PageSourceSearch

https://www.tuli.sk/includes/js/cache/7678ebe5dba9a43728cf74068f199843.js?144406

js tuli.sk collected 2026-09-24 13:07:33 UTC 1,951,927 bytes, 47,832 lines download raw bytes

1/* ========================================
2 FILE: /language/_js/slovak-utf.js
3 ==================== */
4
5var cms_js_lang_2code = 'sk';
6
7var js_lang_flypage_cart_summary = 'Do košíka pridáte {quantity} za {price_with_tax} s DPH ({price_without_tax} bez DPH).';
8
9var cms_js_lang_yes = 'áno';
10var cms_js_lang_no = 'nie';
11
12var cms_js_lang_from = 'od';
13var cms_js_lang_to = 'do';
14
15var cms_js_lang_category = 'Kategória';
16
17var cms_js_lang_more = 'viac';
18var cms_js_lang_less = 'menej';
19var cms_js_lang_updated = 'Aktualizované';
20
21var cms_js_lang_subscribers_remove_one = 'Naozaj si prajete zmazať zvoleného odberatela?';
22var cms_js_lang_subscribers_remove_more = 'Naozaj si prajete zmazať zvolených odberatelov?';
23
24var cms_js_lang_print_order_firefox_alert = 'Zistili sme, že používate prehliadač Mozilla Firefox a chystáte sa vytlačiť objednávku obsahujúcu viac ako 10 položiek.<br><br>Firefox obsahuje oficiálne nahlásenú chybu, ktorá spôsobuje neštandardnú tlač.<br><br>Prosíme Vás o použitie iného prehliadača - napr. {chrome_link} alebo {opera_link}.';
25
26var cms_js_lang_weekdays = {1: 'Pondelok',2: 'Utorok',3: 'Streda',4: 'Å tvrtok',5: 'Piatok',6: 'Sobota',7: 'Nedela'};
27
28var cms_js_lang_dashboard_no_orders = 'Nemáte žiadne objednávky.';
29var cms_js_lang_dashboard_no_customers = 'Nemáte žiadnych zákazníkov.';
30
31var cms_js_lang_orders_mass_inv_text_1 = '1 alebo viac vybraných záznamov objednávok nemá vytvorenú faktúru. \n\nPrajete si vygenerovať hromadnú faktúru len pre existujúce faktúry?';
32var cms_js_lang_orders_mass_inv_text_2 = 'Maximálny počet faktúr pre hromadné generovanie je obmedzený na {count_max} (aktuálny počet: {count}).\nVyberte prosím menší počet faktúr, prípadne znížte počet zobrazených položiek na stránku.';
33
34var cms_js_lang_settings_required = 'Potrebná úprava nastavení';
35var cms_js_lang_bulk_adjustment_of_coupon_validity = 'Hromadná zmena platnosti pre %s zvolených kupónov';
36var cms_js_lang_erase_date = 'Vyčistiť dátum';
37
38var js_lang_buy_as_company_country_restriction = 'Nákup na firmu je možný iba v prípade fakturačnej a dodacej adresy na Slovensku.';
39
40var js_lang_gift_free_title = 'Darček zdarma - zostáva nakúpiť za';
41var js_lang_gift_free_enabled = 'Máte vzorku produktu zdarma.';
42var cms_js_lang_orders_sms_send_title_s = 'Zaslať SMS o zmene stavu objednávky';
43var cms_js_lang_orders_sms_send_title_m = 'Zaslať SMS o zmene stavu objednávok';
44var cms_js_lang_orders_sms_send_title = 'Zaslať SMS o zmene stavu na';
45var cms_js_lang_orders_change_status_default_comment = 'Komentár pre zákazníka';
46var cms_js_lang_orders_change_status_change_confirm = 'Potvrdiť zmenu stavu objednávky';
47var cms_js_lang_orders_customer_search = 'zadajte meno / e-mail zákazníka';
48var cms_js_lang_orders_delete_confirm = 'Skutočne chcete zmazať zvolené objednávky?';
49var cms_js_lang_orders_message = 'Nepovinná správa k zmene stavu objednávky pre zákazníka';
50var cms_js_lang_orders_change_info_s = 'Zmena stavu objednávky na nový stav:';
51var cms_js_lang_orders_change_info_m = 'Hromadná zmena stavu objednávok na nový stav:';
52var cms_js_lang_orders_change_pick_new = 'vyberte nový stav objednávky';
53var cms_js_lang_orders_confirm_1 = 'Potvrdiť zmenu stavu bez zaslania e-mailu';
54var cms_js_lang_orders_confirm_2 = 'Potvrdiť zmenu a zaslať e-mail zákazníkovi';
55var cms_js_lang_orders_confirm_3 = 'alebo';
56var cms_js_lang_orders_confirm_4 = 'Zaslať email zákazníkovi';
57var cms_js_lang_orders_confirm_5 = 'Vložiť zo šablóny';
58var cms_js_lang_orders_confirm_6 = '- vyberte šablónu správy -';
59var cms_js_lang_orders_confirm_7 = 'Správa šablón';
60var cms_js_lang_orders_confirm_8 = 'uložiť správu do účtu zákazníka';
61var cms_js_lang_orders_confirm_9 = '- pridať novú šablónu -';
62var cms_js_lang_orders_confirm_10 = 'Zmazať šablónu';
63var cms_js_lang_orders_confirm_11 = 'Názov šablóny:';
64var cms_js_lang_orders_confirm_12 = 'Text:';
65var cms_js_lang_orders_confirm_13 = 'Nahrať prílohu ku správe';
66var cms_js_lang_orders_confirm_14 = 'Správa textových šablón';
67var cms_js_lang_orders_confirm_15 = 'Naozaj si prajete zmazať zvolenú šablónu?';
68var cms_js_lang_orders_confirm_16 = 'Vyplňte údaje ku šablóne.';
69var cms_js_lang_orders_confirm_17_add = 'Šablóna bola úspešne pridaná.';
70var cms_js_lang_orders_confirm_17_save = 'Šablóna bola úspešne uložená.';
71var cms_js_lang_orders_confirm_18 = 'Počkajte na dokončenie nahrávania súborov.';
72var cms_js_lang_orders_misc_1 = 'pôvodný adresát: ';
73var cms_js_lang_invoice_next_no_err = 'Faktúra so zadaným číslom už existuje. Zadajte prosím iné.';
74var cms_js_lang_invoice_email = 'Nie je vyplnená e-mailová adresa klienta.';
75var cms_js_lang_invoice_info_1 = 'Faktúra už bola zaslaná.';
76var cms_js_lang_invoice_info_2 = 'Chcete ju napriek tomu znovu zaslať na ';
77var cms_js_lang_invoice_info_3 = 'Skutočne chcete zaslať faktúru na ';
78var cms_js_lang_proforma_invoice_info_1 = 'Predfaktúra už bola zaslaná.';
79var cms_js_lang_proforma_invoice_info_3 = 'Skutočne chcete zaslať predfaktúru na ';
80var js_lang_bulk_discount_import_completed = 'Import množstevných zliav bol úspešne dokončený.';
81
82var cms_js_lang_group_alert = 'Skupina s rovnakým menom už existuje!';
83
84var cms_js_selected_message = {
85	users: {
86		DESELECT: 'Zrušiť výber',
87		SELECTED: 'Označení zákazníci:',
88		SELECTED_ALL: 'Máte označených všetkých vyfiltrovaných zákazníkov',
89		SELECTED_ALL_NO_FILTER: 'Máte označených všetkých zákazníkov',
90		SELECTED_ALL_CUR: 'Všetci zákazníci na stránke sú označený.',
91		SELECT_ALL: 'Označiť zákazníkov na všetkých stranách',
92		SELECT_INFO: '&nbsp;&nbsp;&nbsp;<i>Info: ďalšieho %s zákazníka máte označeného na ostatných stranách.</i>',
93		SELECT_INFO_PLURAL: '&nbsp;&nbsp;&nbsp;<i>Info: ďalších %s zákazníkov máte označených na ostatných stranách.</i>',
94		SELECT_INFO_PLURAL_2: '&nbsp;&nbsp;&nbsp;<i>Info: ďalších %s zákazníkov máte označených na ostatných stranách.</i>'
95	},
96	admins: {
97		DESELECT: 'Zrušiť výber',
98		SELECTED: 'Označení administrátori:',
99		SELECTED_ALL: 'Máte označené všetkých vyfiltrovaných administrátorov',
100		SELECTED_ALL_NO_FILTER: 'Máte označené všetkých administrátorov',
101		SELECTED_ALL_CUR: 'Všetci administrátori na stránke sú označené.',
102		SELECT_ALL: 'Označiť administrátorov na všetkých stranách',
103		SELECT_INFO: '&nbsp;&nbsp;&nbsp;<i>Info: ďalšieho %s administrátora máte označeného na ostatných stranách.</i>',
104		SELECT_INFO_PLURAL: '&nbsp;&nbsp;&nbsp;<i>Info: ďalších %s administrátorov máte označených na ostatných stranách.</i>',
105		SELECT_INFO_PLURAL_2: '&nbsp;&nbsp;&nbsp;<i>Info: ďalších %s administrátorov máte označených na ostatných stranách.</i>'
106	}
107};
108
109var cms_js_lang_admin_user_form_letterman_active = ' - odber noviniek je aktivovaný';
110var cms_js_lang_admin_user_form_letterman_inactive = ' - odber noviniek je deaktivovaný';
111var cms_js_lang_admin_user_form_namedaycoupon_active = ' - odber meninových kupónov je aktivovaný';
112var cms_js_lang_admin_user_form_namedaycoupon_inactive = ' - odber meninových kupónov je deaktivovaný';
113
114var js_lang_admin_login_as_customer_vex_title = 'Zákazník bol nedávno aktívny';
115var js_lang_admin_login_as_customer_vex_last_active = 'Aktívny pred';
116var js_lang_admin_login_as_customer_vex_message = 'Prajete si pokračovať? Zákazník bude týmto odhlásený.';
117var js_lang_admin_login_as_customer_vex_cancel = 'Zrušiť';
118var js_lang_admin_login_as_customer_vex_continue = 'Nákup za zákazníka';
119
120var cms_js_lang_filter_customer_all = 'všetkých zákazníkov';
121var cms_js_lang_filter_customer_registered = 'iba registrovaných zákazníkov';
122var cms_js_lang_filter_customer_unregistered = 'iba neregistrovaných zákazníkov';
123var cms_js_lang_select_customer_group = 'Zvoľte skupinu zákazníkov';
124var cms_js_lang_enter_specific_customer = 'Zadajte konkrétneho zákazníka';
125var cms_js_lang_filter_customer_placeholder = 'meno / e-mail / ulica / mesto / PSČ / tel.';
126
127var csm_js_lang_pw_strength = 'Sila hesla';
128var cms_js_lang_pw_too_short = 'Príliš krátke (min. 6 znakov)';
129var cms_js_lang_pw_weak = 'Slabé';
130var cms_js_lang_pw_medium = 'Priemerné';
131var cms_js_lang_pw_strong = 'Silné';
132
133var cms_js_lang_pw_too_short_hint = '"Príliš krátke" heslo má dĺžku menej ako 6 znakov.';
134var cms_js_lang_pw_weak_hint = '"Slabé" heslo nemá dĺžku 8 znakov, neskladá sa z veľkých písmen, malých písmen a číslic';
135var cms_js_lang_pw_medium_hint = '"Priemerné" heslo nemá dĺžku 12 znakov, neskladá sa z veľkých písmen, malých písmen a číslic.';
136
137
138var cms_js_lang_voucher_delete_title = 'Zmazať poukaz';
139var cms_js_lang_voucher_send = 'Zaslať';
140var cms_js_lang_voucher_send_title = 'Zašle email iba s týmto poukazom.';
141var cms_js_lang_voucher_delete_confirm = 'Skutočne chcete zmazať poukážku';
142var cms_js_lang_voucher_delete_all_confirm = 'Skutočne chcete zmazať všetky poukážky objednávky';
143var cms_js_lang_voucher_send_all_confirm = 'Skutočne chcete zaslať faktúru a všetky poukážky objednávky';
144var cms_js_lang_voucher_send_confirm = 'Skutočne chcete zaslať emailom túto poukážku?';
145var cms_js_lang_voucher_edit_title = 'Upraviť poukaz';
146var cms_js_lang_voucher_enter_pin = 'Pre kontrolu zadajte 4 miestny bezpečnostný kód uvedený v spodnej časti poukazu.';
147var cms_js_lang_voucher_novalid = 'Kód poukazu alebo bezpečnostný kód nie je správny.';
148var cms_js_lang_voucher_desc_title = 'Popis poukazu';
149var cms_js_lang_voucher_pdf_click_title = 'Zobraziť vyúčtovanie PDF. Stlačením alt a kliknutím zobrazíte faktúru PDF k vyúčtovaniu';
150
151var cms_js_loader_working = 'Prebieha spracovanie...';
152
153var cms_js_lang_percent = 'Percentá';
154var cms_js_lang_total = 'Čiastka';
155var cms_js_lang_total_sub = 'Odrátanie čiastky';
156
157var cms_js_lang_credit_note_info_1 = 'Dobropis už bol zaslaný.';
158var cms_js_lang_credit_note_info_2 = 'Chcete ho napriek tomu znovu zaslať na ';
159var cms_js_lang_credit_note_info_3 = 'Skutočne chcete zaslať dobropis na ';
160
161var cms_js_lang_credit_erase_working = 'Pracujem...';
162var cms_js_lang_credit_erase_confirm = 'Skutočne chcete vynulovať kredity všetkým svojim zákazníkom ?';
163var cms_js_lang_credit_erased = 'Kredity všetkých zákazníkov boli úspešne vynulované';
164var cms_js_lang_credit_erase_run = 'Vynulovať';
165
166var cms_js_lang_advanced_credit_system_1 = 'Nemožno uplatniť trvalú zlavu. Máte dostatok volných kreditov?';
167
168var cms_js_lang_products_group_name = 'Meno skupiny produktov';
169var cms_js_lang_products_group_1 = 'Zobraziť zoznam produktov skupiny';
170var cms_js_lang_products_group_2 = 'Uložiť';
171var cms_js_lang_products_group_3 = 'Zrušiť';
172var cms_js_lang_products_group_4 = 'Upraviť';
173var cms_js_lang_products_group_5 = 'Zmazať';
174var cms_js_lang_products_group_6 = 'Pridať skupinu';
175var cms_js_lang_products_group_7 = 'Pridať';
176var cms_js_lang_products_group_8 = 'Odoslať';
177var cms_js_lang_products_group_9 = 'Zatvoriť';
178var cms_js_lang_products_group_10 = 'Objednať';
179var cms_js_lang_products_group_11 = 'Vyprázdniť';
180var cms_js_lang_products_group_12 = 'Vložiť';
181var cms_js_lang_products_group_13 = 'Preložiť';
182var cms_js_lang_products_group_14 = 'Vytvoriť kópiu šablóny';
183var cms_js_lang_products_group_15 = 'Pridať predajcu';
184var cms_js_lang_products_group_16 = 'Uložiť zmeny a zmazať modul';
185var cms_js_lang_products_group_17 = 'Odkaz text';
186var cms_js_lang_products_group_18 = 'Odkaz link';
187var cms_js_lang_products_group_delete_confirm_1 = 'Skupina produktov ';
188var cms_js_lang_products_group_delete_confirm_2 = ', ktorú chcete zmazať má priradených ';
189var cms_js_lang_products_group_delete_confirm_3 = ' produktov. Zmazať je možné iba skupinu, ktorá je prázdna.';
190var cms_js_lang_products_group_delete_confirm_4 = 'Naozaj chcete vymazať skupinu ';
191var cms_js_lang_products_group_lang_empty_input = 'Všetky polia prekladov musia byť vyplnené.';
192var cms_js_lang_payment_meaning_empty = 'Vyberte prosím hodnotu pre "Význam platby"';
193var cms_js_lang_shipping_meaning_empty = 'Vyberte prosím hodnotu pre "Význam dopravy"';
194var cms_js_lang_products_shipping_message_error_1 = ' Chyba ';
195var cms_js_lang_products_shipping_message_error_2 = 'Neznáma chyba';
196var cms_js_lang_products_stock_1 = 'Skladový pohyb bol úspešne vytvorený.';
197var cms_js_lang_products_stock_2 = 'Pri vytváraní skladového pohybu sa vyskytla chyba.';
198var cms_js_lang_products_stock_3 = 'Pridať';
199var cms_js_lang_products_availability_delete = 'Vymazať';
200var cms_js_lang_products_availability_delete_title = 'Vymazať dostupnosť';
201var cms_js_lang_products_availability_delete_message_1 = 'Po vymazaní ';
202var cms_js_lang_products_availability_delete_message_2 = ' produkt prestane';
203var cms_js_lang_products_availability_delete_message_3 = ' produkty prestanú';
204var cms_js_lang_products_availability_delete_message_4 = ' produktov prestane';
205var cms_js_lang_products_availability_delete_message_5 = ' mať uvedenú dostupnosť. Naozaj chcete vymazať vybranú dostupnosť?';
206var cms_js_lang_products_availability_delete_message_6 = 'Naozaj chcete vymazať vybranú dostupnosť?';
207var cms_js_lang_products_manufacturer_delete_message_1 = 'Po vymazaní ';
208var cms_js_lang_products_manufacturer_delete_message_2 = ' produkt prestane';
209var cms_js_lang_products_manufacturer_delete_message_3 = ' produkty prestanú';
210var cms_js_lang_products_manufacturer_delete_message_4 = ' produktov prestane';
211var cms_js_lang_products_manufacturer_delete_message_5 = ' mať uvedeného výrobcu. Naozaj chcete vymazať tohto výrobcu?';
212var cms_js_lang_products_manufacturer_delete_message_6 = 'Naozaj chcete vymazať tohto výrobcu?';
213var cms_js_lang_products_manufacturer_delete_message_7 = 'Naozaj chcete vymazať výrobcu "%s"?';
214var cms_js_lang_claims_delete_confirm = 'Skutočne chcete zmazať zvolené reklamácie?';
215var cms_js_lang_select_manufacturer = 'Zvoľte výrobcu';
216//
217var cms_js_lang_products_supplier_delete_message_1 = 'Po vymazaní ';
218var cms_js_lang_products_supplier_delete_message_2 = ' produkt prestane';
219var cms_js_lang_products_supplier_delete_message_3 = ' produkty prestanú';
220var cms_js_lang_products_supplier_delete_message_4 = ' produktov prestane';
221var cms_js_lang_products_supplier_delete_message_5 = ' mať uvedeného dodávateľa. Naozaj chcete vymazať tohto dodávateľa?';
222var cms_js_lang_products_supplier_delete_message_6 = 'Naozaj chcete vymazať tohto dodávateľa?';
223//
224var cms_js_lang_products_tax_rate = 'Sadzba DPH';
225var cms_js_lang_products_tax_delete = 'Naozaj chcete zmazať sadzbu DPH?';
226var cms_js_lang_products_duplicate_add_finish_first = 'Pred vytvorením kópie produktu je potrebné najskôr ukončiť pridanie nového produktu.';
227var cms_js_lang_products_duplicate_product_name_changed = 'Zmeňte názov produktu, aby bol iný ako názov pôvodného, prosím.';
228var cms_js_lang_customer_customer_search = 'zadajte meno / e-mail zákazníka';
229var cms_js_lang_customer_password_notmatched = 'Heslá sa nezhodujú.';
230var cms_js_lang_customer_delete_confirm = 'Naozaj chcete zmazať zvolených zákazníkov?';
231var cms_js_lang_customer_administrator_delete_confirm = 'Naozaj chcete zmazať zvolených administrátorov?';
232var cms_js_lang_content_product_added_add_another = 'Produkt bol úspešne pridaný&hellip; môžete pridať ďalší produkt';
233var cms_js_lang_content_product_added_add_another_copied = 'Produkt bol úspešne pridaný&hellip; môžete pridať ďalší produkt s podobnými údajmi';
234var cms_js_lang_content_product_add = 'Pridať produkt';
235var cms_js_lang_content_product_edited = 'Produkt "%s" bol úspešne upravený';
236var cms_js_lang_content_product_related_removed = 'Produkt bol zmazaný zo zoznamu';
237var cms_js_lang_content_products_delete_confirm = 'Skutočne chcete zmazať zvolené produkty? Počet produktov na zmazanie: %s.'; // %s = pocet
238var cms_js_lang_content_products_tax_select = '- zvolte DPH -';
239var cms_js_lang_content_products_tax_add = '- pridať novú DPH -';
240var cms_js_lang_content_panel_layout = 'Rozdelenie web stránky';
241var cms_js_lang_content_panel_layout_title_1 = 'Rozdelenie - 3 stĺpce';
242var cms_js_lang_content_panel_layout_title_2 = 'Rozdelenie - 2 stĺpce';
243var cms_js_lang_content_panel_layout_title_3 = 'Rozdelenie - 3 stĺpce';
244var cms_js_lang_content_panel_layout_title_4 = 'Rozdelenie - 2 stĺpce';
245var cms_js_lang_content_panel_bin_used = 'Použité moduly';
246var cms_js_lang_content_panel_bin_new = 'Nepoužité moduly';
247var cms_js_lang_content_panel_restart = 'Skutočne chcete vykonať návrat na pôvodné rozloženie stránky?';
248var cms_js_lang_content_panel_restart_title = 'Návrat na pôvodné rozloženie stránky.';
249var cms_js_lang_content_modules_info = 'Skrýva sa pravá časť, moduly patriace do nej boli presunute do Zásobníka použitých modulov';
250var cms_js_lang_content_modules_move = 'Presunúť do zásobníka nepoužitých modulov';
251var cms_js_lang_content_modules_move_btn = 'Presunúť';
252var cms_js_lang_content_modules_move_title = 'Presunúť modul/y';
253var cms_js_lang_content_modules_moving = 'Skrývam modul do zásobníka použitých modulov';
254var cms_js_lang_content_modules_delete = 'Zmazať modul';
255var cms_js_lang_content_modules_delete_confirm = 'Naozaj chcete zmazať tento modul?';
256var cms_js_lang_content_modules_change_name = 'Zmeniť názov';
257var cms_js_lang_content_modules_hide_name = 'Skryť názov';
258var cms_js_lang_content_modules_show_name = 'Zobraziť názov';
259var cms_js_lang_content_modules_show_where = 'Zobraziť modul na';
260var cms_js_lang_content_article_show_where = 'Zobraziť článok na';
261var cms_js_lang_content_modules_show_where_btn = 'Zobraziť na...';
262var cms_js_lang_content_modules_show_params = 'Parametre';
263var cms_js_lang_content_modules_disable_devices = 'Zobraziť na zariadeniach';
264var cms_js_lang_content_choose_one_option = 'Zvoľte aspoň 1 z možností';
265var cms_js_lang_content_modules_edit = 'Úprava modulu';
266var cms_js_lang_content_module_title_edit = 'Úprava názvu';
267var cms_js_lang_content_modules_show_image_params = 'Obrázky';
268var cms_js_lang_content_modules_hide = 'Skryť modul';
269var cms_js_lang_content_modules_save = 'Uložiť';
270var cms_js_lang_content_modules_quick_title = 'Zobraziť tento modul:';
271var cms_js_lang_content_modules_display_only_for_admin = 'iba pre administrátora';
272var cms_js_lang_content_modules_this_page = 'iba na tejto stránke *';
273var cms_js_lang_content_modules_this_category = 'iba v produktoch tejto kategórie*';
274var cms_js_lang_content_modules_all_pages = 'na všetkých stránkach';
275var cms_js_lang_content_modules_select_page = 'vybrať si stránky...';
276var cms_js_lang_content_modules_basic_setting = '* základné nastavenie';
277var cms_js_lang_content_modules_cancel = 'Zrušiť';
278var cms_js_lang_content_modules_redirect = 'Presmerovať';
279var cms_js_lang_content_modules_image_upload = 'Nahrať obrázok';
280var cms_js_lang_content_modules_image_change = 'Zmeniť obrázok';
281var cms_js_lang_content_modules_group_products_group = 'Skupina produktov';
282var cms_js_lang_content_modules_group_products_count = 'Počet produktov v skupine:';
283var cms_js_lang_content_modules_group_products_ordering = 'Zoradenie produktov:';
284var cms_js_lang_content_modules_group_products_ordering_1 = 'manuálne';
285var cms_js_lang_content_modules_group_products_ordering_2 = 'náhodné pre 1 deň';
286var cms_js_lang_content_modules_group_products_ordering_3 = 'vždy náhodné';
287var cms_js_lang_content_modules_group_products_ordering_12 = 'dátumu pridania';
288var cms_js_lang_content_modules_group_products_ordering_13 = 'dátumu pridania do skupiny';
289var cms_js_lang_content_menu_item_drag_title = 'Zmeniť poradie';
290var cms_js_lang_content_text_change = 'Zmeniť text';
291var cms_js_lang_content_structure_change = 'Zmeniť HTML';
292var cms_js_lang_content_text_change_edit = 'Úprava textu modulu ';
293var cms_js_lang_content_text_change_tooltip = 'Kliknutím môžete zmeniť obsah modulu';
294var cms_js_lang_content_footer_change_edit = 'Úprava textu pätičky';
295var cms_js_lang_content_footer_change_tooltip = 'Kliknutím môžete zmeniť obsah pätičky';
296var cms_js_lang_content_footer_1 = 'pätičky';
297var cms_js_lang_content_article_change_position = 'Zmeniť poradie článkov';
298var cms_js_lang_content_article_change_position_finish = 'Ukončiť zmenu poradia';
299var cms_js_lang_content_article_change_position_cancel = 'Zrušiť zmenu poradia';
300var cms_js_lang_content_article_edit = 'Upraviť článok';
301var cms_js_lang_content_article_delete = 'Zmazať článok';
302var cms_js_lang_content_article_delete_confirm = 'Naozaj chcete zmazať článok?';
303var cms_js_lang_content_article_move_1 = 'Zobraziť stránku "';
304var cms_js_lang_content_article_move_2 = '" po presune článku?';
305var cms_js_lang_content_article_move_title = 'Zmeniť poradie';
306var cms_js_lang_content_topmenu_delete_confirm = 'Naozaj chcete zmazať položku menu?';
307var cms_js_lang_content_topmenu_change_typ_confirm = 'Naozaj si želáte zmeniť menu položku z typu stránka na typ Odkaz (URL adresa)? \n \n Upozornenie: táto akcia vymaže vytvorený obsah stránky, jej prípadné články a jej špecifické moduly.';
308var cms_js_lang_content_topmenu_change_typ_confirm_blog = 'Naozaj si želáte zmeniť menu položku z typu Blog na typ Odkaz (URL adresa)? \n \n Upozornenie: táto akcia vymaže vytvorený obsah stránky, jej prípadné články a jej špecifické moduly.';
309var cms_js_lang_content_topmenu_change_typ_okmsg = 'Položka <strong>%n</strong> bola úspešne zmenená na typ URL <strong>%s</strong>.';
310var cms_js_lang_content_topmenu_alert_1 = 'Nie je možné pridať novú položku do menu - jeho položky už zaberajú celú jeho šírku.';
311var cms_js_lang_content_item_add = 'Pridať položku';
312var cms_js_lang_content_no_category_selectd = 'Vyberte si kategóriu zo stromu kategórií.';
313var cms_js_lang_content_category_add = 'Pridať kategóriu';
314var cms_js_lang_content_category_add_sub = 'Pridať podkategóriu';
315var cms_js_lang_content_category_add_name = 'Názov menu položky';
316var cms_js_lang_content_category_add_confirm = 'Pridať';
317var cms_js_lang_content_category_add_label = 'Pridanie kategórie:';
318var cms_js_lang_content_category_add_success = 'Kategória bola úspešne pridaná.';
319var cms_js_lang_content_category_edit_success = 'Kategória bola úspešne zmenená.';
320var cms_js_lang_content_category_move_success = 'Kategória bola úspešne presunutá.';
321var cms_js_lang_content_category_delete_success = 'Kategória bola úspešne zmazaná.';
322var cms_js_lang_category_without_category = 'bez priradenej kategórie';
323var cms_js_lang_category_without_category_title = 'odoberie všetky kategórie';
324var cms_js_lang_category_radio_set_only = 'Nastaviť iba';
325var cms_js_lang_category_radio_add_also = 'Pridať aj';
326var cms_js_lang_category_radio_del_only = 'Odobrať';
327var cms_js_lang_category_radio_label = ' kategórie zvolené nižšie:';
328var cms_js_lang_category_change = 'Zmeniť:';
329var cms_js_lang_category_radio_label_1 = 'Kategórie produktov';
330var cms_js_lang_product_param_label = 'Parametre produktov';
331var cms_js_lang_category_radio_label_2 = 'Primárnu kategóriu produktov';
332var cms_js_lang_primary_category_change = 'Zmena primárnej kategórie ';
333var cms_js_lang_primary_category_change_span_text = 'Nastaviť jednu vybranú primárnu kategóriu ';
334var cms_js_lang_category_change_1 = 'Hromadná zmena kategórií ';
335var cms_js_lang_category_change_2 = ' zvolených produktov';
336var cms_js_lang_category_change_2_1 = ' zvoleného produktu';
337var cms_js_lang_category_change_3 = ' zvoleným produktom:<br><i>(produkty budú do kategórie aj zaradené, ak ešte nie sú)</i>';
338var cms_js_lang_category_change_3_1 = ' zvolenému produktu:<br><i>(produkt bude do kategórie aj zaradený, ak ešte nie je)</i>';
339var cms_js_lang_content_edit_categories_label = 'Úprava kategórií:';
340var cms_js_lang_content_edit_category_label = 'Úprava kategórie: %s';
341var cms_js_lang_content_edit_category_show_selected = 'Zobraziť iba označené kategórie';
342var cms_js_lang_content_edit_category_vex_tooltip = 'V tejto sekcii môžete jednoducho a efektívne spravovať kategórie produktov: <br> - pridať novú kategóriu, upraviť existujúcu, zmeniť ich poradie a zaradenie v strome.';
343var cms_js_lang_content_category_save = 'Uložiť';
344var cms_js_lang_content_category_cancel = 'Zrušiť';
345var cms_js_lang_content_category_edit = 'Upraviť kategóriu';
346var cms_js_lang_content_category_delete = 'Zmazať';
347var cms_js_lang_content_category_delete_confirm = 'Naozaj chcete zmazať kategóriu?';
348var cms_js_lang_content_category_delete_confirm_cat = 'Naozaj chcete zmazať kategóriu %s?';
349var cms_js_lang_content_category_add_disabled = 'Kategóriu nie je možné pridať pretože sa presiahlo maximálne vnorenie';
350var cms_js_lang_content_category_add_disabled_for_alias = 'Kategóriu nie je možné pridať, pretože je aliasom inej kategórie';
351var cms_js_lang_content_category_delete_disabled = 'Kategóriu nie je možné zmazať pretože obsahuje podkategórie';
352var cms_js_lang_content_category_move_confirm = 'Kategória bude presunutá pod inú kategóriu. Prajete si pokračovať?';
353var cms_js_lang_content_category_show_all_products = 'Zoznam produktov v kategórii %s';  // %s - nazov kategorie
354var cms_js_lang_content_category_translate = 'Preložiť';
355var cms_js_lang_content_category_translate_all = 'Preložiť všetko';
356var cms_js_lang_content_category_alias_for = 'Odkaz na kategóriu';
357var cms_js_lang_orders_x = 'Objednávok:';
358var cms_js_lang_customers_x = 'Zákazníkov:';
359var cms_js_lang_income_x = 'Príjem:';
360var cms_js_lang_content_alert_1 = 'Neznáma chyba.';
361var cms_js_lang_content_alert_2 = 'Zadajte prosím názov kategórie.';
362var cms_js_lang_content_alert_3 = 'Zadajte prosím čitatelnú URL kategórie.';
363var cms_js_lang_content_alert_4 = 'Zadajte prosím názov položky menu.';
364var cms_js_lang_content_alert_5 = 'Zadajte prosím čitatelnú URL položky menu.';
365var cms_js_lang_content_alert_6 = 'Túto položku nie je možné presunúť do hlavného menu - jeho položky už zaberajú celú jeho šírku.';
366var cms_js_lang_content_alert_7 = 'Prosím ukončite najskôr úpravu ';
367var cms_js_lang_content_alert_8 = 'Zadajte sadzbu DPH.';
368var cms_js_lang_content_alert_9 = 'Chybne zadaná sadzba DPH.';
369var cms_js_lang_content_alert_10 = 'Vyplňte a vyberte prosím povinné položky označené hviezdičkou.';
370var cms_js_lang_content_alert_11 = '';
371var cms_js_lang_content_alert_12 = 'Žial už nie je možné vpísať viac znakov, pretože by sa menu položka nezmestila do menu.';
372var cms_js_lang_content_alert_13 = 'Žial už nie je možné vpísať viac znakov, pretože bola dosiahnutá maximálna dĺžka krátkeho popisu (#COUNT# zn
372akov).';
373var cms_js_lang_content_alert_14 = 'Túto položku nie je možné vymazať, pretože má podpoložky.';
374var cms_js_lang_content_alert_15 = 'Čitatelná url sa zmenila a môže byť použitá.';
375var cms_js_lang_content_alert_16 = 'Čitatelnú url je potrebné zmeniť pretože sa už v systéme používa.';
376var cms_js_lang_content_alert_17 = 'Overenie čitatelnej url adresy zlyhalo.';
377var cms_js_lang_content_alert_18 = 'Čitatelná url položka musí byť vyplnená a nesmie sa zhodovať so žiadnou už existujúcou.';
378var cms_js_lang_content_alert_19 = 'Systémovú položku nie je možné vymazať.';
379var cms_js_lang_content_alert_20 = 'položku nie je možné vymazať (nachádza sa v objednávkach za posledný mesiac)';
380var cms_js_lang_customer_password_strength = '<strong>Vysvetlenie pojmu "Sila hesla":</strong><br /><br /><strong>"Príliš krátke"</strong> heslo má dĺžku menej ako 6 znakov.<br /><strong>"Silné"</strong> heslo ma dĺžku najmenej 12 znakov, skladá sa z velkých písmen, malých písmen a číslic.<br /><strong>"Priemerné"</strong> heslo má dĺžku najmenej 8 znakov, skladá sa z velkých a malých písmen, alebo z velkých písmen a číslic, alebo z malých písmen a číslic.<br /><strong>"Slabé"</strong> heslo je horšie ako "Priemerné" heslo v niektorom z jeho parametrov.';
381var cms_js_lang_product_availability_name = 'Dodacia lehota';
382var cms_js_lang_product_availability_duplicity = 'Zadaná dodacia lehota už existuje.';
383var cms_js_lang_product_availability_inserted = 'Dodacia lehota bola pridaná.';
384var cms_js_lang_product_availability_update_fail = 'Nepodarilo sa upraviť danú dodaciu lehotu.';
385var cms_js_lang_product_availability_updated = 'Dodacia lehota bola upravená.';
386var cms_js_lang_product_availability_deleted = 'Dodacia lehota bola zmazaná.';
387var cms_js_lang_product_manufacturer_name = 'Názov výrobcu';
388var cms_js_lang_product_manufacturer_duplicity = 'Zadaný výrobca už existuje.';
389var cms_js_lang_product_manufacturer_edit_fail = 'Nepodarilo sa upraviť výrobcu.';
390var cms_js_lang_product_manufacturer_edit_success = 'Výrobca bol upravený.';
391var cms_js_lang_product_manufacturer_insert_fail = 'Nepodarilo sa pridať nového výrobcu.';
392var cms_js_lang_product_manufacturer_deleted = 'Výrobca bol zmazaný.';
393
394var cms_js_lang_price_history_delete_message = 'Naozaj si želáte hromadne zmazať históriu cien na <strong> %s </strong> zvolených produktoch?';
395var cms_js_lang_price_history_delete_title = 'Zmazanie histórie cien';
396var cms_js_lang_price_history_confirm_number = 'Prosím zadajte číslo <strong> %s </strong> (počet produktov, ktorým sa zmaže cenová história)'
397var cms_js_lang_price_history_success = 'Cenová história bola zmazaná pre %s produktov';
398var cms_js_lang_price_history_fail = 'Chyba, zadali ste nesprávny počet zvolených produktov. Skúste to znova.';
399
400var cms_js_lang_mass_shopper_group_change_confirm_title = 'Priradiť %count zákazníkov';
401var cms_js_lang_mass_shopper_group_change_confirm_content = 'Naozaj ste si istý, že chcete <strong>%count</strong> zákazníkov presunúť do zadanej zákazníckej skupiny? <br><br> Prosím zadajte číslo <strong> %count </strong> (počet všetkých označených zákazníkov) <br><br>';
402var cms_js_lang_mass_shopper_group_change_title = 'Zmena zákazníckej skupiny';
403var cms_js_lang_mass_shopper_group_change_success = 'Úspešne zmenené zákaznícke skupiny';
404
405var cms_js_lang_product_seller_name = 'Názov predajcu';
406var cms_js_lang_product_seller_delete = 'Naozaj chcete zmazať tohto predajcu?';
407
408//
409var cms_js_lang_product_supplier_name = 'Názov dodávateľa';
410var cms_js_lang_product_supplier_duplicity = 'Zadaný dodávateľ už existuje.';
411var cms_js_lang_product_supplier_edit_fail = 'Nepodarilo sa upraviť dodávateľa.';
412var cms_js_lang_product_supplier_edit_success = 'Dodávateľ bol upravený.';
413var cms_js_lang_product_supplier_insert_fail = 'Nepodarilo sa pridať nového dodávateľa.';
414var cms_js_lang_product_supplier_deleted = 'Dodávateľ bol zmazaný.';
415//
416var cms_js_lang_always = ' - vždy -';
417var cms_js_lang_change_sef_name = 'Zmena čitatelnej URL môže spôs
417obiť zníženie pozície (resp. PageRank-u)\nkonkrétnej stránky na GOOGLE. Naozaj pokračovať?';
418var cms_js_lang_close = 'Zavrieť';
419var cms_js_lang_order_items_changes_prod_quant_nonzero_warn = 'Zadané množstvo musí byť celé číslo väčšie ako nula.';
420var cms_js_lang_order_items_changes_chng_ord_nonzero_warn = 'Hodnotu položky nie je možné zmeniť, nakoľko celková suma objednavky by nebola väčšia ako nula.';
421var cms_js_lang_order_items_changes_other_quant_warn = 'Zadané množstvo musí byť iné ako pôvodné.';
422var cms_js_lang_order_items_changes_check_stock_limit_warn = 'Položke objednávky nie je možné zmeniť množstvo na zadanú hodnotu, z dôvodu zapnutej kontroly skladových zásob. Najvyššia možná hodnota pre množstvo je';
423var cms_js_lang_order_items_changes_equal_quant_warn = 'Položke objednávky nebolo zmenené množstvo, pretože ste zadali rovnakú hodnotu.';
424var cms_js_lang_order_items_changes_chng_ord_quest_01 = 'Chcete zmeniť objednávku aj napriek tomu, že po zmene jej celková suma v hodnote';
425var cms_js_lang_order_items_changes_chng_ord_quest_02 = 'bude nižšia ako minimálna suma objednávky v hodnote';
426var cms_js_lang_order_items_changes_only_one_ord_item = 'Položku objednávky nie je možné zmazať, pretože objednávka obsahuje iba túto jednu položku';
427var cms_js_lang_order_items_changes_del_ord_item_quest = 'Zmazať z objednávky položku číslo';
428var cms_js_lang_order_items_changes_put_or_sel_prod_sku = 'Prosím zadajte alebo vyberte';
429var cms_js_lang_order_items_changes_mass_invoice_creation = 'Prebieha hromadné vytváranie faktúr. Táto operácia môže chvílu trvať. Prosím, neobnovujte stránku.';
430var cms_js_lang_order_items_changes_lower_like_coupon_warn = 'Položku objednávky nie je možné zmazať, pretože:<br> - suma objednávky by bola následne nižšia ako hodnota kupónu.';
431var cms_js_lang_order_items_changes_lower_like_minimal_value = 'Položku objednávky nie je možné zmazať, pretože:<br> - suma objednávky by bola následne nižšia ako minimálna hodnota objednávky.';
432var cms_js_lang_order_print_sku = 'Kód produktu';
433var cms_js_lang_order_print_sku_form = 'Kód:';
434var cms_js_lang_display = 'Zobraziť';
435var cms_js_lang_hide = 'Skryť';
436var cms_js_lang_delete = 'Zmazať';
437var cms_js_lang_change = 'Zmeniť';
438var cms_js_lang_order_items_changes_dupli_ord_item = 'Novú položku objednávky nie je možné pridať, pretože objednávka už obsahuje inú položku s rovnakým kódom produktu';
439var cms_js_lang_order_items_changes_unknown_prod_sku = 'Novú položku objednávky nie je možné pridať, pretože ste zadali neexistujúci údaj pre';
440var cms_js_lang_products_filter_entry_search = 'zadajte názov alebo kód produktu';
441var cms_js_lang_products_filter_entry_search_variant = 'zadajte identifikátor variantu';
442var cms_js_lang_order_number_entry_search = 'zadajte číslo objedn.';
443var cms_js_lang_claim_number_entry_search = 'zadajte číslo rekl.';
444var cms_js_lang_dobropis_number_entry_search = 'zadajte číslo dobr.';
445var cms_js_lang_system_account_changed = 'Váš účet bol úspešne upravený';
446var cms_js_lang_content_leadimg_tooltip = 'Kliknutím môžete upraviť hlavičku';
447var cms_js_lang_content_leadimg_web_name = 'Názov e-shopu:';
448var cms_js_lang_content_leadimg_web_desc = 'Slogan e-shopu:';
449var cms_js_lang_content_leadimg_def_web_name = 'Názov e-shopu';
450var cms_js_lang_content_leadimg_def_web_desc = 'Slogan e-shopu';
451var cms_js_lang_content_leadimg_change_header_height = 'Zmeniť výšku hlavičky';
452var cms_js_lang_content_leadimg_change_header_save = 'Uložiť výšku';
453var cms_js_lang_content_leadimg_banner_upload_notice = 'Šírku nahrávaného obrázka odporúčame mať 940px, výšku 200px.';
454
455var cms_js_lang_admin_param_group_delete_title = 'Naozaj si prajete zmazať sadu parametrov <b>{group}</b>?';
456var cms_js_lang_admin_param_group_delete_input = 'Zmazaním sady parametrov, neprídete o vytvorené parametre ani o ich hodnoty pri produktoch. Paramatre aj produkty ostanú bez priradenej sady parametrov.<br><br>Aby sa parametre znova zobrazovali je potrebné ich priradiť k novej sade paremtrov a tú nastaviť produktom.<br><br>Bude ovplyvnených:<b><br>• {XYproducts}{products}<br>• {XYparams} {params}.</b>';
457var cms_js_lang_admin_param_group_delete_sortiment = 'Touto akciou prídete aj o priradenie sortimentov. Túto sadu majú ako sortiment nastavené:<br><b>• {XYsortiments} {params}.</b>';
458
459var cms_js_lang_content_mod_discount_product_start_date = 'Začiatok akcie';
460var cms_js_lang_content_mod_discount_product_end_date = 'Ukončenie akcie';
461var cms_js_lang_content_mod_discount_product_name = 'Názov akcie';
462var cms_js_lang_content_mod_discount_product_text = 'Text (napr. "Do konca zostáva")';
463
464var cms_js_lang_system_first_login_invitation = '<div><div><h3>Ďakujeme Vám za záujem o vyskúšanie e-shop riešenia Skvelý Shop.</h3> K dispozícii máte 15 dní na bezplatné nezáväzné vyskúšanie e-shop riešenia Skvelý Shop v plnej verzii - balík PREMIUM.<br /><br />V tomto období si môžete navrhnúť Váš e-shop, jeho dizajn a napĺňať ho reálnymi dátami. Pred ukončením obdobia pre vyskúšanie si môžete zvoliť balík služieb, ktorý Vám bude najviac vyhovovať spolu so subdoménou, na ktorej bude Váš e-shop prevádzkovaný.</div><br /><div>Návrh Vášho e-shopu je automaticky ukladaný a všetky dáta sú bezpečne zachované.</div><br /><div>Odporúčame Vám pozrieť si inštruktážne videá, ktoré Vám pribl
464ížia jednoduchosť práce v systéme Skvelý Shop, nájdete ich v sekcii Video manuály v administrácii vpravo hore vedla Váš účet.</div><br/><div>V prípade akýchkolvek otázok nás neváhajte kontaktovať. Váš Skvelý Shop tím.</div><div class="cleaner">&nbsp;</div></div>';
465
466var cms_js_lang_system_first_login_invitation_boom = '<div><div><h3>Ďakujeme Vám za záujem o vyskúšanie e-shop riešenia BOOM Shop.</h3> K dispozícii máte 15 dní na bezplatné nezáväzné vyskúšanie e-shop riešenia BOOM Shop v plnej verzii - balík EXCLUSIVE.<br /><br />V tomto období si môžete navrhnúť Váš e-shop, jeho dizajn a napĺňať ho reálnymi dátami. Pred ukončením obdobia pre vyskúšanie si môžete zvoliť balík služieb, ktorý Vám bude najviac vyhovovať spolu so subdoménou, na ktorej bude Váš e-shop prevádzkovaný.</div><br /><div>Návrh Vášho e-shopu je automaticky ukladaný a všetky dáta sú bezpečne zachované.</div><br /><div>Odporúčame Vám pozrieť si inštruktážne videá, ktoré Vám priblížia jednoduchosť práce v systéme BOOM Shop, nájdete ich v sekcii Video manuály v administrácii vpravo hore vedla Váš účet.</div><br/><div>V prípade akýchkolvek otázok nás neváhajte kontaktovať. Váš BOOM Shop tím.</div><div class="cleaner">&nbsp;</div></div>';
467
468// var cms_js_lang_system_first_login_invitation_free = '<div><div><h3>Ďakujeme za objednanie e-shop riešenia Skvelý Shop.</h3> K dispozícii máte 15 dní na vyskúšanie e-shop riešenia Skvelý Shop v plnej verzii - balík PREMIUM, po skončení 15-dňovej skúšobnej prevádzky sa balík PREMIUM zmení na Vami vybraný balík %s.</div><br /><div>Návrh Vášho e-shopu je automaticky ukladaný a všetky dáta sú bezpečne zachované.</div><br /><div>Odporúčame Vám pozrieť si inštruktážne videá, ktoré Vám priblížia jednoduchosť práce v systéme Skvelý Shop, nájdete ich v sekcii Video manuály v administrácii vpravo hore vedla Váš účet.</div><br/><div>V prípade akýchkolvek otázok nás neváhajte kontaktovať. Váš Skvelý Shop tím.</div><div class="cleaner">&nbsp;</div></div>';
469var cms_js_lang_system_first_login_invitation_free = '<div><div><h3>Vážený zákazník,</h3> ďakujeme Vám za prejavený záujem o Skvelý Shop FREE a veríme, že ste s ním boli spokojný.</div><div>Tento balík sme bol našej ponuke viac ako 2 roky (čo je dlhšie ako sme plánovali) a rozhodli sme sa ho už ďalej neponúkať.</div><br /><div>Od pondelka 15.04.2013 Vám bude tento balík zmenený naspäť na Skúšobnú prevádzku s možnosťou zvolenia si niektorého z platených balíkov - MINI, PROFI a PREMIUM.</div><br/><div>Naozaj pracujeme na systéme každý deň a veríme, že našu prácu výberom plateného balíka oceníte.<br/>Napr. pri balíku MINI v cene 9 EUR / mes. ide o minimálnu položku.</div><br/><div>Ďakujeme, váš Skvelý Shop team.</div><div class="cleaner">&nbsp;</div></div>';
470
471var cms_js_lang_you_have_free_shipping = 'Máte dopravu zdarma.';
472var cms_js_lang_system_cfg_delete_payment_method = 'Naozaj chcete zmazať zvolené spôsoby pre platby?';
473var cms_js_lang_system_cfg_delete_shipping_rate = 'Naozaj chcete zmazať zvolené spôsoby dopravy?';
474var cms_js_lang_shipping_rate_duplicate_title = 'Kopírovať spôsob dopravy';
475var cms_js_lang_my_account_wrong_username_format = 'Používatelské meno musí byť vo formáte e-mailovej adresy.';
476var cms_js_lang_new_account_no_product_results = 'Neboli nájdené žiadne zakúpené produkty.';
477
478var cms_js_lang_leadimg_reset_values = 'Pôvodné nastavenie hlavičky';
479var cms_js_lang_leadimg_reset_values_confirm = 'Naozaj si prajete pôvodné nastavenie textov hlavičky (ich farba, velkosť a pozícia) ako aj pôvodný obrázok hlavičky?';
480var cms_js_lang_leadimg_jpicker_new = 'nová';
481var cms_js_lang_leadimg_jpicker_current = 'aktuálna';
482var cms_js_lang_leadimg_jpicker_drag_and_pick = 'Presuňte krúžok a tým vyberiete farbu';
483var cms_js_lang_leadimg_jpicker_more_options = 'Viac možností&nbsp;&gt;';
484var cms_js_lang_leadimg_qq_upload_button = 'Nahrať nový obrázok hlavičky';
485var cms_js_lang_leadimg_move_texts_info = 'Pozíciu textov zmeníte pretiahnutím myšou na nové miesto.';
486//var cms_js_lang_leadimg_banner_notice = 'Některé designy jsou navrženy tak, že standardně nepodporují vložení jiného obrázku do záhlaví stránek.';
487//var cms_js_lang_leadimg_banner_wrong_template = 'To se týká i tohoto designu, který máte aktuálně zvolen. V případě, že si přejete v takovém designu přesto mít vlastní obrázek, prosím kontaktujte nás, pokusíme se vám pomoci.';
488var cms_js_lang_products_edit_product_title = 'Úprava produktu';
489var cms_js_lang_cart_product_is_unsaleable_msg = 'Ľutujeme, produkt je nepredajný';
490var cms_js_lang_last_product_piece_warn = 'Čoskoro sa vypredá';
491var cms_js_lang_last_product_piece_txt1 = 'Posledný kus. Čoskoro sa vypredá! Kupuj lebo nebude!';
492var cms_js_lang_last_product_piece_txt2 = 'Posledné 2 kusy. Čoskoro sa vypredá!';
493var cms_js_lang_last_product_piece_txt3 = 'Viac ako 2 kusy';
494var cms_js_lang_cart_product_is_in_stock = 'produkt je na sklade';
495var cms_js_lang_cart_product_is_not_in_stock = 'produkt nie je na sklade';
496var cms_js_lang_cart_remove_product_qestion = 'Prajete si odstrániť produkt z nákupného košíka?';
497var cms_js_lang_content_def_category_sef_1 = 'kategoria-produktov-1';
498var cms_js_lang_content_def_category_sef_2 = 'kategoria-produktov-2';
499var cms_js_lang_content_def_category_sef_3 = 'kategoria-produktov-3';
500var cms_js_lang_content_def_category_sef_4 = 'kategoria-produktov-4';
501var cms_js_lang_users_add_user_group = 'pridať novú skupinu';
502var cms_js_lang_users_add_user_group_def_text = 'Názov skupiny';
503var cms_js_lang_users_add_user_group_fill_name = 'Vyplňte prosím názov skupiny.';
504var cms_js_lang_forbbiden_sgp_change_tooltip = 'Zmena zákazníckej skupiny nie je možná, nakoľko už existuje iný účet s rovnakou e-mailovou adresou. Zmenu zákazníckej skupiny môžete vykonať pri druhom účte zákazníka.';
505var cms_js_lang_display_on_save_empty_warning = 'Zvolte aspoň jednu stránku internetového obchodu, na ktorej si prajete modul zobrazovať.';
506var cms_js_lang_sitemap_title = 'Meta nadpis';
507var cms_js_lang_sitemap_desc = 'Meta popis stránky';
508var cms_js_lang_sitemap_kyewo = 'Meta klúčové slová';
509var cms_js_lang_SEO_meta_article = 'SEO dáta článku';
510var cms_js_lang_SEO_meta_category = 'Meta dáta kategórie';
511var cms_js_lang_SEO_meta_menu = 'SEO dáta menu položky';
512var cms_js_lang_SEO_title = 'Meta Názov';
513var cms_js_lang_SEO_desc = 'Meta Popis';
514var cms_js_lang_SEO_kwrds = 'Meta Klúčové slová';
515var cms_js_lang_SEO_save_ok = 'Zmeny metadát boli uložené.';
516var cms_js_lang_canonical_url = 'Kanonická URL';
517var js_lang_ssp_cms_order_eshop_title = 'Objednávka balíka e-shop riešenia Skvelý Shop';
518var js_lang_ssp_cms_order_eshop_title_new = 'Objednávka nového balíka e-shop riešenia Skvelý Shop';
519var js_lang_ssp_cms_order_eshop_info = '<div class="ssp_tooltip_info">Po prijatí objednávky Vás budeme kontaktovať s ďalšími inštrukciami.<br />Ďakujeme Vám za prejavenú dôveru a tešíme sa na úspešnú spoluprácu.<br />Váš Skvelý Shop tím.</div>';
520var js_lang_ssp_cms_order_eshop_email = 'Zadajte Vašu e-mailovú adresu:';
521var js_lang_ssp_cms_order_eshop_email_def_text = '[email protected]';
522var js_lang_ssp_cms_order_eshop_email_error = 'Vyplňte prosím Vašu e-mailovú adresu.';
523var js_lang_ssp_cms_order_eshop_bundle = 'Zvolte si balík:';
524var js_lang_ssp_cms_order_eshop_phone = 'Zadajte Vaše telefónne číslo:';
525var js_lang_ssp_cms_order_eshop_phone_def_text = '+421 Vaše tel.č.';
526var js_lang_ssp_cms_order_eshop_phone_error = 'Vyplňte prosím Vaše telefónne číslo.';
527var js_lang_ssp_cms_order_sent = 'Vaša objednávka e-shopu Skvelý Shop bola úspešne odoslaná.';
528var js_lang_ssp_cms_order_sent_paid1 = 'Objednávka e-shopu Skvelý Shop - balík';
529var js_lang_ssp_cms_order_sent_paid2 = 'bola úspešne odoslaná. Ďalšie inštrukcie ohladom fakturácie Vám pošleme mailom.';
530//var js_lang_ssp_order_eshop_package_date_1 = 'Už len 12 dní.';
531//var js_lang_ssp_order_eshop_package_date_2 = '15 už vypršalo dní.';
532var js_lang_ssp_order_eshop_agree_to_toc = 'Súhlasím so <a href="http://www.skvelyshop.sk/SkvelyShop_VOP.pdf" target="_blank">Všeobecnými podmienkami SkvelyShop.sk</a>';
533var js_lang_ssp_cms_order_eshop_agree_to_toc_error = 'Pred objednaním je potrebné súhlasiť so Všeobecnými podmienkami SkvelyShop.sk.';
534var js_lang_ssp_cms_order_test_eshop_valid_info = 'Do skončenia Vašej skúšobnej prevádzky %s.';
535var js_lang_ssp_cms_order_test_eshop_valid_info_days = ['zostáva neznámy počet dní', 'zostáva 1 deň', 'zostávajú 2 dni', 'zostávajú 3 dni', 'zostávajú 4 dni', 'zostáva %s dní'];
536var js_lang_ssp_cms_order_test_eshop_expired_info = 'Vaša skúšobná prevádzka vypršala.';
537var js_lang_ssp_cms_order_eshop_pricelist_info = '<div class="ssp_tooltip_info">Prehlad balíkov nájdete na stránke <a href="http://www.skvelyshop.sk/cennik/" target="_blank">Cenník</a>.<br />Subdoména je adresa Vášho e-shopu, napr. http://obchod.skvelyshop.sk</div>';
538var js_lang_ssp_cms_order_eshop_subdomain = 'Zadajte Vašu subdoménu:';
539var js_lang_ssp_cms_order_eshop_subdomain_def_text = 'Vaša subdoména';
540var js_lang_ssp_cms_order_eshop_subdomain_error_1 = 'Vyplňte prosím Vašu subdoménu.';
541var js_lang_ssp_cms_order_eshop_subdomain_error_2 = 'lutujeme, zadaná subdoména je už obsadená.';
542var js_lang_ssp_cms_settings_google_analytics_error = 'Google Analytics ID bol zadaný v nesprávnom formáte. Správny formát je UA-XXXXXXXX-1.';
543var js_lang_ssp_cms_settings_google_tools_error = 'Google Webmaster Tools meta bol zadaný v nesprávnom formáte. Mal by mať 43 znakov.';
544var js_price_from_bundle_id1 = 'Suma k úhrade';
545var js_price_from_bundle_id2 = 'EUR + DPH x 12 mes.';
546var js_import_product_data = new Object();
547    js_import_product_data[''] = '- neimportovať -';
548    js_import_product_data['name'] = 'názov produktu';
549    js_import_product_data['sku'] = 'kód produktu';
550    js_import_product_data['price_with_vat'] = 'cena s DPH';
551    js_import_product_data['price_without_vat'] = 'cena bez DPH';
552    js_import_product_data['old_price_with_vat'] = 'bežná cena s DPH';
553    js_import_product_data['old_price_without_vat'] = 'bežná cena bez DPH';
554    js_import_product_data['s_desc'] = 'krátky popis';
555    js_import_product_data['desc'] = 'popis produktu';
556  //js_import_product_data['is_unsaleable'] = 'produkt je nepredajný';
557    js_import_product_data['in_stock'] = 'na sklade [ks]';
558    js_import_product_data['weight'] = 'hmotnosť [kg]';
559    js_import_product_data['publish'] = 'zverejniť (Y/N)';
560    js_import_product_data['manufacturer'] = 'výrobca';
561	js_import_product_data['supplier'] = 'dodávateľ';
562  //  js_import_product_data['plength'] = 'length';
563  //  js_import_product_data['width'] = 'width';
564  //  js_import_product_data['height'] = 'height';
565    js_import_product_data['primary_img'] = 'hlavný obrázok';
566    js_import_product_data['secondary_img'] = 'ďalšie obrázky';
567    js_import_product_data['secondary_img_desc'] = 'popisy ďalších obrázkov';
568    js_import_product_data['external_active_url'] = 'Vedlajší obrázok URL';
569    js_import_product_data['category'] = 'kategória';
570    js_import_product_data['category_id'] = 'ID kategórie';
571    js_import_product_data['product_relations'] = 'príbuzné produkty';
572
573	js_import_product_data['product_relations_1'] = 'príbuzné produkty - príslušenstvo';
574	js_import_product_data['product_relations_2'] = 'príbuzné produkty - doplnky';
575	js_import_product_data['product_relations_3'] = 'príbuzné produkty - súvisiace produkty';
576
577	js_import_product_data['seo_page_name'] = 'SEO: Názov stránky';
578	js_import_product_data['seo_meta_description_for_this_page'] = 'SEO: Meta popis';
579	//js_import_product_data['seo_h1_element'] = 'SEO: H1 element';
580	js_import_product_data['seo_meta_keywords_for_this_page'] = 'SEO: Meta klúčové slová';
581	js_import_product_data['permanently_unavailable'] = 'Trvalo nedostupný produkt (Y/N)';
582	js_import_product_data['ship_code_id'] = 'Zobraziť na doménach';
583	js_import_product_data['primary_category_id'] = 'Primárna kategória (ID)';
584	js_import_product_data['product_is_unsaleable'] = 'Nepredajný produkt';
585	js_import_product_data['shopper_group_visibility'] = 'Zobraziť pre zákaznícke skupiny';
586	js_import_product_data['bazar'] = 'Bazarová položka';
587	js_import_product_data['priceportal_productname'] = 'Názov produktu pre cenové portály';
588	js_import_product_data['priceportal_productname_cz'] = 'Názov produktu pre cenové portály[cz]';
589	//js_import_product_data['country_code'] = 'Kód krajiny';
590	js_import_product_data.heureka_category_sk = 'heureka kategória - sk';
591	js_import_product_data.heureka_category_cz = 'heureka kategória - cz';
592	js_import_product_data['pack_set'] = 'Set produktov';
593
594
595var js_import_product_data_no_vat = new Object();
596    js_import_product_data_no_vat[''] = '- neimportovať -';
597    js_import_product_data_no_vat['name'] = 'názov produktu';
598    js_import_product_data_no_vat['sku'] = 'kód produktu';
599    // js_import_product_data_no_vat['price_with_vat'] = 'cena s DPH';
600    js_import_product_data_no_vat['price_without_vat'] = 'cena';
601    // js_import_product_data_no_vat['old_price_with_vat'] = 'bežná cena s DPH';
602    js_import_product_data_no_vat['old_price_without_vat'] = 'bežná cena';
603    js_import_product_data_no_vat['s_desc'] = 'krátky popis';
604    js_import_product_data_no_vat['desc'] = 'popis produktu';
605  //  js_import_product_data_no_vat['is_unsaleable'] = 'produkt je nepredajný';
606    js_import_product_data_no_vat['in_stock'] = 'na sklade [ks]';
607    js_import_product_data_no_vat['weight'] = 'hmotnosť [kg]';
608    js_import_product_data_no_vat['publish'] = 'zverejniť (Y/N)';
609    js_import_product_data_no_vat['manufacturer'] = 'výrobca';
610  //  js_import_product_data_no_vat['plength'] = 'length';
611  //  js_import_product_data_no_vat['width'] = 'width';
612  //  js_import_product_data_no_vat['height'] = 'height';
613    js_import_product_data_no_vat['primary_img'] = 'hlavný obrázok';
614    js_import_product_data_no_vat['secondary_img'] = 'ďalšie obrázky';
615    js_import_product_data_no_vat['secondary_img_desc'] = 'popisy ďalších obrázkov';
616    js_import_product_data_no_vat['external_active_url'] = 'Vedlajší obrázok URL';
617    js_import_product_data_no_vat['category'] = 'kategória';
618    js_import_product_data_no_vat['category_id'] = 'ID kategórie';
619    js_import_product_data_no_vat['product_relations'] = 'príbuzné produkty';
620
621	js_import_product_data_no_vat['product_relations_1'] = 'príbuzné produkty - príslušenstvo';
622	js_import_product_data_no_vat['product_relations_2'] = 'príbuzné produkty - doplnky';
623	js_import_product_data_no_vat['product_relations_3'] = 'príbuzné produkty - súvisiace produkty';
624
625	js_import_product_data_no_vat['seo_page_name'] = 'SEO: Názov stránky';
626	js_import_product_data_no_vat['seo_meta_description_for_this_page'] = 'SEO: Meta popis';
627	//js_import_product_data_no_vat['seo_h1_element'] = 'SEO: H1 element';
628	js_import_product_data_no_vat['seo_meta_keywords_for_this_page'] = 'SEO: Meta klúčové slová';
629	js_import_product_data_no_vat['permanently_unavailable'] = 'Trvalo 
629nedostupný produkt (Y/N)';
630	js_import_product_data_no_vat['ship_code_id'] = 'Zobraziť na doménach';
631	js_import_product_data_no_vat['product_is_unsaleable'] = 'Nepredajný produkt';
632	js_import_product_data_no_vat['shopper_group_visibility'] = 'Zobraziť pre zákaznícke skupiny';
633	js_import_product_data_no_vat['bazar'] = 'Bazarová položka';
634	js_import_product_data_no_vat['priceportal_productname'] = 'Názov produktu pre cenové portály';
635	js_import_product_data_no_vat.heureka_category_sk = 'heureka kategória - sk';
636	js_import_product_data_no_vat.heureka_category_cz = 'heureka kategória - cz';
637
638var js_import_heureka_data_options = {};
639	js_import_heureka_data_options[''] = '- neimportovať -';
640	js_import_heureka_data_options.sku = 'kód produktu';
641	js_import_heureka_data_options.id = 'id produktu';
642	js_import_heureka_data_options.main_img = 'Heureka.sk URL - Import 1 hlavného obrázka produktu';
643	js_import_heureka_data_options.all_img = 'Heureka.sk URL - Import všetkých obrázkov produktu';
644
645var js_import_product_data_import_title = 'Štandardný import produktov do internetového obchodu';
646var js_import_heureka_data_import_title = 'Import Heureka.sk dát produktov do internetového obchodu';
647var js_import_heureka_data_import_status = 'Import súboru %s1 bol spustený. Po dokončení budete informovaný e-mailom na adresu:';
648var js_import_heureka_data_estimated_time = {};
649	js_import_heureka_data_estimated_time[0] = 'Odhadovaný čas dokončenia: ';
650	js_import_heureka_data_estimated_time[1] = 'Menej ako minúta';
651	js_import_heureka_data_estimated_time[2] = ' minúta';
652	js_import_heureka_data_estimated_time[3] = ' minúty';
653	js_import_heureka_data_estimated_time[4] = ' minút';
654	js_import_heureka_data_estimated_time[5] = 'približne ';
655
656
657var js_import_gui_login = 'Prihlasovacie meno';
658var js_import_gui_pass = 'Heslo';
659var js_import_gui_url_to_login_form = 'Link na prihlasovací formulár';
660var js_import_gui_send = 'Odoslať';
661var js_import_gui_products = 'Produkty';
662var js_import_gui_categories = 'Kategórie';
663var js_import_gui_users = 'Zákazníci';
664var js_import_gui_orders = 'Objednávky';
665var js_import_gui_found_notice = 'Vyberte ktoré údaje máte záujem importovať. (Číslo v zátvorke udáva počet nájdených položiek.)';
666var js_import_gui_welcome_notice = 'Import údajov';
667var js_import_product_main_link_text = 'Import produktov';
668var js_import_product_data_type = new Array();
669    js_import_product_data_type[1] = 'Ak je začiarknuté, naimportujú sa z CSV súboru nové produkty, t.j. ktoré v zozname produktov ešte neexistujú. Ak odčiarknete, nové produkty sa nebudú importovať.';
670    js_import_product_data_type[2] = 'Ak je začiarknuté, upravia sa z produkty, t.j. ktoré v sú aj v e-shope aj v CSV. Ak odčiarknete, nebudú sa upravovať.';
671    js_import_product_data_type[3] = 'Ak je začiarknuté, tie produkty, ktoré sú v eshope, ale nie sú v importovacom CSV sa "zneverejnia". Ak odčiarknete, budú ignorované.';
672var js_import_product_data_import_type = new Array();
673    js_import_product_data_import_type[0] = 'chcem <strong>pridať produkty</strong> (prvý import, resp. pridanie nových produktov k už existujúcim)';
674    js_import_product_data_import_type[1] = 'chcem <strong>aktualizovať existujúce</strong> produkty (upravia sa vybrané položky už existujúcich produktov, napr. ceny)';
675var js_import_by_ean_import_type = new Array();
676    js_import_by_ean_import_type[0] = 'Párovať produkty podla kódu produktu';
677    js_import_by_ean_import_type[1] = 'Párovať produkty podla EAN (pole "kód produktu" nie je dostupné)';
678var js_import_product_choose_tax = 'Vyberte DPH';
679var js_import_product_only_one_tax = 'K produktu bude pridaná DPH';
680var js_import_product_choose_category = 'Vyberte kategóriu';
681var js_import_product_choose_start_import = 'Spustiť import';
682var js_import_product_ignore_first_row = 'Neimportovať prvý riadok';
683var js_import_product_no_category_notice = 'Všetky novopridávané produkty budu naimportované tak, ze nebudú priradené do žiadnej kategórie (na stránke Produkty ich zobrazíte tak, ze si zvolíte zobraziť produkty - bez priradenie kategórie - )';
684var js_import_product_choose_csv_separator = 'Zmeniť oddelovač CSV';
685var js_import_product_choose_csv_encoding = 'Zmeniť kódovanie';
686var js_import_product_reload_csv_from_server = 'Znovu načítať csv súbor';
687var js_import_product_show_column_error = 'Skryť môžete iba stĺpec s dátami, 
687ktoré si neprajete importovať.';
688var js_import_product_show_full_file = 'Zobraziť celý súbor?';
689var js_import_product_cancel = 'Naozaj si prajete zrušit import tohto súboru?';
690var js_import_product_import_is_ok = 'Import je v poriadku';
691var js_import_product_revert_last_import = 'Zrušiť import a vrátiť dáta späť';
692var js_import_product_revert_last_import_intro = new Array();
693    js_import_product_revert_last_import_intro[0] = 'Inštrukcie';
694    js_import_product_revert_last_import_intro[1] = 'Všetky novopridávané produkty sú naimportované tak, že sú priradené do žiadnej kategórie (v záložke PRODUKTY ich zobrazíte tak, že si v hornom filtri zvolíte zobraziť produkty "- bez priradenej kategórie -", t.j. vo filtri si zmeníte "všetkých kategórií" na "bez priradenej kategórie"). Následne si novopridané produkty môžete pridať do kategórií.';
695    js_import_product_revert_last_import_intro[2] = 'Prejsť k úprave nových importovaných produktov';
696    js_import_product_revert_last_import_intro[3] = 'Následne po finálnej úprave a zaradení novopridaných produktov do kategórií si ich označte ako zverejnené kliknutím na cervený krúžok celkom vpravo pre ten, ktorý produkt.';
697    js_import_product_revert_last_import_intro[4] = 'Po kontrole či import súboru %s1 dňa %s2 prebehol v poriadku, prosím potvrďte:';
698    js_import_product_revert_last_import_intro[5] = 'Všetky aktualizované produkty sú zobrazené v záložke PRODUKTY.';
699    js_import_product_revert_last_import_intro[6] = 'tlacidlom sa dostane do zalozky produkty s filtrom nastavenym na zobrazenie vsetkych kategorii';
700    js_import_product_revert_last_import_intro[7] = 'Všetky aktualizované produkty, ktoré sú zaradené v kategóriach sú zobrazené v záložke PRODUKTY. Všetky aktualizované produkty, ktoré ešte nie sú zaradené v kategóriach sú zobrazené v záložke PRODUKTY v "- bez priradenej kategórie -".';
701    js_import_product_revert_last_import_intro[8] = 'Prejsť do záložky PRODUKTY';
702    js_import_product_revert_last_import_intro[9] = 'Prejsť do "- bez priradenej kategórie -" v záložke PRODUKTY';
703var js_import_product_revert_last_import_comment_1 = 'Pozn.: Ak potvrdíte import, dáta už nebude možné vrátiť späť. Importované produkty však stále môžete hromadne vymazať a pokračovať odznova.';
704var js_import_product_revert_last_import_comment_2 = 'Ak dáta vrátite späť, produkty budete mať v rovnakom stave, aký bol pred importom.';
705var js_import_product_revert_last_import_comment_5 = 'Naozaj ste si istý? Počet dní od importu: ';
706var js_import_product_revert_last_import_comment_6 = 'Prosím zadajte číslo ';
707var js_import_product_revert_last_import_comment_7 = ' (počet dní od importu):';
708var js_import_product_revert_last_import_comment_8 = {
709	'1':	'deň',
710	'2-4':	'dni',
711	'5':	'dní',
712	'at':	' o ',
713	'hour':	' hod.'
714};
715var js_import_product_revert_last_import_confirm = 'POZOR!!\n\nAk iní administrátori vykonávali manuálne úpravy produktov (akýchkoľvek) od posledného nepotvrdeného importu, všetky ich úpravy budú vrátením importu stratené.<br /><br />Naozaj si prajete vrátiť úplne všetky dáta produktov do pôvodného stavu pred importom z';
716var js_import_product_revert_last_import_done = 'Stav produktov a ich obrazkov bol obnovený zo zálohy %s, ktorá bola vytvorená pred vykonaním importu.'
717var js_import_product_main_import_status_report = new Array();
718    js_import_product_main_import_status_report[0] = 'Import súboru %s1 bol %s2 úspešne spracovaný';
719    js_import_product_main_import_status_report[1] = 'Počet <strong>záznamov</strong> v importovanom súbore';
720    js_import_product_main_import_status_report[2] = 'Počet produktov v e-shope <strong>po importe</strong>';
721    js_import_product_main_import_status_report[3] = 'Počet <strong>zmenených produktov</strong> v e-shope';
722    js_import_product_main_import_status_report[4] = 'Počet <strong>nezmenených produktov</strong> v e-shope';
723    js_import_product_main_import_status_report[5] = 'Počet <strong>nadbytočných zneverejnených produktov</strong> v e-shope';
724    js_import_product_main_import_status_report[6] = 'Počet <strong>duplicitných riadkov</strong> v importovanom súbore';
725    js_import_product_main_import_status_report[7] = 'Počet <strong>nových produktov</strong> pridaných do e-shopu';
726var js_import_product_help_text_main = new Array();
727    js_import_product_help_text_main[0] = 'Poznámky';
728    js_import_product_help_text_main[1] = 'Položka "krátky popis" môže obsahovať len 255 znakov, všetky znaky naviac nebudú importované.';
729    js_import_product_help_text_main[2] = 'Nevyplnený (prázdny) údaj v položke záznamu sa neimportuje, číselná hodnota "0" sa importuje ako "0".';
730    js_import_product_help_text_main[3] = 'V prípade, ak existuje rovnaký kód produktu vo viacerých záznamoch, pri prvom importe sa importuje len prvý záznam s rovnakým kódom produktu, v prípade aktualizácie existujúceho produktu sa importujú údaje vybraných položiek tak ako sú uvedené v poslednom zázname s rovnakým kódom produktu.';
731    js_import_product_help_text_main[4] = 'Ak sa súbežne importujú položky "cena/bežná cena bez DPH" a "cena/bežná cena s DPH", pre potreby importu sa vychádza len z položky "cena/bežná cena bez DPH", z ktorej sa vypočíta hodnota aj pre položku "cena/bežná cena s DPH.';
732    js_import_product_help_text_main[5] = 'Ak importujete položku kde je stav "ano-nie" (napr. zverejniť produkt), ako "áno" sa chápu tieto zadané hodnoty: "1, y, Y, ano, áno, Ano, Áno".';
733var js_import_product_help_text_intro = new Array();
734    js_import_product_help_text_intro[0] = 'Inštrukcie';
735    js_import_product_help_text_intro[1] = 'Pred nahratím CSV súboru si prosím pozrite návod, ako importovať dáta, obrázky a kategórie produktov.';
736    js_import_product_help_text_intro[2] = 'Tiež si stiahnite a pozrite vzorový CSV súbor';
737    js_import_product_help_text_intro[3] = 'Pre potreby importu sa zatial bez úprav nedá použiť CSV súbor získaný exportom produktov.';
738    js_import_product_help_text_intro[4] = 'V prípade otázok alebo nefunkčnosti importu nám napíšte e-mail, radi Vám pomôžeme.';
739    js_import_product_help_text_intro[5] = 'Návod k Importu produktov nájdete v sekcii Pomoc.';
740    js_import_product_help_text_intro[6] = 'Produkty_Import.csv';
741
742var js_import_product_eu_taxrates_group_info = 'Pre import sadzby DPH EU krajiny a kódu krajiny nie je možné importovať ostatné dáta';
743
744var cms_js_lang_shopper_group_edit_success = 'Skupina bola upravená.';
745var cms_js_lang_shopper_group_edit_fail = 'Nepodarilo sa upraviť skupinu.';
746var cms_js_lang_shopper_group_duplicity = 'Zadaná skupina už existuje.';
747var cms_js_lang_shopper_group_deleted = 'Skupina bola zmazaná.';
748var cms_js_lang_shopper_group_name = 'Názov skupiny';
749var cms_js_lang_shopper_group_insert_fail = 'Nepodarilo sa pridať novú skupinu.';
750var cms_js_lang_shopper_group_delete_message_6 = 'Naozaj chcete vymazať túto skupinu?';
751var cms_js_lang_shopper_group_delete_message_0 = 'Skupinu nie je možné zmazať pretože sa používa - v cenách produktov, v zákazníkoch, v spôsoboch platieb, alebo v spôsoboch dodania.';
752var cms_js_lang_users_add_user_group_def_text2 = 'Zlava';
753var cms_js_lang_shopper_group_input_value_margin = 'Marža';
754var cms_js_lang_users_add_user_group_fill_discount_correctly = 'Celoplošná zlava pre skupinu zákazníkov je nepovinný údaj a môže byť zadaný ako číselná hodnota, vyjadrujúca percentuálnu zlavu.';
755var cms_js_lang_shopper_group_delete_message_5 = 'Základnú zákaznícku skupinu nie je možné zmazať.';
756var cms_js_lang_shopper_group_discount_tip = 'Celoplošná zlava pre prihlásených zákazníkov patriacich do tejto zákazníckej skupiny.<br />Zlava bude aplikovaná a zobrazovaná pre všetky produkty bez výnimky.';
757var cms_js_lang_cfg_product_attrib_products_text = 'produktov';
758var cms_js_lang_cfg_product_attrib_1_product_text = 'produktu';
759var cms_js_lang_cfg_product_new_attrib_def_text = 'Názov atribútu';
760var cms_js_lang_cfg_product_new_attrib_name_error = 'Vyplňte prosím názov atribútu.';
761var cms_js_lang_cfg_product_new_attrib_name_exists = 'Atribút so zadaným názvom už existuje.';
762var cms_js_lang_cfg_product_attrib_name_delete_confirm = 'Naozaj chcete zmazať atribút %s?';
763var cms_js_lang_cfg_product_attrib_name_delete_error = 'Pred zmazaním atribútu %s je potrebné zmazať všetky jeho hodnoty.';
764var cms_js_lang_cfg_product_attrib_value_delete_confirm = 'Naozaj chcete zmazať atribútu hodnotu %s?';
765var cms_js_lang_cfg_product_attrib_value_delete_confirm_2 = 'Naozaj chcete zmazať atribútu hodnotu %s1? Táto hodnota bude odstránená z atribútov %s2.';
766var cms_js_lang_cfg_product_new_attrib_value_def_text = 'Hodnota atribútu';
767var cms_js_lang_cfg_product_new_attrib_value_error = 'Vyplňte prosím hodnotu atribútu.';
768var cms_js_lang_cfg_product_new_attrib_value_error_2 = 'Zadaná hodnota pre atribút %s už existuje.';
769var cms_js_lang_product_attrib_price_help_info = 'Úprava ceny produtku podla jednotlivých atribútov:<br/>zadané &quot;+&quot;
769 pred čiastkou znamená: Zvýšiť cenu produktu o uvedenú čiastku.<br/>zadané &quot;-&quot; pred čiastkou znamená: Znížiť cenu produktu o uvedenú čiastku.<br/>bez zadanej hodnoty znamená: Cena sa nemení.';
770var cms_js_lang_system_cfg_delete_coupons = 'Naozaj chcete archivovať zvolené kupóny?';
771var cms_js_lang_system_cfg_delete_coupons_alert = 'Tento kupón je odpočitateľný.';
772var cms_js_lang_system_cfg_delete_coupons_alert2 = 'Naozaj chcete archivovať tento kupón?';
773var cms_js_lang_system_cfg_delete_order_state = 'Naozaj chcete zmazať zvolené stavy objednávky?';
774var cms_js_lang_system_cfg_delete_order_state_delete_notif_default_status = 'Tento stav objednávky je potrebný pre funkčnosť systému, preto nemôže byť zmazaný.';
775var cms_js_lang_system_cfg_delete_order_state_delete_notif_has_orders = 'Tento stav používa niektorá z objednávok a preto ho nie je možné zmazať.';
776var cms_js_lang_system_cfg_order_state_name_max_length_alert = 'Žial už nie je možné vpísať viac znakov, pretože bola dosiahnutá max. dĺžka názvu (40 znakov).';
777var cms_js_lang_system_cfg_delete_countries = 'Naozaj chcete zmazať zvolené štáty?';
778var cms_js_lang_content_header_custom_image_info = 'Niektoré dizajny sú navrhnuté tak, že nepodporujú vloženie obrázku do hlavičky stránok.';
779var cms_js_lang_content_header_custom_image_upload_stop = 'Dizajn %s, ktorý máte aktuálne zvolený, nepodporuje vloženie obrázku do hlavičky stránok.';
780var cms_js_lang_content_header_custom_image_not_supported_info = 'To sa týka aj dizajnu %s, ktorý máte aktuálne zvolený. V prípade, že si prajete v takomto dizajne aj napriek tomu mať vlastný obrázok, prosím kontaktujte nás, pokúsime sa vám pomôcť.';
781var cms_js_lang_content_header_custom_image_is_supported_info = 'To sa však netýka dizajnu %s1, ktorý máte aktuálne zvolený (tento dizajn umožňuje obrázok v hlavičke do výšky obrázka %s2px).';
782var cms_adminlang_mod_fullmenu_swe_mediamanag = 'Správa súborov';
783
784var cms_js_lang_order_status = 'Stav objednávky';
785var cms_js_lang_delivery_date = 'Termín dodania';
786var cms_js_lang_error_found = 'Vyskytla sa chyba!';
787
788
789
790var cms_js_lang_product_availability_preffered_value_info = "Pri nastavení dodacej lehoty variantu bude ako <br />hlavná dodacia lehota produktu použitá najskoršia dodacia lehota <br />zo všetkých variantov dostupných skladom.";
791var cms_js_lang_news = 'Novinky';
792var cms_js_lang_result_for_searching = 'výsledky vyhladávania pre';
793var cms_js_lang_all_apps = 'Všetky aplikácie';
794var cms_js_lang_appstore_searching_found = 'Výsledky vyhladávania pre';
795var cms_js_lang_appstore_searching_notfound = 'Zadaným kritériam nezodpovedá žiadny záznam';
796var cms_js_lang_appstore_special_tag_add = 'Pridať štítok';
797var cms_js_lang_appstore_special_tag_edit = 'Upraviť štítok';
798var cms_js_lang_appstore_special_tag_window = 'Správa štítkov';
799var cms_js_lang_appstore_special_tag_remove_question = 'Naozaj si prajete zmazať tento štítok?';
800var cms_js_lang_appstore_special_tag_remove_success = 'Štítok bol úspešne zmazaný.';
801var cms_js_lang_appstore_special_tag_save_add = 'Štítok bol úspešne vytvorený.';
802var cms_js_lang_appstore_special_tag_save_edit = 'Štítok bol úspešne upravený.';
803
804
805var cms_js_lang_shopper_list_group = 'Skupina';
806var cms_js_lang_product_form_price_net_label = 'bez DPH';
807var cms_js_lang_product_form_price_gross_label = 's DPH';
808var cms_js_lang_product_discount_price_label = 'cena po %s% zlave:';
809var cms_js_lang_product_discount_price_label_tooltip = 'Výsledná cena pre danú zákaznícku skupinu po uplatnení celoplošnej zlavy %s%.';
810var cms_js_lang_product_form_price_agreement = 'špecifická pre e-shop';
811var cms_js_lang_product_form_price_free = 'zdarma';
812var cms_js_lang_price_form_mnu = 'Pridať ďalšiu cenu';
813var cms_js_lang_other_prices_label = 'Ďalšie ceny';
814var cms_js_lang_select_shopper_group = '- vyberte skupinu -';
815var cms_js_lang_product_attrib_select = '- vyberte atribút -';
816var cms_js_lang_product_attrib_value_select = '- vyberte položku atribútu -';
817//var cms_js_lang_product_attrib_value_error = 'Pred pridaním položky je potrebné najskôr vybrať atribút.';
818var cms_js_lang_other_prices_for_shopper_group_label = 'Cena pre:';
819var cms_js_lang_product_add_comb_name_error = 'Vyberte prosím atribút.';
820var cms_js_lang_product_add_comb_value_error = 'Vyberte prosím položku atribútu.';
821var cms_js_lang_product_attrib_comb_add = 'Pridať variant';
822var cms_js_lang_product_attrib_comb_add2 = 'Pridať kombináciu variantov';
823var cms_js_lang_product_attrib_comb_generate = 'Generuj kombinácie';
824var cms_js_lang_product_attrib_comb_generate_save = 'Ulož kombinácie';
825var cms_js_lang_product_attrib_comb_attrib_count_less = 'Pre vytváranie kombinácií atribútov je nutné mať vytvorené aspoň 2 atribúty. Prajete si preto prejsť do správy atribútov?';
826var cms_js_lang_product_attrib_price_without_vat = 'Cena bez DPH:';
827var cms_js_lang_product_attrib_price_with_vat = 'Cena s DPH:';
828var cms_js_lang_product_attrib_sku = 'Kód:';
829var cms_js_lang_product_attrib_in_stock = 'Skladom:';
830var cms_js_lang_product_attrib_in_supplier_stock = 'Dod. skladom:';
831var cms_js_lang_these_products_were_returned_to_stock = 'Nasledujúce produkty boli vrátene na sklad';
832var cms_js_lang_product_attrib_confirm = 'Naozaj si prajete odstrániť variant: \n   "%var"\n z produktu "%prod"?';
833var cms_js_lang_overview_test_package_over_2_days_info = '';
834cms_js_lang_overview_test_package_over_2_days_info += '<div id="admin_test_package_over_2_days_info">';
835//cms_js_lang_overview_test_package_over_2_days_info += '<h3>Zaujímavé informácie</h3>';
836cms_js_lang_overview_test_package_over_2_days_info += '<fieldset style="margin-bottom: 20px">';
837cms_js_lang_overview_test_package_over_2_days_info += '<legend><b>1. Snažíme sa pomôcť v začiatkoch</b></legend>';
838//cms_js_lang_overview_test_package_over_2_days_info += '<div class="admin_over_2_days_title">1. Snažíme sa pomôcť v začiatkoch</div>';
839cms_js_lang_overview_test_package_over_2_days_info += '<div>Pre začínajúcich majitelov e-shopov sme pripravili špeciálnu akciu: možnosť objednania balíka MINI alebo PROFI na obdobie 6 mes. - <a href="http://www.skvelyshop.sk/cennik/#az" target="_blank" class="admin_over_2_days_link">viac informácií</a>.</div>';
840cms_js_lang_overview_test_package_over_2_days_info += '</fieldset>';
841//cms_js_lang_overview_test_package_over_2_days_info += '<div class="admin_over_2_days_hr"><!-- --></div>';
842cms_js_lang_overview_test_package_over_2_days_info += '<fieldset style="margin-bottom: 20px">';
843cms_js_lang_overview_test_package_over_2_days_info += '<legend><b>2. Najrýchlejšie vyvíjaný systém</b></legend>';
844//cms_js_lang_overview_test_package_over_2_days_info += '<div class="admin_over_2_days_title">2. Najrýchlejšie vyvíjaný systém</div>';
845cms_js_lang_overview_test_package_over_2_days_info += '<div>Za posledný mesiac sme naprogramovali množstvo žiadaných funkcií,<br/>tento mesiac plánujeme ďalšie. Ich prehlad nájdete na stránke <a href="http://www.facebook.com/SkvelyShop.sk" class="admin_over_2_days_link" target="_blank">Novinky systému</a>.</div>';
846cms_js_lang_overview_test_package_over_2_days_info += '</fieldset>';
847//cms_js_lang_overview_test_package_over_2_days_info += '<div class="admin_over_2_days_hr"><!-- --></div>';
848cms_js_lang_overview_test_package_over_2_days_info += '<fieldset style="margin-bottom: 20px">';
849cms_js_lang_overview_test_package_over_2_days_info += '<legend><b>3. Počúvame našich klientov</b></legend>';
850//cms_js_lang_overview_test_package_over_2_days_info += '<div class="admin_over_2_days_title">3. Počúvame našich klientov</div>';
851cms_js_lang_overview_test_package_over_2_days_info += '<div class="admin_over_2_days_msg_container">Ak Vám chýba nejaká funkcia alebo máte akékolvek otázky, napíšte nám:<div class="admin_over_2_days_msg_panel"><div style="position:absolute;right:100px;bottom:14px;"><div class="save-icon-container"><a href="#" onclick="return js_admin_test_package_over_2_days_msg_send_click(this);" class="vex-dialog-button vex-dialog-button-primary">'+cms_js_lang_products_group_8+'</a></div></div><textarea name="user_message_text" cols="" rows="" class="admin_over_2_days_msg" style="width: 100%"></textarea></div></div>';
852cms_js_lang_overview_test_package_over_2_days_info += '</fieldset>';
853cms_js_lang_overview_test_package_over_2_days_info += '<div class="admin_over_2_days_input_panel"><input type="checkbox" name="do_not_show_again" value="1" id="admin_test_package_over_2_days_do_not_show"/> <label class="ssp_tooltip_info" for="admin_test_package_over_2_days_do_not_show"><b>túto správu už viac nezobrazovať</b></label></div><div class="cleaner">&nbsp;</div>';
854cms_js_lang_overview_test_package_over_2_days_info += '</div>';
855var cms_js_lang_overview_test_package_over_2_days_send_error = 'Vyplňte prosím text správy.';
856var cms_js_lang_overview_test_package_over_2_days_sent = '<em>Vaša správa bola úspešne odoslaná. Ďakujeme.</em>';
857var cms_js_lang_product_detail_in_stock_label = 'Na sklade';
858var cms_js_lang_product_price_net = 'Cena produktu';
859var cms_js_lang_cfg_vat_payer_to_non_payer_info = 'Pri zmene spoločnosti z platcu DPH na neplatcu DPH je treba určiť ako sa prepočítajú ceny produktov a ceny za dopravu.<br/><br/>Pre ceny u neplatcu DPH sa použijú:';
860var cms_js_lang_cfg_vat_payer_to_non_payer_with_vat = 'existujúce ceny s DPH ';
861var cms_js_lang_cfg_vat_payer_to_non_payer_without_vat = 'existujúce ceny bez DPH ';
862var cms_js_lang_cfg_non_vat_payer_to_payer_info = 'Pri zmene spoločnosti z neplatcu DPH na platcu DPH je treba určiť ako sa prepočítajú ceny produktov a ceny za dopravu.<br/><br/>Ceny u neplatcu DPH sa zmenia na:';
863
864var cms_js_lang_ai_generator_confirm_modal = {
865	title: 'Prepísať existujúci obsah?',
866	content: 'Pole už obsahuje text. Vygenerovaný návrh ho prepíše. Táto akcia sa nedá vrátiť späť.',
867	close: 'Zrušiť',
868	apply: 'Prepísať'
869};
870
871var cms_js_lang_cfg_non_vat_payer_to_payer_with_vat = 'ceny s DPH';
872var cms_js_lang_cfg_non_vat_payer_to_payer_without_vat = 'ceny bez DPH';
873var js_lang_admin_manage_users_switch = new Array();
874    js_lang_admin_manage_users_switch['main'] = new Array();
875    js_lang_admin_manage_users_switch['main'][0] = 'Správa administrátorov';
876    js_lang_admin_manage_users_switch['main'][1] = 'Správa zákazníkov';
877    js_lang_admin_manage_users_switch['add_new'] = new Array();
878    js_lang_admin_manage_users_switch['add_new'][0] = 'Pridať zákazníka';
879    js_lang_admin_manage_users_switch['add_new'][1] = 'Pridať administrátora';
880var cms_js_lang_content_editing_content_sef_update_info = 'Aktualizujem&hellip;';
881var cms_js_lang_content_editing_content_sef_error = 'Vyplňte prosím čitatelnú URL adresu.';
882var cms_js_lang_content_editing_content_sef_error_2 = 'Vyplnená čitatelná URL adresa sa už používa. Zadajte prosím inú.';
883var cms_js_lang_content_editing_content_sef_error_3 = 'Zadali ste duplicitné URL adresy.';
884var cms_js_lang_content_editing_content_sef_error_empty_1 = 'Chýbajúca URL adresa';
885var cms_js_lang_content_editing_content_sef_error_empty_2 = 'Nie je vyplnená čitateľná URL adresa. Prosím doplňte.';
886var cms_js_lang_content_menu_item_type_url_error = 'Zadajte prosím aktuálne existujúcu URL adresu z Vašich web stránok.';
887var cms_js_lang_product_list_manual_order_notice = 'Pre možnosť produkty v kategórii manuálne zoradiť, bude zmenené zobrazenie podla manuálneho poradia.';
888var cms_js_lang_content_menu_item_type_content_tooltip = 'Vytvorí sa nová stránka (položka menu), kde si môžete pridať články a/alebo ďalšie moduly.';
889var cms_js_lang_content_menu_item_type_url_tooltip = 'Vytvorí sa odkaz (URL odkaz) na článok alebo stránku (položku menu).';
890
891var cms_js_lang_access_restricted_order_detail = 'Nemáte oprávnenie zobraziť detail objednávky.';
892
893var cms_js_lang_add_comment_your_name_error = 'Vyplňte prosím Vaše meno.';
894var cms_js_lang_add_comment_your_email_error = 'Vyplňte prosím Váš e-mail.';
895var cms_js_lang_edit_comment_date_error = 'Zadaný dátum je v zlom formáte. Správny formát je dd.mm.yyyy hh:mm';
896var cms_js_lang_add_comment_body_error = 'Vyplňte prosím text komentáru.';
897var cms_js_lang_add_comment_captcha_error = 'Chybný overovací kód.';
898var cms_js_lang_delete_comment_confirm = 'Naozaj chcete zmazať tento komentár?';
899var cms_js_lang_delete_comment_error = 'Nemáte oprávnenie zmazať tento komentár.';
900var cms_js_lang_edit_comment_error = 'Nemáte oprávnenie upraviť tento komentár.';
901var cms_js_lang_edit_comment_time_left = 'Na úpravu komentára zostáva <span class="time_left">%s</span>';
902var cms_js_lang_edit_commnet_minute = 'minúta';
903var cms_js_lang_edit_commnet_minutes = 'minúty';
904var cms_js_lang_edit_commnet_minutes2 = 'minút';
905var cms_js_lang_reply_to_comment_opened_error = 'Pre pridanie reakcie na tento komentár je nutné ukončiť už otvorenú reakciu na iný komentár.';
906var cms_js_lang_add_comment_rating_error = 'Vyberte prosím hodnotenie';
907var cms_js_lang_add_comment_success = 'Váš komentár bol úspešne odoslaný';
908var cms_js_lang_add_review_success = 'Vaša recenzia bola úspešne pridaná';
909
910var cms_js_lang_poll_title_error = 'Vyplňte názov ankety.';
911var cms_js_lang_poll_options_error = 'Treba zadať aspoň 2 možnosti.';
912
913var cms_js_lang_request_timeout_error_title = 'Chyba vášho pripojenia';
914var cms_js_lang_request_timeout_error = 'Váš prehliadač neodoslal všetky potrebné dáta vyžadované pre túto akciu.<br>Prosím zopakujte akciu znovu.';
915
916var cms_js_lang_lm_delete_subsc_group = ' užívatel/ov má nastavenú túto skupinu. Chcete ju napriek tomu zmazať?';
917var cms_js_lang_lm_fill_all_fields = 'Prosím vyplňte všetky polia.';
918var cms_js_lang_lm_wrong_email = 'Nesprávny formát e-mail adresy.';
919var cms_js_lang_lm_invalid_dns_email = 'E-mail adresa nie je platná - nefunkčná doména:';
920var cms_js_lang_lm_wrong_smtp_connection_host = 'Nesprávny server pre SMTP.';
921var cms_js_lang_lm_wrong_smtp_connection_login = 'Nesprávne užívatelské meno alebo heslo pre SMTP.';
922var cms_js_lang_lm_wrong_smtp_connection_data = 'Nesprávne údaje pre SMTP';
923var cms_js_lang_lm_wrong_smtp_connection_title = 'Nesprávne SMTP údaje';
924var cms_js_lang_lm_wrong_smtp_connection_successful = 'SMTP údaje boli úspešne overené';
925var cms_js_lang_lm_wrong_smtp_connection_verify_progress = 'Overovanie SMTP údajov';
926var cms_js_lang_lm_wrong_smtp_connection_data_code_550 = 'E-mailová schránka neexistuje';
927var cms_js_lang_lm_wrong_smtp_connection_data_code_501 = 'E-mailová adresa je nesprávna';
928var cms_js_lang_lm_wrong_smtp_connection_username = 'Užívatelské meno';
929var cms_js_lang_lm_wrong_smtp_connection_username_2 = ' na ';
930var cms_js_lang_lm_wrong_smtp_connection_password_change = 'Heslo na SMTP účte ';
931var cms_js_lang_lm_subscribers_required = 'Je nutné zadať prijímatela/ov newslettera.';
932var cms_js_lang_lm_subscribers_group_delete = 'Naozaj chcete vymazať skupinu ';
933
934var cms_js_lang_delete_main_product_img_confirm = 'Naozaj chcete zmazať hlavný obrázok produktu?';
935var cms_js_lang_delete_category_img_confirm = 'Naozaj chcete zmazať obrázok?';
936var cms_js_lang_delete_logo_img_confirm = 'Naozaj chcete zmazať logo?';
937
938var cms_js_lang_print_order_file_prefix = 'objednavka_';
939var cms_js_lang_print_orders_file_prefix = 'hromadna_tlac_objednavok';
940
941var cms_js_lang_product_price = 'Cena produktu';
942var cms_js_lang_product_old_price = 'Bežná cena';
943
944var cms_js_lang_shipping_start_rate_vs_end_rate_notice = 'Dolná hranica ceny musí byť nižšia ako horná.';
945var cms_js_lang_shipping_no_payment_selected = 'Zadajte prosím spôsob pre platby.';
946
947var cms_js_lang_tools_reporting_bugs_url_def_text = '- vložte sem prosím úplnú URL adresu stránky, na ktorej ste chybu zistili -';
948var cms_js_lang_tools_reporting_bugs_descr_def_text = '- pokúste sa čo najpresnejšie popísať Vami zistenú chybu -';
949var cms_js_lang_tools_reporting_bugs_alert1 = 'Zadajte prosím URL adresu, kde sa chyba vyskytla.';
950var cms_js_lang_tools_reporting_bugs_alert2 = 'Zadajte prosím popis Vami zistenej chyby.';
951var cms_js_lang_tools_reporting_bugs_alert3 = 'Prajete si odoslať chybové hlásenie?';
952var cms_js_lang_tools_reporting_bugs_alert4 = '<p>Ďakujeme Vám za nahlásenie chyby, túto sa pokúsime čo najskôr analyzovať a opraviť.<br /><br />Po jej odstránení Vás budeme informovať e-mailom.</p>';
953
954var cms_js_lang_tools_request_descr_def_text = '- pokúste sa čo najpresnejšie popísať Vašu požiadavku -';
955var cms_js_lang_tools_request_alert1 = 'Zadajte prosím popis Vašej požiadavky.';
956var cms_js_lang_tools_request_alert2 = 'Prajete si odoslať požiadavku?';
957var cms_js_lang_tools_request_alert3 = '<p>Ďakujeme Vám za nahlásenie požiadavky, túto sa pokúsime čo najskôr analyzovať.<br /><br />O možnosti jej realizovania Vás budeme informovať e-mailom.</p>';
958
959var cms_js_lang_product_other_price_valid_msg_01 = 'Chyba v údajoch pre Ďalšie ceny!';
960var cms_js_lang_product_other_price_valid_msg_02 = '<i>Každá ďalšia cena musí mať vybranú <strong>nejakú</strong> Skupinu zákazníkov.</i>';
961var cms_js_lang_product_other_price_valid_msg_03 = '<i>Každá ďalšia cena musí mať vybranú <strong>inú</strong> Skupinu zákazníkov.</i>';
962var cms_js_lang_product_form_stock_in_attribs = 'Stav na sklade je nastavený pre atribút';
963
964var cms_js_lang_product_form_availability_price_portal_days_warn = 'Zadaný počet musí byť celé číslo, alebo prázdna hodnota.';
965var cms_js_lang_price_portal_activate_title = 'Aktivácia exportov pre cenové portály';
966var cms_js_lang_price_portal_activate_subtitle = 'maximálny počet aktivovaných portálov:';
967
968var cms_js_lang_nivo_slider_no_dir = 'Zadajte prosím adresár v parametroch modulu.';
969
970var cms_js_lang_product_form_unit_fill_err = 'Zadajte názov jednotky prosím.';
971var cms_js_lang_product_form_active_images_select_confirm_1 = 'Prajete si 1 práve nahraný obrázok priradiť medzi zvolené aktívne obrázky produktu {product_name}?';
972var cms_js_lang_product_form_active_images_select_confirm_2_4 = 'Prajete si {img_count} práve nahrané obrázky priradiť medzi zvolené aktívne obrázky produktu {product_name}?';
973var cms_js_lang_product_form_active_images_select_confirm_5 = 'Prajete si {img_count} práve nahraných obrázkov priradiť medzi zvolené aktívne obrázky produktu {product_name}?';
974
975var cms_js_lang_user_user_search = 'zadajte meno / e-mail používatela';
976
977js_import_product_data['ean'] = 'ean';
978js_import_product_data_no_vat['ean'] = 'ean';
979js_import_product_data['product_purchase_price'] = 'nákupná cena bez DPH';
980js_import_product_data_no_vat['product_purchase_price'] = 'nákupná cena bez DPH';
981js_import_product_data['product_availability'] = 'dostupnosť';
982js_import_product_data_no_vat['product_availability'] = 'dostupnosť';
983
984var cms_js_lang_order_details_check_order_item_quantity_validity_warn = 'Prosím zadajte platné množstvo pre tento tovar';
985var cms_js_lang_order_details_resend_email = 'Želáte si znovu odosla
985ť objednávkový e-mail zákazníkovi?';
986var cms_js_lang_order_details_resend_email_last_change = 'Informácie objednávky budú podla aktuálneho stavu po poslednej zmene ';
987var cms_js_lang_order_details_resend_email_sent = 'Objednávkový e-mail odoslaný';
988var cms_js_lang_order_details_resend_email_not_sent = 'Objednávkový e-mail sa nepodarilo odoslať';
989
990var cms_js_lang_inquiry_details_resend_email = 'Želáte si znovu odoslať cenovú ponuku zákazníkovi?';
991var cms_js_lang_inquiry_details_resend_email_sent = 'Cenová ponuka odoslaná';
992var cms_js_lang_inquiry_details_resend_email_not_sent = 'Cenovú ponuku sa nepodarilo odoslať';
993
994var cms_js_lang_reservation_mode_incorrect_format_date_error = 'Zadaný dátum je v zlom formáte. Správny formát je dd.mm.yyyy';
995var cms_js_lang_reservation_mode_predate_error = 'Neskorší dátum nemôže predchádzať skorší';
996var cms_js_lang_reservation_mode_current_date_error = 'Dátum nemôže byť starší ako ten dnešný';
997var cms_js_lang_reservation_mode_email_not_sent = 'E-mail sa nepodarilo odoslať';
998var cms_js_lang_reservation_mode_email_sent = 'E-mail bol úspešne odoslaný';
999var cms_js_lang_reservation_mode_email_sent_contact = 'Čoskoro Vás budeme kontaktovať!';
1000
1001var cms_js_lang_unchanged_order_coupon_discount_alert_msg = 'Nezmenili ste žiadnu hodnotu pre kupónovú zlavu!';
1002var cms_js_lang_empty_order_coupon_discount_alert_msg = 'Nezadali ste žiadnu hodnotu pre kupónovú zlavu!';
1003var cms_js_lang_week = 'Týždeň';
1004var cms_js_lang_cfg_curr_code_err = 'Pole musí obsahovať presne 3 velké písmená.';
1005var cms_js_lang_cfg_curr_delete_alert = 'Naozaj si prajete zmazať túto menu?';
1006
1007var cms_js_lang_cfg_order_payment_method_q = 'Naozaj si prajete zaslať požiadavku pre záujem o spôsob platby:\n%s ?\n\n(V krátkej dobe sa Vám ozveme a upresníme postup.)';
1008var cms_js_lang_cfg_order_payment_method_txt = 'Mám záujem o metódu platby';
1009var cms_js_lang_cfg_order_payment_method_sent = 'Požiadavka bola úspešne odoslaná.';
1010
1011var cms_js_lang_ga_act_confirm = 'Naozaj si prajete zaslať požiadavku pre záujem o modul Google Analytics štatistík?';
1012var cms_js_lang_ga_problem_confirm = 'Naozaj si prajete zaslať požiadavku o probléme pri aktivovaní modulu Google Analytics štatistík?';
1013var cms_js_lang_cke_jq_adapter_cms_content = 'Článok';
1014var cms_js_lang_cke_jq_adapter_cms_page = 'Stránka';
1015var cms_js_lang_cke_jq_adapter_shop_category = 'Kategória produktov';
1016var cms_js_lang_cke_jq_adapter_shop_product = 'Produkt';
1017var cms_js_lang_cke_jq_adapter_product_snapshot = 'Snapshot produktu';
1018var cms_js_lang_cke_jq_adapter_enter_product_part = 'Zadajte časť názvu produktu';
1019var cms_js_lang_cke_jq_adapter_enter_product_categ_part = 'Zadajte časť názvu kategórie produktu';
1020var cms_js_lang_cke_jq_adapter_select = 'vyberte';
1021
1022var cms_js_lang_header_edit_template_save_alert = 'V sekcii Dizajn -> PANEL S DIZAJNOM máte aktuálne zvolený dizajn:\n"{template_name}"\n\nPred úpravou hlavičky tam najskôr kliknite na tlačidlo "Použiť zvolený dizajn".';
1023var cms_js_lang_header_edit_close_finallize_poshy = 'Zmeny v dizajne hlavičky boli uložené, skontrolujte si ich prosím v sekcii Dizajn.';
1024var js_import_product_data_for_shopper_group = ' - ';
1025
1026var cms_js_lang_GA_manual_header = 'Návod pre riešenie problému s Google Analytics prehľadmi.';
1027
1028// var cms_js_lang_GA_manual_content = ['prihláste sa do svojho Google účtu (účet, na ktorom máte aktivované Google Analytics štatistiky pre Vašu doménu)', 'navštívte stránku <a href="https://www.google.com/accounts/ManageDomains" target="_blank">https://www.google.com/accounts/ManageDomains</a>', 'do sekcie "Add a New Domain" vložte názov domeny (napr. "{js_live_site}"), následne kliknite na "Add domain"', 'v zozname (Manage registration) sa objaví novopridaná doména, kliknutím vojdite do jej úpravy', 'následne choďte na záložku alternatívne spôsoby -> Použite svoj účet služby Google Analytics -> tlačidlo overiť', 'pokračovať -> kliknite na súhlasiť s podmienkami (ToS)', 'v nasledujúcom formulári zadajte pre "Target URL path prefix" URL v tvare:<br/> "http://{js_live_site}/administrator/index2.php?authsub=y"', 'SAVE - následne by vedla 
1028nadpisu v tejto sekcii malo zobraziť (Aktívne)', 'v ďalšej záložke sa prihláste do administrácie e-shopu a "Kliknite pre povolenie", pričom v predchádzajúcej záložke ste stále prihásení do Google Analytics účtu'];
1029// var cms_js_lang_GA_manual_content_finish = 'Následne je možné postupovať podla video návodu na aktiváciu Google analytics prehladov.';
1030
1031var cms_js_lang_GA_manual_content = ['overte si svoje prihlasovacie údaje ( užívatelské meno je možné zadať aj bez koncovky "@gmail.com" )', 'prihláste sa do svojho <a href="http://www.google.com/analytics/" target="_blank">Google Analytics účtu</a> a overte, či máte vytvorený aspoň 1 Google Analytics profil', 'ak sa stále nemôžete prihlásiť, otvorte si <a href="https://accounts.google.com/DisplayUnlockCaptcha" target="_blank">nasledujúcu stránku</a> a znovu sa pokúste prihlásiť', 'prípadne si treba overiť v <a href="https://myaccount.google.com/" target="_blank">nastaveniach Vášho Google účtu</a>, či máte <strong>vypnuté "Dvojstupňové overenie"</strong> a <strong>povolený prístup pre menej bezpečné aplikácie</strong>'];
1032var cms_js_lang_GA_manual_content_finish = 'Následne by malo byť možné Google Analytics prehlady aktivovať.';
1033
1034var cms_js_lang_module_copy_btn_copy = 'Kopírovať';
1035var cms_js_lang_module_copy_btn_cancel = 'Zrušiť';
1036var cms_js_lang_module_copy_title = 'Kopírovať modul';
1037var cms_js_lang_module_copy_question = 'Naozaj chcete kopírovať vybraný modul?';
1038
1039var cms_js_lang_module_multilang_dir_tip = 'Pre zobrazenie rôznych obrázkov v <strong>{langs}</strong> jazyku nahrajte obrázky do {dirs_count_title}:<ul><li>{dir_lang_list}</li></ul>';
1040var cms_js_lang_module_multilang_dir_tip_1_dir = 'adresára';
1041var cms_js_lang_module_multilang_dir_tip_more_dirs = 'adresárov';
1042var cms_js_lang_module_multilang_dir_tip_li_temp = '<strong>{dir_name}__{lang_lower}</strong> - pre {lang_upper} verziu stránok';
1043
1044var cms_js_lang_sitemap_title_as_h1 = '- rovnaký ako Názov stránky';
1045
1046var cms_js_lang_is_not_numeric = 'Nesprávny formát čísla.';
1047var cms_js_lang_user_list_no_access_section = 'Musíte povoliť aspoň 1 sekciu.';
1048var cms_js_lang_cfg_product_param_del_alert = 'Naozaj si prajete zmazať zvolené parametre?';
1049var cms_js_lang_cfg_product_param_del_assigned_title   = 'Zmazať parametre priradené k produktom';
1050var cms_js_lang_cfg_product_param_del_assigned_unit    = 'produktov';
1051var cms_js_lang_cfg_product_param_del_assigned_total   = 'Celkovo bude parameter odobraný z %s produktov.';
1052var cms_js_lang_cfg_product_param_del_assigned_confirm = 'Pre potvrdenie zadajte číslo %s:';
1053var cms_js_lang_cfg_product_param_del_assigned_error   = 'Zadané číslo sa nezhoduje s počtom produktov.';
1054
1055var cms_js_lang_cfg_product_new_attrib_value_error_3 = 'Hodnota pre atribút nesmie obsahovať úvodzovku ani apostrof!';
1056
1057var cms_js_lang_cfg_country_region_err = 'Je nutné zvoliť aspoň 1 štát.';
1058var cms_js_lang_cfg_country_region_select_all = 'kliknutím označíte všetky';
1059var cms_js_lang_cfg_country_region_deselect_all = 'kliknutím odznačíte všetky';
1060var cms_js_lang_cfg_country_region_select_def = 'kliknutím označíte pôvodné';
1061var cms_js_lang_cfg_country_region_protected_click = 'Štát "{country_name}" je už používaný systémom{country_protected_area}\nZ tohto dôvodu nie je možné tento štát odznačiť.';
1062var cms_js_lang_cfg_country_region_protected_click2 = ' pre:';
1063var cms_js_lang_cfg_country_region_protected_sections = {'order_user_info':'fakturačná alebo dodacia adresa zákazníka', 'shipping_rate':'spôsoby dodania', 'user_info':'fakturačná alebo dodacia adresa objednávky'};
1064var cms_js_lang_products_variant_fill = 'Zvýraznené polia variantov musia byť správne vyplnené';
1065var cms_js_lang_products_primary_category_out_of_range_text1 = 'Čitatelná URL adresa produktu je vytvorená podla kategórie \'';
1066var cms_js_lang_products_primary_category_out_of_range_text2 = '\', do ktorej však už produkt nie je zaradený.\nV záložke SEO teda zvolte inú kategóriu, prosím.'
1067var cms_js_lang_order_item_name_edit_err = 'Zadajte prosím správny názov produktu.';
1068
1069var cms_js_lang_phpshop_order_item_edit = 'Úprava položky objednávky';
1070var cms_js_lang_phpshop_order_item_edit_err1 = 'Novú položku objednávky nie je možné pridať, pretože objednávka už obsahuje inú položku s rovnakým kódom (príp. i atribútom) produktu!';
1071var cms_js_lang_phpshop_order_item_edit_err2 = 'Novú položku objednávky nie je možné pridať, z dôvodu zapnutej kontroly skladových zásob. Najvyššia možná hodnota pre množstvo je';
1072var cms_js_lang_phpshop_order_item_edit_err3 = 'Novú položku objednávky nie je možné pridať, pretože ste zadali prázdne (nulové) množstvo!';
1073var cms_js_lang_phpshop_product_price_old = 'pôvodne';
1074var cms_js_lang_phpshop_product_price_per_piece = 'Jednotková cena';
1075var cms_js_lang_phpshop_order_items_label_6 = 'JC bez DPH';
1076var cms_js_lang_phpshop_order_items_label_7 = 'JC s DPH';
1077var cms_js_lang_phpshop_order_items_alert_save = 'JC bez DPH má len informatívny charakter, ukladá sa JC s DPH, z ktorej sa následne dopočíta JC bez DPH.';
1078var cms_js_lang_phpshop_order_items_alert_save_wo_tax = 'JC s DPH má len informatívny charakter, ukladá sa JC bez DPH, z ktorej sa následne dopočíta JC s DPH.';
1079var cms_js_lang_phpshop_order_items_zero_title = 'Pre nastavenie ceny na 0, zadajte cenu v tvare 0.00001';
1080var cms_js_lang_phpshop_order_print_quantity = 'Množstvo';
1081var cms_js_lang_phpshop_product_list_name = 'Názov produktu';
1082var cms_js_lang_phpshop_product_variant = 'Variant produktu';
1083var cms_js_lang_phpshop_price_sum = 'Spolu';
1084var cms_js_lang_phpshop_product_variant_stock_error = 'V prípade zadania stavu na skladu pre variant, musia byť vyplnené všetky stavy na skladoch u variantov.';
1085var cms_js_lang_phpshop_product_variant_code_fill_error = 'Všetky kódy variantov musia byť vyplnené';
1086var cms_js_lang_phpshop_product_variant_code_duplicity_error = 'Kódy variantov musia byť unikátne a nesmú 
1086sa opakovať';
1087
1088var cms_js_lang_order_checkout_payment_need_admin_authorize = 'Chcete autorizovať platbu objednávky?';
1089
1090var cms_js_lang_checkout_unknown_error = '<p>Pravdepodobne z dôvodu nestabilného internetového pripojenia došlo k chybe.</p><p>Obnovte si stránku a akciu vykonajte ešte raz.</p>';
1091
1092var cms_js_lang_yes_C = 'Áno';
1093var cms_js_lang_no_C = 'Nie';
1094
1095
1096
1097var cms_js_lang_fb_logged_in = 'Prihlásenie cez Facebook prebehlo úspešne.';
1098var cms_js_lang_fb_login_link = 'Prihlásenie cez Facebook';
1099var cms_js_lang_wrong_format_http_301 = 'URL adresy webových stránok musia začínať s "http"';
1100var cms_js_lang_no_delimiter_301 = 'URL adresy webových stránok musia byť rozdelené bodkočiarkou ";"';
1101var cms_js_lang_same_url_on_one_line = 'Počiatočná a cielová adresa sa zhodujú';
1102var cms_js_lang_start_to_target_same = 'Už existuje presmerovanie na počiatočnú adresu';
1103var cms_js_lang_open_sef_error = 'Adresa %s1 na riadku %s2 je používaná na stránkach/článkoch';
1104var cms_js_lang_system_sef_error = 'Adresa %s1 na riadku %s2 je používaná v systéme';
1105var cms_js_lang_product_sef_error = 'Adresa %s1 na riadku %s2 je používaná produktom';
1106var cms_js_lang_product_sef_error2 = 'Produktová časť "%s1" v URL adrese "%s2", ktorú sa snažíte presmerovať na riadku %s3, je používaná existujúcim produktom.';
1107var cms_js_lang_product_sef_error3 = 'Riadok %s1 s URL adresou "%s2", kde sa snažíte presmerovať kategóriu, je potrebné odstrániť, pretože presmerovanie kategórií toho istého produktu funguje automaticky.';
1108var cms_js_lang_category_sef_error = 'Adresa %s1 na riadku %s2 je používaná kategóriami';
1109var cms_js_lang_error_on_line_num = 'chyba na riadku č. ';
1110var cms_js_lang_url_with_no_path = 'Adresa neobsahuje cestu';
1111var cms_js_lang_unknown_src_domain = 'Pozor, snažíte sa presmerovať cudziu doménu - kontaktujte nás';
1112
1113var cms_js_lang_price_category_free = 'Zadarmo';
1114var cms_js_lang_price_category_paid = 'Platené';
1115
1116
1117var cms_fill_message = 'Vyplňte prosím text správy.';
1118
1119js_import_product_data['product_tax_rate'] = 'sadzba DPH';
1120
1121var js_import_product_variants_help_text_intro = new Array();
1122    js_import_product_variants_help_text_intro[0] = 'Inštrukcie';
1123    js_import_product_variants_help_text_intro[1] = '';	//	'Pred nahratím CSV súboru si prosím pozrite návod ako importovať dáta variantov produktov. Návod v PDF formáte';
1124    js_import_product_variants_help_text_intro[2] = 'Formát CSV súboru je: '; 	//	'Tiež si stiahnite a pozrite vzorový CSV súbor';
1125    js_import_product_variants_help_text_intro[5] = '&nbsp;&nbsp;&nbsp;(<a href="#" style="font-size:10px" onclick="return js_dipv_toggle_display(\'#help_text_intro_21_show_more\');">zobraziť viac</a>)<br /><span id="help_text_intro_21_show_more" style="display:none;font-size:12px;color:#AAAAAA;margin-top:3px;margin-left:15px">- všetky položky v riadkoch by mali byť uzavreté v úvodzovkách, najmä "Variant",<br />- každý variant má názov a za dvojbodkou uvedenú hodnotu,<br />napr.: "Velkosť:45",<br />- zložený variant sa skladá z viacerých variantov oddelených bodkočiarkou,<br />napr.: "Velkosť:45;Farba:červeno-zelená",<br />- žiadny variant nesmie obsahovať znaky hranatých zátvoriek, ani zložených zátvoriek, ani čiarky ( t.j. znaky [ ] { } , ),<br />- žiadna položka v riadku nesmie obsahovať riadiaci znak ukončenia riadku (t.j. "enter"),<br />- nevyplnený (prázdny) údaj v položke riadku sa neimportuje, číselná hodnota "0" sa importuje ako "0",<br />- desatinnú časť číselných hodnôt je najlepšie oddelovať bodkou.</span>';
1126    js_import_product_variants_help_text_intro[3] = 'Pre potreby importu sa dá použiť CSV súbor získaný exportom variantov produktov.';
1127    js_import_product_variants_help_text_intro[4] = 'V prípade otázok alebo nefunkčnosti importu nám napíšte e-mail, radi Vám pomôžeme.';
1128
1129var js_import_product_variants_price_help_text_intro = new Array();
1130    js_import_product_variants_price_help_text_intro[0] = 'Inštrukcie';
1131    js_import_product_variants_price_help_text_intro[1] = '';	//	'Pred nahratím CSV súboru si prosím pozrite návod ako importovať dáta variantov produktov. Návod v PDF formáte';
1132    js_import_product_variants_price_help_text_intro[2] = 'Formát CSV súboru je: '; 	//	'Tiež si stiahnite a pozrite vzorový CSV súbor';
1133    js_import_product_variants_price_help_text_intro[5] = '&nbsp;&nbsp;&nbsp;(<a href="#" style="font-size:10px" onclick="return js_dipv_toggle_display(\'#help_text_intro_21_show_more\');">zobraziť viac</a>)<br /><span id="help_text_intro_21_show_more" style="display:none;font-size:12px;color:#AAAAAA;margin-top:3px;">- všetky položky v riadkoch by mali byť uzavreté v úvodzovkách,<br />- Názov atribútu a Názov položky sú identifikátorom konkrétneho variantu<br />- položky nesmú obsahovať znaky v hranatých zátvorkách, ani zložených zátvorkách, ani čiarky ( t.j. znaky [ ] { } , ),<br />- žiadna položka v riadku nesmie obsahovať riadiaci znak ukončenia riadku (t.j. "enter"),<br />- desatinnú časť číselných hodnôt je najlepšie oddelovať bodkou.</sp
1133an>';
1134    js_import_product_variants_price_help_text_intro[3] = 'Pre potreby importu sa dá použiť CSV súbor získaný exportom variantov produktov.';
1135    js_import_product_variants_price_help_text_intro[4] = 'V prípade otázok alebo nefunkčnosti importu nám napíšte e-mail, radi Vám pomôžeme.';
1136
1137var js_import_product_variants_data_import_type = new Array();
1138    js_import_product_variants_data_import_type[0] = 'chcem pridať varianty produktov (prvý import, resp. pridanie nových neexistujúcich variantov)';
1139    js_import_product_variants_data_import_type[1] = 'chcem aktualizovať existujúce varianty produktov (upravia sa vybrané vlastnosti už existujúcich variantov, napr. cena, zásoba, ...)';
1140
1141var js_import_category_info_1 = 'Zo stromu kategórií si zvolte kategóriu, ktorá bude slúžiť ako koreňová. Všetky kategórie zo súboru sa naimportujú do nej.';
1142var js_import_category_info_2 = 'Stiahnite si vzorový XML súbor:';
1143var js_import_category_info_3 = 'V súbore pre import je potrebné zachovať kódovanie "windows-1250" a názvy kategórií zabaliť do CDATA tagu.';
1144
1145var cms_js_lang_phpshop_product_img_tag_file_name_alert_01 = 'Nahraný obrázok má odlišný formát a typ (napr. pôvodný "png" alebo "bmp" obrázok má koncovkou "jpg" a pod.)';
1146
1147var js_global_valums_file_uploader_lang_01 = "Súbor {file} má neplatnú príponu. Povolené prípony sú: {extensions}.";
1148var js_global_valums_file_uploader_lang_02 = "Súbor {file} je príliš velký, maximálna velkosť súboru je {sizeLimit}.";
1149var js_global_valums_file_uploader_lang_03 = "Súbor {file} je príliš malý, minimálna velkosť súboru je {minSizeLimit}.";
1150var js_global_valums_file_uploader_lang_04 = "Súbor {file} je prázdny, vyberte súbory opäť, bez neho.";
1151var js_global_valums_file_uploader_lang_05 = "Súbory sú práve nahrávané, ak teraz odídete, tak nahrávanie bude zrušené.";
1152var js_global_valums_file_uploader_lang_06 = "Pre nahranie pustite súbory sem.";
1153var js_global_valums_file_uploader_lang_07 = "Nahrať súbor";
1154var js_global_valums_file_uploader_lang_08 = "Zrušiť";
1155var js_global_valums_file_uploader_lang_09 = "Neúspešné";
1156var js_global_valums_file_uploader_lang_10 = "element nebol nájdený";
1157var js_global_valums_file_uploader_lang_11 = "z";
1158var js_global_valums_file_uploader_lang_12 = "súbor s uvedeným id nebol pridaný, alebo je už nahraný / zrušený";
1159var js_global_valums_file_uploader_lang_13 = "Uvedený obj nie je v súbore (v qq.UploadHandlerXhr)";
1160var js_global_valums_file_uploader_lang_14 = "Nahrať hlavný obrázok";
1161var js_global_valums_file_uploader_lang_15 = "Nahrať ďalšie obrázky";
1162
1163var cms_js_lang_phpshop_book_author_name_too_short = 'Meno autora je príliš krátke.';
1164var cms_js_lang_phpshop_book_author_does_not_exist = 'Zadaný autor neexistuje.';
1165var cms_js_lang_phpshop_book_author_author = 'Autor';
1166var cms_js_lang_phpshop_book_author_was_added = 'bol pridaný.';
1167var cms_js_lang_phpshop_book_author_remove_confirm = 'Prajete si odobrať autora zo zoznamu autorov tohto titulu?';
1168var cms_js_lang_phpshop_book_author_not_found = 'Autor nenájdený. Skontrolujte zadané meno alebo vytvorte nového autora.';
1169
1170var cms_js_lang_phpshop_gift_added_info = 'Darček %gift_name% bol zdarma pridaný do Vášho košíka.';
1171
1172var cms_js_lang_phpshop_newsletter_edit_html_code 	= 'Upraviť HTML kód';
1173var cms_js_lang_phpshop_newsletter_show_preview 	= 'Zobraziť náhlad newslettera';
1174var cms_js_lang_phpshop_newsletter_save_html_file 	= 'Uložiť HTML súbor';
1175var cms_js_lang_phpshop_newsletter_lang_of_export 	= 'Jazyk exportu';
1176var cms_js_lang_phpshop_newsletter_chosen_lang 		= 'Zvolený jazyk';
1177var cms_js_lang_phpshop_newsletter_showed_prods 	= 'zobrazených %num_of_displayed_prods% z %num_of_selected_prods% produktov.';
1178var cms_js_lang_phpshop_newsletter_sk_lang 			= 'Slovenčina';
1179var cms_js_lang_phpshop_newsletter_en_lang 			= 'Angličtina';
1180var cms_js_lang_phpshop_newsletter_cz_lang 			= 'Čeština';
1181var cms_js_lang_phpshop_newsletter_pl_lang 			= 'Polština';
1182var cms_js_lang_phpshop_newsletter_hu_lang 			= 'Maďarčina';
1183var cms_js_lang_phpshop_newsletter_ro_lang 			= 'Rumunčina';
1184var cms_js_lang_phpshop_newsletter_auto_code_save	= 'Zmeny v kóde sa ukladajú automaticky.';
1185
1186var cms_js_lang_phpshop_etiquette_print_file = 'Tlačiť štítky';
1187var cms_js_lang_phpshop_etiquette_save_to_pdf = 'Uložiť ako PDF';
1188
1189var cms_js_lang_phpshop_etiquette_paper_size = 'Veľkosť papiera:';
1190var cms_js_lang_phpshop_etiquette_paper_orientation = 'Orientácia papiera';
1191var cms_js_lang_phpshop_etiquette_pdf_template = 'PDF šablóna';
1192var cms_js_lang_phpshop_etiquette_hide_price = 'Generovať bez cien';
1193
1194var cms_js_lang_phpshop_etiquette_reorder = 'Zmeniť poradie štítkov';
1195var cms_js_lang_phpshop_etiquette_reorder_title = 'Zmena poradia štítkov:';
1196var cms_js_lang_phpshop_etiquette_reorder_fail = 'Nepodarilo sa uložiť poradie štítkov';
1197var cms_js_lang_phpshop_etiquette_reorder_success = 'Uložené poradie štítkov';
1198
1199var cms_js_lang_only_gift_product = 'Produkt je samostatne nepredajný, a je určený pre funkciu darčekov.';
1200var cms_js_lang_free_gift = 'Darček_zadarmo_';
1201var cms_js_lang_free_gift_text = 'Vybrať ako darček zadarmo';
1202var cms_js_lang_free_gift_group = 'Darčeky od';
1203var cms_js_lang_free_gift_motivational_block = 'Pre odomknutie tohto darčeka je potrebné nakúpiť aspoň za ';
1204
1205var cms_js_lang_admin_purchase_price = 'Nákupná cena';
1206var cms_js_lang_admin_sell_price = 'Cena';
1207
1208var cms_js_lang_admin_wrong_time_format = 'Nesprávny formát času. Použite hh:mm';
1209
1210var cms_js_lang_supplier_order_number_entry_search = 'zadajte číslo dod. obj.';
1211var cms_js_lang_tracking_id_entry_search = 'zadajte číslo zásielky';
1212
1213var cms_js_lang_add_param_to_short_description_button_title = 'Pridať parameter do krátkeho popisu';
1214var cms_js_lang_add_param_to_short_description_button = 'Pridať do popisu';
1215
1216var js_lang_osch_confirm_order_text = 'Naozaj si prajete potvrdiť Vašu objednávku?';
1217
1218var cms_js_admin_product_bulk_discount_message_1 = 'Hodnota v tomto poli musí byť číselná';
1219var cms_js_admin_product_bulk_discount_message_2 = 'V tomto poli ste nezadali žiadnu hodnotu';
1220var cms_js_admin_product_bulk_discount_message_3 = 'Hodnota tohoto pola musí byť väčšia ako hodnota "od"';
1221var cms_js_admin_product_bulk_discount_message_4 = 'Táto hodnota musí byť väčšia ako hodnota "do" predošlej položky';
1222var cms_js_admin_product_bulk_discount_message_5 = 'Zlava nemôže prekročiť hodnotu 100%';
1223var cms_js_admin_product_bulk_discount_message_6 = 'Hodnota "od" nemôže byť nulová';
1224var cms_js_admin_product_bulk_discount_message_7 = 'Nemožno pridať dalšiu položku, ak posledná hodnota "do" je nekonečná';
1225var cms_js_admin_product_bulk_discount_message_8 = 'Táto zlava je menšia alebo rovnaká ako predošlá';
1226var cms_js_admin_product_price_level_no_group_selected_message = 'Vyberte si zákaznícku skupinu.';
1227var cms_js_lang_member_zone_cancel_subsc_dialog = 'Naozaj chcete zrušiť svoje členstvo? Peniaze Vám nebudú vrátené späť.';
1228var cms_js_lang_member_zone_change_subsc_dialog = 'Naozaj chcete požiadať o zmenu typu predplatného v členskej zóne? Ak áno, budeme Vás kontaktovať prostredníctvom e-mailu.';
1229var cms_js_lang_member_zone_cancel_subsc_message_suc = 'Požiadavka na zrušenie členstva bola úspešne odoslaná správcovi';
1230var cms_js_lang_member_zone_cancel_subsc_message_err = 'Požiadavka na zrušenie členstva nebola zaslaná!';
1231var cms_js_lang_member_zone_change_subsc_message_suc = 'Požiadavka na zmenu typu členstva bola úspešne odoslaná správcovi';
1232var cms_js_lang_member_zone_change_subsc_message_err = 'Požiadavka na zmenu typu členstva nebola zaslaná!';
1233var cms_js_lang_loyalty_system_infinity_value = 'Posledná hodnota "do" nemôže byť nekonečná';
1234var cms_js_lang_loyalty_system_resolve_errors_first = 'Pred pridaním nového intervalu vyriešte všetky chyby';
1235
1236var cms_js_lang_admin_cfg_migration_no_www_proceed = 'Ostrá doména neobsahuje "www." - prajete si pokračovať?';
1237var cms_js_duplicity = 'Zadaná hodnota je duplicitná.';
1238var cms_js_back_to_basket = 'Späť do košíka';
1239var cms_js_confirm_order = 'Potvrdiť objednávku s úhradou';
1240var cms_js_confirm_avail_notify_in_cart = 'Potvrdiť a pokračovať';
1241var cms_js_check_stock_with_return_strct_check_text1 = 'Tieto produkty sú momentálne nedostupné, preto nemôžete dokončiť nákup:';
1242var cms_js_check_stock_with_return_strct_check_text2 = 'Vráťte sa do košíka a odstráňte z neho produkty, ktoré práve nie sú skladom.';
1243var cms_js_check_stock_with_return_text1 = 'Tieto produkty sú momentálne nedostupné, preto bude odoslanie zásielky trvať o niečo dlhšie:';
1244var cms_js_check_stock_with_return_text2 = 'Pokiaľ Vám neprekáža na zásielku počkať, kým budú tieto produkty dostupné, stlačte tlačidlo <b>"' + cms_js_confirm_order + '"</b>.<br/> V opačnom prípade sa vráťte do košíka a odstráňte z neho produkty, ktoré práve nie sú skladom.';
1245var js_lang_phpshop_product_form_show_flypage = 'Náhlad stránky produktu v obchode.';
1246var js_lang_phpshop_product_unpublished = 'Produkt je skrytý';
1247var js_lang_phpshop_product_category_not_defined = 'Produkt nemá priradenú kategóriu';
1248
1249var cms_js_apps_button_activated = 'Aktivované';
1250var cms_js_apps_button_activate = 'Aktivovať';
1251var cms_js_apps_admin_detail_activation_help = 'Pomoc s aktiváciou';
1252var cms_js_apps_card_activation_help = 'Mám záujem';
1253var cms_js_apps_button_activate_free = 'Mám záujem';
1254var cms_js_apps_all_apps = 'Všetky aplikácie';
1255var cms_js_apps_more_info = 'Viac info';
1256var cms_js_apps_will_contact = 'Ozveme sa';
1257var cms_js_apps_payment_waiting = 'Čaká na aktiváciu';
1258var cms_js_apps_news_for = 'Novinky za';
1259var cms_js_apps_quarter = 'štvrťrok';
1260var cms_js_apps_help_mail_info = 'E-mail s požiadavkou nám bol zaslaný, ďakujeme za záujem. <br> Budeme Vás kontaktovať s informáciami o aktivácii.';
1261
1262var cms_js_image = "Obrázok";
1263var cms_js_txtOf = 'z';
1264var cms_js_prev = 'PRED.';
1265var cms_js_next = 'ĎALŠÍ';
1266
1267var cms_js_sort_tabs = {
1268	'new': 'Najnovšie',
1269	'old': 'Najstaršie',
1270	'cheap': 'Najlacnejšie',
1271	'expensive': 'Najdrahšie',
1272	'aToZ': 'A do Z',
1273	'zToA': 'Z do A',
1274	'bestsellers': 'Najpredávanejšie',
1275	'top': 'Top Produkty',
1276	'stock': 'Množstvo na sklade',
1277	'standard': 'Štandardné poradie',
1278	'price': 'Cena',
1279	'name': 'Názov produktu'
1280};
1281
1282var cms_js_accept_cookies_text = 'Táto webová stránka používa cookies. Kliknutím na tlačidlo "OK" súhlasíte s ich používaním.';
1283var cms_js_accept_cookies_text_accept = 'OK';
1284var cms_js_lang_phpshop_zasilkovna_alert_sel = 'V spôsoboch dopravy prosím vyberte pobočku';
1285var cms_js_lang_balik_na_postu_opening_hours = 'Otváracie hodiny';
1286var cms_js_lang_balik_na_postu_phone_number = 'Telefonický kontakt';
1287var cms_js_lang_balik_na_postu_services = 'Služby';
1288
1289var js_lang_phpshop_product_unavailable = 'Predaj skončil';
1290
1291var js_lang_phpshop_product_oos2pu = 'Produkt je vypredaný';
1292
1293var js_lang_admin_config_smtp_confirm_username = "Naozaj chcete zmeniť SMTP údaje?\nUžívatelské meno: ";
1294var js_lang_admin_config_smtp_confirm_change_to = "\nNa: ";
1295var js_lang_admin_config_smtp_confirm_password = "Naozaj chcete zmeniť heslo na SMTP účte: ";
1296var js_lang_admin_config_smtp_confirm_host = "Naozaj chcete zmeniť SMTP server?\nZ: ";
1297var js_lang_admin_config_smtp_confirm_settings = "Naozaj chcete zmeniť nastavenie SMTP servera?\n";
1298
1299var js_lang_admin_config_order_state_meaning = "Prosím, nastavte význam stavu objednávky.";
1300
1301var js_lang_da_select_attributte = 'Prosím, vyberte si z ponuky skupinu atribútov.';
1302var js_lang_da_special_only_for_nondef = 'Špeciálne zobrazenie sa nedá zvoliť pre tento typ zobrazenia.';
1303var js_lang_da_select_display_type = 'Prosím zvolte typ zobrazenia pre túto skupinu.';
1304var js_lang_da_select_family_name = 'Zadajte názov rodiny pre lahšiu identifikáciu.';
1305
1306var cms_js_open_all = 'Otvoriť položky stromu kategórií.';
1307var cms_js_close_all = 'Zavrieť položky stromu kategórií.';
1308var cms_js_show_checked = 'Zobraziť iba označené kategórie';
1309var cms_js_iterate_selected = 'Kliknutím prejdete na ďalšiu označenú kategóriu.';
1310var cms_js_iterate_found = 'Kliknutím prejdete na ďalšiu nájdenú kategóriu.';
1311var cms_js_iterate_notfound = 'Hľadanie nenašlo žiadne výsledky.';
1312var cms_js_show_all = 'Zobraziť všetky kategórie';
1313var cms_js_search_in_category = 'Vyhľadať v kategórii'; // _PHPSHOP_PARAMETER_SEARCH_IN_CATEGORY
1314var cms_js_category_filter = 'Zobraziť iba nájdené kategórie.'; // _NEW_CATEGORY_FILTER
1315var cms_js_category_chain_parent = 'Označením kategórie sa označia aj všetky jej nadradené.'; // _NEW_CATEGORY_CHAIN_PARENT
1316var cms_js_category_chain_child = 'Označením / odznačením kategórie sa rovnako zmenia aj všetky jej podradené.'; // _NEW_CATEGORY_CHAIN_CHILD
1317
1318var cms_dropzone_drop_images_here = 'Kliknite a nahrajte obrázok ';
1319var cms_dropzone_remove_file = 'Odstrániť';
1320
1321var js_lang_product_attribute_unavailable = 'Produkt vo variante "{variant}: {value}" je nedostupný. Prosím vyberte si iný dostupný variant.';
1322var js_lang_product_attribute_unavailable_2 = 'Produkt v tejto kombinácií atribútov nie je momentálne na sklade.';
1323var js_lang_product_attribute_unavailable_3 = 'Atribút {clicked} nie je dostupný v požadovanej kombinácii:\n{clicked} , {other_attribs}\n\nPrajete si vybrať {clicked} s inou kombináciou?';
1324
1325var cms_js_lang_group_of_articles = 'Skupina článkov';
1326var cms_js_lang_all = 'všetky';
1327var cms_js_lang_from = 'od';
1328var cms_js_lang_from_specific_pages = 'z konkrétnych stránok';
1329var cms_js_lang_number_of_article_in_group = 'Počet Článkov v skupine';
1330var cms_js_lang_article_sorting = 'Zoradenie článkov';
1331var cms_js_lang_from_newest = 'od najnovšieho';
1332var cms_js_lang_random_for_x_days = 'náhodné pre x dní';
1333var cms_js_lang_random_everytime = 'vždy náhodné';
1334var cms_js_lang_articles_inline = 'články vedla seba';
1335
1336var cms_js_lang_order_sum_tooltip_qty = 'Počet vybraných objednávok';
1337var cms_js_lang_order_sum_tooltip_total = 'Suma objednávok';
1338
1339var cms_js_lang_articles_block_setting_num_of_articles_at_full_width = 'Počet článkov na celú šírku (štandardne):';
1340var cms_js_lang_articles_block_setting_num_of_columns_for_articles = 'Počet stĺpcov pre ďalšie články (pod štandardnými článkami):';
1341var cms_js_lang_articles_block_setting_num_of_articles_in_columns = 'Počet ďalších článkov v stĺpcoch:';
1342var cms_js_lang_articles_block_setting_num_of_articles_as_links = 'Počet článkov ako URL odkazov (pod sĺpcovými článkami):';
1343var cms_js_lang_articles_block_setting_pages_name_with_articles = 'Názov stránky s článkami:';
1344var cms_js_lang_articles_block_setting_not_show_page_name = 'nezobrazovať';
1345var cms_js_lang_articles_block_setting_show_page_name = 'zobrazovať';
1346var cms_js_lang_articles_block_setting_disqus_allowed = 'Povoliť DISQUS (externá funkcia komentárov ku článkom)';
1347
1348// DA Backend
1349var js_lang_dynamic_attributes_datacpyok = 'Dáta boli úspešne skopírované do schránky';
1350var js_lang_dynamic_attributes_bndenaerr = 'Ohraničujúcu oblasť pre skupinu je potrebné najprv povoliť.';
1351var js_lang_dynamic_attributes_bndunaerr = 'Skupina technicky nemôže používať ohraničujúcu oblasť.';
1352var js_lang_dynamic_attributes_rngcpycol = 'Rozpätie bolo úspešne kopírované. Zmeňte prosím jeho podmienku alebo hodnoty.';
1353var js_lang_dynamic_attributes_layer_sucess = 'Úprava vrstvy prebehla v poriadku.';
1354var js_lang_dynamic_attributes_layer_error = 'Úprava vrstvy zlyhala.';
1355var js_lang_dynamic_attributes_text_align = 'Zarovnanie textu';
1356var js_lang_dynamic_attributes_text_max_chrars = 'Maximálny počet znakov';
1357var js_lang_dynamic_attributes_align_left = 'Vlavo';
1358var js_lang_dynamic_attributes_align_center = 'Centrovať';
1359var js_lang_dynamic_attributes_align_right = 'Vpravo';
1360var js_lang_dynamic_attributes_text_count = 'Počítanie znakov';
1361var js_lang_dynamic_attributes_text_size = 'Velkosť fontu';
1362var js_lang_dynamic_attributes_font_type = 'Názov fontu';
1363var js_lang_dynamic_attributes_text_color = 'Farba fontu';
1364var js_lang_dynamic_attributes_min_dpi = 'Minimálne DPI';
1365var js_lang_dynamic_attributes_min_dpi_title = 'Ak viac ako 0 a obrázok bude mať menšie DPI rozlíšenie než je táto hodnota, zákazníkovi sa zobrazí upozornenie o nekvalitnom obrázku.';
1366var js_lang_dynamic_attributes_max_image_size = 'Max. velkosť obrázka';
1367var js_lang_dynamic_attributes_max_image_size_title = 'Maximálna velkosť obrázka v MB ktorú užívatel môže nahrať na server.';
1368var js_lang_dynamic_attributes_ovr = 'Každý obrázok bude overlay';
1369var js_lang_dynamic_attributes_ovr_title = 'Nastavenim tejto volby, sa všetky obrázky v skupine vykreslia ako overlay. Overlay je vykreslený vždy ako posledný bez ohladu na poradie vrstvy. Overlay sa nedá upravovať.';
1370var js_lang_dynamic_attributes_save_to_apply = 'Pre aplikovanie zmien stlačte uložiť.';
1371var js_lang_dynamic_attributes_palett_inter = 'Interaktívny výber';
1372var js_lang_dynamic_attributes_palett_inter_title = 'Zaškrtnutím tejto volby, bude možné meniť hodnotu skupiny kliknutím na ikonu priamo v konfigurátore';
1373var js_lang_dynamic_attributes_palett_ico = 'Typ ikony v konfigurátore';
1374var js_lang_dynamic_attributes_palett_ico_title = 'Vyberte si typ ikony ktorá bude zobrazená v konfigurátore. Môžete si nahrať jednu vlastnú ikonu vo formáte .svg';
1375var js_lang_dynamic_attributes_ovr_pick = 'Nahrať obrázok ako overlay';
1376var js_lang_dynamic_attributes_src_del_error = 'Nastala chyba pri mazaní súboru.';
1377var js_lang_dynamic_attributes_src_del_sucess = 'Súbor bol úspešne zmazaný.';
1378var js_lang_dynamic_attributes_ovr_pick_title = 'Môžete nastaviť jeden obrázok ako overlay. Uistite sa že má presné rozmery ako všetky obrázky v skupine.';
1379var js_lang_dynamic_attributes_max_images = 'Max. počet obrázkov';
1380var js_lang_dynamic_attributes_max_images_title = 'Maximálny počet obrázkov v návrhu konfigurátora pre skupinu';
1381var js_lang_dynamic_attributes_edit_group_layer = 'Editovať zobrazenie vrstvy';
1382var js_lang_dynamic_attributes_edit_active = 'Prebieha editácia vrstvy';
1383var js_lang_dynamic_attributes_edit_group = 'Editovať zobrazenie skupiny';
1384var js_lang_dynamic_attributes_act_r_alert = 'Všetky aktivátori tejto skupiny budú zmazané. Pokračovať?';
1385var js_lang_dynamic_attributes_grp_r_alert = 'Skupina bude odobratá od tejto schémy, to sa prejaví aj u produktov ktoré majú priradenú túto schému. Pokračovať?';
1386var js_lang_dynamic_attributes_prod_r_alert = 'Naozaj si želáte odobrať túto položku zo skupiny? <br/> Budú odstránené aj všetky jej údaje ako obrázky, atď...';
1387var js_lang_dynamic_attributes_link_rule_r_alert = 'Naozaj si želáte odstrániť pravidlá odkazov zo skupiny? <br/>Budú zmazané aj všetky vytvorené odkazy pre túto skupinu.';
1388var js_lang_dynamic_attributes_fml_r_alert = 'Naozaj si želáte zmazať túto rodinu?';
1389var js_lang_dynamic_attributes_template_r_alert = 'Naozaj si želáte zmazať túto predlohu?';
1390var js_lang_dynamic_attributes_sch_d_alert = 'Táto schéma bude zmazaná a odobratá od produktov ktoré sú k nej priradené. Pokračovať?';
1391var js_lang_dynamic_attributes_sch_c_alert = 'Kopírovať schému';
1392var js_lang_dynamic_attributes_copy_ok = 'Dáta boli kopírované do schránky';
1393var js_lang_dynamic_attributes_paste_err = 'Nemáte žiadne dáta v schránke';
1394var js_lang_dynamic_attributes_ref_set_msg = 'Nastavenie referenčnej hodnoty';
1395var js_lang_dynamic_attributes_calc_del_alert = 'Naozaj si želáte zmazať nastavenú rovnicu kalkulácie prepočtu tejto skupiny?';
1396var js_lang_dynamic_attributes_change_display_alert = 'Zmenou typu zobrazenia budú resetované všetky už nastavené hodnoty skupiny.
1396<br/>Prajete si pokračovať?';
1397var js_lang_dynamic_attributes_reset_ordering_title = 'Resetovanie poradia hodnôt';
1398var js_lang_dynamic_attributes_reset_ordering_alert = 'Naozaj si želáte resetovať poradie hodnôt v skupine?<br/>Bude aplikované základné poradie.';
1399var js_lang_dynamic_attributes_pick_scheme_alert = 'Prosím zvoľte si schému';
1400var js_lang_dynamic_attributes_sch_c_name = 'Nový názov schémy';
1401var js_lang_dynamic_attributes_sch_c_name_place = 'Zadajte názov schémy';
1402var js_lang_dynamic_attributes_add_param = 'Pridanie parametra';
1403var js_lang_dynamic_attributes_sch_c_asign = 'Priradiť novo vytvorenú kópiu schémy k tomuto produktu';
1404var js_lang_dynamic_attributes_sch_r_alert = 'Táto schéma bude odobratá od tohto produktu. Pokračovať?';
1405var js_lang_dynamic_attributes_field_numeric = 'Hodnota pre toto pole musí byť číselná';
1406var js_lang_dynamic_attributes_save_sucess = 'Uloženie prebehlo správne.';
1407var js_lang_dynamic_attributes_action_sucess = 'Akcia prebehla úspešne.';
1408var js_lang_dynamic_attributes_changes_sucess = 'Zmeny prebehly úspešne.';
1409var js_lang_dynamic_attributes_action_error = 'Nastala neznáma chyba pri tejto akcii.';
1410var js_lang_dynamic_attributes_save_error = 'Nastala chyba pri ukladaní dát.';
1411var js_lang_dynamic_attributes_delete_sucess = 'Zmazanie dát prebehlo správne.';
1412var js_lang_dynamic_attributes_delete_confirm = 'Naozaj si želáte zmazať tento súbor?';
1413var js_lang_dynamic_attributes_delete_error = 'Nastala chyba pri mazaní dát.';
1414var js_lang_dynamic_attributes_save_warning = 'Táto skupina nemá žiadne nastavenia.';
1415var js_lang_dynamic_attributes_upload_error = 'Súbor sa nepodarilo nahrať na server.';
1416var js_lang_dynamic_attributes_upload_sucess = 'Súbor bol úspešne odoslaný na server.';
1417var js_lang_dynamic_attributes_use_fonts = 'Používať fonty';
1418var js_lang_dynamic_attributes_ds_type = 'Geometria premietania';
1419var js_lang_dynamic_attributes_ds_type_title = 'Zvolte aký typ geometrie bude použitý pri premietaní v konfigurátore.';
1420var js_lang_dynamic_attributes_ds_rectangle = 'Obdĺžnik';
1421var js_lang_dynamic_attributes_ds_square = 'Å tvorec';
1422var js_lang_dynamic_attributes_ds_circle = 'Kruh';
1423var js_lang_dynamic_attributes_ds_w = 'Referenčná šírka';
1424var js_lang_dynamic_attributes_ds_w_title = 'Zvolte skupinu, ktorej hodnota sa bude aplikovať pre šírku premietania. Táto hodnota je povinná stále.';
1425var js_lang_dynamic_attributes_ds_h = 'Referenčná výška';
1426var js_lang_dynamic_attributes_ds_h_title = 'Zvolte skupinu, ktorej hodnota sa bude aplikovať pre výšku premietania. Táto hodnota je povinná iba pre typ obdĺžnik.';
1427var js_lang_dynamic_attributes_ds_q = 'Zobraziť kótovanie';
1428var js_lang_dynamic_attributes_ds_q_title = 'Zvolte či sa má zobraziť kótovanie pre geometriu tienenia a aké kóty majú byť zobrazené.';
1429var js_lang_dynamic_attributes_layer_editable = 'Vrstva editovatelná';
1430var js_lang_dynamic_attributes_layer_editable_title = 'Zaškrtnutím tejto volby, má zákazník možnosť interaktívne editovať túto vrstvu a jej obsah.';
1431var js_lang_dynamic_attributes_pb_elems = 'Položky úprav';
1432var js_lang_dynamic_attributes_pb_elems_title = 'Vyberte položky ktoré budú dostupné pri úprave elementu pre túto skupinu.';
1433var js_lang_dynamic_attributes_pb_lay = 'Vrstva';
1434var js_lang_dynamic_attributes_pb_sca = 'Velkosť';
1435var js_lang_dynamic_attributes_pb_mov = 'Posun';
1436var js_lang_dynamic_attributes_pb_rot = 'Natočenie';
1437var js_lang_dynamic_attributes_pb_ste = 'Krokovanie';
1438var js_lang_dynamic_attributes_pb_fli = 'Zrkadlenie';
1439var js_lang_dynamic_attributes_pb_res = 'Reset';
1440var js_lang_dynamic_attributes_pb_fot = 'Výber fontu';
1441var js_lang_dynamic_attributes_pb_foa = 'Zarovnanie textu';
1442var js_lang_dynamic_attributes_pb_foh = 'Výška riadku';
1443var js_lang_dynamic_attributes_pb_col = 'Farba';
1444var js_lang_dynamic_attributes_all = 'Všetky';
1445var js_lang_dynamic_attributes_pb_up = 'Presunie objekt o vrstvu nahor';
1446var js_lang_dynamic_attributes_pb_down = 'Presunie objekt o vrstvu nadol';
1447var js_lang_dynamic_attributes_disable = 'Zakázať';
1448var js_lang_dynamic_attributes_selected = 'Vybrané';
1449var js_lang_dynamic_attributes_def_fonts = 'Predvolený font';
1450var js_lang_dynamic_attributes_def_fonts_title = 'Zadajte font, ktorý bude predvolený pri načítaní tejto skupiny. Ak prázdne, bude sa brať prvý dostupný font.';
1451var js_lang_dynamic_attributes_can_obj = 'Výber objektu';
1452var js_lang_dynamic_attributes_can_obj_title = 'Kliknite na ikonu, vyberie sa objekt ktorý budete môcť následne upraviť.';
1453var js_lang_dynamic_attributes_sel_obj_elem = 'Hlavný objekt';
1454var js_lang_dynamic_attributes_sel_obj_bound = 'Ohraničujúci objekt';
1455var js_lang_dynamic_attributes_use_fonts_title = 'Zákazník si môže zvoliť font z výberu. K dispozícií budú fonty nahrané v priečinku Fonts v správe súborov. Fonty musia mať príponu .ttf (malé písmená) a názov nesmie obsahovať medzeru. Znak _ sa automaticky konvertuje na medzeru.';
1456var js_lang_dynamic_attributes_bind_prod_title = 'Priradenie produktu k atribútu';
1457var js_lang_dynamic_attributes_no_prod_found = 'Žiadny produkt s týmto kódom sa nenašiel';
1458// DA Frontend
1459var js_lang_dynamic_attributes_version_confirm = 'Verzia schémy alebo skryptov sa zmenila! Je tu malá šanca že vaša konfigurácia bude nekompletná alebo nesprávna. Chcete pokračovať v práci na tejto konfigurácii?';
1460var js_lang_dynamic_attributes_cfg_palettdef_title = 'Ak prehlia
1460dač nezobrazuje paletu správne, môžete zmeniť typ zobrazenia';
1461var js_lang_dynamic_attributes_cfg_reset = 'Resetovať';
1462var js_lang_dynamic_attributes_cfg_reset_title = 'Resetovať návrh do pôvodneho stavu';
1463var js_lang_dynamic_attributes_save = 'Uložiť zmeny';
1464var js_lang_dynamic_attributes_copy = 'Upraviť';
1465var js_lang_dynamic_attributes_loading = 'Načítavam';
1466var js_lang_dynamic_attributes_new_item = 'Nová položka';
1467var js_lang_dynamic_attributes_modify_item = 'Upravujete položku ktorá sa už nachádza v košíku.';
1468var js_lang_dynamic_attributes_duplicate_item = 'Teraz môžete zmeniť atribúty a vložiť do košíka.';
1469var js_lang_dynamic_attributes_price_total = 'Celková cena objednávky';
1470var js_lang_dynamic_attributes_duplicate = 'Duplikovať';
1471var js_lang_dynamic_attributes_min_alert = 'Minimálna hodnota pre toto pole je';
1472var js_lang_dynamic_attributes_max_alert = 'Maximálna hodnota pre toto pole je';
1473var js_lang_dynamic_attributes_carterror = 'Nastala chyba pri spracovaní požiadavky. Obnovte stránku a opakujte akciu.';
1474var js_lang_dynamic_attributes_pb_help = 'Vyberte objekt z obrázka alebo kliknite na skupinu pri volbách.';
1475var js_lang_dynamic_attributes_pb_cancel = 'Ukončiť úpravu a zrušiť označenie';
1476var js_lang_dynamic_attributes_pb_title = 'Editácia objektov';
1477var js_lang_dynamic_attributes_delete = 'Zmazať';
1478var js_lang_dynamic_attributes_low_res = 'Obrázok má nízke rozlíšenie a produkt nemusí byť spracovaný kvalitne.';
1479var js_lang_dynamic_attributes_low_res_tip = 'Pre kvalitnú tlač používajte rozlíšenie minimálne ';
1480var js_lang_dynamic_attributes_cfg_dwn = 'Stiahnuť';
1481var js_lang_dynamic_attributes_cfg_dwn_title = 'Stiahnúť náhlad návrhu ako obrázok';
1482var js_lang_dynamic_attributes_field_required = 'Hodnota pre toto pole je povinná';
1483var js_lang_dynamic_attributes_sm_title = 'Súhrn zvolených kombinácii';
1484var js_lang_dynamic_attributes_lm_title = 'Poslať túto konfiguráciu na email';
1485var js_lang_dynamic_attributes_lm_btn = 'Poslať';
1486var js_lang_dynamic_attributes_std_feat_title = 'Štandardná výbava';
1487var js_lang_dynamic_attributes_numeric_alert = 'Hodnota v tomto poli musí byť číselná';
1488var js_lang_dynamic_attributes_misconf_warn = 'Prostredie pre túto aplikáciu nie je správne nastavené, kontaktujte správcu.';
1489var js_lang_dynamic_attributes_reqerror = 'Zvýraznené položky sú povinné.';
1490var js_lang_dynamic_attributes_experror = 'Export konfigurátora zlyhal. Prosím obnovte stránku a skúste to ešte raz.';
1491var js_lang_dynamic_attributes_maxfiles_warn = 'Maximálny počet nahraných súborov je {{maxFiles}}';
1492var js_lang_dynamic_attributes_maxfilesize_warn = 'Veľkosť tohoto súboru je {{filesize}}Mb, ktorá prekračuje maximálne povolenú hranicu {{maxFilesize}}Mb';
1493var js_lang_dynamic_attributes_drop_here = 'Kliknite a nahrajte obrázok';
1494var js_lang_dynamic_attributes_drop_remove = 'Odstrániť';
1495var js_lang_dynamic_attributes_printing_alert = 'Rozmery a umiestnenie potlače nie sú nastavené!';
1496var js_lang_dynamic_attributes_price_offer = 'Cenová ponuka';
1497
1498var js_lang_sphf_transfer_to_admin = 'Preniesť výsledky do admin filtra';
1499var js_lang_sphf_remove_all_filters = 'Odstrániť všetky filtre';
1500var js_lang_sphf_all = 'Všetko';
1501var js_lang_sphf_from = 'z';
1502var js_lang_sphf_filter_active = 'Máte aktívny filter:';
1503var js_lang_sphf_more_results = 'Viac';
1504var js_lang_sphf_less_results = 'Menej';
1505var js_lang_sphf_no_results = 'Žiadne výsledky';
1506var js_lang_sphf_show = 'Zobraziť';
1507var js_lang_sphf_found1 = 'Nájdený';
1508var js_lang_sphf_found2 = 'Nájdené';
1509var js_lang_sphf_found3 = 'Nájdených';
1510var js_lang_sphf_result_1 = 'výsledok';
1511var js_lang_sphf_result_2 = 'výsledky';
1512var js_lang_sphf_result_3 = 'výsledkov';
1513var js_lang_sphf_pag_next = 'Zobraziť ďalších {+}'; // @deprecated
1514var js_lang_sphf_pag_next1 = 'Zobraziť ďalší {+}';
1515var js_lang_sphf_pag_next2 = 'Zobraziť ďalšie {+}';
1516var js_lang_sphf_pag_next3 = 'Zobraziť ďalších {+}';
1517var js_lang_sphf_pag_last = 'Zobraziť posledných {+}'; // @deprecated
1518var js_lang_sphf_pag_last1 = 'Zobraziť posledný {+}';
1519var js_lang_sphf_pag_last2 = 'Zobraziť posledné {+}';
1520var js_lang_sphf_pag_last3 = 'Zobraziť posledných {+}';
1521var js_lang_sphf_set_group = 'Kliknutím môžete zmeniť nastavenia tejto skupiny.';
1522var js_lang_sphf_has_setting = 'Skupina filtra má vlastné špecifické nastavenie';
1523var js_lang_sphf_remove_group = 'Odstrániť všetky hodnoty tejto skupiny z filtra';
1524var js_lang_sphf_remove_value = 'Odstrániť hodnotu z filtra';
1525var js_lang_sphf_activ_no_res = 'Parameter nie je k dispozícii v zobrazených výsledkoch';
1526var js_lang_sphf_net_err = 'Nastal problém so sieťou, obnovte prosím stránku.';
1527var js_lang_sphf_total_1 = 'V tejto kategórii je {total} produkt';
1528var js_lang_sphf_total_2 = 'V tejto kategórii sú {total} produkty';
1529var js_lang_sphf_total_3 = 'V tejto kategórii je {total} produktov';
1530var js_lang_sphf_filtering = 'Filtruje sa ...';
1531var js_lang_sphf_open_filter = 'Zobraziť filter';
1532var js_lang_sphf_close_filter = 'Skryť filter';
1533var js_lang_sphf_pick_text = 'Vyberte položku';
1534var js_lang_sphf_show_results = 'Zobraziť výsledky filtra';
1535
1536var js_lang_prof_select_offer = 'Zvoľte si prosím minimálne jednu ponuku';
1537var js_lang_prof_select_variant = 'Vyberte si prosím variant zvolenej špeciálnej ponuky';
1538var js_lang_prof_select_main_variant = 'Vyberte si prosím variant produktu';
1539var js_lang_prof_show_more = 'Zobraziť viac darčekov';
1540var js_lang_prof_show_less = 'Zobraziť menej';
1541var js_lang_prof_free = 'Zdarma';
1542var js_lang_prof_discount = 'zľava';
1543var js_lang_prof_del_warn = 'Spolu s týmto produktom, sa odstránia následujúce špeciálne ponuky.';
1544var js_lang_prof_del_conf = 'Prajete si pokračovať?';
1545var js_lang_set_not_avail = 'Niektorý z produktov v sete nie je dostupný na sklade.';
1546
1547var js_lang_pacc_select_products = 'Označte prosím minimálne jeden produkt';
1548var js_lang_pacc_unselect_group = 'Odznačenie skupiny';
1549var js_lang_pacc_no_group_selected = 'Nemáte označenú žiadnu skupinu doplnkov';
1550var js_lang_pacc_wrong_action = 'Neplatná požiadavka! Oznámte to prosím na helpdesk.';
1551var js_lang_pacc_delete_confirm = 'Ste si naozaj istý že chcete zmazať túto skupinu?';
1552
1553var _JS_LNG_PROMPT_CLOSE = 'Zatvoriť okno';
1554
1555var js_lang_newcat2plus = 'Vytvoriť modul';
1556
1557var cms_js_lang_phpshop_product_change_variant = 'zmeniť variant';
1558
1559var js_lang_newcat2plus_tooltip = 'Kliknutím na tlačidlo sa automaticky z kategórie vytvorí nový modul<br>'+
1560						's podkategóriami, v ktorom sa budú zobrazovať <br>'+
1561						'iba podkategórie konkrétnej kategórie.<br>'+
1562						'Modul bude automaticky zbrazený v konkrétnej kategórii, <br>'+
1563						'všetkých jej podkategóriách a bude viditelný iba na administrátora <br>'+
1564						'(po Vašej kontrole môžete modul zverejniť).';
1565
1566var js_lang_newcat2plus_confirm = 'Prajete si vytvoriť nový modul s podkategóriami z kategórie ';
1567
1568var js_lang_gift_error_0 = 'Hodnota pre toto pole nesmie byť prázdna.';
1569var js_lang_gift_error_1 = 'Úroveň nastavenej ceny nemôže byť menšia než nula.';
1570var js_lang_gift_error_2 = 'Nastavená cena nemá správnu postupnosť. Musí byť väčšia než predošlá hodnota';
1571var js_lang_gift_error_3 = 'Zvoľte si skupinu pre darčeky z tejto cenovej skupiny.';
1572
1573var js_lang_action_estimated = 'Do konca akcie ostáva';
1574var js_lang_action_expired = 'Akcia skončila';
1575
1576var js_lang_time_estimated = 'Odhadovaný čas';
1577
1578var js_lang_time_day_1 = 'deň';
1579var js_lang_time_day_more = 'dni';
1580var js_lang_time_day_more_2 = 'dní';
1581
1582var js_lang_time_hours_1 = 'hodina';
1583var js_lang_time_hours_2_4 = 'hodiny';
1584var js_lang_time_hours_more = 'hodín';
1585
1586var js_lang_time_minutes_1 = 'minúta';
1587var js_lang_time_minutes_2_4 = 'minúty';
1588var js_lang_time_minutes_more = 'minút';
1589
1590var js_lang_time_seconds_1 = 'sekunda';
1591var js_lang_time_seconds_2_4 = 'sekundy';
1592var js_lang_time_seconds_more = 'sekúnd';
1593
1594var js_lang_read_more = 'Čítať viac';
1595var js_lang_read_less = 'Čítať menej';
1596
1597var js_lang_show_more = 'Zobraziť viac';
1598var js_lang_show_less = 'Zobraziť menej';
1599
1600var js_lang_show_filter = 'Zobraziť filter';
1601var js_lang_show_full_filter = 'Zobraziť celý filter';
1602var js_lang_hide_filter = 'Skryť filter';
1603
1604var js_lang_order_flag_set_title = 'Príznaky objednávky';
1605var js_lang_order_flag_set_question = 'Skutočne si prajete zmeniť príznak ';
1606var js_lang_order_flag_set_order = 'objednávky';
1607var js_lang_order_flag_set_comment = 'Pozn.: táto zmena sa zapíše do histórie zmien objednávky';
1608var js_lang_order_flag_set_wait = 'Prosím čakajte';
1609var js_lang_order_flag_set_success = 'Príznak objednávky bol úspešne zmenený.';
1610var js_lang_order_flag_set_error = 'Nastala chyba, prosím skúste to znova.';
1611var js_lang_order_flag_set_error_not_invoiced = 'Objednávke nie je možné nastaviť príznak, nakolko nemá vytvorenú faktúru.';
1612
1613var js_lang_browse_row_display_stock_amount_error_lbl_1 = 'iba';
1614var js_lang_browse_row_display_stock_amount_error_lbl_2 = 'ks';
1615
1616var js_lang_find_order = 'Vyhladať objednávku';
1617var js_lang_no_order_id_inserted = 'Nezadali ste číslo objednávky!';
1618var js_lang_order_not_found = 'Objednávka sa nenašla';
1619
1620var js_lang_compare_remove_all_confirm = 'Odobrať všetko?';
1621var js_lang_compare_no_prod = 'Žiadne produkty na porovnávanie.';
1622var js_lang_compare_max_product_amount_reached = 'Produkt nie je možné pridať do porovnávania.\nMaximálny počet produktov pre porovnanie je %s.';
1623var js_lang_compare_min_product_amount_needed = 'Položku nie je možné odobrať, pretože v porovnávacej tabuľke musia zostať aspoň 2 produkty!';
1624
1625var js_lang_must_fill_rating_of_product = 'Musíte vyplniť hodnotenie produktu!';
1626
1627var js_lang_admin_info_adv_change_admin_vex_title = 'Vybrať správcu objednávky';
1628var js_lang_admin_info_adv_change_admin_vex_select_label = 'Nový správca objednávky: ';
1629var js_lang_admin_info_adv_change_admin_vex_select_default = ' - vyberte správcu objednávky - ';
1630var js_lang_admin_info_adv_change_admin_vex_change_mail = 'Zaslať email o zmene zákaznikovi';
1631var js_lang_admin_info_adv_new_count_1 = ' nová';
1632var js_lang_admin_info_adv_new_count_2_4 = ' nové';
1633var js_lang_admin_info_adv_new_count_more = ' nových';
1634var js_lang_admin_info_adv_new_count_notif_1 = 'Máte {order_count} novú objednávku';
1635var js_lang_admin_info_adv_new_count_notif_2_4 = 'Máte {order_count} nové objednávky';
1636var js_lang_admin_info_adv_new_count_notif_more = 'Máte {order_count} nových objednávok';
1637var js_lang_admin_info_adv_new_count_notif_body_1 = '{order_id}: {order_items_count} položka, suma {order_total}';
1638var js_lang_admin_info_adv_new_count_notif_body_2_4 = '{order_id}: {order_items_count} položky, suma {order_total}';
1639var js_lang_admin_info_adv_new_count_notif_body_more = '{order_id}: {order_items_count} položiek, suma {order_total}';
1640
1641var js_inf_scroll_button_more = 'Načítať ďalšie';
1642
1643var js_lang_gift_free_title = 'Darček zadarmo - chýba ešte nakúpiť za';
1644var js_lang_gift_free_enabled = 'Máte darček zadarmo.';
1645
1646// com_media
1647var js_lang_admin_media_cancel = 'Zrušiť';
1648var js_lang_admin_media_resize = 'Zmeniť velkosť';
1649var js_lang_admin_media_overlay_text = '<span>Prosím čakajte...</span><img class="loader" src="/images/ajax-loader-05.gif">';
1650var js_lang_admin_media_redirect = 'Prejsť do adresára';
1651var js_lang_admin_media_clicktocreate = 'Vytvoriť';
1652
1653var js_lang_admin_media_file = 'Súbor';
1654var js_lang_admin_media_folders = 'Adresáre';
1655var js_lang_admin_media_images = 'Obrázky';
1656var js_lang_admin_media_files = 'Súbory';
1657var js_lang_admin_media_copy_url_done = 'Skopírované.';
1658
1659var js_lang_admin_media_upl_file_done = 'bol úspešne nahraný na server.';
1660var js_lang_admin_media_upl_file_error = 'sa nepodarilo nahrať na server.';
1661var js_lang_admin_media_upl_ren_file = 'Adresa položky: ';
1662var js_lang_admin_media_leg_ren_file = 'Premenovať položku: ';
1663var js_lang_admin_media_ren_file_error = 'Položka sa nedá premenovať!';
1664var js_lang_admin_media_text_unzip_ren_file = 'Odzipovať položku: ';
1665var js_lang_admin_media_leg_cre_folder = 'Vytvoriť adresár';
1666
1667var js_lang_admin_media_del_items_error = 'Zvolené položky sa nepodarilo odstrániť.';
1668
1669var js_lang_admin_media_act_edit = 'Upraviť';
1670var js_lang_admin_media_act_rename = 'Premenovať';
1671var js_lang_admin_media_act_copy = 'Kopírovať';
1672var js_lang_admin_media_act_resize = 'Zmeniť velkosť';
1673var js_lang_admin_media_act_resize_keep_ratio = 'Zachovať pomer strán';
1674var js_lang_admin_media_act_resize_keep_copy = 'Zachovať pôvodný obrázok';
1675var js_lang_admin_media_act_resize_keep_copy_org = 'Zmeniť velkosť obrázka s pôvodným názvom, <br>vytvoriť kópiu nezmeneného obrázka s názvom "-copy"';
1676var js_lang_admin_media_act_resize_keep_copy_cpy = 'Zachovať obrázok s pôvodným názvom, <br>vytvoriť kópiu zmeneného obrázka s názvom "-copy"';
1677var js_lang_admin_media_act_move = 'Presunúť';
1678var js_lang_admin_media_act_delete = 'Zmazať';
1679var js_lang_admin_media_act_prev = 'Pre náhlad obrázku kliknite na obrázok!';
1680var js_lang_admin_media_act_slimbox = 'Súbor obrázku:';
1681var js_lang_admin_media_act_unzip = 'Odzipovať';
1682
1683var js_lang_admin_media_text_width = 'šírka';
1684var js_lang_admin_media_text_height = 'výška';
1685
1686var js_lang_admin_media_num_dir = 'podadresárov';
1687var js_lang_admin_media_num_files = 'súborov';
1688
1689var js_lang_admin_media_wm_nothing_to_do = 'Všetky súbory majú aplikovaný vodoznak.';
1690var js_lang_admin_media_wm_remove_nothing_to_do = 'Žiaden súbor nemá aplikovaný vodoznak.';
1691var js_lang_admin_media_wm_remove_tip = 'Prajete si odstrániť vodoznaky pre všetky obrázky v tomto adresári?';
1692var js_lang_admin_media_wm_remove_cur_dir = 'Odstrániť v tomto adresári';
1693var js_lang_admin_media_wm_remove_deep = 'Odstrániť v tomto adresári a jeho podadresároch';
1694var js_lang_admin_media_wm_appli_quest = 'Prajete si aplikovať vodoznaky pre všetky obrázky v tomto adresári?';
1695var js_lang_admin_media_wm_appli_quest_cur = 'Aplikovať pre tento adresár';
1696var js_lang_admin_media_wm_appli_quest_deep = 'Aplikovať pre tento adresár a jeho podadresáre';
1697var js_lang_admin_media_wm_warn_1 = 'Vodoznaky sa zmažú iba z hlavných obrázkov produktov, zmazanie vodoznakov z ďalších obrázkov produktov je možné v správe súborov.';
1698
1699var js_lang_admin_media_dropzone_hint = 'Nahrajte súbory pretiahnutím sem';
1700var js_lang_admin_media_dropzone_fallback_message = 'Váš prehliadač nepodporuje nahrávanie súborov pretiahnutím';
1701var js_lang_admin_media_dropzone_invalid_filetype = 'nepovolený formát';
1702var js_lang_admin_media_dropzone_file_too_big = 'súbor je príliš velký';
1703var js_lang_admin_media_dropzone_response_error = 'chyba pri nahrávaní';
1704var js_lang_admin_media_dropzone_too_many_files = 'Nepovolený počet súborov';
1705var js_lang_admin_media_dropzone_upload_cancel = 'Nahrávanie súboru zrušené';
1706
1707var js_lang_admin_media_alert_del_files_sure_q = 'Zmazať položky';
1708var js_lang_admin_media_alert_move_files_sure_q = 'Presunúť položky';
1709var js_lang_admin_media_alert_copy_files_sure_q = 'Kopírovať položky';
1710var js_lang_admin_media_alert_resize_files_sure_q = 'Zmeniť velkosť obrázkov';
1711var js_lang_admin_media_alert_del_files_sure_q_2 = 'Potvrdiť vymazanie';
1712var js_lang_admin_media_alert_del_files_suer_q_2_text = 'Naozaj ste si istý? Počet označených položiek na vymazanie:';
1713var js_lang_admin_media_alert_del_files_suer_q_2_text_2 = 'Prosím zadajte číslo';
1714var js_lang_admin_media_alert_del_files_suer_q_2_text_3 = '(počet položiek pre vymazanie):';
1715
1716var js_lang_admin_media_move_items_error = 'Zvolené položky sa nepodarilo presunúť.';
1717var js_lang_admin_media_copy_items_error = 'Zvolené položky sa nepodarilo skopírovať.';
1718var js_lang_admin_media_backup_error_all = 'Položky nebolo možné obnoviť.';
1719
1720var js_lang_one_step_checkout_company_warning_title = 'Upozornenie';
1721var js_lang_one_step_checkout_company_warning_input = 'Máte vyplnené firemné údaje, ale nakupujete ako súkromná osoba.<br><br>Vaše firemné údaje budú týmto zmazané - prajete si pokračovať?';
1722var js_lang_one_step_checkout_company_warning_button_yes = 'Nakúpiť ako súkromná osoba';
1723var js_lang_one_step_checkout_company_warning_button_no = 'Zrušiť';
1724
1725var js_lang_admin_products_custom_mass_avail_set_vex_title = 'Hromadná zmena dostupnosti:';
1726
1727var js_lang_one_step_checkout_tos_price_offer_lbl = 'Žiadosť o cen
1727ovú ponuku';
1728
1729var js_lang_one_step_checkout_tos_price_offer_langs = {
1730	'checkout_heading': 'Zhrnutie rezervácie',
1731	'checkout_note_checkbox': 'Chcem napísať poznámku k rezervácii',
1732};
1733
1734var js_lang_one_step_checkout_company_tin_expected_format = 'Očakávaný formát';
1735
1736var js_lang_ico_error_validation = 'Minimálne 4 znaky s číslicou.';
1737
1738var js_lang_admin_panel_available_block_names = {
1739	'header': 'Hlavička',
1740	'subheader': 'Podhlavička',
1741	'left': 'lavý panel',
1742	'right': 'Pravý panel',
1743	'middle_top': 'Horná časť obsahu',
1744	'middle_bottom': 'Spodná časť obsahu',
1745	'pre_footer': 'Časť nad pätičkou',
1746	'footer_top': 'Horná časť pätičky'
1747};
1748
1749var js_lang_app_euroleasing_calc = {
1750	modalSubmit: 'Potvrdiť',
1751	modalCancel: 'Zrušiť',
1752	modalTitle: 'Euroleasing kalkulačka',
1753	creditValue: 'Hodnota úveru: ',
1754	creditCurrency: 'Mena úveru: ',
1755	creditDeposit: 'Akontácia úveru: ',
1756	creditRepaymentLength: 'Dĺžka splácania: ',
1757	months: 'mesiacov',
1758	monthlyPayAdditional: ' p.m.',
1759};
1760
1761var js_lang_email_did_you_mean = 'Mali ste na mysli: :suggestion?';
1762
1763var js_lang_manage_account = 'Správa Účtu';
1764var js_registration_url = '/obchod-registracia/';
1765
1766var js_lang_product_in_stock_1 = 'kus';
1767var js_lang_product_in_stock_2 = 'kusy';
1768var js_lang_product_in_stock_5 = 'kusov';
1769
1770var js_lang_proforma_saved_btn_label = 'Uložené';
1771var js_lang_proforma_error_btn_label = 'Chyba uloženia';
1772var js_lang_proforma_error_payment_date_title = 'Vytvorenie vyúčtovacej faktúry je možné len do 15 dní odo dňa prijatia úhrady predfaktúry.';
1773var js_lang_wishlist_item_delete = 'Odstrániť produkt z oblúbených';
1774var js_lang_wishlist_in_wishlist = 'Produkt sa už nachádza medzi oblúbenými';
1775
1776// Administracia
1777var js_lang_make_sel_from_list_for_action = 'Zvolte prosím v zozname položky pre volbu';
1778var js_lang_must_be_number = 'Zadaná hodnota musí byť číslo';
1779var js_lang_product_mass_colors_assign = 'Hromadné priradenie farieb';
1780var js_lang_mass_attribute_overpricing_lbl = 'Precenenie atribútov';
1781var js_lang_product_mass_attribute_change = 'Hromadná zmena variantov';
1782var js_lang_exception_negative_number = 'Hodnota precenenia musí byť kladné číslo';
1783var js_lang_max_low_50 = 'Ľutujeme, ale maximálne zníženie môže byť o 50%';
1784var js_lang_range_warn_1_99 = 'Ľutujeme, ale rozsah hodnôt môže byť len v rozmedzí 1 - 99';
1785var js_lang_exception_lowest_price = 'Zníženie musí byť menšie alebo rovné ako cena najlacnejšieho vybraného produktu pre precenenie.';
1786var js_lang_exception_set_price = 'Nastavenie na hodnotu musí byť väčšie alebo rovné "0" (nulovej hodnote).';
1787var js_lang_product_list_warn1 = 'Nezmenili ste žiadny atribút.';
1788var js_lang_product_list_warn3 = 'Nezmenili ste žiadnu cenu.';
1789var js_lang_regenerate_confirm_all = 'Akcia pregeneruje všetky príbuzné produkty na všetkých produktoch. V závislosti na počte produktov môže trvať dlhší čas.';
1790var js_lang_regenerate_confirm_missing = 'Akcia dodatočne vygeneruje a doplní príbuzné produkty ku produktom, ktoré nemajú dostatočný počet vygenerovaných príbuzných produktov. V závislosti na počte produktov môže trvať dlhší čas.';
1791var js_lang_generate_all = 'Pregenerovať všetky';
1792var js_lang_generate_missing = 'Dogenerovať chýbajúce';
1793var js_lang_generate_relative_product_start = 'začalo generovanie relatívnych produktov podľa kategórii';
1794var js_lang_mass_special_assign_lbl = 'Hromadne spracovať produkty v akcii';
1795
1796var js_vex_new_order_status_lbl1 = 'Zmeniť stav %s objednávky na nový stav: %s';
1797var js_vex_new_order_status_lbl2 = 'Zmeniť stav %s objednávok na nový stav: %s';
1798
1799// Orders
1800var js_lang_order_delete_mnu = 'Zmazať objednávku';
1801var js_lang_order_delete_mnu_more = 'Zmazať objednávky';
1802var js_lang_order_delete_prompt = 'Chcete zmazať označenú objednávku?';
1803var js_lang_order_delete_prompt_more = 'Chcete zmazať označené objednávky?';
1804var js_lang_order_disable_preview = 'Vypnúť zobrazenie náhladov objednávok.';
1805var js_lang_order_enable_preview = 'Zapnúť zobrazenie náhladov objednávok.';
1806var js_lang_order_change_status_prompt_more = 'Chcete zmeniť stav označených objednávok?';
1807var js_lang_order_change_status_prompt_more_content = 'Naozaj ste si istý? Počet všetkých označených objednávok na zmenu stavu:';
1808var js_lang_order_deselect = 'Zrušiť výber';
1809var js_lang_order_selected = 'Označené objednávky:';
1810var js_lang_order_product_selected = 'Označené produkty objednávky:';
1811var js_lang_order_selected_all = 'Máte označené všetky vyfiltrované objednávky';
1812var js_lang_order_selected_all_no_filter = 'Máte označené všetky objednávky';
1813var js_lang_order_selected_all_cur = 'Všetky objednávky na stránke sú označené.';
1814var js_lang_order_select_all = 'Označiť objednávky na všetkých stranách';
1815var js_lang_order_select_info = '&nbsp;&nbsp;&nbsp;<i>Info: ďalšiu %s objednávku máte označenú na ostatných stranách.</i>';
1816var js_lang_order_select_info_plural = '&nbsp;&nbsp;&nbsp;<i>Info: ďalšie %s objednávky máte označené na ostatných stranách.</i>';
1817var js_lang_order_select_info_plural_2 = '&nbsp;&nbsp;&nbsp;<i>Info: ďalších %s objednávok máte označené na ostatných stranách.</i>';
1818var js_lang_order_mass_change_status_lbl = 'Hromadná zmena stavu objednávok';
1819var js_lang_order_notify_err = 'Prosím, zmeňte najskôr stav objednávky.';
1820var js_lang_order_invoice_renumber_quest = 'Skutočne chcete vstúpiť do formulára, k
1820de budete môcť zmeniť číslo tejto objednávky?';
1821var js_lang_invoice_number = 'číslo FA';
1822var js_lang_list_of_orders_which_have_changed_status = 'Zoznam objednávok, ktorým bol zmenený status';
1823var js_lang_order_error_confirmation = 'Chyba odoslania objednávky';
1824
1825// Products
1826var js_lang_product_delete_mnu = 'Zmazať produkt';
1827var js_lang_product_delete_mnu_more = 'Zmazať produkty';
1828var js_lang_product_delete_prompt = 'Chcete zmazať označený produkt?';
1829var js_lang_product_delete_prompt_more = 'Chcete zmazať označené produkty?';
1830var js_lang_product_delete_prompt_count = 'Zadajte číslo';
1831var js_lang_product_delete_info = 'Zmazanie %s produktu prebehlo úspešne';
1832var js_lang_product_delete_info_pl = 'Zmazanie %s produktov prebehlo úspešne';
1833var js_lang_product_not_marked = 'Neboli označené žiadne produkty!';
1834var js_lang_product_manufacturer_changed = 'Výrobca bol úspešne zmenený';
1835var js_lang_product_selected = 'Naozaj ste si istý? Počet všetkých označených produktov je:';
1836var js_lang_product_mass_change_manufacturer = 'Zmeniť výrobcu pre';
1837var js_lang_product_mass_change_manufacturer_title = 'Hromadná zmena výrobcu';
1838var js_lang_product_mass_change_manufacturer_for = 'Hromadná zmena výrobcu pre';
1839
1840// Users
1841var js_lang_user_delete_mnu = 'Zmazať zákazníka';
1842var js_lang_user_delete_mnu_more = 'Zmazať zákazníkov';
1843var js_lang_user_delete_prompt = 'Chcete zmazať označeného zákazníka?';
1844var js_lang_user_delete_prompt_more = 'Chcete zmazať označených zákazníkov?';
1845
1846var js_lang_user_delete_prompt_count = 'Zadajte číslo';
1847
1848var js_lang_user_delete_info = 'Zmazanie %s zákazníka prebehlo úspešne';
1849var js_lang_user_delete_info_pl = 'Zmazanie %s zákazníkov prebehlo úspešne';
1850
1851var js_admin_admin_guide_vex_title = 'Sprievodca základným nastavením e-shopu';
1852var js_admin_admin_guide_firs_vex_msg = 'Vitajte na Vašom novom e-shope. Ako pomoc pri jeho nastavení Vám poslúži náš sprievodca.';
1853var js_admin_admin_guide_ag0 = 'Sprievodcu základným nastavením e-shopu spustíte TU';
1854var js_admin_admin_guide_btn_title = 'Nastavenie e-shopu';
1855var js_admin_admin_guide_btn_desc = 'Zostávajúci počet krokov:';
1856var js_admin_admin_guide_btn_prev = 'Predchádzajúci';
1857var js_admin_admin_guide_btn_next = 'Ďalší';
1858var js_admin_guide_vex_description = 'Pre dosiahnutie 100% je potrebné splnenie všetkých krokov, tak neváhajte a do toho!';
1859var js_admin_guide_off_msg = 'Sprievodca bol vypnutý, zapnete ho v sekcii Pomoc';
1860var js_admin_guide_on_msg = 'Sprievodca bol zapnutý';
1861
1862
1863var js_admin_guide_ag_1_1 = 'Meno odosielateľa, ktoré sa bude zobrazovať pri e-mailoch odoslaných z e-shopu.';
1864var js_admin_guide_ag_1_2 = 'E-mailová adresa, ktorá sa bude zobrazovať ako adresa odosielateľa.';
1865var js_admin_guide_ag_1_3 = 'E-mailová adresa pre príjem objednávkových notifikácií.';
1866var js_admin_guide_ag_1_4 = 'Zvoľte si SMTP metódu odosielania e-mailov<br>a nastavte potrebné údaje pre odosielanie elektronickej pošty.<br>Heslo je aktuálne heslo k danej emailovej adrese.';
1867var js_admin_guide_ag_1_4_smtp = 'Nastavte potrebné údaje pre odosielanie elektronickej pošty.<br>Heslo je aktuálne heslo k danej emailovej adrese.';
1868var js_admin_guide_ag_2_1 = 'Globálny meta názov (meta title), ktorý sa bude automaticky generovať za alebo pred meta názov stránok,<br>kategórií, produktov a článkov. Pre stránku kategórie napr.: "Názov kategórie - globálny meta title".';
1869var js_admin_guide_ag_2_2 = 'Tieto polia odporúčame nechať prázdne a meta dáta vyplniť v mape stránok pre každú kategóriu a stránku zvlášť, aby bola zachovaná unikátnosť obsahu meta dát.';
1870var js_admin_guide_ag_2_3 = 'Údaje, ktoré budú použité v hornej časti objednávkových e-mailov.';
1871var js_admin_guide_ag_3_1 = 'Názov obchodu, ktorý bude použitý v predmete objednávkových e-mailov.';
1872var js_admin_guide_ag_3_2 = 'Údaje, ktoré budú použité v hornej časti<br /> objednávkových e-mailov.';
1873var js_admin_guide_ag_4_1 = 'Zvoľte, či bude váš e-shop v režime platiteľa DPH.';
1874var js_admin_guide_ag_5_1 = 'Môžete vytvoriť nový spôsob dopravy.';
1875var js_admin_guide_ag_5_2 = 'Alebo editovať existujúci.';
1876var js_admin_guide_ag_5_2_1 = 'Zadajte názov nového spôsobu dopravy.';
1877var js_admin_guide_ag_5_2_2 = 'Vyberte štáty, pre ktoré bude daná doprava podporovaná.';
1878var js_admin_guide_ag_5_2_3 = 'Zvoľte výšku poplatku za dopravu.';
1879var js_admin_guide_ag_5_2_4 = 'Vyberte spôsob platieb, ktoré bude možné využiť pri zvolení tejto dopravy.';
1880var js_admin_guide_ag_5_2_5 = 'Definujte si rozsah sumy objednávky, pri ktorej sa bude doprava zobrazovať v pokladni.';
1881var js_admin_guide_ag_6_1 = 'Môžete vytvoriť nový spôsob platby.';
1882var js_admin_guide_ag_6_2 = 'Alebo editovať existujúci.';
1883var js_admin_guide_ag_6_2_1 = 'Zadajte názov nového spôsobu platby.';
1884var js_admin_guide_ag_6_2_2 = 'V prípade potreby nastavte zľavu alebo príplatok za danú platbu.';
1885var js_admin_guide_ag_6_2_3 = 'Označte v prípade, že ide o dobierku.';
1886var js_admin_guide_ag_7_1 = 'Vyberte štáty, ktoré sa budú zobrazovať ako možnosť voľby vo formulári pri registrácii zákazníka a ako štát doručenia v pokladni.';
1887var js_admin_guide_ag_8_1 = 'Nastavte si prvotné číslo, ktorým sa začnú číslovať objednávky.';
1888var js_admin_guide_ag_8_2 = 'Nastavte si výšku minimálnej sumy objednávky, kedy bude balné a doprava zdarma.';
1889var js_admin_guide_ag_9_1 = 'Upravte si text, ktorý sa bude zobrazovať v hornej časti objednávkových e-mailov, podľa vašich požiadaviek.';
1890var js_admin_guide_ag_9_2 = 'V prípade potreby môžete doplniť informácie, ktoré sa zákazníkom zobrazia na ďakovnej stránke po dokončení nákupu.';
1891var js_admin_guide_ag_9_3 = 'Upravte si text, ktorý sa bude zobrazovať v dolnej časti objednávkových e-mailov, podľa vašich požiadaviek.';
1892var js_admin_guide_ag_10_1 = 'Upravte si údaje, ktoré sa budú zobrazovať v hornej časti faktúr.';
1893var js_admin_guide_ag_11_1 = 'Máte možnosť upraviť zobrazenie variantov produktu v jeho detaile.';
1894var js_admin_guide_ag_11_2 = 'Zvoľte nastavenie predvoleného výberu variantov v detaile produktu.';
1895var js_admin_guide_ag_12_1 = 'Pokiaľ má produkt nastavenú cenu, ktorá je nižšia ako bežná cena tohto produktu (resp. je v akcii), tak si môžete nastaviť zobrazovanie aj bežnej ceny v detaile produktu.';
1896var js_admin_guide_ag_12_2 = 'Môžete si zvoliť v prípade, že chcete evidovať aj vašu nákupnú cenu produktu (nezobrazuje sa v dizajne).';
1897var js_admin_guide_ag_12_3 = 'Ďalšie ceny využijete, pokiaľ chcete produkty ponúkať v iných cenách pre rôzne zákaznícke skupiny (VIP, veľkoodberateľ, ...).';
1898var js_admin_guide_ag_13_1 = 'Pokiaľ je vypnutá kontrola skladu, tak bude možné produkt nakúpiť aj s nulovou skladovou zásobou.';
1899var js_admin_guide_ag_13_2 = 'Zvoľte si, kde všade je potrebné vyžadovať oboznámenia s obchodnými podmienkami.';
1900var js_admin_guide_ag_14_1 = 'Nastavte si ako budú zoradené produkty v kategórii.';
1901var js_admin_guide_ag_14_2 = 'Pri dvojstupňovom zoradení si budú môcť návštevníci zoradiť produkty vzostupne alebo zostupne.';
1902var js_admin_guide_ag_14_3 = 'Ponuka možností zoradenia pre návštevníkov.';
1903var js_admin_guide_ag_14_4 = 'V prípade, že chcete zobrazovať produkty, ktoré sú skladom ako prvé.';
1904var js_admin_guide_ag_14_5 = 'Informačný údaj, ktorý zobrazuje počet produktov v kategórii. Napr. "Názov kategórie (47)".';
1905var js_admin_guide_ag_15_1 = 'Sledovanie štatistík je už štandard. Zadajte si svoje Google Analytics ID. TIP: po uložení si zvoľte aj meranie konverzií.';
1906var js_admin_guide_ag_15_2 = 'Sitemapa je zoznam všetkých stránok a kategórií vášho e-shopu. Pomáha k indexovaniu týchto stránok a kategórií. TIP: odporúčame zvoliť "kategórie, produkty a obrázky".';
1907var js_admin_guide_ag_16_1 = 'V tejto časti si môžete nastaviť generovanie meta názvu stránok, kategórií, produktov a článkov.';
1908var js_admin_guide_ag_16_2 = 'Môžete si nastaviť oddeľovač, ktorý sa automaticky generuje do meta názvu. Príklad meta názvu kategórie: "Názov kategórie - globálny meta title".';
1909var js_admin_guide_ag_16_3 = 'Zvoľte si spôsob, akým sa overí alebo neoverí registrácia n
1909ového používateľa.';
1910var js_admin_guide_ag_16_4 = 'Nastavte si zobrazovanie cesty (breadcrumbs) prekliku po stránke (Príklad: úvod > kategória 1 > produkt 1).';
1911var js_admin_guide_ag_16_5 = 'Do týchto častí si môžete vkladať statické kódy (skripty), ktoré vykonávajú rôzne funkcie ako napríklad zobrazovanie chatovacieho okna, zbieranie údajov a pod.';
1912var js_admin_guide_ag_17_2 = 'ODKAZ NA CELY CLANOK';
1913var js_admin_guide_ag_18_1 = 'Kategórie produktov môžete spravovať TU.';
1914var js_admin_guide_ag_19_1 = 'Pridajte nový produkt.';
1915var js_admin_guide_ag_19_2 = 'Importuje produkty z externého súboru.';
1916var js_admin_guide_ag_19_3 = 'Editujte existujúci produkt.';
1917var js_admin_guide_ag_20_1 = 'Na nájdenie užitočného rozšírenia vám poslúžia naše navigačné nástroje.';
1918var js_admin_guide_ag_20_2 = 'Jednotlivé rozšírenia sa zobrazujú v zozname.';
1919
1920
1921var js_admin_written_amount = 'Pripísaných';
1922var js_admin_you_must_cancel_article_edit_first = 'Najprv musíte ukončiť úpravu článku!';
1923var js_admin_you_must_cancel_module_edit_first = 'Najprv musíte ukončiť úpravu modulu!';
1924var js_admin_you_must_save_your_text_editing_because_you_can_miss_your_editing = 'Najskôr uložte úpravu textu, aby ste neprišli o svoje zmeny!';
1925
1926
1927
1928var js_admin_invoice_with_this_number_exists_yet = 'Faktúra s týmto číslom už existuje!';
1929
1930var js_shop_product_comparing_check_same_msg = {
1931	1: 'Modrým hrubým písmom bol v tabulke porovnávania označený <strong>{count} rovnaký parameter</strong>.',
1932	2: 'Modrým hrubým písmom boli v tabulke porovnávania označené <strong>{count} rovnaké parametre</strong>.',
1933	5: 'Modrým hrubým písmom bolo v tabulke porovnávania označených <strong>{count} rovnakých parametrov</strong>.'
1934};
1935var js_shop_buy_only_registred_users_msg_reg = 'Objednávku môže dokončiť len registrovaný používatel.';
1936var js_shop_buy_only_registred_users_msg_product = 'Objednávku môže dokončiť len zákazník, ktorý má zakúpený registračný balíček.';
1937var js_shop_buy_only_registred_users_btn_reg = 'Registrovať';
1938var js_shop_buy_only_registred_users_btn_log = 'Prihlásiť';
1939var js_shop_buy_only_registred_users_btn_buy = 'Zakúpiť registračný balíček';
1940
1941var js_lang_prod_slick_show_more = 'Zobraziť všetky';
1942var js_lang_prod_slick_show_less = 'Zobraziť na riadok';
1943var js_lang_appstore_sef_conflicts_link_title = 'Otvoriť v novom okne';
1944var js_lang_appstore_sef_conflicts_conflict_1 = 'konflikt';
1945var js_lang_appstore_sef_conflicts_conflict_2 = 'konflikty';
1946var js_lang_appstore_sef_conflicts_conflict_3 = 'konfliktov';
1947var js_lang_appstore_sef_conflicts_no_conflicts = 'Žiadne konflikty nenájdené';
1948var js_lang_appstore_sef_conflicts_readable_url = 'Čitatelná URL';
1949var js_lang_appstore_sef_conflicts_category_name = 'Názov kategórie';
1950var js_lang_appstore_sef_conflicts_loading_text = 'Prebieha zisťovanie konfliktov';
1951var js_lang_appstore_sef_conflicts_vex_title = 'Kontrola konfliktov medzi URL kategórie a produktu';
1952var js_lang_variant_code2 = 'Kód variantu';
1953
1954// product Custom Export
1955var js_lang_custom_export_message = 'Nastavenia exportu produktov';
1956var js_lang_custom_export_yes = 'Exportovať do CSV';
1957var js_lang_custom_export_xlsx = 'Exportovať do XLSX';
1958var js_lang_custom_export_no = 'Zrušiť';
1959var js_lang_custom_export_remove_part_one = 'Šablóna s názvom ';
1960var js_lang_custom_export_remove_part_two = ' bola úspešne vymazaná.';
1961
1962
1963var js_lang_custom_export_alert_primary = 'Pre export je potrebné označiť aspoň jednu z možností.';
1964var js_lang_custom_export_alert_template_create = 'Pre pridanie šablóny označte aspoň jednu z možností.';
1965var js_lang_custom_export_templates = 'Dostupné šablóny:';
1966var js_lang_custom_export_template_name = 'Názov šablóny';
1967var js_lang_custom_export_template_select = '- Vyberte si šablónu -';
1968var js_lang_custom_export_add_new_templates = 'Pridať novú šablónu';
1969var js_lang_custom_export_select_all = 'Označiť všetky';
1970var js_lang_custom_export_unselect_all = 'Odznačiť všetky';
1971var js_lang_custom_export_remove_selected = 'Prajete si vymazať šablónu s názvom ';
1972var js_lang_custom_export_blank_template_name = 'Prosím zadajte názov vašej šablóny.';
1973var js_lang_custom_export_alert_already_exist = 'Šablóna s názvom ';
1974var js_lang_custom_export_alert_already_exist_two = ' už existuje.';
1975var js_lang_custom_export_helper_text_first_part = 'Šablóna exportu bude obsahovať ';
1976var js_lang_custom_export_helper_text_secound_part = ' aktuálne zvolené stĺpce (z ';
1977var js_lang_custom_export_helper_text_addition_three = ' aktuálne zvolených stĺpcov (z ';
1978var js_lang_custom_export_helper_text_addition_four = ' aktuálne zvolený stĺpec (z ';
1979var js_lang_custom_export_helper_text_saved_one = 'Šablóna s názvom ';
1980var js_lang_custom_export_helper_text_saved_two = ' bola úspešne vytvorená.';
1981var js_lang_custom_export_attributes_exists = ' s rovnakou kombináciou stĺpcov už existuje.';
1982var js_lang_custom_export_attributes_exists_part_one = 'Šablóna ';
1983
1984var js_lang_checkout_speedup_process_speed_up = 'Už ste u nás nakupovali';
1985var js_lang_checkout_speedup_process_logg_in = 'môžete sa prihlásiť';
1986var js_lang_checkout_speedup_process_speed_up_two = 'a urýchlite si vyplnenie údajov, alebo si môžete';
1987var js_lang_checkout_speedup_process_1 = 'a urýchlite si vyplnenie údajov';
1988var js_lang_checkout_speedup_process_fastcheckout = 'nakúpiť bez registrácie';
1989var js_lang_checkout_speedup_process_2 = 'alebo si môžete';
1990var js_lang_checkout_speedup_process_forgot_password = 'obnoviť zabudnuté heslo';
1991var js_lang_checkout_speedup_email_was_send = "Overovací e-mail Vám bol zaslaný na zadanú e-mailovú adresu.";
1992
1993var js_lang_additional_info_error = 'Skontrolujte prosím, či je formulár správne vyplnený';
1994
1995var js_lang_flypage_quatro_button_title = 'Quatro splátky';
1996
1997var js_lang_regenerate_prices = 'Pregenerovať ceny';
1998
1999var js_lang_virtual_variants_lbl = [
2000    {
2001        'all': 'Dostupné v'
2002    },
2003    {
2004        '0': 'variantoch',
2005        '1': 'variante',
2006        '2': 'variantoch'
2007    }
2008];
2009
2010var js_lang_phone_correct_msg = 'Prosím vylpňte správne tel. kontakt.';
2011var js_lang_back_btn_lbl = 'Späť na ';
2012var js_lang_coupon_move_from_archive = 'Vybraný kupón bol presunutý z archívu';
2013var js_lang_coupons_move_from_archive = 'Vybrané kupóny boli presunuté z archívu';
2014var js_lang_return_coupon_from_archive_confirm = 'Naozaj chcete vrátiť kupón "%d" z archívu?';
2015var js_lang_return_coupons_from_archive_confirm = 'Naozaj chcete vrátiť %d kupóny z archívu?';
2016var js_lang_return_5_or_more_coupons_from_archive_confirm = 'Naozaj chcete vrátiť %d kupónov z archívu?';
2017var js_lang_import_coupons_confirm = 'Naozaj chcete importovať kupóny zo súboru <strong>%s</strong>?';
2018var js_lang_import_coupons_updated = 'Počet upravených kupónov: <strong>%s</strong>';
2019var js_lang_import_coupons_created = 'Počet vytvorených kupónov: <strong>%s</strong>';
2020var js_lang_import_coupons_failed = 'Počet neexistujúcich Tiande ID: <strong>%s</strong>';
2021var js_lang_import_coupons_error = 'Chybný súbor.';
2022var js_lang_import_coupons_send_email = 'E-mail s nepriradenými Tiande ID bol odoslaný na <strong>%s</strong>';
2023var js_lang_import_gift_confirm = 'Naozaj chcete importovať darčeky zo 
2023súboru <strong>%s</strong>?';
2024var js_lang_import_gift_created = 'Počet naimportovaných darčekov: <strong>%s</strong>';
2025var js_lang_import_gift_sku_failed = 'Počet neexistujúcich SKU darčekov: <strong>%s</strong>';
2026var js_lang_import_tiande_gift_send_email = 'E-mail s nepriradenými Tiande ID<br>a neexistujúcimi kódmi produktov<br>bol odoslaný na <strong>%s</strong>';
2027
2028var js_lang_parimex_dwn = 'Stiahnúť súbor';
2029var js_lang_parimex_wait_please = 'počkajte prosím...';
2030var js_lang_parimex_running = 'Prebieha';
2031
2032var js_lang_content_modul_will_be_visible = 'Modul bude zobrazený';
2033var js_lang_content_modul_is_visible = 'Modul je zobrazený';
2034var js_lang_content_modul_was_visible = 'Modul bol zobrazený';
2035
2036// Coupon mess import
2037var js_lang_mess_coupon_import_more_selected_error = 'Nastala chyba, bolo zvolených viac ako 1 kupón.';
2038var js_lang_mess_coupon_import_load_file_error = 'Súbor sa nepodarilo načítať. Obnovte stránku a skúste nahrať súbor ešte raz.';
2039var js_lang_mess_coupon_import_read_file_error = 'Nastala chyba pri spracovávaní súboru. Skúste nahrať súbor ešte raz alebo skontrolujte jeho štruktúru/kódovanie.';
2040var js_lang_mess_coupon_import_count_title = 'Import prebehol úspešne';
2041var js_lang_mess_coupon_import_count = 'Počet importovaných kupónov: %text';
2042var js_lang_mess_coupon_import_count_duplicates_title = 'V súbore sú duplicity';
2043var js_lang_mess_coupon_import_count_duplicates = 'Počet duplicitných kupónov v importovanom súbore: %value';
2044var js_lang_mess_coupon_import_count_not_inserted_title = 'Zoznam duplicitných kupónov';
2045var js_lang_mess_coupon_import_count_not_inserted = 'Zoznam všetkých nájdených a nenaimportovaných duplicitných kupónov si môžete <a href="%link" target="_blank" download> stiahnuť tu. </a>';
2046var js_lang_mess_coupon_import_start_title = 'Informácia';
2047var js_lang_mess_coupon_import_start = 'Začal sa import kupónov (počet: %value). O dokončení Vás budeme informovať notifikáciou.';
2048
2049var js_lang_no_search_match_for = 'Žiadna zhoda pre slovo';
2050
2051var js_lang_luigibox_hint = 'Pre bežné vyhľadávanie slova {query}, stlačte Enter';
2052var js_lang_luigibox_min_chars = 'Zadajte prosím minimálne {char} znaky';
2053var js_lang_luigibox_min_chars_one_char = 'Zadajte prosím minimálne {char} znak';
2054var js_lang_luigibox_addtocart = 'Do košíka';
2055var js_lang_luigibox_Showall = 'Zobraziť všetko';
2056var js_lang_luigibox_top_product = 'Top produkt';
2057var js_lang_luigibox_ac_query = 'Populárne vyhľadávania';
2058var js_lang_luigibox_ac_categories = 'Kategórie';
2059var js_lang_luigibox_ac_products = 'Produkty';
2060var js_lang_luigibox_ac_manufacturers = 'Výrobcovia';
2061var js_lang_luigibox_ac_articles = 'Články';
2062
2063var js_lang_phpshop_product_incr_credit_by_purchase_text = 'Nákupom tohto produktu získate kredit vo výške <span class="credit_val">%s</span> bodov.';
2064var js_lang_phpshop_product_incr_credit_by_purchase_text_1 = 'Nákupom tohto produktu získate kredit vo výške <span class="credit_val">%s</span> bod.';
2065var js_lang_phpshop_product_incr_credit_by_purchase_text_5 = 'Nákupom tohto produktu získate kredit vo výške <span class="credit_val">%s</span> body.';
2066
2067
2068var js_lang_really_want_you_remove_this_item = 'Naozaj chcete odstrániť túto položku?';
2069
2070var js_lang_product_min_characters = 'Odporúčame použiť min. 3 znaky.';
2071
2072var js_lang_product_stock_movement_vex_title = 'Hromadné skladové pohyby produktov';
2073var js_lang_product_add_stock_movement = 'Pridať skladový pohyb';
2074var js_lang_product_sku_no_exist = 'Kód produktu neexistuje';
2075var js_lang_product_set_on_main = 'Nastaviť na hlavný produkt';
2076var js_lang_product_select_variant_sku = 'Zvoľte kód variantu';
2077var js_lang_product_use = 'Použiť';
2078var js_lang_product_movement_date = 'Dátum pohybu';
2079var js_lang_product_movement_type = 'Druh pohybu';
2080var js_lang_product_movement_type_r = 'Príjem';
2081var js_lang_product_movement_type_i = 'Výdaj';
2082var js_lang_product_movement_type_a = 'Inventúrny príjem';
2083var js_lang_product_movement_type_b = 'Inventúrny výdaj';
2084var js_lang_suppl_invoice = 'Dodávateľská faktúra';
2085var js_lang_note = 'Poznámka';
2086var js_lang_supplyer = 'Dodávateľ';
2087
2088var js_lang_shuch_club_card_text = 'Číslo karty vpíšte len vtedy, ak už ste majiteľom klubovej karty';
2089
2090var js_lang_new_form_item = 'Položka';
2091var js_lang_new_form_nesessery = 'je povinná';
2092var js_lang_new_form_nesessery_item = 'Táto položka je povinná.';
2093var js_lang_new_pickupdate_rule = 'Najskorší možný termín je o 2 pracovné dni';
2094
2095// GDPR
2096var js_vex_first_login_title = 'Ochrana osobných údajov';
2097var js_vex_first_login_info = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem <br> Ipsum has been the industrys standard dummy text ever since the 1500s';
2098var js_gdpr_tooltip = "V našej spoločnosti dbáme na to, aby naši zákazníci boli spokojní<br>- chceme vám poskytovať kvalitné služby šité na mieru.<br>Preto je potrebné, aby ste nám poskytli súhlas na spracovanie vašich osobných údajov.";
2099var js_newsletter_tooltip = "Označením políčka udeľujem prevádzkovateľovi súhlas so spracovaním<br> mnou poskytnutých osobných údajov na účely zasielania newsletteru<br> a zároveň potvrdzujem, že som sa oboznámil/a s pravidlami spracovania osobných údajov,<br>
2099 ktoré sú uvedené v sekcii „Ochrana osobných údajov“ na tejto stránke.";
2100var js_newsletter_tooltip_inverse = "Neoznačením políčka udeľujem prevádzkovateľovi súhlas so spracovaním<br> mnou poskytnutých osobných údajov na účely zasielania newsletteru<br> a zároveň potvrdzujem, že som sa oboznámil/a s pravidlami spracovania osobných údajov,<br> ktoré sú uvedené v sekcii „Ochrana osobných údajov“ na tejto stránke.";
2101var js_gdpr_agree_to_gdpr = 'Je potrebný Váš súhlas so spracovaním osobných údajov.';
2102var js_gdpr_wrong_iban = 'Čislo účtu v tvare IBAN je nesprávne';
2103
2104var js_universal_contact_form_suc_alert = "Ďakujeme za Vašu správu.";
2105
2106// GDPR Zakaznik
2107var js_gdpr_copy = 'Kopírovať verziu GDPR článku do schránky';
2108var js_gdpr_version = 'Verzia GDPR článku';
2109var js_gdpr_version_title = 'Verzia GDPR článku';
2110var js_gdpr_cdate = 'Dátum súhlasu';
2111var js_gdpr_form_id = 'Miesto súhlasu';
2112var js_gdpr_version_title_head = 'Verzia GDPR článku';
2113var js_gdpr_cdate_title_head = 'Dátum súhlasu';
2114var js_gdpr_form_id_title_head = 'Miesto súhlasu';
2115
2116var js_gdpr_watch_dog = 'Strážny pes';
2117var js_gdpr_send_to_friend = 'Odporuč priateľovi';
2118var js_gdpr_product_question = 'Otázka na produkt';
2119var js_gdpr_contact_form = 'Kontaktný formulár';
2120var js_gdpr_register_form = 'Registračný formulár';
2121var js_gdpr_module_newsleatter = 'Modul Newsleatter';
2122var js_gdpr_module_short_contact_form = 'Modul s kontaktným formularom';
2123var js_gdpr_module_contest_form = 'Modul súťaž';
2124var js_gdpr_checkout = 'Pokladňa';
2125var js_gdpr_dt_form = 'Formulár na mieru';
2126var js_gdpr_unknown = "Neznáme";
2127var js_gdpr_comment = 'Komentár';
2128var js_gdpr_product_best_price = 'Našli ste lepšiu cenu?';
2129var js_gdpr_representative_contact = 'Kontakt na reprezentanta';
2130var js_gdpr_first_login = 'Prvé prihlásenie';
2131
2132var js_gdpr_empty_data = 'Neevidujeme žiadny súhlas';
2133
2134var js_gdpr_personal_data_title = 'Výpis osobných údajov';
2135var js_gdpr_personal_gdpr_approval_title = 'Súhlasy so spracovaním osobných údajov';
2136
2137var js_gdpr_article_copy = "Článok bol skopírovaný do schránky (s Ctrl + V ho vložíte na iné miesto)";
2138
2139var js_lang_town = "Mesto";
2140var js_lang_company = "Spoločnosť";
2141var js_lang_country = "Krajina";
2142var js_lang_zip = "PSČ";
2143var js_lang_name = "Meno";
2144var js_lang_gdpr_name = "Meno";
2145var js_lang_surname = "Priezvisko";
2146var js_lang_middle_name = "Stredné meno";
2147var js_lang_state = "Štát";
2148var js_lang_title = "Titul";
2149var js_lang_phone = "Tel. číslo";
2150var js_lang_phone_2 = "Tel. číslo 2";
2151var js_lang_address_type = "Typ adresy";
2152var js_lang_address_type_bt = "Fakturačná adresa";
2153var js_lang_address_type_st = "Dodacia adresa";
2154var js_lang_address = "Adresa";
2155var js_lang_address_2 = "Adresa 2";
2156
2157var js_lang_delete_customer_are_you_sure_cus = "Naozaj ste si istý? Chcete zmazať zvolených zákazníkov?";
2158var js_lang_delete_customer_are_you_sure_adm = "Naozaj ste si istý? Chcete zmazať zvolených administrátorov?";
2159
2160var js_gdpr_singed_credit_system_0 = "Svoju účasť vo vernostnom programe môžete kedykoľvek ";
2161var js_gdpr_singed_credit_system_1 = "zmeniť/ upraviť tu";
2162
2163var js_gdrp_agree_info_0 = "Bol som oboznámený s";
2164var js_gdrp_agree_info_1 = "obchodnými podmienkami";
2165var js_gdrp_agree_info_2 = "a beriem na vedomie";
2166var js_gdrp_agree_info_3 = " spracovanie osobných údajov.";
2167
2168var js_lang_shopping_cart_empty_confirm = 'Naozaj chcete vyprázdniť nákupný košík?';
2169var js_lang_product_has_been_to_cart = 'Produkt bol pridaný do nákupného košíka';
2170
2171var js_lang_availability = 'Dostupnosť';
2172
2173var js_add_product_to_parents_category = 'Pridanie produktu do nadradených kategórií';
2174var js_add_products_to_parents_category = 'Hromadné pridanie %s produktov do nadradených kategórií';
2175var js_add_product_to_parents_category_confirm = 'Naozaj si prajete zaradiť vybraný produkt do všetkých nadradených kategórií?<br><br>Znamená to, že produkt bude zaradený do všetkých kategórií, ktoré sú nadradené ku kategóriám, do ktorých produkt aktuálne patrí.';
2176var js_add_products_to_parents_category_confirm = 'Naozaj si prajete zaradiť vybrané produkty do všetkých nadradených kategórií?<br><br>Znamená to, že produkty budú zaradené do všetkých kategórií, ktoré sú nadradené ku kategóriám, do ktorých produkty aktuálne patria.';
2177
2178var js_shop_cart_quantity = 'Množ.';
2179var js_shop_flypage_lbl = 'Detail produktu';
2180var cms_js_lang_cms_lightbox_txtimage = 'Obrázok';
2181var cms_js_lang_cms_lightbox_txtof = 'z';
2182
2183var js_PHPSHOP_GDPR_CREDIT_SYSTEM_ON = "Chcete byť zaradený/á do vernostného programu?";
2184var js_PHPSHOP_GDPR_CREDIT_SYSTEM_OFF = "Chcete sa odhlásiť z vernostného programu? Prídete o %X% kreditov.";
2185
2186var js_all_categories = 'Všetky kategórie';
2187var js_close_categories = 'Zavrieť kategórie';
2188var GDPR_EMAIL_ADDED = 'Vaša e-mailová adresa bola pridaná do odberu newsletteru';
2189var GDPR_EMAIL_REMOVED = 'Váš e-mail bol odstránený z odberu newsletteru.';
2190var GDPR_NO_EMAIL = 'Nie je zadaný Váš email';
2191var ACC_VOUCHER_EMAIL_NOT_VALID = 'Neplatná emailová adresa.';
2192var GDPR_EMAIL_SEND2 = "Na Vašu e-mailovú adresu už bol zaslaný potvrdzovací e-mail.";
2193var APPROVE_REQUIRED = "Je potrebný Váš súhlas";
2194var GDPR_NO_ACCEPTED = "Je potrebný Váš súhlas so spracovaním osobných údajov.";
2195var GDPR_EMAIL_QUESTION = "Skutočne sa chcete odhlásiť z odberu noviniek?";
2196var GDPR_EMAIL_SEND = "Na Vašu e-mailovú adresu bol zaslaný potvrdzovací e-mail.";
2197var LM_SAME_EMAIL_TWICE = "Vami zadaná e-mail adresa je už do Newslettera prihlásená.";
2198var LM_FORM_NOEMAIL = "Zadajte prosím platnú e-mailovú adresu.";
2199var js_admin_settings_goto_manual = "Prejsť na manuál";
2200var cms_js_lang_category_choose = '- Vyberte si -';
2201var js_PHPSHOP_CONTEST_NEWSLETTER_TEXT_ADMIN_TOOLTIP = 'Ak je funkcia zapnutá, zákazníkom je zobrazený súhlas s odberom noviniek (newsletter-a) - prostredníctvom zaškrtávacieho tlačidla vo formulároch na e-shope.';
2202var js_lang_shopping_cart_delete_item_confirm = 'Naozaj chcete odstrániť produkt z košíka?';
2203
2204var js_lang_insufficient_quantity_inform = 'Nebolo možné pridať požadované množstvo produktu, množstvo bolo zmenené z {from} na {to}.';
2205var js_lang_insufficient_quantity_inform_max = 'V nákupnom košíku je maximálne povolené množstvo produktu k nákupu. Pridané množstvo bolo zmenené z {from} {unit} na {to} {unit}.';
2206var js_lang_insufficient_quantity_inform_max_2 = 'V nákupnom košíku je maximálne povolené množstvo produktu k nákupu. Vami zadané množstvo nebolo pridané.';
2207var js_lang_insufficient_quantity_inform_min = 'Množstvo v nákupnom košíku bolo zmenené z {from} {unit} na {to} {unit} kvôli minimálnemu povolenému množstvu k nákupu.';
2208
2209var cms_js_lang_multilang_import_enabled_alert = 'Pokiaľ importujete cudzojazyč
2209né dáta produktov, import nebude možné vrátiť naspäť.';
2210
2211var js_PHPSHOP_INVOICED_SERVICES_MSG_TOMORROW = 'zajtra.';
2212var js_admin_export_omega = 'Dáta do Omegy boli úspešne exportované.';
2213
2214var mod_quickicon_add_title = 'Priradiť ';
2215var mod_quickicon_remove_title = 'Odobrať ';
2216var mod_quickicon_keep_title = 'Ponechať ';
2217var mod_quickicon_export_error = 'Export pre cenový portál bol už spustený pred menej ako hodinou, manuálne spustenie generovania je možné max. raz za hodinu.';
2218var mod_quickicon_export_error2 = 'Váš balík neumožnuje exportovať pre cenové portály.';
2219var mod_quickicon_export_error3 = 'Pre správne nastavenie exportov a dosiahnutie čo najlepších výsledkov pozícií na cenových portáloch nastavte číselnú hodnotu (vyjadrenú v počte dní) pre Dodacie lehoty produktov.V úprave produktu upravte všetky Dodacie lehoty tak, že im nastavíte číselný počet dní.';
2220var mod_quickicon_delete_cookie_error = 'Nečakaná chyba';
2221var mod_quickicon_delete_cookie = 'Cookie boli vymazané.';
2222var mod_quickicon_change_design = 'Zmena štýlu dizajnu';
2223var mod_quickicon_export_activated_for = 'Momentálne máte aktivovaný export pre: ';
2224var mod_quickicon_activated_question = 'Prajete si aktivovať práve tieto cenové portály?';
2225var mod_quickicon_no_activated_portal = 'Nevybrali ste žiadny cenový portál pre aktiváciu.';
2226var mod_quickicon_choose_one_category = 'Zvoľte si aspoň 1 kategóriu prosím.';
2227var mod_quickicon_text1 = 'Priradiť hodnotu "žiadne portály" ku ';
2228var mod_quickicon_text2 = 'Priradiť vybrané portály ku ';
2229var mod_quickicon_text3 = ' kategóriám?';
2230var mod_quickicon_text4 = ' kategórií?';
2231var mod_quickicon_text5 = 'Počet vybraných kategórií: ';
2232var mod_quickicon_text6 = 'Pridať vybrané kategórie do ';
2233var mod_quickicon_text7 = 'Odstrániť vybrané kategórie z ';
2234var mod_quickicon_text8 = ' portálov?';
2235var mod_quickicon_text9 = ' portálu?';
2236
2237var mod_quickicon_add_portal_text1 = '<b>Uložiť nasledovné zmeny pre ';
2238var mod_quickicon_add_portal_text2_1 = ' zvolenú kategóriu?';
2239var mod_quickicon_add_portal_text2_2 = ' zvolené kategórie?';
2240var mod_quickicon_add_portal_text2_3 = ' zvolených kategórií?';
2241var mod_quickicon_add_portal_text3_1 = '<b>Priradiť ';
2242var mod_quickicon_add_portal_text3_2 = ' nový portál:</b><br/>';
2243var mod_quickicon_add_portal_text3_3 = ' nové portály:</b><br/>';
2244var mod_quickicon_add_portal_text3_4 = ' nových portálov:</b><br/>';
2245var mod_quickicon_add_portal_text4_1 = '<b>Odobrať ';
2246var mod_quickicon_add_portal_text4_2 = ' portál:</b><br/>';
2247var mod_quickicon_add_portal_text4_3 = ' portály:</b><br/>';
2248var mod_quickicon_add_portal_text4_4 = ' portálov:</b><br/>';
2249
2250var js_lang_select_orders = 'Zvoľte si prosím objednávky pre túto akciu';
2251var js_lang_neoship_no_token = 'Zlý token';
2252var js_lang_neoship_select_orders = 'Zvoľte objednávky ktoré majú príznak Export do Neoship';
2253var js_lang_neoship_not_select_orders = 'Zvoľte objednávky ktoré nemajú príznak Export do Neoship';
2254var js_lang_neoship_select_exported_orders = 'Zvolte iba objednávky, ktoré boli exportované do Neoship';
2255var js_lang_neoship_data_not_send = 'Neboli zaslané žiadne údaje';
2256var js_lang_neoship_exported_order = 'Exportované obj';
2257var js_lang_neoship_exported_order_detail = 'Tieto objednávky boli úspešne exportované: ';
2258var js_lang_neoship_not_exported_order_detail = 'Chyba v obj č. ';
2259var js_lang_neoship_vex_title = 'Export objednávok do Neoship';
2260var js_lang_neoship_vex_number_of_pack = 'Počet balíkov';
2261var js_lang_neoship_vex_number_of_pack_placeholder = 'zadajte počet balíkov';
2262var js_lang_neoship_vex_number_of_pack_placeholder_error = 'Hodnota musí byť číslo väčšie ako 0';
2263var js_lang_neoship_vex_value_of_ins = 'Výška poistenia';
2264var js_lang_neoship_vex_value_of_ins_placeholder = 'zadajte výšku poistenia';
2265var js_lang_neoship_vex_value_of_ins_placeholder_error = 'Hodnota musí byť číslo medzi 0 a 5001';
2266var js_lang_neoship_vex_sms = 'Poslať SMS';
2267var js_lang_neoship_vex_email = 'Poslať E-mail';
2268var js_lang_neoship_vex_sat_delivery = 'Sobotné doručenie';
2269var js_lang_neoship_vex_express_delivery = 'Typ doručenia';
2270var js_lang_neoship_vex_export = 'Exportovať';
2271var js_lang_neoship_vex_export_setEmail = 'Nastala chyba pri nastavení E-mailu. Kontaktuje prosím administrátora.';
2272var js_lang_neoship_tracking_not_avail = 'Sledovanie je k dispozícii iba pre odoslané objednávky.';
2273var js_lang_neoship_protocol_download_title = 'Tlač preberacích protokolov';
2274var js_lang_neoship_protocol_download_shippper = 'Vyberte dopravcu';
2275var js_lang_neoship_protocol_download_date = 'Vyberte dátum';
2276var js_lang_neoship_protocol_print = 'Tlačiť';
2277
2278var cms_js_lang_shipping_address_name_must_be_unique = 'Názov dodacej adresy musí byť unikátny.';
2279var cms_js_lang_no_shipping_address = 'Žiadne dodacie adresy.';
2280var cms_js_lang_delete_specific_shipping_address_confirm = 'Naozaj chcete odstrániť adresu s názvom <strong>%s</strong>';
2281var cms_js_lang_delete_shipping_address_confirm = 'Naozaj chcete odstrániť vybrané adresy?';
2282var cms_js_lang_phone_1_validate = 'Tel.kontakt a IČO musí byť číslo.';
2283var cms_js_lang_phone_1_validate2 = 'Tel. kontakt obsahuje nepovolený znak. Povolené znaky sú 0-9, +, medzera, /, -, –';
2284var cms_js_lang_phone_1_validate3 = 'IČO môže obsahovať len čísla a písmená.';
2285var js_lang_form_validation_sk_phone = 'Telefónne číslo musí začínať +421 alebo 0 a obsahovať 9 číslic za predvoľbou.';
2286var js_lang_form_validation_email = 'Nesprávny tvar e-mailovej adresy.';
2287
2288var cms_js_lang_order_status_change1 = 'Objednávky s číslom ';
2289var cms_js_lang_order_status_change2 = ' boli zmenené.';
2290
2291var js_lang_repurchase_mobile_min_char = 'Zadajte min. 3 znaky';
2292var js_lang_repurchase_mobile_no_match = 'Neboli nájdené žiadne výsledky';
2293var js_lang_repurchase_mobile_one_match = ' výsledok';
2294var js_lang_repurchase_mobile_two_match = ' výsledky';
2295var js_lang_repurchase_mobile_five_match = ' výsledkov';
2296
2297var js_lang_google_recaptcha_error_msg = 'Potvrďte prosím, že nie ste robot prostredníctvom reCAPTCHA.';
2298
2299var js_lang_checkout_shipping_changed = 'Spôsob dopravy bol upravený';
2300var js_lang_checkout_shipping_changed_text = 'Váš spôsob dopravy bol upravený z dôvodu, že množstvo niektorého z produktov v košíku nevyhovuje pre vami zvolený spôsob dopravy. Prosím zvoľte iný spôsob dopravy.';
2301
2302var js_admin_lang_delete = "Zmazať";
2303var js_admin_lang_delete_alert = "Pozor, chystáte sa zmazať";
2304var js_admin_lang_delete_accepted_y = "Úspešne zmazaný ";
2305var js_admin_lang_delete_accepted_i = "Úspešne zmazaní ";
2306var js_admin_lang_delete_accepted_a = "Úspešne zmazaná ";
2307var js_admin_lang_delete_accepted_e = "Úspešne zmazané ";
2308var js_admin_lang_delete_accepted_more = "Úspešne zmazaných ";
2309var js_admin_lang_delete_accepted_user = " zákazník.";
2310var js_admin_lang_delete_accepted_user_2 = " zákazníci.";
2311var js_admin_lang_delete_accepted_user_3 = " zákazníka.";
2312var js_admin_lang_delete_accepted_users = " zákazníkov.";
2313var js_admin_lang_delete_accepted_product = " produkt.";
2314var js_admin_lang_delete_accepted_product_2 = " produkty.";
2315var js_admin_lang_delete_accepted_products = " produktov.";
2316var js_admin_lang_delete_accepted_param = "parameter";
2317var js_admin_lang_delete_accepted_param_2 = "parametre";
2318var js_admin_lang_delete_accepted_params = "parametrov";
2319var js_admin_lang_delete_accepted_article = " článok.";
2320var js_admin_lang_delete_accepted_article_2 = " články.";
2321var js_admin_lang_delete_accepted_articles = " článkov.";
2322var js_admin_lang_delete_accepted_admin = " admin.";
2323var js_admin_lang_delete_accepted_admin_2 = " admini.";
2324var js_admin_lang_delete_accepted_admin_3 = " admina.";
2325var js_admin_lang_delete_accepted_admins = " adminov.";
2326var js_admin_lang_delete_accepted_order = " objednávka";
2327var js_admin_lang_delete_accepted_order_2 = " objednávky";
2328var js_admin_lang_delete_accepted_order_3 = " objednávku";
2329var js_admin_lang_delete_accepted_orders = " objednávok";
2330var js_lang_user_delete_prompt_more_content = 'Naozaj ste si istý? Počet všetkých označených zákazníkov na zmazanie:';
2331var js_lang_user_delete_prompt_count_please = 'Prosím zadajte číslo';
2332var js_lang_user_delete_prompt_count_info_cur = '(počet zákazníkov na tejto strane)';
2333var js_lang_user_delete_prompt_count_info_other = '(počet zákazníkov na ďalších stranách)';
2334var js_lang_user_delete_error = 'Zadajte správny počet zákazníkov, prosím.';
2335var js_lang_admin_delete_prompt_more_content = 'Naozaj ste si istý? Počet všetkých označených adminov na zmazanie:';
2336var js_lang_admin_delete_prompt_count_please = 'Prosím zadajte číslo';
2337var js_lang_admin_delete_prompt_count_info_cur = '(počet adminov na tejto strane)';
2338var js_lang_admin_delete_prompt_count_info_other = '(počet adminov na ďalších stranách)';
2339var js_lang_admin_delete_error = 'Zadajte správny počet adminov, prosím.';
2340var js_lang_order_delete_prompt_more_content = 'Naozaj ste si istý? Počet všetkých označených objednávok na zmazanie:';
2341var js_lang_order_delete_prompt_count = 'Prosím zadajte číslo';
2342var js_lang_order_delete_prompt_count_info_cur = '(počet objednávok na tejto strane)';
2343var js_lang_order_delete_prompt_count_info_other = '(počet objednávok na ďalších stranách)';
2344var js_lang_order_delete_error = 'Zadajte správny počet objednávok, prosím.';
2345var js_lang_product_delete_prompt_more_content = 'Naozaj ste si istý? Počet všetkých označených produktov na zmazanie:';
2346var js_lang_product_delete_prompt_count_please = 'Prosím zadajte číslo';
2347var js_lang_product_delete_prompt_count_info_cur = '(počet produktov na tejto strane)';
2348var js_lang_product_delete_prompt_count_info_other = '(počet produktov na ďalších stranách)';
2349var js_lang_product_delete_error = 'Zadajte správny počet produktov, prosím.';
2350var js_lang_article_delete_prompt_more_content = 'Naozaj ste si istý? Počet všetkých označených článkov na zmazanie:';
2351var js_lang_article_delete_prompt_count_please = 'Prosím zadajte číslo';
2352var js_lang_article_delete_prompt_count_info_cur = '(počet článkov na tejto strane)';
2353var js_lang_article_delete_prompt_count_info_other = '(počet článkov na ďalších stranách)';
2354var js_lang_article_delete_error = 'Zadajte správny počet článkov, prosím.';
2355
2356var js_lang_variant_delete_error = 'Zadajte správny počet variantov, prosím.';
2357var js_lang_variant_delete_main_text_01 = 'Naozaj si prajete zmazať varianty obsahujúce text';
2358var js_lang_variant_delete_main_text_02 = '(varianty budú reálne odstránené až po uložení úpravy produktu)';
2359var js_lang_variant_delete_main_text_03 = 'Počet nájdených variantov';
2360var js_admin_lang_delete_accepted_variant = "variant";
2361var js_admin_lang_delete_accepted_variant_2 = "varianty";
2362var js_admin_lang_delete_accepted_variant_3 = "variant";
2363var js_admin_lang_delete_accepted_variants = "variantov";
2364
2365var cms_js_lang_credit_note_next_no_err = 'Dobropis so zadaným číslom už existuje. Zadajte prosím iné.';
2366var cms_js_lang_order_chcek_stock_after_update = 'Dôjde ku zmene počtu kusov v objednávke. Skontrolujte prosím počty kusov na hlavnom/dodávateľskom sklade pri jednotlivých položkách objednávky.';
2367var cms_js_lang_order_chcek_stock_sum_error = 'Súčet hlavného a dodávateľského skladu sa musí rovnať počtu objednaných kusov.';
2368
2369var cms_js_lang_shop_coupon_total = 'Pevná čiastka';
2370var cms_js_lang_shop_coupon_percent = 'Percentá';
2371var cms_js_lang_shop_coupon_type_gift = 'Jednorazový';
2372
2373var cms_js_lang_shop_coupon_type_permanent = 'Trvalý';
2374var cms_js_lang_shop_coupon_type_automatic = 'Automatický';
2375var cms_js_lang_shop_coupon_type_deductable = 'Odpočítateľný';
2376var cms_js_lang_shop_coupon_type_gift_voucher = 'Darčeková poukážka';
2377
2378var cms_js_lang_product_img_path_change = 'Cesta k zvolenému obrázku neexistuje alebo bol zmazaný';
2379
2380
2381var cms_js_lang_modeule_hide_0 = 'Naozaj chcete skryť názov modulu?';
2382var cms_js_lang_modeule_hide_1 = 'Naozaj chcete zobraziť názov modulu?';
2383var cms_js_lang_modeule_hide_2 = 'Naozaj chcete skryť modul?';
2384var cms_js_lang_modeule_hide_3 = 'Modul nieje možné skryť';
2385
2386var cms_js_lang_external_scripts = 'Externé skripty:';
2387var cms_js_lang_external_scripts_tip = 'Zakázať vykonanie javascriptu v admin sekcii Obsah';
2388var cms_js_module_banner_editable_no_tags = 'Nie sú dostupné žiadne prvky pre úpravu bannera.';
2389
2390
2391var js_import_product_help_complication_info = new Array();
2392js_import_product_help_complication_info[0] = 'Nahlásenie komplikácii s importom produktov:';
2393js_import_product_help_complication_info[1] = 'V prípade komplikácii s importom produktov Vám odporúčame navštíviť <a href="index2.php?option=com_apps&mode=faqdetail&id=314" target="_blank"><strong>návod z admin sekcie Pomoc</strong></a>, kde sa nachádzajú odpovede na najčastejšie otázky. ';
2394js_import_product_help_complication_info[2] = 'Ak si aj naďalej nebudete vedieť s import poradiť, postupujte prosím podľa bodov nižšie. Následne budeme vedieť efektívne odpovedať na Vaše otázky a pomôcť Vám so správnou konfiguráciou nastavení pri importovaní CSV súboru: ';
2395js_import_product_help_complication_info[3] = '1) Zašlite nám screenshot v JPEG formáte, na ktorom bude viditeľná konfigurácia všetkých nastavení, ktorú ste zadali pred spustením samotného importu.';
2396js_import_product_help_complication_info[4] = '2) V prílohe e-mailu nám prepošlite CSV súbor, ktorý sa pokúšate importovať. Ak je súbor väčší ako 2 MB, zabaľte ho a zašlite nám ho ako ZIP súbor.';
2397js_import_product_help_complication_info[5] = 'Po kliknutí na tlačidlo <strong>Spustiť import</strong> sa automaticky vykoná <strong>záloha VŠETKÝCH produktov</strong> (nie iba importovaných produktov) v momente spustenia hromadného importu. Po vykonaní importu produktov budete vyzvaný potvrdiť správnosť importu kliknutím na tlačidlo <strong>Import je v poriadku</strong>. Navyše máte možnosť vrátiť všetky zmeny späť do času spred vykonania importu kliknutím na tlačidlo <strong>Zrušiť import a vrátiť dáta späť</strong>.';
2398js_import_product_help_complication_info[6] = 'Odporúčame Vám import produktov vždy potvrdiť, alebo vrátiť dáta späť do času pred importom <strong>ihneď po vykonaní importu produktov</strong>. V opačnom prípade môže nastať situácia, kedy dôjde ku vráteniu dát späť až po určitej dobe od vykonania importu - napríklad iným administrátorom, ktorý bude importovať produkty. Upozorňujeme, že dáta všetkých produktov sú vždy vrátené do pôvodného stavu pred posledným importom. Všetky zmeny, ktoré v dátach n
2398astali (odpočítanie zo skladu na základe objednávky atď...) budú teda vrátené späť do času spred posledného importu.';
2399
2400var cms_js_temporary_unavailable = 'Dočasne nedostupné';
2401var cms_js_contact_us_inform = 'informujte sa';
2402
2403var cms_js_selected_customer_no_orders = 'Pre vybraných zákaznikov neevidujeme žiadne objednávky';
2404var cms_js_orders_transfere = 'Presun objednávok';
2405var cms_js_orders_transfere_done = 'Objednávky boli presunuté';
2406var cms_js_total_order_transfered = 'Celkový počet objednávok, ktoré budú presunuté';
2407
2408var js_lang_check_stock_from_external_source = 'Overujem skladovú zásobu';
2409var js_lang_check_coupon_from_external_source = 'Overujem kupón';
2410var js_lang_check_gift_voucher_from_external_source = 'Overujem darčekovú poukážku';
2411var js_lang_my_account = 'Môj účet';
2412
2413var js_cart_select_item = 'Zvoľte si variant pre tento produkt.';
2414var js_lang_finstat_info_message = 'Vpíšte sem názov firmy alebo IČO a automaticky doplníme všetky fakturačné údaje vašej firmy.';
2415var js_lang_finstat_info_fill_message = 'Firemné údaje boli úspešne vyplnené';
2416var js_lang_google_places_info_message = 'Začnite písať, automatické dopĺňanie údajov adresy je aktívne.';
2417var js_lang_checkout_vat_valid = 'platné IČ DPH';
2418var js_lang_checkout_vat_valid_with_zero_vat = 'platné IČ DPH - nákup bez DPH pri nákupe zo zahraničia';
2419var js_lang_checkout_vat_invalid = 'neplatné IČ DPH';
2420var js_lang_checkout_vat_invalid_unable_to_check_vat_number = 'IČ DPH nebolo možné overiť automaticky';
2421var js_lang_checkout_vat_unavail = 'IČ DPH nie je možné overiť';
2422
2423var js_lang_checkout_tin_number_message = 'Ak je vaša spoločnosť platcom DPH, vyplňte nasledujúce pole vo formáte HU99999999.';
2424
2425var js_lang_checkout_delivery_might_take_longer = 'Doba dodania sa môže líšiť';
2426var js_lang_checkout_delivery_might_take_longer_button_back = 'Späť';
2427
2428var js_lang_blog_edit_vex_title = 'Nastavenia blog sekcie';
2429var js_lang_blog_edit_vex_canceled = 'Úprava nastavení blog sekcie bola zrušená';
2430var js_lang_blog_edit_vex_ok = 'Nastavenia blog sekcie boli zmenené';
2431
2432var cms_js_lang_cfg_product_param_type_change_confirm_2 = 'Naozaj chcete zmenit typ parametra %s1? Táto hodnota bude odstránená z parametrov %s2.';
2433
2434var js_lang_check_coupon = 'Overujem kupón';
2435var js_lang_recommended_button = 'Odporúčané aplikácie';
2436
2437var cms_js_lang_session_expired = 'Prihlásenie vypršalo, pre pokračovanie je potrebné sa prihlásiť.';
2438
2439var js_lang_max_product_stock_per_order = '(pri objednávke max. {stock}ks)';
2440
2441var js_lang_store_cfg_vat_payer_disabled = 'Automatické prepočítavanie cien produktov je vypnuté. Hromadne upraviÅ¥ ceny produktov môžete napríklad využitím funkcie <a href="/administrator/index2.php?option=com_apps&mode=faqdetail&id=314" target="_blank">CSV importu produktov</a>, alebo nás kontakujte na adrese <a href="mailto:[email protected]">[email protected]</a>';
2442
2443var cms_js_lang_mod_category_title_img = 'Obrázok modulu';
2444var cms_js_lang_mod_category_title_desc = 'Popis kategórie';
2445
2446// $_PHPSHOP_ORDER_WITH_0_DPH_NO_DATA_VIES
2447var js_lang_order_with_0_dph_no_data_vies = 'Zo systému VIES neboli prijaté validné dáta';
2448var js_lang_order_with_0_dph_relaclulate_question = 'IČ DPH je validné a objednávka spĺňa podmienky pre nákup s 0% DPH. Želáte si prepočítať objednávku do režimu s 0% DPH?<br><br>Pozor, prepočítanú objednávku do režimu s 0% DPH nie je možné prerátať do pôvodného stavu.';
2449
2450var js_admin_lang_delete_module_name_text = '<b>Modul: {moduleName} bol úspešne zmazaný.</b>';
2451
2452var js_admin_lang_delete_module_text0 = 'Nebola presunutá žiadna stránka.';
2453var js_admin_lang_delete_module_text1 = 'Bola presunutá 1 stránka.';
2454var js_admin_lang_delete_module_text2_4 = 'Boli presunuté {countOfChangedSites} stránky.';
2455var js_admin_lang_delete_module_text5 = 'Bolo presunutých {countOfChangedSites} stránok.';
2456
2457var js_admin_lang_mass_overpricing_error1 = 'Hromadná zmena cien nebola vykonaná.';
2458var js_admin_lang_mass_overpricing_title = 'Hromadná zmena cien pre ';
2459var js_admin_lang_mass_overpricing_title1 = ' užívateľskú skupinu';
2460var js_admin_lang_mass_overpricing_title2_4 = ' užívateľské skupiny';
2461var js_admin_lang_mass_overpricing_title_more = ' užívateľských skupín';
2462var js_admin_lang_mass_overpricing_error2 = 'Hromadná úprava ceny zlyhala pre produkt s kódom produktu: ';
2463var js_admin_lang_mass_overpricing_error3 = 'Hromadná úprava ceny zlyhala pre produkty s kódom produktu: ';
2464var js_admin_lang_mass_overpricing_error4 = 'Nakoľko by bola cena nižšia ako 0.';
2465var js_admin_lang_mass_overpricing_error5_1 = 'Nakoľko tento produkt nemá záznam v databáze.';
2466var js_admin_lang_mass_overpricing_error5_more = 'nakoľko tieto produkty nemajú záznam v databáze.';
2467var js_admin_lang_mass_overpricing_error6 = 'Kontaktujte administrátora.';
2468var js_admin_lang_mass_overpricing_done1 = 'Hromadná zmena pre ';
2469var js_admin_lang_mass_overpricing_done2 = ' produktu, prebehla v poriadku.';
2470var js_admin_lang_mass_overpricing_done3 = ' produktov, prebehla v poriadku.';
2471var js_admin_lang_mass_overpricing_error7 = 'Počas ukladania dať nastala chyba, skúste opakovať uloženie.';
2472var js_admin_lang_mass_overpricing_error8 = 'Počas odosielania dať nastala chyba, skúste opakovať uloženie.';
2473
2474
2475
2476var js_admin_lang_total_csv_orders_count = 'Celkový počet údajov v CSV súbore: ';
2477var js_admin_lang_existet_orders_in_system_count = 'Existujúcich objednávok v systéme: ';
2478var js_admin_lang_non_existet_orders_in_system1 = 'Zoznam ';
2479var js_admin_lang_non_existet_orders_in_system2 = ' neexistujúcich objednávok: ';
2480var js_admin_lang_non_existet_orders_in_system3 = ' neexistujúcej objednávky: ';
2481var js_admin_lang_paired_orders_count1 = 'Počet úspešne spárovaných objednávok (podľa sumy objednávky): ';
2482var js_admin_lang_paired_orders_count2 = 'Počet úspešne spárovanej objednávky (podľa sumy objednávky): ';
2483var js_admin_lang_paired_orders = ' úspešne spárovaných objednávok ';
2484var js_admin_lang_paired_orders2 = ' úspešne spárovanej objednávky ';
2485var js_admin_lang_paired_orders_bl = ' bez zmeny stavu <br/>(s nastaveným zákazom zmeny - blacklist): ';
2486var js_admin_lang_unpaired_orders_by_sum_count = 'Počet nespárovaných objednávok (podľa sumy objednávky): ';
2487var js_admin_lang_unpaired_orders = ' nespárovaných CSV dát: ';
2488var js_admin_lang_unpaired_orders1 = ' nespárovaného CSV záznamu: ';
2489
2490var js_admin_lang_pairing_payment_orders = 'Párovanie platieb objednávok';
2491var js_admin_lang_pairing_payment_orders_wait = 'Prebieha spracovávanie dát. Čakajte prosím.';
2492
2493// APP 865
2494var js_admin_lang_settings_app_865_ordering_update = 'Poradie spúšťačov bolo upravené';
2495var js_admin_lang_settings_app_865_trigger_confirm_delete = 'Naozaj si želáte zmazať zvolený spúšťač "%triger_name%"?';
2496var js_admin_lang_settings_app_865_triggers_confirm_delete = 'Naozaj si želáte zmazať zvolené spúšťače "%triger_name%"?';
2497var js_admin_lang_settings_app_865_trigger_delete = 'Zvolený spúšťač bol zmazaný';
2498var js_admin_lang_settings_app_865_triggers_delete = 'Zvolené spúšťače boli zmazané';
2499var js_admin_lang_settings_app_865_trigger_edit_close = 'Úprava spúšťača bola zrušená';
2500var js_admin_lang_settings_app_865_trigger_create_save = 'Spúšťač bol vytvorený';
2501var js_admin_lang_settings_app_865_trigger_edit_save = 'Spúšťač bol upravený';
2502var js_admin_lang_settings_app_865_tooltip_0 = 'Zvoľte typ spúšťača';
2503var js_admin_lang_settings_app_865_triger_activate_confirm = 'Naozaj si želáte aktivovať zvolený spúštač "%triger_name%"?';
2504var js_admin_lang_settings_app_865_triger_activate_notification = 'Spúšťač "%triger_name%" bol <b>aktivovaný</b>';
2505var js_admin_lang_settings_app_865_triger_deactivate_confirm = 'Naozaj si želáte deaktivovať zvolený spúštač "%triger_name%"?';
2506var js_admin_lang_settings_app_865_triger_deactivate_notification = 'Spúšťač "%triger_name%" bol <b>deaktivovaný</b>';
2507var js_admin_lang_settings_app_865_trial_message = 'Pre plnú verziu funkcie kontaktujte [email protected]';
2508var js_admin_lang_settings_app_865_rulle_name_empty = 'Vyplňte názov spúšťača!';
2509var js_admin_lang_settings_app_865_rulle_all_empty = 'Vyplňte aspoň jednu "AND" podmienku spúšťača!';
2510var js_admin_lang_settings_app_865_rulle_any_empty = 'Vyplňte aspoň jednu "OR" podmienku spúšťača!';
2511var js_admin_lang_settings_app_865_rulle_action_empty = 'Vyplňte typ spúšťača!';
2512// END APP 865
2513
2514var cms_js_lang_checkout_street_validation_error = 'Doplňte popisné číslo';
2515
2516var js_admin_mass_print_orders_firefox_notif_title = 'Upozornenie pre prehliadač Firefox:';
2517var js_admin_mass_print_orders_firefox_notif_body = 'Aby ste dosiahli najlepšie zobrazenie hromadnej tlače objednávok, použite radšej prehlia
2517dač Chrome / Opera.';
2518
2519var js_admin_export_order = 'Export objednávok';
2520var js_admin_export_order_error = 'Nebola exportovaná žiadna objednávka';
2521
2522var js_admin_please_select_at_least_one_order = 'Zvoľte prosím aspoň jednu objednávku.';
2523
2524var js_lang_menu_item_delete_title = 'Zmazať menu položku';
2525var js_lang_menu_item_delete_error = 'Zadajte správny počet článkov, prosím.';
2526var js_lang_menu_item_delete_prompt_more_content = 'Naozaj ste si istý? Vymazaná bude stránka s {num_of_articles}.<br>Počet všetkých článkov, ktoré sa zmazaním tejto položky takisto vymažú:';
2527var js_lang_menu_item_delete_prompt_count_please = 'Prosím zadajte číslo';
2528var js_lang_menu_item_delete_prompt_count_info = '(počet článkov pre zmazanie)';
2529var js_lang_menu_item_delete_count_articles_1 = 'článkom';
2530var js_lang_menu_item_delete_count_articles_2 = 'článkami';
2531var js_lang_menu_item_change_title = 'Zmeniť menu položku';
2532
2533// sprava uctu 2.0
2534var js_lang_account_index_datatable_orders_sSearch = 'Názov tovaru, číslo objednávky, faktúra . . .';
2535var js_lang_account_index_datatable_orders_sLengthMenu = 'Zobraziť na stranu: _MENU_';
2536var js_lang_account_index_datatable_orders_sInfo = 'Zobrazených _START_-_END_ z _TOTAL_ objednávok';
2537var js_lang_account_index_datatable_products_sInfo = 'Zobrazených _START_-_END_ z _TOTAL_ produktov';
2538var js_lang_account_index_allowed_products_export_tooltip = 'Pre export je nutné zvoliť aspoň jedného podriadeného';
2539var js_lang_account_index_allowed_products_clear_tooltip = 'Pre zmazanie je nutné zvoliť aspoň jedného podriadeného';
2540var js_lang_account_index_repeat_order = 'Opakovať objednávku';
2541var js_lang_account_index_product_no_exists = 'Produkt už nie je dostupný';
2542
2543// cssearch
2544var js_lang_cssearch_no_match = 'Žiadna zhoda';
2545var js_lang_cssearch_min_chars = 'Zadajte prosím minimálne {char} znaky';
2546
2547// strazny pes
2548var js_lang_product_watch_unfollow_confirm_msg = 'Boli ste úspešne odhlásený zo sledovania produktu.';
2549var js_lang_product_watch_unfollow_error_msg = 'Nastala chyba pri odhlasovaní!';
2550
2551var js_lang_modul_info_tooltip_vex = 'Informácia pre administrátora';
2552var js_lang_modul_info_tooltip_vex2 = 'Pridať info';
2553
2554var js_lang_modul_info_display_has_info = 'Zobraziť info pre admina';
2555var js_lang_modul_info_display_no_info = 'Pridať info pre admina';
2556
2557var js_admin_lang_invoice_successfully_deleted = 'Faktúra bola úspešne vymazaná';
2558var js_admin_lang_credit_note_successfully_deleted = 'Dobropis bol úspešne vymazaný';
2559var js_admin_lang_credit_note_date_successfully_changed = 'Dátum dobropisu bol úspešne zmenený';
2560var js_admin_lang_credit_note_items_successfully_saved = 'Zmeny položiek dobropisu boli uložené';
2561
2562// NSU
2563var js_lang_nsu_phone_valid_error = 'Povolené sú len znaky "0-9", "+", "-" a "/"';
2564var js_lang_nsu_ico_valid_error = 'Povolené sú len znaky "0-9"';
2565var js_lang_nsu_default_address_add_rly = 'Naozaj chcete nastaviť adresu %adress_name% ako predvolenú?';
2566var js_lang_nsu_default_address_checkbox_hover = 'Prvá dodacia adresa musí byť predvolená';
2567var js_lang_nsu_default_address_successfully_changed = 'Dodacia adresa %adress_name% bola nastavená ako predvolená';
2568var js_lang_nsu_default_address_remove_error = 'Predvolenú adresu nie je možné vymazať';
2569var js_lang_nsu_delete_shipping_address_rly = 'Naozaj chcete vymazať túto dodaciu adresu?';
2570var js_lang_nsu_delete_shipping_address_rly_alone_default = 'Dodacia adresa je predvolená.<br>Naozaj ju chcete vymazať?';
2571var js_lang_nsu_next_page = 'Ďalšia strana';
2572var js_lang_nsu_orders_multi_purchased_products = 'Objednávky s ';
2573var js_lang_nsu_delete_watchdog_rly = 'Skutočne zrušiť sledovanie tohto produktu?';
2574var js_lang_nsu_credits_not_allowed_amount_error = 'Najnižšia hodnota kreditu, ktorú možno presunúť je +1 bod.';
2575var js_lang_nsu_credits_low_amount_error = 'Najvyššia hodnota kreditu, ktorú možno presunúť je %s bodov.';
2576var js_lang_nsu_credits_update_rly = 'Skutočne chcete presunúť kredit vo výške %credit% bodov používateľovi %user% ?';
2577var js_lang_nsu_donate_credit_valid_error = 'Povolená je hodnota od 1 do %credit%';
2578var js_lang_nsu_no_product_results = 'Neboli nájdené žiadne zakúpené produkty.';
2579var js_lang_nsu_no_saved_cart_results = 'Neboli nájdené žiadne uložené košíky.';
2580var js_lang_nsu_saved_cart_load = 'Aktivovať uložený košík';
2581var js_lang_nsu_saved_cart_delete = 'Zmazať uložený košík';
2582var js_lang_nsu_saved_cart_load_modal_title = 'Uložený košík - %_SAVED_CART_NAME_%';
2583var js_lang_nsu_saved_cart_load_modal_msg = 'Prajete si pridať produkty do košíka a ponechať uložený košík pre prípadné opätovné použitie?';
2584var js_lang_nsu_saved_cart_load_modal_btn_1 = 'Naplniť a ponechať';
2585var js_lang_nsu_saved_cart_load_modal_btn_2 = 'Naplniť a odstrániť';
2586var js_lang_nsu_saved_cart_delete_modal_title = 'Uložený košík - %_SAVED_CART_NAME_%';
2587var js_lang_nsu_saved_cart_delete_modal_msg = 'Skutočne chcete zmazať uložený košík s názvom "%_SAVED_CART_NAME_%" ?';
2588var js_lang_nsu_saved_cart_delete_success = 'Uložený košík bol vymazaný';
2589var js_lang_nsu_saved_cart_delete_error = 'Uložený košík sa nepod
2589arilo vymazať';
2590var js_lang_nsu_saved_cart_add_error = 'Nepodarilo sa pridať všetky produkty do košíka';
2591var js_lang_nsu_datatable_orders_sSearch = 'Názov tovaru, číslo objednávky, faktúra . . .';
2592var js_lang_nsu_datatable_orders_sLengthMenu = 'Zobraziť na stranu: _MENU_';
2593var js_lang_nsu_datatable_orders_sInfo = 'Zobrazených _START_-_END_ z _TOTAL_ objednávok';
2594var js_lang_nsu_datatable_products_sInfo = 'Zobrazených _START_-_END_ z _TOTAL_ produktov';
2595var js_lang_nsu_pw_too_short = 'Príliš krátke (min. 6 znakov)';
2596var js_lang_nsu_pw_too_short_hint = '"Príliš krátke" heslo má dĺžku menej ako 6 znakov.';
2597var js_lang_nsu_pw_weak = 'Slabé';
2598var js_lang_nsu_pw_weak_hint = '"Slabé" heslo nemá dĺžku 8 znakov, neskladá sa z veľkých písmen, malých písmen a číslic';
2599var js_lang_nsu_pw_medium = 'Priemerné';
2600var js_lang_nsu_pw_medium_hint = '"Priemerné" heslo nemá dĺžku 12 znakov, neskladá sa z veľkých písmen, malých písmen a číslic.';
2601var js_lang_nsu_pw_strong = 'Silné';
2602var js_lang_nsu_customer_password_strength = '<strong>Vysvetlenie pojmu "Sila hesla":</strong><br /><br /><strong>"Príliš krátke"</strong> heslo má dĺžku menej ako 6 znakov.<br /><strong>"Silné"</strong> heslo ma dĺžku najmenej 12 znakov, skladá sa z velkých písmen, malých písmen a číslic.<br /><strong>"Priemerné"</strong> heslo má dĺžku najmenej 8 znakov, skladá sa z velkých a malých písmen, alebo z velkých písmen a číslic, alebo z malých písmen a číslic.<br /><strong>"Slabé"</strong> heslo je horšie ako "Priemerné" heslo v niektorom z jeho parametrov.';
2603var js_lang_nsu_new_form_nesessery_item = 'Táto položka je povinná.';
2604var js_lang_nsu_lm_wrong_email = 'Nesprávny formát e-mail adresy.';
2605var js_lang_nsu_customer_password_notmatched = 'Heslá sa nezhodujú.';
2606var js_lang_nsu_product_no_exists = 'Produkt už nie je dostupný';
2607var js_lang_repeat_order_config = 'Objednávku s vybranými produktami ste realizovali pred menej ako 1 dňom.<br>Skutočne si želáte objednávku zopakovať?';
2608var js_lang_nsu_datatable_wishlist_sEmptyTable = 'Váš Wishlist je aktuálne prázdny';
2609var js_lang_nsu_no_wishlist_product_results = 'Neboli nájdené žiadne produkty z Wishlistu:';
2610// NSU
2611
2612var js_admin_lang_complete_before_leave_warning = 'Prosím dokončite a uložte najskôr predchádzajúce úpravy.';
2613
2614var js_lang_product_attachment_info = 'Nahrajte súbor s dizajnom, ktorý chcete potlačiť na produkt vo formáte .pdf alebo .zip';
2615var js_lang_product_attachment_info_s = 'Produkt s nahratým súborom sa pridá do košíka a môžete pokračovať pri vyberaní ďalších produktov. Po skončení výberu pokračujte do košíka a následne do pokladne, kde kliknite na tlačidlo "Vyžiadať nezáväznú cenovú ponuku"';
2616
2617var js_lang_app_946_infobar_message_tooltip = 'Ak nebude vyplnený preklad pre jazykovú mutáciu, infowidget sa na tejto mutácii nebude zobrazovať.';
2618var js_lang_app_946_infobar_set_icon_tooltip = 'Obrázok je potrebné nahrávať vo formáte SVG.';
2619
2620var js_lank_product_attachment_price_offer = 'Vyžiadať nezáväznú cenovú ponuku';
2621
2622var js_lang_marketing_check_all_title_check = 'Vždy exportovať produkty všetkých kategórií';
2623var js_lang_marketing_check_all_title_uncheck = 'Zrušiť nastavenie exportu produktov vždy všetkých kategórií';
2624var js_lang_marketing_check_all_rly_check = 'Naozaj chcete pre portál <strong>%portal%</strong> vždy exportovať produkty všetkých kategórií?';
2625var js_lang_marketing_check_all_rly_uncheck1 = 'Naozaj pre portál <strong>%portal%</strong> zrušiť nastavenie exportu produktov vždy všetkých kategórií?';
2626var js_lang_marketing_check_all_rly_uncheck2 = 'Týmto budú nastavené pôvodné kategórie pre export do portálu <strong>%portal%</strong>';
2627var js_lang_marketing_check_all_save_btn = 'Uložiť nastavenie exportu produktov vždy všetkých kategórií';
2628var js_lang_marketing_check_all_vex1 = 'Vykonávate zmenu nastavenia exportu produktov vždy všetkých kategórií</br>a túto zmenu je potrebné uložiť / zrušiť.';
2629var js_lang_marketing_check_all_vex2 = 'Následne budete môcť robiť zmeny ďalšími spôsobmi.';
2630
2631var cms_js_lang_instagram_img_num_display = 'Počet zobrazených obrázkov';
2632
2633var js_lang_shipping_addresses_list_lbl = 'Nová predvolená dodacia adresa:';
2634var js_lang_shipping_address_is_default_title = 'Dodacia adresa je predvolená';
2635var js_lang_shipping_address_is_default_confirm = 'Naozaj ju chcete vymazať?';
2636var js_lang_shipping_address_is_default_warning = 'Pokúšate sa odstrániť predvolenú dodaciu adresu.<br><br>Pred tým, ako budete pokračovať, zvoľte zo zoznamu novú predvolenú adresu.<br><br>';
2637var js_lang_shipping_address_already_exists = 'Dodacia adresa s takýmto názvom už existuje.';
2638var js_lang_input_values_were_changed = 'Zmenili ste údaje v nasledujúcich poliach:';
2639var js_lang_do_you_want_to_continue = 'Naozaj chcete ďalej pokračovať?';
2640var js_lang_shipping_address_no_longer_exist = 'Táto dodacia adresa už neexistuje.<br><br>Naozaj ju chcete vytvoriť?';
2641
2642var js_lang_postponed_order_vex_delete = 'Naozaj chcete zmazať dátum odloženého dodania?';
2643var js_lang_postponed_order_without_date = 'Objednáva nemá nastavený dátum odloženého dodania.';
2644var js_lang_postponed_order_deleted = 'Dátum odloženého dodania bol zmazaný.';
2645var js_lang_postponed_order_delete_error = 'Dátum odloženého dodania bol zmazaný.';
2646var js_lang_postponed_order_edit_error = 'Dátum odloženého dodania nebolo možné nastav
2646iť/upraviť.';
2647var js_lang_postponed_order_delete_edited = 'Dátum odloženého dodania bol upravený.';
2648
2649
2650var js_lang_payment_status_vex_delete = 'Naozaj chcete zmazať dátum úhrady objednávky?';
2651var js_lang_payment_status_date_edited = 'Dátum úhrady objednávky bol upravený.';
2652var js_lang_payment_status_date_delete_error = 'Dátum úhrady objednávky nebolo možné zmazať';
2653var js_lang_payment_status_date_edit_error = 'Dátum úhrady objednávky nebolo možné nastaviť/upraviť.';
2654var js_lang_payment_status_value_edited = 'Celková uhradená suma objednávky bola upravená.';
2655var js_lang_payment_status_value_edited_error = 'Celková uhradená suma objednávky bola nesprávne zadaná/zmazaná a nie je definovaná.';
2656var js_lang_payment_status_delete_error = 'Dátum úhrady objednávky bol zmazaný.';
2657
2658var js_lang_export_product_watchdog = "Systém nenašiel pre žiadny zo zvolených produktov údaje o strážení.";
2659
2660var js_lang_save_article = 'Uložiť';
2661var js_lang_save_and_remain_in_edit = 'Uložiť a zostať v úprave';
2662var js_lang_edit_seo_data = 'Upraviť SEO dáta článku';
2663var js_lang_article_cancel = 'Zrušiť';
2664var js_lang_article_title_not_empty = 'Názov článku nesmie ostať prázdny!';
2665var js_lang_article_introtext_not_empty = 'Úvodný text nesmie ostať prázdny!';
2666var js_lang_article_was_successfully_created = 'Článok úspešne vytvorený';
2667
2668var js_lang_order_change_status_notify = 'Nastala zmena skladu u nasled. produktov:';
2669
2670var js_lang_app_959_please_choose = 'Prosím vyberte';
2671var js_lang_app_959_save_notification = 'Nastavenia zmeny dostupnosti produktu boli uložené.';
2672var js_lang_app_959_save_notification_error = 'Nastavenia neboli uložené, skontrolujte dostupnosti.';
2673
2674var js_lang_mod_shop_product_group_only_in_stock = 'Iba skladom';
2675var js_lang_changes_saved = 'Zmeny boli uložené';
2676
2677var js_lang_instagram_users = 'Používatelia';
2678var js_lang_instagram_no_users = 'Žiadny používateľ';
2679var js_lang_show_only_default_vv = 'Zobrazovať iba predvolené virt. varianty';
2680var js_lang_product_attribute_stock_note = 'V balení';
2681
2682var js_browse_listing_set_quantity = 'Prosím, zadajte množstvo';
2683var js_browse_listing_choose_variant = 'Prosím, vyberte variant';
2684var js_browse_listing_unavailable_quantity = 'Skladom máme len {quantity} {unit}';
2685
2686var js_watch_Stock_custom_header_msg = 'Pripomenúť, keď bude produkt k dispozícii';
2687var js_watch_stock_custom_body_msg = 'Budeme ťa informovať';
2688var js_watch_stock_custom_send_btn = 'Zatvoriť';
2689var js_watch_stock_attr_error_msg = 'Je potrebné vybrať nejakú z možností veľkostí.';
2690var js_watch_cancel_watch_btn_lbl = 'Zrušiť sledovanie';
2691
2692var js_lang_luigi_undefined_manufacturer = 'Výrobca neuvedený';
2693
2694var js_lang_product_not_in_offer = 'Zobraziť aj nedostupné produkty';
2695
2696var cms_js_lang_claim_choose_product = 'Vyberte produkt';
2697
2698var js_lang_app_970_connection_create = 'Vytvorenie novej identity';
2699var js_lang_app_970_connection_created = 'Identita bola vytvorená';
2700var js_lang_app_970_connection_already_exists = 'Identita pre tuto doménu už existuje';
2701var js_lang_app_970_connection_loaded = 'Identity boli načitané / obnovené';
2702var js_lang_app_970_group_id = 'Group (list) ID';
2703var js_lang_app_970_assign_sgp = 'preradiť do zákazníckej skupiny';
2704
2705var js_lang_order_status_max_attachment_size_warn = 'Prekročili ste maximálnu celkovú velkosť príloh: 20MB.';
2706
2707var js_lang_order_order_list_import_delivered_orders_vex_title = 'Import čísel doručených zásielok';
2708var js_lang_order_order_list_import_delivered_orders_no_orders_to_change = 'Nemáme žiadne naparovane objednávky';
2709var js_lang_order_order_list_import_delivered_orders_orders_to_change_with_errors = 'Objednávky u ktorych nastala chyba:';
2710
2711var js_lang_registration_reset_password_email_already_sent = 'Pre zadaný e-mail už bol odoslaný overovací e-mail pre zmenu hesla. Skontrolujte svoju e-mail schránku.';
2712var js_lang_registration_reset_password_email_sent = 'Na zadanú e-mail adresu bol odoslaný overovací e-mail. Pokračujte podľa pokynov v e-mail správe.';
2713var js_lang_registration_reset_password_password_changed = 'Heslo bolo úspešne zmenené. Od teraz sa môžete prihlasovať s novým heslom.';
2714var js_lang_registration_reset_password_password_changed_continue = 'Pokračujte ďalej automatickým prihlásením';
2715var js_lang_registration_reset_password_field_required = 'Položka je povinná';
2716var js_lang_registration_reset_password_passwords_dont_match = 'Heslá sa nezhodujú';
2717var js_lang_registration_reset_password_password_too_short = 'Heslo je príliš krátke';
2718
2719var js_api_dpd_export_orders_modal_title = 'Export objednávok do DPD';
2720
2721var js_api_gls_export_orders_modal_title = 'Export objednávok do GLS';
2722var js_api_gls_export_orders_modal_fss_empty_phone = 'Je potrebné vyplniť tel. číslo';
2723var js_api_gls_export_orders_modal_fds_fss_not_checked = 'Táto služba vyžaduje aktívnu službu FSS';
2724var js_api_gls_export_orders_modal_fds_empty_email = 'Je potrebné vyplniť e-mail';
2725var js_api_gls_export_orders_modal_sm2_empty_phone = 'Je potrebné vyplniť tel. číslo';
2726var js_api_gls_export_orders_modal_sm1_empty_phone_or_sms_text = 'Je potrebné vyplniť tel. číslo a obsah sms správy';
2727var js_api_gls_export_orders_modal_dds_empty_delivery_date = 'Je potrebné vybrať dátum dodania';
2728var js_api_gls_export_orders_modal_t12_fss_fds_selected = 'Kombinácia FSS, FDS a T12 nie je povolená';
2729var js_api_gls_export_orders_modal_dds_fss_fds_selected = 'Kombinácia FSS, FDS a DDS nie je povolená';
2730var js_api_gls_export_orders_modal_sat_fss_fds_selected = 'Kombinácia FSS, FDS a SAT nie je povolená';
2731var js_api_gls_export_orders_modal_xs_fss_fds_selected = 'Kombinácia FSS, FDS a XS nie je povolená';
2732var js_api_gls_export_orders_modal_dds_fds_ps_selected = 'Kombinácia FDS, PS a DDS nie je povolená';
2733var js_api_gls_export_orders_modal_t12_fds_ps_selected = 'Kombinácia FDS, PS a T12 nie je povolená';
2734var js_api_gls_export_orders_modal_sat_fds_ps_selected = 'Kombinácia FDS, PS a SAT nie je povolená';
2735var js_api_gls_export_orders_modal_dds_sm1_selected = 'Kombinácia DDS a SM1 nie je povolená';
2736var js_api_gls_export_orders_modal_aos_selected = 'Je nutné vyplniť meno príjemcu';
2737
2738var js_add_to_cart_as_inquiry = 'Pridať ako cenovú ponuku';
2739
2740var cms_js_lang_admin_google_cloud_label_1 = 'štatistika využitia prekladov';
2741var cms_js_lang_admin_google_cloud_label_2 = 'Rok';
2742var cms_js_lang_admin_google_cloud_label_3 = 'Mesiac';
2743var cms_js_lang_admin_google_cloud_label_4 = 'Počet znakov';
2744var cms_js_lang_admin_google_cloud_label_5 = 'Počty preložených znakov sú orientačné a nezahŕňajú preklady vykonané mimo administrácie e-shopu.';
2745var cms_js_lang_admin_google_cloud_label_6 = 'Prajete si preložiť text o dĺžke';
2746var cms_js_lang_admin_google_cloud_label_7 = 'znakov?';
2747var cms_js_lang_admin_google_cloud_label_8 = 'Preklad Google Translate';
2748var cms_js_lang_admin_google_cloud_label_9 = 'Preložiť';
2749
2750var js_order_edit_order_item_purchased_price_changed = 'Nákupná cena položky bola zmenená';
2751
2752var js_google_translate_api_quotes_limit_error = 'Bol prekročený limit pre preklady';
2753
2754var js_registration_company_tin_please_enter_correct_tin = 'Prosím vložte správne IČ DPH';
2755
2756var js_lang_product_currently_sold_out = 'Aktuálne vypredané u dodávateľa.';
2757var js_lang_product_variant_out_of_stock_info = 'Nie je na sklade';
2758
2759var js_lang_product_will_be_removed_from_group_after_one_day = 'Produkty budú vyradené po uplynutí %s dňa.';
2760var js_lang_product_will_be_removed_from_group_after_x_days = 'Produkty budú vyradené po uplynutí %s dní.';
2761
2762var js_lang_change_primary_section_vex_info = 'Po zmene URL adries Vám odporúčame zadať ich 301 presmerovania v admin sekcii Nastavenia.';
2763var js_lang_hold_shift_tooltip = '<div style="text-align:left">Viacnásobné označenie viac položiek:</div>- držte Shift + kliknitie myšou na ďalší checkbox <a href="%link" target="_blank">Viac info...</a>';
2764
2765var cms_js_lang_set_featureprod_group_change_confirm = 'Uložením nastavenia Skupiny produktov dôjde k zrušeniu voľby "Kategórií produktov".\nChcete nastaviť zobrazenie produktov z danej Skupiny produktov?';
2766var cms_js_lang_set_featureprod_group_cat_change_confirm = 'Uložením nastavenia kategórií dôjde k zrušeniu voľby "Skupina produktov".\nChcete pokračovať a nastaviť zobrazenie produktov z vybraných kategórií?';
2767var cms_js_lang_set_featureprod_group_params_change_confirm = 'Uložením nastavenia parametrov dôjde k zrušeniu aktuálnych volieb.\nChcete pokračovať a nastaviť zobrazenie produktov z vybraných parametrov?';
2768
2769var js_lang_product_please_select_atleast_one_product = 'Prosím zvoľte aspoň jeden produkt.';
2770
2771var js_lang_blog_sep_vex_sentence = 'Zmeniť menu položku z typu obyčajná stránka na typ:';
2772var js_lang_blog_sep_vex_type_blog = 'BLOG sekcia';
2773var js_lang_blog_sep_vex_type_url = 'URL odkaz';
2774var js_lang_blog_sep_change_type_to_blog_okmsg = 'Položka <strong>%n</strong> bola úspešne zmenená na typ BLOG sekcia.';
2775
2776var js_lang_adminlang_swe_content_comments_add_main_title = 'Pridať komentár';
2777
2778var js_lang_phpshop_registration_thank_you_vex_title = 'Registrácia je ukončená!';
2779
2780var js_lang_adminlang_product_admin_note_tooltip_modify_note = 'Poznámky k objednávke (viditeľné iba pre administrátora)';
2781
2782var js_lang_automated_triggers_create_invoice = 'Vytvoriť faktúru';
2783
2784var js_lang_adminlang_product_size_table_new_title = 'Vytvorenie novej tabuľky';
2785var js_lang_adminlang_product_size_table_update_title = 'Úprava veľkostnej tabuľky "%name%"';
2786var js_lang_adminlang_product_size_table_delete_confirm = 'Naozaj chcete vymazať veľkostnú tabuľku?';
2787var js_lang_adminlang_product_size_table_delete_row_alert = 'Nemôžete zmazať posledný riadok tabuľky';
2788var js_lang_adminlang_product_size_table_delete_column_alert = 'Nemôžete zmazať posledný stĺpec tabuľky';
2789var js_lang_adminlang_product_size_table_delete_row_new_up_title = 'Pridať nový riadok pred';
2790var js_lang_adminlang_product_size_table_delete_column_new_left_title = 'Pridať nový stĺpec pred';
2791var js_lang_adminlang_product_size_table_delete_row_new_down_title = 'Pridať nový riadok za';
2792var js_lang_adminlang_product_size_table_delete_column_new_right_title = 'Pridať nový stĺpec za';
2793var js_lang_adminlang_product_size_table_delete_row_delete_title = 'Vymazať riadok';
2794var js_lang_adminlang_product_size_table_delete_column_delete_title = 'Vymazať stĺpec';
2795var js_lang_adminlang_product_size_table_name = 'Názov veľkostnej tabuľky';
2796var js_lang_adminlang_product_size_table_created = 'Veľkostná tabuľka "%name%" bola vytvorená';
2797var js_lang_adminlang_product_size_table_updated = 'Veľkostná tabuľka "%name%" bola upravená';
2798var js_lang_adminlang_product_size_table_deleted = 'Veľkostná tabuľka "%name%" bola vymazaná';
2799var js_lang_adminlang_product_size_table_fill_from = 'náplň z';
2800var js_lang_adminlang_product_size_table_image_label = 'Obrázok tabuľky veľkosti';
2801
2802
2803var js_lang_go4_timeslot_select = 'Go 4 - Výber časového okna';
2804var js_lang_go4_delivery = 'Go 4 kuriér';
2805
2806var js_lang_adminlang_magic_margin_label_1 = 'Vygenerovať Margin feed za';
2807var js_lang_adminlang_magic_margin_label_2 = 'dní dozadu.';
2808
2809var js_lang_api_payment_confirm_button = 'Spracovať';
2810var js_lang_api_payment_cancel_button = 'Zrušiť';
2811var js_lang_api_payment_refund_system_error = 'Systémová chyba pri zaslaní!';
2812var js_lang_api_payment_refund_amount_has_to_be_positive = 'Zadaná suma musí byť kladné číslo!';
2813var js_lang_api_payment_refund_amount_has_to_be_less = 'Zadaná suma musí byt rovnaká alebo menšia ako rozdiel medzi sumou už vykonaných návratov a pôvodnou v
2813ýškou platby!';
2814
2815var js_lang_checkout_loader_initial = 'Spracováva sa...';
2816var js_lang_checkout_loader_intermediate = 'Chvíľku strpenia...';
2817var js_lang_checkout_loader_final = 'Ešte chvíľu počkajte...';
2818
2819var js_lang_payment_loader_delay_text = 'Čakajte prosím, otvára sa<br>platobná brána na úhradu...';
2820
2821var js_lang_import_done = 'Import sa dokončil';
2822
2823var js_lang_checkout_thankyou_unregistered_vex_title = 'Upozornenie pre zákazníka';
2824var js_lang_checkout_thankyou_unregistered_vex_confirm = 'Ok';
2825
2826var js_lang_link_settings = 'Nastavenia linku';
2827var js_lang_choose_link_type = 'Vyberte typ odkazu';
2828var js_lang_minimal_chars = 'Zadajte min. 3 znaky';
2829var js_lang_categories = 'Kategórie';
2830
2831var js_lang_order_print_payment_edit_label_open = 'Upraviť spôsob platby';
2832var js_lang_order_print_shipping_edit_label_open = 'Upraviť spôsob dopravy';
2833
2834var js_lang_order_dispach_not_in_dispach_state = 'Objednávka nie je v stave na expedovanie.';
2835var js_lang_order_dispach_already_dispached = 'Objednávka už bola expedovaná.';
2836var js_lang_order_dispach_retry_dispach = 'Opakovať expedíciu';
2837var js_lang_order_dispach_confirm = 'Expedovať';
2838var js_lang_order_dispach_vex_title = 'Automatická expedícia objednávky č.';
2839var js_lang_order_dispach_product_is_full = 'Produkt je už plný.';
2840var js_lang_order_dispach_product_too_many_pieces = 'Príliš veľa kusov.';
2841var js_lang_order_dispach_please_enter_quantity = 'Prosím zadajte množstvo.';
2842var js_lang_order_dispach_product_not_found = 'Produkt sa nenašiel.';
2843var js_lang_order_dispach_successful = 'Objednávka úspešne expedovaná.';
2844var js_lang_order_dispach_missing_piecies = 'Nie sú naplnené všetky produkty.';
2845var js_lang_order_dispach_vex_search_title = 'Zadajte objednávku na expedíciu';
2846var js_lang_order_dispach_begin_dispach = 'Spustiť expedíciu';
2847var js_lang_order_dispach_product_added = 'Produkt bol úspešne zadaný do expedície';
2848var js_lang_order_dispach_order_number = 'Číslo objednávky';
2849var js_lang_order_dispach_cancel_confirm_text = 'Naozaj chcete zrušiť celú expedíciu objednávky č.';
2850
2851var js_lang_payment_adyen_service_unavailable_title = 'Ospravedlňujeme sa';
2852var js_lang_payment_adyen_service_unavailable_content = 'Vyskytla sa chyba s platobnou bránou, prosím zvoľte iný spôsob platby.';
2853
2854var js_lang_articles_ordering_no_data = 'Daný blog neobsahuje žiadne články';
2855
2856var js_lang_modal_after_add_to_cart_vex_title = 'A je to v košíku!';
2857
2858var js_lang_product_available_again = 'Pravdepodobne bude k dispozícii od: ';
2859
2860var js_lang_mass_product_ordering = 'Zmena poradia produktov';
2861var js_lang_choose_only_one_category = 'Vo filtri kategórii vyberte len jednu kategóriu';
2862
2863var js_lang_coupon_free_shipping = 'Doprava zdarma';
2864
2865var js_lang_tin_number = 'DIČ';
2866
2867var js_lang_order_status_email_attachments_placeholder = 'Zvoľte prílohy';
2868
2869var js_lang_imagepin_product_sku = 'Vyhľadávanie produktu';
2870var js_lang_imagepin_abort_changes = 'Vykonané zmeny neboli uložené! Prajete si ich uložiť?';
2871var js_lang_imagepin_delete_pins = 'Vážne si prajete zmazať tieto špendlíky?';
2872var js_lang_imagepin_duplicated_title = 'Tento názov sa používa. Bolo mu priradené poradové číslo.';
2873var js_lang_imagepin_check_title = 'Nastala chyba pri kontrole názvu. Prosím zopakujte uloženie názvu.';
2874var js_lang_imagepin_help_title_rpin = 'Zmazať špendlík';
2875var js_lang_imagepin_delete_changes = 'Zahodiť zmeny';
2876var js_lang_imagepin_save_changes = 'Uložiť zmeny';
2877
2878var js_lang_app_1164_gopay_goid_tooltip = 'ID obchodníka ktoré ste obrdžali v e-maili od GoPay.';
2879var js_lang_app_1164_gopay_client_id_tooltip = 'Client ID ktoré ste obrdžali v e-maili od GoPay.';
2880var js_lang_app_1164_gopay_client_secret_tooltip = 'Client Secret ktoré ste obrdžali v SMS od GoPay.';
2881var js_lang_app_1164_gopay_environment_tooltip = 'Prostredie platobnej brány.';
2882var js_lang_app_1164_gopay_payment_mode_tooltip = 'Spôsob otvorenia platobnej brány. Redirect - Zákazník bude presmerovaný na platobnú bránu, Inline - Platobná brána sa zobrazí nad stránkou e-shopu a zákazník nebude presmerovaný.';
2883var js_lang_app_1164_gopay_refund_tooltip = 'Povoľuje refundácie ak je nastavenie aktívne v úprave objednávky v sekcii "Spôsob platby" sa zobrazí tlačídlo na vrátenie platby.';
2884var js_lang_app_1164_gopay_preauthorization_tooltip = 'Povoľuje predautorizované platby.';
2885var js_lang_app_1164_gopay_order_success_tooltip = 'Stav, na ktorý sa objednávka zmení po úspešnej platbe.';
2886var js_lang_app_1164_gopay_order_fail_tooltip = 'Stav, na ktorý sa objednávka zmení po neúspešnej platbe.';
2887
2888var js_lang_app_1452_label_tooltip = 'Pre zvolené zákaznícke skupiny bude deaktivovaná funkcia množstvových zliav pri zvýhodnenej cene produktu';
2889var js_lang_app_1452_select_placeholder = 'Zvoľte zákaznícke skupiny';
2890
2891var js_lang_vex_after_add_to_cart_login = 'Prihlásiť sa';
2892
2893var js_lang_limited_special_hide_image = 'Skryť obrázok';
2894
2895var js_lang_saving_price_label = 'Ušetríte';
2896
2897var js_lang_indexer_app_indexer_ready = 'Indexer pripravený.';
2898var js_lang_indexer_app_last_indexation = 'Posledná indexácia skončila';
2899
2900var js_lang_product_variant_required_weight = 'Hmotnosť variantu produktu je povinná';
2901
2902var js_lang_mod_shop_product_group_show_products_in_current_category = 'Produkty z aktuálnej kategórie';
2903
2904var js_lang_settings_mobile_app_delete_device = 'Odstrániť zariadenie s názvom "#_DEVICE_NAME_#"?';
2905
2906/* START priplatkove produkty */
2907var js_lang_pre_checked_surcharge_product = 'Predvolená služba';
2908var js_lang_no_surcharge_products_for_select = 'Neexistuje ďalšia doplnková služba. Vytvorte novú doplnkovú službu, aby ju bolo možné pridať.';
2909var js_lang_quantity_for_gift_surcharge_product = 'Množstvo pre získanie darčeka';
2910/* END priplatkove produkty */
2911
2912var js_lang_multiple_packages_1 = 'balenie';
2913var js_lang_multiple_packages_2 = 'balenia';
2914var js_lang_multiple_packages_3 = 'balení';
2915
2916var js_lang_pack4you_products_exported_success = 'Produkty boli úspešne exportované do Pack4You.';
2917var js_lang_pack4you_products_exported_error =  'Produkty sa nepod
2917arilo exportovať do Pack4You.';
2918
2919var js_lang_jvplusav_orders_exported_success =  'Objednávky boli úspešne exportované do jvplusav.';
2920
2921var js_lang_automatic_gifts_shipping_restricted_title = 'Darčeky boli odstránené z nákupného košíka';
2922var js_lang_automatic_gifts_shipping_restricted_message = 'Ospravedlňujeme sa, darčeky sa nevzťahujú na zvolený spôsob dopravy, ak si prajete darčeky vrátiť späť do košíka, prosím zvoľte iný spôsob dopravy.';
2923var js_lang_automatic_gifts_shipping_restricted_setting_placeholder = 'Zvoľte spôsoby dopravy';
2924
2925var js_lang_send_mass_email = 'Hromadný e-mail'
2926var js_lang_send_mass_email_text = 'Text'
2927var js_lang_send_mass_email_subject = 'Predmet'
2928
2929/* mod_package_tracking */
2930var js_lang_unable_to_identify_package = 'Zásielku nebolo možné identifikovať';
2931
2932var js_lang_measure_unit_pcs = 'ks';
2933var js_lang_product_store_availability_inline_title = 'Dostupnosť na predajniach';
2934var js_lang_product_store_availability_show_store_link_title = 'Zobraziť predajňu';
2935
2936var js_lang_save_all_changes = 'Uložiť všetky zmeny';
2937
2938var js_lang_coupon_list = 'Zoznam kupónov';
2939var js_lang_coupon_archive = 'Archív použitých kupónov';
2940
2941var js_lang_api_tmr = {
2942	childTooltip: {
2943		childNumRoom: 'Deti v %s. izbe',
2944		description: 'Na to, aby sme vám mohli nájsť ubytovanie s dostatočnou kapacitou pre celú vašu skupinu a so správnymi cenami, potrebujeme poznať vek detí v deň vášho odchodu z ubytovania',
2945		confirm: 'Potvrdiť výber',
2946		childAge: 'Vek %s. dieťaťa',
2947		defaultOption: 'Vyberte vek',
2948		selectAge: 'Zvoľte prosím vek',
2949		notConfirmed: 'Potvrďte prosím vek detí',
2950	},
2951	adultTooltip: {
2952		adultNumRoom: 'Dospelí v %s. izbe',
2953		description: '',
2954		confirm: 'Potvrdiť výber',
2955		notConfirmed: 'Potvrďte prosím počet dospelích',
2956	},
2957	date: {
2958		confirm: 'Potvrdiť',
2959		cancel: 'Zrušiť',
2960	},
2961	basketGift: {
2962		name: 'Meno',
2963		surname: 'Priezvisko',
2964		email: 'Email',
2965		phone: 'Telefón',
2966		confirm: 'Potvrdiť',
2967		cancel: 'Zrušiť',
2968		errors: {
2969			name: 'Prosím vyplňte meno',
2970			surname: 'Prosím vyplňte priezvisko',
2971			email: 'Nesprávny formát emailu',
2972			phone: 'Prosím vyplňte číslo',
2973		},
2974 	}
2975};
2976
2977var js_lang_api_ellipsecloud = {
2978	date: {
2979		confirm: 'Potvrdiť',
2980		cancel: 'Zrušiť',
2981	},
2982	errors: {
2983		selectDate: 'Prosím vyberte termín',
2984		noResults: 'Pre zvolený termín nie sú dostupné žiadne ponuky',
2985		fillRequired: 'Prosím vyplňte všetky povinné polia',
2986		bookingFailed: 'Rezervácia zlyhala, skúste to prosím znova',
2987		cancelFailed: 'Zrušenie rezervácie zlyhalo',
2988	},
2989	booking: {
2990		created: 'Rezervácia bola úspešne vytvorená',
2991		cancelled: 'Rezervácia bola zrušená',
2992	},
2993	minStay: 'Min. %s nocí',
2994};
2995
2996var js_lang_abandoned_cart = {
2997	email_sent: 'Email pre košík {cart_id} bol úspešne odoslaný',
2998	cart_archived: 'Košík {cart_id} bol archivovaný',
2999	converted_to_order: 'Košík {cart_id} bol skonvertovaný na objednávku',
3000	quick_template_label: 'Zabudnuté košíky',
3001	convert_error: 'Košík nemožno konvertovať na objednávku, pretože nie sú k dispozícii všetky požadované údaje',
3002	archive_confirm: 'Ste si istý, že chcete archivovať tento košík ({cart_id})?',
3003	archive_title: 'Potvrdenie archivácie košíka',
3004	convert_confirm: 'Ste si istý, že chcete konvertovať tento košík ({cart_id}) na objednávku?',
3005	convert_title: 'Potvrdenie vytvorenia objednávky',
3006	confirm: 'Potvrdiť',
3007	cancel: 'Zrušiť',
3008	activate: 'Naozaj si želáte aktivovať automatizáciu <b>"{name}"</b>?',
3009	deactivate: 'Naozaj si želáte deaktivovať automatizáciu <b>"{name}"</b>?',
3010	activateSuccess: 'Automatizácia "{name}" bola <b>aktivovaná</b>',
3011	deactivateSuccess: 'Automatizácia "{name}" bola <b>deaktivovaná</b>',
3012	selectTemplateError: 'Prosím, zvoľte šablónu',
3013	deleteAutomationsConfirm: 'Naozaj si želáte zmazať zvolenú automatizáciu?',
3014	deleteAutomationsConfirmMultiple: 'Naozaj si želáte zmazať zvolené automatizácie?',
3015	deleteAutomationsSuccess: 'Zvolené automatizácie boli úspešne zmazané',
3016	selectedCarts: 'Označené košíky',
3017	selectedFrom: 'z',
3018	quickTemplateReplacements: 'Automaticky vkladané premenné: <b>ADDR</b> - adresa zákazníka, <b>NAME</b> - meno zákazníka, <b>SURNAME</b> - priezvisko zákazníka, <b>TOTAL_PRICE</b> - suma košíku, <b>SHIPPING_PRICE</b> - cena za dopravu, <b>SHIPPING</b> - typ dopravy, <b>PAYMENT</b> - typ platby, <b>CART_LINK</b> - link na košík, <b>COUPON_CODE</b> - Kód kupónu',
3019};
3020
3021var js_lang_mass_category_change = {
3022	infoModal: {
3023		title: 'Hromadná zmena kategórií',
3024		selectedProducts: 'Označených produktov',
3025		updatedProducts: 'Aktualizovaných produktov',
3026		unchangedProducts: 'Nezmenených produktov',
3027		unchangedProductsList: 'Kódy nezmenených produktov',
3028		unchangedProductsInfo: 'Pokúšate sa vyradiť produkty z kategórií, ktoré sú zároveň nastavené ako ich primárne kategórie. Nezmeneným produktom odporúčame kategórie upraviť manuálne.',
3029		remainder: 'Po zatvorení okna sa stránka obnoví, prosím skopírujte si kódy nezmenených produktov a upravte ich manuálne.'
3030	}
3031};
3032
3033var js_lang_api_onix = {
3034	notifications: {
3035		exportedOrder: {
3036			title: 'Onix',
3037			msg: 'Vybrané objednávky boli exportované do Onix.'
3038		},
3039	},
3040};
3041
3042var js_lang_api_dpd = {
3043	orderExport: {
3044		parcel: {
3045			depth: 'Hĺbka',
3046			height: 'Výška',
3047			width: 'Šírka',
3048			weight: 'Váha',
3049			reference: 'Referencia'
3050		},
3051		tooltip: {
3052			codHover: 'Zmena tejto služby je možná iba zmenou typu dopravy v objednávke'
3053		}
3054	},
3055	dpdWidget: {
3056		defaultOption: 'Vybrat miesto',
3057		selectParcelShop: 'Prosím vyberte si odberné miesto',
3058	}
3059};
3060
3061var js_lang_recalculate_order_successful = 'Úspešný prepočet objednávky';
3062var js_lang_recalculate_order_failed = 'Neúspešný prepočet objednávky';
3063var js_lang_recalculate_order_alert = 'Tento úkon môže zmeniť sadzby DPH pre jednotlivé položky objednávky.<br>Želáte si napriek tomu prepočítať objednávku?';
3064
3065var js_lang_browse_images_label = 'Prehliadať obrázky';
3066
3067var js_lang_back_to_active_coupons = 'Späť na zoznam aktívnych kupónov';
3068
3069var js_lang_edit_label = 'Upraviť';
3070
3071var js_lang_not_found_orders_for_packeta_all = 'Systém nenašiel žiadne záznamy s vytvorenými objednávkami pre Packeta.';
3072var js_lang_not_found_orders_for_packeta_not_exported = 'Systém nenašiel žiadne doposiaľ nevyexportované záznamy pre Packeta.';
3073var js_lang_orders_for_packeta_check_and_export = 'Ak potrebujete exportovať konkrétne objednávky pre Packeta, označte ich a exportujte.';
3074
3075var js_lang_product_detail_delivery_date_tomorrow = 'zajtra';
3076var js_lang_product_detail_delivery_date_deliver_by_1 = 'Doručíme do';
3077var js_lang_product_detail_delivery_date_deliver_by_2 = 'Doručíme v';
3078
3079var js_lang_checkout_product_reservation = {
3080	modalTitle: 'Rezervácia produktov',
3081	modalContent: 'Opúšťate funkciu rezervácie. Prípadná zvýhodnená cena produktov bude prepočítaná späť na štandardnú cenu. Chcete pokračovať?',
3082	cancel: 'Zrušiť',
3083	confirm: 'Potvrdiť',
3084	fillModalMessage: 'Všetky produkty, ktoré boli predtým vložené do košíka budú odstránené a nahradené za produkty z rezervácie. Prajete si pokračovať?',
3085	leavingReservation: 'Úpravou množstva produktu v košíku sa zruší režim rezervácie a zvýhodnené ceny budú prepočítané na štandardné. Prajete si pokračovať?',
3086	filterDisable: 'Odstránenie filtra nie je možné, kým máte aktívnu ‘Moju predajňu’. Najskôr ju deaktivujte.',
3087	selectStore: 'Prosím, zvoľte predajňu',
3088};
3089
3090var js_lang_expected_delivery_tooltip = 'Odhadovaný dátum doručenia, ktorý sa môže zmeniť na základe aktuálnej vyťaženosti prepravcu.';
3091
3092var js_lang_checkout_vhl_map = 'Zvoľte odberné miesto';
3093var js_lang_checkout_wedo_map = 'Zvoľte odberné miesto';
3094var js_lang_checkout_balikovna_map = 'Zvoľte odberné miesto';
3095
3096var js_lang_checkout_sps_map_modal = {
3097	close: 'Zrušiť',
3098	confirm: 'Potvrdiť',
3099	name: 'Názov',
3100	address: 'Ulica',
3101	city: 'Mesto',
3102	dropoff: 'Podanie zásielky',
3103	openinghours: 'Otváracie hodiny',
3104	cod: 'Dobierka',
3105	yes: 'Áno',
3106	no: 'Nie',
3107};
3108
3109var js_lang_makro_custom_dealers = {
3110	accountIndex: {
3111		detail: {
3112			title: 'Informácie o zákazníkovi',
3113
3114			stredisko: 'Stredisko',
3115			varSymbol: 'Var. symbol',
3116			datVystavenia: 'Dátum vystavenia',
3117			datSplatnosti: 'Dátum splatnosti',
3118			hodnotaPohladavky: 'Hodnota pohľadávky',
3119			hodnotaUhrad: 'Hodnota úhrad',
3120			afterDueDate: 'Po splatnosti (v dňoch)',
3121		}
3122	}
3123};
3124
3125var js_lang_claims = {
3126	remove: {
3127		state: 'Naozaj si prajete vymazať tento stav reklamácií?',
3128		shipping: 'Naozaj si prajete vymazať tento spôsob dopravy reklamácií?',
3129		refund: 'Naozaj si prajete vymazať tento spôsob vybavenia reklamácií?',
3130		service: 'Naozaj si prajete vymazať tento typ opravy reklamácií?',
3131	}
3132};
3133
3134var js_lang_promotions = {
3135	modal: {
3136		deactivatePromotion: {
3137			title: 'Deaktivovať zľavovú akciu',
3138			msg: 'Naozaj si želáte deaktivovať zvolenu akciu "#_PROMOTION_NAME_#"?'
3139		},
3140		activePromotion: {
3141			title: 'Aktivovať zľavovú akciu',
3142			msg: 'Naozaj si želáte aktivovať zvolenu akciu "#_PROMOTION_NAME_#"?'
3143		}
3144	},
3145	notifications: {
3146		alreadySelectedProduct: {
3147			title: '',
3148			msg: 'Vami vybraný produkt už bol pridaný.'
3149		},
3150		alreadySelectedUser: {
3151			title: '',
3152			msg: 'Vami vybraný zákazník už bol pridaný.'
3153		},
3154		subscriptionNameRequired: {
3155			title: '',
3156			msg: 'Názov predplatného je povinný.'
3157		},
3158		subscriptionTypeRequired: {
3159			title: '',
3160			msg: 'Typ predplatného je povinný.'
3161		},
3162		subscriptionProductRequired: {
3163			title: '',
3164			msg: 'Vyberte produkt, ktorý bude s predplatným spojený.'
3165		},
3166		subscriptionSgpCantBeSame: {
3167			title: '',
3168			msg: 'Zákaznícka skupina nemôže byť rovnaké.'
3169		},
3170		subscriptionOrderStatusCantBeSame: {
3171			title: '',
3172			msg: 'Stav objednávky nemôže byť rovnaký.'
3173		},
3174		subscriptionValidityTooSmall: {
3175			title: '',
3176			msg: 'Minimálna platnosť predplatného je 1 deň.'
3177		},
3178	},
3179	autocomplete: {
3180		noResults: 'Žiadne výsledky'
3181	}
3182};
3183
3184var js_lang_document_system = {
3185	numbering: {
3186		options: {
3187			'': '- Vyberte možnosť -',
3188			'#_YEAR_4_#': 'Rok (4 čísla)',
3189			'#_YEAR_2_#': 'Rok (2 čísla)',
3190			'#_ORDER_ID_#': 'Číslo objednávky',
3191			'#_CONSTANT_#': 'Konstanta',
3192		}
3193	},
3194};
3195
3196var js_lang_we_are_hiring = `
3197  ______   _______   ________   ______  ________  ______  __     __  ________                  __    __
3198 /      \\ |       \\ |        \\ /      \\|        \\|      \\|  \\   |  \\|        \\                |  \\  |  \\
3199|  $$$$$$\\| $$$$$$$\\| $$$$$$$$|  $$$$$$\\\\$$$$$$$$ \\$$$$$$| $$   | $$| $$$$$$$$        _______  \\$$ _| $$_     ______    _______
3200| $$   \\$$| $$__| $$| $$__    | $$__| $$  | $$     | $$  | $$   | $$| $$__           /       \\|  \\|   $$ \\   /      \\  /       \\
3201| $$      | $$    $$| $$  \\   | $$    $$  | $$     | $$   \\$$\\ /  $$| $$  \\         |  $$$$$$$| $$ \\$$$$$$  |  $$$$$$\\|  $$$$$$$
3202| $$   __ | $$$$$$$\\| $$$$$   | $$$$$$$$  | $$     | $$    \\$$\\  $$ | $$$$$          \\$$    \\ | $$  | $$ __ | $$    $$ \\$$    \\
3203| $$__/  \\| $$  | $$| $$_____ | $$  | $$  | $$    _| $$_    \\$$ $$  | $$_____        _\\$$$$$$\\| $$  | $$|  \\| $$$$$$$$ _\\$$$$$$\\
3204 \\$$    $$| $$  | $$| $$     \\| $$  | $$  | $$   |   $$ \\    \\$$$   | $$     \\      |       $$| $$   \\$$  $$ \\$$     \\|       $$
3205  \\$$$$$$  \\$$   \\$$ \\$$$$$$$$ \\$$   \\$$   \\$$    \\$$$$$$     \\$     \\$$$$$$$$       \\$$$$$$$  \\$$    \\$$$$   \\$$$$$$$ \\$$$$$$$
3206
3207
3208Nechceš sa k nám pridať a vyvíjať lepší kód? Viac nájdeš na našej stránke https://www.creativesites.sk/kariera/
3209`;
3210
3211var js_lang_export_not_marked_orders = 'Neoznačili ste žiadne objednávky, preto sa pre export spracujú len doposiaľ nevyexportované. Pokračovať?';
3212var cms_appstore_cant_activate_prerequisite = 'Aktivácia aplikácie vyžaduje mať najskôr aktivovanú inú aplikáciu. Viac informácií nájdete v detaile aplikácie.';
3213var cms_appstore_cant_activate_relocate = 'Prejsť do aplikácie';
3214
3215var js_lang_client_credits = {
3216	standardCurrentBalance: 'Aktuálny zostatok štandardných kreditov',
3217	pnmVipCurrentBalance: 'Aktuálny zostatok PNM/VIP kreditov',
3218	guaranteedCredit: 'Garantovaný kredit',
3219	creditValidUntil: 'Platnosť kreditu do',
3220	currentBalance: 'Aktuálny zostatok kreditov',
3221};
3222
3223var js_lang_contact_form = {
3224	gdpr: "Musíte súhlasiť s podmienkami spracovania osobných údajov"
3225};
3226
3227var cms_js_lang_claim = 'Reklamácia';
3228var cms_js_lang_claim_send = 'Odoslať reklamáciu';
3229var cms_js_lang_article_faq_title = 'Správa FAQ';
3230var cms_js_lang_article_faq_add = 'Pridať otázku';
3231var cms_js_lang_article_faq_remove_title = 'Odstrániť';
3232var cms_js_lang_article_faq_save = 'Uložiť';
3233var cms_js_lang_article_faq_cancel = 'Zrušiť';
3234var cms_js_lang_article_faq_question = 'Otázka';
3235var cms_js_lang_article_faq_answer = 'Odpoveď';
3236
3237var js_lang_rotary_images_title = 'Rotačné obrázky';
3238var js_lang_rotary_images_err_1 = 'Pre typ obrázku "Filmový pás" je možné nahrať len jeden obrázok.';
3239var js_lang_rotary_images_err_2 = 'Počet nahraných obrázkov sa nezhoduje so zvoleným množstvom.';
3240
3241var js_lang_cms_app_activation_help_text = 'Priblížte nám, čo by Vás ohľadne funkcie zaujímalo.';
3242
3243var js_lang_months_names = {
3244	1: 'Január',
3245	2: 'Február',
3246	3: 'Marec',
3247	4: 'Apríl',
3248	5: 'Máj',
3249	6: 'Jún',
3250	7: 'Júl',
3251	8: 'August',
3252	9: 'September',
3253	10: 'Október',
3254	11: 'November',
3255	12: 'December'
3256};
3257
3258var js_lang_freeshipping_interval = {
3259	dates_must_be_different: 'Dátumy musia byť rozdielne',
3260	start_must_be_lower: 'Začiatok nemôže byť neskôr ako koniec',
3261};
3262
3263var js_lang_coupon_nth_percent_only_tooltip = 'Táto možnosť je dostupná iba pri type zľavy "%s".';
3264
3265var js_lang_new_taxrate_export_label = 'Export dát z faktúr';
3266var js_lang_new_taxrate_export_select = 'Zvoľte mesiac';
3267
3268var js_lang_product_settings_copy_title = 'Kopírovať vlastnosti produktu';
3269var js_lang_product_settings_copy_overwrite_title = 'Produkt už má nastavené niektoré z kopírovaných vlastností, želáte si ich prepísať?';
3270var js_lang_product_settings_copy_select_values = 'Prosím, vyberte hodnoty, ktoré chcete kopírovať.';
3271var js_lang_product_settings_copy_overwrite_button = 'Prepísať';
3272
3273var order_status_quick_templates = {
3274	'modalTitle': 'Správa textovýčh šablón',
3275	'templateSave': 'Uložiť',
3276	'templateAdd': 'Pridať',
3277	'templateCopy': 'Vytvoriť kópiu šablóny',
3278	'templateDelete': 'Zmazať šablónu',
3279	'templateCancel': 'Zrušiť',
3280	'templatePreview': 'Náhľad e-mailu',
3281	'templateSubject': 'Predmet emailu',
3282};
3283
3284var js_lang_app_1654_langs = {
3285	stores_tooltip: 'Povolené predajne na ktorých je možné rezervovať tovar.',
3286	price_tooltip: 'Zákaznícka skupina z ktorej sa použije cena pre rezerváciu produktu.',
3287	shipping_tooltip: 'Spôsob dopravy ktorý sa automaticky zvolí pri potvrdení rezervácie.',
3288	allow_tooltip: 'Povoliť alebo zakázať rezervácie produktov na e-shope.',
3289};
3290
3291const js_langs = {
3292	plugins: {
3293		chosen: {
3294			placeholder_text_multiple: 'Vyberte hodnoty',
3295			placeholder_text_single: 'Vyberte hodnotu',
3296			placeholder_text: 'Vyberte hodnotu',
3297			no_results_text: 'Žiadne výsledky pre',
3298			create_option_text: 'Vytvoriť hodnotu'
3299		},
3300	},
3301	frontend: {
3302		checkout: {
3303			errors: {
3304				subscriptionRequiredBeforeCheckout: 'Pred pokračovaním v nákupe je potrebné mať aktívné predplatné.',
3305				maximumPurchasedProductsForUserReached: 'Prekročili ste limit nákupu, ešte môžte nakúpiť v celkovom množstve #_VALID_PURCHASE_QUANTITY_#',
3306				maximumOrdersForUserReached: 'Prekročili ste limit objednávok, skúste to prosím neskôr.',
3307			}
3308		},
3309		shopBrowse: {
3310			luigi_search: {
3311				availability: {
3312					available: 'Skladom',
3313					notAvailable: 'Na objednávku',
3314				},
3315			},
3316		},
3317		nsu: {
3318			vouchers: {
3319				realization: {
3320					confirmVoucherRealizationTitle: 'Potvrdenie hromadnej realizácie',
3321					selectedVoucherCount: 'Počet označených poukazov:',
3322				}
3323			}
3324		},
3325	},
3326	admin: {
3327		orders: {
3328			coolbalik: {
3329				exportTitle: 'Export objednávok do Coolbalik',
3330				delivery_at: 'Doručiť v',
3331				address: 'Adresa',
3332				city: 'Mesto',
3333				zip: 'PSČ',
3334				country: 'Krajina',
3335				user_email: 'Email používateľa',
3336				phone_1: 'Telefón',
3337				first_name: 'Meno',
3338				last_name: 'Priezvisko',
3339			},
3340		},
3341		products: {
3342			bulkDiscount: {
3343				additionalDiscount: 'Dodatočná deliteľná zľava',
3344				every: 'každých',
3345				applyAdditionalDiscount: 'aplikovať dodatočnú zľavu',
3346				addAdditionalDiscount: 'Pridať dodatočnú deliteľnú zľavu'
3347			},
3348			productPrices: {
3349				errorList: {
3350					date: {
3351						title: "Neplatný dátum v záložke ‘Ceny od-do’.",
3352						content: 'Dátum od musí byť menší než dátum do.',
3353					},
3354					price: {
3355						title: 'Neplatná cena v záložke ‚Ceny od–do‘.',
3356						content: 'Cena nesmie byť nulová ani prázdna.',
3357					},
3358					oldPrice: {
3359						title: 'Neplatná bežná cena v záložke ‚Ceny od–do‘.',
3360						content: 'Bežná cena nesmie byť väčšia ako cena.',
3361					},
3362					sgpId: {
3363						title: 'Neplatná zákaznícka skupina v záložke ‚Ceny od–do‘.',
3364						content: 'Cena musí obsahovať priradenú zákaznícku skupinu.',
3365					},
3366					sgpPrice: {
3367						title: 'Neplatná cena pre zákaznícku skupinu v záložke ‚Ceny od–do‘.',
3368						content: 'Cena pre zákaznícku skupinu nesmie byť nulová ani prázdna.',
3369					},
3370					sgpOldPrice: {
3371						title: 'Neplatná bežná cena pre zákaznícku skupinu v záložke ‚Ceny od–do‘.',
3372						content: 'Bežná Cena pre zákaznícku skupinu nesmie byť väčšia ako cena.',
3373					},
3374				}
3375			},
3376		},
3377		users: {
3378			shopperGroupManage: {
3379				title: 'Úprava zákazníckych skupín',
3380				name: 'Názov skupiny',
3381				discount: '% zľava',
3382				credits: 'Zakázať využívanie kreditov',
3383				domain: 'Doména',
3384				emptyDomain: '- bez obmedzenia na doménu -',
3385				actions: {
3386					edit: 'Upraviť',
3387					delete: 'Zmazať',
3388					addNew: 'Pridať zak. skupinu',
3389					back: 'Späť',
3390					save: 'Uložiť',
3391				}
3392			},
3393			editPassword: {
3394				newPassword: 'Nové heslo',
3395				confirmPassword: 'Potvrdiť heslo'
3396			}
3397		},
3398		settings: {
3399			params: {
3400				import: {
3401					confirm: 'Chcete importovať parametre zo zvoleného súboru?',
3402					notification: {
3403						success: {
3404							title: 'Parametre importované',
3405							message: 'Importované parametre: #_IMPORTED_COUNT_#, aktualizované parametre: #_UPDATED_COUNT_#'
3406						}
3407					}
3408				}
3409			}
3410		}
3411	}
3412};
3413
3414var js_lang_save_product_admin_allow = {
3415	modalTitle: 'Potvrďte uloženie',
3416	missingCategory: 'Pokúšate sa produkt uložiť bez priradenej kategórie.<br>Nastavenie produktu bez priradenej kategórie, je vhodné pre špeciálne typy produktov - darčeky, doplnkové služby, zálohované obaly...<br><br>Prajete si produkt uložiť?'
3417};
3418
3419var js_lang_ssp_cms_order_eshop_unknown_error = 'Neznáma chyba';
3420
3421var js_lang_checkout_payment_avail_btn_yes = 'Súhlasím';
3422var js_lang_checkout_payment_avail_btn_no  = 'Naspäť';
3423var js_lang_checkout_payment_avail_msg = 'V krátkej dobe Vás budeme informovať o dostupnosti tovaru.';
3424var js_lang_webpay_payment_methods = 'Zvoľte platobné metódy';
3425
3426var js_lang_glossary_delete_term = 'Naozaj si prajete zmazať tento termín?';
3427
3428// Zensky rod: Objednávka,...
3429var js_lang_checker_F_deselect = 'Zrušiť výber';
3430var js_lang_checker_F_selected = 'Označené {plural1}:';
3431var js_lang_checker_F_selected_all = 'Máte označené všetky vyfiltrované {plural1}';
3432var js_lang_checker_F_selected_all_no_filter = 'Máte označené všetky {plural1}';
3433var js_lang_checker_F_selected_all_cur = 'Všetky {plural1} na stránke sú označené.';
3434var js_lang_checker_F_select_all = 'Označiť {plural1} na všetkých stranách';
3435var js_lang_checker_F_select_info = 'Info: ďalšiu %s {plural0} máte označenú na ostatných stranách.';
3436var js_lang_checker_F_select_info_plural = 'Info: ďalšie %s {plural1} máte označené na ostatných stranách.';
3437var js_lang_checker_F_select_info_plural_2 = 'Info: ďalších %s {plural2} máte označené na ostatných stranách.';
3438// Muzsky rod: Produkt, Článkok,...
3439var js_lang_checker_M_deselect = 'Zrušiť výber';
3440var js_lang_checker_M_selected = 'Označené {plural1}:';
3441var js_lang_checker_M_selected_all = 'Máte označené všetky vyfiltrované {plural1}';
3442var js_lang_checker_M_selected_all_no_filter = 'Máte označené všetky {plural1}';
3443var js_lang_checker_M_selected_all_cur = 'Všetky {plural1} na stránke sú označené.';
3444var js_lang_checker_M_select_all = 'Označiť {plural1} na všetkých stranách';
3445var js_lang_checker_M_select_info = 'Info: ďalší %s {plural0} máte označený na ostatných stranách.';
3446var js_lang_checker_M_select_info_plural = 'Info: ďalšie %s {plural1} máte označené na ostatných stranách.';
3447var js_lang_checker_M_select_info_plural_2 = 'Info: ďalších %s {plural2} máte označených na ostatných stranách.';
3448
3449var js_lang_admin_article_plurals = ['článok','články','článkov'];
3450
3451var js_lang_export_category_tree = {
3452	"title": "Export stromu kategorií",
3453	"cancel": "Zrušiť",
3454	"export": "Exportovať",
3455	"select_category": "Prosím, vyberte aspoň jednu kategóriu",
3456};
3457
3458var js_lang_redirects_301_domain_replace_modal_confirm = 'Potvrdiť';
3459var js_lang_redirects_301_domain_replace_modal_cancel = 'Zrušiť';
3460var js_lang_redirects_301_domain_replace_modal_title = 'Nahradenie domén v zdrojových URL';
3461
3462var js_lang_batch_code = 'Šarža';
3463var js_lang_batch_code_expiration = 'Expirácia';
3464
3465var js_lang_canny_vex_title = 'Váš názor tvorí budúcnosť';
3466
3467var js_lang_button_logout = 'Odhlásiť';
3468
3469var js_lang_app_1987_label_tooltip = 'Poukážka sa bude odosielať v samostatnom emaili nezávisle od emailu o zmene stavu objednávky.';
3470
3471var js_lang_helpdesk_reviews_please_rate = 'Prosím, vyplňte hodnotenie a odpoveď na otázku.';
3472
3473var js_product_reservation_system_langs = {
3474	noReservations: 'Nie sú k dispozícii žiadne rezervácie na spracovanie.',
3475	reservationManagement: 'Správa rezervácií',
3476	close: 'Zatvoriť',
3477	mandatoryFields: 'Povinné polia s hviezdičkou musia byť vyplnené.',
3478	completed: 'Rezervácia {id} bola označená ako dokončená.',
3479	cancelled: 'Rezervácia {id} bola označená ako zrušená.',
3480	deleted: 'Rezervácia {id} bola odstránená.',
3481	vexHeader: 'Ďakujeme za Vašu rezerváciu.',
3482	vexDetails: 'Detaily rezervácie boli zaslané na Váš e-mail',
3483	vexAlreadyReserved: 'Bohužial, tento produkt si v určenom dátume rezervoval niekto iný.',
3484	vexAlreadyReservedMsg: 'Poprosíme o vybratie nového termínu',
3485	vexError: 'Bohužial, pri rezervácií vznikla chyba.',
3486	vexErrorMsg: 'Vo vaších údajoch sú tieto chyby:',
3487	vexContactAdmin: 'Kontaktujte prosím administrátora stránky',
3488	changeStatusConfirm: 'Naozaj si želáte označiť rezerváciu produktu <b>{product}</b> používateľa <b>{email}</b> ako {status}?',
3489	changeStatusConfirmLang: {
3490		completed: 'dokončenú',
3491		canceled: 'zrušenú',
3492		deleted: 'Naozaj si želáte odstrániť rezerváciu produktu <b>{product}</b> používateľa <b>{email}</b>?',
3493	},
3494	changeStatus: 'Zmena stavu rezervácie',
3495	confirm: 'Potvrdiť',
3496	cancel: 'Zrušiť',
3497};
3498
3499var js_import_stock_movements_help_text_intro = [];
3500js_import_stock_movements_help_text_intro[0] = 'Inštrukcie';
3501js_import_stock_movements_help_text_intro['1a'] = '"Datum pohybu";"Druh pohybu";"Kod produktu/variantu";"Mnozstvo";"Cena";"Nazov dodavatela";"Dodavatelska faktura"';   //  "Dátum pohybu";"Druh pohybu";"Kód produktu/variantu";"Množstvo";"Cena";"Názov dodávateľa";"Dodávateľská faktúra"
3502js_import_stock_movements_help_text_intro['1_batch_code'] = ';"Sarza";"Expiracia"'; //  ;"Šarža";"Expirácia"
3503js_import_stock_movements_help_text_intro['1z'] = ';"Poznamka"';    //  ;"Poznámka"
3504js_import_stock_movements_help_text_intro['2a'] = 'Formát CSV súboru: <b>"Dátum pohybu";"Druh pohybu";"Kód produktu/variantu";"Množstvo";"Cena";"Názov dodávateľa";"Dodávateľská faktúra"</b>';
3505js_import_stock_movements_help_text_intro['2_batch_code'] = '<b>;"Šarža";"Expirácia"</b>';
3506js_import_stock_movements_help_text_intro['2z'] = '<b>;"Poznámka"</b>';
3507js_import_stock_movements_help_text_intro['3a'] = 'Popis položiek:<div style="margin-top:-8px;margin-left:15px">- Dátum pohybu (nepovinný údaj, pri prázdnej hodnote bude použitý aktuálny dátum, inak vo formátoch napr. "2030-11-23", "2030-11-23 12:30:00", "23.11.2030", "23.11.2030 12:30"),<br />- Druh pohybu (povinný údaj, hodnota "P" znamená "príjem", hodnota "IP" znamená "inventúrny príjem", hodnota "IV" znamená "inventúrny výdaj"),<br />- Kód produktu/variantu (povinný neprázdny údaj),<br />- Množstvo (povinný nenulový údaj),<br />- Cena (nepovinný údaj. Cena je s DPH pre platcu DPH, bez DPH pre neplatcu DPH),<br />- Názov dodávateľa (podľa názvu bude použitý existujúci alebo založený nový. Iba v prípade neinventúrneho príjmového pohybu),<br />- Dodávateľská faktúra (hodnota "1" znamená príznak existencie dod. fak. Iba v prípade neinventúrneho príjmového pohybu),';
3508js_import_stock_movements_help_text_intro['3_batch_code'] = '<br />- Šarža (nepovinný údaj. Funkčné len v prípade zapnutej a aktívnej evidencie šarží),<br />- Expirácia (nepovinný údaj, resp. povinný len pri zároveň vyplnenom údaji Šarža a príjmovom pohybe. Funkčné len v prípade zapnutej a aktívnej evidencie šarží),';
3509js_import_stock_movements_help_text_intro['3z'] = '<br />- Poznámka (nepovinný údaj),</div>';
3510js_import_stock_movements_help_text_intro[4] = 'V prípade otázok alebo nefunkčnosti importu nám napíšte e-mail, radi Vám pomôžeme.';
3511js_import_stock_movements_help_text_intro[5] = '<b>Vzorový súbor</b> CSV s pripravenou hlavičkou s názvami stĺpcov je možné stiahnuť kliknutím na tento <a href="SampleCsvLinkData" download="import_stock_movements.csv">odkaz</a>.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Po stiahnutí a otvorení súboru napr. v aplikácii Excel alebo Open Office môžete do súboru naplniť riadky s údajmi.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Údaje pre jednotlivé stĺpce vyplňte na základe popisu položiek vyššie.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Po uložení je súbor pripravený na nahratie do e-shopu a importovanie údajov.';
3512
3513var js_lang_gun_number_label = 'Číslo zbrane:';
3514var js_lang_gun_number_saved = 'Číslo zbrane bolo uložené.';
3515var js_lang_prefilled_best_price_message = 'Vedeli by ste mi dorovnať cenu na [kód produktu] [názov produktu]?\nNa [aktuálna doména] je cena [cena s DPH] a na tomto odkaze: ... je cena: ... [CURRENCY]\n\nAlebo máte záujem o individuálnu cenovú ponuku pre [kód produktu] [názov produktu]?';
3516var js_lang_template_product_ean_title = 'EAN kód:';
3517var js_lang_product_image = "Obrázok";
3518var js_lang_product_other_images = "Ostatné obr.";
3519var js_lang_product_weight = "Hmotnosť";
3520var js_lang_product_available_from = "K dispozícii od";
3521var js_lang_product_select = "- vyberte -";
3522
3523var js_lang_shipping_rate_ranges_disabled_warning = 'Hodnota sa nedá meniť, pretože máte zapnuté viacnásobné rozsahy pre toto pole. Hodnoty nastavte v príslušných pod-rozsahoch.';
3524
3525var js_lang_api_stripe = {
3526	unexpected_error: 'Vyskytla sa neočakávaná chyba.',
3527};
3528
3529var js_lang_kikaapi_confirm = "Naozaj chcete synchronizovať produkty z e-shopu do KikaAPI?";
3530
3531var js_lang_load_capacity_calculator = {
3532	'top_content': 'Rozdiel medzi testovanými podmienkami a reálnymi podmienkami zohľadňuje bezpečnostný faktor. Hodnotu bezpečnostného faktora môže stanoviť len osoba (konštruktér), ktorá pozná pracovné podmienky koliesok ako aj príslušné STN. Poradenstvo firmy RENOST môže len odporučiť výšku faktoru podľa dostupných informácií, bez záruky.',
3533	'formula_title': 'Požadovaná nosnosť sa stanoví nasledovne',
3534	'calculation_title': 'Výpočet',
3535	'v_label': 'Vlastná hmotnosť transportného zariadenia',
3536	'o_label': 'Maximálna hmotnosť nákladu',
3537	'n_label': 'Počet použitých rolovacích koliesok a kolies',
3538	'beta_label': 'Bezpečnostný faktor',
3539	'result_label': 'Nosnosť',
3540	'safety_title': 'Bezpečnostný faktor',
3541	'safety_content': 'Stanovuje odchýlky normalizovaných podmienok (STN EN 12 527, 12 532) od reálnych, ktoré zahŕňajú povrch podlahy, rýchlosť zariadenia, výšku prahov, sklon spádov, rovnomernosť rozloženia zaťaženia, smer pohybu rolovacieho kolieska a kolesa, teplotu (+15 °C až +28 °C).',
3542	'safety_factor_list_1': 'ručná manipulácia v štandardných podmienkach, rovná liata podlaha',
3543	'safety_factor_list_2': 'zhoršené podmienky, nerovnosti, výjazdy, častá manipulácia',
3544	'safety_factor_list_3': 'ťažné stroje, nepretržitá prevádzka, náročné podmienky',
3545	'safety_factor_list_3_more': 'a viac',
3546	'modal_title': 'Výpočet požadovanej nosnosti',
3547};
3548
3549var js_lang_sudo_slider_accesibility = {
3550	'prev_label': 'Prepnúť na stránku',
3551	'next_label': 'Prepnúť na stránku',
3552	'status_label': 'Zobrazená stránka',
3553	'from': 'z',
3554	'prev_html_text': 'predchádzajúca stránka',
3555	'next_html_text': 'následujúca stránka',
3556	'button_for_switching_pages': 'Tlačidlá na prepínanie stránok',
3557};
3558
3559var js_product_detail_availability_modal = {
3560	'pieces': 'ks',
3561	'in_stock': 'Skladom',
3562	'immediately': 'ihneď',
3563	'immediately_tooltip': 'Pri objednaní do 13:00 expedujeme v ten istý deň.',
3564	'in_stock_parts': 'Skladom v dielcoch',
3565	'parts_availability': '2-3 dni',
3566	'parts_availability_tooltip': 'Potrebná montáž, expedujeme do 2 až 3 dní.',
3567	'no_stock_availability': 'Výroba 8-14 dní',
3568	'status': 'Stav',
3569	'number_of_units': 'Počet jednotiek',
3570	'expedition_date': 'Termín expedície',
3571	'modal_title': 'Dostupnosť',
3572	'contact_text_empty': 'Pre informáciu o množstve a termíne dodania, <a href="{contactLink}" target="_blank">nás prosím kontaktujte.</a>',
3573	'contact_text': 'Pre preverenie dostupnosti pre väčšie množstvo, ako máme momentálne skladom <a href="{contactLink}" target="_blank">nás prosím kontaktujte</a>.'
3574};
3575
3576var js_lang_product_detail_availability_table = {
3577	store_head: 'Predajňa',
3578	availability_head: 'Možnosť doručenia do predajne',
3579	displayed_head: 'Vystavené v predajni',
3580};
3581
3582var js_lang_unfinished_purchase_modal_title = 'Nedokončili ste svoj nákup';
3583var js_lang_unfinished_purchase_modal_text = 'Skutočne chcete opustiť košík?';
3584var js_lang_unfinished_purchase_modal_btn_continue_order = 'Pokračovať v objednávke';
3585var js_lang_unfinished_purchase_modal_btn_continue_shopping = 'Pokračovať v nakupovaní';
3586
3587var js_lang_product_add_to_wishlist_aria_label = 'Odobrať :product_name z wishlistu';
3588
3589var js_global_wcag = {
3590	'sliderPrevButton' : 'Predchádzajúca stránka',
3591	'sliderNextButton' : 'Nasledujúca stránka',
3592	'sliderStatus' : 'Zmenila sa stránka karuselu.',
3593	'sliderDotLabel' : 'Prejsť na stránku {index}',
3594	'sortButtonsGroup' : 'Tlačidlové zobrazenie pre radenie produktov',
3595};
3596
3597
3598/* ========================================
3599 FILE: /includes/js/state-management-lib/state.min.js
3600 ==================== */
3601
3602var initState=function(){function a(b){var c=Object.getOwnPropertyNames(b);return c.map(function(c){if(b.hasOwnProperty(c)){var d=b[c];d&&"object"==typeof d&&a(d)}}),Object.freeze(b)}function b(a){return"object"==typeof a?Object.assign({},a):{}}function c(b){return function(c){var d=Object.assign({},b);return"string"==typeof c?"undefined"==typeof d[c]?null:a(d[c]):a(d)}}function d(a,b){return function(c,d){"string"!=typeof c||(b("stateWillChange",{key:c,value:d}),a[c]=d,b("stateDidChange",{key:c,value:d}))}}function e(a,b){return function(c,d,e){return Array.isArray(e)||(e=[]),a[c]=a[c]||[],a[c].push({listener:d,dependencies:e,once:b}),this}}function f(a){return function(b,c){return a[b]||a[b].length?c?(a[b]=a[b].filter(function(a){return a.listener!==c}),this):(delete a[b],this):this}}function g(a){return function(b,c){return a[b]&&a[b].length?(a[b]=a[b].filter(function(a){return a.dependencies.length&&(c=c||{},-1===a.dependencies.indexOf(c.key))?this:(a.listener(c),!a.once)}),this):this}}return"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(a){if(null==a)throw new TypeError("Cannot convert undefined or null to object");for(var b,c=Object(a),d=1;d<arguments.length;d++)if(b=arguments[d],null!=b)for(var e in b)Object.prototype.hasOwnProperty.call(b,e)&&(c[e]=b[e]);return c},writable:!0,configurable:!0}),function(a){var h=b(a),i={};return{getState:c(h),setState:d(h,g(i)),once:e(i,!0),on:e(i,!1),off:f(i),trigger:g(i)}}}();
3603
3604/* ========================================
3605 FILE: /includes/js/state-management-lib/globalState.min.js
3606 ==================== */
3607
3608var globalState=initState();
3609
3610/* ========================================
3611 FILE: /includes/js/jquery/core/jquery-3.7.1.min.js
3612 ==================== */
3613
vendor: 87,533 bytes, lines 3614-3615
3614/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */
3615!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function fe(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}ce.fn=ce.prototype={jquery:t,constructor:ce,length:0,toArray:function(){return ae.call(this)},get:function(e){return null==e?ae.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ce.each(this,e)},map:function(n){return this.pushStack(ce.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(ce.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(ce.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:oe.sort,splice:oe.splice},ce.extend=ce.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(ce.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||ce.isPlainObject(n)?n:{},i=!1,a[t]=ce.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},ce.extend({expando:"jQuery"+(t+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==i.call(e))&&(!(t=r(e))||"function"==typeof(n=ue.call(t,"constructor")&&t.constructor)&&o.call(n)===a)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(c(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)while(t=e[r++])n+=ce.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(c(Object(e))?ce.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:se.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!l.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(c(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:le}),"function"==typeof Symbol&&(ce.fn[Symbol.iterator]=oe[Symbol.iterator]),ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var pe=oe.pop,de=oe.sort,he=oe.splice,ge="[\\x20\\t\\r\\n\\f]",ve=new RegExp("^"+ge+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ge+"+$","g");ce.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var f=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function p(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}ce.escapeSelector=function(e){return(e+"").replace(f,p)};var ye=C,me=s;!function(){var e,b,w,o,a,T,r,C,d,i,k=me,S=ce.expando,E=0,n=0,s=W(),c=W(),u=W(),h=W(),l=function(e,t){return e===t&&(a=!0),0},f="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",t="(?:\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",p="\\["+ge+"*("+t+")(?:"+ge+"*([*^$|!~]?=)"+ge+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+t+"))|)"+ge+"*\\]",g=":("+t+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+p+")*)|.*)\\)|)",v=new RegExp(ge+"+","g"),y=new RegExp("^"+ge+"*,"+ge+"*"),m=new RegExp("^"+ge+"*([>+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="<a id='"+S+"' href='' disabled='disabled'></a><select id='"+S+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0<I(t,T,null,[e]).length},I.contains=function(e,t){return(e.ownerDocument||e)!=T&&V(e),ce.contains(e,t)},I.attr=function(e,t){(e.ownerDocument||e)!=T&&V(e);var n=b.attrHandle[t.toLowerCase()],r=n&&ue.call(b.attrHandle,t.toLowerCase())?n(e,t,!C):void 0;return void 0!==r?r:e.getAttribute(t)},I.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ce.uniqueSort=function(e){var t,n=[],r=0,i=0;if(a=!le.sortStable,o=!le.sortStable&&ae.call(e,0),de.call(e,l),a){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)he.call(e,n[r],1)}return o=null,e},ce.fn.uniqueSort=function(){return this.pushStack(ce.uniqueSort(ae.apply(this)))},(b=ce.expr={cacheLength:50,createPseudo:F,match:D,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(v," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(d,e,t,h,g){var v="nth"!==d.slice(0,3),y="last"!==d.slice(-4),m="of-type"===e;return 1===h&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u=v!==y?"nextSibling":"previousSibling",l=e.parentNode,c=m&&e.nodeName.toLowerCase(),f=!n&&!m,p=!1;if(l){if(v){while(u){o=e;while(o=o[u])if(m?fe(o,c):1===o.nodeType)return!1;s=u="only"===d&&!s&&"nextSibling"}return!0}if(s=[y?l.firstChild:l.lastChild],y&&f){p=(a=(r=(i=l[S]||(l[S]={}))[d]||[])[0]===E&&r[1])&&r[2],o=a&&l.childNodes[a];while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if(1===o.nodeType&&++p&&o===e){i[d]=[E,a,p];break}}else if(f&&(p=a=(r=(i=e[S]||(e[S]={}))[d]||[])[0]===E&&r[1]),!1===p)while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if((m?fe(o,c):1===o.nodeType)&&++p&&(f&&((i=o[S]||(o[S]={}))[d]=[E,p]),o===e))break;return(p-=g)===h||p%h==0&&0<=p/h}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||I.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?F(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=se.call(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:F(function(e){var r=[],i=[],s=ne(e.replace(ve,"$1"));return s[S]?F(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:F(function(t){return function(e){return 0<I(t,e).length}}),contains:F(function(t){return t=t.replace(O,P),function(e){return-1<(e.textContent||ce.text(e)).indexOf(t)}}),lang:F(function(n){return A.test(n||"")||I.error("unsupported lang: "+n),n=n.replace(O,P).toLowerCase(),function(e){var t;do{if(t=C?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=ie.location&&ie.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===r},focus:function(e){return e===function(){try{return T.activeElement}catch(e){}}()&&T.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:z(!1),disabled:z(!0),checked:function(e){return fe(e,"input")&&!!e.checked||fe(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return q.test(e.nodeName)},input:function(e){return N.test(e.nodeName)},button:function(e){return fe(e,"input")&&"button"===e.type||fe(e,"button")},text:function(e){var t;return fe(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:X(function(){return[0]}),last:X(function(e,t){return[t-1]}),eq:X(function(e,t,n){return[n<0?n+t:n]}),even:X(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:X(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:X(function(e,t,n){var r;for(r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:X(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=B(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=_(e);function G(){}function Y(e,t){var n,r,i,o,a,s,u,l=c[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=y.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=m.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(ve," ")}),a=a.slice(n.length)),b.filter)!(r=D[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?I.error(e):c(e,s).slice(0)}function Q(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function J(a,e,t){var s=e.dir,u=e.next,l=u||s,c=t&&"parentNode"===l,f=n++;return e.first?function(e,t,n){while(e=e[s])if(1===e.nodeType||c)return a(e,t,n);return!1}:function(e,t,n){var r,i,o=[E,f];if(n){while(e=e[s])if((1===e.nodeType||c)&&a(e,t,n))return!0}else while(e=e[s])if(1===e.nodeType||c)if(i=e[S]||(e[S]={}),u&&fe(e,u))e=e[s]||e;else{if((r=i[l])&&r[0]===E&&r[1]===f)return o[2]=r[2];if((i[l]=o)[2]=a(e,t,n))return!0}return!1}}function K(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Z(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function ee(d,h,g,v,y,e){return v&&!v[S]&&(v=ee(v)),y&&!y[S]&&(y=ee(y,e)),F(function(e,t,n,r){var i,o,a,s,u=[],l=[],c=t.length,f=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)I(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),p=!d||!e&&h?f:Z(f,u,d,n,r);if(g?g(p,s=y||(e?d:c||v)?[]:t,n,r):s=p,v){i=Z(s,l),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(s[l[o]]=!(p[l[o]]=a))}if(e){if(y||d){if(y){i=[],o=s.length;while(o--)(a=s[o])&&i.push(p[o]=a);y(null,s=[],i,r)}o=s.length;while(o--)(a=s[o])&&-1<(i=y?se.call(e,a):u[o])&&(e[i]=!(t[i]=a))}}else s=Z(s===t?s.splice(c,s.length):s),y?y(null,t,s,r):k.apply(t,s)})}function te(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=J(function(e){return e===i},a,!0),l=J(function(e){return-1<se.call(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!=w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[J(K(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return ee(1<s&&K(c),1<s&&Q(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ve,"$1"),t,s<n&&te(e.slice(s,n)),n<r&&te(e=e.slice(n)),n<r&&Q(e))}c.push(t)}return K(c)}function ne(e,t){var n,v,y,m,x,r,i=[],o=[],a=u[e+" "];if(!a){t||(t=Y(e)),n=t.length;while(n--)(a=te(t[n]))[S]?i.push(a):o.push(a);(a=u(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=E+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==T||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==T||(V(o),n=!C);while(s=v[a++])if(s(o,t||T,n)){k.call(r,o);break}i&&(E=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=pe.call(r));f=Z(f)}k.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&ce.uniqueSort(r)}return i&&(E=h,w=p),c},m?F(r):r))).selector=e}return a}function re(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&Y(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&C&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(O,P),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=D.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(O,P),H.test(o[0].type)&&U(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&Q(o)))return k.apply(n,r),n;break}}}return(l||ne(e,c))(r,t,!C,n,!t||H.test(e)&&U(t.parentNode)||t),n}G.prototype=b.filters=b.pseudos,b.setFilters=new G,le.sortStable=S.split("").sort(l).join("")===S,V(),le.sortDetached=$(function(e){return 1&e.compareDocumentPosition(T.createElement("fieldset"))}),ce.find=I,ce.expr[":"]=ce.expr.pseudos,ce.unique=ce.uniqueSort,I.compile=ne,I.select=re,I.setDocument=V,I.tokenize=Y,I.escape=ce.escapeSelector,I.getText=ce.text,I.isXML=ce.isXMLDoc,I.selectors=ce.expr,I.support=ce.support,I.uniqueSort=ce.uniqueSort}();var d=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&ce(e).is(n))break;r.push(e)}return r},h=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},b=ce.expr.match.needsContext,w=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1<se.call(n,e)!==r}):ce.filter(n,e,r)}ce.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ce.find.matchesSelector(r,e)?[r]:[]:ce.find.matches(e,ce.grep(t,function(e){return 1===e.nodeType}))},ce.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(ce(e).filter(function(){for(t=0;t<r;t++)if(ce.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)ce.find(e,i[t],n);return 1<r?ce.uniqueSort(n):n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?ce(e):e||[],!1).length}});var k,S=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(ce.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&ce(e);if(!b.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&ce.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?ce.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?se.call(ce(e),this[0]):se.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ce.uniqueSort(ce.merge(this.get(),ce(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ce.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return d(e,"parentNode")},parentsUntil:function(e,t,n){return d(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return d(e,"nextSibling")},prevAll:function(e){return d(e,"previousSibling")},nextUntil:function(e,t,n){return d(e,"nextSibling",n)},prevUntil:function(e,t,n){return d(e,"previousSibling",n)},siblings:function(e){return h((e.parentNode||{}).firstChild,e)},children:function(e){return h(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(fe(e,"template")&&(e=e.content||e),ce.merge([],e.childNodes))}},function(r,i){ce.fn[r]=function(e,t){var n=ce.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=ce.filter(t,n)),1<this.length&&(j[r]||ce.uniqueSort(n),E.test(r)&&n.reverse()),this.pushStack(n)}});var D=/[^\x20\t\r\n\f]+/g;function N(e){return e}function q(e){throw e}function L(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}ce.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},ce.each(e.match(D)||[],function(e,t){n[t]=!0}),n):ce.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){ce.each(e,function(e,t){v(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==x(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return ce.each(arguments,function(e,t){var n;while(-1<(n=ce.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<ce.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},ce.extend({Deferred:function(e){var o=[["notify","progress",ce.Callbacks("memory"),ce.Callbacks("memory"),2],["resolve","done",ce.Callbacks("once memory"),ce.Callbacks("once memory"),0,"resolved"],["reject","fail",ce.Callbacks("once memory"),ce.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return ce.Deferred(function(r){ce.each(o,function(e,t){var n=v(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&v(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,v(t)?s?t.call(e,l(u,o,N,s),l(u,o,q,s)):(u++,t.call(e,l(u,o,N,s),l(u,o,q,s),l(u,o,N,o.notifyWith))):(a!==N&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){ce.Deferred.exceptionHook&&ce.Deferred.exceptionHook(e,t.error),u<=i+1&&(a!==q&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(ce.Deferred.getErrorHook?t.error=ce.Deferred.getErrorHook():ce.Deferred.getStackHook&&(t.error=ce.Deferred.getStackHook()),ie.setTimeout(t))}}return ce.Deferred(function(e){o[0][3].add(l(0,e,v(r)?r:N,e.notifyWith)),o[1][3].add(l(0,e,v(t)?t:N)),o[2][3].add(l(0,e,v(n)?n:q))}).promise()},promise:function(e){return null!=e?ce.extend(e,a):a}},s={};return ce.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=ae.call(arguments),o=ce.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?ae.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(L(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||v(i[t]&&i[t].then)))return o.then();while(t--)L(i[t],a(t),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ce.Deferred.exceptionHook=function(e,t){ie.console&&ie.console.warn&&e&&H.test(e.name)&&ie.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},ce.readyException=function(e){ie.setTimeout(function(){throw e})};var O=ce.Deferred();function P(){C.removeEventListener("DOMContentLoaded",P),ie.removeEventListener("load",P),ce.ready()}ce.fn.ready=function(e){return O.then(e)["catch"](function(e){ce.readyException(e)}),this},ce.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ce.readyWait:ce.isReady)||(ce.isReady=!0)!==e&&0<--ce.readyWait||O.resolveWith(C,[ce])}}),ce.ready.then=O.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?ie.setTimeout(ce.ready):(C.addEventListener("DOMContentLoaded",P),ie.addEventListener("load",P));var M=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)M(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(ce(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},R=/^-ms-/,I=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function F(e){return e.replace(R,"ms-").replace(I,W)}var $=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function B(){this.expando=ce.expando+B.uid++}B.uid=1,B.prototype={cache:function(e){var t=e[this.expando];return t||(t={},$(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[F(t)]=n;else for(r in t)i[F(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][F(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(F):(t=F(t))in r?[t]:t.match(D)||[]).length;while(n--)delete r[t[n]]}(void 0===t||ce.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!ce.isEmptyObject(t)}};var _=new B,z=new B,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,U=/[A-Z]/g;function V(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(U,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:X.test(i)?JSON.parse(i):i)}catch(e){}z.set(e,t,n)}else n=void 0;return n}ce.extend({hasData:function(e){return z.hasData(e)||_.hasData(e)},data:function(e,t,n){return z.access(e,t,n)},removeData:function(e,t){z.remove(e,t)},_data:function(e,t,n){return _.access(e,t,n)},_removeData:function(e,t){_.remove(e,t)}}),ce.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=z.get(o),1===o.nodeType&&!_.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=F(r.slice(5)),V(o,r,i[r]));_.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){z.set(this,n)}):M(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=z.get(o,n))?t:void 0!==(t=V(o,n))?t:void 0;this.each(function(){z.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){z.remove(this,e)})}}),ce.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=_.get(e,t),n&&(!r||Array.isArray(n)?r=_.access(e,t,ce.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ce.queue(e,t),r=n.length,i=n.shift(),o=ce._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){ce.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return _.get(e,n)||_.access(e,n,{empty:ce.Callbacks("once memory").add(function(){_.remove(e,[t+"queue",n])})})}}),ce.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?ce.queue(this[0],t):void 0===n?this:this.each(function(){var e=ce.queue(this,t,n);ce._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&ce.dequeue(this,t)})},dequeue:function(e){return this.each(function(){ce.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ce.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=_.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var G=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Y=new RegExp("^(?:([+-])=|)("+G+")([a-z%]*)$","i"),Q=["Top","Right","Bottom","Left"],J=C.documentElement,K=function(e){return ce.contains(e.ownerDocument,e)},Z={composed:!0};J.getRootNode&&(K=function(e){return ce.contains(e.ownerDocument,e)||e.getRootNode(Z)===e.ownerDocument});var ee=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&K(e)&&"none"===ce.css(e,"display")};function te(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return ce.css(e,t,"")},u=s(),l=n&&n[3]||(ce.cssNumber[t]?"":"px"),c=e.nodeType&&(ce.cssNumber[t]||"px"!==l&&+u)&&Y.exec(ce.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)ce.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,ce.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ne={};function re(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=_.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ee(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ne[s])||(o=a.body.appendChild(a.createElement(s)),u=ce.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ne[s]=u)))):"none"!==n&&(l[c]="none",_.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}ce.fn.extend({show:function(){return re(this,!0)},hide:function(){return re(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ee(this)?ce(this).show():ce(this).hide()})}});var xe,be,we=/^(?:checkbox|radio)$/i,Te=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="<textarea>x</textarea>",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="<option></option>",le.option=!!xe.lastChild;var ke={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n<r;n++)_.set(e[n],"globalEval",!t||_.get(t[n],"globalEval"))}ke.tbody=ke.tfoot=ke.colgroup=ke.caption=ke.thead,ke.th=ke.td,le.option||(ke.optgroup=ke.option=[1,"<select multiple='multiple'>","</select>"]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))ce.merge(p,o.nodeType?[o]:o);else if(je.test(o)){a=a||f.appendChild(t.createElement("div")),s=(Te.exec(o)||["",""])[1].toLowerCase(),u=ke[s]||ke._default,a.innerHTML=u[1]+ce.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;ce.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<ce.inArray(o,r))i&&i.push(o);else if(l=K(o),a=Se(f.appendChild(o),"script"),l&&Ee(a),n){c=0;while(o=a[c++])Ce.test(o.type||"")&&n.push(o)}return f}var De=/^([^.]*)(?:\.(.+)|)/;function Ne(){return!0}function qe(){return!1}function Le(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Le(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=qe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return ce().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=ce.guid++)),e.each(function(){ce.event.add(this,t,i,r,n)})}function He(e,r,t){t?(_.set(e,r,!1),ce.event.add(e,r,{namespace:!1,handler:function(e){var t,n=_.get(this,r);if(1&e.isTrigger&&this[r]){if(n)(ce.event.special[r]||{}).delegateType&&e.stopPropagation();else if(n=ae.call(arguments),_.set(this,r,n),this[r](),t=_.get(this,r),_.set(this,r,!1),n!==t)return e.stopImmediatePropagation(),e.preventDefault(),t}else n&&(_.set(this,r,ce.event.trigger(n[0],n.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ne)}})):void 0===_.get(e,r)&&ce.event.add(e,r,Ne)}ce.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.get(t);if($(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&ce.find.matchesSelector(J,i),n.guid||(n.guid=ce.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof ce&&ce.event.triggered!==e.type?ce.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(D)||[""]).length;while(l--)d=g=(s=De.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=ce.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=ce.event.special[d]||{},c=ce.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ce.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),ce.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.hasData(e)&&_.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(D)||[""]).length;while(l--)if(d=g=(s=De.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=ce.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||ce.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)ce.event.remove(e,d+t[l],n,r,!0);ce.isEmptyObject(u)&&_.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=ce.event.fix(e),l=(_.get(this,"events")||Object.create(null))[u.type]||[],c=ce.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=ce.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((ce.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<ce(i,this).index(l):ce.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(ce.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[ce.expando]?e:new ce.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click",!0),!1},trigger:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click"),!0},_default:function(e){var t=e.target;return we.test(t.type)&&t.click&&fe(t,"input")&&_.get(t,"click")||fe(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},ce.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},ce.Event=function(e,t){if(!(this instanceof ce.Event))return new ce.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ne:qe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&ce.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[ce.expando]=!0},ce.Event.prototype={constructor:ce.Event,isDefaultPrevented:qe,isPropagationStopped:qe,isImmediatePropagationStopped:qe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ne,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ne,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ne,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},ce.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},ce.event.addProp),ce.each({focus:"focusin",blur:"focusout"},function(r,i){function o(e){if(C.documentMode){var t=_.get(this,"handle"),n=ce.event.fix(e);n.type="focusin"===e.type?"focus":"blur",n.isSimulated=!0,t(e),n.target===n.currentTarget&&t(n)}else ce.event.simulate(i,e.target,ce.event.fix(e))}ce.event.special[r]={setup:function(){var e;if(He(this,r,!0),!C.documentMode)return!1;(e=_.get(this,i))||this.addEventListener(i,o),_.set(this,i,(e||0)+1)},trigger:function(){return He(this,r),!0},teardown:function(){var e;if(!C.documentMode)return!1;(e=_.get(this,i)-1)?_.set(this,i,e):(this.removeEventListener(i,o),_.remove(this,i))},_default:function(e){return _.get(e.target,r)},delegateType:i},ce.event.special[i]={setup:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i);n||(C.documentMode?this.addEventListener(i,o):e.addEventListener(r,o,!0)),_.set(t,i,(n||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i)-1;n?_.set(t,i,n):(C.documentMode?this.removeEventListener(i,o):e.removeEventListener(r,o,!0),_.remove(t,i))}}}),ce.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){ce.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||ce.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),ce.fn.extend({on:function(e,t,n,r){return Le(this,e,t,n,r)},one:function(e,t,n,r){return Le(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ce(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=qe),this.each(function(){ce.event.remove(this,e,n,t)})}});var Oe=/<script|<style|<link/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,Me=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)ce.event.add(t,i,s[i][n]);z.hasData(e)&&(o=z.access(e),a=ce.extend({},o),z.set(t,a))}}function $e(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=v(d);if(h||1<f&&"string"==typeof d&&!le.checkClone&&Pe.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),$e(t,r,i,o)});if(f&&(t=(e=Ae(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=ce.map(Se(e,"script"),Ie)).length;c<f;c++)u=e,c!==p&&(u=ce.clone(u,!0,!0),s&&ce.merge(a,Se(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,ce.map(a,We),c=0;c<s;c++)u=a[c],Ce.test(u.type||"")&&!_.access(u,"globalEval")&&ce.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?ce._evalUrl&&!u.noModule&&ce._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):m(u.textContent.replace(Me,""),u,l))}return n}function Be(e,t,n){for(var r,i=t?ce.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||ce.cleanData(Se(r)),r.parentNode&&(n&&K(r)&&Ee(Se(r,"script")),r.parentNode.removeChild(r));return e}ce.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=K(e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ce.isXMLDoc(e)))for(a=Se(c),r=0,i=(o=Se(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&we.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||Se(e),a=a||Se(c),r=0,i=o.length;r<i;r++)Fe(o[r],a[r]);else Fe(e,c);return 0<(a=Se(c,"script")).length&&Ee(a,!f&&Se(e,"script")),c},cleanData:function(e){for(var t,n,r,i=ce.event.special,o=0;void 0!==(n=e[o]);o++)if($(n)){if(t=n[_.expando]){if(t.events)for(r in t.events)i[r]?ce.event.remove(n,r):ce.removeEvent(n,r,t.handle);n[_.expando]=void 0}n[z.expando]&&(n[z.expando]=void 0)}}}),ce.fn.extend({detach:function(e){return Be(this,e,!0)},remove:function(e){return Be(this,e)},text:function(e){return M(this,function(e){return void 0===e?ce.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return $e(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Re(this,e).appendChild(e)})},prepend:function(){return $e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Re(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ce.cleanData(Se(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ce.clone(this,e,t)})},html:function(e){return M(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Oe.test(e)&&!ke[(Te.exec(e)||["",""])[1].toLowerCase()]){e=ce.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(ce.cleanData(Se(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return $e(this,arguments,function(e){var t=this.parentNode;ce.inArray(this,n)<0&&(ce.cleanData(Se(this)),t&&t.replaceChild(e,this))},n)}}),ce.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){ce.fn[e]=function(e){for(var t,n=[],r=ce(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),ce(r[o])[a](t),s.apply(n,t.get());return this.pushStack(n)}});var _e=new RegExp("^("+G+")(?!px)[a-z%]+$","i"),ze=/^--/,Xe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=ie),t.getComputedStyle(e)},Ue=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ve=new RegExp(Q.join("|"),"i");function Ge(e,t,n){var r,i,o,a,s=ze.test(t),u=e.style;return(n=n||Xe(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(ve,"$1")||void 0),""!==a||K(e)||(a=ce.style(e,t)),!le.pixelBoxStyles()&&_e.test(a)&&Ve.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function Ye(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",J.appendChild(u).appendChild(l);var e=ie.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),J.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=C.createElement("div"),l=C.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",le.clearCloneStyle="content-box"===l.style.backgroundClip,ce.extend(le,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=C.createElement("table"),t=C.createElement("tr"),n=C.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",J.appendChild(e).appendChild(t).appendChild(n),r=ie.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,J.removeChild(e)),a}}))}();var Qe=["Webkit","Moz","ms"],Je=C.createElement("div").style,Ke={};function Ze(e){var t=ce.cssProps[e]||Ke[e];return t||(e in Je?e:Ke[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;while(n--)if((e=Qe[n]+t)in Je)return e}(e)||e)}var et=/^(none|table(?!-c[ea]).+)/,tt={position:"absolute",visibility:"hidden",display:"block"},nt={letterSpacing:"0",fontWeight:"400"};function rt(e,t,n){var r=Y.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function it(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=ce.css(e,n+Q[a],!0,i)),r?("content"===n&&(u-=ce.css(e,"padding"+Q[a],!0,i)),"margin"!==n&&(u-=ce.css(e,"border"+Q[a]+"Width",!0,i))):(u+=ce.css(e,"padding"+Q[a],!0,i),"padding"!==n?u+=ce.css(e,"border"+Q[a]+"Width",!0,i):s+=ce.css(e,"border"+Q[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u+l}function ot(e,t,n){var r=Xe(e),i=(!le.boxSizingReliable()||n)&&"border-box"===ce.css(e,"boxSizing",!1,r),o=i,a=Ge(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(_e.test(a)){if(!n)return a;a="auto"}return(!le.boxSizingReliable()&&i||!le.reliableTrDimensions()&&fe(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===ce.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===ce.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+it(e,t,n||(i?"border":"content"),o,r,a)+"px"}function at(e,t,n,r,i){return new at.prototype.init(e,t,n,r,i)}ce.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ge(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=F(t),u=ze.test(t),l=e.style;if(u||(t=Ze(s)),a=ce.cssHooks[t]||ce.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=Y.exec(n))&&i[1]&&(n=te(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(ce.cssNumber[s]?"":"px")),le.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=F(t);return ze.test(t)||(t=Ze(s)),(a=ce.cssHooks[t]||ce.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ge(e,t,r)),"normal"===i&&t in nt&&(i=nt[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),ce.each(["height","width"],function(e,u){ce.cssHooks[u]={get:function(e,t,n){if(t)return!et.test(ce.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,u,n):Ue(e,tt,function(){return ot(e,u,n)})},set:function(e,t,n){var r,i=Xe(e),o=!le.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===ce.css(e,"boxSizing",!1,i),s=n?it(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-it(e,u,"border",!1,i)-.5)),s&&(r=Y.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=ce.css(e,u)),rt(0,t,s)}}}),ce.cssHooks.marginLeft=Ye(le.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ge(e,"marginLeft"))||e.getBoundingClientRect().left-Ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),ce.each({margin:"",padding:"",border:"Width"},function(i,o){ce.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+Q[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(ce.cssHooks[i+o].set=rt)}),ce.fn.extend({css:function(e,t){return M(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Xe(e),i=t.length;a<i;a++)o[t[a]]=ce.css(e,t[a],!1,r);return o}return void 0!==n?ce.style(e,t,n):ce.css(e,t)},e,t,1<arguments.length)}}),((ce.Tween=at).prototype={constructor:at,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||ce.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ce.cssNumber[n]?"":"px")},cur:function(){var e=at.propHooks[this.prop];return e&&e.get?e.get(this):at.propHooks._default.get(this)},run:function(e){var t,n=at.propHooks[this.prop];return this.options.duration?this.pos=t=ce.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):at.propHooks._default.set(this),this}}).init.prototype=at.prototype,(at.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=ce.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){ce.fx.step[e.prop]?ce.fx.step[e.prop](e):1!==e.elem.nodeType||!ce.cssHooks[e.prop]&&null==e.elem.style[Ze(e.prop)]?e.elem[e.prop]=e.now:ce.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=at.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ce.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ce.fx=at.prototype.init,ce.fx.step={};var st,ut,lt,ct,ft=/^(?:toggle|show|hide)$/,pt=/queueHooks$/;function dt(){ut&&(!1===C.hidden&&ie.requestAnimationFrame?ie.requestAnimationFrame(dt):ie.setTimeout(dt,ce.fx.interval),ce.fx.tick())}function ht(){return ie.setTimeout(function(){st=void 0}),st=Date.now()}function gt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Q[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function vt(e,t,n){for(var r,i=(yt.tweeners[t]||[]).concat(yt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function yt(o,e,t){var n,a,r=0,i=yt.prefilters.length,s=ce.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=st||ht(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:ce.extend({},e),opts:ce.extend(!0,{specialEasing:{},easing:ce.easing._default},t),originalProperties:e,originalOptions:t,startTime:st||ht(),duration:t.duration,tweens:[],createTween:function(e,t){var n=ce.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=F(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=ce.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=yt.prefilters[r].call(l,o,c,l.opts))return v(n.stop)&&(ce._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return ce.map(c,vt,l),v(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),ce.fx.timer(ce.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}ce.Animation=ce.extend(yt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return te(n.elem,e,Y.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(D);for(var n,r=0,i=e.length;r<i;r++)n=e[r],yt.tweeners[n]=yt.tweeners[n]||[],yt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ee(e),v=_.get(e,"fxshow");for(r in n.queue||(null==(a=ce._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,ce.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ft.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||ce.style(e,r)}if((u=!ce.isEmptyObject(t))||!ce.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=_.get(e,"display")),"none"===(c=ce.css(e,"display"))&&(l?c=l:(re([e],!0),l=e.style.display||l,c=ce.css(e,"display"),re([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===ce.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=_.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&re([e],!0),p.done(function(){for(r in g||re([e]),_.remove(e,"fxshow"),d)ce.style(e,r,d[r])})),u=vt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?yt.prefilters.unshift(e):yt.prefilters.push(e)}}),ce.speed=function(e,t,n){var r=e&&"object"==typeof e?ce.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return ce.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in ce.fx.speeds?r.duration=ce.fx.speeds[r.duration]:r.duration=ce.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&ce.dequeue(this,r.queue)},r},ce.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ee).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=ce.isEmptyObject(t),o=ce.speed(e,n,r),a=function(){var e=yt(this,ce.extend({},t),o);(i||_.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=ce.timers,r=_.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&pt.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||ce.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=_.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=ce.timers,o=n?n.length:0;for(t.finish=!0,ce.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),ce.each(["toggle","show","hide"],function(e,r){var i=ce.fn[r];ce.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(gt(r,!0),e,t,n)}}),ce.each({slideDown:gt("show"),slideUp:gt("hide"),slideToggle:gt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){ce.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),ce.timers=[],ce.fx.tick=function(){var e,t=0,n=ce.timers;for(st=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||ce.fx.stop(),st=void 0},ce.fx.timer=function(e){ce.timers.push(e),ce.fx.start()},ce.fx.interval=13,ce.fx.start=function(){ut||(ut=!0,dt())},ce.fx.stop=function(){ut=null},ce.fx.speeds={slow:600,fast:200,_default:400},ce.fn.delay=function(r,e){return r=ce.fx&&ce.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=ie.setTimeout(e,r);t.stop=function(){ie.clearTimeout(n)}})},lt=C.createElement("input"),ct=C.createElement("select").appendChild(C.createElement("option")),lt.type="checkbox",le.checkOn=""!==lt.value,le.optSelected=ct.selected,(lt=C.createElement("input")).value="t",lt.type="radio",le.radioValue="t"===lt.value;var mt,xt=ce.expr.attrHandle;ce.fn.extend({attr:function(e,t){return M(this,ce.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){ce.removeAttr(this,e)})}}),ce.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?ce.prop(e,t,n):(1===o&&ce.isXMLDoc(e)||(i=ce.attrHooks[t.toLowerCase()]||(ce.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void ce.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=ce.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!le.radioValue&&"radio"===t&&fe(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(D);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?ce.removeAttr(e,n):e.setAttribute(n,n),n}},ce.each(ce.expr.match.bool.source.match(/\w+/g),function(e,t){var a=xt[t]||ce.find.attr;xt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=xt[o],xt[o]=r,r=null!=a(e,t,n)?o:null,xt[o]=i),r}});var bt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;function Tt(e){return(e.match(D)||[]).join(" ")}function Ct(e){return e.getAttribute&&e.getAttribute("class")||""}function kt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(D)||[]}ce.fn.extend({prop:function(e,t){return M(this,ce.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[ce.propFix[e]||e]})}}),ce.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&ce.isXMLDoc(e)||(t=ce.propFix[t]||t,i=ce.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=ce.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),le.optSelected||(ce.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),ce.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ce.propFix[this.toLowerCase()]=this}),ce.fn.extend({addClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).addClass(t.call(this,e,Ct(this)))}):(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).removeClass(t.call(this,e,Ct(this)))}):arguments.length?(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return v(t)?this.each(function(e){ce(this).toggleClass(t.call(this,e,Ct(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=kt(t),this.each(function(){if(s)for(o=ce(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=Ct(this))&&_.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":_.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+Tt(Ct(n))+" ").indexOf(t))return!0;return!1}});var St=/\r/g;ce.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=v(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,ce(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=ce.map(t,function(e){return null==e?"":e+""})),(r=ce.valHooks[this.type]||ce.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=ce.valHooks[t.type]||ce.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(St,""):null==e?"":e:void 0}}),ce.extend({valHooks:{option:{get:function(e){var t=ce.find.attr(e,"value");return null!=t?t:Tt(ce.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!fe(n.parentNode,"optgroup"))){if(t=ce(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=ce.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<ce.inArray(ce.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),ce.each(["radio","checkbox"],function(){ce.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<ce.inArray(ce(e).val(),t)}},le.checkOn||(ce.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Et=ie.location,jt={guid:Date.now()},At=/\?/;ce.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new ie.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||ce.error("Invalid XML: "+(n?ce.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Dt=/^(?:focusinfocus|focusoutblur)$/,Nt=function(e){e.stopPropagation()};ce.extend(ce.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||C],d=ue.call(e,"type")?e.type:e,h=ue.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||C,3!==n.nodeType&&8!==n.nodeType&&!Dt.test(d+ce.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[ce.expando]?e:new ce.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:ce.makeArray(t,[e]),c=ce.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!y(n)){for(s=c.delegateType||d,Dt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||C)&&p.push(a.defaultView||a.parentWindow||ie)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(_.get(o,"events")||Object.create(null))[e.type]&&_.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&$(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!$(n)||u&&v(n[d])&&!y(n)&&((a=n[u])&&(n[u]=null),ce.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Nt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Nt),ce.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=ce.extend(new ce.Event,n,{type:e,isSimulated:!0});ce.event.trigger(r,null,t)}}),ce.fn.extend({trigger:function(e,t){return this.each(function(){ce.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ce.event.trigger(e,t,n,!0)}});var qt=/\[\]$/,Lt=/\r?\n/g,Ht=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Pt(n,e,r,i){var t;if(Array.isArray(e))ce.each(e,function(e,t){r||qt.test(n)?i(n,t):Pt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==x(e))i(n,e);else for(t in e)Pt(n+"["+t+"]",e[t],r,i)}ce.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!ce.isPlainObject(e))ce.each(e,function(){i(this.name,this.value)});else for(n in e)Pt(n,e[n],t,i);return r.join("&")},ce.fn.extend({serialize:function(){return ce.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ce.prop(this,"elements");return e?ce.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ce(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ht.test(e)&&(this.checked||!we.test(e))}).map(function(e,t){var n=ce(this).val();return null==n?null:Array.isArray(n)?ce.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var Mt=/%20/g,Rt=/#.*$/,It=/([?&])_=[^&]*/,Wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ft=/^(?:GET|HEAD)$/,$t=/^\/\//,Bt={},_t={},zt="*/".concat("*"),Xt=C.createElement("a");function Ut(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(D)||[];if(v(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Vt(t,i,o,a){var s={},u=t===_t;function l(e){var r;return s[e]=!0,ce.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Gt(e,t){var n,r,i=ce.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&ce.extend(!0,e,r),e}Xt.href=Et.href,ce.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":ce.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gt(Gt(e,ce.ajaxSettings),t):Gt(ce.ajaxSettings,e)},ajaxPrefilter:Ut(Bt),ajaxTransport:Ut(_t),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=ce.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?ce(y):ce.event,x=ce.Deferred(),b=ce.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Wt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace($t,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(D)||[""],null==v.crossDomain){r=C.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Xt.protocol+"//"+Xt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=ce.param(v.data,v.traditional)),Vt(Bt,v,t,T),h)return T;for(i in(g=ce.event&&v.global)&&0==ce.active++&&ce.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ft.test(v.type),f=v.url.replace(Rt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Mt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(At.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(It,"$1"),o=(At.test(f)?"&":"?")+"_="+jt.guid+++o),v.url=f+o),v.ifModified&&(ce.lastModified[f]&&T.setRequestHeader("If-Modified-Since",ce.lastModified[f]),ce.etag[f]&&T.setRequestHeader("If-None-Match",ce.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+zt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Vt(_t,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=ie.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&ie.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<ce.inArray("script",v.dataTypes)&&ce.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(ce.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(ce.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--ce.active||ce.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return ce.get(e,t,n,"json")},getScript:function(e,t){return ce.get(e,void 0,t,"script")}}),ce.each(["get","post"],function(e,i){ce[i]=function(e,t,n,r){return v(t)&&(r=r||n,n=t,t=void 0),ce.ajax(ce.extend({url:e,type:i,dataType:r,data:t,success:n},ce.isPlainObject(e)&&e))}}),ce.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),ce._evalUrl=function(e,t,n){return ce.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){ce.globalEval(e,t,n)}})},ce.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=ce(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return v(n)?this.each(function(e){ce(this).wrapInner(n.call(this,e))}):this.each(function(){var e=ce(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=v(t);return this.each(function(e){ce(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ce(this).replaceWith(this.childNodes)}),this}}),ce.expr.pseudos.hidden=function(e){return!ce.expr.pseudos.visible(e)},ce.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ce.ajaxSettings.xhr=function(){try{return new ie.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Qt=ce.ajaxSettings.xhr();le.cors=!!Qt&&"withCredentials"in Qt,le.ajax=Qt=!!Qt,ce.ajaxTransport(function(i){var o,a;if(le.cors||Qt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Yt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&ie.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),ce.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ce.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return ce.globalEval(e),e}}}),ce.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ce.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=ce("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=Tt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&ce.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?ce("<div>").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var en=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;ce.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=ae.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(ae.call(arguments)))}).guid=e.guid=e.guid||ce.guid++,i},ce.holdReady=function(e){e?ce.readyWait++:ce.ready(!0)},ce.isArray=Array.isArray,ce.parseJSON=JSON.parse,ce.nodeName=fe,ce.isFunction=v,ce.isWindow=y,ce.camelCase=F,ce.type=x,ce.now=Date.now,ce.isNumeric=function(e){var t=ce.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},ce.trim=function(e){return null==e?"":(e+"").replace(en,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return ce});var tn=ie.jQuery,nn=ie.$;return ce.noConflict=function(e){return ie.$===ce&&(ie.$=nn),e&&ie.jQuery===ce&&(ie.jQuery=tn),ce},"undefined"==typeof e&&(ie.jQuery=ie.$=ce),ce});
3616
3617/* ========================================
3618 FILE: /includes/js/jquery/core/jquery-migrate-3.5.2.min.js
3619 ==================== */
3620
3621/*! jQuery Migrate v3.5.2 | (c) OpenJS Foundation and other contributors | jquery.com/license */
3622"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+o[a]<+n[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.5.2";var t=Object.create(null);s.migrateDisablePatches=function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=!0},s.migrateEnablePatches=function(){for(var e=0;e<arguments.length;e++)delete t[arguments[e]]},s.migrateIsPatchEnabled=function(e){return!t[e]},n.console&&n.console.log&&(s&&e("3.0.0")&&!e("5.0.0")||n.console.log("JQMIGRATE: jQuery 3.x-4.x REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var o={};function u(e,t){var r=n.console;!s.migrateIsPatchEnabled(e)||s.migrateDeduplicateWarnings&&o[t]||(o[t]=!0,s.migrateWarnings.push(t+" ["+e+"]"),r&&r.warn&&!s.migrateMute&&(r.warn("JQMIGRATE: "+t),s.migrateTrace&&r.trace&&r.trace()))}function r(e,t,r,n,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n,o),r},set:function(e){u(n,o),r=e}})}function a(e,t,r,n,o){var a=e[t];e[t]=function(){return o&&u(n,o),(s.migrateIsPatchEnabled(n)?r:a||s.noop).apply(this,arguments)}}function c(e,t,r,n,o){if(!o)throw new Error("No warning message provided");return a(e,t,r,n,o),0}function i(e,t,r,n){return a(e,t,r,n),0}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){o={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("quirks","jQuery is not compatible with Quirks Mode");var d,l,p,f={},m=s.fn.init,y=s.find,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;for(d in i(s.fn,"init",function(e){var t=Array.prototype.slice.call(arguments);return s.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof e&&"#"===e&&(u("selector-empty-id","jQuery( '#' ) is not a valid selector"),t[0]=[]),m.apply(this,t)},"selector-empty-id"),s.fn.init.prototype=s.fn,i(s,"find",function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&g.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(h,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("selector-hash","Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("selector-hash","Attribute selector with '#' was not fixed: "+r[0])}}return y.apply(this,r)},"selector-hash"),y)Object.prototype.hasOwnProperty.call(y,d)&&(s.find[d]=y[d]);c(s.fn,"size",function(){return this.length},"size","jQuery.fn.size() is deprecated and removed; use the .length property"),c(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),c(s,"holdReady",s.holdReady,"holdReady","jQuery.holdReady is deprecated"),c(s,"unique",s.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),r(s.expr,"filters",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),r(s.expr,":",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&c(s,"trim",function(e){return null==e?"":(e+"").replace(v,"$1")},"trim","jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(c(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"nodeName","jQuery.nodeName is deprecated"),c(s,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(c(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"isNumeric","jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()}),c(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[Object.prototype.toString.call(e)]||"object":typeof e},"type","jQuery.type is deprecated"),c(s,"isFunction",function(e){return"function"==typeof e},"isFunction","jQuery.isFunction() is deprecated"),c(s,"isWindow",function(e){return null!=e&&e===e.window}
3622,"isWindow","jQuery.isWindow() is deprecated")),s.ajax&&(l=s.ajax,p=/(=)\?(?=&|$)|\?\?/,i(s,"ajax",function(){var e=l.apply(this,arguments);return e.promise&&(c(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),c(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),c(e,"complete",e.always,"jqXHR-methods","jQXHR.complete is deprecated and removed")),e},"jqXHR-methods"),e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(p.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&p.test(e.data))&&u("jsonp-promotion","JSON-to-JSONP auto-promotion is deprecated")}));var j=s.fn.removeAttr,b=s.fn.toggleClass,Q=/^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i,w=/\S+/g;function x(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}i(s.fn,"removeAttr",function(e){var r=this,n=!1;return s.each(e.match(w),function(e,t){Q.test(t)&&r.each(function(){if(!1!==s(this).prop(t))return!(n=!0)}),n&&(u("removeAttr-bool","jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),j.apply(this,arguments)},"removeAttr-bool"),i(s.fn,"toggleClass",function(t){return void 0!==t&&"boolean"!=typeof t?b.apply(this,arguments):(u("toggleClass-bool","jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))},"toggleClass-bool");var A,R,S=!1,k=/^[a-z]/,N=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return S=!0,e=r.apply(this,arguments),S=!1,e})}),i(s,"swap",function(e,t,r,n){var o,a,i={};for(a in S||u("swap","jQuery.swap() is undocumented and deprecated"),t)i[a]=e.style[a],e.style[a]=t[a];for(a in o=r.apply(e,n||[]),t)e.style[a]=i[a];return o},"swap"),e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("cssProps","jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),e("4.0.0")?(R={animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},"undefined"!=typeof Proxy?s.cssNumber=new Proxy(R,{get:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.get.apply(this,arguments)},set:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.set.apply(this,arguments)}}):s.cssNumber=R):R=s.cssNumber,A=s.fn.css,i(s.fn,"css",function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t)}),this):("number"==typeof t&&(r=x(e),n=r,k.test(n)&&N.test(n[0].toUpperCase()+n.slice(1))||R[r]||u("css-number",'Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),A.apply(this,arguments))},"css-number");var P,C,H,E,M=s.data;i(s,"data",function(e,t,r){var n,o,a;if(t&&"object"==typeof t&&2===arguments.length){for(a in n=s.hasData(e)&&M.call(this,e),o={},t)a!==x(a)?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+a),n[a]=t[a]):o[a]=t[a];return M.call(this,e,o),t}return t&&"string"==typeof t&&t!==x(t)&&(n=s.hasData(e)&&M.call(this,e))&&t in n?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):M.apply(this,arguments)},"data-camelCase"),s.fx&&(H=s.Tween.prototype.run,E=function(e){return e},i(s.Tween.prototype,"run",function(){1<s.easing[this.easing].length&&(u("easing-one-arg","'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=E),H.apply(this,arguments)},"easing-one-arg"),P=s.fx.interval,C="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u("fx-interval",C),s.migrateIsPatchEnabled("fx-interval")&&void 0===P?13:P},set:function(e){u("fx-interval",C),P=e}}));var q=s.fn.load,O=s.event.add,F=s.event.fix;s.event.props=[],s.event.fixHooks={}
3622,r(s.event.props,"concat",s.event.props.concat,"event-old-patch","jQuery.event.props.concat() is deprecated and removed"),i(s.event,"fix",function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("event-old-patch","jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,u("event-old-patch","jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=F.call(this,e),n&&n.filter?n.filter(t,e):t},"event-old-patch"),i(s.event,"add",function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("load-after-event","jQuery(window).on('load'...) called after load event occurred"),O.apply(this,arguments)},"load-after-event"),s.each(["load","unload","error"],function(e,t){i(s.fn,t,function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?q.apply(this,e):(u("shorthand-removed-v3","jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))},"shorthand-removed-v3")}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){c(s.fn,r,function(e,t){return 0<arguments.length?this.on(r,null,e,t):this.trigger(r)},"shorthand-deprecated-v3","jQuery.fn."+r+"() event shorthand is deprecated")}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&u("ready-event","'ready' event is deprecated")}},c(s.fn,"bind",function(e,t,r){return this.on(e,null,t,r)},"pre-on-methods","jQuery.fn.bind() is deprecated"),c(s.fn,"unbind",function(e,t){return this.off(e,null,t)},"pre-on-methods","jQuery.fn.unbind() is deprecated"),c(s.fn,"delegate",function(e,t,r,n){return this.on(t,e,r,n)},"pre-on-methods","jQuery.fn.delegate() is deprecated"),c(s.fn,"undelegate",function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},"pre-on-methods","jQuery.fn.undelegate() is deprecated"),c(s.fn,"hover",function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)},"pre-on-methods","jQuery.fn.hover() is deprecated");function T(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}var D=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi;c(s,"UNSAFE_restoreLegacyHtmlPrefilter",function(){s.migrateEnablePatches("self-closed-tags")},"legacy-self-closed-tags",'jQuery.UNSAFE_restoreLegacyHtmlPrefilter deprecated; use `jQuery.migrateEnablePatches( "self-closed-tags" )`'),i(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(D,"<$1></$2>"))!==t&&T(t)!==T(r)&&u("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(D,"<$1></$2>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags");var _,I,W,J=s.fn.offset;return i(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?J.apply(this,arguments):(u("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(_=s.param,i(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),_.call(this,e,t)},"param-ajax-traditional")),c(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(I=s.Deferred,W=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],i(s,"Deferred",function(e){var a=I(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(W,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return c(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),c(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=I.exceptionHook),s});
3623
3624/* ========================================
3625 FILE: /includes/js/jquery/cs_custom_jquery_functions.js
3626 ==================== */
3627
3628/*
3629 * Creativesites s.r.o.
3630 * Custom Jquery Functions
3631 *
3632 * Vsetky custom funkcie, ktore rozsiruju jQuery objekt, pridavajte sem
3633 */
3634
3635if ( typeof js_CS_Config_log_xhr_payload !== 'undefined' && js_CS_Config_log_xhr_payload ) {
3636	(function() {
3637		window.csSavedErrorJsonResponse = '';
3638
3639		var origOpen = XMLHttpRequest.prototype.open;
3640		XMLHttpRequest.prototype.open = function() {
3641			this.addEventListener('loadstart', function() {
3642				csSavedErrorJsonResponse = '';
3643			});
3644			this.addEventListener('progress', function() {
3645				if ( this.responseType === '' || this.responseType === 'text' ) {
3646					csSavedErrorJsonResponse = this.responseText;
3647				}
3648			});
3649			origOpen.apply(this, arguments);
3650		};
3651	})();
3652} else {
3653	window.csSavedErrorJsonResponse = '';
3654}
3655
3656document.addEventListener('lazybeforeunveil', function(event) {
3657	if (event.target.tagName == 'svg') {
3658		var elem = event.target;
3659		var url = elem.getAttribute('data-src');
3660		elem.removeAttribute('data-src');
3661
3662		jQuery.get(url, function(res) {
3663			if (typeof res === 'undefined' || typeof res.getElementsByTagName !== 'function') {
3664				return;
3665			}
3666
3667			var svg = res.getElementsByTagName('svg');
3668			if (svg.length) {
3669				// But we only want the first.
3670				svg = svg[0];
3671
3672				// Copy over the attributes first.
3673				var attr = svg.attributes;
3674				var attrLen = attr.length;
3675				for (var i = 0; i < attrLen; ++i) {
3676					if (attr[i].specified) {
3677						// Merge classes.
3678						if ('class' === attr[i].name) {
3679							//var classes = attr[i].value.replace(/\s+/g, ' ').trim().split(' ');
3680							//var classesLen = classes.length;
3681							//for (var j = 0; j < classesLen; ++j) {
3682							//	elem.classList.add(classes[j]);
3683							//}
3684						}
3685						// Add/replace anything else.
3686						else {
3687							elem.setAttribute(attr[i].name, attr[i].value);
3688						}
3689					}
3690				}
3691
3692				// Now transfer over the children. Note: IE does not
3693				// assign an innerHTML property to SVGs, so we need to
3694				// go node by node.
3695				while (svg.childNodes.length) {
3696					elem.appendChild(svg.childNodes[0]);
3697				}
3698			}
3699		});
3700	}
3701});
3702
3703(function() {
3704	var matched, browser;
3705
3706	// Use of jQuery.browser is frowned upon.
3707	// More details: http://api.jquery.com/jQuery.browser
3708	// jQuery.uaMatch maintained for back-compat
3709	jQuery.uaMatch = function( ua ) {
3710		ua = ua.toLowerCase();
3711
3712		var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
3713			/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
3714			/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
3715			/(msie) ([\w.]+)/.exec( ua ) ||
3716			ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
3717			[];
3718
3719		return {
3720			browser: match[ 1 ] || "",
3721			version: match[ 2 ] || "0"
3722		};
3723	};
3724
3725	matched = jQuery.uaMatch( navigator.userAgent );
3726	browser = {};
3727
3728	if ( matched.browser ) {
3729		browser[ matched.browser ] = true;
3730		browser.version = matched.version;
3731	}
3732
3733	// Chrome is Webkit, but Webkit is also Safari.
3734	if ( browser.chrome ) {
3735		browser.webkit = true;
3736	} else if ( browser.webkit ) {
3737		browser.safari = true;
3738	}
3739
3740	jQuery.browser = browser;
3741})();
3742
3743window.addEventListener('DOMContentLoaded', function() {
3744
3745	// ak uiautocomplete nie je definovany on ready, tak ho definujeme
3746	if ( typeof jQuery.fn.uiautocomplete === 'undefined' && jQuery.fn.autocomplete !== 'undefined' ) {
3747		jQuery.fn.uiautocomplete = jQuery.fn.autocomplete;
3748	}
3749});
3750
3751
3752/* ========================================
3753 FILE: /includes/js/jquery.cookie.js
3754 ==================== */
3755
3756/**
3757 * Cookie plugin
3758 *
3759 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
3760 * Dual licensed under the MIT and GPL licenses:
3761 * http://www.opensource.org/licenses/mit-license.php
3762 * http://www.gnu.org/licenses/gpl.html
3763 *
3764 */
3765
3766/**
3767 * Create a cookie with the given name and value and other optional parameters.
3768 *
3769 * @example $jQ.cookie('the_cookie', 'the_value');
3770 * @desc Set the value of a cookie.
3771 * @example $jQ.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
3772 * @desc Create a cookie with all available options.
3773 * @example $jQ.cookie('the_cookie', 'the_value');
3774 * @desc Create a session cookie.
3775 * @example $jQ.cookie('the_cookie', null);
3776 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
3777 *       used when the cookie was set.
3778 *
3779 * @param String name The name of the cookie.
3780 * @param String value The value of the cookie.
3781 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
3782 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
3783 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
3784 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
3785 *                             when the the browser exits.
3786 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
3787 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
3788 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
3789 *                        require a secure protocol (like HTTPS).
3790 * @type undefined
3791 *
3792 * @name $jQ.cookie
3793 * @cat Plugins/Cookie
3794 * @author Klaus Hartl/[email protected]
3795 */
3796
3797/**
3798 * Get the value of a cookie with the given name.
3799 *
3800 * @example $jQ.cookie('the_cookie');
3801 * @desc Get the value of a cookie.
3802 *
3803 * @param String name The name of the cookie.
3804 * @return The value of the cookie.
3805 * @type String
3806 *
3807 * @name $jQ.cookie
3808 * @cat Plugins/Cookie
3809 * @author Klaus Hartl/[email protected]
3810 */
3811
3812/**
3813 * Get the values of all cookies.
3814 *
3815 * @example $jQ.cookie('*');
3816 * @desc Get the values of all cookie in array.
3817 *
3818 * @example $jQ.cookie('my_items_*');
3819 * @desc Get the values of all cookie with name begins 'my_items_' in array.
3820 *
3821 * @name $jQ.cookie
3822 * @cat Plugins/Cookie
3823 * @author Calim
3824 */
3825
3826jQuery.cookie = function(name, value, options) {
3827    if (typeof value != 'undefined') { // name and value given, set cookie
3828        options = options || {};
3829        if (value === null) {
3830            value = '';
3831            options.expires = -1;
3832        }
3833        var expires = '';
3834        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
3835            var date;
3836            if (typeof options.expires == 'number') {
3837                date = new Date();
3838                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
3839            } else {
3840                date = options.expires;
3841            }
3842            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
3843        }
3844        // CAUTION: Needed to parenthesize options.path and options.domain
3845        // in the following expressions, otherwise they evaluate to undefined
3846        // in the packed version for some reason...
3847        var path = options.path ? '; path=' + (options.path) : '';
3848        var domain = options.domain ? '; domain=' + (options.domain) : '';
3849        var secure = options.secure ? '; secure' : '';
3850        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
3851    } else { // only name given, get cookie
3852        var cookieValue = null;
3853        if (document.cookie && document.cookie != '') {
3854            var cookies = document.cookie.split(';');
3855            if (name.substr(-1, 1)=='*') {
3856            		//cookieValue = cookies;
3857            		cookieValue = new Array();
3858				for (var i = 0; i < cookies.length; i++) {
3859					var cookie = jQuery.trim(cookies[i]);
3860					var cp = cookie.indexOf('=');
3861					if (cp > -1) {
3862						cn = cookie.substr(0, cp);
3863						if (name=='*' || cn.substr(0, name.length-1)+'*' == name) cookieValue[cookieValue.length] = [cn, decodeURIComponent(cookie.substr(cp+1))];
3864					}
3865				}
3866            } else {
3867				for (var i = 0; i < cookies.length; i++) {
3868					var cookie = jQuery.trim(cookies[i]);
3869					// Does this cookie string begin with the name we want?
3870					if (cookie.substring(0, name.length + 1) == (name + '=')) {
3871						cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
3872						break;
3873					}
3874				}
3875            }
3876        }
3877        return cookieValue;
3878    }
3879};
3880
3881/* ========================================
3882 FILE: /includes/js/js-cookie/js.cookie.js
3883 ==================== */
3884
3885/*!
3886 * JavaScript Cookie v2.2.1
3887 * https://github.com/js-cookie/js-cookie
3888 *
3889 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
3890 * Released under the MIT license
3891 */
3892;(function (factory) {
3893	var registeredInModuleLoader;
3894	if (typeof define === 'function' && define.amd) {
3895		define(factory);
3896		registeredInModuleLoader = true;
3897	}
3898	if (typeof exports === 'object') {
3899		module.exports = factory();
3900		registeredInModuleLoader = true;
3901	}
3902	if (!registeredInModuleLoader) {
3903		var OldCookies = window.Cookies;
3904		var api = window.Cookies = factory();
3905		api.noConflict = function () {
3906			window.Cookies = OldCookies;
3907			return api;
3908		};
3909	}
3910}(function () {
3911	function extend () {
3912		var i = 0;
3913		var result = {};
3914		for (; i < arguments.length; i++) {
3915			var attributes = arguments[ i ];
3916			for (var key in attributes) {
3917				result[key] = attributes[key];
3918			}
3919		}
3920		return result;
3921	}
3922
3923	function decode (s) {
3924		return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
3925	}
3926
3927	function init (converter) {
3928		function api() {}
3929
3930		function set (key, value, attributes) {
3931			if (typeof document === 'undefined') {
3932				return;
3933			}
3934
3935			attributes = extend({
3936				path: '/'
3937			}, api.defaults, attributes);
3938
3939			if (typeof attributes.expires === 'number') {
3940				attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
3941			}
3942
3943			// We're using "expires" because "max-age" is not supported by IE
3944			attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
3945
3946			try {
3947				var result = JSON.stringify(value);
3948				if (/^[\{\[]/.test(result)) {
3949					value = result;
3950				}
3951			} catch (e) {}
3952
3953			value = converter.write ?
3954				converter.write(value, key) :
3955				encodeURIComponent(String(value))
3956					.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
3957
3958			key = encodeURIComponent(String(key))
3959				.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
3960				.replace(/[\(\)]/g, escape);
3961
3962			var stringifiedAttributes = '';
3963			for (var attributeName in attributes) {
3964				if (!attributes[attributeName]) {
3965					continue;
3966				}
3967				stringifiedAttributes += '; ' + attributeName;
3968				if (attributes[attributeName] === true) {
3969					continue;
3970				}
3971
3972				// Considers RFC 6265 section 5.2:
3973				// ...
3974				// 3.  If the remaining unparsed-attributes contains a %x3B (";")
3975				//     character:
3976				// Consume the characters of the unparsed-attributes up to,
3977				// not including, the first %x3B (";") character.
3978				// ...
vendor: 3,476 bytes, lines 3979-4070
3979				stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
3980			}
3981
3982			return (document.cookie = key + '=' + value + stringifiedAttributes);
3983		}
3984
3985		function get (key, json) {
3986			if (typeof document === 'undefined') {
3987				return;
3988			}
3989
3990			var jar = {};
3991			// To prevent the for loop in the first place assign an empty array
3992			// in case there are no cookies at all.
3993			var cookies = document.cookie ? document.cookie.split('; ') : [];
3994			var i = 0;
3995
3996			for (; i < cookies.length; i++) {
3997				var parts = cookies[i].split('=');
3998				var cookie = parts.slice(1).join('=');
3999
4000				if (!json && cookie.charAt(0) === '"') {
4001					cookie = cookie.slice(1, -1);
4002				}
4003
4004				try {
4005					var name = decode(parts[0]);
4006					cookie = (converter.read || converter)(cookie, name) ||
4007						decode(cookie);
4008
4009					if (json) {
4010						try {
4011							cookie = JSON.parse(cookie);
4012						} catch (e) {}
4013					}
4014
4015					jar[name] = cookie;
4016
4017					if (key === name) {
4018						break;
4019					}
4020				} catch (e) {}
4021			}
4022
4023			return key ? jar[key] : jar;
4024		}
4025
4026		api.set = set;
4027		api.get = function (key) {
4028			return get(key, false /* read as raw */);
4029		};
4030		api.getJSON = function (key) {
4031			return get(key, true /* read as json */);
4032		};
4033		api.remove = function (key, attributes) {
4034			set(key, '', extend(attributes, {
4035				expires: -1
4036			}));
4037		};
4038
4039		api.defaults = {};
4040
4041		api.withConverter = init;
4042
4043		return api;
4044	}
4045
4046	return init(function () {});
4047}));
4048
4049
4050/* ========================================
4051 FILE: /includes/js/core.js
4052 ==================== */
4053
4054var script_manage_params = typeof script_manage_params === 'object' ? script_manage_params : {};
4055var script_manage_params_jcsl_jq = typeof script_manage_params.jcsl_jq !== 'undefined' ? script_manage_params.jcsl_jq : '';
4056var script_manage_params_jcsl_g = typeof script_manage_params.jcsl_g !== 'undefined' ? script_manage_params.jcsl_g : '';
4057var script_manage_params_ls = typeof script_manage_params.ls !== 'undefined' ? script_manage_params.ls : '';
4058var script_manage_params_sws = typeof script_manage_params.sws !== 'undefined' ? script_manage_params.sws : '';
4059var script_manage_params_lss = typeof script_manage_params.lss !== 'undefined' ? script_manage_params.lss : '';
4060var script_manage_params_cs = typeof script_manage_params.cs !== 'undefined' ? script_manage_params.cs : '';
4061var script_manage_params_csu = typeof script_manage_params.csu !== 'undefined' ? script_manage_params.csu : '';
4062var script_manage_params_is_admin = typeof script_manage_params.is_admin !== 'undefined' ? script_manage_params.is_admin : '';
4063var script_manage_params_csu_ip = typeof script_manage_params.csu_ip !== 'undefined' ? script_manage_params.csu_ip : '';
4064var script_manage_params_jsc = typeof script_manage_params.jsc !== 'undefined' ? script_manage_params.jsc : '';
4065var script_manage_params_sra = typeof script_manage_params.sra !== 'undefined' ? script_manage_params.sra : '';
4066var script_manage_params_du = typeof script_manage_params.devu !== 'undefined' ? script_manage_params.devu : false;
4067var script_manage_params_svp = typeof script_manage_params.svp !== 'undefined' ? script_manage_params.svp : '';
4068var script_manage_params_pame = typeof script_manage_params.pame !== 'undefined' ? script_manage_params.pame : false;
4069var script_manage_params_pamsf = typeof script_manage_params.pamsf !== 'undefined' ? script_manage_params.pamsf : false;
4070var script_manage_params_npfsv = typeof script_manage_params.npfsv !== 'undefined' ? script_manage_params.npfsv : false;
4071var script_manage_params_madom = typeof script_manage_params.madom !== 'undefined' && script_manage_params.madom !== null ? script_manage_params.madom : '';
4072var script_manage_params_ismyid = typeof script_manage_params.ismyid !== 'undefined' ? script_manage_params.ismyid : '';
4073var script_manage_params_mynm = typeof script_manage_params.mynm !== 'undefined' ? script_manage_params.mynm : '';
4074var script_manage_params_myem = typeof script_manage_params.myem !== 'undefined' ? script_manage_params.myem : '';
4075var script_manage_params_mygid = typeof script_manage_params.mygid !== 'undefined' ? script_manage_params.mygid : '';
4076var script_manage_params_myshgid = typeof script_manage_params.myshgid !== 'undefined' ? script_manage_params.myshgid : '';
4077var script_manage_params_ucri = typeof script_manage_params.ucri !== 'undefined' ? script_manage_params.ucri : '';
4078var script_manage_params_sspuefri = typeof script_manage_params.sspuefri !== 'undefined' ? script_manage_params.sspuefri : '';
4079var script_manage_params_sspuefrit = typeof script_manage_params.sspuefrit !== 'undefined' ? script_manage_params.sspuefrit : '';
4080var script_manage_params_gl = typeof script_manage_params.gl !== 'undefined' ? script_manage_params.gl : '';
4081var script_manage_params_cl = typeof script_manage_params.cl !== 'undefined' ? script_manage_params.cl : '';
4082var script_manage_params_jfe = typeof script_manage_params.jfe !== 'undefined' ? script_manage_params.jfe : '';
4083var script_manage_params_jfl = typeof script_manage_params.jfl !== 'undefined' ? script_manage_params.jfl : '';
4084var script_manage_params_jflid = typeof script_manage_params.jflid !== 'undefined' ? script_manage_params.jflid : '';
4085var script_manage_params_c_f = typeof script_manage_params.c_f !== 'undefined' ? script_manage_params.c_f : '';
4086var script_manage_params_j_f = typeof script_manage_params.j_f !== 'undefined' ? script_manage_params.j_f : '';
4087var script_manage_params_rqcid = typeof script_manage_params.rqcid !== 'undefined' ? script_manage_params.rqcid : '';
4088var script_manage_params_ptab = typeof script_manage_params.ptab !== 'undefined' ? script_manage_params.ptab : '';
4089var script_manage_params_paimg = typeof script_manage_params.paimg !== 'undefined' ? script_manage_params.paimg == 'true' : '';
4090var script_manage_params_paaimg = typeof script_manage_params.paaimg !== 'undefined' ? script_manage_params.paaimg == 'true' : '';
4091var script_manage_params_paean = typeof script_manage_params.paean !== 'undefined' ? script_manage_params.paean == 'true' : '';
4092var script_manage_params_pavdom = typeof script_manage_params.pavdom !== 'undefined' ? script_manage_params.pavdom == 'true' : '';
4093var script_manage_params_paw = typeof script_manage_params.paw !== 'undefined' ? script_manage_params.paw == 'true' : '';
4094var script_manage_params_pasid = typeof script_manage_params.pasid !== 'undefined' ? script_manage_params.pasid == 'true' : '';
4095var script_manage_params_pasidftr = typeof script_manage_params.pasidftr !== 'undefined' ? script_manage_params.pasidftr == 'true' : '';
4096var script_manage_params_pamq = typeof script_manage_params.pamq !== 'undefined' ? script_manage_params.pamq == 'true' : '';
4097var script_manage_params_vdate = typeof script_manage_params.vdate !== 'undefined' ? script_manage_params.vdate : '';
4098var script_manage_params_attcfill = typeof script_manage_params.attcfill !== 'undefined' ? script_manage_params.attcfill : '';
4099var script_manage_params_pst = typeof script_manage_params.pst !== 'undefined' ? script_manage_params.pst : '';
4100var script_manage_params_pact = typeof script_manage_params.pact !== 'undefined' ? script_manage_params.pact : '';
4101var script_manage_params_product_attribute_custom_text_title = typeof script_manage_params.product_attribute_custom_text_title !== 'undefined' ? script_manage_params.product_attribute_custom_text_title : '';
4102var script_manage_params_pca = typeof script_manage_params.pca !== 'undefined' ? script_manage_params.pca : '';
4103var script_manage_params_mca = typeof script_manage_params.mca !== 'undefined' ? script_manage_params.mca : '';
4104var script_manage_params_pp = typeof script_manage_params.pp !== 'undefined' ? script_manage_params.pp : '';
4105var script_manage_params_paop = typeof script_manage_params.paop !== 'undefined' ? script_manage_params.paop == 'true' : '';
4106var script_manage_params_pprice = typeof script_manage_params.pprice !== 'undefined' ? script_manage_params.pprice == 'true' : '';
4107var script_manage_params_pasgp = typeof script_manage_params.pasgp !== 'undefined' ? script_manage_params.pasgp == 'true' : '';
4108var script_manage_params_pass = typeof script_manage_params.pass !== 'undefined' ? script_manage_params.pass == 'true' : '';
4109var script_manage_params_aslt = typeof script_manage_params.aslt !== 'undefined' ? script_manage_params.aslt : '';
4110var script_manage_params_cla = typeof script_manage_params.cla !== 'undefined' ? script_manage_params.cla : '';
4111var script_manage_params_sfpfel = typeof script_manage_params.sfpfel !== 'undefined' ? script_manage_params.sfpfel : '';
4112var script_manage_params_pl = typeof script_manage_params.pl !== 'undefined' ? script_manage_params.pl : '';
4113var script_manage_params_jcsl_fb = typeof script_manage_params.jcsl_fb !== 'undefined' ? script_manage_params.jcsl_fb : '';
4114var script_manage_params_jcsl_jqac = typeof script_manage_params.jcsl_jqac !== 'undefined' ? script_manage_params.jcsl_jqac : '';
4115var script_manage_params_pc = typeof script_manage_params.pc !== 'undefined' ? script_manage_params.pc : '';
4116var script_manage_params_r05 = typeof script_manage_params.r05 !== 'undefined' ? script_manage_params.r05 : '';
4117var script_manage_params_r1 = typeof script_manage_params.r1 !== 'undefined' ? script_manage_params.r1 : '';
4118var script_manage_params_r24 = typeof script_manage_params.r24 !== 'undefined' ? script_manage_params.r24 : '';
4119var script_manage_params_sspascshop_b = typeof script_manage_params.sspascshop_b !== 'undefined' ? script_manage_params.sspascshop_b : '';
4120var script_manage_params_sspascsites_b = typeof script_manage_params.sspascsites_b !== 'undefined' ? script_manage_params.sspascsites_b : '';
4121var script_manage_params_sspascsites = typeof script_manage_params.sspascsites !== 'undefined' ? script_manage_params.sspascsites : '';
4122var script_manage_params_aws_security_level = typeof script_manage_params.aws_security_level !== 'undefined' ? script_manage_params.aws_security_level : 'x';
4123var script_manage_params_js_server_ip = typeof script_manage_params.js_server_ip !== 'undefined' ? script_manage_params.js_server_ip : '';
4124var script_manage_params_paaf = typeof script_manage_params.paaf !== 'undefined' ? script_manage_params.paaf : ''; //product atribute available from
4125var script_manage_params_gdir = typeof script_manage_params.gdir !== 'undefined' ? script_manage_params.gdir : [];
4126
4127if (script_manage_params_jcsl_jq) {
4128	$jQ = jQuery.noConflict();
4129}
4130
4131if (js_aws_security_level == null || typeof(js_aws_security_level) === 'undefined') var js_aws_security_level = script_manage_params.aws_security_level;
4132if (js_server_ip == null || typeof(js_server_ip) != 'string' || js_server_ip.trim() == '') var js_server_ip = script_manage_params.js_server_ip;
4133
4134if (script_manage_params_jcsl_g) {
4135	if (typeof(js_global_live_site) === 'undefined') var js_global_live_site = script_manage_params_ls;
4136	if (typeof(js_global_skvelyweb_site) === 'undefined') var js_global_skvelyweb_site = script_manage_params_sws;
4137	if (typeof(js_global_live_site_sef) === 'undefined') js_global_live_site_sef = script_manage_params_lss;
4138	if (typeof(js_global_cache_site) === 'undefined') js_global_cache_site = script_manage_params_cs;
4139	if (typeof(js_global_is_csu) === 'undefined') var js_global_is_csu = script_manage_params_csu;
4140	if (typeof(js_global_is_admin) === 'undefined') var js_global_is_admin = script_manage_params_is_admin;
4141	if (typeof(js_global_js_categories) === 'undefined') var js_global_js_categories = script_manage_params_jsc;
4142	if (typeof(js_global_is_csip) === 'undefined') js_global_is_csip = script_manage_params_csu_ip;
4143	if (typeof(js_global_is_devu) === 'undefined') js_global_is_devu = script_manage_params_du;
4144	if (typeof(js_global_user_shgid) === 'undefined') js_global_user_shgid = script_manage_params_myshgid;
4145	if (typeof(js_global_is_store_vat_payer) === 'undefined') js_global_is_store_vat_payer = script_manage_params_svp;
4146
4147	if (typeof(js_global_product_attribute_matrix_enabled) === 'undefined') js_global_product_attribute_matrix_enabled = script_manage_params_pame;
4148	if (typeof(js_global_product_attribute_matrix_in_stock_forced) === 'undefined') js_global_product_attribute_matrix_in_stock_forced = script_manage_params_pamsf;
4149	if (typeof(js_global_new_product_forced_stock_value) === 'undefined') js_global_new_product_forced_stock_value = script_manage_params_npfsv;
4150	if (typeof(js_global_main_domain) === 'undefined') js_global_main_domain = ( script_manage_params_madom !== '' ? script_manage_params_madom : '' );
4151
4152	if ( script_manage_params_ismyid ) {
4153
4154		if (typeof(js_global_user_info) === 'undefined') js_global_user_info = {};
4155
4156		if ( script_manage_params_mynm != '' ) {
4157			if (typeof(js_global_user_info.name) === 'undefined') js_global_user_info.name = script_manage_params_mynm;
4158		}
4159
4160		if ( script_manage_params_myem != '' ) {
4161			if (typeof(js_global_user_info.email) === 'undefined') js_global_user_info.email = script_manage_params_myem;
4162		}
4163
4164		if ( script_manage_params_mygid != '' ) {
4165			if (typeof(js_global_user_info.gid) === 'undefined') js_global_user_info.gid = script_manage_params_mygid;
4166		}
4167
4168		// JAN user credit info
4169		if ( script_manage_params_ucri != '' ) {
4170			if (typeof(js_global_user_info.ucri) === 'undefined') js_global_user_info.ucri = script_manage_params_ucri;
4171		}
4172	}
4173
4174	if ( script_manage_params_sspuefri ) {
4175
4176		if (typeof(js_global_ssp_user_info) === 'undefined') js_global_ssp_user_info = {};
4177
4178		if ( script_manage_params_sspuefrit != '' ) {
4179			if (typeof(js_global_ssp_user_info.package_type) === 'undefined') js_global_ssp_user_info.package_type = script_manage_params_sspuefrit;
4180		}
4181	}
4182	if (script_manage_params_gl != '')	if (typeof(js_get_lang) === 'undefined') js_get_lang = script_manage_params_gl;
4183	if (typeof(js_curr_lang) === 'undefined') js_curr_lang  = script_manage_params_cl;
4184	if (typeof(jf_enabled) === 'undefined') jf_enabled  = script_manage_params_jfe;
4185
4186	if (typeof(jf_langs) === 'undefined') jf_langs  = typeof script_manage_params_jfl === 'string' ? JSON.parse(script_manage_params_jfl) : script_manage_params_jfl;
4187	if (jf_langs === null) jf_langs = [];
4188
4189	if (typeof(jf_langs_id) === 'undefined') jf_langs_id  = typeof script_manage_params_jflid === 'string' ? JSON.parse(script_manage_params_jflid) : script_manage_params_jflid;
4190	if (typeof(jf_curr_flag) === 'undefined') jf_curr_flag  = script_manage_params_c_f;
4191
4192	if (typeof(jf_flags) === 'undefined') jf_flags  = typeof script_manage_params_j_f === 'string' ? JSON.parse(script_manage_params_j_f) : script_manage_params_j_f;
4193	if (jf_flags === null) jf_flags = [];
4194
4195	if (typeof(js_category_id) === 'undefined') js_category_id = script_manage_params_rqcid;
4196	if (typeof(js_prod_tabs) === 'undefined') js_prod_tabs = script_manage_params_ptab;
4197	if (typeof(js_prod_attr_img) === 'undefined') js_prod_attr_img = script_manage_params_paimg;
4198	if (typeof(js_prod_attr_active_img) === 'undefined') js_prod_attr_active_img = script_manage_params_paaimg;
4199	//if (typeof(js_prod_attr_ean) === 'undefined') js_prod_attr_ean = true;
4200	if (typeof(js_prod_attr_ean) === 'undefined') js_prod_attr_ean = script_manage_params_paean;
4201	if (typeof(js_prod_attr_vdom) === 'undefined') js_prod_attr_vdom = script_manage_params_pavdom;
4202	if (typeof(js_prod_attr_weight) === 'undefined') js_prod_attr_weight = script_manage_params_paw;
4203	if (typeof(js_prod_attr_sid) === 'undefined') js_prod_attr_sid = script_manage_params_pasid;
4204	if (typeof(js_prod_attr_sid_filter) === 'undefined') js_prod_attr_sid_filter = script_manage_params_pasidftr;
4205	if (typeof(js_prod_attr_vdate) === 'undefined') js_prod_attr_vdate = script_manage_params_vdate;
4206	if (typeof(js_prod_attr_check_fill) === 'undefined') js_prod_attr_check_fill = script_manage_params_attcfill;
4207	if (typeof(js_prod_size_table_dir) === 'undefined') js_prod_size_table_dir = script_manage_params_pst;
4208	if (typeof(js_prod_attr_available_from) === 'undefined') js_prod_attr_available_from = script_manage_params_paaf;
4209	if (typeof(js_gdir_list) === 'undefined') js_gdir_list = script_manage_params_gdir;
4210
4211	if (typeof(js_prod_attr_mq) === 'undefined') {
4212		js_prod_attr_mq = script_manage_params_pamq;
4213	}
4214
4215	var js_product_attribute_custom_text_tmp = 0;
4216
4217	if ( typeof script_manage_params_pact === 'number' && script_manage_params_pact > 0 ) {
4218		js_product_attribute_custom_text_tmp = script_manage_params_pact;
4219	}
4220
4221	if (typeof(js_product_attribute_custom_text) === 'undefined') {
4222		js_product_attribute_custom_text = js_product_attribute_custom_text_tmp;
4223	}
4224	delete js_product_attribute_custom_text_tmp;
4225
4226
4227	var js_product_attribute_custom_text_title_tmp = 0;
4228
4229	if ( script_manage_params_product_attribute_custom_text_title.length > 1) {
4230		js_product_attribute_custom_text_title_tmp = script_manage_params_product_attribute_custom_text_title;
4231	}
4232
4233	if (typeof(js_product_attribute_custom_text_title) == 'undefined') {
4234		js_product_attribute_custom_text_title = js_product_attribute_custom_text_title_tmp;
4235	}
4236	delete js_product_attribute_custom_text_title_tmp;
4237
4238	if (typeof (js_product_categ_list_parent_categ_autoselect) === 'undefined') {
4239		js_product_categ_list_parent_categ_autoselect = script_manage_params_pca;
4240	}
4241	if (typeof (js_product_manu_to_categ_list_autoselect_id) === 'undefined') {
4242		js_product_manu_to_categ_list_autoselect_id = script_manage_params_mca;
4243	}
4244	if (typeof (js_product_params_enabled) === 'undefined') {
4245		js_product_params_enabled = script_manage_params_pp;
4246	}
4247	if (typeof (js_header_edit_img_forced) === 'undefined') {
4248		js_header_edit_img_forced = '0';
4249	}
4250	if (typeof (js_prod_attr_old_price) === 'undefined') {
4251		js_prod_attr_old_price = script_manage_params_paop;
4252	}
4253	if (typeof (js_prod_attr_purchase_price) === 'undefined') {
4254		js_prod_attr_purchase_price = script_manage_params_pprice;
4255	}
4256	if (typeof (js_prod_attr_sgp) === 'undefined') {
4257		js_prod_attr_sgp = script_manage_params_pasgp;
4258	}
4259	if (typeof (js_prod_attr_ss) === 'undefined') {
4260		js_prod_attr_ss = script_manage_params_pass;
4261	}
4262	if (typeof script_manage_params_aslt !== 'undefined') { /* admin session life time */
4263		if (typeof (js_admin_sess_lt) === 'undefined') js_admin_sess_lt = 43200;
4264	}
4265
4266	/* pexf + param filter */
4267	if (typeof script_manage_params_cla !== 'undefined') {
4268		if (typeof (js_custom_page_limit) === 'undefined') js_custom_page_limit = script_manage_params_cla;
4269	}
4270	if (typeof script_manage_params_sfpfel !== 'undefined') {
4271		if (typeof (js_filter_param_from_url) === 'undefined') js_filter_param_from_url = script_manage_params_sfpfel;
4272	}
4273	if (typeof script_manage_params_pl !== 'undefined') {
4274		if (typeof (js_filter_pagination_enabled) === 'undefined') js_filter_pagination_enabled = script_manage_params_pl;
4275	}
4276	/* \\ pexf + param filter */
4277}
4278
4279if ( typeof script_manage_params_jcsl_fb !== 'undefined' && script_manage_params_jcsl_fb ) {
4280	_JS_LNG_PROMPT_CLOSE = script_manage_params_pc;
4281}
4282
4283if ( typeof script_manage_params_jcsl_jqac !== 'undefined' && script_manage_params_jcsl_jqac ) {
4284	js_global_adminlang_results_0_5 = script_manage_params_r05;
4285	js_global_adminlang_results_1 = script_manage_params_r1;
4286	js_global_adminlang_results_2_4 = script_manage_params_r24;
4287}
4288
4289var countryISOMapping = {
4290	AFG: "AF",
4291	ALA: "AX",
4292	ALB: "AL",
4293	DZA: "DZ",
4294	ASM: "AS",
4295	AND: "AD",
4296	AGO: "AO",
4297	AIA: "AI",
4298	ATA: "AQ",
4299	ATG: "AG",
4300	ARG: "AR",
4301	ARM: "AM",
4302	ABW: "AW",
4303	AUS: "AU",
4304	AUT: "AT",
4305	AZE: "AZ",
4306	BHS: "BS",
4307	BHR: "BH",
4308	BGD: "BD",
4309	BRB: "BB",
4310	BLR: "BY",
4311	BEL: "BE",
4312	BLZ: "BZ",
4313	BEN: "BJ",
4314	BMU: "BM",
4315	BTN: "BT",
4316	BOL: "BO",
4317	BIH: "BA",
4318	BWA: "BW",
4319	BVT: "BV",
4320	BRA: "BR",
4321	VGB: "VG",
4322	IOT: "IO",
4323	BRN: "BN",
4324	BGR: "BG",
4325	BFA: "BF",
4326	BDI: "BI",
4327	KHM: "KH",
4328	CMR: "CM",
4329	CAN: "CA",
4330	CPV: "CV",
4331	CYM: "KY",
4332	CAF: "CF",
4333	TCD: "TD",
4334	CHL: "CL",
4335	CHN: "CN",
4336	HKG: "HK",
4337	MAC: "MO",
4338	CXR: "CX",
4339	CCK: "CC",
4340	COL: "CO",
4341	COM: "KM",
4342	COG: "CG",
4343	COD: "CD",
4344	COK: "CK",
4345	CRI: "CR",
4346	CIV: "CI",
4347	HRV: "HR",
4348	CUB: "CU",
4349	CYP: "CY",
4350	CZE: "CZ",
4351	DNK: "DK",
4352	DJI: "DJ",
4353	DMA: "DM",
4354	DOM: "DO",
4355	ECU: "EC",
4356	EGY: "EG",
4357	SLV: "SV",
4358	GNQ: "GQ",
4359	ERI: "ER",
4360	EST: "EE",
4361	ETH: "ET",
4362	FLK: "FK",
4363	FRO: "FO",
4364	FJI: "FJ",
4365	FIN: "FI",
4366	FRA: "FR",
4367	GUF: "GF",
4368	PYF: "PF",
4369	ATF: "TF",
4370	GAB: "GA",
4371	GMB: "GM",
4372	GEO: "GE",
4373	DEU: "DE",
4374	GHA: "GH",
4375	GIB: "GI",
4376	GRC: "GR",
4377	GRL: "GL",
4378	GRD: "GD",
4379	GLP: "GP",
4380	GUM: "GU",
4381	GTM: "GT",
4382	GGY: "GG",
4383	GIN: "GN",
4384	GNB: "GW",
4385	GUY: "GY",
4386	HTI: "HT",
4387	HMD: "HM",
4388	VAT: "VA",
4389	HND: "HN",
4390	HUN: "HU",
4391	ISL: "IS",
4392	IND: "IN",
4393	IDN: "ID",
4394	IRN: "IR",
4395	IRQ: "IQ",
4396	IRL: "IE",
4397	IMN: "IM",
4398	ISR: "IL",
4399	ITA: "IT",
4400	JAM: "JM",
4401	JPN: "JP",
4402	JEY: "JE",
4403	JOR: "JO",
4404	KAZ: "KZ",
4405	KEN: "KE",
4406	KIR: "KI",
4407	PRK: "KP",
4408	KOR: "KR",
4409	KWT: "KW",
4410	KGZ: "KG",
4411	LAO: "LA",
4412	LVA: "LV",
4413	LBN: "LB",
4414	LSO: "LS",
4415	LBR: "LR",
4416	LBY: "LY",
4417	LIE: "LI",
4418	LTU: "LT",
4419	LUX: "LU",
4420	MKD: "MK",
4421	MDG: "MG",
4422	MWI: "MW",
4423	MYS: "MY",
4424	MDV: "MV",
4425	MLI: "ML",
4426	MLT: "MT",
4427	MHL: "MH",
4428	MTQ: "MQ",
4429	MRT: "MR",
4430	MUS: "MU",
4431	MYT: "YT",
4432	MEX: "MX",
4433	FSM: "FM",
4434	MDA: "MD",
4435	MCO: "MC",
4436	MNG: "MN",
4437	MNE: "ME",
4438	MSR: "MS",
4439	MAR: "MA",
4440	MOZ: "MZ",
4441	MMR: "MM",
4442	NAM: "NA",
4443	NRU: "NR",
4444	NPL: "NP",
4445	NLD: "NL",
4446	ANT: "AN",
4447	NCL: "NC",
4448	NZL: "NZ",
4449	NIC: "NI",
4450	NER: "NE",
4451	NGA: "NG",
4452	NIU: "NU",
4453	NFK: "NF",
4454	MNP: "MP",
4455	NOR: "NO",
4456	OMN: "OM",
4457	PAK: "PK",
4458	PLW: "PW",
4459	PSE: "PS",
4460	PAN: "PA",
4461	PNG: "PG",
4462	PRY: "PY",
4463	PER: "PE",
4464	PHL: "PH",
4465	PCN: "PN",
4466	POL: "PL",
4467	PRT: "PT",
4468	PRI: "PR",
4469	QAT: "QA",
4470	REU: "RE",
4471	ROU: "RO",
4472	ROM: "RO",
4473	RUS: "RU",
4474	RWA: "RW",
4475	BLM: "BL",
4476	SHN: "SH",
4477	KNA: "KN",
4478	LCA: "LC",
4479	MAF: "MF",
4480	SPM: "PM",
4481	VCT: "VC",
4482	WSM: "WS",
4483	SMR: "SM",
4484	STP: "ST",
4485	SAU: "SA",
4486	SEN: "SN",
4487	SRB: "RS",
4488	SYC: "SC",
4489	SLE: "SL",
4490	SGP: "SG",
4491	SVK: "SK",
4492	SVN: "SI",
4493	SLB: "SB",
4494	SOM: "SO",
4495	ZAF: "ZA",
4496	SGS: "GS",
4497	SSD: "SS",
4498	ESP: "ES",
4499	LKA: "LK",
4500	SDN: "SD",
4501	SUR: "SR",
4502	SJM: "SJ",
4503	SWZ: "SZ",
4504	SWE: "SE",
4505	CHE: "CH",
4506	SYR: "SY",
4507	TWN: "TW",
4508	TJK: "TJ",
4509	TZA: "TZ",
4510	THA: "TH",
4511	TLS: "TL",
4512	TGO: "TG",
4513	TKL: "TK",
4514	TON: "TO",
4515	TTO: "TT",
4516	TUN: "TN",
4517	TUR: "TR",
4518	TKM: "TM",
4519	TCA: "TC",
4520	TUV: "TV",
4521	UGA: "UG",
4522	UKR: "UA",
4523	ARE: "AE",
4524	GBR: "GB",
4525	USA: "US",
4526	UMI: "UM",
4527	URY: "UY",
4528	UZB: "UZ",
4529	VUT: "VU",
4530	VEN: "VE",
4531	VNM: "VN",
4532	VIR: "VI",
4533	WLF: "WF",
4534	ESH: "EH",
4535	YEM: "YE",
4536	ZMB: "ZM",
4537	ZWE: "ZW",
4538	OTH: "OT",
4539	HOL: "HO",
4540	IRS: "IR",
4541	LIT: "LI",
4542	POR: "PO",
4543	PLN: "PL"
4544};
4545
4546
4547/* ========================================
4548 FILE: /includes/js/system/FormValidator.js
4549 ==================== */
4550
4551/**
4552 * Validator na formy pisane cez divField v material designe
4553 * - required inputy su validovane automaticky
4554 * - pre custom validaciu a pridanie pravidiel je potrebne pouzit addRule
4555 *
4556 * @param formContainer jQuery element, v ktorom sa nachadza cely form
4557 * @returns {FormValidator}
4558 * @constructor
4559 *
4560 * @author Jakub Sakac <[email protected]>
4561 */
4562var FormValidator = function (formContainer) {
4563	this.form = jQuery(formContainer);
4564	this.inputs = this.form.find('input, select, textarea');
4565	this.rules = [];
4566
4567	return this;
4568};
4569
4570/**
4571 * Ziskanie hodnot vsetkych inputov, okrem tych disabled
4572 *
4573 * @param sanitizeInputs {boolean} ak je true, tak vrati osetrene hodnoty
4574 */
4575FormValidator.prototype.getFormValues = function(sanitizeInputs) {
4576	var formValues = {};
4577
4578	if ( sanitizeInputs ) {
4579		this.sanitize();
4580	}
4581
4582	this.inputs.not(':disabled').each(function(key, elm) {
4583		elm = jQuery(elm);
4584
4585		// ak je input radio button alebo checkbox a nie je zaskrtnuty, tak ho nepridavajme
4586		if ( (elm.is(':radio') || elm.is(':checkbox')) && !elm.prop('checked') ) {
4587			return;
4588		}
4589
4590		var elmVal = elm.val();
4591		var elmName = elm.attr('name');
4592
4593		formValues[elmName] = elmVal;
4594	});
4595
4596	return formValues;
4597};
4598
4599/**
4600 * Nabindovanie validacie na vsetky inputy po definovani vsetkych nastaveni a pridani pravidiel
4601 */
4602FormValidator.prototype.bindValidation = function() {
4603	this.inputs.not(':checkbox').on('blur change', jQuery.proxy(function(e) {
4604		this.validateInput(jQuery(e.target));
4605	}, this));
4606};
4607
4608/**
4609 * Manualna validacia formulara
4610 * je potrebne volat pri submite
4611 *
4612 * Prechadza vsetky inputy najdene v poli inputov (vytvori sa v constructe)
4613 *
4614 * @returns {boolean} vrati ci je formular validny podla definovanych pravidiel
4615 */
4616FormValidator.prototype.validate = function() {
4617	var valid = true;
4618
4619	this.inputs.not(':disabled').each(jQuery.proxy(function(key, elm) {
4620		if (!this.validateInput(elm)) valid = false;
4621	}, this));
4622
4623	return valid;
4624};
4625
4626/**
4627 * Funkcia na zvalidovanie konkretneho inputu/selectu
4628 * Interna funkcia, nie je potrebne volat vonku
4629 *
4630 * V pripade, ze pravidlo nie je pre input definovane, vrati true a 
4630input je validny
4631 *
4632 * @param elm konkretny input element
4633 * @returns {boolean} vrati ci je input validny
4634 */
4635FormValidator.prototype.validateInput = function(elm) {
4636	elm = jQuery(elm);
4637	var elmVal = elm.val();
4638	var elmName = elm.attr('name');
4639	var elmRules = this.rules[elmName];
4640	var elmIsRequired = elm.hasClass('required');
4641
4642	elm.toggleClass('filled', this.isDefined(elmVal) && elmVal != '');
4643
4644	this.removeError(elm);
4645
4646	// required field
4647	if (elmIsRequired && ( !this.isDefined(elmVal) || elmVal == '' || (config('js_Config_custom_contact_form_selects') && elm.is('select') && elm.val() === '0')) ) {
4648		if ( typeof js_Config_forgotten_password_new !== 'undefined' && js_Config_forgotten_password_new ) {
4649
4650			var labelText = elm.closest('.field').find('label').text();
4651			labelText = labelText.trim().replace(':', '');
4652
4653			if (labelText !== '') {
4654				this.addError(elm, js_lang_new_form_item + ' "' +labelText+ '" ' + js_lang_new_form_nesessery);
4655			} else {
4656				this.addError(elm, js_lang_registration_reset_password_field_required );
4657			}
4658		} else {
4659			this.addError(elm, 'Položka je povinná');
4660		}
4661
4662
4663		return false;
4664	}
4665
4666	// rules nastavene cez addRule
4667	if (this.isDefined(elmRules)) {
4668		for (var ruleName in elmRules) {
4669			if (!elmRules.hasOwnProperty(ruleName)) {
4670				continue;
4671			}
4672
4673			var rule = elmRules[ruleName];
4674
4675			if (this.isSanitizationRule(rule)) {
4676				continue;
4677			}
4678
4679			if (this.isDefined(rule.conditions) && !this.checkConditions(rule.conditions)) {
4680				elm.addClass('valid');
4681				return true;
4682			}
4683
4684			if (typeof this[ruleName] === 'function') {
4685				// zavolanie custom funkcie na overenie
4686				if ( !this[ruleName](elm, rule) ) {
4687					return false;
4688				}
4689			}
4690		}
4691	}
4692
4693	if (elmIsRequired || this.isDefined(elmRules)) {
4694		elm.addClass('valid');
4695	}
4696
4697	return true;
4698};
4699
4700/**
4701 * Satinizacia/osetrenie hodnot formulara
4702 * bud sa musi zavolat manualne alebo pri ziskani vsektych hodnot v getFormValues
4703 *
4704 * Prechadza vsetky inputy najdene v poli inputov (vytvori sa v constructe)
4705 */
4706FormValidator.prototype.sanitize = function() {
4707	this.inputs.not(':disabled').each(jQuery.proxy(function(key, elm) {
4708		this.sanitizeInput(elm);
4709	}, this));
4710};
4711
4712/**
4713 * Funkcia na sanitizaciu/osetrenie konkretneho inputu
4714 *
4715 * V pripade, ze custom pravidlo nie je pre input definovane, vrati trimnutu hodnotu
4716 *
4717 * @param elm
4718 * @returns {string}
4719 */
4720FormValidator.prototype.sanitizeInput = function(elm) {
4721	elm = jQuery(elm);
4722	var elmVal = elm.val();
4723	var elmName = elm.attr('name');
4724	var elmRules = this.rules[elmName];
4725
4726	var trimmedVal = elmVal.trim();
4727
4728	// rules nastavene cez addRule
4729	if (this.isDefined(elmRules)) {
4730		trimmedVal = Object.keys(elmRules).reduce(jQuery.proxy(function(inputVal, ruleName) {
4731			var rule = elmRules[ruleName];
4732
4733			if (!this.isSanitizationRule(rule)) {
4734				return inputVal;
4735			}
4736
4737			return this[ruleName](elm, rule, inputVal);
4738		}, this), trimmedVal);
4739	}
4740
4741	elm.val(trimmedVal);
4742	return trimmedVal;
4743};
4744
4745/**
4746 * Sluzi na overenie podmienok, ktore urcuju, ci sa ma validacia inputu vykonat - vo validateInput
4747 *
4748 * V pripade, ak niektory z inputov nema platnu value (podla pola),
4749 * podmienka nepresla a pravidlo na ktore je naviazana sa nebude overovat (input bude validny)
4750 *
4751 * @param {Object.<string, Array>} conditions objekt, v ktorom su ako kluce nazvy inputov (atribut name) a ako value pole hodnot moznych pre tento input
4752 * @returns {boolean}
4753 */
4754FormValidator.prototype.checkConditions = function(conditions) {
4755	var valid = true;
4756
4757	for (var elmName in conditions) {
4758		if (!conditions.hasOwnProperty(elmName)) {
4759			continue;
4760		}
4761
4762		var elm = this.inputs.filter('[name="' + elmName + '"]');
4763
4764		if (elm.length) {
4765			var elmVal = elm.val();
4766
4767			if (typeof conditions[elmName] == 'object' && conditions[elmName].indexOf(elmVal) == -1) {
4768				valid = false;
4769			}
4770		}
4771	}
4772
4773	return valid;
4774};
4775
4776/**
4777 * Pridanie pravidla validacie do zoznamu pravidiel
4778 *
4779 *
4780 * @param inputName nazov inputu vo forme
4781 * @param rule custom metoda overovania - metody su definovane dole v classe
4782 * @param value kontrolovana hodnota
4783 * @param message chybova hlaska v pripade, ze input neprejde validaciou
4784 * @param conditions podmienka, ak jej vysledok je true, input sa zvaliduje, inac nie
4785 * @param sanitizationRule {boolean} kontrola, ci sa jedna o validacne alebo sanitizacne pravidlo
4786 * @returns {FormValidator}
4787 */
4788FormValidator.prototype.addRule = function(inputName, rule, value, message, conditions, sanitizationRule) {
4789	if (!this.isDefined(this.rules[inputName])) {
4790		this.rules[inputName] = [];
4791	}
4792
4793	this.rules[inputName][rule] = [];
4794	this.rules[inputName][rule].value = value;
4795
4796	if (this.isDefined(sanitizationRule)) {
4797		this.rules[inputName][rule].sanitizationRule = sanitizationRule;
4798	}
4799
4800	if (this.isDefined(message)) {
4801		this.rules[inputName][rule].message = message;
4802	}
4803
4804	if (this.isDefined(conditions)) {
4805		this.rules[inputName][rule].conditions = conditions;
4806	}
4807
4808	return this;
4809};
4810
4811/**
4812 * Vykreslenie chyby v pripade nevalidneho inputu
4813 *
4814 * @param elm
4815 * @param message
4816 */
4817FormValidator.prototype.addError = function(elm, message) {
4818	var $wrapper = elm.closest('.field');
4819
4820	this.removeError(elm);
4821
4822	$wrapper.append('<div class="error_box">' + message + "</div>");
4823	elm.addClass('error');
4824	elm.removeClass('valid');
4825};
4826
4827/**
4828 * Odstranenie chyby v pripade, ze input je validny
4829 *
4830 * @param elm
4831 */
4832FormValidator.prototype.removeError = function(elm) {
4833	var $wrapper = elm.closest('.field');
4834
4835	$wrapper.find('.error_box').remove();
4836	elm.removeClass('error');
4837};
4838
4839/**
4840 * @param variable kontrolovana premenna
4841 * @returns {boolean} premenna existuje
4842 */
4843FormValidator.prototype.isDefined = function(variable) {
4844	return typeof variable !== 'undefined';
4845};
4846
4847/**
4848 *
4849 * @param rule kontrolovane pravidlo
4850 * @returns {boolean} nie je validacne pravidlo, ale sanitizacne
4851 */
4852FormValidator.prototype.isSanitizationRule = function(rule) {
4853	return typeof rule.sanitizationRule !== 'undefined' && rule.sanitizationRule ;
4854};
4855
4856/*********************************
4857 ** CUSTOM VALIDACNE PRAVIDLA PRE addRule **
4858 ********************************/
4859
4860/**
4861 * Regex validacia
4862 *
4863 * @param elm
4864 * @param rule
4865 * @returns {boolean}
4866 */
4867FormValidator.prototype.regexMatch = function(elm, rule) {
4868	if (!this.isDefined(rule.value)) {
4869		return false;
4870	}
4871
4872	var valid = elm.val().match(rule.value) != null;
4873	var message = this.isDefined(rule.message) ? rule.message : 'Hodnota nie je v správnom formáte';
4874
4875	if (!valid) {
4876		this.addError(elm, message);
4877		return false;
4878	}
4879
4880	return true;
4881};
4882
4883FormValidator.prototype.allowedChars = function(elm, rule) {
4884	if (!this.isDefined(rule.value)) {
4885		return false;
4886	}
4887
4888	var valid = elm.val().match(rule.value) != null;
4889	var message = this.isDefined(rule.message) ? rule.message : 'Obsahuje nepovolené znaky';
4890
4891	if (!valid) {
4892		this.addError(elm, message);
4893		return false;
4894	}
4895
4896	return true;
4897};
4898
4899FormValidator.prototype.minLength = function(elm, rule) {
4900	if (!this.isDefined(rule.value)) {
4901		return false;
4902	}
4903
4904	var valid = elm.val().length >= rule.value;
4905	var message = this.isDefined(rule.message) ? rule.message : 'Min. počet znakov: ' + rule.value;
4906
4907	if (!valid) {
4908		this.addError(elm, message);
4909		return false;
4910	}
4911
4912	return true;
4913};
4914
4915FormValidator.prototype.maxLength = function(elm, rule) {
4916	if (!this.isDefined(rule.value)) {
4917		return false;
4918	}
4919
4920	var valid = elm.val().length <= rule.value;
4921	var message = this.isDefined(rule.message) ? rule.message : 'Max. počet znakov: ' + rule.value;
4922
4923	if (!valid) {
4924		this.addError(elm, message);
4925		return false;
4926	}
4927
4928	return true;
4929};
4930
4931FormValidator.prototype.min = function(elm, rule) {
4932	if (!this.isDefined(rule.value)) {
4933		return false;
4934	}
4935
4936	if (isNaN(elm.val()) || isNaN(rule.value)) {
4937		this.addError(elm, 'Hodnota musí byť číslo');
4938		return false;
4939	}
4940
4941	var valid = elm.val() >= rule.value;
4942	var message = this.isDefined(rule.message) ? rule.message : 'Min. hodnota: ' + rule.value;
4943
4944	if (!valid) {
4945		this.addError(elm, message);
4946		return false;
4947	}
4948
4949	return true;
4950};
4951
4952FormValidator.prototype.max = function(elm, rule) {
4953	if (!this.isDefined(rule.value)) {
4954		return false;
4955	}
4956
4957	if (isNaN(elm.val()) || isNaN(rule.value)) {
4958		this.addError(elm, 'Hodnota musí byť číslo');
4959		return false;
4960	}
4961
4962	var valid = elm.val() <= rule.value;
4963	var message = this.isDefined(rule.message) ? rule.message : 'Max. hodnota: ' + rule.value;
4964
4965	if (!valid) {
4966		this.addError(elm, message);
4967		return false;
4968	}
4969
4970	return true;
4971};
4972
4973FormValidator.prototype.enum = function(elm, rule) {
4974	if (!this.isDefined(rule.value) || !(rule.value instanceof Array)) {
4975		return false;
4976	}
4977
4978	var valid = rule.value.indexOf(elm.val()) !== -1;
4979	var message = this.isDefined(rule.message) ? rule.message : 'Hodnota nie je v správnom formáte';
4980
4981	if (!valid) {
4982		this.addError(elm, message);
4983		return false;
4984	}
4985
4986	return true;
4987};
4988
4989FormValidator.prototype.isEmail = function(elm, rule) {
4990	if (!this.isDefined(rule.value)) {
4991		return false;
4992	}
4993
4994	var emailAddress = elm.val();
4995
4996	var valid = emailAddress.match(/[\w.\-]+@\w+[\w.\-]*?\.\w{1,4}/) != null;
4997	var message = this.isDefined(rule.message) ? rule.message : 'Nesprávny tvar e-mailovej adresy: "' + emailAddress + '"';
4998
4999	if (!valid) {
5000		this.addError(elm, message);
5001		return false;
5002	}
5003
5004	return true;
5005};
5006
5007FormValidator.prototype.isNumber = function(elm, rule) {
5008	if (!this.isDefined(rule.value)) {
5009		return false;
5010	}
5011
5012	var valid = !isNaN(elm.val());
5013	var message = this.isDefined(rule.message) ? rule.message : 'Hodnota musí byť číslo';
5014
5015	if (!valid) {
5016		this.addError(elm, message);
5017		return false;
5018	}
5019
5020	return true;
5021};
5022
5023FormValidator.prototype.isEqualTo = function(elm, rule) {
5024	if (!this.isDefined(rule.value)) {
5025		return false;
5026	}
5027
5028	var checkAgainstInput = this.form.find('[name="' + rule.value + '"]');
5029
5030	var valid = elm.val() === checkAgainstInput.val();
5031	var message = this.isDefined(rule.message) ? rule.message : 'Hodnoty sa nezhodujú';
5032
5033	if (!valid) {
5034		this.addError(elm, message);
5035		return false;
5036	}
5037
5038	return true;
5039};
5040
5041FormValidator.prototype.isChecked = function(elm, rule) {
5042	if (!elm.prop('checked')) {
5043		var message = this.isDefined(rule.message) ? rule.message : 'Položka je povinná';
5044		this.addError(elm, message);
5045		return false;
5046	}
5047
5048	return true;
5049};
5050
5051FormValidator.prototype.isBarcode = function(elm, rule) {
5052	var barcode = elm.val();
5053	var message = this.isDefined(rule.message) ? rule.message : 'Kód klubovej karty nie je platný';
5054
5055	// check length
5056	if (barcode.length < 8 || barcode.length > 18 ||
5057		(barcode.length != 8 && barcode.length != 12 &&
5058			barcode.length != 13 && barcode.length != 14 &&
5059			barcode.length != 18)) {
5060		this.addError(elm, message);
5061		return false;
5062	}
5063
5064	var lastDigit = Number(barcode.substring(barcode.length - 1));
5065	var checkSum = 0;
5066	if (isNaN(lastDigit)) {
5067		this.addError(elm, message);
5068		return false;
5069	} // not a valid upc/ean
5070
5071	var arr = barcode.substring(0,barcode.length - 1).split("").reverse();
5072	var oddTotal = 0, evenTotal = 0;
5073
5074	for (var i=0; i<arr.length; i++) {
5075		if (isNaN(arr[i])) {
5076			this.addError(elm, message);
5077			return false;
5078		} // can't be a valid upc/ean we're checking for
5079
5080		if (i % 2 == 0) { oddTotal += Number(arr[i]) * 3; }
5081		else { evenTotal += Number(arr[i]); }
5082	}
5083	checkSum = (10 - ((evenTotal + oddTotal) % 10)) % 10;
5084
5085	// true if they are equal
5086	if (checkSum != lastDigit) {
5087		this.addError(elm, message);
5088		return false;
5089	}
5090
5091	return true;
5092};
5093
5094FormValidator.prototype.isZipCode = function(elm, rule) {
5095	// TODO
5096};
5097
5098/**
5099 *  DEPRECATED ↓
5100 */
5101
5102/**
5103 * Validacia checkboxu
5104 *
5105 * @param elm
5106 * @param rule
5107 * @returns {boolean}
5108 */
5109FormValidator.prototype.validateCheckbox = function(elm, rule) {
5110	if (!elm.prop('checked')) {
5111		var message = this.isDefined(rule.message) ? rule.message : 'Položka je povinná';
5112		this.addError(elm, message);
5113		return false;
5114	}
5115
5116	return true;
5117};
5118
5119/**
5120 * Validacia dlzky hodnoty
5121 *
5122 * @param elm
5123 * @param rule
5124 * @returns {boolean}
5125 */
5126FormValidator.prototype.validateLength = function(elm, rule) {
5127	if (!this.isDefined(rule.value)) {
5128		return false;
5129	}
5130
5131	var requiredLength = rule.value;
5132
5133	if ( elm.val().trim().length < requiredLength ) {
5134		var message = this.isDefined(rule.message) ? rule.message : 'Minimálne ' + requiredLength + ' znakov';
5135		this.addError(elm, message);
5136		return false;
5137	}
5138
5139	return true;
5140};
5141
5142/**
5143 * Porovnanie hodnot dvoch inputov
5144 *
5145 * rule.value musi byt jQuery Object
5146 *
5147 * @param elm
5148 * @param rule
5149 * @returns {boolean}
5150 */
5151FormValidator.prototype.compareInputValues = function(elm, rule) {
5152	if (!this.isDefined(rule.value) || !rule.value.length) {
5153		return false;
5154	}
5155
5156	var firstValue = elm.val().trim();
5157	var secondValue = rule.value.val().trim();
5158
5159	if ( firstValue !== secondValue ) {
5160		var message = this.isDefined(rule.message) ? rule.message : 'Hodnoty sa nezhodujú';
5161		this.addError(elm, message);
5162		return false;
5163	}
5164
5165	return true;
5166};
5167
5168/**
5169 * @param elm
5170 * @param {string} value
5171 * @param {object} rule
5172 * @returns {boolean}
5173 */
5174FormValidator.prototype.validateDate = function(elm, rule) {
5175	if (!this.isDefined(rule) || Object.keys(rule).length === 0) {
5176		return false;
5177	}
5178
5179	let message = this.isDefined(rule.message) ? rule.message : 'Neplatný formát dátumu';
5180	let date;
5181
5182	try {
5183		 date = jQuery.datepicker.parseDate(rule.format, elm.val().trim());
5184	} catch (e) {
5185		return false;
5186	}
5187
5188	if (!date) {
5189		return false;
5190	}
5191
5192	if (!rule.days?.includes(date.getDay())) {
5193		this.addError(elm, message);
5194		return false;
5195	}
5196
5197	if (rule.minDate && typeof rule.minDate === 'number') {
5198		const today = new Date();
5199		today.setHours(0, 0, 0, 0);
5200		today.setDate(today.getDate() + rule.minDate);
5201
5202		if (date < today) {
5203			this.addError(elm, message);
5204			return false;
5205		}
5206	}
5207
5208	return true;
5209};
5210
5211/**
5212 * Validacia klubovej karty
5213 *
5214 * @param elm
5215 * @param rule
5216 * @returns {boolean}
5217 */
5218FormValidator.prototype.validateBarcode = function(elm, rule) {
5219	var barcode = elm.val();
5220	var message = this.isDefined(rule.message) ? rule.message : 'Kód klubovej karty nie je platný';
5221
5222	// check length
5223	if (barcode.length < 8 || barcode.length > 18 ||
5224		(barcode.length != 8 && barcode.length != 12 &&
5225			barcode.length != 13 && barcode.length != 14 &&
5226			barcode.length != 18)) {
5227		this.addError(elm, message);
5228		return false;
5229	}
5230
5231	var lastDigit = Number(barcode.substring(barcode.length - 1));
5232	var checkSum = 0;
5233	if (isNaN(lastDigit)) {
5234		this.addError(elm, message);
5235		return false;
5236	} // not a valid upc/ean
5237
5238	var arr = barcode.substring(0,barcode.length - 1).split("").reverse();
5239	var oddTotal = 0, evenTotal = 0;
5240
5241	for (var i=0; i<arr.length; i++) {
5242		if (isNaN(arr[i])) {
5243			this.addError(elm, message);
5244			return false;
5245		} // can't be a valid upc/ean we're checking for
5246
5247		if (i % 2 == 0) { oddTotal += Number(arr[i]) * 3; }
5248		else { evenTotal += Number(arr[i]); }
5249	}
5250	checkSum = (10 - ((evenTotal + oddTotal) % 10)) % 10;
5251
5252	// true if they are equal
5253	if (checkSum != lastDigit) {
5254		this.addError(elm, message);
5255		return false;
5256	}
5257
5258	return true;
5259};
5260
5261/*********************************
5262 ** CUSTOM SANITIZACNE PRAVIDLA PRE addRule **
5263 ********************************/
5264
5265/**
5266 * Regex sanitizacia
5267 * rule.value musi byt object vo formate { regex: Regex, replacement: String }
5268 *
5269 * @param elm
5270 * @param rule
5271 * @param elemVal {string}
5272 * @returns {string}
5273 */
5274FormValidator.prototype.regexReplace = function(elm, rule, elemVal) {
5275	if (!this.isSanitizationRule(rule)) {
5276		return elemVal;
5277	}
5278
5279	if (
5280		!this.isDefined(rule.value)
5281		|| !this.isDefined(rule.value.pattern)
5282		|| !this.isDefined(rule.value.replacement)
5283		) {
5284		return elemVal;
5285	}
5286
5287	var pattern = new RegExp(rule.value.pattern, 'gi');
5288	var replacement = rule.value.replacement;
5289
5290	return elemVal.replace(pattern, replacement);
5291};
5292
5293
5294/* ========================================
5295 FILE: /includes/js/jquery/poshytip/jquery.poshytip.js
5296 ==================== */
5297
5298/*
5299 * Poshy Tip jQuery plugin v1.2
5300 * http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/
5301 * Copyright 2010-2013, Vasil Dinkov, http://vadikom.com/
5302 */
5303
5304(function($) {
5305
5306	var tips = [],
5307	    reBgImage = /^url\(["']?([^"'\)]*)["']?\);?$/i,
5308	    rePNG = /\.png$/i,
5309	    ie6 = !!window.createPopup && ( typeof(document.documentElement.currentStyle) == 'undefined' || typeof(document.documentElement.currentStyle.minWidth) == 'undefined' );
5310
5311	// make sure the tips' position is updated on resize
5312	function handleWindowResize() {
5313		$.each(tips, function() {
5314			this.refresh(true);
5315		});
5316	}
5317	$(window).resize(handleWindowResize);
5318
5319	$.Poshytip = function(elm, options) {
5320		this.$elm = $(elm);
5321		this.opts = $.extend({}, $.fn.poshytip.defaults, options);
5322		this.$tip = $(['<div class="',this.opts.className,'">',
5323			'<div class="tip-inner tip-bg-image"></div>',
5324			'<div class="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left"></div>',
5325			'</div>'].join('')).appendTo(document.body);
5326		this.$arrow = this.$tip.find('div.tip-arrow');
5327		this.$inner = this.$tip.find('div.tip-inner');
5328		this.disabled = false;
5329		this.content = null;
5330		this.init();
5331	};
5332
5333	$.Poshytip.prototype = {
5334		init: function() {
5335			tips.push(this);
5336
5337			// save the original title and a reference to the Poshytip object
5338			var title = this.$elm.attr('title');
5339			this.$elm.data('title.poshytip', title !== undefined ? title : null)
5340				.data('poshytip', this);
5341
5342			// hook element events
5343			if (this.opts.showOn != 'none') {
5344				this.$elm.bind({
5345					'mouseenter.poshytip': $.proxy(this.mouseenter, this),
5346					'mouseleave.poshytip': $.proxy(this.mouseleave, this)
5347				});
5348				switch (this.opts.showOn) {
5349					case 'hover':
5350						if (this.opts.alignTo == 'cursor')
5351							this.$elm.bind('mousemove.poshytip', $.proxy(this.mousemove, this));
5352						if (this.opts.allowTipHover)
5353							this.$tip.hover($.proxy(this.clearTimeouts, this), $.proxy(this.mouseleave, this));
5354						break;
5355					case 'focus':
5356						this.$elm.bind({
5357							'focus.poshytip': $.proxy(this.showDelayed, this),
5358							'blur.poshytip': $.proxy(this.hideDelayed, this)
5359						});
5360						break;
5361				}
5362			}
5363		},
5364		mouseenter: function(e) {
5365			if (this.disabled)
5366				return true;
5367
5368			this.$elm.attr('title', '');
5369			if (this.opts.showOn == 'focus')
5370				return true;
5371
5372			this.showDelayed();
5373		},
5374		mouseleave: function(e) {
5375			if (this.disabled || this.asyncAnimating && (this.$tip[0] === e.relatedTarget || jQuery.contains(this.$tip[0], e.relatedTarget)))
5376				return true;
5377
5378			if (!this.$tip.data('active')) {
5379				var title = this.$elm.data('title.poshytip');
5380				if (title !== null)
5381					this.$elm.attr('title', title);
5382			}
5383			if (this.opts.showOn == 'focus')
5384				return true;
5385
5386			this.hideDelayed();
5387		},
5388		mousemove: function(e) {
5389			if (this.disabled)
5390				return true;
5391
5392			this.eventX = e.pageX;
5393			this.eventY = e.pageY;
5394			if (this.opts.followCursor && this.$tip.data('active')) {
5395				this.calcPos();
5396				this.$tip.css({left: this.pos.l, top: this.pos.t});
5397				if (this.pos.arrow)
5398					this.$arrow[0].className = 'tip-arrow tip-arrow-' + this.pos.arrow;
5399			}
5400		},
5401		show: function() {
5402			if (this.disabled || typeof this.$tip === 'undefined' || this.$tip.data('active'))
5403				return;
5404
5405			this.reset();
5406			this.update();
5407
5408			// don't proceed if we didn't get any content in update() (e.g. the element has an empty title attribute)
5409			if (!this.content)
5410				return;
5411
5412			this.display();
5413			if (this.opts.timeOnScreen)
5414				this.hideDelayed(this.opts.timeOnScreen);
5415		},
5416		showDelayed: function(timeout) {
5417			this.clearTimeouts();
5418			this.showTimeout = setTimeout($.proxy(this.show, this), typeof timeout == 'number' ? timeout : this.opts.showTimeout);
5419		},
5420		hide: function() {
5421			if (this.disabled || typeof this.$tip === 'undefined' || !this.$tip.data('active'))
5422				return;
5423
5424			this.display(true);
5425		},
5426		hideDelayed: function(timeout) {
5427			this.clearTimeouts();
5428			this.hideTimeout = setTimeout($.proxy(this.hide, this), typeof timeout == 'number' ? timeout : this.opts.hideTimeout);
5429		},
5430		reset: function() {
5431			this.$tip.queue([]).detach().css('visibility', 'hidden').data('active', false);
5432			this.$inner.find('*').poshytip('hide');
5433			if (this.opts.fade)
5434				this.$tip.css('opacity', this.opacity);
5435			this.$arrow[0].className = 'tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left';
5436			this.asyncAnimating = false;
5437		},
5438		update: function(content, dontOverwriteOption) {
5439			if (this.disabled)
5440				return;
5441
5442			var async = content !== undefined;
5443			if (async) {
5444				if (!dontOverwriteOption)
5445					this.opts.content = content;
5446				if (!this.$tip.data('active'))
5447					return;
5448			} else {
5449				content = this.opts.content;
5450			}
5451
5452			// update content only if it has been changed since last time
5453			var self = this,
5454			    newContent = typeof content == 'function' ?
5455				    content.call(this.$elm[0], function(newContent) {
5456					    self.update(newContent);
5457				    }) :
5458				    content == '[title]' ? this.$elm.data('title.poshytip') : content;
5459			if (this.content !== newContent) {
5460				this.$inner.empty().append(newContent);
5461				this.content = newContent;
5462			}
5463
5464			this.$tip.appendTo(document.body);
5465
5466			this.refresh(async);
5467		},
5468		refresh: function(async) {
5469			if (this.disabled)
5470				return;
5471
5472			if (async) {
5473				if (!this.$tip.data('active'))
5474					return;
5475				// save current position as we will need to animate
5476				var currPos = {left: this.$tip.css('left'), top: this.$tip.css('top')};
5477			}
5478
5479			// reset position to avoid text wrapping, etc.
5480			this.$tip.css({left: 0, top: 0});
5481
5482			// save default opacity
5483			if (this.opacity === undefined)
5484				this.opacity = this.$tip.css('opacity');
5485
5486			// check for images - this code is here (i.e. executed each time we show the tip and not on init) due to some browser inconsistencies
5487			var bgImage = this.$tip.css('background-image').match(reBgImage),
5488			    arrow = this.$arrow.css('background-image').match(reBgImage);
5489
5490			if (bgImage) {
5491				var bgImagePNG = rePNG.test(bgImage[1]);
5492				// fallback to background-color/padding/border in IE6 if a PNG is used
5493				if (ie6 && bgImagePNG) {
5494					this.$tip.css('background-image', 'none');
5495					this.$inner.css({margin: 0, border: 0, padding: 0});
5496					bgImage = bgImagePNG = false;
5497				} else {
5498					this.$tip.prepend('<table class="tip-table" border="0" cellpadding="0" cellspacing="0"><tr><td class="tip-top tip-bg-image" colspan="2"><span></span></td><td class="tip-right tip-bg-image" rowspan="2"><span></span></td></tr><tr><td class="tip-left tip-bg-image" rowspan="2"><span></span></td><td></td></tr><tr><td class="tip-bottom tip-bg-image" colspan="2"><span></span></td></tr></table>')
5499						.css({border: 0, padding: 0, 'background-image': 'none', 'background-color': 'transparent'})
5500						.find('.tip-bg-image').css('background-image', 'url("' + bgImage[1] +'")').end()
5501						.find('td').eq(3).append(this.$inner);
5502				}
5503				// disable fade effect in IE due to Alpha filter + translucent PNG issue
5504				if (bgImagePNG && !$.support.opacity)
5505					this.opts.fade = false;
5506			}
5507			// IE arrow fixes
5508			if (arrow && !$.support.opacity) {
5509				// disable arrow in IE6 if using a PNG
5510				if (ie6 && rePNG.test(arrow[1])) {
5511					arrow = false;
5512					this.$arrow.css('background-image', 'none');
5513				}
5514				// disable fade effect in IE due to Alpha filter + translucent PNG issue
5515				this.opts.fade = false;
5516			}
5517
5518			var $table = this.$tip.find('> table.tip-table');
5519			if (ie6) {
5520				// fix min/max-width in IE6
5521				this.$tip[0].style.width = '';
5522				$table.width('auto').find('td').eq(3).width('auto');
5523				var tipW = this.$tip.width(),
5524				    minW = parseInt(this.$tip.css('min-width')),
5525				    maxW = parseInt(this.$tip.css('max-width'));
5526				if (!isNaN(minW) && tipW < minW)
5527					tipW = minW;
5528				else if (!isNaN(maxW) && tipW > maxW)
5529					tipW = maxW;
5530				this.$tip.add($table).width(tipW).eq(0).find('td').eq(3).width('100%');
5531			} else if ($table[0]) {
5532				// fix the table width if we are using a background image
5533				// IE9, FF4 use float numbers for width/height so use getComputedStyle for them to avoid text wrapping
5534				// for details look at: http://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/
5535				$table.width('auto').find('td').eq(3).width('auto').end().end().width(document.defaultView && document.defaultView.getComputedStyle && parseFloat(document.defaultView.getComputedStyle(this.$tip[0], null).width) || this.$tip.width()).find('td').eq(3).width('100%');
5536			}
5537			this.tipOuterW = this.$tip.outerWidth();
5538			this.tipOuterH = this.$tip.outerHeight();
5539
5540			this.calcPos();
5541
5542			// position and show the arrow image
5543			if (arrow && this.pos.arrow) {
5544				this.$arrow[0].className = 'tip-arrow tip-arrow-' + this.pos.arrow;
5545				this.$arrow.css('visibility', 'inherit');
5546			}
5547
5548			if (async && this.opts.refreshAniDuration) {
5549				this.asyncAnimating = true;
5550				var self = this;
5551				this.$tip.css(currPos).animate({left: this.pos.l, top: this.pos.t}, this.opts.refreshAniDuration, function() { self.asyncAnimating = false; });
5552			} else {
5553				this.$tip.css({left: this.pos.l, top: this.pos.t});
5554			}
5555			if (typeof this.opts.onRefresh === 'function') this.opts.onRefresh();
5556		},
5557		display: function(hide) {
5558			var active = this.$tip.data('active');
5559			if (active && !hide || !active && hide)
5560				return;
5561
5562			this.$tip.stop();
5563			if ((this.opts.slide && this.pos.arrow || this.opts.fade) && (hide && this.opts.hideAniDuration || !hide && this.opts.showAniDuration)) {
5564				var from = {}, to = {};
5565				// this.pos.arrow is only undefined when alignX == alignY == 'center' and we don't need to slide in that rare case
5566				if (this.opts.slide && this.pos.arrow) {
5567					var prop, arr;
5568					if (this.pos.arrow == 'bottom' || this.pos.arrow == 'top') {
5569						prop = 'top';
5570						arr = 'bottom';
5571					} else {
5572						prop = 'left';
5573						arr = 'right';
5574					}
5575					var val = parseInt(this.$tip.css(prop));
5576					from[prop] = val + (hide ? 0 : (this.pos.arrow == arr ? -this.opts.slideOffset : this.opts.slideOffset));
5577					to[prop] = val + (hide ? (this.pos.arrow == arr ? this.opts.slideOffset : -this.opts.slideOffset) : 0) + 'px';
5578				}
5579				if (this.opts.fade) {
5580					from.opacity = hide ? this.$tip.css('opacity') : 0;
5581					to.opacity = hide ? 0 : this.opacity;
5582				}
5583				this.$tip.css(from).animate(to, this.opts[hide ? 'hideAniDuration' : 'showAniDuration']);
5584			}
5585			hide ? this.$tip.queue($.proxy(this.reset, this)) : this.$tip.css('visibility', 'inherit');
5586			if (active) {
5587				var title = this.$elm.data('title.poshytip');
5588				if (title !== null)
5589					this.$elm.attr('title', title);
5590			}
5591			this.$tip.data('active', !active);
5592		},
5593		disable: function() {
5594			this.reset();
5595			this.disabled = true;
5596		},
5597		enable: function() {
5598			this.disabled = false;
5599		},
5600		destroy: function() {
5601			this.reset();
5602			this.$tip.remove();
5603			delete this.$tip;
5604			this.content = null;
5605			this.$elm.unbind('.poshytip').removeData('title.poshytip').removeData('poshytip');
5606			tips.splice($.inArray(this, tips), 1);
5607		},
5608		clearTimeouts: function() {
5609			if (this.showTimeout) {
5610				clearTimeout(this.showTimeout);
5611				this.showTimeout = 0;
5612			}
5613			if (this.hideTimeout) {
5614				clearTimeout(this.hideTimeout);
5615				this.hideTimeout = 0;
5616			}
5617		},
5618		calcPos: function() {
5619			var pos = {l: 0, t: 0, arrow: ''},
5620			    $win = $(window),
5621			    win = {
5622				    l: $win.scrollLeft(),
5623				    t: $win.scrollTop(),
5624				    w: $win.width(),
5625				    h: $win.height()
5626			    }, xL, xC, xR, yT, yC, yB;
5627			if (this.opts.alignTo == 'cursor') {
5628				xL = xC = xR = this.eventX;
5629				yT = yC = yB = this.eventY;
5630			} else { // this.opts.alignTo == 'target'
5631				var elmOffset = this.$elm.offset(),
5632				    elm = {
5633					    l: elmOffset.left,
5634					    t: elmOffset.top,
5635					    w: this.$elm.outerWidth(),
5636					    h: this.$elm.outerHeight()
5637				    };
5638				xL = elm.l + (this.opts.alignX != 'inner-right' ? 0 : elm.w);	// left edge
5639				xC = xL + Math.floor(elm.w / 2);				// h center
5640				xR = xL + (this.opts.alignX != 'inner-left' ? elm.w : 0);	// right edge
5641				yT = elm.t + (this.opts.alignY != 'inner-bottom' ? 0 : elm.h);	// top edge
5642				yC = yT + Math.floor(elm.h / 2);				// v center
5643				yB = yT + (this.opts.alignY != 'inner-top' ? elm.h : 0);	// bottom edge
5644			}
5645
5646			if (typeof this.opts.alignXOrig !== 'undefined') this.opts.alignX = this.opts.alignXOrig;
5647			if (typeof this.opts.alignYOrig !== 'undefined') this.opts.alignY = this.opts.alignYOrig;
5648
5649			// keep in viewport and calc arrow position
5650			switch (this.opts.alignX) {
5651				case 'right':
5652				case 'inner-left':
5653					pos.l = xR + this.opts.offsetX;
5654					if (this.opts.keepInViewport && pos.l + this.tipOuterW > win.l + win.w)
5655						pos.l = win.l + win.w - this.tipOuterW;
5656					if (this.opts.alignX == 'right' || this.opts.alignY == 'center')
5657						pos.arrow = 'left';
5658					break;
5659				case 'center':
5660					pos.l = xC - Math.floor(this.tipOuterW / 2);
5661					if (this.opts.keepInViewport) {
5662						if (pos.l + this.tipOuterW > win.l + win.w)
5663							pos.l = win.l + win.w - this.tipOuterW;
5664						else if (pos.l < win.l)
5665							pos.l = win.l;
5666					}
5667					break;
5668				default: // 'left' || 'inner-right'
5669					pos.l = xL - this.tipOuterW - this.opts.offsetX;
5670					if (this.opts.keepInViewport && pos.l < win.l)
5671						pos.l = win.l;
5672					if (this.opts.alignX == 'left' || this.opts.alignY == 'center')
5673						pos.arrow = 'right';
5674			}
5675			switch (this.opts.alignY) {
5676				case 'bottom':
5677				case 'inner-top':
5678					pos.t = yB + this.opts.offsetY;
5679					// 'left' and 'right' need priority for 'target'
5680					if (!pos.arrow || this.opts.alignTo == 'cursor')
5681						pos.arrow = 'top';
5682					if (this.opts.keepInViewport && pos.t + this.tipOuterH > win.t + win.h) {
5683						pos.t = yT - this.tipOuterH - this.opts.offsetY;
5684						if (pos.arrow == 'top')
5685							pos.arrow = 'bottom';
5686					}
5687					break;
5688				case 'center':
5689					pos.t = yC - Math.floor(this.tipOuterH / 2);
5690					if (this.opts.keepInViewport) {
5691						if (pos.t + this.tipOuterH > win.t + win.h)
5692							pos.t = win.t + win.h - this.tipOuterH;
5693						else if (pos.t < win.t)
5694							pos.t = win.t;
5695					}
5696					break;
5697				default: // 'top' || 'inner-bottom'
5698					pos.t = yT - this.tipOuterH - this.opts.offsetY;
5699					// 'left' and 'right' need priority for 'target'
5700					if (!pos.arrow || this.opts.alignTo == 'cursor')
5701						pos.arrow = 'bottom';
5702					if (this.opts.keepInViewport && pos.t < win.t) {
5703						pos.t = yB + this.opts.offsetY;
5704						if (pos.arrow == 'bottom')
5705							pos.arrow = 'top';
5706					}
5707			}
5708
5709			if (pos.t < 0) pos.t = 0;
5710
5711			this.pos = pos;
5712		}
5713	};
5714
5715	$.fn.poshytip = function(options) {
5716		if (typeof options == 'string') {
5717			var args = arguments,
5718			    method = options;
5719			Array.prototype.shift.call(args);
5720			// unhook live events if 'destroy' is called
5721			if (method == 'destroy') {
5722				this.off ?
5723					this.off('mouseenter.poshytip').off('focus.poshytip') :
5724					$(document).undelegate(this.selector, 'mouseenter.poshytip').undelegate(this.selector, 'focus.poshytip');
5725			}
5726			return this.each(function() {
5727				var poshytip = $(this).data('poshytip');
5728				if (poshytip && poshytip[method])
5729					poshytip[method].apply(poshytip, args);
5730			});
5731		}
5732
5733		var opts = $.extend({}, $.fn.poshytip.defaults, options);
5734
5735		// generate CSS for this tip class if not already generated
5736		if (!$('#poshytip-css-' + opts.className)[0])
5737			$(['<style id="poshytip-css-',opts.className,'" type="text/css">',
5738				'div.',opts.className,'{visibility:hidden;position:absolute;top:0;left:0;}',
5739				'div.',opts.className,' table.tip-table, div.',opts.className,' table.tip-table td{margin:0;font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;font-variant:inherit;vertical-align:middle;}',
5740				'div.',opts.className,' td.tip-bg-image span{display:block;font:1px/1px sans-serif;height:',opts.bgImageFrameSize,'px;width:',opts.bgImageFrameSize,'px;overflow:hidden;}',
5741				'div.',opts.className,' td.tip-right{background-position:100% 0;}',
5742				'div.',opts.className,' td.tip-bottom{background-position:100% 100%;}',
5743				'div.',opts.className,' td.tip-left{background-position:0 100%;}',
5744				'div.',opts.className,' div.tip-inner{background-position:-',opts.bgImageFrameSize,'px -',opts.bgImageFrameSize,'px;}',
5745				'div.',opts.className,' div.tip-arrow{visibility:hidden;position:absolute;overflow:hidden;font:1px/1px sans-serif;}',
5746				'</style>'].join('')).appendTo('head');
5747
5748		// check if we need to hook live events
5749		if (opts.liveEvents && opts.showOn != 'none') {
5750			var handler,
5751			    deadOpts = $.extend({}, opts, { liveEvents: false });
5752			switch (opts.showOn) {
5753				case 'hover':
5754					handler = function() {
5755						var $this = $(this);
5756						if (!$this.data('poshytip'))
5757							$this.poshytip(deadOpts).poshytip('mouseenter');
5758					};
5759					// support 1.4.2+ & 1.9+
5760					this.on ?
5761						this.on('mouseenter.poshytip', handler) :
5762						$(document).delegate(this.selector, 'mouseenter.poshytip', handler);
5763					break;
5764				case 'focus':
5765					handler = function() {
5766						var $this = $(this);
5767						if (!$this.data('poshytip'))
5768							$this.poshytip(deadOpts).poshytip('showDelayed');
5769					};
5770					this.on ?
5771						this.on('focus.poshytip', handler) :
5772						$(document).delegate(this.selector, 'focus.poshytip', handler);
5773					break;
5774			}
5775			return this;
5776		}
5777
5778		return this.each(function() {
5779			new $.Poshytip(this, opts);
5780		});
5781	};
5782
5783	// default settings
5784	$.fn.poshytip.defaults = {
5785		content: 		'[title]',	// content to display ('[title]', 'string', element, function(updateCallback){...}, jQuery)
5786		className:		'tip-yellow',	// class for the tips
5787		bgImageFrameSize:	10,		// size in pixels for the background-image (if set in CSS) frame around the inner content of the tip
5788		showTimeout:		500,		// timeout before showing the tip (in milliseconds 1000 == 1 second)
5789		hideTimeout:		100,		// timeout before hiding the tip
5790		timeOnScreen:		0,		// timeout before automatically hiding the tip after showing it (set to > 0 in order to activate)
5791		showOn:			'hover',	// handler for showing the tip ('hover', 'focus', 'none') - use 'none' to trigger it manually
5792		liveEvents:		false,		// use live events
5793		alignTo:		'cursor',	// align/position the tip relative to ('cursor', 'target')
5794		alignX:			'right',	// horizontal alignment for the tip relative to the mouse cursor or the target element
5795		// ('right', 'center', 'left', 'inner-left', 'inner-right') - 'inner-*' matter if alignTo:'target'
5796		alignY:			'top',		// vertical alignment for the tip relative to the mouse cursor or the target element
5797		// ('bottom', 'center', 'top', 'inner-bottom', 'inner-top') - 'inner-*' matter if alignTo:'target'
5798		offsetX:		-22,		// offset X pixels from the default position - doesn't matter if alignX:'center'
5799		offsetY:		18,		// offset Y pixels from the default position - doesn't matter if alignY:'center'
5800		keepInViewport:		true,		// reposition the tooltip if needed to make sure it always appears inside the viewport
5801		allowTipHover:		true,		// allow hovering the tip without hiding it onmouseout of the target - matters only if showOn:'hover'
5802		followCursor:		false,		// if the tip should follow the cursor - matters only if showOn:'hover' and alignTo:'cursor'
5803		fade: 			true,		// use fade animation
5804		slide: 			true,		// use slide animation
5805		slideOffset: 		8,		// slide animation offset
5806		showAniDuration: 	300,		// show animation duration - set to 0 if you don't want show animation
5807		hideAniDuration: 	300,		// hide animation duration - set to 0 if you don't want hide animation
5808		refreshAniDuration:	200		// refresh animation duration - set to 0 if you don't want animation when updating the tooltip asynchronously
5809	};
5810
5811})(jQuery);
5812
5813/* ========================================
5814 FILE: /includes/js/system/frontend.js
5815 ==================== */
5816
5817var sudoMoveHrefPosX,
5818    sudoMoveHrefPosY;
5819
5820//načítanie všetkých tooltipsterov pre frontend
5821window.addEventListener('DOMContentLoaded', function() {
5822	//len je potrebné si vybrať classu a podľa nej nahodiť tooltipster
5823	jQuery('.quantity_modifications_tooltip').each(function() {
5824		//element má v sebe data-attributes
5825
5826
5827
5828		var $this = jQuery(this);
5829		var content = (($this.data('minimum_quantity') + '<br>') || ' ') + (($this.data('forced_quantity') + '<br>') || ' ') + ($this.data('maximum_quantity') || ' ');
5830
5831		$this.tooltipster({
5832			animation     : 'fade',
5833			delay         : 200,
5834			trigger       : 'hover',
5835			content       : content,
5836			theme         : 'cs_tooltipster_grey_theme',
5837			contentAsHTML : true,
5838		});
5839
5840		//extra pridanie aj na pridaŤ do košíka button
5841
5842		if ($this.closest('div.shop-category-product').length) {
5843			$this.closest('div.shop-category-product').find('input.categ_add_to_cart').tooltipster({
5844				animation     : 'fade',
5845				delay         : 200,
5846				trigger       : 'hover',
5847				content       : content,
5848				theme         : 'cs_tooltipster_grey_theme',
5849				contentAsHTML : true,
5850			});
5851		}
5852	});
5853});
5854
5855// sudo slider iOS fix
5856function js_sudo_slider_ios_fix() {
5857	jQuery('.sudo_href').on('touchmove', function(e) {
5858        sudoMoveHrefPosX = e.originalEvent.touches[0].pageX;
5859        sudoMoveHrefPosY = e.originalEvent.touches[0].pageY;
5860    }).on('touchend', function(e) {
5861        var ths = jQuery(this),
5862            thsHref = ths.attr('href'),
5863            thsTarget = ths.attr('target');
5864
5865        if ( sudoMoveHrefPosX == undefined && sudoMoveHrefPosY == undefined) {
5866            if ( thsTarget == '_blank' ) {
5867                window.open(thsHref, '_blank');
5868            } else {
5869                window.location.assign(thsHref);
5870            }
5871            return false;
5872        }
5873        sudoMoveHrefPosX = undefined;
5874        sudoMoveHrefPosY = undefined;
5875    });
5876}
5877
5878function js_sudo_slider_sudo_href_fix() {
5879    var $sudoHrefElem,
5880        sudoHrefCursoruPosX,
5881        sudoHrefCursoruPosY;
5882
5883	$sudoHrefElem = jQuery('.sudo_href');
5884
5885	$sudoHrefElem.on('click', function(e) {
5886    	return false;
5887    });
5888	$sudoHrefElem.on('mousedown', function(e) {
5889        sudoHrefCursoruPosX = e.pageX;
5890        sudoHrefCursoruPosY = e.pageY;
5891    });
5892
5893	$sudoHrefElem.on('mouseup', function(e) {
5894    	var target = jQuery(this).attr('href');
5895    	if ( sudoHrefCursoruPosX === e.pageX && sudoHrefCursoruPosY === e.pageY && target !== '#' ) {
5896            if ( jQuery(this).attr('target') == '_blank' ) {
5897                window.open(target, '_blank');
5898            } else {
5899                window.location.assign(target);
5900            }
5901        }
5902    });
5903}
5904
5905jQuery.fn.startAjaxLoader = function ( loader_image_filename ) {
5906	if (this.data('ajax-loader-pre-html-content') == null) {
5907		this.data('ajax-loader-pre-html-content', this.html()).html('<span class="small_graph_ajax_loader"><img src="'+js_global_live_site+'/images/'+(loader_image_filename != null ? loader_image_filename : 'ajax-loader-05.gif')+'" alt="..." /></span>');
5908	}
5909	return this;
5910};
5911
5912jQuery.fn.stopAjaxLoader = function () {
5913	if (this.data('ajax-loader-pre-html-content') != null) {
5914		this.html(this.data('ajax-loader-pre-html-content')).removeData('ajax-loader-pre-html-content');
5915	}
5916	return this;
5917};
5918
5919function js_add_class_to_last_module( block_element ) {
5920	if (typeof js_Config_parser_enabled !== 'undefined' && js_Config_parser_enabled) {
5921		return false;
5922	}
5923
5924  block_element = jQuery(block_element);
5925
5926  if ( block_element.find('.mp:first').length == 0 ) {
5927    return;
5928  }
5929
5930  block_element = block_element.find('.mp:first').parent();
5931  block_element.children('.mp,.mp_placeholder,.mp_placeholder_1x').removeClass('mp_side_last');
5932
5933  // aktualna sirka bloku v x
5934  var block_width_x = 5;
5935
5936  if ( block_element.parents('#middle:first').length != 0 )
5937    block_width_x = parseInt( /middle_([0-9]+)x/.exec( jQuery('#middle').attr('class') )[1] );
5938
5939  var placeholder_element = block_element.children('.mp_placeholder,.mp_placeholder_1x');
5940  var mp_last_element = block_element.children('.mp:last');
5941
5942  if ( mp_last_element.hasClass('ui-sortable-helper') )
5943    mp_last_element = mp_last_element.prev('.mp');
5944
5945  var last_found = false;
5946
5947  if ( placeholder_element.length != 0 && (placeholder_element.index() > mp_last_element.index() || mp_last_element.length == 0) ) {
5948
5949    placeholder_element.addClass('mp_side_last');
5950    last_found = true;
5951  }
5952
5953  if ( !last_found && mp_last_element.length != 0 )
5954    mp_last_element.addClass('mp_side_last');
5955
5956  //var module_count = block_element.children('.mp').length;
5957
5958  // pridaj class aj pre kazdy posledny modul v riadku (ak je zobrazenych viac riadkov)
5959
5960  var modules_width = 0;
5961
5962  // sirku modulov v bloku si musime vypocitat
5963  block_element.children('.mp').each( function() {
5964	  var parsedWidth =  /mp_w([1-9]+)(\s|$)/.exec( jQuery(this).attr('class') );
5965
5966	  if (parsedWidth !== null) {
5967		  modules_width += parseInt(parsedWidth[1]);
5968	  }
5969  });
5970
5971  // moduly su na viac riadkov
5972  if ( modules_width > block_width_x ) {
5973
5974    var module_last_class_set = false;
5975    var prev_module_element = null;
5976    var modules_row_width = 0;  // sucet sirky modulov (v x) pre kazdy riadok bloku
5977    var module_width = 0;  // v x
5978
5979    block_element.children('.mp').each( function() {
5980    	if ( !jQuery(this).hasClass('mp') && !jQuery(this).hasClass('mp_placeholder') && !jQuery(this).hasClass('mp_placeholder_1x') )
5981    		return;
5982    	if ( jQuery(this).hasClass('ui-sortable-helper') )
5983    		return;
5984
5985//     	module_width = Math.floor( (jQuery(this).width()+30)/180 );
5986		module_width = parseInt(/mp_w([0-9]+)/.exec( jQuery(this).attr('class') )[1] || 0);
5987    	modules_row_width += module_width;
5988
5989		// sirky modulov v riadku nevychadzaju presne na jeho sirku
5990		if ( modules_row_width > block_width_x && prev_module_element != null ) {
5991			prev_module_element.addClass('mp_side_last');
5992			modules_row_width = module_width;
5993		}
5994
5995		// posledny modul v bloku uz ma nastavenu class
5996		if ( jQuery(this).hasClass('mp_side_last') )
5997			return;
5998
5999		// sirky modulov v riadku vychadzaju presne na jeho sirku
6000		if ( modules_row_width == block_width_x ) {
6001			jQuery(this).addClass('mp_side_last');
6002			modules_row_width = 0;
6003		}
6004
6005		prev_module_element = jQuery(this);
6006    });
6007  }
6008}
6009
6010// pre moduly v bloku left a right
6011function js_add_class_to_left_right_modules( block_element, class_prefix ) {
6012  block_element = jQuery(block_element);
6013
6014  block_element.children('.mp').each( function(index) {
6015
6016    jQuery(this).removeClass('mp_l0').removeClass('mp_l1');
6017    jQuery(this).removeClass('mp_r0').removeClass('mp_r1');
6018
6019    if ( (index % 2) == 0 )
6020      jQuery(this).addClass(class_prefix+'0');
6021    else
6022      jQuery(this).addClass(class_prefix+'1');
6023  });
6024}
6025
6026if ( typeof(js_reload_current_page) != 'function' ) {
6027	function js_reload_current_page() {
6028		document.location.href = (document.location.href).replace(/#[^#]*$/i,'');
6029	}
6030}
6031
6032function js_prettyphoto_close() {
6033  jQuery.prettyPhoto.close();
6034  jQuery(document).off('keyup');
6035  return false;
6036}
6037
6038function js_print_page(elem) {
6039	window.print();
6040	return false;
6041}
6042//------------------------------------
6043function js_prettyPhoto_tos_init() {
6044	jQuery('body').on('click', 'a.prettyPhoto_tos, a.prettyPhoto_tos_custom', function(event) {
6045		event.preventDefault();
6046
6047		if (typeof js_custom_func_tos_nonsef_url !== 'function') {
6048			tos_nonsef_url = js_global_live_site +'/index2.php?option=com_content&task=blogcategory&id=98&Itemid=1419&no_html=1';
6049		} else {
6050			tos_nonsef_url = js_custom_func_tos_nonsef_url();
6051		}
6052
6053		if (typeof js_CS_Config_gdpr_agree_info_custom_part_lang !== 'undefined' && typeof js_CS_Config_gdpr_agree_info_custom_part_lang.url !== 'undefined') {
6054			if (jQuery(event.target).hasClass('prettyPhoto_tos_custom')) {
6055				tos_nonsef_url = js_global_live_site + js_CS_Config_gdpr_agree_info_custom_part_lang.url;
6056			}
6057		}
6058
6059		jQuery.get(tos_nonsef_url, function (res) {
6060			jQuery(event.target).parent().stopAjaxLoader();
6061
6062			var resElem = jQuery('<div />').html(res);
6063			var titleElem = resElem.find('.contentheading :header:first');
6064			var vexData = {
6065				afterOpen: function(vexContent) {
6066					vexContent
6067						.find('.vex-close').css('right', '20px')
6068						.end()
6069						.closest('.vex').addClass('vex-tos');
6070				}
6071			};
6072			if(typeof js_Config_blog !== 'undefined' && js_Config_blog) {
6073				var titleHeading = resElem.find('.title').text();
6074				var inputHtml = jQuery(resElem);
6075				inputHtml.find('.article_preview').removeClass('article_preview_default_blog_system');
6076				inputHtml.find('.text_wrap .title').remove();
6077				inputHtml.find('.img_wrap').remove();
6078				vexData.title = titleHeading;
6079				vexData.input = inputHtml.html();
6080			} else if (titleElem.length) {
6081				vexData.title = titleElem.text();
6082				vexData.input = jQuery('<div />').append(jQuery('.contentheading', res).remove().end()).html();
6083
6084			} else {
6085				vexData.input = resElem.html();
6086			}
6087
6088			js_function_vex_open(vexData);
6089		});
6090	});
6091
6092	return false;
6093}
6094
6095function js_prettyphoto_newsletter() {
6096	// prettyPhoto_newsletter
6097	if(typeof js_Config_checkout_newsletter_inverse_checkbox !== 'undefined' && js_Config_checkout_newsletter_inverse_checkbox) {
6098		var newsletter_tooltip = js_newsletter_tooltip_inverse;
6099	} else {
6100		var newsletter_tooltip = js_newsletter_tooltip;
6101	}
6102	jQuery('body').on("mouseenter", ".prettyPhoto_newsletter", function () {
6103		if (!jQuery(this).hasClass("tooltipstered")) {
6104			jQuery(this).tooltipster({
6105				theme: "tooltipster-gdpr prettypPhoto_newsletter",
6106				contentAsHTML: true,
6107				trackTooltip: true,
6108				trackOrigin: true,
6109				content: newsletter_tooltip,
6110				trigger: "hover",
6111				selfDestruction: true
6112			}).tooltipster('open');
6113		}
6114	}).on("mouseenter", "#club_card_val_div #club_card_field", function () {
6115		if (!jQuery(this).hasClass("tooltipstered")) {
6116			jQuery(this).tooltipster({
6117				theme: "tooltipster-gdpr",
6118				contentAsHTML: true,
6119				trackTooltip: true,
6120				trackOrigin: true,
6121				content: js_lang_shuch_club_card_text,
6122				trigger: "hover",
6123				selfDestruction: true
6124			}).tooltipster('open');
6125		}
6126	});
6127
6128}
6129
6130function js_prettyphoto_gdpr_init() {
6131
6132	jQuery('body').on("mouseenter", "a.prettyPhoto_gdpr", function () {
6133		if (!jQuery(this).hasClass("tooltipstered")) {
6134			var text = js_gdpr_tooltip;
6135			if( jQuery(this).hasClass("custom_text_reg") ) {
6136				text = js_gdpr_tooltip_reg;
6137			}
6138			if( !jQuery(this).hasClass("no_hover") ) {
6139				jQuery(this).tooltipster({
6140					theme: "tooltipster-gdpr",
6141					contentAsHTML: true,
6142					trackTooltip: true,
6143					trackOrigin: true,
6144					content: text,
6145					trigger: "hover",
6146					selfDestruction: true
6147				}).tooltipster('open');
6148			}
6149
6150		}
6151	}).off("click", "a.prettyPhoto_gdpr").on('click', 'a.prettyPhoto_gdpr', function(event) {
6152		event.preventDefault();
6153
6154		tos_nonsef_url = js_global_live_site +'/index2.php?option=com_content&task=blogcategory&id=4&Itemid=4&no_html=1';
6155		if( jQuery(this).hasClass("custom_text_reg") ) {
6156			tos_nonsef_url = js_global_live_site +'/index2.php?option=com_content&task=blogcategory&id=214&Itemid=1684&no_html=1';
6157		}
6158		if( jQuery(this).hasClass("custom_text_notify") ) {
6159			tos_nonsef_url += js_global_live_site +'/index2.php?option=com_content&task=blogcategory&id=215&Itemid=1685&no_html=1';
6160		}
6161
6162		jQuery.get(tos_nonsef_url, function (res) {
6163			jQuery(event.target).parent().stopAjaxLoader();
6164
6165			var resElem = jQuery('<div />').html(res);
6166			var titleElem = resElem.find('.contentheading :header:first');
6167			var vexData = {
6168				afterOpen: function(vexContent) {
6169					vexContent
6170						.find('.vex-close').css('right', '20px')
6171						.end()
6172						.closest('.vex').addClass('vex-tos');
6173				}
6174			};
6175
6176			if(typeof js_Config_blog !== 'undefined' && js_Config_blog) {
6177				var titleHeading = resElem.find('.title').text();
6178				var inputHtml = jQuery(resElem);
6179				inputHtml.find('.article_preview').removeClass('article_preview_default_blog_system');
6180				inputHtml.find('.text_wrap .title').remove();
6181				inputHtml.find('.img_wrap').remove();
6182				vexData.title = titleHeading;
6183				vexData.input = inputHtml.html();
6184			} else if (titleElem.length) {
6185				vexData.title = titleElem.text();
6186				vexData.input = jQuery('<div />').append(jQuery('.contentheading', res).remove().end()).html();
6187			} else {
6188				vexData.input = resElem.html();
6189			}
6190
6191			js_function_vex_open(vexData);
6192		});
6193	});
6194
6195	return false;
6196}
6197
6198function js_login_register_module_set(mod_class) {
6199
6200	if (typeof(js_global_user_info) == "undefined" || js_global_user_info.name == "" || jQuery('body.admin_content').length)
6201		return;
6202
6203	var module_class = typeof(mod_class) != 'undefined' ? mod_class : '.mp_id10714';
6204
6205	// JAN user credit info
6206	var user_credits = (typeof js_global_user_info.ucri !== "undefined") ? '<span class="user_credits_info">&nbsp;('+js_global_user_info.ucri+' kreditov)</span>' : '';
6207
6208	var href_lang = {
6209		'sk': '/sprava-uctu/',
6210		's2': '/sprava-uctu/',
6211		's3': '/sprava-uctu/',
6212		'cz': '/udrzba-uctu/',
6213		'c2': '/udrzba-uctu/',
6214		'en': '/account-details/',
6215		'de': '/account-details/',
6216		'at': '/account-details/',
6217		'pl': '/zarzadzanie-kontem/',
6218		'hu': '/szamlazas-reszletek/',
6219		'si': '/nastavitve-racuna/',
6220		'ro': '/drept-de-sine/',
6221		'ru': '/upravlenyie-utsheta/',
6222		'hr': '/uredivanje-racuna/'
6223	};
6224
6225	var final_lang_manage_account = (typeof js_lang_manage_account !== "undefined") ? js_lang_manage_account : 'Správa Účtu';
6226    var final_href = (typeof href_lang[js_get_lang] !== "undefined") ? href_lang[js_get_lang] : '/sprava-uctu/';
6227    var final_lang_logout = (typeof js_lang_account_logout !== "undefined") ? js_lang_account_logout : 'Odhlásiť';
6228
6229	jQuery(module_class+' .registration').attr('href', final_href).html('<span>' + final_lang_manage_account + '</span>' + user_credits);
6230	jQuery(module_class+' .login').addClass('no_content_design_link').attr('href', '/index.php?option=logout').html('<span>' + final_lang_logout + '</span>');
6231}
6232
6233// type: 0 = native, 1 = shop.browse, 2 = product_snapshot
6234function showFullPriceInfo(myself, sku) {
6235	var type = 0;
6236	var target = null;
6237	if (jQuery(myself).parent().parent().hasClass('shop-category-product')) {
6238		target = jQuery(myself).parent().siblings(".full_price_info");
6239		type = 1;
6240	}
6241	else {
6242		target = jQuery(myself).siblings(".full_price_info");
6243		type = 2;
6244	}
6245
6246	var check = (target.length == 0);
6247
6248	if(check) {
6249		switch (type) {
6250			case 1:
6251				jQuery(myself).parent().parent().append('<div class="full_price_info"></div>');
6252				break;
6253			case 2:
6254				jQuery(myself).parent().append('<div class="full_price_info"></div>');
6255				break;
6256		}
6257		jQuery.post('/includes/system.cs_lib.ajax.php?ajax_call=1&use_sef=1&option=com_shop&ajax_func=get_full_price_info', {productSku: sku}, function (res) {
6258			var data = JSON.parse(res);
6259
6260			var stringData = '';
6261			jQuery.each(data, function(key, value) {
6262				stringData += '<div class="full_price_info_price">' + key + ':<span class="full_price_info_value">' + value + '</span></div>';
6263			});
6264			jQuery(myself).parent().parent().find('.full_price_info').html(stringData);
6265		});
6266	}
6267}
6268
6269
6270
6271// on ready
6272jQuery(function() {
6273	js_sudo_slider_ios_fix();
6274    js_sudo_slider_sudo_href_fix();
6275
6276	var $nivoSlider = jQuery('.nivoSlider');
6277
6278	jQuery(window).on("blur", function() {
6279		if($nivoSlider.length > 0) {
6280			$nivoSlider.each(function() {
6281				if(typeof(jQuery(this).data('nivoslider')) !== 'undefined' && document.hidden) {
6282					jQuery(this).data('nivoslider').stop();
6283				}
6284			});
6285		}
6286	}).on("focus", function() {
6287		if($nivoSlider.length > 0) {
6288			$nivoSlider.each(function() {
6289				if(typeof(jQuery(this).data('nivoslider')) !== 'undefined') {
6290					if ( typeof js_Config_in_viewport_optimalization !== 'undefined' && js_Config_in_viewport_optimalization && typeof isElementInView === 'function' ) {
6291						if ( isElementInView(jQuery(this)) ) {
6292							jQuery(this).data('nivoslider').start();
6293						}
6294					} else if ( jQuery(this).is(':in-viewport') ) {
6295						jQuery(this).data('nivoslider').start();
6296					}
6297				}
6298			});
6299		}
6300	}).on("scroll", function() {
6301		if($nivoSlider.length > 0) {
6302			$nivoSlider.each(function() {
6303				if(typeof(jQuery(this).data('nivoslider')) !== 'undefined') {
6304					if ( typeof js_Config_in_viewport_optimalization !== 'undefined' && js_Config_in_viewport_optimalization && typeof isElementInView === 'function' ) {
6305						if ( isElementInView(jQuery(this)) ) {
6306							jQuery(this).data('nivoslider').start();
6307						} else {
6308							jQuery(this).data('nivoslider').stop();
6309						}
6310					} else {
6311						if(jQuery(this).is(':in-viewport')) {
6312							jQuery(this).data('nivoslider').start();
6313						} else {
6314							jQuery(this).data('nivoslider').stop();
6315						}
6316					}
6317				}
6318			});
6319		}
6320	});
6321
6322	jQuery('td.shop_addtocart_advanced_attribute_availability').on('click', function() {
6323		var newClass = jQuery(this).attr('class').split(' ')[1];
6324		jQuery('.shop_product_availability_value').attr('class', 'shop_product_availability_value ' + newClass);
6325	});
6326
6327  js_login_register_module_set(); // nastavenie linkov pre modul prihlasenie
6328
6329  // make active menu
6330  jQuery('.mainlevel-nav li a, .mainlevel-nav li ul li a, .mainlevel-nav li ul li ul li a').removeClass('cms_active_menu');
6331
6332	jQuery('.mainlevel-nav li a, .mainlevel-nav li ul li a, .mainlevel-nav li ul li ul li a, .module_cont_custmenu li a').each(function () {
6333		if (typeof (js_global_live_site_sef) !== 'undefined' && js_global_live_site_sef === jQuery(this).attr('href')) {
6334				jQuery(this).addClass('cms_active_menu');
6335				if (jQuery(this).hasClass('mi_u')) {
6336					jQuery(this).addClass('active');
6337					jQuery(this).parent().addClass('active');
6338				}
6339		}
6340	});
6341
6342	if (!(typeof (categ_add_to_cart_unsaleable_poshy_disabled) !== 'undefined' && categ_add_to_cart_unsaleable_poshy_disabled == '1') && typeof (cms_js_lang_cart_product_is_unsaleable_msg) !== 'undefined') {
6343		jQuery(document).on('mouseenter click', '.categ_add_to_cart_unsaleable', function (event) {
6344//          if (!jQuery(this).hasClass("tooltipstered")) {
6345			var $currentTarget = jQuery(event.currentTarget);
6346			var $elemWrap = $currentTarget.closest('tr');
6347			if ($elemWrap.find('input.product_quantity').val() > 0 || $currentTarget.hasClass('categ_add_to_cart_unsaleable')) {
6348				jQuery(this).tooltipster({
6349					theme          : "tooltipster-gdpr",
6350					contentAsHTML  : true,
6351					trackTooltip   : true,
6352					trackOrigin    : true,
6353					content        : cms_js_lang_cart_product_is_unsaleable_msg,
6354					selfDestruction: true
6355				}).tooltipster('open');
6356			}
6357//          }
6358		});
6359		jQuery(document).on('mouseout', '.categ_add_to_cart_unsaleable', function (event) {
6360			var $this = jQuery(this);
6361			if ($this.hasClass('tooltipstered')) {
6362				$this.tooltipster('hide');
6363			}
6364			jQuery(".tooltipstered").tooltipster('destroy');
6365		});
6366	}
6367	// product size table preview init
6368	if (typeof js_prod_size_table_dir !== 'undefined' && js_prod_size_table_dir != '' && jQuery('.shop_page_class_shop_product_details').length > 0) {
6369		jQuery('.size-table-img').click(function (event) {
6370			event.preventDefault();
6371			var img = new Image();
6372			img.src = this.href;
6373			js_function_vex_open({
6374				input: img.outerHTML,
6375				className: 'vex-cs vex-size-table-img',
6376			});
6377		});
6378	}
6379
6380	/**
6381	 * Scroll to size table || open size table in vex
6382	 */
6383	if (typeof js_Config_product_size_table !== 'undefined' && js_Config_product_size_table && jQuery('.size-table-link-button').length > 0) {
6384		jQuery('#mainmiddle_container').on('click', '.size-table-link-button', function () {
6385			if (typeof js_Config_product_size_table_in_vex !== 'undefined' && js_Config_product_size_table_in_vex) {
6386
6387				var requestData = {
6388					productId: jQuery('.flypage-cart input[name="product_id"]').val()
6389				};
6390
6391				if (typeof requestData.productId === 'undefined') {
6392					return;
6393				}
6394
6395				new AjaxRequest(requestData)
6396					.setController('Product')
6397					.setAction('getProductSizeTableHtml')
6398					.onSuccess(function (response) {
6399						vex.open({
6400							content: response.data.html,
6401							className: 'vex-cs html_size_table'
6402						});
6403					})
6404					.onError(function (response) {
6405						//console.log(response);
6406					})
6407					.send();
6408			} else {
6409
6410				let sizeTable = jQuery('.size_chart_html_table');
6411
6412				if (config('js_Config_product_tabs_configuration')) {
6413					Object.entries(js_Config_product_tabs_configuration).forEach(function (val) {
6414						if (val[1].elements.includes('Size_Table')) {
6415							let tabId = val[0];
6416							let tabHeader = jQuery('.tabHeaders label[for="tab' + tabId + '"]');
6417							let tabInput = jQuery('#tabsContainer input#tab' + tabId);
6418
6419							if (tabHeader.length > 0 && tabInput.length > 0 && tabInput.prop('checked') !== true) {
6420								tabHeader.trigger('click');
6421								sizeTable = tabHeader;
6422							}
6423						}
6424					})
6425				}
6426
6427				var sizeTableTopOffset = sizeTable.offset().top;
6428
6429				if (jQuery('body').hasClass('fixed_header') || jQuery('body').hasClass('g_fixed_header') || is_responsive()) {
6430					sizeTableTopOffset -= parseFloat(jQuery('#header_container').css('height'));
6431				}
6432
6433				jQuery('html,body').animate({
6434					scrollTop: sizeTableTopOffset
6435				}, 300);
6436			}
6437		});
6438	}
6439
6440	// hover nad pexf name filter
6441  jQuery('.pexf_container')
6442	.on("mouseenter", function () {
6443		jQuery(this).find('.pexf_name:first').addClass('hover');
6444	})
6445	.on("mouseleave", function () {
6446		jQuery(this).find('.pexf_name:first').removeClass('hover');
6447	});
6448
6449	// compare page - compare table multivalue height init
6450	jQuery('.product-compare-table .sub_group-params .param-line').each(function () {
6451		jQuery(this).find('.param-value').height(jQuery(this).outerHeight());
6452	});
6453
6454	js_prettyphoto_gdpr_init();
6455	js_prettyphoto_newsletter();
6456});
6457
6458if (typeof js_Config_parser_enabled !== 'undefined' && js_Config_parser_enabled) {
6459	window.addEventListener("load", function () {
6460		var unavailText;//
6461		if (jQuery('.flypage-image').length && jQuery('.unavailable_product .shop_page_class_shop_product_details').length) {
6462			if (jQuery('.oos2pu_product .shop_page_class_shop_product_details').length) {
6463				unavailText = jQuery('<span class="prod_unavailable_title">' + js_lang_phpshop_product_oos2pu + '</span>');
6464			} else {
6465				unavailText = jQuery('<span class="prod_unavailable_title">' + js_lang_phpshop_product_unavailable + '</span>');
6466			}
6467			jQuery('.flypage-image').append(unavailText);
6468		}
6469	});
6470} else {
6471	jQuery(function () {
6472		// produkt trvalo nedostupny
6473		var unavailText;
6474		if (jQuery('.unavailable_product .shop_page_class_shop_product_details').length) {
6475			if (jQuery('.oos2pu_product .shop_page_class_shop_product_details').length) {
6476				unavailText = jQuery('<span class="prod_unavailable_title">' + js_lang_phpshop_product_oos2pu + '</span>');
6477			} else {
6478				unavailText = jQuery('<span class="prod_unavailable_title">' + js_lang_phpshop_product_unavailable + '</span>');
6479			}
6480			jQuery('.flypage-image').append(unavailText);
6481		}
6482	});
6483}
6484
6485// overovanie tel čísla vo formulari
6486function formTelVerify() {
6487	var phone = jQuery('#phone_1_field');
6488	var phonelabel = jQuery('#phone_1_div');
6489
6490	if ( phone.closest('#materialDesignRegistration').length ) {
6491		return;
6492	}
6493
6494	if(phone.length > 0 ){
6495// 		formTelVerifyColorSetter(phone, phonelabel);
6496
6497		if( typeof js_CS_Config_change_input_to_button !== 'undefined' && js_CS_Config_change_input_to_button ) {
6498			phone.on('keyup', function() {
6499				formTelVerifyColorSetter(phone, phonelabel);
6500			})
6501			.on('blur', function() {
6502				formTelVerifyColorSetter(phone, phonelabel);
6503			})
6504			.parents('form:first').find('button.button').on('click', function() {
6505				formTelVerifyMessageSetter(phone, formTelVerifyColorSetter(phone, phonelabel), true);
6506			});
6507		} else {
6508			phone.on('keyup', function() {
6509				formTelVerifyColorSetter(phone, phonelabel);
6510			})
6511			.on('blur', function() {
6512				formTelVerifyColorSetter(phone, phonelabel);
6513			})
6514			.parents('form:first').find('input.button').on('click', function() {
6515				formTelVerifyMessageSetter(phone, formTelVerifyColorSetter(phone, phonelabel), true);
6516			});
6517		}
6518
6519	}
6520}
6521
6522function formTelVerifyMessageSetter (phone, errorCode, showAlert) {
6523	if (typeof showAlert === 'undefined') {
6524		showAlert = false;
6525	}
6526
6527	if (typeof js_get_lang === 'undefined') {
6528		js_get_lang = 'sk';
6529	}
6530
6531	if ( is_cs_user('new_phone_validation') && typeof js_CS_Config_new_phone_validation !== 'undefined' && js_CS_Config_new_phone_validation ) {
6532		var js_phone_max_length = {
6533			'sk': 'Minimálne 6 číslic.',
6534			's2': 'Minimálne 6 číslic.',
6535			's3': 'Minimálne 6 číslic.',
6536			'cz': 'Minimálně 6 číslic.',
6537			'en': 'min 6 digits.',
6538			'de': 'mindestens 6 Stellen.',
6539			'hu': 'minimum 6 számjegy.',
6540			'pl': 'minimum 6 cyfr.',
6541			'ro': 'minimă de 6 cifre.',
6542			'ru': 'минимум 6 цифр.'
6543		};
6544	} else {
6545		var js_phone_max_length = {
6546			'sk': 'Minimálne 9 znakov.',
6547			's2': 'Minimálne 9 znakov.',
6548			's3': 'Minimálne 9 znakov.',
6549			'cz': 'minimálně 9 znaků.',
6550			'en': 'min 9 characters.',
6551			'de': 'mindestens 9 Zeichen.',
6552			'hu': 'minimum 9 karakter.',
6553			'pl': 'minimum 9 znaków.',
6554			'ro': 'minimă de 9 caractere.',
6555			'ru': 'минимум 9 символов.'
6556		};
6557	}
6558
6559	var js_phone_correct = {
6560		'sk': 'Prosím vylpňte správne tel. kontakt.',
6561		's2': 'Prosím vylpňte správne tel. kontakt.',
6562		's3': 'Prosím vylpňte správne tel. kontakt.',
6563		'cz': 'Prosím vylpňte správne tel. kontakt.',
6564		'en': 'Please insert a phone number in correct form.',
6565		'de': 'Bitte füllen Sie das richtige Telefon. Kontakt.',
6566		'pl': 'Proszę wypełnić w odpowiedniej telefonu kontakt.',
6567		'hu': 'Kérjük, töltse ki a megfelelő telefont érintkezés.',
6568		'ru': 'Пожалуйста, заполните корректно телефону контакт.',
6569		'ro': 'Vă rugăm să completați în telefon corect contact.'
6570	};
6571
6572	var msg = (typeof js_lang_phone_correct_msg !== 'undefined' ? js_lang_phone_correct_msg : (typeof js_phone_correct[js_get_lang] !== 'undefined' ? js_phone_correct[js_get_lang] : 'Please insert a phone number in correct form.'));
6573
6574	var errorMessage = '';
6575	var errspan = jQuery('<span class="tel_error" style="color:#FF0000;font-size:11px;"></span>');
6576
6577	switch (errorCode) {
6578		case 1:
6579			errorMessage = (typeof js_phone_max_length[js_get_lang] !== 'undefined' ? js_phone_max_length[js_get_lang] : js_phone_max_length.en);
6580			break;
6581		case 2:
6582			errorMessage = msg;
6583			break;
6584		case 3:
6585			errorMessage = (typeof js_phone_max_length[js_get_lang] !== 'undefined' ? js_phone_max_length[js_get_lang] : js_phone_max_length.en) + "\n" + msg;
6586			break;
6587		default:
6588			errorMessage = '';
6589			break;
6590	}
6591
6592	if (showAlert && errorMessage.length) {
6593		//alert(errorMessage);
6594	} else {
6595		errspan.text(errorMessage).insertAfter(phone);
6596	}
6597}
6598
6599function formTelVerifyColorSetter (phone, phonelabel) {
6600	var phoneval = jQuery.trim(phone.val());
6601	// phone_validation
6602	if ( is_cs_user('new_phone_validation') && typeof js_CS_Config_new_phone_validation !== 'undefined' && js_CS_Config_new_phone_validation ) {
6603		var errorCode = 0;
6604
6605		if (!is_correct_length_phone_number(phoneval)) {
6606			errorCode += 1;
6607		}
6608
6609		if (!is_valid_phone_number(phoneval)) {
6610			errorCode += 2;
6611		}
6612	} else {
6613		var badChar  = phoneval.match(/[^0-9+\-–\/ ]/) != null;
6614		var errorCode = 0;
6615		errorCode += (phoneval.length < 9) ? 1 : 0;
6616		errorCode += (badChar) ? 2 : 0;
6617	}
6618
6619	jQuery('span.tel_error').remove();
6620	if (!errorCode)
6621		phonelabel.css('color', '#000');
6622	else {
6623		phonelabel.css('color', '#f00');
6624		formTelVerifyMessageSetter (phone, errorCode);
6625	}
6626	return errorCode;
6627}
6628
6629function formTinVerify() {
6630	var tinField = jQuery('#company_tin_id_field');
6631	var tinLabel = jQuery('#company_tin_id_div');
6632
6633	var tinLength = {
6634		'sk': 12,
6635		'cz': 12,
6636		'hu': 10
6637	};
6638
6639	if ( js_get_lang === 'undefined' ) {
6640		js_get_lang = 'sk';
6641	}
6642
6643	if ( tinField.length > 0 ) {
6644
6645		if ( tinLength[js_get_lang] !== 'undefined' ) {
6646			tinField.prop('maxlength', tinLength[js_get_lang]);
6647		}
6648
6649		tinField.on('keyup', function() {
6650			formTinVerifyColorSetter(tinField, tinLabel);
6651		});
6652
6653		tinField.on('blur', function() {
6654			formTinVerifyColorSetter(tinField, tinLabel);
6655		})
6656			.parents('form:first').find('input.button').on('click', function() {
6657			formTelVerifyMessageSetter(tinField, formTinVerifyColorSetter(tinField, tinLabel), true);
6658		});
6659	}
6660}
6661
6662function formVatVerify( vatField ) {
6663	if ( !is_cs_user('rxi215') ) {
6664		return false;
6665	}
6666
6667	if ( typeof js_get_lang === 'undefined' ) {
6668		js_get_lang = 'sk';
6669	}
6670
6671	var vatRegex = {
6672		'SVK': '^[0-9]{9,10}$',
6673		'CZE': '^[0-9]{9}$|^CZ[0-9]{8}$',
6674		'HUN': '^[0-9]{10,11}$',
6675		'BEL': '^[0-9]{11}$|^0[0-9]{9}$',
6676		'BGR': '^[0-9]{10}$|^[0-9]{9}$|^307[0-9]{7}$|^[0-9]{13}$',
6677		'CY': '^[09]{1}[0-9]{7}[A-Z]{1}$|^[13459]{1}[0-9]{7}[A-Z]{1}$',
6678		'HRV': '^[0-9]{11}$|^[0-9]{11}$',
6679		'DNK': '^[0-9]{10}$|^DK[0-9]{8}$',
6680		'EST': '^[0-9]{11}$|^[0-9]{8}$',
6681		'FRA': '^[0123]{1}[0-9]{12}$|^[0-9]{9}$',
6682		'FIN': '^[0-9]{6}[A+-]{1}[0-9]{3}[A-Z0-9]{1}$|^[0-9]{7}-[0-9]{1}$',
6683		'HOL': '^[0-9]{9}$',
6684		'LIT': '^[0-9]{11}$|^[0-9]{9}$',
6685		'LVA': '^[0-9]{11}$|^[0-9]{11}$',
6686		'LUX': '^[0-9]{13}$|^[0-9]{11}$',
6687		'DEU': '^[0-9]{11}$',
6688		'POR': '^[0-9]{9}$',
6689		'PLN': '^[0-9]{10,11}$',
6690		'AUT': '^[0-9]{9}$',
6691		'ROM': '^[0-9]{13}$|^[0-9]{2,10}$',
6692		'SVN': '^[0-9]{8}$',
6693		'ITA': '^[A-Z]{6}[0-9]{2}[A-Z]{1}[0-9]{2}[A-Z]{1}[0-9]{3}[A-Z]{1}$|^[0-9]{11}$',
6694		'ESP': '^[LKMXYZ0-9]{1}[0-9]{7}[A-Z]{1}$|^[ABCDEFGHJNPQRSUVW]{1}[0-9]{7}[A-Z0-9]{1}$',
6695		'SWE': '^[0-9]{10}$',
6696		'MT': '^[0-9]{7}[MGAPLHBZ]{1}$|^[0-9]{9}$|^[0-9]{9}$',
6697		'EL': '^[0-9]{9}$',
6698		'IE': '^[0-9]{7}[A-z]{1,2}$|^[0-9]{7}[A-Z]{1,2}$',
6699	};
6700
6701	var vatCountryCode = '';
6702	if ( jQuery('#country').length > 0 ) {
6703		vatCountryCode = jQuery('#country').val();
6704	} else {
6705		vatCountryCode = jQuery('#country_field').val();
6706	}
6707
6708	var vatCheck = false;
6709	if ( vatCountryCode != '' ) {
6710		vatCheck = RegExp(vatRegex[vatCountryCode]).test(jQuery.trim(vatField.val()));
6711	} else {
6712		vatCheck = RegExp(vatRegex.SVK).test(jQuery.trim(vatField.val()));
6713	}
6714	return vatCheck;
6715}
6716
6717function formTinVerifyColorSetter (tinField, tinLabel) {
6718	// tin_validation
6719	if ( typeof js_get_lang === 'undefined' ) {
6720		js_get_lang = 'sk';
6721	}
6722
6723	// TODO: use getTinCountryCode() instead of countryCodes
6724	var countryCodes = {
6725		'SVK': 'SK',
6726		'CZE': 'CZ',
6727		'HUN': 'HU',
6728		'BEL': 'BE',
6729		'BGR': 'BG',
6730		'CY': 'CY',
6731		'HRV': 'HR',
6732		'DNK': 'DK',
6733		'EST': 'EE',
6734		'FRA': 'FR',
6735		'FIN': 'FI',
6736		'HOL': 'NL',
6737		'LIT': 'LT',
6738		'LVA': 'LV',
6739		'LUX': 'LU',
6740		'DEU': 'DE',
6741		'POR': 'PT',
6742		'PLN': 'PL',
6743		'AUT': 'AT',
6744		'ROM': 'RO',
6745		'SVN': 'SI',
6746		'ITA': 'IT',
6747		'ESP': 'ES',
6748		'SWE': 'SE',
6749		'MT': 'MT',
6750		'EL': 'EL',
6751		'IE': 'IE',
6752	};
6753
6754	var tinLength = {
6755		'SK': 12,
6756		'CZ': 12,
6757		'HU': 10,
6758		'BE': 12,
6759		'BG': 12,
6760		'CY': 11,
6761		'HR': 13,
6762		'DK': 13,
6763		'EE': 11,
6764		'FR': 14,
6765		'FI': 10,
6766		'NL': 14,
6767		'LT': 14,
6768		'LV': 13,
6769		'LU': 10,
6770		'DE': 11,
6771		'PT': 11,
6772		'PL': 12,
6773		'AT': 11,
6774		'RO': 12,
6775		'SI': 10,
6776		'IT': 13,
6777		'ES': 11,
6778		'SE': 14,
6779		'MT': 10,
6780		'EL': 11,
6781		'IE': 11,
6782	};
6783
6784	var tinCountryCode = '';
6785	var selectedCountryCode = '';
6786	if ( tinField.val().length >= 2 ) {
6787		selectedCountryCode = tinField.val().substring(0,2);
6788		if ( Object.values(countryCodes).indexOf(selectedCountryCode) > -1 ) {
6789			tinCountryCode = selectedCountryCode;
6790		} else {
6791			if ( jQuery('#country').length > 0 ) {
6792				tinCountryCode = countryCodes[jQuery('#country').val()];
6793			} else {
6794				tinCountryCode = countryCodes[jQuery('#country_field').val()];
6795			}
6796		}
6797	} else {
6798		if ( jQuery('#country').length > 0 ) {
6799			tinCountryCode = countryCodes[jQuery('#country').val()];
6800		} else {
6801			tinCountryCode = countryCodes[jQuery('#country_field').val()];
6802		}
6803	}
6804
6805	if ( tinLength[tinCountryCode] !== 'undefined' && tinField.prop('maxlength') != tinLength[tinCountryCode] ) {
6806		tinField.prop('maxlength', tinLength[tinCountryCode]);
6807	}
6808
6809	if (tinField.val().length > tinField.prop('maxlength')) {
6810		tinField.val(tinField.val().substring(0, tinField.prop('maxlength')));
6811	}
6812
6813	var badChar = true;
6814	if (tinCountryCode != '' ) {
6815		badChar = !validTin(tinField.val(), tinCountryCode);
6816	}
6817
6818	jQuery('span.tin_error').remove();
6819	if (!badChar) {
6820		if ( !tinField.parent().hasClass('field') ) {
6821			tinLabel.css('color', '#545454');
6822		}
6823	} else {
6824		if ( !tinField.parent().hasClass('field') ) {
6825			tinLabel.css('color', '#f60');
6826		}
6827		formTinVerifyMessageSetter (tinField, badChar, tinCountryCode);
6828	}
6829	return badChar;
6830}
6831
6832function validTin(tinValue, country) {
6833	country = typeof country === 'undefined' ? 'SK' : getTinCountryCode(country);
6834
6835	var tinRegex = {
6836		'SK': '^SK[0-9]{10}$',
6837		'CZ': '^CZ[0-9]{8,10}$',
6838		'HU': '^HU[0-9]{8}$',
6839		'BE': '^BE[01]{1}[0-9]{9}$',
6840		'BG': '^BG[0-9]{9,10}$',
6841		'CY': '^CY[0-9]{8}[A-Z]{1}$',
6842		'HR': '^HR[0-9]{11}$',
6843		'DK': '^DK\\d{2} \\d{2} \\d{2} \\d{2}$',
6844		'EE': '^EE[0-9]{9}$',
6845		'FR': '^FR[A-Z0-9]{2} [0-9]{9}$',
6846		'FI': '^FI[0-9]{8}$',
6847		'NL': '^NL[A-Z0-9+*]{12}$',
6848		'LT': '^LT[0-9]{9}$|^LT[0-9]{12}$',
6849		'LV': '^LV[0-9]{11}$',
6850		'LU': '^LU[0-9]{8}$',
6851		'DE': '^DE[0-9]{9}$',
6852		'PT': '^PT[0-9]{9}$',
6853		'PL': '^PL[0-9]{10}$',
6854		'AT': '^ATU[0-9]{8}$',
6855		'RO': '^RO[0-9]{2,10}$',
6856		'SI': '^SI[0-9]{8}$',
6857		'IT': '^IT[0-9]{11}$',
6858		'ES': '^ES[A-Z]{1}\\d{7}[A-Z]{1}$|^ES[A-Z0-9]{1}\\d{7}[A-Z]{1}$|^ES[A-Z]{1}\\d{7}[A-Z0-9]{1}$',
6859		'SE': '^SE[0-9]{12}$',
6860		'MT': '^MT[0-9]{8}$',
6861		'EL': '^EL[0-9]{9}$',
6862		'IE': '^IE[0-9]{1}[A-Z0-9+*]{1}[0-9]{5}[A-Z]{1}$|^IE[0-9]{7}WI$',
6863		'UA': '^[0-9]{10}$',
6864	};
6865
6866	return RegExp(tinRegex[country]).test(jQuery.trim(tinValue));
6867}
6868
6869function getTinCountryCode(country) {
6870	if (country.length == 2) {
6871		return country;
6872	}
6873
6874	var countryCodes = {
6875		'SVK': 'SK',
6876		'CZE': 'CZ',
6877		'HUN': 'HU',
6878		'BEL': 'BE',
6879		'BGR': 'BG',
6880		'CY': 'CY',
6881		'HRV': 'HR',
6882		'DNK': 'DK',
6883		'EST': 'EE',
6884		'FRA': 'FR',
6885		'FIN': 'FI',
6886		'HOL': 'NL',
6887		'LIT': 'LT',
6888		'LVA': 'LV',
6889		'LUX': 'LU',
6890		'DEU': 'DE',
6891		'POR': 'PT',
6892		'PLN': 'PL',
6893		'AUT': 'AT',
6894		'ROM': 'RO',
6895		'SVN': 'SI',
6896		'ITA': 'IT',
6897		'ESP': 'ES',
6898		'SWE': 'SE',
6899		'MLT': 'MT',
6900		'GRC': 'EL',
6901		'IRL': 'IE',
6902		'UKR': 'UA',
6903	};
6904
6905	return countryCodes[country];
6906}
6907
6908function formTinVerifyMessageGetHint ( countryCode ) {
6909	// TODO: use getTinCountryCode() instead of countryCodes
6910	var countryCodes = {
6911		'SVK': 'SK',
6912		'CZE': 'CZ',
6913		'HUN': 'HU',
6914		'BEL': 'BE',
6915		'BGR': 'BG',
6916		'CY': 'CY',
6917		'HRV': 'HR',
6918		'DNK': 'DK',
6919		'EST': 'EE',
6920		'FRA': 'FR',
6921		'FIN': 'FI',
6922		'HOL': 'NL',
6923		'LIT': 'LT',
6924		'LVA': 'LV',
6925		'LUX': 'LU',
6926		'DEU': 'DE',
6927		'POR': 'PT',
6928		'PLN': 'PL',
6929		'AUT': 'AT',
6930		'ROM': 'RO',
6931		'SVN': 'SI',
6932		'ITA': 'IT',
6933		'ESP': 'ES',
6934		'SWE': 'SE',
6935		'MT': 'MT',
6936		'EL': 'EL',
6937		'IE': 'IE',
6938	};
6939
6940	var tinAllowedFormat = {
6941		'SK': 'SK1234567890',
6942		'CZ': 'CZ1234567890',
6943		'HU': 'HU12345678',
6944		'BE': 'BE0999999999, BE1999999999',
6945		'BG': 'BG999999999, BG9999999999',
6946		'CY': 'CY99999999X',
6947		'HR': 'HR99999999999',
6948		'DK': 'DK99 99 99 99',
6949		'EE': 'EE999999999',
6950		'FR': 'FRXX 999999999',
6951		'FI': 'FI99999999',
6952		'NL': 'NLXXXXXXXXXXXX',
6953		'LT': 'LT999999999, LT999999999999',
6954		'LV': 'LV99999999999',
6955		'LU': 'LU99999999',
6956		'DE': 'DE999999999',
6957		'PT': 'PT999999999',
6958		'PL': 'PL9999999999',
6959		'AT': 'ATU99999999',
6960		'RO': 'RO999999999',
6961		'SI': 'SI99999999',
6962		'IT': 'IT99999999999',
6963		'ES': 'ESX9999999X',
6964		'SE': 'SE999999999999',
6965		'MT': 'MT99999999',
6966		'EL': 'EL999999999',
6967		'IE': 'IE9S99999L, IE9999999WI'
6968	};
6969
6970	if ( countryCode in tinAllowedFormat ) {
6971		return tinAllowedFormat[countryCode];
6972	} else {
6973		if ( jQuery('#country').length > 0 ) {
6974			var selectedState = jQuery('#country').val();
6975		} else {
6976			var selectedState = jQuery('#country_field').val();
6977		}
6978
6979		if ( selectedState !== 'undefined' && selectedState in countryCodes ) {
6980			return tinAllowedFormat[countryCodes[selectedState]];
6981		} else {
6982			return tinAllowedFormat.SK;
6983		}
6984	}
6985}
6986
6987function formTinVerifyMessageSetter (tinField, errorCode, countryCode) {
6988	if ( typeof errorCode === 'undefined' ) {
6989		errorCode = false;
6990	}
6991
6992	if ( countryCode === '' ) {
6993		countryCode = 'SK';
6994	}
6995
6996	var errorMessage = '';
6997	var errorSpan = jQuery('<span class="tin_error" style="color:#f60;font-size:11px;"></span>');
6998	if ( errorCode && !tinField.parent().hasClass('field') ) {
6999		errorMessage = js_lang_one_step_checkout_company_tin_expected_format + ': ' + formTinVerifyMessageGetHint(countryCode);
7000		errorSpan.text(errorMessage).insertAfter(tinField);
7001	}
7002}
7003
7004function icoValidation() {
7005	const form = jQuery('form[name="adminForm"]');
7006
7007	if (!form.length) {
7008		return;
7009	}
7010
7011	const icoInput = form.find('input[name="extra_field_1"]');
7012	const icoDiv = form.find('div[id="extra_field_1_div"]');
7013
7014	const icoValidate = function() {
7015		const validatedICO = validateICO(icoInput.val());
7016
7017		icoInput.val(validatedICO.value);
7018		jQuery('span.ico_error').remove();
7019		icoDiv.css('color', '#000');
7020
7021		if (!validatedICO.valid) {
7022			icoDiv.css('color', '#f00');
7023			jQuery('<span class="ico_error" style="color:#FF0000;font-size:11px;">' + (config('js_Config_company_id_format.error') || js_lang_ico_error_validation) + '</span>').insertAfter(icoInput);
7024		}
7025	};
7026
7027	icoInput
7028		.on('blur', icoValidate)
7029		.parents('form:first')
7030		.find('button.button')
7031		.on('click', icoValidate);
7032}
7033
7034// jQuery(function() {
7035jQuery(function () {
7036	formTelVerify();
7037	js_modify_cart_item();
7038	icoValidation();
7039
7040	if ( typeof js_Config_reqistration_company_tin_required !== 'undefined' && js_Config_reqistration_company_tin_required ) {
7041		formTinVerify();
7042	}
7043
7044	// setnutioe do cookie ak som sa do flypage dostal cez shop_browse
7045    jQuery('#product_list').on('click', '.shop-category-product a', function(){
7046        Cookies.set('uWd1XhE4VhMPeRAa', 1, { path: '/', expires: 0.000057 } );
7047    });
7048});
7049
7050function js_modify_cart_item(){
7051
7052	if (typeof modify_cart_item == 'undefined' || jQuery.isEmptyObject(modify_cart_item)) return;
7053
7054	jQuery('input[name="dim_a"]').val(modify_cart_item.dim_a);
7055	jQuery('input[name="dim_b"]').val(modify_cart_item.dim_b);
7056	jQuery('input[name="quantity"]').val(modify_cart_item.dim_qty);
7057	jQuery('input[name="modify_cart_item"]').val(modify_cart_item.cart_item);
7058	jQuery('.prod_dim_box').prepend('<div class="modify_cart">'+js_lang_dynamic_attributes_modify_item+'</div>');
7059}
7060
7061
7062function js_ajax_cart_open_disabled() {
7063	return (jQuery('#m1').hasClass('shop_page_class_shop_cart')
7064			|| jQuery('#checkout_one_step').length);
7065}
7066
7067function switch_browse(elm, toggle) {
7068	var categoryId = jQuery(elm).data('category_id');
7069	if (categoryId === null || typeof categoryId === 'undefined' || categoryId === 'undefined') {
7070		categoryId = typeof js_category_id !== 'undefined' ? js_category_id : 0;
7071	}
7072	var getUrl = "/administrator/components/com_shop/html/shop.browse.ajax.php?ajax_call=1&ajax_func=set_shop_browse_as_listing_toggle&category_id=" + categoryId;
7073
7074	if (typeof toggle !== 'undefined') {
7075		getUrl += "&toggle=" + toggle;
7076	}
7077
7078	jQuery.get(getUrl, function(res) {
7079		if(jQuery.trim(res) == '1') {
7080			location.reload();
7081		}
7082	});
7083}
7084
7085function js_browse_count_control_btn_click (elem, action) {
7086	var input = jQuery(elem).parents('.quantity_wrapper:first').find('.shop-addtocart-quantity-inputbox');
7087	var value = parseInt(input.val());
7088	if (action == 'down' && value > 1) {
7089		input.val(value - 1);
7090	} else if (action == 'up') {
7091		input.val(value + 1);
7092	}
7093}
7094
7095function flypage_img_click(mainImage){
7096	// ak ma shop easyzoom a novy fancybox
7097	if (typeof mainImage !== 'undefined' && mainImage) {
7098		var href = jQuery('.flypage-lightbox-image-a').attr('href');
7099		jQuery('[href="' + href + '"]:not(.flypage-lightbox-image-a)').trigger('click');
7100		return false;
7101	}
7102
7103	var img_count = jQuery('.flypage-image a');
7104	if( img_count.length == 1 ){ // vacsinou TATO(situacia) v template je v .flypage-image jeden obrazok ( hlavny )
7105		jQuery('.flypage-image a').trigger('click');
7106		return false;
7107	}
7108	if( img_count.length > 1 ){ // niekedy v template .flypage-image je viacero obrazkov pri hlavnok a pri lightboxe potom pri kliku na obrazkok nenajde hlavy *alltoys.sk*
7109		jQuery('a.flypage-lightbox-image-a').trigger('click');
7110		return false;
7111	}
7112}
7113
7114function product_3d_image_preview_init(url) {
7115	vex.open({
7116		content: '<iframe src="'+ url +'" id="product_3d_image_preview_iframe" width="800" height="800" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" frameborder="0"></iframe>',
7117		//showCloseButton: true,
7118		//overlayClosesOnClick: true,
7119		className: 'vex vex-cs app_vex_wrap vex_3d_preview_image',
7120	});
7121}
7122
7123function dynamic_shipping_change_country(elem) {
7124	var jElem = jQuery(elem);
7125
7126	if (jElem.hasClass('active')) return;
7127
7128
7129	var dataElem = jElem.closest('.choose_country_btn_wrap').find('.choose_country_btn');
7130	var selectedCountry = jElem.data('active_country');
7131	var countryDiv = jQuery('.flypage_dynamic_shipping_inner.' + selectedCountry);
7132
7133	if (countryDiv.hasClass('selected')) return;
7134
7135	if (!countryDiv.children().length > 0) {
7136		//jQuery(countrySelect).startAjaxLoader();
7137
7138		var requestData = {
7139			productId: dataElem.data('id'),
7140			country: selectedCountry,
7141			price: dataElem.data('price'),
7142			weight: dataElem.data('weight')
7143		};
7144
7145		if (typeof requestData.productId === 'undefined') {
7146			return;
7147		}
7148
7149		new AjaxRequest(requestData)
7150			.setController('Product')
7151			.setAction('getProductDynamicShippingForCountry')
7152			.onSuccess(function (result) {
7153				//jQuery(countrySelect).stopAjaxLoader()
7154				jQuery('.choose_country_item').removeClass('active');
7155				jElem.addClass('active');
7156				jQuery('.choose_country_btn').html(jElem.html());
7157
7158
7159				jQuery('.flypage_dynamic_shipping_inner').removeClass('selected').hide();
7160				countryDiv.html(result.data);
7161				countryDiv.show().addClass('selected');
7162			})
7163			.onError(function (result) {
7164				//jQuery(countrySelect).stopAjaxLoader();
7165			})
7166			.send();
7167	} else {
7168		jQuery('.choose_country_item').removeClass('active');
7169		jElem.addClass('active');
7170		jQuery('.choose_country_btn').html(jElem.html());
7171
7172		jQuery('.flypage_dynamic_shipping_inner').removeClass('selected').hide();
7173		countryDiv.show().addClass('selected');
7174	}
7175}
7176
7177function dynamic_shipping_toggle_class(elem) {
7178	var jElem = jQuery(elem);
7179	jElem.closest('.flypage_dynamic_shipping').addClass('show_more_shippings');
7180}
7181
7182function filterShippingChange(elem) {
7183	var $elem = jQuery(elem);
7184	var name = $elem.attr('name');
7185	var value = $elem.val();
7186
7187	var parent = $elem.closest('.setting');
7188
7189	//dotatocne odstranenie error classy
7190	jQuery('body').removeClass('voucher_delivery_error');
7191
7192	parent.find('.setting_option').removeClass('option_active');
7193	$elem.closest('.setting_option').addClass('option_active');
7194
7195	var params = {};
7196	params[name] = value;
7197
7198	new AjaxRequest({params: params})
7199			.setController('Shipping')
7200			.setAction('setModuleFilterShipping')
7201			.onSuccess(function (result) {
7202				if( typeof result.data.refresh !== 'undefined' && result.data.refresh ) {
7203					// vycisti historiu (inak by duplikovalo requesty z kosika cartAdd, cartUpdate, cartDelete)
7204					if ( window.history.replaceState ) {
7205						window.history.replaceState( null, '', window.location.href );
7206					}
7207
7208					window.location.reload();
7209				}
7210			})
7211			.onError(function (result) {
7212			})
7213			.send();
7214}
7215
7216function changeGiftWrapShippingOption(product_id) {
7217
7218	new AjaxRequest({product_id: product_id})
7219		.setController('Shipping')
7220		.setAction('changeGiftWrapShippingOption')
7221		.onSuccess(function (result) {
7222			if (result.success && result.data.changed) {
7223				jQuery('#bt_diff:first').trigger('change');
7224				changeCheckoutTitleLangForShippingOption(product_id);
7225			}
7226		})
7227		.onError(function () {
7228		})
7229		.send();
7230}
7231
7232function changeCheckoutTitleLangForShippingOption(product_id) {
7233	const checkoutTitleLang = config(`js_Config_module_filter_shipping.internetOrPersonal.giftWrap.${js_get_lang}.${product_id}.checkoutTitleLang`);
7234
7235	if (!checkoutTitleLang) {
7236		return;
7237	}
7238
7239	jQuery('#checkout_one_step_heading').text(checkoutTitleLang);
7240}
7241
7242function showAvailabilityDescription(elem) {
7243	var elem = jQuery(elem);
7244	var productAvailability = elem.data('availability');
7245
7246	elem.tooltipster({
7247		content: productAvailability,
7248	});
7249}
7250
7251function initRotateActiveImages() {
7252	if (typeof js_rotate_active_images === 'object' && typeof js_rotate_active_images_data === 'object') {
7253		js_rotate_active_images.init(js_rotate_active_images_data);
7254
7255		if (typeof sphf !== 'undefined') {
7256			var timeStarted = jQuery.now();
7257			var sphfWait = function() {
7258				var sphfOnBrowseRequestFn = sphf.options.onBrowseRequest;
7259
7260				if (sphf.initialized) {
7261					sphf.options.onBrowseRequest = function() {
7262						if (typeof sphfOnBrowseRequestFn === 'function') {
7263							sphfOnBrowseRequestFn();
7264						}
7265
7266						if (typeof js_rotate_active_images_data === 'object') {
7267							js_rotate_active_images.init(js_rotate_active_images_data);
7268						}
7269					};
7270
7271				} else if (timeStarted + 30000 >= jQuery.now()) {
7272					setTimeout(function() {
7273						sphfWait();
7274
7275					}, 100);
7276				}
7277			};
7278
7279			sphfWait();
7280		}
7281	}
7282}
7283
7284//
7285jQuery(function() {
7286	initRotateActiveImages();
7287
7288	if (typeof js_rotate_active_images_detail_data === 'object') {
7289		js_rotate_active_images_detail.init(js_rotate_active_images_detail_data);
7290	}
7291
7292	var $sideContactForm = jQuery('#sideContactForm');
7293	if ($sideContactForm.length > 0) {
7294		var contactForm = $sideContactForm;
7295
7296		contactForm.find('.sideButton').on({
7297			'click': function() {
7298				contactForm.toggleClass('open');
7299			},
7300			'mouseover': function() {
7301				contactForm.addClass('open');
7302			}
7303		});
7304
7305		contactForm.on('mouseleave', function() {
7306			if(jQuery(this).find('input:focus, textarea:focus').length == 0) {
7307				contactForm.removeClass('open');
7308			}
7309		});
7310
7311		jQuery(document).on('click', function (e) {
7312			var closeWindow = true;
7313
7314			contactForm.find("input[type=text], textarea").each(function() {
7315				if(jQuery(this).val() != '') {
7316					closeWindow = false;
7317				}
7318			});
7319
7320			if (!jQuery(e.target).closest(contactForm).length && closeWindow) {
7321				contactForm.removeClass('open');
7322			}
7323		});
7324	}
7325
7326	var showAvailabilityDescription = typeof js_Config_product_availability_description !== 'undefined' && js_Config_product_availability_description;
7327
7328	if (showAvailabilityDescription) {
7329		var availabilityElements = jQuery('span[class*="shop_product_availability_value"]');
7330
7331		availabilityElements.each(function () {
7332			var $this = jQuery(this);
7333			var availabilityDescription = $this.data('description');
7334
7335			if (availabilityDescription) {
7336				var isProductDetail = $this.closest('.flypage-top').length;
7337				var inModule = $this.closest('.module-navst').length;
7338				var isBrowse = $this.closest('.shop-category-product').length || inModule;
7339				var isBasket = $this.closest('.shop_page_class_shop_cart').length;
7340				var isNsuOrderDetail = $this.closest('.shop_page_class_account_index').length;
7341				var isHomePage = $this.closest('.is_frontpage').length;
7342				var canShowInProductDetail = typeof js_Config_product_availability_description !== 'undefined' ? js_Config_product_availability_description.productDetails : false;
7343				var canShowInBrowse = typeof js_Config_product_availability_description !== 'undefined' ? js_Config_product_availability_description.browse : false;
7344				var canShowInBasket = false;
7345				var canShowInNsuOrderDetail = typeof js_Config_show_product_future_availability !== 'undefined' ? js_Config_show_product_future_availability.nsuOrderDetail : false;
7346
7347				var tooltipsterSettings = typeof availabilityDescriptionSettings !== 'undefined' && availabilityDescriptionSettings ? availabilityDescriptionSettings : null;
7348
7349				if (isProductDetail && canShowInProductDetail) {
7350					var tooltipsterCustomSettings = tooltipsterSettings && availabilityDescriptionSettings.productDetail ? availabilityDescriptionSettings.productDetail : null;
7351					var tooltipsterSide = tooltipsterCustomSettings && tooltipsterCustomSettings.side ? tooltipsterCustomSettings.side : 'right';
7352					var tooltipsterMaxWidth = tooltipsterCustomSettings && tooltipsterCustomSettings.maxWidth ? tooltipsterCustomSettings.maxWidth : 250;
7353
7354					$this.tooltipster({
7355						content: availabilityDescription,
7356						side: tooltipsterSide,
7357						maxWidth: tooltipsterMaxWidth,
7358					});
7359				}
7360
7361				if (isBrowse && canShowInBrowse) {
7362					var tooltipsterCustomSettings = tooltipsterSettings && availabilityDescriptionSettings.browse ? availabilityDescriptionSettings.browse : null;
7363					var tooltipsterSide = tooltipsterCustomSettings && tooltipsterCustomSettings.side ? tooltipsterCustomSettings.side : 'top';
7364					var tooltipsterMaxWidth = tooltipsterCustomSettings && tooltipsterCustomSettings.maxWidth ? tooltipsterCustomSettings.maxWidth : 250;
7365
7366					$this.tooltipster({
7367						content: availabilityDescription,
7368						side: tooltipsterSide,
7369						maxWidth: tooltipsterMaxWidth,
7370					});
7371				}
7372
7373				if ( canShowInBasket && isBasket ) {
7374					var tooltipsterCustomSettings = tooltipsterSettings && availabilityDescriptionSettings.browse ? availabilityDescriptionSettings.browse : null;
7375					var tooltipsterSide = tooltipsterCustomSettings && tooltipsterCustomSettings.side ? tooltipsterCustomSettings.side : 'top';
7376					var tooltipsterMaxWidth = tooltipsterCustomSettings && tooltipsterCustomSettings.maxWidth ? tooltipsterCustomSettings.maxWidth : 250;
7377
7378					$this.tooltipster({
7379						content: availabilityDescription,
7380						side: tooltipsterSide,
7381						maxWidth: tooltipsterMaxWidth,
7382					});
7383				}
7384
7385				if ( canShowInNsuOrderDetail && isNsuOrderDetail ) {
7386					var tooltipsterCustomSettings = tooltipsterSettings && availabilityDescriptionSettings.browse ? availabilityDescriptionSettings.browse : null;
7387					var tooltipsterSide = tooltipsterCustomSettings && tooltipsterCustomSettings.side ? tooltipsterCustomSettings.side : 'top';
7388					var tooltipsterMaxWidth = tooltipsterCustomSettings && tooltipsterCustomSettings.maxWidth ? tooltipsterCustomSettings.maxWidth : 250;
7389
7390					$this.tooltipster({
7391						content: availabilityDescription,
7392						side: tooltipsterSide,
7393						maxWidth: tooltipsterMaxWidth,
7394					});
7395				}
7396			}
7397		});
7398	}
7399
7400	if (typeof phpdebugbar !== 'undefined') {
7401		jQuery(document).ajaxComplete(function(event, jqXHR) {
7402			phpdebugbar.ajaxHandler.handle(jqXHR);
7403		});
7404	}
7405});
7406
7407
7408/* ========================================
7409 FILE: /includes/js/jquery/prettyphoto/js/jquery.prettyPhoto.js
7410 ==================== */
7411
7412/* ------------------------------------------------------------------------
7413 * Class: prettyPhoto
7414 * Use: Lightbox clone for jQuery
7415 * Author: Stephane Caron (http://www.no-margin-for-errors.com)
7416 * Version: 3.0.1
7417 * ------------------------------------------------------------------------- */
7418
7419(function($){$.prettyPhoto={version:'3.0'};$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend({animation_speed:'fast',pp_full_res_custom_class:'',slideshow:false,autoplay_slideshow:false,opacity:0.80,show_title:true,allow_resize:true,default_width:500,default_height:344,counter_separator_label:'/',theme:'facebook',hideflash:false,wmode:'opaque',autoplay:true,modal:false,overlay_gallery:true,keyboard_shortcuts:false,changepicturecallback:function(){},callback:function(){},markup:'<div class="pp_pic_holder"> \
7420      <div class="ppt">&nbsp;</div> \
7421      <div class="pp_top"> \
7422       <div class="pp_left"></div> \
7423       <div class="pp_middle"></div> \
7424       <div class="pp_right"></div> \
7425      </div> \
7426      <div class="pp_content_container"> \
7427       <div class="pp_left"> \
7428       <div class="pp_right"> \
7429        <div class="pp_content"> \
7430         <div class="pp_loaderIcon"></div> \
7431         <div class="pp_fade"> \
7432          <a href="#" class="pp_expand" title="Expand the image">Expand</a> \
7433          <div class="pp_hoverContainer"> \
7434           <a class="pp_next" href="#">next</a> \
7435           <a class="pp_previous" href="#">previous</a> \
7436          </div> \
7437          <div id="pp_full_res"></div> \
7438          <div class="pp_details clearfix"> \
7439           <p class="pp_description"></p> \
7440           <a class="pp_close" href="#">Close</a> \
7441           <div class="pp_nav"> \
7442            <a href="#" class="pp_arrow_previous">Previous</a> \
7443            <p class="currentTextHolder">0/0</p> \
7444            <a href="#" class="pp_arrow_next">Next</a> \
7445           </div> \
7446          </div> \
7447         </div> \
7448        </div> \
7449       </div> \
7450       </div> \
7451      </div> \
7452      <div class="pp_bottom"> \
7453       <div class="pp_left"></div> \
7454       <div class="pp_middle"></div> \
7455       <div class="pp_right"></div> \
7456      </div> \
7457     </div> \
7458     <div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> \
7459        <a href="#" class="pp_arrow_previous">Previous</a> \
7460        <ul> \
7461         {gallery} \
7462        </ul> \
7463        <a href="#" class="pp_arrow_next">Next</a> \
7464       </div>',image_markup:'<img id="fullResImage" src="" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',youtube_markup: '<iframe type="text/html" width="{width}" height="{height}" src ="{path}" frameborder="0" allowfullscreen="allowfullscreen" allowscriptaccess="allowscriptaccess" wmode="opaque"></iframe>',inline_markup:'<div class="pp_inline clearfix">{content}</div>',custom_markup:''},pp_settings);var matchedObjects=this,percentBased=false,correctSizes,pp_open,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),pp_slideshow;doresize=true,scroll_pos=_get_scroll();$(window).unbind('resize').resize(function(){_center_overlay();_resize_overlay();});if(pp_settings.keyboard_shortcuts){$(document).unbind('keydown').keydown(function(e){if(typeof $pp_pic_holder!='undefined'){if($pp_pic_holder.is(':visible')){switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');break;case 39:$.prettyPhoto.changePage('next');break;case 27:if(!settings.modal)
7465$.prettyPhoto.close();break;};return false;};};});}
7466$.prettyPhoto.initialize=function(){settings=pp_settings;
7467  if ( typeof(settings.pp_full_res_custom_class) != 'undefined' && settings.pp_full_res_custom_class != '' )
7468    settings.markup = settings.markup.replace('<div id="pp_full_res"></div>', '<div id="pp_full_res" class="' + settings.pp_full_res_custom_class + '"></div>'); 
7469  if($.browser.msie&&parseInt($.browser.version)==6)settings.theme="light_square";_buildOverlay(this);if(settings.allow_resize)
7470$(window).scroll(function(){_center_overlay();});_center_overlay();set_position=jQuery.inArray($(this).attr('href'),pp_images);$.prettyPhoto.open();return false;};
7471$.prettyPhoto.open=function(event){if(typeof settings=="undefined"){settings=pp_settings;if($.browser.msie&&$.browser.version==6)settings.theme="light_square";_buildOverlay(event.target);pp_images=$.makeArray(arguments[0]);pp_titles=(arguments[1])?$.makeArray(arguments[1]):$.makeArray("");pp_descriptions=(arguments[2])?$.makeArray(arguments[2]):$.makeArray("");isSet=(pp_images.length>1)?true:false;set_position=0;}
7472if($.browser.msie&&$.browser.version==6)$('select').css('visibility','hidden');if(settings.hideflash)$('object,embed').css('visibility','hidden');_checkPosition($(pp_images).length);$('.pp_loaderIcon').show();if($ppt.is(':hidden'))$ppt.css('opacity',0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((set_position+1)+settings.counter_separator_label+$(pp_images).length);$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));(settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined")?$ppt.html(unescape(pp_titles[set_position])):$ppt.html('&nbsp;');
7473
7474movie_width=(parseFloat(grab_param('width',pp_images[set_position])))?grab_param('width',pp_images[set_position]):settings.default_width.toString();
7475movie_height=(parseFloat(grab_param('height',pp_images[set_position])))?grab_param('height',pp_images[set_position]):settings.default_height.toString();
7476// movie_width = movie_height = '100%'; 
7477if(movie_width.indexOf('%')!=-1||movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-150);movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-150);percentBased=true;}else{percentBased=false;}
7478$pp_pic_holder.fadeIn(function(){imgPreloader="";switch(_getFileType(pp_images[set_position])){case'image':imgPreloader=new Image();nextImage=new Image();if(isSet&&set_position>$(pp_images).length)nextImage.src=pp_images[set_position+1];prevImage=new Image();if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup;$pp_pic_holder.find('#fullResImage').attr('src',pp_images[set_position]);imgPreloader.onload=function(){correctSizes=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.onerror=function(){alert('Image cannot be loaded. Make sure the path is correct and image exist.');$.prettyPhoto.close();};imgPreloader.src=pp_images[set_position];break;case'youtube':if (grab_param('resize_to',pp_images[set_position])=='height')movie_width=Math.floor(movie_height*1.77)-38;correctSizes=_fitToViewport(movie_width,movie_height);movie='//www.youtube.com/embed/'+grab_param('v',pp_images[set_position])+'?';if(settings.autoplay)movie+="?autoplay=1";
7479			
7480// if(grab_param('hd',pp_images[set_position])) movie+="&hd="+grab_param('hd',pp_images[set_position]);
7481if(grab_param('hd',pp_images[set_position])) movie+="&vq=hd720";
7482if(grab_param('fs',pp_images[set_position])) movie+="&fs="+grab_param('fs',pp_images[set_position]);
7483if(grab_param('showinfo',pp_images[set_position])) movie+="&showinfo="+grab_param('showinfo',pp_images[set_position]);
7484if (typeof(console) != 'undefined') console.log('YT-movie', movie);
7485
7486if(grab_param('t',pp_images[set_position])) movie+="&start="+grab_param('t',pp_images[set_position]);movie+="&showsearch=0&rel=0";toInject=settings.youtube_markup.replace(/{width}/g,correctSizes.width).replace(/{height}/g,correctSizes.height).replace(/{path}/g,movie);break;case'vimeo':correctSizes=_fitToViewport(movie_width,movie_height);movie_id=pp_images[set_position];var regExp=/http:\/\/(www\.)?vimeo.com\/(\d+)/;var match=movie_id.match(regExp);movie='http://player.vimeo.com/video/'+match[2]+'?title=0&amp;byline=0&amp;portrait=0';if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=correctSizes.width+'/embed/?moog_width='+correctSizes.width;toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,correctSizes.height).replace(/{path}/g,movie);break;case'quicktime':correctSizes=_fitToViewport(movie_width,movie_height);correctSizes.height+=15;correctSizes.contentHeight+=15;correctSizes.containerHeight+=15;toInject=settings.quicktime_markup.replace(/{width}/g,correctSizes.width).replace(/{height}/g,correctSizes.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':correctSizes=_fitToViewport(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars')+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf('?'));toInject=settings.flash_markup.replace(/{width}/g,correctSizes.width).replace(/{height}/g,correctSizes.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);break;case'iframe':correctSizes=_fitToViewport(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);toInject=settings.iframe_markup.replace(/{width}/g,correctSizes.width).replace(/{height}/g,correctSizes.height).replace(/{path}/g,frame_url);break;case'custom':correctSizes=_fitToViewport(movie_width,movie_height);toInject=settings.custom_markup;break;case'inline':myClone=$(pp_images[set_position]).clone().css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo($('body'));correctSizes=_fitToViewport($(myClone).width(),$(myClone).height());$(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());break;};if(!imgPreloader){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});return false;};$.prettyPhoto.changePage=function(direction){currentGalleryPage=0;if(direction=='previous'){set_position--;if(set_position<0){set_position=0;return;};}else if(direction=='next'){set_position++;if(set_position>$(pp_images).length-1){set_position=0;}}else{set_position=direction;};
7486if(!doresize)doresize=true;$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');_hideContent(function(){$.prettyPhoto.open();});};$.prettyPhoto.changeGalleryPage=function(direction){if(direction=='next'){currentGalleryPage++;if(currentGalleryPage>totalPage){currentGalleryPage=0;};}else if(direction=='previous'){currentGalleryPage--;if(currentGalleryPage<0){currentGalleryPage=totalPage;};}else{currentGalleryPage=direction;};itemsToSlide=(currentGalleryPage==totalPage)?pp_images.length-((totalPage)*itemsPerPage):itemsPerPage;$pp_pic_holder.find('.pp_gallery li').each(function(i){$(this).animate({'left':(i*itemWidth)-((itemsToSlide*itemWidth)*currentGalleryPage)});});};$.prettyPhoto.startSlideshow=function(){if(typeof pp_slideshow=='undefined'){$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){$.prettyPhoto.stopSlideshow();return false;});pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow);}else{$.prettyPhoto.changePage('next');};};
7487$.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});clearInterval(pp_slideshow);pp_slideshow=undefined;};
7488$.prettyPhoto.close=function(){clearInterval(pp_slideshow);$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){$(this).remove();});$pp_overlay.fadeOut(settings.animation_speed,function(){if($.browser.msie&&$.browser.version==6)$('select').css('visibility','visible');if(settings.hideflash)$('object,embed').css('visibility','visible');$(this).remove();settings.callback();doresize=true;pp_open=false;delete settings;});};_showContent=function(){$('.pp_loaderIcon').hide();$ppt.fadeTo(settings.animation_speed,1);if ( isNaN(correctSizes.contentHeight) )correctSizes.contentHeight = 1;projectedTop=scroll_pos.scrollTop+((windowHeight/2)-(correctSizes.containerHeight/2));if(projectedTop<0)projectedTop=0;if ( isNaN(projectedTop) )projectedTop = 1;$pp_pic_holder.find('.pp_content').animate({'height':correctSizes.contentHeight},settings.animation_speed);$pp_pic_holder.animate({'top':projectedTop,'left':(windowWidth/2)-(correctSizes.containerWidth/2),'width':correctSizes.containerWidth},settings.animation_speed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(correctSizes.height).width(correctSizes.width);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed);if(isSet&&_getFileType(pp_images[set_position])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();}
7489if(correctSizes.resized)$('a.pp_expand,a.pp_contract').fadeIn(settings.animation_speed);if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open)$.prettyPhoto.startSlideshow();settings.changepicturecallback();pp_open=true;});_insert_gallery();};function _hideContent(callback){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){$('.pp_loaderIcon').show();callback();});};function _checkPosition(setCount){if(set_position==setCount-1){$pp_pic_holder.find('a.pp_next').css('visibility','hidden');$pp_pic_holder.find('a.pp_next').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_next').css('visibility','visible');$pp_pic_holder.find('a.pp_next.disabled').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('next');return false;});};if(set_position==0){$pp_pic_holder.find('a.pp_previous').css('visibility','hidden').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_previous.disabled').css('visibility','visible').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('previous');return false;});};(setCount>1)?$('.pp_nav').show():$('.pp_nav').hide();};function _fitToViewport(width,height){resized=false;_getDimensions(width,height);imageWidth=width,imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allow_resize&&!percentBased){resized=true,fitting=false;while(!fitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{fitting=true;};pp_containerHeight=imageHeight,pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);};return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(pp_containerHeight),containerWidth:Math.floor(pp_containerWidth)+40,contentHeight:Math.floor(pp_contentHeight),contentWidth:Math.floor(pp_contentWidth),resized:resized};};function _getDimensions(width,height){width=parseFloat(width);height=parseFloat(height);$pp_details=$pp_pic_holder.find('.pp_details');$pp_details.width(width);detailsHeight=parseFloat($pp_details.css('marginTop'))+parseFloat($pp_details.css('marginBottom'));$pp_details=$pp_details.clone().appendTo($('body')).css({'position':'absolute','top':-10000});detailsHeight+=$pp_details.height();
7489detailsHeight=(detailsHeight<=34)?36:detailsHeight;if($.browser.msie&&$.browser.version==7)detailsHeight+=8;$pp_details.remove();pp_contentHeight=height+detailsHeight;pp_contentWidth=width;pp_containerHeight=pp_contentHeight+$ppt.height()+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width;}
7490function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com/i)){return'youtube';}else if(itemSrc.match(/vimeo\.com/i)){return'vimeo';}else if(itemSrc.indexOf('.mov')!=-1){return'quicktime';}else if(itemSrc.indexOf('.swf')!=-1){return'flash';}else if(itemSrc.indexOf('iframe')!=-1){return'iframe';}else if(itemSrc.indexOf('custom')!=-1){return'custom';}else if(itemSrc.substr(0,1)=='#'){return'inline';}else{return'image';};};function _center_overlay(){if(doresize&&typeof $pp_pic_holder!='undefined'){scroll_pos=_get_scroll();titleHeight=$ppt.height(),contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scroll_pos.scrollTop-(contentHeight/2);$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scroll_pos.scrollLeft-(contentwidth/2)});};};function _get_scroll(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};};};function _resize_overlay(){windowHeight=$(window).height(),windowWidth=$(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height($(document).height());};function _insert_gallery(){if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=(settings.theme=="facebook")?58:38;itemsPerPage=Math.floor((correctSizes.containerWidth-100-navWidth)/itemWidth);itemsPerPage=(itemsPerPage<pp_images.length)?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$pp_pic_holder.find('.pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous').hide();}else{$pp_pic_holder.find('.pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous').show();};galleryWidth=itemsPerPage*itemWidth+navWidth;$pp_pic_holder.find('.pp_gallery').width(galleryWidth).css('margin-left',-(galleryWidth/2));$pp_pic_holder.find('.pp_gallery ul').width(itemsPerPage*itemWidth).find('li.selected').removeClass('selected');goToPage=(Math.floor(set_position/itemsPerPage)<=totalPage)?Math.floor(set_position/itemsPerPage):totalPage;if(itemsPerPage){$pp_pic_holder.find('.pp_gallery').hide().show().removeClass('disabled');}else{$pp_pic_holder.find('.pp_gallery').hide().addClass('disabled');}
7491$.prettyPhoto.changeGalleryPage(goToPage);$pp_pic_holder.find('.pp_gallery ul li:eq('+set_position+')').addClass('selected');}else{$pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');$pp_pic_holder.find('.pp_gallery').hide();}}
7492function _buildOverlay(caller){theRel=$(caller).attr('rel');galleryRegExp=/\[(?:.*)\]/;isSet=(galleryRegExp.exec(theRel))?true:false;pp_images=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return $(n).attr('href');}):$.makeArray($(caller).attr('href'));pp_titles=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).find('img').attr('alt'))?$(n).find('img').attr('alt'):"";}):$.makeArray($(caller).find('img').attr('alt'));pp_descriptions=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).attr('title'))?$(n).attr('title'):"";}):$.makeArray($(caller).attr('title'));$('body').append(settings.markup);$pp_pic_holder=$('.pp_pic_holder'),$ppt=$('.ppt'),$pp_overlay=$('div.pp_overlay');if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var i=0;i<pp_images.length;i++){var regex=new RegExp("(.*?)\.(jpg|jpeg|png|gif)$");var results=regex.exec(pp_images[i]);if(!results){classname='default';}else{classname='';}
7493toInject+="<li class='"+classname+"'><a href='#'><img src='"+pp_images[i]+"' width='50' alt='' /></a></li>";};toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find('#pp_full_res').after(toInject);$pp_pic_holder.find('.pp_gallery .pp_arrow_next').click(function(){$.prettyPhoto.changeGalleryPage('next');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_gallery .pp_arrow_previous').click(function(){$.prettyPhoto.changeGalleryPage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_content').hover(function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();},function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();});itemWidth=52+5;$pp_pic_holder.find('.pp_gallery ul li').each(function(i){$(this).css({'position':'absolute','left':i*itemWidth});$(this).find('a').unbind('click').click(function(){$.prettyPhoto.changePage(i);$.prettyPhoto.stopSlideshow();return false;});});};if(settings.slideshow){$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>');
7494$pp_pic_holder.find('.pp_nav .pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});}
7495$pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0/*,'height':'100%'*/,'height':$(document).height()/*,'width':$(document).width()*/}).bind('click',function(){if(!settings.modal)js_prettyphoto_close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(e){if($(this).hasClass('pp_expand')){$(this).removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$(this).removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open();});return false;});$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');$.prettyPhoto.stopSlideshow();return false;});_center_overlay();};return this.unbind('click').click($.prettyPhoto.initialize);};function grab_param(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);return(results==null)?"":results[1];}})(jQuery);
7496
7497
7498/* ========================================
7499 FILE: /includes/js/jquery/jquery-ui-1.14.0/jquery-ui.js
7500 ==================== */
7501
7502/*! jQuery UI - v1.14.0 - 2024-08-05
7503* https://jqueryui.com
7504* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
7505* Copyright OpenJS Foundation and other contributors; Licensed MIT */
7506
7507( function( factory ) {
7508	"use strict";
7509
7510	if ( typeof define === "function" && define.amd ) {
7511
7512		// AMD. Register as an anonymous module.
7513		define( [ "jquery" ], factory );
7514	} else {
7515
7516		// Browser globals
7517		factory( jQuery );
7518	}
7519} )( function( $ ) {
7520"use strict";
7521
7522$.ui = $.ui || {};
7523
7524var version = $.ui.version = "1.14.0";
7525
7526
7527/*!
7528 * jQuery UI Widget 1.14.0
vendor: 8,451 bytes, lines 7528-7831
7528
7529 * https://jqueryui.com
7530 *
7531 * Copyright OpenJS Foundation and other contributors
7532 * Released under the MIT license.
7533 * https://jquery.org/license
7534 */
7535
7536//>>label: Widget
7537//>>group: Core
7538//>>description: Provides a factory for creating stateful widgets with a common API.
7539//>>docs: https://api.jqueryui.com/jQuery.widget/
7540//>>demos: https://jqueryui.com/widget/
7541
7542
7543var widgetUuid = 0;
7544var widgetHasOwnProperty = Array.prototype.hasOwnProperty;
7545var widgetSlice = Array.prototype.slice;
7546
7547$.cleanData = ( function( orig ) {
7548	return function( elems ) {
7549		var events, elem, i;
7550		for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
7551
7552			// Only trigger remove when necessary to save time
7553			events = $._data( elem, "events" );
7554			if ( events && events.remove ) {
7555				$( elem ).triggerHandler( "remove" );
7556			}
7557		}
7558		orig( elems );
7559	};
7560} )( $.cleanData );
7561
7562$.widget = function( name, base, prototype ) {
7563	var existingConstructor, constructor, basePrototype;
7564
7565	// ProxiedPrototype allows the provided prototype to remain unmodified
7566	// so that it can be used as a mixin for multiple widgets (#8876)
7567	var proxiedPrototype = {};
7568
7569	var namespace = name.split( "." )[ 0 ];
7570	name = name.split( "." )[ 1 ];
7571	var fullName = namespace + "-" + name;
7572
7573	if ( !prototype ) {
7574		prototype = base;
7575		base = $.Widget;
7576	}
7577
7578	if ( Array.isArray( prototype ) ) {
7579		prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
7580	}
7581
7582	// Create selector for plugin
7583	$.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) {
7584		return !!$.data( elem, fullName );
7585	};
7586
7587	$[ namespace ] = $[ namespace ] || {};
7588	existingConstructor = $[ namespace ][ name ];
7589	constructor = $[ namespace ][ name ] = function( options, element ) {
7590
7591		// Allow instantiation without "new" keyword
7592		if ( !this || !this._createWidget ) {
7593			return new constructor( options, element );
7594		}
7595
7596		// Allow instantiation without initializing for simple inheritance
7597		// must use "new" keyword (the code above always passes args)
7598		if ( arguments.length ) {
7599			this._createWidget( options, element );
7600		}
7601	};
7602
7603	// Extend with the existing constructor to carry over any static properties
7604	$.extend( constructor, existingConstructor, {
7605		version: prototype.version,
7606
7607		// Copy the object used to create the prototype in case we need to
7608		// redefine the widget later
7609		_proto: $.extend( {}, prototype ),
7610
7611		// Track widgets that inherit from this widget in case this widget is
7612		// redefined after a widget inherits from it
7613		_childConstructors: []
7614	} );
7615
7616	basePrototype = new base();
7617
7618	// We need to make the options hash a property directly on the new instance
7619	// otherwise we'll modify the options hash on the prototype that we're
7620	// inheriting from
7621	basePrototype.options = $.widget.extend( {}, basePrototype.options );
7622	$.each( prototype, function( prop, value ) {
7623		if ( typeof value !== "function" ) {
7624			proxiedPrototype[ prop ] = value;
7625			return;
7626		}
7627		proxiedPrototype[ prop ] = ( function() {
7628			function _super() {
7629				return base.prototype[ prop ].apply( this, arguments );
7630			}
7631
7632			function _superApply( args ) {
7633				return base.prototype[ prop ].apply( this, args );
7634			}
7635
7636			return function() {
7637				var __super = this._super;
7638				var __superApply = this._superApply;
7639				var returnValue;
7640
7641				this._super = _super;
7642				this._superApply = _superApply;
7643
7644				returnValue = value.apply( this, arguments );
7645
7646				this._super = __super;
7647				this._superApply = __superApply;
7648
7649				return returnValue;
7650			};
7651		} )();
7652	} );
7653	constructor.prototype = $.widget.extend( basePrototype, {
7654
7655		// TODO: remove support for widgetEventPrefix
7656		// always use the name + a colon as the prefix, e.g., draggable:start
7657		// don't prefix for widgets that aren't DOM-based
7658		widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name
7659	}, proxiedPrototype, {
7660		constructor: constructor,
7661		namespace: namespace,
7662		widgetName: name,
7663		widgetFullName: fullName
7664	} );
7665
7666	// If this widget is being redefined then we need to find all widgets that
7667	// are inheriting from it and redefine all of them so that they inherit from
7668	// the new version of this widget. We're essentially trying to replace one
7669	// level in the prototype chain.
7670	if ( existingConstructor ) {
7671		$.each( existingConstructor._childConstructors, function( i, child ) {
7672			var childPrototype = child.prototype;
7673
7674			// Redefine the child widget using the same prototype that was
7675			// originally used, but inherit from the new version of the base
7676			$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor,
7677				child._proto );
7678		} );
7679
7680		// Remove the list of existing child constructors from the old constructor
7681		// so the old child constructors can be garbage collected
7682		delete existingConstructor._childConstructors;
7683	} else {
7684		base._childConstructors.push( constructor );
7685	}
7686
7687	$.widget.bridge( name, constructor );
7688
7689	return constructor;
7690};
7691
7692$.widget.extend = function( target ) {
7693	var input = widgetSlice.call( arguments, 1 );
7694	var inputIndex = 0;
7695	var inputLength = input.length;
7696	var key;
7697	var value;
7698
7699	for ( ; inputIndex < inputLength; inputIndex++ ) {
7700		for ( key in input[ inputIndex ] ) {
7701			value = input[ inputIndex ][ key ];
7702			if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) {
7703
7704				// Clone objects
7705				if ( $.isPlainObject( value ) ) {
7706					target[ key ] = $.isPlainObject( target[ key ] ) ?
7707						$.widget.extend( {}, target[ key ], value ) :
7708
7709						// Don't extend strings, arrays, etc. with objects
7710						$.widget.extend( {}, value );
7711
7712				// Copy everything else by reference
7713				} else {
7714					target[ key ] = value;
7715				}
7716			}
7717		}
7718	}
7719	return target;
7720};
7721
7722$.widget.bridge = function( name, object ) {
7723	var fullName = object.prototype.widgetFullName || name;
7724	$.fn[ name ] = function( options ) {
7725		var isMethodCall = typeof options === "string";
7726		var args = widgetSlice.call( arguments, 1 );
7727		var returnValue = this;
7728
7729		if ( isMethodCall ) {
7730
7731			// If this is an empty collection, we need to have the instance method
7732			// return undefined instead of the jQuery instance
7733			if ( !this.length && options === "instance" ) {
7734				returnValue = undefined;
7735			} else {
7736				this.each( function() {
7737					var methodValue;
7738					var instance = $.data( this, fullName );
7739
7740					if ( options === "instance" ) {
7741						returnValue = instance;
7742						return false;
7743					}
7744
7745					if ( !instance ) {
7746						return $.error( "cannot call methods on " + name +
7747							" prior to initialization; " +
7748							"attempted to call method '" + options + "'" );
7749					}
7750
7751					if ( typeof instance[ options ] !== "function" ||
7752						options.charAt( 0 ) === "_" ) {
7753						return $.error( "no such method '" + options + "' for " + name +
7754							" widget instance" );
7755					}
7756
7757					methodValue = instance[ options ].apply( instance, args );
7758
7759					if ( methodValue !== instance && methodValue !== undefined ) {
7760						returnValue = methodValue && methodValue.jquery ?
7761							returnValue.pushStack( methodValue.get() ) :
7762							methodValue;
7763						return false;
7764					}
7765				} );
7766			}
7767		} else {
7768
7769			// Allow multiple hashes to be passed on init
7770			if ( args.length ) {
7771				options = $.widget.extend.apply( null, [ options ].concat( args ) );
7772			}
7773
7774			this.each( function() {
7775				var instance = $.data( this, fullName );
7776				if ( instance ) {
7777					instance.option( options || {} );
7778					if ( instance._init ) {
7779						instance._init();
7780					}
7781				} else {
7782					$.data( this, fullName, new object( options, this ) );
7783				}
7784			} );
7785		}
7786
7787		return returnValue;
7788	};
7789};
7790
7791$.Widget = function( /* options, element */ ) {};
7792$.Widget._childConstructors = [];
7793
7794$.Widget.prototype = {
7795	widgetName: "widget",
7796	widgetEventPrefix: "",
7797	defaultElement: "<div>",
7798
7799	options: {
7800		classes: {},
7801		disabled: false,
7802
7803		// Callbacks
7804		create: null
7805	},
7806
7807	_createWidget: function( options, element ) {
7808		element = $( element || this.defaultElement || this )[ 0 ];
7809		this.element = $( element );
7810		this.uuid = widgetUuid++;
7811		this.eventNamespace = "." + this.widgetName + this.uuid;
7812
7813		this.bindings = $();
7814		this.hoverable = $();
7815		this.focusable = $();
7816		this.classesElementLookup = {};
7817
7818		if ( element !== this ) {
7819			$.data( element, this.widgetFullName, this );
7820			this._on( true, this.element, {
7821				remove: function( event ) {
7822					if ( event.target === element ) {
7823						this.destroy();
7824					}
7825				}
7826			} );
7827			this.document = $( element.style ?
7828
7829				// Element within the document
7830				element.ownerDocument :
7831
vendor: 11,563 bytes, lines 7832-8270
7832				// Element is window or document
7833				element.document || element );
7834			this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );
7835		}
7836
7837		this.options = $.widget.extend( {},
7838			this.options,
7839			this._getCreateOptions(),
7840			options );
7841
7842		this._create();
7843
7844		if ( this.options.disabled ) {
7845			this._setOptionDisabled( this.options.disabled );
7846		}
7847
7848		this._trigger( "create", null, this._getCreateEventData() );
7849		this._init();
7850	},
7851
7852	_getCreateOptions: function() {
7853		return {};
7854	},
7855
7856	_getCreateEventData: $.noop,
7857
7858	_create: $.noop,
7859
7860	_init: $.noop,
7861
7862	destroy: function() {
7863		var that = this;
7864
7865		this._destroy();
7866		$.each( this.classesElementLookup, function( key, value ) {
7867			that._removeClass( value, key );
7868		} );
7869
7870		// We can probably remove the unbind calls in 2.0
7871		// all event bindings should go through this._on()
7872		this.element
7873			.off( this.eventNamespace )
7874			.removeData( this.widgetFullName );
7875		this.widget()
7876			.off( this.eventNamespace )
7877			.removeAttr( "aria-disabled" );
7878
7879		// Clean up events and states
7880		this.bindings.off( this.eventNamespace );
7881	},
7882
7883	_destroy: $.noop,
7884
7885	widget: function() {
7886		return this.element;
7887	},
7888
7889	option: function( key, value ) {
7890		var options = key;
7891		var parts;
7892		var curOption;
7893		var i;
7894
7895		if ( arguments.length === 0 ) {
7896
7897			// Don't return a reference to the internal hash
7898			return $.widget.extend( {}, this.options );
7899		}
7900
7901		if ( typeof key === "string" ) {
7902
7903			// Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
7904			options = {};
7905			parts = key.split( "." );
7906			key = parts.shift();
7907			if ( parts.length ) {
7908				curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
7909				for ( i = 0; i < parts.length - 1; i++ ) {
7910					curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
7911					curOption = curOption[ parts[ i ] ];
7912				}
7913				key = parts.pop();
7914				if ( arguments.length === 1 ) {
7915					return curOption[ key ] === undefined ? null : curOption[ key ];
7916				}
7917				curOption[ key ] = value;
7918			} else {
7919				if ( arguments.length === 1 ) {
7920					return this.options[ key ] === undefined ? null : this.options[ key ];
7921				}
7922				options[ key ] = value;
7923			}
7924		}
7925
7926		this._setOptions( options );
7927
7928		return this;
7929	},
7930
7931	_setOptions: function( options ) {
7932		var key;
7933
7934		for ( key in options ) {
7935			this._setOption( key, options[ key ] );
7936		}
7937
7938		return this;
7939	},
7940
7941	_setOption: function( key, value ) {
7942		if ( key === "classes" ) {
7943			this._setOptionClasses( value );
7944		}
7945
7946		this.options[ key ] = value;
7947
7948		if ( key === "disabled" ) {
7949			this._setOptionDisabled( value );
7950		}
7951
7952		return this;
7953	},
7954
7955	_setOptionClasses: function( value ) {
7956		var classKey, elements, currentElements;
7957
7958		for ( classKey in value ) {
7959			currentElements = this.classesElementLookup[ classKey ];
7960			if ( value[ classKey ] === this.options.classes[ classKey ] ||
7961					!currentElements ||
7962					!currentElements.length ) {
7963				continue;
7964			}
7965
7966			// We are doing this to create a new jQuery object because the _removeClass() call
7967			// on the next line is going to destroy the reference to the current elements being
7968			// tracked. We need to save a copy of this collection so that we can add the new classes
7969			// below.
7970			elements = $( currentElements.get() );
7971			this._removeClass( currentElements, classKey );
7972
7973			// We don't use _addClass() here, because that uses this.options.classes
7974			// for generating the string of classes. We want to use the value passed in from
7975			// _setOption(), this is the new value of the classes option which was passed to
7976			// _setOption(). We pass this value directly to _classes().
7977			elements.addClass( this._classes( {
7978				element: elements,
7979				keys: classKey,
7980				classes: value,
7981				add: true
7982			} ) );
7983		}
7984	},
7985
7986	_setOptionDisabled: function( value ) {
7987		this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value );
7988
7989		// If the widget is becoming disabled, then nothing is interactive
7990		if ( value ) {
7991			this._removeClass( this.hoverable, null, "ui-state-hover" );
7992			this._removeClass( this.focusable, null, "ui-state-focus" );
7993		}
7994	},
7995
7996	enable: function() {
7997		return this._setOptions( { disabled: false } );
7998	},
7999
8000	disable: function() {
8001		return this._setOptions( { disabled: true } );
8002	},
8003
8004	_classes: function( options ) {
8005		var full = [];
8006		var that = this;
8007
8008		options = $.extend( {
8009			element: this.element,
8010			classes: this.options.classes || {}
8011		}, options );
8012
8013		function bindRemoveEvent() {
8014			var nodesToBind = [];
8015
8016			options.element.each( function( _, element ) {
8017				var isTracked = $.map( that.classesElementLookup, function( elements ) {
8018					return elements;
8019				} )
8020					.some( function( elements ) {
8021						return elements.is( element );
8022					} );
8023
8024				if ( !isTracked ) {
8025					nodesToBind.push( element );
8026				}
8027			} );
8028
8029			that._on( $( nodesToBind ), {
8030				remove: "_untrackClassesElement"
8031			} );
8032		}
8033
8034		function processClassString( classes, checkOption ) {
8035			var current, i;
8036			for ( i = 0; i < classes.length; i++ ) {
8037				current = that.classesElementLookup[ classes[ i ] ] || $();
8038				if ( options.add ) {
8039					bindRemoveEvent();
8040					current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) );
8041				} else {
8042					current = $( current.not( options.element ).get() );
8043				}
8044				that.classesElementLookup[ classes[ i ] ] = current;
8045				full.push( classes[ i ] );
8046				if ( checkOption && options.classes[ classes[ i ] ] ) {
8047					full.push( options.classes[ classes[ i ] ] );
8048				}
8049			}
8050		}
8051
8052		if ( options.keys ) {
8053			processClassString( options.keys.match( /\S+/g ) || [], true );
8054		}
8055		if ( options.extra ) {
8056			processClassString( options.extra.match( /\S+/g ) || [] );
8057		}
8058
8059		return full.join( " " );
8060	},
8061
8062	_untrackClassesElement: function( event ) {
8063		var that = this;
8064		$.each( that.classesElementLookup, function( key, value ) {
8065			if ( $.inArray( event.target, value ) !== -1 ) {
8066				that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
8067			}
8068		} );
8069
8070		this._off( $( event.target ) );
8071	},
8072
8073	_removeClass: function( element, keys, extra ) {
8074		return this._toggleClass( element, keys, extra, false );
8075	},
8076
8077	_addClass: function( element, keys, extra ) {
8078		return this._toggleClass( element, keys, extra, true );
8079	},
8080
8081	_toggleClass: function( element, keys, extra, add ) {
8082		add = ( typeof add === "boolean" ) ? add : extra;
8083		var shift = ( typeof element === "string" || element === null ),
8084			options = {
8085				extra: shift ? keys : extra,
8086				keys: shift ? element : keys,
8087				element: shift ? this.element : element,
8088				add: add
8089			};
8090		options.element.toggleClass( this._classes( options ), add );
8091		return this;
8092	},
8093
8094	_on: function( suppressDisabledCheck, element, handlers ) {
8095		var delegateElement;
8096		var instance = this;
8097
8098		// No suppressDisabledCheck flag, shuffle arguments
8099		if ( typeof suppressDisabledCheck !== "boolean" ) {
8100			handlers = element;
8101			element = suppressDisabledCheck;
8102			suppressDisabledCheck = false;
8103		}
8104
8105		// No element argument, shuffle and use this.element
8106		if ( !handlers ) {
8107			handlers = element;
8108			element = this.element;
8109			delegateElement = this.widget();
8110		} else {
8111			element = delegateElement = $( element );
8112			this.bindings = this.bindings.add( element );
8113		}
8114
8115		$.each( handlers, function( event, handler ) {
8116			function handlerProxy() {
8117
8118				// Allow widgets to customize the disabled handling
8119				// - disabled as an array instead of boolean
8120				// - disabled class as method for disabling individual parts
8121				if ( !suppressDisabledCheck &&
8122						( instance.options.disabled === true ||
8123						$( this ).hasClass( "ui-state-disabled" ) ) ) {
8124					return;
8125				}
8126				return ( typeof handler === "string" ? instance[ handler ] : handler )
8127					.apply( instance, arguments );
8128			}
8129
8130			// Copy the guid so direct unbinding works
8131			if ( typeof handler !== "string" ) {
8132				handlerProxy.guid = handler.guid =
8133					handler.guid || handlerProxy.guid || $.guid++;
8134			}
8135
8136			var match = event.match( /^([\w:-]*)\s*(.*)$/ );
8137			var eventName = match[ 1 ] + instance.eventNamespace;
8138			var selector = match[ 2 ];
8139
8140			if ( selector ) {
8141				delegateElement.on( eventName, selector, handlerProxy );
8142			} else {
8143				element.on( eventName, handlerProxy );
8144			}
8145		} );
8146	},
8147
8148	_off: function( element, eventName ) {
8149		eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +
8150			this.eventNamespace;
8151		element.off( eventName );
8152
8153		// Clear the stack to avoid memory leaks (#10056)
8154		this.bindings = $( this.bindings.not( element ).get() );
8155		this.focusable = $( this.focusable.not( element ).get() );
8156		this.hoverable = $( this.hoverable.not( element ).get() );
8157	},
8158
8159	_delay: function( handler, delay ) {
8160		function handlerProxy() {
8161			return ( typeof handler === "string" ? instance[ handler ] : handler )
8162				.apply( instance, arguments );
8163		}
8164		var instance = this;
8165		return setTimeout( handlerProxy, delay || 0 );
8166	},
8167
8168	_hoverable: function( element ) {
8169		this.hoverable = this.hoverable.add( element );
8170		this._on( element, {
8171			mouseenter: function( event ) {
8172				this._addClass( $( event.currentTarget ), null, "ui-state-hover" );
8173			},
8174			mouseleave: function( event ) {
8175				this._removeClass( $( event.currentTarget ), null, "ui-state-hover" );
8176			}
8177		} );
8178	},
8179
8180	_focusable: function( element ) {
8181		this.focusable = this.focusable.add( element );
8182		this._on( element, {
8183			focusin: function( event ) {
8184				this._addClass( $( event.currentTarget ), null, "ui-state-focus" );
8185			},
8186			focusout: function( event ) {
8187				this._removeClass( $( event.currentTarget ), null, "ui-state-focus" );
8188			}
8189		} );
8190	},
8191
8192	_trigger: function( type, event, data ) {
8193		var prop, orig;
8194		var callback = this.options[ type ];
8195
8196		data = data || {};
8197		event = $.Event( event );
8198		event.type = ( type === this.widgetEventPrefix ?
8199			type :
8200			this.widgetEventPrefix + type ).toLowerCase();
8201
8202		// The original event may come from any element
8203		// so we need to reset the target on the new event
8204		event.target = this.element[ 0 ];
8205
8206		// Copy original event properties over to the new event
8207		orig = event.originalEvent;
8208		if ( orig ) {
8209			for ( prop in orig ) {
8210				if ( !( prop in event ) ) {
8211					event[ prop ] = orig[ prop ];
8212				}
8213			}
8214		}
8215
8216		this.element.trigger( event, data );
8217		return !( typeof callback === "function" &&
8218			callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||
8219			event.isDefaultPrevented() );
8220	}
8221};
8222
8223$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
8224	$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
8225		if ( typeof options === "string" ) {
8226			options = { effect: options };
8227		}
8228
8229		var hasOptions;
8230		var effectName = !options ?
8231			method :
8232			options === true || typeof options === "number" ?
8233				defaultEffect :
8234				options.effect || defaultEffect;
8235
8236		options = options || {};
8237		if ( typeof options === "number" ) {
8238			options = { duration: options };
8239		} else if ( options === true ) {
8240			options = {};
8241		}
8242
8243		hasOptions = !$.isEmptyObject( options );
8244		options.complete = callback;
8245
8246		if ( options.delay ) {
8247			element.delay( options.delay );
8248		}
8249
8250		if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
8251			element[ method ]( options );
8252		} else if ( effectName !== method && element[ effectName ] ) {
8253			element[ effectName ]( options.duration, options.easing, callback );
8254		} else {
8255			element.queue( function( next ) {
8256				$( this )[ method ]();
8257				if ( callback ) {
8258					callback.call( element[ 0 ] );
8259				}
8260				next();
8261			} );
8262		}
8263	};
8264} );
8265
8266var widget = $.widget;
8267
8268
8269/*!
8270 * jQuery UI Position 1.14.
vendor: 3,861 bytes, lines 8270-8413
82700
8271 * https://jqueryui.com
8272 *
8273 * Copyright OpenJS Foundation and other contributors
8274 * Released under the MIT license.
8275 * https://jquery.org/license
8276 *
8277 * https://api.jqueryui.com/position/
8278 */
8279
8280//>>label: Position
8281//>>group: Core
8282//>>description: Positions elements relative to other elements.
8283//>>docs: https://api.jqueryui.com/position/
8284//>>demos: https://jqueryui.com/position/
8285
8286
8287( function() {
8288var cachedScrollbarWidth,
8289	max = Math.max,
8290	abs = Math.abs,
8291	rhorizontal = /left|center|right/,
8292	rvertical = /top|center|bottom/,
8293	roffset = /[\+\-]\d+(\.[\d]+)?%?/,
8294	rposition = /^\w+/,
8295	rpercent = /%$/,
8296	_position = $.fn.position;
8297
8298function getOffsets( offsets, width, height ) {
8299	return [
8300		parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
8301		parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
8302	];
8303}
8304
8305function parseCss( element, property ) {
8306	return parseInt( $.css( element, property ), 10 ) || 0;
8307}
8308
8309function isWindow( obj ) {
8310	return obj != null && obj === obj.window;
8311}
8312
8313function getDimensions( elem ) {
8314	var raw = elem[ 0 ];
8315	if ( raw.nodeType === 9 ) {
8316		return {
8317			width: elem.width(),
8318			height: elem.height(),
8319			offset: { top: 0, left: 0 }
8320		};
8321	}
8322	if ( isWindow( raw ) ) {
8323		return {
8324			width: elem.width(),
8325			height: elem.height(),
8326			offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
8327		};
8328	}
8329	if ( raw.preventDefault ) {
8330		return {
8331			width: 0,
8332			height: 0,
8333			offset: { top: raw.pageY, left: raw.pageX }
8334		};
8335	}
8336	return {
8337		width: elem.outerWidth(),
8338		height: elem.outerHeight(),
8339		offset: elem.offset()
8340	};
8341}
8342
8343$.position = {
8344	scrollbarWidth: function() {
8345		if ( cachedScrollbarWidth !== undefined ) {
8346			return cachedScrollbarWidth;
8347		}
8348		var w1, w2,
8349			div = $( "<div style=" +
8350				"'display:block;position:absolute;width:200px;height:200px;overflow:hidden;'>" +
8351				"<div style='height:300px;width:auto;'></div></div>" ),
8352			innerDiv = div.children()[ 0 ];
8353
8354		$( "body" ).append( div );
8355		w1 = innerDiv.offsetWidth;
8356		div.css( "overflow", "scroll" );
8357
8358		w2 = innerDiv.offsetWidth;
8359
8360		if ( w1 === w2 ) {
8361			w2 = div[ 0 ].clientWidth;
8362		}
8363
8364		div.remove();
8365
8366		return ( cachedScrollbarWidth = w1 - w2 );
8367	},
8368	getScrollInfo: function( within ) {
8369		var overflowX = within.isWindow || within.isDocument ? "" :
8370				within.element.css( "overflow-x" ),
8371			overflowY = within.isWindow || within.isDocument ? "" :
8372				within.element.css( "overflow-y" ),
8373			hasOverflowX = overflowX === "scroll" ||
8374				( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ),
8375			hasOverflowY = overflowY === "scroll" ||
8376				( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight );
8377		return {
8378			width: hasOverflowY ? $.position.scrollbarWidth() : 0,
8379			height: hasOverflowX ? $.position.scrollbarWidth() : 0
8380		};
8381	},
8382	getWithinInfo: function( element ) {
8383		var withinElement = $( element || window ),
8384			isElemWindow = isWindow( withinElement[ 0 ] ),
8385			isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,
8386			hasOffset = !isElemWindow && !isDocument;
8387		return {
8388			element: withinElement,
8389			isWindow: isElemWindow,
8390			isDocument: isDocument,
8391			offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },
8392			scrollLeft: withinElement.scrollLeft(),
8393			scrollTop: withinElement.scrollTop(),
8394			width: withinElement.outerWidth(),
8395			height: withinElement.outerHeight()
8396		};
8397	}
8398};
8399
8400$.fn.position = function( options ) {
8401	if ( !options || !options.of ) {
8402		return _position.apply( this, arguments );
8403	}
8404
8405	// Make a copy, we don't want to modify arguments
8406	options = $.extend( {}, options );
8407
8408	var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
8409
8410		// Make sure string options are treated as CSS selectors
8411		target = typeof options.of === "string" ?
8412			$( document ).find( options.of ) :
8413			$( options.of ),
vendor: 10,992 bytes, lines 8414-8767
8414
8415		within = $.position.getWithinInfo( options.within ),
8416		scrollInfo = $.position.getScrollInfo( within ),
8417		collision = ( options.collision || "flip" ).split( " " ),
8418		offsets = {};
8419
8420	dimensions = getDimensions( target );
8421	if ( target[ 0 ].preventDefault ) {
8422
8423		// Force left top to allow flipping
8424		options.at = "left top";
8425	}
8426	targetWidth = dimensions.width;
8427	targetHeight = dimensions.height;
8428	targetOffset = dimensions.offset;
8429
8430	// Clone to reuse original targetOffset later
8431	basePosition = $.extend( {}, targetOffset );
8432
8433	// Force my and at to have valid horizontal and vertical positions
8434	// if a value is missing or invalid, it will be converted to center
8435	$.each( [ "my", "at" ], function() {
8436		var pos = ( options[ this ] || "" ).split( " " ),
8437			horizontalOffset,
8438			verticalOffset;
8439
8440		if ( pos.length === 1 ) {
8441			pos = rhorizontal.test( pos[ 0 ] ) ?
8442				pos.concat( [ "center" ] ) :
8443				rvertical.test( pos[ 0 ] ) ?
8444					[ "center" ].concat( pos ) :
8445					[ "center", "center" ];
8446		}
8447		pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
8448		pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
8449
8450		// Calculate offsets
8451		horizontalOffset = roffset.exec( pos[ 0 ] );
8452		verticalOffset = roffset.exec( pos[ 1 ] );
8453		offsets[ this ] = [
8454			horizontalOffset ? horizontalOffset[ 0 ] : 0,
8455			verticalOffset ? verticalOffset[ 0 ] : 0
8456		];
8457
8458		// Reduce to just the positions without the offsets
8459		options[ this ] = [
8460			rposition.exec( pos[ 0 ] )[ 0 ],
8461			rposition.exec( pos[ 1 ] )[ 0 ]
8462		];
8463	} );
8464
8465	// Normalize collision option
8466	if ( collision.length === 1 ) {
8467		collision[ 1 ] = collision[ 0 ];
8468	}
8469
8470	if ( options.at[ 0 ] === "right" ) {
8471		basePosition.left += targetWidth;
8472	} else if ( options.at[ 0 ] === "center" ) {
8473		basePosition.left += targetWidth / 2;
8474	}
8475
8476	if ( options.at[ 1 ] === "bottom" ) {
8477		basePosition.top += targetHeight;
8478	} else if ( options.at[ 1 ] === "center" ) {
8479		basePosition.top += targetHeight / 2;
8480	}
8481
8482	atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
8483	basePosition.left += atOffset[ 0 ];
8484	basePosition.top += atOffset[ 1 ];
8485
8486	return this.each( function() {
8487		var collisionPosition, using,
8488			elem = $( this ),
8489			elemWidth = elem.outerWidth(),
8490			elemHeight = elem.outerHeight(),
8491			marginLeft = parseCss( this, "marginLeft" ),
8492			marginTop = parseCss( this, "marginTop" ),
8493			collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) +
8494				scrollInfo.width,
8495			collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) +
8496				scrollInfo.height,
8497			position = $.extend( {}, basePosition ),
8498			myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
8499
8500		if ( options.my[ 0 ] === "right" ) {
8501			position.left -= elemWidth;
8502		} else if ( options.my[ 0 ] === "center" ) {
8503			position.left -= elemWidth / 2;
8504		}
8505
8506		if ( options.my[ 1 ] === "bottom" ) {
8507			position.top -= elemHeight;
8508		} else if ( options.my[ 1 ] === "center" ) {
8509			position.top -= elemHeight / 2;
8510		}
8511
8512		position.left += myOffset[ 0 ];
8513		position.top += myOffset[ 1 ];
8514
8515		collisionPosition = {
8516			marginLeft: marginLeft,
8517			marginTop: marginTop
8518		};
8519
8520		$.each( [ "left", "top" ], function( i, dir ) {
8521			if ( $.ui.position[ collision[ i ] ] ) {
8522				$.ui.position[ collision[ i ] ][ dir ]( position, {
8523					targetWidth: targetWidth,
8524					targetHeight: targetHeight,
8525					elemWidth: elemWidth,
8526					elemHeight: elemHeight,
8527					collisionPosition: collisionPosition,
8528					collisionWidth: collisionWidth,
8529					collisionHeight: collisionHeight,
8530					offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
8531					my: options.my,
8532					at: options.at,
8533					within: within,
8534					elem: elem
8535				} );
8536			}
8537		} );
8538
8539		if ( options.using ) {
8540
8541			// Adds feedback as second argument to using callback, if present
8542			using = function( props ) {
8543				var left = targetOffset.left - position.left,
8544					right = left + targetWidth - elemWidth,
8545					top = targetOffset.top - position.top,
8546					bottom = top + targetHeight - elemHeight,
8547					feedback = {
8548						target: {
8549							element: target,
8550							left: targetOffset.left,
8551							top: targetOffset.top,
8552							width: targetWidth,
8553							height: targetHeight
8554						},
8555						element: {
8556							element: elem,
8557							left: position.left,
8558							top: position.top,
8559							width: elemWidth,
8560							height: elemHeight
8561						},
8562						horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
8563						vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
8564					};
8565				if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
8566					feedback.horizontal = "center";
8567				}
8568				if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
8569					feedback.vertical = "middle";
8570				}
8571				if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
8572					feedback.important = "horizontal";
8573				} else {
8574					feedback.important = "vertical";
8575				}
8576				options.using.call( this, props, feedback );
8577			};
8578		}
8579
8580		elem.offset( $.extend( position, { using: using } ) );
8581	} );
8582};
8583
8584$.ui.position = {
8585	fit: {
8586		left: function( position, data ) {
8587			var within = data.within,
8588				withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
8589				outerWidth = within.width,
8590				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
8591				overLeft = withinOffset - collisionPosLeft,
8592				overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
8593				newOverRight;
8594
8595			// Element is wider than within
8596			if ( data.collisionWidth > outerWidth ) {
8597
8598				// Element is initially over the left side of within
8599				if ( overLeft > 0 && overRight <= 0 ) {
8600					newOverRight = position.left + overLeft + data.collisionWidth - outerWidth -
8601						withinOffset;
8602					position.left += overLeft - newOverRight;
8603
8604				// Element is initially over right side of within
8605				} else if ( overRight > 0 && overLeft <= 0 ) {
8606					position.left = withinOffset;
8607
8608				// Element is initially over both left and right sides of within
8609				} else {
8610					if ( overLeft > overRight ) {
8611						position.left = withinOffset + outerWidth - data.collisionWidth;
8612					} else {
8613						position.left = withinOffset;
8614					}
8615				}
8616
8617			// Too far left -> align with left edge
8618			} else if ( overLeft > 0 ) {
8619				position.left += overLeft;
8620
8621			// Too far right -> align with right edge
8622			} else if ( overRight > 0 ) {
8623				position.left -= overRight;
8624
8625			// Adjust based on position and margin
8626			} else {
8627				position.left = max( position.left - collisionPosLeft, position.left );
8628			}
8629		},
8630		top: function( position, data ) {
8631			var within = data.within,
8632				withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
8633				outerHeight = data.within.height,
8634				collisionPosTop = position.top - data.collisionPosition.marginTop,
8635				overTop = withinOffset - collisionPosTop,
8636				overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
8637				newOverBottom;
8638
8639			// Element is taller than within
8640			if ( data.collisionHeight > outerHeight ) {
8641
8642				// Element is initially over the top of within
8643				if ( overTop > 0 && overBottom <= 0 ) {
8644					newOverBottom = position.top + overTop + data.collisionHeight - outerHeight -
8645						withinOffset;
8646					position.top += overTop - newOverBottom;
8647
8648				// Element is initially over bottom of within
8649				} else if ( overBottom > 0 && overTop <= 0 ) {
8650					position.top = withinOffset;
8651
8652				// Element is initially over both top and bottom of within
8653				} else {
8654					if ( overTop > overBottom ) {
8655						position.top = withinOffset + outerHeight - data.collisionHeight;
8656					} else {
8657						position.top = withinOffset;
8658					}
8659				}
8660
8661			// Too far up -> align with top
8662			} else if ( overTop > 0 ) {
8663				position.top += overTop;
8664
8665			// Too far down -> align with bottom edge
8666			} else if ( overBottom > 0 ) {
8667				position.top -= overBottom;
8668
8669			// Adjust based on position and margin
8670			} else {
8671				position.top = max( position.top - collisionPosTop, position.top );
8672			}
8673		}
8674	},
8675	flip: {
8676		left: function( position, data ) {
8677			var within = data.within,
8678				withinOffset = within.offset.left + within.scrollLeft,
8679				outerWidth = within.width,
8680				offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
8681				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
8682				overLeft = collisionPosLeft - offsetLeft,
8683				overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
8684				myOffset = data.my[ 0 ] === "left" ?
8685					-data.elemWidth :
8686					data.my[ 0 ] === "right" ?
8687						data.elemWidth :
8688						0,
8689				atOffset = data.at[ 0 ] === "left" ?
8690					data.targetWidth :
8691					data.at[ 0 ] === "right" ?
8692						-data.targetWidth :
8693						0,
8694				offset = -2 * data.offset[ 0 ],
8695				newOverRight,
8696				newOverLeft;
8697
8698			if ( overLeft < 0 ) {
8699				newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -
8700					outerWidth - withinOffset;
8701				if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
8702					position.left += myOffset + atOffset + offset;
8703				}
8704			} else if ( overRight > 0 ) {
8705				newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +
8706					atOffset + offset - offsetLeft;
8707				if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
8708					position.left += myOffset + atOffset + offset;
8709				}
8710			}
8711		},
8712		top: function( position, data ) {
8713			var within = data.within,
8714				withinOffset = within.offset.top + within.scrollTop,
8715				outerHeight = within.height,
8716				offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
8717				collisionPosTop = position.top - data.collisionPosition.marginTop,
8718				overTop = collisionPosTop - offsetTop,
8719				overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
8720				top = data.my[ 1 ] === "top",
8721				myOffset = top ?
8722					-data.elemHeight :
8723					data.my[ 1 ] === "bottom" ?
8724						data.elemHeight :
8725						0,
8726				atOffset = data.at[ 1 ] === "top" ?
8727					data.targetHeight :
8728					data.at[ 1 ] === "bottom" ?
8729						-data.targetHeight :
8730						0,
8731				offset = -2 * data.offset[ 1 ],
8732				newOverTop,
8733				newOverBottom;
8734			if ( overTop < 0 ) {
8735				newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -
8736					outerHeight - withinOffset;
8737				if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
8738					position.top += myOffset + atOffset + offset;
8739				}
8740			} else if ( overBottom > 0 ) {
8741				newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +
8742					offset - offsetTop;
8743				if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
8744					position.top += myOffset + atOffset + offset;
8745				}
8746			}
8747		}
8748	},
8749	flipfit: {
8750		left: function() {
8751			$.ui.position.flip.left.apply( this, arguments );
8752			$.ui.position.fit.left.apply( this, arguments );
8753		},
8754		top: function() {
8755			$.ui.position.flip.top.apply( this, arguments );
8756			$.ui.position.fit.top.apply( this, arguments );
8757		}
8758	}
8759};
8760
8761} )();
8762
8763var position = $.ui.position;
8764
8765
8766/*!
8767 * jQuery UI :data 1.1
87674.0
8768 * https://jqueryui.com
8769 *
8770 * Copyright OpenJS Foundation and other contributors
8771 * Released under the MIT license.
8772 * https://jquery.org/license
8773 */
8774
8775//>>label: :data Selector
8776//>>group: Core
8777//>>description: Selects elements which have data stored under the specified key.
8778//>>docs: https://api.jqueryui.com/data-selector/
8779
8780
8781var data = $.extend( $.expr.pseudos, {
8782	data: $.expr.createPseudo( function( dataName ) {
8783		return function( elem ) {
8784			return !!$.data( elem, dataName );
8785		};
8786	} )
8787} );
8788
8789/*!
8790 * jQuery UI Disable Selection 1.14.0
vendor: 16,993 bytes, lines 8790-9510
8790
8791 * https://jqueryui.com
8792 *
8793 * Copyright OpenJS Foundation and other contributors
8794 * Released under the MIT license.
8795 * https://jquery.org/license
8796 */
8797
8798//>>label: disableSelection
8799//>>group: Core
8800//>>description: Disable selection of text content within the set of matched elements.
8801//>>docs: https://api.jqueryui.com/disableSelection/
8802
8803// This file is deprecated
8804
8805var disableSelection = $.fn.extend( {
8806	disableSelection: ( function() {
8807		var eventType = "onselectstart" in document.createElement( "div" ) ?
8808			"selectstart" :
8809			"mousedown";
8810
8811		return function() {
8812			return this.on( eventType + ".ui-disableSelection", function( event ) {
8813				event.preventDefault();
8814			} );
8815		};
8816	} )(),
8817
8818	enableSelection: function() {
8819		return this.off( ".ui-disableSelection" );
8820	}
8821} );
8822
8823
8824
8825// Create a local jQuery because jQuery Color relies on it and the
8826// global may not exist with AMD and a custom build (#10199).
8827// This module is a noop if used as a regular AMD module.
8828// eslint-disable-next-line no-unused-vars
8829var jQuery = $;
8830
8831
8832/*!
8833 * jQuery Color Animations v3.0.0
8834 * https://github.com/jquery/jquery-color
8835 *
8836 * Copyright OpenJS Foundation and other contributors
8837 * Released under the MIT license.
8838 * https://jquery.org/license
8839 *
8840 * Date: Wed May 15 16:49:44 2024 +0200
8841 */
8842
8843
8844	var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor " +
8845		"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
8846
8847	class2type = {},
8848	toString = class2type.toString,
8849
8850	// plusequals test for += 100 -= 100
8851	rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
8852
8853	// a set of RE's that can match strings and generate color tuples.
8854	stringParsers = [ {
8855			re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
8856			parse: function( execResult ) {
8857				return [
8858					execResult[ 1 ],
8859					execResult[ 2 ],
8860					execResult[ 3 ],
8861					execResult[ 4 ]
8862				];
8863			}
8864		}, {
8865			re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
8866			parse: function( execResult ) {
8867				return [
8868					execResult[ 1 ] * 2.55,
8869					execResult[ 2 ] * 2.55,
8870					execResult[ 3 ] * 2.55,
8871					execResult[ 4 ]
8872				];
8873			}
8874		}, {
8875
8876			// this regex ignores A-F because it's compared against an already lowercased string
8877			re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,
8878			parse: function( execResult ) {
8879				return [
8880					parseInt( execResult[ 1 ], 16 ),
8881					parseInt( execResult[ 2 ], 16 ),
8882					parseInt( execResult[ 3 ], 16 ),
8883					execResult[ 4 ] ?
8884						( parseInt( execResult[ 4 ], 16 ) / 255 ).toFixed( 2 ) :
8885						1
8886				];
8887			}
8888		}, {
8889
8890			// this regex ignores A-F because it's compared against an already lowercased string
8891			re: /#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,
8892			parse: function( execResult ) {
8893				return [
8894					parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
8895					parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
8896					parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ),
8897					execResult[ 4 ] ?
8898						( parseInt( execResult[ 4 ] + execResult[ 4 ], 16 ) / 255 )
8899							.toFixed( 2 ) :
8900						1
8901				];
8902			}
8903		}, {
8904			re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
8905			space: "hsla",
8906			parse: function( execResult ) {
8907				return [
8908					execResult[ 1 ],
8909					execResult[ 2 ] / 100,
8910					execResult[ 3 ] / 100,
8911					execResult[ 4 ]
8912				];
8913			}
8914		} ],
8915
8916	// jQuery.Color( )
8917	color = jQuery.Color = function( color, green, blue, alpha ) {
8918		return new jQuery.Color.fn.parse( color, green, blue, alpha );
8919	},
8920	spaces = {
8921		rgba: {
8922			props: {
8923				red: {
8924					idx: 0,
8925					type: "byte"
8926				},
8927				green: {
8928					idx: 1,
8929					type: "byte"
8930				},
8931				blue: {
8932					idx: 2,
8933					type: "byte"
8934				}
8935			}
8936		},
8937
8938		hsla: {
8939			props: {
8940				hue: {
8941					idx: 0,
8942					type: "degrees"
8943				},
8944				saturation: {
8945					idx: 1,
8946					type: "percent"
8947				},
8948				lightness: {
8949					idx: 2,
8950					type: "percent"
8951				}
8952			}
8953		}
8954	},
8955	propTypes = {
8956		"byte": {
8957			floor: true,
8958			max: 255
8959		},
8960		"percent": {
8961			max: 1
8962		},
8963		"degrees": {
8964			mod: 360,
8965			floor: true
8966		}
8967	},
8968
8969	// colors = jQuery.Color.names
8970	colors,
8971
8972	// local aliases of functions called often
8973	each = jQuery.each;
8974
8975// define cache name and alpha properties
8976// for rgba and hsla spaces
8977each( spaces, function( spaceName, space ) {
8978	space.cache = "_" + spaceName;
8979	space.props.alpha = {
8980		idx: 3,
8981		type: "percent",
8982		def: 1
8983	};
8984} );
8985
8986// Populate the class2type map
8987jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
8988	function( _i, name ) {
8989		class2type[ "[object " + name + "]" ] = name.toLowerCase();
8990	} );
8991
8992function getType( obj ) {
8993	if ( obj == null ) {
8994		return obj + "";
8995	}
8996
8997	return typeof obj === "object" ?
8998		class2type[ toString.call( obj ) ] || "object" :
8999		typeof obj;
9000}
9001
9002function clamp( value, prop, allowEmpty ) {
9003	var type = propTypes[ prop.type ] || {};
9004
9005	if ( value == null ) {
9006		return ( allowEmpty || !prop.def ) ? null : prop.def;
9007	}
9008
9009	// ~~ is an short way of doing floor for positive numbers
9010	value = type.floor ? ~~value : parseFloat( value );
9011
9012	if ( type.mod ) {
9013
9014		// we add mod before modding to make sure that negatives values
9015		// get converted properly: -10 -> 350
9016		return ( value + type.mod ) % type.mod;
9017	}
9018
9019	// for now all property types without mod have min and max
9020	return Math.min( type.max, Math.max( 0, value ) );
9021}
9022
9023function stringParse( string ) {
9024	var inst = color(),
9025		rgba = inst._rgba = [];
9026
9027	string = string.toLowerCase();
9028
9029	each( stringParsers, function( _i, parser ) {
9030		var parsed,
9031			match = parser.re.exec( string ),
9032			values = match && parser.parse( match ),
9033			spaceName = parser.space || "rgba";
9034
9035		if ( values ) {
9036			parsed = inst[ spaceName ]( values );
9037
9038			// if this was an rgba parse the assignment might happen twice
9039			// oh well....
9040			inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
9041			rgba = inst._rgba = parsed._rgba;
9042
9043			// exit each( stringParsers ) here because we matched
9044			return false;
9045		}
9046	} );
9047
9048	// Found a stringParser that handled it
9049	if ( rgba.length ) {
9050
9051		// if this came from a parsed string, force "transparent" when alpha is 0
9052		// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
9053		if ( rgba.join() === "0,0,0,0" ) {
9054			jQuery.extend( rgba, colors.transparent );
9055		}
9056		return inst;
9057	}
9058
9059	// named colors
9060	return colors[ string ];
9061}
9062
9063color.fn = jQuery.extend( color.prototype, {
9064	parse: function( red, green, blue, alpha ) {
9065		if ( red === undefined ) {
9066			this._rgba = [ null, null, null, null ];
9067			return this;
9068		}
9069		if ( red.jquery || red.nodeType ) {
9070			red = jQuery( red ).css( green );
9071			green = undefined;
9072		}
9073
9074		var inst = this,
9075			type = getType( red ),
9076			rgba = this._rgba = [];
9077
9078		// more than 1 argument specified - assume ( red, green, blue, alpha )
9079		if ( green !== undefined ) {
9080			red = [ red, green, blue, alpha ];
9081			type = "array";
9082		}
9083
9084		if ( type === "string" ) {
9085			return this.parse( stringParse( red ) || colors._default );
9086		}
9087
9088		if ( type === "array" ) {
9089			each( spaces.rgba.props, function( _key, prop ) {
9090				rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
9091			} );
9092			return this;
9093		}
9094
9095		if ( type === "object" ) {
9096			if ( red instanceof color ) {
9097				each( spaces, function( _spaceName, space ) {
9098					if ( red[ space.cache ] ) {
9099						inst[ space.cache ] = red[ space.cache ].slice();
9100					}
9101				} );
9102			} else {
9103				each( spaces, function( _spaceName, space ) {
9104					var cache = space.cache;
9105					each( space.props, function( key, prop ) {
9106
9107						// if the cache doesn't exist, and we know how to convert
9108						if ( !inst[ cache ] && space.to ) {
9109
9110							// if the value was null, we don't need to copy it
9111							// if the key was alpha, we don't need to copy it either
9112							if ( key === "alpha" || red[ key ] == null ) {
9113								return;
9114							}
9115							inst[ cache ] = space.to( inst._rgba );
9116						}
9117
9118						// this is the only case where we allow nulls for ALL properties.
9119						// call clamp with alwaysAllowEmpty
9120						inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
9121					} );
9122
9123					// everything defined but alpha?
9124					if ( inst[ cache ] && jQuery.inArray(
9125						null,
9126						inst[ cache ].slice( 0, 3 )
9127					) < 0 ) {
9128
9129						// use the default of 1
9130						if ( inst[ cache ][ 3 ] == null ) {
9131							inst[ cache ][ 3 ] = 1;
9132						}
9133
9134						if ( space.from ) {
9135							inst._rgba = space.from( inst[ cache ] );
9136						}
9137					}
9138				} );
9139			}
9140			return this;
9141		}
9142	},
9143	is: function( compare ) {
9144		var is = color( compare ),
9145			same = true,
9146			inst = this;
9147
9148		each( spaces, function( _, space ) {
9149			var localCache,
9150				isCache = is[ space.cache ];
9151			if ( isCache ) {
9152				localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
9153				each( space.props, function( _, prop ) {
9154					if ( isCache[ prop.idx ] != null ) {
9155						same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
9156						return same;
9157					}
9158				} );
9159			}
9160			return same;
9161		} );
9162		return same;
9163	},
9164	_space: function() {
9165		var used = [],
9166			inst = this;
9167		each( spaces, function( spaceName, space ) {
9168			if ( inst[ space.cache ] ) {
9169				used.push( spaceName );
9170			}
9171		} );
9172		return used.pop();
9173	},
9174	transition: function( other, distance ) {
9175		var end = color( other ),
9176			spaceName = end._space(),
9177			space = spaces[ spaceName ],
9178			startColor = this.alpha() === 0 ? color( "transparent" ) : this,
9179			start = startColor[ space.cache ] || space.to( startColor._rgba ),
9180			result = start.slice();
9181
9182		end = end[ space.cache ];
9183		each( space.props, function( _key, prop ) {
9184			var index = prop.idx,
9185				startValue = start[ index ],
9186				endValue = end[ index ],
9187				type = propTypes[ prop.type ] || {};
9188
9189			// if null, don't override start value
9190			if ( endValue === null ) {
9191				return;
9192			}
9193
9194			// if null - use end
9195			if ( startValue === null ) {
9196				result[ index ] = endValue;
9197			} else {
9198				if ( type.mod ) {
9199					if ( endValue - startValue > type.mod / 2 ) {
9200						startValue += type.mod;
9201					} else if ( startValue - endValue > type.mod / 2 ) {
9202						startValue -= type.mod;
9203					}
9204				}
9205				result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
9206			}
9207		} );
9208		return this[ spaceName ]( result );
9209	},
9210	blend: function( opaque ) {
9211
9212		// if we are already opaque - return ourself
9213		if ( this._rgba[ 3 ] === 1 ) {
9214			return this;
9215		}
9216
9217		var rgb = this._rgba.slice(),
9218			a = rgb.pop(),
9219			blend = color( opaque )._rgba;
9220
9221		return color( jQuery.map( rgb, function( v, i ) {
9222			return ( 1 - a ) * blend[ i ] + a * v;
9223		} ) );
9224	},
9225	toRgbaString: function() {
9226		var prefix = "rgba(",
9227			rgba = jQuery.map( this._rgba, function( v, i ) {
9228				if ( v != null ) {
9229					return v;
9230				}
9231				return i > 2 ? 1 : 0;
9232			} );
9233
9234		if ( rgba[ 3 ] === 1 ) {
9235			rgba.pop();
9236			prefix = "rgb(";
9237		}
9238
9239		return prefix + rgba.join( ", " ) + ")";
9240	},
9241	toHslaString: function() {
9242		var prefix = "hsla(",
9243			hsla = jQuery.map( this.hsla(), function( v, i ) {
9244				if ( v == null ) {
9245					v = i > 2 ? 1 : 0;
9246				}
9247
9248				// catch 1 and 2
9249				if ( i && i < 3 ) {
9250					v = Math.round( v * 100 ) + "%";
9251				}
9252				return v;
9253			} );
9254
9255		if ( hsla[ 3 ] === 1 ) {
9256			hsla.pop();
9257			prefix = "hsl(";
9258		}
9259		return prefix + hsla.join( ", " ) + ")";
9260	},
9261	toHexString: function( includeAlpha ) {
9262		var rgba = this._rgba.slice(),
9263			alpha = rgba.pop();
9264
9265		if ( includeAlpha ) {
9266			rgba.push( ~~( alpha * 255 ) );
9267		}
9268
9269		return "#" + jQuery.map( rgba, function( v ) {
9270
9271			// default to 0 when nulls exist
9272			return ( "0" + ( v || 0 ).toString( 16 ) ).substr( -2 );
9273		} ).join( "" );
9274	},
9275	toString: function() {
9276		return this.toRgbaString();
9277	}
9278} );
9279color.fn.parse.prototype = color.fn;
9280
9281// hsla conversions adapted from:
9282// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
9283
9284function hue2rgb( p, q, h ) {
9285	h = ( h + 1 ) % 1;
9286	if ( h * 6 < 1 ) {
9287		return p + ( q - p ) * h * 6;
9288	}
9289	if ( h * 2 < 1 ) {
9290		return q;
9291	}
9292	if ( h * 3 < 2 ) {
9293		return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
9294	}
9295	return p;
9296}
9297
9298spaces.hsla.to = function( rgba ) {
9299	if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
9300		return [ null, null, null, rgba[ 3 ] ];
9301	}
9302	var r = rgba[ 0 ] / 255,
9303		g = rgba[ 1 ] / 255,
9304		b = rgba[ 2 ] / 255,
9305		a = rgba[ 3 ],
9306		max = Math.max( r, g, b ),
9307		min = Math.min( r, g, b ),
9308		diff = max - min,
9309		add = max + min,
9310		l = add * 0.5,
9311		h, s;
9312
9313	if ( min === max ) {
9314		h = 0;
9315	} else if ( r === max ) {
9316		h = ( 60 * ( g - b ) / diff ) + 360;
9317	} else if ( g === max ) {
9318		h = ( 60 * ( b - r ) / diff ) + 120;
9319	} else {
9320		h = ( 60 * ( r - g ) / diff ) + 240;
9321	}
9322
9323	// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
9324	// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
9325	if ( diff === 0 ) {
9326		s = 0;
9327	} else if ( l <= 0.5 ) {
9328		s = diff / add;
9329	} else {
9330		s = diff / ( 2 - add );
9331	}
9332	return [ Math.round( h ) % 360, s, l, a == null ? 1 : a ];
9333};
9334
9335spaces.hsla.from = function( hsla ) {
9336	if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
9337		return [ null, null, null, hsla[ 3 ] ];
9338	}
9339	var h = hsla[ 0 ] / 360,
9340		s = hsla[ 1 ],
9341		l = hsla[ 2 ],
9342		a = hsla[ 3 ],
9343		q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
9344		p = 2 * l - q;
9345
9346	return [
9347		Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
9348		Math.round( hue2rgb( p, q, h ) * 255 ),
9349		Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
9350		a
9351	];
9352};
9353
9354
9355each( spaces, function( spaceName, space ) {
9356	var props = space.props,
9357		cache = space.cache,
9358		to = space.to,
9359		from = space.from;
9360
9361	// makes rgba() and hsla()
9362	color.fn[ spaceName ] = function( value ) {
9363
9364		// generate a cache for this space if it doesn't exist
9365		if ( to && !this[ cache ] ) {
9366			this[ cache ] = to( this._rgba );
9367		}
9368		if ( value === undefined ) {
9369			return this[ cache ].slice();
9370		}
9371
9372		var ret,
9373			type = getType( value ),
9374			arr = ( type === "array" || type === "object" ) ? value : arguments,
9375			local = this[ cache ].slice();
9376
9377		each( props, function( key, prop ) {
9378			var val = arr[ type === "object" ? key : prop.idx ];
9379			if ( val == null ) {
9380				val = local[ prop.idx ];
9381			}
9382			local[ prop.idx ] = clamp( val, prop );
9383		} );
9384
9385		if ( from ) {
9386			ret = color( from( local ) );
9387			ret[ cache ] = local;
9388			return ret;
9389		} else {
9390			return color( local );
9391		}
9392	};
9393
9394	// makes red() green() blue() alpha() hue() saturation() lightness()
9395	each( props, function( key, prop ) {
9396
9397		// alpha is included in more than one space
9398		if ( color.fn[ key ] ) {
9399			return;
9400		}
9401		color.fn[ key ] = function( value ) {
9402			var local, cur, match, fn,
9403				vtype = getType( value );
9404
9405			if ( key === "alpha" ) {
9406				fn = this._hsla ? "hsla" : "rgba";
9407			} else {
9408				fn = spaceName;
9409			}
9410			local = this[ fn ]();
9411			cur = local[ prop.idx ];
9412
9413			if ( vtype === "undefined" ) {
9414				return cur;
9415			}
9416
9417			if ( vtype === "function" ) {
9418				value = value.call( this, cur );
9419				vtype = getType( value );
9420			}
9421			if ( value == null && prop.empty ) {
9422				return this;
9423			}
9424			if ( vtype === "string" ) {
9425				match = rplusequals.exec( value );
9426				if ( match ) {
9427					value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
9428				}
9429			}
9430			local[ prop.idx ] = value;
9431			return this[ fn ]( local );
9432		};
9433	} );
9434} );
9435
9436// add cssHook and .fx.step function for each named hook.
9437// accept a space separated string of properties
9438color.hook = function( hook ) {
9439	var hooks = hook.split( " " );
9440	each( hooks, function( _i, hook ) {
9441		jQuery.cssHooks[ hook ] = {
9442			set: function( elem, value ) {
9443				var parsed;
9444
9445				if ( value !== "transparent" &&
9446					( getType( value ) !== "string" ||
9447						( parsed = stringParse( value ) ) ) ) {
9448					value = color( parsed || value );
9449					value = value.toRgbaString();
9450				}
9451				elem.style[ hook ] = value;
9452			}
9453		};
9454		jQuery.fx.step[ hook ] = function( fx ) {
9455			if ( !fx.colorInit ) {
9456				fx.start = color( fx.elem, hook );
9457				fx.end = color( fx.end );
9458				fx.colorInit = true;
9459			}
9460			jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
9461		};
9462	} );
9463
9464};
9465
9466color.hook( stepHooks );
9467
9468jQuery.cssHooks.borderColor = {
9469	expand: function( value ) {
9470		var expanded = {};
9471
9472		each( [ "Top", "Right", "Bottom", "Left" ], function( _i, part ) {
9473			expanded[ "border" + part + "Color" ] = value;
9474		} );
9475		return expanded;
9476	}
9477};
9478
9479// Basic color names only.
9480// Usage of any of the other color names requires adding yourself or including
9481// jquery.color.svg-names.js.
9482colors = jQuery.Color.names = {
9483
9484	// 4.1. Basic color keywords
9485	aqua: "#00ffff",
9486	black: "#000000",
9487	blue: "#0000ff",
9488	fuchsia: "#ff00ff",
9489	gray: "#808080",
9490	green: "#008000",
9491	lime: "#00ff00",
9492	maroon: "#800000",
9493	navy: "#000080",
9494	olive: "#808000",
9495	purple: "#800080",
9496	red: "#ff0000",
9497	silver: "#c0c0c0",
9498	teal: "#008080",
9499	white: "#ffffff",
9500	yellow: "#ffff00",
9501
9502	// 4.2.3. "transparent" color keyword
9503	transparent: [ null, null, null, 0 ],
9504
9505	_default: "#ffffff"
9506};
9507
9508
9509/*!
9510 * jQuery UI Effects 1.14.
95100
9511 * https://jqueryui.com
9512 *
9513 * Copyright OpenJS Foundation and other contributors
9514 * Released under the MIT license.
9515 * https://jquery.org/license
9516 */
9517
9518//>>label: Effects Core
9519//>>group: Effects
9520/* eslint-disable max-len */
9521//>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.
9522/* eslint-enable max-len */
vendor: 7,523 bytes, lines 9522-9812
9522
9523//>>docs: https://api.jqueryui.com/category/effects-core/
9524//>>demos: https://jqueryui.com/effect/
9525
9526
9527var dataSpace = "ui-effects-",
9528	dataSpaceStyle = "ui-effects-style",
9529	dataSpaceAnimated = "ui-effects-animated";
9530
9531$.effects = {
9532	effect: {}
9533};
9534
9535/******************************************************************************/
9536/****************************** CLASS ANIMATIONS ******************************/
9537/******************************************************************************/
9538( function() {
9539
9540var classAnimationActions = [ "add", "remove", "toggle" ],
9541	shorthandStyles = {
9542		border: 1,
9543		borderBottom: 1,
9544		borderColor: 1,
9545		borderLeft: 1,
9546		borderRight: 1,
9547		borderTop: 1,
9548		borderWidth: 1,
9549		margin: 1,
9550		padding: 1
9551	};
9552
9553$.each(
9554	[ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ],
9555	function( _, prop ) {
9556		$.fx.step[ prop ] = function( fx ) {
9557			if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
9558				jQuery.style( fx.elem, prop, fx.end );
9559				fx.setAttr = true;
9560			}
9561		};
9562	}
9563);
9564
9565function camelCase( string ) {
9566	return string.replace( /-([\da-z])/gi, function( all, letter ) {
9567		return letter.toUpperCase();
9568	} );
9569}
9570
9571function getElementStyles( elem ) {
9572	var key, len,
9573		style = elem.ownerDocument.defaultView.getComputedStyle( elem ),
9574		styles = {};
9575
9576	len = style.length;
9577	while ( len-- ) {
9578		key = style[ len ];
9579		if ( typeof style[ key ] === "string" ) {
9580			styles[ camelCase( key ) ] = style[ key ];
9581		}
9582	}
9583
9584	return styles;
9585}
9586
9587function styleDifference( oldStyle, newStyle ) {
9588	var diff = {},
9589		name, value;
9590
9591	for ( name in newStyle ) {
9592		value = newStyle[ name ];
9593		if ( oldStyle[ name ] !== value ) {
9594			if ( !shorthandStyles[ name ] ) {
9595				if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
9596					diff[ name ] = value;
9597				}
9598			}
9599		}
9600	}
9601
9602	return diff;
9603}
9604
9605$.effects.animateClass = function( value, duration, easing, callback ) {
9606	var o = $.speed( duration, easing, callback );
9607
9608	return this.queue( function() {
9609		var animated = $( this ),
9610			baseClass = animated.attr( "class" ) || "",
9611			applyClassChange,
9612			allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
9613
9614		// Map the animated objects to store the original styles.
9615		allAnimations = allAnimations.map( function() {
9616			var el = $( this );
9617			return {
9618				el: el,
9619				start: getElementStyles( this )
9620			};
9621		} );
9622
9623		// Apply class change
9624		applyClassChange = function() {
9625			$.each( classAnimationActions, function( i, action ) {
9626				if ( value[ action ] ) {
9627					animated[ action + "Class" ]( value[ action ] );
9628				}
9629			} );
9630		};
9631		applyClassChange();
9632
9633		// Map all animated objects again - calculate new styles and diff
9634		allAnimations = allAnimations.map( function() {
9635			this.end = getElementStyles( this.el[ 0 ] );
9636			this.diff = styleDifference( this.start, this.end );
9637			return this;
9638		} );
9639
9640		// Apply original class
9641		animated.attr( "class", baseClass );
9642
9643		// Map all animated objects again - this time collecting a promise
9644		allAnimations = allAnimations.map( function() {
9645			var styleInfo = this,
9646				dfd = $.Deferred(),
9647				opts = $.extend( {}, o, {
9648					queue: false,
9649					complete: function() {
9650						dfd.resolve( styleInfo );
9651					}
9652				} );
9653
9654			this.el.animate( this.diff, opts );
9655			return dfd.promise();
9656		} );
9657
9658		// Once all animations have completed:
9659		$.when.apply( $, allAnimations.get() ).done( function() {
9660
9661			// Set the final class
9662			applyClassChange();
9663
9664			// For each animated element,
9665			// clear all css properties that were animated
9666			$.each( arguments, function() {
9667				var el = this.el;
9668				$.each( this.diff, function( key ) {
9669					el.css( key, "" );
9670				} );
9671			} );
9672
9673			// This is guarnteed to be there if you use jQuery.speed()
9674			// it also handles dequeuing the next anim...
9675			o.complete.call( animated[ 0 ] );
9676		} );
9677	} );
9678};
9679
9680$.fn.extend( {
9681	addClass: ( function( orig ) {
9682		return function( classNames, speed, easing, callback ) {
9683			return speed ?
9684				$.effects.animateClass.call( this,
9685					{ add: classNames }, speed, easing, callback ) :
9686				orig.apply( this, arguments );
9687		};
9688	} )( $.fn.addClass ),
9689
9690	removeClass: ( function( orig ) {
9691		return function( classNames, speed, easing, callback ) {
9692			return arguments.length > 1 ?
9693				$.effects.animateClass.call( this,
9694					{ remove: classNames }, speed, easing, callback ) :
9695				orig.apply( this, arguments );
9696		};
9697	} )( $.fn.removeClass ),
9698
9699	toggleClass: ( function( orig ) {
9700		return function( classNames, force, speed, easing, callback ) {
9701			if ( typeof force === "boolean" || force === undefined ) {
9702				if ( !speed ) {
9703
9704					// Without speed parameter
9705					return orig.apply( this, arguments );
9706				} else {
9707					return $.effects.animateClass.call( this,
9708						( force ? { add: classNames } : { remove: classNames } ),
9709						speed, easing, callback );
9710				}
9711			} else {
9712
9713				// Without force parameter
9714				return $.effects.animateClass.call( this,
9715					{ toggle: classNames }, force, speed, easing );
9716			}
9717		};
9718	} )( $.fn.toggleClass ),
9719
9720	switchClass: function( remove, add, speed, easing, callback ) {
9721		return $.effects.animateClass.call( this, {
9722			add: add,
9723			remove: remove
9724		}, speed, easing, callback );
9725	}
9726} );
9727
9728} )();
9729
9730/******************************************************************************/
9731/*********************************** EFFECTS **********************************/
9732/******************************************************************************/
9733
9734( function() {
9735
9736if ( $.expr && $.expr.pseudos && $.expr.pseudos.animated ) {
9737	$.expr.pseudos.animated = ( function( orig ) {
9738		return function( elem ) {
9739			return !!$( elem ).data( dataSpaceAnimated ) || orig( elem );
9740		};
9741	} )( $.expr.pseudos.animated );
9742}
9743
9744if ( $.uiBackCompat === true ) {
9745	$.extend( $.effects, {
9746
9747		// Saves a set of properties in a data storage
9748		save: function( element, set ) {
9749			var i = 0, length = set.length;
9750			for ( ; i < length; i++ ) {
9751				if ( set[ i ] !== null ) {
9752					element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
9753				}
9754			}
9755		},
9756
9757		// Restores a set of previously saved properties from a data storage
9758		restore: function( element, set ) {
9759			var val, i = 0, length = set.length;
9760			for ( ; i < length; i++ ) {
9761				if ( set[ i ] !== null ) {
9762					val = element.data( dataSpace + set[ i ] );
9763					element.css( set[ i ], val );
9764				}
9765			}
9766		},
9767
9768		setMode: function( el, mode ) {
9769			if ( mode === "toggle" ) {
9770				mode = el.is( ":hidden" ) ? "show" : "hide";
9771			}
9772			return mode;
9773		},
9774
9775		// Wraps the element around a wrapper that copies position properties
9776		createWrapper: function( element ) {
9777
9778			// If the element is already wrapped, return it
9779			if ( element.parent().is( ".ui-effects-wrapper" ) ) {
9780				return element.parent();
9781			}
9782
9783			// Wrap the element
9784			var props = {
9785					width: element.outerWidth( true ),
9786					height: element.outerHeight( true ),
9787					"float": element.css( "float" )
9788				},
9789				wrapper = $( "<div></div>" )
9790					.addClass( "ui-effects-wrapper" )
9791					.css( {
9792						fontSize: "100%",
9793						background: "transparent",
9794						border: "none",
9795						margin: 0,
9796						padding: 0
9797					} ),
9798
9799				// Store the size in case width/height are defined in % - Fixes #5245
9800				size = {
9801					width: element.width(),
9802					height: element.height()
9803				},
9804				active = document.activeElement;
9805
9806			// Support: Firefox
9807			// Firefox incorrectly exposes anonymous content
9808			// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
9809			try {
9810				// eslint-disable-next-line no-unused-expressions
9811				active.id;
9812			} catch ( 
vendor: 1,550 bytes, lines 9812-9873
9812e ) {
9813				active = document.body;
9814			}
9815
9816			element.wrap( wrapper );
9817
9818			// Fixes #7595 - Elements lose focus when wrapped.
9819			if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
9820				$( active ).trigger( "focus" );
9821			}
9822
9823			// Hotfix for jQuery 1.4 since some change in wrap() seems to actually
9824			// lose the reference to the wrapped element
9825			wrapper = element.parent();
9826
9827			// Transfer positioning properties to the wrapper
9828			if ( element.css( "position" ) === "static" ) {
9829				wrapper.css( { position: "relative" } );
9830				element.css( { position: "relative" } );
9831			} else {
9832				$.extend( props, {
9833					position: element.css( "position" ),
9834					zIndex: element.css( "z-index" )
9835				} );
9836				$.each( [ "top", "left", "bottom", "right" ], function( i, pos ) {
9837					props[ pos ] = element.css( pos );
9838					if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
9839						props[ pos ] = "auto";
9840					}
9841				} );
9842				element.css( {
9843					position: "relative",
9844					top: 0,
9845					left: 0,
9846					right: "auto",
9847					bottom: "auto"
9848				} );
9849			}
9850			element.css( size );
9851
9852			return wrapper.css( props ).show();
9853		},
9854
9855		removeWrapper: function( element ) {
9856			var active = document.activeElement;
9857
9858			if ( element.parent().is( ".ui-effects-wrapper" ) ) {
9859				element.parent().replaceWith( element );
9860
9861				// Fixes #7595 - Elements lose focus when wrapped.
9862				if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
9863					$( active ).trigger( "focus" );
9864				}
9865			}
9866
9867			return element;
9868		}
9869	} );
9870}
9871
9872$.extend( $.effects, {
9873	version: "1.14.0
vendor: 6,301 bytes, lines 9873-10141
9873",
9874
9875	define: function( name, mode, effect ) {
9876		if ( !effect ) {
9877			effect = mode;
9878			mode = "effect";
9879		}
9880
9881		$.effects.effect[ name ] = effect;
9882		$.effects.effect[ name ].mode = mode;
9883
9884		return effect;
9885	},
9886
9887	scaledDimensions: function( element, percent, direction ) {
9888		if ( percent === 0 ) {
9889			return {
9890				height: 0,
9891				width: 0,
9892				outerHeight: 0,
9893				outerWidth: 0
9894			};
9895		}
9896
9897		var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1,
9898			y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1;
9899
9900		return {
9901			height: element.height() * y,
9902			width: element.width() * x,
9903			outerHeight: element.outerHeight() * y,
9904			outerWidth: element.outerWidth() * x
9905		};
9906
9907	},
9908
9909	clipToBox: function( animation ) {
9910		return {
9911			width: animation.clip.right - animation.clip.left,
9912			height: animation.clip.bottom - animation.clip.top,
9913			left: animation.clip.left,
9914			top: animation.clip.top
9915		};
9916	},
9917
9918	// Injects recently queued functions to be first in line (after "inprogress")
9919	unshift: function( element, queueLength, count ) {
9920		var queue = element.queue();
9921
9922		if ( queueLength > 1 ) {
9923			queue.splice.apply( queue,
9924				[ 1, 0 ].concat( queue.splice( queueLength, count ) ) );
9925		}
9926		element.dequeue();
9927	},
9928
9929	saveStyle: function( element ) {
9930		element.data( dataSpaceStyle, element[ 0 ].style.cssText );
9931	},
9932
9933	restoreStyle: function( element ) {
9934		element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || "";
9935		element.removeData( dataSpaceStyle );
9936	},
9937
9938	mode: function( element, mode ) {
9939		var hidden = element.is( ":hidden" );
9940
9941		if ( mode === "toggle" ) {
9942			mode = hidden ? "show" : "hide";
9943		}
9944		if ( hidden ? mode === "hide" : mode === "show" ) {
9945			mode = "none";
9946		}
9947		return mode;
9948	},
9949
9950	// Translates a [top,left] array into a baseline value
9951	getBaseline: function( origin, original ) {
9952		var y, x;
9953
9954		switch ( origin[ 0 ] ) {
9955		case "top":
9956			y = 0;
9957			break;
9958		case "middle":
9959			y = 0.5;
9960			break;
9961		case "bottom":
9962			y = 1;
9963			break;
9964		default:
9965			y = origin[ 0 ] / original.height;
9966		}
9967
9968		switch ( origin[ 1 ] ) {
9969		case "left":
9970			x = 0;
9971			break;
9972		case "center":
9973			x = 0.5;
9974			break;
9975		case "right":
9976			x = 1;
9977			break;
9978		default:
9979			x = origin[ 1 ] / original.width;
9980		}
9981
9982		return {
9983			x: x,
9984			y: y
9985		};
9986	},
9987
9988	// Creates a placeholder element so that the original element can be made absolute
9989	createPlaceholder: function( element ) {
9990		var placeholder,
9991			cssPosition = element.css( "position" ),
9992			position = element.position();
9993
9994		// Lock in margins first to account for form elements, which
9995		// will change margin if you explicitly set height
9996		// see: https://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380
9997		// Support: Safari
9998		element.css( {
9999			marginTop: element.css( "marginTop" ),
10000			marginBottom: element.css( "marginBottom" ),
10001			marginLeft: element.css( "marginLeft" ),
10002			marginRight: element.css( "marginRight" )
10003		} )
10004		.outerWidth( element.outerWidth() )
10005		.outerHeight( element.outerHeight() );
10006
10007		if ( /^(static|relative)/.test( cssPosition ) ) {
10008			cssPosition = "absolute";
10009
10010			placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( {
10011
10012				// Convert inline to inline block to account for inline elements
10013				// that turn to inline block based on content (like img)
10014				display: /^(inline|ruby)/.test( element.css( "display" ) ) ?
10015					"inline-block" :
10016					"block",
10017				visibility: "hidden",
10018
10019				// Margins need to be set to account for margin collapse
10020				marginTop: element.css( "marginTop" ),
10021				marginBottom: element.css( "marginBottom" ),
10022				marginLeft: element.css( "marginLeft" ),
10023				marginRight: element.css( "marginRight" ),
10024				"float": element.css( "float" )
10025			} )
10026			.outerWidth( element.outerWidth() )
10027			.outerHeight( element.outerHeight() )
10028			.addClass( "ui-effects-placeholder" );
10029
10030			element.data( dataSpace + "placeholder", placeholder );
10031		}
10032
10033		element.css( {
10034			position: cssPosition,
10035			left: position.left,
10036			top: position.top
10037		} );
10038
10039		return placeholder;
10040	},
10041
10042	removePlaceholder: function( element ) {
10043		var dataKey = dataSpace + "placeholder",
10044				placeholder = element.data( dataKey );
10045
10046		if ( placeholder ) {
10047			placeholder.remove();
10048			element.removeData( dataKey );
10049		}
10050	},
10051
10052	// Removes a placeholder if it exists and restores
10053	// properties that were modified during placeholder creation
10054	cleanUp: function( element ) {
10055		$.effects.restoreStyle( element );
10056		$.effects.removePlaceholder( element );
10057	},
10058
10059	setTransition: function( element, list, factor, value ) {
10060		value = value || {};
10061		$.each( list, function( i, x ) {
10062			var unit = element.cssUnit( x );
10063			if ( unit[ 0 ] > 0 ) {
10064				value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
10065			}
10066		} );
10067		return value;
10068	}
10069} );
10070
10071// Return an effect options object for the given parameters:
10072function _normalizeArguments( effect, options, speed, callback ) {
10073
10074	// Allow passing all options as the first parameter
10075	if ( $.isPlainObject( effect ) ) {
10076		options = effect;
10077		effect = effect.effect;
10078	}
10079
10080	// Convert to an object
10081	effect = { effect: effect };
10082
10083	// Catch (effect, null, ...)
10084	if ( options == null ) {
10085		options = {};
10086	}
10087
10088	// Catch (effect, callback)
10089	if ( typeof options === "function" ) {
10090		callback = options;
10091		speed = null;
10092		options = {};
10093	}
10094
10095	// Catch (effect, speed, ?)
10096	if ( typeof options === "number" || $.fx.speeds[ options ] ) {
10097		callback = speed;
10098		speed = options;
10099		options = {};
10100	}
10101
10102	// Catch (effect, options, callback)
10103	if ( typeof speed === "function" ) {
10104		callback = speed;
10105		speed = null;
10106	}
10107
10108	// Add options to effect
10109	if ( options ) {
10110		$.extend( effect, options );
10111	}
10112
10113	speed = speed || options.duration;
10114	effect.duration = $.fx.off ? 0 :
10115		typeof speed === "number" ? speed :
10116		speed in $.fx.speeds ? $.fx.speeds[ speed ] :
10117		$.fx.speeds._default;
10118
10119	effect.complete = callback || options.complete;
10120
10121	return effect;
10122}
10123
10124function standardAnimationOption( option ) {
10125
10126	// Valid standard speeds (nothing, number, named speed)
10127	if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
10128		return true;
10129	}
10130
10131	// Invalid strings - treat as "normal" speed
10132	if ( typeof option === "string" && !$.effects.effect[ option ] ) {
10133		return true;
10134	}
10135
10136	// Complete callback
10137	if ( typeof option === "function" ) {
10138		return true;
10139	}
10140
10141	// Options hash (but not naming an effect)
vendor: 8,038 bytes, lines 10142-10441
10142	if ( typeof option === "object" && !option.effect ) {
10143		return true;
10144	}
10145
10146	// Didn't match any standard API
10147	return false;
10148}
10149
10150$.fn.extend( {
10151	effect: function( /* effect, options, speed, callback */ ) {
10152		var args = _normalizeArguments.apply( this, arguments ),
10153			effectMethod = $.effects.effect[ args.effect ],
10154			defaultMode = effectMethod.mode,
10155			queue = args.queue,
10156			queueName = queue || "fx",
10157			complete = args.complete,
10158			mode = args.mode,
10159			modes = [],
10160			prefilter = function( next ) {
10161				var el = $( this ),
10162					normalizedMode = $.effects.mode( el, mode ) || defaultMode;
10163
10164				// Sentinel for duck-punching the :animated pseudo-selector
10165				el.data( dataSpaceAnimated, true );
10166
10167				// Save effect mode for later use,
10168				// we can't just call $.effects.mode again later,
10169				// as the .show() below destroys the initial state
10170				modes.push( normalizedMode );
10171
10172				// See $.uiBackCompat inside of run() for removal of defaultMode in 1.14
10173				if ( defaultMode && ( normalizedMode === "show" ||
10174						( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) {
10175					el.show();
10176				}
10177
10178				if ( !defaultMode || normalizedMode !== "none" ) {
10179					$.effects.saveStyle( el );
10180				}
10181
10182				if ( typeof next === "function" ) {
10183					next();
10184				}
10185			};
10186
10187		if ( $.fx.off || !effectMethod ) {
10188
10189			// Delegate to the original method (e.g., .show()) if possible
10190			if ( mode ) {
10191				return this[ mode ]( args.duration, complete );
10192			} else {
10193				return this.each( function() {
10194					if ( complete ) {
10195						complete.call( this );
10196					}
10197				} );
10198			}
10199		}
10200
10201		function run( next ) {
10202			var elem = $( this );
10203
10204			function cleanup() {
10205				elem.removeData( dataSpaceAnimated );
10206
10207				$.effects.cleanUp( elem );
10208
10209				if ( args.mode === "hide" ) {
10210					elem.hide();
10211				}
10212
10213				done();
10214			}
10215
10216			function done() {
10217				if ( typeof complete === "function" ) {
10218					complete.call( elem[ 0 ] );
10219				}
10220
10221				if ( typeof next === "function" ) {
10222					next();
10223				}
10224			}
10225
10226			// Override mode option on a per element basis,
10227			// as toggle can be either show or hide depending on element state
10228			args.mode = modes.shift();
10229
10230			if ( $.uiBackCompat === true && !defaultMode ) {
10231				if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
10232
10233					// Call the core method to track "olddisplay" properly
10234					elem[ mode ]();
10235					done();
10236				} else {
10237					effectMethod.call( elem[ 0 ], args, done );
10238				}
10239			} else {
10240				if ( args.mode === "none" ) {
10241
10242					// Call the core method to track "olddisplay" properly
10243					elem[ mode ]();
10244					done();
10245				} else {
10246					effectMethod.call( elem[ 0 ], args, cleanup );
10247				}
10248			}
10249		}
10250
10251		// Run prefilter on all elements first to ensure that
10252		// any showing or hiding happens before placeholder creation,
10253		// which ensures that any layout changes are correctly captured.
10254		return queue === false ?
10255			this.each( prefilter ).each( run ) :
10256			this.queue( queueName, prefilter ).queue( queueName, run );
10257	},
10258
10259	show: ( function( orig ) {
10260		return function( option ) {
10261			if ( standardAnimationOption( option ) ) {
10262				return orig.apply( this, arguments );
10263			} else {
10264				var args = _normalizeArguments.apply( this, arguments );
10265				args.mode = "show";
10266				return this.effect.call( this, args );
10267			}
10268		};
10269	} )( $.fn.show ),
10270
10271	hide: ( function( orig ) {
10272		return function( option ) {
10273			if ( standardAnimationOption( option ) ) {
10274				return orig.apply( this, arguments );
10275			} else {
10276				var args = _normalizeArguments.apply( this, arguments );
10277				args.mode = "hide";
10278				return this.effect.call( this, args );
10279			}
10280		};
10281	} )( $.fn.hide ),
10282
10283	toggle: ( function( orig ) {
10284		return function( option ) {
10285			if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
10286				return orig.apply( this, arguments );
10287			} else {
10288				var args = _normalizeArguments.apply( this, arguments );
10289				args.mode = "toggle";
10290				return this.effect.call( this, args );
10291			}
10292		};
10293	} )( $.fn.toggle ),
10294
10295	cssUnit: function( key ) {
10296		var style = this.css( key ),
10297			val = [];
10298
10299		$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
10300			if ( style.indexOf( unit ) > 0 ) {
10301				val = [ parseFloat( style ), unit ];
10302			}
10303		} );
10304		return val;
10305	},
10306
10307	cssClip: function( clipObj ) {
10308		if ( clipObj ) {
10309			return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " +
10310				clipObj.bottom + "px " + clipObj.left + "px)" );
10311		}
10312		return parseClip( this.css( "clip" ), this );
10313	},
10314
10315	transfer: function( options, done ) {
10316		var element = $( this ),
10317			target = $( options.to ),
10318			targetFixed = target.css( "position" ) === "fixed",
10319			body = $( "body" ),
10320			fixTop = targetFixed ? body.scrollTop() : 0,
10321			fixLeft = targetFixed ? body.scrollLeft() : 0,
10322			endPosition = target.offset(),
10323			animation = {
10324				top: endPosition.top - fixTop,
10325				left: endPosition.left - fixLeft,
10326				height: target.innerHeight(),
10327				width: target.innerWidth()
10328			},
10329			startPosition = element.offset(),
10330			transfer = $( "<div class='ui-effects-transfer'></div>" );
10331
10332		transfer
10333			.appendTo( "body" )
10334			.addClass( options.className )
10335			.css( {
10336				top: startPosition.top - fixTop,
10337				left: startPosition.left - fixLeft,
10338				height: element.innerHeight(),
10339				width: element.innerWidth(),
10340				position: targetFixed ? "fixed" : "absolute"
10341			} )
10342			.animate( animation, options.duration, options.easing, function() {
10343				transfer.remove();
10344				if ( typeof done === "function" ) {
10345					done();
10346				}
10347			} );
10348	}
10349} );
10350
10351function parseClip( str, element ) {
10352		var outerWidth = element.outerWidth(),
10353			outerHeight = element.outerHeight(),
10354			clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,
10355			values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ];
10356
10357		return {
10358			top: parseFloat( values[ 1 ] ) || 0,
10359			right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ),
10360			bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ),
10361			left: parseFloat( values[ 4 ] ) || 0
10362		};
10363}
10364
10365$.fx.step.clip = function( fx ) {
10366	if ( !fx.clipInit ) {
10367		fx.start = $( fx.elem ).cssClip();
10368		if ( typeof fx.end === "string" ) {
10369			fx.end = parseClip( fx.end, fx.elem );
10370		}
10371		fx.clipInit = true;
10372	}
10373
10374	$( fx.elem ).cssClip( {
10375		top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top,
10376		right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right,
10377		bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom,
10378		left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left
10379	} );
10380};
10381
10382} )();
10383
10384/******************************************************************************/
10385/*********************************** EASING ***********************************/
10386/******************************************************************************/
10387
10388( function() {
10389
10390// Based on easing equations from Robert Penner (http://robertpenner.com/easing)
10391
10392var baseEasings = {};
10393
10394$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
10395	baseEasings[ name ] = function( p ) {
10396		return Math.pow( p, i + 2 );
10397	};
10398} );
10399
10400$.extend( baseEasings, {
10401	Sine: function( p ) {
10402		return 1 - Math.cos( p * Math.PI / 2 );
10403	},
10404	Circ: function( p ) {
10405		return 1 - Math.sqrt( 1 - p * p );
10406	},
10407	Elastic: function( p ) {
10408		return p === 0 || p === 1 ? p :
10409			-Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 );
10410	},
10411	Back: function( p ) {
10412		return p * p * ( 3 * p - 2 );
10413	},
10414	Bounce: function( p ) {
10415		var pow2,
10416			bounce = 4;
10417
10418		while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
10419		return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
10420	}
10421} );
10422
10423$.each( baseEasings, function( name, easeIn ) {
10424	$.easing[ "easeIn" + name ] = easeIn;
10425	$.easing[ "easeOut" + name ] = function( p ) {
10426		return 1 - easeIn( 1 - p );
10427	};
10428	$.easing[ "easeInOut" + name ] = function( p ) {
10429		return p < 0.5 ?
10430			easeIn( p * 2 ) / 2 :
10431			1 - easeIn( p * -2 + 2 ) / 2;
10432	};
10433} );
10434
10435} )();
10436
10437var effect = $.effects;
10438
10439
10440/*!
10441 * jQuery UI Effects Blind 1.14.
vendor: 33,753 bytes, lines 10441-11750
104410
10442 * https://jqueryui.com
10443 *
10444 * Copyright OpenJS Foundation and other contributors
10445 * Released under the MIT license.
10446 * https://jquery.org/license
10447 */
10448
10449//>>label: Blind Effect
10450//>>group: Effects
10451//>>description: Blinds the element.
10452//>>docs: https://api.jqueryui.com/blind-effect/
10453//>>demos: https://jqueryui.com/effect/
10454
10455
10456var effectsEffectBlind = $.effects.define( "blind", "hide", function( options, done ) {
10457	var map = {
10458			up: [ "bottom", "top" ],
10459			vertical: [ "bottom", "top" ],
10460			down: [ "top", "bottom" ],
10461			left: [ "right", "left" ],
10462			horizontal: [ "right", "left" ],
10463			right: [ "left", "right" ]
10464		},
10465		element = $( this ),
10466		direction = options.direction || "up",
10467		start = element.cssClip(),
10468		animate = { clip: $.extend( {}, start ) },
10469		placeholder = $.effects.createPlaceholder( element );
10470
10471	animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ];
10472
10473	if ( options.mode === "show" ) {
10474		element.cssClip( animate.clip );
10475		if ( placeholder ) {
10476			placeholder.css( $.effects.clipToBox( animate ) );
10477		}
10478
10479		animate.clip = start;
10480	}
10481
10482	if ( placeholder ) {
10483		placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing );
10484	}
10485
10486	element.animate( animate, {
10487		queue: false,
10488		duration: options.duration,
10489		easing: options.easing,
10490		complete: done
10491	} );
10492} );
10493
10494
10495/*!
10496 * jQuery UI Effects Bounce 1.14.0
10497 * https://jqueryui.com
10498 *
10499 * Copyright OpenJS Foundation and other contributors
10500 * Released under the MIT license.
10501 * https://jquery.org/license
10502 */
10503
10504//>>label: Bounce Effect
10505//>>group: Effects
10506//>>description: Bounces an element horizontally or vertically n times.
10507//>>docs: https://api.jqueryui.com/bounce-effect/
10508//>>demos: https://jqueryui.com/effect/
10509
10510
10511var effectsEffectBounce = $.effects.define( "bounce", function( options, done ) {
10512	var upAnim, downAnim, refValue,
10513		element = $( this ),
10514
10515		// Defaults:
10516		mode = options.mode,
10517		hide = mode === "hide",
10518		show = mode === "show",
10519		direction = options.direction || "up",
10520		distance = options.distance,
10521		times = options.times || 5,
10522
10523		// Number of internal animations
10524		anims = times * 2 + ( show || hide ? 1 : 0 ),
10525		speed = options.duration / anims,
10526		easing = options.easing,
10527
10528		// Utility:
10529		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
10530		motion = ( direction === "up" || direction === "left" ),
10531		i = 0,
10532
10533		queuelen = element.queue().length;
10534
10535	$.effects.createPlaceholder( element );
10536
10537	refValue = element.css( ref );
10538
10539	// Default distance for the BIGGEST bounce is the outer Distance / 3
10540	if ( !distance ) {
10541		distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
10542	}
10543
10544	if ( show ) {
10545		downAnim = { opacity: 1 };
10546		downAnim[ ref ] = refValue;
10547
10548		// If we are showing, force opacity 0 and set the initial position
10549		// then do the "first" animation
10550		element
10551			.css( "opacity", 0 )
10552			.css( ref, motion ? -distance * 2 : distance * 2 )
10553			.animate( downAnim, speed, easing );
10554	}
10555
10556	// Start at the smallest distance if we are hiding
10557	if ( hide ) {
10558		distance = distance / Math.pow( 2, times - 1 );
10559	}
10560
10561	downAnim = {};
10562	downAnim[ ref ] = refValue;
10563
10564	// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
10565	for ( ; i < times; i++ ) {
10566		upAnim = {};
10567		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
10568
10569		element
10570			.animate( upAnim, speed, easing )
10571			.animate( downAnim, speed, easing );
10572
10573		distance = hide ? distance * 2 : distance / 2;
10574	}
10575
10576	// Last Bounce when Hiding
10577	if ( hide ) {
10578		upAnim = { opacity: 0 };
10579		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
10580
10581		element.animate( upAnim, speed, easing );
10582	}
10583
10584	element.queue( done );
10585
10586	$.effects.unshift( element, queuelen, anims + 1 );
10587} );
10588
10589
10590/*!
10591 * jQuery UI Effects Clip 1.14.0
10592 * https://jqueryui.com
10593 *
10594 * Copyright OpenJS Foundation and other contributors
10595 * Released under the MIT license.
10596 * https://jquery.org/license
10597 */
10598
10599//>>label: Clip Effect
10600//>>group: Effects
10601//>>description: Clips the element on and off like an old TV.
10602//>>docs: https://api.jqueryui.com/clip-effect/
10603//>>demos: https://jqueryui.com/effect/
10604
10605
10606var effectsEffectClip = $.effects.define( "clip", "hide", function( options, done ) {
10607	var start,
10608		animate = {},
10609		element = $( this ),
10610		direction = options.direction || "vertical",
10611		both = direction === "both",
10612		horizontal = both || direction === "horizontal",
10613		vertical = both || direction === "vertical";
10614
10615	start = element.cssClip();
10616	animate.clip = {
10617		top: vertical ? ( start.bottom - start.top ) / 2 : start.top,
10618		right: horizontal ? ( start.right - start.left ) / 2 : start.right,
10619		bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom,
10620		left: horizontal ? ( start.right - start.left ) / 2 : start.left
10621	};
10622
10623	$.effects.createPlaceholder( element );
10624
10625	if ( options.mode === "show" ) {
10626		element.cssClip( animate.clip );
10627		animate.clip = start;
10628	}
10629
10630	element.animate( animate, {
10631		queue: false,
10632		duration: options.duration,
10633		easing: options.easing,
10634		complete: done
10635	} );
10636
10637} );
10638
10639
10640/*!
10641 * jQuery UI Effects Drop 1.14.0
10642 * https://jqueryui.com
10643 *
10644 * Copyright OpenJS Foundation and other contributors
10645 * Released under the MIT license.
10646 * https://jquery.org/license
10647 */
10648
10649//>>label: Drop Effect
10650//>>group: Effects
10651//>>description: Moves an element in one direction and hides it at the same time.
10652//>>docs: https://api.jqueryui.com/drop-effect/
10653//>>demos: https://jqueryui.com/effect/
10654
10655
10656var effectsEffectDrop = $.effects.define( "drop", "hide", function( options, done ) {
10657
10658	var distance,
10659		element = $( this ),
10660		mode = options.mode,
10661		show = mode === "show",
10662		direction = options.direction || "left",
10663		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
10664		motion = ( direction === "up" || direction === "left" ) ? "-=" : "+=",
10665		oppositeMotion = ( motion === "+=" ) ? "-=" : "+=",
10666		animation = {
10667			opacity: 0
10668		};
10669
10670	$.effects.createPlaceholder( element );
10671
10672	distance = options.distance ||
10673		element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
10674
10675	animation[ ref ] = motion + distance;
10676
10677	if ( show ) {
10678		element.css( animation );
10679
10680		animation[ ref ] = oppositeMotion + distance;
10681		animation.opacity = 1;
10682	}
10683
10684	// Animate
10685	element.animate( animation, {
10686		queue: false,
10687		duration: options.duration,
10688		easing: options.easing,
10689		complete: done
10690	} );
10691} );
10692
10693
10694/*!
10695 * jQuery UI Effects Explode 1.14.0
10696 * https://jqueryui.com
10697 *
10698 * Copyright OpenJS Foundation and other contributors
10699 * Released under the MIT license.
10700 * https://jquery.org/license
10701 */
10702
10703//>>label: Explode Effect
10704//>>group: Effects
10705/* eslint-disable max-len */
10706//>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.
10707/* eslint-enable max-len */
10708//>>docs: https://api.jqueryui.com/explode-effect/
10709//>>demos: https://jqueryui.com/effect/
10710
10711
10712var effectsEffectExplode = $.effects.define( "explode", "hide", function( options, done ) {
10713
10714	var i, j, left, top, mx, my,
10715		rows = options.pieces ? Math.round( Math.sqrt( options.pieces ) ) : 3,
10716		cells = rows,
10717		element = $( this ),
10718		mode = options.mode,
10719		show = mode === "show",
10720
10721		// Show and then visibility:hidden the element before calculating offset
10722		offset = element.show().css( "visibility", "hidden" ).offset(),
10723
10724		// Width and height of a piece
10725		width = Math.ceil( element.outerWidth() / cells ),
10726		height = Math.ceil( element.outerHeight() / rows ),
10727		pieces = [];
10728
10729	// Children animate complete:
10730	function childComplete() {
10731		pieces.push( this );
10732		if ( pieces.length === rows * cells ) {
10733			animComplete();
10734		}
10735	}
10736
10737	// Clone the element for each row and cell.
10738	for ( i = 0; i < rows; i++ ) { // ===>
10739		top = offset.top + i * height;
10740		my = i - ( rows - 1 ) / 2;
10741
10742		for ( j = 0; j < cells; j++ ) { // |||
10743			left = offset.left + j * width;
10744			mx = j - ( cells - 1 ) / 2;
10745
10746			// Create a clone of the now hidden main element that will be absolute positioned
10747			// within a wrapper div off the -left and -top equal to size of our pieces
10748			element
10749				.clone()
10750				.appendTo( "body" )
10751				.wrap( "<div></div>" )
10752				.css( {
10753					position: "absolute",
10754					visibility: "visible",
10755					left: -j * width,
10756					top: -i * height
10757				} )
10758
10759				// Select the wrapper - make it overflow: hidden and absolute positioned based on
10760				// where the original was located +left and +top equal to the size of pieces
10761				.parent()
10762					.addClass( "ui-effects-explode" )
10763					.css( {
10764						position: "absolute",
10765						overflow: "hidden",
10766						width: width,
10767						height: height,
10768						left: left + ( show ? mx * width : 0 ),
10769						top: top + ( show ? my * height : 0 ),
10770						opacity: show ? 0 : 1
10771					} )
10772					.animate( {
10773						left: left + ( show ? 0 : mx * width ),
10774						top: top + ( show ? 0 : my * height ),
10775						opacity: show ? 1 : 0
10776					}, options.duration || 500, options.easing, childComplete );
10777		}
10778	}
10779
10780	function animComplete() {
10781		element.css( {
10782			visibility: "visible"
10783		} );
10784		$( pieces ).remove();
10785		done();
10786	}
10787} );
10788
10789
10790/*!
10791 * jQuery UI Effects Fade 1.14.0
10792 * https://jqueryui.com
10793 *
10794 * Copyright OpenJS Foundation and other contributors
10795 * Released under the MIT license.
10796 * https://jquery.org/license
10797 */
10798
10799//>>label: Fade Effect
10800//>>group: Effects
10801//>>description: Fades the element.
10802//>>docs: https://api.jqueryui.com/fade-effect/
10803//>>demos: https://jqueryui.com/effect/
10804
10805
10806var effectsEffectFade = $.effects.define( "fade", "toggle", function( options, done ) {
10807	var show = options.mode === "show";
10808
10809	$( this )
10810		.css( "opacity", show ? 0 : 1 )
10811		.animate( {
10812			opacity: show ? 1 : 0
10813		}, {
10814			queue: false,
10815			duration: options.duration,
10816			easing: options.easing,
10817			complete: done
10818		} );
10819} );
10820
10821
10822/*!
10823 * jQuery UI Effects Fold 1.14.0
10824 * https://jqueryui.com
10825 *
10826 * Copyright OpenJS Foundation and other contributors
10827 * Released under the MIT license.
10828 * https://jquery.org/license
10829 */
10830
10831//>>label: Fold Effect
10832//>>group: Effects
10833//>>description: Folds an element first horizontally and then vertically.
10834//>>docs: https://api.jqueryui.com/fold-effect/
10835//>>demos: https://jqueryui.com/effect/
10836
10837
10838var effectsEffectFold = $.effects.define( "fold", "hide", function( options, done ) {
10839
10840	// Create element
10841	var element = $( this ),
10842		mode = options.mode,
10843		show = mode === "show",
10844		hide = mode === "hide",
10845		size = options.size || 15,
10846		percent = /([0-9]+)%/.exec( size ),
10847		horizFirst = !!options.horizFirst,
10848		ref = horizFirst ? [ "right", "bottom" ] : [ "bottom", "right" ],
10849		duration = options.duration / 2,
10850
10851		placeholder = $.effects.createPlaceholder( element ),
10852
10853		start = element.cssClip(),
10854		animation1 = { clip: $.extend( {}, start ) },
10855		animation2 = { clip: $.extend( {}, start ) },
10856
10857		distance = [ start[ ref[ 0 ] ], start[ ref[ 1 ] ] ],
10858
10859		queuelen = element.queue().length;
10860
10861	if ( percent ) {
10862		size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
10863	}
10864	animation1.clip[ ref[ 0 ] ] = size;
10865	animation2.clip[ ref[ 0 ] ] = size;
10866	animation2.clip[ ref[ 1 ] ] = 0;
10867
10868	if ( show ) {
10869		element.cssClip( animation2.clip );
10870		if ( placeholder ) {
10871			placeholder.css( $.effects.clipToBox( animation2 ) );
10872		}
10873
10874		animation2.clip = start;
10875	}
10876
10877	// Animate
10878	element
10879		.queue( function( next ) {
10880			if ( placeholder ) {
10881				placeholder
10882					.animate( $.effects.clipToBox( animation1 ), duration, options.easing )
10883					.animate( $.effects.clipToBox( animation2 ), duration, options.easing );
10884			}
10885
10886			next();
10887		} )
10888		.animate( animation1, duration, options.easing )
10889		.animate( animation2, duration, options.easing )
10890		.queue( done );
10891
10892	$.effects.unshift( element, queuelen, 4 );
10893} );
10894
10895
10896/*!
10897 * jQuery UI Effects Highlight 1.14.0
10898 * https://jqueryui.com
10899 *
10900 * Copyright OpenJS Foundation and other contributors
10901 * Released under the MIT license.
10902 * https://jquery.org/license
10903 */
10904
10905//>>label: Highlight Effect
10906//>>group: Effects
10907//>>description: Highlights the background of an element in a defined color for a custom duration.
10908//>>docs: https://api.jqueryui.com/highlight-effect/
10909//>>demos: https://jqueryui.com/effect/
10910
10911
10912var effectsEffectHighlight = $.effects.define( "highlight", "show", function( options, done ) {
10913	var element = $( this ),
10914		animation = {
10915			backgroundColor: element.css( "backgroundColor" )
10916		};
10917
10918	if ( options.mode === "hide" ) {
10919		animation.opacity = 0;
10920	}
10921
10922	$.effects.saveStyle( element );
10923
10924	element
10925		.css( {
10926			backgroundImage: "none",
10927			backgroundColor: options.color || "#ffff99"
10928		} )
10929		.animate( animation, {
10930			queue: false,
10931			duration: options.duration,
10932			easing: options.easing,
10933			complete: done
10934		} );
10935} );
10936
10937
10938/*!
10939 * jQuery UI Effects Size 1.14.0
10940 * https://jqueryui.com
10941 *
10942 * Copyright OpenJS Foundation and other contributors
10943 * Released under the MIT license.
10944 * https://jquery.org/license
10945 */
10946
10947//>>label: Size Effect
10948//>>group: Effects
10949//>>description: Resize an element to a specified width and height.
10950//>>docs: https://api.jqueryui.com/size-effect/
10951//>>demos: https://jqueryui.com/effect/
10952
10953
10954var effectsEffectSize = $.effects.define( "size", function( options, done ) {
10955
10956	// Create element
10957	var baseline, factor, temp,
10958		element = $( this ),
10959
10960		// Copy for children
10961		cProps = [ "fontSize" ],
10962		vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
10963		hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
10964
10965		// Set options
10966		mode = options.mode,
10967		restore = mode !== "effect",
10968		scale = options.scale || "both",
10969		origin = options.origin || [ "middle", "center" ],
10970		position = element.css( "position" ),
10971		pos = element.position(),
10972		original = $.effects.scaledDimensions( element ),
10973		from = options.from || original,
10974		to = options.to || $.effects.scaledDimensions( element, 0 );
10975
10976	$.effects.createPlaceholder( element );
10977
10978	if ( mode === "show" ) {
10979		temp = from;
10980		from = to;
10981		to = temp;
10982	}
10983
10984	// Set scaling factor
10985	factor = {
10986		from: {
10987			y: from.height / original.height,
10988			x: from.width / original.width
10989		},
10990		to: {
10991			y: to.height / original.height,
10992			x: to.width / original.width
10993		}
10994	};
10995
10996	// Scale the css box
10997	if ( scale === "box" || scale === "both" ) {
10998
10999		// Vertical props scaling
11000		if ( factor.from.y !== factor.to.y ) {
11001			from = $.effects.setTransition( element, vProps, factor.from.y, from );
11002			to = $.effects.setTransition( element, vProps, factor.to.y, to );
11003		}
11004
11005		// Horizontal props scaling
11006		if ( factor.from.x !== factor.to.x ) {
11007			from = $.effects.setTransition( element, hProps, factor.from.x, from );
11008			to = $.effects.setTransition( element, hProps, factor.to.x, to );
11009		}
11010	}
11011
11012	// Scale the content
11013	if ( scale === "content" || scale === "both" ) {
11014
11015		// Vertical props scaling
11016		if ( factor.from.y !== factor.to.y ) {
11017			from = $.effects.setTransition( element, cProps, factor.from.y, from );
11018			to = $.effects.setTransition( element, cProps, factor.to.y, to );
11019		}
11020	}
11021
11022	// Adjust the position properties based on the provided origin points
11023	if ( origin ) {
11024		baseline = $.effects.getBaseline( origin, original );
11025		from.top = ( original.outerHeight - from.outerHeight ) * baseline.y + pos.top;
11026		from.left = ( original.outerWidth - from.outerWidth ) * baseline.x + pos.left;
11027		to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top;
11028		to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left;
11029	}
11030	delete from.outerHeight;
11031	delete from.outerWidth;
11032	element.css( from );
11033
11034	// Animate the children if desired
11035	if ( scale === "content" || scale === "both" ) {
11036
11037		vProps = vProps.concat( [ "marginTop", "marginBottom" ] ).concat( cProps );
11038		hProps = hProps.concat( [ "marginLeft", "marginRight" ] );
11039
11040		// Only animate children with width attributes specified
11041		// TODO: is this right? should we include anything with css width specified as well
11042		element.find( "*[width]" ).each( function() {
11043			var child = $( this ),
11044				childOriginal = $.effects.scaledDimensions( child ),
11045				childFrom = {
11046					height: childOriginal.height * factor.from.y,
11047					width: childOriginal.width * factor.from.x,
11048					outerHeight: childOriginal.outerHeight * factor.from.y,
11049					outerWidth: childOriginal.outerWidth * factor.from.x
11050				},
11051				childTo = {
11052					height: childOriginal.height * factor.to.y,
11053					width: childOriginal.width * factor.to.x,
11054					outerHeight: childOriginal.height * factor.to.y,
11055					outerWidth: childOriginal.width * factor.to.x
11056				};
11057
11058			// Vertical props scaling
11059			if ( factor.from.y !== factor.to.y ) {
11060				childFrom = $.effects.setTransition( child, vProps, factor.from.y, childFrom );
11061				childTo = $.effects.setTransition( child, vProps, factor.to.y, childTo );
11062			}
11063
11064			// Horizontal props scaling
11065			if ( factor.from.x !== factor.to.x ) {
11066				childFrom = $.effects.setTransition( child, hProps, factor.from.x, childFrom );
11067				childTo = $.effects.setTransition( child, hProps, factor.to.x, childTo );
11068			}
11069
11070			if ( restore ) {
11071				$.effects.saveStyle( child );
11072			}
11073
11074			// Animate children
11075			child.css( childFrom );
11076			child.animate( childTo, options.duration, options.easing, function() {
11077
11078				// Restore children
11079				if ( restore ) {
11080					$.effects.restoreStyle( child );
11081				}
11082			} );
11083		} );
11084	}
11085
11086	// Animate
11087	element.animate( to, {
11088		queue: false,
11089		duration: options.duration,
11090		easing: options.easing,
11091		complete: function() {
11092
11093			var offset = element.offset();
11094
11095			if ( to.opacity === 0 ) {
11096				element.css( "opacity", from.opacity );
11097			}
11098
11099			if ( !restore ) {
11100				element
11101					.css( "position", position === "static" ? "relative" : position )
11102					.offset( offset );
11103
11104				// Need to save style here so that automatic style restoration
11105				// doesn't restore to the original styles from before the animation.
11106				$.effects.saveStyle( element );
11107			}
11108
11109			done();
11110		}
11111	} );
11112
11113} );
11114
11115
11116/*!
11117 * jQuery UI Effects Scale 1.14.0
11118 * https://jqueryui.com
11119 *
11120 * Copyright OpenJS Foundation and other contributors
11121 * Released under the MIT license.
11122 * https://jquery.org/license
11123 */
11124
11125//>>label: Scale Effect
11126//>>group: Effects
11127//>>description: Grows or shrinks an element and its content.
11128//>>docs: https://api.jqueryui.com/scale-effect/
11129//>>demos: https://jqueryui.com/effect/
11130
11131
11132var effectsEffectScale = $.effects.define( "scale", function( options, done ) {
11133
11134	// Create element
11135	var el = $( this ),
11136		mode = options.mode,
11137		percent = parseInt( options.percent, 10 ) ||
11138			( parseInt( options.percent, 10 ) === 0 ? 0 : ( mode !== "effect" ? 0 : 100 ) ),
11139
11140		newOptions = $.extend( true, {
11141			from: $.effects.scaledDimensions( el ),
11142			to: $.effects.scaledDimensions( el, percent, options.direction || "both" ),
11143			origin: options.origin || [ "middle", "center" ]
11144		}, options );
11145
11146	// Fade option to support puff
11147	if ( options.fade ) {
11148		newOptions.from.opacity = 1;
11149		newOptions.to.opacity = 0;
11150	}
11151
11152	$.effects.effect.size.call( this, newOptions, done );
11153} );
11154
11155
11156/*!
11157 * jQuery UI Effects Puff 1.14.0
11158 * https://jqueryui.com
11159 *
11160 * Copyright OpenJS Foundation and other contributors
11161 * Released under the MIT license.
11162 * https://jquery.org/license
11163 */
11164
11165//>>label: Puff Effect
11166//>>group: Effects
11167//>>description: Creates a puff effect by scaling the element up and hiding it at the same time.
11168//>>docs: https://api.jqueryui.com/puff-effect/
11169//>>demos: https://jqueryui.com/effect/
11170
11171
11172var effectsEffectPuff = $.effects.define( "puff", "hide", function( options, done ) {
11173	var newOptions = $.extend( true, {}, options, {
11174		fade: true,
11175		percent: parseInt( options.percent, 10 ) || 150
11176	} );
11177
11178	$.effects.effect.scale.call( this, newOptions, done );
11179} );
11180
11181
11182/*!
11183 * jQuery UI Effects Pulsate 1.14.0
11184 * https://jqueryui.com
11185 *
11186 * Copyright OpenJS Foundation and other contributors
11187 * Released under the MIT license.
11188 * https://jquery.org/license
11189 */
11190
11191//>>label: Pulsate Effect
11192//>>group: Effects
11193//>>description: Pulsates an element n times by changing the opacity to zero and back.
11194//>>docs: https://api.jqueryui.com/pulsate-effect/
11195//>>demos: https://jqueryui.com/effect/
11196
11197
11198var effectsEffectPulsate = $.effects.define( "pulsate", "show", function( options, done ) {
11199	var element = $( this ),
11200		mode = options.mode,
11201		show = mode === "show",
11202		hide = mode === "hide",
11203		showhide = show || hide,
11204
11205		// Showing or hiding leaves off the "last" animation
11206		anims = ( ( options.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
11207		duration = options.duration / anims,
11208		animateTo = 0,
11209		i = 1,
11210		queuelen = element.queue().length;
11211
11212	if ( show || !element.is( ":visible" ) ) {
11213		element.css( "opacity", 0 ).show();
11214		animateTo = 1;
11215	}
11216
11217	// Anims - 1 opacity "toggles"
11218	for ( ; i < anims; i++ ) {
11219		element.animate( { opacity: animateTo }, duration, options.easing );
11220		animateTo = 1 - animateTo;
11221	}
11222
11223	element.animate( { opacity: animateTo }, duration, options.easing );
11224
11225	element.queue( done );
11226
11227	$.effects.unshift( element, queuelen, anims + 1 );
11228} );
11229
11230
11231/*!
11232 * jQuery UI Effects Shake 1.14.0
11233 * https://jqueryui.com
11234 *
11235 * Copyright OpenJS Foundation and other contributors
11236 * Released under the MIT license.
11237 * https://jquery.org/license
11238 */
11239
11240//>>label: Shake Effect
11241//>>group: Effects
11242//>>description: Shakes an element horizontally or vertically n times.
11243//>>docs: https://api.jqueryui.com/shake-effect/
11244//>>demos: https://jqueryui.com/effect/
11245
11246
11247var effectsEffectShake = $.effects.define( "shake", function( options, done ) {
11248
11249	var i = 1,
11250		element = $( this ),
11251		direction = options.direction || "left",
11252		distance = options.distance || 20,
11253		times = options.times || 3,
11254		anims = times * 2 + 1,
11255		speed = Math.round( options.duration / anims ),
11256		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
11257		positiveMotion = ( direction === "up" || direction === "left" ),
11258		animation = {},
11259		animation1 = {},
11260		animation2 = {},
11261
11262		queuelen = element.queue().length;
11263
11264	$.effects.createPlaceholder( element );
11265
11266	// Animation
11267	animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
11268	animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
11269	animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
11270
11271	// Animate
11272	element.animate( animation, speed, options.easing );
11273
11274	// Shakes
11275	for ( ; i < times; i++ ) {
11276		element
11277			.animate( animation1, speed, options.easing )
11278			.animate( animation2, speed, options.easing );
11279	}
11280
11281	element
11282		.animate( animation1, speed, options.easing )
11283		.animate( animation, speed / 2, options.easing )
11284		.queue( done );
11285
11286	$.effects.unshift( element, queuelen, anims + 1 );
11287} );
11288
11289
11290/*!
11291 * jQuery UI Effects Slide 1.14.0
11292 * https://jqueryui.com
11293 *
11294 * Copyright OpenJS Foundation and other contributors
11295 * Released under the MIT license.
11296 * https://jquery.org/license
11297 */
11298
11299//>>label: Slide Effect
11300//>>group: Effects
11301//>>description: Slides an element in and out of the viewport.
11302//>>docs: https://api.jqueryui.com/slide-effect/
11303//>>demos: https://jqueryui.com/effect/
11304
11305
11306var effectsEffectSlide = $.effects.define( "slide", "show", function( options, done ) {
11307	var startClip, startRef,
11308		element = $( this ),
11309		map = {
11310			up: [ "bottom", "top" ],
11311			down: [ "top", "bottom" ],
11312			left: [ "right", "left" ],
11313			right: [ "left", "right" ]
11314		},
11315		mode = options.mode,
11316		direction = options.direction || "left",
11317		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
11318		positiveMotion = ( direction === "up" || direction === "left" ),
11319		distance = options.distance ||
11320			element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ),
11321		animation = {};
11322
11323	$.effects.createPlaceholder( element );
11324
11325	startClip = element.cssClip();
11326	startRef = element.position()[ ref ];
11327
11328	// Define hide animation
11329	animation[ ref ] = ( positiveMotion ? -1 : 1 ) * distance + startRef;
11330	animation.clip = element.cssClip();
11331	animation.clip[ map[ direction ][ 1 ] ] = animation.clip[ map[ direction ][ 0 ] ];
11332
11333	// Reverse the animation if we're showing
11334	if ( mode === "show" ) {
11335		element.cssClip( animation.clip );
11336		element.css( ref, animation[ ref ] );
11337		animation.clip = startClip;
11338		animation[ ref ] = startRef;
11339	}
11340
11341	// Actually animate
11342	element.animate( animation, {
11343		queue: false,
11344		duration: options.duration,
11345		easing: options.easing,
11346		complete: done
11347	} );
11348} );
11349
11350
11351/*!
11352 * jQuery UI Effects Transfer 1.14.0
11353 * https://jqueryui.com
11354 *
11355 * Copyright OpenJS Foundation and other contributors
11356 * Released under the MIT license.
11357 * https://jquery.org/license
11358 */
11359
11360//>>label: Transfer Effect
11361//>>group: Effects
11362//>>description: Displays a transfer effect from one element to another.
11363//>>docs: https://api.jqueryui.com/transfer-effect/
11364//>>demos: https://jqueryui.com/effect/
11365
11366
11367var effect;
11368if ( $.uiBackCompat === true ) {
11369	effect = $.effects.define( "transfer", function( options, done ) {
11370		$( this ).transfer( options, done );
11371	} );
11372}
11373var effectsEffectTransfer = effect;
11374
11375
11376/*!
11377 * jQuery UI Focusable 1.14.0
11378 * https://jqueryui.com
11379 *
11380 * Copyright OpenJS Foundation and other contributors
11381 * Released under the MIT license.
11382 * https://jquery.org/license
11383 */
11384
11385//>>label: :focusable Selector
11386//>>group: Core
11387//>>description: Selects elements which can be focused.
11388//>>docs: https://api.jqueryui.com/focusable-selector/
11389
11390
11391// Selectors
11392$.ui.focusable = function( element, hasTabindex ) {
11393	var map, mapName, img, focusableIfVisible, fieldset,
11394		nodeName = element.nodeName.toLowerCase();
11395
11396	if ( "area" === nodeName ) {
11397		map = element.parentNode;
11398		mapName = map.name;
11399		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
11400			return false;
11401		}
11402		img = $( "img[usemap='#" + mapName + "']" );
11403		return img.length > 0 && img.is( ":visible" );
11404	}
11405
11406	if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) {
11407		focusableIfVisible = !element.disabled;
11408
11409		if ( focusableIfVisible ) {
11410
11411			// Form controls within a disabled fieldset are disabled.
11412			// However, controls within the fieldset's legend do not get disabled.
11413			// Since controls generally aren't placed inside legends, we skip
11414			// this portion of the check.
11415			fieldset = $( element ).closest( "fieldset" )[ 0 ];
11416			if ( fieldset ) {
11417				focusableIfVisible = !fieldset.disabled;
11418			}
11419		}
11420	} else if ( "a" === nodeName ) {
11421		focusableIfVisible = element.href || hasTabindex;
11422	} else {
11423		focusableIfVisible = hasTabindex;
11424	}
11425
11426	return focusableIfVisible && $( element ).is( ":visible" ) &&
11427		$( element ).css( "visibility" ) === "visible";
11428};
11429
11430$.extend( $.expr.pseudos, {
11431	focusable: function( element ) {
11432		return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
11433	}
11434} );
11435
11436var focusable = $.ui.focusable;
11437
11438
11439/*!
11440 * jQuery UI Form Reset Mixin 1.14.0
11441 * https://jqueryui.com
11442 *
11443 * Copyright OpenJS Foundation and other contributors
11444 * Released under the MIT license.
11445 * https://jquery.org/license
11446 */
11447
11448//>>label: Form Reset Mixin
11449//>>group: Core
11450//>>description: Refresh input widgets when their form is reset
11451//>>docs: https://api.jqueryui.com/form-reset-mixin/
11452
11453
11454var formResetMixin = $.ui.formResetMixin = {
11455	_formResetHandler: function() {
11456		var form = $( this );
11457
11458		// Wait for the form reset to actually happen before refreshing
11459		setTimeout( function() {
11460			var instances = form.data( "ui-form-reset-instances" );
11461			$.each( instances, function() {
11462				this.refresh();
11463			} );
11464		} );
11465	},
11466
11467	_bindFormResetHandler: function() {
11468		this.form = $( this.element.prop( "form" ) );
11469		if ( !this.form.length ) {
11470			return;
11471		}
11472
11473		var instances = this.form.data( "ui-form-reset-instances" ) || [];
11474		if ( !instances.length ) {
11475
11476			// We don't use _on() here because we use a single event handler per form
11477			this.form.on( "reset.ui-form-reset", this._formResetHandler );
11478		}
11479		instances.push( this );
11480		this.form.data( "ui-form-reset-instances", instances );
11481	},
11482
11483	_unbindFormResetHandler: function() {
11484		if ( !this.form.length ) {
11485			return;
11486		}
11487
11488		var instances = this.form.data( "ui-form-reset-instances" );
11489		instances.splice( $.inArray( this, instances ), 1 );
11490		if ( instances.length ) {
11491			this.form.data( "ui-form-reset-instances", instances );
11492		} else {
11493			this.form
11494				.removeData( "ui-form-reset-instances" )
11495				.off( "reset.ui-form-reset" );
11496		}
11497	}
11498};
11499
11500
11501/*!
11502 * jQuery UI Legacy jQuery Core patches 1.14.0
11503 * https://jqueryui.com
11504 *
11505 * Copyright OpenJS Foundation and other contributors
11506 * Released under the MIT license.
11507 * https://jquery.org/license
11508 *
11509 */
11510
11511//>>label: Legacy jQuery Core patches
11512//>>group: Core
11513//>>description: Backport `.even()`, `.odd()` and `$.escapeSelector` to older jQuery Core versions (deprecated)
11514
11515
11516// Support: jQuery 2.2.x or older.
11517// This method has been defined in jQuery 3.0.0.
11518// Code from https://github.com/jquery/jquery/blob/e539bac79e666bba95bba86d690b4e609dca2286/src/selector/escapeSelector.js
11519if ( !$.escapeSelector ) {
11520	$.escapeSelector = function( id ) {
11521		return CSS.escape( id + "" );
11522	};
11523}
11524
11525// Support: jQuery 3.4.x or older
11526// These methods have been defined in jQuery 3.5.0.
11527if ( !$.fn.even || !$.fn.odd ) {
11528	$.fn.extend( {
11529		even: function() {
11530			return this.filter( function( i ) {
11531				return i % 2 === 0;
11532			} );
11533		},
11534		odd: function() {
11535			return this.filter( function( i ) {
11536				return i % 2 === 1;
11537			} );
11538		}
11539	} );
11540}
11541
11542;
11543/*!
11544 * jQuery UI Keycode 1.14.0
11545 * https://jqueryui.com
11546 *
11547 * Copyright OpenJS Foundation and other contributors
11548 * Released under the MIT license.
11549 * https://jquery.org/license
11550 */
11551
11552//>>label: Keycode
11553//>>group: Core
11554//>>description: Provide keycodes as keynames
11555//>>docs: https://api.jqueryui.com/jQuery.ui.keyCode/
11556
11557
11558var keycode = $.ui.keyCode = {
11559	BACKSPACE: 8,
11560	COMMA: 188,
11561	DELETE: 46,
11562	DOWN: 40,
11563	END: 35,
11564	ENTER: 13,
11565	ESCAPE: 27,
11566	HOME: 36,
11567	LEFT: 37,
11568	PAGE_DOWN: 34,
11569	PAGE_UP: 33,
11570	PERIOD: 190,
11571	RIGHT: 39,
11572	SPACE: 32,
11573	TAB: 9,
11574	UP: 38
11575};
11576
11577
11578/*!
11579 * jQuery UI Labels 1.14.0
11580 * https://jqueryui.com
11581 *
11582 * Copyright OpenJS Foundation and other contributors
11583 * Released under the MIT license.
11584 * https://jquery.org/license
11585 */
11586
11587//>>label: labels
11588//>>group: Core
11589//>>description: Find all the labels associated with a given input
11590//>>docs: https://api.jqueryui.com/labels/
11591
11592
11593var labels = $.fn.labels = function() {
11594	var ancestor, selector, id, labels, ancestors;
11595
11596	if ( !this.length ) {
11597		return this.pushStack( [] );
11598	}
11599
11600	// Check control.labels first
11601	if ( this[ 0 ].labels && this[ 0 ].labels.length ) {
11602		return this.pushStack( this[ 0 ].labels );
11603	}
11604
11605	// If `control.labels` is empty - e.g. inside of document fragments - find
11606	// the labels manually
11607	labels = this.eq( 0 ).parents( "label" );
11608
11609	// Look for the label based on the id
11610	id = this.attr( "id" );
11611	if ( id ) {
11612
11613		// We don't search against the document in case the element
11614		// is disconnected from the DOM
11615		ancestor = this.eq( 0 ).parents().last();
11616
11617		// Get a full set of top level ancestors
11618		ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() );
11619
11620		// Create a selector for the label based on the id
11621		selector = "label[for='" + CSS.escape( id ) + "']";
11622
11623		labels = labels.add( ancestors.find( selector ).addBack( selector ) );
11624
11625	}
11626
11627	// Return whatever we have found for labels
11628	return this.pushStack( labels );
11629};
11630
11631
11632/*!
11633 * jQuery UI Scroll Parent 1.14.0
11634 * https://jqueryui.com
11635 *
11636 * Copyright OpenJS Foundation and other contributors
11637 * Released under the MIT license.
11638 * https://jquery.org/license
11639 */
11640
11641//>>label: scrollParent
11642//>>group: Core
11643//>>description: Get the closest ancestor element that is scrollable.
11644//>>docs: https://api.jqueryui.com/scrollParent/
11645
11646
11647var scrollParent = $.fn.scrollParent = function( includeHidden ) {
11648	var position = this.css( "position" ),
11649		excludeStaticParent = position === "absolute",
11650		overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
11651		scrollParent = this.parents().filter( function() {
11652			var parent = $( this );
11653			if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
11654				return false;
11655			}
11656			return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
11657				parent.css( "overflow-x" ) );
11658		} ).eq( 0 );
11659
11660	return position === "fixed" || !scrollParent.length ?
11661		$( this[ 0 ].ownerDocument || document ) :
11662		scrollParent;
11663};
11664
11665
11666/*!
11667 * jQuery UI Tabbable 1.14.0
11668 * https://jqueryui.com
11669 *
11670 * Copyright OpenJS Foundation and other contributors
11671 * Released under the MIT license.
11672 * https://jquery.org/license
11673 */
11674
11675//>>label: :tabbable Selector
11676//>>group: Core
11677//>>description: Selects elements which can be tabbed to.
11678//>>docs: https://api.jqueryui.com/tabbable-selector/
11679
11680
11681var tabbable = $.extend( $.expr.pseudos, {
11682	tabbable: function( element ) {
11683		var tabIndex = $.attr( element, "tabindex" ),
11684			hasTabindex = tabIndex != null;
11685		return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex );
11686	}
11687} );
11688
11689
11690/*!
11691 * jQuery UI Unique ID 1.14.0
11692 * https://jqueryui.com
11693 *
11694 * Copyright OpenJS Foundation and other contributors
11695 * Released under the MIT license.
11696 * https://jquery.org/license
11697 */
11698
11699//>>label: uniqueId
11700//>>group: Core
11701//>>description: Functions to generate and remove uniqueId's
11702//>>docs: https://api.jqueryui.com/uniqueId/
11703
11704
11705var uniqueId = $.fn.extend( {
11706	uniqueId: ( function() {
11707		var uuid = 0;
11708
11709		return function() {
11710			return this.each( function() {
11711				if ( !this.id ) {
11712					this.id = "ui-id-" + ( ++uuid );
11713				}
11714			} );
11715		};
11716	} )(),
11717
11718	removeUniqueId: function() {
11719		return this.each( function() {
11720			if ( /^ui-id-\d+$/.test( this.id ) ) {
11721				$( this ).removeAttr( "id" );
11722			}
11723		} );
11724	}
11725} );
11726
11727
11728/*!
11729 * jQuery UI Accordion 1.14.0
11730 * https://jqueryui.com
11731 *
11732 * Copyright OpenJS Foundation and other contributors
11733 * Released under the MIT license.
11734 * https://jquery.org/license
11735 */
11736
11737//>>label: Accordion
11738//>>group: Widgets
11739/* eslint-disable max-len */
11740//>>description: Displays collapsible content panels for presenting information in a limited amount of space.
11741/* eslint-enable max-len */
11742//>>docs: https://api.jqueryui.com/accordion/
11743//>>demos: https://jqueryui.com/accordion/
11744//>>css.structure: ../../themes/base/core.css
11745//>>css.structure: ../../themes/base/accordion.css
11746//>>css.theme: ../../themes/base/theme.css
11747
11748
11749var widgetsAccordion = $.widget( "ui.accordion", {
11750	version: "1.14.0
vendor: 14,922 bytes, lines 11750-12331
11750",
11751	options: {
11752		active: 0,
11753		animate: {},
11754		classes: {
11755			"ui-accordion-header": "ui-corner-top",
11756			"ui-accordion-header-collapsed": "ui-corner-all",
11757			"ui-accordion-content": "ui-corner-bottom"
11758		},
11759		collapsible: false,
11760		event: "click",
11761		header: function( elem ) {
11762			return elem
11763				.find( "> li > :first-child" )
11764				.add(
11765					elem.find( "> :not(li)" )
11766
11767						// Support: jQuery <3.5 only
11768						// We could use `.even()` but that's unavailable in older jQuery.
11769						.filter( function( i ) {
11770							return i % 2 === 0;
11771						} )
11772				);
11773		},
11774		heightStyle: "auto",
11775		icons: {
11776			activeHeader: "ui-icon-triangle-1-s",
11777			header: "ui-icon-triangle-1-e"
11778		},
11779
11780		// Callbacks
11781		activate: null,
11782		beforeActivate: null
11783	},
11784
11785	hideProps: {
11786		borderTopWidth: "hide",
11787		borderBottomWidth: "hide",
11788		paddingTop: "hide",
11789		paddingBottom: "hide",
11790		height: "hide"
11791	},
11792
11793	showProps: {
11794		borderTopWidth: "show",
11795		borderBottomWidth: "show",
11796		paddingTop: "show",
11797		paddingBottom: "show",
11798		height: "show"
11799	},
11800
11801	_create: function() {
11802		var options = this.options;
11803
11804		this.prevShow = this.prevHide = $();
11805		this._addClass( "ui-accordion", "ui-widget ui-helper-reset" );
11806		this.element.attr( "role", "tablist" );
11807
11808		// Don't allow collapsible: false and active: false / null
11809		if ( !options.collapsible && ( options.active === false || options.active == null ) ) {
11810			options.active = 0;
11811		}
11812
11813		this._processPanels();
11814
11815		// handle negative values
11816		if ( options.active < 0 ) {
11817			options.active += this.headers.length;
11818		}
11819		this._refresh();
11820	},
11821
11822	_getCreateEventData: function() {
11823		return {
11824			header: this.active,
11825			panel: !this.active.length ? $() : this.active.next()
11826		};
11827	},
11828
11829	_createIcons: function() {
11830		var icon, children,
11831			icons = this.options.icons;
11832
11833		if ( icons ) {
11834			icon = $( "<span>" );
11835			this._addClass( icon, "ui-accordion-header-icon", "ui-icon " + icons.header );
11836			icon.prependTo( this.headers );
11837			children = this.active.children( ".ui-accordion-header-icon" );
11838			this._removeClass( children, icons.header )
11839				._addClass( children, null, icons.activeHeader )
11840				._addClass( this.headers, "ui-accordion-icons" );
11841		}
11842	},
11843
11844	_destroyIcons: function() {
11845		this._removeClass( this.headers, "ui-accordion-icons" );
11846		this.headers.children( ".ui-accordion-header-icon" ).remove();
11847	},
11848
11849	_destroy: function() {
11850		var contents;
11851
11852		// Clean up main element
11853		this.element.removeAttr( "role" );
11854
11855		// Clean up headers
11856		this.headers
11857			.removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" )
11858			.removeUniqueId();
11859
11860		this._destroyIcons();
11861
11862		// Clean up content panels
11863		contents = this.headers.next()
11864			.css( "display", "" )
11865			.removeAttr( "role aria-hidden aria-labelledby" )
11866			.removeUniqueId();
11867
11868		if ( this.options.heightStyle !== "content" ) {
11869			contents.css( "height", "" );
11870		}
11871	},
11872
11873	_setOption: function( key, value ) {
11874		if ( key === "active" ) {
11875
11876			// _activate() will handle invalid values and update this.options
11877			this._activate( value );
11878			return;
11879		}
11880
11881		if ( key === "event" ) {
11882			if ( this.options.event ) {
11883				this._off( this.headers, this.options.event );
11884			}
11885			this._setupEvents( value );
11886		}
11887
11888		this._super( key, value );
11889
11890		// Setting collapsible: false while collapsed; open first panel
11891		if ( key === "collapsible" && !value && this.options.active === false ) {
11892			this._activate( 0 );
11893		}
11894
11895		if ( key === "icons" ) {
11896			this._destroyIcons();
11897			if ( value ) {
11898				this._createIcons();
11899			}
11900		}
11901	},
11902
11903	_setOptionDisabled: function( value ) {
11904		this._super( value );
11905
11906		this.element.attr( "aria-disabled", value );
11907		this._toggleClass( null, "ui-state-disabled", !!value );
11908	},
11909
11910	_keydown: function( event ) {
11911		if ( event.altKey || event.ctrlKey ) {
11912			return;
11913		}
11914
11915		var keyCode = $.ui.keyCode,
11916			length = this.headers.length,
11917			currentIndex = this.headers.index( event.target ),
11918			toFocus = false;
11919
11920		switch ( event.keyCode ) {
11921		case keyCode.RIGHT:
11922		case keyCode.DOWN:
11923			toFocus = this.headers[ ( currentIndex + 1 ) % length ];
11924			break;
11925		case keyCode.LEFT:
11926		case keyCode.UP:
11927			toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
11928			break;
11929		case keyCode.SPACE:
11930		case keyCode.ENTER:
11931			this._eventHandler( event );
11932			break;
11933		case keyCode.HOME:
11934			toFocus = this.headers[ 0 ];
11935			break;
11936		case keyCode.END:
11937			toFocus = this.headers[ length - 1 ];
11938			break;
11939		}
11940
11941		if ( toFocus ) {
11942			$( event.target ).attr( "tabIndex", -1 );
11943			$( toFocus ).attr( "tabIndex", 0 );
11944			$( toFocus ).trigger( "focus" );
11945			event.preventDefault();
11946		}
11947	},
11948
11949	_panelKeyDown: function( event ) {
11950		if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
11951			$( event.currentTarget ).prev().trigger( "focus" );
11952		}
11953	},
11954
11955	refresh: function() {
11956		var options = this.options;
11957		this._processPanels();
11958
11959		// Was collapsed or no panel
11960		if ( ( options.active === false && options.collapsible === true ) ||
11961				!this.headers.length ) {
11962			options.active = false;
11963			this.active = $();
11964
11965		// active false only when collapsible is true
11966		} else if ( options.active === false ) {
11967			this._activate( 0 );
11968
11969		// was active, but active panel is gone
11970		} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
11971
11972			// all remaining panel are disabled
11973			if ( this.headers.length === this.headers.find( ".ui-state-disabled" ).length ) {
11974				options.active = false;
11975				this.active = $();
11976
11977			// activate previous panel
11978			} else {
11979				this._activate( Math.max( 0, options.active - 1 ) );
11980			}
11981
11982		// was active, active panel still exists
11983		} else {
11984
11985			// make sure active index is correct
11986			options.active = this.headers.index( this.active );
11987		}
11988
11989		this._destroyIcons();
11990
11991		this._refresh();
11992	},
11993
11994	_processPanels: function() {
11995		var prevHeaders = this.headers,
11996			prevPanels = this.panels;
11997
11998		if ( typeof this.options.header === "function" ) {
11999			this.headers = this.options.header( this.element );
12000		} else {
12001			this.headers = this.element.find( this.options.header );
12002		}
12003		this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed",
12004			"ui-state-default" );
12005
12006		this.panels = this.headers.next().filter( ":not(.ui-accordion-content-active)" ).hide();
12007		this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" );
12008
12009		// Avoid memory leaks (#10056)
12010		if ( prevPanels ) {
12011			this._off( prevHeaders.not( this.headers ) );
12012			this._off( prevPanels.not( this.panels ) );
12013		}
12014	},
12015
12016	_refresh: function() {
12017		var maxHeight,
12018			options = this.options,
12019			heightStyle = options.heightStyle,
12020			parent = this.element.parent();
12021
12022		this.active = this._findActive( options.active );
12023		this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" )
12024			._removeClass( this.active, "ui-accordion-header-collapsed" );
12025		this._addClass( this.active.next(), "ui-accordion-content-active" );
12026		this.active.next().show();
12027
12028		this.headers
12029			.attr( "role", "tab" )
12030			.each( function() {
12031				var header = $( this ),
12032					headerId = header.uniqueId().attr( "id" ),
12033					panel = header.next(),
12034					panelId = panel.uniqueId().attr( "id" );
12035				header.attr( "aria-controls", panelId );
12036				panel.attr( "aria-labelledby", headerId );
12037			} )
12038			.next()
12039				.attr( "role", "tabpanel" );
12040
12041		this.headers
12042			.not( this.active )
12043				.attr( {
12044					"aria-selected": "false",
12045					"aria-expanded": "false",
12046					tabIndex: -1
12047				} )
12048				.next()
12049					.attr( {
12050						"aria-hidden": "true"
12051					} )
12052					.hide();
12053
12054		// Make sure at least one header is in the tab order
12055		if ( !this.active.length ) {
12056			this.headers.eq( 0 ).attr( "tabIndex", 0 );
12057		} else {
12058			this.active.attr( {
12059				"aria-selected": "true",
12060				"aria-expanded": "true",
12061				tabIndex: 0
12062			} )
12063				.next()
12064					.attr( {
12065						"aria-hidden": "false"
12066					} );
12067		}
12068
12069		this._createIcons();
12070
12071		this._setupEvents( options.event );
12072
12073		if ( heightStyle === "fill" ) {
12074			maxHeight = parent.height();
12075			this.element.siblings( ":visible" ).each( function() {
12076				var elem = $( this ),
12077					position = elem.css( "position" );
12078
12079				if ( position === "absolute" || position === "fixed" ) {
12080					return;
12081				}
12082				maxHeight -= elem.outerHeight( true );
12083			} );
12084
12085			this.headers.each( function() {
12086				maxHeight -= $( this ).outerHeight( true );
12087			} );
12088
12089			this.headers.next()
12090				.each( function() {
12091					$( this ).height( Math.max( 0, maxHeight -
12092						$( this ).innerHeight() + $( this ).height() ) );
12093				} )
12094				.css( "overflow", "auto" );
12095		} else if ( heightStyle === "auto" ) {
12096			maxHeight = 0;
12097			this.headers.next()
12098				.each( function() {
12099					var isVisible = $( this ).is( ":visible" );
12100					if ( !isVisible ) {
12101						$( this ).show();
12102					}
12103					maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
12104					if ( !isVisible ) {
12105						$( this ).hide();
12106					}
12107				} )
12108				.height( maxHeight );
12109		}
12110	},
12111
12112	_activate: function( index ) {
12113		var active = this._findActive( index )[ 0 ];
12114
12115		// Trying to activate the already active panel
12116		if ( active === this.active[ 0 ] ) {
12117			return;
12118		}
12119
12120		// Trying to collapse, simulate a click on the currently active header
12121		active = active || this.active[ 0 ];
12122
12123		this._eventHandler( {
12124			target: active,
12125			currentTarget: active,
12126			preventDefault: $.noop
12127		} );
12128	},
12129
12130	_findActive: function( selector ) {
12131		return typeof selector === "number" ? this.headers.eq( selector ) : $();
12132	},
12133
12134	_setupEvents: function( event ) {
12135		var events = {
12136			keydown: "_keydown"
12137		};
12138		if ( event ) {
12139			$.each( event.split( " " ), function( index, eventName ) {
12140				events[ eventName ] = "_eventHandler";
12141			} );
12142		}
12143
12144		this._off( this.headers.add( this.headers.next() ) );
12145		this._on( this.headers, events );
12146		this._on( this.headers.next(), { keydown: "_panelKeyDown" } );
12147		this._hoverable( this.headers );
12148		this._focusable( this.headers );
12149	},
12150
12151	_eventHandler: function( event ) {
12152		var activeChildren, clickedChildren,
12153			options = this.options,
12154			active = this.active,
12155			clicked = $( event.currentTarget ),
12156			clickedIsActive = clicked[ 0 ] === active[ 0 ],
12157			collapsing = clickedIsActive && options.collapsible,
12158			toShow = collapsing ? $() : clicked.next(),
12159			toHide = active.next(),
12160			eventData = {
12161				oldHeader: active,
12162				oldPanel: toHide,
12163				newHeader: collapsing ? $() : clicked,
12164				newPanel: toShow
12165			};
12166
12167		event.preventDefault();
12168
12169		if (
12170
12171				// click on active header, but not collapsible
12172				( clickedIsActive && !options.collapsible ) ||
12173
12174				// allow canceling activation
12175				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
12176			return;
12177		}
12178
12179		options.active = collapsing ? false : this.headers.index( clicked );
12180
12181		// When the call to ._toggle() comes after the class changes
12182		// it causes a very odd bug in IE 8 (see #6720)
12183		this.active = clickedIsActive ? $() : clicked;
12184		this._toggle( eventData );
12185
12186		// Switch classes
12187		// corner classes on the previously active header stay after the animation
12188		this._removeClass( active, "ui-accordion-header-active", "ui-state-active" );
12189		if ( options.icons ) {
12190			activeChildren = active.children( ".ui-accordion-header-icon" );
12191			this._removeClass( activeChildren, null, options.icons.activeHeader )
12192				._addClass( activeChildren, null, options.icons.header );
12193		}
12194
12195		if ( !clickedIsActive ) {
12196			this._removeClass( clicked, "ui-accordion-header-collapsed" )
12197				._addClass( clicked, "ui-accordion-header-active", "ui-state-active" );
12198			if ( options.icons ) {
12199				clickedChildren = clicked.children( ".ui-accordion-header-icon" );
12200				this._removeClass( clickedChildren, null, options.icons.header )
12201					._addClass( clickedChildren, null, options.icons.activeHeader );
12202			}
12203
12204			this._addClass( clicked.next(), "ui-accordion-content-active" );
12205		}
12206	},
12207
12208	_toggle: function( data ) {
12209		var toShow = data.newPanel,
12210			toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
12211
12212		// Handle activating a panel during the animation for another activation
12213		this.prevShow.add( this.prevHide ).stop( true, true );
12214		this.prevShow = toShow;
12215		this.prevHide = toHide;
12216
12217		if ( this.options.animate ) {
12218			this._animate( toShow, toHide, data );
12219		} else {
12220			toHide.hide();
12221			toShow.show();
12222			this._toggleComplete( data );
12223		}
12224
12225		toHide.attr( {
12226			"aria-hidden": "true"
12227		} );
12228		toHide.prev().attr( {
12229			"aria-selected": "false",
12230			"aria-expanded": "false"
12231		} );
12232
12233		// if we're switching panels, remove the old header from the tab order
12234		// if we're opening from collapsed state, remove the previous header from the tab order
12235		// if we're collapsing, then keep the collapsing header in the tab order
12236		if ( toShow.length && toHide.length ) {
12237			toHide.prev().attr( {
12238				"tabIndex": -1,
12239				"aria-expanded": "false"
12240			} );
12241		} else if ( toShow.length ) {
12242			this.headers.filter( function() {
12243				return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
12244			} )
12245				.attr( "tabIndex", -1 );
12246		}
12247
12248		toShow
12249			.attr( "aria-hidden", "false" )
12250			.prev()
12251				.attr( {
12252					"aria-selected": "true",
12253					"aria-expanded": "true",
12254					tabIndex: 0
12255				} );
12256	},
12257
12258	_animate: function( toShow, toHide, data ) {
12259		var total, easing, duration,
12260			that = this,
12261			adjust = 0,
12262			boxSizing = toShow.css( "box-sizing" ),
12263			down = toShow.length &&
12264				( !toHide.length || ( toShow.index() < toHide.index() ) ),
12265			animate = this.options.animate || {},
12266			options = down && animate.down || animate,
12267			complete = function() {
12268				that._toggleComplete( data );
12269			};
12270
12271		if ( typeof options === "number" ) {
12272			duration = options;
12273		}
12274		if ( typeof options === "string" ) {
12275			easing = options;
12276		}
12277
12278		// fall back from options to animation in case of partial down settings
12279		easing = easing || options.easing || animate.easing;
12280		duration = duration || options.duration || animate.duration;
12281
12282		if ( !toHide.length ) {
12283			return toShow.animate( this.showProps, duration, easing, complete );
12284		}
12285		if ( !toShow.length ) {
12286			return toHide.animate( this.hideProps, duration, easing, complete );
12287		}
12288
12289		total = toShow.show().outerHeight();
12290		toHide.animate( this.hideProps, {
12291			duration: duration,
12292			easing: easing,
12293			step: function( now, fx ) {
12294				fx.now = Math.round( now );
12295			}
12296		} );
12297		toShow
12298			.hide()
12299			.animate( this.showProps, {
12300				duration: duration,
12301				easing: easing,
12302				complete: complete,
12303				step: function( now, fx ) {
12304					fx.now = Math.round( now );
12305					if ( fx.prop !== "height" ) {
12306						if ( boxSizing === "content-box" ) {
12307							adjust += fx.now;
12308						}
12309					} else if ( that.options.heightStyle !== "content" ) {
12310						fx.now = Math.round( total - toHide.outerHeight() - adjust );
12311						adjust = 0;
12312					}
12313				}
12314			} );
12315	},
12316
12317	_toggleComplete: function( data ) {
12318		var toHide = data.oldPanel,
12319			prev = toHide.prev();
12320
12321		this._removeClass( toHide, "ui-accordion-content-active" );
12322		this._removeClass( prev, "ui-accordion-header-active" )
12323			._addClass( prev, "ui-accordion-header-collapsed" );
12324
12325		this._trigger( "activate", null, data );
12326	}
12327} );
12328
12329
12330/*!
12331 * jQuery UI Menu 1.14.
123310
12332 * https://jqueryui.com
12333 *
12334 * Copyright OpenJS Foundation and other contributors
12335 * Released under the MIT license.
12336 * https://jquery.org/license
12337 */
12338
12339//>>label: Menu
12340//>>group: Widgets
12341//>>description: Creates nestable menus.
12342//>>docs: https://api.jqueryui.com/menu/
12343//>>demos: https://jqueryui.com/menu/
12344//>>css.structure: ../../themes/base/core.css
12345//>>css.structure: ../../themes/base/menu.css
12346//>>css.theme: ../../themes/base/theme.css
12347
12348
12349var widgetsMenu = $.widget( "ui.menu", {
12350	version: "1.14.0
vendor: 2,644 bytes, lines 12350-12452
12350",
12351	defaultElement: "<ul>",
12352	delay: 300,
12353	options: {
12354		icons: {
12355			submenu: "ui-icon-caret-1-e"
12356		},
12357		items: "> *",
12358		menus: "ul",
12359		position: {
12360			my: "left top",
12361			at: "right top"
12362		},
12363		role: "menu",
12364
12365		// Callbacks
12366		blur: null,
12367		focus: null,
12368		select: null
12369	},
12370
12371	_create: function() {
12372		this.activeMenu = this.element;
12373
12374		// Flag used to prevent firing of the click handler
12375		// as the event bubbles up through nested menus
12376		this.mouseHandled = false;
12377		this.lastMousePosition = { x: null, y: null };
12378		this.element
12379			.uniqueId()
12380			.attr( {
12381				role: this.options.role,
12382				tabIndex: 0
12383			} );
12384
12385		this._addClass( "ui-menu", "ui-widget ui-widget-content" );
12386		this._on( {
12387
12388			// Prevent focus from sticking to links inside menu after clicking
12389			// them (focus should always stay on UL during navigation).
12390			"mousedown .ui-menu-item": function( event ) {
12391				event.preventDefault();
12392
12393				this._activateItem( event );
12394			},
12395			"click .ui-menu-item": function( event ) {
12396				var target = $( event.target );
12397				var active = $( this.document[ 0 ].activeElement );
12398				if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
12399					this.select( event );
12400
12401					// Only set the mouseHandled flag if the event will bubble, see #9469.
12402					if ( !event.isPropagationStopped() ) {
12403						this.mouseHandled = true;
12404					}
12405
12406					// Open submenu on click
12407					if ( target.has( ".ui-menu" ).length ) {
12408						this.expand( event );
12409					} else if ( !this.element.is( ":focus" ) &&
12410							active.closest( ".ui-menu" ).length ) {
12411
12412						// Redirect focus to the menu
12413						this.element.trigger( "focus", [ true ] );
12414
12415						// If the active item is on the top level, let it stay active.
12416						// Otherwise, blur the active item since it is no longer visible.
12417						if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
12418							clearTimeout( this.timer );
12419						}
12420					}
12421				}
12422			},
12423			"mouseenter .ui-menu-item": "_activateItem",
12424			"mousemove .ui-menu-item": "_activateItem",
12425			mouseleave: "collapseAll",
12426			"mouseleave .ui-menu": "collapseAll",
12427			focus: function( event, keepActiveItem ) {
12428
12429				// If there's already an active item, keep it active
12430				// If not, activate the first item
12431				var item = this.active || this._menuItems().first();
12432
12433				if ( !keepActiveItem ) {
12434					this.focus( event, item );
12435				}
12436			},
12437			blur: function( event ) {
12438				this._delay( function() {
12439					var notContained = !$.contains(
12440						this.element[ 0 ],
12441						this.document[ 0 ].activeElement
12442					);
12443					if ( notContained ) {
12444						this.collapseAll( event );
12445					}
12446				} );
12447			},
12448			keydown: "_keydown"
12449		} );
12450
12451		this.refresh();
12452
vendor: 3,056 bytes, lines 12453-12569
12453		// Clicks outside of a menu collapse any open menus
12454		this._on( this.document, {
12455			click: function( event ) {
12456				if ( this._closeOnDocumentClick( event ) ) {
12457					this.collapseAll( event, true );
12458				}
12459
12460				// Reset the mouseHandled flag
12461				this.mouseHandled = false;
12462			}
12463		} );
12464	},
12465
12466	_activateItem: function( event ) {
12467
12468		// Ignore mouse events while typeahead is active, see #10458.
12469		// Prevents focusing the wrong item when typeahead causes a scroll while the mouse
12470		// is over an item in the menu
12471		if ( this.previousFilter ) {
12472			return;
12473		}
12474
12475		// If the mouse didn't actually move, but the page was scrolled, ignore the event (#9356)
12476		if ( event.clientX === this.lastMousePosition.x &&
12477				event.clientY === this.lastMousePosition.y ) {
12478			return;
12479		}
12480
12481		this.lastMousePosition = {
12482			x: event.clientX,
12483			y: event.clientY
12484		};
12485
12486		var actualTarget = $( event.target ).closest( ".ui-menu-item" ),
12487			target = $( event.currentTarget );
12488
12489		// Ignore bubbled events on parent items, see #11641
12490		if ( actualTarget[ 0 ] !== target[ 0 ] ) {
12491			return;
12492		}
12493
12494		// If the item is already active, there's nothing to do
12495		if ( target.is( ".ui-state-active" ) ) {
12496			return;
12497		}
12498
12499		// Remove ui-state-active class from siblings of the newly focused menu item
12500		// to avoid a jump caused by adjacent elements both having a class with a border
12501		this._removeClass( target.siblings().children( ".ui-state-active" ),
12502			null, "ui-state-active" );
12503		this.focus( event, target );
12504	},
12505
12506	_destroy: function() {
12507		var items = this.element.find( ".ui-menu-item" )
12508				.removeAttr( "role aria-disabled" ),
12509			submenus = items.children( ".ui-menu-item-wrapper" )
12510				.removeUniqueId()
12511				.removeAttr( "tabIndex role aria-haspopup" );
12512
12513		// Destroy (sub)menus
12514		this.element
12515			.removeAttr( "aria-activedescendant" )
12516			.find( ".ui-menu" ).addBack()
12517				.removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " +
12518					"tabIndex" )
12519				.removeUniqueId()
12520				.show();
12521
12522		submenus.children().each( function() {
12523			var elem = $( this );
12524			if ( elem.data( "ui-menu-submenu-caret" ) ) {
12525				elem.remove();
12526			}
12527		} );
12528	},
12529
12530	_keydown: function( event ) {
12531		var match, prev, character, skip,
12532			preventDefault = true;
12533
12534		switch ( event.keyCode ) {
12535		case $.ui.keyCode.PAGE_UP:
12536			this.previousPage( event );
12537			break;
12538		case $.ui.keyCode.PAGE_DOWN:
12539			this.nextPage( event );
12540			break;
12541		case $.ui.keyCode.HOME:
12542			this._move( "first", "first", event );
12543			break;
12544		case $.ui.keyCode.END:
12545			this._move( "last", "last", event );
12546			break;
12547		case $.ui.keyCode.UP:
12548			this.previous( event );
12549			break;
12550		case $.ui.keyCode.DOWN:
12551			this.next( event );
12552			break;
12553		case $.ui.keyCode.LEFT:
12554			this.collapse( event );
12555			break;
12556		case $.ui.keyCode.RIGHT:
12557			if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
12558				this.expand( event );
12559			}
12560			break;
12561		case $.ui.keyCode.ENTER:
12562		case $.ui.keyCode.SPACE:
12563			this._activate( event );
12564			break;
12565		case $.ui.keyCode.ESCAPE:
12566			this.collapse( event );
12567			break;
12568		default:
12569			preventDefault = false;
vendor: 6,930 bytes, lines 12570-12818
12570			prev = this.previousFilter || "";
12571			skip = false;
12572
12573			// Support number pad values
12574			character = event.keyCode >= 96 && event.keyCode <= 105 ?
12575				( event.keyCode - 96 ).toString() : String.fromCharCode( event.keyCode );
12576
12577			clearTimeout( this.filterTimer );
12578
12579			if ( character === prev ) {
12580				skip = true;
12581			} else {
12582				character = prev + character;
12583			}
12584
12585			match = this._filterMenuItems( character );
12586			match = skip && match.index( this.active.next() ) !== -1 ?
12587				this.active.nextAll( ".ui-menu-item" ) :
12588				match;
12589
12590			// If no matches on the current filter, reset to the last character pressed
12591			// to move down the menu to the first item that starts with that character
12592			if ( !match.length ) {
12593				character = String.fromCharCode( event.keyCode );
12594				match = this._filterMenuItems( character );
12595			}
12596
12597			if ( match.length ) {
12598				this.focus( event, match );
12599				this.previousFilter = character;
12600				this.filterTimer = this._delay( function() {
12601					delete this.previousFilter;
12602				}, 1000 );
12603			} else {
12604				delete this.previousFilter;
12605			}
12606		}
12607
12608		if ( preventDefault ) {
12609			event.preventDefault();
12610		}
12611	},
12612
12613	_activate: function( event ) {
12614		if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
12615			if ( this.active.children( "[aria-haspopup='true']" ).length ) {
12616				this.expand( event );
12617			} else {
12618				this.select( event );
12619			}
12620		}
12621	},
12622
12623	refresh: function() {
12624		var menus, items, newSubmenus, newItems, newWrappers,
12625			that = this,
12626			icon = this.options.icons.submenu,
12627			submenus = this.element.find( this.options.menus );
12628
12629		this._toggleClass( "ui-menu-icons", null, !!this.element.find( ".ui-icon" ).length );
12630
12631		// Initialize nested menus
12632		newSubmenus = submenus.filter( ":not(.ui-menu)" )
12633			.hide()
12634			.attr( {
12635				role: this.options.role,
12636				"aria-hidden": "true",
12637				"aria-expanded": "false"
12638			} )
12639			.each( function() {
12640				var menu = $( this ),
12641					item = menu.prev(),
12642					submenuCaret = $( "<span>" ).data( "ui-menu-submenu-caret", true );
12643
12644				that._addClass( submenuCaret, "ui-menu-icon", "ui-icon " + icon );
12645				item
12646					.attr( "aria-haspopup", "true" )
12647					.prepend( submenuCaret );
12648				menu.attr( "aria-labelledby", item.attr( "id" ) );
12649			} );
12650
12651		this._addClass( newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front" );
12652
12653		menus = submenus.add( this.element );
12654		items = menus.find( this.options.items );
12655
12656		// Initialize menu-items containing spaces and/or dashes only as dividers
12657		items.not( ".ui-menu-item" ).each( function() {
12658			var item = $( this );
12659			if ( that._isDivider( item ) ) {
12660				that._addClass( item, "ui-menu-divider", "ui-widget-content" );
12661			}
12662		} );
12663
12664		// Don't refresh list items that are already adapted
12665		newItems = items.not( ".ui-menu-item, .ui-menu-divider" );
12666		newWrappers = newItems.children()
12667			.not( ".ui-menu" )
12668				.uniqueId()
12669				.attr( {
12670					tabIndex: -1,
12671					role: this._itemRole()
12672				} );
12673		this._addClass( newItems, "ui-menu-item" )
12674			._addClass( newWrappers, "ui-menu-item-wrapper" );
12675
12676		// Add aria-disabled attribute to any disabled menu item
12677		items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
12678
12679		// If the active item has been removed, blur the menu
12680		if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
12681			this.blur();
12682		}
12683	},
12684
12685	_itemRole: function() {
12686		return {
12687			menu: "menuitem",
12688			listbox: "option"
12689		}[ this.options.role ];
12690	},
12691
12692	_setOption: function( key, value ) {
12693		if ( key === "icons" ) {
12694			var icons = this.element.find( ".ui-menu-icon" );
12695			this._removeClass( icons, null, this.options.icons.submenu )
12696				._addClass( icons, null, value.submenu );
12697		}
12698		this._super( key, value );
12699	},
12700
12701	_setOptionDisabled: function( value ) {
12702		this._super( value );
12703
12704		this.element.attr( "aria-disabled", String( value ) );
12705		this._toggleClass( null, "ui-state-disabled", !!value );
12706	},
12707
12708	focus: function( event, item ) {
12709		var nested, focused, activeParent;
12710		this.blur( event, event && event.type === "focus" );
12711
12712		this._scrollIntoView( item );
12713
12714		this.active = item.first();
12715
12716		focused = this.active.children( ".ui-menu-item-wrapper" );
12717		this._addClass( focused, null, "ui-state-active" );
12718
12719		// Only update aria-activedescendant if there's a role
12720		// otherwise we assume focus is managed elsewhere
12721		if ( this.options.role ) {
12722			this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
12723		}
12724
12725		// Highlight active parent menu item, if any
12726		activeParent = this.active
12727			.parent()
12728				.closest( ".ui-menu-item" )
12729					.children( ".ui-menu-item-wrapper" );
12730		this._addClass( activeParent, null, "ui-state-active" );
12731
12732		if ( event && event.type === "keydown" ) {
12733			this._close();
12734		} else {
12735			this.timer = this._delay( function() {
12736				this._close();
12737			}, this.delay );
12738		}
12739
12740		nested = item.children( ".ui-menu" );
12741		if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
12742			this._startOpening( nested );
12743		}
12744		this.activeMenu = item.parent();
12745
12746		this._trigger( "focus", event, { item: item } );
12747	},
12748
12749	_scrollIntoView: function( item ) {
12750		var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
12751		if ( this._hasScroll() ) {
12752			borderTop = parseFloat( $.css( this.activeMenu[ 0 ], "borderTopWidth" ) ) || 0;
12753			paddingTop = parseFloat( $.css( this.activeMenu[ 0 ], "paddingTop" ) ) || 0;
12754			offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
12755			scroll = this.activeMenu.scrollTop();
12756			elementHeight = this.activeMenu.height();
12757			itemHeight = item.outerHeight();
12758
12759			if ( offset < 0 ) {
12760				this.activeMenu.scrollTop( scroll + offset );
12761			} else if ( offset + itemHeight > elementHeight ) {
12762				this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
12763			}
12764		}
12765	},
12766
12767	blur: function( event, fromFocus ) {
12768		if ( !fromFocus ) {
12769			clearTimeout( this.timer );
12770		}
12771
12772		if ( !this.active ) {
12773			return;
12774		}
12775
12776		this._removeClass( this.active.children( ".ui-menu-item-wrapper" ),
12777			null, "ui-state-active" );
12778
12779		this._trigger( "blur", event, { item: this.active } );
12780		this.active = null;
12781	},
12782
12783	_startOpening: function( submenu ) {
12784		clearTimeout( this.timer );
12785
12786		// Don't open if already open fixes a Firefox bug that caused a .5 pixel
12787		// shift in the submenu position when mousing over the caret icon
12788		if ( submenu.attr( "aria-hidden" ) !== "true" ) {
12789			return;
12790		}
12791
12792		this.timer = this._delay( function() {
12793			this._close();
12794			this._open( submenu );
12795		}, this.delay );
12796	},
12797
12798	_open: function( submenu ) {
12799		var position = $.extend( {
12800			of: this.active
12801		}, this.options.position );
12802
12803		clearTimeout( this.timer );
12804		this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
12805			.hide()
12806			.attr( "aria-hidden", "true" );
12807
12808		submenu
12809			.show()
12810			.removeAttr( "aria-hidden" )
12811			.attr( "aria-expanded", "true" )
12812			.position( position );
12813	},
12814
12815	collapseAll: function( event, all ) {
12816		clearTimeout( this.timer );
12817		this.timer = this._delay( function() {
12818
vendor: 5,432 bytes, lines 12819-13022
12819			// If we were passed an event, look for the submenu that contains the event
12820			var currentMenu = all ? this.element :
12821				$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
12822
12823			// If we found no valid submenu ancestor, use the main menu to close all
12824			// sub menus anyway
12825			if ( !currentMenu.length ) {
12826				currentMenu = this.element;
12827			}
12828
12829			this._close( currentMenu );
12830
12831			this.blur( event );
12832
12833			// Work around active item staying active after menu is blurred
12834			this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" );
12835
12836			this.activeMenu = currentMenu;
12837		}, all ? 0 : this.delay );
12838	},
12839
12840	// With no arguments, closes the currently active menu - if nothing is active
12841	// it closes all menus.  If passed an argument, it will search for menus BELOW
12842	_close: function( startMenu ) {
12843		if ( !startMenu ) {
12844			startMenu = this.active ? this.active.parent() : this.element;
12845		}
12846
12847		startMenu.find( ".ui-menu" )
12848			.hide()
12849			.attr( "aria-hidden", "true" )
12850			.attr( "aria-expanded", "false" );
12851	},
12852
12853	_closeOnDocumentClick: function( event ) {
12854		return !$( event.target ).closest( ".ui-menu" ).length;
12855	},
12856
12857	_isDivider: function( item ) {
12858
12859		// Match hyphen, em dash, en dash
12860		return !/[^\-\u2014\u2013\s]/.test( item.text() );
12861	},
12862
12863	collapse: function( event ) {
12864		var newItem = this.active &&
12865			this.active.parent().closest( ".ui-menu-item", this.element );
12866		if ( newItem && newItem.length ) {
12867			this._close();
12868			this.focus( event, newItem );
12869		}
12870	},
12871
12872	expand: function( event ) {
12873		var newItem = this.active && this._menuItems( this.active.children( ".ui-menu" ) ).first();
12874
12875		if ( newItem && newItem.length ) {
12876			this._open( newItem.parent() );
12877
12878			// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
12879			this._delay( function() {
12880				this.focus( event, newItem );
12881			} );
12882		}
12883	},
12884
12885	next: function( event ) {
12886		this._move( "next", "first", event );
12887	},
12888
12889	previous: function( event ) {
12890		this._move( "prev", "last", event );
12891	},
12892
12893	isFirstItem: function() {
12894		return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
12895	},
12896
12897	isLastItem: function() {
12898		return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
12899	},
12900
12901	_menuItems: function( menu ) {
12902		return ( menu || this.element )
12903			.find( this.options.items )
12904			.filter( ".ui-menu-item" );
12905	},
12906
12907	_move: function( direction, filter, event ) {
12908		var next;
12909		if ( this.active ) {
12910			if ( direction === "first" || direction === "last" ) {
12911				next = this.active
12912					[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
12913					.last();
12914			} else {
12915				next = this.active
12916					[ direction + "All" ]( ".ui-menu-item" )
12917					.first();
12918			}
12919		}
12920		if ( !next || !next.length || !this.active ) {
12921			next = this._menuItems( this.activeMenu )[ filter ]();
12922		}
12923
12924		this.focus( event, next );
12925	},
12926
12927	nextPage: function( event ) {
12928		var item, base, height;
12929
12930		if ( !this.active ) {
12931			this.next( event );
12932			return;
12933		}
12934		if ( this.isLastItem() ) {
12935			return;
12936		}
12937		if ( this._hasScroll() ) {
12938			base = this.active.offset().top;
12939			height = this.element.innerHeight();
12940
12941			// jQuery 3.2 doesn't include scrollbars in innerHeight, add it back.
12942			if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) {
12943				height += this.element[ 0 ].offsetHeight - this.element.outerHeight();
12944			}
12945
12946			this.active.nextAll( ".ui-menu-item" ).each( function() {
12947				item = $( this );
12948				return item.offset().top - base - height < 0;
12949			} );
12950
12951			this.focus( event, item );
12952		} else {
12953			this.focus( event, this._menuItems( this.activeMenu )
12954				[ !this.active ? "first" : "last" ]() );
12955		}
12956	},
12957
12958	previousPage: function( event ) {
12959		var item, base, height;
12960		if ( !this.active ) {
12961			this.next( event );
12962			return;
12963		}
12964		if ( this.isFirstItem() ) {
12965			return;
12966		}
12967		if ( this._hasScroll() ) {
12968			base = this.active.offset().top;
12969			height = this.element.innerHeight();
12970
12971			// jQuery 3.2 doesn't include scrollbars in innerHeight, add it back.
12972			if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) {
12973				height += this.element[ 0 ].offsetHeight - this.element.outerHeight();
12974			}
12975
12976			this.active.prevAll( ".ui-menu-item" ).each( function() {
12977				item = $( this );
12978				return item.offset().top - base + height > 0;
12979			} );
12980
12981			this.focus( event, item );
12982		} else {
12983			this.focus( event, this._menuItems( this.activeMenu ).first() );
12984		}
12985	},
12986
12987	_hasScroll: function() {
12988		return this.element.outerHeight() < this.element.prop( "scrollHeight" );
12989	},
12990
12991	select: function( event ) {
12992
12993		// TODO: It should never be possible to not have an active item at this
12994		// point, but the tests don't trigger mouseenter before click.
12995		this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
12996		var ui = { item: this.active };
12997		if ( !this.active.has( ".ui-menu" ).length ) {
12998			this.collapseAll( event, true );
12999		}
13000		this._trigger( "select", event, ui );
13001	},
13002
13003	_filterMenuItems: function( character ) {
13004		var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
13005			regex = new RegExp( "^" + escapedCharacter, "i" );
13006
13007		return this.activeMenu
13008			.find( this.options.items )
13009
13010				// Only match on items, not dividers or other content (#10571)
13011				.filter( ".ui-menu-item" )
13012					.filter( function() {
13013						return regex.test(
13014							String.prototype.trim.call(
13015								$( this ).children( ".ui-menu-item-wrapper" ).text() ) );
13016					} );
13017	}
13018} );
13019
13020
13021/*!
13022 * jQuery UI Autocomplete 1.1
130224.0
13023 * https://jqueryui.com
13024 *
13025 * Copyright OpenJS Foundation and other contributors
13026 * Released under the MIT license.
13027 * https://jquery.org/license
13028 */
13029
13030//>>label: Autocomplete
13031//>>group: Widgets
13032//>>description: Lists suggested words as the user is typing.
13033//>>docs: https://api.jqueryui.com/autocomplete/
13034//>>demos: https://jqueryui.com/autocomplete/
13035//>>css.structure: ../../themes/base/core.css
13036//>>css.structure: ../../themes/base/autocomplete.css
13037//>>css.theme: ../../themes/base/theme.css
13038
13039
13040$.widget( "ui.autocomplete", {
13041	version: "1.14.0
vendor: 15,301 bytes, lines 13041-13641
13041",
13042	defaultElement: "<input>",
13043	options: {
13044		appendTo: null,
13045		autoFocus: false,
13046		delay: 300,
13047		minLength: 1,
13048		position: {
13049			my: "left top",
13050			at: "left bottom",
13051			collision: "none"
13052		},
13053		source: null,
13054
13055		// Callbacks
13056		change: null,
13057		close: null,
13058		focus: null,
13059		open: null,
13060		response: null,
13061		search: null,
13062		select: null
13063	},
13064
13065	requestIndex: 0,
13066	pending: 0,
13067	liveRegionTimer: null,
13068
13069	_create: function() {
13070
13071		// Some browsers only repeat keydown events, not keypress events,
13072		// so we use the suppressKeyPress flag to determine if we've already
13073		// handled the keydown event. #7269
13074		// Unfortunately the code for & in keypress is the same as the up arrow,
13075		// so we use the suppressKeyPressRepeat flag to avoid handling keypress
13076		// events when we know the keydown event was used to modify the
13077		// search term. #7799
13078		var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
13079			nodeName = this.element[ 0 ].nodeName.toLowerCase(),
13080			isTextarea = nodeName === "textarea",
13081			isInput = nodeName === "input";
13082
13083		// Textareas are always multi-line
13084		// Inputs are always single-line, even if inside a contentEditable element
13085		// All other element types are determined by whether they're contentEditable
13086		this.isMultiLine = isTextarea ||
13087			!isInput && this.element.prop( "contentEditable" ) === "true";
13088
13089		this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
13090		this.isNewMenu = true;
13091
13092		this._addClass( "ui-autocomplete-input" );
13093		this.element.attr( "autocomplete", "off" );
13094
13095		this._on( this.element, {
13096			keydown: function( event ) {
13097				if ( this.element.prop( "readOnly" ) ) {
13098					suppressKeyPress = true;
13099					suppressInput = true;
13100					suppressKeyPressRepeat = true;
13101					return;
13102				}
13103
13104				suppressKeyPress = false;
13105				suppressInput = false;
13106				suppressKeyPressRepeat = false;
13107				var keyCode = $.ui.keyCode;
13108				switch ( event.keyCode ) {
13109				case keyCode.PAGE_UP:
13110					suppressKeyPress = true;
13111					this._move( "previousPage", event );
13112					break;
13113				case keyCode.PAGE_DOWN:
13114					suppressKeyPress = true;
13115					this._move( "nextPage", event );
13116					break;
13117				case keyCode.UP:
13118					suppressKeyPress = true;
13119					this._keyEvent( "previous", event );
13120					break;
13121				case keyCode.DOWN:
13122					suppressKeyPress = true;
13123					this._keyEvent( "next", event );
13124					break;
13125				case keyCode.ENTER:
13126
13127					// when menu is open and has focus
13128					if ( this.menu.active ) {
13129
13130						// #6055 - Opera still allows the keypress to occur
13131						// which causes forms to submit
13132						suppressKeyPress = true;
13133						event.preventDefault();
13134						this.menu.select( event );
13135					}
13136					break;
13137				case keyCode.TAB:
13138					if ( this.menu.active ) {
13139						this.menu.select( event );
13140					}
13141					break;
13142				case keyCode.ESCAPE:
13143					if ( this.menu.element.is( ":visible" ) ) {
13144						if ( !this.isMultiLine ) {
13145							this._value( this.term );
13146						}
13147						this.close( event );
13148
13149						// Different browsers have different default behavior for escape
13150						// Single press can mean undo or clear
13151						event.preventDefault();
13152					}
13153					break;
13154				default:
13155					suppressKeyPressRepeat = true;
13156
13157					// search timeout should be triggered before the input value is changed
13158					this._searchTimeout( event );
13159					break;
13160				}
13161			},
13162			keypress: function( event ) {
13163				if ( suppressKeyPress ) {
13164					suppressKeyPress = false;
13165					if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
13166						event.preventDefault();
13167					}
13168					return;
13169				}
13170				if ( suppressKeyPressRepeat ) {
13171					return;
13172				}
13173
13174				// Replicate some key handlers to allow them to repeat in Firefox and Opera
13175				var keyCode = $.ui.keyCode;
13176				switch ( event.keyCode ) {
13177				case keyCode.PAGE_UP:
13178					this._move( "previousPage", event );
13179					break;
13180				case keyCode.PAGE_DOWN:
13181					this._move( "nextPage", event );
13182					break;
13183				case keyCode.UP:
13184					this._keyEvent( "previous", event );
13185					break;
13186				case keyCode.DOWN:
13187					this._keyEvent( "next", event );
13188					break;
13189				}
13190			},
13191			input: function( event ) {
13192				if ( suppressInput ) {
13193					suppressInput = false;
13194					event.preventDefault();
13195					return;
13196				}
13197				this._searchTimeout( event );
13198			},
13199			focus: function() {
13200				this.selectedItem = null;
13201				this.previous = this._value();
13202			},
13203			blur: function( event ) {
13204				clearTimeout( this.searching );
13205				this.close( event );
13206				this._change( event );
13207			}
13208		} );
13209
13210		this._initSource();
13211		this.menu = $( "<ul>" )
13212			.appendTo( this._appendTo() )
13213			.menu( {
13214
13215				// disable ARIA support, the live region takes care of that
13216				role: null
13217			} )
13218			.hide()
13219			.menu( "instance" );
13220
13221		this._addClass( this.menu.element, "ui-autocomplete", "ui-front" );
13222		this._on( this.menu.element, {
13223			mousedown: function( event ) {
13224
13225				// Prevent moving focus out of the text field
13226				event.preventDefault();
13227			},
13228			menufocus: function( event, ui ) {
13229				var label, item;
13230
13231				// Support: Firefox
13232				// Prevent accidental activation of menu items in Firefox (#7024 #9118)
13233				if ( this.isNewMenu ) {
13234					this.isNewMenu = false;
13235					if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
13236						this.menu.blur();
13237
13238						this.document.one( "mousemove", function() {
13239							$( event.target ).trigger( event.originalEvent );
13240						} );
13241
13242						return;
13243					}
13244				}
13245
13246				item = ui.item.data( "ui-autocomplete-item" );
13247				if ( false !== this._trigger( "focus", event, { item: item } ) ) {
13248
13249					// use value to match what will end up in the input, if it was a key event
13250					if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
13251						this._value( item.value );
13252					}
13253				}
13254
13255				// Announce the value in the liveRegion
13256				label = ui.item.attr( "aria-label" ) || item.value;
13257				if ( label && String.prototype.trim.call( label ).length ) {
13258					clearTimeout( this.liveRegionTimer );
13259					this.liveRegionTimer = this._delay( function() {
13260						this.liveRegion.html( $( "<div>" ).text( label ) );
13261					}, 100 );
13262				}
13263			},
13264			menuselect: function( event, ui ) {
13265				var item = ui.item.data( "ui-autocomplete-item" ),
13266					previous = this.previous;
13267
13268				// Only trigger when focus was lost (click on menu)
13269				if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
13270					this.element.trigger( "focus" );
13271					this.previous = previous;
13272				}
13273
13274				if ( false !== this._trigger( "select", event, { item: item } ) ) {
13275					this._value( item.value );
13276				}
13277
13278				// reset the term after the select event
13279				// this allows custom select handling to work properly
13280				this.term = this._value();
13281
13282				this.close( event );
13283				this.selectedItem = item;
13284			}
13285		} );
13286
13287		this.liveRegion = $( "<div>", {
13288			role: "status",
13289			"aria-live": "assertive",
13290			"aria-relevant": "additions"
13291		} )
13292			.appendTo( this.document[ 0 ].body );
13293
13294		this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
13295
13296		// Turning off autocomplete prevents the browser from remembering the
13297		// value when navigating through history, so we re-enable autocomplete
13298		// if the page is unloaded before the widget is destroyed. #7790
13299		this._on( this.window, {
13300			beforeunload: function() {
13301				this.element.removeAttr( "autocomplete" );
13302			}
13303		} );
13304	},
13305
13306	_destroy: function() {
13307		clearTimeout( this.searching );
13308		this.element.removeAttr( "autocomplete" );
13309		this.menu.element.remove();
13310		this.liveRegion.remove();
13311	},
13312
13313	_setOption: function( key, value ) {
13314		this._super( key, value );
13315		if ( key === "source" ) {
13316			this._initSource();
13317		}
13318		if ( key === "appendTo" ) {
13319			this.menu.element.appendTo( this._appendTo() );
13320		}
13321		if ( key === "disabled" && value && this.xhr ) {
13322			this.xhr.abort();
13323		}
13324	},
13325
13326	_isEventTargetInWidget: function( event ) {
13327		var menuElement = this.menu.element[ 0 ];
13328
13329		return event.target === this.element[ 0 ] ||
13330			event.target === menuElement ||
13331			$.contains( menuElement, event.target );
13332	},
13333
13334	_closeOnClickOutside: function( event ) {
13335		if ( !this._isEventTargetInWidget( event ) ) {
13336			this.close();
13337		}
13338	},
13339
13340	_appendTo: function() {
13341		var element = this.options.appendTo;
13342
13343		if ( element ) {
13344			element = element.jquery || element.nodeType ?
13345				$( element ) :
13346				this.document.find( element ).eq( 0 );
13347		}
13348
13349		if ( !element || !element[ 0 ] ) {
13350			element = this.element.closest( ".ui-front, dialog" );
13351		}
13352
13353		if ( !element.length ) {
13354			element = this.document[ 0 ].body;
13355		}
13356
13357		return element;
13358	},
13359
13360	_initSource: function() {
13361		var array, url,
13362			that = this;
13363		if ( Array.isArray( this.options.source ) ) {
13364			array = this.options.source;
13365			this.source = function( request, response ) {
13366				response( $.ui.autocomplete.filter( array, request.term ) );
13367			};
13368		} else if ( typeof this.options.source === "string" ) {
13369			url = this.options.source;
13370			this.source = function( request, response ) {
13371				if ( that.xhr ) {
13372					that.xhr.abort();
13373				}
13374				that.xhr = $.ajax( {
13375					url: url,
13376					data: request,
13377					dataType: "json",
13378					success: function( data ) {
13379						response( data );
13380					},
13381					error: function() {
13382						response( [] );
13383					}
13384				} );
13385			};
13386		} else {
13387			this.source = this.options.source;
13388		}
13389	},
13390
13391	_searchTimeout: function( event ) {
13392		clearTimeout( this.searching );
13393		this.searching = this._delay( function() {
13394
13395			// Search if the value has changed, or if the user retypes the same value (see #7434)
13396			var equalValues = this.term === this._value(),
13397				menuVisible = this.menu.element.is( ":visible" ),
13398				modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
13399
13400			if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
13401				this.selectedItem = null;
13402				this.search( null, event );
13403			}
13404		}, this.options.delay );
13405	},
13406
13407	search: function( value, event ) {
13408		value = value != null ? value : this._value();
13409
13410		// Always save the actual value, not the one passed as an argument
13411		this.term = this._value();
13412
13413		if ( value.length < this.options.minLength ) {
13414			return this.close( event );
13415		}
13416
13417		if ( this._trigger( "search", event ) === false ) {
13418			return;
13419		}
13420
13421		return this._search( value );
13422	},
13423
13424	_search: function( value ) {
13425		this.pending++;
13426		this._addClass( "ui-autocomplete-loading" );
13427		this.cancelSearch = false;
13428
13429		this.source( { term: value }, this._response() );
13430	},
13431
13432	_response: function() {
13433		var index = ++this.requestIndex;
13434
13435		return function( content ) {
13436			if ( index === this.requestIndex ) {
13437				this.__response( content );
13438			}
13439
13440			this.pending--;
13441			if ( !this.pending ) {
13442				this._removeClass( "ui-autocomplete-loading" );
13443			}
13444		}.bind( this );
13445	},
13446
13447	__response: function( content ) {
13448		if ( content ) {
13449			content = this._normalize( content );
13450		}
13451		this._trigger( "response", null, { content: content } );
13452		if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
13453			this._suggest( content );
13454			this._trigger( "open" );
13455		} else {
13456
13457			// use ._close() instead of .close() so we don't cancel future searches
13458			this._close();
13459		}
13460	},
13461
13462	close: function( event ) {
13463		this.cancelSearch = true;
13464		this._close( event );
13465	},
13466
13467	_close: function( event ) {
13468
13469		// Remove the handler that closes the menu on outside clicks
13470		this._off( this.document, "mousedown" );
13471
13472		if ( this.menu.element.is( ":visible" ) ) {
13473			this.menu.element.hide();
13474			this.menu.blur();
13475			this.isNewMenu = true;
13476			this._trigger( "close", event );
13477		}
13478	},
13479
13480	_change: function( event ) {
13481		if ( this.previous !== this._value() ) {
13482			this._trigger( "change", event, { item: this.selectedItem } );
13483		}
13484	},
13485
13486	_normalize: function( items ) {
13487
13488		// assume all items have the right format when the first item is complete
13489		if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
13490			return items;
13491		}
13492		return $.map( items, function( item ) {
13493			if ( typeof item === "string" ) {
13494				return {
13495					label: item,
13496					value: item
13497				};
13498			}
13499			return $.extend( {}, item, {
13500				label: item.label || item.value,
13501				value: item.value || item.label
13502			} );
13503		} );
13504	},
13505
13506	_suggest: function( items ) {
13507		var ul = this.menu.element.empty();
13508		this._renderMenu( ul, items );
13509		this.isNewMenu = true;
13510		this.menu.refresh();
13511
13512		// Size and position menu
13513		ul.show();
13514		this._resizeMenu();
13515		ul.position( $.extend( {
13516			of: this.element
13517		}, this.options.position ) );
13518
13519		if ( this.options.autoFocus ) {
13520			this.menu.next();
13521		}
13522
13523		// Listen for interactions outside of the widget (#6642)
13524		this._on( this.document, {
13525			mousedown: "_closeOnClickOutside"
13526		} );
13527	},
13528
13529	_resizeMenu: function() {
13530		var ul = this.menu.element;
13531		ul.outerWidth( Math.max(
13532
13533			// Firefox wraps long text (possibly a rounding bug)
13534			// so we add 1px to avoid the wrapping (#7513)
13535			ul.width( "" ).outerWidth() + 1,
13536			this.element.outerWidth()
13537		) );
13538	},
13539
13540	_renderMenu: function( ul, items ) {
13541		var that = this;
13542		$.each( items, function( index, item ) {
13543			that._renderItemData( ul, item );
13544		} );
13545	},
13546
13547	_renderItemData: function( ul, item ) {
13548		return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
13549	},
13550
13551	_renderItem: function( ul, item ) {
13552		return $( "<li>" )
13553			.append( $( "<div>" ).text( item.label ) )
13554			.appendTo( ul );
13555	},
13556
13557	_move: function( direction, event ) {
13558		if ( !this.menu.element.is( ":visible" ) ) {
13559			this.search( null, event );
13560			return;
13561		}
13562		if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
13563				this.menu.isLastItem() && /^next/.test( direction ) ) {
13564
13565			if ( !this.isMultiLine ) {
13566				this._value( this.term );
13567			}
13568
13569			this.menu.blur();
13570			return;
13571		}
13572		this.menu[ direction ]( event );
13573	},
13574
13575	widget: function() {
13576		return this.menu.element;
13577	},
13578
13579	_value: function() {
13580		return this.valueMethod.apply( this.element, arguments );
13581	},
13582
13583	_keyEvent: function( keyEvent, event ) {
13584		if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
13585			this._move( keyEvent, event );
13586
13587			// Prevents moving cursor to beginning/end of the text field in some browsers
13588			event.preventDefault();
13589		}
13590	}
13591} );
13592
13593$.extend( $.ui.autocomplete, {
13594	escapeRegex: function( value ) {
13595		return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
13596	},
13597	filter: function( array, term ) {
13598		var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
13599		return $.grep( array, function( value ) {
13600			return matcher.test( value.label || value.value || value );
13601		} );
13602	}
13603} );
13604
13605// Live region extension, adding a `messages` option
13606// NOTE: This is an experimental API. We are still investigating
13607// a full solution for string manipulation and internationalization.
13608$.widget( "ui.autocomplete", $.ui.autocomplete, {
13609	options: {
13610		messages: {
13611			noResults: "No search results.",
13612			results: function( amount ) {
13613				return amount + ( amount > 1 ? " results are" : " result is" ) +
13614					" available, use up and down arrow keys to navigate.";
13615			}
13616		}
13617	},
13618
13619	__response: function( content ) {
13620		var message;
13621		this._superApply( arguments );
13622		if ( this.options.disabled || this.cancelSearch ) {
13623			return;
13624		}
13625		if ( content && content.length ) {
13626			message = this.options.messages.results( content.length );
13627		} else {
13628			message = this.options.messages.noResults;
13629		}
13630		clearTimeout( this.liveRegionTimer );
13631		this.liveRegionTimer = this._delay( function() {
13632			this.liveRegion.html( $( "<div>" ).text( message ) );
13633		}, 100 );
13634	}
13635} );
13636
13637var widgetsAutocomplete = $.ui.autocomplete;
13638
13639
13640/*!
13641 * jQuery UI Controlgroup 1.14.
136410
13642 * https://jqueryui.com
13643 *
13644 * Copyright OpenJS Foundation and other contributors
13645 * Released under the MIT license.
13646 * https://jquery.org/license
13647 */
13648
13649//>>label: Controlgroup
13650//>>group: Widgets
13651//>>description: Visually groups form control widgets
13652//>>docs: https://api.jqueryui.com/controlgroup/
13653//>>demos: https://jqueryui.com/controlgroup/
13654//>>css.structure: ../../themes/base/core.css
13655//>>css.structure: ../../themes/base/controlgroup.css
13656//>>css.theme: ../../themes/base/theme.css
13657
13658
13659var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
13660
13661var widgetsControlgroup = $.widget( "ui.controlgroup", {
13662	version: "1.14.0
vendor: 7,734 bytes, lines 13662-13926
13662",
13663	defaultElement: "<div>",
13664	options: {
13665		direction: "horizontal",
13666		disabled: null,
13667		onlyVisible: true,
13668		items: {
13669			"button": "input[type=button], input[type=submit], input[type=reset], button, a",
13670			"controlgroupLabel": ".ui-controlgroup-label",
13671			"checkboxradio": "input[type='checkbox'], input[type='radio']",
13672			"selectmenu": "select",
13673			"spinner": ".ui-spinner-input"
13674		}
13675	},
13676
13677	_create: function() {
13678		this._enhance();
13679	},
13680
13681	// To support the enhanced option in jQuery Mobile, we isolate DOM manipulation
13682	_enhance: function() {
13683		this.element.attr( "role", "toolbar" );
13684		this.refresh();
13685	},
13686
13687	_destroy: function() {
13688		this._callChildMethod( "destroy" );
13689		this.childWidgets.removeData( "ui-controlgroup-data" );
13690		this.element.removeAttr( "role" );
13691		if ( this.options.items.controlgroupLabel ) {
13692			this.element
13693				.find( this.options.items.controlgroupLabel )
13694				.find( ".ui-controlgroup-label-contents" )
13695				.contents().unwrap();
13696		}
13697	},
13698
13699	_initWidgets: function() {
13700		var that = this,
13701			childWidgets = [];
13702
13703		// First we iterate over each of the items options
13704		$.each( this.options.items, function( widget, selector ) {
13705			var labels;
13706			var options = {};
13707
13708			// Make sure the widget has a selector set
13709			if ( !selector ) {
13710				return;
13711			}
13712
13713			if ( widget === "controlgroupLabel" ) {
13714				labels = that.element.find( selector );
13715				labels.each( function() {
13716					var element = $( this );
13717
13718					if ( element.children( ".ui-controlgroup-label-contents" ).length ) {
13719						return;
13720					}
13721					element.contents()
13722						.wrapAll( "<span class='ui-controlgroup-label-contents'></span>" );
13723				} );
13724				that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" );
13725				childWidgets = childWidgets.concat( labels.get() );
13726				return;
13727			}
13728
13729			// Make sure the widget actually exists
13730			if ( !$.fn[ widget ] ) {
13731				return;
13732			}
13733
13734			// We assume everything is in the middle to start because we can't determine
13735			// first / last elements until all enhancments are done.
13736			if ( that[ "_" + widget + "Options" ] ) {
13737				options = that[ "_" + widget + "Options" ]( "middle" );
13738			} else {
13739				options = { classes: {} };
13740			}
13741
13742			// Find instances of this widget inside controlgroup and init them
13743			that.element
13744				.find( selector )
13745				.each( function() {
13746					var element = $( this );
13747					var instance = element[ widget ]( "instance" );
13748
13749					// We need to clone the default options for this type of widget to avoid
13750					// polluting the variable options which has a wider scope than a single widget.
13751					var instanceOptions = $.widget.extend( {}, options );
13752
13753					// If the button is the child of a spinner ignore it
13754					// TODO: Find a more generic solution
13755					if ( widget === "button" && element.parent( ".ui-spinner" ).length ) {
13756						return;
13757					}
13758
13759					// Create the widget if it doesn't exist
13760					if ( !instance ) {
13761						instance = element[ widget ]()[ widget ]( "instance" );
13762					}
13763					if ( instance ) {
13764						instanceOptions.classes =
13765							that._resolveClassesValues( instanceOptions.classes, instance );
13766					}
13767					element[ widget ]( instanceOptions );
13768
13769					// Store an instance of the controlgroup to be able to reference
13770					// from the outermost element for changing options and refresh
13771					var widgetElement = element[ widget ]( "widget" );
13772					$.data( widgetElement[ 0 ], "ui-controlgroup-data",
13773						instance ? instance : element[ widget ]( "instance" ) );
13774
13775					childWidgets.push( widgetElement[ 0 ] );
13776				} );
13777		} );
13778
13779		this.childWidgets = $( $.uniqueSort( childWidgets ) );
13780		this._addClass( this.childWidgets, "ui-controlgroup-item" );
13781	},
13782
13783	_callChildMethod: function( method ) {
13784		this.childWidgets.each( function() {
13785			var element = $( this ),
13786				data = element.data( "ui-controlgroup-data" );
13787			if ( data && data[ method ] ) {
13788				data[ method ]();
13789			}
13790		} );
13791	},
13792
13793	_updateCornerClass: function( element, position ) {
13794		var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
13795		var add = this._buildSimpleOptions( position, "label" ).classes.label;
13796
13797		this._removeClass( element, null, remove );
13798		this._addClass( element, null, add );
13799	},
13800
13801	_buildSimpleOptions: function( position, key ) {
13802		var direction = this.options.direction === "vertical";
13803		var result = {
13804			classes: {}
13805		};
13806		result.classes[ key ] = {
13807			"middle": "",
13808			"first": "ui-corner-" + ( direction ? "top" : "left" ),
13809			"last": "ui-corner-" + ( direction ? "bottom" : "right" ),
13810			"only": "ui-corner-all"
13811		}[ position ];
13812
13813		return result;
13814	},
13815
13816	_spinnerOptions: function( position ) {
13817		var options = this._buildSimpleOptions( position, "ui-spinner" );
13818
13819		options.classes[ "ui-spinner-up" ] = "";
13820		options.classes[ "ui-spinner-down" ] = "";
13821
13822		return options;
13823	},
13824
13825	_buttonOptions: function( position ) {
13826		return this._buildSimpleOptions( position, "ui-button" );
13827	},
13828
13829	_checkboxradioOptions: function( position ) {
13830		return this._buildSimpleOptions( position, "ui-checkboxradio-label" );
13831	},
13832
13833	_selectmenuOptions: function( position ) {
13834		var direction = this.options.direction === "vertical";
13835		return {
13836			width: direction ? "auto" : false,
13837			classes: {
13838				middle: {
13839					"ui-selectmenu-button-open": "",
13840					"ui-selectmenu-button-closed": ""
13841				},
13842				first: {
13843					"ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ),
13844					"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" )
13845				},
13846				last: {
13847					"ui-selectmenu-button-open": direction ? "" : "ui-corner-tr",
13848					"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" )
13849				},
13850				only: {
13851					"ui-selectmenu-button-open": "ui-corner-top",
13852					"ui-selectmenu-button-closed": "ui-corner-all"
13853				}
13854
13855			}[ position ]
13856		};
13857	},
13858
13859	_resolveClassesValues: function( classes, instance ) {
13860		var result = {};
13861		$.each( classes, function( key ) {
13862			var current = instance.options.classes[ key ] || "";
13863			current = String.prototype.trim.call( current.replace( controlgroupCornerRegex, "" ) );
13864			result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
13865		} );
13866		return result;
13867	},
13868
13869	_setOption: function( key, value ) {
13870		if ( key === "direction" ) {
13871			this._removeClass( "ui-controlgroup-" + this.options.direction );
13872		}
13873
13874		this._super( key, value );
13875		if ( key === "disabled" ) {
13876			this._callChildMethod( value ? "disable" : "enable" );
13877			return;
13878		}
13879
13880		this.refresh();
13881	},
13882
13883	refresh: function() {
13884		var children,
13885			that = this;
13886
13887		this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction );
13888
13889		if ( this.options.direction === "horizontal" ) {
13890			this._addClass( null, "ui-helper-clearfix" );
13891		}
13892		this._initWidgets();
13893
13894		children = this.childWidgets;
13895
13896		// We filter here because we need to track all childWidgets not just the visible ones
13897		if ( this.options.onlyVisible ) {
13898			children = children.filter( ":visible" );
13899		}
13900
13901		if ( children.length ) {
13902
13903			// We do this last because we need to make sure all enhancment is done
13904			// before determining first and last
13905			$.each( [ "first", "last" ], function( index, value ) {
13906				var instance = children[ value ]().data( "ui-controlgroup-data" );
13907
13908				if ( instance && that[ "_" + instance.widgetName + "Options" ] ) {
13909					var options = that[ "_" + instance.widgetName + "Options" ](
13910						children.length === 1 ? "only" : value
13911					);
13912					options.classes = that._resolveClassesValues( options.classes, instance );
13913					instance.element[ instance.widgetName ]( options );
13914				} else {
13915					that._updateCornerClass( children[ value ](), value );
13916				}
13917			} );
13918
13919			// Finally call the refresh method on each of the child widgets.
13920			this._callChildMethod( "refresh" );
13921		}
13922	}
13923} );
13924
13925/*!
13926 * jQuery UI Checkboxradio 1.1
vendor: 7,791 bytes, lines 13926-14216
139264.0
13927 * https://jqueryui.com
13928 *
13929 * Copyright OpenJS Foundation and other contributors
13930 * Released under the MIT license.
13931 * https://jquery.org/license
13932 */
13933
13934//>>label: Checkboxradio
13935//>>group: Widgets
13936//>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
13937//>>docs: https://api.jqueryui.com/checkboxradio/
13938//>>demos: https://jqueryui.com/checkboxradio/
13939//>>css.structure: ../../themes/base/core.css
13940//>>css.structure: ../../themes/base/button.css
13941//>>css.structure: ../../themes/base/checkboxradio.css
13942//>>css.theme: ../../themes/base/theme.css
13943
13944
13945$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
13946	version: "1.14.0",
13947	options: {
13948		disabled: null,
13949		label: null,
13950		icon: true,
13951		classes: {
13952			"ui-checkboxradio-label": "ui-corner-all",
13953			"ui-checkboxradio-icon": "ui-corner-all"
13954		}
13955	},
13956
13957	_getCreateOptions: function() {
13958		var disabled, labels, labelContents;
13959		var options = this._super() || {};
13960
13961		// We read the type here, because it makes more sense to throw a element type error first,
13962		// rather then the error for lack of a label. Often if its the wrong type, it
13963		// won't have a label (e.g. calling on a div, btn, etc)
13964		this._readType();
13965
13966		labels = this.element.labels();
13967
13968		// If there are multiple labels, use the last one
13969		this.label = $( labels[ labels.length - 1 ] );
13970		if ( !this.label.length ) {
13971			$.error( "No label found for checkboxradio widget" );
13972		}
13973
13974		this.originalLabel = "";
13975
13976		// We need to get the label text but this may also need to make sure it does not contain the
13977		// input itself.
13978		// The label contents could be text, html, or a mix. We wrap all elements
13979		// and read the wrapper's `innerHTML` to get a string representation of
13980		// the label, without the input as part of it.
13981		labelContents = this.label.contents().not( this.element[ 0 ] );
13982
13983		if ( labelContents.length ) {
13984			this.originalLabel += labelContents
13985				.clone()
13986				.wrapAll( "<div></div>" )
13987				.parent()
13988				.html();
13989		}
13990
13991		// Set the label option if we found label text
13992		if ( this.originalLabel ) {
13993			options.label = this.originalLabel;
13994		}
13995
13996		disabled = this.element[ 0 ].disabled;
13997		if ( disabled != null ) {
13998			options.disabled = disabled;
13999		}
14000		return options;
14001	},
14002
14003	_create: function() {
14004		var checked = this.element[ 0 ].checked;
14005
14006		this._bindFormResetHandler();
14007
14008		if ( this.options.disabled == null ) {
14009			this.options.disabled = this.element[ 0 ].disabled;
14010		}
14011
14012		this._setOption( "disabled", this.options.disabled );
14013		this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" );
14014		this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" );
14015
14016		if ( this.type === "radio" ) {
14017			this._addClass( this.label, "ui-checkboxradio-radio-label" );
14018		}
14019
14020		if ( this.options.label && this.options.label !== this.originalLabel ) {
14021			this._updateLabel();
14022		} else if ( this.originalLabel ) {
14023			this.options.label = this.originalLabel;
14024		}
14025
14026		this._enhance();
14027
14028		if ( checked ) {
14029			this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
14030		}
14031
14032		this._on( {
14033			change: "_toggleClasses",
14034			focus: function() {
14035				this._addClass( this.label, null, "ui-state-focus ui-visual-focus" );
14036			},
14037			blur: function() {
14038				this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" );
14039			}
14040		} );
14041	},
14042
14043	_readType: function() {
14044		var nodeName = this.element[ 0 ].nodeName.toLowerCase();
14045		this.type = this.element[ 0 ].type;
14046		if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) {
14047			$.error( "Can't create checkboxradio on element.nodeName=" + nodeName +
14048				" and element.type=" + this.type );
14049		}
14050	},
14051
14052	// Support jQuery Mobile enhanced option
14053	_enhance: function() {
14054		this._updateIcon( this.element[ 0 ].checked );
14055	},
14056
14057	widget: function() {
14058		return this.label;
14059	},
14060
14061	_getRadioGroup: function() {
14062		var group;
14063		var name = this.element[ 0 ].name;
14064		var nameSelector = "input[name='" + CSS.escape( name ) + "']";
14065
14066		if ( !name ) {
14067			return $( [] );
14068		}
14069
14070		if ( this.form.length ) {
14071			group = $( this.form[ 0 ].elements ).filter( nameSelector );
14072		} else {
14073
14074			// Not inside a form, check all inputs that also are not inside a form
14075			group = $( nameSelector ).filter( function() {
14076				return $( $( this ).prop( "form" ) ).length === 0;
14077			} );
14078		}
14079
14080		return group.not( this.element );
14081	},
14082
14083	_toggleClasses: function() {
14084		var checked = this.element[ 0 ].checked;
14085		this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
14086
14087		if ( this.options.icon && this.type === "checkbox" ) {
14088			this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked )
14089				._toggleClass( this.icon, null, "ui-icon-blank", !checked );
14090		}
14091
14092		if ( this.type === "radio" ) {
14093			this._getRadioGroup()
14094				.each( function() {
14095					var instance = $( this ).checkboxradio( "instance" );
14096
14097					if ( instance ) {
14098						instance._removeClass( instance.label,
14099							"ui-checkboxradio-checked", "ui-state-active" );
14100					}
14101				} );
14102		}
14103	},
14104
14105	_destroy: function() {
14106		this._unbindFormResetHandler();
14107
14108		if ( this.icon ) {
14109			this.icon.remove();
14110			this.iconSpace.remove();
14111		}
14112	},
14113
14114	_setOption: function( key, value ) {
14115
14116		// We don't allow the value to be set to nothing
14117		if ( key === "label" && !value ) {
14118			return;
14119		}
14120
14121		this._super( key, value );
14122
14123		if ( key === "disabled" ) {
14124			this._toggleClass( this.label, null, "ui-state-disabled", value );
14125			this.element[ 0 ].disabled = value;
14126
14127			// Don't refresh when setting disabled
14128			return;
14129		}
14130		this.refresh();
14131	},
14132
14133	_updateIcon: function( checked ) {
14134		var toAdd = "ui-icon ui-icon-background ";
14135
14136		if ( this.options.icon ) {
14137			if ( !this.icon ) {
14138				this.icon = $( "<span>" );
14139				this.iconSpace = $( "<span> </span>" );
14140				this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" );
14141			}
14142
14143			if ( this.type === "checkbox" ) {
14144				toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank";
14145				this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" );
14146			} else {
14147				toAdd += "ui-icon-blank";
14148			}
14149			this._addClass( this.icon, "ui-checkboxradio-icon", toAdd );
14150			if ( !checked ) {
14151				this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" );
14152			}
14153			this.icon.prependTo( this.label ).after( this.iconSpace );
14154		} else if ( this.icon !== undefined ) {
14155			this.icon.remove();
14156			this.iconSpace.remove();
14157			delete this.icon;
14158		}
14159	},
14160
14161	_updateLabel: function() {
14162
14163		// Remove the contents of the label ( minus the icon, icon space, and input )
14164		var contents = this.label.contents().not( this.element[ 0 ] );
14165		if ( this.icon ) {
14166			contents = contents.not( this.icon[ 0 ] );
14167		}
14168		if ( this.iconSpace ) {
14169			contents = contents.not( this.iconSpace[ 0 ] );
14170		}
14171		contents.remove();
14172
14173		this.label.append( this.options.label );
14174	},
14175
14176	refresh: function() {
14177		var checked = this.element[ 0 ].checked,
14178			isDisabled = this.element[ 0 ].disabled;
14179
14180		this._updateIcon( checked );
14181		this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
14182		if ( this.options.label !== null ) {
14183			this._updateLabel();
14184		}
14185
14186		if ( isDisabled !== this.options.disabled ) {
14187			this._setOptions( { "disabled": isDisabled } );
14188		}
14189	}
14190
14191} ] );
14192
14193var widgetsCheckboxradio = $.ui.checkboxradio;
14194
14195
14196/*!
14197 * jQuery UI Button 1.14.0
14198 * https://jqueryui.com
14199 *
14200 * Copyright OpenJS Foundation and other contributors
14201 * Released under the MIT license.
14202 * https://jquery.org/license
14203 */
14204
14205//>>label: Button
14206//>>group: Widgets
14207//>>description: Enhances a form with themeable buttons.
14208//>>docs: https://api.jqueryui.com/button/
14209//>>demos: https://jqueryui.com/button/
14210//>>css.structure: ../../themes/base/core.css
14211//>>css.structure: ../../themes/base/button.css
14212//>>css.theme: ../../themes/base/theme.css
14213
14214
14215$.widget( "ui.button", {
14216	version: "1.14.0
vendor: 10,754 bytes, lines 14216-14621
14216",
14217	defaultElement: "<button>",
14218	options: {
14219		classes: {
14220			"ui-button": "ui-corner-all"
14221		},
14222		disabled: null,
14223		icon: null,
14224		iconPosition: "beginning",
14225		label: null,
14226		showLabel: true
14227	},
14228
14229	_getCreateOptions: function() {
14230		var disabled,
14231
14232			// This is to support cases like in jQuery Mobile where the base widget does have
14233			// an implementation of _getCreateOptions
14234			options = this._super() || {};
14235
14236		this.isInput = this.element.is( "input" );
14237
14238		disabled = this.element[ 0 ].disabled;
14239		if ( disabled != null ) {
14240			options.disabled = disabled;
14241		}
14242
14243		this.originalLabel = this.isInput ? this.element.val() : this.element.html();
14244		if ( this.originalLabel ) {
14245			options.label = this.originalLabel;
14246		}
14247
14248		return options;
14249	},
14250
14251	_create: function() {
14252		if ( !this.option.showLabel & !this.options.icon ) {
14253			this.options.showLabel = true;
14254		}
14255
14256		// We have to check the option again here even though we did in _getCreateOptions,
14257		// because null may have been passed on init which would override what was set in
14258		// _getCreateOptions
14259		if ( this.options.disabled == null ) {
14260			this.options.disabled = this.element[ 0 ].disabled || false;
14261		}
14262
14263		this.hasTitle = !!this.element.attr( "title" );
14264
14265		// Check to see if the label needs to be set or if its already correct
14266		if ( this.options.label && this.options.label !== this.originalLabel ) {
14267			if ( this.isInput ) {
14268				this.element.val( this.options.label );
14269			} else {
14270				this.element.html( this.options.label );
14271			}
14272		}
14273		this._addClass( "ui-button", "ui-widget" );
14274		this._setOption( "disabled", this.options.disabled );
14275		this._enhance();
14276
14277		if ( this.element.is( "a" ) ) {
14278			this._on( {
14279				"keyup": function( event ) {
14280					if ( event.keyCode === $.ui.keyCode.SPACE ) {
14281						event.preventDefault();
14282
14283						// If a native click is available use it, so we
14284						// actually cause navigation. Otherwise, just trigger
14285						// a click event.
14286						if ( this.element[ 0 ].click ) {
14287							this.element[ 0 ].click();
14288						} else {
14289							this.element.trigger( "click" );
14290						}
14291					}
14292				}
14293			} );
14294		}
14295	},
14296
14297	_enhance: function() {
14298		if ( !this.element.is( "button" ) ) {
14299			this.element.attr( "role", "button" );
14300		}
14301
14302		if ( this.options.icon ) {
14303			this._updateIcon( "icon", this.options.icon );
14304			this._updateTooltip();
14305		}
14306	},
14307
14308	_updateTooltip: function() {
14309		this.title = this.element.attr( "title" );
14310
14311		if ( !this.options.showLabel && !this.title ) {
14312			this.element.attr( "title", this.options.label );
14313		}
14314	},
14315
14316	_updateIcon: function( option, value ) {
14317		var icon = option !== "iconPosition",
14318			position = icon ? this.options.iconPosition : value,
14319			displayBlock = position === "top" || position === "bottom";
14320
14321		// Create icon
14322		if ( !this.icon ) {
14323			this.icon = $( "<span>" );
14324
14325			this._addClass( this.icon, "ui-button-icon", "ui-icon" );
14326
14327			if ( !this.options.showLabel ) {
14328				this._addClass( "ui-button-icon-only" );
14329			}
14330		} else if ( icon ) {
14331
14332			// If we are updating the icon remove the old icon class
14333			this._removeClass( this.icon, null, this.options.icon );
14334		}
14335
14336		// If we are updating the icon add the new icon class
14337		if ( icon ) {
14338			this._addClass( this.icon, null, value );
14339		}
14340
14341		this._attachIcon( position );
14342
14343		// If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove
14344		// the iconSpace if there is one.
14345		if ( displayBlock ) {
14346			this._addClass( this.icon, null, "ui-widget-icon-block" );
14347			if ( this.iconSpace ) {
14348				this.iconSpace.remove();
14349			}
14350		} else {
14351
14352			// Position is beginning or end so remove the ui-widget-icon-block class and add the
14353			// space if it does not exist
14354			if ( !this.iconSpace ) {
14355				this.iconSpace = $( "<span> </span>" );
14356				this._addClass( this.iconSpace, "ui-button-icon-space" );
14357			}
14358			this._removeClass( this.icon, null, "ui-wiget-icon-block" );
14359			this._attachIconSpace( position );
14360		}
14361	},
14362
14363	_destroy: function() {
14364		this.element.removeAttr( "role" );
14365
14366		if ( this.icon ) {
14367			this.icon.remove();
14368		}
14369		if ( this.iconSpace ) {
14370			this.iconSpace.remove();
14371		}
14372		if ( !this.hasTitle ) {
14373			this.element.removeAttr( "title" );
14374		}
14375	},
14376
14377	_attachIconSpace: function( iconPosition ) {
14378		this.icon[ /^(?:end|bottom)/.test( iconPosition ) ? "before" : "after" ]( this.iconSpace );
14379	},
14380
14381	_attachIcon: function( iconPosition ) {
14382		this.element[ /^(?:end|bottom)/.test( iconPosition ) ? "append" : "prepend" ]( this.icon );
14383	},
14384
14385	_setOptions: function( options ) {
14386		var newShowLabel = options.showLabel === undefined ?
14387				this.options.showLabel :
14388				options.showLabel,
14389			newIcon = options.icon === undefined ? this.options.icon : options.icon;
14390
14391		if ( !newShowLabel && !newIcon ) {
14392			options.showLabel = true;
14393		}
14394		this._super( options );
14395	},
14396
14397	_setOption: function( key, value ) {
14398		if ( key === "icon" ) {
14399			if ( value ) {
14400				this._updateIcon( key, value );
14401			} else if ( this.icon ) {
14402				this.icon.remove();
14403				if ( this.iconSpace ) {
14404					this.iconSpace.remove();
14405				}
14406			}
14407		}
14408
14409		if ( key === "iconPosition" ) {
14410			this._updateIcon( key, value );
14411		}
14412
14413		// Make sure we can't end up with a button that has neither text nor icon
14414		if ( key === "showLabel" ) {
14415				this._toggleClass( "ui-button-icon-only", null, !value );
14416				this._updateTooltip();
14417		}
14418
14419		if ( key === "label" ) {
14420			if ( this.isInput ) {
14421				this.element.val( value );
14422			} else {
14423
14424				// If there is an icon, append it, else nothing then append the value
14425				// this avoids removal of the icon when setting label text
14426				this.element.html( value );
14427				if ( this.icon ) {
14428					this._attachIcon( this.options.iconPosition );
14429					this._attachIconSpace( this.options.iconPosition );
14430				}
14431			}
14432		}
14433
14434		this._super( key, value );
14435
14436		if ( key === "disabled" ) {
14437			this._toggleClass( null, "ui-state-disabled", value );
14438			this.element[ 0 ].disabled = value;
14439			if ( value ) {
14440				this.element.trigger( "blur" );
14441			}
14442		}
14443	},
14444
14445	refresh: function() {
14446
14447		// Make sure to only check disabled if its an element that supports this otherwise
14448		// check for the disabled class to determine state
14449		var isDisabled = this.element.is( "input, button" ) ?
14450			this.element[ 0 ].disabled : this.element.hasClass( "ui-button-disabled" );
14451
14452		if ( isDisabled !== this.options.disabled ) {
14453			this._setOptions( { disabled: isDisabled } );
14454		}
14455
14456		this._updateTooltip();
14457	}
14458} );
14459
14460// DEPRECATED
14461if ( $.uiBackCompat === true ) {
14462
14463	// Text and Icons options
14464	$.widget( "ui.button", $.ui.button, {
14465		options: {
14466			text: true,
14467			icons: {
14468				primary: null,
14469				secondary: null
14470			}
14471		},
14472
14473		_create: function() {
14474			if ( this.options.showLabel && !this.options.text ) {
14475				this.options.showLabel = this.options.text;
14476			}
14477			if ( !this.options.showLabel && this.options.text ) {
14478				this.options.text = this.options.showLabel;
14479			}
14480			if ( !this.options.icon && ( this.options.icons.primary ||
14481					this.options.icons.secondary ) ) {
14482				if ( this.options.icons.primary ) {
14483					this.options.icon = this.options.icons.primary;
14484				} else {
14485					this.options.icon = this.options.icons.secondary;
14486					this.options.iconPosition = "end";
14487				}
14488			} else if ( this.options.icon ) {
14489				this.options.icons.primary = this.options.icon;
14490			}
14491			this._super();
14492		},
14493
14494		_setOption: function( key, value ) {
14495			if ( key === "text" ) {
14496				this._super( "showLabel", value );
14497				return;
14498			}
14499			if ( key === "showLabel" ) {
14500				this.options.text = value;
14501			}
14502			if ( key === "icon" ) {
14503				this.options.icons.primary = value;
14504			}
14505			if ( key === "icons" ) {
14506				if ( value.primary ) {
14507					this._super( "icon", value.primary );
14508					this._super( "iconPosition", "beginning" );
14509				} else if ( value.secondary ) {
14510					this._super( "icon", value.secondary );
14511					this._super( "iconPosition", "end" );
14512				}
14513			}
14514			this._superApply( arguments );
14515		}
14516	} );
14517
14518	$.fn.button = ( function( orig ) {
14519		return function( options ) {
14520			var isMethodCall = typeof options === "string";
14521			var args = Array.prototype.slice.call( arguments, 1 );
14522			var returnValue = this;
14523
14524			if ( isMethodCall ) {
14525
14526				// If this is an empty collection, we need to have the instance method
14527				// return undefined instead of the jQuery instance
14528				if ( !this.length && options === "instance" ) {
14529					returnValue = undefined;
14530				} else {
14531					this.each( function() {
14532						var methodValue;
14533						var type = $( this ).attr( "type" );
14534						var name = type !== "checkbox" && type !== "radio" ?
14535							"button" :
14536							"checkboxradio";
14537						var instance = $.data( this, "ui-" + name );
14538
14539						if ( options === "instance" ) {
14540							returnValue = instance;
14541							return false;
14542						}
14543
14544						if ( !instance ) {
14545							return $.error( "cannot call methods on button" +
14546								" prior to initialization; " +
14547								"attempted to call method '" + options + "'" );
14548						}
14549
14550						if ( typeof instance[ options ] !== "function" ||
14551							options.charAt( 0 ) === "_" ) {
14552							return $.error( "no such method '" + options + "' for button" +
14553								" widget instance" );
14554						}
14555
14556						methodValue = instance[ options ].apply( instance, args );
14557
14558						if ( methodValue !== instance && methodValue !== undefined ) {
14559							returnValue = methodValue && methodValue.jquery ?
14560								returnValue.pushStack( methodValue.get() ) :
14561								methodValue;
14562							return false;
14563						}
14564					} );
14565				}
14566			} else {
14567
14568				// Allow multiple hashes to be passed on init
14569				if ( args.length ) {
14570					options = $.widget.extend.apply( null, [ options ].concat( args ) );
14571				}
14572
14573				this.each( function() {
14574					var type = $( this ).attr( "type" );
14575					var name = type !== "checkbox" && type !== "radio" ? "button" : "checkboxradio";
14576					var instance = $.data( this, "ui-" + name );
14577
14578					if ( instance ) {
14579						instance.option( options || {} );
14580						if ( instance._init ) {
14581							instance._init();
14582						}
14583					} else {
14584						if ( name === "button" ) {
14585							orig.call( $( this ), options );
14586							return;
14587						}
14588
14589						$( this ).checkboxradio( $.extend( { icon: false }, options ) );
14590					}
14591				} );
14592			}
14593
14594			return returnValue;
14595		};
14596	} )( $.fn.button );
14597
14598	$.fn.buttonset = function() {
14599		if ( !$.ui.controlgroup ) {
14600			$.error( "Controlgroup widget missing" );
14601		}
14602		if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" && arguments[ 2 ] ) {
14603			return this.controlgroup.apply( this,
14604				[ arguments[ 0 ], "items.button", arguments[ 2 ] ] );
14605		}
14606		if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" ) {
14607			return this.controlgroup.apply( this, [ arguments[ 0 ], "items.button" ] );
14608		}
14609		if ( typeof arguments[ 0 ] === "object" && arguments[ 0 ].items ) {
14610			arguments[ 0 ].items = {
14611				button: arguments[ 0 ].items
14612			};
14613		}
14614		return this.controlgroup.apply( this, arguments );
14615	};
14616}
14617
14618var widgetsButton = $.ui.button;
14619
14620
14621/* eslint-disable max-len
14621, camelcase */
14622/*!
14623 * jQuery UI Datepicker 1.14.0
14624 * https://jqueryui.com
14625 *
14626 * Copyright OpenJS Foundation and other contributors
14627 * Released under the MIT license.
14628 * https://jquery.org/license
14629 */
14630
14631//>>label: Datepicker
14632//>>group: Widgets
14633//>>description: Displays a calendar from an input or inline for selecting dates.
14634//>>docs: https://api.jqueryui.com/datepicker/
14635//>>demos: https://jqueryui.com/datepicker/
14636//>>css.structure: ../../themes/base/core.css
14637//>>css.structure: ../../themes/base/datepicker.css
14638//>>css.theme: ../../themes/base/theme.css
14639
14640
14641$.extend( $.ui, { datepicker: { version: "1.14.0
vendor: 17,405 bytes, lines 14641-15040
14641" } } );
14642
14643var datepicker_instActive;
14644
14645function datepicker_getZindex( elem ) {
14646	var position, value;
14647	while ( elem.length && elem[ 0 ] !== document ) {
14648
14649		// Ignore z-index if position is set to a value where z-index is ignored by the browser
14650		// This makes behavior of this function consistent across browsers
14651		// WebKit always returns auto if the element is positioned
14652		position = elem.css( "position" );
14653		if ( position === "absolute" || position === "relative" || position === "fixed" ) {
14654
14655			// IE returns 0 when zIndex is not specified
14656			// other browsers return a string
14657			// we ignore the case of nested elements with an explicit value of 0
14658			// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
14659			value = parseInt( elem.css( "zIndex" ), 10 );
14660			if ( !isNaN( value ) && value !== 0 ) {
14661				return value;
14662			}
14663		}
14664		elem = elem.parent();
14665	}
14666
14667	return 0;
14668}
14669
14670/* Date picker manager.
14671   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
14672   Settings for (groups of) date pickers are maintained in an instance object,
14673   allowing multiple different settings on the same page. */
14674
14675function Datepicker() {
14676	this._curInst = null; // The current instance in use
14677	this._keyEvent = false; // If the last event was a key event
14678	this._disabledInputs = []; // List of date picker inputs that have been disabled
14679	this._datepickerShowing = false; // True if the popup picker is showing , false if not
14680	this._inDialog = false; // True if showing within a "dialog", false if not
14681	this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
14682	this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
14683	this._appendClass = "ui-datepicker-append"; // The name of the append marker class
14684	this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
14685	this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
14686	this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
14687	this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
14688	this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
14689	this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
14690	this.regional = []; // Available regional settings, indexed by language code
14691	this.regional[ "" ] = { // Default regional settings
14692		closeText: "Done", // Display text for close link
14693		prevText: "Prev", // Display text for previous month link
14694		nextText: "Next", // Display text for next month link
14695		currentText: "Today", // Display text for current month link
14696		monthNames: [ "January", "February", "March", "April", "May", "June",
14697			"July", "August", "September", "October", "November", "December" ], // Names of months for drop-down and formatting
14698		monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], // For formatting
14699		dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], // For formatting
14700		dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], // For formatting
14701		dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ], // Column headings for days starting at Sunday
14702		weekHeader: "Wk", // Column header for week of the year
14703		dateFormat: "mm/dd/yy", // See format options on parseDate
14704		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
14705		isRTL: false, // True if right-to-left language, false if left-to-right
14706		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
14707		yearSuffix: "", // Additional text to append to the year in the month headers,
14708		selectMonthLabel: "Select month", // Invisible label for month selector
14709		selectYearLabel: "Select year" // Invisible label for year selector
14710	};
14711	this._defaults = { // Global defaults for all the date picker instances
14712		showOn: "focus", // "focus" for popup on focus,
14713			// "button" for trigger button, or "both" for either
14714		showAnim: "fadeIn", // Name of jQuery animation for popup
14715		showOptions: {}, // Options for enhanced animations
14716		defaultDate: null, // Used when field is blank: actual date,
14717			// +/-number for offset from today, null for today
14718		appendText: "", // Display text following the input box, e.g. showing the format
14719		buttonText: "...", // Text for trigger button
14720		buttonImage: "", // URL for trigger button image
14721		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
14722		hideIfNoPrevNext: false, // True to hide next/previous month links
14723			// if not applicable, false to just disable them
14724		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
14725		gotoCurrent: false, // True if today link goes back to current selection instead
14726		changeMonth: false, // True if month can be selected directly, false if only prev/next
14727		changeYear: false, // True if year can be selected directly, false if only prev/next
14728		yearRange: "c-10:c+10", // Range of years to display in drop-down,
14729			// either relative to today's year (-nn:+nn), relative to currently displayed year
14730			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
14731		showOtherMonths: false, // True to show dates in other months, false to leave blank
14732		selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
14733		showWeek: false, // True to show week of the year, false to not show it
14734		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
14735			// takes a Date and returns the number of the week for it
14736		shortYearCutoff: "+10", // Short year values < this are in the current century,
14737			// > this are in the previous century,
14738			// string value starting with "+" for current year + value
14739		minDate: null, // The earliest selectable date, or null for no limit
14740		maxDate: null, // The latest selectable date, or null for no limit
14741		duration: "fast", // Duration of display/closure
14742		beforeShowDay: null, // Function that takes a date and returns an array with
14743			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
14744			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
14745		beforeShow: null, // Function that takes an input field and
14746			// returns a set of custom settings for the date picker
14747		onSelect: null, // Define a callback function when a date is selected
14748		onChangeMonthYear: null, // Define a callback function when the month or year is changed
14749		onClose: null, // Define a callback function when the datepicker is closed
14750		onUpdateDatepicker: null, // Define a callback function when the datepicker is updated
14751		numberOfMonths: 1, // Number of months to show at a time
14752		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
14753		stepMonths: 1, // Number of months to step back/forward
14754		stepBigMonths: 12, // Number of months to step back/forward for the big links
14755		altField: "", // Selector for an alternate field to store selected dates into
14756		altFormat: "", // The date format to use for the alternate field
14757		constrainInput: true, // The input is constrained by the current date format
14758		showButtonPanel: false, // True to show button panel, false to not show it
14759		autoSize: false, // True to size the input for the date format, false to leave as is
14760		disabled: false // The initial disabled state
14761	};
14762	$.extend( this._defaults, this.regional[ "" ] );
14763	this.regional.en = $.extend( true, {}, this.regional[ "" ] );
14764	this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
14765	this.dpDiv = datepicker_bindHover( $( "<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) );
14766}
14767
14768$.extend( Datepicker.prototype, {
14769
14770	/* Class name added to elements to indicate already configured with a date picker. */
14771	markerClassName: "hasDatepicker",
14772
14773	//Keep track of the maximum number of rows displayed (see #7043)
14774	maxRows: 4,
14775
14776	// TODO rename to "widget" when switching to widget factory
14777	_widgetDatepicker: function() {
14778		return this.dpDiv;
14779	},
14780
14781	/* Override the default settings for all instances of the date picker.
14782	 * @param  settings  object - the new settings to use as defaults (anonymous object)
14783	 * @return the manager object
14784	 */
14785	setDefaults: function( settings ) {
14786		datepicker_extendRemove( this._defaults, settings || {} );
14787		return this;
14788	},
14789
14790	/* Attach the date picker to a jQuery selection.
14791	 * @param  target	element - the target input field or division or span
14792	 * @param  settings  object - the new settings to use for this date picker instance (anonymous)
14793	 */
14794	_attachDatepicker: function( target, settings ) {
14795		var nodeName, inline, inst;
14796		nodeName = target.nodeName.toLowerCase();
14797		inline = ( nodeName === "div" || nodeName === "span" );
14798		if ( !target.id ) {
14799			this.uuid += 1;
14800			target.id = "dp" + this.uuid;
14801		}
14802		inst = this._newInst( $( target ), inline );
14803		inst.settings = $.extend( {}, settings || {} );
14804		if ( nodeName === "input" ) {
14805			this._connectDatepicker( target, inst );
14806		} else if ( inline ) {
14807			this._inlineDatepicker( target, inst );
14808		}
14809	},
14810
14811	/* Create a new instance object. */
14812	_newInst: function( target, inline ) {
14813		var id = target[ 0 ].id.replace( /([^A-Za-z0-9_\-])/g, "\\\\$1" ); // escape jQuery meta chars
14814		return { id: id, input: target, // associated target
14815			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
14816			drawMonth: 0, drawYear: 0, // month being drawn
14817			inline: inline, // is datepicker inline or not
14818			dpDiv: ( !inline ? this.dpDiv : // presentation div
14819			datepicker_bindHover( $( "<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ) ) };
14820	},
14821
14822	/* Attach the date picker to an input field. */
14823	_connectDatepicker: function( target, inst ) {
14824		var input = $( target );
14825		inst.append = $( [] );
14826		inst.trigger = $( [] );
14827		if ( input.hasClass( this.markerClassName ) ) {
14828			return;
14829		}
14830		this._attachments( input, inst );
14831		input.addClass( this.markerClassName ).on( "keydown", this._doKeyDown ).
14832			on( "keypress", this._doKeyPress ).on( "keyup", this._doKeyUp );
14833		this._autoSize( inst );
14834		$.data( target, "datepicker", inst );
14835
14836		//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
14837		if ( inst.settings.disabled ) {
14838			this._disableDatepicker( target );
14839		}
14840	},
14841
14842	/* Make attachments based on settings. */
14843	_attachments: function( input, inst ) {
14844		var showOn, buttonText, buttonImage,
14845			appendText = this._get( inst, "appendText" ),
14846			isRTL = this._get( inst, "isRTL" );
14847
14848		if ( inst.append ) {
14849			inst.append.remove();
14850		}
14851		if ( appendText ) {
14852			inst.append = $( "<span>" )
14853				.addClass( this._appendClass )
14854				.text( appendText );
14855			input[ isRTL ? "before" : "after" ]( inst.append );
14856		}
14857
14858		input.off( "focus", this._showDatepicker );
14859
14860		if ( inst.trigger ) {
14861			inst.trigger.remove();
14862		}
14863
14864		showOn = this._get( inst, "showOn" );
14865		if ( showOn === "focus" || showOn === "both" ) { // pop-up date picker when in the marked field
14866			input.on( "focus", this._showDatepicker );
14867		}
14868		if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked
14869			buttonText = this._get( inst, "buttonText" );
14870			buttonImage = this._get( inst, "buttonImage" );
14871
14872			if ( this._get( inst, "buttonImageOnly" ) ) {
14873				inst.trigger = $( "<img>" )
14874					.addClass( this._triggerClass )
14875					.attr( {
14876						src: buttonImage,
14877						alt: buttonText,
14878						title: buttonText
14879					} );
14880			} else {
14881				inst.trigger = $( "<button type='button'>" )
14882					.addClass( this._triggerClass );
14883				if ( buttonImage ) {
14884					inst.trigger.html(
14885						$( "<img>" )
14886							.attr( {
14887								src: buttonImage,
14888								alt: buttonText,
14889								title: buttonText
14890							} )
14891					);
14892				} else {
14893					inst.trigger.text( buttonText );
14894				}
14895			}
14896
14897			input[ isRTL ? "before" : "after" ]( inst.trigger );
14898			inst.trigger.on( "click", function() {
14899				if ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) {
14900					$.datepicker._hideDatepicker();
14901				} else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) {
14902					$.datepicker._hideDatepicker();
14903					$.datepicker._showDatepicker( input[ 0 ] );
14904				} else {
14905					$.datepicker._showDatepicker( input[ 0 ] );
14906				}
14907				return false;
14908			} );
14909		}
14910	},
14911
14912	/* Apply the maximum length for the date format. */
14913	_autoSize: function( inst ) {
14914		if ( this._get( inst, "autoSize" ) && !inst.inline ) {
14915			var findMax, max, maxI, i,
14916				date = new Date( 2009, 12 - 1, 20 ), // Ensure double digits
14917				dateFormat = this._get( inst, "dateFormat" );
14918
14919			if ( dateFormat.match( /[DM]/ ) ) {
14920				findMax = function( names ) {
14921					max = 0;
14922					maxI = 0;
14923					for ( i = 0; i < names.length; i++ ) {
14924						if ( names[ i ].length > max ) {
14925							max = names[ i ].length;
14926							maxI = i;
14927						}
14928					}
14929					return maxI;
14930				};
14931				date.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ?
14932					"monthNames" : "monthNamesShort" ) ) ) );
14933				date.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ?
14934					"dayNames" : "dayNamesShort" ) ) ) + 20 - date.getDay() );
14935			}
14936			inst.input.attr( "size", this._formatDate( inst, date ).length );
14937		}
14938	},
14939
14940	/* Attach an inline date picker to a div. */
14941	_inlineDatepicker: function( target, inst ) {
14942		var divSpan = $( target );
14943		if ( divSpan.hasClass( this.markerClassName ) ) {
14944			return;
14945		}
14946		divSpan.addClass( this.markerClassName ).append( inst.dpDiv );
14947		$.data( target, "datepicker", inst );
14948		this._setDate( inst, this._getDefaultDate( inst ), true );
14949		this._updateDatepicker( inst );
14950		this._updateAlternate( inst );
14951
14952		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
14953		if ( inst.settings.disabled ) {
14954			this._disableDatepicker( target );
14955		}
14956
14957		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
14958		// https://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
14959		inst.dpDiv.css( "display", "block" );
14960	},
14961
14962	/* Pop-up the date picker in a "dialog" box.
14963	 * @param  input element - ignored
14964	 * @param  date	string or Date - the initial date to display
14965	 * @param  onSelect  function - the function to call when a date is selected
14966	 * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
14967	 * @param  pos int[2] - coordinates for the dialog's position within the screen or
14968	 *					event - with x/y coordinates or
14969	 *					leave empty for default (screen centre)
14970	 * @return the manager object
14971	 */
14972	_dialogDatepicker: function( input, date, onSelect, settings, pos ) {
14973		var id, browserWidth, browserHeight, scrollX, scrollY,
14974			inst = this._dialogInst; // internal instance
14975
14976		if ( !inst ) {
14977			this.uuid += 1;
14978			id = "dp" + this.uuid;
14979			this._dialogInput = $( "<input type='text' id='" + id +
14980				"' style='position: absolute; top: -100px; width: 0px;'/>" );
14981			this._dialogInput.on( "keydown", this._doKeyDown );
14982			$( "body" ).append( this._dialogInput );
14983			inst = this._dialogInst = this._newInst( this._dialogInput, false );
14984			inst.settings = {};
14985			$.data( this._dialogInput[ 0 ], "datepicker", inst );
14986		}
14987		datepicker_extendRemove( inst.settings, settings || {} );
14988		date = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date );
14989		this._dialogInput.val( date );
14990
14991		this._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null );
14992		if ( !this._pos ) {
14993			browserWidth = document.documentElement.clientWidth;
14994			browserHeight = document.documentElement.clientHeight;
14995			scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
14996			scrollY = document.documentElement.scrollTop || document.body.scrollTop;
14997			this._pos = // should use actual width/height below
14998				[ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ];
14999		}
15000
15001		// Move input on screen for focus, but hidden behind dialog
15002		this._dialogInput.css( "left", ( this._pos[ 0 ] + 20 ) + "px" ).css( "top", this._pos[ 1 ] + "px" );
15003		inst.settings.onSelect = onSelect;
15004		this._inDialog = true;
15005		this.dpDiv.addClass( this._dialogClass );
15006		this._showDatepicker( this._dialogInput[ 0 ] );
15007		if ( $.blockUI ) {
15008			$.blockUI( this.dpDiv );
15009		}
15010		$.data( this._dialogInput[ 0 ], "datepicker", inst );
15011		return this;
15012	},
15013
15014	/* Detach a datepicker from its control.
15015	 * @param  target	element - the target input field or division or span
15016	 */
15017	_destroyDatepicker: function( target ) {
15018		var nodeName,
15019			$target = $( target ),
15020			inst = $.data( target, "datepicker" );
15021
15022		if ( !$target.hasClass( this.markerClassName ) ) {
15023			return;
15024		}
15025
15026		nodeName = target.nodeName.toLowerCase();
15027		$.removeData( target, "datepicker" );
15028		if ( nodeName === "input" ) {
15029			inst.append.remove();
15030			inst.trigger.remove();
15031			$target.removeClass( this.markerClassName ).
15032				off( "focus", this._showDatepicker ).
15033				off( "keydown", this._doKeyDown ).
15034				off( "keypress", this._doKeyPress ).
15035				off( "keyup", this._doKeyUp );
15036		} else if ( nodeName === "div" || nodeName === "span" ) {
15037			$target.removeClass( this.markerClassName ).empty();
15038		}
15039
15040		
15040$.datepicker._hideDatepicker();
vendor: 15,786 bytes, lines 15040-15504
15040
15041		if ( datepicker_instActive === inst ) {
15042			datepicker_instActive = null;
15043			this._curInst = null;
15044		}
15045	},
15046
15047	/* Enable the date picker to a jQuery selection.
15048	 * @param  target	element - the target input field or division or span
15049	 */
15050	_enableDatepicker: function( target ) {
15051		var nodeName, inline,
15052			$target = $( target ),
15053			inst = $.data( target, "datepicker" );
15054
15055		if ( !$target.hasClass( this.markerClassName ) ) {
15056			return;
15057		}
15058
15059		nodeName = target.nodeName.toLowerCase();
15060		if ( nodeName === "input" ) {
15061			target.disabled = false;
15062			inst.trigger.filter( "button" ).
15063				each( function() {
15064					this.disabled = false;
15065				} ).end().
15066				filter( "img" ).css( { opacity: "1.0", cursor: "" } );
15067		} else if ( nodeName === "div" || nodeName === "span" ) {
15068			inline = $target.children( "." + this._inlineClass );
15069			inline.children().removeClass( "ui-state-disabled" );
15070			inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
15071				prop( "disabled", false );
15072		}
15073		this._disabledInputs = $.map( this._disabledInputs,
15074
15075			// Delete entry
15076			function( value ) {
15077				return ( value === target ? null : value );
15078			} );
15079	},
15080
15081	/* Disable the date picker to a jQuery selection.
15082	 * @param  target	element - the target input field or division or span
15083	 */
15084	_disableDatepicker: function( target ) {
15085		var nodeName, inline,
15086			$target = $( target ),
15087			inst = $.data( target, "datepicker" );
15088
15089		if ( !$target.hasClass( this.markerClassName ) ) {
15090			return;
15091		}
15092
15093		nodeName = target.nodeName.toLowerCase();
15094		if ( nodeName === "input" ) {
15095			target.disabled = true;
15096			inst.trigger.filter( "button" ).
15097				each( function() {
15098					this.disabled = true;
15099				} ).end().
15100				filter( "img" ).css( { opacity: "0.5", cursor: "default" } );
15101		} else if ( nodeName === "div" || nodeName === "span" ) {
15102			inline = $target.children( "." + this._inlineClass );
15103			inline.children().addClass( "ui-state-disabled" );
15104			inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
15105				prop( "disabled", true );
15106		}
15107		this._disabledInputs = $.map( this._disabledInputs,
15108
15109			// Delete entry
15110			function( value ) {
15111				return ( value === target ? null : value );
15112			} );
15113		this._disabledInputs[ this._disabledInputs.length ] = target;
15114	},
15115
15116	/* Is the first field in a jQuery collection disabled as a datepicker?
15117	 * @param  target	element - the target input field or division or span
15118	 * @return boolean - true if disabled, false if enabled
15119	 */
15120	_isDisabledDatepicker: function( target ) {
15121		if ( !target ) {
15122			return false;
15123		}
15124		for ( var i = 0; i < this._disabledInputs.length; i++ ) {
15125			if ( this._disabledInputs[ i ] === target ) {
15126				return true;
15127			}
15128		}
15129		return false;
15130	},
15131
15132	/* Retrieve the instance data for the target control.
15133	 * @param  target  element - the target input field or division or span
15134	 * @return  object - the associated instance data
15135	 * @throws  error if a jQuery problem getting data
15136	 */
15137	_getInst: function( target ) {
15138		try {
15139			return $.data( target, "datepicker" );
15140		} catch ( err ) {
15141			throw "Missing instance data for this datepicker";
15142		}
15143	},
15144
15145	/* Update or retrieve the settings for a date picker attached to an input field or division.
15146	 * @param  target  element - the target input field or division or span
15147	 * @param  name	object - the new settings to update or
15148	 *				string - the name of the setting to change or retrieve,
15149	 *				when retrieving also "all" for all instance settings or
15150	 *				"defaults" for all global defaults
15151	 * @param  value   any - the new value for the setting
15152	 *				(omit if above is an object or to retrieve a value)
15153	 */
15154	_optionDatepicker: function( target, name, value ) {
15155		var settings, date, minDate, maxDate,
15156			inst = this._getInst( target );
15157
15158		if ( arguments.length === 2 && typeof name === "string" ) {
15159			return ( name === "defaults" ? $.extend( {}, $.datepicker._defaults ) :
15160				( inst ? ( name === "all" ? $.extend( {}, inst.settings ) :
15161				this._get( inst, name ) ) : null ) );
15162		}
15163
15164		settings = name || {};
15165		if ( typeof name === "string" ) {
15166			settings = {};
15167			settings[ name ] = value;
15168		}
15169
15170		if ( inst ) {
15171			if ( this._curInst === inst ) {
15172				this._hideDatepicker();
15173			}
15174
15175			date = this._getDateDatepicker( target, true );
15176			minDate = this._getMinMaxDate( inst, "min" );
15177			maxDate = this._getMinMaxDate( inst, "max" );
15178			datepicker_extendRemove( inst.settings, settings );
15179
15180			// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
15181			if ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) {
15182				inst.settings.minDate = this._formatDate( inst, minDate );
15183			}
15184			if ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) {
15185				inst.settings.maxDate = this._formatDate( inst, maxDate );
15186			}
15187			if ( "disabled" in settings ) {
15188				if ( settings.disabled ) {
15189					this._disableDatepicker( target );
15190				} else {
15191					this._enableDatepicker( target );
15192				}
15193			}
15194			this._attachments( $( target ), inst );
15195			this._autoSize( inst );
15196			this._setDate( inst, date );
15197			this._updateAlternate( inst );
15198			this._updateDatepicker( inst );
15199		}
15200	},
15201
15202	// Change method deprecated
15203	_changeDatepicker: function( target, name, value ) {
15204		this._optionDatepicker( target, name, value );
15205	},
15206
15207	/* Redraw the date picker attached to an input field or division.
15208	 * @param  target  element - the target input field or division or span
15209	 */
15210	_refreshDatepicker: function( target ) {
15211		var inst = this._getInst( target );
15212		if ( inst ) {
15213			this._updateDatepicker( inst );
15214		}
15215	},
15216
15217	/* Set the dates for a jQuery selection.
15218	 * @param  target element - the target input field or division or span
15219	 * @param  date	Date - the new date
15220	 */
15221	_setDateDatepicker: function( target, date ) {
15222		var inst = this._getInst( target );
15223		if ( inst ) {
15224			this._setDate( inst, date );
15225			this._updateDatepicker( inst );
15226			this._updateAlternate( inst );
15227		}
15228	},
15229
15230	/* Get the date(s) for the first entry in a jQuery selection.
15231	 * @param  target element - the target input field or division or span
15232	 * @param  noDefault boolean - true if no default date is to be used
15233	 * @return Date - the current date
15234	 */
15235	_getDateDatepicker: function( target, noDefault ) {
15236		var inst = this._getInst( target );
15237		if ( inst && !inst.inline ) {
15238			this._setDateFromField( inst, noDefault );
15239		}
15240		return ( inst ? this._getDate( inst ) : null );
15241	},
15242
15243	/* Handle keystrokes. */
15244	_doKeyDown: function( event ) {
15245		var onSelect, dateStr, sel,
15246			inst = $.datepicker._getInst( event.target ),
15247			handled = true,
15248			isRTL = inst.dpDiv.is( ".ui-datepicker-rtl" );
15249
15250		inst._keyEvent = true;
15251		if ( $.datepicker._datepickerShowing ) {
15252			switch ( event.keyCode ) {
15253				case 9: $.datepicker._hideDatepicker();
15254						handled = false;
15255						break; // hide on tab out
15256				case 13: sel = $( "td." + $.datepicker._dayOverClass + ":not(." +
15257									$.datepicker._currentClass + ")", inst.dpDiv );
15258						if ( sel[ 0 ] ) {
15259							$.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] );
15260						}
15261
15262						onSelect = $.datepicker._get( inst, "onSelect" );
15263						if ( onSelect ) {
15264							dateStr = $.datepicker._formatDate( inst );
15265
15266							// Trigger custom callback
15267							onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );
15268						} else {
15269							$.datepicker._hideDatepicker();
15270						}
15271
15272						return false; // don't submit the form
15273				case 27: $.datepicker._hideDatepicker();
15274						break; // hide on escape
15275				case 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
15276							-$.datepicker._get( inst, "stepBigMonths" ) :
15277							-$.datepicker._get( inst, "stepMonths" ) ), "M" );
15278						break; // previous month/year on page up/+ ctrl
15279				case 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
15280							+$.datepicker._get( inst, "stepBigMonths" ) :
15281							+$.datepicker._get( inst, "stepMonths" ) ), "M" );
15282						break; // next month/year on page down/+ ctrl
15283				case 35: if ( event.ctrlKey || event.metaKey ) {
15284							$.datepicker._clearDate( event.target );
15285						}
15286						handled = event.ctrlKey || event.metaKey;
15287						break; // clear on ctrl or command +end
15288				case 36: if ( event.ctrlKey || event.metaKey ) {
15289							$.datepicker._gotoToday( event.target );
15290						}
15291						handled = event.ctrlKey || event.metaKey;
15292						break; // current on ctrl or command +home
15293				case 37: if ( event.ctrlKey || event.metaKey ) {
15294							$.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), "D" );
15295						}
15296						handled = event.ctrlKey || event.metaKey;
15297
15298						// -1 day on ctrl or command +left
15299						if ( event.originalEvent.altKey ) {
15300							$.datepicker._adjustDate( event.target, ( event.ctrlKey ?
15301								-$.datepicker._get( inst, "stepBigMonths" ) :
15302								-$.datepicker._get( inst, "stepMonths" ) ), "M" );
15303						}
15304
15305						// next month/year on alt +left on Mac
15306						break;
15307				case 38: if ( event.ctrlKey || event.metaKey ) {
15308							$.datepicker._adjustDate( event.target, -7, "D" );
15309						}
15310						handled = event.ctrlKey || event.metaKey;
15311						break; // -1 week on ctrl or command +up
15312				case 39: if ( event.ctrlKey || event.metaKey ) {
15313							$.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), "D" );
15314						}
15315						handled = event.ctrlKey || event.metaKey;
15316
15317						// +1 day on ctrl or command +right
15318						if ( event.originalEvent.altKey ) {
15319							$.datepicker._adjustDate( event.target, ( event.ctrlKey ?
15320								+$.datepicker._get( inst, "stepBigMonths" ) :
15321								+$.datepicker._get( inst, "stepMonths" ) ), "M" );
15322						}
15323
15324						// next month/year on alt +right
15325						break;
15326				case 40: if ( event.ctrlKey || event.metaKey ) {
15327							$.datepicker._adjustDate( event.target, +7, "D" );
15328						}
15329						handled = event.ctrlKey || event.metaKey;
15330						break; // +1 week on ctrl or command +down
15331				default: handled = false;
15332			}
15333		} else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home
15334			$.datepicker._showDatepicker( this );
15335		} else {
15336			handled = false;
15337		}
15338
15339		if ( handled ) {
15340			event.preventDefault();
15341			event.stopPropagation();
15342		}
15343	},
15344
15345	/* Filter entered characters - based on date format. */
15346	_doKeyPress: function( event ) {
15347		var chars, chr,
15348			inst = $.datepicker._getInst( event.target );
15349
15350		if ( $.datepicker._get( inst, "constrainInput" ) ) {
15351			chars = $.datepicker._possibleChars( $.datepicker._get( inst, "dateFormat" ) );
15352			chr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode );
15353			return event.ctrlKey || event.metaKey || ( chr < " " || !chars || chars.indexOf( chr ) > -1 );
15354		}
15355	},
15356
15357	/* Synchronise manual entry and field/alternate field. */
15358	_doKeyUp: function( event ) {
15359		var date,
15360			inst = $.datepicker._getInst( event.target );
15361
15362		if ( inst.input.val() !== inst.lastVal ) {
15363			try {
15364				date = $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
15365					( inst.input ? inst.input.val() : null ),
15366					$.datepicker._getFormatConfig( inst ) );
15367
15368				if ( date ) { // only if valid
15369					$.datepicker._setDateFromField( inst );
15370					$.datepicker._updateAlternate( inst );
15371					$.datepicker._updateDatepicker( inst );
15372				}
15373			} catch ( err ) {
15374			}
15375		}
15376		return true;
15377	},
15378
15379	/* Pop-up the date picker for a given input field.
15380	 * If false returned from beforeShow event handler do not show.
15381	 * @param  input  element - the input field attached to the date picker or
15382	 *					event - if triggered by focus
15383	 */
15384	_showDatepicker: function( input ) {
15385		input = input.target || input;
15386		if ( input.nodeName.toLowerCase() !== "input" ) { // find from button/image trigger
15387			input = $( "input", input.parentNode )[ 0 ];
15388		}
15389
15390		if ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here
15391			return;
15392		}
15393
15394		var inst, beforeShow, beforeShowSettings, isFixed,
15395			offset, showAnim, duration;
15396
15397		inst = $.datepicker._getInst( input );
15398		if ( $.datepicker._curInst && $.datepicker._curInst !== inst ) {
15399			$.datepicker._curInst.dpDiv.stop( true, true );
15400			if ( inst && $.datepicker._datepickerShowing ) {
15401				$.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] );
15402			}
15403		}
15404
15405		beforeShow = $.datepicker._get( inst, "beforeShow" );
15406		beforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {};
15407		if ( beforeShowSettings === false ) {
15408			return;
15409		}
15410		datepicker_extendRemove( inst.settings, beforeShowSettings );
15411
15412		inst.lastVal = null;
15413		$.datepicker._lastInput = input;
15414		$.datepicker._setDateFromField( inst );
15415
15416		if ( $.datepicker._inDialog ) { // hide cursor
15417			input.value = "";
15418		}
15419		if ( !$.datepicker._pos ) { // position below input
15420			$.datepicker._pos = $.datepicker._findPos( input );
15421			$.datepicker._pos[ 1 ] += input.offsetHeight; // add the height
15422		}
15423
15424		isFixed = false;
15425		$( input ).parents().each( function() {
15426			isFixed |= $( this ).css( "position" ) === "fixed";
15427			return !isFixed;
15428		} );
15429
15430		offset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] };
15431		$.datepicker._pos = null;
15432
15433		//to avoid flashes on Firefox
15434		inst.dpDiv.empty();
15435
15436		// determine sizing offscreen
15437		inst.dpDiv.css( { position: "absolute", display: "block", top: "-1000px" } );
15438		$.datepicker._updateDatepicker( inst );
15439
15440		// fix width for dynamic number of date pickers
15441		// and adjust position before showing
15442		offset = $.datepicker._checkOffset( inst, offset, isFixed );
15443		inst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ?
15444			"static" : ( isFixed ? "fixed" : "absolute" ) ), display: "none",
15445			left: offset.left + "px", top: offset.top + "px" } );
15446
15447		if ( !inst.inline ) {
15448			showAnim = $.datepicker._get( inst, "showAnim" );
15449			duration = $.datepicker._get( inst, "duration" );
15450			inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
15451			$.datepicker._datepickerShowing = true;
15452
15453			if ( $.effects && $.effects.effect[ showAnim ] ) {
15454				inst.dpDiv.show( showAnim, $.datepicker._get( inst, "showOptions" ), duration );
15455			} else {
15456				inst.dpDiv[ showAnim || "show" ]( showAnim ? duration : null );
15457			}
15458
15459			if ( $.datepicker._shouldFocusInput( inst ) ) {
15460				inst.input.trigger( "focus" );
15461			}
15462
15463			$.datepicker._curInst = inst;
15464		}
15465	},
15466
15467	/* Generate the date picker content. */
15468	_updateDatepicker: function( inst ) {
15469		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
15470		datepicker_instActive = inst; // for delegate hover events
15471		inst.dpDiv.empty().append( this._generateHTML( inst ) );
15472		this._attachHandlers( inst );
15473
15474		var origyearshtml,
15475			numMonths = this._getNumberOfMonths( inst ),
15476			cols = numMonths[ 1 ],
15477			width = 17,
15478			activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" ),
15479			onUpdateDatepicker = $.datepicker._get( inst, "onUpdateDatepicker" );
15480
15481		if ( activeCell.length > 0 ) {
15482			datepicker_handleMouseover.apply( activeCell.get( 0 ) );
15483		}
15484
15485		inst.dpDiv.removeClass( "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4" ).width( "" );
15486		if ( cols > 1 ) {
15487			inst.dpDiv.addClass( "ui-datepicker-multi-" + cols ).css( "width", ( width * cols ) + "em" );
15488		}
15489		inst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? "add" : "remove" ) +
15490			"Class" ]( "ui-datepicker-multi" );
15491		inst.dpDiv[ ( this._get( inst, "isRTL" ) ? "add" : "remove" ) +
15492			"Class" ]( "ui-datepicker-rtl" );
15493
15494		if ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
15495			inst.input.trigger( "focus" );
15496		}
15497
15498		// Deffered render of the years select (to avoid flashes on Firefox)
15499		if ( inst.yearshtml ) {
15500			origyearshtml = inst.yearshtml;
15501			setTimeout( function() {
15502
15503				//assure that inst.yearshtml didn't change.
15504				if ( origyearshtml === inst.yearshtml && inst.yearshtml ) {
vendor: 5,251 bytes, lines 15505-15659
15505					inst.dpDiv.find( "select.ui-datepicker-year" ).first().replaceWith( inst.yearshtml );
15506				}
15507				origyearshtml = inst.yearshtml = null;
15508			}, 0 );
15509		}
15510
15511		if ( onUpdateDatepicker ) {
15512			onUpdateDatepicker.apply( ( inst.input ? inst.input[ 0 ] : null ), [ inst ] );
15513		}
15514	},
15515
15516	_shouldFocusInput: function( inst ) {
15517		return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" );
15518	},
15519
15520	/* Check positioning to remain on screen. */
15521	_checkOffset: function( inst, offset, isFixed ) {
15522		var dpWidth = inst.dpDiv.outerWidth(),
15523			dpHeight = inst.dpDiv.outerHeight(),
15524			inputWidth = inst.input ? inst.input.outerWidth() : 0,
15525			inputHeight = inst.input ? inst.input.outerHeight() : 0,
15526			viewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ),
15527			viewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() );
15528
15529		offset.left -= ( this._get( inst, "isRTL" ) ? ( dpWidth - inputWidth ) : 0 );
15530		offset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0;
15531		offset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0;
15532
15533		// Now check if datepicker is showing outside window viewport - move to a better place if so.
15534		offset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ?
15535			Math.abs( offset.left + dpWidth - viewWidth ) : 0 );
15536		offset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ?
15537			Math.abs( dpHeight + inputHeight ) : 0 );
15538
15539		return offset;
15540	},
15541
15542	/* Find an object's position on the screen. */
15543	_findPos: function( obj ) {
15544		var position,
15545			inst = this._getInst( obj ),
15546			isRTL = this._get( inst, "isRTL" );
15547
15548		while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.pseudos.hidden( obj ) ) ) {
15549			obj = obj[ isRTL ? "previousSibling" : "nextSibling" ];
15550		}
15551
15552		position = $( obj ).offset();
15553		return [ position.left, position.top ];
15554	},
15555
15556	/* Hide the date picker from view.
15557	 * @param  input  element - the input field attached to the date picker
15558	 */
15559	_hideDatepicker: function( input ) {
15560		var showAnim, duration, postProcess, onClose,
15561			inst = this._curInst;
15562
15563		if ( !inst || ( input && inst !== $.data( input, "datepicker" ) ) ) {
15564			return;
15565		}
15566
15567		if ( this._datepickerShowing ) {
15568			showAnim = this._get( inst, "showAnim" );
15569			duration = this._get( inst, "duration" );
15570			postProcess = function() {
15571				$.datepicker._tidyDialog( inst );
15572			};
15573
15574			if ( $.effects && ( $.effects.effect[ showAnim ] ) ) {
15575				inst.dpDiv.hide( showAnim, $.datepicker._get( inst, "showOptions" ), duration, postProcess );
15576			} else {
15577				inst.dpDiv[ ( showAnim === "slideDown" ? "slideUp" :
15578					( showAnim === "fadeIn" ? "fadeOut" : "hide" ) ) ]( ( showAnim ? duration : null ), postProcess );
15579			}
15580
15581			if ( !showAnim ) {
15582				postProcess();
15583			}
15584			this._datepickerShowing = false;
15585
15586			onClose = this._get( inst, "onClose" );
15587			if ( onClose ) {
15588				onClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : "" ), inst ] );
15589			}
15590
15591			this._lastInput = null;
15592			if ( this._inDialog ) {
15593				this._dialogInput.css( { position: "absolute", left: "0", top: "-100px" } );
15594				if ( $.blockUI ) {
15595					$.unblockUI();
15596					$( "body" ).append( this.dpDiv );
15597				}
15598			}
15599			this._inDialog = false;
15600		}
15601	},
15602
15603	/* Tidy up after a dialog display. */
15604	_tidyDialog: function( inst ) {
15605		inst.dpDiv.removeClass( this._dialogClass ).off( ".ui-datepicker-calendar" );
15606	},
15607
15608	/* Close date picker if clicked elsewhere. */
15609	_checkExternalClick: function( event ) {
15610		if ( !$.datepicker._curInst ) {
15611			return;
15612		}
15613
15614		var $target = $( event.target ),
15615			inst = $.datepicker._getInst( $target[ 0 ] );
15616
15617		if ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId &&
15618				$target.parents( "#" + $.datepicker._mainDivId ).length === 0 &&
15619				!$target.hasClass( $.datepicker.markerClassName ) &&
15620				!$target.closest( "." + $.datepicker._triggerClass ).length &&
15621				$.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) ||
15622			( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) {
15623				$.datepicker._hideDatepicker();
15624		}
15625	},
15626
15627	/* Adjust one of the date sub-fields. */
15628	_adjustDate: function( id, offset, period ) {
15629		var target = $( id ),
15630			inst = this._getInst( target[ 0 ] );
15631
15632		if ( this._isDisabledDatepicker( target[ 0 ] ) ) {
15633			return;
15634		}
15635		this._adjustInstDate( inst, offset, period );
15636		this._updateDatepicker( inst );
15637	},
15638
15639	/* Action for current link. */
15640	_gotoToday: function( id ) {
15641		var date,
15642			target = $( id ),
15643			inst = this._getInst( target[ 0 ] );
15644
15645		if ( this._get( inst, "gotoCurrent" ) && inst.currentDay ) {
15646			inst.selectedDay = inst.currentDay;
15647			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
15648			inst.drawYear = inst.selectedYear = inst.currentYear;
15649		} else {
15650			date = new Date();
15651			inst.selectedDay = date.getDate();
15652			inst.drawMonth = inst.selectedMonth = date.getMonth();
15653			inst.drawYear = inst.selectedYear = date.getFullYear();
15654		}
15655		this._notifyChange( inst );
15656		this._adjustDate( target );
15657	},
15658
15659	/* Action for selecting a new month/year. */
vendor: 4,615 bytes, lines 15660-15791
15660	_selectMonthYear: function( id, select, period ) {
15661		var target = $( id ),
15662			inst = this._getInst( target[ 0 ] );
15663
15664		inst[ "selected" + ( period === "M" ? "Month" : "Year" ) ] =
15665		inst[ "draw" + ( period === "M" ? "Month" : "Year" ) ] =
15666			parseInt( select.options[ select.selectedIndex ].value, 10 );
15667
15668		this._notifyChange( inst );
15669		this._adjustDate( target );
15670	},
15671
15672	/* Action for selecting a day. */
15673	_selectDay: function( id, month, year, td ) {
15674		var inst,
15675			target = $( id );
15676
15677		if ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) {
15678			return;
15679		}
15680
15681		inst = this._getInst( target[ 0 ] );
15682		inst.selectedDay = inst.currentDay = parseInt( $( "a", td ).attr( "data-date" ) );
15683		inst.selectedMonth = inst.currentMonth = month;
15684		inst.selectedYear = inst.currentYear = year;
15685		this._selectDate( id, this._formatDate( inst,
15686			inst.currentDay, inst.currentMonth, inst.currentYear ) );
15687	},
15688
15689	/* Erase the input field and hide the date picker. */
15690	_clearDate: function( id ) {
15691		var target = $( id );
15692		this._selectDate( target, "" );
15693	},
15694
15695	/* Update the input field with the selected date. */
15696	_selectDate: function( id, dateStr ) {
15697		var onSelect,
15698			target = $( id ),
15699			inst = this._getInst( target[ 0 ] );
15700
15701		dateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) );
15702		if ( inst.input ) {
15703			inst.input.val( dateStr );
15704		}
15705		this._updateAlternate( inst );
15706
15707		onSelect = this._get( inst, "onSelect" );
15708		if ( onSelect ) {
15709			onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );  // trigger custom callback
15710		} else if ( inst.input ) {
15711			inst.input.trigger( "change" ); // fire the change event
15712		}
15713
15714		if ( inst.inline ) {
15715			this._updateDatepicker( inst );
15716		} else {
15717			this._hideDatepicker();
15718			this._lastInput = inst.input[ 0 ];
15719			if ( typeof( inst.input[ 0 ] ) !== "object" ) {
15720				inst.input.trigger( "focus" ); // restore focus
15721			}
15722			this._lastInput = null;
15723		}
15724	},
15725
15726	/* Update any alternate field to synchronise with the main field. */
15727	_updateAlternate: function( inst ) {
15728		var altFormat, date, dateStr,
15729			altField = this._get( inst, "altField" );
15730
15731		if ( altField ) { // update alternate field too
15732			altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" );
15733			date = this._getDate( inst );
15734			dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) );
15735			$( document ).find( altField ).val( dateStr );
15736		}
15737	},
15738
15739	/* Set as beforeShowDay function to prevent selection of weekends.
15740	 * @param  date  Date - the date to customise
15741	 * @return [boolean, string] - is this date selectable?, what is its CSS class?
15742	 */
15743	noWeekends: function( date ) {
15744		var day = date.getDay();
15745		return [ ( day > 0 && day < 6 ), "" ];
15746	},
15747
15748	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
15749	 * @param  date  Date - the date to get the week for
15750	 * @return  number - the number of the week within the year that contains this date
15751	 */
15752	iso8601Week: function( date ) {
15753		var time,
15754			checkDate = new Date( date.getTime() );
15755
15756		// Find Thursday of this week starting on Monday
15757		checkDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) );
15758
15759		time = checkDate.getTime();
15760		checkDate.setMonth( 0 ); // Compare with Jan 1
15761		checkDate.setDate( 1 );
15762		return Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1;
15763	},
15764
15765	/* Parse a string value into a date object.
15766	 * See formatDate below for the possible formats.
15767	 *
15768	 * @param  format string - the expected format of the date
15769	 * @param  value string - the date in the above format
15770	 * @param  settings Object - attributes include:
15771	 *					shortYearCutoff  number - the cutoff year for determining the century (optional)
15772	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
15773	 *					dayNames		string[7] - names of the days from Sunday (optional)
15774	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
15775	 *					monthNames		string[12] - names of the months (optional)
15776	 * @return  Date - the extracted date value or null if value is blank
15777	 */
15778	parseDate: function( format, value, settings ) {
15779		if ( format == null || value == null ) {
15780			throw "Invalid arguments";
15781		}
15782
15783		value = ( typeof value === "object" ? value.toString() : value + "" );
15784		if ( value === "" ) {
15785			return null;
15786		}
15787
15788		var iFormat, dim, extra,
15789			iValue = 0,
15790			shortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff,
15791			shortYearCutoff = ( typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp 
vendor: 5,431 bytes, lines 15791-15981
15791:
15792				new Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ),
15793			dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
15794			dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
15795			monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
15796			monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
15797			year = -1,
15798			month = -1,
15799			day = -1,
15800			doy = -1,
15801			literal = false,
15802			date,
15803
15804			// Check whether a format character is doubled
15805			lookAhead = function( match ) {
15806				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
15807				if ( matches ) {
15808					iFormat++;
15809				}
15810				return matches;
15811			},
15812
15813			// Extract a number from the string value
15814			getNumber = function( match ) {
15815				var isDoubled = lookAhead( match ),
15816					size = ( match === "@" ? 14 : ( match === "!" ? 20 :
15817					( match === "y" && isDoubled ? 4 : ( match === "o" ? 3 : 2 ) ) ) ),
15818					minSize = ( match === "y" ? size : 1 ),
15819					digits = new RegExp( "^\\d{" + minSize + "," + size + "}" ),
15820					num = value.substring( iValue ).match( digits );
15821				if ( !num ) {
15822					throw "Missing number at position " + iValue;
15823				}
15824				iValue += num[ 0 ].length;
15825				return parseInt( num[ 0 ], 10 );
15826			},
15827
15828			// Extract a name from the string value and convert to an index
15829			getName = function( match, shortNames, longNames ) {
15830				var index = -1,
15831					names = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) {
15832						return [ [ k, v ] ];
15833					} ).sort( function( a, b ) {
15834						return -( a[ 1 ].length - b[ 1 ].length );
15835					} );
15836
15837				$.each( names, function( i, pair ) {
15838					var name = pair[ 1 ];
15839					if ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) {
15840						index = pair[ 0 ];
15841						iValue += name.length;
15842						return false;
15843					}
15844				} );
15845				if ( index !== -1 ) {
15846					return index + 1;
15847				} else {
15848					throw "Unknown name at position " + iValue;
15849				}
15850			},
15851
15852			// Confirm that a literal character matches the string value
15853			checkLiteral = function() {
15854				if ( value.charAt( iValue ) !== format.charAt( iFormat ) ) {
15855					throw "Unexpected literal at position " + iValue;
15856				}
15857				iValue++;
15858			};
15859
15860		for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
15861			if ( literal ) {
15862				if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
15863					literal = false;
15864				} else {
15865					checkLiteral();
15866				}
15867			} else {
15868				switch ( format.charAt( iFormat ) ) {
15869					case "d":
15870						day = getNumber( "d" );
15871						break;
15872					case "D":
15873						getName( "D", dayNamesShort, dayNames );
15874						break;
15875					case "o":
15876						doy = getNumber( "o" );
15877						break;
15878					case "m":
15879						month = getNumber( "m" );
15880						break;
15881					case "M":
15882						month = getName( "M", monthNamesShort, monthNames );
15883						break;
15884					case "y":
15885						year = getNumber( "y" );
15886						break;
15887					case "@":
15888						date = new Date( getNumber( "@" ) );
15889						year = date.getFullYear();
15890						month = date.getMonth() + 1;
15891						day = date.getDate();
15892						break;
15893					case "!":
15894						date = new Date( ( getNumber( "!" ) - this._ticksTo1970 ) / 10000 );
15895						year = date.getFullYear();
15896						month = date.getMonth() + 1;
15897						day = date.getDate();
15898						break;
15899					case "'":
15900						if ( lookAhead( "'" ) ) {
15901							checkLiteral();
15902						} else {
15903							literal = true;
15904						}
15905						break;
15906					default:
15907						checkLiteral();
15908				}
15909			}
15910		}
15911
15912		if ( iValue < value.length ) {
15913			extra = value.substr( iValue );
15914			if ( !/^\s+/.test( extra ) ) {
15915				throw "Extra/unparsed characters found in date: " + extra;
15916			}
15917		}
15918
15919		if ( year === -1 ) {
15920			year = new Date().getFullYear();
15921		} else if ( year < 100 ) {
15922			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
15923				( year <= shortYearCutoff ? 0 : -100 );
15924		}
15925
15926		if ( doy > -1 ) {
15927			month = 1;
15928			day = doy;
15929			do {
15930				dim = this._getDaysInMonth( year, month - 1 );
15931				if ( day <= dim ) {
15932					break;
15933				}
15934				month++;
15935				day -= dim;
15936			} while ( true );
15937		}
15938
15939		date = this._daylightSavingAdjust( new Date( year, month - 1, day ) );
15940		if ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) {
15941			throw "Invalid date"; // E.g. 31/02/00
15942		}
15943		return date;
15944	},
15945
15946	/* Standard date formats. */
15947	ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
15948	COOKIE: "D, dd M yy",
15949	ISO_8601: "yy-mm-dd",
15950	RFC_822: "D, d M y",
15951	RFC_850: "DD, dd-M-y",
15952	RFC_1036: "D, d M y",
15953	RFC_1123: "D, d M yy",
15954	RFC_2822: "D, d M yy",
15955	RSS: "D, d M y", // RFC 822
15956	TICKS: "!",
15957	TIMESTAMP: "@",
15958	W3C: "yy-mm-dd", // ISO 8601
15959
15960	_ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) +
15961		Math.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ),
15962
15963	/* Format a date object into a string value.
15964	 * The format can be combinations of the following:
15965	 * d  - day of month (no leading zero)
15966	 * dd - day of month (two digit)
15967	 * o  - day of year (no leading zeros)
15968	 * oo - day of year (three digit)
15969	 * D  - day name short
15970	 * DD - day name long
15971	 * m  - month of year (no leading zero)
15972	 * mm - month of year (two digit)
15973	 * M  - month name short
15974	 * MM - month name long
15975	 * y  - year (two digit)
15976	 * yy - year (four digit)
15977	 * @ - Unix timestamp (ms since 01/01/1970)
15978	 * ! - Windows ticks (100ns since 01/01/0001)
15979	 * "..." - literal text
15980	 * '' - single quote
15981	 *
vendor: 6,198 bytes, lines 15982-16181
15982	 * @param  format string - the desired format of the date
15983	 * @param  date Date - the date value to format
15984	 * @param  settings Object - attributes include:
15985	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
15986	 *					dayNames		string[7] - names of the days from Sunday (optional)
15987	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
15988	 *					monthNames		string[12] - names of the months (optional)
15989	 * @return  string - the date in the above format
15990	 */
15991	formatDate: function( format, date, settings ) {
15992		if ( !date ) {
15993			return "";
15994		}
15995
15996		var iFormat,
15997			dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
15998			dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
15999			monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
16000			monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
16001
16002			// Check whether a format character is doubled
16003			lookAhead = function( match ) {
16004				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
16005				if ( matches ) {
16006					iFormat++;
16007				}
16008				return matches;
16009			},
16010
16011			// Format a number, with leading zero if necessary
16012			formatNumber = function( match, value, len ) {
16013				var num = "" + value;
16014				if ( lookAhead( match ) ) {
16015					while ( num.length < len ) {
16016						num = "0" + num;
16017					}
16018				}
16019				return num;
16020			},
16021
16022			// Format a name, short or long as requested
16023			formatName = function( match, value, shortNames, longNames ) {
16024				return ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] );
16025			},
16026			output = "",
16027			literal = false;
16028
16029		if ( date ) {
16030			for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
16031				if ( literal ) {
16032					if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
16033						literal = false;
16034					} else {
16035						output += format.charAt( iFormat );
16036					}
16037				} else {
16038					switch ( format.charAt( iFormat ) ) {
16039						case "d":
16040							output += formatNumber( "d", date.getDate(), 2 );
16041							break;
16042						case "D":
16043							output += formatName( "D", date.getDay(), dayNamesShort, dayNames );
16044							break;
16045						case "o":
16046							output += formatNumber( "o",
16047								Math.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 );
16048							break;
16049						case "m":
16050							output += formatNumber( "m", date.getMonth() + 1, 2 );
16051							break;
16052						case "M":
16053							output += formatName( "M", date.getMonth(), monthNamesShort, monthNames );
16054							break;
16055						case "y":
16056							output += ( lookAhead( "y" ) ? date.getFullYear() :
16057								( date.getFullYear() % 100 < 10 ? "0" : "" ) + date.getFullYear() % 100 );
16058							break;
16059						case "@":
16060							output += date.getTime();
16061							break;
16062						case "!":
16063							output += date.getTime() * 10000 + this._ticksTo1970;
16064							break;
16065						case "'":
16066							if ( lookAhead( "'" ) ) {
16067								output += "'";
16068							} else {
16069								literal = true;
16070							}
16071							break;
16072						default:
16073							output += format.charAt( iFormat );
16074					}
16075				}
16076			}
16077		}
16078		return output;
16079	},
16080
16081	/* Extract all possible characters from the date format. */
16082	_possibleChars: function( format ) {
16083		var iFormat,
16084			chars = "",
16085			literal = false,
16086
16087			// Check whether a format character is doubled
16088			lookAhead = function( match ) {
16089				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
16090				if ( matches ) {
16091					iFormat++;
16092				}
16093				return matches;
16094			};
16095
16096		for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
16097			if ( literal ) {
16098				if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
16099					literal = false;
16100				} else {
16101					chars += format.charAt( iFormat );
16102				}
16103			} else {
16104				switch ( format.charAt( iFormat ) ) {
16105					case "d": case "m": case "y": case "@":
16106						chars += "0123456789";
16107						break;
16108					case "D": case "M":
16109						return null; // Accept anything
16110					case "'":
16111						if ( lookAhead( "'" ) ) {
16112							chars += "'";
16113						} else {
16114							literal = true;
16115						}
16116						break;
16117					default:
16118						chars += format.charAt( iFormat );
16119				}
16120			}
16121		}
16122		return chars;
16123	},
16124
16125	/* Get a setting value, defaulting if necessary. */
16126	_get: function( inst, name ) {
16127		return inst.settings[ name ] !== undefined ?
16128			inst.settings[ name ] : this._defaults[ name ];
16129	},
16130
16131	/* Parse existing date and initialise date picker. */
16132	_setDateFromField: function( inst, noDefault ) {
16133		if ( inst.input.val() === inst.lastVal ) {
16134			return;
16135		}
16136
16137		var dateFormat = this._get( inst, "dateFormat" ),
16138			dates = inst.lastVal = inst.input ? inst.input.val() : null,
16139			defaultDate = this._getDefaultDate( inst ),
16140			date = defaultDate,
16141			settings = this._getFormatConfig( inst );
16142
16143		try {
16144			date = this.parseDate( dateFormat, dates, settings ) || defaultDate;
16145		} catch ( event ) {
16146			dates = ( noDefault ? "" : dates );
16147		}
16148		inst.selectedDay = date.getDate();
16149		inst.drawMonth = inst.selectedMonth = date.getMonth();
16150		inst.drawYear = inst.selectedYear = date.getFullYear();
16151		inst.currentDay = ( dates ? date.getDate() : 0 );
16152		inst.currentMonth = ( dates ? date.getMonth() : 0 );
16153		inst.currentYear = ( dates ? date.getFullYear() : 0 );
16154		this._adjustInstDate( inst );
16155	},
16156
16157	/* Retrieve the default date shown on opening. */
16158	_getDefaultDate: function( inst ) {
16159		return this._restrictMinMax( inst,
16160			this._determineDate( inst, this._get( inst, "defaultDate" ), new Date() ) );
16161	},
16162
16163	/* A date may be specified as an exact value or a relative one. */
16164	_determineDate: function( inst, date, defaultDate ) {
16165		var offsetNumeric = function( offset ) {
16166				var date = new Date();
16167				date.setDate( date.getDate() + offset );
16168				return date;
16169			},
16170			offsetString = function( offset ) {
16171				try {
16172					return $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
16173						offset, $.datepicker._getFormatConfig( inst ) );
16174				} catch ( e ) {
16175
16176					// Ignore
16177				}
16178
16179				var date = ( offset.toLowerCase().match( /^c/ ) ?
16180					$.datepicker._getDate( inst ) : null ) || new Date(),
16181					year = date.getFullYear(),
vendor: 5,359 bytes, lines 16182-16320
16182					month = date.getMonth(),
16183					day = date.getDate(),
16184					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
16185					matches = pattern.exec( offset );
16186
16187				while ( matches ) {
16188					switch ( matches[ 2 ] || "d" ) {
16189						case "d" : case "D" :
16190							day += parseInt( matches[ 1 ], 10 ); break;
16191						case "w" : case "W" :
16192							day += parseInt( matches[ 1 ], 10 ) * 7; break;
16193						case "m" : case "M" :
16194							month += parseInt( matches[ 1 ], 10 );
16195							day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
16196							break;
16197						case "y": case "Y" :
16198							year += parseInt( matches[ 1 ], 10 );
16199							day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
16200							break;
16201					}
16202					matches = pattern.exec( offset );
16203				}
16204				return new Date( year, month, day );
16205			},
16206			newDate = ( date == null || date === "" ? defaultDate : ( typeof date === "string" ? offsetString( date ) :
16207				( typeof date === "number" ? ( isNaN( date ) ? defaultDate : offsetNumeric( date ) ) : new Date( date.getTime() ) ) ) );
16208
16209		newDate = ( newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate );
16210		if ( newDate ) {
16211			newDate.setHours( 0 );
16212			newDate.setMinutes( 0 );
16213			newDate.setSeconds( 0 );
16214			newDate.setMilliseconds( 0 );
16215		}
16216		return this._daylightSavingAdjust( newDate );
16217	},
16218
16219	/* Handle switch to/from daylight saving.
16220	 * Hours may be non-zero on daylight saving cut-over:
16221	 * > 12 when midnight changeover, but then cannot generate
16222	 * midnight datetime, so jump to 1AM, otherwise reset.
16223	 * @param  date  (Date) the date to check
16224	 * @return  (Date) the corrected date
16225	 */
16226	_daylightSavingAdjust: function( date ) {
16227		if ( !date ) {
16228			return null;
16229		}
16230		date.setHours( date.getHours() > 12 ? date.getHours() + 2 : 0 );
16231		return date;
16232	},
16233
16234	/* Set the date(s) directly. */
16235	_setDate: function( inst, date, noChange ) {
16236		var clear = !date,
16237			origMonth = inst.selectedMonth,
16238			origYear = inst.selectedYear,
16239			newDate = this._restrictMinMax( inst, this._determineDate( inst, date, new Date() ) );
16240
16241		inst.selectedDay = inst.currentDay = newDate.getDate();
16242		inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
16243		inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
16244		if ( ( origMonth !== inst.selectedMonth || origYear !== inst.selectedYear ) && !noChange ) {
16245			this._notifyChange( inst );
16246		}
16247		this._adjustInstDate( inst );
16248		if ( inst.input ) {
16249			inst.input.val( clear ? "" : this._formatDate( inst ) );
16250		}
16251	},
16252
16253	/* Retrieve the date(s) directly. */
16254	_getDate: function( inst ) {
16255		var startDate = ( !inst.currentYear || ( inst.input && inst.input.val() === "" ) ? null :
16256			this._daylightSavingAdjust( new Date(
16257			inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
16258			return startDate;
16259	},
16260
16261	/* Attach the onxxx handlers.  These are declared statically so
16262	 * they work with static code transformers like Caja.
16263	 */
16264	_attachHandlers: function( inst ) {
16265		var stepMonths = this._get( inst, "stepMonths" ),
16266			id = "#" + inst.id.replace( /\\\\/g, "\\" );
16267		inst.dpDiv.find( "[data-handler]" ).map( function() {
16268			var handler = {
16269				prev: function() {
16270					$.datepicker._adjustDate( id, -stepMonths, "M" );
16271				},
16272				next: function() {
16273					$.datepicker._adjustDate( id, +stepMonths, "M" );
16274				},
16275				hide: function() {
16276					$.datepicker._hideDatepicker();
16277				},
16278				today: function() {
16279					$.datepicker._gotoToday( id );
16280				},
16281				selectDay: function() {
16282					$.datepicker._selectDay( id, +this.getAttribute( "data-month" ), +this.getAttribute( "data-year" ), this );
16283					return false;
16284				},
16285				selectMonth: function() {
16286					$.datepicker._selectMonthYear( id, this, "M" );
16287					return false;
16288				},
16289				selectYear: function() {
16290					$.datepicker._selectMonthYear( id, this, "Y" );
16291					return false;
16292				}
16293			};
16294			$( this ).on( this.getAttribute( "data-event" ), handler[ this.getAttribute( "data-handler" ) ] );
16295		} );
16296	},
16297
16298	/* Generate the HTML for the current state of the date picker. */
16299	_generateHTML: function( inst ) {
16300		var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
16301			controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
16302			monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
16303			selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
16304			cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
16305			printDate, dRow, tbody, daySettings, otherMonth, unselectable,
16306			tempDate = new Date(),
16307			today = this._daylightSavingAdjust(
16308				new Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) ), // clear time
16309			isRTL = this._get( inst, "isRTL" ),
16310			showButtonPanel = this._get( inst, "showButtonPanel" ),
16311			hideIfNoPrevNext = this._get( inst, "hideIfNoPrevNext" ),
16312			navigationAsDateFormat = this._get( inst, "navigationAsDateFormat" ),
16313			numMonths = this._getNumberOfMonths( inst ),
16314			showCurrentAtPos = this._get( inst, "showCurrentAtPos" ),
16315			stepMonths = this._get( inst, "stepMonths" ),
16316			isMultiMonth = ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ),
16317			currentDate = this._daylightSavingAdjust( ( !inst.currentDay ? new Date( 9999, 9, 9 ) :
16318				new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ),
16319			minDate = this._getMinMaxDate( inst, "min" ),
16320			maxDate = this._getMinMaxDate( inst, "max" ),
vendor: 21,257 bytes, lines 16321-16835
16321			drawMonth = inst.drawMonth - showCurrentAtPos,
16322			drawYear = inst.drawYear;
16323
16324		if ( drawMonth < 0 ) {
16325			drawMonth += 12;
16326			drawYear--;
16327		}
16328		if ( maxDate ) {
16329			maxDraw = this._daylightSavingAdjust( new Date( maxDate.getFullYear(),
16330				maxDate.getMonth() - ( numMonths[ 0 ] * numMonths[ 1 ] ) + 1, maxDate.getDate() ) );
16331			maxDraw = ( minDate && maxDraw < minDate ? minDate : maxDraw );
16332			while ( this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 ) ) > maxDraw ) {
16333				drawMonth--;
16334				if ( drawMonth < 0 ) {
16335					drawMonth = 11;
16336					drawYear--;
16337				}
16338			}
16339		}
16340		inst.drawMonth = drawMonth;
16341		inst.drawYear = drawYear;
16342
16343		prevText = this._get( inst, "prevText" );
16344		prevText = ( !navigationAsDateFormat ? prevText : this.formatDate( prevText,
16345			this._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ),
16346			this._getFormatConfig( inst ) ) );
16347
16348		if ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ) {
16349			prev = $( "<a>" )
16350				.attr( {
16351					"class": "ui-datepicker-prev ui-corner-all",
16352					"data-handler": "prev",
16353					"data-event": "click",
16354					title: prevText
16355				} )
16356				.append(
16357					$( "<span>" )
16358						.addClass( "ui-icon ui-icon-circle-triangle-" +
16359							( isRTL ? "e" : "w" ) )
16360						.text( prevText )
16361				)[ 0 ].outerHTML;
16362		} else if ( hideIfNoPrevNext ) {
16363			prev = "";
16364		} else {
16365			prev = $( "<a>" )
16366				.attr( {
16367					"class": "ui-datepicker-prev ui-corner-all ui-state-disabled",
16368					title: prevText
16369				} )
16370				.append(
16371					$( "<span>" )
16372						.addClass( "ui-icon ui-icon-circle-triangle-" +
16373							( isRTL ? "e" : "w" ) )
16374						.text( prevText )
16375				)[ 0 ].outerHTML;
16376		}
16377
16378		nextText = this._get( inst, "nextText" );
16379		nextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText,
16380			this._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ),
16381			this._getFormatConfig( inst ) ) );
16382
16383		if ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ) {
16384			next = $( "<a>" )
16385				.attr( {
16386					"class": "ui-datepicker-next ui-corner-all",
16387					"data-handler": "next",
16388					"data-event": "click",
16389					title: nextText
16390				} )
16391				.append(
16392					$( "<span>" )
16393						.addClass( "ui-icon ui-icon-circle-triangle-" +
16394							( isRTL ? "w" : "e" ) )
16395						.text( nextText )
16396				)[ 0 ].outerHTML;
16397		} else if ( hideIfNoPrevNext ) {
16398			next = "";
16399		} else {
16400			next = $( "<a>" )
16401				.attr( {
16402					"class": "ui-datepicker-next ui-corner-all ui-state-disabled",
16403					title: nextText
16404				} )
16405				.append(
16406					$( "<span>" )
16407						.attr( "class", "ui-icon ui-icon-circle-triangle-" +
16408							( isRTL ? "w" : "e" ) )
16409						.text( nextText )
16410				)[ 0 ].outerHTML;
16411		}
16412
16413		currentText = this._get( inst, "currentText" );
16414		gotoDate = ( this._get( inst, "gotoCurrent" ) && inst.currentDay ? currentDate : today );
16415		currentText = ( !navigationAsDateFormat ? currentText :
16416			this.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) );
16417
16418		controls = "";
16419		if ( !inst.inline ) {
16420			controls = $( "<button>" )
16421				.attr( {
16422					type: "button",
16423					"class": "ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all",
16424					"data-handler": "hide",
16425					"data-event": "click"
16426				} )
16427				.text( this._get( inst, "closeText" ) )[ 0 ].outerHTML;
16428		}
16429
16430		buttonPanel = "";
16431		if ( showButtonPanel ) {
16432			buttonPanel = $( "<div class='ui-datepicker-buttonpane ui-widget-content'>" )
16433				.append( isRTL ? controls : "" )
16434				.append( this._isInRange( inst, gotoDate ) ?
16435					$( "<button>" )
16436						.attr( {
16437							type: "button",
16438							"class": "ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all",
16439							"data-handler": "today",
16440							"data-event": "click"
16441						} )
16442						.text( currentText ) :
16443					"" )
16444				.append( isRTL ? "" : controls )[ 0 ].outerHTML;
16445		}
16446
16447		firstDay = parseInt( this._get( inst, "firstDay" ), 10 );
16448		firstDay = ( isNaN( firstDay ) ? 0 : firstDay );
16449
16450		showWeek = this._get( inst, "showWeek" );
16451		dayNames = this._get( inst, "dayNames" );
16452		dayNamesMin = this._get( inst, "dayNamesMin" );
16453		monthNames = this._get( inst, "monthNames" );
16454		monthNamesShort = this._get( inst, "monthNamesShort" );
16455		beforeShowDay = this._get( inst, "beforeShowDay" );
16456		showOtherMonths = this._get( inst, "showOtherMonths" );
16457		selectOtherMonths = this._get( inst, "selectOtherMonths" );
16458		defaultDate = this._getDefaultDate( inst );
16459		html = "";
16460
16461		for ( row = 0; row < numMonths[ 0 ]; row++ ) {
16462			group = "";
16463			this.maxRows = 4;
16464			for ( col = 0; col < numMonths[ 1 ]; col++ ) {
16465				selectedDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, inst.selectedDay ) );
16466				cornerClass = " ui-corner-all";
16467				calender = "";
16468				if ( isMultiMonth ) {
16469					calender += "<div class='ui-datepicker-group";
16470					if ( numMonths[ 1 ] > 1 ) {
16471						switch ( col ) {
16472							case 0: calender += " ui-datepicker-group-first";
16473								cornerClass = " ui-corner-" + ( isRTL ? "right" : "left" ); break;
16474							case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last";
16475								cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break;
16476							default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
16477						}
16478					}
16479					calender += "'>";
16480				}
16481				calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
16482					( /all|left/.test( cornerClass ) && row === 0 ? ( isRTL ? next : prev ) : "" ) +
16483					( /all|right/.test( cornerClass ) && row === 0 ? ( isRTL ? prev : next ) : "" ) +
16484					this._generateMonthYearHeader( inst, drawMonth, drawYear, minDate, maxDate,
16485					row > 0 || col > 0, monthNames, monthNamesShort ) + // draw month headers
16486					"</div><table class='ui-datepicker-calendar'><thead>" +
16487					"<tr>";
16488				thead = ( showWeek ? "<th class='ui-datepicker-week-col'>" + this._get( inst, "weekHeader" ) + "</th>" : "" );
16489				for ( dow = 0; dow < 7; dow++ ) { // days of the week
16490					day = ( dow + firstDay ) % 7;
16491					thead += "<th scope='col'" + ( ( dow + firstDay + 6 ) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "" ) + ">" +
16492						"<span title='" + dayNames[ day ] + "'>" + dayNamesMin[ day ] + "</span></th>";
16493				}
16494				calender += thead + "</tr></thead><tbody>";
16495				daysInMonth = this._getDaysInMonth( drawYear, drawMonth );
16496				if ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) {
16497					inst.selectedDay = Math.min( inst.selectedDay, daysInMonth );
16498				}
16499				leadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7;
16500				curRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate
16501				numRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043)
16502				this.maxRows = numRows;
16503				printDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) );
16504				for ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows
16505					calender += "<tr>";
16506					tbody = ( !showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
16507						this._get( inst, "calculateWeek" )( printDate ) + "</td>" );
16508					for ( dow = 0; dow < 7; dow++ ) { // create date picker days
16509						daySettings = ( beforeShowDay ?
16510							beforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, "" ] );
16511						otherMonth = ( printDate.getMonth() !== drawMonth );
16512						unselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] ||
16513							( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate );
16514						tbody += "<td class='" +
16515							( ( dow + firstDay + 6 ) % 7 >= 5 ? " ui-datepicker-week-end" : "" ) + // highlight weekends
16516							( otherMonth ? " ui-datepicker-other-month" : "" ) + // highlight days from other months
16517							( ( printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent ) || // user pressed key
16518							( defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ) ?
16519
16520							// or defaultDate is current printedDate and defaultDate is selectedDate
16521							" " + this._dayOverClass : "" ) + // highlight selected day
16522							( unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "" ) +  // highlight unselectable days
16523							( otherMonth && !showOtherMonths ? "" : " " + daySettings[ 1 ] + // highlight custom dates
16524							( printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "" ) + // highlight selected day
16525							( printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "" ) ) + "'" + // highlight today (if different)
16526							( ( !otherMonth || showOtherMonths ) && daySettings[ 2 ] ? " title='" + daySettings[ 2 ].replace( /'/g, "&#39;" ) + "'" : "" ) + // cell title
16527							( unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'" ) + ">" + // actions
16528							( otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
16529							( unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
16530							( printDate.getTime() === today.getTime() ? " ui-state-highlight" : "" ) +
16531							( printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "" ) + // highlight selected day
16532							( otherMonth ? " ui-priority-secondary" : "" ) + // distinguish dates from other months
16533							"' href='#' aria-current='" + ( printDate.getTime() === currentDate.getTime() ? "true" : "false" ) + // mark date as selected for screen reader
16534							"' data-date='" + printDate.getDate() + // store date as data
16535							"'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date
16536						printDate.setDate( printDate.getDate() + 1 );
16537						printDate = this._daylightSavingAdjust( printDate );
16538					}
16539					calender += tbody + "</tr>";
16540				}
16541				drawMonth++;
16542				if ( drawMonth > 11 ) {
16543					drawMonth = 0;
16544					drawYear++;
16545				}
16546				calender += "</tbody></table>" + ( isMultiMonth ? "</div>" +
16547							( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? "<div class='ui-datepicker-row-break'></div>" : "" ) : "" );
16548				group += calender;
16549			}
16550			html += group;
16551		}
16552		html += buttonPanel;
16553		inst._keyEvent = false;
16554		return html;
16555	},
16556
16557	/* Generate the month and year header. */
16558	_generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate,
16559			secondary, monthNames, monthNamesShort ) {
16560
16561		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
16562			changeMonth = this._get( inst, "changeMonth" ),
16563			changeYear = this._get( inst, "changeYear" ),
16564			showMonthAfterYear = this._get( inst, "showMonthAfterYear" ),
16565			selectMonthLabel = this._get( inst, "selectMonthLabel" ),
16566			selectYearLabel = this._get( inst, "selectYearLabel" ),
16567			html = "<div class='ui-datepicker-title'>",
16568			monthHtml = "";
16569
16570		// Month selection
16571		if ( secondary || !changeMonth ) {
16572			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[ drawMonth ] + "</span>";
16573		} else {
16574			inMinYear = ( minDate && minDate.getFullYear() === drawYear );
16575			inMaxYear = ( maxDate && maxDate.getFullYear() === drawYear );
16576			monthHtml += "<select class='ui-datepicker-month' aria-label='" + selectMonthLabel + "' data-handler='selectMonth' data-event='change'>";
16577			for ( month = 0; month < 12; month++ ) {
16578				if ( ( !inMinYear || month >= minDate.getMonth() ) && ( !inMaxYear || month <= maxDate.getMonth() ) ) {
16579					monthHtml += "<option value='" + month + "'" +
16580						( month === drawMonth ? " selected='selected'" : "" ) +
16581						">" + monthNamesShort[ month ] + "</option>";
16582				}
16583			}
16584			monthHtml += "</select>";
16585		}
16586
16587		if ( !showMonthAfterYear ) {
16588			html += monthHtml + ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" );
16589		}
16590
16591		// Year selection
16592		if ( !inst.yearshtml ) {
16593			inst.yearshtml = "";
16594			if ( secondary || !changeYear ) {
16595				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
16596			} else {
16597
16598				// determine range of years to display
16599				years = this._get( inst, "yearRange" ).split( ":" );
16600				thisYear = new Date().getFullYear();
16601				determineYear = function( value ) {
16602					var year = ( value.match( /c[+\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) :
16603						( value.match( /[+\-].*/ ) ? thisYear + parseInt( value, 10 ) :
16604						parseInt( value, 10 ) ) );
16605					return ( isNaN( year ) ? thisYear : year );
16606				};
16607				year = determineYear( years[ 0 ] );
16608				endYear = Math.max( year, determineYear( years[ 1 ] || "" ) );
16609				year = ( minDate ? Math.max( year, minDate.getFullYear() ) : year );
16610				endYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear );
16611				inst.yearshtml += "<select class='ui-datepicker-year' aria-label='" + selectYearLabel + "' data-handler='selectYear' data-event='change'>";
16612				for ( ; year <= endYear; year++ ) {
16613					inst.yearshtml += "<option value='" + year + "'" +
16614						( year === drawYear ? " selected='selected'" : "" ) +
16615						">" + year + "</option>";
16616				}
16617				inst.yearshtml += "</select>";
16618
16619				html += inst.yearshtml;
16620				inst.yearshtml = null;
16621			}
16622		}
16623
16624		html += this._get( inst, "yearSuffix" );
16625		if ( showMonthAfterYear ) {
16626			html += ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" ) + monthHtml;
16627		}
16628		html += "</div>"; // Close datepicker_header
16629		return html;
16630	},
16631
16632	/* Adjust one of the date sub-fields. */
16633	_adjustInstDate: function( inst, offset, period ) {
16634		var year = inst.selectedYear + ( period === "Y" ? offset : 0 ),
16635			month = inst.selectedMonth + ( period === "M" ? offset : 0 ),
16636			day = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === "D" ? offset : 0 ),
16637			date = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) );
16638
16639		inst.selectedDay = date.getDate();
16640		inst.drawMonth = inst.selectedMonth = date.getMonth();
16641		inst.drawYear = inst.selectedYear = date.getFullYear();
16642		if ( period === "M" || period === "Y" ) {
16643			this._notifyChange( inst );
16644		}
16645	},
16646
16647	/* Ensure a date is within any min/max bounds. */
16648	_restrictMinMax: function( inst, date ) {
16649		var minDate = this._getMinMaxDate( inst, "min" ),
16650			maxDate = this._getMinMaxDate( inst, "max" ),
16651			newDate = ( minDate && date < minDate ? minDate : date );
16652		return ( maxDate && newDate > maxDate ? maxDate : newDate );
16653	},
16654
16655	/* Notify change of month/year. */
16656	_notifyChange: function( inst ) {
16657		var onChange = this._get( inst, "onChangeMonthYear" );
16658		if ( onChange ) {
16659			onChange.apply( ( inst.input ? inst.input[ 0 ] : null ),
16660				[ inst.selectedYear, inst.selectedMonth + 1, inst ] );
16661		}
16662	},
16663
16664	/* Determine the number of months to show. */
16665	_getNumberOfMonths: function( inst ) {
16666		var numMonths = this._get( inst, "numberOfMonths" );
16667		return ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === "number" ? [ 1, numMonths ] : numMonths ) );
16668	},
16669
16670	/* Determine the current maximum date - ensure no time components are set. */
16671	_getMinMaxDate: function( inst, minMax ) {
16672		return this._determineDate( inst, this._get( inst, minMax + "Date" ), null );
16673	},
16674
16675	/* Find the number of days in a given month. */
16676	_getDaysInMonth: function( year, month ) {
16677		return 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate();
16678	},
16679
16680	/* Find the day of the week of the first of a month. */
16681	_getFirstDayOfMonth: function( year, month ) {
16682		return new Date( year, month, 1 ).getDay();
16683	},
16684
16685	/* Determines if we should allow a "next/prev" month display change. */
16686	_canAdjustMonth: function( inst, offset, curYear, curMonth ) {
16687		var numMonths = this._getNumberOfMonths( inst ),
16688			date = this._daylightSavingAdjust( new Date( curYear,
16689			curMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) );
16690
16691		if ( offset < 0 ) {
16692			date.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) );
16693		}
16694		return this._isInRange( inst, date );
16695	},
16696
16697	/* Is the given date in the accepted range? */
16698	_isInRange: function( inst, date ) {
16699		var yearSplit, currentYear,
16700			minDate = this._getMinMaxDate( inst, "min" ),
16701			maxDate = this._getMinMaxDate( inst, "max" ),
16702			minYear = null,
16703			maxYear = null,
16704			years = this._get( inst, "yearRange" );
16705			if ( years ) {
16706				yearSplit = years.split( ":" );
16707				currentYear = new Date().getFullYear();
16708				minYear = parseInt( yearSplit[ 0 ], 10 );
16709				maxYear = parseInt( yearSplit[ 1 ], 10 );
16710				if ( yearSplit[ 0 ].match( /[+\-].*/ ) ) {
16711					minYear += currentYear;
16712				}
16713				if ( yearSplit[ 1 ].match( /[+\-].*/ ) ) {
16714					maxYear += currentYear;
16715				}
16716			}
16717
16718		return ( ( !minDate || date.getTime() >= minDate.getTime() ) &&
16719			( !maxDate || date.getTime() <= maxDate.getTime() ) &&
16720			( !minYear || date.getFullYear() >= minYear ) &&
16721			( !maxYear || date.getFullYear() <= maxYear ) );
16722	},
16723
16724	/* Provide the configuration settings for formatting/parsing. */
16725	_getFormatConfig: function( inst ) {
16726		var shortYearCutoff = this._get( inst, "shortYearCutoff" );
16727		shortYearCutoff = ( typeof shortYearCutoff !== "string" ? shortYearCutoff :
16728			new Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) );
16729		return { shortYearCutoff: shortYearCutoff,
16730			dayNamesShort: this._get( inst, "dayNamesShort" ), dayNames: this._get( inst, "dayNames" ),
16731			monthNamesShort: this._get( inst, "monthNamesShort" ), monthNames: this._get( inst, "monthNames" ) };
16732	},
16733
16734	/* Format the given date for display. */
16735	_formatDate: function( inst, day, month, year ) {
16736		if ( !day ) {
16737			inst.currentDay = inst.selectedDay;
16738			inst.currentMonth = inst.selectedMonth;
16739			inst.currentYear = inst.selectedYear;
16740		}
16741		var date = ( day ? ( typeof day === "object" ? day :
16742			this._daylightSavingAdjust( new Date( year, month, day ) ) ) :
16743			this._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
16744		return this.formatDate( this._get( inst, "dateFormat" ), date, this._getFormatConfig( inst ) );
16745	}
16746} );
16747
16748/*
16749 * Bind hover events for datepicker elements.
16750 * Done via delegate so the binding only occurs once in the lifetime of the parent div.
16751 * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
16752 */
16753function datepicker_bindHover( dpDiv ) {
16754	var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
16755	return dpDiv.on( "mouseout", selector, function() {
16756			$( this ).removeClass( "ui-state-hover" );
16757			if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
16758				$( this ).removeClass( "ui-datepicker-prev-hover" );
16759			}
16760			if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
16761				$( this ).removeClass( "ui-datepicker-next-hover" );
16762			}
16763		} )
16764		.on( "mouseover", selector, datepicker_handleMouseover );
16765}
16766
16767function datepicker_handleMouseover() {
16768	if ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) {
16769		$( this ).parents( ".ui-datepicker-calendar" ).find( "a" ).removeClass( "ui-state-hover" );
16770		$( this ).addClass( "ui-state-hover" );
16771		if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
16772			$( this ).addClass( "ui-datepicker-prev-hover" );
16773		}
16774		if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
16775			$( this ).addClass( "ui-datepicker-next-hover" );
16776		}
16777	}
16778}
16779
16780/* jQuery extend now ignores nulls! */
16781function datepicker_extendRemove( target, props ) {
16782	$.extend( target, props );
16783	for ( var name in props ) {
16784		if ( props[ name ] == null ) {
16785			target[ name ] = props[ name ];
16786		}
16787	}
16788	return target;
16789}
16790
16791/* Invoke the datepicker functionality.
16792   @param  options  string - a command, optionally followed by additional parameters or
16793					Object - settings for attaching new datepicker functionality
16794   @return  jQuery object */
16795$.fn.datepicker = function( options ) {
16796
16797	/* Verify an empty collection wasn't passed - Fixes #6976 */
16798	if ( !this.length ) {
16799		return this;
16800	}
16801
16802	/* Initialise the date picker. */
16803	if ( !$.datepicker.initialized ) {
16804		$( document ).on( "mousedown", $.datepicker._checkExternalClick );
16805		$.datepicker.initialized = true;
16806	}
16807
16808	/* Append datepicker main container to body if not exist. */
16809	if ( $( "#" + $.datepicker._mainDivId ).length === 0 ) {
16810		$( "body" ).append( $.datepicker.dpDiv );
16811	}
16812
16813	var otherArgs = Array.prototype.slice.call( arguments, 1 );
16814	if ( typeof options === "string" && ( options === "isDisabled" || options === "getDate" || options === "widget" ) ) {
16815		return $.datepicker[ "_" + options + "Datepicker" ].
16816			apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
16817	}
16818	if ( options === "option" && arguments.length === 2 && typeof arguments[ 1 ] === "string" ) {
16819		return $.datepicker[ "_" + options + "Datepicker" ].
16820			apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
16821	}
16822	return this.each( function() {
16823		if ( typeof options === "string" ) {
16824			$.datepicker[ "_" + options + "Datepicker" ]
16825				.apply( $.datepicker, [ this ].concat( otherArgs ) );
16826		} else {
16827			$.datepicker._attachDatepicker( this, options );
16828		}
16829	} );
16830};
16831
16832$.datepicker = new Datepicker(); // singleton instance
16833$.datepicker.initialized = false;
16834$.datepicker.uuid = new Date().getTime();
16835$.datepicker.version = "1.1
vendor: 6,619 bytes, lines 16835-17096
168354.0";
16836
16837var widgetsDatepicker = $.datepicker;
16838
16839
16840/*!
16841 * jQuery UI Mouse 1.14.0
16842 * https://jqueryui.com
16843 *
16844 * Copyright OpenJS Foundation and other contributors
16845 * Released under the MIT license.
16846 * https://jquery.org/license
16847 */
16848
16849//>>label: Mouse
16850//>>group: Widgets
16851//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
16852//>>docs: https://api.jqueryui.com/mouse/
16853
16854
16855var mouseHandled = false;
16856$( document ).on( "mouseup", function() {
16857	mouseHandled = false;
16858} );
16859
16860var widgetsMouse = $.widget( "ui.mouse", {
16861	version: "1.14.0",
16862	options: {
16863		cancel: "input, textarea, button, select, option",
16864		distance: 1,
16865		delay: 0
16866	},
16867	_mouseInit: function() {
16868		var that = this;
16869
16870		this.element
16871			.on( "mousedown." + this.widgetName, function( event ) {
16872				return that._mouseDown( event );
16873			} )
16874			.on( "click." + this.widgetName, function( event ) {
16875				if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) {
16876					$.removeData( event.target, that.widgetName + ".preventClickEvent" );
16877					event.stopImmediatePropagation();
16878					return false;
16879				}
16880			} );
16881
16882		this.started = false;
16883	},
16884
16885	// TODO: make sure destroying one instance of mouse doesn't mess with
16886	// other instances of mouse
16887	_mouseDestroy: function() {
16888		this.element.off( "." + this.widgetName );
16889		if ( this._mouseMoveDelegate ) {
16890			this.document
16891				.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
16892				.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
16893		}
16894	},
16895
16896	_mouseDown: function( event ) {
16897
16898		// don't let more than one widget handle mouseStart
16899		if ( mouseHandled ) {
16900			return;
16901		}
16902
16903		this._mouseMoved = false;
16904
16905		// We may have missed mouseup (out of window)
16906		if ( this._mouseStarted ) {
16907			this._mouseUp( event );
16908		}
16909
16910		this._mouseDownEvent = event;
16911
16912		var that = this,
16913			btnIsLeft = event.which === 1,
16914			elIsCancel = typeof this.options.cancel === "string" ?
16915				$( event.target ).closest( this.options.cancel ).length :
16916				false;
16917		if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
16918			return true;
16919		}
16920
16921		this.mouseDelayMet = !this.options.delay;
16922		if ( !this.mouseDelayMet ) {
16923			this._mouseDelayTimer = setTimeout( function() {
16924				that.mouseDelayMet = true;
16925			}, this.options.delay );
16926		}
16927
16928		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
16929			this._mouseStarted = ( this._mouseStart( event ) !== false );
16930			if ( !this._mouseStarted ) {
16931				event.preventDefault();
16932				return true;
16933			}
16934		}
16935
16936		// Click event may never have fired (Gecko & Opera)
16937		if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) {
16938			$.removeData( event.target, this.widgetName + ".preventClickEvent" );
16939		}
16940
16941		// These delegates are required to keep context
16942		this._mouseMoveDelegate = function( event ) {
16943			return that._mouseMove( event );
16944		};
16945		this._mouseUpDelegate = function( event ) {
16946			return that._mouseUp( event );
16947		};
16948
16949		this.document
16950			.on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
16951			.on( "mouseup." + this.widgetName, this._mouseUpDelegate );
16952
16953		event.preventDefault();
16954
16955		mouseHandled = true;
16956		return true;
16957	},
16958
16959	_mouseMove: function( event ) {
16960
16961		// Only check for mouseups outside the document if you've moved inside the document
16962		// at least once.
16963		if ( this._mouseMoved && !event.which ) {
16964
16965			// Support: Safari <=8 - 9
16966			// Safari sets which to 0 if you press any of the following keys
16967			// during a drag (#14461)
16968			if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
16969					event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
16970				this.ignoreMissingWhich = true;
16971			} else if ( !this.ignoreMissingWhich ) {
16972				return this._mouseUp( event );
16973			}
16974		}
16975
16976		if ( event.which || event.button ) {
16977			this._mouseMoved = true;
16978		}
16979
16980		if ( this._mouseStarted ) {
16981			this._mouseDrag( event );
16982			return event.preventDefault();
16983		}
16984
16985		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
16986			this._mouseStarted =
16987				( this._mouseStart( this._mouseDownEvent, event ) !== false );
16988			if ( this._mouseStarted ) {
16989				this._mouseDrag( event );
16990			} else {
16991				this._mouseUp( event );
16992			}
16993		}
16994
16995		return !this._mouseStarted;
16996	},
16997
16998	_mouseUp: function( event ) {
16999		this.document
17000			.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
17001			.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
17002
17003		if ( this._mouseStarted ) {
17004			this._mouseStarted = false;
17005
17006			if ( event.target === this._mouseDownEvent.target ) {
17007				$.data( event.target, this.widgetName + ".preventClickEvent", true );
17008			}
17009
17010			this._mouseStop( event );
17011		}
17012
17013		if ( this._mouseDelayTimer ) {
17014			clearTimeout( this._mouseDelayTimer );
17015			delete this._mouseDelayTimer;
17016		}
17017
17018		this.ignoreMissingWhich = false;
17019		mouseHandled = false;
17020		event.preventDefault();
17021	},
17022
17023	_mouseDistanceMet: function( event ) {
17024		return ( Math.max(
17025				Math.abs( this._mouseDownEvent.pageX - event.pageX ),
17026				Math.abs( this._mouseDownEvent.pageY - event.pageY )
17027			) >= this.options.distance
17028		);
17029	},
17030
17031	_mouseDelayMet: function( /* event */ ) {
17032		return this.mouseDelayMet;
17033	},
17034
17035	// These are placeholder methods, to be overriden by extending plugin
17036	_mouseStart: function( /* event */ ) {},
17037	_mouseDrag: function( /* event */ ) {},
17038	_mouseStop: function( /* event */ ) {},
17039	_mouseCapture: function( /* event */ ) {
17040		return true;
17041	}
17042} );
17043
17044
17045
17046// $.ui.plugin is deprecated. Use $.widget() extensions instead.
17047var plugin = $.ui.plugin = {
17048	add: function( module, option, set ) {
17049		var i,
17050			proto = $.ui[ module ].prototype;
17051		for ( i in set ) {
17052			proto.plugins[ i ] = proto.plugins[ i ] || [];
17053			proto.plugins[ i ].push( [ option, set[ i ] ] );
17054		}
17055	},
17056	call: function( instance, name, args, allowDisconnected ) {
17057		var i,
17058			set = instance.plugins[ name ];
17059
17060		if ( !set ) {
17061			return;
17062		}
17063
17064		if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode ||
17065				instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
17066			return;
17067		}
17068
17069		for ( i = 0; i < set.length; i++ ) {
17070			if ( instance.options[ set[ i ][ 0 ] ] ) {
17071				set[ i ][ 1 ].apply( instance.element, args );
17072			}
17073		}
17074	}
17075};
17076
17077
17078/*!
17079 * jQuery UI Draggable 1.14.0
17080 * https://jqueryui.com
17081 *
17082 * Copyright OpenJS Foundation and other contributors
17083 * Released under the MIT license.
17084 * https://jquery.org/license
17085 */
17086
17087//>>label: Draggable
17088//>>group: Interactions
17089//>>description: Enables dragging functionality for any element.
17090//>>docs: https://api.jqueryui.com/draggable/
17091//>>demos: https://jqueryui.com/draggable/
17092//>>css.structure: ../../themes/base/draggable.css
17093
17094
17095$.widget( "ui.draggable", $.ui.mouse, {
17096	version: "1.14.0
vendor: 13,254 bytes, lines 17096-17589
17096",
17097	widgetEventPrefix: "drag",
17098	options: {
17099		addClasses: true,
17100		appendTo: "parent",
17101		axis: false,
17102		connectToSortable: false,
17103		containment: false,
17104		cursor: "auto",
17105		cursorAt: false,
17106		grid: false,
17107		handle: false,
17108		helper: "original",
17109		iframeFix: false,
17110		opacity: false,
17111		refreshPositions: false,
17112		revert: false,
17113		revertDuration: 500,
17114		scope: "default",
17115		scroll: true,
17116		scrollSensitivity: 20,
17117		scrollSpeed: 20,
17118		snap: false,
17119		snapMode: "both",
17120		snapTolerance: 20,
17121		stack: false,
17122		zIndex: false,
17123
17124		// Callbacks
17125		drag: null,
17126		start: null,
17127		stop: null
17128	},
17129	_create: function() {
17130
17131		if ( this.options.helper === "original" ) {
17132			this._setPositionRelative();
17133		}
17134		if ( this.options.addClasses ) {
17135			this._addClass( "ui-draggable" );
17136		}
17137		this._setHandleClassName();
17138
17139		this._mouseInit();
17140	},
17141
17142	_setOption: function( key, value ) {
17143		this._super( key, value );
17144		if ( key === "handle" ) {
17145			this._removeHandleClassName();
17146			this._setHandleClassName();
17147		}
17148	},
17149
17150	_destroy: function() {
17151		if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
17152			this.destroyOnClear = true;
17153			return;
17154		}
17155		this._removeHandleClassName();
17156		this._mouseDestroy();
17157	},
17158
17159	_mouseCapture: function( event ) {
17160		var o = this.options;
17161
17162		// Among others, prevent a drag on a resizable-handle
17163		if ( this.helper || o.disabled ||
17164				$( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) {
17165			return false;
17166		}
17167
17168		//Quit if we're not on a valid handle
17169		this.handle = this._getHandle( event );
17170		if ( !this.handle ) {
17171			return false;
17172		}
17173
17174		this._blurActiveElement( event );
17175
17176		this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
17177
17178		return true;
17179
17180	},
17181
17182	_blockFrames: function( selector ) {
17183		this.iframeBlocks = this.document.find( selector ).map( function() {
17184			var iframe = $( this );
17185
17186			return $( "<div>" )
17187				.css( "position", "absolute" )
17188				.appendTo( iframe.parent() )
17189				.outerWidth( iframe.outerWidth() )
17190				.outerHeight( iframe.outerHeight() )
17191				.offset( iframe.offset() )[ 0 ];
17192		} );
17193	},
17194
17195	_unblockFrames: function() {
17196		if ( this.iframeBlocks ) {
17197			this.iframeBlocks.remove();
17198			delete this.iframeBlocks;
17199		}
17200	},
17201
17202	_blurActiveElement: function( event ) {
17203		var activeElement = this.document[ 0 ].activeElement,
17204			target = $( event.target );
17205
17206		// Don't blur if the event occurred on an element that is within
17207		// the currently focused element
17208		// See #10527, #12472
17209		if ( target.closest( activeElement ).length ) {
17210			return;
17211		}
17212
17213		// Blur any element that currently has focus, see #4261
17214		$( activeElement ).trigger( "blur" );
17215	},
17216
17217	_mouseStart: function( event ) {
17218
17219		var o = this.options;
17220
17221		//Create and append the visible helper
17222		this.helper = this._createHelper( event );
17223
17224		this._addClass( this.helper, "ui-draggable-dragging" );
17225
17226		//Cache the helper size
17227		this._cacheHelperProportions();
17228
17229		//If ddmanager is used for droppables, set the global draggable
17230		if ( $.ui.ddmanager ) {
17231			$.ui.ddmanager.current = this;
17232		}
17233
17234		/*
17235		 * - Position generation -
17236		 * This block generates everything position related - it's the core of draggables.
17237		 */
17238
17239		//Cache the margins of the original element
17240		this._cacheMargins();
17241
17242		//Store the helper's css position
17243		this.cssPosition = this.helper.css( "position" );
17244		this.scrollParent = this.helper.scrollParent( true );
17245		this.offsetParent = this.helper.offsetParent();
17246		this.hasFixedAncestor = this.helper.parents().filter( function() {
17247				return $( this ).css( "position" ) === "fixed";
17248			} ).length > 0;
17249
17250		//The element's absolute position on the page minus margins
17251		this.positionAbs = this.element.offset();
17252		this._refreshOffsets( event );
17253
17254		//Generate the original position
17255		this.originalPosition = this.position = this._generatePosition( event, false );
17256		this.originalPageX = event.pageX;
17257		this.originalPageY = event.pageY;
17258
17259		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
17260		if ( o.cursorAt ) {
17261			this._adjustOffsetFromHelper( o.cursorAt );
17262		}
17263
17264		//Set a containment if given in the options
17265		this._setContainment();
17266
17267		//Trigger event + callbacks
17268		if ( this._trigger( "start", event ) === false ) {
17269			this._clear();
17270			return false;
17271		}
17272
17273		//Recache the helper size
17274		this._cacheHelperProportions();
17275
17276		//Prepare the droppable offsets
17277		if ( $.ui.ddmanager && !o.dropBehaviour ) {
17278			$.ui.ddmanager.prepareOffsets( this, event );
17279		}
17280
17281		// Execute the drag once - this causes the helper not to be visible before getting its
17282		// correct position
17283		this._mouseDrag( event, true );
17284
17285		// If the ddmanager is used for droppables, inform the manager that dragging has started
17286		// (see #5003)
17287		if ( $.ui.ddmanager ) {
17288			$.ui.ddmanager.dragStart( this, event );
17289		}
17290
17291		return true;
17292	},
17293
17294	_refreshOffsets: function( event ) {
17295		this.offset = {
17296			top: this.positionAbs.top - this.margins.top,
17297			left: this.positionAbs.left - this.margins.left,
17298			scroll: false,
17299			parent: this._getParentOffset(),
17300			relative: this._getRelativeOffset()
17301		};
17302
17303		this.offset.click = {
17304			left: event.pageX - this.offset.left,
17305			top: event.pageY - this.offset.top
17306		};
17307	},
17308
17309	_mouseDrag: function( event, noPropagation ) {
17310
17311		// reset any necessary cached properties (see #5009)
17312		if ( this.hasFixedAncestor ) {
17313			this.offset.parent = this._getParentOffset();
17314		}
17315
17316		//Compute the helpers position
17317		this.position = this._generatePosition( event, true );
17318		this.positionAbs = this._convertPositionTo( "absolute" );
17319
17320		//Call plugins and callbacks and use the resulting position if something is returned
17321		if ( !noPropagation ) {
17322			var ui = this._uiHash();
17323			if ( this._trigger( "drag", event, ui ) === false ) {
17324				this._mouseUp( new $.Event( "mouseup", event ) );
17325				return false;
17326			}
17327			this.position = ui.position;
17328		}
17329
17330		this.helper[ 0 ].style.left = this.position.left + "px";
17331		this.helper[ 0 ].style.top = this.position.top + "px";
17332
17333		if ( $.ui.ddmanager ) {
17334			$.ui.ddmanager.drag( this, event );
17335		}
17336
17337		return false;
17338	},
17339
17340	_mouseStop: function( event ) {
17341
17342		//If we are using droppables, inform the manager about the drop
17343		var that = this,
17344			dropped = false;
17345		if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
17346			dropped = $.ui.ddmanager.drop( this, event );
17347		}
17348
17349		//if a drop comes from outside (a sortable)
17350		if ( this.dropped ) {
17351			dropped = this.dropped;
17352			this.dropped = false;
17353		}
17354
17355		if ( ( this.options.revert === "invalid" && !dropped ) ||
17356				( this.options.revert === "valid" && dropped ) ||
17357				this.options.revert === true || ( typeof this.options.revert === "function" &&
17358				this.options.revert.call( this.element, dropped ) )
17359		) {
17360			$( this.helper ).animate(
17361				this.originalPosition,
17362				parseInt( this.options.revertDuration, 10 ),
17363				function() {
17364					if ( that._trigger( "stop", event ) !== false ) {
17365						that._clear();
17366					}
17367				}
17368			);
17369		} else {
17370			if ( this._trigger( "stop", event ) !== false ) {
17371				this._clear();
17372			}
17373		}
17374
17375		return false;
17376	},
17377
17378	_mouseUp: function( event ) {
17379		this._unblockFrames();
17380
17381		// If the ddmanager is used for droppables, inform the manager that dragging has stopped
17382		// (see #5003)
17383		if ( $.ui.ddmanager ) {
17384			$.ui.ddmanager.dragStop( this, event );
17385		}
17386
17387		// Only need to focus if the event occurred on the draggable itself, see #10527
17388		if ( this.handleElement.is( event.target ) ) {
17389
17390			// The interaction is over; whether or not the click resulted in a drag,
17391			// focus the element
17392			this.element.trigger( "focus" );
17393		}
17394
17395		return $.ui.mouse.prototype._mouseUp.call( this, event );
17396	},
17397
17398	cancel: function() {
17399
17400		if ( this.helper.is( ".ui-draggable-dragging" ) ) {
17401			this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
17402		} else {
17403			this._clear();
17404		}
17405
17406		return this;
17407
17408	},
17409
17410	_getHandle: function( event ) {
17411		return this.options.handle ?
17412			!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
17413			true;
17414	},
17415
17416	_setHandleClassName: function() {
17417		this.handleElement = this.options.handle ?
17418			this.element.find( this.options.handle ) : this.element;
17419		this._addClass( this.handleElement, "ui-draggable-handle" );
17420	},
17421
17422	_removeHandleClassName: function() {
17423		this._removeClass( this.handleElement, "ui-draggable-handle" );
17424	},
17425
17426	_createHelper: function( event ) {
17427
17428		var o = this.options,
17429			helperIsFunction = typeof o.helper === "function",
17430			helper = helperIsFunction ?
17431				$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
17432				( o.helper === "clone" ?
17433					this.element.clone().removeAttr( "id" ) :
17434					this.element );
17435
17436		if ( !helper.parents( "body" ).length ) {
17437			helper.appendTo( ( o.appendTo === "parent" ?
17438				this.element[ 0 ].parentNode :
17439				o.appendTo ) );
17440		}
17441
17442		// https://bugs.jqueryui.com/ticket/9446
17443		// a helper function can return the original element
17444		// which wouldn't have been set to relative in _create
17445		if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
17446			this._setPositionRelative();
17447		}
17448
17449		if ( helper[ 0 ] !== this.element[ 0 ] &&
17450				!( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) {
17451			helper.css( "position", "absolute" );
17452		}
17453
17454		return helper;
17455
17456	},
17457
17458	_setPositionRelative: function() {
17459		if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
17460			this.element[ 0 ].style.position = "relative";
17461		}
17462	},
17463
17464	_adjustOffsetFromHelper: function( obj ) {
17465		if ( typeof obj === "string" ) {
17466			obj = obj.split( " " );
17467		}
17468		if ( Array.isArray( obj ) ) {
17469			obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
17470		}
17471		if ( "left" in obj ) {
17472			this.offset.click.left = obj.left + this.margins.left;
17473		}
17474		if ( "right" in obj ) {
17475			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
17476		}
17477		if ( "top" in obj ) {
17478			this.offset.click.top = obj.top + this.margins.top;
17479		}
17480		if ( "bottom" in obj ) {
17481			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
17482		}
17483	},
17484
17485	_isRootNode: function( element ) {
17486		return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
17487	},
17488
17489	_getParentOffset: function() {
17490
17491		//Get the offsetParent and cache its position
17492		var po = this.offsetParent.offset(),
17493			document = this.document[ 0 ];
17494
17495		// This is a special case where we need to modify a offset calculated on start, since the
17496		// following happened:
17497		// 1. The position of the helper is absolute, so it's position is calculated based on the
17498		// next positioned parent
17499		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
17500		// the document, which means that the scroll is included in the initial calculation of the
17501		// offset of the parent, and never recalculated upon drag
17502		if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document &&
17503				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
17504			po.left += this.scrollParent.scrollLeft();
17505			po.top += this.scrollParent.scrollTop();
17506		}
17507
17508		if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
17509			po = { top: 0, left: 0 };
17510		}
17511
17512		return {
17513			top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
17514			left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
17515		};
17516
17517	},
17518
17519	_getRelativeOffset: function() {
17520		if ( this.cssPosition !== "relative" ) {
17521			return { top: 0, left: 0 };
17522		}
17523
17524		var p = this.element.position(),
17525			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
17526
17527		return {
17528			top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
17529				( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
17530			left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
17531				( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
17532		};
17533
17534	},
17535
17536	_cacheMargins: function() {
17537		this.margins = {
17538			left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ),
17539			top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ),
17540			right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ),
17541			bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 )
17542		};
17543	},
17544
17545	_cacheHelperProportions: function() {
17546		this.helperProportions = {
17547			width: this.helper.outerWidth(),
17548			height: this.helper.outerHeight()
17549		};
17550	},
17551
17552	_setContainment: function() {
17553
17554		var isUserScrollable, c, ce,
17555			o = this.options,
17556			document = this.document[ 0 ];
17557
17558		this.relativeContainer = null;
17559
17560		if ( !o.containment ) {
17561			this.containment = null;
17562			return;
17563		}
17564
17565		if ( o.containment === "window" ) {
17566			this.containment = [
17567				$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
17568				$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
17569				$( window ).scrollLeft() + $( window ).width() -
17570					this.helperProportions.width - this.margins.left,
17571				$( window ).scrollTop() +
17572					( $( window ).height() || document.body.parentNode.scrollHeight ) -
17573					this.helperProportions.height - this.margins.top
17574			];
17575			return;
17576		}
17577
17578		if ( o.containment === "document" ) {
17579			this.containment = [
17580				0,
17581				0,
17582				$( document ).width() - this.helperProportions.width - this.margins.left,
17583				( $( document ).height() || document.body.parentNode.scrollHeight ) -
17584					this.helperProportions.height - this.margins.top
17585			];
17586			return;
17587		}
17588
17589		if ( o.containment.constructor === Array ) {
vendor: 10,369 bytes, lines 17590-17936
17590			this.containment = o.containment;
17591			return;
17592		}
17593
17594		if ( o.containment === "parent" ) {
17595			o.containment = this.helper[ 0 ].parentNode;
17596		}
17597
17598		c = $( o.containment );
17599		ce = c[ 0 ];
17600
17601		if ( !ce ) {
17602			return;
17603		}
17604
17605		isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
17606
17607		this.containment = [
17608			( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) +
17609				( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
17610			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) +
17611				( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
17612			( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
17613				( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
17614				( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
17615				this.helperProportions.width -
17616				this.margins.left -
17617				this.margins.right,
17618			( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
17619				( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
17620				( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
17621				this.helperProportions.height -
17622				this.margins.top -
17623				this.margins.bottom
17624		];
17625		this.relativeContainer = c;
17626	},
17627
17628	_convertPositionTo: function( d, pos ) {
17629
17630		if ( !pos ) {
17631			pos = this.position;
17632		}
17633
17634		var mod = d === "absolute" ? 1 : -1,
17635			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
17636
17637		return {
17638			top: (
17639
17640				// The absolute mouse position
17641				pos.top	+
17642
17643				// Only for relative positioned nodes: Relative offset from element to offset parent
17644				this.offset.relative.top * mod +
17645
17646				// The offsetParent's offset without borders (offset + border)
17647				this.offset.parent.top * mod -
17648				( ( this.cssPosition === "fixed" ?
17649					-this.offset.scroll.top :
17650					( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod )
17651			),
17652			left: (
17653
17654				// The absolute mouse position
17655				pos.left +
17656
17657				// Only for relative positioned nodes: Relative offset from element to offset parent
17658				this.offset.relative.left * mod +
17659
17660				// The offsetParent's offset without borders (offset + border)
17661				this.offset.parent.left * mod	-
17662				( ( this.cssPosition === "fixed" ?
17663					-this.offset.scroll.left :
17664					( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod )
17665			)
17666		};
17667
17668	},
17669
17670	_generatePosition: function( event, constrainPosition ) {
17671
17672		var containment, co, top, left,
17673			o = this.options,
17674			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
17675			pageX = event.pageX,
17676			pageY = event.pageY;
17677
17678		// Cache the scroll
17679		if ( !scrollIsRootNode || !this.offset.scroll ) {
17680			this.offset.scroll = {
17681				top: this.scrollParent.scrollTop(),
17682				left: this.scrollParent.scrollLeft()
17683			};
17684		}
17685
17686		/*
17687		 * - Position constraining -
17688		 * Constrain the position to a mix of grid, containment.
17689		 */
17690
17691		// If we are not dragging yet, we won't check for options
17692		if ( constrainPosition ) {
17693			if ( this.containment ) {
17694				if ( this.relativeContainer ) {
17695					co = this.relativeContainer.offset();
17696					containment = [
17697						this.containment[ 0 ] + co.left,
17698						this.containment[ 1 ] + co.top,
17699						this.containment[ 2 ] + co.left,
17700						this.containment[ 3 ] + co.top
17701					];
17702				} else {
17703					containment = this.containment;
17704				}
17705
17706				if ( event.pageX - this.offset.click.left < containment[ 0 ] ) {
17707					pageX = containment[ 0 ] + this.offset.click.left;
17708				}
17709				if ( event.pageY - this.offset.click.top < containment[ 1 ] ) {
17710					pageY = containment[ 1 ] + this.offset.click.top;
17711				}
17712				if ( event.pageX - this.offset.click.left > containment[ 2 ] ) {
17713					pageX = containment[ 2 ] + this.offset.click.left;
17714				}
17715				if ( event.pageY - this.offset.click.top > containment[ 3 ] ) {
17716					pageY = containment[ 3 ] + this.offset.click.top;
17717				}
17718			}
17719
17720			if ( o.grid ) {
17721
17722				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid
17723				// argument errors in IE (see ticket #6950)
17724				top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY -
17725					this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY;
17726				pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] ||
17727					top - this.offset.click.top > containment[ 3 ] ) ?
17728						top :
17729						( ( top - this.offset.click.top >= containment[ 1 ] ) ?
17730							top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top;
17731
17732				left = o.grid[ 0 ] ? this.originalPageX +
17733					Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] :
17734					this.originalPageX;
17735				pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] ||
17736					left - this.offset.click.left > containment[ 2 ] ) ?
17737						left :
17738						( ( left - this.offset.click.left >= containment[ 0 ] ) ?
17739							left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left;
17740			}
17741
17742			if ( o.axis === "y" ) {
17743				pageX = this.originalPageX;
17744			}
17745
17746			if ( o.axis === "x" ) {
17747				pageY = this.originalPageY;
17748			}
17749		}
17750
17751		return {
17752			top: (
17753
17754				// The absolute mouse position
17755				pageY -
17756
17757				// Click offset (relative to the element)
17758				this.offset.click.top -
17759
17760				// Only for relative positioned nodes: Relative offset from element to offset parent
17761				this.offset.relative.top -
17762
17763				// The offsetParent's offset without borders (offset + border)
17764				this.offset.parent.top +
17765				( this.cssPosition === "fixed" ?
17766					-this.offset.scroll.top :
17767					( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
17768			),
17769			left: (
17770
17771				// The absolute mouse position
17772				pageX -
17773
17774				// Click offset (relative to the element)
17775				this.offset.click.left -
17776
17777				// Only for relative positioned nodes: Relative offset from element to offset parent
17778				this.offset.relative.left -
17779
17780				// The offsetParent's offset without borders (offset + border)
17781				this.offset.parent.left +
17782				( this.cssPosition === "fixed" ?
17783					-this.offset.scroll.left :
17784					( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
17785			)
17786		};
17787
17788	},
17789
17790	_clear: function() {
17791		this._removeClass( this.helper, "ui-draggable-dragging" );
17792		if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) {
17793			this.helper.remove();
17794		}
17795		this.helper = null;
17796		this.cancelHelperRemoval = false;
17797		if ( this.destroyOnClear ) {
17798			this.destroy();
17799		}
17800	},
17801
17802	// From now on bulk stuff - mainly helpers
17803
17804	_trigger: function( type, event, ui ) {
17805		ui = ui || this._uiHash();
17806		$.ui.plugin.call( this, type, [ event, ui, this ], true );
17807
17808		// Absolute position and offset (see #6884 ) have to be recalculated after plugins
17809		if ( /^(drag|start|stop)/.test( type ) ) {
17810			this.positionAbs = this._convertPositionTo( "absolute" );
17811			ui.offset = this.positionAbs;
17812		}
17813		return $.Widget.prototype._trigger.call( this, type, event, ui );
17814	},
17815
17816	plugins: {},
17817
17818	_uiHash: function() {
17819		return {
17820			helper: this.helper,
17821			position: this.position,
17822			originalPosition: this.originalPosition,
17823			offset: this.positionAbs
17824		};
17825	}
17826
17827} );
17828
17829$.ui.plugin.add( "draggable", "connectToSortable", {
17830	start: function( event, ui, draggable ) {
17831		var uiSortable = $.extend( {}, ui, {
17832			item: draggable.element
17833		} );
17834
17835		draggable.sortables = [];
17836		$( draggable.options.connectToSortable ).each( function() {
17837			var sortable = $( this ).sortable( "instance" );
17838
17839			if ( sortable && !sortable.options.disabled ) {
17840				draggable.sortables.push( sortable );
17841
17842				// RefreshPositions is called at drag start to refresh the containerCache
17843				// which is used in drag. This ensures it's initialized and synchronized
17844				// with any changes that might have happened on the page since initialization.
17845				sortable.refreshPositions();
17846				sortable._trigger( "activate", event, uiSortable );
17847			}
17848		} );
17849	},
17850	stop: function( event, ui, draggable ) {
17851		var uiSortable = $.extend( {}, ui, {
17852			item: draggable.element
17853		} );
17854
17855		draggable.cancelHelperRemoval = false;
17856
17857		$.each( draggable.sortables, function() {
17858			var sortable = this;
17859
17860			if ( sortable.isOver ) {
17861				sortable.isOver = 0;
17862
17863				// Allow this sortable to handle removing the helper
17864				draggable.cancelHelperRemoval = true;
17865				sortable.cancelHelperRemoval = false;
17866
17867				// Use _storedCSS To restore properties in the sortable,
17868				// as this also handles revert (#9675) since the draggable
17869				// may have modified them in unexpected ways (#8809)
17870				sortable._storedCSS = {
17871					position: sortable.placeholder.css( "position" ),
17872					top: sortable.placeholder.css( "top" ),
17873					left: sortable.placeholder.css( "left" )
17874				};
17875
17876				sortable._mouseStop( event );
17877
17878				// Once drag has ended, the sortable should return to using
17879				// its original helper, not the shared helper from draggable
17880				sortable.options.helper = sortable.options._helper;
17881			} else {
17882
17883				// Prevent this Sortable from removing the helper.
17884				// However, don't set the draggable to remove the helper
17885				// either as another connected Sortable may yet handle the removal.
17886				sortable.cancelHelperRemoval = true;
17887
17888				sortable._trigger( "deactivate", event, uiSortable );
17889			}
17890		} );
17891	},
17892	drag: function( event, ui, draggable ) {
17893		$.each( draggable.sortables, function() {
17894			var innermostIntersecting = false,
17895				sortable = this;
17896
17897			// Copy over variables that sortable's _intersectsWith uses
17898			sortable.positionAbs = draggable.positionAbs;
17899			sortable.helperProportions = draggable.helperProportions;
17900			sortable.offset.click = draggable.offset.click;
17901
17902			if ( sortable._intersectsWith( sortable.containerCache ) ) {
17903				innermostIntersecting = true;
17904
17905				$.each( draggable.sortables, function() {
17906
17907					// Copy over variables that sortable's _intersectsWith uses
17908					this.positionAbs = draggable.positionAbs;
17909					this.helperProportions = draggable.helperProportions;
17910					this.offset.click = draggable.offset.click;
17911
17912					if ( this !== sortable &&
17913							this._intersectsWith( this.containerCache ) &&
17914							$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
17915						innermostIntersecting = false;
17916					}
17917
17918					return innermostIntersecting;
17919				} );
17920			}
17921
17922			if ( innermostIntersecting ) {
17923
17924				// If it intersects, we use a little isOver variable and set it once,
17925				// so that the move-in stuff gets fired only once.
17926				if ( !sortable.isOver ) {
17927					sortable.isOver = 1;
17928
17929					// Store draggable's parent in case we need to reappend to it later.
17930					draggable._parent = ui.helper.parent();
17931
17932					sortable.currentItem = ui.helper
17933						.appendTo( sortable.element )
17934						.data( "ui-sortable-item", true );
17935
17936					// Store helper option to later restore it
vendor: 11,051 bytes, lines 17937-18314
17937					sortable.options._helper = sortable.options.helper;
17938
17939					sortable.options.helper = function() {
17940						return ui.helper[ 0 ];
17941					};
17942
17943					// Fire the start events of the sortable with our passed browser event,
17944					// and our own helper (so it doesn't create a new one)
17945					event.target = sortable.currentItem[ 0 ];
17946					sortable._mouseCapture( event, true );
17947					sortable._mouseStart( event, true, true );
17948
17949					// Because the browser event is way off the new appended portlet,
17950					// modify necessary variables to reflect the changes
17951					sortable.offset.click.top = draggable.offset.click.top;
17952					sortable.offset.click.left = draggable.offset.click.left;
17953					sortable.offset.parent.left -= draggable.offset.parent.left -
17954						sortable.offset.parent.left;
17955					sortable.offset.parent.top -= draggable.offset.parent.top -
17956						sortable.offset.parent.top;
17957
17958					draggable._trigger( "toSortable", event );
17959
17960					// Inform draggable that the helper is in a valid drop zone,
17961					// used solely in the revert option to handle "valid/invalid".
17962					draggable.dropped = sortable.element;
17963
17964					// Need to refreshPositions of all sortables in the case that
17965					// adding to one sortable changes the location of the other sortables (#9675)
17966					$.each( draggable.sortables, function() {
17967						this.refreshPositions();
17968					} );
17969
17970					// Hack so receive/update callbacks work (mostly)
17971					draggable.currentItem = draggable.element;
17972					sortable.fromOutside = draggable;
17973				}
17974
17975				if ( sortable.currentItem ) {
17976					sortable._mouseDrag( event );
17977
17978					// Copy the sortable's position because the draggable's can potentially reflect
17979					// a relative position, while sortable is always absolute, which the dragged
17980					// element has now become. (#8809)
17981					ui.position = sortable.position;
17982				}
17983			} else {
17984
17985				// If it doesn't intersect with the sortable, and it intersected before,
17986				// we fake the drag stop of the sortable, but make sure it doesn't remove
17987				// the helper by using cancelHelperRemoval.
17988				if ( sortable.isOver ) {
17989
17990					sortable.isOver = 0;
17991					sortable.cancelHelperRemoval = true;
17992
17993					// Calling sortable's mouseStop would trigger a revert,
17994					// so revert must be temporarily false until after mouseStop is called.
17995					sortable.options._revert = sortable.options.revert;
17996					sortable.options.revert = false;
17997
17998					sortable._trigger( "out", event, sortable._uiHash( sortable ) );
17999					sortable._mouseStop( event, true );
18000
18001					// Restore sortable behaviors that were modfied
18002					// when the draggable entered the sortable area (#9481)
18003					sortable.options.revert = sortable.options._revert;
18004					sortable.options.helper = sortable.options._helper;
18005
18006					if ( sortable.placeholder ) {
18007						sortable.placeholder.remove();
18008					}
18009
18010					// Restore and recalculate the draggable's offset considering the sortable
18011					// may have modified them in unexpected ways. (#8809, #10669)
18012					ui.helper.appendTo( draggable._parent );
18013					draggable._refreshOffsets( event );
18014					ui.position = draggable._generatePosition( event, true );
18015
18016					draggable._trigger( "fromSortable", event );
18017
18018					// Inform draggable that the helper is no longer in a valid drop zone
18019					draggable.dropped = false;
18020
18021					// Need to refreshPositions of all sortables just in case removing
18022					// from one sortable changes the location of other sortables (#9675)
18023					$.each( draggable.sortables, function() {
18024						this.refreshPositions();
18025					} );
18026				}
18027			}
18028		} );
18029	}
18030} );
18031
18032$.ui.plugin.add( "draggable", "cursor", {
18033	start: function( event, ui, instance ) {
18034		var t = $( "body" ),
18035			o = instance.options;
18036
18037		if ( t.css( "cursor" ) ) {
18038			o._cursor = t.css( "cursor" );
18039		}
18040		t.css( "cursor", o.cursor );
18041	},
18042	stop: function( event, ui, instance ) {
18043		var o = instance.options;
18044		if ( o._cursor ) {
18045			$( "body" ).css( "cursor", o._cursor );
18046		}
18047	}
18048} );
18049
18050$.ui.plugin.add( "draggable", "opacity", {
18051	start: function( event, ui, instance ) {
18052		var t = $( ui.helper ),
18053			o = instance.options;
18054		if ( t.css( "opacity" ) ) {
18055			o._opacity = t.css( "opacity" );
18056		}
18057		t.css( "opacity", o.opacity );
18058	},
18059	stop: function( event, ui, instance ) {
18060		var o = instance.options;
18061		if ( o._opacity ) {
18062			$( ui.helper ).css( "opacity", o._opacity );
18063		}
18064	}
18065} );
18066
18067$.ui.plugin.add( "draggable", "scroll", {
18068	start: function( event, ui, i ) {
18069		if ( !i.scrollParentNotHidden ) {
18070			i.scrollParentNotHidden = i.helper.scrollParent( false );
18071		}
18072
18073		if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] &&
18074				i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
18075			i.overflowOffset = i.scrollParentNotHidden.offset();
18076		}
18077	},
18078	drag: function( event, ui, i  ) {
18079
18080		var o = i.options,
18081			scrolled = false,
18082			scrollParent = i.scrollParentNotHidden[ 0 ],
18083			document = i.document[ 0 ];
18084
18085		if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
18086			if ( !o.axis || o.axis !== "x" ) {
18087				if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY <
18088						o.scrollSensitivity ) {
18089					scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
18090				} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
18091					scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
18092				}
18093			}
18094
18095			if ( !o.axis || o.axis !== "y" ) {
18096				if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX <
18097						o.scrollSensitivity ) {
18098					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
18099				} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
18100					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
18101				}
18102			}
18103
18104		} else {
18105
18106			if ( !o.axis || o.axis !== "x" ) {
18107				if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) {
18108					scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed );
18109				} else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) <
18110						o.scrollSensitivity ) {
18111					scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed );
18112				}
18113			}
18114
18115			if ( !o.axis || o.axis !== "y" ) {
18116				if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) {
18117					scrolled = $( document ).scrollLeft(
18118						$( document ).scrollLeft() - o.scrollSpeed
18119					);
18120				} else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) <
18121						o.scrollSensitivity ) {
18122					scrolled = $( document ).scrollLeft(
18123						$( document ).scrollLeft() + o.scrollSpeed
18124					);
18125				}
18126			}
18127
18128		}
18129
18130		if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
18131			$.ui.ddmanager.prepareOffsets( i, event );
18132		}
18133
18134	}
18135} );
18136
18137$.ui.plugin.add( "draggable", "snap", {
18138	start: function( event, ui, i ) {
18139
18140		var o = i.options;
18141
18142		i.snapElements = [];
18143
18144		$( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap )
18145			.each( function() {
18146				var $t = $( this ),
18147					$o = $t.offset();
18148				if ( this !== i.element[ 0 ] ) {
18149					i.snapElements.push( {
18150						item: this,
18151						width: $t.outerWidth(), height: $t.outerHeight(),
18152						top: $o.top, left: $o.left
18153					} );
18154				}
18155			} );
18156
18157	},
18158	drag: function( event, ui, inst ) {
18159
18160		var ts, bs, ls, rs, l, r, t, b, i, first,
18161			o = inst.options,
18162			d = o.snapTolerance,
18163			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
18164			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
18165
18166		for ( i = inst.snapElements.length - 1; i >= 0; i-- ) {
18167
18168			l = inst.snapElements[ i ].left - inst.margins.left;
18169			r = l + inst.snapElements[ i ].width;
18170			t = inst.snapElements[ i ].top - inst.margins.top;
18171			b = t + inst.snapElements[ i ].height;
18172
18173			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
18174					!$.contains( inst.snapElements[ i ].item.ownerDocument,
18175					inst.snapElements[ i ].item ) ) {
18176				if ( inst.snapElements[ i ].snapping ) {
18177					if ( inst.options.snap.release ) {
18178						inst.options.snap.release.call(
18179							inst.element,
18180							event,
18181							$.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } )
18182						);
18183					}
18184				}
18185				inst.snapElements[ i ].snapping = false;
18186				continue;
18187			}
18188
18189			if ( o.snapMode !== "inner" ) {
18190				ts = Math.abs( t - y2 ) <= d;
18191				bs = Math.abs( b - y1 ) <= d;
18192				ls = Math.abs( l - x2 ) <= d;
18193				rs = Math.abs( r - x1 ) <= d;
18194				if ( ts ) {
18195					ui.position.top = inst._convertPositionTo( "relative", {
18196						top: t - inst.helperProportions.height,
18197						left: 0
18198					} ).top;
18199				}
18200				if ( bs ) {
18201					ui.position.top = inst._convertPositionTo( "relative", {
18202						top: b,
18203						left: 0
18204					} ).top;
18205				}
18206				if ( ls ) {
18207					ui.position.left = inst._convertPositionTo( "relative", {
18208						top: 0,
18209						left: l - inst.helperProportions.width
18210					} ).left;
18211				}
18212				if ( rs ) {
18213					ui.position.left = inst._convertPositionTo( "relative", {
18214						top: 0,
18215						left: r
18216					} ).left;
18217				}
18218			}
18219
18220			first = ( ts || bs || ls || rs );
18221
18222			if ( o.snapMode !== "outer" ) {
18223				ts = Math.abs( t - y1 ) <= d;
18224				bs = Math.abs( b - y2 ) <= d;
18225				ls = Math.abs( l - x1 ) <= d;
18226				rs = Math.abs( r - x2 ) <= d;
18227				if ( ts ) {
18228					ui.position.top = inst._convertPositionTo( "relative", {
18229						top: t,
18230						left: 0
18231					} ).top;
18232				}
18233				if ( bs ) {
18234					ui.position.top = inst._convertPositionTo( "relative", {
18235						top: b - inst.helperProportions.height,
18236						left: 0
18237					} ).top;
18238				}
18239				if ( ls ) {
18240					ui.position.left = inst._convertPositionTo( "relative", {
18241						top: 0,
18242						left: l
18243					} ).left;
18244				}
18245				if ( rs ) {
18246					ui.position.left = inst._convertPositionTo( "relative", {
18247						top: 0,
18248						left: r - inst.helperProportions.width
18249					} ).left;
18250				}
18251			}
18252
18253			if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) {
18254				if ( inst.options.snap.snap ) {
18255					inst.options.snap.snap.call(
18256						inst.element,
18257						event,
18258						$.extend( inst._uiHash(), {
18259							snapItem: inst.snapElements[ i ].item
18260						} ) );
18261				}
18262			}
18263			inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first );
18264
18265		}
18266
18267	}
18268} );
18269
18270$.ui.plugin.add( "draggable", "stack", {
18271	start: function( event, ui, instance ) {
18272		var min,
18273			o = instance.options,
18274			group = $.makeArray( $( o.stack ) ).sort( function( a, b ) {
18275				return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) -
18276					( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 );
18277			} );
18278
18279		if ( !group.length ) {
18280			return;
18281		}
18282
18283		min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0;
18284		$( group ).each( function( i ) {
18285			$( this ).css( "zIndex", min + i );
18286		} );
18287		this.css( "zIndex", ( min + group.length ) );
18288	}
18289} );
18290
18291$.ui.plugin.add( "draggable", "zIndex", {
18292	start: function( event, ui, instance ) {
18293		var t = $( ui.helper ),
18294			o = instance.options;
18295
18296		if ( t.css( "zIndex" ) ) {
18297			o._zIndex = t.css( "zIndex" );
18298		}
18299		t.css( "zIndex", o.zIndex );
18300	},
18301	stop: function( event, ui, instance ) {
18302		var o = instance.options;
18303
18304		if ( o._zIndex ) {
18305			$( ui.helper ).css( "zIndex", o._zIndex );
18306		}
18307	}
18308} );
18309
18310var widgetsDraggable = $.ui.draggable;
18311
18312
18313/*!
18314 * jQuery UI Resizable 1.14.
183140
18315 * https://jqueryui.com
18316 *
18317 * Copyright OpenJS Foundation and other contributors
18318 * Released under the MIT license.
18319 * https://jquery.org/license
18320 */
18321
18322//>>label: Resizable
18323//>>group: Interactions
18324//>>description: Enables resize functionality for any element.
18325//>>docs: https://api.jqueryui.com/resizable/
18326//>>demos: https://jqueryui.com/resizable/
18327//>>css.structure: ../../themes/base/core.css
18328//>>css.structure: ../../themes/base/resizable.css
18329//>>css.theme: ../../themes/base/theme.css
18330
18331
18332$.widget( "ui.resizable", $.ui.mouse, {
18333	version: "1.14.0",
18334	widgetEventPrefix: "resize",
18335	options: {
18336		alsoResize: false,
18337		animate: false,
18338		animateDuration: "slow",
18339		animateEasing: "swing",
18340		aspectRatio: false,
18341		autoHide: false,
18342		classes: {
18343			"ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
18344		},
18345		containment: false,
18346		ghost: false,
18347		grid: false,
18348		handles: "e,s,se",
18349		helper: false,
18350		maxHeight: null,
18351		maxWidth: null,
18352		minHeight: 10,
18353		minWidth: 10,
18354
18355		// See #7960
18356		zIndex: 90,
18357
18358		// Callbacks
18359		resize: null,
18360		start: null,
18361		stop: null
18362	},
18363
18364	_num: function( value ) {
18365		return parseFloat( value ) || 0;
18366	},
18367
18368	_isNumber: function( value ) {
18369		return !isNaN( parseFloat( value ) );
18370	},
18371
18372	_hasScroll: function( el, a ) {
18373
18374		if ( $( el ).css( "overflow" ) === "hidden" ) {
18375			return false;
vendor: 2,099 bytes, lines 18376-18453
18376		}
18377
18378		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
18379			has = false;
18380
18381		if ( el[ scroll ] > 0 ) {
18382			return true;
18383		}
18384
18385		// TODO: determine which cases actually cause this to happen
18386		// if the element doesn't have the scroll set, see if it's possible to
18387		// set the scroll
18388		try {
18389			el[ scroll ] = 1;
18390			has = ( el[ scroll ] > 0 );
18391			el[ scroll ] = 0;
18392		} catch ( e ) {
18393
18394			// `el` might be a string, then setting `scroll` will throw
18395			// an error in strict mode; ignore it.
18396		}
18397		return has;
18398	},
18399
18400	_create: function() {
18401
18402		var margins,
18403			o = this.options,
18404			that = this;
18405		this._addClass( "ui-resizable" );
18406
18407		$.extend( this, {
18408			_aspectRatio: !!( o.aspectRatio ),
18409			aspectRatio: o.aspectRatio,
18410			originalElement: this.element,
18411			_proportionallyResizeElements: [],
18412			_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
18413		} );
18414
18415		// Wrap the element if it cannot hold child nodes
18416		if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) {
18417
18418			this.element.wrap(
18419				$( "<div class='ui-wrapper'></div>" ).css( {
18420					overflow: "hidden",
18421					position: this.element.css( "position" ),
18422					width: this.element.outerWidth(),
18423					height: this.element.outerHeight(),
18424					top: this.element.css( "top" ),
18425					left: this.element.css( "left" )
18426				} )
18427			);
18428
18429			this.element = this.element.parent().data(
18430				"ui-resizable", this.element.resizable( "instance" )
18431			);
18432
18433			this.elementIsWrapper = true;
18434
18435			margins = {
18436				marginTop: this.originalElement.css( "marginTop" ),
18437				marginRight: this.originalElement.css( "marginRight" ),
18438				marginBottom: this.originalElement.css( "marginBottom" ),
18439				marginLeft: this.originalElement.css( "marginLeft" )
18440			};
18441
18442			this.element.css( margins );
18443
18444			// Support: Safari
18445			// Prevent Safari textarea resize
18446			this.originalResizeStyle = this.originalElement.css( "resize" );
18447			this.originalElement.css( "resize", "none" );
18448
18449			this._proportionallyResizeElements.push( this.originalElement.css( {
18450				position: "static",
18451				zoom: 1,
18452				display: "block"
18453			} )
vendor: 23,890 bytes, lines 18453-19402
18453 );
18454
18455			this._proportionallyResize();
18456		}
18457
18458		this._setupHandles();
18459
18460		if ( o.autoHide ) {
18461			$( this.element )
18462				.on( "mouseenter", function() {
18463					if ( o.disabled ) {
18464						return;
18465					}
18466					that._removeClass( "ui-resizable-autohide" );
18467					that._handles.show();
18468				} )
18469				.on( "mouseleave", function() {
18470					if ( o.disabled ) {
18471						return;
18472					}
18473					if ( !that.resizing ) {
18474						that._addClass( "ui-resizable-autohide" );
18475						that._handles.hide();
18476					}
18477				} );
18478		}
18479
18480		this._mouseInit();
18481	},
18482
18483	_destroy: function() {
18484
18485		this._mouseDestroy();
18486		this._addedHandles.remove();
18487
18488		var wrapper,
18489			_destroy = function( exp ) {
18490				$( exp )
18491					.removeData( "resizable" )
18492					.removeData( "ui-resizable" )
18493					.off( ".resizable" );
18494			};
18495
18496		// TODO: Unwrap at same DOM position
18497		if ( this.elementIsWrapper ) {
18498			_destroy( this.element );
18499			wrapper = this.element;
18500			this.originalElement.css( {
18501				position: wrapper.css( "position" ),
18502				width: wrapper.outerWidth(),
18503				height: wrapper.outerHeight(),
18504				top: wrapper.css( "top" ),
18505				left: wrapper.css( "left" )
18506			} ).insertAfter( wrapper );
18507			wrapper.remove();
18508		}
18509
18510		this.originalElement.css( "resize", this.originalResizeStyle );
18511		_destroy( this.originalElement );
18512
18513		return this;
18514	},
18515
18516	_setOption: function( key, value ) {
18517		this._super( key, value );
18518
18519		switch ( key ) {
18520		case "handles":
18521			this._removeHandles();
18522			this._setupHandles();
18523			break;
18524		case "aspectRatio":
18525			this._aspectRatio = !!value;
18526			break;
18527		default:
18528			break;
18529		}
18530	},
18531
18532	_setupHandles: function() {
18533		var o = this.options, handle, i, n, hname, axis, that = this;
18534		this.handles = o.handles ||
18535			( !$( ".ui-resizable-handle", this.element ).length ?
18536				"e,s,se" : {
18537					n: ".ui-resizable-n",
18538					e: ".ui-resizable-e",
18539					s: ".ui-resizable-s",
18540					w: ".ui-resizable-w",
18541					se: ".ui-resizable-se",
18542					sw: ".ui-resizable-sw",
18543					ne: ".ui-resizable-ne",
18544					nw: ".ui-resizable-nw"
18545				} );
18546
18547		this._handles = $();
18548		this._addedHandles = $();
18549		if ( this.handles.constructor === String ) {
18550
18551			if ( this.handles === "all" ) {
18552				this.handles = "n,e,s,w,se,sw,ne,nw";
18553			}
18554
18555			n = this.handles.split( "," );
18556			this.handles = {};
18557
18558			for ( i = 0; i < n.length; i++ ) {
18559
18560				handle = String.prototype.trim.call( n[ i ] );
18561				hname = "ui-resizable-" + handle;
18562				axis = $( "<div>" );
18563				this._addClass( axis, "ui-resizable-handle " + hname );
18564
18565				axis.css( { zIndex: o.zIndex } );
18566
18567				this.handles[ handle ] = ".ui-resizable-" + handle;
18568				if ( !this.element.children( this.handles[ handle ] ).length ) {
18569					this.element.append( axis );
18570					this._addedHandles = this._addedHandles.add( axis );
18571				}
18572			}
18573
18574		}
18575
18576		this._renderAxis = function( target ) {
18577
18578			var i, axis, padPos, padWrapper;
18579
18580			target = target || this.element;
18581
18582			for ( i in this.handles ) {
18583
18584				if ( this.handles[ i ].constructor === String ) {
18585					this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show();
18586				} else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
18587					this.handles[ i ] = $( this.handles[ i ] );
18588					this._on( this.handles[ i ], { "mousedown": that._mouseDown } );
18589				}
18590
18591				if ( this.elementIsWrapper &&
18592						this.originalElement[ 0 ]
18593							.nodeName
18594							.match( /^(textarea|input|select|button)$/i ) ) {
18595					axis = $( this.handles[ i ], this.element );
18596
18597					padWrapper = /sw|ne|nw|se|n|s/.test( i ) ?
18598						axis.outerHeight() :
18599						axis.outerWidth();
18600
18601					padPos = [ "padding",
18602						/ne|nw|n/.test( i ) ? "Top" :
18603						/se|sw|s/.test( i ) ? "Bottom" :
18604						/^e$/.test( i ) ? "Right" : "Left" ].join( "" );
18605
18606					target.css( padPos, padWrapper );
18607
18608					this._proportionallyResize();
18609				}
18610
18611				this._handles = this._handles.add( this.handles[ i ] );
18612			}
18613		};
18614
18615		// TODO: make renderAxis a prototype function
18616		this._renderAxis( this.element );
18617
18618		this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
18619		this._handles.disableSelection();
18620
18621		this._handles.on( "mouseover", function() {
18622			if ( !that.resizing ) {
18623				if ( this.className ) {
18624					axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i );
18625				}
18626				that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se";
18627			}
18628		} );
18629
18630		if ( o.autoHide ) {
18631			this._handles.hide();
18632			this._addClass( "ui-resizable-autohide" );
18633		}
18634	},
18635
18636	_removeHandles: function() {
18637		this._addedHandles.remove();
18638	},
18639
18640	_mouseCapture: function( event ) {
18641		var i, handle,
18642			capture = false;
18643
18644		for ( i in this.handles ) {
18645			handle = $( this.handles[ i ] )[ 0 ];
18646			if ( handle === event.target || $.contains( handle, event.target ) ) {
18647				capture = true;
18648			}
18649		}
18650
18651		return !this.options.disabled && capture;
18652	},
18653
18654	_mouseStart: function( event ) {
18655
18656		var curleft, curtop, cursor,
18657			o = this.options,
18658			el = this.element;
18659
18660		this.resizing = true;
18661
18662		this._renderProxy();
18663
18664		curleft = this._num( this.helper.css( "left" ) );
18665		curtop = this._num( this.helper.css( "top" ) );
18666
18667		if ( o.containment ) {
18668			curleft += $( o.containment ).scrollLeft() || 0;
18669			curtop += $( o.containment ).scrollTop() || 0;
18670		}
18671
18672		this.offset = this.helper.offset();
18673		this.position = { left: curleft, top: curtop };
18674
18675		this.size = this._helper ? {
18676				width: this.helper.width(),
18677				height: this.helper.height()
18678			} : {
18679				width: el.width(),
18680				height: el.height()
18681			};
18682
18683		this.originalSize = this._helper ? {
18684				width: el.outerWidth(),
18685				height: el.outerHeight()
18686			} : {
18687				width: el.width(),
18688				height: el.height()
18689			};
18690
18691		this.sizeDiff = {
18692			width: el.outerWidth() - el.width(),
18693			height: el.outerHeight() - el.height()
18694		};
18695
18696		this.originalPosition = { left: curleft, top: curtop };
18697		this.originalMousePosition = { left: event.pageX, top: event.pageY };
18698
18699		this.aspectRatio = ( typeof o.aspectRatio === "number" ) ?
18700			o.aspectRatio :
18701			( ( this.originalSize.width / this.originalSize.height ) || 1 );
18702
18703		cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" );
18704		$( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor );
18705
18706		this._addClass( "ui-resizable-resizing" );
18707		this._propagate( "start", event );
18708		return true;
18709	},
18710
18711	_mouseDrag: function( event ) {
18712
18713		var data, props,
18714			smp = this.originalMousePosition,
18715			a = this.axis,
18716			dx = ( event.pageX - smp.left ) || 0,
18717			dy = ( event.pageY - smp.top ) || 0,
18718			trigger = this._change[ a ];
18719
18720		this._updatePrevProperties();
18721
18722		if ( !trigger ) {
18723			return false;
18724		}
18725
18726		data = trigger.apply( this, [ event, dx, dy ] );
18727
18728		this._updateVirtualBoundaries( event.shiftKey );
18729		if ( this._aspectRatio || event.shiftKey ) {
18730			data = this._updateRatio( data, event );
18731		}
18732
18733		data = this._respectSize( data, event );
18734
18735		this._updateCache( data );
18736
18737		this._propagate( "resize", event );
18738
18739		props = this._applyChanges();
18740
18741		if ( !this._helper && this._proportionallyResizeElements.length ) {
18742			this._proportionallyResize();
18743		}
18744
18745		if ( !$.isEmptyObject( props ) ) {
18746			this._updatePrevProperties();
18747			this._trigger( "resize", event, this.ui() );
18748			this._applyChanges();
18749		}
18750
18751		return false;
18752	},
18753
18754	_mouseStop: function( event ) {
18755
18756		this.resizing = false;
18757		var pr, ista, soffseth, soffsetw, s, left, top,
18758			o = this.options, that = this;
18759
18760		if ( this._helper ) {
18761
18762			pr = this._proportionallyResizeElements;
18763			ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName );
18764			soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height;
18765			soffsetw = ista ? 0 : that.sizeDiff.width;
18766
18767			s = {
18768				width: ( that.helper.width()  - soffsetw ),
18769				height: ( that.helper.height() - soffseth )
18770			};
18771			left = ( parseFloat( that.element.css( "left" ) ) +
18772				( that.position.left - that.originalPosition.left ) ) || null;
18773			top = ( parseFloat( that.element.css( "top" ) ) +
18774				( that.position.top - that.originalPosition.top ) ) || null;
18775
18776			if ( !o.animate ) {
18777				this.element.css( $.extend( s, { top: top, left: left } ) );
18778			}
18779
18780			that.helper.height( that.size.height );
18781			that.helper.width( that.size.width );
18782
18783			if ( this._helper && !o.animate ) {
18784				this._proportionallyResize();
18785			}
18786		}
18787
18788		$( "body" ).css( "cursor", "auto" );
18789
18790		this._removeClass( "ui-resizable-resizing" );
18791
18792		this._propagate( "stop", event );
18793
18794		if ( this._helper ) {
18795			this.helper.remove();
18796		}
18797
18798		return false;
18799
18800	},
18801
18802	_updatePrevProperties: function() {
18803		this.prevPosition = {
18804			top: this.position.top,
18805			left: this.position.left
18806		};
18807		this.prevSize = {
18808			width: this.size.width,
18809			height: this.size.height
18810		};
18811	},
18812
18813	_applyChanges: function() {
18814		var props = {};
18815
18816		if ( this.position.top !== this.prevPosition.top ) {
18817			props.top = this.position.top + "px";
18818		}
18819		if ( this.position.left !== this.prevPosition.left ) {
18820			props.left = this.position.left + "px";
18821		}
18822
18823		this.helper.css( props );
18824
18825		if ( this.size.width !== this.prevSize.width ) {
18826			props.width = this.size.width + "px";
18827			this.helper.width( props.width );
18828		}
18829		if ( this.size.height !== this.prevSize.height ) {
18830			props.height = this.size.height + "px";
18831			this.helper.height( props.height );
18832		}
18833
18834		return props;
18835	},
18836
18837	_updateVirtualBoundaries: function( forceAspectRatio ) {
18838		var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
18839			o = this.options;
18840
18841		b = {
18842			minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0,
18843			maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity,
18844			minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0,
18845			maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity
18846		};
18847
18848		if ( this._aspectRatio || forceAspectRatio ) {
18849			pMinWidth = b.minHeight * this.aspectRatio;
18850			pMinHeight = b.minWidth / this.aspectRatio;
18851			pMaxWidth = b.maxHeight * this.aspectRatio;
18852			pMaxHeight = b.maxWidth / this.aspectRatio;
18853
18854			if ( pMinWidth > b.minWidth ) {
18855				b.minWidth = pMinWidth;
18856			}
18857			if ( pMinHeight > b.minHeight ) {
18858				b.minHeight = pMinHeight;
18859			}
18860			if ( pMaxWidth < b.maxWidth ) {
18861				b.maxWidth = pMaxWidth;
18862			}
18863			if ( pMaxHeight < b.maxHeight ) {
18864				b.maxHeight = pMaxHeight;
18865			}
18866		}
18867		this._vBoundaries = b;
18868	},
18869
18870	_updateCache: function( data ) {
18871		this.offset = this.helper.offset();
18872		if ( this._isNumber( data.left ) ) {
18873			this.position.left = data.left;
18874		}
18875		if ( this._isNumber( data.top ) ) {
18876			this.position.top = data.top;
18877		}
18878		if ( this._isNumber( data.height ) ) {
18879			this.size.height = data.height;
18880		}
18881		if ( this._isNumber( data.width ) ) {
18882			this.size.width = data.width;
18883		}
18884	},
18885
18886	_updateRatio: function( data ) {
18887
18888		var cpos = this.position,
18889			csize = this.size,
18890			a = this.axis;
18891
18892		if ( this._isNumber( data.height ) ) {
18893			data.width = ( data.height * this.aspectRatio );
18894		} else if ( this._isNumber( data.width ) ) {
18895			data.height = ( data.width / this.aspectRatio );
18896		}
18897
18898		if ( a === "sw" ) {
18899			data.left = cpos.left + ( csize.width - data.width );
18900			data.top = null;
18901		}
18902		if ( a === "nw" ) {
18903			data.top = cpos.top + ( csize.height - data.height );
18904			data.left = cpos.left + ( csize.width - data.width );
18905		}
18906
18907		return data;
18908	},
18909
18910	_respectSize: function( data ) {
18911
18912		var o = this._vBoundaries,
18913			a = this.axis,
18914			ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ),
18915			ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ),
18916			isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ),
18917			isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ),
18918			dw = this.originalPosition.left + this.originalSize.width,
18919			dh = this.originalPosition.top + this.originalSize.height,
18920			cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a );
18921		if ( isminw ) {
18922			data.width = o.minWidth;
18923		}
18924		if ( isminh ) {
18925			data.height = o.minHeight;
18926		}
18927		if ( ismaxw ) {
18928			data.width = o.maxWidth;
18929		}
18930		if ( ismaxh ) {
18931			data.height = o.maxHeight;
18932		}
18933
18934		if ( isminw && cw ) {
18935			data.left = dw - o.minWidth;
18936		}
18937		if ( ismaxw && cw ) {
18938			data.left = dw - o.maxWidth;
18939		}
18940		if ( isminh && ch ) {
18941			data.top = dh - o.minHeight;
18942		}
18943		if ( ismaxh && ch ) {
18944			data.top = dh - o.maxHeight;
18945		}
18946
18947		// Fixing jump error on top/left - bug #2330
18948		if ( !data.width && !data.height && !data.left && data.top ) {
18949			data.top = null;
18950		} else if ( !data.width && !data.height && !data.top && data.left ) {
18951			data.left = null;
18952		}
18953
18954		return data;
18955	},
18956
18957	_getPaddingPlusBorderDimensions: function( element ) {
18958		var i = 0,
18959			widths = [],
18960			borders = [
18961				element.css( "borderTopWidth" ),
18962				element.css( "borderRightWidth" ),
18963				element.css( "borderBottomWidth" ),
18964				element.css( "borderLeftWidth" )
18965			],
18966			paddings = [
18967				element.css( "paddingTop" ),
18968				element.css( "paddingRight" ),
18969				element.css( "paddingBottom" ),
18970				element.css( "paddingLeft" )
18971			];
18972
18973		for ( ; i < 4; i++ ) {
18974			widths[ i ] = ( parseFloat( borders[ i ] ) || 0 );
18975			widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 );
18976		}
18977
18978		return {
18979			height: widths[ 0 ] + widths[ 2 ],
18980			width: widths[ 1 ] + widths[ 3 ]
18981		};
18982	},
18983
18984	_proportionallyResize: function() {
18985
18986		if ( !this._proportionallyResizeElements.length ) {
18987			return;
18988		}
18989
18990		var prel,
18991			i = 0,
18992			element = this.helper || this.element;
18993
18994		for ( ; i < this._proportionallyResizeElements.length; i++ ) {
18995
18996			prel = this._proportionallyResizeElements[ i ];
18997
18998			// TODO: Seems like a bug to cache this.outerDimensions
18999			// considering that we are in a loop.
19000			if ( !this.outerDimensions ) {
19001				this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
19002			}
19003
19004			prel.css( {
19005				height: ( element.height() - this.outerDimensions.height ) || 0,
19006				width: ( element.width() - this.outerDimensions.width ) || 0
19007			} );
19008
19009		}
19010
19011	},
19012
19013	_renderProxy: function() {
19014
19015		var el = this.element, o = this.options;
19016		this.elementOffset = el.offset();
19017
19018		if ( this._helper ) {
19019
19020			this.helper = this.helper || $( "<div></div>" ).css( { overflow: "hidden" } );
19021
19022			this._addClass( this.helper, this._helper );
19023			this.helper.css( {
19024				width: this.element.outerWidth(),
19025				height: this.element.outerHeight(),
19026				position: "absolute",
19027				left: this.elementOffset.left + "px",
19028				top: this.elementOffset.top + "px",
19029				zIndex: ++o.zIndex //TODO: Don't modify option
19030			} );
19031
19032			this.helper
19033				.appendTo( "body" )
19034				.disableSelection();
19035
19036		} else {
19037			this.helper = this.element;
19038		}
19039
19040	},
19041
19042	_change: {
19043		e: function( event, dx ) {
19044			return { width: this.originalSize.width + dx };
19045		},
19046		w: function( event, dx ) {
19047			var cs = this.originalSize, sp = this.originalPosition;
19048			return { left: sp.left + dx, width: cs.width - dx };
19049		},
19050		n: function( event, dx, dy ) {
19051			var cs = this.originalSize, sp = this.originalPosition;
19052			return { top: sp.top + dy, height: cs.height - dy };
19053		},
19054		s: function( event, dx, dy ) {
19055			return { height: this.originalSize.height + dy };
19056		},
19057		se: function( event, dx, dy ) {
19058			return $.extend( this._change.s.apply( this, arguments ),
19059				this._change.e.apply( this, [ event, dx, dy ] ) );
19060		},
19061		sw: function( event, dx, dy ) {
19062			return $.extend( this._change.s.apply( this, arguments ),
19063				this._change.w.apply( this, [ event, dx, dy ] ) );
19064		},
19065		ne: function( event, dx, dy ) {
19066			return $.extend( this._change.n.apply( this, arguments ),
19067				this._change.e.apply( this, [ event, dx, dy ] ) );
19068		},
19069		nw: function( event, dx, dy ) {
19070			return $.extend( this._change.n.apply( this, arguments ),
19071				this._change.w.apply( this, [ event, dx, dy ] ) );
19072		}
19073	},
19074
19075	_propagate: function( n, event ) {
19076		$.ui.plugin.call( this, n, [ event, this.ui() ] );
19077		if ( n !== "resize" ) {
19078			this._trigger( n, event, this.ui() );
19079		}
19080	},
19081
19082	plugins: {},
19083
19084	ui: function() {
19085		return {
19086			originalElement: this.originalElement,
19087			element: this.element,
19088			helper: this.helper,
19089			position: this.position,
19090			size: this.size,
19091			originalSize: this.originalSize,
19092			originalPosition: this.originalPosition
19093		};
19094	}
19095
19096} );
19097
19098/*
19099 * Resizable Extensions
19100 */
19101
19102$.ui.plugin.add( "resizable", "animate", {
19103
19104	stop: function( event ) {
19105		var that = $( this ).resizable( "instance" ),
19106			o = that.options,
19107			pr = that._proportionallyResizeElements,
19108			ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ),
19109			soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height,
19110			soffsetw = ista ? 0 : that.sizeDiff.width,
19111			style = {
19112				width: ( that.size.width - soffsetw ),
19113				height: ( that.size.height - soffseth )
19114			},
19115			left = ( parseFloat( that.element.css( "left" ) ) +
19116				( that.position.left - that.originalPosition.left ) ) || null,
19117			top = ( parseFloat( that.element.css( "top" ) ) +
19118				( that.position.top - that.originalPosition.top ) ) || null;
19119
19120		that.element.animate(
19121			$.extend( style, top && left ? { top: top, left: left } : {} ), {
19122				duration: o.animateDuration,
19123				easing: o.animateEasing,
19124				step: function() {
19125
19126					var data = {
19127						width: parseFloat( that.element.css( "width" ) ),
19128						height: parseFloat( that.element.css( "height" ) ),
19129						top: parseFloat( that.element.css( "top" ) ),
19130						left: parseFloat( that.element.css( "left" ) )
19131					};
19132
19133					if ( pr && pr.length ) {
19134						$( pr[ 0 ] ).css( { width: data.width, height: data.height } );
19135					}
19136
19137					// Propagating resize, and updating values for each animation step
19138					that._updateCache( data );
19139					that._propagate( "resize", event );
19140
19141				}
19142			}
19143		);
19144	}
19145
19146} );
19147
19148$.ui.plugin.add( "resizable", "containment", {
19149
19150	start: function() {
19151		var element, p, co, ch, cw, width, height,
19152			that = $( this ).resizable( "instance" ),
19153			o = that.options,
19154			el = that.element,
19155			oc = o.containment,
19156			ce = ( oc instanceof $ ) ?
19157				oc.get( 0 ) :
19158				( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
19159
19160		if ( !ce ) {
19161			return;
19162		}
19163
19164		that.containerElement = $( ce );
19165
19166		if ( /document/.test( oc ) || oc === document ) {
19167			that.containerOffset = {
19168				left: 0,
19169				top: 0
19170			};
19171			that.containerPosition = {
19172				left: 0,
19173				top: 0
19174			};
19175
19176			that.parentData = {
19177				element: $( document ),
19178				left: 0,
19179				top: 0,
19180				width: $( document ).width(),
19181				height: $( document ).height() || document.body.parentNode.scrollHeight
19182			};
19183		} else {
19184			element = $( ce );
19185			p = [];
19186			$( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) {
19187				p[ i ] = that._num( element.css( "padding" + name ) );
19188			} );
19189
19190			that.containerOffset = element.offset();
19191			that.containerPosition = element.position();
19192			that.containerSize = {
19193				height: ( element.innerHeight() - p[ 3 ] ),
19194				width: ( element.innerWidth() - p[ 1 ] )
19195			};
19196
19197			co = that.containerOffset;
19198			ch = that.containerSize.height;
19199			cw = that.containerSize.width;
19200			width = ( that._hasScroll( ce, "left" ) ? ce.scrollWidth : cw );
19201			height = ( that._hasScroll( ce ) ? ce.scrollHeight : ch );
19202
19203			that.parentData = {
19204				element: ce,
19205				left: co.left,
19206				top: co.top,
19207				width: width,
19208				height: height
19209			};
19210		}
19211	},
19212
19213	resize: function( event ) {
19214		var woset, hoset, isParent, isOffsetRelative,
19215			that = $( this ).resizable( "instance" ),
19216			o = that.options,
19217			co = that.containerOffset,
19218			cp = that.position,
19219			pRatio = that._aspectRatio || event.shiftKey,
19220			cop = {
19221				top: 0,
19222				left: 0
19223			},
19224			ce = that.containerElement,
19225			continueResize = true;
19226
19227		if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
19228			cop = co;
19229		}
19230
19231		if ( cp.left < ( that._helper ? co.left : 0 ) ) {
19232			that.size.width = that.size.width +
19233				( that._helper ?
19234					( that.position.left - co.left ) :
19235					( that.position.left - cop.left ) );
19236
19237			if ( pRatio ) {
19238				that.size.height = that.size.width / that.aspectRatio;
19239				continueResize = false;
19240			}
19241			that.position.left = o.helper ? co.left : 0;
19242		}
19243
19244		if ( cp.top < ( that._helper ? co.top : 0 ) ) {
19245			that.size.height = that.size.height +
19246				( that._helper ?
19247					( that.position.top - co.top ) :
19248					that.position.top );
19249
19250			if ( pRatio ) {
19251				that.size.width = that.size.height * that.aspectRatio;
19252				continueResize = false;
19253			}
19254			that.position.top = that._helper ? co.top : 0;
19255		}
19256
19257		isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
19258		isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
19259
19260		if ( isParent && isOffsetRelative ) {
19261			that.offset.left = that.parentData.left + that.position.left;
19262			that.offset.top = that.parentData.top + that.position.top;
19263		} else {
19264			that.offset.left = that.element.offset().left;
19265			that.offset.top = that.element.offset().top;
19266		}
19267
19268		woset = Math.abs( that.sizeDiff.width +
19269			( that._helper ?
19270				that.offset.left - cop.left :
19271				( that.offset.left - co.left ) ) );
19272
19273		hoset = Math.abs( that.sizeDiff.height +
19274			( that._helper ?
19275				that.offset.top - cop.top :
19276				( that.offset.top - co.top ) ) );
19277
19278		if ( woset + that.size.width >= that.parentData.width ) {
19279			that.size.width = that.parentData.width - woset;
19280			if ( pRatio ) {
19281				that.size.height = that.size.width / that.aspectRatio;
19282				continueResize = false;
19283			}
19284		}
19285
19286		if ( hoset + that.size.height >= that.parentData.height ) {
19287			that.size.height = that.parentData.height - hoset;
19288			if ( pRatio ) {
19289				that.size.width = that.size.height * that.aspectRatio;
19290				continueResize = false;
19291			}
19292		}
19293
19294		if ( !continueResize ) {
19295			that.position.left = that.prevPosition.left;
19296			that.position.top = that.prevPosition.top;
19297			that.size.width = that.prevSize.width;
19298			that.size.height = that.prevSize.height;
19299		}
19300	},
19301
19302	stop: function() {
19303		var that = $( this ).resizable( "instance" ),
19304			o = that.options,
19305			co = that.containerOffset,
19306			cop = that.containerPosition,
19307			ce = that.containerElement,
19308			helper = $( that.helper ),
19309			ho = helper.offset(),
19310			w = helper.outerWidth() - that.sizeDiff.width,
19311			h = helper.outerHeight() - that.sizeDiff.height;
19312
19313		if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
19314			$( this ).css( {
19315				left: ho.left - cop.left - co.left,
19316				width: w,
19317				height: h
19318			} );
19319		}
19320
19321		if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
19322			$( this ).css( {
19323				left: ho.left - cop.left - co.left,
19324				width: w,
19325				height: h
19326			} );
19327		}
19328	}
19329} );
19330
19331$.ui.plugin.add( "resizable", "alsoResize", {
19332
19333	start: function() {
19334		var that = $( this ).resizable( "instance" ),
19335			o = that.options;
19336
19337		$( o.alsoResize ).each( function() {
19338			var el = $( this );
19339			el.data( "ui-resizable-alsoresize", {
19340				width: parseFloat( el.css( "width" ) ), height: parseFloat( el.css( "height" ) ),
19341				left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
19342			} );
19343		} );
19344	},
19345
19346	resize: function( event, ui ) {
19347		var that = $( this ).resizable( "instance" ),
19348			o = that.options,
19349			os = that.originalSize,
19350			op = that.originalPosition,
19351			delta = {
19352				height: ( that.size.height - os.height ) || 0,
19353				width: ( that.size.width - os.width ) || 0,
19354				top: ( that.position.top - op.top ) || 0,
19355				left: ( that.position.left - op.left ) || 0
19356			};
19357
19358			$( o.alsoResize ).each( function() {
19359				var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {},
19360					css = el.parents( ui.originalElement[ 0 ] ).length ?
19361							[ "width", "height" ] :
19362							[ "width", "height", "top", "left" ];
19363
19364				$.each( css, function( i, prop ) {
19365					var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 );
19366					if ( sum && sum >= 0 ) {
19367						style[ prop ] = sum || null;
19368					}
19369				} );
19370
19371				el.css( style );
19372			} );
19373	},
19374
19375	stop: function() {
19376		$( this ).removeData( "ui-resizable-alsoresize" );
19377	}
19378} );
19379
19380$.ui.plugin.add( "resizable", "ghost", {
19381
19382	start: function() {
19383
19384		var that = $( this ).resizable( "instance" ), cs = that.size;
19385
19386		that.ghost = that.originalElement.clone();
19387		that.ghost.css( {
19388			opacity: 0.25,
19389			display: "block",
19390			position: "relative",
19391			height: cs.height,
19392			width: cs.width,
19393			margin: 0,
19394			left: 0,
19395			top: 0
19396		} );
19397
19398		that._addClass( that.ghost, "ui-resizable-ghost" );
19399
19400		// DEPRECATED
19401		// TODO: remove after 1.12
19402		if ( $.uiBackCompat 
19402=== true && typeof that.options.ghost === "string" ) {
19403
19404			// Ghost option
19405			that.ghost.addClass( this.options.ghost );
19406		}
19407
19408		that.ghost.appendTo( that.helper );
19409
19410	},
19411
19412	resize: function() {
19413		var that = $( this ).resizable( "instance" );
19414		if ( that.ghost ) {
19415			that.ghost.css( {
19416				position: "relative",
19417				height: that.size.height,
vendor: 3,562 bytes, lines 19418-19564
19418				width: that.size.width
19419			} );
19420		}
19421	},
19422
19423	stop: function() {
19424		var that = $( this ).resizable( "instance" );
19425		if ( that.ghost && that.helper ) {
19426			that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) );
19427		}
19428	}
19429
19430} );
19431
19432$.ui.plugin.add( "resizable", "grid", {
19433
19434	resize: function() {
19435		var outerDimensions,
19436			that = $( this ).resizable( "instance" ),
19437			o = that.options,
19438			cs = that.size,
19439			os = that.originalSize,
19440			op = that.originalPosition,
19441			a = that.axis,
19442			grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
19443			gridX = ( grid[ 0 ] || 1 ),
19444			gridY = ( grid[ 1 ] || 1 ),
19445			ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX,
19446			oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY,
19447			newWidth = os.width + ox,
19448			newHeight = os.height + oy,
19449			isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ),
19450			isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ),
19451			isMinWidth = o.minWidth && ( o.minWidth > newWidth ),
19452			isMinHeight = o.minHeight && ( o.minHeight > newHeight );
19453
19454		o.grid = grid;
19455
19456		if ( isMinWidth ) {
19457			newWidth += gridX;
19458		}
19459		if ( isMinHeight ) {
19460			newHeight += gridY;
19461		}
19462		if ( isMaxWidth ) {
19463			newWidth -= gridX;
19464		}
19465		if ( isMaxHeight ) {
19466			newHeight -= gridY;
19467		}
19468
19469		if ( /^(se|s|e)$/.test( a ) ) {
19470			that.size.width = newWidth;
19471			that.size.height = newHeight;
19472		} else if ( /^(ne)$/.test( a ) ) {
19473			that.size.width = newWidth;
19474			that.size.height = newHeight;
19475			that.position.top = op.top - oy;
19476		} else if ( /^(sw)$/.test( a ) ) {
19477			that.size.width = newWidth;
19478			that.size.height = newHeight;
19479			that.position.left = op.left - ox;
19480		} else {
19481			if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) {
19482				outerDimensions = that._getPaddingPlusBorderDimensions( this );
19483			}
19484
19485			if ( newHeight - gridY > 0 ) {
19486				that.size.height = newHeight;
19487				that.position.top = op.top - oy;
19488			} else {
19489				newHeight = gridY - outerDimensions.height;
19490				that.size.height = newHeight;
19491				that.position.top = op.top + os.height - newHeight;
19492			}
19493			if ( newWidth - gridX > 0 ) {
19494				that.size.width = newWidth;
19495				that.position.left = op.left - ox;
19496			} else {
19497				newWidth = gridX - outerDimensions.width;
19498				that.size.width = newWidth;
19499				that.position.left = op.left + os.width - newWidth;
19500			}
19501		}
19502	}
19503
19504} );
19505
19506var widgetsResizable = $.ui.resizable;
19507
19508
19509/*!
19510 * jQuery UI Dialog 1.14.0
19511 * https://jqueryui.com
19512 *
19513 * Copyright OpenJS Foundation and other contributors
19514 * Released under the MIT license.
19515 * https://jquery.org/license
19516 */
19517
19518//>>label: Dialog
19519//>>group: Widgets
19520//>>description: Displays customizable dialog windows.
19521//>>docs: https://api.jqueryui.com/dialog/
19522//>>demos: https://jqueryui.com/dialog/
19523//>>css.structure: ../../themes/base/core.css
19524//>>css.structure: ../../themes/base/dialog.css
19525//>>css.theme: ../../themes/base/theme.css
19526
19527
19528$.widget( "ui.dialog", {
19529	version: "1.14.0",
19530	options: {
19531		appendTo: "body",
19532		autoOpen: true,
19533		buttons: [],
19534		classes: {
19535			"ui-dialog": "ui-corner-all",
19536			"ui-dialog-titlebar": "ui-corner-all"
19537		},
19538		closeOnEscape: true,
19539		closeText: "Close",
19540		draggable: true,
19541		hide: null,
19542		height: "auto",
19543		maxHeight: null,
19544		maxWidth: null,
19545		minHeight: 150,
19546		minWidth: 150,
19547		modal: false,
19548		position: {
19549			my: "center",
19550			at: "center",
19551			of: window,
19552			collision: "fit",
19553
19554			// Ensure the titlebar is always visible
19555			using: function( pos ) {
19556				var topOffset = $( this ).css( pos ).offset().top;
19557				if ( topOffset < 0 ) {
19558					$( this ).css( "top", pos.top - topOffset );
19559				}
19560			}
19561		},
19562		resizable: true,
19563		show: null,
19564		title: null
vendor: 8,955 bytes, lines 19564-19921
19564,
19565		width: 300,
19566
19567		// Callbacks
19568		beforeClose: null,
19569		close: null,
19570		drag: null,
19571		dragStart: null,
19572		dragStop: null,
19573		focus: null,
19574		open: null,
19575		resize: null,
19576		resizeStart: null,
19577		resizeStop: null
19578	},
19579
19580	sizeRelatedOptions: {
19581		buttons: true,
19582		height: true,
19583		maxHeight: true,
19584		maxWidth: true,
19585		minHeight: true,
19586		minWidth: true,
19587		width: true
19588	},
19589
19590	resizableRelatedOptions: {
19591		maxHeight: true,
19592		maxWidth: true,
19593		minHeight: true,
19594		minWidth: true
19595	},
19596
19597	_create: function() {
19598		this.originalCss = {
19599			display: this.element[ 0 ].style.display,
19600			width: this.element[ 0 ].style.width,
19601			minHeight: this.element[ 0 ].style.minHeight,
19602			maxHeight: this.element[ 0 ].style.maxHeight,
19603			height: this.element[ 0 ].style.height
19604		};
19605		this.originalPosition = {
19606			parent: this.element.parent(),
19607			index: this.element.parent().children().index( this.element )
19608		};
19609		this.originalTitle = this.element.attr( "title" );
19610		if ( this.options.title == null && this.originalTitle != null ) {
19611			this.options.title = this.originalTitle;
19612		}
19613
19614		// Dialogs can't be disabled
19615		if ( this.options.disabled ) {
19616			this.options.disabled = false;
19617		}
19618
19619		this._createWrapper();
19620
19621		this.element
19622			.show()
19623			.removeAttr( "title" )
19624			.appendTo( this.uiDialog );
19625
19626		this._addClass( "ui-dialog-content", "ui-widget-content" );
19627
19628		this._createTitlebar();
19629		this._createButtonPane();
19630
19631		if ( this.options.draggable && $.fn.draggable ) {
19632			this._makeDraggable();
19633		}
19634		if ( this.options.resizable && $.fn.resizable ) {
19635			this._makeResizable();
19636		}
19637
19638		this._isOpen = false;
19639
19640		this._trackFocus();
19641	},
19642
19643	_init: function() {
19644		if ( this.options.autoOpen ) {
19645			this.open();
19646		}
19647	},
19648
19649	_appendTo: function() {
19650		var element = this.options.appendTo;
19651		if ( element && ( element.jquery || element.nodeType ) ) {
19652			return $( element );
19653		}
19654		return this.document.find( element || "body" ).eq( 0 );
19655	},
19656
19657	_destroy: function() {
19658		var next,
19659			originalPosition = this.originalPosition;
19660
19661		this._untrackInstance();
19662		this._destroyOverlay();
19663
19664		this.element
19665			.removeUniqueId()
19666			.css( this.originalCss )
19667
19668			// Without detaching first, the following becomes really slow
19669			.detach();
19670
19671		this.uiDialog.remove();
19672
19673		if ( this.originalTitle ) {
19674			this.element.attr( "title", this.originalTitle );
19675		}
19676
19677		next = originalPosition.parent.children().eq( originalPosition.index );
19678
19679		// Don't try to place the dialog next to itself (#8613)
19680		if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
19681			next.before( this.element );
19682		} else {
19683			originalPosition.parent.append( this.element );
19684		}
19685	},
19686
19687	widget: function() {
19688		return this.uiDialog;
19689	},
19690
19691	disable: $.noop,
19692	enable: $.noop,
19693
19694	close: function( event ) {
19695		var that = this;
19696
19697		if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
19698			return;
19699		}
19700
19701		this._isOpen = false;
19702		this._focusedElement = null;
19703		this._destroyOverlay();
19704		this._untrackInstance();
19705
19706		if ( !this.opener.filter( ":focusable" ).trigger( "focus" ).length ) {
19707
19708			// Hiding a focused element doesn't trigger blur in WebKit
19709			// so in case we have nothing to focus on, explicitly blur the active element
19710			// https://bugs.webkit.org/show_bug.cgi?id=47182
19711			$( this.document[ 0 ].activeElement ).trigger( "blur" );
19712		}
19713
19714		this._hide( this.uiDialog, this.options.hide, function() {
19715			that._trigger( "close", event );
19716		} );
19717	},
19718
19719	isOpen: function() {
19720		return this._isOpen;
19721	},
19722
19723	moveToTop: function() {
19724		this._moveToTop();
19725	},
19726
19727	_moveToTop: function( event, silent ) {
19728		var moved = false,
19729			zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map( function() {
19730				return +$( this ).css( "z-index" );
19731			} ).get(),
19732			zIndexMax = Math.max.apply( null, zIndices );
19733
19734		if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
19735			this.uiDialog.css( "z-index", zIndexMax + 1 );
19736			moved = true;
19737		}
19738
19739		if ( moved && !silent ) {
19740			this._trigger( "focus", event );
19741		}
19742		return moved;
19743	},
19744
19745	open: function() {
19746		var that = this;
19747		if ( this._isOpen ) {
19748			if ( this._moveToTop() ) {
19749				this._focusTabbable();
19750			}
19751			return;
19752		}
19753
19754		this._isOpen = true;
19755		this.opener = $( this.document[ 0 ].activeElement );
19756
19757		this._size();
19758		this._position();
19759		this._createOverlay();
19760		this._moveToTop( null, true );
19761
19762		// Ensure the overlay is moved to the top with the dialog, but only when
19763		// opening. The overlay shouldn't move after the dialog is open so that
19764		// modeless dialogs opened after the modal dialog stack properly.
19765		if ( this.overlay ) {
19766			this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
19767		}
19768
19769		this._show( this.uiDialog, this.options.show, function() {
19770			that._focusTabbable();
19771			that._trigger( "focus" );
19772		} );
19773
19774		// Track the dialog immediately upon opening in case a focus event
19775		// somehow occurs outside of the dialog before an element inside the
19776		// dialog is focused (#10152)
19777		this._makeFocusTarget();
19778
19779		this._trigger( "open" );
19780	},
19781
19782	_focusTabbable: function() {
19783
19784		// Set focus to the first match:
19785		// 1. An element that was focused previously
19786		// 2. First element inside the dialog matching [autofocus]
19787		// 3. Tabbable element inside the content element
19788		// 4. Tabbable element inside the buttonpane
19789		// 5. The close button
19790		// 6. The dialog itself
19791		var hasFocus = this._focusedElement;
19792		if ( !hasFocus ) {
19793			hasFocus = this.element.find( "[autofocus]" );
19794		}
19795		if ( !hasFocus.length ) {
19796			hasFocus = this.element.find( ":tabbable" );
19797		}
19798		if ( !hasFocus.length ) {
19799			hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
19800		}
19801		if ( !hasFocus.length ) {
19802			hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
19803		}
19804		if ( !hasFocus.length ) {
19805			hasFocus = this.uiDialog;
19806		}
19807		hasFocus.eq( 0 ).trigger( "focus" );
19808	},
19809
19810	_restoreTabbableFocus: function() {
19811		var activeElement = this.document[ 0 ].activeElement,
19812			isActive = this.uiDialog[ 0 ] === activeElement ||
19813				$.contains( this.uiDialog[ 0 ], activeElement );
19814		if ( !isActive ) {
19815			this._focusTabbable();
19816		}
19817	},
19818
19819	_keepFocus: function( event ) {
19820		event.preventDefault();
19821		this._restoreTabbableFocus();
19822	},
19823
19824	_createWrapper: function() {
19825		this.uiDialog = $( "<div>" )
19826			.hide()
19827			.attr( {
19828
19829				// Setting tabIndex makes the div focusable
19830				tabIndex: -1,
19831				role: "dialog",
19832				"aria-modal": this.options.modal ? "true" : null
19833			} )
19834			.appendTo( this._appendTo() );
19835
19836		this._addClass( this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front" );
19837		this._on( this.uiDialog, {
19838			keydown: function( event ) {
19839				if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
19840						event.keyCode === $.ui.keyCode.ESCAPE ) {
19841					event.preventDefault();
19842					this.close( event );
19843					return;
19844				}
19845
19846				// Prevent tabbing out of dialogs
19847				if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
19848					return;
19849				}
19850				var tabbables = this.uiDialog.find( ":tabbable" ),
19851					first = tabbables.first(),
19852					last = tabbables.last();
19853
19854				if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) &&
19855						!event.shiftKey ) {
19856					this._delay( function() {
19857						first.trigger( "focus" );
19858					} );
19859					event.preventDefault();
19860				} else if ( ( event.target === first[ 0 ] ||
19861						event.target === this.uiDialog[ 0 ] ) && event.shiftKey ) {
19862					this._delay( function() {
19863						last.trigger( "focus" );
19864					} );
19865					event.preventDefault();
19866				}
19867			},
19868			mousedown: function( event ) {
19869				if ( this._moveToTop( event ) ) {
19870					this._focusTabbable();
19871				}
19872			}
19873		} );
19874
19875		// We assume that any existing aria-describedby attribute means
19876		// that the dialog content is marked up properly
19877		// otherwise we brute force the content as the description
19878		if ( !this.element.find( "[aria-describedby]" ).length ) {
19879			this.uiDialog.attr( {
19880				"aria-describedby": this.element.uniqueId().attr( "id" )
19881			} );
19882		}
19883	},
19884
19885	_createTitlebar: function() {
19886		var uiDialogTitle;
19887
19888		this.uiDialogTitlebar = $( "<div>" );
19889		this._addClass( this.uiDialogTitlebar,
19890			"ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix" );
19891		this._on( this.uiDialogTitlebar, {
19892			mousedown: function( event ) {
19893
19894				// Don't prevent click on close button (#8838)
19895				// Focusing a dialog that is partially scrolled out of view
19896				// causes the browser to scroll it into view, preventing the click event
19897				if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
19898
19899					// Dialog isn't getting focus when dragging (#8063)
19900					this.uiDialog.trigger( "focus" );
19901				}
19902			}
19903		} );
19904
19905		this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
19906			.button( {
19907				label: $( "<a>" ).text( this.options.closeText ).html(),
19908				icon: "ui-icon-closethick",
19909				showLabel: false
19910			} )
19911			.appendTo( this.uiDialogTitlebar );
19912
19913		this._addClass( this.uiDialogTitlebarClose, "ui-dialog-titlebar-close" );
19914		this._on( this.uiDialogTitlebarClose, {
19915			click: function( event ) {
19916				event.preventDefault();
19917				this.close( event );
19918			}
19919		} );
19920
19921		
vendor: 12,822 bytes, lines 19921-20437
19921uiDialogTitle = $( "<span>" ).uniqueId().prependTo( this.uiDialogTitlebar );
19922		this._addClass( uiDialogTitle, "ui-dialog-title" );
19923		this._title( uiDialogTitle );
19924
19925		this.uiDialogTitlebar.prependTo( this.uiDialog );
19926
19927		this.uiDialog.attr( {
19928			"aria-labelledby": uiDialogTitle.attr( "id" )
19929		} );
19930	},
19931
19932	_title: function( title ) {
19933		if ( this.options.title ) {
19934			title.text( this.options.title );
19935		} else {
19936			title.html( "&#160;" );
19937		}
19938	},
19939
19940	_createButtonPane: function() {
19941		this.uiDialogButtonPane = $( "<div>" );
19942		this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane",
19943			"ui-widget-content ui-helper-clearfix" );
19944
19945		this.uiButtonSet = $( "<div>" )
19946			.appendTo( this.uiDialogButtonPane );
19947		this._addClass( this.uiButtonSet, "ui-dialog-buttonset" );
19948
19949		this._createButtons();
19950	},
19951
19952	_createButtons: function() {
19953		var that = this,
19954			buttons = this.options.buttons;
19955
19956		// If we already have a button pane, remove it
19957		this.uiDialogButtonPane.remove();
19958		this.uiButtonSet.empty();
19959
19960		if ( $.isEmptyObject( buttons ) || ( Array.isArray( buttons ) && !buttons.length ) ) {
19961			this._removeClass( this.uiDialog, "ui-dialog-buttons" );
19962			return;
19963		}
19964
19965		$.each( buttons, function( name, props ) {
19966			var click, buttonOptions;
19967			props = typeof props === "function" ?
19968				{ click: props, text: name } :
19969				props;
19970
19971			// Default to a non-submitting button
19972			props = $.extend( { type: "button" }, props );
19973
19974			// Change the context for the click callback to be the main element
19975			click = props.click;
19976			buttonOptions = {
19977				icon: props.icon,
19978				iconPosition: props.iconPosition,
19979				showLabel: props.showLabel,
19980
19981				// Deprecated options
19982				icons: props.icons,
19983				text: props.text
19984			};
19985
19986			delete props.click;
19987			delete props.icon;
19988			delete props.iconPosition;
19989			delete props.showLabel;
19990
19991			// Deprecated options
19992			delete props.icons;
19993			if ( typeof props.text === "boolean" ) {
19994				delete props.text;
19995			}
19996
19997			$( "<button></button>", props )
19998				.button( buttonOptions )
19999				.appendTo( that.uiButtonSet )
20000				.on( "click", function() {
20001					click.apply( that.element[ 0 ], arguments );
20002				} );
20003		} );
20004		this._addClass( this.uiDialog, "ui-dialog-buttons" );
20005		this.uiDialogButtonPane.appendTo( this.uiDialog );
20006	},
20007
20008	_makeDraggable: function() {
20009		var that = this,
20010			options = this.options;
20011
20012		function filteredUi( ui ) {
20013			return {
20014				position: ui.position,
20015				offset: ui.offset
20016			};
20017		}
20018
20019		this.uiDialog.draggable( {
20020			cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
20021			handle: ".ui-dialog-titlebar",
20022			containment: "document",
20023			start: function( event, ui ) {
20024				that._addClass( $( this ), "ui-dialog-dragging" );
20025				that._blockFrames();
20026				that._trigger( "dragStart", event, filteredUi( ui ) );
20027			},
20028			drag: function( event, ui ) {
20029				that._trigger( "drag", event, filteredUi( ui ) );
20030			},
20031			stop: function( event, ui ) {
20032				var left = ui.offset.left - that.document.scrollLeft(),
20033					top = ui.offset.top - that.document.scrollTop();
20034
20035				options.position = {
20036					my: "left top",
20037					at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
20038						"top" + ( top >= 0 ? "+" : "" ) + top,
20039					of: that.window
20040				};
20041				that._removeClass( $( this ), "ui-dialog-dragging" );
20042				that._unblockFrames();
20043				that._trigger( "dragStop", event, filteredUi( ui ) );
20044			}
20045		} );
20046	},
20047
20048	_makeResizable: function() {
20049		var that = this,
20050			options = this.options,
20051			handles = options.resizable,
20052
20053			// .ui-resizable has position: relative defined in the stylesheet
20054			// but dialogs have to use absolute or fixed positioning
20055			position = this.uiDialog.css( "position" ),
20056			resizeHandles = typeof handles === "string" ?
20057				handles :
20058				"n,e,s,w,se,sw,ne,nw";
20059
20060		function filteredUi( ui ) {
20061			return {
20062				originalPosition: ui.originalPosition,
20063				originalSize: ui.originalSize,
20064				position: ui.position,
20065				size: ui.size
20066			};
20067		}
20068
20069		this.uiDialog.resizable( {
20070			cancel: ".ui-dialog-content",
20071			containment: "document",
20072			alsoResize: this.element,
20073			maxWidth: options.maxWidth,
20074			maxHeight: options.maxHeight,
20075			minWidth: options.minWidth,
20076			minHeight: this._minHeight(),
20077			handles: resizeHandles,
20078			start: function( event, ui ) {
20079				that._addClass( $( this ), "ui-dialog-resizing" );
20080				that._blockFrames();
20081				that._trigger( "resizeStart", event, filteredUi( ui ) );
20082			},
20083			resize: function( event, ui ) {
20084				that._trigger( "resize", event, filteredUi( ui ) );
20085			},
20086			stop: function( event, ui ) {
20087				var offset = that.uiDialog.offset(),
20088					left = offset.left - that.document.scrollLeft(),
20089					top = offset.top - that.document.scrollTop();
20090
20091				options.height = that.uiDialog.height();
20092				options.width = that.uiDialog.width();
20093				options.position = {
20094					my: "left top",
20095					at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
20096						"top" + ( top >= 0 ? "+" : "" ) + top,
20097					of: that.window
20098				};
20099				that._removeClass( $( this ), "ui-dialog-resizing" );
20100				that._unblockFrames();
20101				that._trigger( "resizeStop", event, filteredUi( ui ) );
20102			}
20103		} )
20104			.css( "position", position );
20105	},
20106
20107	_trackFocus: function() {
20108		this._on( this.widget(), {
20109			focusin: function( event ) {
20110				this._makeFocusTarget();
20111				this._focusedElement = $( event.target );
20112			}
20113		} );
20114	},
20115
20116	_makeFocusTarget: function() {
20117		this._untrackInstance();
20118		this._trackingInstances().unshift( this );
20119	},
20120
20121	_untrackInstance: function() {
20122		var instances = this._trackingInstances(),
20123			exists = $.inArray( this, instances );
20124		if ( exists !== -1 ) {
20125			instances.splice( exists, 1 );
20126		}
20127	},
20128
20129	_trackingInstances: function() {
20130		var instances = this.document.data( "ui-dialog-instances" );
20131		if ( !instances ) {
20132			instances = [];
20133			this.document.data( "ui-dialog-instances", instances );
20134		}
20135		return instances;
20136	},
20137
20138	_minHeight: function() {
20139		var options = this.options;
20140
20141		return options.height === "auto" ?
20142			options.minHeight :
20143			Math.min( options.minHeight, options.height );
20144	},
20145
20146	_position: function() {
20147
20148		// Need to show the dialog to get the actual offset in the position plugin
20149		var isVisible = this.uiDialog.is( ":visible" );
20150		if ( !isVisible ) {
20151			this.uiDialog.show();
20152		}
20153		this.uiDialog.position( this.options.position );
20154		if ( !isVisible ) {
20155			this.uiDialog.hide();
20156		}
20157	},
20158
20159	_setOptions: function( options ) {
20160		var that = this,
20161			resize = false,
20162			resizableOptions = {};
20163
20164		$.each( options, function( key, value ) {
20165			that._setOption( key, value );
20166
20167			if ( key in that.sizeRelatedOptions ) {
20168				resize = true;
20169			}
20170			if ( key in that.resizableRelatedOptions ) {
20171				resizableOptions[ key ] = value;
20172			}
20173		} );
20174
20175		if ( resize ) {
20176			this._size();
20177			this._position();
20178		}
20179		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
20180			this.uiDialog.resizable( "option", resizableOptions );
20181		}
20182	},
20183
20184	_setOption: function( key, value ) {
20185		var isDraggable, isResizable,
20186			uiDialog = this.uiDialog;
20187
20188		if ( key === "disabled" ) {
20189			return;
20190		}
20191
20192		this._super( key, value );
20193
20194		if ( key === "appendTo" ) {
20195			this.uiDialog.appendTo( this._appendTo() );
20196		}
20197
20198		if ( key === "buttons" ) {
20199			this._createButtons();
20200		}
20201
20202		if ( key === "closeText" ) {
20203			this.uiDialogTitlebarClose.button( {
20204
20205				// Ensure that we always pass a string
20206				label: $( "<a>" ).text( "" + this.options.closeText ).html()
20207			} );
20208		}
20209
20210		if ( key === "draggable" ) {
20211			isDraggable = uiDialog.is( ":data(ui-draggable)" );
20212			if ( isDraggable && !value ) {
20213				uiDialog.draggable( "destroy" );
20214			}
20215
20216			if ( !isDraggable && value ) {
20217				this._makeDraggable();
20218			}
20219		}
20220
20221		if ( key === "position" ) {
20222			this._position();
20223		}
20224
20225		if ( key === "resizable" ) {
20226
20227			// currently resizable, becoming non-resizable
20228			isResizable = uiDialog.is( ":data(ui-resizable)" );
20229			if ( isResizable && !value ) {
20230				uiDialog.resizable( "destroy" );
20231			}
20232
20233			// Currently resizable, changing handles
20234			if ( isResizable && typeof value === "string" ) {
20235				uiDialog.resizable( "option", "handles", value );
20236			}
20237
20238			// Currently non-resizable, becoming resizable
20239			if ( !isResizable && value !== false ) {
20240				this._makeResizable();
20241			}
20242		}
20243
20244		if ( key === "title" ) {
20245			this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
20246		}
20247
20248		if ( key === "modal" ) {
20249			uiDialog.attr( "aria-modal", value ? "true" : null );
20250		}
20251	},
20252
20253	_size: function() {
20254
20255		// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
20256		// divs will both have width and height set, so we need to reset them
20257		var nonContentHeight, minContentHeight, maxContentHeight,
20258			options = this.options;
20259
20260		// Reset content sizing
20261		this.element.show().css( {
20262			width: "auto",
20263			minHeight: 0,
20264			maxHeight: "none",
20265			height: 0
20266		} );
20267
20268		if ( options.minWidth > options.width ) {
20269			options.width = options.minWidth;
20270		}
20271
20272		// Reset wrapper sizing
20273		// determine the height of all the non-content elements
20274		nonContentHeight = this.uiDialog.css( {
20275			height: "auto",
20276			width: options.width
20277		} )
20278			.outerHeight();
20279		minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
20280		maxContentHeight = typeof options.maxHeight === "number" ?
20281			Math.max( 0, options.maxHeight - nonContentHeight ) :
20282			"none";
20283
20284		if ( options.height === "auto" ) {
20285			this.element.css( {
20286				minHeight: minContentHeight,
20287				maxHeight: maxContentHeight,
20288				height: "auto"
20289			} );
20290		} else {
20291			this.element.height( Math.max( 0, options.height - nonContentHeight ) );
20292		}
20293
20294		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
20295			this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
20296		}
20297	},
20298
20299	_blockFrames: function() {
20300		this.iframeBlocks = this.document.find( "iframe" ).map( function() {
20301			var iframe = $( this );
20302
20303			return $( "<div>" )
20304				.css( {
20305					position: "absolute",
20306					width: iframe.outerWidth(),
20307					height: iframe.outerHeight()
20308				} )
20309				.appendTo( iframe.parent() )
20310				.offset( iframe.offset() )[ 0 ];
20311		} );
20312	},
20313
20314	_unblockFrames: function() {
20315		if ( this.iframeBlocks ) {
20316			this.iframeBlocks.remove();
20317			delete this.iframeBlocks;
20318		}
20319	},
20320
20321	_allowInteraction: function( event ) {
20322		if ( $( event.target ).closest( ".ui-dialog" ).length ) {
20323			return true;
20324		}
20325
20326		// TODO: Remove hack when datepicker implements
20327		// the .ui-front logic (#8989)
20328		return !!$( event.target ).closest( ".ui-datepicker" ).length;
20329	},
20330
20331	_createOverlay: function() {
20332		if ( !this.options.modal ) {
20333			return;
20334		}
20335
20336		// We use a delay in case the overlay is created from an
20337		// event that we're going to be cancelling (#2804)
20338		var isOpening = true;
20339		this._delay( function() {
20340			isOpening = false;
20341		} );
20342
20343		if ( !this.document.data( "ui-dialog-overlays" ) ) {
20344
20345			// Prevent use of anchors and inputs
20346			// This doesn't use `_on()` because it is a shared event handler
20347			// across all open modal dialogs.
20348			this.document.on( "focusin.ui-dialog", function( event ) {
20349				if ( isOpening ) {
20350					return;
20351				}
20352
20353				var instance = this._trackingInstances()[ 0 ];
20354				if ( !instance._allowInteraction( event ) ) {
20355					event.preventDefault();
20356					instance._focusTabbable();
20357				}
20358			}.bind( this ) );
20359		}
20360
20361		this.overlay = $( "<div>" )
20362			.appendTo( this._appendTo() );
20363
20364		this._addClass( this.overlay, null, "ui-widget-overlay ui-front" );
20365		this._on( this.overlay, {
20366			mousedown: "_keepFocus"
20367		} );
20368		this.document.data( "ui-dialog-overlays",
20369			( this.document.data( "ui-dialog-overlays" ) || 0 ) + 1 );
20370	},
20371
20372	_destroyOverlay: function() {
20373		if ( !this.options.modal ) {
20374			return;
20375		}
20376
20377		if ( this.overlay ) {
20378			var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
20379
20380			if ( !overlays ) {
20381				this.document.off( "focusin.ui-dialog" );
20382				this.document.removeData( "ui-dialog-overlays" );
20383			} else {
20384				this.document.data( "ui-dialog-overlays", overlays );
20385			}
20386
20387			this.overlay.remove();
20388			this.overlay = null;
20389		}
20390	}
20391} );
20392
20393// DEPRECATED
20394// TODO: switch return back to widget declaration at top of file when this is removed
20395if ( $.uiBackCompat === true ) {
20396
20397	// Backcompat for dialogClass option
20398	$.widget( "ui.dialog", $.ui.dialog, {
20399		options: {
20400			dialogClass: ""
20401		},
20402		_createWrapper: function() {
20403			this._super();
20404			this.uiDialog.addClass( this.options.dialogClass );
20405		},
20406		_setOption: function( key, value ) {
20407			if ( key === "dialogClass" ) {
20408				this.uiDialog
20409					.removeClass( this.options.dialogClass )
20410					.addClass( value );
20411			}
20412			this._superApply( arguments );
20413		}
20414	} );
20415}
20416
20417var widgetsDialog = $.ui.dialog;
20418
20419
20420/*!
20421 * jQuery UI Droppable 1.14.0
20422 * https://jqueryui.com
20423 *
20424 * Copyright OpenJS Foundation and other contributors
20425 * Released under the MIT license.
20426 * https://jquery.org/license
20427 */
20428
20429//>>label: Droppable
20430//>>group: Interactions
20431//>>description: Enables drop targets for draggable elements.
20432//>>docs: https://api.jqueryui.com/droppable/
20433//>>demos: https://jqueryui.com/droppable/
20434
20435
20436$.widget( "ui.droppable", {
20437	version: "1.14.0
vendor: 11,311 bytes, lines 20437-20865
20437",
20438	widgetEventPrefix: "drop",
20439	options: {
20440		accept: "*",
20441		addClasses: true,
20442		greedy: false,
20443		scope: "default",
20444		tolerance: "intersect",
20445
20446		// Callbacks
20447		activate: null,
20448		deactivate: null,
20449		drop: null,
20450		out: null,
20451		over: null
20452	},
20453	_create: function() {
20454
20455		var proportions,
20456			o = this.options,
20457			accept = o.accept;
20458
20459		this.isover = false;
20460		this.isout = true;
20461
20462		this.accept = typeof accept === "function" ? accept : function( d ) {
20463			return d.is( accept );
20464		};
20465
20466		this.proportions = function( /* valueToWrite */ ) {
20467			if ( arguments.length ) {
20468
20469				// Store the droppable's proportions
20470				proportions = arguments[ 0 ];
20471			} else {
20472
20473				// Retrieve or derive the droppable's proportions
20474				return proportions ?
20475					proportions :
20476					proportions = {
20477						width: this.element[ 0 ].offsetWidth,
20478						height: this.element[ 0 ].offsetHeight
20479					};
20480			}
20481		};
20482
20483		this._addToManager( o.scope );
20484
20485		if ( o.addClasses ) {
20486			this._addClass( "ui-droppable" );
20487		}
20488
20489	},
20490
20491	_addToManager: function( scope ) {
20492
20493		// Add the reference and positions to the manager
20494		$.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
20495		$.ui.ddmanager.droppables[ scope ].push( this );
20496	},
20497
20498	_splice: function( drop ) {
20499		var i = 0;
20500		for ( ; i < drop.length; i++ ) {
20501			if ( drop[ i ] === this ) {
20502				drop.splice( i, 1 );
20503			}
20504		}
20505	},
20506
20507	_destroy: function() {
20508		var drop = $.ui.ddmanager.droppables[ this.options.scope ];
20509
20510		this._splice( drop );
20511	},
20512
20513	_setOption: function( key, value ) {
20514
20515		if ( key === "accept" ) {
20516			this.accept = typeof value === "function" ? value : function( d ) {
20517				return d.is( value );
20518			};
20519		} else if ( key === "scope" ) {
20520			var drop = $.ui.ddmanager.droppables[ this.options.scope ];
20521
20522			this._splice( drop );
20523			this._addToManager( value );
20524		}
20525
20526		this._super( key, value );
20527	},
20528
20529	_activate: function( event ) {
20530		var draggable = $.ui.ddmanager.current;
20531
20532		this._addActiveClass();
20533		if ( draggable ) {
20534			this._trigger( "activate", event, this.ui( draggable ) );
20535		}
20536	},
20537
20538	_deactivate: function( event ) {
20539		var draggable = $.ui.ddmanager.current;
20540
20541		this._removeActiveClass();
20542		if ( draggable ) {
20543			this._trigger( "deactivate", event, this.ui( draggable ) );
20544		}
20545	},
20546
20547	_over: function( event ) {
20548
20549		var draggable = $.ui.ddmanager.current;
20550
20551		// Bail if draggable and droppable are same element
20552		if ( !draggable || ( draggable.currentItem ||
20553				draggable.element )[ 0 ] === this.element[ 0 ] ) {
20554			return;
20555		}
20556
20557		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
20558				draggable.element ) ) ) {
20559			this._addHoverClass();
20560			this._trigger( "over", event, this.ui( draggable ) );
20561		}
20562
20563	},
20564
20565	_out: function( event ) {
20566
20567		var draggable = $.ui.ddmanager.current;
20568
20569		// Bail if draggable and droppable are same element
20570		if ( !draggable || ( draggable.currentItem ||
20571				draggable.element )[ 0 ] === this.element[ 0 ] ) {
20572			return;
20573		}
20574
20575		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
20576				draggable.element ) ) ) {
20577			this._removeHoverClass();
20578			this._trigger( "out", event, this.ui( draggable ) );
20579		}
20580
20581	},
20582
20583	_drop: function( event, custom ) {
20584
20585		var draggable = custom || $.ui.ddmanager.current,
20586			childrenIntersection = false;
20587
20588		// Bail if draggable and droppable are same element
20589		if ( !draggable || ( draggable.currentItem ||
20590				draggable.element )[ 0 ] === this.element[ 0 ] ) {
20591			return false;
20592		}
20593
20594		this.element
20595			.find( ":data(ui-droppable)" )
20596			.not( ".ui-draggable-dragging" )
20597			.each( function() {
20598				var inst = $( this ).droppable( "instance" );
20599				if (
20600					inst.options.greedy &&
20601					!inst.options.disabled &&
20602					inst.options.scope === draggable.options.scope &&
20603					inst.accept.call(
20604						inst.element[ 0 ], ( draggable.currentItem || draggable.element )
20605					) &&
20606					$.ui.intersect(
20607						draggable,
20608						$.extend( inst, { offset: inst.element.offset() } ),
20609						inst.options.tolerance, event
20610					)
20611				) {
20612					childrenIntersection = true;
20613					return false;
20614				}
20615			} );
20616		if ( childrenIntersection ) {
20617			return false;
20618		}
20619
20620		if ( this.accept.call( this.element[ 0 ],
20621				( draggable.currentItem || draggable.element ) ) ) {
20622			this._removeActiveClass();
20623			this._removeHoverClass();
20624
20625			this._trigger( "drop", event, this.ui( draggable ) );
20626			return this.element;
20627		}
20628
20629		return false;
20630
20631	},
20632
20633	ui: function( c ) {
20634		return {
20635			draggable: ( c.currentItem || c.element ),
20636			helper: c.helper,
20637			position: c.position,
20638			offset: c.positionAbs
20639		};
20640	},
20641
20642	// Extension points just to make backcompat sane and avoid duplicating logic
20643	// TODO: Remove in 1.14 along with call to it below
20644	_addHoverClass: function() {
20645		this._addClass( "ui-droppable-hover" );
20646	},
20647
20648	_removeHoverClass: function() {
20649		this._removeClass( "ui-droppable-hover" );
20650	},
20651
20652	_addActiveClass: function() {
20653		this._addClass( "ui-droppable-active" );
20654	},
20655
20656	_removeActiveClass: function() {
20657		this._removeClass( "ui-droppable-active" );
20658	}
20659} );
20660
20661$.ui.intersect = ( function() {
20662	function isOverAxis( x, reference, size ) {
20663		return ( x >= reference ) && ( x < ( reference + size ) );
20664	}
20665
20666	return function( draggable, droppable, toleranceMode, event ) {
20667
20668		if ( !droppable.offset ) {
20669			return false;
20670		}
20671
20672		var x1 = ( draggable.positionAbs ||
20673				draggable.position.absolute ).left + draggable.margins.left,
20674			y1 = ( draggable.positionAbs ||
20675				draggable.position.absolute ).top + draggable.margins.top,
20676			x2 = x1 + draggable.helperProportions.width,
20677			y2 = y1 + draggable.helperProportions.height,
20678			l = droppable.offset.left,
20679			t = droppable.offset.top,
20680			r = l + droppable.proportions().width,
20681			b = t + droppable.proportions().height;
20682
20683		switch ( toleranceMode ) {
20684		case "fit":
20685			return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
20686		case "intersect":
20687			return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
20688				x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
20689				t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
20690				y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
20691		case "pointer":
20692			return isOverAxis( event.pageY, t, droppable.proportions().height ) &&
20693				isOverAxis( event.pageX, l, droppable.proportions().width );
20694		case "touch":
20695			return (
20696				( y1 >= t && y1 <= b ) || // Top edge touching
20697				( y2 >= t && y2 <= b ) || // Bottom edge touching
20698				( y1 < t && y2 > b ) // Surrounded vertically
20699			) && (
20700				( x1 >= l && x1 <= r ) || // Left edge touching
20701				( x2 >= l && x2 <= r ) || // Right edge touching
20702				( x1 < l && x2 > r ) // Surrounded horizontally
20703			);
20704		default:
20705			return false;
20706		}
20707	};
20708} )();
20709
20710/*
20711	This manager tracks offsets of draggables and droppables
20712*/
20713$.ui.ddmanager = {
20714	current: null,
20715	droppables: { "default": [] },
20716	prepareOffsets: function( t, event ) {
20717
20718		var i, j,
20719			m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
20720			type = event ? event.type : null, // workaround for #2317
20721			list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
20722
20723		droppablesLoop: for ( i = 0; i < m.length; i++ ) {
20724
20725			// No disabled and non-accepted
20726			if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ],
20727					( t.currentItem || t.element ) ) ) ) {
20728				continue;
20729			}
20730
20731			// Filter out elements in the current dragged item
20732			for ( j = 0; j < list.length; j++ ) {
20733				if ( list[ j ] === m[ i ].element[ 0 ] ) {
20734					m[ i ].proportions().height = 0;
20735					continue droppablesLoop;
20736				}
20737			}
20738
20739			m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
20740			if ( !m[ i ].visible ) {
20741				continue;
20742			}
20743
20744			// Activate the droppable if used directly from draggables
20745			if ( type === "mousedown" ) {
20746				m[ i ]._activate.call( m[ i ], event );
20747			}
20748
20749			m[ i ].offset = m[ i ].element.offset();
20750			m[ i ].proportions( {
20751				width: m[ i ].element[ 0 ].offsetWidth,
20752				height: m[ i ].element[ 0 ].offsetHeight
20753			} );
20754
20755		}
20756
20757	},
20758	drop: function( draggable, event ) {
20759
20760		var dropped = false;
20761
20762		// Create a copy of the droppables in case the list changes during the drop (#9116)
20763		$.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
20764
20765			if ( !this.options ) {
20766				return;
20767			}
20768			if ( !this.options.disabled && this.visible &&
20769					$.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
20770				dropped = this._drop.call( this, event ) || dropped;
20771			}
20772
20773			if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ],
20774					( draggable.currentItem || draggable.element ) ) ) {
20775				this.isout = true;
20776				this.isover = false;
20777				this._deactivate.call( this, event );
20778			}
20779
20780		} );
20781		return dropped;
20782
20783	},
20784	dragStart: function( draggable, event ) {
20785
20786		// Listen for scrolling so that if the dragging causes scrolling the position of the
20787		// droppables can be recalculated (see #5003)
20788		draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() {
20789			if ( !draggable.options.refreshPositions ) {
20790				$.ui.ddmanager.prepareOffsets( draggable, event );
20791			}
20792		} );
20793	},
20794	drag: function( draggable, event ) {
20795
20796		// If you have a highly dynamic page, you might try this option. It renders positions
20797		// every time you move the mouse.
20798		if ( draggable.options.refreshPositions ) {
20799			$.ui.ddmanager.prepareOffsets( draggable, event );
20800		}
20801
20802		// Run through all droppables and check their positions based on specific tolerance options
20803		$.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
20804
20805			if ( this.options.disabled || this.greedyChild || !this.visible ) {
20806				return;
20807			}
20808
20809			var parentInstance, scope, parent,
20810				intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
20811				c = !intersects && this.isover ?
20812					"isout" :
20813					( intersects && !this.isover ? "isover" : null );
20814			if ( !c ) {
20815				return;
20816			}
20817
20818			if ( this.options.greedy ) {
20819
20820				// find droppable parents with same scope
20821				scope = this.options.scope;
20822				parent = this.element.parents( ":data(ui-droppable)" ).filter( function() {
20823					return $( this ).droppable( "instance" ).options.scope === scope;
20824				} );
20825
20826				if ( parent.length ) {
20827					parentInstance = $( parent[ 0 ] ).droppable( "instance" );
20828					parentInstance.greedyChild = ( c === "isover" );
20829				}
20830			}
20831
20832			// We just moved into a greedy child
20833			if ( parentInstance && c === "isover" ) {
20834				parentInstance.isover = false;
20835				parentInstance.isout = true;
20836				parentInstance._out.call( parentInstance, event );
20837			}
20838
20839			this[ c ] = true;
20840			this[ c === "isout" ? "isover" : "isout" ] = false;
20841			this[ c === "isover" ? "_over" : "_out" ].call( this, event );
20842
20843			// We just moved out of a greedy child
20844			if ( parentInstance && c === "isout" ) {
20845				parentInstance.isout = false;
20846				parentInstance.isover = true;
20847				parentInstance._over.call( parentInstance, event );
20848			}
20849		} );
20850
20851	},
20852	dragStop: function( draggable, event ) {
20853		draggable.element.parentsUntil( "body" ).off( "scroll.droppable" );
20854
20855		// Call prepareOffsets one final time since IE does not fire return scroll events when
20856		// overflow was caused by drag (see #5003)
20857		if ( !draggable.options.refreshPositions ) {
20858			$.ui.ddmanager.prepareOffsets( draggable, event );
20859		}
20860	}
20861};
20862
20863// DEPRECATED
20864// TODO: switch return back to widget declaration at top of file when this is removed
20865if ( $.uiBackCompat 
20865=== true ) {
20866
20867	// Backcompat for activeClass and hoverClass options
20868	$.widget( "ui.droppable", $.ui.droppable, {
20869		options: {
20870			hoverClass: false,
20871			activeClass: false
20872		},
20873		_addActiveClass: function() {
20874			this._super();
20875			if ( this.options.activeClass ) {
20876				this.element.addClass( this.options.activeClass );
20877			}
20878		},
20879		_removeActiveClass: function() {
20880			this._super();
20881			if ( this.options.activeClass ) {
20882				this.element.removeClass( this.options.activeClass );
20883			}
20884		},
20885		_addHoverClass: function() {
20886			this._super();
20887			if ( this.options.hoverClass ) {
20888				this.element.addClass( this.options.hoverClass );
20889			}
20890		},
20891		_removeHoverClass: function() {
20892			this._super();
20893			if ( this.options.hoverClass ) {
20894				this.element.removeClass( this.options.hoverClass );
20895			}
20896		}
20897	} );
20898}
20899
20900var widgetsDroppable = $.ui.droppable;
20901
20902
20903/*!
20904 * jQuery UI Progressbar 1.14.0
20905 * https://jqueryui.com
20906 *
20907 * Copyright OpenJS Foundation and other contributors
20908 * Released under the MIT license.
20909 * https://jquery.org/license
20910 */
20911
20912//>>label: Progressbar
20913//>>group: Widgets
20914/* eslint-disable max-len */
20915//>>
vendor: 4,223 bytes, lines 20915-21084
20915description: Displays a status indicator for loading state, standard percentage, and other progress indicators.
20916/* eslint-enable max-len */
20917//>>docs: https://api.jqueryui.com/progressbar/
20918//>>demos: https://jqueryui.com/progressbar/
20919//>>css.structure: ../../themes/base/core.css
20920//>>css.structure: ../../themes/base/progressbar.css
20921//>>css.theme: ../../themes/base/theme.css
20922
20923
20924var widgetsProgressbar = $.widget( "ui.progressbar", {
20925	version: "1.14.0",
20926	options: {
20927		classes: {
20928			"ui-progressbar": "ui-corner-all",
20929			"ui-progressbar-value": "ui-corner-left",
20930			"ui-progressbar-complete": "ui-corner-right"
20931		},
20932		max: 100,
20933		value: 0,
20934
20935		change: null,
20936		complete: null
20937	},
20938
20939	min: 0,
20940
20941	_create: function() {
20942
20943		// Constrain initial value
20944		this.oldValue = this.options.value = this._constrainedValue();
20945
20946		this.element.attr( {
20947
20948			// Only set static values; aria-valuenow and aria-valuemax are
20949			// set inside _refreshValue()
20950			role: "progressbar",
20951			"aria-valuemin": this.min
20952		} );
20953		this._addClass( "ui-progressbar", "ui-widget ui-widget-content" );
20954
20955		this.valueDiv = $( "<div>" ).appendTo( this.element );
20956		this._addClass( this.valueDiv, "ui-progressbar-value", "ui-widget-header" );
20957		this._refreshValue();
20958	},
20959
20960	_destroy: function() {
20961		this.element.removeAttr( "role aria-valuemin aria-valuemax aria-valuenow" );
20962
20963		this.valueDiv.remove();
20964	},
20965
20966	value: function( newValue ) {
20967		if ( newValue === undefined ) {
20968			return this.options.value;
20969		}
20970
20971		this.options.value = this._constrainedValue( newValue );
20972		this._refreshValue();
20973	},
20974
20975	_constrainedValue: function( newValue ) {
20976		if ( newValue === undefined ) {
20977			newValue = this.options.value;
20978		}
20979
20980		this.indeterminate = newValue === false;
20981
20982		// Sanitize value
20983		if ( typeof newValue !== "number" ) {
20984			newValue = 0;
20985		}
20986
20987		return this.indeterminate ? false :
20988			Math.min( this.options.max, Math.max( this.min, newValue ) );
20989	},
20990
20991	_setOptions: function( options ) {
20992
20993		// Ensure "value" option is set after other values (like max)
20994		var value = options.value;
20995		delete options.value;
20996
20997		this._super( options );
20998
20999		this.options.value = this._constrainedValue( value );
21000		this._refreshValue();
21001	},
21002
21003	_setOption: function( key, value ) {
21004		if ( key === "max" ) {
21005
21006			// Don't allow a max less than min
21007			value = Math.max( this.min, value );
21008		}
21009		this._super( key, value );
21010	},
21011
21012	_setOptionDisabled: function( value ) {
21013		this._super( value );
21014
21015		this.element.attr( "aria-disabled", value );
21016		this._toggleClass( null, "ui-state-disabled", !!value );
21017	},
21018
21019	_percentage: function() {
21020		return this.indeterminate ?
21021			100 :
21022			100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
21023	},
21024
21025	_refreshValue: function() {
21026		var value = this.options.value,
21027			percentage = this._percentage();
21028
21029		this.valueDiv
21030			.toggle( this.indeterminate || value > this.min )
21031			.width( percentage.toFixed( 0 ) + "%" );
21032
21033		this
21034			._toggleClass( this.valueDiv, "ui-progressbar-complete", null,
21035				value === this.options.max )
21036			._toggleClass( "ui-progressbar-indeterminate", null, this.indeterminate );
21037
21038		if ( this.indeterminate ) {
21039			this.element.removeAttr( "aria-valuenow" );
21040			if ( !this.overlayDiv ) {
21041				this.overlayDiv = $( "<div>" ).appendTo( this.valueDiv );
21042				this._addClass( this.overlayDiv, "ui-progressbar-overlay" );
21043			}
21044		} else {
21045			this.element.attr( {
21046				"aria-valuemax": this.options.max,
21047				"aria-valuenow": value
21048			} );
21049			if ( this.overlayDiv ) {
21050				this.overlayDiv.remove();
21051				this.overlayDiv = null;
21052			}
21053		}
21054
21055		if ( this.oldValue !== value ) {
21056			this.oldValue = value;
21057			this._trigger( "change" );
21058		}
21059		if ( value === this.options.max ) {
21060			this._trigger( "complete" );
21061		}
21062	}
21063} );
21064
21065
21066/*!
21067 * jQuery UI Selectable 1.14.0
21068 * https://jqueryui.com
21069 *
21070 * Copyright OpenJS Foundation and other contributors
21071 * Released under the MIT license.
21072 * https://jquery.org/license
21073 */
21074
21075//>>label: Selectable
21076//>>group: Interactions
21077//>>description: Allows groups of elements to be selected with the mouse.
21078//>>docs: https://api.jqueryui.com/selectable/
21079//>>demos: https://jqueryui.com/selectable/
21080//>>css.structure: ../../themes/base/selectable.css
21081
21082
21083var widgetsSelectable = $.widget( "ui.selectable", $.ui.mouse, {
21084	version: "1.14.0
vendor: 7,325 bytes, lines 21084-21365
21084",
21085	options: {
21086		appendTo: "body",
21087		autoRefresh: true,
21088		distance: 0,
21089		filter: "*",
21090		tolerance: "touch",
21091
21092		// Callbacks
21093		selected: null,
21094		selecting: null,
21095		start: null,
21096		stop: null,
21097		unselected: null,
21098		unselecting: null
21099	},
21100	_create: function() {
21101		var that = this;
21102
21103		this._addClass( "ui-selectable" );
21104
21105		this.dragged = false;
21106
21107		// Cache selectee children based on filter
21108		this.refresh = function() {
21109			that.elementPos = $( that.element[ 0 ] ).offset();
21110			that.selectees = $( that.options.filter, that.element[ 0 ] );
21111			that._addClass( that.selectees, "ui-selectee" );
21112			that.selectees.each( function() {
21113				var $this = $( this ),
21114					selecteeOffset = $this.offset(),
21115					pos = {
21116						left: selecteeOffset.left - that.elementPos.left,
21117						top: selecteeOffset.top - that.elementPos.top
21118					};
21119				$.data( this, "selectable-item", {
21120					element: this,
21121					$element: $this,
21122					left: pos.left,
21123					top: pos.top,
21124					right: pos.left + $this.outerWidth(),
21125					bottom: pos.top + $this.outerHeight(),
21126					startselected: false,
21127					selected: $this.hasClass( "ui-selected" ),
21128					selecting: $this.hasClass( "ui-selecting" ),
21129					unselecting: $this.hasClass( "ui-unselecting" )
21130				} );
21131			} );
21132		};
21133		this.refresh();
21134
21135		this._mouseInit();
21136
21137		this.helper = $( "<div>" );
21138		this._addClass( this.helper, "ui-selectable-helper" );
21139	},
21140
21141	_destroy: function() {
21142		this.selectees.removeData( "selectable-item" );
21143		this._mouseDestroy();
21144	},
21145
21146	_mouseStart: function( event ) {
21147		var that = this,
21148			options = this.options;
21149
21150		this.opos = [ event.pageX, event.pageY ];
21151		this.elementPos = $( this.element[ 0 ] ).offset();
21152
21153		if ( this.options.disabled ) {
21154			return;
21155		}
21156
21157		this.selectees = $( options.filter, this.element[ 0 ] );
21158
21159		this._trigger( "start", event );
21160
21161		$( options.appendTo ).append( this.helper );
21162
21163		// position helper (lasso)
21164		this.helper.css( {
21165			"left": event.pageX,
21166			"top": event.pageY,
21167			"width": 0,
21168			"height": 0
21169		} );
21170
21171		if ( options.autoRefresh ) {
21172			this.refresh();
21173		}
21174
21175		this.selectees.filter( ".ui-selected" ).each( function() {
21176			var selectee = $.data( this, "selectable-item" );
21177			selectee.startselected = true;
21178			if ( !event.metaKey && !event.ctrlKey ) {
21179				that._removeClass( selectee.$element, "ui-selected" );
21180				selectee.selected = false;
21181				that._addClass( selectee.$element, "ui-unselecting" );
21182				selectee.unselecting = true;
21183
21184				// selectable UNSELECTING callback
21185				that._trigger( "unselecting", event, {
21186					unselecting: selectee.element
21187				} );
21188			}
21189		} );
21190
21191		$( event.target ).parents().addBack().each( function() {
21192			var doSelect,
21193				selectee = $.data( this, "selectable-item" );
21194			if ( selectee ) {
21195				doSelect = ( !event.metaKey && !event.ctrlKey ) ||
21196					!selectee.$element.hasClass( "ui-selected" );
21197				that._removeClass( selectee.$element, doSelect ? "ui-unselecting" : "ui-selected" )
21198					._addClass( selectee.$element, doSelect ? "ui-selecting" : "ui-unselecting" );
21199				selectee.unselecting = !doSelect;
21200				selectee.selecting = doSelect;
21201				selectee.selected = doSelect;
21202
21203				// selectable (UN)SELECTING callback
21204				if ( doSelect ) {
21205					that._trigger( "selecting", event, {
21206						selecting: selectee.element
21207					} );
21208				} else {
21209					that._trigger( "unselecting", event, {
21210						unselecting: selectee.element
21211					} );
21212				}
21213				return false;
21214			}
21215		} );
21216
21217	},
21218
21219	_mouseDrag: function( event ) {
21220
21221		this.dragged = true;
21222
21223		if ( this.options.disabled ) {
21224			return;
21225		}
21226
21227		var tmp,
21228			that = this,
21229			options = this.options,
21230			x1 = this.opos[ 0 ],
21231			y1 = this.opos[ 1 ],
21232			x2 = event.pageX,
21233			y2 = event.pageY;
21234
21235		if ( x1 > x2 ) {
21236			tmp = x2; x2 = x1; x1 = tmp;
21237		}
21238		if ( y1 > y2 ) {
21239			tmp = y2; y2 = y1; y1 = tmp;
21240		}
21241		this.helper.css( { left: x1, top: y1, width: x2 - x1, height: y2 - y1 } );
21242
21243		this.selectees.each( function() {
21244			var selectee = $.data( this, "selectable-item" ),
21245				hit = false,
21246				offset = {};
21247
21248			//prevent helper from being selected if appendTo: selectable
21249			if ( !selectee || selectee.element === that.element[ 0 ] ) {
21250				return;
21251			}
21252
21253			offset.left   = selectee.left   + that.elementPos.left;
21254			offset.right  = selectee.right  + that.elementPos.left;
21255			offset.top    = selectee.top    + that.elementPos.top;
21256			offset.bottom = selectee.bottom + that.elementPos.top;
21257
21258			if ( options.tolerance === "touch" ) {
21259				hit = ( !( offset.left > x2 || offset.right < x1 || offset.top > y2 ||
21260                    offset.bottom < y1 ) );
21261			} else if ( options.tolerance === "fit" ) {
21262				hit = ( offset.left > x1 && offset.right < x2 && offset.top > y1 &&
21263                    offset.bottom < y2 );
21264			}
21265
21266			if ( hit ) {
21267
21268				// SELECT
21269				if ( selectee.selected ) {
21270					that._removeClass( selectee.$element, "ui-selected" );
21271					selectee.selected = false;
21272				}
21273				if ( selectee.unselecting ) {
21274					that._removeClass( selectee.$element, "ui-unselecting" );
21275					selectee.unselecting = false;
21276				}
21277				if ( !selectee.selecting ) {
21278					that._addClass( selectee.$element, "ui-selecting" );
21279					selectee.selecting = true;
21280
21281					// selectable SELECTING callback
21282					that._trigger( "selecting", event, {
21283						selecting: selectee.element
21284					} );
21285				}
21286			} else {
21287
21288				// UNSELECT
21289				if ( selectee.selecting ) {
21290					if ( ( event.metaKey || event.ctrlKey ) && selectee.startselected ) {
21291						that._removeClass( selectee.$element, "ui-selecting" );
21292						selectee.selecting = false;
21293						that._addClass( selectee.$element, "ui-selected" );
21294						selectee.selected = true;
21295					} else {
21296						that._removeClass( selectee.$element, "ui-selecting" );
21297						selectee.selecting = false;
21298						if ( selectee.startselected ) {
21299							that._addClass( selectee.$element, "ui-unselecting" );
21300							selectee.unselecting = true;
21301						}
21302
21303						// selectable UNSELECTING callback
21304						that._trigger( "unselecting", event, {
21305							unselecting: selectee.element
21306						} );
21307					}
21308				}
21309				if ( selectee.selected ) {
21310					if ( !event.metaKey && !event.ctrlKey && !selectee.startselected ) {
21311						that._removeClass( selectee.$element, "ui-selected" );
21312						selectee.selected = false;
21313
21314						that._addClass( selectee.$element, "ui-unselecting" );
21315						selectee.unselecting = true;
21316
21317						// selectable UNSELECTING callback
21318						that._trigger( "unselecting", event, {
21319							unselecting: selectee.element
21320						} );
21321					}
21322				}
21323			}
21324		} );
21325
21326		return false;
21327	},
21328
21329	_mouseStop: function( event ) {
21330		var that = this;
21331
21332		this.dragged = false;
21333
21334		$( ".ui-unselecting", this.element[ 0 ] ).each( function() {
21335			var selectee = $.data( this, "selectable-item" );
21336			that._removeClass( selectee.$element, "ui-unselecting" );
21337			selectee.unselecting = false;
21338			selectee.startselected = false;
21339			that._trigger( "unselected", event, {
21340				unselected: selectee.element
21341			} );
21342		} );
21343		$( ".ui-selecting", this.element[ 0 ] ).each( function() {
21344			var selectee = $.data( this, "selectable-item" );
21345			that._removeClass( selectee.$element, "ui-selecting" )
21346				._addClass( selectee.$element, "ui-selected" );
21347			selectee.selecting = false;
21348			selectee.selected = true;
21349			selectee.startselected = true;
21350			that._trigger( "selected", event, {
21351				selected: selectee.element
21352			} );
21353		} );
21354		this._trigger( "stop", event );
21355
21356		this.helper.remove();
21357
21358		return false;
21359	}
21360
21361} );
21362
21363
21364/*!
21365 * jQuery UI Selectmenu 1.1
213654.0
21366 * https://jqueryui.com
21367 *
21368 * Copyright OpenJS Foundation and other contributors
21369 * Released under the MIT license.
21370 * https://jquery.org/license
21371 */
21372
21373//>>label: Selectmenu
21374//>>group: Widgets
21375/* eslint-disable max-len */
21376//>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.
21377/* eslint-enable max-len */
21378//>>docs: https://api.jqueryui.com/selectmenu/
21379//>>demos: https://jqueryui.com/selectmenu/
21380//>>css.structure: ../../themes/base/core.css
21381//>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css
21382//>>css.theme: ../../themes/base/theme.css
21383
21384
21385var widgetsSelectmenu = $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
21386	version: "1.14.0
vendor: 14,466 bytes, lines 21386-22007
21386",
21387	defaultElement: "<select>",
21388	options: {
21389		appendTo: null,
21390		classes: {
21391			"ui-selectmenu-button-open": "ui-corner-top",
21392			"ui-selectmenu-button-closed": "ui-corner-all"
21393		},
21394		disabled: null,
21395		icons: {
21396			button: "ui-icon-triangle-1-s"
21397		},
21398		position: {
21399			my: "left top",
21400			at: "left bottom",
21401			collision: "none"
21402		},
21403		width: false,
21404
21405		// Callbacks
21406		change: null,
21407		close: null,
21408		focus: null,
21409		open: null,
21410		select: null
21411	},
21412
21413	_create: function() {
21414		var selectmenuId = this.element.uniqueId().attr( "id" );
21415		this.ids = {
21416			element: selectmenuId,
21417			button: selectmenuId + "-button",
21418			menu: selectmenuId + "-menu"
21419		};
21420
21421		this._drawButton();
21422		this._drawMenu();
21423		this._bindFormResetHandler();
21424
21425		this._rendered = false;
21426		this.menuItems = $();
21427	},
21428
21429	_drawButton: function() {
21430		var icon,
21431			that = this,
21432			item = this._parseOption(
21433				this.element.find( "option:selected" ),
21434				this.element[ 0 ].selectedIndex
21435			);
21436
21437		// Associate existing label with the new button
21438		this.labels = this.element.labels().attr( "for", this.ids.button );
21439		this._on( this.labels, {
21440			click: function( event ) {
21441				this.button.trigger( "focus" );
21442				event.preventDefault();
21443			}
21444		} );
21445
21446		// Hide original select element
21447		this.element.hide();
21448
21449		// Create button
21450		this.button = $( "<span>", {
21451			tabindex: this.options.disabled ? -1 : 0,
21452			id: this.ids.button,
21453			role: "combobox",
21454			"aria-expanded": "false",
21455			"aria-autocomplete": "list",
21456			"aria-owns": this.ids.menu,
21457			"aria-haspopup": "true",
21458			title: this.element.attr( "title" )
21459		} )
21460			.insertAfter( this.element );
21461
21462		this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed",
21463			"ui-button ui-widget" );
21464
21465		icon = $( "<span>" ).appendTo( this.button );
21466		this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button );
21467		this.buttonItem = this._renderButtonItem( item )
21468			.appendTo( this.button );
21469
21470		if ( this.options.width !== false ) {
21471			this._resizeButton();
21472		}
21473
21474		this._on( this.button, this._buttonEvents );
21475		this.button.one( "focusin", function() {
21476
21477			// Delay rendering the menu items until the button receives focus.
21478			// The menu may have already been rendered via a programmatic open.
21479			if ( !that._rendered ) {
21480				that._refreshMenu();
21481			}
21482		} );
21483	},
21484
21485	_drawMenu: function() {
21486		var that = this;
21487
21488		// Create menu
21489		this.menu = $( "<ul>", {
21490			"aria-hidden": "true",
21491			"aria-labelledby": this.ids.button,
21492			id: this.ids.menu
21493		} );
21494
21495		// Wrap menu
21496		this.menuWrap = $( "<div>" ).append( this.menu );
21497		this._addClass( this.menuWrap, "ui-selectmenu-menu", "ui-front" );
21498		this.menuWrap.appendTo( this._appendTo() );
21499
21500		// Initialize menu widget
21501		this.menuInstance = this.menu
21502			.menu( {
21503				classes: {
21504					"ui-menu": "ui-corner-bottom"
21505				},
21506				role: "listbox",
21507				select: function( event, ui ) {
21508					event.preventDefault();
21509					that._select( ui.item.data( "ui-selectmenu-item" ), event );
21510				},
21511				focus: function( event, ui ) {
21512					var item = ui.item.data( "ui-selectmenu-item" );
21513
21514					// Prevent inital focus from firing and check if its a newly focused item
21515					if ( that.focusIndex != null && item.index !== that.focusIndex ) {
21516						that._trigger( "focus", event, { item: item } );
21517						if ( !that.isOpen ) {
21518							that._select( item, event );
21519						}
21520					}
21521					that.focusIndex = item.index;
21522
21523					that.button.attr( "aria-activedescendant",
21524						that.menuItems.eq( item.index ).attr( "id" ) );
21525				}
21526			} )
21527			.menu( "instance" );
21528
21529		// Don't close the menu on mouseleave
21530		this.menuInstance._off( this.menu, "mouseleave" );
21531
21532		// Cancel the menu's collapseAll on document click
21533		this.menuInstance._closeOnDocumentClick = function() {
21534			return false;
21535		};
21536
21537		// Selects often contain empty items, but never contain dividers
21538		this.menuInstance._isDivider = function() {
21539			return false;
21540		};
21541	},
21542
21543	refresh: function() {
21544		this._refreshMenu();
21545		this.buttonItem.replaceWith(
21546			this.buttonItem = this._renderButtonItem(
21547
21548				// Fall back to an empty object in case there are no options
21549				this._getSelectedItem().data( "ui-selectmenu-item" ) || {}
21550			)
21551		);
21552		if ( this.options.width === null ) {
21553			this._resizeButton();
21554		}
21555	},
21556
21557	_refreshMenu: function() {
21558		var item,
21559			options = this.element.find( "option" );
21560
21561		this.menu.empty();
21562
21563		this._parseOptions( options );
21564		this._renderMenu( this.menu, this.items );
21565
21566		this.menuInstance.refresh();
21567		this.menuItems = this.menu.find( "li" )
21568			.not( ".ui-selectmenu-optgroup" )
21569				.find( ".ui-menu-item-wrapper" );
21570
21571		this._rendered = true;
21572
21573		if ( !options.length ) {
21574			return;
21575		}
21576
21577		item = this._getSelectedItem();
21578
21579		// Update the menu to have the correct item focused
21580		this.menuInstance.focus( null, item );
21581		this._setAria( item.data( "ui-selectmenu-item" ) );
21582
21583		// Set disabled state
21584		this._setOption( "disabled", this.element.prop( "disabled" ) );
21585	},
21586
21587	open: function( event ) {
21588		if ( this.options.disabled ) {
21589			return;
21590		}
21591
21592		// If this is the first time the menu is being opened, render the items
21593		if ( !this._rendered ) {
21594			this._refreshMenu();
21595		} else {
21596
21597			// Menu clears focus on close, reset focus to selected item
21598			this._removeClass( this.menu.find( ".ui-state-active" ), null, "ui-state-active" );
21599			this.menuInstance.focus( null, this._getSelectedItem() );
21600		}
21601
21602		// If there are no options, don't open the menu
21603		if ( !this.menuItems.length ) {
21604			return;
21605		}
21606
21607		this.isOpen = true;
21608		this._toggleAttr();
21609		this._resizeMenu();
21610		this._position();
21611
21612		this._on( this.document, this._documentClick );
21613
21614		this._trigger( "open", event );
21615	},
21616
21617	_position: function() {
21618		this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
21619	},
21620
21621	close: function( event ) {
21622		if ( !this.isOpen ) {
21623			return;
21624		}
21625
21626		this.isOpen = false;
21627		this._toggleAttr();
21628
21629		this.range = null;
21630		this._off( this.document );
21631
21632		this._trigger( "close", event );
21633	},
21634
21635	widget: function() {
21636		return this.button;
21637	},
21638
21639	menuWidget: function() {
21640		return this.menu;
21641	},
21642
21643	_renderButtonItem: function( item ) {
21644		var buttonItem = $( "<span>" );
21645
21646		this._setText( buttonItem, item.label );
21647		this._addClass( buttonItem, "ui-selectmenu-text" );
21648
21649		return buttonItem;
21650	},
21651
21652	_renderMenu: function( ul, items ) {
21653		var that = this,
21654			currentOptgroup = "";
21655
21656		$.each( items, function( index, item ) {
21657			var li;
21658
21659			if ( item.optgroup !== currentOptgroup ) {
21660				li = $( "<li>", {
21661					text: item.optgroup
21662				} );
21663				that._addClass( li, "ui-selectmenu-optgroup", "ui-menu-divider" +
21664					( item.element.parent( "optgroup" ).prop( "disabled" ) ?
21665						" ui-state-disabled" :
21666						"" ) );
21667
21668				li.appendTo( ul );
21669
21670				currentOptgroup = item.optgroup;
21671			}
21672
21673			that._renderItemData( ul, item );
21674		} );
21675	},
21676
21677	_renderItemData: function( ul, item ) {
21678		return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
21679	},
21680
21681	_renderItem: function( ul, item ) {
21682		var li = $( "<li>" ),
21683			wrapper = $( "<div>", {
21684				title: item.element.attr( "title" )
21685			} );
21686
21687		if ( item.disabled ) {
21688			this._addClass( li, null, "ui-state-disabled" );
21689		}
21690
21691		if ( item.hidden ) {
21692			li.prop( "hidden", true );
21693		} else {
21694			this._setText( wrapper, item.label );
21695		}
21696
21697		return li.append( wrapper ).appendTo( ul );
21698	},
21699
21700	_setText: function( element, value ) {
21701		if ( value ) {
21702			element.text( value );
21703		} else {
21704			element.html( "&#160;" );
21705		}
21706	},
21707
21708	_move: function( direction, event ) {
21709		var item, next,
21710			filter = ".ui-menu-item";
21711
21712		if ( this.isOpen ) {
21713			item = this.menuItems.eq( this.focusIndex ).parent( "li" );
21714		} else {
21715			item = this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
21716			filter += ":not(.ui-state-disabled)";
21717		}
21718
21719		if ( direction === "first" || direction === "last" ) {
21720			next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
21721		} else {
21722			next = item[ direction + "All" ]( filter ).eq( 0 );
21723		}
21724
21725		if ( next.length ) {
21726			this.menuInstance.focus( event, next );
21727		}
21728	},
21729
21730	_getSelectedItem: function() {
21731		return this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
21732	},
21733
21734	_toggle: function( event ) {
21735		this[ this.isOpen ? "close" : "open" ]( event );
21736	},
21737
21738	_setSelection: function() {
21739		var selection;
21740
21741		if ( !this.range ) {
21742			return;
21743		}
21744
21745		selection = window.getSelection();
21746		selection.removeAllRanges();
21747		selection.addRange( this.range );
21748	},
21749
21750	_documentClick: {
21751		mousedown: function( event ) {
21752			if ( !this.isOpen ) {
21753				return;
21754			}
21755
21756			if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" +
21757				CSS.escape( this.ids.button ) ).length ) {
21758				this.close( event );
21759			}
21760		}
21761	},
21762
21763	_buttonEvents: {
21764
21765		// Prevent text selection from being reset when interacting with the selectmenu (#10144)
21766		mousedown: function() {
21767			var selection = window.getSelection();
21768			if ( selection.rangeCount ) {
21769				this.range = selection.getRangeAt( 0 );
21770			}
21771		},
21772
21773		click: function( event ) {
21774			this._setSelection();
21775			this._toggle( event );
21776		},
21777
21778		keydown: function( event ) {
21779			var preventDefault = true;
21780			switch ( event.keyCode ) {
21781			case $.ui.keyCode.TAB:
21782			case $.ui.keyCode.ESCAPE:
21783				this.close( event );
21784				preventDefault = false;
21785				break;
21786			case $.ui.keyCode.ENTER:
21787				if ( this.isOpen ) {
21788					this._selectFocusedItem( event );
21789				}
21790				break;
21791			case $.ui.keyCode.UP:
21792				if ( event.altKey ) {
21793					this._toggle( event );
21794				} else {
21795					this._move( "prev", event );
21796				}
21797				break;
21798			case $.ui.keyCode.DOWN:
21799				if ( event.altKey ) {
21800					this._toggle( event );
21801				} else {
21802					this._move( "next", event );
21803				}
21804				break;
21805			case $.ui.keyCode.SPACE:
21806				if ( this.isOpen ) {
21807					this._selectFocusedItem( event );
21808				} else {
21809					this._toggle( event );
21810				}
21811				break;
21812			case $.ui.keyCode.LEFT:
21813				this._move( "prev", event );
21814				break;
21815			case $.ui.keyCode.RIGHT:
21816				this._move( "next", event );
21817				break;
21818			case $.ui.keyCode.HOME:
21819			case $.ui.keyCode.PAGE_UP:
21820				this._move( "first", event );
21821				break;
21822			case $.ui.keyCode.END:
21823			case $.ui.keyCode.PAGE_DOWN:
21824				this._move( "last", event );
21825				break;
21826			default:
21827				this.menu.trigger( event );
21828				preventDefault = false;
21829			}
21830
21831			if ( preventDefault ) {
21832				event.preventDefault();
21833			}
21834		}
21835	},
21836
21837	_selectFocusedItem: function( event ) {
21838		var item = this.menuItems.eq( this.focusIndex ).parent( "li" );
21839		if ( !item.hasClass( "ui-state-disabled" ) ) {
21840			this._select( item.data( "ui-selectmenu-item" ), event );
21841		}
21842	},
21843
21844	_select: function( item, event ) {
21845		var oldIndex = this.element[ 0 ].selectedIndex;
21846
21847		// Change native select element
21848		this.element[ 0 ].selectedIndex = item.index;
21849		this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) );
21850		this._setAria( item );
21851		this._trigger( "select", event, { item: item } );
21852
21853		if ( item.index !== oldIndex ) {
21854			this._trigger( "change", event, { item: item } );
21855		}
21856
21857		this.close( event );
21858	},
21859
21860	_setAria: function( item ) {
21861		var id = this.menuItems.eq( item.index ).attr( "id" );
21862
21863		this.button.attr( {
21864			"aria-labelledby": id,
21865			"aria-activedescendant": id
21866		} );
21867		this.menu.attr( "aria-activedescendant", id );
21868	},
21869
21870	_setOption: function( key, value ) {
21871		if ( key === "icons" ) {
21872			var icon = this.button.find( "span.ui-icon" );
21873			this._removeClass( icon, null, this.options.icons.button )
21874				._addClass( icon, null, value.button );
21875		}
21876
21877		this._super( key, value );
21878
21879		if ( key === "appendTo" ) {
21880			this.menuWrap.appendTo( this._appendTo() );
21881		}
21882
21883		if ( key === "width" ) {
21884			this._resizeButton();
21885		}
21886	},
21887
21888	_setOptionDisabled: function( value ) {
21889		this._super( value );
21890
21891		this.menuInstance.option( "disabled", value );
21892		this.button.attr( "aria-disabled", value );
21893		this._toggleClass( this.button, null, "ui-state-disabled", value );
21894
21895		this.element.prop( "disabled", value );
21896		if ( value ) {
21897			this.button.attr( "tabindex", -1 );
21898			this.close();
21899		} else {
21900			this.button.attr( "tabindex", 0 );
21901		}
21902	},
21903
21904	_appendTo: function() {
21905		var element = this.options.appendTo;
21906
21907		if ( element ) {
21908			element = element.jquery || element.nodeType ?
21909				$( element ) :
21910				this.document.find( element ).eq( 0 );
21911		}
21912
21913		if ( !element || !element[ 0 ] ) {
21914			element = this.element.closest( ".ui-front, dialog" );
21915		}
21916
21917		if ( !element.length ) {
21918			element = this.document[ 0 ].body;
21919		}
21920
21921		return element;
21922	},
21923
21924	_toggleAttr: function() {
21925		this.button.attr( "aria-expanded", this.isOpen );
21926
21927		// We can't use two _toggleClass() calls here, because we need to make sure
21928		// we always remove classes first and add them second, otherwise if both classes have the
21929		// same theme class, it will be removed after we add it.
21930		this._removeClass( this.button, "ui-selectmenu-button-" +
21931			( this.isOpen ? "closed" : "open" ) )
21932			._addClass( this.button, "ui-selectmenu-button-" +
21933				( this.isOpen ? "open" : "closed" ) )
21934			._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen );
21935
21936		this.menu.attr( "aria-hidden", !this.isOpen );
21937	},
21938
21939	_resizeButton: function() {
21940		var width = this.options.width;
21941
21942		// For `width: false`, just remove inline style and stop
21943		if ( width === false ) {
21944			this.button.css( "width", "" );
21945			return;
21946		}
21947
21948		// For `width: null`, match the width of the original element
21949		if ( width === null ) {
21950			width = this.element.show().outerWidth();
21951			this.element.hide();
21952		}
21953
21954		this.button.outerWidth( width );
21955	},
21956
21957	_resizeMenu: function() {
21958		this.menu.outerWidth( Math.max(
21959			this.button.outerWidth(),
21960			this.menu.width( "" ).outerWidth()
21961		) );
21962	},
21963
21964	_getCreateOptions: function() {
21965		var options = this._super();
21966
21967		options.disabled = this.element.prop( "disabled" );
21968
21969		return options;
21970	},
21971
21972	_parseOptions: function( options ) {
21973		var that = this,
21974			data = [];
21975		options.each( function( index, item ) {
21976			data.push( that._parseOption( $( item ), index ) );
21977		} );
21978		this.items = data;
21979	},
21980
21981	_parseOption: function( option, index ) {
21982		var optgroup = option.parent( "optgroup" );
21983
21984		return {
21985			element: option,
21986			index: index,
21987			value: option.val(),
21988			label: option.text(),
21989			hidden: optgroup.prop( "hidden" ) || option.prop( "hidden" ),
21990			optgroup: optgroup.attr( "label" ) || "",
21991			disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
21992		};
21993	},
21994
21995	_destroy: function() {
21996		this._unbindFormResetHandler();
21997		this.menuWrap.remove();
21998		this.button.remove();
21999		this.element.show();
22000		this.element.removeUniqueId();
22001		this.labels.attr( "for", this.ids.element );
22002	}
22003} ] );
22004
22005
22006/*!
22007 * jQuery UI Slider 1.14.
vendor: 2,981 bytes, lines 22007-22123
220070
22008 * https://jqueryui.com
22009 *
22010 * Copyright OpenJS Foundation and other contributors
22011 * Released under the MIT license.
22012 * https://jquery.org/license
22013 */
22014
22015//>>label: Slider
22016//>>group: Widgets
22017//>>description: Displays a flexible slider with ranges and accessibility via keyboard.
22018//>>docs: https://api.jqueryui.com/slider/
22019//>>demos: https://jqueryui.com/slider/
22020//>>css.structure: ../../themes/base/core.css
22021//>>css.structure: ../../themes/base/slider.css
22022//>>css.theme: ../../themes/base/theme.css
22023
22024
22025var widgetsSlider = $.widget( "ui.slider", $.ui.mouse, {
22026	version: "1.14.0",
22027	widgetEventPrefix: "slide",
22028
22029	options: {
22030		animate: false,
22031		classes: {
22032			"ui-slider": "ui-corner-all",
22033			"ui-slider-handle": "ui-corner-all",
22034
22035			// Note: ui-widget-header isn't the most fittingly semantic framework class for this
22036			// element, but worked best visually with a variety of themes
22037			"ui-slider-range": "ui-corner-all ui-widget-header"
22038		},
22039		distance: 0,
22040		max: 100,
22041		min: 0,
22042		orientation: "horizontal",
22043		range: false,
22044		step: 1,
22045		value: 0,
22046		values: null,
22047
22048		// Callbacks
22049		change: null,
22050		slide: null,
22051		start: null,
22052		stop: null
22053	},
22054
22055	// Number of pages in a slider
22056	// (how many times can you page up/down to go through the whole range)
22057	numPages: 5,
22058
22059	_create: function() {
22060		this._keySliding = false;
22061		this._mouseSliding = false;
22062		this._animateOff = true;
22063		this._handleIndex = null;
22064		this._detectOrientation();
22065		this._mouseInit();
22066		this._calculateNewMax();
22067
22068		this._addClass( "ui-slider ui-slider-" + this.orientation,
22069			"ui-widget ui-widget-content" );
22070
22071		this._refresh();
22072
22073		this._animateOff = false;
22074	},
22075
22076	_refresh: function() {
22077		this._createRange();
22078		this._createHandles();
22079		this._setupEvents();
22080		this._refreshValue();
22081	},
22082
22083	_createHandles: function() {
22084		var i, handleCount,
22085			options = this.options,
22086			existingHandles = this.element.find( ".ui-slider-handle" ),
22087			handle = "<span tabindex='0'></span>",
22088			handles = [];
22089
22090		handleCount = ( options.values && options.values.length ) || 1;
22091
22092		if ( existingHandles.length > handleCount ) {
22093			existingHandles.slice( handleCount ).remove();
22094			existingHandles = existingHandles.slice( 0, handleCount );
22095		}
22096
22097		for ( i = existingHandles.length; i < handleCount; i++ ) {
22098			handles.push( handle );
22099		}
22100
22101		this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
22102
22103		this._addClass( this.handles, "ui-slider-handle", "ui-state-default" );
22104
22105		this.handle = this.handles.eq( 0 );
22106
22107		this.handles.each( function( i ) {
22108			$( this )
22109				.data( "ui-slider-handle-index", i )
22110				.attr( "tabIndex", 0 );
22111		} );
22112	},
22113
22114	_createRange: function() {
22115		var options = this.options;
22116
22117		if ( options.range ) {
22118			if ( options.range === true ) {
22119				if ( !options.values ) {
22120					options.values = [ this._valueMin(), this._valueMin() ];
22121				} else if ( options.values.length && options.values.length !== 2 ) {
22122					options.values = [ options.values[ 0 ], options.values[ 0 ] ];
22123				} else if ( Array
vendor: 6,343 bytes, lines 22123-22369
22123.isArray( options.values ) ) {
22124					options.values = options.values.slice( 0 );
22125				}
22126			}
22127
22128			if ( !this.range || !this.range.length ) {
22129				this.range = $( "<div>" )
22130					.appendTo( this.element );
22131
22132				this._addClass( this.range, "ui-slider-range" );
22133			} else {
22134				this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" );
22135
22136				// Handle range switching from true to min/max
22137				this.range.css( {
22138					"left": "",
22139					"bottom": ""
22140				} );
22141			}
22142			if ( options.range === "min" || options.range === "max" ) {
22143				this._addClass( this.range, "ui-slider-range-" + options.range );
22144			}
22145		} else {
22146			if ( this.range ) {
22147				this.range.remove();
22148			}
22149			this.range = null;
22150		}
22151	},
22152
22153	_setupEvents: function() {
22154		this._off( this.handles );
22155		this._on( this.handles, this._handleEvents );
22156		this._hoverable( this.handles );
22157		this._focusable( this.handles );
22158	},
22159
22160	_destroy: function() {
22161		this.handles.remove();
22162		if ( this.range ) {
22163			this.range.remove();
22164		}
22165
22166		this._mouseDestroy();
22167	},
22168
22169	_mouseCapture: function( event ) {
22170		var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
22171			that = this,
22172			o = this.options;
22173
22174		if ( o.disabled ) {
22175			return false;
22176		}
22177
22178		this.elementSize = {
22179			width: this.element.outerWidth(),
22180			height: this.element.outerHeight()
22181		};
22182		this.elementOffset = this.element.offset();
22183
22184		position = { x: event.pageX, y: event.pageY };
22185		normValue = this._normValueFromMouse( position );
22186		distance = this._valueMax() - this._valueMin() + 1;
22187		this.handles.each( function( i ) {
22188			var thisDistance = Math.abs( normValue - that.values( i ) );
22189			if ( ( distance > thisDistance ) ||
22190				( distance === thisDistance &&
22191					( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) {
22192				distance = thisDistance;
22193				closestHandle = $( this );
22194				index = i;
22195			}
22196		} );
22197
22198		allowed = this._start( event, index );
22199		if ( allowed === false ) {
22200			return false;
22201		}
22202		this._mouseSliding = true;
22203
22204		this._handleIndex = index;
22205
22206		this._addClass( closestHandle, null, "ui-state-active" );
22207		closestHandle.trigger( "focus" );
22208
22209		offset = closestHandle.offset();
22210		mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
22211		this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
22212			left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
22213			top: event.pageY - offset.top -
22214				( closestHandle.height() / 2 ) -
22215				( parseInt( closestHandle.css( "borderTopWidth" ), 10 ) || 0 ) -
22216				( parseInt( closestHandle.css( "borderBottomWidth" ), 10 ) || 0 ) +
22217				( parseInt( closestHandle.css( "marginTop" ), 10 ) || 0 )
22218		};
22219
22220		if ( !this.handles.hasClass( "ui-state-hover" ) ) {
22221			this._slide( event, index, normValue );
22222		}
22223		this._animateOff = true;
22224		return true;
22225	},
22226
22227	_mouseStart: function() {
22228		return true;
22229	},
22230
22231	_mouseDrag: function( event ) {
22232		var position = { x: event.pageX, y: event.pageY },
22233			normValue = this._normValueFromMouse( position );
22234
22235		this._slide( event, this._handleIndex, normValue );
22236
22237		return false;
22238	},
22239
22240	_mouseStop: function( event ) {
22241		this._removeClass( this.handles, null, "ui-state-active" );
22242		this._mouseSliding = false;
22243
22244		this._stop( event, this._handleIndex );
22245		this._change( event, this._handleIndex );
22246
22247		this._handleIndex = null;
22248		this._clickOffset = null;
22249		this._animateOff = false;
22250
22251		return false;
22252	},
22253
22254	_detectOrientation: function() {
22255		this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
22256	},
22257
22258	_normValueFromMouse: function( position ) {
22259		var pixelTotal,
22260			pixelMouse,
22261			percentMouse,
22262			valueTotal,
22263			valueMouse;
22264
22265		if ( this.orientation === "horizontal" ) {
22266			pixelTotal = this.elementSize.width;
22267			pixelMouse = position.x - this.elementOffset.left -
22268				( this._clickOffset ? this._clickOffset.left : 0 );
22269		} else {
22270			pixelTotal = this.elementSize.height;
22271			pixelMouse = position.y - this.elementOffset.top -
22272				( this._clickOffset ? this._clickOffset.top : 0 );
22273		}
22274
22275		percentMouse = ( pixelMouse / pixelTotal );
22276		if ( percentMouse > 1 ) {
22277			percentMouse = 1;
22278		}
22279		if ( percentMouse < 0 ) {
22280			percentMouse = 0;
22281		}
22282		if ( this.orientation === "vertical" ) {
22283			percentMouse = 1 - percentMouse;
22284		}
22285
22286		valueTotal = this._valueMax() - this._valueMin();
22287		valueMouse = this._valueMin() + percentMouse * valueTotal;
22288
22289		return this._trimAlignValue( valueMouse );
22290	},
22291
22292	_uiHash: function( index, value, values ) {
22293		var uiHash = {
22294			handle: this.handles[ index ],
22295			handleIndex: index,
22296			value: value !== undefined ? value : this.value()
22297		};
22298
22299		if ( this._hasMultipleValues() ) {
22300			uiHash.value = value !== undefined ? value : this.values( index );
22301			uiHash.values = values || this.values();
22302		}
22303
22304		return uiHash;
22305	},
22306
22307	_hasMultipleValues: function() {
22308		return this.options.values && this.options.values.length;
22309	},
22310
22311	_start: function( event, index ) {
22312		return this._trigger( "start", event, this._uiHash( index ) );
22313	},
22314
22315	_slide: function( event, index, newVal ) {
22316		var allowed, otherVal,
22317			currentValue = this.value(),
22318			newValues = this.values();
22319
22320		if ( this._hasMultipleValues() ) {
22321			otherVal = this.values( index ? 0 : 1 );
22322			currentValue = this.values( index );
22323
22324			if ( this.options.values.length === 2 && this.options.range === true ) {
22325				newVal =  index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal );
22326			}
22327
22328			newValues[ index ] = newVal;
22329		}
22330
22331		if ( newVal === currentValue ) {
22332			return;
22333		}
22334
22335		allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) );
22336
22337		// A slide can be canceled by returning false from the slide callback
22338		if ( allowed === false ) {
22339			return;
22340		}
22341
22342		if ( this._hasMultipleValues() ) {
22343			this.values( index, newVal );
22344		} else {
22345			this.value( newVal );
22346		}
22347	},
22348
22349	_stop: function( event, index ) {
22350		this._trigger( "stop", event, this._uiHash( index ) );
22351	},
22352
22353	_change: function( event, index ) {
22354		if ( !this._keySliding && !this._mouseSliding ) {
22355
22356			//store the last changed value index for reference when handles overlap
22357			this._lastChangedValue = index;
22358			this._trigger( "change", event, this._uiHash( index ) );
22359		}
22360	},
22361
22362	value: function( newValue ) {
22363		if ( arguments.length ) {
22364			this.options.value = this._trimAlignValue( newValue );
22365			this._refreshValue();
22366			this._change( null, 0 );
22367			return;
22368		}
22369
vendor: 4,358 bytes, lines 22370-22542
22370		return this._value();
22371	},
22372
22373	values: function( index, newValue ) {
22374		var vals,
22375			newValues,
22376			i;
22377
22378		if ( arguments.length > 1 ) {
22379			this.options.values[ index ] = this._trimAlignValue( newValue );
22380			this._refreshValue();
22381			this._change( null, index );
22382			return;
22383		}
22384
22385		if ( arguments.length ) {
22386			if ( Array.isArray( arguments[ 0 ] ) ) {
22387				vals = this.options.values;
22388				newValues = arguments[ 0 ];
22389				for ( i = 0; i < vals.length; i += 1 ) {
22390					vals[ i ] = this._trimAlignValue( newValues[ i ] );
22391					this._change( null, i );
22392				}
22393				this._refreshValue();
22394			} else {
22395				if ( this._hasMultipleValues() ) {
22396					return this._values( index );
22397				} else {
22398					return this.value();
22399				}
22400			}
22401		} else {
22402			return this._values();
22403		}
22404	},
22405
22406	_setOption: function( key, value ) {
22407		var i,
22408			valsLength = 0;
22409
22410		if ( key === "range" && this.options.range === true ) {
22411			if ( value === "min" ) {
22412				this.options.value = this._values( 0 );
22413				this.options.values = null;
22414			} else if ( value === "max" ) {
22415				this.options.value = this._values( this.options.values.length - 1 );
22416				this.options.values = null;
22417			}
22418		}
22419
22420		if ( Array.isArray( this.options.values ) ) {
22421			valsLength = this.options.values.length;
22422		}
22423
22424		this._super( key, value );
22425
22426		switch ( key ) {
22427			case "orientation":
22428				this._detectOrientation();
22429				this._removeClass( "ui-slider-horizontal ui-slider-vertical" )
22430					._addClass( "ui-slider-" + this.orientation );
22431				this._refreshValue();
22432				if ( this.options.range ) {
22433					this._refreshRange( value );
22434				}
22435
22436				// Reset positioning from previous orientation
22437				this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
22438				break;
22439			case "value":
22440				this._animateOff = true;
22441				this._refreshValue();
22442				this._change( null, 0 );
22443				this._animateOff = false;
22444				break;
22445			case "values":
22446				this._animateOff = true;
22447				this._refreshValue();
22448
22449				// Start from the last handle to prevent unreachable handles (#9046)
22450				for ( i = valsLength - 1; i >= 0; i-- ) {
22451					this._change( null, i );
22452				}
22453				this._animateOff = false;
22454				break;
22455			case "step":
22456			case "min":
22457			case "max":
22458				this._animateOff = true;
22459				this._calculateNewMax();
22460				this._refreshValue();
22461				this._animateOff = false;
22462				break;
22463			case "range":
22464				this._animateOff = true;
22465				this._refresh();
22466				this._animateOff = false;
22467				break;
22468		}
22469	},
22470
22471	_setOptionDisabled: function( value ) {
22472		this._super( value );
22473
22474		this._toggleClass( null, "ui-state-disabled", !!value );
22475	},
22476
22477	//internal value getter
22478	// _value() returns value trimmed by min and max, aligned by step
22479	_value: function() {
22480		var val = this.options.value;
22481		val = this._trimAlignValue( val );
22482
22483		return val;
22484	},
22485
22486	//internal values getter
22487	// _values() returns array of values trimmed by min and max, aligned by step
22488	// _values( index ) returns single value trimmed by min and max, aligned by step
22489	_values: function( index ) {
22490		var val,
22491			vals,
22492			i;
22493
22494		if ( arguments.length ) {
22495			val = this.options.values[ index ];
22496			val = this._trimAlignValue( val );
22497
22498			return val;
22499		} else if ( this._hasMultipleValues() ) {
22500
22501			// .slice() creates a copy of the array
22502			// this copy gets trimmed by min and max and then returned
22503			vals = this.options.values.slice();
22504			for ( i = 0; i < vals.length; i += 1 ) {
22505				vals[ i ] = this._trimAlignValue( vals[ i ] );
22506			}
22507
22508			return vals;
22509		} else {
22510			return [];
22511		}
22512	},
22513
22514	// Returns the step-aligned value that val is closest to, between (inclusive) min and max
22515	_trimAlignValue: function( val ) {
22516		if ( val <= this._valueMin() ) {
22517			return this._valueMin();
22518		}
22519		if ( val >= this._valueMax() ) {
22520			return this._valueMax();
22521		}
22522		var step = ( this.options.step > 0 ) ? this.options.step : 1,
22523			valModStep = ( val - this._valueMin() ) % step,
22524			alignValue = val - valModStep;
22525
22526		if ( Math.abs( valModStep ) * 2 >= step ) {
22527			alignValue += ( valModStep > 0 ) ? step : ( -step );
22528		}
22529
22530		// Since JavaScript has problems with large floats, round
22531		// the final value to 5 digits after the decimal point (see #4124)
22532		return parseFloat( alignValue.toFixed( 5 ) );
22533	},
22534
22535	_calculateNewMax: function() {
22536		var max = this.options.max,
22537			min = this._valueMin(),
22538			step = this.options.step,
22539			aboveMin = Math.round( ( max - min ) / step ) * step;
22540		max = aboveMin + min;
22541		if ( max > this.options.max ) {
22542
vendor: 5,594 bytes, lines 22543-22742
22543			//If max is not divisible by step, rounding off may increase its value
22544			max -= step;
22545		}
22546		this.max = parseFloat( max.toFixed( this._precision() ) );
22547	},
22548
22549	_precision: function() {
22550		var precision = this._precisionOf( this.options.step );
22551		if ( this.options.min !== null ) {
22552			precision = Math.max( precision, this._precisionOf( this.options.min ) );
22553		}
22554		return precision;
22555	},
22556
22557	_precisionOf: function( num ) {
22558		var str = num.toString(),
22559			decimal = str.indexOf( "." );
22560		return decimal === -1 ? 0 : str.length - decimal - 1;
22561	},
22562
22563	_valueMin: function() {
22564		return this.options.min;
22565	},
22566
22567	_valueMax: function() {
22568		return this.max;
22569	},
22570
22571	_refreshRange: function( orientation ) {
22572		if ( orientation === "vertical" ) {
22573			this.range.css( { "width": "", "left": "" } );
22574		}
22575		if ( orientation === "horizontal" ) {
22576			this.range.css( { "height": "", "bottom": "" } );
22577		}
22578	},
22579
22580	_refreshValue: function() {
22581		var lastValPercent, valPercent, value, valueMin, valueMax,
22582			oRange = this.options.range,
22583			o = this.options,
22584			that = this,
22585			animate = ( !this._animateOff ) ? o.animate : false,
22586			_set = {};
22587
22588		if ( this._hasMultipleValues() ) {
22589			this.handles.each( function( i ) {
22590				valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() -
22591					that._valueMin() ) * 100;
22592				_set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
22593				$( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
22594				if ( that.options.range === true ) {
22595					if ( that.orientation === "horizontal" ) {
22596						if ( i === 0 ) {
22597							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
22598								left: valPercent + "%"
22599							}, o.animate );
22600						}
22601						if ( i === 1 ) {
22602							that.range[ animate ? "animate" : "css" ]( {
22603								width: ( valPercent - lastValPercent ) + "%"
22604							}, {
22605								queue: false,
22606								duration: o.animate
22607							} );
22608						}
22609					} else {
22610						if ( i === 0 ) {
22611							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
22612								bottom: ( valPercent ) + "%"
22613							}, o.animate );
22614						}
22615						if ( i === 1 ) {
22616							that.range[ animate ? "animate" : "css" ]( {
22617								height: ( valPercent - lastValPercent ) + "%"
22618							}, {
22619								queue: false,
22620								duration: o.animate
22621							} );
22622						}
22623					}
22624				}
22625				lastValPercent = valPercent;
22626			} );
22627		} else {
22628			value = this.value();
22629			valueMin = this._valueMin();
22630			valueMax = this._valueMax();
22631			valPercent = ( valueMax !== valueMin ) ?
22632					( value - valueMin ) / ( valueMax - valueMin ) * 100 :
22633					0;
22634			_set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
22635			this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
22636
22637			if ( oRange === "min" && this.orientation === "horizontal" ) {
22638				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
22639					width: valPercent + "%"
22640				}, o.animate );
22641			}
22642			if ( oRange === "max" && this.orientation === "horizontal" ) {
22643				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
22644					width: ( 100 - valPercent ) + "%"
22645				}, o.animate );
22646			}
22647			if ( oRange === "min" && this.orientation === "vertical" ) {
22648				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
22649					height: valPercent + "%"
22650				}, o.animate );
22651			}
22652			if ( oRange === "max" && this.orientation === "vertical" ) {
22653				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
22654					height: ( 100 - valPercent ) + "%"
22655				}, o.animate );
22656			}
22657		}
22658	},
22659
22660	_handleEvents: {
22661		keydown: function( event ) {
22662			var allowed, curVal, newVal, step,
22663				index = $( event.target ).data( "ui-slider-handle-index" );
22664
22665			switch ( event.keyCode ) {
22666				case $.ui.keyCode.HOME:
22667				case $.ui.keyCode.END:
22668				case $.ui.keyCode.PAGE_UP:
22669				case $.ui.keyCode.PAGE_DOWN:
22670				case $.ui.keyCode.UP:
22671				case $.ui.keyCode.RIGHT:
22672				case $.ui.keyCode.DOWN:
22673				case $.ui.keyCode.LEFT:
22674					event.preventDefault();
22675					if ( !this._keySliding ) {
22676						this._keySliding = true;
22677						this._addClass( $( event.target ), null, "ui-state-active" );
22678						allowed = this._start( event, index );
22679						if ( allowed === false ) {
22680							return;
22681						}
22682					}
22683					break;
22684			}
22685
22686			step = this.options.step;
22687			if ( this._hasMultipleValues() ) {
22688				curVal = newVal = this.values( index );
22689			} else {
22690				curVal = newVal = this.value();
22691			}
22692
22693			switch ( event.keyCode ) {
22694				case $.ui.keyCode.HOME:
22695					newVal = this._valueMin();
22696					break;
22697				case $.ui.keyCode.END:
22698					newVal = this._valueMax();
22699					break;
22700				case $.ui.keyCode.PAGE_UP:
22701					newVal = this._trimAlignValue(
22702						curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
22703					);
22704					break;
22705				case $.ui.keyCode.PAGE_DOWN:
22706					newVal = this._trimAlignValue(
22707						curVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) );
22708					break;
22709				case $.ui.keyCode.UP:
22710				case $.ui.keyCode.RIGHT:
22711					if ( curVal === this._valueMax() ) {
22712						return;
22713					}
22714					newVal = this._trimAlignValue( curVal + step );
22715					break;
22716				case $.ui.keyCode.DOWN:
22717				case $.ui.keyCode.LEFT:
22718					if ( curVal === this._valueMin() ) {
22719						return;
22720					}
22721					newVal = this._trimAlignValue( curVal - step );
22722					break;
22723			}
22724
22725			this._slide( event, index, newVal );
22726		},
22727		keyup: function( event ) {
22728			var index = $( event.target ).data( "ui-slider-handle-index" );
22729
22730			if ( this._keySliding ) {
22731				this._keySliding = false;
22732				this._stop( event, index );
22733				this._change( event, index );
22734				this._removeClass( $( event.target ), null, "ui-state-active" );
22735			}
22736		}
22737	}
22738} );
22739
22740
22741/*!
22742 * jQuery UI Sortable 1.1
227424.0
22743 * https://jqueryui.com
22744 *
22745 * Copyright OpenJS Foundation and other contributors
22746 * Released under the MIT license.
22747 * https://jquery.org/license
22748 */
22749
22750//>>label: Sortable
22751//>>group: Interactions
22752//>>description: Enables items in a list to be sorted using the mouse.
22753//>>docs: https://api.jqueryui.com/sortable/
22754//>>demos: https://jqueryui.com/sortable/
22755//>>css.structure: ../../themes/base/sortable.css
22756
22757
22758var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, {
22759	version: "1.14.0
vendor: 7,827 bytes, lines 22759-23074
22759",
22760	widgetEventPrefix: "sort",
22761	ready: false,
22762	options: {
22763		appendTo: "parent",
22764		axis: false,
22765		connectWith: false,
22766		containment: false,
22767		cursor: "auto",
22768		cursorAt: false,
22769		dropOnEmpty: true,
22770		forcePlaceholderSize: false,
22771		forceHelperSize: false,
22772		grid: false,
22773		handle: false,
22774		helper: "original",
22775		items: "> *",
22776		opacity: false,
22777		placeholder: false,
22778		revert: false,
22779		scroll: true,
22780		scrollSensitivity: 20,
22781		scrollSpeed: 20,
22782		scope: "default",
22783		tolerance: "intersect",
22784		zIndex: 1000,
22785
22786		// Callbacks
22787		activate: null,
22788		beforeStop: null,
22789		change: null,
22790		deactivate: null,
22791		out: null,
22792		over: null,
22793		receive: null,
22794		remove: null,
22795		sort: null,
22796		start: null,
22797		stop: null,
22798		update: null
22799	},
22800
22801	_isOverAxis: function( x, reference, size ) {
22802		return ( x >= reference ) && ( x < ( reference + size ) );
22803	},
22804
22805	_isFloating: function( item ) {
22806		return ( /left|right/ ).test( item.css( "float" ) ) ||
22807			( /inline|table-cell/ ).test( item.css( "display" ) );
22808	},
22809
22810	_create: function() {
22811		this.containerCache = {};
22812		this._addClass( "ui-sortable" );
22813
22814		//Get the items
22815		this.refresh();
22816
22817		//Let's determine the parent's offset
22818		this.offset = this.element.offset();
22819
22820		//Initialize mouse events for interaction
22821		this._mouseInit();
22822
22823		this._setHandleClassName();
22824
22825		//We're ready to go
22826		this.ready = true;
22827
22828	},
22829
22830	_setOption: function( key, value ) {
22831		this._super( key, value );
22832
22833		if ( key === "handle" ) {
22834			this._setHandleClassName();
22835		}
22836	},
22837
22838	_setHandleClassName: function() {
22839		var that = this;
22840		this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" );
22841		$.each( this.items, function() {
22842			that._addClass(
22843				this.instance.options.handle ?
22844					this.item.find( this.instance.options.handle ) :
22845					this.item,
22846				"ui-sortable-handle"
22847			);
22848		} );
22849	},
22850
22851	_destroy: function() {
22852		this._mouseDestroy();
22853
22854		for ( var i = this.items.length - 1; i >= 0; i-- ) {
22855			this.items[ i ].item.removeData( this.widgetName + "-item" );
22856		}
22857
22858		return this;
22859	},
22860
22861	_mouseCapture: function( event, overrideHandle ) {
22862		var currentItem = null,
22863			validHandle = false,
22864			that = this;
22865
22866		if ( this.reverting ) {
22867			return false;
22868		}
22869
22870		if ( this.options.disabled || this.options.type === "static" ) {
22871			return false;
22872		}
22873
22874		//We have to refresh the items data once first
22875		this._refreshItems( event );
22876
22877		//Find out if the clicked node (or one of its parents) is a actual item in this.items
22878		$( event.target ).parents().each( function() {
22879			if ( $.data( this, that.widgetName + "-item" ) === that ) {
22880				currentItem = $( this );
22881				return false;
22882			}
22883		} );
22884		if ( $.data( event.target, that.widgetName + "-item" ) === that ) {
22885			currentItem = $( event.target );
22886		}
22887
22888		if ( !currentItem ) {
22889			return false;
22890		}
22891		if ( this.options.handle && !overrideHandle ) {
22892			$( this.options.handle, currentItem ).find( "*" ).addBack().each( function() {
22893				if ( this === event.target ) {
22894					validHandle = true;
22895				}
22896			} );
22897			if ( !validHandle ) {
22898				return false;
22899			}
22900		}
22901
22902		this.currentItem = currentItem;
22903		this._removeCurrentsFromItems();
22904		return true;
22905
22906	},
22907
22908	_mouseStart: function( event, overrideHandle, noActivation ) {
22909
22910		var i, body,
22911			o = this.options;
22912
22913		this.currentContainer = this;
22914
22915		//We only need to call refreshPositions, because the refreshItems call has been moved to
22916		// mouseCapture
22917		this.refreshPositions();
22918
22919		//Prepare the dragged items parent
22920		this.appendTo = $( o.appendTo !== "parent" ?
22921				o.appendTo :
22922				this.currentItem.parent() );
22923
22924		//Create and append the visible helper
22925		this.helper = this._createHelper( event );
22926
22927		//Cache the helper size
22928		this._cacheHelperProportions();
22929
22930		/*
22931		 * - Position generation -
22932		 * This block generates everything position related - it's the core of draggables.
22933		 */
22934
22935		//Cache the margins of the original element
22936		this._cacheMargins();
22937
22938		//The element's absolute position on the page minus margins
22939		this.offset = this.currentItem.offset();
22940		this.offset = {
22941			top: this.offset.top - this.margins.top,
22942			left: this.offset.left - this.margins.left
22943		};
22944
22945		$.extend( this.offset, {
22946			click: { //Where the click happened, relative to the element
22947				left: event.pageX - this.offset.left,
22948				top: event.pageY - this.offset.top
22949			},
22950
22951			// This is a relative to absolute position minus the actual position calculation -
22952			// only used for relative positioned helper
22953			relative: this._getRelativeOffset()
22954		} );
22955
22956		// After we get the helper offset, but before we get the parent offset we can
22957		// change the helper's position to absolute
22958		// TODO: Still need to figure out a way to make relative sorting possible
22959		this.helper.css( "position", "absolute" );
22960		this.cssPosition = this.helper.css( "position" );
22961
22962		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
22963		if ( o.cursorAt ) {
22964			this._adjustOffsetFromHelper( o.cursorAt );
22965		}
22966
22967		//Cache the former DOM position
22968		this.domPosition = {
22969			prev: this.currentItem.prev()[ 0 ],
22970			parent: this.currentItem.parent()[ 0 ]
22971		};
22972
22973		// If the helper is not the original, hide the original so it's not playing any role during
22974		// the drag, won't cause anything bad this way
22975		if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
22976			this.currentItem.hide();
22977		}
22978
22979		//Create the placeholder
22980		this._createPlaceholder();
22981
22982		//Get the next scrolling parent
22983		this.scrollParent = this.placeholder.scrollParent();
22984
22985		$.extend( this.offset, {
22986			parent: this._getParentOffset()
22987		} );
22988
22989		//Set a containment if given in the options
22990		if ( o.containment ) {
22991			this._setContainment();
22992		}
22993
22994		if ( o.cursor && o.cursor !== "auto" ) { // cursor option
22995			body = this.document.find( "body" );
22996
22997			this._storedStylesheet =
22998				$( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
22999		}
23000
23001		// We need to make sure to grab the zIndex before setting the
23002		// opacity, because setting the opacity to anything lower than 1
23003		// causes the zIndex to change from "auto" to 0.
23004		if ( o.zIndex ) { // zIndex option
23005			if ( this.helper.css( "zIndex" ) ) {
23006				this._storedZIndex = this.helper.css( "zIndex" );
23007			}
23008			this.helper.css( "zIndex", o.zIndex );
23009		}
23010
23011		if ( o.opacity ) { // opacity option
23012			if ( this.helper.css( "opacity" ) ) {
23013				this._storedOpacity = this.helper.css( "opacity" );
23014			}
23015			this.helper.css( "opacity", o.opacity );
23016		}
23017
23018		//Prepare scrolling
23019		if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
23020				this.scrollParent[ 0 ].tagName !== "HTML" ) {
23021			this.overflowOffset = this.scrollParent.offset();
23022		}
23023
23024		//Call callbacks
23025		this._trigger( "start", event, this._uiHash() );
23026
23027		//Recache the helper size
23028		if ( !this._preserveHelperProportions ) {
23029			this._cacheHelperProportions();
23030		}
23031
23032		//Post "activate" events to possible containers
23033		if ( !noActivation ) {
23034			for ( i = this.containers.length - 1; i >= 0; i-- ) {
23035				this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
23036			}
23037		}
23038
23039		//Prepare possible droppables
23040		if ( $.ui.ddmanager ) {
23041			$.ui.ddmanager.current = this;
23042		}
23043
23044		if ( $.ui.ddmanager && !o.dropBehaviour ) {
23045			$.ui.ddmanager.prepareOffsets( this, event );
23046		}
23047
23048		this.dragging = true;
23049
23050		this._addClass( this.helper, "ui-sortable-helper" );
23051
23052		//Move the helper, if needed
23053		if ( !this.helper.parent().is( this.appendTo ) ) {
23054			this.helper.detach().appendTo( this.appendTo );
23055
23056			//Update position
23057			this.offset.parent = this._getParentOffset();
23058		}
23059
23060		//Generate the original position
23061		this.position = this.originalPosition = this._generatePosition( event );
23062		this.originalPageX = event.pageX;
23063		this.originalPageY = event.pageY;
23064		this.lastPositionAbs = this.positionAbs = this._convertPositionTo( "absolute" );
23065
23066		this._mouseDrag( event );
23067
23068		return true;
23069
23070	},
23071
23072	_scroll: function( event ) {
23073		var o = this.options,
23074			scrolled = false;
vendor: 4,489 bytes, lines 23075-23217
23075
23076		if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
23077				this.scrollParent[ 0 ].tagName !== "HTML" ) {
23078
23079			if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) -
23080					event.pageY < o.scrollSensitivity ) {
23081				this.scrollParent[ 0 ].scrollTop =
23082					scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
23083			} else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) {
23084				this.scrollParent[ 0 ].scrollTop =
23085					scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
23086			}
23087
23088			if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) -
23089					event.pageX < o.scrollSensitivity ) {
23090				this.scrollParent[ 0 ].scrollLeft = scrolled =
23091					this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
23092			} else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) {
23093				this.scrollParent[ 0 ].scrollLeft = scrolled =
23094					this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
23095			}
23096
23097		} else {
23098
23099			if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) {
23100				scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed );
23101			} else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) <
23102					o.scrollSensitivity ) {
23103				scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed );
23104			}
23105
23106			if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) {
23107				scrolled = this.document.scrollLeft(
23108					this.document.scrollLeft() - o.scrollSpeed
23109				);
23110			} else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) <
23111					o.scrollSensitivity ) {
23112				scrolled = this.document.scrollLeft(
23113					this.document.scrollLeft() + o.scrollSpeed
23114				);
23115			}
23116
23117		}
23118
23119		return scrolled;
23120	},
23121
23122	_mouseDrag: function( event ) {
23123		var i, item, itemElement, intersection,
23124			o = this.options;
23125
23126		//Compute the helpers position
23127		this.position = this._generatePosition( event );
23128		this.positionAbs = this._convertPositionTo( "absolute" );
23129
23130		//Set the helper position
23131		if ( !this.options.axis || this.options.axis !== "y" ) {
23132			this.helper[ 0 ].style.left = this.position.left + "px";
23133		}
23134		if ( !this.options.axis || this.options.axis !== "x" ) {
23135			this.helper[ 0 ].style.top = this.position.top + "px";
23136		}
23137
23138		//Do scrolling
23139		if ( o.scroll ) {
23140			if ( this._scroll( event ) !== false ) {
23141
23142				//Update item positions used in position checks
23143				this._refreshItemPositions( true );
23144
23145				if ( $.ui.ddmanager && !o.dropBehaviour ) {
23146					$.ui.ddmanager.prepareOffsets( this, event );
23147				}
23148			}
23149		}
23150
23151		this.dragDirection = {
23152			vertical: this._getDragVerticalDirection(),
23153			horizontal: this._getDragHorizontalDirection()
23154		};
23155
23156		//Rearrange
23157		for ( i = this.items.length - 1; i >= 0; i-- ) {
23158
23159			//Cache variables and intersection, continue if no intersection
23160			item = this.items[ i ];
23161			itemElement = item.item[ 0 ];
23162			intersection = this._intersectsWithPointer( item );
23163			if ( !intersection ) {
23164				continue;
23165			}
23166
23167			// Only put the placeholder inside the current Container, skip all
23168			// items from other containers. This works because when moving
23169			// an item from one container to another the
23170			// currentContainer is switched before the placeholder is moved.
23171			//
23172			// Without this, moving items in "sub-sortables" can cause
23173			// the placeholder to jitter between the outer and inner container.
23174			if ( item.instance !== this.currentContainer ) {
23175				continue;
23176			}
23177
23178			// Cannot intersect with itself
23179			// no useless actions that have been done before
23180			// no action if the item moved is the parent of the item checked
23181			if ( itemElement !== this.currentItem[ 0 ] &&
23182				this.placeholder[ intersection === 1 ?
23183				"next" : "prev" ]()[ 0 ] !== itemElement &&
23184				!$.contains( this.placeholder[ 0 ], itemElement ) &&
23185				( this.options.type === "semi-dynamic" ?
23186					!$.contains( this.element[ 0 ], itemElement ) :
23187					true
23188				)
23189			) {
23190
23191				this.direction = intersection === 1 ? "down" : "up";
23192
23193				if ( this.options.tolerance === "pointer" ||
23194						this._intersectsWithSides( item ) ) {
23195					this._rearrange( event, item );
23196				} else {
23197					break;
23198				}
23199
23200				this._trigger( "change", event, this._uiHash() );
23201				break;
23202			}
23203		}
23204
23205		//Post events to containers
23206		this._contactContainers( event );
23207
23208		//Interconnect with droppables
23209		if ( $.ui.ddmanager ) {
23210			$.ui.ddmanager.drag( this, event );
23211		}
23212
23213		//Call callbacks
23214		this._trigger( "sort", event, this._uiHash() );
23215
23216		this.lastPositionAbs = this.positionAbs;
23217		return false;
vendor: 5,063 bytes, lines 23218-23407
23218
23219	},
23220
23221	_mouseStop: function( event, noPropagation ) {
23222
23223		if ( !event ) {
23224			return;
23225		}
23226
23227		//If we are using droppables, inform the manager about the drop
23228		if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
23229			$.ui.ddmanager.drop( this, event );
23230		}
23231
23232		if ( this.options.revert ) {
23233			var that = this,
23234				cur = this.placeholder.offset(),
23235				axis = this.options.axis,
23236				animation = {};
23237
23238			if ( !axis || axis === "x" ) {
23239				animation.left = cur.left - this.offset.parent.left - this.margins.left +
23240					( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
23241						0 :
23242						this.offsetParent[ 0 ].scrollLeft
23243					);
23244			}
23245			if ( !axis || axis === "y" ) {
23246				animation.top = cur.top - this.offset.parent.top - this.margins.top +
23247					( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
23248						0 :
23249						this.offsetParent[ 0 ].scrollTop
23250					);
23251			}
23252			this.reverting = true;
23253			$( this.helper ).animate(
23254				animation,
23255				parseInt( this.options.revert, 10 ) || 500,
23256				function() {
23257					that._clear( event );
23258				}
23259			);
23260		} else {
23261			this._clear( event, noPropagation );
23262		}
23263
23264		return false;
23265
23266	},
23267
23268	cancel: function() {
23269
23270		if ( this.dragging ) {
23271
23272			this._mouseUp( new $.Event( "mouseup", { target: null } ) );
23273
23274			if ( this.options.helper === "original" ) {
23275				this.currentItem.css( this._storedCSS );
23276				this._removeClass( this.currentItem, "ui-sortable-helper" );
23277			} else {
23278				this.currentItem.show();
23279			}
23280
23281			//Post deactivating events to containers
23282			for ( var i = this.containers.length - 1; i >= 0; i-- ) {
23283				this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) );
23284				if ( this.containers[ i ].containerCache.over ) {
23285					this.containers[ i ]._trigger( "out", null, this._uiHash( this ) );
23286					this.containers[ i ].containerCache.over = 0;
23287				}
23288			}
23289
23290		}
23291
23292		if ( this.placeholder ) {
23293
23294			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
23295			// it unbinds ALL events from the original node!
23296			if ( this.placeholder[ 0 ].parentNode ) {
23297				this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
23298			}
23299			if ( this.options.helper !== "original" && this.helper &&
23300					this.helper[ 0 ].parentNode ) {
23301				this.helper.remove();
23302			}
23303
23304			$.extend( this, {
23305				helper: null,
23306				dragging: false,
23307				reverting: false,
23308				_noFinalSort: null
23309			} );
23310
23311			if ( this.domPosition.prev ) {
23312				$( this.domPosition.prev ).after( this.currentItem );
23313			} else {
23314				$( this.domPosition.parent ).prepend( this.currentItem );
23315			}
23316		}
23317
23318		return this;
23319
23320	},
23321
23322	serialize: function( o ) {
23323
23324		var items = this._getItemsAsjQuery( o && o.connected ),
23325			str = [];
23326		o = o || {};
23327
23328		$( items ).each( function() {
23329			var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" )
23330				.match( o.expression || ( /(.+)[\-=_](.+)/ ) );
23331			if ( res ) {
23332				str.push(
23333					( o.key || res[ 1 ] + "[]" ) +
23334					"=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) );
23335			}
23336		} );
23337
23338		if ( !str.length && o.key ) {
23339			str.push( o.key + "=" );
23340		}
23341
23342		return str.join( "&" );
23343
23344	},
23345
23346	toArray: function( o ) {
23347
23348		var items = this._getItemsAsjQuery( o && o.connected ),
23349			ret = [];
23350
23351		o = o || {};
23352
23353		items.each( function() {
23354			ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" );
23355		} );
23356		return ret;
23357
23358	},
23359
23360	/* Be careful with the following core functions */
23361	_intersectsWith: function( item ) {
23362
23363		var x1 = this.positionAbs.left,
23364			x2 = x1 + this.helperProportions.width,
23365			y1 = this.positionAbs.top,
23366			y2 = y1 + this.helperProportions.height,
23367			l = item.left,
23368			r = l + item.width,
23369			t = item.top,
23370			b = t + item.height,
23371			dyClick = this.offset.click.top,
23372			dxClick = this.offset.click.left,
23373			isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t &&
23374				( y1 + dyClick ) < b ),
23375			isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l &&
23376				( x1 + dxClick ) < r ),
23377			isOverElement = isOverElementHeight && isOverElementWidth;
23378
23379		if ( this.options.tolerance === "pointer" ||
23380			this.options.forcePointerForContainers ||
23381			( this.options.tolerance !== "pointer" &&
23382				this.helperProportions[ this.floating ? "width" : "height" ] >
23383				item[ this.floating ? "width" : "height" ] )
23384		) {
23385			return isOverElement;
23386		} else {
23387
23388			return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half
23389				x2 - ( this.helperProportions.width / 2 ) < r && // Left Half
23390				t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half
23391				y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half
23392
23393		}
23394	},
23395
23396	_intersectsWithPointer: function( item ) {
23397		var verticalDirection, horizontalDirection,
23398			isOverElementHeight = ( this.options.axis === "x" ) ||
23399				this._isOverAxis(
23400					this.positionAbs.top + this.offset.click.top, item.top, item.height ),
23401			isOverElementWidth = ( this.options.axis === "y" ) ||
23402				this._isOverAxis(
23403					this.positionAbs.left + this.offset.click.left, item.left, item.width ),
23404			isOverElement = isOverElementHeight && isOverElementWidth;
23405
23406		if ( !isOverElement ) {
23407			return false;
vendor: 8,518 bytes, lines 23408-23682
23408		}
23409
23410		verticalDirection = this.dragDirection.vertical;
23411		horizontalDirection = this.dragDirection.horizontal;
23412
23413		return this.floating ?
23414			( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) :
23415			( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) );
23416
23417	},
23418
23419	_intersectsWithSides: function( item ) {
23420
23421		var isOverBottomHalf = this._isOverAxis( this.positionAbs.top +
23422				this.offset.click.top, item.top + ( item.height / 2 ), item.height ),
23423			isOverRightHalf = this._isOverAxis( this.positionAbs.left +
23424				this.offset.click.left, item.left + ( item.width / 2 ), item.width ),
23425			verticalDirection = this.dragDirection.vertical,
23426			horizontalDirection = this.dragDirection.horizontal;
23427
23428		if ( this.floating && horizontalDirection ) {
23429			return ( ( horizontalDirection === "right" && isOverRightHalf ) ||
23430				( horizontalDirection === "left" && !isOverRightHalf ) );
23431		} else {
23432			return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) ||
23433				( verticalDirection === "up" && !isOverBottomHalf ) );
23434		}
23435
23436	},
23437
23438	_getDragVerticalDirection: function() {
23439		var delta = this.positionAbs.top - this.lastPositionAbs.top;
23440		return delta !== 0 && ( delta > 0 ? "down" : "up" );
23441	},
23442
23443	_getDragHorizontalDirection: function() {
23444		var delta = this.positionAbs.left - this.lastPositionAbs.left;
23445		return delta !== 0 && ( delta > 0 ? "right" : "left" );
23446	},
23447
23448	refresh: function( event ) {
23449		this._refreshItems( event );
23450		this._setHandleClassName();
23451		this.refreshPositions();
23452		return this;
23453	},
23454
23455	_connectWith: function() {
23456		var options = this.options;
23457		return options.connectWith.constructor === String ?
23458			[ options.connectWith ] :
23459			options.connectWith;
23460	},
23461
23462	_getItemsAsjQuery: function( connected ) {
23463
23464		var i, j, cur, inst,
23465			items = [],
23466			queries = [],
23467			connectWith = this._connectWith();
23468
23469		if ( connectWith && connected ) {
23470			for ( i = connectWith.length - 1; i >= 0; i-- ) {
23471				cur = $( connectWith[ i ], this.document[ 0 ] );
23472				for ( j = cur.length - 1; j >= 0; j-- ) {
23473					inst = $.data( cur[ j ], this.widgetFullName );
23474					if ( inst && inst !== this && !inst.options.disabled ) {
23475						queries.push( [ typeof inst.options.items === "function" ?
23476							inst.options.items.call( inst.element ) :
23477							$( inst.options.items, inst.element )
23478								.not( ".ui-sortable-helper" )
23479								.not( ".ui-sortable-placeholder" ), inst ] );
23480					}
23481				}
23482			}
23483		}
23484
23485		queries.push( [ typeof this.options.items === "function" ?
23486			this.options.items
23487				.call( this.element, null, { options: this.options, item: this.currentItem } ) :
23488			$( this.options.items, this.element )
23489				.not( ".ui-sortable-helper" )
23490				.not( ".ui-sortable-placeholder" ), this ] );
23491
23492		function addItems() {
23493			items.push( this );
23494		}
23495		for ( i = queries.length - 1; i >= 0; i-- ) {
23496			queries[ i ][ 0 ].each( addItems );
23497		}
23498
23499		return $( items );
23500
23501	},
23502
23503	_removeCurrentsFromItems: function() {
23504
23505		var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" );
23506
23507		this.items = $.grep( this.items, function( item ) {
23508			for ( var j = 0; j < list.length; j++ ) {
23509				if ( list[ j ] === item.item[ 0 ] ) {
23510					return false;
23511				}
23512			}
23513			return true;
23514		} );
23515
23516	},
23517
23518	_refreshItems: function( event ) {
23519
23520		this.items = [];
23521		this.containers = [ this ];
23522
23523		var i, j, cur, inst, targetData, _queries, item, queriesLength,
23524			items = this.items,
23525			queries = [ [ typeof this.options.items === "function" ?
23526				this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) :
23527				$( this.options.items, this.element ), this ] ],
23528			connectWith = this._connectWith();
23529
23530		//Shouldn't be run the first time through due to massive slow-down
23531		if ( connectWith && this.ready ) {
23532			for ( i = connectWith.length - 1; i >= 0; i-- ) {
23533				cur = $( connectWith[ i ], this.document[ 0 ] );
23534				for ( j = cur.length - 1; j >= 0; j-- ) {
23535					inst = $.data( cur[ j ], this.widgetFullName );
23536					if ( inst && inst !== this && !inst.options.disabled ) {
23537						queries.push( [ typeof inst.options.items === "function" ?
23538							inst.options.items
23539								.call( inst.element[ 0 ], event, { item: this.currentItem } ) :
23540							$( inst.options.items, inst.element ), inst ] );
23541						this.containers.push( inst );
23542					}
23543				}
23544			}
23545		}
23546
23547		for ( i = queries.length - 1; i >= 0; i-- ) {
23548			targetData = queries[ i ][ 1 ];
23549			_queries = queries[ i ][ 0 ];
23550
23551			for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) {
23552				item = $( _queries[ j ] );
23553
23554				// Data for target checking (mouse manager)
23555				item.data( this.widgetName + "-item", targetData );
23556
23557				items.push( {
23558					item: item,
23559					instance: targetData,
23560					width: 0, height: 0,
23561					left: 0, top: 0
23562				} );
23563			}
23564		}
23565
23566	},
23567
23568	_refreshItemPositions: function( fast ) {
23569		var i, item, t, p;
23570
23571		for ( i = this.items.length - 1; i >= 0; i-- ) {
23572			item = this.items[ i ];
23573
23574			//We ignore calculating positions of all connected containers when we're not over them
23575			if ( this.currentContainer && item.instance !== this.currentContainer &&
23576					item.item[ 0 ] !== this.currentItem[ 0 ] ) {
23577				continue;
23578			}
23579
23580			t = this.options.toleranceElement ?
23581				$( this.options.toleranceElement, item.item ) :
23582				item.item;
23583
23584			if ( !fast ) {
23585				item.width = t.outerWidth();
23586				item.height = t.outerHeight();
23587			}
23588
23589			p = t.offset();
23590			item.left = p.left;
23591			item.top = p.top;
23592		}
23593	},
23594
23595	refreshPositions: function( fast ) {
23596
23597		// Determine whether items are being displayed horizontally
23598		this.floating = this.items.length ?
23599			this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
23600			false;
23601
23602		// This has to be redone because due to the item being moved out/into the offsetParent,
23603		// the offsetParent's position will change
23604		if ( this.offsetParent && this.helper ) {
23605			this.offset.parent = this._getParentOffset();
23606		}
23607
23608		this._refreshItemPositions( fast );
23609
23610		var i, p;
23611
23612		if ( this.options.custom && this.options.custom.refreshContainers ) {
23613			this.options.custom.refreshContainers.call( this );
23614		} else {
23615			for ( i = this.containers.length - 1; i >= 0; i-- ) {
23616				p = this.containers[ i ].element.offset();
23617				this.containers[ i ].containerCache.left = p.left;
23618				this.containers[ i ].containerCache.top = p.top;
23619				this.containers[ i ].containerCache.width =
23620					this.containers[ i ].element.outerWidth();
23621				this.containers[ i ].containerCache.height =
23622					this.containers[ i ].element.outerHeight();
23623			}
23624		}
23625
23626		return this;
23627	},
23628
23629	_createPlaceholder: function( that ) {
23630		that = that || this;
23631		var className, nodeName,
23632			o = that.options;
23633
23634		if ( !o.placeholder || o.placeholder.constructor === String ) {
23635			className = o.placeholder;
23636			nodeName = that.currentItem[ 0 ].nodeName.toLowerCase();
23637			o.placeholder = {
23638				element: function() {
23639
23640					var element = $( "<" + nodeName + ">", that.document[ 0 ] );
23641
23642					that._addClass( element, "ui-sortable-placeholder",
23643							className || that.currentItem[ 0 ].className )
23644						._removeClass( element, "ui-sortable-helper" );
23645
23646					if ( nodeName === "tbody" ) {
23647						that._createTrPlaceholder(
23648							that.currentItem.find( "tr" ).eq( 0 ),
23649							$( "<tr>", that.document[ 0 ] ).appendTo( element )
23650						);
23651					} else if ( nodeName === "tr" ) {
23652						that._createTrPlaceholder( that.currentItem, element );
23653					} else if ( nodeName === "img" ) {
23654						element.attr( "src", that.currentItem.attr( "src" ) );
23655					}
23656
23657					if ( !className ) {
23658						element.css( "visibility", "hidden" );
23659					}
23660
23661					return element;
23662				},
23663				update: function( container, p ) {
23664
23665					// 1. If a className is set as 'placeholder option, we don't force sizes -
23666					// the class is responsible for that
23667					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a
23668					// class name is specified
23669					if ( className && !o.forcePlaceholderSize ) {
23670						return;
23671					}
23672
23673					// If the element doesn't have a actual height or width by itself (without
23674					// styles coming from a stylesheet), it receives the inline height and width
23675					// from the dragged item. Or, if it's a tbody or tr, it's going to have a height
23676					// anyway since we're populating them with <td>s above, but they're unlikely to
23677					// be the correct height on their own if the row heights are dynamic, so we'll
23678					// always assign the height of the dragged item given forcePlaceholderSize
23679					// is true.
23680					if ( !p.height() || ( o.forcePlaceholderSize &&
23681							( nodeName === "tbody" || nodeName === "tr" ) ) ) {
23682						p.height(
vendor: 10,010 bytes, lines 23683-23988
23683							that.currentItem.innerHeight() -
23684							parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) -
23685							parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) );
23686					}
23687					if ( !p.width() ) {
23688						p.width(
23689							that.currentItem.innerWidth() -
23690							parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) -
23691							parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) );
23692					}
23693				}
23694			};
23695		}
23696
23697		//Create the placeholder
23698		that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) );
23699
23700		//Append it after the actual current item
23701		that.currentItem.after( that.placeholder );
23702
23703		//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
23704		o.placeholder.update( that, that.placeholder );
23705
23706	},
23707
23708	_createTrPlaceholder: function( sourceTr, targetTr ) {
23709		var that = this;
23710
23711		sourceTr.children().each( function() {
23712			$( "<td>&#160;</td>", that.document[ 0 ] )
23713				.attr( "colspan", $( this ).attr( "colspan" ) || 1 )
23714				.appendTo( targetTr );
23715		} );
23716	},
23717
23718	_contactContainers: function( event ) {
23719		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom,
23720			floating, axis,
23721			innermostContainer = null,
23722			innermostIndex = null;
23723
23724		// Get innermost container that intersects with item
23725		for ( i = this.containers.length - 1; i >= 0; i-- ) {
23726
23727			// Never consider a container that's located within the item itself
23728			if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) {
23729				continue;
23730			}
23731
23732			if ( this._intersectsWith( this.containers[ i ].containerCache ) ) {
23733
23734				// If we've already found a container and it's more "inner" than this, then continue
23735				if ( innermostContainer &&
23736						$.contains(
23737							this.containers[ i ].element[ 0 ],
23738							innermostContainer.element[ 0 ] ) ) {
23739					continue;
23740				}
23741
23742				innermostContainer = this.containers[ i ];
23743				innermostIndex = i;
23744
23745			} else {
23746
23747				// container doesn't intersect. trigger "out" event if necessary
23748				if ( this.containers[ i ].containerCache.over ) {
23749					this.containers[ i ]._trigger( "out", event, this._uiHash( this ) );
23750					this.containers[ i ].containerCache.over = 0;
23751				}
23752			}
23753
23754		}
23755
23756		// If no intersecting containers found, return
23757		if ( !innermostContainer ) {
23758			return;
23759		}
23760
23761		// Move the item into the container if it's not there already
23762		if ( this.containers.length === 1 ) {
23763			if ( !this.containers[ innermostIndex ].containerCache.over ) {
23764				this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
23765				this.containers[ innermostIndex ].containerCache.over = 1;
23766			}
23767		} else {
23768
23769			// When entering a new container, we will find the item with the least distance and
23770			// append our item near it
23771			dist = 10000;
23772			itemWithLeastDistance = null;
23773			floating = innermostContainer.floating || this._isFloating( this.currentItem );
23774			posProperty = floating ? "left" : "top";
23775			sizeProperty = floating ? "width" : "height";
23776			axis = floating ? "pageX" : "pageY";
23777
23778			for ( j = this.items.length - 1; j >= 0; j-- ) {
23779				if ( !$.contains(
23780						this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] )
23781				) {
23782					continue;
23783				}
23784				if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) {
23785					continue;
23786				}
23787
23788				cur = this.items[ j ].item.offset()[ posProperty ];
23789				nearBottom = false;
23790				if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
23791					nearBottom = true;
23792				}
23793
23794				if ( Math.abs( event[ axis ] - cur ) < dist ) {
23795					dist = Math.abs( event[ axis ] - cur );
23796					itemWithLeastDistance = this.items[ j ];
23797					this.direction = nearBottom ? "up" : "down";
23798				}
23799			}
23800
23801			//Check if dropOnEmpty is enabled
23802			if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) {
23803				return;
23804			}
23805
23806			if ( this.currentContainer === this.containers[ innermostIndex ] ) {
23807				if ( !this.currentContainer.containerCache.over ) {
23808					this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
23809					this.currentContainer.containerCache.over = 1;
23810				}
23811				return;
23812			}
23813
23814			if ( itemWithLeastDistance ) {
23815				this._rearrange( event, itemWithLeastDistance, null, true );
23816			} else {
23817				this._rearrange( event, null, this.containers[ innermostIndex ].element, true );
23818			}
23819			this._trigger( "change", event, this._uiHash() );
23820			this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) );
23821			this.currentContainer = this.containers[ innermostIndex ];
23822
23823			//Update the placeholder
23824			this.options.placeholder.update( this.currentContainer, this.placeholder );
23825
23826			//Update scrollParent
23827			this.scrollParent = this.placeholder.scrollParent();
23828
23829			//Update overflowOffset
23830			if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
23831					this.scrollParent[ 0 ].tagName !== "HTML" ) {
23832				this.overflowOffset = this.scrollParent.offset();
23833			}
23834
23835			this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
23836			this.containers[ innermostIndex ].containerCache.over = 1;
23837		}
23838
23839	},
23840
23841	_createHelper: function( event ) {
23842
23843		var o = this.options,
23844			helper = typeof o.helper === "function" ?
23845				$( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) :
23846				( o.helper === "clone" ? this.currentItem.clone() : this.currentItem );
23847
23848		//Add the helper to the DOM if that didn't happen already
23849		if ( !helper.parents( "body" ).length ) {
23850			this.appendTo[ 0 ].appendChild( helper[ 0 ] );
23851		}
23852
23853		if ( helper[ 0 ] === this.currentItem[ 0 ] ) {
23854			this._storedCSS = {
23855				width: this.currentItem[ 0 ].style.width,
23856				height: this.currentItem[ 0 ].style.height,
23857				position: this.currentItem.css( "position" ),
23858				top: this.currentItem.css( "top" ),
23859				left: this.currentItem.css( "left" )
23860			};
23861		}
23862
23863		if ( !helper[ 0 ].style.width || o.forceHelperSize ) {
23864			helper.width( this.currentItem.width() );
23865		}
23866		if ( !helper[ 0 ].style.height || o.forceHelperSize ) {
23867			helper.height( this.currentItem.height() );
23868		}
23869
23870		return helper;
23871
23872	},
23873
23874	_adjustOffsetFromHelper: function( obj ) {
23875		if ( typeof obj === "string" ) {
23876			obj = obj.split( " " );
23877		}
23878		if ( Array.isArray( obj ) ) {
23879			obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
23880		}
23881		if ( "left" in obj ) {
23882			this.offset.click.left = obj.left + this.margins.left;
23883		}
23884		if ( "right" in obj ) {
23885			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
23886		}
23887		if ( "top" in obj ) {
23888			this.offset.click.top = obj.top + this.margins.top;
23889		}
23890		if ( "bottom" in obj ) {
23891			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
23892		}
23893	},
23894
23895	_getParentOffset: function() {
23896
23897		//Get the offsetParent and cache its position
23898		this.offsetParent = this.helper.offsetParent();
23899		var po = this.offsetParent.offset();
23900
23901		// This is a special case where we need to modify a offset calculated on start, since the
23902		// following happened:
23903		// 1. The position of the helper is absolute, so it's position is calculated based on the
23904		// next positioned parent
23905		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
23906		// the document, which means that the scroll is included in the initial calculation of the
23907		// offset of the parent, and never recalculated upon drag
23908		if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] &&
23909				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
23910			po.left += this.scrollParent.scrollLeft();
23911			po.top += this.scrollParent.scrollTop();
23912		}
23913
23914		// This needs to be actually done for all browsers, since pageX/pageY includes
23915		// this information.
23916		if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ) {
23917			po = { top: 0, left: 0 };
23918		}
23919
23920		return {
23921			top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
23922			left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
23923		};
23924
23925	},
23926
23927	_getRelativeOffset: function() {
23928
23929		if ( this.cssPosition === "relative" ) {
23930			var p = this.currentItem.position();
23931			return {
23932				top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
23933					this.scrollParent.scrollTop(),
23934				left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
23935					this.scrollParent.scrollLeft()
23936			};
23937		} else {
23938			return { top: 0, left: 0 };
23939		}
23940
23941	},
23942
23943	_cacheMargins: function() {
23944		this.margins = {
23945			left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ),
23946			top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 )
23947		};
23948	},
23949
23950	_cacheHelperProportions: function() {
23951		this.helperProportions = {
23952			width: this.helper.outerWidth(),
23953			height: this.helper.outerHeight()
23954		};
23955	},
23956
23957	_setContainment: function() {
23958
23959		var ce, co, over,
23960			o = this.options;
23961		if ( o.containment === "parent" ) {
23962			o.containment = this.helper[ 0 ].parentNode;
23963		}
23964		if ( o.containment === "document" || o.containment === "window" ) {
23965			this.containment = [
23966				0 - this.offset.relative.left - this.offset.parent.left,
23967				0 - this.offset.relative.top - this.offset.parent.top,
23968				o.containment === "document" ?
23969					this.document.width() :
23970					this.window.width() - this.helperProportions.width - this.margins.left,
23971				( o.containment === "document" ?
23972					( this.document.height() || document.body.parentNode.scrollHeight ) :
23973					this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight
23974				) - this.helperProportions.height - this.margins.top
23975			];
23976		}
23977
23978		if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) {
23979			ce = $( o.containment )[ 0 ];
23980			co = $( o.containment ).offset();
23981			over = ( $( ce ).css( "overflow" ) !== "hidden" );
23982
23983			this.containment = [
23984				co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) +
23985					( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left,
23986				co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) +
23987					( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top,
23988				co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) 
vendor: 1,747 bytes, lines 23988-24040
23988: ce.offsetWidth ) -
23989					( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) -
23990					( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) -
23991					this.helperProportions.width - this.margins.left,
23992				co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
23993					( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) -
23994					( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) -
23995					this.helperProportions.height - this.margins.top
23996			];
23997		}
23998
23999	},
24000
24001	_convertPositionTo: function( d, pos ) {
24002
24003		if ( !pos ) {
24004			pos = this.position;
24005		}
24006		var mod = d === "absolute" ? 1 : -1,
24007			scroll = this.cssPosition === "absolute" &&
24008				!( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
24009				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
24010					this.offsetParent :
24011					this.scrollParent,
24012			scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
24013
24014		return {
24015			top: (
24016
24017				// The absolute mouse position
24018				pos.top	+
24019
24020				// Only for relative positioned nodes: Relative offset from element to offset parent
24021				this.offset.relative.top * mod +
24022
24023				// The offsetParent's offset without borders (offset + border)
24024				this.offset.parent.top * mod -
24025				( ( this.cssPosition === "fixed" ?
24026					-this.scrollParent.scrollTop() :
24027					( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod )
24028			),
24029			left: (
24030
24031				// The absolute mouse position
24032				pos.left +
24033
24034				// Only for relative positioned nodes: Relative offset from element to offset parent
24035				this.offset.relative.left * mod +
24036
24037				// The offsetParent's offset without borders (offset + border)
24038				this.offset.parent.left * mod	-
24039				( ( this.cssPosition === "fixed" ?
24040					-this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
vendor: 4,632 bytes, lines 24041-24184
24041					scroll.scrollLeft() ) * mod )
24042			)
24043		};
24044
24045	},
24046
24047	_generatePosition: function( event ) {
24048
24049		var top, left,
24050			o = this.options,
24051			pageX = event.pageX,
24052			pageY = event.pageY,
24053			scroll = this.cssPosition === "absolute" &&
24054				!( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
24055				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
24056					this.offsetParent :
24057					this.scrollParent,
24058				scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
24059
24060		// This is another very weird special case that only happens for relative elements:
24061		// 1. If the css position is relative
24062		// 2. and the scroll parent is the document or similar to the offset parent
24063		// we have to refresh the relative offset during the scroll so there are no jumps
24064		if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
24065				this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) {
24066			this.offset.relative = this._getRelativeOffset();
24067		}
24068
24069		/*
24070		 * - Position constraining -
24071		 * Constrain the position to a mix of grid, containment.
24072		 */
24073
24074		if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options
24075
24076			if ( this.containment ) {
24077				if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) {
24078					pageX = this.containment[ 0 ] + this.offset.click.left;
24079				}
24080				if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) {
24081					pageY = this.containment[ 1 ] + this.offset.click.top;
24082				}
24083				if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) {
24084					pageX = this.containment[ 2 ] + this.offset.click.left;
24085				}
24086				if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) {
24087					pageY = this.containment[ 3 ] + this.offset.click.top;
24088				}
24089			}
24090
24091			if ( o.grid ) {
24092				top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) /
24093					o.grid[ 1 ] ) * o.grid[ 1 ];
24094				pageY = this.containment ?
24095					( ( top - this.offset.click.top >= this.containment[ 1 ] &&
24096						top - this.offset.click.top <= this.containment[ 3 ] ) ?
24097							top :
24098							( ( top - this.offset.click.top >= this.containment[ 1 ] ) ?
24099								top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) :
24100								top;
24101
24102				left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) /
24103					o.grid[ 0 ] ) * o.grid[ 0 ];
24104				pageX = this.containment ?
24105					( ( left - this.offset.click.left >= this.containment[ 0 ] &&
24106						left - this.offset.click.left <= this.containment[ 2 ] ) ?
24107							left :
24108							( ( left - this.offset.click.left >= this.containment[ 0 ] ) ?
24109								left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) :
24110								left;
24111			}
24112
24113		}
24114
24115		return {
24116			top: (
24117
24118				// The absolute mouse position
24119				pageY -
24120
24121				// Click offset (relative to the element)
24122				this.offset.click.top -
24123
24124				// Only for relative positioned nodes: Relative offset from element to offset parent
24125				this.offset.relative.top -
24126
24127				// The offsetParent's offset without borders (offset + border)
24128				this.offset.parent.top +
24129				( ( this.cssPosition === "fixed" ?
24130					-this.scrollParent.scrollTop() :
24131					( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) )
24132			),
24133			left: (
24134
24135				// The absolute mouse position
24136				pageX -
24137
24138				// Click offset (relative to the element)
24139				this.offset.click.left -
24140
24141				// Only for relative positioned nodes: Relative offset from element to offset parent
24142				this.offset.relative.left -
24143
24144				// The offsetParent's offset without borders (offset + border)
24145				this.offset.parent.left +
24146				( ( this.cssPosition === "fixed" ?
24147					-this.scrollParent.scrollLeft() :
24148					scrollIsRootNode ? 0 : scroll.scrollLeft() ) )
24149			)
24150		};
24151
24152	},
24153
24154	_rearrange: function( event, i, a, hardRefresh ) {
24155
24156		if ( a ) {
24157			a[ 0 ].appendChild( this.placeholder[ 0 ] );
24158		} else {
24159			i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ],
24160				( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) );
24161		}
24162
24163		//Various things done here to improve the performance:
24164		// 1. we create a setTimeout, that calls refreshPositions
24165		// 2. on the instance, we have a counter variable, that get's higher after every append
24166		// 3. on the local scope, we copy the counter variable, and check in the timeout,
24167		// if it's still the same
24168		// 4. this lets only the last addition to the timeout stack through
24169		this.counter = this.counter ? ++this.counter : 1;
24170		var counter = this.counter;
24171
24172		this._delay( function() {
24173			if ( counter === this.counter ) {
24174
24175				//Precompute after each DOM insertion, NOT on mousemove
24176				this.refreshPositions( !hardRefresh );
24177			}
24178		} );
24179
24180	},
24181
24182	_clear: function( event, noPropagation ) {
24183
24184		this.reverting = false;
vendor: 4,255 bytes, lines 24185-24329
24185
24186		// We delay all events that have to be triggered to after the point where the placeholder
24187		// has been removed and everything else normalized again
24188		var i,
24189			delayedTriggers = [];
24190
24191		// We first have to update the dom position of the actual currentItem
24192		// Note: don't do it if the current item is already removed (by a user), or it gets
24193		// reappended (see #4088)
24194		if ( !this._noFinalSort && this.currentItem.parent().length ) {
24195			this.placeholder.before( this.currentItem );
24196		}
24197		this._noFinalSort = null;
24198
24199		if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) {
24200			for ( i in this._storedCSS ) {
24201				if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) {
24202					this._storedCSS[ i ] = "";
24203				}
24204			}
24205			this.currentItem.css( this._storedCSS );
24206			this._removeClass( this.currentItem, "ui-sortable-helper" );
24207		} else {
24208			this.currentItem.show();
24209		}
24210
24211		if ( this.fromOutside && !noPropagation ) {
24212			delayedTriggers.push( function( event ) {
24213				this._trigger( "receive", event, this._uiHash( this.fromOutside ) );
24214			} );
24215		}
24216		if ( ( this.fromOutside ||
24217				this.domPosition.prev !==
24218				this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] ||
24219				this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) {
24220
24221			// Trigger update callback if the DOM position has changed
24222			delayedTriggers.push( function( event ) {
24223				this._trigger( "update", event, this._uiHash() );
24224			} );
24225		}
24226
24227		// Check if the items Container has Changed and trigger appropriate
24228		// events.
24229		if ( this !== this.currentContainer ) {
24230			if ( !noPropagation ) {
24231				delayedTriggers.push( function( event ) {
24232					this._trigger( "remove", event, this._uiHash() );
24233				} );
24234				delayedTriggers.push( ( function( c ) {
24235					return function( event ) {
24236						c._trigger( "receive", event, this._uiHash( this ) );
24237					};
24238				} ).call( this, this.currentContainer ) );
24239				delayedTriggers.push( ( function( c ) {
24240					return function( event ) {
24241						c._trigger( "update", event, this._uiHash( this ) );
24242					};
24243				} ).call( this, this.currentContainer ) );
24244			}
24245		}
24246
24247		//Post events to containers
24248		function delayEvent( type, instance, container ) {
24249			return function( event ) {
24250				container._trigger( type, event, instance._uiHash( instance ) );
24251			};
24252		}
24253		for ( i = this.containers.length - 1; i >= 0; i-- ) {
24254			if ( !noPropagation ) {
24255				delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
24256			}
24257			if ( this.containers[ i ].containerCache.over ) {
24258				delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
24259				this.containers[ i ].containerCache.over = 0;
24260			}
24261		}
24262
24263		//Do what was originally in plugins
24264		if ( this._storedStylesheet ) {
24265			this._storedStylesheet.remove();
24266			this._storedStylesheet = null;
24267		}
24268		if ( this._storedOpacity ) {
24269			this.helper.css( "opacity", this._storedOpacity );
24270		}
24271		if ( this._storedZIndex ) {
24272			this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex );
24273		}
24274
24275		this.dragging = false;
24276
24277		if ( !noPropagation ) {
24278			this._trigger( "beforeStop", event, this._uiHash() );
24279		}
24280
24281		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
24282		// it unbinds ALL events from the original node!
24283		this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
24284
24285		if ( !this.cancelHelperRemoval ) {
24286			if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
24287				this.helper.remove();
24288			}
24289			this.helper = null;
24290		}
24291
24292		if ( !noPropagation ) {
24293			for ( i = 0; i < delayedTriggers.length; i++ ) {
24294
24295				// Trigger all delayed events
24296				delayedTriggers[ i ].call( this, event );
24297			}
24298			this._trigger( "stop", event, this._uiHash() );
24299		}
24300
24301		this.fromOutside = false;
24302		return !this.cancelHelperRemoval;
24303
24304	},
24305
24306	_trigger: function() {
24307		if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) {
24308			this.cancel();
24309		}
24310	},
24311
24312	_uiHash: function( _inst ) {
24313		var inst = _inst || this;
24314		return {
24315			helper: inst.helper,
24316			placeholder: inst.placeholder || $( [] ),
24317			position: inst.position,
24318			originalPosition: inst.originalPosition,
24319			offset: inst.positionAbs,
24320			item: inst.currentItem,
24321			sender: _inst ? _inst.element : null
24322		};
24323	}
24324
24325} );
24326
24327
24328/*!
24329 * jQuery UI Spinner 1.14.
vendor: 3,301 bytes, lines 24329-24466
243290
24330 * https://jqueryui.com
24331 *
24332 * Copyright OpenJS Foundation and other contributors
24333 * Released under the MIT license.
24334 * https://jquery.org/license
24335 */
24336
24337//>>label: Spinner
24338//>>group: Widgets
24339//>>description: Displays buttons to easily input numbers via the keyboard or mouse.
24340//>>docs: https://api.jqueryui.com/spinner/
24341//>>demos: https://jqueryui.com/spinner/
24342//>>css.structure: ../../themes/base/core.css
24343//>>css.structure: ../../themes/base/spinner.css
24344//>>css.theme: ../../themes/base/theme.css
24345
24346
24347function spinnerModifier( fn ) {
24348	return function() {
24349		var previous = this.element.val();
24350		fn.apply( this, arguments );
24351		this._refresh();
24352		if ( previous !== this.element.val() ) {
24353			this._trigger( "change" );
24354		}
24355	};
24356}
24357
24358$.widget( "ui.spinner", {
24359	version: "1.14.0",
24360	defaultElement: "<input>",
24361	widgetEventPrefix: "spin",
24362	options: {
24363		classes: {
24364			"ui-spinner": "ui-corner-all",
24365			"ui-spinner-down": "ui-corner-br",
24366			"ui-spinner-up": "ui-corner-tr"
24367		},
24368		culture: null,
24369		icons: {
24370			down: "ui-icon-triangle-1-s",
24371			up: "ui-icon-triangle-1-n"
24372		},
24373		incremental: true,
24374		max: null,
24375		min: null,
24376		numberFormat: null,
24377		page: 10,
24378		step: 1,
24379
24380		change: null,
24381		spin: null,
24382		start: null,
24383		stop: null
24384	},
24385
24386	_create: function() {
24387
24388		// handle string values that need to be parsed
24389		this._setOption( "max", this.options.max );
24390		this._setOption( "min", this.options.min );
24391		this._setOption( "step", this.options.step );
24392
24393		// Only format if there is a value, prevents the field from being marked
24394		// as invalid in Firefox, see #9573.
24395		if ( this.value() !== "" ) {
24396
24397			// Format the value, but don't constrain.
24398			this._value( this.element.val(), true );
24399		}
24400
24401		this._draw();
24402		this._on( this._events );
24403		this._refresh();
24404
24405		// Turning off autocomplete prevents the browser from remembering the
24406		// value when navigating through history, so we re-enable autocomplete
24407		// if the page is unloaded before the widget is destroyed. #7790
24408		this._on( this.window, {
24409			beforeunload: function() {
24410				this.element.removeAttr( "autocomplete" );
24411			}
24412		} );
24413	},
24414
24415	_getCreateOptions: function() {
24416		var options = this._super();
24417		var element = this.element;
24418
24419		$.each( [ "min", "max", "step" ], function( i, option ) {
24420			var value = element.attr( option );
24421			if ( value != null && value.length ) {
24422				options[ option ] = value;
24423			}
24424		} );
24425
24426		return options;
24427	},
24428
24429	_events: {
24430		keydown: function( event ) {
24431			if ( this._start( event ) && this._keydown( event ) ) {
24432				event.preventDefault();
24433			}
24434		},
24435		keyup: "_stop",
24436		focus: function() {
24437			this.previous = this.element.val();
24438		},
24439		blur: function( event ) {
24440			this._stop();
24441			this._refresh();
24442			if ( this.previous !== this.element.val() ) {
24443				this._trigger( "change", event );
24444			}
24445		},
24446		mousewheel: function( event, delta ) {
24447			var activeElement = this.document[ 0 ].activeElement;
24448			var isActive = this.element[ 0 ] === activeElement;
24449
24450			if ( !isActive || !delta ) {
24451				return;
24452			}
24453
24454			if ( !this.spinning && !this._start( event ) ) {
24455				return false;
24456			}
24457
24458			this._spin( ( delta > 0 ? 1 : -1 ) * this.options.step, event );
24459			clearTimeout( this.mousewheelTimer );
24460			this.mousewheelTimer = this._delay( function() {
24461				if ( this.spinning ) {
24462					this._stop( event );
24463				}
24464			}, 100 );
24465			event.preventDefault();
24466		},
vendor: 10,099 bytes, lines 24466-24868
24466
24467		"mousedown .ui-spinner-button": function( event ) {
24468			var previous;
24469
24470			// We never want the buttons to have focus; whenever the user is
24471			// interacting with the spinner, the focus should be on the input.
24472			// If the input is focused then this.previous is properly set from
24473			// when the input first received focus. If the input is not focused
24474			// then we need to set this.previous based on the value before spinning.
24475			previous = this.element[ 0 ] === this.document[ 0 ].activeElement ?
24476				this.previous : this.element.val();
24477			function checkFocus() {
24478				var isActive = this.element[ 0 ] === this.document[ 0 ].activeElement;
24479				if ( !isActive ) {
24480					this.element.trigger( "focus" );
24481					this.previous = previous;
24482				}
24483			}
24484
24485			// Ensure focus is on (or stays on) the text field
24486			event.preventDefault();
24487			checkFocus.call( this );
24488
24489			if ( this._start( event ) === false ) {
24490				return;
24491			}
24492
24493			this._repeat( null, $( event.currentTarget )
24494				.hasClass( "ui-spinner-up" ) ? 1 : -1, event );
24495		},
24496		"mouseup .ui-spinner-button": "_stop",
24497		"mouseenter .ui-spinner-button": function( event ) {
24498
24499			// button will add ui-state-active if mouse was down while mouseleave and kept down
24500			if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
24501				return;
24502			}
24503
24504			if ( this._start( event ) === false ) {
24505				return false;
24506			}
24507			this._repeat( null, $( event.currentTarget )
24508				.hasClass( "ui-spinner-up" ) ? 1 : -1, event );
24509		},
24510
24511		// TODO: do we really want to consider this a stop?
24512		// shouldn't we just stop the repeater and wait until mouseup before
24513		// we trigger the stop event?
24514		"mouseleave .ui-spinner-button": "_stop"
24515	},
24516
24517	// Support mobile enhanced option and make backcompat more sane
24518	_enhance: function() {
24519		this.uiSpinner = this.element
24520			.attr( "autocomplete", "off" )
24521			.wrap( "<span>" )
24522			.parent()
24523
24524				// Add buttons
24525				.append(
24526					"<a></a><a></a>"
24527				);
24528	},
24529
24530	_draw: function() {
24531		this._enhance();
24532
24533		this._addClass( this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content" );
24534		this._addClass( "ui-spinner-input" );
24535
24536		this.element.attr( "role", "spinbutton" );
24537
24538		// Button bindings
24539		this.buttons = this.uiSpinner.children( "a" )
24540			.attr( "tabIndex", -1 )
24541			.attr( "aria-hidden", true )
24542			.button( {
24543				classes: {
24544					"ui-button": ""
24545				}
24546			} );
24547
24548		// TODO: Right now button does not support classes this is already updated in button PR
24549		this._removeClass( this.buttons, "ui-corner-all" );
24550
24551		this._addClass( this.buttons.first(), "ui-spinner-button ui-spinner-up" );
24552		this._addClass( this.buttons.last(), "ui-spinner-button ui-spinner-down" );
24553		this.buttons.first().button( {
24554			"icon": this.options.icons.up,
24555			"showLabel": false
24556		} );
24557		this.buttons.last().button( {
24558			"icon": this.options.icons.down,
24559			"showLabel": false
24560		} );
24561
24562		// IE 6 doesn't understand height: 50% for the buttons
24563		// unless the wrapper has an explicit height
24564		if ( this.buttons.height() > Math.ceil( this.uiSpinner.height() * 0.5 ) &&
24565				this.uiSpinner.height() > 0 ) {
24566			this.uiSpinner.height( this.uiSpinner.height() );
24567		}
24568	},
24569
24570	_keydown: function( event ) {
24571		var options = this.options,
24572			keyCode = $.ui.keyCode;
24573
24574		switch ( event.keyCode ) {
24575		case keyCode.UP:
24576			this._repeat( null, 1, event );
24577			return true;
24578		case keyCode.DOWN:
24579			this._repeat( null, -1, event );
24580			return true;
24581		case keyCode.PAGE_UP:
24582			this._repeat( null, options.page, event );
24583			return true;
24584		case keyCode.PAGE_DOWN:
24585			this._repeat( null, -options.page, event );
24586			return true;
24587		}
24588
24589		return false;
24590	},
24591
24592	_start: function( event ) {
24593		if ( !this.spinning && this._trigger( "start", event ) === false ) {
24594			return false;
24595		}
24596
24597		if ( !this.counter ) {
24598			this.counter = 1;
24599		}
24600		this.spinning = true;
24601		return true;
24602	},
24603
24604	_repeat: function( i, steps, event ) {
24605		i = i || 500;
24606
24607		clearTimeout( this.timer );
24608		this.timer = this._delay( function() {
24609			this._repeat( 40, steps, event );
24610		}, i );
24611
24612		this._spin( steps * this.options.step, event );
24613	},
24614
24615	_spin: function( step, event ) {
24616		var value = this.value() || 0;
24617
24618		if ( !this.counter ) {
24619			this.counter = 1;
24620		}
24621
24622		value = this._adjustValue( value + step * this._increment( this.counter ) );
24623
24624		if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false ) {
24625			this._value( value );
24626			this.counter++;
24627		}
24628	},
24629
24630	_increment: function( i ) {
24631		var incremental = this.options.incremental;
24632
24633		if ( incremental ) {
24634			return typeof incremental === "function" ?
24635				incremental( i ) :
24636				Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
24637		}
24638
24639		return 1;
24640	},
24641
24642	_precision: function() {
24643		var precision = this._precisionOf( this.options.step );
24644		if ( this.options.min !== null ) {
24645			precision = Math.max( precision, this._precisionOf( this.options.min ) );
24646		}
24647		return precision;
24648	},
24649
24650	_precisionOf: function( num ) {
24651		var str = num.toString(),
24652			decimal = str.indexOf( "." );
24653		return decimal === -1 ? 0 : str.length - decimal - 1;
24654	},
24655
24656	_adjustValue: function( value ) {
24657		var base, aboveMin,
24658			options = this.options;
24659
24660		// Make sure we're at a valid step
24661		// - find out where we are relative to the base (min or 0)
24662		base = options.min !== null ? options.min : 0;
24663		aboveMin = value - base;
24664
24665		// - round to the nearest step
24666		aboveMin = Math.round( aboveMin / options.step ) * options.step;
24667
24668		// - rounding is based on 0, so adjust back to our base
24669		value = base + aboveMin;
24670
24671		// Fix precision from bad JS floating point math
24672		value = parseFloat( value.toFixed( this._precision() ) );
24673
24674		// Clamp the value
24675		if ( options.max !== null && value > options.max ) {
24676			return options.max;
24677		}
24678		if ( options.min !== null && value < options.min ) {
24679			return options.min;
24680		}
24681
24682		return value;
24683	},
24684
24685	_stop: function( event ) {
24686		if ( !this.spinning ) {
24687			return;
24688		}
24689
24690		clearTimeout( this.timer );
24691		clearTimeout( this.mousewheelTimer );
24692		this.counter = 0;
24693		this.spinning = false;
24694		this._trigger( "stop", event );
24695	},
24696
24697	_setOption: function( key, value ) {
24698		var prevValue, first, last;
24699
24700		if ( key === "culture" || key === "numberFormat" ) {
24701			prevValue = this._parse( this.element.val() );
24702			this.options[ key ] = value;
24703			this.element.val( this._format( prevValue ) );
24704			return;
24705		}
24706
24707		if ( key === "max" || key === "min" || key === "step" ) {
24708			if ( typeof value === "string" ) {
24709				value = this._parse( value );
24710			}
24711		}
24712		if ( key === "icons" ) {
24713			first = this.buttons.first().find( ".ui-icon" );
24714			this._removeClass( first, null, this.options.icons.up );
24715			this._addClass( first, null, value.up );
24716			last = this.buttons.last().find( ".ui-icon" );
24717			this._removeClass( last, null, this.options.icons.down );
24718			this._addClass( last, null, value.down );
24719		}
24720
24721		this._super( key, value );
24722	},
24723
24724	_setOptionDisabled: function( value ) {
24725		this._super( value );
24726
24727		this._toggleClass( this.uiSpinner, null, "ui-state-disabled", !!value );
24728		this.element.prop( "disabled", !!value );
24729		this.buttons.button( value ? "disable" : "enable" );
24730	},
24731
24732	_setOptions: spinnerModifier( function( options ) {
24733		this._super( options );
24734	} ),
24735
24736	_parse: function( val ) {
24737		if ( typeof val === "string" && val !== "" ) {
24738			val = window.Globalize && this.options.numberFormat ?
24739				Globalize.parseFloat( val, 10, this.options.culture ) : +val;
24740		}
24741		return val === "" || isNaN( val ) ? null : val;
24742	},
24743
24744	_format: function( value ) {
24745		if ( value === "" ) {
24746			return "";
24747		}
24748		return window.Globalize && this.options.numberFormat ?
24749			Globalize.format( value, this.options.numberFormat, this.options.culture ) :
24750			value;
24751	},
24752
24753	_refresh: function() {
24754		this.element.attr( {
24755			"aria-valuemin": this.options.min,
24756			"aria-valuemax": this.options.max,
24757
24758			// TODO: what should we do with values that can't be parsed?
24759			"aria-valuenow": this._parse( this.element.val() )
24760		} );
24761	},
24762
24763	isValid: function() {
24764		var value = this.value();
24765
24766		// Null is invalid
24767		if ( value === null ) {
24768			return false;
24769		}
24770
24771		// If value gets adjusted, it's invalid
24772		return value === this._adjustValue( value );
24773	},
24774
24775	// Update the value without triggering change
24776	_value: function( value, allowAny ) {
24777		var parsed;
24778		if ( value !== "" ) {
24779			parsed = this._parse( value );
24780			if ( parsed !== null ) {
24781				if ( !allowAny ) {
24782					parsed = this._adjustValue( parsed );
24783				}
24784				value = this._format( parsed );
24785			}
24786		}
24787		this.element.val( value );
24788		this._refresh();
24789	},
24790
24791	_destroy: function() {
24792		this.element
24793			.prop( "disabled", false )
24794			.removeAttr( "autocomplete role aria-valuemin aria-valuemax aria-valuenow" );
24795
24796		this.uiSpinner.replaceWith( this.element );
24797	},
24798
24799	stepUp: spinnerModifier( function( steps ) {
24800		this._stepUp( steps );
24801	} ),
24802	_stepUp: function( steps ) {
24803		if ( this._start() ) {
24804			this._spin( ( steps || 1 ) * this.options.step );
24805			this._stop();
24806		}
24807	},
24808
24809	stepDown: spinnerModifier( function( steps ) {
24810		this._stepDown( steps );
24811	} ),
24812	_stepDown: function( steps ) {
24813		if ( this._start() ) {
24814			this._spin( ( steps || 1 ) * -this.options.step );
24815			this._stop();
24816		}
24817	},
24818
24819	pageUp: spinnerModifier( function( pages ) {
24820		this._stepUp( ( pages || 1 ) * this.options.page );
24821	} ),
24822
24823	pageDown: spinnerModifier( function( pages ) {
24824		this._stepDown( ( pages || 1 ) * this.options.page );
24825	} ),
24826
24827	value: function( newVal ) {
24828		if ( !arguments.length ) {
24829			return this._parse( this.element.val() );
24830		}
24831		spinnerModifier( this._value ).call( this, newVal );
24832	},
24833
24834	widget: function() {
24835		return this.uiSpinner;
24836	}
24837} );
24838
24839// DEPRECATED
24840// TODO: switch return back to widget declaration at top of file when this is removed
24841if ( $.uiBackCompat === true ) {
24842
24843	// Backcompat for spinner html extension points
24844	$.widget( "ui.spinner", $.ui.spinner, {
24845		_enhance: function() {
24846			this.uiSpinner = this.element
24847				.attr( "autocomplete", "off" )
24848				.wrap( this._uiSpinnerHtml() )
24849				.parent()
24850
24851					// Add buttons
24852					.append( this._buttonHtml() );
24853		},
24854		_uiSpinnerHtml: function() {
24855			return "<span>";
24856		},
24857
24858		_buttonHtml: function() {
24859			return "<a></a><a></a>";
24860		}
24861	} );
24862}
24863
24864var widgetsSpinner = $.ui.spinner;
24865
24866
24867/*!
24868 * jQuery UI Tabs 1.14.
vendor: 12,208 bytes, lines 24868-25340
248680
24869 * https://jqueryui.com
24870 *
24871 * Copyright OpenJS Foundation and other contributors
24872 * Released under the MIT license.
24873 * https://jquery.org/license
24874 */
24875
24876//>>label: Tabs
24877//>>group: Widgets
24878//>>description: Transforms a set of container elements into a tab structure.
24879//>>docs: https://api.jqueryui.com/tabs/
24880//>>demos: https://jqueryui.com/tabs/
24881//>>css.structure: ../../themes/base/core.css
24882//>>css.structure: ../../themes/base/tabs.css
24883//>>css.theme: ../../themes/base/theme.css
24884
24885
24886$.widget( "ui.tabs", {
24887	version: "1.14.0",
24888	delay: 300,
24889	options: {
24890		active: null,
24891		classes: {
24892			"ui-tabs": "ui-corner-all",
24893			"ui-tabs-nav": "ui-corner-all",
24894			"ui-tabs-panel": "ui-corner-bottom",
24895			"ui-tabs-tab": "ui-corner-top"
24896		},
24897		collapsible: false,
24898		event: "click",
24899		heightStyle: "content",
24900		hide: null,
24901		show: null,
24902
24903		// Callbacks
24904		activate: null,
24905		beforeActivate: null,
24906		beforeLoad: null,
24907		load: null
24908	},
24909
24910	_isLocal: ( function() {
24911		var rhash = /#.*$/;
24912
24913		return function( anchor ) {
24914			var anchorUrl, locationUrl;
24915
24916			anchorUrl = anchor.href.replace( rhash, "" );
24917			locationUrl = location.href.replace( rhash, "" );
24918
24919			// Decoding may throw an error if the URL isn't UTF-8 (#9518)
24920			try {
24921				anchorUrl = decodeURIComponent( anchorUrl );
24922			} catch ( error ) {}
24923			try {
24924				locationUrl = decodeURIComponent( locationUrl );
24925			} catch ( error ) {}
24926
24927			return anchor.hash.length > 1 && anchorUrl === locationUrl;
24928		};
24929	} )(),
24930
24931	_create: function() {
24932		var that = this,
24933			options = this.options;
24934
24935		this.running = false;
24936
24937		this._addClass( "ui-tabs", "ui-widget ui-widget-content" );
24938		this._toggleClass( "ui-tabs-collapsible", null, options.collapsible );
24939
24940		this._processTabs();
24941		options.active = this._initialActive();
24942
24943		// Take disabling tabs via class attribute from HTML
24944		// into account and update option properly.
24945		if ( Array.isArray( options.disabled ) ) {
24946			options.disabled = $.uniqueSort( options.disabled.concat(
24947				$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
24948					return that.tabs.index( li );
24949				} )
24950			) ).sort();
24951		}
24952
24953		// Check for length avoids error when initializing empty list
24954		if ( this.options.active !== false && this.anchors.length ) {
24955			this.active = this._findActive( options.active );
24956		} else {
24957			this.active = $();
24958		}
24959
24960		this._refresh();
24961
24962		if ( this.active.length ) {
24963			this.load( options.active );
24964		}
24965	},
24966
24967	_initialActive: function() {
24968		var active = this.options.active,
24969			collapsible = this.options.collapsible,
24970			locationHash = location.hash.substring( 1 );
24971
24972		if ( active === null ) {
24973
24974			// check the fragment identifier in the URL
24975			if ( locationHash ) {
24976				this.tabs.each( function( i, tab ) {
24977					if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
24978						active = i;
24979						return false;
24980					}
24981				} );
24982			}
24983
24984			// Check for a tab marked active via a class
24985			if ( active === null ) {
24986				active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
24987			}
24988
24989			// No active tab, set to false
24990			if ( active === null || active === -1 ) {
24991				active = this.tabs.length ? 0 : false;
24992			}
24993		}
24994
24995		// Handle numbers: negative, out of range
24996		if ( active !== false ) {
24997			active = this.tabs.index( this.tabs.eq( active ) );
24998			if ( active === -1 ) {
24999				active = collapsible ? false : 0;
25000			}
25001		}
25002
25003		// Don't allow collapsible: false and active: false
25004		if ( !collapsible && active === false && this.anchors.length ) {
25005			active = 0;
25006		}
25007
25008		return active;
25009	},
25010
25011	_getCreateEventData: function() {
25012		return {
25013			tab: this.active,
25014			panel: !this.active.length ? $() : this._getPanelForTab( this.active )
25015		};
25016	},
25017
25018	_tabKeydown: function( event ) {
25019		var focusedTab = $( this.document[ 0 ].activeElement ).closest( "li" ),
25020			selectedIndex = this.tabs.index( focusedTab ),
25021			goingForward = true;
25022
25023		if ( this._handlePageNav( event ) ) {
25024			return;
25025		}
25026
25027		switch ( event.keyCode ) {
25028		case $.ui.keyCode.RIGHT:
25029		case $.ui.keyCode.DOWN:
25030			selectedIndex++;
25031			break;
25032		case $.ui.keyCode.UP:
25033		case $.ui.keyCode.LEFT:
25034			goingForward = false;
25035			selectedIndex--;
25036			break;
25037		case $.ui.keyCode.END:
25038			selectedIndex = this.anchors.length - 1;
25039			break;
25040		case $.ui.keyCode.HOME:
25041			selectedIndex = 0;
25042			break;
25043		case $.ui.keyCode.SPACE:
25044
25045			// Activate only, no collapsing
25046			event.preventDefault();
25047			clearTimeout( this.activating );
25048			this._activate( selectedIndex );
25049			return;
25050		case $.ui.keyCode.ENTER:
25051
25052			// Toggle (cancel delayed activation, allow collapsing)
25053			event.preventDefault();
25054			clearTimeout( this.activating );
25055
25056			// Determine if we should collapse or activate
25057			this._activate( selectedIndex === this.options.active ? false : selectedIndex );
25058			return;
25059		default:
25060			return;
25061		}
25062
25063		// Focus the appropriate tab, based on which key was pressed
25064		event.preventDefault();
25065		clearTimeout( this.activating );
25066		selectedIndex = this._focusNextTab( selectedIndex, goingForward );
25067
25068		// Navigating with control/command key will prevent automatic activation
25069		if ( !event.ctrlKey && !event.metaKey ) {
25070
25071			// Update aria-selected immediately so that AT think the tab is already selected.
25072			// Otherwise AT may confuse the user by stating that they need to activate the tab,
25073			// but the tab will already be activated by the time the announcement finishes.
25074			focusedTab.attr( "aria-selected", "false" );
25075			this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
25076
25077			this.activating = this._delay( function() {
25078				this.option( "active", selectedIndex );
25079			}, this.delay );
25080		}
25081	},
25082
25083	_panelKeydown: function( event ) {
25084		if ( this._handlePageNav( event ) ) {
25085			return;
25086		}
25087
25088		// Ctrl+up moves focus to the current tab
25089		if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
25090			event.preventDefault();
25091			this.active.trigger( "focus" );
25092		}
25093	},
25094
25095	// Alt+page up/down moves focus to the previous/next tab (and activates)
25096	_handlePageNav: function( event ) {
25097		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
25098			this._activate( this._focusNextTab( this.options.active - 1, false ) );
25099			return true;
25100		}
25101		if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
25102			this._activate( this._focusNextTab( this.options.active + 1, true ) );
25103			return true;
25104		}
25105	},
25106
25107	_findNextTab: function( index, goingForward ) {
25108		var lastTabIndex = this.tabs.length - 1;
25109
25110		function constrain() {
25111			if ( index > lastTabIndex ) {
25112				index = 0;
25113			}
25114			if ( index < 0 ) {
25115				index = lastTabIndex;
25116			}
25117			return index;
25118		}
25119
25120		while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
25121			index = goingForward ? index + 1 : index - 1;
25122		}
25123
25124		return index;
25125	},
25126
25127	_focusNextTab: function( index, goingForward ) {
25128		index = this._findNextTab( index, goingForward );
25129		this.tabs.eq( index ).trigger( "focus" );
25130		return index;
25131	},
25132
25133	_setOption: function( key, value ) {
25134		if ( key === "active" ) {
25135
25136			// _activate() will handle invalid values and update this.options
25137			this._activate( value );
25138			return;
25139		}
25140
25141		this._super( key, value );
25142
25143		if ( key === "collapsible" ) {
25144			this._toggleClass( "ui-tabs-collapsible", null, value );
25145
25146			// Setting collapsible: false while collapsed; open first panel
25147			if ( !value && this.options.active === false ) {
25148				this._activate( 0 );
25149			}
25150		}
25151
25152		if ( key === "event" ) {
25153			this._setupEvents( value );
25154		}
25155
25156		if ( key === "heightStyle" ) {
25157			this._setupHeightStyle( value );
25158		}
25159	},
25160
25161	_sanitizeSelector: function( hash ) {
25162		return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
25163	},
25164
25165	refresh: function() {
25166		var options = this.options,
25167			lis = this.tablist.children( ":has(a[href])" );
25168
25169		// Get disabled tabs from class attribute from HTML
25170		// this will get converted to a boolean if needed in _refresh()
25171		options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
25172			return lis.index( tab );
25173		} );
25174
25175		this._processTabs();
25176
25177		// Was collapsed or no tabs
25178		if ( options.active === false || !this.anchors.length ) {
25179			options.active = false;
25180			this.active = $();
25181
25182		// was active, but active tab is gone
25183		} else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
25184
25185			// all remaining tabs are disabled
25186			if ( this.tabs.length === options.disabled.length ) {
25187				options.active = false;
25188				this.active = $();
25189
25190			// activate previous tab
25191			} else {
25192				this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
25193			}
25194
25195		// was active, active tab still exists
25196		} else {
25197
25198			// make sure active index is correct
25199			options.active = this.tabs.index( this.active );
25200		}
25201
25202		this._refresh();
25203	},
25204
25205	_refresh: function() {
25206		this._setOptionDisabled( this.options.disabled );
25207		this._setupEvents( this.options.event );
25208		this._setupHeightStyle( this.options.heightStyle );
25209
25210		this.tabs.not( this.active ).attr( {
25211			"aria-selected": "false",
25212			"aria-expanded": "false",
25213			tabIndex: -1
25214		} );
25215		this.panels.not( this._getPanelForTab( this.active ) )
25216			.hide()
25217			.attr( {
25218				"aria-hidden": "true"
25219			} );
25220
25221		// Make sure one tab is in the tab order
25222		if ( !this.active.length ) {
25223			this.tabs.eq( 0 ).attr( "tabIndex", 0 );
25224		} else {
25225			this.active
25226				.attr( {
25227					"aria-selected": "true",
25228					"aria-expanded": "true",
25229					tabIndex: 0
25230				} );
25231			this._addClass( this.active, "ui-tabs-active", "ui-state-active" );
25232			this._getPanelForTab( this.active )
25233				.show()
25234				.attr( {
25235					"aria-hidden": "false"
25236				} );
25237		}
25238	},
25239
25240	_processTabs: function() {
25241		var that = this,
25242			prevTabs = this.tabs,
25243			prevAnchors = this.anchors,
25244			prevPanels = this.panels;
25245
25246		this.tablist = this._getList().attr( "role", "tablist" );
25247		this._addClass( this.tablist, "ui-tabs-nav",
25248			"ui-helper-reset ui-helper-clearfix ui-widget-header" );
25249
25250		// Prevent users from focusing disabled tabs via click
25251		this.tablist
25252			.on( "mousedown" + this.eventNamespace, "> li", function( event ) {
25253				if ( $( this ).is( ".ui-state-disabled" ) ) {
25254					event.preventDefault();
25255				}
25256			} );
25257
25258		this.tabs = this.tablist.find( "> li:has(a[href])" )
25259			.attr( {
25260				role: "tab",
25261				tabIndex: -1
25262			} );
25263		this._addClass( this.tabs, "ui-tabs-tab", "ui-state-default" );
25264
25265		this.anchors = this.tabs.map( function() {
25266			return $( "a", this )[ 0 ];
25267		} )
25268			.attr( {
25269				tabIndex: -1
25270			} );
25271		this._addClass( this.anchors, "ui-tabs-anchor" );
25272
25273		this.panels = $();
25274
25275		this.anchors.each( function( i, anchor ) {
25276			var selector, panel, panelId,
25277				anchorId = $( anchor ).uniqueId().attr( "id" ),
25278				tab = $( anchor ).closest( "li" ),
25279				originalAriaControls = tab.attr( "aria-controls" );
25280
25281			// Inline tab
25282			if ( that._isLocal( anchor ) ) {
25283				selector = anchor.hash;
25284				panelId = selector.substring( 1 );
25285				panel = that.element.find( that._sanitizeSelector( selector ) );
25286
25287			// remote tab
25288			} else {
25289
25290				// If the tab doesn't already have aria-controls,
25291				// generate an id by using a throw-away element
25292				panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
25293				selector = "#" + panelId;
25294				panel = that.element.find( selector );
25295				if ( !panel.length ) {
25296					panel = that._createPanel( panelId );
25297					panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
25298				}
25299				panel.attr( "aria-live", "polite" );
25300			}
25301
25302			if ( panel.length ) {
25303				that.panels = that.panels.add( panel );
25304			}
25305			if ( originalAriaControls ) {
25306				tab.data( "ui-tabs-aria-controls", originalAriaControls );
25307			}
25308			tab.attr( {
25309				"aria-controls": panelId,
25310				"aria-labelledby": anchorId
25311			} );
25312			panel.attr( "aria-labelledby", anchorId );
25313		} );
25314
25315		this.panels.attr( "role", "tabpanel" );
25316		this._addClass( this.panels, "ui-tabs-panel", "ui-widget-content" );
25317
25318		// Avoid memory leaks (#10056)
25319		if ( prevTabs ) {
25320			this._off( prevTabs.not( this.tabs ) );
25321			this._off( prevAnchors.not( this.anchors ) );
25322			this._off( prevPanels.not( this.panels ) );
25323		}
25324	},
25325
25326	// Allow overriding how to find the list for rare usage scenarios (#7715)
25327	_getList: function() {
25328		return this.tablist || this.element.find( "ol, ul" ).eq( 0 );
25329	},
25330
25331	_createPanel: function( id ) {
25332		return $( "<div>" )
25333			.attr( "id", id )
25334			.data( "ui-tabs-destroy", true );
25335	},
25336
25337	_setOptionDisabled: function( disabled ) {
25338		var currentItem, li, i;
25339
25340		if ( Array
vendor: 6,222 bytes, lines 25340-25571
25340.isArray( disabled ) ) {
25341			if ( !disabled.length ) {
25342				disabled = false;
25343			} else if ( disabled.length === this.anchors.length ) {
25344				disabled = true;
25345			}
25346		}
25347
25348		// Disable tabs
25349		for ( i = 0; ( li = this.tabs[ i ] ); i++ ) {
25350			currentItem = $( li );
25351			if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
25352				currentItem.attr( "aria-disabled", "true" );
25353				this._addClass( currentItem, null, "ui-state-disabled" );
25354			} else {
25355				currentItem.removeAttr( "aria-disabled" );
25356				this._removeClass( currentItem, null, "ui-state-disabled" );
25357			}
25358		}
25359
25360		this.options.disabled = disabled;
25361
25362		this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null,
25363			disabled === true );
25364	},
25365
25366	_setupEvents: function( event ) {
25367		var events = {};
25368		if ( event ) {
25369			$.each( event.split( " " ), function( index, eventName ) {
25370				events[ eventName ] = "_eventHandler";
25371			} );
25372		}
25373
25374		this._off( this.anchors.add( this.tabs ).add( this.panels ) );
25375
25376		// Always prevent the default action, even when disabled
25377		this._on( true, this.anchors, {
25378			click: function( event ) {
25379				event.preventDefault();
25380			}
25381		} );
25382		this._on( this.anchors, events );
25383		this._on( this.tabs, { keydown: "_tabKeydown" } );
25384		this._on( this.panels, { keydown: "_panelKeydown" } );
25385
25386		this._focusable( this.tabs );
25387		this._hoverable( this.tabs );
25388	},
25389
25390	_setupHeightStyle: function( heightStyle ) {
25391		var maxHeight,
25392			parent = this.element.parent();
25393
25394		if ( heightStyle === "fill" ) {
25395			maxHeight = parent.height();
25396			maxHeight -= this.element.outerHeight() - this.element.height();
25397
25398			this.element.siblings( ":visible" ).each( function() {
25399				var elem = $( this ),
25400					position = elem.css( "position" );
25401
25402				if ( position === "absolute" || position === "fixed" ) {
25403					return;
25404				}
25405				maxHeight -= elem.outerHeight( true );
25406			} );
25407
25408			this.element.children().not( this.panels ).each( function() {
25409				maxHeight -= $( this ).outerHeight( true );
25410			} );
25411
25412			this.panels.each( function() {
25413				$( this ).height( Math.max( 0, maxHeight -
25414					$( this ).innerHeight() + $( this ).height() ) );
25415			} )
25416				.css( "overflow", "auto" );
25417		} else if ( heightStyle === "auto" ) {
25418			maxHeight = 0;
25419			this.panels.each( function() {
25420				maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
25421			} ).height( maxHeight );
25422		}
25423	},
25424
25425	_eventHandler: function( event ) {
25426		var options = this.options,
25427			active = this.active,
25428			anchor = $( event.currentTarget ),
25429			tab = anchor.closest( "li" ),
25430			clickedIsActive = tab[ 0 ] === active[ 0 ],
25431			collapsing = clickedIsActive && options.collapsible,
25432			toShow = collapsing ? $() : this._getPanelForTab( tab ),
25433			toHide = !active.length ? $() : this._getPanelForTab( active ),
25434			eventData = {
25435				oldTab: active,
25436				oldPanel: toHide,
25437				newTab: collapsing ? $() : tab,
25438				newPanel: toShow
25439			};
25440
25441		event.preventDefault();
25442
25443		if ( tab.hasClass( "ui-state-disabled" ) ||
25444
25445				// tab is already loading
25446				tab.hasClass( "ui-tabs-loading" ) ||
25447
25448				// can't switch durning an animation
25449				this.running ||
25450
25451				// click on active header, but not collapsible
25452				( clickedIsActive && !options.collapsible ) ||
25453
25454				// allow canceling activation
25455				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
25456			return;
25457		}
25458
25459		options.active = collapsing ? false : this.tabs.index( tab );
25460
25461		this.active = clickedIsActive ? $() : tab;
25462		if ( this.xhr ) {
25463			this.xhr.abort();
25464		}
25465
25466		if ( !toHide.length && !toShow.length ) {
25467			$.error( "jQuery UI Tabs: Mismatching fragment identifier." );
25468		}
25469
25470		if ( toShow.length ) {
25471			this.load( this.tabs.index( tab ), event );
25472		}
25473		this._toggle( event, eventData );
25474	},
25475
25476	// Handles show/hide for selecting tabs
25477	_toggle: function( event, eventData ) {
25478		var that = this,
25479			toShow = eventData.newPanel,
25480			toHide = eventData.oldPanel;
25481
25482		this.running = true;
25483
25484		function complete() {
25485			that.running = false;
25486			that._trigger( "activate", event, eventData );
25487		}
25488
25489		function show() {
25490			that._addClass( eventData.newTab.closest( "li" ), "ui-tabs-active", "ui-state-active" );
25491
25492			if ( toShow.length && that.options.show ) {
25493				that._show( toShow, that.options.show, complete );
25494			} else {
25495				toShow.show();
25496				complete();
25497			}
25498		}
25499
25500		// Start out by hiding, then showing, then completing
25501		if ( toHide.length && this.options.hide ) {
25502			this._hide( toHide, this.options.hide, function() {
25503				that._removeClass( eventData.oldTab.closest( "li" ),
25504					"ui-tabs-active", "ui-state-active" );
25505				show();
25506			} );
25507		} else {
25508			this._removeClass( eventData.oldTab.closest( "li" ),
25509				"ui-tabs-active", "ui-state-active" );
25510			toHide.hide();
25511			show();
25512		}
25513
25514		toHide.attr( "aria-hidden", "true" );
25515		eventData.oldTab.attr( {
25516			"aria-selected": "false",
25517			"aria-expanded": "false"
25518		} );
25519
25520		// If we're switching tabs, remove the old tab from the tab order.
25521		// If we're opening from collapsed state, remove the previous tab from the tab order.
25522		// If we're collapsing, then keep the collapsing tab in the tab order.
25523		if ( toShow.length && toHide.length ) {
25524			eventData.oldTab.attr( "tabIndex", -1 );
25525		} else if ( toShow.length ) {
25526			this.tabs.filter( function() {
25527				return $( this ).attr( "tabIndex" ) === 0;
25528			} )
25529				.attr( "tabIndex", -1 );
25530		}
25531
25532		toShow.attr( "aria-hidden", "false" );
25533		eventData.newTab.attr( {
25534			"aria-selected": "true",
25535			"aria-expanded": "true",
25536			tabIndex: 0
25537		} );
25538	},
25539
25540	_activate: function( index ) {
25541		var anchor,
25542			active = this._findActive( index );
25543
25544		// Trying to activate the already active panel
25545		if ( active[ 0 ] === this.active[ 0 ] ) {
25546			return;
25547		}
25548
25549		// Trying to collapse, simulate a click on the current active header
25550		if ( !active.length ) {
25551			active = this.active;
25552		}
25553
25554		anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
25555		this._eventHandler( {
25556			target: anchor,
25557			currentTarget: anchor,
25558			preventDefault: $.noop
25559		} );
25560	},
25561
25562	_findActive: function( index ) {
25563		return index === false ? $() : this.tabs.eq( index );
25564	},
25565
25566	_getIndex: function( index ) {
25567
25568		// meta-function to give users option to provide a href string instead of a numerical index.
25569		if ( typeof index === "string" ) {
25570			index = this.anchors.index( this.anchors.filter( "[href$='" +
25571				
vendor: 23,849 bytes, lines 25571-26338
25571CSS.escape( index ) + "']" ) );
25572		}
25573
25574		return index;
25575	},
25576
25577	_destroy: function() {
25578		if ( this.xhr ) {
25579			this.xhr.abort();
25580		}
25581
25582		this.tablist
25583			.removeAttr( "role" )
25584			.off( this.eventNamespace );
25585
25586		this.anchors
25587			.removeAttr( "role tabIndex" )
25588			.removeUniqueId();
25589
25590		this.tabs.add( this.panels ).each( function() {
25591			if ( $.data( this, "ui-tabs-destroy" ) ) {
25592				$( this ).remove();
25593			} else {
25594				$( this ).removeAttr( "role tabIndex " +
25595					"aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded" );
25596			}
25597		} );
25598
25599		this.tabs.each( function() {
25600			var li = $( this ),
25601				prev = li.data( "ui-tabs-aria-controls" );
25602			if ( prev ) {
25603				li
25604					.attr( "aria-controls", prev )
25605					.removeData( "ui-tabs-aria-controls" );
25606			} else {
25607				li.removeAttr( "aria-controls" );
25608			}
25609		} );
25610
25611		this.panels.show();
25612
25613		if ( this.options.heightStyle !== "content" ) {
25614			this.panels.css( "height", "" );
25615		}
25616	},
25617
25618	enable: function( index ) {
25619		var disabled = this.options.disabled;
25620		if ( disabled === false ) {
25621			return;
25622		}
25623
25624		if ( index === undefined ) {
25625			disabled = false;
25626		} else {
25627			index = this._getIndex( index );
25628			if ( Array.isArray( disabled ) ) {
25629				disabled = $.map( disabled, function( num ) {
25630					return num !== index ? num : null;
25631				} );
25632			} else {
25633				disabled = $.map( this.tabs, function( li, num ) {
25634					return num !== index ? num : null;
25635				} );
25636			}
25637		}
25638		this._setOptionDisabled( disabled );
25639	},
25640
25641	disable: function( index ) {
25642		var disabled = this.options.disabled;
25643		if ( disabled === true ) {
25644			return;
25645		}
25646
25647		if ( index === undefined ) {
25648			disabled = true;
25649		} else {
25650			index = this._getIndex( index );
25651			if ( $.inArray( index, disabled ) !== -1 ) {
25652				return;
25653			}
25654			if ( Array.isArray( disabled ) ) {
25655				disabled = $.merge( [ index ], disabled ).sort();
25656			} else {
25657				disabled = [ index ];
25658			}
25659		}
25660		this._setOptionDisabled( disabled );
25661	},
25662
25663	load: function( index, event ) {
25664		index = this._getIndex( index );
25665		var that = this,
25666			tab = this.tabs.eq( index ),
25667			anchor = tab.find( ".ui-tabs-anchor" ),
25668			panel = this._getPanelForTab( tab ),
25669			eventData = {
25670				tab: tab,
25671				panel: panel
25672			},
25673			complete = function( jqXHR, status ) {
25674				if ( status === "abort" ) {
25675					that.panels.stop( false, true );
25676				}
25677
25678				that._removeClass( tab, "ui-tabs-loading" );
25679				panel.removeAttr( "aria-busy" );
25680
25681				if ( jqXHR === that.xhr ) {
25682					delete that.xhr;
25683				}
25684			};
25685
25686		// Not remote
25687		if ( this._isLocal( anchor[ 0 ] ) ) {
25688			return;
25689		}
25690
25691		this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
25692
25693		if ( this.xhr.statusText !== "canceled" ) {
25694			this._addClass( tab, "ui-tabs-loading" );
25695			panel.attr( "aria-busy", "true" );
25696
25697			this.xhr
25698				.done( function( response, status, jqXHR ) {
25699					panel.html( response );
25700					that._trigger( "load", event, eventData );
25701
25702					complete( jqXHR, status );
25703				} )
25704				.fail( function( jqXHR, status ) {
25705					complete( jqXHR, status );
25706				} );
25707		}
25708	},
25709
25710	_ajaxSettings: function( anchor, event, eventData ) {
25711		var that = this;
25712		return {
25713			url: anchor.attr( "href" ),
25714			beforeSend: function( jqXHR, settings ) {
25715				return that._trigger( "beforeLoad", event,
25716					$.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
25717			}
25718		};
25719	},
25720
25721	_getPanelForTab: function( tab ) {
25722		var id = $( tab ).attr( "aria-controls" );
25723		return this.element.find( this._sanitizeSelector( "#" + id ) );
25724	}
25725} );
25726
25727// DEPRECATED
25728// TODO: Switch return back to widget declaration at top of file when this is removed
25729if ( $.uiBackCompat === true ) {
25730
25731	// Backcompat for ui-tab class (now ui-tabs-tab)
25732	$.widget( "ui.tabs", $.ui.tabs, {
25733		_processTabs: function() {
25734			this._superApply( arguments );
25735			this._addClass( this.tabs, "ui-tab" );
25736		}
25737	} );
25738}
25739
25740var widgetsTabs = $.ui.tabs;
25741
25742
25743/*!
25744 * jQuery UI Tooltip 1.14.0
25745 * https://jqueryui.com
25746 *
25747 * Copyright OpenJS Foundation and other contributors
25748 * Released under the MIT license.
25749 * https://jquery.org/license
25750 */
25751
25752//>>label: Tooltip
25753//>>group: Widgets
25754//>>description: Shows additional information for any element on hover or focus.
25755//>>docs: https://api.jqueryui.com/tooltip/
25756//>>demos: https://jqueryui.com/tooltip/
25757//>>css.structure: ../../themes/base/core.css
25758//>>css.structure: ../../themes/base/tooltip.css
25759//>>css.theme: ../../themes/base/theme.css
25760
25761
25762$.widget( "ui.tooltip", {
25763	version: "1.14.0",
25764	options: {
25765		classes: {
25766			"ui-tooltip": "ui-corner-all ui-widget-shadow"
25767		},
25768		content: function() {
25769			var title = $( this ).attr( "title" );
25770
25771			// Escape title, since we're going from an attribute to raw HTML
25772			return $( "<a>" ).text( title ).html();
25773		},
25774		hide: true,
25775
25776		// Disabled elements have inconsistent behavior across browsers (#8661)
25777		items: "[title]:not([disabled])",
25778		position: {
25779			my: "left top+15",
25780			at: "left bottom",
25781			collision: "flipfit flip"
25782		},
25783		show: true,
25784		track: false,
25785
25786		// Callbacks
25787		close: null,
25788		open: null
25789	},
25790
25791	_addDescribedBy: function( elem, id ) {
25792		var describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ );
25793		describedby.push( id );
25794		elem
25795			.data( "ui-tooltip-id", id )
25796			.attr( "aria-describedby", String.prototype.trim.call( describedby.join( " " ) ) );
25797	},
25798
25799	_removeDescribedBy: function( elem ) {
25800		var id = elem.data( "ui-tooltip-id" ),
25801			describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ),
25802			index = $.inArray( id, describedby );
25803
25804		if ( index !== -1 ) {
25805			describedby.splice( index, 1 );
25806		}
25807
25808		elem.removeData( "ui-tooltip-id" );
25809		describedby = String.prototype.trim.call( describedby.join( " " ) );
25810		if ( describedby ) {
25811			elem.attr( "aria-describedby", describedby );
25812		} else {
25813			elem.removeAttr( "aria-describedby" );
25814		}
25815	},
25816
25817	_create: function() {
25818		this._on( {
25819			mouseover: "open",
25820			focusin: "open"
25821		} );
25822
25823		// IDs of generated tooltips, needed for destroy
25824		this.tooltips = {};
25825
25826		// IDs of parent tooltips where we removed the title attribute
25827		this.parents = {};
25828
25829		// Append the aria-live region so tooltips announce correctly
25830		this.liveRegion = $( "<div>" )
25831			.attr( {
25832				role: "log",
25833				"aria-live": "assertive",
25834				"aria-relevant": "additions"
25835			} )
25836			.appendTo( this.document[ 0 ].body );
25837		this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
25838
25839		this.disabledTitles = $( [] );
25840	},
25841
25842	_setOption: function( key, value ) {
25843		var that = this;
25844
25845		this._super( key, value );
25846
25847		if ( key === "content" ) {
25848			$.each( this.tooltips, function( id, tooltipData ) {
25849				that._updateContent( tooltipData.element );
25850			} );
25851		}
25852	},
25853
25854	_setOptionDisabled: function( value ) {
25855		this[ value ? "_disable" : "_enable" ]();
25856	},
25857
25858	_disable: function() {
25859		var that = this;
25860
25861		// Close open tooltips
25862		$.each( this.tooltips, function( id, tooltipData ) {
25863			var event = $.Event( "blur" );
25864			event.target = event.currentTarget = tooltipData.element[ 0 ];
25865			that.close( event, true );
25866		} );
25867
25868		// Remove title attributes to prevent native tooltips
25869		this.disabledTitles = this.disabledTitles.add(
25870			this.element.find( this.options.items ).addBack()
25871				.filter( function() {
25872					var element = $( this );
25873					if ( element.is( "[title]" ) ) {
25874						return element
25875							.data( "ui-tooltip-title", element.attr( "title" ) )
25876							.removeAttr( "title" );
25877					}
25878				} )
25879		);
25880	},
25881
25882	_enable: function() {
25883
25884		// restore title attributes
25885		this.disabledTitles.each( function() {
25886			var element = $( this );
25887			if ( element.data( "ui-tooltip-title" ) ) {
25888				element.attr( "title", element.data( "ui-tooltip-title" ) );
25889			}
25890		} );
25891		this.disabledTitles = $( [] );
25892	},
25893
25894	open: function( event ) {
25895		var that = this,
25896			target = $( event ? event.target : this.element )
25897
25898				// we need closest here due to mouseover bubbling,
25899				// but always pointing at the same event target
25900				.closest( this.options.items );
25901
25902		// No element to show a tooltip for or the tooltip is already open
25903		if ( !target.length || target.data( "ui-tooltip-id" ) ) {
25904			return;
25905		}
25906
25907		if ( target.attr( "title" ) ) {
25908			target.data( "ui-tooltip-title", target.attr( "title" ) );
25909		}
25910
25911		target.data( "ui-tooltip-open", true );
25912
25913		// Kill parent tooltips, custom or native, for hover
25914		if ( event && event.type === "mouseover" ) {
25915			target.parents().each( function() {
25916				var parent = $( this ),
25917					blurEvent;
25918				if ( parent.data( "ui-tooltip-open" ) ) {
25919					blurEvent = $.Event( "blur" );
25920					blurEvent.target = blurEvent.currentTarget = this;
25921					that.close( blurEvent, true );
25922				}
25923				if ( parent.attr( "title" ) ) {
25924					parent.uniqueId();
25925					that.parents[ this.id ] = {
25926						element: this,
25927						title: parent.attr( "title" )
25928					};
25929					parent.attr( "title", "" );
25930				}
25931			} );
25932		}
25933
25934		this._registerCloseHandlers( event, target );
25935		this._updateContent( target, event );
25936	},
25937
25938	_updateContent: function( target, event ) {
25939		var content,
25940			contentOption = this.options.content,
25941			that = this,
25942			eventType = event ? event.type : null;
25943
25944		if ( typeof contentOption === "string" || contentOption.nodeType ||
25945				contentOption.jquery ) {
25946			return this._open( event, target, contentOption );
25947		}
25948
25949		content = contentOption.call( target[ 0 ], function( response ) {
25950
25951			// Ignore async response if tooltip was closed already
25952			if ( !target.data( "ui-tooltip-open" ) ) {
25953				return;
25954			}
25955
25956			// JQuery creates a special event for focusin when it doesn't
25957			// exist natively. To improve performance, the native event
25958			// object is reused and the type is changed. Therefore, we can't
25959			// rely on the type being correct after the event finished
25960			// bubbling, so we set it back to the previous value. (#8740)
25961			if ( event ) {
25962				event.type = eventType;
25963			}
25964			that._open( event, target, response );
25965		} );
25966		if ( content ) {
25967			this._open( event, target, content );
25968		}
25969	},
25970
25971	_open: function( event, target, content ) {
25972		var tooltipData, tooltip, delayedShow, a11yContent,
25973			positionOption = $.extend( {}, this.options.position );
25974
25975		if ( !content ) {
25976			return;
25977		}
25978
25979		// Content can be updated multiple times. If the tooltip already
25980		// exists, then just update the content and bail.
25981		tooltipData = this._find( target );
25982		if ( tooltipData ) {
25983			tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
25984			return;
25985		}
25986
25987		// If we have a title, clear it to prevent the native tooltip
25988		// we have to check first to avoid defining a title if none exists
25989		// (we don't want to cause an element to start matching [title])
25990		//
25991		// We use removeAttr only for key events, to allow IE to export the correct
25992		// accessible attributes. For mouse events, set to empty string to avoid
25993		// native tooltip showing up (happens only when removing inside mouseover).
25994		if ( target.is( "[title]" ) ) {
25995			if ( event && event.type === "mouseover" ) {
25996				target.attr( "title", "" );
25997			} else {
25998				target.removeAttr( "title" );
25999			}
26000		}
26001
26002		tooltipData = this._tooltip( target );
26003		tooltip = tooltipData.tooltip;
26004		this._addDescribedBy( target, tooltip.attr( "id" ) );
26005		tooltip.find( ".ui-tooltip-content" ).html( content );
26006
26007		// Support: Voiceover on OS X, JAWS on IE <= 9
26008		// JAWS announces deletions even when aria-relevant="additions"
26009		// Voiceover will sometimes re-read the entire log region's contents from the beginning
26010		this.liveRegion.children().hide();
26011		a11yContent = $( "<div>" ).html( tooltip.find( ".ui-tooltip-content" ).html() );
26012		a11yContent.removeAttr( "name" ).find( "[name]" ).removeAttr( "name" );
26013		a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
26014		a11yContent.appendTo( this.liveRegion );
26015
26016		function position( event ) {
26017			positionOption.of = event;
26018			if ( tooltip.is( ":hidden" ) ) {
26019				return;
26020			}
26021			tooltip.position( positionOption );
26022		}
26023		if ( this.options.track && event && /^mouse/.test( event.type ) ) {
26024			this._on( this.document, {
26025				mousemove: position
26026			} );
26027
26028			// trigger once to override element-relative positioning
26029			position( event );
26030		} else {
26031			tooltip.position( $.extend( {
26032				of: target
26033			}, this.options.position ) );
26034		}
26035
26036		tooltip.hide();
26037
26038		this._show( tooltip, this.options.show );
26039
26040		// Handle tracking tooltips that are shown with a delay (#8644). As soon
26041		// as the tooltip is visible, position the tooltip using the most recent
26042		// event.
26043		// Adds the check to add the timers only when both delay and track options are set (#14682)
26044		if ( this.options.track && this.options.show && this.options.show.delay ) {
26045			delayedShow = this.delayedShow = setInterval( function() {
26046				if ( tooltip.is( ":visible" ) ) {
26047					position( positionOption.of );
26048					clearInterval( delayedShow );
26049				}
26050			}, 13 );
26051		}
26052
26053		this._trigger( "open", event, { tooltip: tooltip } );
26054	},
26055
26056	_registerCloseHandlers: function( event, target ) {
26057		var events = {
26058			keyup: function( event ) {
26059				if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
26060					var fakeEvent = $.Event( event );
26061					fakeEvent.currentTarget = target[ 0 ];
26062					this.close( fakeEvent, true );
26063				}
26064			}
26065		};
26066
26067		// Only bind remove handler for delegated targets. Non-delegated
26068		// tooltips will handle this in destroy.
26069		if ( target[ 0 ] !== this.element[ 0 ] ) {
26070			events.remove = function() {
26071				var targetElement = this._find( target );
26072				if ( targetElement ) {
26073					this._removeTooltip( targetElement.tooltip );
26074				}
26075			};
26076		}
26077
26078		if ( !event || event.type === "mouseover" ) {
26079			events.mouseleave = "close";
26080		}
26081		if ( !event || event.type === "focusin" ) {
26082			events.focusout = "close";
26083		}
26084		this._on( true, target, events );
26085	},
26086
26087	close: function( event ) {
26088		var tooltip,
26089			that = this,
26090			target = $( event ? event.currentTarget : this.element ),
26091			tooltipData = this._find( target );
26092
26093		// The tooltip may already be closed
26094		if ( !tooltipData ) {
26095
26096			// We set ui-tooltip-open immediately upon open (in open()), but only set the
26097			// additional data once there's actually content to show (in _open()). So even if the
26098			// tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in
26099			// the period between open() and _open().
26100			target.removeData( "ui-tooltip-open" );
26101			return;
26102		}
26103
26104		tooltip = tooltipData.tooltip;
26105
26106		// Disabling closes the tooltip, so we need to track when we're closing
26107		// to avoid an infinite loop in case the tooltip becomes disabled on close
26108		if ( tooltipData.closing ) {
26109			return;
26110		}
26111
26112		// Clear the interval for delayed tracking tooltips
26113		clearInterval( this.delayedShow );
26114
26115		// Only set title if we had one before (see comment in _open())
26116		// If the title attribute has changed since open(), don't restore
26117		if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
26118			target.attr( "title", target.data( "ui-tooltip-title" ) );
26119		}
26120
26121		this._removeDescribedBy( target );
26122
26123		tooltipData.hiding = true;
26124		tooltip.stop( true );
26125		this._hide( tooltip, this.options.hide, function() {
26126			that._removeTooltip( $( this ) );
26127		} );
26128
26129		target.removeData( "ui-tooltip-open" );
26130		this._off( target, "mouseleave focusout keyup" );
26131
26132		// Remove 'remove' binding only on delegated targets
26133		if ( target[ 0 ] !== this.element[ 0 ] ) {
26134			this._off( target, "remove" );
26135		}
26136		this._off( this.document, "mousemove" );
26137
26138		if ( event && event.type === "mouseleave" ) {
26139			$.each( this.parents, function( id, parent ) {
26140				$( parent.element ).attr( "title", parent.title );
26141				delete that.parents[ id ];
26142			} );
26143		}
26144
26145		tooltipData.closing = true;
26146		this._trigger( "close", event, { tooltip: tooltip } );
26147		if ( !tooltipData.hiding ) {
26148			tooltipData.closing = false;
26149		}
26150	},
26151
26152	_tooltip: function( element ) {
26153		var tooltip = $( "<div>" ).attr( "role", "tooltip" ),
26154			content = $( "<div>" ).appendTo( tooltip ),
26155			id = tooltip.uniqueId().attr( "id" );
26156
26157		this._addClass( content, "ui-tooltip-content" );
26158		this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" );
26159
26160		tooltip.appendTo( this._appendTo( element ) );
26161
26162		return this.tooltips[ id ] = {
26163			element: element,
26164			tooltip: tooltip
26165		};
26166	},
26167
26168	_find: function( target ) {
26169		var id = target.data( "ui-tooltip-id" );
26170		return id ? this.tooltips[ id ] : null;
26171	},
26172
26173	_removeTooltip: function( tooltip ) {
26174
26175		// Clear the interval for delayed tracking tooltips
26176		clearInterval( this.delayedShow );
26177
26178		tooltip.remove();
26179		delete this.tooltips[ tooltip.attr( "id" ) ];
26180	},
26181
26182	_appendTo: function( target ) {
26183		var element = target.closest( ".ui-front, dialog" );
26184
26185		if ( !element.length ) {
26186			element = this.document[ 0 ].body;
26187		}
26188
26189		return element;
26190	},
26191
26192	_destroy: function() {
26193		var that = this;
26194
26195		// Close open tooltips
26196		$.each( this.tooltips, function( id, tooltipData ) {
26197
26198			// Delegate to close method to handle common cleanup
26199			var event = $.Event( "blur" ),
26200				element = tooltipData.element;
26201			event.target = event.currentTarget = element[ 0 ];
26202			that.close( event, true );
26203
26204			// Remove immediately; destroying an open tooltip doesn't use the
26205			// hide animation
26206			$( "#" + id ).remove();
26207
26208			// Restore the title
26209			if ( element.data( "ui-tooltip-title" ) ) {
26210
26211				// If the title attribute has changed since open(), don't restore
26212				if ( !element.attr( "title" ) ) {
26213					element.attr( "title", element.data( "ui-tooltip-title" ) );
26214				}
26215				element.removeData( "ui-tooltip-title" );
26216			}
26217		} );
26218		this.liveRegion.remove();
26219	}
26220} );
26221
26222// DEPRECATED
26223// TODO: Switch return back to widget declaration at top of file when this is removed
26224if ( $.uiBackCompat === true ) {
26225
26226	// Backcompat for tooltipClass option
26227	$.widget( "ui.tooltip", $.ui.tooltip, {
26228		options: {
26229			tooltipClass: null
26230		},
26231		_tooltip: function() {
26232			var tooltipData = this._superApply( arguments );
26233			if ( this.options.tooltipClass ) {
26234				tooltipData.tooltip.addClass( this.options.tooltipClass );
26235			}
26236			return tooltipData;
26237		}
26238	} );
26239}
26240
26241var widgetsTooltip = $.ui.tooltip;
26242
26243
26244
26245
26246} );
26247
26248/* ========================================
26249 FILE: /includes/js/jquery/jquery-ui-1.14.0/jquery-ui-i18n.js
26250 ==================== */
26251
26252/*! jQuery UI - v1.8.24 - 2012-09-28
26253* https://github.com/jquery/jquery-ui
26254* Includes: jquery.ui.datepicker-af.js, jquery.ui.datepicker-ar-DZ.js, jquery.ui.datepicker-ar.js, jquery.ui.datepicker-az.js, jquery.ui.datepicker-bg.js, jquery.ui.datepicker-bs.js, jquery.ui.datepicker-ca.js, jquery.ui.datepicker-cs.js, jquery.ui.datepicker-cy-GB.js, jquery.ui.datepicker-da.js, jquery.ui.datepicker-de.js, jquery.ui.datepicker-el.js, jquery.ui.datepicker-en-AU.js, jquery.ui.datepicker-en-GB.js, jquery.ui.datepicker-en-NZ.js, jquery.ui.datepicker-eo.js, jquery.ui.datepicker-es.js, jquery.ui.datepicker-et.js, jquery.ui.datepicker-eu.js, jquery.ui.datepicker-fa.js, jquery.ui.datepicker-fi.js, jquery.ui.datepicker-fo.js, jquery.ui.datepicker-fr-CH.js, jquery.ui.datepicker-fr.js, jquery.ui.datepicker-gl.js, jquery.ui.datepicker-he.js, jquery.ui.datepicker-hi.js, jquery.ui.datepicker-hr.js, jquery.ui.datepicker-hu.js, jquery.ui.datepicker-hy.js, jquery.ui.datepicker-id.js, jquery.ui.datepicker-is.js, jquery.ui.datepicker-it.js, jquery.ui.datepicker-ja.js, jquery.ui.datepicker-ka.js, jquery.ui.datepicker-kk.js, jquery.ui.datepicker-km.js, jquery.ui.datepicker-ko.js, jquery.ui.datepicker-lb.js, jquery.ui.datepicker-lt.js, jquery.ui.datepicker-lv.js, jquery.ui.datepicker-mk.js, jquery.ui.datepicker-ml.js, jquery.ui.datepicker-ms.js, jquery.ui.datepicker-nl-BE.js, jquery.ui.datepicker-nl.js, jquery.ui.datepicker-no.js, jquery.ui.datepicker-pl.js, jquery.ui.datepicker-pt-BR.js, jquery.ui.datepicker-pt.js, jquery.ui.datepicker-rm.js, jquery.ui.datepicker-ro.js, jquery.ui.datepicker-ru.js, jquery.ui.datepicker-sk.js, jquery.ui.datepicker-sl.js, jquery.ui.datepicker-sq.js, jquery.ui.datepicker-sr-SR.js, jquery.ui.datepicker-sr.js, jquery.ui.datepicker-sv.js, jquery.ui.datepicker-ta.js, jquery.ui.datepicker-th.js, jquery.ui.datepicker-tj.js, jquery.ui.datepicker-tr.js, jquery.ui.datepicker-uk.js, jquery.ui.datepicker-vi.js, jquery.ui.datepicker-zh-CN.js, jquery.ui.datepicker-zh-HK.js, jquery.ui.datepicker-zh-TW.js
26255* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
26256
26257/* Afrikaans initialisation for the jQuery UI date picker plugin. */
26258/* Written by Renier Pretorius. */
26259jQuery(function($){
26260	$.datepicker.regional['af'] = {
26261		closeText: 'Selekteer',
26262		prevText: 'Vorige',
26263		nextText: 'Volgende',
26264		currentText: 'Vandag',
26265		monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie',
26266		'Julie','Augustus','September','Oktober','November','Desember'],
26267		monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun',
26268		'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'],
26269		dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'],
26270		dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'],
26271		dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'],
26272		weekHeader: 'Wk',
26273		dateFormat: 'dd/mm/yy',
26274		firstDay: 1,
26275		isRTL: false,
26276		showMonthAfterYear: false,
26277		yearSuffix: ''};
26278	$.datepicker.setDefaults($.datepicker.regional['af']);
26279});
26280
26281/* Algerian Arabic Translation for jQuery UI date picker plugin. (can be used for Tunisia)*/
26282/* Mohamed Cherif BOUCHELAGHEM -- [email protected] */
26283
26284jQuery(function($){
26285	$.datepicker.regional['ar-DZ'] = {
26286		closeText: 'إغلاق',
26287		prevText: '&#x3c;السابق',
26288		nextText: 'التالي&#x3e;',
26289		currentText: 'اليوم',
26290		monthNames: ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان',
26291		'جويلية', 'أوت', 'سبتمبر','أكتوبر', 'نوفمبر', 'ديسمبر'],
26292		monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
26293		dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
26294		dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
26295		dayNamesMin: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
26296		weekHeader: 'أسبوع',
26297		dateFormat: 'dd/mm/yy',
26298		firstDay: 6,
26299  		isRTL: true,
26300		showMonthAfterYear: false,
26301		yearSuffix: ''};
26302	$.datepicker.setDefaults($.datepicker.regional['ar-DZ']);
26303});
26304
26305/* Arabic Translation for jQuery UI date picker plugin. */
26306/* Khaled Alhourani -- [email protected] */
26307/* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */
26308jQuery(function($){
26309	$.datepicker.regional['ar'] = {
26310		closeText: 'إغلاق',
26311		prevText: '&#x3c;السابق',
26312		nextText: 'التالي&#x3e;',
26313		currentText: 'اليوم',
26314		monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'مايو', 'حزيران',
26315		'تموز', 'آب', 'أيلول',	'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
26316		monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
26317		dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
26318		dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
26319		dayNamesMin: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
26320		weekHeader: 'أسبوع',
26321		dateFormat: 'dd/mm/yy',
26322		firstDay: 6,
26323  		isRTL: true,
26324		showMonthAfterYear: false,
26325		yearSuffix: ''};
26326	$.datepicker.setDefaults($.datepicker.regional['ar']);
26327});
26328/* Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */
26329/* Written by Jamil Najafov ([email protected]). */
26330jQuery(function($) {
26331	$.datepicker.regional['az'] = {
26332		closeText: 'Bağla',
26333		prevText: '&#x3c;Geri',
26334		nextText: 'İrəli&#x3e;',
26335		currentText: 'Bugün',
26336		monthNames: ['Yanvar','Fevral','Mart','Aprel','May','İyun',
26337		'İyul','Avqust','Sentyabr','Oktyabr','Noyabr','Dekabr'],
26338		monthNamesShort: ['Yan','Fev','Mar','Apr','May','İyun',
26339		'İyul','Avq','Sen','Okt','Noy','Dek'],
26340		dayNames: ['Bazar','Bazar ertəsi','Çərşənbə axşamı','Çərşənbə','Cümə axşamı','Cümə','Şənbə'],
26341		dayNamesShort: ['B','Be','Ça','Ç','Ca','C','Ş'],
26342		dayNamesMin: ['B','B','Ç','С','Ç','C','Ş'],
26343		weekHeader: 'Hf',
26344		dateFormat: 'dd.mm.yy',
26345		firstDay: 1,
26346		isRTL: false,
26347		showMonthAfterYear: false,
26348		yearSuffix: ''};
26349	$.datepicker.setDefaults($.datepicker.regional['az']);
26350});
26351/* Bulgarian initialisation for the jQuery UI date picker plugin. */
26352/* Written by Stoyan Kyosev (http://svest.org). */
26353jQuery(function($){
26354    $.datepicker.regional['bg'] = {
26355        closeText: 'затвори',
26356        prevText: '&#x3c;назад',
26357        nextText: 'напред&#x3e;',
26358		nextBigText: '&#x3e;&#x3e;',
26359        currentText: 'днес',
26360        monthNames: ['Януари','Февруари','Март','Април','Май','Юни',
26361        'Юли','Август','Септември','Октомври','Ноември','Декември'],
26362        monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни',
26363        'Юли','Авг','Сеп','Окт','Нов','Дек'],
26364        dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'],
26365        dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'],
26366        dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'],
26367		weekHeader: 'Wk',
26368        dateFormat: 'dd.mm.yy',
26369		firstDay: 1,
26370        isRTL: false,
26371		showMonthAfterYear: false,
26372		yearSuffix: ''};
26373    $.datepicker.setDefaults($.datepicker.regional['bg']);
26374});
26375
26376/* Bosnian i18n for the jQuery UI date picker plugin. */
26377/* Written by Kenan Konjo. */
26378jQuery(function($){
26379	$.datepicker.regional['bs'] = {
26380		closeText: 'Zatvori', 
26381		prevText: '&#x3c;', 
26382		nextText: '&#x3e;', 
26383		currentText: 'Danas', 
26384		monthNames: ['Januar','Februar','Mart','April','Maj','Juni',
26385		'Juli','August','Septembar','Oktobar','Novembar','Decembar'],
26386		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
26387		'Jul','Aug','Sep','Okt','Nov','Dec'],
26388		dayNames: ['Nedelja','Ponedeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
26389		dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
26390		dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
26391		weekHeader: 'Wk',
26392		dateFormat: 'dd.mm.yy',
26393		firstDay: 1,
26394		isRTL: false,
26395		showMonthAfterYear: false,
26396		yearSuffix: ''};
26397	$.datepicker.setDefaults($.datepicker.regional['bs']);
26398});
26399/* Inicialització en català per a l'extenció 'calendar' per jQuery. */
26400/* Writers: ([email protected]). */
26401jQuery(function($){
26402	$.datepicker.regional['ca'] = {
26403		closeText: 'Tancar',
26404		prevText: '&#x3c;Ant',
26405		nextText: 'Seg&#x3e;',
26406		currentText: 'Avui',
26407		monthNames: ['Gener','Febrer','Mar&ccedil;','Abril','Maig','Juny',
26408		'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'],
26409		monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun',
26410		'Jul','Ago','Set','Oct','Nov','Des'],
26411		dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'],
26412		dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'],
26413		dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'],
26414		weekHeader: 'Sm',
26415		dateFormat: 'dd/mm/yy',
26416		firstDay: 1,
26417		isRTL: false,
26418		showMonthAfterYear: false,
26419		yearSuffix: ''};
26420	$.datepicker.setDefaults($.datepicker.regional['ca']);
26421});
26422/* Czech initialisation for the jQuery UI date picker plugin. */
26423/* Written by Tomas Muller ([email protected]). */
26424jQuery(function($){
26425	$.datepicker.regional['cs'] = {
26426		closeText: 'Zavřít',
26427		prevText: '&#x3c;Dříve',
26428		nextText: 'Později&#x3e;',
26429		currentText: 'Nyní',
26430		monthNames: ['leden','únor','březen','duben','květen','červen',
26431        'červenec','srpen','září','říjen','listopad','prosinec'],
26432		monthNamesShort: ['led','úno','bře','dub','kvě','čer',
26433		'čvc','srp','zář','říj','lis','pro'],
26434		dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
26435		dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
26436		dayNamesMin: ['ne','po','út','st','čt','pá','so'],
26437		weekHeader: 'Týd',
26438		dateFormat: 'dd.mm.yy',
26439		firstDay: 1,
26440		isRTL: false,
26441		showMonthAfterYear: false,
26442		yearSuffix: ''};
26443	$.datepicker.setDefaults($.datepicker.regional['cs']);
26444});
26445
26446/* Welsh/UK initialisation for the jQuery UI date picker plugin. */
26447/* Written by William Griffiths. */
26448jQuery(function($){
26449	$.datepicker.regional['cy-GB'] = {
26450		closeText: 'Done',
26451		prevText: 'Prev',
26452		nextText: 'Next',
26453		currentText: 'Today',
26454		monthNames: ['Ionawr','Chwefror','Mawrth','Ebrill','Mai','Mehefin',
26455		'Gorffennaf','Awst','Medi','Hydref','Tachwedd','Rhagfyr'],
26456		monthNamesShort: ['Ion', 'Chw', 'Maw', 'Ebr', 'Mai', 'Meh',
26457		'Gor', 'Aws', 'Med', 'Hyd', 'Tac', 'Rha'],
26458		dayNames: ['Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn'],
26459		dayNamesShort: ['Sul', 'Llu', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad'],
26460		dayNamesMin: ['Su','Ll','Ma','Me','Ia','Gw','Sa'],
26461		weekHeader: 'Wy',
26462		dateFormat: 'dd/mm/yy',
26463		firstDay: 1,
26464		isRTL: false,
26465		showMonthAfterYear: false,
26466		yearSuffix: ''};
26467	$.datepicker.setDefaults($.datepicker.regional['cy-GB']);
26468});
26469/* Danish initialisation for the jQuery UI date picker plugin. */
26470/* Written by Jan Christensen ( [email protected]). */
26471jQuery(function($){
26472    $.datepicker.regional['da'] = {
26473		closeText: 'Luk',
26474        prevText: '&#x3c;Forrige',
26475		nextText: 'Næste&#x3e;',
26476		currentText: 'Idag',
26477        monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
26478        'Juli','August','September','Oktober','November','December'],
26479        monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
26480        'Jul','Aug','Sep','Okt','Nov','Dec'],
26481		dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
26482		dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
26483		dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
26484		weekHeader: 'Uge',
26485        dateFormat: 'dd-mm-yy',
26486		firstDay: 1,
26487		isRTL: false,
26488		showMonthAfterYear: false,
26489		yearSuffix: ''};
26490    $.datepicker.setDefaults($.datepicker.regional['da']);
26491});
26492
26493/* German initialisation for the jQuery UI date picker plugin. */
26494/* Written by Milian Wolff ([email protected]). */
26495jQuery(function($){
26496	$.datepicker.regional['de'] = {
26497		closeText: 'schließen',
26498		prevText: '&#x3c;zurück',
26499		nextText: 'Vor&#x3e;',
26500		currentText: 'heute',
26501		monthNames: ['Januar','Februar','März','April','Mai','Juni',
26502		'Juli','August','September','Oktober','November','Dezember'],
26503		monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
26504		'Jul','Aug','Sep','Okt','Nov','Dez'],
26505		dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
26506		dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
26507		dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
26508		weekHeader: 'KW',
26509		dateFormat: 'dd.mm.yy',
26510		firstDay: 1,
26511		isRTL: false,
26512		showMonthAfterYear: false,
26513		yearSuffix: ''};
26514	$.datepicker.setDefaults($.datepicker.regional['de']);
26515});
26516
26517/* Greek (el) initialisation for the jQuery UI date picker plugin. */
26518/* Written by Alex Cicovic (http://www.alexcicovic.com) */
26519jQuery(function($){
26520	$.datepicker.regional['el'] = {
26521		closeText: 'Κλείσιμο',
26522		prevText: 'Προηγούμενος',
26523		nextText: 'Επόμενος',
26524		currentText: 'Τρέχων Μήνας',
26525		monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος',
26526		'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'],
26527		monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν',
26528		'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'],
26529		dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'],
26530		dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'],
26531		dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'],
26532		weekHeader: 'Εβδ',
26533		dateFormat: 'dd/mm/yy',
26534		firstDay: 1,
26535		isRTL: false,
26536		showMonthAfterYear: false,
26537		yearSuffix: ''};
26538	$.datepicker.setDefaults($.datepicker.regional['el']);
26539});
26540/* English/Australia initialisation for the jQuery UI date picker plugin. */
26541/* Based on the en-GB initialisation. */
26542jQuery(function($){
26543	$.datepicker.regional['en-AU'] = {
26544		closeText: 'Done',
26545		prevText: 'Prev',
26546		nextText: 'Next',
26547		currentText: 'Today',
26548		monthNames: ['January','February','March','April','May','June',
26549		'July','August','September','October','November','December'],
26550		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
26551		'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
26552		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
26553		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
26554		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
26555		weekHeader: 'Wk',
26556		dateFormat: 'dd/mm/yy',
26557		firstDay: 1,
26558		isRTL: false,
26559		showMonthAfterYear: false,
26560		yearSuffix: ''};
26561	$.datepicker.setDefaults($.datepicker.regional['en-AU']);
26562});
26563
26564/* English/UK initialisation for the jQuery UI date picker plugin. */
26565/* Written by Stuart. */
26566jQuery(function($){
26567	$.datepicker.regional['en-GB'] = {
26568		closeText: 'Done',
26569		prevText: 'Prev',
26570		nextText: 'Next',
26571		currentText: 'Today',
26572		monthNames: ['January','February','March','April','May','June',
26573		'July','August','September','October','November','December'],
26574		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
26575		'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
26576		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
26577		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
26578		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
26579		weekHeader: 'Wk',
26580		dateFormat: 'dd/mm/yy',
26581		firstDay: 1,
26582		isRTL: false,
26583		showMonthAfterYear: false,
26584		yearSuffix: ''};
26585	$.datepicker.setDefaults($.datepicker.regional['en-GB']);
26586});
26587
26588/* English/New Zealand initialisation for the jQuery UI date picker plugin. */
26589/* Based on the en-GB initialisation. */
26590jQuery(function($){
26591	$.datepicker.regional['en-NZ'] = {
26592		closeText: 'Done',
26593		prevText: 'Prev',
26594		nextText: 'Next',
26595		currentText: 'Today',
26596		monthNames: ['January','February','March','April','May','June',
26597		'July','August','September','October','November','December'],
26598		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
26599		'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
26600		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
26601		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
26602		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
26603		weekHeader: 'Wk',
26604		dateFormat: 'dd/mm/yy',
26605		firstDay: 1,
26606		isRTL: false,
26607		showMonthAfterYear: false,
26608		yearSuffix: ''};
26609	$.datepicker.setDefaults($.datepicker.regional['en-NZ']);
26610});
26611
26612/* Esperanto initialisation for the jQuery UI date picker plugin. */
26613/* Written by Olivier M. ([email protected]). */
26614jQuery(function($){
26615	$.datepicker.regional['eo'] = {
26616		closeText: 'Fermi',
26617		prevText: '&lt;Anta',
26618		nextText: 'Sekv&gt;',
26619		currentText: 'Nuna',
26620		monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio',
26621		'Julio','AÅ­gusto','Septembro','Oktobro','Novembro','Decembro'],
26622		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
26623		'Jul','AÅ­g','Sep','Okt','Nov','Dec'],
26624		dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'],
26625		dayNamesShort: ['Dim','Lun','Mar','Mer','Ä´aÅ­','Ven','Sab'],
26626		dayNamesMin: ['Di','Lu','Ma','Me','Ä´a','Ve','Sa'],
26627		weekHeader: 'Sb',
26628		dateFormat: 'dd/mm/yy',
26629		firstDay: 0,
26630		isRTL: false,
26631		showMonthAfterYear: false,
26632		yearSuffix: ''};
26633	$.datepicker.setDefaults($.datepicker.regional['eo']);
26634});
26635
26636/* Inicialización en español para la extensión 'UI date picker' para jQuery. */
26637/* Traducido por Vester ([email protected]). */
26638jQuery(function($){
26639	$.datepicker.regional['es'] = {
26640		closeText: 'Cerrar',
26641		prevText: '&#x3c;Ant',
26642		nextText: 'Sig&#x3e;',
26643		currentText: 'Hoy',
26644		monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
26645		'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
26646		monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
26647		'Jul','Ago','Sep','Oct','Nov','Dic'],
26648		dayNames: ['Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','S&aacute;bado'],
26649		dayNamesShort: ['Dom','Lun','Mar','Mi&eacute;','Juv','Vie','S&aacute;b'],
26650		dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','S&aacute;'],
26651		weekHeader: 'Sm',
26652		dateFormat: 'dd/mm/yy',
26653		firstDay: 1,
26654		isRTL: false,
26655		showMonthAfterYear: false,
26656		yearSuffix: ''};
26657	$.datepicker.setDefaults($.datepicker.regional['es']);
26658});
26659/* Estonian initialisation for the jQuery UI date picker plugin. */
26660/* Written by Mart Sõmermaa (mrts.pydev at gmail com). */
26661jQuery(function($){
26662	$.datepicker.regional['et'] = {
26663		closeText: 'Sulge',
26664		prevText: 'Eelnev',
26665		nextText: 'Järgnev',
26666		currentText: 'Täna',
26667		monthNames: ['Jaanuar','Veebruar','Märts','Aprill','Mai','Juuni',
26668		'Juuli','August','September','Oktoober','November','Detsember'],
26669		monthNamesShort: ['Jaan', 'Veebr', 'Märts', 'Apr', 'Mai', 'Juuni',
26670		'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'],
26671		dayNames: ['Pühapäev', 'Esmaspäev', 'Teisipäev', 'Kolmapäev', 'Neljapäev', 'Reede', 'Laupäev'],
26672		dayNamesShort: ['Pühap', 'Esmasp', 'Teisip', 'Kolmap', 'Neljap', 'Reede', 'Laup'],
26673		dayNamesMin: ['P','E','T','K','N','R','L'],
26674		weekHeader: 'näd',
26675		dateFormat: 'dd.mm.yy',
26676		firstDay: 1,
26677		isRTL: false,
26678		showMonthAfterYear: false,
26679		yearSuffix: ''};
26680	$.datepicker.setDefaults($.datepicker.regional['et']);
26681}); 
26682/* Euskarako oinarria 'UI date picker' jquery-ko extentsioarentzat */
26683/* Karrikas-ek itzulia ([email protected]) */
26684jQuery(function($){
26685	$.datepicker.regional['eu'] = {
26686		closeText: 'Egina',
26687		prevText: '&#x3c;Aur',
26688		nextText: 'Hur&#x3e;',
26689		currentText: 'Gaur',
26690		monthNames: ['urtarrila','otsaila','martxoa','apirila','maiatza','ekaina',
26691			'uztaila','abuztua','iraila','urria','azaroa','abendua'],
26692		monthNamesShort: ['urt.','ots.','mar.','api.','mai.','eka.',
26693			'uzt.','abu.','ira.','urr.','aza.','abe.'],
26694		dayNames: ['igandea','astelehena','asteartea','asteazkena','osteguna','ostirala','larunbata'],
26695		dayNamesShort: ['ig.','al.','ar.','az.','og.','ol.','lr.'],
26696		dayNamesMin: ['ig','al','ar','az','og','ol','lr'],
26697		weekHeader: 'As',
26698		dateFormat: 'yy-mm-dd',
26699		firstDay: 1,
26700		isRTL: false,
26701		showMonthAfterYear: false,
26702		yearSuffix: ''};
26703	$.datepicker.setDefaults($.datepicker.regional['eu']);
26704});
26705/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */
26706/* Javad Mowlanezhad -- [email protected] */
26707/* Jalali calendar should supported soon! (Its implemented but I have to test it) */
26708jQuery(function($) {
26709	$.datepicker.regional['fa'] = {
26710		closeText: 'بستن',
26711		prevText: '&#x3C;قبلی',
26712		nextText: 'بعدی&#x3E;',
26713		currentText: 'امروز',
26714		monthNames: [
26715			'فروردين',
26716			'ارديبهشت',
26717			'خرداد',
26718			'تير',
26719			'مرداد',
26720			'شهريور',
26721			'مهر',
26722			'آبان',
26723			'آذر',
26724			'دی',
26725			'بهمن',
26726			'اسفند'
26727		],
26728		monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
26729		dayNames: [
26730			'يکشنبه',
26731			'دوشنبه',
26732			'سه‌شنبه',
26733			'چهارشنبه',
26734			'پنجشنبه',
26735			'جمعه',
26736			'شنبه'
26737		],
26738		dayNamesShort: [
26739			'ی',
26740			'د',
26741			'س',
26742			'چ',
26743			'Ù¾',
26744			'ج', 
26745			'Ø´'
26746		],
26747		dayNamesMin: [
26748			'ی',
26749			'د',
26750			'س',
26751			'چ',
26752			'Ù¾',
26753			'ج', 
26754			'Ø´'
26755		],
26756		weekHeader: 'هف',
26757		dateFormat: 'yy/mm/dd',
26758		firstDay: 6,
26759		isRTL: true,
26760		showMonthAfterYear: false,
26761		yearSuffix: ''};
26762	$.datepicker.setDefaults($.datepicker.regional['fa']);
26763});
26764/* Finnish initialisation for the jQuery UI date picker plugin. */
26765/* Written by Harri Kilpiö ([email protected]). */
26766jQuery(function($){
26767	$.datepicker.regional['fi'] = {
26768		closeText: 'Sulje',
26769		prevText: '&#xAB;Edellinen',
26770		nextText: 'Seuraava&#xBB;',
26771		currentText: 'T&#xE4;n&#xE4;&#xE4;n',
26772		monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kes&#xE4;kuu',
26773		'Hein&#xE4;kuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'],
26774		monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kes&#xE4;',
26775		'Hein&#xE4;','Elo','Syys','Loka','Marras','Joulu'],
26776		dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','La'],
26777		dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'],
26778		dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'],
26779		weekHeader: 'Vk',
26780		dateFormat: 'dd.mm.yy',
26781		firstDay: 1,
26782		isRTL: false,
26783		showMonthAfterYear: false,
26784		yearSuffix: ''};
26785	$.datepicker.setDefaults($.datepicker.regional['fi']);
26786});
26787
26788/* Faroese initialisation for the jQuery UI date picker plugin */
26789/* Written by Sverri Mohr Olsen, [email protected] */
26790jQuery(function($){
26791	$.datepicker.regional['fo'] = {
26792		closeText: 'Lat aftur',
26793		prevText: '&#x3c;Fyrra',
26794		nextText: 'Næsta&#x3e;',
26795		currentText: 'Í dag',
26796		monthNames: ['Januar','Februar','Mars','Apríl','Mei','Juni',
26797		'Juli','August','September','Oktober','November','Desember'],
26798		monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
26799		'Jul','Aug','Sep','Okt','Nov','Des'],
26800		dayNames: ['Sunnudagur','Mánadagur','Týsdagur','Mikudagur','Hósdagur','Fríggjadagur','Leyardagur'],
26801		dayNamesShort: ['Sun','Mán','Týs','Mik','Hós','Frí','Ley'],
26802		dayNamesMin: ['Su','Má','Tý','Mi','Hó','Fr','Le'],
26803		weekHeader: 'Vk',
26804		dateFormat: 'dd-mm-yy',
26805		firstDay: 0,
26806		isRTL: false,
26807		showMonthAfterYear: false,
26808		yearSuffix: ''};
26809	$.datepicker.setDefaults($.datepicker.regional['fo']);
26810});
26811
26812/* Swiss-French initialisation for the jQuery UI date picker plugin. */
26813/* Written Martin Voelkle ([email protected]). */
26814jQuery(function($){
26815	$.datepicker.regional['fr-CH'] = {
26816		closeText: 'Fermer',
26817		prevText: '&#x3c;Préc',
26818		nextText: 'Suiv&#x3e;',
26819		currentText: 'Courant',
26820		monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
26821		'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
26822		monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
26823		'Jul','Aoû','Sep','Oct','Nov','Déc'],
26824		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
26825		dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
26826		dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
26827		weekHeader: 'Sm',
26828		dateFormat: 'dd.mm.yy',
26829		firstDay: 1,
26830		isRTL: false,
26831		showMonthAfterYear: false,
26832		yearSuffix: ''};
26833	$.datepicker.setDefaults($.datepicker.regional['fr-CH']);
26834});
26835/* French initialisation for the jQuery UI date picker plugin. */
26836/* Written by Keith Wood (kbwood{at}iinet.com.au),
26837              Stéphane Nahmani ([email protected]),
26838              Stéphane Raimbault <[email protected]> */
26839jQuery(function($){
26840	$.datepicker.regional['fr'] = {
26841		closeText: 'Fermer',
26842		prevText: 'Précédent',
26843		nextText: 'Suivant',
26844		currentText: 'Aujourd\'hui',
26845		monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
26846		'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
26847		monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin',
26848		'Juil.','Août','Sept.','Oct.','Nov.','Déc.'],
26849		dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
26850		dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'],
26851		dayNamesMin: ['D','L','M','M','J','V','S'],
26852		weekHeader: 'Sem.',
26853		dateFormat: 'dd/mm/yy',
26854		firstDay: 1,
26855		isRTL: false,
26856		showMonthAfterYear: false,
26857		yearSuffix: ''};
26858	$.datepicker.setDefaults($.datepicker.regional['fr']);
26859});
26860
26861/* Galician localization for 'UI date picker' jQuery extension. */
26862/* Translated by Jorge Barreiro <[email protected]>. */
26863jQuery(function($){
26864	$.datepicker.regional['gl'] = {
26865		closeText: 'Pechar',
26866		prevText: '&#x3c;Ant',
26867		nextText: 'Seg&#x3e;',
26868		currentText: 'Hoxe',
26869		monthNames: ['Xaneiro','Febreiro','Marzo','Abril','Maio','Xuño',
26870		'Xullo','Agosto','Setembro','Outubro','Novembro','Decembro'],
26871		monthNamesShort: ['Xan','Feb','Mar','Abr','Mai','Xuñ',
26872		'Xul','Ago','Set','Out','Nov','Dec'],
26873		dayNames: ['Domingo','Luns','Martes','M&eacute;rcores','Xoves','Venres','S&aacute;bado'],
26874		dayNamesShort: ['Dom','Lun','Mar','M&eacute;r','Xov','Ven','S&aacute;b'],
26875		dayNamesMin: ['Do','Lu','Ma','M&eacute;','Xo','Ve','S&aacute;'],
26876		weekHeader: 'Sm',
26877		dateFormat: 'dd/mm/yy',
26878		firstDay: 1,
26879		isRTL: false,
26880		showMonthAfterYear: false,
26881		yearSuffix: ''};
26882	$.datepicker.setDefaults($.datepicker.regional['gl']);
26883});
26884/* Hebrew initialisation for the UI Datepicker extension. */
26885/* Written by Amir Hardon (ahardon at gmail dot com). */
26886jQuery(function($){
26887	$.datepicker.regional['he'] = {
26888		closeText: 'סגור',
26889		prevText: '&#x3c;הקודם',
26890		nextText: 'הבא&#x3e;',
26891		currentText: 'היום',
26892		monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני',
26893		'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'],
26894		monthNamesShort: ['ינו','פבר','מרץ','אפר','מאי','יוני',
26895		'יולי','אוג','ספט','אוק','נוב','דצמ'],
26896		dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'],
26897		dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
26898		dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'],
26899		weekHeader: 'Wk',
26900		dateFormat: 'dd/mm/yy',
26901		firstDay: 0,
26902		isRTL: true,
26903		showMonthAfterYear: false,
26904		yearSuffix: ''};
26905	$.datepicker.setDefaults($.datepicker.regional['he']);
26906});
26907
26908/* Hindi initialisation for the jQuery UI date picker plugin. */
26909/* Written by Michael Dawart. */
26910jQuery(function($){
26911	$.datepicker.regional['hi'] = {
26912		closeText: 'बंद',
26913		prevText: 'पिछला',
26914		nextText: 'अगला',
26915		currentText: 'आज',
26916		monthNames: ['जनवरी ','फरवरी','मार्च','अप्रेल','मई','जून',
26917		'जूलाई','अगस्त ','सितम्बर','अक्टूबर','नवम्बर','दिसम्बर'],
26918		monthNamesShort: ['जन', 'फर', 'मार्च', 'अप्रेल', 'मई', 'जून',
26919		'जूलाई', 'अग', 'सित', 'अक्ट', 'नव', 'दि'],
26920		dayNames: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'],
26921		dayNamesShort: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
26922		dayNamesMin: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
26923		weekHeader: 'हफ्ता',
26924		dateFormat: 'dd/mm/yy',
26925		firstDay: 1,
26926		isRTL: false,
26927		showMonthAfterYear: false,
26928		yearSuffix: ''};
26929	$.datepicker.setDefaults($.datepicker.regional['hi']);
26930});
26931
26932/* Croatian i18n for the jQuery UI date picker plugin. */
26933/* Written by Vjekoslav Nesek. */
26934jQuery(function($){
26935	$.datepicker.regional['hr'] = {
26936		closeText: 'Zatvori',
26937		prevText: '&#x3c;',
26938		nextText: '&#x3e;',
26939		currentText: 'Danas',
26940		monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj',
26941		'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
26942		monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip',
26943		'Srp','Kol','Ruj','Lis','Stu','Pro'],
26944		dayNames: ['Nedjelja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
26945		dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
26946		dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
26947		weekHeader: 'Tje',
26948		dateFormat: 'dd.mm.yy.',
26949		firstDay: 1,
26950		isRTL: false,
26951		showMonthAfterYear: false,
26952		yearSuffix: ''};
26953	$.datepicker.setDefaults($.datepicker.regional['hr']);
26954});
26955/* Hungarian initialisation for the jQuery UI date picker plugin. */
26956/* Written by Istvan Karaszi ([email protected]). */
26957jQuery(function($){
26958	$.datepicker.regional['hu'] = {
26959		closeText: 'bezár',
26960		prevText: 'vissza',
26961		nextText: 'előre',
26962		currentText: 'ma',
26963		monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június',
26964		'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
26965		monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún',
26966		'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'],
26967		dayNames: ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'],
26968		dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'],
26969		dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
26970		weekHeader: 'Hét',
26971		dateFormat: 'yy.mm.dd.',
26972		firstDay: 1,
26973		isRTL: false,
26974		showMonthAfterYear: true,
26975		yearSuffix: ''};
26976	$.datepicker.setDefaults($.datepicker.regional['hu']);
26977});
26978
26979/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */
26980/* Written by Levon Zakaryan ([email protected])*/
26981jQuery(function($){
26982	$.datepicker.regional['hy'] = {
26983		closeText: 'Փակել',
26984		prevText: '&#x3c;Նախ.',
26985		nextText: 'Հաջ.&#x3e;',
26986		currentText: 'Այսօր',
26987		monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս',
26988		'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'],
26989		monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս',
26990		'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'],
26991		dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'],
26992		dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
26993		dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
26994		weekHeader: 'ՇԲՏ',
26995		dateFormat: 'dd.mm.yy',
26996		firstDay: 1,
26997		isRTL: false,
26998		showMonthAfterYear: false,
26999		yearSuffix: ''};
27000	$.datepicker.setDefaults($.datepicker.regional['hy']);
27001});
27002/* Indonesian initialisation for the jQuery UI date picker plugin. */
27003/* Written by Deden Fathurahman ([email protected]). */
27004jQuery(function($){
27005	$.datepicker.regional['id'] = {
27006		closeText: 'Tutup',
27007		prevText: '&#x3c;mundur',
27008		nextText: 'maju&#x3e;',
27009		currentText: 'hari ini',
27010		monthNames: ['Januari','Februari','Maret','April','Mei','Juni',
27011		'Juli','Agustus','September','Oktober','Nopember','Desember'],
27012		monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
27013		'Jul','Agus','Sep','Okt','Nop','Des'],
27014		dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'],
27015		dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'],
27016		dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'],
27017		weekHeader: 'Mg',
27018		dateFormat: 'dd/mm/yy',
27019		firstDay: 0,
27020		isRTL: false,
27021		showMonthAfterYear: false,
27022		yearSuffix: ''};
27023	$.datepicker.setDefaults($.datepicker.regional['id']);
27024});
27025/* Icelandic initialisation for the jQuery UI date picker plugin. */
27026/* Written by Haukur H. Thorsson ([email protected]). */
27027jQuery(function($){
27028	$.datepicker.regional['is'] = {
27029		closeText: 'Loka',
27030		prevText: '&#x3c; Fyrri',
27031		nextText: 'N&aelig;sti &#x3e;',
27032		currentText: '&Iacute; dag',
27033		monthNames: ['Jan&uacute;ar','Febr&uacute;ar','Mars','Apr&iacute;l','Ma&iacute','J&uacute;n&iacute;',
27034		'J&uacute;l&iacute;','&Aacute;g&uacute;st','September','Okt&oacute;ber','N&oacute;vember','Desember'],
27035		monthNamesShort: ['Jan','Feb','Mar','Apr','Ma&iacute;','J&uacute;n',
27036		'J&uacute;l','&Aacute;g&uacute;','Sep','Okt','N&oacute;v','Des'],
27037		dayNames: ['Sunnudagur','M&aacute;nudagur','&THORN;ri&eth;judagur','Mi&eth;vikudagur','Fimmtudagur','F&ouml;studagur','Laugardagur'],
27038		dayNamesShort: ['Sun','M&aacute;n','&THORN;ri','Mi&eth;','Fim','F&ouml;s','Lau'],
27039		dayNamesMin: ['Su','M&aacute;','&THORN;r','Mi','Fi','F&ouml;','La'],
27040		weekHeader: 'Vika',
27041		dateFormat: 'dd/mm/yy',
27042		firstDay: 0,
27043		isRTL: false,
27044		showMonthAfterYear: false,
27045		yearSuffix: ''};
27046	$.datepicker.setDefaults($.datepicker.regional['is']);
27047});
27048/* Italian initialisation for the jQuery UI date picker plugin. */
27049/* Written by Antonello Pasella ([email protected]). */
27050jQuery(function($){
27051	$.datepicker.regional['it'] = {
27052		closeText: 'Chiudi',
27053		prevText: '&#x3c;Prec',
27054		nextText: 'Succ&#x3e;',
27055		currentText: 'Oggi',
27056		monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno',
27057			'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
27058		monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu',
27059			'Lug','Ago','Set','Ott','Nov','Dic'],
27060		dayNames: ['Domenica','Luned&#236','Marted&#236','Mercoled&#236','Gioved&#236','Venerd&#236','Sabato'],
27061		dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
27062		dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'],
27063		weekHeader: 'Sm',
27064		dateFormat: 'dd/mm/yy',
27065		firstDay: 1,
27066		isRTL: false,
27067		showMonthAfterYear: false,
27068		yearSuffix: ''};
27069	$.datepicker.setDefaults($.datepicker.regional['it']);
27070});
27071
27072/* Japanese initialisation for the jQuery UI date picker plugin. */
27073/* Written by Kentaro SATO ([email protected]). */
27074jQuery(function($){
27075	$.datepicker.regional['ja'] = {
27076		closeText: '閉じる',
27077		prevText: '&#x3c;前',
27078		nextText: '次&#x3e;',
27079		currentText: '今日',
27080		monthNames: ['1月','2月','3月','4月','5月','6月',
27081		'7月','8月','9月','10月','11月','12月'],
27082		monthNamesShort: ['1月','2月','3月','4月','5月','6月',
27083		'7月','8月','9月','10月','11月','12月'],
27084		dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'],
27085		dayNamesShort: ['日','月','火','水','木','金','土'],
27086		dayNamesMin: ['日','月','火','水','木','金','土'],
27087		weekHeader: '週',
27088		dateFormat: 'yy/mm/dd',
27089		firstDay: 0,
27090		isRTL: false,
27091		showMonthAfterYear: true,
27092		yearSuffix: 'å¹´'};
27093	$.datepicker.setDefaults($.datepicker.regional['ja']);
27094});
27095/* Georgian (UTF-8) initialisation for the jQuery UI date picker plugin. */
27096/* Written by Lado Lomidze ([email protected]). */
27097jQuery(function($){
27098	$.datepicker.regional['ka'] = {
27099		closeText: 'დახურვა',
27100		prevText: '&#x3c; წინა',
27101		nextText: 'შემდეგი &#x3e;',
27102		currentText: 'დღეს',
27103		monthNames: ['იანვარი','თებერვალი','მარტი','აპრილი','მაისი','ივნისი', 'ივლისი','აგვისტო','სექტემბერი','ოქტომბერი','ნოემბერი','დეკემბერი'],
27104		monthNamesShort: ['იან','თებ','მარ','აპრ','მაი','ივნ', 'ივლ','აგვ','სექ','ოქტ','ნოე','დეკ'],
27105		dayNames: ['კვირა','ორშაბათი','სამშაბათი','ოთხშაბათი','ხუთშაბათი','პარასკევი','შაბათი'],
27106		dayNamesShort: ['კვ','ორშ','სამ','ოთხ','ხუთ','პარ','შაბ'],
27107		dayNamesMin: ['კვ','ორშ','სამ','ოთხ','ხუთ','პარ','შაბ'],
27108		weekHeader: 'კვირა',
27109		dateFormat: 'dd-mm-yy',
27110		firstDay: 1,
27111		isRTL: false,
27112		showMonthAfterYear: false,
27113		yearSuffix: ''};
27114	$.datepicker.setDefaults($.datepicker.regional['ka']);
27115});
27116
27117/* Kazakh (UTF-8) initialisation for the jQuery UI date picker plugin. */
27118/* Written by Dmitriy Karasyov ([email protected]). */
27119jQuery(function($){
27120	$.datepicker.regional['kk'] = {
27121		closeText: 'Жабу',
27122		prevText: '&#x3c;Алдыңғы',
27123		nextText: 'Келесі&#x3e;',
27124		currentText: 'Бүгін',
27125		monthNames: ['Қаңтар','Ақпан','Наурыз','Сәуір','Мамыр','Маусым',
27126		'Шілде','Тамыз','Қыркүйек','Қазан','Қараша','Желтоқсан'],
27127		monthNamesShort: ['Қаң','Ақп','Нау','Сәу','Мам','Мау',
27128		'Шіл','Там','Қыр','Қаз','Қар','Жел'],
27129		dayNames: ['Жексенбі','Дүйсенбі','Сейсенбі','Сәрсенбі','Бейсенбі','Жұма','Сенбі'],
27130		dayNamesShort: ['жкс','дсн','ссн','срс','бсн','жма','снб'],
27131		dayNamesMin: ['Жк','Дс','Сс','Ср','Бс','Жм','Сн'],
27132		weekHeader: 'Не',
27133		dateFormat: 'dd.mm.yy',
27134		firstDay: 1,
27135		isRTL: false,
27136		showMonthAfterYear: false,
27137		yearSuffix: ''};
27138	$.datepicker.setDefaults($.datepicker.regional['kk']);
27139});
27140
27141/* Khmer initialisation for the jQuery calendar extension. */
27142/* Written by Chandara Om ([email protected]). */
27143jQuery(function($){
27144	$.datepicker.regional['km'] = {
27145		closeText: 'ធ្វើ​រួច',
27146		prevText: 'មុន',
27147		nextText: 'បន្ទាប់',
27148		currentText: 'ថ្ងៃ​នេះ',
27149		monthNames: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
27150		'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
27151		monthNamesShort: ['មករា','កុម្ភៈ','មីនា','មេសា','ឧសភា','មិថុនា',
27152		'កក្កដា','សីហា','កញ្ញា','តុលា','វិច្ឆិកា','ធ្នូ'],
27153		dayNames: ['អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'],
27154		dayNamesShort: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
27155		dayNamesMin: ['អា', 'ច', 'អ', 'ពុ', 'ព្រហ', 'សុ', 'សៅ'],
27156		weekHeader: 'សប្ដាហ៍',
27157		dateFormat: 'dd-mm-yy',
27158		firstDay: 1,
27159		isRTL: false,
27160		showMonthAfterYear: false,
27161		yearSuffix: ''};
27162	$.datepicker.setDefaults($.datepicker.regional['km']);
27163});
27164
27165/* Korean initialisation for the jQuery calendar extension. */
27166/* Written by DaeKwon Kang ([email protected]), Edited by Genie. */
27167jQuery(function($){
27168	$.datepicker.regional['ko'] = {
27169		closeText: '닫기',
27170		prevText: '이전달',
27171		nextText: '다음달',
27172		currentText: '오늘',
27173		monthNames: ['1월','2월','3월','4월','5월','6월',
27174		'7월','8월','9월','10월','11월','12월'],
27175		monthNamesShort: ['1월','2월','3월','4월','5월','6월',
27176		'7월','8월','9월','10월','11월','12월'],
27177		dayNames: ['일요일','월요일','화요일','수요일','목요일','금요일','토요일'],
27178		dayNamesShort: ['일','월','화','수','목','금','토'],
27179		dayNamesMin: ['일','월','화','수','목','금','토'],
27180		weekHeader: 'Wk',
27181		dateFormat: 'yy-mm-dd',
27182		firstDay: 0,
27183		isRTL: false,
27184		showMonthAfterYear: true,
27185		yearSuffix: '년'};
27186	$.datepicker.setDefaults($.datepicker.regional['ko']);
27187});
27188/* Luxembourgish initialisation for the jQuery UI date picker plugin. */
27189/* Written by Michel Weimerskirch <[email protected]> */
27190jQuery(function($){
27191	$.datepicker.regional['lb'] = {
27192		closeText: 'Fäerdeg',
27193		prevText: 'Zréck',
27194		nextText: 'Weider',
27195		currentText: 'Haut',
27196		monthNames: ['Januar','Februar','Mäerz','Abrëll','Mee','Juni',
27197		'Juli','August','September','Oktober','November','Dezember'],
27198		monthNamesShort: ['Jan', 'Feb', 'Mäe', 'Abr', 'Mee', 'Jun',
27199		'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
27200		dayNames: ['Sonndeg', 'Méindeg', 'Dënschdeg', 'Mëttwoch', 'Donneschdeg', 'Freideg', 'Samschdeg'],
27201		dayNamesShort: ['Son', 'Méi', 'Dën', 'Mët', 'Don', 'Fre', 'Sam'],
27202		dayNamesMin: ['So','Mé','Dë','Më','Do','Fr','Sa'],
27203		weekHeader: 'W',
27204		dateFormat: 'dd.mm.yy',
27205		firstDay: 1,
27206		isRTL: false,
27207		showMonthAfterYear: false,
27208		yearSuffix: ''};
27209	$.datepicker.setDefaults($.datepicker.regional['lb']);
27210});
27211
27212/* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */
27213/* @author Arturas Paleicikas <[email protected]> */
27214jQuery(function($){
27215	$.datepicker.regional['lt'] = {
27216		closeText: 'Uždaryti',
27217		prevText: '&#x3c;Atgal',
27218		nextText: 'Pirmyn&#x3e;',
27219		currentText: 'Å iandien',
27220		monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis',
27221		'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'],
27222		monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir',
27223		'Lie','Rugp','Rugs','Spa','Lap','Gru'],
27224		dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'],
27225		dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'],
27226		dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Å e'],
27227		weekHeader: 'Wk',
27228		dateFormat: 'yy-mm-dd',
27229		firstDay: 1,
27230		isRTL: false,
27231		showMonthAfterYear: false,
27232		yearSuffix: ''};
27233	$.datepicker.setDefaults($.datepicker.regional['lt']);
27234});
27235/* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */
27236/* @author Arturas Paleicikas <[email protected]> */
27237jQuery(function($){
27238	$.datepicker.regional['lv'] = {
27239		closeText: 'Aizvērt',
27240		prevText: 'Iepr',
27241		nextText: 'Nāka',
27242		currentText: 'Å odien',
27243		monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs',
27244		'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'],
27245		monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn',
27246		'Jūl','Aug','Sep','Okt','Nov','Dec'],
27247		dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'],
27248		dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'],
27249		dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'],
27250		weekHeader: 'Nav',
27251		dateFormat: 'dd-mm-yy',
27252		firstDay: 1,
27253		isRTL: false,
27254		showMonthAfterYear: false,
27255		yearSuffix: ''};
27256	$.datepicker.setDefaults($.datepicker.regional['lv']);
27257});
27258/* Macedonian i18n for the jQuery UI date picker plugin. */
27259/* Written by Stojce Slavkovski. */
27260jQuery(function($){
27261	$.datepicker.regional['mk'] = {
27262		closeText: 'Затвори',
27263		prevText: '&#x3C;',
27264		nextText: '&#x3E;',
27265		currentText: 'Денес',
27266		monthNames: ['Јануари','Февруари','Март','Април','Мај','Јуни',
27267		'Јули','Август','Септември','Октомври','Ноември','Декември'],
27268		monthNamesShort: ['Јан','Фев','Мар','Апр','Мај','Јун',
27269		'Јул','Авг','Сеп','Окт','Ное','Дек'],
27270		dayNames: ['Недела','Понеделник','Вторник','Среда','Четврток','Петок','Сабота'],
27271		dayNamesShort: ['Нед','Пон','Вто','Сре','Чет','Пет','Саб'],
27272		dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Са'],
27273		weekHeader: 'Сед',
27274		dateFormat: 'dd.mm.yy',
27275		firstDay: 1,
27276		isRTL: false,
27277		showMonthAfterYear: false,
27278		yearSuffix: ''};
27279	$.datepicker.setDefaults($.datepicker.regional['mk']);
27280});
27281
27282/* Malayalam (UTF-8) initialisation for the jQuery UI date picker plugin. */
27283/* Written by Saji Nediyanchath ([email protected]). */
27284jQuery(function($){
27285	$.datepicker.regional['ml'] = {
27286		closeText: 'à´¶à´°à´¿',
27287		prevText: 'മുന്നത്തെ',  
27288		nextText: 'അടുത്തത് ',
27289		currentText: 'ഇന്ന്',
27290		monthNames: ['ജനുവരി','ഫെബ്രുവരി','മാര്‍ച്ച്','ഏപ്രില്‍','മേയ്','ജൂണ്‍',
27291		'ജൂലൈ','ആഗസ്റ്റ്','സെപ്റ്റംബര്‍','ഒക്ടോബര്‍','നവംബര്‍','ഡിസംബര്‍'],
27292		monthNamesShort: ['ജനു', 'ഫെബ്', 'മാര്‍', 'ഏപ്രി', 'മേയ്', 'ജൂണ്‍',
27293		'ജൂലാ', 'ആഗ', 'സെപ്', 'ഒക്ടോ', 'നവം', 'ഡിസ'],
27294		dayNames: ['ഞായര്‍', 'തിങ്കള്‍', 'ചൊവ്വ', 'ബുധന്‍', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
27295		dayNamesShort: ['ഞായ', 'തിങ്ക', 'ചൊവ്വ', 'ബുധ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
27296		dayNamesMin: ['ഞാ','തി','ചൊ','ബു','വ്യാ','വെ','ശ'],
27297		weekHeader: 'ആ',
27298		dateFormat: 'dd/mm/yy',
27299		firstDay: 1,
27300		isRTL: false,
27301		showMonthAfterYear: false,
27302		yearSuffix: ''};
27303	$.datepicker.setDefaults($.datepicker.regional['ml']);
27304});
27305
27306/* Malaysian initialisation for the jQuery UI date picker plugin. */
27307/* Written by Mohd Nawawi Mohamad Jamili ([email protected]). */
27308jQuery(function($){
27309	$.datepicker.regional['ms'] = {
27310		closeText: 'Tutup',
27311		prevText: '&#x3c;Sebelum',
27312		nextText: 'Selepas&#x3e;',
27313		currentText: 'hari ini',
27314		monthNames: ['Januari','Februari','Mac','April','Mei','Jun',
27315		'Julai','Ogos','September','Oktober','November','Disember'],
27316		monthNamesShort: ['Jan','Feb','Mac','Apr','Mei','Jun',
27317		'Jul','Ogo','Sep','Okt','Nov','Dis'],
27318		dayNames: ['Ahad','Isnin','Selasa','Rabu','Khamis','Jumaat','Sabtu'],
27319		dayNamesShort: ['Aha','Isn','Sel','Rab','kha','Jum','Sab'],
27320		dayNamesMin: ['Ah','Is','Se','Ra','Kh','Ju','Sa'],
27321		weekHeader: 'Mg',
27322		dateFormat: 'dd/mm/yy',
27323		firstDay: 0,
27324		isRTL: false,
27325		showMonthAfterYear: false,
27326		yearSuffix: ''};
27327	$.datepicker.setDefaults($.datepicker.regional['ms']);
27328});
27329/* Dutch (Belgium) initialisation for the jQuery UI date picker plugin. */
27330/* David De Sloovere @DavidDeSloovere */
27331jQuery(function($){
27332	$.datepicker.regional['nl-BE'] = {
27333		closeText: 'Sluiten',
27334		prevText: '←',
27335		nextText: '→',
27336		currentText: 'Vandaag',
27337		monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
27338		'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
27339		monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun',
27340		'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
27341		dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
27342		dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
27343		dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
27344		weekHeader: 'Wk',
27345		dateFormat: 'dd/mm/yy',
27346		firstDay: 1,
27347		isRTL: false,
27348		showMonthAfterYear: false,
27349		yearSuffix: ''};
27350	$.datepicker.setDefaults($.datepicker.regional['nl-BE']);
27351});
27352
27353/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */
27354/* Written by Mathias Bynens <http://mathiasbynens.be/> */
27355jQuery(function($){
27356	$.datepicker.regional.nl = {
27357		closeText: 'Sluiten',
27358		prevText: '←',
27359		nextText: '→',
27360		currentText: 'Vandaag',
27361		monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
27362		'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
27363		monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun',
27364		'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
27365		dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
27366		dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
27367		dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
27368		weekHeader: 'Wk',
27369		dateFormat: 'dd-mm-yy',
27370		firstDay: 1,
27371		isRTL: false,
27372		showMonthAfterYear: false,
27373		yearSuffix: ''};
27374	$.datepicker.setDefaults($.datepicker.regional.nl);
27375});
27376/* Norwegian initialisation for the jQuery UI date picker plugin. */
27377/* Written by Naimdjon Takhirov ([email protected]). */
27378
27379jQuery(function($){
27380  $.datepicker.regional['no'] = {
27381    closeText: 'Lukk',
27382    prevText: '&laquo;Forrige',
27383    nextText: 'Neste&raquo;',
27384    currentText: 'I dag',
27385    monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'],
27386    monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'],
27387    dayNamesShort: ['søn','man','tir','ons','tor','fre','lør'],
27388    dayNames: ['søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag'],
27389    dayNamesMin: ['sø','ma','ti','on','to','fr','lø'],
27390    weekHeader: 'Uke',
27391    dateFormat: 'dd.mm.yy',
27392    firstDay: 1,
27393    isRTL: false,
27394    showMonthAfterYear: false,
27395    yearSuffix: ''
27396  };
27397  $.datepicker.setDefaults($.datepicker.regional['no']);
27398});
27399
27400/* Polish initialisation for the jQuery UI date picker plugin. */
27401/* Written by Jacek Wysocki ([email protected]). */
27402jQuery(function($){
27403	$.datepicker.regional['pl'] = {
27404		closeText: 'Zamknij',
27405		prevText: '&#x3c;Poprzedni',
27406		nextText: 'Następny&#x3e;',
27407		currentText: 'Dziś',
27408		monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
27409		'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
27410		monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
27411		'Lip','Sie','Wrz','Pa','Lis','Gru'],
27412		dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
27413		dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'],
27414		dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'],
27415		weekHeader: 'Tydz',
27416		dateFormat: 'dd.mm.yy',
27417		firstDay: 1,
27418		isRTL: false,
27419		showMonthAfterYear: false,
27420		yearSuffix: ''};
27421	$.datepicker.setDefaults($.datepicker.regional['pl']);
27422});
27423
27424/* Brazilian initialisation for the jQuery UI date picker plugin. */
27425/* Written by Leonildo Costa Silva ([email protected]). */
27426jQuery(function($){
27427	$.datepicker.regional['pt-BR'] = {
27428		closeText: 'Fechar',
27429		prevText: '&#x3c;Anterior',
27430		nextText: 'Pr&oacute;ximo&#x3e;',
27431		currentText: 'Hoje',
27432		monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho',
27433		'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
27434		monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
27435		'Jul','Ago','Set','Out','Nov','Dez'],
27436		dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','S&aacute;bado'],
27437		dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
27438		dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
27439		weekHeader: 'Sm',
27440		dateFormat: 'dd/mm/yy',
27441		firstDay: 0,
27442		isRTL: false,
27443		showMonthAfterYear: false,
27444		yearSuffix: ''};
27445	$.datepicker.setDefaults($.datepicker.regional['pt-BR']);
27446});
27447/* Portuguese initialisation for the jQuery UI date picker plugin. */
27448jQuery(function($){
27449	$.datepicker.regional['pt'] = {
27450		closeText: 'Fechar',
27451		prevText: '&#x3c;Anterior',
27452		nextText: 'Seguinte',
27453		currentText: 'Hoje',
27454		monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho',
27455		'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
27456		monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
27457		'Jul','Ago','Set','Out','Nov','Dez'],
27458		dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','S&aacute;bado'],
27459		dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
27460		dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
27461		weekHeader: 'Sem',
27462		dateFormat: 'dd/mm/yy',
27463		firstDay: 0,
27464		isRTL: false,
27465		showMonthAfterYear: false,
27466		yearSuffix: ''};
27467	$.datepicker.setDefaults($.datepicker.regional['pt']);
27468});
27469/* Romansh initialisation for the jQuery UI date picker plugin. */
27470/* Written by Yvonne Gienal ([email protected]). */
27471jQuery(function($){
27472	$.datepicker.regional['rm'] = {
27473		closeText: 'Serrar',
27474		prevText: '&#x3c;Suandant',
27475		nextText: 'Precedent&#x3e;',
27476		currentText: 'Actual',
27477		monthNames: ['Schaner','Favrer','Mars','Avrigl','Matg','Zercladur', 'Fanadur','Avust','Settember','October','November','December'],
27478		monthNamesShort: ['Scha','Fev','Mar','Avr','Matg','Zer', 'Fan','Avu','Sett','Oct','Nov','Dec'],
27479		dayNames: ['Dumengia','Glindesdi','Mardi','Mesemna','Gievgia','Venderdi','Sonda'],
27480		dayNamesShort: ['Dum','Gli','Mar','Mes','Gie','Ven','Som'],
27481		dayNamesMin: ['Du','Gl','Ma','Me','Gi','Ve','So'],
27482		weekHeader: 'emna',
27483		dateFormat: 'dd/mm/yy',
27484		firstDay: 1,
27485		isRTL: false,
27486		showMonthAfterYear: false,
27487		yearSuffix: ''};
27488	$.datepicker.setDefaults($.datepicker.regional['rm']);
27489});
27490
27491/* Romanian initialisation for the jQuery UI date picker plugin.
27492 *
27493 * Written by Edmond L. ([email protected])
27494 * and Ionut G. Stan ([email protected])
27495 */
27496jQuery(function($){
27497	$.datepicker.regional['ro'] = {
27498		closeText: 'Închide',
27499		prevText: '&laquo; Luna precedentă',
27500		nextText: 'Luna următoare &raquo;',
27501		currentText: 'Azi',
27502		monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Iunie',
27503		'Iulie','August','Septembrie','Octombrie','Noiembrie','Decembrie'],
27504		monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun',
27505		'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
27506		dayNames: ['Duminică', 'Luni', 'Marţi', 'Miercuri', 'Joi', 'Vineri', 'Sâmbătă'],
27507		dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'],
27508		dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sâ'],
27509		weekHeader: 'Săpt',
27510		dateFormat: 'dd.mm.yy',
27511		firstDay: 1,
27512		isRTL: false,
27513		showMonthAfterYear: false,
27514		yearSuffix: ''};
27515	$.datepicker.setDefaults($.datepicker.regional['ro']);
27516});
27517
27518/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
27519/* Written by Andrew Stromnov ([email protected]). */
27520jQuery(function($){
27521	$.datepicker.regional['ru'] = {
27522		closeText: 'Закрыть',
27523		prevText: '&#x3c;Пред',
27524		nextText: 'След&#x3e;',
27525		currentText: 'Сегодня',
27526		monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
27527		'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
27528		monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
27529		'Июл','Авг','Сен','Окт','Ноя','Дек'],
27530		dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
27531		dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
27532		dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
27533		weekHeader: 'Нед',
27534		dateFormat: 'dd.mm.yy',
27535		firstDay: 1,
27536		isRTL: false,
27537		showMonthAfterYear: false,
27538		yearSuffix: ''};
27539	$.datepicker.setDefaults($.datepicker.regional['ru']);
27540});
27541/* Slovak initialisation for the jQuery UI date picker plugin. */
27542/* Written by Vojtech Rinik ([email protected]). */
27543jQuery(function($){
27544	$.datepicker.regional['sk'] = {
27545		closeText: 'Zavrieť',
27546		prevText: '&#x3c;Predchádzajúci',
27547		nextText: 'Nasledujúci&#x3e;',
27548		currentText: 'Dnes',
27549		monthNames: ['Január','Február','Marec','Apríl','Máj','Jún',
27550		'Júl','August','September','Október','November','December'],
27551		monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún',
27552		'Júl','Aug','Sep','Okt','Nov','Dec'],
27553		dayNames: ['Nedeľa','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'],
27554		dayNamesShort: ['Ned','Pon','Uto','Str','Å tv','Pia','Sob'],
27555		dayNamesMin: ['Ne','Po','Ut','St','Å t','Pia','So'],
27556		weekHeader: 'Ty',
27557		dateFormat: 'dd.mm.yy',
27558		firstDay: 1,
27559		isRTL: false,
27560		showMonthAfterYear: false,
27561		yearSuffix: ''};
27562	$.datepicker.setDefaults($.datepicker.regional['sk']);
27563});
27564
27565/* Slovenian initialisation for the jQuery UI date picker plugin. */
27566/* Written by Jaka Jancar ([email protected]). */
27567/* c = &#x10D;, s = &#x161; z = &#x17E; C = &#x10C; S = &#x160; Z = &#x17D; */
27568jQuery(function($){
27569	$.datepicker.regional['sl'] = {
27570		closeText: 'Zapri',
27571		prevText: '&lt;Prej&#x161;nji',
27572		nextText: 'Naslednji&gt;',
27573		currentText: 'Trenutni',
27574		monthNames: ['Januar','Februar','Marec','April','Maj','Junij',
27575		'Julij','Avgust','September','Oktober','November','December'],
27576		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
27577		'Jul','Avg','Sep','Okt','Nov','Dec'],
27578		dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','&#x10C;etrtek','Petek','Sobota'],
27579		dayNamesShort: ['Ned','Pon','Tor','Sre','&#x10C;et','Pet','Sob'],
27580		dayNamesMin: ['Ne','Po','To','Sr','&#x10C;e','Pe','So'],
27581		weekHeader: 'Teden',
27582		dateFormat: 'dd.mm.yy',
27583		firstDay: 1,
27584		isRTL: false,
27585		showMonthAfterYear: false,
27586		yearSuffix: ''};
27587	$.datepicker.setDefaults($.datepicker.regional['sl']);
27588});
27589
27590/* Albanian initialisation for the jQuery UI date picker plugin. */
27591/* Written by Flakron Bytyqi ([email protected]). */
27592jQuery(function($){
27593	$.datepicker.regional['sq'] = {
27594		closeText: 'mbylle',
27595		prevText: '&#x3c;mbrapa',
27596		nextText: 'Përpara&#x3e;',
27597		currentText: 'sot',
27598		monthNames: ['Janar','Shkurt','Mars','Prill','Maj','Qershor',
27599		'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'],
27600		monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer',
27601		'Kor','Gus','Sht','Tet','Nën','Dhj'],
27602		dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'],
27603		dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'],
27604		dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'],
27605		weekHeader: 'Ja',
27606		dateFormat: 'dd.mm.yy',
27607		firstDay: 1,
27608		isRTL: false,
27609		showMonthAfterYear: false,
27610		yearSuffix: ''};
27611	$.datepicker.setDefaults($.datepicker.regional['sq']);
27612});
27613
27614/* Serbian i18n for the jQuery UI date picker plugin. */
27615/* Written by Dejan Dimić. */
27616jQuery(function($){
27617	$.datepicker.regional['sr-SR'] = {
27618		closeText: 'Zatvori',
27619		prevText: '&#x3c;',
27620		nextText: '&#x3e;',
27621		currentText: 'Danas',
27622		monthNames: ['Januar','Februar','Mart','April','Maj','Jun',
27623		'Jul','Avgust','Septembar','Oktobar','Novembar','Decembar'],
27624		monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
27625		'Jul','Avg','Sep','Okt','Nov','Dec'],
27626		dayNames: ['Nedelja','Ponedeljak','Utorak','Sreda','Četvrtak','Petak','Subota'],
27627		dayNamesShort: ['Ned','Pon','Uto','Sre','Čet','Pet','Sub'],
27628		dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
27629		weekHeader: 'Sed',
27630		dateFormat: 'dd/mm/yy',
27631		firstDay: 1,
27632		isRTL: false,
27633		showMonthAfterYear: false,
27634		yearSuffix: ''};
27635	$.datepicker.setDefaults($.datepicker.regional['sr-SR']);
27636});
27637
27638/* Serbian i18n for the jQuery UI date picker plugin. */
27639/* Written by Dejan Dimić. */
27640jQuery(function($){
27641	$.datepicker.regional['sr'] = {
27642		closeText: 'Затвори',
27643		prevText: '&#x3c;',
27644		nextText: '&#x3e;',
27645		currentText: 'Данас',
27646		monthNames: ['Јануар','Фебруар','Март','Април','Мај','Јун',
27647		'Јул','Август','Септембар','Октобар','Новембар','Децембар'],
27648		monthNamesShort: ['Јан','Феб','Мар','Апр','Мај','Јун',
27649		'Јул','Авг','Сеп','Окт','Нов','Дец'],
27650		dayNames: ['Недеља','Понедељак','Уторак','Среда','Четвртак','Петак','Субота'],
27651		dayNamesShort: ['Нед','Пон','Уто','Сре','Чет','Пет','Суб'],
27652		dayNamesMin: ['Не','По','Ут','Ср','Че','Пе','Су'],
27653		weekHeader: 'Сед',
27654		dateFormat: 'dd/mm/yy',
27655		firstDay: 1,
27656		isRTL: false,
27657		showMonthAfterYear: false,
27658		yearSuffix: ''};
27659	$.datepicker.setDefaults($.datepicker.regional['sr']);
27660});
27661
27662/* Swedish initialisation for the jQuery UI date picker plugin. */
27663/* Written by Anders Ekdahl ( [email protected]). */
27664jQuery(function($){
27665    $.datepicker.regional['sv'] = {
27666		closeText: 'Stäng',
27667        prevText: '&laquo;Förra',
27668		nextText: 'Nästa&raquo;',
27669		currentText: 'Idag',
27670        monthNames: ['Januari','Februari','Mars','April','Maj','Juni',
27671        'Juli','Augusti','September','Oktober','November','December'],
27672        monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
27673        'Jul','Aug','Sep','Okt','Nov','Dec'],
27674		dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'],
27675		dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'],
27676		dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'],
27677		weekHeader: 'Ve',
27678        dateFormat: 'yy-mm-dd',
27679		firstDay: 1,
27680		isRTL: false,
27681		showMonthAfterYear: false,
27682		yearSuffix: ''};
27683    $.datepicker.setDefaults($.datepicker.regional['sv']);
27684});
27685
27686/* Tamil (UTF-8) initialisation for the jQuery UI date picker plugin. */
27687/* Written by S A Sureshkumar ([email protected]). */
27688jQuery(function($){
27689	$.datepicker.regional['ta'] = {
27690		closeText: 'மூடு',
27691		prevText: 'முன்னையது',
27692		nextText: 'அடுத்தது',
27693		currentText: 'இன்று',
27694		monthNames: ['தை','மாசி','பங்குனி','சித்திரை','வைகாசி','ஆனி',
27695		'ஆடி','ஆவணி','புரட்டாசி','ஐப்ப
27695சி','கார்த்திகை','மார்கழி'],
27696		monthNamesShort: ['தை','மாசி','பங்','சித்','வைகா','ஆனி',
27697		'ஆடி','ஆவ','புர','ஐப்','கார்','மார்'],
27698		dayNames: ['ஞாயிற்றுக்கிழமை','திங்கட்கிழமை','செவ்வாய்க்கிழமை','புதன்கிழமை','வியாழக்கிழமை','வெள்ளிக்கிழமை','சனிக்கிழமை'],
27699		dayNamesShort: ['ஞாயிறு','திங்கள்','செவ்வாய்','புதன்','வியாழன்','வெள்ளி','சனி'],
27700		dayNamesMin: ['ஞா','தி','செ','பு','வி','வெ','ச'],
27701		weekHeader: 'Не',
27702		dateFormat: 'dd/mm/yy',
27703		firstDay: 1,
27704		isRTL: false,
27705		showMonthAfterYear: false,
27706		yearSuffix: ''};
27707	$.datepicker.setDefaults($.datepicker.regional['ta']);
27708});
27709
27710/* Thai initialisation for the jQuery UI date picker plugin. */
27711/* Written by pipo ([email protected]). */
27712jQuery(function($){
27713	$.datepicker.regional['th'] = {
27714		closeText: 'ปิด',
27715		prevText: '&laquo;&nbsp;ย้อน',
27716		nextText: 'ถัดไป&nbsp;&raquo;',
27717		currentText: 'วันนี้',
27718		monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน',
27719		'กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],
27720		monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.',
27721		'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'],
27722		dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'],
27723		dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
27724		dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'],
27725		weekHeader: 'Wk',
27726		dateFormat: 'dd/mm/yy',
27727		firstDay: 0,
27728		isRTL: false,
27729		showMonthAfterYear: false,
27730		yearSuffix: ''};
27731	$.datepicker.setDefaults($.datepicker.regional['th']);
27732});
27733/* Tajiki (UTF-8) initialisation for the jQuery UI date picker plugin. */
27734/* Written by Abdurahmon Saidov ([email protected]). */
27735jQuery(function($){
27736	$.datepicker.regional['tj'] = {
27737		closeText: 'Идома',
27738		prevText: '&#x3c;Қафо',
27739		nextText: 'Пеш&#x3e;',
27740		currentText: 'Имрӯз',
27741		monthNames: ['Январ','Феврал','Март','Апрел','Май','Июн',
27742		'Июл','Август','Сентябр','Октябр','Ноябр','Декабр'],
27743		monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
27744		'Июл','Авг','Сен','Окт','Ноя','Дек'],
27745		dayNames: ['якшанбе','душанбе','сешанбе','чоршанбе','панҷшанбе','ҷумъа','шанбе'],
27746		dayNamesShort: ['якш','душ','сеш','чор','пан','ҷум','шан'],
27747		dayNamesMin: ['Як','Дш','Сш','Чш','Пш','Ҷм','Шн'],
27748		weekHeader: 'Хф',
27749		dateFormat: 'dd.mm.yy',
27750		firstDay: 1,
27751		isRTL: false,
27752		showMonthAfterYear: false,
27753		yearSuffix: ''};
27754	$.datepicker.setDefaults($.datepicker.regional['tj']);
27755});
27756/* Turkish initialisation for the jQuery UI date picker plugin. */
27757/* Written by Izzet Emre Erkan ([email protected]). */
27758jQuery(function($){
27759	$.datepicker.regional['tr'] = {
27760		closeText: 'kapat',
27761		prevText: '&#x3c;geri',
27762		nextText: 'ileri&#x3e',
27763		currentText: 'bugün',
27764		monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran',
27765		'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'],
27766		monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz',
27767		'Tem','Ağu','Eyl','Eki','Kas','Ara'],
27768		dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'],
27769		dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
27770		dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
27771		weekHeader: 'Hf',
27772		dateFormat: 'dd.mm.yy',
27773		firstDay: 1,
27774		isRTL: false,
27775		showMonthAfterYear: false,
27776		yearSuffix: ''};
27777	$.datepicker.setDefaults($.datepicker.regional['tr']);
27778});
27779/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */
27780/* Written by Maxim Drogobitskiy ([email protected]). */
27781/* Corrected by Igor Milla ([email protected]). */
27782jQuery(function($){
27783	$.datepicker.regional['uk'] = {
27784		closeText: 'Закрити',
27785		prevText: '&#x3c;',
27786		nextText: '&#x3e;',
27787		currentText: 'Сьогодні',
27788		monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень',
27789		'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'],
27790		monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер',
27791		'Лип','Сер','Вер','Жов','Лис','Гру'],
27792		dayNames: ['неділя','понеділок','вівторок','середа','четвер','п’ятниця','субота'],
27793		dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'],
27794		dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'],
27795		weekHeader: 'Тиж',
27796		dateFormat: 'dd/mm/yy',
27797		firstDay: 1,
27798		isRTL: false,
27799		showMonthAfterYear: false,
27800		yearSuffix: ''};
27801	$.datepicker.setDefaults($.datepicker.regional['uk']);
27802});
27803/* Vietnamese initialisation for the jQuery UI date picker plugin. */
27804/* Translated by Le Thanh Huy ([email protected]). */
27805jQuery(function($){
27806	$.datepicker.regional['vi'] = {
27807		closeText: 'Đóng',
27808		prevText: '&#x3c;Trước',
27809		nextText: 'Tiếp&#x3e;',
27810		currentText: 'Hôm nay',
27811		monthNames: ['Tháng Một', 'Tháng Hai', 'Tháng Ba', 'Tháng Tư', 'Tháng Năm', 'Tháng Sáu',
27812		'Tháng Bảy', 'Tháng Tám', 'Tháng Chín', 'Tháng Mười', 'Tháng Mười Một', 'Tháng Mười Hai'],
27813		monthNamesShort: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6',
27814		'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'],
27815		dayNames: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],
27816		dayNamesShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
27817		dayNamesMin: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
27818		weekHeader: 'Tu',
27819		dateFormat: 'dd/mm/yy',
27820		firstDay: 0,
27821		isRTL: false,
27822		showMonthAfterYear: false,
27823		yearSuffix: ''};
27824	$.datepicker.setDefaults($.datepicker.regional['vi']);
27825});
27826
27827/* Chinese initialisation for the jQuery UI date picker plugin. */
27828/* Written by Cloudream ([email protected]). */
27829jQuery(function($){
27830	$.datepicker.regional['zh-CN'] = {
27831		closeText: '关闭',
27832		prevText: '&#x3c;上月',
27833		nextText: '下月&#x3e;',
27834		currentText: '今天',
27835		monthNames: ['一月','二月','三月','四月','五月','六月',
27836		'七月','八月','九月','十月','十一月','十二月'],
27837		monthNamesShort: ['一月','二月','三月','四月','五月','六月',
27838		'七月','八月','九月','十月','十一月','十二月'],
27839		dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
27840		dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
27841		dayNamesMin: ['日','一','二','三','四','五','六'],
27842		weekHeader: '周',
27843		dateFormat: 'yy-mm-dd',
27844		firstDay: 1,
27845		isRTL: false,
27846		showMonthAfterYear: true,
27847		yearSuffix: 'å¹´'};
27848	$.datepicker.setDefaults($.datepicker.regional['zh-CN']);
27849});
27850
27851/* Chinese initialisation for the jQuery UI date picker plugin. */
27852/* Written by SCCY ([email protected]). */
27853jQuery(function($){
27854	$.datepicker.regional['zh-HK'] = {
27855		closeText: '關閉',
27856		prevText: '&#x3c;上月',
27857		nextText: '下月&#x3e;',
27858		currentText: '今天',
27859		monthNames: ['一月','二月','三月','四月','五月','六月',
27860		'七月','八月','九月','十月','十一月','十二月'],
27861		monthNamesShort: ['一月','二月','三月','四月','五月','六月',
27862		'七月','八月','九月','十月','十一月','十二月'],
27863		dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
27864		dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
27865		dayNamesMin: ['日','一','二','三','四','五','六'],
27866		weekHeader: '周',
27867		dateFormat: 'dd-mm-yy',
27868		firstDay: 0,
27869		isRTL: false,
27870		showMonthAfterYear: true,
27871		yearSuffix: 'å¹´'};
27872	$.datepicker.setDefaults($.datepicker.regional['zh-HK']);
27873});
27874
27875/* Chinese initialisation for the jQuery UI date picker plugin. */
27876/* Written by Ressol ([email protected]). */
27877jQuery(function($){
27878	$.datepicker.regional['zh-TW'] = {
27879		closeText: '關閉',
27880		prevText: '&#x3c;上月',
27881		nextText: '下月&#x3e;',
27882		currentText: '今天',
27883		monthNames: ['一月','二月','三月','四月','五月','六月',
27884		'七月','八月','九月','十月','十一月','十二月'],
27885		monthNamesShort: ['一月','二月','三月','四月','五月','六月',
27886		'七月','八月','九月','十月','十一月','十二月'],
27887		dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
27888		dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
27889		dayNamesMin: ['日','一','二','三','四','五','六'],
27890		weekHeader: '周',
27891		dateFormat: 'yy/mm/dd',
27892		firstDay: 1,
27893		isRTL: false,
27894		showMonthAfterYear: true,
27895		yearSuffix: 'å¹´'};
27896	$.datepicker.setDefaults($.datepicker.regional['zh-TW']);
27897});
27898
27899
27900/* ========================================
27901 FILE: /includes/js/jquery/cs-autocomplete.js
27902 ==================== */
27903
27904/**
27905 * Upraveny uiautocomplete pre shopy s JS optimalizaciami (pouzity napr. v mod_shop_search, checkoute. atd.
27906 */
27907
27908jQuery.widget('custom.csautocomplete', jQuery.ui.autocomplete, {
27909	_create    : function () {
27910		this._super();
27911		this.widget().menu("option", "items", "> :not(.ac_results_counter)");
27912		//if ( is_cs_user('separate_js') ) {
27913			var classes = this.options && this.options.classes && this.options.classes["ui-autocomplete"];
27914			if (typeof classes === 'string') {
27915				this.menu.element.wrap('<div class="ac_results ui-autocomplete ' + classes + '"></div>');
27916			} else {
27917				this.menu.element.wrap('<div class="ac_results ui-autocomplete"></div>');
27918			}
27919		//} else {
27920		//	this.menu.element.wrap('<div class="ac_results ui-autocomplete"></div>' );
27921		//}
27922	},
27923	_renderMenu: function (ul, items) {
27924		var self = this;
27925		var resultCounter;
27926		if (items.length === script_manage_params_aacwpi.uacl) {
27927			resultCounter = '&ge; ' + items.length + ' ' + js_lang_sphf_result_3;
27928		} else if (items.length >= 5) {
27929			resultCounter = items.length + ' ' + js_lang_sphf_result_3;
27930		} else if (items.length > 1 && items.length < 5) {
27931			resultCounter = items.length + ' ' + js_lang_sphf_result_2;
27932		} else if (items.length === 1) {
27933			resultCounter = items.length + ' ' + js_lang_sphf_result_1;
27934		}
27935
27936		if (items[0].value !== cms_js_iterate_notfound) {
27937			ul.before('<div class="ac_results_counter">' + resultCounter + '</div>');
27938		}
27939
27940		ul.parent().show();
27941
27942		jQuery.each(items, function (index, item) {
27943			if (item !== null && item !== []) {
27944				self._renderItemData(ul, item);
27945			}
27946		});
27947	},
27948	_renderItem: function( ul, item ) {
27949		if (item.value === cms_js_iterate_notfound) {
27950			return jQuery('<li>').text(item.value).appendTo( ul );
27951		}
27952		var linkElement = jQuery('<a>').attr('href', item.value).append(item.label);
27953		return jQuery('<li>').append(linkElement).appendTo(ul);
27954	},
27955	_suggest   : function (items) {
27956		var $menu = this.menu.element;
27957		$menu.prev( '.ac_results_counter' ).remove();
27958		this._super( items );
27959		var inputBottom = this.element.offset().top + this.element.height();
27960		var inputLeft = this.element.offset().left;
vendor: 5,743 bytes, lines 27961-28195
27961		//var inputWidth = $menu.css('width');
27962		var inputWidth = this.element.css('width');
27963		$menu.closest('.ac_results').css('top', inputBottom).css('left', inputLeft).css('width', inputWidth).css('position', 'absolute');
27964		$menu.css('top', '').css('left', '');
27965		$menu.removeClass('ui-autocomplete');
27966	},
27967	_close: function( e ) {
27968		this._super( e );
27969
27970		this.menu.element
27971			.parent()
27972			.hide();
27973
27974		this.menu.element
27975			.prev( '.ac_results_counter' )
27976			.remove();
27977	}
27978});
27979
27980
27981
27982/* ========================================
27983 FILE: /includes/js/jquery/cs-jquery-ui-custom-settings.js
27984 ==================== */
27985
27986jQuery(function() {
27987	if (typeof js_get_lang !== 'undefined') {
27988		var lang = js_get_lang === 'cz' ? 'cs' : js_get_lang;
27989		jQuery.datepicker.setDefaults(jQuery.datepicker.regional[lang]);
27990	} else {
27991		jQuery.datepicker.setDefaults(jQuery.datepicker.regional['']);
27992	}
27993});
27994
27995
27996
27997/* ========================================
27998 FILE: /includes/js/jquery.lazy.js
27999 ==================== */
28000
28001/*! lazysizes - v5.1.0 - pozor zmenene CS srcAttr hodnota bola nahradene, NUTNE loadHidden nastavit na FALSE !  */
28002(function(window, factory) {
28003	var lazySizes = factory(window, window.document);
28004	window.lazySizes = lazySizes;
28005	if(typeof module == 'object' && module.exports){
28006		module.exports = lazySizes;
28007	}
28008}(typeof window != 'undefined' ?
28009	window : {}, function l(window, document) {
28010		'use strict';
28011		/*jshint eqnull:true */
28012
28013		var lazysizes, lazySizesCfg;
28014
28015		(function(){
28016			var prop;
28017
28018			var lazySizesDefaults = {
28019				lazyClass: 'lazyload',
28020				loadedClass: 'lazyloaded',
28021				loadingClass: 'lazyloading',
28022				preloadClass: 'lazypreload',
28023				errorClass: 'lazyerror',
28024				//strictClass: 'lazystrict',
28025				autosizesClass: 'lazyautosizes',
28026				srcAttr: 'longdesc',
28027				srcsetAttr: 'data-srcset',
28028				sizesAttr: 'data-sizes',
28029				//preloadAfterLoad: false,
28030				minSize: 40,
28031				customMedia: {},
28032				init: true,
28033				expFactor: 1.5,
28034				hFac: 0.8,
28035				loadMode: 2,
28036				loadHidden: false,
28037				ricTimeout: 0,
28038				throttleDelay: 125,
28039			};
28040
28041			lazySizesCfg = window.lazySizesConfig || window.lazysizesConfig || {};
28042
28043			for(prop in lazySizesDefaults){
28044				if(!(prop in lazySizesCfg)){
28045					lazySizesCfg[prop] = lazySizesDefaults[prop];
28046				}
28047			}
28048		})();
28049
28050		if (!document || !document.getElementsByClassName) {
28051			return {
28052				init: function () {},
28053				cfg: lazySizesCfg,
28054				noSupport: true,
28055			};
28056		}
28057
28058		var docElem = document.documentElement;
28059
28060		var Date = window.Date;
28061
28062		var supportPicture = window.HTMLPictureElement;
28063
28064		var _addEventListener = 'addEventListener';
28065
28066		var _getAttribute = 'getAttribute';
28067
28068		var addEventListener = window[_addEventListener];
28069
28070		var setTimeout = window.setTimeout;
28071
28072		var requestAnimationFrame = window.requestAnimationFrame || setTimeout;
28073
28074		var requestIdleCallback = window.requestIdleCallback;
28075
28076		var regPicture = /^picture$/i;
28077
28078		var loadEvents = ['load', 'error', 'lazyincluded', '_lazyloaded'];
28079
28080		var regClassCache = {};
28081
28082		var forEach = Array.prototype.forEach;
28083
28084		var hasClass = function(ele, cls) {
28085			if(!regClassCache[cls]){
28086				regClassCache[cls] = new RegExp('(\\s|^)'+cls+'(\\s|$)');
28087			}
28088			return regClassCache[cls].test(ele[_getAttribute]('class') || '') && regClassCache[cls];
28089		};
28090
28091		var addClass = function(ele, cls) {
28092			if (!hasClass(ele, cls)){
28093				ele.setAttribute('class', (ele[_getAttribute]('class') || '').trim() + ' ' + cls);
28094			}
28095		};
28096
28097		var removeClass = function(ele, cls) {
28098			var reg;
28099			if ((reg = hasClass(ele,cls))) {
28100				ele.setAttribute('class', (ele[_getAttribute]('class') || '').replace(reg, ' '));
28101			}
28102		};
28103
28104		var addRemoveLoadEvents = function(dom, fn, add){
28105			var action = add ? _addEventListener : 'removeEventListener';
28106			if(add){
28107				addRemoveLoadEvents(dom, fn);
28108			}
28109			loadEvents.forEach(function(evt){
28110				dom[action](evt, fn);
28111			});
28112		};
28113
28114		var triggerEvent = function(elem, name, detail, noBubbles, noCancelable){
28115			var event = document.createEvent('Event');
28116
28117			if(!detail){
28118				detail = {};
28119			}
28120
28121			detail.instance = lazysizes;
28122
28123			event.initEvent(name, !noBubbles, !noCancelable);
28124
28125			event.detail = detail;
28126
28127			elem.dispatchEvent(event);
28128			return event;
28129		};
28130
28131		var updatePolyfill = function (el, full){
28132			var polyfill;
28133			if( !supportPicture && ( polyfill = (window.picturefill || lazySizesCfg.pf) ) ){
28134				if(full && full.src && !el[_getAttribute]('srcset')){
28135					el.setAttribute('srcset', full.src);
28136				}
28137				polyfill({reevaluate: true, elements: [el]});
28138			} else if(full && full.src){
28139				el.src = full.src;
28140			}
28141		};
28142
28143		var getCSS = function (elem, style){
28144			return (getComputedStyle(elem, null) || {})[style];
28145		};
28146
28147		var getWidth = function(elem, parent, width){
28148			width = width || elem.offsetWidth;
28149
28150			while(width < lazySizesCfg.minSize && parent && !elem._lazysizesWidth){
28151				width =  parent.offsetWidth;
28152				parent = parent.parentNode;
28153			}
28154
28155			return width;
28156		};
28157
28158		var rAF = (function(){
28159			var running, waiting;
28160			var firstFns = [];
28161			var secondFns = [];
28162			var fns = firstFns;
28163
28164			var run = function(){
28165				var runFns = fns;
28166
28167				fns = firstFns.length ? secondFns : firstFns;
28168
28169				running = true;
28170				waiting = false;
28171
28172				while(runFns.length){
28173					runFns.shift()();
28174				}
28175
28176				running = false;
28177			};
28178
28179			var rafBatch = function(fn, queue){
28180				if(running && !queue){
28181					fn.apply(this, arguments);
28182				} else {
28183					fns.push(fn);
28184
28185					if(!waiting){
28186						waiting = true;
28187						(document.hidden ? setTimeout : requestAnimationFrame)(run);
28188					}
28189				}
28190			};
28191
28192			rafBatch._lsFlush = run;
28193
28194			return rafBatch;
28195		})();
vendor: 15,006 bytes, lines 28196-28742
28196
28197		var rAFIt = function(fn, simple){
28198			return simple ?
28199				function() {
28200					rAF(fn);
28201				} :
28202				function(){
28203					var that = this;
28204					var args = arguments;
28205					rAF(function(){
28206						fn.apply(that, args);
28207					});
28208				}
28209				;
28210		};
28211
28212		var throttle = function(fn){
28213			var running;
28214			var lastTime = 0;
28215			var gDelay = lazySizesCfg.throttleDelay;
28216			var rICTimeout = lazySizesCfg.ricTimeout;
28217			var run = function(){
28218				running = false;
28219				lastTime = Date.now();
28220				fn();
28221			};
28222			var idleCallback = requestIdleCallback && rICTimeout > 49 ?
28223				function(){
28224					requestIdleCallback(run, {timeout: rICTimeout});
28225
28226					if(rICTimeout !== lazySizesCfg.ricTimeout){
28227						rICTimeout = lazySizesCfg.ricTimeout;
28228					}
28229				} :
28230				rAFIt(function(){
28231					setTimeout(run);
28232				}, true)
28233			;
28234
28235			return function(isPriority){
28236				var delay;
28237
28238				if((isPriority = isPriority === true)){
28239					rICTimeout = 33;
28240				}
28241
28242				if(running){
28243					return;
28244				}
28245
28246				running =  true;
28247
28248				delay = gDelay - (Date.now() - lastTime);
28249
28250				if(delay < 0){
28251					delay = 0;
28252				}
28253
28254				if(isPriority || delay < 9){
28255					idleCallback();
28256				} else {
28257					setTimeout(idleCallback, delay);
28258				}
28259			};
28260		};
28261
28262		//based on http://modernjavascript.blogspot.de/2013/08/building-better-debounce.html
28263		var debounce = function(func) {
28264			var timeout, timestamp;
28265			var wait = 99;
28266			var run = function(){
28267				timeout = null;
28268				func();
28269			};
28270			var later = function() {
28271				var last = Date.now() - timestamp;
28272
28273				if (last < wait) {
28274					setTimeout(later, wait - last);
28275				} else {
28276					(requestIdleCallback || run)(run);
28277				}
28278			};
28279
28280			return function() {
28281				timestamp = Date.now();
28282
28283				if (!timeout) {
28284					timeout = setTimeout(later, wait);
28285				}
28286			};
28287		};
28288
28289		var loader = (function(){
28290			var preloadElems, isCompleted, resetPreloadingTimer, loadMode, started;
28291
28292			var eLvW, elvH, eLtop, eLleft, eLright, eLbottom, isBodyHidden;
28293
28294			var regImg = /^img$/i;
28295			var regIframe = /^iframe$/i;
28296
28297			var supportScroll = ('onscroll' in window) && !(/(gle|ing)bot/.test(navigator.userAgent));
28298
28299			var shrinkExpand = 0;
28300			var currentExpand = 0;
28301
28302			var isLoading = 0;
28303			var lowRuns = -1;
28304
28305			var resetPreloading = function(e){
28306				isLoading--;
28307				if(!e || isLoading < 0 || !e.target){
28308					isLoading = 0;
28309				}
28310			};
28311
28312			var isVisible = function (elem) {
28313				if (isBodyHidden == null) {
28314					isBodyHidden = getCSS(document.body, 'visibility') == 'hidden';
28315				}
28316
28317				return isBodyHidden || (getCSS(elem.parentNode, 'visibility') != 'hidden' && getCSS(elem, 'visibility') != 'hidden');
28318			};
28319
28320			var isNestedVisible = function(elem, elemExpand){
28321				var outerRect;
28322				var parent = elem;
28323				var visible = isVisible(elem);
28324
28325				eLtop -= elemExpand;
28326				eLbottom += elemExpand;
28327				eLleft -= elemExpand;
28328				eLright += elemExpand;
28329
28330				while(visible && (parent = parent.offsetParent) && parent != document.body && parent != docElem){
28331					visible = ((getCSS(parent, 'opacity') || 1) > 0);
28332
28333					if(visible && getCSS(parent, 'overflow') != 'visible'){
28334						outerRect = parent.getBoundingClientRect();
28335						visible = eLright > outerRect.left &&
28336							eLleft < outerRect.right &&
28337							eLbottom > outerRect.top - 1 &&
28338							eLtop < outerRect.bottom + 1
28339						;
28340					}
28341				}
28342
28343				return visible;
28344			};
28345
28346			var checkElements = function() {
28347				var eLlen, i, rect, autoLoadElem, loadedSomething, elemExpand, elemNegativeExpand, elemExpandVal,
28348				    beforeExpandVal, defaultExpand, preloadExpand, hFac;
28349				var lazyloadElems = lazysizes.elements;
28350
28351				if((loadMode = lazySizesCfg.loadMode) && isLoading < 8 && (eLlen = lazyloadElems.length)){
28352
28353					i = 0;
28354
28355					lowRuns++;
28356
28357					for(; i < eLlen; i++){
28358
28359						if(!lazyloadElems[i] || lazyloadElems[i]._lazyRace){continue;}
28360
28361						if(!supportScroll || (lazysizes.prematureUnveil && lazysizes.prematureUnveil(lazyloadElems[i]))){unveilElement(lazyloadElems[i]);continue;}
28362
28363						if(!(elemExpandVal = lazyloadElems[i][_getAttribute]('data-expand')) || !(elemExpand = elemExpandVal * 1)){
28364							elemExpand = currentExpand;
28365						}
28366
28367						if (!defaultExpand) {
28368							defaultExpand = (!lazySizesCfg.expand || lazySizesCfg.expand < 1) ?
28369								docElem.clientHeight > 500 && docElem.clientWidth > 500 ? 500 : 370 :
28370								lazySizesCfg.expand;
28371
28372							lazysizes._defEx = defaultExpand;
28373
28374							preloadExpand = defaultExpand * lazySizesCfg.expFactor;
28375							hFac = lazySizesCfg.hFac;
28376							isBodyHidden = null;
28377
28378							if(currentExpand < preloadExpand && isLoading < 1 && lowRuns > 2 && loadMode > 2 && !document.hidden){
28379								currentExpand = preloadExpand;
28380								lowRuns = 0;
28381							} else if(loadMode > 1 && lowRuns > 1 && isLoading < 6){
28382								currentExpand = defaultExpand;
28383							} else {
28384								currentExpand = shrinkExpand;
28385							}
28386						}
28387
28388						if(beforeExpandVal !== elemExpand){
28389							eLvW = innerWidth + (elemExpand * hFac);
28390							elvH = innerHeight + elemExpand;
28391							elemNegativeExpand = elemExpand * -1;
28392							beforeExpandVal = elemExpand;
28393						}
28394
28395						rect = lazyloadElems[i].getBoundingClientRect();
28396
28397						if ((eLbottom = rect.bottom) >= elemNegativeExpand &&
28398							(eLtop = rect.top) <= elvH &&
28399							(eLright = rect.right) >= elemNegativeExpand * hFac &&
28400							(eLleft = rect.left) <= eLvW &&
28401							(eLbottom || eLright || eLleft || eLtop) &&
28402							(lazySizesCfg.loadHidden || isVisible(lazyloadElems[i])) &&
28403							((isCompleted && isLoading < 3 && !elemExpandVal && (loadMode < 3 || lowRuns < 4)) || isNestedVisible(lazyloadElems[i], elemExpand))){
28404							unveilElement(lazyloadElems[i]);
28405							loadedSomething = true;
28406							if(isLoading > 9){break;}
28407						} else if(!loadedSomething && isCompleted && !autoLoadElem &&
28408							isLoading < 4 && lowRuns < 4 && loadMode > 2 &&
28409							(preloadElems[0] || lazySizesCfg.preloadAfterLoad) &&
28410							(preloadElems[0] || (!elemExpandVal && ((eLbottom || eLright || eLleft || eLtop) || lazyloadElems[i][_getAttribute](lazySizesCfg.sizesAttr) != 'auto')))){
28411							autoLoadElem = preloadElems[0] || lazyloadElems[i];
28412						}
28413					}
28414
28415					if(autoLoadElem && !loadedSomething){
28416						unveilElement(autoLoadElem);
28417					}
28418				}
28419			};
28420
28421			var throttledCheckElements = throttle(checkElements);
28422
28423			var switchLoadingClass = function(e){
28424				var elem = e.target;
28425
28426				if (elem._lazyCache) {
28427					delete elem._lazyCache;
28428					return;
28429				}
28430
28431				resetPreloading(e);
28432				addClass(elem, lazySizesCfg.loadedClass);
28433				removeClass(elem, lazySizesCfg.loadingClass);
28434				addRemoveLoadEvents(elem, rafSwitchLoadingClass);
28435				triggerEvent(elem, 'lazyloaded');
28436			};
28437			var rafedSwitchLoadingClass = rAFIt(switchLoadingClass);
28438			var rafSwitchLoadingClass = function(e){
28439				rafedSwitchLoadingClass({target: e.target});
28440			};
28441
28442			var changeIframeSrc = function(elem, src){
28443				try {
28444					elem.contentWindow.location.replace(src);
28445				} catch(e){
28446					elem.src = src;
28447				}
28448			};
28449
28450			var handleSources = function(source){
28451				var customMedia;
28452
28453				var sourceSrcset = source[_getAttribute](lazySizesCfg.srcsetAttr);
28454
28455				if( (customMedia = lazySizesCfg.customMedia[source[_getAttribute]('data-media') || source[_getAttribute]('media')]) ){
28456					source.setAttribute('media', customMedia);
28457				}
28458
28459				if(sourceSrcset){
28460					source.setAttribute('srcset', sourceSrcset);
28461				}
28462			};
28463
28464			var lazyUnveil = rAFIt(function (elem, detail, isAuto, sizes, isImg){
28465				var src, srcset, parent, isPicture, event, firesLoad;
28466
28467				if(!(event = triggerEvent(elem, 'lazybeforeunveil', detail)).defaultPrevented){
28468
28469					if(sizes){
28470						if(isAuto){
28471							addClass(elem, lazySizesCfg.autosizesClass);
28472						} else {
28473							elem.setAttribute('sizes', sizes);
28474						}
28475					}
28476
28477					srcset = elem[_getAttribute](lazySizesCfg.srcsetAttr);
28478					src = elem[_getAttribute](lazySizesCfg.srcAttr);
28479
28480					if(isImg) {
28481						parent = elem.parentNode;
28482						isPicture = parent && regPicture.test(parent.nodeName || '');
28483					}
28484
28485					firesLoad = detail.firesLoad || (('src' in elem) && (srcset || src || isPicture));
28486
28487					event = {target: elem};
28488
28489					addClass(elem, lazySizesCfg.loadingClass);
28490
28491					if(firesLoad){
28492						clearTimeout(resetPreloadingTimer);
28493						resetPreloadingTimer = setTimeout(resetPreloading, 2500);
28494						addRemoveLoadEvents(elem, rafSwitchLoadingClass, true);
28495					}
28496
28497					if(isPicture){
28498						forEach.call(parent.getElementsByTagName('source'), handleSources);
28499					}
28500
28501					if(srcset){
28502						elem.setAttribute('srcset', srcset);
28503					} else if(src && !isPicture){
28504						if(regIframe.test(elem.nodeName)){
28505							changeIframeSrc(elem, src);
28506						} else {
28507							elem.src = src;
28508						}
28509					}
28510
28511					if(isImg && (srcset || isPicture)){
28512						updatePolyfill(elem, {src: src});
28513					}
28514				}
28515
28516				if(elem._lazyRace){
28517					delete elem._lazyRace;
28518				}
28519				removeClass(elem, lazySizesCfg.lazyClass);
28520
28521				rAF(function(){
28522					// Part of this can be removed as soon as this fix is older: https://bugs.chromium.org/p/chromium/issues/detail?id=7731 (2015)
28523					var isLoaded = elem.complete && elem.naturalWidth > 1;
28524
28525					if( !firesLoad || isLoaded){
28526						if (isLoaded) {
28527							addClass(elem, 'ls-is-cached');
28528						}
28529						switchLoadingClass(event);
28530						elem._lazyCache = true;
28531						setTimeout(function(){
28532							if ('_lazyCache' in elem) {
28533								delete elem._lazyCache;
28534							}
28535						}, 9);
28536					}
28537					if (elem.loading == 'lazy') {
28538						isLoading--;
28539					}
28540				}, true);
28541			});
28542
28543			var unveilElement = function (elem){
28544				if (elem._lazyRace) {return;}
28545				var detail;
28546
28547				var isImg = regImg.test(elem.nodeName);
28548
28549				//allow using sizes="auto", but don't use. it's invalid. Use data-sizes="auto" or a valid value for sizes instead (i.e.: sizes="80vw")
28550				var sizes = isImg && (elem[_getAttribute](lazySizesCfg.sizesAttr) || elem[_getAttribute]('sizes'));
28551				var isAuto = sizes == 'auto';
28552
28553				if( (isAuto || !isCompleted) && isImg && (elem[_getAttribute]('src') || elem.srcset) && !elem.complete && !hasClass(elem, lazySizesCfg.errorClass) && hasClass(elem, lazySizesCfg.lazyClass)){return;}
28554
28555				detail = triggerEvent(elem, 'lazyunveilread').detail;
28556
28557				if(isAuto){
28558					autoSizer.updateElem(elem, true, elem.offsetWidth);
28559				}
28560
28561				elem._lazyRace = true;
28562				isLoading++;
28563
28564				lazyUnveil(elem, detail, isAuto, sizes, isImg);
28565			};
28566
28567			var afterScroll = debounce(function(){
28568				lazySizesCfg.loadMode = 3;
28569				throttledCheckElements();
28570			});
28571
28572			var altLoadmodeScrollListner = function(){
28573				if(lazySizesCfg.loadMode == 3){
28574					lazySizesCfg.loadMode = 2;
28575				}
28576				afterScroll();
28577			};
28578
28579			var onload = function(){
28580				if(isCompleted){return;}
28581				if(Date.now() - started < 999){
28582					setTimeout(onload, 999);
28583					return;
28584				}
28585
28586
28587				isCompleted = true;
28588
28589				lazySizesCfg.loadMode = 3;
28590
28591				throttledCheckElements();
28592
28593				addEventListener('scroll', altLoadmodeScrollListner, true);
28594			};
28595
28596			return {
28597				_: function(){
28598					started = Date.now();
28599
28600					lazysizes.elements = document.getElementsByClassName(lazySizesCfg.lazyClass);
28601					preloadElems = document.getElementsByClassName(lazySizesCfg.lazyClass + ' ' + lazySizesCfg.preloadClass);
28602
28603					addEventListener('scroll', throttledCheckElements, true);
28604
28605					addEventListener('resize', throttledCheckElements, true);
28606
28607					if(window.MutationObserver){
28608						new MutationObserver( throttledCheckElements ).observe( docElem, {childList: true, subtree: true, attributes: true} );
28609					} else {
28610						docElem[_addEventListener]('DOMNodeInserted', throttledCheckElements, true);
28611						docElem[_addEventListener]('DOMAttrModified', throttledCheckElements, true);
28612						setInterval(throttledCheckElements, 999);
28613					}
28614
28615					addEventListener('hashchange', throttledCheckElements, true);
28616
28617					//, 'fullscreenchange'
28618					['focus', 'mouseover', 'click', 'load', 'transitionend', 'animationend'].forEach(function(name){
28619						document[_addEventListener](name, throttledCheckElements, true);
28620					});
28621
28622					if((/d$|^c/.test(document.readyState))){
28623						onload();
28624					} else {
28625						addEventListener('load', onload);
28626						document[_addEventListener]('DOMContentLoaded', throttledCheckElements);
28627						setTimeout(onload, 20000);
28628					}
28629
28630					if(lazysizes.elements.length){
28631						checkElements();
28632						rAF._lsFlush();
28633					} else {
28634						throttledCheckElements();
28635					}
28636				},
28637				checkElems: throttledCheckElements,
28638				unveil: unveilElement,
28639				_aLSL: altLoadmodeScrollListner,
28640			};
28641		})();
28642
28643
28644		var autoSizer = (function(){
28645			var autosizesElems;
28646
28647			var sizeElement = rAFIt(function(elem, parent, event, width){
28648				var sources, i, len;
28649				elem._lazysizesWidth = width;
28650				width += 'px';
28651
28652				elem.setAttribute('sizes', width);
28653
28654				if(regPicture.test(parent.nodeName || '')){
28655					sources = parent.getElementsByTagName('source');
28656					for(i = 0, len = sources.length; i < len; i++){
28657						sources[i].setAttribute('sizes', width);
28658					}
28659				}
28660
28661				if(!event.detail.dataAttr){
28662					updatePolyfill(elem, event.detail);
28663				}
28664			});
28665			var getSizeElement = function (elem, dataAttr, width){
28666				var event;
28667				var parent = elem.parentNode;
28668
28669				if(parent){
28670					width = getWidth(elem, parent, width);
28671					event = triggerEvent(elem, 'lazybeforesizes', {width: width, dataAttr: !!dataAttr});
28672
28673					if(!event.defaultPrevented){
28674						width = event.detail.width;
28675
28676						if(width && width !== elem._lazysizesWidth){
28677							sizeElement(elem, parent, event, width);
28678						}
28679					}
28680				}
28681			};
28682
28683			var updateElementsSizes = function(){
28684				var i;
28685				var len = autosizesElems.length;
28686				if(len){
28687					i = 0;
28688
28689					for(; i < len; i++){
28690						getSizeElement(autosizesElems[i]);
28691					}
28692				}
28693			};
28694
28695			var debouncedUpdateElementsSizes = debounce(updateElementsSizes);
28696
28697			return {
28698				_: function(){
28699					autosizesElems = document.getElementsByClassName(lazySizesCfg.autosizesClass);
28700					addEventListener('resize', debouncedUpdateElementsSizes);
28701				},
28702				checkElems: debouncedUpdateElementsSizes,
28703				updateElem: getSizeElement
28704			};
28705		})();
28706
28707		var init = function(){
28708			if(!init.i && document.getElementsByClassName){
28709				init.i = true;
28710				autoSizer._();
28711				loader._();
28712			}
28713		};
28714
28715		setTimeout(function(){
28716			if(lazySizesCfg.init){
28717				init();
28718			}
28719		});
28720
28721		lazysizes = {
28722			cfg: lazySizesCfg,
28723			autoSizer: autoSizer,
28724			loader: loader,
28725			init: init,
28726			uP: updatePolyfill,
28727			aC: addClass,
28728			rC: removeClass,
28729			hC: hasClass,
28730			fire: triggerEvent,
28731			gW: getWidth,
28732			rAF: rAF,
28733		};
28734
28735		return lazysizes;
28736	}
28737));
28738
28739/* ========================================
28740 FILE: /includes/js/tooltipster/tooltipster.min.js
28741 ==================== */
28742
vendor: 1,666 bytes, line 28743
28743/*! tooltipster v4.2.6 */!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){function b(a){this.$container,this.constraints=null,this.__$tooltip,this.__init(a)}function c(b,c){var d=!0;return a.each(b,function(a,e){return void 0===c[a]||b[a]!==c[a]?(d=!1,!1):void 0}),d}function d(b){var c=b.attr("id"),d=c?h.window.document.getElementById(c):null;return d?d===b[0]:a.contains(h.window.document.body,b[0])}function e(){if(!g)return!1;var a=g.document.body||g.document.documentElement,b=a.style,c="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[c])return!0;c=c.charAt(0).toUpperCase()+c.substr(1);for(var e=0;e<d.length;e++)if("string"==typeof b[d[e]+c])return!0;return!1}var f={animation:"fade",animationDuration:350,content:null,contentAsHTML:!1,contentCloning:!1,debug:!0,delay:300,delayTouch:[300,500],functionInit:null,functionBefore:null,functionReady:null,functionAfter:null,functionFormat:null,IEmin:6,interactive:!1,multiple:!1,parent:null,plugins:["sideTip"],repositionOnScroll:!1,restoration:"none",selfDestruction:!0,theme:[],timer:0,trackerInterval:500,trackOrigin:!1,trackTooltip:!1,trigger:"hover",triggerClose:{click:!1,mouseleave:!1,originClick:!1,scroll:!1,tap:!1,touchleave:!1},triggerOpen:{click:!1,mouseenter:!1,tap:!1,touchstart:!1},updateAnimation:"rotate",zIndex:9999999},g="undefined"!=typeof window?window:null,h={hasTouchCapability:!(!g||!("ontouchstart"in g||g.DocumentTouch&&g.document instanceof g.DocumentTouch||g.navigator.maxTouchPoints)),hasTransitions:e(),IE:!1,semVer:"4.2.6
vendor: 28,893 bytes, line 28743
28743",window:g},i=function(){this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__instancesLatestArr=[],this.__plugins={},this._env=h};i.prototype={__bridge:function(b,c,d){if(!c[d]){var e=function(){};e.prototype=b;var g=new e;g.__init&&g.__init(c),a.each(b,function(a,b){0!=a.indexOf("__")&&(c[a]?f.debug&&console.log("The "+a+" method of the "+d+" plugin conflicts with another plugin or native methods"):(c[a]=function(){return g[a].apply(g,Array.prototype.slice.apply(arguments))},c[a].bridged=g))}),c[d]=g}return this},__setWindow:function(a){return h.window=a,this},_getRuler:function(a){return new b(a)},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_plugin:function(b){var c=this;if("string"==typeof b){var d=b,e=null;return d.indexOf(".")>0?e=c.__plugins[d]:a.each(c.__plugins,function(a,b){return b.name.substring(b.name.length-d.length-1)=="."+d?(e=b,!1):void 0}),e}if(b.name.indexOf(".")<0)throw new Error("Plugins must be namespaced");return c.__plugins[b.name]=b,b.core&&c.__bridge(b.core,c,b.name),this},_trigger:function(){var a=Array.prototype.slice.apply(arguments);return"string"==typeof a[0]&&(a[0]={type:a[0]}),this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,a),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,a),this},instances:function(b){var c=[],d=b||".tooltipstered";return a(d).each(function(){var b=a(this),d=b.data("tooltipster-ns");d&&a.each(d,function(a,d){c.push(b.data(d))})}),c},instancesLatest:function(){return this.__instancesLatestArr},off:function(){return this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},origins:function(b){var c=b?b+" ":"";return a(c+".tooltipstered").toArray()},setDefaults:function(b){return a.extend(f,b),this},triggerHandler:function(){return this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.tooltipster=new i,a.Tooltipster=function(b,c){this.__callbacks={close:[],open:[]},this.__closingTime,this.__Content,this.__contentBcr,this.__destroyed=!1,this.__$emitterPrivate=a({}),this.__$emitterPublic=a({}),this.__enabled=!0,this.__garbageCollector,this.__Geometry,this.__lastPosition,this.__namespace="tooltipster-"+Math.round(1e6*Math.random()),this.__options,this.__$originParents,this.__pointerIsOverOrigin=!1,this.__previousThemes=[],this.__state="closed",this.__timeouts={close:[],open:null},this.__touchEvents=[],this.__tracker=null,this._$origin,this._$tooltip,this.__init(b,c)},a.Tooltipster.prototype={__init:function(b,c){var d=this;if(d._$origin=a(b),d.__options=a.extend(!0,{},f,c),d.__optionsFormat(),!h.IE||h.IE>=d.__options.IEmin){var e=null;if(void 0===d._$origin.data("tooltipster-initialTitle")&&(e=d._$origin.attr("title"),void 0===e&&(e=null),d._$origin.data("tooltipster-initialTitle",e)),null!==d.__options.content)d.__contentSet(d.__options.content);else{var g,i=d._$origin.attr("data-tooltip-content");i&&(g=a(i)),g&&g[0]?d.__contentSet(g.first()):d.__contentSet(e)}d._$origin.removeAttr("title").addClass("tooltipstered"),d.__prepareOrigin(),d.__prepareGC(),a.each(d.__options.plugins,function(a,b){d._plug(b)}),h.hasTouchCapability&&a(h.window.document.body).on("touchmove."+d.__namespace+"-triggerOpen",function(a){d._touchRecordEvent(a)}),d._on("created",function(){d.__prepareTooltip()})._on("repositioned",function(a){d.__lastPosition=a.position})}else d.__options.disabled=!0},__contentInsert:function(){var a=this,b=a._$tooltip.find(".tooltipster-content"),c=a.__Content,d=function(a){c=a};return a._trigger({type:"format",content:a.__Content,format:d}),a.__options.functionFormat&&(c=a.__options.functionFormat.call(a,a,{origin:a._$origin[0]},a.__Content)),"string"!=typeof c||a.__options.contentAsHTML?b.empty().append(c):b.text(c),a},__contentSet:function(b){return b instanceof a&&this.__options.contentCloning&&(b=b.clone(!0)),this.__Content=b,this._trigger({type:"updated",content:b}),this},__destroyError:function(){throw new Error("This tooltip has been destroyed and cannot execute your method call.")},__geometry:function(){var b=this,c=b._$origin,d=b._$origin.is("area");if(d){var e=b._$origin.parent().attr("name");c=a('img[usemap="#'+e+'"]')}var f=c[0].getBoundingClientRect(),g=a(h.window.document),i=a(h.window),j=c,k={available:{document:null,window:null},document:{size:{height:g.height(),width:g.width()}},window:{scroll:{left:h.window.scrollX||h.window.document.documentElement.scrollLeft,top:h.window.scrollY||h.window.document.documentElement.scrollTop},size:{height:i.height(),width:i.width()}},origin:{fixedLineage:!1,offset:{},size:{height:f.bottom-f.top,width:f.right-f.left},usemapImage:d?c[0]:null,windowOffset:{bottom:f.bottom,left:f.left,right:f.right,top:f.top}}};if(d){var l=b._$origin.attr("shape"),m=b._$origin.attr("coords");if(m&&(m=m.split(","),a.map(m,function(a,b){m[b]=parseInt(a)})),"default"!=l)switch(l){case"circle":var n=m[0],o=m[1],p=m[2],q=o-p,r=n-p;k.origin.size.height=2*p,k.origin.size.width=k.origin.size.height,k.origin.windowOffset.left+=r,k.origin.windowOffset.top+=q;break;case"rect":var s=m[0],t=m[1],u=m[2],v=m[3];k.origin.size.height=v-t,k.origin.size.width=u-s,k.origin.windowOffset.left+=s,k.origin.windowOffset.top+=t;break;case"poly":for(var w=0,x=0,y=0,z=0,A="even",B=0;B<m.length;B++){var C=m[B];"even"==A?(C>y&&(y=C,0===B&&(w=y)),w>C&&(w=C),A="odd"):(C>z&&(z=C,1==B&&(x=z)),x>C&&(x=C),A="even")}k.origin.size.height=z-x,k.origin.size.width=y-w,k.origin.windowOffset.left+=w,k.origin.windowOffset.top+=x}}var D=function(a){k.origin.size.height=a.height,k.origin.windowOffset.left=a.left,k.origin.windowOffset.top=a.top,k.origin.size.width=a.width};for(b._trigger({type:"geometry",edit:D,geometry:{height:k.origin.size.height,left:k.origin.windowOffset.left,top:k.origin.windowOffset.top,width:k.origin.size.width}}),k.origin.windowOffset.right=k.origin.windowOffset.left+k.origin.size.width,k.origin.windowOffset.bottom=k.origin.windowOffset.top+k.origin.size.height,k.origin.offset.left=k.origin.windowOffset.left+k.window.scroll.left,k.origin.offset.top=k.origin.windowOffset.top+k.window.scroll.top,k.origin.offset.bottom=k.origin.offset.top+k.origin.size.height,k.origin.offset.right=k.origin.offset.left+k.origin.size.width,k.available.document={bottom:{height:k.document.size.height-k.origin.offset.bottom,width:k.document.size.width},left:{height:k.document.size.height,width:k.origin.offset.left},right:{height:k.document.size.height,width:k.document.size.width-k.origin.offset.right},top:{height:k.origin.offset.top,width:k.document.size.width}},k.available.window={bottom:{height:Math.max(k.window.size.height-Math.max(k.origin.windowOffset.bottom,0),0),width:k.window.size.width},left:{height:k.window.size.height,width:Math.max(k.origin.windowOffset.left,0)},right:{height:k.window.size.height,width:Math.max(k.window.size.width-Math.max(k.origin.windowOffset.right,0),0)},top:{height:Math.max(k.origin.windowOffset.top,0),width:k.window.size.width}};"html"!=j[0].tagName.toLowerCase();){if("fixed"==j.css("position")){k.origin.fixedLineage=!0;break}j=j.parent()}return k},__optionsFormat:function(){return"number"==typeof this.__options.animationDuration&&(this.__options.animationDuration=[this.__options.animationDuration,this.__options.animationDuration]),"number"==typeof this.__options.delay&&(this.__options.delay=[this.__options.delay,this.__options.delay]),"number"==typeof this.__options.delayTouch&&(this.__options.delayTouch=[this.__options.delayTouch,this.__options.delayTouch]),"string"==typeof this.__options.theme&&(this.__options.theme=[this.__options.theme]),null===this.__options.parent?this.__options.parent=a(h.window.document.body):"string"==typeof this.__options.parent&&(this.__options.parent=a(this.__options.parent)),"hover"==this.__options.trigger?(this.__options.triggerOpen={mouseenter:!0,touchstart:!0},this.__options.triggerClose={mouseleave:!0,originClick:!0,touchleave:!0}):"click"==this.__options.trigger&&(this.__options.triggerOpen={click:!0,tap:!0},this.__options.triggerClose={click:!0,tap:!0}),this._trigger("options"),this},__prepareGC:function(){var b=this;return b.__options.selfDestruction?b.__garbageCollector=setInterval(function(){var c=(new Date).getTime();b.__touchEvents=a.grep(b.__touchEvents,function(a,b){return c-a.time>6e4}),d(b._$origin)||b.close(function(){b.destroy()})},2e4):clearInterval(b.__garbageCollector),b},__prepareOrigin:function(){var a=this;if(a._$origin.off("."+a.__namespace+"-triggerOpen"),h.hasTouchCapability&&a._$origin.on("touchstart."+a.__namespace+"-triggerOpen touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen",function(b){a._touchRecordEvent(b)}),a.__options.triggerOpen.click||a.__options.triggerOpen.tap&&h.hasTouchCapability){var b="";a.__options.triggerOpen.click&&(b+="click."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.tap&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&a._open(b)})}if(a.__options.triggerOpen.mouseenter||a.__options.triggerOpen.touchstart&&h.hasTouchCapability){var b="";a.__options.triggerOpen.mouseenter&&(b+="mouseenter."+a.__namespace+"-triggerOpen "),a.__options.triggerOpen.touchstart&&h.hasTouchCapability&&(b+="touchstart."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){!a._touchIsTouchEvent(b)&&a._touchIsEmulatedEvent(b)||(a.__pointerIsOverOrigin=!0,a._openShortly(b))})}if(a.__options.triggerClose.mouseleave||a.__options.triggerClose.touchleave&&h.hasTouchCapability){var b="";a.__options.triggerClose.mouseleave&&(b+="mouseleave."+a.__namespace+"-triggerOpen "),a.__options.triggerClose.touchleave&&h.hasTouchCapability&&(b+="touchend."+a.__namespace+"-triggerOpen touchcancel."+a.__namespace+"-triggerOpen"),a._$origin.on(b,function(b){a._touchIsMeaningfulEvent(b)&&(a.__pointerIsOverOrigin=!1)})}return a},__prepareTooltip:function(){var b=this,c=b.__options.interactive?"auto":"";return b._$tooltip.attr("id",b.__namespace).css({"pointer-events":c,zIndex:b.__options.zIndex}),a.each(b.__previousThemes,function(a,c){b._$tooltip.removeClass(c)}),a.each(b.__options.theme,function(a,c){b._$tooltip.addClass(c)}),b.__previousThemes=a.merge([],b.__options.theme),b},__scrollHandler:function(b){var c=this;if(c.__options.triggerClose.scroll)c._close(b);else if(d(c._$origin)&&d(c._$tooltip)){var e=null;if(b.target===h.window.document)c.__Geometry.origin.fixedLineage||c.__options.repositionOnScroll&&c.reposition(b);else{e=c.__geometry();var f=!1;if("fixed"!=c._$origin.css("position")&&c.__$originParents.each(function(b,c){var d=a(c),g=d.css("overflow-x"),h=d.css("overflow-y");if("visible"!=g||"visible"!=h){var i=c.getBoundingClientRect();if("visible"!=g&&(e.origin.windowOffset.left<i.left||e.origin.windowOffset.right>i.right))return f=!0,!1;if("visible"!=h&&(e.origin.windowOffset.top<i.top||e.origin.windowOffset.bottom>i.bottom))return f=!0,!1}return"fixed"==d.css("position")?!1:void 0}),f)c._$tooltip.css("visibility","hidden");else if(c._$tooltip.css("visibility","visible"),c.__options.repositionOnScroll)c.reposition(b);else{var g=e.origin.offset.left-c.__Geometry.origin.offset.left,i=e.origin.offset.top-c.__Geometry.origin.offset.top;c._$tooltip.css({left:c.__lastPosition.coord.left+g,top:c.__lastPosition.coord.top+i})}}c._trigger({type:"scroll",event:b,geo:e})}return c},__stateSet:function(a){return this.__state=a,this._trigger({type:"state",state:a}),this},__timeoutsClear:function(){return clearTimeout(this.__timeouts.open),this.__timeouts.open=null,a.each(this.__timeouts.close,function(a,b){clearTimeout(b)}),this.__timeouts.close=[],this},__trackerStart:function(){var a=this,b=a._$tooltip.find(".tooltipster-content");return a.__options.trackTooltip&&(a.__contentBcr=b[0].getBoundingClientRect()),a.__tracker=setInterval(function(){if(d(a._$origin)&&d(a._$tooltip)){if(a.__options.trackOrigin){var e=a.__geometry(),f=!1;c(e.origin.size,a.__Geometry.origin.size)&&(a.__Geometry.origin.fixedLineage?c(e.origin.windowOffset,a.__Geometry.origin.windowOffset)&&(f=!0):c(e.origin.offset,a.__Geometry.origin.offset)&&(f=!0)),f||(a.__options.triggerClose.mouseleave?a._close():a.reposition())}if(a.__options.trackTooltip){var g=b[0].getBoundingClientRect();g.height===a.__contentBcr.height&&g.width===a.__contentBcr.width||(a.reposition(),a.__contentBcr=g)}}else a._close()},a.__options.trackerInterval),a},_close:function(b,c,d){var e=this,f=!0;if(e._trigger({type:"close",event:b,stop:function(){f=!1}}),f||d){c&&e.__callbacks.close.push(c),e.__callbacks.open=[],e.__timeoutsClear();var g=function(){a.each(e.__callbacks.close,function(a,c){c.call(e,e,{event:b,origin:e._$origin[0]})}),e.__callbacks.close=[]};if("closed"!=e.__state){var i=!0,j=new Date,k=j.getTime(),l=k+e.__options.animationDuration[1];if("disappearing"==e.__state&&l>e.__closingTime&&e.__options.animationDuration[1]>0&&(i=!1),i){e.__closingTime=l,"disappearing"!=e.__state&&e.__stateSet("disappearing");var m=function(){clearInterval(e.__tracker),e._trigger({type:"closing",event:b}),e._$tooltip.off("."+e.__namespace+"-triggerClose").removeClass("tooltipster-dying"),a(h.window).off("."+e.__namespace+"-triggerClose"),e.__$originParents.each(function(b,c){a(c).off("scroll."+e.__namespace+"-triggerClose")}),e.__$originParents=null,a(h.window.document.body).off("."+e.__namespace+"-triggerClose"),e._$origin.off("."+e.__namespace+"-triggerClose"),e._off("dismissable"),e.__stateSet("closed"),e._trigger({type:"after",event:b}),e.__options.functionAfter&&e.__options.functionAfter.call(e,e,{event:b,origin:e._$origin[0]}),g()};h.hasTransitions?(e._$tooltip.css({"-moz-animation-duration":e.__options.animationDuration[1]+"ms","-ms-animation-duration":e.__options.animationDuration[1]+"ms","-o-animation-duration":e.__options.animationDuration[1]+"ms","-webkit-animation-duration":e.__options.animationDuration[1]+"ms","animation-duration":e.__options.animationDuration[1]+"ms","transition-duration":e.__options.animationDuration[1]+"ms"}),e._$tooltip.clearQueue().removeClass("tooltipster-show").addClass("tooltipster-dying"),e.__options.animationDuration[1]>0&&e._$tooltip.delay(e.__options.animationDuration[1]),e._$tooltip.queue(m)):e._$tooltip.stop().fadeOut(e.__options.animationDuration[1],m)}}else g()}return e},_off:function(){return this.__$emitterPrivate.off.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_on:function(){return this.__$emitterPrivate.on.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_one:function(){return this.__$emitterPrivate.one.apply(this.__$emitterPrivate,Array.prototype.slice.apply(arguments)),this},_open:function(b,c){var e=this;if(!e.__destroying&&d(e._$origin)&&e.__enabled){var f=!0;if("closed"==e.__state&&(e._trigger({type:"before",event:b,stop:function(){f=!1}}),f&&e.__options.functionBefore&&(f=e.__options.functionBefore.call(e,e,{event:b,origin:e._$origin[0]}))),f!==!1&&null!==e.__Content){c&&e.__callbacks.open.push(c),e.__callbacks.close=[],e.__timeoutsClear();var g,i=function(){"stable"!=e.__state&&e.__stateSet("stable"),a.each(e.__callbacks.open,function(a,b){b.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}),e.__callbacks.open=[]};if("closed"!==e.__state)g=0,"disappearing"===e.__state?(e.__stateSet("appearing"),h.hasTransitions?(e._$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-show"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i)):e._$tooltip.stop().fadeIn(i)):"stable"==e.__state&&i();else{if(e.__stateSet("appearing"),g=e.__options.animationDuration[0],e.__contentInsert(),e.reposition(b,!0),h.hasTransitions?(e._$tooltip.addClass("tooltipster-"+e.__options.animation).addClass("tooltipster-initial").css({"-moz-animation-duration":e.__options.animationDuration[0]+"ms","-ms-animation-duration":e.__options.animationDuration[0]+"ms","-o-animation-duration":e.__options.animationDuration[0]+"ms","-webkit-animation-duration":e.__options.animationDuration[0]+"ms","animation-duration":e.__options.animationDuration[0]+"ms","transition-duration":e.__options.animationDuration[0]+"ms"}),setTimeout(function(){"closed"!=e.__state&&(e._$tooltip.addClass("tooltipster-show").removeClass("tooltipster-initial"),e.__options.animationDuration[0]>0&&e._$tooltip.delay(e.__options.animationDuration[0]),e._$tooltip.queue(i))},0)):e._$tooltip.css("display","none").fadeIn(e.__options.animationDuration[0],i),e.__trackerStart(),a(h.window).on("resize."+e.__namespace+"-triggerClose",function(b){var c=a(document.activeElement);(c.is("input")||c.is("textarea"))&&a.contains(e._$tooltip[0],c[0])||e.reposition(b)}).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)}),e.__$originParents=e._$origin.parents(),e.__$originParents.each(function(b,c){a(c).on("scroll."+e.__namespace+"-triggerClose",function(a){e.__scrollHandler(a)})}),e.__options.triggerClose.mouseleave||e.__options.triggerClose.touchleave&&h.hasTouchCapability){e._on("dismissable",function(a){a.dismissable?a.delay?(m=setTimeout(function(){e._close(a.event)},a.delay),e.__timeouts.close.push(m)):e._close(a):clearTimeout(m)});var j=e._$origin,k="",l="",m=null;e.__options.interactive&&(j=j.add(e._$tooltip)),e.__options.triggerClose.mouseleave&&(k+="mouseenter."+e.__namespace+"-triggerClose ",l+="mouseleave."+e.__namespace+"-triggerClose "),e.__options.triggerClose.touchleave&&h.hasTouchCapability&&(k+="touchstart."+e.__namespace+"-triggerClose",l+="touchend."+e.__namespace+"-triggerClose touchcancel."+e.__namespace+"-triggerClose"),j.on(l,function(a){if(e._touchIsTouchEvent(a)||!e._touchIsEmulatedEvent(a)){var b="mouseleave"==a.type?e.__options.delay:e.__options.delayTouch;e._trigger({delay:b[1],dismissable:!0,event:a,type:"dismissable"})}}).on(k,function(a){!e._touchIsTouchEvent(a)&&e._touchIsEmulatedEvent(a)||e._trigger({dismissable:!1,event:a,type:"dismissable"})})}e.__options.triggerClose.originClick&&e._$origin.on("click."+e.__namespace+"-triggerClose",function(a){e._touchIsTouchEvent(a)||e._touchIsEmulatedEvent(a)||e._close(a)}),(e.__options.triggerClose.click||e.__options.triggerClose.tap&&h.hasTouchCapability)&&setTimeout(function(){if("closed"!=e.__state){var b="",c=a(h.window.document.body);e.__options.triggerClose.click&&(b+="click."+e.__namespace+"-triggerClose "),e.__options.triggerClose.tap&&h.hasTouchCapability&&(b+="touchend."+e.__namespace+"-triggerClose"),c.on(b,function(b){e._touchIsMeaningfulEvent(b)&&(e._touchRecordEvent(b),e.__options.interactive&&a.contains(e._$tooltip[0],b.target)||e._close(b))}),e.__options.triggerClose.tap&&h.hasTouchCapability&&c.on("touchstart."+e.__namespace+"-triggerClose",function(a){e._touchRecordEvent(a)})}},0),e._trigger("ready"),e.__options.functionReady&&e.__options.functionReady.call(e,e,{origin:e._$origin[0],tooltip:e._$tooltip[0]})}if(e.__options.timer>0){var m=setTimeout(function(){e._close()},e.__options.timer+g);e.__timeouts.close.push(m)}}}return e},_openShortly:function(a){var b=this,c=!0;if("stable"!=b.__state&&"appearing"!=b.__state&&!b.__timeouts.open&&(b._trigger({type:"start",event:a,stop:function(){c=!1}}),c)){var d=0==a.type.indexOf("touch")?b.__options.delayTouch:b.__options.delay;d[0]?b.__timeouts.open=setTimeout(function(){b.__timeouts.open=null,b.__pointerIsOverOrigin&&b._touchIsMeaningfulEvent(a)?(b._trigger("startend"),b._open(a)):b._trigger("startcancel")},d[0]):(b._trigger("startend"),b._open(a))}return b},_optionsExtract:function(b,c){var d=this,e=a.extend(!0,{},c),f=d.__options[b];return f||(f={},a.each(c,function(a,b){var c=d.__options[a];void 0!==c&&(f[a]=c)})),a.each(e,function(b,c){void 0!==f[b]&&("object"!=typeof c||c instanceof Array||null==c||"object"!=typeof f[b]||f[b]instanceof Array||null==f[b]?e[b]=f[b]:a.extend(e[b],f[b]))}),e},_plug:function(b){var c=a.tooltipster._plugin(b);if(!c)throw new Error('The "'+b+'" plugin is not defined');return c.instance&&a.tooltipster.__bridge(c.instance,this,c.name),this},_touchIsEmulatedEvent:function(a){for(var b=!1,c=(new Date).getTime(),d=this.__touchEvents.length-1;d>=0;d--){var e=this.__touchEvents[d];if(!(c-e.time<500))break;e.target===a.target&&(b=!0)}return b},_touchIsMeaningfulEvent:function(a){return this._touchIsTouchEvent(a)&&!this._touchSwiped(a.target)||!this._touchIsTouchEvent(a)&&!this._touchIsEmulatedEvent(a)},_touchIsTouchEvent:function(a){return 0==a.type.indexOf("touch")},_touchRecordEvent:function(a){return this._touchIsTouchEvent(a)&&(a.time=(new Date).getTime(),this.__touchEvents.push(a)),this},_touchSwiped:function(a){for(var b=!1,c=this.__touchEvents.length-1;c>=0;c--){var d=this.__touchEvents[c];if("touchmove"==d.type){b=!0;break}if("touchstart"==d.type&&a===d.target)break}return b},_trigger:function(){var b=Array.prototype.slice.apply(arguments);return"string"==typeof b[0]&&(b[0]={type:b[0]}),b[0].instance=this,b[0].origin=this._$origin?this._$origin[0]:null,b[0].tooltip=this._$tooltip?this._$tooltip[0]:null,this.__$emitterPrivate.trigger.apply(this.__$emitterPrivate,b),a.tooltipster._trigger.apply(a.tooltipster,b),this.__$emitterPublic.trigger.apply(this.__$emitterPublic,b),this},_unplug:function(b){var c=this;if(c[b]){var d=a.tooltipster._plugin(b);d.instance&&a.each(d.instance,function(a,d){c[a]&&c[a].bridged===c[b]&&delete c[a]}),c[b].__destroy&&c[b].__destroy(),delete c[b]}return c},close:function(a){return this.__destroyed?this.__destroyError():this._close(null,a),this},content:function(a){var b=this;if(void 0===a)return b.__Content;if(b.__destroyed)b.__destroyError();else if(b.__contentSet(a),null!==b.__Content){if("closed"!==b.__state&&(b.__contentInsert(),b.reposition(),b.__options.updateAnimation))if(h.hasTransitions){var c=b.__options.updateAnimation;b._$tooltip.addClass("tooltipster-update-"+c),setTimeout(function(){"closed"!=b.__state&&b._$tooltip.removeClass("tooltipster-update-"+c)},1e3)}else b._$tooltip.fadeTo(200,.5,function(){"closed"!=b.__state&&b._$tooltip.fadeTo(200,1)})}else b._close();return b},destroy:function(){var b=this;if(b.__destroyed)b.__destroyError();else{"closed"!=b.__state?b.option("animationDuration",0)._close(null,null,!0):b.__timeoutsClear(),b._trigger("destroy"),b.__destroyed=!0,b._$origin.removeData(b.__namespace).off("."+b.__namespace+"-triggerOpen"),a(h.window.document.body).off("."+b.__namespace+"-triggerOpen");var c=b._$origin.data("tooltipster-ns");if(c)if(1===c.length){var d=null;"previous"==b.__options.restoration?d=b._$origin.data("tooltipster-initialTitle"):"current"==b.__options.restoration&&(d="string"==typeof b.__Content?b.__Content:a("<div></div>").append(b.__Content).html()),d&&b._$origin.attr("title",d),b._$origin.removeClass("tooltipstered"),b._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else c=a.grep(c,function(a,c){return a!==b.__namespace}),b._$origin.data("tooltipster-ns",c);b._trigger("destroyed"),b._off(),b.off(),b.__Content=null,b.__$emitterPrivate=null,b.__$emitterPublic=null,b.__options.parent=null,b._$origin=null,b._$tooltip=null,a.tooltipster.__instancesLatestArr=a.grep(a.tooltipster.__instancesLatestArr,function(a,c){return b!==a}),clearInterval(b.__garbageCollector)}return b},disable:function(){return this.__destroyed?(this.__destroyError(),this):(this._close(),this.__enabled=!1,this)},elementOrigin:function(){return this.__destroyed?void this.__destroyError():this._$origin[0]},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(a){return this.close(a)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(a){return this.__destroyed?this.__destroyError():this._open(null,a),this},option:function(b,c){return void 0===c?this.__options[b]:(this.__destroyed?this.__destroyError():(this.__options[b]=c,this.__optionsFormat(),a.inArray(b,["trigger","triggerClose","triggerOpen"])>=0&&this.__prepareOrigin(),"selfDestruction"===b&&this.__prepareGC()),this)},reposition:function(a,b){var c=this;return c.__destroyed?c.__destroyError():"closed"!=c.__state&&d(c._$origin)&&(b||d(c._$tooltip))&&(b||c._$tooltip.detach(),c.__Geometry=c.__geometry(),c._trigger({type:"reposition",event:a,helper:{geo:c.__Geometry}})),c},show:function(a){return this.open(a)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},a.fn.tooltipster=function(){var b=Array.prototype.slice.apply(arguments),c="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";if(0===this.length)return this;if("string"==typeof b[0]){var d="#*$~&";return this.each(function(){var e=a(this).data("tooltipster-ns"),f=e?a(this).data(e[0]):null;if(!f)throw new Error("You called Tooltipster's \""+b[0]+'" method on an uninitialized element');if("function"!=typeof f[b[0]])throw new Error('Unknown method "'+b[0]+'"');this.length>1&&"content"==b[0]&&(b[1]instanceof a||"object"==typeof b[1]&&null!=b[1]&&b[1].tagName)&&!f.__options.contentCloning&&f.__options.debug&&console.log(c);var g=f[b[0]](b[1],b[2]);return g!==f||"instance"===b[0]?(d=g,!1):void 0}),"#*$~&"!==d?d:this}a.tooltipster.__instancesLatestArr=[];var e=b[0]&&void 0!==b[0].multiple,g=e&&b[0].multiple||!e&&f.multiple,h=b[0]&&void 0!==b[0].content,i=h&&b[0].content||!h&&f.content,j=b[0]&&void 0!==b[0].contentCloning,k=j&&b[0].contentCloning||!j&&f.contentCloning,l=b[0]&&void 0!==b[0].debug,m=l&&b[0].debug||!l&&f.debug;return this.length>1&&(i instanceof a||"object"==typeof i&&null!=i&&i.tagName)&&!k&&m&&console.log(c),this.each(function(){var c=!1,d=a(this),e=d.data("tooltipster-ns"),f=null;e?g?c=!0:m&&(console.log("Tooltipster: one or more tooltips are already attached to the element below. Ignoring."),console.log(this)):c=!0,c&&(f=new a.Tooltipster(this,b[0]),e||(e=[]),e.push(f.__namespace),d.data("tooltipster-ns",e),d.data(f.__namespace,f),f.__options.functionInit&&f.__options.functionInit.call(f,f,{origin:this}),f._trigger("init")),a.tooltipster.__instancesLatestArr.push(f)}),this},b.prototype={__init:function(b){this.__$tooltip=b,this.__$tooltip.css({left:0,overflow:"hidden",position:"absolute",top:0}).find(".tooltipster-content").css("overflow","auto"),this.$container=a('<div class="tooltipster-ruler"></div>').append(this.__$tooltip).appendTo(h.window.document.body)},__forceRedraw:function(){var a=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(a)},constrain:function(a,b){return this.constraints={width:a,height:b},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:a}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var a=this.__$tooltip[0].getBoundingClientRect(),b={size:{height:a.height||a.bottom-a.top,width:a.width||a.right-a.left}};if(this.constraints){var c=this.__$tooltip.find(".tooltipster-content"),d=this.__$tooltip.outerHeight(),e=c[0].getBoundingClientRect(),f={height:d<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=c[0].scrollWidth-1};b.fits=f.height&&f.width}return h.IE&&h.IE<=11&&b.size.width!==h.window.document.documentElement.clientWidth&&(b.size.width=Math.ceil(b.size.width)+1),b}};var j=navigator.userAgent.toLowerCase();-1!=j.indexOf("msie")?h.IE=parseInt(j.split("msie")[1]):-1!==j.toLowerCase().indexOf("trident")&&-1!==j.indexOf(" rv:11")?h.IE=11:-1!=j.toLowerCase().indexOf("edge/")&&(h.IE=parseInt(j.toLowerCase().split("edge/")[1]))
vendor: 3,979 bytes, lines 28743-28744
28743;var k="tooltipster.sideTip";return a.tooltipster._plugin({name:k,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(a){var b=this;b.__instance=a,b.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),b.__previousState="closed",b.__options,b.__optionsFormat(),b.__instance._on("state."+b.__namespace,function(a){"closed"==a.state?b.__close():"appearing"==a.state&&"closed"==b.__previousState&&b.__create(),b.__previousState=a.state}),b.__instance._on("options."+b.__namespace,function(){b.__optionsFormat()}),b.__instance._on("reposition."+b.__namespace,function(a){b.__reposition(a.event,a.helper)})},__close:function(){this.__instance.content()instanceof a&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var b=a('<div class="tooltipster-base tooltipster-sidetip"><div class="tooltipster-box"><div class="tooltipster-content"></div></div><div class="tooltipster-arrow"><div class="tooltipster-arrow-uncropped"><div class="tooltipster-arrow-border"></div><div class="tooltipster-arrow-background"></div></div></div></div>');this.__options.arrow||b.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&b.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&b.css("max-width",this.__options.maxWidth+"px"),
28744this.__instance._$tooltip=b,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var b=this;if(b.__options=b.__instance._optionsExtract(k,b.__defaults()),b.__options.position&&(b.__options.side=b.__options.position),"object"!=typeof b.__options.distance&&(b.__options.distance=[b.__options.distance]),b.__options.distance.length<4&&(void 0===b.__options.distance[1]&&(b.__options.distance[1]=b.__options.distance[0]),void 0===b.__options.distance[2]&&(b.__options.distance[2]=b.__options.distance[0]),void 0===b.__options.distance[3]&&(b.__options.distance[3]=b.__options.distance[1]),b.__options.distance={top:b.__options.distance[0],right:b.__options.distance[1],bottom:b.__options.distance[2],left:b.__options.distance[3]}),"string"==typeof b.__options.side){var c={top:"bottom",right:"left",bottom:"top",left:"right"};b.__options.side=[b.__options.side,c[b.__options.side]],"left"==b.__options.side[0]||"right"==b.__options.side[0]?b.__options.side.push("top","bottom"):b.__options.side.push("right","left")}6===a.tooltipster._env.IE&&b.__options.arrow!==!0&&(b.__options.arrow=!1)},__reposition:function(b,c){var d,e=this,f=e.__targetFind(c),g=[];e.__instance._$tooltip.detach();var h=e.__instance._$tooltip.clone(),i=a.tooltipster._getRuler(h),j=!1,k=e.__instance.option("animation");switch(k&&h.removeClass("tooltipster-"+k),a.each(["window","document"],function(d,k){var l=null;if(e.__instance._trigger({container:k,helper:c,satisfied:j,takeTest:function(a){l=a},results:g,type:"positionTest"}),1==l||0!=l&&0==j&&("window"!=k||e.__options.viewportAware))for(var d=0;d<e.__options.side.length;d++){var m={horizontal:0,vertical:0},n=e.__options.side[d];"top"==n||"bottom"==n?m.vertical=e.__options.distance[n]:m.horizontal=e.__options.distance[n],e.__sideChange(h,n),a.each(["natural","constrained"],function(a,d){if(l=null,e.__instance._trigger({container:k,event:b,helper:c,mode:d,results:g,satisfied:j,side:n,takeTest:function(a){l=a},type:"positionTest"}),1==l||0!=l&&0==j){var h={container:k,distance:m,fits:null,mode:d,outerSize:null,side:n,size:null,target:f[n],whole:null},o="natural"==d?i.free():i.constrain(c.geo.available[k][n].width-m.horizontal,c.geo.available[k][n].height-m.vertical),p=o.measure();if(h.size=p.size,h.outerSize={height:p.size.height+m.vertical,width:p.size.width+m.horizontal},"natural"==d?c.geo.available[k][n].width>=h.outerSize.width&&c.geo.available[k][n].height>
28744=h.outerSize.height?h.fits=!0:h.fits=!1:h.fits=p.fits,"window"==k&&(h.fits?"top"==n||"bottom"==n?h.whole=c.geo.origin.windowOffset.right>=e.__options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=e.__options.minIntersection:h.whole=c.geo.origin.windowOffset.bottom>=e.__options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=e.__options.minIntersection:h.whole=!1),g.push(h),h.whole)j=!0;else if("natural"==h.mode&&(h.fits||h.size.width<=c.geo.available[k][n].width))return!1}})}}),e.__instance._trigger({edit:function(a){g=a},event:b,helper:c,results:g,type:"positionTested"}),g.sort(function(a,b){if(a.whole&&!b.whole)return-1;if(!a.whole&&b.whole)return 1;if(a.whole&&b.whole){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}if(a.fits&&!b.fits)return-1;if(!a.fits&&b.fits)return 1;if(a.fits&&b.fits){var c=e.__options.side.indexOf(a.side),d=e.__options.side.indexOf(b.side);return d>c?-1:c>d?1:"natural"==a.mode?-1:1}return"document"==a.container&&"bottom"==a.side&&"natural"==a.mode?-1:1}),d=g[0],d.coord={},d.side){case"left":case"right":d.coord.top=Math.floor(d.target-d.size.height/2);break;case"bottom":case"top":d.coord.left=Math.floor(d.target-d.size.width/2)}switch(d.side){case"left":d.coord.left=c.geo.origin.windowOffset.left-d.outerSize.width;break;case"right":d.coord.left=c.geo.origin.windowOffset.right+d.distance.horizontal;break;case"top":d.coord.top=c.geo.origin.windowOffset.top-d.outerSize.height;break;case"bottom":d.coord.top=c.geo.origin.windowOffset.bottom+d.distance.vertical}"window"==d.container?"top"==d.side||"bottom"==d.side?d.coord.left<0?c.geo.origin.windowOffset.right-this.__options.minIntersection>=0?d.coord.left=0:d.coord.left=c.geo.origin.windowOffset.right-this.__options.minIntersection-1:d.coord.left>c.geo.window.size.width-d.size.width&&(c.geo.origin.windowOffset.left+this.__options.minIntersection<=c.geo.window.size.width?d.coord.left=c.geo.window.size.width-d.size.width:d.coord.left=c.geo.origin.windowOffset.left+this.__options.minIntersection+1-d.size.width):d.coord.top<0?c.geo.origin.windowOffset.bottom-this.__options.minIntersection>=0?d.coord.top=0:d.coord.top=c.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:d.coord.top>c.geo.window.size.height-d.size.height&&(c.geo.origin.windowOffset.top+this.__options.minIntersection<=c.geo.window.size.height?d.coord.top=c.geo.window.size.height-d.size.height:d.coord.top=c.geo.origin.windowOffset.top+this.__options.minIntersection+1-d.size.height):(d.coord.left>c.geo.window.size.width-d.size.width&&(d.coord.left=c.geo.window.size.width-d.size.width),d.coord.left<0&&(d.coord.left=0)),e.__sideChange(h,d.side),c.tooltipClone=h[0],c.tooltipParent=e.__instance.option("parent").parent[0],c.mode=d.mode,c.whole=d.whole,c.origin=e.__instance._$origin[0],c.tooltip=e.__instance._$tooltip[0],delete d.container,delete d.fits,delete d.mode,delete d.outerSize,delete d.whole,d.distance=d.distance.horizontal||d.distance.vertical;var l=a.extend(!0,{},d);if(e.__instance._trigger({edit:function(a){d=a},event:b,helper:c,position:l,type:"position"}),e.__options.functionPosition){var m=e.__options.functionPosition.call(e,e.__instance,c,l);m&&(d=m)}i.destroy();var n,o;"top"==d.side||"bottom"==d.side?(n={prop:"left",val:d.target-d.coord.left},o=d.size.width-this.__options.minIntersection):(n={prop:"top",val:d.target-d.coord.top},o=d.size.height-this.__options.minIntersection),n.val<this.__options.minIntersection?n.val=this.__options.minIntersection:n.val>o&&(n.val=o);var p;p=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},d.coord={left:p.left+(d.coord.left-c.geo.origin.windowOffset.left),top:p.top+(d.coord.top-c.geo.origin.windowOffset.top)},e.__sideChange(e.__instance._$tooltip,d.side),c.geo.origin.fixedLineage?e.__instance._$tooltip.css("position","fixed"):e.__instance._$tooltip.css("position",""),e.__instance._$tooltip.css({left:d.coord.left,top:d.coord.top,height:d.size.height,width:d.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(n.prop,n.val),e.__instance._$tooltip.appendTo(e.__instance.option("parent")),e.__instance._trigger({type:"repositioned",event:b,position:d})},__sideChange:function(a,b){a.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+b)},__targetFind:function(a){var b={},c=this.__instance._$origin[0].getClientRects();if(c.length>1){var d=this.__instance._$origin.css("opacity");1==d&&(this.__instance._$origin.css("opacity",.99),c=this.__instance._$origin[0].getClientRects(),this.__instance._$origin.css("opacity",1))}if(c.length<2)b.top=Math.floor(a.geo.origin.windowOffset.left+a.geo.origin.size.width/2),b.bottom=b.top,b.left=Math.floor(a.geo.origin.windowOffset.top+a.geo.origin.size.height/2),b.right=b.left;else{var e=c[0];b.top=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil(c.length/2)-1]:c[0],b.right=Math.floor(e.top+(e.bottom-e.top)/2),e=c[c.length-1],b.bottom=Math.floor(e.left+(e.right-e.left)/2),e=c.length>2?c[Math.ceil((c.length+1)/2)-1]:c[c.length-1],b.left=Math.floor(e.top+(e.bottom-e.top)/2)}return b}}}),a});
28745/* tooltipster-follower v0.1.5 */
28746!function(a,b){"function"==typeof define&&define.amd?define(["tooltipster"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("tooltipster")):b(jQuery)}(this,function(a){var b="laa.follower";return a.tooltipster._plugin({name:b,instance:{__defaults:function(){return{anchor:"top-left",maxWidth:null,minWidth:0,offset:[15,-15]}},__init:function(a){var b=this;return b.__displayed,b.__helper,b.__initialROS=a.option("repositionOnScroll"),b.__instance=a,b.__latestMouseEvent,b.__namespace="tooltipster-follower-"+Math.round(1e6*Math.random()),b.__openingTouchEnded,b.__pointerPosition,b.__previousState="closed",b.__size,b.__options,b.__initialROS||b.__instance.option("repositionOnScroll",!0),b.__optionsFormat(),b.__instance._on("destroy."+b.__namespace,function(){b.__destroy()}),b.__instance._on("options."+b.__namespace,function(){b.__optionsFormat()}),b.__instance._on("reposition."+b.__namespace,function(a){b.__reposition(a.event,a.helper)}),b.__instance._on("start."+b.__namespace,function(a){b.__instance._$origin.on("mousemove."+b.__namespace,function(a){b.__latestMouseEvent=a})}),b.__instance._one("startend."+b.__namespace+" startcancel."+b.__namespace,function(a){b.__instance._$origin.off("mousemove."+b.__namespace),"startcancel"==a.type&&(b.__latestMouseEvent=null)}),b.__instance._on("state."+b.__namespace,function(a){"closed"==a.state?b.__close():"appearing"==a.state&&"closed"==b.__previousState&&b.__create(),b.__previousState=a.state}),b},__close:function(){return"object"==typeof this.__instance.content()&&null!==this.__instance.content()&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null,a(a.tooltipster._env.window.document).off("."+this.__namespace),this.__latestMouseEvent=null,this},__create:function(){var b=this,c=a('<div class="tooltipster-base tooltipster-follower"><div class="tooltipster-box"><div class="tooltipster-content"></div></div></div>'),d=a(a.tooltipster._env.window.document);b.__options.minWidth&&c.css("min-width",b.__options.minWidth+"px"),b.__options.maxWidth&&c.css("max-width",b.__options.maxWidth+"px"),b.__instance._$tooltip=c,b.__displayed=!1,b.__openingTouchEnded=!1,d.on("mousemove."+b.__namespace,function(a){b.__openingTouchEnded&&b.__displayed||b.__follow(a)});var e=b.__instance.option("triggerClose");return e.tap&&d.on("touchend."+b.__namespace+" touchcancel."+b.__namespace,function(a){b.__openingTouchEnded=!0}),b.__instance._trigger("created"),b},__destroy:function(){return this.__instance._off("."+this.__namespace),this.__initialROS||this.__instance.option("repositionOnScroll",!1),this},__follow:function(b){if(b?this.__latestMouseEvent=b:this.__latestMouseEvent&&(b=this.__latestMouseEvent),b){this.__displayed=!0;var c={},d=this.__options.anchor,e=a.merge([],this.__options.offset);switch(this.__helper.geo.window.scroll={left:a.tooltipster._env.window.scrollX||a.tooltipster._env.window.document.documentElement.scrollLeft,top:a.tooltipster._env.window.scrollY||a.tooltipster._env.window.document.documentElement.scrollTop},d){case"top-left":case"left-center":case"bottom-left":c.left=b.pageX+e[0];break;case"top-center":case"bottom-center":c.left=b.pageX+e[0]-this.__size.width/2;break;case"top-right":case"right-center":case"bottom-right":c.left=b.pageX+e[0]-this.__size.width;break;default:console.log("Wrong anchor value")}switch(d){case"top-left":case"top-center":case"top-right":c.top=b.pageY-e[1];break;case"left-center":case"right-center":c.top=b.pageY-e[1]-this.__size.height/2;break;case"bottom-left":case"bottom-center":case"bottom-right":c.top=b.pageY-e[1]-this.__size.height}if("left-center"==d||"right-center"==d){if("right-center"==d)c.left<this.__helper.geo.window.scroll.left&&(b.pageX-e[0]+this.__size.width<=this.__helper.geo.window.scroll.left+this.__helper.geo.window.size.width?(d="left-center",e[0]=-e[0],c.left=b.pageX+e[0]):(d="top-right",e[1]=e[0],c={left:0,top:b.pageY-e[1]}));else if(c.left+this.__size.width>this.__helper.geo.window.scroll.left+this.__helper.geo.window.size.width){var f=b.pageX-e[0]-this.__size.width;f>=0?(d="right-center",e[0]=-e[0],c.left=f):(d="top-left",e[1]=-e[0],c={left:b.pageX+e[0],top:b.pageY-e[1]})}c.top+this.__size.height>this.__helper.geo.window.scroll.top+this.__helper.geo.window.size.height&&(c.top=this.__helper.geo.window.scroll.top+this.__helper.geo.window.size.height-this.__size.height),c.top<this.__helper.geo.window.scroll.top&&(c.top=this.__helper.geo.window.scroll.top),c.top+this.__size.height>this.__helper.geo.document.size.height&&(c.top=this.__helper.geo.document.size.height-this.__size.height),c.top<0&&(c.top=0)}if("left-center"!=d&&"right-center"!=d){c.left+this.__size.width>this.__helper.geo.window.scroll.left+this.__helper.geo.window.size.width&&(c.left=this.__helper.geo.window.scroll.left+this.__helper.geo.window.size.width-this.__size.width),c.left<0&&(c.left=0);var g=b.pageY-this.__helper.geo.window.scroll.top;if(0==d.indexOf("bottom"))c.top<this.__helper.geo.window.scroll.top&&(c.top<0||g<this.__helper.geo.window.size.height-g&&b.pageY+e[1]+this.__size.height<=this.__helper.geo.document.size.height)&&(c.top=b.pageY+e[1]);else{var h=c.top+this.__size.height;if(h>this.__helper.geo.window.scroll.top+this.__helper.geo.window.size.height&&(g>this.__helper.geo.window.size.height-g||g-e[1]+this.__size.height<=this.__helper.geo.document.size.height)){var i=b.pageY+e[1]-this.__size.height;i>=0&&(c.top=i)}}}this.__helper.geo.origin.fixedLineage&&(c.left-=this.__helper.geo.window.scroll.left,c.top-=this.__helper.geo.window.scroll.top);
28746var j={coord:c};this.__instance._trigger({edit:function(a){j=a},event:b,helper:this.__helper,position:a.extend(!0,{},j),type:"follow"}),this.__instance._$tooltip.css({left:j.coord.left,top:j.coord.top}).show()}else this.__instance._$tooltip.hide();return this},__optionsFormat:function(){return this.__options=this.__instance._optionsExtract(b,this.__defaults()),this},__reposition:function(b,c){var d=this,e=d.__instance._$tooltip.clone(),f=a.tooltipster._getRuler(e),g=d.__instance.option("animation");g&&e.removeClass("tooltipster-"+g);var h=f.free().measure(),i={size:h.size};c.geo.origin.fixedLineage?d.__instance._$tooltip.css("position","fixed"):d.__instance._$tooltip.css("position",""),d.__instance._trigger({edit:function(a){i=a},event:b,helper:c,position:a.extend(!0,{},i),tooltipClone:e[0],type:"position"}),f.destroy(),d.__helper=c,d.__size=i.size,d.__instance._$tooltip.css({height:i.size.height,width:i.size.width});var j=a.tooltipster._env.IE&&"click"===b.type?b:null;return d.__follow(j),d.__instance._$tooltip.appendTo(d.__instance.option("parent")),d.__instance._trigger({type:"repositioned",event:b,position:{coord:{left:0,top:0},size:i.size}}),this}}}),a}); 
28747
28748/* ========================================
28749 FILE: /modules/mod_wishlist_new/mod_wishlist_new.js
28750 ==================== */
28751
28752// global vars
28753var wishlist_new_count = 0;
28754
28755(function () {
28756	script_manage_params = typeof script_manage_params === 'object' ? script_manage_params : {};
28757
28758	var params = {
28759		'wishlist': typeof script_manage_params.wishlist !== 'undefined' && script_manage_params.wishlist != 0 ? JSON.parse(script_manage_params.wishlist) : {},
28760		'ph_id':    typeof script_manage_params.ph_id !== 'undefined' ? script_manage_params.ph_id : ''
28761	};
28762
28763	window.onload = function () {
28764		js_wishlist_new_check_after_page_load();
28765
28766		jQuery(document).on('addToWishlist removeFromWishlist', function(event, data) {
28767			if (typeof data !== 'undefined' && data.after_js) {
28768				eval(data.after_js);
28769			}
28770		});
28771	};
28772
28773	window.js_wishlist_new_check_after_page_load = function() {
28774		var my_id        = params.ph_id;
28775		var wishlist_new = params.wishlist;
28776
28777		if (my_id == 0) {
28778			wishlist_new = '';
28779			if ( Cookies.get('wishlist') !== undefined ) { wishlist_new = Cookies.get('wishlist'); }
28780			wishlist_new = wishlist_new.split(",");
28781			if (wishlist_new.length == 1 && wishlist_new[0] == '') wishlist_new = [];
28782		}
28783
28784		wishlist_new_count = wishlist_new.length;
28785
28786		for (i in wishlist_new) {
28787			if (wishlist_new.hasOwnProperty(i)) {
28788				var el = jQuery('.flypage_wishlist_'+wishlist_new[i]);
28789				el.find('.flypage_wishlist_add').hide();
28790				el.find('.flypage_wishlist_delete').show();
28791				el.find('.flypage_wishlist_in_wishlist').show();
28792
28793				if (el.length > 0) {
28794					jQuery('body').addClass('in_wishlist');
28795				}
28796
28797				el.parents('.slick-slide').addClass('product_in_wishlist');
28798
28799				var product_list_elem = jQuery('#product_list').find('.product_id_'+wishlist_new[i]);
28800				product_list_elem.addClass('product_in_wishlist');
28801
28802				const pw_el = jQuery('.product_wishlist_' + wishlist_new[i]);
28803				const slickSlide = pw_el.parents('.slick-slide');
28804				const articleProduct = pw_el.parents('.article_product_listing:first');
28805				const csProductItem = pw_el.parents('.cs_product_item:first');
28806
28807				if (slickSlide.length > 0) {
28808					slickSlide.addClass('product_in_wishlist');
28809				} else if (articleProduct.length > 0) {
28810					articleProduct.addClass('product_in_wishlist');
28811					if (csProductItem.length > 0) {
28812						csProductItem.addClass('product_in_wishlist');
28813					}
28814				} else if (csProductItem.length > 0) {
28815					csProductItem.addClass('product_in_wishlist');
28816				}
28817
28818				const wishlistButton = pw_el.find('a');
28819				const productName = wishlistButton.data('product_name');
28820				let ariaLabel = '';
28821				if (productName != null  && productName !== '') {
28822					let labelLang = js_lang_product_add_to_wishlist_aria_label.replace(':product_name', productName);
28823					ariaLabel = ` aria-label="${labelLang.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;')}"`;
28824				}
28825
28826				wishlistButton.remove();
28827				pw_el.prepend(`<a class="wishlist_btn_remove"${ariaLabel} href="javascript:void(0)" onclick="return js_wishlist_b_delete_click(this, ` + my_id + ', ' + wishlist_new[i] + ')" title="' + js_lang_wishlist_item_delete + '">' + js_lang_wishlist_item_delete + '</a>');
28828				//jednotlive moduly
28829				var modul_elems = jQuery(' .featured-prod.product_id_' + wishlist_new[i] + ', .module-latest-viewed-item.product_id_' + wishlist_new[i] + ', .related_product1.product_id_' + wishlist_new[i] + ', .related_product2.product_id_' + wishlist_new[i] + ', .related_product3.product_id_' + wishlist_new[i] + '');
28830				modul_elems.addClass('product_in_wishlist');
28831			}
28832		}
28833
28834		if (typeof(js_wishlist_change_count) != 'undefined') { js_wishlist_change_count(); }
28835	};
28836
28837	window.js_wishlist_change = function(typ) {
28838		if (typ == 'add') wishlist_new_count++;
28839		if (typ == 'remove' && wishlist_new_count > 0) wishlist_new_count--;
28840		if (typeof(js_wishlist_change_count) != 'undefined') { js_wishlist_change_count(typ); }
28841	};
28842
28843// ---------- FUNKCIE VOLANE Z MODULU --------------
28844
28845	window.js_wishlist_item_to_cart_click = function(elem, product_id, category_id) {
28846		document.wlnf_addtocart.quantity.value = "1";
28847		document.wlnf_addtocart.category_id.value = category_id;
28848		document.wlnf_addtocart.product_id.value = product_id;
28849		document.wlnf_addtocart.func.value = "cartadd";
28850		document.wlnf_addtocart.submit();
28851	};
28852
28853
28854	window.js_wishlist_item_delete_click = function(elem, user_id, product_id) {
28855		elem = jQuery(elem);
28856
28857		var cookie_wl = '';
28858		if (user_id == 0) {
28859			cookie_wl = Cookies.get('wishlist') || '';
28860			cookie_wl = cookie_wl.split(",");
28861			for (i=cookie_wl.length-1; i>=0; i--) {
28862				if (cookie_wl[i] == product_id) cookie_wl.splice(i, 1);
28863			}
28864			cookie_wl = cookie_wl.toString();
28865			Cookies.set('wishlist', cookie_wl, { expires: 365, path: '/' });
28866		}
28867		var options = {ajax_func: 'item_delete', user_id: user_id, product_id: product_id};
28868
28869		jQuery.post(js_global_live_site+'/modules/mod_wishlist_new/mod_wishlist_new_ajax.php', options, function(r) {
28870			var rdata = JSON.parse(r);
28871			var wlitems = elem.closest('.wishlist_items').get(0);
28872
28873			if ( typeof wlitems !== 'undefined' ) {
28874				wlitems.innerHTML = rdata.wlhtml;
28875			}
28876
28877			var wlpdclass = '.flypage_wishlist_'+rdata.product_id;
28878			var wlbclass = '.product_wishlist_'+rdata.product_id;
28879			if (jQuery(wlpdclass)[0]) {
28880				jQuery('body').removeClass('in_wishlist');
28881				jQuery(wlpdclass).html(rdata.wl_pd_html);
28882			}
28883			jQuery(wlbclass).html(rdata.wl_b_html);
28884			jQuery('.product_id_'+rdata.product_id).removeClass('product_in_wishlist');
28885			jQuery('.product_wishlist_'+rdata.product_id).parents('.slick-slide').removeClass('product_in_wishlist');
28886
28887			//dynamicke ceny pre tripsy
28888			if (typeof _aws != 'undefined' && jQuery('.user_logged_in').length) {
28889				_aws.init('.module-wishlist');
28890			}
28891
28892			js_add_to_cart_form_ajax_cart_bind();
28893
28894			jQuery(document).trigger('removeFromWishlist', [rdata]);
28895		});
28896		js_wishlist_change('remove');
28897	};
28898
28899// ---------- FUNKCIE VOLANE Z DETAILU PRODUKTU --------------
28900
28901	window.js_wishlist_pd_add_click = function(elem, user_id, product_id) {
28902		var $elem = jQuery(elem);
28903
28904		$elem.css('pointer-events', 'none');
28905
28906		var cookie_wl = '';
28907		if (user_id == 0) {
28908			cookie_wl = Cookies.get('wishlist') || '';
28909			if (cookie_wl == null || cookie_wl == '') {
28910				Cookies.set('wishlist', product_id, { expires: 365, path: '/' });
28911			} else {
28912				Cookies.set('wishlist', cookie_wl + ',' + product_id, { expires: 365, path: '/' });
28913			}
28914			cookie_wl = Cookies.get('wishlist') || '';
28915		}
28916
28917		var options = {ajax_func: 'pd_add', user_id: user_id, product_id: product_id, cookie_wl: cookie_wl};
28918
28919		jQuery.post(js_global_live_site+'/modules/mod_wishlist_new/mod_wishlist_new_ajax.php', options, function(r) {
28920			$elem.css('pointer-events', 'auto');
28921
28922			var rdata = JSON.parse(r);
28923			var wl_pd = $elem.closest('.flypage_wishlist').get(0);
28924
28925			if ( typeof wl_pd !== 'undefined' ) {
28926				wl_pd.innerHTML = rdata.wl_pd_html;
28927			}
28928
28929			jQuery('.wishlist_items').html(rdata.wl_mod_html);
28930			jQuery('body').addClass('in_wishlist');
28931
28932			jQuery(document).trigger('addToWishlist', [rdata]);
28933		});
28934
28935		js_wishlist_change('add');
28936
28937		setTimeout(function(){
28938			jQuery('.flypage_wishlist').find('.flypage_wishlist_added').hide();
28939		}, 4000);
28940	};
28941
28942	window.js_wishlist_pd_delete_click = function(elem, user_id, product_id) {
28943		elem = jQuery(elem);
28944
28945		var cookie_wl = '';
28946		if (user_id == '0') {
28947			cookie_wl = Cookies.get('wishlist') || '';
28948			cookie_wl = cookie_wl.split(",");
28949			for (i=cookie_wl.length-1; i>=0; i--) {
28950				if (cookie_wl[i] == product_id) cookie_wl.splice(i, 1);
28951			}
28952			cookie_wl = cookie_wl.toString();
28953			Cookies.set('wishlist', cookie_wl, { expires: 365, path: '/' });
28954		}
28955		var options = {ajax_func: 'pd_delete', user_id: user_id, product_id: product_id, cookie_wl: cookie_wl};
28956		jQuery.post(js_global_live_site+'/modules/mod_wishlist_new/mod_wishlist_new_ajax.php', options, function(r) {
28957			var rdata = JSON.parse(r);
28958			var wl_pd = elem.closest('.flypage_wishlist').get(0);
28959
28960			if ( typeof wl_pd !== 'undefined' ) {
28961				wl_pd.innerHTML = rdata.wl_pd_html;
28962			}
28963
28964			jQuery('.wishlist_items').html(rdata.wl_mod_html);
28965			jQuery('body').removeClass('in_wishlist');
28966
28967			jQuery(document).trigger('removeFromWishlist', [rdata]);
28968		});
28969
28970		js_wishlist_change('remove');
28971
28972		setTimeout(function(){
28973			jQuery('.flypage_wishlist').find('.flypage_wishlist_added').hide();
28974		}, 4000);
28975	};
28976
28977// ---------- FUNKCIE VOLANE Z BROWSU --------------
28978
28979	window.js_wishlist_b_add_click = function(elem, user_id, product_id) {
28980		var $elem = jQuery(elem);
28981
28982		$elem.css('pointer-events', 'none');
28983
28984		var cookie_wl = '';
28985		if (user_id == 0) {
28986			cookie_wl = Cookies.get('wishlist') || '';
28987			if (cookie_wl == null || cookie_wl == '') {
28988				Cookies.set('wishlist', product_id, { expires: 365, path: '/' });
28989			} else {
28990				Cookies.set('wishlist', cookie_wl + ',' + product_id, { expires: 365, path: '/' });
28991			}
28992			cookie_wl = Cookies.get('wishlist') || '';
28993		}
28994		var options = {ajax_func: 'b_add', user_id: user_id, product_id: product_id, cookie_wl: cookie_wl};
28995		jQuery.post(js_global_live_site+'/modules/mod_wishlist_new/mod_wishlist_new_ajax.php', options, function(r) {
28996			$elem.css('pointer-events', 'auto');
28997
28998			var rdata = JSON.parse(r);
28999			var wl_p = $elem.closest('.product_wishlist_'+product_id).get(0);
29000			$elem.closest('div.browse_listing').addClass('product_in_wishlist');
29001
29002			if ( typeof wl_p !== 'undefined' ) {
29003				wl_p.innerHTML = rdata.wl_b_html;
29004			}
29005
29006			if ( user_id > 0 ) {
29007				params && params.wishlist && params.wishlist.push(product_id.toString());
29008			}
29009
29010			jQuery('.wishlist_items').html(rdata.wl_mod_html);
29011			jQuery('.product_id_'+product_id).addClass('product_in_wishlist');
29012			const pw_el = jQuery('.product_wishlist_' + product_id);
29013			const slickSlide = pw_el.parents('.slick-slide');
29014			const articleProduct = pw_el.parents('.article_product_listing:first');
29015			const csProductItem = pw_el.parents('.cs_product_item:first');
29016
29017			if (slickSlide.length > 0) {
29018				slickSlide.addClass('product_in_wishlist');
29019			} else if (articleProduct.length > 0) {
29020				articleProduct.addClass('product_in_wishlist');
29021				if (csProductItem.length > 0) {
29022					csProductItem.addClass('product_in_wishlist');
29023				}
29024			} else if (csProductItem.length > 0) {
29025				csProductItem.addClass('product_in_wishlist');
29026			}
29027
29028			jQuery(document).trigger('addToWishlist', [rdata]);
29029		});
29030
29031		js_wishlist_change('add');
29032	};
29033
29034	window.js_wishlist_b_delete_click = function(elem, user_id, product_id) {
29035		elem = jQuery(elem);
29036
29037		var cookie_wl = '';
29038		if (user_id == '0') {
29039			cookie_wl = Cookies.get('wishlist') || '';
29040			cookie_wl = cookie_wl.split(",");
29041			for (i=cookie_wl.length-1; i>=0; i--) {
29042				if (cookie_wl[i] == product_id) cookie_wl.splice(i, 1);
29043			}
29044			cookie_wl = cookie_wl.toString();
29045			Cookies.set('wishlist', cookie_wl, { expires: 365, path: '/' });
29046		}
29047		var options = {ajax_func: 'b_delete', user_id: user_id, product_id: product_id, cookie_wl: cookie_wl};
29048		jQuery.post(js_global_live_site+'/modules/mod_wishlist_new/mod_wishlist_new_ajax.php', options, function(r) {
29049			var rdata = JSON.parse(r);
29050			var wl_p = elem.closest('.product_wishlist_'+product_id).get(0);
29051			elem.closest('div.browse_listing').removeClass('product_in_wishlist');
29052
29053			if ( typeof wl_p !== 'undefined' ) {
29054				wl_p.innerHTML = rdata.wl_b_html;
29055			}
29056
29057			if(user_id > 0){
29058				params.wishlist = params.wishlist && jQuery.grep(params.wishlist, function(value) {
29059					return value != product_id.toString();
29060				});
29061			}
29062
29063			jQuery('.wishlist_items').html(rdata.wl_mod_html);
29064			jQuery('.product_id_'+product_id).removeClass('product_in_wishlist');
29065			const pw_el = jQuery('.product_wishlist_' + product_id);
29066			const slickSlide = pw_el.parents('.slick-slide');
29067			const articleProduct = pw_el.parents('.article_product_listing:first');
29068			const csProductItem = pw_el.parents('.cs_product_item:first');
29069
29070			if (slickSlide.length > 0) {
29071				slickSlide.removeClass('product_in_wishlist');
29072			} else if (articleProduct.length > 0) {
29073				articleProduct.removeClass('product_in_wishlist');
29074				if (csProductItem.length > 0) {
29075					csProductItem.removeClass('product_in_wishlist');
29076				}
29077			} else if (csProductItem.length > 0) {
29078				csProductItem.removeClass('product_in_wishlist');
29079			}
29080
29081			jQuery(document).trigger('removeFromWishlist', [rdata]);
29082		});
29083
29084		js_wishlist_change('remove');
29085	};
29086})();
29087
29088
29089/* ========================================
29090 FILE: /includes/js/system/cs_lib.js
29091 ==================== */
29092
29093String.prototype.toJSON = function() {
29094	var text = this;
29095// 	if (typeof(text) != 'string')
29096// 		text = encodeURIComponent(text);
29097	return JSON.parse(decodeURIComponent(text));
29098};
29099
29100//function importJs(name,url) {
29101//	if(jQuery('[data-id="'+name+'"]').length > 0){
29102//		return;
29103//	}
29104//	var scriptTag = document.createElement('script');
29105//
29106//			scriptTag.setAttribute('data-id', name);
29107//			scriptTag.onload = _success;
29108//			scriptTag.onreadystatechange = _success;
29109//			scriptTag.src = url;
29110//			document.head.appendChild(scriptTag);
29111//}
29112
29113function csJsonParse( strJson, errFunc ) {
29114	var jsonRes = null;
29115	if (strJson != null && (typeof(strJson) == 'string' || strJson instanceof String) && strJson.trim() != '') {
29116		try {
29117			jsonRes = JSON.parse(strJson);
29118		} catch( jso_err ) {
29119			jsonRes = null;
29120			if (typeof(errFunc) == 'function') {
29121				//errFunc.call(null, jso_err);
29122				errFunc(jso_err, strJson);
29123			}
29124		}
29125	} else {
29126		jsonRes = null;
29127	}
29128	return jsonRes;
29129};
29130
29131/**
29132 *
29133 * @example csClean(['1', 'lorem', true, 55698], '1', true);
29134 * @example csClean(['1', 'lorem', true, 55698], [true, 'lorem']);
29135 *
29136 * @param {Array} - Array
29137 * @param {String|Array} deleteValue - Value to be deleted from array
29138 * @param {Boolean} strict - Compare data types - Default: false
29139 * @return {Array}
29140 */
29141function csClean(arr, deleteValue, strict)
29142{
29143	strict = typeof strict === 'boolean' ? strict : false;
29144
29145	if (!(deleteValue instanceof Array)) {
29146		deleteValue = [deleteValue];
29147	}
29148
29149	if (deleteValue instanceof Array) {
29150		for (var i = 0; i < arr.length; i++) {
29151			deleteValue.forEach(function(value) {
29152				if (strict) {
29153					if (arr[i] === value) {
29154						arr.splice(i, 1);
29155						i--;
29156					}
29157
29158				} else {
29159					if (arr[i] == value) {
29160						arr.splice(i, 1);
29161						i--;
29162					}
29163				}
29164			});
29165		}
29166	}
29167
29168	return arr;
29169};
29170
29171/**
29172 * Compare 2 or more objects
29173 * @author Hucci
29174 * @example csCompareObjects({a: 1, b: 2}, {b: 2, a: 1}) > true
29175 * @return {Boolean}
29176 */
29177function csCompareObjects()
29178{
29179	var i, l, leftChain, rightChain;
29180
29181	function compare2Objects(x, y)
29182	{
29183		var p;
29184
29185		if ((isNaN(x) && isNaN(y) && typeof x === 'number' && typeof y === 'number') || x === y) {
29186			return true;
29187		}
29188
29189		if ((typeof x === 'function' && typeof y === 'function') ||
29190			(x instanceof Date && y instanceof Date) ||
29191			(x instanceof RegExp && y instanceof RegExp) ||
29192			(x instanceof String && y instanceof String) ||
29193			(x instanceof Number && y instanceof Number)
29194		) {
29195			return x.toString() === y.toString();
29196		}
29197
29198		if (!(x instanceof Object && y instanceof Object) ||
29199			x.isPrototypeOf(y) || y.isPrototypeOf(x) ||
29200			x.constructor !== y.constructor ||
29201			x.prototype !== y.prototype ||
29202			leftChain.indexOf(x) > -1 || rightChain.indexOf(y) > -1
29203		) {
29204			return false;
29205		}
29206
29207		for (p in y) {
29208			if (y.hasOwnProperty(p) !== x.hasOwnProperty(p) || typeof y[p] !== typeof x[p]) {
29209				return false;
29210			}
29211		}
29212
29213		for (p in x) {
29214			if (y.hasOwnProperty(p) !== x.hasOwnProperty(p) || typeof y[p] !== typeof x[p]) {
29215				return false;
29216			}
29217
29218			switch (typeof (x[p])) {
29219				case 'object':
29220				case 'function':
29221					leftChain.push(x);
29222					rightChain.push(y);
29223
29224					if (!compare2Objects (x[p], y[p])) {
29225						return false;
29226					}
29227
29228					leftChain.pop();
29229					rightChain.pop();
29230
29231					break;
29232
29233				default:
29234					if (x[p] !== y[p]) {
29235						return false;
29236					}
29237
29238					break;
29239			}
29240		}
29241
29242		return true;
29243	}
29244
29245	if (arguments.length < 1) {
29246		return true;
29247	}
29248
29249	for (i = 1, l = arguments.length; i < l; i++) {
29250		leftChain = [];
29251		rightChain = [];
29252
29253		if (!compare2Objects(arguments[0], arguments[i])) {
29254			return false;
29255		}
29256	}
29257
29258	return true;
29259}
29260
29261/**
29262 * @author Hucci
29263 * @param {Number} price
29264 * @param {Object} currencySettings
29265 * @return {String}
29266 */
29267function csFormatPrice(price, currencySettings, only_number)
29268{
29269	var price = typeof price === 'number' ? price : (typeof js_parse_float === 'function') ? js_parse_float(price) : 0;
29270	var currencySettings = typeof currencySettings === 'object'
29271		? currencySettings
29272		: ((typeof shop_currency_info === 'object' && typeof shop_vendor_currency_code === 'string' && shop_vendor_currency_code in shop_currency_info)
29273			? shop_currency_info[shop_vendor_currency_code]
29274			: {
29275				'DECIMALS': 2,
29276				'1000_SYMBOL': ' ',
29277				'DEC_SYMBOL': ',',
29278				'POSIT': 1,
29279				'NEGAT': 8,
29280				'SYMBOL': '€'
29281			});
29282	var negative = price < 0 ? '-' : '';
29283	var full = String(parseInt(price = Math.abs(Number(price) || 0).toFixed(currencySettings.DECIMALS)));
29284	var thousands = (thousands = full.length) > 3 ? thousands % 3 : 0;
29285	var formattedPrice = negative + (thousands ? full.substr(0, thousands) + currencySettings['1000_SYMBOL'] : '') + full.substr(thousands).replace(/(\d{3})(?=\d)/g, "$1" + currencySettings['1000_SYMBOL']) + (price && currencySettings.DECIMALS ? currencySettings.DEC_SYMBOL + Math.abs(price - full).toFixed(currencySettings.DECIMALS).slice(2) : '');
29286
29287	if ( only_number === true ) return formattedPrice;
29288
29289	var symbol = currencySettings.SYMBOL;
29290
29291	var elem = document.createElement('textarea');
29292	elem.innerHTML = symbol;
29293	symbol = elem.value;
29294
29295	if (price >= 0) {
29296		switch (currencySettings.POSIT) {
29297			case 0:	formattedPrice = formattedPrice + symbol; break;
29298			case 1:	formattedPrice = formattedPrice +' '+ symbol; break;
29299			case 2:	formattedPrice = symbol + formattedPrice; break;
29300			case 3:	formattedPrice = symbol +' '+ formattedPrice; break;
29301
29302			default: formattedPrice = formattedPrice +' '+ symbol; break;
29303		}
29304
29305	} else {
29306		formattedPrice = (formattedPrice[0] === '-') ? formattedPrice.substr(1) : formattedPrice;
29307
29308		switch (currencySettings.NEGAT) {
29309			case 0: formattedPrice = '('+ symbol + formattedPrice +')'; break;
29310			case 1: formattedPrice = '-'+ symbol + formattedPrice; break;
29311			case 2: formattedPrice = symbol +'-'+ formattedPrice; break;
29312			case 3: formattedPrice = symbol + formattedPrice +'-'; break;
29313			case 4:	formattedPrice = '('+ formattedPrice + symbol +')'; break;
29314			case 5:	formattedPrice = '-'+ formattedPrice + symbol; break;
29315			case 6:	formattedPrice = formattedPrice +'-'+ symbol; break;
29316			case 7:	formattedPrice = formattedPrice + symbol +'-'; break;
29317			case 8:	formattedPrice = '-'+ formattedPrice +' '+ symbol; break;
29318			case 9:	formattedPrice = '-'+ symbol +' '+ formattedPrice; break;
29319			case 10: formattedPrice = formattedPrice +' '+ symbol +'-'; break;
29320			case 11: formattedPrice = symbol +' '+ formattedPrice +'-'; break;
29321			case 12: formattedPrice = symbol +' -'+ formattedPrice; break;
29322			case 13: formattedPrice = formattedPrice +'- '+ symbol; break;
29323			case 14: formattedPrice = '('+ symbol +' '+ formattedPrice +')'; break;
29324			case 15: formattedPrice = '('+ formattedPrice +' '+ symbol +')'; break;
29325
29326			default: formattedPrice = '-'+ formattedPrice +' '+ symbol; break;
29327		}
29328	}
29329
29330	return formattedPrice;
29331}
29332
29333/**
29334 * Create breakpoint when object property has changed
29335 *
29336 * @example csConsoleWatch(jQuery('#cbi_5').get(0), 'checked');
29337 * @example csConsoleWatch(document.getElementById('cbi_5'), 'checked');
29338 *
29339 * @param {Object} obj - Javascript Object
29340 * @param {String}
29340 prop - Object property to watch
29341 */
29342function csConsoleWatch(obj, prop)
29343{
29344	privateProp = "$_"+ prop +"_$";		// to minimize the name clash risk
29345	obj[privateProp] = obj[prop];
29346
29347	// overwrite with accestor
29348	Object.defineProperty(obj, prop, {
29349		get:	function() {
29350			return obj[privateProp];
29351		},
29352		set:	function(value) {
29353			console.log(' # # # csConsoleWatch: # # # ');
29354			console.log('Setting \''+ prop +'\' to \''+ value +'\' on ', obj);
29355			console.trace();
29356			console.log(' # # # # # # # # # # # # # # ');
29357			debugger;					// sets breakpoint
29358			obj[privateProp] = value;
29359		}
29360	});
29361}
29362
29363/**
29364 *
29365 * @param {Object} element - jQuery element
29366 * @param {Boolean} getChilds - If true - get also events of element childs - Default: true
29367 * @return {Array} - Array of Objects - {object: {Object} - jQuery element, events: {Object}}
29368 */
29369function csGetBindedEvents(element, getChilds)
29370{
29371	getChilds = typeof getChilds === 'boolean' ? getChilds : true;
29372	var selection = getChilds ? element.add(element.find('*')) : element;
29373	var retArr = [];
29374
29375	selection.each(function() {
29376		if (typeof (events = jQuery._data(jQuery(this).get(0), 'events')) === 'object') {
29377			retArr.push({
29378				object:	jQuery(this),
29379				events:	events
29380			});
29381		}
29382	});
29383
29384	return retArr;
29385}
29386
29387
29388/**
29389 *
29390 * @example csGetUrlParamByName('order_id', '...?page=order.invoice_printdetails&order_id=425000087') -> '425000087'
29391 * @example csGetUrlParamByName('type', '...?page=order.invoice_printdetails&order_id=425000087') -> undefined
29392 *
29393 * @param {String} name - Parameter name to get
29394 * @param {String} url
29395 * @return {String|Undefined}
29396 */
29397function csGetUrlParamByName(name, url) {
29398	url = (!url || url === '') ? window.location.href : url;
29399	name = name.replace(/[\[\]]/g, "\\$&");
29400
29401	var regex = new RegExp('[?&]'+ name +'(=([^&#]*)|&|#|$)'),
29402
29403	results = regex.exec(url);
29404
29405	if (!results) {
29406		return;
29407
29408	} else if (!results[2]) {
29409		return '';
29410
29411	} else {
29412		return decodeURIComponent(results[2].replace(/\+/g, ' '));
29413	}
29414}
29415
29416
29417jQuery.fn.justtext = function() {
29418	// fn vrati text len aktalneho elementu bez jeho childrens
29419    return jQuery(this).clone()
29420            .children()
29421            .remove()
29422            .end()
29423            .text();
29424};
29425
29426var emailProtection = '';
29427
29428var urlParams = {};
29429(function () {
29430    var e,
29431        a = /\+/g,  // Regex for replacing addition symbol with a space
29432        r = /([^&=]+)=?([^&]*)/g,
29433        d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
29434        q = window.location.search.substring(1);
29435
29436    while (e = r.exec(q))
29437       urlParams[d(e[1])] = d(e[2]);
29438})();
29439
29440function str_repeat(patern, n) {
29441    var s = '';
29442    for (;;) {
29443        if (n & 1) s += patern;
29444        n >>= 1;
29445        if (n) patern += patern;
29446        else break;
29447    }
29448    return s;
29449}
29450
29451function js_prettyphoto_close() {
29452  if (jQuery('.pp_pic_holder').length == 0)
29453  	  return false;
29454
29455  jQuery.prettyPhoto.close();
29456  jQuery(document).off('keyup');
29457  return false;
29458}
29459
29460function js_toggle_input_fields(elem){
29461	var checkbox = jQuery(elem);
29462	var box = checkbox.closest('div');
29463	if (checkbox.is(':checked')){
29464
29465		box.find('.inputbox').show();
29466	} else {
29467
29468		box.find('.inputbox').hide();
29469	}
29470}
29471
29472function js_toggle_ckmsyts_fields(elem){
29473	var checkbox = jQuery(elem);
29474	var box = checkbox.closest('div');
29475	var coupon = jQuery('[name="coupon_code"]');
29476	var placeholder = '';
29477	if (checkbox.is(':checked')){
29478		placeholder = coupon.data('ckmpsytslaceholder');
29479		box.find('.inputbox').show();
29480	} else {
29481		placeholder = coupon.data('couponplaceholder');
29482		box.find('.inputbox').hide();
29483	}
29484	coupon.attr('placeholder', placeholder);
29485}
29486
29487function js_setLimitedInterval( func, msec, repeat_limit ) {
29488	//	variacia funkcie setInterval( function () {...} ) s limitom poctu opakovania
29489	//	opakuje volanie funkcie func pokial tato nevrati == true, alebo pokial neuplynie limit poctu opakovani
29490	//	prve volanie funkcie func je po uplynuti msec (rovnako ako v setInterval)
29491	//	//	pouzitie 1.: js_setLimitedInterval( function () { return my_func(); }, 1000, 3 );
29492	//	//	vykonava v sekundovych intervaloch, pokial my_func() nevrati true, ale max. 3x
29493	//	//	pouzitie 2.: js_setLimitedInterval( function () { return if ( ... ) { ...; return true; } else { ...; return false; } ; }, 1000, 3 )
29494	//	//	vykonava v sekundovych intervaloch, pokial function nevrati true, ale max. 3x
29495	if (typeof(func) == 'function' && typeof(msec) == 'number' && msec > 0 && typeof(repeat_limit) == 'number' && repeat_limit > 0) {
29496		if (func.hasOwnProperty('own_func_prop__repeat_count')) {
29497			var func_ret = func.call();
29498			func.own_func_prop__repeat_count ++;
29499		} else {
29500			var func_ret = null;
29501			func.own_func_prop__repeat_count = 0;
29502		}
29503		if (typeof(func_ret) != 'boolean' || func_ret != true) {
29504			if (func.own_func_prop__repeat_count < repeat_limit) {
29505				setTimeout(function () { js_setLimitedInterval(func, msec, repeat_limit); }, msec);
29506			}
29507		}
29508	}
29509	return null;
29510}
29511
29512function js_load_external(url) {
29513	var script = document.createElement("script");
29514	script.type = "text/javascript";
29515	script.src = url;
29516	document.getElementsByTagName("head")[0].appendChild(script);
29517}
29518
29519function js_load_external_css(url) {
29520	var style = document.createElement("link");
29521	style.rel = "stylesheet";
29522	style.type = 'text/css';
29523	style.href = url;
29524	document.getElementsByTagName("head")[0].appendChild(style);
29525}
29526
29527function pathinfo(path, options) {
29528  //  discuss at: http://phpjs.org/functions/pathinfo/
29529  // original by: Nate
29530  //  revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
29531  // improved by: Brett Zamir (http://brett-zamir.me)
29532  //    input by: Timo
29533  //        note: Inspired by actual PHP source: php5-5.2.6/ext/standard/string.c line #1559
29534  //        note: The way the bitwise arguments are handled allows for greater flexibility
29535  //        note: & compatability. We might even standardize this code and use a similar approach for
29536  //        note: other bitwise PHP functions
29537  //        note: php.js tries very hard to stay away from a core.js file with global dependencies, because we like
29538  //        note: that you can just take a couple of functions and be on your way.
29539  //        note: But by way we implemented this function, if you want you can still declare the PATHINFO_*
29540  //        note: yourself, and then you can use: pathinfo('/www/index.html', PATHINFO_BASENAME | PATHINFO_EXTENSION);
29541  //        note: which makes it fully compliant with PHP syntax.
29542  //  depends on: basename
29543  //   example 1: pathinfo('/www/htdocs/index.html', 1);
29544  //   returns 1: '/www/htdocs'
29545  //   example 2: pathinfo('/www/htdocs/index.html', 'PATHINFO_BASENAME');
29546  //   returns 2: 'index.html'
29547  //   example 3: pathinfo('/www/htdocs/index.html', 'PATHINFO_EXTENSION');
29548  //   returns 3: 'html'
29549  //   example 4: pathinfo('/www/htdocs/index.html', 'PATHINFO_FILENAME');
29550  //   returns 4: 'index'
29551  //   example 5: pathinfo('/www/htdocs/index.html', 2 | 4);
29552  //   returns 5: {basename: 'index.html', extension: 'html'}
29553  //   example 6: pathinfo('/www/htdocs/index.html', 'PATHINFO_ALL');
29554  //   returns 6: {dirname: '/www/htdocs', basename: 'index.html', extension: 'html', filename: 'index'}
29555  //   example 7: pathinfo('/www/htdocs/index.html');
29556  //   returns 7: {dirname: '/www/htdocs', basename: 'index.html', extension: 'html', filename: 'index'}
29557
29558  var opt = '',
29559    optName = '',
29560    optTemp = 0,
29561    tmp_arr = {},
29562    cnt = 0,
29563    i = 0;
29564  var have_basename = false,
29565    have_extension = false,
29566    have_filename = false;
29567
29568  // Input defaulting & sanitation
29569  if (!path) {
29570    return false;
29571  }
29572  if (!options) {
29573    options = 'PATHINFO_ALL';
29574  }
29575
29576  // Initialize binary arguments. Both the string & integer (constant) input is
29577  // allowed
29578  var OPTS = {
29579    'PATHINFO_DIRNAME': 1,
29580    'PATHINFO_BASENAME': 2,
29581    'PATHINFO_EXTENSION': 4,
29582    'PATHINFO_FILENAME': 8,
29583    'PATHINFO_ALL': 0
29584  };
29585  // PATHINFO_ALL sums up all previously defined PATHINFOs (could just pre-calculate)
29586  for (optName in OPTS) {
29587    OPTS.PATHINFO_ALL = OPTS.PATHINFO_ALL | OPTS[optName];
29588  }
29589  if (typeof options !== 'number') {
29590    // Allow for a single string or an array of string flags
29591    options = [].concat(options);
29592    for (i = 0; i < options.length; i++) {
29593      // Resolve string input to bitwise e.g. 'PATHINFO_EXTENSION' becomes 4
29594      if (OPTS[options[i]]) {
29595        optTemp = optTemp | OPTS[options[i]];
29596      }
29597    }
29598    options = optTemp;
29599  }
29600
29601  // Internal Functions
29602  var __getExt = function (path) {
29603    var str = path + '';
29604    var dotP = str.lastIndexOf('.') + 1;
29605    return !dotP ? false : dotP !== str.length ? str.substr(dotP) : '';
29606  };
29607
29608  // Gather path infos
29609  if (options & OPTS.PATHINFO_DIRNAME) {
29610    var dirName = path.replace(/\\/g, '/')
29611      .replace(/\/[^\/]*\/?$/, ''); // dirname
29612    tmp_arr.dirname = dirName === path ? '.' : dirName;
29613  }
29614
29615  if (options & OPTS.PATHINFO_BASENAME) {
29616    if (false === have_basename) {
29617      have_basename = this.basename(path);
29618    }
29619    tmp_arr.basename = have_basename;
29620  }
29621
29622  if (options & OPTS.PATHINFO_EXTENSION) {
29623    if (false === have_basename) {
29624      have_basename = this.basename(path);
29625    }
29626    if (false === have_extension) {
29627      have_extension = __getExt(have_basename);
29628    }
29629    if (false !== have_extension) {
29630      tmp_arr.extension = have_extension;
29631    }
29632  }
29633
29634  if (options & OPTS.PATHINFO_FILENAME) {
29635    if (false === have_basename) {
29636      have_basename = this.basename(path);
29637    }
29638    if (false === have_extension) {
29639      have_extension = __getExt(have_basename);
29640    }
29641    if (false === have_filename) {
29642      have_filename = have_basename.slice(0, have_basename.length - (have_extension ? have_extension.length + 1 :
29643        have_extension === false ? 0 : 1));
29644    }
29645
29646    tmp_arr.filename = have_filename;
29647  }
29648
29649  // If array contains only 1 element: return string
29650  cnt = 0;
29651  for (opt in tmp_arr) {
29652    cnt++;
29653  }
29654  if (cnt == 1) {
29655    return tmp_arr[opt];
29656  }
29657
29658  // Return full-blown array
29659  return tmp_arr;
29660}
29661
29662function basename(path, suffix) {
29663  //  discuss at: http://phpjs.org/functions/basename/
29664  // original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
29665  // improved by: Ash Searle (http://hexmen.com/blog/)
29666  // improved by: Lincoln Ramsay
29667  // improved by: djmix
29668  // improved by: Dmitry Gorelenkov
29669  //   example 1: basename('/www/site/home.htm', '.htm');
29670  //   returns 1: 'home'
29671  //   example 2: basename('ecra.php?p=1');
29672  //   returns 2: 'ecra.php?p=1'
29673  //   example 3: basename('/some/path/');
29674  //   returns 3: 'path'
29675  //   example 4: basename('/some/path_ext.ext/','.ext');
29676  //   returns 4: 'path_ext'
29677
29678  var b = path;
29679  var lastChar = b.charAt(b.length - 1);
29680
29681  if (lastChar === '/' || lastChar === '\\') {
29682    b = b.slice(0, -1);
29683  }
29684
29685  b = b.replace(/^.*[\/\\]/g, '');
29686
29687  if (typeof suffix === 'string' && b.substr(b.length - suffix.length) == suffix) {
29688    b = b.substr(0, b.length - suffix.length);
29689  }
29690
29691  return b;
29692}
29693
29694// JAN mnozstevna automaticka zlava na produkt: povolenie zlavy
29695function js_product_automatic_discount_click( link_element ) {
29696	link_element = jQuery(link_element);
29697	var container_element = jQuery('.product_automatic_discount_add_new');
29698
29699	if ( link_element.prop('checked') ) {
29700		container_element.css('display', 'block');
29701	}
29702	else {
29703		container_element.css('display', 'none');
29704	}
29705}
29706
29707// kusy navyse za 0.01 EUR (buy X get Y): zobrazenie/skrytie nastaveni pri prepnuti checkboxu
29708// scopovane na vlastnu kartu (.extra-quantity-box), aby to fungovalo aj pri viacerych otvorenych edit formularoch
29709function js_product_extra_quantity_click( checkbox_element ) {
29710	const cbox = jQuery(checkbox_element);
29711	cbox.closest('.extra-quantity-box').find('.product_extra_quantity_settings')
29712		.css('display', cbox.prop('checked') ? 'block' : 'none');
29713	return true;
29714}
29715
29716// kusy navyse za 0.01 EUR: pole "pocet opakovani" sa zobrazi len pri mode "limited"
29717function js_product_extra_quantity_mode_change( select_element ) {
29718	const sel = jQuery(select_element);
29719	sel.closest('.extra-quantity-box').find('.peq_repetitions')
29720		.css('display', sel.val() === 'limited' ? 'block' : 'none');
29721	return true;
29722}
29723
29724// kusy navyse za 0.01 EUR: povol iba cele cisla v inputoch
29725function js_product_extra_quantity_check_numeric( input_element ) {
29726	const el = jQuery(input_element);
29727	el.val(el.val().replace(/[^0-9]/g, ''));
29728}
29729
29730// kusy navyse za 0.01 EUR: cena - povol cislice a jednu desatinnu bodku (ciarka -> bodka)
29731function js_product_extra_quantity_check_price( input_element ) {
29732	const el = jQuery(input_element);
29733	let v = el.val().replace(',', '.').replace(/[^0-9.]/g, '');
29734	const firstDot = v.indexOf('.');
29735	if ( firstDot !== -1 ) {
29736		v = v.slice(0, firstDot + 1) + v.slice(firstDot + 1).replace(/\./g, '');
29737	}
29738	el.val(v);
29739}
29740
29741// kusy navyse za 0.01 EUR: cena - pri opusteni polia vynut minimum 0.01 a format na 2 desatinne miesta
29742function js_product_extra_quantity_price_blur( input_element ) {
29743	const el = jQuery(input_element);
29744	let v = parseFloat(String(el.val()).replace(',', '.'));
29745	if ( isNaN(v) || v < 0.01 ) {
29746		v = 0.01;
29747	}
29748	el.val(v.toFixed(2));
29749}
29750
29751
29752const ProductBulkDiscount = {
29753	getBulkDiscountWrapper: (elemInsideBulkDiscount) => elemInsideBulkDiscount ? jQuery(elemInsideBulkDiscount).closest('.product_automatic_discount_add_new') : jQuery('.product_automatic_discount_add_new'),
29754	js_product_automatic_discount_handler: (action) => {
29755		// JAN mnozstevna automaticka zlava na produkt: pridanie variantu
29756		if (config('js_Config_shop_product_bulk_discounts_shopper_group') && typeof action !== 'undefined' && action == 1) {
29757			ProductBulkDiscount.js_product_automatic_discount_handler_shopper_groups(action);
29758			return false;
29759		}
29760
29761		let variant_box = ProductBulkDiscount.getBulkDiscountWrapper();
29762		let last_element = variant_box.children('.product_auto_discount_variant:last');
29763		let variant_count = variant_box.children('.product_auto_discount_variant').length;
29764		let variant_start = parseInt(jQuery('input[name=auto_discount_to_' + variant_count + ']').val()) + 1;
29765		let variant_r_count = variant_count + action;
29766		let unit = variant_box.closest('tr.adminlist_data_row').find('.product_in_stock_ks:first').text().trim() || 'ks';
29767
29768		if (typeof (action) !== 'undefined' && action == 1 && js_product_automatic_discount_check_field(false, true)) {
29769			let extraHtml = '';
29770			if (config('js_Config_shop_product_bulk_discounts_favorite_option')) {
29771				extraHtml += '<div class="pad_favorite_option"><input type="checkbox" id="auto_discount_favorite_option_' + variant_r_count + '" name="auto_discount_favorite_option_' + variant_r_count + '" /><label for="auto_discount_favorite_option_' + variant_r_count + '">Obľúbená možnosť</label></div>';
29772			}
29773
29774			let variant_div = '<div class="product_auto_discount_variant" id="auto_discount_variant_' + variant_r_count + '"><div class="br-setting"><!-- --></div><div class="pad_v_count_from"><label><span class="pad_vc_nr">' + variant_r_count + '.</span>od:</label><input onkeyup="ProductBulkDiscount.js_product_automatic_discount_check_numeric_decimal(this);
29774" onblur="return js_product_automatic_discount_check_field(this);" type="text" name="auto_discount_from_' + variant_r_count + '" maxlength="15" value="' + variant_start + '" /></div><div class="pad_v_count_to"><label>' + unit + '&nbsp;&nbsp;-&nbsp;&nbsp;do:</label><input onkeyup="js_product_automatic_discount_check_numeric_decimal(this);" onblur="return js_product_automatic_discount_check_field(this);" type="text" name="auto_discount_to_' + variant_r_count + '" maxlength="15" value="" /></div><div class="pad_variants_value"><label>' + unit + '&nbsp;&nbsp;-&nbsp;&nbsp;aplikovať zľavu</label><input onkeyup="js_product_automatic_discount_check_numeric_decimal(this);" onblur="return js_product_automatic_discount_check_field(this);" type="text" name="auto_discount_value_' + variant_r_count + '" maxlength="15" value="" /><span class="auto_discount_symbol_percentage">&#37;</span></div>' + extraHtml + '<div class="auto_discount_remove"><a style="display:block;" class="pad_v_remove_btton product_auto_discount_remove cs_icon csi-times" onclick="return ProductBulkDiscount.js_product_automatic_discount_handler(-1);" title="Zmazať posledný variant"></a></div></div>';
29775			last_element.after(variant_div);
29776			last_element.find('a.product_auto_discount_remove').css('display', 'none');
29777		} else if (typeof (action) !== 'undefined' && action == -1 && variant_count > 1) {
29778			last_element.remove();
29779			last_element = variant_box.children('.product_auto_discount_variant:last');
29780			last_element.find('a.product_auto_discount_remove').css('display', 'block');
29781		}
29782
29783		return false;
29784	},
29785	js_product_automatic_discount_handler_shopper_groups: (action) => {
29786		let variantBox = ProductBulkDiscount.getBulkDiscountWrapper();
29787		let variantCount = variantBox.children('.product_auto_discount_variant').length;
29788		let options = {
29789			function: 'getBulkDiscountSgHtml',
29790			variantIndex: variantCount + action,
29791		};
29792		jQuery.post('/includes/frontend_ajax.php', options, function (res) {
29793			let shopperGroupInputs = '';
29794			if (res != '') {
29795				var content = JSON.parse(res);
29796				if (typeof content.sgInputs != 'undefined' && content.sgInputs != '') {
29797					shopperGroupInputs = content.sgInputs;
29798				}
29799			}
29800
29801			let variant_box = ProductBulkDiscount.getBulkDiscountWrapper();
29802			let last_element = variant_box.children('.product_auto_discount_variant:last');
29803			let variant_count = variant_box.children('.product_auto_discount_variant').length;
29804			let variant_start = parseInt(jQuery('input[name=auto_discount_to_' + variant_count + ']').val()) + 1;
29805			let variant_r_count = variant_count + action;
29806			let unit = variant_box.closest('tr.adminlist_data_row').find('.product_in_stock_ks:first').text().trim() || 'ks';
29807
29808			let variant_div = '<div class="product_auto_discount_variant" id="auto_discount_variant_' + variant_r_count + '">';
29809			variant_div += '<div class="br-setting"><!-- --></div><div class="pad_v_count_from"><label><span class="pad_vc_nr">' + variant_r_count + '.</span>od:</label>';
29810			variant_div += '<input onkeyup="ProductBulkDiscount.js_product_automatic_discount_check_numeric_decimal(this);
29810" onblur="return js_product_automatic_discount_check_field(this);" type="text" name="auto_discount_from_' + variant_r_count + '" maxlength="15" value="' + variant_start + '" /></div>';
29811			variant_div += '<div class="pad_v_count_to"><label>' + unit + '&nbsp;&nbsp;-&nbsp;&nbsp;do:</label>';
29812			variant_div += '<input onkeyup="js_product_automatic_discount_check_numeric_decimal(this);" onblur="return js_product_automatic_discount_check_field(this);" type="text" name="auto_discount_to_' + variant_r_count + '" maxlength="15" value="" />';
29813			variant_div += '</div>';
29814			variant_div += '<div class="pad_variants_value">';
29815			variant_div += '<label>' + unit + '&nbsp;&nbsp;</label>' + shopperGroupInputs;
29816			variant_div += '</div>';
29817			variant_div += '<div class="auto_discount_remove">';
29818			variant_div += '<a style="display:block;" class="pad_v_remove_btton product_auto_discount_remove cs_icon csi-times" onclick="return ProductBulkDiscount.js_product_automatic_discount_handler(-1);" title="Zmazať posledný variant">';
29819			variant_div += '</div>';
29820			variant_div += '</a>';
29821			variant_div += '</div>';
29822
29823			if (typeof (action) !== 'undefined' && action == 1 && js_product_automatic_discount_check_field(false, true)) {
29824				last_element.after(variant_div);
29825				last_element.find('a.product_auto_discount_remove').css('display', 'none');
29826			}
29827		});
29828		return false;
29829	},
29830	js_product_automatic_discount_check_numeric_decimal: (field) => {
29831		let new_val;
29832		// Riso mnozstevna automaticka zlava : ciselna kontrola tak aby sa dali zadavat nie len cele cisla
29833		const field_box = jQuery(field);
29834		if ( (event.keyCode > 105 || event.keyCode < 96) && ( event.keyCode !== 190 || field_box.val().includes('.') || field_box.val().includes(',') ) ) { // key is not number
29835			if ( field_box.val().includes('.') && field_box.val().includes(',') ) {
29836				if ( field_box.val().slice(-1) == '.' ) {
29837					new_val = field_box.val().match(/\d+\,?\d*/g);
29838					field_box.val( new_val != null ? new_val.join('') : '');
29839				} else {
29840					new_val = field_box.val().match(/\d+\.?\d*/g);
29841					field_box.val(new_val != null ? new_val.join('') : '');
29842				}
29843			} else if ( field_box.val().includes('.') ) {
29844				new_val = field_box.val().match(/\d+\.?\d*/g);
29845				field_box.val( new_val != null ? new_val.join('') : '');
29846			} else if ( field_box.val().includes(',') ) {
29847				new_val = field_box.val().match(/\d+\,?\d*/g);
29848				field_box.val( new_val != null ? new_val.join('').replace(',','.') : '');
29849			}
29850		}
29851	},
29852	getAdditionalDiscountWrapper: (elem) => ProductBulkDiscount.getBulkDiscountWrapper(elem).find('.pad_vc_additional_discount_wrap'),
29853	getAdditionalDiscountRemoveButtonHtml: (index) => {
29854		let html = '';
29855		html += '<div class="pad_additional_discount_remove">';
29856		html += '<a href="javascript:void(0)" onclick="ProductBulkDiscount.removeAdditionalDiscount(this)" class="cs_icon csi-times"></a>';
29857		html += '</div>';
29858		return html;
29859	},
29860	addAdditionalDiscount: (elem) => {
29861		let additionalDiscountWrapper = ProductBulkDiscount.getAdditionalDiscountWrapper(elem);
29862		let additionalDiscountWrapperValues = additionalDiscountWrapper.find('.pad_vc_additional_discount_values');
29863		let unit = additionalDiscountWrapperValues.closest('tr.adminlist_data_row').find('.product_in_stock_ks').text();
29864		let allAdditionalDiscountValueList = additionalDiscountWrapperValues.find('.pad_vc_additional_discount_value');
29865
29866		/* zmazeme tlacitko odobrat z predchadzajucich hodnot */
29867		allAdditionalDiscountValueList.find('.pad_additional_discount_remove').remove();
29868
29869		let currentIndex = allAdditionalDiscountValueList.length + 1;
29870		let html = '';
29871
29872		html += '<div class="pad_vc_additional_discount_value">';
29873		html += `<div class="pad_additional_discount_index">${currentIndex}.</div>`;
29874
29875		/* pocet ks */
29876		html += '<div class="pad_additional_discount_count">';
29877		html += `<span>${js_langs.admin.products.bulkDiscount.every}</span>`;
29878		html += `<input onkeyup="ProductBulkDiscount.js_product_automatic_discount_check_numeric_decimal(this);" type="text" name="auto_discount_additional_discount_count_${currentIndex}" maxlength="15">`;
29879		html += `<span>${unit}</span>`;
29880		html += '</div>';
29881
29882		/* zlava */
29883		html += '<div class="pad_additional_discount_value">';
29884		html += `<span>${js_langs.admin.products.bulkDiscount.applyAdditionalDiscount}</span>`;
29885		html += `<input onkeyup="ProductBulkDiscount.js_product_automatic_discount_check_numeric_decimal(this);" type="text" name="auto_discount_additional_discount_value_${currentIndex}" maxlength="15">`;
29886		html += '<span class="auto_discount_symbol_percentage">%</span>';
29887		html += '</div>';
29888
29889		/* odobrat */
29890		html += ProductBulkDiscount.getAdditionalDiscountRemoveButtonHtml(currentIndex);
29891
29892		html += '</div>';
29893		additionalDiscountWrapperValues.append(html)
29894
29895		/* odstranenie tlacidla na pridanie dalsej delitelnej zlavy */
29896		additionalDiscountWrapper.find('.plus_button').remove();
29897	},
29898	removeAdditionalDiscount: (elem) => {
29899		let additionalDiscountWrapper = ProductBulkDiscount.getAdditionalDiscountWrapper(elem);
29900		let allAdditionalDiscountValueList = additionalDiscountWrapper.find('.pad_vc_additional_discount_value');
29901
29902		/* pridanie tlacidla na pridanie dalsej delitelnej zlavy (ak uz nieje) */
29903		if (!additionalDiscountWrapper.find('.plus_button').length) {
29904			additionalDiscountWrapper.append(`<a href="javascript:void(0)" onclick="ProductBulkDiscount.addAdditionalDiscount(this)" class="plus_button"></a>`);
29905		}
29906
29907		for (let i = 0; i < allAdditionalDiscountValueList.length; i++) {
29908			let isLast = i === allAdditionalDiscountValueList.length - 1;
29909			if (isLast) {
29910				allAdditionalDiscountValueList.eq(i).remove();
29911				let beforeLastIndex = i - 1;
29912				allAdditionalDiscountValueList.eq(beforeLastIndex).find('.pad_additional_discount_value').after(ProductBulkDiscount.getAdditionalDiscountRemoveButtonHtml(beforeLastIndex));
29913			}
29914		}
29915	}
29916};
29917
29918// JAN mnozstevna atomaticka zlava : ciselna kontrola pola
29919function js_product_automatic_discount_check_numeric( field ){ /* TODO presunut do ProductBulkDiscount */
29920	var field_box = jQuery(field);
29921	if (event.keyCode > 105 || event.keyCode < 96 ) { // key is not number
29922		var new_val = field_box.val().match(/\d+/g);
29923		console.log(new_val);
29924		field_box.val( new_val != null ? new_val.join('') : '');
29925	}
29926}
29927
29928// JAN mnozstevna automaticka zlava na produkt: kontrola variantov
29929function js_product_automatic_discount_check_field( focused, add ){ /* TODO presunut do ProductBulkDiscount */
29930	var add = typeof add !== 'undefined' ? add : false;
29931	if( typeof( focused ) == 'undefined' || focused == false ) var focused = jQuery('.product_auto_discount_variant').last().find('input').last().attr('name');
29932	else var focused = jQuery(focused).attr('name');
29933	var variant_count = jQuery('.product_automatic_discount_add_new').children('.product_auto_discount_variant').length;
29934	if( typeof( variant_count ) !== 'undefined' ){
29935		var last_to_value = 0;
29936		var last_discount_value = 0;
29937		for (var i = 1; i <= variant_count; i++) {
29938
29939
29940			if (typeof js_Config_vm_use_decimal_product_quantity != 'undefined') {
29941				var from = parseFloat(jQuery('input[name=auto_discount_from_'+i+']').val());
29942				var to = parseFloat(jQuery('input[name=auto_discount_to_'+i+']').val());
29943				var val = parseFloat(jQuery('input[name=auto_discount_value_'+i+']').val());
29944			} else {
29945				var from = parseInt(jQuery('input[name=auto_discount_from_'+i+']').val());
29946				var to = parseInt(jQuery('input[name=auto_discount_to_'+i+']').val());
29947				var val = parseInt(jQuery('input[name=auto_discount_value_'+i+']').val());
29948			}
29949
29950
29951
29952			// kontrola prazdnych alebo neciselnych poli
29953			if( add && ( typeof(from) == 'undefined' || isNaN( from ) ) ) { js_product_automatic_discount_warning( 'from', i, 1 ); return false; }
29954			if( add && ( typeof(to) == 'undefined' || isNaN( to ) ) ) { js_product_automatic_discount_warning( 'to', i, 1 ); return false; }
29955			if ( !( typeof js_Config_shop_product_bulk_discounts_shopper_group !== 'undefined' && js_Config_shop_product_bulk_discounts_shopper_group ) ) {
29956				if( add && ( typeof(val) == 'undefined' || isNaN( val ) ) ) { js_product_automatic_discount_warning( 'value', i, 1 ); return false; }
29957
29958				// Kontrola zlavy nad 100 percent
29959				if( val > 100 ) { js_product_automatic_discount_warning( 'value', i, 4 ); return false; }
29960			}
29961
29962			// Hodnota from nemoze byt nula
29963			if( from == 0 ) { js_product_automatic_discount_warning( 'from', i, 5 ); return false; }
29964			// kontrola prekrivania od - do
29965			if ( from > to  ) { js_product_automatic_discount_warning('to', i, 2); return false; }
29966
29967			//janB úprava -> aby kusy mohli byť od 2 do 2
29968			if (from > to && to != 99999 && add) {
29969				js_product_automatic_discount_warning('to', i, 2);
29970				return false;
29971			}
29972			// kontrola poslednej navecsej hodnoty "do" a noveho variantu "from"
29973			if (typeof (last_to_value) !== 'undefined' && last_to_value > 0 && last_to_value >= from ){ js_product_automatic_discount_warning( 'from', i, 3 ); return false; }
29974
29975			// kontrola poslednej nekonecnej hodnoty, nemozeme pridavat dalsie varianty
29976			if (add && i == variant_count && (to.length == 0 || to == '99999')) {
29977				js_product_automatic_discount_warning('to', i, 6);
29978				return false;
29979			}
29980			if (!(typeof js_Config_shop_product_bulk_discounts_shopper_group !== 'undefined' && js_Config_shop_product_bulk_discounts_shopper_group)) {
29981				// kontrola nizsej percentualnej zlavy ako predosly variant
29982				if( val != '' && i != 1 && val <= last_discount_value ) {js_product_automatic_discount_warning( 'value', i, 7 ); return false; }
29983			}
29984
29985			// zapis posledne najvacsie hodnoty pre nasledujucu kontrolu
29986			last_to_value = to;
29987
29988			if ( !( typeof js_Config_shop_product_bulk_discounts_shopper_group !== 'undefined' && js_Config_shop_product_bulk_discounts_shopper_group ) ) {
29989				last_discount_value = val;
29990			}
29991		}
29992		return true;
29993	}
29994	return false;
29995}
29996
29997// JAN mnozstevna automaticka zlava na produkt: upozornenie
29998function js_product_automatic_discount_warning( field, variant, message ){ /* TODO presunut do ProductBulkDiscount */
29999	var messages = [
30000		cms_js_admin_product_bulk_discount_message_1,
30001		cms_js_admin_product_bulk_discount_message_2,
30002		cms_js_admin_product_bulk_discount_message_3,
30003		cms_js_admin_product_bulk_discount_message_4,
30004		cms_js_admin_product_bulk_discount_message_5,
30005		cms_js_admin_product_bulk_discount_message_6,
30006		cms_js_admin_product_bulk_discount_message_7,
30007		cms_js_admin_product_bulk_discount_message_8
30008	];
30009	var target = jQuery( 'input[name=auto_discount_'+field+'_'+variant+']' );
30010	var message_box = jQuery( '.product_automatic_discount_message_box' ).text('');
30011	target.effect("highlight", {}, 3000);
30012	message_box.effect("highlight", {}, 3000);
30013	message_box.append( messages[message] ).delay(500).fadeOut();
30014}
30015
30016// JAN member zone zrusenie clenstva
30017function js_member_zone_cancel_subsc( user, type ){
30018	if( confirm( cms_js_lang_member_zone_cancel_subsc_dialog ) ){
30019		jQuery.post( js_global_live_site+'/public_scripts_M4r7ft/member_zone_ajax.php', {'ajax_func': type, 'user': user}, function(res) {
30020			// Skontroluj spravy a aktivuj messengera
30021			if (typeof messenger != 'undefined') messenger.check(res);
30022			return;
30023		});
30024	}
30025    return false;
30026}
30027
30028// JAN member zone poziadavka na zmenu balika
30029function js_member_zone_change_subsc( user, type ){
30030	if( confirm( cms_js_lang_member_zone_change_subsc_dialog ) ){
30031		jQuery.post( js_global_live_site+'/public_scripts_M4r7ft/member_zone_ajax.php', {'ajax_func': type, 'user': user}, function(res) {
30032			// Skontroluj spravy a aktivuj messengera
30033			if (typeof messenger != 'undefined') messenger.check(res);
30034			return;
30035		});
30036	}
30037    return false;
30038}
30039
30040// JAN nastavenie wishlist filtra
30041function js_set_wishlist_filter(bit){
30042	var wsh_filter = Cookies.get( 'wishlistFilter' );
30043	if( js_wishlist_filter_type == 'checkbox') wsh_filter = wsh_filter ^ bit;
30044	else if( wsh_filter == bit ) wsh_filter = 0;
30045	else wsh_filter = bit;
30046	Cookies.set( 'wishlistFilter', wsh_filter, {expires: 365, path: '/'});
30047	document.location.reload();
30048}
30049
30050// JAN wishlist manual product add (used in wishlist and product accessories)
30051function js_wishlist_product_search( self ) {
30052	jQuery(self).trigger('click');
30053	if( !(jQuery(self).hasClass('wsh_initialized')) ){
30054		var pr_search = jQuery(self);
30055		pr_search.addClass('wsh_initialized');
30056		pr_search.autocomplete(js_global_live_site+"/administrator/index3.php?option=com_shop&page=product.product_list&no_html=1&no_vm_html=1&no_menu=1&no_css=1&ajax_call=2&ajax_func=get-product-list-for-autocompleter", {
30057		width: 180,
30058		parentClass: "wishlist_manual_add_content"
30059		});
30060
30061		pr_search.result(function(event, data, formatted) {
30062			var hidden_id = jQuery(this).parent('.wishlist_manual_add_content').find('.wsh_add_product_id');
30063			hidden_id.val( data['2'] );
30064			var full_product_name = '';
30065			var formatted_jqo = jQuery('<div>'+formatted+'</div>');
30066			jQuery(formatted_jqo).find('span').each( function(index) {
30067				if ( index == 0 ) full_product_name += jQuery(this).text();
30068				else full_product_name += ' (' + jQuery(this).text() + ')';
30069			});
30070			formatted = full_product_name;
30071			if (data && data[1] != '' && data[2] > 0) jQuery(this).val( data['1'] );
30072			else jQuery(this).val(formatted);
30073			return;
30074		});
30075		pr_search.removeClass('wsh_initialized');
30076	}
30077	return;
30078}
30079
30080// JAN wishlist add product
30081function js_add_product_to_wishlist( button, user_id ){
30082	var elem = jQuery(button);
30083	var product = elem.parent('.wishlist_manual_add_content').find('.wsh_add_product_id').val();
30084	var tab = elem.parent('.wishlist_manual_add_content').find(':selected').val();
30085	if ( typeof(product) == 'undefined' || product == '') return false;
30086	if ( typeof(tab) == 'undefined' || tab == '') return false;
30087
30088	var options = {'ajax_func': 'forced', 'product_id': product, 'user_id': user_id, 'tab_id': tab};
30089
30090	jQuery.post('/modules/mod_wishlist_ajax.php', options, function (ajax_res) {
30091		var result = JSON.parse(decodeURIComponent(ajax_res));
30092		// Zla poziadavka
30093		if( typeof(result.result) != 'undefined' && result.result == '0' ){
30094			alert('Chýbajú údaje pre spracovanie');
30095			return false;
30096		}
30097		// Produkt existuje
30098		if( typeof(result.result) != 'undefined' && result.result == '1' ){
30099			alert('Produkt neexistuje');
30100			return false;
30101		}
30102		// Produkt bol pridany
30103		if( typeof(result.result) != 'undefined' && result.result == '2' ){
30104			elem.parents('fieldset:first').find('table tr:last').after(result.content);
30105			return false;
30106		}
30107		// Produkt uz existuje
30108		if( typeof(result.result) != 'undefined' && result.result == '4' ){
30109			alert('Produkt sa už nachádza v tejto záložke');
30110			return false;
30111		}
30112	});
30113}
30114
30115/**
30116 * Vytvori duplicitnu instanciu DOM elementu, ktory je surodencom interagovaneho, volajuceho elementu.
30117 *
30118 * @author Marek J. Kolcun
30119 *
30120 * @param me string           - interagovany, volajuci element
30121 * @param target string       - DOM nazov elementu, ktory chceme skopirovat
30122 * @param insertAfter boolean - rozhodne, ci sa novy element ma vlozit pred alebo za interagovany element. True = after, false = before
30123 *
30124 * @return mixed - JS objekt daneho elementu, ak element bol uspesne vytvoreny, inac null
30125 */
30126function copySiblingDomElement(data) {
30127	if (typeof data.me === 'undefined' || typeof data.target === 'undefined') {
30128		return false;
30129	}
30130
30131	insertAfter = (typeof data.insertAfter === 'boolean') ? data.insertAfter : false;
30132	var $me = jQuery(data.me);
30133	var $target = jQuery(data.target);
30134
30135	if (!$target.length) {
30136		if (typeof console !== 'undefined') console.log('copySiblingDomElement(): Element "' + data.target + '" neexistuje.');
30137		return null;
30138	}
30139	var time = new Date().getTime();
30140	var $clone = jQuery(data.target + ':first').clone().data('_id', time).hide();
30141
30142	$clone.find('input, select, textarea').val('').prop('checked', false);
30143
30144	if (!insertAfter)
30145		$me.before($clone);
30146	else
30147		$me.after($clone);
30148
30149	var siblings = $me.siblings();
30150	jQuery(siblings).each(function(i) {
30151		if (jQuery(siblings[i]).data('_id') == time)
30152			jQuery(siblings[i]).show(250, function(){ jQuery(this).css({'overflow':'visible'}); }).removeData('_id');
30153	});
30154
30155	if (typeof data.callback === 'function')
30156		data.callback();
30157	return $clone;
30158}
30159
30160/**
30161 * Odstrani cielovy element
30162 *
30163 * @author Marek J. Kolcun
30164 *
30165 * @param target string     - DOM nazov cieloveho elementu, ktory bude odstraneny
30166 * @param callback function - Callback funkcia, ktora sa vykona bezprostredne po odstraneni cieloveho elementu.
30167 *
30168 * @return boolean - True, ak bol element odstraneny, inac false
30169 */
30170function removeDomElement(target, callback) {
30171	jQuery(target).hide(500, function() {
30172		jQuery(this).remove();
30173	});
30174	if (typeof callback === 'function') {
30175		setTimeout(function() {
30176			callback();
30177		}, 510);
30178	}
30179}
30180
30181/**
30182 * Vsetkym suvisiacim selectom aktualizuje mozne option hodnoty tak, ze vybrana hodnota v jednom selecte sa nezobrazi v inom/zobrazi sa ako disabled.
30183 *
30184 * @author Marek J. Kolcun
30185 *
30186 * @param me string            - DOM nazov cieloveho elementu, ktory bude odstraneny
30187 * @param makeDisabled boolean - Ak je "true", hodnoty sa nezmazu, ale dostanu parameter disabled="disabled"
30188 *
30189 * @return void
30190 */
30191function refreshExclusiveSelect(me, makeDisabled) {
30192	makeDisabled = (typeof makeDisabled === 'boolean') ? makeDisabled : false;
30193	let list = jQuery(me);
30194
30195	if (list.length < 2) {
30196		return;
30197	}
30198
30199	let optionList = jQuery(list[0]).children('option');
30200	let selectedOptions = [];
30201
30202	jQuery(list).each(function(i) {
30203		if (typeof jQuery(list[i]).val() !== 'undefined' && jQuery(list[i]).val() != null) {
30204			selectedOptions.push(jQuery(list[i]).val());
30205		}
30206	});
30207
30208	jQuery(list).children().each(function(i) {
30209		jQuery(this).prop('disabled', false).show();
30210
30211		for (let j in selectedOptions) {
30212			if (jQuery(this).val() == selectedOptions[j]) {
30213				if (makeDisabled) {
30214					jQuery(this).prop('disabled', true);
30215				} else {
30216					jQuery(this).hide();
30217				}
30218			}
30219		}
30220	});
30221}
30222
30223
30224/**
30225 * Otestuje hodnotu atributu (val()) cieloveho elementu, porovna ju so zelanou hodnotou a pripadne vykona odpovedajucu callback funkciu.
30226 * Ak je porovnavana hodnota typu "string", v pripade nerovnosti s compareTo premennou sa porovnaju dlzky tychto retazcov. Nasledne sa
30227 * zavola callback funkcia callbackLess alebo callbackMore. V pripade, ze su retazce rov
30227nake, zavola sa funkcia callbackEqual.
30228 *
30229 * @author Marek J. Kolcun
30230 *
30231 * @param target string          - identifikator cieloveho DOM elementu (trieda, ID).
30232 * @param compareTo mixed        - hodnota, s ktorou sa ma porovnavat hodnota zadaneho DOM elementu.
30233 * @param callbackLess function  - funkcia, ktora sa ma vykonat, ak je hodnota v elemente mensia nez porovnavana hodnota.
30234 * @param callbackEqual function - funkcia, ktora sa ma vykonat, ak je hodnota v elemente rovnaka ako porovnavana hodnota.
30235 * @param callbackMore function  - funkcia, ktora sa ma vykonat, ak je hodnota v elemente vacsia nez porovnavana hodnota.
30236 *
30237 */
30238function testValueAndCallback(target, compareTo, callbackLess, callbackEqual, callbackMore) {
30239	callbackLess = (typeof callbackLess === 'function') ? callbackLess : function() {};
30240	callbackEqual = (typeof callbackEqual === 'function') ? callbackEqual : function() {};
30241	callbackMore = (typeof callbackMore === 'function') ? callbackMore : function() {};
30242
30243	jQuery(target).animate({'outline': '3px solid #a55'}, 500, 'linear', function() {jQuery(this).css('outline', 'none');});
30244	var value = jQuery(target).val();
30245
30246	if (typeof value === 'string' && value != compareTo) {
30247		value     = value.length;
30248		compareTo = compareTo.length;
30249	}
30250
30251	if (value < compareTo)
30252		return callbackLess();
30253	if (value == compareTo)
30254		return callbackEqual();
30255	if (value > compareTo)
30256		return callbackMore();
30257}
30258
30259//	funkcia pre Cetelem. Baf.
30260function js_toggle_cetelem_web_calculator( jso_this ) {
30261	console.log('klik');
30262	var jqo = jQuery('div.cetelem_web_calculator_main');
30263	if (jqo.length > 0) {
30264		if (jqo.html() == '') {
30265			jqo.startAjaxLoader();
30266			jQuery(jso_this).parents('div:first').find('[name="payment_method_id"]:first').prop('checked', true);
30267			jQuery.post('/administrator/components/com_shop/html/checkout.one_step.index.php?option=com_shop&ajax_call=1&ajax_func=get_cetelem_web_calculator', function ( ret ) {
30268				jqo.replaceWith(ret.cetelem_web_calculator);
30269			});
30270		} else {
30271			jqo.slideToggle(250);
30272		}
30273	} else {
30274		console.log('nefungujeme');
30275	}
30276	return false;
30277}
30278
30279var defaultDiacriticsRemovalMap = [
30280		{'base':'A', 'letters':/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},
30281		{'base':'AA','letters':/[\uA732]/g},
30282		{'base':'AE','letters':/[\u00C6\u01FC\u01E2]/g},
30283		{'base':'AO','letters':/[\uA734]/g},
30284		{'base':'AU','letters':/[\uA736]/g},
30285		{'base':'AV','letters':/[\uA738\uA73A]/g},
30286		{'base':'AY','letters':/[\uA73C]/g},
30287		{'base':'B', 'letters':/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},
30288		{'base':'C', 'letters':/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},
30289		{'base':'D', 'letters':/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},
30290		{'base':'DZ','letters':/[\u01F1\u01C4]/g},
30291		{'base':'Dz','letters':/[\u01F2\u01C5]/g},
30292		{'base':'E', 'letters':/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},
30293		{'base':'F', 'letters':/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},
30294		{'base':'G', 'letters':/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},
30295		{'base':'H', 'letters':/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},
30296		{'base':'I', 'letters':/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},
30297		{'base':'J', 'letters':/[\u004A\u24BF\uFF2A\u0134\u0248]/g},
30298		{'base':'K', 'letters':/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},
30299		{'base':'L', 'letters':/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},
30300		{'base':'LJ','letters':/[\u01C7]/g},
30301		{'base':'Lj','letters':/[\u01C8]/g},
30302		{'base':'M', 'letters':/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},
30303		{'base':'N', 'letters':/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},
30304		{'base':'NJ','letters':/[\u01CA]/g},
30305		{'base':'Nj','letters':/[\u01CB]/g},
30306		{'base':'O', 'letters':/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},
30307		{'base':'OI','letters':/[\u01A2]/g},
30308		{'base':'OO','letters':/[\uA74E]/g},
30309		{'base':'OU','letters':/[\u0222]/g},
30310		{'base':'P', 'letters':/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},
30311		{'base':'Q', 'letters':/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},
30312		{'base':'R', 'letters':/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},
30313		{'base':'S', 'letters':/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u
30313015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},
30314		{'base':'T', 'letters':/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},
30315		{'base':'TZ','letters':/[\uA728]/g},
30316		{'base':'U', 'letters':/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},
30317		{'base':'V', 'letters':/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},
30318		{'base':'VY','letters':/[\uA760]/g},
30319		{'base':'W', 'letters':/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},
30320		{'base':'X', 'letters':/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},
30321		{'base':'Y', 'letters':/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},
30322		{'base':'Z', 'letters':/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},
30323		{'base':'a', 'letters':/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},
30324		{'base':'aa','letters':/[\uA733]/g},
30325		{'base':'ae','letters':/[\u00E6\u01FD\u01E3]/g},
30326		{'base':'ao','letters':/[\uA735]/g},
30327		{'base':'au','letters':/[\uA737]/g},
30328		{'base':'av','letters':/[\uA739\uA73B]/g},
30329		{'base':'ay','letters':/[\uA73D]/g},
30330		{'base':'b', 'letters':/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},
30331		{'base':'c', 'letters':/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},
30332		{'base':'d', 'letters':/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},
30333		{'base':'dz','letters':/[\u01F3\u01C6]/g},
30334		{'base':'e', 'letters':/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},
30335		{'base':'f', 'letters':/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},
30336		{'base':'g', 'letters':/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},
30337		{'base':'h', 'letters':/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},
30338		{'base':'hv','letters':/[\u0195]/g},
30339		{'base':'i', 'letters':/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},
30340		{'base':'j', 'letters':/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},
30341		{'base':'k', 'letters':/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},
30342		{'base':'l', 'letters':/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},
30343		{'base':'lj','letters':/[\u01C9]/g},
30344		{'base':'m', 'letters':/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},
30345		{'base':'n', 'letters':/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},
30346		{'base':'nj','letters':/[\u01CC]/g},
30347		{'base':'o', 'letters':/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},
30348		{'base':'oi','letters':/[\u01A3]/g},
30349		{'base':'ou','letters':/[\u0223]/g},
30350		{'base':'oo','letters':/[\uA74F]/g},
30351		{'base':'p','letters':/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},
30352		{'base':'q','letters':/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},
30353		{'base':'r','letters':/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},
30354		{'base':'s','letters':/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},
30355		{'base':'t','letters':/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u02
303551B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},
30356		{'base':'tz','letters':/[\uA729]/g},
30357		{'base':'u','letters':/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},
30358		{'base':'v','letters':/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},
30359		{'base':'vy','letters':/[\uA761]/g},
30360		{'base':'w','letters':/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},
30361		{'base':'x','letters':/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},
30362		{'base':'y','letters':/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},
30363		{'base':'z','letters':/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}
30364	];
30365
30366function js_remove_accents( str ) {
30367
30368    changes = defaultDiacriticsRemovalMap;
30369
30370    for(var i=0; i<changes.length; i++) {
30371        str = str.replace(changes[i].letters, changes[i].base);
30372    }
30373    return str;
30374}
30375
30376function js_format_Money( number, places, symbol, thousand, decimal) {
30377
30378	number = number || 0;
30379	places = !isNaN(places = Math.abs(places)) ? places : 2;
30380	symbol = symbol !== undefined ? symbol : " $";
30381	thousand = thousand || ".";
30382	decimal = decimal || ",";
30383	var negative = number < 0 ? "-" : "",
30384	    i = parseInt(number = Math.abs(+number || 0).toFixed(places), 10) + "",
30385	    j = (j = i.length) > 3 ? j % 3 : 0;
30386	return negative + (j ? i.substr(0, j) + thousand : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousand) + (places ? decimal + Math.abs(number - i).toFixed(places).slice(2) : "") + ' ' + symbol;
30387}
30388
30389function js_format_bytes(bytes, decimals){
30390   if(bytes == 0) return '0 Bytes';
30391   var k = 1024,
30392       dm = decimals || 2,
30393       sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
30394       i = Math.floor(Math.log(bytes) / Math.log(k));
30395   return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
30396}
30397
30398/**
30399 * Vrati microtime pre debug
30400 * @param {boolean} getAsFloat - Ak true bude hodnota vratena ako desatinne cislo
30401 */
30402function microtime(getAsFloat){
30403	var s;
30404	var now;
30405	if (typeof performance !== 'undefined' && performance.now) {
30406
30407		now = (performance.now() + performance.timing.navigationStart) / 1e3;
30408
30409		if (getAsFloat) { return now; }
30410
30411		s = now | 0;
30412
30413		return (Math.round((now - s) * 1e6) / 1e6) + ' ' + s;
30414	} else {
30415
30416		now = (Date.now ? Date.now() : new Date().getTime()) / 1e3;
30417		if (getAsFloat) { return now; }
30418
30419		s = now | 0;
30420
30421		return (Math.round((now - s) * 1e3) / 1e3) + ' ' + s;
30422	}
30423}
30424
30425var js_image_import_interval = 0;
30426var js_image_import_loading = 0;
30427function js_image_import_info(){
30428
30429	if (js_image_import_loading == 1) return;
30430
30431	var wrap = jQuery('.import_data_upload_container_wrapper');
30432	var box = wrap.find('.img_import_prog');
30433
30434	if (box.length == 0){
30435
30436		wrap.append('<div class="img_import_prog"></div>');
30437		box = jQuery('.img_import_prog');
30438	}
30439
30440	js_image_import_loading = 1;
30441	var html = '';
30442	var options = {};
30443	options.function = 'check_image_import';
30444	jQuery.post('/includes/frontend_ajax.php', options, function(res){
30445
30446		var result = JSON.parse(res);
30447		if (result.success == 1 && result.content != ''){
30448
30449			box.html(result.content);
30450
30451			// Maly pocet obrazkov dame po 1 sekunde
30452			var interval = 5000;
30453			if (result.total > 0 && result.total < 100){ interval = 1000; }
30454			else if (result.total < 500){ interval = 2000; }
30455			else if (result.total < 1000){ interval = 3000; }
30456			else if (result.total < 3000){ interval = 4000; }
30457			else if (result.total < 5000){ interval = 5000; }
30458
30459			// Import pripraveny
30460			if (result.status == 1){
30461
30462				var now = new Date();
30463				var eta_ms = new Date(now.getFullYear(), now.getMonth(), now.getDate(), result.sheduled[0], result.sheduled[1]).getTime() - Date.now();
30464
30465				var timeout = setTimeout(function(){
30466
30467					if (js_image_import_interval == 0){
30468
30469						js_image_import_interval = setInterval(function(){
30470
30471							js_image_import_info();
30472						}, interval);
30473					}
30474				}, eta_ms);
30475			}
30476			// Import bezi
30477			else if(result.status == 2){
30478
30479				if (js_image_import_interval == 0){
30480
30481					js_image_import_interval = setInterval(function(){
30482
30483						js_image_import_info();
30484					}, interval);
30485				}
30486			}
30487			// Import zbehol
30488			else if (result.status == 3){
30489
30490				if (js_image_import_interval > 0) clearInterval(js_image_import_interval);
30491			}
30492			else {
30493
30494				box.remove();
30495				if (js_image_import_interval > 0) clearInterval(js_image_import_interval);
30496			}
30497		} else {
30498
30499			box.remove();
30500			clearInterval(js_image_import_interval);
30501		}
30502		js_image_import_loading = 0;
30503	});
30504}
30505
30506function js_image_import_cancel(){
30507
30508	if ( confirm('Zruší sa import všetkých nespracovaných obrázkov. Pokračovať?') ){
30509
30510		var options = {};
30511		options.function = 'cancel_image_import';
30512		jQuery.post('/includes/frontend_ajax.php', options, function(res){
30513
30514			var result = JSON.parse(res);
30515			if (result.success == 1){
30516
30517				js_image_import_info_close();
30518			}
30519		});
30520	}
30521}
30522
30523function js_image_import_info_close(){
30524
30525	var box = jQuery('.img_import_prog');
30526	box.remove();
30527	var options = {};
30528	if (js_image_import_interval > 0) clearInterval(js_image_import_interval);
30529	js_image_import_loading = 0;
30530	options.function = 'close_image_import';
30531	jQuery.post('/includes/frontend_ajax.php', options, function(res){});
30532}
30533
30534function validateEmail(email){
30535	var re = new RegExp('^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,63}$');
30536	//var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
30537
30538    return re.test(email);
30539}
30540
30541function htmlEntities(str) {
30542    return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
30543}
30544
30545/**
30546 * Nahrada zastaralej/pomalej kiniznice overlib_mini lepsim systemom
30547 * @param {object} elem Html element
30548 * @param {object} data Vysvetlenie v komentoch nizsie
30549 */
30550function cs_overlib(elem, data){
30551
30552	var el = jQuery(elem);
30553	var pos = 'top';
30554	var plugs = [];
30555	var disableTooltipster = data.disableTooltipster || false;
30556
30557	if (el.hasClass('tooltipstered')) return;
30558
30559	if (typeof data.content === 'undefined') return;
30560
30561	if (typeof data.position !== 'undefined'){
30562
30563		if (data.position == 0) pos = 'top';
30564		if (data.position == 1) pos = 'right';
30565		if (data.position == 2) pos = 'bottom';
30566		if (data.position == 3) pos = 'left';
30567	}
30568
30569	if (typeof data.follow !== 'undefined' && data.follow == 1){
30570
30571		//plugs.push('follower');
30572	}
30573
30574	var html = decodeURIComponent(atob(data.content));
30575
30576	var instances = jQuery.tooltipster.instances();
30577	jQuery.each(instances, function(i, instance){
30578	    instance.close();
30579	});
30580
30581	var _show = function(html){
30582		if ( disableTooltipster ) {
30583			el.removeAttr('onmouseover');
30584			el.find('.preview_product_image').html(html);
30585		} else {
30586			el.tooltipster({
30587				plugins: plugs,
30588				theme: ['tooltipster-base', 'tooltipster-overlib'],
30589				content: html+'<div class="cs_overlib_cleaner"></div>',
30590				contentAsHTML: true,
30591				trigger: 'custom',
30592				triggerOpen: {
30593					click: true,  // For mouse
30594					tap: true    // For touch device
30595				},
30596				triggerClose: {
30597					click: true,  // For mouse
30598					tap: true    // For touch device
30599				},
30600				delay: (typeof data.delay !== 'undefined' ? data.delay : 0),
30601				animationDuration: (typeof data.animationDuration !== 'undefined' ? data.animationDuration : 0),
30602				interactive: (typeof data.interactive !== 'undefined'),
30603				side: pos,
30604				functionInit: function(){
30605
30606				}
30607			});
30608
30609			el.tooltipster({
30610				plugins: plugs,
30611				theme: ['tooltipster-base', 'tooltipster-overlib'],
30612				content: html+'<div class="cs_overlib_cleaner"></div>',
30613				contentAsHTML: true,
30614				trigger: (typeof data.trigger !== 'undefined' ? data.trigger : 'hover'),
30615				delay: (typeof data.delay !== 'undefined' ? data.delay : 0),
30616				animationDuration: (typeof data.animationDuration !== 'undefined' ? data.animationDuration : 0),
30617				interactive: (typeof data.interactive !== 'undefined'),
30618				side: pos,
30619				functionInit: function(){
30620
30621				}
30622			});
30623
30624			el.tooltipster('open');
30625		}
30626	};
30627
30628	// Preload obrazkov kvoli dynamickemu setnutiu rozmerov
30629	var _html = jQuery(html);
30630	var imgs = (_html.is('img') ? [_html] : _html.find('img'));
30631	if (imgs.length){
30632
30633		var sources = [];
30634		for(var i=0; i<imgs.length; i++){
30635			sources[i] = imgs[0].attr('src');
30636		}
30637		cs_preload_images(sources, function(images){
30638
30639			for(var i=0; i<imgs.length; i++){
30640
30641				var ratio = 1;
30642				var rx = 0;
30643				var ry = 0;
30644				var width = images[i].width;
30645				var height = images[i].height;
30646				var percentage = 0;
30647
30648				// Aplikujeme maxDim ak je nastavene
30649				if (typeof data.maxDim !== 'undefined' && data.maxDim > 0 && (data.maxDim < width || data.maxDim < height)){
30650
30651					if (width > height) {
30652				        ratio = height/width;
30653				        rx = (width-data.maxDim) * (percentage/100);
30654				        ry = (height-data.maxDim * ratio) * (percentage/100);
30655				        width = rx+data.maxDim;
30656				        height = ry+data.maxDim * ratio;
30657				    } else {
30658				        ratio = width/height;
30659				        rx = (width-data.maxDim * ratio) * (percentage/100);
30660				        ry = (height-data.maxDim) * (percentage/100);
30661				        width = rx+data.maxDim * ratio;
30662				        height = ry+data.maxDim;
30663				    }
30664				}
30665
30666				imgs[0].attr('width', width).attr('height', height);
30667			}
30668			html = _html[0].outerHTML;
30669			_show(html);
30670		});
30671	} else {
30672
30673		_show(html);
30674	}
30675}
30676
30677function getInputSelection(el) {
30678    var start = 0, end = 0, normalizedValue, range, textInputRange, len, endRange;
30679
30680    if (typeof el.selectionStart == "number" && typeof el.selectionEnd == "number") {
30681        start = el.selectionStart;
30682        end = el.selectionEnd;
30683    } else {
30684        range = document.selection.createRange();
30685
30686        if (range && range.parentElement() == el) {
30687            len = el.value.length;
30688            normalizedValue = el.value.replace(/\r\n/g, "\n");
30689
30690            // Create a working TextRange that lives only in the input
30691            textInputRange = el.createTextRange();
30692            textInputRange.moveToBookmark(range.getBookmark());
30693
30694            // Check if the start and end of the selection are at the very end
30695            // of the input, since moveStart/moveEnd doesn't return what we want
30696            // in those cases
30697            endRange = el.createTextRange();
30698            endRange.collapse(false);
30699
30700            if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
30701                start = end = len;
30702            } else {
30703                start = -textInputRange.moveStart("character", -len);
30704                start += normalizedValue.slice(0, start).split("\n").length - 1;
30705
30706                if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) {
30707                    end = len;
30708                } else {
30709                    end = -textInputRange.moveEnd("character", -len);
30710                    end += normalizedValue.slice(0, end).split("\n").length - 1;
30711                }
30712            }
30713        }
30714    }
30715
30716    return {
30717        start: start,
30718        end: end
30719    };
30720}
30721
30722function js_related_products_show_button(elem){
30723	jQuery(elem).closest('.set_cont').toggleClass('open');
30724}
30725function js_related_products_change_tab(elem){
30726	jQuery(elem).closest('.related_products_set').find('.set_cont.open').removeClass('open');
30727}
30728
30729function cs_preload_images(sources, callback){
30730
30731	if (jQuery.isEmptyObject(sources)){ callback([]); return; }
30732
30733	var completed = 0;
30734	var errors = 0;
30735	var imgs = [];
30736
30737	var complete = function(){
30738		if ((completed + errors) == sources.length) callback(imgs);
30739	};
30740
30741	if (sources.length){
30742
30743		// Load obrazkov
30744		jQuery.each(sources, function(c,s){
30745
30746			imgs[c] = new Image();
30747
30748			imgs[c].onerror = imgs[c].onabort = function(){
30749
30750				errors++;
30751				complete();
30752			};
30753
30754			imgs[c].onload = function(){
30755
30756				completed++;
30757				complete();
30758			};
30759
30760			imgs[c].src = s;
30761		});
30762	} else {
30763
30764		complete();
30765	}
30766}
30767
30768function CsScrollToAnchor(id) {
30769	var e = window.event;
30770
30771    // zabráni default reloadu
30772    if (e.preventDefault) {
30773        e.preventDefault();
30774    } else {
30775        e.returnValue = false; // IE
30776    }
30777
30778    var el = document.getElementById(id);
30779    if (!el) {
30780		return;
30781    }
30782
30783	var headerOffset = 0;
30784
30785	if (document.body.classList.contains('custom_fixed_header')) {
30786		var hdr = document.getElementById('header-inner');
30787		if (hdr) {
30788		    headerOffset = hdr.offsetHeight;
30789			// Definovat v local.js jemne doladenie
30790			if (typeof window.js_anchor_offset_adjust !== 'undefined' && window.js_anchor_offset_adjust < headerOffset) {
30791				headerOffset = headerOffset - window.js_anchor_offset_adjust;
30792			}
30793		}
30794	}
30795
30796    var elementPosition = el.getBoundingClientRect().top;
30797    var offsetPosition = elementPosition + window.pageYOffset - headerOffset;
30798
30799    window.scrollTo({
30800         top: offsetPosition,
30801         behavior: "smooth"
30802    });
30803}
30804
30805/**
30806 * Zasle error na server a vypise ho do konzoli
30807 * @param message
30808 * @param {boolean} [local] Echovat message iba do konzoli
30809 */
30810function cserror(message,local){
30811
30812	try {
30813		throw new Error(message);
30814	} catch (e){
30815		console.error(e.message);
30816		if (typeof local === 'undefined' || !local){
30817			var _e = new ErrorEvent('error', {message:e.message,error:e});
30818            window.dispatchEvent(_e);
30819		}
30820	}
30821}
30822
30823// Pomocna funkcia pre debug kodu, iba pre csuserov!!! NEDAVAT ONLINE !!!
30824function csstack(func, params){
30825
30826	var _params = '';
30827	if (typeof params === 'undefined') _params = '';
30828	else if (typeof params === 'object'){
30829		try{
30830			_params = JSON.stringify(params);
30831		} catch (err){
30832			_params = 'ERROR: '+err;
30833		}
30834		_params = _params.substring(1, _params.length-1);
30835	}
30836
30837	var callstack = '';
30838	var s = new Error().stack;
30839
30840	// Pre browsre nepodporujuce Error constructor
30841	if (s == null || typeof s == 'undefined') {
30842		console.log(func+'( '+_params+' )');
30843		return;
30844	}
30845	var lines = s.split('\n');
30846	lines.shift();
30847	lines.shift();
30848	var rows = (lines.length > 2 ? 2 : 1);
30849	for (var i=0; i < rows; i++){
30850
30851		func = lines[i].match(/^\s*?at\s(.+)\s+?\(.*[?|/](.*)\)/);
30852
30853		if (func !== null){
30854			if (i == 0){
30855				if (typeof func[1] != 'undefined') {
30856					var f = func[1].replace('Object.', '') + '('+_params+')';
30857					if (f.length < 80){
30858						for(var k=f.length; k<80; k++){
30859							f += ' ';
30860						}
30861					}
30862					callstack += f;
30863				}
30864			}
30865		}
30866	}
30867
30868	console.log('%s Stacktrace: %O', callstack, lines);
30869}
30870
30871const messenger = {
30872	body: {},
30873	options: {
30874		delay: 8000
30875	},
30876	init: function(){
30877		messenger.body = jQuery('body');
30878		messenger.activate();
30879	},
30880	check: function(m){
30881
30882		if (typeof m != 'string') return false;
30883		var res = m.indexOf('<div class="msg_wrap">');
30884		if(res != -1) messenger.activate(m);
30885	},
30886	activate: function(m){
30887
30888		if (typeof m === 'string') messenger.body.append(m);
30889		var msg_wrap = messenger.body.find('.msg_wrap');
30890
30891		if (msg_wrap.length){
30892
30893			var time = 8000;
30894			var autohide = true;
30895			msg_wrap.find('.msg_box').each(function(){
30896
30897				var msg = jQuery('<div>').addClass('msg_wrap');
30898				var box = jQuery(this);
30899				time = (box.data('time') ? parseInt(box.data('time')) : messenger.options.delay);
30900				autohide = box.data('autohide') != 0;
30901				msg.html(box[0].outerHTML);
30902				messenger.body.append(msg);
30903
30904				messenger.center(msg);
30905				messenger.body.addClass('messenger_opened');
30906
30907				if (autohide){
30908
30909					window.setTimeout(function(){
30910
30911						msg.fadeOut(300, function(){ jQuery(this).remove(); messenger.body.removeClass('messenger_opened'); });
30912					}, time);
30913				}
30914
30915				msg.on('click', function(){ jQuery(this).remove(); messenger.body.removeClass('messenger_opened'); });
30916			});
30917
30918			msg_wrap.remove();
30919		}
30920	},
30921	center: function(e){
30922
30923		if (e.length > 0){
30924
30925			var ml = (window.screen.width - e.width()) / 2;
30926			var mt = (window.screen.availHeight / 2) - (e.height() / 2);
30927			e.css({'left':ml+'px', 'top':mt+'px'});
30928		}
30929	}
30930};
30931
30932window.addEventListener('DOMContentLoaded', function() {
30933	messenger.init();
30934
30935	// ak uiautocomplete nie je definovany on ready, tak ho definujeme
30936	if ( typeof jQuery.fn.uiautocomplete === 'undefined' && jQuery.fn.autocomplete !== 'undefined' ) {
30937		jQuery.fn.uiautocomplete = jQuery.fn.autocomplete;
30938	}
30939});
30940
30941
30942/* ========================================
30943 FILE: /includes/js/system/system_functions.js
30944 ==================== */
30945
30946//JB pre budúcu funckionalitu sa pridáva keylistener aby sme mali nahodené aký key sa stlačil
30947//pridaná nová funkcionalita
30948window.addEventListener('DOMContentLoaded', function () {
30949
30950	jQuery(document).keydown(function(event) {
30951		pressedKeyValue = event.which;
30952	}).keyup(function(event) {
30953
30954		//keypress nezachytí ESCAPE takže aj tu riešime stlačenie ESC
30955		processKeyUp(event);
30956		delete pressedKeyValue;}
30957	);
30958
30959	if(typeof js_CS_Config_display_comment_ajax_slick !== 'undefined' && js_CS_Config_display_comment_ajax_slick) {
30960		js_comment_slide();
30961	}
30962
30963	if(typeof js_CS_Config_shop_coupon_auto_use_tooltip !== 'undefined' && js_CS_Config_shop_coupon_auto_use_tooltip) {
30964		bindAutoCouponTooltip();
30965	}
30966
30967	if(typeof js_CS_Config_product_active_image_slick !== 'undefined' && js_CS_Config_product_active_image_slick.active) {
30968		bindProductActiveImageSlick();
30969	}
30970
30971	if (typeof js_Config_product_store_reservation !== 'undefined' && js_Config_product_store_reservation) {
30972		toggleProductReservationButton();
30973		if (jQuery("body").hasClass("shop_page_class_shop_browse")) {
30974			myStoreDisableStoreFilter();
30975		}
30976	}
30977
30978	if (history.state && history.state.modalOpen) {
30979		history.back();
30980	}
30981
30982	window.addEventListener('popstate', function() {
30983		if (typeof window['activeVexId'] !== "undefined" && window['activeVexId'] !== null) {
30984			vex.close(window['activeVexId']);
30985		}
30986	});
30987});
30988
30989function processKeyUp(event) {
30990	if (typeof jsOpenedOrderList !== 'undefined' && jsOpenedOrderList.length && event.key === 'Escape') {
30991		var lastOrderId = jsOpenedOrderList.pop();
30992		var orderCloseButtonElement = jQuery('tr.row_order_id_' + lastOrderId).find('a.icon_orders_detail_close:first');
30993		_order.detail.cancel(orderCloseButtonElement, lastOrderId);
30994	} else if (typeof window.jsOpenedCartList !== 'undefined' && window.jsOpenedCartList.length && event.key === 'Escape') {
30995		const lastCartId = window.jsOpenedCartList.pop();
30996		const cartCloseButtonElement = jQuery('tr.cart-list-row[data-id="' + lastCartId + '"] .adminlist-order-bottom-icons .icon_orders_detail_close');
30997		if (cartCloseButtonElement.length) {
30998			cartCloseButtonElement.trigger("click");
30999		}
31000	}
31001}
31002
31003function escapeHtml(text) {
31004	if ( typeof( text ) == 'string' )
31005		return text
31006		.replace(/&/g, "&amp;")
31007		.replace(/</g, "&lt;")
31008		.replace(/>/g, "&gt;")
31009		.replace(/"/g, "&quot;")
31010		.replace(/'/g, "&#039;");
31011}
31012
31013//JB pridaná možnosť pri zmene variantu meniť aj ďalšie dáta (tie čo by mali byť vrámci variantu vykreslené na frontende)
31014function jsChangeVariantAddon(elem) {
31015
31016	var $elem = jQuery(elem);
31017
31018	var $productWrapper = null;
31019
31020	if ($elem.closest('.cs_product_item').length != 0) {
31021		$productWrapper = $elem.closest('.cs_product_item');
31022	} else if ($elem.closest('.flypage1').length != 0) {
31023		$productWrapper = $elem.closest('.flypage1');
31024	} else {
31025		//nemáme wrap -> return
31026		return;
31027	}
31028
31029	productChangeQuantity: if (typeof js_Config_vm_forced_quantity_multiplier != 'undefined' && typeof js_Config_vm_forced_quantity_multiplier.allowVariantQuantityMultiplier != 'undefined') {
31030
31031		//TODO ak má jeden variant nastavené tieto hodnoty -> musia to mať nastavené všetky varianty
31032		// -> riešenie vytvoriť nejakú js premennú v ktorej sa bude uskladňovať pôvodná hodnota
31033		// -> druhé, lepšie riešenie, variantu dať hodnoty hlavného produktu -> tak sa nič nepokazía a vždy bude situácia fungovať
31034
31035
31036		//je potrebné si rozparsovať vybratý variant a len na základe toho zistiť, či vôbec budeme riešiť či sa niečo bude upravovať
31037		var variantData = jsParseVariant($elem.val());
31038
31039		var mQ = variantData.mQ;
31040		var fQ = variantData.fQ;
31041		var MQ = variantData.MQ;
31042//ak nie je nastavené ani fQ ani mQ ani MQ .. nemáme čo riešiť
31043		if ((typeof mQ == 'undefined' || mQ.length == 0) && (typeof fQ == 'undefined' || fQ.length == 0) && (typeof MQ == 'undefined' || MQ.length == 0)) {
31044			//break productChangeQuantity;
31045		}
31046
31047		if ((typeof mQ == 'undefined') && (typeof fQ == 'undefined') && (typeof MQ == 'undefined')) {
31048			//break productChangeQuantity;
31049		}
31050
31051		//v tomto prípade riešime input a tlačidlá +/-ps
31052
31053		var $quantityField = $productWrapper.find('input[name="quantity"]');
31054
31055		var $addButton = $productWrapper.find('a.count_up');
31056		var $subButton = $productWrapper.find('a.count_down');
31057
31058		//v tomto pripade meníme pre input výberu množstva nejakého produktu
31059		if (typeof js_Config_vm_forced_quantity_multiplier.minimumQuantity != 'undefined') {
31060			console.log('realMinimumQuantity');
31061			var realMinimumQuantity = (mQ > 0 ? mQ : 1 );
31062			//$quantityField.data('quantity', realMinimumQuantity);
31063		}
31064
31065		if (typeof js_Config_vm_forced_quantity_multiplier.forcedQuantity != 'undefined') {
31066			var realForcedQuantity = (fQ > 0 ? fQ : 1 );
31067			console.log('realForcedQuantity');
31068			$addButton.data('quantity', parseFloat(realForcedQuantity));
31069			$subButton.data('quantity', parseFloat(realForcedQuantity));
31070			$quantityField.data('forced_quantity', parseFloat(realForcedQuantity));
31071		}
31072
31073		if (typeof js_Config_vm_forced_quantity_multiplier.maximumQuantity != 'undefined') {
31074			var realMaximumQuantity = (MQ > 0 ? MQ : 1 );
31075			console.log('realMaximumQuantity');
31076			$quantityField.data('maximum_quantity', parseFloat(realMaximumQuantity));
31077		}
31078
31079		$quantityField.trigger('blur');
31080	}
31081
31082	if ( typeof js_Config_custom_variant_fields_display !== 'undefined' && typeof js_Config_custom_variant_fields !== 'undefined' ) {
31083		var attributeData = jsParseVariant($elem.val());
31084		js_Config_custom_variant_fields.forEach( function(entry) {
31085			if ( js_Config_custom_variant_fields_display.includes(entry.name) ) {
31086				var elementDiv = jQuery('.flypage_variant_' + entry.name); //Tu sa vypisuje custom field variantu
31087				var mainCustomAttr = jQuery('.flypage_' + entry.name); //Tu sa vypisuje custom field hlavneho produktu
31088				if ( typeof attributeData[entry.name] !== 'undefined' ) {
31089					if ( mainCustomAttr.length > 0 ) {
31090						mainCustomAttr.hide();
31091					}
31092					elementDiv.html('<span class="custom_variant_' + entry.name + '_label">' + entry.title + ':</span><span class="custom_variant_' + entry.name + '_value">' + attributeData[entry.name] + '</span>');
31093				} else {
31094					if ( mainCustomAttr.length > 0 ) {
31095						mainCustomAttr.show();
31096					}
31097					elementDiv.html('');
31098				}
31099			}
31100		});
31101	}
31102
31103	const dayOfDeliveryMultistockWarehouses = config('js_Config_day_of_delivery_multistock_warehouses');
31104	if ( typeof js_Config_shipping_day_of_delivery_show_in_product_details !== 'undefined' && js_Config_shipping_day_of_delivery_show_in_product_details ) {
31105		var elementValue = $elem.val();
31106		var tooltip = jQuery('.delivery-day-tooltip');
31107		if ( typeof tooltip !== 'undefined' && tooltip.find('[data-variant="' + elementValue + '"]').length > 0 ) {
31108			//These shippings already have been loaded so we just need to hide the current one and diplay the selected one
31109			tooltip.hide();
31110			const tooltipContent = tooltip.find('[data-variant="' + elementValue + '"]');
31111			const deliveryDayTooltip = tooltipContent.parent('.delivery-day-tooltip');
31112			deliveryDayTooltip.show();
31113
31114			const earliestDeliveryDate = tooltipContent.data('earliest-delivery-date');
31115			if (earliestDeliveryDate) {
31116				jQuery('.day_of_delivery_availability_container .courier_shipping_text').html(earliestDeliveryDate);
31117			}
31118		} else {
31119			//Load variant deliveries with ajax
31120			var options = {
31121				function: 'getProductVariantShippings',
31122				product_id: js_product_id,
31123				variant: elementValue,
31124			};
31125
31126			if (dayOfDeliveryMultistockWarehouses) {
31127				options.earliestDeliveryDate = true;
31128			}
31129
31130			jQuery.post('/includes/frontend_ajax.php', options, function (res) {
31131				if ( res != '' ) {
31132					//insert after content
31133					var content = JSON.parse(res);
31134					if ( typeof content.tooltip != 'undefined' && content.tooltip != '' ) {
31135						var variantCode = jQuery(content.tooltip).find('.tooltip-content').data().variant;
31136						var pageTooltip = jQuery('.delivery-day-tooltip');
31137						if ( pageTooltip.length > 0 && pageTooltip.find('[data-variant="' + variantCode + '"]').length == 0 ) {
31138							pageTooltip.hide();
31139							jQuery(content.tooltip).insertAfter('.delivery-day-tooltip:last');
31140						} else if ( pageTooltip.length == 0 ) {
31141							jQuery(content.tooltip).appendTo('.flypage-shipping');
31142						}
31143
31144						if (content.earliestDeliveryDate) {
31145							jQuery('.day_of_delivery_availability_container .courier_shipping_text').html(content.earliestDeliveryDate);
31146							jQuery('.delivery-day-tooltip').find('[data-variant="' + variantCode + '"]').data('earliest-delivery-date', content.earliestDeliveryDate);
31147						}
31148					}
31149				}
31150			});
31151		}
31152	}
31153
31154	if (dayOfDeliveryMultistockWarehouses && typeof MultistockWarehousesDayOfDelivery !== 'undefined') {
31155		MultistockWarehousesDayOfDelivery.toggleDeliveryTexts($elem);
31156	}
31157}
31158
31159//táto funckia zabezpečuje po kliknutí na span, aby sa vedľa neho otvoril input, ktorý následne
31160function jsOpenInputFieldForEditing(elem) {
31161	if (typeof pressedKeyValue !== 'undefined' && pressedKeyValue == 17 ) {
31162		elem = jQuery(elem);
31163		var wrapper = elem.closest('div.cs_field_editor');
31164
31165		if (wrapper.find('input').length < 1) {
31166			elem.hide();
31167
31168			var value       = ((elem.data('value') == '- - -' ) ? '' : elem.data('value'));
31169			var placeHolder = ((elem.data('value') == '- - -' ) ? '- - -' : '');
31170			var inputToAppend = jQuery('<input type="text" class="fieldname" placeholder="' + placeHolder + '" onfocus="jsCreateEventlistenerOnFocus(this)"  value="' + value + '"data-default="' + value + '" maxlength="32"/>');
31171			wrapper.append(inputToAppend).find('input').focus();
31172		}
31173
31174	}
31175}
31176
31177function jsCreateEventlistenerOnFocus(elem) {
31178	elem = jQuery(elem);
31179	var wrapper = elem.closest('div.cs_field_editor');
31180	//bindujeme event on change a potom následne event keypress, oba navzájom
31181	elem.unbind('keyup').bind('keyup', function(e) {
31182		jsCheckIfInputChanged(elem);
31183		if (e.key === "Escape"){
31184			wrapper.find('div.cs_field_editor_value').show();
31185			elem.remove();
31186		}
31187
31188	}).unbind('keypress').bind('keypress', function (e) {
31189		elem.removeClass('error');
31190		if (e.which == 13) {
31191			jsEditProductParameter(elem);
31192		}
31193	});
31194}
31195
31196function jsOpenTrustPayPopup(elem) {
31197	elem = jQuery(elem);
31198	var TrustPayFrames = jQuery('[id^=TrustPayFrame]');
31199	if ( TrustPayFrames.length > 1 ) {
31200		TrustPayFrames.attr('id', 'TrustPayFrameInactive');
31201		var activeTrustPayFrame = elem.siblings('[id^=TrustPayFrame]');
31202		activeTrustPayFrame.attr('id', 'TrustPayFrame');
31203		activeTrustPayFrame.css('position', 'fixed');
31204		activeTrustPayFrame.css('left', 0);
31205		activeTrustPayFrame.css('right', 0);
31206		activeTrustPayFrame.css('top', 0);
31207		activeTrustPayFrame.css('bottom', 0);
31208		activeTrustPayFrame.css('width', 0);
31209		activeTrustPayFrame.css('height', 0);
31210		activeTrustPayFrame.css('border', 'none');
31211		activeTrustPayFrame.css('opacity', 0);
31212		activeTrustPayFrame.css('transition', 'opacity .5s ease-in-out');
31213		activeTrustPayFrame.css('zIndex', '99999');
31214		if ( activeTrustPayFrame.css('display') == 'none' ) {
31215			activeTrustPayFrame.show();
31216		}
31217
31218		if (typeof openPopup == 'function' ) {
31219			openPopup();
31220		}
31221	} else {
31222		if ( typeof openPopup == 'function' ) {
31223			openPopup();
31224		}
31225	}
31226}
31227
31228function jsCheckIfInputChanged(elem) {
31229	elem = jQuery(elem);
31230	if (elem.data('default') != elem.val()) {
31231		elem.addClass('changed');
31232	} else {
31233		elem.removeClass('changed');
31234	}
31235}
31236
31237function jsEditProductParameter(elem) {
31238	//pozrieť sa ktoré dáta máme nastaviť, potom ich nastaviť pre daný produkt
31239	elem = jQuery(elem);
31240	var wrapper = elem.closest('div.cs_field_editor');
31241
31242	wrapper.addClass('ajaxLoader');
31243	valueElement = wrapper.find('div.cs_field_editor_value');
31244
31245	var jsonData = {
31246		'productId' : valueElement.data('id'),
31247		'value' : elem.val(),
31248	};
31249
31250	//momentálne len pre produkty.. neriešime zvyšné úpravy
31251
31252	new AjaxRequest(jsonData)
31253		.setMethod('POST')
31254		.setController(valueElement.data('controller'))
31255		.setAction(valueElement.data('action'))
31256		.setAsync(false) //asi nerobi nic
31257		.onSuccess(function (response) {
31258			wrapper.removeClass('ajaxLoader');
31259
31260			valueElement.data('value',elem.val()).html(elem.val()).show();
31261			elem.remove();
31262		})
31263		.onError(function (response) {
31264			wrapper.removeClass('ajaxLoader');
31265			elem.addClass('error');
31266		})
31267		.send();
31268}
31269
31270
31271
31272jQuery.fn.changeElementType = function(newType) {
31273    var attrs = {};
31274    var newelements = [];
31275    jQuery.each(this, function () {
31276    	var elem = this;
31277    	jQuery.each(elem.attributes, function(idx, attr) {
31278			attrs[attr.nodeName] = attr.nodeValue;
31279		});
31280		var newelement = jQuery("<" + newType + "/>", attrs).append(jQuery(elem).contents());
31281		jQuery(elem).replaceWith(newelement);
31282		newelements.push(newelement.get(0));
31283    });
31284    return newelements;
31285};
31286
31287jQuery.fn.getCursorPosition = function() {
31288    var pos = 0;
31289    var el = jQuery(this).get(0);
31290    // IE Support
31291    if (document.selection) {
31292        el.trigger('focus');
31293        var Sel = document.selection.createRange();
31294        var SelLength = document.selection.createRange().text.length;
31295        Sel.moveStart('character', -el.value.length);
31296        pos = Sel.text.length - SelLength;
31297    }
31298    // Firefox support
31299    else if (el.selectionStart || el.selectionStart == '0') {
31300	    pos = el.selectionStart;
31301    }
31302
31303    return pos;
31304};
31305
31306jQuery.fn.startAjaxLoader = function ( loader_image_filename, svg, destination, options = {}) {
31307	svg = typeof svg !== 'undefined';
31308	destination = typeof destination !== 'undefined' ? destination : false;
31309
31310	var addToCartButton = this.find('input[type="submit"].prod_add_to_cart');
31311	var autoloaderHtml;
31312
31313	if (svg) {
31314		autoloaderHtml = '<span class="small_graph_ajax_loader full-page-loader"></span>';
31315	} else {
31316		autoloaderHtml = '<span class="small_graph_ajax_loader"><img src="' + js_global_live_site + '/images/' + (loader_image_filename != null ? loader_image_filename : 'ajax-loader-05.gif') + '" alt="..." /></span>';
31317	}
31318
31319	if ( addToCartButton.length ) {
31320		addToCartButton.prop('disabled', true).after(autoloaderHtml);
31321		//console.log(this, autoloaderHtml);
31322	} else if (this.data('ajax-loader-pre-html-content') == null) {
31323		if (svg && destination) {
31324			jQuery(destination).append(autoloaderHtml);
31325		} else {
31326			if (options.appendHtml) {
31327				this.data('ajax-loader-pre-html-content', this.html()).append(autoloaderHtml);
31328			} else {
31329				this.data('ajax-loader-pre-html-content', this.html()).html(autoloaderHtml);
31330			}
31331		}
31332	}
31333	return this;
31334};
31335
31336jQuery.fn.stopAjaxLoader = function () {
31337	var addToCartButton = this.find('input[type="submit"].prod_add_to_cart');
31338
31339	if ( addToCartButton.length ) {
31340		addToCartButton.prop('disabled', false);
31341	} else if (this.data('ajax-loader-pre-html-content') != null) {
31342		this.html(this.data('ajax-loader-pre-html-content')).removeData('ajax-loader-pre-html-content');
31343	}
31344
31345	this.find('.small_graph_ajax_loader').remove();
31346	return this;
31347};
31348
31349jQuery.fn.inputAllowNumericOnly = function () {
31350	return this.each(function () {
31351		const element = jQuery(this);
31352
31353		element.on("input", () => {
31354			const value = element.val();
31355			const cleaned = value.replace(/\D+/g, "");
31356
31357			if (value !== cleaned) {
31358				element.val(cleaned);
31359
31360				element.tooltipster({
31361					theme: 'tooltipster-noir',
31362					animation: 'fade',
31363					side: 'left',
31364					delay: 10,
31365					timer: 1600
31366				})
31367					.tooltipster('content', js_lang_must_be_number)
31368					.tooltipster('open');
31369			}
31370		});
31371	});
31372};
31373
31374jQuery.fn.ForceNumericOnly = function () {
31375	return this.each(function () {
31376			jQuery(this).on('keydown', function (e) {
31377				var key = e.charCode || e.keyCode || 0;
31378				return (
31379					key == 8 ||
31380					key == 9 ||
31381					key == 13 ||
31382					key == 46 ||
31383					key == 110 ||
31384					key == 190 ||
31385					(key >= 35 && key <= 40) ||
31386					(key >= 48 && key <= 57) ||
31387					(key >= 96 && key <= 105));
31388			});
31389	});
31390};
31391
31392/**
31393 * @desc Replace all occurrences of match except first
31394 * @author Martin Hucko (Hucci)
31395 *
31396 * @param {RegExp|String} searchVal
31397 * @param {String|Function} newVal
31398 * @return {String}
31399 */
31400String.prototype.cs_replaceNotFirst = function(searchVal, newVal) {
31401    return this.replace(searchVal, function(match, offset, all) {
31402        return (all.indexOf(match) === offset) ? match
31403        	: (typeof newVal === 'function') ? newVal(match, offset, all) : newVal;
31404    });
31405};
31406
31407/**
31408 * @desc create slug from string
31409 * @author Martin Hucko (Hucci)
31410 *
31411 * @return {String}
31412 */
31413String.prototype.cs_slugify = function() {
31414	return this.toLowerCase()
31415		.latinize()						// Replace latin characters
31416		.replace(/\s+/g, '-')           // Replace spaces with -
31417		.replace(/[^\w\-]+/g, '')       // Remove all non-word chars
31418		.replace(/\-\-+/g, '-')         // Replace multiple - with single -
31419		.replace(/^-+/, '')             // Trim - from start of text
31420		.replace(/-+$/, '');            // Trim - from end of text
31421};
31422
31423Date.prototype.getWeek = function() {
31424    var determinedate = new Date();
31425    determinedate.setFullYear(this.getFullYear(), this.getMonth(), this.getDate());
31426    var D = determinedate.getDay();
31427    if(D == 0) D = 7;
31428    determinedate.setDate(determinedate.getDate() + (4 - D));
31429    var YN = determinedate.getFullYear();
31430    var ZBDoCY = Math.floor((determinedate.getTime() - new Date(YN, 0, 1, -6)) / 86400000);
31431    var WN = 1 + Math.floor(ZBDoCY / 7);
31432    return WN;
31433};
31434
31435var Latinise={};Latinise.latin_map={"Á":"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","Ć":"C","Č":"C","Ç":"C","Ḉ":"C","Ĉ":"C","Ċ":"C","Ƈ":"C","Ȼ":"C","Ď":"D","Ḑ":"D","Ḓ":"D","Ḋ":"D","Ḍ":"D","Ɗ":"D","Ḏ":"D","Dz":"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","Ꝫ":"ET","Ḟ":"F","Ƒ":"F","Ǵ":"G","Ğ":"G","Ǧ":"G","Ģ":"G","Ĝ":"G","Ġ":"G","Ɠ":"G","Ḡ":"G","Ǥ":"G","Ḫ":"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","Ꝺ":"D","Ꝼ":"F","Ᵹ":"G","Ꞃ":"R","Ꞅ":"S","Ꞇ":"T","Ꝭ":"IS","Ĵ":"J","Ɉ":"J","Ḱ":"K","Ǩ":"K","Ķ":"K","Ⱪ":"K","Ꝃ":"K","Ḳ":"K","Ƙ":"K","Ḵ":"K","Ꝁ":"K","Ꝅ":"K","Ĺ":"L","Ƚ":"L","Ľ":"L","Ļ":"L","Ḽ":"L","Ḷ":"L","Ḹ":"L","Ⱡ":"L","Ꝉ":"L","Ḻ":"L","Ŀ":"L","Ɫ":"L","Lj":"L","Ł":"L","LJ":"LJ","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ń":"N","Ň":"N","Ņ":"N","Ṋ":"N","Ṅ":"N","Ṇ":"N","Ǹ":"N","Ɲ":"N","Ṉ":"N","Ƞ":"N","Nj":"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","Ƣ":"OI","Ꝏ":"OO","Ɛ":"E","Ɔ":"O","Ȣ":"OU","Ṕ":"P","Ṗ":"P","Ꝓ":"P","Ƥ":"P","Ꝕ":"P","Ᵽ":"P","Ꝑ":"P","Ꝙ":"Q","Ꝗ":"Q","Ŕ":"R","Ř":"R","Ŗ":"R","Ṙ":"R","Ṛ":"R","Ṝ":"R","Ȑ":"R","Ȓ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꜿ":"C","Ǝ":"E","Ś":"S","Ṥ":"S","Š":"S","Ṧ":"S","Ş":"S","Ŝ":"S","Ș":"S","Ṡ":"S","Ṣ":"S","Ṩ":"S","Ť":"T","Ţ":"T","Ṱ":"T","Ț":"T","Ⱦ":"T","Ṫ":"T","Ṭ":"T","Ƭ":"T","Ṯ":"T","Ʈ":"T","Ŧ":"T","Ɐ":"A","Ꞁ":"L","Ɯ":"M","Ʌ":"V","Ꜩ":"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","Ꝟ":"V","Ṿ":"V","Ʋ":"
31435V","á¹¼":"V","Ꝡ":"VY","Ẃ":"W","Å´":"W","Ẅ":"W","Ẇ":"W","Ẉ":"W","Ẁ":"W","â±²":"W","Ẍ":"X","Ẋ":"X","Ý":"Y","Ŷ":"Y","Ÿ":"Y","Ẏ":"Y","á»´":"Y","Ỳ":"Y","Ƴ":"Y","á»¶":"Y","Ỿ":"Y","Ȳ":"Y","Ɏ":"Y","Ỹ":"Y","Ź":"Z","Ž":"Z","Ẑ":"Z","Ⱬ":"Z","Å»":"Z","Ẓ":"Z","Ȥ":"Z","Ẕ":"Z","Ƶ":"Z","IJ":"IJ","Œ":"OE","ᴀ":"A","ᴁ":"AE","ʙ":"B","ᴃ":"B","ᴄ":"C","ᴅ":"D","ᴇ":"E","ꜰ":"F","É¢":"G","ʛ":"G","ʜ":"H","ɪ":"I","ʁ":"R","ᴊ":"J","ᴋ":"K","ʟ":"L","ᴌ":"L","ᴍ":"M","É´":"N","ᴏ":"O","ɶ":"OE","ᴐ":"O","ᴕ":"OU","ᴘ":"P","ʀ":"R","ᴎ":"N","ᴙ":"R","ꜱ":"S","ᴛ":"T","â±»":"E","ᴚ":"R","ᴜ":"U","á´ ":"V","á´¡":"W","ʏ":"Y","á´¢":"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","ꜳ":"aa","æ":"ae","ǽ":"ae","Ç£":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ḃ":"b","ḅ":"b","ɓ":"b","ḇ":"b","ᵬ":"b","ᶀ":"b","ƀ":"b","ƃ":"b","ɵ":"o","ć":"c","č":"c","ç":"c","ḉ":"c","ĉ":"c","ɕ":"c","ċ":"c","ƈ":"c","ȼ":"c","ď":"d","ḑ":"d","ḓ":"d","È¡":"d","ḋ":"d","ḍ":"d","ɗ":"d","ᶑ":"d","ḏ":"d","áµ­":"d","ᶁ":"d","đ":"d","ɖ":"d","ƌ":"d","ı":"i","È·":"j","ɟ":"j","ʄ":"j","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","ꝫ":"et","ḟ":"f","ƒ":"f","áµ®":"f","ᶂ":"f","ǵ":"g","ğ":"g","ǧ":"g","Ä£":"g","ĝ":"g","Ä¡":"g","É ":"g","ḡ":"g","ᶃ":"g","Ç¥":"g","ḫ":"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","ꝺ":"d","ꝼ":"f","áµ¹":"g","ꞃ":"r","ꞅ":"s","ꞇ":"t","ꝭ":"is","ǰ":"j","ĵ":"j","ʝ":"j","ɉ":"j","ḱ":"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","lj":"lj","Å¿":"s","ẜ":"s","ẛ":"s","ẝ":"s","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ᵯ":"m","ᶆ":"m","ń":"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","Æ£":"oi","ꝏ":"oo","ɛ":"e","ᶓ":"e","ɔ":"o","ᶗ":"o","È£":"ou","ṕ":"p","ṗ":"p","ꝓ":"p","Æ¥":"p","áµ±":"p","ᶈ":"p","ꝕ":"p","áµ½":"p","ꝑ":"p","ꝙ":"q","Ê ":"q","ɋ":"q","ꝗ":"q","ŕ":"r","ř":"r","ŗ":"r","ṙ":"r","ṛ":"r","ṝ":"r","ȑ":"r","ɾ":"r","áµ³":"r","ȓ":"r","ṟ":"r","ɼ":"r","áµ²":"r","ᶉ":"r","ɍ":"r","ɽ":"r","ↄ":"c","ꜿ":"c","ɘ":"e","É¿":"r","ś":"s","á¹¥":"s","Å¡":"s","á¹§":"s","ş":"s","ŝ":"s","ș":"s","ṡ":"s","á¹£":"s","ṩ":"s","ʂ":"s","áµ´":"s","ᶊ":"s","È¿":"s","É¡":"g","ᴑ":"o","ᴓ":"o","ᴝ":"u","Å¥":"t","Å£":"t","á¹±":"t","ț":"t","ȶ":"t","ẗ":"t","ⱦ":"t","ṫ":"t","á¹­":"t","Æ­":"t","ṯ":"t","áµµ":"t","Æ«":"t","ʈ":"t","ŧ":"t","ᵺ":"th","ɐ":"a","ᴂ":"ae","ǝ":"e","áµ·":"g","É¥":"h","Ê®":"h","ʯ":"h","ᴉ":"i","ʞ":"k","ꞁ":"l","ɯ":"m","ɰ":"m","ᴔ":"oe","ɹ":"r","É»":"r","ɺ":"r","â±¹":"r","ʇ":"t","ʌ":"v","ʍ":"w","ʎ":"y","ꜩ":"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","ᵫ":"ue","ꝸ":"um","â±´":"v","ꝟ":"v","ṿ":"v","ʋ":"v","ᶌ":"v","â±±":"v","á¹½":"v","ꝡ":"vy","ẃ":"w","ŵ":"w","ẅ":"w","ẇ":"w","ẉ":"w","ẁ":"w","â±³":"w","ẘ":"w","ẍ":"x","ẋ":"x","ᶍ":"x","ý":"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","ff":"ff","ffi":"ffi","ffl":"ffl","fi":"fi","fl":"fl","ij":"ij","œ":"oe","st":"st","ₐ":"a","â
31435‚‘":"e","áµ¢":"i","â±¼":"j","ₒ":"o","áµ£":"r","ᵤ":"u","áµ¥":"v","ₓ":"x"};
31436String.prototype.latinise=function(){return this.replace(/[^A-Za-z0-9\[\] ]/g,function(a){return Latinise.latin_map[a]||a;});};
31437String.prototype.latinize=String.prototype.latinise;
31438String.prototype.isLatin=function(){return this==this.latinise();};
31439var emailProtection = '';
31440
31441// Tu sa inicializuje SimpleModal. Ten sa nachadza v /includes/simple_modal/simple_modal.min.js
31442if (typeof SimpleModal !== 'undefined') {
31443	var simpleModal = new SimpleModal({autoShow: false});
31444}
31445
31446// - - - - - - - - - - - - - - - - - -
31447
31448function protectEmailAddressAsEncodedString(email) {
31449	return  "'"+encodeURI(email)+"'";
31450}
31451
31452function escapeSingleQuote( argList ) {
31453	if (typeof(console) != 'undefined') console.log('argList', argList);
31454	return encodeURI(argList);
31455}
31456
31457function js_html_special_chars( text ) {
31458  return (text.replace(/\</g, '&lt;').replace(/\>/g, '&gt;').replace(/"/g, '&quot;'));
31459}
31460
31461// bez anchor
31462function js_get_current_page_url() {
31463	return (document.location.href).replace(/#[^#]*$/i,'');
31464}
31465
31466// bez parametrov a anchor
31467function js_get_current_page_clean_url() {
31468	return js_get_current_page_url().replace(/\?[^\/\?]*$/,'');
31469}
31470
31471function js_reload_current_page() {
31472  document.location.href = js_get_current_page_url();
31473}
31474
31475function js_reload_page_with_added_params( params ) {
31476
31477  if ( typeof(params) != 'object' || params == null ) {
31478    js_reload_current_page();
31479  }
31480
31481  var orig_location = js_get_current_page_url();
31482  var new_location = orig_location.match(/^[^\?]*/);  // cesta bez parametrov
31483
31484  var location_parameters = '';
31485
31486  if ( new_location == '' ) {
31487    new_location = '/';
31488    location_parameters = orig_location;
31489  }
31490  else {
31491    location_parameters = orig_location.replace( new_location, '' );
31492  }
31493
31494  if ( location_parameters.charAt(0) == '?' ) {
31495    location_parameters = location_parameters.substr(1);
31496  }
31497  location_parameters = location_parameters.split('&');
31498
31499  var has_params = false;
31500  var param_replaced = false;
31501  var name = '';
31502  var encoded_name = '';
31503
31504  // prejdi vsetky parametre, ktore treba pridat
31505  for( name in params ) {
31506
31507    if ( name == '' )
31508      continue;
31509
31510	// fix ktory upravy limitStart na zaklade limitu (mohlo nastat ze sme boli na 1. strane a zacinali od 21 obj/ zak/ prod, a nevedeli sa dostat spat)
31511	if (name == 'limit') {
31512	  var newLimit = parseInt(params[name]);
31513    }
31514
31515	  encoded_name = encodeURIchars( name );
31516
31517    if ( params[name] != null ) {
31518      params[name] = encodeURIchars( params[name] );
31519    }
31520
31521    param_replaced = false;
31522
31523    for ( var i = 0; i < location_parameters.length; i++ ) {
31524
31525      if ( location_parameters[i] == '' ) {
31526        continue;
31527      }
31528
31529	  if ( typeof newLimit !== 'undefined' ) {
31530	  	if( location_parameters[i].indexOf('limitstart') == 0) {
31531		  var limitStart =  parseInt(location_parameters[i].replace('limitstart=', ''));
31532		  if (limitStart > 0) {
31533			  if(newLimit%limitStart != 0 || (limitStart < newLimit)){
31534				  limitStart = Math.floor(limitStart/newLimit)*newLimit;
31535				  location_parameters[i] = ('limitstart='+limitStart.toString());
31536			  }
31537		  }
31538	    }
31539	  }
31540
31541      // nahrad hodnotu existujuceho parametra
31542      if ( location_parameters[i].indexOf( name + '=' ) == 0 || location_parameters[i].indexOf( encoded_name + '=' ) == 0 ) {
31543
31544      	// odstranujeme parameter
31545        if ( params[name] == null ) {
31546          location_parameters[i] = '';
31547        }
31548        else {
31549          location_parameters[i] = ( encoded_name + '=' + params[name] );
31550        }
31551        param_replaced = true;
31552        break;
31553      }
31554    }
31555
31556    if ( param_replaced ) {
31557      continue;
31558    }
31559    // pridanie noveho parametra
31560
31561    if ( params[name] == null ) {
31562      continue;
31563    }
31564
31565    //if ( has_params && new_location.indexOf('?') == 0 ) {
31566    if ( has_params ) {
31567      new_location += '&';
31568    }
31569    else {
31570      new_location += '?';
31571    }
31572
31573    new_location += ( encoded_name + '=' + params[name] );
31574    has_params = true;
31575  }
31576
31577  // pridaj povodne parametre
31578  for ( var i = 0; i < location_parameters.length; i++ ) {
31579
31580    if ( location_parameters[i] == '' ) {
31581      continue;
31582    }
31583
31584    new_location += ((has_params ? '&' : '?') + location_parameters[i]);
31585    has_params = true;
31586  }
31587
31588  document.location.href = new_location;
31589}
31590
31591var urlParams = {};
31592(function () {
31593    var e,
31594        a = /\+/g,  // Regex for replacing addition symbol with a space
31595        r = /([^&=]+)=?([^&]*)/g,
31596        d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
31597        q = window.location.search.substring(1);
31598
31599    while (e = r.exec(q))
31600        urlParams[d(e[1])] = d(e[2]);
31601})();
31602
31603function js_round(x, places, fix) {
31604	var rounded_ret = Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
31605	if (fix && rounded_ret!=parseInt(rounded_ret)) rounded_ret = rounded_ret.toFixed(places);
31606	return rounded_ret;
31607}
31608
31609function doRound(x, places, fix) {
31610	return js_round(x, places, fix);
31611}
31612
31613function js_get_page_scroll() {
31614  var xScroll, yScroll;
31615  if (self.pageYOffset) {
31616    yScroll = self.pageYOffset;
31617    xScroll = self.pageXOffset;
31618  } else if (document.documentElement && document.documentElement.scrollTop) {
31619    yScroll = document.documentElement.scrollTop;
31620    xScroll = document.documentElement.scrollLeft;
31621  } else if (document.body) {// all other Explorers
31622    yScroll = document.body.scrollTop;
31623    xScroll = document.body.scrollLeft;
31624  }
31625  return new Array(xScroll,yScroll);
31626}
31627
31628function js_array_index_of( items, searched_item ) {
31629
31630	if ( typeof(items) != 'object' ) {
31631		return -1;
31632	}
31633
31634  for( var item_id in items ) {
31635    if ( items[item_id] == searched_item )
31636      return item_id;
31637  }
31638  return -1;  // nenasli sme
31639}
31640
31641function js_prettyphoto_close() {
31642  if (jQuery('.pp_pic_holder').length == 0)
31643  	  return false;
31644
31645  jQuery.prettyPhoto.close();
31646  jQuery('body').removeClass('fancybox-lock');
31647  jQuery(document).off('keyup');
31648  return false;
31649}
31650
31651function js_prettyphoto_center() {
31652	var prettyphoto_element = jQuery('.pp_pic_holder:first');
31653	if ( prettyphoto_element.length == 0 )
31654		return;
31655	var page_scroll = js_get_page_scroll();
31656	prettyphoto_element.animate({'left': (page_scroll[0] + Math.round( parseInt(jQuery(window).width()) / 2 ) - Math.round( parseInt(prettyphoto_element.width()) / 2 )).toString() + 'px', 'top': (page_scroll[1] + Math.round( parseInt(jQuery(window).height()) / 2 ) - Math.round( parseInt(prettyphoto_element.height()) / 2 )).toString() + 'px'}, 100);
31657	return;
31658}
31659
31660
31661function js_trim_input_value( input_elements ) {
31662	input_elements = jQuery(input_elements);
31663
31664	if ( input_elements.length == 0 ) {
31665	  return;
31666	}
31667
31668	input_elements.each( function() {
31669		jQuery(this).attr('value', jQuery.trim( jQuery(this).val() ));
31670	});
31671}
31672
31673function js_default_text_input_focus( input_element ) {
31674	input_element = jQuery(input_element);
31675
31676	if ( input_element.hasClass('tooltip_input_def_text') ) {
31677		input_element.attr('value', '').removeClass('tooltip_input_def_text');
31678	}
31679}
31680
31681function js_default_text_input_blur( input_element, default_text, trim ) {
31682	input_element = jQuery(input_element);
31683
31684	if (trim !== false) js_trim_input_value( input_element );
31685
31686	if ( input_element.val() == '' ) {
31687		input_element.attr('value', default_text).addClass('tooltip_input_def_text');
31688	}
31689}
31690
31691function js_select_option_value( select_element, selected_value ) {
31692	select_element = jQuery(select_element);
31693	var selected_option_element = select_element.children('option[value="'+selected_value+'"]:first');
31694
31695	if ( selected_option_element.length == 0 ) {
31696		return;
31697	}
31698
31699	select_element.children('option').removeAttr('selected');
31700	selected_option_element.attr('selected', 'selected');
31701}
31702
31703function js_get_object_length( obj ) {
31704	var size = 0, key = null;
31705	if (obj == null) {
31706		return size;
31707	}
31708
31709	for (key in obj) {
31710		if (obj.hasOwnProperty(key)) size++;
31711	}
31712	return size;
31713};
31714
31715function js_are_objects_identical( obj1, obj2, is_type_strict ) {
31716	if ( typeof(obj1) == 'undefined' || typeof(obj2) == 'undefined' ) {
31717		return false;
31718	}
31719	if ( typeof(obj1) != 'object' || typeof(obj2) != 'object' ) {
31720		return false;
31721	}
31722
31723	if ( js_get_object_length(obj1) != js_get_object_length(obj2) ) {
31724		return false;
31725	}
31726
31727	for (key in obj1) {
31728
31729		if ( !obj1.hasOwnProperty(key) ) {
31730			continue;
31731		}
31732
31733		if ( typeof(obj2[key]) == 'undefined' ) {
31734			return false;
31735		}
31736
31737		if ( obj1[key] != obj2[key] ) {
31738			return false;
31739		}
31740		if ( is_type_strict && typeof(obj1[key]) != typeof(obj2[key]) ) {
31741			return false;
31742		}
31743	}
31744
31745	return true;
31746}
31747
31748function js_clear_css_attribute( element, css_name ) {
31749
31750  if ( css_name != '' ) {
31751    jQuery(element).css(css_name, '');
31752  }
31753}
31754
31755function js_set_css_attribute( element, css_name, css_value ) {
31756
31757  if ( css_name != '' && css_value != '' ) {
31758    jQuery(element).css(css_name, css_value);
31759  }
31760}
31761
31762function js_is_empty( variable ) {
31763
31764  return ( typeof(variable) == 'undefined' || variable == null || (typeof(variable) == 'string' && variable == '') || (typeof(variable.length) != 'undefined' && variable.length == 0) || (typeof(variable) == 'object' && jQuery.isEmptyObject( variable )) );
31765}
31766
31767function js_is_valid_json( obj, params ) {
31768  if ( typeof(obj) != 'object' ) {
31769    return false;
31770  }
31771
31772  if ( typeof(params) != 'object' || params == null ) {
31773  	return true;
31774  }
31775
31776  for( var param in params ) {
31777
31778    if ( typeof(obj[param]) == 'undefined' ) {
31779    	return false;
31780    }
31781
31782    if ( params[param] == null ) {
31783      continue;
31784    }
31785
31786    if ( obj[param] != params[param] ) {
31787    	return false;
31788    }
31789  }
31790  return true;
31791}
31792
31793function js_merge_objects( obj_1, obj_2 ) {
31794  return jQuery.extend(true, {}, obj_1, obj_2);
31795}
31796
31797function js_is_email_banned( email ) {
31798	return ( email.substr(-10) == '@jnxjn.com' || email.substr(-23) == '@guerrillamailblock.com' || email.substr(-16) == '@spamgourmet.com' || email.substr(-10) == 'e4ward.com' || email.substr(-11) == '@spambox.us' || email.substr(-13) == '@pookmail.com' || email.substr(-16) == '@mailmetrash.com' || email.substr(-12) == '@jetable.org' || email.substr(-14) == '@tempemail.net' || /spamfree[24]{0,2}\.[^\.]+$/.exec(email) != null || email.substr(-12) == 'spamspot.com' || email.substr(-7) == 'spam.la' );
31799}
31800
31801function js_check_sef_input_caret( input_element, special_sef ) {
31802	input_element = jQuery(input_element);
31803
31804	if (input_element.length == 0)
31805		return false;
31806
31807	var cur_caret_pos          = input_element.caret().start;
31808	var cur_caret_end_pos      = input_element.caret().end;
31809	var text_from_user         = input_element.val();
31810	var new_text               = '';
31811	var change_position_cursor = false;
31812
31813	if ((text_from_user.search('http') != -1) || (text_from_user.search('https') != -1)) {
31814		// nasiel som "http", alebo "https"
31815		if (text_from_user.search('/') == 0) { // ak na 0.mieste v stringu je "/"
31816			text_from_user = text_from_user.substr(1); // odstrani prvy znak v stringu, cize '/'
31817			//text_from_user = text_from_user.slice(1); // odstrani prvy znak v stringu, cize '/'
31818			change_position_cursor = true;
31819			--cur_caret_pos;
31820			--cur_caret_end_pos;
31821		}
31822
31823		var stringLength = text_from_user.length;
31824		if ((text_from_user.charAt(stringLength - 1) === '/') && (text_from_user.charAt(stringLength - 2) === '/')) {
31825			// ak predposledny a sucasne posledny znak je "/", tak jedno lomitko zmaz
31826			text_from_user = text_from_user.slice(0, -1);
31827		}
31828
31829		new_text = text_from_user;
31830		input_element.val(new_text);
31831		if (change_position_cursor) {
31832			input_element.caret(cur_caret_pos, cur_caret_end_pos);
31833			change_position_cursor = false;
31834		}
31835
31836		return;
31837	} else {
31838		// nenasiel som "http", ani "https"
31839		new_text = '/' + input_element.val().replace(/\s*\//g, '') + '/';
31840		if (typeof(special_sef) != "undefined" && special_sef == 2) {	// povoluje SEF s "/" vo vnutri
31841			//new_text = input_element.val().replace(/^\s*\//, '').replace(/\/\s*$/, '').replace(/\/{2,}/, '/').replace(/ +/, '-').replace(/\-{2,}/, '-') + '/';
31842			new_text = '/' + input_element.val().replace(/^\s*\//, '').replace(/\/\s*$/, '').replace(/\/{2,}/, '/').replace(/ +/, '-').replace(/\-{2,}/, '-') + '/';
31843			//var slash_count = new_text.length - new_text.replace(/\//gi,'').length);
31844		}
31845		if ((typeof(special_sef) != "undefined" && special_sef == 3) || (input_element.val().indexOf('http://') != -1 || input_element.val().indexOf('https://') != -1 || input_element.val().indexOf('www.') != -1)) {
31846			new_text = input_element.val();
31847		} else {
31848			if (input_element.val() != new_text) {
31849				input_element.val(new_text);
31850			}
31851
31852			if (input_element.data('no_caret_change') == '1')
31853				return;
31854
31855			if (!input_element.is(':visible')) {
31856				return;
31857			}
31858
31859			cur_caret_pos     = input_element.caret().start;
31860			cur_caret_end_pos = input_element.caret().end;
31861			//var cur_caret_pos     = input_element.caret().start;
31862			//var cur_caret_end_pos = input_element.caret().end;
31863
31864			if (cur_caret_pos == 0)
31865				cur_caret_pos = 1;
31866
31867			if (cur_caret_pos == input_element.val().length)
31868				cur_caret_pos = input_element.val().length - 1;
31869
31870			if (cur_caret_end_pos == 0)
31871				cur_caret_end_pos = 1;
31872
31873			if (cur_caret_end_pos == input_element.val().length)
31874				cur_caret_end_pos = input_element.val().length - 1;
31875
31876			if (cur_caret_pos == input_element.caret().start && cur_caret_end_pos == input_element.caret().end)
31877				return;
31878
31879			input_element.caret(cur_caret_pos, cur_caret_end_pos);
31880		}
31881
31882	}
31883
31884
31885}
31886
31887
31888
31889function js_bind_sef_input_events( input_element, special_sef ) {
31890
31891  if (typeof js_sef_control_disabled != 'undefined' && js_sef_control_disabled == 1) {
31892	  if(is_cs_user()) {
31893		  console.log('test inside binding -> unreachable');
31894	  }
31895	  return;
31896  }
31897	jQuery(input_element).on('focus keyup click', function () {
31898		js_check_sef_input_caret(jQuery(this), special_sef);
31899	});
31900}
31901function js_multiple_select_option_click(option_element) {
31902	option_element = jQuery(option_element);
31903	if (option_element.val() != '') {
31904		option_element.parents('select:first').find('option[value=""]').prop('selected', false);
31905	}
31906}
31907function js_jq_clearCalendarField(input_jq_selector, container_jq_selector, clear_val, jso ) {
31908	if (typeof(jso) != 'undefined' && jso) {
31909		var jqo = jQuery(jso);
31910		var jqo_container = jqo.parents(container_jq_selector);	//	'.adminlist-edit-main-div.product:first'
31911		if (jqo_container.length > 0) {
31912			var jqo_input = jqo_container.find(input_jq_selector);	//	'[name="'+input_name+'"]:first'
31913			if (jqo_input.length > 0) {
31914				jqo_input.val(clear_val);
31915			}
31916		}
31917	}
31918}
31919
31920function js_jq_showCalendar( id, date_format, jq_jso ) {
31921	if (typeof(jq_jso) != 'undefined' && jq_jso) {
31922		var jqo = jQuery(jq_jso);
31923		var jqo_container = jqo.parents('.adminlist-edit-main-div.product:first');
31924		if (jqo_container.length > 0) {
31925			var el = jqo_container.find('[name="'+id+'"]:first').get(0);
31926		}
31927	} else {
31928		var el = document.getElementById(id);
31929	}
31930	if (calendar != null) {
31931		// we already have one created, so just update it.
31932		calendar.hide();		// hide the existing calendar
31933		calendar.parseDate(el.value); // set it to a new date
31934	} else {
31935		// first-time call, create the calendar
31936		var cal = new Calendar(true, null, selected, closeHandler);
31937		calendar = cal;		// remember the calendar in the global
31938		cal.setRange(1900, 2070);	// min/max year allowed
31939		if (date_format && date_format.indexOf('%') > -1) cal.setDateFormat(date_format);
31940		calendar.create();		// create a popup calendar
31941		calendar.parseDate(el.value); // set it to a new date
31942	}
31943	calendar.sel = el;		// inform it about the input field in use
31944	calendar.showAtElement(el);	// show the calendar next to the input field
31945
31946	// catch mousedown on the document
31947	Calendar.addEvent(document, "mousedown", checkCalendar);
31948	return false;
31949}
31950
31951// general utility for browsing a named array or object
31952function xshow(o) {
31953	s = '';
31954	for(e in o) {s += e+'='+o[e]+'\n';}
31955	alert( s );
31956}
31957
31958/**
31959* Writes a dynamically generated list
31960* @param selectParams string The parameters to insert into the <select> tag
31961* @param source array A javascript array of list options in the form [key,value,text]
31962* @param key string The key to display for the initial state of the list
31963* @param orig_key string The original key that was selected
31964* @param orig_val string The original item value that was selected
31965*/
31966function writeDynaList( selectParams, source, key, orig_key, orig_val ) {
31967	console.log('WRITE DL');
31968	var html = '\n	<select ' + selectParams + '>';
31969	var i = 0;
31970	for (x in source) {
31971		if (source[x][0] == key) {
31972			var selected = '';
31973			if ((orig_key == key && orig_val == source[x][1]) || (i == 0 && orig_key != key)) {
31974				selected = 'selected="selected"';
31975			}
31976			html += '\n		<option value="'+source[x][1]+'" '+selected+'>'+source[x][2]+'</option>';
31977		}
31978		i++;
31979	}
31980	html += '\n	</select>';
31981
31982	document.writeln( html );
31983}
31984
31985/**
31986* Changes a dynamically generated list
31987* @param listname string The name of the list to change
31988* @param source array A javascript array of list options in the form [key,value,text]
31989* @param key string The key to display
31990* @param orig_key string The original key that was selected
31991* @param orig_val string The original item value that was selected
31992*/
31993function changeDynaList( listname, source, key, orig_key, orig_val ) {
31994	var list = eval( 'jQuery(\'[name="' + listname + '"]:first\').get(0)' );
31995
31996	// empty the list
31997	for (i in list.options.length) {
31998		list.options[i] = null;
31999	}
32000	i = 0;
32001	for (x in source) {
32002		if (source[x][0] == key) {
32003			opt = new Option();
32004			opt.value = source[x][1];
32005			opt.text = source[x][2];
32006
32007			if ((orig_key == key && orig_val == opt.value) || i == 0) {
32008				opt.selected = true;
32009			}
32010			list.options[i++] = opt;
32011		}
32012	}
32013	list.length = i;
32014}
32015
32016/**
32017* Adds a select item(s) from one list to another
32018*/
32019function addSelectedToList( frmName, srcListName, tgtListName, jQ, ex_params ) {
32020
32021	var srcList;
32022	var tgtList;
32023
32024	if (typeof(ex_params.imagefiles_jq_selector) != 'undefined' && typeof(ex_params.imagelist_jq_selector) != 'undefined' && typeof(jQuery) != 'undefined') {
32025		srcList = jQuery(ex_params.imagefiles_jq_selector).get(0);
32026		tgtList = jQuery(ex_params.imagelist_jq_selector).get(0);
32027	} else {
32028		var form = eval( 'document.' + frmName );
32029		if (jQ) {
32030			srcList = jQuery("form[name='"+frmName+"'] select[name='"+srcListName+"']").get(0);
32031			tgtList = jQuery("form[name='"+frmName+"'] select[name='"+tgtListName+"']").get(0);
32032		} else {
32033			srcList = eval( 'form.' + srcListName );
32034			tgtList = eval( 'form.' + tgtListName );
32035		}
32036	}
32037
32038	if ( typeof srcList === 'undefined' || typeof tgtList === 'undefined' ) {
32039		return;
32040	}
32041
32042	var srcLen = srcList.length;
32043	var tgtLen = tgtList.length;
32044	var tgt = "x";
32045
32046	//build array of target items
32047	for (var i=tgtLen-1; i > -1; i--) {
32048		tgt += "," + tgtList.options[i].value + ",";
32049	}
32050
32051	//Pull selected resources and add them to list
32052	//for (var i=srcLen-1; i > -1; i--) {
32053	for (var i=0; i < srcLen; i++) {
32054		if (srcList.options[i].selected && tgt.indexOf( "," + srcList.options[i].value + "," ) == -1) {
32055
32056				var subFolderPath = jQuery(srcList).closest('.admin-product-edit-active-images').find('select[name="folders"] option:selected').val();
32057				//Zbavenie sa Lomitka pri tahani subFoldru
32058				subFolderPath = (subFolderPath[0] == '/') ? subFolderPath.substr(1) : subFolderPath;
32059				opt = new Option(srcList.options[i].text, subFolderPath + srcList.options[i].text);
32060				tgtList.options[tgtList.length] = opt;
32061
32062				//opt = new Option(srcList.options[i].text, srcList.options[i].value );
32063				//tgtList.options[tgtList.length] = opt;
32064		}
32065	}
32066}
32067
32068function delSelectedFromList( frmName, srcListName, ex_params ) {
32069	if (typeof(ex_params.imagelist_jq_selector) != 'undefined' && typeof(jQuery) != 'undefined') {
32070		var srcList = jQuery(ex_params.imagelist_jq_selector).get(0);
32071	} else {
32072		var form = eval( 'document.' + frmName );
32073		var srcList = eval( 'form.' + srcListName );
32074	}
32075
32076	var srcLen = srcList.length;
32077
32078	for (var i=srcLen-1; i > -1; i--) {
32079		if (srcList.options[i].selected) {
32080			srcList.options[i] = null;
32081		}
32082	}
32083}
32084
32085function moveInList( frmName, srcListName, index, to, jQ, ex_params ) {
32086	if (ex_params != null && typeof(ex_params.imagelist_jq_selector) != 'undefined' && typeof(jQuery) != 'undefined') {
32087		var srcList = jQuery(ex_params.imagelist_jq_selector).get(0);
32088		index = jQuery(ex_params.imagelist_jq_selector).find('option:selected').index();
32089	} else {
32090		if (jQ) {
32091			var srcList = jQuery("form[name='"+frmName+"'] select[name='"+srcListName+"']").get(0);
32092		} else {
32093			var form = eval( 'document.' + frmName );
32094			var srcList = eval( 'form.' + srcListName );
32095		}
32096	}
32097	var total = srcList.options.length-1;
32098
32099	if (index == -1) {
32100		return false;
32101	}
32102	if (to == +1 && index == total) {
32103		return false;
32104	}
32105	if (to == -1 && index == 0) {
32106		return false;
32107	}
32108
32109	var items = new Array;
32110	var values = new Array;
32111
32112	var classes = new Array;
32113
32114	for (i=total; i >= 0; i--) {
32115		items[i] = srcList.options[i].text;
32116		values[i] = srcList.options[i].value;
32117			classes[i] = jQuery(srcList.options[i]).attr('class');
32118	}
32119	for (i = total; i >= 0; i--) {
32120		if (index == i) {
32121			srcList.options[i + to] = new Option(items[i],values[i], 0, 1);
32122			srcList.options[i] = new Option(items[i+to], values[i+to]);
32123				jQuery(srcList.options[i + to]).addClass(classes[i]);
32124				jQuery(srcList.options[i]).addClass(classes[i + to]);
32125			i--;
32126		} else {
32127			srcList.options[i] = new Option(items[i], values[i]);
32128				jQuery(srcList.options[i]).addClass(classe
32128s[i]);
32129		}
32130	}
32131
32132	if (typeof srcList === 'object' && srcList.length) jQuery(srcList).trigger('focus');
32133}
32134
32135function getSelectedOption( frmName, srcListName ) {
32136	var form = eval( 'document.' + frmName );
32137	var srcList = eval( 'form.' + srcListName );
32138
32139	i = srcList.selectedIndex;
32140	if (i != null && i > -1) {
32141		return srcList.options[i];
32142	} else {
32143		return null;
32144	}
32145}
32146
32147function setSelectedValue( frmName, srcListName, value ) {
32148	var form = eval( 'document.' + frmName );
32149	var srcList = eval( 'form.' + srcListName );
32150
32151	var srcLen = srcList.length;
32152
32153	for (var i=0; i < srcLen; i++) {
32154		srcList.options[i].selected = false;
32155		if (srcList.options[i].value == value) {
32156			srcList.options[i].selected = true;
32157		}
32158	}
32159}
32160
32161function getSelectedRadio( frmName, srcGroupName ) {
32162	var form = eval( 'document.' + frmName );
32163	var srcGroup = eval( 'form.' + srcGroupName );
32164
32165	if (srcGroup[0]) {
32166		for (var i=0, n=srcGroup.length; i < n; i++) {
32167			if (srcGroup[i].checked) {
32168				return srcGroup[i].value;
32169			}
32170		}
32171	} else {
32172		if (srcGroup.checked) {
32173			return srcGroup.value;
32174		} // if the one button is checked, return zero
32175	}
32176   // if we get to this point, no radio button is selected
32177   return null;
32178}
32179
32180function getSelectedValue( frmName, srcListName ) {
32181	var form = eval( 'document.' + frmName );
32182	var srcList = eval( 'form.' + srcListName );
32183
32184	i = srcList.selectedIndex;
32185	if (i != null && i > -1) {
32186		return srcList.options[i].value;
32187	} else {
32188		return null;
32189	}
32190}
32191
32192function getSelectedText( frmName, srcListName ) {
32193	var form = eval( 'document.' + frmName );
32194	var srcList = eval( 'form.' + srcListName );
32195
32196	i = srcList.selectedIndex;
32197	if (i != null && i > -1) {
32198		return srcList.options[i].text;
32199	} else {
32200		return null;
32201	}
32202}
32203
32204function chgSelectedValue( frmName, srcListName, value ) {
32205	var form = eval( 'document.' + frmName );
32206	var srcList = eval( 'form.' + srcListName );
32207
32208	i = srcList.selectedIndex;
32209	if (i != null && i > -1) {
32210		srcList.options[i].value = value;
32211		return true;
32212	} else {
32213		return false;
32214	}
32215}
32216
32217function jq_showImageProps( base_path, ex_params) {
32218//id="images-page461"
32219//if (typeof(console) != 'undefined') console.log(ex_params);
32220	if (typeof(ex_params.imagelist_jq_selector) != 'undefined' && typeof(ex_params.view_imagelist_jq_selector) != 'undefined') {
32221		value = jQuery(ex_params.imagelist_jq_selector+' option:selected').val();
32222		if (typeof value !== 'undefined' && value != '') {
32223			parts = value.split( '|' );
32224			var view_imagelist = jQuery(ex_params.view_imagelist_jq_selector).get(0);
32225				var imagelist_jq_selector = jQuery(ex_params.view_imagelist_jq_selector);
32226				if(jQuery(ex_params.imagelist_jq_selector+' option:selected').hasClass('removed')){
32227					if(!jQuery('img[name="view_imagelist"]').parent().find('span.error').length){
32228						imagelist_jq_selector.after('<span class="error">'+ cms_js_lang_product_img_path_change + ' ('+parts[0]+')</span>');
32229
32230					} else {
32231						jQuery('img[name="view_imagelist"]').parent().find('span.error').text( cms_js_lang_product_img_path_change+ ' ('+parts[0]+')');
32232
32233					}
32234					console.log(imagelist_jq_selector.closest('span .error').length);
32235					imagelist_jq_selector.hide();
32236				} else {
32237					imagelist_jq_selector.show();
32238					jQuery('img[name="view_imagelist"]').parent().find('span.error').remove();
32239					view_imagelist.src = base_path + parts[0];
32240				}
32241		}
32242	}
32243}
32244
32245function applyImageProps() {
32246	form = document.adminForm;
32247	if (!getSelectedValue( 'adminForm', 'imagelist' )) {
32248		alert( "Select and image from the list" );
32249		return;
32250	}
32251	value = form._source.value + '|'
32252	+ getSelectedValue( 'adminForm', '_align' ) + '|'
32253	+ form._alt.value + '|'
32254	+ parseInt( form._border.value ) + '|'
32255	+ form._caption.value + '|'
32256	+ getSelectedValue( 'adminForm', '_caption_position' ) + '|'
32257	+ getSelectedValue( 'adminForm', '_caption_align' ) + '|'
32258	+ form._width.value;
32259	chgSelectedValue( 'adminForm', 'imagelist', value );
32260}
32261
32262function previewImage( list, image, base_path, ex_params ) {
32263	//	calim
32264	var srcList;
32265	var srcImage;
32266
32267	if (typeof(ex_params.imagefiles_jq_selector) != 'undefined' && typeof(ex_params.view_imagefiles_jq_selector) != 'undefined' && typeof(jQuery) != 'undefined') {
32268
32269		srcList = jQuery(ex_params.imagefiles_jq_selector).get(0);
32270		srcImage = jQuery(ex_params.view_imagefiles_jq_selector).get(0);
32271
32272	} else {
32273
32274		var form = document.adminForm;
32275		srcList = eval( "form." + list );
32276		srcImage = eval( "document." + image );
32277	}
32278
32279	if (srcList.selectedIndex >= 0) {
32280
32281		var fileName = srcList.options[srcList.selectedIndex].text;
32282		var fileName2 = srcList.options[srcList.selectedIndex].value;
32283		if (fileName.length == 0 || fileName2.length == 0) {
32284			srcImage.src = 'images/blank.gif';
32285		} else {
32286			srcImage.src = base_path + fileName2;
32287		}
32288	}
32289}
32290
32291// Form specific functions for editting content images
32292
32293function showImageProps( base_path, ex_params ) {
32294	if (typeof(ex_params.func) != "undefined" && ex_params.func == "jq_showImageProps" && typeof(jQuery) != 'undefined') {
32295		return jq_showImageProps(base_path, ex_params);
32296	}
32297	form = document.adminForm;
32298	value = getSelectedValue( 'adminForm', 'imagelist' );
32299	parts = value.split( '|' );
32300	form._source.value = parts[0];
32301	setSelectedValue( 'adminForm', '_align', parts[1] || '' );
32302	form._alt.value = parts[2] || '';
32303	form._border.value = parts[3] || '0';
32304	form._caption.value = parts[4] || '';
32305	setSelectedValue( 'adminForm', '_caption_position', parts[5] || '' );
32306	setSelectedValue( 'adminForm', '_caption_align', parts[6] || '' );
32307	form._width.value = parts[7] || '';
32308
32309	//previewImage( 'imagelist', 'view_imagelist', base_path );
32310	var srcImage = eval( "document." + 'view_imagelist' );
32311	srcImage.src = base_path + parts[0];
32312}
32313
32314/**
32315 * Toggles the check state of a group of boxes
32316 *
32317 * Checkboxes must have an id attribute in the form cb0, cb1...
32318 * @param The number of box to 'check'
32319 * @param An alternative field name
32320*/
32321function checkAll( n, fldName ) {
32322  if (!fldName) {
32323     fldName = 'cb';
32324  }
32325	var f = document.adminForm;
32326	var c = f.toggle.checked;
32327	var n2 = 0;
32328	for (i=0; i < n; i++) {
32329		cb = eval( 'f.' + fldName + '' + i );
32330		if (cb) {
32331			cb.checked = c;
32332			n2++;
32333		}
32334	}
32335	if (c) {
32336		document.adminForm.boxchecked.value = n2;
32337	} else {
32338		document.adminForm.boxchecked.value = 0;
32339	}
32340}
32341
32342function listItemTask( id, task ) {
32343    var f = document.adminForm;
32344    cb = eval( 'f.' + id );
32345    if (cb) {
32346        for (i = 0; true; i++) {
32347            cbx = eval('f.cb'+i);
32348            if (!cbx) break;
32349            cbx.checked = false;
32350        } // for
32351        cb.checked = true;
32352        f.boxchecked.value = 1;
32353        submitbutton(task);
32354    }
32355    return false;
32356}
32357
32358function hideMainMenu()
32359{
32360	document.adminForm.hidemainmenu.value=1;
32361}
32362
32363function isChecked(isitchecked){
32364
32365	if ( typeof document.adminForm.boxchecked !== 'undefined' ) {
32366		if (isitchecked == true) {
32367			document.adminForm.boxchecked.value++;
32368		}
32369		else {
32370			document.adminForm.boxchecked.value--;
32371		}
32372	}
32373}
32374
32375/**
32376* Default function.  Usually would be overriden by the component
32377*/
32378function submitbutton(pressbutton) {
32379	submitform(pressbutton);
32380}
32381
32382/**
32383* Submit the admin form
32384*/
32385function submitform(pressbutton){
32386	document.adminForm.task.value=pressbutton;
32387	try {
32388		document.adminForm.onsubmit();
32389		}
32390	catch(e){}
32391	document.adminForm.submit();
32392}
32393
32394/**
32395* Submit the control panel admin form
32396*/
32397function submitcpform(sectionid, id){
32398	document.adminForm.sectionid.value=sectionid;
32399	document.adminForm.id.value=id;
32400	submitbutton("edit");
32401}
32402
32403/**
32404* Getting radio button that is selected.
32405*/
32406function getSelected(allbuttons){
32407	for (i=0;i<allbuttons.length;i++) {
32408		if (allbuttons[i].checked) {
32409			return allbuttons[i].value;
32410		}
32411	}
32412}
32413
32414// JS Calendar
32415var calendar = null; // remember the calendar object so that we reuse
32416// it and avoid creating another
32417
32418// This function gets called when an end-user clicks on some date
32419function selected(cal, date) {
32420	cal.sel.value = date; // just update the value of the input field
32421	if ( is_cs_user('separate_js') ) {
32422		console.log(date);
32423	}
32424	jQuery(cal.sel).trigger('change'); // trigger event after input value replace
32425}
32426// And this gets called when the end-user clicks on the _selected_ date,
32427// or clicks the "Close" (X) button.  It just hides the calendar without
32428// destroying it.
32429function closeHandler(cal) {
32430	cal.hide();			// hide the calendar
32431
32432	// don't check mousedown on document anymore (used to be able to hide the
32433	// calendar when someone clicks outside it, see the showCalendar function).
32434	Calendar.removeEvent(document, "mousedown", checkCalendar);
32435}
32436
32437// This gets called when the user presses a mouse button anywhere in the
32438// document, if the calendar is shown.  If the click was outside the open
32439// calendar this function closes it.
32440function checkCalendar(ev) {
32441	var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
32442	for (; el != null; el = el.parentNode)
32443	// FIXME: allow end-user to click some link without closing the
32444	// calendar.  Good to see real-time stylesheet change :)
32445	if (el == calendar.element || el.tagName == "A") break;
32446	if (el == null) {
32447		// calls closeHandler which should hide the calendar.
32448		calendar.callCloseHandler(); Calendar.stopEvent(ev);
32449	}
32450}
32451
32452// This function shows the calendar under the element having the given id.
32453// It takes care of catching "mousedown" signals on document and hiding the
32454// calendar if the click was outside.
32455function showCalendar( id, date_format, jq_jso ) {
32456	if (typeof(jq_jso) != 'undefined' && jq_jso) {
32457		var jqo = jQuery(jq_jso);
32458		var jqo_container = jqo.parents('.adminlist-edit-main-div.product:first');
32459		if (jqo_container.length > 0) {
32460			var el = jqo_container.find('[name="'+id+'"]:first').get(0);
32461		}
32462	} else {
32463		var el = document.getElementById(id);
32464	}
32465	if (calendar != null) {
32466		// we already have one created, so just update it.
32467		calendar.hide();		// hide the existing calendar
32468		calendar.parseDate(el.value); // set it to a new date
32469	} else {
32470		// first-time call, create the calendar
32471		var cal = new Calendar(true, null, selected, closeHandler);
32472		calendar = cal;		// remember the calendar in the global
32473		cal.setRange(1900, 2070);	// min/max year allowed
32474		if (date_format && date_format.indexOf('%') > -1) cal.setDateFormat(date_format);
32475		calendar.create();		// create a popup calendar
32476		calendar.parseDate(el.value); // set it to a new date
32477	}
32478	calendar.sel = el;		// inform it about the input field in use
32479	calendar.showAtElement(el);	// show the calendar next to the input field
32480
32481	// catch mousedown on the document
32482	Calendar.addEvent(document, "mousedown", checkCalendar);
32483	return false;
32484}
32485
32486/**
32487* Pops up a new window in the middle of the screen
32488*/
32489function popupWindow(mypage, myname, w, h, scroll) {
32490	var winl = (screen.width - w) / 2;
32491	var wint = (screen.height - h) / 2;
32492	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
32493	win = window.open(mypage, myname, winprops);
32494	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
32495}
32496
32497// LTrim(string) : Returns a copy of a string without leading spaces.
32498function ltrim(str)
32499{
32500   var whitespace = new String(" \t\n\r");
32501   var s = new String(str);
32502   if (whitespace.indexOf(s.charAt(0)) != -1) {
32503      var j=0, i = s.length;
32504      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
32505         j++;
32506      s = s.substring(j, i);
32507   }
32508   return s;
32509}
32510
32511//RTrim(string) : Returns a copy of a string without trailing spaces.
32512function rtrim(str)
32513{
32514   var whitespace = new String(" \t\n\r");
32515   var s = new String(str);
32516   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
32517      var i = s.length - 1;       // Get length of string
32518      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
32519         i--;
32520      s = s.substring(0, i+1);
32521   }
32522   return s;
32523}
32524
32525// Trim(string) : Returns a copy of a string without leading or trailing spaces
32526function trim(str) {
32527   return rtrim(ltrim(str));
32528}
32529
32530function mosDHTML(){
32531	this.ver=navigator.appVersion;
32532	this.agent=navigator.userAgent;
32533	this.dom=document.getElementById?1:0;
32534	this.opera5=this.agent.indexOf("Opera 5")<-1;
32535	this.ie5=(this.ver.indexOf("MSIE 5")<-1 && this.dom && !this.opera5)?1:0;
32536	this.ie6=(this.ver.indexOf("MSIE 6")<-1 && this.dom && !this.opera5)?1:0;
32537	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
32538	this.ie=this.ie4||this.ie5||this.ie6;
32539	this.mac=this.agent.indexOf("Mac")<-1;
32540	this.ns6=(this.dom && parseInt(this.ver) <= 5) ?1:0;
32541	this.ns4=(document.layers && !this.dom)?1:0;
32542	this.bw=(this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera5);
32543
32544	this.activeTab = '';
32545	this.onTabStyle = 'ontab';
32546	this.offTabStyle = 'offtab';
32547
32548	this.setElemStyle = function(elem,style) {
32549		document.getElementById(elem).className = style;
32550	};
32551	this.showElem = function(id) {
32552		if (elem = document.getElementById(id)) {
32553			elem.style.visibility = 'visible';
32554			elem.style.display = 'block';
32555		}
32556	};
32557	this.hideElem = function(id) {
32558		if (elem = document.getElementById(id)) {
32559			elem.style.visibility = 'hidden';
32560			elem.style.display = 'none';
32561		}
32562	};
32563	this.cycleTab = function(name) {
32564		if (this.activeTab) {
32565			this.setElemStyle( this.activeTab, this.offTabStyle );
32566			page = this.activeTab.replace( 'tab', 'page' );
32567			this.hideElem(page);
32568		}
32569		this.setElemStyle( name, this.onTabStyle );
32570		this.activeTab = name;
32571		page = this.activeTab.replace( 'tab', 'page' );
32572		this.showElem(page);
32573	};
32574	return this;
32575}
32576var dhtml = new mosDHTML();
32577
32578function MM_findObj(n, d) { //v4.01
32579	var p,i,x;
32580	if(!d) d=document;
32581	if((p=n.indexOf("?"))>0&&parent.frames.length) {
32582		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
32583	}
32584	if(!(x=d[n])&&d.all) x=d.all[n];
32585	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
32586	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
32587	if(!x && d.getElementById) x=d.getElementById(n);
32588	return x;
32589}
32590function MM_swapImage() { //v3.0
32591	var i,j=0,x,a=MM_swapImage.arguments;
32592	document.MM_sr=new Array;
32593	for(i=0;i<(a.length-2);i+=3)
32594	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;
32595	if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
32596}
32597function MM_swapImgRestore() { //v3.0
32598	var i,x,a=document.MM_sr;
32599	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
32600}
32601
32602function MM_preloadImages() { //v3.0
32603	var d=document;
32604	if(d.images){
32605	if(!d.MM_p) d.MM_p=new Array();
32606	var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
32607	for(i=0; i<a.length; i++)
32608	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
32609}
32610
32611
32612function saveorder( n, ls, lm, save_order_func ) {
32613	if (!isNaN(ls) && !isNaN(lm)) {
32614		if (!(ls==0 && lm >= (n+1))) {
32615			alert('Pre uloženie zmien poradia je potrebné zvoliť zobrazenie všetkých (resp. aspoň '+(n+1)+') položiek.');
32616			return;
32617		}
32618	}
32619	checkAll_button( n, save_order_func );
32620}
32621
32622//needed by saveorder function
32623function checkAll_button( n, save_order_func ) {
32624	for ( var j = 0; j <= n; j++ ) {
32625		box = eval( "document.adminForm.cb" + j );
32626		if ( box ) {
32627			if ( box.checked == false ) {
32628				box.checked = true;
32629			}
32630		} else {
32631			alert("You cannot change the order of items, as an item in the list is `Checked Out`");
32632			return;
32633		}
32634	}
32635	if (!isNaN(save_order_func)) submitform(save_order_func);
32636	//if (save_order_func!='') submitform(save_order_func);
32637	else submitform('saveorder');
32638}
32639/**
32640* @param object A form element
32641* @param string The name of the element to find
32642*/
32643function getElementByName( f, name ) {
32644	if (f.elements) {
32645		for (i=0, n=f.elements.length; i < n; i++) {
32646			if (f.elements[i].name == name) {
32647				return f.elements[i];
32648			}
32649		}
32650	}
32651	return null;
32652}
32653
32654function cs_set_cookie ( name, value, expires, path, domain, secure ) {
32655	var today = new Date(); // set time, it's in milliseconds
32656	today.setTime( today.getTime() );
32657
32658	if ( expires ) { // if the expires variable is set, make the correct expires time, the current script below will set it for x number of days, to make it for hours, delete * 24, for minutes, delete * 60 * 24
32659	expires = expires * 1000 * 60 * 60 * 24;
32660	}
32661	var expires_date = new Date( today.getTime() + (expires) );
32662
32663	document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" );
32664}
32665
32666function cs_get_cookie( name ) {
32667	var start = document.cookie.indexOf( name + "=" );
32668	var len = start + name.length + 1;
32669	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
32670		return null;
32671	}
32672	if ( start == -1 ) return null;
32673	var end = document.cookie.indexOf( ";", len );
32674	if ( end == -1 ) end = document.cookie.length;
32675	return unescape( document.cookie.substring( len, end ) );
32676}
32677
32678function encodeURIchars ( text ) {
32679	//	funkcia zakoduje text, ktory sa ma pouzit ako parameter v URL
32680	return encodeURIComponent(text).replace('~','%7E').replace('!','%21').replace('*','%2A').replace('(','%28').replace(')','%29').replace('\'','%27');
32681}
32682
32683// Create XML request variable
32684var ajaxGlobalRequest = false;
32685
32686// function ajaxAsyncContainer() {
32687// 	if (!ajaxGlobalRequestObjectList) ajaxGlobalRequestObjectList = new Array();
32688// 	ajaxGlobalRequestObjectList[ajaxGlobalRequestObjectList.length] = '1';
32689// 	alert(ajaxGlobalRequestObjectList.length);
32690// }
32691
32692function ajaxSyncProcess ( myURL, requestPostParams, requestHeaderContentType, requestMimeType ) {
32693     // Clear ajaxGlobalRequest
32694     ajaxGlobalRequest = false;
32695     // For browsers: Safari, Firefox, etc. use one XML model
32696     if (window.XMLHttpRequest) {
32697          ajaxGlobalRequest = new XMLHttpRequest();
32698          if (requestMimeType==null) ajaxGlobalRequest.overrideMimeType('text/html');	//	text/html, text/xml
32699//           if (ajaxGlobalRequest.overrideMimeType && requestHeaderContentType==null && requestPostParams==null) {
32700//                ajaxGlobalRequest.overrideMimeType('text/xml');
32701//           }
32702     } else if (window.ActiveXObject) {
32703          // For browsers: IE, version 6 and before, use another model
32704          try {
32705               ajaxGlobalRequest = new
32706                    ActiveXObject("Msxml2.XMLHTTP");
32707          } catch (e) {
32708               try {
32709                    ajaxGlobalRequest = new
32710                         ActiveXObject("Microsoft.XMLHTTP");
32711               } catch (e) {}
32712          }
32713     }
32714     // Make sure the request object is valid
32715     if (!ajaxGlobalRequest) {
32716          alert('AJAX ERROR: Cannot create XMLHTTP object');
32717          return false;
32718     }
32719     // Open the URL request
32720     if (requestPostParams==null) {
32721	     ajaxGlobalRequest.open('get', myURL, false);		//	SYNC (waiting mode)
32722     } else {
32723	     ajaxGlobalRequest.open('post', myURL, false);		//	SYNC (waiting mode)
32724     }
32725     // Send request
32726     //	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
32727     //	"Content-Type","application/x-www-form-urlencoded"
32728     if (requestPostParams==null) {
32729	     if (requestHeaderContentType==null) ajaxGlobalRequest.setRequestHeader("Content-Type","text/html; charset=utf-8");
32730	     ajaxGlobalRequest.send(null);
32731     } else {
32732	     ajaxGlobalRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
32733	     ajaxGlobalRequest.setRequestHeader("Content-Length", requestPostParams.length);
32734	     ajaxGlobalRequest.setRequestHeader("Connection", "close");
32735	     ajaxGlobalRequest.send(requestPostParams);
32736     }
32737     return ajaxGlobalRequest.responseText;
32738}
32739
32740function ajaxAsyncProcess ( myURL, myAjaxCallbackFuncName, requestPostParams, requestHeaderContentType, requestMimeType ) {
32741     // Clear ajaxGlobalRequest
32742     ajaxGlobalRequest = false;
32743     // For browsers: Safari, Firefox, etc. use one XML model
32744     if (window.XMLHttpRequest) {
32745          ajaxGlobalRequest = new XMLHttpRequest();
32746          if (requestMimeType==null) ajaxGlobalRequest.overrideMimeType('text/html');	//	text/html, text/xml
32747//           if (ajaxGlobalRequest.overrideMimeType) {
32748//                ajaxGlobalRequest.overrideMimeType('text/xml');
32749//           }
32750     } else if (window.ActiveXObject) {
32751          // For browsers: IE, version 6 and before, use another model
32752          try {
32753               ajaxGlobalRequest = new
32754                    ActiveXObject("Msxml2.XMLHTTP");
32755          } catch (e) {
32756               try {
32757                    ajaxGlobalRequest = new
32758                         ActiveXObject("Microsoft.XMLHTTP");
32759               } catch (e) {}
32760          }
32761     }
32762     // Make sure the request object is valid
32763     if (!ajaxGlobalRequest) {
32764          alert('AJAX ERROR: Cannot create XMLHTTP object');
32765          return false;
32766     }
32767     // Link to display function activated when result returned
32768     if (myAjaxCallbackFuncName=='') myAjaxCallbackFuncName = 'ajaxAsyncDisplayReturn';
32769     eval('ajaxGlobalRequest.onreadystatechange = '+myAjaxCallbackFuncName+';');
32770     // Open the URL request
32771     if (requestPostParams==null) {
32772	     ajaxGlobalRequest.open('get', myURL, true);	//	ASYNC (no waiting mode)
32773     } else {
32774	     ajaxGlobalRequest.open('post', myURL, true);	//	ASYNC (no waiting mode)
32775     }
32776     // Send request
32777     if (requestPostParams==null) {
32778	     if (requestHeaderContentType==null) ajaxGlobalRequest.setRequestHeader("Content-Type","text/html; charset=utf-8");
32779	     ajaxGlobalRequest.send(null);
32780     } else {
32781	     ajaxGlobalRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
32782	     ajaxGlobalRequest.setRequestHeader("Content-Length", requestPostParams.length);
32783	     ajaxGlobalRequest.setRequestHeader("Connection", "close");
32784	     ajaxGlobalRequest.send(requestPostParams);
32785     }
32786     return true;	//	ajaxGlobalRequest.responseText
32787}
32788
32789function ajaxAsyncDisplayReturn () {
32790	// Check to make sure result came through, 4=complete
32791	if (ajaxGlobalRequest.readyState == 4) {
32792		// Check HTTP status code
32793		if (ajaxGlobalRequest.status == 200) {
32794			// Display the responseText
32795			alert(ajaxGlobalRequest.responseText);
32796		} else {
32797			alert('AJAX ERROR: There was a problem with the request.');
32798		}
32799	}
32800}
32801
32802function RGBtoHex(R,G,B) {return toHex(R)+toHex(G)+toHex(B);}
32803function toHex(N) {
32804 if (N==null) return "00";
32805 N=parseInt(N); if (N==0 || isNaN(N)) return "00";
32806 N=Math.max(0,N); N=Math.min(N,255); N=Math.round(N);
32807 return "0123456789ABCDEF".charAt((N-N%16)/16)
32808      + "0123456789ABCDEF".charAt(N%16);
32809}
32810
32811
32812function js_comma_to_dot( text ) {
32813    text = text.toString();
32814    var pattern = new RegExp("\,");
32815	return no_comma = text.replace( pattern, "." );
32816}
32817
32818function jf_translate(text, from, to, format) {
32819	return new Promise((resolve, reject) => {
32820		new AjaxRequest({ text, from, to, format })
32821			.setMethod('POST')
32822			.setController('Admin')
32823			.setAction('getTranslation')
32824			.onSuccess(function (response) {
32825				resolve(response);
32826			})
32827			.onError(function (error) {
32828				reject(error);
32829			})
32830			.send();
32831	});
32832}
32833
32834// preklad pomocou TRANSLATE kniznice  MODE >> input/textarea/sef
32835// podporovane langy https://docs.microsoft.com/en-us/azure/cognitive-services/translator/languages
32836function jf_translate_field( elem, container, lang, margin_left, mode, prevAll ) {
32837
32838	// kod na ziskanie langov z microsoft webu ...
32839	/*jQuery("#main > div:nth-child(6) > table > tbody").find("code").each(function() {
32840		a.push(jQuery(this).html());
32841	});*/
32842	if (typeof(mode) == "undefined")
32843		mode = '';
32844
32845	prevAll = prevAll || false;
32846
32847	var tmp_at = false;
32848
32849	// redefine language iso podla podporovanych jazykov jquery.translate
32850	if ( lang == 'cz') {
32851		lang = 'cs';
32852	} else if ( lang == 'at' ) {
32853		lang = 'de';
32854		tmp_at = true;
32855	} else if ( lang == 'si') {
32856		lang = 'sl';
32857	} else if (lang == 's2' || lang == 's3') {
32858		tmp_sk = lang;
32859		lang = 'sk';
32860	} else if (lang == 'c2') {
32861		tmp_cz = lang;
32862		lang = 'cs';
32863	}
32864
32865	var alloved_lang_codes = [
32866		"af", "ar", "apc", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs",
32867		"da", "nl", "en", "et", "fj", "fil", "fi", "fr", "de", "el", "ht", "he", "hi", "mww",
32868		"hu", "is", "id", "it", "ja", "sw", "tlh", "tlh-Qaak", "ko", "lv", "lt", "mg", "ms",
32869		"mt", "nb", "fa", "pl", "pt", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk",
32870		"sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua"
32871	];
32872
32873	if (alloved_lang_codes.indexOf(lang) == -1) {
32874		lang = "en";
32875	}
32876
32877
32878	if (typeof(console) != 'undefined') console.log('typeof(mode)',typeof(mode));
32879
32880	var elem_type = 'input';
32881	if ( mode == 'textarea' )
32882		elem_type = 'textarea';
32883
32884	elem = jQuery(elem);
32885
32886	var container = elem.parents(container+':first');
32887	var dest_elem = elem.prev(elem_type);
32888
32889	if (prevAll) {
32890		dest_elem = elem.prevAll(elem_type);
32891	}
32892
32893	var dest_parent = dest_elem.parents();
32894	var dest_name = dest_elem.attr('name');
32895	var translated;
32896
32897	var nameAttr = dest_elem.attr('name') || '';
32898	var source_elem = nameAttr.substr(0, (nameAttr.length - 3));
32899
32900	if ( typeof js_Config_menu_type_blog_separated !== 'undefined' && js_Config_menu_type_blog_separated ) {
32901		translated = container.find('[name='+source_elem+']:visible').val();
32902	} else {
32903		translated = container.find('[name='+source_elem+']').val();
32904	}
32905
32906	if ( typeof js_Config_product_special_category_translate_field_fix !== 'undefined' && js_Config_product_special_category_translate_field_fix && typeof translated == 'undefined') {
32907		if ( source_elem.indexOf('new') == 0 ) {
32908			source_elem = source_elem.substr(4, source_elem.length);
32909		}
32910		translated = container.find('[name='+source_elem+']').val();
32911	}
32912
32913
32914	if ( mode == 'sef' ) {
32915		translated = translated.replace('/', ' ');
32916		var dest_sef_val = dest_elem.val();
32917		if ( dest_sef_val == '//' || dest_sef_val == '' ) {}
32918		else {
32919			if (typeof(console) != 'undefined') console.log('return jf_translate_field()',dest_sef_val);
32920			return;
32921		}
32922	}
32923
32924	if (typeof(console) != 'undefined') console.log('container:', container);
32925
32926	if (translated != '') 	{
32927		elem.before('<img class="ajax-loader" src="'+js_global_live_site+'/images/ajax-loader-05-14x14.gif" style="position:absolute; margin-left: '+margin_left+'px; margin-top: 3px;"/>');
32928		dest_elem.val('');
32929
32930		var local_js_curr_lang = js_curr_lang;
32931		if (local_js_curr_lang == 'cz') {
32932			local_js_curr_lang = 'cs';
32933		} else if (local_js_curr_lang == 'at') {
32934			local_js_curr_lang = 'de';
32935		} else if (local_js_curr_lang == 's2' || local_js_curr_lang == 's3') {
32936			local_js_curr_lang = 'sk';
32937		} else if (local_js_curr_lang == 'c2') {
32938			local_js_curr_lang = 'cs';
32939		}
32940
32941		if (lang == local_js_curr_lang) {
32942			//stopneme loader
32943			dest_parent.children('.ajax-loader').remove();
32944
32945			if (container.children().find('[name='+dest_name+']').length != 0) {
32946				container.children().find('[name='+dest_name+']').val(translated).addClass('changed').trigger('keyup').trigger('blur').trigger('focus');
32947			} else {
32948				container.children('[name='+dest_name+']').val(translated).trigger('focus');
32949			}
32950
32951			// re-make sef
32952			if (lang == 'sk' && typeof tmp_sk !== 'undefined') {
32953				lang = tmp_sk;
32954			} else if (lang == 'cs') {
32955				if (typeof tmp_cz !== 'undefined') {
32956					lang = tmp_cz;
32957				} else {
32958					lang = 'cz';
32959				}
32960			} else if (lang == 'de' && tmp_at) {
32961				lang = 'at';
32962			}
32963
32964			if (mode != 'no_sef') {
32965				try {
32966					js_update_categ_sef_name_input(container.attr('id'), lang );
32967				} catch (e) {
32968					if (typeof(console) != 'undefined' && is_cs_user() ) console.log('catchERR:',e);
32969				}
32970			}
32971		} else if (typeof translated !== 'undefined') {
32972
32973			const handleResponse = (response) => {
32974				//stopneme loader
32975				dest_parent.children('.ajax-loader').remove();
32976				//prelozeny text umiestnime do textarea / inputu
32977				if (typeof response.data.translation !== 'undefined') {
32978					if (container.children().find('[name=' + dest_name + ']').length != 0) {
32979						container.children().find('[name=' + dest_name + ']').val(response.data.translation).addClass('changed').trigger('keyup').trigger('blur').trigger('focus');
32980					} else {
32981						container.children('[name=' + dest_name + ']').val(response.data.translation).trigger('focus');
32982					}
32983					// re-make sef
32984					if (lang == 'sk' && typeof tmp_sk !== 'undefined') {
32985						lang = tmp_sk;
32986					} else if (lang == 'cs') {
32987						if (typeof tmp_cz !== 'undefined') {
32988							lang = tmp_cz;
32989						} else {
32990							lang = 'cz';
32991						}
32992					} else if (lang == 'de' && tmp_at) {
32993						lang = 'at';
32994					}
32995					if (mode != 'no_sef') {
32996						try {
32997							js_update_categ_sef_name_input(container.attr('id'), lang);
32998						} catch (e) {
32999							if (typeof (console) != 'undefined' && is_cs_user()) console.log('catchERR:', e);
33000						}
33001					}
33002				}
33003			}
33004
33005			if(config('js_Config_google_cloud_translation_in_administration')) {
33006				//google cloud translation
33007				new AjaxRequest({"text": translated, "from": local_js_curr_lang, "to": lang})
33008					.setMethod('POST')
33009					.setController('Admin')
33010					.setAction('getGoogleTranslation')
33011					.onSuccess(function (response) {
33012						handleResponse(response);
33013					})
33014					.onError(function (jsonData) {
33015						dest_parent.children('.ajax-loader').remove();
33016						if (jsonData && jsonData.errors) {
33017							showNotification(jsonData.errors.join(' '), 'Google Cloud Translation API', 'error');
33018						}
33019					})
33020					.send();
33021			} else {
33022				jf_translate(translated, local_js_curr_lang, lang, 'text').then(function (response) {
33023					handleResponse(response);
33024				}).catch(function (error) {
33025					dest_parent.children('.ajax-loader').remove();
33026				})
33027			}
33028		}
33029	}
33030
33031  return false;
33032}
33033
33034function jf_translate_all_fields(elem, container, elem_name) {
33035	elem = jQuery(elem);
33036	container_obj = jQuery(container);
33037	container_obj.children().find('input').each(function(){
33038			var input_elem = jQuery(this);
33039			input_elem.next('img').trigger('click');
33040	});
33041
33042	// reload menu poloziek pri uprave
33043	if (container == '#categ_edit_panel_content') {
33044		//js_update_menu_sef_name_input(container.replace('#','') );
33045		jQuery(jf_langs).each(function(i,val){
33046				var sef_value = container_obj.children().find('[name=menu_item_sef_'+val+']').val();
33047				if (typeof(elem_name)!="undefined") {
33048					sef_value = container_obj.children().find('[name=category_sef_name_'+val+']').val();
33049				}
33050
33051				if (typeof(console) != 'undefined') console.log('sef_value',sef_value);
33052
33053				if (sef_value == '' || sef_value == '//') {
33054					js_update_menu_sef_name_input(container.replace('#',''), val );
33055					//container_obj.children().find('input')
33056					setTimeout("js_check_input_sef_name( '"+container+"', 'menu_item_sef_"+val+"')", 1000);
33057				}
33058		});
33059	}
33060
33061	js_update_categ_sef_name_input(container_obj.attr('id'));
33062	return false;
33063}
33064
33065
33066
33067function js_function_vex_open(data) {
33068	var options = jQuery.extend({}, {
33069		title: '',
33070		input: '',
33071		buttons: '',
33072		afterOpen: function(vexContent) { }
33073	}, data);
33074
33075	vex.open({
33076		className: options.className,
33077		content  : [
33078			'<form class="vex-dialog-form">',
33079			(options.title == '') ? '' : [
33080				'<div class="vex-dialog-message">',
33081				'<span class="login-title">',
33082				options.title,
33083				'</span>',
33084				'</div>'
33085			].join(''),
33086			(options.input == '') ? '' : [
33087				'<div class="vex-dialog-input" style="padding-top: 1.5em;">',
33088				options.input,
33089				'</div>'
33090			].join(''),
33091			(options.buttons == '') ? '' : [
33092				'<div class="vex-dialog-buttons">',
33093				options.buttons,
33094				'</div>'
33095			].join(''),
33096			'</form>'
33097		].join(''),
33098		afterOpen: function (vexContent) {
33099			if (typeof options.afterOpen === 'function') {
33100				options.afterOpen(vexContent);
33101			}
33102		}
33103	});
33104}
33105function hexc(colorval) {
33106	var parts = colorval.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
33107	if (typeof parts === 'undefined' || parts === null) {
33108		return;
33109	}
33110	delete (parts[0]);
33111	for (var i = 1; i <= 3; ++i) {
33112		parts[i] = parseInt(parts[i]).toString(16);
33113		if (parts[i].length === 1) {
33114			parts[i] = '0' + parts[i];
33115		}
33116	}
33117	return '#' + parts.join('');
33118}
33119// Scroll to top button content new
33120function js_scroll_top_content_new() {
33121	var enableScrollToTopButton = true;  // pripadne dodefinovanie
33122	if (!enableScrollToTopButton === true) {
33123		return false;
33124	}
33125	var scroll_top_el = jQuery('.scroll_to_top_content_new');
33126
33127	if ( !scroll_top_el.length ) { return; }
33128
33129	scroll_top_el.on('click', function () {
33130		jQuery('html,body').animate({scrollTop: 0}, 300);
33131	});
33132	jQuery(window).on('scroll.to_top',function(){
33133		if (jQuery(window).scrollTop() > 300){
33134			scroll_top_el.fadeIn(200);
33135		}
33136		else {
33137			scroll_top_el.fadeOut(200);
33138		}
33139	}).trigger('scroll.to_top');
33140}
33141
33142jQuery(function() {
33143	js_scroll_top_content_new();
33144
33145	var $themeColorDiv = jQuery("meta[name='theme-color']");
33146	if ( $themeColorDiv.length > 0 && Cookies.get('themeColor') === undefined ) {
33147		var colorDivs = jQuery('#menu_div, #header, .button:first');
33148		colorDivs.each(function (key, item) {
33149			item = jQuery(item);
33150
33151			if (typeof item !== 'undefined') {
33152				var themeColorRgb = item.css('background-color');
33153
33154				if (typeof themeColorRgb !== 'undefined' && themeColorRgb !== '') {
33155					var themeColorHex = hexc(themeColorRgb);
33156
33157					if ( typeof themeColorHex !== 'undefined' ) {
33158						Cookies.set('themeColor', themeColorHex, { path: '/' });
33159
33160						$themeColorDiv.attr('content', themeColorHex);
33161						jQuery("meta[name='msapplication-navbutton-color']").attr('content', themeColorHex);
33162
33163						return false;
33164					}
33165				}
33166			}
33167		});
33168	}
33169
33170	if (typeof js_config_enable_article_modal === 'boolean' && js_config_enable_article_modal){
33171		jQuery(document).on('click', 'a[rel="vex"]', function(event) {
33172			event.preventDefault();
33173
33174			var $me = jQuery(this);
33175
33176			jQuery.ajax({
33177				url: $me.attr('href'),
33178				method: 'GET',
33179				success: function(data) {
33180					var content = jQuery(data).find('#middle_content_inner');
33181
33182					if (content.length > 0 && content.text().trim() !== '') {
33183
33184						js_function_vex_open({
33185							input: content.html(),
33186							afterOpen: function(vexContent) {
33187								vexContent.css({
33188									width: '95%',
33189									maxWidth: '1200px'
33190
33191								}).closest('.vex').addClass('flypage_vex');
33192							}
33193						});
33194
33195					} else {
33196						window.location.href = $me.attr('href');
33197					}
33198				}
33199			});
33200
33201			return false;
33202		});
33203	}
33204});
33205
33206function jf_translate_textarea(elem, lang, source_elem, dest_elem) {
33207
33208	//google cloud translation
33209	if(typeof js_Config_google_cloud_translation_in_administration !== 'undefined' && js_Config_google_cloud_translation_in_administration) {
33210		var elemContainer       = jQuery(elem).parent();
33211		var translateContainer  = elemContainer.parents('fieldset:first');
33212		//ziskame statistiku
33213		new AjaxRequest()
33214			.setMethod('POST')
33215			.setController('Admin')
33216			.setAction('getGoogleTranslationStats')
33217			.onSuccess(function (response) {
33218				if ( typeof js_Config_blog_textarea_translate_button_fix !== 'undefined' && js_Config_blog_textarea_translate_button_fix) {
33219					if (translateContainer.length < 1) {
33220						translateContainer = jQuery(source_elem).parents('.admin_add_content_form');
33221					}
33222				} else {
33223					if (translateContainer.length < 1) {
33224						translateContainer = elemContainer.parent().parent();
33225					}
33226				}
33227
33228				source_elem = translateContainer.find(source_elem);
33229				dest_elem   = translateContainer.find(dest_elem);
33230
33231				//pripravime text pre vex
33232				var vexContent = '<br>'+
33233					'<span style="display:block;width: 360px" >'+
33234					'    <span class="cs_icon csi-bar-chart csi_c_black" style="font-size: 19px"></span>'+
33235					'    <span style="font-weight: bold; font-size:19px; text-transform: uppercase;">'+cms_js_lang_admin_google_cloud_label_1+'</span>'+
33236					'</span>'+
33237					'<br>'+
33238					'<br>'+
33239					'<table style="text-align: center;border-collapse: collapse;">'+
33240					'    <tr style="border-bottom: 1px solid #8e8e8e">'+
33241					'        <th style="padding: 5px 30px">'+cms_js_lang_admin_google_cloud_label_2+'</th>'+
33242					'        <th style="padding: 5px 30px;">'+cms_js_lang_admin_google_cloud_label_3+'</th>'+
33243					'        <th style="padding: 5px 30px;">'+cms_js_lang_admin_google_cloud_label_4+'*</th>'+
33244					'    </tr>';
33245
33246				//statistiky za posledne 3 mesiace
33247				if (typeof response.data.statistic !== 'undefined' && Object.keys(response.data.statistic).length) {
33248					jQuery.each(response.data.statistic, function(i,v){
33249						vexContent += '<tr style="border-top: 1px solid #8e8e8e">'+
33250							'    <td style="padding: 5px 30px">
33250'+v.year+'</td>'+
33251							'    <td style="padding: 5px 30px;">'+v.month+'</td>'+
33252							'    <td style="padding: 5px 30px;text-align: right;">'+parseFloat(v.count).toLocaleString()+'</td>'+
33253							'</tr>';
33254					});
33255				} else {
33256					var currentDate = new Date();
33257					vexContent += '<tr style="border-top: 1px solid #8e8e8e">'+
33258						'    <td style="padding: 5px 30px">'+currentDate.getFullYear()+'</td>'+
33259						'    <td style="padding: 5px 30px;">'+(currentDate.getMonth() + 1)+'</td>'+
33260						'    <td style="padding: 5px 30px;text-align: right;">0</td>'+
33261						'</tr>';
33262				}
33263
33264				//vyzva na preklad
33265				vexContent += '</table>'+
33266					'<br>'+
33267					'<span style="width: 350px;display:block;">'+
33268					'    <i>* '+cms_js_lang_admin_google_cloud_label_5+'</i>'+
33269					'</span>'+
33270					'<br>'+
33271					'<br>'+
33272					'<span style="font-size: 19px;width: 360px;display:block;">'+
33273						cms_js_lang_admin_google_cloud_label_6+' <span style="font-weight: bold">'+parseFloat(source_elem.val().length).toLocaleString()+'</span> '+cms_js_lang_admin_google_cloud_label_7+
33274					'</span>'+
33275					'<img style="padding:10px 0px;" src="/components/com_joomfish/images/translated-by-google.svg">';
33276
33277
33278				//otvorime vex
33279				vex.dialog.confirm({
33280					className: 'vex-cs',
33281					message: '<span style="font-weight: bold">'+cms_js_lang_admin_google_cloud_label_8+'</span> (Cloud Translation API)',
33282					input: vexContent,
33283					buttons: [
33284						jQuery.extend({}, vex.dialog.buttons.NO, {text: cms_js_lang_products_group_3}),
33285						jQuery.extend({}, vex.dialog.buttons.YES, {
33286							text: cms_js_lang_admin_google_cloud_label_9,
33287							click: function() {
33288
33289								if (typeof source_elem.val() !== 'undefined') {
33290									//zavolame preklad
33291									new AjaxRequest({"text": source_elem.val(), "from": js_curr_lang, "to": lang})
33292										.setMethod('POST')
33293										.setController('Admin')
33294										.setAction('getGoogleTranslation')
33295										.onSuccess(function (response) {
33296											//prelozeny text umiestnime do textarea / inputu
33297											if (typeof response.data.translation !== 'undefined') {
33298												dest_elem.val(response.data.translation);
33299											}
33300										})
33301										.send();
33302								}
33303							}
33304						})
33305					]
33306				});
33307
33308			})
33309			.send();
33310
33311		return false;
33312	}
33313
33314
33315	vex.dialog.alert({
33316		className: 'vex-cs',
33317		message: '',
33318		input: 'Externá bezplatná služba na prekladanie textov je aktuálne nedostupná.<br>Použite manuálny a bezplatný režim pomocou: <a href="https://translate.google.com/">translate.google.com</a><br><br>V prípade záujmu existuje alternatívna možnosť implementácie spoplatnenej Google Translate API.',
33319		buttons: [
33320			jQuery.extend({}, vex.dialog.buttons.NO, {text: cms_js_lang_products_group_3}),
33321			jQuery.extend({}, vex.dialog.buttons.YES, {
33322				text: 'Mám záujem o alternatívu',
33323				click: function(elm) {
33324					window.open('mailto:[email protected]?subject=' + encodeURI('Máme záujem o preklady cez Google Translate API') + '&body=' + encodeURI('Dobrý deň,\n\nmáme záujem o preklady cez Google Translate API pre https://' + js_global_main_domain + '\n\nĎakujeme :-)'));
33325				}
33326			})
33327		]
33328	});
33329
33330	return false;
33331}
33332
33333function js_admin_translate_content_save(elem) {
33334	elem = jQuery(elem);
33335
33336	var translate_html = js_make_clean_translated_value( elem.parents('.vex-content:first').find('.translate_html').html() );
33337	var dest_elem = jQuery('.t-data').data('dest_elem');
33338
33339	dest_elem.val(translate_html);
33340	vex.close();
33341
33342	return false;
33343}
33344
33345
33346
33347function js_make_clean_translated_value(ret) {
33348	if (typeof(ret) != 'undefined' && ret != null && ret.length > 0)
33349		return ret.replace(/\<\/?font\s*[^\>]*\>/gi, '');
33350// 		return ret.replace(/<font>/gi, '').replace(/<\/font>/gi, '').replace(/<font class="">/gi, '');
33351
33352	return '';
33353}
33354
33355function js_check_input_sef_name(container, input_name) {
33356	//if (typeof(console) != 'undefined') console.log('input_name',input_name);
33357	container = jQuery(container);
33358	input_elem = container.children().find('input[name='+input_name+']');
33359	var sef_value = input_elem.val().replace(/\/{2,}/g, '/').split('/');
33360
33361	//if (typeof(console) != 'undefined') console.log('sef_value', sef_value);
33362
33363	var options = { 'sef_name': sef_value };
33364
33365	jQuery.post(js_global_live_site+'/administrator/components/com_shop/html/frontend.edit_category.php?option=com_shop&ajax_call=1&ajax_func=make_sef_name&no_html=1&no_vm_html=1&no_menu=1&no_css=1', options, function (res) {
33366		//if (typeof(console) != 'undefined') console.log('make_sef_name', input_elem, res);
33367
33368		if (res == '0') {
33369			//alert('ERR: system_functions.js > fcia js_check_input_sef_name()');
33370			return;
33371		}
33372
33373		input_elem.val( res );
33374	});
33375}
33376
33377function js_bindQQFileUploader( json_params, json_ret_info ) {
33378	//	'element_id': file_upload_selector_container-mosCreateGUID()
33379	//	'action': '/administrator/components/com_shop/html/frontend.edit_category.php'
33380	//	'params': { 'option': 'com_shop', 'ajax_call': '1', 'ajax_func': 'upload_category_full_image', 'no_html': '1', 'no_vm_html': '1', 'no_menu': '1', 'no_css': '1', 'category_id': < ? php echo $req_category_id; ? > }
33381	//	'allowedExtensions': ['jpg', 'jpeg', 'png', 'gif'],
33382	//	'onComplete': function( id, fileName, json_res )
33383	ret = false;
33384	if (js_is_valid_json(json_params, {'element_id': null, 'action': null, 'params': null, 'onComplete': null})) {
33385		var element_id = json_params.element_id;
33386		var jqo_element = jQuery('#'+element_id);
33387		if (jqo_element.length == 1) {
33388			var jso_element = jqo_element.get(0);
33389			if (jso_element) {
33390				var uploader = new qq.FileUploader({
33391					element: jso_element,
33392					action: json_params.action,
33393					allowedExtensions: (typeof(json_params.allowedExtensions) != 'undefined' && json_params.allowedExtensions ? json_params.allowedExtensions : ['jpg', 'jpeg', 'png', 'gif']),
33394					params: json_params.params,
33395					onSubmit: function( id, fileName ) {
33396						jqo_element.find('.qq-upload-list li').remove();
33397					},
33398					onComplete: json_params.onComplete,
33399					debug: 0 && js_global_is_csu,
33400					multiple: (typeof(json_params.multiple) != 'undefined' && json_params.multiple ? json_params.multiple : false)
33401				});
33402
33403				if (1 || js_global_is_csu) {
33404					if (typeof(console) != 'undefined') console.log('GREDXuploader:',uploader);
33405				}
33406
33407				setTimeout("jQuery('.full_img_container #"+element_id+"').find('.qq-upload-button').css('left','0px');", 500);
33408				if (json_ret_info != null && typeof(json_ret_info) == 'object') {
33409					json_ret_info.result = ret;
33410				}
33411				ret = true;
33412			} else {
33413				if (json_ret_info != null && typeof(json_ret_info) == 'object') {
33414					json_ret_info.result = ret;
33415					json_ret_info.msg = 'jso_element is: null';
33416				}
33417			}
33418		} else {
33419			if (json_ret_info != null && typeof(json_ret_info) == 'object') {
33420				json_ret_info.result = ret;
33421				json_ret_info.msg = 'jqo_element.length is: '+jqo_element.length;
33422			}
33423		}
33424	} else {
33425		if (json_ret_info != null && typeof(json_ret_info) == 'object') {
33426			json_ret_info.result = ret;
33427			json_ret_info.msg = 'js_is_valid_json(json_params) is: false';
33428		}
33429	}
33430	return ret;
33431}
33432
33433function js_get_editor_templates() {
33434	var result = [];
33435
33436	if (typeof ckeditor_custom_tmp == 'undefined' || ckeditor_custom_tmp == 0) return result;
33437
33438	jQuery.ajax({
33439		url: js_global_live_site + '/public_scripts_M4r7ft/global_scripts/product_actions.php?',
33440		method: 'POST',
33441		data: {
33442			option: 'com_shop',
33443			ajax_call: 1,
33444			ajax_func: 'get_editor_templates',
33445			no_html: 1,
33446			no_vm_html: 1,
33447			no_menu: 1,
33448			no_css: 1
33449		},
33450		async: false,
33451		success: function (res) {
33452			result = JSON.parse(res);
33453		}
33454	});
33455	return result;
33456}
33457
33458function admin_panel_cke_post_init( textarea_name ) {
33459    //	spolocne volana funkcia, po zobrazeni ckeditora
33460    if (typeof js_dont_use_ckeditor_4_5_0 === 'undefined') {
33461    	js_bind_jwmmxtd_on_cke_containers2(textarea_name);
33462    } else {
33463	    js_bind_jwmmxtd_on_cke_containers(textarea_name);
33464    }
33465}
33466
33467function js_bind_jwmmxtd_on_cke_containers( textarea_name ) {
33468	//	pri zadanom textarea_name prida prislusnej arei tlacitko na start jwmmxtd
33469	//	inak existujucim aream s ck-editorom prida tlacitko na start jwmmxtd
33470
33471	// JAN, 3.10.2016 toto nie je dobre Quickfix, treba to poriesit inak
33472	return false;
33473
33474	if (typeof(js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb) === 'undefined') js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb = 0;
33475	var container_selector = (textarea_name != null) ? ('span#cke_'+textarea_name+'.cke_editor_'+textarea_name) : ('span[id^="cke_"][class^="cke_"]');
33476
33477	if (jQuery(container_selector+':first').length == 0) {
33478		js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb = js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb + 1;
33479		if (js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb < 21) setTimeout('js_bind_jwmmxtd_on_cke_containers('+((textarea_name != null) ? ('"'+textarea_name+'"') : '')+');', 250);	//	timeout 5 sec.
33480		return false;
33481	}
33482
33483	jQuery(container_selector).each(function (idx, jso) {
33484		var jqo = jQuery(jso);
33485		if (jQuery('textarea#'+jqo.attr('id').substr(4)+', textarea[name="'+jqo.attr('id').substr(4)+'"]').length > 0 && jqo.find('a.'+jqo.attr('id')+'_jwmmxtd').length == 0) {
33486			var jqo_cke_toolgroup = jQuery('span#'+jqo.attr('id')+' span.cke_toolbar span.cke_toolgroup span.cke_button a.cke_button_image:first').parents('span.cke_toolgroup:first');
33487			jqo_cke_toolgroup.append('<span class="cke_button"><a href="/administrator/index2.php?option=com_media&jwmmxtd_template_refresh=1&iframe=true&width=1040&height=700" class="cke_off cke_button_jwmmxtd '+jqo.attr('id')+'_jwmmxtd" title="'+cms_adminlang_mod_fullmenu_swe_mediamanag+'"><span class="cke_icon">&nbsp;</span><span class="cke_label">'+cms_adminlang_mod_fullmenu_swe_mediamanag+'</span></a></span>');
33488			jqo_cke_toolgroup.find('span.cke_button a.cke_button_jwmmxtd:first').prettyPhoto({
33489				'show_title':false,
33490				'allow_resize':false,
33491				'modal':true,
33492				'theme':'facebook',
33493				changepicturecallback: function() {
33494				jQuery('body > .pp_pic_holder:last').css('z-index', '10002');	//	kvoli poshytipu.. bleee
33495				var jqo_pp_full_res = jQuery('body > .pp_pic_holder:last #pp_full_res:first');
33496				if (jqo_pp_full_res && jqo_pp_full_res.length > 0) {
33497					jqo_pp_full_res.find('iframe').attr('width', parseInt(jqo_pp_full_res.find('iframe').attr('width')) - 10);
33498					jqo_pp_full_res.append('<div class="cs_prettyphoto_close"><a href="#" onclick="return js_prettyphoto_close();" title="'+cms_js_lang_close+'"><img src="/includes/js/jquery/prettyphoto/images/closelabel.png" alt="X"/></a></div>');
33499				}
33500				  jQuery(document).on('keyup', function(event) {
33501					if ( event.keyCode == 27 ) {
33502
33503					  if ( in_tooltip == 1 ) {
33504						js_product_special_groups_closed( in_tooltip );
33505					  }
33506					  else {
33507						js_prettyphoto_close();
33508					  }
33509					}
33510				  });
33511				}
33512			  });
33513		}
33514	});
33515	js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb = 0;
33516	return true;
33517}
33518
33519function js_bind_jwmmxtd_on_cke_containers2( textarea_name ) {
33520	if (typeof(js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb) === 'undefined')
33521		js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb = 0;
33522
33523	var container_selector = (textarea_name != null) ? ('div#cke_'+textarea_name+'.cke_editor_'+textarea_name) : ('div[id^="cke_"][class^="cke_"]');
33524
33525// 	console.log(container_selector);
33526
33527	if (jQuery(container_selector+':first').length == 0) {
33528		js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb = js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb + 1;
33529		if (js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb < 21) setTimeout('js_bind_jwmmxtd_on_cke_containers('+((textarea_name != null) ? ('"'+textarea_name+'"') : '')+');', 250);	//	timeout 5 sec.
33530		return false;
33531	}
33532
33533	jQuery(container_selector).each(function (idx, jso) {
33534		var jqo = jQuery(jso);
33535		if (jQuery('textarea#'+jqo.attr('id').substr(4)+', textarea[name="'+jqo.attr('id').substr(4)+'"]').length > 0 && jqo.find('a.'+jqo.attr('id')+'_jwmmxtd').length == 0) {
33536			var jqo_cke_toolgroup = jQuery('div#'+jqo.attr('id')+' span.cke_toolbar span.cke_toolgroup a.cke_button__image:first').parents('span.cke_toolgroup:first');
33537
33538			if ( typeof js_Config_ckeditor_v4_19 != 'undefined' && js_Config_ckeditor_v4_19 ) {
33539				jqo_cke_toolgroup.append('<a href="/administrator/index2.php?option=com_media&jwmmxtd_template_refresh=0" target="_blank" class="cke_button cke_button_off cke_button_jwmmxtd '+jqo.attr('id')+'_jwmmxtd" title="'+cms_adminlang_mod_fullmenu_swe_mediamanag+'"><span class="cke_button_icon cke_button__button_icon">&nbsp;</span><span class="cke_button_label">'+cms_adminlang_mod_fullmenu_swe_mediamanag+'</span></a>');
33540			} else {
33541				jqo_cke_toolgroup.append('<a href="/administrator/index2.php?option=com_media&jwmmxtd_template_refresh=0" target="_blank" class="cke_button cke_button_off cke_button_jwmmxtd '+jqo.attr('id')+'_jwmmxtd" title="'+cms_adminlang_mod_fullmenu_swe_mediamanag+'"><span class="cke_button_icon">&nbsp;</span><span class="cke_button_label">'+cms_adminlang_mod_fullmenu_swe_mediamanag+'</span></a>');
33542
33543			}
33544
33545		}
33546	});
33547	js_internal_counter_f0b7de8b3a88b0788aa6b348ac4ebbeb = 0;
33548	return true;
33549}
33550
33551function js_strip_alowed_tags(input, allowed) {
33552    allowed = (((allowed || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)
33553    var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,
33554        commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
33555    return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
33556        return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
33557    });
33558}
33559
33560function js_strip_tags(input) {
33561    var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,
33562        commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
33563    return input.replace(commentsAndPhpTags, '').replace(tags, '');
33564}
33565
33566function jsGetJSON( json_text, required_vars ) {
33567	//	funkcia vrati JSON object zo stringovej formy (json_encode)
33568	//	v pripade ze required_vars je pole (nazvov premennych), musi objekt obsahovat tieto premenne
33569	//	chyby su osetrene, v pripade chyby vracia null
33570	var ret = null;
33571	if (json_text > '') {
33572		try {
33573			eval('ret = ' + json_text + ';');
33574			if (ret != null && required_vars != null) {
33575				jQuery.each(required_vars, function (i, u) {
33576					if (typeof(ret[u]) == 'undefined') {
33577						ret = null;
33578						return false;
33579					}
33580					return true;
33581				});
33582			}
33583		} catch( jso_err ) {
33584			ret = null;
33585		}
33586	}
33587	return ret;
33588}
33589
33590function js_module_edit_categ_list_click(elem) {
33591	elem = jQuery(elem);
33592
33593	if (elem.find('option:selected').length)
33594		elem.parents('.module_display_list_categories:first').find('.module_prod_show_container input, .module_prod_show_container label').fadeIn(300);
33595	else
33596		elem.parents('.module_display_list_categories:first').find('.module_prod_show_container input, .module_prod_show_container label').fadeOut(300);
33597}
33598
33599function is_valid_email(email) {
33600	//return !(email == '' || /^[\w\.\-]+@\w+[\w\.\-]*?\.\w{1,}$/i.exec(email) == null );
33601	var re = new RegExp('^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,63}$');
33602	return re.test(email);
33603}
33604
33605/**
33606 * Validates whether phoneNumber contains only allowed characters
33607 * @param phoneNumber {String}
33608 * @returns {boolean}
33609 */
33610function is_valid_phone_number(phoneNumber) {
33611	if ( is_cs_user('new_phone_validation') && typeof js_CS_Config_new_phone_validation !== 'undefined' && js_CS_Config_new_phone_validation ) {
33612		if ( typeof phoneNumber === 'undefined' || phoneNumber == '' ) return false;
33613
33614		return RegExp('^[+]*[-0-9\s–\/]+$').test(phoneNumber); // 15 povolenych znakov: 0-9, +, [space], /, -, –
33615
33616	} else {
33617		if ( typeof phoneNumber === 'undefined' || phoneNumber == '' ) return false;
33618
33619		return !RegExp(/[^-–\/+\s0-9]/g).test(phoneNumber); // 15 povolenych znakov: 0-9, +, [space], /, -, –
33620	}
33621}
33622
33623/**
33624 * Validates whether phoneNumber is of correct length (at least 6 digits)
33625 * @param phoneNumber {String}
33626 * @param length {Number}
33627 * @returns {boolean}
33628 */
33629function is_correct_length_phone_number(phoneNumber, length) {
33630	if ( typeof phoneNumber === 'undefined' || phoneNumber == '' ) { return false; }
33631
33632	var matches = phoneNumber.match(/[0-9]/g);
33633
33634	if (matches === null) { return false; }
33635
33636	return matches.length >= (length || 6);
33637}
33638
33639// CENY
33640function js_remove_right_zeros( price ) {
33641	price = price.toString();
33642
33643	if ( price.indexOf('.') == -1 ) {
33644		return price;
33645	}
33646
33647	var zero_index = -1;
33648
33649	for ( var i = price.length - 1; i >= 0; i-- ) {
33650
33651		if ( price[i] != '0' ) {
33652			break;
33653		}
33654
33655		zero_index = i;
33656	}
33657
33658	if ( zero_index == -1 ) {
33659		return price;
33660	}
33661
33662	price = price.substr(0, zero_index);
33663
33664	if ( price.substr(-1) == '.' ) {
33665		price = price.substr(0, price.length - 1);
33666	}
33667
33668	return price;
33669}
33670
33671function js_jq_remove_right_zeros_from_input( input_element ) {
33672	input_element = jQuery(input_element);
33673
33674	input_element.attr('value', js_remove_right_zeros(input_element.val()));
33675}
33676
33677function js_remove_not_numeric(elem) {
33678	var e = jQuery(elem);
33679	var r = /\.[0-9]{0,}[.,]/;
33680	while (r.test(e.val())) e.val(e.val().substr(0, e.val().length - 1));
33681
33682	r = /\,/;
33683	e.val(e.val().replace(r, '.'));
33684	e.val(e.val().replace(/(?!^)[\+\-]/g, ''));
33685
33686	r = /[^0-9\.\+\-]/g;
33687	e.val(e.val().replace(r, ''));
33688
33689	r = /[0-9]/;
33690	if (!r.test(e.val())) e.val('');
33691}
33692
33693function js_set_element_changed(elem) {
33694	jQuery(elem).addClass('elem_changed');
33695}
33696
33697
33698function js_jq_update_price_gross( jqo_price_net, jqo_tax_rate, jqo_price_gross, decimals, remove ) {
33699	remove = typeof remove !== 'undefined' ? remove : true;
33700	decimals = typeof decimals !== 'undefined' ? parseInt(decimals) : 2;
33701
33702	var rates = (typeof _product !== 'undefined' ? _product.options.tax_rates : 0);
33703
33704	if( jqo_price_net.val() != '' ) {
33705
33706		js_remove_not_numeric(jqo_price_net);
33707
33708		var grossValue = jqo_price_net.val();
33709
33710		var taxRate;
33711		if (typeof(jqo_tax_rate) != 'object')
33712			taxRate = parseFloat(jqo_tax_rate);
33713		else
33714			taxRate = rates[jqo_tax_rate.val()];
33715
33716		if ( typeof js_Config_VM_direct_prices_editing_for_shopper_group !== "undefined" ) {
33717			$tmp_sgp = jqo_price_net.parents('.pp_other_price_content').find('select.pp_op_shopper_group_select option:selected').val();
33718
33719			if (typeof js_Config_VM_direct_prices_editing_for_shopper_group !== "undefined" && typeof js_Config_VM_direct_prices_editing_for_shopper_group[$tmp_sgp] !== "undefined" && js_Config_VM_direct_prices_editing_for_shopper_group[$tmp_sgp].dph !== '') {
33720				taxRate = parseFloat(js_Config_VM_direct_prices_editing_for_shopper_group[$tmp_sgp].dph);
33721			}
33722		}
33723
33724		if (taxRate > 0) grossValue = grossValue * (taxRate + 1);
33725
33726		var price = doRound(grossValue, decimals);
33727
33728		price = remove ? js_remove_right_zeros(price) : parseFloat(price).toFixed(decimals);
33729
33730		if (grossValue == '') {
33731			jqo_price_gross.val('');
33732		} else {
33733			jqo_price_gross.val(price);
33734		}
33735
33736		var cn = jqo_price_net['0'].className;
33737		var ppsgid = jqo_price_net.parents('.pp_other_price_content').find('.pp_op_shopper_group_select').val();
33738		var sgdis = 1 - ((typeof(phsg) != 'undefined' && ppsgid != 0 ? phsg[ppsgid] : 0) / 100);
33739		//JANB fixnutie 07-04-2020 zlý prepočet sumy .. bude to treba skontrolovať !!!
33740		var phcena = jqo_price_net.val() * sgdis * (1 + taxRate);
33741
33742		if (phcena % 1 == 0) phcena = phcena;
33743		else phcena = phcena.toFixed(2);
33744
33745		if (cn.indexOf('product_price_input') > -1) {
33746
33747			if ( grossValue == '' ) {
33748				jqo_price_net.parents('.pp_other_price_content').find('.product_price_incl_tax_dis').val('');
33749			} else {
33750				jqo_price_net.parents('.pp_other_price_content').find('.product_price_incl_tax_dis').val(phcena);
33751			}
33752		}
33753	}
33754}
33755
33756function js_jq_updateOldPriceGross(product_id, event, price_net_jq_selector, price_gross_jq_selector) {
33757	if (event && (event.keyCode == 9 || event.keyCode == 13 || (event.keyCode > 34 && event.keyCode < 41))) {
33758		return;
33759	}
33760
33761	let jqo_price_net = jQuery(price_net_jq_selector != null && price_net_jq_selector != '' ? price_net_jq_selector : `.product_old_price_input_${product_id}`);
33762	let jqo_tax_rate = jQuery(`.product_tax_select_${product_id}`);
33763	let jqo_price_gross = jQuery(price_gross_jq_selector != null && price_gross_jq_selector != '' ? price_gross_jq_selector : `.product_old_price_incl_vat_input_${product_id}`);
33764
33765	if (jqo_price_net.length == 0 || jqo_tax_rate.length == 0 || jqo_price_gross == 0) {
33766		return;
33767	}
33768
33769	js_jq_update_price_gross(jqo_price_net, jqo_tax_rate, jqo_price_gross);
33770}
33771
33772function js_jq_updateGross( product_id, event, price_net_jq_selector, price_gross_jq_selector ) {
33773	if (event && (event.keyCode==9 || event.keyCode==13 || (event.keyCode>34 && event.keyCode<41))) return;
33774	jqo_price_net = jQuery((price_net_jq_selector != null && price_net_jq_selector != '') ? price_net_jq_selector : ('.product_price_input_'+product_id));
33775	jqo_tax_rate = jQuery('.product_tax_select_'+product_id);
33776	jqo_price_gross = jQuery((price_gross_jq_selector != null && price_gross_jq_selector != '') ? price_gross_jq_selector : ('.product_price_incl_tax_input_'+product_id));
33777	if (typeof event != 'undefined' && typeof event.keyCode != 'undefined') js_set_element_changed(jqo_price_net);
33778
33779	js_jq_update_price_gross( jqo_price_net, jqo_tax_rate, jqo_price_gross );
33780}
33781
33782function js_jq_updateOtherPricesGross( product_id ) {
33783	var jq_list = jQuery('.pp_info_container [name="pp_value_wo_tax\[\]"]');
33784	if (jq_list && jq_list.length > 0) {
33785		var jqo_tax_rate = jQuery('.product_tax_select_'+product_id);
33786		jq_list.each(function () {
33787			var jqo_price_net = jQuery(this);
33788			var jqo_price_gross = jqo_price_net.parents('.pp_info_container:first').find('input[name="pp_value_w_tax\[\]"]:first');
33789			js_jq_update_price_gross(jqo_price_net, jqo_tax_rate, jqo_price_gross);
33790		});
33791	}
33792}
33793
33794function js_jq_updatePurchasePriceGross( product_id, event ) {
33795	if (event && (event.keyCode==9 || event.keyCode==13 || (event.keyCode>34 && event.keyCode<41))) return;
33796
33797	jqo_price_net = jQuery('.product_purchase_price_input_'+product_id);
33798	jqo_tax_rate = jQuery('.product_tax_select_'+product_id);
33799	jqo_price_gross = jQuery('.product_purchase_price_incl_vat_input_'+product_id);
33800
33801	if ( jqo_price_net.length == 0 || jqo_tax_rate.length == 0 || jqo_price_gross == 0 ) {
33802		return;
33803	}
33804
33805	js_jq_update_price_gross( jqo_price_net, jqo_tax_rate, jqo_price_gross );
33806}
33807
33808function js_jq_update_price_net( jqo_price_net, jqo_tax_rate, jqo_price_gross, decimals, remove ) {
33809	remove = typeof remove !== 'undefined' ? remove : true;
33810	decimals = typeof decimals !== 'undefined' ? parseInt(decimals) : 5;
33811
33812	var rates = (typeof _product !== 'undefined' ? _product.options.tax_rates : (typeof _order !== 'undefined' ? _order.options.tax_rates : tax_rates));
33813
33814	js_remove_not_numeric(jqo_price_gross);
33815	js_set_element_changed(jqo_price_gross);
33816
33817	var netValue = jqo_price_gross.val();
33818	if (typeof (jqo_tax_rate) != 'object') {
33819		var taxRate = parseFloat(jqo_tax_rate);
33820	} else
33821		var taxRate = rates[jqo_tax_rate.val()];
33822
33823	if ( typeof js_Config_VM_direct_prices_editing_for_shopper_group !== "undefined" ) {
33824		$tmp_sgp = jqo_price_net.parents('.pp_other_price_content').find('select.pp_op_shopper_group_select option:selected').val();
33825
33826		if (typeof js_Config_VM_direct_prices_editing_for_shopper_group !== "undefined" && typeof js_Config_VM_direct_prices_editing_for_shopper_group[$tmp_sgp] !== "undefined" && js_Config_VM_direct_prices_editing_for_shopper_group[$tmp_sgp].dph !== '') {
33827			taxRate = parseFloat(js_Config_VM_direct_prices_editing_for_shopper_group[$tmp_sgp].dph);
33828		}
33829	}
33830	if (taxRate > 0) {
33831		netValue = netValue / (taxRate + 1);
33832	}
33833	var price = doRound(netValue, decimals);
33834	price     = remove ? js_remove_right_zeros(price) : parseFloat(price).toFixed(decimals);
33835
33836	if ( netValue == '' ) {
33837		jqo_price_net.val('');
33838	} else {
33839		jqo_price_net.val(price);
33840	}
33841
33842	var cn = jqo_price_net['0'].className;
33843	var ppsgid = jqo_price_net.parents('.pp_other_price_content').find('.pp_op_shopper_group_select').val();
33844	var sgdis = 1 - ((typeof(phsg) != 'undefined' && ppsgid != 0 ? phsg[ppsgid] : 0) / 100);
33845	//JANB fix 07-02-2020 zlý prepočet potrebné poriadne skontrolovať !!!
33846	var phcena = jqo_price_net.val() * sgdis * (taxRate + 1);
33847
33848	if (phcena % 1 == 0) {
33849		phcena = phcena;
33850	} else phcena = phcena.toFixed(2);
33851
33852	if (cn.indexOf('product_price_input') > -1) {
33853
33854		if ( netValue == '' ) {
33855			jqo_price_net.parents('.pp_other_price_content').find('.product_price_incl_tax_dis').val('');
33856		} else {
33857			jqo_price_net.parents('.pp_other_price_content').find('.product_price_incl_tax_dis').val(phcena);
33858		}
33859	}
33860}
33861
33862function js_jq_updateOldPriceNet( product_id, event ) {
33863	if (event && (event.keyCode==9 || event.keyCode==13 || (event.keyCode>34 && event.keyCode<41))) return;
33864	jqo_price_net = jQuery('.product_old_price_input_'+product_id);
33865	jqo_tax_rate = jQuery('.product_tax_select_'+product_id);
33866	jqo_price_gross = jQuery('.product_old_price_incl_vat_input_'+product_id);
33867
33868	if ( jqo_price_net.length == 0 || jqo_tax_rate.length == 0 || jqo_price_gross == 0 ) {
33869		return;
33870	}
33871
33872	js_jq_update_price_net( jqo_price_net, jqo_tax_rate, jqo_price_gross );
33873}
33874
33875function js_jq_updateNet( product_id, event, price_net_jq_selector, price_gross_jq_selector ) {
33876	if (event && (event.keyCode==9 || event.keyCode==13 || (event.keyCode>34 && event.keyCode<41))) return;
33877	jqo_price_net = jQuery((price_net_jq_selector != null && price_net_jq_selector != '') ? price_net_jq_selector : ('.product_price_input_'+product_id));
33878	jqo_tax_rate = jQuery('.product_tax_select_'+product_id);
33879	jqo_price_gross = jQuery((price_gross_jq_selector != null && price_gross_jq_selector != '') ? price_gross_jq_selector : ('.product_price_incl_tax_input_'+product_id));
33880
33881	js_jq_update_price_net( jqo_price_net, jqo_tax_rate, jqo_price_gross );
33882}
33883
33884function js_jq_updatePurchasePriceNet( product_id, event ) {
33885	if (event && (event.keyCode==9 || event.keyCode==13 || (event.keyCode>34 && event.keyCode<41))) return;
33886	jqo_price_net = jQuery('.product_purchase_price_input_'+product_id);
33887	jqo_tax_rate = jQuery('.product_tax_select_'+product_id);
33888	jqo_price_gross = jQuery('.product_purchase_price_incl_vat_input_'+product_id);
33889
33890	if ( jqo_price_net.length == 0 || jqo_tax_rate.length == 0 || jqo_price_gross == 0 ) {
33891		return;
33892	}
33893
33894	js_jq_update_price_net( jqo_price_net, jqo_tax_rate, jqo_price_gross );
33895}
33896
33897function js_parse_float( num ) {
33898	var ret = ''+num;
33899	if (ret.indexOf(',') > -1) {
33900		ret = ret.replace(/\./g, '').replace(/,/g, '.');
33901	}
33902	ret = parseFloat(ret.replace(/ /g, ''));
33903	if (isNaN(ret)) {
33904		ret = 0;
33905	}
33906	return ret;
33907}
33908
33909function apiRequest(trigger, params, callback, onetime) {
33910	if ( typeof isApiActive === 'undefined' || !isApiActive || typeof activeApiTriggers === 'undefined' || activeApiTriggers.indexOf(trigger) == -1 ) {
33911		return false;
33912	}
33913
33914	if (typeof onetime !== 'undefined' && onetime && typeof sessionStorage !== 'undefined') {
33915		var apiKey = 'apiRequest_' + trigger;
33916		var apiStorage = sessionStorage.getItem(apiKey);
33917
33918		apiStorage = apiStorage ? JSON.parse(apiStorage) : [];
33919
33920		// pri novom nacitani local storage zmaz
33921		if (typeof window[apiKey] === 'undefined') {
33922			sessionStorage.removeItem(apiKey);
33923			window[apiKey] = true;
33924			apiStorage = [];
33925		}
33926
33927		for (var x in apiStorage) {
33928			if ( typeof apiStorage[x].params !== 'undefined' && apiStorage[x].params === JSON.stringify(params) ) {
33929				/*if (typeof apiStorage[x].result !== 'undefined') {
33930					eval(apiStorage[x].result);
33931				}
33932
33933				if (typeof callback === 'function') {
33934					callback();
33935				}*/
33936
33937				return;
33938			}
33939		}
33940	}
33941
33942	if (typeof params === 'undefined') {
33943		params = {};
33944	}
33945
33946	// nieco musi byt v params, inac to neposle v requeste
33947	params.isAjax = true;
33948
33949	new AjaxRequest({'trigger': trigger, 'params': params})
33950		.setController('Api')
33951		.setAction('get')
33952		.onSuccess(function (jsonData) {
33953			if( typeof jsonData != 'undefined' && typeof jsonData.data != 'undefined' ){
33954				var res = jsonData.data;
33955
33956				if ( typeof res.jsCode !== 'undefined' ) {
33957					//pokial dostaneme kod wrapnuty v tagoch <script></script> je potrebne ich odstranit kvoli eval()
33958					var cleanJsCode = res.jsCode;
33959					cleanJsCode = cleanJsCode.replace(/<(|\/)script.*?>/gm, ''); //tagy script
33960					cleanJsCode = cleanJsCode.replace(/<!--(.*?)-->/gm, '/*$1*/'); //html koment
33961
33962					if (typeof onetime !== 'undefined' && onetime && typeof sessionStorage !== 'undefined') {
33963						apiStorage.push({
33964							'params': JSON.stringify(params),
33965							//'result': cleanJsCode
33966						});
33967
33968						sessionStorage.setItem(apiKey, JSON.stringify(apiStorage));
33969					}
33970
33971					//eval is evil
33972					eval(cleanJsCode);
33973				}
33974
33975				if (typeof callback === 'function') {
33976					callback();
33977				}
33978			}
33979		})
33980		.send();
33981}
33982
33983/**
33984 *
33985 * @param elem HTMLElement Kliknuty element
33986 * @param productId int
33987 * @param attribute string
33988 * @param action string "+" | "-"
33989 * @param quantity nmber
33990 * @param inputRef HTMLElement<input> input ktoremu sa zmeni mnozstvo podla action
33991 * @oaram cartItemId int ak je definovane odstrani sa variant podla "description" a prida sa "cart_item_id" nutne hlavne pre akciu "-" tam sa to sprava dost zvlastne
33992 * @oaram disableAnimation vypne animaciu
33993 */
33994function simpleAddToCart(elem, productId, attribute, action, quantity, inputRef, cartItemId, disableAnimation, wishlist) {
33995	var jQueryBody = jQuery('body');
33996
33997	if (['+', '-'].indexOf(action) === -1) {
33998		//jQueryBody.trigger('addToCartErrorWrongAction');
33999		console.warn('simpleAddToCart called with wrong action, action should be "+" / "-"');
34000		return false;
34001	}
34002	if (quantity < 1 || typeof quantity !== 'number') {
34003		//jQueryBody.trigger('addToCartErrorWrongQuantity');
34004		console.warn('simpleAddToCart called with wrong quantity, quantity should be more or equal to 1 and valid number');
34005		return false;
34006	}
34007	if (productId < 0 || typeof productId !== 'number') {
34008		//jQueryBody.trigger('addToCartErrorWrongProductId');
34009		console.warn('simpleAddToCart called with wrong productId, productId should be more then 0 and valid number');
34010		return false;
34011	}
34012	if (typeof inputRef !== 'undefined') {
34013		if (action == '-' && inputRef.val() - quantity == 0) {
34014			return false;
34015		}
34016	}
34017
34018	// osetrenie modal pre attiibut
34019	if (typeof tmpAttributeModalInstance !== 'undefined') {
34020		tmpAttributeModalInstance.close();
34021		tmpAttributeModalInstance = undefined;
34022	}
34023
34024	var ajaxUrl     = '/modules/mod_shop_cart_ajax.php';
34025	var ajaxOptions = {
34026		ajax_func           : 'get_ajax_cart',
34027		ajax_cart_product_id: productId,
34028		ajax_cart_action    : action, // +, -
34029		ajax_cart_quantity  : quantity,
34030		is_gift             : false,
34031		is_special_offer    : false,
34032		category_id         : 0
34033	};
34034
34035	if (typeof attribute !== 'undefined' && attribute !== '') {
34036		ajaxOptions.select_name  = 'faadd750a6fbb9ea11a94c6074db79144';
34037		ajaxOptions.select_value = attribute;
34038	}
34039
34040	if (typeof cartItemId !== 'undefined') {
34041		ajaxOptions.cart_item_id = cartItemId;
34042	}
34043
34044	if (config('js_Config_epredplatne_wishlist_compatibility') && typeof wishlist !== 'undefined') {
34045		if (wishlist === 1) {
34046			ajaxOptions.fromWishlist = true;
34047		} else if (wishlist === 2) {
34048			if (typeof attribute !== 'undefined' && attribute !== '') {
34049				ajaxOptions.select_name  = 'f9f243829b48214b20c0a53f6dfe35002';
34050				ajaxOptions.category_id = 3; //Toto este asi upravit nejak dynamicky a pozriet ci je to vobec potrebne
34051			} else {
34052				ajaxOptions.fromWishlist = true;
34053			}
34054		}
34055	}
34056
34057	jQuery.post(ajaxUrl, ajaxOptions, function (res) {
34058		if (res.indexOf('{') === -1) {
34059			jQueryBody.trigger('addToCartErrorNoAttribute');
34060			// nemame attribut ...
34061			console.error('simpleAddToCart called with wrong attribute, attribute should not be empty for produt with attributes');
34062
34063			var tmpButtons = '';
34064			var decodedRes = JSON.parse(decodeURIComponent(res));
34065
34066			tmpButtons = '<div class="vex_cart_quantity">';
34067			// mnozstvo
34068			// tmpButtons += '<input class="inputbox shop-addtocart-quantity-inputbox" type="text" size="3" name="quantity" value="1" onkeyup="(parseInt(this.value)>0)?this.style.borderColor=\'\' : this.style.borderColor=\'red\';">';
34069
34070			tmpButtons += `<div class="quantity_wrapper">
34071				<div class="count_control">
34072					<a class="count_up" onclick="jsChangeProductQuantity(this)" data-parent_selector=".quantity_wrapper" data-input_selector=".inputbox" data-action="add" data-quantity="1"></a>
34073					<a class="count_down" onclick="jsChangeProductQuantity(this)" data-parent_selector=".quantity_wrapper" data-input_selector=".inputbox" data-action="sub" data-quantity="1"></a>
34074				</div>
34075				<input onblur="jsChangeProductQuantity(this)" data-allow_zero_quantity="0" data-parent_selector=".quantity_wrapper" data-input_selector=".inputbox" data-action="set" data-quantity="1" class="inputbox shop-addtocart-quantity-inputbox" type="text" size="5" maxlength="10" value="1" name="quantity" id="quantity">
34076			</div>`;
34077
34078			let attribSelector = '[name=faadd750a6fbb9ea11a94c6074db79144] option:selected';
34079			if (config('js_Config_epredplatne_wishlist_compatibility') && decodedRes.html_variants.includes('f9f243829b48214b20c0a53f6dfe35002')) {
34080				attribSelector = '[name=f9f243829b48214b20c0a53f6dfe35002] option:selected';
34081				var is_epredplatne = true;
34082			}
34083
34084			var quantity = 'parseFloat(jQuery(this).closest(\'.cs_modal_actions\').find(\'input[name=quantity]\').val())';
34085			// pridat do kosika btn
34086			var tmpAttributeSelectedValue = 'jQuery(this).closest(\'.vex-content\').find(\'' + attribSelector + '\').val()'; // toto je podla man zle "vex-content" neexistuje v niektorych pripadoch
34087			// nove rarianty
34088			if ( typeof js_Config_product_variant !== 'undefined' && js_Config_product_variant ) {
34089				tmpAttributeSelectedValue = 'ProductVariantInstance_' + productId + '.getSelectedAttribute().source';
34090			}
34091
34092			if (typeof is_epredplatne !== 'undefined' && is_epredplatne === true) {
34093				tmpButtons += '<input onclick="simpleAddToCart(this, ' + productId + ', ' + tmpAttributeSelectedValue +', \'+\', ' + quantity + ', undefined, undefined, undefined, 2)" type="button" class="button" name="submit" title="" value="' + js_lang_luigibox_addtocart + '">';
34094			} else {
34095				tmpButtons += '<input onclick="simpleAddToCart(this, ' + productId + ', ' + tmpAttributeSelectedValue +', \'+\', ' + quantity + ')" type="button" class="button" name="submit" title="" value="' + js_lang_luigibox_addtocart + '">';
34096			}
34097			tmpButtons += '</div>';
34098
34099			// detail produktu btn
34100			tmpButtons += '<input onclick="window.location=\'' + (decodedRes.product_url || jQuery('.cs_product_item[data-product-id="' + productId + '"] a:first').attr('href') || '') + '\';" type="button" class="vex-dialog-button-secondary vex-dialog-button vex-last button" value="' + (typeof js_shop_flypage_lbl !== 'undefined' ? js_shop_flypage_lbl : '') + '">';
34101
34102			window['tmpAttributeModalInstance'] = new CsModal()
34103				.setType('info')
34104				.setTitle(decodedRes.product_name)
34105				.setContent(decodedRes.html_variants)
34106				.setButtons(tmpButtons)
34107				.setActionsClassName('vex-dialog-buttons')
34108				.afterOpen(function () {
34109					jQueryBody.trigger('addToCartAttributeModalShown', [{
34110						productId: productId
34111					}]);
34112
34113					jQuery('.cs_modal_content_inner .attr_sel_a:first').click();
34114				})
34115				.open();
34116
34117			return false;
34118		}
34119
34120		res = JSON.parse(res);
34121		if (typeof res['update_res']['success'] === 'undefined') {
34122			var ajaxRes     = res['update_res'],
34123			    stripedText = jQuery(ajaxRes).text().replace('\n', '<br>');
34124			if (stripedText) {
34125				jQuery(elem).tooltipster({
34126					theme        : "tooltipster-gdpr",
34127					contentAsHTML: true,
34128					trackTooltip : true,
34129					trackOrigin  : true,
34130					multiple     : false,
34131					timer        : 5000,
34132					trigger      : 'custom',
34133					onlyOne      : false,
34134					content      : stripedText
34135				}).tooltipster('open');
34136			}
34137			return false;
34138		}
34139
34140		if (typeof quantity === 'undefined') {
34141			quantity = 1;
34142		}
34143
34144		if (typeof inputRef !== 'undefined') {
34145			if (action === '+') {
34146				inputRef.val(parseFloat(inputRef.val()) + quantity);
34147			} else {
34148				inputRef.val(parseFloat(inputRef.val()) - quantity);
34149			}
34150		}
34151
34152		jQuery('.moduleCartInfo').html(res['html_cart_values']);
34153		jQuery('.cart_ajax_container').replaceWith(res['html_products']);
34154		//ajax cart fix
34155		jQuery('div.module-cart').removeClass('empty');
34156		jQuery('a.cartLink').removeAttr('onclick');
34157		if (typeof disableAnimation === 'undefined') {
34158			js_cart_image_animate(elem);
34159		}
34160
34161		if (typeof js_product_as_gift_init === 'function') {
34162			js_product_as_gift_init();
34163		}
34164
34165		var cartItemId = null;
34166
34167		if (typeof res.update_res.itemId !== 'undefined') {
34168			cartItemId = res.update_res.itemId;
34169		}
34170
34171		jQueryBody.trigger('addToCartFinished', [{
34172			productId: productId,
34173			attribute: typeof attribute !== 'undefined' ? attribute : '',
34174			action: action,
34175			quantity: quantity,
34176			itemId: cartItemId,
34177		}]);
34178
34179		jQueryBody.trigger('cartUpdated');
34180
34181		if (typeof isApiActive !== 'undefined' && isApiActive) {
34182			var apiAction = action === '+' ? 'addToCart' : 'removeFromCart';
34183			var pageMatch = typeof js_server_request_uri !== 'undefined' ? js_server_request_uri.match(/(&|;|\?)page\=([^&]+)/) : undefined;
34184			var manMatch  = typeof js_server_request_uri !== 'undefined' ? js_server_request_uri.match(/(&|;|\?)pc_manufacturer_id\=([^&]+)/) : undefined;
34185			var page      = '';
34186			if (typeof manMatch === 'object' && manMatch !== null) {
34187				page = 'manufacturer';
34188			} else if (typeof pageMatch === 'object' && pageMatch !== null && typeof pageMatch[2] !== 'undefined') {
34189				page = pageMatch[2];
34190			}
34191			apiRequest(apiAction, {
34192				'products': [{
34193					'product_id' : productId,
34194					'quantity'   : quantity,
34195					'description': typeof attribute !== 'undefined' ? attribute : '',
34196					'idx'        : ''
34197				}],
34198				'page'    : page,
34199				'isAjax'  : true
34200			});
34201		}
34202
34203		return false;
34204	});
34205
34206	return false;
34207}
34208
34209function js_shopcart_submit(elem) {
34210	if (typeof js_shopcart_submit_custom != 'undefined') {
34211		return js_shopcart_submit_custom(elem);
34212	}
34213
34214	var $elem = jQuery(elem);
34215	var $form = $elem.is('form') ? $elem : $elem.parents('form:first');
34216	var $quantity = $form.find('[name="quantity"]');
34217	let productId = $form.find('input[name=product_id]').val();
34218
34219	if (($quantity.val().indexOf(',')) != -1) {  // nebralo ciarku pri 'Nákup produktov v desatinných množstvách'
34220		$quantity.val($quantity.val().replace(/\,/g, '.'));
34221	}
34222
34223	if ($quantity.length && parseFloat($quantity.val()) == 0) {
34224		$quantity.trigger('focus');
34225		return false;
34226	}
34227
34228	//RB vex pre custom field
34229	if ( $elem.hasClass('is_restricted_product') ) {
34230		vex.dialog.alert( $elem.data('vex_url') );
34231	}
34232
34233	if ( $elem.hasClass('vex_product_is_in_spg') && typeof js_Config_show_vex_after_add_to_cart !== 'undefined' && js_Config_show_vex_after_add_to_cart && typeof CsModal !== "undefined" ) {
34234		//#15177
34235		showMessageAfterAddToCart(elem);
34236		return false;
34237	}
34238
34239	if (typeof js_Config_product_variant !== 'undefined' && js_Config_product_variant) {
34240		// neskor presunut do vnutra `checkIfVariantIsSelected`
34241		if (typeof window[`ProductVariantInstance_${productId}`] !== 'undefined' && (window[`ProductVariantInstance_${productId}`].attributeList.length > 0 || Object.keys(window[`ProductVariantInstance_${productId}`].attributeList).length > 0)) {
34242			return window[`ProductVariantInstance_${productId}`].checkIfVariantIsSelected();
34243		}
34244
34245		return true;
34246	}
34247
34248	// dusan pridani ehlasky pri nevybere variantu
34249	if (js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED != '2') {
34250		var is_checked = false;
34251		var variant_element = '';
34252		if(jQuery('.attr_group_sel_div').length != '0'){
34253			// pri vybere variantu z attr_group_sel_div a
34254			jQuery('.attr_group_sel_div a').each( function () {
34255				if (jQuery(this).hasClass('selected_attr')){
34256					is_checked = true;
34257				}
34258			});
34259			variant_element = '.attr_group_sel_div a';
34260
34261		} else if(jQuery('.prod_adv_attrib_select select').length != '0'){
34262			//zo selectu
34263			if( jQuery('.prod_adv_attrib_select select').val() != ''){
34264				is_checked = true;
34265			}
34266
34267			variant_element = '.prod_adv_attrib_select select';
34268
34269		} else {
34270
34271			if ( is_cs_user('separate_js') && ( typeof js_CS_Config_empy_radio_select_variant !== 'undefined' && js_CS_Config_empy_radio_select_variant == '1' ) ) {
34272				var form_varaints = jQuery('.prod_adv_attribs_div').find('.shop_addtocart_advanced_attribute_radio');
34273				if( ( typeof js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED !== 'undefined' && js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED == '1') && ( form_varaints.length > 0 ) && (form_varaints.is(':checked') == false ) ){
34274					is_checked = false;
34275					variant_element = '.prod_adv_attribs_div';
34276				} else {
34277					// nieje vyber variantu
34278					return true;
34279				}
34280
34281			}else {
34282				// nieje vyber variantu
34283				return true;
34284			}
34285		}
34286		if (is_checked == true){
34287			return true;
34288		} else {
34289            var attribsWrapperTop = jQuery('.prod_adv_attribs_div').offset().top - 70;
34290
34291            jQuery(variant_element).each( function () {
34292				jQuery(this).addClass('please_choose_variant');
34293			});
34294			if ( attribsWrapperTop < jQuery(window).scrollTop() ) {
34295                jQuery('html, body').animate({
34296                    scrollTop: attribsWrapperTop
34297                }, 600);
34298			}
34299			jQuery(variant_element + ':first').tooltipster({
34300				theme        : "tooltipster-gdpr tooltipster-choose-attr",
34301				contentAsHTML: true,
34302				trackTooltip : true,
34303				trackOrigin  : true,
34304				multiple     : true,
34305				timer        : 5000,
34306				content      : (typeof js_cart_select_item !== 'undefined' ? js_cart_select_item : '')
34307			}).tooltipster('open');
34308			return false;
34309		}
34310	}
34311
34312	return true;
34313}
34314function js_add_bind_data(jso, name, value) {
34315	var jqo  = jQuery(jso);
34316	var bind = jqo.data('bind');
34317	jqo.data('bind', jQuery.extend(bind, {name: value}));
34318}
34319/////-------------- PEXF LOAD PRE PARAMETRE - FINALNY
34320var js_external_url_link = '';
34321function js_pexf_load( page_count, asc_desc, mode ) {
34322	if (js_global_is_csu) {
34323		console.log('FN: js_pexf_load', {page_count: page_count, asc_desc: asc_desc, mode: mode});
34324	}
34325
34326	if ( typeof js_category_id === 'undefined' ) return;
34327
34328	// Neloaduj ak je poziadavka z nekonecneho scrolovania
34329	if( typeof inf_clear_pexf !== 'undefined' && inf_clear_pexf == true ) return;
34330
34331	js_global_c_pp_filter_processing = null;
34332	js_global_pexf_processing = null;
34333	var options = {'option': 'com_shop', 'page': 'shop.browse', 'Itemid': '1040', 'category_id': js_category_id, 'no_html': '1', 'no_css': '1', 'no_menu': '1', 'no_vm_html': '1', 'sef_rewrite_index2_index': '1'};
34334
34335	if (jQuery('.pexf_reset_container .pexf_cancel_values').hasClass('active') && mode != 'reset_product_filter') {
34336		jQuery('.pexf_reset_container .pexf_cancel_values').fadeIn(300);
34337	} else
34338		jQuery('.pexf_reset_container .pexf_cancel_values').fadeOut(300);
34339
34340
34341	jQuery('body').find('.pexf_selected_values').html('');	// zmazanie zoznamu vsetkych selectnutych attribute filtrov
34342
34343	// filter cenove hladiny
34344	jQuery('.pexf_value input[type="checkbox"][name="ch_pexf_price_level"]:checked').each(function ( idx_v, jso_v ) {
34345		options[jQuery(jso_v).attr('name')+'['+idx_v+']'] = jQuery(jso_v).val();
34346		var pexf_selected_values_container = jQuery(this).parents('.pexf_container').find('.pexf_selected_values:first');
34347// 		if (typeof(console) != 'undefined') console.log('pexf_selected_values_container', pexf_selected_values_container, jQuery(jso_v), jQuery(jso_v).siblings('label'));
34348		var this_attr_value = jQuery(jso_v).siblings('label').html();
34349		if (typeof(console) != 'undefined') console.log('this_attr_value', pexf_selected_values_container,  this_attr_value);
34350		pexf_selected_values_container.html(pexf_selected_values_container.html() + this_attr_value + '<br/>');
34351	});
34352
34353	// filtry podla atributov
34354	if (jQuery('body').find('input.attr_value_filter:checked').length) {
34355
34356		options.attr_filter_values_enabled = 1;
34357		options.attr_filter_values = {};
34358
34359		jQuery('body').find('input.attr_value_filter:checked').each(function(i){
34360			// naplnenie do zoznamu vybratych filtrov
34361			var pexf_selected_values_container = jQuery(this).parents('.pexf_container').find('.pexf_selected_values:first');
34362			var this_attr_value = jQuery(this).val().split(':');
34363			pexf_selected_values_container.html(pexf_selected_values_container.html() + this_attr_value[1] + '<br/>');
34364			//var input_class = jQuery(this).attr
34365			var attr_val_index_arr = jQuery(this).attr('class').match(/(^| )pexf_by_attr_value_([0-9]+)/);
34366
34367			if (attr_val_index_arr != null && attr_val_index_arr.length > 2 )
34368				var attr_val_index = attr_val_index_arr[attr_val_index_arr.length - 1];
34369
34370			if (typeof(options.attr_filter_values[attr_val_index]) != "object")
34371				options.attr_filter_values[attr_val_index] = [];
34372
34373			options.attr_filter_values[attr_val_index][ options.attr_filter_values[attr_val_index].length ] = jQuery(this).val();
34374		});
34375	}
34376
34377	// filtry podla atributov - type image
34378	if (jQuery('body').find('input.attr_image_value_filter_selected').length) {
34379
34380		options.attr_filter_values_enabled = 1;
34381		if (typeof(options.attr_filter_values) == "undefined" )
34382			options.attr_filter_values = {};
34383
34384
34385		jQuery('body').find('input.attr_image_value_filter_selected').each(function(i) {
34386			var pexf_selected_values_container = jQuery(this).parents('.pexf_container').find('.pexf_selected_values:first');
34387			var this_attr_image_value = jQuery(this).css('background-image').replace(/"/gi, '').replace(/'/gi,'');
34388			pexf_selected_values_container.html(pexf_selected_values_container.html() + '<input type="button" class="attr_image_value_filter attr_image_value_filter_active" style="background:' + this_attr_image_value + ' repeat center 50%" value=""/> ');
34389
34390			var attr_val_index_arr = jQuery(this).attr('class').match(/(^| )pexf_by_attr_value_([0-9]+)/);
34391
34392			if (attr_val_index_arr != null && attr_val_index_arr.length > 2 )
34393				var attr_val_index = attr_val_index_arr[attr_val_index_arr.length - 1];
34394
34395			if (typeof(options.attr_filter_values[attr_val_index]) != "object")
34396				options.attr_filter_values[attr_val_index] = [];
34397
34398			options.attr_filter_values[attr_val_index][ options.attr_filter_values[attr_val_index].length ] = jQuery(this).val();
34399
34400		});
34401	}
34402
34403	// filter vyrobcu
34404	var manufacturer_select = jQuery('select[name=product_manufacturer_shop_browse_filter]');
34405	if ( manufacturer_select.length > 0 ) {
34406		if(is_cs_user()) console.log(manufacturer_select.val());
34407		if (manufacturer_select.val() != '') {
34408			options.pc_manufacturer_id = manufacturer_select.val();
34409			if (typeof(options.pc_manufacturer_id) == 'string' && isNaN(options.pc_manufacturer_id)) {// palo
34410				options.pc_manufacturer_id = options.pc_manufacturer_id.substring(0, options.pc_manufacturer_id.length - 1);
34411				var start_id = options.pc_manufacturer_id.lastIndexOf('-') + 1;
34412				options.pc_manufacturer_id = options.pc_manufacturer_id.substring(start_id);
34413			}
34414
34415
34416			if (Array.isArray(options.pc_manufacturer_id)) {	// multiple
34417				jQuery('.pexf_manu_container').find('.pexf_selected_values').html('');
34418				var selected_values = [];
34419				jQuery.each(options.pc_manufacturer_id, function (i, val) {
34420					if (val > 0)
34421						selected_values.push( manufacturer_select.find('option[value="' + val + '"]').html() );
34422				});
34423				jQuery('.pexf_manu_container').find('.pexf_selected_values').html( selected_values.join(', ') );
34424
34425			} else 												// standard
34426				jQuery('.pexf_manu_container').find('.pexf_selected_values').html(manufacturer_select.find('option[value="' + options.pc_manufacturer_id + '"]').html());
34427		}
34428	}
34429
34430	// limit produktov na stranku
34431	options.limit = jQuery('#middle').find('select[name=limit]:first').val();
34432	if (typeof(options.limit)=='undefined') {
34433		if ( typeof js_custom_page_limit != 'undefined')
34434			options.limit = js_custom_page_limit;
34435		else
34436			options.limit = 20;	// lebo
34437	}
34438
34439	// limit - strankovanie
34440	options.limitstart = 0;
34441	if ( typeof(page_count) != "undefined" && page_count > 0 ) 	// Zobraziť na stránku
34442		options.limitstart = page_count;
34443
34444	// zoradit produkty podla ...
34445	options.orderby = jQuery('#middle').find('select[name=orderby]:first').val();
34446	if (typeof(options.orderby) == 'undefined' || options.orderby == 'undefined')
34447		options.orderby = 'vm_product.product_name';
34448	if (jQuery('#middle').find('select[name=orderby]:first option:selected').index() != 0 ) {
34449		jQuery('.pexf_order_by_container .pexf_selected_values').html( jQuery('#middle').find('select[name=orderby]:first option:selected').html() );
34450	} else
34451		jQuery('.pexf_order_by_container .pexf_selected_values').html('');
34452
34453	// zoradit produkty ASC/DESC
34454	if (typeof(mode) != "undefined" && mode == 'select_order') {
34455		asc_desc_ico = 'sort_desc.png';
34456		asc_desc = '1';
34457	}
34458	if (typeof(asc_desc_ico) != "undefined" && asc_desc_ico == '' && jQuery('.orderby_img').length) {
34459		asc_desc_ico = jQuery('.orderby_img:first').attr('src').indexOf('sort_asc') > -1 ? 'sort_asc.png' : 'sort_desc.png';
34460	}
34461	if ( typeof(asc_desc) != "undefined" && asc_desc != '' ) {
34462		if (typeof(asc_desc_ico) != "undefined" &&  asc_desc_ico == 'sort_asc.png') {
34463			options.DescOrderBy = 'DESC';
34464			asc_desc_ico = 'sort_desc.png';
34465		} else {
34466			options.DescOrderBy = 'ASC';
34467			asc_desc_ico = 'sort_asc.png';
34468		}
34469
34470		Cookies.set('shop_browse_orderby_price_asc_desc', options.DescOrderBy, { path: '/' });
34471		jQuery('.pexf_order_by_value_container').find('.asc_desc_img').attr('src', js_global_live_site + '/images/M_images/' + asc_desc_ico);
34472		jQuery('.pexf_order_by_container .pexf_selected_values').append('<img class="pexf_asc_desc_img_set" src="/images/M_images/' + asc_desc_ico + '" />');
34473	}
34474	if (typeof asc_desc == 'undefined' && jQuery('.orderby_img').length) {
34475		asc_desc_ico = jQuery('.orderby_img:first').attr('src').indexOf('sort_asc') > -1 ? 'sort_asc.png' : 'sort_desc.png';
34476		if (typeof(asc_desc_ico) != "undefined" && asc_desc_ico == 'sort_asc.png') {
34477			options.DescOrderBy = 'ASC';
34478		} else {
34479			options.DescOrderBy = 'DESC';
34480		}
34481	}
34482	// END: ordering
34483
34484	// adaptivny filter podla ceny
34485	if (jQuery('#pexf_range').length && mode != 'reset_product_filter') {
34486		var $pexf_range = jQuery('#pexf_range');
34487		var slider_params = $pexf_range.data('params') || {};
34488		options.pexf_price_from = $pexf_range.slider('values')[0];
34489		options.pexf_price_to = $pexf_range.slider('values')[1];
34490		options.pexf_price_tax = slider_params.max_tax;
34491		jQuery('#pexf_range').parents('.pexf_price_lvl:first').find('.pexf_selected_values').html('');
34492
34493		// cudzojazycny filter, hodnoty treba prepocitat na default currency
34494		if (!js_is_empty(slider_params.orig) && !js_is_empty(slider_params.orig.currency_rate) && slider_params.orig.currency_rate != 1) {
34495			options.pexf_price_from = options.pexf_price_from / slider_params.orig.currency_rate;
34496			options.pexf_price_to = options.pexf_price_to / slider_params.orig.currency_rate;
34497		}
34498
34499	}
34500
34501	// skupina produktov
34502	if (jQuery('select#product_special_group').length)
34503		options.product_special_group = jQuery('select#product_special_group').val();
34504
34505	options.is_pexf = 1;
34506	options.shop_browse_ajax_mode = 1;	// shop ajax mode enabled
34507
34508	jQuery('#middle').css('height', 'auto');
34509
34510	// filter dostupnostosti
34511	if (jQuery('#product_availability_shop_browse_filter').length) {
34512		options.pc_avail_id = jQuery('#product_availability_shop_browse_filter').val();
34513		var avails = jQuery('#product_availability_shop_browse_filter').val();
34514		if (jQuery('#product_availability_shop_browse_filter').attr('multiple') == 'multiple' && avails != null && avails.length > 0){
34515			var avail_opt = avails.join(',');
34516		} else {
34517			var avail_opt = avails;
34518		}
34519		Cookies.set('pc_avail_id_' + js_category_id, avail_opt, { path: '/' });
34520
34521		var selected_values = [];
34522		if (jQuery('#product_availability_shop_browse_filter').val() != '' ) {
34523			jQuery('#product_availability_shop_browse_filter :selected').each(function () {
34524				selected_values.push(jQuery(this).text());
34525			});
34526		}
34527		jQuery('.pexf_avail_container .pexf_selected_values').html(selected_values.join(', '));
34528	}
34529
34530	// JAN external link filter parameter, zostavenie linku
34531	if (typeof js_filter_param_from_url != 'undefined' && js_filter_param_from_url == 1){
34532
34533		var opt = {};
34534		var fu_params = Cookies.get('c_pp_filter_' + js_category_id);
34535		var fu_avails = Cookies.get('pc_avail_id_' + js_category_id);
34536
34537		if (typeof fu_params !== 'undefined' && fu_params !== null && fu_params !== '') opt.x = 'c_pp_filter_'+js_category_id+'='+fu_params;
34538		if (typeof fu_avails !== 'undefined' && fu_avails !== null && fu_avails !== '') opt.y = 'pc_avail_id_'+js_category_id+'='+fu_avails;
34539
34540		var optKey = {'limit':'a','limitstart':'b','orderby':'c','pexf_price_from':'d','pexf_price_tax':'e','pexf_price_to':'f'};
34541		for(var keyIndex in options) {
34542		   if (options.hasOwnProperty(keyIndex)) {
34543			   if(typeof(optKey[keyIndex]) != 'undefined'){
34544				   opt[optKey[keyIndex]] = options[keyIndex];
34545			   }
34546		   }
34547		}
34548		var encoded_url = btoa(JSON.stringify(opt));
34549		js_external_url_link = js_global_live_site+js_url.replace(/&amp;/g, '&')+'?fp='+encoded_url;
34550		cs_set_cookie('filter_param_from_url', js_external_url_link);
34551	}
34552
34553// 	if (typeof(console) != 'undefined') console.log(options);
34554	if (typeof(js_pexf_load_before_ajax_init) == 'function')
34555			js_pexf_load_before_ajax_init();
34556
34557	if (typeof(js_pexf_load_change_options_init) == 'function')
34558		options = js_pexf_load_change_options_init(options);
34559
34560	// scroll to top of produtct list after pexf_load
34561	if (typeof js_pexf_load_autoscroll != 'undefined' && js_pexf_load_autoscroll == 1 && jQuery('.shop_browse_category_h2').length) {
34562		var top_pos = jQuery('.shop_browse_category_h2').offset().top || -1;
34563		setTimeout(function () {
34564			if (top_pos > 0)
34565				jQuery.scrollTo(top_pos, 800);
34566		}, 250);
34567	}
34568
34569	// set category last page
34570	Cookies.set('shop_browse_pexf_limitstart_' + js_category_id, options.limitstart, { path: '/' });
34571
34572	// JAN dynamic category product counter
34573	js_pexf_product_counter();
34574	jQuery('#middle_content_inner').html('<div class="middle_progress" style="text-align:center"><img src="/images/ajax-loader-01.gif" alt="..." /></div>').load('/index2.php', options, function () {
34575
34576		jQuery('.shop_category_limit').show();
34577
34578		// presunutie pagination limitboxu do tela modulu
34579		if (typeof js_move_pagination_to_filter_module != 'undefined' && typeof js_filter_pagination_enabled != 'undefined' && js_filter_pagination_enabled == 1){
34580			js_move_pagination_to_filter_module();
34581		}
34582
34583		// vymazanie selected values elementov
34584		if (typeof(mode) != "undefined" && mode == 'reset_product_filter')
34585			jQuery('.pexf_selected_values').html('');
34586
34587		if (typeof js_get_selectboxes_height != 'undefined')
34588			js_get_selectboxes_height();
34589
34590		// na konci vzdy
34591		if (typeof(js_pexf_load_after_ajax_init) == 'function')
34592			js_pexf_load_after_ajax_init();
34593
34594
34595	});
34596	return false;
34597}
34598
34599// JAN filter dynamic category product counter
34600function js_pexf_product_counter(){
34601
34602	var filter_box = jQuery('body').find('.c_pp_filter_container');
34603
34604	if( filter_box.length > 0 && filter_box.hasClass('c_pp_counter') ){
34605
34606		var options = {};
34607
34608		jQuery.post('/public_scripts_M4r7ft/ajax/pexf_count_product.php', options, function (res) {
34609
34610			var result = JSON.parse(res);
34611
34612			if( typeof result === 'object' ){
34613
34614				jQuery.each(result.counter, function(c, v){
34615
34616					var elem = jQuery('.module_cont-kateg .category_id_'+c);
34617
34618					if (elem.find('span.pexf_counter').length > 0){
34619						elem.find('span.pexf_counter').html(v).attr('class', result.filter);
34620					} else {
34621						elem.append('<span class="'+result.filter+'">'+v+'</span>');
34622					}
34623				});
34624			}
34625		});
34626	}
34627}
34628
34629function js_update_text_counter(elem, max_count, counterElement) {
34630	if (typeof max_count == 'undefined')
34631		return;
34632
34633	counterElement = counterElement || false;
34634
34635	var $elem = jQuery(elem);
34636	var $counter = $elem.parent().find('.txt_count');
34637
34638	if (counterElement) {
34639		$counter = jQuery(counterElement);
34640	}
34641
34642	$counter.text(parseInt(max_count) - $elem.val().length);
34643}
34644
34645function is_admin() {
34646	return ((typeof js_global_is_admin !== 'undefined' ? js_global_is_admin : false) || jQuery('body').hasClass('admin_design'));
34647}
34648
34649function is_cs_user(cookieValue) {
34650	if (typeof js_global_is_csu !== 'undefined') {
34651		if (typeof cookieValue !== 'undefined') {
34652			if (Cookies.get('cs_whois') !== undefined && Cookies.get('cs_whois') !== '') {
34653				return Cookies.get('cs_whois').split('|').includes(cookieValue);
34654			}
34655
34656			return false;
34657		}
34658
34659		return js_global_is_csu;
34660	}
34661
34662	return false;
34663}
34664
34665function isDesignTools(param) {
34666	if( typeof design_tools !== 'undefined' ) {
34667		if( typeof param !== 'undefined' && typeof design_tools[param] !== 'undefined' ) {
34668			return design_tools[param];
34669		}
34670
34671		if( typeof param !== 'undefined' && typeof design_tools[param] === 'undefined' ) {
34672			return false;
34673		}
34674
34675		return design_tools;
34676	}
34677
34678	return false;
34679}
34680
34681/**
34682 * Vrati ID modulu
34683 * @param elem - jQuery element modulu, ktoreho ID chceme ziskat
34684 * @return int - ID modulu. Ak element neobsahuje triedu s definiciou modulu, vrati 0.
34685 */
34686function getModuleId(elem) {
34687	if (typeof elem === 'undefined')
34688		return 0;
34689
34690	var classes = jQuery(elem).attr('class');
34691
34692	console.log(classes);
34693
34694	if (typeof classes === 'undefined')
34695		return 0;
34696
34697	var mpid = classes.match(/mp_id(\d+)/);
34698	if (mpid != null && mpid instanceof Array)
34699		return parseInt(mpid[1]);
34700	return 0;
34701}
34702
34703function vmExplodeProductVariant(attributes = '', ex_params = null) {
34704	let ret = {};
34705	if (typeof attributes === 'string' && attributes !== '') {
34706		attributes = attributes.replace('$@#@$:', '');
34707		let l = attributes.split(';');
34708		if (l !== null) {
34709			l.forEach((v) => {
34710				v = v.trim();
34711				if (v !== '') {
34712					let ret1 = {};
34713					let matches;
34714
34715					// SPECIAL CHARS $@#@$:
34716					if (!(ex_params && ex_params['no_strip_special_replacement'])) {
34717						v = v.replace(/^\$\@\#\@\$\[\:\,]/, '');
34718					}
34719
34720					if ((matches = v.match(/(.+?)(\[|\{|$)/)) && matches[1].trim() !== '') {
34721						// ATTR DATA
34722						let a = matches[1].replace(/[ ]{0,}\:[ ]{0,}/g, ':').trim();
34723						let l2 = a.split('-');
34724						l2.forEach((v2) => {
34725							let l3 = v2.split(':');
34726
34727							if (typeof ret1['attr'] === 'undefined') {
34728								ret1['attr'] = {};
34729							}
34730
34731							ret1['attr'][l3[0].trim()] = l3[1] ? l3[1].trim() : '';
34732						});
34733
34734						// GROUPS
34735						v.match(/\{([\w]+)=(.+?)\}/g).forEach((match) => {
34736							let props = match.slice(1, -1).split('=');
34737							let propName = props[0];
34738							let propValue = props[1];
34739
34740							if (typeof ret1['prop'] === 'undefined') {
34741								ret1['prop'] = {};
34742							}
34743
34744							if (['CDATA', 'IMG', 'AID'].includes(propName)) {
34745								ret1['prop'][propName] = decodeURIComponent(propValue);
34746							} else {
34747								ret1['prop'][propName] = propValue;
34748							}
34749						});
34750
34751						// PRICE
34752						if ((matches = v.match(/\[(.+?)\]/)) && matches[1].trim() !== '') {
34753							ret1['prop']['price'] = matches[1];
34754
34755							let matches2;
34756							if ((matches2 = matches[1].match(/^(\+|\-|\=?)(.+)/))) {
34757								if (matches2[1]) {
34758									ret1['prop']['price_sign'] = matches2[1];
34759								}
34760								if (matches2[2]) {
34761									ret1['prop']['price_num'] = matches2[2];
34762								}
34763							}
34764						}
34765
34766						// CUSTOM - SGP PAIR
34767						if (ret1['prop']['SGP']) {
34768							let prices = ret1['prop']['SGP'].split('|');
34769							ret1['prop']['SGP'] = {};
34770							prices.forEach((price) => {
34771								let sgp = price.split(':');
34772								ret1['prop']['SGP'][sgp[0]] = sgp[1];
34773							});
34774						}
34775
34776						if (ret1['prop'] && ret1['prop']['VDOM']) {
34777							ret1['prop']['VDOM'] = ret1['prop']['VDOM'].split(',').filter((v) => v !== '');
34778						}
34779
34780						ret1['source'] = v;
34781
34782						if (ex_params && ex_params['assoc_by_code'] && ret1['prop']['CODE'] !== '') {
34783							a = ret1['prop']['CODE'];
34784						}
34785
34786						ret[a] = ret1;
34787					}
34788				}
34789			});
34790		}
34791	}
34792	return ret;
34793}
34794
34795
34796function jsParseVariant(variant){
34797	var split = variant.split('{');
34798	var variants = {};
34799	jQuery(split).each(function (k,v){
34800		if (v.substr(-1) === "}") {
34801			v = v.slice(0, -1);
34802		}
34803		var v_split = [];
34804		if (v.indexOf(":")>0){
34805			v_split = v.split(':');
34806		} else if(v.indexOf("=")>0){
34807			v_split = v.split('=');
34808		}
34809		variants[v_split[0]] = v_split[1];
34810	});
34811	return variants;
34812
34813}
34814
34815function js_show_delivery_date_by_max_stock(element) {
34816	/*if( !jQuery('body').hasClass('shop_page_class_shop_product_details') ) return;
34817	if ( jQuery('.shop_product_availability_value').length > 0 && typeof product_stock !== 'undefined' && typeof productInCart !== 'undefined' ) {
34818		if( parseInt(product_stock) < parseInt(productInCart) ) {
34819			jQuery('.shop_product_availability_value:last').text('Nedostupne');
34820		}
34821	}*/
34822	var jqo = jQuery(element);
34823	var avail_jqo = jqo.parents('.variant-info-group').siblings('.vig-availability');
34824	var product_stock = avail_jqo.find('.product_in_stock').text();
34825	var jqo_value = parseInt(jqo.val());
34826	if ( jqo_value < 0 ) {
34827		jqo_value = 0;
34828	}
34829	if ( jqo_value > parseInt(product_stock) ) {
34830		avail_jqo.find('.variant-info-value').text('doba dodania sa môže líšiť');
34831		avail_jqo.removeClass('vig-avail-3');
34832		avail_jqo.addClass('vig-avail-4');
34833	} else {
34834		avail_jqo.find('.variant-info-value').text('skladom');
34835		avail_jqo.removeClass('vig-avail-4');
34836		avail_jqo.addClass('vig-avail-3');
34837
34838	}
34839}
34840
34841// dusko product delivery max stock
34842function js_show_delivery_max_stock(product_stock){
34843	// ak niesme v product_details
34844	var max_stock = false;
34845	if( !jQuery('body').hasClass('shop_page_class_shop_product_details') ) return;
34846
34847	if( jQuery('.variant_btns_custom').length > 0 ) {
34848		if( jQuery('.variant_btn_custom_selected').length > 0 ){
34849			// armymarket ma zapnute custom varianty
34850			var variant_index = jQuery('.variant_btn_custom_selected').data('index');
34851			var variant_attrib = jQuery('.prod_adv_attribs_div select .attrib_comb_' + variant_index).val();
34852			var variant = jsParseVariant(variant_attrib);
34853			var stock = typeof variant.SS !== 'undefined' && typeof variant.S !== 'undefined' && variant.S == 0 ? variant.SS : variant.S;
34854			jQuery('.dodanie .date-container .text').remove();
34855			if ( parseInt(stock) > 0 ){
34856				var text = js_lang_max_product_stock_per_order.replace('{stock}', stock);
34857				jQuery('.dodanie .date-container').append('<span class="text">' + text  +'</span>');
34858				max_stock = true;
34859			}
34860
34861		} else if( product_stock > 0){
34862			// toto je volane z product details vzdy tak to nechajte ako poslednu podmienku
34863			var text = js_lang_max_product_stock_per_order.replace('{stock}', product_stock);
34864			jQuery('.dodanie .date-container').append('<span class="text">' + text  +'</span>');
34865			max_stock = true;
34866		}
34867
34868		if( jQuery('.dodanie .dodanie_inner.max_stock').length > 0 && !max_stock){
34869			jQuery('.dodanie .dodanie_inner').removeClass('max_stock');
34870		}
34871		if( jQuery('.dodanie .dodanie_inner.max_stock').length == 0 && max_stock){
34872			jQuery('.dodanie .dodanie_inner').addClass('max_stock');
34873		}
34874
34875		return;
34876	}
34877	if ( is_cs_user() ) {
34878		console.log('treba este dorobit ine druhy variantov');
34879		return;
34880	}
34881}
34882
34883// JAN product last pieces box
34884function js_last_pieces_html_box(elem){
34885
34886	if( !jQuery('body').hasClass('shop_page_class_shop_product_details') ) return;
34887
34888	var container = jQuery('.product_last_piece_box');
34889
34890	if( container.length == 0 || typeof(last_pieces_info_enabled) == 'undefined' || last_pieces_info_enabled == 0 ) return;
34891
34892	// Ak ma produkt atributy musi sa to spustit z local.js cez change (co sa deje vo vecsine pripadov)
34893	var hasattribs = config('js_Config_product_variant') ? (jQuery('.prod_adv_attribs_div').length > 0) : (jQuery('#addtocart .prod_adv_attribs_div').length > 0);
34894
34895	if (elem === 0 && hasattribs) return;
34896
34897	// O Aky typ zobrazenia ide?
34898	var box_val = '';
34899	var anchork = jQuery(elem);
34900	var classes = anchork.attr('class');
34901	if (typeof classes !== 'undefined'){
34902		var classList = classes.split(/\s+/);
34903
34904		for (var i = 0; i < classList.length; i++) {
34905			switch(classList[i]){
34906				// Radio inputs
34907				case 'shop_addtocart_advanced_attribute_tbl' : {
34908					box_val = anchork.attr('data-value');
34909					break;
34910				}
34911				// Href / image inputs
34912				case 'shop_addtocart_advanced_attribute_block' : {
34913					box_val = anchork.val();
34914					break;
34915				}
34916				// Select box
34917				case 'main_attr_select' : {
34918					box_val = anchork.val();
34919					break;
34920				}
34921			}
34922		}
34923
34924		if (box_val === '' && anchork.is('input')) box_val = anchork.val();
34925	}
34926
34927	var _render_last_pieces = function(result) {
34928		if (typeof result !== 'object' || result == null || typeof result.content == 'undefined') {
34929			container.html('');
34930			return;
34931		}
34932		var inner_html = '<div class="last_pieces_detail_tag ' + result.class + '"><span>' + result.content + '</span></div>';
34933		container.html(inner_html);
34934		var filter_object = jQuery('.last_pieces_detail_tag span');
34935		var orig_color = filter_object.css('color');
34936			  filter_object
34937			  .css('color','#FFF')
34938			  .css('transition', 'all 0.3s ease-out')
34939			  .css('-webkit-transition', 'all 0.3s ease-out')
34940			  .css('-moz-transition', 'all 0.3s ease-out')
34941			  .css('-o-transition', 'all 0.3s ease-out');
34942				setTimeout( function(){
34943					filter_object
34944					.css('color',orig_color);
34945			},200);
34946	};
34947
34948	if (typeof window.last_pieces_cache === 'undefined') window.last_pieces_cache = {};
34949
34950	var box_val_key = btoa(encodeURIComponent(box_val));
34951
34952	if (typeof window.last_pieces_cache[box_val_key] !== 'undefined'){
34953
34954		_render_last_pieces(window.last_pieces_cache[box_val_key]);
34955	} else {
34956
34957		// Setneme to uz teraz aby sa to nevolalo dookola
34958		window.last_pieces_cache[box_val_key] = {};
34959
34960		var options = {};
34961		var prodIdClass = jQuery('body').attr('class').match(/product_id_(\d+)/gm);
34962
34963		options.function = 'get_last_pieces';
34964		options.product_id = prodIdClass.length > 0 ? prodIdClass[0].replace('product_id_', '') : jQuery('input[name="product_id"]').val();
34965		options.variant = box_val;
34966
34967		jQuery.post('/includes/frontend_ajax.php', options, function(res){
34968
34969			// If json response is null, then set result to an empty object
34970			result = csJsonParse(res) || {};
34971			if (result.status == '1'){
34972
34973				window.last_pieces_cache[box_val_key] = result;
34974				_render_last_pieces(window.last_pieces_cache[box_val_key]);
34975			} else {
34976				if (result.status == '0') {
34977					container.html('');
34978				}
34979			}
34980		});
34981	}
34982}
34983function printStackTrace() {
34984	var callstack = [];
34985  var isCallstackPopulated = false;
34986  try {
34987	i.dont.exist+=0; //doesn't exist- that's the point
34988  } catch(e) {
34989  	console.log(e.stack);
34990	if (e.stack) { //Firefox
34991	  var lines = e.stack.split("\n");
34992	  for (var i=0, len=lines.length; i<len; i++) {
34993		if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
34994		  callstack.push(lines[i]);
34995		}
34996	  }
34997	  //Remove call to printStackTrace()
34998	  callstack.shift();
34999	  isCallstackPopulated = true;
35000	}
35001	else if (window.opera && e.message) { //Opera
35002	  var lines = e.message.split("\n");
35003	  for (var i=0, len=lines.length; i<len; i++) {
35004		if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
35005		  var entry = lines[i];
35006		  //Append next line also since it has the file info
35007		  if (lines[i+1]) {
35008			entry += " at " + lines[i+1];
35009			i++;
35010		  }
35011		  callstack.push(entry);
35012		}
35013	  }
35014	  //Remove call to printStackTrace()
35015	  callstack.shift();
35016	  isCallstackPopulated = true;
35017	}
35018  }
35019  if (!isCallstackPopulated) { //IE and Safari
35020	var currentFunction = arguments.callee.caller;
35021	while (currentFunction) {
35022	  var fn = currentFunction.toString();
35023	  var fname = fn.substring(fn.indexOf("function") + 8, fn.indexOf("(")) || "anonymous";
35024	  callstack.push(fname);
35025	  currentFunction = currentFunction.caller;
35026	}
35027  }
35028
35029  output(callstack);
35030}
35031
35032function output(arr) {
35033  //Output whatever you want
35034  console.info('stack trace', arr.join("nn"));
35035}
35036
35037//peter
35038
35039	//vytvorenie odkazu na editaciu po mouse over na produkt
35040	if (typeof js_global_user_info !='undefined' && js_global_user_info.gid >= 24) {
35041		jQuery(function() {
35042
35043			var _body = jQuery('body');
35044
35045			_body.on('mouseenter', '#product_list .shop-category-product', function(){
35046
35047				var productId = jQuery(this).find('.product-cart input[name="product_id"]').val();
35048
35049				if (typeof productId === 'undefined') {
35050					productId = jQuery(this).find('input[name="product_id"]').val();
35051				}
35052
35053				if (typeof productId === 'undefined') {
35054					productId = jQuery(this).find('input[name="shop_no_price_product"]').val();
35055				}
35056
35057				if (typeof productId === 'undefined') {
35058					var classNames = jQuery(this).attr('class').split(/\s+/)
35059						.filter(function(className) { return className.substr(0, 11) === 'product_id_'; })
35060						.map(function(className) { return className.substr(11); });
35061
35062					if (classNames.length) {
35063						productId = parseInt(classNames.pop());
35064					}
35065				}
35066
35067				if (typeof productId !== 'undefined') {
35068					jQuery(this).append([
35069						'<div class="edit-me" style="z-index:999; position:absolute; top:20px; right:20px;">',
35070							'<a href="/administrator/index2.php?option=com_shop&page=product.product_list&show_id='
35070+ productId +'" target="_blank">',
35071								'<img src="/administrator/components/com_shop/css/edit.svg" alt="" title="' + js_lang_edit_label + '">',
35072							'</a>',
35073						'</div>'
35074					].join(''));
35075				}
35076			});
35077
35078			_body.on('mouseleave', '#product_list .shop-category-product', function(){
35079
35080				jQuery(this).find('.edit-me').remove();
35081			});
35082		});
35083
35084	}
35085
35086	//vytvorenie odkazu na editaciu po mouse over na detail produktu
35087	if (typeof js_global_user_info !== 'undefined' && js_global_user_info.gid >= 24) {
35088		jQuery(function() {
35089			var product = jQuery(jQuery('.flypage1 .flypage-top').find('h1, h2, h3')[0]);
35090			var flypageTitle = jQuery('.flypage1 .flypage-h1');
35091
35092			if (flypageTitle.length) {
35093				product = flypageTitle;
35094			}
35095
35096			if (typeof product === 'undefined') {
35097				return;
35098			}
35099
35100			product.on('mouseenter',function() {
35101				jQuery(this).append('<span class="edit-me"><a href="/administrator/index2.php?option=com_shop&page=product.product_list&show_id=' + js_product_id + '" target="_blank" ><img src="/administrator/components/com_shop/css/edit.svg" alt="" title="' + js_lang_edit_label + '" ></a></span>');
35102			});
35103			product.on('mouseleave', function () {
35104				jQuery(this).find('.edit-me').remove();
35105			});
35106		});
35107	}
35108//END
35109//peter
35110if (typeof Config_accept_cookies_bar !== 'undefined' && Config_accept_cookies_bar == 1) {
35111	jQuery(function () {
35112		jQuery.acceptCookies({
35113			fixed: true
35114		});
35115	});
35116}
35117//END peter
35118/**
35119 * Najde a vrati zoznam hladanych javascriptovych premennych.
35120 * Funkcia preleti polom vsetkych globalnych (resp. definovanych vo window scope) JS premennych a funkcii a vrati
35121 * indexovane pole tych, v ktorych nazve sa nachadza hladany vyraz.
35122 * Hladany vyraz musi mat aspon tri znaky, inac sa hladanie vykonavat nebude.
35123 *
35124 * @author Marek J. Kolcun
35125 * @param string searchFor - retazec, ktory chceme najst v nazvoch JS premennych/funkciach
35126 * @param boolean onlyVariables - ak je zadana boolean hodnota, vyhladaju sa: iba premenne (TRUE), iba funkcie (FALSE), inac vrati vsetky vysledky
35127 * @return array - indexovane pole so zoznamom najdenych vysledkov
35128 */
35129function searchForVar(searchFor, onlyVariables) {
35130	if (typeof searchFor === 'undefined' || searchFor.length < 3) {
35131		console.warn('Zadaj aspon 3 znaky.');
35132		return [];
35133	}
35134
35135	var reg = new RegExp(searchFor, 'i');
35136	var results = Object.keys(window).reduce(function(res, val, key) {
35137		if (val.match(reg)) {
35138			if (typeof window[val] === 'function')
35139				res.functions.push(val);
35140			else
35141				res.variables.push(val);
35142		}
35143		return res;
35144	}, {variables: [], functions: []});
35145
35146	if (typeof onlyVariables === 'boolean') {
35147		return (onlyVariables) ? results.variables : results.functions;
35148	}
35149	return results;
35150}
35151
35152var newsletter_setting = {
35153	confirm : {},
35154	data : {},
35155	original_data : {},
35156	box : {},
35157	rbox : {},
35158	init : function(){
35159
35160		newsletter_setting.box = jQuery('.ans_wrap');
35161		newsletter_setting.rbox = jQuery('.ans_res_box');
35162		newsletter_setting.confirm = jQuery('.ans_confirm');
35163		newsletter_setting.loader = jQuery('.ans_loader');
35164
35165		newsletter_setting.confirm.on('click', function(){
35166			var btn = jQuery(this);
35167			newsletter_setting.saveData();
35168		});
35169
35170		jQuery('.ans_input').on('click', function(){
35171			var input = jQuery(this);
35172			if (!newsletter_setting.check()){
35173				newsletter_setting.confirm.show();
35174			} else {
35175				newsletter_setting.confirm.hide();
35176			}
35177		});
35178
35179		newsletter_setting.getData();
35180		newsletter_setting.original_data = JSON.stringify(newsletter_setting.data);
35181	},
35182	check : function(){
35183
35184		newsletter_setting.getData();
35185		return (typeof newsletter_setting.original_data !== 'undefined' && newsletter_setting.original_data === JSON.stringify(newsletter_setting.data));
35186	},
35187	saveData : function(){
35188
35189		newsletter_setting.getData();
35190		var options = {};
35191		options.function = 'save_newsletter_setting';
35192		options.data = JSON.stringify(newsletter_setting.data);
35193		newsletter_setting.confirm.hide();
35194		newsletter_setting.loader.show();
35195		jQuery.post('/includes/frontend_ajax.php', options, function(res){
35196
35197			var result = JSON.parse(res);
35198			newsletter_setting.loader.hide();
35199			if (result.status == '1'){
35200
35201				newsletter_setting.original_data = options.data;
35202
35203				newsletter_setting.rbox.append(result.content);
35204				setTimeout(function (){newsletter_setting.rbox.find('.ans_msg').remove();}, 5000);
35205			}
35206		});
35207	},
35208	getData : function(){
35209
35210		newsletter_setting.data = {};
35211		newsletter_setting.box.find('.ans_box').each(function(){
35212
35213			var name = jQuery(this).find('input').attr('name');
35214			var value = parseInt(jQuery(this).find('input:checked').val());
35215			newsletter_setting.data[name] = value;
35216		});
35217	}
35218};
35219
35220function disableOrderGroup(comp, disable) {
35221		jQuery(comp).find('input[type=checkbox]').each(function(){
35222			if(jQuery(this).hasClass('disabled')){
35223				jQuery(this).prop('disabled', true);
35224			} else {
35225				jQuery(this).prop('disabled', disable);
35226			}
35227		});
35228		comp.find('label').css({'color': (disable ? '#868686' : 'black')});
35229	//	comp.find('input[type=checkbox]').prop('disabled', disable);
35230	//	comp.find('label').css({'color': (disable ? '#868686' : 'black')});
35231
35232}
35233
35234function clickOrderGroup(bool) {
35235	disableOrderGroup(jQuery('#simpleStepOrder'), !bool);
35236	disableOrderGroup(jQuery('#twoStepOrder'), bool);
35237
35238	var comp = bool ?  jQuery('#simpleStepOrder') : jQuery('#twoStepOrder');
35239	var def = jQuery('select[name=conf_VM_BROWSE_ORDERBY_FIELD]');
35240	var selected = def.find('option:selected').val();
35241	var html = '';
35242
35243	def.html('');
35244	comp.find('input').each(function() {
35245		var newVal = jQuery(this).val().replace(/_2$/g, '');
35246
35247		html += "<option value=\"" + newVal + "\"";
35248
35249		if(selected == newVal)
35250			html += " selected=\"selected\" ";
35251
35252		html += ">" + jQuery(this).next('label').html() + "</option>\n";
35253	});
35254
35255	def.html(html);
35256}
35257
35258function setCookieOrder() {
35259	Cookies.set('stepOrder', '');
35260
35261	jQuery('#simpleStepOrder input').each(function() {
35262		var cookie = Cookies.get('stepOrder');
35263
35264		if(jQuery(this).is(':checked'))
35265			Cookies.set('stepOrder', cookie + ((cookie != '') ? ',' : '') + jQuery(this).val());
35266	});
35267
35268	jQuery('#twoStepOrder input').each(function() {
35269		var cookie = Cookies.get('stepOrder');
35270
35271		if(jQuery(this).is(':checked'))
35272			Cookies.set('stepOrder', cookie + ((cookie != '') ? ',' : '') + jQuery(this).val());
35273	});
35274}
35275
35276jQuery(function() {
35277	if(jQuery('#simpleStepOrder').length > 0 && jQuery('#twoStepOrder').length > 0) {
35278		clickOrderGroup(jQuery('#order_type1').is(':checked'));
35279		setCookieOrder();
35280
35281		jQuery('#simpleStepOrder input, #twoStepOrder input').on('change', function() {
35282			setCookieOrder();
35283		});
35284	}
35285
35286});
35287
35288function showConfirmUrl(comp) {
35289	jQuery("#url_confirm").toggle(jQuery(comp).is(':checked'));
35290}
35291
35292function js_verify_coupon_code(elem){
35293
35294	var btn = jQuery(elem);
35295	var options = {};
35296	options.function = 'verify_coupon_code';
35297	options.coupon_code = jQuery('input[name="coupon_code"]').val();
35298	btn.startAjaxLoader();
35299	jQuery.post(js_global_live_site+'/includes/frontend_ajax.php', options, function (res) {
35300		btn.stopAjaxLoader();
35301		var result = JSON.parse(res);
35302		jQuery('.coupon_verify_result').html(result.content);
35303	});
35304}
35305
35306function js_convertToDate(timestamp, format){
35307
35308if (typeof format == "undefined" ) var format = "date.month.year hour:min:sec";
35309  var a = new Date(timestamp * 1000);
35310  var year = a.getFullYear();
35311  var month = parseInt(a.getMonth()) + 1;
35312  var date = a.getDate();
35313  var hour = a.getHours();
35314  var min = a.getMinutes();
35315  var sec = a.getSeconds();
35316  if(sec < 10) var bsec = '0';
35317  else var bsec = '';
35318  if(min < 10) var bmin = '0';
35319  else var bmin = '';
35320  if(hour < 10) var bhour = '0';
35321  else var bhour = '';
35322  hour = bhour + hour;
35323  min = bmin + min;
35324  sec = bsec + sec;
35325  var r = "";
35326  r = format.replace("date",date);
35327  r = r.replace("month",month);
35328  r = r.replace("year",year);
35329  r = r.replace("hour",hour);
35330  r = r.replace("min",min);
35331  r = r.replace("sec",sec);
35332  return r;
35333}
35334
35335/***********/
35336
35337function js_pp_confirm(main_text, button1_text, button2_text, options, after_close_callback_fn, before_close_callback_fn) {
35338    //if (is_cs_user() && typeof options === 'object' && 'useVex' in options && options.useVex)
35339	return js_vex_confirm(main_text, button1_text, button2_text, options, after_close_callback_fn, before_close_callback_fn);
35340}
35341
35342
35343
35344function itemsAreIdentical(array) {
35345    for(var i = 0; i < array.length - 1; i++) {
35346        if(array[i] !== array[i+1]) {
35347            return false;
35348        }
35349    }
35350    return true;
35351}
35352
35353
35354
35355function js_vex_confirm(main_text, button1_text, button2_text, options, after_close_callback_fn, before_close_callback_fn){
35356
35357	if (typeof(js_global_is_csu) != 'undefined' && js_global_is_csu && typeof(console) != 'undefined') {
35358        console.log('js_vex_confirm');
35359    }
35360
35361	var main_text_html = main_text;
35362
35363	if (typeof(closing_allowed) != 'undefined' ) {
35364		if (button1_text != '' || button2_text != '') {
35365			main_text_html += '<div class="vex-dialog-form">';
35366
35367			if (button1_text != '') {
35368				main_text_html += '<div class="save-icon-container "><a class="pp_confirm_button1 vex-dialog-button-primary vex-dialog-button vex-last" href="#">
35368' + button1_text + '</a></div>';
35369			}
35370
35371			if (button2_text != '') {
35372				main_text_html += '<div class="cancel-icon-container"><a href="#" class="pp_confirm_button2 vex-dialog-button-secondary vex-dialog-button vex-last">' + button2_text + '</a></div>';
35373			}
35374
35375			main_text_html += '</div>';
35376		}
35377    }
35378
35379	var vexOptions = {
35380		content: main_text_html,
35381		afterOpen: function () {
35382			jQuery('input[type="button"].button.two')
35383				.off()
35384				.on('click', function () {
35385					vex.close();
35386				});
35387		},
35388		beforeClose: function () {
35389			if (typeof(before_close_callback_fn) == 'function') {
35390				before_close_callback_fn(false, options);
35391			}
35392		},
35393		afterClose: function() {
35394			if (typeof(after_close_callback_fn) == 'function') {
35395				after_close_callback_fn(false, options);
35396			}
35397		}
35398	};
35399
35400	if (typeof options !== 'undefined' && options.extra_class) {
35401		vexOptions.className = options.extra_class;
35402	}
35403
35404	vex.open(vexOptions);
35405
35406   return false;
35407}
35408
35409/**
35410 * Skonvertuje timestamp na datum
35411 */
35412function convertDate(timestamp, format){
35413
35414	var c = '';
35415
35416	if (typeof format == 'undefined') format = 'Y-m-d';
35417
35418	try{
35419
35420		format = format.split('');
35421
35422		var date = new Date(parseInt(timestamp) * 1000);
35423
35424		if (!format.length || timestamp.split('').length !== 10) throw 'Invalid format';
35425
35426		for(var i=0; i<format.length; i++){
35427
35428			var h = '';
35429			switch(format[i]){
35430
35431				case 'Y' : { c += date.getFullYear(); break; }
35432				case 'm' : {
35433					h = date.getMonth() + 1;
35434					c += (h < 10 ? '0'+h : h);
35435					break;
35436				}
35437				case 'd' : {
35438					h = date.getDate();
35439					c += (h < 10 ? '0'+h : h);
35440					break;
35441				}
35442				default : c+= format[i];
35443			}
35444		}
35445
35446		return c;
35447
35448	} catch (e){
35449
35450		return timestamp;
35451	}
35452}
35453
35454function js_product_special_group_change(elem, group_id) {
35455    elem = jQuery(elem);
35456
35457    if (typeof(group_id) == 'undefined')
35458        group_id = elem.val();
35459
35460    elem.siblings('.order_by_option').removeClass('active');
35461    elem.addClass('active');
35462
35463    var path_name = window.location.pathname + '/';
35464    window.location.href = 'http://' + window.location.host + path_name.match(/^\/[^\/]+\//)[0] + ((parseInt(group_id) > 0) ? 'g' + group_id + ',a' + (jQuery('select#limit').length ? ',' + jQuery('select#limit').val() : '') + '/' : '');
35465}
35466
35467function saveAdminLanguages(){
35468	alert("save admin langs");
35469}
35470
35471/**
35472 * @function initAutoTooltip
35473 */
35474var initAutoTooltip = function () {
35475
35476	/**
35477	 * JAN, tento observer je brutal overkill, ktory sa pouziva iba na autodetekciu inicializacie poshytipu pri dynamickom vlozeni elementov
35478	 * Nemoze sa to robit takto? jQuery('body').on('mouseenter', '[data-tooltip]',  function(){ initTooltip(this); });
35479	 */
35480	if (jQuery('body.optimized_list').length) return;
35481
35482	var addedTypes = [
35483		'childList',
35484		'subtree',
35485		'characterData'
35486	];
35487	var attrTypes = ['attributes'];
35488	var attrNames = [
35489		'data-tooltip',
35490		'tooltip'
35491	];
35492
35493	if ( typeof MutationObserver === 'undefined' ) {
35494		return;
35495	}
35496
35497	var observer = new MutationObserver(function (mutations) {
35498		var init = false;
35499		var mutation, index;
35500
35501		for (index in mutations) {
35502			if (!mutations.hasOwnProperty(index)) {
35503				continue;
35504			}
35505
35506			mutation = mutations[index];
35507
35508			if ((!!~addedTypes.indexOf(mutation.type) && mutation.addedNodes.length) || (!!~attrTypes.indexOf(mutation.type) && !!~attrNames.indexOf(mutation.attributeName))) {
35509				init = true;
35510				break;
35511			}
35512		}
35513
35514		if (init) {
35515			initTooltip();
35516		}
35517	});
35518
35519	var observe = function () {
35520		var target = document.getElementById('m1');
35521
35522		if (target instanceof Node) {
35523			observer.observe(target, {
35524				attributes: true,
35525				childList: true,
35526				subtree: true,
35527				characterData: true
35528			});
35529		} else {
35530			console.log(target);
35531		}
35532	};
35533
35534	var disconnect = function () {
35535		if ( observer !== null ) {
35536			observer.disconnect();
35537		}
35538	};
35539
35540	var initTooltip = function () {
35541		jQuery('[data-tooltip]').each(function () {
35542			var $elem = jQuery(this);
35543			var alignX = $elem.data('tip-x') || 'right';
35544			var alignY = $elem.data('tip-y') || 'center';
35545			var showOn = $elem.data('tip-show') || 'hover';
35546			var showTimeout = parseInt($elem.data('tip-timeout')) || 0;
35547			var offsetX = parseInt($elem.data('tip-offset-x')) || 0;
35548			var offsetY = parseInt($elem.data('tip-offset-y')) || 0;
35549			var $elemClone;
35550
35551			var tipInit = $elem.attr('tip-init');
35552
35553			if ( typeof tipInit !== 'undefined' ) {
35554				disconnect();
35555
35556				$elemClone = $elem.clone();
35557				$elem.after($elemClone);
35558				$elem.remove();
35559				$elem = $elemClone;
35560
35561				observe();
35562			}
35563
35564			//if ( typeof console !== 'undefined' ) {
35565			//	console.group('Debug');
35566			//	console.log($elem);
35567			//	console.log($elem.data('tip-init'));
35568			//	console.log($elem.attr('tip-init'));
35569			//	console.groupEnd();
35570			//}
35571
35572			//if ( typeof tipInit === 'undefined' ) {
35573				$elem.attr('tip-init', true);
35574				$elem.poshytip({
35575						alignX: alignX,
35576						alignY: alignY,
35577						offsetX: offsetX,
35578						offsetY: offsetY,
35579						showOn: showOn,
35580						showTimeout: showTimeout,
35581						alignTo: 'target',
35582						className: 'global_tooltip',
35583						content: '<span class="tooltip poshy-tooltip ' + ($elem.attr('class') || '') + '">' + $elem.data('tooltip') + '</span>'
35584					});
35585			//}
35586		});
35587	};
35588
35589	initTooltip();
35590	observe();
35591};
35592
35593/**
35594 * @author Martin Hucko <[email protected]>
35595 * @function initLogMessages
35596 * @returns {Boolean}
35597 */
35598var initLogMessages = function () {
35599	var messages = window.logMessages;
35600	var priorities = [
35601		'debug',
35602		'tip',
35603		'info',
35604		'notice',
35605		'alert',
35606		'warning',
35607		'error',
35608		'critical',
35609		'emergency'
35610	];
35611
35612	/**
35613	 * @function getHighestPriorityMessage
35614	 * @inner
35615	 * @returns {Object}
35616	 */
35617	var getHighestPriorityMessage = function () {
35618		var highestIndex = 0;
35619		var critMessage = messages[0];
35620
35621		messages.forEach(function (message) {
35622			var index = priorities.indexOf(message.className);
35623
35624			if (index > highestIndex) {
35625				highestIndex = index;
35626				critMessage = message;
35627			}
35628		});
35629
35630		return critMessage;
35631	};
35632
35633	/**
35634	 * @function showVex
35635	 * @inner
35636	 * @param {String} title
35637	 * @param {String} body
35638	 * @param {String} className
35639	 */
35640	var showVex = function (title, body, className) {
35641		vex.dialog.alert({
35642			message: '<span class="login-title">' + title + '</span>',
35643			input: body,
35644			className: 'vex-cs vex-log ' + className
35645		});
35646	};
35647
35648	/**
35649	 * @function getUniqueMessages
35650	 * @returns {Object[]}
35651	 */
35652	var getUniqueMessages = function () {
35653		var newArray = [];
35654		var lookupObject = {};
35655		var i;
35656
35657		for (i in messages) {
35658			if (messages.hasOwnProperty(i)) {
35659				lookupObject[messages[i].message] = messages[i];
35660			}
35661		}
35662
35663		for (i in lookupObject) {
35664			if (lookupObject.hasOwnProperty(i)) {
35665				newArray.push(lookupObject[i]);
35666			}
35667		}
35668
35669		return newArray;
35670	};
35671	var topMessage;
35672
35673	if (!(messages instanceof Array) || js_is_empty(messages)) {
35674		return false;
35675	}
35676
35677	messages = getUniqueMessages();
35678	messages.sort(function (a, b) {
35679		var aPriority = priorities.indexOf(a.className);
35680		var bPriority = priorities.indexOf(b.className);
35681
35682		if (aPriority === bPriority) {
35683			return 0;
35684		}
35685
35686		return aPriority > bPriority ? -1 : 1;
35687	});
35688
35689	if (messages.length === 1) {
35690		topMessage = messages[0];
35691
35692		showVex(topMessage.title, topMessage.message, topMessage.className);
35693
35694		return true;
35695	}
35696
35697
35698	topMessage = getHighestPriorityMessage();
35699
35700	showVex(topMessage.title, '<ul>' + messages.map(function (message) {
35701		return '<li class="' + message.className + '">' + message.message + '</li>';
35702	}).join('') + '</ul>', topMessage.className);
35703
35704	return true;
35705};
35706
35707/**********/
35708jQuery(function () {
35709	if (is_cs_user()) {
35710		console.log('%cJS INIT LOAD', 'color: #2196F3');
35711	} else if (typeof js_lang_we_are_hiring !== 'undefined') {
35712		console.log(js_lang_we_are_hiring);
35713	}
35714
35715	//if(is_cs_user()) {
35716	var module_cont_nivo_slider = jQuery('.module_cont_nivo_slider');
35717		if(module_cont_nivo_slider.length > 0) module_cont_nivo_slider.addClass('theme-default');
35718	//}
35719
35720	if ( typeof js_CS_Config_cs_infobar !== 'undefined' && js_CS_Config_cs_infobar == '1' ){
35721		js_infobar_cs('.cs_infobar');// app 946, CS_Config_cs_infobar
35722
35723		if ( typeof js_Config_infowidget_countdown_timer !== 'undefined' && js_Config_infowidget_countdown_timer ) {
35724			var infobarElem = jQuery('.cs_infobar');
35725			if ( infobarElem.length > 0 && js_Config_infowidget_countdown_timer.end != '' && js_Config_infowidget_countdown_timer.start != '' ) {
35726				var currentTime = new Date().getTime();
35727
35728				if ( js_Config_infowidget_countdown_timer.startTimestamp != '' ) {
35729					var startDate = js_Config_infowidget_countdown_timer.startTimestamp;
35730				} else {
35731					var startDate = Date.parse(js_Config_infowidget_countdown_timer.start.split(' ')[0].split('.').reverse().join('-') + ' ' + js_Config_infowidget_countdown_timer.start.split(' ')[1]);
35732				}
35733
35734				//var startDate = new Date(js_Config_infowidget_countdown_timer.start.split(' ')[0].split('.').reverse().join('-') + ' ' + js_Config_infowidget_countdown_timer.start.split(' ')[1]).getTime();
35735				if (currentTime > startDate) {
35736
35737					//infobarElem.find('.inner').append('<div class="timer"></div>');
35738					infobarElem.find('.text p:last-child').append('<span class="timer"></span>');
35739					var elem = infobarElem.find('.inner').find('.timer');
35740					if ( js_Config_infowidget_countdown_timer.endTimestamp != '' ) {
35741						var endDate = js_Config_infowidget_countdown_timer.endTimestamp;
35742					} else {
35743						var endDate = Date.parse(js_Config_infowidget_countdown_timer.end.split(' ')[0].split('.').reverse().join('-') + ' ' + js_Config_infowidget_countdown_timer.end.split(' ')[1]);
35744					}
35745					//var endDate = new Date(js_Config_infowidget_countdown_timer.end.split(' ')[0].split('.').reverse().join('-') + ' ' + js_Config_infowidget_countdown_timer.end.split(' ')[1]).getTime();
35746					initInfowidgetCountdownTimer(endDate, elem);
35747				}
35748			}
35749		}
35750	}
35751
35752	/**
35753	 * Log/info/warn/error to console for cs users only
35754	 */
35755	if ( console && ( !jQuery('body').hasClass('cs_user_ip') && ( typeof js_global_is_csip === 'undefined' || !js_global_is_csip ) ) ) {
35756		console.log = function() {};
35757		console.info = function() {};
35758		console.warn = function() {};
35759		console.error = function() {};
35760	}
35761
35762	initAutoTooltip();
35763	initLogMessages();
35764
35765	setTimeout(function() {
35766		showNotificationsAfterReload()
35767	}, 500);
35768});
35769// example: array("1=aaa") to array(1:'aaa');
35770function splitArrayToKeyValue(x, splitter) {
35771
35772	var obj = {};
35773	for (var i = 0; i < x.length; i++) {
35774		var split = x[i].split(splitter);
35775		obj[jQuery.trim(split[0])] = jQuery.trim(split[1]);
35776	}
35777	return obj;
35778}
35779
35780function getLang(lang, def) {
35781	var langText = '';
35782
35783	if( lang.indexOf('js_lang') === -1 ) {
35784		langText = window['js_lang_' + lang];
35785	} else {
35786		langText = window[lang];
35787	}
35788
35789	if ( typeof langText !== 'undefined' ) {
35790		return langText;
35791	}
35792
35793	if ( typeof def !== 'undefined' ) {
35794		return def;
35795	}
35796
35797	return '';
35798}
35799
35800function closeOutdatedBrowserAlert() {
35801	Cookies.set('outdatedBrowserAlertCookie', 1, { expires: 1 });
35802	jQuery('#outdatedBrowser').remove();
35803}
35804
35805/*
35806	type - success, info, error, notice
35807 */
35808function showNotification(text, title, type, delay, autohide, options, custom_class) {
35809
35810	var opts = {};
35811	opts.target = document.body;
35812	opts.title = (typeof title !== 'undefined') ?  title : false;
35813	opts.text = (typeof text !== 'undefined') ?  text : false;
35814	opts.type = (typeof type !== 'undefined') ?  type : "success";
35815	opts.delay = (typeof delay !== 'undefined') ?  delay : 10000;
35816	opts.hide = (typeof autohide !== 'undefined') ?  autohide : true;
35817	add_custom_class = (typeof custom_class !== 'undefined') ?  custom_class : '';
35818	opts.addclass = "stack-custom "+add_custom_class;
35819
35820	if (typeof options === 'object') opts = jQuery.extend(true, {}, opts, options);
35821
35822	// PNotify
35823	if (typeof PNotify !== 'undefined') {
35824		return new PNotify(opts);
35825	}
35826
35827	// docasne riesenie pokym nebude nieco univerzalnejsie
35828	if (false && typeof CsModal !== 'undefined') {
35829		let csModalType = 'info';
35830		if (type === 'error' || type === 'warning') {
35831			csModalType = type;
35832		}
35833
35834		return new CsModal()
35835			.setClassName('notification notification_alert')
35836			.setType(csModalType)
35837			.setTitle(opts.title)
35838			.setContent(opts.text)
35839			.hideCloseButton(false)
35840			.open();
35841	}
35842}
35843
35844function showNotificationsAfterReload() {
35845	/* zobrazovanie notifikacii z localstorage */
35846	var notifications = sessionStorage.getItem('NotificationsAfterReload');
35847	if (notifications) {
35848		notifications = JSON.parse(notifications);
35849		if (typeof notifications === 'object') {
35850			showNotificationsFromList(notifications);
35851			sessionStorage.removeItem('NotificationsAfterReload');
35852		}
35853	}
35854}
35855
35856/**
35857 *
35858 * @param notificationList {type: string, title: string, body: string}[]
35859 */
35860function showNotificationsFromList(notificationList) {
35861
35862	if (typeof notificationList !== 'object' || !notificationList.length) {
35863		return;
35864	}
35865
35866	notificationList.map(function(notificationData) {
35867		showNotification(notificationData.body, notificationData.title, notificationData.type);
35868	});
35869}
35870
35871/**
35872 * Validates ICO value
35873 * - normalizes input (removes special chars)
35874 * - checks rules
35875 *
35876 * @param {string} ICO
35877 * @returns {{ valid: boolean, value: string }}
35878 */
35879function validateICO(ICO) {
35880	if (typeof ICO !== 'string') {
35881		return { valid: false, value: '' };
35882	}
35883
35884	// nastaveny format ICO (napr. HU 12345678-1-23) – pomlcky ponechame, odstranime len medzery
35885	const companyIdFormat = config('js_Config_company_id_format');
35886
35887	if (companyIdFormat && companyIdFormat.pattern) {
35888		const value = ICO.replace(/\s/g, '');
35889		const patternParts = companyIdFormat.pattern.match(/^\/(.*)\/([a-z]*)$/);
35890
35891		return {
35892			valid: patternParts !== null && new RegExp(patternParts[1], patternParts[2]).test(value),
35893			value: value
35894		};
35895	}
35896
35897	// normalizácia – ponecháme len písmená a čísla
35898	const normalized = ICO
35899		.normalize('NFD') 				// kvôli diakritike
35900		.replace(/[\u0300-\u036f]/g, '')
35901		.replace(/[^a-zA-Z0-9]/g, '');
35902
35903	const hasNumber = /\d/.test(normalized);
35904	const minLength = normalized.length >= 4;
35905
35906	return {
35907		valid: hasNumber && minLength,
35908		value: normalized
35909	};
35910}
35911
35912function config(_config) {
35913	if (typeof _config !== 'string') {
35914		return undefined;
35915	}
35916
35917	if (_config.includes('.')) {
35918		let keys = _config.split('.');
35919		let obj = window;
35920		for (let i = 0; i < keys.length; i++) {
35921			obj = obj[keys[i]];
35922			if (typeof obj === 'undefined') {
35923				return undefined;
35924			}
35925		}
35926
35927		return obj;
35928	}
35929
35930	if (typeof window[_config] !== 'undefined') {
35931		return window[_config];
35932	}
35933
35934	return undefined;
35935}
35936
35937jQuery( document ).ajaxError(function(event, jqxhr, settings, thrownError) {
35938
35939	if (typeof jqxhr.status !== 'undefined' && jqxhr.status == 408){
35940
35941		jQuery(document).trigger('onAjaxError');
35942		var title = (typeof cms_js_lang_request_timeout_error_title !== 'undefined' ? cms_js_lang_request_timeout_error_title : '');
35943		var text = (typeof cms_js_lang_request_timeout_error !== 'undefined' ? cms_js_lang_request_timeout_error : '');
35944		vex.dialog.open({
35945			className: "vex-cs newsletter_vex",
35946			showCloseButton: true,
35947			escapeButtonCloses: true,
35948			message: '<span class="login-title">' + title + '</span>',
35949			input: text,
35950			buttons: [jQuery.extend({}, vex.dialog.buttons.YES, {text: "OK"})]
35951		});
35952	}
35953});
35954
35955function js_get_gdpr_form_name(form_id) {
35956	switch (form_id) {
35957		case "1":
35958			return js_gdpr_watch_dog;
35959		case "2":
35960			return js_gdpr_send_to_friend;
35961		case "3":
35962			return js_gdpr_product_question;
35963		case "4":
35964			return js_gdpr_contact_form;
35965		case "5":
35966			return js_gdpr_register_form;
35967		case "6":
35968			return js_gdpr_module_newsleatter;
35969		case "7":
35970			return js_gdpr_comment;
35971		case "8":
35972			return js_gdpr_product_best_price;
35973		case "9":
35974			return js_gdpr_representative_contact;
35975		case "100":
35976			return js_gdpr_checkout;
35977		case "400":
35978			return 'product reservation';
35979		case "499":
35980			return js_gdpr_dt_form;
35981		case "500":
35982			return js_gdpr_module_short_contact_form;
35983		case "501":
35984			return js_gdpr_module_contest_form;
35985		case "505":
35986			return js_gdpr_contact_form + " - universal";
35987		case "999":
35988			return js_gdpr_first_login;
35989		default:
35990			return js_gdpr_unknown;
35991	}
35992}
35993
35994function js_admin_user_list_gdpr_info(user_id, elem) {
35995
35996	new AjaxRequest({user_id: user_id})
35997		.setMethod('POST')
35998		.setController('Customer')
35999		.setAction('getGdprUserData')
36000		.onSuccess(function (response) {
36001			var data = response.data['gdpr'];
36002			if (data === null) {
36003				jQuery(elem).tooltipster({
36004					theme        : "tooltipster-gdpr",
36005					trigger      : 'click',
36006					contentAsHTML: true,
36007					trackTooltip : true,
36008					trackOrigin  : true,
36009					multiple     : false,
36010					timer        : 3000,
36011					content      : js_gdpr_empty_data
36012				}).tooltipster('open');
36013				return true;
36014			}
36015			var gdpr_table_html = '<table class="adminlist gdpr_approval_table">';
36016			gdpr_table_html += '<thead>';
36017			gdpr_table_html += '<th class="title"></th>';
36018			gdpr_table_html += '<th class="title" title="' + js_gdpr_version_title_head + '">' + js_gdpr_version + '</th>';
36019			gdpr_table_html += '<th class="title" title="' + js_gdpr_cdate_title_head + '">' + js_gdpr_cdate + '</th>';
36020			gdpr_table_html += '<th class="title" title="' + js_gdpr_form_id_title_head + '">' + js_gdpr_form_id + '</th>';
36021			gdpr_table_html += '</thead>';
36022			gdpr_table_html += '<tbody>';
36023			jQuery.each(data, function(i,v){
36024				if (v === null) {
36025					jQuery(elem).tooltipster({
36026						theme        : "tooltipster-gdpr",
36027						trigger      : 'click',
36028						contentAsHTML: true,
36029						trackTooltip : true,
36030						trackOrigin  : true,
36031						multiple     : false,
36032						timer        : 3000,
36033						content      : js_gdpr_empty_data
36034					}).tooltipster('open');
36035					return true;
36036				}
36037				gdpr_table_html += '<tr>';
36038				gdpr_table_html += '<td class="data">' + '<span class="cs_icon csi-file-text-o" onclick="js_admin_user_list_get_gdpr_verion(' + v.version_id + ', this)" title="' + js_gdpr_copy + '"></span>' + '</td>';
36039				gdpr_table_html += '<td class="data" title="' + js_gdpr_version_title + '">' + v.version_id + '</td>';
36040				gdpr_table_html += '<td class="data">' + v.cdate + '</td>';
36041				gdpr_table_html += '<td class="data">' + js_get_gdpr_form_name(v.form_id) + '</td>';
36042				gdpr_table_html += '</tr>';
36043			});
36044			if (typeof response.data['additional_approves'] !== 'undefined') {
36045				jQuery.each(response.data['additional_approves'], function(i,v) {
36046
36047					jQuery.each(v.tableData, function (ii, vv) {
36048						gdpr_table_html += '<tr>';
36049						gdpr_table_html += '<td class="data"> </td>';
36050						gdpr_table_html += '<td class="data">' + v.title + '</td>';
36051						jQuery.each(vv, function (iii, vvv) {
36052							gdpr_table_html += '<td class="data">' + vvv + '</td>';
36053						});
36054						gdpr_table_html += '</tr>';
36055					});
36056
36057				});
36058			}
36059			gdpr_table_html += '</tbody></table>';
36060
36061			vex.dialog.open({
36062				message: '<span class="login-title">' + js_gdpr_personal_gdpr_approval_title + '</span>',
36063				input: gdpr_table_html,
36064				buttons: [
36065					jQuery.extend({}, vex.dialog.buttons.NO, {
36066						text: 'OK'
36067					})
36068				],
36069				callback: function(data) {
36070				}
36071			});
36072		})
36073		.send();
36074}
36075
36076function js_admin_user_lisg_gdpr_personal_info(user_id) {
36077
36078	if (typeof user_id === 'undefined') {
36079		user_id = 0;
36080	}
36081
36082	new AjaxRequest({user_id: user_id})
36083		.setMethod('POST')
36084		.setController('Customer')
36085		.setAction('getGdprUserPersonalInfo')
36086		.onSuccess(function (response) {
36087			var data = response.data[0];
36088			var gdpr_table_html = '';
36089
36090			for (var index in data) {
36091				gdpr_table_html += '<fieldset class="gdpr_fieldset">';
36092				gdpr_table_html += '<legend>' + (data[index].address_type == "BT" ? js_lang_address_type_bt : js_lang_address_type_st) + '</legend>';
36093				gdpr_table_html += '<div class="fieldset_content">';
36094					gdpr_table_html += '<div class="name_cell">';
36095						gdpr_table_html += '<span class="title">';
36096							gdpr_table_html += js_lang_gdpr_name;
36097						gdpr_table_html += '</span>';
36098						gdpr_table_html += '<span class="order_address_name">';
36099				gdpr_table_html += (data[index].first_name != null && data[index].first_name != "" ? data[index].first_name : '') + ' ' + (data[index].middle_name != null && data[index].middle_name != "" ? data[index].middle_name : '') + ' ' + (data[index].last_name != null && data[index].last_name != "" ? data[index].last_name : '');
36100				gdpr_table_html += '</span>';
36101				gdpr_table_html += '</div>';
36102				gdpr_table_html += '<div class="address_cell">';
36103				gdpr_table_html += '<span class="title">' + js_lang_address + '</span>';
36104				gdpr_table_html += '<span>' + data[index].address_1 + '</span>';
36105				gdpr_table_html += '<div class="country_name">' + data[index].zip + ' ' + data[index].city + '</div>';
36106				gdpr_table_html += '<div class="country_name">' + data[index].state + '</div>';
36107					gdpr_table_html += '</div>';
36108					if (data[index].phone_1 != null && data[index].phone_1 != "") {
36109						gdpr_table_html += '<div class="phone_cell">';
36110							gdpr_table_html += '<span class="order_detail_phone">';
36111								gdpr_table_html += '<span class="title">' + js_lang_phone + '</span>';
36112								gdpr_table_html += '<span class="phone_number">' + data[index].phone_1 + '</span>';
36113							gdpr_table_html += '</span>';
36114						gdpr_table_html += '</div>';
36115					}
36116					if (data[index].user_email != null && data[index].user_email != "") {
36117						gdpr_table_html += '<div class="email_cell">';
36118							gdpr_table_html += '<span class="order_detail_email">';
36119							gdpr_table_html += '<span class="title">E-mail:</span>';
36120							gdpr_table_html += '<span class="email_address">' + data[index].user_email + '</span>';
36121							gdpr_table_html += '</span>';
36122						gdpr_table_html += '</div>';
36123					}
36124				gdpr_table_html += '</div>';
36125			}
36126
36127			gdpr_table_html += '</tbody></table>';
36128			vex.dialog.open({
36129				message: '<span class="login-title">' + js_gdpr_personal_data_title + '</span>',
36130				input: gdpr_table_html,
36131				buttons: [
36132					jQuery.extend({}, vex.dialog.buttons.NO, {
36133						text: 'OK'
36134					})
36135				],
36136				callback: function(data) {
36137				}
36138			});
36139		})
36140		.send();
36141}
36142
36143function js_admin_user_list_get_gdpr_verion(version_id, elem) {
36144
36145	var tmpData = '';
36146	new AjaxRequest({version_id: version_id})
36147		.setMethod('POST')
36148		.setController('Customer')
36149		.setAction('getGdprVersion')
36150		.setAsync(false) //asi nerobi nic
36151		.onSuccess(function (response) {
36152			tmpData = response.data[0];
36153		})
36154		.send();
36155
36156	setTimeout( function () {copyTextToClipboard(tmpData, elem);}, 500);
36157
36158}
36159
36160/**
36161 * Dynamicky loadne js a css zdroje na stranku, callback vrati true alebo false oznacujuci uspesnu akciu pre vsetky url
36162 * @param {object} scripts Zoznam url pre loading
36163 * @param {function} callback Zavola po loadnuti vsetkych scriptov
36164 */
36165function csLoadScripts(scripts, callback){
36166
36167	if ( typeof window.loadedScripts === 'undefined' ) window.loadedScripts = {};
36168	if ( typeof scripts !== 'object' ){
36169
36170		if ( typeof callback === 'function' ) callback(false);
36171		return;
36172	}
36173
36174	var tag;
36175	var _check = function(){
36176		var done = true;
36177		var ok = true;
36178		jQuery.each(scripts, function(c,v){
36179			var hash = jQuery.md5(v);
36180			if ( typeof window.loadedScripts[hash] === 'undefined' ){
36181				done = false;
36182				return false;
36183			}
36184			if ( !window.loadedScripts[hash] ) ok = false;
36185		});
36186		if ( done && typeof callback === 'function' ) callback(ok);
36187	};
36188
36189	var _success = function(hash){
36190		window.loadedScripts[hash] = 1;
36191		_check();
36192	};
36193
36194	var _error = function(hash){
36195		window.loadedScripts[hash] = 0;
36196		_check();
36197	};
36198
36199	jQuery.each(scripts, function(c,url){
36200
36201		var hash = jQuery.md5(url);
36202		var type = ( url.search('\\.js$') > -1 ? 'js' : (url.search('\\.css$') > -1 ? 'css' : 0) );
36203
36204		if ( !type ) _error(hash);
36205		else if ( typeof window.loadedScripts[hash] !== 'undefined' ) _success(hash);
36206		else {
36207
36208			if ( type == 'js' ){
36209				tag = document.createElement('script');
36210				tag.type = 'text/javascript';
36211				tag.src = url;
36212				tag.onload = function(){ _success(hash); };
36213				tag.onreadystatechange = function(){ _success(hash); };
36214			} else {
36215				tag = document.createElement('link');
36216				tag.type = 'text/css';
36217				tag.rel = 'stylesheet';
36218				tag.href = url;
36219				tag.onload = function(){ _success(hash); };
36220				tag.onreadystatechange = function(){ _success(hash); };
36221			}
36222
36223			document.head.appendChild(tag);
36224		}
36225	});
36226}
36227
36228function copyTextToClipboard(text, elem, customTooltip){
36229
36230	showLoader();
36231	function selectElementText(element) {
36232		if (document.selection) {
36233			var range = document.body.createTextRange();
36234			range.moveToElementText(element);
36235			range.select();
36236		} else if (window.getSelection) {
36237			var range = document.createRange();
36238			range.selectNode(element);
36239			window.getSelection().removeAllRanges();
36240			window.getSelection().addRange(range);
36241		}
36242	}
36243
36244	var element = document.createElement('DIV');
36245	element.innerHTML = text;
36246	document.body.appendChild(element);
36247	selectElementText(element);
36248	document.execCommand('copy');
36249	element.remove();
36250
36251	hideLoader();
36252	jQuery(elem).tooltipster({
36253		theme        : "tooltipster-gdpr",
36254		trigger      : 'click',
36255		contentAsHTML: true,
36256		trackTooltip : true,
36257		trackOrigin  : true,
36258		multiple     : false,
36259		timer        : 3000,
36260		content      : typeof customTooltip !== 'undefined' ? customTooltip : js_gdpr_article_c
36260opy
36261	}).tooltipster('open');
36262	jQuery(elem).attr("title", js_gdpr_copy);
36263}
36264
36265function changePositionModuleSwitch (type, name) {
36266	var cookie_name = 'PositionModuleSwitcher';
36267	var property_name = type + '_' + name;
36268	var class_name = 'active_switch_' + type + '_' + name;
36269
36270	var cookie_value = Cookies.get(cookie_name);
36271	if (cookie_value == null || cookie_value == '')
36272		cookie_value = {};
36273	else
36274		cookie_value = JSON.parse(cookie_value);
36275
36276	if (typeof cookie_value[property_name] != 'undefined') {
36277		delete cookie_value[property_name];
36278		jQuery('body').removeClass(class_name);
36279	} else {
36280		cookie_value[property_name] = 1;
36281		jQuery('body').addClass(class_name);
36282	}
36283
36284	cookie_value = JSON.stringify(cookie_value);
36285	Cookies.set(cookie_name, cookie_value, { expires : 365, path : '/' });
36286}
36287
36288function js_download_base64_file (name, content, type, id) {
36289	id = typeof(id) != 'undefined' ? '_'+id : '';
36290	var byteCharacters = window.atob(content);
36291	var byteArrays = [];
36292	var sliceSize = 512;
36293	var slice;
36294	var byteNumbers;
36295
36296	for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
36297		slice = byteCharacters.slice(offset, offset + sliceSize);
36298		byteNumbers = new Array(slice.length);
36299
36300		for (var i = 0; i < slice.length; i++) {
36301			byteNumbers[i] = slice.charCodeAt(i);
36302		}
36303
36304		byteArray = new Uint8Array(byteNumbers);
36305		byteArrays.push(byteArray);
36306	}
36307
36308	blob = new Blob(byteArrays, {type: type});
36309	var link = document.createElement('a');
36310	link.href = window.URL.createObjectURL(blob);
36311	if (type == 'application/pdf') {
36312		link.target = '_blank';
36313	} else {
36314		link.download = name;
36315	}
36316	link.id = 'download_base_64_file_temp_elem_id' + id;
36317	jQuery('body').append(link);
36318	link.click();
36319	jQuery(link).remove();
36320}
36321
36322function js_copy_to_clipboard (text) {
36323	var input = jQuery('<input>').val(text).appendTo('body').trigger('select');
36324	document.execCommand('copy');
36325	input.remove();
36326}
36327
36328if ( typeof lazySizesConfig !== "undefined" ) {
36329	// lazysizes CONFIGURACIA - nadstavba na lazyLoad
36330	window.lazySizesConfig.loadHidden = false;
36331}
36332if ( is_cs_user('lazyload_preload') && typeof lazySizesConfig !== "undefined" ) {
36333	window.lazySizesConfig.preloadAfterLoad = true;
36334}
36335
36336$jQ = jQuery.noConflict();
36337
36338/*
36339 * Checks whether the value passed to the function is numeric
36340 * Therefore both 0 and '0' will return true, but 'zero' will return false
36341 * Replacement for jQuery.isNumeric fn, which was deprecated
36342 *
36343 * @return bool
36344 */
36345function isNumeric (num) {
36346	return !isNaN(parseFloat(num)) && isFinite(num);
36347}
36348
36349/*
36350 * Append loader/spinner on element
36351 * Replacement for jQuery.fancybox.showLoading();
36352 * @auth TL
36353 *
36354 * @param element [string] (valid jQuery selector) - element to which loader will be appended
36355 * @return void
36356 */
36357function showLoader (element) {
36358	if (typeof element === 'undefined') {
36359		element = 'body';
36360	}
36361
36362	let $elem = jQuery(element).first();
36363	let html  = '<span class="css_graph_ajax_loader"></span>';
36364
36365	if ($elem.length && !$elem.children('.css_graph_ajax_loader').length) {
36366		$elem.append(html);
36367	}
36368}
36369/*
36370 * Hide loader/spinner
36371 * Replacement for jQuery.fancybox.hideLoading();
36372 * @auth TL
36373 *
36374 * @param element {string} (valid jQuery selector) - element from which the loader will be removed
36375 * @param hideAll {bool} - if set to true, all loaders inside the element, no matter on which level, will be removed
36376 * @return void
36377 */
36378function hideLoader (element, hideAll) {
36379	if (typeof element == 'undefined') {
36380		element = 'body';
36381	}
36382
36383	if (typeof hideAll == 'undefined') {
36384		hideAll = false;
36385	}
36386
36387	let $elem = jQuery(element).first();
36388
36389	if (hideAll) {
36390		$elem.find('.css_graph_ajax_loader').remove();
36391	} else {
36392		$elem.children('.css_graph_ajax_loader').remove();
36393	}
36394}
36395
36396function toggleMiddleSubCategories(elem, module) {
36397	switch (module) {
36398		case 'middle_subcategories':
36399			jQuery(elem).closest('.module_middle_subcategories').toggleClass('show_all');
36400			break;
36401		case 'kateg':
36402			jQuery(elem)
36403				.toggleClass('open')
36404				.closest('ul')
36405				.toggleClass('open');
36406			break;
36407		case 'topten':
36408			jQuery(elem)
36409				.toggleClass('open')
36410				.closest('.module-topten')
36411				.toggleClass('open');
36412			break;
36413		case 'modTopCategorySales':
36414			jQuery(elem)
36415				.toggleClass('open')
36416				.closest('.module-topten-cat')
36417				.toggleClass('open');
36418			break;
36419		default:
36420			return;
36421	}
36422}
36423
36424
36425function js_flypage_product_as_sqm_init() {
36426	if ( typeof js_Config_show_package_sqm_in_product_detail !== 'undefined' && js_Config_show_package_sqm_in_product_detail ) {
36427		//if(is_cs_user()) {
36428		var currency   = shop_currency_info[shop_vendor_currency_code],
36429		    focusInput = false;
36430		if (!jQuery('.flypage-kosik[data-packagesqm]').length) {
36431			return false;
36432		}
36433
36434		let bodyElem = jQuery('body');
36435		let quantitySqmElem = jQuery('#quantity_sqm');
36436
36437		quantitySqmElem.keypress(function (e) {
36438			if (e.which == 46) {
36439				if (jQuery(this).val().indexOf('.') != -1 || jQuery(this).val().indexOf(',') != -1) {
36440					return false;
36441				}
36442			}
36443			if (e.which == 44) {
36444				if (jQuery(this).val().indexOf('.') != -1 || jQuery(this).val().indexOf(',') != -1) {
36445					return false;
36446				}
36447			}
36448
36449			if (e.which != 8 && e.which != 0 && e.which != 46 && e.which != 44 && (e.which < 48 || e.which > 57)) {
36450				return false;
36451			}
36452		});
36453
36454		bodyElem.on('keyup mouseup', '#quantity_sqm', function () {
36455			//úprava JB 02-04-2020 po DR, nesprávne zaokrúhľovanie
36456			//nakoniec premiestniť z LOCAL.JS
36457			//nefunkčné zaokrúhľvoanie a podobne.. na eshope majú nastavneé 3 desatinné miesta..
36458			var new_value     = quantitySqmElem.val().replace(',', '.');
36459			var one_package_text = jQuery('.total_unit_price .price_unit').text().replace(',', '.');
36460			var one_package   = parseFloat(one_package_text);
36461			var price_per_sqm = parseFloat(jQuery('#product-detail-price-value').text().replace(',', '.'));
36462			var package_decimal_places = (one_package_text.match(/\.(\d+)/) || ['', ''])[1].length;
36463			var quantity_decimal_places = Math.max(2, package_decimal_places);
36464			var new_package   = Math.ceil((parseFloat(new_value) / one_package) - 0.000000001);
36465			//var quantity_sqm = (Math.round(parseFloat(new_package * one_package) * 100) / 100);
36466			//var new_price = (Math.round(parseFloat(quantity_sqm * price_per_sqm) * 100) / 100);
36467			var quantity_sqm = parseFloat(new_package * one_package).toFixed(quantity_decimal_places);
36468			var new_price    = parseFloat(quantity_sqm * price_per_sqm);
36469			if (new_package == 1) {
36470				package_text = ' balenie';
36471			} else if (new_package > 1 && new_package < 5) {
36472				package_text = ' balenia';
36473			} else {
36474				package_text = ' balení';
36475			}
36476			jQuery('#quantity').val(quantity_sqm);
36477			jQuery('.form_info .bal').text(new_package);
36478			jQuery('.form_info .bal_text').text(package_text + ' (' + String(parseFloat(quantity_sqm).toFixed(2)).replace('.', ',') + jQuery('.quantity_per_sqm').html() + ')');
36479			jQuery('.form_info .price').html(js_format_Money(new_price, currency.DECIMALS, currency.SYMBOL, currency['1000_SYMBOL'], currency.DEC_SYMBOL));
36480		});
36481
36482		quantitySqmElem.on('focus', function () {
36483			jQuery(this).get(0).setSelectionRange(0, 9999);
36484		});
36485
36486		bodyElem.on('cartUpdated', () => quantitySqmElem.trigger('keyup'));
36487
36488		quantitySqmElem.trigger('keyup');
36489	}
36490}
36491
36492/*
36493	Custom confirmation vex
36494    PJ
36495    Based on js_delete_confirm_vex(), more customizable
36496    options {
36497        getSelectedSplit
36498        getSelected
36499        actionLang
36500        itemLangOne, itemLangTwo, itemLangMore,
36501        errorTooltip,
36502        mainText,
36503        inputText1,
36504        inputAdditionalText1,
36505        inputText2,
36506        inputAdditionalText2,
36507        customInfo,
36508        yesButtonText
36509    }
36510 */
36511
36512function vexCustomConfirm(options, callback) {
36513	var selected = options.getSelectedSplit;
36514	var total = selected.curPage + selected.otherPages;
36515	var title = '';
36516
36517	if (total == 1) {
36518		// napr. produkt
36519		title = options.actionLang + ' ' + total + options.itemLangOne.replace('.', '');
36520	} else if (total < 5) {
36521		// napr. produkty
36522		title = options.actionLang + ' ' + total + options.itemLangTwo.replace('.', '');
36523	} else {
36524		// napr. produktov
36525		title = options.actionLang + ' ' + total + options.itemLangMore.replace('.', '');
36526	}
36527
36528	var customOptions = jQuery.extend({
36529		total: selected,
36530		vexTitle: title
36531	}, options);
36532
36533	js_confirm_vex(customOptions, callback);
36534}
36535
36536
36537/*
36538 * Confirmation Vex
36539 * @auth TL
36540 *
36541 * @param customOptions {object}
36542 * @param callback {function} - callback function to be executed upon successful confirmation
36543 * @return void
36544 */
36545function js_delete_confirm_vex(customOptions, callback) {
36546
36547	// OPTIONS:
36548	var options = jQuery.extend({
36549		total: {
36550			count: 1
36551		},
36552		vexTitle: '',
36553		mainText: '',
36554		inputText1: '',
36555		inputAdditionalText1: '',
36556		errorTooltip: ''
36557	}, customOptions);
36558
36559	if (typeof options.total === 'string' || typeof options.total === 'number') {
36560		var itemsTotal     = parseInt(options.total);
36561		var numberOfInputs = [1];
36562	} else {
36563		var itemsTotal     = 0;
36564		var numberOfInputs = Object.keys(options.total);
36565		for (var i = 0; i < numberOfInputs.length; i++) {
36566			itemsTotal += parseInt(options.total[numberOfInputs[i]]);
36567		}
36568	}
36569
36570	var vexTitle = '<span class="login-title">' + options.vexTitle + '</span>';
36571	var vexYesButtonText = cms_js_lang_delete;
36572	if (typeof customOptions.yesButtonText !== 'undefined' && customOptions.yesButtonText.length > 0) {
36573		vexYesButtonText = customOptions.yesButtonText;
36574	}
36575
36576	var vexContent = options.mainText;
36577
36578	if (typeof customOptions.dontAddItemsTotal === 'undefined' || (typeof customOptions.dontAddItemsTotal !== 'undefined' && !customOptions.dontAddItemsTotal)) {
36579		vexContent += ' <strong>' + itemsTotal + '</strong>';
36580	}
36581
36582	jQuery.each(numberOfInputs, function (index, value) {
36583		// if inputText is undefined, continue into another loop iteration
36584		if ( typeof options['inputText' + (index + 1)] === 'undefined' ) return;
36585
36586		if ((typeof options.total === 'string' || typeof options.total === 'number') ? (index === 0 || options.total > 0) : (index === 0 || options.total[value] > 0)) {
36587			vexContent += '<br><br><span class="vex-dialog-span">' + options['inputText' + (index + 1)] + ' <strong>' + ((typeof options.total === 'string' || typeof options.total === 'number') ? options.total : options.total[value]) + '</strong> ';
36588			vexContent += options['inputAdditionalText' + (index + 1)] + '</span><br><br>';
36589			vexContent += '<input type="number" name="' + value + '" class="inputbox vex-dialog-confirm-input" placeholder="0" min="0">';
36590		} else {
36591			vexContent += '<input type="hidden" name="confirmedOtherPages" value="
365910">';
36592		}
36593	});
36594
36595	if (typeof customOptions.customDeleteInfo !== 'undefined' && customOptions.customDeleteInfo.length > 0) {
36596		vexContent += customOptions.customDeleteInfo;
36597	}
36598
36599	stop_submit_vex_enter();
36600	vex.dialog.confirm({
36601		title: vexTitle,
36602		vexCount: 1,
36603		className: 'vex-cs vex-text delete_items_vex delete_items_vex_new',
36604		message: vexTitle,
36605		input : vexContent,
36606		afterOpen: function(){
36607			stop_submit_vex_enter(this);
36608		},
36609		buttons: {
36610			YES: {
36611				text     : vexYesButtonText,
36612				className: "vex-dialog-button-primary",
36613				type     : "button",
36614				click    : function () {
36615
36616					var $inputs = jQuery('.vex-dialog-confirm-input');
36617					var wrongInputs = [];
36618					var valuesAreEqual = true;
36619
36620					$inputs.each(function (index, input) {
36621						input = jQuery(input);
36622						var nameAttr = input.prop('name');
36623
36624						if (input.hasClass('error')) {
36625							input.removeClass('error').tooltipster('destroy');
36626						}
36627
36628						if ( $inputs.length === 1 ) {
36629							if ( itemsTotal !== parseInt(input.val()) ) {
36630								wrongInputs.push(input);
36631							}
36632						} else {
36633							if ( options.total[nameAttr] !== parseInt(input.val()) ) {
36634								wrongInputs.push(input);
36635							}
36636						}
36637					});
36638
36639					if ( wrongInputs.length ) {
36640
36641						jQuery.each(wrongInputs, function(index, input) {
36642							jQuery(input).tooltipster({
36643								theme        : "tooltipster-gdpr",
36644								contentAsHTML: true,
36645								trackTooltip : true,
36646								trackOrigin  : true,
36647								multiple     : true,
36648								timer        : 5000,
36649								content      : options.errorTooltip
36650							}).tooltipster('open');
36651
36652							jQuery(input).addClass('error');
36653						});
36654
36655						return;
36656					}
36657
36658					callback();
36659					vex.close();
36660				}
36661			},
36662			NO : {
36663				text     : cms_js_lang_module_copy_btn_cancel,
36664				className: "vex-dialog-button-secondary",
36665				type     : "button",
36666				click    : function () {
36667					return vex.close();
36668				}
36669			}
36670		}
36671	});
36672}
36673
36674function js_confirm_vex(customOptions, callback) {
36675	// OPTIONS:
36676	var options = jQuery.extend({
36677		total: {
36678			count: 1
36679		},
36680		vexTitle: '',
36681		mainText: '',
36682		className: '',
36683		inputText1: '',
36684		inputAdditionalText1: '',
36685		errorTooltip: ''
36686	}, customOptions);
36687
36688	var itemsTotal = 0;
36689	var numberOfInputs = Object.keys(options.total);
36690	for (var i = 0; i < numberOfInputs.length; i++) {
36691		itemsTotal += parseInt( options.total[numberOfInputs[i]] );
36692	}
36693
36694	var vexTitle = '<span class="login-title">' + options.vexTitle + '</span>';
36695
36696	var vexContent;
36697	vexContent = options.mainText + ' <strong>' + itemsTotal + '</strong>';
36698
36699	jQuery.each(numberOfInputs, function (index, value) {
36700		// if inputText is undefined, continue into another loop iteration
36701		if ( typeof options['inputText' + (index + 1)] === 'undefined' ) return;
36702
36703		if (index === 0 || options.total[value] > 0) {
36704			vexContent += '<br><br><span class="vex-dialog-span">' + options['inputText' + (index + 1)] + ' <strong>' + options.total[value] + '</strong> ';
36705			vexContent += options['inputAdditionalText' + (index + 1)] + '</span><br><br>';
36706			vexContent += '<input type="number" name="' + value + '" class="inputbox vex-dialog-confirm-input" placeholder="0" min="0">';
36707		} else {
36708			vexContent += '<input type="hidden" name="confirmedOtherPages" value="0">';
36709		}
36710	});
36711
36712	if (typeof customOptions.customInfo !== 'undefined' && customOptions.customInfo.length > 0) {
36713		vexContent += customOptions.customInfo;
36714	}
36715
36716	stop_submit_vex_enter();
36717	var confirmVex = vex.dialog.confirm({
36718		title: vexTitle,
36719		vexCount: 1,
36720		className: 'vex-cs vex-text ' + options.className,
36721		message: vexTitle,
36722		input : vexContent,
36723		afterOpen: function(){
36724			stop_submit_vex_enter(this);
36725		},
36726		buttons: {
36727			YES: {
36728				text     : options.yesButtonText,
36729				className: "vex-dialog-button-primary",
36730				type     : "button",
36731				click    : function () {
36732
36733					var $inputs        = confirmVex.find('.vex-dialog-confirm-input');
36734					var wrongInputs    = [];
36735
36736					$inputs.each(function (index, input) {
36737						input        = jQuery(input);
36738						var nameAttr = input.prop('name');
36739
36740						if (input.hasClass('error')) {
36741							input.removeClass('error').tooltipster('destroy');
36742						}
36743
36744						if ($inputs.length === 1) {
36745							if (itemsTotal !== parseInt(input.val())) {
36746								wrongInputs.push(input);
36747							}
36748						} else {
36749							if (options.total[nameAttr] !== parseInt(input.val())) {
36750								wrongInputs.push(input);
36751							}
36752						}
36753					});
36754
36755					if (wrongInputs.length) {
36756
36757						jQuery.each(wrongInputs, function (index, input) {
36758							jQuery(input).tooltipster({
36759								theme        : "tooltipster-gdpr",
36760								contentAsHTML: true,
36761								trackTooltip : true,
36762								trackOrigin  : true,
36763								multiple     : true,
36764								timer        : 5000,
36765								content      : options.errorTooltip
36766							}).tooltipster('open');
36767
36768							jQuery(input).addClass('error');
36769						});
36770
36771						return;
36772					}
36773
36774					callback();
36775					vex.close();
36776				}
36777			},
36778			NO : {
36779				text     : cms_js_lang_module_copy_btn_cancel,
36780				className: "vex-dialog-button-secondary",
36781				type     : "button",
36782				click    : function () {
36783					return vex.close();
36784				}
36785			}
36786		}
36787	});
36788}
36789
36790function google_recaptcha_add_wrap_class() {
36791	if ( typeof MutationObserver != 'undefined' ) {
36792		var observer = new MutationObserver(function(mutations) {
36793			mutations.forEach(function(mut) {
36794				if ( jQuery(mut.target).find('div.g-recaptcha-bubble-arrow').length > 0 ) {
36795					jQuery(mut.target).find('div.g-recaptcha-bubble-arrow').parent().addClass('g-recaptcha-wrap');
36796				}
36797			});
36798		});
36799		observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true});
36800	}
36801}
36802
36803/**
36804 * presunute z comments.js lebo sa ta funkcia pouziva aj v registracii [2020-03-02] - tomasL
36805 * Validate google recaptcha
36806 * @function validation_by_google_recaptcha
36807 *
36808 * @author Miro
36809 *
36810 * @return {Boolean}
36811 */
36812function validation_by_google_recaptcha()
36813{
36814	return jQuery('#g-recaptcha-response').val();
36815}
36816
36817function js_infobar_cs(module) {
36818	var mod = jQuery(module);
36819	if ( !mod.length || ( typeof admin_view_design !== 'undefined' && typeof admin_view_design == 0 ) ) { return false; }
36820	var body = jQuery('body');
36821	var scrollTop_old = null;
36822	var scrollTop = null;
36823	body.addClass('show_banner_infobar');
36824	mod.find('.close').on('click',function () { //.text
36825		body.removeClass('show_banner_infobar');
36826		mod.addClass('hide');
36827		var time = new Date();
36828		Cookies.set('banner_infobar_hidden', Math.floor(time.getTime() / 1000));
36829		if (typeof js_infobar_content_md5 !== 'undefined') {
36830			Cookies.set('banner_infobar_msg', js_infobar_content_md5);
36831		}
36832		body.addClass('banner_infobar_hidden');
36833	});
36834}
36835
36836function js_vex_show_after_registration_user_activation_2() {
36837
36838	vex.dialog.open({
36839		message: '<h6>' + js_lang_phpshop_registration_thank_you_vex_title + '</h6>',
36840		input: js_lang_phpshop_registration_thank_you_vex,
36841		buttons: [
36842			jQuery.extend({}, vex.dialog.buttons.YES, { text: 'Ok'})
36843		],
36844		callback: function (data) {
36845			window.location = window.location.protocol + '//' + window.location.host;
36846		}
36847	});
36848}
36849
36850function js_product_mass_bonus_assign() {
36851	var checkedProducts = jQuery('input:checked[name="product_id[]"][type="checkbox"]').length;
36852	if (checkedProducts == 0) {
36853		vex.dialog.alert({message: '<?php echo $VM_LANG->_PHPSHOP_MAKE_SEL_FROM_LIST_FOR_ACTION . " " . $VM_LANG->_PHPSHOP_PRODUCT_SPECIAL_GROUP_MASS_SPECIAL_ASSIGN_LBL; ?>'});
36854		return;	//	bez parametra !!!
36855	}
36856
36857	jQuery.get(js_global_live_site + '/administrator/index3.php?pshop_mode=admin&page=product.product_list&option=com_shop&ajax_call=1&ajax_func=product_bonus_assign_get_groups&no_html=1&no_menu=1', {'product_count': checkedProducts}, function (res) {
36858		var bonusSelectHtml = JSON.parse(res);
36859		vex.open({
36860			content  : bonusSelectHtml.bonusSelectHtml,
36861			afterOpen: function () {
36862			console.log(JSON.parse(res));
36863			/*	start_improve_multiselect();
36864				var group_select_element = jQuery('.vex-content select[name="product_special_group_id[]"]:first');
36865				group_select_element.find('option').on('click', function () {
36866					js_multiple_select_option_click(jQuery(this));
36867				});
36868
36869				jQuery('#mass_special_group_moving_container select[name="product_special_group_id[]"]')
36870					.prop('size', '10')
36871					.css('width', '100%')
36872					.css('height', 'auto');*/
36873			}
36874		});
36875	});
36876
36877	return;
36878}
36879
36880function js_product_mass_bonus_assign_save() {
36881	var selectedBonus        = jQuery('select[name="product_bonus_id[]"] option:selected');
36882	var bonusSelectedMethod = jQuery('#mass_product_bonus_select_method option:selected');
36883	var selectedProducts = js_getSelectedProducts();
36884
36885	if ( selectedProducts.length > 0 && selectedBonus.length == 1 && bonusSelectedMethod.length == 1 ) {
36886		var options = {
36887			'productSpecialId': selectedBonus.val(),
36888			'selectedMethod'  : bonusSelectedMethod.val(),
36889			'selectedProducts': selectedProducts,
36890		};
36891
36892		jQuery.post(js_global_live_site + '/administrator/index3.php?pshop_mode=admin&page=product.product_list&option=com_shop&ajax_call=2&ajax_func=save_mass_product_bonus&no_html=1&no_menu=1', options, function (res) {
36893			if (res == '0') {
36894				alert(cms_js_lang_products_shipping_message_error_2);
36895			}
36896
36897			window.location.reload();
36898		});
36899	}
36900}
36901
36902function js_set_partial_shipping(elem) {
36903	showLoader();
36904	var element = jQuery(elem);
36905	new AjaxRequest({ hasPartialShipping: element.is(":checked") })
36906		.setController("Basket")
36907		.setAction("setPartialShipping")
36908		.onSuccess(function (result) {
36909			hideLoader();
36910			window.location.reload();
36911		})
36912		.send();
36913}
36914
36915function moduleCreativeShopSwitch(elem) {
36916	var $elem = jQuery(elem);
36917
36918	$elem.prop('disabled',true);
36919
36920	var $newContentWrapper = $elem.closest('div.video-news-page').find('div.more');
36921
36922	if ($newContentWrapper.html() == '') {
36923		$elem.startAjaxLoader();
36924		new AjaxRequest()
36925			.setMethod('POST')
36926			.setController('Module')
36927			.setAction('moduleCreativeshopNewsAsyncLoad')
36928			.onSuccess(function (response) {
36929				$elem.prop('disabled',false);
36930				$newContentWrapper.html(response['data'][0]);
36931				$newContentWrapper.removeClass('hide');
36932				$newContentWrapper.removeClass('hidden');
36933				$elem.stopAjaxLoader();
36934				$elem.html($elem.data('hide'));
36935			})
36936			.onError(function (response) {
36937				$elem.prop('disabled',false);
36938				$elem.stopAjaxLoader();
36939				$elem.html($elem.data('show'));
36940			})
36941			.send();
36942	} else {
36943
36944		if ($newContentWrapper.is(':visible')) {
36945			$newContentWrapper.hide();
36946			$elem.html($elem.data('show'));
36947		} else {
36948			$newContentWrapper.show();
36949			$elem.html($elem.data('hide'));
36950		}
36951	}
36952}
36953
36954/**
36955 * Univerzalny wrapper na rendering/manipulaciu stromu z json dat
36956 * Pouziva ztree plugin http://www.treejs.cn/v3/api.php
36957 * @author IAN
36958 * TODO: kedze to bolo narychlo robene, treba dotiahnut niektore ficurky ako iteraciu nodov,hlasky,eventy,callbacks atd...
36959 */
36960var CsTree = function(id, options){
36961	var obj = this;
36962	obj.box = {};
36963	obj.tree = {};
36964	obj.ztree = {};
36965	obj.search = {};
36966	obj.keyword = '';
36967	obj.timer = 0;
36968	obj.index = 0;
36969	obj.options = {
36970		data: {},
36971		selected: [],
36972		setting: {
36973			data: {
36974				key: {
36975					name: "title",
36976					children: "branch",
36977					idKey: "id"
36978				}
36979			},
36980			check: {
36981				enable: true,
36982				chkboxType: {"Y": "", "N": ""}
36983			},
36984			view: {
36985				showTitle: false,
36986				expandSpeed: ''
36987			},
36988			callback: {
36989				onClick: function (event, treeId, treeNode) {}
36990			}
36991		}
36992	};
36993	obj.init = function (id, options) {
36994
36995		obj.options = jQuery.extend(true, obj.options, options);
36996		obj.tree = jQuery('#'+id);
36997
36998		if ( !obj.tree.length ) return;
36999
37000		obj.box = obj.tree.closest('.nc_nav_master');
37001
37002		if ( obj.box.length ){
37003
37004			obj.search = obj.box.find('.nc_search_input');
37005
37006			if ( obj.search.length ){
37007
37008				obj.search.on('keyup', function (e) {
37009					var input = jQuery(this);
37010					var value = jQuery.trim(input.val());
37011
37012					if (value == '' || value.length < 2) {
37013						obj.resetSearch();
37014						return;
37015					}
37016
37017					if (obj.keyword == value) {
37018						return;
37019					}
37020
37021					obj.keyword = value;
37022
37023					if (obj.timer > 0) {
37024						return;
37025					}
37026
37027					obj.timer = setTimeout(function () {
37028
37029						clearTimeout(obj.timer);
37030						obj.timer = 0;
37031						obj.find();
37032					}, 300);
37033				});
37034			}
37035		}
37036
37037		obj.ztree = jQuery.fn.zTree.init(obj.tree, obj.options.setting, obj.options.data);
37038
37039		if ( obj.options.selected.length ) obj.select(obj.options.selected);
37040	}
37041	obj.select = function (selected){
37042
37043		jQuery.each(selected, function (i, u) {
37044
37045			var node = obj.ztree.getNodeByParam("id", u, null);
37046			if (node !== null) obj.ztree.checkNode(node, true, false);
37047		});
37048	}
37049	obj.getChecked = function(){
37050
37051		var ret = [];
37052		var nodes = obj.ztree.getCheckedNodes(true);
37053
37054		for (var i = 0; i < nodes.length; i++) {
37055
37056			ret.push(nodes[i].id);
37057		}
37058
37059		return ret;
37060	}
37061	obj.find = function(){
37062
37063		if (obj.keyword == '') {
37064
37065			obj.resetSearch();
37066			return;
37067		}
37068
37069		obj.ztree.cancelSelectedNode();
37070
37071		var keyword = obj.keyword.latinise();
37072
37073		var nodes = obj.ztree.getNodesByFilter(obj.filter, false, null, keyword);
37074
37075		obj.index = 0;
37076
37077		if (nodes.length > 0) {
37078
37079			for (var i = 0; i < nodes.length; i++) {
37080
37081				if (i == 0) obj.scroll(nodes[i]);
37082
37083				obj.ztree.selectNode(nodes[i], true, true);
37084			}
37085			//cscat.iterator[id].addClass('found').removeClass('notfound').text(' ' + nodes.length).attr('title', cms_js_iterate_found);
37086		} else {
37087			//cscat.iterator[id].removeClass('found').addClass('notfound').text(' ' + 0).attr('title', cms_js_iterate_notfound);
37088		}
37089	}
37090	obj.resetSearch = function(clearinput){
37091
37092		if (clearinput) obj.search.val('');
37093		obj.ztree.cancelSelectedNode();
37094		obj.keyword = '';
37095		obj.index = -1;
37096	}
37097	obj.scroll = function(node){
37098
37099		if (typeof node === 'undefined' || node === null) return;
37100
37101		var row = obj.tree.find('#' + node.tId);
37102
37103		// Node nebol otvoreny a zatial neexistuje
37104		if (!row.length){
37105
37106			var nodes = node.getPath();
37107			if (nodes.length){
37108
37109				for(var i=0; i<nodes.length; i++){
37110
37111					obj.ztree.expandNode(nodes[i], true, true, true);
37112				}
37113
37114				row = obj.tree.find('#' + node.tId);
37115			}
37116		} else {
37117
37118			obj.ztree.expandNode(node, true, true, true);
37119		}
37120
37121		// V strome uz nemame tento node
37122		if (!row.length) return;
37123
37124		obj.timer = setTimeout(function () {
37125
37126			clearTimeout(obj.timer);
37127			obj.timer = 0;
37128			obj.tree.stop().animate({scrollTop: row[0].offsetTop}, 300);
37129		}, 150);
37130	}
37131	obj.filter = function(node, keyword){
37132
37133		if ( typeof node[obj.options.setting.data.key.name] === 'undefined' ) return false;
37134		var regex = new RegExp(keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), "i");
37135		var label = node[obj.options.setting.data.key.name].latinise();
37136		return regex.test(String(label));
37137	}
37138	obj.init(id, options);
37139	return obj;
37140}
37141
37142//JB globálna zmena množstva produtku.. nie je potrebné aby sme mali v systéme 4 funckie
37143/*
37144*  element, má v sebe cez data-attributes všetky hodnoty potrebné na vyhodnotenie
37145* */
37146function jsChangeProductQuantity(elem) {
37147	if (typeof elem !== 'undefined') {
37148		var jQueryBody = jQuery('body');
37149		var elem = jQuery(elem);
37150		var finalQuantity = 0;
37151
37152		var params = {
37153			'inputSelector'     : elem.data('input_selector'),
37154			'parentSelector'    : elem.data('parent_selector'),
37155			'action'            : elem.data('action'),
37156			'quantity'          : elem.data('quantity'),
37157			'decimals'          : 0,
37158			'defaultValue'      : elem.data('default_value'),
37159		};
37160
37161
37162
37163		//pridanie zaokrúhľovania množstva podľa potreby -> počet desatinných miest samotného quantity / forcedQuantity
37164		//blobo by fajn nahodiť tam : js_Config_vm_use_decimal_product_quantity, lenže to má mmoentálne zlé hodnoty, prípadne produkt môže mať menší počet desatinných miest
37165		if (Math.floor(params.quantity) != params.quantity) {
37166			params.decimals = params.quantity.toString().split(".")[1].length || 0;
37167		}
37168
37169		var quantityInput = elem.closest(params.parentSelector).find(params.inputSelector);
37170
37171		if (typeof quantityInput.data('allow_zero_quantity') !== 'undefined') {
37172			params.allowZeroQuantity = quantityInput.data('allow_zero_quantity');
37173		} else {
37174			params.allowZeroQuantity = 0;
37175		}
37176
37177		//množstevné nákupy
37178		if ( typeof quantityInput.data('maximum_quantity') !== 'undefined') {
37179			params.maximumQuantity = quantityInput.data('maximum_quantity');
37180		} else {
37181			params.maximumQuantity = 0;
37182		}
37183
37184		if ( typeof quantityInput.data('forced_quantity') !== 'undefined') {
37185			params.forcedQuantity = quantityInput.data('forced_quantity');
37186
37187			if (Math.floor(params.forcedQuantity) !== params.forcedQuantity) {
37188				params.decimals = params.forcedQuantity.toString().split(".")[1].length || 0;
37189			}
37190
37191		} else {
37192			params.forcedQuantity = 0;
37193		}
37194
37195		if ( typeof quantityInput.data('minimum_quantity') !== 'undefined') {
37196			params.minimumQuantity = quantityInput.data('minimum_quantity');
37197		} else {
37198			params.minimumQuantity = 0;
37199		}
37200
37201		params.floatFix = Math.pow(10, params.decimals);
37202
37203		var startingQuantity = parseFloat(quantityInput.val().replace(',','.'));
37204
37205		switch (params.action) {
37206			case 'add' :
37207
37208				if (params.forcedQuantity) {
37209					finalQuantity = (startingQuantity + parseFloat(params.forcedQuantity) ).toFixed(params.decimals);
37210
37211					if (params.minimumQuantity && (parseFloat(finalQuantity) < parseFloat(params.minimumQuantity)) && !params.allowZeroQuantity) {
37212						finalQuantity = params.minimumQuantity;
37213					} else if (params.maximumQuantity && (parseFloat(finalQuantity) > parseFloat(params.maximumQuantity))) {
37214						finalQuantity = params.maximumQuantity;
37215					}
37216				} else {
37217					finalQuantity = (startingQuantity + parseFloat(params.quantity) ).toFixed(params.decimals);
37218				}
37219
37220				finalQuantity = parseFloat(finalQuantity).toFixed(params.decimals);
37221
37222				quantityInput.val( finalQuantity ).attr('value', finalQuantity).trigger('change');
37223
37224				if (quantityInput.data('refresh')) {
37225					quantityInput.closest('tr').find('input[name="update"]').click();
37226				}
37227				jQueryBody.trigger('jsChangeProductQuantity', [quantityInput, finalQuantity]);
37228				return 1;
37229			case 'sub' :
37230
37231				if (params.forcedQuantity) {
37232					finalQuantity = (startingQuantity - parseFloat(params.forcedQuantity)).toFixed(params.decimals);
37233					if (params.minimumQuantity && (finalQuantity < params.minimumQuantity)) {
37234
37235						//ak je sa nažíme pridať menšie množstvo ako je minimum a je povolené zero Quantity, setneme na 0, inak vrátime na minimum
37236						if (params.allowZeroQuantity) {
37237							finalQuantity = 0;
37238						} else {
37239							finalQuantity = params.minimumQuantity;
37240						}
37241					} else if (params.maximumQuantity && (finalQuantity > params.maximumQuantity)) {
37242						finalQuantity = params.maximumQuantity;
37243					}
37244
37245					if ( !(finalQuantity > 0) ) {
37246						if (params.allowZeroQuantity) {
37247							finalQuantity = 0;
37248						} else {
37249							finalQuantity = params.forcedQuantity;
37250						}
37251					}
37252
37253				} else {
37254					//potrebujeme si uložiť minimálne množstvo čo je buď 1 ks alebo min. množstvo
37255					finalQuantity = Math.ceil( (startingQuantity - parseFloat(params.quantity)).toFixed(params.decimals));
37256
37257					if ( !(finalQuantity > 0) ) {
37258						if (params.allowZeroQuantity) {
37259							finalQuantity = 0;
37260						} else {
37261							finalQuantity = 1;
37262						}
37263					}
37264				}
37265
37266				// JB 05-06-2020 maťova žiadosť -> množstvo sa nemá dostať na nulu cez buttony
37267				//finalQuantity = parseFloat(quantityInput.val()) - params.quantity;
37268				//finalQuantity = parseFloat(finalQuantity).toFixed(params.decimals);
37269				//TODO : defaultValue by mal byť len bool ktorý určuje či s
37269a dostane produkt na nulu alebo nie -> takže to bude 1 / minimálne / krokové množstvo
37270
37271				if ( finalQuantity === 0 ) {
37272					//  FIX: v riadkovom výpise sa vzdy opyta, ci user chce odstranit product z kosika
37273					if( !params.allowZeroQuantity || params.parentSelector === '.basket_quantity_wrapper' ) {
37274						vex.dialog.confirm({
37275							message : js_lang_shopping_cart_delete_item_confirm,
37276							callback: function (confirmed) {
37277								if ( confirmed ) {
37278									refreshQuantity(quantityInput, finalQuantity, true);
37279								} else {
37280									return false;
37281								}
37282							}
37283						});
37284						return false;
37285					}
37286
37287					refreshQuantity(quantityInput, finalQuantity);
37288					return false;
37289				}
37290
37291				refreshQuantity(quantityInput, finalQuantity);
37292
37293				jQueryBody.trigger('jsChangeProductQuantity', [quantityInput, finalQuantity]);
37294				return 1;
37295			case 'set' :
37296				//úprava on blur funkciou, po každom vyplnení inputu sa spraví validácia na dané množstvo aby sedelo zadanému množstvu, ktoré používateľ zadal
37297				finalQuantity = parseFloat(elem.val().replace(',','.'));
37298
37299				if (params.minimumQuantity && ( finalQuantity < params.minimumQuantity ) && !params.allowZeroQuantity  ) {
37300					finalQuantity = params.minimumQuantity;
37301				}
37302				if (params.maximumQuantity && finalQuantity > params.maximumQuantity) {
37303					finalQuantity = params.maximumQuantity;
37304				}
37305
37306				if (params.forcedQuantity) {
37307
37308					//je možno potrebné upraviť na cfg
37309
37310					if (1 || is_cs_user()) {
37311						//zaokrúhli vždy k väčšiemu
37312						finalQuantity = (parseFloat(params.forcedQuantity) * Math.ceil( finalQuantity / parseFloat(params.forcedQuantity) )).toFixed(params.decimals);
37313					} else {
37314						//zaokrúhli dole / nahor -> podľa toho čo je bližšie
37315						finalQuantity = (parseFloat(params.forcedQuantity) * Math.ceil( (  finalQuantity / parseFloat(params.forcedQuantity) ).toFixed(params.decimals))).toFixed(params.decimals);
37316					}
37317				}
37318
37319				if ( !(finalQuantity > 0) ) {
37320					if (params.allowZeroQuantity) {
37321						finalQuantity = 0;
37322					} else {
37323						if (params.forcedQuantity) {
37324							finalQuantity = params.forcedQuantity;
37325						} else {
37326							finalQuantity = 1;
37327						}
37328					}
37329				}
37330
37331				//posledná úprava aby sa do inputu nedostala záporná hodnota, prípadne nula
37332
37333				//quantityInput.val( ( finalQuantity > 0 ) ? (finalQuantity.toFixed(params.decimals).toString()) : 0).trigger('change');
37334				quantityInput.val( finalQuantity ).attr('value', finalQuantity).trigger('change');
37335
37336				if (finalQuantity != startingQuantity) {
37337					quantityInput.addClass('error_inputbox_animation');
37338					setTimeout(function() {
37339						quantityInput.removeClass('error_inputbox_animation');
37340					}, 1000);
37341
37342					var lang = js_lang_insufficient_quantity_inform;
37343					lang     = lang.replace('{from}', startingQuantity);
37344					lang     = lang.replace('{to}', finalQuantity);
37345
37346					quantityInput.closest('.quantity_wrapper').tooltipster({
37347						theme    : 'cs_tooltipster_grey_theme tooltipster_minquantity',
37348						animation: 'fade',
37349						side     : 'top',
37350						delay    : 10,
37351						timer    : 5000
37352					})
37353						.tooltipster('content', lang)
37354						.tooltipster('open');
37355				}
37356				if (quantityInput.data('refresh')) {
37357					quantityInput.closest('tr').find('input[name="update"]').click();
37358				}
37359
37360				jQueryBody.trigger('jsChangeProductQuantity', [quantityInput, finalQuantity]);
37361				return 1;
37362			default :
37363				jQueryBody.trigger('jsChangeProductQuantity', [quantityInput, finalQuantity]);
37364				return 1;
37365		}
37366	}
37367	return 0;
37368}
37369
37370function refreshQuantity(quantityInput, quantity, forceRefresh = false) {
37371	quantityInput.val( quantity ).attr('value', quantity).trigger('change');
37372
37373	if (quantityInput.data('refresh') || forceRefresh) {
37374		quantityInput.closest('tr').find('input[name="update"]').click();
37375	}
37376}
37377
37378function js_checkout_thankyou_message_to_unregistered_customer (data) {
37379	if ( typeof data !== 'undefined' && typeof data.data !== 'undefined' && data.data != '' ) {
37380		vex.dialog.open({
37381			message  : '<h4>' + data.title + '</h4>',
37382			className: 'vex-cs vex-dialog-checkout-thankyou-unregistered-message',
37383			input    : data.data,
37384			buttons: [
37385				jQuery.extend({}, vex.dialog.buttons.YES, { text: js_lang_checkout_thankyou_unregistered_vex_confirm }),
37386			],
37387		});
37388	}
37389}
37390
37391// loyalty scheme
37392function js_add_to_loyalty_scheme_checkbox_handler (elem) {
37393	elem = jQuery(elem);
37394	var isChecked = elem.is(':checked');
37395	if (isChecked) {
37396		jQuery.cookie('add_to_loyalty_scheme_checked', '1', {path:'/'});
37397	} else if (jQuery.cookie('add_to_loyalty_scheme_checked')) {
37398		jQuery.cookie('add_to_loyalty_scheme_checked', null, {path:'/'});
37399	}
37400}
37401
37402/**
37403 * Toggles cstools on/off
37404 *
37405 * @return void
37406 */
37407function toggleCsTools() {
37408	jQuery('.pres_btn.nobg').trigger('click');
37409}
37410
37411function initInfowidgetCountdownTimer (duration, display) {
37412	infowidgetInterval = setInterval(function () {
37413		if ( typeof js_Config_infowidget_countdown_timer.current !== 'undefined' ) {
37414			now = js_Config_infowidget_countdown_timer.current * 1000;
37415			if ( typeof infowidgetCountDownHelper == 'undefined' ) {
37416				infowidgetCountDownHelper = 0;
37417			} else {
37418				infowidgetCountDownHelper += 1;
37419				now += infowidgetCountDownHelper * 1000;
37420			}
37421		} else {
37422			var now = new Date().getTime();
37423		}
37424
37425		var timeleft = duration - now;
37426
37427		var days = Math.floor(timeleft / (1000 * 60 * 60 * 24));
37428		var hours = Math.floor((timeleft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
37429		var minutes = Math.floor((timeleft % (1000 * 60 * 60)) / (1000 * 60));
37430		var seconds = Math.floor((timeleft % (1000 * 60)) / 1000);
37431
37432		if ( seconds < 0 || minutes < 0 || hours < 0 || days < 0 ) {
37433			clearInterval(infowidgetInterval);
37434			display.hide();
37435		}
37436
37437		var daysText = '';
37438		var hoursText = '';
37439		var minutesText = '';
37440		var secondsText = '';
37441
37442		if ( days == 1 ) {
37443			daysText = days + ' ' + (typeof js_lang_time_day_1 !== 'undefined' ? js_lang_time_day_1 : 'day') ;
37444		} else if ( days > 1 && days < 5 ) {
37445			daysText = days + ' ' + (typeof js_lang_time_day_more !== 'undefined' ? js_lang_time_day_more : 'days') ;
37446		} else if ( days >= 5 ) {
37447			daysText = days + ' ' + (typeof js_lang_time_day_more_2 !== 'undefined' ? js_lang_time_day_more_2 : 'days' );
37448		}
37449
37450		if ( hours == 1 ) {
37451			hoursText = hours + ' ' + (typeof js_lang_time_hours_1 !== 'undefined' ? js_lang_time_hours_1 : 'hours') ;
37452		} else if ( hours > 1 && hours < 5 ) {
37453			hoursText = hours + ' ' + (typeof js_lang_time_hours_2_4 !== 'undefined' ? js_lang_time_hours_2_4 : 'hours') ;
37454		} else if ( hours >= 5 || ( hours == 0 && days != 0 ) ) {
37455			hoursText = hours + ' ' + (typeof js_lang_time_hours_more !== 'undefined' ? js_lang_time_hours_more : 'hours') ;
37456		}
37457
37458		if ( minutes == 1 ) {
37459			minutesText = minutes + ' ' + (typeof js_lang_time_minutes_1 !== 'undefined' ? js_lang_time_minutes_1 : 'minute') ;
37460		} else if ( minutes > 1 && minutes < 5 ) {
37461			minutesText = minutes + ' ' + (typeof js_lang_time_minutes_2_4 !== 'undefined' ? js_lang_time_minutes_2_4 : 'minutes') ;
37462		} else if ( minutes >= 5 || ( minutes == 0 && ( days != 0 || hours != 0 ) ) ) {
37463			minutesText = minutes + ' ' + (typeof js_lang_time_minutes_more !== 'undefined' ? js_lang_time_minutes_more : 'minutes') ;
37464		}
37465
37466		if ( seconds == 1 ) {
37467			secondsText = seconds + ' ' + (typeof js_lang_time_seconds_1 !== 'undefined' ? js_lang_time_seconds_1 : 'second') ;
37468		} else if ( seconds > 1 && seconds < 5 ) {
37469			secondsText = seconds + ' ' + (typeof js_lang_time_seconds_2_4 !== 'undefined' ? js_lang_time_seconds_2_4 : 'seconds') ;
37470		} else if ( seconds >= 5 || ( seconds == 0 && ( days != 0 || hours != 0 || minutes != 0 ) ) ) {
37471			secondsText = seconds + ' ' + (typeof js_lang_time_seconds_more !== 'undefined' ? js_lang_time_seconds_more : 'seconds') ;
37472		}
37473
37474		display.text(daysText + ' ' + hoursText + ' ' + minutesText + ' ' + secondsText);
37475	}, 1000);
37476}
37477
37478function tempNewLoader (toggle, reload, fade) {
37479	var $body = jQuery('body');
37480	var fadeDuration = 300;
37481
37482	if ( typeof loaderTimeouts === 'undefined' ) {
37483		loaderTimeouts = [];
37484	}
37485
37486	var changeText = function changeText(text) { jQuery('.css_graph_ajax_loader_text').text(text); };
37487
37488	if ( !toggle ) {
37489		if ( fade ) {
37490			$body.find('.css_graph_ajax_loader_wrapper').fadeOut(fadeDuration, function() {
37491				jQuery(this).remove();
37492			});
37493		} else {
37494			$body.find('.css_graph_ajax_loader_wrapper').remove();
37495		}
37496
37497		loaderTimeouts.map(function (timeoutId) {
37498			clearTimeout(timeoutId);
37499		});
37500		delete loaderTimeouts;
37501		return;
37502	}
37503
37504	if ($body.children('.css_graph_ajax_loader_wrapper').length) {
37505		return;
37506	}
37507
37508	var loaderTexts = {
37509		initial: typeof js_lang_checkout_loader_initial !== 'undefined' ? js_lang_checkout_loader_initial : '',
37510		intermediate: typeof js_lang_checkout_loader_intermediate !== 'undefined' ? js_lang_checkout_loader_intermediate : '',
37511		final: typeof js_lang_checkout_loader_final !== 'undefined' ? js_lang_checkout_loader_final : ''
37512	};
37513
37514	var html = [
37515		'<span class="css_graph_ajax_loader_wrapper">',
37516		'<span class="css_graph_ajax_loader_inner">',
37517		'<span class="css_graph_ajax_loader"></span>',
37518		'<span class="css_graph_ajax_loader_text"></span>',
37519		'</span>',
37520		'</span>'
37521	].join('');
37522
37523	loaderTimeouts.push(setTimeout(function () {
37524		changeText(loaderTexts.initial);
37525		}, 3000));
37526
37527	loaderTimeouts.push(setTimeout(function () {
37528		changeText(loaderTexts.intermediate);
37529		}, 5000));
37530
37531	loaderTimeouts.push(setTimeout(function () {
37532		changeText(loaderTexts.final);
37533		}, 15000));
37534
37535	if ( reload ) {
37536		loaderTimeouts.push(setTimeout(function() {
37537			window.location.reload();
37538		}, 30000));
37539	}
37540
37541	if ( fade ) {
37542		$body.append(jQuery(html).hide().fadeIn(fadeDuration));
37543	} else {
37544		$body.append(jQuery(html));
37545	}
37546}
37547
37548var CsLoader = {
37549	fade: false,
37550	fadeDuration: 300,
37551	reload: false,
37552	loaderLangs: {
37553		initial: typeof js_lang_checkout_loader_initial !== 'undefined' ? js_lang_checkout_loader_initial : 'Spracováva sa...',
37554		intermediate: typeof js_lang_checkout_loader_intermediate !== 'undefined' ? js_lang_checkout_loader_intermediate : 'Chvíľku strpenia...',
37555		final: typeof js_lang_checkout_loader_final !== 'undefined' ? js_lang_checkout_loader_final : 'Ešte chvíľu počkajte...',
37556	},
37557	loaderTimeoutDurations: {
37558		initial: 3000,
37559		intermediate: 5000,
37560		final: 15000,
37561		reload: 30000,
37562	},
37563	loaderTimeouts: {},
37564	transparentBackground: false,
37565	blurBackground: true,
37566	loaderTextSelector: '.css_graph_ajax_loader_text',
37567	loaderWrapperSelector: '.css_graph_ajax_loader_wrapper',
37568	html: [
37569		'<span class="css_graph_ajax_loader_wrapper">',
37570		'<span class="css_graph_ajax_loader_inner">',
37571		'<span class="css_graph_ajax_loader"></span>',
37572		'<span class="css_graph_ajax_loader_text"></span>',
37573		'</span>',
37574		'</span>'
37575	].join(''),
37576	htmlTransparent: [
37577		'<span class="css_graph_ajax_loader_wrapper" style="background:transparent;">',
37578		'<span class="css_graph_ajax_loader_inner">',
37579		'<span class="css_graph_ajax_loader"></span>',
37580		'<span class="css_graph_ajax_loader_text"></span>',
37581		'</span>',
37582		'</span>'
37583	].join(''),
37584	startLoader: function ( selector ) {
37585
37586		if ( typeof selector !== 'string' || selector === '' ) {
37587			selector = 'body';
37588		}
37589
37590		var $body = jQuery(selector);
37591
37592		if ( this.isLoaderActive(selector) ) {
37593			return;
37594		}
37595
37596		if ( selector === 'body' && this.blurBackground === true ) {
37597			$body.addClass('csloader-active');
37598		}
37599
37600		this.loaderTimeouts[selector] = [];
37601		this.loaderTimeouts[selector].push(setTimeout(function () {
37602			CsLoader.changeText(CsLoader.loaderLangs.initial, selector);
37603		}, this.loaderTimeoutDurations.initial));
37604
37605		this.loaderTimeouts[selector].push(setTimeout(function () {
37606			CsLoader.changeText(CsLoader.loaderLangs.intermediate, selector);
37607		}, this.loaderTimeoutDurations.intermediate));
37608
37609		this.loaderTimeouts[selector].push(setTimeout(function () {
37610			CsLoader.changeText(CsLoader.loaderLangs.final, selector);
37611		}, this.loaderTimeoutDurations.final));
37612
37613		if ( this.reload ) {
37614			this.loaderTimeouts[selector].push(setTimeout(function() {
37615				window.location.reload();
37616			}, this.loaderTimeoutDurations.reload));
37617		}
37618
37619		if ( this.fade ) {
37620			if ( this.transparentBackground ) {
37621				$body.append(jQuery(this.htmlTransparent).hide().fadeIn(this.fadeDuration));
37622			} else {
37623				$body.append(jQuery(this.html).hide().fadeIn(this.fadeDuration));
37624			}
37625		} else {
37626			if ( this.transparentBackground ) {
37627				$body.append(jQuery(this.htmlTransparent));
37628			} else {
37629				$body.append(jQuery(this.html));
37630			}
37631		}
37632	},
37633
37634	stopLoader: function ( selector ) {
37635
37636		if ( typeof selector !== 'string' || selector === '' ) {
37637			selector = 'body';
37638		}
37639
37640		if ( !this.isLoaderActive(selector) ) {
37641			return;
37642		}
37643
37644		if ( this.fade ) {
37645			jQuery(selector).children(this.loaderWrapperSelector).fadeOut(this.fadeDuration, function() {
37646				jQuery(this).remove();
37647			});
37648		} else {
37649			jQuery(selector).children(this.loaderWrapperSelector).remove();
37650		}
37651
37652		if ( selector === 'body' ) {
37653			jQuery(selector).removeClass('csloader-active');
37654		}
37655
37656		this.clearTimeouts(selector);
37657	},
37658
37659	clearTimeouts: function (selector) {
37660		CsLoader.loaderTimeouts[selector].map(function (timeoutId) {
37661			clearTimeout(timeoutId);
37662		});
37663		delete CsLoader.loaderTimeouts[selector];
37664	},
37665
37666	changeText: function(text, selector) {
37667		jQuery(selector).children(this.loaderWrapperSelector).find(this.loaderTextSelector).html(text);
37668	},
37669
37670	isLoaderActive: function ( selector ) {
37671		if ( jQuery(selector).children(this.loaderWrapperSelector).length ) {
37672			return true;
37673		}
37674		return false;
37675	},
37676
37677	setLoaderText: {
37678		initial: function (text) {
37679			if ( typeof text === 'string' ) {
37680				CsLoader.loaderLangs.initial = text;
37681			}
37682		},
37683		intermediate: function (text) {
37684			if ( typeof text === 'string' ) {
37685				CsLoader.loaderLangs.intermediate = text;
37686			}
37687		},
37688		final: function (text) {
37689			if ( typeof text === 'string' ) {
37690				CsLoader.loaderLangs.final = text;
37691			}
37692		},
37693	},
37694
37695	setLoaderTimeout: {
37696		initial: function (duration) {
37697			if ( typeof duration === 'number' ) {
37698				CsLoader.loaderTimeoutDurations.initial = duration;
37699			}
37700		},
37701		intermediate: function (duration) {
37702			if ( typeof duration === 'number' ) {
37703				CsLoader.loaderTimeoutDurations.intermediate = duration;
37704			}
37705		},
37706		final: function (duration) {
37707			if ( typeof duration === 'number' ) {
37708				CsLoader.loaderTimeoutDurations.final = duration;
37709			}
37710		},
37711		reload: function (duration) {
37712			if ( typeof duration === 'number' ) {
37713				CsLoader.loaderTimeoutDurations.reload = duration;
37714			}
37715		}
37716	},
37717
37718	toggleFade: function (fade) {
37719		if ( typeof fade === 'boolean' ) {
37720			CsLoader.fade = fade;
37721		}
37722	},
37723
37724	setFadeDuration: function (duration) {
37725		if ( typeof duration === 'number' ) {
37726			CsLoader.fadeDuration = duration;
37727		}
37728	},
37729
37730	toggleReload: function (reload) {
37731		if ( typeof reload === 'boolean' ) {
37732			CsLoader.reload = reload;
37733		}
37734	},
37735
37736	stopAll: function () {
37737		if ( this.fade ) {
37738			jQuery(this.loaderWrapperSelector).fadeOut(this.fadeDuration, function() {
37739				jQuery(this).remove();
37740			});
37741		} else {
37742			jQuery(this.loaderWrapperSelector).remove();
37743		}
37744
37745		Object.keys(this.loaderTimeouts).map(function (selector) {
37746			CsLoader.clearTimeouts(selector);
37747		});
37748	},
37749
37750};
37751
37752function faqTableStructuredData(tableSelector) {
37753	if (!jQuery('.banner_faq_init').length) {
37754		return;
37755	}
37756
37757	// Použi selector ak je zadaný, inak default
37758	const selector = tableSelector || '.banner_faq_content .module_cont';
37759	const faqArray = [];
37760	const tableElem = jQuery(selector).find('tbody');
37761
37762	if (tableElem.length > 0) {
37763		tableElem.each(function (key, table) {
37764			const currentTable = jQuery(table);
37765			currentTable.find('tr').each(function (key, questionElem) {
37766				let question = jQuery(questionElem).find('td:first span').text().trim();
37767				if (question === '') {
37768					question = jQuery(questionElem).find('td:first').text().trim();
37769				}
37770
37771				const prohibited = {
37772					'sk': 'NOŽE',
37773					'cz': 'NOŽE',
37774					'de': 'MESSER',
37775					'at': 'MESSER',
37776					'ro': 'CUȚITE',
37777					'pl': 'NOŻE',
37778					'si': 'NOŽI',
37779					'hu': 'KÉSEK',
37780				};
37781
37782				const prohibitedWord = prohibited[js_get_lang] || prohibited['sk'];
37783				if (question.includes(prohibitedWord)) {
37784					return;
37785				}
37786
37787				let answer = jQuery(questionElem).find('td').last().text().trim();
37788				if (answer === '') {
37789					answer = jQuery(questionElem).find('td').last().find('span').text().trim();
37790				}
37791
37792				if (question !== '' && answer !== '') {
37793					faqArray.push({
37794						'@type': 'Question',
37795						'name': question,
37796						'acceptedAnswer': {
37797							'@type': 'Answer',
37798							'text': answer
37799						}
37800					});
37801				}
37802			});
37803		});
37804
37805		if (faqArray.length > 0) {
37806			const jsonLd = {
37807				"@context": "https://schema.org",
37808				"@type": "FAQPage",
37809				"mainEntity": faqArray
37810			};
37811
37812			const script = document.createElement('script');
37813			script.setAttribute('type', 'application/ld+json');
37814			script.textContent = JSON.stringify(jsonLd);
37815			document.head.appendChild(script);
37816		}
37817	}
37818}
37819
37820function isElementInView(elem) {
37821	var $elem = jQuery(elem);
37822
37823	if ($elem.length > 0) {
37824		var rect = $elem[0].getBoundingClientRect();
37825		return rect.bottom >= 0 && rect.right >= 0 && rect.top <= (window.innerHeight || document.documentElement.clientHeight) && rect.left <= (window.innerWidth || document.documentElement.clientWidth);
37826	}
37827
37828	return false;
37829}
37830
37831function lazyLoadFunction(selector, callback, callbackObject, ...params) {
37832	// Guard
37833	if (typeof callback !== 'function' && (typeof callbackObject === 'undefined' || typeof callbackObject[callback] !== 'function')) {
37834		if (is_cs_user()) {
37835			console.log('Nefunkcne spustenie optimalizovaneho lazyloadu - callback nie je funkcia');
37836		}
37837
37838		return;
37839	}
37840
37841	// Cant watch this element, run callback
37842	if (jQuery(selector).length === 0) {
37843		if (typeof callbackObject !== 'undefined') {
37844			callbackObject[callback](...params);
37845		} else {
37846			callback(...params);
37847		}
37848
37849		if (is_cs_user()) {
37850			console.log('Nefunkčné spustenie optimalizovaného lazyloadu - nepodarilo sa nájsť element');
37851		}
37852
37853		return;
37854	}
37855
37856	// Element is in view, run callback instatly
37857	if (isElementInView(selector)) {
37858		if (typeof callbackObject !== 'undefined') {
37859			callbackObject[callback](...params);
37860		} else {
37861			callback(...params);
37862		}
37863
37864		return;
37865	}
37866
37867	// Element is not in view, run callback after 5 seconds or when user scrolls element into view
37868	if (typeof window.lazyLoadElements === 'undefined') {
37869		window.lazyLoadElements = [];
37870	}
37871
37872	let uniqueId = window.lazyLoadElements.length;
37873	let eventNamespace = 'scroll.lle_' + uniqueId;
37874	let timeout = config('js_CS_Config_lazyLoadFunctions_pagespeed') ? 20000 : 5000;
37875
37876	window.lazyLoadElements.push(selector);
37877	// Load after time spent
37878	setTimeout(function () {
37879		if (typeof window.lazyLoadElements[uniqueId] === 'undefined') {
37880			return;
37881		}
37882
37883		window.lazyLoadElements[uniqueId] = undefined;
37884
37885		if (typeof callbackObject !== 'undefined') {
37886			callbackObject[callback](...params);
37887		} else {
37888			callback(...params);
37889		}
37890
37891		jQuery(window).off('.lle_' + uniqueId);
37892	}, timeout, uniqueId, params, callback, callbackObject);
37893
37894	// Load when user scrolls element into view
37895	jQuery(window).on(eventNamespace, {
37896		uniqueId: uniqueId,
37897		selector: selector,
37898		params: params,
37899		callback: callback,
37900		callbackObject: callbackObject
37901	}, function (ev) {
37902		if (typeof window.lazyLoadElements[ev.data.uniqueId] !== 'string') {
37903			jQuery(window).off('.lle_' + ev.data.uniqueId);
37904			return;
37905		}
37906
37907		if (!isElementInView(ev.data.selector)) {
37908			return;
37909		}
37910
37911		window.lazyLoadElements[ev.data.uniqueId] = null;
37912
37913		if (typeof callbackObject !== 'undefined') {
37914			callbackObject[callback](...params);
37915		} else {
37916			callback(...params);
37917		}
37918
37919		jQuery(window).off('.lle_' + ev.data.uniqueId);
37920	});
37921}
37922
37923function showMessageAfterAddToCart (elem) {
37924	var $elem = jQuery(elem);
37925	if ( $elem.hasClass('vex_product_is_in_spg') && typeof js_Config_show_vex_after_add_to_cart !== 'undefined' && js_Config_show_vex_after_add_to_cart && typeof CsModal !== "undefined" ) {
37926		var modalSettings = JSON.parse(js_Config_show_vex_after_add_to_cart);
37927		var buttons = "<input type=\"button\" class=\"button cs_modal_sec_button\" name=\"submit\" title=\"\" onclick=\"messageModal.close();\" value=" + js_lang_admin_media_cancel + "><input type=\"button\" name=\"login-button\" onclick=\"window.location.href='" + modalSettings.loginLink + "'\" class=\"button\" title=\"\" value=\"" + (typeof js_lang_vex_after_add_to_cart_login !== 'undefined' ? js_lang_vex_after_add_to_cart_login : 'Login') + "\">";
37928		var modalTitle = getLang(modalSettings.title);
37929		var modalContent = getLang(modalSettings.content);
37930
37931		if ( modalTitle == '' ) {
37932			modalTitle = modalSettings.title;
37933		}
37934
37935		if ( modalContent == '' ) {
37936			modalContent = modalSettings.content;
37937		}
37938
37939		messageModal = new CsModal()
37940			.setClassName('type_login_required')
37941			.setType('info')
37942			.setTitle(modalTitle)
37943			.setContent(modalContent)
37944			.setButtons(buttons)
37945			.open();
37946		return false;
37947	}
37948}
37949
37950function bindAutoCouponTooltip() {
37951	var autoAddButton = jQuery('.shop_cart_coupon_form form .tooltip-code-add');
37952	if (typeof js_Config_parser_enabled !== 'undefined' && js_Config_parser_enabled) {
37953		window.addEventListener('DOMContentLoaded', function() {
37954			autoAddButton.on('click', setAutoCoupon);
37955		});
37956	} else {
37957		jQuery(function(){
37958			autoAddButton.on('click', setAutoCoupon);
37959		});
37960	}
37961}
37962
37963function setAutoCoupon(event) {
37964	var autoButton = jQuery(event.target);
37965	var couponForm = autoButton.closest('form');
37966	var couponAutoCode = autoButton.parent().find('.tooltip-code').attr('data-code');
37967
37968	if(typeof couponAutoCode !== 'undefined' && couponAutoCode !== '') {
37969		couponForm.find('input[name=do_coupon]').val('yes');
37970		couponForm.find('input[name=delete_coupon]').val('no');
37971		couponForm.find('input[name=coupon_code]').val(couponAutoCode);
37972		couponForm.find('input[name=unset_autoskip]').val('yes');
37973	}
37974
37975	couponForm.find('input[type=submit]').trigger('click');
37976}
37977
37978/**
37979 * @elem : .cs_rating_wrapper element
37980 * @rating : (Optional) to change rating value
37981 * @rCount : (Optional) to change count number and toggle .is_empty
37982 * @ratingLang : (Optional) to change rating lang value
37983 */
37984function updateRatingElement(elem, rating, rCount, ratingLang) {
37985	let ratingElem = jQuery(elem);
37986
37987	if (typeof ratingElem === 'undefined' || !ratingElem.hasClass('cs_rating_wrapper')) {
37988		return;
37989	}
37990
37991	if (typeof rating !== 'undefined' && !isNaN(rating)) {
37992		let ratingPercentage = Math.floor(rating * 20);
37993		let spaceKoef = 0;
37994
37995		if (ratingPercentage > 80) {
37996			spaceKoef = 4;
37997		} else if (ratingPercentage > 60) {
37998			spaceKoef = 3;
37999		} else if (ratingPercentage > 40) {
38000			spaceKoef = 2;
38001		} else if (ratingPercentage > 10) {
38002			spaceKoef = -4;
38003		}
38004
38005		ratingElem.find('.count .val').text(rating);
38006		ratingElem.find('.rating').attr('style', '--rating:' + ratingPercentage + '%; --space-koef:' + spaceKoef + ';')
38007	}
38008
38009	if (typeof rCount !== 'undefined' && !isNaN(rCount)) {
38010		ratingElem.find('.count .total').text(rCount);
38011
38012		if (rCount > 0) {
38013			ratingElem.removeClass('is_empty');
38014		} else {
38015			ratingElem.addClass('is_empty');
38016		}
38017	}
38018
38019	if (typeof ratingLang !== 'undefined') {
38020		ratingElem.find('.count .count_total').text(ratingLang);
38021	}
38022}
38023
38024function openModalVideo(e, url, title, admin) {
38025	var videoElem = '';
38026	var yUrl = '';
38027	var yTitle = '';
38028
38029	if(typeof admin !== 'undefined' && admin) {
38030		yUrl = "https://www.youtube.com/embed/" +  url;
38031		yTitle = title;
38032	} else {
38033		e.preventDefault();
38034		e.stopPropagation();
38035
38036		videoElem = jQuery(e.target).closest('.product_video').find('a');
38037		yUrl = "https://www.youtube.com/embed/" + videoElem.attr('data-url');
38038		yTitle = videoElem.attr('data-title');
38039	}
38040
38041	var iFrame = '<iframe width="1280" height="720" src="';
38042	iFrame += yUrl;
38043	iFrame += '" title="';
38044	iFrame += '" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
38045
38046	new CsModal()
38047		.setClassName('product_video')
38048		.setType('info')
38049		.setTitle(yTitle)
38050		.setContent(iFrame)
38051		.hideCloseButton(true)
38052		.setActionsClassName('vex-dialog-buttons')
38053		.open();
38054}
38055
38056function activeImageFancyHover() {
38057	var $flypageImage = jQuery('.flypage-image a:first');
38058		$flypageImage.data('href', $flypageImage.attr('href'));
38059		$flypageImage.data('src', $flypageImage.children('img:first').attr('src'));
38060		$flypageImage.data('srcset', $flypageImage.children('img:first').attr('srcset'));
38061
38062	jQuery('.product_activeimages_image_div a').on('mouseenter', function () {
38063		var activeImage = jQuery(this);
38064		var dataOptions = $flypageImage.data('options');
38065
38066		if ( activeImage.data('fancybox') ) {
38067
38068			$flypageImage
38069				.attr('href', activeImage.attr('href'))
38070				.data('src', activeImage.attr('href'))
38071				.children('img')
38072				.attr('src', activeImage.attr('href'));
38073
38074			$flypageImage
38075				.data('options')
38076
38077			if ($flypageImage.children('img').attr('srcset') !== 'undefined' && $flypageImage.children('img').attr('srcset') !== false) {
38078				$flypageImage
38079					.attr('href', activeImage.attr('href'))
38080					.children('img')
38081					.attr('srcset', activeImage.attr('href'));
38082			}
38083		}
38084	});
38085
38086	jQuery('.product_activeimages_image_div a').on('mouseleave', function () {
38087		if (jQuery(this).data('fancybox')) {
38088			if ($flypageImage.data('href') && $flypageImage.data('src')) {
38089				$flypageImage
38090					.attr('href', $flypageImage.data('href'))
38091					.children('img')
38092					.attr('src', $flypageImage.data('src'));
38093			}
38094			if ($flypageImage.children('img').attr('srcset') !== 'undefined' && $flypageImage.children('img').attr('srcset') !== false && $flypageImage.data('srcset')) {
38095				$flypageImage
38096					.attr('href', $flypageImage.data('href'))
38097					.children('img')
38098					.attr('srcset', $flypageImage.data('srcset'));
38099			}
38100		}
38101	});
38102}
38103
38104function initSlickSlider(wrap, slide) {
38105	wrap = jQuery(wrap);
38106
38107	if (!wrap.length || wrap.hasClass('slick-initialized') || wrap.find(slide).length < 5) {
38108		return;
38109	}
38110
38111	wrap.slick({
38112		slide: slide,
38113		centerMode: true,
38114		centerPadding: '64px',
38115		slidesToShow: 1,
38116		slidesToScroll: 1,
38117		infinite: true,
38118		dots: true,
38119		variableWidth: false,
38120		draggable: false,
38121		swipeToSlide: false,
38122	});
38123}
38124
38125function bindProductActiveImageSlick() {
38126    jQuery('.cs_product_item .browse_active_images:not(.loaded)').closest('.cs_product_item').on('mouseenter', function () {
38127        var imageWrap = jQuery(this);
38128
38129        if (!imageWrap.hasClass('loaded')) {
38130            imageWrap.find('.browse_active_images').slick({
38131                slide: '.active_image',
38132                centerMode: true,
38133                centerPadding: '64px',
38134                slidesToShow: 1,
38135                slidesToScroll: 1,
38136                infinite: true,
38137                dots: true,
38138                variableWidth: false,
38139                draggable: false,
38140                swipeToSlide: false,
38141            });
38142        }
38143
38144		imageWrap.addClass('loaded');
38145    });
38146}
38147
38148function loadProductTabPage(elem, tabId) {
38149
38150	var element = jQuery(elem);
38151
38152	if ( element.hasClass('tab-loaded') ) {
38153		return;
38154	} else {
38155		// Prevencia duplicitnemu nacitanie pre zmenu sirky (napr. pri otoceni zariadenia)
38156		element
38157			.closest('#tabsContainer')
38158			.find('label[for="' + element.attr('for') + '"]')
38159			.addClass('tab-loaded')
38160			.removeClass('is_empty');
38161	}
38162
38163	var productId = js_product_id;
38164
38165	var params = {
38166		productId 	: productId,
38167		tabId		: tabId,
38168	};
38169
38170	jQuery('label[for="tab' + tabId + '"]').startAjaxLoader(undefined, undefined, undefined, {appendHtml: true});
38171
38172	new AjaxRequest(params)
38173		.setMethod('POST')
38174		.setController('ProductTab')
38175		.setAction('loadProductTab')
38176		.onSuccess(function (res) {
38177			console.log(res);
38178			if ( res.data.tabId !== '' ) {
38179				jQuery('label[for="tab' + tabId + '"]').stopAjaxLoader();
38180			}
38181
38182			if ( res.data.tabId !== '' && res.data.result !== '' ) {
38183				var tabPageId = res.data.tabId;
38184				var tabPageResult = res.data.result;
38185				var insertMode = res.data.insertMode;
38186				var tabPage = jQuery('.tabPages .tabContent#page' + tabPageId);
38187				if ( tabPage.length > 0 && tabPageResult != '' ) {
38188					if ( insertMode === 'append' ) {
38189						tabPage.append(tabPageResult);
38190					} else if ( insertMode === 'prepend' ) {
38191						tabPage.prepend(tabPageResult);
38192					}
38193
38194					if ( typeof afterProductTabLoad === 'function' ) {
38195						afterProductTabLoad(tabPageId);
38196					}
38197
38198				}
38199			}
38200		})
38201		.send();
38202}
38203
38204function afterProductTabLoad ( tabId ) {
38205	if ( typeof tabId === 'undefined' || tabId == '' || typeof js_Config_product_tabs_configuration === 'undefined' ) {
38206		return;
38207	}
38208
38209	var tabSettings = js_Config_product_tabs_configuration;
38210
38211	if ( typeof tabSettings[tabId] !== 'undefined' ) {
38212		var currentTab = tabSettings[tabId];
38213		//CODE TO EXECUTE AFTER PRODUCT TAB LOAD GOES HERE
38214		//currentTab.elements -> elementy v aktualne nacitanom tabe
38215
38216		if (currentTab.elements.includes('Product_Comments')) {
38217			if (typeof CsRating !== 'undefined') {
38218				let setRatings = jQuery('.cs_rating_wrapper.set_rating .rating');
38219				setRatings.each(function(index, elem ) {
38220					new CsRating(elem);
38221				});
38222			}
38223
38224			if (typeof js_Config_comments_use_google_recaptcha !== 'undefined' && js_Config_comments_use_google_recaptcha && typeof js_comments_render_recaptcha === 'function') {
38225				js_comments_render_recaptcha(jQuery('.tabPages .tabContent#page' + tabId));
38226			}
38227		}
38228
38229		if ( typeof after_init_tab === 'function' ) {
38230			//Toto je funkcia ktora sa bude definovat v local.js, nie kazdy shop ju musi mat
38231			after_init_tab(tabId);
38232		}
38233	}
38234}
38235
38236function js_multiselect_click_handle(element) {
38237	$element = jQuery(element);
38238	if ($element.val() == '') {
38239		// nemozeme manualne odselectnut "vsetky"
38240		if (!$element.is(':selected')) {
38241			$element.prop('selected', true);
38242		}
38243		$element.siblings('[selected]').prop('selected', false);
38244	} else {
38245		$element.siblings('[value=""]').prop('selected', false);
38246	}
38247}
38248
38249function quantityUpdate(elem, up) {
38250	var quantityWrap = jQuery(elem).closest('.quantity_wrapper');
38251	var quantityInput = quantityWrap.find('input');
38252	var qVal = quantityInput.val();
38253	var minStep = typeof quantityInput.attr('step') !== 'undefined' ? quantityInput.attr('step') * 1 : 1;
38254
38255	if (up === 1) {
38256		quantityInput.val(parseFloat(qVal) + parseFloat(minStep));
38257	} else if( qVal >= minStep) {
38258		quantityInput.val(parseFloat(qVal) - parseFloat(minStep));
38259	}
38260
38261	quantityInput.trigger('change');
38262}
38263
38264function checkQuantity(elem) {
38265	var quantityInput = jQuery(elem);
38266	var minVal = typeof quantityInput.attr('min') !== 'undefined' ? Number(quantityInput.attr('min')) : undefined;
38267	var maxVal = typeof quantityInput.attr('max') !== 'undefined' ? Number(quantityInput.attr('max')) : undefined;
38268	var val = Number(quantityInput.val());
38269
38270	if(typeof minVal !== 'undefined' && minVal > val) {
38271		quantityInput.val(minVal);
38272	}
38273
38274	if(typeof maxVal !== 'undefined' && maxVal < val) {
38275		quantityInput.val(maxVal);
38276	}
38277}
38278
38279function openReservationModal(elem) {
38280	let element = jQuery(elem);
38281	let productId = element.data('product_id');
38282	let selectedAttribute = '';
38283	if ( typeof element.data('is_attribute') !== 'undefined' && element.data('is_attribute') == 1 ) {
38284		let productAttribute = window[`ProductVariantInstance_${js_product_id}`].selectedAttribute;
38285		if ( typeof productAttribute.prop.CODE !== 'undefined' && productAttribute.prop.CODE !== '' ) {
38286			selectedAttribute = productAttribute.prop.CODE;
38287		}
38288	}
38289
38290	let menuOpen = false;
38291	if ( element.data('menu_open') !== 'undefined' && element.data('menu_open') === 1 ) {
38292		menuOpen = true;
38293	}
38294
38295	let action = typeof js_Config_product_store_reservation !== 'undefined' && typeof js_Config_product_store_reservation.extended !== 'undefined' && js_Config_product_store_reservation.extended ? 'getModalContentExtended' : 'getModalContent';
38296	element.prop('disabled', true);
38297
38298	new AjaxRequest({productId: productId, attribute: selectedAttribute, menuOpen: menuOpen})
38299	.setMethod('POST')
38300	.setController('ProductStoreReservation')
38301	.setAction(action)
38302	.onSuccess(function (response) {
38303		if ( response.data.success === false && response.data.addFailed === true ) {
38304			new CsModal()
38305			.setClassName('product_reservation_error')
38306			.setType('info')
38307			.setTitle('')
38308			.setContent(response.data.info_message)
38309			.open();
38310
38311			let reservationButton = jQuery('.button.prod_reservation');
38312			if ( reservationButton.length > 0 ) {
38313				reservationButton.hide();
38314			}
38315
38316			if ( typeof response.data.attribute !== 'undefined' && response.data.attribute != '' && typeof reservationAttributes !== 'undefined' && Object.keys(reservationAttributes).includes(response.data.attribute) ) {
38317				reservationAttributes[response.data.attribute] = false;
38318			}
38319		} else if (response.data.success === true) {
38320			var title = response.data.modalTitle;
38321			var content = response.data.modalContent;
38322
38323			if ( typeof response.data.reservationAttributes != 'undefined' && response.data.reservationAttributes != '' ) {
38324				reservationAttributes = response.data.reservationAttributes;
38325			}
38326
38327			let reservationCookie = jQuery.cookie('product_reservation_filled');
38328			if (reservationCookie == null) {
38329				jQuery.cookie('product_reservation_filled', '1', {path: '/'});
38330				toggleProductReservationButton();
38331			} else {
38332				updateReservationCount();
38333			}
38334
38335			reservationModal = new CsModal()
38336			.setClassName('product_reservation')
38337			.setType('info')
38338			.setTitle((typeof title != 'undefined' && title != '') ? title : '')
38339			.setContent(content)
38340			.hideCloseButton(false)
38341			.setButtons("<input type=\"button\" name=\"reservation-confirm\" class=\"button\" title=\"\" value=\"" + response.data.modalButtonConfirm + "\"><input type=\"button change_my_store\" name=\"change_my_store\" class=\"button\" title=\"\" value=\"" + response.data.modalButtonContinue + "\"><div class=\"reservation_with_payment_obligation\">" + response.data.paymentObligationText + "</div>")
38342			.afterClose(function() {
38343				let reservationButton = jQuery('.button.prod_reservation');
38344				if ( reservationButton.length > 0 ) {
38345					reservationButton.prop('disabled', false);
38346				}
38347			})
38348			.afterOpen(function() {
38349				var quantityWrapper = jQuery('.reservation_quantity_wrapper .quantity_wrapper');
38350				var storeSelect = jQuery('.product_reservation_modal .store_select_wrap select');
38351
38352				let fakeStoreSelect = jQuery('.attr_group_custom_select_div_wrap.attr_group');
38353				if (fakeStoreSelect.length > 0) {
38354					let fakeStoreSelect = jQuery('.attr_group_custom_select_div_wrap.attr_group');
38355					let fakeInputBox = fakeStoreSelect.find('.inputbox.store_custom_select');
38356					let fakeOptions = fakeStoreSelect.find('.stores .custom_select_item');
38357
38358					fakeInputBox.on('click', function() {
38359						let elem = jQuery(this);
38360						elem.toggleClass('open');
38361						let options = elem.parent().find('.stores');
38362						if (options.length > 0) {
38363							//"Rozbalime" fake select
38364							options.toggle();
38365						}
38366					});
38367
38368					fakeOptions.on('click', function() {
38369						let elem = jQuery(this);
38370						let fakeSelectedStoreId = elem.data('value');
38371
38372						//Prepiseme zvolenu hodnotu selectu
38373						let inputBox = elem.parents('.attr_group').find('.inputbox.store_custom_select');
38374						if (inputBox.length > 0) {
38375							let inputBoxName = inputBox.find('.product_reservation_store_name');
38376							let inputBoxAvail = inputBox.find('.product_reservation_store_availability');
38377							if (inputBoxName.length > 0) {
38378								inputBoxName.text(elem.data('name'));
38379							}
38380							if (inputBoxAvail.length > 0) {
38381								if (fakeSelectedStoreId == '') {
38382									inputBoxAvail.text('');
38383								} else if (fakeSelectedStoreId != '') {
38384									inputBoxAvail.text('V predajni');
38385								}
38386							}
38387							inputBox.toggleClass('open');
38388						}
38389
38390						//Skryjeme rozbaleny fakeSelect
38391						let optionsWrap = elem.parent();
38392						if (optionsWrap.length > 0) {
38393							optionsWrap.toggle();
38394						}
38395
38396						//Odstranime aktualne active
38397						let options = elem.siblings();
38398						if (options.length > 0) {
38399							options.removeClass('active');
38400						}
38401
38402						//Nastavime nove active
38403						elem.addClass('active');
38404
38405						//Zmenime pôvodný select
38406						if (fakeSelectedStoreId != '') {
38407							storeSelect.val(fakeSelectedStoreId);
38408						} else {
38409							storeSelect.val('0');
38410						}
38411
38412						//Triggerneme change na select a tým sa vykonajú aj nabidnované funkcionality
38413						storeSelect.trigger('change');
38414					});
38415				}
38416
38417				jQuery('.product_reservation .reservation_customer_info input[name="name"]').on('blur', function() {
38418					var $this = jQuery(this);
38419					var inputValue = $this.val();
38420
38421					if ( typeof inputValue == 'undefined' || inputValue == '' || inputValue.replace(/\s/g, "").length <= 2 || /^[a-žA-Ž ]+$/.test(inputValue) === false ) {
38422						$this.addClass('error');
38423						$this.removeClass('valid');
38424					} else {
38425						$this.addClass('valid');
38426						$this.removeClass('error');
38427					}
38428				});
38429
38430				jQuery('.product_reservation .reservation_customer_info input[name="name"],[name="surname"]').on('blur', function() {
38431					var $this = jQuery(this);
38432					var inputValue = $this.val();
38433
38434					if ( typeof inputValue == 'undefined' || inputValue == '' || inputValue.replace(/\s/g, "").length <= 2 || /^[a-žA-Ž ]+$/.test(inputValue) === false ) {
38435						$this.addClass('error');
38436						$this.removeClass('valid');
38437					} else {
38438						$this.addClass('valid');
38439						$this.removeClass('error');
38440					}
38441				});
38442
38443				jQuery('.product_reservation .reservation_customer_info input[name="email"]').on('blur', function() {
38444					var $this = jQuery(this);
38445					var inputValue = $this.val();
38446
38447					if ( typeof inputValue == 'undefined' || inputValue == '' || /\S+@\S+\.\S+/.test(inputValue) === false ) {
38448						$this.addClass('error');
38449						$this.removeClass('valid');
38450					} else {
38451						$this.addClass('valid');
38452						$this.removeClass('error');
38453					}
38454				});
38455
38456				jQuery('.product_reservation .reservation_customer_info input[name="phone"]').on('blur', function() {
38457					var $this = jQuery(this);
38458					var inputValue = $this.val();
38459
38460					if ( typeof inputValue == 'undefined' || inputValue == '' || inputValue.replace(/\s/g, "").length < 9 || inputValue.replace(/\s/g, "").length > 13 || /\d/g.test(inputValue.replace(/\s/g, "")) === false ) {
38461						$this.addClass('error');
38462						$this.removeClass('valid');
38463					} else {
38464						$this.addClass('valid');
38465						$this.removeClass('error');
38466					}
38467				});
38468
38469				var submitButton = jQuery('.product_reservation input[name="reservation-confirm"]');
38470				submitButton.on('click', function () {
38471					var $this = jQuery(this);
38472					$this.prop('disabled', true);
38473					showLoader();
38474					var result = true;
38475					var parentElement 	= $this.parents('.product_reservation');
38476					var customerInfo 	= parentElement.find('.reservation_customer_info');
38477					var selectedStore 	= parentElement.find('.store_select').val();
38478					var quantity 		= parentElement.find('.quantity_wrapper input').val();
38479					var name 			= customerInfo.find('input[name="name"]').val();
38480					var surname 		= customerInfo.find('input[name="surname"]').val();
38481					var email 			= customerInfo.find('input[name="email"]').val();
38482					var phone 			= customerInfo.find('input[name="phone"]').val();
38483					var comment 		= customerInfo.find('textarea[name="comment"]').val();
38484					var productId 		= parentElement.find('.reservation_product_id').val();
38485					var attribute 		= parentElement.find('.reservation_attribute').val();
38486
38487					var errors = {
38488						'name': false,
38489						'surname': false,
38490						'email': false,
38491						'phone': false,
38492						'store': false,
38493						'quantity': false,
38494						'product' : false,
38495					};
38496
38497					if ( (typeof productId == 'undefined' || productId == '' || productId == '0') && (typeof js_Config_product_store_reservation.extended === 'undefined' || js_Config_product_store_reservation.extended !== true) ) {
38498						errors.product = true;
38499					}
38500
38501					if ( typeof selectedStore == 'undefined' || selectedStore == '' || selectedStore == '0' ) {
38502						errors.store = true;
38503						parentElement.find('.store_select').addClass('error');
38504						parentElement.find('.inputbox.store_custom_select').addClass('error');
38505					}
38506
38507					if ( typeof quantity == 'undefined' || quantity == '' || quantity == 0 ) {
38508						errors.quantity = true;
38509					}
38510
38511					if ( (typeof name == 'undefined' || name == '' || name.replace(/\s/g, "").length <= 2 || /^[a-žA-Ž ]+$/.test(name) === false) && (typeof js_Config_product_store_reservation.extended === 'undefined' || js_Config_product_store_reservation.extended !== true) ) {
38512						errors.name = true;
38513						customerInfo.find('input[name="name"]').addClass('error');
38514					}
38515
38516					if ( (typeof surname == 'undefined' || surname == '' || surname.replace(/\s/g, "").length <= 2 || /^[a-žA-Ž ]+$/.test(surname) === false) && (typeof js_Config_product_store_reservation.extended === 'undefined' || js_Config_product_store_reservation.extended !== true) ) {
38517						errors.surname = true;
38518						customerInfo.find('input[name="surname"]').addClass('error');
38519					}
38520
38521					if ( (typeof email == 'undefined' || email == '' || /\S+@\S+\.\S+/.test(email) === false) && (typeof js_Config_product_store_reservation.extended === 'undefined' || js_Config_product_store_reservation.extended !== true) ) {
38522						errors.email = true;
38523						customerInfo.find('input[name="email"]').addClass('error');
38524					}
38525
38526					if ( (typeof phone == 'undefined' || phone == '' || phone.replace(/\s/g, "").length < 9 || phone.replace(/\s/g, "").length > 13 || /\d/g.test(phone.replace(/\s/g, "")) === false) && (typeof js_Config_product_store_reservation.extended === 'undefined' || js_Config_product_store_reservation.extended !== true) ) {
38527						errors.phone = true;
38528						customerInfo.find('input[name="phone"]').addClass('error');
38529					}
38530
38531
38532					Object.values(errors).forEach(function (error) {
38533						if ( error === true) {
38534							result = false;
38535						}
38536					});
38537
38538					if ( result === true && typeof js_Config_product_store_reservation.extended !== 'undefined' && js_Config_product_store_reservation.extended === true ) {
38539
38540						//Kontaktne udaje zakaznika vypnute, kedze su tu zbytocne
38541						/* var controllerData = {
38542							'first_name'	: name,
38543							'last_name'		: surname,
38544							'email'			: email,
38545							'phone_1'		: phone,
38546						}; */
38547
38548						let setDefaultStoreCbx = jQuery('.product_reservation_modal #set_as_my_store_cbx');
38549						let setDefaultStore = false;
38550						if ( setDefaultStoreCbx.length > 0 ) {
38551							setDefaultStore = setDefaultStoreCbx.is(':checked');
38552						}
38553
38554						new AjaxRequest()
38555						.setMethod('POST')
38556						.setController('ProductStoreReservation')
38557						.setAction('checkCartItems')
38558						.onSuccess(function (response) {
38559							if (response.data.success === true && response.data.cartEmpty == true) {
38560								new AjaxRequest({data: {'selectedStore': selectedStore, 'setDefaultStore': setDefaultStore}})
38561								.setMethod('POST')
38562								.setController('ProductStoreReservation')
38563								.setAction('fillCartReservation')
38564								.onSuccess(function (response) {
38565									if (response.data.success === true && response.data.checkout_redirect_url != '' ) {
38566
38567										if ( typeof response.data.checkout_form_data !== 'undefined' && response.data.checkout_form_data != '' ) {
38568											let checkoutFormData = response.data.checkout_form_data;
38569											let currentFormData = jQuery.cookie('checkout_form_data');
38570
38571											if ( currentFormData !== null ) {
38572												currentFormData = JSON.parse(currentFormData);
38573												checkoutFormData = Object.assign(currentFormData, checkoutFormData);
38574											}
38575
38576											jQuery.cookie('checkout_form_data', JSON.stringify(checkoutFormData), {path: '/'});
38577											jQuery.cookie('product_reservation_active', 1, {path: '/'});
38578										}
38579
38580										window.location.replace(response.data.checkout_redirect_url);
38581									}
38582								})
38583								.send();
38584							} else {
38585								cartReservationModalConfirm = new CsModal()
38586								.setClassName('cart_reservation_fill_confirm')
38587								.setType('info')
38588								.setTitle('')
38589								.setContent(js_lang_checkout_product_reservation.fillModalMessage)
38590								.hideCloseButton(true)
38591								.setButtons("<input type=\"button\" name=\"reservation-fill-confirm\" class=\"button\" title=\"\" value=\"" + js_lang_checkout_product_reservation.confirm + "\"><input type=\"button\" name=\"reservatil-fill-cancel\" onclick=\"cartReservationModalConfirm.close();\" class=\"button\" title=\"\" value=\"" + js_lang_checkout_product_reservation.cancel + "\">")
38592								.afterOpen(function() {
38593									let reservationFillModal = jQuery('.cart_reservation_fill_confirm');
38594									if (reservationFillModal.length > 0) {
38595										let fillConfirmButton = reservationFillModal.find('input[name="reservation-fill-confirm"]');
38596										if (fillConfirmButton.length > 0) {
38597											fillConfirmButton.on('click', function() {
38598												if (typeof selectedStore !== 'undefined' && typeof setDefaultStore !== 'undefined') {
38599													new AjaxRequest({data: {'selectedStore': selectedStore, 'setDefaultStore': setDefaultStore}})
38600													.setMethod('POST')
38601													.setController('ProductStoreReservation')
38602													.setAction('fillCartReservation')
38603													.onSuccess(function (response) {
38604														if (response.data.success === true && response.data.checkout_redirect_url != '' ) {
38605
38606															if ( typeof response.data.checkout_form_data !== 'undefined' && response.data.checkout_form_data != '' ) {
38607																let checkoutFormData = response.data.checkout_form_data;
38608																let currentFormData = jQuery.cookie('checkout_form_data');
38609
38610																if ( currentFormData !== null ) {
38611																	currentFormData = JSON.parse(currentFormData);
38612																	checkoutFormData = Object.assign(currentFormData, checkoutFormData);
38613																}
38614
38615																jQuery.cookie('checkout_form_data', JSON.stringify(checkoutFormData), {path: '/'});
38616																jQuery.cookie('product_reservation_active', 1, {path: '/'});
38617															}
38618
38619															window.location.replace(response.data.checkout_redirect_url);
38620														}
38621													})
38622													.send();
38623												} else {
38624													console.log('Variables are not defined');
38625												}
38626											});
38627										}
38628									}
38629								})
38630								.open();
38631							}
38632						})
38633						.send();
38634					}
38635
38636					if ( result === true && (typeof js_Config_product_store_reservation.extended === 'undefined' || js_Config_product_store_reservation.extended !== true ) ) {
38637
38638						var controllerData = {
38639							'store'		: selectedStore,
38640							'quantity'	: quantity,
38641							'name'		: name,
38642							'surname'	: surname,
38643							'email'		: email,
38644							'phone'		: phone,
38645							'comment'	: comment,
38646							'product'	: productId,
38647						};
38648
38649						if ( typeof attribute !== 'undefined' && attribute != '' ) {
38650							controllerData.attribute = attribute;
38651						}
38652
38653						new AjaxRequest({data: controllerData,})
38654						.setMethod('POST')
38655						.setController('ProductStoreReservation')
38656						.setAction('processReservation')
38657						.onSuccess(function (response) {
38658							if (response.data.success === true) {
38659								if ( typeof reservationModal === 'undefined' ) {
38660									hideLoader();
38661									return;
38662								}
38663
38664								var newContent = response.data.modalUpdate.content;
38665								var newButton  =  response.data.modalUpdate.button;
38666
38667								//var reservationNumber = response.data.reservationNumber;
38668								reservationModal.setContent(newContent);
38669								var button = jQuery('.product_reservation .vex-dialog-buttons input');
38670								if ( button.length > 0 ) {
38671									button.replaceWith(newButton);
38672								}
38673								hideLoader();
38674							} else {
38675								jQuery('.product_reservation input[name="reservation-confirm"]').prop('disabled', false);
38676								hideLoader();
38677							}
38678						}).send();
38679					} else {
38680						$this.prop('disabled', false);
38681						hideLoader();
38682					}
38683				});
38684
38685				let changeStoreButton = jQuery('.product_reservation input[name="change_my_store"]');
38686				if ( changeStoreButton.length > 0 ) {
38687					changeStoreButton.on('click', function () {
38688						let button = jQuery(this);
38689						button.prop('disabled', true);
38690						let storeSelect = jQuery('.product_reservation_modal .store_select_wrap select');
38691						if ( storeSelect.length > 0 ) {
38692							var selectedStore = storeSelect.val();
38693						}
38694
38695						if ( typeof selectedStore === 'undefined' || selectedStore == '' || selectedStore == '0' ) {
38696							reservationModal.close();
38697							return;
38698						}
38699
38700						let preventStoreUpdate = jQuery('.product_reservation_modal #my_store_active');
38701						preventStoreUpdate = preventStoreUpdate.length > 0 && preventStoreUpdate.val() == 1;
38702
38703						let setDefaultStoreCbx = jQuery('.product_reservation_modal #set_as_my_store_cbx');
38704						var setDefaultStore = false;
38705						if ( setDefaultStoreCbx.length > 0 ) {
38706							setDefaultStore = setDefaultStoreCbx.is(':checked');
38707							let storeTooltip = jQuery('.store_reservation span.my_store.tooltipstered');
38708							if ( setDefaultStore === true && storeTooltip.length > 0 ) {
38709								storeTooltip.tooltipster('destroy');
38710							}
38711						}
38712
38713						if ( preventStoreUpdate === false || setDefaultStore === true ) {
38714							new AjaxRequest({'storeId': selectedStore, 'myStore': setDefaultStore})
38715							.setMethod('POST')
38716							.setController('ProductStoreReservation')
38717							.setAction('updateStore')
38718							.onSuccess(function (response) {
38719								if ( response.data.success === true ) {
38720									reservationModal.close();
38721									if (typeof setDefaultStore !== 'undefined' && setDefaultStore === true && jQuery('body').hasClass('shop_page_class_shop_browse')) {
38722										js_reload_current_page();
38723									} else if (typeof setDefaultStore !== 'undefined' && setDefaultStore === true && jQuery('body').hasClass('shop_page_class_shop_product_details')) {
38724										let availabilityWrapper = jQuery('.product_store_availability_wrapper');
38725										if (availabilityWrapper.length > 0) {
38726											detailActiveStoreIcon = availabilityWrapper.find('.active_store_icon');
38727											if (detailActiveStoreIcon.length > 0) {
38728												detailActiveStoreIcon.remove();
38729											}
38730											newDetailActive = availabilityWrapper.find('div[data-store-id="' + selectedStore + '"]');
38731											if (newDetailActive.length > 0) {
38732												newDetailActive.find('.store_title').find('span').after('<span class="active_store_icon"></span>');
38733											}
38734										}
38735									}
38736								} else {
38737									let changeStoreButton = jQuery('.product_reservation input[name="change_my_store"]');
38738									if ( changeStoreButton.length > 0 ) {
38739										changeStoreButton.prop('disabled', false);
38740									}
38741								}
38742							}).send();
38743						} else {
38744							reservationModal.close();
38745						}
38746					});
38747				}
38748
38749				var totalMaximumQuantity = 0;
38750				storeSelect.find('option').each(function () {
38751					var storeMaximum = jQuery(this).data('quantity');
38752					if ( typeof storeMaximum === 'object' ) {
38753						Object.values(storeMaximum).forEach( function (quantity) {
38754							if ( quantity > totalMaximumQuantity ) {
38755								totalMaximumQuantity = quantity;
38756							}
38757						});
38758					} else if ( typeof storeMaximum !== 'undefined' && storeMaximum > totalMaximumQuantity ) {
38759						totalMaximumQuantity = storeMaximum;
38760					}
38761				});
38762
38763				var quantityInput = quantityWrapper.find('input');
38764				if ( typeof quantityInput.data('forced_quantity') === 'undefined' ) {
38765					quantityInput.data('forced_quantity', 1);
38766				}
38767
38768				if ( typeof totalMaximumQuantity !== 'undefined' ) {
38769					quantityInput.data('maximum_quantity', totalMaximumQuantity);
38770					storeSelect.find('option[value="0"]').data('quantity', totalMaximumQuantity);
38771				}
38772
38773				quantityInput.on('change', function (evt) {
38774					let element = jQuery(this);
38775
38776					if ( typeof evt.isTrigger === 'undefined' || element.prop('disabled') == true ) {
38777						return;
38778					}
38779
38780					/* let priceWrapper =  element.parents('.reservation_snapshot').find('.price_wrapper');
38781					let unitPrice = priceWrapper.find('.price_per_unit').data('unit_price').replace(',', '.');
38782					if ( typeof unitPrice !== 'undefined' ) {
38783						let newPrice = element.val() * unitPrice;
38784						priceWrapper.find('.total_price').html('<b>' + csFormatPrice(newPrice) + '</b>');
38785					} */
38786
38787					let totalPrice = element.parents('.product_reservation_modal').find('.reservation_total .total_price');
38788					if ( totalPrice.length > 0 ) {
38789						let reservationTotal = 0;
38790						jQuery('.reservation_snapshot').each(function(){
38791							let elem = jQuery(this);
38792							let unit_price = elem.find('.price_per_unit').data('unit_price');
38793							let quantity = elem.find('.quantity_wrapper').find('input').val();
38794							reservationTotal += parseFloat(unit_price.replace(',','.')) * quantity;
38795						});
38796						totalPrice.html('<b>' + reservationTotal.toFixed(shop_currency_info[shop_vendor_currency_code].DECIMALS).replace('.',',') + ' ' + shop_currency_info[shop_vendor_currency_code].SYMBOL + ' ' + cms_js_lang_product_form_price_gross_label + '</b>');
38797					}
38798
38799					let productId = element.parents('.reservation_quantity_wrapper').data('prod_id');
38800					let productAttribute = element.parents('.reservation_quantity_wrapper').data('prod_attr_code');
38801
38802					if ( typeof productId !== 'undefined' && productId != '' ) {
38803						let quantityData = {
38804							productId: productId,
38805							attribute: (typeof productAttribute !== 'undefined' && productAttribute != '' ? productAttribute : ''),
38806							quantity: element.val(),
38807						};
38808
38809						element.prop('disabled', true);
38810
38811						new AjaxRequest(quantityData)
38812							.setMethod('POST')
38813							.setController('ProductStoreReservation')
38814							.setAction('updateQuantity')
38815							.onSuccess(function (response) {
38816								element.prop('disabled', false);
38817								updateReservationCount();
38818							}).send();
38819					}
38820				});
38821
38822				//Bindovanie odstranenia produktu z rezervacie
38823				let removeButtons = jQuery('.product_reservation .remove_product span[name="delete"]');
38824				removeButtons.on('click', function () {
38825					let element = jQuery(this);
38826					let productId = element.parent().siblings('.reservation_quantity_wrapper').data('prod_id');
38827
38828					if ( typeof productId !== 'undefined' && productId != '' ) {
38829						let removeProductOptions = {
38830							productId: productId,
38831						};
38832
38833						let attrCode = element.parent().siblings('.reservation_quantity_wrapper').data('prod_attr_code');
38834						if ( typeof attrCode !== 'undefined' && attrCode != '' ) {
38835							removeProductOptions.attribute = attrCode;
38836						}
38837
38838						new AjaxRequest(removeProductOptions)
38839							.setMethod('POST')
38840							.setController('ProductStoreReservation')
38841							.setAction('removeProduct')
38842							.onSuccess(function (response) {
38843								if ( response.data.success === true && response.data.product_id != '' ) {
38844
38845									if ( response.data.reservation_empty === true ) {
38846										let reservationCookie = jQuery.cookie('product_reservation_filled');
38847										if (reservationCookie != null) {
38848											Cookies.remove('product_reservation_filled');
38849											toggleProductReservationButton();
38850										} else {
38851											updateReservationCount();
38852										}
38853										reservationModal.close();
38854										return;
38855									} else {
38856										updateReservationCount();
38857									}
38858
38859									if ( typeof response.data.reservationAttributes != 'undefined' && response.data.reservationAttributes != '' && typeof js_product_id != 'undefined' && js_product_id == response.data.product_id ) {
38860										reservationAttributes = response.data.reservationAttributes;
38861									}
38862
38863									if ( typeof response.data.updated_stores === 'object' && Object.keys(response.data.updated_stores).length > 0 ) {
38864										let storeSelect = jQuery('.product_reservation_modal .store_select_wrap select');
38865										let storeOptions = storeSelect.find('option:not(:first)');
38866										storeOptions.remove();
38867										let newOptions = '';
38868										Object.entries(response.data.updated_stores).forEach( entry => {
38869											let newStore = entry[1];
38870											newOptions += '<option value="' + newStore.store_id + '" data-quantity="' + newStore.quantity + '"' + (typeof newStore.selected !== 'undefined' && newStore.selected === true ? ' selected' : '') + '>' + newStore.store + '</option>';
38871										});
38872
38873										storeSelect.append(newOptions);
38874										storeSelect.trigger('change');
38875									}
38876
38877									if ( typeof response.data.store_json !== 'undefined' && response.data.store_json != '' ) {
38878										storeReservationJson = JSON.parse(response.data.store_json);
38879									}
38880
38881									let isAttribute = typeof response.data.attribute !== 'undefined' && response.data.attribute != '' ? true : false;
38882									let productElement = jQuery('.product_reservation_modal .reservation_quantity_wrapper.prod_id_' + response.data.product_id + ( isAttribute === true ? '[data-prod_attr_code="' + response.data.attribute + '"]' : ''));
38883									if ( productElement.length > 0 ) {
38884										productElement = productElement.parents('.reservation_snapshot');
38885										if ( productElement.length > 0 ) {
38886											productElement.slideUp(150, function () {
38887												this.remove();
38888
38889												let totalPrice = jQuery('.product_reservation_modal .reservation_total .total_price');
38890												if ( totalPrice.length > 0 ) {
38891													let reservationTotal = 0;
38892													jQuery('.reservation_snapshot').each(function(){
38893														let elem = jQuery(this);
38894														let unit_price = elem.find('.price_per_unit').data('unit_price');
38895														let quantity = elem.find('.quantity_wrapper').find('input').val();
38896														reservationTotal += parseFloat(unit_price.replace(',','.')) * quantity;
38897													});
38898													totalPrice.html('<b>' + reservationTotal.toFixed(shop_currency_info[shop_vendor_currency_code].DECIMALS).replace('.',',') + ' ' + shop_currency_info[shop_vendor_currency_code].SYMBOL + '</b>');
38899												}
38900
38901												let reservationPrices = jQuery('.product_reservation_modal .reservation_snapshot .price_per_unit');
38902												if (reservationPrices.length > 0) {
38903													let hidePriceInfo = true;
38904
38905													reservationPrices.each(function() {
38906														if (jQuery(this).css('display') != 'none') {
38907															hidePriceInfo = false;
38908															return false;
38909														}
38910													});
38911
38912													if (hidePriceInfo === true) {
38913														let priceInfo = jQuery('.product_reservation_modal .reservation_discounted_price_info');
38914														if (priceInfo.length > 0) {
38915															priceInfo.hide();
38916														}
38917													}
38918												}
38919											});
38920										}
38921									}
38922								}
38923							}).send();
38924					}
38925				});
38926
38927				if ( storeSelect.length > 0 ) {
38928					storeSelect.on('change', function(){
38929						var element = jQuery(this);
38930						var selected = element.find('option:selected');
38931
38932						if ( selected.length == 0 ) {
38933							return;
38934						}
38935						var maximumQuantity = selected.data('quantity');
38936
38937						if ( typeof maximumQuantity === 'object' ) {
38938							Object.entries(maximumQuantity).forEach( entry => {
38939								let productId = entry[0];
38940								let quantity = entry[1];
38941								let quantityInput = element.parents('.product_reservation_modal').find('.reservation_quantity_wrapper[data-prod_attr_code="' + productId + '"] input'); //Najskor hladaj variant
38942
38943								if ( quantityInput.length == 0 ) {
38944									quantityInput = element.parents('.product_reservation_modal').find('.reservation_quantity_wrapper.prod_id_' + productId + ' input');//Ak sa nenajde variant tak podla prod_id
38945								}
38946
38947								if ( quantityInput.length > 0 ) {
38948									quantityInput.data('maximum_quantity', quantity);
38949									if ( parseInt(quantityInput.val()) > parseInt(quantity) ) {
38950										quantityInput.trigger('blur');
38951									}
38952								}
38953							});
38954						} else {
38955							let quantityInput = element.parents('.product_reservation_modal').find('.quantity_wrapper input');
38956
38957							if ( quantityInput.length == 0 ) {
38958								return;
38959							}
38960
38961							quantityInput.data('maximum_quantity', maximumQuantity);
38962							quantityInput.trigger('blur');
38963						}
38964
38965						//Tu konci zmena quantity a zacina info o predajni
38966						var storeId = selected.val();
38967						if ( typeof storeReservationJson !== 'undefined' && typeof storeReservationJson[storeId] !== 'undefined' ) {
38968							element.removeClass('error');
38969							let temFakeSelect = element.siblings('.attr_group_custom_select_div_wrap.attr_group');
38970							if (temFakeSelect.length > 0) {
38971								temFakeSelect.find('.inputbox.store_custom_select').removeClass('error');
38972							}
38973							var storeInfo = element.parents('.store_select_wrap').find('.selected_store_info');
38974							storeInfo.find('.address').html(storeReservationJson[storeId].street + ', ' + storeReservationJson[storeId].city);
38975							let hoursHtml = '';
38976							if ( typeof storeReservationJson[storeId].hours !== 'undefined' && storeReservationJson[storeId].hours != '' ) {
38977								let openingHours = storeReservationJson[storeId].hours;
38978								Object.entries(openingHours).forEach( entry => {
38979									hoursHtml += '<div class="hours_row">' + entry[0] + ': ' + entry[1] + '</div>';
38980								});
38981							}
38982
38983							storeInfo.find('.phone_contact').html(storeReservationJson[storeId].phone);
38984							storeInfo.find('.email_contact').html(storeReservationJson[storeId].mail);
38985							storeInfo.find('.opening_hours').html(hoursHtml);
38986							storeInfo.show();
38987
38988							let preventStoreUpdate = jQuery('.product_reservation_modal #my_store_active');
38989							if ( typeof preventStoreUpdate == 'undefined' || preventStoreUpdate.length == 0 || preventStoreUpdate.val() != 1 ) {
38990								new AjaxRequest({'storeId': storeId})
38991								.setMethod('POST')
38992								.setController('ProductStoreReservation')
38993								.setAction('updateStore')
38994								.send();
38995							}
38996						} else {
38997							element.parents('.store_select_wrap').find('.selected_store_info').hide();
38998						}
38999					});
39000				}
39001				storeSelect.trigger('change');
39002			})
39003			.setActionsClassName('vex-dialog-buttons')
39004			.open();
39005		}
39006	}).send();
39007}
39008
39009function updateReservationCount() {
39010	let reservationCookie = jQuery.cookie('product_reservation_filled');
39011	if (reservationCookie == null) {
39012		return;
39013	}
39014
39015	new AjaxRequest()
39016	.setMethod('POST')
39017	.setController('ProductStoreReservation')
39018	.setAction('getProductCount')
39019	.onSuccess(function (response) {
39020		let reservationcountElem = jQuery(".store_reservation span.prod_reservation .count");
39021		if (response.data.success === true && typeof response.data.count !== 'undefined' && reservationcountElem.length > 0) {
39022			reservationcountElem.text(response.data.count > 0 ? response.data.count : '');
39023		} else if (reservationcountElem.length > 0) {
39024			reservationcountElem.text('');
39025		}
39026	}).send();
39027}
39028
39029function resetReservationFilter() {
39030	let sphfResetButton = jQuery('.fp_active_reset');
39031	if (sphfResetButton.length > 0) {
39032		sphfResetButton.trigger('click');
39033	}
39034}
39035
39036function toggleProductReservationButton() {
39037	let reservationButton = jQuery(".store_reservation span.prod_reservation");
39038	if (reservationButton.length == 0) {
39039		return;
39040	}
39041
39042	let reservationCookie = jQuery.cookie('product_reservation_filled');
39043	if (reservationCookie == null || reservationCookie != 1) {
39044		reservationButton.hide();
39045		return;
39046	}
39047
39048	updateReservationCount();
39049
39050	reservationButton.show();
39051	return;
39052}
39053
39054function openMyStoreTooltip(element){
39055	let elem = jQuery(element);
39056
39057	if ( elem.hasClass('tooltipstered') ) {
39058		return false;
39059	}
39060
39061	elem.prop('disabled', true);
39062
39063	new AjaxRequest()
39064		.setMethod('POST')
39065		.setController('ProductStoreReservation')
39066		.setAction('getTooltipContent')
39067		.onSuccess(function (response) {
39068			if ( response.data.success === true ) {
39069				elem.tooltipster({
39070					theme        	: "cs_tooltipster_grey_theme store-tooltip",
39071					contentAsHTML	: true,
39072					position	 	: 'bottom',
39073					content      	: response.data.tooltipContent,
39074					interactive		: true,
39075				}).tooltipster('open');
39076				elem.prop('disabled', false);
39077			}
39078		}).send();
39079}
39080
39081function resetMyStore(){
39082	let button = jQuery(this);
39083	if ( button.length > 0 ) {
39084		button.prop('disabed', true);
39085	}
39086
39087	new AjaxRequest()
39088	.setMethod('POST')
39089	.setController('ProductStoreReservation')
39090	.setAction('cancelSelectedStore')
39091	.onSuccess(function (response) {
39092		if ( response.data.success === true ) {
39093			if (jQuery('body').hasClass('shop_page_class_shop_browse')) {
39094				//Ak sme v kategorii tak klikneme na reset filtra
39095				if (typeof js_Config_product_store_reservation.my_store !== 'undefined' && js_Config_product_store_reservation.my_store === true) {
39096					js_Config_product_store_reservation.my_store = false;
39097				}
39098				resetReservationFilter();
39099			} else if (jQuery('body').hasClass('shop_page_class_shop_product_details')) {
39100				//Ak sme v detaile tak odstranime ikonku domceku
39101				let availabilityWrapper = jQuery('.product_store_availability_wrapper');
39102				if (availabilityWrapper.length > 0) {
39103					detailActiveStoreIcon = availabilityWrapper.find('.active_store_icon');
39104					if (detailActiveStoreIcon.length > 0) {
39105						detailActiveStoreIcon.remove();
39106					}
39107				}
39108			}
39109
39110			jQuery('.store_reservation span.my_store.tooltipstered').tooltipster('destroy');
39111		}
39112	}).send();
39113}
39114
39115function myStoreDisableStoreFilter() {
39116	if (typeof sphf !== 'undefined') {
39117		sphf.options.onActiveRender = function(activ) {
39118			let elem = activ.find('.param_6 .activ_item');
39119			if (elem.length > 0) {
39120				elem.addClass('no_removable');
39121
39122				let filtersCount = elem.parents('.fp_active').find('.activ_item');
39123
39124				let eventSelector = '';
39125				if (filtersCount.length > 1) {
39126					eventSelector = '.param_6 .activ_item';
39127				} else if (filtersCount.length === 1) {
39128					eventSelector = '.param_6 .activ_item, .fp_active_reset';
39129				}
39130
39131				jQuery(eventSelector).on('click', function(e) {
39132					if (typeof js_Config_product_store_reservation.my_store == 'undefined' || js_Config_product_store_reservation.my_store !== true) {
39133						return;
39134					}
39135
39136					e.stopPropagation();
39137					let $this = jQuery(this);
39138					let myStoreTooltip = jQuery('.store_reservation .my_store').not('button');
39139
39140					if ($this.hasClass('tooltipstered')) {
39141						$this.tooltipster('open');
39142					} else {
39143						$this.tooltipster({
39144							theme        : "tooltipster-gdpr",
39145							contentAsHTML: true,
39146							trackTooltip : true,
39147							trackOrigin  : true,
39148							multiple     : false,
39149							timer        : 5000,
39150							content      : js_lang_checkout_product_reservation.filterDisable,
39151						}).tooltipster('open');
39152					}
39153
39154					if (myStoreTooltip.length > 0) {
39155						let tooltipOpened = false;
39156						myStoreTooltip.each(function(key, elm) {
39157							elm = jQuery(elm);
39158
39159							if (elm.hasClass('tooltipstered')) {
39160								elm.tooltipster('close');
39161							}
39162
39163							if (elm.is(':hidden') || tooltipOpened === true) {
39164								return;
39165							}
39166
39167							if (elm.hasClass('tooltipstered')) {
39168								elm.tooltipster('open');
39169							} else {
39170								elm.trigger('mouseover');
39171							}
39172							tooltipOpened = true;
39173						});
39174					}
39175				});
39176			}
39177		}
39178	}
39179}
39180
39181function openMyStore(element){
39182	var element = jQuery(element);
39183	element.prop('disabled', true);
39184
39185	new AjaxRequest()
39186		.setMethod('POST')
39187		.setController('ProductStoreReservation')
39188		.setAction('getStoreModal')
39189		.onSuccess(function (response) {
39190			if ( response.data.success === true ) {
39191				let storeTooltip = jQuery('.store_reservation span.my_store.tooltipstered');
39192				if ( storeTooltip.length > 0 && storeTooltip.hasClass('tooltipstered') ) {
39193					storeTooltip.tooltipster('hide');
39194				}
39195
39196				let content = response.data.modalContent;
39197				let title = response.data.modalTitle;
39198
39199				myStoreModal = new CsModal()
39200				.setClassName('my_store')
39201				.setType('info')
39202				.setTitle(title)
39203				.setContent(content)
39204				.setButtons("<input type=\"button\" name=\"my_store_confirm\" class=\"button\" title=\"\" value=\"" + response.data.modalButton + "\">")
39205				.afterClose(function() {
39206					let myStoreButton = jQuery('.button.my_store');
39207					if ( myStoreButton.length > 0 ) {
39208						myStoreButton.prop('disabled', false);
39209					}
39210				})
39211				.afterOpen(function() {
39212
39213					let storeConfirmButton = jQuery('.cs_modal.my_store input[name="my_store_confirm"]');
39214					if ( storeConfirmButton.length > 0) {
39215						storeConfirmButton.on('click', function() {
39216							let confirmButton = jQuery(this);
39217							confirmButton.prop('disabled', true);
39218							let selectedStoreId = confirmButton.parents('.my_store').find('input[name="store_select_radio"]:checked').val();
39219							if (typeof selectedStoreId !== 'undefined' && selectedStoreId !== '') {
39220								new AjaxRequest({'storeId': selectedStoreId, 'myStore': true})
39221								.setMethod('POST')
39222								.setController('ProductStoreReservation')
39223								.setAction('updateStore')
39224								.onSuccess(function (response) {
39225									if ( response.data.success === true ) {
39226										jQuery('.store_reservation span.my_store.tooltipstered').tooltipster('destroy');
39227										if (jQuery('body').hasClass('shop_page_class_shop_browse')) {
39228											js_reload_current_page();
39229										} else if (jQuery('body').hasClass('shop_page_class_shop_product_details')) {
39230											let availabilityWrapper = jQuery('.product_store_availability_wrapper');
39231											if (availabilityWrapper.length > 0) {
39232												detailActiveStoreIcon = availabilityWrapper.find('.active_store_icon');
39233												if (detailActiveStoreIcon.length > 0) {
39234													detailActiveStoreIcon.remove();
39235												}
39236												newDetailActive = availabilityWrapper.find('div[data-store-id="' + selectedStoreId + '"]');
39237												if (newDetailActive.length > 0) {
39238													newDetailActive.find('.store_title').find('span').after('<span class="active_store_icon"></span>');
39239												}
39240											}
39241										}
39242
39243										myStoreModal.close();
39244									} else {
39245										let storeConfirmButton = jQuery('.cs_modal.my_store input[name="my_store_confirm"]');
39246										if ( storeConfirmButton.length > 0 ) {
39247											storeConfirmButton.prop('disabled', false);
39248										}
39249									}
39250								}).send();
39251							} else {
39252								if (confirmButton.hasClass('tooltipstered')) {
39253									confirmButton.tooltipster('open');
39254								} else {
39255									confirmButton.tooltipster({
39256										theme        : "tooltipster-gdpr",
39257										contentAsHTML: true,
39258										trackTooltip : true,
39259										trackOrigin  : true,
39260										multiple     : false,
39261										timer        : 5000,
39262										content      : js_lang_checkout_product_reservation.selectStore,
39263									}).tooltipster('open');
39264								}
39265
39266
39267								//Zatvorenie tooltipsteru nech mame aj animaciu a nasledne destroy
39268								window.setTimeout( function() {
39269									if ( confirmButton.hasClass('tooltipstered') ) {
39270										confirmButton.tooltipster('hide', function(){
39271											jQuery('.cs_modal.my_store input[name="my_store_confirm"]').tooltipster('destroy');
39272											confirmButton.prop('disabled', false);
39273										});
39274									}
39275								}, 1500);
39276
39277							}
39278						});
39279					}
39280
39281					let storeCitySelect = jQuery('.cs_modal.my_store select.city_select');
39282					if ( storeCitySelect.length > 0 ) {
39283						storeCitySelect.on('change', function () {
39284							let citySelect = jQuery(this);
39285							let selected = citySelect.find('option:selected');
39286							let stores = selected.data('stores');
39287
39288							if ( typeof stores !== 'undefined' && stores.length > 0 ) {
39289								let allStores = citySelect.parents('.my_store_modal').find('input[name="store_select_radio"]');
39290								if ( allStores.length > 0 ) {
39291									allStores.each(function() {
39292										let store = jQuery(this);
39293										if ( stores.includes(store.val()) ) {
39294											store.parents('.other_store_row').show();
39295										} else {
39296											store.parents('.other_store_row').hide();
39297										}
39298									});
39299								}
39300							} else {
39301								citySelect.parents('.my_store_modal').find('.other_store_row').show();
39302							}
39303						});
39304					}
39305
39306					let storesRadio = jQuery('.cs_modal.my_store input[name="store_select_radio"]');
39307					if ( storesRadio.length > 0 ) {
39308						storesRadio.on('change', function() {
39309							let storeRow = jQuery(this).parents('.other_store_row');
39310							storeRow.siblings('.active').removeClass('active');
39311							storeRow.addClass('active');
39312						});
39313					}
39314				})
39315				.open();
39316			}
39317		}).send();
39318}
39319
39320function js_shopcart_reserve_product_submit(elem) {
39321	let element = jQuery(elem);
39322	let productId = element.data('product_id');
39323	let productName = element.data('product_name');
39324	let reservationModal = '';
39325
39326	new AjaxRequest({productId: productId, productName: productName})
39327		.setMethod('POST')
39328		.setController('ProductRental')
39329		.setAction('getModalContent')
39330		.onSuccess(function (response) {
39331
39332			reservationModal = new CsModal()
39333				.setClassName('product_mode_reservation')
39334				.setType('info')
39335				.setTitle(productName)
39336				.setContent(response.data.content)
39337				.setButtons("<button type='button' class='close_button close_reservation_mode_modal'>"+ cms_js_lang_close +"</button><button type='button' class='button submit_product_mode_reservation'>"+ js_lang_dynamic_attributes_lm_btn +"</button>")
39338				.afterOpen(function () {
39339					let sendEmailButton = jQuery('.submit_product_mode_reservation');
39340					let reservationInfo = sendEmailButton.parents().find('.reservation_mode_customer_info');
39341
39342					sendEmailButton.on('click', function () {
39343						sendEmailButton.prop('disabled', true);
39344						let result = true;
39345
39346						let nameElem = reservationInfo.find('input[name="name"]');
39347						let surnameElem = reservationInfo.find('input[name="surname"]');
39348						let emailElem = reservationInfo.find('input[name="email"]');
39349						let phoneElem = reservationInfo.find('input[name="phone"]');
39350						let commentElem = reservationInfo.find('textarea[name="comment"]');
39351						let dateFromElem = reservationInfo.find('input[name="dateFrom"]');
39352						let dateToElem = reservationInfo.find('input[name="dateTo"]');
39353
39354						let name = nameElem.val();
39355						let surname = surnameElem.val();
39356						let email = emailElem.val();
39357						let phone = phoneElem.val();
39358						let comment = commentElem.val();
39359						let dateFrom = dateFromElem.val();
39360						let dateTo = dateToElem.val();
39361
39362						let errors = {
39363							'name': false,
39364							'surname': false,
39365							'email': false,
39366							'phone': false,
39367							'product': false,
39368							'dateFrom': false,
39369							'dateTo': false,
39370						};
39371
39372						if (typeof productId == 'undefined' || productId === '' || productId === '0') {
39373							errors.product = true;
39374						}
39375
39376						if (typeof name == 'undefined' || name === '' || name.replace(/\s/g, "").length <= 2 || /^[a-žA-Ž ]+$/.test(name) === false) {
39377							errors.name = true;
39378							nameElem.addClass('error');
39379							nameElem.after('<div class="cleaner"></div><div class="error_box">' + js_lang_new_form_item + ' ' + nameElem.parent().find("label").html() + ' ' + js_lang_new_form_nesessery + '</div>');
39380						}
39381
39382						if (typeof surname == 'undefined' || surname === '' || surname.replace(/\s/g, "").length <= 2 || /^[a-žA-Ž ]+$/.test(surname) === false) {
39383							errors.surname = true;
39384							surnameElem.addClass('error');
39385							surnameElem.after('<div class="cleaner"></div><div class="error_box">' + js_lang_new_form_item + ' ' + surnameElem.parent().find("label").html() + ' ' + js_lang_new_form_nesessery + '</div>');
39386						}
39387
39388						if (typeof email == 'undefined' || email === '' || /\S+@\S+\.\S+/.test(email) === false) {
39389							errors.email = true;
39390							if (emailElem.siblings('.error_box').length === 0) {
39391								emailElem.after('<div class="cleaner"></div><div class="error_box">' + js_lang_new_form_item + ' ' + emailElem.parent().find("label").html() + ' ' + js_lang_new_form_nesessery + '</div>');
39392								emailElem.addClass('error');
39393							}
39394						}
39395
39396						if (typeof phone == 'undefined' || phone === '' || phone.replace(/\s/g, "").length < 9 || (phone.replace(/\s/g, "").length > 13 || /\d/g.test(phone.replace(/\s/g, "")) === false)) {
39397							errors.phone = true;
39398							if (phoneElem.siblings('.error_box').length === 0) {
39399								phoneElem.after('<div class="cleaner"></div><div class="error_box">' + js_lang_new_form_item + ' ' + phoneElem.parent().find("label").html() + ' ' + js_lang_new_form_nesessery + '</div>');
39400								phoneElem.addClass('error');
39401							}
39402						}
39403
39404						if (typeof dateFrom == 'undefined' || dateFrom === '' || /(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](20|21)\d\d/.test(dateFrom) === false) {
39405							errors.dateFrom = true;
39406							errors.phone = true;
39407							if (dateFromElem.siblings('.error_box').length === 0) {
39408								dateFromElem.after('<div class="cleaner"></div><div class="error_box">' + js_lang_new_form_item + ' ' + dateFromElem.parent().find("label").html() + ' ' + js_lang_new_form_nesessery + '</div>');
39409								dateFromElem.addClass('error');
39410							}
39411						}
39412
39413						if (typeof dateTo == 'undefined' || dateTo === '' || /(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](20|21)\d\d/.test(dateTo) === false) {
39414							errors.dateTo = true;
39415							if (dateToElem.siblings('.error_box').length === 0) {
39416								dateToElem.after('<div class="cleaner"></div><div class="error_box">' + js_lang_new_form_item + ' ' + dateToElem.parent().find("label").html() + ' ' + js_lang_new_form_nesessery + '</div>');
39417								dateToElem.addClass('error');
39418							}
39419						}
39420
39421						if (dateFrom !== '' && dateTo !== '') {
39422							let dateFrom2 = dateFrom.split(".");
39423							let dateTo2 = dateTo.split(".");
39424							let now = new Date();
39425							now.setHours(0, 0, 0, 0);
39426
39427							dateFrom2 = new Date(parseInt(dateFrom2[2], 10),
39428								parseInt(dateFrom2[1], 10) - 1,
39429								parseInt(dateFrom2[0], 10));
39430
39431							dateTo2 = new Date(parseInt(dateTo2[2], 10),
39432								parseInt(dateTo2[1], 10) - 1,
39433								parseInt(dateTo2[0], 10));
39434
39435							if (isNaN(dateFrom2.getDate())) {
39436								errors.dateFrom = true;
39437								dateFromElem.removeClass('valid');
39438								dateFromElem.after('<div class="cleaner"></div><div class="error_box">' + cms_js_lang_reservation_mode_incorrect_format_date_error + '</div>');
39439							}
39440
39441							if (isNaN(dateTo2.getDate())) {
39442								errors.dateTo = true;
39443								dateToElem.removeClass('valid');
39444								dateToElem.after('<div class="cleaner"></div><div class="error_box">' + cms_js_lang_reservation_mode_incorrect_format_date_error + '</div>');
39445							}
39446
39447							if (dateFrom2 > dateTo2) {
39448								errors.dateFrom = true;
39449								dateFromElem.removeClass('valid');
39450								dateToElem.removeClass('valid');
39451								dateToElem.removeClass('error_box');
39452								dateFromElem.addClass('error');
39453								dateToElem.addClass('error');
39454								dateToElem.after('<div class="cleaner"></div><div class="error_box">' + cms_js_lang_reservation_mode_predate_error + '</div>');
39455								dateFromElem.after('<div class="cleaner"></div><div class="error_box">' + cms_js_lang_reservation_mode_predate_error + '</div>');
39456							}
39457
39458							if (dateFrom2 < now) {
39459								errors.dateFrom = true;
39460								dateFromElem.removeClass('valid');
39461								dateFromElem.addClass('error');
39462								dateFromElem.after('<div class="cleaner"></div><div class="error_box">' + cms_js_lang_reservation_mode_current_date_error + '</div>');
39463							}
39464
39465							if (dateTo2 < now) {
39466								errors.dateTo = true;
39467								dateToElem.removeClass('valid');
39468								dateToElem.addClass('error');
39469								dateToElem.after('<div class="cleaner"></div><div class="error_box">' + cms_js_lang_reservation_mode_current_date_error + '</div>');
39470							}
39471						}
39472
39473
39474						Object.values(errors).forEach(function (error) {
39475							if (error === true) {
39476								result = false;
39477							}
39478						});
39479
39480						if (result === true) {
39481							let emailData = {
39482								name: name,
39483								surname: surname,
39484								email: email,
39485								phone: phone,
39486								comment: comment,
39487								productId: productId,
39488								productName: productName,
39489								dateFrom: dateFrom,
39490								dateTo: dateTo,
39491							};
39492
39493							new AjaxRequest({data: emailData})
39494								.setMethod('POST')
39495								.setController('ProductRental')
39496								.setAction('sendEmail')
39497								.onSuccess(function (response) {
39498									if (response.data.message === 'success') {
39499										reservationModal.close();
39500										vex.dialog.alert(cms_js_lang_reservation_mode_email_sent + '. ' + cms_js_lang_reservation_mode_email_sent_contact);
39501									} else {
39502										reservationModal.close();
39503										vex.dialog.alert(cms_js_lang_reservation_mode_email_not_sent);
39504									}
39505								}).send();
39506
39507						} else {
39508							sendEmailButton.prop('disabled', false);
39509						}
39510					})
39511
39512					reservationInfo.on("focusout", "input, textarea", function () {
39513						var $this = jQuery(this);
39514						let elemValue = $this.val();
39515						var valid = typeof elemValue !== 'undefined' && elemValue !== '';
39516						let elemName = $this.attr('name');
39517						let message = '<div class="cleaner"></div><div class="error_box">' + js_lang_new_form_item + ' ' + $this.parent().find("label").html() + ' ' + js_lang_new_form_nesessery + '</div>';
39518
39519						if (elemName === 'dateTo' || elemName === 'dateFrom') {
39520							return;
39521						}
39522
39523						if (elemName === 'email' && elemValue.length > 0 && /\S+@\S+\.\S+/.test(elemValue) === false) {
39524							valid = false;
39525							message = '<div class="cleaner"></div><div class="error_box">' + js_lang_nsu_lm_wrong_email + '</div>';
39526						}
39527
39528						if (elemName === 'phone' && elemValue.length > 0 && (elemValue === '' || elemValue.replace(/\s/g, "").length < 9 || elemValue.replace(/\s/g, "").length > 13 || /\d/g.test(elemValue.replace(/\s/g, "")) === false)) {
39529							valid = false;
39530							message = '<div class="cleaner"></div><div class="error_box">' + cms_js_lang_is_not_numeric + '</div>';
39531						}
39532
39533						if (valid) {
39534							if ($this.hasClass('required')) {
39535								$this.addClass('valid');
39536								$this.removeClass('error');
39537								$this.siblings('.error_box').remove();
39538								$this.siblings('.cleaner').remove();
39539							}
39540							$this.addClass('filled');
39541
39542						} else {
39543							$this.siblings('.error_box').remove();
39544							$this.siblings('.cleaner').remove();
39545							if ($this.hasClass('required')) {
39546								$this.removeClass('valid');
39547								$this.addClass('error');
39548								$this.after(message);
39549							}
39550							if (elemValue.length > 0) {
39551								$this.addClass('filled');
39552							} else {
39553								$this.removeClass('filled');
39554							}
39555						}
39556					});
39557
39558					reservationInfo.on("change", ".date", function () {
39559						var $this = jQuery(this);
39560						let elemValue = $this.val();
39561						var valid = typeof elemValue !== 'undefined' && elemValue !== '';
39562						let elemName = $this.attr('name');
39563						let currentDateInput = elemValue.split(".");
39564						currentDateInput = new Date(parseInt(currentDateInput[2], 10),
39565							parseInt(currentDateInput[1], 10) - 1,
39566							parseInt(currentDateInput[0], 10));
39567						let now = new Date();
39568						now.setHours(0, 0, 0, 0);
39569
39570						if (elemName === 'dateTo' || elemName === 'dateFrom') {
39571							let message = '<div class="cleaner"></div><div class="error_box">' + js_lang_new_form_item + ' ' + $this.parent().find("label").html() + ' ' + js_lang_new_form_nesessery + '</div>';
39572
39573							if (isNaN(currentDateInput.getDate()) || elemValue !== '' && /(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](20|21)\d\d/.test(elemValue) === false) {
39574								valid = false;
39575								message = '<div class="cleaner"></div><div class="error_box">' + cms_js_lang_reservation_mode_incorrect_format_date_error + '</div>';
39576							}
39577
39578							if (elemValue !== '' && currentDateInput < now) {
39579								valid = false;
39580								message = '<div class="cleaner"></div><div class="error_box">' + cms_js_lang_reservation_mode_current_date_error + '</div>';
39581							}
39582
39583							if (valid) {
39584								if ($this.hasClass('required')) {
39585									$this.addClass('valid');
39586									$this.removeClass('error');
39587									$this.siblings('.error_box').remove();
39588									$this.siblings('.cleaner').remove();
39589								}
39590								$this.addClass('filled');
39591
39592							} else {
39593								$this.siblings('.error_box').remove();
39594								$this.siblings('.cleaner').remove();
39595
39596								$this.removeClass('valid');
39597								$this.addClass('error');
39598								$this.after(message);
39599								if (elemValue !== '') {
39600									$this.addClass('filled');
39601								} else {
39602									$this.removeClass('filled');
39603								}
39604							}
39605						}
39606
39607						if (elemName === 'dateFrom') {
39608							let reservationInfo = jQuery('.submit_product_mode_reservation').parents().find('.reservation_mode_customer_info');
39609							let dateTo2 = reservationInfo.find('input[name="dateTo"]');
39610
39611							dateTo2.datepicker('option', 'minDate', new Date(currentDateInput));
39612						}
39613					});
39614
39615					let options = {minDate: new Date()};
39616					reservationInfo = jQuery('.submit_product_mode_reservation').parents().find('.reservation_mode_customer_info');
39617					reservationInfo.find('input[name="dateFrom"]').datepicker(options);
39618					reservationInfo.find('input[name="dateTo"]').datepicker(options);
39619					jQuery('#ui-datepicker-div').addClass('material_design');
39620				})
39621				.open();
39622		}).send();
39623}
39624
39625function triggerClickOn(selector)
39626{
39627	jQuery(selector).trigger('click');
39628	return false;
39629}
39630
39631/**
39632 * Funkcia vymeni svoj obsah s cielovym elementom
39633 * @param {object} elem DocumentElement
39634 * @param {string} target Cielovy element
39635 * @param {string} func Spusti funkciu na konci ak je to vyzadovane
39636 */
39637function ghostContent(elem, target,  func){
39638	let src = jQuery(elem);
39639	let trg = jQuery(target).not('.ghost_content');
39640
39641	if (trg.length) {
39642		let from = src.closest('.ghost_content');
39643		let class_to = jQuery(trg).removeClass('ghost_content').attr('class');
39644		let ghost_to = jQuery(trg).clone();
39645
39646		from.attr('class', class_to + ' ghost_content');
39647        let ghost_from = from.clone();
39648        jQuery(trg).replaceWith(ghost_from);
39649        from.replaceWith(ghost_to);
39650
39651		// Doplnkove inicializacie
39652		if (typeof func !== 'undefined' && typeof window[func] === 'function') {
39653			window[func](src);
39654		}
39655	}
39656}
39657
39658function ghostSearchContent(src){
39659	js_mod_vm_search_ajax_search_ini();
39660	let selector = jQuery('#shop_search_field');
39661	if (selector.length) {
39662		let caret = selector.val().length;
39663		selector.focus();
39664		selector[0].setSelectionRange(caret,caret);
39665	}
39666}
39667
39668function getProductDetailSelectedVariant(selector = 'body')
39669{
39670	const mainSelector = jQuery(selector);
39671	let selectedVariantElem = undefined;
39672
39673	// stare varianty - select
39674	selectedVariantElem = mainSelector.find('.prod_adv_attrib_select select.main_attr_select');
39675
39676	if (!selectedVariantElem.length) {
39677		// stare varianty - radio
39678		selectedVariantElem = mainSelector.find('.prod_adv_attrib_radio input[type="radio"]:checked');
39679	}
39680	if (!selectedVariantElem.length) {
39681		// stare varianty - adv. select
39682		selectedVariantElem = mainSelector.find('.prod_adv_attrib_select');
39683	}
39684	if (typeof window.js_product_id !== 'undefined' && Number(window.js_product_id) && typeof window['ProductVariantInstance_' + window.js_product_id] !== 'undefined') {
39685		// nove varianty
39686		let selectedAttr = window['ProductVariantInstance_' + window.js_product_id].getSelectedAttribute();
39687		return {
39688			select: undefined,
39689			value: selectedAttr?.source,
39690			parsedValue: vmExplodeProductVariant(selectedAttr?.source),
39691			variantInstance: selectedAttr
39692		}
39693	}
39694
39695	if (selectedVariantElem.length) {
39696		return {
39697			select: selectedVariantElem.attr('name'),
39698			value: selectedVariantElem.val(),
39699			parsedValue: vmExplodeProductVariant(selectedVariantElem.val()),
39700		};
39701	}
39702
39703	return undefined;
39704}
39705
39706function switchLangWyisiwyg(element) {
39707	var elm = jQuery(element);
39708
39709	if (elm.hasClass('cs_flag_active')) {
39710		return;
39711	}
39712
39713	var parentElm = elm.closest('.wysiwyg_editor');
39714	var lang = elm.attr('data-lang');
39715
39716	parentElm.find('.cs_flag_active').removeClass('cs_flag_active');
39717	parentElm.find('.active').removeClass('active').hide();
39718
39719	elm.addClass('cs_flag_active');
39720	parentElm.find('.wysiwyg_container[data-lang="'+lang+'"]').addClass('active').show();
39721}
39722
39723function initWysiwygEditor(element) {
39724	element = jQuery(element);
39725	let textArea = element.is('textarea') ? element : element.find('textarea');
39726
39727	textArea
39728		.ckeditor( function() {
39729			element
39730				.find('.wysiwyg_container:not(.active)')
39731				.hide();
39732		}, cs_ckeditor_default_cfg);
39733}
39734
39735function getAjaxCartItems()
39736{
39737	let cart = jQuery('div.cart_ajax_container div.products_wrap');
39738	let products = cart.children();
39739
39740	let cartItems = {};
39741
39742	products.each(function (index, item) {
39743		let product = jQuery(item);
39744		cartItems[product.attr('data-id')] = product.attr('data-quantity');
39745	});
39746
39747	return cartItems;
39748}
39749
39750function togglePasswordVisibility(element, inputNameOrId) {
39751	element = jQuery(element);
39752
39753	const container = element.closest('div, fieldset, form');
39754	let input = container.find('#' + inputNameOrId);
39755
39756	if (!input.length) {
39757		input = container.find('input[name="' + inputNameOrId + '"]');
39758	}
39759
39760	if (!input.length) {
39761		return;
39762	}
39763
39764	if (input.attr('type') === 'text') {
39765		input.prop('type', 'password');
39766		element.removeClass('csi-eye').addClass('csi-eye-slash');
39767	} else {
39768		input.prop('type', 'text');
39769		element.removeClass('csi-eye-slash').addClass('csi-eye');
39770	}
39771}
39772
39773function changeProductPricePerUnit(newVal) {
39774	let pricePerUnitTitle = jQuery(".flypage-cena .title");
39775	if (pricePerUnitTitle.length > 0) {
39776		let pricePerUnitValue = pricePerUnitTitle.siblings(".price");
39777		if (pricePerUnitValue.length > 0) {
39778			setTimeout(function() {
39779				newVal = `<span class="value">${newVal}</span>/kg`;
39780				pricePerUnitValue.html(newVal);
39781			}, 100);
39782		}
39783	}
39784}
39785
39786function emitEvent(event, data = {}) {
39787	if (!event || typeof event !== 'string') {
39788		return;
39789	}
39790
39791	fetch('/includes/ajax_handle.php', {
39792		method: 'POST',
39793		headers: {[js_CS_Config_csrf_header]: jQuery('meta[name="csrf-token"]').attr('content')},
39794		body: new URLSearchParams({
39795			no_css: 1,
39796			no_html: 1,
39797			no_vm_html: 1,
39798			no_menu: 1,
39799			ajax_call: 2,
39800			controller: 'Event',
39801			action: 'dispatchEvent',
39802			event: event,
39803			data: JSON.stringify(data)
39804		}),
39805		keepalive: true
39806	});
39807}
39808
39809/**
39810 * Unfinished purchase modal - exit intent detection
39811 * Shows modal when user moves cursor toward browser URL bar on cart/checkout pages
39812 */
39813if (config('js_Config_unfinished_purchase_modal')) {
39814	(function () {
39815		let config = js_Config_unfinished_purchase_modal;
39816		let storageKey = 'unfinished_purchase_modal_shown';
39817		let clientYThreshold = typeof config.clientY !== 'undefined' ? config.clientY : 0;
39818
39819		function isRelevantPage() {
39820			const body = document.body;
39821			const isCartPage = body.classList.contains('shop_page_cart');
39822			const isCheckoutPage = document.getElementById('checkout_one_step') !== null;
39823
39824			if (isCartPage && !config.enabledOnCartPage) {
39825				return false;
39826			}
39827
39828			if (isCheckoutPage && !config.enabledOnCheckoutPage) {
39829				return false;
39830			}
39831
39832			if (!isCartPage && !isCheckoutPage) {
39833				return false;
39834			}
39835
39836			return true;
39837		}
39838
39839		function showModal(onCancel) {
39840			sessionStorage.setItem(storageKey, '1');
39841			let submitted = false;
39842
39843			new CsModal()
39844				.setType('confirm')
39845				.setClassName('unfinished-purchase-modal')
39846				.setTitle(js_lang_unfinished_purchase_modal_title)
39847				.setContent('<p>' + js_lang_unfinished_purchase_modal_text + '</p>')
39848				.setButtonTexts([js_lang_unfinished_purchase_modal_btn_continue_shopping, js_lang_unfinished_purchase_modal_btn_continue_order])
39849				.onSubmit(function () {
39850					submitted = true;
39851					this.close();
39852				})
39853				.afterClose(function () {
39854					if (!submitted && typeof onCancel === 'function') {
39855						onCancel();
39856					}
39857				})
39858				.open();
39859		}
39860
39861		// Desktop: mouseleave detection
39862		document.addEventListener('mouseleave', function (e) {
39863			if (sessionStorage.getItem(storageKey)) {
39864				return;
39865			}
39866
39867			if (e.clientY > clientYThreshold) {
39868				return;
39869			}
39870
39871			if (document.querySelector('.module-cart .cart-count-amount') === null) {
39872				return;
39873			}
39874
39875			if (!isRelevantPage()) {
39876				return;
39877			}
39878
39879			showModal();
39880		});
39881
39882		// Mobile: back button interception
39883		if (/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)) {
39884			if (!isRelevantPage()) {
39885				return;
39886			}
39887
39888			if (document.querySelector('.module-cart .cart-count-amount') === null) {
39889				return;
39890			}
39891
39892			let backAllowed = false;
39893
39894			history.pushState({unfinishedPurchaseGuard: true}, '');
39895
39896			window.addEventListener('popstate', function (e) {
39897				if (backAllowed) {
39898					return;
39899				}
39900
39901				if (sessionStorage.getItem(storageKey)) {
39902					return;
39903				}
39904
39905				history.pushState({unfinishedPurchaseGuard: true}, '');
39906
39907				showModal(function () {
39908					backAllowed = true;
39909					history.back();
39910				});
39911			});
39912		}
39913	})();
39914}
39915
39916/**
39917 * If someone or something (third-party script, etc.) tries to overwrite jQuery, it won't let it
39918 */
39919if ( typeof js_Config_stop_jquery_overwrites !== 'undefined' && js_Config_stop_jquery_overwrites ) {
39920	(function() {
39921		var jQueryClone = window.jQuery;
39922
39923		Object.defineProperty(window, 'jQuery', {
39924			configurable: true,
39925			set: function(value) {},
39926			get: function() {
39927				return jQueryClone;
39928			}
39929		});
39930	})();
39931}
39932
39933
39934/* ========================================
39935 FILE: /includes/js/vex/vex.2.2.1.min.js
39936 ==================== */
39937
39938/*! vex.js, vex.dialog.js 2.3.3 */
39939(function(){var a;a=function(a){var b,c;return b=!1,a(function(){var d;return d=(document.body||document.documentElement).style,b=void 0!==d.animation||void 0!==d.WebkitAnimation||void 0!==d.MozAnimation||void 0!==d.MsAnimation||void 0!==d.OAnimation,a(window).bind("keyup.vex",function(a){return 27===a.keyCode?c.closeByEscape():void 0})}),c={globalID:1,animationEndEvent:"animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",baseClassNames:{vex:"vex",content:"vex-content",overlay:"vex-overlay",close:"vex-close",closing:"vex-closing",open:"vex-open"},defaultOptions:{content:"",showCloseButton:!0,escapeButtonCloses:!0,overlayClosesOnClick:!0,appendLocation:"body",className:"vex-cs",css:{},overlayClassName:"",overlayCSS:{},contentClassName:"",contentCSS:{},closeClassName:"",closeCSS:{}},open:function(b){return b=a.extend({},c.defaultOptions,b),b.id=c.globalID,c.globalID+=1,b.$vex=a("<div>").addClass(c.baseClassNames.vex).addClass(b.className).css(b.css).data({vex:b}),b.$vexOverlay=a("<div>").addClass(c.baseClassNames.overlay).addClass(b.overlayClassName).css(b.overlayCSS).data({vex:b}),b.overlayClosesOnClick&&b.$vexOverlay.bind("click.vex",function(b){return b.target===this?c.close(a(this).data().vex.id):void 0}),b.$vex.append(b.$vexOverlay),b.$vexContent=a("<div>").addClass(c.baseClassNames.content).addClass(b.contentClassName).css(b.contentCSS).append(b.content).data({vex:b}),b.$vex.append(b.$vexContent),b.showCloseButton&&(b.$closeButton=a("<div>").addClass(c.baseClassNames.close).addClass(b.closeClassName).css(b.closeCSS).data({vex:b}).bind("click.vex",function(){return c.close(a(this).data().vex.id)}),b.$vexContent.append(b.$closeButton)),a(b.appendLocation).append(b.$vex),c.setupBodyClassName(b.$vex),b.afterOpen&&b.afterOpen(b.$vexContent,b),setTimeout(function(){return b.$vexContent.trigger("vexOpen",b)},0),b.$vexContent},getSelectorFromBaseClass:function(a){return"."+a.split(" ").join(".")},getAllVexes:function(){return a("."+c.baseClassNames.vex+':not(".'+c.baseClassNames.closing+'") '+c.getSelectorFromBaseClass(c.baseClassNames.c
39939ontent))},getVexByID:function(b){return c.getAllVexes().filter(function(){return a(this).data().vex.id===b})},close:function(a){var b;if(!a){if(b=c.getAllVexes().last(),!b.length)return!1;a=b.data().vex.id}return c.closeByID(a)},closeAll:function(){var b;return b=c.getAllVexes().map(function(){return a(this).data().vex.id}).toArray(),(null!=b?b.length:void 0)?(a.each(b.reverse(),function(a,b){return c.closeByID(b)}),!0):!1},closeByID:function(d){var e,f,g,h,i,j;return f=c.getVexByID(d),f.length?(e=f.data().vex.$vex,j=a.extend({},f.data().vex),g=function(){return j.beforeClose?j.beforeClose(f,j):void 0},h=function(){return f.trigger("vexClose",j),e.remove(),a("body").trigger("vexAfterClose",j),j.afterClose?j.afterClose(f,j):void 0},i="none"!==f.css("animationName")&&"0s"!==f.css("animationDuration"),b&&i?g()!==!1&&e.unbind(c.animationEndEvent).bind(c.animationEndEvent,function(){return h()}).addClass(c.baseClassNames.closing):g()!==!1&&h(),!0):void 0},closeByEscape:function(){var b,d,e;return e=c.getAllVexes().map(function(){return a(this).data().vex.id}).toArray(),(null!=e?e.length:void 0)?(d=Math.max.apply(Math,e),b=c.getVexByID(d),b.data().vex.escapeButtonCloses!==!0?!1:c.closeByID(d)):!1},setupBodyClassName:function(b){return a("body").bind("vexOpen.vex",function(){return a("body").addClass(c.baseClassNames.open)}).bind("vexAfterClose.vex",function(){return c.getAllVexes().length?void 0:a("body").removeClass(c.baseClassNames.open)})},hideLoading:function(){return a(".vex-loading-spinner").remove()},showLoading:function(){return c.hideLoading(),a("body").append('<div class="vex-loading-spinner '+c.defaultOptions.className+'"></div>')}}},"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):window.vex=a(jQuery)}).call(this),function(){var a;a=function(a,b){var c,d;return null==b?a.error("Vex is required to use vex.dialog"):(c=function(b){var c;return c={},a.each(b.serializeArray(),function(){return c[this.name]?(c[this.name].push||(c[this.name]=[c[this.name]]),c[this.name].push(this.value||"")):c[this.name]=this.value||""}),c},d={},d.buttons={YES:{text:"OK",type:"submit",className:"vex-dialog-button-primary"},NO:{text:"Cancel",type:"button",className:"vex-dialog-button-secondary",click:function(a,c){return a.data().vex.value=!1,b.close(a.data().vex.id)}}},d.defaultOptions={callback:function(a){},afterOpen:function(){},message:"Message",input:'<input name="vex" type="hidden" value="_vex-empty-value" />',value:!1,buttons:[d.buttons.YES,d.buttons.NO],showCloseButton:!1,onSubmit:function(e){var f,g;return f=a(this),g=f.parent(),e.preventDefault(),e.stopPropagation(),g.data().vex.value=d.getFormValueOnSubmit(c(f)),b.close(g.data().vex.id)},focusFirstInput:!0},d.defaultAlertOptions={message:"Alert",buttons:[d.buttons.YES]},d.defaultConfirmOptions={message:"Confirm"},d.open=function(c){var e,f;return c=a.extend({},b.defaultOptions,d.defaultOptions,c),c.content=d.buildDialogForm(c),f=c.beforeClose,c.beforeClose=function(a,b){return c.callback(b.value),"function"==typeof f?f(a,b):void 0},e=b.open(c),c.focusFirstInput&&e.find('button[type="submit"], button[type="button"], input[type="submit"], input[type="button"], textarea, input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"]').first().focus(),e},d.alert=function(b){return"string"==typeof b&&(b={message:b}),b=a.extend({},d.defaultAlertOptions,b),d.open(b)},d.confirm=function(b){return"string"==typeof b?a.error("dialog.confirm(options) requires options.callback."):(b=a.extend({},d.defaultConfirmOptions,b),d.open(b))},d.prompt=function(b){var c;return"string"==typeof b?a.error("dialog.prompt(options) requires options.callback."):(c={message:'<label for="vex">'+(b.label||"Prompt:")+"</label>",input:'<input name="vex" type="text" class="vex-dialog-prompt-input" placeholder="'+(b.placeholder||"")+'"  value="'+(b.value||"")+'" />'},b=a.extend({},c,b),d.open(b))},d.buildDialogForm=function(b){var c,e,f;return c=a('<form class="vex-dialog-form" />'),f=a('<div class="vex-dialog-message" />'),e=a('<div class="vex-dialog-input" />'),c.append(f.append(b.message)).append(e.append(b.input)).append(d.buttonsToDOM(b.buttons)).bind("submit.vex",b.onSubmit),c},d.getFormValueOnSubmit=function(a){return a.vex||""===a.vex?"_vex-empty-value"===a.vex?!0:a.vex:a},d.buttonsToDOM=function(c){var d;return d=a('<div class="vex-dialog-buttons" />'),a.each(c,function(e,f){var g;return g=a('<button type="'+f.type+'"></button>').text(f.text).addClass(f.className+" vex-dialog-button "+(0===e?"vex-first ":"")+(e===c.length-1?"vex-last ":"")).bind("click.vex",function(c){return f.click?f.click(a(this).parents(b.getSelectorFromBaseClass(b.baseClassNames.c
39939ontent)),c):void 0}),g.appendTo(d)}),d},d)},"function"==typeof define&&define.amd?define(["jquery","vex"],a):"object"==typeof exports?module.exports=a(require("jquery"),require("./vex.js")):window.vex.dialog=a(window.jQuery,window.vex)}.call(this);
39940
39941//Funkcia capitalize
39942String.prototype.capitalize = function() {
39943	return this.charAt(0).toUpperCase() + this.slice(1);
39944}
39945
39946jQuery(function() {
39947	var body = jQuery('body');
39948		
39949	vex.defaultOptions.beforeClose = function() {
39950		body.addClass('vex_closing');
39951	};
39952	
39953	vex.defaultOptions.afterClose = function() {
39954		body.removeClass('vex_closing');
39955	};
39956
39957
39958	/** GLOBALNE NASTAVENIA **/
39959	
39960	//Nastavenie confirm dialogov 
39961	vex.dialog.defaultConfirmOptions = {
39962		className: 'vex-cs confirm',
39963		overlayClosesOnClick: false,
39964		showCloseButton: true,
39965		buttons:{
39966			NO:{
39967				text:cms_js_lang_no.capitalize(),  //Cancel -> Nie
39968				className:"vex-dialog-button-secondary",
39969				type:"button",
39970				click: function() {
39971						return vex.close();
39972				}
39973			},
39974			YES:{
39975				text:cms_js_lang_yes.capitalize(), //OK -> Ano
39976				className:"vex-dialog-button-primary",
39977				type:"submit"
39978			}
39979		}
39980	};
39981		
39982	//Nastavenie alert dialogov 
39983	vex.dialog.defaultAlertOptions = {
39984		className: 'vex-cs confirm alert',
39985		overlayClosesOnClick: false,
39986		showCloseButton: true,
39987		buttons:{
39988			YES:{
39989				text:'OK',
39990				className:"vex-dialog-button-primary",
39991				type:"submit"
39992			}
39993		}
39994	};
39995//if ( is_cs_user() ) {
39996//	// Dusan kontrola vexu a jeho elementov, ak sa tam nenachadza input, checkbox, select, link a button iny ako primary a secondary
39997//	// v pripade chyb povedzte
39998//	jQuery(window).keypress(function (e) {
39999//		if (e.key === ' ' || e.key === 'Spacebar') {
40000//			var inputs     = '';
40001//			var links      = '';
40002//			var checkboxes = '';
40003//			jQuery('.vex-content').each(function () {
40004//				inputs     = jQuery(this).find(':input').not('.vex-dialog-button-primary').not('.vex-dialog-button-secondary');
40005//				checkboxes = jQuery(this).find('[type=checkbox]');
40006//				links      = jQuery(this).find('a');
40007//				//console.log(inputs);
40008//				//console.log(links);
40009//				//console.log(checkboxes);
40010//				//<-- Should return all input elements in that specific form.
40011//				if (inputs.length || checkboxes.length || links.length > 0) {
40012//					console.log('Stlacil si space, ale nakolko sa nachadza vo vexe input, select, checkbox, link tak sa to nepotvrdilo');
40013//				}
40014//				else {
40015//					// ak sa nenachadza vo vexe ziadny input, checkbox, select, link a button iny ako primary, secondary
40016//					// bude spacebar funkcny na odkliknutie
40017//					// ' ' is standard, 'Spacebar' was used by IE9 and Firefox < 37
40018//					jQuery( ".vex-dialog-button-primary" ).click();
40019//					console.log('Stlacil si space, potvrdili sme vex');
40020//				}
40021//			});
40022//		}
40023//	});
40024//}
40025	// po stlaceni space sa potvrdi vex okno
40026	//jQuery(window).keypress(function (e) {
40027	//	if (e.key === ' ' || e.key === 'Spacebar') {
40028	//		// ' ' is standard, 'Spacebar' was used by IE9 and Firefox < 37
40029	//		jQuery( ".vex-dialog-button-primary" ).click();
40030	//
40031	//	}
40032	//});
40033});
40034
40035/** Vlastne funkcie **/
40036
40037function close_vex_spacebar() {
40038	//funkcia pre vypnutie vexu pomocou medzernika
40039	jQuery(window).on('keypress', function (e) {
40040			if (e.key === ' ' || e.key === 'Spacebar') {
40041				// ' ' is standard, 'Spacebar' was used by IE9 and Firefox < 37
40042				jQuery( ".vex-dialog-button-primary" ).click();
40043
40044			}
40045		});
40046}
40047function submit_vex_enter() {
40048	//funkcia pre potvrdenie vexu s enterom
40049	jQuery(window).on('keypress', function (e) {
40050		if (e.which == 13) {
40051			jQuery( ".vex-dialog-button-primary" ).click();
40052		}
40053	});
40054}
40055function stop_submit_vex_enter(jqo) {
40056	//funkcia pre nepotvrdenie vexu s enterom
40057	jQuery(window).on('keypress', function (e) {
40058		if (e.which == 13) {
40059			e.preventDefault();
40060			//jQuery( ".vex-dialog-button-primary" ).click();
40061		}
40062	});
40063}
40064function js_confirm(elem, message){
40065	close_vex_spacebar();
40066	var url = jQuery(elem).prop('href');
40067	vex.dialog.confirm({
40068		message:message,
40069		callback: function(value){
40070			if (value) {
40071				window.location = url;
40072			};
40073		}
40074	});
40075	return false;
40076	
40077}
40078
40079
40080 /**********************
40081 * PRIKLADY POUZITIA:  *
40082 ***********************
40083
40084//Alert:
40085vex.dialog.alert({ 
40086	message:'Are you absolutely sure you want to destroy the alien planet?'
40087});
40088
40089//Confirm:
40090vex.dialog.confirm({ 
40091	message:'Are you absolutely sure you want to destroy the alien planet?',
40092	callback: function(value){
40093		return (value ? true : false);
40094	}
40095});
40096
40097//Confirm na onclick:
40098<a href="/index.php?option=logout" title="Kliknutím sa odhlásite z administrácie" onclick="javascript:return js_confirm(this,'Prajete si odhlásiť sa z administrácie?');">Odhlásiť</a>
40099	
40100
40101//Vseobecne:
40102vex.open({ content: 'Hello World!!!' });
40103
40104vex.open({
40105	showCloseButton: true, 
40106	className: 'vex-cs vex-cs-login', 
40107	content: '<form class="vex-dialog-form vex-login-form" onsubmit="event.preventDefault()">' + 
40108				'<div class="vex-dialog-message">' + 
40109					'<b><?php echo _CMS_ADMINLANG_LOGIN_DIALOG_MESSAGE_ADMINISTRATOR ?></b>' +
40110				'</div>' +
40111				
40112				'<div class="vex-dialog-input" style="padding: 21px;">' +
40113					'<div class="vex-login-username-group">' +
40114						'<label><?php echo _CMS_ADMINLANG_LOGIN_DIALOG_USERNAME_LABEL ?></label>' + 
40115						'<input type="text" class="vex-login-username" placeholder="<?php echo _CMS_ADMINLANG_LOGIN_DIALOG_USERNAME_PLACEHOLDER ?>" name="username">' + 
40116					'</div>' +
40117					'<div class="vex-login-password-group">' +
40118						'<label><?php echo _CMS_ADMINLANG_LOGIN_DIALOG_PASSWORD_LABEL ?></label>' + 
40119						'<input type="password" class="vex-login-password" placeholder="<?php echo _CMS_ADMINLANG_LOGIN_DIALOG_PASSWORD_PLACEHOLDER ?>" name="password">' +
40120					'</div>' +	
40121				'</div>' +
40122				
40123				'<div class="vex-dialog-buttons">' + 
40124					'<div class="vex-dialog-err"></div>' + 
40125					'<button class="vex-login-submit vex-dialog-button-primary vex-dialog-button vex-first vex-last" type="submit"><?php echo _CMS_ADMINLANG_LOGIN_DIALOG_SUBMITBTN_TEXT ?></button>' +
40126				'</div>' +
40127			 '</form>'
40128});
40129
40130***********************************************************************/
40131
40132/* ========================================
40133 FILE: /includes/product_offer/product_offer.js
40134 ==================== */
40135
40136/**
40137 * Creativesites s.r.o
40138 * Produkt offers
40139 * http://wiki.creativesites.sk/doku.php?id=product_offer
40140 * v.2.4
40141 *
40142 *
40143 *  -------------------------------------------------------------------------------------------------
40144 * |                                                                                                 |
40145 * |                                  !!!! POZOR !!!!                                                |
40146 * | Upravuje sa stale subor product_offer_dev.js a obsah sa skopiruje nasledne do product_offer.js  |
40147 * |                                                     											 |
40148 * |							  nasledne sync frontend.js											 |
40149 *  -------------------------------------------------------------------------------------------------
40150 *
40151 */
40152var prof={version:"2.4",debug:!1,set_plugin:0,box:{},wrap:{},body:{},currency:{},browse:0,detail:0,offers:{},verified:[],prepared:0,uninterested:0,variantpicked:1,forcedcount:0,selection:{},availability:{},product_id:0,nocheck:0,product_variant:"",options:{detailopen:"hover",categoryopen:"hover",morebutton:1,buyontop:0,checknoclose:0,mandatoryoffer:0,fadespeed:250,availability:0,scrollToElem:"",scrollToOffset:15},init:function(o){if(prof.debug=is_cs_user("profdev"),prof.debug&&(console.log("Product offers [v."+prof.version+"]"),csstack("init")),prof.body=jQuery("body"),prof.browse=prof.body.hasClass("shop_page_class_shop_browse")?1:0,prof.detail=prof.body.hasClass("shop_page_class_shop_product_details")?1:0,prof.set_plugin=prof.body.find(".prod_add_to_cart.set_add").length>0,void 0!==o&&(prof.options=jQuery.extend(prof.options,o)),prof.detail&&(prof.box=jQuery(".pof_dt_box"),prof.wrap=jQuery(".pof_dt_overbox"),prof.morebtn=jQuery(".show_more_btn"),prof.product_id=parseInt(jQuery('input[name="product_id"]').val()),prof.set_plugin&&prof.box.addClass("pof_set"),prof.body.on("change",".main_attr_select",function(){var o=jQuery(this);prof.product_variant=o.val(),o.removeClass("pof_var_warn")}),void 0!==prof.box&&prof.box.length>0)){var e=prof.box.find(".pof_dt_offer_wrap").length;prof.wrap.addClass("has_offers"),prof.options.morebutton&&e-prof.options.morebutton>0&&(prof.morebtn.show(),prof.morebtn.on("click",function(){prof.box.hasClass("open")?prof.box.removeClass("open"):prof.box.addClass("open")})),prof.options.buyontop&&prof.box.find(".pof_dt_form").insertAfter(".pof_dt_offer_title"),prof.body.on("change",'select[name="pof_variant"]',function(){prof.refreshPrices(this),0==prof.noCheck&&prof.autoCheck(this),1==prof.options.availability&&prof.setAvailability(this),jQuery(this).trigger("blur")}),prof.body.on("focus",'select[name="pof_variant"]',function(){prof.box.addClass("select-opened")}),prof.body.on("blur",'select[name="pof_variant"]',function(){prof.box.removeClass("select-opened")}),prof.body.on("mouseleave",'select[name="pof_variant"]',function(){}),prof.body.on("click",'.select-opened select[name="pof_variant"] option',function(){jQuery(this).trigger("blur")}),prof.body.on("change",'input[name="pof_buy_this"]',function(){var o=jQuery(this),e=o.closest("li");"radio"==o.attr("type")&&o.closest("ul").find("li").removeClass("pof_picked"),o.is(":checked")?e.addClass("pof_picked"):e.removeClass("pof_picked").find(".main_attr_select").val(e.find(".main_attr_select option:first").val()),"click"!=prof.options.detailopen||prof.box.hasClass("open")||prof.morebtn.trigger("click")}),"hover"==prof.options.detailopen?(prof.body.on("mouseenter",".pof_dt_box",function(){prof.box.addClass("open").addClass("mouse-in")}),prof.body.on("mouseleave",".pof_dt_box",function(){prof.box.removeClass("mouse-in"),jQuery(".vex").length>0&&prof.box.hasClass("forcedopen")||prof.options.checknoclose&&prof.box.find('input[name="pof_buy_this"]:checked').length||prof.box.hasClass("select-opened")||prof.box.removeClass("open").removeClass("forcedopen")})):prof.options.detailopen,prof.body.on("click",'.pof_dt_box a[rel="vex"]',function(){prof.box.addClass("forcedopen")}),prof.box.find('[name="pof_variant"]').each(function(){prof.refreshPrices(this)}),prof.wrap.fadeIn(prof.options.fadespeed).addClass("initialized"),"function"==typeof prof.options.onDetailInit&&prof.options.onDetailInit()}if(prof.browse){prof.getOffers();var r="click"===prof.options.categoryopen?"click":"mouseover";prof.body.on(r,".product_offer_fly",function(){prof.show(this)}),"click"===prof.options.categoryopen&&prof.body.on("click",function(o){void 0!==o.target&&jQuery(o.target).closest("div").hasClass("product_offer_fly")||jQuery(".poshy-up").poshytip("hide").removeClass("poshy-up")})}},autoCheck:function(o){prof.debug&&csstack("autoCheck");var e=jQuery(o),r=e.closest("li");""!==e.val()?r.find('input[name="pof_buy_this"]').attr("checked","checked").prop("checked",!0).trigger("change"):r.find('input[name="pof_buy_this"]').removeAttr("checked").prop("checked",!1).trigger("change")}
40152,setAvailability:function(o){if(prof.debug&&csstack("setAvailability"),"function"==typeof setProductAvailabilityTime){var e=prof.getHighestAvail();"undefined"==typeof need_days_variable&&(window.need_days_variable=0),need_days_variable=e,setProductAvailabilityTime();var r=0,t="",a=jQuery(o).closest(".pof_dt_offer_wrap"),i=parseInt(a.find('input[name="pof_buy_this"]').val()),p=a.find('[name="pof_variant"]');if(p.length){var f=p.val();void 0!==prof.availability[i].variant[f]&&(r=parseInt(prof.availability[i].variant[f].id),t=prof.availability[i].variant[f].name)}0==r&&void 0!==prof.availability[i].product&&(r=parseInt(prof.availability[i].product.id),t=prof.availability[i].product.name),""!==t&&void 0!==t&&(prof.debug&&console.log("    Seting availability text: ",t),a.find(".shop_product_availability_value").attr("class","").addClass("shop_product_availability_value").addClass("attr_avail_"+r).html(t))}},getHighestAvail:function(){prof.debug&&csstack("getHighestAvail");var o=0;return prof.box.find("li").each(function(){var e=jQuery(this),r=parseInt(e.find('input[name="pof_buy_this"]').val()),t=e.find('[name="pof_variant"]');if(void 0===prof.availability[r])return!1;var a=0;if(t.length){var i=t.val();void 0!==prof.availability[r].variant[i]&&(a=parseInt(prof.availability[r].variant[i].day))}0==a&&(a=parseInt(prof.availability[r].product.day)),o<a&&(prof.debug&&console.log("    Setting availability day: ",a),o=a)}),o},resetVariantSelect:function(){prof.debug&&csstack("resetVariantSelect"),prof.nocheck=1,prof.box.find('select[name="pof_variant"]').each(function(){var o=jQuery(this);o.val(o.find("option:first").val()).trigger("change")}),prof.nocheck=0},show:function(o){prof.debug&&csstack("show");var e=jQuery(o),r=parseInt(e.find("input").val()),t="",a="",i="",p=e.hasClass("poshy-up");if("click"===prof.options.categoryopen&&(jQuery(".poshy-up").each(function(){jQuery(this).poshytip("hide").removeClass("poshy-up")}),p))return!1;if(void 0!==prof.offers[r]){var f='<div class="pof_pt_box">',s=[];jQuery.each(prof.offers[r],function(o,e){s.push(e)});for(var n=s.sort(function(o,e){return void 0===o.offer_ordering||void 0===e.offer_ordering?0:parseInt(o.offer_ordering)-parseInt(e.offer_ordering)}),c=0;c<n.length;c++)a=n[c].product_credit,i=n[c].product_name,t+='<div class="pof_pt_offer_wrap">',t+='<a class="pof_pt_offer_thumb" href="'+n[c].offer_url+'"><img src="'+n[c].offer_thumb+'" alt="'+n[c].offer_name+'" /></a>',t+='<div class="pof_pt_offer_name"><a href="'+n[c].offer_url+'">'+n[c].offer_name+"</a></div>",t+='<div class="pof_pt_offer_save">'+n[c].offer_discount_text+"</div>",t+='<div class="pof_pt_offer_old">'+n[c].offer_standard_price_text+" "+n[c].offer_save_price_text+"</div>",t+='<div class="pof_pt_offer_pay">'+n[c].offer_new_price_text+"</div>",t+="</div>";f+=i,f+=t,f+=a,f+="</div>",null==e.data("poshytip")?(e.poshytip({className:"tip-yellow",content:f,alignTo:"target",alignX:"center",showOn:"click"===prof.options.categoryopen?"none":"hover",offsetX:0,offsetY:-1,fade:!0,slide:!0,showTimeout:100,hideTimeout:is_cs_user("offer_block")?400000009:100}),e.poshytip("show").addClass("poshy-up")):"click"===prof.options.categoryopen?p?e.poshytip("hide").removeClass("poshy-up"):e.poshytip("show").addClass("poshy-up"):e.poshytip("show")}},getOffers:function(){prof.debug&&csstack("getOffers");var o={action:"getOffers"};o.selection=prof.getProducts(),0!=o.selection.length&&jQuery.post(js_global_live_site+"/includes/product_offer/product_offer_ajax.php",o,function(e){e=csJsonParse(e)||{},prof.debug&&console.log(e),void 0!==e.offers&&(prof.offers=jQuery.extend(!0,prof.offers,e.offers),jQuery.each(o.selection,function(o,r){void 0===e.offers[r]?jQuery(".product_id_"+r).find(".product_offer_fly").remove():jQuery(".product_id_"+r).find(".product_offer_fly").show()}))})},getProducts:function(){prof.debug&&csstack("getProducts");var o=[];return prof.body.find(".product_offer_fly").each(function(){var e=jQuery(this),r=parseInt(e.find('input[name="product_offer_id"]').val());void 0===prof.offers[r]&&prof.verified.indexOf(r)<0&&(e.hide(),o.push(r),prof.verified.push(r))}),o},highlight:function(){var o;prof.debug&&csstack("highlight"),o=""!==prof.options.scrollToElem?jQuery(""+prof.options.scrollToElem):prof.box;var e=parseInt(o.offset().top,10)-prof.options.scrollToOffset;e<0&&(e=0),jQuery("body,html").animate({scrollTop:e},1e3),prof.box.addClass("open"),prof.box.effect("highlight",{},800)},refreshPrices:function(o){prof.debug&&csstack("refreshPrices");var e=parseInt(prof.currency.currency_display.nbDecimal),r=jQuery(o),t=r.closest(".pof_dt_offer_wrap"),a=parseFloat(t.find('input[name="raw_discount"]').val()),i=parseInt(t.find('input[name="raw_discount_type"]').val());"-0-"!=r.val()&&r.removeClass("error"),r.trigger("blur");var p=r.find("option:selected");""==p.val()&&(p=r.find("option[data-price]:first"));var f,s=parseFloat(p.attr("data-price"));f=0==i?prof._round(parseFloat(a/100*s),e):1==i?s-a:a;var n,c=t.find(".pof_dt_offer_save_perc");if(n=0==i?a+"%":js_format_Money(1==i?f:a,e,prof.currency.currency_display.symbol,prof.currency.currency_display.decimal).replace(/\s(.)$/,"$1"),c.html((js_lang_prof_discount||"zľava")+" "+n),t.find(".akcia-cena").html(js_format_Money(s,e,prof.currency.currency_display.symbol,prof.currency.currency_display.decimal)),t.find(".pof_dt_offer_save .pof_sv span").html(js_format_Money(f,e,prof.currency.currency_display.symbol,prof.currency.currency_display.decimal)),s-f>0)var d=js_format_Money(s-f,e,prof.currency.currency_display.symbol,prof.currency.currency_display.decimal);else d="undefined"!=typeof js_lang_prof_free?js_lang_prof_free:"Free";t.find(".pof_dt_offer_pay").html(d)},showWarning:function(o){prof.debug&&csstack("showWarning");var e="",r=o.closest(".products_wrap"),t="",a=new RegExp("pof_par_"),i=o.closest(".product_cont").attr("class").split(" ");if(jQuery.each(i,function(o,e){-1!=e.search(a)&&(t=parseInt(e.replace("pof_par_","")))}),r.find(".pof_ref_"+t).each(function(){var o=jQuery(this);e+='<div class="pof_to_del">',e+='<div class="pof_del_img">'+o.find(".cajx_image").html()+"</div>",e+='<div class="pof_del_name">'+o.find(".cajx_name").html()+"</div>",e+='<div class="pof_del_attr">'+o.find(".cajx_attr").html()+"</div>",e+='<div class="pof_del_price">'+o.find(".cajx_price").html()+"</div>",e+="</div>"}),""!=e){var p="";return p+='<div class="pof_del_wrap">',p+='<div class="pof_del_q">'+("undefined"!=typeof js_lang_prof_del_warn?js_lang_prof_del_warn:"Along with this product, the following special offers will removed.")+"</div>",p+='<div class="pof_to_del_prods">'+e+"</div>",p+='<div class="pof_del_c">'+("undefined"!=typeof js_lang_prof_del_conf?js_lang_prof_del_conf:"Do you want to continue?")+"</div>",vex.dialog.confirm({message:p,callback:function(e){e&&o.addClass("pof_del_confirmed").trigger("click")}}),!1}return!0},prepare:function(){if(prof.debug&&csstack("prepare"),prof.getChecked(),!prof.uninterested&&jQuery.isEmptyObject(prof.selection))return vex.dialog.alert({message:js_lang_prof_select_offer}),prof.prepared=0,!1;if("undefined"!=typeof js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED&&1==js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED&&!prof.uninterested&&!prof.variantpicked)return vex.dialog.alert({message:js_lang_prof_select_variant}),!1;if(prof.uninterested){prof.prepared=1;var o=prof.body.find(".prod_add_to_cart");return o.hasClass("set_add")||o.trigger("click"),!0}if(prof.set_plugin)return prof.prepared=1,!0;var e=prof.getParentVariant(),r={action:"pof_check_cart"};r.selection=JSON.stringify(prof.selection),r.product_id=prof.product_id,r.product_variant=0==e||e<-1?"":e,jQuery.post(js_global_live_site+"/includes/product_offer/product_offer_ajax.php",r,function(o){if
40152(1==(o=csJsonParse(o)||{}).status){prof.debug&&console.log("    Parent is in cart, can add offers..."),prof.prepared=1;var e={update_res:{},log_params:[]};e.update_res.success=1,e.log_params.push(o.product_id),e.log_params.push("+"),e.log_params.push(o.product_qty),e.log_params.push({select_value:o.product_variant}),prof.add(e)}else if(2==o.status){if(prof.debug&&console.log("    Parent is in cart, quantity missing, adding another parent to cart..."),0===prof.getParentVariant(!0))return!1;prof.prepared=1;var r=prof.body.find(".prod_add_to_cart");if(prof.set_plugin)return!0;r.trigger("click")}else{if(prof.debug&&console.log("    Parent not in cart, adding parent to cart..."),0===prof.getParentVariant(!0))return!1;if(prof.prepared=1,r=prof.body.find(".prod_add_to_cart"),prof.set_plugin)return!0;r.trigger("click")}})},getParentVariant:function(o){var e=-1;if("undefined"!=typeof js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED&&1==js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED){var r=jQuery("select.main_attr_select");r.length>0&&(""==r.val()?(o&&(r.addClass("pof_var_warn"),vex.dialog.alert({message:js_lang_prof_select_main_variant})),e=0):e=r.val())}return e},add:function(o){if(prof.debug&&csstack("add"),void 0===o.update_res||void 0===o.update_res.success||1!=o.update_res.success)return prof.prepared=0,prof.uninterested=0,!1;if(!prof.prepared)return!1;if(prof.uninterested)return prof.prepared=0,prof.uninterested=0,!1;var e={action:"pof_cart_add"};e.selection=JSON.stringify(prof.selection),e.product_id=o.log_params[0],e.product_qty=o.log_params[2],void 0!==o.log_params[3]&&"string"==typeof o.log_params[3].select_value&&(e.product_variant=o.log_params[3].select_value),jQuery.post(js_global_live_site+"/includes/product_offer/product_offer_ajax.php",e,function(e){e=csJsonParse(e)||{},prof.set_plugin||(prof.uncheckAll(),prof.resetVariantSelect()),1==e.status?(prof.debug&&console.log("    Success..."),o.html_products=e.html_products,o.html_cart_values=e.html_cart_values,js_ajax_cart_container_init(o),js_add_to_cart_form_ajax_cart_bind(),"function"==typeof js_ajax_cart_update_after_init&&js_ajax_cart_update_after_init()):(prof.debug&&console.log("    Error..."),void 0!==e.html_products&&(o.html_products=e.html_products,o.html_cart_values=e.html_cart_values,js_ajax_cart_container_init(o),js_add_to_cart_form_ajax_cart_bind(),"function"==typeof js_ajax_cart_update_after_init&&js_ajax_cart_update_after_init()),void 0!==e.not_added&&jQuery.each(e.not_added,function(o,e){jQuery(".pof_pid_"+e).addClass("pof_highlight")}),prof.box.append(e.status),setTimeout(function(){jQuery(".shop_tip, .shop_warning").remove()},6e3)),prof.prepared=0,prof.uninterested=0})},uncheckAll:function(){prof.debug&&csstack("uncheckAll"),jQuery('input[name="pof_buy_this"]').prop("checked",!1)},getChecked:function(){prof.debug&&csstack("getChecked"),prof.selection={},prof.variantpicked=1,prof.box.find('input[name="pof_buy_this"]:checked').each(function(){var o=jQuery(this),e=parseInt(o.val(),10),r=0;if(0==e)return prof.uninterested=1,{};if(o.hasClass("pof_variants")){var t=void 0!==(r=o.closest(".pof_dt_offer_wrap").find('select[name="pof_variant"] option:selected').val())&&"-0-"!=r&&""!=r;prof.variantpicked=prof.variantpicked&&t,t?o.closest(".pof_dt_offer_wrap").find('select[name="pof_variant"]').removeClass("error"):o.closest(".pof_dt_offer_wrap").find('select[name="pof_variant"]').addClass("error")}prof.selection[e]=r}),prof.box.find('input[name="pof_buy_forced"]').each(function(){var o=jQuery(this),e=parseInt(o.val(),10);prof.selection[e]=0,prof.forcedcount++}),jQuery.isEmptyObject(prof.selection)&&prof.box.hasClass("pof_type_1")&&(prof.uninterested=1)},sortCart:function(o){prof.debug&&csstack("sortCart"),void 0===o&&(o=jQuery(".cart_ajax_container"));var e={};o.find(".pof_child").each(function(){var r=jQuery(this),t=new RegExp("pof_ref_(\\d+)","g").exec(r.attr("class"));null!==t&&void 0!==t[1]&&(void 0===e[t[1]]?e[t[1]]=1:e[t[1]]++,r.addClass("pof_sort_"+e[t[1]]),o.find(".pof_par_"+t[1]).after(r))}),jQuery.each(e,function(e,r){o.find(".pof_ref_"+e+".pof_sort_1").addClass("pof_child_last")})},_round:function(o,e){void 0===e&&(e=0);var r=Math.pow(10,e),t=o*r;return Math.round(t)/r}};
40153
40154
40155/* ========================================
40156 FILE: /includes/infinite_scroll/iscroll.min.js
40157 ==================== */
40158
40159var iscroll={version:"1.1",debug:is_cs_user("scrolldev")||is_cs_user("separate_js"),window:{},body:{},box:{},button:{},curr_url:"",next_url:"",prev_url:"",cache:{},loading:0,bottom:0,rowheight:100,page:1,first_page:1,last_page:1,ispexf:0,_page:1,_scroll:0,options:{ajax_call:1,no_vm_html:1,no_menu:1,no_html:1,no_css:1,filler:!0,echo_buffer_and_exit:1,is_inf_scroll_call:1,time:Math.round((new Date).getTime()/1e3)},setting:{realtime:1,constant:2,btnTarget:"",afterShow:null},init:function(l){var o,i;iscroll.debug&&(console.log("Infinite scrolling [v."+iscroll.version+"]"),csstack("init")),iscroll.window=jQuery(window),iscroll.body=jQuery("body"),iscroll.box=jQuery("#product_list"),iscroll.ispexf=iscroll.box.hasClass("pexf_is_on")||jQuery(".mp_fs").length,void 0!==l&&(iscroll.setting=jQuery.extend(iscroll.setting,l)),iscroll.box.length&&(iscroll.initCache(),(i=iscroll.canLoad(iscroll.next_url))&&iscroll.load(iscroll.next_url),jQuery(document).ajaxComplete(function(){window.setTimeout(function(){iscroll.ispexf;iscroll.box=jQuery("#product_list"),iscroll.ispexf=iscroll.box.hasClass("pexf_is_on")||jQuery(".mp_fs").length},500)}),o=jQuery("#middle_content"),iscroll.setting.filler&&iscroll.window.height()>o.height()&&((l=document.createElement("div")).id="filler",l.style.height=iscroll.window.height()-o.height()+"px",o.after(l)),iscroll.window.scroll(iscroll.scroll),!iscroll.setting.realtime&&i&&(i="undefined"!=typeof js_
40159inf_scroll_button_more?js_inf_scroll_button_more:"Show more",iscroll.button=jQuery("<div>").addClass("button inf_button").html(i),iscroll.button.on("click",function(){iscroll.loadFollowing()}),(""!==iscroll.setting.btnTarget?jQuery(iscroll.setting.btnTarget):iscroll.box).after(iscroll.button)),jQuery("#footer").on("mouseover",function(l){l.target==this&&jQuery("#footer_top_wrapper").show()}),iscroll.body.on("mouseleave","#footer_top_wrapper",function(){jQuery(this).hide("slide",{direction:"down"},400)}))},initCache:function(l){var o;iscroll.debug&&csstack("initCache"),void 0!==iscroll.cache[iscroll.page]||(o=jQuery(".inf_page.page_"+iscroll.page)).length&&(iscroll.bottom=parseInt(o.position().top)+o.height(),iscroll.rowheight=jQuery(".shop-category-product").height(),iscroll.first_page=iscroll.page,iscroll.last_page=iscroll.page,o.data("infpage",iscroll.page),iscroll.cache[iscroll.page]={},iscroll.cache[iscroll.page].page=iscroll.page,iscroll.cache[iscroll.page].next_url=jQuery(".pn_next_has_link").attr("href"),iscroll.cache[iscroll.page].curr_url=js_global_live_site_sef,iscroll.cache[iscroll.page].prev_url=jQuery(".pn_prev_has_link").attr("href"),iscroll.cache[iscroll.page].response='<div class="inf_page page_'+iscroll.page+'">'+o.html()+"</div>",iscroll.cache[iscroll.page].pagination=jQuery(".page-navigation-bottom").html())},scroll:function(){var l;iscroll.ispexf||(l=iscroll.window.scrollTop(),iscroll.setting.realtime&&iscroll._scroll<l&&iscroll.bottom-iscroll.rowheight*iscroll.setting.constant<l&&0===iscroll.loading&&iscroll.loadFollowing(),Math.abs(l-iscroll._scroll)>parseFloat(.2*iscroll.window.height())&&(iscroll._scroll=l,jQuery(".inf_page").each(function(){var l=jQuery(this),o=parseInt(l.data("infpage"),10);return"undefined"!=o&&!isNaN(o)&&(o==iscroll.page||(iscroll.mostlyVisible(l,o)?(iscroll.updateTo(o),!1):void 0))})))},updateTo:function(l){iscroll.debug&&csstack("updateTo",[l]),iscroll.page=l,iscroll._page=l;var o,i=jQuery(".inf_page.page_"+l);i.length&&(iscroll.bottom=parseInt(i.position().top)+i.height()),void 0!==iscroll.cache[l]&&(o=iscroll.cache[l].curr_url,iscroll.last_page>iscroll.first_page&&(i=new RegExp(/(.*),\d+\/$/),o=iscroll.cache[l].curr_url.replace(i,"$1,"+iscroll.first_page+"-"+iscroll.last_page+"/")),console.log(o),history.replaceState(null,null,o),jQuery(".page-navigation-bottom").html(iscroll.cache[l].pagination),jQuery(".page-navigation-top").html(iscroll.cache[l].pagination))},load:function(l,o){void 0!==window.luigy_search_init&&window.luigy_search_init&&(l=l.replace(",,",",")),iscroll.debug&&csstack("load",[l]),iscroll.loading=1,jQuery.getJSON(l,iscroll.options,function(l){iscroll.cache[l.page]=l,iscroll.loading=0,"function"==typeof o&&o(l)}).fail(function(l){iscroll.debug&&console.log("    Error: Failed loading JSON",l),iscroll.loading=0,"function"==typeof o&&o(!1)})},loadFollowing:function(){iscroll.debug&&csstack("loadFollowing"),void 0!==iscroll.cache[iscroll.page+1]?(iscroll.debug&&console.log("    Page cached! | "+iscroll.next_url),iscroll.showFollowing(iscroll.cache[iscroll.page+1])):iscroll.canLoad(iscroll.next_url)&&iscroll.load(iscroll.next_url,function(l){!1!==l&&iscroll.showFollowing(l)})},showFollowing:function(l){iscroll.debug&&csstack("showFollowing");var o,i,e=jQuery("#product_list .inf_page.page_"+l.page);if(e.length)return iscroll.debug&&console.log("    Page already displayed..."),!1;jQuery("#product_list .inf_page.page_"+iscroll.page).after(l.response),"function"==typeof iscroll.setting.afterShow&&iscroll.setting.afterShow(l,"next"),void 0!==l.breadcrumblist&&(o=jQuery("#luigibox_structure_shop_browse_container").find("script"),i=JSON.parse(o.html()),jQuery(l.breadcrumblist.result.itemListElement).each(function(l,o){i.result.itemListElement.push(o)}),o.html(JSON.stringify(i))),iscroll.next_url=l.next_url,iscroll.last_page<l.page&&(iscroll.last_page=l.page),e.data("infpage",l.page),iscroll.canLoad(iscroll.next_url)||0!==iscroll.setting.realtime||iscroll.button.hide(),iscroll.canLoad(iscroll.next_url)&&void 0===iscroll.cache[l.page+1]&&iscroll.load(iscroll.next_url)},loadPrevious:function(){iscroll.debug&&csstack("loadPrevious"),iscroll.cache[iscroll.page-1]?(iscroll.debug&&console.log("    show previous"),iscroll.showPrevious(iscroll.cache[iscroll.page-1]),iscroll.loading=0):iscroll.canLoad(iscroll.prev_url)&&iscroll.load(iscroll.prev_url,function(l){!1!==l&&iscroll.showPrevious(l)})},showPrevious:function(l){if(iscroll.debug&&csstack("showPrevious"),0<jQuery("#product_list .inf_page.page_"+l.page).length)return!1;var o=jQuery("#product_list .inf_page.page_"+iscroll.page);o.before(l.response),"function"==typeof iscroll.setting.afterShow&&iscroll.setting.afterShow(l,"prev"),window.scrollTo(0,iscroll.window.scrollTop()+o.height()),iscroll.prev_url=l.prev_url,
vendor: 17,036 bytes, lines 40159-40168
40159iscroll.first_page>l.page&&(iscroll.first_page=l.page),iscroll.canLoad(iscroll.prev_url)&&void 0===iscroll.cache[l.page-1]&&iscroll.load(iscroll.prev_url)},canLoad:function(l){l=""!==l&&"#"!==l&&null!==l&&"null"!==l;return iscroll.debug&&csstack("canLoad","'"+(l?"true":"false")+"'"),l},mostlyVisible:function(l,o){var i=iscroll.window.scrollTop(),e=iscroll.window.height(),r=l.offset().top,l=l.height(),e=i<r+l-.25*l&&r<i+.5*e;return iscroll.debug&&csstack("mostlyVisible","'Page "+o+": "+(e?"true":"false")+"'"),e}};
40160
40161/* ========================================
40162 FILE: /includes/js/jquery/mCustomScrollbar-3.1.7/jquery.mCustomScrollbar.concat.min.js
40163 ==================== */
40164
40165/* == jquery mousewheel plugin == Version: 3.1.13, License: MIT License (MIT) */
40166!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
40167/* == malihu jquery custom scrollbar plugin == Version: 3.1.7, License: MIT License (MIT) */
40168!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){var t,o,a,n,i,r,l,s,c,d,u,f,m,h,p,g,v,x,S,_,w,C,b,y,B,T,k,M,O,I,D,E,W,R,A,L,z,P,H,U,F,q,j,Y,X,N,V,Q,G,J,K,Z,$,ee,te,oe,ae,ne;oe="function"==typeof define&&define.amd,ae="undefined"!=typeof module&&module.exports,ne="https:"==document.location.protocol?"https:":"http:",oe||(ae?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+ne+"//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js%3E%3C/script%3E"))),o="mCustomScrollbar",a={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},n=0,i={},r=window.attachEvent&&!window.addEventListener?1:0,l=!1,s=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],c={init:function(t){var t=e.extend(!0,{},a,t),o=d.call(this);if(t.live){var r=t.liveSelector||this.selector||".mCustomScrollbar",l=e(r);if("off"===t.live)return void f(r);i[r]=setTimeout(function(){l.mCustomScrollbar(t),"once"===t.live&&l.length&&f(r)},500)}else f(r);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":m(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=h(t.scrollButtons.scrollType),u(t),e(o).each(function(){var o=e(this);if(!o.data("mCS")){o.data("mCS",{idx:++n,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var a=o.data("mCS"),i=a.opt,r=o.data("mcs-axis"),l=o.data("mcs-scrollbar-position"),d=o.data("mcs-theme");r&&(i.axis=r),l&&(i.scrollbarPosition=l),d&&(i.theme=d,u(i)),p.call(this),a&&i.callbacks.onCreate&&"function"==typeof i.callbacks.onCreate&&i.callbacks.onCreate.call(this),e("#mCSB_"+a.idx+"_container img:not(."+s[2]+")").addClass(s[2]),c.update.call(null,o)}})},update:function(t,o){var a=t||d.call(this);return e(a).each(function(){var t=e(this);if(t.data("mCS")){var a=t.data("mCS"),n=a.opt,i=e("#mCSB_"+a.idx+"_container"),r=e("#mCSB_"+a.idx),l=[e("#mCSB_"+a.idx+"_dragger_vertical"),e("#mCSB_"+a.idx+"_dragger_horizontal")];if(!i.length)return;a.tweenRunning&&X(t),o&&a&&n.callbacks.onBeforeUpdate&&"function"==typeof n.callbacks.onBeforeUpdate&&n.callbacks.onBeforeUpdate.call(this),t.hasClass(s[3])&&t.removeClass(s[3]),t.hasClass(s[4])&&t.removeClass(s[4]),r.css("max-height","none"),r.height()!==t.height()&&r.css("max-height",t.height()),v.call(this),"y"===n.axis||n.advanced.autoExpandHorizontalScroll||i.css("width",g(i)),a.overflowed=C.call(this),T.call(this),n.autoDraggerLength&&S.call(this),_.call(this),y.call(this);var c=[Math.abs(i[0].offsetTop),Math.abs(i[0].offsetLeft)];"x"!==n.axis&&(a.overflowed[0]?l[0].height()>l[0].parent().height()?b.call(this):(N(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),a.contentReset.y=null):(b.call(this),"y"===n.axis?B.call(this):"yx"===n.axis&&a.overflowed[1]&&N(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==n.axis&&(a.overflowed[1]?l[1].width()>l[1].parent().width()?b.call(this):(N(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),a.contentReset.x=null):(b.call(this),"x"===n.axis?B.call(this):"yx"===n.axis&&a.overflowed[0]&&N(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&a&&(2===o&&n.callbacks.onImageLoad&&"function"==typeof n.callbacks.onImageLoad?n.callbacks.onImageLoad.call(this):3===o&&n.callbacks.onSelectorChange&&"function"==typeof n.callbacks.onSelectorChange?n.callbacks.onSelectorChange.call(this):n.callbacks.onUpdate&&"function"==typeof n.callbacks.onUpdate&&n.callbacks.onUpdate.call(this)),Y.call(this)}})},scrollTo:function(t,o){if(void 0!==t&&null!=t){var a=d.call(this);return e(a).each(function(){var a=e(this);if(a.data("mCS")){var n=a.data("mCS"),i=n.opt,r={trigger:"external",scrollInertia:i.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},l=e.extend(!0,{},r,o),s=q.call(this,t),c=l.scrollInertia>0&&l.scrollInertia<17?17:l.scrollInertia;s[0]=j.call(this,s[0],"y"),s[1]=j.call(this,s[1],"x"),l.moveDragger&&(s[0]*=n.scrollRatio.y,s[1]*=n.scrollRatio.x),l.dur=te()?0:c,setTimeout(function(){null!==s[0]&&void 0!==s[0]&&"x"!==i.axis&&n.overflowed[0]&&(l.dir="y",l.overwrite="all",N(a,s[0].toString(),l)),null!==s[1]&&void 0!==s[1]&&"y"!==i.axis&&n.overflowed[1]&&(l.dir="x",l.overwrite="none",N(a,s[1].toString(),l))},l.timeout)}})}},stop:function(){var t=d.call(this);return e(t).each(function(){var t=e(this);t.data("mCS")&&X(t)})},disable:function(t){var o=d.call(this);return e(o).each(function(){var o=e(this);o.data("mCS")&&(o.data("mCS"),Y.call(this,"remove"),B.call(this),t&&b.call(this),T.call(this,!0),o.addClass(s[3]))})},destroy:function(){var t=d.call(this);return e(t).each(function(){var a=e(this);if(a.data("mCS")){var n=a.data("mCS"),i=n.opt,r=e("#mCSB_"+n.idx),l=e("#mCSB_"+n.idx+"_container"),c=e(".mCSB_"+n.idx+"_scrollbar");i.live&&f(i.liveSelector||e(t).selector),Y.call(this,"remove"),B.call(this),b.call(this),a.removeData("mCS"),J(this,"mcs"),c.remove(),l.find("img."+s[2]).removeClass(s[2]),r.replaceWith(l.contents()),a.removeClass(o+" _mCS_"+n.idx+" "+s[6]+" "+s[7]+" "+s[5]+" "+s[3]).addClass(s[4])}})}},d=function(){return"object"!=typeof e(this)||e(this).length<1?".mCustomScrollbar":this},u=function(t){t.autoDraggerLength=!(e.inArray(t.theme,["rounded","rounded-dark","rounded-dots","rounded-dots-dark"])>-1)&&t.autoDraggerLength,t.autoExpandScrollbar=!(e.inArray(t.theme,["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"])>-1)&&t.autoExpandScrollbar,t.scrollButtons.enable=!(e.inArray(t.theme,["minimal","minimal-dark"])>-1)&&t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,["minimal","minimal-dark"])>-1||t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,["minimal","minimal-dark"])>-1?"outside":t.scrollbarPosition},f=function(e){i[e]&&(clearTimeout(i[e]),J(i,e))},m=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},h=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},p=function(){var t=e(this),a=t.data("mCS"),n=a.opt,i=n.autoExpandScrollbar?" "+s[1]+"_expand":"",r=["<div id='mCSB_"+a.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+a.idx+"_scrollbar mCS-"+n.theme+" mCSB_scrollTools_vertical"+i+"'><div class='"+s[12]+"'><div id='mCSB_"+a.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div></div><div class='mCSB_draggerRail' /></div>","<div id='mCSB_"+a.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+a.idx+"_scrollbar mCS-"+n.theme+" mCSB_scrollTools_horizontal"+i+"'><div class='"+s[12]+"'><div id='mCSB_"+a.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div></div><div class='mCSB_draggerRail' /></div>"],l="yx"===n.axis?"mCSB_vertical_horizontal":"x"===n.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===n.axis?r[0]+r[1]:"x"===n.axis?r[1]:r[0],d="yx"===n.axis?"<div id='mCSB_"+a.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",u=n.autoHideScrollbar?" "+s[6]:"",f="x"!==n.axis&&"rtl"===a.langDir?" "+s[7]:"";n.setWidth&&t.css("width",n.setWidth),n.setHeight&&t.css("height",n.setHeight),n.setLeft="y"!==n.axis&&"rtl"===a.langDir?"989999px":n.setLeft,t.addClass(o+" _mCS_"+a.idx+u+f).wrapInner("<div id='mCSB_"+a.idx+"' class='mCustomScrollBox mCS-"+n.theme+" "+l+"'><div id='mCSB_"+a.idx+"_container' class='mCSB_container' style='position:relative; top:"+n.setTop+"; left:"+n.setLeft+";' dir='"+a.langDir+"' /></div>");var m=e("#mCSB_"+a.idx),h=e("#mCSB_"+a.idx+"_container");"y"===n.axis||n.advanced.autoExpandHorizontalScroll||h.css("width",g(h)),"outside"===n.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),h.wrap(d)),x.call(this);var p=[e("#mCSB_"+a.idx+"_dragger_vertical"),e("#mCSB_"+a.idx+"_dragger_horizontal")];p[0].css("min-height",p[0].height()),p[1].css("min-width",p[1].width())},g=function(t){var o=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return e(this).outerWidth(!0)}).get())],a=t.parent().width();return o[0]>a?o[0]:o[1]>a?o[1]:"100%"},v=function(){var t=e(this),o=t.data("mCS"),a=o.opt,n=e("#mCSB_"+o.idx+"_container");if(a.advanced.autoExpandHorizontalScroll&&"y"!==a.axis){n.css({width:"auto","min-width":0,"overflow-x":"scroll"});var i=Math.ceil(n[0].scrollWidth);3===a.advanced.autoExpandHorizontalScroll||2!==a.advanced.autoExpandHorizontalScroll&&i>n.parent().width()?n.css({width:i,"min-width":"100%","overflow-x":"inherit"}):n.css({"overflow-x":"inherit",position:"absolute"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(n[0].getBoundingClientRect().right+.4)-Math.floor(n[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},x=function(){var t=e(this),o=t.data("mCS"),a=o.opt,n=e(".mCSB_"+o.idx+"_scrollbar:first"),i=$(a.scrollButtons.tabindex)?"tabindex='"+a.scrollButtons.tabindex+"'":"",r=["<a href='#' class='"+s[13]+"' "+i+" />","<a href='#' class='"+s[14]+"' "+i+" />","<a href='#' class='"+s[15]+"' "+i+" />","<a href='#' class='"+s[16]+"' "+i+" />
40168"],l=["x"===a.axis?r[2]:r[0],"x"===a.axis?r[3]:r[1],r[2],r[3]];a.scrollButtons.enable&&n.prepend(l[0]).append(l[1]).next(".mCSB_scrollTools").prepend(l[2]).append(l[3])},S=function(){var t=e(this),o=t.data("mCS"),a=e("#mCSB_"+o.idx),n=e("#mCSB_"+o.idx+"_container"),i=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[a.height()/n.outerHeight(!1),a.width()/n.outerWidth(!1)],s=[parseInt(i[0].css("min-height")),Math.round(l[0]*i[0].parent().height()),parseInt(i[1].css("min-width")),Math.round(l[1]*i[1].parent().width())],c=r&&s[1]<s[0]?s[0]:s[1],d=r&&s[3]<s[2]?s[2]:s[3];i[0].css({height:c,"max-height":i[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":s[0]+"px"}),i[1].css({width:d,"max-width":i[1].parent().width()-10})},_=function(){var t=e(this),o=t.data("mCS"),a=e("#mCSB_"+o.idx),n=e("#mCSB_"+o.idx+"_container"),i=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],r=[n.outerHeight(!1)-a.height(),n.outerWidth(!1)-a.width()],l=[r[0]/(i[0].parent().height()-i[0].height()),r[1]/(i[1].parent().width()-i[1].width())];o.scrollRatio={y:l[0],x:l[1]}},w=function(e,t,o){var a=o?s[0]+"_expanded":"",n=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(s[0]+" "+a),n.toggleClass(s[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(s[0]),n.removeClass(s[1])):(e.addClass(s[0]),n.addClass(s[1])))},C=function(){var t=e(this),o=t.data("mCS"),a=e("#mCSB_"+o.idx),n=e("#mCSB_"+o.idx+"_container"),i=null==o.overflowed?n.height():n.outerHeight(!1),r=null==o.overflowed?n.width():n.outerWidth(!1),l=n[0].scrollHeight,s=n[0].scrollWidth;return l>i&&(i=l),s>r&&(r=s),[i>a.height(),r>a.width()]},b=function(){var t,o,a=e(this),n=a.data("mCS"),i=n.opt,r=e("#mCSB_"+n.idx),l=e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];X(a),("x"!==i.axis&&!n.overflowed[0]||"y"===i.axis&&n.overflowed[0])&&(s[0].add(l).css("top",0),N(a,"_resetY")),("y"!==i.axis&&!n.overflowed[1]||"x"===i.axis&&n.overflowed[1])&&(t=o=0,"rtl"===n.langDir&&(t=r.width()-l.outerWidth(!1),o=Math.abs(t/n.scrollRatio.x)),l.css("left",t),s[1].css("left",o),N(a,"_resetX"))},y=function(){var t=e(this),o=t.data("mCS"),a=o.opt;if(!o.bindEvents){var n;if(M.call(this),a.contentTouchScroll&&O.call(this),I.call(this),a.mouseWheel.enable)!function o(){n=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(n),D.call(t[0])):o()},100)}();L.call(this),P.call(this),a.advanced.autoScrollOnFocus&&z.call(this),a.scrollButtons.enable&&H.call(this),a.keyboard.enable&&U.call(this),o.bindEvents=!0}},B=function(){var t=e(this),o=t.data("mCS"),a=o.opt,n="mCS_"+o.idx,i=".mCSB_"+o.idx+"_scrollbar",r=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+i+" ."+s[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+i+">a"),l=e("#mCSB_"+o.idx+"_container");if(a.advanced.releaseDraggableSelectors&&r.add(e(a.advanced.releaseDraggableSelectors)),a.advanced.extraDraggableSelectors&&r.add(e(a.advanced.extraDraggableSelectors)),o.bindEvents){var c=W()?top.document:document;e(document).add(e(c)).unbind("."+n),r.each(function(){e(this).unbind("."+n)}),clearTimeout(t[0]._focusTimeout),J(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),J(o.sequential,"step"),clearTimeout(l[0].onCompleteTimeout),J(l[0],"onCompleteTimeout"),o.bindEvents=!1}},T=function(t){var o=e(this),a=o.data("mCS"),n=a.opt,i=e("#mCSB_"+a.idx+"_container_wrapper"),r=i.length?i:e("#mCSB_"+a.idx+"_container"),l=[e("#mCSB_"+a.idx+"_scrollbar_vertical"),e("#mCSB_"+a.idx+"_scrollbar_horizontal")],c=[l[0].find(".mCSB_dragger"),l[1].find(".mCSB_dragger")];"x"!==n.axis&&(a.overflowed[0]&&!t?(l[0].add(c[0]).add(l[0].children("a")).css("display","block"),r.removeClass(s[8]+" "+s[10])):(n.alwaysShowScrollbar?(2!==n.alwaysShowScrollbar&&c[0].css("display","none"),r.removeClass(s[10])):(l[0].css("display","none"),r.addClass(s[10])),r.addClass(s[8]))),"y"!==n.axis&&(a.overflowed[1]&&!t?(l[1].add(c[1]).add(l[1].children("a")).css("display","block"),r.removeClass(s[9]+" "+s[11])):(n.alwaysShowScrollbar?(2!==n.alwaysShowScrollbar&&c[1].css("display","none"),r.removeClass(s[11])):(l[1].css("display","none"),r.addClass(s[11])),r.addClass(s[9]))),a.overflowed[0]||a.overflowed[1]?o.removeClass(s[5]):o.addClass(s[5])},k=function(t){var o=t.type,a=t.target.ownerDocument!==document&&null!==frameElement?[e(frameElement).offset().top,e(frameElement).offset().left]:null,n=W()&&t.target.ownerDocument!==top.document&&null!==frameElement?[e(t.view.frameElement).offset().top,e(t.view.frameElement).offset().left]:[0,0];switch(o){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return a?[t.originalEvent.pageY-a[0]+n[0],t.originalEvent.pageX-a[1]+n[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],r=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return t.target.ownerDocument!==document?[i.screenY,i.screenX,r>
401681]:[i.pageY,i.pageX,r>1];default:return a?[t.pageY-a[0]+n[0],t.pageX-a[1]+n[1],!1]:[t.pageY,t.pageX,!1]}},M=function(){var t,o,a,n=e(this),i=n.data("mCS"),s=i.opt,c="mCS_"+i.idx,d=["mCSB_"+i.idx+"_dragger_vertical","mCSB_"+i.idx+"_dragger_horizontal"],u=e("#mCSB_"+i.idx+"_container"),f=e("#"+d[0]+",#"+d[1]),m=s.advanced.releaseDraggableSelectors?f.add(e(s.advanced.releaseDraggableSelectors)):f,h=W()?top.document:document,p=s.advanced.extraDraggableSelectors?e(h).add(e(s.advanced.extraDraggableSelectors)):e(h);function g(e,o,a,r){if(u[0].idleTimer=s.scrollInertia<233?250:0,t.attr("id")===d[1])var l="x",c=(t[0].offsetLeft-o+r)*i.scrollRatio.x;else var l="y",c=(t[0].offsetTop-e+a)*i.scrollRatio.y;N(n,c.toString(),{dir:l,drag:!0})}f.bind("contextmenu."+c,function(e){e.preventDefault()}).bind("mousedown."+c+" touchstart."+c+" pointerdown."+c+" MSPointerDown."+c,function(i){if(i.stopImmediatePropagation(),i.preventDefault(),K(i)){l=!0,r&&(document.onselectstart=function(){return!1}),R.call(u,!1),X(n);var c=(t=e(this)).offset(),d=k(i)[0]-c.top,f=k(i)[1]-c.left,m=t.height()+c.top,h=t.width()+c.left;d<m&&d>0&&f<h&&f>0&&(o=d,a=f),w(t,"active",s.autoExpandScrollbar)}}).bind("touchmove."+c,function(e){e.stopImmediatePropagation(),e.preventDefault();var n=t.offset(),i=k(e)[0]-n.top,r=k(e)[1]-n.left;g(o,a,i,r)}),e(document).add(p).bind("mousemove."+c+" pointermove."+c+" MSPointerMove."+c,function(e){if(t){var n=t.offset(),i=k(e)[0]-n.top,r=k(e)[1]-n.left;if(o===i&&a===r)return;g(o,a,i,r)}}).add(m).bind("mouseup."+c+" touchend."+c+" pointerup."+c+" MSPointerUp."+c,function(e){t&&(w(t,"active",s.autoExpandScrollbar),t=null),l=!1,r&&(document.onselectstart=null),R.call(u,!0)})},O=function(){var o,a,n,i,r,s,c,d,u,f,m,h,p,g,v=e(this),x=v.data("mCS"),S=x.opt,_="mCS_"+x.idx,w=e("#mCSB_"+x.idx),C=e("#mCSB_"+x.idx+"_container"),b=[e("#mCSB_"+x.idx+"_dragger_vertical"),e("#mCSB_"+x.idx+"_dragger_horizontal")],y=[],B=[],T=0,M="yx"===S.axis?"none":"all",O=[],I=C.find("iframe"),D=["touchstart."+_+" pointerdown."+_+" MSPointerDown."+_,"touchmove."+_+" pointermove."+_+" MSPointerMove."+_,"touchend."+_+" pointerup."+_+" MSPointerUp."+_],E=void 0!==document.body.style.touchAction&&""!==document.body.style.touchAction;function R(e){if(!Z(e)||l||k(e)[2])t=0;else{t=1,p=0,g=0,o=1,v.removeClass("mCS_touch_action");var i=C.offset();a=k(e)[0]-i.top,n=k(e)[1]-i.left,O=[k(e)[0],k(e)[1]]}}function A(e){if(Z(e)&&!l&&!k(e)[2]&&(S.documentTouchScroll||e.preventDefault(),e.stopImmediatePropagation(),(!g||p)&&o)){c=Q();var t=w.offset(),i=k(e)[0]-t.top,r=k(e)[1]-t.left;if(y.push(i),B.push(r),O[2]=Math.abs(k(e)[0]-O[0]),O[3]=Math.abs(k(e)[1]-O[1]),x.overflowed[0])var s=b[0].parent().height()-b[0].height(),d=a-i>0&&i-a>-s*x.scrollRatio.y&&(2*O[3]<O[2]||"yx"===S.axis);if(x.overflowed[1])var u=b[1].parent().width()-b[1].width(),f=n-r>0&&r-n>-u*x.scrollRatio.x&&(2*O[2]<O[3]||"yx"===S.axis);d||f?(E||e.preventDefault(),p=1):(g=1,v.addClass("mCS_touch_action")),E&&e.preventDefault(),m="yx"===S.axis?[a-i,n-r]:"x"===S.axis?[null,n-r]:[a-i,null],C[0].idleTimer=250,x.overflowed[0]&&H(m[0],T,"mcsLinearOut","y","all",!0),x.overflowed[1]&&H(m[1],T,"mcsLinearOut","x",M,!0)}}function L(e){if(!Z(e)||l||k(e)[2])t=0;else{t=1,e.stopImmediatePropagation(),X(v),s=Q();var o=w.offset();i=k(e)[0]-o.top,r=k(e)[1]-o.left,y=[],B=[]}}function z(e){if(Z(e)&&!l&&!k(e)[2]){o=0,e.stopImmediatePropagation(),p=0,g=0,d=Q();var t=w.offset(),a=k(e)[0]-t.top,n=k(e)[1]-t.left;if(!(d-c>30)){var v=(f=1e3/(d-s))<2.5,_=v?[y[y.length-2],B[B.length-2]]:[0,0];u=v?[a-_[0],n-_[1]]:[a-i,n-r];var b=[Math.abs(u[0]),Math.abs(u[1])];f=v?[Math.abs(u[0]/4),Math.abs(u[1]/4)]:[f,f];var T=[Math.abs(C[0].offsetTop)-u[0]*P(b[0]/f[0],f[0]),Math.abs(C[0].offsetLeft)-u[1]*P(b[1]/f[1],f[1])];m="yx"===S.axis?[T[0],T[1]]:"x"===S.axis?[null,T[1]]:[T[0],null],h=[4*b[0]+S.scrollInertia,4*b[1]+S.scrollInertia];var O=parseInt(S.contentTouchScroll)||0;m[0]=b[0]>O?m[0]:0,m[1]=b[1]>O?m[1]:0,x.overflowed[0]&&H(m[0],h[0],"mcsEaseOut","y",M,!1),x.overflowed[1]&&H(m[1],h[1],"mcsEaseOut","x",M,!1)}}}function P(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function H(e,t,o,a,n,i){e&&N(v,e.toString(),{dur:t,scrollEasing:o,dir:a,over
vendor: 13,158 bytes, line 40168
40168write:n,drag:i})}C.bind(D[0],function(e){R(e)}).bind(D[1],function(e){A(e)}),w.bind(D[0],function(e){L(e)}).bind(D[2],function(e){z(e)}),I.length&&I.each(function(){e(this).bind("load",function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind(D[0],function(e){R(e),L(e)}).bind(D[1],function(e){A(e)}).bind(D[2],function(e){z(e)})})})},I=function(){var o,a=e(this),n=a.data("mCS"),i=n.opt,r=n.sequential,s="mCS_"+n.idx,c=e("#mCSB_"+n.idx+"_container"),d=c.parent();function u(e,t,n){r.type=n&&o?"stepped":"stepless",r.scrollAmount=10,F(a,e,t,"mcsLinearOut",n?60:null)}c.bind("mousedown."+s,function(e){t||o||(o=1,l=!0)}).add(document).bind("mousemove."+s,function(e){if(!t&&o&&(window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type&&document.selection.createRange().text)){var a=c.offset(),l=k(e)[0]-a.top+c[0].offsetTop,s=k(e)[1]-a.left+c[0].offsetLeft;l>0&&l<d.height()&&s>0&&s<d.width()?r.step&&u("off",null,"stepped"):("x"!==i.axis&&n.overflowed[0]&&(l<0?u("on",38):l>d.height()&&u("on",40)),"y"!==i.axis&&n.overflowed[1]&&(s<0?u("on",37):s>d.width()&&u("on",39)))}}).bind("mouseup."+s+" dragend."+s,function(e){t||(o&&(o=0,u("off",null)),l=!1)})},D=function(){if(e(this).data("mCS")){var t=e(this),o=t.data("mCS"),a=o.opt,n="mCS_"+o.idx,i=e("#mCSB_"+o.idx),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],s=e("#mCSB_"+o.idx+"_container").find("iframe");s.length&&s.each(function(){e(this).bind("load",function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+n,function(e,t){c(e,t)})})}),i.bind("mousewheel."+n,function(e,t){c(e,t)})}function c(n,s){if(X(t),!A(t,n.target)){var c="auto"!==a.mouseWheel.deltaFactor?parseInt(a.mouseWheel.deltaFactor):r&&n.deltaFactor<100?100:n.deltaFactor||100,d=a.scrollInertia;if("x"===a.axis||"x"===a.mouseWheel.axis)var u="x",f=[Math.round(c*o.scrollRatio.x),parseInt(a.mouseWheel.scrollAmount)],m="auto"!==a.mouseWheel.scrollAmount?f[1]:f[0]>=i.width()?.9*i.width():f[0],h=Math.abs(e("#mCSB_"+o.idx+"_container")[0].offsetLeft),p=l[1][0].offsetLeft,g=l[1].parent().width()-l[1].width(),v="y"===a.mouseWheel.axis?n.deltaY||s:n.deltaX;else var u="y",f=[Math.round(c*o.scrollRatio.y),parseInt(a.mouseWheel.scrollAmount)],m="auto"!==a.mouseWheel.scrollAmount?f[1]:f[0]>=i.height()?.9*i.height():f[0],h=Math.abs(e("#mCSB_"+o.idx+"_container")[0].offsetTop),p=l[0][0].offsetTop,g=l[0].parent().height()-l[0].height(),v=n.deltaY||s;"y"===u&&!o.overflowed[0]||"x"===u&&!o.overflowed[1]||((a.mouseWheel.invert||n.webkitDirectionInvertedFromDevice)&&(v=-v),a.mouseWheel.normalizeDelta&&(v=v<0?-1:1),(v>0&&0!==p||v<0&&p!==g||a.mouseWheel.preventDefault)&&(n.stopImmediatePropagation(),n.preventDefault()),n.deltaFactor<5&&!a.mouseWheel.normalizeDelta&&(m=n.deltaFactor,d=17),N(t,(h-v*m).toString(),{dir:u,dur:d}))}}},E=new Object,W=function(t){var o=!1,a=!1,n=null;if(void 0===t?a="#empty":void 0!==e(t).attr("id")&&(a=e(t).attr("id")),!1!==a&&void 0!==E[a])return E[a];if(t){try{var i=t.contentDocument||t.contentWindow.document;n=i.body.innerHTML}catch(e){}o=null!==n}else{try{var i=top.document;n=i.body.innerHTML}catch(e){}o=null!==n}return!1!==a&&(E[a]=o),o},R=function(e){var t=this.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}},A=function(t,o){var a=o.nodeName.toLowerCase(),n=t.data("mCS").opt.mouseWheel.disableOver;return e.inArray(a,n)>-1&&!(e.inArray(a,["select","textarea"])>-1&&!e(o).is(":focus"))},L=function(){var t,o=e(this),a=o.data("mCS"),n="mCS_"+a.idx,i=e("#mCSB_"+a.idx+"_container"),r=i.parent(),c=e(".mCSB_"+a.idx+"_scrollbar ."+s[12]);c.bind("mousedown."+n+" touchstart."+n+" pointerdown."+n+" MSPointerDown."+n,function(o){l=!0,e(o.target).hasClass("mCSB_dragger")||(t=1)}).bind("touchend."+n+" pointerup."+n+" MSPointerUp."+n,function(e){l=!1}).bind("click."+n,function(n){if(t&&(t=0,e(n.target).hasClass(s[12])||e(n.target).hasClass("mCSB_draggerRail"))){X(o);var l=e(this),c=l.find(".mCSB_dragger");if(l.parent(".mCSB_scrollTools_horizontal").length>0){if(!a.overflowed[1])return;var d="x",u=n.pageX>c.offset().left?-1:1,f=Math.abs(i[0].offsetLeft)-u*(.9*r.width())}else{if(!a.overflowed[0])return;var d="y",u=n.pageY>c.offset().top?-1:1,f=Math.abs(i[0].offsetTop)-u*(.9*r.height())}N(o,f.toString(),{dir:d,scrollEasing:"mcsEaseInOut"})}})},z=function(){var t=e(this),o=t.data("mCS"),a=o.opt,n="mCS_"+o.idx,i=e("#mCSB_"+o.idx+"_container"),r=i.parent();i.bind("focusin."+n,function(o){var n=e(document.activeElement),l=i.find(".mCustomScrollBox").length;n.is(a.advanced.autoScrollOnFocus)&&(X(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=l?17*l:0,t[0]._focusTimeout=setTimeout(function(){var e=[ee(n)[0],ee(n)[1]],o=[i[0].offsetTop,i[0].offsetLeft],l=[o[0]+e[0]>=0&&o[0]+e[0]<r.height()-n.outerHeight(!1),o[1]+e[1]>=0&&o[0]+e[1]<r.width()-n.outerWidth(!1)],s="yx"!==a.axis||l[0]||l[1]?"all":"none";"x"===a.axis||l[0]||N(t,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:s,dur:0}),"y"===a.axis||l[1]||N(t,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:s,dur:0})},t[0]._focusTimer))})},P=function(){var t=e(this),o=t.data("mCS"),a="mCS_"+o.idx,n=e("#mCSB_"+o.idx+"_container").parent();n.bind("scroll."+a,function(t){0===n.scrollTop()&&0===n.scrollLeft()||e(".mCSB_"+o.idx+"_scrollbar").css("visibility","hidden")})},H=function(){var t=e(this),o=t.data("mCS"),a=o.opt,n=o.sequential,i="mCS_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",s=e(r+">a");s.bind("contextmenu."+i,function(e){e.preventDefault()}).bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i+" mouseup."+i+" touchend."+i+" pointerup."+i+" MSPointerUp."+i+" mouseout."+i+" pointerout."+i+" MSPointerOut."+i+" click."+i,function(i){if(i.preventDefault(),K(i)){var r=e(this).attr("class");switch(n.type=a.scrollButtons.scrollType,i.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===n.type)return;l=!0,o.tweenRunning=!1,s("on",r);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===n.type)return;l=!1,n.dir&&s("off",r);break;case"click":if("stepped"!==n.type||o.tweenRunning)return;s("on",r)}}function s(e,o){n.scrollAmount=a.scrollButtons.scrollAmount,F(t,e,o)}})},U=function(){var t=e(this),o=t.data("mCS"),a=o.opt,n=o.sequential,i="mCS_"+o.idx,r=e("#mCSB_"+o.idx),l=e("#mCSB_"+o.idx+"_container"),s=l.parent(),c="input,textarea,select,datalist,keygen,[contenteditable='true']",d=l.find("iframe"),u=["blur."+i+" keydown."+i+" keyup."+i];function f(i){switch(i.type){case"blur":o.tweenRunning&&n.dir&&h("off",null);break;case"keydown":case"keyup":var r=i.keyCode?i.keyCode:i.which,d="on";if("x"!==a.axis&&(38===r||40===r)||"y"!==a.axis&&(37===r||39===r)){if((38===r||40===r)&&!o.overflowed[0]||(37===r||39===r)&&!o.overflowed[1])return;"keyup"===i.type&&(d="off"),e(document.activeElement).is(c)||(i.preventDefault(),i.stopImmediatePropagation(),h(d,r))}else if(33===r||34===r){if((o.overflowed[0]||o.overflowed[1])&&(i.preventDefault(),i.stopImmediatePropagation()),"keyup"===i.type){X(t);var u=34===r?-1:1;if("x"===a.axis||"yx"===a.axis&&o.overflowed[1]&&!o.overflowed[0])var f="x",m=Math.abs(l[0].offsetLeft)-u*(.9*s.width());else var f="y",m=Math.abs(l[0].offsetTop)-u*(.9*s.height());N(t,m.toString(),{dir:f,scrollEasing:"mcsEaseInOut"})}}else if((35===r||36===r)&&!e(document.activeElement).is(c)&&((o.overflowed[0]||o.overflowed[1])&&(i.preventDefault(),i.stopImmediatePropagation()),"keyup"===i.type)){if("x"===a.axis||"yx"===a.axis&&o.overflowed[1]&&!o.overflowed[0])var f="x",m=35===r?Math.abs(s.width()-l.outerWidth(!1)):0;else var f="y",m=35===r?Math.abs(s.height()-l.outerHeight(!1)):0;N(t,m.toString(),{dir:f,scrollEasing:"mcsEaseInOut"})}}function h(e,i){n.type=a.keyboard.scrollType,n.scrollAmount=a.keyboard.scrollAmount,"stepped"===n.type&&o.tweenRunning||F(t,e,i)}}d.length&&d.each(function(){e(this).bind("load",function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind(u[0],function(e){f(e)})})}),r.attr("tabindex","0").bind(u[0],function(e){f(e)})},F=function(t,o,a,n,i){var r=t.data("mCS"),l=r.opt,c=r.sequential,d=e("#mCSB_"+r.idx+"_container"),u="stepped"===c.type,f=l.scrollInertia<26?26:l.scrollInertia,m=l.scrollInertia<1?17:l.scrollInertia;switch(o){case"on":if(c.dir=[a===s[16]||a===s[15]||39===a||37===a?"x":"y",a===s[13]||a===s[15]||38===a||37===a?-1:1],X(t),$(a)&&"stepped"===c.type)return;h(u);break;case"off":clearTimeout(c.step),J(c,"step"),X(t),(u||r.tweenRunning&&c.dir)&&h(!0)}function h(e){l.snapAmount&&(c.scrollAmount=l.snapAmount instanceof Array?"x"===c.dir[0]?l.snapAmount[1]:l.snapAmount[0]:l.snapAmount);var o="stepped"!==c.type,a=i||(e?o?f/1.5:m:1e3/60),s=e?o?7.5:40:2.5,u=[Math.abs(d[0].offsetTop),Math.abs(d[0].offsetLeft)],p=[r.scrollRatio.y>10?10:r.scrollRatio.y,r.scrollRatio.x>10?10:r.scrollRatio.x],g="x"===c.dir[0]?u[1]+c.dir[1]*(p[1]*s):u[0]+c.dir[1]*(p[0]*s),v="x"===c.dir[0]?u[1]+c.dir[1]*parseInt(c.scrollAmount):u[0]+c.dir[1]*parseInt(c.scrollAmount),x="auto"!==c.scrollAmount?v:g,S=n||(e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear"),_=!!e;e&&a<17&&(x="x"===c.dir[0]?u[1]:u[0]),N(t,x.toString(),{dir:c.dir[0],scrollEasing:S,dur:a,onComplete:_}),e?c.dir=!1:(clearTimeout(c.step),c.step=setTimeout(function(){h()},a))}},q=function(t){var o=e(this).data("mCS").opt,a=[];return"function"==typeof t&&(t=t()),t instanceof Array?a=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(a[0]=t.y?t.y:t.x||"x"===o.axis?null:t,a[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof a[0]&&(a[0]=a[0]()),"function"==typeof a[1]&&(a[1]=a[1]()),a},j=function(t,o){if(null!=t&&void 0!==t){var a=e(this),n=a.data("mCS"),i=n.opt,r=e("#mCSB_"+n.idx+"_container"),l=r.parent(),s=typeof t;o||(o="x"===i.axis?"x":"y");var d="x"===o?r.outerWidth(!1)-l.width():r.outerHeight(!1)-l.height(),u="x"===o?r[0].offsetLeft:r[0].offsetTop,f="x"===o?"left":"top";switch(s){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?ee(m)[1]:ee(m)[0];case"string":case"number":if($(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(u-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var h=u+parseInt(t.split("+=")[1]);return h>=0?0:Math.abs(h)}if(-1!==t.indexOf("px")&&$(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(l.height()-r.outerHeight(!1));if("right"===t)return Math.abs(l.width()-r.outerWidth(!1));if("first"===t||"last"===t){var m=r.find(":"+t);return"x"===o?ee(m)[1]:ee(m)[0]}return e(t).length?"x"===o?ee(e(t))[1]:ee(e(t))[0]:(r.css(f,t),void c.update.call(null,a[0]))}}},Y=function(t){var o=e(this),a=o.data("mCS"),n=a.opt,i=e("#mCSB_"+a.idx+"_container");if(t)return clearTimeout(i[0].autoUpdate),void J(i[0],"autoUpdate");function r(e){clearTimeout(i[0].autoUpdate),c.update.call(null,o[0],e)}!function t(){clearTimeout(i[0].autoUpdate),0!==o.parents("html").length?i[0].autoUpdate=setTimeout(function(){return n.advanced.updateOnSelectorChange&&(a.poll.change.n=function(){!0===n.advanced.updateOnSelectorChange&&(n.advanced.updateOnSelectorChange="*");var e=0,t=i.find(n.advanced.updateOnSelectorChange);return n.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){e+=this.offsetHeight+this.offsetWidth}),e}(),a.poll.change.n!==a.poll.change.o)?(a.poll.change.o=a.poll.change.n,void r(3)):n.advanced.updateOnContentResize&&(a.poll.size.n=o[0].scrollHeight+o[0].scrollWidth+i[0].offsetHeight+o[0].offsetHeight+o[0].offsetWidth,a.poll.size.n!==a.poll.size.o)?(a.poll.size.o=a.poll.size.n,void r(1)):!n.advanced.updateOnImageLoad||"auto"===n.advanced.updateOnImageLoad&&"y"===n.axis||(a.poll.img.n=i.find("img").length,a.poll.img.n===a.poll.img.o)?void((n.advanced.updateOnSelectorChange||n.advanced.updateOnContentResize||n.advanced.updateOnImageLoad)&&t()):(a.poll.img.o=a.poll.img.n,void i.find("img").each(function(){!function(t){if(e(t).hasClass(s[2]))r();else{var o,a,n=new Image;n.onload=(o=n,a=function(){this.onload=null,e(t).addClass(s[2]),r(2)},function(){return a.apply(o,arguments)}),n.src=t.src}}(this)}))},n.advanced.autoUpdateTimeout):o=null}()},X=function(t){var o=t.data("mCS"),a=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");a.each(function(){G.call(this)})},N=function(t,o,a){var n=t.data("mCS"),i=n.opt,r={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:i.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},a=e.extend(r,a),l=[a.dur,a.drag?0:a.dur],s=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),d=c.parent(),u=i.callbacks.onTotalScrollOffset?q.call(t,i.callbacks.onTotalScrollOffset):[0,0],f=i.callbacks.onTotalScrollBackOffset?q.call(t,i.callbacks.onTotalScrollBackOffset):[0,0];if(n.trigger=a.trigger,0===d.scrollTop()&&0===d.scrollLeft()||(e(".mCSB_"+n.idx+"_scrollbar").css("visibility","visible"),d.scrollTop(0).scrollLeft(0)),"_resetY"!==o||n.contentReset.
40168y||(y("onOverflowYNone")&&i.callbacks.onOverflowYNone.call(t[0]),n.contentReset.y=1),"_resetX"!==o||n.contentReset.x||(y("onOverflowXNone")&&i.callbacks.onOverflowXNone.call(t[0]),n.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){if(!n.contentReset.y&&t[0].mcs||!n.overflowed[0]||(y("onOverflowY")&&i.callbacks.onOverflowY.call(t[0]),n.contentReset.x=null),!n.contentReset.x&&t[0].mcs||!n.overflowed[1]||(y("onOverflowX")&&i.callbacks.onOverflowX.call(t[0]),n.contentReset.x=null),i.snapAmount){var m=i.snapAmount instanceof Array?"x"===a.dir?i.snapAmount[1]:i.snapAmount[0]:i.snapAmount;o=function(e,t,o){return Math.round(e/t)*t-o}(o,m,i.snapOffset)}switch(a.dir){case"x":var h=e("#mCSB_"+n.idx+"_dragger_horizontal"),p="left",g=c[0].offsetLeft,v=[s.width()-c.outerWidth(!1),h.parent().width()-h.width()],x=[o,0===o?0:o/n.scrollRatio.x],S=u[1],_=f[1],C=S>0?S/n.scrollRatio.x:0,b=_>0?_/n.scrollRatio.x:0;break;case"y":var h=e("#mCSB_"+n.idx+"_dragger_vertical"),p="top",g=c[0].offsetTop,v=[s.height()-c.outerHeight(!1),h.parent().height()-h.height()],x=[o,0===o?0:o/n.scrollRatio.y],S=u[0],_=f[0],C=S>0?S/n.scrollRatio.y:0,b=_>0?_/n.scrollRatio.y:0}x[1]<0||0===x[0]&&0===x[1]?x=[0,0]:x[1]>=v[1]?x=[v[0],v[1]]:x[0]=-x[0],t[0].mcs||(B(),y("onInit")&&i.callbacks.onInit.call(t[0])),clearTimeout(c[0].onCompleteTimeout),V(h[0],p,Math.round(x[1]),l[1],a.scrollEasing),!n.tweenRunning&&(0===g&&x[0]>=0||g===v[0]&&x[0]<=v[0])||V(c[0],p,Math.round(x[0]),l[0],a.scrollEasing,a.overwrite,{onStart:function(){a.callbacks&&a.onStart&&!n.tweenRunning&&(y("onScrollStart")&&(B(),i.callbacks.onScrollStart.call(t[0])),n.tweenRunning=!0,w(h),n.cbOffsets=[i.callbacks.alwaysTriggerOffsets||g>=v[0]+S,i.callbacks.alwaysTriggerOffsets||g<=-_])},onUpdate:function(){a.callbacks&&a.onUpdate&&y("whileScrolling")&&(B(),i.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(a.callbacks&&a.onComplete){"yx"===i.axis&&clearTimeout(c[0].onCompleteTimeout);var e=c[0].idleTimer||0;c[0].onCompleteTimeout=setTimeout(function(){y("onScroll")&&(B(),i.callbacks.onScroll.call(t[0])),y("onTotalScroll")&&x[1]>=v[1]-C&&n.cbOffsets[0]&&(B(),i.callbacks.onTotalScroll.call(t[0])),y("onTotalScrollBack")&&x[1]<=b&&n.cbOffsets[1]&&(B(),i.callbacks.onTotalScrollBack.call(t[0])),n.tweenRunning=!1,c[0].idleTimer=0,w(h,"hide")},e)}}})}function y(e){return n&&i.callbacks[e]&&"function"==typeof i.callbacks[e]}function B(){var e=[c[0].offsetTop,c[0].offsetLeft],o=[h[0].offsetTop,h[0].offsetLeft],n=[c.outerHeight(!1),c.outerWidth(!1)],i=[s.height(),s.width()];t[0].mcs={content:c,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(n[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(n[1])-i[1])),direction:a.dir}}},V=function(e,t,o,a,n,i,r){e._mTween||(e._mTween={top:{},left:{}});var l,s,r=r||{},c=r.onStart||function(){},d=r.onUpdate||function(){},u=r.onComplete||function(){},f=Q(),m=0,h=e.offsetTop,p=e.style,g=e._mTween[t];"left"===t&&(h=e.offsetLeft);var v=o-h;function x(){g.stop||(m||c.call(),m=Q()-f,S(),m>=g.time&&(g.time=m>g.time?m+l-(m-g.time):m+l-1,g.time<m+1&&(g.time=m+1)),g.time<a?g.id=s(x):u.call())}function S(){a>0?(g.currVal=function(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return(e/=a/2)<1?o/2*e*e+t:-o/2*(--e*(e-2)-1)+t;case"easeInOutStrong":return(e/=a/2)<1?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(2-Math.pow(2,-10*e))+t);case"easeInOut":case"mcsEaseInOut":return(e/=a/2)<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t;case"easeOutSmooth":return e/=a,-o*(--e*e*e*e-1)+t;case"easeOutStrong":return o*(1-Math.pow(2,-10*e/a))+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}(g.time,h,v,a,n),p[t]=Math.round(g.currVal)+"px"):p[t]=o+"px",d.call()}g.stop=0,"none"!==i&&null!=g.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(g.id):clearTimeout(g.id),g.id=null),l=1e3/60,g.time=m+l,s=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return S(),setTimeout(e,.01)},g.id=s(x)},Q=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},G=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o<t.length;o++){var a=t[o];e._mTween[a].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._mTween[a].id):clearTimeout(e._mTween[a].id),e._mTween[a].id=null,e._mTween[a].stop=1)}},J=function(e,t){try{delete e[t]}catch(o){e[t]=null}},K=function(e){return!(e.which&&1!==e.which)},Z=function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},$=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ee=function(e){var t=e.parents(".mCSB_container");return[e.offset().top-t.offset().top,e.offset().left-t.offset().left]},te=function(){var e=function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return e[t]+"Hidden";return null}();return!!e&&document[e]},e.fn[o]=function(t){return c[t]?c[t].apply(this,Array.prototype.slice.call(arguments,1
40168)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):c.init.apply(this,arguments)},e[o]=function(t){return c[t]?c[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):c.init.apply(this,arguments)},e[o].defaults=a,window[o]=!0,e(window).bind("load",function(){e(".mCustomScrollbar")[o](),e.extend(e.expr[":"],{mcsInView:e.expr[":"].mcsInView||function(t){var o,a,n=e(t),i=n.parents(".mCSB_container");if(i.length)return o=i.parent(),(a=[i[0].offsetTop,i[0].offsetLeft])[0]+ee(n)[0]>=0&&a[0]+ee(n)[0]<o.height()-n.outerHeight(!1)&&a[1]+ee(n)[1]>=0&&a[1]+ee(n)[1]<o.width()-n.outerWidth(!1)},mcsInSight:e.expr[":"].mcsInSight||function(t,o,a){var n,i,r,l,s=e(t),c=s.parents(".mCSB_container"),d="exact"===a[3]?[[1,0],[1,0]]:[[.9,.1],[.6,.4]];if(c.length)return n=[s.outerHeight(!1),s.outerWidth(!1)],r=[c[0].offsetTop+ee(s)[0],c[0].offsetLeft+ee(s)[1]],i=[c.parent()[0].offsetHeight,c.parent()[0].offsetWidth],r[0]-i[0]*(l=[n[0]<i[0]?d[0]:d[1],n[1]<i[1]?d[0]:d[1]])[0][0]<0&&r[0]+n[0]-i[0]*l[0][1]>=0&&r[1]-i[1]*l[1][0]<0&&r[1]+n[1]-i[1]*l[1][1]>=0},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var o=e(t).data("mCS");if(o)return o.overflowed[0]||o.overflowed[1]}})})});
40169
40170/* ========================================
40171 FILE: /includes/js/jquery.touchpunch.min.js
40172 ==================== */
40173
40174//jQuery UI Touch Punch 0.2.3
40175/*
40176!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d);}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"));},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"));},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1);},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b);},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b);};}}(jQuery);
40177*/
40178/*!
40179 * jQuery UI Touch Punch 1.0.8 as modified by RWAP Software
40180 * based on original touchpunch v0.2.3 which has not been updated since 2014
40181 *
40182 * Updates by RWAP Software to take account of various suggested changes on the original code issues
40183 *
40184 * Original: https://github.com/furf/jquery-ui-touch-punch
40185 * Copyright 2011–2014, Dave Furfero
40186 * Dual licensed under the MIT or GPL Version 2 licenses.
40187 *
40188 * Fork: https://github.com/RWAP/jquery-ui-touch-punch
40189 *
40190 * Depends:
40191 * jquery.ui.widget.js
40192 * jquery.ui.mouse.js
40193 */
40194!function(t){"function"==typeof define&&define.amd?define(["jquery","jquery.ui"],t):t(jQuery)}(function(t){function o(t){return{x:t.originalEvent.changedTouches[0].pageX,y:t.originalEvent.changedTouches[0].pageY}}function e(t,o){if(!(t.originalEvent.touches.length>1)){t.cancelable&&t.preventDefault();var e=t.originalEvent.changedTouches[0],n=document.createEvent("MouseEvents");n.initMouseEvent(o,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(n)}}if(t.support.mspointer=window.navigator.msPointerEnabled,t.support.touch="ontouchstart"in document||"ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,(t.support.touch||t.support.mspointer)&&t.ui.mouse){var n,u=t.ui.mouse.prototype,c=u._mouseInit,i=u._mouseDestroy;u._touchStart=function(t){var u=this;this._startedMove=t.timeStamp,u._startPos=o(t),!n&&u._mouseCapture(t.originalEvent.changedTouches[0])&&(n=!0,u._touchMoved=!1,e(t,"mouseover"),e(t,"mousemove"),e(t,"mousedown"))},u._touchMove=function(t){n&&(this._touchMoved=!0,e(t,"mousemove"))},u._touchEnd=function(t){if(n){e(t,"mouseup"),e(t,"mouseout");var u=t.timeStamp-this._startedMove;if(!this._touchMoved||500>u)e(t,"click");else{var c=o(t);Math.abs(c.x-this._startPos.x)<10&&Math.abs(c.y-this._startPos.y)<10&&(this._touchMoved&&"stylus"!==t.originalEvent.changedTouches[0].touchType||e(t,"click"))}this._touchMoved=!1,n=!1}},u._mouseInit=function(){var o=this;t.support.mspointer&&(o.element[0].style.msTouchAction="none"),o.element.on({touchstart:t.proxy(o,"_touchStart"),touchmove:t.proxy(o,"_touchMove"),touchend:t.proxy(o,"_touchEnd")}),c.call(o)},u._mouseDestroy=function(){var o=this;o.element.off({touchstart:t.proxy(o,"_touchStart"),touchmove:t.proxy(o,"_touchMove"),touchend:t.proxy(o,"_touchEnd")}),i.call(o)}}});
40195
40196/* ========================================
40197 FILE: /templates/js/template.js
40198 ==================== */
40199
40200var script_manage_params = typeof script_manage_params === 'object' ? script_manage_params : {};
40201
40202//	contact.html.php
40203if( typeof script_manage_params.contact_chkas !== 'undefined' && script_manage_params.contact_chkas == '1' ){
40204	function checkAntispam() {
40205		if (document.emailForm.cs_as_v.value!='' && !isNaN(document.emailForm.cs_as_v.value)) {
40206			return validate();
40207		} else {
40208			if ( typeof script_manage_params.as_nan !== 'undefined' ) {
40209				alert(script_manage_params.as_nan);
40210			}
40211
40212			document.emailForm.cs_as_v.trigger('focus');
40213			return false;
40214		}
40215	}
40216}
40217
40218//	shop.cart.php
40219if( typeof script_manage_params['shop.cart_h2'] !== 'undefined' && script_manage_params['shop.cart_h2'] == '1' ) {
40220	function shop_cart_quantity_input_onkeydown( event, form_obj ) {
40221		var ret_val = false;
40222		if ( event.keyCode == 13 ) {
40223			if (form_obj.getAttribute('onsubmit')!='') ret_val = form_obj.onsubmit();
40224
40225			//bonus system (nedovol pridat polozku ktora by prekrocila vysku nazbieraneho bonusu)
40226			// string 'Ym9udXM=' znamena 'bonus' len je zakodovany v base64
40227			if (Cookies.get('bonusShoppingMode') == 'Ym9udXM=' && jQuery('.bonus-system-cart-wrapper').length > 0) {
40228
40229				var cart_id             = jQuery(form_obj).find('input[name=idx]').val();
40230				var actualBonusAmount   = jQuery('.bonus-system-cart-wrapper .bonus-amount-lbl strong').html().split(' ')[0];
40231				var originalQty         = js_cart_items[cart_id].quantity;
40232				var actualQty           = jQuery(form_obj).find('input[name=quantity]').val();
40233
40234				if (actualBonusAmount < (actualQty - originalQty) * js_cart_items[cart_id].product_price) {
40235					vex.dialog.alert(js_lang_bonus_system_not_enough_credit);
40236					event.preventDefault();
40237					ret_val = false;
40238				}
40239			}
40240
40241			if (ret_val) form_obj.submit();
40242		}
40243		return ret_val;
40244	}
40245}
40246
40247//	shop.product_details, ps_product_attribute.php
40248if( typeof script_manage_params['shop.product_details_ps_pa'] !== 'undefined' && script_manage_params['shop.product_details_ps_pa'] == '1' ){
40249	function js_custom_attribute_submit_addtocart() {
40250		var isvalid = true;
40251		if (typeof script_manage_params.rr == 'object') {
40252			for (var i in script_manage_params.rr) {
40253				var ref_required1 = script_manage_params.rr[i];
40254					if ( (typeof document.getElementById('addtocart')[ref_required1] === 'undefined' || document.getElementById('addtocart')[ref_required1].value == "") && (document.getElementById(ref_required1 +'_field').value == "") ) {
40255						if ( isDesignTools()){
40256							jQuery('#'+ ref_required1 + '_field').parents('.product-custom-attribute:first').addClass('error');
40257						}else{
40258							document.getElementById(ref_required1 + '_label_div').style.color   = "red";
40259							document.getElementById(ref_required1 + '_field').style.borderColor = "red";
40260						}
40261						isvalid                                                             = false;
40262					} else {
40263						if ( isDesignTools()){
40264							jQuery('#'+ ref_required1 + '_field').parents('.product-custom-attribute:first').removeClass('error');
40265						} else {
40266							document.getElementById(ref_required1 + '_label_div').style.color   = "";
40267							document.getElementById(ref_required1 + '_field').style.borderColor = "";
40268						}
40269					}
40270			}
40271		}
40272		if (!isvalid && typeof script_manage_params.vml_wchffv !== 'undefined') {
40273			jQuery('#addtocart').addClass('custom_attribute_submit_error');
40274			if (isDesignTools()) {
40275				vex.dialog.alert({message: '', input: script_manage_params.vml_wchffv});
40276			} else {
40277				alert(script_manage_params.vml_wchffv);
40278			}
40279		}
40280		return isvalid;
40281	}
40282}
40283if (typeof script_manage_params.dcid !== 'undefined' && script_manage_params.dcid) {
40284	var displayed_category_id = script_manage_params.dcid;
40285}
40286//	shop.browse
40287if (typeof script_manage_params['shop.browse_desc_ord_by'] !== 'undefined' && script_manage_params['shop.browse_desc_ord_by'] == '1') {
40288	function js_DescOrderBy_click( DescOrderBy_value, elem ) {
40289		elem = jQuery(elem);
40290		if (elem.hasClass('orderby_price')) {
40291			Cookies.set('shop_browse_orderby_price_asc_desc', DescOrderBy_value, {path: '/'});
40292		} else {
40293			Cookies.remove('shop_browse_orderby_price_asc_desc', {path: '/'});
40294		}
40295
40296		document.order.DescOrderBy.value = DescOrderBy_value;
40297		document.order.submit();
40298	}
40299}
40300
40301if ( typeof script_manage_params['shop.browse_mf_filt_ch'] !== 'undefined' && script_manage_params['shop.browse_mf_filt_ch'] == '1' ) {
40302	function js_product_manufacturer_shop_browse_filter_changed( o ) {
40303		$o = jQuery(o);
40304		if ($o.parents('.module-param-filter:first').length) {
40305			js_pexf_load();
40306			return;
40307		}
40308		document.location.href = o.value;
40309
40310	}
40311}
40312
40313if ( typeof script_manage_params['shop.browse_globals'] !== 'undefined' && script_manage_params['shop.browse_globals'] == '1') {
40314
40315	var script_manage_params_vml = typeof script_manage_params.vml !== 'undefined' ? script_manage_params.vml : '';
40316	//var Fscript_manage_params_vml = typeof script_manage_params.vml !== 'undefined' ? script_manage_params.vml : '';
40317	js_global_live_site = typeof script_manage_params.ls !== 'undefined' ? script_manage_params.ls : '';
40318	js_global_VM_LANG_PEAR_LOG_INFO     = typeof script_manage_params_vml.pli !== 'undefined' ? script_manage_params_vml.pli : '';
40319	js_global_VM_LANG_PEAR_LOG_ERR      = typeof script_manage_params_vml.ple !== 'undefined' ? script_manage_params_vml.ple : '';
40320	js_global_VM_LANG_PEAR_LOG_WARNING  = typeof script_manage_params_vml.plw !== 'undefined' ? script_manage_params_vml.plw : '';
40321	js_global_VM_LANG_PHPSHOP_VALUES_UPDATED_SUCCESSFULLY = typeof script_manage_params_vml.pvus !== 'undefined' ? script_manage_params_vml.pvus : '';
40322	var tax_rates = [];
40323
40324	if ( typeof script_manage_params.tr === 'object' ){
40325		for(var i in script_manage_params.tr) {
40326			var tax_rate = script_manage_params.tr[i];
40327			tax_rates[tax_rate.tax_rate_id] = tax_rate.tax_rate;
40328		}
40329	}
40330}
40331
40332//	template.php, #418
40333if (typeof script_manage_params.lt !== 'undefined' && script_manage_params.lt != null) {
40334	var js_itemid               = typeof script_manage_params.lt.iid !== 'undefined' ? script_manage_params.lt.iid : '';
40335	var js_url                  = typeof script_manage_params.lt.u !== 'undefined' ? script_manage_params.lt.u : '';
40336	var js_server_request_uri   = typeof script_manage_params.lt.sru !== 'undefined' ? script_manage_params.lt.sru : '';
40337	if( typeof script_manage_params.lt.pid !== 'undefined' && script_manage_params.lt.pid > 0 ) var js_product_id = script_manage_params.lt.pid;
40338}
40339
40340//	template.php, #538
40341if ( typeof script_manage_params.gac !== 'undefined' && script_manage_params.gac != '') {
40342	var _gaq = _gaq || [];
40343	_gaq.push(['_setAccount', script_manage_params.gac]);
40344	_gaq.push(['_trackPageview']);
40345	(function() {
40346		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
40347		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
40348		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
40349	})();
40350}
40351
40352//	template.php, #974
40353if ( typeof script_manage_params.onr !== 'undefined' && script_manage_params.onr ) {
40354	// on ready
40355	if ( typeof js_Config_parser_enabled !== 'undefined' && js_Config_parser_enabled ) {
40356		jQuery(window).on('load', function () {
40357			js_add_class_to_last_module( jQuery('#subheader') );
40358			js_add_class_to_last_module( jQuery('#middle_top') );
40359			js_add_class_to_last_module( jQuery('#middle_bot') );
40360			js_add_class_to_last_module( jQuery('#footer_top') );
40361			js_add_class_to_last_module( jQuery('#pre_footer') );
40362		});
40363	} else {
40364		jQuery(function() {
40365			js_add_class_to_last_module( jQuery('#subheader') );
40366			js_add_class_to_last_module( jQuery('#middle_top') );
40367			js_add_class_to_last_module( jQuery('#middle_bot') );
40368			js_add_class_to_last_module( jQuery('#footer_top') );
40369			js_add_class_to_last_module( jQuery('#pre_footer') );
40370		});
40371	}
40372
40373	if( typeof script_manage_params.msl !== 'undefined' && script_manage_params.msl != '' ) {
40374		var sublvl_t = 0;
40375
40376		function sort_submenu(menu_rows, cell_width) {
40377			if(!(jQuery("#tab-menu-tools").length && Cookies.get('admin_view_design') == '0')) {
40378				jQuery(".mainlevel-nav>li>ul").each(function(){
40379					var new_menu_html="";
40380					var total_cells=jQuery(this).find("li").length;
40381					var menu_cols=Math.ceil(total_cells/menu_rows);
40382					var curr_cell=1;
40383
40384					//insert invisible li's to achieve vertical ordering
40385					for(curr_cell; curr_cell<=menu_rows; curr_cell++)
40386					{
40387						for(var i=0;
40387 i<menu_cols; i++)
40388						{
40389							var tmp_val=i*menu_rows+curr_cell;
40390							if(i==0 && tmp_val>total_cells)break;
40391							if(jQuery(this).find("li:nth-child("+tmp_val+")").length)
40392							{
40393								new_menu_html= new_menu_html+"<li>"+jQuery(this).find("li:nth-child("+tmp_val+")").html()+"</li>";
40394							}
40395							else new_menu_html= new_menu_html+"<li class=\"empty_li\"></li>";
40396						}
40397					}
40398					jQuery(this).html(new_menu_html).wrap('<span class="sublevel-span">');
40399
40400					//width for the whole ul
40401					jQuery(this).css({
40402							'overflow':'hidden',
40403							'width': (total_cells<=menu_rows) ? (cell_width+1)+'px' : Math.ceil(total_cells/menu_rows)*cell_width+'px'
40404					});
40405				});
40406			}
40407		}
40408	}
40409}
40410
40411jQuery(function() {
40412	if ( typeof js_Config_registration_company_skip_email_show_thank_you_vex !== 'undefined' && js_Config_registration_company_skip_email_show_thank_you_vex && typeof URLSearchParams !== 'undefined' ) {
40413		var urlParams = new URLSearchParams(window.location.search);
40414		if (urlParams.get('execFunction')) {
40415			var executeFunction = urlParams.get('execFunction');
40416			if (typeof window[executeFunction] === 'function') {
40417				window[executeFunction]();
40418			}
40419		}
40420	}
40421});
40422if (is_cs_user()) {
40423	function js_product_detail_quick_view(productSku) {
40424		if (typeof productSku !== 'undefined') {
40425			new AjaxRequest({'productSku' : productSku})
40426				.setController('Product')
40427				.setAction('quickViewProduct')
40428				.onSuccess(function(res){
40429					console.log(res.data.script);
40430					console.log(jQuery(res.data.script).html());
40431					if (typeof jQuery(res.data.script).html() != 'undefined') {
40432						eval(jQuery(res.data.script).html());
40433						console.log('eval');
40434					}
40435					vex.dialog.open({
40436						message: 'RÝCHLY NÁHĽAD PRODUKTU',
40437						input: res.data.html,
40438						className: 'vex-cs vex-product-quick-view',
40439						showCloseButton: false
40440					});
40441				})
40442				.send();
40443		}
40444	}
40445}
40446
40447/* ========================================
40448 FILE: /includes/js/shop/ps_product_attribute_prod_detail_avail_and_custom.js
40449 ==================== */
40450
40451if (typeof originalProductSkuValue === 'undefined') {
40452	var originalProductSkuValue = [];
40453}
40454
40455script_manage_params = typeof script_manage_params === 'object' ? script_manage_params : {};
40456var attributeChangeCustomParams = {
40457	'sil'                 : typeof script_manage_params.sil !== 'undefined' && (script_manage_params.sil == 'true' || script_manage_params.sil == true),
40458	'VM_PRODUCT_OLD_PRICE': typeof script_manage_params.VM_PRODUCT_OLD_PRICE !== 'undefined' ? script_manage_params.VM_PRODUCT_OLD_PRICE : ''
40459};
40460
40461window.addEventListener('DOMContentLoaded', function () {
40462	attribute_change_custom();
40463});
40464
40465function attribute_change_custom() {
40466	var price_by_product_attribute = typeof js_CS_Config_set_price_by_product_attribute !== 'undefined' && js_CS_Config_set_price_by_product_attribute;
40467
40468	if (!price_by_product_attribute || ( typeof js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED !== 'undefined' && js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED === 0 ) ) {
40469
40470		if (typeof js_custom_variant_init_script === 'undefined') {
40471			if (typeof js_Config_do_not_encode_attribute !== 'undefined' && js_Config_do_not_encode_attribute) {
40472				var hash = decodeURIComponent(window.location.hash.replace('#', ''));
40473			} else {
40474				var hash = encodeURIComponent(window.location.hash.replace('#', ''));
40475			}
40476
40477			if (hash === '') {
40478				let searchUrlParams = new URLSearchParams(window.location.search);
40479
40480				hash = searchUrlParams.get('var');
40481			}
40482
40483			if (hash !== null && hash != '') {
40484				var select  = jQuery('.prod_adv_attrib_select:first select:first');
40485				var options = select.find('option');
40486				var radio = false;
40487
40488				if (options.length == 0) {
40489					options = jQuery('.prod_adv_attrib_radio .shop_addtocart_advanced_attribute_buy input');
40490					radio   = true;
40491				}
40492				if (options.length > 0) {
40493					jQuery.each(options, function (index, option) {
40494						let $option = jQuery(option);
40495						var attributes = $option.val();
40496						if (attributes.includes('[')) {
40497							attributes = attributes.split('[')[0];
40498						}
40499						if (attributes.includes('{')) {
40500							attributes = attributes.split('{')[0];
40501						}
40502						attributes = attributes.split('-');
40503						if (attributes != '') {
40504							var key = '';
40505							jQuery.each(attributes, function (v_index, attribute) {
40506								if (attribute != '') {
40507									var attr;
40508									if (attribute.includes('[')) {
40509										attr = attribute.split(':')[1].split('[')[0];
40510									} else if (attribute.includes('{')) {
40511										attr = attribute.split(':')[1].split('{')[0];
40512									} else {
40513										attr = attribute.split(':')[1];
40514									}
40515									key += (key != '' ? '-' : '') + attr;
40516								}
40517							});
40518
40519							//key = key.toLowerCase();
40520
40521							key = key.normalize('NFD').replace(/[\u0300-\u036f]/g, "");
40522
40523							if (typeof js_Config_do_not_encode_attribute === 'undefined' || !js_Config_do_not_encode_attribute) {
40524								key = encodeURIComponent(key);
40525							}
40526
40527							if (key == hash || (hash.replace(/\+/g, '_').toLowerCase() === key.toLowerCase())) {
40528
40529								if ( typeof js_Config_product_attribute_settings !== 'undefined' ) {
40530									var template = js_Config_product_attribute_settings.template || '';
40531									var selector = js_Config_product_attribute_settings.selector || '';
40532									var activeAttrClass = js_Config_product_attribute_settings.activeAttrClass || '';
40533
40534									var $attributeBtn;
40535									var variants;
40536
40537									if (template === 'table') {
40538										$option.prop('selected', true);
40539										$option.parent().trigger('change');
40540
40541										if ( $option.val().indexOf('{D=3}') >= 0 ) {
40542											jQuery('body').addClass('flypage_variant_is_out_of_stock');
40543										} else {
40544											jQuery('body').removeClass('flypage_variant_is_out_of_stock');
40545										}
40546
40547										$attributeBtn = jQuery('.' + selector + '[value^="' + $option.val() + '"]');
40548
40549										if (!$attributeBtn.length) {
40550											let optionClasses = $option.attr('class').split(' ');
40551
40552											if (optionClasses.length) {
40553												optionClasses.forEach(function (optionClass) {
40554													$attributeBtn = jQuery('.' + selector + '.' + optionClass);
40555													if ($attributeBtn.length) {
40556														return false;
40557													}
40558												});
40559											}
40560										}
40561
40562										if ($attributeBtn.length) {
40563											$attributeBtn.trigger('click');
40564											$attributeBtn.closest('[class*="shop_addtocart_advanced_attribute_row_"]').addClass(activeAttrClass);
40565										}
40566
40567										js_set_shop_product_detail_avail_value_from_attrib_comb(select);
40568										customVariantSelectChange(select);
40569									} else if (template === 'links') {
40570										if ( selector !== '' && jQuery('.' + selector).length ) {
40571											var varId = encodeURIComponent($option.html().replace(': ', '__')).replace(/%/g, '--');
40572											$attributeBtn = jQuery('[id="' + varId + '"]');
40573
40574											if ($attributeBtn.length > 0) {
40575												$attributeBtn.trigger('click');
40576												// TODO - pridat aktivnu classu pre links template
40577												//$attributeBtn.closest('[class*="shop_addtocart_advanced_attribute_row_"]').addClass('active custom_active');
40578											}
40579										}
40580									} else if (template === 'radio') {
40581										if (radio) {
40582											$option.prop('checked', true);
40583											$option.trigger('click');
40584										} else {
40585											$option.prop('selected', true);
40586										}
40587									}
40588								} else if (jQuery('.attr_group_sel_div').length > 0) {
40589									var var_id = encodeURIComponent($option.html().replace(': ', '__')).replace(/%/g, '--');
40590									var $varId = jQuery('[id="' + var_id + '"]');
40591
40592									if ($varId.length > 0) {
40593										$varId.trigger('click');
40594									} else {
40595										if (radio) {
40596											$option.prop('checked', true);
40597											$option.trigger('click');
40598										} else {
40599											$option.prop('selected', true);
40600										}
40601									}
40602								} else {
40603									if (radio) {
40604										$option.prop('checked', true);
40605										$option.trigger('click');
40606									} else {
40607										$option.prop('selected', true);
40608
40609										$option.closest('select').trigger('change');
40610									}
40611								}
40612							} else {
40613								if (radio) {
40614									$option.prop('checked', false);
40615								} else {
40616									$option.prop('selected', false);
40617								}
40618							}
40619						}
40620					});
40621
40622				}
40623			} else {
40624				if ( typeof js_CS_Config_disable_defer_select_attribute === 'undefined' ) {
40625					if ( typeof js_CS_Config_lighthouse6_opt === 'undefined' ) {
40626						var refreshIntervalId = setInterval(function () {
40627							var select = jQuery('.prod_adv_attrib_select:first select:first');
40628							var radio  = jQuery('.prod_adv_attrib_radio .shop_addtocart_advanced_attribute_buy input:checked');
40629							//if ( is_cs_user() ) {
40630							if (typeof js_CS_Config_display_min_max_variant_price === 'undefined') {
40631								if (select.length > 0) {
40632									select.trigger('click').trigger('change');
40633									clearInterval(refreshIntervalId);
40634								}
40635								if (radio.length > 0) {
40636									radio.trigger('click').trigger('change');
40637									clearInterval(refreshIntervalId);
40638								}
40639							}
40640						}, 100);
40641					}
40642				}
40643			}
40644		}
40645	}
40646	// JAN Product last pieces : count quantity on page load
40647	if (typeof js_last_pieces_html_box == 'function') {
40648		js_last_pieces_html_box(0);
40649	}
40650	// !!! this function is defined for non_cs_user
40651	if (typeof js_template_flypage == 'function') {
40652		js_template_flypage();
40653	}
40654	// hook for cs_user and non_cs_user
40655	if (typeof js_template_flypage2 == 'function') {
40656		js_template_flypage2();
40657	}
40658}
40659
40660function js_set_shop_product_detail_avail_value_from_attrib_comb(select_element) {
40661	var doNotRunInBrowse = typeof js_CS_Config_run_script_only_in_product_detail !== 'undefined' && js_CS_Config_run_script_only_in_product_detail && jQuery('.flypage-top').length === 0;
40662
40663	if ((typeof js_config_set_shop_product_detail_avail_value_from_attrib_comb_disable != 'undefined' && js_config_set_shop_product_detail_avail_value_from_attrib_comb_disable > 0) || doNotRunInBrowse) {
40664		return false;
40665	}
40666
40667	select_element       = jQuery(select_element);
40668	var attrib_comb_name = '';
40669	var attrib_position  = '';
40670	var attrib_comb_id;
40671
40672	if (select_element.children('option').length != 0 || select_element.attr('type') == 'radio') {
40673		if (select_element.attr('type') == 'radio') {
40674			attrib_comb_id   = /attrib_comb_([0-9]+)(\s|$)/.exec(select_element.attr('class'));
40675			attrib_comb_name = select_element.val().match(/^(.+?)(\{|\[|$)/)[1];
40676		} else {
40677			attrib_comb_id   = /attrib_comb_([0-9]+)(\s|$)/.exec(select_element.children('option:selected').attr('class'));
40678			attrib_comb_name = select_element.children('option:selected').html();
40679
40680			var $showAttrButtons = jQuery('.show_attr_buttons');
40681			if ($showAttrButtons.find('span.flypage_attr_button').length > 0) {
40682				$showAttrButtons.find('span.flypage_attr_button').each(function (k, v) {
40683					if (jQuery(this).hasClass('active')) {
40684						attrib_position = k;
40685					}
40686				});
40687			}
40688			if (attrib_comb_id == null) {
40689				attrib_comb_id = /attr_id_([0-9]+)(\s|$)/.exec(select_element.children('option:selected').attr('id'));
40690			}
40691		}
40692	} else {
40693		attrib_comb_id   = /attrib_comb_([0-9]+)(\s|$)/.exec(select_element.attr('class'));
40694		attrib_comb_name = '';
40695		select_element.parents('tr:first').find('.shop_addtocart_advanced_attribute_name:first').children('span:first').each(function () {
40696			jQuery(this).children(':visible').each(function () {
40697				attrib_comb_name += jQuery(this).text();
40698			});
40699		});
40700	}
40701
40702	if ( typeof attrib_comb_name === 'undefined' ) {
40703		attrib_comb_name = '';
40704	}
40705
40706	// HOTFIX var product_avail_value_element = jQuery('.flypage1 .flypage-avail .shop_product_availability_value:first');
40707	var product_avail_value_element, product_in_stock_not_available_element, product_in_stock_available_from_element, product_in_stock_value_element, product_custom_text_element;
40708	if ( is_cs_user('kc-7949') && jQuery('.vex-product-quick-view .flypage1 .flypage-avail').length > 0 ) {
40709		var quickViewFlypage = jQuery('.vex-product-quick-view .flypage1');
40710
40711		product_avail_value_element             = quickViewFlypage.find('.flypage-avail:first .shop_product_availability_value');
40712		attrib_comb_name                        = attrib_comb_name.replace(/\([^\(*]*$/, '').replace(/\&nbsp;/g, ' ').replace(/_/g, ' ');
40713		product_in_stock_not_available_element  = quickViewFlypage.find('.flypage-avail:first .prod_in_stock_not_available');
40714		product_in_stock_available_from_element = quickViewFlypage.find('.flypage-avail:first .prod_in_stock_available_from');
40715		product_in_stock_value_element          = quickViewFlypage.find('.flypage-avail:first .prod_in_stock_info');
40716		product_custom_text_element             = quickViewFlypage.find('.flypage-avail:first .flypage-custom-text');
40717	} else if (jQuery('.flypage1 .flypage-avail').length > 0) {
40718		product_avail_value_element             = jQuery('.flypage1 .flypage-avail .shop_product_availability_value:first');
40719		attrib_comb_name                        = attrib_comb_name.replace(/\([^\(*]*$/, '').replace(/\&nbsp;/g, ' ').replace(/_/g, ' ');
40720		product_in_stock_not_available_element  = jQuery('#middle_content_inner .flypage-avail .prod_in_stock_not_available:first');
40721		product_in_stock_available_from_element = jQuery('#middle_content_inner .flypage-avail .prod_in_stock_available_from:first');
40722		product_in_stock_value_element          = jQuery('#middle_content_inner .flypage-avail .prod_in_stock_info:first');
40723		product_custom_text_element             = jQuery('#middle_content_inner .flypage-avail .flypage-custom-text:first');
40724	} else {
40725		product_avail_value_element             = jQuery('.flypage1 .shop_product_availability_value:first');
40726		attrib_comb_name                        = attrib_comb_name.replace(/\([^\(*]*$/, '').replace(/\&nbsp;/g, ' ').replace(/_/g, ' ');
40727		product_in_stock_not_available_element  = jQuery('#middle_content_inner .prod_in_stock_not_available:first');
40728		product_in_stock_available_from_element = jQuery('#middle_content_inner .prod_in_stock_available_from:first');
40729		product_in_stock_value_element          = jQuery('#middle_content_inner .prod_in_stock_info:first');
40730		product_custom_text_element             = jQuery('#middle_content_inner .flypage-custom-text:first');
40731	}
40732
40733	product_avail_value_element.show();
40734	product_avail_value_element.prev().show();
40735	product_in_stock_not_available_element.hide();
40736	product_in_stock_value_element.hide();
40737
40738	if (typeof js_CS_Config_vm_product_attributes_use_available_from === 'undefined') {
40739		product_in_stock_available_from_element.hide();
40740	}
40741
40742	if (product_custom_text_element.length != 0) {
40743		product_custom_text_element.hide();
40744	}
40745
40746	if (typeof (attrib_comb_id) !== 'undefined' && attrib_comb_id != null) {
40747		attrib_comb_id = parseInt(attrib_comb_id[1]);
40748		// gangstagroup fix pri vybere variantu to davalo hodnotu dostupnosti o jednu vyssiu
40749		// fix prebehol v ps_product_attribute.php:2810
40750		// ak by sa zle zobrazovali dostupnosti treba pozriet ci nieje toto navine
40751		// zmena classy attr_avail_xx
40752		if (typeof attrib_position !== 'undefined' && attrib_position !== '') {
40753			attrib_comb_id = parseInt(attrib_position);
40754		}
40755
40756		if ( typeof shop_product_details_avail_list !== 'undefined' ) {
40757			var newAvailId = shop_product_details_avail_list[attrib_comb_id];
40758		}
40759
40760		var availClass = product_avail_value_element.attr('class');
40761		if (typeof availClass !== 'undefined' && typeof newAvailId !== 'undefined' && newAvailId != '') {
40762			if (availClass.match(/attr_avail_[0-9]+/) == null) {
40763				newAvailClass = availClass + ' attr_avail_' + newAvailId;
40764			} else {
40765				newAvailClass = availClass.replace(/attr_avail_[0-9]+/, 'attr_avail_' + newAvailId);
40766			}
40767			product_avail_value_element.attr('class', newAvailClass).show();
40768		}
40769
40770		if (typeof (shop_product_details_avail_names_list) != 'undefined' && typeof (shop_product_details_avail_names_list[attrib_comb_id]) != 'undefined' && shop_product_details_avail_names_list[attrib_comb_id] != '') {
40771			var avail_name = shop_product_details_avail_names_list[attrib_comb_id];
40772
40773			if ( (typeof(js_CS_Config_prod_details_variant_change_avail_count_fix) !== 'undefined' && js_CS_Config_prod_details_variant_change_avail_count_fix == '1') ) { //variant_change_fix , pozriet related product moze robit problem
40774				if (jQuery('.flypage1 .flypage-avail').length > 0) {
40775					jQuery('.flypage1 .flypage-avail .shop_product_availability_value').attr('title',avail_name).html(avail_name);
40776				} else {
40777					jQuery('.flypage1 .shop_product_availability_value').not(jQuery('.flypage1').find('div.flypage-related').find('.shop_product_availability_value'));
40778				}
40779			} else {
40780				product_avail_value_element.attr('title', avail_name).html(avail_name);
40781			}
40782			jQuery('span.sw_shop_product_availability_value').remove();
40783			jQuery('span.sw_prod_availability_heading2').remove();
40784			if (typeof (sw_shop_product_details_avail_names_list) != 'undefined' && typeof (sw_shop_product_details_avail_names_list[attrib_comb_id]) != 'undefined' && sw_shop_product_details_avail_names_list[attrib_comb_id] != '') {
40785				if (typeof sw_shop_product_details_avail_id_list[attrib_comb_id] !== 'undefined') {
40786					sw_availClass = 'attr_avail_' + sw_shop_product_details_avail_id_list[attrib_comb_id];
40787				} else {
40788					sw_availClass = '';
40789				}
40790
40791				console.log(sw_availClass);
40792				product_avail_value_element.after('<span class="shop_product_availability_value sw_shop_product_availability_value ' + sw_availClass + '">' + sw_shop_product_details_avail_names_list[attrib_comb_id] + '</span>');
40793				product_avail_value_element.after('<span class="sw_prod_availability_heading2">' + js_lang_availability + ' ' + CS_Config_prod_info_from_switched_db_label + ': </sp
40793an>');
40794			}
40795			if (typeof setProductAvailabilityTime === 'function' && typeof shop_product_details_avail_names_list[attrib_comb_id] !== 'undefined') {
40796				need_days_variable = parseInt(shop_product_details_avail_days_list[attrib_comb_id]);
40797				setProductAvailabilityTime();
40798			}
40799		} else {  // default
40800
40801			// JAN poziadavka od TK ak mamedostupnost u variantoch a nic nie je zvolene nema sa zobrazovat dostupnost zakladna nastavena u produktu
40802			var variant_avails = (typeof shop_product_details_avail_names_list === 'object' && shop_product_details_avail_names_list.length);
40803
40804			if (!variant_avails && typeof (shop_product_details_avail) != 'undefined' && shop_product_details_avail != '') {
40805				product_avail_value_element.html(shop_product_details_avail);
40806			} else {
40807				product_avail_value_element.hide();
40808				product_avail_value_element.prev().hide();
40809			}
40810		}
40811
40812		var $prodInStockValue = jQuery('.flypage-avail .prod-in-stock .prod_in_stock_value');
40813		var prod_in_stock_value_selector;
40814		if (typeof js_product_in_stock_show_amount !== 'undefined' && js_product_in_stock_show_amount && $prodInStockValue.length > 0) {
40815			prod_in_stock_value_selector = $prodInStockValue;
40816		} else {
40817			$prodInStockValue = jQuery('.flypage1 .prod_in_stock_value');
40818			if ($prodInStockValue.length > 0 && product_in_stock_value_element.length == 0) {
40819				prod_in_stock_value_selector = $prodInStockValue;
40820			} else {
40821				prod_in_stock_value_selector = product_in_stock_value_element.children('.prod_in_stock_value');
40822			}
40823		}
40824
40825		if (typeof (shop_product_details_in_stock_list) != 'undefined' && typeof (shop_product_details_in_stock_list[attrib_comb_id]) != 'undefined') {
40826			var in_stock = parseInt(shop_product_details_in_stock_list[attrib_comb_id]);
40827			var text;
40828			if (in_stock > 0) {
40829				text = (typeof (js_prod_detail_stock_text_mode) != 'undefined' && js_prod_detail_stock_text_mode == '1') ? cms_js_lang_yes : in_stock;
40830				text = typeof (js_lang_prod_detail_in_stock_text_value) != 'undefined' && js_lang_prod_detail_in_stock_text_value != '' ? js_lang_prod_detail_in_stock_text_value : text;
40831				// palo
40832				if (isDesignTools()) {
40833					var ph_product_in_stock             = '';
40834					var ph_product_in_stock_lang_define = '0';
40835					if (in_stock == 1) {
40836						if (typeof (js_lang_product_in_stock_1) != 'undefined') {
40837							ph_product_in_stock = js_lang_product_in_stock_1;
40838						} else {
40839							ph_product_in_stock_lang_define = '1';
40840						}
40841					} else if (in_stock < 5) {
40842						if (typeof (js_lang_product_in_stock_2) != 'undefined') {
40843							ph_product_in_stock = js_lang_product_in_stock_2;
40844						} else {
40845							ph_product_in_stock_lang_define = '1';
40846						}
40847					} else {
40848						if (typeof (js_lang_product_in_stock_5) != 'undefined') {
40849							ph_product_in_stock = js_lang_product_in_stock_5;
40850						} else {
40851							ph_product_in_stock_lang_define = '1';
40852						}
40853					}
40854					if (ph_product_in_stock_lang_define == '0') {
40855						var phtext;
40856						if (typeof js_is_color_stock_pieces !== 'undefined' && js_is_color_stock_pieces) {
40857							phtext = '<span class="amount_val" style="color:red;">
40857' + text + ' </span><span class="amount_text"> ' + ph_product_in_stock + '</span>';
40858						} else {
40859							phtext = '<span class="amount_val">' + text + ' </span><span class="amount_text"> ' + ph_product_in_stock + '</span>';
40860						}
40861						prod_in_stock_value_selector.html(phtext);
40862					} else {
40863						prod_in_stock_value_selector.text(text);
40864					}
40865				} else {
40866					prod_in_stock_value_selector.text(text);
40867				}
40868
40869				// pridanie poctu kusov k dostupnosti
40870				if (typeof js_product_avail_with_stock !== 'undefined' && typeof newAvailId !== 'undefined' && jQuery.inArray(newAvailId, js_product_avail_with_stock) != -1) {
40871					jQuery('.flypage-avail span.shop_product_availability_value:first').append(' ' + in_stock + ' ' + ph_product_in_stock);
40872				}
40873
40874				product_in_stock_value_element.show();
40875			} else if (typeof js_Config_show_main_stock_instead_of_empty_variant_stock !== 'undefined' && js_Config_show_main_stock_instead_of_empty_variant_stock && isNaN(in_stock) && typeof product_main_stock !== 'undefined') {
40876				text = product_main_stock;
40877				prod_in_stock_value_selector.text(text);
40878			} else {
40879				text = (typeof (js_prod_detail_stock_text_mode) != 'undefined' && js_prod_detail_stock_text_mode == '1') ? cms_js_lang_no : '0';
40880				prod_in_stock_value_selector.text(text);
40881			}
40882
40883			var $swProdInStockInfo = jQuery('.sw_prod_in_stock_info');
40884
40885			if ($swProdInStockInfo.length) {
40886				$swProdInStockInfo.remove();
40887			}
40888
40889			if (typeof sw_product_in_stock != 'undefined' && sw_product_in_stock.length && typeof sw_product_in_stock[attrib_comb_id] != 'undefined') {
40890				if (sw_product_in_stock[attrib_comb_id] < 2) {
40891					amountText = js_lang_product_in_stock_1;
40892				} else if (sw_product_in_stock[attrib_comb_id] < 5) {
40893					amountText = js_lang_product_in_stock_2;
40894				} else {
40895					amountText = js_lang_product_in_stock_5;
40896				}
40897
40898				jQuery('.flypage-avail .prod_in_stock_info').after('<div class="sw_prod_in_stock_info"></div>');
40899				$swProdInStockInfo.html('<span class="prod_in_stock_info_lbl" style="font-weight:bold;">' + cms_js_lang_product_detail_in_stock_label + ' ' + CS_Config_prod_info_from_switched_db_label + ': </sp
40899an><span class="prod_in_stock_value"><span class="amount_val">' + sw_product_in_stock[attrib_comb_id] + ' </span><span class="amount_text"> ' + amountText + '</span><span class="attrib_name"> </span></span>');
40900			}
40901
40902			if (attributeChangeCustomParams.sil) {
40903				var $browseAvail = jQuery('.browse-avail');
40904				var jqo_stock_info_label = $browseAvail.find('.stock_info_label');
40905				if (jqo_stock_info_label.length < 1) {
40906					$browseAvail.append('<div class="stock_info_label"/>');
40907					jqo_stock_info_label = $browseAvail.find('.stock_info_label');
40908				}
40909
40910				if (in_stock > 0) {
40911					jqo_stock_info_label.text(js_global_PHPSHOP_PRODUCT_FORM_IN_STOCK).addClass('in_stock').removeClass('not_in_stock');
40912				} else {
40913					jqo_stock_info_label.text(js_global_PHPSHOP_PRODUCT_FORM_NOT_IN_STOCK).addClass('not_in_stock').removeClass('in_stock');
40914				}
40915			}
40916
40917			var js_cs_config_product_details_do_not_set_first_attrib_to_stock_label = typeof js_cs_config_product_details_do_not_set_first_attrib_to_stock_label !== 'undefined' ? js_cs_config_product_details_do_not_set_first_attrib_to_stock_label : false;
40918			var product_in_stock_value_text = cms_js_lang_product_detail_in_stock_label;
40919
40920			if (typeof CS_Config_prod_info_from_switched_db_curShopStockPostLabel !== 'undefined') {
40921				product_in_stock_value_text += ' ' + CS_Config_prod_info_from_switched_db_curShopStockPostLabel;
40922			}
40923
40924			product_in_stock_value_element.children('span:first').text(product_in_stock_value_text + ': ');
40925			if (attrib_comb_name != '' && !js_cs_config_product_details_do_not_set_first_attrib_to_stock_label) {
40926				if (typeof js_show_attrib_in_stock_info !== 'undefined' && js_show_attrib_in_stock_info) {
40927					var append = jQuery('.flypage-avail .prod_in_stock_info_lbl').text().replace(':', ' <span class="attrib_name"> (' + attrib_comb_name + ')</span>:');
40928					jQuery('.flypage-avail. prod_in_stock_info_lbl').html(append);
40929				} else {
40930					product_in_stock_value_element.children('.prod_in_stock_value').append('<span class="attrib_name"> (' + attrib_comb_name + ')</span>');
40931				}
40932			}
40933		}
40934
40935		if (product_custom_text_element.length != 0 && typeof (shop_product_details_custom_text) != 'undefined' && typeof (shop_product_details_custom_text[attrib_comb_id]) != 'undefined') {
40936			product_custom_text_element.html(shop_product_details_custom_text[attrib_comb_id]);
40937			product_custom_text_element.show();
40938		}
40939	} else {
40940		product_avail_value_element.hide();
40941		product_avail_value_element.prev().hide();
40942	}
40943
40944	// custom after load
40945	if (typeof js_set_shop_product_detail_avail_value_from_attrib_comb_after_init == 'function') {
40946		js_set_shop_product_detail_avail_value_from_attrib_comb_after_init(select_element);
40947	}
40948
40949	if (typeof js_custom_delivery_date == 'function') {
40950		js_custom_delivery_date(newAvailId);
40951	}
40952
40953	if (typeof js_CS_Config_product_lowest_price !== 'undefined') {
40954		let selected_elm = select_element.is('select') ? select_element.children('option:selected') : select_element;
40955		let lowest_price = selected_elm.data('lowest-price');
40956		let lowest_price_elm = jQuery('.lowest_price');
40957
40958		if (lowest_price && lowest_price_elm.length) {
40959			lowest_price_elm.find('.lp_val').html(lowest_price.val);
40960
40961			let lpDiscountPercent = ( lowest_price.perc > 0 ? '+' : '' ) + lowest_price.perc;
40962			lowest_price_elm.find('.lp_perc').html('(' + lpDiscountPercent + ' %)');
40963
40964			lowest_price_elm.show();
40965		} else if (selected_elm.val() !== '') {
40966			lowest_price_elm.hide();
40967		}
40968	}
40969
40970	var $productAvailability = jQuery('[name="product_availability"]');
40971	if ($productAvailability.length > 0) {
40972		var avail_text = jQuery('.flypage-avail .shop_product_availability_value').html();
40973		if (avail_text != '' && avail_text != null) {
40974			$productAvailability.val(avail_text);
40975		}
40976	}
40977}
40978
40979function customVariantSelectChange(select) {
40980	select = jQuery(select);
40981	var variantName = select.find(":selected").val().split('[')[0];
40982	var variantName = variantName.replace(/_/g, ' ');
40983
40984	if (typeof variantsCustomStocks !== 'undefined') {
40985		for (var key in variantsCustomStocks[variantName]) {
40986			customStockNumber = key.replace('S','stock');
40987
40988			var customStockValue = jQuery('.availability_custom_stocks .'+customStockNumber+' .custom_stock_value');
40989
40990			customStockValue.text(variantsCustomStocks[variantName][key]['text']);
40991			customStockValue.removeClass('available_in_custom_stock');
40992			customStockValue.removeClass('unavailable_in_custom_stock');
40993
40994
40995			if(variantsCustomStocks[variantName][key]['count'] > 0) {
40996				jQuery('.availability_custom_stocks .'+customStockNumber+' .custom_stock_value').addClass('available_in_custom_stock');
40997			} else {
40998				jQuery('.availability_custom_stocks .'+customStockNumber+' .custom_stock_value').addClass('unavailable_in_custom_stock');
40999			}
41000		}
41001	}
41002}
41003
41004function js_set_others_params(selectbox) {
41005	var $selectbox = jQuery(selectbox);
41006
41007	if ($selectbox.val() == null) {
41008		return false;
41009	}
41010
41011	if (typeof (set_actual_variant_main_image) != 'undefined' && set_actual_variant_main_image == '1') {
41012		js_set_actual_variant_main_image($selectbox);
41013	} // zobrazenie aktuia
41014
41015	// definovane v local.js
41016	if (typeof (js_custom_variant_change_function) == 'function') {
41017		js_custom_variant_change_function($selectbox);
41018	}
41019
41020	js_custom_credit_change_function($selectbox);	// zmena kreditu
41021	js_handle_variant_code_changed($selectbox);	//	zmena CODE
41022	js_handle_variant_old_price_changed($selectbox);	//	zmena beznej ceny
41023	js_save_price_changed($selectbox);// zmena usetrite v detaile produktu
41024	js_set_product_weight($selectbox);	// zmena vahy
41025	js_set_attribute_info_price_with_coupon_sale($selectbox);
41026	js_set_variant_ean_code($selectbox);
41027	updateAhojCalculatorPrice($selectbox.is('select') ? $selectbox.find('option:selected').val() : ''); //Update ceny ahoj kalkulacky
41028}
41029
41030function js_set_product_weight(selectbox) {
41031	const val = selectbox.val();
41032	const match = val.match(/\{W=([^\}]+)\}/);
41033	const $el = jQuery('.flypage1 .product_weight_value');
41034
41035	// ak regex nič nenašiel variant_weight bude prázdny string
41036	const variant_weight = match ? match[1] || '' : '';
41037	const value = !js_is_empty(variant_weight)
41038		? variant_weight
41039		: $el.data('weight-default');
41040
41041	$el.attr('data-weight-current', value).text(value);
41042}
41043
41044function js_set_attribute_info_price_with_coupon_sale(selectbox) {
41045	let attr = selectbox.val().replace(/_/gi, ' ').match(/^[^\[\{]+/);
41046
41047	if (!attr) {
41048		return;
41049	}
41050
41051	attr = attr[0];
41052
41053	if (!config('js_attribute_info_price_with_coupon_sale.'+attr+'.product_coupon_discount_price')) {
41054		return;
41055	}
41056
41057	jQuery('.coupon-notlogged-price-value').text(js_attribute_info_price_with_coupon_sale[attr]['product_coupon_discount_price']);
41058	jQuery('#coupon-notlogged-coupon-code').text(js_attribute_info_price_with_coupon_sale[attr]['coupon_code']);
41059}
41060
41061function js_set_variant_ean_code(selectbox) {
41062	const val = selectbox.val();
41063	const match = val.match(/EAN=(\d+)/);
41064	const $el = jQuery('.flypage1 .ean_value');
41065
41066	// ak regex nič nenašiel variant_ean bude prázdny string
41067	const variant_ean = match ? match[1] || '' : '';
41068	const value = !js_is_empty(variant_ean)
41069		? variant_ean
41070		: $el.data('ean-default');
41071
41072	$el.attr('data-ean-current', value).text(value);
41073}
41074
41075function js_save_price_changed(selectbox) {
41076	if (jQuery('body').hasClass('is_tmr_product')) {
41077		return;
41078	}
41079
41080	var $savePrice = jQuery('.flypage-cena .save_val');
41081	var savevalboth = $savePrice.hasClass('type_both');
41082	var save_val_element = '';
41083	var old_price_bdph = '';
41084	var old_price_sdph = '';
41085	var old_price = '';
41086	var $oldPrice = jQuery('.flypage-old-price .old-price');
41087	let isVariantPriceWithoutTax = typeof js_global_VM_PRODUCT_ATTRIB_PRICE_VALUES_WITH_TAX != 'undefined' && js_global_VM_PRODUCT_ATTRIB_PRICE_VALUES_WITH_TAX === '';
41088
41089	var $oldPriceWithoutTax = jQuery('.flypage-old-price .old-price-bdph');
41090	if ($oldPriceWithoutTax.length > 0) {
41091		old_price_bdph = $oldPriceWithoutTax.text();
41092	}
41093
41094	var $oldPriceWithTax = jQuery('.flypage-old-price .old-price-sdph');
41095	if ($oldPriceWithTax.length > 0) {
41096		old_price_sdph = $oldPriceWithTax.text();
41097	}
41098
41099	if ($oldPrice.length) {
41100		old_price = $oldPrice.text();
41101	} else {
41102		$oldPrice = jQuery('.flypage-prices .old-price');
41103		if ($oldPrice.length) {
41104			old_price = $oldPrice.text();
41105		}
41106	}
41107
41108	if ($savePrice.length) {
41109		save_val_element = '.flypage-cena .save_val';
41110	} else if (jQuery('.image_container .save_val').length) {
41111		save_val_element = '.image_container .save_val';
41112	} else if (jQuery('.flypage-image .flypage-saving-price').length) {
41113		save_val_element = '.flypage-image .flypage-saving-price';
41114	} else if ( jQuery('.flypage-right .flypage-saving-price .save_val').length ) {
41115		save_val_element = '.flypage-right .flypage-saving-price .save_val';
41116	} else if ( jQuery('.flypage-right .flypage-saving-price').length ) {
41117		save_val_element = '.flypage-right .flypage-saving-price';
41118	}
41119
41120	$savePrice = jQuery(save_val_element);
41121
41122	if (typeof (a) == 'undefined' || typeof js_old_price_values === 'undefined') {
41123		js_old_price_values = {
41124			save_val      : $savePrice.html(),
41125			old_price     : old_price,
41126			old_price_sdph: old_price_sdph,
41127			old_price_bdph: old_price_bdph
41128		};
41129	}
41130
41131	var $actionPriceWithoutTax = jQuery('.akcia-cena-bdph').first();
41132
41133	if (js_old_price_values.old_price_bdph != '' && $actionPriceWithoutTax.is(':visible') && $oldPriceWithTax.length > 0) {
41134		js_old_price_values.old_price = js_old_price_values.old_price_bdph;
41135		$oldPriceWithTax.show();
41136		$oldPriceWithoutTax.show();
41137	} else if (js_old_price_values.old_price_bdph != '' && $actionPriceWithoutTax.not(':visible') && $oldPriceWithTax.length > 0) {
41138		js_old_price_values.old_price = js_old_price_values.old_price_sdph;
41139		$oldPriceWithTax.show();
41140		$oldPriceWithoutTax.hide();
41141	}
41142
41143	// Variant ma beznu cenu
41144	var has_old_price   = selectbox.val().indexOf('{OP=') > -1;
41145
41146	// Niekedy toto nie je definovane (cookiebot?) a pouziva sa to vsade
41147	if ( typeof shop_currency_info === 'undefined' || typeof shop_currency_info[shop_vendor_currency_code] === 'undefined' ) return;
41148
41149	var current_curency = shop_currency_info[shop_vendor_currency_code];
41150
41151	// Aktualna cena
41152	variant_price = '';
41153	if (jQuery('.prod_adv_attrib_radio tr').hasClass('active')) {
41154		var variant_price_text = jQuery('.prod_adv_attrib_radio tr.active .shop_addtocart_advanced_attribute_price').clone().find('.attr_old_price').remove().end().text();
41155		variant_price = parseFloat(variant_price_text.replace(current_curency['1000_SYMBOL'], '').replace(current_curency.DEC_SYMBOL, '.').replace(/[^\d\.\,]+/g, ''));
41156	} else {
41157		if (js_old_price_values.old_price_bdph != '' && $actionPriceWithoutTax.is(':visible') && isVariantPriceWithoutTax) {
41158			variant_price = parseFloat($actionPriceWithoutTax.text().replace(current_curency['1000_SYMBOL'], '').replace(current_curency.DEC_SYMBOL, '.').replace(/[^\d\.\,]+/g, ''));
41159		} else {
41160			if (jQuery('.prod_adv_attribs_div .attr_group_sel_div').length > 0) {
41161				var s       = jQuery(selectbox).val();
41162				var regExp  = /\[=([^)]+)\]/;
41163				var matches = regExp.exec(s);
41164				if (matches != null && typeof matches[1] !== 'undefined' && matches[1] != '') {
41165					variant_price = matches[1];
41166
41167					if (isVariantPriceWithoutTax) {
41168						// ak ma shop nastavene ceny variantov bez dph
41169
41170						if ( typeof js_Config_fix_prices_for_variants != 'undefined' && js_Config_fix_prices_for_variants) {
41171							//cena získaná zo selectu nie je správna -> v prípade, že mena nesedí , preto cenu vždy predelíme currency
41172							//shop_vendor_currency_code -> to by mal byť kurz ktorý má zśakazník
41173
41174							var vendor_currency = 1;
41175
41176							if (typeof shop_currency_info[shop_vendor_currency_code] != 'undefined') {
41177								vendor_currency = shop_currency_info[shop_vendor_currency_code]['RATE'];
41178							}
41179
41180							variant_price = variant_price * js_product_tax_rate * (current_curency.RATE / vendor_currency);
41181						} else {
41182							variant_price = variant_price * js_product_tax_rate * current_curency.RATE;
41183						}
41184					}
41185
41186					//janB fix pre eshopist nenaťahovalo sa správne nastavenie cien pre iné
41187					if (typeof js_Config_fix_variant_price_not_default_currency != 'undefined' && js_Config_fix_variant_price_not_default_currency) {
41188						variant_price *= current_curency.RATE;
41189					}
41190
41191					variant_price_text = js_format_Money(variant_price, current_curency.DECIMALS, current_curency.SYMBOL, current_curency['1000_SYMBOL'], current_curency.DEC_SYMBOL);
41192				} else {
41193					variant_price = parseFloat(jQuery('#product-detail-price-value').text().replace(current_curency['1000_SYMBOL'], '').replace(current_curency.DEC_SYMBOL, '.').replace(/[^\d\.\,]+/g, ''));
41194				}
41195			} else {
41196				variant_price = parseFloat(jQuery('#product-detail-price-value').text().replace(current_curency['1000_SYMBOL'], '').replace(current_curency.DEC_SYMBOL, '.').replace(/[^\d\.\,]+/g, ''));
41197			}
41198		}
41199	}
41200
41201	if (!isNaN(variant_price) && config('js_dual_price_config')) {
41202		let dualPriceVal = Math.round(variant_price * js_dual_price_config.rate * 100) / 100;
41203		jQuery(selectbox).closest('div.vex').find('.dual-price-value').html(dualPriceVal + ' ' + js_dual_price_config.symbol);
41204	}
41205
41206	// Bezna cena
41207	var variant_old_price = selectbox.val() != '' && has_old_price ? parseFloat(selectbox.val().match(/\{OP\=([-+]?[0-9]*\.?[0-9]*)\}/)[1]) : (!js_is_empty(js_old_price_values.old_price) ? parseFloat(js_old_price_values.old_price.replace(current_curency['1000_SYMBOL'], '').replace(current_curency.DEC_SYMBOL, '.')) : '');	//	/\{OP\=([-+]?[0-9]*\.?[0-9]*)\}(\s|$)/
41208	// vyzera to tak, ze v OP su data tahane z db a tak nemaju . a , zamenenu
41209
41210	var variant_old_price_wo_vat = variant_old_price;
41211
41212	if (isVariantPriceWithoutTax && typeof js_product_tax_rate !== 'undefined' && has_old_price) {
41213		variant_old_price = variant_old_price * js_product_tax_rate * parseFloat(current_curency.RATE);
41214	}
41215
41216	if (isNaN(variant_old_price) && js_old_price_values.old_price != '' ){
41217		// pridane kvoli thestreets.sk lebo nemaju nastavenu old price na variantoch ale na produktoch
41218		variant_old_price = parseFloat(js_old_price_values.old_price.replace(current_curency['1000_SYMBOL'], '').replace(current_curency.DEC_SYMBOL, '.').replace(/[^\d\.\,]+/g, ''));
41219	}
41220
41221	if (isNaN(variant_old_price) && !jQuery('.prod_adv_attribs_div .attr_group_sel_div').length) {
41222		if ( jQuery('.flypage-old-price').length ) {
41223			var oldPriceWTaxEl  = jQuery('.flypage-old-price').find('.old-price-sdph');
41224			var oldPriceWoTaxEl = jQuery('.flypage-old-price').find('.old-price-bdph');
41225
41226			if (oldPriceWoTaxEl.length || oldPriceWTaxEl.length) {
41227				if (!isVariantPriceWithoutTax) {
41228					variant_old_price = parseFloat(oldPriceWTaxEl.text().replace(current_curency['1000_SYMBOL'], '').replace(current_curency.DEC_SYMBOL, '.'));
41229				} else {
41230					variant_old_price = parseFloat(oldPriceWoTaxEl.text().replace(current_curency['1000_SYMBOL'], '').replace(current_curency.DEC_SYMBOL, '.'));
41231				}
41232			} else {
41233				variant_old_price = parseFloat(jQuery('.flypage-old-price').text().replace(current_curency['1000_SYMBOL'], '').replace(current_curency.DEC_SYMBOL, '.').replace(/[^\d\.\,]+/g, ''));
41234			}
41235		}
41236	}
41237
41238	// zaokruhlenie na desatine miesta podla meny, kedze vznikaju ceny ako 11.750000000000039 co nieje 11.75
41239	// taktiez ak sme mali beznu cenu na viac desatinnych miest, porovnavalo sa to so zaokruhlenou cenou
41240	if (variant_old_price !== '') {
41241		variant_old_price = +(Math.round(variant_old_price + "e+" + current_curency.DECIMALS)  + "e-" + current_curency.DECIMALS);
41242	}
41243
41244	var showSavingPriceBothSeparately = typeof js_Config_show_saving_price_both_values_separately !== 'undefined';
41245
41246	var savePriceSumValue = jQuery('.saving_price_value');
41247	var savePricePercentValue = jQuery('.saving_price_percent');
41248
41249	var savingPriceValue = 0;
41250	var savingPricePercent = 0;
41251
41252	if (variant_old_price > variant_price) {
41253		savingPriceValue = variant_old_price - variant_price;
41254		savingPricePercent = savingPriceValue / variant_old_price * 100;
41255	}
41256
41257	if (savingPriceValue > 0) {
41258		if (has_old_price && variant_old_price > variant_price) {
41259			// variant ma vlastnu beznu cenu
41260			$oldPrice.html(js_format_Money(variant_old_price, current_curency.DECIMALS, current_curency.SYMBOL, current_curency['1000_SYMBOL'], current_curency.DEC_SYMBOL)
41260);
41261			if (!isVariantPriceWithoutTax) {
41262				$oldPriceWithTax.html(js_format_Money(variant_old_price, current_curency.DECIMALS, current_curency.SYMBOL, current_curency['1000_SYMBOL'], current_curency.DEC_SYMBOL));
41263			} else {
41264				$oldPriceWithoutTax.html(js_format_Money(variant_old_price_wo_vat, current_curency.DECIMALS, current_curency.SYMBOL, current_curency['1000_SYMBOL'], current_curency.DEC_SYMBOL));
41265			}
41266		}
41267
41268		$savePrice.show();
41269		jQuery('.flypage-old-price').show();
41270
41271		var mena, save_value, percentage;
41272
41273		if (savevalboth || showSavingPriceBothSeparately) {
41274			var save_html  = '';
41275
41276			mena = js_old_price_values.old_price.split(' ')[1];
41277
41278			if(!mena) {
41279				mena = current_curency.SYMBOL;
41280			}
41281
41282			save_value = savingPriceValue.toFixed(2).replace('.', ',');
41283			percentage = savingPricePercent.toFixed(0).replace('.', ',');
41284
41285			if (showSavingPriceBothSeparately && savePriceSumValue.length && savePricePercentValue.length) {
41286				savePriceSumValue.text(save_value + ' ' + mena).show();
41287				savePricePercentValue.text(percentage + ' %').show();
41288			} else {
41289				save_html += '<span class="save_val_sum">' + save_value + ' ' + mena + '</span>';
41290				save_html += '<span class="save_val_perc">' + percentage + ' %</span>';
41291				$savePrice.html(save_html);
41292			}
41293		} else {
41294			if (attributeChangeCustomParams.VM_PRODUCT_OLD_PRICE == '3') {
41295				save_value = js_format_Money(savingPriceValue, current_curency.DECIMALS, current_curency.SYMBOL, current_curency['1000_SYMBOL'], current_curency.DEC_SYMBOL);
41296				$savePrice.html('<span class="save_lbl">' + js_lang_saving_price_label + ':</span> <span class="save_val">' + save_value + '</span>');
41297			} else {
41298				// Usetrite percenta
41299				percentage = savingPricePercent.toFixed(0).replace('.', ',');
41300
41301				if (typeof (js_CS_Config_prod_detail_save_price_disp_old_variant) != 'undefined' && js_CS_Config_prod_detail_save_price_disp_old_variant) {
41302					var save_html_perc = '<span class="save_val">' + percentage + ' %</span>';
41303					$savePrice.html(save_html_perc);
41304				}else {
41305					if ($savePrice.hasClass('save_val')) {
41306						$savePrice.text(percentage + ' %');
41307					} else {
41308						var additionalContent = '';
41309						var contentElement = $savePrice.find('.save_cstm_string');
41310
41311						if (contentElement.length) {
41312							additionalContent = contentElement.prop('outerHTML');
41313						}
41314
41315						var save_html_perc = '<span class="save_val">' + percentage + ' %' + additionalContent + '</span>';
41316
41317						$savePrice.html(save_html_perc);
41318					}
41319				}
41320			}
41321		}
41322	} else {
41323		$savePrice.hide();
41324		jQuery('.flypage-old-price').hide();
41325
41326		if (showSavingPriceBothSeparately && savePriceSumValue.length && savePricePercentValue.length) {
41327			savePriceSumValue.hide();
41328			savePricePercentValue.hide();
41329		}
41330	}
41331
41332	if (variant_price_text != '') {
41333		jQuery('#product-detail-price-value').html(variant_price_text);
41334
41335		if (typeof TbNasplatkyButton !== 'undefined' && typeof variant_price !== 'undefined') {
41336			TbNasplatkyButton.update(parseFloat(variant_price));
41337		}
41338
41339		if (typeof variant_old_price != 'undefined' && variant_old_price) {
41340			var variant_old_price_text = js_format_Money(variant_old_price, current_curency.DECIMALS, current_curency.SYMBOL, current_curency['1000_SYMBOL'], current_curency.DEC_SYMBOL);
41341
41342			jQuery('.flypage-cena span.old-price-sdph').html(variant_old_price_text);
41343		}
41344	} else {
41345		jQuery('.flypage-saving-price, .flypage-old-price').html(jQuery('.prod_adv_attrib_radio tr.active .shop_addtocart_advanced_attribute_price').text().split(' ')[0].replace('.', '').replace(',', '.'));
41346	}
41347}
41348
41349function js_handle_variant_code_changed(jso) {
41350	if ((typeof js_attr_table_mod !== 'undefined' && js_attr_table_mod) || config('js_Config_hide_product_code_for_customers')) {
41351		return;
41352	}
41353
41354	if (typeof (js_handle_variant_code_changed_disabled) != 'undefined' && js_handle_variant_code_changed_disabled) {
41355		return false;
41356	}
41357
41358	// ak ma viariant nastavene zobrazovanie kodu produktu a aj kodu variantu
41359	if (jQuery('.flypage_variant_sku').length != 0) {
41360		return;
41361	}
41362	if (jQuery('.flypage_sku .product_sku_value_old').length == 0) {
41363		jQuery('.flypage_sku').append('<span class="product_sku_value_old hide">' + jQuery('.product_sku_value').text() + '</span>');
41364	}
41365	var jqo                   = jQuery(jso);
41366	var jqo_product_sku_value = jQuery('#middle .flypage1 .product_sku_value');
41367	originalProductSkuValue.push(jqo_product_sku_value);
41368	if (jqo_product_sku_value.length > 0) {
41369		if (jqo.data('orig_product_sku_value') == null) {
41370			jqo.data('orig_product_sku_value', jqo_product_sku_value.html());
41371		}
41372		var curr_val  = jqo.val();
41373		var curr_code = '';
41374		if (curr_val != '' && curr_val !== null) {
41375			var curr_code_matches = curr_val.match(/\{CODE\=([^\}]+)\}/);
41376			if (curr_code_matches != null) {
41377				curr_code = curr_code_matches[1];
41378			}
41379		}
41380		if (curr_code == '') {
41381			curr_code = jqo.data('orig_product_sku_value');
41382		}
41383		curr_code = curr_code.replace('_', ' ');
41384		jqo_product_sku_value.html(curr_code);
41385	}
41386}
41387
41388function js_handle_variant_old_price_changed(jso) {
41389	if (typeof (js_prod_attr_old_price) === 'undefined' || !js_prod_attr_old_price) {
41390		return;
41391	}
41392	var jqo                         = jQuery(jso);
41393	var jqo_product_old_price_value = jQuery('#middle .flypage1 .flypage-cena .old-price');
41394	if (jqo_product_old_price_value.length < 1) {
41395		jqo_product_old_price_value = jQuery('#middle .flypage1 .flypage-prices').find('.old-price');
41396	}
41397
41398	if (jqo_product_old_price_value.length > 0) {
41399		if (jqo.data('orig_product_old_price_value') == null) {
41400			jqo.data('orig_product_old_price_value', jqo_product_old_price_value.html());
41401		}
41402
41403		curr_code = jqo.data('orig_product_old_price_value');
41404
41405		if (typeof (js_op_list) != 'undefined' && js_op_list != null && typeof (js_list) != 'undefined' && js_list != null) {
41406			//	ak je to select ktory ma 1. polozku len vyberovu (prazdnu) a zaroven je vybrana ina ako tato vyberova (prazdna)
41407			//	vtedy musime odpocitavat poziciu
41408			var sel_opt_offset = jqo.children('option:first').val() == '' && jqo.get(0).selectedIndex > 0 ? 1 : 0;
41409			var current_curency = shop_currency_info[shop_vendor_currency_code];
41410
41411			var price1;
41412			if (typeof js_op_list[jqo.get(0).selectedIndex - sel_opt_offset] !== 'undefined') {
41413				price1 = parseFloat(js_op_list[jqo.get(0).selectedIndex - sel_opt_offset].replace(current_curency['1000_SYMBOL'], '').replace(current_curency.DEC_SYMBOL, '.'));
41414			} else {
41415				price1 = '';
41416			}
41417
41418			var price2;
41419			if (typeof js_list[jqo.get(0).selectedIndex - sel_opt_offset] !== 'undefined') {
41420				price2 = parseFloat(js_list[jqo.get(0).selectedIndex - sel_opt_offset].replace(current_curency['1000_SYMBOL'], '').replace(current_curency.DEC_SYMBOL, '.'));
41421			} else {
41422				price2 = '';
41423			}
41424
41425			if (jqo.get(0).selectedIndex <= js_op_list.length && js_op_list[jqo.get(0).selectedIndex - sel_opt_offset] != '' && jqo.get(0).selectedIndex <= js_list.length && js_list[jqo.get(0).selectedIndex - sel_opt_offset] != '' && price1 > price2) {
41426				//curr_code = jqo.get(0).selectedIndex-sel_opt_offset;
41427				curr_code = js_op_list[jqo.get(0).selectedIndex - sel_opt_offset];
41428				//curr_code = js_op_list[jqo.get(0).selectedIndex-sel_opt_offset].replace(current_curency['1000_SYMBOL'],'').replace(current_curency['DEC_SYMBOL'],'.');
41429			}
41430		}
41431
41432		if (curr_code == '') {
41433			curr_code = jqo.data('orig_product_old_price_value');
41434		}
41435
41436		jqo_product_old_price_value.html(curr_code);
41437	}
41438}
41439
41440function js_custom_credit_change_function(selectbox) {
41441	var $selectbox = jQuery(selectbox);
41442	if (typeof (js_global_product_credit_value) == 'undefined' || typeof (js_global_product_variants_credit_json) == 'undefined' || jQuery('.credit_val').length == 0) {
41443		return false;
41444	}
41445	var credit_value = js_global_product_credit_value;
41446	var credit_index = $selectbox.val().replace(/_/gi, ' ').match(/^[^\[\{]+/) || '';
41447// 	if (typeof(console) != 'undefined') console.log('credit_index', credit_index);
41448	if (credit_index != '' && typeof credit_index !== 'object' && typeof (js_global_product_variants_credit_json[credit_index]) && typeof (js_global_product_variants_credit_json[credit_index].credit_value) != 'undefined') {
41449		credit_value = js_global_product_variants_credit_json[credit_index].credit_value;
41450	}
41451	var credit_text = '';
41452	if (credit_value < 1 || credit_value > 4) {
41453		credit_text = js_global_PHPSHOP_PRODUCT_INCR_CREDIT_BY_PURCHASE_TEXT;
41454	}
41455	if (credit_value > 1 && credit_value < 5) {
41456		credit_text = js_global_PHPSHOP_PRODUCT_INCR_CREDIT_BY_PURCHASE_TEXT_5;
41457	}
41458	if (credit_value == '1') {
41459		credit_text = js_global_PHPSHOP_PRODUCT_INCR_CREDIT_BY_PURCHASE_TEXT_1;
41460	}
41461	if (credit_text == '') {
41462		if (typeof (console) != 'undefined') {
41463			console.log('ERR: credit_text');
41464		}
41465		return false;
41466	}
41467	jQuery('.product_credit_amount').html(credit_text.replace('%s', credit_value));
41468}
41469
41470function js_set_actual_variant_main_image(selectbox) {
41471	selectbox     = jQuery(selectbox);
41472	var img_index     = selectbox.find('option:selected').attr('id');
41473	var flypage_img_a = jQuery('.flypage-image a');
41474	var flypage_img   = jQuery('.flypage-image a img');
41475	if (selectbox.data('main_flypage_image_src') == null) {
41476		selectbox.data('main_flypage_image_src', flypage_img.attr('src'));
41477	}
41478	if (selectbox.data('main_flypage_a_href') == null) {
41479		selectbox.data('main_flypage_a_href', flypage_img.parents('a:first').attr('href'));
41480	}
41481	if (typeof (img_index) != 'undefined' && typeof (ref_array_imgs) != 'undefined' && typeof (ref_array_imgs[img_index]) != 'undefined' && ref_array_imgs[img_index] != '') {
41482		// isset variant image
41483		flypage_img_a.attr('href', js_global_skvelyweb_site + '/images/shop-active-images/' + ref_array_imgs[img_index]);
41484		if ( typeof js_Config_parser_enabled !== 'undefined' && js_Config_parser_enabled ) {
41485			flypage_img.attr('src', js_global_skvelyweb_site + '/images/shop-active-images/' + ref_array_imgs[img_index].replace('(', '%28').replace(')', '%29'));
41486		} else {
41487			flypage_img.attr('src', js_global_skvelyweb_site + '/images/shop-active-images/' + ref_array_imgs[img_index]);
41488		}
41489		main_image_href = main_image_thumb_href = js_global_skvelyweb_site + '/images/shop-active-images/' + ref_array_imgs[img_index];
41490		flypage_img_a.data({href: main_image_href, src: main_image_href});
41491		// fancybox option je potrebne zmenit, lebo je tam nastaveny povodny img produktu
41492		if (typeof flypage_img_a.attr('data-fancybox') !== 'undefined') {
41493			var data_options = {
41494				'thumb': main_image_href,
41495				'src'  : main_image_href,
41496				'type' : 'image'
41497			};
41498			flypage_img_a.attr('data-options', JSON.stringify(data_options));
41499			flypage_img_a.data().options = JSON.stringify(data_options);
41500		}
41501		if (typeof js_Config_parser_enabled !== 'undefined' && js_Config_parser_enabled) {
41502			if ( typeof flypage_img[0] !== 'undefined' && flypage_img[0].hasAttribute('data-srcset') ) {
41503				flypage_img.attr('data-srcset', js_global_skvelyweb_site + '/images/shop-active-images/' + ref_array_imgs[img_index].replace('%', '%25'));
41504				flypage_img.attr('srcset', js_global_skvelyweb_site + '/images/shop-active-images/' + ref_array_imgs[img_index].replace('%', '%25'));
41505				if ( (is_cs_user('js_opts') || is_cs_user('csu-parser')) ) {
41506					if ( jQuery('.product_activeimages_attr.' + img_index).length ) {
41507						var attrId = Number(img_index.match(/attr_id_([0-9])/)[1]) + 1;
41508						flypage_img.parent('a[data-fancybox^="gallery"]').attr('data-fancybox', 'gallery' + attrId);
41509					} else {
41510						flypage_img.parent('a[data-fancybox^="gallery"]').attr('data-fancybox', 'gallery');
41511					}
41512				}
41513			} else if ( typeof flypage_img[0] !== 'undefined' && flypage_img[0].hasAttribute('longdesc') ) {
41514
41515				flypage_img.attr('longdesc', js_global_skvelyweb_site + '/images/shop-active-images/' + ref_array_imgs[img_index]);
41516			}
41517		} else {
41518			if ( typeof flypage_img[0] !== 'undefined' && flypage_img[0].hasAttribute('data-srcset') ) {
41519				flypage_img.attr('data-srcset', js_global_skvelyweb_site + '/images/shop-active-images/' + ref_array_imgs[img_index]);
41520				flypage_img.attr('srcset', js_global_skvelyweb_site + '/images/shop-active-images/' + ref_array_imgs[img_index]);
41521			}
41522		}
41523	} else {
41524		// set the default product thumb image
41525		flypage_img_a.attr('href', selectbox.data('main_flypage_a_href'));
41526		flypage_img.attr('src', selectbox.data('main_flypage_image_src'));
41527
41528		// reset srcset and data-srcset if present
41529		if (flypage_img[0] && flypage_img[0].hasAttribute('data-srcset')) {
41530			flypage_img.attr('data-srcset', selectbox.data('main_flypage_image_src'));
41531			flypage_img.attr('srcset', selectbox.data('main_flypage_image_src'));
41532		}
41533
41534		// reset longdesc if present
41535		if (flypage_img[0] && flypage_img[0].hasAttribute('longdesc')) {
41536			flypage_img.attr('longdesc', selectbox.data('main_flypage_image_src'));
41537		}
41538
41539		// reset Fancybox data-options if present
41540		if (typeof flypage_img_a.attr('data-fancybox') !== 'undefined') {
41541			var data_options = {
41542				'thumb': selectbox.data('main_flypage_image_src'),
41543				'src'  : selectbox.data('main_flypage_image_src'),
41544				'type' : 'image'
41545			};
41546			flypage_img_a.attr('data-options', JSON.stringify(data_options));
41547			flypage_img_a.data().options = JSON.stringify(data_options);
41548		}
41549	}
41550}
41551
41552function js_set_variant_into_url(selectbox) {
41553	let $selectbox = jQuery(selectbox);
41554	let variant = decodeURIComponent($selectbox.val()).split('{')[0].split(':');
41555	let url = window.location.href;
41556
41557	if (typeof variant === 'undefined' || typeof variant[1] === 'undefined') {
41558		return false;
vendor: 13,934 bytes, lines 41559-41642
41559	}
41560
41561	// fix ak ma variant cenu
41562	if (variant[1]) {
41563		variant[1] = variant[1].split('[')[0];
41564	}
41565
41566	//hash predstavoval lovercase a ten nechceme
41567	if (url.indexOf('#') == -1) {
41568		history.replaceState({}, '', url + '#' + variant[1]);
41569	} else {
41570		history.replaceState({}, '', url.substring(0, url.indexOf('#')) + '#' + variant[1]);
41571	}
41572}
41573
41574function setVariantUrlParam(selectbox) {
41575	let $selectbox = jQuery(selectbox);
41576	let variant = decodeURIComponent($selectbox.val()).split('{')[0].split(':');
41577	let href = window.location.origin + window.location.pathname;
41578	let urlSearchParams = new URLSearchParams(window.location.search);
41579
41580	if (typeof variant === 'undefined' || typeof variant[1] === 'undefined') {
41581		return false;
41582	}
41583
41584	if (variant[1]) {
41585		variant[1] = variant[1].split('[')[0];
41586	}
41587
41588	urlSearchParams.set('var', variant[1]);
41589	history.replaceState({}, '', href + '?' + urlSearchParams.toString() + window.location.hash);
41590}
41591
41592function updateAhojCalculatorPrice(selectedValue) {
41593	if (!config('js_Config_ahoj_kalkulacka')) {
41594		return;
41595	}
41596
41597	const priceMatch = selectedValue.match(/\[=([^\]]+)]/);
41598	let variantPrice = priceMatch?.[1] ? parseFloat(priceMatch[1]) : 0;
41599
41600	const currency = shop_currency_info[shop_vendor_currency_code];
41601	const isPriceWithoutTax = typeof js_global_VM_PRODUCT_ATTRIB_PRICE_VALUES_WITH_TAX !== 'undefined'
41602		&& js_global_VM_PRODUCT_ATTRIB_PRICE_VALUES_WITH_TAX === '';
41603
41604	if (isPriceWithoutTax) {
41605		const vendorRate = shop_currency_info[shop_vendor_currency_code]?.RATE ?? 1;
41606		const rateMultiplier = config('js_Config_fix_prices_for_variants')
41607			? currency.RATE / vendorRate
41608			: currency.RATE;
41609
41610		variantPrice *= js_product_tax_rate * rateMultiplier;
41611	}
41612
41613	const calculateElem = jQuery('.ahojCalculateLink');
41614	const price = variantPrice.toFixed(currency.DECIMALS);
41615
41616	if (!calculateElem.length || !price) return;
41617
41618	calculateElem.attr('data-ahojparams', `suma=${price}`);
41619}
41620
41621
41622/* ========================================
41623 FILE: /includes/js/jquery/slick/slick.min.js
41624 ==================== */
41625
41626/*
41627     _ _      _       _
41628 ___| (_) ___| | __  (_)___
41629/ __| | |/ __| |/ /  | / __|
41630\__ \ | | (__|   < _ | \__ \
41631|___/_|_|\___|_|\_(_)/ |___/
41632                   |__/
41633
41634 Version: 1.6.0
41635  Author: Ken Wheeler
41636 Website: http://kenwheeler.github.io
41637    Docs: http://kenwheeler.github.io/slick
41638    Repo: http://github.com/kenwheeler/slick
41639  Issues: http://github.com/kenwheeler/slick/issues
41640
41641 */
41642!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};e=function(){function e(e,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(e),appendDots:i(e),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" data-role="none" role="button" tabindex="0" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(e),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(e).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,"undefined"!=typeof document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=t++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}var t=0;return e}(),e.prototype.activateADA=function(){var i=this;null!==i.$slideTrack&&i.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(0>t||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):o===!0?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),s.options.rtl===!0&&s.options.vertical===!1&&(e=-e),s.transformsEnabled===!1?s.options.vertical===!1?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):s.cssTransitions===!1?(s.options.rtl===!0&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),s.options.vertical===!1?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),s.options.vertical===!1?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this,o=t.getNavTarget();null!==o&&"object"==typeof o&&o.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};e.options.fade===!1?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(i.options.infinite===!1&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1===0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;e.options.arrows===!0&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),e.options.infinite!==!0&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(o.options.dots===!0&&o.slideCount>o.options.slidesToShow){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),(e.options.centerMode===!0||e.options.swipeToSlide===!0)&&(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.options.draggable===!0&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.options.rows>1){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;s>i;i++){var a=document.createElement("div");for(e=0;e<l.options.rows;e++){var d=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&d.appendChild(n.get(c))}a.appendChild(d)}o.appendChild(a)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,a=r.$slider.width(),d=window.innerWidth||i(window).width();if("window"===r.respondTo?n=d:"slider"===r.respondTo?n=a:"min"===r.respondTo&&(n=Math.min(d,a)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(r.originalSettings.mobileFirst===!1?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||l===!1||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!==0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var a=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(a),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t,o=this;if(e=o.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var s in e){if(i<e[s]){i=t;break}t=e[s]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),e.$slider.off("focus.slick blur.slick"),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide)),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.
41642slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),e.options.accessibility===!0&&e.$list.off("keydown.slick",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition),i(document).off("ready.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>1&&(i=e.$slides.children().children(),i.removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){var e=this;e.shouldClick===!1&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;t.cssTransitions===!1?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;e.cssTransitions===!1?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*:not(.slick-arrow)",function(t){t.stopImmediatePropagation();var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){var i=this;return i.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(i.options.infinite===!0)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(i.options.centerMode===!0)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s=this,n=0;return s.slideOffset=0,t=s.$slides.first().outerHeight(!0),s.options.infinite===!0?(s.slideCount>s.options.slidesToShow&&(s.slideOffset=s.slideWidth*s.options.slidesToShow*-1,n=t*s.options.slidesToShow*-1),s.slideCount%s.options.slidesToScroll!==0&&i+s.options.slidesToScroll>s.slideCount&&s.slideCount>s.options.slidesToShow&&(i>s.slideCount?(s.slideOffset=(s.options.slidesToShow-(i-s.slideCount))*s.slideWidth*-1,n=(s.options.slidesToShow-(i-s.slideCount))*t*-1):(s.slideOffset=s.slideCount%s.options.slidesToScroll*s.slideWidth*-1,n=s.slideCount%s.options.slidesToScroll*t*-1))):i+s.options.slidesToShow>s.slideCount&&(s.slideOffset=(i+s.options.slidesToShow-s.slideCount)*s.slideWidth,n=(i+s.options.slidesToShow-s.slideCount)*t),s.slideCount<=s.options.slidesToShow&&(s.slideOffset=0,n=0),s.options.centerMode===!0&&s.options.infinite===!0?s.slideOffset+=s.slideWidth*Math.floor(s.options.slidesToShow/2)-s.slideWidth:s.options.centerMode===!0&&(s.slideOffset=0,s.slideOffset+=s.slideWidth*Math.floor(s.options.slidesToShow/2)),e=s.options.vertical===!1?i*s.slideWidth*-1+s.slideOffset:i*t*-1+n,s.options.variableWidth===!0&&(o=s.slideCount<=s.options.slidesToShow||s.options.infinite===!1?s.$slideTrack.children(".slick-slide").eq(i):s.$slideTrack.children(".slick-slide").eq(i+s.options.slidesToShow),e=s.options.rtl===!0?o[0]?-1*(s.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,s.options.centerMode===!0&&(o=s.slideCount<=s.options.slidesToShow||s.options.infinite===!1?s.$slideTrack.children(".slick-slide").eq(i):s.$slideTrack.children(".slick-slide").eq(i+s.options.slidesToShow+1),e=s.options.rtl===!0?o[0]?-1*(s.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(s.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){var e=this;return e.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(e.options.infinite===!1?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);i>t;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o,s=this;return o=s.options.centerMode===!0?s.slideWidth*Math.floor(s.options.slidesToShow/2):0,s.options.swipeToSlide===!0?(s.$slideTrack.find(".slick-slide").each(function(e,n){return n.offsetLeft-o+i(n).outerWidth()/2>-1*s.swipeLeft?(t=n,!1):void 0}),e=Math.abs(i(t).attr("data-slick-index")-s.currentSlide)||1):s.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){var t=this;
41642t.changeSlide({data:{message:"index",index:parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),t.options.accessibility===!0&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this;null!==e.$slides&&e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$slideTrack&&e.$slideTrack.attr("role","listbox"),null!==e.$slides&&e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){i(this).attr({role:"option","aria-describedby":"slick-slide"+e.instanceUid+t})}),null!==e.$dots&&e.$dots.attr("role","tablist").find("li").each(function(t){i(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+e.instanceUid+t,id:"slick-slide"+e.instanceUid+t})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar"),e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide))},e.prototype.initDotEvents=function(){var e=this;e.options.dots===!0&&e.slideCount>e.options.slidesToShow&&i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),e.options.dots===!0&&e.options.pauseOnDotsHover===!0&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"}
vendor: 19,100 bytes, lines 41642-41643
41642,e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),e.options.accessibility===!0&&e.$list.on("keydown.slick",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(document).on("ready.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.initUI=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&e.options.accessibility===!0?e.changeSlide({data:{message:e.options.rtl===!0?"next":"previous"}}):39===i.keyCode&&e.options.accessibility===!0&&e.changeSlide({data:{message:e.options.rtl===!0?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=document.createElement("img");o.onload=function(){e.animate({opacity:0},100,function(){e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy").removeClass("slick-loading")}),r.$slider.trigger("lazyLoaded",[r,e,t])})},o.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),r.$slider.trigger("lazyLoadError",[r,e,t])},o.src=t})}var t,o,s,n,r=this;r.options.centerMode===!0?r.options.infinite===!0?(s=r.currentSlide+(r.options.slidesToShow/2+1),n=s+r.options.slidesToShow+2):(s=Math.max(0,r.currentSlide-(r.options.slidesToShow/2+1)),n=2+(r.options.slidesToShow/2+1)+r.currentSlide):(s=r.options.infinite?r.options.slidesToShow+r.currentSlide:r.currentSlide,n=Math.ceil(s+r.options.slidesToShow),r.options.fade===!0&&(s>0&&s--,n<=r.slideCount&&n++)),t=r.$slider.find(".slick-slide").slice(s,n),e(t),r.slideCount<=r.options.slidesToShow?(o=r.$slider.find(".slick-slide"),e(o)):r.currentSlide>=r.slideCount-r.options.slidesToShow?(o=r.$slider.find(".slick-cloned").slice(0,r.options.slidesToShow),e(o)):0===r.currentSlide&&(o=r.$slider.find(".slick-cloned").slice(-1*r.options.slidesToShow),e(o))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){var i=this;i.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(i){var e=this;e.unslicked||(e.$slider.trigger("afterChange",[e,i]),e.animating=!1,e.setPosition(),e.swipeLeft=null,e.options.autoplay&&e.autoPlay(),e.options.accessibility===!0&&e.initADA())},e.prototype.prev=e.prototype.slickPrev=function(){var i=this;i.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n=this,r=i("img[data-lazy]",n.$slider);r.length?(t=r.first(),o=t.attr("data-lazy"),s=document.createElement("img"),s.onload=function(){t.attr("src",o).removeAttr("data-lazy").removeClass("slick-loading"),n.options.adaptiveHeight===!0&&n.setPosition(),n.$slider.trigger("lazyLoaded",[n,t,o]),n.progressiveLazyLoad()},s.onerror=function(){3>e?setTimeout(function(){n.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,t,o]),n.progressiveLazyLoad())},s.src=o):n.$slider.trigger("allImagesLoaded",[n])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,t=n[e].breakpoint,n.hasOwnProperty(e)){for(;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;return"boolean"==typeof i?(e=i,i=e===!0?0:o.slideCount-1):i=e===!0?--i:i,o.slideCount<1||0>i||i>o.slideCount-1?!1:(o.unload(),t===!0?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,void o.reinit())},e.prototype.setCSS=function(i){var e,t,o=this,s={};o.options.rtl===!0&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,o.transformsEnabled===!1?o.$slideTrack.css(s):(s={},o.cssTransitions===!1?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;i.options.vertical===!1?i.options.centerMode===!0&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),i.options.centerMode===!0&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),i.options.vertical===!1&&i.options.variableWidth===!1?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):i.options.variableWidth===!0?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();i.options.variableWidth===!1&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,t.options.rtl===!0?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":"undefined"!=typeof arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),i.options.fade===!1?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=i.options.vertical===!0?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),(void 0!==e.WebkitTransition||void 0!==e.MozTransition||void 0!==e.msTransition)&&i.options.useCSS===!0&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&i.animType!==!1&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&i.animType!==!1},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),n.options.centerMode===!0?(e=Math.floor(n.options.slidesToShow/2),n.options.infinite===!0&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,
41643t.slice(o-e+1,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")):i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=n.options.infinite===!0?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false")),"ondemand"===n.options.lazyLoad&&n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(s.options.fade===!0&&(s.options.centerMode=!1),s.options.infinite===!0&&s.options.fade===!1&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=s.options.centerMode===!0?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;o>e;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));return s||(s=0),t.slideCount<=t.options.slidesToShow?(t.setSlideClasses(s),void t.asNavFor(s)):void t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,a=null,d=this;return e=e||!1,d.animating===!0&&d.options.waitForAnimate===!0||d.options.fade===!0&&d.currentSlide===i||d.slideCount<=d.options.slidesToShow?void 0:(e===!1&&d.asNavFor(i),o=i,a=d.getLeft(o),r=d.getLeft(d.currentSlide),d.currentLeft=null===d.swipeLeft?r:d.swipeLeft,d.options.infinite===!1&&d.options.centerMode===!1&&(0>i||i>d.getDotCount()*d.options.slidesToScroll)?void(d.options.fade===!1&&(o=d.currentSlide,t!==!0?d.animateSlide(r,function(){d.postSlide(o)}):d.postSlide(o))):d.options.infinite===!1&&d.options.centerMode===!0&&(0>i||i>d.slideCount-d.options.slidesToScroll)?void(d.options.fade===!1&&(o=d.currentSlide,t!==!0?d.animateSlide(r,function(){d.postSlide(o)}):d.postSlide(o))):(d.options.autoplay&&clearInterval(d.autoPlayTimer),s=0>o?d.slideCount%d.options.slidesToScroll!==0?d.slideCount-d.slideCount%d.options.slidesToScroll:d.slideCount+o:o>=d.slideCount?d.slideCount%d.options.slidesToScroll!==0?0:o-d.slideCount:o,d.animating=!0,d.$slider.trigger("beforeChange",[d,d.currentSlide,s]),n=d.currentSlide,d.currentSlide=s,d.setSlideClasses(d.currentSlide),d.options.asNavFor&&(l=d.getNavTarget(),l=l.slick("getSlick"),l.slideCount<=l.options.slidesToShow&&l.setSlideClasses(d.currentSlide)),d.updateDots(),d.updateArrows(),d.options.fade===!0?(t!==!0?(d.fadeSlideOut(n),d.fadeSlide(s,function(){d.postSlide(s)})):d.postSlide(s),void d.animateHeight()):void(t!==!0?d.animateSlide(a,function(){d.postSlide(s)}):d.postSlide(s))))},e.prototype.startLoad=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),o=Math.round(180*t/Math.PI),0>o&&(o=360-Math.abs(o)),45>=o&&o>=0?s.options.rtl===!1?"left":"right":360>=o&&o>=315?s.options.rtl===!1?"left":"right":o>=135&&225>=o?s.options.rtl===!1?"right":"left":s.options.verticalSwiping===!0?o>=35&&135>=o?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.interrupted=!1,o.shouldClick=o.touchObject.swipeLength>10?!1:!0,void 0===o.touchObject.curX)return!1;if(o.touchObject.edgeHit===!0&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(e.options.swipe===!1||"ontouchend"in document&&e.options.swipe===!1||e.options.draggable===!1&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,e.options.verticalSwiping===!0&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!r.dragging||n&&1!==n.length?!1:(e=r.getLeft(r.currentSlide),r.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,r.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,r.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(r.touchObject.curX-r.touchObject.startX,2))),r.options.verticalSwiping===!0&&(r.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(r.touchObject.curY-r.touchObject.startY,2)))),t=r.swipeDirection(),"vertical"!==t?(void 0!==i.originalEvent&&r.touchObject.swipeLength>4&&i.preventDefault(),s=(r.options.rtl===!1?1:-1)*(r.touchObject.curX>r.touchObject.startX?1:-1),r.options.verticalSwiping===!0&&(s=r.touchObject.curY>r.touchObject.startY?1:-1),o=r.touchObject.swipeLength,r.touchObject.edgeHit=!1,r.options.infinite===!1&&(0===r.currentSlide&&"right"===t||r.currentSlide>=r.getDotCount()&&"left"===t)&&(o=r.touchObject.swipeLength*r.options.edgeFriction,r.touchObject.edgeHit=!0),r.options.vertical===!1?r.swipeLeft=e+o*s:r.swipeLeft=e+o*(r.$list.height()/r.listWidth)*s,r.options.verticalSwiping===!0&&(r.swipeLeft=e+o*s),r.options.fade===!0||r.options.touchMove===!1?!1:r.animating===!0?(r.swipeLeft=null,!1):void r.setCSS(r.swipeLeft)):void 0)},e.prototype.swipeStart=function(i){var e,t=this;return t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow?(t.touchObject={},!1):(void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,void(t.dragging=!0))},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")}
41643,e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i,e=this;i=Math.floor(e.options.slidesToShow/2),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&!e.options.infinite&&(e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===e.currentSlide?(e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):e.currentSlide>=e.slideCount-e.options.slidesToShow&&e.options.centerMode===!1?(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):e.currentSlide>=e.slideCount-1&&e.options.centerMode===!0&&(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;r>i;i++)if("object"==typeof s||"undefined"==typeof s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),"undefined"!=typeof t)return t;return o}});
41644
41645/* ========================================
41646 FILE: /includes/js/jquery/slick/cs-slick.js
41647 ==================== */
41648
41649if ( typeof js_Config_reenable_plugins_for_pagespeed === 'undefined' && typeof js_CS_Config_lighthouse6_opt !== 'undefined' && js_CS_Config_lighthouse6_opt ) {
41650	jQuery.fn.slick = function() {};
41651}
41652
41653/* ========================================
41654 FILE: /modules/js/mod_shop_search.js
41655 ==================== */
41656
41657var script_manage_params = typeof script_manage_params === 'object' ? script_manage_params : {};
41658var script_manage_params_ssfv = typeof script_manage_params.ssfv !== 'undefined' ? script_manage_params.ssfv : '';
41659var script_manage_params_dst = typeof script_manage_params.dst !== 'undefined' ? script_manage_params.dst : '';
41660var script_manage_params_vlpim3 = typeof script_manage_params.vlpim3 !== 'undefined' ? script_manage_params.vlpim3 : '';
41661var script_manage_params_vlpim3cr = typeof script_manage_params.vlpim3cr !== 'undefined' ? script_manage_params.vlpim3cr : '';
41662var script_manage_params_sm = typeof script_manage_params.sm !== 'undefined' ? script_manage_params.sm : '';
41663var script_manage_params_fau = typeof script_manage_params.fau !== 'undefined' ? script_manage_params.fau : '';
41664var script_manage_params_aacwpi = typeof script_manage_params.aacwpi !== 'undefined' ? script_manage_params.aacwpi : '';
41665var script_manage_params_ls = typeof script_manage_params.ls !== 'undefined' ? script_manage_params.ls : '';
41666var script_manage_params_csq = typeof script_manage_params.csq !== 'undefined' ? script_manage_params.csq : '';
41667
41668window.currentRequest = null;
41669if ( !is_cs_user('separate_js') ) {
41670	jQuery('#shop_search_field').on('focusout', function(event) {
41671
41672		if(event.relatedTarget == null || (event.relatedTarget.id != 'show_more_found_cats' && event.relatedTarget.id != 'show_more_found_comps')) {
41673			setTimeout(function() {
41674				jQuery('.autocompleter_with_cats_and_companies_div').hide();
41675			},250);
41676		}
41677	});
41678}
41679
41680function js_default_search_title(js_action) {
41681	var shop_search_field = document.getElementById('shop_search_field');
41682	var shop_search_field_prop = document.getElementById('keyword_props') || null;
41683	var sendAlsoShopSearchFieldProp = (shop_search_field_prop && shop_search_field_prop.value != '') ? shop_search_field_prop.value + '/' : '';
41684
41685	switch ( js_action ) {
41686		case 'blur':
41687			if ( shop_search_field.value == '' && !isDesignTools() ) {
41688// 				shop_search_field.style.color = script_manage_params_cd;
41689				shop_search_field.value=script_manage_params_ssfv;
41690			}
41691			break;
41692
41693		case 'focus':
41694			if ( shop_search_field.value == script_manage_params_ssfv ) {
41695// 				shop_search_field.style.color = script_manage_params_ct;
41696				if (shop_search_field.value == script_manage_params_dst)
41697					shop_search_field.value = '';
41698			}
41699			break;
41700
41701		case 'submit':
41702
41703			var $searchField = jQuery('#shop_search_field');
41704			ssf_val = $searchField.val();
41705			$searchField.val(ssf_val);
41706			ssf_val = encodeURIComponent(ssf_val);
41707			var default_val = encodeURIComponent($searchField[0].defaultValue);
41708
41709			if ( shop_search_field.value == script_manage_params_dst ) {
41710// 				shop_search_field.style.color = script_manage_params_ct;
41711				jQuery(shop_search_field).trigger('focus');
41712				//shop_search_field.trigger('focus');
41713				return false;
41714			}
41715			if ( isDesignTools() && shop_search_field.value.length == 0 ) {
41716				jQuery(shop_search_field).trigger('focus');
41717				//shop_search_field.trigger('focus');
41718				return false;
41719			}
41720			if (shop_search_field.value.length < (typeof script_manage_params_vlpim3 !== 'undefined' ? script_manage_params_vlpim3 : 3 ) ) {
41721				alert(script_manage_params_vlpim3cr);
41722				return false;
41723			}
41724			if ( (script_manage_params_sm == '1' ? '1' : '0') && shop_search_field.value!='') {
41725				var jqo_form = jQuery(shop_search_field).parents('form:first');
41726				if (jqo_form.find('input[type="hidden"][name="search_tree_category_id"]').length > 0) {
41727					Cookies.set('search_tree_category_id', jqo_form.find('input[type="hidden"][name="search_tree_category_id"]').val(), { path: '/' });
41728				}
41729				// Dušan bol ostraneny replace(/\//g, ' ') na ziadost sakyho
41730				var search = js_vm_search_encodeURIchars(shop_search_field.value.replace(/ {2}/g, ' '));
41731
41732				if (typeof script_manage_params_csq !== 'undefined' && script_manage_params_csq != '') {
41733					document.location.href = script_manage_params_fau + '?' + script_manage_params_csq + '=' + js_vm_search_encodeURIchars(search);
41734				} else {
41735					document.location.href = script_manage_params_fau + js_vm_search_encodeURIchars(search) + '/' + sendAlsoShopSearchFieldProp;
41736				}
41737
41738				return false;
41739			}
41740			return true;
41741	}
41742}
41743
41744if ( typeof script_manage_params_aacwpi !== 'undefined' && script_manage_params_aacwpi != '') {
41745
41746	function js_mod_vm_search_ajax_search_ini() {
41747		let options = {};
41748		if (typeof modularSystem !== 'undefined') {
41749			options = modularSystem.getSetting('modules.search', null, {});
41750		}
41751
41752		if ( typeof script_manage_params_aacwpi.ow !== 'undefined' ) {
41753			options.width = script_manage_params_aacwpi.ow;
41754		}
41755		if ( typeof script_manage_params_aacwpi.om !== 'undefined' ) {
41756			options.max = script_manage_params_aacwpi.om;
41757		}
41758		if ( typeof script_manage_params_aacwpi.olipcc !== 'undefined' ) {
41759			options.listItemPostCreateCallback = script_manage_params_aacwpi.olipcc;
41760		}
41761		if ( typeof script_manage_params_aacwpi.os !== 'undefined' ) {
41762			options.scroll = script_manage_params_aacwpi.os.toLowerCase() === 'true';
41763		}
41764		if ( typeof script_manage_params_aacwpi.ahtrd !== 'undefined' ) {
41765			options.appendHtmlToResultsDiv = script_manage_params_aacwpi.ahtrd;
41766		}
41767		if ( typeof script_manage_params_aacwpi.loff !== 'undefined' ) {
41768			options.leftOffset = script_manage_params_aacwpi.loff;
41769		}
41770		if ( typeof script_manage_params_aacwpi.toff !== 'undefined' ) {
41771			options.topOffset = script_manage_params_aacwpi.toff;
41772		}
41773		if ( typeof script_manage_params_aacwpi.minChars !== 'undefined' ) {
41774			options.minChars = script_manage_params_aacwpi.minChars;
41775		}
41776		if ( typeof script_manage_params_aacwpi.uacl !== 'undefined' ) {
41777			options.acLimit = script_manage_params_aacwpi.uacl;
41778		}
41779		if ( typeof script_manage_params_aacwpi.ofwrd !== 'undefined' ) {
41780			options.onlyFirstWord = script_manage_params_aacwpi.ofwrd;
41781		}
41782
41783		// skripty extrahuj: ld+json vloz do DOM, ostatne vykonaj
41784		options.formatItem = function(row, i, n) {
41785			var value = row[0];
41786
41787			value = value.replace(/<script([^>]*)>([\s\S]*?)<\/script>/gi, function(match, attrs, scriptContent) {
41788				if (attrs.indexOf('application/ld+json') > -1) {
41789					var resultBox = jQuery('.ac_results');
41790					resultBox.find('script[type="application/ld+json"]').remove();
41791					resultBox.append(match);
41792				} else {
41793					try { new Function(scriptContent)(); } catch(e) {}
41794				}
41795				return '';
41796			});
41797
41798			return value.trim() !== '' ? value : false;
41799		};
41800
41801		options.resultsClass = "ac_main ac_results";
41802
41803		var $searchField = jQuery('input#shop_search_field[name="keyword"]');
41804		if ( typeof js_Config_parser_enabled === 'undefined' ) {
41805			$searchField.autocomplete();
41806			if ( is_cs_user('separate_js') ) {
41807				jQuery(document).on('click', function(event) {
41808					jQuery('.ac_results').hide();
41809					jQuery('.autocompleter_with_cats_and_companies_div').hide();
41810				}).on('click', '.ac_results, .moduletable-search, .autocompleter_with_cats_and_companies_div', function(event) {
41811					event.stopPropagation();
41812				});
41813			}
41814		}
41815
41816		if (typeof script_manage_params_aacwpi.cats_and_companies !== 'undefined' ) {
41817			jQuery('input#shop_search_field').on('keyup', function(event) {
41818
41819				if(window.currentRequest !== null &&  window.currentRequest.readyState != 4) {
41820					window.currentRequest.abort();
41821					window.currentRequest = null;
41822				}
41823
41824				if ( !(typeof js_Config_ajax_search_allow_moving_with_arrows !== 'undefined' && js_Config_ajax_search_allow_moving_with_arrows) ) {
41825					var keyCode = event.keyCode;
41826					if (keyCode == '37' || keyCode == '38' || keyCode == '39' || keyCode == '40') { //sipky
41827						return;
41828					}
41829				}
41830
41831				event.preventDefault();
41832
41833				if ( typeof js_Config_ajax_search_allow_moving_with_arrows !== 'undefined' && js_Config_ajax_search_allow_moving_with_arrows ) {
41834					var isArrow = event.keyCode;
41835					if (isArrow == '37' || isArrow == '38' || isArrow == '39' || isArrow == '40') { //sipky
41836						return;
41837					}
41838				}
41839
41840
41841				var elem = jQuery(this);
41842				var acq = jQuery(this).val();
41843
41844
41845				if(acq.length > 2) {
41846					window.currentRequest = jQuery.ajax({
41847						type: 'POST',
41848						data: 'acq=' + acq,
41849						url: '/modules/ajax/mod_shop_search_ajax.php?ajax_call=1&ajax_func=get_autocompleter_with_cats_and_companies',
41850						beforeSend : function(request) {
41851							if(window.currentRequest != null &&  window.currentRequest.readyState != 4) {
41852								window.currentRequest.abort();
41853							} else {
41854								var resdiv = jQuery('div.autocompleter_with_cats_and_companies_div');
41855								if (resdiv.length){
41856									resdiv.html('<div class="ac_loader"><span class="featureprod_ajax_loader"></span></div>').show();
41857								} else {
41858									elem.after('<div class="autocompleter_with_cats_and_companies_div"><div class="ac_loader"><span class="featureprod_ajax_loader"></span></div></div>');
41859									jQuery('div.autocompleter_with_cats_and_companies_div').show();
41860								}
41861							}
41862						}
41863					}).done(function(result) {
41864						var resdiv = jQuery('div.autocompleter_with_cats_and_companies_div');
41865
41866						resdiv.remove();
41867						elem.after(result);
41868						resdiv.hide();
41869						resdiv.show();
41870
41871						jQuery('div.autocompleter_with_cats_and_companies_div').on('click', '.ajaxFinder_products_li a', function() {
41872							var li = jQuery(this).closest('li');
41873							var itemId = li.data('item-id');
41874							var itemName = li.data('item-name');
41875							if (itemId) {
41876								window.dispatchEvent(new CustomEvent('cs:autocomplete:select_item', {detail: {items: [{item_id: itemId, item_name: itemName}]}}));
41877							}
41878						});
41879
41880						if ( typeof(js_after_init_search_autocompleter) !== 'undefined'){ js_after_init_search_autocompleter(); }
41881						if (typeof(js_mod_vm_search_ajax_search_after_ini) !== 'undefined') {
41882							js_mod_vm_search_ajax_search_after_ini();
41883						}
41884					});
41885
41886				} else {
41887					jQuery('div.autocompleter_with_cats_and_companies_div').remove();
41888				}
41889			});
41890		} else {
41891			if ( typeof js_Config_parser_enabled !== 'undefined' && js_Config_parser_enabled ) {
41892				var minLength;
41893
41894				if ( typeof script_manage_params_aacwpi.minChars !== 'undefined' ) {
41895					minLength = script_manage_params_aacwpi.minChars; // TODO: premenovat parametre
41896				}
41897
41898				if ( typeof jQuery.ui === 'undefined' ) { return; }
41899
41900				var auto_class = {};
41901				if ($searchField.is('#shop_search_field')) {
41902					if ( is_cs_user('separate_js') ) {
41903						auto_class = {'ui-autocomplete': 'ac_main'};
41904					} else {
41905						auto_class = {'ui-autocomplete': 'ac_header'};
41906					}
41907				}
41908
41909				let modularOptions = {};
41910				if (typeof modularSystem !== 'undefined') {
41911					modularOptions = modularSystem.getSetting('modules.search', null, {});
41912				}
41913				
41914				var csoptions = jQuery.extend(true, {}, modularOptions);
41915
41916				if (typeof csoptions.minLength === 'undefined') {
41917					csoptions.minLength = typeof options.minChars !== 'undefined' ? options.minChars : 1;
41918				}
41919				if (typeof csoptions.html === 'undefined') {
41920					csoptions.html = true;
41921				}
41922				if (typeof csoptions.classes === 'undefined') {
41923					csoptions.classes = auto_class;
41924				}
41925				csoptions.source = function (request, response) {
41926					var searchTerm = '&acq=' + encodeURIComponent(request.term);
41927					var searchLimit = typeof script_manage_params_aacwpi.uacl !== 'undefined' && script_manage_params_aacwpi != '' ? '&aclimit=' + script_manage_params_aacwpi.uacl : '';
41928					var getParams   = window.location.search.replace('?', '&');
41929					var url         = script_manage_params_ls + '/modules/ajax/mod_shop_search_ajax.php?ajax_call=1&ajax_func=get_autocompleter_with_img_list' + searchTerm + searchLimit + getParams;
41930					jQuery.get(url, function (res) {
41931						var parsedJson = csJsonParse(res);
41932						if (parsedJson === null) {
41933							response([cms_js_iterate_notfound]);
41934							return;
41935						}
41936						if (parsedJson.length > 0 && parsedJson[0]._ac_analytics !== undefined) {
41937							var analyticsHtml = parsedJson[0]._ac_analytics;
41938							parsedJson = parsedJson.slice(1);
41939							if (analyticsHtml) {
41940								var acAnalyticsDiv = document.createElement('div');
41941								acAnalyticsDiv.innerHTML = analyticsHtml;
41942								acAnalyticsDiv.querySelectorAll('script').forEach(function(s) {
41943									var script = document.createElement('script');
41944									script.text = s.textContent || s.innerText || '';
41945									document.head.appendChild(script);
41946									document.head.removeChild(script);
41947								});
41948							}
41949						}
41950						response(parsedJson);
41951						jQuery('.ui-menu-item:odd').addClass('ac_odd');
41952						jQuery('.ui-menu-item:even').addClass('ac_even');
41953						jQuery('.ui-menu-item')
41954							.on('mouseover', function () {
41955								jQuery(this).addClass('ac_over');
41956								jQuery(this).find('.ui-menu-item-wrapper');
41957							})
41958							.on('mouseleave', function () {
41959								jQuery(this).removeClass('ac_over');
41960							});
41961					});
41962				};
41963				csoptions.select = function (event, ui) {
41964					event.preventDefault();
41965					if (ui.item._ac_item_id) {
41966						window.dispatchEvent(new CustomEvent('cs:autocomplete:select_item', {detail: {items: [{item_id: ui.item._ac_item_id, item_name: ui.item._ac_item_name}]}}));
41967					}
41968					if (typeof ui.item.value !== 'undefined' && ui.item.value.indexOf('http') > -1) {
41969						location.href = ui.item.value;
41970					}
41971				};
41972				csoptions.focus = function(event, ui) {
41973					event.preventDefault();
41974
41975					var $focusedElem = jQuery('.ui-state-active').parent();
41976					if ( $focusedElem.length ) {
41977						jQuery('.ui-menu-item').removeClass('ac_over');
41978						$focusedElem.addClass('ac_over');
41979					}
41980				};
41981
41982				$searchField.csautocomplete(csoptions).off('blur');
41983			} else {
41984				$searchField.autocomplete(script_manage_params_ls + '/modules/ajax/mod_shop_search_ajax.php?ajax_call=1&ajax_func=get_autocompleter_with_img_list' + (typeof script_manage_params_aacwpi.uacl !== 'undefined' && script_manage_params_aacwpi != '' ? '&aclimit=' + script_manage_params_aacwpi.uacl : ''), options);
41985			}
41986		}
41987		if (typeof $searchField.result === 'function') {
41988			$searchField.result(function (event, data, formatted) {
41989				if (data && data[1] && data[2]) {
41990					$searchField.val(data[1]);
41991					jQuery('#ac_res_product_name').val(data[1]);
41992					jQuery('#ac_res_product_id').val(data[2]);
41993					// click on product -> go to product detail page
41994					if (formatted.indexOf('acwil_url') > -1) {
41995						var url = jQuery('<div/>').html(formatted).find('.acwil_url').text();
41996						if (!js_is_empty(url)) {
41997							window.location.href = url;
41998							return false;
41999						}
42000					}
42001					$searchField.parents('form:first').trigger('submit');
42002				}
42003			});
42004		}
42005	}
42006	function js_mod_vm_search_ajax_search_ok() {
42007		return jQuery('#ac_res_product_id').val() > '0' && jQuery('#ac_res_product_name').val() == jQuery('input#shop_search_field[name="keyword"]').val();
42008	}
42009	if (typeof js_Config_parser_enabled !== 'undefined' && js_Config_parser_enabled) {
42010		jQuery(window).on('load', function () {
42011			jQuery('input#shop_search_field[name="keyword"]').after('<input name="ac_res_product_id" id="ac_res_product_id" type="hidden" value="" /><input name="ac_res_product_name" id="ac_res_product_name" type="hidden" value="" />');
42012			js_mod_vm_search_ajax_search_ini();
42013		});
42014	} else {
42015		jQuery(function () {
42016			jQuery('input#shop_search_field[name="keyword"]').after('<input name="ac_res_product_id" id="ac_res_product_id" type="hidden" value="" /><input name="ac_res_product_name" id="ac_res_product_name" type="hidden" value="" />');
42017			js_mod_vm_search_ajax_search_ini();
42018		});
42019	}
42020}
42021function js_vm_search_encodeURIchars(text) {
42022	//	funkcia zakoduje text, ktory sa ma pouzit ako parameter v URL
42023	return encodeURIComponent(text).replace('~', '%7E').replace('!', '%21').replace('*', '%2A').replace('(', '%28').replace(')', '%29').replace('\'', '%27');
42024}
42025
42026jQuery(document).on('click','#show_more_found_cats',function() {
42027	var categories = jQuery('div.autocompleter_categories ul');
42028	var manus = jQuery('div.autocompleter_manufacturers');
42029	var categH;
42030
42031	if ( manus.find('li').length ) {
42032		categH = categories.outerHeight() + jQuery(this).outerHeight();
42033	} else {
42034		categH = jQuery('.autocompleter_products').outerHeight() - jQuery('.autocompleter_categories_title').outerHeight(true) - manus.outerHeight(true);
42035	}
42036
42037	categories.find('li.hidden_cats').removeClass('hidden_cats');
42038	categories.removeClass('categories_show_default');
42039	categories.addClass('categories_show_all');
42040
42041	// categories.height( categH );
42042
42043	jQuery('#show_more_found_cats').remove();
42044	jQuery('#shop_search_field').focus();
42045});
42046
42047jQuery(document).on('click','#show_more_found_comps',function() {
42048	var manufacturers = jQuery('div.autocompleter_manufacturers ul');
42049	var categories = jQuery('div.autocompleter_categories');
42050	var manuH;
42051
42052	if ( categories.find('li').length ) {
42053		manuH = manufacturers.outerHeight() + jQuery(this).outerHeight();
42054	} else {
42055		manuH = jQuery('.autocompleter_products').outerHeight() - jQuery('.autocompleter_manufacturers_title').outerHeight(true) - categories.outerHeight(true);
42056	}
42057
42058	manufacturers.find('li.hidden_comps').removeClass('hidden_comps');
42059	manufacturers.removeClass('manufacturers_show_default');
42060	manufacturers.addClass('manufacturers_show_all');
42061
42062	// manufacturers.height( manuH );
42063
42064	jQuery('#show_more_found_comps').remove();
42065	jQuery('#shop_search_field').focus();
42066});
42067
42068
42069/* ========================================
42070 FILE: /modules/js/mod_shop_login.js
42071 ==================== */
42072
42073(function(){
42074	script_manage_params = typeof script_manage_params === 'object' ? script_manage_params : {};
42075	script_manage_params.sh_lg = typeof script_manage_params.sh_lg !== 'undefined' ? script_manage_params.sh_lg : {};
42076
42077	const params = {
42078		'ijs': typeof script_manage_params.sh_lg.ijs !== 'undefined' ? script_manage_params.sh_lg.ijs : '',
42079		'li': typeof script_manage_params.sh_lg.li !== 'undefined' ? script_manage_params.sh_lg.li : '',
42080		'im3chrq': typeof script_manage_params.sh_lg.im3chrq !== 'undefined' ? script_manage_params.sh_lg.im3chrq : '',
42081		'_un': typeof script_manage_params.sh_lg._un !== 'undefined' ? script_manage_params.sh_lg._un : ''
42082	};
42083
42084	if ( params.ijs ) {
42085		var $passwordField = jQuery('form[name="login"] #login_password_field');
42086		var $passwordFieldVirtual = jQuery('form[name="login"] #password_field_virtual');
42087
42088		var pos = $passwordField.position();
42089
42090		if (typeof pos !== 'undefined') {
42091			$passwordFieldVirtual.css({'left': (pos.left) + 'px', 'top': (pos.top) + 'px', 'position': 'absolute' });
42092		}
42093
42094		$passwordField.hide().attr('tabindex', -1);
42095
42096		$passwordFieldVirtual.on('focus', function () {
42097			js_show_password_field();
42098		});
42099
42100		$passwordField.on('change blur', function () {
42101			hidePasswordFieldIfEmpty();
42102		});
42103
42104		window.js_show_password_field = function js_show_password_field() {
42105			$passwordField.show().removeAttr('tabindex').trigger('focus');
42106			$passwordFieldVirtual.hide();
42107		};
42108
42109		window.hidePasswordFieldIfEmpty = function hidePasswordFieldIfEmpty() {
42110			if ($passwordField.val() === '') {
42111				$passwordField.hide().attr('tabindex', -1);
42112				$passwordFieldVirtual.show();
42113			}
42114		}
42115
42116		window.js_default_login = function js_default_login(e, js_action) {
42117			var elem = document.getElementById(e);
42118			// alert(elem.value);
42119
42120			switch ( js_action ) {
42121				case 'blur':
42122					if ( elem.value == '' ) {
42123						elem.style.color = '#777';
42124						elem.value=params._un;
42125					}
42126				break;
42127
42128				case 'focus':
42129					if ( elem.value == params._un ) {
42130						elem.style.color = '#333';
42131						elem.value = '';
42132					}
42133				break;
42134
42135				case 'submit':
42136					if ( elem.value == params._un) {
42137						elem.style.color = '#333';
42138						elem.focus();
42139						return false;
42140					}
42141					if (elem.value.length < 3) {
42142						alert(params.im3chrq);
42143						return false;
42144					}
42145					return true;
42146			}
42147		};
42148	}
42149
42150	window.js_login_form_valid_submit = function js_login_form_valid_submit(form) {
42151		if (typeof window['mod_login_submitting'] !== 'undefined' && window['mod_login_submitting']) {
42152			return false;
42153		}
42154
42155		if (form.username.value == '' || form.passwd.value == '') {
42156			alert(params.li);
42157			return false;
42158		}
42159
42160		window['mod_login_submitting'] = true;
42161		jQuery(form).find('input[type="submit"]').attr('disabled', true);
42162		return true;
42163	};
42164
42165})();
42166
42167
42168/* ========================================
42169 FILE: /modules/js/mod_shop_cart_ajax.js
42170 ==================== */
42171
42172// museli sme takto, aby fungovali shopy, kde nemaju ajax kosik aktivny
42173if ( typeof js_global_ajax_cart_active !== 'undefined' && js_global_ajax_cart_active ) {
42174
42175	if ( typeof js_Config_parser_enabled !== 'undefined' && js_Config_parser_enabled ) {
42176		jQuery(window).on('load', function () {
42177			js_first_init_ajax_cart();
42178		});
42179	} else {
42180		jQuery(function () {
42181			js_first_init_ajax_cart();
42182		});
42183	}
42184
42185	var modalAfterAddToCartSlickSettings = 	{
42186		slide: '.cs_product_item',
42187		autoplay: false,
42188		autoplaySpeed: 4000,
42189		slidesToShow: 3,
42190		slidesToScroll: 3,
42191		infinite: true,
42192		variableWidth: false,
42193		swipeToSlide: true,
42194        responsive: [
42195            {
42196                breakpoint: 800,
42197                settings: { slidesToShow: 2,slidesToScroll: 2, autoplay: false, }
42198            },
42199            {
42200                breakpoint: 400,
42201                settings: { slidesToShow: 1,slidesToScroll: 1, autoplay: false, }
42202            }
42203        ]
42204	};
42205
42206	function js_first_init_ajax_cart(){
42207		js_ajax_cart_init(); // init scroll
42208		js_ajax_cart_container_events_init();
42209		js_cart_link_update(); // cart link
42210		js_add_to_cart_form_ajax_cart_bind(); // bind add to cart buttons
42211		window.cs_ajax_cart_forms_ready = true;
42212		if (window.cs_pending_ajax_cart_form) {
42213			var pendingAjaxCartForm = window.cs_pending_ajax_cart_form;
42214			window.cs_pending_ajax_cart_form = null;
42215			jQuery(pendingAjaxCartForm).trigger('submit');
42216		}
42217		js_refresh_extended_waranty();
42218		// js_refresh_surcharge_products();
42219		js_remove_gift_free_msg(); // zmaze message o darceku z kosika v pripade, ze nie je skladom (ta appka co ho pridava sa instaluje do local.js-iek)
42220	}
42221
42222	function js_ajax_cart_init() {
42223		var box = jQuery('.cart_ajax_container_inner');
42224		// ajax container doesn't exists
42225		if (box.length < 1) {
42226			jQuery('.cart_ajax_container').remove();
42227			jQuery('.module-cart table:first, .module-cart .moduleCartInfo').after('<div class="cart_ajax_container"><div class="cart_ajax_container_inner"></div></div>');
42228			js_ajax_cart_container_events_init({'no_products':1});
42229			js_cart_link_update(); // cart link
42230		}
42231
42232	}
42233
42234	function js_ajax_cart_container_events_init(params) {
42235		if (is_cs_user('profdev')) csstack('js_ajax_cart_container_events_init',[params]);
42236		jQuery('.module-cart:first')
42237			.off('mouseenter mouseleave')
42238			.on('mouseenter', function () {
42239				if (typeof jQuery !== 'function') { return false; }
42240
42241				if (js_ajax_cart_open_disabled()) // frontend.js
42242					return false;
42243
42244				var cart_ajax_container = jQuery(this).find('.cart_ajax_container');
42245				if (cart_ajax_container.find('.product_cont').length > 0 || (typeof(params) != 'undefined' && typeof(params.no_products) != 'undefined'))
42246					cart_ajax_container.stop().slideDown(50, 'easeInExpo', function () {
42247						cart_ajax_container.addClass('is_open');
42248						cart_ajax_container.removeAttr('style').css('display','block'); //fix miznutia kosika
42249					});
42250			})
42251			.on('mouseleave', function () {
42252				if (typeof jQuery !== 'function') { return false; }
42253
42254				var cart_ajax_container = jQuery(this).find('.cart_ajax_container');
42255				cart_ajax_container.stop().slideUp(50, 'easeOutExpo', function () {
42256					cart_ajax_container.removeClass('is_open');
42257					cart_ajax_container.removeAttr('style').hide(); //fix miznutia kosika
42258				});
42259			});
42260	}
42261
42262	function js_remove_gift_free_msg(){
42263		if( typeof js_CS_Config_product_as_gift_empty_stock !== 'undefined' && js_CS_Config_product_as_gift_empty_stock){
42264			jQuery('.cart_ajax_container .gift_free').remove();
42265		}
42266	}
42267
42268	function js_ajax_cart_update(elem, product_id, quantity, params) {
42269		elem = jQuery(elem);
42270		if (js_is_empty(params)) params = {};
42271
42272		if (typeof js_Config_product_store_reservation !== 'undefined' && typeof js_Config_product_store_reservation.extended !== 'undefined' && typeof js_Config_product_store_reservation.active !== 'undefined' && js_Config_product_store_reservation.active === true && params.reservationCanceled !== true) {
42273			let reservationCookie = jQuery.cookie('product_reservation_active');
42274			if (typeof reservationCookie !== 'undefined' && reservationCookie !== null && reservationCookie === '1') {
42275				reservationCancelModal = new CsModal()
42276				.setClassName('product_reservation_disable_modal')
42277				.setType('info')
42278				.setTitle(js_lang_checkout_product_reservation.modalTitle)
42279				.setContent(js_lang_checkout_product_reservation.leavingReservation)
42280				.hideCloseButton(false)
42281				.setButtons("<input type=\"button\" name=\"reservation-disable-confirm\" class=\"button\" title=\"\" value=\"" + js_lang_checkout_product_reservation.confirm + "\"><input type=\"button\" name=\"reservation-disable-cancel\" class=\"button\" title=\"\" onclick=\"reservationCancelModal.close();\" value=\"" + js_lang_checkout_product_reservation.cancel + "\">")
42282				.afterOpen(()=>{
42283					let confirmButton = jQuery('input[name="reservation-disable-confirm"]');
42284					if (confirmButton.length > 0) {
42285						confirmButton.on('click', ()=>{
42286							Cookies.remove('product_reservation_active');
42287							params.reservationCanceled = true;
42288							if (typeof reservationCancelModal !== 'undefined' ) {
42289								reservationCancelModal.close();
42290							}
42291							js_ajax_cart_update(elem, product_id, quantity, params);
42292						});
42293					}
42294				})
42295				.open();
42296				return;
42297			}
42298		}
42299
42300		elem.addClass('js_img_animate_' + product_id);
42301
42302		var action = (elem.hasClass('minus') || elem.hasClass('remove')) ? '-' : '+';
42303		var cart_update = function () {
42304			var ajax_container = elem.parent();
42305
42306			var options = {
42307				'ajax_func'           : 'get_ajax_cart',
42308				'ajax_cart_product_id': product_id,
42309				'ajax_cart_action'    : action,
42310				'ajax_cart_quantity'  : quantity
42311			};
42312
42313			if (typeof params.cart_item_id !== 'undefined') {
42314				options.is_ajax = true;
42315			}
42316
42317			if (typeof(js_cart_form_ajax_selector) != 'undefined' && !js_is_empty(js_cart_form_ajax_selector) && elem.find(js_cart_form_ajax_selector).length) {
42318				ajax_container = elem.find(js_cart_form_ajax_selector);
42319			}
42320
42321			if (!options.is_ajax && typeof ProductPackDetail !== 'undefined') {
42322				var productPackParams = ProductPackDetail.getCartParams();
42323				if (Object.keys(productPackParams).length > 0) {
42324					params.productPackData = JSON.stringify(productPackParams);
42325				}
42326			}
42327
42328			// JAN Product offer: vex s upozornenim o zmazani ponuk
42329			if (action === '-' && typeof params.cart_qty !== 'undefined' && params.cart_qty === 1 && typeof prof === 'object' && elem.hasClass('pof_cart_parent') && !elem.hasClass('pof_del_confirmed')) {
42330				if (!prof.showWarning(elem)) {
42331					if (config('js_Config_product_offer_settings.hide_confirm_modal')) {
42332						window.hideConfirmModal = true;
42333					}
42334
42335					return false;
42336				}
42337			}
42338
42339			// JAN Produkt offer: povinne vybratie ponuk iba pre hlavny button pridat do kosika
42340			if (typeof prof === 'object' && prof.options.mandatoryoffer && !jQuery.isEmptyObject(prof.box) && prof.box.length > 0 && !prof.prepared && elem.attr('name') == 'addtocart' && !prof.set_plugin) {
42341				prof.highlight();
42342				return false;
42343			}
42344
42345			jQuery.each(params, function (i, val) {
42346				options[i] = val;
42347			});
42348
42349			// ulozime si info o tom, ci bolo vybrane aj predlzenie zaruky , po pridani do kosiku uz tuto mzonost odstranime(nemoze si vybrat 2 predlzenai zaruky na jeden produkt)
42350			var extendedWarranty              = jQuery('input[name="extended_warranty_product"]');
42351			extended_warranty_product_checked = extendedWarranty.length && extendedWarranty.is(':checked');
42352
42353			// Sety
42354			var isAjaxCart = elem.hasClass('minus') || elem.hasClass('plus');
42355
42356			// if is ajax cart and not set
42357			if (typeof prof === 'object' && prof.set_plugin && !isAjaxCart) {
42358				options.is_set    = true;
42359				options.selection = JSON.stringify(prof.selection);
42360			}
42361
42362			if (typeof params.set !== 'undefined') {
42363				options.is_set = true;
42364				options.set    = params.set;
42365			}
42366
42367			var parentElem = elem.parents('.shop-category-product, .featured-prod');
42368
42369			if (typeof options.select_value !== 'undefined' && options.select_value == null) {
42370				delete options.select_value;
42371			}
42372
42373			if (typeof options.select_value === 'undefined' && typeof js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED !== 'undefined' && js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED == 2 ){
42374				options.is_ajax_cart = true;
42375			}
42376
42377			var ajaxOptions = {async: true};
42378			if (typeof options.dynamic_attribute === 'undefined') {
42379				ajaxOptions = {async: false};
42380			}
42381
42382			options.fromDetail = jQuery('.shop_page_class_shop_product_details').length > 0;
42383
42384			ajax_container.startAjaxLoader();
42385			parentElem.addClass('ajaxProcess');
42386			jQuery.ajaxSetup(ajaxOptions); // adding to card have to be sync ! to avoid problems with fast purchase
42387
42388			jQuery.post('/modules/mod_shop_cart_ajax.php', options, function (ajax_res) {
42389				var cartError = false;
42390				var result;
42391
42392				try {
42393					result = JSON.parse(decodeURIComponent(ajax_res));
42394				} catch (err) {
42395					result = JSON.parse(ajax_res);
42396				}
42397
42398				if ('image_source' in result) {
42399					localStorage.setItem('ajaxCartUpdateVariants', JSON.stringify(result));
42400				} else if ('log_params' in result) {
42401					for (var i = 0; i < result.log_params.length; i++) {
42402						if (typeof result.log_params[i] === 'object' && result.log_params[i].hasOwnProperty('select_value')) {
42403							localStorage.setItem('selectedItemValue', JSON.stringify(result.log_params[i].select_value));
42404						}
42405					}
42406				}
42407
42408				if (typeof result.messages !== 'undefined') {
42409					for (let message of result.messages) {
42410						new CsModal().setTitle(message.title).setContent(message.text).open();
42411					}
42412
42413					skipAnimate = true;
42414				}
42415
42416				if (typeof js_Config_product_details_vex_product_restricted !== 'undefined' && js_Config_product_details_vex_product_restricted ) {
42417					if ( typeof result.restricted_product !== 'undefined' && result.restricted_product.is_product_restricted == '1' && result.restricted_product.contains_restricted == '0' && typeof result.restricted_product.message !== 'undefined' ) {
42418						vex.dialog.alert(result.restricted_product.message);
42419					}
42420				}
42421
42422				if (typeof result.productModifiedQuantities !== 'undefined' && result.productModifiedQuantities !== null && result.productModifiedQuantities.length) {
42423					var before = result.productModifiedQuantities.before;
42424					var after  = (typeof result.productModifiedQuantities.after != 'undefined') ? result.productModifiedQuantities.after : 0;
42425					var unit = result.productModifiedQuantities.unit;
42426
42427					if (parseFloat(before) !== parseFloat(after)) {
42428						var opts  = {};
42429
42430						opts.text = '';
42431
42432						if (typeof js_lang_insufficient_quantity_inform != 'undefined') {
42433							opts.text = js_lang_insufficient_quantity_inform;
42434						}
42435
42436						if (typeof js_lang_insufficient_quantity_inform_max != 'undefined' && after < before) {
42437							opts.text = js_lang_insufficient_quantity_inform_max;
42438						}
42439
42440						if (typeof js_lang_insufficient_quantity_inform_min != 'undefined' && after > before) {
42441							opts.text = js_lang_insufficient_quantity_inform_min;
42442						}
42443
42444						opts.text = opts.text.replace('{from}',before);
42445						opts.text = opts.text.replace('{to}',after);
42446						//2 krát unit v langu.. najrýchlejšie riešenie (aj keď hlúpe)
42447						opts.text = opts.text.replace('{unit}',unit);
42448						opts.text = opts.text.replace('{unit}',unit);
42449
42450						//opts.text = 'Kvôli úprave množstva produktu bolo množstvo zmenené z ' + before + ' na ' + after;
42451						opts.type = 'warning';
42452
42453						if (typeof options === 'object') {
42454							opts = jQuery.extend(true, {}, opts, options);
42455						}
42456
42457						//TODO znazať ostatné (staré Notifikácie)
42458
42459						//jQuery('.ui-pnotify-container').remove();
42460
42461						if ( typeof CsModal !== "undefined" && after < before ) {
42462
42463							if ( typeof skipAnimate === 'undefined' ) {
42464								var skipAnimate = true;
42465							} else {
42466								skipAnimate = true;
42467							}
42468
42469							if ( typeof quantityMessageModal !== 'undefined' ) {
42470								quantityMessageModal.open();
42471							} else {
42472								quantityMessageModal = new CsModal()
42473								.setClassName("modify-quantity")
42474								.setType('info')
42475								.setTitle(js_lang_mess_coupon_import_start_title)
42476								.setContent(js_lang_insufficient_quantity_inform_max_2)
42477								.hideEmptySpace(true)
42478								.setButtons("<input type=\"button\" class=\"button cs_modal_sec_button\" name=\"submit\" title=\"\" onclick=\"quantityMessageModal.close();\" value=\"Ok\">")
42479								.hideCloseButton(true)
42480								.open();
42481							}
42482
42483							if ( typeof ajax_container !== 'undefined' ) {
42484								var productQuantityInput = ajax_container.find('input[name="quantity"]');
42485								if ( productQuantityInput.length === 1 ) {
42486									var productQuantityInputMin = typeof productQuantityInput.data('minimum_quantity') !== 'undefined' ? productQuantityInput.data('minimum_quantity') : 1;
42487									productQuantityInput.val(productQuantityInputMin);
42488								}
42489							}
42490
42491						} else {
42492							PNotify.removeAll();
42493							showNotification(opts.text, '', opts.type,'8000',opts.hide,'','pnotify_modify_quantiity');
42494						}
42495					}
42496				}
42497
42498				js_cart_total = result.cart_order_total; //config_cart_total_js
42499
42500				//mesacny limit na nakup pre vybranych pouzivatelov
42501				if (typeof result.monthlyOrderLimitExceeded !== 'undefined') {
42502					vex.dialog.alert({message: result.monthlyOrderLimitExceeded.message, input: result.monthlyOrderLimitExceeded.input});
42503				}
42504
42505				if (typeof(result) !== 'undefined' && typeof(result.update_res) !== 'undefined') {
42506					if (typeof(result.update_res.error) !== 'undefined') {
42507						cartError = true;
42508
42509						vex.dialog.alert({
42510							message: result.update_res.error,
42511							callback: function() {
42512								var $productPackSection = jQuery('#product_pack_section');
42513
42514								if (typeof result.update_res.highlight_product_pack !== 'undefined' && result.update_res.highlight_product_pack && $productPackSection.length) {
42515									$productPackSection.addClass('choose_variant');
42516
42517									setTimeout(function() {
42518										$productPackSection.removeClass('choose_variant');
42519									}, 3000);
42520								}
42521							}
42522						});
42523					}
42524
42525					if ( jQuery('.shop_page_class_shop_cart').length ) {
42526						if( jQuery(result.update_res).filter('.shop_tip').length > 0 ){
42527							jQuery(result.update_res).insertBefore('#middle_content_inner .shop_cart_ac_add_to_cart_div');
42528
42529							setTimeout(function () {
42530								jQuery('#middle_content_inner .shop_tip').remove();
42531							}, 9000);
42532
42533							return false;
42534						}
42535					}
42536				}
42537
42538				var matrix = (typeof(params.matrix) != 'undefined');
42539
42540				if ( params.attr_selectbox == null && result.method == 'get_variants' && result.html_variants != '' && !matrix ) {
42541					// nove vex okno na vyber variantu produktu
42542
42543					let tmpProductVariantHtml = [];
42544					if (config('js_Config_product_variant') && ['multiSelect', 'select'].includes(config('js_Config_product_variant.mode'))) {
42545						tmpProductVariantHtml = [
42546							'<div class="modal-variant-info">',
42547							`<div class="info_line avail_line"><span class="label">${js_lang_availability}</span><span class="vex_product_availability_value shop_product_availability_value" title=""></span></div>`,
42548							`<div class="info_line price_line"><span class="label">${cms_js_sort_tabs.price}</span><span class="vex_variant_price"></span></div>`,
42549							'</div>'
42550						];
42551					}
42552
42553					vex.open({
42554						content         : [
42555							'<form class="vex-dialog-form">',
42556							'<div class="vex-dialog-message">',
42557							'<span class="login-title">',
42558							result.product_name,
42559							'</span>',
42560							'</div>',
42561							'<div class="vex-dialog-input" style="padding-top: 1.5em;">',
42562							...tmpProductVariantHtml,
42563							'</div>',
42564							'<div class="vex-dialog-buttons">',
42565							'</div>',
42566							'</form>'
42567						].join(''),
42568						contentClassName: 'vex-content pretty_cart',
42569						afterOpen       : function (vexContent) {
42570							jQuery(vexContent).on('click', 'div.vex-close', function () {
42571								vex.close(vexContent.data().vex.id);
42572							});
42573							ajax_container.stopAjaxLoader();
42574							parentElem.removeClass('ajaxProcess');
42575							var vexForm  = vexContent.find('form.vex-dialog-form');
42576							var vexInput = vexForm.find('.vex-dialog-input');
42577							var vexButtons = vexForm.find('.vex-dialog-buttons');
42578
42579							var form_elem = ajax_container.clone();
42580							var parent    = ajax_container.parent();
42581							var product_link;
42582
42583							if (typeof result.surchargeProductsHtml !== 'undefined' && result.surchargeProductsHtml) {
42584								vexInput.prepend(result.surchargeProductsHtml);
42585							}
42586
42587							if ( typeof js_CS_Config_change_input_to_button !== 'undefined' && js_CS_Config_change_input_to_button ) {
42588								jQuery(vexContent).on('click', '.vex_cart_quantity [type="submit"]', function (event) {
42589
42590									if (jQuery('.prod_adv_attrib_select select').val() == '' && typeof js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED !== 'undefined' && js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED != '2') {
42591										var newFind = jQuery('.prod_adv_attrib_select select').find("option:selected");
42592										if (typeof newFind[1] === 'undefined' || (typeof newFind[1] !== 'undefined' && newFind[1].value == '')) {
42593											var elem              = jQuery(event.target);
42594											var variant_container = jQuery(elem).parents('.vex-dialog-form:first').find('.prod_adv_attrib_select');
42595											var msg               = '<span class="select_variant_error">' + js_lang_prof_select_main_variant + '</span>';
42596											variant_container.prepend(msg);
42597											return false;
42598										} else {
42599											vex.close(vexContent.data().vex.id);
42600										}
42601									} else {
42602										if ( is_cs_user('separate_js') && ( typeof js_CS_Config_empy_radio_select_variant !== 'undefined' && js_CS_Config_empy_radio_select_variant == '1' ) ) { // jaro
42603											var form_varaints = vexForm.find('.prod_adv_attribs_div').find('.shop_addtocart_advanced_attribute_radio');
42604											if( ( typeof js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED !== 'undefined' && js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED == '1') && ( form_varaints.length > 0 ) && (form_varaints.is(':checked') == false ) ){
42605												//console.log(vexForm.find('.prod_adv_attribs_div').find('.shop_addtocart_advanced_attribute_radio'));
42606												var elem              = jQuery(event.target);
42607												var variant_container = jQuery(elem).parents('.vex-dialog-form:first').find('.prod_adv_attribs_div:first');
42608												var msg               = '<span class="radio_variant_error">' + js_lang_prof_select_main_variant + '</span>';
42609												if(vexForm.find('.radio_variant_error').length == 0 ){
42610													jQuery(msg).insertAfter(variant_container).delay(2500).fadeOut('slow', function(){ //insertBefore
42611														jQuery(this).remove();
42612													});
42613													//variant_container.prepend(msg);
42614												}
42615												return false;
42616											} else {
42617												vex.close(vexContent.data().vex.id);
42618											}
42619										} else {
42620											if (typeof product_id !== 'undefined' && typeof js_Config_product_variant !== 'undefined' && js_Config_product_variant && typeof window['ProductVariantInstance_' + product_id] !== 'undefined' && typeof window['ProductVariantInstance_' + product_id].getSelectedAttribute() == 'undefined') {
42621												var msg = '<span class="select_variant_error">' + js_lang_prof_select_main_variant + '</span>';
42622												if (vexForm.find('.select_variant_error').length == 0) {
42623													jQuery(msg).insertAfter(vexForm.find('.vex-dialog-input')).delay(2500).fadeOut('slow', function () { //insertBefore
42624														jQuery(this).remove();
42625													});
42626												}
42627												return false;
42628											}
42629											vex.close(vexContent.data().vex.id);
42630										}
42631									}
42632								});
42633							} else {
42634								jQuery(vexContent).on('click', '.vex_cart_quantity input[name="submit"]', function (event) {
42635
42636									if (jQuery('.prod_adv_attrib_select select').val() == '' && typeof js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED !== 'undefined' && js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED != '2') {
42637										var newFind = jQuery('.prod_adv_attrib_select select').find("option:selected");
42638										if (typeof newFind[1] === 'undefined' || (typeof newFind[1] !== 'undefined' && newFind[1].value == '')) {
42639											var elem              = jQuery(event.target);
42640											var variant_container = jQuery(elem).parents('.vex-dialog-form:first').find('.prod_adv_attrib_select');
42641											var msg               = '<span class="select_variant_error">' + js_lang_prof_select_main_variant + '</span>';
42642											variant_container.prepend(msg);
42643											return false;
42644										} else {
42645											vex.close(vexContent.data().vex.id);
42646										}
42647									} else {
42648										if ( is_cs_user('separate_js') && ( typeof js_CS_Config_empy_radio_select_variant !== 'undefined' && js_CS_Config_empy_radio_select_variant == '1' ) ) { // jaro
42649											var form_varaints = vexForm.find('.prod_adv_attribs_div').find('.shop_addtocart_advanced_attribute_radio');
42650											if( ( typeof js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED !== 'undefined' && js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED == '1') && ( form_varaints.length > 0 ) && (form_varaints.is(':checked') == false ) ){
42651												//console.log(vexForm.find('.prod_adv_attribs_div').find('.shop_addtocart_advanced_attribute_radio'));
42652												var elem              = jQuery(event.target);
42653												var variant_container = jQuery(elem).parents('.vex-dialog-form:first').find('.prod_adv_attribs_div:first');
42654												var msg               = '<span class="radio_variant_error">' + js_lang_prof_select_main_variant + '</span>';
42655												if(vexForm.find('.radio_variant_error').length == 0 ){
42656													jQuery(msg).insertAfter(variant_container).delay(2500).fadeOut('slow', function(){ //insertBefore
42657														jQuery(this).remove();
42658													});
42659													//variant_container.prepend(msg);
42660												}
42661												return false;
42662											} else {
42663												vex.close(vexContent.data().vex.id);
42664											}
42665										} else {
42666											if (typeof product_id !== 'undefined' && typeof js_Config_product_variant !== 'undefined' && js_Config_product_variant && typeof window['ProductVariantInstance_' + product_id] !== 'undefined' && typeof window['ProductVariantInstance_' + product_id].getSelectedAttribute() == 'undefined') {
42667												var msg = '<span class="select_variant_error">' + js_lang_prof_select_main_variant + '</span>';
42668												if (vexForm.find('.select_variant_error').length == 0) {
42669													jQuery(msg).insertAfter(vexForm.find('.vex-dialog-input')).delay(2500).fadeOut('slow', function () { //insertBefore
42670														jQuery(this).remove();
42671													});
42672												}
42673												return false;
42674											}
42675											vex.close(vexContent.data().vex.id);
42676										}
42677									}
42678								});
42679							}
42680
42681							jQuery(document).on('change', '.prod_adv_attrib_div .prod_adv_attrib_select select', function (event) {
42682								var elem = jQuery(event.target);
42683								if (elem.val() !== '') {
42684									jQuery(elem).parents('.prod_adv_attrib_select').find('.select_variant_error').remove();
42685								}
42686							});
42687
42688							if (!form_elem.is('form')) {
42689								form_elem = form_elem.parents('form:first').length ? form_elem.parents('form:first').clone() : form_elem.find('form:first').clone();
42690							}
42691
42692							jQuery(form_elem).find('.shop_browse_addtocart_quantity_label').remove();
42693							jQuery(form_elem).find('[name="quantity"]').removeAttr('id');
42694							jQuery(form_elem).find('[name="quantity"]').removeAttr('onkeyup');
42695							jQuery(form_elem).find('[name="prod_url"]').remove();
42696							if ( typeof js_CS_Config_change_input_to_button !== 'undefined' && js_CS_Config_change_input_to_button ) {
42697								jQuery(form_elem).find('[type="submit"]').attr('class', 'button');
42698								jQuery(form_elem).find('[type="submit"]').removeAttr('onclick');
42699							} else {
42700								jQuery(form_elem).find('[name="submit"]').attr('class', 'button');
42701								jQuery(form_elem).find('[name="submit"]').removeAttr('onclick');
42702							}
42703
42704							vexForm
42705								.attr('action', form_elem.attr('action'))
42706								.attr('method', form_elem.attr('method'))
42707								.attr('name', form_elem.attr('name'))
42708								.attr('id', form_elem.attr('id'));
42709
42710
42711							let fullLinkSelector = parent.parents('.product_id_'+product_id).find('.full_link').length > 0 ? '.full_link' : '.product_full_link';
42712							if (parent.parents('.product_id_'+product_id).find(fullLinkSelector).length > 0) {
42713								product_link = parent.parents('.product_id_'+product_id).find(fullLinkSelector).prop('href');
42714							}
42715
42716							while (typeof product_link === 'undefined') {
42717								if (parent.find('a'+fullLinkSelector).length > 0) {
42718									product_link = parent.find('a'+fullLinkSelector).prop('href');
42719								} else {
42720									product_link = parent.find('a').prop('href');
42721								}
42722								parent = parent.parent();
42723							}
42724
42725							if (form_elem.find('.prod_adv_attribs_div').length == 0) {
42726								vexInput.prepend(result.html_variants);
42727							}
42728
42729							form_elem.find('input[name="quantity"]').attr('id', 'quantity');
42730							form_elem.find('label[for^="quantity"]').attr('for', 'quantity');
42731							if (!jQuery.inArray(js_global_VM_PRODUCT_ATTRIB_STYLE, ['1', '2'])) {
42732								form_elem.append('<input type="hidden" name="attribute_select_mode" value="1"/>');
42733								if (js_global_VM_PRODUCT_ATTRIB_STYLE == '1') {
42734									jQuery('.pretty_avil').hide();
42735								}
42736							}
42737
42738							if (typeof js_Config_change_product_quantity != 'undefined') {
42739								form_elem.find('input[name="quantity"]').show();
42740							} else {
42741								if (form_elem.find('input[name="quantity"]:visible').length == 0) {
42742									if ( typeof params.vex_quantity !== 'undefined' ) {
42743										vex_quantity = params.vex_quantity;
42744									} else {
42745										if(elem.find('input[name="quantity"]').length > 0 ){
42746											vex_quantity = elem.find('input[name="quantity"]').val();
42747										} else {
42748											vex_quantity = 1;
42749										}
42750									}
42751
42752									form_elem.find('input[name="quantity"]:hidden, label[for="quantitFsubmity"]').remove();
42753									if ( typeof js_CS_Config_change_input_to_button !== 'undefined' && js_CS_Config_change_input_to_button ) {
42754										jQuery([
42755											'<label for="quantity" class="shop_browse_addtocart_quantity_label">',
42756											(typeof js_shop_cart_quantity !== 'undefined' ? js_shop_cart_quantity + ':' : ''),
42757											'</label>',
42758											'<input id="quantity" class="inputbox shop-addtocart-quantity-inputbox" type="text" size="3" name="quantity" value="' + vex_quantity + '" onkeyup="(parseInt(this.value)>0)?this.style.borderColor=\'\' : this.style.borderColor=\'red\';">'
42759										].join('')).insertBefore(jQuery(form_elem.find('[type="submit"]')));
42760									} else {
42761										jQuery([
42762											'<label for="quantity" class="shop_browse_addtocart_quantity_label">',
42763											(typeof js_shop_cart_quantity !== 'undefined' ? js_shop_cart_quantity + ':' : ''),
42764											'</label>',
42765											'<input id="quantity" class="inputbox shop-addtocart-quantity-inputbox" type="text" size="3" name="quantity" value="' + vex_quantity + '" onkeyup="(parseInt(this.value)>0)?this.style.borderColor=\'\' : this.style.borderColor=\'red\';">'
42766										].join('')).insertBefore(jQuery(form_elem.find('input[name="submit"]')));
42767									}
42768
42769								}
42770							}
42771							if ( typeof js_CS_Config_change_input_to_button !== 'undefined' && js_CS_Config_change_input_to_button ) {
42772								var submitBtn = form_elem.find('[type="submit"].categ_add_to_cart');
42773							} else {
42774								var submitBtn = form_elem.find('input[type="submit"].categ_add_to_cart');
42775							}
42776
42777							if (submitBtn.length) {
42778								submitBtn.removeAttr('onclick');
42779								vexButtons.append(submitBtn.clone().addClass('vex-dialog-button-primary vex-dialog-button vex-first'));
42780								submitBtn.remove();
42781							}
42782
42783							if (typeof product_link === 'undefined' || product_link == 0 || product_link == 'javascript:void(0)') {
42784								if (elem.data('product-link')) {
42785									product_link = elem.data('product-link');
42786								}
42787							}
42788
42789							// link na produkt z virtualnych variantov
42790							if (typeof product_link === 'undefined' || product_link == 0 || product_link == 'javascript:void(0)') {
42791								var productLinkHref = elem.closest('tr.vv_tr').find('a.vv_box_image').attr('href');
42792								if (typeof productLinkHref !== 'undefined' && productLinkHref !== '') {
42793									product_link = productLinkHref;
42794								}
42795							}
42796
42797							// fallback na url zo servera (napr. ak produkt nie je v DOM - quick view, autocomplete)
42798							if (!product_link && result.product_url) {
42799								product_link = result.product_url;
42800							}
42801
42802							if (typeof js_CS_Config_change_input_to_button !== 'undefined' && js_CS_Config_change_input_to_button ) {
42803								vexButtons.append('<button onclick="window.location=\'' + product_link + '\';" type="button" class="vex-dialog-button-secondary vex-dialog-button vex-last button">' + (typeof js_shop_flypage_lbl !== 'undefined' ? js_shop_flypage_lbl : '') + '</button>');
42804							} else {
42805								vexButtons.append('<input onclick="window.location=\'' + product_link + '\';" type="button" class="vex-dialog-button-secondary vex-dialog-button vex-last button" value="' + (typeof js_shop_flypage_lbl !== 'undefined' ? js_shop_flypage_lbl : '') + '">');
42806							}
42807
42808
42809							//vexInput.append(form_elem.html());
42810							vexButtons.prepend('<div class="vex_cart_quantity"></div>');
42811							vexButtons.find('.vex_cart_quantity').prepend(form_elem.html());
42812
42813
42814							// init availability text
42815							var availText = jQuery('.vex-content select');
42816							if (availText.length) {
42817								form_elem.prepend('<div class="pretty_avil">' + result.html_avail + '</div>');
42818								availText.trigger('change');
42819							}
42820
42821							js_add_to_cart_form_ajax_cart_bind();
42822
42823							vexForm.find('.shop_addtocart_advanced_attribute_radio:checked').addClass('active');
42824							vexForm.on('click', '[class^="shop_addtocart_advanced_attribute_row_"]', function (event) {
42825								jQuery(this).siblings().removeClass('active').find('.shop_addtocart_advanced_attribute_radio').prop('checked', false);
42826								jQuery(this).addClass('active').find('.shop_addtocart_advanced_attribute_radio').prop('checked', true);
42827							});
42828
42829							vexContent.on('click', '.categ_add_to_cart', function (event) {
42830								var selectElem = vexContent.find('select.main_attr_select');
42831								var firstVal   = selectElem.find('option').filter(function () {
42832									return jQuery(this).val() !== '';
42833								}).first().val();
42834
42835								if (selectElem.val() === '') {
42836									if (typeof firstVal !== 'undefined') {
42837										selectElem.css('border', 'red solid 1px');
42838										return false;
42839										//selectElem.val(firstVal);
42840										//vex.close(vexContent.data().vex.id);
42841									} else {
42842										event.preventDefault();
42843									}
42844								} else {
42845									vex.close(vexContent.data().vex.id); // TODO: px zmazat ak zistim co skutocne zatvara
42846								}
42847							});
42848
42849							if (typeof js_variants_browse_table_js_init == 'function') {
42850								js_variants_browse_table_js_init();
42851							}
42852
42853						},
42854						afterClose      : function () {
42855							if (typeof window['ProductVariantInstance_' + product_id] !== 'undefined') {
42856								//delete window['ProductVariantInstance_' + product_id];
42857
42858								if( !(delete window['ProductVariantInstance_' + product_id]) ){// nebolo mozne zmazat premennu s pomocou 'delete'
42859									window['ProductVariantInstance_' + product_id] = undefined;
42860								}
42861							}
42862
42863							js_add_to_cart_form_ajax_cart_bind();
42864						}
42865					});
42866
42867					return false;
42868				}
42869
42870				// Skontroluj spravy a aktivuj messengera
42871				if (typeof messenger !== 'undefined') {
42872					messenger.check(result.update_res);
42873				}
42874
42875				if ( jQuery('.shop_cart_ac_add_to_cart_div').length ){
42876					js_reload_current_page();
42877					return false;
42878				}
42879
42880				let is_dynamic_attribute = false;
42881				let reloadCurrentPageAfterTimeout = (jQuery('.shop_page_class_shop_cart').length || (typeof(reloadAfterAddToCart) !== 'undefined' && reloadAfterAddToCart == 1));
42882				if (reloadCurrentPageAfterTimeout) {	// ak som v nakupnom kosiku, vykonam reload
42883					setTimeout(function () {
42884						js_reload_current_page();
42885						return false;
42886					}, 900);
42887				}
42888
42889				if ( !( (typeof(options.is_gift) != 'undefined' && options.is_gift === true) || (typeof(options.is_special_offer) != 'undefined' && options.is_special_offer === true) ) && !( typeof cart_animate_false !== 'undefined' && cart_animate_false ) ) {
42890					js_ajax_cart_container_init(result);
42891				}
42892
42893				js_refresh_extended_waranty();
42894				js_refresh_surcharge_products();
42895
42896				if(typeof js_Config_product_detail_free_shipping_info !== 'undefined' && js_Config_product_detail_free_shipping_info && jQuery('body').hasClass('shop_page_class_shop_product_details') && typeof js_flypage_free_shipping_update_info == 'function'){
42897					js_flypage_free_shipping_update_info();
42898				}
42899
42900				// zmena dostupnosti na buducu dostupnost
42901				if (typeof result === 'object' && typeof result.futureAvailability === 'object') {
42902					js_refresh_product_availability_by_future_availability(result.futureAvailability);
42903				}
42904
42905				parentElem.removeClass('ajaxProcess');
42906				ajax_container.stopAjaxLoader();
42907
42908				if (config('js_Config_reset_quantity_after_add_to_cart')) {
42909					ajax_container.find('.quantity_wrapper input[name="quantity"]').val('1').trigger('change');
42910				}
42911
42912				// JAN dynamicke atributy
42913				if (elem.find('.daf_wrap').length && typeof dattr == 'object' && typeof dattr.afterCart == 'function') {
42914					is_dynamic_attribute = true;
42915					dattr.afterCart();
42916				}
42917
42918				// JAN Produkt offer: Pridanie ponuk do kosika po ajax requeste!!!
42919				// sety maju defaultne vypnute pridavanie cez offer ajax
42920				if (typeof prof == 'object' && !jQuery.isEmptyObject(prof.box) && prof.box.length > 0 && prof.prepared && !prof.set_plugin) {
42921					prof.add(result);
42922				}
42923
42924				// JAN dary pre detsky domov
42925				var custom_gifts = elem.hasClass('customGiftInput');
42926
42927				js_add_to_cart_form_ajax_cart_bind();	// bind add to cart buttons
42928
42929				var success_added = jQuery('<div>' + result.update_res + '</div>').find('.shop_tip').length == 0;
42930
42931				//ecomail trackovanie obsahu kosika (len pre non cs)
42932				if (!is_cs_user() && typeof js_Config_ecomail_track_cart_content !== 'undefined') {
42933					//ziskame naformatovany obsah kosika
42934					new AjaxRequest()
42935						.setController('Cart')
42936						.setAction('getCartContentForEcomail')
42937						.onSuccess(function (result) {
42938							//odosleme obsah kosika
42939							if (typeof window.ecotrack !== 'undefined') {
42940								window.ecotrack('trackUnstructEvent', {
42941									schema: '',
42942									data  : {
42943										action  : 'Basket',
42944										products: result.data
42945									}
42946								});
42947							}
42948							//console.log(result.data);
42949						})
42950						.send();
42951				}
42952
42953				if (typeof freeShippingInfoData !== 'undefined' && typeof result.totalCartWeight !== 'undefined') {
42954					var totalCartWeight = result.totalCartWeight;
42955					var selectedVariant = jQuery('.prod_adv_attrib_div .selected_attr');
42956
42957					freeShippingInfoData.totalWeight = totalCartWeight;
42958					freeShippingInfoData.canShowInfo = freeShippingInfoData.maxFreeShippingWeight > (totalCartWeight + freeShippingInfoData.currentProductWeight);
42959
42960					if (selectedVariant.length) {
42961						selectedVariant.trigger('click');
42962					}
42963				}
42964
42965				if (typeof (js_ajax_cart_update_after_init) != 'undefined') {
42966					js_ajax_cart_update_after_init({
42967						'product_id': product_id,
42968						'quantity'  : quantity,
42969						'attribute' : params.select_value
42970					});
42971				}
42972
42973				var redirectFunc = function() {
42974					if (typeof(result.redirect) != 'undefined' && result.redirect !== '') {
42975						location.href = js_global_live_site + result.redirect;
42976					}
42977				};
42978
42979
42980				var apiRequestRun = false;
42981
42982				if (success_added && !cartError) {
42983					if (result.method !== 'remove' && !(custom_gifts
42984						|| (
42985							(typeof (options.is_gift) != 'undefined' && options.is_gift === true)
42986							||
42987							(typeof (options.is_special_offer) != 'undefined' && options.is_special_offer === true)
42988						))
42989					) {
42990						if (elem.attr('data-skip-animate')) {
42991							skipAnimate = true;
42992						}
42993
42994						if ( typeof skipAnimate === 'undefined' || ( typeof skipAnimate !== 'undefined' && skipAnimate == false ) ) {
42995							if (typeof js_cart_image_animate_custom == 'function') {
42996								js_cart_image_animate_custom(ajax_container);
42997							} else {
42998								if (ajax_container.hasClass('vex-content')) {
42999									js_cart_image_animate(jQuery('.js_img_animate_' + product_id).not('.vex-dialog-form'));
43000								} else {
43001									js_cart_image_animate(ajax_container);
43002								}
43003
43004								jQuery('.js_img_animate_' + product_id).removeClass('js_img_animate_' + product_id);
43005							}
43006						}
43007					}
43008
43009					if (typeof isApiActive !== 'undefined' && isApiActive) {
43010						var apiAction = action === '+' ? 'addToCart' : 'removeFromCart';
43011						var pageMatch = js_server_request_uri.match(/(&|;|\?)page\=([^&]+)/);
43012						var manMatch  = js_server_request_uri.match(/(&|;|\?)pc_manufacturer_id\=([^&]+)/);
43013						var page      = '';
43014
43015						if (typeof manMatch === 'object' && manMatch !== null) {
43016							page = 'manufacturer';
43017						} else if (typeof pageMatch === 'object' && pageMatch !== null && typeof pageMatch[2] !== 'undefined') {
43018							page = pageMatch[2];
43019						}
43020
43021						apiRequest(apiAction, {
43022							'products': [{
43023								'product_id' : product_id,
43024								'quantity'   : quantity,
43025								'description': params.select_value,
43026								'idx'        : params.cart_item_id
43027							}],
43028							'page'    : page,
43029							'isAjax'  : true
43030						}, redirectFunc);
43031
43032						apiRequestRun = true;
43033					}
43034				}
43035
43036				// close prettyphoto with variants
43037				js_prettyphoto_close();
43038
43039				if (!reloadCurrentPageAfterTimeout && !is_dynamic_attribute && typeof params !== 'undefined' && typeof params.cart_item_id === 'undefined' && typeof js_Config_modal_after_add_to_cart !== 'undefined' && js_Config_modal_after_add_to_cart && typeof result.update_res !== 'undefined' && typeof result.update_res.success !== 'undefined' && result.update_res.success == 1 && typeof result.update_res.method !== 'undefined' && ['add', 'update'].indexOf(result.update_res.method) >= 0) {
43040
43041					if (typeof result.update_res.itemId !== 'undefined') {
43042						params.itemId = result.update_res.itemId;
43043					}
43044
43045					showLoader();
43046					new AjaxRequest({productId: product_id, params: params})
43047						.setController('Cart')
43048						.setAction('getModalAfterAddToCart')
43049						.onSuccess(function (result) {
43050							hideLoader();
43051							if (typeof result !== 'undefined' && typeof result.data !== 'undefined' && typeof result.data.html !== 'undefined') {
43052								if (typeof window.ModalAfterAddToCart === 'undefined') {
43053									window.ModalAfterAddToCart = new CsModal()
43054										.setClassName('modal_after_add_to_cart_vex fresh')
43055										.setType('info')
43056										.setTitle(typeof js_lang_modal_after_add_to_cart_vex_title !== 'undefined' ? js_lang_modal_after_add_to_cart_vex_title : 'And it\'s in the basket!')
43057										.setContent(result.data.html)
43058										.setButtons('')
43059										.afterOpen(function(vexContent) {
43060											jQuery('body').addClass('modal_after_add_to_cart_open');
43061											vexContent.find('.related_products_div').slick(modalAfterAddToCartSlickSettings);
43062										})
43063										.afterSetContent(function (vexContent) {
43064											vexContent.find('.related_products_div').slick(modalAfterAddToCartSlickSettings);
43065										})
43066										.afterClose(function() { // nastavi callback, ktory sa vykona po uzavreti modalu
43067											window.ModalAfterAddToCart = undefined;
43068											jQuery('body').removeClass('modal_after_add_to_cart_open');
43069										})
43070										.open();
43071								}
43072
43073								// bind eventu na reload // TODO neako refactorovat ?
43074								jQuery('body').on('addToCartFinished', function(event, triggeredData) {
43075									window.ModalAfterAddToCart.setClassName('loading');
43076									window.ModalAfterAddToCart.removeClass('fresh');
43077									new AjaxRequest({productId: triggeredData.productId, params: {select_value: triggeredData.attribute, itemId: triggeredData.itemId}})
43078										.setController('Cart')
43079										.setAction('getModalAfterAddToCart')
43080										.onSuccess(function (result) {
43081											window.ModalAfterAddToCart.removeClass('loading');
43082											if (typeof result !== 'undefined' && typeof result.data !== 'undefined' && typeof result.data.html !== 'undefined') {
43083												window.ModalAfterAddToCart.setContent(result.data.html);
43084											}
43085										})
43086										.send();
43087								});
43088							}
43089						})
43090						.onError(function () {
43091							hideLoader();
43092						})
43093						.send();
43094				}
43095
43096				jQuery('body').trigger('cartUpdated');
43097
43098				// Redirect
43099				if (!apiRequestRun) {
43100					redirectFunc();
43101				}
43102			});
43103
43104			jQuery.ajaxSetup({async: true});
43105		};
43106
43107		if (typeof window.hideConfirmModal !== 'undefined' && window.hideConfirmModal) {
43108			cart_update(elem, product_id, quantity, params, action);
43109			
43110			delete window.hideConfirmModal;
43111
43112			return false;
43113		}
43114
43115		// do anonymnej funkcie dat potom v if sa spytat na vex confirm a potom zavolat anonymnu funkciu, dodefinovat este potom elem ako parameter anonymnej funkcie
43116		if ((elem.hasClass('minus') && params.cart_qty == quantity) || elem.hasClass('remove')) {
43117			vex.dialog.confirm({
43118				message  : js_lang_shopping_cart_delete_item_confirm,
43119				focusFirstInput: !config('js_Config_disable_focus_on_dialog'),
43120				callback : function (value) {
43121					if (value) {
43122						cart_update(elem, product_id, quantity, params, action);
43123					} else {
43124						var cart_ajax_container = jQuery(document).find('.cart_ajax_container');
43125						if (cart_ajax_container.find('.product_cont').length > 0 || (typeof (params) != 'undefined' && typeof (params.no_products) != 'undefined')) {
43126							cart_ajax_container.stop().slideDown(50, 'easeInExpo', function () {
43127								cart_ajax_container.addClass('is_open');
43128								cart_ajax_container.removeAttr('style').css('display', 'block'); //fix miznutia kosika
43129							});
43130						}
43131					}
43132				},
43133				afterOpen: function () {
43134					if (!config('js_Config_disable_focus_on_dialog')) {
43135						setTimeout(function(){
43136							jQuery(document).find('.vex-dialog-buttons .vex-dialog-button-primary').trigger('focus');
43137						}, 100);
43138					}
43139				}
43140			});
43141		} else {
43142			if (typeof js_CS_Config_check_if_product_in_cart !== 'undefined' && js_CS_Config_check_if_product_in_cart && elem.hasClass('has_variant') == false && elem.hasClass('minus') == false) {
43143				js_check_if_product_in_cart(product_id, params).then((response) => {
43144					if (response.data.message.isInCart) {
43145						let cofirmModal = new CsModal()
43146								.setClassName('product_in_cart_already')
43147								.setType('info')
43148								.setContent(response.data.message.confirm)
43149								.setButtons("<button type='button' class='confirm_button_is_in_cart'>"+ cms_js_lang_yes.toUpperCase() +"</button><button type='button' class='close_button'>"+ cms_js_lang_no.toUpperCase() +"</button>")
43150								.afterOpen(function () {
43151									jQuery('.confirm_button_is_in_cart').on('click', function () {
43152										cofirmModal.close();
43153										cart_update();
43154									});
43155								})
43156								.open();
43157					} else {
43158						cart_update();
43159					}
43160				});
43161			} else if (config('js_Config_exchange_product_in_cart') && elem.hasClass('minus') == false) {
43162				getProductToChange(product_id, params).then((response) => {
43163					let productForExchange = response.data.productForExchange;
43164					if (productForExchange && productForExchange.product_snapshot) {
43165						let productForExchangeModal = new CsModal()
43166							.setClassName('product_exchange_modal')
43167							.setType('info')
43168							.setTitle(productForExchange.title)
43169							.setContent(productForExchange.product_snapshot)
43170							.setButtons(productForExchange.buttons)
43171							.afterOpen(function () {
43172								jQuery('.product_exchange_modal button').on('click', function () {
43173									productForExchangeModal.close();
43174									if (jQuery(this).hasClass('close_button_product_exchange')) {
43175										cart_update();
43176									}
43177								});
43178							})
43179							.open();
43180					} else {
43181						cart_update();
43182					}
43183				});
43184			} else {
43185				cart_update();
43186			}
43187		}
43188
43189		return false;
43190	}
43191
43192	function js_init_fixed_ajax_cart() {
43193		var window_scroll_top = 0;
43194		if (navigator.userAgent.indexOf('MSIE') > -1) {
43195			window_scroll_top = parseInt(document.documentElement.scrollTop);
43196		} else {
43197			window_scroll_top = parseInt(window.pageYOffset);
43198		}
43199		if (typeof js_cart_css_obj === 'undefined') {
43200			return;
43201		}
43202		var js_cart_css_obj_top = js_cart_css_obj.top == 'auto' ? 0 : js_cart_css_obj.top;
43203		if (window_scroll_top > 0 && window_scroll_top > (js_cart_css_obj_top + 40)) {
43204			if (js_cart_css_scroll_obj.left == 'auto') {
43205				js_cart_css_scroll_obj.left = jQuery('.module-cart:first').offset().left; // fix palo 16.9. - v responzivite vyhadzovalo js chybu
43206				// js_cart_css_scroll_obj.left = jQuery('#topmenu .module-cart').offset().left;
43207			}
43208			jQuery('#topmenu .module-cart').addClass('scroll').css(js_cart_css_scroll_obj);
43209			jQuery(window)
43210				.on("scroll", function () {
43211					//#5795
43212					if (!jQuery('#topmenu .module-cart').hasClass('scroll')) {
43213						return;
43214					}
43215					jQuery('#topmenu .cart_ajax_container').slideUp(200, function () {
43216						jQuery('#topmenu .module-cart').removeClass('scroll').css(js_cart_css_obj);
43217					});
43218				});
43219		} else {
43220			jQuery('#topmenu .module-cart').removeClass('scroll').css(js_cart_css_obj);
43221		}
43222	}
43223	function js_add_to_cart_form_ajax_cart_bind() {
43224		jQuery('div.mp_discount_product_vals form, .wishlist_item_btns form, .product-cart form, .flypage-kosik form, .akcia-buttons form, .acc_item form, .compare_c
43224art form, .pretty_cart form, .custom_gifts form, .vig-addtocart form, .related_product_item_cart form').each(function (e) {
43225			var $form = jQuery(this);
43226			// SAKY MATRIX
43227			if (jQuery('.matrixQuantity').length > 0) {
43228				jQuery('.matrixControlQ .but')
43229					.off('click')
43230					.on('click', function () {
43231						var input             = jQuery(this).parents('td').find('.matrixQuantity');
43232						var matrixMaxQuantity = jQuery(this).closest('td').find('.matrixMaxQuantity').text();
43233						var inputVal          = input.val();
43234						if (jQuery(this).hasClass('plus')) {
43235							//ak je zapnuta kontrola skladu tak nedovol dat do kosika viac variantov ako je skladom
43236							if (parseInt(matrixMaxQuantity) > 0 && parseInt(matrixMaxQuantity) - 1 == parseInt(inputVal)) {
43237								//zmen farbu pluska (indikator, ze uz nie je mozne kupit viac kusov)
43238								input.val(parseInt(inputVal) + 1);
43239								jQuery(this).addClass('disabled-plus');
43240							} else if (parseInt(matrixMaxQuantity) > 0 && parseInt(matrixMaxQuantity) == parseInt(inputVal)) {
43241								//nepridavaj uz dalsie varianty
43242							} else {
43243								input.val(parseInt(inputVal) + 1);
43244							}
43245						} else {
43246							jQuery(this).closest('.matrixControlQ').find('.plus').removeClass('disabled-plus');
43247							if(inputVal > 0) input.val(inputVal - 1);
43248						}
43249					});
43250			}
43251
43252			if (is_cs_user()){
43253				$form.find('.categ_add_to_cart_not_on_stock')
43254					.off('click.ajaxcart')
43255					.on('click.ajaxcart', function (e) {
43256						if( e.preventDefault )
43257							e.preventDefault();
43258						jQuery(this).parents('form').trigger('submit');
43259					});
43260			} else {
43261				$form.find('.categ_add_to_cart_not_on_stock')
43262					.off('click')
43263					.on('click', function (e) {
43264						if( e.preventDefault )
43265							e.preventDefault();
43266						jQuery(this).parents('form').trigger('submit');
43267					});
43268			}
43269
43270			if (jQuery('.pp_pic_holder').length) {
43271				return;
43272			}
43273
43274			$form.off('submit').on('submit', function (e) {
43275
43276				// v detaile produktu ak nie je zvoleny variant, vykona sa klasicky submit, aby sa predislo vyskakovaniu modalneho okna
43277				// vynimka: ak je vyber variantu nepovinny (== 2), pokracuje AJAX flow
43278				if ( (typeof js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED === 'undefined' || js_global_VM_PRODUCT_ATTRIB_FIRST_OPTION_REQUIRED != 2) &&
43279					jQuery('.shop_page_class_shop_product_details').length && jQuery('.flypage1 .flypage-top select.main_attr_select').length &&
43280					jQuery('.flypage1 select.main_attr_select').filter(function() { return jQuery(this).val() == ''; }).length ) {
43281					return true;
43282				}
43283
43284				if(e.preventDefault) {
43285					e.preventDefault();
43286				}
43287
43288				var elem = this;
43289				var $elem = jQuery(this);
43290				var params = {};
43291
43292				// form submit disabled
43293				if ($elem.hasClass('disabled')) {
43294					return false;
43295				}
43296
43297				if ($elem.hasClass('custom_attribute_submit_error')) {
43298					$elem.removeClass('custom_attribute_submit_error');
43299					return false;
43300				}
43301
43302				var product_id = $elem.find('[name=product_id]').val();
43303				var quantity            = $elem.find('[name=quantity]').val();
43304				var $elemFlypage1Parents = $elem.parents('.flypage1');
43305				params.is_gift          = $elem.find('[name=is_gift]').val() == 1;
43306				params.is_special_offer = $elem.find('[name=is_special_offer]').val() == 1;
43307
43308				if ($elem.find('[name=product_availability]').length > 0) {
43309					params.product_availability = $elem.find('[name=product_availability]').val();
43310				}
43311
43312				if(!product_id) {
43313					product_id = $elemFlypage1Parents.find('[name=product_id]').val();
43314				}
43315
43316				if (!quantity) {
43317					quantity = $elemFlypage1Parents.find('[name=quantity]').val();
43318				}
43319
43320				// priplatkove produkty - add to cart
43321				var surchargeProducts = $elem.closest('.flypage-cart').find('div[data-surcharge-product-id]');
43322				if (surchargeProducts.length === 0) {
43323					surchargeProducts = $elem.closest('.flypage1').find('div[data-surcharge-product-id]');
43324				}
43325				params.hasSurchargeProducts = surchargeProducts.length > 0; // ak je false a v Backende mame priplatkove produkty tak sa zobrazi modalne okno s vyberom priplatkovych produktov
43326
43327				if (!params.hasSurchargeProducts || e.currentTarget.id.indexOf('_') !== -1) { // vex okno pre varianty
43328					surchargeProducts = $elem.closest('.vex').find('div[data-surcharge-product-id]');
43329					params.hasSurchargeProducts = surchargeProducts.length > 0;
43330				}
43331				if (surchargeProducts.length) {
43332					params.surchargeProducts = [];
43333					surchargeProducts.each(function () {
43334						var $this = jQuery(this);
43335						if ($this.find('div.surcharge_product_main_content input[type="checkbox"]:checked').length === 1) {
43336							params.surchargeProducts.push( parseInt($this.attr('data-surcharge-product-id')) );
43337						}
43338					});
43339					// surchargeProducts.parent().html('');
43340				}
43341
43342				// na server pojde aj udaj o predlzenej zaruke, pokial je zaskrtnuta
43343				if ($elem.find('[name=extended_warranty_product]:checked').length > 0) {
43344					params.extended_warranty_product = $elem.find('[name=extended_warranty_product]:checked').val();
43345				}
43346
43347				if (jQuery('input[name="special_product"]').length) {
43348					special_products_imploded = [];
43349					jQuery('input[name="special_product"]:checked').each(function (index, value) {
43350						special_products_imploded[index] = jQuery(this).val();
43351					});
43352					params.special_products = special_products_imploded.join(',');
43353				}
43354
43355				$select = $elem.find('.prod_adv_attrib_select select.main_attr_select');
43356				$advAttrRadio = $elem.find('.prod_adv_attrib_radio');
43357				$advAttrSelect = $elem.find('.prod_adv_attrib_select');
43358
43359				// 27.12.2018 - pato $elem.parents('.flypage-related') je zle lebo to neberie sibling ... ako asi niekto chcel  ($elem.parents('.flypage1').find('.flypage-related').length == 0)
43360				if ($elem.closest('.shop_addtocart_with_advanced_attributes').length && $elem.parents('.flypage-related').length == 0) {
43361					var $flypageElem = $elem.parents('.flypage1');
43362
43363					if ($advAttrSelect.length == 0) {
43364						tmp = $flypageElem.find('.prod_adv_attrib_select');
43365
43366						if (tmp.parents('.flypage-related').length == 0) {
43367							$advAttrSelect = tmp;
43368						}
43369					}
43370
43371					if ($advAttrSelect.length == 0 && $advAttrRadio.length == 0) {
43372						tmp = $flypageElem.find('.prod_adv_attrib_radio');
43373
43374						if (tmp.parents('.flypage-related').length == 0) {
43375							$advAttrRadio = tmp;
43376						}
43377					}
43378
43379					if ($advAttrSelect.length == 0 && $advAttrRadio.length == 0 && $select.length == 0) {
43380						tmp = $flypageElem.find('.prod_adv_attrib_select select.main_attr_select');
43381
43382						if (tmp.parents('.flypage-related').length == 0) {
43383							$select = tmp;
43384						}
43385					}
43386				}
43387
43388				if ($select.length > 0) {
43389					if ($select.hasClass('no_submit')) {
43390						return false;
43391					}
43392					if ($select.length > 1) {
43393						// old mode, more selectboxes
43394						params.select_name      = [];
43395						params.select_value     = [];
43396						params.more_select_mode = 1;
43397						$select.each(function () {
43398							params.select_name.push(jQuery(this).attr('name'));
43399							params.select_value.push(jQuery(this).val());
43400						});
43401					} else {
43402						// new mode, only 1 selectbox
43403						params.select_name  = $select.attr('name');
43404						params.select_value = $select.val();
43405					}
43406				} else if ($advAttrRadio.length > 0) {
43407					params.select_name = $advAttrRadio.find('input[type="radio"]:first').attr('name');
43408					params.select_value = $advAttrRadio.find('input[type="radio"]:checked').val();
43409				} else if ($advAttrSelect.find('select.main_attr_select:first').length > 0 || $advAttrSelect.find('input[name="attribute_select_mode"]').length) {
43410
43411					if ($advAttrSelect.length > 1) {
43412						// old mode, more selectboxes
43413						params.select_name      = [];
43414						params.select_value     = [];
43415						params.more_select_mode = 1;
43416						$advAttrSelect.each(function () {
43417							params.select_name.push(jQuery(this).find('select.main_attr_select:first').attr('name'));
43418							params.select_value.push(jQuery(this).find('select.main_attr_select:first').val());
43419						});
43420					} else {
43421						params.select_name = $advAttrSelect.find('select.main_attr_select:first').attr('name');
43422						params.select_value = $advAttrSelect.find('select.main_attr_select:first').val();
43423					}
43424				}
43425
43426				if (typeof product_id !== 'undefined' && typeof js_Config_product_variant !== 'undefined' && js_Config_product_variant && typeof window['ProductVariantInstance_' + product_id] !== 'undefined' && typeof window['ProductVariantInstance_' + product_id].getSelectedAttribute() !== 'undefined') {
43427
43428					params.select_name = 'faadd750a6fbb9ea11a94c6074db79144';
43429					params.select_value = window['ProductVariantInstance_' + product_id].getSelectedAttribute().source;
43430				}
43431
43432				if ( typeof js_Config_product_attachment !== 'undefined' && js_Config_product_attachment && typeof productAttachment !== 'undefined' && productAttachment != '' ) {
43433					params.product_attachment = productAttachment;
43434				}
43435
43436				if ( $elem.parents('.flypage1').find('.product-custom-attributes').length && typeof js_Config_vex_after_add_to_cart_skip_custom_attributes === 'undefined' ) {
43437
43438					if (typeof params.select_name == 'undefined') {
43439						params.select_name = [];
43440					} else if (typeof params.select_name == 'string') {
43441						params.select_name = [ params.select_name ];
43442					}
43443
43444					if (typeof params.select_value == 'undefined') {
43445						params.select_value = [];
43446					} else if (typeof params.select_value == 'string') {
43447						params.select_value = [ params.select_value ];
43448					}
43449
43450					$elem.parents('.flypage1').find('.product-custom-attribute .inputbox').each(function () {
43451						params.select_name.push(jQuery(this).attr('name'));
43452						params.select_value.push(jQuery(this).val());
43453					});
43454				}
43455
43456				if(params.select_value == "") delete params.select_value;
43457
43458				if ($elem.find('[name=gift_text]').length && jQuery.trim($elem.find('[name=gift_text]').val()) != '') {
43459					params.select_name      = 'faadd750a6fbb9ea11a94c6074db79144';
43460					params.select_value     = $elem.find('[name=gift_text]').val();
43461					params.forced_add       = 1;
43462					params.is_gift          = 1;
43463				}
43464
43465				// JAN nakupovanie v rozmeroch : pridanie parametrov do postu
43466				if ( $elem.find('[name=dim_a]').length > 0 && $elem.find('[name=dim_b]').length > 0) {
43467					params.dim_a = $elem.find('[name=dim_a]').val();
43468					params.dim_b = $elem.find('[name=dim_b]').val();
43469				}
43470				if ( $elem.find('[name=modify_cart_item]').length > 0 && $elem.find('[name=modify_cart_item]').val() != '') {
43471					params.modify_cart_item = $elem.find('[name=modify_cart_item]').val();
43472				}
43473				if ( $elem.find('[name=category_id]').length > 0 && $elem.find('[name=category_id]').val() != '' ) {
43474					params.category_id = $elem.find('[name=category_id]').val();
43475				}
43476
43477				// JAN doplnky produktu : pridanie parametrov do postu
43478				if ( $elem.find('.product_accessory_options').length > 0 ) {
43479					var accessories = [];
43480
43481					$elem.find('.product_accessory_options').find('.product_accessory_group_box:visible select').each(function(){
43482						var sel_box = jQuery(this);
43483						var box = sel_box.parents('.product_accessory_group_box');
43484						var sel_box_id = box.data('box');
43485
43486						sel_box.find('option:selected').each(function(){
43487							var acc_id = jQuery(this).val();
43488							var acc_field = jQuery('.custom_accessory_field_box.cafb_'+sel_box_id);
43489							if( acc_field.length > 0 && acc_field.is(':visible') ){
43490								var acc_pap_item = acc_field.find('.pap_item_'+acc_id);
43491								if( acc_pap_item.length > 0 && acc_pap_item.is(':visible') ){
43492									var acc_label_f = acc_pap_item.find('label').html();
43493									var acc_field_f = acc_pap_item.find('.product_accessory_param_'+acc_id).val();
43494									var acc_txt = acc_label_f + ': ' + acc_field_f;
43495									var acc_qty = (box.hasClass('quantity_add_check') ? quantity : '1');
43496									accessories.push( JSON.stringify({"id": acc_id,"qty": acc_qty,"custom"
43496: acc_txt}) );
43497								} else accessories.push( JSON.stringify({"id": acc_id}) );
43498							} else accessories.push( JSON.stringify({"id": acc_id}) );
43499						});
43500					});
43501					params.product_accessories = accessories.join(';');
43502				}
43503
43504				if (config('js_Config_product_group_package')) {
43505					let productGroupPackageRadio = jQuery('input[name="package"]:checked');
43506					if (productGroupPackageRadio.length > 0 && productGroupPackageRadio.val() === 'package') {
43507						params.is_group_package = true;
43508					}
43509				}
43510
43511
43512				if (quantity > 0) {
43513					// SAKY MATRIX
43514					if(jQuery('input.matrixQuantity').length > 0) {
43515						var mq = [];
43516						var mv = [];
43517
43518						jQuery('input.matrixQuantity').each(function() {
43519							var q = parseInt(jQuery(this).val());
43520
43521							if(q > 0) {
43522								mq.push(q);
43523								mv.push(jQuery(this).closest('td').find('input.matrixQuantityVal').val());
43524							}
43525						});
43526
43527						var i;
43528						params.matrix = true;
43529						for(i = 0; i < mq.length; i++) {
43530							params.select_value = mv[i];
43531							js_ajax_cart_update(elem, product_id, mq[i], params);
43532						}
43533
43534						return false;
43535					}
43536
43537					if(jQuery('#product_custom_shipping_district2').length && jQuery('#shipping_date').length){
43538
43539						if (jQuery.trim(jQuery('#product_custom_shipping_district2').val()) == '') {
43540							vex.dialog.alert({message:'Prosím vyberte miesto doručenia.'});
43541							return false;
43542						}
43543						params.delivery_district_and_date = jQuery('#product_custom_shipping_district2').val()+' - '+ jQuery('#shipping_date').val();
43544					}
43545
43546					// JAN dynamicke atributy
43547					if ($elem.find('.daf_wrap').length && typeof dattr === 'object' && typeof dattr.parseCart === 'function') {
43548						params.quantity = quantity;
43549						dattr.parseCart(params, function(result) {
43550
43551							if ( !result || jQuery.isEmptyObject(result) ) return false;
43552
43553							params = result;
43554							js_ajax_cart_update(elem, product_id, quantity, params);
43555						});
43556					} else {
43557
43558						js_ajax_cart_update(elem, product_id, quantity, params);
43559					}
43560				}
43561				return false;
43562			});
43563		});
43564	}
43565
43566	function js_cart_image_animate(elem) {
43567
43568		// disable animation for specific funcion
43569		if (typeof js_Config_modal_after_add_to_cart !== 'undefined') {
43570			return;
43571		}
43572
43573		elem = jQuery(elem);
43574
43575		if (elem.find('#addtocart').hasClass('custom_attribute_submit_error')) {
43576			elem.find('#addtocart').removeClass('custom_attribute_submit_error');
43577			return false;
43578		}
43579
43580		var product_img = null;
43581		var ajaxCartUpdate = localStorage.getItem('ajaxCartUpdateVariants');
43582		var variantImgSrc = null;
43583		var selectValue   = null;
43584		if (localStorage.getItem('selectedItemValue') != null) {
43585			selectValue = localStorage.getItem('selectedItemValue');
43586		}
43587		localStorage.removeItem('ajaxCartUpdateVariants');
43588		localStorage.removeItem('selectedItemValue');
43589		if (selectValue != null) {
43590			var attributes = selectValue.split('{');
43591			for (var i = 0; i < attributes.length; i++) {
43592				if (attributes[i].indexOf('IMG=') > -1) {
43593					variantImgSrc = attributes[i].substring(4, attributes[i].indexOf('}')); // attributes[i] = 'IMG=cesta/obrazka.jpg}'
43594					break;
43595				}
43596			}
43597		}
43598		if (variantImgSrc != null) {
43599			product_img = jQuery('<img src="' + window.js_global_skvelyweb_site + '/images/shop-active-images/' + variantImgSrc + '" alt="' + variantImgSrc + '">');
43600		} else {
43601			if (ajaxCartUpdate != null) {
43602				ajaxCartUpdate  = JSON.parse(ajaxCartUpdate);
43603				var imageSource = ajaxCartUpdate.image_source;
43604				product_img     = jQuery('<img src="' + imageSource + '" alt="' + imageSource + '">');
43605			}
43606		}
43607
43608		if (elem.parents('.related_product1:first, .related_product2:first, .related_product3:first').length > 0) {
43609			if (elem.parents('.related_product1:first, .related_product2:first, .related_product3:first').find('.featured-image-span:first img:first').length > 0) {
43610				product_img = elem.parents('.related_product1:first, .related_product2:first, .related_product3:first').find('.featured-image-span:first img:first');
43611			} else {
43612				product_img = elem.closest('.related_product1, .related_product2, .related_product3').find('.shop-cat-img a img');
43613			}
43614		} else if (elem.parents('.featured-prod:first').length > 0) {
43615			product_img = elem.parents('.featured-prod:first').find('.featured-image-span:first img:first, .shop-cat-img img.thumb:first');
43616		} else if (elem.parents('.shop-category-product:first').length > 0) {
43617			product_img = elem.parents('.shop-category-product:first').find('img.thumb:first');
43618		} else if (elem.parents('.acc_item:first').length > 0) {
43619			product_img = elem.parents('.acc_item:first').find('img:first');
43620		} else if (elem.parents('.article_product:first').length > 0) {
43621			product_img = elem.parents('.article_product:first').find('img:first');
43622		} else if (elem.parents('.article_product_listing:first').length > 0) {
43623			product_img = elem.parents('.article_product_listing:first').find('img:first');
43624		} else if (elem.parents('.flypage1:first').length > 0) {
43625			product_img = elem.parents('.flypage1:first').find('.flypage-image img.default_flypage_img');
43626
43627			if ((typeof js_Config_product_variant !== 'undefined') && (typeof js_Config_product_variant.options !== 'undefined') && (typeof js_Config_product_variant.options.table_data !== 'undefined') &&
43628				(jQuery.inArray('_IMAGE_', js_Config_product_variant.options.table_data) > -1)) {
43629				if (elem.parents('.flypage1:first').find('.prod_adv_attribs_div').find('tr.active').find('img').length > 0) {
43630					product_img = elem.parents('.flypage1:first').find('.prod_adv_attribs_div').find('tr.active').find('img');
43631				}
43632			}
43633			if ((typeof js_rotate_active_images_detail_data !== 'undefined') && (typeof js_rotate_active_images_detail_data._hideActiveImages !== 'undefined') && (js_rotate_active_images_detail_data._hideActiveImages == false)) {
43634				if (elem.parents('.flypage1:first').find('.flypage-slick-images').find('.slick-active img').length > 0) {
43635					product_img = elem.parents('.flypage1:first').find('.flypage-slick-images').find('.slick-active img');
43636				}
43637			}
43638
43639			if (!product_img.length) {
43640				const slickActiveImg = elem.parents('.flypage1:first').find('.flypage-slick-images .slick-active img');
43641				product_img = slickActiveImg.length ? slickActiveImg : product_img;
43642			}
43643
43644		} else if (elem.parents('.prod:first').length > 0) {	// comparing table
43645			product_img = elem.parents('.prod:first').find('.prod-img img');
43646		} else if (elem.closest('tr.product_item').length) {
43647			product_img = elem.closest('tr.product_item').find('img:first');
43648		}
43648 else if (elem.parents('.product_exchange_modal').find('img').length) {
43649			product_img = elem.parents('.product_exchange_modal').find('img');
43650		} else if (elem.parents('.module-latest-viewed-item').length) {
43651			product_img = elem.parents('.module-latest-viewed-item').find('.shop-cat-img').find('img');
43652		} else if (jQuery('.flypage-image img').length) {
43653			product_img = jQuery('.flypage-image img');
43654		} else if (elem.closest('.wishlist_item').length) {
43655			product_img = elem.closest('.wishlist_item').find('.wishlist_item_img img');
43656		} else if (elem.parents('.bl_product_cart_wrap:first').siblings('.bl_product_image_wrap').length) {
43657			product_img = elem.parents('.bl_product_cart_wrap:first').siblings('.bl_product_image_wrap').find('img');
43658		}
43659
43660		if (product_img != null && product_img.length) {
43661			// set fixed position for cart
43662			if (typeof ('js_cart_css_obj') != 'undefined' && jQuery('#topmenu .module-cart').length > 0) {
43663				js_init_fixed_ajax_cart();
43664			}
43665			var product_ajax_img = product_img.clone();
43666			var offset           = product_img.offset();
43667			if (elem.hasClass('vex-content')) {
43668				offset = elem.offset();
43669			}
43670			var $html = jQuery('html');
43671			product_ajax_img.addClass('ajax_image_animate');
43672			var cart_obj    = jQuery('.module_cont-cart .mainlevel, .module_cont-cart .moduleCartTop a, .module_cont-cart a.cartLink');
43673			var cart_offset = cart_obj.offset();
43674			var posX = offset.left;
43675			if ( elem.hasClass('vex-content') || !(typeof is_responsive !== 'undefined' && is_responsive()) ) {
43676				posX = offset.left + (elem.width() / 2);
43677			}
43678			var posY            = offset.top;
43679			var inHalfViewport = $html.scrollTop() > offset.top + product_img.height() / 2;
43680			var productImgWidth = product_img.width();
43681			var width           = $html.width() * 0.6;
43682			if (elem.hasClass('vex-content')) {
43683				if (productImgWidth == 0) {
43684					productImgWidth = 100;
43685				}
43686			}
43687			if (inHalfViewport) {
43688				product_ajax_img.css({width: (productImgWidth > width ? width : productImgWidth)});
43689				// zakomentovane na ziadost LM a MM
43690				// if (typeof is_responsive !== 'undefined' && is_responsive()) {
43691				// 	posX = 10;
43692				// }
43693				posY = $html.scrollTop() + 70;
43694			} else {
43695				product_ajax_img.css({width: productImgWidth});
43696			}
43697
43698			product_ajax_img.css({position: 'absolute', top: posY, left: posX});
43699			product_ajax_img
43700				.appendTo('body')
43701				.show()
43702				.css({'z-index' : 100002,
43703					'box-shadow':'0 0 3px 3px #e5e5e5', '-moz-box-shadow' : '0 0 3px 3px #e5e5e5', '-webkit-boxshadow' : '0 0 3px 3px #e5e5e5', 'width:': product_img.width(), height: product_img.height()})
43704				.animate({left:cart_offset.left + cart_obj.width() / 2, top: cart_offset.top + cart_obj.height() / 2, width:40, height:30}, 1000, 'easeInCirc', function () {
43705					product_ajax_img.remove();
43706				});
43707
43708		}
43709	}
43710
43711	function js_ajax_cart_flush(elem, extraSettings) {
43712		vex.dialog.confirm({
43713			message : js_lang_shopping_cart_empty_confirm,
43714			focusFirstInput: !config('js_Config_disable_focus_on_dialog'),
43715			callback: function (value) {
43716				if (value) {
43717					elem               = jQuery(elem);
43718					var ajax_container = elem.parent();
43719
43720					var ajax_items = jQuery(ajax_container).parents('.cart_ajax_container').find('.product_cont');
43721					if (ajax_items.length && typeof isApiActive !== 'undefined' && isApiActive) {
43722						var pageMatch = js_server_request_uri.match(/(&|;|\?)page\=([^&]+)/);
43723						var manMatch = js_server_request_uri.match(/(&|;|\?)pc_manufacturer_id\=([^&]+)/);
43724						var page = '';
43725
43726						if (typeof manMatch === 'object' && manMatch !== null) {
43727							page = 'manufacturer';
43728						} else if (typeof pageMatch === 'object' && pageMatch !== null && typeof pageMatch[2] !== 'undefined') {
43729							page = pageMatch[2];
43730						}
43731
43732						apiRequest('flushCart', {
43733							'page': page,
43734							'isAjax': true
43735						});
43736					}
43737
43738					var options = {'ajax_func': 'flush_ajax_cart'};
43739					ajax_container.startAjaxLoader();
43740
43741					jQuery.post('/modules/mod_shop_cart_ajax.php', options, function (ajax_res) {
43742						var result = JSON.parse(decodeURIComponent(ajax_res));
43743						js_cart_total = 0; //config_cart_total_js
43744						js_ajax_cart_container_init(result, 'flush');
43745
43746						if (typeof (js_ajax_cart_update_after_init) != 'undefined') {
43747							js_ajax_cart_update_after_init();
43748						}
43749						ajax_container.stopAjaxLoader();
43750
43751						if (typeof extraSettings !== 'undefined' && extraSettings.refreshAfterComplete !== 'undefined' && extraSettings.refreshAfterComplete) {
43752							window.location.reload();
43753						}
43754					});
43755
43756					// odstranenie ikoniek kosika s pridanym quantity (abenys)
43757					var amountDiv = jQuery('div.product_amount_in_cart_div');
43758					var amountSpan = amountDiv.find('span');
43759					if (amountSpan.length > 0) {
43760						amountSpan.text('');
43761						amountDiv.find('img').prop('src', '');
43762					}
43763
43764					if (typeof (js_ajax_cart_update_after_init) != 'undefined') {
43765						js_ajax_cart_update_after_init();
43766					}
43767
43768					// ecomail trackovanie obsahu kosika (len pre non cs)
43769					if(!is_cs_user() && typeof js_Config_ecomail_track_cart_content !== 'undefined') {
43770						//ziskame naformatovany obsah kosika
43771						new AjaxRequest()
43772							.setController('Cart')
43773							.setAction('getCartContentForEcomail')
43774							.onSuccess(function (result) {
43775
43776								//odosleme obsah kosika
43777								if (typeof window.ecotrack !== 'undefined' ) {
43778									window.ecotrack('trackUnstructEvent', {
43779										schema: '',
43780										data: {
43781											action: 'Basket',
43782											products: result.data
43783										}
43784									});
43785								}
43786								//console.log(result.data);
43787							})
43788							.send();
43789					}
43790				}
43791			},
43792			afterOpen: function () {
43793				if (!config('js_Config_disable_focus_on_dialog')) {
43794					setTimeout(function () {
43795						jQuery(document).find('.vex-dialog-buttons .vex-dialog-button-primary').trigger('focus');
43796					}, 100);
43797				}
43798			}
43799		});
43800		return false;
43801	}
43802
43803	function js_ajax_cart_container_init(result, action) {
43804		// Ak je sprava urcena pre messenger
43805		var res = typeof result.update_res === 'string' ? result.update_res.search('<div class="msg_wrap">') : '-1';
43806
43807		if (typeof(result.update_res) == 'string' && result.update_res.substr(1,3) == 'div' && res == '-1' ) {	// error message
43808			var jqo_message = jQuery('<div>'+result.update_res+'</div>');
43809			jqo_message.find('br:last').remove();
43810			jqo_message = jqo_message.children();
43811			jqo_message
43812				.css({width:500, position:'fixed', top:(jQuery(window).height() / 2 - 70), left:(jQuery(window).width() / 2 - 280), 'z-index':10001 })
43813				.hide();
43814			jQuery('body').append(jqo_message.fadeIn(1000));
43815			setTimeout(function () { jqo_message.fadeOut(1000, function () { jqo_message.remove(); }); }, 8000);
43816
43817		} else if (action == 'flush' || typeof(result.update_res) != 'undefined' && typeof(result.update_res.success) != 'undefined' && result.update_res.success == '1') {	// flush || update cart
43818			jQuery('.module-cart .module-cart-products, .module-cart .moduleCartInfo').html(result.html_cart_values);
43819
43820			if ( Cookies.get('gifts-h46L32i6u') !== undefined && Cookies.get('gifts-h46L32i6u') !== '' ) {
43821				if (typeof(js_gift_init) == 'function')
43822					js_gift_init();
43823			}
43824
43825			var new_ajax_content = jQuery('<div>'+result.html_products+'</div>').html();
43826			if (new_ajax_content != null && new_ajax_content != 'null') {
43827				if (jQuery('.module-cart .cart_ajax_container').length < 1)
43828					jQuery('.module-cart .module_cont-cart table').after(result.html_products);
43829				else {
43830					jQuery('.module-cart .cart_ajax_container').replaceWith(result.html_products);
43831
43832					if (typeof(result.method) != 'undefined') {
43833						jQuery('.module-cart .cart_ajax_container').stop().show();
43834						js_cart_link_update(); // cart link
43835						js_ajax_cart_container_events_init();
43836						// doprava zdarma
43837						if (typeof(js_freeshipping_init) == 'function')
43838							js_freeshipping_init();
43839
43840						if (typeof(js_gift_init) == 'function')
43841							js_gift_init();
43842
43843						if (typeof(js_product_as_gift_init) == 'function') {
43844							if (typeof js_CS_Config_product_as_gift_empty_stock !== 'undefined') {
43845								if (!(typeof js_Config_product_as_gift_disable != 'undefined' && js_Config_product_as_gift_disable) && !js_CS_Config_product_as_gift_empty_stock) {
43846									js_product_as_gift_init();
43847								}
43848							} else if (!(typeof js_Config_product_as_gift_disable != 'undefined' && js_Config_product_as_gift_disable)) {
43849								js_product_as_gift_init();
43850							}
43851						}
43852						if (typeof (js_ajax_cart_after_init) == 'function') {
43853							js_ajax_cart_after_init();
43854						}
43855						if (typeof (product_accessory_bind) == 'function') {
43856							product_accessory_bind();
43857						}
43858						return false;
43859					} else {
43860						setTimeout(function () {
43861							jQuery('.module-cart .cart_ajax_container').stop().slideDown(700);
43862						}, 500);
43863					}
43864				}
43865			} else
43866				jQuery('.module-cart .cart_ajax_container_inner').html('');
43867			jQuery('.module-cart .cart_ajax_container').stop().slideUp(50, 'easeOutExpo', function () { jQuery(this).removeClass('is_open'); });
43868		} else if(res == '-1'){
43869			if (typeof(console) != 'undefined') console.log('CART UPDATE ERROR2:', result);
43870		}
43871
43872		js_cart_link_update(); // cart link
43873		js_ajax_cart_container_events_init();
43874		js_refresh_extended_waranty();
43875		js_refresh_surcharge_products();
43876
43877		// doprava zdarma
43878		if (typeof(js_freeshipping_init) == 'function')
43879			js_freeshipping_init();
43880		if (typeof(js_gift_init) == 'function')
43881			js_gift_init();
43882
43883		if (typeof(js_ajax_cart_after_init) == 'function')
43884			js_ajax_cart_after_init();
43885
43886		if( typeof(product_accessory_bind) == 'function' ){
43887			product_accessory_bind();
43888		}
43889	}
43890
43891	/**
43892	 * @var futureAvailability {id: number, value: string}
43893	 * @param futureAvailability
43894	 */
43895	function js_refresh_product_availability_by_future_availability(futureAvailability) {
43896
43897		if (typeof futureAvailability == 'undefined' || futureAvailability == null || typeof futureAvailability.id == 'undefined' || futureAvailability.id == null) {
43898			return;
43899		}
43900
43901		let availElement = jQuery('.flypage1 .shop_product_availability_value:first');
43902		let newAvailClass = `attr_avail_${futureAvailability.id}`;
43903
43904		if ( availElement.length ) {
43905			if (!availElement.hasClass(newAvailClass) || availElement.text() !== futureAvailability.value) {
43906				// odoberieme povodne classy pre dostupnost
43907				jQuery(availElement).attr('class',
43908					jQuery(availElement).attr('class').split(" ").filter(c => !c.startsWith('attr_avail_')).join(" ").trim()
43909				);
43910				// priradime novu classu s novimy hodnotami
43911				availElement
43912					.addClass(newAvailClass)
43913					.attr('title', futureAvailability.value)
43914					.text(futureAvailability.value);
43915
43916				if ( typeof futureAvailability.description !== 'undefined' ) {
43917
43918					var availDescElement = availElement.parent().siblings('.flypage-avail-info').find('.shop_product_availability_value');
43919
43920					if ( availDescElement.length > 0 ) {
43921						if ( futureAvailability.description != '' ) {
43922							availDescElement.attr('data-description', futureAvailability.description).text(futureAvailability.description);
43923						} else {
43924							availDescElement.attr('data-description', '').text('');
43925						}
43926
43927					}
43928				}
43929			}
43930		}
43931
43932		jQuery('input[name="quantity"]').trigger('blur');
43933	}
43934
43935	function js_refresh_surcharge_products() {
43936		// overime ci sme na detaile produktu
43937		if (jQuery('.shop_page_class_shop_product_details').length) {
43938
43939			// console.log('CALLLED X')
43940
43941			var cart = jQuery('.flypage-kosik');
43942			var box = cart.find('div.surcharge_products_wrap');
43943			var productId = cart.find('input[name="product_id"]').val();
43944
43945			if (box.length && productId){
43946
43947				/*new AjaxRequest({
43948					productId: productId
43949				})
43950					.setController('Product')
43951					.setAction('getSurchargeProductsHtml')
43952					.onSuccess(function (jsonData) {
43953						if (jsonData && jsonData.data && jsonData.data.html) {
43954							box.replaceWith(jsonData.data.html);
43955						}
43956					})
43957					.send();*/
43958
43959			}
43960
43961		}
43962	}
43963
43964	function js_refresh_extended_waranty(){
43965
43966		if (jQuery('.shop_page_class_shop_product_details').length){
43967
43968			var cart = jQuery('.flypage-kosik');
43969			var box = cart.find('.extended_warranty_products');
43970
43971			if (box.length){
43972
43973				var options = { function: 'extended_waranty_products', product_id: cart.find('input[name="product_id"]').val() };
43974
43975				jQuery.post('/includes/frontend_ajax.php', options, function (res) {
43976
43977					var result = csJsonParse(res) || {};
43978
43979					if (typeof result.content !== 'undefined'){
43980						box.html(result.content);
43981						jQuery('input[name="extended_warranty_product"]:checked').data("chk", true);
43982						jQuery('input[name="extended_warranty_product"]').click(function () {
43983							jQuery('input[name="' + jQuery(this).attr('name') + '"]:radio').not(this).removeData("chk");
43984							jQuery(this).data("chk", !jQuery(this).data("chk"));
43985							jQuery(this).prop("checked", jQuery(this).data("chk"));
43986						});
43987					}
43988				});
43989			}
43990		}
43991	}
43992	function js_cart_link_update(){
43993		var moduleCartCount = jQuery('.module-cart-products .module-cart-count, .moduleCartInfo .module-cart-count');
43994
43995		if(jQuery('.moduleCartInfo').length > 0) {
43996			var link = jQuery('.module_cont-cart a.cartLink');
43997		} else {
43998			var link = jQuery('.module_cont-cart a:first');
43999		}
44000
44001		link.attr('onclick', typeof(js_cart_link_click) != 'undefined' && js_cart_link_click || moduleCartCount.length || (typeof(js_Config_show_empty_cart) != 'undefined' && js_Config_show_empty_cart == 1) ? 'return true' : 'return false');
44002		moduleCartCount.length ? jQuery('.cart_ajax_container, .module-cart').removeClass('empty') : jQuery('.cart_ajax_container, .module-cart').addClass('empty');
44003		if (typeof(js_Config_show_empty_cart) != 'undefined' && js_Config_show_empty_cart == 1) {
44004			if (moduleCartCount.length) {
44005				link.removeClass('show_empty');
44006			} else {
44007				link.addClass('show_empty');
44008			}
44009		}
44010
44011		if (typeof prof == 'object') prof.sortCart();
44012	}
44013
44014	//JB modifikácia pre varianty v riadkovom výpise
44015	//odstráni option zo selectu
44016	function refreshVariantSelect(elem, attr) {
44017		//zistíme všetky riadky ktoré sú vypísané a podľa nich upravíme options v selecte
44018		var wrapper = elem.closest('.product-variant-wrap');
44019		var newFinalAmount = 0;
44020
44021		if (typeof attr == 'string') {
44022			if (attr.includes(':')) {
44023				var option = elem.find('option[data-index="' + attr + '"]');
44024			} else {
44025				var option = elem.find('option[data-index=""]');
44026			}
44027			option.prop('disabled', !option.prop('disabled'));
44028			option.prop('selected', !option.prop('selected'));
44029
44030			//nakoľko nefunguje jquery toggle je prepínať viditeľnosť takto
44031			if (option.get(0).style.display === "none" || option.get(0).style.display === "" && jQuery.css( option.get(0), "display" ) === "none") {
44032				option.show();
44033			} else {
44034				option.hide();
44035			}
44036			if (elem.find('option:selected').length) {
44037				elem.closest('.product-chooser-wrap').show();
44038			} else {
44039				elem.closest('.product-chooser-wrap').hide();
44040			}
44041		}
44042		//zapísanie reálneho množstva do inputu
44043
44044		//---------------------------
44045
44046		//časť kódu upraví
44047		wrapper.find('input.variant-amount').each(function(){
44048			newFinalAmount += parseInt(jQuery(this).val());
44049		});
44050
44051		//newFinal value môže presahovať povolený limit
44052		var finalAmountInput = wrapper.closest('tr[class*=product_]').find('input.product_quantity');
44053
44054		finalAmountInput.attr('value',newFinalAmount);
44055
44056		//refreshneme input, aby nám vrátil reálnu hodnotu ->ako sa zachovať pri načítaní údajov
44057		js_change_quantity(finalAmountInput.get(0));
44058
44059	}
44060
44061	//vytvorí nám nový riadok vybraného variantu
44062	function lineAddVariant(elem) {
44063		elem = jQuery(elem);
44064		var select = elem.closest('.product-variant-wrap').find('select:first');
44065		var variant = select.find('option:selected');
44066
44067		if (variant.data('index') == '') {
44068			if (typeof js_browse_listing_choose_variant != 'undefined') {
44069				var tmpContent = js_browse_listing_choose_variant;
44070			}
44071
44072			variant.closest('select').tooltipster({
44073				theme        : 'tooltipster-noir',
44074				animation    : 'fade',
44075				delay        : 10,
44076				timer        : 1500,
44077				content      : tmpContent,
44078				functionAfter: function (instance) {
44079					instance.destroy();
44080				}
44081			}).tooltipster('open');
44082			return false;
44083
44084		}
44085
44086		var input = elem.closest('.product-variant-wrap').find('input[name=productVariantAmountTemplate]');
44087		var amount = input.val();
44088		input.val('');
44089
44090		// ak má variant vlastný Stock, ak nie tak v selecte bude údaj o množstve, musí sa sčítať všetko a zároveň amount, a povoliť maximálne
44091
44092		if (typeof variant.data('qty') != 'undefined' && variant.data('qty') > 0) {
44093			amount = (amount > variant.data('qty') ? variant.data('qty') : amount);
44094		} else {
44095			var finalAmount = elem.closest('.product-variant-wrap').data('qty');
44096			elem.closest('.product-variant-wrap').find('input[name="productVariantAmount"]').each(function(){
44097				finalAmount -= jQuery(this).val();
44098			});
44099			amount = (amount > finalAmount ? finalAmount : amount);
44100		}
44101
44102		if (!(amount > 0)) {
44103			input.addClass('error');
44104			if (input.parent().find('.stock_amount_error').length < 1) {
44105				input.after('<span class="stock_amount_error" style="color:red;">iba ' + ((typeof variant.data('qty') != 'undefined' && variant.data('qty')) ? variant.data('qty') : elem.closest('.product-variant-wrap').data('qty') ) + ' ks </span>');
44106			}
44107			return;
44108		} else {
44109			input.removeClass('error');
44110			input.parent().find('span.stock_amount_error').remove();
44111		}
44112
44113		var html = '<span class="selected-variant"><span class="variant-index" data-index="' + variant.data('index') + '" data-qty="' + variant.data('qty') + '">' + variant.html() + '</span><input style="width:20px;" class="variant-amount" type="text" name="productVariantAmount" value="' + amount + '"><span class="csi-check" onclick="lineChangeVariant(this)"></span><span class="csi-times" onclick="lineRemoveVariant(this)"></span></span>';
44114
44115		//todo: overovanie podľa {S} ?? ->ak nie je setnuté, čo robiť ?
44116
44117		select.closest('.product-variant-wrap').prepend(html);
44118		refreshVariantSelect(select, variant.data('index'));
44119	}
44120
44121	//zmení množstvo variantu
44122	function lineChangeVariant(elem) {
44123		//len zmenime hodnotu na danom riadku, po overení množstva
44124		elem = jQuery(elem);
44125
44126		var amount = elem.closest('span.selected-variant').find('input.variant-amount').val();
44127		var variant = elem.closest('span.selected-variant').find('span.variant-index');
44128		if (typeof variant.data('qty') != 'undefined' && variant.data('qty') > 0) {
44129			console.log('variant qty');
44130			amount = (amount > variant.data('qty') ? variant.data('qty') : amount);
44131		} else {
44132			var finalAmount = elem.closest('.product-variant-wrap').data('qty');
44133			elem.closest('.product-variant-wrap').find('input[name="productVariantAmount"]').each(function(){
44134
44135				//vo final amount je aj hodnota prave upraveného inputu, potrebujeme ju odčítať od final Amount a s tým pracovať ďalej
44136				finalAmount -= jQuery(this).val();
44137			});
44138			console.log('finalAmount',finalAmount);
44139			console.log('actualAmount',amount);
44140			console.log('shouldBeAmount',parseInt(amount) + parseInt(finalAmount));
44141			amount = (finalAmount < 0 ? parseInt(amount) + parseInt(finalAmount) : amount);
44142			console.log('realAmount',amount);
44143		}
44144		elem.closest('span.selected-variant').find('input.variant-amount').val(amount);
44145		refreshVariantSelect(elem);
44146	}
44147
44148	//odstáni riadok variantu
44149	function lineRemoveVariant(elem) {
44150		elem = jQuery(elem);
44151		var select = elem.closest('.product-variant-wrap').find('select:first');
44152
44153		var variant = elem.closest('span.selected-variant');
44154		var variantIndex = variant.find('span.variant-index').html();
44155		variant.remove();
44156
44157		refreshVariantSelect(select, variantIndex);
44158	}
44159
44160	function lineSubmit(elem) {
44161
44162		elem = jQuery(elem);
44163		elem.addClass('ajax-loader');
44164		var product = elem.closest('tr[class*=product_]');
44165		var addToCartList = {};
44166		if (product.find('input.product_quantity').val() < 1) {
44167			elem.removeClass('ajax-loader');
44168			return false;
44169		}
44170
44171		var productId = product.find('input[name="product_id"]').val();
44172		addToCartList[productId] = [];
44173
44174		if (product.find('span.selected-variant').length) {
44175			product.find('span.selected-variant').each(function() {
44176				var variantIndex = jQuery(this).find('span.variant-index');
44177				var variantAmount = jQuery(this).find('input.variant-amount');
44178				var tmpRow = {
44179					'variantIndex' : variantIndex.data('index'),
44180					'variantAmount' : variantAmount.val()
44181				};
44182
44183				addToCartList[productId].push(tmpRow);
44184			});
44185		} else {
44186			var tmpRow = {
44187				'variantAmount' : product.closest('tr[class*=product_]').find('input.product_quantity').val()
44188			};
44189
44190			addToCartList[productId].push(tmpRow);
44191		}
44192
44193		new AjaxRequest({'data': JSON.stringify(addToCartList)})
44194			.setMethod('POST')
44195			.setController('Product')
44196			.setAction('lineSubmitAll')
44197			.onSuccess(function(response){
44198				var html = response.data.html;
44199				elem.removeClass('ajax-loader');
44200				jQuery('.moduleCartInfo').html(html.html_cart_values);
44201				jQuery('.cart_ajax_container').replaceWith(html.html_products);
44202				jQuery('div.module-cart').removeClass('empty');
44203
44204				//custom uprava pre wiky, hromadná skladová zásoba pre varianty, preto upravujeme js hodnoty
44205
44206				lineReset(product);
44207			})
44208			.send();
44209		//toto tu je len kvoli hlúpej predošlej forme
44210		return false;
44211	}
44212
44213	function lineSubmitAll(elem) {
44214
44215		elem = jQuery(elem);
44216		elem.addClass('ajax-loader');
44217		var productWrap = elem.closest('#product_list');
44218
44219		var addToCartList = {};
44220
44221		//new product list code
44222		productWrap.find('tr[class*=product_]').each(function(){
44223
44224			if (jQuery(this).find('input.product_quantity').val() < 1) {
44225				return;
44226			}
44227
44228			var productId = jQuery(this).find('input[name="product_id"]').val();
44229			addToCartList[productId] = [];
44230
44231			if (jQuery(this).find('span.selected-variant').length) {
44232				jQuery(this).find('span.selected-variant').each(function() {
44233					var variantIndex = jQuery(this).find('span.variant-index');
44234					var variantAmount = jQuery(this).find('input.variant-amount');
44235					var tmpRow = {
44236						'variantIndex' : variantIndex.data('index'),
44237						'variantAmount' : variantAmount.val()
44238					};
44239
44240					addToCartList[productId].push(tmpRow);
44241				});
44242			} else {
44243				var tmpRow = {
44244					'variantAmount' : jQuery(this).closest('tr[class*=product_]').find('input.product_quantity').val()
44245				};
44246
44247				addToCartList[productId].push(tmpRow);
44248			}
44249			//resetovanie
44250		});
44251		if (JSON.stringify(addToCartList) == '{}') {
44252			elem.removeClass('ajax-loader');
44253			return false;
44254		}
44255
44256		new AjaxRequest({'data': JSON.stringify(addToCartList)})
44257			.setMethod('POST')
44258			.setController('Product')
44259			.setAction('lineSubmitAll')
44260			.onSuccess(function(response){
44261				var html = response.data.html;
44262				elem.removeClass('ajax-loader');
44263				jQuery('.moduleCartInfo').html(html.html_cart_values);
44264				jQuery('.cart_ajax_container').replaceWith(html.html_products);
44265				jQuery('div.module-cart').removeClass('empty');
44266
44267				var reset = jQuery('div.reset_all').find('.reset_all');
44268				lineResetAll(reset);
44269			})
44270			.send();
44271
44272
44273		//nájsť všetky inputy a vytiahnuť celkový objekt v ktorom budú IDčka -> attribúty
44274	}
44275
44276	function lineReset(elem) {
44277		//vstupom je tr ELEMENT
44278		elem = jQuery(elem);
44279
44280		if (elem.hasClass('product-has-attributes')) {
44281				//zmažeme všetky varianty a resetujeme select
44282
44283			elem.find('.stock_amount_error').remove();
44284			elem.find('.variant-amount-template').val('').removeClass('error');
44285
44286			elem.find('span.selected-variant').each(function(){
44287				jQuery(this).remove();
44288			});
44289
44290			elem.find('.product-chooser-wrap').show();
44291
44292			elem.find('option').each(function(){
44293				jQuery(this).show().prop('disabled',false);
44294			});
44295		}
44296
44297		//wiky custom úprava
44298		var value = elem.find('input.product_quantity').val();
44299		var oldValue = 0;
44300		if (elem.hasClass('product-has-attributes')) {
44301			oldValue = elem.find('.product-variant-wrap').data('qty');
44302			elem.find('.product-variant-wrap').data('qty', oldValue - value);
44303		} else {
44304			//možno prekomplikované, ale custom a rýchle
44305			oldValue = jQuery('div.productArrayAsInputHiddenBlock div#product_' + elem.find('input[name=product_id]').val()).find('input[name=product_in_stock]').val();
44306			jQuery('div.productArrayAsInputHiddenBlock div#product_' + elem.find('input[name=product_id]').val()).find('input[name=product_in_stock]').val(oldValue-value);
44307		}
44308
44309		elem.find('span.info-value').html(oldValue-value);
44310		//koniec custom úpravy
44311		elem.find('input.product_quantity').val(0);
44312	}
44313
44314	function lineResetAll(elem) {
44315		if (!is_cs_user('separate_js')) {
44316			jQuery('.product_quantity').val('0').change();
44317		}
44318		//najideálnejšie by bolo spraviť refresh stránky
44319		jQuery('div#product_list').find('tr[class*=product_]').each(function() {
44320			lineReset(this);
44321		});
44322		jQuery('#price_all').html(0);
44323		//len kvoli forme
44324		return false;
44325	}
44326
44327	function getProductToChange(productId, params) {
44328
44329		return	new AjaxRequest({productId: productId, params: params})
44330					.setMethod('POST')
44331					.setController('Product')
44332					.setAction('getProductToChange')
44333					.onSuccess(function (response) {
44334						return response;
44335					}).send();
44336	}
44337
44338	function js_check_if_product_in_cart(productId, params) {
44339
44340		return	new AjaxRequest({productId: productId, params: params})
44341					.setMethod('POST')
44342					.setController('ProductInCart')
44343					.setAction('productInCartCheck')
44344					.onSuccess(function (response) {
44345						return response;
44346					}).send();
44347	}
44348}
44349
44350
44351/* ========================================
44352 FILE: /includes/js/system/AjaxRequest.js
44353 ==================== */
44354
44355/**
44356 * @fileOverview AjaxRequest class
44357 * @name AjaxRequest (/includes/js/system/AjaxRequest.js)
44358 * @author Martin Hucko <[email protected]>
44359 * @version 1.0.0
44360 * @requires jQuery
44361 */
44362
44363/**
44364 * @class AjaxRequest
44365 * @classdesc Basic AJAX request class
44366 * @constructor
44367 *
44368 * @param {Object} [data = {}]
44369 *
44370 * @returns {AjaxRequest}
44371 */
44372var AjaxRequest = function (data) {
44373
44374	/**
44375	 * @member {String} [AjaxRequest#url = '/includes/ajax_handle.php'] - Request URL
44376	 */
44377	this.url = '/includes/ajax_handle.php';
44378
44379	/**
44380	 * @member {Object} [AjaxRequest#data = {}] - Ajax data
44381	 */
44382	this.data = data || {};
44383
44384	/**
44385	 * @member {String} [AjaxRequest#method = 'GET'] - Ajax method (POST | GET | PUT | ...)
44386	 */
44387	this.method = 'GET';
44388
44389	/**
44390	 * @member {Number} [AjaxRequest#timeout = 0] - Ajax timeout in [ms]
44391	 */
44392	this.timeout = 0;
44393
44394	/**
44395	 * @member {Object.<String, String>} [AjaxRequest#headers = {}] - Ajax headers
44396	 */
44397	this.headers = {};
44398
44399	/**
44400	 * @member {Boolean} [AjaxRequest#cache = true]
44401	 */
44402	this.cache = true;
44403
44404	/**
44405	 * @member {String} [AjaxRequest#dataType = 'json']
44406	 */
44407	this.dataType = 'json';
44408
44409	/**
44410	 * @member {Boolean} [AjaxRequest#ignore = false]
44411	 */
44412	this.ignore = false;
44413
44414	/**
44415	 * @member {Function} AjaxRequest#successCallback
44416	 * @see AjaxRequest.prototype.send
44417	 */
44418	this.successCallback = null;
44419
44420	/**
44421	 * @member {Function} AjaxRequest#errorCallback
44422	 * @see AjaxRequest.prototype.send
44423	 */
44424	this.errorCallback = null;
44425
44426	/**
44427	 * @member {Function} AjaxRequest#ajaxFailCallback
44428	 * @see AjaxRequest.prototype.send
44429	 */
44430	this.ajaxFailCallback = null;
44431
44432	/**
44433	 * @member {Function} AjaxRequest#completeCallback
44434	 * @see AjaxRequest.prototype.send
44435	 */
44436	this.completeCallback = null;
44437
44438	/**
44439	 * @member {Boolean} [AjaxRequest#isExternal = false] - Provided url is external
44440	 */
44441	this.isExternal = false;
44442
44443	/**
44444	 * @member {Boolean} [AjaxRequest#async = true]
44445	 */
44446	this.async = true;
44447
44448	/**
44449	 * @member {Object} [AjaxRequest#localData = {}]
44450	 * @property {String} [AjaxRequest#localData.controller = 'Front']
44451	 * @property {String} [AjaxRequest#localData.action = 'order.index']
44452	 */
44453	this.localData = {};
44454
44455	this.setLocalData(this.data);
44456
44457	if (typeof js_CS_Config_csrf !== 'undefined' && js_CS_Config_csrf && typeof js_CS_Config_csrf_header !== 'undefined' && js_CS_Config_csrf_header) {
44458		this.addHeader(js_CS_Config_csrf_header, jQuery('meta[name="csrf-token"]').attr('content'));
44459	}
44460
44461	this.nonCF = false;
44462
44463	this.autoRedirectOn403 = true;
44464
44465
44466	return this;
44467};
44468
44469/**
44470 * jQuery.ajax()
44471 *   - success
44472 *     - response is JSON
44473 *       - jsonData.success -> successCallback(jsonData, textStatus, jqXHR);
44474 *       - !jsonData.success
44475 *         - errorCallback provided -> errorCallback(jsonData, textStatus, jqXHR);
44476 *         - errorCallback not provided
44477 *           - jsonData.error provided -> vex.dialog.alert(jsonData.error);
44478 *           - jsonData.error not provided -> vex.dialog.alert(cms_js_lang_content_alert_1); // Unknown error.
44479 *     - response is something else -> errorCallback(data, textStatus, jqXHR);
44480 *   - error
44481 *     - ajaxFailCallback provided -> ajaxFailCallback(jqXHR, textStatus, errorThrown);
44482 *     - ajaxFailCallback not provided -> vex.dialog.alert(cms_js_lang_content_alert_1); // Unknown error.
44483 *   - complete -> completeCallback(jqXHR, textStatus);
44484 *
44485 * @method AjaxRequest.prototype.send
44486 * @return {jqXHR}
44487 */
44488AjaxRequest.prototype.send = function () {
44489	return jQuery.ajax({
44490		url: this.getParsedUrl(),
44491		data: this.getParsedData(),
44492		type: this.method,
44493
44494		cache: this.cache,
44495		async: this.isAsync(),
44496		dataType: this.dataType,
44497		timeout: this.timeout,
44498		headers: this.headers,
44499		success: jQuery.proxy(this.handleResponse, this),
44500		error: jQuery.proxy(this.handleError, this),
44501		complete: jQuery.proxy(this.handleComplete, this)
44502	});
44503};
44504
44505/**
44506 * @method AjaxRequest.prototype.handleResponse
44507 * @param {Object} data
44508 * @param {String} textStatus
44509 * @param {Object} jqXHR
44510 */
44511AjaxRequest.prototype.handleResponse = function (data, textStatus, jqXHR) {
44512	if (this.ignore) {
44513		if (typeof this.successCallback === 'function') {
44514			this.successCallback(data, textStatus, jqXHR);
44515		}
44516
44517		return;
44518	}
44519
44520	if (this.dataType === 'json') {
44521		this.handleJsonResponse(data, textStatus, jqXHR);
44522	} else if (typeof this.successCallback === 'function') {
44523		this.successCallback(data, textStatus, jqXHR);
44524	}
44525};
44526
44527/**
44528 * @method AjaxRequest.prototype.handleJsonResponse
44529 * @param {Object} data
44530 * @param {String} textStatus
44531 * @param {Object} jqXHR
44532 */
44533AjaxRequest.prototype.handleJsonResponse = function (data, textStatus, jqXHR) {
44534	var errorString;
44535
44536	try {
44537		jsonData = data;
44538
44539		this.handleModal(jsonData);
44540
44541		if (jsonData.success) {
44542			if (typeof this.successCallback === 'function') {
44543				this.successCallback(jsonData, textStatus, jqXHR);
44544			}
44545
44546			return;
44547		}
44548
44549		if (typeof this.errorCallback === 'function') {
44550			this.errorCallback(jsonData, textStatus, jqXHR);
44551
44552			return;
44553		}
44554
44555		errorString = this.getResponseErrors(jsonData).map(function (error) {
44556			return '<li>' + error + '</li>';
44557		}).join('');
44558
44559		vex.dialog.alert('<ul style="list-style: none; padding: 0; margin: 0;">' + errorString + '</ul>');
44560	} catch (exception) {
44561		if (typeof this.errorCallback === 'function') {
44562			this.errorCallback(data, textStatus, jqXHR);
44563		}
44564
44565		if (is_cs_user()) {
44566			console.log(exception);
44567		}
44568	}
44569};
44570
44571/**
44572 * @method AjaxRequest.prototype.handleError
44573 * @param {Object} jqXHR
44574 * @param {String} textStatus
44575 * @param {Object} errorThrown
44576 */
44577AjaxRequest.prototype.handleError = function (jqXHR, textStatus, errorThrown) {
44578
44579	if (jqXHR.status === 403 && this.autoRedirectOn403) {
44580		window.location.href = typeof js_global_live_site !== 'undefined' ? js_global_live_site : '/';
44581		return;
44582	}
44583
44584	// Firefox nastavuje status na 0 a statusText na `error` ked ideme inam
44585	// chrome nezavola error teda handleError
44586	if (jqXHR.status === 0 && (!errorThrown || errorThrown === '')) {
44587		return;
44588	}
44589
44590	if (typeof this.ajaxFailCallback === 'function') {
44591		this.ajaxFailCallback(jqXHR, textStatus, errorThrown);
44592
44593		return;
44594	}
44595
44596	if (!this.ignore) {
44597		vex.dialog.alert(cms_js_lang_content_alert_1);
44598	}
44599};
44600
44601/**
44602 * @method AjaxRequest.prototype.handleComplete
44603 * @param {Object} jqXHR
44604 * @param {String} textStatus
44605 */
44606AjaxRequest.prototype.handleComplete = function (jqXHR, textStatus) {
44607	if (typeof this.completeCallback === 'function') {
44608		this.completeCallback(jqXHR, textStatus);
44609	}
44610
44611	this.showNotifications(jqXHR);
44612};
44613
44614/**
44615 *
44616 * @param {Object} data
44617 * @returns {jQuery|null}
44618 */
44619AjaxRequest.prototype.handleModal = function (data) {
44620	if (data.modal && data.body) {
44621		return vex.dialog.alert(data.body);
44622	}
44623
44624	return null;
44625};
44626
44627/**
44628 * @method AjaxRequest.prototype.getResponseErrors
44629 * @param {Object} data
44630 * @return {String[]}
44631 */
44632AjaxRequest.prototype.getResponseErrors = function (data) {
44633	if (data.errors && data.errors.length) {
44634		return data.errors;
44635	}
44636
44637	return [cms_js_lang_content_alert_1];
44638};
44639
44640/**
44641 * @method AjaxRequest.prototype.getParsedUrl
44642 * @return {String}
44643 */
44644AjaxRequest.prototype.getParsedUrl = function () {
44645	var url = this.url;
44646
44647	if (this.isExternal) {
44648		return url;
44649	}
44650
44651	if (typeof url === 'undefined' || url === null) {
44652		return js_global_live_site + '/index3.php?' + this.serialize(this.localData);
44653	}
44654
44655	return url;
44656};
44657
44658/**
44659 * @method AjaxRequest.prototype.getParsedData
44660 * @return {Object}
44661 */
44662AjaxRequest.prototype.getParsedData = function () {
44663	return jQuery.extend(true, {}, {
44664		no_css: 1,
44665		no_html: 1,
44666		no_vm_html: 1,
44667		no_menu: 1,
44668		ajax_call: 2
44669	}, this.localData, this.data);
44670};
44671
44672/**
44673 * @method AjaxRequest.prototype.serialize
44674 * @param {Object} data
44675 * @param {String} [prefix = '']
44676 * @return {String}
44677 */
44678AjaxRequest.prototype.serialize = function (data, prefix) {
44679	var parts = [];
44680	var property, key, value, part;
44681
44682	for (property in data) {
44683		if (data.hasOwnProperty(property)) {
44684			key = prefix ? prefix + '[' + property + ']' : property;
44685			value = data[property];
44686			part = (value !== null && typeof value === 'object') ?
44687				this.serialize(value, property) :
44688				encodeURIComponent(key) + '=' + encodeURIComponent(value);
44689
44690			parts.push(part);
44691		}
44692	}
44693
44694	return parts.join('&');
44695};
44696
44697/**
44698 * @method AjaxRequest.prototype.isUrlExternal
44699 * @param {String} [url = this.url]
44700 * @return {Boolean}
44701 */
44702AjaxRequest.prototype.isUrlExternal = function (url) {
44703	var domainRe = /https?:\/\/((?:[\w\d-]+\.)+[\w\d]{2,})/i;
44704	var domain = function (urlInner) {
44705		return domainRe.exec(urlInner)[1];
44706	};
44707
44708	return domain(location.href) !== domain(url || this.url);
44709};
44710
44711/**
44712 * @method AjaxRequest.prototype.setUrl
44713 * @param {String} url
44714 * @return {AjaxRequest}
44715 */
44716AjaxRequest.prototype.setUrl = function (url) {
44717	this.url = url;
44718	this.isExternal = this.isUrlExternal();
44719
44720	return this;
44721};
44722
44723/**
44724 * @method AjaxRequest.prototype.setData
44725 * @param {Object} data
44726 * @return {AjaxRequest}
44727 */
44728AjaxRequest.prototype.setData = function (data) {
44729	this.data = data;
44730
44731	return this;
44732};
44733
44734/**
44735 * @method AjaxRequest.prototype.setMethod
44736 * @param {String} method
44737 * @return {AjaxRequest}
44738 */
44739AjaxRequest.prototype.setMethod = function (method) {
44740	this.method = method;
44741
44742	return this;
44743};
44744
44745/**
44746 * @method AjaxRequest.prototype.setTimeout
44747 * @param {Number} timeout
44748 * @return {AjaxRequest}
44749 */
44750AjaxRequest.prototype.setTimeout = function (timeout) {
44751	this.timeout = parseInt(timeout);
44752
44753	return this;
44754};
44755
44756/**
44757 * @method AjaxRequest.prototype.setHeaders
44758 * @param {Object} headers
44759 * @return {AjaxRequest}
44760 */
44761AjaxRequest.prototype.setHeaders = function (headers) {
44762	this.headers = headers;
44763
44764	return this;
44765};
44766
44767/**
44768 * @method AjaxRequest.prototype.addHeader
44769 * @param {String} name
44770 * @param {String} header
44771 * @return {AjaxRequest}
44772 */
44773AjaxRequest.prototype.addHeader = function (name, header) {
44774	this.headers[name] = header;
44775
44776	return this;
44777};
44778
44779/**
44780 * @method AjaxRequest.prototype.setCache
44781 * @param {Boolean} cache
44782 * @return {AjaxRequest}
44783 */
44784AjaxRequest.prototype.setCache = function (cache) {
44785	this.cache = cache;
44786
44787	return this;
44788};
44789
44790/**
44791 * @method AjaxRequest.prototype.setDataType
44792 * @param {String} dataType
44793 * @return {AjaxRequest}
44794 */
44795AjaxRequest.prototype.setDataType = function (dataType) {
44796	this.dataType = dataType;
44797
44798	return this;
44799};
44800
44801/**
44802 * @method AjaxRequest.prototype.addCallback
44803 * @param {String} type
44804 * @param {Function} callback
44805 * @return {AjaxRequest}
44806 */
44807AjaxRequest.prototype.after = function (type, callback) {
44808	switch (type) {
44809		case 'success':
44810			return this.onSuccess(callback);
44811
44812		case 'error':
44813			return this.onError(callback);
44814
44815		case 'ajaxFail':
44816			return this.onAjaxFail(callback);
44817
44818		case 'complete':
44819			return this.onComplete(callback);
44820
44821		default:
44822			return this;
44823	}
44824};
44825
44826/**
44827 * @method AjaxRequest.prototype.onSuccess
44828 * @param {Function} callback
44829 * @return {AjaxRequest}
44830 */
44831AjaxRequest.prototype.onSuccess = function (callback) {
44832	this.successCallback = callback;
44833
44834	return this;
44835};
44836
44837/**
44838 * @method AjaxRequest.prototype.onError
44839 * @param {Function} callback
44840 * @return {AjaxRequest}
44841 */
44842AjaxRequest.prototype.onError = function (callback) {
44843	this.errorCallback = callback;
44844
44845	return this;
44846};
44847
44848/**
44849 * @method AjaxRequest.prototype.onAjaxFail
44850 * @param {Function} callback
44851 * @return {AjaxRequest}
44852 */
44853AjaxRequest.prototype.onAjaxFail = function (callback) {
44854	this.ajaxFailCallback = callback;
44855
44856	return this;
44857};
44858
44859/**
44860 * @method AjaxRequest.prototype.onComplete
44861 * @param {Function} callback
44862 * @return {AjaxRequest}
44863 */
44864AjaxRequest.prototype.onComplete = function (callback) {
44865	this.completeCallback = callback;
44866
44867	return this;
44868};
44869
44870/**
44871 * @method AjaxRequest.prototype.isExternal
44872 * @returns {Boolean|AjaxRequest}
44873 */
44874
44875/**
44876 * @method AjaxRequest.prototype.isExternal
44877 * @param {Boolean} isExternal
44878 * @return {AjaxRequest}
44879 */
44880AjaxRequest.prototype.isExternal = function (isExternal) {
44881	if (typeof isExternal === 'undefined' || isExternal === null) {
44882		return this.isExternal;
44883	}
44884
44885	this.isExternal = isExternal;
44886
44887	return this;
44888};
44889
44890/**
44891 * @method AjaxRequest.prototype.isAsync
44892 * @param {Boolean} [isAsync]
44893 * @returns {Boolean|AjaxRequest}
44894 */
44895AjaxRequest.prototype.isAsync = function (isAsync) {
44896	if (typeof isAsync === 'undefined' || isAsync === null) {
44897		return this.async;
44898	}
44899
44900	this.async = isAsync;
44901
44902	return this;
44903};
44904
44905/**
44906 *
44907 * @param {Boolean} async
44908 * @return {AjaxRequest}
44909 */
44910AjaxRequest.prototype.setAsync = function (async) {
44911	this.async = async;
44912
44913	return this;
44914};
44915
44916/**
44917 * @method AjaxRequest.prototype.setLocalData
44918 * @param {Object} data
44919 * @param {String} data.controller
44920 * @param {String} data.action
44921 * @returns {AjaxRequest}
44922 */
44923AjaxRequest.prototype.setLocalData = function (data) {
44924	if (typeof data !== 'object') {
44925		return this;
44926	}
44927
44928	if (data.hasOwnProperty('_type')) {
44929		this.setType(data._type);
44930	}
44931
44932	if (data.hasOwnProperty('controller')) {
44933		this.setController(data.controller);
44934	}
44935
44936	if (data.hasOwnProperty('action')) {
44937		this.setAction(data.action);
44938	}
44939
44940	return this;
44941};
44942
44943/**
44944 * @param {'admin'|'frontend'} [type='frontend'] type
44945 * @returns {AjaxRequest}
44946 */
44947AjaxRequest.prototype.setType = function (type = 'frontend') {
44948	this.localData._type = type;
44949
44950	return this;
44951}
44952
44953/**
44954 * @method AjaxRequest.prototype.setAutoRedirectOn403
44955 * @param {Boolean} autoRedirect
44956 * @return {AjaxRequest}
44957 */
44958AjaxRequest.prototype.setAutoRedirectOn403 = function (autoRedirect) {
44959	this.autoRedirectOn403 = autoRedirect;
44960
44961	return this;
44962};
44963
44964/**
44965 * @method AjaxRequest.prototype.setController
44966 * @param {String} controller
44967 * @return {AjaxRequest}
44968 */
44969AjaxRequest.prototype.setController = function (controller) {
44970	this.localData.controller = controller;
44971
44972	return this;
44973};
44974
44975/**
44976 * @method AjaxRequest.prototype.setAction
44977 * @param {String} action
44978 * @return {AjaxRequest}
44979 */
44980AjaxRequest.prototype.setAction = function (action) {
44981	this.localData.action = action;
44982
44983	return this;
44984};
44985
44986AjaxRequest.prototype.setNonCF = function () {
44987	this.nonCF = true;
44988
44989	return this;
44990};
44991
44992/**
44993 * @method AjaxRequest.prototype.ignoreDefault
44994 * @param {Boolean} [ignore = true]
44995 * @return {AjaxRequest}
44996 */
44997AjaxRequest.prototype.ignoreDefault = function (ignore) {
44998	this.ignore = typeof ignore === 'undefined' ? true : ignore;
44999
45000	return this;
45001};
45002
45003AjaxRequest.prototype.showNotifications = function (jqXHR) {
45004	try {
45005		if (typeof jqXHR !== 'object' || typeof jqXHR.responseText !== 'string') {
45006			return this;
45007		}
45008
45009		var response = JSON.parse(jqXHR.responseText);
45010
45011		if (
45012			typeof response === 'object' &&
45013			typeof response.notifications === 'object' &&
45014			typeof showNotificationsFromList === 'function' &&
45015			typeof localStorage === 'object' &&
45016			localStorage.getItem('NotificationsAfterReload') === null
45017		) {
45018			showNotificationsFromList(response.notifications);
45019		}
45020	} catch (e) {
45021		console.warn('Problem while showing notifications', e);
45022	}
45023
45024	return this;
45025};
45026
45027AjaxRequest.prototype.scheduleNotifications = function (notifications) {
45028	try {
45029		if (typeof notifications === 'object' && typeof localStorage === 'object') {
45030			localStorage.setItem('NotificationsAfterReload', JSON.stringify(notifications));
45031		}
45032	} catch (e) {
45033		console.warn('Problem while scheduling notifications', e);
45034	}
45035
45036	return this;
45037};
45038
45039
45040/* ========================================
45041 FILE: /includes/js/advanced_banner_functions.js
45042 ==================== */
45043
45044function getAdvancedBannerData(module_id) {
45045	result = {};
45046	if (typeof jQuery('.mp_id' + module_id).data('advancedBannerData') !== 'undefined') {
45047		result = jQuery('.mp_id' + module_id).data('advancedBannerData');
45048	}
45049	return result;
45050}
45051
45052function isOneTimeUseAdvancedBanner(bannerId) {
45053	var moduleData = getAdvancedBannerData(bannerId);
45054	var params = moduleData.params;
45055	var match = params.match(/one_time_use=(\d)/);
45056	return ( match !== null && match[1] != null && parseInt(match[1]) === 1 );
45057}
45058
45059function isMouseLeave(bannerId) {
45060	var moduleData = getAdvancedBannerData(bannerId);
45061	var params = moduleData.params;
45062	var match = params.match(/mouseleave=(\d)/);
45063	return ( match !== null && match[1] != null && parseInt(match[1]) === 1 );
45064}
45065
45066function isLeaveFromSite(bannerId) {
45067	var moduleData = getAdvancedBannerData(bannerId);
45068	var params = moduleData.params;
45069	var match = params.match(/siteleave=(\d)/);
45070	return ( match !== null && match[1] != null && parseInt(match[1]) === 1 );
45071}
45072
45073function getAdvancedBannerHash(bannerId) {
45074	var moduleData = getAdvancedBannerData(bannerId);
45075
45076	if (typeof moduleData.content !== 'undefined') {
45077		return bannerId + moduleData.content.length;
45078	} else {
45079		return bannerId;
45080	}
45081}
45082
45083function iAmInBackend() {
45084	return ( jQuery('body').hasClass('admin_content') || location.pathname.match(/^\/administrator/) !== null );
45085}
45086
45087function getAdvancedBannerList() {
45088	var bannerList = JSON.parse(Cookies.get('advanced_banner_closed'));
45089	return (bannerList !== null && bannerList.length) ? bannerList : [];
45090}
45091
45092function advancedBannerAlreadySeen(bannerId) {
45093	var moduleData = getAdvancedBannerData(bannerId);
45094	var myCookie = 'advanced_banner_closed_' + bannerId;
45095	if (typeof (moduleData.geoip_request) != 'undefined' && moduleData.geoip_request != '') {
45096		myCookie += '_' + moduleData.page;
45097	}
45098	myCookie = Cookies.get(myCookie);
45099	var result = ( typeof myCookie !== 'undefined' && myCookie !== null && myCookie == getAdvancedBannerHash(bannerId) );
45100	return result;
45101}
45102
45103function advancedBannerOutOfTimeRange(bannerId) {
45104	var result = true;
45105	var moduleData = getAdvancedBannerData(bannerId);
45106	if (typeof moduleData.params !== 'undefined') {
45107		var matches = moduleData.params.match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/g);
45108		if (matches.length == 2) {
45109			var dateFrom = new Date(matches[0].replace(' ', 'T')) /1000;
45110			var dateTo = new Date(matches[1].replace(' ', 'T')) /1000;
45111			//dateFrom.setHours(dateFrom.getUTCHours());
45112			//dateTo.setHours(dateTo.getUTCHours());
45113			var now = new Date()/1000;
45114		}
45115		result = ( now < dateFrom || now > dateTo );
45116	}
45117	return result;
45118}
45119
45120function initAdvancedBanner(module_id, show) {
45121	//RB -> 5.10.2020 Zakomentoval som pretoze modul nikdy nenainicialozoval a tym padom sa nedal upravovat.
45122	/*if (iAmInBackend()) {
45123		return false;
45124	}*/
45125
45126	var module_class = '.mp_id' + module_id;
45127	var moduleData = getAdvancedBannerData(module_id);
45128	var module = jQuery(module_class);
45129	var respo_limit = (typeof(advanced_banner_respo) !== 'undefined' && advanced_banner_respo);
45130
45131	if ( ( respo_limit || jQuery(window).width() > 1023 ) && !jQuery(module_class + " .advanced_module_cont").length) {
45132		jQuery(module_class + " div[class*=module_cont_]" ).append('<div class="advanced_module_cont" />');
45133		var advancedBannerContent = jQuery(module_class + " .advanced_module_cont");
45134		advancedBannerContent.html(moduleData.content);
45135
45136		if (module.length < 1 || advancedBannerAlreadySeen(module_id) || !advancedBannerContent.html().length || advancedBannerOutOfTimeRange(module_id))
45137			return false;
45138		if(!isMouseLeave(module_id)) {
45139			setTimeout(function () {
45140				if (show) showAdvancedBanner(module_id);
45141			}, 300);
45142		} else {
45143			var counter = 0;
45144			jQuery(window).on('mouseleave',function() {
45145				if(counter == 0 ) {
45146					if (show) showAdvancedBanner(module_id);
45147				}
45148				 counter++;
45149			});
45150		}
45151	}
45152}
45153
45154function isConfirmEnabled(bannerId) {
45155	var moduleData = getAdvancedBannerData(bannerId);
45156	var params = moduleData.params;
45157	var match = params.match(/confirm=(\d)/);
45158
45159	return ( match !== null && match[1] != null && parseInt(match[1]) === 1 );
45160}
45161
45162function redirectOnNo(bannerId) {
45163	var moduleData = getAdvancedBannerData(bannerId);
45164	var params = moduleData.params;
45165	var match = params.match(/^url=(.*)/gm);
45166	window.location.assign(match[0].split('=')[1]);
45167}
45168
45169function showAdvancedBanner(module_id) {
45170	module_class = '.mp_id' + module_id;
45171	var moduleData = getAdvancedBannerData(module_id);
45172	var module = jQuery(module_class);
45173
45174	var vexInput = moduleData.content;
45175	vexInput += '<div class="cleaner"><!-- &nbsp; --></div>';
45176
45177	let bannerConfirmButtonStyles = ' style="color: #fff; background-color: #44c767; border: 1px solid #18ab29; float:none; margin-left: 0;"';
45178	let bannerCancelButtonStyles = ' style="color: #fff; background-color: #d0451b; border: 1px solid #942911; float: none; margin-left: .5em;"';
45179	if (typeof js_CS_Config_reklamneOkno_disable_default_styles !== 'undefined' && js_CS_Config_reklamneOkno_disable_default_styles) {
45180		bannerConfirmButtonStyles = '';
45181		bannerCancelButtonStyles = '';
45182	}
45183	let bannerConfirmButton = '<input' + bannerConfirmButtonStyles + ' class="bannerConfirmButton vex-dialog-button-primary vex-dialog-button vex-first" type="submit" onclick="advancedBannerClose(' + module_id + ')" value="' + cms_js_lang_yes_C + '"/>';
45184	let bannerCancelButton = '<input' + bannerCancelButtonStyles + ' class="bannerCancelButton vex-dialog-button-secondary vex-dialog-button vex-last" type="button" onclick="redirectOnNo(' + module_id + ')" value="' + cms_js_lang_no_C + '"/>';
45185	if (typeof js_CS_Config_change_input_to_button !== 'undefined' && js_CS_Config_change_input_to_button) {
45186		bannerConfirmButton = '<button' + bannerConfirmButtonStyles + ' class="bannerConfirmButton vex-dialog-button-primary vex-dialog-button vex-first" type="submit" onclick="advancedBannerClose(' + module_id + ')">' + cms_js_lang_yes_C + '</button>';
45187		bannerCancelButton = '<button' + bannerCancelButtonStyles + ' class="bannerCancelButton vex-dialog-button-secondary vex-dialog-button vex-last" type="button" onclick="redirectOnNo(' + module_id + ')">' + cms_js_lang_no_C + '</button>';
45188	}
45189
45190	let bannerButtonsDivStyles = ' style="text-align: center;"';
45191	if (typeof js_CS_Config_reklamneOkno_disable_default_styles !== 'undefined' && js_CS_Config_reklamneOkno_disable_default_styles) {
45192		bannerButtonsDivStyles = '';
45193	}
45194	var vexButtons = (isConfirmEnabled(module_id)) ? [
45195			'<div class="vex-dialog-buttons"' + bannerButtonsDivStyles + '>',
45196			bannerConfirmButton,
45197			bannerCancelButton,
45198			'</div>'
45199		].join('') : '';
45200
45201	if (typeof (moduleData.geoip_request) != 'undefined' && moduleData.geoip_request != '') {
45202		vexButtons = [
45203			'<div class="vex-dialog-buttons">',
45204			'<a class="vex-dialog-button-primary vex-dialog-button vex-first" onclick="advancedBannerClose(' + module_id + ');" href="' + moduleData.geoip_request+'">' + cms_js_lang_content_modules_redirect + '</a>',
45205			'<a class="bannerCancelButton vex-dialog-button-secondary vex-dialog-button vex-last" href="javascript:void(0)" onclick="advancedBannerClose(' + module_id + ')">'+cms_js_lang_content_modules_cancel + '</a>',
45206			'</div>'
45207		].join('');
45208
45209		if (vexInput.indexOf('geoip_redirect') >= 0) {
45210			vexInput = vexInput.replace('geoip_redirect', moduleData.geoip_request);
45211			vexButtons = [
45212				'<div class="vex-dialog-buttons">',
45213				'<a class="bannerCancelButton vex-dialog-button-secondary vex-dialog-button vex-last" href="javascript:void(0)" onclick="advancedBannerClose(' + module_id + ')">'+cms_js_lang_content_modules_cancel+'</a>',
45214				'</div>'
45215			].join('');
45216		}
45217	}
45218
45219	if ( typeof (moduleData.disable_buttons) != 'undefined' && moduleData.disable_buttons == true ) {
45220		vexButtons = '';
45221	}
45222
45223	var contentClasses = ['vex-content', 'vex-adv-banner', 'vex-module-' + module_id];
45224	var containsText = false;
45225
45226	jQuery(moduleData.content).add(jQuery(moduleData.content).find('*')).each(function () {
45227		if (jQuery(this).text().trim() != '') {
45228			containsText = true;
45229			return false;
45230		}
45231	});
45232
45233	if (!containsText) {
45234		contentClasses.push('vex-no-border');
45235	}
45236
45237	moduleDataParams = moduleData.params.split(/\r|\n/);
45238	moduleDataParams = splitArrayToKeyValue(moduleDataParams, '=');
45239	if (moduleDataParams.delay == null) {
45240		moduleDataParams.delay = 10;
45241	}
45242		setTimeout(function () {
45243			vex.open({
45244				showCloseButton: !isConfirmEnabled(module_id),
45245				overlayClosesOnClick: !isConfirmEnabled(module_id),
45246				contentClassName: contentClasses.join(' '),
45247				content: [
45248					'<form class="vex-dialog-form">',
45249					'<div class="vex-dialog-input">',
45250					vexInput,
45251					'</div>',
45252					vexButtons,
45253					'</form>'
45254				].join(''),
45255				afterOpen: function () {
45256					if ( typeof (moduleData.custom_href) != 'undefined' && moduleData.custom_href == true ) {
45257						var vexLinks = jQuery('.vex-content li');
45258						vexLinks.on('click', 'a', function (e){
45259							e.preventDefault();
45260						});
45261					}
45262				},
45263				beforeClose: function () {
45264					if ( typeof (moduleData.disable_close) != 'undefined' && moduleData.disable_close == true ) {
45265						return false;
45266					}
45267				},
45268				afterClose: function () {
45269					if ( typeof (moduleData.custom_href) != 'undefined' && moduleData.custom_href == true ) {
45270						advancedBannerCloseCustom(module_id);
45271					} else {
45272						advancedBannerClose(module_id);
45273					}
45274				}
45275			});
45276
45277		}, moduleDataParams.delay);
45278}
45279
45280function advancedBannerClose(bannerId) {
45281	var moduleData = getAdvancedBannerData(bannerId);
45282	var params = (isOneTimeUseAdvancedBanner(bannerId)) ? {expires: 31, path: '/'} : {path: '/'};
45283	var vexContent = jQuery('.vex-content.vex-module-'+ bannerId);
45284	var myCookie = 'advanced_banner_closed_' + bannerId;
45285	if (typeof (moduleData.geoip_request) != 'undefined' && moduleData.geoip_request != '') {
45286		myCookie += '_' + moduleData.page;
45287		params = {expires: moduleData.geoip_days, path: '/'};
45288		if ( typeof (moduleData.geoip_minutes) != 'undefined' ) {
45289			params.expires = 1 / (1440 / moduleData.geoip_minutes);
45290			console.log(params);
45291		}
45292	}
45293
45294	if ( typeof(js_Config_advanced_banner_show_always) == 'undefined' ||
45295		 js_Config_advanced_banner_show_always != 1 ||
45296		 (typeof (moduleData.geoip_request) != 'undefined' && moduleData.geoip_request != '')
45297	) {
45298		Cookies.set(myCookie, getAdvancedBannerHash(bannerId), params);
45299	}
45300
45301	if (vexContent.length > 0) {
45302		vex.close(vexContent.data().vex.id);
45303	}
45304
45305	return false;
45306}
45307
45308function advancedBannerCloseCustom(bannerId, bannerLink) {
45309	var moduleData = getAdvancedBannerData(bannerId);
45310	var params = (isOneTimeUseAdvancedBanner(bannerId)) ? {expires: 31, path: '/'} : {path: '/'};
45311	var vexContent = jQuery('.vex-content.vex-module-'+ bannerId);
45312	var myCookie = 'advanced_banner_closed_' + bannerId;
45313	if (typeof (moduleData.geoip_request) != 'undefined' && moduleData.geoip_request != '') {
45314		myCookie += '_' + moduleData.page;
45315		params = {expires: moduleData.geoip_days, path: '/'};
45316		if ( typeof (moduleData.geoip_minutes) != 'undefined' ) {
45317			params.expires = 1 / (1440 / moduleData.geoip_minutes);
45318			console.log(params);
45319		}
45320	}
45321	if ( typeof(js_Config_advanced_banner_show_always) == 'undefined' ||
45322		js_Config_advanced_banner_show_always != 1 ||
45323		(typeof (moduleData.geoip_request) != 'undefined' && moduleData.geoip_request != '')
45324	) {
45325		Cookies.set(myCookie, getAdvancedBannerHash(bannerId), params);
45326	}
45327
45328	if (vexContent.length > 0) {
45329		vex.close(vexContent.data().vex.id);
45330		if (bannerLink) {
45331			window.location.href = bannerLink;
45332		}
45333	}
45334	return false;
45335}
45336
45337
45338/* ========================================
45339 FILE: /modules/js/mod_vm_product_watch.js
45340 ==================== */
45341
45342jQuery(function () {
45343	var product_watch_unfollow_key = location.search.split('unfollow_watched_product=')[1];
45344	if (typeof product_watch_unfollow_key != 'undefined') {
45345		showLoader();
45346		new AjaxRequest({'unfollow_key': product_watch_unfollow_key})
45347			.setController("User")
45348			.setAction('unfollowWatchedProduct')
45349			.onSuccess(function (jsonData) {
45350				hideLoader();
45351				if (jsonData.data.success === 1) {
45352					var vexText = js_lang_product_watch_unfollow_confirm_msg || 'Boli ste úspešne odhlásený zo sledovania produktu';
45353
45354					vex.dialog.open({
45355						className: 'vex-cs watchdog-vex',
45356						message: '',
45357						input: vexText,
45358						buttons: [jQuery.extend({}, vex.dialog.buttons.YES)],
45359						afterClose: function () {
45360							if ( typeof script_manage_params_ismyid !== 'undefined' && script_manage_params_ismyid) {
45361								window.location = js_global_live_site + '/sprava-uctu/';
45362							} else {
45363								window.location = js_global_live_site;
45364							}
45365						}
45366					});
45367				} else {
45368					alert(js_lang_product_watch_unfollow_error_msg);
45369				}
45370			})
45371			.send();
45372	}
45373});
45374
45375/* ========================================
45376 FILE: /includes/js/system/Modal.js
45377 ==================== */
45378
45379/**
45380 * Modal Class
45381 *
45382 * @author TL
45383 * @type {CsModal}
45384 */
45385var CsModal = (
45386	/**
45387	 *
45388	 * @param modalPlugin {object}
45389	 * @returns {Modal}
45390	 */
45391	function(modalPlugin) {
45392		'use strict';
45393
45394		/**
45395		 * Plugin
45396		 * @type {vex}
45397		 */
45398		var PLUGIN = modalPlugin;
45399
45400		/**
45401		 * Default class for all modal windows
45402		 * @type {string}
45403		 */
45404		var MODAL_DEFAULT_CLASSNAME = 'cs_modal';
45405
45406		/**
45407		 * Default class for overlay element
45408		 * @type {string}
45409		 */
45410		var MODAL_OVERLAY_CLASSNAME = 'cs_modal_overlay';
45411
45412		/**
45413		 * Default class for heading element
45414		 * @type {string}
45415		 */
45416		var MODAL_HEADING_CLASSNAME = 'cs_modal_heading';
45417
45418		/**
45419		 * Default class for content element
45420		 * @type {string}
45421		 */
45422		var MODAL_CONTENT_CLASSNAME = 'cs_modal_content';
45423
45424		/**
45425		 * Default class for content inner element
45426		 * @type {string}
45427		 */
45428		var MODAL_CONTENT_INNER_CLASSNAME = 'cs_modal_content_inner';
45429
45430		/**
45431		 * Default class for actions container element
45432		 * @type {string}
45433		 */
45434		var MODAL_ACTIONS_CLASSNAME = 'cs_modal_actions';
45435
45436		/**
45437		 * Default class for close button
45438		 * @type {string}
45439		 */
45440		var MODAL_CLOSE_CLASSNAME = 'cs_modal_close';
45441
45442		/**
45443		 * Default class for cancel button
45444		 * @type {string}
45445		 */
45446		var MODAL_CANCEL_CLASSNAME = 'close_button';
45447
45448		/**
45449		 * Default class for cancel button
45450		 * @type {string}
45451		 */
45452		var MODAL_SUBMIT_CLASSNAME = 'submit_button';
45453
45454		/**
45455		 * Allowed types [info, warning, error, confirm, prompt]
45456		 * @type {object}
45457		 */
45458		var ALLOWED_TYPES = {
45459			info: 'info',
45460			warning: 'warning',
45461			error: 'error',
45462			confirm: 'confirm',
45463			prompt: 'prompt'
45464		};
45465
45466		var listOfCsModals = new WeakMap();
45467
45468		/**
45469		 *
45470		 * @constructor
45471		 */
45472		function Modal() {
45473			this.plugin = PLUGIN;
45474			this.id = 0;
45475			this.modal = null;
45476			this.hideEmptyContent = false;
45477			this.options = {
45478				type: 'alert',
45479				className: MODAL_DEFAULT_CLASSNAME,
45480				overlayClassName: MODAL_OVERLAY_CLASSNAME,
45481				contentClassName: MODAL_CONTENT_CLASSNAME,
45482				actionsClassName: MODAL_ACTIONS_CLASSNAME,
45483				closeClassName: MODAL_CLOSE_CLASSNAME,
45484				message: ''
45485			};
45486			this.passDataToOnSubmit = false; /* TODO neskor dat na true */
45487
45488			return this;
45489		}
45490
45491		/**
45492		 * Sets type of modal window (info, warning, error, confirm, prompt)
45493		 *
45494		 * @param type {string}
45495		 * @returns {Modal}
45496		 */
45497		Modal.prototype.setType = function(type) {
45498			if ( !_isString(type) ) {
45499				throw new TypeError('Argument must be a String');
45500			}
45501
45502			if ( !_isAllowedType(type) ) {
45503				throw new Error('This type is not allowed');
45504			}
45505
45506			switch (type) {
45507				case 'info':
45508				case 'warning':
45509				case 'error':
45510					this.options.type = 'alert';
45511					break;
45512				default:
45513					this.options.type = type;
45514					break;
45515			}
45516
45517			this.setClassName('type_' + type);
45518
45519			return this;
45520		};
45521
45522		Modal.prototype.removeClass = function(className) {
45523			if ( !_isString(className) ) {
45524				throw new TypeError('Argument must be a String');
45525			}
45526
45527			if ( _isModalInitialized(this.id) ) {
45528				this.modal.removeClass(className);
45529			} else {
45530				throw new TypeError('removeClass should not be called on init');
45531			}
45532
45533			return this;
45534		};
45535
45536		/**
45537		 * Sets classes for modal window
45538		 *
45539		 * @param className {string}
45540		 * @returns {Modal}
45541		 */
45542		Modal.prototype.setClassName = function(className) {
45543			if ( !_isString(className) ) {
45544				throw new TypeError('Argument must be a String');
45545			}
45546
45547			if ( _isModalInitialized(this.id) ) {
45548				this.modal.addClass(className);
45549			} else {
45550				this.options.className = this.options.className + ' ' + className;
45551			}
45552
45553			return this;
45554		};
45555
45556		/**
45557		 * Sets classes for modal content element
45558		 *
45559		 * @param className {string}
45560		 * @returns {Modal}
45561		 */
45562		Modal.prototype.setContentClassName = function(className) {
45563			if ( !_isString(className) ) {
45564				throw new TypeError('Argument must be a String');
45565			}
45566
45567			if ( _isModalInitialized(this.id) ) {
45568				this.modal.find('.' + MODAL_CONTENT_CLASSNAME).addClass(className);
45569			} else {
45570				this.options.contentClassName = this.options.contentClassName + ' ' + className;
45571			}
45572
45573			return this;
45574		};
45575
45576		/**
45577		 * Sets classes for modal actions container element
45578		 *
45579		 * @param className
45580		 * @returns {Modal}
45581		 */
45582		Modal.prototype.setActionsClassName = function (className) {
45583			if ( !_isString(className) ) {
45584				throw new TypeError('Argument must be a String');
45585			}
45586
45587			if ( _isModalInitialized(this.id) ) {
45588				this.modal.find('.' + MODAL_ACTIONS_CLASSNAME).addClass(className);
45589			} else {
45590				this.options.actionsClassName = this.options.actionsClassName + ' ' + className;
45591			}
45592
45593			return this;
45594		};
45595
45596		/**
45597		 * Sets icon of modal window
45598		 *
45599		 * @param icon {string}
45600		 * @returns {Modal}
45601		 */
45602		Modal.prototype.setIcon = function(icon) {
45603			if ( !_isString(icon) ) {
45604				throw new TypeError('Argument must be a String');
45605			}
45606
45607			if ( _isModalInitialized(this.id) ) {
45608				// TODO
45609				//this.modal.find('.' + MODAL_CONTENT_CLASSNAME).addClass(className);
45610			} else {
45611				this.options.icon = icon;
45612			}
45613
45614			return this;
45615		};
45616		/**
45617		 * Sets title of modal window
45618		 *
45619		 * @param title {string}
45620		 * @returns {Modal}
45621		 */
45622		Modal.prototype.setTitle = function(title) {
45623			if ( !_isString(title) ) {
45624				throw new TypeError('Argument must be a String');
45625			}
45626
45627			if ( _isModalInitialized(this.id) ) {
45628				this.modal.find('.' + MODAL_HEADING_CLASSNAME + ' .title').addClass(title);
45629			} else {
45630				this.options.message = title;
45631			}
45632
45633			return this;
45634		};
45635
45636		/**
45637		 * Sets subtitle of modal window
45638		 *
45639		 * @param subtitle {string}
45640		 * @returns {Modal}
45641		 */
45642		Modal.prototype.setSubtitle = function(subtitle) {
45643			if ( !_isString(subtitle) ) {
45644				throw new TypeError('Argument must be a String');
45645			}
45646
45647			if ( _isModalInitialized(this.id) ) {
45648				this.modal.find('.' + MODAL_HEADING_CLASSNAME + ' .subtitle').addClass(subtitle);
45649			} else {
45650				this.options.subtitle = subtitle;
45651			}
45652
45653			return this;
45654		};
45655
45656		/**
45657		 * Sets content of modal window
45658		 *
45659		 * @param content {string}
45660		 * @returns {Modal}
45661		 */
45662		Modal.prototype.setContent = function(content) {
45663			if ( !_isString(content) ) {
45664				throw new TypeError('Argument must be a String');
45665			}
45666
45667			if ( _isModalInitialized(this.id) ) {
45668				this.modal.find('.' + MODAL_CONTENT_INNER_CLASSNAME).html(content);
45669
45670				if (typeof this.options.afterSetContentFn === 'function' ) { // nahradit za _isFunction(this.options.afterSetContentFn) ?
45671					this.options.afterSetContentFn(this.modal);
45672				}
45673
45674			} else {
45675				this.options.input = content;
45676			}
45677
45678			return this;
45679		};
45680
45681		Modal.prototype.afterSetContent = function (fn) {
45682			if ( !_isFunction(fn) ) {
45683				throw new TypeError('Argument must be a Function');
45684			}
45685
45686			this.options.afterSetContentFn = fn;
45687
45688			return this;
45689		};
45690
45691		/**
45692		 * Sets langs/texts for modal buttons
45693		 *
45694		 * @param buttons {string[]}
45695		 * @returns {Modal}
45696		 */
45697		Modal.prototype.setButtonTexts = function(buttons) {
45698			if ( !_isArray(buttons) ) {
45699				throw new TypeError('Argument must be an Array');
45700			}
45701
45702			this.options.buttons = buttons;
45703
45704			return this;
45705		};
45706
45707		/**
45708		 * Sets custom buttons for modal window as a html string
45709		 *
45710		 * @param buttons {string}
45711		 * @returns {Modal}
45712		 */
45713		Modal.prototype.setButtons = function(buttons) {
45714			if ( !_isString(buttons) ) {
45715				throw new TypeError('Argument must be a HTML string');
45716			}
45717
45718			this.options.buttons = buttons;
45719
45720			return this;
45721		};
45722
45723		/**
45724		 * Sets initial value for prompt modal
45725		 *
45726		 * @param value {string}
45727		 * @returns {Modal}
45728		 */
45729		Modal.prototype.setPromptValue = function(value) {
45730			if ( !_isString(value) ) {
45731				throw new TypeError('Argument must be a String');
45732			}
45733
45734			this.options.value = value;
45735
45736			return this;
45737		};
45738
45739		/**
45740		 * Sets placeholder value for prompt modal
45741		 *
45742		 * @param placeholder {string}
45743		 * @returns {Modal}
45744		 */
45745		Modal.prototype.setPromptPlaceholder = function(placeholder) {
45746			if ( !_isString(placeholder) ) {
45747				throw new TypeError('Argument must be a String');
45748			}
45749
45750			this.options.placeholder = placeholder;
45751
45752			return this;
45753		};
45754
45755		/**
45756		 * Shows close button
45757		 *
45758		 * @param bool {boolean}
45759		 * @returns {Modal}
45760		 */
45761		Modal.prototype.hideCloseButton = function(bool) {
45762			var hideBtn = bool;
45763
45764			if ( typeof hideBtn === 'undefined' ) {
45765				hideBtn = true;
45766			}
45767
45768			if ( !_isBool(hideBtn) ) {
45769				throw new TypeError('Argument must be a Boolean');
45770			}
45771
45772			this.options.showCloseButton = !hideBtn;
45773
45774			return this;
45775		};
45776
45777		/**
45778		 * Hides empty content or title
45779		 *
45780		 * @param bool {boolean}
45781		 * @returns {Modal}
45782		 */
45783		Modal.prototype.hideEmptySpace = function(bool) {
45784			var hideEmptySpace = bool;
45785
45786			if ( typeof hideEmptySpace === 'undefined' ) {
45787				hideEmptySpace = true;
45788			}
45789
45790			if ( !_isBool(hideEmptySpace) ) {
45791				throw new TypeError('Argument must be a Boolean');
45792			}
45793
45794			this.hideEmptyContent = hideEmptySpace;
45795
45796			return this;
45797		};
45798
45799		/**
45800		 * Disables pressing escape key to close modal
45801		 *
45802		 * @param bool {boolean}
45803		 * @returns {Modal}
45804		 */
45805		Modal.prototype.disableEscapeKey = function(bool) {
45806			var disableEscape = bool;
45807
45808			if ( typeof disableEscape === 'undefined' ) {
45809				disableEscape = true;
45810			}
45811
45812			if ( !_isBool(disableEscape) ) {
45813				throw new TypeError('Argument must be a Boolean');
45814			}
45815
45816			this.options.escapeButtonCloses = !disableEscape;
45817
45818			return this;
45819		};
45820
45821		/**
45822		 * Disables clicking on overlay/backdrop to close modal
45823		 *
45824		 * @param bool {boolean}
45825		 * @returns {Modal}
45826		 */
45827		Modal.prototype.disableClickOnOverlay = function(bool) {
45828			var disableClickOnOverlay = bool;
45829
45830			if ( typeof disableClickOnOverlay === 'undefined' ) {
45831				disableClickOnOverlay = true;
45832			}
45833
45834			if ( !_isBool(disableClickOnOverlay) ) {
45835				throw new TypeError('Argument must be a Boolean');
45836			}
45837
45838			this.options.overlayClosesOnClick = !disableClickOnOverlay;
45839
45840			return this;
45841		};
45842
45843		/**
45844		 * @callback callbackFunction
45845		 */
45846
45847		/**
45848		 * Sets callback function that is called after opening the modal
45849		 *
45850		 * @param fn {callbackFunction}
45851		 * @returns {Modal}
45852		 */
45853		Modal.prototype.afterOpen = function(fn) {
45854			if ( !_isFunction(fn) ) {
45855				throw new TypeError('Argument must be a Function');
45856			}
45857
45858			this.options.afterOpen = fn;
45859
45860			return this;
45861		};
45862
45863		/**
45864		 * Sets callback function that is called before closing the modal, but after callback function is called
45865		 *
45866		 * @param fn {callbackFunction}
45867		 * @returns {Modal}
45868		 */
45869		Modal.prototype.beforeClose = function(fn) {
45870			if ( !_isFunction(fn) ) {
45871				throw new TypeError('Argument must be a Function');
45872			}
45873
45874			this.options.beforeClose = fn;
45875
45876			return this;
45877		};
45878
45879		/**
45880		 * Sets callback function that is called after closing the modal
45881		 *
45882		 * @param fn {callbackFunction}
45883		 * @returns {Modal}
45884		 */
45885		Modal.prototype.afterClose = function(fn) {
45886			if ( !_isFunction(fn) ) {
45887				throw new TypeError('Argument must be a Function');
45888			}
45889
45890			this.options.afterClose = fn;
45891
45892			return this;
45893		};
45894
45895		/**
45896		 * Sets callback function that is called on submitting the modal
45897		 *
45898		 * @param fn {callbackFunction}
45899		 * @returns {Modal}
45900		 */
45901		Modal.prototype.onSubmit = function(fn) {
45902			if ( !_isFunction(fn) ) {
45903				throw new TypeError('Argument must be a Function');
45904			}
45905
45906			this.options.onSubmit = fn;
45907
45908			return this;
45909		};
45910
45911		Modal.prototype.setPassDataToOnSubmit = function (value) {
45912			if ( !_isBool(value) ) {
45913				throw new TypeError('Argument must be a Boolean');
45914			}
45915
45916			this.options.passDataToOnSubmit = value;
45917
45918			return this;
45919		}
45920
45921		/**
45922		 * Opens modal window
45923		 *
45924		 * @returns {Modal}
45925		 */
45926		Modal.prototype.open = function() {
45927			var $this = this;
45927 // nemozeme pouzit () => {} takze preto a krajsie ako jQuery.proxy
45928			//this.id = this.plugin.dialog[this.options.type](this.options).data('vex').id;
45929			if (this.hideEmptyContent) {
45930				if (typeof this.options.input === 'undefined' || this.options.input === '') {
45931					this.options.className += ' empty_body';
45932				} else if (typeof this.options.message === 'undefined' || this.options.message === '') {
45933					this.options.className += ' empty_header';
45934				}
45935			}
45936			this.options = _setHtml(this.options);
45937			var modalContentElem = this.plugin.open(this.options);
45938			this.id = modalContentElem.data('vex').id;
45939			this.modal = modalContentElem.closest('.' + MODAL_DEFAULT_CLASSNAME);
45940
45941
45942			this.options.node = this.modal;
45943			this.options.close = function () {
45944				$this.plugin.close($this.id);
45945			};
45946
45947			_bindEvents(this);
45948
45949			listOfCsModals.set(this.modal[0], this);
45950			return this;
45951		};
45952
45953		/**
45954		 * Closes modal window
45955		 *
45956		 * @returns {Modal}
45957		 */
45958		Modal.prototype.close = function() {
45959			if (this.id === 0) {
45960				return this;
45961			}
45962
45963			this.plugin.close(this.id);
45964			if (listOfCsModals.has(this.modal[0])) {
45965				listOfCsModals.delete(this.modal[0]);
45966			}
45967
45968			return this;
45969		};
45970
45971		Modal.prototype.getInstance = function(elem) {
45972			return listOfCsModals.get(jQuery(elem)[0]);
45973		};
45974
45975		/*****************************
45976		 * Private functions
45977		 *****************************/
45978
45979		/**
45980		 * Sets modal's html content
45981		 *
45982		 * @param options
45983		 * @returns {*}
45984		 * @private
45985		 */
45986		function _setHtml(options) {
45987
45988			var modalHeading = _getModalHeading(options);
45989
45990			var modalContent = _getModalContent(options);
45991
45992			var buttons = _getModalButtons(options);
45993
45994			var html = [
45995				modalHeading,
45996				modalContent,
45997				buttons
45998			].join('');
45999
46000			return Object.assign({}, options, {
46001				content: html
46002			});
46003		}
46004
46005		/**
46006		 * Gets modal's heading
46007		 *
46008		 * @param options
46009		 * @returns {string}
46010		 * @private
46011		 */
46012		function _getModalHeading(options) {
46013			return [
46014				'<div class="' + MODAL_HEADING_CLASSNAME + ( options.icon ? ' has_icon' : '' ) +'">',
46015				options.icon ? '<div class="icon cs_icon ' + options.icon + '"></div>' : '',
46016				'<div class="title"><span>' + (options.message ? options.message : '') + '</span></div>',
46017				'<div class="subtitle"><span>' + (options.subtitle ? options.subtitle : '') + '</span></div>',
46018				'</div>'
46019			].join('');
46020		}
46021
46022		/**
46023		 * Gets modal's content
46024		 *
46025		 * @param options
46026		 * @returns {string}
46027		 * @private
46028		 */
46029		function _getModalContent(options) {
46030			var promptInput = '<input class="inputbox" type="text"' + (options.placeholder ? ' placeholder="' + options.placeholder + '"' : '') + (options.value ? ' value="' + options.value + '"' : '') + '>';
46031
46032			return [
46033				'<div class="' + MODAL_CONTENT_INNER_CLASSNAME + '">',
46034				options.input ? options.input : '',
46035				(options.type === 'prompt' ? promptInput : ''),
46036				'</div>'
46037			].join('');
46038		}
46039
46040		/**
46041		 * Gets modal's buttons
46042		 *
46043		 * @param options
46044		 * @returns {string}
46045		 * @private
46046		 */
46047		function _getModalButtons(options) {
46048			var buttons;
46049
46050			if ( _isString(options.buttons) ) {
46051				return '<div class="' + (_isString(options.actionsClassName) ? options.actionsClassName : MODAL_ACTIONS_CLASSNAME) + '">' + options.buttons + '</div>'; //
46052			}
46053
46054			if ( options.type === 'alert' ) {
46055				var closeBtn = _isArray(options.buttons) && _isString(options.buttons[0]) ? options.buttons[0] : cms_js_lang_close;
46056
46057				buttons = '<div class="' + (_isString(options.actionsClassName) ? options.actionsClassName : MODAL_ACTIONS_CLASSNAME) + '"><button class="' + MODAL_CANCEL_CLASSNAME + '">' + closeBtn + '</button></div>';
46058			} else {
46059				var cancelBtn = _isArray(options.buttons) && _isString(options.buttons[0]) ? options.buttons[0] : 'Cancel';
46060				var confirmBtn = _isArray(options.buttons) && _isString(options.buttons[1]) ? options.buttons[1] : 'OK';
46061
46062				buttons = [
46063					'<div class="' + (_isString(options.actionsClassName) ? options.actionsClassName : MODAL_ACTIONS_CLASSNAME) + '">',
46064					'<button class="' + MODAL_CANCEL_CLASSNAME + '">' + cancelBtn + '</button>',
46065					'<button class="button ' + MODAL_SUBMIT_CLASSNAME + '">' + confirmBtn + '</button>',
46066					'</div>'
46067
46068				].join('');
46069			}
46070
46071			return buttons;
46072		}
46073
46074		/**
46075		 * Binds events
46076		 *
46077		 * @param instance
46078		 * @private
46079		 */
46080		function _bindEvents(instance) {
46081			instance.modal.find('.' + MODAL_CANCEL_CLASSNAME).on('click', instance.plugin.close.bind(null, instance.id));
46082			instance.modal.find('.' + MODAL_SUBMIT_CLASSNAME).on('click', function() {
46083				if ( _isFunction(instance.options.onSubmit) ) {
46084					if (instance.options.passDataToOnSubmit) {
46085						instance.options.onSubmit(_getModalContentInputs(instance));
46086					} else {
46087						instance.options.onSubmit();
46088					}
46089				}
46090			});
46091		}
46092
46093		function _getModalContentInputs(instance) {
46094			// Collect all inputs/selects/textarea/... values
46095			let data = {};
46096			let jQueryContent = instance.modal.find('.' + MODAL_CONTENT_CLASSNAME);
46097
46098			// Find all relevant form controls inside the content
46099			const $fields = jQueryContent.find(':input').filter(function () {
46100				const type = this.type;
46101				// Skip disabled or unnamed controls and non-data buttons
46102				if (this.disabled || !this.name) return false;
46103				if (type === 'button' || type === 'submit' || type === 'reset') return false;
46104				// For radios/checkboxes only capture checked values
46105				if ((type === 'radio' || type === 'checkbox') && !this.checked) return false;
46106				return true;
46107			});
46108
46109			const parseName = (name) => {
46110				// "orderUserData[2025023][address_1]" -> ["orderUserData","2025023","address_1"]
46111				// "tags[]" -> ["tags", ""]
46112				return name.replace(/\]/g, '').split('[');
46113			};
46114
46115			// Only use arrays for explicit [] in the name. Numeric keys should be object keys.
46116			const ensureContainer = (parent, key, nextKey) => {
46117				const needsArray = nextKey === ''; // only when explicit "[]" is present
46118				if (!(key in parent)) {
46119					parent[key] = needsArray ? [] : {};
46120				} else {
46121					// Coerce to the expected container type if mismatched
46122					if (needsArray && !Array.isArray(parent[key])) parent[key] = [];
46123					if (!needsArray && Array.isArray(parent[key])) parent[key] = {};
46124				}
46125				return parent[key];
46126			};
46127
46128			const assignDeep = (target, path, value) => {
46129				let ctx = target;
46130
46131				for (let i = 0; i < path.length; i++) {
46132					const key = path[i];
46133					const isLast = i === path.length - 1;
46134
46135					// Handle push for explicit "[]" segments
46136					if (key === '') {
46137						if (!Array.isArray(ctx)) {
46138							// If current is not an array (malformed), convert to array as best effort
46139							const newArr = [];
46140							ctx = newArr;
46141						}
46142						if (isLast) {
46143							ctx.push(value);
46144							return;
46145						} else {
46146							const nextKey = path[i + 1];
46147							const container = (nextKey === '') ? [] : {};
46148							ctx.push(container);
46149							ctx = container;
46150							continue;
46151						}
46152					}
46153
46154					if (isLast) {
46155						// Final assignment
46156						if (key in ctx) {
46157							const existing = ctx[key];
46158							if (Array.isArray(existing)) {
46159								if (Array.isArray(value)) {
46160									ctx[key] = existing.concat(value);
46161								} else {
46162									existing.push(value);
46163								}
46164							} else {
46165								ctx[key] = Array.isArray(value) ? [existing].concat(value) : [existing, value];
46166							}
46167						} else {
46168							ctx[key] = value;
46169						}
46170					} else {
46171						// Traverse / create container based on the next segment
46172						const nextKey = path[i + 1];
46173						ctx = ensureContainer(ctx, key, nextKey);
46174					}
46175				}
46176			};
46177
46178			$fields.each(function () {
46179				const $el = jQuery(this);
46180				const name = this.name;
46181
46182				let value;
46183				// Handle multi-select as an array of values
46184				if (this.tagName.toLowerCase() === 'select' && this.multiple) {
46185					value = $el.val() || [];
46186				} else {
46187					value = $el.val();
46188				}
46189
46190				const path = parseName(name);
46191				assignDeep(data, path, value);
46192			});
46193
46194			return data;
46195		}
46196
46197
46198		/**
46199		 * Checks whether modal is already intialiazed or is being initialized
46200		 *
46201		 * @param id {number}
46202		 * @returns {boolean}
46203		 * @private
46204		 */
46205		function _isModalInitialized(id) {
46206			return id !== 0;
46207		}
46208
46209		/**
46210		 * Checks if param is boolean
46211		 *
46212		 * @param param
46213		 * @returns {boolean}
46214		 * @private
46215		 */
46216		function _isBool(param) {
46217			return typeof param === 'boolean';
46218		}
46219
46220		/**
46221		 * Checks if param is string
46222		 *
46223		 * @param param
46224		 * @returns {boolean}
46225		 * @private
46226		 */
46227		function _isString(param) {
46228			return typeof param === 'string';
46229		}
46230
46231		/**
46232		 * Checks if param is object
46233		 *
46234		 * @param param
46235		 * @returns {boolean}
46236		 * @private
46237		 */
46238		function _isObject(param) {
46239			return typeof param === 'object' && !Array.isArray(param);
46240		}
46241
46242		/**
46243		 * Checks if param is function
46244		 *
46245		 * @param param
46246		 * @returns {boolean}
46247		 * @private
46248		 */
46249		function _isFunction(param) {
46250			return typeof param === 'function';
46251		}
46252
46253		/**
46254		 * Checks if param is array
46255		 *
46256		 * @param param
46257		 * @returns {boolean}
46258		 * @private
46259		 */
46260		function _isArray(param) {
46261			return typeof param !== 'undefined' && Array.isArray(param);
46262		}
46263
46264		/**
46265		 * Checks if type is allowed
46266		 *
46267		 * @param type {string}
46268		 * @returns {boolean}
46269		 * @private
46270		 */
46271		function _isAllowedType(type) {
46272			return Object.values(ALLOWED_TYPES).indexOf(type) > -1;
46273		}
46274
46275		return Modal;
46276	}
46277)(vex);
46278
46279
46280/* ========================================
46281 FILE: /includes/js/imagePin.js
46282 ==================== */
46283
46284var ImagePin = function () {
46285	var $this = this;
46286	// Classes on which pins/edit are not going to be initialized. Can be applied on parent or img classes
46287	this.blacklist = [
46288		'.disable_pins',
46289		'.benefits',
46290		'.cart_ajax_container',
46291		'.comments_container',
46292		'.product_activeimages_image_div',
46293		'.wishlist_item_img',
46294		'.cs_product_item',
46295	];
46296
46297	// Override blacklist excluded classes through this list. This deletes classes from blacklist so be aware of parent classes.
46298	if(typeof js_CS_Config_image_pin_whitelist !== 'undefined') {
46299		this.whitelist = js_CS_Config_image_pin_whitelist;
46300	} else {
46301		this.whitelist = [];
46302	}
46303
46304	// Serves as template for saving
46305	// pinId -> refers to pin inside the admin vex
46306	// id -> refers to product id
46307	// x/y -> position on image
46308	// action -> 0: delete / 1: insert / 2: update
46309	this.templatePin = {
46310		'pinId' : '',
46311		'id' : '',
46312		'x': '',
46313		'y': '',
46314		'action': ''
46315	};
46316
46317	// Variabiles for edit vex.
46318	this.confirmedClose = false;
46319	this.deselectCounter = 1;
46320	this.editingMode = false;
46321	this.icon = '';
46322	this.langs = [];
46323	this.vexImg = '';
46324	this.title = '';
46325	this.loadedTitle = '';
46326	this.uniqueTitle = true;
46327	this.newImg = false;
46328	this.loadedPins = '';
46329	this.currentPins = [];
46330	this.newPin = JSON.parse(JSON.stringify(this.templatePin));
46331	this.pinsWrap = '<div class="pins_wrap"></div>';
46332	this.appendButton = '<div class="image_pin open_edit"></div>';
46333	this.deleteButton = '<span class="pin_delete"></span>';
46334	this.productInput = '';
46335	this.newPinHtml = '';
46336	this.loadPagePinsAjax = null;
46337
46338	jQuery(window).on('load', function () {
46339		$this.loadDefaultSettings();
46340	});
46341};
46342
46343ImagePin.prototype.loadFunctions = function () {
46344	var $this = this;
46345	if ( !is_admin() || (typeof admin_view_design !== 'undefined' && admin_view_design === 1) ) {
46346		jQuery('body').addClass('function_pin_enabled');
46347		$this.initPinitialization();
46348	} else if (typeof js_we_are_in_admin !== 'undefined') {
46349		$this.initAdminTable();
46350		$this.initCustomSelect();
46351	}
46352};
46353
46354ImagePin.prototype.loadDefaultSettings = function() {
46355	var $this = this;
46356	new AjaxRequest()
46357		.setController('ImagePin')
46358		.setAction('loadDefaultSettings')
46359		.onSuccess(function (res) {
46360			if(!res.data.success){
46361				console.log('check config syntax for icon');
46362			}
46363			$this.icon = res.data.icon;
46364			$this.langs = res.data.langs;
46365			$this.productInput = '<div class="new_info"><input name="product_auto" id="product_auto" type="text" placeholder="'+$this.langs.product_sku+'"><span class="cs_icon csi-search"></span></div>';
46366			$this.newPinHtml = '<div class="pin_wrap new_wrap"><div class="new_pin image_pin '+$this.icon+'"><span class="pin_delete" onclick="ImagePin.deletePin(\'.new_pin\')" title="'+ $this.langs.help_title_rpin +'"></span></div></div>';
46367			$this.loadFunctions();
46368		})
46369		.onError(function (res) {
46370			console.log(res);
46371		})
46372		.send();
46373};
46374
46375// Pun intended
46376ImagePin.prototype.initPinitialization = function () {
46377	var $this = this;
46378
46379	// accept only whitelist classes as pinnable content
46380	if ( typeof js_CS_Config_image_pin_only_whitelist !== 'undefined') {
46381		// prevents join() from not inserting delimiter on last class in list OR single item list
46382		if($this.whitelist.length){
46383			$this.whitelist.push('');
46384			var selector = ('('+$this.whitelist.join(' img,') + $this.whitelist.join(',')+')').replace(',)', ')');
46385			selector = selector.replace('(', '').replace(')', '');
46386			$this.activeImages = jQuery(selector);
46387		} else {
46388			$this.activeImages = [];
46389		}
46390	} else if ( $this.blacklist.length ) {
46391		if ( $this.whitelist.length ) {
46392
46393			// exclude whitelist classes
46394			this.blacklist.forEach(function(w) {
46395				if($this.whitelist.indexOf(w) != -1) {
46396					$this.blacklist.splice(w, 1);
46397				}
46398			});
46399		} else {
46400			$this.activeImages = [];
46401		}
46402
46403		// prevents join() from not inserting delimiter on last class in list OR single item list
46404		$this.blacklist.push('');
46405
46406		var selector = ('img:not(' + $this.blacklist.join(' img,') + $this.blacklist.join(',') +')').replace(',)', ')');
46407		$this.activeImages = jQuery(selector);
46408	} else {
46409		$this.activeImages = jQuery('img');
46410	}
46411
46412	// start Pinitialization
46413	if($this.activeImages.length) {
46414		$this.appendWrapper('');
46415		if (typeof js_CS_Config_pins_extras !== 'undefined') {
46416			$this.triggerOnDomChange();
46417		}
46418	}
46419};
46420ImagePin.prototype.loadPagePins = function (selectedImage){
46421	var $this = this;
46422
46423	var imgs = [];
46424
46425	// Zruší predchádzajúci request
46426	if (this.loadPagePinsAjax) {
46427		this.loadPagePinsAjax.abort();
46428	}
46429
46430	if(!selectedImage.length){
46431		$this.activeImages.each(function (index, item) {
46432			var element = jQuery(item);
46433
46434			if(element.is('img')){
46435				var img = element.attr('data-srcset');
46436
46437				if (typeof img === 'undefined') {
46438					img = element.attr('src');
46439				}
46440
46441				img = $this.cleanImageUrl(img);
46442
46443				if (typeof img !== 'undefined') {
46444					imgs.push(img);
46445				}
46446			}
46447		});
46448	} else {
46449		if (typeof selectedImage === 'object') { // uz je pole
46450			imgs = selectedImage;
46451		} else {
46452			imgs.push(selectedImage);
46453		}
46454	}
46455
46456	if (imgs.length) {
46457		this.loadPagePinsAjax = new AjaxRequest({imgs: imgs})
46458			.setController('ImagePin')
46459			.setAction('loadPagePins')
46460			.setMethod('POST')
46461			.ignoreDefault(true) // pri aborte ajaxov nutnost
46462			.onSuccess(function (res) {
46463				if(res.data.success){
46464					var pins = res.data.pins;
46465					var k;
46466					for( k in pins ) {
46467						if (pins[k].length) {
46468							var pinsWrap = jQuery('.pins_wrap[data-img="' + k + '"]');
46469							pins[k].forEach(function (value) {
46470								pinsWrap.append('<div class="visible_pin_wrap" style="top:' + value.y_axis + '%;left:' + value.x_axis + '%"><div class="visible_pin image_pin ' + $this.icon + '" data-id="' + value.product_id + '" data-top="' + value.y_axis + '" data-left="' + value.x_axis + '"></div></div>');
46471								var moduleParent = pinsWrap.closest('.module, .mp');
46472								if (moduleParent.length) {
46473									moduleParent.addClass('module_pin_enabled');
46474								}
46475							});
46476						}
46477					}
46478					if (typeof jQuery('.pins_info_body')[0] === 'undefined') {
46479						jQuery('body')
46480							.append('<div class="pins_info_body"></div>');
46481					}
46482					$this.bindHoverEffect();
46483				} else {
46484					if (res.data.message.length) {
46485						var message = res.data.message;
46486						if (message === 'error') {
46487							if (is_cs_user()) {
46488								console.log(res.data.error);
46489							}
46490						} else {
46491							if (is_cs_user()) {
46492								console.log(res.data.message);
46493							}
46494						}
46495					}
46496				}
46497			})
46498			.onError(function (res) {
46499				console.log(res);
46500			})
46501			.send();
46502	}
46503};
46504//Helper
46505ImagePin.prototype.getImgUrls = function (selectedImgs) {
46506	var imgs = [];
46507	var $this = this;
46508
46509	jQuery(selectedImgs).each(function (index,item){
46510		var element = jQuery(item);
46511
46512		if(element.is('img')){
46513			var img = element.attr('data-srcset');
46514
46515			if (typeof img === 'undefined') {
46516				img = element.attr('src');
46517			}
46518
46519			img = $this.cleanImageUrl(img);
46520
46521			if (typeof img !== 'undefined') {
46522				imgs.push(img);
46523			}
46524		}
46525	});
46526
46527	return imgs;
46528};
46529//Helper
46530ImagePin.prototype.cleanImageUrl = function (ImgUrl){
46531	var tmpUrl = ImgUrl;
46532
46533	tmpUrl = tmpUrl.replace(js_global_live_site, '');
46534	tmpUrl = tmpUrl.replace('https://'+js_global_main_domain, '');
46535	tmpUrl = tmpUrl.replace(/\.webp(.)*/, '');
46536	tmpUrl = tmpUrl.replace(/\?.*/, '');
46537
46538	return tmpUrl;
46539};
46540
46541ImagePin.prototype.appendWrapper = function (imgs) {
46542	var $this           = this;
46543	var admin           = is_admin();
46544	var foundNivoSlider = false;
46545	var appendToImgs    = null;
46546	var somethingAppended = false;
46547
46548	if (imgs.length) {
46549		appendToImgs = imgs;
46550	} else {
46551		appendToImgs = $this.activeImages;
46552	}
46553
46554	// get image cleared paths and append wrapper and edit button if admin
46555	jQuery(appendToImgs).each(function (index, item) {
46556		var element = jQuery(item);
46557		// skip already appended
46558		if (element.next().hasClass('pins_wrap')) {
46559			return true;
46560		}
46561		somethingAppended = true;
46562		if (element.is('img')) {
46563			var oldBlog        = element.closest('.blog_default, article').length;
46564			var newBlog        = element.closest('.contentpaneopen').length;
46565			var parents        = element.parents();
46566			var parentAssigned = false;
46567			var parentNeeded   = true;
46568			if ( is_cs_user('kc-14829') ) {
46569				var parent = element.parent();
46570				if(parent.is('a') && parent.css('position') !== 'relative' && !oldBlog && !newBlog){
46571					parent.css('position', 'relative');
46572				}
46573			} else {
46574				if (!oldBlog) {
46575					parents.each(function (index, item) {
46576						var parent = jQuery(item);
46577						if (parent.css('position') === 'relative') {
46578							if (parent.innerWidth() !== element.innerWidth() || parent.innerHeight() !== element.innerHeight()) {
46579								var parentClasses = 'imagepin_parent';
46580
46581								if (element.css('float') === 'left') {
46582									parentClasses += ' float_left';
46583								} else if (element.css('float') === 'right') {
46584									parentClasses += ' float_right';
46585								}
46586
46587								element.wrap('<span class="'+parentClasses+'"></span>');
46588								parentAssigned = true;
46589							} else {
46590								parentNeeded = false;
46591							}
46592							return false;
46593						} else {
46594							return true;
46595						}
46596					});
46597					if (parentNeeded && !parentAssigned) {
46598						element.wrap('<span class="imagepin_parent"></span>');
46599					}
46600				}
46601			}
46602			element.after($this.pinsWrap);
46603			var pinsWrap = element.next();
46604			var offPar;
46605			if (oldBlog) {
46606				offPar = element.position();
46607				pinsWrap.css({
46608					'top'   : offPar.top,
46609					'left'  : offPar.left,
46610					'width' : element.width(),
46611					'height': element.height()
46612				});
46613				if (element.css('margin').length) {
46614					pinsWrap.css({'margin': element.css('margin')});
46615				}
46616				if (element.css('float').length) {
46617					pinsWrap.css({'float': element.css('float')});
46618				}
46619				pinsWrap.addClass('absolute_position');
46620			} else if (newBlog) {
46621				pinsWrap.css({
46622					'width' : '100%',
46623					'height': '100%',
46624					'top'   : 0,
46625					'left'  : 0,
46626					'position': 'absolute'
46627				});
46628			}
46629
46630			var contentInfo = $this.getContentInfo(element);
46631			var imgUrl      = element.attr('data-srcset');
46632			var imgSrc      = element.attr('src');
46633			if (typeof imgUrl === 'undefined') {
46634				imgUrl = imgSrc;
46635			}
46636			if (typeof imgUrl !== 'undefined') {
46637				imgUrl = $this.cleanImageUrl(imgUrl);
46638			}
46639			pinsWrap.attr('data-img', imgUrl);
46640			if (contentInfo.type === 'nivo_slider') {
46641				foundNivoSlider = true;
46642			}
46643			if (admin) {
46644				var editButton = jQuery($this.appendButton);
46645				editButton
46646					.attr('data-img', imgUrl)
46647					.attr('data-content-type', contentInfo.type)
46648					.attr('data-content-id', contentInfo.id);
46649				element.next('.pins_wrap').append(editButton);
46650			}
46651		}
46652	});
46653
46654	if (!somethingAppended) {
46655		return;
46656	}
46657
46658	jQuery('.open_edit').off('click');
46659	// TODO presunut inam
46660	if (foundNivoSlider) {
46661		$this.NivoSliderChangeLayers();
46662	}
46663
46664	// bind listener to open edit vex
46665	jQuery('.open_edit').on('click', function (e) {
46666		e.preventDefault();
46667		$this.openEditVex(jQuery(this));
46668	});
46669
46670	imgs.length ? $this.loadPagePins($this.getImgUrls(appendToImgs)) : $this.loadPagePins('');
46671};
46672ImagePin.prototype.NivoSliderChangeLayers = function () {
46673	var $this    = this;
46674	var elements = document.querySelectorAll(".module_nivo_slider .nivo-main-image");
46675	var observer = new MutationObserver(function (mutations) {
46676		mutations.forEach(function (mutation) {
46677			if (mutation.type === "attributes") {
46678				if (mutation.attributeName === 'src') {
46679					var targetedElement = jQuery(mutation.target);
46680					var targetImg = $this.cleanImageUrl(targetedElement.attr('src'));
46681					var parentWrap = targetedElement.parent();
46682					parentWrap.find('.pins_wrap .open_edit:not(.open_edit[data-img="' + targetImg+'"])').parent().addClass('hidden_pins_wrap');
46683					parentWrap.find('.pins_wrap .open_edit[data-img="'+targetImg+'"]').parent().removeClass('hidden_pins_wrap');
46684				}
46685			}
46686		});
46687	});
46688
46689	elements.forEach(function (item){
46690		var jItem = jQuery(item);
46691		var img = $this.cleanImageUrl(jItem.attr('src'));
46692		if (jItem.next().hasClass('pins_wrap')) {
46693			jItem.next().remove();
46694		}
46695		jQuery('.module_nivo_slider .pins_wrap .open_edit:not(.open_edit[data-img="'+img+'"])').parent().addClass('hidden_pins_wrap');
46696
46697		observer.observe(item, {
46698			attributes: true
46699		});
46700	});
46701};
46702
46703ImagePin.prototype.triggerOnDomChange = function () {
46704	// Custom funkcie doplnat do ifov pre observer
46705	var $this    = this;
46706	var observer = new MutationObserver(function (mutations) {
46707		mutations.forEach(function (mutation) {
46708			if (mutation.type === "childList") {
46709				let nodes = jQuery(mutation.addedNodes);
46710
46711				if (nodes.hasClass('fancybox-container')) {
46712					let imageNodes = nodes.find('.fancybox-slide--current img');
46713
46714					if (imageNodes.length) {
46715						$this.appendWrapper(imageNodes);
46716						observer.observe(document.querySelector('.fancybox-stage'), {
46717							childList: true,
46718							subtree: true,
46719							attributes: false,
46720							characterData: false
46721						});
46722					}
46723				}
46724
46725				let targetNodes = jQuery(mutation.target).find('.fancybox-slide--current img');
46726				if (targetNodes.length) {
46727					$this.appendWrapper(targetNodes);
46728				}
46729			}
46730		});
46731	});
46732
46733	// do extras pridat pod cfg na spustenie observera
46734	if (typeof js_CS_Config_pins_extras.openedFancybox !== 'undefined') {
46735
46736		observer.observe(document.body, {
46737			childList: true,
46738			subtree: false,
46739			attributes: false,
46740			characterData: false
46741		});
46742	}
46743};
46744
46745ImagePin.prototype.getContentInfo = function (elem) {
46746	var id = '';
46747
46748	// clanky
46749	var tmpEl = elem.closest('.article_container, .blog_default');
46750	if(tmpEl.length){
46751		id = elem.closest('.blog_default').parent().find('input[name=article_id]').val();
46752		if(typeof id === 'undefined'){
46753			id = elem.closest('.article_container').attr('data-article_id');
46754		}
46755
46756		if(typeof id === 'undefined' || !id.length){
46757			id = '-1';
46758		}
46759		return {
46760			'type' : 'article',
46761			'id' : id
46762		};
46763	}
46764	// sudo-slider
46765	if(elem.hasClass('sudo_image')){
46766		// id -1 znamena ze sa nepodarilo najst id
46767
46768		if(typeof elem.closest('.sudo_slide').attr('data-slide') !== 'undefined'){
46769
46770			if(typeof id === 'undefined' || !id.length){
46771				id = '-1';
46772			}
46773			return {
46774				'type' : 'sudo_slider',
46775				'id' : elem.closest('.sudo_slide').attr('data-slide')
46776			};
46777		} else {
46778			var classList = jQuery(elem).closest('.sudo_slide').attr('class').split(/\s+/);
46779			var idClass;
46780
46781			classList.forEach(function(itemClass){
46782				if(itemClass.indexOf('slide_id_') === 0){
46783					idClass = itemClass;
46784				}
46785			});
46786
46787			if(typeof id === 'undefined' || !id.length){
46788				id = '-1';
46789			}
46790			return {
46791				'type' : 'sudo_slider',
46792				'id' : idClass
46793			};
46794		}
46795	}
46796	// nivo-slider
46797	tmpEl = elem.closest('.module_nivo_slider ');
46798	if(tmpEl.length){
46799		var classes = tmpEl.attr("class").split(/\s+/);
46800
46801		classes.forEach(function(itemClass){
46802			if(itemClass.indexOf('mp_id') === 0){
46803				id = itemClass.replace('mp_id', '');
46804			}
46805		});
46806
46807		if(typeof id === 'undefined' || !id.length){
46808			id = '-1';
46809		}
46810		return {
46811			'type' : 'nivo_slider',
46812			'id' : id
46813		};
46814	}
46815	// produkt
46816	tmpEl = elem.closest('.flypage1');
46817	if (tmpEl.length) {
46818		id = jQuery('.flypage1').find('input[name=product_id]').val();
46819		if (typeof id === 'undefined' || !id.length) {
46820			id = '-1';
46821		}
46822		return {
46823			'type': 'product',
46824			'id'  : id
46825		};
46826	}
46827	var tmpFancy = elem.closest('.fancybox-container');
46828	if (tmpFancy.length) {
46829		id = jQuery('.flypage1').find('input[name=product_id]').val();
46830		if (typeof id === 'undefined' || !id.length) {
46831			id = '-1';
46832		}
46833		return {
46834			'type': 'fancybox',
46835			'id'  : id
46836		};
46837	}
46838	// module
46839	tmpEl = elem.closest('.mp');
46840	if (tmpEl.length) {
46841		var classes = tmpEl.attr("class").split(/\s+/);
46842		classes.forEach(function (itemClass) {
46843			if (itemClass.indexOf('mp_id') === 0) {
46844				id = itemClass.replace('mp_id', '');
46845			}
46846		});
46847		if (typeof id === 'undefined' || !id.length) {
46848			id = '-1';
46849		}
46850		return {
46851			'type': 'module',
46852			'id'  : id
46853		};
46854	}
46855	// vsetko ostatne
46856	var wrap = elem.parent();
46857
46858	if (wrap.hasClass('imagepin_parent')) {
46859		wrap = wrap.parent();
46860	}
46861
46862	if (typeof wrap.attr('id') !== 'undefined'){
46863		id = wrap.attr('id');
46864	} else {
46865		id = wrap.attr('class');
46866	}
46867	if(typeof id === 'undefined' || !id.length){
46868		id = '-1';
46869	}
46870	return {
46871		'type' : 'content',
46872		'id' : id
46873	};
46874};
46875
46876ImagePin.prototype.openEditVex = function (elem, fs) {
46877	var $this = this;
46878	var img = elem.attr('data-img');
46879	var vexClasses = 'vex-cs vex_pin_edit';
46880	if(typeof fs === 'undefined' || !fs.length){
46881		fs = '';
46882	}
46883
46884	if(elem.hasClass('row_action_edit') && elem.closest('fieldset').hasClass('pin_product_settings')) {
46885		elem
46886			.attr('data-content-type', 'table')
46887			.attr('data-content-id', elem.closest('.adminlist_data_row').find('.row-number-container').text());
46888	}
46889
46890	$this.activeElement = elem;
46891	if ($this.activeElement.attr('data-content-type') === 'fancybox') {
46892		vexClasses += ' show_above';
46893	}
46894	new AjaxRequest({
46895		img    : img,
46896		cType  : $this.activeElement.attr('data-content-type'),
46897		cId    : $this.activeElement.attr('data-content-id')
46898	})
46899		.setController('ImagePin')
46900		.setAction('loadImageData')
46901		.onSuccess(function (res) {
46902			if (res.data.success) {
46903				var mainVexId;
46904				vex.dialog.confirm({
46905					input          : res.data.html,
46906					message        : res.data.titleHtml,
46907					className      : vexClasses,
46908					escapeButtonCloses : false,
46909					showCloseButton: true,
46910					buttons        : [
46911						{
46912							type     : 'submit',
46913							text     : $this.langs.save_btn,
46914							className: 'pin_edit_save vex-dialog-button-primary'
46915						},
46916						{
46917							type     : 'submit',
46918							text     : $this.langs.cancel_btn,
46919							className: 'pin_edit_cancel vex-dialog-button-secondary'
46920						}
46921					],
46922					beforeClose : function () {
46923						if ($this.confirmedClose) {
46924							jQuery(window).off('keydown');
46925							return true;
46926						} else {
46927							if (($this.loadedPins != JSON.stringify($this.currentPins)) || ($this.loadedTitle !== $this.title) || $this.editingMode) {
46928								vex.dialog.confirm({
46929									message           : $this.langs.warning,
46930									input             : $this.langs.abort_changes,
46931									escapeButtonCloses: true,
46932									showCloseButton   : true,
46933									buttons: [
46934										{
46935											type     : 'submit',
46936											text     : $this.langs.save_changes,
46937											className: 'pin_warning_save vex-dialog-button-primary'
46938										},
46939										{
46940											type     : 'submit',
46941											text     : $this.langs.delete_changes,
46942											className: 'pin_warning_cancel vex-dialog-button-secondary'
46943										}
46944									],
46945									className         : 'vex-cs alert vex_pin_warning',
46946									afterOpen       : function (){
46947										jQuery('.pin_warning_save').click(function (e){
46948											e.preventDefault();
46949											$this.saveNewLayout(fs, mainVexId);
46950											vex.close();
46951										});
46952										jQuery('.pin_warning_cancel').click(function (e){
46953											e.preventDefault();
46954											$this.confirmedClose = true;
46955											$this.loadedPins     = '';
46956											$this.currentPins    = [];
46957											$this.newPin         = JSON.parse(JSON.stringify($this.templatePin));
46958											vex.closeAll();
46959										});
46960									}
46961								});
46962							} else {
46963								jQuery(window).off('keydown');
46964								return true;
46965							}
46966						}
46967						return false;
46968					},
46969					afterOpen      : function () {
46970						mainVexId = this.id;
46971						$this.bindDraggable();
46972						$this.confirmedClose = false;
46973						$this.editingMode = false;
46974						jQuery('.pin_edit_save').prop('disabled', true);
46975						jQuery('#active_image').click({param1: $this}, $this.addPin);
46976						jQuery('#edit_image_pin_times').hide();
46977						jQuery('#editing_pin_title').hide();
46978
46979						if((res.data.warning).length > 1) {
46980							$this.openErrorVex({
46981								'error'     : 'Ajax failed to return data.',
46982								'ajax_res'  : res.data,
46983								'custom'    : res.data.warning
46984							});
46985						}
46986
46987						jQuery('.pin_edit_save').on('mousedown click' , function (e) {
46988							e.preventDefault();
46989							if(e.type !== 'click') {
46990								$this.saveNewLayout(fs, mainVexId);
46991							}
46992						});
46993
46994						jQuery(window).on('keydown',function(e){
46995							if(e.keyCode == 116){
46996								if(($this.loadedPins != JSON.stringify($this.currentPins)) || ($this.loadedTitle !== $this.title) || $this.editingMode){
46997									e.preventDefault();
46998									e.stopImmediatePropagation();
46999									vex.close(mainVexId);
47000								}
47001							} else if ($this.editingMode) {
47002								if(e.keyCode == 13) {
47003									e.preventDefault();
47004									e.stopImmediatePropagation();
47005									$this.saveSetName(true);
47006								} else if (e.keyCode == 27) {
47007									e.preventDefault();
47008									e.stopImmediatePropagation();
47009									$this.saveSetName(false);
47010								}
47011							}
47012						});
47013
47014						jQuery('.vex_pin_edit').on('click' ,function (e) {
47015							if($this.editingMode) {
47016								if (e.target.id !== 'edit_image_pin_pen' && e.target.id !== 'editing_pin_title' && e.target.id !== 'image_pin_title') {
47017									if (e.target.id === 'edit_image_pin_times') {
47018										$this.saveSetName(false);
47019									} else {
47020										if (jQuery('#editing_pin_title').val() !== $this.loadedTitle) {
47021											$this.saveSetName(true);
47022										} else {
47023											$this.saveSetName(false);
47024										}
47025									}
47026								} else if (e.target.id === 'editing_pin_title') {
47027									var text = jQuery('#editing_pin_title').val();
47028									if( text === window.getSelection().toString()){
47029										$this.deselectCounter += 1;
47030										if($this.deselectCounter === 2) {
47031											window.getSelection().removeAllRanges();
47032											$this.deselectCounter = 0;
47033										}
47034									}
47035								}
47036							}
47037						});
47038
47039						jQuery('#edit_image_pin_pen, .image_pin_title_wrap span').click(function (){
47040							var title = jQuery('#image_pin_title');
47041							var pen = jQuery('#edit_image_pin_pen');
47042							var times = jQuery('#edit_image_pin_times');
47043							var editInput = jQuery('#editing_pin_title');
47044
47045							// editing Mode urcuje ci mame otvoreny input na nazov. Potrebne pre stopnutie niektorych listenerov.
47046							$this.editingMode = true;
47047
47048							// switching magic
47049							title.hide();
47050							editInput.show().select();
47051							pen.hide();
47052							times.show();
47053						});
47054					}
47055				});
47056
47057				$this.vexImg = res.data.img;
47058				$this.loadedTitle = res.data.title;
47059				$this.title = res.data.title;
47060				$this.newImg = res.data.new_img;
47061
47062				if(res.data.pins.length){
47063					var loadedPins = JSON.parse(res.data.pins);
47064					loadedPins.forEach(function (item, index) {
47065						$this.newPin.pinId  = 'pin_' + item.id;
47066						$this.newPin.id     = item.product_id;
47067						$this.newPin.x      = item.x_axis;
47068						$this.newPin.y      = item.y_axis;
47069						$this.newPin.action = '-1';
47070						$this.currentPins.push($this.newPin);
47071						$this.newPin = JSON.parse(JSON.stringify($this.templatePin));
47072					});
47073					$this.loadedPins = JSON.stringify($this.currentPins);
47074				}
47075			} else {
47076				$this.openErrorVex({
47077					'error'     : 'Ajax returned false data.',
47078					'ajax_res'  : res.data
47079				});
47080			}
47081		})
47082		.onError(function (res) {
47083			$this.openErrorVex({
47084				'error'     : 'Ajax failed to return data.',
47085				'ajax_res'  : res
47086			});
47087		})
47088		.send();
47089};
47090
47091ImagePin.prototype.saveNewLayout = function (fs, mainVexId){
47092	var $this = this;
47093
47094	if (!($this.title).length) {
47095		$this.openErrorVex({
47096			'custom': $this.langs.empty_title,
47097			'error' : 'ImagePin Error: Set name is undefined!'
47098		});
47099	}
47100
47101	if ($this.loadedPins != JSON.stringify($this.currentPins) || ($this.loadedTitle !== $this.title)) {
47102		new AjaxRequest({
47103			title   : $this.title,
47104			pins    : JSON.stringify($this.currentPins),
47105			img     : $this.vexImg,
47106			newImg  : $this.newImg,
47107			url     : js_global_live_site_sef,
47108			cType  : $this.activeElement.attr('data-content-type'),
47109			cId    : $this.activeElement.attr('data-content-id')
47110		})
47111			.setController('ImagePin')
47112			.setAction('saveImagePins')
47113			.onSuccess(function (res) {
47114				if (res.data.success) {
47115					$this.confirmedClose = true;
47116					$this.loadedPins  = '';
47117					$this.currentPins = [];
47118					$this.newPin      = JSON.parse(JSON.stringify($this.templatePin));
47119
47120					if(fs.length) {
47121						jQuery('#app_id_1132_dataTable').DataTable().ajax.reload();
47122						vex.close(mainVexId);
47123					} else {
47124						var visiblePins = $this.activeElement.parent().find('.visible_pin_wrap');
47125						var pinInfos = jQuery('pins_info_body');
47126						visiblePins.each(function (index, item){
47127							var current = jQuery(item);
47128							if(current.children().hasClass('loaded_info')){
47129								var classes = current.children().attr("class").split(/\s+/);
47130
47131								classes.forEach(function(itemClass){
47132									if(itemClass.indexOf('loaded_') === 0){
47133										pinInfos.find('.'+itemClass).remove();
47134									}
47135								});
47136							}
47137							current.remove();
47138						});
47139						$this.loadPagePins($this.vexImg);
47140						vex.close(mainVexId);
47141					}
47142				} else {
47143					$this.openErrorVex({
47144						'error'     : 'Function returned false success, internal error.',
47145						'ajax_res'  : res
47146					});
47147				}
47148			})
47149			.onError(function (res) {
47150				$this.openErrorVex({
47151					'error'     : 'Ajax failed to return data.',
47152					'ajax_res'  : res
47153				});
47154			})
47155			.send();
47156	}
47157};
47158
47159ImagePin.prototype.saveSetName = function(save) {
47160	var $this = this;
47161	var title = jQuery('#image_pin_title');
47162	var pen = jQuery('#edit_image_pin_pen');
47163	var times = jQuery('#edit_image_pin_times');
47164	var editInput = jQuery('#editing_pin_title');
47165
47166	if(save && ($this.title !== editInput.val()) && editInput.val() !== '') {
47167		$this.title = editInput.val();
47168		if($this.title.length) {
47169			new AjaxRequest({
47170				title : $this.title
47171			})
47172				.setController('ImagePin')
47173				.setAction('checkSetTitle')
47174				.onSuccess(function (res) {
47175					if (res.data.success) {
47176						if(res.data.duplicity) {
47177							$this.title = $this.title + '(' + res.data.count + ')';
47178							title.parent().append('<div class="pin_error_msg">'+$this.langs.duplicate_title+'</div>');
47179
47180							setTimeout(function (){
47181								jQuery('.pin_error_msg').fadeOut(150);
47182								setTimeout(function (){
47183									jQuery('.pin_error_msg').remove();
47184								}, 150);
47185							}, 3000);
47186						}
47187						title.text($this.title);
47188
47189						jQuery('.pin_edit_save').prop('disabled', false);
47190
47191						editInput.hide();
47192
47193						title.show();
47194
47195						times.hide();
47196						pen.show();
47197						$this.editingMode = false;
47198					} else {
47199						$this.openErrorVex({
47200							'error'     : 'Ajax failed to return data.',
47201							'ajax_res'  : res,
47202							'custom'    : $this.langs.check_title
47203						});
47204						$this.editingMode = false;
47205					}
47206				})
47207				.onError(function (res) {
47208					$this.openErrorVex({
47209						'error'     : 'Ajax failed to return data.',
47210						'ajax_res'  : res,
47211						'custom'    : $this.langs.check_title
47212					});
47213					$this.editingMode = false;
47214				})
47215				.send();
47216		} else {
47217			$this.openErrorVex({
47218				'error'     : 'Ajax failed to return data.',
47219				'ajax_res'  : res,
47220				'custom'    : $this.langs.check_title
47221			});
47222			editInput.hide();
47223			title.show();
47224
47225			times.hide();
47226			pen.show();
47227			$this.editingMode = false;
47228		}
47229	} else {
47230		editInput.hide();
47231		editInput.val($this.title);
47232		title.show();
47233
47234		times.hide();
47235		pen.show();
47236		$this.editingMode = false;
47237	}
47238};
47239
47240ImagePin.prototype.addPin = function (e) {
47241	var oldPin = jQuery('.new_pin');
47242	if (oldPin.length) {
47243		oldPin.parent().remove();
47244	}
47245
47246	var $this = e.data.param1;
47247	var elem = jQuery(this);
47248
47249	var rect = e.target.getBoundingClientRect();
47250	var x = e.clientX - rect.left;
47251	var y = e.clientY - rect.top;
47252
47253	var x_axis = ((x / elem.innerWidth()) * 100).toFixed(2);
47254	var y_axis = ((y / elem.innerHeight()) * 100).toFixed(2);
47255
47256	$this.newPin.pinId = 'pin_n_' + jQuery('.finished_pin').length;
47257	$this.newPin.x = x_axis;
47258	$this.newPin.y = y_axis;
47259	$this.newPin.action = 1;
47260
47261	jQuery('.image_edit_pane .pins_wrap').append($this.newPinHtml);
47262	jQuery('.new_pin').after($this.productInput);
47263	jQuery('.new_pin').attr('id', $this.newPin.pinId);
47264	jQuery('.new_wrap').css({top: y_axis + '%', left: x_axis + '%'});
47265
47266	$this.bindDraggable();
47267
47268	jQuery('#product_auto')
47269		.on('input', {param1: $this}, $this.initAutocomplete)
47270		.focus()
47271		.trigger('input');
47272};
47273
47274ImagePin.prototype.initAutocomplete = function (e) {
47275	$this = e.data.param1;
47276	var acInstance;
47277	acInstance = jQuery('#product_auto').uiautocomplete({
47278		source: function(request, response){
47279			if (request.term.length > 2) {
47280				new AjaxRequest({inputValue: request.term})
47281					.setController('ImagePin')
47282					.setAction('getProductsAutoComplete')
47283					.onSuccess(function (res) {
47284						if(res.data.success && res.data.products.length) {
47285							var data         = JSON.parse(res.data.products);
47286
47287							var responseData = [];
47288							data.forEach(function (item, index) {
47289								responseData.push({
47290									'value': item.product_id,
47291									'label': item.html
47292								});
47293							});
47294							response(responseData);
47295						} else {
47296							// pri autocomplete nechcem vyhadzovat vex na chybu kedze moze nastat pri kazdom inpute
47297							if( is_cs_user() ) {
47298								console.log(res.data.error);
47299							}
47300						}
47301					})
47302					.onError(function (res) {
47303						// pri autocomplete nechcem vyhadzovat vex na chybu kedze moze nastat pri kazdom inpute
47304						if( is_cs_user() ) {
47305							console.log(res.data.error);
47306						}
47307					})
47308					.send();
47309			}
47310		},
47311		focus: function (event, ui) {
47312			//console.log('focus');
47313		},
47314		autoFocus: false,
47315		select: function (event, ui) {
47316			jQuery('#product_auto').remove();
47317			jQuery('.new_pin').addClass('finished_pin').removeClass('new_pin');
47318			$this.newPin.id = ui.item.value;
47319			$this.currentPins.push($this.newPin);
47320			$this.saveNewPin($this.newPin.pinId);
47321			jQuery('.pin_edit_save').prop('disabled', false);
47322			$this.newPin = JSON.parse(JSON.stringify($this.templatePin));
47323			toggleScroll(true);
47324		},
47325		open: function () {
47326			jQuery('.ui-autocomplete').addClass('product_pin_autocomplete');
47327			toggleScroll(false);
47328		},
47329		close: function() {
47330			toggleScroll(true);
47331		},
47332		minLength: 3
47333	});
47334	acInstance.data("uiAutocomplete")._renderItem = function (ul, item) {
47335		return jQuery("<li></li>")
47336			.data("item.autocomplete", item)
47337			.append(item.label)
47338			.appendTo(ul);
47339	};
47340};
47341ImagePin.prototype.deletePin = function (pinId) {
47342	toggleScroll(true);
47343	if (pinId == '.new_pin') {
47344		jQuery('.new_wrap').remove();
47345	} else {
47346		jQuery('#'+pinId).parent().remove();
47347
47348		if( pinId.indexOf('pin_n_') !== -1 ) {
47349			ImagePin.currentPins.forEach(function (item , index){
47350				if(item.pinId == pinId) {
47351					ImagePin.currentPins.splice(index, 1);
47352				}
47353			});
47354		} else {
47355			ImagePin.currentPins.forEach(function (item , index){
47356				if(item.pinId == pinId) {
47357					item.action = 0;
47358				}
47359			});
47360		}
47361
47362		jQuery('.pin_edit_save').prop('disabled', false);
47363	}
47364};
47365
47366ImagePin.prototype.bindHoverEffect = function() {
47367	// remove previous binds
47368	var $this = this;
47369	var elements = jQuery('.visible_pin:not(.loaded_info)');
47370	elements.off( "mouseenter" );
47371
47372	elements.mouseenter(function() {
47373		var pin = jQuery(this);
47374
47375		if(!pin.hasClass('loaded_info')) {
47376			pin.addClass('loaded_info');
47377			new AjaxRequest({id: pin.attr('data-id'), x_axis: pin.attr("data-left"), y_axis: pin.attr("data-top"), vexPin: 0})
47378				.setController('ImagePin')
47379				.setAction('loadNewPinInfo')
47380				.onSuccess(function (res) {
47381					if(res.data.success) {
47382						var pinClass = 'loaded_' + pin.attr('data-id') + '_' + Date.now();
47383						var offset = pin.offset();
47384						var foundInfo = jQuery('.pin_info[class*="' + 'loaded_' + pin.attr('data-id') + '"]');
47385						if (typeof foundInfo[0] !== 'undefined' && ((foundInfo.css('top') === (offset.top + 'px')) && (foundInfo.css('left') === (offset.left + 'px')))) {
47386							pinClass = getClassLike(foundInfo.attr('class'), 'loaded_' + pin.attr('data-id'));
47387						} else {
47388							var info = jQuery(res.data.html).addClass(pinClass);
47389							if (pin.closest('.pins_wrap').find('.open_edit').attr('data-content-type') === 'fancybox') {
47390								info.addClass('show_above');
47391							}
47392							jQuery('.pins_info_body').append(info);
47393						}
47394						pin.addClass(pinClass);
47395						var newPinTab = jQuery('.pin_info.' + pinClass);
47396						newPinTab.hide();
47397
47398						var pinHeight = newPinTab.height();
47399						var windowHeight = jQuery(document).height();
47400
47401						if((pinHeight + offset.top) > windowHeight) {
47402							newPinTab.css({top: Math.floor(windowHeight - pinHeight)});
47403						}
47404
47405						jQuery('.' + pinClass).hover(function () {
47406							jQuery('.pin_info.' + pinClass).show();
47407						}, function () {
47408							jQuery('.pin_info.' + pinClass).hide();
47409						});
47410						if (jQuery('.' + pinClass + ':hover').length) {
47411							jQuery('.' + pinClass).trigger('mouseenter');
47412						}
47413					} else {
47414						$this.openErrorVex({
47415							'error'     : 'Function failed to return correct data.',
47416							'ajax_res'  : res
47417						});
47418					}
47419				})
47420				.onError(function (res) {
47421					$this.openErrorVex({
47422						'error'     : 'Ajax failed to return data.',
47423						'ajax_res'  : res
47424					});
47425				})
47426				.send();
47427		} else {
47428			// update position (for window resizing)
47429			var offset  = pin.offset();
47430			var classes = pin.attr("class").split(/\s+/);
47431
47432			var minLeftOffset = 86;
47433			var maxRightOffset = Math.floor(jQuery(window).width() - (108));
47434
47435			var offsetLeft = offset.left;
47436			if(offsetLeft >= minLeftOffset) {
47437				if(offsetLeft > maxRightOffset) {
47438					offsetLeft = maxRightOffset;
47439				}
47440			} else {
47441				offsetLeft = minLeftOffset;
47442			}
47443
47444			classes.forEach(function (itemClass) {
47445				if (itemClass.indexOf('loaded_') === 0) {
47446					var newPinTab = jQuery('.pin_info.' + itemClass);
47447					var windowHeight = jQuery(window).height();
47448					var pinOffTop = pin[0].getBoundingClientRect().top;
47449
47450					if((windowHeight - pinOffTop - 36) < 365 && pinOffTop > 365) {
47451						newPinTab.css({top: offset.top - 36, left: offsetLeft, transform: 'translate(-50%,-100%)'});
47452					} else if(pinOffTop > 365) {
47453						newPinTab.css({top: offset.top, left: offsetLeft, transform: 'translateX(-50%)'});
47454					} else {
47455						newPinTab.css({top: offset.top, left: offsetLeft, transform: 'translateX(-50%)'});
47456					}
47457				}
47458			});
47459		}
47460	});
47461};
47462ImagePin.prototype.bindDraggable = function () {
47463	var $this = this;
47464	var elements = jQuery('.pin_wrap');
47465
47466	elements.draggable({
47467		containment: '#active_image',
47468		iFrameFix  : true,
47469		stop       : function (e, ui) {
47470			var elem = jQuery('#active_image');
47471			var x_axis = ((ui.position.left / elem.innerWidth()) * 100).toFixed(2);
47472			var y_axis = ((ui.position.top / elem.innerHeight()) * 100).toFixed(2);
47473			jQuery(this).css({top: y_axis + '%', left: x_axis + '%'});
47474			var movedPin = jQuery(this).children();
47475			var id       = movedPin.attr('id');
47476			if (movedPin.hasClass('new_pin')) {
47477				$this.newPin.x = x_axis;
47478				$this.newPin.y = y_axis;
47479				jQuery('#product_auto')
47480					.trigger('input')
47481					.focus();
47482			} else {
47483				$this.currentPins.forEach(function (item) {
47484					if (item.pinId == id) {
47485						item.x = x_axis;
47486						item.y = y_axis;
47487						if (item.action != 1) {
47488							item.action = 2;
47489						}
47490					}
47491				});
47492			}
47493			jQuery('.pin_edit_save').prop('disabled', false);
47494		},
47495		start      : function (e, ui) {
47496			jQuery('.product_pin_autocomplete').hide();
47497		}
47498	});
47499};
47500ImagePin.prototype.saveNewPin = function (pinId) {
47501	var $this = this;
47502	new AjaxRequest({id: $this.newPin.id, x_axis: $this.newPin.x, y_axis: $this.newPin.y})
47503		.setController('ImagePin')
47504		.setAction('loadNewPinInfo')
47505		.onSuccess(function (res) {
47506			if (res.data.success) {
47507				var result = jQuery(res.data.html);
47508				result.find('.finished_pin')
47509					.attr('id', pinId)
47510					.append(jQuery($this.deleteButton));
47511				result.find('.pin_delete')
47512					.attr('onclick', 'ImagePin.deletePin("' + pinId + '")')
47513					.attr('title', $this.langs.help_title_rpin);
47514				jQuery('.new_wrap').replaceWith(result);
47515				$this.bindDraggable();
47516			} else {
47517				$this.openErrorVex({
47518					'error'   : 'Function failed to return correct data.',
47519					'ajax_res': res
47520				});
47521			}
47522		})
47523		.onError(function (res) {
47524			$this.openErrorVex({
47525				'error'   : 'Ajax failed to return data.',
47526				'ajax_res': res
47527			});
47528		})
47529		.send();
47530};
47531
47532ImagePin.prototype.initCustomSelect = function(){
47533	var $this = this;
47534	var selectBox = jQuery('.custom_select');
47535	var placeholderBox = jQuery('.custom_select_placeholder');
47536	var iconInput = jQuery('input[name=app1132_imagepin_icon_select]');
47537	var saveBox = '';
47538
47539	$this.originalValue = iconInput.val();
47540	placeholderBox.click(function (){
47541		if(selectBox.hasClass('closed')){
47542			selectBox.removeClass('closed').addClass('opened');
47543		} else {
47544			selectBox.removeClass('opened').addClass('closed');
47545		}
47546	});
47547
47548	selectBox.find('.custom_select_box_option').click(function (){
47549		var currentEl = jQuery(this);
47550		if(selectBox.hasClass('opened')){
47551			if(!currentEl.hasClass('selected')){
47552				selectBox.find('.custom_select_box .selected').removeClass('selected');
47553
47554				currentEl.addClass('selected');
47555				placeholderBox.find('.csi-icon').removeClass(iconInput.val()).addClass(currentEl.attr('data-value'));
47556				placeholderBox.find('.custom_select_box_placeholder_text').text(currentEl.attr('data-title'));
47557				iconInput.val(currentEl.attr('data-value'));
47558				selectBox.removeClass('opened').addClass('closed');
47559
47560
47561				if(iconInput.val() === $this.originalValue && saveBox.length) {
47562					saveBox.slideUp('slow');
47563				} else if (typeof js_fs_changes_monitor_notif !== 'undefined' && !saveBox.length){
47564					var fs_table = jQuery('.pin_product_settings');
47565					js_fs_changes_monitor_notif(fs_table.attr('id'));
47566					saveBox = fs_table.find('.save_cancel_container');
47567				} else {
47568					saveBox.slideDown('slow');
47569				}
47570			}
47571		}
47572	});
47573
47574	jQuery(window).click(function (e) {
47575		if(selectBox.hasClass('opened')){
47576			if(!jQuery('.custom_select').find(jQuery(e.target)).length){
47577				selectBox.removeClass('opened').addClass('closed');
47578			}
47579		}
47580	});
47581};
47582
47583ImagePin.prototype.initAdminTable = function (){
47584	var $this = this;
47585	var table = jQuery('#app_id_1132_dataTable');
47586	var checkedIds = [];
47587
47588	// nastavi custom callback na akcie v tabulke (search, order...)
47589	table.on('draw.dt' , function (){
47590		tableCallback();
47591	});
47592
47593	// definovanie stlpcov v tabulke
47594	var $columns =  [
47595		{
47596			"data": "id",
47597			"searchable" : false,
47598			"orderable" : false,
47599			"className" : 'number_container_cell'
47600		},
47601		{
47602			"data": "checkbox",
47603			"searchable" : false,
47604			"orderable" : false,
47605			"className" : 'checkbox_cell'
47606		},
47607		{
47608			"data": "set_name",
47609			"className" : 'pin_set_name'
47610		},
47611		{
47612			"data": "img_preview",
47613			"searchable" : false,
47614			"orderable" : false,
47615			"className" : 'pin_img_preview'
47616		},
47617		{
47618			"data": "url",
47619			"searchable" : false,
47620			"orderable" : false,
47621			"className" : 'pin_url'
47622		},
47623		{
47624			"data": "placement",
47625			"searchable" : true,
47626			"orderable" : true,
47627			"className" : 'pin_placement'
47628		},
47629		{
47630			"data": "pins",
47631			"orderable" : false,
47632			"className" : 'pin_pins'
47633		},
47634		{
47635			"data": "pincount",
47636			"searchable" : false,
47637			"className" : 'pin_pincount'
47638		},
47639		{
47640			"data": "cdate",
47641			"className" : 'pin_cdate'
47642		}
47643	];
47644
47645	// definovanie datatable
47646	table.DataTable({
47647		"dom"           : 'frtlip',
47648		"language"      : dataTablesLangs[cms_js_lang_2code],
47649		"columns"       : $columns,
47650		"order"         : [2, 'desc'],
47651		"processing"    : true,
47652		"paging"        : true,
47653		"pageLength"    : 10, // defaultne nacinane
47654		"lengthMenu"    : [[10, 25, 50, 100, 150], [10, 25, 50, 100, 150]],
47655		"serverSide"    : true,
47656		"ajax"          : {
47657			"url": js_global_live_site + '/includes/ajax_handle.php?controller=ImagePin&action=loadTablePage',
47658			"type": "POST",
47659			"beforeSend": function (request) {
47660				if (typeof js_CS_Config_csrf !== 'undefined' && js_CS_Config_csrf && typeof js_CS_Config_csrf_header !== 'undefined' && js_CS_Config_csrf_header) {
47661					request.setRequestHeader(js_CS_Config_csrf_header, jQuery('meta[name="csrf-token"]').attr('content'));
47662				}
47663			}
47664		},
47665		"initComplete" : function(){
47666			tableCallback();
47667		}
47668	});
47669
47670	var tableCallback = function () {
47671		var checkboxes = jQuery('input[name="pin_check"]');
47672
47673		// listenery musia sa vypnut lebo sa nahodia nove kazdou akciou v tabulke
47674		jQuery('.pin_product_settings input[name="pin_check"], .pin_product_settings #check_all_pins, .pin_product_settings .image-pin-delete, .pin_product_settings .row_action_edit').off();
47675
47676		// doladovacie styly
47677		table.parent().addClass('adminlist-container');
47678		table.find('.odd').addClass('row0 adminlist_data_row');
47679		table.find('.even').addClass('row1 adminlist_data_row');
47680		table.css('width', '100%');
47681
47682		// zozbieranie oznacenych riadkov
47683		checkboxes.each(function(index,item){
47684			var el = jQuery(item);
47685			if(checkedIds.indexOf(el.attr('data-id')) != -1){
47686				el.closest('tr').addClass('adminlist-tr-checked');
47687				el.prop('checked', true);
47688			}
47689		});
47690
47691		// pri oznaceni pridat do pola oznacenych
47692		checkboxes.click(function (){
47693			var check = jQuery(this);
47694
47695			if(check.is(':checked')) {
47696				checkedIds.push(check.attr('data-id'));
47697			} else {
47698				var index = checkedIds.indexOf(check.attr('data-id'));
47699				if (index > -1) {
47700					checkedIds.splice(index, 1);
47701				}
47702			}
47703
47704			if(checkedIds.length) {
47705				jQuery('.image-pin-delete').show();
47706			} else {
47707				jQuery('.image-pin-delete').hide();
47708			}
47709		});
47710
47711		// oznac vsetky
47712		jQuery('#check_all_pins').click(function (){
47713			if(jQuery(this).is(':checked')){
47714				checkboxes.each(function(index,item){
47715					var id = jQuery(item).attr('data-id');
47716					if(checkedIds.indexOf(id) == -1){
47717						checkedIds.push(id);
47718					}
47719				});
47720				if(checkedIds.length) {
47721					jQuery('.image-pin-delete').show();
47722				}
47723			} else {
47724				checkboxes.each(function(index,item){
47725					var id = jQuery(item).attr('data-id');
47726					if(checkedIds.indexOf(id) != -1){
47727						checkedIds.splice(checkedIds.indexOf(id), 1);
47728					}
47729				});
47730				if(!checkedIds.length) {
47731					jQuery('.image-pin-delete').hide();
47732				}
47733			}
47734		});
47735
47736		// delete selected rows
47737		jQuery('.image-pin-delete').click(function(e){
47738			e.preventDefault();
47739			vex.dialog.confirm({
47740				message : $this.langs.warning,
47741				input : $this.langs.delete_pins,
47742				escapeButtonCloses : false,
47743				showCloseButton: false,
47744				className : 'vex-cs alert vex_pin_warning',
47745				callback: function (confirmed) {
47746					if (confirmed) {
47747						checkedIds.forEach(function (value) {
47748							$this.deleteAllPins(value);
47749						});
47750
47751						jQuery('#app_id_1132_dataTable').DataTable().ajax.reload();
47752					} else {
47753						return false;
47754					}
47755				}
47756			});
47757		});
47758
47759		// open edit vex
47760		jQuery('.pin_product_settings .row_action_edit').click(function(e) {
47761			e.preventDefault();
47762			var elem = jQuery(this);
47763			$this.openEditVex(elem, 'table');
47764		});
47765	};
47766};
47767
47768ImagePin.prototype.openErrorVex = function (data) {
47769	var $this = this;
47770
47771	if ( is_cs_user() ) {
47772		console.log(data.error);
47773		if((data.ajax_res).length) {
47774			console.log(data.ajax_res);
47775		}
47776	}
47777
47778	if (typeof data.custom !== 'undefined'){
47779		vex.dialog.alert({
47780			className : 'vex-cs alert vex_pin_warning',
47781			message : $this.langs.warning,
47782			input : data.custom
47783		});
47784	} else {
47785		vex.dialog.alert({
47786			className : 'vex-cs alert vex_pin_warning',
47787			message : $this.langs.warning,
47788			input : $this.langs.error_occured
47789		});
47790	}
47791};
47792// zmaz obrazok a jeho piny. ID z db.
47793ImagePin.prototype.deleteAllPins = function (id) {
47794	new AjaxRequest({id: id})
47795		.setController('ImagePin')
47796		.setAction('deleteAllPins')
47797		.send();
47798};
47799
47800ImagePin = new ImagePin();
47801
47802// Helpers
47803
47804function getClassLike (classString, classNeedle) {
47805	var $this = this;
47806	var foundClass = '';
47807	var classArr = classString.split(/\s+/);
47808
47809	classArr.forEach(function (itemClass){
47810		if(itemClass.indexOf(classNeedle) === 0){
47811			foundClass = itemClass;
47812		}
47813	});
47814
47815	return foundClass;
47816}
47817
47818// true = enable | false = disable
47819function toggleScroll(mode) {
47820	if(mode) {
47821		window.onscroll = function() {};
47822	} else {
47823		var top = window.pageYOffset || document.documentElement.scrollTop;
47824		var left = window.pageXOffset || document.documentElement.scrollLeft;
47825
47826		window.onscroll = function() {
47827			window.scrollTo(left, top);
47828		};
47829	}
47830}
47831
47832

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.