Plugin Directory

Changeset 3160499


Ignore:
Timestamp:
10/01/2024 10:03:10 AM (18 months ago)
Author:
dhlparcel
Message:

Release 2.1.8

  • Updated tested up to version
  • Fixed an issue where ISO codes in postalcode would prevent label creation. Applies to Czechia, Denmark, Latvia and Slovakia
Location:
dhlpwc
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • dhlpwc/tags/2.1.8/README.md

    r3141567 r3160499  
    11# DHL eCommerce (Benelux) for WooCommerce
     2 
     3v2.1.8
     4## Changes
     5- Updated tested up to version
     6- Fixed an issue where ISO codes in postalcode would prevent label creation. Applies to Czechia, Denmark, Latvia and Slovakia
    27 
    38v2.1.7
  • dhlpwc/tags/2.1.8/build/view.asset.php

    r3073094 r3160499  
    1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '4a7f4d2ae5633fc55727');
     1<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'eeeebb5fff6cc243195d');
  • dhlpwc/tags/2.1.8/build/view.js

    r3073094 r3160499  
    188188  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    189189    const script = document.createElement('script');
    190     script.src = 'https://static.dhlparcel.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js';
     190    script.src = 'https://static.dhlecommerce.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js';
    191191    script.async = true;
    192192    script.onload = () => loadModal();
     
    512512  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    513513    // Track selected shipping method
    514     const shippingMethods = document.getElementsByClassName("wc-block-components-form wc-block-checkout__form")[0]['radio-control-0'];
    515     if (shippingMethods) {
    516       shippingMethods.forEach(element => {
    517         element.addEventListener('change', event => {
    518           setSelectedShippingMethod(event.target.value);
    519         });
    520       });
    521     }
     514    document.addEventListener("change", trackSelectedShippingMethod);
     515    function trackSelectedShippingMethod(event) {
     516      let element = event.target;
     517      if (element.name === 'radio-control-0') {
     518        setSelectedShippingMethod(event.target.value);
     519      }
     520    }
     521
     522    /**
     523     * Create observer for when shipping methods fundamentally change (WooCommerce does not call the Change method)
     524     * We observe the parent of the radio buttons. When a shipping methods gets added or removed, we update the selectedShippingMethod
     525     */
     526    const observer = new MutationObserver(mutationList => {
     527      for (const mutation of mutationList) {
     528        if (mutation.type === "childList") {
     529          setSelectedShippingMethod(document.getElementsByName('radio-control-0')[0].value);
     530        }
     531      }
     532    });
     533    observer.observe(document.getElementsByName('radio-control-0')[0].parentElement.parentElement, {
     534      childList: true
     535    });
    522536
    523537    // TODO find a better method to retrieve address data instead of observing requests
  • dhlpwc/tags/2.1.8/build/view.js.map

    r3073094 r3160499  
    1 {"version":3,"file":"view.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAwD;AACnB;AACiB;AAE/C,MAAMI,aAAa,GAAIC,KAAK,IAAK;EACpC,IAAI,CAACC,MAAM,CAACC,iBAAiB,CAACC,qBAAqB,EAAE;IACjD,OAAO,EAAE;EACb;EAEA,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,kCAAkC,EAClC,mCAAmC,CACtC;EACD,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGX,4DAAQ,CAAC,CAAC,CAAC,CAAC;EACtD,MAAM,CAACY,YAAY,EAAEC,eAAe,CAAC,GAAGb,4DAAQ,CAAC,EAAE,CAAC;EAEpDC,6DAAS,CAAC,MAAM;IACZ,MAAMa,mBAAmB,GAAGC,QAAQ,CAACC,cAAc,CAAC,8CAA8C,CAAC;IACnG,IAAIP,2BAA2B,CAACQ,OAAO,CAACZ,KAAK,CAACa,sBAAsB,CAAC,KAAK,CAAC,CAAC,EAAE;MAC1EJ,mBAAmB,CAACK,KAAK,CAACC,OAAO,GAAG,OAAO;MAC3C;MACA,MAAMC,QAAQ,GAAG,IAAI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AC1C,CAAC,EACFvD,oDAAA,CAACQ,8CAAO;IACJjC,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA;EAAuB,CAClD,CACA,CAAC;AACV,CAAC,C","sources":["webpack://copyright-date-block/./src/delivery-times.js","webpack://copyright-date-block/./src/same-day.js","webpack://copyright-date-block/./src/servicepoints.js","webpack://copyright-date-block/external window \"React\"","webpack://copyright-date-block/external window [\"wp\",\"components\"]","webpack://copyright-date-block/external window [\"wp\",\"data\"]","webpack://copyright-date-block/external window [\"wp\",\"domReady\"]","webpack://copyright-date-block/external window [\"wp\",\"element\"]","webpack://copyright-date-block/external window [\"wp\",\"i18n\"]","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/view.js"],"sourcesContent":["import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\n\nexport const DeliveryTimes = (props) => {\n    if (!window.dhlpwc_block_data.deliverytimes_enabled) {\n        return ''\n    }\n\n    const deliveryTimeShippingMethods = [\n        'dhlpwc-home',\n        'dhlpwc-home-evening',\n        'dhlpwc-home-next-day',\n        'dhlpwc-home-no-neighbour',\n        'dhlpwc-home-no-neighbour-evening',\n        'dhlpwc-home-no-neighbour-next-day',\n    ]\n    const [deliveryTimes, setDeliveryTimes] = useState({});\n    const [selectedTime, setSelectedTime] = useState([]);\n\n    useEffect(() => {\n        const deliveryTimeDetails = document.getElementById('dhlpwc-shipping-method-delivery-times-option')\n        if (deliveryTimeShippingMethods.indexOf(props.selectedShippingMethod) !== -1) {\n            deliveryTimeDetails.style.display = \"block\";\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_delivery_times')\n            formData.append('shipping_method', props.selectedShippingMethod)\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n                let parsedDeliveryTimes = [];\n\n                Object.values(response.data).forEach((value) => {\n                    const parsedDeliveryTime = {\n                        label: `${value.date} (${value.start_time} - ${value.end_time})`,\n                        value: value.identifier\n                    }\n                    parsedDeliveryTimes.push(parsedDeliveryTime)\n                })\n                setDeliveryTimes(parsedDeliveryTimes)\n                // initially set the first selection\n                setSelectedTime(parsedDeliveryTimes[0].value.split('___'))\n            })\n        } else {\n            deliveryTimeDetails.style.display = \"none\"\n            setSelectedTime([])\n        }\n    }, [props.postalCode, props.countryCode, props.selectedShippingMethod])\n\n    useEffect(() => {\n        // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n        const formData = new FormData();\n        formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n        formData.append('selected', true)\n        formData.append('date', selectedTime[0] ?? '')\n        formData.append('start_time', selectedTime[1] ?? '')\n        formData.append('end_time', selectedTime[2] ?? '')\n\n        fetch(\n            window.dhlpwc_block_data['ajax_url'],\n            {\n                method: 'POST',\n                body: formData\n            }\n        )\n    }, [selectedTime])\n\n    return <div id='dhlpwc-shipping-method-delivery-times-option'\n                className='dhlpwc-shipping-method-delivery-times-option'>\n        <div className=\"dhlpwc-delivery-times-selection-header\">{__('DHL Delivery Times options')}</div>\n        <span className=\"dhlpwc-delivery-times-selection-text\">{__('Desired delivery moment:')}</span>\n        <SelectControl\n            hideLabelFromVision='true'\n            className='dhlpwc-delivery-times-selection-input'\n            label={__('Select desired delivery moment')}\n            value={selectedTime.join('___')}\n            options={deliveryTimes}\n            onChange={(deliveryTime) => setSelectedTime(deliveryTime.split('___'))}\n        />\n    </div>\n};\n","import { useEffect } from '@wordpress/element'\n\nexport const SameDay = (props) => {\n    if (window.dhlpwc_block_data.sdd_as_time_window) {\n        const sameDayElement = document.getElementById('radio-control-0-dhlpwc-home-same-day');\n        if (sameDayElement) {\n            sameDayElement.parentElement.style.display = \"none\";\n        }\n\n        const sameDayNoNeighborElement = document.getElementById('radio-control-0-dhlpwc-home-no-neighbour-same-day');\n        if (sameDayNoNeighborElement) {\n            sameDayNoNeighborElement.parentElement.style.display = \"none\";\n        }\n    }\n\n    const sameDayDeliveryMethods = [\n        'dhlpwc-home-same-day',\n        'dhlpwc-home-no-neighbour-same-day'\n    ]\n\n    useEffect(() => {\n        if (sameDayDeliveryMethods.indexOf(props.selectedShippingMethod) !== -1) {\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_delivery_times')\n            formData.append('shipping_method', props.selectedShippingMethod)\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n                const sameDayDeliveryTime = response.data[0]['identifier'].split('___')\n                const formData = new FormData();\n                formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n                formData.append('selected', true)\n                formData.append('date', sameDayDeliveryTime[0] ?? '')\n                formData.append('start_time', sameDayDeliveryTime[1] ?? '')\n                formData.append('end_time', sameDayDeliveryTime[2] ?? '')\n\n                fetch(\n                    window.dhlpwc_block_data['ajax_url'],\n                    {\n                        method: 'POST',\n                        body: formData\n                    }\n                )\n            })\n        }\n    }, [props.postalCode, props.countryCode, props.selectedShippingMethod]);\n};\n","import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\nexport const Servicepoints = (props) => {\n    const VALIDATION_ERROR_PARCELSHOP_EMPTY = 'validation-error-parcelshop-empty'\n    const getValidationError = useSelect((select) => {\n        const store = select('wc/store/validation');\n\n        return store.getValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n    });\n    const [parcelshop, setParcelshop] = useState({})\n\n    // Only run this once, intentionally no dependencies given\n    useEffect(() => {\n        const script = document.createElement('script')\n        script.src = 'https://static.dhlparcel.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js'\n        script.async = true\n        script.onload = () => loadModal()\n\n        document.body.appendChild(script)\n    }, [])\n\n    const loadModal = () => {\n        var options = {\n            language: window.dhlpwc_block_data['language'],\n            country: window.dhlpwc_block_data['country_code'] ?? '',\n            limit: window.dhlpwc_block_data['limit'],\n            googleMapsApiKey: window.dhlpwc_block_data['google_maps_key'],\n            header: false,\n            resizable: true,\n            onSelect: (parcelshop) => {\n                setParcelshop(parcelshop)\n            },\n            filter: {\n                serviceType: 'pick-up'\n            }\n        }\n\n        window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(document.getElementById('dhl-servicepoint-locator-component'), options)\n\n        // Hide the parcelshop element when parcelshop is not selected\n        const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n        if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n            parcelshopDetails.style.display = 'block'\n        } else {\n            parcelshopDetails.style.display = 'none'\n        }\n\n        // Hide the modal when clicking the X button\n        document.getElementById('dhlpwc-modal-close').onclick = () => {\n            document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n        }\n\n        // Set background image dynamically\n        document.getElementById('dhlpwc-modal-content').style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'\n    }\n\n    /**\n     * Set the initial parcelshop based on postalCode or countryCode\n     */\n    useEffect(() => {\n        const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n        if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n            parcelshopDetails.style.display = 'block'\n\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_initial_parcelshop')\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n\n                if (response.data?.parcelshop) {\n                    setParcelshop(response.data.parcelshop)\n                } else {\n                    setParcelshop({})\n                }\n            })\n        } else {\n            parcelshopDetails.style.display = 'none'\n            setParcelshop({})\n        }\n    }, [props.postalCode, props.selectedShippingMethod])\n\n    const { setValidationErrors, clearValidationError } = useDispatch(\n        'wc/store/validation'\n    );\n\n    /**\n     * Sync the parcelshop (or lack of) with frontend elements and the backend\n     *\n     * @param parcelshop\n     */\n    useEffect( () => {\n        document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n\n        // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n        const formData = new FormData();\n        formData.append('action', 'dhlpwc_parcelshop_selection_sync')\n        if (Object.keys(parcelshop).length !== 0 || props.selectedShippingMethod !== 'dhlpwc-parcelshop') {\n            props.setValidationClass('dhlpwc_notice')\n            formData.append('parcelshop_id', parcelshop['id'] ?? '')\n            formData.append('country_code', props.countryCode)\n            if ( getValidationError ) {\n                clearValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n            }\n        } else {\n            props.setValidationClass('dhlpwc-servicepoint-error')\n            setValidationErrors( {\n                [ VALIDATION_ERROR_PARCELSHOP_EMPTY ]: {\n                    message: __( 'Please add some text', 'shipping-workshop' ),\n                    hidden: true,\n                },\n            } );\n        }\n\n        fetch(\n            window.dhlpwc_block_data['ajax_url'],\n            {\n                method: 'POST',\n                body: formData\n            }\n        )\n    }, [parcelshop]);\n\n    /**\n     * Show the parcelshop selector\n     */\n    const showModal = () => {\n        if (props.postalCode === '') {\n            document.getElementById('shipping-postcode').value\n        }\n\n        const modal = document.getElementById('dhlpwc-servicepoint-modal')\n        modal.style.display = 'block'\n\n        if (typeof window.dhlparcel_shipping_servicepoint_locator !== 'undefined') {\n            window.dhlparcel_shipping_servicepoint_locator.setCountry(props.countryCode)\n            window.dhlparcel_shipping_servicepoint_locator.setQuery(props.postalCode)\n        }\n    }\n\n    return <div id='dhlpwc-shipping-method-parcelshop-option' className='dhlpwc-shipping-method-parcelshop-option'>\n        <span className=\"dhlpwc-parcelshop-selection-text\">{__('The following ServicePoint is selected:')}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop.name ?? __('⚠ No location selected.')}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.postal_code} {parcelshop?.address?.city}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.street} {parcelshop?.address?.number} {parcelshop?.address?.addition}</span>\n\n        <input type='button' className='dhlpwc-parcelshop-option-change' value='Change' onClick={() => showModal()}/>\n    </div>\n};\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"domReady\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import domReady from '@wordpress/dom-ready'\nimport { render, useEffect } from '@wordpress/element'\nimport { Servicepoints } from \"./servicepoints\";\nimport { DeliveryTimes } from \"./delivery-times\";\nimport { SameDay } from \"./same-day\";\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element'\n\ndomReady(async function () {\n    const getElementByIdAsync = id => new Promise(resolve => {\n        const getElement = () => {\n            const element = document.getElementById(id)\n            if(element) {\n                resolve(element)\n            } else {\n                requestAnimationFrame(getElement)\n            }\n        };\n        getElement()\n    });\n\n    const container = await getElementByIdAsync('dhlpwc-app')\n    render(<App/>, container)\n})\n\nexport const App = () => {\n    const [postalCode, setPostalCode] = useState(window.dhlpwc_block_data['postal_code'])\n    const [countryCode, setCountryCode] = useState(window.dhlpwc_block_data['country_code'])\n    const [selectedShippingMethod, setSelectedShippingMethod] = useState(window.dhlpwc_block_data['initial_shipping_method'])\n    const [validationClass, setValidationClass] = useState('dhlpwc_warning')\n\n    // Only run this once, intentionally no dependencies given\n    useEffect(()=>{\n        // Track selected shipping method\n        const shippingMethods = document.getElementsByClassName(\"wc-block-components-form wc-block-checkout__form\")[0]['radio-control-0'];\n        if (shippingMethods) {\n            shippingMethods.forEach((element) => {\n                element.addEventListener('change', (event) => {\n                    setSelectedShippingMethod(event.target.value)\n                })\n            })\n        }\n\n        // TODO find a better method to retrieve address data instead of observing requests\n        const nativeFetch = window.fetch;\n        window.fetch = function(...args) {\n            let isWantedCall = false;\n            const urlParams = new URLSearchParams(args[0]);\n            urlParams.forEach(function (param) {\n                if (isWantedCall) {\n                    return;\n                }\n\n                if (param.includes('batch')) {\n                    isWantedCall = true;\n                }\n            });\n\n            if (!isWantedCall) {\n                return nativeFetch.apply(window, args);\n            }\n\n            JSON.parse(args[1].body).requests.forEach((request) => {\n                if (request.path.includes('update-customer')) {\n                    if (typeof request.body.shipping_address.country !== 'undefined') {\n                        setCountryCode(request.body.shipping_address.country);\n                    }\n\n                    if (typeof request.body.shipping_address.postcode !== 'undefined') {\n                        setPostalCode(request.body.shipping_address.postcode);\n                    }\n                }\n            })\n\n            return nativeFetch.apply(window, args);\n        }\n    }, [])\n\n    const deliveryTimeShippingMethods = [\n        'dhlpwc-parcelshop',\n        'dhlpwc-home',\n        'dhlpwc-home-evening',\n        'dhlpwc-home-next-day',\n        'dhlpwc-home-no-neighbour',\n        'dhlpwc-home-no-neighbour-evening',\n        'dhlpwc-home-no-neighbour-next-day',\n    ]\n\n    useEffect(() => {\n        if (deliveryTimeShippingMethods.indexOf(selectedShippingMethod) !== -1) {\n            document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"block\"\n        } else {\n            document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"none\"\n        }\n    }, [selectedShippingMethod]);\n\n    return <div id='dhlpwc-shipping-method-delivery-options' className='dhlpwc-shipping-method-delivery-options'>\n        <div className=\"dhlpwc-delivery-options-header\">{__('DHL Delivery options')}</div>\n        <DeliveryTimes\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n        />\n        <Servicepoints\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n            validationClass={validationClass}\n            setValidationClass={setValidationClass}\n        />\n        <SameDay\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n        />\n    </div>\n}\n"],"names":["useState","useEffect","__","SelectControl","DeliveryTimes","props","window","dhlpwc_block_data","deliverytimes_enabled","deliveryTimeShippingMethods","deliveryTimes","setDeliveryTimes","selectedTime","setSelectedTime","deliveryTimeDetails","document","getElementById","indexOf","selectedShippingMethod","style","display","formData","FormData","append","postalCode","countryCode","fetch","method","body","then","response","json","parsedDeliveryTimes","Object","values","data","forEach","value","parsedDeliveryTime","label","date","start_time","end_time","identifier","push","split","_selectedTime$","_selectedTime$2","_selectedTime$3","createElement","id","className","hideLabelFromVision","join","options","onChange","deliveryTime","SameDay","sdd_as_time_window","sameDayElement","parentElement","sameDayNoNeighborElement","sameDayDeliveryMethods","_sameDayDeliveryTime$","_sameDayDeliveryTime$2","_sameDayDeliveryTime$3","sameDayDeliveryTime","useDispatch","useSelect","Servicepoints","_parcelshop$name","VALIDATION_ERROR_PARCELSHOP_EMPTY","getValidationError","select","store","parcelshop","setParcelshop","script","src","async","onload","loadModal","appendChild","_window$dhlpwc_block_","language","country","limit","googleMapsApiKey","header","resizable","onSelect","filter","serviceType","dhlparcel_shipping_servicepoint_locator","dhl","servicepoint","Locator","parcelshopDetails","onclick","setValidationErrors","clearValidationError","keys","length","_parcelshop$id","setValidationClass","message","hidden","showModal","modal","setCountry","setQuery","validationClass","name","address","postal_code","city","street","number","addition","type","onClick","domReady","render","getElementByIdAsync","Promise","resolve","getElement","element","requestAnimationFrame","container","App","setPostalCode","setCountryCode","setSelectedShippingMethod","shippingMethods","getElementsByClassName","addEventListener","event","target","nativeFetch","args","isWantedCall","urlParams","URLSearchParams","param","includes","apply","JSON","parse","requests","request","path","shipping_address","postcode"],"sourceRoot":""}
     1{"version":3,"file":"view.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAwD;AACnB;AACiB;AAE/C,MAAMI,aAAa,GAAIC,KAAK,IAAK;EACpC,IAAI,CAACC,MAAM,CAACC,iBAAiB,CAACC,qBAAqB,EAAE;IACjD,OAAO,EAAE;EACb;EAEA,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,kCAAkC,EACl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sBAAsB,EACtB,0BAA0B,EAC1B,kCAAkC,EAClC,mCAAmC,CACtC;EAEDR,6DAAS,CAAC,MAAM;IACZ,IAAIQ,2BAA2B,CAACQ,OAAO,CAACC,sBAAsB,CAAC,KAAK,CAAC,CAAC,EAAE;MACpEH,QAAQ,CAACC,cAAc,CAAC,yCAAyC,CAAC,CAACG,KAAK,CAACC,OAAO,GAAG,OAAO;IAC9F,CAAC,MAAM;MACHL,QAAQ,CAACC,cAAc,CAAC,yCAAyC,CAAC,CAACG,KAAK,CAACC,OAAO,GAAG,MAAM;IAC7F;EACJ,CAAC,EAAE,CAACF,sBAAsB,CAAC,CAAC;EAE5B,OAAO+B,oDAAA;IAAKC,EAAE,EAAC,yCAAyC;IAACC,SAAS,EAAC;EAAyC,GACxGF,oDAAA;IAAKE,SAAS,EAAC;EAAgC,GAAEjD,mDAAE,CAAC,sBAAsB,CAAO,CAAC,EAClF+C,oDAAA,CAAC7C,0DAAa;IACVoB,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA;EAAuB,CAClD,CAAC,EACF+B,oDAAA,CAACoB,yDAAa;IACV7C,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA,sBAAuB;IAC/C6F,eAAe,EAAEA,eAAgB;IACjCP,kBAAkB,EAAEA;EAAmB,CAC1C,CAAC,EACFvD,oDAAA,CAACQ,8CAAO;IACJjC,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA;EAAuB,CAClD,CACA,CAAC;AACV,CAAC,C","sources":["webpack://copyright-date-block/./src/delivery-times.js","webpack://copyright-date-block/./src/same-day.js","webpack://copyright-date-block/./src/servicepoints.js","webpack://copyright-date-block/external window \"React\"","webpack://copyright-date-block/external window [\"wp\",\"components\"]","webpack://copyright-date-block/external window [\"wp\",\"data\"]","webpack://copyright-date-block/external window [\"wp\",\"domReady\"]","webpack://copyright-date-block/external window [\"wp\",\"element\"]","webpack://copyright-date-block/external window [\"wp\",\"i18n\"]","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/view.js"],"sourcesContent":["import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\n\nexport const DeliveryTimes = (props) => {\n    if (!window.dhlpwc_block_data.deliverytimes_enabled) {\n        return ''\n    }\n\n    const deliveryTimeShippingMethods = [\n        'dhlpwc-home',\n        'dhlpwc-home-evening',\n        'dhlpwc-home-next-day',\n        'dhlpwc-home-no-neighbour',\n        'dhlpwc-home-no-neighbour-evening',\n        'dhlpwc-home-no-neighbour-next-day',\n    ]\n    const [deliveryTimes, setDeliveryTimes] = useState({});\n    const [selectedTime, setSelectedTime] = useState([]);\n\n    useEffect(() => {\n        const deliveryTimeDetails = document.getElementById('dhlpwc-shipping-method-delivery-times-option')\n        if (deliveryTimeShippingMethods.indexOf(props.selectedShippingMethod) !== -1) {\n            deliveryTimeDetails.style.display = \"block\";\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_delivery_times')\n            formData.append('shipping_method', props.selectedShippingMethod)\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n                let parsedDeliveryTimes = [];\n\n                Object.values(response.data).forEach((value) => {\n                    const parsedDeliveryTime = {\n                        label: `${value.date} (${value.start_time} - ${value.end_time})`,\n                        value: value.identifier\n                    }\n                    parsedDeliveryTimes.push(parsedDeliveryTime)\n                })\n                setDeliveryTimes(parsedDeliveryTimes)\n                // initially set the first selection\n                setSelectedTime(parsedDeliveryTimes[0].value.split('___'))\n            })\n        } else {\n            deliveryTimeDetails.style.display = \"none\"\n            setSelectedTime([])\n        }\n    }, [props.postalCode, props.countryCode, props.selectedShippingMethod])\n\n    useEffect(() => {\n        // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n        const formData = new FormData();\n        formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n        formData.append('selected', true)\n        formData.append('date', selectedTime[0] ?? '')\n        formData.append('start_time', selectedTime[1] ?? '')\n        formData.append('end_time', selectedTime[2] ?? '')\n\n        fetch(\n            window.dhlpwc_block_data['ajax_url'],\n            {\n                method: 'POST',\n                body: formData\n            }\n        )\n    }, [selectedTime])\n\n    return <div id='dhlpwc-shipping-method-delivery-times-option'\n                className='dhlpwc-shipping-method-delivery-times-option'>\n        <div className=\"dhlpwc-delivery-times-selection-header\">{__('DHL Delivery Times options')}</div>\n        <span className=\"dhlpwc-delivery-times-selection-text\">{__('Desired delivery moment:')}</span>\n        <SelectControl\n            hideLabelFromVision='true'\n            className='dhlpwc-delivery-times-selection-input'\n            label={__('Select desired delivery moment')}\n            value={selectedTime.join('___')}\n            options={deliveryTimes}\n            onChange={(deliveryTime) => setSelectedTime(deliveryTime.split('___'))}\n        />\n    </div>\n};\n","import { useEffect } from '@wordpress/element'\n\nexport const SameDay = (props) => {\n    if (window.dhlpwc_block_data.sdd_as_time_window) {\n        const sameDayElement = document.getElementById('radio-control-0-dhlpwc-home-same-day');\n        if (sameDayElement) {\n            sameDayElement.parentElement.style.display = \"none\";\n        }\n\n        const sameDayNoNeighborElement = document.getElementById('radio-control-0-dhlpwc-home-no-neighbour-same-day');\n        if (sameDayNoNeighborElement) {\n            sameDayNoNeighborElement.parentElement.style.display = \"none\";\n        }\n    }\n\n    const sameDayDeliveryMethods = [\n        'dhlpwc-home-same-day',\n        'dhlpwc-home-no-neighbour-same-day'\n    ]\n\n    useEffect(() => {\n        if (sameDayDeliveryMethods.indexOf(props.selectedShippingMethod) !== -1) {\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_delivery_times')\n            formData.append('shipping_method', props.selectedShippingMethod)\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n                const sameDayDeliveryTime = response.data[0]['identifier'].split('___')\n                const formData = new FormData();\n                formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n                formData.append('selected', true)\n                formData.append('date', sameDayDeliveryTime[0] ?? '')\n                formData.append('start_time', sameDayDeliveryTime[1] ?? '')\n                formData.append('end_time', sameDayDeliveryTime[2] ?? '')\n\n                fetch(\n                    window.dhlpwc_block_data['ajax_url'],\n                    {\n                        method: 'POST',\n                        body: formData\n                    }\n                )\n            })\n        }\n    }, [props.postalCode, props.countryCode, props.selectedShippingMethod]);\n};\n","import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\nexport const Servicepoints = (props) => {\n    const VALIDATION_ERROR_PARCELSHOP_EMPTY = 'validation-error-parcelshop-empty'\n    const getValidationError = useSelect((select) => {\n        const store = select('wc/store/validation');\n\n        return store.getValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n    });\n    const [parcelshop, setParcelshop] = useState({})\n\n    // Only run this once, intentionally no dependencies given\n    useEffect(() => {\n        const script = document.createElement('script')\n        script.src = 'https://static.dhlecommerce.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js'\n        script.async = true\n        script.onload = () => loadModal()\n\n        document.body.appendChild(script)\n    }, [])\n\n    const loadModal = () => {\n        var options = {\n            language: window.dhlpwc_block_data['language'],\n            country: window.dhlpwc_block_data['country_code'] ?? '',\n            limit: window.dhlpwc_block_data['limit'],\n            googleMapsApiKey: window.dhlpwc_block_data['google_maps_key'],\n            header: false,\n            resizable: true,\n            onSelect: (parcelshop) => {\n                setParcelshop(parcelshop)\n            },\n            filter: {\n                serviceType: 'pick-up'\n            }\n        }\n\n        window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(document.getElementById('dhl-servicepoint-locator-component'), options)\n\n        // Hide the parcelshop element when parcelshop is not selected\n        const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n        if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n            parcelshopDetails.style.display = 'block'\n        } else {\n            parcelshopDetails.style.display = 'none'\n        }\n\n        // Hide the modal when clicking the X button\n        document.getElementById('dhlpwc-modal-close').onclick = () => {\n            document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n        }\n\n        // Set background image dynamically\n        document.getElementById('dhlpwc-modal-content').style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'\n    }\n\n    /**\n     * Set the initial parcelshop based on postalCode or countryCode\n     */\n    useEffect(() => {\n        const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n        if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n            parcelshopDetails.style.display = 'block'\n\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_initial_parcelshop')\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n\n                if (response.data?.parcelshop) {\n                    setParcelshop(response.data.parcelshop)\n                } else {\n                    setParcelshop({})\n                }\n            })\n        } else {\n            parcelshopDetails.style.display = 'none'\n            setParcelshop({})\n        }\n    }, [props.postalCode, props.selectedShippingMethod])\n\n    const { setValidationErrors, clearValidationError } = useDispatch(\n        'wc/store/validation'\n    );\n\n    /**\n     * Sync the parcelshop (or lack of) with frontend elements and the backend\n     *\n     * @param parcelshop\n     */\n    useEffect( () => {\n        document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n\n        // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n        const formData = new FormData();\n        formData.append('action', 'dhlpwc_parcelshop_selection_sync')\n        if (Object.keys(parcelshop).length !== 0 || props.selectedShippingMethod !== 'dhlpwc-parcelshop') {\n            props.setValidationClass('dhlpwc_notice')\n            formData.append('parcelshop_id', parcelshop['id'] ?? '')\n            formData.append('country_code', props.countryCode)\n            if ( getValidationError ) {\n                clearValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n            }\n        } else {\n            props.setValidationClass('dhlpwc-servicepoint-error')\n            setValidationErrors( {\n                [ VALIDATION_ERROR_PARCELSHOP_EMPTY ]: {\n                    message: __( 'Please add some text', 'shipping-workshop' ),\n                    hidden: true,\n                },\n            } );\n        }\n\n        fetch(\n            window.dhlpwc_block_data['ajax_url'],\n            {\n                method: 'POST',\n                body: formData\n            }\n        )\n    }, [parcelshop]);\n\n    /**\n     * Show the parcelshop selector\n     */\n    const showModal = () => {\n        if (props.postalCode === '') {\n            document.getElementById('shipping-postcode').value\n        }\n\n        const modal = document.getElementById('dhlpwc-servicepoint-modal')\n        modal.style.display = 'block'\n\n        if (typeof window.dhlparcel_shipping_servicepoint_locator !== 'undefined') {\n            window.dhlparcel_shipping_servicepoint_locator.setCountry(props.countryCode)\n            window.dhlparcel_shipping_servicepoint_locator.setQuery(props.postalCode)\n        }\n    }\n\n    return <div id='dhlpwc-shipping-method-parcelshop-option' className='dhlpwc-shipping-method-parcelshop-option'>\n        <span className=\"dhlpwc-parcelshop-selection-text\">{__('The following ServicePoint is selected:')}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop.name ?? __('⚠ No location selected.')}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.postal_code} {parcelshop?.address?.city}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.street} {parcelshop?.address?.number} {parcelshop?.address?.addition}</span>\n\n        <input type='button' className='dhlpwc-parcelshop-option-change' value='Change' onClick={() => showModal()}/>\n    </div>\n};\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"domReady\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import domReady from '@wordpress/dom-ready'\nimport { render, useEffect } from '@wordpress/element'\nimport { Servicepoints } from \"./servicepoints\";\nimport { DeliveryTimes } from \"./delivery-times\";\nimport { SameDay } from \"./same-day\";\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element'\n\ndomReady(async function () {\n    const getElementByIdAsync = id => new Promise(resolve => {\n        const getElement = () => {\n            const element = document.getElementById(id)\n            if(element) {\n                resolve(element)\n            } else {\n                requestAnimationFrame(getElement)\n            }\n        };\n        getElement()\n    });\n\n    const container = await getElementByIdAsync('dhlpwc-app')\n    render(<App/>, container)\n})\n\nexport const App = () => {\n    const [postalCode, setPostalCode] = useState(window.dhlpwc_block_data['postal_code'])\n    const [countryCode, setCountryCode] = useState(window.dhlpwc_block_data['country_code'])\n    const [selectedShippingMethod, setSelectedShippingMethod] = useState(window.dhlpwc_block_data['initial_shipping_method'])\n    const [validationClass, setValidationClass] = useState('dhlpwc_warning')\n\n    // Only run this once, intentionally no dependencies given\n    useEffect(()=>{\n\n        // Track selected shipping method\n        document.addEventListener( \"change\", trackSelectedShippingMethod );\n        function trackSelectedShippingMethod(event){\n            let element = event.target;\n            if (element.name === 'radio-control-0') {\n                setSelectedShippingMethod(event.target.value)\n            }\n        }\n\n        /**\n         * Create observer for when shipping methods fundamentally change (WooCommerce does not call the Change method)\n         * We observe the parent of the radio buttons. When a shipping methods gets added or removed, we update the selectedShippingMethod\n         */\n        const observer = new MutationObserver((mutationList) => {\n            for (const mutation of mutationList) {\n                if (mutation.type === \"childList\") {\n                    setSelectedShippingMethod(document.getElementsByName('radio-control-0')[0].value)\n                }\n            }\n        });\n        observer.observe(document.getElementsByName('radio-control-0')[0].parentElement.parentElement, {childList: true});\n\n\n        // TODO find a better method to retrieve address data instead of observing requests\n        const nativeFetch = window.fetch\n        window.fetch = function(...args) {\n            let isWantedCall = false\n            const urlParams = new URLSearchParams(args[0])\n            urlParams.forEach(function (param) {\n                if (isWantedCall) {\n                    return\n                }\n\n                if (param.includes('batch')) {\n                    isWantedCall = true\n                }\n            });\n\n            if (!isWantedCall) {\n                return nativeFetch.apply(window, args);\n            }\n\n            JSON.parse(args[1].body).requests.forEach((request) => {\n                if (request.path.includes('update-customer')) {\n                    if (typeof request.body.shipping_address.country !== 'undefined') {\n                        setCountryCode(request.body.shipping_address.country)\n                    }\n\n                    if (typeof request.body.shipping_address.postcode !== 'undefined') {\n                        setPostalCode(request.body.shipping_address.postcode);\n                    }\n                }\n            })\n\n            return nativeFetch.apply(window, args);\n        }\n    }, [])\n\n    const deliveryTimeShippingMethods = [\n        'dhlpwc-parcelshop',\n        'dhlpwc-home',\n        'dhlpwc-home-evening',\n        'dhlpwc-home-next-day',\n        'dhlpwc-home-no-neighbour',\n        'dhlpwc-home-no-neighbour-evening',\n        'dhlpwc-home-no-neighbour-next-day',\n    ]\n\n    useEffect(() => {\n        if (deliveryTimeShippingMethods.indexOf(selectedShippingMethod) !== -1) {\n            document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"block\"\n        } else {\n            document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"none\"\n        }\n    }, [selectedShippingMethod])\n\n    return <div id='dhlpwc-shipping-method-delivery-options' className='dhlpwc-shipping-method-delivery-options'>\n        <div className=\"dhlpwc-delivery-options-header\">{__('DHL Delivery options')}</div>\n        <DeliveryTimes\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n        />\n        <Servicepoints\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n            validationClass={validationClass}\n            setValidationClass={setValidationClass}\n        />\n        <SameDay\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n        />\n    </div>\n}\n"],"names":["useState","useEffect","__","SelectControl","DeliveryTimes","props","window","dhlpwc_block_data","deliverytimes_enabled","deliveryTimeShippingMethods","deliveryTimes","setDeliveryTimes","selectedTime","setSelectedTime","deliveryTimeDetails","document","getElementById","indexOf","selectedShippingMethod","style","display","formData","FormData","append","postalCode","countryCode","fetch","method","body","then","response","json","parsedDeliveryTimes","Object","values","data","forEach","value","parsedDeliveryTime","label","date","start_time","end_time","identifier","push","split","_selectedTime$","_selectedTime$2","_selectedTime$3","createElement","id","className","hideLabelFromVision","join","options","onChange","deliveryTime","SameDay","sdd_as_time_window","sameDayElement","parentElement","sameDayNoNeighborElement","sameDayDeliveryMethods","_sameDayDeliveryTime$","_sameDayDeliveryTime$2","_sameDayDeliveryTime$3","sameDayDeliveryTime","useDispatch","useSelect","Servicepoints","_parcelshop$name","VALIDATION_ERROR_PARCELSHOP_EMPTY","getValidationError","select","store","parcelshop","setParcelshop","script","src","async","onload","loadModal","appendChild","_window$dhlpwc_block_","language","country","limit","googleMapsApiKey","header","resizable","onSelect","filter","serviceType","dhlparcel_shipping_servicepoint_locator","dhl","servicepoint","Locator","parcelshopDetails","onclick","setValidationErrors","clearValidationError","keys","length","_parcelshop$id","setValidationClass","message","hidden","showModal","modal","setCountry","setQuery","validationClass","name","address","postal_code","city","street","number","addition","type","onClick","domReady","render","getElementByIdAsync","Promise","resolve","getElement","element","requestAnimationFrame","container","App","setPostalCode","setCountryCode","setSelectedShippingMethod","addEventListener","trackSelectedShippingMethod","event","target","observer","MutationObserver","mutationList","mutation","getElementsByName","observe","childList","nativeFetch","args","isWantedCall","urlParams","URLSearchParams","param","includes","apply","JSON","parse","requests","request","path","shipping_address","postcode"],"sourceRoot":""}
  • dhlpwc/tags/2.1.8/dhlpwoocommerce.php

    r3141567 r3160499  
    55 * Description:          This is the official DHL eCommerce (Benelux) for WooCommerce plugin.
    66 * Author:               DHL eCommerce
    7  * Version:              2.1.7
     7 * Version:              2.1.8
    88 * Requires at least:    4.7.16
    9  * Tested up to:         6.3
     9 * Tested up to:         6.6.0
    1010 * Requires PHP:         5.6
    1111 * WC requires at least: 3.0.0
     
    5252
    5353        // Set constants
    54         $this->define('DHLPWC_PLUGIN_VERSION', '2.1.7');
     54        $this->define('DHLPWC_PLUGIN_VERSION', '2.1.8');
    5555        $this->define('DHLPWC_PLUGIN_FILE', __FILE__);
    5656        $this->define('DHLPWC_PLUGIN_BASENAME', plugin_basename(__FILE__));
  • dhlpwc/tags/2.1.8/includes/model/logic/class-dhlpwc-model-logic-shipment.php

    r3073094 r3160499  
    216216    {
    217217        $address = $this->prepare_street_address($address);
     218        $address = $this->format_postcode($address);
    218219
    219220        return new DHLPWC_Model_API_Data_Shipment_Address(array(
     
    225226            'address'       => array(
    226227                'country_code' => $address['country'],
    227                 'postal_code'  => WC_Validation::format_postcode($address['postcode'], $address['country']),
     228                'postal_code'  => $address['postcode'],
    228229                'city'         => $address['city'],
    229230                'street'       => $address['street'],
     
    237238    }
    238239
     240    protected function format_postcode($address)
     241    {
     242        $address['postcode'] = WC_Validation::format_postcode( $address['postcode'], $address['country'] );
     243        switch ($address['country']) {
     244            case 'CZ':
     245            case 'DK':
     246            case 'LV':
     247            case 'SK':
     248                $address['postcode'] = str_replace([$address['country'], '-'], '', $address['postcode']);
     249                break;
     250        }
     251
     252        return $address;
     253    }
     254
    239255    protected function prepare_street_address($address)
    240256    {
  • dhlpwc/tags/2.1.8/readme.txt

    r3141567 r3160499  
    55Requires PHP:         5.6
    66Tested up to:         6.6.0
    7 Stable tag:           2.1.7
     7Stable tag:           2.1.8
    88WC requires at least: 3.0.0
    99WC tested up to:      9.0.2
     
    5757== Changelog ==
    5858 
     59= 2.1.8 =
     60- Updated tested up to version
     61- Fixed an issue where ISO codes in postalcode would prevent label creation. Applies to Czechia, Denmark, Latvia and Slovakia
     62
    5963= 2.1.7 =
    6064- Fixed the Download Label button in the popup shown after creating a label in the HPOS menu
  • dhlpwc/trunk/README.md

    r3141567 r3160499  
    11# DHL eCommerce (Benelux) for WooCommerce
     2 
     3v2.1.8
     4## Changes
     5- Updated tested up to version
     6- Fixed an issue where ISO codes in postalcode would prevent label creation. Applies to Czechia, Denmark, Latvia and Slovakia
    27 
    38v2.1.7
  • dhlpwc/trunk/build/view.asset.php

    r3073094 r3160499  
    1 <?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '4a7f4d2ae5633fc55727');
     1<?php return array('dependencies' => array('react', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'eeeebb5fff6cc243195d');
  • dhlpwc/trunk/build/view.js

    r3073094 r3160499  
    188188  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    189189    const script = document.createElement('script');
    190     script.src = 'https://static.dhlparcel.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js';
     190    script.src = 'https://static.dhlecommerce.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js';
    191191    script.async = true;
    192192    script.onload = () => loadModal();
     
    512512  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    513513    // Track selected shipping method
    514     const shippingMethods = document.getElementsByClassName("wc-block-components-form wc-block-checkout__form")[0]['radio-control-0'];
    515     if (shippingMethods) {
    516       shippingMethods.forEach(element => {
    517         element.addEventListener('change', event => {
    518           setSelectedShippingMethod(event.target.value);
    519         });
    520       });
    521     }
     514    document.addEventListener("change", trackSelectedShippingMethod);
     515    function trackSelectedShippingMethod(event) {
     516      let element = event.target;
     517      if (element.name === 'radio-control-0') {
     518        setSelectedShippingMethod(event.target.value);
     519      }
     520    }
     521
     522    /**
     523     * Create observer for when shipping methods fundamentally change (WooCommerce does not call the Change method)
     524     * We observe the parent of the radio buttons. When a shipping methods gets added or removed, we update the selectedShippingMethod
     525     */
     526    const observer = new MutationObserver(mutationList => {
     527      for (const mutation of mutationList) {
     528        if (mutation.type === "childList") {
     529          setSelectedShippingMethod(document.getElementsByName('radio-control-0')[0].value);
     530        }
     531      }
     532    });
     533    observer.observe(document.getElementsByName('radio-control-0')[0].parentElement.parentElement, {
     534      childList: true
     535    });
    522536
    523537    // TODO find a better method to retrieve address data instead of observing requests
  • dhlpwc/trunk/build/view.js.map

    r3073094 r3160499  
    1 {"version":3,"file":"view.js","m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AAsB,CAAC,KAAK,CAAC,CAAC,EAAE;MACpEH,QAAQ,CAACC,cAAc,CAAC,yCAAyC,CAAC,CAACG,KAAK,CAACC,OAAO,GAAG,OAAO;IAC9F,CAAC,MAAM;MACHL,QAAQ,CAACC,cAAc,CAAC,yCAAyC,CAAC,CAACG,KAAK,CAACC,OAAO,GAAG,MAAM;IAC7F;EACJ,CAAC,EAAE,CAACF,sBAAsB,CAAC,CAAC;EAE5B,OAAO+B,oDAAA;IAAKC,EAAE,EAAC,yCAAyC;IAACC,SAAS,EAAC;EAAyC,GACxGF,oDAAA;IAAKE,SAAS,EAAC;EAAgC,GAAEjD,mDAAE,CAAC,sBAAsB,CAAO,CAAC,EAClF+C,oDAAA,CAAC7C,0DAAa;IACVoB,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA;EAAuB,CAClD,CAAC,EACF+B,oDAAA,CAACoB,yDAAa;IACV7C,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA,sBAAuB;IAC/C6F,eAAe,EAAEA,eAAgB;IACjCP,kBAAkB,EAAEA;EAAmB,CAC1C,CAAC,EACFvD,oDAAA,CAACQ,8CAAO;IACJjC,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA;EAAuB,CAClD,CACA,CAAC;AACV,CAAC,C","sources":["webpack://copyright-date-block/./src/delivery-times.js","webpack://copyright-date-block/./src/same-day.js","webpack://copyright-date-block/./src/servicepoints.js","webpack://copyright-date-block/external window \"React\"","webpack://copyright-date-block/external window [\"wp\",\"components\"]","webpack://copyright-date-block/external window [\"wp\",\"data\"]","webpack://copyright-date-block/external window [\"wp\",\"domReady\"]","webpack://copyright-date-block/external window [\"wp\",\"element\"]","webpack://copyright-date-block/external window [\"wp\",\"i18n\"]","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/view.js"],"sourcesContent":["import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\n\nexport const DeliveryTimes = (props) => {\n    if (!window.dhlpwc_block_data.deliverytimes_enabled) {\n        return ''\n    }\n\n    const deliveryTimeShippingMethods = [\n        'dhlpwc-home',\n        'dhlpwc-home-evening',\n        'dhlpwc-home-next-day',\n        'dhlpwc-home-no-neighbour',\n        'dhlpwc-home-no-neighbour-evening',\n        'dhlpwc-home-no-neighbour-next-day',\n    ]\n    const [deliveryTimes, setDeliveryTimes] = useState({});\n    const [selectedTime, setSelectedTime] = useState([]);\n\n    useEffect(() => {\n        const deliveryTimeDetails = document.getElementById('dhlpwc-shipping-method-delivery-times-option')\n        if (deliveryTimeShippingMethods.indexOf(props.selectedShippingMethod) !== -1) {\n            deliveryTimeDetails.style.display = \"block\";\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_delivery_times')\n            formData.append('shipping_method', props.selectedShippingMethod)\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n                let parsedDeliveryTimes = [];\n\n                Object.values(response.data).forEach((value) => {\n                    const parsedDeliveryTime = {\n                        label: `${value.date} (${value.start_time} - ${value.end_time})`,\n                        value: value.identifier\n                    }\n                    parsedDeliveryTimes.push(parsedDeliveryTime)\n                })\n                setDeliveryTimes(parsedDeliveryTimes)\n                // initially set the first selection\n                setSelectedTime(parsedDeliveryTimes[0].value.split('___'))\n            })\n        } else {\n            deliveryTimeDetails.style.display = \"none\"\n            setSelectedTime([])\n        }\n    }, [props.postalCode, props.countryCode, props.selectedShippingMethod])\n\n    useEffect(() => {\n        // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n        const formData = new FormData();\n        formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n        formData.append('selected', true)\n        formData.append('date', selectedTime[0] ?? '')\n        formData.append('start_time', selectedTime[1] ?? '')\n        formData.append('end_time', selectedTime[2] ?? '')\n\n        fetch(\n            window.dhlpwc_block_data['ajax_url'],\n            {\n                method: 'POST',\n                body: formData\n            }\n        )\n    }, [selectedTime])\n\n    return <div id='dhlpwc-shipping-method-delivery-times-option'\n                className='dhlpwc-shipping-method-delivery-times-option'>\n        <div className=\"dhlpwc-delivery-times-selection-header\">{__('DHL Delivery Times options')}</div>\n        <span className=\"dhlpwc-delivery-times-selection-text\">{__('Desired delivery moment:')}</span>\n        <SelectControl\n            hideLabelFromVision='true'\n            className='dhlpwc-delivery-times-selection-input'\n            label={__('Select desired delivery moment')}\n            value={selectedTime.join('___')}\n            options={deliveryTimes}\n            onChange={(deliveryTime) => setSelectedTime(deliveryTime.split('___'))}\n        />\n    </div>\n};\n","import { useEffect } from '@wordpress/element'\n\nexport const SameDay = (props) => {\n    if (window.dhlpwc_block_data.sdd_as_time_window) {\n        const sameDayElement = document.getElementById('radio-control-0-dhlpwc-home-same-day');\n        if (sameDayElement) {\n            sameDayElement.parentElement.style.display = \"none\";\n        }\n\n        const sameDayNoNeighborElement = document.getElementById('radio-control-0-dhlpwc-home-no-neighbour-same-day');\n        if (sameDayNoNeighborElement) {\n            sameDayNoNeighborElement.parentElement.style.display = \"none\";\n        }\n    }\n\n    const sameDayDeliveryMethods = [\n        'dhlpwc-home-same-day',\n        'dhlpwc-home-no-neighbour-same-day'\n    ]\n\n    useEffect(() => {\n        if (sameDayDeliveryMethods.indexOf(props.selectedShippingMethod) !== -1) {\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_delivery_times')\n            formData.append('shipping_method', props.selectedShippingMethod)\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n                const sameDayDeliveryTime = response.data[0]['identifier'].split('___')\n                const formData = new FormData();\n                formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n                formData.append('selected', true)\n                formData.append('date', sameDayDeliveryTime[0] ?? '')\n                formData.append('start_time', sameDayDeliveryTime[1] ?? '')\n                formData.append('end_time', sameDayDeliveryTime[2] ?? '')\n\n                fetch(\n                    window.dhlpwc_block_data['ajax_url'],\n                    {\n                        method: 'POST',\n                        body: formData\n                    }\n                )\n            })\n        }\n    }, [props.postalCode, props.countryCode, props.selectedShippingMethod]);\n};\n","import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\nexport const Servicepoints = (props) => {\n    const VALIDATION_ERROR_PARCELSHOP_EMPTY = 'validation-error-parcelshop-empty'\n    const getValidationError = useSelect((select) => {\n        const store = select('wc/store/validation');\n\n        return store.getValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n    });\n    const [parcelshop, setParcelshop] = useState({})\n\n    // Only run this once, intentionally no dependencies given\n    useEffect(() => {\n        const script = document.createElement('script')\n        script.src = 'https://static.dhlparcel.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js'\n        script.async = true\n        script.onload = () => loadModal()\n\n        document.body.appendChild(script)\n    }, [])\n\n    const loadModal = () => {\n        var options = {\n            language: window.dhlpwc_block_data['language'],\n            country: window.dhlpwc_block_data['country_code'] ?? '',\n            limit: window.dhlpwc_block_data['limit'],\n            googleMapsApiKey: window.dhlpwc_block_data['google_maps_key'],\n            header: false,\n            resizable: true,\n            onSelect: (parcelshop) => {\n                setParcelshop(parcelshop)\n            },\n            filter: {\n                serviceType: 'pick-up'\n            }\n        }\n\n        window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(document.getElementById('dhl-servicepoint-locator-component'), options)\n\n        // Hide the parcelshop element when parcelshop is not selected\n        const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n        if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n            parcelshopDetails.style.display = 'block'\n        } else {\n            parcelshopDetails.style.display = 'none'\n        }\n\n        // Hide the modal when clicking the X button\n        document.getElementById('dhlpwc-modal-close').onclick = () => {\n            document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n        }\n\n        // Set background image dynamically\n        document.getElementById('dhlpwc-modal-content').style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'\n    }\n\n    /**\n     * Set the initial parcelshop based on postalCode or countryCode\n     */\n    useEffect(() => {\n        const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n        if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n            parcelshopDetails.style.display = 'block'\n\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_initial_parcelshop')\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n\n                if (response.data?.parcelshop) {\n                    setParcelshop(response.data.parcelshop)\n                } else {\n                    setParcelshop({})\n                }\n            })\n        } else {\n            parcelshopDetails.style.display = 'none'\n            setParcelshop({})\n        }\n    }, [props.postalCode, props.selectedShippingMethod])\n\n    const { setValidationErrors, clearValidationError } = useDispatch(\n        'wc/store/validation'\n    );\n\n    /**\n     * Sync the parcelshop (or lack of) with frontend elements and the backend\n     *\n     * @param parcelshop\n     */\n    useEffect( () => {\n        document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n\n        // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n        const formData = new FormData();\n        formData.append('action', 'dhlpwc_parcelshop_selection_sync')\n        if (Object.keys(parcelshop).length !== 0 || props.selectedShippingMethod !== 'dhlpwc-parcelshop') {\n            props.setValidationClass('dhlpwc_notice')\n            formData.append('parcelshop_id', parcelshop['id'] ?? '')\n            formData.append('country_code', props.countryCode)\n            if ( getValidationError ) {\n                clearValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n            }\n        } else {\n            props.setValidationClass('dhlpwc-servicepoint-error')\n            setValidationErrors( {\n                [ VALIDATION_ERROR_PARCELSHOP_EMPTY ]: {\n                    message: __( 'Please add some text', 'shipping-workshop' ),\n                    hidden: true,\n                },\n            } );\n        }\n\n        fetch(\n            window.dhlpwc_block_data['ajax_url'],\n            {\n                method: 'POST',\n                body: formData\n            }\n        )\n    }, [parcelshop]);\n\n    /**\n     * Show the parcelshop selector\n     */\n    const showModal = () => {\n        if (props.postalCode === '') {\n            document.getElementById('shipping-postcode').value\n        }\n\n        const modal = document.getElementById('dhlpwc-servicepoint-modal')\n        modal.style.display = 'block'\n\n        if (typeof window.dhlparcel_shipping_servicepoint_locator !== 'undefined') {\n            window.dhlparcel_shipping_servicepoint_locator.setCountry(props.countryCode)\n            window.dhlparcel_shipping_servicepoint_locator.setQuery(props.postalCode)\n        }\n    }\n\n    return <div id='dhlpwc-shipping-method-parcelshop-option' className='dhlpwc-shipping-method-parcelshop-option'>\n        <span className=\"dhlpwc-parcelshop-selection-text\">{__('The following ServicePoint is selected:')}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop.name ?? __('⚠ No location selected.')}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.postal_code} {parcelshop?.address?.city}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.street} {parcelshop?.address?.number} {parcelshop?.address?.addition}</span>\n\n        <input type='button' className='dhlpwc-parcelshop-option-change' value='Change' onClick={() => showModal()}/>\n    </div>\n};\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"domReady\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import domReady from '@wordpress/dom-ready'\nimport { render, useEffect } from '@wordpress/element'\nimport { Servicepoints } from \"./servicepoints\";\nimport { DeliveryTimes } from \"./delivery-times\";\nimport { SameDay } from \"./same-day\";\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element'\n\ndomReady(async function () {\n    const getElementByIdAsync = id => new Promise(resolve => {\n        const getElement = () => {\n            const element = document.getElementById(id)\n            if(element) {\n                resolve(element)\n            } else {\n                requestAnimationFrame(getElement)\n            }\n        };\n        getElement()\n    });\n\n    const container = await getElementByIdAsync('dhlpwc-app')\n    render(<App/>, container)\n})\n\nexport const App = () => {\n    const [postalCode, setPostalCode] = useState(window.dhlpwc_block_data['postal_code'])\n    const [countryCode, setCountryCode] = useState(window.dhlpwc_block_data['country_code'])\n    const [selectedShippingMethod, setSelectedShippingMethod] = useState(window.dhlpwc_block_data['initial_shipping_method'])\n    const [validationClass, setValidationClass] = useState('dhlpwc_warning')\n\n    // Only run this once, intentionally no dependencies given\n    useEffect(()=>{\n        // Track selected shipping method\n        const shippingMethods = document.getElementsByClassName(\"wc-block-components-form wc-block-checkout__form\")[0]['radio-control-0'];\n        if (shippingMethods) {\n            shippingMethods.forEach((element) => {\n                element.addEventListener('change', (event) => {\n                    setSelectedShippingMethod(event.target.value)\n                })\n            })\n        }\n\n        // TODO find a better method to retrieve address data instead of observing requests\n        const nativeFetch = window.fetch;\n        window.fetch = function(...args) {\n            let isWantedCall = false;\n            const urlParams = new URLSearchParams(args[0]);\n            urlParams.forEach(function (param) {\n                if (isWantedCall) {\n                    return;\n                }\n\n                if (param.includes('batch')) {\n                    isWantedCall = true;\n                }\n            });\n\n            if (!isWantedCall) {\n                return nativeFetch.apply(window, args);\n            }\n\n            JSON.parse(args[1].body).requests.forEach((request) => {\n                if (request.path.includes('update-customer')) {\n                    if (typeof request.body.shipping_address.country !== 'undefined') {\n                        setCountryCode(request.body.shipping_address.country);\n                    }\n\n                    if (typeof request.body.shipping_address.postcode !== 'undefined') {\n                        setPostalCode(request.body.shipping_address.postcode);\n                    }\n                }\n            })\n\n            return nativeFetch.apply(window, args);\n        }\n    }, [])\n\n    const deliveryTimeShippingMethods = [\n        'dhlpwc-parcelshop',\n        'dhlpwc-home',\n        'dhlpwc-home-evening',\n        'dhlpwc-home-next-day',\n        'dhlpwc-home-no-neighbour',\n        'dhlpwc-home-no-neighbour-evening',\n        'dhlpwc-home-no-neighbour-next-day',\n    ]\n\n    useEffect(() => {\n        if (deliveryTimeShippingMethods.indexOf(selectedShippingMethod) !== -1) {\n            document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"block\"\n        } else {\n            document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"none\"\n        }\n    }, [selectedShippingMethod]);\n\n    return <div id='dhlpwc-shipping-method-delivery-options' className='dhlpwc-shipping-method-delivery-options'>\n        <div className=\"dhlpwc-delivery-options-header\">{__('DHL Delivery options')}</div>\n        <DeliveryTimes\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n        />\n        <Servicepoints\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n            validationClass={validationClass}\n            setValidationClass={setValidationClass}\n        />\n        <SameDay\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n        />\n    </div>\n}\n"],"names":["useState","useEffect","__","SelectControl","DeliveryTimes","props","window","dhlpwc_block_data","deliverytimes_enabled","deliveryTimeShippingMethods","deliveryTimes","setDeliveryTimes","selectedTime","setSelectedTime","deliveryTimeDetails","document","getElementById","indexOf","selectedShippingMethod","style","display","formData","FormData","append","postalCode","countryCode","fetch","method","body","then","response","json","parsedDeliveryTimes","Object","values","data","forEach","value","parsedDeliveryTime","label","date","start_time","end_time","identifier","push","split","_selectedTime$","_selectedTime$2","_selectedTime$3","createElement","id","className","hideLabelFromVision","join","options","onChange","deliveryTime","SameDay","sdd_as_time_window","sameDayElement","parentElement","sameDayNoNeighborElement","sameDayDeliveryMethods","_sameDayDeliveryTime$","_sameDayDeliveryTime$2","_sameDayDeliveryTime$3","sameDayDeliveryTime","useDispatch","useSelect","Servicepoints","_parcelshop$name","VALIDATION_ERROR_PARCELSHOP_EMPTY","getValidationError","select","store","parcelshop","setParcelshop","script","src","async","onload","loadModal","appendChild","_window$dhlpwc_block_","language","country","limit","googleMapsApiKey","header","resizable","onSelect","filter","serviceType","dhlparcel_shipping_servicepoint_locator","dhl","servicepoint","Locator","parcelshopDetails","onclick","setValidationErrors","clearValidationError","keys","length","_parcelshop$id","setValidationClass","message","hidden","showModal","modal","setCountry","setQuery","validationClass","name","address","postal_code","city","street","number","addition","type","onClick","domReady","render","getElementByIdAsync","Promise","resolve","getElement","element","requestAnimationFrame","container","App","setPostalCode","setCountryCode","setSelectedShippingMethod","shippingMethods","getElementsByClassName","addEventListener","event","target","nativeFetch","args","isWantedCall","urlParams","URLSearchParams","param","includes","apply","JSON","parse","requests","request","path","shipping_address","postcode"],"sourceRoot":""}
     1{"version":3,"file":"view.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAwD;AACnB;AACiB;AAE/C,MAAMI,aAAa,GAAIC,KAAK,IAAK;EACpC,IAAI,CAACC,MAAM,CAACC,iBAAiB,CAACC,qBAAqB,EAAE;IACjD,OAAO,EAAE;EACb;EAEA,MAAMC,2BAA2B,GAAG,CAChC,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,kCAAkC,EAClC,mCAAmC,CACtC;EACD,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGX,4DAAQ,CAAC,CAAC,CAAC,CAAC;EACtD,MAAM,CAACY,YAAY,EAAEC,eAAe,CAAC,GAAGb,4DAAQ,CAAC,EAAE,CAAC;EAEpDC,6DAAS,CAAC,MAAM;IACZ,MAAMa,mBAAmB,GAAGC,QAAQ,CAACC,cAAc,CAAC,8CAA8C,CAAC;IACnG,IAAIP,2BAA2B,CAACQ,OAAO,CAACZ,KAAK,CAACa,sBAAsB,CAAC,KAAK,CAAC,CAAC,EAAE;MAC1EJ,mBAAmB,CAACK,KAAK,CAACC,OAAO,GAAG,OAAO;MAC3C;MACA,MAAMC,QAAQ,GAAG,IAAIC,QAAQ,CAAC,CAAC;MAC/BD,QAAQ,CAACE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AAS,EAAC;EAAgC,GAAEjD,mDAAE,CAAC,sBAAsB,CAAO,CAAC,EAClF+C,oDAAA,CAAC7C,0DAAa;IACVoB,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA;EAAuB,CAClD,CAAC,EACF+B,oDAAA,CAACoB,yDAAa;IACV7C,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA,sBAAuB;IAC/C6F,eAAe,EAAEA,eAAgB;IACjCP,kBAAkB,EAAEA;EAAmB,CAC1C,CAAC,EACFvD,oDAAA,CAACQ,8CAAO;IACJjC,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBP,sBAAsB,EAAEA;EAAuB,CAClD,CACA,CAAC;AACV,CAAC,C","sources":["webpack://copyright-date-block/./src/delivery-times.js","webpack://copyright-date-block/./src/same-day.js","webpack://copyright-date-block/./src/servicepoints.js","webpack://copyright-date-block/external window \"React\"","webpack://copyright-date-block/external window [\"wp\",\"components\"]","webpack://copyright-date-block/external window [\"wp\",\"data\"]","webpack://copyright-date-block/external window [\"wp\",\"domReady\"]","webpack://copyright-date-block/external window [\"wp\",\"element\"]","webpack://copyright-date-block/external window [\"wp\",\"i18n\"]","webpack://copyright-date-block/webpack/bootstrap","webpack://copyright-date-block/webpack/runtime/compat get default export","webpack://copyright-date-block/webpack/runtime/define property getters","webpack://copyright-date-block/webpack/runtime/hasOwnProperty shorthand","webpack://copyright-date-block/webpack/runtime/make namespace object","webpack://copyright-date-block/./src/view.js"],"sourcesContent":["import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\n\nexport const DeliveryTimes = (props) => {\n    if (!window.dhlpwc_block_data.deliverytimes_enabled) {\n        return ''\n    }\n\n    const deliveryTimeShippingMethods = [\n        'dhlpwc-home',\n        'dhlpwc-home-evening',\n        'dhlpwc-home-next-day',\n        'dhlpwc-home-no-neighbour',\n        'dhlpwc-home-no-neighbour-evening',\n        'dhlpwc-home-no-neighbour-next-day',\n    ]\n    const [deliveryTimes, setDeliveryTimes] = useState({});\n    const [selectedTime, setSelectedTime] = useState([]);\n\n    useEffect(() => {\n        const deliveryTimeDetails = document.getElementById('dhlpwc-shipping-method-delivery-times-option')\n        if (deliveryTimeShippingMethods.indexOf(props.selectedShippingMethod) !== -1) {\n            deliveryTimeDetails.style.display = \"block\";\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_delivery_times')\n            formData.append('shipping_method', props.selectedShippingMethod)\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n                let parsedDeliveryTimes = [];\n\n                Object.values(response.data).forEach((value) => {\n                    const parsedDeliveryTime = {\n                        label: `${value.date} (${value.start_time} - ${value.end_time})`,\n                        value: value.identifier\n                    }\n                    parsedDeliveryTimes.push(parsedDeliveryTime)\n                })\n                setDeliveryTimes(parsedDeliveryTimes)\n                // initially set the first selection\n                setSelectedTime(parsedDeliveryTimes[0].value.split('___'))\n            })\n        } else {\n            deliveryTimeDetails.style.display = \"none\"\n            setSelectedTime([])\n        }\n    }, [props.postalCode, props.countryCode, props.selectedShippingMethod])\n\n    useEffect(() => {\n        // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n        const formData = new FormData();\n        formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n        formData.append('selected', true)\n        formData.append('date', selectedTime[0] ?? '')\n        formData.append('start_time', selectedTime[1] ?? '')\n        formData.append('end_time', selectedTime[2] ?? '')\n\n        fetch(\n            window.dhlpwc_block_data['ajax_url'],\n            {\n                method: 'POST',\n                body: formData\n            }\n        )\n    }, [selectedTime])\n\n    return <div id='dhlpwc-shipping-method-delivery-times-option'\n                className='dhlpwc-shipping-method-delivery-times-option'>\n        <div className=\"dhlpwc-delivery-times-selection-header\">{__('DHL Delivery Times options')}</div>\n        <span className=\"dhlpwc-delivery-times-selection-text\">{__('Desired delivery moment:')}</span>\n        <SelectControl\n            hideLabelFromVision='true'\n            className='dhlpwc-delivery-times-selection-input'\n            label={__('Select desired delivery moment')}\n            value={selectedTime.join('___')}\n            options={deliveryTimes}\n            onChange={(deliveryTime) => setSelectedTime(deliveryTime.split('___'))}\n        />\n    </div>\n};\n","import { useEffect } from '@wordpress/element'\n\nexport const SameDay = (props) => {\n    if (window.dhlpwc_block_data.sdd_as_time_window) {\n        const sameDayElement = document.getElementById('radio-control-0-dhlpwc-home-same-day');\n        if (sameDayElement) {\n            sameDayElement.parentElement.style.display = \"none\";\n        }\n\n        const sameDayNoNeighborElement = document.getElementById('radio-control-0-dhlpwc-home-no-neighbour-same-day');\n        if (sameDayNoNeighborElement) {\n            sameDayNoNeighborElement.parentElement.style.display = \"none\";\n        }\n    }\n\n    const sameDayDeliveryMethods = [\n        'dhlpwc-home-same-day',\n        'dhlpwc-home-no-neighbour-same-day'\n    ]\n\n    useEffect(() => {\n        if (sameDayDeliveryMethods.indexOf(props.selectedShippingMethod) !== -1) {\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_delivery_times')\n            formData.append('shipping_method', props.selectedShippingMethod)\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n                const sameDayDeliveryTime = response.data[0]['identifier'].split('___')\n                const formData = new FormData();\n                formData.append('action', 'dhlpwc_delivery_time_selection_sync')\n\n                formData.append('selected', true)\n                formData.append('date', sameDayDeliveryTime[0] ?? '')\n                formData.append('start_time', sameDayDeliveryTime[1] ?? '')\n                formData.append('end_time', sameDayDeliveryTime[2] ?? '')\n\n                fetch(\n                    window.dhlpwc_block_data['ajax_url'],\n                    {\n                        method: 'POST',\n                        body: formData\n                    }\n                )\n            })\n        }\n    }, [props.postalCode, props.countryCode, props.selectedShippingMethod]);\n};\n","import { useState, useEffect } from '@wordpress/element'\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\nexport const Servicepoints = (props) => {\n    const VALIDATION_ERROR_PARCELSHOP_EMPTY = 'validation-error-parcelshop-empty'\n    const getValidationError = useSelect((select) => {\n        const store = select('wc/store/validation');\n\n        return store.getValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n    });\n    const [parcelshop, setParcelshop] = useState({})\n\n    // Only run this once, intentionally no dependencies given\n    useEffect(() => {\n        const script = document.createElement('script')\n        script.src = 'https://static.dhlecommerce.nl/components/servicepoint-locator-component@latest/servicepoint-locator-component.js'\n        script.async = true\n        script.onload = () => loadModal()\n\n        document.body.appendChild(script)\n    }, [])\n\n    const loadModal = () => {\n        var options = {\n            language: window.dhlpwc_block_data['language'],\n            country: window.dhlpwc_block_data['country_code'] ?? '',\n            limit: window.dhlpwc_block_data['limit'],\n            googleMapsApiKey: window.dhlpwc_block_data['google_maps_key'],\n            header: false,\n            resizable: true,\n            onSelect: (parcelshop) => {\n                setParcelshop(parcelshop)\n            },\n            filter: {\n                serviceType: 'pick-up'\n            }\n        }\n\n        window.dhlparcel_shipping_servicepoint_locator = new dhl.servicepoint.Locator(document.getElementById('dhl-servicepoint-locator-component'), options)\n\n        // Hide the parcelshop element when parcelshop is not selected\n        const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n        if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n            parcelshopDetails.style.display = 'block'\n        } else {\n            parcelshopDetails.style.display = 'none'\n        }\n\n        // Hide the modal when clicking the X button\n        document.getElementById('dhlpwc-modal-close').onclick = () => {\n            document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n        }\n\n        // Set background image dynamically\n        document.getElementById('dhlpwc-modal-content').style['background-image'] = 'url(' + window.dhlpwc_block_data['modal_background'] + ')'\n    }\n\n    /**\n     * Set the initial parcelshop based on postalCode or countryCode\n     */\n    useEffect(() => {\n        const parcelshopDetails = document.getElementById('dhlpwc-shipping-method-parcelshop-option')\n        if (props.selectedShippingMethod === 'dhlpwc-parcelshop') {\n            parcelshopDetails.style.display = 'block'\n\n            // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n            const formData = new FormData();\n            formData.append('action', 'dhlpwc_get_initial_parcelshop')\n            formData.append('postal_code', props.postalCode)\n            formData.append('country_code', props.countryCode)\n            fetch(\n                window.dhlpwc_block_data['ajax_url'],\n                {\n                    method: 'POST',\n                    body: formData\n                }\n            ).then(async response => {\n                response = await response.json()\n\n                if (response.data?.parcelshop) {\n                    setParcelshop(response.data.parcelshop)\n                } else {\n                    setParcelshop({})\n                }\n            })\n        } else {\n            parcelshopDetails.style.display = 'none'\n            setParcelshop({})\n        }\n    }, [props.postalCode, props.selectedShippingMethod])\n\n    const { setValidationErrors, clearValidationError } = useDispatch(\n        'wc/store/validation'\n    );\n\n    /**\n     * Sync the parcelshop (or lack of) with frontend elements and the backend\n     *\n     * @param parcelshop\n     */\n    useEffect( () => {\n        document.getElementById('dhlpwc-servicepoint-modal').style.display = 'none'\n\n        // Wordpress doesn't like it when we post raw data, so we post it as a form instead\n        const formData = new FormData();\n        formData.append('action', 'dhlpwc_parcelshop_selection_sync')\n        if (Object.keys(parcelshop).length !== 0 || props.selectedShippingMethod !== 'dhlpwc-parcelshop') {\n            props.setValidationClass('dhlpwc_notice')\n            formData.append('parcelshop_id', parcelshop['id'] ?? '')\n            formData.append('country_code', props.countryCode)\n            if ( getValidationError ) {\n                clearValidationError( VALIDATION_ERROR_PARCELSHOP_EMPTY );\n            }\n        } else {\n            props.setValidationClass('dhlpwc-servicepoint-error')\n            setValidationErrors( {\n                [ VALIDATION_ERROR_PARCELSHOP_EMPTY ]: {\n                    message: __( 'Please add some text', 'shipping-workshop' ),\n                    hidden: true,\n                },\n            } );\n        }\n\n        fetch(\n            window.dhlpwc_block_data['ajax_url'],\n            {\n                method: 'POST',\n                body: formData\n            }\n        )\n    }, [parcelshop]);\n\n    /**\n     * Show the parcelshop selector\n     */\n    const showModal = () => {\n        if (props.postalCode === '') {\n            document.getElementById('shipping-postcode').value\n        }\n\n        const modal = document.getElementById('dhlpwc-servicepoint-modal')\n        modal.style.display = 'block'\n\n        if (typeof window.dhlparcel_shipping_servicepoint_locator !== 'undefined') {\n            window.dhlparcel_shipping_servicepoint_locator.setCountry(props.countryCode)\n            window.dhlparcel_shipping_servicepoint_locator.setQuery(props.postalCode)\n        }\n    }\n\n    return <div id='dhlpwc-shipping-method-parcelshop-option' className='dhlpwc-shipping-method-parcelshop-option'>\n        <span className=\"dhlpwc-parcelshop-selection-text\">{__('The following ServicePoint is selected:')}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop.name ?? __('⚠ No location selected.')}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.postal_code} {parcelshop?.address?.city}</span>\n        <span className={`dhlpwc-parcelshop-option-message ${props.validationClass}`}>{parcelshop?.address?.street} {parcelshop?.address?.number} {parcelshop?.address?.addition}</span>\n\n        <input type='button' className='dhlpwc-parcelshop-option-change' value='Change' onClick={() => showModal()}/>\n    </div>\n};\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"domReady\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import domReady from '@wordpress/dom-ready'\nimport { render, useEffect } from '@wordpress/element'\nimport { Servicepoints } from \"./servicepoints\";\nimport { DeliveryTimes } from \"./delivery-times\";\nimport { SameDay } from \"./same-day\";\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element'\n\ndomReady(async function () {\n    const getElementByIdAsync = id => new Promise(resolve => {\n        const getElement = () => {\n            const element = document.getElementById(id)\n            if(element) {\n                resolve(element)\n            } else {\n                requestAnimationFrame(getElement)\n            }\n        };\n        getElement()\n    });\n\n    const container = await getElementByIdAsync('dhlpwc-app')\n    render(<App/>, container)\n})\n\nexport const App = () => {\n    const [postalCode, setPostalCode] = useState(window.dhlpwc_block_data['postal_code'])\n    const [countryCode, setCountryCode] = useState(window.dhlpwc_block_data['country_code'])\n    const [selectedShippingMethod, setSelectedShippingMethod] = useState(window.dhlpwc_block_data['initial_shipping_method'])\n    const [validationClass, setValidationClass] = useState('dhlpwc_warning')\n\n    // Only run this once, intentionally no dependencies given\n    useEffect(()=>{\n\n        // Track selected shipping method\n        document.addEventListener( \"change\", trackSelectedShippingMethod );\n        function trackSelectedShippingMethod(event){\n            let element = event.target;\n            if (element.name === 'radio-control-0') {\n                setSelectedShippingMethod(event.target.value)\n            }\n        }\n\n        /**\n         * Create observer for when shipping methods fundamentally change (WooCommerce does not call the Change method)\n         * We observe the parent of the radio buttons. When a shipping methods gets added or removed, we update the selectedShippingMethod\n         */\n        const observer = new MutationObserver((mutationList) => {\n            for (const mutation of mutationList) {\n                if (mutation.type === \"childList\") {\n                    setSelectedShippingMethod(document.getElementsByName('radio-control-0')[0].value)\n                }\n            }\n        });\n        observer.observe(document.getElementsByName('radio-control-0')[0].parentElement.parentElement, {childList: true});\n\n\n        // TODO find a better method to retrieve address data instead of observing requests\n        const nativeFetch = window.fetch\n        window.fetch = function(...args) {\n            let isWantedCall = false\n            const urlParams = new URLSearchParams(args[0])\n            urlParams.forEach(function (param) {\n                if (isWantedCall) {\n                    return\n                }\n\n                if (param.includes('batch')) {\n                    isWantedCall = true\n                }\n            });\n\n            if (!isWantedCall) {\n                return nativeFetch.apply(window, args);\n            }\n\n            JSON.parse(args[1].body).requests.forEach((request) => {\n                if (request.path.includes('update-customer')) {\n                    if (typeof request.body.shipping_address.country !== 'undefined') {\n                        setCountryCode(request.body.shipping_address.country)\n                    }\n\n                    if (typeof request.body.shipping_address.postcode !== 'undefined') {\n                        setPostalCode(request.body.shipping_address.postcode);\n                    }\n                }\n            })\n\n            return nativeFetch.apply(window, args);\n        }\n    }, [])\n\n    const deliveryTimeShippingMethods = [\n        'dhlpwc-parcelshop',\n        'dhlpwc-home',\n        'dhlpwc-home-evening',\n        'dhlpwc-home-next-day',\n        'dhlpwc-home-no-neighbour',\n        'dhlpwc-home-no-neighbour-evening',\n        'dhlpwc-home-no-neighbour-next-day',\n    ]\n\n    useEffect(() => {\n        if (deliveryTimeShippingMethods.indexOf(selectedShippingMethod) !== -1) {\n            document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"block\"\n        } else {\n            document.getElementById('dhlpwc-shipping-method-delivery-options').style.display = \"none\"\n        }\n    }, [selectedShippingMethod])\n\n    return <div id='dhlpwc-shipping-method-delivery-options' className='dhlpwc-shipping-method-delivery-options'>\n        <div className=\"dhlpwc-delivery-options-header\">{__('DHL Delivery options')}</div>\n        <DeliveryTimes\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n        />\n        <Servicepoints\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n            validationClass={validationClass}\n            setValidationClass={setValidationClass}\n        />\n        <SameDay\n            postalCode={postalCode}\n            countryCode={countryCode}\n            selectedShippingMethod={selectedShippingMethod}\n        />\n    </div>\n}\n"],"names":["useState","useEffect","__","SelectControl","DeliveryTimes","props","window","dhlpwc_block_data","deliverytimes_enabled","deliveryTimeShippingMethods","deliveryTimes","setDeliveryTimes","selectedTime","setSelectedTime","deliveryTimeDetails","document","getElementById","indexOf","selectedShippingMethod","style","display","formData","FormData","append","postalCode","countryCode","fetch","method","body","then","response","json","parsedDeliveryTimes","Object","values","data","forEach","value","parsedDeliveryTime","label","date","start_time","end_time","identifier","push","split","_selectedTime$","_selectedTime$2","_selectedTime$3","createElement","id","className","hideLabelFromVision","join","options","onChange","deliveryTime","SameDay","sdd_as_time_window","sameDayElement","parentElement","sameDayNoNeighborElement","sameDayDeliveryMethods","_sameDayDeliveryTime$","_sameDayDeliveryTime$2","_sameDayDeliveryTime$3","sameDayDeliveryTime","useDispatch","useSelect","Servicepoints","_parcelshop$name","VALIDATION_ERROR_PARCELSHOP_EMPTY","getValidationError","select","store","parcelshop","setParcelshop","script","src","async","onload","loadModal","appendChild","_window$dhlpwc_block_","language","country","limit","googleMapsApiKey","header","resizable","onSelect","filter","serviceType","dhlparcel_shipping_servicepoint_locator","dhl","servicepoint","Locator","parcelshopDetails","onclick","setValidationErrors","clearValidationError","keys","length","_parcelshop$id","setValidationClass","message","hidden","showModal","modal","setCountry","setQuery","validationClass","name","address","postal_code","city","street","number","addition","type","onClick","domReady","render","getElementByIdAsync","Promise","resolve","getElement","element","requestAnimationFrame","container","App","setPostalCode","setCountryCode","setSelectedShippingMethod","addEventListener","trackSelectedShippingMethod","event","target","observer","MutationObserver","mutationList","mutation","getElementsByName","observe","childList","nativeFetch","args","isWantedCall","urlParams","URLSearchParams","param","includes","apply","JSON","parse","requests","request","path","shipping_address","postcode"],"sourceRoot":""}
  • dhlpwc/trunk/dhlpwoocommerce.php

    r3141567 r3160499  
    55 * Description:          This is the official DHL eCommerce (Benelux) for WooCommerce plugin.
    66 * Author:               DHL eCommerce
    7  * Version:              2.1.7
     7 * Version:              2.1.8
    88 * Requires at least:    4.7.16
    9  * Tested up to:         6.3
     9 * Tested up to:         6.6.0
    1010 * Requires PHP:         5.6
    1111 * WC requires at least: 3.0.0
     
    5252
    5353        // Set constants
    54         $this->define('DHLPWC_PLUGIN_VERSION', '2.1.7');
     54        $this->define('DHLPWC_PLUGIN_VERSION', '2.1.8');
    5555        $this->define('DHLPWC_PLUGIN_FILE', __FILE__);
    5656        $this->define('DHLPWC_PLUGIN_BASENAME', plugin_basename(__FILE__));
  • dhlpwc/trunk/includes/model/logic/class-dhlpwc-model-logic-shipment.php

    r3073094 r3160499  
    216216    {
    217217        $address = $this->prepare_street_address($address);
     218        $address = $this->format_postcode($address);
    218219
    219220        return new DHLPWC_Model_API_Data_Shipment_Address(array(
     
    225226            'address'       => array(
    226227                'country_code' => $address['country'],
    227                 'postal_code'  => WC_Validation::format_postcode($address['postcode'], $address['country']),
     228                'postal_code'  => $address['postcode'],
    228229                'city'         => $address['city'],
    229230                'street'       => $address['street'],
     
    237238    }
    238239
     240    protected function format_postcode($address)
     241    {
     242        $address['postcode'] = WC_Validation::format_postcode( $address['postcode'], $address['country'] );
     243        switch ($address['country']) {
     244            case 'CZ':
     245            case 'DK':
     246            case 'LV':
     247            case 'SK':
     248                $address['postcode'] = str_replace([$address['country'], '-'], '', $address['postcode']);
     249                break;
     250        }
     251
     252        return $address;
     253    }
     254
    239255    protected function prepare_street_address($address)
    240256    {
  • dhlpwc/trunk/readme.txt

    r3141567 r3160499  
    55Requires PHP:         5.6
    66Tested up to:         6.6.0
    7 Stable tag:           2.1.7
     7Stable tag:           2.1.8
    88WC requires at least: 3.0.0
    99WC tested up to:      9.0.2
     
    5757== Changelog ==
    5858 
     59= 2.1.8 =
     60- Updated tested up to version
     61- Fixed an issue where ISO codes in postalcode would prevent label creation. Applies to Czechia, Denmark, Latvia and Slovakia
     62
    5963= 2.1.7 =
    6064- Fixed the Download Label button in the popup shown after creating a label in the HPOS menu
Note: See TracChangeset for help on using the changeset viewer.