Plugin Directory

Changeset 3143150


Ignore:
Timestamp:
08/28/2024 06:50:03 PM (19 months ago)
Author:
webikon
Message:

Add ability to hide parcelshops from interactive map

Location:
wc-dpd
Files:
98 added
15 edited

Legend:

Unmodified
Added
Removed
  • wc-dpd/trunk/includes/DpdParcelShopShippingMethod.php

    r3115058 r3143150  
    1010    public const SHIPPING_PRICE_TYPE_OPTION_KEY = 'wc_dpd_shipping_price_type';
    1111    public const FREE_FIXED_SHIPPING_OPTION_KEY = 'wc_dpd_free_shipping_price';
     12    public const DISALLOW_SHOPS_OPTION_KEY = 'wc_dpd_disallow_shops';
     13    public const DISALLOW_LOCKERS_OPTION_KEY = 'wc_dpd_disallow_lockers';
     14    public const DISALLOW_DPD_PICKUP_STATIONS_OPTION_KEY = 'wc_dpd_disallow_dpd_pickup_stations';
     15    public const DISALLOW_SK_POST_OPTION_KEY = 'wc_dpd_disallow_sk_post';
     16    public const DISALLOW_ALZA_BOXES_OPTION_KEY = 'wc_dpd_disallow_alza_boxes';
    1217    public const PRODUCTS_WEIGHT_SHIPPING_RATES_OPTION_KEY = 'wc_dpd_products_weight_shipping_rates';
    1318    public const PACKAGE_WEIGHT_SHIPPING_LIMITS_OPTION_KEY = 'wc_dpd_package_weight_shipping_limits';
     
    3338    public const PARCELSHOP_COUNTRY_CODE_META_KEY = 'wc_dpd_parcelshop_country_code';
    3439    public const PARCELSHOP_COUNTRY_NAME_META_KEY = 'wc_dpd_parcelshop_country_name';
    35     public const PARCELSHOP_MAX_WEIGHT_META_KEY = 'wc_dpd_parcelshop_max_weight';
    36     public const PARCELSHOP_COD_META_KEY = 'wc_dpd_parcelshop_cod';
    37     public const PARCELSHOP_CARD_META_KEY = 'wc_dpd_parcelshop_card';
    38     public const PARCELSHOP_IS_ALZABOX_ELIGIBLE_META_KEY = 'wc_dpd_parcelshop_is_alzabox_eligible';
    39     public const PARCELSHOP_IS_SLOVENSKA_POSTA_ELIGIBLE_META_KEY = 'wc_dpd_parcelshop_is_slovenska_posta_eligible';
     40    public const PARCELSHOP_MAX_WEIGHT_META_KEY = 'wc_dpd_parcelshop_max_weight';
     41    public const PARCELSHOP_COD_META_KEY = 'wc_dpd_parcelshop_cod';
     42    public const PARCELSHOP_CARD_META_KEY = 'wc_dpd_parcelshop_card';
     43    public const PARCELSHOP_IS_ALZABOX_ELIGIBLE_META_KEY = 'wc_dpd_parcelshop_is_alzabox_eligible';
     44    public const PARCELSHOP_IS_SLOVENSKA_POSTA_ELIGIBLE_META_KEY = 'wc_dpd_parcelshop_is_slovenska_posta_eligible';
    4045
    4146    /**
     
    235240                'class' => 'js-dpd-dimension-limit-shipping-type',
    236241            ],
     242            self::DISALLOW_SHOPS_OPTION_KEY => [
     243                'title' => __('Disallow Shops', 'wc-dpd'),
     244                'type' => 'checkbox',
     245                'default' => false,
     246                'desc_tip' => true,
     247                'description' => __('If checked, DPD Pickup shops will be disabled.', 'wc-dpd'),
     248            ],
     249            self::DISALLOW_LOCKERS_OPTION_KEY => [
     250                'title' => __('Disallow Lockers', 'wc-dpd'),
     251                'type' => 'checkbox',
     252                'default' => false,
     253                'desc_tip' => true,
     254                'description' => __('If checked, all locker types will be disabled.', 'wc-dpd'),
     255            ],
     256            self::DISALLOW_DPD_PICKUP_STATIONS_OPTION_KEY => [
     257                'title' => __('Disallow DPD Pickup Stations', 'wc-dpd'),
     258                'type' => 'checkbox',
     259                'default' => false,
     260                'desc_tip' => true,
     261                'description' => __('If checked, DPD Pickup Stations will be disabled.', 'wc-dpd'),
     262            ],
     263            self::DISALLOW_SK_POST_OPTION_KEY => [
     264                'title' => __('Disallow Slovenská Pošta Boxes', 'wc-dpd'),
     265                'type' => 'checkbox',
     266                'default' => false,
     267                'desc_tip' => true,
     268                'description' => __('If checked, Slovenská Pošta boxes will be disabled.', 'wc-dpd'),
     269            ],
     270            self::DISALLOW_ALZA_BOXES_OPTION_KEY => [
     271                'title' => __('Disallow Alza Boxes', 'wc-dpd'),
     272                'type' => 'checkbox',
     273                'default' => false,
     274                'desc_tip' => true,
     275                'description' => __('If checked, Alza Boxes will be disabled.', 'wc-dpd'),
     276            ],
    237277        ];
    238278    }
  • wc-dpd/trunk/includes/Shipping.php

    r3115058 r3143150  
    112112            return $method;
    113113        }
     114
     115        $parcelshop_shipping_method_settings = DpdParcelShopShippingMethod::getSettings();
    114116
    115117        // Get allowed countries codes in lowercase
     
    181183            }
    182184        }
     185
     186
     187        $disallow_shops = isset($parcelshop_shipping_method_settings[DpdParcelShopShippingMethod::DISALLOW_SHOPS_OPTION_KEY]) ? filter_var($parcelshop_shipping_method_settings[DpdParcelShopShippingMethod::DISALLOW_SHOPS_OPTION_KEY], FILTER_VALIDATE_BOOL) : false;
     188        $disallow_lockers = isset($parcelshop_shipping_method_settings[DpdParcelShopShippingMethod::DISALLOW_LOCKERS_OPTION_KEY]) ? filter_var($parcelshop_shipping_method_settings[DpdParcelShopShippingMethod::DISALLOW_LOCKERS_OPTION_KEY], FILTER_VALIDATE_BOOL) : false;
     189        $disallow_dpd_pickup_stations = isset($parcelshop_shipping_method_settings[DpdParcelShopShippingMethod::DISALLOW_DPD_PICKUP_STATIONS_OPTION_KEY]) ? filter_var($parcelshop_shipping_method_settings[DpdParcelShopShippingMethod::DISALLOW_DPD_PICKUP_STATIONS_OPTION_KEY], FILTER_VALIDATE_BOOL) : false;
     190        $disallow_sk_post = isset($parcelshop_shipping_method_settings[DpdParcelShopShippingMethod::DISALLOW_SK_POST_OPTION_KEY]) ? filter_var($parcelshop_shipping_method_settings[DpdParcelShopShippingMethod::DISALLOW_SK_POST_OPTION_KEY], FILTER_VALIDATE_BOOL) : false;
     191        $disallow_alza_boxes = isset($parcelshop_shipping_method_settings[DpdParcelShopShippingMethod::DISALLOW_ALZA_BOXES_OPTION_KEY]) ? filter_var($parcelshop_shipping_method_settings[DpdParcelShopShippingMethod::DISALLOW_ALZA_BOXES_OPTION_KEY], FILTER_VALIDATE_BOOL) : false;
    183192
    184193        echo include_template('parcelshop-shipping-method-content.php', [
     
    200209            'is_cod_required' => $is_cod_required,
    201210            'is_card_required' => $is_card_required,
     211            'disallow_shops' => $disallow_shops,
     212            'disallow_lockers' => $disallow_lockers,
     213            'disallow_dpd_pickup_stations' => $disallow_dpd_pickup_stations,
     214            'disallow_sk_post' => $disallow_sk_post,
     215            'disallow_alza_boxes' => $disallow_alza_boxes,
    202216        ]);
    203217
  • wc-dpd/trunk/languages/wc-dpd-sk_SK.po

    r3116019 r3143150  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: DPD SK for WooCommerce - 6.0.1\n"
     3"Project-Id-Version: DPD SK for WooCommerce - 7.0.0\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2024-06-27 12:18+0200\n"
    6 "PO-Revision-Date: 2024-06-27 12:20+0200\n"
     5"POT-Creation-Date: 2024-08-28 07:57+0200\n"
     6"PO-Revision-Date: 2024-08-28 08:01+0200\n"
    77"Last-Translator: \n"
    88"Language-Team: Slovenčina\n"
     
    8686msgstr "DPD 18:00 / DPD Guarantee"
    8787
    88 #: includes/DpdExportSettings.php:170
     88#: includes/DpdExportSettings.php:174
    8989msgid "ID delis"
    9090msgstr "ID delis"
    9191
    92 #: includes/DpdExportSettings.php:171
     92#: includes/DpdExportSettings.php:175
    9393msgid "This is the username you got from DPD to login to their service"
    9494msgstr ""
     
    9696"prihlásenie do ich služby"
    9797
    98 #: includes/DpdExportSettings.php:172
     98#: includes/DpdExportSettings.php:176
    9999msgid "Unique customer identifier assigned by DPD."
    100100msgstr "Jedinečný identifikátor zákazníka pridelený spoločnosťou DPD."
    101101
    102 #: includes/DpdExportSettings.php:177
     102#: includes/DpdExportSettings.php:181
    103103msgid "Client email"
    104104msgstr "E-mail klienta"
    105105
    106 #: includes/DpdExportSettings.php:181
     106#: includes/DpdExportSettings.php:185
    107107msgid "API key"
    108108msgstr "API kľúč"
    109109
    110 #: includes/DpdExportSettings.php:182
     110#: includes/DpdExportSettings.php:186
    111111msgid "Your api key"
    112112msgstr "Kľúč API"
    113113
    114 #: includes/DpdExportSettings.php:183
     114#: includes/DpdExportSettings.php:187
    115115msgid "Unique authentication key required to access API."
    116116msgstr "Jedinečný autentifikačný kľúč potrebný na prístup k rozhraniu API."
    117117
    118 #: includes/DpdExportSettings.php:188
     118#: includes/DpdExportSettings.php:192
    119119msgid "Bank account ID"
    120120msgstr "ID bankového účtu"
    121121
    122 #: includes/DpdExportSettings.php:191
     122#: includes/DpdExportSettings.php:195
    123123msgid "Bank account"
    124124msgstr "Bankový účet"
    125125
    126 #: includes/DpdExportSettings.php:192
     126#: includes/DpdExportSettings.php:196
    127127msgid "Add bank account"
    128128msgstr "Pridať bankový účet"
    129129
    130 #: includes/DpdExportSettings.php:193
     130#: includes/DpdExportSettings.php:197
    131131msgid "Select your default bank account."
    132132msgstr "Vyberte svoj predvolený bankový účet."
    133133
    134 #: includes/DpdExportSettings.php:196
     134#: includes/DpdExportSettings.php:200
    135135msgid "ID of the collection address"
    136136msgstr "ID adresy pre zber"
    137137
    138 #: includes/DpdExportSettings.php:199
     138#: includes/DpdExportSettings.php:203
    139139msgid "Address"
    140140msgstr "Adresa"
    141141
    142 #: includes/DpdExportSettings.php:200
     142#: includes/DpdExportSettings.php:204
    143143msgid "Add address"
    144144msgstr "Pridať adresu"
    145145
    146 #: includes/DpdExportSettings.php:201
     146#: includes/DpdExportSettings.php:205
    147147msgid "Select your default address."
    148148msgstr "Vyberte svoju predvolenú adresu."
    149149
    150 #: includes/DpdExportSettings.php:204
     150#: includes/DpdExportSettings.php:208
    151151msgid "Transport"
    152152msgstr "Doprava"
    153153
    154 #: includes/DpdExportSettings.php:210
     154#: includes/DpdExportSettings.php:214
    155155msgid "Notifications"
    156156msgstr "Notifikácie"
    157157
    158 #: includes/DpdExportSettings.php:216
     158#: includes/DpdExportSettings.php:220
    159159msgid "Labels format"
    160160msgstr "Formát štítkov"
    161161
    162 #: includes/DpdExportSettings.php:225
     162#: includes/DpdExportSettings.php:229
    163163msgid "Enable Map Widget"
    164164msgstr "Povoliť widget mapy"
    165165
    166 #: includes/DpdExportSettings.php:228
     166#: includes/DpdExportSettings.php:232
    167167msgid ""
    168168"Enable this option to display the map widget. If enabled, a valid Map API "
     
    172172"správne fungovanie widgetu je potrebný platný kľúč Map API."
    173173
    174 #: includes/DpdExportSettings.php:232
     174#: includes/DpdExportSettings.php:236
    175175msgid "Map API Key"
    176176msgstr "API kľúč mapy"
    177177
    178 #: includes/DpdExportSettings.php:234
     178#: includes/DpdExportSettings.php:238
    179179msgid ""
    180180"Enter a valid DPD Map API Key. This is required if the Map Widget is enabled."
     
    183183"widget mapy."
    184184
    185 #: includes/DpdExportSettings.php:279
    186 #: includes/DpdParcelShopShippingMethod.php:455
     185#: includes/DpdExportSettings.php:283
     186#: includes/DpdParcelShopShippingMethod.php:495
    187187msgid "Remove"
    188188msgstr "Odstrániť"
    189189
    190 #: includes/DpdExportSettings.php:280
    191 #: includes/DpdParcelShopShippingMethod.php:456
     190#: includes/DpdExportSettings.php:284
     191#: includes/DpdParcelShopShippingMethod.php:496
    192192msgid "Title"
    193193msgstr "Názov"
    194194
    195 #: includes/DpdExportSettings.php:281
     195#: includes/DpdExportSettings.php:285
    196196msgid "Value"
    197197msgstr "Hodnota"
    198198
    199 #: includes/DpdParcelShopShippingMethod.php:52
     199#: includes/DpdParcelShopShippingMethod.php:57
    200200msgid "DPD parcelshop"
    201201msgstr "DPD Pickup/Pickup Station"
    202202
    203 #: includes/DpdParcelShopShippingMethod.php:53
     203#: includes/DpdParcelShopShippingMethod.php:58
    204204msgid "Allow customers to deliver to the DPD parcelshops."
    205205msgstr "Umožnite zákazníkom doručovať zásielky do DPD Pickup/Pickup Station."
    206206
    207 #: includes/DpdParcelShopShippingMethod.php:75
     207#: includes/DpdParcelShopShippingMethod.php:80
    208208msgid "DPD Pickup/Pickup Station"
    209209msgstr "DPD Pickup/Pickup Station"
    210210
    211 #: includes/DpdParcelShopShippingMethod.php:102
     211#: includes/DpdParcelShopShippingMethod.php:107
    212212msgid "Tax status"
    213213msgstr "Zdaniteľnosť"
    214214
    215 #: includes/DpdParcelShopShippingMethod.php:107
     215#: includes/DpdParcelShopShippingMethod.php:112
    216216msgctxt "Tax status"
    217217msgid "None"
    218218msgstr "Nezdaňuje sa"
    219219
    220 #: includes/DpdParcelShopShippingMethod.php:108
     220#: includes/DpdParcelShopShippingMethod.php:113
    221221msgid "Taxable"
    222222msgstr "Zdaniteľný"
    223223
    224 #: includes/DpdParcelShopShippingMethod.php:112
     224#: includes/DpdParcelShopShippingMethod.php:117
    225225msgid "Shipping type"
    226226msgstr "Typ dopravy"
    227227
    228 #: includes/DpdParcelShopShippingMethod.php:115
     228#: includes/DpdParcelShopShippingMethod.php:120
    229229msgid "Fixed shipping price"
    230230msgstr "Pevná cena dopravy"
    231231
    232 #: includes/DpdParcelShopShippingMethod.php:116
     232#: includes/DpdParcelShopShippingMethod.php:121
    233233msgid "Products weight based shipping price"
    234234msgstr "Sadzba dopravy podľa hmotnosti produktov"
    235235
    236 #: includes/DpdParcelShopShippingMethod.php:118
     236#: includes/DpdParcelShopShippingMethod.php:123
    237237msgid "Choose type of the shipping."
    238238msgstr "Vyberte typ dopravy."
    239239
    240 #: includes/DpdParcelShopShippingMethod.php:123
     240#: includes/DpdParcelShopShippingMethod.php:128
    241241msgid "Delivery fee"
    242242msgstr "Poplatok"
    243243
    244 #: includes/DpdParcelShopShippingMethod.php:125
     244#: includes/DpdParcelShopShippingMethod.php:130
    245245msgid "What fee do you want to charge for shipping to the parcelshop."
    246246msgstr "Aký poplatok chcete účtovať za prepravu do DPD Pickup/Pickup Station."
    247247
    248 #: includes/DpdParcelShopShippingMethod.php:132
     248#: includes/DpdParcelShopShippingMethod.php:137
    249249msgid "Free shipping from"
    250250msgstr "Doprava zdarma od"
    251251
    252 #: includes/DpdParcelShopShippingMethod.php:134
     252#: includes/DpdParcelShopShippingMethod.php:139
    253253msgid "If you exceed the price in the cart, shipping will be free."
    254254msgstr "Ak prekročíte cenu v košíku, poštovné bude zadarmo."
    255255
    256 #: includes/DpdParcelShopShippingMethod.php:141
     256#: includes/DpdParcelShopShippingMethod.php:146
    257257msgid "Products weight based shipping rates"
    258258msgstr "Sadzby dopravy podľa hmotnosti produktov"
    259259
    260 #: includes/DpdParcelShopShippingMethod.php:143
     260#: includes/DpdParcelShopShippingMethod.php:148
    261261msgid "Add shipping rates based on the weight of products in the cart."
    262262msgstr "Pridajte sadzby za dopravu na základe hmotnosti produktov v košíku."
    263263
    264 #: includes/DpdParcelShopShippingMethod.php:145
     264#: includes/DpdParcelShopShippingMethod.php:150
    265265msgid "Shipping rate"
    266266msgstr "Sadzba za prepravu"
    267267
    268 #: includes/DpdParcelShopShippingMethod.php:146
     268#: includes/DpdParcelShopShippingMethod.php:151
    269269#, php-format
    270270msgid "Min weight (%s)"
    271271msgstr "Min. hmotnosť (%s)"
    272272
    273 #: includes/DpdParcelShopShippingMethod.php:147
     273#: includes/DpdParcelShopShippingMethod.php:152
    274274#, php-format
    275275msgid "Max weight (%s)"
    276276msgstr "Max. hmotnosť (%s)"
    277277
    278 #: includes/DpdParcelShopShippingMethod.php:148
    279 #: includes/DpdParcelShopShippingMethod.php:151
     278#: includes/DpdParcelShopShippingMethod.php:153
     279#: includes/DpdParcelShopShippingMethod.php:156
    280280msgid "Price"
    281281msgstr "Cena"
    282282
    283 #: includes/DpdParcelShopShippingMethod.php:148
     283#: includes/DpdParcelShopShippingMethod.php:153
    284284msgid "with"
    285285msgstr "s"
    286286
    287 #: includes/DpdParcelShopShippingMethod.php:148
     287#: includes/DpdParcelShopShippingMethod.php:153
    288288msgid "without"
    289289msgstr "bez"
    290290
    291 #: includes/DpdParcelShopShippingMethod.php:148
     291#: includes/DpdParcelShopShippingMethod.php:153
    292292msgid "tax"
    293293msgstr "DPH"
    294294
    295 #: includes/DpdParcelShopShippingMethod.php:149
     295#: includes/DpdParcelShopShippingMethod.php:154
    296296msgid "Min weight"
    297297msgstr "Min. hmotnosť"
    298298
    299 #: includes/DpdParcelShopShippingMethod.php:150
     299#: includes/DpdParcelShopShippingMethod.php:155
    300300msgid "Max weight"
    301301msgstr "Max. hmotnosť"
    302302
    303 #: includes/DpdParcelShopShippingMethod.php:152
     303#: includes/DpdParcelShopShippingMethod.php:157
    304304msgid "Add a shipping rate"
    305305msgstr "Pridať sadzbu dopravy"
    306306
    307 #: includes/DpdParcelShopShippingMethod.php:156
     307#: includes/DpdParcelShopShippingMethod.php:161
    308308msgid "Setting the weight limits for packages"
    309309msgstr "Nastavenie hmotnostných limitov pre balíky"
    310310
    311 #: includes/DpdParcelShopShippingMethod.php:157
     311#: includes/DpdParcelShopShippingMethod.php:162
    312312msgid ""
    313313"If the shipment does not meet the conditions for delivery in a parcelbox, "
     
    317317"dopravy sa nezobrazí."
    318318
    319 #: includes/DpdParcelShopShippingMethod.php:164
     319#: includes/DpdParcelShopShippingMethod.php:169
    320320msgid "Maximum weight"
    321321msgstr "Maximálna hmotnosť"
    322322
    323 #: includes/DpdParcelShopShippingMethod.php:171
     323#: includes/DpdParcelShopShippingMethod.php:176
    324324msgid "Maximum weight for Alzabox"
    325325msgstr "Maximálna hmotnosť pre Alzabox"
    326326
    327 #: includes/DpdParcelShopShippingMethod.php:178
     327#: includes/DpdParcelShopShippingMethod.php:183
    328328msgid "Maximum weight for Slovenska Posta box"
    329329msgstr "Maximálna hmotnosť pre box Slovenskej Pošty"
    330330
    331 #: includes/DpdParcelShopShippingMethod.php:185
     331#: includes/DpdParcelShopShippingMethod.php:190
    332332msgid "Setting the dimension limits for packages"
    333333msgstr "Nastavenie rozmerových limitov pre balíky"
    334334
    335 #: includes/DpdParcelShopShippingMethod.php:186
     335#: includes/DpdParcelShopShippingMethod.php:191
    336336msgid ""
    337337"If the shipment does not meet the conditions for delivery in a box, this "
     
    341341"dopravy sa nezobrazí."
    342342
    343 #: includes/DpdParcelShopShippingMethod.php:193
     343#: includes/DpdParcelShopShippingMethod.php:198
    344344msgid "Maximum width"
    345345msgstr "Maximálna šírka"
    346346
    347 #: includes/DpdParcelShopShippingMethod.php:198
     347#: includes/DpdParcelShopShippingMethod.php:203
    348348msgid "Maximum height"
    349349msgstr "Maximálna výška"
    350350
    351 #: includes/DpdParcelShopShippingMethod.php:203
     351#: includes/DpdParcelShopShippingMethod.php:208
    352352msgid "Maximum length"
    353353msgstr "Maximálna dĺžka"
    354354
    355 #: includes/DpdParcelShopShippingMethod.php:208
     355#: includes/DpdParcelShopShippingMethod.php:213
    356356msgid "Maximum width for Alzabox"
    357357msgstr "Maximálna šírka pre Alzabox"
    358358
    359 #: includes/DpdParcelShopShippingMethod.php:213
     359#: includes/DpdParcelShopShippingMethod.php:218
    360360msgid "Maximum height for Alzabox"
    361361msgstr "Maximálna výška pre Alzabox"
    362362
    363 #: includes/DpdParcelShopShippingMethod.php:218
     363#: includes/DpdParcelShopShippingMethod.php:223
    364364msgid "Maximum length for Alzabox"
    365365msgstr "Maximálna dĺžka pre Alzabox"
    366366
    367 #: includes/DpdParcelShopShippingMethod.php:223
     367#: includes/DpdParcelShopShippingMethod.php:228
    368368msgid "Maximum width for Slovenska Posta box"
    369369msgstr "Maximálna šírka pre box Slovenskej Pošty"
    370370
    371 #: includes/DpdParcelShopShippingMethod.php:228
     371#: includes/DpdParcelShopShippingMethod.php:233
    372372msgid "Maximum height for Slovenska Posta box"
    373373msgstr "Maximálna výška pre box Slovenskej Pošty"
    374374
    375 #: includes/DpdParcelShopShippingMethod.php:233
     375#: includes/DpdParcelShopShippingMethod.php:238
    376376msgid "Maximum length for Slovenska Posta box"
    377377msgstr "Maximálna dĺžka pre box Slovenskej Pošty"
     378
     379#: includes/DpdParcelShopShippingMethod.php:243
     380msgid "Disallow Shops"
     381msgstr "Zakázať odberné miesta"
     382
     383#: includes/DpdParcelShopShippingMethod.php:247
     384msgid "If checked, DPD Pickup shops will be disabled."
     385msgstr "Ak je začiarknuté, všetky DPD Pickup odberné miesta budú zakázané."
     386
     387#: includes/DpdParcelShopShippingMethod.php:250
     388msgid "Disallow Lockers"
     389msgstr "Zakázať samoobslužné boxy"
     390
     391#: includes/DpdParcelShopShippingMethod.php:254
     392msgid "If checked, all locker types will be disabled."
     393msgstr "Ak je začiarknuté, všetky samoobslužné boxy budú zakázané."
     394
     395#: includes/DpdParcelShopShippingMethod.php:257
     396msgid "Disallow DPD Pickup Stations"
     397msgstr "Zakázať DPD Pickup samoobslužné boxy"
     398
     399#: includes/DpdParcelShopShippingMethod.php:261
     400msgid "If checked, DPD Pickup Stations will be disabled."
     401msgstr "Ak je začiarknuté, samoobslužné boxy DPD Pickup budú zakázané."
     402
     403#: includes/DpdParcelShopShippingMethod.php:264
     404msgid "Disallow Slovenská Pošta Boxes"
     405msgstr "Zakázať samoobslužné boxy Slovenskej Pošty"
     406
     407#: includes/DpdParcelShopShippingMethod.php:268
     408msgid "If checked, Slovenská Pošta boxes will be disabled."
     409msgstr "Ak je začiarknuté, samoobslužné boxy Slovenskej Pošty budú zakázané."
     410
     411#: includes/DpdParcelShopShippingMethod.php:271
     412msgid "Disallow Alza Boxes"
     413msgstr "Zakázať Alza samoobslužné boxy"
     414
     415#: includes/DpdParcelShopShippingMethod.php:275
     416msgid "If checked, Alza Boxes will be disabled."
     417msgstr "Ak je začiarknuté, samoobslužné Alza boxy budú zakázané."
    378418
    379419#: includes/Order.php:52
     
    538578
    539579#: templates/parcelshop-popup.php:49
    540 #: templates/parcelshop-shipping-method-content.php:36
    541 #: templates/parcelshop-shipping-method-content.php:38
     580#: templates/parcelshop-shipping-method-content.php:57
     581#: templates/parcelshop-shipping-method-content.php:59
    542582msgid "Choose parcelshop"
    543583msgstr "Vybrať DPD Pickup/Pickup Station"
    544584
    545 #: templates/parcelshop-shipping-method-content.php:43
     585#: templates/parcelshop-shipping-method-content.php:64
    546586msgid "Selected parcelshop"
    547587msgstr "Vybraná DPD Pickup/Pickup Station"
  • wc-dpd/trunk/languages/wc-dpd.pot

    r3116019 r3143150  
    44msgid ""
    55msgstr ""
    6 "Project-Id-Version: DPD SK for WooCommerce - 6.0.1\n"
     6"Project-Id-Version: DPD SK for WooCommerce - 7.0.0\n"
    77"Report-Msgid-Bugs-To: \n"
    8 "POT-Creation-Date: 2024-06-27 12:18+0200\n"
     8"POT-Creation-Date: 2024-08-28 07:57+0200\n"
    99"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1010"Last-Translator: Webikon <support@webikon.sk>\n"
     
    9494msgstr ""
    9595
    96 #: includes/DpdExportSettings.php:170
     96#: includes/DpdExportSettings.php:174
    9797msgid "ID delis"
    9898msgstr ""
    9999
    100 #: includes/DpdExportSettings.php:171
     100#: includes/DpdExportSettings.php:175
    101101msgid "This is the username you got from DPD to login to their service"
    102102msgstr ""
    103103
    104 #: includes/DpdExportSettings.php:172
     104#: includes/DpdExportSettings.php:176
    105105msgid "Unique customer identifier assigned by DPD."
    106106msgstr ""
    107107
    108 #: includes/DpdExportSettings.php:177
     108#: includes/DpdExportSettings.php:181
    109109msgid "Client email"
    110110msgstr ""
    111111
    112 #: includes/DpdExportSettings.php:181
     112#: includes/DpdExportSettings.php:185
    113113msgid "API key"
    114114msgstr ""
    115115
    116 #: includes/DpdExportSettings.php:182
     116#: includes/DpdExportSettings.php:186
    117117msgid "Your api key"
    118118msgstr ""
    119119
    120 #: includes/DpdExportSettings.php:183
     120#: includes/DpdExportSettings.php:187
    121121msgid "Unique authentication key required to access API."
    122122msgstr ""
    123123
    124 #: includes/DpdExportSettings.php:188
     124#: includes/DpdExportSettings.php:192
    125125msgid "Bank account ID"
    126126msgstr ""
    127127
    128 #: includes/DpdExportSettings.php:191
     128#: includes/DpdExportSettings.php:195
    129129msgid "Bank account"
    130130msgstr ""
    131131
    132 #: includes/DpdExportSettings.php:192
     132#: includes/DpdExportSettings.php:196
    133133msgid "Add bank account"
    134134msgstr ""
    135135
    136 #: includes/DpdExportSettings.php:193
     136#: includes/DpdExportSettings.php:197
    137137msgid "Select your default bank account."
    138138msgstr ""
    139139
    140 #: includes/DpdExportSettings.php:196
     140#: includes/DpdExportSettings.php:200
    141141msgid "ID of the collection address"
    142142msgstr ""
    143143
    144 #: includes/DpdExportSettings.php:199
     144#: includes/DpdExportSettings.php:203
    145145msgid "Address"
    146146msgstr ""
    147147
    148 #: includes/DpdExportSettings.php:200
     148#: includes/DpdExportSettings.php:204
    149149msgid "Add address"
    150150msgstr ""
    151151
    152 #: includes/DpdExportSettings.php:201
     152#: includes/DpdExportSettings.php:205
    153153msgid "Select your default address."
    154154msgstr ""
    155155
    156 #: includes/DpdExportSettings.php:204
     156#: includes/DpdExportSettings.php:208
    157157msgid "Transport"
    158158msgstr ""
    159159
    160 #: includes/DpdExportSettings.php:210
     160#: includes/DpdExportSettings.php:214
    161161msgid "Notifications"
    162162msgstr ""
    163163
    164 #: includes/DpdExportSettings.php:216
     164#: includes/DpdExportSettings.php:220
    165165msgid "Labels format"
    166166msgstr ""
    167167
    168 #: includes/DpdExportSettings.php:225
     168#: includes/DpdExportSettings.php:229
    169169msgid "Enable Map Widget"
    170170msgstr ""
    171171
    172 #: includes/DpdExportSettings.php:228
     172#: includes/DpdExportSettings.php:232
    173173msgid "Enable this option to display the map widget. If enabled, a valid Map API Key is required for the widget to function properly."
    174174msgstr ""
    175175
    176 #: includes/DpdExportSettings.php:232
     176#: includes/DpdExportSettings.php:236
    177177msgid "Map API Key"
    178178msgstr ""
    179179
    180 #: includes/DpdExportSettings.php:234
     180#: includes/DpdExportSettings.php:238
    181181msgid "Enter a valid DPD Map API Key. This is required if the Map Widget is enabled."
    182182msgstr ""
    183183
    184 #: includes/DpdExportSettings.php:279
    185 #: includes/DpdParcelShopShippingMethod.php:455
     184#: includes/DpdExportSettings.php:283
     185#: includes/DpdParcelShopShippingMethod.php:495
    186186msgid "Remove"
    187187msgstr ""
    188188
    189 #: includes/DpdExportSettings.php:280
    190 #: includes/DpdParcelShopShippingMethod.php:456
     189#: includes/DpdExportSettings.php:284
     190#: includes/DpdParcelShopShippingMethod.php:496
    191191msgid "Title"
    192192msgstr ""
    193193
    194 #: includes/DpdExportSettings.php:281
     194#: includes/DpdExportSettings.php:285
    195195msgid "Value"
    196196msgstr ""
    197197
    198 #: includes/DpdParcelShopShippingMethod.php:52
     198#: includes/DpdParcelShopShippingMethod.php:57
    199199msgid "DPD parcelshop"
    200200msgstr ""
    201201
    202 #: includes/DpdParcelShopShippingMethod.php:53
     202#: includes/DpdParcelShopShippingMethod.php:58
    203203msgid "Allow customers to deliver to the DPD parcelshops."
    204204msgstr ""
    205205
    206 #: includes/DpdParcelShopShippingMethod.php:75
     206#: includes/DpdParcelShopShippingMethod.php:80
    207207msgid "DPD Pickup/Pickup Station"
    208208msgstr ""
    209209
    210 #: includes/DpdParcelShopShippingMethod.php:102
     210#: includes/DpdParcelShopShippingMethod.php:107
    211211msgid "Tax status"
    212212msgstr ""
    213213
    214 #: includes/DpdParcelShopShippingMethod.php:107
     214#: includes/DpdParcelShopShippingMethod.php:112
    215215msgctxt "Tax status"
    216216msgid "None"
    217217msgstr ""
    218218
    219 #: includes/DpdParcelShopShippingMethod.php:108
     219#: includes/DpdParcelShopShippingMethod.php:113
    220220msgid "Taxable"
    221221msgstr ""
    222222
    223 #: includes/DpdParcelShopShippingMethod.php:112
     223#: includes/DpdParcelShopShippingMethod.php:117
    224224msgid "Shipping type"
    225225msgstr ""
    226226
    227 #: includes/DpdParcelShopShippingMethod.php:115
     227#: includes/DpdParcelShopShippingMethod.php:120
    228228msgid "Fixed shipping price"
    229229msgstr ""
    230230
    231 #: includes/DpdParcelShopShippingMethod.php:116
     231#: includes/DpdParcelShopShippingMethod.php:121
    232232msgid "Products weight based shipping price"
    233233msgstr ""
    234234
    235 #: includes/DpdParcelShopShippingMethod.php:118
     235#: includes/DpdParcelShopShippingMethod.php:123
    236236msgid "Choose type of the shipping."
    237237msgstr ""
    238238
    239 #: includes/DpdParcelShopShippingMethod.php:123
     239#: includes/DpdParcelShopShippingMethod.php:128
    240240msgid "Delivery fee"
    241241msgstr ""
    242242
    243 #: includes/DpdParcelShopShippingMethod.php:125
     243#: includes/DpdParcelShopShippingMethod.php:130
    244244msgid "What fee do you want to charge for shipping to the parcelshop."
    245245msgstr ""
    246246
    247 #: includes/DpdParcelShopShippingMethod.php:132
     247#: includes/DpdParcelShopShippingMethod.php:137
    248248msgid "Free shipping from"
    249249msgstr ""
    250250
    251 #: includes/DpdParcelShopShippingMethod.php:134
     251#: includes/DpdParcelShopShippingMethod.php:139
    252252msgid "If you exceed the price in the cart, shipping will be free."
    253253msgstr ""
    254254
    255 #: includes/DpdParcelShopShippingMethod.php:141
     255#: includes/DpdParcelShopShippingMethod.php:146
    256256msgid "Products weight based shipping rates"
    257257msgstr ""
    258258
    259 #: includes/DpdParcelShopShippingMethod.php:143
     259#: includes/DpdParcelShopShippingMethod.php:148
    260260msgid "Add shipping rates based on the weight of products in the cart."
    261261msgstr ""
    262262
    263 #: includes/DpdParcelShopShippingMethod.php:145
     263#: includes/DpdParcelShopShippingMethod.php:150
    264264msgid "Shipping rate"
    265265msgstr ""
    266266
    267 #: includes/DpdParcelShopShippingMethod.php:146
     267#: includes/DpdParcelShopShippingMethod.php:151
    268268#, php-format
    269269msgid "Min weight (%s)"
    270270msgstr ""
    271271
    272 #: includes/DpdParcelShopShippingMethod.php:147
     272#: includes/DpdParcelShopShippingMethod.php:152
    273273#, php-format
    274274msgid "Max weight (%s)"
    275275msgstr ""
    276276
    277 #: includes/DpdParcelShopShippingMethod.php:148
    278 #: includes/DpdParcelShopShippingMethod.php:151
     277#: includes/DpdParcelShopShippingMethod.php:153
     278#: includes/DpdParcelShopShippingMethod.php:156
    279279msgid "Price"
    280280msgstr ""
    281281
    282 #: includes/DpdParcelShopShippingMethod.php:148
     282#: includes/DpdParcelShopShippingMethod.php:153
    283283msgid "with"
    284284msgstr ""
    285285
    286 #: includes/DpdParcelShopShippingMethod.php:148
     286#: includes/DpdParcelShopShippingMethod.php:153
    287287msgid "without"
    288288msgstr ""
    289289
    290 #: includes/DpdParcelShopShippingMethod.php:148
     290#: includes/DpdParcelShopShippingMethod.php:153
    291291msgid "tax"
    292292msgstr ""
    293293
    294 #: includes/DpdParcelShopShippingMethod.php:149
     294#: includes/DpdParcelShopShippingMethod.php:154
    295295msgid "Min weight"
    296296msgstr ""
    297297
    298 #: includes/DpdParcelShopShippingMethod.php:150
     298#: includes/DpdParcelShopShippingMethod.php:155
    299299msgid "Max weight"
    300300msgstr ""
    301301
    302 #: includes/DpdParcelShopShippingMethod.php:152
     302#: includes/DpdParcelShopShippingMethod.php:157
    303303msgid "Add a shipping rate"
    304304msgstr ""
    305305
    306 #: includes/DpdParcelShopShippingMethod.php:156
     306#: includes/DpdParcelShopShippingMethod.php:161
    307307msgid "Setting the weight limits for packages"
    308308msgstr ""
    309309
    310 #: includes/DpdParcelShopShippingMethod.php:157
     310#: includes/DpdParcelShopShippingMethod.php:162
    311311msgid "If the shipment does not meet the conditions for delivery in a parcelbox, this shipping method will not be displayed."
    312312msgstr ""
    313313
    314 #: includes/DpdParcelShopShippingMethod.php:164
     314#: includes/DpdParcelShopShippingMethod.php:169
    315315msgid "Maximum weight"
    316316msgstr ""
    317317
    318 #: includes/DpdParcelShopShippingMethod.php:171
     318#: includes/DpdParcelShopShippingMethod.php:176
    319319msgid "Maximum weight for Alzabox"
    320320msgstr ""
    321321
    322 #: includes/DpdParcelShopShippingMethod.php:178
     322#: includes/DpdParcelShopShippingMethod.php:183
    323323msgid "Maximum weight for Slovenska Posta box"
    324324msgstr ""
    325325
    326 #: includes/DpdParcelShopShippingMethod.php:185
     326#: includes/DpdParcelShopShippingMethod.php:190
    327327msgid "Setting the dimension limits for packages"
    328328msgstr ""
    329329
    330 #: includes/DpdParcelShopShippingMethod.php:186
     330#: includes/DpdParcelShopShippingMethod.php:191
    331331msgid "If the shipment does not meet the conditions for delivery in a box, this shipping method will not be displayed."
    332332msgstr ""
    333333
    334 #: includes/DpdParcelShopShippingMethod.php:193
     334#: includes/DpdParcelShopShippingMethod.php:198
    335335msgid "Maximum width"
    336336msgstr ""
    337337
    338 #: includes/DpdParcelShopShippingMethod.php:198
     338#: includes/DpdParcelShopShippingMethod.php:203
    339339msgid "Maximum height"
    340340msgstr ""
    341341
    342 #: includes/DpdParcelShopShippingMethod.php:203
     342#: includes/DpdParcelShopShippingMethod.php:208
    343343msgid "Maximum length"
    344344msgstr ""
    345345
    346 #: includes/DpdParcelShopShippingMethod.php:208
     346#: includes/DpdParcelShopShippingMethod.php:213
    347347msgid "Maximum width for Alzabox"
    348348msgstr ""
    349349
    350 #: includes/DpdParcelShopShippingMethod.php:213
     350#: includes/DpdParcelShopShippingMethod.php:218
    351351msgid "Maximum height for Alzabox"
    352352msgstr ""
    353353
    354 #: includes/DpdParcelShopShippingMethod.php:218
     354#: includes/DpdParcelShopShippingMethod.php:223
    355355msgid "Maximum length for Alzabox"
    356356msgstr ""
    357357
    358 #: includes/DpdParcelShopShippingMethod.php:223
     358#: includes/DpdParcelShopShippingMethod.php:228
    359359msgid "Maximum width for Slovenska Posta box"
    360360msgstr ""
    361361
    362 #: includes/DpdParcelShopShippingMethod.php:228
     362#: includes/DpdParcelShopShippingMethod.php:233
    363363msgid "Maximum height for Slovenska Posta box"
    364364msgstr ""
    365365
    366 #: includes/DpdParcelShopShippingMethod.php:233
     366#: includes/DpdParcelShopShippingMethod.php:238
    367367msgid "Maximum length for Slovenska Posta box"
     368msgstr ""
     369
     370#: includes/DpdParcelShopShippingMethod.php:243
     371msgid "Disallow Shops"
     372msgstr ""
     373
     374#: includes/DpdParcelShopShippingMethod.php:247
     375msgid "If checked, DPD Pickup shops will be disabled."
     376msgstr ""
     377
     378#: includes/DpdParcelShopShippingMethod.php:250
     379msgid "Disallow Lockers"
     380msgstr ""
     381
     382#: includes/DpdParcelShopShippingMethod.php:254
     383msgid "If checked, all locker types will be disabled."
     384msgstr ""
     385
     386#: includes/DpdParcelShopShippingMethod.php:257
     387msgid "Disallow DPD Pickup Stations"
     388msgstr ""
     389
     390#: includes/DpdParcelShopShippingMethod.php:261
     391msgid "If checked, DPD Pickup Stations will be disabled."
     392msgstr ""
     393
     394#: includes/DpdParcelShopShippingMethod.php:264
     395msgid "Disallow Slovenská Pošta Boxes"
     396msgstr ""
     397
     398#: includes/DpdParcelShopShippingMethod.php:268
     399msgid "If checked, Slovenská Pošta boxes will be disabled."
     400msgstr ""
     401
     402#: includes/DpdParcelShopShippingMethod.php:271
     403msgid "Disallow Alza Boxes"
     404msgstr ""
     405
     406#: includes/DpdParcelShopShippingMethod.php:275
     407msgid "If checked, Alza Boxes will be disabled."
    368408msgstr ""
    369409
     
    524564
    525565#: templates/parcelshop-popup.php:49
    526 #: templates/parcelshop-shipping-method-content.php:36
    527 #: templates/parcelshop-shipping-method-content.php:38
     566#: templates/parcelshop-shipping-method-content.php:57
     567#: templates/parcelshop-shipping-method-content.php:59
    528568msgid "Choose parcelshop"
    529569msgstr ""
    530570
    531 #: templates/parcelshop-shipping-method-content.php:43
     571#: templates/parcelshop-shipping-method-content.php:64
    532572msgid "Selected parcelshop"
    533573msgstr ""
  • wc-dpd/trunk/public/mix-manifest.json

    r3116019 r3143150  
    22    "/scripts/dpd-export-settings-admin-repeater.js": "/scripts/dpd-export-settings-admin-repeater.js?id=47ab745c5bd14dafc4173865dda97bdd",
    33    "/scripts/dpd-export-settings-admin.js": "/scripts/dpd-export-settings-admin.js?id=606bebb885995476f43c3d7157525db9",
    4     "/scripts/dpd-parcelshop-map-widget.js": "/scripts/dpd-parcelshop-map-widget.js?id=4c726b18cc64b83362c7525679c66892",
     4    "/scripts/dpd-parcelshop-map-widget.js": "/scripts/dpd-parcelshop-map-widget.js?id=7ca8dbd2bdd493e4229d08bf85b8cc0d",
    55    "/scripts/dpd-parcelshop-popup.js": "/scripts/dpd-parcelshop-popup.js?id=037ba613ed74627c795f07e373dcc26d",
    6     "/scripts/dpd-parcelshop-shipping-method-weight-by-package-repeater.js": "/scripts/dpd-parcelshop-shipping-method-weight-by-package-repeater.js?id=37b8c61b912f09ecb35aa1a992a49b69",
     6    "/scripts/dpd-parcelshop-shipping-method-weight-by-package-repeater.js": "/scripts/dpd-parcelshop-shipping-method-weight-by-package-repeater.js?id=ca160a750e6189180d440d9a809f455b",
    77    "/styles/dpd-parcelshop-shipping-method-content.css": "/styles/dpd-parcelshop-shipping-method-content.css?id=28a4746f03d1d07187b119df9b049191",
    88    "/styles/dpd-parcelshop-popup.css": "/styles/dpd-parcelshop-popup.css?id=d07000a6ff887b77b81f6f67d88e0c39",
  • wc-dpd/trunk/public/scripts/dpd-parcelshop-map-widget.js

    r3116019 r3143150  
    1 (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}window.dpdParcelShopWidget=function(){var t,o,p,n,d,a,r,i,c,l,u,s,h,g,y,m,v,_=!1;function w(){p=".js-dpd-parcelshop-map-widget-open-popup-btn",n=".js-dpd-chosen-parcelshop-content",d=".js-dpd-chosen-parcelshop-chosen-parcelshop-text",a=".js-dpd-parcelshop-hidden-parcelshop-id",r=".js-dpd-parcelshop-hidden-parcelshop-pus-id",i=".js-dpd-parcelshop-hidden-parcelshop-name",c=".js-dpd-parcelshop-hidden-parcelshop-street",l=".js-dpd-parcelshop-hidden-parcelshop-city",u=".js-dpd-parcelshop-hidden-parcelshop-zip",s=".js-dpd-parcelshop-hidden-parcelshop-country-code",t=document.querySelector(".js-dpd-parcelshop-map-widget-popup"),document.addEventListener("click",(function(e){e.target.matches(p)&&(e.preventDefault(),(h=document.querySelector(".js-dpd-parcelshop-map-widget-popup-embed"))&&(dpdMapOpenWidgetMapPopupEl=e.target.closest(p),dpdMapOpenWidgetMapPopupEl&&(!function(){if(_)return;var e=h.getAttribute("data-api-key");if(!e)return void console.log("Map Api key is missing");y=JSON.parse(dpdMapOpenWidgetMapPopupEl.getAttribute("data-countries")),allowedCountries=JSON.parse(dpdMapOpenWidgetMapPopupEl.getAttribute("data-allowed-countries")),allowedCountries=allowedCountries.join(","),m=dpdMapOpenWidgetMapPopupEl.getAttribute("data-base-country-code"),o=new DpdPudo.Widget({apiKey:e,country:m,allowedCountries:[allowedCountries]}),_=!0}(),b())))}),!1),document.addEventListener("click",(function(e){e.target.matches(".js-dpd-parcelshop-map-widget-popup-container")&&(e.preventDefault(),P())}),!1),document.addEventListener("keydown",(function(e){"Escape"===e.key&&P()}),!1),document.addEventListener("change",(function(e){e.target&&e.target.matches('input[name="payment_method"]')&&""!==document.querySelector(a).value&&document.body.dispatchEvent(new Event("update_checkout"))}),!1)}function f(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o&&0!==Object.keys(o).length){var p=o.hasOwnProperty("id")?o.id:null,h=o.hasOwnProperty("id")?o.id:null,g=o.hasOwnProperty("name")?o.name:null,m=o.hasOwnProperty("street")?o.street:null,v=o.hasOwnProperty("zip")?o.zip:null,_=o.hasOwnProperty("city")?o.city:null,w=o.hasOwnProperty("countryCode")?o.countryCode:null;!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",p=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",i=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"",u=!(arguments.length>10&&void 0!==arguments[10])||arguments[10],s=!(arguments.length>11&&void 0!==arguments[11])||arguments[11],h=new XMLHttpRequest;h.open("POST",wc_dpd_parcelshop_map_widget_settings.ajax_url,!0),h.setRequestHeader("Content-type","application/x-www-form-urlencoded"),h.onreadystatechange=function(){var e=4,t=200;h.readyState===e&&h.status===t&&document.body.dispatchEvent(new Event("update_checkout"))},h.send("action=wc_dpd_update_chosen_parcelshop&wp_nonce="+t.getAttribute("data-nonce")+"&wc_dpd_parcelshop_id="+e+"&wc_dpd_parcelshop_pus_id="+o+"&wc_dpd_parcelshop_name="+p+"&wc_dpd_parcelshop_street="+n+"&wc_dpd_parcelshop_zip="+d+"&wc_dpd_parcelshop_city="+a+"&wc_dpd_parcelshop_country_code="+r+"&wc_dpd_parcelshop_max_weight="+i+"&wc_dpd_parcelshop_cod="+c+"&wc_dpd_parcelshop_card="+l+"&wc_dpd_parcelshop_is_alzabox_eligible="+u+"&wc_dpd_parcelshop_is_slovenska_posta_eligible="+s)}(p,h,g,m,v,_,w,o.hasOwnProperty("maxweight")?o.maxweight:null,o.hasOwnProperty("cod")?o.cod:null,o.hasOwnProperty("card")?o.card:null,o.hasOwnProperty("isEligibleForAlzabox")?o.isEligibleForAlzabox:null,o.hasOwnProperty("isEligibleForSlovenskaPostaBox")?o.isEligibleForSlovenskaPostaBox:null);var f=y&&"object"===e(y)&&y.hasOwnProperty(w)?y[w]:w;document.querySelector(a).value=p,document.querySelector(r).value=h,document.querySelector(i).value=g,document.querySelector(c).value=m,document.querySelector(u).value=v,document.querySelector(l).value=_,document.querySelector(s).value=w;var b=Object.values([g,m,v,_,f]).filter((function(e){return!!e}));document.querySelector(d).innerHTML=b.join(", "),document.querySelector(n).classList.add("active")}}function b(){if(t.classList.add("active"),h&&o){var e=document.querySelector(a).value;e&&(o.options.selectedPudoId=e),dpdMapOpenWidgetMapPopupEl=document.querySelector(p),(g=function(){var e=document.querySelector('input[name="ship_to_different_address"]');if(e&&e.checked){var t=document.querySelector('input[name="shipping_postcode"]');if(t&&(g=t.value),g)return g}var o=document.querySelector('input[name="billing_postcode"]');o&&(g=o.value);if(g)return g;if(g=dpdMapOpenWidgetMapPopupEl.getAttribute("data-customer-zip"))return g;return""}())&&(o.options.zip=g);var n=dpdMapOpenWidgetMapPopupEl.getAttribute("data-base-country-code");n&&(o.options.country=n);var d=parseInt(dpdMapOpenWidgetMapPopupEl.getAttribute("data-min-weight-in-kg")),r="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-is-eligible-for-alzabox"),i="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-is-eligible-for-slovenska-posta-box"),c=[];r&&i||(c=["dpdSkPickupStations","skPost","alzaSlovakia","outsideOfSlovakia"],r||(c=c.filter((function(e){return"alzaSlovakia"!==e}))),i||(c=c.filter((function(e){return"skPost"!==e})))),o.options.minWeightInKg=d,o.options.allowedLockerTypes=c;var l=[],u="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-is-cod-required"),s="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-is-card-payment-required");(u||s)&&(u&&l.push("cod"),s&&l.push("cardPayment")),o.options.requiredServices=l,o.attach(h).then((function(e){f({id:e.id,name:e.name,street:e.street,houseno:e.houseno,zip:e.zip,city:e.city,countryCode:e.countryCode,maxweight:e.maxWeightInKg,cod:!(!e.services||!e.services.includes("cod")),card:!(!e.services||!e.services.includes("cardPayment")),isEligibleForAlzabox:r,isEligibleForSlovenskaPostaBox:i}),P()})).catch((function(e){P()}))}}function P(){t.classList.remove("active"),o&&o.close&&o.close()}return v=function(){w()},"complete"===document.readyState||"interactive"===document.readyState?setTimeout(v,1):document.addEventListener("DOMContentLoaded",v),{openPopup:b}}()})();
     1(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}window.dpdParcelShopWidget=function(){var t,o,p,d,a,n,r,i,c,l,u,s,h,g,y,v,m,_=!1;function w(){p=".js-dpd-parcelshop-map-widget-open-popup-btn",d=".js-dpd-chosen-parcelshop-content",a=".js-dpd-chosen-parcelshop-chosen-parcelshop-text",n=".js-dpd-parcelshop-hidden-parcelshop-id",r=".js-dpd-parcelshop-hidden-parcelshop-pus-id",i=".js-dpd-parcelshop-hidden-parcelshop-name",c=".js-dpd-parcelshop-hidden-parcelshop-street",l=".js-dpd-parcelshop-hidden-parcelshop-city",u=".js-dpd-parcelshop-hidden-parcelshop-zip",s=".js-dpd-parcelshop-hidden-parcelshop-country-code",t=document.querySelector(".js-dpd-parcelshop-map-widget-popup"),document.addEventListener("click",(function(e){e.target.matches(p)&&(e.preventDefault(),(h=document.querySelector(".js-dpd-parcelshop-map-widget-popup-embed"))&&(dpdMapOpenWidgetMapPopupEl=e.target.closest(p),dpdMapOpenWidgetMapPopupEl&&(!function(){if(_)return;var e=h.getAttribute("data-api-key");if(!e)return void console.log("Map Api key is missing");y=JSON.parse(dpdMapOpenWidgetMapPopupEl.getAttribute("data-countries")),allowedCountries=JSON.parse(dpdMapOpenWidgetMapPopupEl.getAttribute("data-allowed-countries")),allowedCountries=allowedCountries.join(","),v=dpdMapOpenWidgetMapPopupEl.getAttribute("data-base-country-code"),o=new DpdPudo.Widget({apiKey:e,country:v,allowedCountries:[allowedCountries]}),_=!0}(),b())))}),!1),document.addEventListener("click",(function(e){e.target.matches(".js-dpd-parcelshop-map-widget-popup-container")&&(e.preventDefault(),P())}),!1),document.addEventListener("keydown",(function(e){"Escape"===e.key&&P()}),!1),document.addEventListener("change",(function(e){e.target&&e.target.matches('input[name="payment_method"]')&&""!==document.querySelector(n).value&&document.body.dispatchEvent(new Event("update_checkout"))}),!1)}function f(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o&&0!==Object.keys(o).length){var p=o.hasOwnProperty("id")?o.id:null,h=o.hasOwnProperty("id")?o.id:null,g=o.hasOwnProperty("name")?o.name:null,v=o.hasOwnProperty("street")?o.street:null,m=o.hasOwnProperty("zip")?o.zip:null,_=o.hasOwnProperty("city")?o.city:null,w=o.hasOwnProperty("countryCode")?o.countryCode:null;!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",p=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",i=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"",u=!(arguments.length>10&&void 0!==arguments[10])||arguments[10],s=!(arguments.length>11&&void 0!==arguments[11])||arguments[11],h=new XMLHttpRequest;h.open("POST",wc_dpd_parcelshop_map_widget_settings.ajax_url,!0),h.setRequestHeader("Content-type","application/x-www-form-urlencoded"),h.onreadystatechange=function(){var e=4,t=200;h.readyState===e&&h.status===t&&document.body.dispatchEvent(new Event("update_checkout"))},h.send("action=wc_dpd_update_chosen_parcelshop&wp_nonce="+t.getAttribute("data-nonce")+"&wc_dpd_parcelshop_id="+e+"&wc_dpd_parcelshop_pus_id="+o+"&wc_dpd_parcelshop_name="+p+"&wc_dpd_parcelshop_street="+d+"&wc_dpd_parcelshop_zip="+a+"&wc_dpd_parcelshop_city="+n+"&wc_dpd_parcelshop_country_code="+r+"&wc_dpd_parcelshop_max_weight="+i+"&wc_dpd_parcelshop_cod="+c+"&wc_dpd_parcelshop_card="+l+"&wc_dpd_parcelshop_is_alzabox_eligible="+u+"&wc_dpd_parcelshop_is_slovenska_posta_eligible="+s)}(p,h,g,v,m,_,w,o.hasOwnProperty("maxweight")?o.maxweight:null,o.hasOwnProperty("cod")?o.cod:null,o.hasOwnProperty("card")?o.card:null,o.hasOwnProperty("isEligibleForAlzabox")?o.isEligibleForAlzabox:null,o.hasOwnProperty("isEligibleForSlovenskaPostaBox")?o.isEligibleForSlovenskaPostaBox:null);var f=y&&"object"===e(y)&&y.hasOwnProperty(w)?y[w]:w;document.querySelector(n).value=p,document.querySelector(r).value=h,document.querySelector(i).value=g,document.querySelector(c).value=v,document.querySelector(u).value=m,document.querySelector(l).value=_,document.querySelector(s).value=w;var b=Object.values([g,v,m,_,f]).filter((function(e){return!!e}));document.querySelector(a).innerHTML=b.join(", "),document.querySelector(d).classList.add("active")}}function b(){if(t.classList.add("active"),h&&o){var e=document.querySelector(n).value;e&&(o.options.selectedPudoId=e),dpdMapOpenWidgetMapPopupEl=document.querySelector(p),(g=function(){var e=document.querySelector('input[name="ship_to_different_address"]');if(e&&e.checked){var t=document.querySelector('input[name="shipping_postcode"]');if(t&&(g=t.value),g)return g}var o=document.querySelector('input[name="billing_postcode"]');o&&(g=o.value);if(g)return g;if(g=dpdMapOpenWidgetMapPopupEl.getAttribute("data-customer-zip"))return g;return""}())&&(o.options.zip=g);var d=dpdMapOpenWidgetMapPopupEl.getAttribute("data-base-country-code");d&&(o.options.country=d);var a=parseInt(dpdMapOpenWidgetMapPopupEl.getAttribute("data-min-weight-in-kg")),r="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-is-eligible-for-alzabox"),i="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-is-eligible-for-slovenska-posta-box");o.options.minWeightInKg=a;var c="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-disallow-shops"),l="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-disallow-lockers"),u="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-disallow-dpd-pickup-stations"),s="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-disallow-sk-post"),y="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-disallow-alza-boxes"),v=["shop","locker"];c&&(v=v.filter((function(e){return"shop"!==e}))),l&&(v=v.filter((function(e){return"locker"!==e}))),o.options.allowedPudoTypes=v;var m=["dpdSkPickupStations","skPost","alzaSlovakia","outsideOfSlovakia"];r&&i||(r||(m=m.filter((function(e){return"alzaSlovakia"!==e}))),i||(m=m.filter((function(e){return"skPost"!==e})))),l||(u&&(m=m.filter((function(e){return"dpdSkPickupStations"!==e}))),s&&(m=m.filter((function(e){return"skPost"!==e}))),y&&(m=m.filter((function(e){return"alzaSlovakia"!==e})))),o.options.allowedLockerTypes=m;var _=[],w="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-is-cod-required"),b="true"===dpdMapOpenWidgetMapPopupEl.getAttribute("data-is-card-payment-required");(w||b)&&(w&&_.push("cod"),b&&_.push("cardPayment")),o.options.requiredServices=_,o.attach(h).then((function(e){f({id:e.id,name:e.name,street:e.street,houseno:e.houseno,zip:e.zip,city:e.city,countryCode:e.countryCode,maxweight:e.maxWeightInKg,cod:!(!e.services||!e.services.includes("cod")),card:!(!e.services||!e.services.includes("cardPayment")),isEligibleForAlzabox:r,isEligibleForSlovenskaPostaBox:i}),P()})).catch((function(e){P()}))}}function P(){t.classList.remove("active"),o&&o.close&&o.close()}return m=function(){w()},"complete"===document.readyState||"interactive"===document.readyState?setTimeout(m,1):document.addEventListener("DOMContentLoaded",m),{openPopup:b}}()})();
    22//# sourceMappingURL=dpd-parcelshop-map-widget.js.map
  • wc-dpd/trunk/public/scripts/dpd-parcelshop-map-widget.js.map

    r3116019 r3143150  
    1 {"version":3,"file":"/scripts/dpd-parcelshop-map-widget.js","mappings":"4OAAAA,OAAOC,oBAAuB,WAC7B,IACCC,EACAC,EAEAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EA6fiBC,EA5fjBC,GAAmB,EAEpB,SAASC,IACRhB,EACC,+CAODC,EAAkC,oCAClCC,EACC,mDACDC,EACC,0CACDC,EACC,8CACDC,EACC,4CACDC,EACC,8CACDC,EACC,4CACDC,EACC,2CACDC,EACC,oDAEDX,EAAQmB,SAASC,cAvBQ,uCA4BzBD,SAASE,iBACR,SACA,SAAUC,GACJA,EAAMC,OAAOC,QAAQtB,KAI1BoB,EAAMG,kBAGNb,EAAiBO,SAASC,cACzB,gDAQDM,2BAA6BJ,EAAMC,OAAOI,QACzCzB,GAGIwB,8BAkER,WACC,GAAIT,EACH,OAGD,IAAMW,EAAShB,EAAei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C7C/B,QACC2B,EAAKG,WAAYH,EAAKG,SAASC,SAAS,gBAGzChD,qBAAsBA,EACtBC,+BAAgCA,IAGjC/B,GACD,IAAE,OACK,SAAC+E,GACP/E,GACD,GACF,CACD,CAKA,SAASA,IACRzC,EAAM+F,UAAU0B,OAAO,UAGnBxH,GAAgBA,EAAayH,OAChCzH,EAAayH,OAEf,CA2EA,OAhBkB1G,EAWT,WACRE,GACD,EAX0B,aAAxBC,SAAS+D,YACe,gBAAxB/D,SAAS+D,WAETyC,WAAW3G,EAAI,GAEfG,SAASE,iBAAiB,mBAAoBL,GASzC,CACNwB,UAAWA,EAEb,CAliB8B,E","sources":["webpack:///./assets/scripts/dpd-parcelshop-map-widget.js"],"sourcesContent":["window.dpdParcelShopWidget = (function () {\n\tvar mapWidgetPopupSelector,\n\t\tpopup,\n\t\tdpdMapWidget,\n\t\tmapWidgetPopupContainerSelector,\n\t\tmapWidgetPopupOpenBtnSelector,\n\t\tchosenParcelShopContentSelector,\n\t\tchosenParcelShopContentTextSelector,\n\t\tchosenParcelShopHiddenParcelIdSelector,\n\t\tchosenParcelShopHiddenParcelPusIdSelector,\n\t\tchosenParcelShopHiddenParcelNameSelector,\n\t\tchosenParcelShopHiddenParcelStreetSelector,\n\t\tchosenParcelShopHiddenParcelCitySelector,\n\t\tchosenParcelShopHiddenParcelZipSelector,\n\t\tchosenParcelShopHiddenParcelCountryCodeSelector,\n\t\tdpdMapWidgetEl,\n\t\tcustomerZip,\n\t\tcountries,\n\t\tbaseCountryCode,\n\t\tisMapInitialized = false;\n\n\tfunction init() {\n\t\tmapWidgetPopupOpenBtnSelector =\n\t\t\t'.js-dpd-parcelshop-map-widget-open-popup-btn';\n\n\t\tmapWidgetPopupSelector = '.js-dpd-parcelshop-map-widget-popup';\n\n\t\tmapWidgetPopupContainerSelector =\n\t\t\t'.js-dpd-parcelshop-map-widget-popup-container';\n\n\t\tchosenParcelShopContentSelector = '.js-dpd-chosen-parcelshop-content';\n\t\tchosenParcelShopContentTextSelector =\n\t\t\t'.js-dpd-chosen-parcelshop-chosen-parcelshop-text';\n\t\tchosenParcelShopHiddenParcelIdSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-id';\n\t\tchosenParcelShopHiddenParcelPusIdSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-pus-id';\n\t\tchosenParcelShopHiddenParcelNameSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-name';\n\t\tchosenParcelShopHiddenParcelStreetSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-street';\n\t\tchosenParcelShopHiddenParcelCitySelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-city';\n\t\tchosenParcelShopHiddenParcelZipSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-zip';\n\t\tchosenParcelShopHiddenParcelCountryCodeSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-country-code';\n\n\t\tpopup = document.querySelector(mapWidgetPopupSelector);\n\n\t\t/**\n\t\t * Open the popup when the user clicks the open button\n\t\t */\n\t\tdocument.addEventListener(\n\t\t\t'click',\n\t\t\tfunction (event) {\n\t\t\t\tif (!event.target.matches(mapWidgetPopupOpenBtnSelector)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\t// Fetch the dpdMapWidgetEl element dynamically\n\t\t\t\tdpdMapWidgetEl = document.querySelector(\n\t\t\t\t\t'.js-dpd-parcelshop-map-widget-popup-embed'\n\t\t\t\t);\n\n\t\t\t\tif (!dpdMapWidgetEl) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Fetch the dpdMapOpenWidgetMapPopupEl element dynamically\n\t\t\t\tdpdMapOpenWidgetMapPopupEl = event.target.closest(\n\t\t\t\t\tmapWidgetPopupOpenBtnSelector\n\t\t\t\t);\n\n\t\t\t\tif (!dpdMapOpenWidgetMapPopupEl) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tinitMap();\n\t\t\t\topenPopup();\n\t\t\t},\n\t\t\tfalse\n\t\t);\n\n\t\t/**\n\t\t * Close the popup when the user clicks outside of it\n\t\t */\n\t\tdocument.addEventListener(\n\t\t\t'click',\n\t\t\tfunction (event) {\n\t\t\t\tif (!event.target.matches(mapWidgetPopupContainerSelector)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tclosePopup();\n\t\t\t},\n\t\t\tfalse\n\t\t);\n\n\t\t/**\n\t\t * Close the popup when the escape key is pressed\n\t\t */\n\t\tdocument.addEventListener(\n\t\t\t'keydown',\n\t\t\tfunction (event) {\n\t\t\t\tif (event.key !== 'Escape') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tclosePopup();\n\t\t\t},\n\t\t\tfalse\n\t\t);\n\n\t\t/**\n\t\t * Trigger the update_checkout event when the payment method is changed and a parcel shop is chosen\n\t\t */\n\t\tdocument.addEventListener(\n\t\t\t'change',\n\t\t\tfunction (event) {\n\t\t\t\tif (\n\t\t\t\t\tevent.target &&\n\t\t\t\t\tevent.target.matches('input[name=\"payment_method\"]')\n\t\t\t\t) {\n\t\t\t\t\t// Check if a parcel shop is chosen\n\t\t\t\t\tif (isParcelShopChosen()) {\n\t\t\t\t\t\t// Trigger the update_checkout event\n\t\t\t\t\t\tdocument.body.dispatchEvent(new Event('update_checkout'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse\n\t\t);\n\t}\n\n\t/**\n\t * Initialize the map\n\t */\n\tfunction initMap() {\n\t\tif (isMapInitialized) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst apiKey = dpdMapWidgetEl.getAttribute('data-api-key');\n\n\t\tif (!apiKey) {\n\t\t\tconsole.log('Map Api key is missing');\n\t\t\treturn;\n\t\t}\n\n\t\tcountries = JSON.parse(\n\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-countries')\n\t\t);\n\t\tallowedCountries = JSON.parse(\n\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-allowed-countries')\n\t\t);\n\t\tallowedCountries = allowedCountries.join(',');\n\t\tbaseCountryCode = dpdMapOpenWidgetMapPopupEl.getAttribute(\n\t\t\t'data-base-country-code'\n\t\t);\n\n\t\tdpdMapWidget = new DpdPudo.Widget({\n\t\t\tapiKey: apiKey,\n\t\t\tcountry: baseCountryCode,\n\t\t\tallowedCountries: [allowedCountries],\n\t\t});\n\n\t\tisMapInitialized = true;\n\t}\n\n\t/**\n\t * Set the selected parcel shop in the session and update the frontend field\n\t */\n\tfunction setSelectedParcelShop(data = {}) {\n\t\tif (!data || Object.keys(data).length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst parcelShopId = data.hasOwnProperty('id') ? data.id : null;\n\t\tconst parcelShopPusId = data.hasOwnProperty('id') ? data.id : null;\n\t\tconst parcelShopName = data.hasOwnProperty('name') ? data.name : null;\n\t\tconst parcelShopStreet = data.hasOwnProperty('street') ? data.street : null;\n\t\tconst parcelShopZip = data.hasOwnProperty('zip') ? data.zip : null;\n\t\tconst parcelShopCity = data.hasOwnProperty('city') ? data.city : null;\n\t\tconst parcelShopCountryCode = data.hasOwnProperty('countryCode')\n\t\t\t? data.countryCode\n\t\t\t: null;\n\t\tconst parcelShopMaxWeight = data.hasOwnProperty('maxweight')\n\t\t\t? data.maxweight\n\t\t\t: null;\n\t\tconst parcelShopCod = data.hasOwnProperty('cod') ? data.cod : null;\n\t\tconst parcelShopCard = data.hasOwnProperty('card') ? data.card : null;\n\t\tconst isEligibleForAlzabox = data.hasOwnProperty('isEligibleForAlzabox')\n\t\t\t? data.isEligibleForAlzabox\n\t\t\t: null;\n\t\tconst isEligibleForSlovenskaPostaBox = data.hasOwnProperty(\n\t\t\t'isEligibleForSlovenskaPostaBox'\n\t\t)\n\t\t\t? data.isEligibleForSlovenskaPostaBox\n\t\t\t: null;\n\n\t\t// Update session\n\t\tsetSelectedParcelShopSession(\n\t\t\tparcelShopId,\n\t\t\tparcelShopPusId,\n\t\t\tparcelShopName,\n\t\t\tparcelShopStreet,\n\t\t\tparcelShopZip,\n\t\t\tparcelShopCity,\n\t\t\tparcelShopCountryCode,\n\t\t\tparcelShopMaxWeight,\n\t\t\tparcelShopCod,\n\t\t\tparcelShopCard,\n\t\t\tisEligibleForAlzabox,\n\t\t\tisEligibleForSlovenskaPostaBox\n\t\t);\n\n\t\tconst parcelShopCountry =\n\t\t\tcountries &&\n\t\t\ttypeof countries === 'object' &&\n\t\t\tcountries.hasOwnProperty(parcelShopCountryCode)\n\t\t\t\t? countries[parcelShopCountryCode]\n\t\t\t\t: parcelShopCountryCode;\n\n\t\t// Update frontend field\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelIdSelector).value =\n\t\t\tparcelShopId;\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelPusIdSelector).value =\n\t\t\tparcelShopPusId;\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelNameSelector).value =\n\t\t\tparcelShopName;\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelStreetSelector).value =\n\t\t\tparcelShopStreet;\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelZipSelector).value =\n\t\t\tparcelShopZip;\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelCitySelector).value =\n\t\t\tparcelShopCity;\n\t\tdocument.querySelector(\n\t\t\tchosenParcelShopHiddenParcelCountryCodeSelector\n\t\t).value = parcelShopCountryCode;\n\n\t\t// Filter out empty values\n\t\tconst notEmptyAddressValues = Object.values([\n\t\t\tparcelShopName,\n\t\t\tparcelShopStreet,\n\t\t\tparcelShopZip,\n\t\t\tparcelShopCity,\n\t\t\tparcelShopCountry,\n\t\t]).filter((value) => !!value);\n\n\t\t// Construct the text content\n\t\tdocument.querySelector(chosenParcelShopContentTextSelector).innerHTML =\n\t\t\tnotEmptyAddressValues.join(', ');\n\n\t\tdocument\n\t\t\t.querySelector(chosenParcelShopContentSelector)\n\t\t\t.classList.add('active');\n\t}\n\n\t/**\n\t * Set the selected parcel shop in the session\n\t */\n\tfunction setSelectedParcelShopSession(\n\t\tparcelShopId = '',\n\t\tparcelShopPusId = '',\n\t\tparcelShopName = '',\n\t\tparcelShopStreet = '',\n\t\tparcelShopZip = '',\n\t\tparcelShopCity = '',\n\t\tparcelShopCountryCode = '',\n\t\tparcelShopMaxWeight = '',\n\t\tparcelShopCod = '',\n\t\tparcelShopCard = '',\n\t\tisEligibleForAlzabox = true,\n\t\tisEligibleForSlovenskaPostaBox = true\n\t) {\n\t\t// Prepare XHR Request.\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open('POST', wc_dpd_parcelshop_map_widget_settings.ajax_url, true);\n\t\txhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\n\t\t// Callback on response.\n\t\txhr.onreadystatechange = function () {\n\t\t\t// readyState 4 means the request is done.\n\t\t\tvar DONE = 4;\n\n\t\t\t// status 200 is a successful return.\n\t\t\tvar OK = 200;\n\n\t\t\t// Check response.\n\t\t\tif (xhr.readyState === DONE) {\n\t\t\t\tif (xhr.status === OK) {\n\t\t\t\t\tdocument.body.dispatchEvent(new Event('update_checkout'));\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Finally do the call with the right parametetrs.\n\t\txhr.send(\n\t\t\t'action=wc_dpd_update_chosen_parcelshop&wp_nonce=' +\n\t\t\t\tpopup.getAttribute('data-nonce') +\n\t\t\t\t'&wc_dpd_parcelshop_id=' +\n\t\t\t\tparcelShopId +\n\t\t\t\t'&wc_dpd_parcelshop_pus_id=' +\n\t\t\t\tparcelShopPusId +\n\t\t\t\t'&wc_dpd_parcelshop_name=' +\n\t\t\t\tparcelShopName +\n\t\t\t\t'&wc_dpd_parcelshop_street=' +\n\t\t\t\tparcelShopStreet +\n\t\t\t\t'&wc_dpd_parcelshop_zip=' +\n\t\t\t\tparcelShopZip +\n\t\t\t\t'&wc_dpd_parcelshop_city=' +\n\t\t\t\tparcelShopCity +\n\t\t\t\t'&wc_dpd_parcelshop_country_code=' +\n\t\t\t\tparcelShopCountryCode +\n\t\t\t\t'&wc_dpd_parcelshop_max_weight=' +\n\t\t\t\tparcelShopMaxWeight +\n\t\t\t\t'&wc_dpd_parcelshop_cod=' +\n\t\t\t\tparcelShopCod +\n\t\t\t\t'&wc_dpd_parcelshop_card=' +\n\t\t\t\tparcelShopCard +\n\t\t\t\t'&wc_dpd_parcelshop_is_alzabox_eligible=' +\n\t\t\t\tisEligibleForAlzabox +\n\t\t\t\t'&wc_dpd_parcelshop_is_slovenska_posta_eligible=' +\n\t\t\t\tisEligibleForSlovenskaPostaBox\n\t\t);\n\t}\n\n\t/**\n\t * Open the popup\n\t */\n\tfunction openPopup() {\n\t\tpopup.classList.add('active');\n\n\t\tif (dpdMapWidgetEl && dpdMapWidget) {\n\t\t\tconst chosenParcelShopId = document.querySelector(\n\t\t\t\tchosenParcelShopHiddenParcelIdSelector\n\t\t\t).value;\n\n\t\t\tif (chosenParcelShopId) {\n\t\t\t\tdpdMapWidget.options.selectedPudoId = chosenParcelShopId;\n\t\t\t}\n\n\t\t\t// Reselect open button to get refreshed data\n\t\t\tdpdMapOpenWidgetMapPopupEl = document.querySelector(\n\t\t\t\tmapWidgetPopupOpenBtnSelector\n\t\t\t);\n\n\t\t\t// Add zip if available\n\t\t\tcustomerZip = getCustomerZip();\n\n\t\t\tif (customerZip) {\n\t\t\t\tdpdMapWidget.options.zip = customerZip;\n\t\t\t}\n\n\t\t\t// Get the selected customer country\n\t\t\tconst countryCode = dpdMapOpenWidgetMapPopupEl.getAttribute(\n\t\t\t\t'data-base-country-code'\n\t\t\t);\n\n\t\t\tif (countryCode) {\n\t\t\t\tdpdMapWidget.options.country = countryCode;\n\t\t\t}\n\n\t\t\t// Update weight and allowed locker types when opening the popup\n\t\t\tconst minWeightInKg = parseInt(\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-min-weight-in-kg')\n\t\t\t);\n\t\t\tconst isEligibleForAlzabox =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute(\n\t\t\t\t\t'data-is-eligible-for-alzabox'\n\t\t\t\t) === 'true';\n\t\t\tconst isEligibleForSlovenskaPostaBox =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute(\n\t\t\t\t\t'data-is-eligible-for-slovenska-posta-box'\n\t\t\t\t) === 'true';\n\n\t\t\tlet allowedLockerTypes = [];\n\n\t\t\tif (!isEligibleForAlzabox || !isEligibleForSlovenskaPostaBox) {\n\t\t\t\tallowedLockerTypes = [\n\t\t\t\t\t'dpdSkPickupStations',\n\t\t\t\t\t'skPost',\n\t\t\t\t\t'alzaSlovakia',\n\t\t\t\t\t'outsideOfSlovakia',\n\t\t\t\t];\n\n\t\t\t\tif (!isEligibleForAlzabox) {\n\t\t\t\t\tallowedLockerTypes = allowedLockerTypes.filter(\n\t\t\t\t\t\t(type) => type !== 'alzaSlovakia'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (!isEligibleForSlovenskaPostaBox) {\n\t\t\t\t\tallowedLockerTypes = allowedLockerTypes.filter(\n\t\t\t\t\t\t(type) => type !== 'skPost'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdpdMapWidget.options.minWeightInKg = minWeightInKg;\n\t\t\tdpdMapWidget.options.allowedLockerTypes = allowedLockerTypes;\n\n\t\t\tlet requiredServices = [];\n\n\t\t\tconst isCodRequired =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-is-cod-required') ===\n\t\t\t\t'true';\n\t\t\tconst isCardPaymentRequired =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute(\n\t\t\t\t\t'data-is-card-payment-required'\n\t\t\t\t) === 'true';\n\n\t\t\tif (isCodRequired || isCardPaymentRequired) {\n\t\t\t\tif (isCodRequired) {\n\t\t\t\t\trequiredServices.push('cod');\n\t\t\t\t}\n\n\t\t\t\tif (isCardPaymentRequired) {\n\t\t\t\t\trequiredServices.push('cardPayment');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdpdMapWidget.options.requiredServices = requiredServices;\n\n\t\t\tdpdMapWidget\n\t\t\t\t.attach(dpdMapWidgetEl)\n\t\t\t\t.then((pudo) => {\n\t\t\t\t\tsetSelectedParcelShop({\n\t\t\t\t\t\tid: pudo.id,\n\t\t\t\t\t\tname: pudo.name,\n\t\t\t\t\t\tstreet: pudo.street,\n\t\t\t\t\t\thouseno: pudo.houseno,\n\t\t\t\t\t\tzip: pudo.zip,\n\t\t\t\t\t\tcity: pudo.city,\n\t\t\t\t\t\tcountryCode: pudo.countryCode,\n\t\t\t\t\t\tmaxweight: pudo.maxWeightInKg,\n\t\t\t\t\t\tcod: pudo.services && pudo.services.includes('cod') ? true : false,\n\t\t\t\t\t\tcard:\n\t\t\t\t\t\t\tpudo.services && pudo.services.includes('cardPayment')\n\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t: false,\n\t\t\t\t\t\tisEligibleForAlzabox: isEligibleForAlzabox,\n\t\t\t\t\t\tisEligibleForSlovenskaPostaBox: isEligibleForSlovenskaPostaBox,\n\t\t\t\t\t});\n\n\t\t\t\t\tclosePopup();\n\t\t\t\t})\n\t\t\t\t.catch((code) => {\n\t\t\t\t\tclosePopup();\n\t\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Close the popup\n\t */\n\tfunction closePopup() {\n\t\tpopup.classList.remove('active');\n\n\t\t// Check if close method exists\n\t\tif (dpdMapWidget && dpdMapWidget.close) {\n\t\t\tdpdMapWidget.close();\n\t\t}\n\t}\n\n\t/**\n\t * Check if a parcel shop is chosen\n\t */\n\tfunction isParcelShopChosen() {\n\t\tvar chosenParcelShopId = document.querySelector(\n\t\t\tchosenParcelShopHiddenParcelIdSelector\n\t\t).value;\n\t\treturn chosenParcelShopId !== '';\n\t}\n\n\t/**\n\t * Get customer zip\n\t */\n\tfunction getCustomerZip() {\n\t\t// Check if ship to different address is checked\n\t\tconst shipToDifferentAddress = document.querySelector(\n\t\t\t'input[name=\"ship_to_different_address\"]'\n\t\t);\n\n\t\tif (shipToDifferentAddress && shipToDifferentAddress.checked) {\n\t\t\tconst shippingPostcodeField = document.querySelector(\n\t\t\t\t'input[name=\"shipping_postcode\"]'\n\t\t\t);\n\n\t\t\tif (shippingPostcodeField) {\n\t\t\t\tcustomerZip = shippingPostcodeField.value;\n\t\t\t}\n\n\t\t\tif (customerZip) {\n\t\t\t\treturn customerZip;\n\t\t\t}\n\t\t}\n\n\t\tconst billingPostcodeField = document.querySelector(\n\t\t\t'input[name=\"billing_postcode\"]'\n\t\t);\n\n\t\tif (billingPostcodeField) {\n\t\t\tcustomerZip = billingPostcodeField.value;\n\t\t}\n\n\t\tif (customerZip) {\n\t\t\treturn customerZip;\n\t\t}\n\n\t\tcustomerZip = dpdMapOpenWidgetMapPopupEl.getAttribute('data-customer-zip');\n\n\t\tif (customerZip) {\n\t\t\treturn customerZip;\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t/**\n\t * Check if document is ready\n\t */\n\tfunction docReady(fn) {\n\t\tif (\n\t\t\tdocument.readyState === 'complete' ||\n\t\t\tdocument.readyState === 'interactive'\n\t\t) {\n\t\t\tsetTimeout(fn, 1);\n\t\t} else {\n\t\t\tdocument.addEventListener('DOMContentLoaded', fn);\n\t\t}\n\t}\n\n\tdocReady(function () {\n\t\tinit();\n\t});\n\n\t// Allow the functions to be called from outside\n\treturn {\n\t\topenPopup: openPopup,\n\t};\n})();\n"],"names":["window","dpdParcelShopWidget","popup","dpdMapWidget","mapWidgetPopupOpenBtnSelector","chosenParcelShopContentSelector","chosenParcelShopContentTextSelector","chosenParcelShopHiddenParcelIdSelector","chosenParcelShopHiddenParcelPusIdSelector","chosenParcelShopHiddenParcelNameSelector","chosenParcelShopHiddenParcelStreetSelector","chosenParcelShopHiddenParcelCitySelector","chosenParcelShopHiddenParcelZipSelector","chosenParcelShopHiddenParcelCountryCodeSelector","dpdMapWidgetEl","customerZip","countries","baseCountryCode","fn","isMapInitialized","init","document","querySelector","addEventListener","event","target","matches","preventDefault","dpdMapOpenWidgetMapPopupEl","closest","apiKey","getAttribute","console","log","JSON","parse","allowedCountries","join","DpdPudo","Widget","country","initMap","openPopup","closePopup","key","value","body","dispatchEvent","Event","setSelectedParcelShop","data","arguments","length","undefined","Object","keys","parcelShopId","hasOwnProperty","id","parcelShopPusId","parcelShopName","name","parcelShopStreet","street","parcelShopZip","zip","parcelShopCity","city","parcelShopCountryCode","countryCode","parcelShopMaxWeight","parcelShopCod","parcelShopCard","isEligibleForAlzabox","isEligibleForSlovenskaPostaBox","xhr","XMLHttpRequest","open","wc_dpd_parcelshop_map_widget_settings","ajax_url","setRequestHeader","onreadystatechange","DONE","OK","readyState","status","send","setSelectedParcelShopSession","maxweight","cod","card","parcelShopCountry","_typeof","notEmptyAddressValues","values","filter","innerHTML","classList","add","chosenParcelShopId","options","selectedPudoId","shipToDifferentAddress","checked","shippingPostcodeField","billingPostcodeField","getCustomerZip","minWeightInKg","parseInt","allowedLockerTypes","type","requiredServices","isCodRequired","isCardPaymentRequired","push","attach","then","pudo","houseno","maxWeightInKg","services","includes","code","remove","close","setTimeout"],"sourceRoot":""}
     1{"version":3,"file":"/scripts/dpd-parcelshop-map-widget.js","mappings":"4OAAAA,OAAOC,oBAAuB,WAC7B,IACCC,EACAC,EAEAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAyiBiBC,EAxiBjBC,GAAmB,EAEpB,SAASC,IACRhB,EACC,+CAODC,EAAkC,oCAClCC,EACC,mDACDC,EACC,0CACDC,EACC,8CACDC,EACC,4CACDC,EACC,8CACDC,EACC,4CACDC,EACC,2CACDC,EACC,oDAEDX,EAAQmB,SAASC,cAvBQ,uCA4BzBD,SAASE,iBACR,SACA,SAAUC,GACJA,EAAMC,OAAOC,QAAQtB,KAI1BoB,EAAMG,kBAGNb,EAAiBO,S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AmBrB,QACvC,SAACoB,GAAI,MAAc,wBAATA,CAA8B,KAGtCH,IACHI,EAAqBA,EAAmBrB,QACvC,SAACoB,GAAI,MAAc,WAATA,CAAiB,KAGzBF,IACHG,EAAqBA,EAAmBrB,QACvC,SAACoB,GAAI,MAAc,iBAATA,CAAuB,MAKpChH,EAAaiG,QAAQgB,mBAAqBA,EAE1C,IAAIC,EAAmB,GAEjBC,EAEL,SADA1F,2BAA2BG,aAAa,wBAEnCwF,EAGC,SAFN3F,2BAA2BG,aAC1B,kCAGEuF,GAAiBC,KAChBD,GACHD,EAAiBG,KAAK,OAGnBD,GACHF,EAAiBG,KAAK,gBAIxBrH,EAAaiG,QAAQiB,iBAAmBA,EAExClH,EACEsH,OAAO3G,GACP4G,MAAK,SAACC,GACN1E,EAAsB,CACrBS,GAAIiE,EAAKjE,GACTG,KAAM8D,EAAK9D,KACXE,OAAQ4D,EAAK5D,OACb6D,QAASD,EAAKC,QACd3D,IAAK0D,EAAK1D,IACVE,KAAMwD,EAAKxD,KACXE,YAAasD,EAAKtD,YAClBmB,UAAWmC,EAAKE,cAChBpC,OAAKkC,EAAKG,WAAYH,EAAKG,SAASC,SAAS,QAC7CrC,QACCiC,EAAKG,WAAYH,EAAKG,SAASC,SAAS,gBAGzCtD,qBAAsBA,EACtBC,+BAAgCA,IAGjC/B,GACD,IAAE,OACK,SAACqF,GACPrF,GACD,GACF,CACD,CAKA,SAASA,IACRzC,EAAM+F,UAAUgC,OAAO,UAGnB9H,GAAgBA,EAAa+H,OAChC/H,EAAa+H,OAEf,CA2EA,OAhBkBhH,EAWT,WACRE,GACD,EAX0B,aAAxBC,SAAS+D,YACe,gBAAxB/D,SAAS+D,WAET+C,WAAWjH,EAAI,GAEfG,SAASE,iBAAiB,mBAAoBL,GASzC,CACNwB,UAAWA,EAEb,CA9kB8B,E","sources":["webpack:///./assets/scripts/dpd-parcelshop-map-widget.js"],"sourcesContent":["window.dpdParcelShopWidget = (function () {\n\tvar mapWidgetPopupSelector,\n\t\tpopup,\n\t\tdpdMapWidget,\n\t\tmapWidgetPopupContainerSelector,\n\t\tmapWidgetPopupOpenBtnSelector,\n\t\tchosenParcelShopContentSelector,\n\t\tchosenParcelShopContentTextSelector,\n\t\tchosenParcelShopHiddenParcelIdSelector,\n\t\tchosenParcelShopHiddenParcelPusIdSelector,\n\t\tchosenParcelShopHiddenParcelNameSelector,\n\t\tchosenParcelShopHiddenParcelStreetSelector,\n\t\tchosenParcelShopHiddenParcelCitySelector,\n\t\tchosenParcelShopHiddenParcelZipSelector,\n\t\tchosenParcelShopHiddenParcelCountryCodeSelector,\n\t\tdpdMapWidgetEl,\n\t\tcustomerZip,\n\t\tcountries,\n\t\tbaseCountryCode,\n\t\tisMapInitialized = false;\n\n\tfunction init() {\n\t\tmapWidgetPopupOpenBtnSelector =\n\t\t\t'.js-dpd-parcelshop-map-widget-open-popup-btn';\n\n\t\tmapWidgetPopupSelector = '.js-dpd-parcelshop-map-widget-popup';\n\n\t\tmapWidgetPopupContainerSelector =\n\t\t\t'.js-dpd-parcelshop-map-widget-popup-container';\n\n\t\tchosenParcelShopContentSelector = '.js-dpd-chosen-parcelshop-content';\n\t\tchosenParcelShopContentTextSelector =\n\t\t\t'.js-dpd-chosen-parcelshop-chosen-parcelshop-text';\n\t\tchosenParcelShopHiddenParcelIdSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-id';\n\t\tchosenParcelShopHiddenParcelPusIdSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-pus-id';\n\t\tchosenParcelShopHiddenParcelNameSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-name';\n\t\tchosenParcelShopHiddenParcelStreetSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-street';\n\t\tchosenParcelShopHiddenParcelCitySelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-city';\n\t\tchosenParcelShopHiddenParcelZipSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-zip';\n\t\tchosenParcelShopHiddenParcelCountryCodeSelector =\n\t\t\t'.js-dpd-parcelshop-hidden-parcelshop-country-code';\n\n\t\tpopup = document.querySelector(mapWidgetPopupSelector);\n\n\t\t/**\n\t\t * Open the popup when the user clicks the open button\n\t\t */\n\t\tdocument.addEventListener(\n\t\t\t'click',\n\t\t\tfunction (event) {\n\t\t\t\tif (!event.target.matches(mapWidgetPopupOpenBtnSelector)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\t// Fetch the dpdMapWidgetEl element dynamically\n\t\t\t\tdpdMapWidgetEl = document.querySelector(\n\t\t\t\t\t'.js-dpd-parcelshop-map-widget-popup-embed'\n\t\t\t\t);\n\n\t\t\t\tif (!dpdMapWidgetEl) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Fetch the dpdMapOpenWidgetMapPopupEl element dynamically\n\t\t\t\tdpdMapOpenWidgetMapPopupEl = event.target.closest(\n\t\t\t\t\tmapWidgetPopupOpenBtnSelector\n\t\t\t\t);\n\n\t\t\t\tif (!dpdMapOpenWidgetMapPopupEl) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tinitMap();\n\t\t\t\topenPopup();\n\t\t\t},\n\t\t\tfalse\n\t\t);\n\n\t\t/**\n\t\t * Close the popup when the user clicks outside of it\n\t\t */\n\t\tdocument.addEventListener(\n\t\t\t'click',\n\t\t\tfunction (event) {\n\t\t\t\tif (!event.target.matches(mapWidgetPopupContainerSelector)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tclosePopup();\n\t\t\t},\n\t\t\tfalse\n\t\t);\n\n\t\t/**\n\t\t * Close the popup when the escape key is pressed\n\t\t */\n\t\tdocument.addEventListener(\n\t\t\t'keydown',\n\t\t\tfunction (event) {\n\t\t\t\tif (event.key !== 'Escape') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tclosePopup();\n\t\t\t},\n\t\t\tfalse\n\t\t);\n\n\t\t/**\n\t\t * Trigger the update_checkout event when the payment method is changed and a parcel shop is chosen\n\t\t */\n\t\tdocument.addEventListener(\n\t\t\t'change',\n\t\t\tfunction (event) {\n\t\t\t\tif (\n\t\t\t\t\tevent.target &&\n\t\t\t\t\tevent.target.matches('input[name=\"payment_method\"]')\n\t\t\t\t) {\n\t\t\t\t\t// Check if a parcel shop is chosen\n\t\t\t\t\tif (isParcelShopChosen()) {\n\t\t\t\t\t\t// Trigger the update_checkout event\n\t\t\t\t\t\tdocument.body.dispatchEvent(new Event('update_checkout'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse\n\t\t);\n\t}\n\n\t/**\n\t * Initialize the map\n\t */\n\tfunction initMap() {\n\t\tif (isMapInitialized) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst apiKey = dpdMapWidgetEl.getAttribute('data-api-key');\n\n\t\tif (!apiKey) {\n\t\t\tconsole.log('Map Api key is missing');\n\t\t\treturn;\n\t\t}\n\n\t\tcountries = JSON.parse(\n\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-countries')\n\t\t);\n\t\tallowedCountries = JSON.parse(\n\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-allowed-countries')\n\t\t);\n\t\tallowedCountries = allowedCountries.join(',');\n\t\tbaseCountryCode = dpdMapOpenWidgetMapPopupEl.getAttribute(\n\t\t\t'data-base-country-code'\n\t\t);\n\n\t\tdpdMapWidget = new DpdPudo.Widget({\n\t\t\tapiKey: apiKey,\n\t\t\tcountry: baseCountryCode,\n\t\t\tallowedCountries: [allowedCountries],\n\t\t});\n\n\t\tisMapInitialized = true;\n\t}\n\n\t/**\n\t * Set the selected parcel shop in the session and update the frontend field\n\t */\n\tfunction setSelectedParcelShop(data = {}) {\n\t\tif (!data || Object.keys(data).length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst parcelShopId = data.hasOwnProperty('id') ? data.id : null;\n\t\tconst parcelShopPusId = data.hasOwnProperty('id') ? data.id : null;\n\t\tconst parcelShopName = data.hasOwnProperty('name') ? data.name : null;\n\t\tconst parcelShopStreet = data.hasOwnProperty('street') ? data.street : null;\n\t\tconst parcelShopZip = data.hasOwnProperty('zip') ? data.zip : null;\n\t\tconst parcelShopCity = data.hasOwnProperty('city') ? data.city : null;\n\t\tconst parcelShopCountryCode = data.hasOwnProperty('countryCode')\n\t\t\t? data.countryCode\n\t\t\t: null;\n\t\tconst parcelShopMaxWeight = data.hasOwnProperty('maxweight')\n\t\t\t? data.maxweight\n\t\t\t: null;\n\t\tconst parcelShopCod = data.hasOwnProperty('cod') ? data.cod : null;\n\t\tconst parcelShopCard = data.hasOwnProperty('card') ? data.card : null;\n\t\tconst isEligibleForAlzabox = data.hasOwnProperty('isEligibleForAlzabox')\n\t\t\t? data.isEligibleForAlzabox\n\t\t\t: null;\n\t\tconst isEligibleForSlovenskaPostaBox = data.hasOwnProperty(\n\t\t\t'isEligibleForSlovenskaPostaBox'\n\t\t)\n\t\t\t? data.isEligibleForSlovenskaPostaBox\n\t\t\t: null;\n\n\t\t// Update session\n\t\tsetSelectedParcelShopSession(\n\t\t\tparcelShopId,\n\t\t\tparcelShopPusId,\n\t\t\tparcelShopName,\n\t\t\tparcelShopStreet,\n\t\t\tparcelShopZip,\n\t\t\tparcelShopCity,\n\t\t\tparcelShopCountryCode,\n\t\t\tparcelShopMaxWeight,\n\t\t\tparcelShopCod,\n\t\t\tparcelShopCard,\n\t\t\tisEligibleForAlzabox,\n\t\t\tisEligibleForSlovenskaPostaBox\n\t\t);\n\n\t\tconst parcelShopCountry =\n\t\t\tcountries &&\n\t\t\ttypeof countries === 'object' &&\n\t\t\tcountries.hasOwnProperty(parcelShopCountryCode)\n\t\t\t\t? countries[parcelShopCountryCode]\n\t\t\t\t: parcelShopCountryCode;\n\n\t\t// Update frontend field\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelIdSelector).value =\n\t\t\tparcelShopId;\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelPusIdSelector).value =\n\t\t\tparcelShopPusId;\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelNameSelector).value =\n\t\t\tparcelShopName;\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelStreetSelector).value =\n\t\t\tparcelShopStreet;\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelZipSelector).value =\n\t\t\tparcelShopZip;\n\t\tdocument.querySelector(chosenParcelShopHiddenParcelCitySelector).value =\n\t\t\tparcelShopCity;\n\t\tdocument.querySelector(\n\t\t\tchosenParcelShopHiddenParcelCountryCodeSelector\n\t\t).value = parcelShopCountryCode;\n\n\t\t// Filter out empty values\n\t\tconst notEmptyAddressValues = Object.values([\n\t\t\tparcelShopName,\n\t\t\tparcelShopStreet,\n\t\t\tparcelShopZip,\n\t\t\tparcelShopCity,\n\t\t\tparcelShopCountry,\n\t\t]).filter((value) => !!value);\n\n\t\t// Construct the text content\n\t\tdocument.querySelector(chosenParcelShopContentTextSelector).innerHTML =\n\t\t\tnotEmptyAddressValues.join(', ');\n\n\t\tdocument\n\t\t\t.querySelector(chosenParcelShopContentSelector)\n\t\t\t.classList.add('active');\n\t}\n\n\t/**\n\t * Set the selected parcel shop in the session\n\t */\n\tfunction setSelectedParcelShopSession(\n\t\tparcelShopId = '',\n\t\tparcelShopPusId = '',\n\t\tparcelShopName = '',\n\t\tparcelShopStreet = '',\n\t\tparcelShopZip = '',\n\t\tparcelShopCity = '',\n\t\tparcelShopCountryCode = '',\n\t\tparcelShopMaxWeight = '',\n\t\tparcelShopCod = '',\n\t\tparcelShopCard = '',\n\t\tisEligibleForAlzabox = true,\n\t\tisEligibleForSlovenskaPostaBox = true\n\t) {\n\t\t// Prepare XHR Request.\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open('POST', wc_dpd_parcelshop_map_widget_settings.ajax_url, true);\n\t\txhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\n\t\t// Callback on response.\n\t\txhr.onreadystatechange = function () {\n\t\t\t// readyState 4 means the request is done.\n\t\t\tvar DONE = 4;\n\n\t\t\t// status 200 is a successful return.\n\t\t\tvar OK = 200;\n\n\t\t\t// Check response.\n\t\t\tif (xhr.readyState === DONE) {\n\t\t\t\tif (xhr.status === OK) {\n\t\t\t\t\tdocument.body.dispatchEvent(new Event('update_checkout'));\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Finally do the call with the right parametetrs.\n\t\txhr.send(\n\t\t\t'action=wc_dpd_update_chosen_parcelshop&wp_nonce=' +\n\t\t\t\tpopup.getAttribute('data-nonce') +\n\t\t\t\t'&wc_dpd_parcelshop_id=' +\n\t\t\t\tparcelShopId +\n\t\t\t\t'&wc_dpd_parcelshop_pus_id=' +\n\t\t\t\tparcelShopPusId +\n\t\t\t\t'&wc_dpd_parcelshop_name=' +\n\t\t\t\tparcelShopName +\n\t\t\t\t'&wc_dpd_parcelshop_street=' +\n\t\t\t\tparcelShopStreet +\n\t\t\t\t'&wc_dpd_parcelshop_zip=' +\n\t\t\t\tparcelShopZip +\n\t\t\t\t'&wc_dpd_parcelshop_city=' +\n\t\t\t\tparcelShopCity +\n\t\t\t\t'&wc_dpd_parcelshop_country_code=' +\n\t\t\t\tparcelShopCountryCode +\n\t\t\t\t'&wc_dpd_parcelshop_max_weight=' +\n\t\t\t\tparcelShopMaxWeight +\n\t\t\t\t'&wc_dpd_parcelshop_cod=' +\n\t\t\t\tparcelShopCod +\n\t\t\t\t'&wc_dpd_parcelshop_card=' +\n\t\t\t\tparcelShopCard +\n\t\t\t\t'&wc_dpd_parcelshop_is_alzabox_eligible=' +\n\t\t\t\tisEligibleForAlzabox +\n\t\t\t\t'&wc_dpd_parcelshop_is_slovenska_posta_eligible=' +\n\t\t\t\tisEligibleForSlovenskaPostaBox\n\t\t);\n\t}\n\n\t/**\n\t * Open the popup\n\t */\n\tfunction openPopup() {\n\t\tpopup.classList.add('active');\n\n\t\tif (dpdMapWidgetEl && dpdMapWidget) {\n\t\t\tconst chosenParcelShopId = document.querySelector(\n\t\t\t\tchosenParcelShopHiddenParcelIdSelector\n\t\t\t).value;\n\n\t\t\tif (chosenParcelShopId) {\n\t\t\t\tdpdMapWidget.options.selectedPudoId = chosenParcelShopId;\n\t\t\t}\n\n\t\t\t// Reselect open button to get refreshed data\n\t\t\tdpdMapOpenWidgetMapPopupEl = document.querySelector(\n\t\t\t\tmapWidgetPopupOpenBtnSelector\n\t\t\t);\n\n\t\t\t// Add zip if available\n\t\t\tcustomerZip = getCustomerZip();\n\n\t\t\tif (customerZip) {\n\t\t\t\tdpdMapWidget.options.zip = customerZip;\n\t\t\t}\n\n\t\t\t// Get the selected customer country\n\t\t\tconst countryCode = dpdMapOpenWidgetMapPopupEl.getAttribute(\n\t\t\t\t'data-base-country-code'\n\t\t\t);\n\n\t\t\tif (countryCode) {\n\t\t\t\tdpdMapWidget.options.country = countryCode;\n\t\t\t}\n\n\t\t\t// Update weight and allowed locker types when opening the popup\n\t\t\tconst minWeightInKg = parseInt(\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-min-weight-in-kg')\n\t\t\t);\n\t\t\tconst isEligibleForAlzabox =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute(\n\t\t\t\t\t'data-is-eligible-for-alzabox'\n\t\t\t\t) === 'true';\n\t\t\tconst isEligibleForSlovenskaPostaBox =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute(\n\t\t\t\t\t'data-is-eligible-for-slovenska-posta-box'\n\t\t\t\t) === 'true';\n\n\t\t\tdpdMapWidget.options.minWeightInKg = minWeightInKg;\n\n\t\t\tconst disallowShops =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-disallow-shops') ===\n\t\t\t\t'true';\n\t\t\tconst disallowLockers =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-disallow-lockers') ===\n\t\t\t\t'true';\n\t\t\tconst disallowDpdPickupStations =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute(\n\t\t\t\t\t'data-disallow-dpd-pickup-stations'\n\t\t\t\t) === 'true';\n\t\t\tconst disallowSkPost =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-disallow-sk-post') ===\n\t\t\t\t'true';\n\t\t\tconst disallowAlzaBoxes =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-disallow-alza-boxes') ===\n\t\t\t\t'true';\n\n\t\t\tlet allowedPudoTypes = ['shop', 'locker'];\n\t\t\tif (disallowShops) {\n\t\t\t\tallowedPudoTypes = allowedPudoTypes.filter((type) => type !== 'shop');\n\t\t\t}\n\t\t\tif (disallowLockers) {\n\t\t\t\tallowedPudoTypes = allowedPudoTypes.filter((type) => type !== 'locker');\n\t\t\t}\n\n\t\t\tdpdMapWidget.options.allowedPudoTypes = allowedPudoTypes;\n\n\t\t\tlet allowedLockerTypes = [\n\t\t\t\t'dpdSkPickupStations',\n\t\t\t\t'skPost',\n\t\t\t\t'alzaSlovakia',\n\t\t\t\t'outsideOfSlovakia',\n\t\t\t];\n\n\t\t\tif (!isEligibleForAlzabox || !isEligibleForSlovenskaPostaBox) {\n\t\t\t\tif (!isEligibleForAlzabox) {\n\t\t\t\t\tallowedLockerTypes = allowedLockerTypes.filter(\n\t\t\t\t\t\t(type) => type !== 'alzaSlovakia'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (!isEligibleForSlovenskaPostaBox) {\n\t\t\t\t\tallowedLockerTypes = allowedLockerTypes.filter(\n\t\t\t\t\t\t(type) => type !== 'skPost'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!disallowLockers) {\n\t\t\t\tif (disallowDpdPickupStations) {\n\t\t\t\t\tallowedLockerTypes = allowedLockerTypes.filter(\n\t\t\t\t\t\t(type) => type !== 'dpdSkPickupStations'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (disallowSkPost) {\n\t\t\t\t\tallowedLockerTypes = allowedLockerTypes.filter(\n\t\t\t\t\t\t(type) => type !== 'skPost'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (disallowAlzaBoxes) {\n\t\t\t\t\tallowedLockerTypes = allowedLockerTypes.filter(\n\t\t\t\t\t\t(type) => type !== 'alzaSlovakia'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdpdMapWidget.options.allowedLockerTypes = allowedLockerTypes;\n\n\t\t\tlet requiredServices = [];\n\n\t\t\tconst isCodRequired =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute('data-is-cod-required') ===\n\t\t\t\t'true';\n\t\t\tconst isCardPaymentRequired =\n\t\t\t\tdpdMapOpenWidgetMapPopupEl.getAttribute(\n\t\t\t\t\t'data-is-card-payment-required'\n\t\t\t\t) === 'true';\n\n\t\t\tif (isCodRequired || isCardPaymentRequired) {\n\t\t\t\tif (isCodRequired) {\n\t\t\t\t\trequiredServices.push('cod');\n\t\t\t\t}\n\n\t\t\t\tif (isCardPaymentRequired) {\n\t\t\t\t\trequiredServices.push('cardPayment');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdpdMapWidget.options.requiredServices = requiredServices;\n\n\t\t\tdpdMapWidget\n\t\t\t\t.attach(dpdMapWidgetEl)\n\t\t\t\t.then((pudo) => {\n\t\t\t\t\tsetSelectedParcelShop({\n\t\t\t\t\t\tid: pudo.id,\n\t\t\t\t\t\tname: pudo.name,\n\t\t\t\t\t\tstreet: pudo.street,\n\t\t\t\t\t\thouseno: pudo.houseno,\n\t\t\t\t\t\tzip: pudo.zip,\n\t\t\t\t\t\tcity: pudo.city,\n\t\t\t\t\t\tcountryCode: pudo.countryCode,\n\t\t\t\t\t\tmaxweight: pudo.maxWeightInKg,\n\t\t\t\t\t\tcod: pudo.services && pudo.services.includes('cod') ? true : false,\n\t\t\t\t\t\tcard:\n\t\t\t\t\t\t\tpudo.services && pudo.services.includes('cardPayment')\n\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t: false,\n\t\t\t\t\t\tisEligibleForAlzabox: isEligibleForAlzabox,\n\t\t\t\t\t\tisEligibleForSlovenskaPostaBox: isEligibleForSlovenskaPostaBox,\n\t\t\t\t\t});\n\n\t\t\t\t\tclosePopup();\n\t\t\t\t})\n\t\t\t\t.catch((code) => {\n\t\t\t\t\tclosePopup();\n\t\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Close the popup\n\t */\n\tfunction closePopup() {\n\t\tpopup.classList.remove('active');\n\n\t\t// Check if close method exists\n\t\tif (dpdMapWidget && dpdMapWidget.close) {\n\t\t\tdpdMapWidget.close();\n\t\t}\n\t}\n\n\t/**\n\t * Check if a parcel shop is chosen\n\t */\n\tfunction isParcelShopChosen() {\n\t\tvar chosenParcelShopId = document.querySelector(\n\t\t\tchosenParcelShopHiddenParcelIdSelector\n\t\t).value;\n\t\treturn chosenParcelShopId !== '';\n\t}\n\n\t/**\n\t * Get customer zip\n\t */\n\tfunction getCustomerZip() {\n\t\t// Check if ship to different address is checked\n\t\tconst shipToDifferentAddress = document.querySelector(\n\t\t\t'input[name=\"ship_to_different_address\"]'\n\t\t);\n\n\t\tif (shipToDifferentAddress && shipToDifferentAddress.checked) {\n\t\t\tconst shippingPostcodeField = document.querySelector(\n\t\t\t\t'input[name=\"shipping_postcode\"]'\n\t\t\t);\n\n\t\t\tif (shippingPostcodeField) {\n\t\t\t\tcustomerZip = shippingPostcodeField.value;\n\t\t\t}\n\n\t\t\tif (customerZip) {\n\t\t\t\treturn customerZip;\n\t\t\t}\n\t\t}\n\n\t\tconst billingPostcodeField = document.querySelector(\n\t\t\t'input[name=\"billing_postcode\"]'\n\t\t);\n\n\t\tif (billingPostcodeField) {\n\t\t\tcustomerZip = billingPostcodeField.value;\n\t\t}\n\n\t\tif (customerZip) {\n\t\t\treturn customerZip;\n\t\t}\n\n\t\tcustomerZip = dpdMapOpenWidgetMapPopupEl.getAttribute('data-customer-zip');\n\n\t\tif (customerZip) {\n\t\t\treturn customerZip;\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t/**\n\t * Check if document is ready\n\t */\n\tfunction docReady(fn) {\n\t\tif (\n\t\t\tdocument.readyState === 'complete' ||\n\t\t\tdocument.readyState === 'interactive'\n\t\t) {\n\t\t\tsetTimeout(fn, 1);\n\t\t} else {\n\t\t\tdocument.addEventListener('DOMContentLoaded', fn);\n\t\t}\n\t}\n\n\tdocReady(function () {\n\t\tinit();\n\t});\n\n\t// Allow the functions to be called from outside\n\treturn {\n\t\topenPopup: openPopup,\n\t};\n})();\n"],"names":["window","dpdParcelShopWidget","popup","dpdMapWidget","mapWidgetPopupOpenBtnSelector","chosenParcelShopContentSelector","chosenParcelShopContentTextSelector","chosenParcelShopHiddenParcelIdSelector","chosenParcelShopHiddenParcelPusIdSelector","chosenParcelShopHiddenParcelNameSelector","chosenParcelShopHiddenParcelStreetSelector","chosenParcelShopHiddenParcelCitySelector","chosenParcelShopHiddenParcelZipSelector","chosenParcelShopHiddenParcelCountryCodeSelector","dpdMapWidgetEl","customerZip","countries","baseCountryCode","fn","isMapInitialized","init","document","querySelector","addEventListener","event","target","matches","preventDefault","dpdMapOpenWidgetMapPopupEl","closest","apiKey","getAttribute","console","log","JSON","parse","allowedCountries","join","DpdPudo","Widget","country","initMap","openPopup","closePopup","key","value","body","dispatchEvent","Event","setSelectedParcelShop","data","arguments","length","undefined","Object","keys","parcelShopId","hasOwnProperty","id","parcelShopPusId","parcelShopName","name","parcelShopStreet","street","parcelShopZip","zip","parcelShopCity","city","parcelShopCountryCode","countryCode","parcelShopMaxWeight","parcelShopCod","parcelShopCard","isEligibleForAlzabox","isEligibleForSlovenskaPostaBox","xhr","XMLHttpRequest","open","wc_dpd_parcelshop_map_widget_settings","ajax_url","setRequestHeader","onreadystatechange","DONE","OK","readyState","status","send","setSelectedParcelShopSession","maxweight","cod","card","parcelShopCountry","_typeof","notEmptyAddressValues","values","filter","innerHTML","classList","add","chosenParcelShopId","options","selectedPudoId","shipToDifferentAddress","checked","shippingPostcodeField","billingPostcodeField","getCustomerZip","minWeightInKg","parseInt","disallowShops","disallowLockers","disallowDpdPickupStations","disallowSkPost","disallowAlzaBoxes","allowedPudoTypes","type","allowedLockerTypes","requiredServices","isCodRequired","isCardPaymentRequired","push","attach","then","pudo","houseno","maxWeightInKg","services","includes","code","remove","close","setTimeout"],"sourceRoot":""}
  • wc-dpd/trunk/public/scripts/dpd-parcelshop-shipping-method-weight-by-package-repeater.js

    r3115058 r3143150  
    1 (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,o(r.key),r)}}function o(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}var i=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=e,this.props=this.getProps(e),this.refs=this.getRefs(e),this.inputsData=this.getInputsData(e)},n=[{key:"init",value:function(){var t=this;this.inputsData.length?this.inputsData.forEach((function(e){t.addRow(e)})):this.addRow(),this.refs.addButton.onclick=function(e){e.preventDefault(),t.addRow()}}},{key:"getRefs",value:function(t){var n={};return e(t.querySelectorAll("[data-ref]")).forEach((function(t){n[t.dataset.ref]=t})),n}},{key:"getProps",value:function(t){return JSON.parse(t.dataset.props)}},{key:"getInputsData",value:function(t){return JSON.parse(t.dataset.inputsData)}},{key:"createFromHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=document.createElement(null);return e.innerHTML=t,e.firstElementChild}},{key:"addRow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this,n=this.createFromHTML(this.renderRow(t));this.getRefs(n).removeButton.onclick=function(t){t.preventDefault(),e.removeRow(n)},this.refs.rowList.appendChild(n)}},{key:"removeRow",value:function(t){this.refs.rowList.children.length<=1||(t.remove(),this.el.focus(),this.refs.rowList.children.length<this.props.maxRows&&(this.refs.addButton.style.display=""))}}],n&&r(t.prototype,n),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();const a=function(){var t,e,n,r,o,i,a,c="fixed",u="products_weight_based";function p(){t.value===c?(e.forEach((function(t){return t.style.display="table-row"})),n.forEach((function(t){return t.style.display="none"}))):t.value===u&&(e.forEach((function(t){return t.style.display="none"})),n.forEach((function(t){return t.style.display="table-row"})))}function l(){r.checked?o.forEach((function(t){t.style.display="table-row"})):o.forEach((function(t){t.style.display="none"}))}function s(){i.checked?a.forEach((function(t){t.style.display="table-row"})):a.forEach((function(t){return t.style.display="none"}))}return{init:function(){(t=document.querySelector(".js-dpd-shipping-type-select"))&&(e=Array.from(document.querySelectorAll(".js-dpd-fixed-shipping-type")).map((function(t){return t.closest("tr")})),n=Array.from(document.querySelectorAll(".js-dpd-weight-based-shipping-type")).map((function(t){return t.closest("tr")})),t.addEventListener("change",p),p()),(r=document.querySelector(".js-dpd-checkbox-weight-limit"))&&(o=Array.from(document.querySelectorAll(".js-dpd-weight-limit-shipping-type")).map((function(t){return t.classList.contains("js-dpd-weight-limit-shipping-type")?t.closest("tr"):t})),r.addEventListener("change",l),l()),(i=document.querySelector(".js-dpd-checkbox-dimension-limit"))&&(a=Array.from(document.querySelectorAll(".js-dpd-dimension-limit-shipping-type")).map((function(t){return t.classList.contains("js-dpd-dimension-limit-shipping-type")?t.closest("tr"):t})),i.addEventListener("change",s),s())}}}();function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,p(r.key),r)}}function p(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}function l(t,e,n){return e=f(e),function(t,e){if(e&&("object"==c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,s()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(s=function(){return!!t})()}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}window.DpdParcelshopShippingMethodWeightByPackageRepeater=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,e,[t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(e,t),n=e,r=[{key:"renderRow",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return'\n\t\t\t<li class="repeatable-field__row">\n\t\t\t\t\t<div class="repeatable-field__row-wrap">\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t<label for="'.concat(this.props.inputName,'_min[]">\n\t\t\t\t\t\t\t\t\t\t').concat("minWeightInputText"in this.props?this.props.minWeightInputText:"",'\n\t\t\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tclass="repeatable-field__input form-field"\n\t\t\t\t\t\t\t\t\t\t\tdata-ref="input-min"\n\t\t\t\t\t\t\t\t\t\t\ttype="number"\n\t\t\t\t\t\t\t\t\t\t\tmin="1"\n\t\t\t\t\t\t\t\t\t\t\tname="').concat(this.props.inputName,'_min[]"\n\t\t\t\t\t\t\t\t\t\t\tvalue="').concat("min"in e?e.min:"",'"\n\t\t\t\t\t\t\t\t\t\t\tplaceholder="').concat("minWeightInputPlaceholderText"in this.props?this.props.minWeightInputPlaceholderText:"",'"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t<label for="').concat(this.props.inputName,'_max[]">\n\t\t\t\t\t\t\t\t\t\t\t').concat("maxWeightInputText"in this.props?this.props.maxWeightInputText:"",'\n\t\t\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tclass="repeatable-field__input form-field"\n\t\t\t\t\t\t\t\t\t\t\tdata-ref="input-max"\n\t\t\t\t\t\t\t\t\t\t\ttype="number"\n\t\t\t\t\t\t\t\t\t\t\tmin="1"\n\t\t\t\t\t\t\t\t\t\t\tname="').concat(this.props.inputName,'_max[]"\n\t\t\t\t\t\t\t\t\t\t\tvalue="').concat("max"in e?e.max:"",'"\n\t\t\t\t\t\t\t\t\t\t\tplaceholder="').concat("maxWeightInputPlaceholderText"in this.props?this.props.maxWeightInputPlaceholderText:"",'"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t<label for="').concat(this.props.inputName,'_price[]">\n\t\t\t\t\t\t\t\t\t\t\t').concat("priceInputText"in this.props?this.props.priceInputText:"",'\n\t\t\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tclass="repeatable-field__input form-field"\n\t\t\t\t\t\t\t\t\t\t\tdata-ref="input-price"\n\t\t\t\t\t\t\t\t\t\t\ttype="number"\n\t\t\t\t\t\t\t\t\t\t\tmin="0"\n\t\t\t\t\t\t\t\t\t\t\tname="').concat(this.props.inputName,'_price[]"\n\t\t\t\t\t\t\t\t\t\t\tvalue="').concat("price"in e?e.price:"",'"\n\t\t\t\t\t\t\t\t\t\t\tplaceholder="').concat("priceInputPlaceholderText"in this.props?this.props.priceInputPlaceholderText:"",'"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</span>\n\n\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\tclass="repeatable-field__remove-button button"\n\t\t\t\t\t\t\t\t\tdata-ref="removeButton"\n\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t').concat(null!==(t=this.props.removeLabel)&&void 0!==t?t:"Remove","\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t</li>\n\t\t")}}],r&&u(n.prototype,r),o&&u(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(i),jQuery(document.body).on("wc_backbone_modal_loaded",(function(t,e){"wc-modal-shipping-method-settings"===e&&(document.querySelectorAll('[data-component="field-repeater"]').forEach((function(t){new window.DpdParcelshopShippingMethodWeightByPackageRepeater(t).init()})),a.init())}))})();
     1(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,o(r.key),r)}}function o(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}var i=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=e,this.props=this.getProps(e),this.refs=this.getRefs(e),this.inputsData=this.getInputsData(e)},n=[{key:"init",value:function(){var t=this;this.inputsData.length?this.inputsData.forEach((function(e){t.addRow(e)})):this.addRow(),this.refs.addButton.onclick=function(e){e.preventDefault(),t.addRow()}}},{key:"getRefs",value:function(t){var n={};return e(t.querySelectorAll("[data-ref]")).forEach((function(t){n[t.dataset.ref]=t})),n}},{key:"getProps",value:function(t){return JSON.parse(t.dataset.props)}},{key:"getInputsData",value:function(t){return JSON.parse(t.dataset.inputsData)}},{key:"createFromHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=document.createElement(null);return e.innerHTML=t,e.firstElementChild}},{key:"addRow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this,n=this.createFromHTML(this.renderRow(t));this.getRefs(n).removeButton.onclick=function(t){t.preventDefault(),e.removeRow(n)},this.refs.rowList.appendChild(n)}},{key:"removeRow",value:function(t){this.refs.rowList.children.length<=1||(t.remove(),this.el.focus(),this.refs.rowList.children.length<this.props.maxRows&&(this.refs.addButton.style.display=""))}}],n&&r(t.prototype,n),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}();const a=function(){var t,e,n,r,o,i,a,c="fixed";function u(){var r=t.value===c;s(e,r),s(n,!r)}function p(){s(o,r.checked)}function l(){s(a,i.checked)}function s(t,e){t.forEach((function(t){var n=t.closest("fieldset");if(n){var r=n.previousElementSibling;r&&"LABEL"===r.tagName&&(r.style.display=e?"":"none"),n.style.display=e?"":"none"}}))}return{init:function(){(t=document.querySelector(".js-dpd-shipping-type-select"))&&(e=document.querySelectorAll(".js-dpd-fixed-shipping-type"),n=document.querySelectorAll(".js-dpd-weight-based-shipping-type"),t.addEventListener("change",u),u()),(r=document.querySelector(".js-dpd-checkbox-weight-limit"))&&(o=document.querySelectorAll(".js-dpd-weight-limit-shipping-type"),r.addEventListener("change",p),p()),(i=document.querySelector(".js-dpd-checkbox-dimension-limit"))&&(a=document.querySelectorAll(".js-dpd-dimension-limit-shipping-type"),i.addEventListener("change",l),l())}}}();function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,p(r.key),r)}}function p(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}function l(t,e,n){return e=f(e),function(t,e){if(e&&("object"==c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,s()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(s=function(){return!!t})()}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}window.DpdParcelshopShippingMethodWeightByPackageRepeater=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,e,[t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(e,t),n=e,r=[{key:"renderRow",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return'\n\t\t\t<li class="repeatable-field__row">\n\t\t\t\t\t<div class="repeatable-field__row-wrap">\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t<label for="'.concat(this.props.inputName,'_min[]">\n\t\t\t\t\t\t\t\t\t\t').concat("minWeightInputText"in this.props?this.props.minWeightInputText:"",'\n\t\t\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tclass="repeatable-field__input form-field"\n\t\t\t\t\t\t\t\t\t\t\tdata-ref="input-min"\n\t\t\t\t\t\t\t\t\t\t\ttype="number"\n\t\t\t\t\t\t\t\t\t\t\tmin="1"\n\t\t\t\t\t\t\t\t\t\t\tname="').concat(this.props.inputName,'_min[]"\n\t\t\t\t\t\t\t\t\t\t\tvalue="').concat("min"in e?e.min:"",'"\n\t\t\t\t\t\t\t\t\t\t\tplaceholder="').concat("minWeightInputPlaceholderText"in this.props?this.props.minWeightInputPlaceholderText:"",'"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t<label for="').concat(this.props.inputName,'_max[]">\n\t\t\t\t\t\t\t\t\t\t\t').concat("maxWeightInputText"in this.props?this.props.maxWeightInputText:"",'\n\t\t\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tclass="repeatable-field__input form-field"\n\t\t\t\t\t\t\t\t\t\t\tdata-ref="input-max"\n\t\t\t\t\t\t\t\t\t\t\ttype="number"\n\t\t\t\t\t\t\t\t\t\t\tmin="1"\n\t\t\t\t\t\t\t\t\t\t\tname="').concat(this.props.inputName,'_max[]"\n\t\t\t\t\t\t\t\t\t\t\tvalue="').concat("max"in e?e.max:"",'"\n\t\t\t\t\t\t\t\t\t\t\tplaceholder="').concat("maxWeightInputPlaceholderText"in this.props?this.props.maxWeightInputPlaceholderText:"",'"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t<label for="').concat(this.props.inputName,'_price[]">\n\t\t\t\t\t\t\t\t\t\t\t').concat("priceInputText"in this.props?this.props.priceInputText:"",'\n\t\t\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tclass="repeatable-field__input form-field"\n\t\t\t\t\t\t\t\t\t\t\tdata-ref="input-price"\n\t\t\t\t\t\t\t\t\t\t\ttype="number"\n\t\t\t\t\t\t\t\t\t\t\tmin="0"\n\t\t\t\t\t\t\t\t\t\t\tname="').concat(this.props.inputName,'_price[]"\n\t\t\t\t\t\t\t\t\t\t\tvalue="').concat("price"in e?e.price:"",'"\n\t\t\t\t\t\t\t\t\t\t\tplaceholder="').concat("priceInputPlaceholderText"in this.props?this.props.priceInputPlaceholderText:"",'"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</span>\n\n\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\tclass="repeatable-field__remove-button button"\n\t\t\t\t\t\t\t\t\tdata-ref="removeButton"\n\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t').concat(null!==(t=this.props.removeLabel)&&void 0!==t?t:"Remove","\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t</li>\n\t\t")}}],r&&u(n.prototype,r),o&&u(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(i),jQuery(document.body).on("wc_backbone_modal_loaded",(function(t,e){"wc-modal-shipping-method-settings"===e&&(document.querySelectorAll('[data-component="field-repeater"]').forEach((function(t){new window.DpdParcelshopShippingMethodWeightByPackageRepeater(t).init()})),a.init())}))})();
    22//# sourceMappingURL=dpd-parcelshop-shipping-method-weight-by-package-repeater.js.map
  • wc-dpd/trunk/public/scripts/dpd-parcelshop-shipping-method-weight-by-package-repeater.js.map

    r3115058 r3143150  
    1 {"version":3,"file":"/scripts/dpd-parcelshop-shipping-method-weight-by-package-repeater.js","mappings":"u7CAAO,IAAMA,EAA8B,WAMzC,O,EALD,SAAAA,EAAYC,I,4FAAIC,CAAA,KAAAF,GACfG,KAAKF,GAAKA,EACVE,KAAKC,MAAQD,KAAKE,SAASJ,GAC3BE,KAAKG,KAAOH,KAAKI,QAAQN,GACzBE,KAAKK,WAAaL,KAAKM,cAAcR,EACtC,E,EAAC,EAAAS,IAAA,OAAAC,MAED,WAAO,IAAAC,EAAA,KACFT,KAAKK,WAAWK,OACnBV,KAAKK,WAAWM,SAAQ,SAACC,GACxBH,EAAKI,OAAOD,EACb,IAEAZ,KAAKa,SAGNb,KAAKG,KAAKW,UAAUC,QAAU,SAACC,GAC9BA,EAAEC,iBACFR,EAAKI,QACN,CACD,GAAC,CAAAN,IAAA,UAAAC,MAED,SAAQV,GACP,IAAIoB,EAAS,CAAC,EAId,OAHAC,EAAIrB,EAAGsB,iBAAiB,eAAeT,SAAQ,SAACU,GAC/CH,EAAOG,EAAIC,QAAQD,KAAOA,CAC3B,IACOH,CACR,GAAC,CAAAX,IAAA,WAAAC,MAED,SAASV,GACR,OAAOyB,KAAKC,MAAM1B,EAAGwB,QAAQrB,MAC9B,GAAC,CAAAM,IAAA,gBAAAC,MAED,SAAcV,GACb,OAAOyB,KAAKC,MAAM1B,EAAGwB,QAAQjB,WAC9B,GAAC,CAAAE,IAAA,iBAAAC,MAED,WAA0B,IAAXiB,EAAIC,UAAAhB,OAAA,QAAAiB,IAAAD,UAAA,GAAAA,UAAA,GAAG,GACjBE,EAAUC,SAASC,cAAc,MAErC,OADAF,EAAQG,UAAYN,EACbG,EAAQI,iBAChB,GAAC,CAAAzB,IAAA,SAAAC,MAED,WAAuB,IAAhBI,EAASc,UAAAhB,OAAA,QAAAiB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OAQhE7E,KAAKC,MAAM6E,UAAS,0CAAAD,OACnB,QAASjE,EAAYA,EAAUoE,IAAM,GAAE,0CAAAH,OAE/C,kCAAmC7E,KAAKC,MACrCD,KAAKC,MAAMgF,8BACX,GAAE,0GAAAJ,OAMM7E,KAAKC,MAAM6E,UAAS,oCAAAD,OAC9B,uBAAwB7E,KAAKC,MAAQD,KAAKC,MAAMiF,mBAAqB,GAAE,4QAAAL,OAQjE7E,KAAKC,MAAM6E,UAAS,0CAAAD,OACnB,QAASjE,EAAYA,EAAUuE,IAAM,GAAE,0CAAAN,OAE/C,kCAAmC7E,KAAKC,MACrCD,KAAKC,MAAMmF,8BACX,GAAE,0GAAAP,OAMM7E,KAAKC,MAAM6E,UAAS,sCAAAD,OAC9B,mBAAoB7E,KAAKC,MAAQD,KAAKC,MAAMoF,eAAiB,GAAE,8QAAAR,OAQzD7E,KAAKC,MAAM6E,UAAS,4CAAAD,OACnB,UAAWjE,EAAYA,EAAU0E,MAAQ,GAAE,0CAAAT,OAEnD,8BAA+B7E,KAAKC,MACjCD,KAAKC,MAAMsF,0BACX,GAAE,oQAAAV,OAWgB,QAXhBD,EAWN5E,KAAKC,MAAMuF,mBAAW,IAAAZ,EAAAA,EAAI,SAAQ,iEAK5C,I,4FAAC,CAlFuD,CACxD/E,GAoFD4F,OAAO5D,SAAS6D,MAAMC,GAAG,4BAA4B,SAAUC,EAAKC,GAC/D,sCAAwCA,IAC3ChE,SACET,iBAAiB,qCACjBT,SAAQ,SAACb,GAER,IAAIwE,OAAOC,mDAAmDzE,GACjD+D,MACf,IAGDiC,EAA4BjC,OAE9B,G","sources":["webpack:///./assets/scripts/dpd-export-repeater-settings-field.js","webpack:///./assets/scripts/dpd-parcelshop-shipping-method.js","webpack:///./assets/scripts/dpd-parcelshop-shipping-method-weight-by-package-repeater.js"],"sourcesContent":["export class DpdExportRepeaterSettingsField {\r\n\tconstructor(el) {\r\n\t\tthis.el = el;\r\n\t\tthis.props = this.getProps(el);\r\n\t\tthis.refs = this.getRefs(el);\r\n\t\tthis.inputsData = this.getInputsData(el);\r\n\t}\r\n\r\n\tinit() {\r\n\t\tif (this.inputsData.length) {\r\n\t\t\tthis.inputsData.forEach((inputData) => {\r\n\t\t\t\tthis.addRow(inputData);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.addRow();\r\n\t\t}\r\n\r\n\t\tthis.refs.addButton.onclick = (e) => {\r\n\t\t\te.preventDefault();\r\n\t\t\tthis.addRow();\r\n\t\t};\r\n\t}\r\n\r\n\tgetRefs(el) {\r\n\t\tlet result = {};\r\n\t\t[...el.querySelectorAll('[data-ref]')].forEach((ref) => {\r\n\t\t\tresult[ref.dataset.ref] = ref;\r\n\t\t});\r\n\t\treturn result;\r\n\t}\r\n\r\n\tgetProps(el) {\r\n\t\treturn JSON.parse(el.dataset.props);\r\n\t}\r\n\r\n\tgetInputsData(el) {\r\n\t\treturn JSON.parse(el.dataset.inputsData);\r\n\t}\r\n\r\n\tcreateFromHTML(html = '') {\r\n\t\tlet element = document.createElement(null);\r\n\t\telement.innerHTML = html;\r\n\t\treturn element.firstElementChild;\r\n\t}\r\n\r\n\taddRow(inputData = []) {\r\n\t\tconst that = this;\r\n\r\n\t\tlet newRow = this.createFromHTML(this.renderRow(inputData));\r\n\t\tconst rowRefs = this.getRefs(newRow);\r\n\r\n\t\trowRefs.removeButton.onclick = (e) => {\r\n\t\t\te.preventDefault();\r\n\t\t\tthat.removeRow(newRow);\r\n\t\t};\r\n\r\n\t\tthis.refs.rowList.appendChild(newRow);\r\n\t}\r\n\r\n\tremoveRow(row) {\r\n\t\tif (this.refs.rowList.children.length <= 1) return;\r\n\r\n\t\trow.remove();\r\n\t\tthis.el.focus();\r\n\r\n\t\tif (this.refs.rowList.children.length < this.props.maxRows) {\r\n\t\t\tthis.refs.addButton.style.display = '';\r\n\t\t}\r\n\t}\r\n}\r\n","const dpdParcelshopShippingMethod = (function () {\r\n\tconst SHIPPING_TYPE_FIXED = 'fixed';\r\n\tconst SHIPPING_TYPE_PRODUCTS_WEIGHT_BASED = 'products_weight_based';\r\n\r\n\tlet shippingTypeSelect,\r\n\t\tfixedShippingTypes,\r\n\t\tproductsWeightBasedShippingTypes,\r\n\t\tproductsWeightLimitCheckbox,\r\n\t\tproductsWeightLimitShippingFields,\r\n\t\tproductsDimensionLimitCheckbox,\r\n\t\tproductsDimensionLimitShippingFields;\r\n\r\n\tfunction init() {\r\n\t\t// Shipping type fields\r\n\t\tshippingTypeSelect = document.querySelector('.js-dpd-shipping-type-select');\r\n\r\n\t\tif (shippingTypeSelect) {\r\n\t\t\tfixedShippingTypes = Array.from(\r\n\t\t\t\tdocument.querySelectorAll('.js-dpd-fixed-shipping-type')\r\n\t\t\t).map((el) => el.closest('tr'));\r\n\r\n\t\t\tproductsWeightBasedShippingTypes = Array.from(\r\n\t\t\t\tdocument.querySelectorAll('.js-dpd-weight-based-shipping-type')\r\n\t\t\t).map((el) => el.closest('tr'));\r\n\r\n\t\t\tshippingTypeSelect.addEventListener('change', updateShippingTypeFields);\r\n\t\t\tupdateShippingTypeFields();\r\n\t\t}\r\n\r\n\t\t// Products weight limit fields\r\n\t\tproductsWeightLimitCheckbox = document.querySelector(\r\n\t\t\t'.js-dpd-checkbox-weight-limit'\r\n\t\t);\r\n\r\n\t\tif (productsWeightLimitCheckbox) {\r\n\t\t\tproductsWeightLimitShippingFields = Array.from(\r\n\t\t\t\tdocument.querySelectorAll('.js-dpd-weight-limit-shipping-type')\r\n\t\t\t).map((el) => {\r\n\t\t\t\tif (el.classList.contains('js-dpd-weight-limit-shipping-type')) {\r\n\t\t\t\t\treturn el.closest('tr');\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tproductsWeightLimitCheckbox.addEventListener(\r\n\t\t\t\t'change',\r\n\t\t\t\tupdateProductWeightLimitFields\r\n\t\t\t);\r\n\t\t\tupdateProductWeightLimitFields();\r\n\t\t}\r\n\r\n\t\t// Products dimension limit fields\r\n\t\tproductsDimensionLimitCheckbox = document.querySelector(\r\n\t\t\t'.js-dpd-checkbox-dimension-limit'\r\n\t\t);\r\n\r\n\t\tif (productsDimensionLimitCheckbox) {\r\n\t\t\tproductsDimensionLimitShippingFields = Array.from(\r\n\t\t\t\tdocument.querySelectorAll('.js-dpd-dimension-limit-shipping-type')\r\n\t\t\t).map((el) => {\r\n\t\t\t\tif (el.classList.contains('js-dpd-dimension-limit-shipping-type')) {\r\n\t\t\t\t\treturn el.closest('tr');\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tproductsDimensionLimitCheckbox.addEventListener(\r\n\t\t\t\t'change',\r\n\t\t\t\tupdateProductDimensionLimitFields\r\n\t\t\t);\r\n\t\t\tupdateProductDimensionLimitFields();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateShippingTypeFields() {\r\n\t\tif (shippingTypeSelect.value === SHIPPING_TYPE_FIXED) {\r\n\t\t\tfixedShippingTypes.forEach((el) => (el.style.display = 'table-row'));\r\n\t\t\tproductsWeightBasedShippingTypes.forEach(\r\n\t\t\t\t(el) => (el.style.display = 'none')\r\n\t\t\t);\r\n\t\t} else if (\r\n\t\t\tshippingTypeSelect.value === SHIPPING_TYPE_PRODUCTS_WEIGHT_BASED\r\n\t\t) {\r\n\t\t\tfixedShippingTypes.forEach((el) => (el.style.display = 'none'));\r\n\t\t\tproductsWeightBasedShippingTypes.forEach(\r\n\t\t\t\t(el) => (el.style.display = 'table-row')\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateProductWeightLimitFields() {\r\n\t\tif (productsWeightLimitCheckbox.checked) {\r\n\t\t\tproductsWeightLimitShippingFields.forEach((el) => {\r\n\t\t\t\tel.style.display = 'table-row';\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tproductsWeightLimitShippingFields.forEach((el) => {\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateProductDimensionLimitFields() {\r\n\t\tif (productsDimensionLimitCheckbox.checked) {\r\n\t\t\tproductsDimensionLimitShippingFields.forEach((el) => {\r\n\t\t\t\tel.style.display = 'table-row';\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tproductsDimensionLimitShippingFields.forEach(\r\n\t\t\t\t(el) => (el.style.display = 'none')\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\tinit: init,\r\n\t};\r\n})();\r\n\r\nexport default dpdParcelshopShippingMethod;\r\n","import { DpdExportRepeaterSettingsField } from './dpd-export-repeater-settings-field';\r\nimport dpdParcelshopShippingMethod from './dpd-parcelshop-shipping-method';\r\n\r\nwindow.DpdParcelshopShippingMethodWeightByPackageRepeater = class extends (\r\n\tDpdExportRepeaterSettingsField\r\n) {\r\n\tconstructor(el) {\r\n\t\tsuper(el);\r\n\t}\r\n\r\n\trenderRow(inputData = []) {\r\n\t\treturn `\r\n\t\t\t<li class=\"repeatable-field__row\">\r\n\t\t\t\t\t<div class=\"repeatable-field__row-wrap\">\r\n\t\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t\t\t<label for=\"${this.props.inputName}_min[]\">\r\n\t\t\t\t\t\t\t\t\t\t${'minWeightInputText' in this.props ? this.props.minWeightInputText : ''}\r\n\t\t\t\t\t\t\t\t\t</label>\r\n\r\n\t\t\t\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\t\t\t\t\tclass=\"repeatable-field__input form-field\"\r\n\t\t\t\t\t\t\t\t\t\t\tdata-ref=\"input-min\"\r\n\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\t\t\t\t\tmin=\"1\"\r\n\t\t\t\t\t\t\t\t\t\t\tname=\"${this.props.inputName}_min[]\"\r\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"${'min' in inputData ? inputData.min : ''}\"\r\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"${\r\n\t\t\t\t\t\t\t\t\t\t\t\t'minWeightInputPlaceholderText' in this.props\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t? this.props.minWeightInputPlaceholderText\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\r\n\t\t\t\t\t\t\t\t\t\t\t}\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</span>\r\n\r\n\t\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t\t\t<label for=\"${this.props.inputName}_max[]\">\r\n\t\t\t\t\t\t\t\t\t\t\t${'maxWeightInputText' in this.props ? this.props.maxWeightInputText : ''}\r\n\t\t\t\t\t\t\t\t\t</label>\r\n\r\n\t\t\t\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\t\t\t\t\tclass=\"repeatable-field__input form-field\"\r\n\t\t\t\t\t\t\t\t\t\t\tdata-ref=\"input-max\"\r\n\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\t\t\t\t\tmin=\"1\"\r\n\t\t\t\t\t\t\t\t\t\t\tname=\"${this.props.inputName}_max[]\"\r\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"${'max' in inputData ? inputData.max : ''}\"\r\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"${\r\n\t\t\t\t\t\t\t\t\t\t\t\t'maxWeightInputPlaceholderText' in this.props\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t? this.props.maxWeightInputPlaceholderText\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\r\n\t\t\t\t\t\t\t\t\t\t\t}\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</span>\r\n\r\n\t\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t\t\t<label for=\"${this.props.inputName}_price[]\">\r\n\t\t\t\t\t\t\t\t\t\t\t${'priceInputText' in this.props ? this.props.priceInputText : ''}\r\n\t\t\t\t\t\t\t\t\t</label>\r\n\r\n\t\t\t\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\t\t\t\t\tclass=\"repeatable-field__input form-field\"\r\n\t\t\t\t\t\t\t\t\t\t\tdata-ref=\"input-price\"\r\n\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\t\t\t\t\tmin=\"0\"\r\n\t\t\t\t\t\t\t\t\t\t\tname=\"${this.props.inputName}_price[]\"\r\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"${'price' in inputData ? inputData.price : ''}\"\r\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"${\r\n\t\t\t\t\t\t\t\t\t\t\t\t'priceInputPlaceholderText' in this.props\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t? this.props.priceInputPlaceholderText\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\r\n\t\t\t\t\t\t\t\t\t\t\t}\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</span>\r\n\r\n\r\n\t\t\t\t\t\t\t<button\r\n\t\t\t\t\t\t\t\t\tclass=\"repeatable-field__remove-button button\"\r\n\t\t\t\t\t\t\t\t\tdata-ref=\"removeButton\"\r\n\t\t\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t${this.props.removeLabel ?? 'Remove'}\r\n\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t</div>\r\n\t\t\t</li>\r\n\t\t`;\r\n\t}\r\n};\r\n\r\njQuery(document.body).on('wc_backbone_modal_loaded', function (evt, target) {\r\n\tif ('wc-modal-shipping-method-settings' === target) {\r\n\t\tdocument\r\n\t\t\t.querySelectorAll('[data-component=\"field-repeater\"]')\r\n\t\t\t.forEach((el) => {\r\n\t\t\t\tconst fieldRepeater =\r\n\t\t\t\t\tnew window.DpdParcelshopShippingMethodWeightByPackageRepeater(el);\r\n\t\t\t\tfieldRepeater.init();\r\n\t\t\t});\r\n\r\n\t\t// init shipping method scripts\r\n\t\tdpdParcelshopShippingMethod.init();\r\n\t}\r\n});\r\n"],"names":["DpdExportRepeaterSettingsField","el","_classCallCheck","this","props","getProps","refs","getRefs","inputsData","getInputsData","key","value","_this","length","forEach","inputData","addRow","addButton","onclick","e","preventDefault","result","_toConsumableArray","querySelectorAll","ref","dataset","JSON","parse","html","arguments","undefined","element","document","createElement","innerHTML","firstElementChild","that","newRow","createFromHTML","renderRow","removeButton","removeRow","rowList","appendChild","row","children","remove","focus","maxRows","style","display","shippingTypeSelect","fixedShippingTypes","productsWeightBasedShippingTypes","productsWeightLimitCheckbox","productsWeightLimitShippingFields","productsDimensionLimitCheckbox","productsDimensionLimitShippingFields","SHIPPING_TYPE_FIXED","SHIPPING_TYPE_PRODUCTS_WEIGHT_BASED","updateShippingTypeFields","updateProductWeightLimitFields","checked","updateProductDimensionLimitFields","init","querySelector","Array","from","map","closest","addEventListener","classList","contains","window","DpdParcelshopShippingMethodWeightByPackageRepeater","_DpdExportRepeaterSet","_class","_callSuper","_inherits","_this$props$removeLab","concat","inputName","minWeightInputText","min","minWeightInputPlaceholderText","maxWeightInputText","max","maxWeightInputPlaceholderText","priceInputText","price","priceInputPlaceholderText","removeLabel","jQuery","body","on","evt","target","dpdParcelshopShippingMethod"],"sourceRoot":""}
     1{"version":3,"file":"/scripts/dpd-parcelshop-shipping-method-weight-by-package-repeater.js","mappings":"u7CAAO,IAAMA,EAA8B,WAMzC,O,EALD,SAAAA,EAAYC,I,4FAAIC,CAAA,KAAAF,GACfG,KAAKF,GAAKA,EACVE,KAAKC,MAAQD,KAAKE,SAASJ,GAC3BE,KAAKG,KAAOH,KAAKI,QAAQN,GACzBE,KAAKK,WAAaL,KAAKM,cAAcR,EACtC,E,EAAC,EAAAS,IAAA,OAAAC,MAED,WAAO,IAAAC,EAAA,KACFT,KAAKK,WAAWK,OACnBV,KAAKK,WAAWM,SAAQ,SAACC,GACxBH,EAAKI,OAAOD,EACb,IAEAZ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IqB/E,KAAKC,MAAM+E,UAAS,kCAAAD,OAC/B,uBAAwB/E,KAAKC,MAAQD,KAAKC,MAAMgF,mBAAqB,GAAE,4QAAAF,OAQhE/E,KAAKC,MAAM+E,UAAS,0CAAAD,OACnB,QAASnE,EAAYA,EAAUsE,IAAM,GAAE,0CAAAH,OAE/C,kCAAmC/E,KAAKC,MACrCD,KAAKC,MAAMkF,8BACX,GAAE,0GAAAJ,OAMM/E,KAAKC,MAAM+E,UAAS,oCAAAD,OAC9B,uBAAwB/E,KAAKC,MAAQD,KAAKC,MAAMmF,mBAAqB,GAAE,4QAAAL,OAQjE/E,KAAKC,MAAM+E,UAAS,0CAAAD,OACnB,QAASnE,EAAYA,EAAUyE,IAAM,GAAE,0CAAAN,OAE/C,kCAAmC/E,KAAKC,MACrCD,KAAKC,MAAMqF,8BACX,GAAE,0GAAAP,OAMM/E,KAAKC,MAAM+E,UAAS,sCAAAD,OAC9B,mBAAoB/E,KAAKC,MAAQD,KAAKC,MAAMsF,eAAiB,GAAE,8QAAAR,OAQzD/E,KAAKC,MAAM+E,UAAS,4CAAAD,OACnB,UAAWnE,EAAYA,EAAU4E,MAAQ,GAAE,0CAAAT,OAEnD,8BAA+B/E,KAAKC,MACjCD,KAAKC,MAAMwF,0BACX,GAAE,oQAAAV,OAWgB,QAXhBD,EAWN9E,KAAKC,MAAMyF,mBAAW,IAAAZ,EAAAA,EAAI,SAAQ,iEAK5C,I,4FAAC,CAlFuD,CACxDjF,GAoFD8F,OAAO9D,SAAS+D,MAAMC,GAAG,4BAA4B,SAAUC,EAAKC,GAC/D,sCAAwCA,IAC3ClE,SACET,iBAAiB,qCACjBT,SAAQ,SAACb,GAER,IAAI0E,OAAOC,mDAAmD3E,GACjDuE,MACf,IAGD2B,EAA4B3B,OAE9B,G","sources":["webpack:///./assets/scripts/dpd-export-repeater-settings-field.js","webpack:///./assets/scripts/dpd-parcelshop-shipping-method.js","webpack:///./assets/scripts/dpd-parcelshop-shipping-method-weight-by-package-repeater.js"],"sourcesContent":["export class DpdExportRepeaterSettingsField {\r\n\tconstructor(el) {\r\n\t\tthis.el = el;\r\n\t\tthis.props = this.getProps(el);\r\n\t\tthis.refs = this.getRefs(el);\r\n\t\tthis.inputsData = this.getInputsData(el);\r\n\t}\r\n\r\n\tinit() {\r\n\t\tif (this.inputsData.length) {\r\n\t\t\tthis.inputsData.forEach((inputData) => {\r\n\t\t\t\tthis.addRow(inputData);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.addRow();\r\n\t\t}\r\n\r\n\t\tthis.refs.addButton.onclick = (e) => {\r\n\t\t\te.preventDefault();\r\n\t\t\tthis.addRow();\r\n\t\t};\r\n\t}\r\n\r\n\tgetRefs(el) {\r\n\t\tlet result = {};\r\n\t\t[...el.querySelectorAll('[data-ref]')].forEach((ref) => {\r\n\t\t\tresult[ref.dataset.ref] = ref;\r\n\t\t});\r\n\t\treturn result;\r\n\t}\r\n\r\n\tgetProps(el) {\r\n\t\treturn JSON.parse(el.dataset.props);\r\n\t}\r\n\r\n\tgetInputsData(el) {\r\n\t\treturn JSON.parse(el.dataset.inputsData);\r\n\t}\r\n\r\n\tcreateFromHTML(html = '') {\r\n\t\tlet element = document.createElement(null);\r\n\t\telement.innerHTML = html;\r\n\t\treturn element.firstElementChild;\r\n\t}\r\n\r\n\taddRow(inputData = []) {\r\n\t\tconst that = this;\r\n\r\n\t\tlet newRow = this.createFromHTML(this.renderRow(inputData));\r\n\t\tconst rowRefs = this.getRefs(newRow);\r\n\r\n\t\trowRefs.removeButton.onclick = (e) => {\r\n\t\t\te.preventDefault();\r\n\t\t\tthat.removeRow(newRow);\r\n\t\t};\r\n\r\n\t\tthis.refs.rowList.appendChild(newRow);\r\n\t}\r\n\r\n\tremoveRow(row) {\r\n\t\tif (this.refs.rowList.children.length <= 1) return;\r\n\r\n\t\trow.remove();\r\n\t\tthis.el.focus();\r\n\r\n\t\tif (this.refs.rowList.children.length < this.props.maxRows) {\r\n\t\t\tthis.refs.addButton.style.display = '';\r\n\t\t}\r\n\t}\r\n}\r\n","const dpdParcelshopShippingMethod = (function () {\n\tconst SHIPPING_TYPE_FIXED = 'fixed';\n\tconst SHIPPING_TYPE_PRODUCTS_WEIGHT_BASED = 'products_weight_based';\n\n\tlet shippingTypeSelect,\n\t\tfixedShippingTypes,\n\t\tproductsWeightBasedShippingTypes,\n\t\tproductsWeightLimitCheckbox,\n\t\tproductsWeightLimitShippingFields,\n\t\tproductsDimensionLimitCheckbox,\n\t\tproductsDimensionLimitShippingFields;\n\n\tfunction init() {\n\t\t// Shipping type fields\n\t\tshippingTypeSelect = document.querySelector('.js-dpd-shipping-type-select');\n\n\t\tif (shippingTypeSelect) {\n\t\t\tfixedShippingTypes = document.querySelectorAll(\n\t\t\t\t'.js-dpd-fixed-shipping-type'\n\t\t\t);\n\t\t\tproductsWeightBasedShippingTypes = document.querySelectorAll(\n\t\t\t\t'.js-dpd-weight-based-shipping-type'\n\t\t\t);\n\n\t\t\tshippingTypeSelect.addEventListener('change', updateShippingTypeFields);\n\t\t\tupdateShippingTypeFields();\n\t\t}\n\n\t\t// Products weight limit fields\n\t\tproductsWeightLimitCheckbox = document.querySelector(\n\t\t\t'.js-dpd-checkbox-weight-limit'\n\t\t);\n\n\t\tif (productsWeightLimitCheckbox) {\n\t\t\tproductsWeightLimitShippingFields = document.querySelectorAll(\n\t\t\t\t'.js-dpd-weight-limit-shipping-type'\n\t\t\t);\n\n\t\t\tproductsWeightLimitCheckbox.addEventListener(\n\t\t\t\t'change',\n\t\t\t\tupdateProductWeightLimitFields\n\t\t\t);\n\t\t\tupdateProductWeightLimitFields();\n\t\t}\n\n\t\t// Products dimension limit fields\n\t\tproductsDimensionLimitCheckbox = document.querySelector(\n\t\t\t'.js-dpd-checkbox-dimension-limit'\n\t\t);\n\n\t\tif (productsDimensionLimitCheckbox) {\n\t\t\tproductsDimensionLimitShippingFields = document.querySelectorAll(\n\t\t\t\t'.js-dpd-dimension-limit-shipping-type'\n\t\t\t);\n\n\t\t\tproductsDimensionLimitCheckbox.addEventListener(\n\t\t\t\t'change',\n\t\t\t\tupdateProductDimensionLimitFields\n\t\t\t);\n\t\t\tupdateProductDimensionLimitFields();\n\t\t}\n\t}\n\n\tfunction updateShippingTypeFields() {\n\t\tconst isFixed = shippingTypeSelect.value === SHIPPING_TYPE_FIXED;\n\t\ttoggleElements(fixedShippingTypes, isFixed);\n\t\ttoggleElements(productsWeightBasedShippingTypes, !isFixed);\n\t}\n\n\tfunction updateProductWeightLimitFields() {\n\t\ttoggleElements(\n\t\t\tproductsWeightLimitShippingFields,\n\t\t\tproductsWeightLimitCheckbox.checked\n\t\t);\n\t}\n\n\tfunction updateProductDimensionLimitFields() {\n\t\ttoggleElements(\n\t\t\tproductsDimensionLimitShippingFields,\n\t\t\tproductsDimensionLimitCheckbox.checked\n\t\t);\n\t}\n\n\tfunction toggleElements(elements, show) {\n\t\telements.forEach((el) => {\n\t\t\tconst parentFieldset = el.closest('fieldset');\n\t\t\tif (parentFieldset) {\n\t\t\t\tconst label = parentFieldset.previousElementSibling;\n\t\t\t\tif (label && label.tagName === 'LABEL') {\n\t\t\t\t\tlabel.style.display = show ? '' : 'none';\n\t\t\t\t}\n\t\t\t\tparentFieldset.style.display = show ? '' : 'none';\n\t\t\t}\n\t\t});\n\t}\n\n\treturn {\n\t\tinit: init,\n\t};\n})();\n\nexport default dpdParcelshopShippingMethod;\n","import { DpdExportRepeaterSettingsField } from './dpd-export-repeater-settings-field';\r\nimport dpdParcelshopShippingMethod from './dpd-parcelshop-shipping-method';\r\n\r\nwindow.DpdParcelshopShippingMethodWeightByPackageRepeater = class extends (\r\n\tDpdExportRepeaterSettingsField\r\n) {\r\n\tconstructor(el) {\r\n\t\tsuper(el);\r\n\t}\r\n\r\n\trenderRow(inputData = []) {\r\n\t\treturn `\r\n\t\t\t<li class=\"repeatable-field__row\">\r\n\t\t\t\t\t<div class=\"repeatable-field__row-wrap\">\r\n\t\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t\t\t<label for=\"${this.props.inputName}_min[]\">\r\n\t\t\t\t\t\t\t\t\t\t${'minWeightInputText' in this.props ? this.props.minWeightInputText : ''}\r\n\t\t\t\t\t\t\t\t\t</label>\r\n\r\n\t\t\t\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\t\t\t\t\tclass=\"repeatable-field__input form-field\"\r\n\t\t\t\t\t\t\t\t\t\t\tdata-ref=\"input-min\"\r\n\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\t\t\t\t\tmin=\"1\"\r\n\t\t\t\t\t\t\t\t\t\t\tname=\"${this.props.inputName}_min[]\"\r\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"${'min' in inputData ? inputData.min : ''}\"\r\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"${\r\n\t\t\t\t\t\t\t\t\t\t\t\t'minWeightInputPlaceholderText' in this.props\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t? this.props.minWeightInputPlaceholderText\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\r\n\t\t\t\t\t\t\t\t\t\t\t}\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</span>\r\n\r\n\t\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t\t\t<label for=\"${this.props.inputName}_max[]\">\r\n\t\t\t\t\t\t\t\t\t\t\t${'maxWeightInputText' in this.props ? this.props.maxWeightInputText : ''}\r\n\t\t\t\t\t\t\t\t\t</label>\r\n\r\n\t\t\t\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\t\t\t\t\tclass=\"repeatable-field__input form-field\"\r\n\t\t\t\t\t\t\t\t\t\t\tdata-ref=\"input-max\"\r\n\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\t\t\t\t\tmin=\"1\"\r\n\t\t\t\t\t\t\t\t\t\t\tname=\"${this.props.inputName}_max[]\"\r\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"${'max' in inputData ? inputData.max : ''}\"\r\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"${\r\n\t\t\t\t\t\t\t\t\t\t\t\t'maxWeightInputPlaceholderText' in this.props\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t? this.props.maxWeightInputPlaceholderText\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\r\n\t\t\t\t\t\t\t\t\t\t\t}\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</span>\r\n\r\n\t\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t\t\t<label for=\"${this.props.inputName}_price[]\">\r\n\t\t\t\t\t\t\t\t\t\t\t${'priceInputText' in this.props ? this.props.priceInputText : ''}\r\n\t\t\t\t\t\t\t\t\t</label>\r\n\r\n\t\t\t\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\t\t\t\t\tclass=\"repeatable-field__input form-field\"\r\n\t\t\t\t\t\t\t\t\t\t\tdata-ref=\"input-price\"\r\n\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\t\t\t\t\tmin=\"0\"\r\n\t\t\t\t\t\t\t\t\t\t\tname=\"${this.props.inputName}_price[]\"\r\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"${'price' in inputData ? inputData.price : ''}\"\r\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"${\r\n\t\t\t\t\t\t\t\t\t\t\t\t'priceInputPlaceholderText' in this.props\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t? this.props.priceInputPlaceholderText\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\r\n\t\t\t\t\t\t\t\t\t\t\t}\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</span>\r\n\r\n\r\n\t\t\t\t\t\t\t<button\r\n\t\t\t\t\t\t\t\t\tclass=\"repeatable-field__remove-button button\"\r\n\t\t\t\t\t\t\t\t\tdata-ref=\"removeButton\"\r\n\t\t\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t${this.props.removeLabel ?? 'Remove'}\r\n\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t</div>\r\n\t\t\t</li>\r\n\t\t`;\r\n\t}\r\n};\r\n\r\njQuery(document.body).on('wc_backbone_modal_loaded', function (evt, target) {\r\n\tif ('wc-modal-shipping-method-settings' === target) {\r\n\t\tdocument\r\n\t\t\t.querySelectorAll('[data-component=\"field-repeater\"]')\r\n\t\t\t.forEach((el) => {\r\n\t\t\t\tconst fieldRepeater =\r\n\t\t\t\t\tnew window.DpdParcelshopShippingMethodWeightByPackageRepeater(el);\r\n\t\t\t\tfieldRepeater.init();\r\n\t\t\t});\r\n\r\n\t\t// init shipping method scripts\r\n\t\tdpdParcelshopShippingMethod.init();\r\n\t}\r\n});\r\n"],"names":["DpdExportRepeaterSettingsField","el","_classCallCheck","this","props","getProps","refs","getRefs","inputsData","getInputsData","key","value","_this","length","forEach","inputData","addRow","addButton","onclick","e","preventDefault","result","_toConsumableArray","querySelectorAll","ref","dataset","JSON","parse","html","arguments","undefined","element","document","createElement","innerHTML","firstElementChild","that","newRow","createFromHTML","renderRow","removeButton","removeRow","rowList","appendChild","row","children","remove","focus","maxRows","style","display","shippingTypeSelect","fixedShippingTypes","productsWeightBasedShippingTypes","productsWeightLimitCheckbox","productsWeightLimitShippingFields","productsDimensionLimitCheckbox","productsDimensionLimitShippingFields","SHIPPING_TYPE_FIXED","updateShippingTypeFields","isFixed","toggleElements","updateProductWeightLimitFields","checked","updateProductDimensionLimitFields","elements","show","parentFieldset","closest","label","previousElementSibling","tagName","init","querySelector","addEventListener","window","DpdParcelshopShippingMethodWeightByPackageRepeater","_DpdExportRepeaterSet","_class","_callSuper","_inherits","_this$props$removeLab","concat","inputName","minWeightInputText","min","minWeightInputPlaceholderText","maxWeightInputText","max","maxWeightInputPlaceholderText","priceInputText","price","priceInputPlaceholderText","removeLabel","jQuery","body","on","evt","target","dpdParcelshopShippingMethod"],"sourceRoot":""}
  • wc-dpd/trunk/readme.txt

    r3116019 r3143150  
    44Donate link: https://platobnebrany.sk/
    55Requires at least: 5.3
    6 Tested up to: 6.5.5
     6Tested up to: 6.6.1
    77Requires PHP: 7.4
    8 Stable tag: 6.0.1
     8Stable tag: 7.0.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    6262
    6363== Changelog ==
     64
     65= 7.0.0 =
     66* Add ability to hide parcelshops from interactive map
    6467
    6568= 6.0.1 =
  • wc-dpd/trunk/templates/parcelshop-shipping-method-content.php

    r3115058 r3143150  
    2222$is_cod_required = isset($is_cod_required) ? (bool) $is_cod_required : false;
    2323$is_card_required = isset($is_card_required) ? (bool) $is_card_required : false;
     24$disallow_shops = isset($disallow_shops) ? (bool) $disallow_shops : false;
     25$disallow_lockers = isset($disallow_lockers) ? (bool) $disallow_lockers : false;
     26$disallow_dpd_pickup_stations = isset($disallow_dpd_pickup_stations) ? (bool) $disallow_dpd_pickup_stations : false;
     27$disallow_sk_post = isset($disallow_sk_post) ? (bool) $disallow_sk_post : false;
     28$disallow_alza_boxes = isset($disallow_alza_boxes) ? (bool) $disallow_alza_boxes : false;
    2429
    2530?>
     
    3540
    3641        <?php if (is_map_widget_enabled()): ?>
    37             <button type="button" class="js-dpd-parcelshop-map-widget-open-popup-btn dpd-parcelshop-shipping-method-content__open-btn" data-countries="<?php echo htmlspecialchars(json_encode($countries), ENT_QUOTES, 'UTF-8'); ?>" data-allowed-countries="<?php echo htmlspecialchars(json_encode($allowed_countries), ENT_QUOTES, 'UTF-8'); ?>" data-base-country-code="<?php echo $base_country_code; ?>" data-customer-zip="<?php echo $customer_zip; ?>" data-min-weight-in-kg="<?php echo $min_weight; ?>"  data-is-eligible-for-alzabox="<?php echo $is_eligible_for_alzabox ? 'true' : 'false'; ?>" data-is-eligible-for-slovenska-posta-box="<?php echo $is_eligible_for_slovenska_posta_box ? 'true' : 'false'; ?>" data-is-cod-required="<?php echo $is_cod_required ? 'true' : 'false'; ?>" data-is-card-payment-required="<?php echo $is_card_required ? 'true' : 'false'; ?>"><?php echo __('Choose parcelshop', 'wc-dpd'); ?></button>
     42            <button type="button" class="js-dpd-parcelshop-map-widget-open-popup-btn dpd-parcelshop-shipping-method-content__open-btn"
     43                data-countries="<?php echo htmlspecialchars(json_encode($countries), ENT_QUOTES, 'UTF-8'); ?>"
     44                data-allowed-countries="<?php echo htmlspecialchars(json_encode($allowed_countries), ENT_QUOTES, 'UTF-8'); ?>"
     45                data-base-country-code="<?php echo $base_country_code; ?>"
     46                data-customer-zip="<?php echo $customer_zip; ?>"
     47                data-min-weight-in-kg="<?php echo $min_weight; ?>"
     48                data-is-eligible-for-alzabox="<?php echo $is_eligible_for_alzabox ? 'true' : 'false'; ?>"
     49                data-is-eligible-for-slovenska-posta-box="<?php echo $is_eligible_for_slovenska_posta_box ? 'true' : 'false'; ?>"
     50                data-is-cod-required="<?php echo $is_cod_required ? 'true' : 'false'; ?>"
     51                data-is-card-payment-required="<?php echo $is_card_required ? 'true' : 'false'; ?>"
     52                data-disallow-shops="<?php echo $disallow_shops ? 'true' : 'false'; ?>"
     53                data-disallow-lockers="<?php echo $disallow_lockers ? 'true' : 'false'; ?>"
     54                data-disallow-dpd-pickup-stations="<?php echo $disallow_dpd_pickup_stations ? 'true' : 'false'; ?>"
     55                data-disallow-sk-post="<?php echo $disallow_sk_post ? 'true' : 'false'; ?>"
     56                data-disallow-alza-boxes="<?php echo $disallow_alza_boxes ? 'true' : 'false'; ?>"
     57            ><?php echo __('Choose parcelshop', 'wc-dpd'); ?></button>
    3858        <?php else: ?>
    3959            <button type="button" class="js-dpd-parcelshop-open-popup-btn dpd-parcelshop-shipping-method-content__open-btn"><?php echo __('Choose parcelshop', 'wc-dpd'); ?></button>
  • wc-dpd/trunk/wc-dpd.php

    r3116019 r3143150  
    44 * Plugin Name: DPD SK for WooCommerce
    55 * Description: DPD SK plugin for WooCommerce which exports orders to the DPD through their API
    6  * Version: 6.0.1
     6 * Version: 7.0.0
    77 * Author: Webikon
    88 * Author URI: https://www.webikon.sk
     
    1111 * Text Domain: wc-dpd
    1212 * Requires at least: 5.3
    13  * Tested up to: 6.5.5
     13 * Tested up to: 6.6.1
    1414 * Requires PHP: 7.4
    1515 * WC requires at least: 7.0
    16  * WC tested up to: 9.0.2
     16 * WC tested up to: 9.2.3
    1717 */
    1818
Note: See TracChangeset for help on using the changeset viewer.