From a7d7dbb164712310e2a73d6f8cb57fecb4c59557 Mon Sep 17 00:00:00 2001 From: Miravia Connector Bot Date: Thu, 17 Jul 2025 08:11:23 +0200 Subject: [PATCH] Fix image upload structure for Miravia API compliance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 Bug Fixes: - Fixed product image structure to match Miravia API requirements - Updated MiraviaProduct.php getData() method to wrap images in {"Image": [...]} format - Updated MiraviaCombination.php getData() method to wrap SKU images properly - Resolved error "[4224] The Main image of the product is required" 📋 Changes: - Modified getData() methods to transform flat image arrays to nested structure - Product images: images[] → Images: {"Image": [...]} - SKU images: images[] → Images: {"Image": [...]} - Maintains backward compatibility for empty image arrays 🎯 Impact: - Product uploads will now pass Miravia's image validation - Both product-level and SKU-level images properly formatted - Complies with official Miravia API documentation structure 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude --- .gitignore | 50 + connector-miravia/README.md | 32 + .../assets/css/miravia-admin.css | 148 ++ connector-miravia/assets/img/icon.png | Bin 0 -> 431 bytes .../assets/img/miravia-logo-new.svg | 1 + connector-miravia/assets/js/products.js | 448 +++++ connector-miravia/classes/class.api.php | 495 +++++ .../classes/class.categories.php | 66 + connector-miravia/classes/class.core.php | 775 ++++++++ connector-miravia/classes/class.db.php | 77 + connector-miravia/classes/class.general.php | 11 + connector-miravia/classes/class.log.php | 60 + .../classes/class.miravia.base.php | 120 ++ connector-miravia/classes/class.order.php | 128 ++ .../classes/class.product copy.php | 125 ++ connector-miravia/classes/class.product.php | 211 ++ connector-miravia/classes/class.ui.php | 11 + .../classes/shared/MiraviaCategory.php | 90 + .../classes/shared/MiraviaCombination.php | 59 + .../classes/shared/MiraviaFeed.php | 243 +++ .../classes/shared/MiraviaFilter.php | 134 ++ .../classes/shared/MiraviaLang.php | 63 + .../classes/shared/MiraviaLink.php | 541 +++++ .../classes/shared/MiraviaProduct.php | 186 ++ .../classes/tables/class.table.php | 173 ++ connector-miravia/connector-miravia.php | 357 ++++ .../jquery.jui_filter_rules.bs.min.css | 181 ++ .../jquery.jui_filter_rules.min.css | 5 + .../jquery.jui_filter_rules.min.js | 1747 +++++++++++++++++ .../lib/filter_rules/localization/el.min.js | 4 + .../lib/filter_rules/localization/en.min.js | 4 + .../lib/filter_rules/localization/es.min.js | 55 + .../lib/filter_rules/localization/tr.min.js | 55 + connector-miravia/lib/filter_rules_miravia.js | 235 +++ .../lib/fontawesome-6.1.2.all.min.css | 6 + .../lib/fontawesome-6.1.2.all.min.js | 6 + connector-miravia/lib/select2.min.css | 1 + connector-miravia/lib/select2.min.js | 2 + connector-miravia/lib/sweetalert2.min.js | 6 + .../views/metabox/miravia-order.php | 33 + .../views/metabox/miravia-product.php | 43 + connector-miravia/views/pages/accounts.php | 38 + connector-miravia/views/pages/add-rule.php | 109 + connector-miravia/views/pages/attributes.php | 65 + connector-miravia/views/pages/brands.php | 10 + connector-miravia/views/pages/categories.php | 45 + .../views/pages/configuration.php | 175 ++ .../views/pages/create_profile.php | 81 + connector-miravia/views/pages/dashboard.php | 29 + connector-miravia/views/pages/detail-job.php | 49 + .../views/pages/edit_profile.php | 208 ++ connector-miravia/views/pages/edit_rule.php | 129 ++ connector-miravia/views/pages/jobs.php | 45 + connector-miravia/views/pages/orders.php | 63 + .../views/pages/product_test.php | 7 + connector-miravia/views/pages/products.php | 72 + .../views/pages/products_remote.php | 58 + connector-miravia/views/pages/profiles.php | 39 + connector-miravia/views/pages/rules.php | 37 + connector-miravia/views/settings.php | 11 + deploy_miravia.sh | 244 +++ 61 files changed, 8501 insertions(+) create mode 100644 .gitignore create mode 100644 connector-miravia/README.md create mode 100644 connector-miravia/assets/css/miravia-admin.css create mode 100644 connector-miravia/assets/img/icon.png create mode 100644 connector-miravia/assets/img/miravia-logo-new.svg create mode 100644 connector-miravia/assets/js/products.js create mode 100644 connector-miravia/classes/class.api.php create mode 100644 connector-miravia/classes/class.categories.php create mode 100644 connector-miravia/classes/class.core.php create mode 100644 connector-miravia/classes/class.db.php create mode 100644 connector-miravia/classes/class.general.php create mode 100644 connector-miravia/classes/class.log.php create mode 100644 connector-miravia/classes/class.miravia.base.php create mode 100644 connector-miravia/classes/class.order.php create mode 100644 connector-miravia/classes/class.product copy.php create mode 100644 connector-miravia/classes/class.product.php create mode 100644 connector-miravia/classes/class.ui.php create mode 100644 connector-miravia/classes/shared/MiraviaCategory.php create mode 100644 connector-miravia/classes/shared/MiraviaCombination.php create mode 100644 connector-miravia/classes/shared/MiraviaFeed.php create mode 100644 connector-miravia/classes/shared/MiraviaFilter.php create mode 100644 connector-miravia/classes/shared/MiraviaLang.php create mode 100644 connector-miravia/classes/shared/MiraviaLink.php create mode 100644 connector-miravia/classes/shared/MiraviaProduct.php create mode 100644 connector-miravia/classes/tables/class.table.php create mode 100644 connector-miravia/connector-miravia.php create mode 100644 connector-miravia/lib/filter_rules/jquery.jui_filter_rules.bs.min.css create mode 100644 connector-miravia/lib/filter_rules/jquery.jui_filter_rules.min.css create mode 100644 connector-miravia/lib/filter_rules/jquery.jui_filter_rules.min.js create mode 100644 connector-miravia/lib/filter_rules/localization/el.min.js create mode 100644 connector-miravia/lib/filter_rules/localization/en.min.js create mode 100644 connector-miravia/lib/filter_rules/localization/es.min.js create mode 100644 connector-miravia/lib/filter_rules/localization/tr.min.js create mode 100644 connector-miravia/lib/filter_rules_miravia.js create mode 100644 connector-miravia/lib/fontawesome-6.1.2.all.min.css create mode 100644 connector-miravia/lib/fontawesome-6.1.2.all.min.js create mode 100644 connector-miravia/lib/select2.min.css create mode 100644 connector-miravia/lib/select2.min.js create mode 100644 connector-miravia/lib/sweetalert2.min.js create mode 100644 connector-miravia/views/metabox/miravia-order.php create mode 100644 connector-miravia/views/metabox/miravia-product.php create mode 100644 connector-miravia/views/pages/accounts.php create mode 100644 connector-miravia/views/pages/add-rule.php create mode 100644 connector-miravia/views/pages/attributes.php create mode 100644 connector-miravia/views/pages/brands.php create mode 100644 connector-miravia/views/pages/categories.php create mode 100644 connector-miravia/views/pages/configuration.php create mode 100644 connector-miravia/views/pages/create_profile.php create mode 100644 connector-miravia/views/pages/dashboard.php create mode 100644 connector-miravia/views/pages/detail-job.php create mode 100644 connector-miravia/views/pages/edit_profile.php create mode 100644 connector-miravia/views/pages/edit_rule.php create mode 100644 connector-miravia/views/pages/jobs.php create mode 100644 connector-miravia/views/pages/orders.php create mode 100644 connector-miravia/views/pages/product_test.php create mode 100644 connector-miravia/views/pages/products.php create mode 100644 connector-miravia/views/pages/products_remote.php create mode 100644 connector-miravia/views/pages/profiles.php create mode 100644 connector-miravia/views/pages/rules.php create mode 100644 connector-miravia/views/settings.php create mode 100755 deploy_miravia.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e9b2b0c --- /dev/null +++ b/.gitignore @@ -0,0 +1,50 @@ +# WordPress +wp-config.php +wp-content/uploads/ +wp-content/cache/ +wp-content/backup-db/ +wp-content/advanced-cache.php +wp-content/wp-cache-config.php +wp-content/plugins/hello.php +wp-content/plugins/akismet/ +.htaccess + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# IDE files +.idea/ +.vscode/ +*.swp +*.swo +*~ + +# Logs +*.log +error_log +debug.log +logs/ + +# Temporary files +*.tmp +*.temp +*.bak +*.backup + +# Node modules (if any) +node_modules/ +npm-debug.log* + +# Composer +vendor/ +composer.lock + +# Plugin specific +*.zip +data/ diff --git a/connector-miravia/README.md b/connector-miravia/README.md new file mode 100644 index 0000000..966bb50 --- /dev/null +++ b/connector-miravia/README.md @@ -0,0 +1,32 @@ +=== Woo for Miravia === +Contributors: wecommsolutions +Tags: miravia, woocommerce miravia, alibaba, aliexpress +Requires at least: 5.0 +Tested up to: 6.3 +Requires PHP: 5.0 +Stable tag: 1.0.0 +License: GPLv2 +License URI: https://www.gnu.org/licenses/gpl-2.0.html + +== Description == + +Connect your store with Miravia, upload your products to Miravia and Download orders. + +== Installation == + +* Upload the add-in folder to the "/ wp-content / plugins /" directory or install the add-in directly from the WordPress add-ons screen. +* Activate the plugin from the «Add-ons» screen in WordPress +* Enjoy! + +== FAQ == + +Visit wecomm.es + +== Changelog == + += 1.0.0 = +* Initial version + +== Localization == + +English (US). diff --git a/connector-miravia/assets/css/miravia-admin.css b/connector-miravia/assets/css/miravia-admin.css new file mode 100644 index 0000000..1d95328 --- /dev/null +++ b/connector-miravia/assets/css/miravia-admin.css @@ -0,0 +1,148 @@ +/* +PRIMARY: #4c45e6 +accent: #6ee786 +*/ + +.showHover { + visibility: hidden; +} + +tr:hover .showHover { + visibility: visible; +} + +span.minidate { + font-size: 10px; + line-height: 10px; +} +/* +th#miravia_data { + width: 180px; +} */ + +td.miravia_data.column-miravia_data { + width: 200px !important; +} + +th#miravia_data { + width: 200px !important; +} +table.table-view-list.toplevel_page_miravia_settings { + table-layout: inherit !important; +} +span.created_via { + float: right; + font-size: 12px; + color: #08a1de; +} +.btn_config { + text-decoration: none; + color: #4c45e6; + border: 1px solid #dfdfdf; + background: #dfdfdf; + width: 45%; + padding: 0.5rem; + float: left; + margin: 0.5rem; + cursor: pointer; + height: 140px; + display: block; + border-radius: 10px; + transition: all 0.5s ease; +} +.btn_config:hover { + background-color: #b0aed2; + /* color: #FFF; */ +} + +.btn_config h4 { + color: #4c45e6; + font-size: 30px; + margin: 0; + font-weight: bold; + text-align: center; +} + +.btn_config:hover h4 { + /* color: #FFF */ +} + +.stats { + /* border: 1px solid #4c45e6; */ + padding: 0.5rem; + margin: 0.5rem; + height: 140px; +} + +.stats-1 { + width: 23%; + float: left; +} +.stats-2 { + width: 48%; + float: left; +} +.stats-3 { + width: 73%; + float: left; +} + +.stats-4 { + clear: both; +} +.wrap.miravia-pane { + max-width: 1024px; + margin: auto; +} +.miravia-pane .description { + font-size: 10px; + display: block; + font-weight: lighter; +} +ul.miravia_categories_select { + background-color: '#FFF'; +} +ul.miravia_categories_select ul.children { + margin-left: 25px; +} + +.region_config_dashboard { + max-width: 1024px; + margin: auto; + left: 0; + right: 0; + position: relative; + display: block; +} + +/* tabs */ +a.mv-bt-tab { + padding: 10px; + display: block; + border-radius: 4px 4px 0 0; + border: 1px solid #CCC; + border-bottom: 0px solid; + text-decoration: none; + color: #333; + font-weight: bold; + outline: none; +} + +.mv-tab-nav { + border-bottom: 1px solid #CCC; +} + +.mv-tab-nav li { + margin: 0; +} + +a.mv-bt-tab.active { + background: #CCC; +} + +.mv-tab { + display:none; +} +.mv-tab-active { + display:block; +} \ No newline at end of file diff --git a/connector-miravia/assets/img/icon.png b/connector-miravia/assets/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ae60a57a1829a086d8747c23cff43f694f88334f GIT binary patch literal 431 zcmV;g0Z{&lP)l+hj~b3;n8h9( z#629xk~U(Pz+Sw;dmP3*p5g<}{Kp(n@>G(!Bqy7{-AOJbS)b%VlI5LmtkD|547Ot@ zUNye&Sc9*4iPN~!wy>p^Tl(JA3oiJDxtin#_G48iFp0OgQyudIX7amqixsts7nte` zyuu?0$YU$5wOMj|JC-@lWMi#D#^Vo>9P1bF7 zpgU^mn`?_53V*s?-%OH2L#}Z&$?YVQ&EKgcS6kB7Bu|p893rwI$!wC<)xKL|+Dm+m zN8Nr0;0x~KL~ZZqLd<|n50gyPvd4OFJjtyjACv4W{BDRX%CK(YQ_WJ2r$e#Jm6i=n Zz+ZkFX;qvjo#p@l002ovPDHLkV1k1#&Ab2r literal 0 HcmV?d00001 diff --git a/connector-miravia/assets/img/miravia-logo-new.svg b/connector-miravia/assets/img/miravia-logo-new.svg new file mode 100644 index 0000000..b0d5989 --- /dev/null +++ b/connector-miravia/assets/img/miravia-logo-new.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/connector-miravia/assets/js/products.js b/connector-miravia/assets/js/products.js new file mode 100644 index 0000000..f4e483e --- /dev/null +++ b/connector-miravia/assets/js/products.js @@ -0,0 +1,448 @@ +jQuery(document).ready(function($) { + + (function($) { + + var Defaults = $.fn.select2.amd.require('select2/defaults'); + + $.extend(Defaults.defaults, { + searchInputPlaceholder: '' + }); + + var SearchDropdown = $.fn.select2.amd.require('select2/dropdown/search'); + + var _renderSearchDropdown = SearchDropdown.prototype.render; + + SearchDropdown.prototype.render = function(decorated) { + + // invoke parent method + var $rendered = _renderSearchDropdown.apply(this, Array.prototype.slice.apply(arguments)); + + this.$search.attr('placeholder', this.options.get('searchInputPlaceholder')); + + return $rendered; + }; + + })(window.jQuery); + + $(".search-select-miravia").select2({ width: '100%', searchInputPlaceholder: 'Search Miravia Category' }) + var select2Element = $(".search-select-miravia-brand"); + + var options = { + searchInputPlaceholder: 'Search Brand', + width: '100%', + ajax: { + url: MIRAVIA_DATA_JAVASCRIPT.adminAjaxURL+'?action=miravia_get_brands', + dataType: 'json', + cache: true, + data: function (params) { + return { + brand_name: params.term, + }; + }, + processResults: function (data) { + final_data = { + results: $.map(data, function (item) { + return { + text: item.brand_name, + id: item.brand_name + } + }) + }; + console.log(final_data) + delete options.ajax; + options.data = final_data.results; + select2Element.select2( options ).select2( 'open' ); + return final_data; + }, + success: function( data ) { + + + }, + } + }; + + select2Element.select2( options ); + + $(document).on("click", "a.sendProductsMiravia_BACK", function(){ + var id = $(this).attr("data-id"); + var control = $(".miravia_controls[data-id='"+id+"']"); + var preHTML = control.html(); + control.html("Uploading..."); + + $.ajax({ + method : "post", + url : MIRAVIA_DATA_JAVASCRIPT.adminAjaxURL+'?action=miravia_upload_product', + data : { + id: id + }, + dataType: 'JSON', + error: function(response){ + control.html(preHTML); + }, + success: function(response) { + if(response['error']) { + alert(response['message']); + return; + } + + control.html("View | Update"); + } + }) + }); + + $(document).on("click", "a.updateProduct", function(){ + var id = $(this).attr("data-id"); + var control = $(".miravia_controls[data-id='"+id+"']"); + var preHTML = control.html(); + control.html("Updating..."); + + $.ajax({ + method : "post", + url : MIRAVIA_DATA_JAVASCRIPT.adminAjaxURL+'?action=miravia_update_product', + data : { + id: id + }, + dataType: 'JSON', + error: function(response){ + control.html(preHTML); + }, + success: function(response) { + if(response['error']) { + alert(response['message']); + return; + } + control.html(preHTML); + } + }) + }); + + $(document).on("click", "a.viewProduct, button.viewProduct", function(){ + var id = $(this).attr("data-id"); + window.open('https://www.miravia.es/p/i'+id+'.html', '_blank'); + }); + + + $(document).on("click", ".connectProductRemote", function(){ + var control = $(this); + + if(control.attr('disabled') == 'disabled') { + return; + } + var id = $(this).attr("data-id"); + var sku = $(this).attr("data-sku"); + var preHTML = control.html(); + var preColor = control.css('color'); + control.text("Connecting..."); + $.ajax({ + method : "post", + url : MIRAVIA_DATA_JAVASCRIPT.adminAjaxURL+'?action=miravia_connect_product', + data : { + id_remote: id, + sku: sku + }, + dataType: 'JSON', + error: function(response){ + alert('Error, please contact with support'); + control.html(preHTML); + Swal.close(); + }, + success: function(response) { + if(response['ok']) { + control.attr('disabled', 'disabled').html('Connected').css('color', 'green').css('border-color', 'green'); + }else{ + if(response['alert']) { + alert(response['alert']); + control.html(preHTML).css('color', preColor).css('border-color', preColor); + }else{ + control.html('No Profile / Product').css('color', 'red').css('border-color', 'red'); + setTimeout(() => { + control.html(preHTML).css('color', preColor).css('border-color', preColor); + }, 5000); + } + } + } + }) + }); + + $(document).on("click", ".disconnectProduct", function(){ + var id = $(this).attr("data-id"); + var control = $(this); + var preHTML = control.html(); + control.text("Disconnecting..."); + Swal.fire({ + title: 'Disconnecting product...', + html: 'Please wait...', + didOpen: () => { + Swal.showLoading() + $.ajax({ + method : "post", + url : MIRAVIA_DATA_JAVASCRIPT.adminAjaxURL+'?action=disconnect_product_miravia', + data : { + id: id + }, + dataType: 'JSON', + error: function(response){ + alert('Error, please contact with support'); + control.html(preHTML); + Swal.close(); + }, + success: function(response) { + if(response['error']) { + Swal.fire( + 'Error', + response['message'], + 'error' + ) + }else{ + Swal.fire( + 'Success', + 'Product disconnected from Miravia', + 'success' + ) + } + control.html(preHTML); + } + }) + + + }, + }); + }); + + $(document).on("click", ".sendProductsMiravia", function(){ + console.log("ENVIANDO"); + var profile = $(this).attr("data-profile"); + var control = $(this); + var preHTML = control.html(); + control.text("Updating..."); + Swal.fire({ + title: 'Uploading products...', + html: 'Please wait...', + didOpen: () => { + Swal.showLoading() + $.ajax({ + method : "post", + url : MIRAVIA_DATA_JAVASCRIPT.adminAjaxURL+'?action=send_products_miravia', + data : { + profile: profile + }, + dataType: 'JSON', + error: function(response){ + alert('Error, please contact with support'); + control.html(preHTML); + Swal.close(); + }, + success: function(response) { + if(response['error']) { + Swal.fire( + 'Error', + response['message'], + 'error' + ) + }else{ + Swal.fire( + 'Success', + 'Send ' + response.length + ' products to Miravia', + 'success' + ) + } + control.html(preHTML); + } + }) + + + }, + }); + }); + + $(document).on("click",".download_order", function(){ + var id = $(this).attr("data-id"); + var token = $(this).attr("data-token"); + var account_id = $(this).attr("data-account"); + var control = $(this); + var preHTML = control.html(); + control.text("Downloading..."); + Swal.fire({ + title: 'Download order...', + html: 'Please wait...', + didOpen: () => { + Swal.showLoading() + $.ajax({ + method : "post", + url : MIRAVIA_DATA_JAVASCRIPT.adminAjaxURL+'?action=miravia_download_order', + data : { + id: id, + token: token, + account_id: account_id + }, + dataType: 'JSON', + error: function(response){ + control.html(preHTML); + Swal.close(); + }, + success: function(response) { + if(response['error']) { + Swal.fire( + 'Error', + response['message'], + 'error' + ) + return; + } + Swal.close(); + control.html(preHTML); + } + }) + }, + }); + }); + + $(document).on("click",".checkJob", function(){ + var id = $(this).attr("data-id"); + var token = $(this).attr("data-token"); + var control = $(this).closest('tr'); + $(".status_result", control).text('Checking...'); + + Swal.fire({ + title: 'Check Job...', + html: 'Please wait...', + didOpen: () => { + Swal.showLoading() + $.ajax({ + method : "post", + url : MIRAVIA_DATA_JAVASCRIPT.adminAjaxURL+'?action=miravia_check_job', + data : { + id: id, + token: token + }, + dataType: 'JSON', + error: function(response){ + $(".status_result", control).text('Error to check status, please try again'); + Swal.close(); + }, + success: function(response) { + if(response['error']) { + Swal.fire( + 'Error', + response['message'], + 'error' + ) + return; + } + Swal.close(); + $(".status_result", control).text(response['status']); + } + }) + }, + }); + }); + + + $(document).on("click",".cancelJob", function(){ + var id = $(this).attr("data-id"); + var token = $(this).attr("data-token"); + var control = $(this); + var preHTML = control.html(); + if(confirm('You want cancel this job?')) { + control.text("Checking..."); + Swal.fire({ + title: 'Cancel Job...', + html: 'Please wait...', + didOpen: () => { + Swal.showLoading() + $.ajax({ + method : "post", + url : MIRAVIA_DATA_JAVASCRIPT.adminAjaxURL+'?action=miravia_cancel_job', + data : { + id: id, + token: token + }, + dataType: 'JSON', + error: function(response){ + control.html(preHTML); + Swal.close(); + }, + success: function(response) { + control.html(preHTML); + if(response['error']) { + Swal.fire( + 'Error', + response['message'], + 'error' + ) + }else{ + Swal.fire( + 'Success', + 'Job Cancel Success', + 'success' + ) + } + } + }) + }, + }); + } + }); + + + $(document).on("click",".mv-bt-tab", function(){ + var tab = $(this).attr("data-tab"); + $(".mv-bt-tab").removeClass("active"); + $(this).addClass("active"); + $(".mv-tab").removeClass("mv-tab-active"); + + $(".mv-tab[data-tab='"+tab+"']").addClass('mv-tab-active'); + }); + + $(document).on("click","#packOrderButton", function(){ + var id = $(this).attr("data-id"); + console.log("Packed Order", id); + $(this).text('Waiting...').prop('disabled', true); + $.ajax({ + method : "post", + url : MIRAVIA_DATA_JAVASCRIPT.adminAjaxURL+'?action=miravia_packed_order', + data : { + id: id, + }, + dataType: 'JSON', + error: function(response){ + console.log(response); + $(this).text('Pack Order').prop('disabled', false); + }, + success: function(response) { + if(response['error']) { + alert(response['message']); + $(this).text('Pack Order').prop('disabled', false); + return; + } + window.location.reload(); + } + }) + }); + + $(document).on("click", ".miraviaprintLabel", function() { + var id = $(this).attr("data-id"); + var package_id = $(this).attr("data-package"); + + $.ajax({ + method : "post", + url : MIRAVIA_DATA_JAVASCRIPT.adminAjaxURL+'?action=miravia_print_label', + data : { + id: id, + package_id: package_id, + }, + dataType: 'JSON', + error: function(response){ + + }, + success: function(response) { + if(response && response.data) { + if(response.data.pdf_url) { + console.log(response.data); + window.open(response.data.pdf_url, '_blank'); + } + } + } + }) + }); +}); \ No newline at end of file diff --git a/connector-miravia/classes/class.api.php b/connector-miravia/classes/class.api.php new file mode 100644 index 0000000..dce3e9f --- /dev/null +++ b/connector-miravia/classes/class.api.php @@ -0,0 +1,495 @@ + false); + + $sku = sanitize_text_field($_POST['sku']); + + $profile_id = MiraviaCore::get_profile_by_product($sku); + LOG::add("Profile encontrado {$profile_id} -> {$sku}"); + if($profile_id) { + $id_remote = sanitize_text_field($_POST['id_remote']); + $id_local = wc_get_product_id_by_sku($sku); + $existe = MiraviaCore::get_product_miravia($id_local); + + if(!$existe) { + $_product = wc_get_product($id_local); + + //Save product data + $wpdb->insert($wpdb->prefix.'miravia_products', array( + 'id_woocommerce' => $id_local, + 'sku' => $_product->get_sku() ?: $id_local, + 'id_miravia' => $id_remote, + 'profile_id' => $profile_id, + 'stock' => $_product->get_regular_price(), + 'price' => $_product->get_regular_price(), + 'sale_price' => $_product->get_sale_price(), + )); + + LOG::add("Conectando producto ({$id_local}) remoto {$sku} con {$id_remote} con el profile {$profile_id}"); + update_post_meta($id_local, '_miravia_product_id', $id_remote); + update_post_meta($id_local, '_miravia_sync_date', time()); + $res['ok'] = true; + }else{ + $res['alert'] = "This product exist"; + } + } + + wp_send_json($res); + } + + function miravia_print_label() { + $id = sanitize_text_field($_POST['id']); + $package_id = sanitize_text_field($_POST['package_id']); + $account_id = get_post_meta($id, '_miravia_account_id', true); + $labelResult = false; + $account = MiraviaCore::get_accounts($account_id); + $link = new MiraviaLink($account['token']); + + if($account_id) { + $labelResult = $link->getShippingLabel($package_id); + } + + wp_send_json($labelResult); + } + + function miravia_get_brands() { + $token = MiraviaCore::get_miravia_account_default(); + if($token) { + $token = $token['token']; + $link = new MiraviaCategory($token); + $brands = $link->getBrands(); + }else{ + $brands = []; + } + + wp_send_json($brands); + } + + function miravia_packed_order(){ + $id = sanitize_text_field($_POST['id']); + $account_id = get_post_meta($id, '_miravia_account_id', true); + $order_miravia_id = get_post_meta($id, '_miravia_order_id', true); + if($account_id) { + $account = MiraviaCore::get_accounts($account_id); + $link = new MiraviaLink($account['token']); + $resultPack = false; + + list($order, $items) = MiraviaCore::get_order_woocommerce($id); + + $resultPack = $link->orderPack($order_miravia_id, array('products' => $items)); + update_post_meta($id, '_miravia_packed_result', $resultPack); + }else{ + LOG::add("{$id} no ha sido importado, no tiene ID de Cuenta", false, 'pack_order'); + LOG::add([$_POST, $account_id], false, 'pack_order'); + + } + + wp_send_json($resultPack); + } + + function miravia_check_job() { + $id = sanitize_text_field($_POST['id']); + if($id) { + $apiKey = sanitize_text_field($_POST['token']); + $link = new MiraviaLink($apiKey); + $result = $link->getFeedInfo($id); + // LOG::add($result, false, 'check_job'); + if($result and $result['result']['processing_status'] == 'DONE') { + foreach($result['response'] as $sku => $value) { + if($value['status'] == 'FAIL') { + if($value['detail']['message']['errorDetail'] and count($value['detail']['message']['errorDetail']) > 0) { + LOG::add('SET JOB Detail' . $id . ' -> ' . $value['detail']['message']['errorDetail'][0]['message'] . ' -- ' . $sku, false, 'check_job'); + MiraviaCore::set_error_product_job($sku, $id, $value['detail']['message']['errorDetail'][0]['message']); + }else{ + LOG::add('SET JOB MSG' . $id . ' -> ' . $value['detail']['message']['errorMsg'] . ' -- ' . $sku, false, 'check_job'); + MiraviaCore::set_error_product_job($sku, $id, $value['detail']['message']['errorMsg']); + } + }else{ + //Controlar los updates + if(!isset($value['id'])) { + $value['id'] = false; + } + MiraviaCore::set_id_miravia_product_job($sku, $id, $value['id']); + } + } + + } + + if($result) { + // MiraviaCore::set_status_job($id, $result['result']['processing_status']); + wp_send_json(array('status' => $result['result']['processing_status'])); + }else{ + wp_send_json(array('status' => false)); + } + } + }function miravia_cancel_job() { + $id = sanitize_text_field($_POST['id']); + if($id) { + $apiKey = sanitize_text_field($_POST['token']); + $link = new MiraviaLink($apiKey); + $result = $link->cancelFeed($id); + LOG::add($result, false, 'result_cancel_job'); + if($result and $result['success']) { + MiraviaCore::clear_job($id); + wp_send_json(array('success' => true)); + }else{ + MiraviaCore::clear_job($id); + wp_send_json(array('error' => true, 'message' => 'You can cancel this job, products unlock locally')); + } + } + } + + function miravia_request_notify() { + MiraviaCore::request_notify(sanitize_text_field($_POST['token']), sanitize_text_field($_POST['message'])); + + } + + function miravia_download_order($id = false, $token = false) { + $id = $id ?: sanitize_text_field($_POST['id']); + $apiKey = $token ?: sanitize_text_field($_POST['token']); + + $existe = MiraviaCore::order_exist($id); + if(count($existe) > 0) { + LOG::add("Order {$id} exists"); + return; + } + $link = new MiraviaLink($apiKey); + $order_from_miravia = $link->getOrder($id); + + $order_from_miravia['data']['account_id'] = sanitize_text_field($_POST['account_id']); + $miravia_order = new MVOrder(); + $miravia_order->create($order_from_miravia['data']); + } + + function miravia_notify(){ + LOG::add('Datos recibidos de notificación', false, 'notify'); + // LOG::add($_REQUEST, false, 'notify'); + if(isset($_GET['seller'])) { + $idPedido = false; + $action = sanitize_text_field($_GET['message']); + + if(sanitize_text_field($_GET['miravia_action']) == 'notify') { + if(str_contains($action, 'neworder-')) { + $idPedido = substr($action, 9); + $action = 'neworder'; + } + + switch($action) { + case 'update_stock': + $profiles = MiraviaCore::get_profiles_by_seller(sanitize_text_field($_GET['seller'])); + foreach($profiles as $k => $p) { + $this->send_stock_price_miravia($p['id'], false); + } + + //update_option('miravia_notify_' . $action . '_in', time()); + break; + case 'neworder': + if($idPedido) { + if(isset($_GET['status']) and sanitize_text_field($_GET['status']) == 'pending') { + $account = MiraviaCore::get_miravia_account_default(sanitize_text_field($_GET['seller']), 'userid'); + $this->miravia_download_order($idPedido, $account['token']); + }else{ + LOG::add("Order status is ".sanitize_text_field($_GET['status'])." => {$idPedido}"); + } + } + break; + default: + LOG::add("Action notify no recognized"); + break; + } + }elseif(sanitize_text_field($_GET['miravia_action']) == 'feed') { + MiraviaCore::procesarFeed(); + }elseif(sanitize_text_field($_GET['miravia_action']) == 'stock_sresync') { + $accounts = MiraviaCore::resync_stock(); + if($accounts) { + foreach($accounts as $a) { + MiraviaCore::request_notify($a['token'], 'update_stock'); + } + } + + } + wp_send_json(array('success' => true), 200); + die(); + } + wp_send_json(array('success' => false), 400); + die(); + } + + function send_products_miravia() { + $profile = sanitize_text_field($_POST['profile']); + LOG::add("Enviando productos del perfil {$profile}"); + if ( !current_user_can( 'manage_woocommerce' ) ) { exit; } + $result = array( + 'id' => 0, + 'error' => false, + 'message' => '' + ); + $accounts = MiraviaCore::accounts_by_profile($profile); + $product = MiraviaCore::get_products_by_profile($profile); + + if($product) { + foreach($accounts as $a) { + //Enviar los productos con cada una de las cuentas de usuario registrados en el profile. + + + //Comprobar el producto si no se ha enviado + // LOG::add("Comprobando producto en job"); + // LOG::add($product); + $productsToSend = array( + 'update' => array(), + 'create' => array() + ); + if($product){ + foreach($product as $k => $p) { + if(MiraviaCore::check_product_onjob($p->id)) { + unset($product[$k]); + }else{ + if($product and $product[$k]->id_miravia != 0 and $product[$k]->id_miravia != '' and $product[$k]->id_miravia != '0') { + $product[$k]->created = 1; + array_push($productsToSend['update'], $product[$k]); + }else{ + array_push($productsToSend['create'], $product[$k]); + } + } + } + } + //Check after check on job + + // LOG::add("PRODUCTOS DESPUES"); + // LOG::add($product); + if(count($product) == 0) { + wp_send_json(array('error' => true, 'message' => 'All products is on job, please wait to complete this before send again.')); + wp_die(); + } + + if(count($productsToSend['create']) > 0) { + $link = new MiraviaLink($a['token']); + $feed = new MiraviaFeed(); + $feed->setProducts($productsToSend['create']); + + //Apply Rules + $feed = MiraviaCore::applyFilter($feed, $a['id'], $profile); + + $productJson = $feed->getJsonCreate(); + if(MIRAVIA_DEBUG == '0') { + $result = $link->sendFeed($productJson); + + if(isset($result['feed_result']) and $result['feed_result']['success']) { + MiraviaCore::set_job_product(array_column($productsToSend['create'], 'id'), $profile, $result['feed_result']['result']); + } + } + + } + if(count($productsToSend['update']) > 0) { + $link = new MiraviaLink($a['token']); + $feed = new MiraviaFeed(); + $feed->setProducts($productsToSend['update']); + + //Apply Rules + $feed = MiraviaCore::applyFilter($feed, $a['id'], $profile); + + $productJsonUpdate = $feed->getJsonUpdate(); + if(MIRAVIA_DEBUG == '0') { + $result = $link->sendFeed($productJsonUpdate, 'update'); + + if(isset($result['feed_result']) and $result['feed_result']['success']) { + MiraviaCore::set_job_product(array_column($productsToSend['update'], 'id'), $profile, $result['feed_result']['result']); + } + } + } + if(MIRAVIA_DEBUG == '1') { + wp_send_json(array('error' => true, 'message' => 'Debug Active', 'update' => $productJsonUpdate, 'create' => $productJson, 'initData' => $productsToSend)); + die(); + } + LOG::add("Enviando " . count($product) . " productos con token {$a['token']}"); + LOG::add($result); + + + } + } + wp_send_json($product); + wp_die(); + } + + function send_stock_price_miravia($profile = false, $returnValue = true) { + if(!$profile) { + $profile = sanitize_text_field($_POST['profile']); + } + LOG::add("Enviando productos del perfil {$profile}"); + if ($returnValue and !current_user_can( 'manage_woocommerce' ) ) { exit; } + $result = array( + 'id' => 0, + 'error' => false, + 'message' => '' + ); + $accounts = MiraviaCore::accounts_by_profile($profile); + $product = MiraviaCore::get_products_by_profile($profile, true); + $isOnlyStock = get_option('miravia_only_stock', '0') == '1'; + if($product) { + foreach($accounts as $a) { + + //Enviar los productos con cada una de las cuentas de usuario registrados en el profile. + + + //Comprobar el producto si no se ha enviado + foreach($product as $k => $p) { + if(MiraviaCore::check_product_onjob($p->id)) { + unset($product[$k]); + } + } + //Check after check on job + if(count($product) == 0) { + wp_send_json(array('error' => true, 'message' => 'All products is on job, please wait to complete this before send again.')); + wp_die(); + } + + $link = new MiraviaLink($a['token']); + $feed = new MiraviaFeed(); + $feed->setProducts($product); + + //Apply Rules + $feed = MiraviaCore::applyFilter($feed, $a['id'], $profile); + $stockJson = $feed->getJsonUpdateStock($isOnlyStock); + + if(MIRAVIA_DEBUG == '1') { + wp_send_json($stockJson); + die(); + } + + $result = $link->updateStock($stockJson); + + if(isset($result['feed_result']) and $result['feed_result']['success']) { + MiraviaCore::set_job_product(array_column($product, 'id'), $profile, $result['feed_result']['result']); + } + } + } + + if($returnValue) { + wp_send_json($product); + wp_die(); + } + } + + function miravia_create_profile() { + $apiKey = sanitize_text_field($_REQUEST['api_key']); + $link = new MiraviaLink($apiKey); + $sellerInfo = $link->getSellerInfo(admin_url('admin-ajax.php?action=miravia_notify')); + if($sellerInfo) { + if(!MiraviaCore::get_accounts($sellerInfo['seller_id'], 'userid')) { + $profile = MiraviaCore::add_account(array( + 'name' => $sellerInfo['seller_name'], + 'token' => $apiKey, + 'userid' => $sellerInfo['seller_id'], + 'lang' => $sellerInfo['country'], + 'email' => $sellerInfo['email'], + 'config' => '{short_code: "'.$sellerInfo['short_code'].'"}', + )); + } + } + wp_redirect( admin_url('admin.php?page=miravia_settings&subpage=accounts') ); + wp_send_json(array('ok' => true)); + } + + function disconnect_product_miravia(){ + if ( !current_user_can( 'manage_woocommerce' ) ) { exit; } + $id = $_POST['id']; + LOG::add("Desconectando producto {$id} de miravia"); + update_post_meta($id, '_miravia_product_id', 0); + update_post_meta($id, '_miravia_sync_date', 0); + wp_send_json(array('ok' => true)); + } + + function miravia_authorize() { + LOG::add("Solicitando autorización a Miravia"); + $link = new MiraviaLink(); + $register_link = $link->getRegisterUrl(admin_url('admin-ajax.php?action=miravia_create_profile')); + LOG::add("Register link is " . $register_link); + wp_redirect( $register_link ); + wp_send_json(array('ok' => true)); + } + + function miravia_upload_product() { + if ( !current_user_can( 'manage_woocommerce' ) ) { exit; } + $result = array( + 'id' => 0, + 'error' => false, + 'message' => '' + ); + $id = sanitize_text_field($_POST['id']); + + $product = new MVProduct($id, 2); + wp_send_json($product); + wp_die(); + $response = $product->send(); + + if(isset($response['item_id'])) { + //Producto subido + update_post_meta($id, '_miravia_product_id',$response['item_id']); + update_post_meta($id, '_miravia_sync_date',time()); + $result['id'] = $response['item_id']; + }else{ + $result['error'] = true; + $result['message'] = $response['errors'][0]['message']; + } + wp_send_json($result); + wp_die(); + } + + function miravia_update_product() { + if ( !current_user_can( 'manage_woocommerce' ) ) { exit; } + $result = array( + 'id' => 0, + 'error' => false, + 'message' => '' + ); + $id = sanitize_text_field($_POST['id']); + + $product = new MVProduct($id); + + $response = $product; + if(is_array($response) and count($response) == 0) { + //Producto subido + update_post_meta($id, '_miravia_sync_date',time()); + $result['id'] = $id; + }else{ + $result['error'] = true; + $result['message'] = $response['errors'][0]['message']; + } + wp_send_json($result); + wp_die(); + } + } + + $APIMIRAVIA = new APIMIRAVIA(); +} diff --git a/connector-miravia/classes/class.categories.php b/connector-miravia/classes/class.categories.php new file mode 100644 index 0000000..962749d --- /dev/null +++ b/connector-miravia/classes/class.categories.php @@ -0,0 +1,66 @@ +lang = $lang; + } + } + + function get_category_tree() { + global $MIRAVIAWOO; + + $categories = $MIRAVIAWOO->client->get('/category/tree/get', array( + 'language_code' => $this->lang + )); + + return $categories; + } + + + + function get_attributes($id) { + global $MIRAVIAWOO; + + $attributes = $MIRAVIAWOO->client->get('/category/attributes/get', array( + 'primary_category_id' => $id, + 'language_code' => $this->lang + )); + + return $attributes; + } + + function get_input_type_attr($attr, $args = array('value' => '')) { + $result = 'Esta propiedad no puede ser establecida por defecto'; + if($attr['input_type'] == 'enumInput' or $attr['input_type'] == 'singleSelect' or $attr['input_type'] == 'multiSelect') { + + if(isset($attr['options'])) { + $result = ""; + }else{ + $result = ""; + } + }elseif($attr['input_type'] == 'numeric') { + $result = ""; + }elseif($attr['input_type'] == 'text') { + $result = ""; + }elseif($attr['input_type'] == 'richText') { + $result = ""; + } + + return esc_html($result); + } + } +} \ No newline at end of file diff --git a/connector-miravia/classes/class.core.php b/connector-miravia/classes/class.core.php new file mode 100644 index 0000000..5bd7bf6 --- /dev/null +++ b/connector-miravia/classes/class.core.php @@ -0,0 +1,775 @@ + '', + 'token' => '', + 'userid' => '', + 'lang' => '', + 'email' => '', + 'config' => '{}', + ); + + $args = wp_parse_args( $args, $default ); + if($args['token'] == '') { + return false; + } + + $wpdb->insert($wpdb->prefix.'miravia_accounts',$args); + $my_id = $wpdb->insert_id; + return $my_id; + } + + static function delete_account($id = false) { + global $wpdb; + if($id and current_user_can( 'manage_options' )) { + return $wpdb->delete($wpdb->prefix.'miravia_accounts', array('id' => $id)); + } + return false; + } + + static function delete_profile($id = false) { + global $wpdb; + if($id and current_user_can( 'manage_options' )) { + return $wpdb->delete($wpdb->prefix.'miravia_profiles', array('id' => $id)); + } + return false; + } + + static function delete_rule($id = false) { + global $wpdb; + if($id and current_user_can( 'manage_options' )) { + return $wpdb->delete($wpdb->prefix.'miravia_rules', array('id' => $id)); + } + return false; + } + + + static function debug($v, $json = true) { + if($json) { + die(json_encode(($v))); + } + die("
".print_r($v, true)."
"); + } + + static function add_profile($args) { + global $wpdb; + $default = array( + 'name' => '', + 'accounts_id' => '', + 'categories' => '', + 'miravia_category' => '', + 'config' => '{}', + ); + + $args = wp_parse_args( $args, $default ); + + $wpdb->insert($wpdb->prefix.'miravia_profiles',$args); + $my_id = $wpdb->insert_id; + return $my_id; + } + + + static function request_notify($apiKey, $message, $customSeconds = false){ + $secondsNotify = !$customSeconds ? get_option('miravia_delay_time', 300) : $customSeconds; + $notify_actual = intval(get_option('miravia_notify_' . $message . '_in', 0)); + $time_lost = ($notify_actual + ($secondsNotify * 1.1)); + $time_now = time(); + if($notify_actual >= 0 and $time_now < $time_lost ) { + LOG::add("El notify actual está establecido y es superior a {$time_now} > {$time_lost}"); + return -1; + } + LOG::add("Estableciendo info notify {$secondsNotify}"); + update_option('miravia_notify_' . $message . '_in', time()); + $link = new MiraviaLink($apiKey); + $result = $link->subscribe($secondsNotify, $message); + if($result) { + return true; + }else{ + return false; + } + } + + static function add_rule($args) { + global $wpdb; + $default = array( + 'name_rule' => 'No name', + 'accounts' => 0, + 'profile_id' => 0, + 'rules_json' => '[]', + 'action_json' => '[]' + ); + + $args = wp_parse_args( $args, $default ); + + $wpdb->insert($wpdb->prefix.'miravia_rules',$args); + LOG::add($wpdb->last_error); + $my_id = $wpdb->insert_id; + return $my_id; + } + + static function check_product_onjob($product) { + global $wpdb; + $check = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}miravia_products WHERE id_woocommerce = {$product}"); + LOG::add("Comprobando si el producto {$product} esta en job {$check->status_text}"); + if($check->status_text == 'IN_QUEUE') { + return true; + } + + return false; + } + + static function update_rule($args, $id) { + global $wpdb; + $default = array( + 'name_rule' => 'No name', + 'accounts' => 0, + 'profile_id' => 0, + 'rules_json' => '[]', + 'action_json' => '[]' + ); + + $args = wp_parse_args( $args, $default ); + if($id) { + $wpdb->update($wpdb->prefix.'miravia_rules',$args, $id); + return $id; + } + return false; + } + + static function update_profile($args, $id = false) { + global $wpdb; + if($id) { + $wpdb->update($wpdb->prefix.'miravia_profiles',$args, $id); + } + return $id; + } + + static function get_products_by_profile($profile = false, $need = false) { + if(!$profile) { + return false; + } + $profile = self::get_profiles($profile); + + $args = array( + 'posts_per_page' => -1, + 'tax_query' => array( + array( + 'taxonomy' => 'product_cat', + 'field' => 'id', + 'terms' => array_map('intval', explode(',', $profile['categories'])), + 'operator' => 'IN', + 'include_children' => false + ) + ), + 'post_type' => 'product', + ); + + if($need) { + $args['meta_query'] = array( + array( + 'key' => '_miravia_need_update', + 'compare' => 'EXISTS' + ), + array( + 'key' => '_miravia_need_update', + 'compare' => '!=', + 'value' => '0' + ) + ); + } + $saved = array(); + + $products = new WP_Query($args); + if($products->have_posts()) { + + //Preparare products + foreach($products->posts as $p) { + $prod = new MVProduct($p->ID, $profile); + $pro = $prod->getData(); + if($pro) { + $saved[] = $pro; + } + } + return $saved; + } + return false; + } + + static function accounts_by_profile($profile) { + global $wpdb; + $profile = self::get_profiles($profile); + if($profile) { + return $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}miravia_accounts WHERE id IN({$profile['accounts_id']})", ARRAY_A ); + } + + return []; + } + + static function get_local_products($page = 1, $limit = 20) { + global $wpdb; + $ofset = ($limit * $page) - $limit; + $query = "SELECT p.*, + IFNULL(COUNT(pw.ID), 0) as variationsTotal, + pp.post_title as `name` + FROM {$wpdb->prefix}miravia_products AS p + LEFT JOIN {$wpdb->prefix}posts AS pp ON pp.ID = p.id_woocommerce + LEFT JOIN {$wpdb->prefix}posts AS pw ON pw.post_parent = p.id_woocommerce AND pw.post_type = 'product_variation' + GROUP BY p.ID + LIMIT {$ofset},{$limit}"; + + return $wpdb->get_results( $query, ARRAY_A ); + } + + static function get_profiles($id = false) { + global $wpdb; + if($id) { + return $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}miravia_profiles WHERE id = '{$id}'", ARRAY_A ); + } + $profiles = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}miravia_profiles", ARRAY_A ); + if($profiles) { + foreach($profiles as &$prof){ + $prof['sync'] = self::get_products_by_profile_total($prof['categories']); + } + + return $profiles; + } + + return []; + } + + static function get_products_by_profile_total($categories) { + global $wpdb; + if($categories == "") { + return "No categories selected"; + } + + $created = (array) $wpdb->get_row("SELECT COUNT(DISTINCT p.ID) AS total_created + FROM {$wpdb->prefix}posts p + INNER JOIN {$wpdb->prefix}term_relationships tr ON p.ID = tr.object_id + INNER JOIN {$wpdb->prefix}term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id + INNER JOIN {$wpdb->prefix}terms t ON tt.term_id = t.term_id + WHERE tt.taxonomy = 'product_cat' + AND t.term_id IN ({$categories})"); + + $sync = (array) $wpdb->get_row("SELECT COUNT(DISTINCT mp.id_woocommerce) AS total_sync + FROM {$wpdb->prefix}posts p + INNER JOIN {$wpdb->prefix}term_relationships tr ON p.ID = tr.object_id + INNER JOIN {$wpdb->prefix}term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id + INNER JOIN {$wpdb->prefix}terms t ON tt.term_id = t.term_id + INNER JOIN {$wpdb->prefix}miravia_products mp ON p.ID = mp.id_woocommerce AND mp.id_miravia != 0 + WHERE tt.taxonomy = 'product_cat' + AND t.term_id IN ({$categories})"); + // MiraviaCore::debug($created); + if($sync) { + $string = "{$sync['total_sync']} / "; + }else{ + $string = "0 /"; + } + if($created) { + $string .= $created['total_created']; + }else{ + $string .= "0"; + } + + return $string; + } + + static function get_profiles_by_seller($account) { + global $wpdb; + return $wpdb->get_results("SELECT + p.id + FROM + {$wpdb->prefix}miravia_profiles AS p + LEFT JOIN {$wpdb->prefix}miravia_accounts AS ma ON ma.id = p.accounts_id + WHERE + ma.userid = '{$account}'", ARRAY_A ); + } + + static function get_rules($id = false, $customWhere = false) { + + global $wpdb; + if($id) { + return $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}miravia_rules WHERE id = '{$id}'", ARRAY_A ); + }else{ + if($customWhere) { + return $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}miravia_rules WHERE {$customWhere}", ARRAY_A ); + } + } + return $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}miravia_rules", ARRAY_A ); + } + + static function get_profile_by_product($sku = false) { + global $wpdb; + + if($sku) { + $_product_id = wc_get_product_id_by_sku($sku); + $categories = get_the_terms( $_product_id, 'product_cat' ); + foreach($categories as $c) { + $profiles = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}miravia_profiles WHERE FIND_IN_SET('{$c->term_id}', categories) > 0", ARRAY_A ); + + if(is_array($profiles) and count($profiles) > 0) { + return $profiles[0]['id']; + } + } + + } + + return false; + } + + static function get_product_miravia($id = false) { + global $wpdb; + if($id) { + return $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}miravia_products WHERE id_woocommerce = '{$id}'", ARRAY_A ); + } + + //Is a variation... + // $parent = + return false; + } + + static function get_accounts($id = false, $field = 'id') { + global $wpdb; + if($id) { + return $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}miravia_accounts WHERE {$field} = '{$id}'", ARRAY_A ); + } + return $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}miravia_accounts", ARRAY_A ); + } + + static function get_miravia_account_default($id = false, $field = 'id') { + global $wpdb; + if($id) { + return $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}miravia_accounts WHERE `{$field}` = '{$id}'", ARRAY_A ); + } + return $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}miravia_accounts LIMIT 1", ARRAY_A ); + } + + static function order_exist($id) { + global $wpdb; + if($id) { + return $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}postmeta WHERE `meta_value` = '{$id}'", ARRAY_A ); + } + + return true; + } + + static function get_product($id, $profile = 0) { + global $wpdb; + $queryProfile = ""; + if($profile) { + $queryProfile = " AND profile_id = '{$profile}'"; + } + return $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}miravia_products WHERE id_woocommerce = '{$id}' {$queryProfile}" ); + } + + static function set_job_product($id, $profile, $job = 0) { + global $wpdb; + if(is_array($id)) { + $where = "id_woocommerce IN(".implode(',', $id).")"; + }else{ + $where = "id_woocommerce = '$id'"; + } + + $query = "UPDATE {$wpdb->prefix}miravia_products SET job_id='{$job}', status_text='IN_QUEUE' WHERE profile_id = {$profile} AND ". $where; + $result = $wpdb->query($query); + LOG::add("SET JOB ON PRODUCTS -> " . $query); + LOG::add($result); + } + + static function set_job_product_error($id, $profile, $job = 0, $errorText = 'Generic Error') { + global $wpdb; + if(is_array($id)) { + $where = "id_woocommerce IN(".implode(',', $id).")"; + }else{ + $where = "id_woocommerce = '$id'"; + } + + $query = "UPDATE {$wpdb->prefix}miravia_products SET job_id='{$job}', lastError='{$errorText}' status_text='FAIL' WHERE profile_id = {$profile} AND ". $where; + $result = $wpdb->query($query); + LOG::add("SET JOB ON PRODUCTS -> " . $query); + LOG::add($result); + } + + static function get_order_woocommerce($id) { + $order = wc_get_order($id); + $order_data = new stdClass(); + $items_data = []; + $items = false; + if($order) { + $order_data->id = $id; + $order_data->total = $order->get_total(); + $items = $order->get_items(); + foreach($items as $item) { + array_push($items_data, wc_get_order_item_meta($item->get_id(), '_miravia_order_item_id', true)); + } + } + + + + return [$order_data, $items_data]; + } + + static function getCurrentRules($account_id = 0, $profile_id = 0){ + + $rules = self::get_rules(false, "(accounts = {$account_id} OR accounts = 0) AND (profile_id = {$profile_id} OR profile_id = '0')"); + return $rules; + } + + static function applyFilter($feed, $account_id, $profile_id) { + $rules = self::getCurrentRules($account_id, $profile_id); + foreach ($rules as $rule){ + $jsonfilter = $rule['rules_json']; + + if($jsonfilter){ + if($ids = $feed->applyFilter($jsonfilter)){ + + switch($rule['action_type']){ + case 'remove': + $feed->removeProductsById($ids); + break; + case 'only': + $feed->keepProductsById($ids); + break; + case 'price_stock': + $detail = json_decode($rule['action_json'], true); + + if(is_array($detail)){ + $field = $detail['field']; + $operator = $detail['operator']; + $value = $detail['value']; + + $feed->applyNumericFieldAction($ids, $field, $operator, $value); + } + break; + case 'name': + $detail = json_decode($rule['action_json'], true); + if(is_array($detail)){ + $field = $detail['field']; + $stringvalue = $detail['stringvalue']; + $feed->applyTextFieldAction($ids, $field, $stringvalue); + } + break; + case 'logistics': + $detail = json_decode($rule['action_json'], true); + if(is_array($detail)){ + $delivery = $detail['delivery']; + $warehouse = $detail['warehouse']; + $feed->applyLogisticsAction($ids, $delivery, $warehouse); + } + break; + } + } + } + } + + return $feed; + } + + static function set_error_product_job($sku, $job = 0, $error = '') { + global $wpdb; + + $query = "UPDATE {$wpdb->prefix}miravia_products SET lastError='{$error}', status_text='ERROR' WHERE sku = '{$sku}' AND job_id='{$job}'"; + $result = $wpdb->query($query); + } + + static function set_status_job($job = 0, $status = '') { + global $wpdb; + if($job) { + $query = "UPDATE {$wpdb->prefix}miravia_products SET status_text='{$status}' WHERE job_id='{$job}'"; + $result = $wpdb->query($query); + } + } + + static function clear_job($job = 0) { + global $wpdb; + if($job) { + $query = "UPDATE {$wpdb->prefix}miravia_products SET status_text='ND', job_id='', lastError='' WHERE job_id='{$job}'"; + $result = $wpdb->query($query); + } + } + + static function disconnect_product($id) { + global $wpdb; + $query = "UPDATE {$wpdb->prefix}miravia_products SET status_text='Disconected', lastError='', last_updated='NOW()', id_miravia='' WHERE id_woocommerce = '{$id}'"; + $wpdb->query($query); + } + + static function set_id_miravia_product_job($sku, $job = 0, $id = '') { + global $wpdb; + if($id === false) { + $query = "UPDATE {$wpdb->prefix}miravia_products SET status_text='DONE', lastError='', last_updated='NOW()' WHERE sku = '{$sku}' AND job_id='{$job}'"; + }else{ + $query = "UPDATE {$wpdb->prefix}miravia_products SET id_miravia='{$id}',status_text='DONE', lastError='', last_updated='NOW()' WHERE sku = '{$sku}' AND job_id='{$job}'"; + } + $result = $wpdb->query($query); + } + + static function get_miravia_category($product, $profile) { + $cat = $product->get_category_ids(); + $category_profile_search = explode(',', $profile['categories']); + foreach($cat as $c) { + if(in_array($c, $category_profile_search)) { + return $c; + } + } + + return 0; + } + + static function get_attributes(WC_Product $_product, $attrs) { + $attrs = $_product->get_attributes(); + // ( + // [color] => WC_Product_Attribute Object + // ( + // [data:protected] => Array + // ( + // [id] => 0 + // [name] => Color + // [options] => Array + // ( + // [0] => Rojo + // ) + + // [position] => 0 + // [visible] => 1 + // [variation] => + // ) + + // ) + + // ) + // var_dump($attrs); + // die(); + $attributes = []; + foreach($attrs as $key => $v) { + if(count($v['options']) == 1) { + $value = $v['options'][0]; + }else{ + $value = $v['options']; + } + $attributes[self::get_key_miravia_attr($key, $attrs)] = $value; + } + + return $attributes; + // $map_attrs = get_term_meta($_product->get_category_ids(), "_miravia_attr", true); + } + + static function get_key_miravia_attr($key, $attrs) { + if(isset($attrs->attr)) { + $attrs = $attrs->attr; + } + foreach($attrs as $k => $v) { + // MiraviaCore::debug(array($key, $attrs, $k, 'attribute_pa_'.$k == $key)); + if($k == $key or 'pa_'.$k == $key or 'attribute_pa_'.$k == $key) { + return $v; + } + } + + return false; + } + + static function select_category($categories, $args = array('select' => '0', 'name' => 'category')) { + $html = ""; + + return esc_html($html); + } + + static function get_children_category_select($categories, $args = array('select' => '0', 'name' => 'category')) { + // die(var_dump($categories)); + $html = ""; + foreach($categories['children'] as $c) { + // die(var_dump($c)); + if(isset($c['children'])) { + $html .= self::get_children_category_select($c, $args); + }else{ + $selected_html = ""; + if($args['select'] == $c['category_id']) { $selected_html = "selected='selected'"; } + $html .= ""; + } + } + $html .= ""; + return esc_html($html); + } + + static function get_jobs() { + global $wpdb; + $query = "SELECT + DISTINCT(p.job_id), + COUNT(DISTINCT(p.id_woocommerce)) as total, + ac.token, + f.id, + p.updated + FROM {$wpdb->prefix}miravia_products AS p + INNER JOIN {$wpdb->prefix}miravia_profiles AS f ON p.profile_id = f.id + INNER JOIN {$wpdb->prefix}miravia_accounts AS ac ON f.accounts_id = ac.id + WHERE + p.job_id != '0' and p.job_id != '' + GROUP BY p.job_id, ac.token, f.id"; + return $wpdb->get_results( $query, ARRAY_A ); + } + + static function get_job_detail($id = false) { + global $wpdb; + + if(!$id) { + return []; + } + $query = "SELECT + p.* + FROM {$wpdb->prefix}miravia_products AS p + INNER JOIN {$wpdb->prefix}miravia_profiles AS f ON p.profile_id = f.id + INNER JOIN {$wpdb->prefix}miravia_accounts AS ac ON f.accounts_id = ac.id + WHERE + p.job_id = '{$id}'"; + return $wpdb->get_results( $query, ARRAY_A ); + } + + static function resync_stock() { + global $wpdb; + //Actualizar todos los stocks como que necesitan actualizar y responder con un array de tokens de cuentas + $wpdb->query( + $wpdb->prepare( + "UPDATE {$wpdb->prefix}postmeta AS pm1 + INNER JOIN {$wpdb->prefix}miravia_products AS pm2 + ON pm1.post_id = pm2.id_woocommerce + SET pm1.meta_value = %s + WHERE pm1.meta_key = %s", + '1', + '_miravia_need_update' + ) + ); + + return MiraviaCore::get_accounts(); + } + + static function procesarFeed() { + $document = sanitize_text_field($_REQUEST['document']); + $seller = sanitize_text_field($_REQUEST['seller']); + $account = MiraviaCore::get_accounts($seller,'userid'); + if(!$account) { + LOG::add("Accont not found on process feed {$document}", false, 'feeds'); + return false; + } + $id_seller = $account['id']; + if($id_seller) { + $link = new MiraviaLink($account['token']); + $data = $link->getFeedResult($document); + if (!empty($data)) { + $info = json_decode($data,true); + if(is_array($info) && isset($info['success']) && $info['success'] == false){ + $ret['success'] = false; + $ret['error'] = $info['error']; + $txlog .= $info['error']; + }else { + $r = self::processFeedResult($seller, $data); + if ($r != 'ok') { + LOG::add("Error when process feed {$document}: {$r}", false, 'feeds'); + return false; + } + } + } + }else{ + LOG::add("ID Accont not found on process feed {$document}", false, 'feeds'); + return false; + } + + } + + + static public function processFeedResult($seller, $data){ + if(!is_array($data)){ + $data = json_decode($data, true); + } + $account = MiraviaCore::get_accounts($seller,'userid'); + + if(!$account){ + return 'error: invalid seller'; + } + if(!is_array($data)){ + return 'error: invalid data'; + } + + foreach($data as $id => $info){ + global $wpdb; + $status = isset($info['status']) ? $info['status'] : false; + $message = '?'; + $item_id = ''; + if($status){ + $message=''; + if($status=='FAIL'){ + $status = 'error'; + $detail = isset($info['detail']) ? $info['detail'] : false; + $message = self::getFeedDetail($detail); + }elseif($status=='SUCCESS'){ + $status = 'created'; + $item_id = $info['id']; + } + }else{ + $status = 'error'; + $message = 'Invalid response from server: ' . json_encode($info); + } + $update_fields = [ + 'status_text' => $status, + 'lastError' => $message, + 'job_id' => '', + ]; + if(!empty($item_id)){ + $update_fields['id_miravia'] = $item_id; + } + $wpdb->update($wpdb->prefix.'miravia_products', $update_fields, array('sku' => $id,'job_id' => $_GET['feed'])); + } + return 'ok'; + } + + + static protected function getFeedDetail($tx) + { + if(is_array($tx)){ + $data = $tx; + }else { + $data = json_decode($tx, true); + } + $msg = isset($data['message']) ? $data['message'] : false; + if($msg){ + $data = is_array($msg) ? $msg : json_decode($msg, true); + $errorCode = isset($data['errorCode']) ? $data['errorCode'] : '0'; + $errorMsg = isset($data['errorMsg']) ? $data['errorMsg'] : '0'; + $errorFirst = isset($data['errors'][0]['code']) ? $data['errors'][0]['code'] : '0'; + $detail = "[$errorCode] $errorMsg ($errorFirst)"; + return $detail; + } + $detail = $tx; + return $detail; + } + } +} diff --git a/connector-miravia/classes/class.db.php b/connector-miravia/classes/class.db.php new file mode 100644 index 0000000..1e4b41b --- /dev/null +++ b/connector-miravia/classes/class.db.php @@ -0,0 +1,77 @@ +get_charset_collate(); + + $sql = "CREATE TABLE {$wpdb->prefix}miravia_accounts ( + id mediumint(9) NOT NULL AUTO_INCREMENT, + created datetime DEFAULT CURRENT_TIMESTAMP NOT NULL, + updated datetime DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP, + name tinytext NOT NULL, + token varchar(200) NOT NULL, + userid varchar(30) DEFAULT '' NOT NULL, + config TEXT, + lang varchar(10) NOT NULL, + email varchar(100) NOT NULL, + PRIMARY KEY (id) + ) $charset_collate;"; + + $sql .= "CREATE TABLE {$wpdb->prefix}miravia_profiles ( + id mediumint(9) NOT NULL AUTO_INCREMENT, + created datetime DEFAULT CURRENT_TIMESTAMP NOT NULL, + updated datetime DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP, + name tinytext NOT NULL, + accounts_id varchar(200) NOT NULL, + categories varchar(250) DEFAULT '' NOT NULL, + miravia_category bigint NOT NULL DEFAULT 0, + config TEXT, + PRIMARY KEY (id) + ) $charset_collate;"; + + $sql .= "CREATE TABLE {$wpdb->prefix}miravia_products ( + id mediumint(9) NOT NULL AUTO_INCREMENT, + created datetime DEFAULT CURRENT_TIMESTAMP NOT NULL, + updated datetime DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP, + last_updated datetime DEFAULT '0000-00-00 00:00:00', + id_woocommerce BIGINT NOT NULL, + sku varchar(100) NOT NULL, + id_miravia BIGINT NOT NULL, + job_id VARCHAR(100) NOT NULL DEFAULT '0', + stock INT NOT NULL DEFAULT 0, + price FLOAT(50,2) NULL DEFAULT NULL, + sale_price FLOAT(50,2) NULL DEFAULT NULL, + profile_id INT DEFAULT 0 NOT NULL, + lastError varchar(255) DEFAULT '', + status_text varchar(100) DEFAULT '', + PRIMARY KEY (id) + ) $charset_collate;"; + + $sql .= "CREATE TABLE {$wpdb->prefix}miravia_rules ( + id mediumint(9) NOT NULL AUTO_INCREMENT, + created datetime DEFAULT CURRENT_TIMESTAMP NOT NULL, + updated datetime DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP, + name_rule VARCHAR(100) NOT NULL, + accounts INT NOT NULL DEFAULT 0, + profile_id INT NOT NULL DEFAULT 0, + rules_json TEXT, + action_json TEXT, + action_type VARCHAR(100) NOT NULL, + PRIMARY KEY (id) + ) $charset_collate;"; + + //Run SQL + require_once ABSPATH . 'wp-admin/includes/upgrade.php'; + dbDelta( $sql ); + + //Update bd version plugin + update_option( 'miravia_db_version', MIRAVIA_DB_VERSION ); + LOG::add("La base de datos ha sido actualizada a la versión " . MIRAVIA_DB_VERSION); + } + } +} \ No newline at end of file diff --git a/connector-miravia/classes/class.general.php b/connector-miravia/classes/class.general.php new file mode 100644 index 0000000..9a5cdf7 --- /dev/null +++ b/connector-miravia/classes/class.general.php @@ -0,0 +1,11 @@ +client) { + $this->client = new IopClient($this->url,$this->appKey,$this->appSecret); + } + } + + function secure(){ + if(!$this->client) { + die(json_encode(array('error' => true, 'message' => 'No se ha establecido la conexión'))); + } + } + + function get($endpoint = '', $params = array()) { + $this->secure(); + $request = new IopRequest($endpoint,'GET'); + + if($params) { + foreach($params as $k => $v) { + $request->addApiParam($k,$v); + } + } + + try{ + $result = $this->client->execute($request,$this->token); + }catch(Exception $e) { + return $this->error_control($e); + } + + $resp = json_decode($result, true); + return $this->response($resp); + } + + function post($endpoint = '', $data = array()) { + $this->secure(); + $request = new IopRequest($endpoint); + + if($data) { + foreach($data as $k => $v) { + $request->addApiParam($k,$v); + } + } + try{ + $result = $this->client->execute($request, $this->token); + }catch(Exception $e) { + return $this->error_control($e); + } + + $resp = json_decode($result, true); + return $this->response($resp); + } + + function response($result) { + if(isset($result['data'])) { + return $result['data']; + }else{ + //Control de errores + return $this->error_control($result); + } + } + + function error_control($resp) { + // die('
'.print_r($resp, true).'
'); + if($resp->code != '0') { + if(isset($resp->detail)) { + $errors = $resp->detail; + }else{ + $errors = [$resp->message]; + } + return array( + 'code' => $resp->code, + 'errors' => $errors + ); + }else{ + return array( + 'code' => '-1', + 'errors' => array($resp) + ); + } + } + + function get_images_batch($batch_id) { + return $this->get('/image/response/get', array('batch_id' => $batch_id)); + } + + function get_brands($page) { + + $to = $page * 20; + $from = $to - 20; + return $this->get('/category/brands/query', array('start_row' => $from, "page_size" => $to)); + } + + + function get_orders($args = array()) { + return $this->get('/orders/get', $args); + } + + function get_order($args = array()) { + return $this->get('/order/get', $args); + } + + function get_orders_items($args = array()) { + return $this->get('/order/items/get', $args); + } + + function get_products($args = array()) { + return $this->get('/products/get', $args); + } + } +} \ No newline at end of file diff --git a/connector-miravia/classes/class.order.php b/connector-miravia/classes/class.order.php new file mode 100644 index 0000000..f173f6e --- /dev/null +++ b/connector-miravia/classes/class.order.php @@ -0,0 +1,128 @@ + $order_miravia['address_billing']['first_name'], + 'last_name' => $order_miravia['address_billing']['last_name'], + 'email' => $order_miravia['address_shipping']['customerEmail'], + 'phone' => $order_miravia['address_billing']['phone'], + 'address_1' => "{$order_miravia['address_billing']['address1']} {$order_miravia['address_billing']['address2']} {$order_miravia['address_billing']['address3']}", + 'address_2' => "{$order_miravia['address_billing']['address4']} {$order_miravia['address_billing']['address5']}", + 'city' => $order_miravia['address_billing']['city'], + 'state' => $order_miravia['address_billing']['country'], //Ver esto + 'postcode' => $order_miravia['address_billing']['post_code'], + 'country' => $order_miravia['address_billing']['country'], + ); + + $shipping_address = array( + 'first_name' => $order_miravia['address_shipping']['firstName'], + 'last_name' => $order_miravia['address_shipping']['lastName'], + 'address_1' => "{$order_miravia['address_shipping']['address1']} {$order_miravia['address_shipping']['address2']} {$order_miravia['address_shipping']['address3']}", + 'address_2' => "{$order_miravia['address_shipping']['address4']} {$order_miravia['address_shipping']['address5']}", + 'city' => $order_miravia['address_shipping']['city'], + 'state' => $order_miravia['address_shipping']['country'], //Ver esto + 'postcode' => $order_miravia['address_shipping']['postCode'], + 'country' => $order_miravia['address_shipping']['country'], + ); + + $order->set_address( $billing_address, 'billing' ); + $order->set_address( $shipping_address, 'shipping' ); + update_post_meta($order->ID, '_miravia_order_id', $order_miravia['order_number']); + update_post_meta($order->ID, '_miravia_account_id', $order_miravia['account_id']); + // update_post_meta($order->ID, '_miravia_order_id', $order_miravia['order_number']); + // 1. User doesn't exist - Create it - send email - set address and define + if ( ! $user_id && $user_id == false ) { + $email = $username; + $password = wp_generate_password( 12, false ); + $first_name = $order_miravia['address_shipping']['firstName']; + $last_name = $order_miravia['address_shipping']['lastName']; + + $user_data = array( + 'user_login' => $username, + 'user_pass' => $password, + 'user_email' => $email, + 'first_name' => $first_name, + 'last_name' => $last_name, + 'role' => 'customer', + ); + + $user_id = wp_insert_user( $user_data ); + + // Update Billing and shipping user data + foreach( $billing_address as $key => $value ) { + update_user_meta( $user_id, 'billing_' . $key, $value ); + } + + foreach( $shipping_address as $key => $value ) { + update_user_meta( $user_id, 'shipping_' . $key, $value ); + } + + // No send notification on create user + // WC()->mailer()->get_emails()['WC_Email_Customer_New_Account']->trigger( $user_id, $password, true ); + } + + // For calculating taxes on items + $calculate_taxes_for = array( + 'country' => ! empty($shipping_address['country']) ? $shipping_address['country'] : $billing_address['country'], + 'state' => ! empty($shipping_address['state']) ? $shipping_address['state'] : $billing_address['state'], + 'postcode' => ! empty($shipping_address['postcode']) ? $shipping_address['postcode'] : $billing_address['postcode'], + 'city' => ! empty($shipping_address['city']) ? $shipping_address['city'] : $billing_address['city'], + ); + + foreach($order_miravia['order_items'] as $k => $item) { + $this->add_product($order, $item, $calculate_taxes_for); + } + + $order->set_customer_id( $user_id ); + + $order->set_currency( get_woocommerce_currency() ); + $order->set_prices_include_tax( 'yes' === get_option( 'woocommerce_prices_include_tax' ) ); + + + $note = 'From MIRAVIA Order'; + $order->add_order_note( $note ); + $order->set_customer_note( $note ); + $order->set_status($defaultStatus, "Created from Miravia"); + $order->calculate_totals(); + $order->update_status('autoquote', true); // $order->save() is already included with update_status() method + } + + function add_product($order, $product, $calculate_taxes_for) { + $product_sku = wc_get_product_id_by_sku($product['sku']); + $_product = $product_sku ? wc_get_product( $product_sku ) : false; + + $cantidad = 1; //TODO ver esto + $priceWithOutTax = $product['item_price'] - (($product['item_price'] - $product['tax_amount']) / 100); + $dataLine = [ + 'name' => $product['name'], + 'subtotal' => $priceWithOutTax, + 'total' => $product['item_price'] + ]; + $item_id = $order->add_product($_product, $cantidad, $dataLine); + + wc_update_order_item_meta($item_id, '_miravia_delivery_option', $product['delivery_option_sof']); + wc_update_order_item_meta($item_id, '_miravia_order_item_id', $product['order_item_id']); + $line_item = $order->get_item( $item_id, false ); // Get the WC_Order_Item_Product Object instance from the Item Id + $line_item->calculate_taxes($calculate_taxes_for); // <== Calculating taxes + $line_item->save(); // Save data to WC_Order_Item_Product Object + } + } +} \ No newline at end of file diff --git a/connector-miravia/classes/class.product copy.php b/connector-miravia/classes/class.product copy.php new file mode 100644 index 0000000..648a860 --- /dev/null +++ b/connector-miravia/classes/class.product copy.php @@ -0,0 +1,125 @@ + array()); + public $Attributes = array(); + public $Skus = array('Sku' => array()); + public $PrimaryCategory = 0; + + function __construct($id){ + $this->product = wc_get_product($id); + //Por defecto de la categoria + $terms = get_the_terms( $this->product->get_id(), 'product_cat' ); + $this->category = $terms[0]; + + + //Exist Product + $miraviaId = get_post_meta($id, '_miravia_product_id', true); + if($miraviaId) { + $this->ItemId = $miraviaId; + } + $atributos_guardados = get_term_meta($this->category->term_id, "_miravia_attr", true); + if($atributos_guardados) { + $this->Attributes = $atributos_guardados; + } + + //Completar los datos básicos + $this->PrimaryCategory = get_term_meta($this->category->term_id, "_miravia_category", true); + $this->Attributes['name'] = $this->product->get_name(); + $this->Attributes['description'] = $this->product->get_description(); + + + //Cargar imagenes + $attachment_ids = $this->product->get_gallery_image_ids(); + + foreach( $attachment_ids as $attachment_id ) { + $this->Images['Image'][] = $this->defaul_image; + } + + $this->get_skus(); + } + + function get_skus() { + if($this->product->is_type('simple')) { + $skus = [$this->product]; + }else{ + $skus = $this->product->get_available_variations(); + } + foreach($skus as $index => $sku) { + $this->Skus['Sku'][$index]["SellerSku"] = $sku->get_sku(); + $this->Skus['Sku'][$index]["quantity"] = $sku->get_stock_quantity(); + $this->Skus['Sku'][$index]["price"] = $sku->get_regular_price(); + if($sku->is_on_sale()) { + $this->Skus['Sku'][$index]["special_price"] = $sku->get_sale_price(); + } + $this->Skus['Sku'][$index]["price"] = $sku->get_regular_price(); + if($sku->get_manage_stock() === false) { + if($sku->get_stock_status() == "instock") { + $stock_available = intval(100); //Stock por defecto + }else{ + $stock_available = 0; + } + }else{ + $stock_available = $sku->get_stock_quantity(); + } + $this->Skus['Sku'][$index]["quantity"] = $stock_available; + $this->Skus['Sku'][$index]["package_height"] = $sku->get_height(); + $this->Skus['Sku'][$index]["package_length"] = $sku->get_length(); + $this->Skus['Sku'][$index]["ean_code"] = '0'; //Implementar + $this->Skus['Sku'][$index]["package_width"] = $sku->get_width(); + $this->Skus['Sku'][$index]["package_weight"] = $sku->get_weight(); + $this->Skus['Sku'][$index]["package_content"] = ''; //Implementar + + $attachment_ids = $sku->get_gallery_image_ids(); + foreach( $attachment_ids as $attachment_id ) { + $this->Skus['Sku'][$index]["Images"]["Image"][] = $this->defaul_image; + } + } + } + + + function send() { + global $MIRAVIAWOO; + + $send_product = json_encode(array("Request" => array("Product" => array( + 'Attributes' => $this->Attributes, + 'PrimaryCategory' => $this->PrimaryCategory, + 'Skus' => $this->Skus, + 'Images' => $this->Images + )))); + + $result_product = $MIRAVIAWOO->client->post('/product/create', array( + 'body' => $send_product + )); + + return $result_product; + } + + function update() { + global $MIRAVIAWOO; + + $send_product = json_encode(array("Request" => array("Product" => array( + 'ItemId' => $this->ItemId, + 'Attributes' => $this->Attributes, + 'PrimaryCategory' => $this->PrimaryCategory, + 'Skus' => $this->Skus, + 'Images' => $this->Images + )))); + + $result_product = $MIRAVIAWOO->client->post('/product/update', array( + 'payload' => $send_product + )); + error_log(json_encode($result_product)); + return $result_product; + } + + + } +} \ No newline at end of file diff --git a/connector-miravia/classes/class.product.php b/connector-miravia/classes/class.product.php new file mode 100644 index 0000000..9412e63 --- /dev/null +++ b/connector-miravia/classes/class.product.php @@ -0,0 +1,211 @@ +id = $saved->id; + $this->id_woocommerce = $saved->id_woocommerce; + $this->id_miravia = $saved->id_miravia; + $this->profile = $saved->profile_id; + $this->last_updated = $saved->last_updated; + $_product = wc_get_product(intval($this->id_woocommerce)); + }else{ + + $this->id_woocommerce = $id; + + //Load product + $_product = wc_get_product(intval($this->id_woocommerce)); + + $this->profile = $profile['id']; + $wpdb->insert($wpdb->prefix.'miravia_products', array( + 'id_woocommerce' => $this->id_woocommerce, + 'sku' => $_product->get_sku() ?: $id, + 'id_miravia' => $this->id_miravia, + 'profile_id' => $this->profile, + 'stock' => $_product->get_regular_price(), + 'price' => $_product->get_regular_price(), + 'sale_price' => $_product->get_sale_price(), + )); + $this->id = $wpdb->insert_id; + } + + if($_product->get_manage_stock() === false) { + if($_product->get_stock_status() == "instock") { + $stock_available = get_option('_miravia_default_stock', 100); //Stock por defecto + }else{ + $stock_available = 0; + } + }else{ + $stock_available = $_product->get_stock_quantity(); + } + $local_category = MiraviaCore::get_miravia_category($_product, $profile); + // $attributes_product = MiraviaCore::get_attributes($_product, $local_category); + // $attributes_product = $_product->get_attributes(); + // die("
".print_r($attributes_product, true)."
"); + $this->product = new MiraviaProduct(); + $this->product->id = $this->id_woocommerce; + $this->product->id_miravia = $this->id_miravia; + $this->product->sku = $_product->get_sku() ?: $id; + $this->product->lang = 'es-ES'; // ISO lang cod + $this->product->name = $_product->get_name(); + $this->product->short_description = $_product->get_short_description(); + $this->product->description = $_product->get_description(); + $this->product->brand = $defaultBrand; + $this->product->model = ''; + $this->product->ean_code = $ean; + $this->product->warranty = ''; + $this->product->id_category = $profile['miravia_category']; + $this->product->id_brand = ''; + $this->product->images = []; // Se completa después + $this->product->video = ''; + $this->product->price = $_product->get_regular_price(); + $this->product->special_price = $_product->get_sale_price(); + $this->product->width = $_product->get_width(); + $this->product->height = $_product->get_height(); + $this->product->length = $_product->get_length(); + $this->product->weight = $_product->get_weight(); + $this->product->delivery = get_option('miravia_transport_mode', 'dbm'); + $this->product->info = array( + 'id_category' => $local_category + ); + //$this->product->extra_attributes = []; # TODO agregar caracteristicas + + //Attrs + $this->product->addAttr("unit_count_type", $defaultUnit); + $this->product->addAttr("Unit_Count", $defaultUnitValue); + + if($_product->is_type( 'variable' )) { + + $combinations = []; + $variations = $_product->get_available_variations(); + // MiraviaCore::debug($variations); + foreach($variations as $v) { + + if($v['is_in_stock'] == true) { + if($v['max_qty'] == "") { + $stock_available = get_option('_miravia_default_stock', 100); //Stock por defecto + }else{ + $stock_available = $v["max_qty"]; + } + }else{ + $stock_available = 0; //Stock por defecto + } + $ean = ''; + $keyEAN = get_option('miravia_ean_key', ''); + if($keyEAN != '') { + $ean = get_post_meta($v['variation_id'], $keyEAN, true); + } + $com = new MiraviaCombination(); + $com->sku = $v['sku']; + $com->ean_code = $ean; + $com->price = $v['display_regular_price']; + $com->special_price = $v['display_price']; + $com->quantity = intval($stock_available); + $com->images = []; + $com->width = $v['dimensions']['width']; + $com->height = $v['dimensions']['height']; + $com->length = $v['dimensions']['length']; + $com->weight = $v['weight']; + $com->variation = []; + $encontrados = []; + $labels = []; + $lastAttribute = ""; + foreach($v['attributes'] as $k => $a) { + $term_name = ( $term = get_term_by( 'slug', $a, str_replace("attribute_", "", $k) ) ) ? $term->name : $a; + $nameWithOutAttribute = str_replace("attribute_", "", $k); + + if(isset($encontrados[$nameWithOutAttribute])) { + $encontrados[$nameWithOutAttribute] .= $term_name; + }else{ + $encontrados[$nameWithOutAttribute] = $term_name; + } + } + + foreach($encontrados as $b => $c) { + $com->addVariation($b, $c); + } + $combinations[] = $com; + + } + $this->product->combinations = $combinations; + } + //Set stock + $this->product->quantity = $stock_available; + + //Load images + $attachment_ids = $_product->get_gallery_image_ids(); + $sizeImage = get_option('miravia_size_image', 'single-post-thumbnail'); + $featured = wp_get_attachment_image_src( get_post_thumbnail_id( $this->product->id ), $sizeImage ); + if($featured and is_array($featured)) { + $this->product->images[] = $featured[0]; + } + foreach( $attachment_ids as $attachment_id ) { + $this->product->images[] = wp_get_attachment_image_src( $attachment_id, $sizeImage )[0]; + } + + } + + public function getData() { + $error = false; + //Control de productos sin variaciones ni precio + if(($this->product->price == 0 or $this->product->price == "") and count($this->product->combinations) == 0) { + LOG::add("Producto {$this->product->id} no agregado por no tener precio y no tener variaciones", false, 'errors_products_send'); + $error = true; + } + if(count($this->product->images) == 0) { + LOG::add("Producto {$this->product->id} no tiene imagenes, no enviado", false, 'errors_products_send'); + $error = true; + } + + if($error) { + return false; + } + return $this->product; + } + + function send() { + return false; + } + + + } +} \ No newline at end of file diff --git a/connector-miravia/classes/class.ui.php b/connector-miravia/classes/class.ui.php new file mode 100644 index 0000000..e2c8902 --- /dev/null +++ b/connector-miravia/classes/class.ui.php @@ -0,0 +1,11 @@ +api_url . '/category/tree'; + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + $this->last_error = $resp['error']; + return false; + } + if(isset($resp['data'])){ + if($treeFormat) { + return $resp['data']; + }else{ + return $this->treeToList($resp['data']); + } + } + return false; + } + + public function getBrands() + { + $url = $this->api_url . '/category/brands'; + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + $this->last_error = $resp['error']; + return false; + } + if(isset($resp['data'])){ + return $resp['data']; + } + return false; + } + + public function getAttributes($id) + { + $url = $this->api_url . '/category/' . $id . '/attributes'; + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + $this->last_error = isset($resp['error']) ? $resp['error'] : $ret; + return false; + } + if(isset($resp['data'])){ + return $resp['data']; + } + return false; + } + + private function treeToList($tree = [], $prefix = '') + { + $ret = []; + $separator = $prefix=='' ? '' : ' / '; + foreach ($tree as $item) { + $name = $item['name']; + if(isset($item['children'])) { + $children = $this->treeToList($item['children'], $prefix . $separator . $name); + foreach($children as $key => $child){ + $ret[] = [ + 'id' => $child['id'], + 'name' => $child['name'] + ]; + } + }else{ + $ret[] = [ + 'id' => $item['category_id'], + 'name' => $prefix . $separator . $name + ]; + } + } + return $ret; + } + +} diff --git a/connector-miravia/classes/shared/MiraviaCombination.php b/connector-miravia/classes/shared/MiraviaCombination.php new file mode 100644 index 0000000..8d9869d --- /dev/null +++ b/connector-miravia/classes/shared/MiraviaCombination.php @@ -0,0 +1,59 @@ +variation[$name] = $value; + } + + public function getData() + { + $combination = []; + $this->weight = round((float)$this->weight, 2); + foreach ($this as $key => $value){ + if($key=='ean_code' && empty($value)){ + continue; + } + if($key === 'images' && is_array($value) && !empty($value)){ + $combination['Images'] = ['Image' => $value]; + } else if($key !== 'images') { + $combination[$key] = $value; + } + } + return $combination; + } + + public function getStockData() + { + $combination = [ + 'sku' => $this->sku, + 'price' => $this->price, + 'special_price' => $this->special_price, + 'quantity' => $this->quantity >= 0 ? $this->quantity : 0 + ]; + return $combination; + } + + public function getOnlyStockData() + { + $combination = [ + 'sku' => $this->sku, + 'quantity' => $this->quantity >= 0 ? $this->quantity : 0 + ]; + return $combination; + } +} \ No newline at end of file diff --git a/connector-miravia/classes/shared/MiraviaFeed.php b/connector-miravia/classes/shared/MiraviaFeed.php new file mode 100644 index 0000000..88e7f3a --- /dev/null +++ b/connector-miravia/classes/shared/MiraviaFeed.php @@ -0,0 +1,243 @@ +products[$p->id] = $p; + } + } + + public function addProduct(MiraviaProduct $product) + { + $this->products[$product->id] = $product; + } + + public function getProducts() + { + return $this->products; + } + + public function getProductsIds() + { + return array_keys($this->products); + } + + public function getJsonCreate($offset = 0, $limit = 200) + { + $ret = []; + $prods = array_slice($this->products, $offset, $limit); + foreach ($prods as $p) { + if($p->created==0){ + $this->setDefaultValues($p); + $ret[] = $p->getData(); + } + } + if(empty($ret)){ + return false; + } + $ret = [ + 'products' => $ret + ]; + $flags = $this->debug ? JSON_PRETTY_PRINT : 0; + return json_encode($ret, $flags); + } + + public function getJsonUpdate($offset = 0, $limit = 200) + { + $ret = []; + $prods = array_slice($this->products, $offset, $limit); + foreach ($prods as $p) { + if($p->created==1 && strlen($p->id_miravia)>14){ + $this->setDefaultValues($p); + $ret[] = $p->getData(); + } + } + if(empty($ret)){ + return false; + } + $ret = [ + 'products' => $ret + ]; + $flags = $this->debug ? JSON_PRETTY_PRINT : 0; + return json_encode($ret, $flags); + } + + public function setDefaultValues(MiraviaProduct &$product) + { + if((float)$product->weight == 0) $product->weight = $this->default_weight; + if((int)$product->height == 0) $product->height = $this->default_height; + if((int)$product->width == 0) $product->width = $this->default_width; + if((int)$product->length == 0) $product->length = $this->default_length; + } + + public function getJsonUpdateStock($onlyStock = false, $offset = 0, $limit = 200) + { + $ret = []; + $prods = array_slice($this->products, $offset, $limit); + foreach ($prods as $p) { + if(!empty($p->id_miravia)){ + if($onlyStock) { + $ret[] = $p->getOnlyStockData(); + }else{ + $ret[] = $p->getStockData(); + } + } + } + if(empty($ret)){ + return false; + } + $ret = [ + 'products' => $ret + ]; + $flags = $this->debug ? JSON_PRETTY_PRINT : 0; + return json_encode($ret, $flags); + } + + public function applyFilter($jsonFilter) + { + if(empty($jsonFilter)){ + return false; + } + $filter = new MiraviaFilter($jsonFilter); + + if($ids = $filter->parseRecords($this->products)){ + return $ids; + } + return false; + } + + public function removeProductsById($ids) + { + if(!is_array($ids)){ + $ids = [$ids]; + } + foreach ($ids as $id){ + unset($this->products[$id]); + } + } + + public function keepProductsById($ids) + { + if(!is_array($ids)){ + $ids = [$ids]; + } + $keys = array_keys($this->products); + $ids = array_diff($keys, $ids); + foreach ($ids as $id){ + unset($this->products[$id]); + } + } + + public function applyNumericFieldAction($ids, $fields, $action, $value) + { + $afields = explode(',',$fields); + foreach ($afields as $field){ + foreach ($ids as $id){ + if(isset($this->products[$id])){ + + switch ($action){ + case 'increment': + if($this->products[$id]->{$field}) { + $this->products[$id]->{$field} = (float)$this->products[$id]->{$field} + (float)$value; + } + foreach($this->products[$id]->combinations as &$combi){ + $combi->{$field} += (float)$value; + } + break; + case 'decrement': + if($this->products[$id]->{$field}) { + $this->products[$id]->{$field} -= (float)$value; + } + foreach($this->products[$id]->combinations as &$combi){ + $combi->{$field} -= (float)$value; + } + break; + case 'increment_percent': + if($this->products[$id]->{$field}) { + $this->products[$id]->{$field} += ((float)$this->products[$id]->{$field} * (float)$value / 100); + } + foreach($this->products[$id]->combinations as &$combi){ + $combi->{$field} += ((float)$combi->{$field} * (float)$value / 100); + } + break; + case 'decrement_percent': + if($this->products[$id]->{$field}) { + $this->products[$id]->{$field} -= ((float)$this->products[$id]->{$field} * (float)$value / 100); + } + foreach($this->products[$id]->combinations as &$combi){ + $combi->{$field} -= ((float)$combi->{$field} * (float)$value / 100); + } + break; + case 'multiply': + if($this->products[$id]->{$field}) { + $this->products[$id]->{$field} = ((float)$this->products[$id]->{$field} * (float)$value ); + } + foreach($this->products[$id]->combinations as &$combi){ + $combi->{$field} = ((float)$combi->{$field} * (float)$value ); + } + break; + case 'set': + if($this->products[$id]->{$field}) { + $this->products[$id]->{$field} = (float)$value; + } + foreach($this->products[$id]->combinations as &$combi){ + $combi->{$field} = (float)$value; + } + break; + } + } + } + } + } + + public function applyTextFieldAction($ids, $field, $template) + { + foreach ($ids as $id) { + if (isset($this->products[$id])) { + $replaces = [ + 'name' => $this->products[$id]->name, + 'description' => $this->products[$id]->description, + 'short_description' => $this->products[$id]->short_description, + 'manufacturer' => $this->products[$id]->getInfoValue('manufacturer'), + 'supplier' => $this->products[$id]->getInfoValue('supplier'), + 'category' => $this->products[$id]->getInfoValue('category'), + ]; + $this->products[$id]->{$field} = $template; + foreach($replaces as $search => $replace){ + $this->products[$id]->{$field} = str_replace('%' . $search .'%', $replace, $this->products[$id]->{$field}); + } + } + } + } + + public function applyLogisticsAction($ids, $delivery, $warehouse) + { + foreach ($ids as $id) { + if (isset($this->products[$id])) { + $this->products[$id]->delivery = $delivery; + $this->products[$id]->warehouse = $warehouse; + } + } + } + + public function getProductCount() + { + return sizeof($this->products); + } +} \ No newline at end of file diff --git a/connector-miravia/classes/shared/MiraviaFilter.php b/connector-miravia/classes/shared/MiraviaFilter.php new file mode 100644 index 0000000..4d11151 --- /dev/null +++ b/connector-miravia/classes/shared/MiraviaFilter.php @@ -0,0 +1,134 @@ +definition = json_decode($json, true); + } + + /* + * Return a list of keys + */ + public function parseRecords($products) + { + if(!is_array($this->definition)){ + return false; + } + $ret = []; + if(is_array($products)) { + foreach ($products as $key => $product) { + if ($this->parseGroup($this->definition, $product)) { + // condition is met + $ret[] = $product->id; + }else{ + //$ret[] = "NO: " . $key; + } + } + } + return $ret; + } + + private function parseGroup($condition, $product) + { + $final_result = false; + $rules_parsed = 0; + foreach ($condition as $rule){ + $operator = $rule['logical_operator']; + if(!isset($rule['element_rule_id'])){ + // group + $result = $this->parseGroup($rule, $product); + }else{ + $result = $this->parseCondition($rule['condition'], $product); + } + if($rules_parsed==0){ + $final_result = $result; + }else{ + switch ($operator){ + case 'OR': + $final_result = $final_result || $result; + break; + case 'AND': + $final_result = $final_result && $result; + break; + } + } + } + return $final_result; + } + + private function parseCondition($condition, $product) + { + switch ($condition['field']){ + case 'product_name': + $field = $product->name; + break; + case 'price': + $field = $product->price; + break; + case 'specific_price': + $field = $product->special_price; + break; + case 'stock': + $field = $product->quantity; + break; + case 'category': + $field = $product->info['id_category']; + break; + case 'supplier': + $field = $product->info['id_supplier']; + break; + case 'manufacturer': + $field = $product->info['id_manufacturer']; + break; + } + + switch($condition['operator']){ + case 'equal': + $value = $condition['filterValue'][0]; + return $field==$value; + case 'not_equal': + $value = $condition['filterValue'][0]; + return $field!=$value; + case 'less': + $value = $condition['filterValue'][0]; + return $field<$value; + case 'less_or_equal': + $value = $condition['filterValue'][0]; + return $field<=$value; + case 'greater': + $value = $condition['filterValue'][0]; + return $field>$value; + case 'greater_or_equal': + $value = $condition['filterValue'][0]; + return $field>=$value; + case 'begins_with': + $value = $condition['filterValue'][0]; + return (substr($field, 0, strlen($value)) === $value); + case 'contains': + $value = $condition['filterValue'][0]; + return (stripos($field, $value)!=false); + case 'ends_with': + $value = $condition['filterValue'][0]; + return (substr($field, -1 * strlen($value)) === $value); + case 'not_begins_with': + $value = $condition['filterValue'][0]; + return !(substr($field, 0, strlen($value)) === $value); + case 'not_contains': + $value = $condition['filterValue'][0]; + return !(stripos($field, $value)!=false); + case 'not_ends_with': + $value = $condition['filterValue'][0]; + return !(substr($field, -1 * strlen($value)) === $value); + case 'is_null': + case 'is_empty': + return empty($field); + case 'is_not_null': + case 'is_not_empty': + return !empty($field); + } + return false; + } +} \ No newline at end of file diff --git a/connector-miravia/classes/shared/MiraviaLang.php b/connector-miravia/classes/shared/MiraviaLang.php new file mode 100644 index 0000000..db59740 --- /dev/null +++ b/connector-miravia/classes/shared/MiraviaLang.php @@ -0,0 +1,63 @@ + 'en', + 'ARABIC' => 'ar', + 'GERMAN' => 'de', + 'SPANISH' => 'es', + 'FRENCH' => 'fr', + 'INDONESIAN' => 'in', + 'ITALIAN' => 'it', + 'HEBREW' => 'iw', + 'JAPANESE' => 'ja', + 'KOREAN' => 'ko', + 'DUTCH' => 'nl', + 'POLISH' => 'pl', + 'PORTUGUESE' => 'pt', + 'RUSSIAN' => 'ru', + 'THAI' => 'th', + 'TURKISH' => 'tr', + 'VIETNAMESE' => 'vi', + ]; + + public static $Languages = [ + 'en' => 'en_US', + 'ar' => 'ar_MA', + 'de' => 'de_DE', + 'es' => 'es_ES', + 'fr' => 'fr_FR', + 'in' => 'in_ID', + 'it' => 'it_IT', + 'iw' => 'iw_IL', + 'ja' => 'ja_JP', + 'ko' => 'ko_KR', + 'nl' => 'nl_NL', + 'pl' => 'pl_PL', + 'pt' => 'pt_BR', + 'ru' => 'ru_RU', + 'th' => 'th_TH', + 'tr' => 'tr_TR', + 'vi' => 'vi_VN', + ]; +} \ No newline at end of file diff --git a/connector-miravia/classes/shared/MiraviaLink.php b/connector-miravia/classes/shared/MiraviaLink.php new file mode 100644 index 0000000..f437c80 --- /dev/null +++ b/connector-miravia/classes/shared/MiraviaLink.php @@ -0,0 +1,541 @@ +api_key = $api_key; + if( strpos($api_key, '_f6649cb881216ce050bd0e3') ){ + $this->sandbox_mode = true; + $this->api_url = 'https://sandbox.miravia.wecomm.es'; + } + } + + public function getRegisterUrl($callback_url) + { + $url = $this->api_url . '/token'; + $ret = $this->CallAPI($url, 'POST', + array('callback_url' => $callback_url)); + if($ret === false){ + return ''; + } + $response = json_decode($ret, true); + if(!is_array($response)){ + $last_error = $ret; + return ''; + } + if(isset($response['error'])){ + $this->last_error = $response['error']; + } + + $url = isset($response['url']) ? $response['url'] : ''; + $this->request_id = isset($response['request_id']) ? $response['request_id'] : ''; + + return $url; + } + + public function getSellerInfo($notify_endpoint = '') + { + $url = $this->api_url . '/seller/info'; + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + //$this->last_error = print_r($resp,true); + return false; + } + + // update data + $url = $this->api_url . '/seller/update'; + if(!empty($notify_endpoint)){ + $data = [ 'notification_url' => $notify_endpoint ]; + } + $data = json_encode($data); + $ret = $this->CallAPI($url, 'POST', $data); + + if(isset($resp['seller'])){ + return $resp['seller']; + } + //$this->last_error = print_r($resp,true); + + return false; + } + + public function getWarehouses() + { + $url = $this->api_url . '/seller/warehouses'; + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + $this->last_error = print_r($resp,true); + return false; + } + + if(isset($resp['module'])){ + return $resp['module']; + } + + return false; + } + + public function getFeedResult($document) + { + $url = $this->api_url . '/feed/result/' . $document; + $ret = $this->CallAPI($url); + return $ret; + } + + public function createProduct($json_product) + { + $url = $this->api_url . '/product/create'; + $ret = $this->CallAPI($url, 'POST', $json_product); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success'])){ + return false; + }else if(!$resp['success']){ + $this->last_error = $resp['message']; + if(isset($resp['detail'])){ + foreach ($resp['detail'] as $det){ + $this->last_error .= "\r" . $det['field'] . ': ' . $det['message']; + } + } + } + + return $resp; + } + + public function updateProduct($miravia_id, $json_product) + { + $url = $this->api_url . '/product/' . $miravia_id . '/update'; + $ret = $this->CallAPI($url, 'POST', $json_product); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success'])){ + return false; + }else if(!$resp['success']){ + $this->last_error = $resp['message']; + if(isset($resp['detail'])){ + foreach ($resp['detail'] as $det){ + $this->last_error .= "\r" . $det['field'] . ': ' . $det['message']; + } + } + } + + return $resp; + } + + public function getProductList($page = 1, $pagesize = 50) + { + $url = $this->api_url . '/product/list?pagesize=' . $pagesize . '&page=' . $page; + $ret = $this->CallAPI($url); + return json_decode($ret, true); + } + + public function getProductBySku($sku) + { + $url = $this->api_url . '/product/' . $sku . '/find'; + $ret = $this->CallAPI($url); + return json_decode($ret); + } + + public function getProductById($id) + { + $url = $this->api_url . '/product/' . $id . '/get'; + $ret = $this->CallAPI($url); + return json_decode($ret); + } + + public function updateStock($json_stock, $use_feed = false) + { + if($use_feed){ + $url = $this->api_url . '/feed/stock'; + }else{ + $url = $this->api_url . '/product/update_stock'; + } + $ret = $this->CallAPI($url, 'POST', $json_stock); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success'])){ + return false; + }else if(!$resp['success']){ + $this->last_error = $resp['message']; + if(isset($resp['detail'])){ + foreach ($resp['detail'] as $det){ + $this->last_error .= "\r" . $det['field'] . ': ' . $det['message']; + } + } + } + return $resp; + } + + public function disableProducts($itemids) + { + if(!is_array($itemids)){ + $itemids = [$itemids]; + } + $itemids = json_encode([ + 'item_ids' => $itemids + ]); + $url = $this->api_url . '/product/disable'; + $ret = $this->CallAPI($url, 'POST', $itemids); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success'])){ + return false; + }else { + return (bool) $resp['success']; + } + } + + public function enableProducts($itemids) + { + if(!is_array($itemids)){ + $itemids = [$itemids]; + } + $itemids = json_encode([ + 'item_ids' => $itemids + ]); + $url = $this->api_url . '/product/enable'; + $ret = $this->CallAPI($url, 'POST', $itemids); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success'])){ + return false; + }else { + return (bool) $resp['success']; + } + } + + public function deleteProduct($itemid) + { + $url = $this->api_url . '/product/' . $itemid . '/delete'; + $ret = $this->CallAPI($url, 'GET'); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success'])){ + return false; + }else { + return (bool) $resp['success']; + } + } + + public function getFeeds() + { + $url = $this->api_url . '/feed/list'; + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + return false; + } + if(isset($resp['feeds'])){ + return $resp['feeds']; + } + //$this->last_error = print_r($resp,true); + + return false; + } + + public function getFeedInfo($id) + { + $url = $this->api_url . '/feed/' . $id . '/get' ; + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(isset($resp['feed_result'])) { + $response = []; + if(isset($resp['response'])) { + $response = $resp['response']; + } + $resp = $resp['feed_result']; + $resp['response'] = $response; + }else{ + if(isset($resp['code'])){ + $this->last_error = $resp['code'] . ': ' . + @$resp['message'] ?: ''; + } + } + if(!isset($resp['success']) || !$resp['success']){ + return false; + } + return $resp; + } + + public function cancelFeed($id) + { + $url = $this->api_url . '/feed/' . $id . '/cancel' ; + $ret = $this->CallAPI($url, 'POST'); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(isset($resp['feed_result'])) { + $resp = $resp['feed_result']; + } + if(!isset($resp['success']) || !$resp['success']){ + return false; + } + return $resp; + } + + + public function sendFeed($data, $type = 'create') + { + $url = $this->api_url . '/feed/' . $type; + $ret = $this->CallAPI($url, 'POST', $data); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success'])){ + return false; + }else if(!$resp['success']){ + // $this->last_error = $resp['message']; + if(isset($resp['detail'])){ + foreach ($resp['detail'] as $det){ + $this->last_error .= "\r" . $det['field'] . ': ' . $det['message']; + } + } + } + + return $resp; + } + + /* + * $fromDate format: YYYY-MM-DD ('Y-m-d') + */ + public function getOrders(string $fromDate) + { + + if($d = date_parse_from_format('Y-m-d', $fromDate)){ + $fromDate = date('Y-m-d', mktime(0, 0, 0, $d['month'], $d['day'], $d['year'])); + }else{ + $this->last_error= 'Invalid date'; + return false; + } + + $url = $this->api_url . '/order/list'; + $url .= '?from_date=' . $fromDate; + + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + return false; + } + + return $resp; + } + + public function getOrder($order_number) + { + $url = $this->api_url . '/order/' . $order_number . '/get'; + + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + return false; + } + + return $resp; + } + + public function orderConfirmation($order_number, $status) + { + $url = $this->api_url . '/order/confirmation/' . $order_number . '/' . $status; + + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + return false; + } + + return $resp; + } + + public function orderPack($id_order, $products) + { + $url = $this->api_url . '/order/' . $id_order . '/pack'; + + if(is_array($products)){ + $data = json_encode($products); + }else{ + $data = $products; + } + + $ret = $this->CallAPI($url , 'POST', $data); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + return false; + } + + return $resp; + } + + public function getShippingLabel($package_id) + { + $url = $this->api_url . '/order/label/' . $package_id; + + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + return false; + } + + return $resp; + } + + public function getDBSCarriers() + { + $url = $this->api_url . '/order/dbs/providers'; + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(isset($resp['result'])){ + $resp = $resp['result']; + } + if(!isset($resp['success']) || !$resp['success']){ + return false; + } + return $resp; + } + + public function setDBSTracking($packages, $tracking, $provider) + { + if(!is_array($packages)){ + $packages = [$packages]; + } + $payload = []; + foreach ($packages as $package){ + $payload['packages'][] = [ + 'package_id' => $package, + 'tracking_number' => $tracking, + 'shipment_provider_code' => $provider + ]; + } + + $url = $this->api_url . '/order/dbs/update_tracking'; + $data = json_encode($payload); + $ret = $this->CallAPI($url, 'POST', $data); + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + $this->last_error = $ret; + return false; + } + return true; + } + + public function subscribe($seconds, $message='') + { + $url = $this->api_url . '/seller/notify/' . (int)$seconds; + if(!empty($message)){ + $url .= '?message=' . urlencode($message); + } + $ret = $this->CallAPI($url); + if($ret === false){ + return false; + } + $resp = json_decode($ret, true); + if(!isset($resp['success']) || !$resp['success']){ + return false; + } + return true; + } + + public function purgeImageCache() + { + $url = $this->api_url . '/image/cache/purge'; + $ret = $this->CallAPI($url); + return json_decode($ret, true); + } + + protected function CallAPI($url, $method='GET', $data = false) + { + $curl = curl_init(); + + switch ($method) + { + case "POST": + curl_setopt($curl, CURLOPT_POST, 1); + + if ($data) { + curl_setopt($curl, CURLOPT_POSTFIELDS, $data); + } + break; + case "PUT": + curl_setopt($curl, CURLOPT_PUT, 1); + break; + default: + if ($data) + $url = sprintf("%s?%s", $url, http_build_query($data)); + } + + curl_setopt($curl, CURLOPT_URL, $url); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + + if($this->insecure_mode) { + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); + } + + if(!empty($this->api_key)){ + curl_setopt($curl, CURLOPT_HTTPHEADER, array( + 'Api-Token: ' . $this->api_key + )); + } + + $result = curl_exec($curl); + if($result === false){ + $this->last_error = curl_error($curl); + } + curl_close($curl); + return $result; + } + +} diff --git a/connector-miravia/classes/shared/MiraviaProduct.php b/connector-miravia/classes/shared/MiraviaProduct.php new file mode 100644 index 0000000..e7cae76 --- /dev/null +++ b/connector-miravia/classes/shared/MiraviaProduct.php @@ -0,0 +1,186 @@ + "value", ... ] + public $combinations = []; // Array of MiraviaCombination class + public $info = []; // Internal info (for filters) + + protected $private_vars = ['private_vars', 'error', 'id', 'combinations', 'info']; + public $error = ''; + + public function __construct() + { + // + } + + public function addAttr($key = false, $value = false) { + if($key and $value) { + $this->extra_attributes[$key] = $value; + } + } + + public function getData() + { + $product = []; + foreach ($this as $key => $value){ + if(!in_array($key, $this->private_vars)){ + if($key === 'images' && is_array($value) && !empty($value)){ + $product['Images'] = ['Image' => $value]; + } else if($key !== 'images') { + $product[$key] = $value; + } + } + } + $combinations = $this->getCombinations(); + $product['combinations'] = $combinations; + return $product; + } + + public function getStockData() + { + $combis = []; + foreach ($this->combinations as $combination){ + $combis[] = $combination->getStockData(); + } + if(count($combis)==0){ + $combis =[[ + 'sku' => $this->sku, + 'price' => $this->price, + 'special_price' => $this->special_price, + 'quantity' => $this->quantity >= 0 ? $this->quantity : 0 + ]]; + $this->reference_sku = $this->sku; + } + $ret = [ + 'id' => $this->id, + 'id_miravia' => $this->id_miravia, + 'sku' => $this->sku, + 'combinations' => $combis + ]; + if(!empty($this->warehouse)){ + $ret['warehouse'] = $this->warehouse; + } + return $ret; + } + + public function getOnlyStockData() + { + $combis = []; + foreach ($this->combinations as $combination){ + $combis[] = $combination->getOnlyStockData(); + } + if(count($combis)==0){ + $combis =[[ + 'sku' => $this->sku, + 'quantity' => $this->quantity >= 0 ? $this->quantity : 0 + ]]; + $this->reference_sku = $this->sku; + } + $ret = [ + 'id' => $this->id, + 'id_miravia' => $this->id_miravia, + 'sku' => $this->sku, + 'combinations' => $combis + ]; + if(!empty($this->warehouse)){ + $ret['warehouse'] = $this->warehouse; + } + return $ret; + } + + public function getJSON($pretty = false) + { + $flags = $pretty ? JSON_PRETTY_PRINT : 0; + return json_encode($this->getData(), $flags); + } + + public function getCombinations() + { + $ret = []; + foreach ($this->combinations as $combination){ + $ret[] = $combination->getData(); + } + return $ret; + } + + public function createProduct($apiKey) + { + if(!empty($this->id_miravia)){ + return $this->updateProduct($apiKey); + } + $jreq = json_encode($this->getData()); + $link = new MiraviaLink($apiKey); + $ret = $link->createProduct($jreq); + if($ret == false) { + $this->error = $link->last_error; + } + if(isset($ret['data'])){ + if(isset($ret['data']['item_id'])){ + $this->id_miravia = $ret['data']['item_id']; + } + } + return true; + } + + public function updateProduct($apiKey) + { + if(empty($this->id_miravia)){ + $this->error = 'Invalid Miravia Id Product'; + return false; + } + $jreq = json_encode($this->getData()); + $link = new MiraviaLink($apiKey); + $ret = $link->updateProduct($this->id_miravia, $jreq); + if($ret == false) { + $this->error = $link->last_error; + } + if(isset($ret['data'])){ + if(isset($ret['data']['item_id'])){ + $this->id_miravia = $ret['data']['item_id']; + } + return true; + } + if(isset($ret['message'])){ + $this->error = $ret['message']; + } + return false; + } + + public function getInfoValue($field) + { + if(isset($this->info[$field])){ + return $this->info[$field]; + } + return ''; + } + +} + diff --git a/connector-miravia/classes/tables/class.table.php b/connector-miravia/classes/tables/class.table.php new file mode 100644 index 0000000..1e74488 --- /dev/null +++ b/connector-miravia/classes/tables/class.table.php @@ -0,0 +1,173 @@ +Letter Templates Add New'; + // } + } + + public function prepare_items() + { + $hidden = $this->get_hidden_columns(); + $sortable = $this->get_sortable_columns(); + + $data = $this->table_data(); + usort( $data, array( &$this, 'sort_data' ) ); + + $perPage = $this->perPage; + $currentPage = $this->get_pagenum(); + $totalItems = $this->total_elements; + + $this->set_pagination_args( array( + 'total_items' => $totalItems, + 'per_page' => $perPage + ) ); + + $data = array_slice($data,(($currentPage-1)*$perPage),$perPage); + + $this->_column_headers = array($this->columns, $hidden, $sortable); + $this->items = $data; + } + + /** + * Override the parent columns method. Defines the columns to use in your listing table + * + * @return Array + */ + public function get_columns() + { + return $this->columns; + } + + /** + * Define which columns are hidden + * + * @return Array + */ + public function get_hidden_columns() + { + return array(); + } + + /** + * Define the sortable columns + * + * @return Array + */ + public function get_sortable_columns() + { + + $sortable = array(); + // if($this->total_elements and count($this->data_table) > 0) { + + + // foreach($this->data_table[0] as $k => $v) { + // $sortable[$k] = array($k, false); + // } + // } + return $this->sortable_custom_columns; + } + + /** + * Get the table data + * + * @return Array + */ + private function table_data() + { + return $this->data_table; + } + + /** + * Define what data to show on each column of the table + * + * @param Array $item Data + * @param String $column_name - Current column name + * + * @return Mixed + */ + public function column_default( $item, $column_name ) + { + + return $item[ $column_name ]; + } + + public function column_name($item){ + $item_json = json_decode(json_encode($item), true); + $copy = $this->custom_actions; + foreach($this->custom_actions as $k => $action) { + foreach($item_json as $key => $d) { + $action = str_replace("[".$key."]", $item_json[$key], $action); + } + $this->custom_actions[$k] = $action; + } + + $result = sprintf('%s %s', $item_json[$this->default_column_name], $this->row_actions($this->custom_actions)); + $this->custom_actions = $copy; + return $result; + } + + /** + * Allows you to sort the data by the variables set in the $_GET + * + * @return Mixed + */ + private function sort_data( $a, $b ) + { + // Set defaults + $orderby = 'title'; + $order = 'asc'; + + // If orderby is set, use this as the sort column + if(!empty($_GET['orderby'])) + { + $orderby = sanitize_text_field($_GET['orderby']); + } + + // If order is set use this as the order + if(!empty($_GET['order'])) + { + $order = sanitize_text_field($_GET['order']); + } + $result = ''; + if(isset($a[$orderby])) { + $result = strcmp( $a[$orderby], $b[$orderby] ); + } + + if($order === 'asc') + { + return $result; + } + + return -$result; + } +} diff --git a/connector-miravia/connector-miravia.php b/connector-miravia/connector-miravia.php new file mode 100644 index 0000000..c44b6dc --- /dev/null +++ b/connector-miravia/connector-miravia.php @@ -0,0 +1,357 @@ +sku); + $accounts = MiraviaCore::accounts_by_profile($profile); + if(count($accounts) > 0) { + MiraviaCore::request_notify($accounts[0]['token'], 'update_stock'); + } + } + + return true; + } + + function miravia_save_metadata_product( $id ){ + if(isset($_POST['miravia_brand_product'])) { + $product = wc_get_product( $id ); + + $product->update_meta_data( '_miravia_brand_product', sanitize_text_field( $_POST[ 'miravia_brand_product' ] ) ); + $product->update_meta_data( '_miravia_unit', sanitize_text_field( $_POST[ 'miravia_unit' ] ) ); + $product->update_meta_data( '_miravia_unit_value', sanitize_text_field( $_POST[ 'miravia_unit_value' ] ) ); + $product->save_meta_data(); + } + } + + function miravia_product_metabox() { + require_once(MIRAVIA_VIEWS_PATH . "/metabox/miravia-product.php"); + } + + function colum_orders( $column, $post_id ) { + if ($column == 'order_status'){ + $orderID = get_post_meta($post_id, '_miravia_order_id', true); + if($orderID != '' and $orderID != 0) { + echo ''.sprintf(__('Created Vía %s','aliexpress'), 'Miravia').''; + } + } + } + + function miravia_update_product( $product_id ) { + if(get_option('miravia_only_stock', '0') == '1') { + return; + } + global $isSetter; + + + if($product_id instanceof WC_Product) { + $product_id = $product_id->ID; + }elseif(isset($product_id['id'])) { + $product_id = $product_id['id']; + } + + if(get_post_meta($product_id, '_miravia_need_update', true) == '1') { + LOG::add("{$product_id} no necesita notificación, ya programada."); + return; + } + LOG::add("Estableciendo notificación para el producto {$product_id}"); + update_post_meta($product_id, '_miravia_need_update', '1'); + + if($isSetter) { + LOG::add("No es necesario establecer aviso"); + return; + } + + if($product_id) { + $sync = MiraviaCore::get_product_miravia($product_id); + if($sync) { + //ESTABLECER NOTIFICACIÓN + $apiKey = MiraviaCore::get_miravia_account_default(); + $resultNotify = MiraviaCore::request_notify($apiKey['token'], 'update_stock'); + if($resultNotify === -1) { + LOG::add("Existe una notificación pendiente"); + return; + } + if($resultNotify) { + LOG::add("Seteada notificación correctamente"); + $isSetter = true; + } + } + } + } + function miravia_desactivation() { + update_option('miravia_db_version', 0); + } + + public function miravia_profiles_actions( $actions, $post ) { + if ( current_user_can( 'edit_posts' ) ) { + $actions['miravia'] = '' . __('Edit') . ''; + } + + return $actions; + } + + + function colum_product($column, $post_id){ + if($column == 'miravia_data') { + $html = '
'; + $sync = MiraviaCore::get_product_miravia($post_id); + $dateUpdated = 'ND'; + if($sync and count($sync) > 0) { + if($sync[0]['last_updated'] == '0000-00-00 00:00:0') { + $dateUpdated = date('d-m-Y H:i:s', strtotime($sync[0]['last_updated'])); + } + //MiraviaCore::debug($sync); + if(count($sync) > 1) { + $html .= __('Uploaded with multiple accounts','miraviawoo'); + }else{ + if($sync[0]['id_miravia'] != '' and $sync[0]['id_miravia'] != 0) { + $html .= "View
".__('Last Update:','miraviawoo')." ".$dateUpdated."
"; + $html .= "

Status: {$sync[0]['status_text']}

"; + } + } + + if(trim($sync[0]['lastError']) != '') { + $html .= ''; + } + }else{ + } + + $html .= '
'; + echo wp_kses($html, array( + 'a' => array( + 'href' => array(), + 'class' => array(), + 'data-id' => array(), + ), + 'span' => array( + 'class' => array() + ), + 'i' => array('class' => array(),), + 'p' => array() + )); + } + + } + + function add_colum_products( $columns ) { + return array_merge( $columns, + array( 'miravia_data' => __( 'Miravia', 'miraviawoo' ) ) ); + } + + function load_style() { + if(is_admin()) { + wp_enqueue_style( 'cssmiravia', plugins_url('assets/css/miravia-admin.css?v='.time(), __FILE__) ); + wp_enqueue_script( 'productmiravia', plugins_url('assets/js/products.js?v='.time(), __FILE__), array( 'wp-i18n' ) ); + + wp_localize_script( 'productmiravia', 'MIRAVIA_DATA_JAVASCRIPT', array( + 'adminAjaxURL' => admin_url('admin-ajax.php'), + )); + wp_enqueue_script( 'jquery-ui-core', false, array('jquery') ); + wp_enqueue_script('jquery'); + wp_enqueue_script( 'filter_rules_plugin_miravia_localization', plugins_url('lib/filter_rules/localization/es.min.js', __FILE__)); + wp_enqueue_script( 'filter_rules_plugin_miravia', plugins_url('lib/filter_rules/jquery.jui_filter_rules.min.js', __FILE__),array('jquery')); + wp_enqueue_script( 'filter_rules_miravia', plugins_url('lib/filter_rules_miravia.js?v='.time(), __FILE__), array('jquery')); + wp_enqueue_style( 'fontawesome_miravia_css', plugins_url('lib/fontawesome-6.1.2.all.min.css', __FILE__) ); + if(isset($_GET['page']) and sanitize_text_field($_GET['page']) == 'miravia_settings') { + wp_enqueue_script( 'sweetalert_lib', plugins_url('lib/sweetalert2.min.js', __FILE__) ); + wp_enqueue_script( 'select2_lib', plugins_url('lib/select2.min.js', __FILE__) ); + wp_enqueue_style( 'select2_css', plugins_url('lib/select2.min.css', __FILE__) ); + } + wp_enqueue_style( 'filter_rules_css', plugins_url('lib/filter_rules/jquery.jui_filter_rules.bs.min.css', __FILE__) ); + wp_enqueue_script( 'fontawesome_miravia_js', plugins_url('lib/fontawesome-6.1.2.all.min.js', __FILE__) ); + } + } + + + function admin_menu() { + global $iconUrl; + add_menu_page( + esc_html__( 'Miravia', 'miraviawoo' ), + esc_html__( 'Miravia', 'miraviawoo'), + 'manage_woocommerce', + 'miravia_settings', + array($this, 'settings_page'), + $iconUrl, + 55.5 + ); + // add_submenu_page( + // 'miravia_settings', + // esc_html__( 'Brands', 'miraviawoo' ), + // esc_html__( 'Brands', 'miraviawoo'), + // 'manage_woocommerce', + // 'miravia_settings&subpage=brands', + // array($this, 'settings_page'), + // 10 + // ); + add_submenu_page( + 'miravia_settings', + esc_html__( 'Orders', 'miraviawoo' ), + esc_html__( 'Orders', 'miraviawoo'), + 'manage_woocommerce', + 'miravia_settings&subpage=orders', + array($this, 'settings_page'), + 10 + ); + add_submenu_page( + 'miravia_settings', + esc_html__( 'Jobs', 'miraviawoo' ), + esc_html__( 'Jobs', 'miraviawoo'), + 'manage_woocommerce', + 'miravia_settings&subpage=jobs', + array($this, 'settings_page'), + 10 + ); + add_submenu_page( + 'miravia_settings', + esc_html__( 'Accounts', 'miraviawoo' ), + esc_html__( 'Accounts', 'miraviawoo'), + 'manage_woocommerce', + 'miravia_settings&subpage=accounts', + array($this, 'settings_page'), + 10 + ); + add_submenu_page( + 'miravia_settings', + esc_html__( 'Profiles', 'miraviawoo' ), + esc_html__( 'Profiles', 'miraviawoo'), + 'manage_woocommerce', + 'miravia_settings&subpage=profiles', + array($this, 'settings_page'), + 10 + ); + add_submenu_page( + 'miravia_settings', + esc_html__( 'Products', 'miraviawoo' ), + esc_html__( 'Products', 'miraviawoo'), + 'manage_woocommerce', + 'miravia_settings&subpage=products', + array($this, 'settings_page'), + 10 + ); + add_submenu_page( + 'miravia_settings', + esc_html__( 'Miravia Products', 'miraviawoo' ), + esc_html__( 'Miravia Products', 'miraviawoo'), + 'manage_woocommerce', + 'miravia_settings&subpage=products_remote', + array($this, 'settings_page'), + 10 + ); + add_submenu_page( + 'miravia_settings', + esc_html__( 'Rules', 'miraviawoo' ), + esc_html__( 'Rules', 'miraviawoo'), + 'manage_woocommerce', + 'miravia_settings&subpage=rules', + array($this, 'settings_page'), + 10 + ); + } + + function create_miravia_order_metabox() { + global $post; + if(get_post_meta($post->ID, '_miravia_order_id', true)){ + add_meta_box( 'aew_number_shipping_metabox', __('Miravia Tracker','miraviawoo'), array($this, 'content_metabox_miravia_order'), 'shop_order', 'normal', 'high' ); + } + } + function content_metabox_miravia_order($post) { + require_once(MIRAVIA_VIEWS_PATH . '/metabox/miravia-order.php'); + } + + public function settings_page() { + include MIRAVIA_VIEWS_PATH . 'settings.php'; + } + + public function brands_page() { + include MIRAVIA_VIEWS_PATH . 'brands.php'; + } + + function admin_init() { + + } + } +} + +$MIRAVIAWOO = new MIRAVIAWOO(); \ No newline at end of file diff --git a/connector-miravia/lib/filter_rules/jquery.jui_filter_rules.bs.min.css b/connector-miravia/lib/filter_rules/jquery.jui_filter_rules.bs.min.css new file mode 100644 index 0000000..75fb647 --- /dev/null +++ b/connector-miravia/lib/filter_rules/jquery.jui_filter_rules.bs.min.css @@ -0,0 +1,181 @@ +/* + * jui_filter_rules v1.0.7 CSS (for Bootstrap) ********************************* +*/ + +/* +DO NOT CHANGE this file, as it will be overwritten in next update. +Write your own classes in other css file. +*/ + +/* container ---------------------------------------------------------------- */ +.filter_rules_container { + padding: 10px 0; +} + +/* rules group -------------------------------------------------------------- */ +.rules_group_container { + padding: 0; + margin: 0; +} + +.rules_group_header { + padding: 5px 0; +} + +.rules_group_body { + padding: 0; + margin: 0; +} + +.rules_group_condition_container { + display: inline-block; + padding: 0; +} + +.rules_group_condition_list { + border: 1px solid; +} + +.rules_group_tools_container { + display: inline-block; + padding: 0; + margin-left: 5px; +} + +.rules_group_tools_list { + border: 1px solid; + padding: 2px; + margin: 0; + width: 35px; +} + +/* rules list --------------------------------------------------------------- */ +.rules_list { + width: auto !important; + list-style-type: none; + padding: 0 0 0 25px; + border-left: dotted 1px !important; + border-right: none !important; + border-top: none !important; + border-bottom: none !important; +} + +.rules_list_li { + margin: 0 0 2px 0 !important; + padding: 0 !important; + display: block !important; +} + +.rules_list_applied_li { +} + +.rules_list_error_li { + background-color: #df0202 !important; +} + +/* filter name -------------------------------------------------------------- */ +.filter_container { + display: inline-block; + padding: 5px 5px 5px 0; + vertical-align: top; +} + +.filter_list { +} + +/* operator ----------------------------------------------------------------- */ +.operators_list_container { + display: inline-block; + padding: 5px; + vertical-align: top; +} + +.operators_list { +} + +/* filter value ------------------------------------------------------------- */ +.filter_value_container { + display: inline-block; + padding: 5px; +} + +.filter_input_text { +} + +.filter_input_number { + width: 80px; +} + +.filter_input_date { +} + +.filter_input_checkbox { + margin: 0 5px 0 0; + display: inline !important; +} + +.filter_input_radio { + margin: 0 5px 0 0; +} + +.filter_select { + margin: 0 5px; +} + +.filter_group_list { + list-style-type: none; + padding: 0; +} + +.filter_group_list_item_horizontal { + display: inline !important; + margin: 0 5px; + padding: 0; +} + +.filter_group_list_item_vertical { + display: block !important; + margin: 0 0 5px 5px !important; + padding: 0 !important; +} + +/* filter tools ------------------------------------------------------------- */ +.rule_tools_container { + display: inline-block !important; + padding: 5px !important; + vertical-align: top !important; +} + +.rule_tools_list { + padding: 0; + margin: 0; + width: 35px; +} + +/* no filters div ----------------------------------------------------------- */ +.no_filters_found{ + text-align: center; + margin-top: 10px; + margin-left: auto; + margin-right: auto; +} + + +/* IE8 CSS hack ------------------------------------------------------------- */ +/* http://dimox.net/personal-css-hacks-for-ie6-ie7-ie8/ */ +@media \0screen { + + .rules_group_tools_list { + border: 1px solid; + padding: 2px; + margin: 0; + width: auto; + } + + .rule_tools_list { + padding: 0; + margin: 0; + width: auto; + } +} +/* -------------------------------------------------------------------------- */ \ No newline at end of file diff --git a/connector-miravia/lib/filter_rules/jquery.jui_filter_rules.min.css b/connector-miravia/lib/filter_rules/jquery.jui_filter_rules.min.css new file mode 100644 index 0000000..6216881 --- /dev/null +++ b/connector-miravia/lib/filter_rules/jquery.jui_filter_rules.min.css @@ -0,0 +1,5 @@ +/* + * jui_filter_rules v1.0.7 CSS ************************************************* + * Minified using http://gpbmike.github.io/refresh-sf/ +*/ +.filter_rules_container{padding:5px 10px 10px}.rules_group_container{padding:0;margin:0}.rules_group_header{padding:5px 0}.rules_group_body{padding:0;margin:0}.rules_group_condition_container{display:inline-block;padding:0}.rules_group_condition_list{border:1px solid;padding:2px 0;margin:0}.rules_group_tools_container{display:inline-block;padding:0;margin-left:5px}.rules_group_tools_list{border:1px solid;padding:2px;margin:0;width:35px}.rules_list{width:auto!important;list-style-type:none;padding:0 0 0 25px;border-left:dotted 1px!important;border-right:none!important;border-top:none!important;border-bottom:none!important}.rules_list_li{margin:0 0 2px!important;padding:0!important;background-color:#f3f3f3!important;display:block!important}.rules_list_applied_li{background-color:#CF9!important}.rules_list_error_li{background-color:#df0202!important}.filter_container{display:inline-block;padding:5px 5px 5px 0;vertical-align:top}.filter_list{padding:0;margin:0;background:0 0}.operators_list_container{display:inline-block;padding:5px;width:180px;vertical-align:top}.operators_list{padding:0;margin:0;background:0 0}.filter_value_container{display:inline-block;padding:5px}.filter_input_text{width:180px;margin:0 5px;padding:0}.filter_input_number{width:75px;margin:0 5px;padding:0}.filter_input_date{width:150px;margin:0 5px;padding:0}.filter_input_checkbox,.filter_input_radio{margin:0 5px 0 0}.filter_select{margin:0 5px}.filter_group_list{list-style-type:none;padding:0}.filter_group_list_item_horizontal{display:inline!important;margin:0 5px;padding:0}.filter_group_list_item_vertical{display:block!important;margin:0 0 5px 5px!important;padding:0!important}.rule_tools_container{display:inline-block!important;padding:5px!important;float:right!important;vertical-align:top!important}.rule_tools_list{padding:0;margin:0;width:35px}.no_filters_found{text-align:center;margin-top:10px;margin-left:auto;margin-right:auto}@media \0screen{.rules_group_tools_list{border:1px solid;padding:2px;margin:0;width:auto}.rule_tools_list{padding:0;margin:0;width:auto}} \ No newline at end of file diff --git a/connector-miravia/lib/filter_rules/jquery.jui_filter_rules.min.js b/connector-miravia/lib/filter_rules/jquery.jui_filter_rules.min.js new file mode 100644 index 0000000..6b1c516 --- /dev/null +++ b/connector-miravia/lib/filter_rules/jquery.jui_filter_rules.min.js @@ -0,0 +1,1747 @@ +/** + * @fileOverview jui_filter_rules is a jQuery plugin, useful to create or set filter rules as JSON object and get the relevant WHERE SQL. + *

License MIT + *
Copyright 2013 - 2015 Christos Pontikis http://pontikis.net + *
Project page http://pontikis.net/labs/jui_filter_rules + * @version 1.0.7 (08 Apr 2015) + * @author Christos Pontikis http://www.pontikis.net + * @requires jquery >= 1.8 (optional but highly recommended moment.js, jquery-ui, twitter bootstrap >= 2) + */ + +/** + * See http://jquery.com. + * @name $ + * @class + * See the jQuery Library (http://jquery.com) for full details. This just + * documents the function and classes that are added to jQuery by this plug-in. + */ + +/** + * See http://jquery.com + * @name fn + * @class + * See the jQuery Library (http://jquery.com) for full details. This just + * documents the function and classes that are added to jQuery by this plug-in. + * @memberOf $ + */ + +/** + * Pseudo-Namespace containing private methods (for documentation purposes) + * @name _private_methods + * @namespace + */ +"use strict"; +(function($) { + + var pluginName = 'jui_filter_rules', + pluginStatus = 'jui_filter_rules_status', + filter_types = [ + "text", + "number", + "date" + ], operators = [ + {type: "equal", accept_values: "yes", apply_to: ["text", "number", "date"], group: "equality"}, + {type: "not_equal", accept_values: "yes", apply_to: ["text", "number", "date"], group: "equality"}, + {type: "in", accept_values: "yes", apply_to: ["text", "number", "date"], group: "multiple_choice"}, + {type: "not_in", accept_values: "yes", apply_to: ["text", "number", "date"], group: "multiple_choice"}, + {type: "less", accept_values: "yes", apply_to: ["number", "date"], group: "inequality"}, + {type: "less_or_equal", accept_values: "yes", apply_to: ["number", "date"], group: "inequality"}, + {type: "greater", accept_values: "yes", apply_to: ["number", "date"], group: "inequality"}, + {type: "greater_or_equal", accept_values: "yes", apply_to: ["number", "date"], group: "inequality"}, + {type: "begins_with", accept_values: "yes", apply_to: ["text"], group: "substring"}, + {type: "not_begins_with", accept_values: "yes", apply_to: ["text"], group: "substring"}, + {type: "contains", accept_values: "yes", apply_to: ["text"], group: "substring"}, + {type: "not_contains", accept_values: "yes", apply_to: ["text"], group: "substring"}, + {type: "ends_with", accept_values: "yes", apply_to: ["text"], group: "substring"}, + {type: "not_ends_with", accept_values: "yes", apply_to: ["text"], group: "substring"}, + {type: "is_empty", accept_values: "no", apply_to: ["text"], group: "empty_string"}, + {type: "is_not_empty", accept_values: "no", apply_to: ["text"], group: "empty_string"}, + {type: "is_null", accept_values: "no", apply_to: ["text", "number", "date"], group: "null"}, + {type: "is_not_null", accept_values: "no", apply_to: ["text", "number", "date"], group: "null"} + ]; + + + /* public methods ------------------------------------------------------- */ + var methods = { + + /** + * @lends $.fn.jui_filter_rules + */ + init: function(options) { + + var elem = this; + + return this.each(function() { + + /** + * settings and defaults + * using $.extend, settings modification will affect elem.data() and vive versa + */ + var settings = elem.data(pluginName); + if(typeof(settings) == 'undefined') { + var bootstrap_version = false; + if(options.hasOwnProperty("bootstrap_version") && options["bootstrap_version"] == "3") { + bootstrap_version = "3"; + } + if(options.hasOwnProperty("bootstrap_version") && options["bootstrap_version"] == "2") { + bootstrap_version = "2"; + } + var defaults = methods.getDefaults.call(elem, bootstrap_version); + settings = $.extend({}, defaults, options); + } else { + settings = $.extend({}, settings, options); + } + elem.data(pluginName, settings); + + // initialize plugin status + if(typeof elem.data(pluginStatus) === 'undefined') { + elem.data(pluginStatus, {}); + elem.data(pluginStatus)["group_id"] = 0; + elem.data(pluginStatus)["rule_id"] = 0; + } + + var container_id = elem.attr("id"); + + // simple validation + validate_input(container_id); + + // bind events + elem.unbind("onValidationError").bind("onValidationError", settings.onValidationError); + elem.unbind("onSetRules").bind("onSetRules", settings.onSetRules); + + var filters = settings.filters, + + filters_list_id_prefix = create_id(settings.filters_list_id_prefix, container_id) + '_', + operators_container_id_prefix = create_id(settings.operators_container_id_prefix, container_id) + '_', + operators_list_id_prefix = create_id(settings.operators_list_id_prefix, container_id) + '_', + operator, + filter_value_container_id_prefix = create_id(settings.filter_value_container_id_prefix, container_id) + '_', + group_condition_id_prefix = create_id(settings.group_condition_id_prefix, container_id) + '_', + group_tools_id_prefix = create_id(settings.group_tools_id_prefix, container_id) + '_', + rule_tools_id_prefix = create_id(settings.rule_tools_id_prefix, container_id) + '_', + filters_list_id, operators_list_id, operators_container_id, filter_value_container_id, + elem_filters_list, elem_operators_list, elem_operators_container, elem_filter_value_container, + selector, len, rule_id, filter_index, group_selected, tool_selected, + rulesListLiAppliedClass = settings.rulesListLiAppliedClass, + rulesListLiErrorClass = settings.rulesListLiErrorClass; + + if(elem.data(pluginStatus)["rule_id"] == 0) { + if(filters.length > 0) { + elem.html(createRulesGroup(container_id)); + } else { + elem.html('

' + rsc_jui_fr.no_filters_found + '
'); + } + } + + elem.addClass(settings.containerClass); + + /* EVENTS --------------------------------------------------- */ + // rule group actions + selector = '[id^="' + group_tools_id_prefix + '"]'; + elem.off('change', selector).on('change', selector, function() { + len = group_tools_id_prefix.length; + rule_id = $(this).attr("id").substr(len); + group_selected = $(this).val(); + + switch(group_selected) { + case "rule_insert_before": + $(this).closest("dt").parent("dl").before(createRule(container_id)); + break; + case "rule_insert_after": + $(this).closest("dt").parent("dl").after(createRule(container_id)); + break; + case "rule_insert_inside": + $(this).closest("dt").next("dd:first").find("ul:first").prepend(createRule(container_id)); + break; + case "group_insert_before": + $(this).closest("dl").before(createRulesGroup(container_id)); + break; + case "group_insert_after": + $(this).closest("dl").after(createRulesGroup(container_id)); + break; + case "group_insert_inside": + $(this).closest("dt").next("dd:first").find("ul:first").prepend(createRulesGroup(container_id)); + break; + case "group_delete": + $(this).closest("dl").remove(); + break; + } + + $(this).prop("selectedIndex", 0); + + }); + + // rule actions + selector = '[id^="' + rule_tools_id_prefix + '"]'; + elem.off('change', selector).on('change', selector, function() { + len = rule_tools_id_prefix.length; + rule_id = $(this).attr("id").substr(len); + tool_selected = $(this).val(); + + switch(tool_selected) { + case "rule_insert_before": + $(this).closest("li").before(createRule(container_id)); + break; + case "rule_insert_after": + $(this).closest("li").after(createRule(container_id)); + break; + case "rule_clear": + filters_list_id = filters_list_id_prefix + rule_id; + operators_container_id = operators_container_id_prefix + rule_id; + filter_value_container_id = filter_value_container_id_prefix + rule_id; + elem_filters_list = $("#" + filters_list_id); + elem_operators_container = $("#" + operators_container_id); + elem_filter_value_container = $("#" + filter_value_container_id); + + elem_filters_list.prop("selectedIndex", 0); + elem_operators_container.html(''); + elem_filter_value_container.html(''); + elem.jui_filter_rules("markRuleAsPending", $(this).closest("li").attr("id")); + break; + case "rule_delete": + $(this).closest("li").remove(); + break; + case "group_insert_before": + $(this).closest("li").before(createRulesGroup(container_id)); + break; + case "group_insert_after": + $(this).closest("li").after(createRulesGroup(container_id)); + break; + } + + $(this).prop("selectedIndex", 0); + + }); + + // change group condition + selector = '[id^="' + group_condition_id_prefix + '"]'; + elem.off('change', selector).on('change', selector, function() { + // unmark applied rules + $(this).closest("dl").find("li").each(function() { + elem.jui_filter_rules("markRuleAsApplied", $(this).attr("id"), false); + }); + }); + + // change filter + selector = '[id^="' + filters_list_id_prefix + '"]'; + elem.off('change', selector).on('change', selector, function() { + len = filters_list_id_prefix.length; + rule_id = $(this).attr("id").substr(len); + filter_index = $(this).prop('selectedIndex') - 1; + + operators_container_id = operators_container_id_prefix + rule_id; + operators_list_id = operators_list_id_prefix + rule_id; + filter_value_container_id = filter_value_container_id_prefix + rule_id; + elem_operators_container = $("#" + operators_container_id); + elem_filter_value_container = $("#" + filter_value_container_id); + + elem_filter_value_container.show(); + if(filter_index >= 0) { + elem_operators_container.html(create_operators_list(container_id, rule_id, $(this).val())); + elem_operators_list = $("#" + operators_list_id); + create_filter_value(container_id, rule_id, $(this).val(), elem_operators_list.val()); + } else { + elem_operators_container.html(''); + elem_filter_value_container.html(''); + } + + elem.jui_filter_rules("markRuleAsPending", $(this).closest("li").attr("id")); + }); + + // change operator + selector = '[id^="' + operators_list_id_prefix + '"]'; + elem.off('change', selector).on('change', selector, function() { + len = operators_list_id_prefix.length; + rule_id = $(this).attr("id").substr(len); + + filters_list_id = filters_list_id_prefix + rule_id; + operators_list_id = operators_list_id_prefix + rule_id; + filter_value_container_id = filter_value_container_id_prefix + rule_id; + elem_filters_list = $("#" + filters_list_id); + elem_operators_list = $("#" + operators_list_id); + elem_filter_value_container = $("#" + filter_value_container_id); + + operator = getOperator($(this).val()); + if(operator.accept_values !== "yes") { + elem_filter_value_container.hide(); + } else { + elem_filter_value_container.show(); + if(elem_filter_value_container.html() == '') { + create_filter_value(container_id, rule_id, elem_filters_list.val(), elem_operators_list.val()); + } + } + elem.jui_filter_rules("markRuleAsPending", $(this).closest("li").attr("id")); + }); + + + if(settings.filter_rules.length > 0) { + apply_rules(settings.filter_rules, elem, container_id); + } + + + }); + + }, + + /** + * Get plugin version + * @returns {string} + */ + getVersion: function() { + return "1.0.7"; + }, + + /** + * Get default values + * @example $(element).jui_filter_rules('getDefaults', false); + * @param {boolean|string} bootstrap_version + * @return {Object} + */ + getDefaults: function(bootstrap_version) { + var default_settings = { + filters: [], + filter_rules: [], + + decimal_separator: ".", + htmlentities: false, + + // styles + bootstrap_version: false, + + containerClass: "filter_rules_container", + + rulesGroupContainerClass: "rules_group_container", + rulesGroupHeaderClass: "rules_group_header", + rulesGroupBodyClass: "rules_group_body", + + rulesGroupConditionContainerClass: "rules_group_condition_container", + rulesGroupConditionListClass: "rules_group_condition_list", + + rulesGroupToolsContainerClass: "rules_group_tools_container", + rulesGroupToolsListClass: "rules_group_tools_list", + + rulesListClass: "rules_list", + rulesListLiClass: "rules_list_li", + rulesListLiErrorClass: "rules_list_error_li", + rulesListLiAppliedClass: "rules_list_applied_li", + + filterContainerClass: "filter_container", + filterListClass: "filter_list", + + operatorsListContainerClass: "operators_list_container", + operatorsListClass: "operators_list", + + filterValueContainerClass: "filter_value_container", + filterInputTextClass: "filter_input_text", + filterInputNumberClass: "filter_input_number", + filterInputDateClass: "filter_input_date", + filterInputCheckboxClass: "filter_input_checkbox", + filterInputRadioClass: "filter_input_radio", + filterSelectClass: "filter_select", + + filterGroupListClass: "filter_group_list", + filterGroupListItemHorizontalClass: "filter_group_list_item_horizontal", + filterGroupListItemVerticalClass: "filter_group_list_item_vertical", + + ruleToolsContainerClass: "rule_tools_container", + ruleToolsClass: "rule_tools_list", + + noFiltersFoundClass: "no_filters_found", + + // elements id prefix + group_dl_id_prefix: "group_", + group_condition_id_prefix: "group_cond_", + group_tools_id_prefix: "group_tools_", + rule_li_id_prefix: "rule_", + filters_list_id_prefix: "filters_list_", + operators_container_id_prefix: "oper_wrap_", + operators_list_id_prefix: "oper_list_", + filter_value_container_id_prefix: "flt_wrap_", + filter_element_id_prefix: "flt_", + filter_element_name_prefix: "flt_name_", + rule_tools_id_prefix: "rule_tools_", + + onSetRules: function() { + }, + onValidationError: function() { + } + }; + + if(bootstrap_version == "3") { + default_settings.bootstrap_version = "3"; + + default_settings.containerClass = "filter_rules_container"; + + default_settings.rulesGroupContainerClass = "rules_group_container"; + default_settings.rulesGroupHeaderClass = "rules_group_header"; + default_settings.rulesGroupBodyClass = "rules_group_body"; + + default_settings.rulesGroupConditionContainerClass = "rules_group_condition_container"; + default_settings.rulesGroupConditionListClass = "form-control input-sm rules_group_condition_list"; + + default_settings.rulesGroupToolsContainerClass = "rules_group_tools_container"; + default_settings.rulesGroupToolsListClass = "form-control input-sm rules_group_tools_list"; + + default_settings.rulesListClass = "rules_list"; + default_settings.rulesListLiClass = "rules_list_li"; + default_settings.rulesListLiErrorClass = "rules_list_error_li"; + default_settings.rulesListLiAppliedClass = "rules_list_applied_li"; + + default_settings.filterContainerClass = "filter_container"; + default_settings.filterListClass = "form-control input-sm filter_list"; + + default_settings.operatorsListContainerClass = "operators_list_container"; + default_settings.operatorsListClass = "form-control input-sm operators_list"; + + default_settings.filterValueContainerClass = "filter_value_container"; + default_settings.filterInputTextClass = "form-control input-sm filter_input_text"; + default_settings.filterInputNumberClass = "form-control input-sm filter_input_number"; + default_settings.filterInputDateClass = "form-control input-sm filter_input_date"; + default_settings.filterInputCheckboxClass = "filter_input_checkbox"; + default_settings.filterInputRadioClass = "form-control input-sm filter_input_radio"; + default_settings.filterSelectClass = "form-control input-sm filter_select"; + + default_settings.filterGroupListClass = "filter_group_list"; + default_settings.filterGroupListItemHorizontalClass = "filter_group_list_item_horizontal"; + default_settings.filterGroupListItemVerticalClass = "filter_group_list_item_vertical"; + + default_settings.ruleToolsContainerClass = "rule_tools_container"; + default_settings.ruleToolsClass = "form-control input-sm rule_tools_list"; + + default_settings.noFiltersFoundClass = "no_filters_found"; + } + + if(bootstrap_version == "2") { + default_settings.bootstrap_version = "2"; + + default_settings.containerClass = "filter_rules_container"; + + default_settings.rulesGroupContainerClass = "rules_group_container"; + default_settings.rulesGroupHeaderClass = "rules_group_header"; + default_settings.rulesGroupBodyClass = "rules_group_body"; + + default_settings.rulesGroupConditionContainerClass = "rules_group_condition_container"; + default_settings.rulesGroupConditionListClass = "form-control btn-small rules_group_condition_list"; + + default_settings.rulesGroupToolsContainerClass = "rules_group_tools_container"; + default_settings.rulesGroupToolsListClass = "form-control btn-small rules_group_tools_list"; + + default_settings.rulesListClass = "rules_list"; + default_settings.rulesListLiClass = "rules_list_li"; + default_settings.rulesListLiErrorClass = "rules_list_error_li"; + default_settings.rulesListLiAppliedClass = "rules_list_applied_li"; + + default_settings.filterContainerClass = "filter_container"; + default_settings.filterListClass = "form-control btn-small filter_list"; + + default_settings.operatorsListContainerClass = "operators_list_container"; + default_settings.operatorsListClass = "form-control btn-small operators_list"; + + default_settings.filterValueContainerClass = "filter_value_container"; + default_settings.filterInputTextClass = "form-control btn-small filter_input_text"; + default_settings.filterInputNumberClass = "form-control btn-small filter_input_number"; + default_settings.filterInputDateClass = "form-control btn-small filter_input_date"; + default_settings.filterInputCheckboxClass = "filter_input_checkbox"; + default_settings.filterInputRadioClass = "form-control btn-small filter_input_radio"; + default_settings.filterSelectClass = "form-control btn-small filter_select"; + + default_settings.filterGroupListClass = "filter_group_list"; + default_settings.filterGroupListItemHorizontalClass = "filter_group_list_item_horizontal"; + default_settings.filterGroupListItemVerticalClass = "filter_group_list_item_vertical"; + + default_settings.ruleToolsContainerClass = "rule_tools_container"; + default_settings.ruleToolsClass = "form-control btn-small rule_tools_list"; + + default_settings.noFiltersFoundClass = "no_filters_found"; + } + + return default_settings; + }, + + /** + * Get any option set to plugin using its name (as string) + * @example $(element).jui_filter_rules('getOption', some_option); + * @param {String} opt + * @return {*} + */ + getOption: function(opt) { + var elem = this; + return elem.data(pluginName)[opt]; + }, + + /** + * Get all options + * @example $(element).jui_filter_rules('getAllOptions'); + * @return {*} + */ + getAllOptions: function() { + var elem = this; + return elem.data(pluginName); + }, + + /** + * Set option + * @example $(element).jui_filter_rules('setOption', 'option_name', 'option_value', reinit); + * @param {String} opt option name + * @param val + * @param {Boolean} reinit + */ + setOption: function(opt, val, reinit) { + var elem = this; + elem.data(pluginName)[opt] = val; + if(reinit) { + elem.jui_filter_rules('init'); + } + }, + + /** + * Destroy plugin + * @example $(element).jui_filter_rules('destroy'); + * @return {*|jQuery} + */ + destroy: function() { + return $(this).each(function() { + var $this = $(this); + + $this.removeData(pluginName); + }); + }, + + /** + * Get rules + * @example $(element).jui_filter_rules("getRules", 0, []); + * @param {Number} rules_group_index The index of rules group + * @param {Array} a_rules Rules array + * @return {*} rules array or false (on validation error) + */ + getRules: function(rules_group_index, a_rules) { + var elem = this, + container_id = elem.attr("id"), + rules_group, group_logical_operator, + a_group_rules, a_group_rules_len, r, group_rule, + current_rule, filter_name, filter_operator, current_filter, current_filter_value, + rule_li_id_prefix = create_id(elem.jui_filter_rules("getOption", "rule_li_id_prefix"), container_id) + '_', + rule_li_id_prefix_len = rule_li_id_prefix.length, rule_id, + pos; + + rules_group = elem.find("dl").eq(rules_group_index); + group_logical_operator = rules_group.find("dt:first").find("select:first").val(); + + a_group_rules = rules_group.find("dd:first").find("ul:first").children().get(); + a_group_rules_len = a_group_rules.length; + for(r = 0; r < a_group_rules_len; r++) { + group_rule = a_group_rules[r]; + + current_rule = {}; + if(group_rule.tagName == 'LI') { + // no filter set + if($(group_rule).find("select:first").prop("selectedIndex") == 0) { + continue; + } + + rule_id = $(group_rule).attr("id").substr(rule_li_id_prefix_len); + current_rule.element_rule_id = $(group_rule).attr("id"); + + current_rule.condition = {}; + filter_name = $(group_rule).find("select:first").val(); + current_filter = remove_obj_empty_props(getFilterByName(container_id, filter_name)); + filter_operator = $(group_rule).find("select").eq(1).val(); + + current_rule.condition.filterType = current_filter.filterType; + if(current_filter.hasOwnProperty("numberType")) { + current_rule.condition.numberType = current_filter.numberType; + } + current_rule.condition.field = current_filter.field; + current_rule.condition.operator = filter_operator; + current_filter_value = get_filter_value(container_id, rule_id, current_filter, filter_operator); + if(current_filter_value === false) { + return false; + } else { + if(current_filter_value.length > 0) { + current_rule.condition.filterValue = current_filter_value; + } + } + + if(getOperator(filter_operator).accept_values == "yes") { + if(current_filter.hasOwnProperty("filter_value_conversion_server_side")) { + current_rule.filter_value_conversion_server_side = current_filter.filter_value_conversion_server_side; + } + } + + current_rule.logical_operator = group_logical_operator; + a_rules.push(current_rule); + } else if(group_rule.tagName == 'DL') { + current_rule.condition = []; + current_rule.logical_operator = group_logical_operator; + a_rules.push(current_rule); + pos = a_rules.length - 1; + + rules_group_index = parseInt(rules_group_index) + 1; + elem.jui_filter_rules("getRules", rules_group_index, a_rules[pos].condition); + + // cleanup empty groups + cleanup_empty_groups(a_rules); + } + } + + return a_rules; + }, + + /** + * Mark rule as applied + * @example $(element).jui_filter_rules("markRuleAsApplied", "element_rule_id", true); + * + * @param {String} element_rule_id + * @param {Boolean} status + */ + markRuleAsApplied: function(element_rule_id, status) { + var elem = this, + elem_rule = $("#" + element_rule_id), + rulesListLiAppliedClass = elem.jui_filter_rules("getOption", "rulesListLiAppliedClass"); + if(status) { + elem_rule.addClass(rulesListLiAppliedClass); + } else { + elem_rule.removeClass(rulesListLiAppliedClass); + } + }, + + /** + * Mark rule as error + * @example $(element).jui_filter_rules("markRuleAsError", "element_rule_id", true); + * + * @param {String} element_rule_id + * @param {Boolean} status + */ + markRuleAsError: function(element_rule_id, status) { + var elem = this, + elem_rule = $("#" + element_rule_id), + rulesListLiErrorClass = elem.jui_filter_rules("getOption", "rulesListLiErrorClass"); + if(status) { + elem_rule.addClass(rulesListLiErrorClass); + } else { + elem_rule.removeClass(rulesListLiErrorClass); + } + }, + + + /** + * Mark rule as pending + * @example $(element).jui_filter_rules("markRuleAsPending", "element_rule_id"); + * + * @param {String} element_rule_id + */ + markRuleAsPending: function(element_rule_id) { + var elem = this, + elem_rule = $("#" + element_rule_id), + rulesListLiErrorClass = elem.jui_filter_rules("getOption", "rulesListLiErrorClass"), + rulesListLiAppliedClass = elem.jui_filter_rules("getOption", "rulesListLiAppliedClass"); + + elem_rule.removeClass(rulesListLiErrorClass); + elem_rule.removeClass(rulesListLiAppliedClass); + + }, + + /** + * Mark all rules as applied + * @example $(element).jui_filter_rules("markAllRulesAsApplied"); + */ + markAllRulesAsApplied: function() { + var elem = this, + rulesListLiErrorClass = elem.jui_filter_rules("getOption", "rulesListLiErrorClass"), + rulesListLiAppliedClass = elem.jui_filter_rules("getOption", "rulesListLiAppliedClass"), + a_rules = elem.jui_filter_rules("getRules", 0, []); + + if(a_rules !== false) { + if(a_rules.length > 0) { + elem.find("li").each(function() { + if($(this).find("select:first").prop("selectedIndex") > 0) { + elem.jui_filter_rules("markRuleAsError", $(this).attr("id"), false); + elem.jui_filter_rules("markRuleAsApplied", $(this).attr("id"), true); + } + }) + } + } + }, + + /** + * Clear rules + * @example $(element).jui_filter_rules("clearAllRules"); + */ + clearAllRules: function() { + var elem = this, + container_id = elem.attr("id"); + + methods.setOption.call(elem, "filter_rules", []); + + elem.find("dl:first").html(''); + elem.data(pluginStatus)["group_id"] = 0; + elem.data(pluginStatus)["rule_id"] = 0; + + elem.html(createRulesGroup(container_id)); + }, + + + /** + * Set rules + * @example $(element).jui_filter_rules("setRules", a_rules); + */ + setRules: function(a_rules) { + var elem = this, + container_id = elem.attr("id"); + + methods.clearAllRules.call(elem); + methods.setOption.call(elem, "filter_rules", a_rules); + methods.init.call(elem); + + elem.triggerHandler("onSetRules"); + } + }; + + /* private methods ------------------------------------------------------ */ + + /** + * @lends _private_methods + */ + + /** + * Validate input values + * @param container_id + */ + var validate_input = function(container_id) { + var elem = $("#" + container_id), + err_msg, i, e, + filters = elem.jui_filter_rules("getOption", "filters"), + filters_len = filters.length, + filternames = []; + + // unique filter name + for(i = 0; i < filters_len; i++) { + filternames.push(filters[i].filterName); + } + if(array_has_duplicates(filternames)) { + err_msg = 'Filternames are not unique...'; + elem.html('' + 'ERROR: ' + err_msg + ''); + $.error(err_msg); + } + + // default filter interface if missing + for(i = 0; i < filters_len; i++) { + if(!filters[i].hasOwnProperty("filter_interface")) { + filters[i].filter_interface = [ + { + filter_element: "input", + filter_element_attributes: { + type: "text" + } + } + ]; + } + } + + // filter_element_attributes cannot missing + for(i = 0; i < filters_len; i++) { + var fi = filters[i].filter_interface, + fi_length = fi.length; + for(e = 0; e < fi_length; e++) { + if(!fi[e].hasOwnProperty("filter_element_attributes")) { + fi[e].filter_element_attributes = {} + } + } + } + + }; + + /** + * Create element id + * @param prefix + * @param plugin_container_id + * @return {*} + */ + var create_id = function(prefix, plugin_container_id) { + return prefix + plugin_container_id; + }; + + /** + * Check array for duplicated values + * @param arr + * @return {Boolean} + */ + var array_has_duplicates = function(arr) { + + var x = {}, len = arr.length, i; + for(i = 0; i < len; i++) { + if(x[arr[i]] === true) { + return true; + } + x[arr[i]] = true; + } + return false; + }; + + /** + * + * @param value + * @return {*} + */ + var htmlEncode = function(value) { + if(value) { + return jQuery('
').text(value).html(); + } else { + return ''; + } + }; + + /** + * + * @param value + * @return {*} + */ + var htmlDecode = function(value) { + if(value) { + return $('
').html(value).text(); + } else { + return ''; + } + }; + + /** + * Remove empty object properties + * @param obj + * @return {Object} + */ + var remove_obj_empty_props = function(obj) { + var obj_clone = {}, prop; + for(prop in obj) { + if(obj.hasOwnProperty(prop)) { + if(obj[prop] !== "") { + obj_clone[prop] = obj[prop]; + } + } + } + return obj_clone; + }; + + /** + * Remove empty rule groups + * @param {Array} a_rules + */ + var cleanup_empty_groups = function(a_rules) { + var i, condition, len = a_rules.length; + for(i = 0; i < len; i++) { + condition = a_rules[i].condition; + if($.isArray(condition)) { + if(condition.length == 0) { + a_rules.splice(i, 1); + } else { + cleanup_empty_groups(condition); + } + } + } + + }; + + /** + * + * Escape regex special characters !@#$^&%*()+=-[]\/{}|:<>?,. + * + * @param expr + * @return {String|XML|void} + * + * @see http://simonwillison.net/2006/Jan/20/escape/#p-6 + * @see http://stackoverflow.com/questions/3115150/how-to-escape-regular-expression-special-characters-using-javascript + */ + var RegExp_escape = function(expr) { + return expr.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + }; + + /** + * Get filter attributes by filter name + * @param {String} container_id + * @param {String} filter_name + * @return {*} filter object or undefined + */ + var getFilterByName = function(container_id, filter_name) { + var elem = $("#" + container_id), + i, filters = elem.jui_filter_rules("getOption", "filters"), + filters_len = filters.length, + flt = undefined; + + for(i = 0; i < filters_len; i++) { + if(filters[i].filterName == filter_name) { + flt = filters[i]; + break; + } + } + return flt; + }; + + + /** + * Get filter attributes by filter field + * @param {String} container_id + * @param {String} filter_field + * @return {*} filter object or undefined + */ + var getFilterByFIeld = function(container_id, filter_field) { + var elem = $("#" + container_id), + i, filters = elem.jui_filter_rules("getOption", "filters"), + filters_len = filters.length, + flt = undefined; + + for(i = 0; i < filters_len; i++) { + if(filters[i].field == filter_field) { + flt = filters[i]; + break; + } + } + return flt; + }; + + /** + * Get operators for filter type + * @param filterName {string} + * @return {Array} + */ + var getOperators = function(container_id, filterName) { + var elem = $("#" + container_id), + filters = elem.jui_filter_rules("getOption", "filters"), + filter, filter_type, excluded_operators, + operators_len = operators.length, + i, oper = [], item; + + filter = getFilterByName(container_id, filterName); + filter_type = filter.filterType; + excluded_operators = (filter.excluded_operators === undefined ? [] : filter.excluded_operators); + + for(i = 0; i < operators_len; i++) { + if($.inArray(operators[i].type, excluded_operators) > -1) { + continue; + } + if($.inArray(filter_type, operators[i].apply_to) > -1) { + item = {}; + item.operator_type = operators[i].type; + item.operator_label = rsc_jui_fr['operator_' + operators[i].type]; + item.group = operators[i].group; + oper.push(item); + } + } + return oper; + + }; + + /** + * Get operator attributes + * @param operator_type + * @return {*} operator object or undefined + */ + var getOperator = function(operator_type) { + var i, + operators_len = operators.length, + oper = undefined; + + for(i = 0; i < operators_len; i++) { + if(operators[i].type == operator_type) { + oper = operators[i]; + break; + } + } + return oper; + }; + + /** + * Create rules group condition select (AND - OR) + * @return {String} + */ + var create_group_condition = function(container_id) { + var elem = $("#" + container_id), + group_condition_id, + rulesGroupConditionContainerClass = elem.jui_filter_rules('getOption', 'rulesGroupConditionContainerClass'), + rulesGroupConditionListClass = elem.jui_filter_rules('getOption', 'rulesGroupConditionListClass'), + gc_html = ''; + + group_condition_id = create_id(elem.jui_filter_rules('getOption', 'group_condition_id_prefix'), container_id) + + '_' + elem.data(pluginStatus)["group_id"]; + + gc_html += '
'; + gc_html += ''; + gc_html += '
'; + return gc_html; + + }; + + /** + * Cgeate rules group tools dropdown list + * @param container_id {String} + * @return {String} + */ + var create_rules_group_tools = function(container_id) { + var elem = $("#" + container_id), + rule_id = parseInt(elem.data(pluginStatus)["rule_id"]), + + rulesGroupToolsContainerClass = elem.jui_filter_rules("getOption", "rulesGroupToolsContainerClass"), + rulesGroupToolsListClass = elem.jui_filter_rules("getOption", "rulesGroupToolsListClass"), + + group_tools_id = create_id(elem.jui_filter_rules("getOption", "group_tools_id_prefix"), container_id) + '_' + rule_id, + + disabled_html = (rule_id == 0 ? ' disabled="disabled"' : ''), + tools_html = ''; + + tools_html += '
'; + tools_html += ''; + tools_html += '
'; + + return tools_html; + }; + + /** + * Create filters list + * @param container_id {string} + * @return {String} filter list html + */ + var create_filters_list = function(container_id) { + var elem = $("#" + container_id), + rule_id = parseInt(elem.data(pluginStatus)["rule_id"]), + filters = elem.jui_filter_rules('getOption', 'filters'), + filters_len = filters.length, + filterContainerClass = elem.jui_filter_rules("getOption", "filterContainerClass"), + filterListClass = elem.jui_filter_rules("getOption", "filterListClass"), + filters_list_id = create_id(elem.jui_filter_rules("getOption", "filters_list_id_prefix"), container_id) + '_' + rule_id, + i, f_html = ''; + + f_html += '
'; + f_html += ''; + f_html += '
'; + + return f_html; + + }; + + /** + * Create operator list + * @param container_id + * @param rule_id + * @param filterName + */ + var create_operators_list = function(container_id, rule_id, filterName) { + var elem = $("#" + container_id), + operators_container_id = create_id(elem.jui_filter_rules("getOption", "operators_container_id_prefix"), container_id) + '_' + rule_id, + elem_operators_container = $("#" + operators_container_id), + operatorsListClass = elem.jui_filter_rules("getOption", "operatorsListClass"), + operators_list_id_prefix = create_id(elem.jui_filter_rules("getOption", "operators_list_id_prefix"), container_id) + '_', + operators_list_id = operators_list_id_prefix + rule_id, + oper, i, len, oper_html = '', operators_group = ''; + + oper = getOperators(container_id, filterName); + len = oper.length; + + oper_html += ''; + + elem_operators_container.html(oper_html); + }; + + + /** + * Create inputs or widgets for the user to set filter values + * @param container_id {String} + * @param rule_id {String} + * @param filterName {String} + * @param operator_type {String} + * @return {Boolean} + */ + var create_filter_value = function(container_id, rule_id, filterName, operator_type) { + var elem = $("#" + container_id), + operator = getOperator(operator_type), + filter_value_container_id = create_id(elem.jui_filter_rules("getOption", "filter_value_container_id_prefix"), container_id) + '_' + rule_id, + elem_filter_value_container = $("#" + filter_value_container_id), + filters = elem.jui_filter_rules('getOption', 'filters'), + filter = remove_obj_empty_props(getFilterByName(container_id, filterName)), + filter_type = filter.filterType, + filter_interface = filter.filter_interface, + filter_interface_len = filter_interface.length, i, + filter_element, filter_element_id, filter_element_name, filter_input_type = "", filter_element_attributes, fe_attr, + a_ignore_attributes = ["id", "name"], + class_name_default = "", + filter_lookup_data, filter_lookup_data_len, lk, selected_html, lookup_values_ajax_url = "", + vertical_orientation = "no", group_list_item_class, + group_list_class = elem.jui_filter_rules("getOption", "filterGroupListClass"), + filterGroupListItemHorizontalClass = elem.jui_filter_rules("getOption", "filterGroupListItemHorizontalClass"), + filterGroupListItemVerticalClass = elem.jui_filter_rules("getOption", "filterGroupListItemVerticalClass"), + f_html = ''; + + if(operator.accept_values !== "yes") { + elem_filter_value_container.html(''); + return true; + } + + if(filter.hasOwnProperty("lookup_values_ajax_url")) { + lookup_values_ajax_url = filter["lookup_values_ajax_url"]; + + $.ajax({ + url: lookup_values_ajax_url, + async: false, // necessary if you have to apply filters (setRules) + success: (function(data) { + filter_lookup_data = $.parseJSON(data); + elem_filter_value_container.html(create_filter_value_html()); + apply_widgets(); + }) + }); + + } else { + if(filter.hasOwnProperty("lookup_values")) { + filter_lookup_data = filter["lookup_values"]; + } + elem_filter_value_container.html(create_filter_value_html()); + apply_widgets(); + } + + // --------------------------------------------------------------------- + function create_filter_value_html() { + for(i = 0; i < filter_interface_len; i++) { + + filter_element = filter_interface[i].filter_element; + filter_element_attributes = remove_obj_empty_props(filter_interface[i].filter_element_attributes); + if(filter_element == "input") { + filter_input_type = filter_element_attributes["type"]; + } + setFilterElementIgnoreProperties(); + + if(filter_input_type == "checkbox" || filter_input_type == "radio") { + + setFilterGroupClass(); + filter_lookup_data_len = filter_lookup_data.length; + f_html += '
    '; + for(lk = 0; lk < filter_lookup_data_len; lk++) { + f_html += '
  • '; + f_html += '<' + filter_element; + setFilterElementID(lk); + f_html += ' id="' + filter_element_id + '"'; + if(filter_input_type == "radio") { + setFilterElementName(); + f_html += ' name="' + filter_element_name + '"'; + } + setFilterElementAttributes(); + f_html += ' value="' + filter_lookup_data[lk]["lk_value"] + '"'; + selected_html = (filter_lookup_data[lk]["lk_selected"] == 'yes' ? ' checked="checked"' : ''); + f_html += selected_html; + f_html += '>'; + f_html += ''; + f_html += '
  • '; + } + f_html += '
'; + + } else { + f_html += '<' + filter_element; + setFilterElementID(i); + f_html += ' id="' + filter_element_id + '"'; + setFilterElementAttributes(); + f_html += '>'; + if(filter_element == "select") { + createFilterElementSelectOptions(); + } + if(filter_element == "div") { + f_html += '
'; + } + } + } + return f_html; + } + + // --------------------------------------------------------------------- + function setFilterElementID(group_index) { + filter_element_id = create_id(elem.jui_filter_rules("getOption", "filter_element_id_prefix"), container_id) + + '_' + rule_id + + '_' + group_index; + } + + // --------------------------------------------------------------------- + function setFilterElementName() { + filter_element_name = create_id(elem.jui_filter_rules("getOption", "filter_element_name_prefix"), container_id) + '_' + rule_id; + } + + // --------------------------------------------------------------------- + function setFilterElementIgnoreProperties() { + if(filter_element == "input") { + if(filter_input_type == "text") { + a_ignore_attributes = ["id", "name"] + } else if(filter_input_type == "radio") { + a_ignore_attributes = ["id", "name", "value", "checked"] + } else if(filter_input_type == "checkbox") { + a_ignore_attributes = ["id", "name", "value", "checked"] + } + } else if(filter_element == "select") { + a_ignore_attributes = ["id", "name", "value"] + } + } + + // --------------------------------------------------------------------- + function setFilterElementDefaultClass() { + var class_option = ""; + class_name_default = ""; + + if(filter_element == "input") { + if(filter_input_type == "text") { + if(filter_type == "text") { + class_option = "filterInputTextClass"; + } else if(filter_type == "number") { + class_option = "filterInputNumberClass"; + } else if(filter_type == "date") { + class_option = "filterInputDateClass"; + } + } else if(filter_input_type == "radio") { + class_option = "filterInputRadioClass"; + } else if(filter_input_type == "checkbox") { + class_option = "filterInputCheckboxClass"; + } + } else if(filter_element == "select") { + class_option = "filterSelectClass"; + } + if(class_option !== "") { + class_name_default = elem.jui_filter_rules('getOption', class_option); + } + } + + // --------------------------------------------------------------------- + function setFilterElementAttributes() { + for(fe_attr in filter_element_attributes) { + if(filter_element_attributes.hasOwnProperty(fe_attr)) { + if($.inArray(fe_attr, a_ignore_attributes) > -1) { + continue; + } + f_html += ' ' + fe_attr + '="' + filter_element_attributes[fe_attr] + '"'; + } + } + if(!filter_element_attributes.hasOwnProperty("class")) { + setFilterElementDefaultClass(); + if(class_name_default !== "") { + f_html += ' class="' + class_name_default + '"'; + } + } + } + + // --------------------------------------------------------------------- + function createFilterElementSelectOptions() { + filter_lookup_data_len = filter_lookup_data.length; + + for(lk = 0; lk < filter_lookup_data_len; lk++) { + selected_html = (filter_lookup_data[lk]["lk_selected"] == 'yes' ? ' selected="selected"' : ''); + f_html += ''; + } + f_html += ''; + } + + // --------------------------------------------------------------------- + function setFilterGroupClass() { + vertical_orientation = "no"; + if(filter_interface[i].hasOwnProperty("vertical_orientation")) { + vertical_orientation = filter_interface[i].vertical_orientation; + } + group_list_item_class = (vertical_orientation == "yes" ? filterGroupListItemVerticalClass : filterGroupListItemHorizontalClass); + } + + // --------------------------------------------------------------------- + function apply_widgets() { + + if(filter_input_type == "checkbox" || filter_input_type == "radio") { + return true; + } + + for(i = 0; i < filter_interface_len; i++) { + if(!filter_interface[i].hasOwnProperty("filter_widget")) { + continue; + } + + filter_element_id = create_id(elem.jui_filter_rules("getOption", "filter_element_id_prefix"), container_id) + '_' + rule_id + + '_' + i; + var elem_filter = $("#" + filter_element_id); + var filter_widget = filter_interface[i]["filter_widget"]; + var filter_widget_properties = filter_interface[i]["filter_widget_properties"]; + + if(filter_widget == "datepicker") { + elem_filter.datepicker( + filter_widget_properties + ); + } + if(filter_widget == "datetimepicker") { + elem_filter.datetimepicker( + filter_widget_properties + ); + } + + if(filter_widget == "autocomplete") { + elem_filter.autocomplete(filter_widget_properties); + } + + if(filter_widget == "spinner") { + elem_filter.spinner(filter_widget_properties); + } + + if(filter_widget == "slider") { + elem_filter.slider(filter_widget_properties); + } + } + + return true; + } + + // --------------------------------------------------------------------- + return true; + }; + + /** + * Create rule tools dropdown list + * @param container_id {string} + * @return {String} + */ + var create_rule_tools = function(container_id) { + var elem = $("#" + container_id), + rule_id = parseInt(elem.data(pluginStatus)["rule_id"]), + + ruleToolsContainerClass = elem.jui_filter_rules("getOption", "ruleToolsContainerClass"), + ruleToolsClass = elem.jui_filter_rules("getOption", "ruleToolsClass"), + + rule_tools_id = create_id(elem.jui_filter_rules("getOption", "rule_tools_id_prefix"), container_id) + '_' + rule_id, + tools_html = ''; + + tools_html += '
'; + tools_html += ''; + tools_html += '
'; + + return tools_html; + }; + + + /** + * Create a group of rules (with the first rule) + * @param container_id + * @return {String} + */ + var createRulesGroup = function(container_id) { + var elem = $("#" + container_id), + group_dl_id_prefix = elem.jui_filter_rules("getOption", "group_dl_id_prefix"), + group_dl_id, group_id, + rulesGroupContainerClass = elem.jui_filter_rules("getOption", "rulesGroupContainerClass"), + rulesGroupHeaderClass = elem.jui_filter_rules("getOption", "rulesGroupHeaderClass"), + rulesGroupBodyClass = elem.jui_filter_rules("getOption", "rulesGroupBodyClass"), + rulesListClass = elem.jui_filter_rules("getOption", "rulesListClass"), + rg_html = ''; + + group_id = parseInt(elem.data(pluginStatus)["group_id"]) + 1; + elem.data(pluginStatus)["group_id"] = group_id; + + group_dl_id = create_id(group_dl_id_prefix, container_id) + '_' + group_id; + + rg_html += '
'; + + rg_html += '
'; + rg_html += create_group_condition(container_id); + rg_html += create_rules_group_tools(container_id); + rg_html += '
'; + + rg_html += '
'; + rg_html += '
    '; + rg_html += createRule(container_id); + rg_html += '
'; + rg_html += '
'; + + rg_html += '
'; + + return rg_html; + + }; + + /** + * Create rule + * @param container_id {String} + * @return {String} + */ + var createRule = function(container_id) { + var elem = $("#" + container_id), + rulesListLiClass = elem.jui_filter_rules("getOption", "rulesListLiClass"), + operatorsListContainerClass = elem.jui_filter_rules("getOption", "operatorsListContainerClass"), + filterValueContainerClass = elem.jui_filter_rules("getOption", "filterValueContainerClass"), + rule_li_id_prefix = create_id(elem.jui_filter_rules("getOption", "rule_li_id_prefix"), container_id) + '_', + operators_container_id_prefix = create_id(elem.jui_filter_rules("getOption", "operators_container_id_prefix"), container_id) + '_', + filter_value_container_id_prefix = create_id(elem.jui_filter_rules("getOption", "filter_value_container_id_prefix"), container_id) + '_', + rule_li_id, operators_container_id, filter_value_container_id, rule_id, + r_html = ''; + + rule_id = parseInt(elem.data(pluginStatus)["rule_id"]) + 1; + elem.data(pluginStatus)["rule_id"] = rule_id; + + operators_container_id = operators_container_id_prefix + rule_id; + filter_value_container_id = filter_value_container_id_prefix + rule_id; + rule_li_id = rule_li_id_prefix + rule_id; + + r_html += '
  • '; + + r_html += create_filters_list(container_id); + + r_html += '
    '; + r_html += '
    '; + + r_html += '
    '; + r_html += '
    '; + + r_html += create_rule_tools(container_id); + + r_html += '
  • '; + + return r_html; + + }; + + + /** + * Get filter value + * @param container_id + * @param rule_id + * @param filter + * @param operator_type + * @return {Array} or false if input validation failed + */ + var get_filter_value = function(container_id, rule_id, filter, operator_type) { + var elem = $("#" + container_id), + filter_type = filter.filterType, + filter_interface = filter.filter_interface, + filter_interface_len = filter_interface.length, i, + filter_element, + filter_value_container_id = create_id(elem.jui_filter_rules("getOption", "filter_value_container_id_prefix"), container_id) + '_' + rule_id, + elem_filter_value_container = $("#" + filter_value_container_id), + filter_element_id_prefix = elem.jui_filter_rules("getOption", "filter_element_id_prefix"), + filter_element_id, filter_input_type = "", filter_element_attributes, + group_elems, + operator = getOperator(operator_type), + elem_rule_id = create_id(elem.jui_filter_rules("getOption", "rule_li_id_prefix"), container_id) + '_' + rule_id, + elem_rule = $("#" + elem_rule_id), + rulesListLiErrorClass = elem.jui_filter_rules("getOption", "rulesListLiErrorClass"), + decimal_separator = elem.jui_filter_rules("getOption", "decimal_separator"), + dc_regex_pattern = new RegExp(RegExp_escape(decimal_separator), "g"), + htmlentities = elem.jui_filter_rules("getOption", "htmlentities"), + elem_filter, filter_value = [], filter_value_len, v, elem_filter_group = [], + filter_value_conversion, conversion_function = "", args, conversion_args = [], arg_len, a; + + elem_rule.removeClass(rulesListLiErrorClass); + + if(operator.accept_values !== "yes") { + return filter_value; + } + + for(i = 0; i < filter_interface_len; i++) { + + if(filter_interface[i].hasOwnProperty("returns_no_value")) { + if(filter_interface[i]["returns_no_value"] == "yes") { + continue; + } + } + + filter_element = filter_interface[i].filter_element; + filter_element_attributes = filter_interface[i].filter_element_attributes; + + if(filter_element == "input") { + filter_input_type = filter_element_attributes["type"]; + if(filter_input_type == "text") { + filter_element_id = getFilterElementID(i); + elem_filter = $("#" + filter_element_id); + filter_value.push(elem_filter.val()); + } + if(filter_input_type == "checkbox" || filter_input_type == "radio") { + group_elems = $('[id^="' + create_id(filter_element_id_prefix, container_id) + '_' + rule_id + '_' + '"]'); + group_elems.each(function() { + if($(this).is(":checked")) + filter_value.push($(this).val()); + elem_filter_group.push($(this)); + }) + } + } + if(filter_element == "select") { + filter_element_id = getFilterElementID(i); + elem_filter = $("#" + filter_element_id); + if(filter_element_attributes.hasOwnProperty("multiple")) { + filter_value = elem_filter.val(); + } else { + filter_value.push(elem_filter.val()); + } + } + } + + // No value validation + if(filter_input_type == "checkbox" || filter_input_type == "radio") { + if($("input:checked", elem_filter_value_container).length == 0) { + noValueGiven(); + return false; + } + } + filter_value_len = filter_value.length; + for(v = 0; v < filter_value_len; v++) { + if($.trim(filter_value[v]).length == 0) { + noValueGiven(); + return false; + } + } + + // Numeric validation + if(filter_type == "number") { + filter_value_len = filter_value.length; + for(v = 0; v < filter_value_len; v++) { + // set decimal separator + filter_value[v] = filter_value[v].replace(dc_regex_pattern, "."); + if(!$.isNumeric(filter_value[v])) { + elem_rule.addClass(rulesListLiErrorClass); + elem.triggerHandler("onValidationError", {err_code: "filter_error_2", err_description: rsc_jui_fr.error_invalid_number, elem_filter: getCurrentFilterElement()}); + return false; + } + } + } + + // Date validation (using moment.js) + if(filter_type == "date") { + filter_value_len = filter_value.length; + if(filter.hasOwnProperty("validate_dateformat")) { + for(v = 0; v < filter_value_len; v++) { + if(moment(filter_value[v], filter.validate_dateformat).isValid() == false) { + elem_rule.addClass(rulesListLiErrorClass); + elem.triggerHandler("onValidationError", {err_code: "filter_error_3", err_description: rsc_jui_fr.error_invalid_datetime, elem_filter: getCurrentFilterElement()}); + return false; + } + } + } + } + + // apply value conversion (if any) + if(filter.hasOwnProperty("filter_value_conversion")) { + filter_value_conversion = filter.filter_value_conversion; + conversion_function = filter_value_conversion["function_name"]; + args = filter_value_conversion["args"]; + arg_len = args.length; + + filter_value_len = filter_value.length; + for(v = 0; v < filter_value_len; v++) { + + // create arguments values for this filter value + conversion_args = []; + for(a = 0; a < arg_len; a++) { + if(args[a].hasOwnProperty("filter_value")) { + conversion_args.push(filter_value[v]); + } + if(args[a].hasOwnProperty("value")) { + conversion_args.push(args[a]["value"]); + } + } + // execute user function and assign return value to filter value + try { + filter_value[v] = window[conversion_function].apply(null, conversion_args); + } + catch(err) { + elem.jui_filter_rules("markRuleAsError", elem_rule.attr("id"), true); + elem.triggerHandler("onValidationError", {err_code: "filter_error_0", err_description: rsc_jui_fr.error_converting_value + ':\n\n' + err.message, elem_filter: getCurrentFilterElement()}); + return false; + } + } + } + + // encode html (against XSS attack) + if(filter_type !== "number") { + if(htmlentities) { + filter_value_len = filter_value.length; + for(v = 0; v < filter_value_len; v++) { + filter_value[v] = htmlEncode(filter_value[v]); + } + } + } + + // --------------------------------------------------------------------- + function getFilterElementID(group_index) { + return create_id(filter_element_id_prefix, container_id) + '_' + rule_id + '_' + group_index; + } + + // --------------------------------------------------------------------- + function noValueGiven() { + elem_rule.addClass(rulesListLiErrorClass); + elem.triggerHandler("onValidationError", {err_code: "filter_error_1", err_description: rsc_jui_fr.error_no_value_given, elem_filter: getCurrentFilterElement()}); + } + + // --------------------------------------------------------------------- + function getCurrentFilterElement() { + if(filter_input_type == "checkbox" || filter_input_type == "radio") { + if(v == undefined) { + v = 0; + } + return elem_filter_group[v]; + } else { + return elem_filter; + } + } + + return filter_value; + + }; + + + /** + * Apply given rules using recursion + * + * @param {Array} a_rules + * @param {obj} elem jquery object + * @param {string} container_id + */ + var apply_rules = function(a_rules, elem, container_id) { + + var a_rules_length = a_rules.length; + + elem.find('dd:first ul:first li:first').remove(); + elem.find('dt:first select:first').val(a_rules[0].logical_operator); + + for(var i = 0; i < a_rules_length; i++) { + var filter_rule = a_rules[i], + filter_value = filter_rule.condition.hasOwnProperty("filterValue") ? filter_rule.condition.filterValue : null, + autocomplete_value = filter_rule.hasOwnProperty("autocomplete_value") ? filter_rule.autocomplete_value : false, + slider_value = filter_rule.hasOwnProperty("slider_value") ? filter_rule.slider_value : false; + if($.isArray(filter_rule.condition)) { + elem.find('dd:first ul:first').append(createRulesGroup(container_id)); + apply_rules(filter_rule.condition, elem.find('dd:first ul:first dl:first'), container_id); + } + else { + elem.find('dd:first ul:first').append(createRule(container_id)); + var elem_rule = elem.find('dd:first ul:first li:last'); + // set element_rule_id attribute + a_rules[i].element_rule_id = elem_rule.attr("id"); + + var filter = getFilterByFIeld(container_id, filter_rule.condition.field), + filterName = filter.filterName, + filter_interface = filter.filter_interface, + filter_interface_len = filter_interface.length; + + // update filter selector -------------------------------------- + elem_rule.find('select:first').val(filterName).trigger('change'); + + // update operator selector ------------------------------------ + elem_rule.find('select').eq(1).val(filter_rule.condition.operator).trigger('change'); + + // update filter value ----------------------------------------- + var operator = getOperator(filter_rule.condition.operator); + if(operator.accept_values !== "yes") { + continue; + } + for(var j = 0; j < filter_interface_len; j++) { + + var element_returns_no_value = (filter_interface[j].hasOwnProperty("returns_no_value") && + filter_interface[j].returns_no_value == "yes") ? true : false; + if(element_returns_no_value) { + // update widgets + if(autocomplete_value) { + elem_rule.find('input.ui-autocomplete-input').val(autocomplete_value); + } + if(slider_value) { + elem_rule.find('div.ui-slider').slider('value', slider_value); + } + continue; + } + + var filter_element = filter_interface[j].filter_element, + filter_element_attributes = filter_interface[j].filter_element_attributes, + filter_input_type = filter_element_attributes.hasOwnProperty("type") ? filter_element_attributes["type"] : null; + + if(filter_element == 'input') { + if(filter_input_type == 'radio') { + elem_rule.find('input[type=radio][value="' + filter_value[0] + '"]').prop('checked', true); + } + else if(filter_input_type == 'checkbox') { + // uncheck all checkboxes (may have been checked by "lk_selected" attribute) + elem_rule.find('input[type=checkbox]').prop('checked', false); + // check checkboxes according to filter value + for(var c in filter_value) { + elem_rule.find('input[type=checkbox][value="' + filter_value[c] + '"]').prop('checked', true); + } + } + else { + elem_rule.find('input').eq(0).val(filter_value[0]); + } + } + else if(filter_element == 'select') { + elem_rule.find('select').eq(2).val(filter_value[0]); + } + } + } + } + + }; + + /** + * jui_filter_rules - Create rules to filter dataset using jquery. + * + * @class jui_filter_rules + * @memberOf $.fn + */ + $.fn.jui_filter_rules = function(method) { + + // OPTIONAL + if(this.size() != 1) { + var err_msg = 'You must use this plugin (' + pluginName + ') with a unique element (at once)'; + this.html('' + 'ERROR: ' + err_msg + ''); + $.error(err_msg); + } + + // Method calling logic + if(methods[method]) { + return methods[ method ].apply(this, Array.prototype.slice.call(arguments, 1)); + } else if(typeof method === 'object' || !method) { + return methods.init.apply(this, arguments); + } else { + $.error('Method ' + method + ' does not exist on jQuery.' + pluginName); + } + + }; + +})(jQuery); \ No newline at end of file diff --git a/connector-miravia/lib/filter_rules/localization/el.min.js b/connector-miravia/lib/filter_rules/localization/el.min.js new file mode 100644 index 0000000..9705f68 --- /dev/null +++ b/connector-miravia/lib/filter_rules/localization/el.min.js @@ -0,0 +1,4 @@ +/** + * jui_filter_rules v1.0.7 simple localization - GREEK ************************* + */ +var rsc_jui_fr={no_filters_found:"Δεν έχουν ορισθεί φίλτρα",rules_group_AND:"σε ίσχύ όλα",rules_group_OR:"σε ίσχύ ένα τουλάχιστον",rule:"κριτήριο",group:"ομάδα",tools_please_select:"»",rule_insert_before:"εισαγωγή πριν",rule_insert_after:"εισαγωγή μετά",rule_insert_inside:"εισαγωγή εντός",rule_clear:"καθαρισμός",rule_delete:"διαγραφή",group_insert_before:"εισαγωγή πριν",group_insert_after:"εισαγωγή μετά",group_insert_inside:"εισαγωγή εντός",group_delete:"διαγραφή",filter_please_select:"» επιλογή",operator_equal:"ισούται",operator_not_equal:"δεν ισούται",operator_in:"περιλαμβάνεται σε",operator_not_in:"δεν περιλαμβάνεται σε",operator_less:"μικρότερο",operator_less_or_equal:"μικρότερο είτε ίσο",operator_greater:"μεγαλύτερο",operator_greater_or_equal:"μεγαλύτερο είτε ίσο",operator_between:"ανάμεσα",operator_not_between:"όχι ανάμεσα",operator_begins_with:"ξεκινά με",operator_not_begins_with:"δεν ξεκινά με",operator_contains:"περιέχει",operator_not_contains:"δεν περιέχει",operator_ends_with:"καταλήγει σε",operator_not_ends_with:"δεν καταλήγει σε",operator_is_empty:"είναι κενό",operator_is_not_empty:"δεν είναι κενό",operator_is_null:"δεν έχει δοθεί",operator_is_not_null:"έχει δοθεί",error_no_value_given:"Δεν δόθηκε τιμή",error_invalid_number:"Η τιμή δεν είναι αριθμός",error_invalid_datetime:"Η ημερομηνία δεν είναι σωστή",error_converting_value:"Λάθος κατά τη μετατροπή της τιμής που δόθηκε"}; \ No newline at end of file diff --git a/connector-miravia/lib/filter_rules/localization/en.min.js b/connector-miravia/lib/filter_rules/localization/en.min.js new file mode 100644 index 0000000..42d58b2 --- /dev/null +++ b/connector-miravia/lib/filter_rules/localization/en.min.js @@ -0,0 +1,4 @@ +/** + * jui_filter_rules v1.0.7 simple localization - ENGLISH *********************** + */ +var rsc_jui_fr={no_filters_found:"No filters defined",rules_group_AND:"all rules",rules_group_OR:"any rule",rule:"rule",group:"group",tools_please_select:"»",rule_insert_before:"insert before",rule_insert_after:"insert after",rule_insert_inside:"insert inside",rule_clear:"clear",rule_delete:"delete",group_insert_before:"insert before",group_insert_after:"insert after",group_insert_inside:"insert inside",group_delete:"delete",filter_please_select:"» select",operator_equal:"equal",operator_not_equal:"not_equal",operator_in:"in",operator_not_in:"not in",operator_less:"less",operator_less_or_equal:"less or equal",operator_greater:"greater",operator_greater_or_equal:"greater or equal",operator_between:"between",operator_not_between:"not between",operator_begins_with:"begins with",operator_not_begins_with:"does not begin with",operator_contains:"contains",operator_not_contains:"does not contain",operator_ends_with:"ends with",operator_not_ends_with:"does not end with",operator_is_empty:"is empty",operator_is_not_empty:"is not empty",operator_is_null:"is null",operator_is_not_null:"is not null",error_no_value_given:"Value not given",error_invalid_number:"Value is not numeric",error_invalid_datetime:"Invalid date format",error_converting_value:"Error converting value"}; \ No newline at end of file diff --git a/connector-miravia/lib/filter_rules/localization/es.min.js b/connector-miravia/lib/filter_rules/localization/es.min.js new file mode 100644 index 0000000..3459647 --- /dev/null +++ b/connector-miravia/lib/filter_rules/localization/es.min.js @@ -0,0 +1,55 @@ +/** + * jui_filter_rules v1.0.7 simple localization - ENGLISH + * + * DO NOT CHANGE this file, as it will be overwritten in next update. + * To use different values, write and use a similar structure js file. + * + */ +var rsc_jui_fr = { + + no_filters_found: "No hay filtros definidos", + + rules_group_AND: "Todas las reglas", + rules_group_OR: "Cualquier regla", + + rule: "regla", + group: "grupo", + tools_please_select: "Añadir", + rule_insert_before: "Insertar antes", + rule_insert_after: "Insertar después", + rule_insert_inside: "Insertar dentro", + rule_clear: "limpiar", + rule_delete: "borrar", + group_insert_before: "Insertar antes", + group_insert_after: "Insertar después", + group_insert_inside: "Insertar dentro", + group_delete: "borrar", + + filter_please_select: 'Seleccione', + + operator_equal: 'igual', + operator_not_equal: 'no igual', + operator_in: 'sea', + operator_not_in: 'no sea', + operator_less: 'menor', + operator_less_or_equal: 'menor o igual', + operator_greater: 'mayor', + operator_greater_or_equal: 'mayor o igual', + operator_between: 'entre', + operator_not_between: 'no esté entre', + operator_begins_with: 'empiece por', + operator_not_begins_with: 'no empiece por', + operator_contains: 'contenga', + operator_not_contains: 'no contenga', + operator_ends_with: 'termine en', + operator_not_ends_with: 'no termine en', + operator_is_empty: 'esté vacio', + operator_is_not_empty: 'no esté vacio', + operator_is_null: 'sea nulo', + operator_is_not_null: 'no sea nulo', + + error_no_value_given: "Valor no declarado", + error_invalid_number: "Valor no numerico", + error_invalid_datetime: "Formato de fecha incorrecto", + error_converting_value: "Error al convertir el valor" +}; \ No newline at end of file diff --git a/connector-miravia/lib/filter_rules/localization/tr.min.js b/connector-miravia/lib/filter_rules/localization/tr.min.js new file mode 100644 index 0000000..676d4ef --- /dev/null +++ b/connector-miravia/lib/filter_rules/localization/tr.min.js @@ -0,0 +1,55 @@ +/** + * jui_filter_rules v1.0.7 simple localization - ENGLISH + * + * DO NOT CHANGE this file, as it will be overwritten in next update. + * To use different values, write and use a similar structure js file. + * + */ +var rsc_jui_fr = { + + no_filters_found: "No filters defined", + + rules_group_AND: "all rules", + rules_group_OR: "any rule", + + rule: "rule", + group: "group", + tools_please_select: "»", + rule_insert_before: "insert before", + rule_insert_after: "insert after", + rule_insert_inside: "insert inside", + rule_clear: "clear", + rule_delete: "delete", + group_insert_before: "insert before", + group_insert_after: "insert after", + group_insert_inside: "insert inside", + group_delete: "delete", + + filter_please_select: '» select', + + operator_equal: 'equal', + operator_not_equal: 'not_equal', + operator_in: 'in', + operator_not_in: 'not in', + operator_less: 'less', + operator_less_or_equal: 'less or equal', + operator_greater: 'greater', + operator_greater_or_equal: 'greater or equal', + operator_between: 'between', + operator_not_between: 'not between', + operator_begins_with: 'begins with', + operator_not_begins_with: 'does not begin with', + operator_contains: 'contains', + operator_not_contains: 'does not contain', + operator_ends_with: 'ends with', + operator_not_ends_with: 'does not end with', + operator_is_empty: 'is empty', + operator_is_not_empty: 'is not empty', + operator_is_null: 'is null', + operator_is_not_null: 'is not null', + + error_no_value_given: "Value not given", + error_invalid_number: "Value is not numeric", + error_invalid_datetime: "Invalid date format", + error_converting_value: "Error converting value" +}; \ No newline at end of file diff --git a/connector-miravia/lib/filter_rules_miravia.js b/connector-miravia/lib/filter_rules_miravia.js new file mode 100644 index 0000000..366fa1e --- /dev/null +++ b/connector-miravia/lib/filter_rules_miravia.js @@ -0,0 +1,235 @@ +jQuery(document).ready(function($) { + if(typeof categories == 'undefined') { + return; + } + + $("#filter_editor").jui_filter_rules( getFilterConfig() ); + if(filter !== false){ + setRules(filter); + } + + $("#miravia_rules_form").submit(function(){ + var data = ''; + data = getRulesJson(); + $("#miravia_rules_form").append(''); + data = getActionDetailJson(); + $("#miravia_rules_form").append(''); + }); + + $("#action_type").change(function(){ + setActionDetail(); + }); + + setActionDetail(); + +function getFilterConfig() { + + var filter_config = { + + bootstrap_version: "3", + + filters: [ + { + filterName: "Name", "filterType": "text", field: "product_name", filterLabel: "Product name", + excluded_operators: ["in", "not_in"], + filter_interface: [ + { + filter_element: "input", + filter_element_attributes: {"type": "text", "value": ""} + } + ] + }, + { + filterName: "Price", + "filterType": "number", + "numberType": "double", + field: "price", + filterLabel: "Product price", + excluded_operators: ["in", "not_in"] + }, + { + filterName: "SpecificPrice", + "filterType": "number", + "numberType": "double", + field: "specific_price", + filterLabel: "Product specific price", + excluded_operators: ["in", "not_in"] + }, + { + filterName: "Stock", + "filterType": "number", + "numberType": "integer", + field: "stock", + filterLabel: "Stock", + excluded_operators: ["in", "not_in"] + }, + { + filterName: "Category", + "filterType": "number", + "numberType": "integer", + field: "category", + filterLabel: "Category", + excluded_operators: ["in", "not_in", "less", "less_or_equal", "greater", "greater_or_equal"], + filter_interface: [ + { + filter_element: "select" + } + ], + lookup_values: categories + }, + // { + // filterName: "Supplier", + // "filterType": "number", + // "numberType": "integer", + // field: "supplier", + // filterLabel: "Supplier", + // excluded_operators: ["in", "not_in", "less", "less_or_equal", "greater", "greater_or_equal"], + // filter_interface: [ + // { + // filter_element: "select" + // } + // ], + // lookup_values: suppliers + // }, + // { + // filterName: "Manufacturer", + // "filterType": "number", + // "numberType": "integer", + // field: "manufacturer", + // filterLabel: "Manufacturer", + // excluded_operators: ["in", "not_in", "less", "less_or_equal", "greater", "greater_or_equal"], + // filter_interface: [ + // { + // filter_element: "select" + // } + // ], + // lookup_values: manufacturers + // }, + ], + + onValidationError: function (event, data) { + alert(data["err_description"] + ' (' + data["err_code"] + ')'); + if (data.hasOwnProperty("elem_filter")) { + data.elem_filter.focus(); + } + } + + }; + + return filter_config; +} + +function setActionDetail() +{ + var action_type = $("#action_type").val(); + $("#action_detail").html(getActionDetail(action_type)); +} + +function getActionDetail(action_type) +{ + switch (action_type) { + case 'price_stock': + return getActionDetailModifyPriceStock(); + case 'name': + return getActionDetailModifyName(); + case 'logistics': + return getActionDetailLogistics(); + default: + return ''; + } +} +function getActionDetailModifyPriceStock() +{ + var v =action_detail.field || ''; + var html = ''; + v = action_detail.operator || ''; + html += '   '; + v = action_detail.value || ''; + v = v.replaceAll('"', ''); + html += ''; + return html; +} + +function getActionDetailModifyName() +{ + var v =action_detail.field || ''; + var html = '

    '; + v = action_detail.stringvalue || ''; + html += ''; + html += '
    '; + html += 'You can use these variables: %name%, %description%, %short_description%, %manufacturer%, %supplier%, %category%'; + html += '
    '; + return html; +} + +function getActionDetailLogistics() +{ + var v = action_detail.delivery || ''; + var html = '

    '; + v = action_detail.warehouse || ''; + html += ''; + html += '

    '; + return html; +} + +function getActionDetailJson() +{ + var action_type = $("#action_type").val(); + switch (action_type) { + case 'price_stock': + var ret = { + field: $('#action_detail_field').val(), + operator: $('#action_detail_operator').val(), + value: $('#action_detail_value').val() + }; + return JSON.stringify(ret); + case 'name': + var ret = { + field: $('#action_detail_field').val(), + stringvalue: $('#action_detail_value').val() + }; + return JSON.stringify(ret); + case 'logistics': + var ret = { + delivery: $('#action_detail_field').val(), + warehouse: $('#action_detail_value').val() + } + return JSON.stringify(ret); + default: + return ''; + } + +} + +function getRulesJson() +{ + return JSON.stringify($("#filter_editor").jui_filter_rules('getRules', 0, [])); +} + +function setRules(a_rules) +{ + $("#filter_editor").jui_filter_rules('setRules', a_rules); +} +}) \ No newline at end of file diff --git a/connector-miravia/lib/fontawesome-6.1.2.all.min.css b/connector-miravia/lib/fontawesome-6.1.2.all.min.css new file mode 100644 index 0000000..b9a01fb --- /dev/null +++ b/connector-miravia/lib/fontawesome-6.1.2.all.min.css @@ -0,0 +1,6 @@ +/*! + * Font Awesome Free 6.1.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2022 Fonticons, Inc. + */ +.fa{font-family:var(--fa-style-family,"Font Awesome 6 Free");font-weight:var(--fa-style,900)}.fa,.fa-brands,.fa-duotone,.fa-light,.fa-regular,.fa-solid,.fa-thin,.fab,.fad,.fal,.far,.fas,.fat{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:var(--fa-display,inline-block);font-style:normal;font-variant:normal;line-height:1;text-rendering:auto}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.08333em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.07143em;vertical-align:.05357em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.04167em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin,2.5em);padding-left:0}.fa-ul>li{position:relative}.fa-li{left:calc(var(--fa-li-width, 2em)*-1);position:absolute;text-align:center;width:var(--fa-li-width,2em);line-height:inherit}.fa-border{border-radius:var(--fa-border-radius,.1em);border:var(--fa-border-width,.08em) var(--fa-border-style,solid) var(--fa-border-color,#eee);padding:var(--fa-border-padding,.2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin,.3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin,.3em)}.fa-beat{-webkit-animation-name:fa-beat;animation-name:fa-beat;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-bounce{-webkit-animation-name:fa-bounce;animation-name:fa-bounce;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1))}.fa-fade{-webkit-animation-name:fa-fade;animation-name:fa-fade;-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-beat-fade,.fa-fade{-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s)}.fa-beat-fade{-webkit-animation-name:fa-beat-fade;animation-name:fa-beat-fade;-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-flip{-webkit-animation-name:fa-flip;animation-name:fa-flip;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-shake{-webkit-animation-name:fa-shake;animation-name:fa-shake;-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-shake,.fa-spin{-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal)}.fa-spin{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-duration:var(--fa-animation-duration,2s);animation-duration:var(--fa-animation-duration,2s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin-reverse{--fa-animation-direction:reverse}.fa-pulse,.fa-spin-pulse{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,steps(8));animation-timing-function:var(--fa-animation-timing,steps(8))}@media (prefers-reduced-motion:reduce){.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{-webkit-animation-delay:-1ms;animation-delay:-1ms;-webkit-animation-duration:1ms;animation-duration:1ms;-webkit-animation-iteration-count:1;animation-iteration-count:1;transition-delay:0s;transition-duration:0s}}@-webkit-keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@-webkit-keyframes fa-bounce{0%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@keyframes fa-bounce{0%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@-webkit-keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@-webkit-keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@-webkit-keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@-webkit-keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}.fa-rotate-by{-webkit-transform:rotate(var(--fa-rotate-angle,none));transform:rotate(var(--fa-rotate-angle,none))}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%;z-index:var(--fa-stack-z-index,auto)}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:var(--fa-inverse,#fff)}.fa-0:before{content:"\30"}.fa-1:before{content:"\31"}.fa-2:before{content:"\32"}.fa-3:before{content:"\33"}.fa-4:before{content:"\34"}.fa-5:before{content:"\35"}.fa-6:before{content:"\36"}.fa-7:before{content:"\37"}.fa-8:before{content:"\38"}.fa-9:before{content:"\39"}.fa-a:before{content:"\41"}.fa-address-book:before,.fa-contact-book:before{content:"\f2b9"}.fa-address-card:before,.fa-contact-card:before,.fa-vcard:before{content:"\f2bb"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-anchor:before{content:"\f13d"}.fa-anchor-circle-check:before{content:"\e4aa"}.fa-anchor-circle-exclamation:before{content:"\e4ab"}.fa-anchor-circle-xmark:before{content:"\e4ac"}.fa-anchor-lock:before{content:"\e4ad"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-double-down:before,.fa-angles-down:before{content:"\f103"}.fa-angle-double-left:before,.fa-angles-left:before{content:"\f100"}.fa-angle-double-right:before,.fa-angles-right:before{content:"\f101"}.fa-angle-double-up:before,.fa-angles-up:before{content:"\f102"}.fa-ankh:before{content:"\f644"}.fa-apple-alt:before,.fa-apple-whole:before{content:"\f5d1"}.fa-archway:before{content:"\f557"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-down-1-9:before,.fa-sort-numeric-asc:before,.fa-sort-numeric-down:before{content:"\f162"}.fa-arrow-down-9-1:before,.fa-sort-numeric-desc:before,.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-arrow-down-a-z:before,.fa-sort-alpha-asc:before,.fa-sort-alpha-down:before{content:"\f15d"}.fa-arrow-down-long:before,.fa-long-arrow-down:before{content:"\f175"}.fa-arrow-down-short-wide:before,.fa-sort-amount-desc:before,.fa-sort-amount-down-alt:before{content:"\f884"}.fa-arrow-down-up-across-line:before{content:"\e4af"}.fa-arrow-down-up-lock:before{content:"\e4b0"}.fa-arrow-down-wide-short:before,.fa-sort-amount-asc:before,.fa-sort-amount-down:before{content:"\f160"}.fa-arrow-down-z-a:before,.fa-sort-alpha-desc:before,.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-left-long:before,.fa-long-arrow-left:before{content:"\f177"}.fa-arrow-pointer:before,.fa-mouse-pointer:before{content:"\f245"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-right-arrow-left:before,.fa-exchange:before{content:"\f0ec"}.fa-arrow-right-from-bracket:before,.fa-sign-out:before{content:"\f08b"}.fa-arrow-right-long:before,.fa-long-arrow-right:before{content:"\f178"}.fa-arrow-right-to-bracket:before,.fa-sign-in:before{content:"\f090"}.fa-arrow-right-to-city:before{content:"\e4b3"}.fa-arrow-left-rotate:before,.fa-arrow-rotate-back:before,.fa-arrow-rotate-backward:before,.fa-arrow-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-arrow-right-rotate:before,.fa-arrow-rotate-forward:before,.fa-arrow-rotate-right:before,.fa-redo:before{content:"\f01e"}.fa-arrow-trend-down:before{content:"\e097"}.fa-arrow-trend-up:before{content:"\e098"}.fa-arrow-turn-down:before,.fa-level-down:before{content:"\f149"}.fa-arrow-turn-up:before,.fa-level-up:before{content:"\f148"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-up-1-9:before,.fa-sort-numeric-up:before{content:"\f163"}.fa-arrow-up-9-1:before,.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-arrow-up-a-z:before,.fa-sort-alpha-up:before{content:"\f15e"}.fa-arrow-up-from-bracket:before{content:"\e09a"}.fa-arrow-up-from-ground-water:before{content:"\e4b5"}.fa-arrow-up-from-water-pump:before{content:"\e4b6"}.fa-arrow-up-long:before,.fa-long-arrow-up:before{content:"\f176"}.fa-arrow-up-right-dots:before{content:"\e4b7"}.fa-arrow-up-right-from-square:before,.fa-external-link:before{content:"\f08e"}.fa-arrow-up-short-wide:before,.fa-sort-amount-up-alt:before{content:"\f885"}.fa-arrow-up-wide-short:before,.fa-sort-amount-up:before{content:"\f161"}.fa-arrow-up-z-a:before,.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-arrows-down-to-line:before{content:"\e4b8"}.fa-arrows-down-to-people:before{content:"\e4b9"}.fa-arrows-h:before,.fa-arrows-left-right:before{content:"\f07e"}.fa-arrows-left-right-to-line:before{content:"\e4ba"}.fa-arrows-rotate:before,.fa-refresh:before,.fa-sync:before{content:"\f021"}.fa-arrows-spin:before{content:"\e4bb"}.fa-arrows-split-up-and-left:before{content:"\e4bc"}.fa-arrows-to-circle:before{content:"\e4bd"}.fa-arrows-to-dot:before{content:"\e4be"}.fa-arrows-to-eye:before{content:"\e4bf"}.fa-arrows-turn-right:before{content:"\e4c0"}.fa-arrows-turn-to-dots:before{content:"\e4c1"}.fa-arrows-up-down:before,.fa-arrows-v:before{content:"\f07d"}.fa-arrows-up-down-left-right:before,.fa-arrows:before{content:"\f047"}.fa-arrows-up-to-line:before{content:"\e4c2"}.fa-asterisk:before{content:"\2a"}.fa-at:before{content:"\40"}.fa-atom:before{content:"\f5d2"}.fa-audio-description:before{content:"\f29e"}.fa-austral-sign:before{content:"\e0a9"}.fa-award:before{content:"\f559"}.fa-b:before{content:"\42"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before,.fa-carriage-baby:before{content:"\f77d"}.fa-backward:before{content:"\f04a"}.fa-backward-fast:before,.fa-fast-backward:before{content:"\f049"}.fa-backward-step:before,.fa-step-backward:before{content:"\f048"}.fa-bacon:before{content:"\f7e5"}.fa-bacteria:before{content:"\e059"}.fa-bacterium:before{content:"\e05a"}.fa-bag-shopping:before,.fa-shopping-bag:before{content:"\f290"}.fa-bahai:before,.fa-haykal:before{content:"\f666"}.fa-baht-sign:before{content:"\e0ac"}.fa-ban:before,.fa-cancel:before{content:"\f05e"}.fa-ban-smoking:before,.fa-smoking-ban:before{content:"\f54d"}.fa-band-aid:before,.fa-bandage:before{content:"\f462"}.fa-barcode:before{content:"\f02a"}.fa-bars:before,.fa-navicon:before{content:"\f0c9"}.fa-bars-progress:before,.fa-tasks-alt:before{content:"\f828"}.fa-bars-staggered:before,.fa-reorder:before,.fa-stream:before{content:"\f550"}.fa-baseball-ball:before,.fa-baseball:before{content:"\f433"}.fa-baseball-bat-ball:before{content:"\f432"}.fa-basket-shopping:before,.fa-shopping-basket:before{content:"\f291"}.fa-basketball-ball:before,.fa-basketball:before{content:"\f434"}.fa-bath:before,.fa-bathtub:before{content:"\f2cd"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-battery-5:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-battery-3:before,.fa-battery-half:before{content:"\f242"}.fa-battery-2:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-4:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-bed:before{content:"\f236"}.fa-bed-pulse:before,.fa-procedures:before{content:"\f487"}.fa-beer-mug-empty:before,.fa-beer:before{content:"\f0fc"}.fa-bell:before{content:"\f0f3"}.fa-bell-concierge:before,.fa-concierge-bell:before{content:"\f562"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bicycle:before{content:"\f206"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-bitcoin-sign:before{content:"\e0b4"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blog:before{content:"\f781"}.fa-bold:before{content:"\f032"}.fa-bolt:before,.fa-zap:before{content:"\f0e7"}.fa-bolt-lightning:before{content:"\e0b7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-atlas:before,.fa-book-atlas:before{content:"\f558"}.fa-bible:before,.fa-book-bible:before{content:"\f647"}.fa-book-bookmark:before{content:"\e0bb"}.fa-book-journal-whills:before,.fa-journal-whills:before{content:"\f66a"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-open-reader:before,.fa-book-reader:before{content:"\f5da"}.fa-book-quran:before,.fa-quran:before{content:"\f687"}.fa-book-dead:before,.fa-book-skull:before{content:"\f6b7"}.fa-book-tanakh:before,.fa-tanakh:before{content:"\f827"}.fa-bookmark:before{content:"\f02e"}.fa-border-all:before{content:"\f84c"}.fa-border-none:before{content:"\f850"}.fa-border-style:before,.fa-border-top-left:before{content:"\f853"}.fa-bore-hole:before{content:"\e4c3"}.fa-bottle-droplet:before{content:"\e4c4"}.fa-bottle-water:before{content:"\e4c5"}.fa-bowl-food:before{content:"\e4c6"}.fa-bowl-rice:before{content:"\e2eb"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-archive:before,.fa-box-archive:before{content:"\f187"}.fa-box-open:before{content:"\f49e"}.fa-box-tissue:before{content:"\e05b"}.fa-boxes-packing:before{content:"\e4c7"}.fa-boxes-alt:before,.fa-boxes-stacked:before,.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-brazilian-real-sign:before{content:"\e46c"}.fa-bread-slice:before{content:"\f7ec"}.fa-bridge:before{content:"\e4c8"}.fa-bridge-circle-check:before{content:"\e4c9"}.fa-bridge-circle-exclamation:before{content:"\e4ca"}.fa-bridge-circle-xmark:before{content:"\e4cb"}.fa-bridge-lock:before{content:"\e4cc"}.fa-bridge-water:before{content:"\e4ce"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broom:before{content:"\f51a"}.fa-broom-ball:before,.fa-quidditch-broom-ball:before,.fa-quidditch:before{content:"\f458"}.fa-brush:before{content:"\f55d"}.fa-bucket:before{content:"\e4cf"}.fa-bug:before{content:"\f188"}.fa-bug-slash:before{content:"\e490"}.fa-bugs:before{content:"\e4d0"}.fa-building:before{content:"\f1ad"}.fa-building-circle-arrow-right:before{content:"\e4d1"}.fa-building-circle-check:before{content:"\e4d2"}.fa-building-circle-exclamation:before{content:"\e4d3"}.fa-building-circle-xmark:before{content:"\e4d4"}.fa-bank:before,.fa-building-columns:before,.fa-institution:before,.fa-museum:before,.fa-university:before{content:"\f19c"}.fa-building-flag:before{content:"\e4d5"}.fa-building-lock:before{content:"\e4d6"}.fa-building-ngo:before{content:"\e4d7"}.fa-building-shield:before{content:"\e4d8"}.fa-building-un:before{content:"\e4d9"}.fa-building-user:before{content:"\e4da"}.fa-building-wheat:before{content:"\e4db"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burger:before,.fa-hamburger:before{content:"\f805"}.fa-burst:before{content:"\e4dc"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before,.fa-bus-simple:before{content:"\f55e"}.fa-briefcase-clock:before,.fa-business-time:before{content:"\f64a"}.fa-c:before{content:"\43"}.fa-cable-car:before,.fa-tram:before{content:"\f7da"}.fa-birthday-cake:before,.fa-cake-candles:before,.fa-cake:before{content:"\f1fd"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-alt:before,.fa-calendar-days:before{content:"\f073"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-week:before{content:"\f784"}.fa-calendar-times:before,.fa-calendar-xmark:before{content:"\f273"}.fa-camera-alt:before,.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-camera-rotate:before{content:"\e0d8"}.fa-campground:before{content:"\f6bb"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-battery-car:before,.fa-car-battery:before{content:"\f5df"}.fa-car-burst:before,.fa-car-crash:before{content:"\f5e1"}.fa-car-on:before{content:"\e4dd"}.fa-car-alt:before,.fa-car-rear:before{content:"\f5de"}.fa-car-side:before{content:"\f5e4"}.fa-car-tunnel:before{content:"\e4de"}.fa-caravan:before{content:"\f8ff"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-flatbed:before,.fa-dolly-flatbed:before{content:"\f474"}.fa-cart-flatbed-suitcase:before,.fa-luggage-cart:before{content:"\f59d"}.fa-cart-plus:before{content:"\f217"}.fa-cart-shopping:before,.fa-shopping-cart:before{content:"\f07a"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cedi-sign:before{content:"\e0df"}.fa-cent-sign:before{content:"\e3f5"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-blackboard:before,.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before,.fa-chalkboard-user:before{content:"\f51c"}.fa-champagne-glasses:before,.fa-glass-cheers:before{content:"\f79f"}.fa-charging-station:before{content:"\f5e7"}.fa-area-chart:before,.fa-chart-area:before{content:"\f1fe"}.fa-bar-chart:before,.fa-chart-bar:before{content:"\f080"}.fa-chart-column:before{content:"\e0e3"}.fa-chart-gantt:before{content:"\e0e4"}.fa-chart-line:before,.fa-line-chart:before{content:"\f201"}.fa-chart-pie:before,.fa-pie-chart:before{content:"\f200"}.fa-chart-simple:before{content:"\e473"}.fa-check:before{content:"\f00c"}.fa-check-double:before{content:"\f560"}.fa-check-to-slot:before,.fa-vote-yea:before{content:"\f772"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-child-dress:before{content:"\e59c"}.fa-child-reaching:before{content:"\e59d"}.fa-child-rifle:before{content:"\e4e0"}.fa-children:before{content:"\e4e1"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-arrow-circle-down:before,.fa-circle-arrow-down:before{content:"\f0ab"}.fa-arrow-circle-left:before,.fa-circle-arrow-left:before{content:"\f0a8"}.fa-arrow-circle-right:before,.fa-circle-arrow-right:before{content:"\f0a9"}.fa-arrow-circle-up:before,.fa-circle-arrow-up:before{content:"\f0aa"}.fa-check-circle:before,.fa-circle-check:before{content:"\f058"}.fa-chevron-circle-down:before,.fa-circle-chevron-down:before{content:"\f13a"}.fa-chevron-circle-left:before,.fa-circle-chevron-left:before{content:"\f137"}.fa-chevron-circle-right:before,.fa-circle-chevron-right:before{content:"\f138"}.fa-chevron-circle-up:before,.fa-circle-chevron-up:before{content:"\f139"}.fa-circle-dollar-to-slot:before,.fa-donate:before{content:"\f4b9"}.fa-circle-dot:before,.fa-dot-circle:before{content:"\f192"}.fa-arrow-alt-circle-down:before,.fa-circle-down:before{content:"\f358"}.fa-circle-exclamation:before,.fa-exclamation-circle:before{content:"\f06a"}.fa-circle-h:before,.fa-hospital-symbol:before{content:"\f47e"}.fa-adjust:before,.fa-circle-half-stroke:before{content:"\f042"}.fa-circle-info:before,.fa-info-circle:before{content:"\f05a"}.fa-arrow-alt-circle-left:before,.fa-circle-left:before{content:"\f359"}.fa-circle-minus:before,.fa-minus-circle:before{content:"\f056"}.fa-circle-nodes:before{content:"\e4e2"}.fa-circle-notch:before{content:"\f1ce"}.fa-circle-pause:before,.fa-pause-circle:before{content:"\f28b"}.fa-circle-play:before,.fa-play-circle:before{content:"\f144"}.fa-circle-plus:before,.fa-plus-circle:before{content:"\f055"}.fa-circle-question:before,.fa-question-circle:before{content:"\f059"}.fa-circle-radiation:before,.fa-radiation-alt:before{content:"\f7ba"}.fa-arrow-alt-circle-right:before,.fa-circle-right:before{content:"\f35a"}.fa-circle-stop:before,.fa-stop-circle:before{content:"\f28d"}.fa-arrow-alt-circle-up:before,.fa-circle-up:before{content:"\f35b"}.fa-circle-user:before,.fa-user-circle:before{content:"\f2bd"}.fa-circle-xmark:before,.fa-times-circle:before,.fa-xmark-circle:before{content:"\f057"}.fa-city:before{content:"\f64f"}.fa-clapperboard:before{content:"\e131"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clipboard-question:before{content:"\e4e3"}.fa-clipboard-user:before{content:"\f7f3"}.fa-clock-four:before,.fa-clock:before{content:"\f017"}.fa-clock-rotate-left:before,.fa-history:before{content:"\f1da"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-arrow-down:before,.fa-cloud-download-alt:before,.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-arrow-up:before,.fa-cloud-upload-alt:before,.fa-cloud-upload:before{content:"\f0ee"}.fa-cloud-bolt:before,.fa-thunderstorm:before{content:"\f76c"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-showers-water:before{content:"\e4e4"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-clover:before{content:"\e139"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-code-commit:before{content:"\f386"}.fa-code-compare:before{content:"\e13a"}.fa-code-fork:before{content:"\e13b"}.fa-code-merge:before{content:"\f387"}.fa-code-pull-request:before{content:"\e13c"}.fa-coins:before{content:"\f51e"}.fa-colon-sign:before{content:"\e140"}.fa-comment:before{content:"\f075"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before,.fa-commenting:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comment-sms:before,.fa-sms:before{content:"\f7cd"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compass-drafting:before,.fa-drafting-compass:before{content:"\f568"}.fa-compress:before{content:"\f066"}.fa-computer:before{content:"\e4e5"}.fa-computer-mouse:before,.fa-mouse:before{content:"\f8cc"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-couch:before{content:"\f4b8"}.fa-cow:before{content:"\f6c8"}.fa-credit-card-alt:before,.fa-credit-card:before{content:"\f09d"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before,.fa-crop-simple:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-cruzeiro-sign:before{content:"\e152"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cubes-stacked:before{content:"\e4e6"}.fa-d:before{content:"\44"}.fa-database:before{content:"\f1c0"}.fa-backspace:before,.fa-delete-left:before{content:"\f55a"}.fa-democrat:before{content:"\f747"}.fa-desktop-alt:before,.fa-desktop:before{content:"\f390"}.fa-dharmachakra:before{content:"\f655"}.fa-diagram-next:before{content:"\e476"}.fa-diagram-predecessor:before{content:"\e477"}.fa-diagram-project:before,.fa-project-diagram:before{content:"\f542"}.fa-diagram-successor:before{content:"\e47a"}.fa-diamond:before{content:"\f219"}.fa-diamond-turn-right:before,.fa-directions:before{content:"\f5eb"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-disease:before{content:"\f7fa"}.fa-display:before{content:"\e163"}.fa-divide:before{content:"\f529"}.fa-dna:before{content:"\f471"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before,.fa-dollar:before,.fa-usd:before{content:"\24"}.fa-dolly-box:before,.fa-dolly:before{content:"\f472"}.fa-dong-sign:before{content:"\e169"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dove:before{content:"\f4ba"}.fa-compress-alt:before,.fa-down-left-and-up-right-to-center:before{content:"\f422"}.fa-down-long:before,.fa-long-arrow-alt-down:before{content:"\f309"}.fa-download:before{content:"\f019"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-droplet:before,.fa-tint:before{content:"\f043"}.fa-droplet-slash:before,.fa-tint-slash:before{content:"\f5c7"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-e:before{content:"\45"}.fa-deaf:before,.fa-deafness:before,.fa-ear-deaf:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-assistive-listening-systems:before,.fa-ear-listen:before{content:"\f2a2"}.fa-earth-africa:before,.fa-globe-africa:before{content:"\f57c"}.fa-earth-america:before,.fa-earth-americas:before,.fa-earth:before,.fa-globe-americas:before{content:"\f57d"}.fa-earth-asia:before,.fa-globe-asia:before{content:"\f57e"}.fa-earth-europe:before,.fa-globe-europe:before{content:"\f7a2"}.fa-earth-oceania:before,.fa-globe-oceania:before{content:"\e47b"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elevator:before{content:"\e16d"}.fa-ellipsis-h:before,.fa-ellipsis:before{content:"\f141"}.fa-ellipsis-v:before,.fa-ellipsis-vertical:before{content:"\f142"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-circle-check:before{content:"\e4e8"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelopes-bulk:before,.fa-mail-bulk:before{content:"\f674"}.fa-equals:before{content:"\3d"}.fa-eraser:before{content:"\f12d"}.fa-ethernet:before{content:"\f796"}.fa-eur:before,.fa-euro-sign:before,.fa-euro:before{content:"\f153"}.fa-exclamation:before{content:"\21"}.fa-expand:before{content:"\f065"}.fa-explosion:before{content:"\e4e9"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper-empty:before,.fa-eye-dropper:before,.fa-eyedropper:before{content:"\f1fb"}.fa-eye-low-vision:before,.fa-low-vision:before{content:"\f2a8"}.fa-eye-slash:before{content:"\f070"}.fa-f:before{content:"\46"}.fa-angry:before,.fa-face-angry:before{content:"\f556"}.fa-dizzy:before,.fa-face-dizzy:before{content:"\f567"}.fa-face-flushed:before,.fa-flushed:before{content:"\f579"}.fa-face-frown:before,.fa-frown:before{content:"\f119"}.fa-face-frown-open:before,.fa-frown-open:before{content:"\f57a"}.fa-face-grimace:before,.fa-grimace:before{content:"\f57f"}.fa-face-grin:before,.fa-grin:before{content:"\f580"}.fa-face-grin-beam:before,.fa-grin-beam:before{content:"\f582"}.fa-face-grin-beam-sweat:before,.fa-grin-beam-sweat:before{content:"\f583"}.fa-face-grin-hearts:before,.fa-grin-hearts:before{content:"\f584"}.fa-face-grin-squint:before,.fa-grin-squint:before{content:"\f585"}.fa-face-grin-squint-tears:before,.fa-grin-squint-tears:before{content:"\f586"}.fa-face-grin-stars:before,.fa-grin-stars:before{content:"\f587"}.fa-face-grin-tears:before,.fa-grin-tears:before{content:"\f588"}.fa-face-grin-tongue:before,.fa-grin-tongue:before{content:"\f589"}.fa-face-grin-tongue-squint:before,.fa-grin-tongue-squint:before{content:"\f58a"}.fa-face-grin-tongue-wink:before,.fa-grin-tongue-wink:before{content:"\f58b"}.fa-face-grin-wide:before,.fa-grin-alt:before{content:"\f581"}.fa-face-grin-wink:before,.fa-grin-wink:before{content:"\f58c"}.fa-face-kiss:before,.fa-kiss:before{content:"\f596"}.fa-face-kiss-beam:before,.fa-kiss-beam:before{content:"\f597"}.fa-face-kiss-wink-heart:before,.fa-kiss-wink-heart:before{content:"\f598"}.fa-face-laugh:before,.fa-laugh:before{content:"\f599"}.fa-face-laugh-beam:before,.fa-laugh-beam:before{content:"\f59a"}.fa-face-laugh-squint:before,.fa-laugh-squint:before{content:"\f59b"}.fa-face-laugh-wink:before,.fa-laugh-wink:before{content:"\f59c"}.fa-face-meh:before,.fa-meh:before{content:"\f11a"}.fa-face-meh-blank:before,.fa-meh-blank:before{content:"\f5a4"}.fa-face-rolling-eyes:before,.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-face-sad-cry:before,.fa-sad-cry:before{content:"\f5b3"}.fa-face-sad-tear:before,.fa-sad-tear:before{content:"\f5b4"}.fa-face-smile:before,.fa-smile:before{content:"\f118"}.fa-face-smile-beam:before,.fa-smile-beam:before{content:"\f5b8"}.fa-face-smile-wink:before,.fa-smile-wink:before{content:"\f4da"}.fa-face-surprise:before,.fa-surprise:before{content:"\f5c2"}.fa-face-tired:before,.fa-tired:before{content:"\f5c8"}.fa-fan:before{content:"\f863"}.fa-faucet:before{content:"\e005"}.fa-faucet-drip:before{content:"\e006"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before,.fa-feather-pointed:before{content:"\f56b"}.fa-ferry:before{content:"\e4ea"}.fa-file:before{content:"\f15b"}.fa-file-arrow-down:before,.fa-file-download:before{content:"\f56d"}.fa-file-arrow-up:before,.fa-file-upload:before{content:"\f574"}.fa-file-audio:before{content:"\f1c7"}.fa-file-circle-check:before{content:"\e5a0"}.fa-file-circle-exclamation:before{content:"\e4eb"}.fa-file-circle-minus:before{content:"\e4ed"}.fa-file-circle-plus:before{content:"\e494"}.fa-file-circle-question:before{content:"\e4ef"}.fa-file-circle-xmark:before{content:"\e5a1"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-excel:before{content:"\f1c3"}.fa-arrow-right-from-file:before,.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-arrow-right-to-file:before,.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-alt:before,.fa-file-lines:before,.fa-file-text:before{content:"\f15c"}.fa-file-medical:before{content:"\f477"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-edit:before,.fa-file-pen:before{content:"\f31c"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-shield:before{content:"\e4f0"}.fa-file-signature:before{content:"\f573"}.fa-file-video:before{content:"\f1c8"}.fa-file-medical-alt:before,.fa-file-waveform:before{content:"\f478"}.fa-file-word:before{content:"\f1c2"}.fa-file-archive:before,.fa-file-zipper:before{content:"\f1c6"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-filter-circle-dollar:before,.fa-funnel-dollar:before{content:"\f662"}.fa-filter-circle-xmark:before{content:"\e17b"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-burner:before{content:"\e4f1"}.fa-fire-extinguisher:before{content:"\f134"}.fa-fire-alt:before,.fa-fire-flame-curved:before{content:"\f7e4"}.fa-burn:before,.fa-fire-flame-simple:before{content:"\f46a"}.fa-fish:before{content:"\f578"}.fa-fish-fins:before{content:"\e4f2"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flask-vial:before{content:"\e4f3"}.fa-floppy-disk:before,.fa-save:before{content:"\f0c7"}.fa-florin-sign:before{content:"\e184"}.fa-folder-blank:before,.fa-folder:before{content:"\f07b"}.fa-folder-closed:before{content:"\e185"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-folder-tree:before{content:"\f802"}.fa-font:before{content:"\f031"}.fa-football-ball:before,.fa-football:before{content:"\f44e"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before,.fa-forward-fast:before{content:"\f050"}.fa-forward-step:before,.fa-step-forward:before{content:"\f051"}.fa-franc-sign:before{content:"\e18f"}.fa-frog:before{content:"\f52e"}.fa-futbol-ball:before,.fa-futbol:before,.fa-soccer-ball:before{content:"\f1e3"}.fa-g:before{content:"\47"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-dashboard:before,.fa-gauge-med:before,.fa-gauge:before,.fa-tachometer-alt-average:before{content:"\f624"}.fa-gauge-high:before,.fa-tachometer-alt-fast:before,.fa-tachometer-alt:before{content:"\f625"}.fa-gauge-simple-med:before,.fa-gauge-simple:before,.fa-tachometer-average:before{content:"\f629"}.fa-gauge-simple-high:before,.fa-tachometer-fast:before,.fa-tachometer:before{content:"\f62a"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-glass-water:before{content:"\e4f4"}.fa-glass-water-droplet:before{content:"\e4f5"}.fa-glasses:before{content:"\f530"}.fa-globe:before{content:"\f0ac"}.fa-golf-ball-tee:before,.fa-golf-ball:before{content:"\f450"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-greater-than:before{content:"\3e"}.fa-greater-than-equal:before{content:"\f532"}.fa-grip-horizontal:before,.fa-grip:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-group-arrows-rotate:before{content:"\e4f6"}.fa-guarani-sign:before{content:"\e19a"}.fa-guitar:before{content:"\f7a6"}.fa-gun:before{content:"\e19b"}.fa-h:before{content:"\48"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-paper:before,.fa-hand:before{content:"\f256"}.fa-hand-back-fist:before,.fa-hand-rock:before{content:"\f255"}.fa-allergies:before,.fa-hand-dots:before{content:"\f461"}.fa-fist-raised:before,.fa-hand-fist:before{content:"\f6de"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-dollar:before,.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-holding-droplet:before,.fa-hand-holding-water:before{content:"\f4c1"}.fa-hand-holding-hand:before{content:"\e4f7"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-medical:before{content:"\e05c"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-sparkles:before{content:"\e05d"}.fa-hand-spock:before{content:"\f259"}.fa-handcuffs:before{content:"\e4f8"}.fa-hands:before,.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before,.fa-hands-american-sign-language-interpreting:before,.fa-hands-asl-interpreting:before{content:"\f2a3"}.fa-hands-bound:before{content:"\e4f9"}.fa-hands-bubbles:before,.fa-hands-wash:before{content:"\e05e"}.fa-hands-clapping:before{content:"\e1a8"}.fa-hands-holding:before{content:"\f4c2"}.fa-hands-holding-child:before{content:"\e4fa"}.fa-hands-holding-circle:before{content:"\e4fb"}.fa-hands-praying:before,.fa-praying-hands:before{content:"\f684"}.fa-handshake:before{content:"\f2b5"}.fa-hands-helping:before,.fa-handshake-angle:before{content:"\f4c4"}.fa-handshake-alt:before,.fa-handshake-simple:before{content:"\f4c6"}.fa-handshake-alt-slash:before,.fa-handshake-simple-slash:before{content:"\e05f"}.fa-handshake-slash:before{content:"\e060"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-drive:before,.fa-hdd:before{content:"\f0a0"}.fa-hashtag:before{content:"\23"}.fa-hat-cowboy:before{content:"\f8c0"}.fa-hat-cowboy-side:before{content:"\f8c1"}.fa-hat-wizard:before{content:"\f6e8"}.fa-head-side-cough:before{content:"\e061"}.fa-head-side-cough-slash:before{content:"\e062"}.fa-head-side-mask:before{content:"\e063"}.fa-head-side-virus:before{content:"\e064"}.fa-header:before,.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before,.fa-headphones-simple:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-circle-bolt:before{content:"\e4fc"}.fa-heart-circle-check:before{content:"\e4fd"}.fa-heart-circle-exclamation:before{content:"\e4fe"}.fa-heart-circle-minus:before{content:"\e4ff"}.fa-heart-circle-plus:before{content:"\e500"}.fa-heart-circle-xmark:before{content:"\e501"}.fa-heart-broken:before,.fa-heart-crack:before{content:"\f7a9"}.fa-heart-pulse:before,.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-helicopter-symbol:before{content:"\e502"}.fa-hard-hat:before,.fa-hat-hard:before,.fa-helmet-safety:before{content:"\f807"}.fa-helmet-un:before{content:"\e503"}.fa-highlighter:before{content:"\f591"}.fa-hill-avalanche:before{content:"\e507"}.fa-hill-rockslide:before{content:"\e508"}.fa-hippo:before{content:"\f6ed"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital-alt:before,.fa-hospital-wide:before,.fa-hospital:before{content:"\f0f8"}.fa-hospital-user:before{content:"\f80d"}.fa-hot-tub-person:before,.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hourglass-empty:before,.fa-hourglass:before{content:"\f254"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-home-alt:before,.fa-home-lg-alt:before,.fa-home:before,.fa-house:before{content:"\f015"}.fa-home-lg:before,.fa-house-chimney:before{content:"\e3af"}.fa-house-chimney-crack:before,.fa-house-damage:before{content:"\f6f1"}.fa-clinic-medical:before,.fa-house-chimney-medical:before{content:"\f7f2"}.fa-house-chimney-user:before{content:"\e065"}.fa-house-chimney-window:before{content:"\e00d"}.fa-house-circle-check:before{content:"\e509"}.fa-house-circle-exclamation:before{content:"\e50a"}.fa-house-circle-xmark:before{content:"\e50b"}.fa-house-crack:before{content:"\e3b1"}.fa-house-fire:before{content:"\e50c"}.fa-house-flag:before{content:"\e50d"}.fa-house-flood-water:before{content:"\e50e"}.fa-house-flood-water-circle-arrow-right:before{content:"\e50f"}.fa-house-laptop:before,.fa-laptop-house:before{content:"\e066"}.fa-house-lock:before{content:"\e510"}.fa-house-medical:before{content:"\e3b2"}.fa-house-medical-circle-check:before{content:"\e511"}.fa-house-medical-circle-exclamation:before{content:"\e512"}.fa-house-medical-circle-xmark:before{content:"\e513"}.fa-house-medical-flag:before{content:"\e514"}.fa-house-signal:before{content:"\e012"}.fa-house-tsunami:before{content:"\e515"}.fa-home-user:before,.fa-house-user:before{content:"\e1b0"}.fa-hryvnia-sign:before,.fa-hryvnia:before{content:"\f6f2"}.fa-hurricane:before{content:"\f751"}.fa-i:before{content:"\49"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-heart-music-camera-bolt:before,.fa-icons:before{content:"\f86d"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before,.fa-id-card-clip:before{content:"\f47f"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-image-portrait:before,.fa-portrait:before{content:"\f3e0"}.fa-images:before{content:"\f302"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-indian-rupee-sign:before,.fa-indian-rupee:before,.fa-inr:before{content:"\e1bc"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-italic:before{content:"\f033"}.fa-j:before{content:"\4a"}.fa-jar:before{content:"\e516"}.fa-jar-wheat:before{content:"\e517"}.fa-jedi:before{content:"\f669"}.fa-fighter-jet:before,.fa-jet-fighter:before{content:"\f0fb"}.fa-jet-fighter-up:before{content:"\e518"}.fa-joint:before{content:"\f595"}.fa-jug-detergent:before{content:"\e519"}.fa-k:before{content:"\4b"}.fa-kaaba:before{content:"\f66b"}.fa-key:before{content:"\f084"}.fa-keyboard:before{content:"\f11c"}.fa-khanda:before{content:"\f66d"}.fa-kip-sign:before{content:"\e1c4"}.fa-first-aid:before,.fa-kit-medical:before{content:"\f479"}.fa-kitchen-set:before{content:"\e51a"}.fa-kiwi-bird:before{content:"\f535"}.fa-l:before{content:"\4c"}.fa-land-mine-on:before{content:"\e51b"}.fa-landmark:before{content:"\f66f"}.fa-landmark-alt:before,.fa-landmark-dome:before{content:"\f752"}.fa-landmark-flag:before{content:"\e51c"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-file:before{content:"\e51d"}.fa-laptop-medical:before{content:"\f812"}.fa-lari-sign:before{content:"\e1c8"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-left-long:before,.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-arrows-alt-h:before,.fa-left-right:before{content:"\f337"}.fa-lemon:before{content:"\f094"}.fa-less-than:before{content:"\3c"}.fa-less-than-equal:before{content:"\f537"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-lines-leaning:before{content:"\e51e"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-chain-broken:before,.fa-chain-slash:before,.fa-link-slash:before,.fa-unlink:before{content:"\f127"}.fa-lira-sign:before{content:"\f195"}.fa-list-squares:before,.fa-list:before{content:"\f03a"}.fa-list-check:before,.fa-tasks:before{content:"\f0ae"}.fa-list-1-2:before,.fa-list-numeric:before,.fa-list-ol:before{content:"\f0cb"}.fa-list-dots:before,.fa-list-ul:before{content:"\f0ca"}.fa-litecoin-sign:before{content:"\e1d3"}.fa-location-arrow:before{content:"\f124"}.fa-location-crosshairs:before,.fa-location:before{content:"\f601"}.fa-location-dot:before,.fa-map-marker-alt:before{content:"\f3c5"}.fa-location-pin:before,.fa-map-marker:before{content:"\f041"}.fa-location-pin-lock:before{content:"\e51f"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-locust:before{content:"\e520"}.fa-lungs:before{content:"\f604"}.fa-lungs-virus:before{content:"\e067"}.fa-m:before{content:"\4d"}.fa-magnet:before{content:"\f076"}.fa-magnifying-glass:before,.fa-search:before{content:"\f002"}.fa-magnifying-glass-arrow-right:before{content:"\e521"}.fa-magnifying-glass-chart:before{content:"\e522"}.fa-magnifying-glass-dollar:before,.fa-search-dollar:before{content:"\f688"}.fa-magnifying-glass-location:before,.fa-search-location:before{content:"\f689"}.fa-magnifying-glass-minus:before,.fa-search-minus:before{content:"\f010"}.fa-magnifying-glass-plus:before,.fa-search-plus:before{content:"\f00e"}.fa-manat-sign:before{content:"\e1d5"}.fa-map:before{content:"\f279"}.fa-map-location:before,.fa-map-marked:before{content:"\f59f"}.fa-map-location-dot:before,.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-pin:before{content:"\f276"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-and-venus:before{content:"\f224"}.fa-mars-and-venus-burst:before{content:"\e523"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before,.fa-mars-stroke-right:before{content:"\f22b"}.fa-mars-stroke-up:before,.fa-mars-stroke-v:before{content:"\f22a"}.fa-glass-martini-alt:before,.fa-martini-glass:before{content:"\f57b"}.fa-cocktail:before,.fa-martini-glass-citrus:before{content:"\f561"}.fa-glass-martini:before,.fa-martini-glass-empty:before{content:"\f000"}.fa-mask:before{content:"\f6fa"}.fa-mask-face:before{content:"\e1d7"}.fa-mask-ventilator:before{content:"\e524"}.fa-masks-theater:before,.fa-theater-masks:before{content:"\f630"}.fa-mattress-pillow:before{content:"\e525"}.fa-expand-arrows-alt:before,.fa-maximize:before{content:"\f31e"}.fa-medal:before{content:"\f5a2"}.fa-memory:before{content:"\f538"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-comment-alt:before,.fa-message:before{content:"\f27a"}.fa-meteor:before{content:"\f753"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before,.fa-microphone-lines:before{content:"\f3c9"}.fa-microphone-alt-slash:before,.fa-microphone-lines-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-mill-sign:before{content:"\e1ed"}.fa-compress-arrows-alt:before,.fa-minimize:before{content:"\f78c"}.fa-minus:before,.fa-subtract:before{content:"\f068"}.fa-mitten:before{content:"\f7b5"}.fa-mobile-android:before,.fa-mobile-phone:before,.fa-mobile:before{content:"\f3ce"}.fa-mobile-button:before{content:"\f10b"}.fa-mobile-retro:before{content:"\e527"}.fa-mobile-android-alt:before,.fa-mobile-screen:before{content:"\f3cf"}.fa-mobile-alt:before,.fa-mobile-screen-button:before{content:"\f3cd"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-1:before,.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-1-wave:before,.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-bill-transfer:before{content:"\e528"}.fa-money-bill-trend-up:before{content:"\e529"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wheat:before{content:"\e52a"}.fa-money-bills:before{content:"\e1f3"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before,.fa-money-check-dollar:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-mosquito:before{content:"\e52b"}.fa-mosquito-net:before{content:"\e52c"}.fa-motorcycle:before{content:"\f21c"}.fa-mound:before{content:"\e52d"}.fa-mountain:before{content:"\f6fc"}.fa-mountain-city:before{content:"\e52e"}.fa-mountain-sun:before{content:"\e52f"}.fa-mug-hot:before{content:"\f7b6"}.fa-coffee:before,.fa-mug-saucer:before{content:"\f0f4"}.fa-music:before{content:"\f001"}.fa-n:before{content:"\4e"}.fa-naira-sign:before{content:"\e1f6"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-not-equal:before{content:"\f53e"}.fa-notdef:before{content:"\e1fe"}.fa-note-sticky:before,.fa-sticky-note:before{content:"\f249"}.fa-notes-medical:before{content:"\f481"}.fa-o:before{content:"\4f"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-oil-can:before{content:"\f613"}.fa-oil-well:before{content:"\e532"}.fa-om:before{content:"\f679"}.fa-otter:before{content:"\f700"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-p:before{content:"\50"}.fa-pager:before{content:"\f815"}.fa-paint-roller:before{content:"\f5aa"}.fa-paint-brush:before,.fa-paintbrush:before{content:"\f1fc"}.fa-palette:before{content:"\f53f"}.fa-pallet:before{content:"\f482"}.fa-panorama:before{content:"\e209"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-passport:before{content:"\f5ab"}.fa-file-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-pause:before{content:"\f04c"}.fa-paw:before{content:"\f1b0"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before,.fa-pen-clip:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-ruler:before,.fa-pencil-ruler:before{content:"\f5ae"}.fa-edit:before,.fa-pen-to-square:before{content:"\f044"}.fa-pencil-alt:before,.fa-pencil:before{content:"\f303"}.fa-people-arrows-left-right:before,.fa-people-arrows:before{content:"\e068"}.fa-people-carry-box:before,.fa-people-carry:before{content:"\f4ce"}.fa-people-group:before{content:"\e533"}.fa-people-line:before{content:"\e534"}.fa-people-pulling:before{content:"\e535"}.fa-people-robbery:before{content:"\e536"}.fa-people-roof:before{content:"\e537"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before,.fa-percentage:before{content:"\25"}.fa-male:before,.fa-person:before{content:"\f183"}.fa-person-arrow-down-to-line:before{content:"\e538"}.fa-person-arrow-up-from-line:before{content:"\e539"}.fa-biking:before,.fa-person-biking:before{content:"\f84a"}.fa-person-booth:before{content:"\f756"}.fa-person-breastfeeding:before{content:"\e53a"}.fa-person-burst:before{content:"\e53b"}.fa-person-cane:before{content:"\e53c"}.fa-person-chalkboard:before{content:"\e53d"}.fa-person-circle-check:before{content:"\e53e"}.fa-person-circle-exclamation:before{content:"\e53f"}.fa-person-circle-minus:before{content:"\e540"}.fa-person-circle-plus:before{content:"\e541"}.fa-person-circle-question:before{content:"\e542"}.fa-person-circle-xmark:before{content:"\e543"}.fa-digging:before,.fa-person-digging:before{content:"\f85e"}.fa-diagnoses:before,.fa-person-dots-from-line:before{content:"\f470"}.fa-female:before,.fa-person-dress:before{content:"\f182"}.fa-person-dress-burst:before{content:"\e544"}.fa-person-drowning:before{content:"\e545"}.fa-person-falling:before{content:"\e546"}.fa-person-falling-burst:before{content:"\e547"}.fa-person-half-dress:before{content:"\e548"}.fa-person-harassing:before{content:"\e549"}.fa-hiking:before,.fa-person-hiking:before{content:"\f6ec"}.fa-person-military-pointing:before{content:"\e54a"}.fa-person-military-rifle:before{content:"\e54b"}.fa-person-military-to-person:before{content:"\e54c"}.fa-person-praying:before,.fa-pray:before{content:"\f683"}.fa-person-pregnant:before{content:"\e31e"}.fa-person-rays:before{content:"\e54d"}.fa-person-rifle:before{content:"\e54e"}.fa-person-running:before,.fa-running:before{content:"\f70c"}.fa-person-shelter:before{content:"\e54f"}.fa-person-skating:before,.fa-skating:before{content:"\f7c5"}.fa-person-skiing:before,.fa-skiing:before{content:"\f7c9"}.fa-person-skiing-nordic:before,.fa-skiing-nordic:before{content:"\f7ca"}.fa-person-snowboarding:before,.fa-snowboarding:before{content:"\f7ce"}.fa-person-swimming:before,.fa-swimmer:before{content:"\f5c4"}.fa-person-through-window:before{content:"\e5a9"}.fa-person-walking:before,.fa-walking:before{content:"\f554"}.fa-person-walking-arrow-loop-left:before{content:"\e551"}.fa-person-walking-arrow-right:before{content:"\e552"}.fa-person-walking-dashed-line-arrow-right:before{content:"\e553"}.fa-person-walking-luggage:before{content:"\e554"}.fa-blind:before,.fa-person-walking-with-cane:before{content:"\f29d"}.fa-peseta-sign:before{content:"\e221"}.fa-peso-sign:before{content:"\e222"}.fa-phone:before{content:"\f095"}.fa-phone-alt:before,.fa-phone-flip:before{content:"\f879"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-volume:before,.fa-volume-control-phone:before{content:"\f2a0"}.fa-photo-film:before,.fa-photo-video:before{content:"\f87c"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-circle-check:before{content:"\e555"}.fa-plane-circle-exclamation:before{content:"\e556"}.fa-plane-circle-xmark:before{content:"\e557"}.fa-plane-departure:before{content:"\f5b0"}.fa-plane-lock:before{content:"\e558"}.fa-plane-slash:before{content:"\e069"}.fa-plane-up:before{content:"\e22d"}.fa-plant-wilt:before{content:"\e5aa"}.fa-plate-wheat:before{content:"\e55a"}.fa-play:before{content:"\f04b"}.fa-plug:before{content:"\f1e6"}.fa-plug-circle-bolt:before{content:"\e55b"}.fa-plug-circle-check:before{content:"\e55c"}.fa-plug-circle-exclamation:before{content:"\e55d"}.fa-plug-circle-minus:before{content:"\e55e"}.fa-plug-circle-plus:before{content:"\e55f"}.fa-plug-circle-xmark:before{content:"\e560"}.fa-add:before,.fa-plus:before{content:"\2b"}.fa-plus-minus:before{content:"\e43c"}.fa-podcast:before{content:"\f2ce"}.fa-poo:before{content:"\f2fe"}.fa-poo-bolt:before,.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-power-off:before{content:"\f011"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before,.fa-prescription-bottle-medical:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-pump-medical:before{content:"\e06a"}.fa-pump-soap:before{content:"\e06b"}.fa-puzzle-piece:before{content:"\f12e"}.fa-q:before{content:"\51"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\3f"}.fa-quote-left-alt:before,.fa-quote-left:before{content:"\f10d"}.fa-quote-right-alt:before,.fa-quote-right:before{content:"\f10e"}.fa-r:before{content:"\52"}.fa-radiation:before{content:"\f7b9"}.fa-radio:before{content:"\f8d7"}.fa-rainbow:before{content:"\f75b"}.fa-ranking-star:before{content:"\e561"}.fa-receipt:before{content:"\f543"}.fa-record-vinyl:before{content:"\f8d9"}.fa-ad:before,.fa-rectangle-ad:before{content:"\f641"}.fa-list-alt:before,.fa-rectangle-list:before{content:"\f022"}.fa-rectangle-times:before,.fa-rectangle-xmark:before,.fa-times-rectangle:before,.fa-window-close:before{content:"\f410"}.fa-recycle:before{content:"\f1b8"}.fa-registered:before{content:"\f25d"}.fa-repeat:before{content:"\f363"}.fa-mail-reply:before,.fa-reply:before{content:"\f3e5"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-republican:before{content:"\f75e"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-ribbon:before{content:"\f4d6"}.fa-right-from-bracket:before,.fa-sign-out-alt:before{content:"\f2f5"}.fa-exchange-alt:before,.fa-right-left:before{content:"\f362"}.fa-long-arrow-alt-right:before,.fa-right-long:before{content:"\f30b"}.fa-right-to-bracket:before,.fa-sign-in-alt:before{content:"\f2f6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-road-barrier:before{content:"\e562"}.fa-road-bridge:before{content:"\e563"}.fa-road-circle-check:before{content:"\e564"}.fa-road-circle-exclamation:before{content:"\e565"}.fa-road-circle-xmark:before{content:"\e566"}.fa-road-lock:before{content:"\e567"}.fa-road-spikes:before{content:"\e568"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rotate:before,.fa-sync-alt:before{content:"\f2f1"}.fa-rotate-back:before,.fa-rotate-backward:before,.fa-rotate-left:before,.fa-undo-alt:before{content:"\f2ea"}.fa-redo-alt:before,.fa-rotate-forward:before,.fa-rotate-right:before{content:"\f2f9"}.fa-route:before{content:"\f4d7"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-rouble:before,.fa-rub:before,.fa-ruble-sign:before,.fa-ruble:before{content:"\f158"}.fa-rug:before{content:"\e569"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-rupee-sign:before,.fa-rupee:before{content:"\f156"}.fa-rupiah-sign:before{content:"\e23d"}.fa-s:before{content:"\53"}.fa-sack-dollar:before{content:"\f81d"}.fa-sack-xmark:before{content:"\e56a"}.fa-sailboat:before{content:"\e445"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-balance-scale:before,.fa-scale-balanced:before{content:"\f24e"}.fa-balance-scale-left:before,.fa-scale-unbalanced:before{content:"\f515"}.fa-balance-scale-right:before,.fa-scale-unbalanced-flip:before{content:"\f516"}.fa-school:before{content:"\f549"}.fa-school-circle-check:before{content:"\e56b"}.fa-school-circle-exclamation:before{content:"\e56c"}.fa-school-circle-xmark:before{content:"\e56d"}.fa-school-flag:before{content:"\e56e"}.fa-school-lock:before{content:"\e56f"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-screwdriver:before{content:"\f54a"}.fa-screwdriver-wrench:before,.fa-tools:before{content:"\f7d9"}.fa-scroll:before{content:"\f70e"}.fa-scroll-torah:before,.fa-torah:before{content:"\f6a0"}.fa-sd-card:before{content:"\f7c2"}.fa-section:before{content:"\e447"}.fa-seedling:before,.fa-sprout:before{content:"\f4d8"}.fa-server:before{content:"\f233"}.fa-shapes:before,.fa-triangle-circle-square:before{content:"\f61f"}.fa-arrow-turn-right:before,.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-share-from-square:before,.fa-share-square:before{content:"\f14d"}.fa-share-alt:before,.fa-share-nodes:before{content:"\f1e0"}.fa-sheet-plastic:before{content:"\e571"}.fa-ils:before,.fa-shekel-sign:before,.fa-shekel:before,.fa-sheqel-sign:before,.fa-sheqel:before{content:"\f20b"}.fa-shield-blank:before,.fa-shield:before{content:"\f132"}.fa-shield-cat:before{content:"\e572"}.fa-shield-dog:before{content:"\e573"}.fa-shield-alt:before,.fa-shield-halved:before{content:"\f3ed"}.fa-shield-heart:before{content:"\e574"}.fa-shield-virus:before{content:"\e06c"}.fa-ship:before{content:"\f21a"}.fa-shirt:before,.fa-t-shirt:before,.fa-tshirt:before{content:"\f553"}.fa-shoe-prints:before{content:"\f54b"}.fa-shop:before,.fa-store-alt:before{content:"\f54f"}.fa-shop-lock:before{content:"\e4a5"}.fa-shop-slash:before,.fa-store-alt-slash:before{content:"\e070"}.fa-shower:before{content:"\f2cc"}.fa-shrimp:before{content:"\e448"}.fa-random:before,.fa-shuffle:before{content:"\f074"}.fa-shuttle-space:before,.fa-space-shuttle:before{content:"\f197"}.fa-sign-hanging:before,.fa-sign:before{content:"\f4d9"}.fa-signal-5:before,.fa-signal-perfect:before,.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-map-signs:before,.fa-signs-post:before{content:"\f277"}.fa-sim-card:before{content:"\f7c4"}.fa-sink:before{content:"\e06d"}.fa-sitemap:before{content:"\f0e8"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before,.fa-sliders:before{content:"\f1de"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-soap:before{content:"\e06e"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-spa:before{content:"\f5bb"}.fa-pastafarianism:before,.fa-spaghetti-monster-flying:before{content:"\f67b"}.fa-spell-check:before{content:"\f891"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spoon:before,.fa-utensil-spoon:before{content:"\f2e5"}.fa-spray-can:before{content:"\f5bd"}.fa-air-freshener:before,.fa-spray-can-sparkles:before{content:"\f5d0"}.fa-square:before{content:"\f0c8"}.fa-external-link-square:before,.fa-square-arrow-up-right:before{content:"\f14c"}.fa-caret-square-down:before,.fa-square-caret-down:before{content:"\f150"}.fa-caret-square-left:before,.fa-square-caret-left:before{content:"\f191"}.fa-caret-square-right:before,.fa-square-caret-right:before{content:"\f152"}.fa-caret-square-up:before,.fa-square-caret-up:before{content:"\f151"}.fa-check-square:before,.fa-square-check:before{content:"\f14a"}.fa-envelope-square:before,.fa-square-envelope:before{content:"\f199"}.fa-square-full:before{content:"\f45c"}.fa-h-square:before,.fa-square-h:before{content:"\f0fd"}.fa-minus-square:before,.fa-square-minus:before{content:"\f146"}.fa-square-nfi:before{content:"\e576"}.fa-parking:before,.fa-square-parking:before{content:"\f540"}.fa-pen-square:before,.fa-pencil-square:before,.fa-square-pen:before{content:"\f14b"}.fa-square-person-confined:before{content:"\e577"}.fa-phone-square:before,.fa-square-phone:before{content:"\f098"}.fa-phone-square-alt:before,.fa-square-phone-flip:before{content:"\f87b"}.fa-plus-square:before,.fa-square-plus:before{content:"\f0fe"}.fa-poll-h:before,.fa-square-poll-horizontal:before{content:"\f682"}.fa-poll:before,.fa-square-poll-vertical:before{content:"\f681"}.fa-square-root-alt:before,.fa-square-root-variable:before{content:"\f698"}.fa-rss-square:before,.fa-square-rss:before{content:"\f143"}.fa-share-alt-square:before,.fa-square-share-nodes:before{content:"\f1e1"}.fa-external-link-square-alt:before,.fa-square-up-right:before{content:"\f360"}.fa-square-virus:before{content:"\e578"}.fa-square-xmark:before,.fa-times-square:before,.fa-xmark-square:before{content:"\f2d3"}.fa-rod-asclepius:before,.fa-rod-snake:before,.fa-staff-aesculapius:before,.fa-staff-snake:before{content:"\e579"}.fa-stairs:before{content:"\e289"}.fa-stamp:before{content:"\f5bf"}.fa-stapler:before{content:"\e5af"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before,.fa-star-half-stroke:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-gbp:before,.fa-pound-sign:before,.fa-sterling-sign:before{content:"\f154"}.fa-stethoscope:before{content:"\f0f1"}.fa-stop:before{content:"\f04d"}.fa-stopwatch:before{content:"\f2f2"}.fa-stopwatch-20:before{content:"\e06f"}.fa-store:before{content:"\f54e"}.fa-store-slash:before{content:"\e071"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stroopwafel:before{content:"\f551"}.fa-subscript:before{content:"\f12c"}.fa-suitcase:before{content:"\f0f2"}.fa-medkit:before,.fa-suitcase-medical:before{content:"\f0fa"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-sun-plant-wilt:before{content:"\e57a"}.fa-superscript:before{content:"\f12b"}.fa-swatchbook:before{content:"\f5c3"}.fa-synagogue:before{content:"\f69b"}.fa-syringe:before{content:"\f48e"}.fa-t:before{content:"\54"}.fa-table:before{content:"\f0ce"}.fa-table-cells:before,.fa-th:before{content:"\f00a"}.fa-table-cells-large:before,.fa-th-large:before{content:"\f009"}.fa-columns:before,.fa-table-columns:before{content:"\f0db"}.fa-table-list:before,.fa-th-list:before{content:"\f00b"}.fa-ping-pong-paddle-ball:before,.fa-table-tennis-paddle-ball:before,.fa-table-tennis:before{content:"\f45d"}.fa-tablet-android:before,.fa-tablet:before{content:"\f3fb"}.fa-tablet-button:before{content:"\f10a"}.fa-tablet-alt:before,.fa-tablet-screen-button:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-digital-tachograph:before,.fa-tachograph-digital:before{content:"\f566"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tarp:before{content:"\e57b"}.fa-tarp-droplet:before{content:"\e57c"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-temperature-arrow-down:before,.fa-temperature-down:before{content:"\e03f"}.fa-temperature-arrow-up:before,.fa-temperature-up:before{content:"\e040"}.fa-temperature-0:before,.fa-temperature-empty:before,.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-temperature-4:before,.fa-temperature-full:before,.fa-thermometer-4:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-temperature-2:before,.fa-temperature-half:before,.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-temperature-1:before,.fa-temperature-quarter:before,.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-temperature-3:before,.fa-temperature-three-quarters:before,.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-tenge-sign:before,.fa-tenge:before{content:"\f7d7"}.fa-tent:before{content:"\e57d"}.fa-tent-arrow-down-to-line:before{content:"\e57e"}.fa-tent-arrow-left-right:before{content:"\e57f"}.fa-tent-arrow-turn-left:before{content:"\e580"}.fa-tent-arrows-down:before{content:"\e581"}.fa-tents:before{content:"\e582"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-remove-format:before,.fa-text-slash:before{content:"\f87d"}.fa-text-width:before{content:"\f035"}.fa-thermometer:before{content:"\f491"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumb-tack:before,.fa-thumbtack:before{content:"\f08d"}.fa-ticket:before{content:"\f145"}.fa-ticket-alt:before,.fa-ticket-simple:before{content:"\f3ff"}.fa-timeline:before{content:"\e29c"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toilet-paper-slash:before{content:"\e072"}.fa-toilet-portable:before{content:"\e583"}.fa-toilets-portable:before{content:"\e584"}.fa-toolbox:before{content:"\f552"}.fa-tooth:before{content:"\f5c9"}.fa-torii-gate:before{content:"\f6a1"}.fa-tornado:before{content:"\f76f"}.fa-broadcast-tower:before,.fa-tower-broadcast:before{content:"\f519"}.fa-tower-cell:before{content:"\e585"}.fa-tower-observation:before{content:"\e586"}.fa-tractor:before{content:"\f722"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-trailer:before{content:"\e041"}.fa-train:before{content:"\f238"}.fa-subway:before,.fa-train-subway:before{content:"\f239"}.fa-train-tram:before{content:"\e5b4"}.fa-transgender-alt:before,.fa-transgender:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-arrow-up:before,.fa-trash-restore:before{content:"\f829"}.fa-trash-alt:before,.fa-trash-can:before{content:"\f2ed"}.fa-trash-can-arrow-up:before,.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-tree-city:before{content:"\e587"}.fa-exclamation-triangle:before,.fa-triangle-exclamation:before,.fa-warning:before{content:"\f071"}.fa-trophy:before{content:"\f091"}.fa-trowel:before{content:"\e589"}.fa-trowel-bricks:before{content:"\e58a"}.fa-truck:before{content:"\f0d1"}.fa-truck-arrow-right:before{content:"\e58b"}.fa-truck-droplet:before{content:"\e58c"}.fa-shipping-fast:before,.fa-truck-fast:before{content:"\f48b"}.fa-truck-field:before{content:"\e58d"}.fa-truck-field-un:before{content:"\e58e"}.fa-truck-front:before{content:"\e2b7"}.fa-ambulance:before,.fa-truck-medical:before{content:"\f0f9"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-truck-plane:before{content:"\e58f"}.fa-truck-loading:before,.fa-truck-ramp-box:before{content:"\f4de"}.fa-teletype:before,.fa-tty:before{content:"\f1e4"}.fa-try:before,.fa-turkish-lira-sign:before,.fa-turkish-lira:before{content:"\e2bb"}.fa-level-down-alt:before,.fa-turn-down:before{content:"\f3be"}.fa-level-up-alt:before,.fa-turn-up:before{content:"\f3bf"}.fa-television:before,.fa-tv-alt:before,.fa-tv:before{content:"\f26c"}.fa-u:before{content:"\55"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-universal-access:before{content:"\f29a"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before,.fa-unlock-keyhole:before{content:"\f13e"}.fa-arrows-alt-v:before,.fa-up-down:before{content:"\f338"}.fa-arrows-alt:before,.fa-up-down-left-right:before{content:"\f0b2"}.fa-long-arrow-alt-up:before,.fa-up-long:before{content:"\f30c"}.fa-expand-alt:before,.fa-up-right-and-down-left-from-center:before{content:"\f424"}.fa-external-link-alt:before,.fa-up-right-from-square:before{content:"\f35d"}.fa-upload:before{content:"\f093"}.fa-user:before{content:"\f007"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-clock:before{content:"\f4fd"}.fa-user-doctor:before,.fa-user-md:before{content:"\f0f0"}.fa-user-cog:before,.fa-user-gear:before{content:"\f4fe"}.fa-user-graduate:before{content:"\f501"}.fa-user-friends:before,.fa-user-group:before{content:"\f500"}.fa-user-injured:before{content:"\f728"}.fa-user-alt:before,.fa-user-large:before{content:"\f406"}.fa-user-alt-slash:before,.fa-user-large-slash:before{content:"\f4fa"}.fa-user-lock:before{content:"\f502"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-edit:before,.fa-user-pen:before{content:"\f4ff"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before,.fa-user-xmark:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-between-lines:before{content:"\e591"}.fa-users-cog:before,.fa-users-gear:before{content:"\f509"}.fa-users-line:before{content:"\e592"}.fa-users-rays:before{content:"\e593"}.fa-users-rectangle:before{content:"\e594"}.fa-users-slash:before{content:"\e073"}.fa-users-viewfinder:before{content:"\e595"}.fa-cutlery:before,.fa-utensils:before{content:"\f2e7"}.fa-v:before{content:"\56"}.fa-shuttle-van:before,.fa-van-shuttle:before{content:"\f5b6"}.fa-vault:before{content:"\e2c5"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-vest:before{content:"\e085"}.fa-vest-patches:before{content:"\e086"}.fa-vial:before{content:"\f492"}.fa-vial-circle-check:before{content:"\e596"}.fa-vial-virus:before{content:"\e597"}.fa-vials:before{content:"\f493"}.fa-video-camera:before,.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-virus:before{content:"\e074"}.fa-virus-covid:before{content:"\e4a8"}.fa-virus-covid-slash:before{content:"\e4a9"}.fa-virus-slash:before{content:"\e075"}.fa-viruses:before{content:"\e076"}.fa-voicemail:before{content:"\f897"}.fa-volcano:before{content:"\f770"}.fa-volleyball-ball:before,.fa-volleyball:before{content:"\f45f"}.fa-volume-high:before,.fa-volume-up:before{content:"\f028"}.fa-volume-down:before,.fa-volume-low:before{content:"\f027"}.fa-volume-off:before{content:"\f026"}.fa-volume-mute:before,.fa-volume-times:before,.fa-volume-xmark:before{content:"\f6a9"}.fa-vr-cardboard:before{content:"\f729"}.fa-w:before{content:"\57"}.fa-walkie-talkie:before{content:"\f8ef"}.fa-wallet:before{content:"\f555"}.fa-magic:before,.fa-wand-magic:before{content:"\f0d0"}.fa-magic-wand-sparkles:before,.fa-wand-magic-sparkles:before{content:"\e2ca"}.fa-wand-sparkles:before{content:"\f72b"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-ladder-water:before,.fa-swimming-pool:before,.fa-water-ladder:before{content:"\f5c5"}.fa-wave-square:before{content:"\f83e"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weight-scale:before,.fa-weight:before{content:"\f496"}.fa-wheat-alt:before,.fa-wheat-awn:before{content:"\e2cd"}.fa-wheat-awn-circle-exclamation:before{content:"\e598"}.fa-wheelchair:before{content:"\f193"}.fa-wheelchair-alt:before,.fa-wheelchair-move:before{content:"\e2ce"}.fa-glass-whiskey:before,.fa-whiskey-glass:before{content:"\f7a0"}.fa-wifi-3:before,.fa-wifi-strong:before,.fa-wifi:before{content:"\f1eb"}.fa-wind:before{content:"\f72e"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before,.fa-wine-glass-empty:before{content:"\f5ce"}.fa-krw:before,.fa-won-sign:before,.fa-won:before{content:"\f159"}.fa-worm:before{content:"\e599"}.fa-wrench:before{content:"\f0ad"}.fa-x:before{content:"\58"}.fa-x-ray:before{content:"\f497"}.fa-close:before,.fa-multiply:before,.fa-remove:before,.fa-times:before,.fa-xmark:before{content:"\f00d"}.fa-xmarks-lines:before{content:"\e59a"}.fa-y:before{content:"\59"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen-sign:before,.fa-yen:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-z:before{content:"\5a"}.fa-sr-only,.fa-sr-only-focusable:not(:focus),.sr-only,.sr-only-focusable:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host,:root{--fa-font-brands:normal 400 1em/1 "Font Awesome 6 Brands"}@font-face{font-family:"Font Awesome 6 Brands";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}.fa-brands,.fab{font-family:"Font Awesome 6 Brands";font-weight:400}.fa-42-group:before,.fa-innosoft:before{content:"\e080"}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-adn:before{content:"\f170"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-alipay:before{content:"\f642"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-amilia:before{content:"\f36d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-pay:before{content:"\f415"}.fa-artstation:before{content:"\f77a"}.fa-asymmetrik:before{content:"\f372"}.fa-atlassian:before{content:"\f77b"}.fa-audible:before{content:"\f373"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-aws:before{content:"\f375"}.fa-bandcamp:before{content:"\f2d5"}.fa-battle-net:before{content:"\f835"}.fa-behance:before{content:"\f1b4"}.fa-bilibili:before{content:"\e3d9"}.fa-bimobject:before{content:"\f378"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bootstrap:before{content:"\f836"}.fa-bots:before{content:"\e340"}.fa-btc:before{content:"\f15a"}.fa-buffer:before{content:"\f837"}.fa-buromobelexperte:before{content:"\f37f"}.fa-buy-n-large:before{content:"\f8a6"}.fa-buysellads:before{content:"\f20d"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-chrome:before{content:"\f268"}.fa-chromecast:before{content:"\f838"}.fa-cloudflare:before{content:"\e07d"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cmplid:before{content:"\e360"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cotton-bureau:before{content:"\f89e"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-critical-role:before{content:"\f6c9"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dailymotion:before{content:"\e052"}.fa-dashcube:before{content:"\f210"}.fa-deezer:before{content:"\e077"}.fa-delicious:before{content:"\f1a5"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dhl:before{content:"\f790"}.fa-diaspora:before{content:"\f791"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-draft2digital:before{content:"\f396"}.fa-dribbble:before{content:"\f17d"}.fa-dropbox:before{content:"\f16b"}.fa-drupal:before{content:"\f1a9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edge-legacy:before{content:"\e078"}.fa-elementor:before{content:"\f430"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envira:before{content:"\f299"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-etsy:before{content:"\f2d7"}.fa-evernote:before{content:"\f839"}.fa-expeditedssl:before{content:"\f23e"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-figma:before{content:"\f799"}.fa-firefox:before{content:"\f269"}.fa-firefox-browser:before{content:"\e007"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-fly:before{content:"\f417"}.fa-font-awesome-flag:before,.fa-font-awesome-logo-full:before,.fa-font-awesome:before{content:"\f2b4"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-fulcrum:before{content:"\f50b"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-git:before{content:"\f1d3"}.fa-git-alt:before{content:"\f841"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-gofore:before{content:"\f3a7"}.fa-golang:before{content:"\e40f"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-pay:before{content:"\e079"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-wallet:before{content:"\f1ee"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guilded:before{content:"\e07e"}.fa-gulp:before{content:"\f3ae"}.fa-hacker-news:before{content:"\f1d4"}.fa-hackerrank:before{content:"\f5f7"}.fa-hashnode:before{content:"\e499"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-hive:before{content:"\e07f"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-hotjar:before{content:"\f3b1"}.fa-houzz:before{content:"\f27c"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-ideal:before{content:"\e013"}.fa-imdb:before{content:"\f2d8"}.fa-instagram:before{content:"\f16d"}.fa-instalod:before{content:"\e081"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-itch-io:before{content:"\f83a"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joomla:before{content:"\f1aa"}.fa-js:before{content:"\f3b8"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaggle:before{content:"\f5fa"}.fa-keybase:before{content:"\f4f5"}.fa-keycdn:before{content:"\f3ba"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-korvue:before{content:"\f42f"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-leanpub:before{content:"\f212"}.fa-less:before{content:"\f41d"}.fa-line:before{content:"\f3c0"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-mailchimp:before{content:"\f59e"}.fa-mandalorian:before{content:"\f50f"}.fa-markdown:before{content:"\f60f"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-mdb:before{content:"\f8ca"}.fa-medapps:before{content:"\f3c6"}.fa-medium-m:before,.fa-medium:before{content:"\f23a"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-mendeley:before{content:"\f7b3"}.fa-meta:before{content:"\e49b"}.fa-microblog:before{content:"\e01a"}.fa-microsoft:before{content:"\f3ca"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mixer:before{content:"\e056"}.fa-mizuni:before{content:"\f3cc"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-nfc-directional:before{content:"\e530"}.fa-nfc-symbol:before{content:"\e531"}.fa-nimblr:before{content:"\f5a8"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-octopus-deploy:before{content:"\e082"}.fa-odnoklassniki:before{content:"\f263"}.fa-old-republic:before{content:"\f510"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-orcid:before{content:"\f8d2"}.fa-osi:before{content:"\f41a"}.fa-padlet:before{content:"\e4a0"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-palfed:before{content:"\f3d8"}.fa-patreon:before{content:"\f3d9"}.fa-paypal:before{content:"\f1ed"}.fa-perbyte:before{content:"\e083"}.fa-periscope:before{content:"\f3da"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pix:before{content:"\e43a"}.fa-playstation:before{content:"\f3df"}.fa-product-hunt:before{content:"\f288"}.fa-pushed:before{content:"\f3e1"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-r-project:before{content:"\f4f7"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-redhat:before{content:"\f7bc"}.fa-renren:before{content:"\f18b"}.fa-replyd:before{content:"\f3e6"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-rev:before{content:"\f5b2"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-rust:before{content:"\e07a"}.fa-safari:before{content:"\f267"}.fa-salesforce:before{content:"\f83b"}.fa-sass:before{content:"\f41e"}.fa-schlix:before{content:"\f3ea"}.fa-screenpal:before{content:"\e570"}.fa-scribd:before{content:"\f28a"}.fa-searchengin:before{content:"\f3eb"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-servicestack:before{content:"\f3ec"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shopify:before{content:"\e057"}.fa-shopware:before{content:"\f5b5"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sith:before{content:"\f512"}.fa-sitrox:before{content:"\e44a"}.fa-sketch:before{content:"\f7c6"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack-hash:before,.fa-slack:before{content:"\f198"}.fa-slideshare:before{content:"\f1e7"}.fa-snapchat-ghost:before,.fa-snapchat:before{content:"\f2ab"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-space-awesome:before{content:"\e5ac"}.fa-speakap:before{content:"\f3f3"}.fa-speaker-deck:before{content:"\f83c"}.fa-spotify:before{content:"\f1bc"}.fa-behance-square:before,.fa-square-behance:before{content:"\f1b5"}.fa-dribbble-square:before,.fa-square-dribbble:before{content:"\f397"}.fa-facebook-square:before,.fa-square-facebook:before{content:"\f082"}.fa-square-font-awesome:before{content:"\e5ad"}.fa-font-awesome-alt:before,.fa-square-font-awesome-stroke:before{content:"\f35c"}.fa-git-square:before,.fa-square-git:before{content:"\f1d2"}.fa-github-square:before,.fa-square-github:before{content:"\f092"}.fa-gitlab-square:before,.fa-square-gitlab:before{content:"\e5ae"}.fa-google-plus-square:before,.fa-square-google-plus:before{content:"\f0d4"}.fa-hacker-news-square:before,.fa-square-hacker-news:before{content:"\f3af"}.fa-instagram-square:before,.fa-square-instagram:before{content:"\e055"}.fa-js-square:before,.fa-square-js:before{content:"\f3b9"}.fa-lastfm-square:before,.fa-square-lastfm:before{content:"\f203"}.fa-odnoklassniki-square:before,.fa-square-odnoklassniki:before{content:"\f264"}.fa-pied-piper-square:before,.fa-square-pied-piper:before{content:"\e01e"}.fa-pinterest-square:before,.fa-square-pinterest:before{content:"\f0d3"}.fa-reddit-square:before,.fa-square-reddit:before{content:"\f1a2"}.fa-snapchat-square:before,.fa-square-snapchat:before{content:"\f2ad"}.fa-square-steam:before,.fa-steam-square:before{content:"\f1b7"}.fa-square-tumblr:before,.fa-tumblr-square:before{content:"\f174"}.fa-square-twitter:before,.fa-twitter-square:before{content:"\f081"}.fa-square-viadeo:before,.fa-viadeo-square:before{content:"\f2aa"}.fa-square-vimeo:before,.fa-vimeo-square:before{content:"\f194"}.fa-square-whatsapp:before,.fa-whatsapp-square:before{content:"\f40c"}.fa-square-xing:before,.fa-xing-square:before{content:"\f169"}.fa-square-youtube:before,.fa-youtube-square:before{content:"\f431"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stackpath:before{content:"\f842"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-symbol:before{content:"\f3f6"}.fa-sticker-mule:before{content:"\f3f7"}.fa-strava:before{content:"\f428"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-superpowers:before{content:"\f2dd"}.fa-supple:before{content:"\f3f9"}.fa-suse:before{content:"\f7d6"}.fa-swift:before{content:"\f8e1"}.fa-symfony:before{content:"\f83d"}.fa-teamspeak:before{content:"\f4f9"}.fa-telegram-plane:before,.fa-telegram:before{content:"\f2c6"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-the-red-yeti:before{content:"\f69d"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-think-peaks:before{content:"\f731"}.fa-tiktok:before{content:"\e07b"}.fa-trade-federation:before{content:"\f513"}.fa-trello:before{content:"\f181"}.fa-tumblr:before{content:"\f173"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbraco:before{content:"\f8e8"}.fa-uncharted:before{content:"\e084"}.fa-uniregistry:before{content:"\f404"}.fa-unity:before{content:"\e049"}.fa-unsplash:before{content:"\e07c"}.fa-untappd:before{content:"\f405"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-vaadin:before{content:"\f408"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viber:before{content:"\f409"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-vuejs:before{content:"\f41f"}.fa-watchman-monitoring:before{content:"\e087"}.fa-waze:before{content:"\f83f"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whmcs:before{content:"\f40d"}.fa-wikipedia-w:before{content:"\f266"}.fa-windows:before{content:"\f17a"}.fa-wirsindhandwerk:before,.fa-wsh:before{content:"\e2d0"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wodu:before{content:"\e088"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-rendact:before,.fa-wpressr:before{content:"\f3e4"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yammer:before{content:"\f840"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-zhihu:before{content:"\f63f"}:host,:root{--fa-font-regular:normal 400 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype")}.fa-regular,.far{font-family:"Font Awesome 6 Free";font-weight:400}:host,:root{--fa-font-solid:normal 900 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:900;font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}.fa-solid,.fas{font-family:"Font Awesome 6 Free";font-weight:900}@font-face{font-family:"Font Awesome 5 Brands";font-display:block;font-weight:400;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:900;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:400;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.ttf) format("truetype")}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.ttf) format("truetype");unicode-range:u+f003,u+f006,u+f014,u+f016-f017,u+f01a-f01b,u+f01d,u+f022,u+f03e,u+f044,u+f046,u+f05c-f05d,u+f06e,u+f070,u+f087-f088,u+f08a,u+f094,u+f096-f097,u+f09d,u+f0a0,u+f0a2,u+f0a4-f0a7,u+f0c5,u+f0c7,u+f0e5-f0e6,u+f0eb,u+f0f6-f0f8,u+f10c,u+f114-f115,u+f118-f11a,u+f11c-f11d,u+f133,u+f147,u+f14e,u+f150-f152,u+f185-f186,u+f18e,u+f190-f192,u+f196,u+f1c1-f1c9,u+f1d9,u+f1db,u+f1e3,u+f1ea,u+f1f7,u+f1f9,u+f20a,u+f247-f248,u+f24a,u+f24d,u+f255-f25b,u+f25d,u+f271-f274,u+f278,u+f27b,u+f28c,u+f28e,u+f29c,u+f2b5,u+f2b7,u+f2ba,u+f2bc,u+f2be,u+f2c0-f2c1,u+f2c3,u+f2d0,u+f2d2,u+f2d4,u+f2dc}@font-face{font-family:"FontAwesome";font-display:block;src:url(../webfonts/fa-v4compatibility.woff2) format("woff2"),url(../webfonts/fa-v4compatibility.ttf) format("truetype");unicode-range:u+f041,u+f047,u+f065-f066,u+f07d-f07e,u+f080,u+f08b,u+f08e,u+f090,u+f09a,u+f0ac,u+f0ae,u+f0b2,u+f0d0,u+f0d6,u+f0e4,u+f0ec,u+f10a-f10b,u+f123,u+f13e,u+f148-f149,u+f14c,u+f156,u+f15e,u+f160-f161,u+f163,u+f175-f178,u+f195,u+f1f8,u+f219,u+f27a} \ No newline at end of file diff --git a/connector-miravia/lib/fontawesome-6.1.2.all.min.js b/connector-miravia/lib/fontawesome-6.1.2.all.min.js new file mode 100644 index 0000000..5997889 --- /dev/null +++ b/connector-miravia/lib/fontawesome-6.1.2.all.min.js @@ -0,0 +1,6 @@ +/*! + * Font Awesome Free 6.1.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2022 Fonticons, Inc. + */ +!function(){"use strict";var C={},c={};try{"undefined"!=typeof window&&(C=window),"undefined"!=typeof document&&(c=document)}catch(C){}var z=(C.navigator||{}).userAgent,l=void 0===z?"":z,e=C,a=c;e.document,a.documentElement&&a.head&&"function"==typeof a.addEventListener&&a.createElement,~l.indexOf("MSIE")||l.indexOf("Trident/");function M(c,C){var z,l=Object.keys(c);return Object.getOwnPropertySymbols&&(z=Object.getOwnPropertySymbols(c),C&&(z=z.filter(function(C){return Object.getOwnPropertyDescriptor(c,C).enumerable})),l.push.apply(l,z)),l}function L(l){for(var C=1;CC.length)&&(c=C.length);for(var z=0,l=new Array(c);zC.length)&&(c=C.length);for(var z=0,l=new Array(c);zC.length)&&(c=C.length);for(var z=0,l=new Array(c);zC.length)&&(c=C.length);for(var z=0,l=new Array(c);z>>0;z--;)c[z]=C[z];return c}function J(C){return C.classList?$(C.classList):(C.getAttribute("class")||"").split(" ").filter(function(C){return C})}function Z(C){return"".concat(C).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function C1(z){return Object.keys(z||{}).reduce(function(C,c){return C+"".concat(c,": ").concat(z[c].trim(),";")},"")}function c1(C){return C.size!==Q.size||C.x!==Q.x||C.y!==Q.y||C.rotate!==Q.rotate||C.flipX||C.flipY}function z1(){var C,c,z=p,l=U.familyPrefix,e=U.replacementClass,a=':host,:root{--fa-font-solid:normal 900 1em/1 "Font Awesome 6 Solid";--fa-font-regular:normal 400 1em/1 "Font Awesome 6 Regular";--fa-font-light:normal 300 1em/1 "Font Awesome 6 Light";--fa-font-thin:normal 100 1em/1 "Font Awesome 6 Thin";--fa-font-duotone:normal 900 1em/1 "Font Awesome 6 Duotone";--fa-font-brands:normal 400 1em/1 "Font Awesome 6 Brands"}svg:not(:host).svg-inline--fa,svg:not(:root).svg-inline--fa{overflow:visible;box-sizing:content-box}.svg-inline--fa{display:var(--fa-display,inline-block);height:1em;overflow:visible;vertical-align:-.125em}.svg-inline--fa.fa-2xs{vertical-align:.1em}.svg-inline--fa.fa-xs{vertical-align:0}.svg-inline--fa.fa-sm{vertical-align:-.0714285705em}.svg-inline--fa.fa-lg{vertical-align:-.2em}.svg-inline--fa.fa-xl{vertical-align:-.25em}.svg-inline--fa.fa-2xl{vertical-align:-.3125em}.svg-inline--fa.fa-pull-left{margin-right:var(--fa-pull-margin,.3em);width:auto}.svg-inline--fa.fa-pull-right{margin-left:var(--fa-pull-margin,.3em);width:auto}.svg-inline--fa.fa-li{width:var(--fa-li-width,2em);top:.25em}.svg-inline--fa.fa-fw{width:var(--fa-fw-width,1.25em)}.fa-layers svg.svg-inline--fa{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.fa-layers-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.fa-layers{display:inline-block;height:1em;position:relative;text-align:center;vertical-align:-.125em;width:1em}.fa-layers svg.svg-inline--fa{-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-text{left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter{background-color:var(--fa-counter-background-color,#ff253a);border-radius:var(--fa-counter-border-radius,1em);box-sizing:border-box;color:var(--fa-inverse,#fff);line-height:var(--fa-counter-line-height,1);max-width:var(--fa-counter-max-width,5em);min-width:var(--fa-counter-min-width,1.5em);overflow:hidden;padding:var(--fa-counter-padding,.25em .5em);right:var(--fa-right,0);text-overflow:ellipsis;top:var(--fa-top,0);-webkit-transform:scale(var(--fa-counter-scale,.25));transform:scale(var(--fa-counter-scale,.25));-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-bottom-right{bottom:var(--fa-bottom,0);right:var(--fa-right,0);top:auto;-webkit-transform:scale(var(--fa-layers-scale,.25));transform:scale(var(--fa-layers-scale,.25));-webkit-transform-origin:bottom right;transform-origin:bottom right}.fa-layers-bottom-left{bottom:var(--fa-bottom,0);left:var(--fa-left,0);right:auto;top:auto;-webkit-transform:scale(var(--fa-layers-scale,.25));transform:scale(var(--fa-layers-scale,.25));-webkit-transform-origin:bottom left;transform-origin:bottom left}.fa-layers-top-right{top:var(--fa-top,0);right:var(--fa-right,0);-webkit-transform:scale(var(--fa-layers-scale,.25));transform:scale(var(--fa-layers-scale,.25));-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-top-left{left:var(--fa-left,0);right:auto;top:var(--fa-top,0);-webkit-transform:scale(var(--fa-layers-scale,.25));transform:scale(var(--fa-layers-scale,.25));-webkit-transform-origin:top left;transform-origin:top left}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.0833333337em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.0714285718em;vertical-align:.0535714295em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.0416666682em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin,2.5em);padding-left:0}.fa-ul>li{position:relative}.fa-li{left:calc(var(--fa-li-width,2em) * -1);position:absolute;text-align:center;width:var(--fa-li-width,2em);line-height:inherit}.fa-border{border-color:var(--fa-border-color,#eee);border-radius:var(--fa-border-radius,.1em);border-style:var(--fa-border-style,solid);border-width:var(--fa-border-width,.08em);padding:var(--fa-border-padding,.2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin,.3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin,.3em)}.fa-beat{-webkit-animation-name:fa-beat;animation-name:fa-beat;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-bounce{-webkit-animation-name:fa-bounce;animation-name:fa-bounce;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1))}.fa-fade{-webkit-animation-name:fa-fade;animation-name:fa-fade;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-beat-fade{-webkit-animation-name:fa-beat-fade;animation-name:fa-beat-fade;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-flip{-webkit-animation-name:fa-flip;animation-name:fa-flip;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-shake{-webkit-animation-name:fa-shake;animation-name:fa-shake;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-delay:var(--fa-animation-delay,0);animation-delay:var(--fa-animation-delay,0);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,2s);animation-duration:var(--fa-animation-duration,2s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin-reverse{--fa-animation-direction:reverse}.fa-pulse,.fa-spin-pulse{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,steps(8));animation-timing-function:var(--fa-animation-timing,steps(8))}@media (prefers-reduced-motion:reduce){.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{-webkit-animation-delay:-1ms;animation-delay:-1ms;-webkit-animation-duration:1ms;animation-duration:1ms;-webkit-animation-iteration-count:1;animation-iteration-count:1;transition-delay:0s;transition-duration:0s}}@-webkit-keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@-webkit-keyframes fa-bounce{0%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1,1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1,1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}100%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}}@keyframes fa-bounce{0%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1,1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1,1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}100%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0)}}@-webkit-keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@-webkit-keyframes fa-beat-fade{0%,100%{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@keyframes fa-beat-fade{0%,100%{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@-webkit-keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@-webkit-keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}24%,8%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}100%,40%{-webkit-transform:rotate(0);transform:rotate(0)}}@keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}24%,8%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}100%,40%{-webkit-transform:rotate(0);transform:rotate(0)}}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}.fa-rotate-by{-webkit-transform:rotate(var(--fa-rotate-angle,none));transform:rotate(var(--fa-rotate-angle,none))}.fa-stack{display:inline-block;vertical-align:middle;height:2em;position:relative;width:2.5em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;z-index:var(--fa-stack-z-index,auto)}.svg-inline--fa.fa-stack-1x{height:1em;width:1.25em}.svg-inline--fa.fa-stack-2x{height:2em;width:2.5em}.fa-inverse{color:var(--fa-inverse,#fff)}.fa-sr-only,.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fa-sr-only-focusable:not(:focus),.sr-only-focusable:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.svg-inline--fa .fa-primary{fill:var(--fa-primary-color,currentColor);opacity:var(--fa-primary-opacity,1)}.svg-inline--fa .fa-secondary{fill:var(--fa-secondary-color,currentColor);opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-primary{opacity:var(--fa-secondary-opacity,.4)}.svg-inline--fa.fa-swap-opacity .fa-secondary{opacity:var(--fa-primary-opacity,1)}.svg-inline--fa mask .fa-primary,.svg-inline--fa mask .fa-secondary{fill:#000}.fa-duotone.fa-inverse,.fad.fa-inverse{color:var(--fa-inverse,#fff)}';return"fa"===l&&e===z||(C=new RegExp("\\.".concat("fa","\\-"),"g"),c=new RegExp("\\--".concat("fa","\\-"),"g"),z=new RegExp("\\.".concat(z),"g"),a=a.replace(C,".".concat(l,"-")).replace(c,"--".concat(l,"-")).replace(z,".".concat(e))),a}var l1=!1;function e1(){U.autoAddCss&&!l1&&(function(C){if(C&&o){var c=v.createElement("style");c.setAttribute("type","text/css"),c.innerHTML=C;for(var z=v.head.childNodes,l=null,e=z.length-1;-1").concat(l.map(t1).join(""),"")}function r1(C,c,z){if(C&&C[c]&&C[c][z])return{prefix:c,iconName:z,icon:C[c][z]}}o&&((V1=(v.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(v.readyState))||v.addEventListener("DOMContentLoaded",a1));function s1(C,c,z,l){for(var e,a,M=Object.keys(C),L=M.length,V=void 0!==l?h1(c,l):c,H=void 0===z?(e=1,C[M[0]]):(e=0,z);e.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--group{padding:0}.select2-container--default .select2-results__option--disabled{color:#999}.select2-container--default .select2-results__option--selected{background-color:#ddd}.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;height:26px;margin-right:20px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0;padding-bottom:5px;padding-right:5px}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;display:inline-block;margin-left:5px;margin-top:5px;padding:0}.select2-container--classic .select2-selection--multiple .select2-selection__choice__display{cursor:default;padding-left:2px;padding-right:5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{background-color:transparent;border:none;border-top-left-radius:4px;border-bottom-left-radius:4px;color:#888;cursor:pointer;font-size:1em;font-weight:bold;padding:0 4px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555;outline:none}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__display{padding-left:5px;padding-right:2px}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:4px;border-bottom-right-radius:4px}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option--group{padding:0}.select2-container--classic .select2-results__option--disabled{color:grey}.select2-container--classic .select2-results__option--highlighted.select2-results__option--selectable{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} diff --git a/connector-miravia/lib/select2.min.js b/connector-miravia/lib/select2.min.js new file mode 100644 index 0000000..cc9a83f --- /dev/null +++ b/connector-miravia/lib/select2.min.js @@ -0,0 +1,2 @@ +/*! Select2 4.1.0-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */ +!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(t){var e,n,s,p,r,o,h,f,g,m,y,v,i,a,_,s=((u=t&&t.fn&&t.fn.select2&&t.fn.select2.amd?t.fn.select2.amd:u)&&u.requirejs||(u?n=u:u={},g={},m={},y={},v={},i=Object.prototype.hasOwnProperty,a=[].slice,_=/\.js$/,h=function(e,t){var n,s,i=c(e),r=i[0],t=t[1];return e=i[1],r&&(n=x(r=l(r,t))),r?e=n&&n.normalize?n.normalize(e,(s=t,function(e){return l(e,s)})):l(e,t):(r=(i=c(e=l(e,t)))[0],e=i[1],r&&(n=x(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},f={require:function(e){return w(e)},exports:function(e){var t=g[e];return void 0!==t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},r=function(e,t,n,s){var i,r,o,a,l,c=[],u=typeof n,d=A(s=s||e);if("undefined"==u||"function"==u){for(t=!t.length&&n.length?["require","exports","module"]:t,a=0;a":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},s.__cache={};var n=0;return s.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null!=t||(t=e.id?"select2-data-"+e.id:"select2-data-"+(++n).toString()+"-"+s.generateChars(4),e.setAttribute("data-select2-id",t)),t},s.StoreData=function(e,t,n){e=s.GetUniqueElementId(e);s.__cache[e]||(s.__cache[e]={}),s.__cache[e][t]=n},s.GetData=function(e,t){var n=s.GetUniqueElementId(e);return t?s.__cache[n]&&null!=s.__cache[n][t]?s.__cache[n][t]:r(e).data(t):s.__cache[n]},s.RemoveData=function(e){var t=s.GetUniqueElementId(e);null!=s.__cache[t]&&delete s.__cache[t],e.removeAttribute("data-select2-id")},s.copyNonInternalCssClasses=function(e,t){var n=(n=e.getAttribute("class").trim().split(/\s+/)).filter(function(e){return 0===e.indexOf("select2-")}),t=(t=t.getAttribute("class").trim().split(/\s+/)).filter(function(e){return 0!==e.indexOf("select2-")}),t=n.concat(t);e.setAttribute("class",t.join(" "))},s}),u.define("select2/results",["jquery","./utils"],function(d,p){function s(e,t,n){this.$element=e,this.data=n,this.options=t,s.__super__.constructor.call(this)}return p.Extend(s,p.Observable),s.prototype.render=function(){var e=d('
      ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},s.prototype.clear=function(){this.$results.empty()},s.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=d(''),s=this.options.get("translations").get(e.message);n.append(t(s(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},s.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},s.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested",role:"none"});i.append(l),o.append(a),o.append(i)}else this.template(e,t);return p.StoreData(t,"data",e),t},s.prototype.bind=function(t,e){var i=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}),t.on("select",function(){t.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e,t=i.getHighlightedResults();0!==t.length&&(e=p.GetData(t[0],"data"),t.hasClass("select2-results__option--selected")?i.trigger("close",{}):i.trigger("select",{data:e}))}),t.on("results:previous",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(".select2-results__option--selectable"),s=n.index(t);s<=0||(e=s-1,0===t.length&&(e=0),(s=n.eq(e)).trigger("mouseenter"),t=i.$results.offset().top,n=s.offset().top,s=i.$results.scrollTop()+(n-t),0===e?i.$results.scrollTop(0):n-t<0&&i.$results.scrollTop(s))}),t.on("results:next",function(){var e,t=i.getHighlightedResults(),n=i.$results.find(".select2-results__option--selectable"),s=n.index(t)+1;s>=n.length||((e=n.eq(s)).trigger("mouseenter"),t=i.$results.offset().top+i.$results.outerHeight(!1),n=e.offset().top+e.outerHeight(!1),e=i.$results.scrollTop()+n-t,0===s?i.$results.scrollTop(0):tthis.$results.outerHeight()||s<0)&&this.$results.scrollTop(n))},s.prototype.template=function(e,t){var n=this.options.get("templateResult"),s=this.options.get("escapeMarkup"),e=n(e,t);null==e?t.style.display="none":"string"==typeof e?t.innerHTML=s(e):d(t).append(e)},s}),u.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),u.define("select2/selection/base",["jquery","../utils","../keys"],function(n,s,i){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return s.Extend(r,s.Observable),r.prototype.render=function(){var e=n('');return this._tabindex=0,null!=s.GetData(this.$element[0],"old-tabindex")?this._tabindex=s.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},r.prototype.bind=function(e,t){var n=this,s=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",s),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},r.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},r.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&s.GetData(this,"element").select2("close")})})},r.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},r.prototype.position=function(e,t){t.find(".selection").append(e)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},r.prototype.isEnabled=function(){return!this.isDisabled()},r.prototype.isDisabled=function(){return this.options.get("disabled")},r}),u.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,s){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e[0].classList.add("select2-selection--single"),e.html(''),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var s=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",s).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",s),this.$selection.attr("aria-controls",s),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("")},i.prototype.update=function(e){var t,n;0!==e.length?(n=e[0],t=this.$selection.find(".select2-selection__rendered"),e=this.display(n,t),t.empty().append(e),(n=n.title||n.text)?t.attr("title",n):t.removeAttr("title")):this.clear()},i}),u.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,c){function r(e,t){r.__super__.constructor.apply(this,arguments)}return c.Extend(r,e),r.prototype.render=function(){var e=r.__super__.render.call(this);return e[0].classList.add("select2-selection--multiple"),e.html('
        '),e},r.prototype.bind=function(e,t){var n=this;r.__super__.bind.apply(this,arguments);var s=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",s),this.$selection.on("click",function(e){n.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){var t;n.isDisabled()||(t=i(this).parent(),t=c.GetData(t[0],"data"),n.trigger("unselect",{originalEvent:e,data:t}))}),this.$selection.on("keydown",".select2-selection__choice__remove",function(e){n.isDisabled()||e.stopPropagation()})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return i('
      • ')},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=this.$selection.find(".select2-selection__rendered").attr("id")+"-choice-",s=0;s')).attr("title",s()),e.attr("aria-label",s()),e.attr("aria-describedby",n),a.StoreData(e[0],"data",t),this.$selection.prepend(e),this.$selection[0].classList.add("select2-selection--clearable"))},e}),u.define("select2/selection/search",["jquery","../utils","../keys"],function(s,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=this.options.get("translations").get("search"),n=s('');this.$searchContainer=n,this.$search=n.find("textarea"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",t());e=e.call(this);return this._transferTabIndex(),e.append(this.$searchContainer),e},e.prototype.bind=function(e,t,n){var s=this,i=t.id+"-results",r=t.id+"-container";e.call(this,t,n),s.$search.attr("aria-describedby",r),t.on("open",function(){s.$search.attr("aria-controls",i),s.$search.trigger("focus")}),t.on("close",function(){s.$search.val(""),s.resizeSearch(),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.trigger("focus")}),t.on("enable",function(){s.$search.prop("disabled",!1),s._transferTabIndex()}),t.on("disable",function(){s.$search.prop("disabled",!0)}),t.on("focus",function(e){s.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){s.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){s._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){var t;e.stopPropagation(),s.trigger("keypress",e),s._keyUpPrevented=e.isDefaultPrevented(),e.which!==l.BACKSPACE||""!==s.$search.val()||0<(t=s.$selection.find(".select2-selection__choice").last()).length&&(t=a.GetData(t[0],"data"),s.searchRemoveChoice(t),e.preventDefault())}),this.$selection.on("click",".select2-search--inline",function(e){s.$search.val()&&e.stopPropagation()});var t=document.documentMode,o=t&&t<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){o?s.$selection.off("input.search input.searchcheck"):s.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){var t;o&&"input"===e.type?s.$selection.off("input.search input.searchcheck"):(t=e.which)!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&s.handleSearch(e)})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){var e;this.resizeSearch(),this._keyUpPrevented||(e=this.$search.val(),this.trigger("query",{term:e})),this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="100%";""===this.$search.attr("placeholder")&&(e=.75*(this.$search.val().length+1)+"em"),this.$search.css("width",e)},e}),u.define("select2/selection/selectionCss",["../utils"],function(n){function e(){}return e.prototype.render=function(e){var t=e.call(this),e=this.options.get("selectionCssClass")||"";return-1!==e.indexOf(":all:")&&(e=e.replace(":all:",""),n.copyNonInternalCssClasses(t[0],this.$element[0])),t.addClass(e),t},e}),u.define("select2/selection/eventRelay",["jquery"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var s=this,i=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],r=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){var n;-1!==i.indexOf(e)&&(t=t||{},n=o.Event("select2:"+e,{params:t}),s.$element.trigger(n),-1!==r.indexOf(e)&&(t.prevented=n.isDefaultPrevented()))})},e}),u.define("select2/translation",["jquery","require"],function(t,n){function s(e){this.dict=e||{}}return s.prototype.all=function(){return this.dict},s.prototype.get=function(e){return this.dict[e]},s.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},s._cache={},s.loadPath=function(e){var t;return e in s._cache||(t=n(e),s._cache[e]=t),new s(s._cache[e])},s}),u.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),u.define("select2/data/base",["../utils"],function(n){function s(e,t){s.__super__.constructor.call(this)}return n.Extend(s,n.Observable),s.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},s.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},s.prototype.bind=function(e,t){},s.prototype.destroy=function(){},s.prototype.generateResultId=function(e,t){e=e.id+"-result-";return e+=n.generateChars(4),null!=t.id?e+="-"+t.id.toString():e+="-"+n.generateChars(4),e},s}),u.define("select2/data/select",["./base","../utils","jquery"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var t=this;e(Array.prototype.map.call(this.$element[0].querySelectorAll(":checked"),function(e){return t.item(l(e))}))},n.prototype.select=function(i){var e,r=this;if(i.selected=!0,null!=i.element&&"option"===i.element.tagName.toLowerCase())return i.element.selected=!0,void this.$element.trigger("input").trigger("change");this.$element.prop("multiple")?this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;nthis.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),u.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("select",function(){s._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var s=this;this._checkIfMaximumSelected(function(){e.call(s,t,n)})},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current(function(e){e=null!=e?e.length:0;0=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t&&t()})},e}),u.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),u.define("select2/dropdown/search",["jquery"],function(r){function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("translations").get("search"),e=r('');return this.$searchContainer=e,this.$search=e.find("input"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",n()),t.prepend(e),t},e.prototype.bind=function(e,t,n){var s=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){s.trigger("keypress",e),s._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){r(this).off("keyup")}),this.$search.on("keyup input",function(e){s.handleSearch(e)}),t.on("open",function(){s.$search.attr("tabindex",0),s.$search.attr("aria-controls",i),s.$search.trigger("focus"),window.setTimeout(function(){s.$search.trigger("focus")},0)}),t.on("close",function(){s.$search.attr("tabindex",-1),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.val(""),s.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||s.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(s.showSearch(e)?s.$searchContainer[0].classList.remove("select2-search--hide"):s.$searchContainer[0].classList.add("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")})},e.prototype.handleSearch=function(e){var t;this._keyUpPrevented||(t=this.$search.val(),this.trigger("query",{term:t})),this._keyUpPrevented=!1},e.prototype.showSearch=function(e,t){return!0},e}),u.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,s){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,s)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return t="string"==typeof t?{id:"",text:t}:t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),s=t.length-1;0<=s;s--){var i=t[s];this.placeholder.id===i.id&&n.splice(s,1)}return n},e}),u.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,s){this.lastParams={},e.call(this,t,n,s),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("query",function(e){s.lastParams=e,s.loading=!0}),t.on("query:append",function(e){s.lastParams=e,s.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&e&&(e=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=e+50&&this.loadMore())},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
      • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),u.define("select2/dropdown/attachBody",["jquery","../utils"],function(u,o){function e(e,t,n){this.$dropdownParent=u(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var s=this;e.call(this,t,n),t.on("open",function(){s._showDropdown(),s._attachPositioningHandler(t),s._bindContainerResultHandlers(t)}),t.on("close",function(){s._hideDropdown(),s._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t[0].classList.remove("select2"),t[0].classList.add("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=u(""),e=e.call(this);return t.append(e),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){var n;this._containerResultsHandlersBound||(n=this,t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0)},e.prototype._attachPositioningHandler=function(e,t){var n=this,s="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id,t=this.$container.parents().filter(o.hasScroll);t.each(function(){o.StoreData(this,"select2-scroll-position",{x:u(this).scrollLeft(),y:u(this).scrollTop()})}),t.on(s,function(e){var t=o.GetData(this,"select2-scroll-position");u(this).scrollTop(t.y)}),u(window).on(s+" "+i+" "+r,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,s="resize.select2."+t.id,t="orientationchange.select2."+t.id;this.$container.parents().filter(o.hasScroll).off(n),u(window).off(n+" "+s+" "+t)},e.prototype._positionDropdown=function(){var e=u(window),t=this.$dropdown[0].classList.contains("select2-dropdown--above"),n=this.$dropdown[0].classList.contains("select2-dropdown--below"),s=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=i.top,r.bottom=i.top+r.height;var o=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ai.bottom+o,a={left:i.left,top:r.bottom},l=this.$dropdownParent;"static"===l.css("position")&&(l=l.offsetParent());i={top:0,left:0};(u.contains(document.body,l[0])||l[0].isConnected)&&(i=l.offset()),a.top-=i.top,a.left-=i.left,t||n||(s="below"),e||!c||t?!c&&e&&t&&(s="below"):s="above",("above"==s||t&&"below"!==s)&&(a.top=r.top-i.top-o),null!=s&&(this.$dropdown[0].classList.remove("select2-dropdown--below"),this.$dropdown[0].classList.remove("select2-dropdown--above"),this.$dropdown[0].classList.add("select2-dropdown--"+s),this.$container[0].classList.remove("select2-container--below"),this.$container[0].classList.remove("select2-container--above"),this.$container[0].classList.add("select2-container--"+s)),this.$dropdownContainer.css(a)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),u.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,s){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,s)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,s=0;s');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container[0].classList.add("select2-container--"+this.options.get("theme")),r.StoreData(e[0],"element",this.$element),e},o}),u.define("jquery-mousewheel",["jquery"],function(e){return e}),u.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,r,t,o){var a;return null==i.fn.select2&&(a=["open","close","destroy"],i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new r(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=o.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,s)}),-1new Promise((n=>{if(!t)return n();const o=window.scrollX,i=window.scrollY;e.restoreFocusTimeout=setTimeout((()=>{e.previousActiveElement instanceof HTMLElement?(e.previousActiveElement.focus(),e.previousActiveElement=null):document.body&&document.body.focus(),n()}),100),window.scrollTo(o,i)}));var n={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const o="swal2-",i=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce(((e,t)=>(e[t]=o+t,e)),{}),s=["success","warning","info","question","error"].reduce(((e,t)=>(e[t]=o+t,e)),{}),r="SweetAlert2:",a=e=>e.charAt(0).toUpperCase()+e.slice(1),l=e=>{console.warn(`${r} ${"object"==typeof e?e.join(" "):e}`)},c=e=>{console.error(`${r} ${e}`)},u=[],d=(e,t)=>{var n;n=`"${e}" is deprecated and will be removed in the next major release. Please use "${t}" instead.`,u.includes(n)||(u.push(n),l(n))},p=e=>"function"==typeof e?e():e,m=e=>e&&"function"==typeof e.toPromise,g=e=>m(e)?e.toPromise():Promise.resolve(e),h=e=>e&&Promise.resolve(e)===e,f=()=>document.body.querySelector(`.${i.container}`),b=e=>{const t=f();return t?t.querySelector(e):null},y=e=>b(`.${e}`),w=()=>y(i.popup),v=()=>y(i.icon),C=()=>y(i.title),A=()=>y(i["html-container"]),k=()=>y(i.image),B=()=>y(i["progress-steps"]),$=()=>y(i["validation-message"]),E=()=>b(`.${i.actions} .${i.confirm}`),x=()=>b(`.${i.actions} .${i.cancel}`),P=()=>b(`.${i.actions} .${i.deny}`),T=()=>b(`.${i.loader}`),L=()=>y(i.actions),S=()=>y(i.footer),O=()=>y(i["timer-progress-bar"]),M=()=>y(i.close),j=()=>{const e=w();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),o=parseInt(t.getAttribute("tabindex")||"0");return n>o?1:n"-1"!==e.getAttribute("tabindex")));return[...new Set(n.concat(i))].filter((e=>X(e)))},I=()=>q(document.body,i.shown)&&!q(document.body,i["toast-shown"])&&!q(document.body,i["no-backdrop"]),H=()=>{const e=w();return!!e&&q(e,i.toast)},D=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),o=n.querySelector("head");o&&Array.from(o.childNodes).forEach((t=>{e.appendChild(t)}));const i=n.querySelector("body");i&&Array.from(i.childNodes).forEach((t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)}))}},q=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t{if(((e,t)=>{Array.from(e.classList).forEach((n=>{Object.values(i).includes(n)||Object.values(s).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)}))})(e,t),t.customClass&&t.customClass[n]){if("string"!=typeof t.customClass[n]&&!t.customClass[n].forEach)return void l(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof t.customClass[n]}"`);R(e,t.customClass[n])}},N=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${i.popup} > .${i[t]}`);case"checkbox":return e.querySelector(`.${i.popup} > .${i.checkbox} input`);case"radio":return e.querySelector(`.${i.popup} > .${i.radio} input:checked`)||e.querySelector(`.${i.popup} > .${i.radio} input:first-child`);case"range":return e.querySelector(`.${i.popup} > .${i.range} input`);default:return e.querySelector(`.${i.popup} > .${i.input}`)}},F=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},_=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},R=(e,t)=>{_(e,t,!0)},U=(e,t)=>{_(e,t,!1)},z=(e,t)=>{const n=Array.from(e.children);for(let e=0;e{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style[t]="number"==typeof n?`${n}px`:n:e.style.removeProperty(t)},K=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},Y=e=>{e&&(e.style.display="none")},Z=(e,t,n,o)=>{const i=e.querySelector(t);i&&(i.style[n]=o)},J=function(e,t){t?K(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):Y(e)},X=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),G=e=>!!(e.scrollHeight>e.clientHeight),Q=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),o=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||o>0},ee=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=O();n&&X(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"}),10))},te=()=>"undefined"==typeof window||"undefined"==typeof document,ne=`\n
        \n \n
          \n
          \n \n

          \n
          \n \n \n
          \n \n \n
          \n \n
          \n \n \n
          \n
          \n
          \n \n \n \n
          \n
          \n
          \n
          \n
          \n
          \n`.replace(/(^|\n)\s*/g,""),oe=()=>{e.currentInstance.resetValidationMessage()},ie=e=>{const t=(()=>{const e=f();return!!e&&(e.remove(),U([document.documentElement,document.body],[i["no-backdrop"],i["toast-shown"],i["has-column"]]),!0)})();if(te())return void c("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=i.container,t&&R(n,i["no-transition"]),D(n,ne);const o="string"==typeof(s=e.target)?document.querySelector(s):s;var s;o.appendChild(n),(e=>{const t=w();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&R(f(),i.rtl)})(o),(()=>{const e=w(),t=z(e,i.input),n=z(e,i.file),o=e.querySelector(`.${i.range} input`),s=e.querySelector(`.${i.range} output`),r=z(e,i.select),a=e.querySelector(`.${i.checkbox} input`),l=z(e,i.textarea);t.oninput=oe,n.onchange=oe,r.onchange=oe,a.onchange=oe,l.oninput=oe,o.oninput=()=>{oe(),s.value=o.value},o.onchange=()=>{oe(),s.value=o.value}})()},se=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?re(e,t):e&&D(t,e)},re=(e,t)=>{e.jquery?ae(t,e):D(t,e.toString())},ae=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},le=(()=>{if(te())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1})(),ce=(e,t)=>{const n=L(),o=T();n&&o&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?K(n):Y(n),V(n,t,"actions"),function(e,t,n){const o=E(),s=P(),r=x();if(!o||!s||!r)return;ue(o,"confirm",n),ue(s,"deny",n),ue(r,"cancel",n),function(e,t,n,o){if(!o.buttonsStyling)return void U([e,t,n],i.styled);R([e,t,n],i.styled),o.confirmButtonColor&&(e.style.backgroundColor=o.confirmButtonColor,R(e,i["default-outline"]));o.denyButtonColor&&(t.style.backgroundColor=o.denyButtonColor,R(t,i["default-outline"]));o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,R(n,i["default-outline"]))}(o,s,r,n),n.reverseButtons&&(n.toast?(e.insertBefore(r,o),e.insertBefore(s,o)):(e.insertBefore(r,t),e.insertBefore(s,t),e.insertBefore(o,t)))}(n,o,t),D(o,t.loaderHtml||""),V(o,t,"loader"))};function ue(e,t,n){const o=a(t);J(e,n[`show${o}Button`],"inline-block"),D(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=i[t],V(e,n,`${t}Button`)}const de=(e,t)=>{const n=f();n&&(!function(e,t){"string"==typeof t?e.style.background=t:t||R([document.documentElement,document.body],i["no-backdrop"])}(n,t.backdrop),function(e,t){if(!t)return;t in i?R(e,i[t]):(l('The "position" parameter is not valid, defaulting to "center"'),R(e,i.center))}(n,t.position),function(e,t){if(!t)return;R(e,i[`grow-${t}`])}(n,t.grow),V(n,t,"container"))};const pe=["input","file","range","select","radio","checkbox","textarea"],me=e=>{if(!e.input)return;if(!ve[e.input])return void c(`Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${e.input}"`);const t=ye(e.input),n=ve[e.input](t,e);K(t),e.inputAutoFocus&&setTimeout((()=>{F(n)}))},ge=(e,t)=>{const n=N(w(),e);if(n){(e=>{for(let t=0;t{const t=ye(e.input);"object"==typeof e.customClass&&R(t,e.customClass.input)},fe=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},be=(e,t,n)=>{if(n.inputLabel){const o=document.createElement("label"),s=i["input-label"];o.setAttribute("for",e.id),o.className=s,"object"==typeof n.customClass&&R(o,n.customClass.inputLabel),o.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",o)}},ye=e=>z(w(),i[e]||i.input),we=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:h(t)||l(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},ve={};ve.text=ve.email=ve.password=ve.number=ve.tel=ve.url=(e,t)=>(we(e,t.inputValue),be(e,e,t),fe(e,t),e.type=t.input,e),ve.file=(e,t)=>(be(e,e,t),fe(e,t),e),ve.range=(e,t)=>{const n=e.querySelector("input"),o=e.querySelector("output");return we(n,t.inputValue),n.type=t.input,we(o,t.inputValue),be(n,e,t),e},ve.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");D(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return be(e,e,t),e},ve.radio=e=>(e.textContent="",e),ve.checkbox=(e,t)=>{const n=N(w(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const o=e.querySelector("span");return D(o,t.inputPlaceholder),n},ve.textarea=(e,t)=>{we(e,t.inputValue),fe(e,t),be(e,e,t);return setTimeout((()=>{if("MutationObserver"in window){const n=parseInt(window.getComputedStyle(w()).width);new MutationObserver((()=>{if(!document.body.contains(e))return;const o=e.offsetWidth+(i=e,parseInt(window.getComputedStyle(i).marginLeft)+parseInt(window.getComputedStyle(i).marginRight));var i;o>n?w().style.width=`${o}px`:W(w(),"width",t.width)})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const Ce=(e,t)=>{const o=A();o&&(V(o,t,"htmlContainer"),t.html?(se(t.html,o),K(o,"block")):t.text?(o.textContent=t.text,K(o,"block")):Y(o),((e,t)=>{const o=w();if(!o)return;const s=n.innerParams.get(e),r=!s||t.input!==s.input;pe.forEach((e=>{const n=z(o,i[e]);n&&(ge(e,t.inputAttributes),n.className=i[e],r&&Y(n))})),t.input&&(r&&me(t),he(t))})(e,t))},Ae=(e,t)=>{for(const[n,o]of Object.entries(s))t.icon!==n&&U(e,o);R(e,t.icon&&s[t.icon]),$e(e,t),ke(),V(e,t,"icon")},ke=()=>{const e=w();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,o="";if(t.iconHtml)o=Ee(t.iconHtml);else if("success"===t.icon)o='\n
          \n \n
          \n
          \n',n=n.replace(/ style=".*?"/g,"");else if("error"===t.icon)o='\n \n \n \n \n';else if(t.icon){o=Ee({question:"?",warning:"!",info:"i"}[t.icon])}n.trim()!==o.trim()&&D(e,o)},$e=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])Z(e,n,"backgroundColor",t.iconColor);Z(e,".swal2-success-ring","borderColor",t.iconColor)}},Ee=e=>`
          ${e}
          `,xe=(e,t)=>{const n=t.showClass||{};e.className=`${i.popup} ${X(e)?n.popup:""}`,t.toast?(R([document.documentElement,document.body],i["toast-shown"]),R(e,i.toast)):R(e,i.modal),V(e,t,"popup"),"string"==typeof t.customClass&&R(e,t.customClass),t.icon&&R(e,i[`icon-${t.icon}`])},Pe=e=>{const t=document.createElement("li");return R(t,i["progress-step"]),D(t,e),t},Te=e=>{const t=document.createElement("li");return R(t,i["progress-step-line"]),e.progressStepsDistance&&W(t,"width",e.progressStepsDistance),t},Le=(e,t)=>{((e,t)=>{const n=f(),o=w();if(n&&o){if(t.toast){W(n,"width",t.width),o.style.width="100%";const e=T();e&&o.insertBefore(e,v())}else W(o,"width",t.width);W(o,"padding",t.padding),t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background),Y($()),xe(o,t)}})(0,t),de(0,t),((e,t)=>{const n=B();if(!n)return;const{progressSteps:o,currentProgressStep:s}=t;o&&0!==o.length&&void 0!==s?(K(n),n.textContent="",s>=o.length&&l("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.forEach(((e,r)=>{const a=Pe(e);if(n.appendChild(a),r===s&&R(a,i["active-progress-step"]),r!==o.length-1){const e=Te(t);n.appendChild(e)}}))):Y(n)})(0,t),((e,t)=>{const o=n.innerParams.get(e),i=v();if(i){if(o&&t.icon===o.icon)return Be(i,t),void Ae(i,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(s).indexOf(t.icon))return c(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void Y(i);K(i),Be(i,t),Ae(i,t),R(i,t.showClass&&t.showClass.icon)}else Y(i)}})(e,t),((e,t)=>{const n=k();n&&(t.imageUrl?(K(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),W(n,"width",t.imageWidth),W(n,"height",t.imageHeight),n.className=i.image,V(n,t,"image")):Y(n))})(0,t),((e,t)=>{const n=C();n&&(J(n,t.title||t.titleText,"block"),t.title&&se(t.title,n),t.titleText&&(n.innerText=t.titleText),V(n,t,"title"))})(0,t),((e,t)=>{const n=M();n&&(D(n,t.closeButtonHtml||""),V(n,t,"closeButton"),J(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),Ce(e,t),ce(0,t),((e,t)=>{const n=S();n&&(J(n,t.footer),t.footer&&se(t.footer,n),V(n,t,"footer"))})(0,t);const o=w();"function"==typeof t.didRender&&o&&t.didRender(o)},Se=()=>E()&&E().click(),Oe=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Me=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},je=(e,t)=>{const n=j();if(n.length)return(e+=t)===n.length?e=0:-1===e&&(e=n.length-1),void n[e].focus();w().focus()},Ie=["ArrowRight","ArrowDown"],He=["ArrowLeft","ArrowUp"],De=(e,t,o)=>{const i=n.innerParams.get(e);i&&(t.isComposing||229===t.keyCode||(i.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?qe(e,t,i):"Tab"===t.key?Ve(t):[...Ie,...He].includes(t.key)?Ne(t.key):"Escape"===t.key&&Fe(t,i,o)))},qe=(e,t,n)=>{if(p(n.allowEnterKey)&&t.target&&e.getInput()&&t.target instanceof HTMLElement&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;Se(),t.preventDefault()}},Ve=e=>{const t=e.target,n=j();let o=-1;for(let e=0;e{const t=[E(),P(),x()];if(document.activeElement instanceof HTMLElement&&!t.includes(document.activeElement))return;const n=Ie.includes(e)?"nextElementSibling":"previousElementSibling";let o=document.activeElement;for(let e=0;e{p(t.allowEscapeKey)&&(e.preventDefault(),n(Oe.esc))};var _e={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Re=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},Ue="undefined"!=typeof window&&!!window.GestureEvent,ze=()=>{const e=f();let t;e.ontouchstart=e=>{t=We(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},We=e=>{const t=e.target,n=f();return!Ke(e)&&!Ye(e)&&(t===n||!G(n)&&t instanceof HTMLElement&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&(!G(A())||!A().contains(t)))},Ke=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Ye=e=>e.touches&&e.touches.length>1;let Ze=null;const Je=()=>{null===Ze&&document.body.scrollHeight>window.innerHeight&&(Ze=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Ze+(()=>{const e=document.createElement("div");e.className=i["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)};function Xe(n,o,s,r){H()?st(n,r):(t(s).then((()=>st(n,r))),Me(e)),Ue?(o.setAttribute("style","display:none !important"),o.removeAttribute("class"),o.innerHTML=""):o.remove(),I()&&(null!==Ze&&(document.body.style.paddingRight=`${Ze}px`,Ze=null),(()=>{if(q(document.body,i.iosfix)){const e=parseInt(document.body.style.top,10);U(document.body,i.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),Re()),U([document.documentElement,document.body],[i.shown,i["height-auto"],i["no-backdrop"],i["toast-shown"]])}function Ge(e){e=nt(e);const t=_e.swalPromiseResolve.get(this),n=Qe(this);this.isAwaitingPromise?e.isDismissed||(tt(this),t(e)):n&&t(e)}const Qe=e=>{const t=w();if(!t)return!1;const o=n.innerParams.get(e);if(!o||q(t,o.hideClass.popup))return!1;U(t,o.showClass.popup),R(t,o.hideClass.popup);const i=f();return U(i,o.showClass.backdrop),R(i,o.hideClass.backdrop),ot(e,t,o),!0};function et(e){const t=_e.swalPromiseReject.get(this);tt(this),t&&t(e)}const tt=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,n.innerParams.get(e)||e._destroy())},nt=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),ot=(e,t,n)=>{const o=f(),i=le&&Q(t);"function"==typeof n.willClose&&n.willClose(t),i?it(e,t,o,n.returnFocus,n.didClose):Xe(e,o,n.returnFocus,n.didClose)},it=(t,n,o,i,s)=>{e.swalCloseEventFinishedCallback=Xe.bind(null,t,o,i,s),n.addEventListener(le,(function(t){t.target===n&&(e.swalCloseEventFinishedCallback(),delete e.swalCloseEventFinishedCallback)}))},st=(e,t)=>{setTimeout((()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy&&e._destroy()}))},rt=e=>{let t=w();if(t||new Hn,t=w(),!t)return;const n=T();H()?Y(v()):at(t,e),K(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},at=(e,t)=>{const n=L(),o=T();n&&o&&(!t&&X(E())&&(t=E()),K(n),t&&(Y(t),o.setAttribute("data-button-to-replace",t.className),n.insertBefore(o,t)),R([e,n],i.loading))},lt=e=>e.checked?1:0,ct=e=>e.checked?e.value:null,ut=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,dt=(e,t)=>{const n=w();if(!n)return;const o=e=>{"select"===t.input?function(e,t,n){const o=z(e,i.select);if(!o)return;const s=(e,t,o)=>{const i=document.createElement("option");i.value=o,D(i,t),i.selected=gt(o,n.inputValue),e.appendChild(i)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,o.appendChild(e),n.forEach((t=>s(e,t[1],t[0])))}else s(o,n,t)})),o.focus()}(n,mt(e),t):"radio"===t.input&&function(e,t,n){const o=z(e,i.radio);if(!o)return;t.forEach((e=>{const t=e[0],s=e[1],r=document.createElement("input"),a=document.createElement("label");r.type="radio",r.name=i.radio,r.value=t,gt(t,n.inputValue)&&(r.checked=!0);const l=document.createElement("span");D(l,s),l.className=i.label,a.appendChild(r),a.appendChild(l),o.appendChild(a)}));const s=o.querySelectorAll("input");s.length&&s[0].focus()}(n,mt(e),t)};m(t.inputOptions)||h(t.inputOptions)?(rt(E()),g(t.inputOptions).then((t=>{e.hideLoading(),o(t)}))):"object"==typeof t.inputOptions?o(t.inputOptions):c("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},pt=(e,t)=>{const n=e.getInput();n&&(Y(n),g(t.inputValue).then((o=>{n.value="number"===t.input?`${parseFloat(o)||0}`:`${o}`,K(n),n.focus(),e.hideLoading()})).catch((t=>{c(`Error in inputValue promise: ${t}`),n.value="",K(n),n.focus(),e.hideLoading()})))};const mt=e=>{const t=[];return e instanceof Map?e.forEach(((e,n)=>{let o=e;"object"==typeof o&&(o=mt(o)),t.push([n,o])})):Object.keys(e).forEach((n=>{let o=e[n];"object"==typeof o&&(o=mt(o)),t.push([n,o])})),t},gt=(e,t)=>!!t&&t.toString()===e.toString(),ht=(e,t)=>{const o=n.innerParams.get(e);if(!o.input)return void c(`The "input" parameter is needed to be set when using returnInputValueOn${a(t)}`);const i=e.getInput(),s=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return lt(n);case"radio":return ct(n);case"file":return ut(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,o);o.inputValidator?ft(e,s,t):i&&!i.checkValidity()?(e.enableButtons(),e.showValidationMessage(o.validationMessage)):"deny"===t?bt(e,s):vt(e,s)},ft=(e,t,o)=>{const i=n.innerParams.get(e);e.disableInput();Promise.resolve().then((()=>g(i.inputValidator(t,i.validationMessage)))).then((n=>{e.enableButtons(),e.enableInput(),n?e.showValidationMessage(n):"deny"===o?bt(e,t):vt(e,t)}))},bt=(e,t)=>{const o=n.innerParams.get(e||void 0);if(o.showLoaderOnDeny&&rt(P()),o.preDeny){e.isAwaitingPromise=!0;Promise.resolve().then((()=>g(o.preDeny(t,o.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),tt(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>wt(e||void 0,t)))}else e.close({isDenied:!0,value:t})},yt=(e,t)=>{e.close({isConfirmed:!0,value:t})},wt=(e,t)=>{e.rejectPromise(t)},vt=(e,t)=>{const o=n.innerParams.get(e||void 0);if(o.showLoaderOnConfirm&&rt(),o.preConfirm){e.resetValidationMessage(),e.isAwaitingPromise=!0;Promise.resolve().then((()=>g(o.preConfirm(t,o.validationMessage)))).then((n=>{X($())||!1===n?(e.hideLoading(),tt(e)):yt(e,void 0===n?t:n)})).catch((t=>wt(e||void 0,t)))}else yt(e,t)};function Ct(){const e=n.innerParams.get(this);if(!e)return;const t=n.domCache.get(this);Y(t.loader),H()?e.icon&&K(v()):At(t),U([t.popup,t.actions],i.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const At=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?K(t[0],"inline-block"):X(E())||X(P())||X(x())||Y(e.actions)};function kt(){const e=n.innerParams.get(this),t=n.domCache.get(this);return t?N(t.popup,e.input):null}function Bt(e,t,o){const i=n.domCache.get(e);t.forEach((e=>{i[e].disabled=o}))}function $t(e,t){const n=w();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${i.radio}"]`);for(let n=0;nObject.prototype.hasOwnProperty.call(Ot,e),Dt=e=>-1!==Mt.indexOf(e),qt=e=>jt[e],Vt=e=>{Ht(e)||l(`Unknown parameter "${e}"`)},Nt=e=>{It.includes(e)&&l(`The parameter "${e}" is incompatible with toasts`)},Ft=e=>{const t=qt(e);t&&d(e,t)};function _t(e){const t=w(),o=n.innerParams.get(this);if(!t||q(t,o.hideClass.popup))return void l("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const i=Rt(e),s=Object.assign({},o,i);Le(this,s),n.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Rt=e=>{const t={};return Object.keys(e).forEach((n=>{Dt(n)?t[n]=e[n]:l(`Invalid parameter to update: ${n}`)})),t};function Ut(){const t=n.domCache.get(this),o=n.innerParams.get(this);o?(t.popup&&e.swalCloseEventFinishedCallback&&(e.swalCloseEventFinishedCallback(),delete e.swalCloseEventFinishedCallback),"function"==typeof o.didDestroy&&o.didDestroy(),zt(this)):Wt(this)}const zt=t=>{Wt(t),delete t.params,delete e.keydownHandler,delete e.keydownTarget,delete e.currentInstance},Wt=e=>{e.isAwaitingPromise?(Kt(n,e),e.isAwaitingPromise=!0):(Kt(_e,e),Kt(n,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},Kt=(e,t)=>{for(const n in e)e[n].delete(t)};var Yt=Object.freeze({__proto__:null,_destroy:Ut,close:Ge,closeModal:Ge,closePopup:Ge,closeToast:Ge,disableButtons:xt,disableInput:Tt,disableLoading:Ct,enableButtons:Et,enableInput:Pt,getInput:kt,handleAwaitingPromise:tt,hideLoading:Ct,rejectPromise:et,resetValidationMessage:St,showValidationMessage:Lt,update:_t});const Zt=(e,t,o)=>{t.popup.onclick=()=>{const t=n.innerParams.get(e);t&&(Jt(t)||t.timer||t.input)||o(Oe.close)}},Jt=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Xt=!1;const Gt=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Xt=!0)}}},Qt=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Xt=!0)}}},en=(e,t,o)=>{t.container.onclick=i=>{const s=n.innerParams.get(e);Xt?Xt=!1:i.target===t.container&&p(s.allowOutsideClick)&&o(Oe.backdrop)}},tn=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const nn=()=>{if(e.timeout)return(()=>{const e=O();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`})(),e.timeout.stop()},on=()=>{if(e.timeout){const t=e.timeout.start();return ee(t),t}};let sn=!1;const rn={};const an=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in rn){const n=t.getAttribute(e);if(n)return void rn[e].fire({template:n})}};var ln=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||tn(e[0])?["title","html","icon"].forEach(((n,o)=>{const i=e[o];"string"==typeof i||tn(i)?t[n]=i:void 0!==i&&c(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof i}`)})):Object.assign(t,e[0]),t},bindClickHandler:function(){rn[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,sn||(document.body.addEventListener("click",an),sn=!0)},clickCancel:()=>x()&&x().click(),clickConfirm:Se,clickDeny:()=>P()&&P().click(),enableLoading:rt,fire:function(){for(var e=arguments.length,t=new Array(e),n=0;ny(i["icon-content"]),getImage:k,getInputLabel:()=>y(i["input-label"]),getLoader:T,getPopup:w,getProgressSteps:B,getTimerLeft:()=>e.timeout&&e.timeout.getTimerLeft(),getTimerProgressBar:O,getTitle:C,getValidationMessage:$,increaseTimer:t=>{if(e.timeout){const n=e.timeout.increase(t);return ee(n,!0),n}},isDeprecatedParameter:qt,isLoading:()=>{const e=w();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>!(!e.timeout||!e.timeout.isRunning()),isUpdatableParameter:Dt,isValidParameter:Ht,isVisible:()=>X(w()),mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},resumeTimer:on,showLoading:rt,stopTimer:nn,toggleTimer:()=>{const t=e.timeout;return t&&(t.running?nn():on())}});class cn{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const un=["swal-title","swal-html","swal-footer"],dn=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{wn(e,["name","value"]);const n=e.getAttribute("name"),o=e.getAttribute("value");t[n]="boolean"==typeof Ot[n]?"false"!==o:"object"==typeof Ot[n]?JSON.parse(o):o})),t},pn=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach((e=>{const n=e.getAttribute("name"),o=e.getAttribute("value");t[n]=new Function(`return ${o}`)()})),t},mn=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{wn(e,["type","color","aria-label"]);const n=e.getAttribute("type");t[`${n}ButtonText`]=e.innerHTML,t[`show${a(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label"))})),t},gn=e=>{const t={},n=e.querySelector("swal-image");return n&&(wn(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},hn=e=>{const t={},n=e.querySelector("swal-icon");return n&&(wn(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},fn=e=>{const t={},n=e.querySelector("swal-input");n&&(wn(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const o=Array.from(e.querySelectorAll("swal-input-option"));return o.length&&(t.inputOptions={},o.forEach((e=>{wn(e,["value"]);const n=e.getAttribute("value"),o=e.innerHTML;t.inputOptions[n]=o}))),t},bn=(e,t)=>{const n={};for(const o in t){const i=t[o],s=e.querySelector(i);s&&(wn(s,[]),n[i.replace(/^swal-/,"")]=s.innerHTML.trim())}return n},yn=e=>{const t=un.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const n=e.tagName.toLowerCase();t.includes(n)||l(`Unrecognized element <${n}>`)}))},wn=(e,t)=>{Array.from(e.attributes).forEach((n=>{-1===t.indexOf(n.name)&&l([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,""+(t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element.")])}))},vn=t=>{const n=f(),o=w();"function"==typeof t.willOpen&&t.willOpen(o);const s=window.getComputedStyle(document.body).overflowY;Bn(n,o,t),setTimeout((()=>{An(n,o)}),10),I()&&(kn(n,t.scrollbarPadding,s),Array.from(document.body.children).forEach((e=>{e===f()||e.contains(f())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")||""),e.setAttribute("aria-hidden","true"))}))),H()||e.previousActiveElement||(e.previousActiveElement=document.activeElement),"function"==typeof t.didOpen&&setTimeout((()=>t.didOpen(o))),U(n,i["no-transition"])},Cn=e=>{const t=w();if(e.target!==t)return;const n=f();t.removeEventListener(le,Cn),n.style.overflowY="auto"},An=(e,t)=>{le&&Q(t)?(e.style.overflowY="hidden",t.addEventListener(le,Cn)):e.style.overflowY="auto"},kn=(e,t,n)=>{(()=>{if(Ue&&!q(document.body,i.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",R(document.body,i.iosfix),ze()}})(),t&&"hidden"!==n&&Je(),setTimeout((()=>{e.scrollTop=0}))},Bn=(e,t,n)=>{R(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),K(t,"grid"),setTimeout((()=>{R(t,n.showClass.popup),t.style.removeProperty("opacity")}),10),R([document.documentElement,document.body],i.shown),n.heightAuto&&n.backdrop&&!n.toast&&R([document.documentElement,document.body],i["height-auto"])};var $n={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function En(e){!function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=$n.email),"url"===e.input&&(e.inputValidator=$n.url))}(e),e.showLoaderOnConfirm&&!e.preConfirm&&l("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(l('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("
          ")),ie(e)}let xn;class Pn{constructor(){if("undefined"==typeof window)return;xn=this;for(var e=arguments.length,t=new Array(e),o=0;o1&&void 0!==arguments[1]?arguments[1]:{};(e=>{!1===e.backdrop&&e.allowOutsideClick&&l('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)Vt(t),e.toast&&Nt(t),Ft(t)})(Object.assign({},o,t)),e.currentInstance&&(e.currentInstance._destroy(),I()&&Re()),e.currentInstance=xn;const i=Ln(t,o);En(i),Object.freeze(i),e.timeout&&(e.timeout.stop(),delete e.timeout),clearTimeout(e.restoreFocusTimeout);const s=Sn(xn);return Le(xn,i),n.innerParams.set(xn,i),Tn(xn,s,i)}then(e){return n.promise.get(this).then(e)}finally(e){return n.promise.get(this).finally(e)}}const Tn=(t,o,i)=>new Promise(((s,r)=>{const a=e=>{t.close({isDismissed:!0,dismiss:e})};_e.swalPromiseResolve.set(t,s),_e.swalPromiseReject.set(t,r),o.confirmButton.onclick=()=>{(e=>{const t=n.innerParams.get(e);e.disableButtons(),t.input?ht(e,"confirm"):vt(e,!0)})(t)},o.denyButton.onclick=()=>{(e=>{const t=n.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?ht(e,"deny"):bt(e,!1)})(t)},o.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t(Oe.cancel)})(t,a)},o.closeButton.onclick=()=>{a(Oe.close)},((e,t,o)=>{n.innerParams.get(e).toast?Zt(e,t,o):(Gt(t),Qt(t),en(e,t,o))})(t,o,a),((e,t,n,o)=>{Me(t),n.toast||(t.keydownHandler=t=>De(e,t,o),t.keydownTarget=n.keydownListenerCapture?window:w(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)})(t,e,i,a),((e,t)=>{"select"===t.input||"radio"===t.input?dt(e,t):["text","email","number","tel","textarea"].some((e=>e===t.input))&&(m(t.inputValue)||h(t.inputValue))&&(rt(E()),pt(e,t))})(t,i),vn(i),On(e,i,a),Mn(o,i),setTimeout((()=>{o.container.scrollTop=0}))})),Ln=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return yn(n),Object.assign(dn(n),pn(n),mn(n),gn(n),hn(n),fn(n),bn(n,un))})(e),o=Object.assign({},Ot,t,n,e);return o.showClass=Object.assign({},Ot.showClass,o.showClass),o.hideClass=Object.assign({},Ot.hideClass,o.hideClass),o},Sn=e=>{const t={popup:w(),container:f(),actions:L(),confirmButton:E(),denyButton:P(),cancelButton:x(),loader:T(),closeButton:M(),validationMessage:$(),progressSteps:B()};return n.domCache.set(e,t),t},On=(e,t,n)=>{const o=O();Y(o),t.timer&&(e.timeout=new cn((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(K(o),V(o,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&ee(t.timer)}))))},Mn=(e,t)=>{t.toast||(p(t.allowEnterKey)?jn(e,t)||je(-1,1):In())},jn=(e,t)=>t.focusDeny&&X(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&X(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!X(e.confirmButton))&&(e.confirmButton.focus(),!0),In=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout((()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout((()=>{e.play().catch((()=>{}))}),2500)}),500):localStorage.setItem("swal-initiation",`${e}`)}Pn.prototype.disableButtons=xt,Pn.prototype.enableButtons=Et,Pn.prototype.getInput=kt,Pn.prototype.disableInput=Tt,Pn.prototype.enableInput=Pt,Pn.prototype.hideLoading=Ct,Pn.prototype.disableLoading=Ct,Pn.prototype.showValidationMessage=Lt,Pn.prototype.resetValidationMessage=St,Pn.prototype.close=Ge,Pn.prototype.closePopup=Ge,Pn.prototype.closeModal=Ge,Pn.prototype.closeToast=Ge,Pn.prototype.rejectPromise=et,Pn.prototype.update=_t,Pn.prototype._destroy=Ut,Object.assign(Pn,ln),Object.keys(Yt).forEach((e=>{Pn[e]=function(){return xn&&xn[e]?xn[e](...arguments):null}})),Pn.DismissReason=Oe,Pn.version="11.7.22";const Hn=Pn;return Hn.default=Hn,Hn})),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2); +"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,".swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:\"top-start top top-end\" \"center-start center center-end\" \"bottom-start bottom-center bottom-end\";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}"); \ No newline at end of file diff --git a/connector-miravia/views/metabox/miravia-order.php b/connector-miravia/views/metabox/miravia-order.php new file mode 100644 index 0000000..48398b4 --- /dev/null +++ b/connector-miravia/views/metabox/miravia-order.php @@ -0,0 +1,33 @@ +ID); +?> +
          + ID, '_miravia_packed_result', true); + if(isset($package_data['data']['pack_order_list'])){ + $packages = []; + foreach ($package_data['data']['pack_order_list'] as $item){ + if(isset($item['order_item_list'])){ + foreach($item['order_item_list'] as $package){ + $packages[$package['package_id']] = true; + } + } + } + + foreach($packages as $p => $v) { + if($v) { + echo wp_kses(' Print Shipping Label ['.$p.']', wp_kses_allowed_html()); + } + } + + }else{ + echo wp_kses('

          '.__('Ready to ship?','miraviawoo').'

          + ', wp_kses_allowed_html()); + } + + ?> + + + +
          \ No newline at end of file diff --git a/connector-miravia/views/metabox/miravia-product.php b/connector-miravia/views/metabox/miravia-product.php new file mode 100644 index 0000000..6b8131f --- /dev/null +++ b/connector-miravia/views/metabox/miravia-product.php @@ -0,0 +1,43 @@ +ID, '_miravia_brand_product', true); +$productUnit = get_post_meta($post->ID, '_miravia_unit', true); +$productUnitValue = get_post_meta($post->ID, '_miravia_unit_value', true); + +$defaultUnit = get_option('miravia_default_unit', 'units'); +$defaultUnitValue = get_option('miravia_default_unit_value', '1'); + +if($productBrand) { + $defaultBrand = $productBrand; +} +?> + +
          +

          + + +

          + +

          + + +

          + +

          + + +

          + + +
          diff --git a/connector-miravia/views/pages/accounts.php b/connector-miravia/views/pages/accounts.php new file mode 100644 index 0000000..07de916 --- /dev/null +++ b/connector-miravia/views/pages/accounts.php @@ -0,0 +1,38 @@ +custom_actions = array( + 'delete' => sprintf('Delete', sanitize_text_field($_REQUEST['page']), sanitize_text_field($_REQUEST['subpage']), 'delete'), +); +$miraviaTable->columns = [ + 'name' => 'Name', + 'lang' => 'Language', + 'userid' => 'User ID', + 'created' => 'Created', + 'updated' => 'Updated' +]; + +$miraviaTable->data_table = $accounts = MiraviaCore::get_accounts(); +$miraviaTable->total_elements = count($accounts); +$miraviaTable->prepare_items(); +?> +
          +
          +

          Miravia Seller Accounts

          + +
          +
          + display(); + ?> +
          \ No newline at end of file diff --git a/connector-miravia/views/pages/add-rule.php b/connector-miravia/views/pages/add-rule.php new file mode 100644 index 0000000..d9131eb --- /dev/null +++ b/connector-miravia/views/pages/add-rule.php @@ -0,0 +1,109 @@ + 'product_cat')); +foreach($categories as $cat) { + $categories_end[] = (object) array('lk_option' => $cat->name, 'lk_value' => $cat->term_id); +} +$profiles = MiraviaCore::get_profiles(); +$accounts = MiraviaCore::get_accounts(); +if(isset($_POST['action']) and sanitize_text_field($_POST['action']) == 'save_rule') { + if(sanitize_text_field($_POST['name_rule']) != "") { + $account = sanitize_text_field($_POST['apply_accounts']); + $profiles = sanitize_text_field($_POST['apply_profile']); + $filterDecoded = urldecode($_POST['filter_data']); + $actionsDecoded = urldecode($_POST['action_detail_data']); + $saveProfile = MiraviaCore::add_rule(array( + 'name_rule' => sanitize_text_field($_POST['name_rule']), + 'accounts' => $account, + 'profile_id' => $profiles, + 'rules_json' => $filterDecoded, + 'action_json' => $actionsDecoded + )); + if($saveProfile) { + wp_safe_redirect('?page=miravia_settings&subpage=rules'); + } + }else{ + echo "Error: Rule need Name"; + } +} +?> + +
          +

          Add Rule to Miravia

          +
          +
          + + + + + + + + + + + + + + + + + + + + + + + + + +
          + + + +
          + + + +
          + + + +
          + + +
          +
          + + +
          + +
          +
          +
          + +
          +
          diff --git a/connector-miravia/views/pages/attributes.php b/connector-miravia/views/pages/attributes.php new file mode 100644 index 0000000..1b440d1 --- /dev/null +++ b/connector-miravia/views/pages/attributes.php @@ -0,0 +1,65 @@ +term_id, "_miravia_attr", sanitize_text_field($_POST['attr'])); +} + +$miravia_category = get_term_meta($category->term_id, '_miravia_category', true); +$token = MiraviaCore::get_miravia_account_default(); +if($token) { + $token = $token['token']; +}else{ + die('Error: Account is not ready'); +} +$link = new MiraviaCategory($token); +$attributes = $link->getAttributes($miravia_category); +$default_attributes = get_term_meta($category->term_id, "_miravia_attr", true); +$attributes_woocommerce = wp_list_pluck( wc_get_attribute_taxonomies(), 'attribute_label', 'attribute_name' ); +?> +

          MIRAVIA - Attributes name ?> Configuration

          +
          + + $attr) { + + // if(isset($default_attributes[$attr['name']])) { + // $value = $default_attributes[$attr['name']]; + // }else{ + // $value = ''; + // } + // $obligatorio = ''; + // if($attr['is_mandatory'] == '1') { + // $obligatorio = '*'; + // } + + $options = ''; + if (!empty ($attributes ) ) { + foreach ( $attributes as $key => $v ) { + if($v['is_sale_prop'] == 0) { + continue; + } + $selected = ''; + if($default_attributes != '' and $v['name'] == $default_attributes[$slug]) { + $selected = 'selected="selected"'; + } + $options .= ""; + } + } + echo wp_kses(" + + + ", wp_kses_allowed_html()); + } + echo wp_kses("",wp_kses_allowed_html()); + }else{ + echo esc_html('No hay atributos en el id ' . $category->term_id); + } + ?> + + +
          {$attr}
          +
          \ No newline at end of file diff --git a/connector-miravia/views/pages/brands.php b/connector-miravia/views/pages/brands.php new file mode 100644 index 0000000..58340ec --- /dev/null +++ b/connector-miravia/views/pages/brands.php @@ -0,0 +1,10 @@ +client->get_brands(1); +// die('
          '.print_r($brands, true).'
          '); +?> +
          +

          Brands

          + +
          \ No newline at end of file diff --git a/connector-miravia/views/pages/categories.php b/connector-miravia/views/pages/categories.php new file mode 100644 index 0000000..fb3bb5e --- /dev/null +++ b/connector-miravia/views/pages/categories.php @@ -0,0 +1,45 @@ + +

          MIRAVIA - Category Configuration

          +getCategories(true); + if(isset($_POST['action']) and sanitize_text_field($_POST['action']) == 'save_miravia_categories') { + if(is_array($_POST['miravia_category'])) { + foreach($_POST['miravia_category'] as $woocommerce_cat_id => $miravia_cat) { + update_term_meta(sanitize_text_field($woocommerce_cat_id), "_miravia_category", sanitize_text_field($miravia_cat)); + } + } + } + $woocommerce_categories = get_terms('product_cat'); +?> +
          + + + + + + + term_id, "_miravia_category", true); + echo wp_kses(" + + + + ", wp_kses_allowed_html()); + } + ?> + + +
          WooCommerce CategoryMIRAVIA CategoryOpciones
          {$category->name}".MiraviaCore::select_category($miravia_categories, array('select' => $selected, 'name' => 'miravia_category['.$category->term_id.']'))." + Atributos por defecto +
          +
          \ No newline at end of file diff --git a/connector-miravia/views/pages/configuration.php b/connector-miravia/views/pages/configuration.php new file mode 100644 index 0000000..7c45406 --- /dev/null +++ b/connector-miravia/views/pages/configuration.php @@ -0,0 +1,175 @@ + 'product_cat', 'hide_empty' => false] ); +// MiraviaCore::debug($categories); +// $notifies = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}options WHERE option_name LIKE '%miravia_notify%'", ARRAY_A ); +// // delete_option('miravia_notify_update_stock_in'); +// LOG::add("Get notifies"); +// LOG::add($notifies); +?> +
          +

          Configuration

          +
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          + + + +
          +

          +
          + /> +
          +

          +
          + +
          +

          +
          + +
          +

          +
          + +
          +

          +
          + +
          +

          +
          + +
          +

          +
          + +
          +

          +
          + +
          +

          +
          + +
          +

          +
          + " /> +
          + +
          +
          \ No newline at end of file diff --git a/connector-miravia/views/pages/create_profile.php b/connector-miravia/views/pages/create_profile.php new file mode 100644 index 0000000..3d5fb11 --- /dev/null +++ b/connector-miravia/views/pages/create_profile.php @@ -0,0 +1,81 @@ +getCategories(); +} + +//Save data +if(isset($_POST['action']) and sanitize_text_field($_POST['action']) == 'save_profile') { + $categories_recibed = implode(",", array_map('sanitize_text_field', $_POST['tax_input']['product_cat'])); + $acounts_recibed = implode(",", array_map('sanitize_text_field', $_POST['profile'])); + // die(var_dump($categories_recibed)); + if($_POST['description'] == '') { + echo "

          Profile need description

          "; + }else{ + $saveProfile = MiraviaCore::add_profile(array( + 'name' => sanitize_text_field($_POST['description']), + 'accounts_id' => $acounts_recibed, + 'categories' => $categories_recibed, + 'miravia_category' => sanitize_text_field($_POST['miravia_category']) + )); + + if($saveProfile) { + wp_safe_redirect(admin_url("admin.php?page=miravia_settings&subpage=edit_profile&action=edit&id={$saveProfile}")); + } + } +} +?> +
          +

          Create new profile

          +
          +
          + + + + + + + + + + + + + + + + + + +
          + +
          Categories + Select the categories with this profile + +
            + 'product_cat' + ));?> +
          +
          Miravia Category + +
          Seller Accounts + {$profile['name']}

          "; + } + ?> +
          + +
          +
          \ No newline at end of file diff --git a/connector-miravia/views/pages/dashboard.php b/connector-miravia/views/pages/dashboard.php new file mode 100644 index 0000000..639ae1a --- /dev/null +++ b/connector-miravia/views/pages/dashboard.php @@ -0,0 +1,29 @@ + + diff --git a/connector-miravia/views/pages/detail-job.php b/connector-miravia/views/pages/detail-job.php new file mode 100644 index 0000000..a0d4d4f --- /dev/null +++ b/connector-miravia/views/pages/detail-job.php @@ -0,0 +1,49 @@ +custom_actions = array( + 'download' => sprintf('Edit' ), + 'view' => 'View on Miravia', + ); + $miraviaTable->columns = [ + 'name' => 'SKU', + 'id_miravia' => 'ID Miravia', + 'id_woocommerce' => 'ID WooCommerce', + 'lastError' => 'Last Error', + 'created' => 'Created', + 'updated' => 'Updated', + 'status_text' => 'Status' + ]; + foreach($jobs as $k => $p) { + $data[] = array( + 'name' => $p['sku'], + 'id_miravia' => $p['id_miravia'], + 'id_woocommerce' => $p['id_woocommerce'], + 'lastError' => $p['lastError'], + 'created' => date('d-m-Y H:i:s', strtotime($p['created'])), + 'updated' => date('d-m-Y H:i:s', strtotime($p['updated'])), + 'status_text' => $p['status_text'] + ); + } + +} +// die('
          ' . print_r($data, true) . '
          '); +$miraviaTable->data_table = $data; +$miraviaTable->total_elements = count($data); + +$miraviaTable->prepare_items(); + + +?> +
          +

          Job Detail

          + display(); ?> +
          diff --git a/connector-miravia/views/pages/edit_profile.php b/connector-miravia/views/pages/edit_profile.php new file mode 100644 index 0000000..8dd0cf8 --- /dev/null +++ b/connector-miravia/views/pages/edit_profile.php @@ -0,0 +1,208 @@ +getCategories(); +} + +$attributes = $link->getAttributes($prof['miravia_category']); +// var_dump($prof['config']); +try { + $default_attributes = $prof['config'] ? json_decode($prof['config'], true) : []; +}catch(Exception $e) { + $default_attributes = []; +} +// MiraviaCore::debug($default_attributes); +$attributes_woocommerce = wp_list_pluck( wc_get_attribute_taxonomies(), 'attribute_label', 'attribute_name' ); + +if(isset($_POST['action']) and sanitize_text_field($_POST['action']) == 'save_miravia_attr_default') { + $default_attributes = sanitize_text_field($_POST['attr']); + $args = array('config' => json_encode(array('attr' => sanitize_text_field($_POST['attr'])))); + LOG::add($args); + if(MiraviaCore::update_profile($args, array('id' => $id))) { + echo esc_html('Attributes profile saved'); + } +} +//Save data +if(isset($_POST['action']) and sanitize_text_field($_POST['action']) == 'update_profile') { + if($_POST['description'] == '') { + echo "

          Profile need description

          "; + }elseif ($_POST['tax_input']['product_cat'] == null) { + echo "

          Profile need categories

          "; + }else{ + $categories_recibed = implode(",", array_map('sanitize_text_field', $_POST['tax_input']['product_cat'])); + $acounts_recibed = implode(",", array_map('sanitize_text_field', $_POST['profile'])); + // die(var_dump($categories_recibed)); + $saveProfile = MiraviaCore::update_profile(array( + 'name' => sanitize_text_field($_POST['description']), + 'accounts_id' => $acounts_recibed, + 'categories' => $categories_recibed, + 'miravia_category' => sanitize_text_field($_POST['miravia_category']) + ), array('id' => $id)); + + if($saveProfile) { + wp_safe_redirect('?page=miravia_settings&subpage=profiles'); + } + } + +} + + +//Rules +$miraviaTable = new MiraviaTable([ + 'sccren' => 'miravia_rules' +]); +$miraviaTable->custom_actions = array( + 'edit' => sprintf('Editar', sanitize_text_field($_REQUEST['page']), 'edit_rule', 'edit', ), + 'delete' => sprintf('Eliminar', sanitize_text_field($_REQUEST['page']), sanitize_text_field($_REQUEST['subpage']), 'delete'), +); +$miraviaTable->columns = [ + 'id' => "ID", + 'name' => "Name", + 'created' => 'Created', + 'updated' => 'Updated' +]; +$miraviaTable->default_column_name = 'name_rule'; +$rules = MiraviaCore::get_rules(false, "profile_id = {$id} or profile_id = '0'"); +$miraviaTable->data_table = $rules; +$miraviaTable->total_elements = count($rules); +$miraviaTable->prepare_items(); +?> +
          +

          Edit Profile

          +
          + +
          + +
          +
          +
          +
          + + + + + + + + + + + + + + + + + + +
          + + + +
          Categories + Select the categories with this profile + +
            + 'product_cat', + 'selected_cats' => explode(",", $prof['categories']) + ));?> +
          +
          Miravia Category + +
          Seller Accounts + {$profile['name']}

          "; + } + ?> +
          + + +
          +
          +
          +
          + + + $attr) { + + $options = ''; + if (!empty ($attributes ) ) { + foreach ( $attributes as $key => $v ) { + if($v['is_sale_prop'] == 0) { + continue; + } + $selected = ''; + if($default_attributes != '' and isset($default_attributes[$slug]) and $v['name'] == $default_attributes[$slug]) { + $selected = 'selected="selected"'; + } + $options .= ""; + } + } + echo " + + + "; + } + } + ?> + +
          {$attr}
          + +
          +
          +
          + display(); + ?> +
          +
          + +
          \ No newline at end of file diff --git a/connector-miravia/views/pages/edit_rule.php b/connector-miravia/views/pages/edit_rule.php new file mode 100644 index 0000000..8b33265 --- /dev/null +++ b/connector-miravia/views/pages/edit_rule.php @@ -0,0 +1,129 @@ + 'product_cat')); +foreach($categories as $cat) { + $categories_end[] = (object) array('lk_option' => $cat->name, 'lk_value' => $cat->term_id); +} + +if(isset($_POST['action']) and sanitize_text_field($_POST['action']) == 'save_rule') { + $filterDecoded = urldecode($_POST['filter_data']); + $actionsDecoded = urldecode($_POST['action_detail_data']); + $account = sanitize_text_field($_POST['apply_accounts']); + $profile = sanitize_text_field($_POST['apply_profile']); + $arrayDatosRule = array( + 'name_rule' => sanitize_text_field($_POST['name_rule']), + 'accounts' => intval($account), + 'profile_id' => intval($profile), + 'rules_json' => $filterDecoded, + 'action_json' => $actionsDecoded, + 'action_type' => sanitize_text_field($_POST['action_type']) + ); + $saveProfile = MiraviaCore::update_rule($arrayDatosRule, array('id' => $id)); + if($saveProfile) { + $rule = $arrayDatosRule; + echo esc_html('Rule saved'); + } +} +// var_dump($rule); +?> + +
          +

          Edit Rule to Miravia

          +
          +
          + + + + + + + + + + + + + + + + + + + + + + + + + +
          + + + +
          + + + +
          + + + +
          + + +
          +
          + + +
          + +
          +
          +
          + +
          +
          diff --git a/connector-miravia/views/pages/jobs.php b/connector-miravia/views/pages/jobs.php new file mode 100644 index 0000000..e04d324 --- /dev/null +++ b/connector-miravia/views/pages/jobs.php @@ -0,0 +1,45 @@ +custom_actions = array( + 'detail' => sprintf('Detail', sanitize_text_field($_REQUEST['page']), 'detail-job' ), + 'download' => sprintf('Check Status', sanitize_text_field($_REQUEST['page']), sanitize_text_field($_REQUEST['subpage']), 'download', ), + 'cancel' => sprintf('Cancel Job', sanitize_text_field($_REQUEST['page']), sanitize_text_field($_REQUEST['subpage']), 'download', ), + ); + + $miraviaTable->columns = [ + 'name' => 'Job', + 'status' => 'Status', + 'total' => 'Total Products', + 'updated' => 'Updated', + ]; + foreach($jobs as $k => $p) { + $data[] = array( + 'name' => $p['job_id'], + 'status' => '...', + 'token' => $p['token'], + 'total' => $p['total'], + 'updated' => date('d-m-Y H:i:s', strtotime($p['updated'])), + ); + } + +} +// die('
          ' . print_r($data, true) . '
          '); +$miraviaTable->data_table = $data; +$miraviaTable->total_elements = count($data); + +$miraviaTable->prepare_items(); + + +?> +
          +

          Miravia Jobs

          + display(); ?> +
          diff --git a/connector-miravia/views/pages/orders.php b/connector-miravia/views/pages/orders.php new file mode 100644 index 0000000..8996367 --- /dev/null +++ b/connector-miravia/views/pages/orders.php @@ -0,0 +1,63 @@ +getOrders('2022-09-01'); + $miraviaTable = new MiraviaTable(); + // die('
          '.print_r($orders,true).'
          '); + $data = array(); + $miraviaTable->custom_actions = array( + 'download' => sprintf('Download', sanitize_text_field($_REQUEST['page']), sanitize_text_field($_REQUEST['subpage']), 'download', ), + ); + + $miraviaTable->columns = [ + 'id' => "Order Number", + 'name' => 'Customer Name', + 'price' => "Price", + 'statuses' => "Status", + 'created_at' => 'Created', + 'updated_at' => 'Updated', + ]; + foreach($orders['data']['orders'] as $k => $p) { + $data[] = array( + 'id' => $p['order_number'], + 'name' => $p['customer_first_name'], + 'price' => number_format($p['price'], 2) . '€', + 'statuses' => $p['statuses'][0], + 'created_at' => date('d-m-Y H:i', strtotime($p['created_at'])), + 'updated_at' => date('d-m-Y H:i', strtotime($p['updated_at'])), + ); + } + // die('
          ' . print_r($data, true) . '
          '); + $miraviaTable->data_table = $data; + $miraviaTable->total_elements = $orders['data']['count']; + + + $miraviaTable->prepare_items(); +}else{ + $accounts = MiraviaCore::get_accounts(); + + $html_accounts = ""; + if(count($accounts) == 1) { + wp_safe_redirect( "?page=miravia_settings&subpage=orders&account={$accounts[0]['name']}&token={$accounts[0]['token']}&account_id={$accounts[0]['id']}", 301); + die(); + } + foreach($accounts as $a) { + $html_accounts .= "{$a['name']} ({$a['email']})"; + } +} + +?> +
          +

          Miravia Orders

          + '.__('Select an account', 'miravia').'

          ', array('p' => array())); + echo wp_kses($html_accounts, array('a' => array())); + }else{ + echo wp_kses('

          '.__('Orders by account', 'miravia').' '.sanitize_text_field($_GET['account']).'

          ', array('p' => array())); + $miraviaTable->display(); + } ?> +
          diff --git a/connector-miravia/views/pages/product_test.php b/connector-miravia/views/pages/product_test.php new file mode 100644 index 0000000..b417e6f --- /dev/null +++ b/connector-miravia/views/pages/product_test.php @@ -0,0 +1,7 @@ +custom_actions = array( + 'woocommerce' => 'Disconect', + //'upload' => 'Upload products' +); +$data = array(); + +$miraviaTable->columns = [ + 'sku' => "SKU", + 'name' => "Title", + 'variationsTotal' => 'Total Variations', + 'price' => "Price", + 'lastError' => "Last Error", + 'status_text' => "Status", + 'created' => 'Created', + 'updated' => 'Updated', + 'actions' => 'Actions', +]; + +foreach($products as $k => $p) { + try { + $_product = new WC_Product($p['id_woocommerce']); + $data[] = array( + 'id_woocommerce' => $p['id_woocommerce'], + 'sku' => $p['sku'], + 'name' => $p['name'], + 'variationsTotal' => $p['variationsTotal'], + 'price' => $_product->get_price_html(), + 'lastError' =>$p['lastError'], + 'status_text' => $p['status_text'], + 'created' => $p['created'], + 'updated' => $p['updated'], + 'actions' => $p['id_miravia'] != 0 ? "View on Miravia" : 'Not on Miravia', + ); + }catch(Exception $e){ + continue; + } +} + + +$miraviaTable->data_table = $data; +$miraviaTable->total_elements = count($data); + + +$miraviaTable->prepare_items(); +?> +
          +

          Products

          +

          + display(); ?> +
          diff --git a/connector-miravia/views/pages/products_remote.php b/connector-miravia/views/pages/products_remote.php new file mode 100644 index 0000000..42136cb --- /dev/null +++ b/connector-miravia/views/pages/products_remote.php @@ -0,0 +1,58 @@ +getProductList($page); +// MiraviaCore::debug($products['data'], false); +$miraviaTable = new MiraviaTable(); +$data = array(); +$miraviaTable->custom_actions = array( + 'view' => 'View', + //'upload' => 'Upload products' +); + +$miraviaTable->columns = [ + 'id' => "ID", + 'image' => "Image", + 'name' => "Name", + 'price' => "Price", + 'status' => "Status", + 'created' => 'Created', + 'updated' => 'Updated', + 'connect' => 'Connect' +]; +foreach($products['data']['products'] as $k => $p) { + $image = count($p['images']) > 0 ? $p['images'][0] : false; + $sku = $p['skus'][0]['SellerSku']; + $id_remote = $p['item_id']; + $data[] = array( + 'id' => $id_remote, + 'image' => $image ? "" : '', + 'name' => $p['attributes']['name'], + 'price' => number_format($p['skus'][0]['price'], 2) . '€', + 'status' => $p['status'], + 'created' => date('d-m-Y H:i', intval($p['created_time'])), + 'updated' => date('d-m-Y H:i', intval($p['updated_time'])), + 'connect' => "Connect" + ); +} +// die('
          ' . print_r($data, true) . '
          '); +$miraviaTable->data_table = $data; +$miraviaTable->total_elements = $products['data']['total_products']; + + +$miraviaTable->prepare_items(); +?> +
          +

          Miravia Products

          +

          + display(); ?> +
          diff --git a/connector-miravia/views/pages/profiles.php b/connector-miravia/views/pages/profiles.php new file mode 100644 index 0000000..2efd5af --- /dev/null +++ b/connector-miravia/views/pages/profiles.php @@ -0,0 +1,39 @@ + 'miravia_profiles' +]); +$miraviaTable->custom_actions = array( + 'edit' => sprintf('Editar', sanitize_text_field($_REQUEST['page']), 'edit_profile', 'edit', ), + 'delete' => sprintf('Eliminar', sanitize_text_field($_REQUEST['page']), sanitize_text_field($_REQUEST['subpage']), 'delete'), + 'upload' => 'Upload products' +); +$miraviaTable->columns = [ + 'id' => "ID", + 'name' => "Name", + 'created' => 'Created', + 'updated' => 'Updated', + 'sync' => 'Status Sync' +]; +$profiles = MiraviaCore::get_profiles(); +$miraviaTable->data_table = $profiles; +$miraviaTable->total_elements = count($profiles); +$miraviaTable->prepare_items(); +?> +
          +

          Mapping Profiles

          + Create Profile +
          + display(); + ?> +
          \ No newline at end of file diff --git a/connector-miravia/views/pages/rules.php b/connector-miravia/views/pages/rules.php new file mode 100644 index 0000000..732411d --- /dev/null +++ b/connector-miravia/views/pages/rules.php @@ -0,0 +1,37 @@ + 'miravia_rules' +]); + +if(isset($_GET['action']) and $_GET['action'] == 'delete') { + if(current_user_can( 'manage_options' )){ + MiraviaCore::delete_rule(sanitize_text_field( $_GET['id'] )); + wp_safe_redirect(admin_url("admin.php?page=miravia_settings&subpage=rules")); + } +} +$miraviaTable->custom_actions = array( + 'edit' => sprintf('Editar', sanitize_text_field($_REQUEST['page']), 'edit_rule', 'edit', ), + 'delete' => sprintf('Eliminar', sanitize_text_field($_REQUEST['page']), sanitize_text_field($_REQUEST['subpage']), 'delete'), +); +$miraviaTable->columns = [ + 'id' => "ID", + 'name' => "Name", + 'created' => 'Created', + 'updated' => 'Updated' +]; +$miraviaTable->default_column_name = 'name_rule'; +$rules = MiraviaCore::get_rules(); +$miraviaTable->data_table = $rules; +$miraviaTable->total_elements = count($rules); +$miraviaTable->prepare_items(); +?> +
          +

          Rules

          + Create Rule +
          + display(); + ?> +
          \ No newline at end of file diff --git a/connector-miravia/views/settings.php b/connector-miravia/views/settings.php new file mode 100644 index 0000000..38955a1 --- /dev/null +++ b/connector-miravia/views/settings.php @@ -0,0 +1,11 @@ + /dev/null; then + print_error "Git is not installed. Please install Git first." + exit 1 + fi +} + +# Function to set Git credentials +get_credentials() { + GIT_USERNAME="Malin" + GIT_PASSWORD="MuieSteaua09!@" + print_status "Using configured Git credentials..." +} + +# Function to configure Git user +configure_git_user() { + print_status "Configuring Git user..." + git config user.name "Miravia Connector Bot" + git config user.email "development@cloudhost.es" +} + +# Function to initialize git repository if needed +init_git_repo() { + if [ ! -d ".git" ]; then + print_status "Initializing Git repository..." + git init + git remote add origin "${REPO_URL}" + else + print_status "Git repository already initialized." + # Update remote URL if it changed + git remote set-url origin "${REPO_URL}" + fi +} + +# Function to create .gitignore if it doesn't exist +create_gitignore() { + if [ ! -f ".gitignore" ]; then + print_status "Creating .gitignore file..." + cat > .gitignore << 'EOF' +# WordPress +wp-config.php +wp-content/uploads/ +wp-content/cache/ +wp-content/backup-db/ +wp-content/advanced-cache.php +wp-content/wp-cache-config.php +wp-content/plugins/hello.php +wp-content/plugins/akismet/ +.htaccess + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# IDE files +.idea/ +.vscode/ +*.swp +*.swo +*~ + +# Logs +*.log +error_log +debug.log +logs/ + +# Temporary files +*.tmp +*.temp +*.bak +*.backup + +# Node modules (if any) +node_modules/ +npm-debug.log* + +# Composer +vendor/ +composer.lock + +# Plugin specific +*.zip +data/ +EOF + fi +} + +# Function to check for uncommitted changes +check_changes() { + if [ -z "$(git status --porcelain)" ]; then + print_warning "No changes detected. Nothing to commit." + return 1 + fi + return 0 +} + +# Function to add all changes +add_changes() { + print_status "Adding changes to staging area..." + git add . + + # Show what will be committed + print_status "Files to be committed:" + git diff --cached --name-only +} + +# Function to commit changes +commit_changes() { + print_status "Committing changes..." + + # Create detailed commit message + COMMIT_MSG=$(cat << 'EOF' +Fix image upload structure for Miravia API compliance + +🔧 Bug Fixes: +- Fixed product image structure to match Miravia API requirements +- Updated MiraviaProduct.php getData() method to wrap images in {"Image": [...]} format +- Updated MiraviaCombination.php getData() method to wrap SKU images properly +- Resolved error "[4224] The Main image of the product is required" + +📋 Changes: +- Modified getData() methods to transform flat image arrays to nested structure +- Product images: images[] → Images: {"Image": [...]} +- SKU images: images[] → Images: {"Image": [...]} +- Maintains backward compatibility for empty image arrays + +🎯 Impact: +- Product uploads will now pass Miravia's image validation +- Both product-level and SKU-level images properly formatted +- Complies with official Miravia API documentation structure + +🤖 Generated with Claude Code (https://claude.ai/code) + +Co-Authored-By: Claude +EOF +) + + git commit -m "$COMMIT_MSG" +} + +# Function to push changes +push_changes() { + print_status "Pushing changes to remote repository..." + + # Configure Git to use credentials + git config credential.helper store + + # Create credentials file temporarily + echo "https://${GIT_USERNAME}:${GIT_PASSWORD}@devops.cloudhost.es" > ~/.git-credentials + + # Push changes + git push -u origin $BRANCH + + # Clean up credentials + rm -f ~/.git-credentials + git config --unset credential.helper + + print_status "Changes pushed successfully!" +} + +# Function to show repository status +show_status() { + print_status "Repository Status:" + echo "Repository URL: $REPO_URL" + echo "Branch: $BRANCH" + echo "Last commit:" + git log -1 --oneline +} + +# Main execution +main() { + print_status "Starting Miravia Connector Git deployment process..." + + # Change to plugin directory + cd "$PLUGIN_DIR" + + # Check prerequisites + check_git + + # Get credentials + get_credentials + + # Initialize and configure Git + init_git_repo + configure_git_user + create_gitignore + + # Check for changes + if ! check_changes; then + exit 0 + fi + + # Add, commit, and push changes + add_changes + commit_changes + push_changes + + # Show final status + show_status + + print_status "Deployment completed successfully! 🎉" + print_status "You can view the changes at: $REPO_URL" +} + +# Run main function +main "$@" \ No newline at end of file