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EAAIgS,SAAQtV,MAAKijE,IAC9BzkE,EAAEwkE,GAAgBr7D,UAClBxG,EAAAA,EAAAA,GAAiB,CAACC,QAASC,EAAAA,EAAKC,EAAE,0BAClC6J,EAAO5B,SAAS,SAAS,GAE7B,MACE3F,EAAAA,IACF,GACA,C","sources":["webpack://lionwheel/./app/javascript/src/dayjs_config.js","webpack://lionwheel/./app/javascript/src/common.js","webpack://lionwheel/./app/javascript/src/layout.js","webpack://lionwheel/./app/javascript/src/helpers/visits_extended/table.js","webpack://lionwheel/./app/javascript/src/helpers/store_visits/filters.js","webpack://lionwheel/./app/javascript/src/operator.js","webpack://lionwheel/./app/javascript/src/communication.js","webpack://lionwheel/./app/javascript/src/home.js","webpack://lionwheel/./app/javascript/src/locations.js","webpack://lionwheel/./app/javascript/src/organizations.js","webpack://lionwheel/./app/javascript/src/helpers/organizations/table.js","webpack://lionwheel/./app/javascript/src/searches.js","webpack://lionwheel/./app/javascript/src/visits.js","webpack://lionwheel/./app/javascript/src/routes/routes.js","webpack://lionwheel/./app/javascript/src/routes/route_plan.js","webpack://lionwheel/./app/javascript/src/routes/daily_route_plan.js","webpack://lionwheel/./app/javascript/src/header.js","webpack://lionwheel/./app/javascript/src/drivers/tasks.js","webpack://lionwheel/./app/javascript/src/excel_config.js","webpack://lionwheel/./app/javascript/src/ticket_lists.js","webpack://lionwheel/./app/javascript/src/cookies/cookies_eu.js","webpack://lionwheel/./app/javascript/src/plugin_addons.js","webpack://lionwheel/./app/javascript/packs/application.js","webpack://lionwheel/./app/javascript/src/actions/tasks.js","webpack://lionwheel/./app/javascript/src/chat.js","webpack://lionwheel/./app/javascript/src/helpers/apexcharts.js","webpack://lionwheel/./app/javascript/src/actions/select.js","webpack://lionwheel/./app/javascript/src/helpers/city-street-select.js","webpack://lionwheel/./app/javascript/src/helpers/color-picker.js","webpack://lionwheel/./app/javascript/src/helpers/datatables.js","webpack://lionwheel/./app/javascript/src/helpers/drivers/table.js","webpack://lionwheel/./app/javascript/src/helpers/floating-actions.js","webpack://lionwheel/./app/javascript/src/helpers/images.js","webpack://lionwheel/./app/javascript/src/helpers/metronic/task_offcanvas.js","webpack://lionwheel/./app/javascript/src/helpers/panel_view.js","webpack://lionwheel/./app/javascript/src/helpers/quill.js","webpack://lionwheel/./app/javascript/src/helpers/routes/routes.js","webpack://lionwheel/./app/javascript/src/helpers/scanner.js","webpack://lionwheel/./app/javascript/src/helpers/shopify.js","webpack://lionwheel/./app/javascript/src/helpers/sms_templates.js","webpack://lionwheel/./app/javascript/src/helpers/store_visits/table.js","webpack://lionwheel/./app/javascript/src/helpers/sweetalerts.js","webpack://lionwheel/./app/javascript/src/helpers/tables/checkboxes.js","webpack://lionwheel/./app/javascript/src/helpers/tables/colvis.js","webpack://lionwheel/./app/javascript/src/helpers/tables/filters.js","webpack://lionwheel/./app/javascript/src/helpers/tasks/order_items.js","webpack://lionwheel/./app/javascript/src/helpers/tasks/table.js","webpack://lionwheel/./app/javascript/src/helpers/tasks/view.js","webpack://lionwheel/./app/javascript/src/helpers/tooltips.js","webpack://lionwheel/./app/javascript/src/actions/regions.js","webpack://lionwheel/./app/javascript/src/helpers/visits/common.js","webpack://lionwheel/./app/javascript/src/actions/visits.js","webpack://lionwheel/./app/javascript/src/leaflet-fullscreen.min.js","webpack://lionwheel/./app/javascript/src/leaflet-heat.js","webpack://lionwheel/./app/javascript/src/metronic/js/metronic-custom.js","webpack://lionwheel/./app/javascript/src/metronic/js/pages/custom/profile/profile.js","webpack://lionwheel/./app/javascript/src/shortcuts.js","webpack://lionwheel/./app/javascript/src/tasks.js"],"sourcesContent":["import dayjs from 'dayjs'\nimport advancedFormat from 'dayjs/plugin/advancedFormat'\nimport customParseFormat from 'dayjs/plugin/customParseFormat'\nimport localeData from 'dayjs/plugin/localeData'\nimport weekday from 'dayjs/plugin/weekday'\nimport weekOfYear from 'dayjs/plugin/weekOfYear'\nimport weekYear from 'dayjs/plugin/weekYear'\nimport utc from 'dayjs/plugin/utc'\nimport timezone from 'dayjs/plugin/timezone'\nimport duration from 'dayjs/plugin/duration'\nimport isToday from 'dayjs/plugin/isToday'\nimport isYesterday from 'dayjs/plugin/isYesterday'\n\n(() => {\n switch (gon?.locale?.slice(0, 2)) {\n case 'he': return require('dayjs/locale/he')\n case 'ar': return require('dayjs/locale/ar')\n case 'es': return require('dayjs/locale/es')\n }\n})()\n\ndayjs.extend(customParseFormat)\ndayjs.extend(advancedFormat)\ndayjs.extend(weekday)\ndayjs.extend(localeData)\ndayjs.extend(weekOfYear)\ndayjs.extend(weekYear)\ndayjs.extend(utc)\ndayjs.extend(timezone)\ndayjs.extend(duration)\ndayjs.extend(isToday)\ndayjs.extend(isYesterday)\nif (gon.timezone) dayjs.tz.setDefault(gon.timezone)\n","import {csrfToken, fetchJSON, updateQueryStringParameter} from \"./helpers/utils\";\nimport Pusher from 'pusher-js'\nimport { showNotification } from \"./helpers/notifications\";\nimport { dateOrCurrent, matchStart, timepickerMeridian } from './helpers/date'\nimport {\n getPathFromUrl,\n initDateRangePicker,\n initHoverCopy,\n initPasswordToggle\n} from './helpers/view'\nimport { initColorPicker } from \"./helpers/color-picker\";\nimport { i18n } from \"./helpers/i18n\";\nimport * as Ladda from 'ladda'\nimport { updateFloatingActionsVisibility } from \"./helpers/floating-actions\";\nimport { initTransferConfirmation } from \"./helpers/drivers/confirmations\";\n\n$(() => {\n if (!gon.is_company && gon.pusher) {\n const pusher = new Pusher(gon.pusher.key, {\n cluster: gon.pusher.cluster,\n authEndpoint: \"/pusher_auth\",\n auth: {\n headers: { 'X-CSRF-Token': $('meta[name=\"csrf-token\"]').attr('content') }\n }\n })\n\n if (gon.task_created_notify || gon.task_failed_notify) {\n let xhr;\n\n const initXhr = () => {\n let audioCtx = new (window.AudioContext || window.webkitAudioContext)();\n xhr = new XMLHttpRequest();\n xhr.open('GET', '/wet.ogg');\n xhr.responseType = 'arraybuffer';\n xhr.addEventListener('load', () => {\n audioCtx.decodeAudioData(xhr.response).then((audioBuffer) => {\n let source = audioCtx.createBufferSource();\n source.buffer = audioBuffer;\n source.connect(audioCtx.destination);\n source.loop = false;\n source.start();\n }).catch(e => console.log(e));\n });\n return true\n }\n\n const channel = pusher.subscribe(gon.pusher_channel_name);\n\n if (gon.task_created_notify) {\n channel.bind('task-created', data => {\n showNotification({ message: i18n.t(data.message, { id: data.task_id }) })\n if (initXhr()) xhr?.send();\n })\n }\n\n if (gon.task_failed_notify) {\n channel.bind('task-failed', data => {\n let message = i18n.t(\"views.tasks.task_failed\", { task_url: data.task_url, company: data.company });\n\n const fields = { reason: 'failure_reason', driver: 'driver', driver_note: 'driver_note' };\n message += Object.entries(fields).filter(([key]) => data[key]?.length > 0)\n .map(([key, translation]) => `
${i18n.t(`views.tasks.${translation}`, { data: data[key] })}`).join('');\n\n showNotification({ message: message, type: 'warning', delay: 300000 });\n if (initXhr()) xhr?.send();\n })\n }\n }\n\n $('.calculate-route-btn').on('click', e => {\n e.preventDefault();\n const optimizationChannel = pusher.subscribe('optimization');\n optimizationChannel.bind('optimized', data => {showNotification(data)});\n $(\".calculate-route-btn\").unbind('click').click();\n })\n }\n\n $('.get-qr-code').click(async (e) => {\n e.preventDefault()\n\n const modalContainer = $('#modal-container')\n const id = e.currentTarget.dataset.id\n const url = `/drivers/${id}/qr_code_modal`\n\n await fetch(url,\n {\n headers: { 'X-CSRF-TOKEN': csrfToken() },\n method: 'POST'\n }\n ).then(res => {\n if (res.status === 200) {\n res.text().then((data) => {\n modalContainer.html(data)\n modalContainer.children().modal('show')\n })\n } else {\n showNotification({ message: i18n.t('errors.something_wrong'), type: 'danger' })\n }\n })\n\n Ladda.stopAll()\n })\n\n Ladda.bind('.ladda-button')\n Ladda.bind('.ladda-link-as-btn')\n $('.ladda-link-as-btn').click(e => window.location.href = e.currentTarget.dataset.url)\n\n $('.language-link').on('click', (e) => {\n e.preventDefault()\n let language = e.currentTarget.dataset.language\n window.location.href = updateQueryStringParameter(window.location.href, 'locale', language)\n })\n\n $('.datepicker-validation').change((e) => {\n let input = e.currentTarget\n input.value = dateOrCurrent(input.value)\n }).keyup((e) => {\n if (e.key === 'Enter') {\n e.currentTarget.blur()\n }\n })\n\n $('.select2-init').select2({\n dir: i18n.t('direction'),\n width: '100%',\n matcher: (params, data) => matchStart(params, data)\n })\n\n $('.select2-grouped').select2({\n dir: i18n.t('direction'),\n width: '100%',\n matcher: function(params, data) {\n const original_matcher = $.fn.select2.defaults.defaults.matcher;\n const result = original_matcher(params, data);\n if (result && data.children && result.children && data.children.length !== result.children.length\n && data.text.toLowerCase().includes(params.term)) {\n result.children = data.children;\n }\n return result;\n }\n })\n\n $('.datepicker-date-param').on('change', (e) => {\n const baseUrl = getPathFromUrl(window.location.href)\n window.location.replace(baseUrl + '?date=' + e.target.value)\n })\n\n $('#kt_aside_toggle').on('click', (e) => {\n const isFolded = e.currentTarget.classList.contains('active')\n document.cookie = `is_sidebar_folded=${isFolded ? 'true' : 'false'}`\n })\n\n $('.open-fullscreen').click(() => {\n if (document.fullscreenElement) {\n document.exitFullscreen()\n } else {\n document.documentElement.requestFullscreen()\n }\n })\n\n $('.timepicker-15m-init').timepicker({\n minuteStep: 15,\n defaultTime: null,\n showMeridian: timepickerMeridian(),\n icons: {\n up: 'ki ki-arrow-up',\n down: 'ki ki-arrow-down'\n }\n })\n\n $('.timepicker-15m-init1').timepicker({\n minuteStep: 15,\n showMeridian: false,\n icons: {\n up: 'ki ki-arrow-up',\n down: 'ki ki-arrow-down'\n }\n })\n\n $('.timepicker-1m-init').timepicker({\n minuteStep: 1,\n defaultTime: null,\n showMeridian: timepickerMeridian(),\n icons: {\n up: 'ki ki-arrow-up',\n down: 'ki ki-arrow-down'\n }\n })\n\n initColorPicker($('.colorpicker-init'), (hex, el) => el.style.background = hex)\n\n $('.filter-wrapper .dropdown-menu').click(e => { e.stopPropagation() })\n $('.dropdown-search').on('keyup', (e) => {\n const value = $(e.currentTarget).val().toLowerCase()\n $(e.currentTarget).closest('.dropdown-menu').find('> div, > label').filter((i, el) => {\n $(el).toggle($(el).text().toLowerCase().indexOf(value) > -1)\n })\n })\n\n initHoverCopy()\n\n $('.click-copy').click(e => {\n e.stopPropagation()\n const temp = $(\"\");\n $(\"body\").append(temp);\n temp.val(e.currentTarget.dataset.copy).select();\n document.execCommand(\"copy\");\n temp.remove();\n showNotification({ message: i18n.t('shared.copied_to_clipboard') })\n })\n\n $('.rating-radio').change((e) => {\n const radio = $(e.currentTarget)\n radio.closest('.rating').css('--value', parseFloat(radio.val()))\n })\n\n $('.alphaonly').bind('keyup blur', function () {\n $(this).val(function (i, val) {\n return val.replace(/[^a-z\\d]/gi, '')\n })\n })\n\n $('.without-spaces').on('change', (e) => {\n e.currentTarget.value = e.currentTarget.value.replace(/\\s/g, \"\");\n }).on('keydown', (e) => {\n if (e.which === 32) return false\n })\n\n $('.email-validation').on('change', (e) => {\n e.currentTarget.value = e.currentTarget.value.replace(/[^a-zA-Z0-9@._+&%$-]/g, '')\n })\n\n $('.remove-ltr-chars').on('change', (e) => {\n e.currentTarget.value = e.currentTarget.value.replace(/[\\u200E\\u2066]/g, '')\n });\n\n if (gon.is_organization || gon.is_company) {\n $(document).on('keydown', (e) => {\n if (e.key === 'Escape') { $(\".leaflet-popup-close-button\")[0]?.click() }\n if (e.key === 'F11') {\n e.preventDefault()\n $('#r-new-task a').get(0)?.click()\n // TODO temp code ====================\n $('#r-new-task2 a').get(0)?.click()\n // TODO ==============================\n }\n })\n }\n\n initPasswordToggle()\n\n const scroller = document.querySelector(\".aside-menu\");\n const dropdowns = $(\".menu-custom-submenu\");\n const handleAsideScroll = () => {\n dropdowns.each((_i, el) => {\n const topPosition = el.parentNode.getBoundingClientRect().top\n let offset = 0;\n if (topPosition + el.offsetHeight > window.innerHeight) {\n offset = topPosition + el.offsetHeight - window.innerHeight\n }\n el.style.transform = `translateY(-${scroller.scrollTop + 5 + offset}px)`\n })\n }\n if (scroller) scroller.addEventListener(\"scroll\", handleAsideScroll)\n\n $('.has-custom-submenu').on('click', (e) => {\n const $el = $(e.currentTarget)\n $el.addClass('active')\n $('.has-custom-submenu:not(.active)').removeClass('custom-submenu-open')\n $el.removeClass('active')\n handleAsideScroll()\n $(e.currentTarget).toggleClass('custom-submenu-open')\n })\n\n $(document).on('click', (e) => {\n if (!$(e.target).closest('.has-custom-submenu').length) {\n $('.has-custom-submenu').removeClass('custom-submenu-open')\n }\n })\n\n $(\".transfer-confirm-form button[type='submit']\").on('click', (e) => {\n if (!gon.confirm_task_transfers) return;\n\n const form = $(e.currentTarget).closest('form');\n\n (async () => {\n const driverId = $('.transfer-confirm-form .transfer-driver').val()\n const orgDrivers = await fetchJSON(`/api/web/organizations/drivers`, 'POST', JSON.stringify({ ids: gon.driver_ids_to_load || [] }))\n const driver = driverId ? orgDrivers.find(d => d.id === parseInt(driverId)) : null\n\n if (driver?.partner_bridge_id) {\n e.preventDefault()\n initTransferConfirmation(driverId, {},\n (transferDetails) => {\n $('.transfer-confirm-form-details').val(JSON.stringify(transferDetails))\n form.submit()\n },\n () => { Ladda.stopAll()}\n )\n } else {\n form.submit()\n }\n })();\n\n e.preventDefault()\n })\n\n $('.images-only-input').on('change', (e) => {\n Array.from(e.currentTarget.files).forEach((file) => {\n if (!file.type.match('image/png') && !file.type.match('image/gif') && !file.type.match('image/jpeg')) {\n showNotification({ message: i18n.t('shared.only_images_allowed'), type: 'danger' })\n e.currentTarget.value = ''\n }\n })\n })\n\n $('.mobile-overlay-close .navi-link').on('click', () => { $('.offcanvas-mobile-overlay').click() })\n\n $('.stop-propagation').on('click', (e) => e.stopPropagation())\n $('.users-mobile-toggle').on('click', () => { $('.users-mobile-dropdown').toggleClass('show') })\n\n $('.dropdown-no-close').on('hide.bs.dropdown', (e) => {\n if ($.contains(e.currentTarget, e.clickEvent?.target)) e.preventDefault()\n })\n\n $('[data-toggle=\"tooltip\"]').tooltip()\n\n initDateRangePicker($('.daterangepicker-init'))\n\n // disable value change by scroll\n $('form').on('wheel', 'input[type=number]', (e) => { $(e.currentTarget).blur() })\n\n $('.load-modal-link').on('click', async (e) => {\n const { url, method } = e.currentTarget.dataset\n\n const modalContainer = $('#modal-container')\n const loader = $('.data-preloader')\n loader.removeClass('d-none')\n\n await fetch(url, {\n method: method,\n headers: { 'X-CSRF-TOKEN': csrfToken(), }\n }).then(res => res.text()).then(html => {\n modalContainer.html(html)\n const modal = modalContainer.children()\n\n loader.addClass('d-none')\n modal.modal('show')\n })\n })\n\n $('.company-new-task-btn').on('click', e => {\n e.preventDefault()\n $('#r-new-task a').get(0)?.click()\n // TODO temp code ====================\n $('#r-new-task2 a').get(0)?.click()\n // TODO ==============================\n })\n\n // TODO - need to find where used and remove by possibility\n $('.bulk-visit-checkbox').on('change', () => {\n const selectedCount = $('.bulk-visit-checkbox').filter(':checked').length\n updateFloatingActionsVisibility(selectedCount)\n })\n\n $('.hide-section-on-empty').each((i, el) => {\n const target = $(el.dataset.target)\n if (!$.trim(target.html())) $(el).addClass('d-none')\n })\n})\n","import { isRTL } from './helpers/locale'\n\n$(() => {\n const toggleSideBarButton = document.querySelector('.menu-toggler.responsive-toggler')\n const sideBar = document.querySelector('.page-sidebar.navbar-collapse')\n const pageContent = document.querySelector('.page-content')\n const pageFooter = document.querySelector('.page-footer')\n if (sideBar && window.innerWidth > 991) {\n sideBar.classList.add('in')\n }\n\n if (toggleSideBarButton) {\n toggleSideBarButton.onclick = function() {\n if (window.innerWidth > 991) {\n if (sideBar.classList.contains('in')) {\n if (isRTL()) {\n setTimeout(() => {\n pageContent.style.setProperty('margin-right', 0, 'important')\n pageFooter.style.setProperty('margin-right', 0, 'important')\n }, 300)\n } else {\n setTimeout(() => {\n pageContent.style.marginLeft = 0\n pageFooter.style.marginLeft = 0\n }, 300)\n }\n } else {\n if (isRTL()) {\n pageContent.style.marginRight = '235px'\n pageFooter.style.marginRight = '235px'\n } else {\n pageContent.style.marginLeft = '235px'\n pageFooter.style.marginLeft = '235px'\n }\n }\n }\n }\n }\n\n $(document).keyup(function(e) {\n if (e.key === \"Escape\" && $('button.close')) $('button.close').click()\n })\n})\n","import { i18n } from \"../i18n\";\nimport {renderSmallAjaxStatus, tooltipsTaskLink} from '../view'\nimport { updateTaskStatus } from '../../actions/tasks'\nimport {\n initVisitDriversSelect,\n initVisitPickUpAtDatepicker\n} from '../visits/common'\nimport {isRTL} from \"../locale\";\nimport {formattedDate, getDateFormat, getFormattedDate, formattedTime} from \"../date\";\nimport {search} from \"../datatables\";\nimport moment from \"moment\";\nimport { setUpTaskPanelView } from \"../panel_view\";\nimport { filterValues, initServerFilter } from \"../tables/filters\";\n\nexport const renderExtendedVisitsTable = () => {\n const operatorTable = $('#operator-visits-extended-table2').DataTable({\n drawCallback: () => {\n setUpTaskPanelView();\n $('.input-group.allow-past').datepicker({\n format: getDateFormat(),\n language: i18n.t('locale'),\n rtl: isRTL(),\n orientation: 'bottom',\n defaultDate: getFormattedDate(),\n autoclose: true,\n todayHighlight: true\n }).on('hide', e => e.stopPropagation())\n $('.visit-drivers-select2:not([data-select2-id^=\"select2\"])').each((i, d) => initVisitDriversSelect(d, () => {}, \"100px\"))\n initVisitPickUpAtDatepicker($('.visit-extended-pickup-date'))\n initVisitPickUpAtDatepicker($('.visit-extended-delivery-date'))\n initVisitPickUpAtDatepicker($('.visit-extended-return-date'))\n $('[data-toggle=\"tooltip\"]').tooltip()\n\n $('.task-set-status').off('click').on('click', (e) => {\n const taskId = e.currentTarget.dataset.taskId\n const status = e.currentTarget.dataset.newStatus\n updateTaskStatus(taskId, status)\n })\n },\n initComplete: (settings, json) => {\n $('.tasks-count').text(json.recordsTotal)\n },\n bInfo: false,\n dom: '<\"top\"i>rtp<\"bottom\"><\"clear\">',\n processing: true,\n serverSide: true,\n lengthChange: false,\n pageLength: gon.pagination_size,\n language: {\n processing: '',\n zeroRecords: i18n.t('zero_records'),\n search: i18n.t('search'),\n infoEmpty: i18n.t('info_empty'),\n lengthMenu: i18n.t('length_menu'),\n info: i18n.t('paginate.info'),\n infoFiltered: i18n.t('info_filtered'),\n paginate: {\n first: i18n.t('paginate.first'),\n last: i18n.t('paginate.last'),\n next: i18n.t('paginate.next'),\n previous: i18n.t('paginate.previous')\n }\n },\n ajax: {\n url: 'index_extended_data',\n type: 'POST'\n },\n responsive: true,\n order: [[1, 'asc']],\n columns: [\n {\n data: 'id',\n render: (_data, _type, row) => {\n const taskId = row.task_id;\n return `\n
\n ${taskId}\n
\n
`\n }\n },\n {\n name: 'created_at',\n data: 'created_at',\n render: (_data, _type, row) => (`${formattedDate(row.created_at)} ${formattedTime(row.created_at)}`)\n },\n {\n name: 'company_name',\n data: 'company_name',\n render: (_data, _type, row) => (`${row.company_name}`)\n },\n {\n name: 'status',\n data: 'status',\n title: i18n.t('models.task.status'),\n render: (data, type, row) => (\n renderSmallAjaxStatus(row.status, row.task_id, row.is_roundtrip, gon.allow_inventory)\n )\n },\n {\n name: 'urgency',\n data: 'urgency',\n render: (_data, _type, row) => (`${gon.allow_urgency ? row.urgency : ''}`),\n createdCell: (td, _cellData, row) => $(td).css('background-color', row.urgency_color)\n },\n {\n data: 'pickup',\n defaultContent: '',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.pickup) {\n return row.pickup.name\n }\n },\n createdCell: (td, cellData, rowData) => {\n if (rowData.pickup && rowData.pickup.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'pickup',\n defaultContent: '',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.pickup) {\n return row.pickup.city\n }\n },\n createdCell: (td, cellData, rowData) => {\n if (rowData.pickup && rowData.pickup.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'pickup',\n defaultContent: '',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.pickup) {\n return row.pickup.location\n }\n },\n createdCell: (td, cellData, rowData) => {\n if (rowData.pickup && rowData.pickup.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'pickup',\n defaultContent: '',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.pickup) {\n return row.pickup.region_name\n }\n },\n createdCell: (td, cellData, rowData) => {\n if (rowData.pickup && rowData.pickup.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'pickup',\n defaultContent: '',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.pickup) {\n return `
\n \n
\n
`\n }\n },\n createdCell: (td, cellData, rowData) => {\n if (rowData.pickup && rowData.pickup.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'pickup',\n defaultContent: '',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.pickup) {\n return `\n `\n }\n },\n createdCell: function (td, cellData, rowData) {\n if (rowData.pickup && rowData.pickup.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'delivery',\n defaultContent: '',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.delivery) {\n return row.delivery.name\n }\n },\n createdCell: (td, cellData, rowData) => {\n if (rowData.delivery && rowData.delivery.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'delivery',\n defaultContent: '',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.delivery) {\n return row.delivery.city\n }\n },\n createdCell: (td, cellData, rowData) => {\n if (rowData.delivery && rowData.delivery.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'delivery',\n defaultContent: '',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.delivery) {\n return row.delivery.location\n }\n },\n createdCell: (td, cellData, rowData) => {\n if (rowData.delivery && rowData.delivery.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'delivery',\n defaultContent: '',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.delivery) {\n return row.delivery.region_name\n }\n },\n createdCell: (td, cellData, rowData) => {\n if (rowData.delivery && rowData.delivery.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'delivery',\n orderable: false,\n width: '78px',\n render: (_data, _type, row) => {\n if (row.delivery) {\n return `
\n \n
\n
`\n }\n },\n createdCell: (td, cellData, rowData) => {\n if (rowData.delivery && rowData.delivery.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n name: 'driver',\n data: 'delivery',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.delivery) {\n return `\n `\n }\n },\n createdCell: function (td, cellData, rowData) {\n if (rowData.delivery && rowData.delivery.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'return',\n defaultContent: '',\n orderable: false,\n width: '78px',\n render: (_data, _type, row) => {\n if (row.return) {\n return `
\n \n
\n
`\n }\n },\n createdCell: (td, cellData, rowData) => {\n if (rowData.return && rowData.return.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n data: 'return',\n defaultContent: '',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.return) {\n return `\n `\n }\n },\n createdCell: function (td, cellData, rowData) {\n if (rowData.return && rowData.return.delivered_at) {\n $(td).css('background-color', '#82f182')\n }\n }\n },\n {\n name: 'completed_at',\n data: 'completed_at',\n orderable: false,\n render: (_data, _type, row) => {\n if (row.completed_at) {\n return `${formattedDate(row.completed_at)} ${formattedTime(row.completed_at)}`;\n }\n }\n },\n {\n name: 'is_roundtrip',\n data: 'is_roundtrip',\n orderable: false,\n },\n {\n name: 'money_collect',\n data: 'money_collect',\n orderable: false,\n }\n ]\n })\n $('.table-search').on('keyup', e => {\n if (e.keyCode === 13) { search(operatorTable)(e) }\n })\n\n operatorTable.on('draw', () => {\n const body = $(operatorTable.table().body())\n\n body.unhighlight()\n body.highlight(operatorTable.search())\n })\n\n initFilters(operatorTable)\n}\n\nconst initFilters = (table) => {\n initServerFilter($('input[name=filterStatus]'))\n initServerFilter($('input[name=filterDriver]'))\n initServerFilter($('input[name=filterCompany]'))\n initServerFilter($('input[name=filterUrgency]'))\n\n const filterDate = $('.date-filter').datepicker({\n format: getDateFormat(),\n language: i18n.locale,\n orientation: 'bottom',\n rtl: isRTL(),\n autoClose: true,\n todayHighlight: true,\n clearBtn: true\n })\n\n $('#apply-filters').click(e => {\n e.preventDefault()\n let searchObj\n const searchArr = []\n\n searchArr.push({name: 'status', data: filterValues($('.status-filter input'))})\n searchArr.push({name: 'company_name', data: filterValues($('.company-filter input'))})\n searchArr.push({name: 'driver', data: filterValues($('.driver-filter input'))})\n\n if ($('.urgency-filter').length) {\n searchArr.push({name: 'urgency', data: filterValues($('.urgency-filter input'))})\n }\n\n const date = filterDate.datepicker('getDate')\n searchArr.push({ name: 'created_at', data: date ? [moment(date).format('YYYY-MM-DD')] : [] })\n\n searchArr.forEach(obj => searchObj = table.column(`${obj.name}:name`).search(obj.data.join()))\n searchObj && searchObj.draw()\n })\n}\n","import { dataOrNA, getPropertyByPath } from \"../utils\";\nimport { i18n } from \"../i18n\";\nimport { columnIndexByName } from \"./table\";\nimport { ADDRESS_PRECISIONS } from \"../visits/common\";\nimport { initFilter } from \"../tables/filters\";\n\nexport const initStoreVisitFilters = (table, data) => {\n const recountFilters = () => {\n recountStoreVisitFilters(table)\n const filteredData = table.rows({ filter: 'applied' }).data().toArray();\n gon.task_ids = filteredData.map((row) => row['task']['id']).join(',');\n }\n\n const initCustomFilter = (inputs, name) => { initFilter(inputs, table, columnIndexByName(table, name), recountFilters) }\n\n const filters = filtersData(data)\n\n filters.forEach((f) => {\n const filterOptions = optionsFunctions[f.optionsFunction || 'initOptions'](f.options(data), f.name, f.NA)\n $(`.filter-wrapper[data-filter-name='${f.name}'] .filter-options`).append(filterOptions)\n initCustomFilter($(`input[name=${f.name}]`), f.columnName)\n })\n}\n\nexport const recountStoreVisitFilters = (table) => {\n const appliedFilters = {}\n table.columns().every((index) => {\n const column = table.column(index)\n if (column.search()) appliedFilters[column.name()] = column.search()\n })\n\n const filterNames = Object.keys(appliedFilters)\n const filteredData = table.rows({ filter: 'applied' }).data().toArray()\n\n filtersData(filteredData).forEach(filter => {\n if (filterNames.includes(filter.columnName)) {\n table.column(columnIndexByName(table, filter.columnName)).search('')\n const data = table.rows({ filter: 'applied' }).data().toArray()\n recountFilter(filter.name, new Map(filter.options(data).map((o) => [o.value, o.count])))\n table.column(columnIndexByName(table, filter.columnName)).search(appliedFilters[filter.columnName])\n } else {\n recountFilter(filter.name, new Map(filter.options(filteredData).map((o) => [o.value, o.count])))\n }\n })\n}\n\nconst recountFilter = (name, optionsMap) => {\n $(`.${name}-label`).each((_i, el) => {\n const $el = $(el)\n const value = $el.find('input').val().replace(/\"/g, '"')\n $el.find('.filter-option-count').text(optionsMap.has(value) ? optionsMap.get(value) : 0)\n })\n}\n\nconst optionsFunctions = {\n initOptions: (options, name, NA = null) => (\n options.reduce((acc, option) => (\n acc + `\n \n `\n ), '')\n ),\n initStatusOptions: (statuses, name) => (\n statuses.reduce((acc, status) => {\n if (!gon.allow_inventory && (status.value === \"IN_INVENTORY\" || status.value === \"OUT_INVENTORY\" || status.value === \"IN_TRANSFER\")) return acc\n\n return acc + `\n \n `\n }, '')\n ),\n initTimeWindowOptions: (timeWindows, name, NA = null) => (\n timeWindows.reduce((acc, timeWindow) => {\n return acc + `\n \n `\n }, '')\n ),\n initUrgencyOptions: (options, name) => (\n options.reduce((acc, option) => {\n return acc + `\n \n `\n }, '')\n )\n}\n\nconst options = (visits, name, dataModifier = (option) => (option)) => (\n [...(new Set(visits.map(visit => dataOrNA(dataModifier(getPropertyByPath(visit, name))))))].map(j => {\n return {\n value: j.replace(/\"/g, '"'),\n count: visits.filter(v => (dataOrNA(dataModifier(getPropertyByPath(v, name))) === j)).length\n }\n }).sort((a, b) => b.count - a.count)\n)\n\nconst booleanOptions = (visits, name, trueValue, falseValue) => (\n [true, false].map(value => ({\n value: value ? trueValue : falseValue,\n count: visits.filter(v => (!!getPropertyByPath(v, name) === value)).length\n }))\n)\n\nconst optionsDriver = (visits, drivers) => {\n const driverNames = drivers.map(d => d.full_name)\n const externalServices = [...new Set(visits.map(v => v.task.ext_service_name))].filter(v => v)\n\n let arr = [...driverNames, ...externalServices].map(name => {\n return {\n value: name.replace(/\"/g, '"'),\n count: visits.filter(i => ((i.driver_name || i.task.ext_service_name) === name)).length\n }\n })\n\n // To keep Unassigned on the top; sort first and then unshift to add unassigned option\n arr.sort((a, b) => b.count - a.count)\n arr.unshift({ value: '', count: visits.filter(v => ((!v.driver_id || v.driver_id === '') && !v.task.ext_service_name)).length })\n return arr\n}\n\nconst optionsStatus = (visits, statuses) => (\n Object.entries(statuses).map(s => {\n return {\n value: i18n.t(`models.task.status_enum.${s[0]}`),\n count: visits.filter(i => (i.task.status === s[0])).length\n }\n })\n)\n\nconst optionsPickStatus = (visits) => (\n [\"NEW\", \"PENDING\", \"PICKED\", \"PARTIALLY_PICKED\"].map(s => {\n return {\n value: i18n.t(`models.task.pick_status_enum.${s}`),\n count: visits.filter(i => (i.task.pick_status === s)).length\n }\n })\n)\n\nconst optionsTimeWindow = (visits) => (\n [...(new Set(visits.map(visit => ((visit['earliest_time'] || visit['latest_time']) ? `${visit['earliest_time'] || ''} - ${visit['latest_time'] || ''}` : '')).filter(i => (i != null))))].sort().map(j => {\n return {\n value: j,\n count: visits.filter(v => (((v['earliest_time'] || v['latest_time']) ? `${v['earliest_time'] || ''} - ${v['latest_time'] || ''}` : '') === j)).length\n }\n })\n)\n\nconst optionsValidation = (visits) => {\n const validationOptions = ['REJECTED', 'ACCEPTED', 'RESCHEDULED', 'GEO_CHANGED'].map(v => ({ name: i18n.t(`models.task.validation_status_enum.${v}`), value: v }))\n validationOptions.push({ name: i18n.t('shared.no_data'), value: '' })\n return validationOptions.map(o => {\n return {\n value: o.name,\n count: visits.filter(v => (dataOrNA(v.task.validation_status) === o.value)).length\n }\n })\n}\n\nconst optionsRoute = (visits) => {\n let arr = [...(new Set(visits.map(visit => (visit.route?.name)).filter(i => (i != null))))].map(route => ({\n value: route,\n count: visits.filter(v => v.route.name === route).length\n }))\n\n arr.sort((a, b) => b.count - a.count)\n arr.unshift({ value: '', count: visits.filter(i => (!i.route?.name || i.route?.name === '')).length })\n return arr;\n}\n\nconst optionsUrgency = (visits) => (\n [\"REGULAR\", \"URGENT\", \"SUPER_URGENT\"].map(u => {\n return {\n value: i18n.t(`models.task.urgency_enum.${u}`),\n count: visits.filter(i => (i.task.urgency === u)).length\n }\n })\n)\n\nconst addressPrecisionOptions = (visits) => (\n Object.entries(ADDRESS_PRECISIONS).map(([value, precision]) => ({\n value: precision.name(),\n count: visits.filter(v => (v.precision_status === value)).length\n }\n ))\n)\n\nconst destinationZipCodes = (visits) => {\n const deliveryVisits = visits.filter(visit => visit.kind == 'DELIVERY');\n return [...(new Set(deliveryVisits.map(visit => dataOrNA(visit['zip_code']) )))].map(j => {\n return {\n value: j.replace(/\"/g, '"'),\n count: visits.filter(v => (dataOrNA(getPropertyByPath(v, 'zip_code')) === j)).length\n }\n }).sort((a, b) => b.count - a.count)\n}\n\nconst destinationNames = (visits) => {\n const deliveryVisits = visits.filter(visit => visit.kind == 'DELIVERY');\n const otherVisitsCount = visits.filter(visit => visit.kind != 'DELIVERY').length;\n return [...(new Set(deliveryVisits.map(visit => dataOrNA(visit['location_name']) )))].map(j => {\n var count = visits.filter(v => (dataOrNA(getPropertyByPath(v, 'location_name')) === j)).length;\n return {\n value: j,\n count: j.length == 0 ? (count + otherVisitsCount) : count\n }\n }).sort((a, b) => b.count - a.count)\n}\n\nconst filtersData = () => [\n {\n name: 'filterCity',\n columnName: 'city',\n options: (data) => options(data, 'city'),\n NA: i18n.t('operator.tasks.no_city')\n },\n {\n name: 'filterCompany',\n columnName: 'company',\n options: (data) => options(data, 'company_name'),\n NA: i18n.t('shared.no_available_short')\n },\n {\n name: 'filterRegion',\n columnName: 'region',\n options: (data) => options(data, 'region_str'),\n NA: i18n.t('shared.no_available_short')\n },\n {\n name: 'filterLoaded',\n columnName: 'loaded',\n options: (data) => booleanOptions(data, 'loaded', i18n.t('yes_str'), i18n.t('no_str'))\n },\n {\n name: 'filterSelfPickup',\n columnName: 'self_pickup',\n options: (data) => booleanOptions(data, 'task.is_self_pickup', i18n.t('yes_str'), i18n.t('no_str'))\n },\n {\n name: 'filterStatus',\n columnName: 'status',\n options: (data) => optionsStatus(data, gon.statuses),\n optionsFunction: 'initStatusOptions'\n },\n {\n name: 'filterDriver',\n columnName: 'driver',\n options: (data) => optionsDriver(data, gon.org_drivers.filter(d => d.active === true)),\n NA: i18n.t('views.operator.no_assignment')\n },\n {\n name: 'filterTimeWindow',\n columnName: 'time_window',\n options: (data) => optionsTimeWindow(data),\n optionsFunction: 'initTimeWindowOptions',\n NA: i18n.t('shared.no_available_short')\n },\n {\n name: 'filterPickStatus',\n columnName: 'pick_status',\n options: (data) => optionsPickStatus(data)\n },\n {\n name: 'filterValidation',\n columnName: 'validation',\n options: (data) => optionsValidation(data)\n },\n {\n name: 'filterRoute',\n columnName: 'route',\n options: (data) => optionsRoute(data),\n NA: i18n.t('views.operator.no_assignment')\n },\n {\n name: 'filterUrgency',\n columnName: 'urgency',\n options: (data) => optionsUrgency(data),\n optionsFunction: 'initUrgencyOptions'\n },\n {\n name: 'filterAmbiguousLocation',\n columnName: 'precision_status',\n options: (data) => addressPrecisionOptions(data),\n },\n {\n name: 'filterSignatureUrl',\n columnName: 'signature_url',\n options: (data) => booleanOptions(data, 'task.signature_url', i18n.t('yes_str'), i18n.t('no_str'))\n },\n {\n name: 'filterPhotoAttached',\n columnName: 'is_photo_attached',\n options: (data) => booleanOptions(data, 'task.is_photo_attached', i18n.t('yes_str'), i18n.t('no_str'))\n },\n {\n name: 'filterZipCode',\n columnName: 'zip_code',\n options: (data) => destinationZipCodes(data)\n },\n {\n name: 'filterTaskType',\n columnName: 'task_type',\n options: (data) => options(data, 'task.task_type', (type) => (type ? i18n.t(`views.tasks.types.${type}`) : '')),\n NA: i18n.t('shared.empty')\n },\n {\n name: 'filterDeliveryMethod',\n columnName: 'delivery_method',\n options: (data) => options(data, 'task.delivery_method'),\n NA: i18n.t('shared.empty')\n },\n {\n name: 'filterLeaveNextToDoor',\n columnName: 'leave_next_to_door',\n options: (data) => booleanOptions(data, 'task.leave_next_to_door', i18n.t('yes_str'), i18n.t('no_str'))\n },\n {\n name: 'filterDestinationName',\n columnName: 'location_name',\n options: (data) => destinationNames(data),\n NA: i18n.t('shared.empty')\n },\n {\n name: 'filterOriginPartnerCompany',\n columnName: 'origin_partner_company',\n options: (data) => options(data, 'task.origin_partner_company'),\n NA: i18n.t('shared.empty')\n },\n {\n name: 'filterTargetPartnerStatus',\n columnName: 'target_partner_task_status',\n options: (data) => options(data, 'task.target_partner_task_status'),\n NA: i18n.t('shared.empty')\n },\n {\n name: 'filterVehicleKind',\n columnName: 'vehicle_kind',\n options: (data) => options(data, 'task.vehicle_kind', (kind) => (kind ? i18n.t(`models.task.vehicle_kind_enum.${kind}`) : '')),\n NA: i18n.t('shared.empty')\n },\n {\n name: 'filterPrintedAt',\n columnName: 'printed_at',\n options: (data) => booleanOptions(data, 'printed_at', i18n.t('yes_str'), i18n.t('no_str'))\n },\n {\n name: 'filterSmsSent',\n columnName: 'sms',\n options: (data) => booleanOptions(data, 'task.sms_amount', i18n.t('yes_str'), i18n.t('no_str'))\n },\n ...extraToFilters(gon.custom_fields)\n]\n\nconst extraToFilters = (customFields) => (\n customFields.map((field) => ({\n name: `filter${field.name.replace(/['\"`()[\\] ]/g, '')}`,\n columnName: field.name.replace(/['\"`()[\\] ]/g, ''),\n options: (data) => options(data, `task.extra.${field.name}`, (value) => (value?.toString())),\n NA: i18n.t('shared.empty')\n }))\n)\n\nexport const currentFilters = () => (\n $('.filter-checkbox:checked').map((i, el) => ({ name: el.name, value: el.value })).get()\n)\n\nexport const applyFilters = (filters) => {\n const loader = $('.data-preloader')\n loader.removeClass('d-none')\n\n filters.forEach((filter) => {\n const name = $.escapeSelector(filter.name)\n const value = $.escapeSelector(filter.value)\n $(`.filter-checkbox[name=${name}][value='${value}']:not(:checked)`).click()\n $(`.filter-checkbox[name=${name}][value='${value}']`).addClass('applied')\n })\n\n $('.filter-checkbox:checked:not(.applied)').each((_i, el) => { $(el).click() })\n $('.applied').removeClass('applied')\n loader.addClass('d-none')\n}\n","import * as Ladda from 'ladda'\nimport \"leaflet-lasso\";\nimport { formattedDate, getDateFormat, getFormattedDate, timepickerMeridian } from './helpers/date'\nimport {\n initDateRangePicker,\n initPanelMapMoving,\n initSidePanel,\n renderPickStatusAjax,\n renderSmallAjaxStatus\n} from './helpers/view'\nimport { renderExtendedVisitsTable } from './helpers/visits_extended/table'\nimport { isRTL } from './helpers/locale'\nimport { renderStoreVisitsTable } from './helpers/store_visits/table'\nimport { initMap, decodePolyline } from './services/map'\nimport {\n ambiguousMarkerAddition,\n buildMarkers,\n drawLinePolygons,\n enableDrawTool,\n numberedSvgMarker,\n transformCoords\n} from './helpers/leaflet'\nimport {\n initRoutesSelect,\n initTaskDriversSelect,\n initTaskPickUpAtDatepicker,\n initVisitDriversSelect\n} from './helpers/visits/common'\nimport {\n csrfToken,\n getParameterByName,\n selectedIds,\n updateQueryStringParameter,\n initEscButtonEvent,\n fetchJSON\n} from './helpers/utils'\nimport { adjustTableSpaceWithMap, defaultTranslations } from \"./helpers/datatables\";\nimport { checkedSet, setFocusOnSearchBoxForCompanies } from \"./tasks\";\nimport { applyFilters, currentFilters, initStoreVisitFilters } from './helpers/store_visits/filters'\nimport { initTable } from './helpers/drivers/table'\nimport { orderItemsSummaryModal, showOrderItemsSummaryModal } from './helpers/tasks/order_items'\nimport { showNotification } from \"./helpers/notifications\";\nimport { i18n } from \"./helpers/i18n\";\nimport { enableScanner } from \"./helpers/scanner\";\nimport { handleTaskPickStatusModal, updateTaskPickStatus, updateTaskStatus } from \"./actions/tasks\";\nimport { updateFloatingActionsVisibility } from \"./helpers/floating-actions\";\nimport Swal from \"sweetalert2/dist/sweetalert2\";\nimport { showSweetAlertMessage } from \"./helpers/sweetalerts\";\nimport { constructFancyInfoWindowContent } from \"./helpers/visits/popups\";\nimport { setUpTaskPanelView, setupMapPanelViewLink } from \"./helpers/panel_view\";\nimport { ARROWHEADS_OPTIONS, POLYLINE_OPTIONS } from \"./constants/index\";\nimport { openWoltModal } from \"./helpers/external_deliveries/wolt\";\nimport { openGettModal } from \"./helpers/external_deliveries/gett\";\nimport { openGetPackageModal } from \"./helpers/external_deliveries/get_package\";\nimport { initCreateRouteModal } from \"./helpers/routes/routes\";\n\n$(async () => {\n const body = $('body')\n if (body.hasClass('public_pages task_info')) return\n\n let renderedVisits = []\n let visitProxyObjects = new Map()\n window.visitProxyObjects = visitProxyObjects\n\n if (body.hasClass('operator visits_extended')) {\n renderExtendedVisitsTable()\n setFocusOnSearchBoxForCompanies();\n }\n\n const initStoreVisitsPage = ({ sum_str }) => {\n $('.packages-summary').text(sum_str)\n\n $('.bulk-duplicate').click(() => {\n $('.task_ids').val([...checkedSet].join(','))\n $('#bulk-duplicate-modal').modal('show')\n })\n\n $('.archive-tasks-bulk-btn').on('click', () => {\n const tasksCount = checkedSet.size\n $('.archive.task_ids').val([...checkedSet].join(','))\n $('.will-archived').text(i18n.t('move_all_to_recycle_bin', { count: tasksCount }))\n })\n\n $('.operator-bulk-sync-shop').click(e => {\n e.preventDefault()\n const $form = $(e.target).closest('form')\n $form.find('#task_ids').val([...checkedSet].join(','))\n Swal.fire({\n text: i18n.t('views.shopify.bulk_confirmation'),\n icon: \"warning\",\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn font-weight-bold btn-primary',\n cancelButtonClass: 'btn btn-grey',\n confirmButtonText: i18n.t('views.update_pricing.bulk_btn_yes'),\n cancelButtonText: i18n.t('views.update_pricing.bulk_btn_no')\n }).then((result) => {\n if (result.isConfirmed) {\n $form.submit()\n } else {\n Ladda.stopAll()\n }\n })\n })\n\n let storeVisitsTable = null\n let storeVisitsMap = null\n const mapContainer = document.getElementById('store_visits_map')\n if (mapContainer) {\n storeVisitsMap = initMap(mapContainer, mapCallback(renderedVisits))\n L.control.lasso({ title: i18n.t('lasso_btn'), position: \"topleft\", intersect: false }).addTo(storeVisitsMap);\n storeVisitsTable = renderStoreVisitsTable(visitProxyObjects, storeVisitsMap)\n } else {\n storeVisitsTable = renderStoreVisitsTable(visitProxyObjects)\n }\n\n initStoreVisitFilters(storeVisitsTable, gon.full_visits)\n\n $('#store-visits-excel').on('submit', (e) => {\n const columnNames = storeVisitsTable.columns().names().toArray()\n const visibleColumnsIndexes = storeVisitsTable.columns().visible().toArray()\n const visibleColumns = columnNames.filter((name, index) => (\n visibleColumnsIndexes[index] && !$(storeVisitsTable.column(index).header()).hasClass('d-none')\n ))\n $('#excel-columns').val(visibleColumns.join(','))\n\n const visitIds = storeVisitsTable.rows({ filter: 'applied' }).data().toArray().map(v => v.visit_id)\n $('#excel-visit-ids').val(visitIds.join(','))\n })\n\n const handleTableSpace = () => { adjustTableSpaceWithMap(storeVisitsTable, $('#store_visits_map'), 3) }\n\n storeVisitsTable.on('column-visibility.dt', () => { handleTableSpace() })\n\n const mapPanel = $(\".offcanvas-custom\")\n if (mapPanel.length) {\n const onPanelOpen = () => { setTimeout(() => { markersRebuild(storeVisitsMap, renderedVisits) }, 50) }\n initSidePanel(mapPanel, '.offcanvas-resize-toggle', onPanelOpen, handleTableSpace)\n initPanelMapMoving(992, () => { markersRebuild(storeVisitsMap, renderedVisits) })\n }\n\n handleTableSpace()\n\n const kind = getParameterByName('kind')\n if (kind) {\n const kind_text = i18n.t(`models.visit.kind_enum.${kind}`)\n document.querySelector(`[value=${kind_text}]`).click()\n }\n\n $(document).on('storeVisitsWereUpdated', (_e, { visits }) => {\n renderedVisits = visits\n if (mapContainer) markersRebuild(storeVisitsMap, renderedVisits)\n })\n\n applyFilters(JSON.parse(sessionStorage.getItem('store_visit_filters')) || [])\n }\n\n if (body.hasClass('operator store_visits')) {\n $('.suggestion-timepicker').timepicker({\n minuteStep: 15,\n showMeridian: timepickerMeridian(),\n icons: {\n up: 'ki ki-arrow-up',\n down: 'ki ki-arrow-down'\n }\n })\n\n initDateRangePicker($('.daterangepicker-init'))\n\n const loader = $('.data-preloader')\n loader.removeClass('d-none')\n const res = await fetch('/operator/store_visits_ajax', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ visit_ids: gon.visit_ids })\n }).catch(() => {\n showNotification({ message: i18n.t('shared.something_went_wrong'), type: 'danger' })\n loader.addClass('d-none')\n })\n\n if (res?.status === 200) {\n const result = await res.json()\n gon.full_visits = result.visits\n const orgDrivers = await fetchJSON(`/api/web/organizations/drivers`, 'POST', JSON.stringify({ ids: gon.driver_ids_to_load || [] }))\n gon.org_drivers = orgDrivers\n gon.task_ids = result.task_ids.join(',')\n renderedVisits = result.visits\n $('#order-items-table').data('taskIds', result.task_ids.join(','))\n initStoreVisitsPage(result)\n loader.addClass('d-none')\n }\n\n $('.clear-time-windows').click(e => {\n e.preventDefault();\n\n Swal.fire({\n title: i18n.t('shared.are_you_sure'),\n text: i18n.t('models.task.tm_delete_warning'),\n icon: 'warning',\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn btn-danger',\n confirmButtonText: i18n.t('views.routes.delete.confirm'),\n cancelButtonText: i18n.t('cancel'),\n cancelButtonClass: 'btn btn-grey'\n }).then(async (result) => {\n if (result.isConfirmed) {\n $('#clear_time_windows_ids').val(selectedIds(visitProxyObjects).join(','));\n $(e.target).closest('form').submit()\n }\n })\n })\n\n $('.select-all-vehicles').on('click', (e) => {\n $('.vehicle-checkbox').prop('checked', $(e.currentTarget).prop('checked'))\n })\n\n $('#use_volume_constraint, #use_weight_constraint').on('change', () => {\n $('.vehicle-checkbox').trigger('change')\n })\n\n $('#regions_toggle').click(() => { $('.leaflet-region-polygon').toggleClass('d-none')} )\n\n $('.bulk-send-to-gett').on('click', () => {\n const taskIds = [...checkedSet].join(',')\n openGettModal(taskIds, null, () => { window.location.reload() })\n })\n\n $('.bulk-send-to-wolt').on('click', () => {\n const taskIds = [...checkedSet].join(',')\n openWoltModal(taskIds, null, () => { window.location.reload() })\n })\n\n $('.bulk-send-to-get-package').on('click', () => {\n const taskIds = [...checkedSet].join(',')\n openGetPackageModal(taskIds, null, () => { window.location.reload() })\n })\n\n $('.bulk-print-waybills-form').on('submit', () => {\n const taskIds = [...checkedSet].join(',')\n $('.hidden-tasks').val(taskIds)\n })\n\n $('.grouped-order-items').off('click').on('click', (e) => {\n e.preventDefault();\n const orderItemtype = e.currentTarget.dataset.kind;\n if (orderItemtype == \"by-skus\")\n orderItemsSummaryModal(e, [...checkedSet].join(','));\n else\n showOrderItemsSummaryModal('/order_items/grouped_items', { task_ids: [...checkedSet].join(',') });\n })\n\n setFocusOnSearchBoxForCompanies(['filterCompany', 'filterCity', 'filterRoute', 'filterRegion']);\n\n $('.filters-dropdown').on('hide.bs.dropdown', (e) => {\n if ($.contains(e.currentTarget, e.clickEvent?.target)) e.preventDefault()\n })\n\n $('.filter-options-search').on('keyup', (e) => {\n const value = $(e.currentTarget).val().toLowerCase()\n $(e.currentTarget).closest('.filter-options').find('> div, > label').filter((i, el) => {\n $(el).toggle($(el).text().toLowerCase().indexOf(value) > -1)\n })\n })\n\n drawFilterPresets(JSON.parse(localStorage.getItem('store_visits_filter_presets')) || [])\n\n $('.save-filter').on('click', async () => {\n let savedFilterPresets = JSON.parse(localStorage.getItem('store_visits_filter_presets')) || []\n\n const { value: name } = await Swal.fire({\n title: i18n.t('views.operator.filter_name'),\n input: 'text',\n inputLabel: '',\n inputPlaceholder: '',\n heightAuto: false,\n customClass: {\n confirmButton: 'btn btn-primary py-2 px-5',\n },\n buttonsStyling: false,\n inputValidator: (value) => {\n value = value.replace(/['\"`()[\\] ]/g, '')\n if (!value) { return i18n.t('views.operator.filter_name_required') }\n if (savedFilterPresets.find(preset => preset.name.replace(/['\"`()[\\] ]/g, '') === value)) { return i18n.t('views.operator.filter_already_exists') }\n }\n })\n\n if (!name) return\n\n savedFilterPresets = [...savedFilterPresets, { name: name, filters: currentFilters() }]\n localStorage.setItem('store_visits_filter_presets', JSON.stringify(savedFilterPresets))\n\n drawFilterPresets(savedFilterPresets)\n })\n\n $('.order-items-summary-btn').on('click', (e) => orderItemsSummaryModal(e, gon.task_ids));\n\n initCreateRouteModal()\n\n window.addEventListener('beforeunload', () => {\n sessionStorage.setItem('store_visit_filters', JSON.stringify(currentFilters()))\n });\n }\n\n if (body.hasClass('operator pickups')) {\n initTable($('#pickups-table'))\n setUpTaskPanelView();\n }\n\n if (body.hasClass('operator scanning')) {\n const allCheckboxes = () => ($('.bulk-scan-task-checkbox:not(:disabled)'))\n const checkedCheckboxes = () => ($('.bulk-scan-task-checkbox:not(:disabled):checked'))\n const updateTaskIds = () => {\n const taskIds = checkedCheckboxes().map((_i, el) => el.getAttribute('data-task-id')).get().join(',')\n $('.hidden-tasks, .task_ids').val(taskIds)\n }\n\n const scanningTable = $('#scanning-table').DataTable({\n dom: 'irt',\n searchHighlight: true,\n bInfo: false,\n paging: false,\n responsive: true,\n language: defaultTranslations(),\n order: [[ 1, \"desc\" ]],\n data: gon.initial_tasks,\n drawCallback: () => {\n $('.task-drivers-select2').each((i, d) => initTaskDriversSelect(d))\n $('.input-group.allow-past').datepicker({\n format: getDateFormat(),\n language: i18n.t('locale'),\n rtl: isRTL(),\n orientation: 'bottom',\n defaultDate: getFormattedDate(),\n autoclose: true,\n todayHighlight: true\n }).on('hide', e => e.stopPropagation())\n initTaskPickUpAtDatepicker($('.task-pickup-date'))\n $('.task-set-status').off('click').on('click', (e) => {\n const taskId = e.currentTarget.dataset.taskId\n const status = e.currentTarget.dataset.newStatus\n updateTaskStatus(taskId, status)\n })\n\n $('.bulk-scan-task-checkbox').off('click').on('click', () => {\n const checkedCount = $('.bulk-scan-task-checkbox:checked').length\n updateFloatingActionsVisibility(checkedCount)\n if (checkedCount === 0) $('#select-all-scan-tasks').prop('checked', false)\n updateTaskIds()\n })\n\n $('.task-set-pick-status').off('click').on('click', (e) => {\n const { taskId, newStatus, packagesQuantity } = e.currentTarget.dataset\n if (newStatus === 'PICKED') {\n handleTaskPickStatusModal(taskId, newStatus, packagesQuantity ? packagesQuantity : 1)\n } else {\n updateTaskPickStatus(taskId, newStatus)\n }\n })\n },\n columns: [\n {\n title: ``,\n width: '25px',\n orderable: false,\n render: (data, type, row) => {\n const isChecked = $('#select-all-tasks').prop('checked')\n return ``\n }\n },\n {\n title: i18n.t('models.task.task'),\n data: 'id',\n render: (taskId) => (`${taskId}`)\n },\n {\n title: i18n.t('models.task.status'),\n data: 'status',\n render: (status, type, task) => {\n if (type === 'filter' || type === 'sort') {\n return i18n.t(`models.task.status_enum.${status}`)\n }\n return renderSmallAjaxStatus(status, task.id, task.is_roundtrip, gon.allow_inventory)\n }\n },\n {\n title: i18n.t('models.driver.driver'),\n data: 'driver_name',\n render: (driverName, type, task) => {\n if (type === 'filter' || type === 'sort') return driverName\n return `
\n \n \n
`\n }\n },\n {\n title: i18n.t('date_str'),\n data: 'pickup_at',\n render: (date, _type, task) => (\n `
\n \n
\n \n \n \n \n
\n
`\n )\n },\n {\n title: i18n.t('models.company.company'),\n data: 'company_name'\n },\n {\n title: i18n.t('models.task.pick_status'),\n data: 'pick_status',\n render: (pickStatus, type, task) => {\n if (type === 'filter' || type === 'sort') { return i18n.t(`models.task.pick_status_enum.${pickStatus}`) }\n return renderPickStatusAjax(task.id, pickStatus, task.packages_quantity ? task.packages_quantity : 1)\n },\n className: gon.allow_picking ? '' : 'noVis d-none'\n },\n ...gon.custom_fields.map(field => ({\n title: field.name,\n name: field.map_name,\n render: (_data, _type, task) => (task.extra ? task.extra[field.name] : '')\n })),\n ]\n })\n\n $('#select-all-scan-tasks').off('click').on('click', (e) => {\n allCheckboxes().prop('checked', e.currentTarget.checked)\n updateFloatingActionsVisibility(e.currentTarget.checked ? checkedCheckboxes().length : 0)\n updateTaskIds()\n })\n\n $('.unselect-all-scan-tasks').off('click').on('click', () => {\n allCheckboxes().prop('checked', false)\n $('#select-all-scan-tasks').prop('checked', false)\n updateFloatingActionsVisibility(0)\n updateTaskIds()\n })\n\n $('#bulk-update-form, #many_sms_form').on('submit', () => {\n const allTaskIds = allCheckboxes().map((_i, el) => el.getAttribute('data-task-id')).get().join(',')\n history.pushState({}, null, updateQueryStringParameter(window.location.href, 'task_ids', allTaskIds))\n })\n\n enableScanner()\n\n const addNewTask = (taskId, onSuccess = () => {}, onError = () => {}) => {\n fetch('/operator/scan_task', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ task_code: taskId })\n }).then(res => res.json()).then(data => {\n const currentTaskIds = allCheckboxes().map((_i, el) => parseInt(el.getAttribute('data-task-id'))).get()\n if (data.error) {\n showSweetAlertMessage(i18n.t('oops'), data.error, 'warning')\n new Audio('/error.wav').play()\n onError()\n return\n }\n if (currentTaskIds.includes(data.id)) {\n showSweetAlertMessage(i18n.t('oops'), i18n.t('views.operator.scanning.task_already_scanned'), 'warning')\n new Audio('/error.wav').play()\n onError()\n return\n }\n scanningTable.rows.add([data]).draw()\n\n showNotification({ message: i18n.t('views.operator.scanning.task_successfully_added', { id: data.id }), type: 'success' })\n updateFloatingActionsVisibility(checkedCheckboxes().length)\n updateTaskIds()\n new Audio('/success.mp3').play()\n showScanningModal(data)\n onSuccess()\n })\n }\n\n $(window.BarcodesScanner).on('scan', () => { addNewTask(window.BarcodesScanner.barcodeData) })\n\n const onManualTaskAddition = () => {\n const taskIdInput = $('.add-task-input')\n const taskId = taskIdInput.val()\n if (!taskId) return\n\n addNewTask(taskId, () => { taskIdInput.val('') })\n }\n\n $('.add-task-input').on('keypress', (e) => { if (e.key === \"Enter\") onManualTaskAddition() })\n $('.add-task-button').on('click', onManualTaskAddition)\n\n initEscButtonEvent('.unselect-all-scan-tasks');\n }\n\n if (body.hasClass('operator route_suggestion')) {\n import('./route_suggestion')\n }\n})\n\nconst showScanningModal = (task) => {\n const statusClass = `${task.status.toLowerCase().replace(/[A-Z]/g, m => `-${m.toLowerCase()}`)}-task`\n const modal = $(\"#operator-scanning-modal\")\n\n modal.find('.scan-task-id').text(task.id)\n modal.find('.scan-task-status').addClass(statusClass).text(i18n.t(`models.task.status_enum.${task.status}`))\n\n const fields = {\n company_name: task.company_name,\n wp_order_id: task.wp_order_id,\n pickup_at: task.pickup_at,\n driver_name: task.driver_name,\n packages_quantity: task.packages_quantity,\n is_roundtrip: task.is_roundtrip,\n region_str: task.region_str\n }\n\n Object.entries(fields).forEach(([field, value]) => {\n const container = modal.find(`.${field}_container`)\n\n if (!value) {\n container.hide()\n } else {\n modal.find(`.${field}`).text(value)\n container.show()\n }\n })\n\n modal.modal('show')\n}\n\nconst drawFilterPresets = (presets) => {\n $('.filter-presets-wrapper').toggleClass('d-none', !presets.length)\n\n $('.filter-presets-list').html(presets.map((preset) => (\n `\n
\n \n ${preset.name}\n \n
\n
\n \n
\n `\n )).join(''))\n\n $('.apply-preset').on('click', (e) => {\n const presetName = e.currentTarget.dataset.name\n const preset = presets.find((p) => p.name.replace(/['\"`()[\\] ]/g, '') === presetName)\n applyFilters(preset.filters)\n })\n\n $('.delete-preset').on('click', async (e) => {\n const { isConfirmed } = await Swal.fire({\n title: i18n.t('shared.are_you_sure'),\n showCancelButton: true,\n cancelButtonText: i18n.t('cancel'),\n reverseButtons: true,\n heightAuto: false,\n customClass: {\n confirmButton: 'btn btn-danger py-2 px-5',\n cancelButton: 'btn btn-secondary py-2 px-5'\n },\n buttonsStyling: false,\n })\n\n if (isConfirmed) {\n const presetName = e.currentTarget.dataset.name\n let savedFilterPresets = JSON.parse(localStorage.getItem('store_visits_filter_presets')) || []\n savedFilterPresets = savedFilterPresets.filter((p) => p.name.replace(/['\"`()[\\] ]/g, '') !== presetName)\n localStorage.setItem('store_visits_filter_presets', JSON.stringify(savedFilterPresets))\n drawFilterPresets(savedFilterPresets)\n }\n })\n}\n\nconst markersRebuild = (map, renderedVisits) => {\n map.eachLayer(layer => { if (layer.options.icon) layer.remove() })\n const markers = buildMarkers(map, renderedVisits, buildUnitedMarker, buildSingleMarker)\n if (markers.length) boundMarkers(map, markers)\n}\n\nconst buildSingleMarker = (map, visit) => {\n const icon = L.divIcon({\n className: \"box\",\n iconSize: [28, 41],\n iconAnchor: [14, 41],\n html: `\n
\n \n \n \n \n \n ${ !visit.precision_status || visit.precision_status === 'accurate' || visit.precision_status === 'warning_ignored' ? '' : ambiguousMarkerAddition() }\n
`\n })\n\n const contentString = constructFancyInfoWindowContent(visit)\n const marker = L.marker([visit.lat, visit.lon], { icon: icon, opacity: 0.9 }).bindPopup(contentString, { offset: [0, -20] }).openPopup().addTo(map)\n if (gon.allow_routes) {\n marker.on('click', () => { $('.popup-select').each((_i, s) => initRoutesSelect(s, onRouteUpdate)) })\n } else {\n marker.on('click', () => { $('.popup-select').each((_i, s) => initVisitDriversSelect(s, onDriverUpdate)) })\n }\n\n return marker\n}\n\nconst buildUnitedMarker = (map, visits) => {\n const firstVisit = visits[0]\n const latitude = firstVisit.lat\n const longitude = firstVisit.lon\n\n const popup = `\n
\n ${visits.map((v) => `\n
\n \n ${v.task.id}${gon.allow_companies ? ` - ${v.company_name}` : ''}${v.recipient_name ? `, ${v.recipient_name}` : ''}\n \n \n \n \n \n \n
\n `).join('')}\n
\n `\n\n const marker = L.marker([latitude, longitude], { icon: numberedSvgMarker(visits.length, firstVisit.marker_color), opacity: 0.9 }).bindPopup(popup, { offset: [0, -20] }).openPopup().addTo(map)\n marker.on('click', () => {\n $('.popup-click').off('click').on('click', (e) => {\n const $el = e.currentTarget.dataset.parent ? $(e.currentTarget).parents(e.currentTarget.dataset.parent) : $(e.currentTarget)\n\n $el.children('.custom-popup').remove()\n $el.append(e.currentTarget.dataset.htmlPopup)\n if (gon.allow_routes) {\n $('.popup-select').each((_i, s) => initRoutesSelect(s, onRouteUpdate))\n } else {\n $('.popup-select').each((_i, s) => initVisitDriversSelect(s, onDriverUpdate))\n }\n })\n\n })\n return marker\n}\n\nconst mapCallback = renderedVisits => map => {\n drawLinePolygons(gon.lines, map, 'leaflet-region-polygon d-none', false)\n\n enableDrawTool(map, '#000', e => {\n const polygon = e.layer;\n $(document).trigger('addedPolygon', polygon);\n $('#line-polygon').val(transformCoords(e.layer.getLatLngs())).trigger('change');\n })\n\n const markers = buildMarkers(map, renderedVisits, buildUnitedMarker, buildSingleMarker)\n if (markers.length) boundMarkers(map, markers)\n\n if(gon.allow_routes && gon.routes_to_plot) {\n gon.routes_to_plot.forEach(route => {\n if (route.polyline.length === 0) { return }\n\n L.featureGroup(\n [L.polyline(decodePolyline(route.polyline),\n {...POLYLINE_OPTIONS, color: route.color}).arrowheads(ARROWHEADS_OPTIONS)]\n ).addTo(map);\n })\n }\n\n setupMapPanelViewLink();\n\n $('.leaflet-draw-toolbar .leaflet-draw-draw-polygon').attr('title', i18n.t('draw_polygon_btn'));\n}\n\nconst onDriverUpdate = (data) => {\n const table = $('#operator-store-visits-table').DataTable()\n const row = table.row(`#visit-row-${data.visit_id}`)\n let rowData = row.data()\n\n rowData.driver_id = data.new_driver\n rowData.marker_color = data.new_marker_color\n\n row.data(rowData).draw()\n}\n\nconst onRouteUpdate = data => {\n const table = $('#operator-store-visits-table').DataTable()\n const row = table.row(`#visit-row-${data.visit_id}`)\n let rowData = row.data()\n\n rowData.route = data.new_route\n rowData.marker_color = data.new_marker_color\n\n row.data(rowData).draw()\n}\n\nconst boundMarkers = (map, markers) => {\n map.fitBounds(L.featureGroup(markers).getBounds(), { padding: [10, 10] })\n}\n\nwindow.alert = (function () {\n const nativeAlert = window.alert\n return function (message) {\n message.indexOf('DataTables warning') === 0\n ? console.warn(message)\n : nativeAlert(message)\n }\n})()\n","import * as Ladda from 'ladda'\nimport { i18n } from \"./helpers/i18n\";\nimport { initTabs, updateCurrentStickyCard } from \"./helpers/view\";\nimport { csrfToken } from \"./helpers/utils\";\nimport Swal from \"sweetalert2/dist/sweetalert2\";\nimport { showNotification } from \"./helpers/notifications\";\nimport { initSmsTemplatesSelect } from \"./helpers/sms_templates\";\nimport { initializeQuillEditor } from \"./helpers/quill\";\n\n$(() => {\n Ladda.bind('.ladda-button')\n\n if ($('body').hasClass('communication emails')) {\n initTabs('general', () => {});\n\n initializeQuillEditor('email_to_destination_on_delivery', 'email_to_destination_on_delivery_html');\n\n $('.preview-link').on('click', (e) => {\n e.preventDefault();\n\n const contentField = e.currentTarget.dataset.content;\n const previewModal = $('#email-preview-modal');\n const content = $(`#${contentField}`).val();\n\n previewModal.find('.modal-body').html(content);\n previewModal.modal('show');\n });\n }\n\n if ($('body').hasClass('communication settings')) {\n jQuery.validator.addMethod('noSpace', function (value, element) {\n return value.indexOf(' ') < 0 && value != ''\n }, i18n.t('views.sms.space_char_illegal'))\n\n let currentStickyCard = null;\n const onTabChange = (tab) => {\n window.scrollTo(0, 0);\n currentStickyCard = updateCurrentStickyCard(currentStickyCard, `${tab}_card`);\n }\n initTabs('general', onTabChange);\n\n // form validation\n $('#communication_form').validate({\n rules: {\n 'organization[sms_from_name]': {\n required: true,\n maxlength: 11,\n noSpace: true\n }\n },\n messages: {\n 'organization[sms_from_name]': {\n maxlength: i18n.t('views.leads.errors.max_length', { amount: 11 })\n }\n }\n })\n\n $('.sticky-setting-menu li a').on('click', () => { window.scrollTo({ top: 0, behavior: 'smooth' }); })\n $(\".sms-setting-checkbox\").change((e) => { e.currentTarget.form.submit() })\n\n $('.whatsapp-connect').click(() => {\n if (!gon.pre_verified_phone_id) {\n showNotification({ message: \"Pre verified number not found\", type: 'danger' })\n return\n }\n\n window.FB.login((response) => {\n\n if (response.authResponse) {\n const code = response.authResponse.code;\n\n if (!code) return\n\n fetch('/organization/facebook_login', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ access_token: code })\n }).then(res => res.json()).then(data => {\n const icon = data.status === 'success' ? 'success' : 'error'\n const title = data.status === 'success' ? i18n.t('great') : i18n.t('oops')\n\n Swal.fire({\n title: `

${title}

`,\n html: `${data.message}`,\n icon: icon,\n width: 400,\n heightAuto: false,\n padding: '2.5rem',\n buttonsStyling: false,\n stopKeydownPropagation: false,\n confirmButtonClass: 'btn btn-primary px-6',\n confirmButtonColor: null,\n })\n })\n } else {\n console.log('User cancelled login or did not fully authorize.');\n }\n }, {\n config_id: '1037398801052927',\n response_type: 'code',\n override_default_response_type: true,\n extras: {\n setup: {\n solutionID: '1016208823500907',\n preVerifiedPhone: {\n ids: [gon.pre_verified_phone_id]\n }\n }\n }\n });\n })\n\n $('.sms-content').each((_i, elem) => updateSmsLengthWarning(elem));\n $('.sms-content').on('keyup', (e) => updateSmsLengthWarning(e.target));\n }\n\n $(document).on('click', '.dynamic-variables-btn', (e) => {\n e.preventDefault();\n renderDynamicVariableModal();\n });\n\n $('.bulk-send-sms-to-route-btn').on('click', e => {\n if (!gon.allow_sms) return\n\n $('.data-preloader').removeClass('d-none');\n const smsModal = $(\"#bulk-send-sms-to-route-modal\");\n\n if (smsModal.text().length > 0) {\n $(smsModal).modal('show');\n $('.data-preloader').addClass('d-none');\n return;\n }\n\n fetch('/visits/bulk_sms_modal', {\n method: 'GET',\n headers: {\n 'X-CSRF-TOKEN': csrfToken(),\n 'Content-Type': 'application/json',\n }\n }).then(res => res.text()).then(html => {\n smsModal.html(html);\n $('.data-preloader').addClass('d-none');\n $(smsModal).modal(\"show\");\n });\n })\n\n $('#bulk-send-sms-to-route-modal').on(\"show.bs.modal\", () => {\n initSmsTemplatesSelect($('.sms-templates-select'), $('#message-body'))\n });\n})\n\nconst renderDynamicVariableModal = () => {\n const dynamicVariableModal = $('#dynamic-variables-modal');\n\n if (dynamicVariableModal && dynamicVariableModal.text().length > 0) {\n $(dynamicVariableModal).modal(\"show\");\n } else {\n fetch('/communication/dynamic_variables', {\n method: 'GET',\n headers: {\n 'X-CSRF-TOKEN': csrfToken(),\n 'Content-Type': 'application/json',\n }\n }).then(res => res.text()).then(html => {\n $(\"body\").append(html);\n $('#dynamic-variables-modal').modal(\"show\");\n $('.data-preloader').addClass('d-none');\n });\n }\n}\n\nconst updateSmsLengthWarning = (elem) => {\n const smsLength = $(elem).val().length;\n const smsText = smsLength > 0 ? i18n.t('views.sms.sms_length_warning', { length: smsLength }) : '';\n $(elem).closest('.sms-content-container').find('.sms-length-warning').text(smsText);\n}\n","import { i18n } from \"./helpers/i18n\";\nimport { STATUSES } from \"./constants\";\nimport { initDailyProgressChart, initMonthlyChart, initStatusSummaryChart } from \"./helpers/apexcharts\";\nimport { csrfToken, getParameterByName } from \"./helpers/utils\";\nimport { initMap } from \"./services/map\";\nimport { fitBounds } from \"./helpers/leaflet\";\nimport { initColorPicker } from \"./helpers/color-picker\";\nimport * as Ladda from \"ladda\";\n\n$(() => {\n const body = $('body')\n $('#termsModal.open-on-load').length && $('#termsModal').modal('show')\n $('#warningModal').length && $('#warningModal').modal('show')\n\n if (body.hasClass('home index') || body.hasClass('reports daily_progress')) {\n initStatusSummaryChart('status-summary-chart')\n initDailyProgressChart('daily-progress-chart')\n }\n\n if (body.hasClass('home index')) {\n const colorMapping = (s) => (STATUSES[s.name].color)\n const seriesMapping = (s) => ({ name: STATUSES[s.name].name(), data: s.data })\n initMonthlyChart('monthly-summary-chart', i18n.t('tasks'), gon.monthly_chart_data, colorMapping, seriesMapping)\n\n if (getParameterByName('onboarding')) loadOnboarding()\n }\n\n $('.clickable-row').on('click', e => { window.open(e.currentTarget.dataset.href) })\n})\n\nconst loadOnboarding = async () => {\n const preloader = $('.data-preloader')\n preloader.removeClass('d-none');\n\n const res = await fetch('/organization/onboarding_modal', {\n method: 'GET',\n headers: {\n 'X-CSRF-TOKEN': csrfToken(),\n 'Content-Type': 'application/json',\n }\n })\n\n const html = await res.text()\n\n if (!html) {\n preloader.addClass('d-none');\n return\n }\n\n const modalContainer = $('#modal-container')\n modalContainer.html(html)\n\n const modal = modalContainer.find('#onboarding-modal')\n\n const populateMapCallback = (map) => {\n const icon = L.divIcon({\n className: 'blue-number-icon',\n iconSize: [29, 47],\n iconAnchor: [15, 47]\n })\n\n const locations = JSON.parse($('#auto_populate_locations').val())\n\n locations.forEach((location) => {\n L.marker([location.lat, location.lng], { icon: icon }).bindPopup(location.address, { offset: [0, -20] }).openPopup().addTo(map)\n })\n }\n\n const map = initMap(document.getElementById('auto_populate_map'), populateMapCallback)\n\n modal.on(\"shown.bs.modal\", () => {\n map.invalidateSize()\n fitBounds(map)\n })\n\n Ladda.bind('#onboarding-modal .ladda-button');\n\n $('.populate-next').on('click', (e) => {\n $(\".onboarding-populate\").addClass('d-none')\n $(\".onboarding-driver\").removeClass('d-none')\n\n $('#onboarding-create-tasks').val(!!e.currentTarget.dataset.create)\n })\n\n initColorPicker($('#driver-marker-color'), (hexColor, el) => {\n $(el).css('background', hexColor)\n $('#marker-sample').css('color', hexColor)\n })\n\n preloader.addClass('d-none');\n modal.modal('show')\n}\n","import * as Ladda from 'ladda'\nimport { geolocationMapCallback, initMap } from './services/map'\nimport { initCityStreetSelect } from \"./helpers/city-street-select\";\nimport { defaultTranslations, search } from \"./helpers/datatables\";\nimport { i18n } from \"./helpers/i18n\";\nimport { updateFloatingActionsVisibility } from \"./helpers/floating-actions\";\nimport {checkedCount, csrfToken, fetchJSON, selectedIds} from \"./helpers/utils\";\nimport Swal from \"sweetalert2\";\nimport { deleteSweetAlert } from './helpers/sweetalerts';\n\n$(() => {\n const mapContainer = document.getElementById('locations_map')\n if (mapContainer) {\n initMap(mapContainer, mapCallback)\n }\n\n Ladda.bind('#create-location-btn')\n\n // disable form submission on enter stroke\n $('form').on('keyup keypress', (e) => {\n const keyCode = e.keyCode || e.which\n if (keyCode === 13 && e.target.tagName !== 'TEXTAREA') {\n e.preventDefault()\n return false\n }\n })\n\n initCityStreetSelect('#location_city', '#location_city_other', '#city-other-button', '#city-other-content',\n '#location_street', '#location_street_other', '#street-other-button', '#street-other-content')\n\n if ($('#location_form').length > 0) {\n // prevent ladda spinner if is invalid\n $('#location_form').on('submit', function (e) {\n const isvalid = $('#location_form').valid()\n if (!isvalid) {\n Ladda.stopAll()\n }\n })\n\n // form validation\n $('#location_form').validate({\n rules: {\n 'location[name]': {\n required: true\n }\n }\n })\n }\n\n if ($('.locations-table').length > 0) {\n const locations = new Map();\n const locationIds = [];\n $('.bulk-location-checkbox').each((key, checkbox) => { locationIds.push(checkbox.dataset.locationId) });\n locationIds.forEach((locationId) => { locations.set(locationId, { checked: false }) });\n\n const locationsTable = $('.locations-table').DataTable({\n drawCallback: () => {\n $('.bulk-location-checkbox').off('click').on('click', (e) => {\n const locationId = e.currentTarget.dataset.locationId;\n locations.set(locationId, { checked: e.currentTarget.checked });\n $(document).trigger('selectedUpdated');\n updateFloatingActionsVisibility(checkedCount(locations));\n })\n\n $('.bulk-location-checkbox').each((_i, el) => {\n const locationId = el.dataset.locationId;\n $(el).prop('checked', locations.get(locationId).checked);\n })\n },\n dom: '<\"top\"i>rt<\"bottom\"><\"clear\">',\n searchHighlight: true,\n bInfo: false,\n paging: false,\n order: [[1, 'asc']],\n responsive: true,\n language: defaultTranslations(),\n columnDefs: [\n {\n targets: 'unorderable',\n orderable: false\n }\n ]\n })\n locationsTable.on('draw', () => {\n const body = $(locationsTable.table().body())\n\n body.unhighlight()\n body.highlight(locationsTable.search())\n })\n\n $('.table-search').on('input', search(locationsTable))\n\n $('.select-all-locations').off('click').on('click', (e) => {\n $('.bulk-location-checkbox').prop('checked', e.currentTarget.checked);\n locations.forEach((value, key) => { locations.set(key, { checked: e.target.checked }) });\n $(document).trigger('selectedUpdated');\n updateFloatingActionsVisibility(checkedCount(locations));\n })\n\n $('.unselect-all-locations').off('click').on('click', () => {\n $('.bulk-location-checkbox').prop('checked', false);\n $('.select-all-locations').prop('checked', false);\n locations.forEach((value, key) => { locations.set(key, { checked: false }) });\n $(document).trigger('selectedUpdated');\n updateFloatingActionsVisibility(0);\n })\n\n $(document).on('selectedUpdated', () => {\n const selected = checkedCount(locations);\n updateFloatingActionsVisibility(selected);\n $('.locations-bulk-delete-btn').prop('disabled', selected === 0);\n })\n\n $('#form-bulk-destroy-location').on('submit', function(e) {\n e.preventDefault();\n const selectedLocations = selectedIds(locations);\n $('.location-ids').val(selectedLocations.join(','))\n\n Swal.fire({\n text: i18n.t('delete_warning'),\n icon: \"warning\",\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn font-weight-bold btn-primary',\n cancelButtonClass: 'btn btn-grey',\n confirmButtonText: i18n.t('yes_str'),\n cancelButtonText: i18n.t('no_str')\n }).then(function (result) {\n if (result.value) {\n $('#form-bulk-destroy-location').unbind('submit').submit();\n }\n });\n });\n\n $('#form-bulk-shared-location').on('submit', function(e) {\n e.preventDefault();\n const selectedLocations = selectedIds(locations);\n $('.location-ids').val(selectedLocations.join(','))\n\n Swal.fire({\n text: i18n.t('views.locations.bulk_shared_warning'),\n icon: \"warning\",\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn font-weight-bold btn-primary',\n cancelButtonClass: 'btn btn-grey',\n confirmButtonText: i18n.t('yes_str'),\n cancelButtonText: i18n.t('no_str')\n }).then(function (result) {\n if (result.value) { $('#form-bulk-shared-location').unbind('submit').submit(); }\n });\n });\n }\n\n if ($('body').hasClass('locations show')) {\n let geolocationMap = null\n\n $('#geolocation-task-edit-btn').off('click').on('click', () => {\n if (!geolocationMap) geolocationMap = initMap(document.getElementById('edit_geolocation_map'), geolocationMapCallback(gon.latitude, gon.longitude, '#location_latitude', '#location_longitude'))\n\n $('#geolocation-task-edit-modal').modal('show')\n setTimeout(() => { geolocationMap.invalidateSize(true) }, 300, geolocationMap)\n })\n\n $('.btn-delete-location').off('click').on('click', (e) => {\n e.preventDefault();\n const dataset = e.currentTarget.dataset;\n const locationId = dataset.locationId;\n const redirectUrl = dataset.redirection;\n\n Swal.fire({\n title: i18n.t('models.location.confirm_deletion'),\n icon: 'warning',\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn btn-danger',\n confirmButtonText: ` ${i18n.t('delete')}`,\n cancelButtonText: i18n.t('cancel'),\n cancelButtonClass: 'btn btn-grey'\n }).then(async (result) => {\n if (result.isConfirmed) {\n fetch(`/api/web/locations/${locationId}`, {\n method: 'DELETE',\n headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken() }\n }).then((res) => {\n if (res.status === 200) {\n res.json().then(response => {\n if (response.error) {\n Swal.fire(\n i18n.t('shared.reject'),\n response.error.message,\n 'error'\n )\n } else {\n Swal.fire(\n i18n.t('deleted_successfully'), '', 'success'\n ).then(() => {\n window.location.href = redirectUrl\n })\n }\n })\n } else {\n Ladda.stopAll()\n }\n })\n }\n })\n })\n }\n})\n\nconst mapCallback = map => {\n const contentString =\n `
\n
\n

${gon.location_name}

\n
${gon.location_partial_address}
\n
\n
`\n\n const numberIcon = L.divIcon({\n className: 'red-number-icon',\n iconSize: [29, 47],\n iconAnchor: [15, 47]\n })\n if (gon.latitude && gon.longitude) {\n const marker = L.marker([gon.latitude, gon.longitude], { icon: numberIcon })\n .bindPopup(contentString).openPopup().addTo(map)\n map.fitBounds(L.latLngBounds([marker.getLatLng()]))\n }\n}\n","import { initTable } from './helpers/drivers/table'\nimport { initBilling2Table } from './helpers/organizations/table'\nimport ApexCharts from 'apexcharts'\nimport { matchStart } from './helpers/date'\nimport { initTabs, updateCurrentStickyCard } from \"./helpers/view\";\nimport Swal from 'sweetalert2/dist/sweetalert2'\nimport { initImageInput } from \"./helpers/images\";\nimport { columnIndexByName } from \"./helpers/store_visits/table\";\nimport { debounce, setPropertyByPath, updateQueryStringParameter } from \"./helpers/utils\";\nimport { i18n } from \"./helpers/i18n\";\nimport { csrfToken } from \"./helpers/utils\";\nimport { deleteSweetAlert } from \"./helpers/sweetalerts\";\nimport { initFilter } from \"./helpers/tables/filters\";\n\n$(() => {\n const body = $('body')\n if (body.hasClass('organizations')) {\n const billingTable = $('#billing-table')\n const billing2Table = $('#billing2-table')\n if (billing2Table) {\n initBilling2Table(billing2Table)\n }\n if (billingTable) {\n initTable(billingTable, { sortBy: 1 })\n }\n const color_urgent = '#' + gon.color_urgent\n const color_super_urgent = '#' + gon.color_super_urgent\n\n $('#urgent-color').colorpicker('place')\n if ($('#urgent-color')[0]) {\n $('#urgent-color')[0].style.background = color_urgent\n }\n if ($('#super-urgent-color')[0]) {\n $('#super-urgent-color')[0].style.background = color_super_urgent\n }\n $('#urgent-color').colorpicker('setValue', color_urgent)\n $('#super-urgent-color').colorpicker('place')\n $('#super-urgent-color').colorpicker('setValue', color_super_urgent)\n\n // ugly workaround because the color picker drop down menu was too wide (I guess becuse rtl support)\n $('.colorpicker.dropdown-menu').addClass('pull-right')\n\n $('#urgent-color').colorpicker().on('changeColor', function (e) {\n const hexaColor = e.color.toHex()\n $('#urgent-color')[0].style.background = hexaColor\n })\n\n $('#super-urgent-color').colorpicker().on('changeColor', function (e) {\n const hexaColor = e.color.toHex()\n $('#super-urgent-color')[0].style.background = hexaColor\n })\n\n $('.public-bg-reset').on('click', () => { $('#public-pages-bg-color').colorpicker('setValue', '#7BA0DF') })\n }\n if (body.hasClass('organizations statistics')) {\n renderStatisticsCharts()\n }\n if (body.hasClass('org_users index')) {\n $('.user-row-js span, .user-row-js').on('click', e => {\n const url = $(e.target).closest('.user-row-js').data('url')\n if (url) window.location.href = url\n })\n\n $('.reset-password').on('click', e => {\n e.preventDefault()\n e.stopPropagation()\n\n const { url, email } = e.currentTarget.dataset\n\n if (email && email.length > 0) {\n Swal.fire({\n title: i18n.t('views.organization.reset_password_alert', {email: email}),\n icon: 'success',\n showCancelButton: false,\n showCloseButton: true,\n confirmButtonClass: 'btn btn-success',\n confirmButtonText: i18n.t('ok_str'),\n }).then(async (result) => {\n if (result.isConfirmed) {\n var form = $('
', {\n 'method': 'POST',\n 'action': url\n });\n form.append($('', {\n 'type': 'hidden',\n 'name': 'authenticity_token',\n 'value': csrfToken()\n }));\n $('body').append(form);\n form.submit();\n }\n })\n } else {\n Swal.fire({\n title: i18n.t('views.organization.user_email_blank'),\n icon: 'error',\n showCancelButton: false,\n showCloseButton: true,\n confirmButtonClass: 'btn btn-secondary',\n confirmButtonText: i18n.t('ok_str'),\n }).then(async () => {\n return false\n })\n }\n })\n\n initializeUsersTable($('#org-active-users-table'), $('.org-active-users-table'))\n initializeUsersTable($('#org-inactive-users-table'), $('.org-inactive-users-table'))\n }\n\n if (body.hasClass('org_users activity')) {\n const activityTable = initTable($('#activities-table'), { paging: true })\n\n initFilter($('input[name=filterUser]'), activityTable, columnIndexByName(activityTable, 'user'))\n }\n\n if (body.hasClass('organizations edit')) {\n initImageInput($('#organization_image'))\n\n $('#organization_timezone').select2({\n dir: i18n.t('direction'),\n width: '100%',\n matcher: (params, data) => matchStart(params, data)\n })\n\n let currentStickyCard = null\n const onTabChange = (tab) => {\n window.scrollTo(0, 0)\n currentStickyCard = updateCurrentStickyCard(currentStickyCard, `${tab}_card`)\n }\n initTabs('general', onTabChange)\n\n const iframe = $(\"#preview-iframe\")\n const iframeLoader = $('.mobile-preview-loader')\n\n const updatePreview = debounce(() => {\n const baseUrl = $('.mobile-preview-tab-link.active').data('link')\n const values = {}\n\n $('#customer-settings-form').serializeArray().forEach(field => { setPropertyByPath(values, field.name, field.value) });\n\n const url = `${baseUrl}?settings=${encodeURIComponent(JSON.stringify(values.organization))}`\n iframeLoader.removeClass('d-none')\n iframe.attr('src', url)\n }, 500)\n\n iframe.on(\"load\", () => { iframeLoader.addClass('d-none') })\n\n updatePreview()\n\n $('.mobile-preview-tab-link').on('click', (e) => {\n const tabName = e.currentTarget.getAttribute('href').replace('#', '')\n const formTab = $(`.mobile-preview-form-tab[data-tab-name='${tabName}']`)\n $('.mobile-preview-form-tab').addClass('d-none')\n formTab.removeClass('d-none')\n\n history.pushState({}, null, updateQueryStringParameter(window.location.href, 'mobile_preview_tab', tabName))\n $('#mobile_preview_tab').val(tabName)\n updatePreview()\n })\n\n $('#customer-settings-form input').on(\"change\", () => { updatePreview() })\n $('.select2-init').on(\"change.select2\", () => { updatePreview() })\n\n $('.language-selection').on('change', (e) => {\n const checkbox = e.target;\n if(checkbox.checked) {\n $('.language-selection-note').removeClass('d-none');\n } else {\n $('.language-selection-note').addClass('d-none');\n $('#availableLanguages').removeClass('show');\n }\n })\n\n $('.btn-delete-reason').off('click').on('click', (e) => {\n e.preventDefault();\n const reasonId = e.currentTarget.dataset.reasonId;\n\n deleteSweetAlert(\n `/organization/failure_reasons/${reasonId}`, `/organization/edit?tab=advanced`, i18n.t('delete_warning'),\n i18n.t('delete'), i18n.t('deleted_successfully')\n );\n })\n }\n\n if (body.hasClass('custom_fields index')) {\n $('#custom_field_field_type').change(e => {\n $('#enumFields').toggleClass('d-none', $(e.currentTarget).val() !== 'enum')\n })\n }\n if (body.hasClass('blocked_phones index')) {\n initTable($('#blocked-phones-table'))\n $('.edit-phone-btn').off('click').on('click', (e) => {\n $('#edit-phone-id').val(e.currentTarget.dataset.id)\n $('#edit-phone-number').val(e.currentTarget.dataset.number)\n })\n\n $('.delete-blocked-phone').off('click').on('click', (e) => {\n e.preventDefault();\n const phoneId = e.currentTarget.dataset.phoneId;\n\n deleteSweetAlert(\n `/organization/blocked_phones/${phoneId}`, `/organization/blocked_phones`, i18n.t('delete_warning'),\n i18n.t('delete'), i18n.t('deleted_successfully')\n );\n })\n }\n\n if (body.hasClass('organization_skills index')) {\n $('.btn-delete-skill').off('click').on('click', (e) => {\n e.preventDefault();\n const skillId = e.currentTarget.dataset.skillId;\n\n deleteSweetAlert(\n `/organization_skills/${skillId}`, `/organization_skills`, i18n.t('delete_warning'),\n i18n.t('delete'), i18n.t('deleted_successfully')\n );\n })\n }\n\n var platform = navigator.platform.toLowerCase();\n if (platform.includes('mac')) {\n $('#keyboard-shortcuts #mac, #keyboard-shortcuts [href=\"#mac\"]').addClass('active');\n $('#keyboard-shortcuts #windows, #keyboard-shortcuts [href=\"#windows\"]').removeClass('active');\n } else {\n $('#keyboard-shortcuts #mac, #keyboard-shortcuts [href=\"#mac\"]').removeClass('active');\n $('#keyboard-shortcuts #windows, #keyboard-shortcuts [href=\"#windows\"]').addClass('active');\n }\n})\n\nconst initializeUsersTable = (table, search) => {\n const orgUsersTable = table.DataTable({\n dom: 't',\n paging: false,\n searchHighlight: true,\n language: {\n zeroRecords: i18n.t('zero_records'),\n search: i18n.t('search'),\n infoEmpty: 'No records available',\n infoFiltered: '(filtered from _MAX_ total records)',\n paginate: {\n first: i18n.t('paginate.first'),\n last: i18n.t('paginate.last'),\n next: i18n.t('paginate.next'),\n previous: i18n.t('paginate.previous')\n }\n }\n })\n\n orgUsersTable.on('draw', function () {\n const body = $(orgUsersTable.table().body())\n\n body.unhighlight()\n body.highlight(orgUsersTable.search())\n })\n search.on('input', e => orgUsersTable.search(e.target.value).draw())\n}\n\nfunction renderStatisticsCharts () {\n const isRtl = gon.isRtl\n createChart('#tasks_per_month', gon.tasks_per_month, gon.months, i18n.t('tasks'), i18n.t('views.organization.statistics.tasks_per_month'), isRtl)\n createChart('#tasks_per_day', gon.tasks_per_day, gon.days, i18n.t('tasks'), i18n.t('views.organization.statistics.tasks_per_day'), isRtl, 25, -10)\n createChart('#sms_per_month', gon.sms_per_month, gon.months, i18n.t('messages'), i18n.t('views.organization.statistics.sms_per_month'), isRtl)\n createChart('#sms_per_day', gon.sms_per_day, gon.days, i18n.t('messages'), i18n.t('views.organization.statistics.sms_per_day'), isRtl, 25, -10)\n createChart('#companies_per_month', gon.companies_per_month, gon.months, i18n.t('models.company.companies'), i18n.t('views.organization.statistics.companies_per_month'), isRtl)\n createChart('#drivers_per_month', gon.drivers_per_month, gon.months, i18n.t('models.driver.drivers'), i18n.t('views.organization.statistics.drivers_per_month'), isRtl)\n createChart('#daily_routes_per_day', gon.daily_routes_per_day, gon.days, i18n.t('views.organization.statistics.daily_routes'), i18n.t('views.organization.statistics.daily_routes_per_day'), isRtl, 25)\n}\n\nfunction createChart (id, data, xAxis, seriesName, title, isRtl, xAxisLabelsOffsetY = 0, xAxisLabelsOffsetX = 0) {\n const options = {\n series: [{\n name: seriesName,\n data: data\n }],\n chart: {\n height: 350,\n type: 'bar',\n style: {\n direction: isRtl ? 'rtl' : ''\n }\n },\n plotOptions: {\n bar: {\n borderRadius: 4\n }\n },\n dataLabels: {\n enabled: false\n },\n title: {\n text: title,\n align: 'center'\n },\n grid: {\n row: {\n colors: ['#f3f3f3', 'transparent'], // takes an array which will be repeated on columns\n opacity: 0.5\n }\n },\n xaxis: {\n categories: xAxis,\n labels: {\n offsetY: isRtl ? xAxisLabelsOffsetY : 0,\n offsetX: isRtl ? xAxisLabelsOffsetX : 0\n }\n },\n tooltip: {\n marker: {\n show: false\n }\n }\n }\n\n const chart = new ApexCharts(document.querySelector(id), options)\n chart.render()\n}\n","import { i18n } from \"../i18n\";\nimport {search} from \"../datatables\";\n\nexport const initBilling2Table = ($el) => {\n const table = $el.DataTable({\n dom: '<\"top\"i>rt<\"bottom\"><\"clear\">',\n fixedHeader: {\n headerOffset: $('#kt_header').height() + $('#kt_subheader').height() + 40\n },\n searchHighlight: true,\n bInfo: false,\n paging: false,\n order: [[1, 'desc']],\n responsive: true,\n language: {\n zeroRecords: i18n.t('zero_records'),\n infoEmpty: 'No records available',\n infoFiltered: '(filtered from _MAX_ total records)'\n }\n })\n table.on('draw', () => {\n const body = $(table.table().body())\n\n body.unhighlight()\n body.highlight(table.search())\n })\n\n $('.table-search').on('input', search(table))\n}\n","import { onScannerNavigate } from './helpers/scanner'\nimport {showNotification} from \"./helpers/notifications\";\nimport { i18n } from \"./helpers/i18n\";\nimport { defaultTranslations } from \"./helpers/datatables\";\nimport { taskOffcanvas } from \"./helpers/metronic/task_offcanvas\";\nimport { initArrowFunction } from \"./helpers/store_visits/table\";\nimport { initTaskPanelView, executeTaskPanelView } from \"./helpers/panel_view\";\nimport { csrfToken } from \"./helpers/utils\";\nimport { initTaskPhotoModal } from './helpers/view';\n\nwindow.BarcodesScanner = {\n barcodeData: '',\n deviceId: '',\n symbology: '',\n timestamp: 0,\n dataLength: 0\n}\nwindow.BarcodesScanner.tmpTimestamp = 0\nwindow.BarcodesScanner.tmpData = ''\n\n$(() => {\n const body = $('body');\n\n if (body.hasClass('search')) {\n $('.search-box input').on('keyup', e => {\n if (e.keyCode === 13) {\n $(e.target).closest('form').submit()\n }\n })\n\n $('.search-box').on('keyup', e => {\n if (e.keyCode === 13) {\n e.target.form.submit()\n }\n\n e.stopPropagation()\n const charCode = String.fromCharCode(e.keyCode)\n\n const keycode = (e.keyCode ? e.keyCode : e.which)\n if (window.BarcodesScanner.tmpTimestamp < Date.now() - 500) {\n window.BarcodesScanner.tmpData = ''\n window.BarcodesScanner.tmpTimestamp = Date.now()\n }\n\n if (keycode === 16 && window.BarcodesScanner.tmpData.length > 3) {\n onScannerNavigate(window.BarcodesScanner.tmpData, 'FAKE_SCANNER', 'WEDGE', window.BarcodesScanner.tmpTimestamp, window.BarcodesScanner.tmpData.length)\n window.BarcodesScanner.tmpTimestamp = 0\n window.BarcodesScanner.tmpData = ''\n } else if (charCode && charCode >= 0) {\n window.BarcodesScanner.tmpData += charCode\n }\n })\n\n $(window.BarcodesScanner).on('scan', function (e) {\n window.location.href = window.location.origin + '/search/search_by_task_code?code=' + window.BarcodesScanner.barcodeData\n })\n\n $('.search-task-table').DataTable({\n drawCallback: () => {\n initTaskPanelView($('.task-panel-view-open'), {\n onOpen: (e) => {\n const row = $(e.currentTarget).parents('tr')\n row.addClass('task-row-active')\n }\n })\n },\n bInfo: false,\n dom: '<\"d-none\"B><\"top\"i>rtp<\"bottom\"><\"clear\">',\n language: defaultTranslations(),\n responsive: true,\n })\n\n const offcanvas = taskOffcanvas();\n initArrowFunction(offcanvas);\n offcanvas.on('afterHide', () => { $('tr.task-row-active').removeClass('task-row-active') });\n initTaskPhotoModal();\n }\n\n $('.custom-quick-search').on('keyup', (e) => {\n const numberOnly = /^\\d+$/;\n const taskId = e.target.value;\n\n if (e.keyCode === 13) {\n if (numberOnly.test(taskId)) {\n $.ajax({\n url: `/tasks/${taskId}/search_task`,\n type: 'get',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n success: (res) => {\n const searchedTaskId = res.task_id;\n if (searchedTaskId) executeTaskPanelView(null, searchedTaskId);\n },\n error: () => {\n showNotification({ message: i18n.t('quick_search_no_delivery'), type: 'danger' })\n }\n })\n } else {\n showNotification({ message: i18n.t('quick_search_error'), type: 'danger' })\n }\n }\n })\n})\n","import * as Ladda from 'ladda'\nimport { matchStart } from './helpers/date'\nimport { i18n } from \"./helpers/i18n\";\n\n$(() => {\n Ladda.bind('.ladda-button')\n\n $('#bulk_update_status,#bulk_update_company_id,#bulk_update_cod_status').select2({\n dropdownCssClass: 'increasedzindexclass',\n dir: i18n.t('direction'),\n width: '100%',\n matcher: function (params, data) {\n return matchStart(params, data)\n }\n })\n\n $('#bulk_update_driver_id').select2({\n dropdownCssClass: 'select2-with-unassign-option',\n dir: i18n.t('direction'),\n width: '100%',\n matcher: function (params, data) {\n return matchStart(params, data)\n }\n })\n\n $('#bulk_update_route_id').select2({\n templateResult: (d) => {\n if (d.id && d.id !== 'empty') {\n const route = gon.org_routes.find(r => (r.id.toString() === d.id))\n const color = route && route.color.length > 0 ? route.color : '#bbb'\n return d.html = `
\n ${d.text}\n
`\n }\n return d.text\n },\n dropdownCssClass: 'select2-with-unassign-option-groupped',\n dir: i18n.t('direction'),\n width: '100%',\n escapeMarkup: markup => markup,\n matcher: function (params, data) {\n return matchStart(params, data)\n }\n })\n})\n","import { backgroundByPercents, initPanelMapMoving, initSidePanel, initTaskPhotoModal } from \"../helpers/view\";\nimport { initSmsTemplatesSelect } from \"../helpers/sms_templates\";\nimport { updateFloatingActionsVisibility } from \"../helpers/floating-actions\";\nimport { matchStart, timepickerMeridian } from \"../helpers/date\";\nimport {\n arrayXor,\n capitalize,\n csrfToken,\n debounce,\n fetchJSON,\n getParameterByName,\n initEscButtonEvent\n} from \"../helpers/utils\";\nimport dragula from \"dragula\";\nimport { orderItemsSummaryModal, renderOrderItemsTable } from \"../helpers/tasks/order_items\";\nimport { checkedSet } from \"../tasks\";\nimport {\n createStartEndMarkers,\n fillMoneyTransferredSum,\n initCreateRouteModal,\n initRoutesIndexTable,\n initRouteVisitsTable,\n initUnassignedVisitsTable\n} from \"../helpers/routes/routes\";\nimport { columnIndexByName, visitsInPolygon } from \"../helpers/store_visits/table\";\nimport { showNotification } from \"../helpers/notifications\";\nimport { adjustTableSpaceWithMap, defaultTranslations, search } from \"../helpers/datatables\";\nimport * as Ladda from 'ladda'\nimport { i18n } from \"../helpers/i18n\";\nimport { decodePolyline, initMap } from \"../services/map\";\nimport { fitBounds, transformCoords } from \"../helpers/leaflet\";\nimport { ARROWHEADS_OPTIONS, POLYLINE_OPTIONS } from \"../constants\";\nimport { initTooltips, taskSmsTooltip } from \"../helpers/tooltips\";\nimport { initMultiRouteTimeline, initRouteTimeline } from \"../helpers/apexcharts\";\nimport { initCodStatusDropdown } from \"../helpers/tasks/view\";\nimport { setUpTaskPanelView } from \"../helpers/panel_view\";\nimport { saveDailyRoutePlanVisitsSchedule } from \"../actions/drivers\";\nimport {\n initRouteAssistantDriverSelect,\n initRouteDriversSelect,\n initRouteVehiclesSelect\n} from \"../helpers/visits/common\";\nimport Swal from \"sweetalert2\";\nimport { initCustomColvis } from \"../helpers/tables/colvis\";\nimport { initFilter } from \"../helpers/tables/filters\";\n\nconst selectedVisits = new Set()\n\n$(() => {\n const body = $('body')\n\n if (body.hasClass('drivers daily_route_plan') || body.hasClass('routes plan')) {\n let orderChanged = false\n let pendingVisitsChanged = false\n initSmsTemplatesSelect($('.sms-templates-select'), $('#message-body'))\n\n if (document.getElementById('total-returned-cod')) {\n fillMoneyTransferredSum()\n initCodStatusDropdown($('.update-cod-status'), (data) => {\n $(`.cod-container[data-task-id='${data.task_id}']`).attr('data-cod-status', data.status)\n fillMoneyTransferredSum()\n })\n }\n\n $('.save-route-button').on('click', e => {\n e.preventDefault()\n $('#save-pattern-modal').modal('show')\n })\n\n $('.load-route-button').on('click', e => {\n e.preventDefault()\n $('#load-from-pattern-modal').modal('show')\n })\n\n const patternsSelect = $('#load_route_pattern_id').select2({\n dir: i18n.t('direction'),\n width: '100%',\n matcher: (params, data) => (matchStart(params, data))\n })\n\n $('.load-route-submit-btn').on('click', e => {\n e.preventDefault()\n const modal = $('#load-route-modal')\n const form = $(e.target).closest('form')\n form.attr('action', `/route_patterns/${patternsSelect.find(':selected').val()}/load_route`)\n form.submit()\n modal.modal('hide')\n })\n\n $('.select-all-checkboxes').click((e) => {\n const $checkboxes = $('.bulk-visit-checkbox')\n\n if (e.target.checked) $checkboxes.each((_, box) => selectedVisits.add(box.getAttribute('visit-id')))\n else selectedVisits.clear()\n\n calculateVisitsSummary();\n updateBulkEdit()\n updateFloatingActionsVisibility(selectedVisits.size)\n })\n\n $('.unselect-all-checkboxes').click(() => {\n $('.select-all-checkboxes').prop('checked', false)\n $('.bulk-visit-checkbox').prop('checked', false)\n selectedVisits.clear()\n updateBulkEdit()\n updateFloatingActionsVisibility(selectedVisits.size)\n })\n\n if (body.hasClass('routes plan')) {\n $(document).on('click', '.bulk-send-sms-submit-btn', (e) => {\n e.preventDefault();\n\n const checked = $('.bulk-visit-checkbox').filter(':checked')\n const chekcedVisits = checked.toArray().map(ch => { return ch.value });\n sumitBulkSmsForm(e, chekcedVisits);\n })\n\n $(document).on('click', '.create-route-modal-btn', (e) => {\n e.preventDefault();\n\n const checked = $('.bulk-visit-checkbox').filter(':checked');\n const chekcedVisits = checked.toArray().map(ch => { return ch.value });\n $('.visit_ids').val(chekcedVisits.join(','));\n })\n\n initCreateRouteModal()\n }\n\n $('#daily-route-timepicker').timepicker({\n minuteStep: 15,\n showMeridian: timepickerMeridian(),\n icons: {\n up: 'ki ki-arrow-up',\n down: 'ki ki-arrow-down'\n }\n })\n\n $('#daily-route-timepicker').on('click', e => $(e.target).next().click())\n\n if (getParameterByName('layout') !== 'list') {\n let gripContainers, deliveriesTableBody;\n if (body.hasClass('routes plan')) {\n gripContainers = ['container'];\n deliveriesTableBody = [document.getElementById('container')];\n } else {\n gripContainers = ['pending-deliveries-tbody', 'all-deliveries-tbody'];\n deliveriesTableBody = [document.getElementById('pending-deliveries-tbody'),\n document.getElementById('all-deliveries-tbody')];\n }\n\n gripContainers.forEach(klass => {\n document.querySelectorAll(`.${klass} .fa-grip-vertical`).forEach(box => {\n box.addEventListener('touchmove', (e) => e.preventDefault());\n });\n });\n const drake = dragula(deliveriesTableBody, { moves: (el, _source, handle) => (\n !el.classList.contains('money-row') && handle.classList.contains('fa-grip-vertical')),\n accepts: (_el, _target, _source, sibling) => (!(sibling === null))\n });\n // keeps the styling of the dragged element (mirror) the same as origin\n drake.on('drag', function (el) {\n const tbodyId = $(el).parent().attr('id');\n for (let i = 0; i < el.children.length; i++) {\n const td_width = $(`#${tbodyId}`)[0].children[0].children[i].offsetWidth;\n el.children[i].style.width = td_width + 'px';\n }\n })\n\n drake.on('drop', (el, _target, _source) => {\n orderChanged = true\n const tbodyId = $(el).parent().attr('id');\n pendingVisitsChanged = pendingVisitsChanged || tbodyId == \"pending-deliveries-tbody\";\n });\n\n if (body.hasClass('drivers daily_route_plan')) {\n $('#save-daily-visits-schedule-btn').on('click', e => saveDailyRoutePlanVisitsSchedule(e, '#optimize_daily_route_visits', pendingVisitsChanged));\n }\n }\n\n renderOrderItemsTable()\n initTaskPhotoModal();\n\n $('.bulk-duplicate').click(() => {\n $('.task_ids').val([...checkedSet].join(','))\n $('#bulk-duplicate-modal').modal('show')\n })\n\n $('.bulk-add-group-btn').click(e => {\n e.preventDefault()\n const form = $(e.target).closest('form')\n form.find('#visits_ids').val([...selectedVisits].join(','));\n\n form.submit()\n })\n\n $('.clear-time-windows').click(e => {\n e.preventDefault();\n\n Swal.fire({\n title: i18n.t('shared.are_you_sure'),\n text: i18n.t('models.task.tm_delete_warning'),\n icon: 'warning',\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn btn-danger',\n confirmButtonText: i18n.t('views.routes.delete.confirm'),\n cancelButtonText: i18n.t('cancel'),\n cancelButtonClass: 'btn btn-grey'\n }).then(async (result) => {\n if (result.isConfirmed) {\n $('#clear_time_windows_ids').val([...selectedVisits].join(','));\n $(e.target).closest('form').submit();\n }\n })\n })\n\n $('.time-window-edit').on('click', (e) => {\n const target = $(e.currentTarget)\n const taskId = target.data('task-id')\n const visitId = target.data('visit-id')\n const earliestTime = target.data('earliest-at')\n const latestTime = target.data('latest-at')\n const visitType = target.data('visit-type')\n if (visitType) {\n $('.about-task').text(`${visitType} - ${taskId}, ${target.data('address')}`)\n }\n $('#time-window-edit-modal').modal('show')\n $('#time-window-visit-id').val(visitId)\n $(\"#time-window-earliest-at\").timepicker('setTime', earliestTime)\n $(\"#time-window-latest-at\").timepicker('setTime', latestTime)\n })\n\n $('#time-window-submit').on('click', () => {\n const visitId = $('#time-window-visit-id').val()\n const earliestAt = $('#time-window-earliest-at').val()\n const latestAt = $('#time-window-latest-at').val()\n\n fetch(`/api/web/tasks/set_time_window?visit_id=${visitId}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({\n earliest_at: earliestAt,\n latest_at: latestAt\n })\n }).then(res => res.json()).then((data) => {\n $(`.time-window-${data.visit_id}`).text(`${data.earliest_at} - ${data.latest_at}`)\n $(`.time-window-edit-${data.visit_id}`).data('earliest-at', data.earliest_at).data('latest-at', data.latest_at)\n $('#time-window-edit-modal').modal('hide')\n showNotification({ message: i18n.t('saved_successfully') })\n Ladda.stopAll()\n })\n })\n\n setUpTaskPanelView();\n initTooltips($('.task-sms-tooltip').not('.tooltipstered'), '/tasks/:id/sms_logs', 800, taskSmsTooltip)\n\n if (gon.multi_timeline) {\n $('.timeline-chart-container').addClass('d-none');\n\n const startTime = gon.actual_start_time || gon.start_time;\n const endTime = gon.actual_end_time || gon.end_time;\n initMultiRouteTimeline('multi-timeline-chart', gon.multi_timeline, startTime, endTime);\n } else {\n $('.timeline-chart-container').removeClass('d-none');\n initRouteTimeline('timeline-chart', gon.timeline, gon.start_time, gon.end_time)\n }\n\n $(window).bind('beforeunload', () => { if (orderChanged) return i18n.t('shared.unsaved_changes') });\n\n initEscButtonEvent('.unselect-all-checkboxes');\n\n $('.route-tab-links').click((e) => {\n if (selectedVisits.size > 0) { $('.unselect-all-checkboxes').click(); }\n });\n\n $('.order-item-summary-btn').off('click').on('click', (e) => orderItemsSummaryModal(e, gon.task_ids.join(','), e.currentTarget.dataset.routeId));\n\n $('.lnk-route-versions').on('click', (e) => {\n const container = $(\"#route-history-modal-body\");\n const historyModal = $(\"#route-history-modal\");\n\n if (container.text().length > 0) {\n $(historyModal).modal(\"show\");\n } else {\n $('.data-preloader').removeClass('d-none');\n const routeId = e.currentTarget.dataset.routeId;\n fetch(`/routes/${routeId}/versions`)\n .then(res => res.text()).then(html => {\n $(container).html(html);\n $(historyModal).modal(\"show\");\n $('.data-preloader').addClass('d-none');\n });\n }\n });\n\n $('#eta-sms-form').on('submit', () => {\n $('#eta-visit-ids').val($('.bulk-eta-visit-checkbox:checked').map((_i, el) => $(el).data('visit-id')).get().join(','));\n })\n\n $('.toggle-all-eta-visits').on('change', (e) => {\n $('.bulk-eta-visit-checkbox').prop('checked', e.currentTarget.checked)\n })\n\n $('.form-re-optimize-route').on('submit', (e) => {\n e.preventDefault();\n\n Swal.fire({\n text: i18n.t('views.routes.re_optimization_alert'),\n icon: \"warning\",\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn font-weight-bold btn-primary',\n cancelButtonClass: 'btn btn-grey',\n confirmButtonText: i18n.t('yes_str'),\n cancelButtonText: i18n.t('no_str'),\n html: `\n ${i18n.t('views.routes.re_optimization_alert')}\n
\n \n \n
\n `\n }).then(function (result) {\n if (result.value) {\n const hideWarning = $('#hide-re-optimization-warning').is(':checked');\n $('#optimize_daily_route_hide_re_optimization_warning').val(hideWarning);\n $('.form-re-optimize-route').unbind('submit').submit();\n } else {\n Ladda.stopAll();\n }\n });\n })\n }\n\n if(body.hasClass('routes index')) {\n $('.send-json').on('click', async e => {\n const checked = $('.bulk-route-checkbox').filter(':checked')\n const url = e.currentTarget.dataset.url\n const res = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ route_ids: checked.map((idx, i) => (i.dataset.routeId)).get() })\n })\n const data = await res.json()\n if (res.status === 200) {\n showNotification({message: data.message})\n Ladda.stopAll()\n } else {\n showNotification({message: data.message, type: 'danger'})\n Ladda.stopAll()\n }\n })\n\n const mapContainer = document.getElementById('routes_map')\n const routesMap = initMap(mapContainer, mapCallback)\n const routesTable = $('#routes-table').DataTable({\n drawCallback: (settings) => {\n const api = new $.fn.dataTable.Api(settings)\n $(api.table().body()).unhighlight().highlight(api.search())\n if (!$('.route-drivers-select2').hasClass(\"select2-hidden-accessible\")) {\n $('.route-drivers-select2').each((i, d) => initRouteDriversSelect(d))\n }\n if (!$('.route-vehicles-select2').hasClass(\"select2-hidden-accessible\")) {\n $('.route-vehicles-select2').each((i, d) => initRouteVehiclesSelect(d))\n }\n if (!$('.route-assistant-driver-select2').hasClass(\"select2-hidden-accessible\")) {\n $('.route-assistant-driver-select2').each((i, d) => initRouteAssistantDriverSelect(d))\n }\n },\n dom: 'B<\"top\"i>rt<\"bottom\"><\"clear\">',\n initComplete: () => {\n $('#colvis').append($('.buttons-colvis'))\n $('.dt-buttons').remove()\n },\n searchHighlight: true,\n bInfo: false,\n paging: false,\n responsive: true,\n columnDefs: [\n { targets: 'actions', width: 50 },\n { targets: 'invisible', visible: false },\n { targets: 'sort-weights', type: 'numeric', orderDataType: 'sort-weights' },\n {\n targets: 3,\n render: (data, type) =>{\n if (type === 'sort' || type === 'filter') {\n return $(data).data('driver')\n } else {\n return data\n }\n }\n },\n {\n targets: 4,\n render: (data, type) =>{\n if (type === 'sort' || type === 'filter') {\n try {\n return $(data).data('vehicle')\n } catch {\n return data\n }\n } else {\n return data\n }\n }\n }\n ],\n stateSave: true,\n colReorder: { fixedColumnsLeft: 1 },\n stateDuration: 0,\n stateSaveParams: (_settings, data) => {\n data.columns.forEach(column => { delete column.search })\n delete data.search\n delete data.length\n delete data.start\n delete data.order\n },\n buttons: [\n { extend: 'colvis', columns: ':not(.noVis)' }\n ],\n language: defaultTranslations(),\n })\n\n initCustomColvis(routesTable);\n $.fn.dataTable.ext.order['sort-weights'] = function(settings, col) {\n return this.api().column(col, {order:'index'}).nodes().map((data) => {\n return $(data).data('colsort');\n });\n }\n\n const routeIds = (table) => (\n table.rows({ filter: 'applied' }).data().toArray().map((route) => (\n $(route[0]).find('input').attr('data-route-id')\n ))\n )\n\n routesTable.settings().init().snapshot = routeIds(routesTable)\n\n routesTable.on('search.dt', () => {\n const idsSnapshot = routeIds(routesTable);\n const currentSnapshot = routesTable.settings().init().snapshot;\n\n if (arrayXor(currentSnapshot, idsSnapshot).length !== 0) {\n routesTable.settings().init().snapshot = idsSnapshot;\n if (currentSnapshot != null) $('#routes-table').trigger('datachange.dt')\n }\n }).on('datachange.dt', () => {\n mapCallback(routesMap, routeIds(routesTable))\n })\n\n const handleTableSpace = () => { adjustTableSpaceWithMap(routesTable, $('#routes_map'), 3, 100) }\n routesTable.on('column-visibility.dt', () => { handleTableSpace() })\n routesTable.on('column-reorder', () => { routesTable.draw() })\n const mapPanel = $(\".offcanvas-custom\")\n if (mapPanel.length) {\n const onPanelOpen = () => { setTimeout(() => { fitBounds(routesMap) }, 50) }\n initSidePanel(mapPanel, '.offcanvas-resize-toggle', onPanelOpen, handleTableSpace)\n initPanelMapMoving(1400, () => { fitBounds(routesMap) })\n }\n handleTableSpace()\n\n $('.table-search').on('input', debounce(search(routesTable), 500));\n\n ['driver', 'vehicle'].forEach((name) => {\n initFilter($(`input[name=filter${capitalize(name)}]`), routesTable, columnIndexByName(routesTable, name))\n })\n initFilter($(`input[name=filterStatus]`), routesTable, columnIndexByName(routesTable, 'status'), () => {}, false)\n initFilter($(`input[name=filterLock]`), routesTable, columnIndexByName(routesTable, 'is_locked'))\n\n $('#select-all-routes').click(e => {\n $('.bulk-route-checkbox').prop('checked', e.target.checked)\n $(document).trigger('selectedUpdated')\n })\n\n $('.bulk-route-checkbox').click(e => {\n $(document).trigger('selectedUpdated')\n $(e.currentTarget).parents('tr').css('background-color', e.target.checked ? 'aliceblue' : '')\n })\n\n $(document).on('selectedUpdated', () => {\n updateFloatingActionsVisibility($('.bulk-route-checkbox').filter(':checked').length)\n })\n\n $('.unselect-all-checkboxes').click(() => {\n $('#select-all-routes').prop('checked', false);\n $('.bulk-route-checkbox').prop('checked', false);\n $(document).trigger('selectedUpdated');\n })\n\n $('#bulk-delete-button').click(() => {\n const checked = $('.bulk-route-checkbox').filter(':checked')\n $('#bulk_destroy_route_ids').val(checked.map((idx, i) => (i.dataset.routeId)).get())\n Swal.fire({\n title: i18n.t('views.routes.delete.warning.title'),\n text: i18n.t('views.routes.delete.warning.text'),\n icon: 'warning',\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn btn-danger',\n confirmButtonText: i18n.t('views.routes.delete.confirm'),\n cancelButtonText: i18n.t('cancel'),\n cancelButtonClass: 'btn btn-grey'\n }).then(async (result) => {\n if (result.isConfirmed) {\n $('.bulk-delete-form').submit()\n } else {\n Ladda.stopAll();\n }\n })\n })\n\n $('#bulk-optimize-button').click(async () => {\n const checked = $('.bulk-route-checkbox').filter(':checked')\n const res = await fetch('routes/bulk_optimize', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({\n date: 1,\n route_ids: checked.map((idx, i) => (i.dataset.routeId)).get()\n })\n })\n if (res.status === 200) {\n showNotification({message: i18n.t('drivers.optimize_daily_route.async_optimization_web_api_msg')})\n Ladda.stopAll()\n } else {\n showNotification({message: i18n.t('errors.something_wrong'), type: 'danger'})\n Ladda.stopAll()\n }\n })\n\n $('.bulk-print-waybills-routes-form, .admin-summary-routes').on('submit', (_e) => {\n const checked = $('.bulk-route-checkbox').filter(':checked');\n $('.hidden-routes').val(checked.map((_idx, i) => (i.dataset.routeId)).get());\n })\n }\n\n if (body.hasClass('routes index') || body.hasClass('routes daily_plan')) {\n const redirectUrl = body.hasClass('routes index') ? '/routes' : '/routes/daily_plan' + window.location.search;\n\n $('.delete_route').click(e => {\n e.preventDefault();\n const url = e.currentTarget.dataset.url;\n\n Swal.fire({\n title: i18n.t('views.routes.delete.warning.title'),\n text: i18n.t('views.routes.delete.warning.text'),\n icon: 'warning',\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn btn-danger',\n confirmButtonText: i18n.t('views.routes.delete.confirm'),\n cancelButtonText: i18n.t('cancel'),\n cancelButtonClass: 'btn btn-grey'\n }).then(async (result) => {\n if (result.isConfirmed) {\n const [response] = await Promise.all([fetchJSON(url, 'DELETE', {})]);\n Swal.fire(\n i18n.t('views.routes.delete.successfully_deleted'),\n response.message,\n 'success'\n ).then(() => {\n window.location.href = redirectUrl\n })\n } else {\n Ladda.stopAll();\n }\n })\n })\n\n initCreateRouteModal()\n }\n\n if (body.hasClass('routes daily_plan')) {\n let activeRouteId = null\n let activeRouteLocked = null\n let activeRouteMaxWeight = null\n let unsavedChanges = false\n\n const routesTable = initRoutesIndexTable($('#routes-table'));\n $('.table-search').on('input', search(routesTable));\n const routeVisitsTable = initRouteVisitsTable($('#route-visits-table'))\n const unassignedVisitsTable = initUnassignedVisitsTable($('#unassigned-visits-table'))\n unassignedVisitsTable.rows.add(gon.unassigned_visits).draw()\n\n $('.route-row').on('click', (e) => {\n if (unsavedChanges && !confirm(i18n.t('shared.unsaved_changes'))) return\n\n unsavedChanges = false\n activeRouteId = e.currentTarget.dataset.routeId\n activeRouteLocked = e.currentTarget.dataset.locked === 'true'\n activeRouteMaxWeight = parseFloat(e.currentTarget.dataset.maxWeight)\n const routeName = $(e.currentTarget).find('.route-name').text()\n $('.route-row').removeClass('active')\n\n $(`.route-row[data-route-id=\"${activeRouteId}\"]`).addClass('active')\n\n $('.data-preloader').removeClass('d-none')\n fetch(`/routes/${activeRouteId}/visits`).then(res => res.json()).then(visits => {\n visits.forEach((v, i) => v.order_id = i + 1)\n routeVisitsTable.clear()\n routeVisitsTable.rows.add(visits).draw()\n updateWeightProgress(visits.reduce((acc, v) => acc + v.weight_number, 0), activeRouteMaxWeight)\n $('#route-visits-title').html(`${routeName} - ${i18n.t('models.visit.visits')} (${visits.length})`)\n $('#route-visits-placeholder').addClass('d-none')\n $('#route-visits-wrapper').addClass('d-flex').removeClass('d-none')\n $('.data-preloader').addClass('d-none')\n })\n })\n\n const dragAndDrop = dragula({\n containers: [document.getElementById('route-visits-table-tbody'),\n document.getElementById('unassigned-visits-table-tbody'),\n document.getElementById('fake-table-tbody')],\n moves: (_el, _source, handle) => (handle.classList.contains('fa-grip-vertical')),\n accepts: (_el, target, _source, sibling) => (!activeRouteLocked && !(target.id === 'fake-table-tbody' && sibling === null))\n })\n\n $('#unassigned-visits-table-tbody, #route-visits-table-tbody').on('click', '.quick-move', (e) => {\n if (!activeRouteId) { showNotification({ message: i18n.t('views.routes.choose_route'), type: 'warning' }); return }\n if (activeRouteLocked) { showNotification({ message: i18n.t('views.routes.route_locked'), type: 'warning' }); return }\n\n unsavedChanges = true\n let order = currentOrder()\n const to = e.currentTarget.dataset.to\n const visitId = $(e.currentTarget).closest('tr').data('visit-id')\n const rowId = `#visit-row-${visitId}`\n\n const fromTable = $(e.currentTarget).closest('table').DataTable()\n const toTable = $(to).DataTable()\n const data = fromTable.row(rowId).data()\n\n fromTable.row(rowId).remove().draw()\n toTable.rows.add([data]).draw()\n\n if (to === '#route-visits-table') {\n order.set(parseInt(visitId), order.size + 1)\n } else {\n order = currentOrder()\n }\n\n reorderTable(routeVisitsTable, order)\n updateWeightProgress(routeVisitsTable.rows().data().toArray().reduce((acc, v) => acc + v.weight_number, 0), activeRouteMaxWeight)\n })\n\n dragAndDrop.on('drop', (el, target, source) => {\n const order = currentOrder()\n\n if (target.id === 'fake-table-tbody') {\n order.set(parseInt(el.dataset.visitId), order.size + 1)\n $(target).find(`#visit-row-${el.dataset.visitId}`).remove()\n target = document.getElementById('route-visits-table-tbody')\n }\n\n if (target.id === source.id && source.id === 'unassigned-visits-table-tbody') return\n unsavedChanges = true\n\n const fromTable = $(source).closest('table').DataTable()\n const toTable = $(target).closest('table').DataTable()\n\n if (target !== source) {\n const data = fromTable.row(`#${el.id}`).data()\n fromTable.row(`#${el.id}`).remove().draw()\n toTable.rows.add([data]).draw()\n }\n\n reorderTable(routeVisitsTable, order)\n updateWeightProgress(routeVisitsTable.rows().data().toArray().reduce((acc, v) => acc + v.weight_number, 0), activeRouteMaxWeight)\n })\n\n dragAndDrop.on('dragend', () => {\n if (activeRouteLocked) showNotification({ message: i18n.t('views.routes.route_locked'), type: 'warning' })\n })\n\n $('#save-route-btn').on('click', () => {\n const order = currentOrder()\n\n fetch(`/routes/${activeRouteId}/set_visits`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ visits: Object.fromEntries(order) })\n }).then(res => {\n if (res.status === 200) {\n routesTable.cell(`[data-route-id='${activeRouteId}'] .route-visits-count`).data(order.size)\n showNotification({ message: i18n.t('saved_successfully'), type: 'success' })\n unsavedChanges = false\n } else {\n showNotification({ message: i18n.t('errors.something_wrong'), type: 'danger' })\n }\n Ladda.stopAll()\n })\n })\n }\n\n if (body.hasClass('routes daily_plan2')) {\n import('../react_components/routes/daily_plan/index')\n }\n\n if (body.hasClass('drivers daily_route_plan')) {\n ['all-deliveries', 'failed-deliveries', 'pending-deliveries',\n 'done-deliveries', 'unassigned-deliveries', 'unloaded-deliveries']\n .forEach((elemId) => {\n $(`.${elemId}-select-all-checkboxes`).click((e) => {\n clearOtherCheckboxes(elemId);\n selectedVisits.clear();\n const $checkboxes = $(`.${elemId}-bulk-checkbox`);\n\n if (e.target.checked) {\n $checkboxes.each((_, box) => {\n $(box).prop('checked', true);\n selectedVisits.add(box.getAttribute('visit-id'));\n checkedSet.add(box.getAttribute('task-id'));\n $('.hidden-tasks').val([...checkedSet].join(','));\n $('.bulk_visit_ids').val([...selectedVisits].join(','));\n });\n } else {\n $(`.${elemId}-bulk-checkbox`).prop('checked', false);\n selectedVisits.clear();\n checkedSet.clear();\n $('.hidden-tasks').val('');\n $('.bulk_visit_ids').val('');\n }\n\n calculateVisitsSummary(`.${elemId}-bulk-checkbox`);\n updateBulkEdit();\n updateFloatingActionsVisibility(selectedVisits.size);\n })\n\n $(document).on('change', `.${elemId}-bulk-checkbox`, function () {\n if (this.checked) {\n selectedVisits.add($(this).attr('visit-id'));\n checkedSet.add($(this).attr('task-id'));\n } else {\n selectedVisits.delete($(this).attr('visit-id'));\n checkedSet.delete($(this).attr('task-id'));\n }\n\n $('.hidden-tasks').val([...checkedSet].join(','));\n $('.bulk_visit_ids').val([...selectedVisits].join(','));\n\n if (body.hasClass('routes plan') || body.hasClass('drivers daily_route_plan'))\n calculateVisitsSummary(`.${elemId}-bulk-checkbox`);\n updateBulkEdit();\n updateFloatingActionsVisibility(selectedVisits.size);\n })\n\n $(document).on('click', '.bulk-send-sms-submit-btn', (e) => {\n e.preventDefault();\n sumitBulkSmsForm(e, [...selectedVisits]);\n })\n })\n\n $('.unselect-all-checkboxes').click(() => {\n ['all-deliveries', 'failed-deliveries', 'pending-deliveries', 'done-deliveries',\n 'unassigned-deliveries', 'unloaded-deliveries']\n .forEach((elemId) => {\n $(`.${elemId}-select-all-checkboxes`).prop('checked', false);\n $(`.${elemId}-bulk-checkbox`).prop('checked', false);\n })\n\n selectedVisits.clear();\n checkedSet.clear();\n updateBulkEdit();\n updateFloatingActionsVisibility(selectedVisits.size);\n })\n\n $('#line-polygon').change(event => {\n const polygon = event.currentTarget.value;\n const positiveVisits = visitsInPolygon(gon.visits_data, polygon);\n $('#js_clear_polygons').removeClass('d-none');\n updateCheckboxes(positiveVisits, true);\n updateBulkEdit();\n })\n\n $('#js_clear_polygons').click((event) => {\n $(event.target).addClass('d-none');\n window['daily_route_mapPolygons'].forEach(polygon => {\n const polygonVisits = visitsInPolygon(gon.visits_data, transformCoords(polygon.getLatLngs()));\n updateCheckboxes(polygonVisits);\n })\n\n window['daily_route_mapPolygons'].forEach(polygon => polygon.remove());\n window['daily_route_mapPolygons'] = [];\n updateBulkEdit();\n })\n }\n\n $(document).on('change', '.bulk-visit-checkbox', function () {\n if (this.checked) selectedVisits.add($(this).attr('visit-id'))\n else selectedVisits.delete($(this).attr('visit-id'))\n if (body.hasClass('routes plan') || body.hasClass('drivers daily_route_plan')) { calculateVisitsSummary(); }\n updateBulkEdit()\n })\n\n $('#bulk-edit-button').on('click', () => {\n $('.visit_ids')[0].value = [...selectedVisits].join(',')\n $('#bulk-update-visits-modal').modal('show')\n })\n\n const updateBulkEdit = () => {\n if (selectedVisits.size) $('#bulk-edit-button').removeAttr('disabled')\n else $('#bulk-edit-button').attr('disabled', 'disabled')\n }\n\n const clearOtherCheckboxes = (elemId) => {\n const elements = ['all-deliveries', 'failed-deliveries', 'pending-deliveries', 'done-deliveries', 'unassigned-deliveries'];\n const elemIndex = elements.indexOf(elemId);\n elements.splice(elemIndex, 1);\n\n elements.forEach((elem) => {\n $(`.${elem}-select-all-checkboxes`).prop('checked', false);\n $(`.${elem}-bulk-checkbox`).prop('checked', false);\n });\n }\n})\n\nconst updateWeightProgress = (currentWeight, maxWeight) => {\n $('.weight-progress-container').toggleClass('d-flex', !!maxWeight).toggleClass('d-none', !maxWeight)\n if ($('.no-vehicle-weight').length > 0) { $('.no-vehicle-weight').remove() }\n if (!maxWeight) {\n $('#route-visits-title').after(`
${i18n.t('models.order_item.weight')}: ${currentWeight}
`)\n return\n }\n\n const percents = currentWeight / maxWeight * 100\n let backgroundClass = backgroundByPercents(percents)\n\n $('.weight-progress .progress-bar').css('width', `${percents}%`)\n .removeClass((i, className) => (className.match (/(^|\\s)bg-\\S+/g) || []).join(' '))\n .addClass(backgroundClass)\n $('.weight-percents').text(`${percents.toFixed(2)}% (${currentWeight}/${maxWeight})`)\n\n $(\"#weight\").removeClass (function (index, className) {\n return (className.match (/(^|\\s)color-\\S+/g) || []).join(' ');\n });\n}\n\nconst currentOrder = () => {\n const order = new Map()\n $('#route-visits-table-tbody tr').each((i, el) => { parseInt(el.dataset.visitId) ? order.set(parseInt(el.dataset.visitId), i + 1) : null })\n return order\n}\n\nconst reorderTable = (table, order) => {\n table.rows().every((rowId) => {\n const row = table.row(rowId)\n row.data({ ...row.data(), order_id: order.get(row.data().id) }).draw()\n })\n table.order(0, 'asc')\n}\n\nconst mapCallback = async (map, ids = null) => {\n map.eachLayer(layer => { if (!layer.options.maxZoom) layer.remove() })\n const featureGroups = []\n let routes = gon.routes\n if (ids) {\n routes = routes.filter(r => (ids.includes(r.id.toString())))\n }\n routes.forEach(route => {\n const allMarkers = []\n const color = route.color\n\n route.visits.filter(v => v.lat && v.lng).forEach(visit => {\n const icon = L.divIcon({\n className: \"box\",\n iconAnchor: [10, 34],\n html: `\n \n \n \n `\n })\n const contentString = constructFancyInfoWindowContent(visit)\n allMarkers.push(L.marker([visit.lat, visit.lng], { icon: icon }).bindPopup(contentString, { offset: [0, -20] }).openPopup().addTo(map))\n })\n if (route.polyline) {\n const decodedPolyline = decodePolyline(route.polyline)\n const startEndMarkers = createStartEndMarkers([], decodedPolyline)\n L.featureGroup(startEndMarkers).addTo(map)\n\n L.featureGroup(\n [L.polyline(decodePolyline(route.polyline),\n {...POLYLINE_OPTIONS, color: color}).arrowheads(ARROWHEADS_OPTIONS)]\n ).addTo(map)\n }\n\n if (allMarkers.length) {\n featureGroups.push(L.featureGroup(allMarkers).addTo(map))\n }\n })\n\n if (featureGroups.length) {\n const firstGroup = featureGroups.shift()\n let bounds = firstGroup.getBounds()\n featureGroups.forEach(fg => {\n bounds = bounds.extend(fg.getBounds())\n })\n map.fitBounds(bounds, { padding: [10, 10] })\n }\n}\n\nconst constructFancyInfoWindowContent = (\n {\n dest_add = '',\n recipient_name: name = '',\n visit_at,\n kind,\n route,\n company_name = undefined,\n task: {\n destination_phone: phone,\n id: task_id,\n wp_order_id: wp_order_id = undefined\n }\n }\n) => {\n return `
\n \n
\n \n \n ${route.name}:\n \n ${dest_add}\n \n
\n
\n ${visit_at}\n ${kind ? i18n.t(`models.visit.kind_enum.${kind}`) : ''}\n
\n
\n ${company_name ? ` ${company_name}` : ''}\n ${wp_order_id ? `${wp_order_id}` : ''}\n
\n
\n ${phone ? ` ${phone}` : ''}\n ${name ? ` ${name}` : ''}\n
\n
`\n}\n\nconst calculateVisitsSummary = (klass = \"\") => {\n var elemKlass = klass ? klass : '.bulk-visit-checkbox';\n var totalSurfaces = 0;\n var totalWeight = 0;\n var totalVolume = 0;\n\n $(elemKlass).each((_, box) => {\n if (box.checked) {\n totalSurfaces += parseFloat(box.getAttribute('task-surfaces-quantity') || '0');\n totalWeight += +parseFloat(box.getAttribute('task-weight') || '0').toFixed(2);\n totalVolume += +parseFloat(box.getAttribute('task-volume') || '0').toFixed(2);\n }\n })\n\n if (totalSurfaces === 0 && totalWeight === 0 && totalVolume === 0) {\n $('.floating-actions-summary').addClass('d-none').removeClass('d-flex');\n } else {\n $('.floating-actions-summary').removeClass('d-none').addClass('d-flex');\n\n $('.selected-visits-surfaces-container').toggleClass('d-none', totalSurfaces === 0).toggleClass('d-flex', totalSurfaces !== 0);\n $('.selected-visits-weight-container').toggleClass('d-none', totalWeight === 0).toggleClass('d-flex', totalWeight !== 0);\n $('.selected-visits-volume-container').toggleClass('d-none', totalVolume === 0).toggleClass('d-flex', totalVolume !== 0);\n }\n\n $('.selected-visits-surfaces').html(totalSurfaces);\n $('.selected-visits-weight').html(totalWeight);\n $('.selected-visits-volume').html(totalVolume);\n}\n\nconst sumitBulkSmsForm = (e, visits) => {\n $('.bulk_visit_ids').val(visits);\n $(e.target).closest('form').submit();\n $('#bulk-send-sms-to-route-modal').modal('hide');\n}\n\nconst updateCheckboxes = (positiveVisits, isChecked) => {\n for (let i = 0; i < positiveVisits.length; i++) {\n const visitId = positiveVisits[i].visit_id\n const taskId = positiveVisits[i].task.id\n const el = $('input[visit-id=' + visitId.toString() + ']')\n\n if (isChecked) {\n selectedVisits.add(visitId);\n checkedSet.add(taskId.toString())\n el.prop('checked', true)\n el.parents('tr').css('background-color', 'aliceblue')\n $('.visits-bulk-actions-btn').prop('disabled', false)\n } else {\n selectedVisits.delete(visitId);\n checkedSet.delete(taskId.toString());\n el.prop('checked', false)\n el.parents('tr').css('background-color', '')\n }\n }\n\n updateFloatingActionsVisibility(selectedVisits.size);\n}\n","import {createStartEndMarkers, initRoutesTable, showIturanRoutes} from \"../helpers/routes/routes\";\nimport {initPanelMapMoving, initSidePanel, initVehiclesDropdown} from \"../helpers/view\";\nimport { saveDailyVisitsSchedule } from \"../actions/drivers\";\nimport {getDateFormat, getFormattedDate, matchStart} from \"../helpers/date\";\nimport { isRTL } from \"../helpers/locale\";\nimport { i18n } from \"../helpers/i18n\";\nimport {initRouteDriversSelect} from \"../helpers/visits/common\";\nimport Swal from 'sweetalert2';\nimport {decodePolyline, initMap} from \"../services/map\";\nimport {adjustTableSpaceWithMap} from \"../helpers/datatables\";\nimport { fitBounds, locationsApiPoll, renderNumberedUnitedMarkers } from \"../helpers/leaflet\";\nimport {ARROWHEADS_OPTIONS, POLYLINE_OPTIONS} from \"../constants\";\nimport { initCustomColvis } from \"../helpers/tables/colvis\";\nimport { setupMapPanelViewLink } from \"../helpers/panel_view\";\n\n$(() => {\n const body = $('body')\n\n const mapCallback = async map => {\n let controlLayers\n if (gon.optimized) {\n const undoneMarkers = renderNumberedUnitedMarkers(gon.undone_visits).undone\n const completedMarkers = renderNumberedUnitedMarkers(gon.done_visits)\n const doneMarkers = completedMarkers.done\n const failedMarkers = completedMarkers.failed\n const doneRoute = decodePolyline(gon.done_route)\n const undoneRoute = decodePolyline(gon.undone_route)\n const startEndMarkers = createStartEndMarkers(doneRoute, undoneRoute)\n\n const undoneFG = L.featureGroup(undoneMarkers).addTo(map)\n const doneFG = L.featureGroup(doneMarkers).addTo(map)\n const failedFG = L.featureGroup(failedMarkers).addTo(map)\n const startEndFG = L.featureGroup(startEndMarkers).addTo(map)\n const undoneRouteFG = L.featureGroup([L.polyline(undoneRoute, {...POLYLINE_OPTIONS, color: 'red'}).arrowheads(ARROWHEADS_OPTIONS)]).addTo(map)\n\n const overlays = {\n [i18n.t('views.map.undone_tasks')]: undoneFG,\n [i18n.t('views.map.done_tasks')]: doneFG,\n [i18n.t('views.map.failed_tasks')]: failedFG,\n [i18n.t('views.map.start_end_points')]: startEndFG,\n [i18n.t('views.map.undone_route')]: undoneRouteFG\n }\n controlLayers = L.control.layers(null, overlays).addTo(map)\n if (undoneMarkers.length || doneMarkers.length || failedMarkers.length) {\n map.fitBounds(\n undoneFG.getBounds().extend(doneFG.getBounds()).extend(failedFG.getBounds()).extend(startEndFG.getBounds()),\n { padding: [10, 10] }\n )\n }\n\n } else {\n const markers = renderNumberedUnitedMarkers(gon.full_visits, false)\n\n const undoneFG = L.featureGroup(markers.undone).addTo(map)\n const doneFG = L.featureGroup(markers.done).addTo(map)\n const failedFG = L.featureGroup(markers.failed).addTo(map)\n\n const overlays = {\n [i18n.t('views.map.undone_tasks')]: undoneFG,\n [i18n.t('views.map.done_tasks')]: doneFG,\n [i18n.t('views.map.failed_tasks')]: failedFG\n }\n\n controlLayers = L.control.layers(null, overlays).addTo(map)\n\n if (markers.done.length || markers.undone.length || markers.failed.length) {\n map.fitBounds(undoneFG.getBounds().extend(doneFG.getBounds()).extend(failedFG.getBounds()), { padding: [10, 10] })\n }\n }\n\n if (gon.driver_id) {\n await locationsApiPoll(gon.driver_id, map, controlLayers)\n }\n\n if (gon.show_ituran_route) {\n showIturanRoutes(map, `/routes/${gon.route_id}/ituran_routes`, controlLayers);\n }\n\n setupMapPanelViewLink();\n }\n\n if (body.hasClass('routes plan')) {\n $('.select2-init-transfer').select2({\n dir: i18n.t('direction'),\n width: '100%',\n placeholder: i18n.t('views.routes.transfer_route'),\n matcher: (params, data) => matchStart(params, data)\n })\n\n $('.edit-route-btn').click(() => $('#edit-route').modal('show'))\n\n const mapContainer = document.getElementById('route_plan_map')\n const routePlanMap = initMap(mapContainer, mapCallback)\n const routePlanTable = initRoutesTable($('#routes-plan-table'), 'routes_plan', routePlanMap)\n initCustomColvis(routePlanTable)\n const handleTableSpace = () => { adjustTableSpaceWithMap(routePlanTable, $('#route_plan_map'), 3, 100) }\n routePlanTable.on('column-visibility.dt', () => { handleTableSpace() })\n const mapPanel = $(\".offcanvas-custom\")\n if (mapPanel.length) {\n const onPanelOpen = () => { setTimeout(() => { fitBounds(routePlanMap) }, 50) }\n initSidePanel(mapPanel, '.offcanvas-resize-toggle', onPanelOpen, handleTableSpace)\n initPanelMapMoving(992, () => { fitBounds(routePlanMap) })\n }\n handleTableSpace()\n initVehiclesDropdown()\n\n $('.route-set-pick-status').on('click', e => {\n e.preventDefault()\n const form = $(e.target).closest('form')\n form.find('#route_status').val(e.currentTarget.dataset.status)\n form.submit()\n })\n\n $('#save-daily-visits-schedule-btn').on('click', e => saveDailyVisitsSchedule(e,'#optimize_route_visits'))\n\n initRouteDriversSelect($('.route-drivers-select2'), () => location.reload())\n\n const routeDatepicker = $('#route-date-change').datepicker({\n format: getDateFormat(),\n language: i18n.t('locale'),\n rtl: isRTL(),\n orientation: 'bottom',\n defaultDate: getFormattedDate(),\n autoclose: true,\n todayHighlight: true,\n }).on('hide', e => e.stopPropagation())\n\n routeDatepicker.on('focusin', () => { routeDatepicker.data('val', routeDatepicker.datepicker('getDate')) })\n .on('changeDate', () => {\n if (routeDatepicker.data('preventChangeEvent')) { routeDatepicker.data('preventChangeEvent', false); return }\n\n Swal.fire({\n title: i18n.t('views.routes.change_date_warning'),\n icon: 'warning',\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn btn-success',\n confirmButtonText: i18n.t('yes_str'),\n cancelButtonText: i18n.t('cancel'),\n cancelButtonClass: 'btn btn-grey'\n }).then((result) => {\n if (result.isConfirmed) {\n routeDatepicker.closest('form').submit();\n } else {\n routeDatepicker.data('preventChangeEvent', true);\n routeDatepicker.datepicker('setDate', routeDatepicker.data('val'));\n }\n })\n })\n }\n})\n","import { initVisitDriversSelect, initVisitPickUpAtDatepicker } from \"../helpers/visits/common\";\nimport { ajaxForm, availableContentSpace } from \"../helpers/utils\";\nimport Swal from \"sweetalert2/dist/sweetalert2\";\nimport {createStartEndMarkers, createStartEndMarkersPlanned, initRoutesTable, showIturanRoutes} from \"../helpers/routes/routes\";\nimport { i18n } from \"../helpers/i18n\";\nimport { fitBounds, locationsApiPoll, renderNumberedUnitedMarkers, enableDrawTool, transformCoords } from \"../helpers/leaflet\";\nimport {ARROWHEADS_OPTIONS, isDev, POLYLINE_OPTIONS} from \"../constants\";\nimport { decodePolyline, initMap } from \"../services/map\";\nimport { adjustTableSpaceWithMap } from \"../helpers/datatables\";\nimport { initPanelMapMoving, initSidePanel, initVehiclesDropdown } from \"../helpers/view\";\nimport { handleTaskPickStatusModal, updateTaskPickStatus } from \"../actions/tasks\";\nimport { initCustomColvis } from \"../helpers/tables/colvis\";\nimport { setupMapPanelViewLink } from \"../helpers/panel_view\";\n\n$(() => {\n const body = $('body')\n\n const mapCallback = async map => {\n let controlLayers\n if (gon.optimized) {\n const undoneMarkers = renderNumberedUnitedMarkers(gon.undone_visits).undone\n const completedMarkers = renderNumberedUnitedMarkers(gon.done_visits)\n const doneMarkers = completedMarkers.done\n const failedMarkers = completedMarkers.failed\n const doneRoute = decodePolyline(gon.done_route)\n const undoneRoute = decodePolyline(gon.undone_route)\n const startEndMarkers = createStartEndMarkers(doneRoute, undoneRoute)\n\n const undoneFG = L.featureGroup(undoneMarkers).addTo(map)\n const doneFG = L.featureGroup(doneMarkers).addTo(map)\n const failedFG = L.featureGroup(failedMarkers).addTo(map)\n const startEndFG = L.featureGroup(startEndMarkers).addTo(map)\n const undoneRouteFG = L.featureGroup([L.polyline(undoneRoute, {...POLYLINE_OPTIONS, color: 'red'}).arrowheads(ARROWHEADS_OPTIONS)]).addTo(map)\n\n const overlays = {\n [i18n.t('views.map.undone_tasks')]: undoneFG,\n [i18n.t('views.map.done_tasks')]: doneFG,\n [i18n.t('views.map.failed_tasks')]: failedFG,\n [i18n.t('views.map.start_end_points')]: startEndFG,\n [i18n.t('views.map.undone_route')]: undoneRouteFG\n }\n controlLayers = L.control.layers(null, overlays).addTo(map)\n if (undoneMarkers.length || doneMarkers.length || failedMarkers.length) {\n map.fitBounds(\n undoneFG.getBounds().extend(doneFG.getBounds()).extend(failedFG.getBounds()).extend(startEndFG.getBounds()),\n { padding: [15, 15] }\n )\n }\n } else {\n const markers = renderNumberedUnitedMarkers(gon.full_visits, false)\n const startEndMarkers = createStartEndMarkersPlanned(gon.start_point, gon.end_point)\n\n const startEndFG = L.featureGroup(startEndMarkers).addTo(map)\n const undoneFG = L.featureGroup(markers.undone).addTo(map)\n const doneFG = L.featureGroup(markers.done).addTo(map)\n const failedFG = L.featureGroup(markers.failed).addTo(map)\n\n const overlays = {\n [i18n.t('views.map.undone_tasks')]: undoneFG,\n [i18n.t('views.map.done_tasks')]: doneFG,\n [i18n.t('views.map.failed_tasks')]: failedFG,\n [i18n.t('views.map.start_end_points')]: startEndFG\n }\n\n controlLayers = L.control.layers(null, overlays).addTo(map)\n\n if (markers.done.length || markers.undone.length || markers.failed.length) {\n map.fitBounds(undoneFG.getBounds().extend(doneFG.getBounds()).extend(failedFG.getBounds()).extend(startEndFG.getBounds()),\n { padding: [15, 15] })\n }\n }\n\n if (gon.driver_id && !isDev()) {\n await locationsApiPoll(gon.driver_id, map, controlLayers)\n }\n\n if (gon.show_ituran_route) {\n showIturanRoutes(map, `/drivers/${gon.driver_id}/ituran_routes?route_date=${gon.route_date}`, controlLayers);\n }\n\n setupMapPanelViewLink();\n\n // Enable draw tool for polygon\n enableDrawTool(map, '#000', e => {\n const polygon = e.layer;\n $(document).trigger('addedPolygon', polygon);\n $('#line-polygon').val(transformCoords(e.layer.getLatLngs())).trigger('change');\n })\n }\n\n if (body.hasClass('drivers daily_route_plan')) {\n const mapContainer = document.getElementById('daily_route_plan_map')\n const dailyRoutesMap = initMap(mapContainer, mapCallback)\n initVehiclesDropdown()\n\n if(gon.country != 'IL' && !(gon.is_wix || gon.is_shopify)) {\n L.tileLayer('Graphhopper', {\n attribution:\n 'Powered by GraphHopper API'\n }).addTo(dailyRoutesMap);\n }\n\n ['all-deliveries-table', 'failed-deliveries-table', 'pending-deliveries-table', 'done-deliveries-table',\n 'unassigned-deliveries-table', 'unloaded-deliveries-table'].forEach((elemId) => {\n const tableElem = document.getElementById(`${elemId}`);\n if (tableElem) {\n const underscoredElemId = elemId.replaceAll('-', '_');\n const table = initRoutesTable($(tableElem), underscoredElemId, dailyRoutesMap);\n initCustomColvis(table, 190, elemId);\n window[`handle_space_${underscoredElemId}`] = function () { adjustTableSpaceWithMap(table, $('#daily_route_plan_map'), 3, 100) }\n table.on('column-visibility.dt', () => { handleTableSpace() });\n }\n })\n\n window['daily_route_mapPolygons'] = [];\n $(document).on('addedPolygon', (_e, polygon) => {\n window['daily_route_mapPolygons'].push(polygon);\n })\n\n const handleTableSpace = () => {\n ['all-deliveries-table', 'failed-deliveries-table', 'pending-deliveries-table', 'done-deliveries-table',\n 'unassigned-deliveries-table', 'unloaded-deliveries-table'].forEach((elemId) => {\n const tableElem = document.getElementById(`${elemId}`);\n if (tableElem) { window[`handle_space_${elemId.replaceAll('-', '_')}`].call(); }\n })\n\n if (window['daily_route_mapPolygons'].length > 0) {\n $('#line-polygon').trigger('change')\n }\n }\n\n const mapPanel = $(\".offcanvas-custom\")\n if (mapPanel.length) {\n const onPanelOpen = () => { setTimeout(() => { fitBounds(dailyRoutesMap) }, 50) }\n initSidePanel(mapPanel, '.offcanvas-resize-toggle', onPanelOpen, handleTableSpace)\n }\n initPanelMapMoving(992, () => { dailyRoutesMap.invalidateSize(); fitBounds(dailyRoutesMap) })\n handleTableSpace()\n\n initVisitPickUpAtDatepicker($('.daily-route-visit-pickup-date'))\n $('.visit-drivers-select2:not([data-select2-id^=\"select2\"])').each((i, d) => initVisitDriversSelect(d))\n\n $('#quick-invite-button').on('click', () => {\n $('#quick-invite-modal').modal('show')\n })\n $('#push-notification-button').on('click', () => {\n $('#push-notification-modal').modal('show')\n })\n\n ajaxForm($('#driver_notification_form'), (json) => {\n $('#push-notification-modal').modal('hide')\n Swal.fire({\n title: i18n.t('great'),\n html: json.message,\n icon: 'success',\n width: 500,\n heightAuto: false,\n padding: '2.5rem',\n buttonsStyling: false,\n stopKeydownPropagation: false,\n confirmButtonClass: 'btn btn-primary px-6',\n confirmButtonColor: null,\n })\n })\n\n $('#tasks_transfer_form').submit(function(e) {\n e.preventDefault();\n\n Swal.fire({\n text: i18n.t('drivers.daily_route_plan.transfer_confirmation'),\n icon: \"warning\",\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn font-weight-bold btn-primary',\n cancelButtonClass: 'btn btn-grey',\n confirmButtonText: i18n.t('drivers.daily_route_plan.transfer_btn_yes'),\n cancelButtonText: i18n.t('drivers.daily_route_plan.transfer_btn_no')\n }).then(function (result) {\n if (result.value) {\n $('#tasks_transfer_form').unbind('submit').submit();\n } else {\n $('#btn_tasks_transfer').prop(\"disabled\", false);\n }\n });\n });\n\n $('.task-set-pick-status').on('click', (e) => {\n const { taskId, newStatus, packagesQuantity } = e.currentTarget.dataset;\n if (newStatus === 'PICKED') {\n handleTaskPickStatusModal(taskId, newStatus, packagesQuantity);\n } else {\n updateTaskPickStatus(taskId, newStatus);\n }\n })\n\n $('.toggle-optimize').on('click', () => {\n $('.optimize-section').toggleClass('d-none')\n })\n\n $('.daily-route-plan-content').css('height', `${availableContentSpace()}px`)\n\n initSidePanel($(\".resizable-right\"), '.resizable-map-toggle')\n\n handleDragScroll(document.querySelector('.resizable-left'))\n }\n})\n\nconst showActualIturanRoute = (map) => {\n\n}\n\nconst handleDragScroll = (scrollableContainer) => {\n let isDragging = false;\n let shouldScrollTop = false;\n let shouldScrollBottom = false;\n let timeoutId = null;\n\n scrollableContainer.addEventListener('mousedown', () => {\n isDragging = true;\n checkScroll();\n });\n\n document.addEventListener('mousemove', (e) => {\n if (!isDragging) return\n\n let currentY = e.clientY;\n let { top, bottom } = scrollableContainer.getBoundingClientRect();\n\n shouldScrollTop = (currentY - top) < 125;\n shouldScrollBottom = (bottom - currentY) < 125;\n checkScroll()\n });\n\n document.addEventListener('mouseup', () => {\n isDragging = false;\n clearTimeout(timeoutId);\n });\n\n const checkScroll = () => {\n if (!isDragging) return\n\n if (shouldScrollTop) scrollableContainer.scrollTop -= 1;\n if (shouldScrollBottom) scrollableContainer.scrollTop += 1;\n if (shouldScrollTop || shouldScrollBottom) timeoutId = setTimeout(checkScroll, 50);\n }\n\n document.addEventListener(\"wheel\", (e) => {\n if (!isDragging) return\n\n scrollableContainer.scrollTop += e.deltaY;\n })\n}\n","import { csrfToken } from \"./helpers/utils\";\n\n$(() => {\n $('.workspace-link').click(async e => {\n $('.data-preloader').removeClass('d-none')\n\n const res = await fetch('/users/workspace', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({organization_id: e.currentTarget.dataset.orgId})\n })\n return res.status === 200 ? window.location.href = '/' : false\n })\n\n $('.company-workspace-link').click(async e => {\n $('.data-preloader').removeClass('d-none')\n\n const res = await fetch('/company/users/workspace', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({company_id: e.currentTarget.dataset.companyId})\n })\n return res.status === 200 ? window.location.href = '/' : false\n })\n})\n","import SignaturePad from 'signature_pad'\nimport { onScannerNavigate } from '../helpers/scanner'\nimport { isEmpty, toggleField, toggleFieldWithHtml } from '../helpers/utils'\nimport { isRTL } from '../helpers/locale'\nimport { i18n } from \"../helpers/i18n\";\n\n$(() => {\n let activeTaskId\n if ($('.tasks.driver_visits').length || $('.tasks.driver_tasks').length) {\n $('.choose-task').on('click', (event) => {\n // handle visit - hide what's needed\n $('#destination_details_box').show()\n $('#source_details_box').show()\n const visit_kind = event.target.getAttribute('visit-kind')\n const visit_id = event.target.getAttribute('visit-id')\n const visit_is_done = event.target.getAttribute('visit-is-done')\n\n if (visit_kind == 'PICKUP' || visit_kind == 'RETURN') {\n $('#destination_details_box').hide()\n }\n if (visit_kind == 'DELIVERY') {\n $('#source_details_box').hide()\n }\n const task_id = event.target.getAttribute('task-id')\n activeTaskId = event.target.getAttribute('task-id')\n const task_details = $(\".task-details[task-id='\" + task_id + \"']\")[0]\n const task_code = task_details.getAttribute('task-code')\n const task_driver_id = task_details.getAttribute('driver-id')\n\n // // setting the task as seen\n if (task_driver_id) {\n const token = $('meta[name=\"csrf-token\"]').attr('content')\n $.ajax({\n url: '/drivers/' + task_driver_id + '/set_driver_task_as_seen?task_id=' + task_id,\n type: 'post',\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': token\n },\n credentials: 'same-origin',\n dataType: 'json',\n contentType: 'application/json',\n success: function (data) {\n $('#mt-list-item-task-id-' + data.task_id).addClass('seen')\n },\n data: JSON.stringify({ task_id: task_id })\n })\n }\n\n const company_name = task_details.getAttribute('company-name')\n const order_time = task_details.getAttribute('order-time')\n const status = task_details.getAttribute('status')\n const urgency = task_details.getAttribute('urgency')\n const packages = task_details.getAttribute('packages')\n const surfaces = task_details.getAttribute('surfaces')\n const cartons = task_details.getAttribute('cartons')\n const roundtrip = task_details.getAttribute('roundtrip')\n const from = task_details.getAttribute('from')\n const to = task_details.getAttribute('to')\n\n const source_notes = task_details.getAttribute('source-notes')\n const destination_notes = task_details.getAttribute('destination-notes')\n\n const source_name = task_details.getAttribute('source-name')\n const destination_name = task_details.getAttribute('destination-name')\n\n const source_floor = task_details.getAttribute('source-floor')\n const source_apartment = task_details.getAttribute('source-apartment')\n const destination_floor = task_details.getAttribute('destination-floor')\n const destination_apartment = task_details.getAttribute('destination-apartment')\n\n const source_recipient_name = task_details.getAttribute('source-recipient-name')\n const source_phone = task_details.getAttribute('source-phone')\n const destination_recipient_name = task_details.getAttribute('destination-recipient-name')\n const destination_phone = task_details.getAttribute('destination-phone')\n\n const source_latitude = task_details.getAttribute('source-latitude')\n const source_longitude = task_details.getAttribute('source-longitude')\n const destination_latitude = task_details.getAttribute('destination-latitude')\n const destination_longitude = task_details.getAttribute('destination-longitude')\n const notes = task_details.getAttribute('notes')\n const document_number = task_details.getAttribute('document-number')\n\n const signee_name = task_details.getAttribute('signee-name')\n\n const wait_time = task_details.getAttribute('wait-time')\n const driver_note = task_details.getAttribute('driver-note')\n\n const vehicle_kind = task_details.getAttribute('vehicle-kind')\n const wp_order_id = task_details.getAttribute('wp-order-id')\n const money_collect = task_details.getAttribute('money-collect')\n const greeting = task_details.getAttribute('greeting')\n const payment_method = task_details.getAttribute('payment_method')\n\n // Handle order items\n if (document.getElementById('order-items-table-placeholder') != null) {\n document.getElementById('order-items-table-placeholder').innerHTML = ''\n const wp_order_items = JSON.parse(task_details.getAttribute('wp-order-items'))\n if (wp_order_items.length > 0) {\n const orderItemsTable = [['מוצר', 'כמות']]\n for (let i = 0; i < wp_order_items.length; i++) {\n orderItemsTable.push([wp_order_items[i].name, wp_order_items[i].quantity])\n }\n createTableOrderItems(orderItemsTable)\n $('#order-items-container').removeClass('collapse')\n } else {\n $('#order-items-container').addClass('collapse')\n }\n }\n\n $('#task_id').val(task_id)\n $('.modal-title').text(task_code)\n $('#task_driver_id').val(task_driver_id)\n $('#modal-company-name').text(company_name)\n $('#modal-order-time').text(order_time)\n $('#task_status').val(status)\n $('#modal-urgency').text(urgency)\n $('#modal-money-collect').text(money_collect)\n $('#modal-greeting').text(greeting)\n $('#modal-payment-method').text(payment_method)\n $('#modal-vehicle-kind').text(vehicle_kind)\n\n $('#modal-from').text(from)\n $('#modal-to').text(to)\n $('#modal-source-name').text(source_name)\n $('#modal-destination-name').text(destination_name)\n\n $('#modal-signee-name')[0].value = signee_name\n\n $('#modal-wait-time')[0].value = wait_time\n $('#modal-driver-note')[0].value = driver_note\n\n $('#modal-wp-order-id').text(wp_order_id)\n\n toggleField(packages, '#modal-packages', '#task-packages-container')\n toggleField(surfaces, '#modal-surfaces', '#task-surfaces-container')\n toggleField(cartons, '#modal-cartons', '#task-cartons-container')\n toggleField(roundtrip, '#modal-roundtrip', '#task-roundtrip-container')\n toggleField(money_collect, '#modal-money-collect', '#task-money-collect-container')\n\n // toggle task notes\n toggleField(notes, '#modal-notes', '#task-notes-container')\n\n // toggle document number\n toggleField(document_number, '#modal-document-number', '#task-document-number-container')\n\n if (visit_id) {\n const not_done_button = $(' לא הושלם')\n const done_button = $(' הושלם')\n\n $('#change-status-buttons').empty()\n $('#change-status-buttons').append(done_button)\n $('#change-status-buttons').append(not_done_button)\n\n if (visit_is_done == 'true') {\n done_button.removeClass('btn-outline')\n } else {\n not_done_button.removeClass('btn-outline')\n }\n } else {\n const assign_button = $('' + i18n.t('models.task.status_enum.ASSIGNED') + '')\n const active_button = $('' + i18n.t('models.task.status_enum.ACTIVE') + '')\n const roundtrip_delivered_button = $('' + i18n.t('models.task.status_enum.ROUNDTRIP_DELIVERED') + '')\n const completed_button = $('' + i18n.t('models.task.status_enum.COMPLETED') + '')\n // assign-driver buttons\n $('.modal-assign-driver').each(function (i) {\n const driver_id = $(this).attr('driver-id')\n const href_string = 'assign_driver_as_master?task_id=' + task_id + '&driver_id=' + driver_id\n\n $(this).attr('href', href_string)\n\n if (task_driver_id == $(this).attr('driver-id')) {\n $(this).addClass('active')\n }\n })\n\n // task status\n switch (status) {\n case 'UNASSIGNED':\n $('#change-status-buttons').empty()\n\n $('#change-status-buttons').append(completed_button)\n if (roundtrip.length > 0) {\n $('#change-status-buttons').append(roundtrip_delivered_button)\n }\n $('#change-status-buttons').append(active_button)\n $('#change-status-buttons').append(assign_button)\n break\n\n case 'ASSIGNED':\n $('#change-status-buttons').empty()\n\n $('#change-status-buttons').append(completed_button)\n if (roundtrip.length > 0) {\n $('#change-status-buttons').append(roundtrip_delivered_button)\n }\n $('#change-status-buttons').append(active_button)\n $('#change-status-buttons').append(assign_button)\n $('#assigned-btn').removeClass('btn-outline')\n break\n case 'ACTIVE':\n $('#change-status-buttons').empty()\n\n $('#change-status-buttons').append(completed_button)\n if (roundtrip.length > 0) {\n $('#change-status-buttons').append(roundtrip_delivered_button)\n }\n $('#change-status-buttons').append(active_button)\n $('#change-status-buttons').append(assign_button)\n $('#active-btn').removeClass('btn-outline')\n break\n case 'COMPLETED':\n $('#change-status-buttons').empty()\n\n $('#change-status-buttons').append(completed_button)\n if (roundtrip.length > 0) {\n $('#change-status-buttons').append(roundtrip_delivered_button)\n }\n $('#change-status-buttons').append(active_button)\n $('#change-status-buttons').append(assign_button)\n $('#completed-btn').removeClass('btn-outline')\n break\n case 'ROUNDTRIP_DELIVERED':\n $('#change-status-buttons').empty()\n\n $('#change-status-buttons').append(completed_button)\n if (roundtrip.length > 0) {\n $('#change-status-buttons').append(roundtrip_delivered_button)\n }\n $('#change-status-buttons').append(active_button)\n $('#change-status-buttons').append(assign_button)\n $('#roundtrip-delivered-btn').removeClass('btn-outline')\n break\n }\n }\n // source waze\n const source_waze_url = 'waze://?ll=' + encodeURIComponent(source_latitude + ',' + source_longitude + '&navigate=yes')\n $('#source-waze-btn').attr('href', source_waze_url)\n\n // destination waze\n const destination_waze_url = 'waze://?ll=' + encodeURIComponent(destination_latitude + ',' + destination_longitude + '&navigate=yes')\n $('#destination-waze-btn').attr('href', destination_waze_url)\n\n // handle source phone\n if (isEmpty(source_phone)) {\n $('#source-phone-container').addClass('collapse')\n } else {\n $('#source-phone-container').removeClass('collapse')\n $('#source-phone-container').attr('href', 'tel:' + source_phone)\n $('#model-source-phone').text(source_phone)\n }\n\n // handle destination phone\n if (isEmpty(destination_phone)) {\n $('#destination-phone-container').addClass('collapse')\n } else {\n $('#destination-phone-container').removeClass('collapse')\n $('#destination-phone-container').attr('href', 'tel:' + destination_phone)\n $('#model-destination-phone').text(destination_phone)\n }\n\n // source fields\n toggleField(source_floor, '#modal-source-floor', '#source-floor-container')\n toggleField(source_apartment, '#modal-source-apartment', '#source-apartment-container')\n toggleField(source_recipient_name, '#modal-source-recipient-name', '#source-recipient-name-container')\n toggleField(source_notes, '#modal-source-notes', '#source-location-notes-container')\n\n // toggle destination fields\n toggleField(destination_floor, '#modal-destination-floor', '#destination-floor-container')\n toggleField(destination_apartment, '#modal-destination-apartment', '#destination-apartment-container')\n toggleField(destination_recipient_name, '#modal-destination-recipient-name', '#destination-recipient-name-container')\n toggleField(destination_notes, '#modal-destination-notes', '#destination-location-notes-container')\n\n toggleFieldWithHtml(greeting, 'ברכה', '#modal-greeting', '#greeting-container')\n toggleField(payment_method, '#modal-payment-method', '#payment-method-container')\n\n $('#signature_spinner').css('visibility', 'hidden')\n\n $('#task-details-modal').modal('show')\n\n const canvas = document.querySelector('#sig-canvas')\n const signaturePad = new SignaturePad(canvas, { backgroundColor: 'rgb(255,255,255)' })\n\n const cancelButton = document.getElementById('clear')\n\n $('#driver-note-save').off().on('click', function () {\n const token = $('meta[name=\"csrf-token\"]').attr('content')\n\n const driver_note = $('#modal-driver-note')[0].value\n const wait_time = $('#modal-wait-time')[0].value\n\n $.ajax({\n url: '/tasks/' + task_id + '/set_driver_note',\n type: 'post',\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': token\n },\n credentials: 'same-origin',\n dataType: 'json',\n contentType: 'application/json',\n success: function (data) {\n const taskDetails = $(\".task-details[task-id='\" + task_id + \"']\")[0]\n taskDetails.setAttribute('wait-time', +data.wait_time)\n taskDetails.setAttribute('driver-note', data.driver_note)\n },\n data: JSON.stringify({ driver_note: driver_note, wait_time: wait_time })\n })\n })\n\n $('#save').off().on('click', function () {\n const base64_string = signaturePad.toDataURL('image/png')\n const token = $('meta[name=\"csrf-token\"]').attr('content')\n $('#signature_spinner').css('visibility', 'visible')\n\n const signee_name = $('#modal-signee-name')[0].value\n\n $.ajax({\n url: '/tasks/' + task_id + '/set_signiture',\n type: 'post',\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': token\n },\n credentials: 'same-origin',\n dataType: 'json',\n contentType: 'application/json',\n success: function () {\n $('#signature_spinner').css('visibility', 'hidden')\n },\n data: JSON.stringify({ signee_name: signee_name, signature: base64_string })\n })\n })\n\n cancelButton.addEventListener('click', function () {\n signaturePad.clear()\n })\n })\n\n $(document).on('keydown', function (e) {\n if (e && e.keyCode === 13) {\n e.target.form.submit()\n }\n\n e.stopPropagation()\n const charCode = String.fromCharCode(e.keyCode)\n\n const keycode = (e.keyCode ? e.keyCode : e.which)\n if (window.BarcodesScanner.tmpTimestamp < Date.now() - 500) {\n window.BarcodesScanner.tmpData = ''\n window.BarcodesScanner.tmpTimestamp = Date.now()\n }\n if (keycode === 16 && window.BarcodesScanner.tmpData.length > 3) {\n onScannerNavigate(window.BarcodesScanner.tmpData, 'FAKE_SCANNER', 'WEDGE', window.BarcodesScanner.tmpTimestamp, window.BarcodesScanner.tmpData.length)\n window.BarcodesScanner.tmpTimestamp = 0\n window.BarcodesScanner.tmpData = ''\n } else if (charCode && charCode >= 0) {\n window.BarcodesScanner.tmpData += charCode\n }\n })\n\n $(window.BarcodesScanner).on('scan', function (e) {\n $(\"a[task-id='\" + window.BarcodesScanner.barcodeData + \"']\")[0].click()\n })\n\n $('#cameraInput').on('change', function (e) {\n const input = e.originalEvent.target\n if (input.files && input.files[0]) {\n const reader = new FileReader()\n\n reader.onload = function (e) {\n $('#camera_spinner').show()\n const token = $('meta[name=\"csrf-token\"]').attr('content')\n const base64String = e.target.result\n $.ajax({\n url: '/tasks/' + activeTaskId + '/set_photo',\n type: 'post',\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': token\n },\n credentials: 'same-origin',\n dataType: 'json',\n contentType: 'application/json',\n success: function (data) {\n $('#camera_spinner').hide()\n\n $('#uploaded-photo-img')\n .attr('src', data.photo_url)\n .width(150)\n .height(146)\n },\n data: JSON.stringify(base64String)\n })\n }\n reader.readAsDataURL(input.files[0])\n }\n })\n }\n buildToolTips()\n})\n\nfunction buildToolTips () {\n $('.sms-collection').tooltipster({\n contentAsHTML: true,\n animation: 'fade',\n position: isRTL() ? 'left' : 'right',\n delay: 200,\n maxWidth: 600,\n interactive: true,\n functionInit: (instance, helper) => {\n const messages = $(helper.origin).data('messages')\n instance.content(`\n \n \n \n \n \n \n \n ${messages.reduce((acc, m) => {\n return acc + ``\n }, '')}\n \n
${i18n.t('views.daily_route.sms.message')}${i18n.t('views.daily_route.sms.date')}
${m.body}${m.date}
\n `)\n }\n })\n}\n\nfunction createTableOrderItems (tableData) {\n const table = document.createElement('table')\n const tableBody = document.createElement('tbody')\n\n tableData.forEach(function (rowData) {\n const row = document.createElement('tr')\n row.style.cssText = 'padding: 2px;'\n\n rowData.forEach(function (cellData) {\n const cell = document.createElement('td')\n cell.style.cssText = 'padding: 2px;'\n cell.appendChild(document.createTextNode(cellData))\n row.appendChild(cell)\n })\n\n tableBody.appendChild(row)\n })\n\n table.appendChild(tableBody)\n document.getElementById('order-items-table-placeholder').appendChild(table)\n}\n","import dragula from \"dragula\";\nimport {showNotification} from \"./helpers/notifications\";\nimport { i18n } from \"./helpers/i18n\";\n\n$(() => {\n let orderChanged = false\n\n const drake = dragula([$('.excel-config .first')[0], $('.excel-config .second')[0]], {\n copy: (el, source) => (el.dataset.code === 'empty' && $(source).hasClass('first')),\n accepts: (el, target, source) => {\n if ($(source).hasClass('title')) { return false }\n\n return !($(source).hasClass('second') && !$(target).hasClass('second') && el.dataset.code === 'city')\n },\n moves: el => (!$(el).hasClass('title'))\n })\n\n drake.on('drop', (el, target, source) => {\n orderChanged = true\n if ($(source).hasClass('second') && !$(target).hasClass('second') && el.dataset.code === 'empty') {\n drake.remove()\n }\n })\n\n $('.excel-config-btn').click(async e => {\n const list = drake.containers[1].children\n const fields = []\n for (let item of list) {\n fields.push(item.dataset.code)\n }\n const res = await fetch('/organization/import_configs/upsert', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': document.head.querySelector('meta[name=\"csrf-token\"]').content\n },\n body: JSON.stringify({ import_config: { fields: fields, start_row: $('#import-config-start-row').val() } })\n })\n\n $(window).unbind('beforeunload')\n\n if (res.status === 200) {\n showNotification({ message: i18n.t('saved_successfully') })\n } else {\n showNotification({ message: i18n.t('errors.something_wrong'), type: 'danger' })\n }\n })\n\n $(window).bind('beforeunload', () => { if (orderChanged) return i18n.t('shared.unsaved_changes') })\n})\n","import { initTable } from \"./helpers/drivers/table\";\n\n$(() => {\n const body = $('body')\n if (body.hasClass('tickets index')) {\n initTable($('#ticket-lists-table'), { paging: gon.pagination_enabled })\n\n $(document).on('change', '.ticket_status', function(){\n var form = $(this).closest('form');\n $(form).submit();\n });\n\n const selectedFileName = document.querySelector('#selectedFileName');\n $(document).on('change', '#message_message_photo_attributes_image', function(){\n const fileName = this.files[0].name;\n selectedFileName.textContent = fileName;\n });\n }\n\n function scrollToBottom() {\n let messageDiv = $('#chat_messages');\n if (messageDiv && messageDiv[0])\n messageDiv.animate({scrollTop: messageDiv[0].scrollHeight}, 500);\n }\n\n function setChatBoxHeight() {\n const screenHeight = window.innerHeight;\n const chatBoxHeight = Math.round(screenHeight * 0.8);\n const chatBoxs = document.querySelectorAll('.tickets .card.card-custom');\n $(chatBoxs).each(function (index, divElem) {\n divElem.style.height = chatBoxHeight + 'px';\n });\n }\n\n if (gon.pusher && gon.allow_ticketing) {\n const pusher = new Pusher(gon.pusher.key, {\n cluster: gon.pusher.cluster,\n authEndpoint: \"/pusher_auth\"\n })\n\n if(gon.ticket_id) {\n const ticket_messages = pusher.subscribe('ticket_messages')\n ticket_messages.bind(`ticket_${gon.ticket_id}`, function(data) {\n var messages = $(`.messages_${gon.ticket_id}`)[0];\n $(messages).html($(messages).html() + data);\n scrollToBottom();\n return;\n });\n }\n\n const channel = pusher.subscribe('tickets')\n channel.bind(`ticket_${gon.organization_id}`, function(data) {\n var tickets = $(`.ticket_list_${gon.organization_id}`)[0];\n $(tickets).prepend(data);\n return;\n });\n\n const message_counter = pusher.subscribe('message_counter')\n message_counter.bind(\"new_messages\", function(data) {\n var unreadDivId = '#unread_message_count_' + data['receiver'] + '_' + data['ticket_id']\n var tickets = document.getElementById(unreadDivId);\n $(tickets).html(data['html']);\n\n if (!body.hasClass('tickets index')) {\n var notificationIconElem = `.unread-${data['receiver']}-message-count-${data['receivable']}`;\n var unreadCount = data['total_unread_count'];\n if(unreadCount && unreadCount > 0 && notificationIconElem) {\n var notification = document.getElementById(\"notification-sound\");\n if (notification) notification.play();\n\n $(notificationIconElem).removeClass('d-none').text(`+${unreadCount}`);\n } else {\n $(notificationIconElem).addClass('d-none');\n }\n }\n\n return;\n });\n\n const ticket_reopened = pusher.subscribe('ticket_reopened')\n ticket_reopened.bind(\"ticket_reopen\", function(data) {\n $(`.user-notification-badge-${data['user_id']}`).html(\"1\").removeClass('d-none');\n return;\n });\n }\n\n window.addEventListener('resize', () => {\n // Call the function to set the chat box height dynamically\n if (body.hasClass('tickets index')) {\n setChatBoxHeight();\n }\n });\n\n if (body.hasClass('tickets index')) {\n scrollToBottom();\n setChatBoxHeight();\n }\n})\n","import Cookies from 'js.cookie';\n\nconst cookiesEu = {\n init: () => {\n const cookiesEuOKButton = document.querySelector('.cookies-banner-ok');\n if (cookiesEuOKButton) cookiesEu.addListener(cookiesEuOKButton)\n },\n\n addListener: (target) => {\n if (target.attachEvent) {\n target.attachEvent('onclick', cookiesEu.setCookie);\n } else {\n target.addEventListener('click', cookiesEu.setCookie, false);\n }\n },\n\n setCookie: () => {\n const isSecure = location.protocol === 'https:';\n Cookies.set('cookie_eu_consented', true, { path: '/', expires: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), secure: isSecure });\n\n const container = document.querySelector('.cookies-banner');\n container.parentNode.removeChild(container);\n\n document.dispatchEvent(new CustomEvent('cookies-eu-acknowledged'));\n }\n};\n\n(() => {\n const isReady = () => { cookiesEu.init() }\n\n if (document.addEventListener) {\n return document.addEventListener('DOMContentLoaded', isReady, false);\n }\n\n if (window.addEventListener) {\n window.addEventListener('load', isReady, false);\n } else if (window.attachEvent) {\n window.attachEvent('onload', isReady);\n }\n})();\n","import { i18n } from \"./helpers/i18n\";\n\n$.validator.addMethod('filesize', function (value, element, param) {\n return this.optional(element) || (element.files[0].size <= param * 1000000)\n})\n\n$.extend($.validator.messages, {\n required: i18n.t('mandatory_field'),\n email: i18n.t('invalid_email')\n})\n\n// package translation is not complete\n$.fn.datepicker.dates['he'] = {\n days: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\", \"ראשון\"],\n daysShort: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\", \"א\"],\n daysMin: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\", \"א\"],\n months: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\n monthsShort: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\n today: \"היום\",\n rtl: true,\n clear: \"לנקות\"\n};\n\n$.fn.dataTable.Api.registerPlural('columns().names()', 'column().name()', function(setter) {\n return this.iterator('column', function(settings, column) {\n const col = settings.aoColumns[column];\n\n if ( setter !== undefined ) {\n col.sName = setter;\n return this;\n } else {\n return col.sName;\n }\n }, 1);\n});\n\nwindow.Rollbar?.configure({}, {\n is_organization: !!gon.is_organization,\n is_company: !!gon.is_company\n})\n","import 'bootstrap'\nimport 'bootstrap-datepicker'\nimport 'daterangepicker'\nimport 'bootstrap-datepicker/js/locales/bootstrap-datepicker.ar.js'\nimport 'bootstrap-timepicker'\nimport 'bootstrap-colorpicker'\nimport 'datatables.net-bs4'\nimport 'datatables.net-fixedheader-bs4'\nimport 'datatables.net-buttons-bs4'\nimport 'datatables.net-buttons/js/buttons.colVis.js'\nimport 'datatables.net-colreorder-bs4'\nimport 'jquery-highlight'\nimport 'leaflet'\nimport 'leaflet-arrowheads'\nimport 'leaflet-draw'\nimport 'select2'\nimport 'select2/dist/js/i18n/he'\nimport 'select2/dist/js/i18n/ar'\nimport 'tooltipster/dist/js/tooltipster.bundle'\nimport 'jquery-validation'\nimport 'jquery-resizable-dom'\nimport 'bootstrap-notify'\nimport 'jqdoublescroll'\nimport 'moment'\n\n// metronic\nimport '@/metronic/js/metronic-custom'\n\n// leaflet-heat\nimport '@/leaflet-heat'\nimport '@/leaflet-fullscreen.min'\n\n// src\nimport '@/dayjs_config'\nimport '@/common'\nimport '@/layout'\nimport '@/operator'\nimport '@/communication'\nimport '@/home'\nimport '@/locations'\nimport '@/organizations'\nimport '@/searches'\nimport '@/tasks'\nimport '@/visits'\nimport '@/routes/routes'\nimport '@/routes/route_plan'\nimport '@/routes/daily_route_plan'\nimport '@/header'\nimport '@/drivers/tasks'\nimport '@/chat'\nimport '@/excel_config'\nimport '@/ticket_lists'\nimport '@/shortcuts'\nimport '@/cookies/cookies_eu'\nimport '@/plugin_addons'\nimport { csrfToken } from \"../src/helpers/utils\";\n\nif (gon.master_session) import('@/brain/master_user')\n\n$(() => {\n const body = $('body')\n\n if (body.hasClass('companies')) import('@/companies')\n if (body.hasClass('drivers')) import('@/drivers')\n if (body.hasClass('products')) import('@/products')\n if (body.hasClass('archived_tasks')) import('@/archived')\n if (body.hasClass('reports')) import('@/reports')\n if (body.hasClass('external_deliveries')) import('@/external_deliveries')\n if (body.hasClass('vehicle_events')) import('@/vehicle_events')\n if (body.hasClass('woo_commerce')) import('@/woo_commerce/orders')\n if (body.hasClass('couriers')) import('@/couriers')\n if (body.hasClass('crm')) import('@/crm')\n if (body.hasClass('driver_routes')) import('@/driver_routes')\n if (body.hasClass('yango_invitations')) import('@/yango_invitations')\n if (body.hasClass('company_invites')) import('@/company_invites')\n if (body.hasClass('route_patterns')) import('@/route_patterns')\n if (body.hasClass('cod_documents')) import('@/cod_documents')\n if (body.hasClass('plugins')) import('@/plugins')\n if (body.hasClass('route_templates')) import('@/route_templates')\n if (body.hasClass('purchases')) import('@/purchase')\n if (body.hasClass('city_lists') || body.hasClass('city_items')) import('@/city_lists')\n if (body.hasClass('stripe_subscriptions')) import('@/stripe_subscription')\n if (body.hasClass('shopify_subscriptions')) import('@/shopify_subscription')\n if (body.hasClass('public_pages')) import('@/public_pages')\n if (body.hasClass('wix')) import('@/wix/orders')\n if (body.hasClass('shopify')) import('@/orders_page')\n if (body.hasClass('integrations')) import('@/integrations')\n if (body.hasClass('sms_templates')) import('@/sms_templates')\n if (body.hasClass('import_histories')) import('@/history_import')\n if (body.hasClass('receipts')) import('@/receipts')\n if (body.hasClass('import')) import('@/import')\n if (body.hasClass('distributions')) import('@/distributions')\n if (body.hasClass('regions')) import('@/regions')\n if (body.hasClass('invoices')) import('@/invoices')\n if (body.hasClass('whatsapp')) import('@/whatsapp')\n if (body.hasClass('inventories')) import('@/inventories')\n if (body.hasClass('vehicles')) import('@/vehicles')\n if (body.hasClass('hashavshevet')) import('@/hashavshevet/orders')\n if (body.hasClass('partner_bridges')) import('@/partner_bridges')\n if (body.hasClass('users')) import('@/users')\n if (body.hasClass('custom_fields')) import('@/custom_fields')\n if (body.hasClass('modules')) import('@/modules')\n if (body.hasClass('scheduled_tasks')) import('@/fixed_tasks')\n if (body.hasClass('pricings') || body.hasClass('pricing_regions') || body.hasClass('city_pricings')) import('@/pricings')\n if (body.hasClass('lines')) import('@/lines')\n\n if (body.hasClass('brain')) {\n import('@/brain/organizations')\n import('@/brain/billing_summary')\n import('@/brain/reports')\n import('@/brain/quick_search')\n import('@/brain/geocode')\n\n if (body.hasClass('brain_payme')) import('@/brain/payme')\n }\n\n if (body.hasClass('brain') || body.hasClass('public_pages')) {\n import('@/brain/near_businesses')\n }\n\n import('@/react_components/quick_search/index')\n import('@/react_components/tasks/index')\n import('@/react_components/routes/routes_suggestion/index')\n import('@/react_components/tasks/scheduled/index')\n import('@/react_components/tasks/distributions/index')\n import('@/react_components/public_pages/roi/index')\n import('@/scroll_to_top')\n})\n\nrequire('@rails/ujs').start()\nrequire('@rails/activestorage').start()\nrequire('@nathanvda/cocoon')\n\n$(() => {\n $('.tooltips').tooltipster()\n // workaround because of jquery vers issues\n $(document).on('select2:open', e => {\n const select2 = $(e.target).data('select2');\n if (!select2.options.get('multiple')) {\n select2.dropdown.$search.get(0).focus();\n }\n });\n})\nconst fetchConfigAction = async () => {\n if (!gon.user_mode) return {}\n\n return fetch(`/api/web/${gon.user_mode}/main_config`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n }\n })\n}\nif (!gon.mainConfig) {\n gon.mainConfig = fetchConfigAction()\n}\n","import { showNotification } from \"../helpers/notifications\";\nimport { i18n } from \"../helpers/i18n\";\nimport { csrfToken } from \"../helpers/utils\";\nimport { cancelTransferConfirmation, isTaskTransferred } from \"../helpers/drivers/confirmations\";\n\nexport const updateTasksDriver = async (taskId, driverId) => {\n return await fetch('/tasks/' + taskId + '/set_driver', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': document.head.querySelector('meta[name=\"csrf-token\"]').content\n },\n body: JSON.stringify({ new_driver: driverId })\n })\n}\n\nexport const updateTaskStatus = async (taskId, status, callback = () => {}) => {\n const container = $(`.ajax-status-container[data-task-id='${taskId}']`)\n const spinner = container.find('.ajax-status-spinner')\n const currentStatusElement = container.find('.ajax-status-current')\n const currentStatusTextElement = container.find('.ajax-status-current-text')\n\n const checks = await statusChangeChecks(taskId, status)\n if (!checks.shouldContinue) return\n\n spinner.show()\n\n $.ajax({\n url: `/tasks/${taskId}/set_status`,\n type: 'post',\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': csrfToken()\n },\n credentials: 'same-origin',\n dataType: 'json',\n contentType: 'application/json',\n success: (data) => {\n const updatedStatus = data.new_status\n const text = i18n.t(`models.task.status_enum.${updatedStatus}`)\n\n currentStatusElement.removeClass((index, className) => (className.match(/\\S*-task\\b/g) || []).join(' '));\n currentStatusElement.addClass(`${updatedStatus.toLowerCase().replace('_', '-')}-task`)\n currentStatusTextElement.text(text)\n\n callback(data)\n },\n error: () => { showNotification({ message: i18n.t('shared.something_went_wrong'), type: 'danger' }) },\n complete: () => { spinner.hide() },\n data: JSON.stringify({ new_task_status: status, ...(checks.data || {}) })\n })\n}\n\nconst statusChangeChecks = async (taskId, status) => {\n if (status !== 'CANCELED') return { shouldContinue: true }\n\n if (await isTaskTransferred(taskId)) {\n const transferConfirmResult = await cancelTransferConfirmation()\n return { shouldContinue: transferConfirmResult.isConfirmed, data: { keep_transfer_connection: transferConfirmResult.value === 0 } }\n }\n\n return { shouldContinue: true }\n}\n\nexport const updateTaskPickStatus = (taskId, status, packagesQuantity = '', callback = () => {}) => {\n const dropdown = $('.task-pick-status-dropdown-' + taskId)\n const container = dropdown.find('.pick-status')\n const spinner = dropdown.find('.pick-status-spinner')\n const text = dropdown.find('.pick-status-text')\n const token = $('meta[name=\"csrf-token\"]').attr('content')\n spinner.show()\n\n $.ajax({\n url: '/tasks/set_pick_status',\n type: 'post',\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': token\n },\n credentials: 'same-origin',\n dataType: 'json',\n contentType: 'application/json',\n data: JSON.stringify({ new_status: status, packages_quantity: packagesQuantity, task_id: taskId }),\n success: (data) => {\n const updatedStatus = data.new_pick_status\n text.text(i18n.t('models.task.pick_status_enum.' + updatedStatus))\n container.removeClass((index, className) => (className.match (/(^|\\s)pick-status-\\S+/g) || []).join(' '));\n container.addClass('pick-status-' + updatedStatus.toLowerCase())\n spinner.hide()\n callback(data)\n }\n })\n}\n\nexport const handleTaskPickStatusModal = (taskId, status, packagesQuantity = 1, isRemote = true) => {\n const modal = $('#set-pick-status-modal')\n const packagesQuantityInput = $('#pick-status-modal-packages-quantity')\n packagesQuantityInput.val(packagesQuantity)\n\n if (isRemote) {\n $('.pick-status-modal-submit').off('click').on('click', (e) => {\n e.preventDefault()\n const printLabels = e.currentTarget.dataset.print;\n const packagesQuantity = packagesQuantityInput.val()\n updateTaskPickStatus(taskId, status, packagesQuantity, (data) => setTimeout(() => {\n if (printLabels == \"true\")\n window.open(`/tasks/${data.task_id}/print_labels`,'_blank').focus();\n }, 500))\n modal.modal('hide')\n })\n } else {\n $('#pick-status-modal-task-id').val(taskId)\n $('#pick-status-modal-new-status').val(status)\n }\n\n modal.modal('show')\n}\n\nexport const updateCodStatus = (taskId, status, onSuccess = () => {}) => {\n codUpdate(\n taskId, $(`.cod-dropdown-container[data-task-id='${taskId}']`), status,\n i18n.t(`models.cod.status_enum.${status}`), 'status', onSuccess\n )\n}\n\nconst codUpdate = (taskId, $container, value, valueStr, valueName, onSuccess = () => {}) => {\n if (valueStr === $container.find('.cod-container-text').text().trim()) return\n\n const loader = $container.find('.cod-container-loader')\n const menuButton = $container.find('.cod-container-menu')\n menuButton.addClass('disabled')\n loader.removeClass('d-none')\n\n $.ajax({\n url: `/tasks/${taskId}/set_cod_data`,\n type: 'POST',\n data: JSON.stringify({ cod: { [valueName]: value } }),\n headers: {\n 'Content-Type': 'application/json',\n 'CSRF-Token': csrfToken()\n },\n success: (json) => {\n $container.find('.cod-container-text').text(valueStr)\n onSuccess(json)\n },\n error: () => {\n showNotification({ message: i18n.t('errors.something_wrong'), type: 'danger' })\n },\n complete: () => {\n menuButton.removeClass('disabled')\n loader.addClass('d-none')\n }\n })\n}\n","\"use strict\";\n\n// Class definition\nvar KTAppChat = function () {\n\tvar _chatAsideEl;\n\tvar _chatAsideOffcanvasObj;\n\tvar _chatContentEl;\n\n\t// Private functions\n\tvar _initAside = function () {\n\t\t// Mobile offcanvas for mobile mode\n\t\t_chatAsideOffcanvasObj = new KTOffcanvas(_chatAsideEl, {\n\t\t\toverlay: true,\n baseClass: 'offcanvas-mobile',\n //closeBy: 'kt_chat_aside_close',\n toggleBy: 'kt_app_chat_toggle'\n });\n\n\t\t// User listing\n\t\tvar cardScrollEl = KTUtil.find(_chatAsideEl, '.scroll');\n\t\tvar cardBodyEl = KTUtil.find(_chatAsideEl, '.card-bodyss');\n\t\tvar searchEl = KTUtil.find(_chatAsideEl, '.input-group');\n\n\t\tif (cardScrollEl) {\n\t\t\t// Initialize perfect scrollbar(see: https://github.com/utatti/perfect-scrollbar)\n\t\t\tKTUtil.scrollInit(cardScrollEl, {\n\t\t\t\tmobileNativeScroll: true, // Enable native scroll for mobile\n\t\t\t\tdesktopNativeScroll: false, // Disable native scroll and use custom scroll for desktop\n\t\t\t\tresetHeightOnDestroy: true, // Reset css height on scroll feature destroyed\n\t\t\t\thandleWindowResize: true, // Recalculate hight on window resize\n\t\t\t\trememberPosition: true, // Remember scroll position in cookie\n\t\t\t\theight: function() { // Calculate height\n\t\t\t\t\tvar height;\n\n\t\t\t\t\tif (KTUtil.isBreakpointUp('lg')) {\n\t\t\t\t\t\theight = KTLayoutContent.getHeight();\n\t\t\t\t\t} else {\n\t\t\t\t\t\theight = KTUtil.getViewPort().height;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (_chatAsideEl) {\n\t\t\t\t\t\theight = height - parseInt(KTUtil.css(_chatAsideEl, 'margin-top')) - parseInt(KTUtil.css(_chatAsideEl, 'margin-bottom'));\n\t\t\t\t\t\theight = height - parseInt(KTUtil.css(_chatAsideEl, 'padding-top')) - parseInt(KTUtil.css(_chatAsideEl, 'padding-bottom'));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (cardScrollEl) {\n\t\t\t\t\t\theight = height - parseInt(KTUtil.css(cardScrollEl, 'margin-top')) - parseInt(KTUtil.css(cardScrollEl, 'margin-bottom')) - 70;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (cardBodyEl) {\n\t\t\t\t\t\theight = height - parseInt(KTUtil.css(cardBodyEl, 'padding-top')) - parseInt(KTUtil.css(cardBodyEl, 'padding-bottom'));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (searchEl) {\n\t\t\t\t\t\theight = height - parseInt(KTUtil.css(searchEl, 'height'));\n\t\t\t\t\t\theight = height - parseInt(KTUtil.css(searchEl, 'margin-top')) - parseInt(KTUtil.css(searchEl, 'margin-bottom'));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove additional space\n\t\t\t\t\theight = height - 2;\n\n\t\t\t\t\treturn height;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\treturn {\n\t\t// Public functions\n\t\tinit: function() {\n\t\t\t// Elements\n\t\t\t_chatAsideEl = KTUtil.getById('kt_chat_aside');\n\t\t\t_chatContentEl = KTUtil.getById('kt_chat_content');\n\n\t\t\t// Init aside and user list\n\t\t\t_initAside();\n\n\t\t\t// Init inline chat example\n\t\t\t// KTLayoutChat.setup(KTUtil.getById('kt_chat_content'));\n\n\t\t\t// Trigger click to show popup modal chat on page load\n\t\t\tif (KTUtil.getById('kt_app_chat_toggle')) {\n\t\t\t\t\tKTUtil.getById('kt_app_chat_toggle').click();\n\t\t\t\t\tKTUtil.getById('kt_app_chat_toggle').click();\n\t\t\t}\n\t\t}\n\t};\n}();\n\njQuery(document).ready(function() {\n\tconst body = $('body')\n if (body.hasClass('tickets index')) {\n\t\tKTAppChat.init();\n\t}\n});\n","import { i18n } from \"./i18n\";\nimport { isRTL } from \"./locale\";\nimport { formattedDate, getDateFormat } from \"./date\";\nimport ApexCharts from \"apexcharts\";\nimport { STATUSES } from \"../constants\";\nimport moment from \"moment\";\n\nconst defaultSeriesMapping = (s) => ({ name: s.name, data: s.data })\n\nexport const initMonthlyChart = (id, title, data, colorsMapping, seriesMapping = defaultSeriesMapping) => {\n const el = document.getElementById(id)\n\n if (el) {\n const { year, month, daily_data: dailyData, days_amount: daysCount } = data\n const series = dailyData.map(seriesMapping)\n const days = [...Array(daysCount).keys()].map(i => i + 1)\n const colors = dailyData.map(colorsMapping)\n\n if (isRTL()) {\n series.forEach(s => { s.data.reverse() })\n days.reverse()\n }\n\n const options = {\n series: series,\n colors: colors,\n chart: {\n type: 'bar',\n height: 400,\n stacked: true,\n toolbar: { show: false },\n zoom: { enabled: false }\n },\n yaxis: {\n title: {\n text: title,\n }\n },\n grid: {\n xaxis: {\n lines: {\n show: false\n }\n }\n },\n xaxis: {\n type: 'category',\n categories: days,\n tickPlacement: 'on',\n title: {\n text: i18n.t('days')\n }\n },\n legend: {\n position: 'right',\n offsetY: 40,\n inverseOrder: true\n },\n tooltip: {\n enabled: true,\n shared: true,\n intersect: false,\n inverseOrder: true,\n x: { formatter: (day) => formattedDate(new Date(year, month - 1, isRTL() ? daysCount - day + 1 : day)) }\n },\n fill: { opacity: 1 },\n dataLabels: { enabled: false },\n responsive: [\n {\n breakpoint: 576,\n options: {\n legend: {\n position: 'bottom',\n offsetY: 7\n }\n }\n },\n ...[992, 768, 576].map((breakpoint, index) => ({\n breakpoint: breakpoint,\n options: {\n xaxis: {\n categories: days,\n labels: {\n formatter: (value) => (parseInt(value) % (index + 2) === 1) ? value : ''\n }\n }\n }\n }))\n ]\n };\n\n const chart = new ApexCharts(el, options);\n chart.render();\n }\n}\n\nexport const initStatusSummaryChart = (id) => {\n const el = document.getElementById(id)\n\n if (el) {\n let statuses = []\n\n for (const [key, value] of Object.entries(gon.total)) {\n statuses.push({\n key: key,\n value: value,\n color: STATUSES[key].color\n })\n }\n\n const hasNoData = statuses.length === 0\n\n const isDailyProgress = $('body').hasClass('daily_progress')\n\n const options = {\n series: statuses.map(s => s.value),\n colors: statuses.map(s => s.color),\n chart: {\n type: 'donut',\n height: isDailyProgress ? '325px' : '250px',\n events: {\n dataPointSelection: (event, chartContext, config) => {\n const status = statuses[config.dataPointIndex].key\n window.open(`/tasks?status=${status}&date=range&from=${gon.from}&to=${gon.to}&time_by=pickup_at`, '_blank').focus()\n }\n }\n },\n plotOptions: {\n pie: {\n donut: {\n labels: {\n show: true,\n total: {\n show: true,\n label: i18n.t('views.reports.total')\n }\n }\n }\n }\n },\n noData: {\n text: i18n.t('shared.no_data_available'),\n offsetY: -25,\n style: {\n color: '#000'\n }\n },\n legend: {\n position: isDailyProgress ? 'bottom' : 'right',\n fontSize: '16px',\n formatter: (seriesName, opts) => ([seriesName, \" - \", opts.w.globals.series[opts.seriesIndex]]),\n markers: {\n width: 13,\n height: 13,\n },\n itemMargin: {\n vertical: 4\n },\n },\n states: {\n hover: {\n filter: {\n type: 'none',\n }\n },\n active: {\n filter: {\n type: 'none',\n }\n }\n },\n stroke: {\n width: 0\n },\n responsive: [\n {\n breakpoint: 1500,\n options: {\n legend: {\n fontSize: '16px',\n markers: {\n width: 10,\n height: 10,\n },\n },\n }\n },\n {\n breakpoint: 992,\n options: {\n legend: {\n fontSize: '11px',\n markers: {\n width: 7,\n height: 7\n },\n position: 'bottom'\n },\n }\n },\n {\n breakpoint: 768,\n options: {\n chart: {\n height: hasNoData ? '75px' : 'auto'\n },\n legend: {\n fontSize: '16px',\n position: 'right',\n markers: {\n width: 10,\n height: 10,\n },\n },\n }\n },\n {\n breakpoint: 576,\n options: {\n chart: {\n height: hasNoData ? '75px' : '400px'\n },\n legend: {\n fontSize: '12px',\n markers: {\n width: 7,\n height: 7,\n },\n position: 'bottom'\n },\n }\n }],\n dataLabels: {\n formatter: (val, opts) => {\n return opts.w.config.series[opts.seriesIndex]\n },\n },\n labels: statuses.map(s => i18n.t(`models.task.status_enum.${s.key}`))\n }\n\n const chart = new ApexCharts(el, options)\n chart.render()\n }\n}\n\nexport const initDailyProgressChart = (id) => {\n const el = document.getElementById(id)\n\n if (el) {\n const { completed, failed, uncompleted, complete_percents: completePercents } = gon.daily_progress_chart_data\n let values = [completed, failed, uncompleted]\n let mainColors = ['#3598dc', '#F64E60', '#EBEDF3']\n let labelColors = ['#fff', '#fff', '#000']\n let labels = [i18n.t('models.task.status_enum.COMPLETED'), i18n.t('models.task.status_enum.FAILED'),\n i18n.t('uncompleted')]\n\n const hasNoData = values.every(e => e === 0)\n\n const options = {\n series: hasNoData ? [] : values,\n colors: mainColors,\n chart: {\n type: 'donut',\n height: hasNoData ? '225px' : '275px',\n style: {\n direction: 'rtl'\n },\n },\n states: {\n hover: {\n filter: {\n type: 'none',\n }\n },\n active: {\n filter: {\n type: 'none'\n }\n }\n },\n noData: {\n text: i18n.t('shared.no_data_available'),\n offsetY: -25,\n style: {\n color: '#000'\n }\n },\n plotOptions: {\n pie: {\n startAngle: -125,\n endAngle: 125,\n offsetY: 0,\n donut: {\n labels: {\n show: true,\n value: {\n show: false\n },\n total: {\n show: true,\n showAlways: true,\n fontSize: 30,\n label: `${completePercents}%`\n },\n }\n }\n },\n },\n grid: {\n padding: {\n bottom: -50\n },\n },\n legend: {\n show: false,\n position: 'right'\n },\n responsive: [{\n breakpoint: 992,\n options: {\n chart: {\n height: hasNoData ? '75px' : '350px'\n },\n }\n }, {\n breakpoint: 400,\n options: {\n chart: {\n height: hasNoData ? '75px' : '275px'\n }\n }\n }],\n dataLabels: {\n show: false,\n enabled: false,\n formatter: (_val, opts) => opts.w.config.series[opts.seriesIndex],\n style: {\n colors: labelColors\n }\n },\n labels: labels\n };\n\n const chart = new ApexCharts(el, options)\n chart.render();\n }\n}\n\nexport const initCompanyOverviewChart = (id) => {\n const el = document.getElementById(id)\n if (!el) return\n\n let dates = gon.tasks_per_day.map(t => t.date)\n const series = [\n {\n name: i18n.t('tasks'),\n data: gon.tasks_per_day.map(t => t.amount)\n }\n ]\n\n if (isRTL()) {\n series.forEach(s => { s.data.reverse() })\n dates.reverse()\n }\n\n const options = {\n series: series,\n colors: ['#fff'],\n chart: {\n type: 'bar',\n toolbar: { show: false },\n zoom: { enabled: false },\n offsetY: 47,\n },\n plotOptions: {\n bar: {\n borderRadius: 5,\n borderRadiusApplication: 'end'\n }\n },\n xaxis: {\n type: 'category',\n categories: dates,\n tickPlacement: 'on',\n labels: { show: false },\n axisTicks: { show: false }\n },\n yaxis: { show: false },\n grid: { show: false },\n legend: { show: false },\n tooltip: {\n enabled: true,\n x: { formatter: (_i, options) => (moment(options.w.globals.categoryLabels[options.dataPointIndex]).format(getDateFormat({ uppercase: true }))) },\n marker: { show: false },\n },\n fill: { opacity: 1 },\n dataLabels: { enabled: false },\n };\n\n const chart = new ApexCharts(el, options)\n chart.render()\n}\n\nexport const initRouteTimeline = (id, timelineData, routeStartTime, routeEndTime) => {\n const el = document.getElementById(id)\n if (!el || !routeStartTime || !routeStartTime || !routeEndTime) return\n\n const series = []\n timelineData.forEach(v => {\n const startTime = v.start_time.toString().slice(0, 19)\n const endTime = v.end_time.toString().slice(0, 19)\n\n series.push({\n name: v.order,\n data: [{\n x: i18n.t('views.sms.route'),\n y: [\n moment.utc(startTime).toDate().getTime(),\n moment.utc(endTime).toDate().getTime()\n ],\n taskId: v.task_id,\n address: v.address\n }]\n })\n })\n\n let chartWidth = series[0].data.length * 80;\n if (chartWidth < 1200) {\n chartWidth = 1200;\n }\n\n const options = {\n series: series,\n colors: [\"#3699FF\"],\n chart: {\n height: 150,\n width: chartWidth,\n type: 'rangeBar',\n zoom: { enabled: false },\n toolbar: { show: false }\n },\n plotOptions: {\n bar: {\n horizontal: true,\n barHeight: '50%',\n rangeBarGroupRows: true\n }\n },\n stroke: {\n width: 1,\n colors: ['#000000']\n },\n dataLabels: {\n enabled: true,\n formatter: (_val, opts) => (opts.w.config.series[opts.seriesIndex].name)\n },\n fill: {\n type: 'solid',\n opacity: 1,\n colors: ['#3699FF']\n },\n xaxis: {\n type: 'datetime',\n min: moment.utc(routeStartTime.toString().slice(0, 19)).toDate().getTime(),\n max: moment.utc(routeEndTime.toString().slice(0, 19)).toDate().getTime(),\n tickPlacement: 'on',\n labels: {\n format: 'HH:mm',\n formatter: function (val) {\n const minTime = moment.utc(routeStartTime.toString().slice(0, 19)).toDate().getTime();\n if (val < minTime) { return ''; }\n\n return moment.utc(val).format('HH:mm');\n }\n }\n },\n yaxis: {\n show: false\n },\n legend: {\n show: false\n },\n tooltip: {\n custom: (opts) => {\n const taskId = opts.w.config.series[opts.seriesIndex].data[0].taskId\n const address = opts.w.config.series[opts.seriesIndex].data[0].address\n const format = i18n.locale === 'en-US' ? 'HH:mm a' : 'HH:mm'\n const fromDate = moment.utc(new Date(opts.y1)).format(format)\n const toDate = moment.utc(new Date(opts.y2)).format(format);\n\n return `
${taskId}
${fromDate}-${toDate}
${address}
`\n }\n }\n };\n\n const chart = new ApexCharts(el, options);\n chart.render();\n}\n\nexport const initMultiRouteTimeline = (id, timelineData, routeStartTime, routeEndTime) => {\n const el = document.getElementById(id)\n if (!el || !routeStartTime || !routeStartTime || !routeEndTime) return\n\n const series = [];\n const plannedSeries = timelineData.planned;\n const actualVisits = timelineData.actual?.flatMap(v => v.visits?.map(visit => visit.task_id) || []) || [];\n Object.entries(timelineData).forEach(([key, values]) => {\n const seriesData = [];\n var index = 1;\n values.filter(v => v).forEach(v => {\n const startTime = v.start_time.toString().slice(0, 19);\n const endTime = v.end_time.toString().slice(0, 19);\n const startTimestamp = moment.utc(startTime).toDate().getTime();\n const endTimestamp = moment.utc(endTime).toDate().getTime();\n\n if (key === \"planned\") {\n const fillColor = actualVisits.includes(v.task_id) ? '#3699FF' : '#FFA800';\n\n seriesData.push({\n x: i18n.t('companies.planned'),\n y: [startTimestamp, endTimestamp],\n label: v.order,\n taskId: v.task_id,\n address: v.address,\n fillColor: fillColor,\n duration: ''\n });\n } else {\n let task_id = i18n.t('companies.unknown_stop');\n let address = v.address;\n let fillColor = '#1BC5BD';\n let label = index;\n\n if (v.visits && v.visits.length > 0) {\n var taskIds = v.visits.map(v => v.task_id);\n const orders = taskIds.map(taskId => {\n const plannedStop = plannedSeries.find(p => p.task_id === taskId);\n return plannedStop ? plannedStop.order : '';\n }).filter(Boolean);\n\n label = orders.length ? orders.sort((a,b) => a - b).join(', ') : '';\n task_id = taskIds.join(', ');\n index++;\n } else {\n fillColor = '#F64E60';\n label = '';\n }\n\n seriesData.push({\n x: i18n.t('companies.actual'),\n y: [startTimestamp, endTimestamp],\n label: label,\n taskId: task_id,\n address: address,\n fillColor: fillColor,\n duration: v.duration\n })\n }\n });\n series.push({ name: i18n.t(`companies.${key}`), data: seriesData });\n });\n\n let chartWidth = series[0].data.length * 80;\n if (chartWidth < 1200) {\n chartWidth = 1200;\n }\n\n const options = {\n series: series,\n chart: {\n height: 200,\n width: chartWidth,\n type: 'rangeBar',\n zoom: { enabled: false },\n toolbar: { show: false }\n },\n plotOptions: {\n bar: {\n horizontal: true,\n barHeight: '80%',\n rangeBarGroupRows: true,\n }\n },\n stroke: {\n width: 1,\n colors: ['#000000']\n },\n dataLabels: {\n enabled: true,\n formatter: (_val, opts) => opts.w.config.series[opts.seriesIndex].data[opts.dataPointIndex].label,\n style: { fontSize: '10px' }\n },\n fill: {\n type: 'solid',\n opacity: 1\n },\n xaxis: {\n type: 'datetime',\n min: moment.utc(routeStartTime.toString().slice(0, 19)).toDate().getTime(),\n max: moment.utc(routeEndTime.toString().slice(0, 19)).toDate().getTime(),\n tickPlacement: 'on',\n labels: {\n format: 'HH:mm',\n formatter: function (val) {\n const minTime = moment.utc(routeStartTime.toString().slice(0, 19)).toDate().getTime();\n if (val < minTime) { return ''; }\n\n return moment.utc(val).format('HH:mm');\n }\n }\n },\n yaxis: { show: false },\n legend: {\n show: true,\n position: 'bottom',\n horizontalAlign: 'center',\n customLegendItems: [\n i18n.t('companies.planned'),\n i18n.t('companies.actual'),\n i18n.t('companies.unknown_stop')\n ],\n markers: {\n fillColors: ['#3699FF', '#1BC5BD', '#F64E60']\n },\n inverseOrder: isRTL()\n },\n tooltip: {\n custom: (opts) => {\n const dataObj = opts.w.config.series[opts.seriesIndex].data[opts.dataPointIndex];\n const { taskId, address, y, duration } = dataObj;\n const format = i18n.locale === 'en-US' ? 'HH:mm a' : 'HH:mm';\n const fromDate = moment.utc(new Date(y[0])).format(format);\n const toDate = moment.utc(new Date(y[1])).format(format);\n\n return `
\n ${duration ? `\n ${i18n.t('datetime.distance_in_words.x_minutes', { count: duration })}\n
` : ''}\n ${taskId}
\n ${fromDate}-${toDate}
${address}\n
`;\n }\n }\n };\n\n const chart = new ApexCharts(el, options);\n chart.render();\n}\n\nexport const initLateReportsPieChart = (divId, displaySelectedDataTable) => {\n const data = gon.pie_chart_data;\n var options = {\n chart: {\n width: 480,\n type: \"pie\",\n events: {\n dataPointSelection: (_event, chartContext, config) => {\n var seriesIndex = config.dataPointIndex;\n var seriesTitle = chartContext.w.config.labels[seriesIndex];\n displaySelectedDataTable(seriesTitle);\n }\n }\n },\n dataLabels: { enabled: true },\n series: Object.values(data),\n labels: Object.keys(data)\n };\n\n var chart = new ApexCharts(document.querySelector(divId), options);\n chart.render();\n}\n","import { ISRAEL_CITIES_URL } from '../constants/index'\n\nexport const israelCities = async () => {\n if (!gon.load_cities) return []\n return await Promise.resolve($.get(ISRAEL_CITIES_URL))\n}\n\nexport const cityStreets = async (cityId) => {\n const url = `/israel_cities/${cityId}/streets`\n return await Promise.resolve($.get(url))\n}\n\nexport const companyLocations = (companyId) => {\n const url = `/locations/company_locations?company=${companyId}`\n return Promise.resolve($.getJSON(url))\n}\n\nexport const companyClients = (companyId) => {\n const url = `/companies/${companyId}/clients`\n return Promise.resolve($.getJSON(url))\n}\n","import { cityStreets, israelCities } from '../actions/select'\nimport { matchStart } from \"./date\";\nimport { toggleOther } from \"./view\";\nimport { i18n } from \"./i18n\";\n\nexport const initCitySelect = async(city_select, city_other, city_other_btn, city_other_content, callback = null) => {\n if (!city_select.length) return\n\n city_select.select2({\n dir: i18n.t('direction'),\n width: '100%',\n data: []\n })\n\n const loadedCities = await israelCities()\n\n city_select.select2({\n dir: i18n.t('direction'),\n width: '100%',\n matcher: (params, data) => matchStart(params, data),\n data: loadedCities\n })\n\n city_select.on('select2:selecting', async () => {\n city_other.val('')\n })\n\n city_other_btn.on('click', () => {\n toggleOther(city_select, city_other_content)\n })\n\n if (gon.chosen_city) {\n city_other_content.toggleClass('collapse')\n city_select.val('').prop('disabled', true).trigger('change')\n city_other.val(gon.chosen_city)\n }\n\n if (callback) { callback(city_select) }\n}\n\nexport const initCityStreetSelect = async (city_select, city_other, city_other_btn, city_other_content, street_select,\n street_other, street_other_btn, street_other_content) => {\n if (!$(city_select).length) return\n\n $(city_select).select2({\n dir: i18n.t('direction'),\n width: '100%',\n data: []\n })\n\n $(street_select).select2({\n dir: i18n.t('direction'),\n width: '100%',\n data: []\n })\n\n const loadedCities = await israelCities()\n\n $(city_select).select2({\n dir: i18n.t('direction'),\n width: '100%',\n matcher: (params, data) => matchStart(params, data),\n data: loadedCities\n })\n\n $(city_select).on('select2:selecting', async (e) => {\n const $select = $(street_select)\n $select.empty().trigger('change')\n $(city_other).val('')\n const streets = await cityStreets(e.params.args.data.city_id)\n streets.unshift({ id: '', text: ' '})\n\n $select.select2({\n dir: i18n.t('direction'),\n width: '100%',\n matcher: (params, data) => matchStart(params, data),\n data: streets\n })\n })\n\n $(street_select).on('select2:selecting', () => $(street_other).val(''))\n\n $(city_other_btn).on('click', () => {\n toggleOther($(city_select), $(city_other_content))\n })\n\n $(street_other_btn).on('click', () => {\n toggleOther($(street_select), $(street_other_content))\n })\n\n if (gon.chosen_city) {\n $(city_other_content).toggleClass('collapse')\n $(city_select).val('').prop('disabled', true)\n $(city_other).val(gon.chosen_city)\n }\n\n if (gon.chosen_street) {\n $(street_other_content).toggleClass('collapse')\n $(street_select).val('').prop('disabled', true)\n $(street_other).val(gon.chosen_street)\n }\n}\n","import { isRTL } from './locale'\n\nexport const initColorPicker = ($el, callback = null) => {\n const defaultColor = $el.data('default-color') || '#000'\n $el.css('background-color', defaultColor)\n $el.colorpicker({\n format: 'hex',\n color: defaultColor,\n extensions: [\n {\n name: 'swatches',\n options: {\n colors: {\n 'color1': '#EB3324',\n 'color2': '#D97A77',\n 'color3': '#FFFD55',\n 'color4': '#F08036',\n 'color5': '#C673CF',\n 'color6': '#EA3680',\n 'color7': '#7F82BB',\n 'color8': '#8E403A',\n 'color9': '#3A0603',\n 'color10': '#9FFCFD',\n 'color11': '#0023F5',\n 'color12': '#817F26',\n 'color13': '#75F94D',\n 'color14': '#C0C0C0',\n 'color15': '#507F80',\n 'color16': '#741B7C',\n 'color17': '#808080',\n 'color18': '#FF20D6',\n 'color19': '#E3FBD1',\n 'color20': '#FBD8D4',\n 'color21': '#07BF77'\n },\n namesAsValues: false\n }\n }\n ]\n }).on('colorpickerChange', (e) => {\n const hexaColor = e.color.toString()\n if (callback) callback(hexaColor, e.currentTarget)\n })\n\n const cpContainer = $('.colorpicker.dropdown-menu')\n isRTL() ? cpContainer.addClass('pull-right') : cpContainer.addClass('pull-left')\n}\n","import { i18n } from \"./i18n\";\n\nexport const search = table => (\n e => {\n if (e.target.value.length == 1) { return }\n $('.dataTables_processing').css('display', 'block')\n table.search(e.target.value.replace(/:/g, '')).draw()\n }\n)\n\nexport const defaultTranslations = () => ({\n processing: '',\n zeroRecords: i18n.t('zero_records'),\n search: i18n.t('search'),\n infoEmpty: i18n.t('info_empty'),\n lengthMenu: i18n.t('length_menu'),\n info: i18n.t('paginate.info'),\n infoFiltered: i18n.t('info_filtered'),\n paginate: {\n first: i18n.t('paginate.first'),\n last: i18n.t('paginate.last'),\n next: i18n.t('paginate.next'),\n previous: i18n.t('paginate.previous')\n },\n buttons: {\n colvis: ''\n }\n})\n\nexport const saveTableOrderConfig = () => ({\n stateSave: true,\n stateSaveParams: (settings, data) => {\n delete data.columns\n delete data.search\n delete data.length\n delete data.start\n },\n stateDuration: 0\n})\n\nexport const adjustTableSpaceWithMap = (table, map, fixedColumns, spacePerColumn = 115, breakpoint = 0) => setTimeout(() => {\n if ($(window).width() <= breakpoint) {\n $('.space-column').css({ width: 0, minWidth: 0 })\n } else {\n const columnsCount = table.columns(':visible').count()\n const tableWidth = $(table.table().container()).width()\n const mapWidth = map.width()\n const availableWidth = tableWidth - mapWidth\n const neededWidth = (columnsCount - fixedColumns) * spacePerColumn\n const emptySpace = availableWidth > neededWidth ? mapWidth : mapWidth - (neededWidth - availableWidth)\n $('.space-column').css({ width: emptySpace, minWidth: emptySpace })\n }\n}, 100)\n","import { defaultTranslations, saveTableOrderConfig, search } from \"../datatables\";\n\nexport const initTable = ($el, {\n sortBy = 0,\n sortOrder = 'desc',\n columnDefs = [],\n paging = false,\n drawCallback = () => {},\n initComplete = () => {},\n info = false,\n translations = defaultTranslations()\n} = {}) => {\n if (!$el.length) return\n\n const table = $el.DataTable({\n drawCallback: drawCallback,\n initComplete: initComplete,\n dom: 'irtp',\n searchHighlight: true,\n bInfo: info,\n paging: paging,\n pageLength: gon.pagination_size || 100,\n order: [[sortBy, sortOrder]],\n responsive: true,\n language: translations,\n ...saveTableOrderConfig(),\n columnDefs: [\n {\n targets: 'unorderable',\n orderable: false\n },\n {\n targets: 'space-column',\n orderable: false,\n className: 'noVis'\n },\n ...columnDefs\n ]\n })\n enableTableHighlight(table)\n\n $('.table-search').on('input', search(table))\n\n return table\n}\n\nexport const enableTableHighlight = (table) => {\n table.on('draw', () => {\n const body = $(table.tables().body())\n\n body.unhighlight()\n body.highlight(table.search())\n })\n}\n","export const updateFloatingActionsVisibility = (selectedCount) => {\n $('.selected-counter').text(`${selectedCount}`)\n const actions = $('.floating-actions')\n actions.stop(true, true)\n\n if (selectedCount === 0) {\n if (!actions.hasClass('d-none')) actions.animate({ opacity: 0 }, { queue: false, complete: () => { actions.addClass('d-none').removeClass('d-flex') }})\n return\n }\n if (actions.hasClass('d-none')) actions.addClass('d-flex').removeClass('d-none').animate({ opacity: 1 }, { queue: false })\n}\n","import Cropper from \"cropperjs\";\n\nexport const initImageInput = (input) => {\n const container = input.closest('.image-input')\n const imageWrapper = container.find('.image-input-wrapper')\n input.on('change', (e) => {\n imageWrapper.attr('src', URL.createObjectURL(e.target.files[0]))\n })\n container.find('.remove-image-btn').click(() => {\n input.val(null)\n imageWrapper.attr('src', '/blank_logo.png')\n container.find('.remove-image-input').val(1)\n })\n}\n\nexport const initCropper = (preview, fakeInput, realInput) => {\n const modal = $('#image-crop-modal')\n const modalImage = document.getElementById('image-crop-modal-image')\n const cropButton = $('#image-crop-modal-crop')\n let cropper\n\n fakeInput.change((e) => {\n const files = e.target.files\n const done = function (url) {\n modalImage.src = url\n modal.modal('show')\n };\n\n if (files && files.length > 0) {\n const file = files[0]\n\n if (URL) {\n done(URL.createObjectURL(file))\n } else if (FileReader) {\n const reader = new FileReader()\n reader.onload = () => done(reader.result)\n reader.readAsDataURL(file)\n }\n }\n })\n\n modal.on('shown.bs.modal', function () {\n cropper = new Cropper(modalImage, {\n aspectRatio: 1,\n viewMode: 2,\n });\n }).on('hidden.bs.modal', function () {\n cropper.destroy();\n cropper = null;\n });\n\n cropButton.click(() => {\n if (cropper) {\n const canvas = cropper.getCroppedCanvas({ width: 200, height: 200 });\n const imageData = canvas.toDataURL()\n preview.attr(\"src\", imageData);\n realInput.val(imageData)\n modal.modal('hide')\n }\n })\n}\n","export const taskOffcanvas = () => new window.KTOffcanvas('task_offcanvas', {\n baseClass: 'offcanvas',\n overlay: true\n})\n","import { taskOffcanvas } from \"./metronic/task_offcanvas\";\nimport { csrfToken, ajaxForm, setPropertyByPath } from \"./utils\";\nimport { initMap } from \"../services/map\";\nimport { i18n } from \"./i18n\";\nimport { getDateFormat, getFormattedDate, timepickerMeridian, matchStart } from \"./date\";\nimport { isRTL } from \"./locale\";\nimport { initVisitDriversSelect, initVisitPickUpAtDatepicker } from \"./visits/common\";\nimport { handleTaskPickStatusModal, updateTaskPickStatus, updateTaskStatus } from \"../actions/tasks\";\nimport { initDriversDropdown, initHoverCopy, initRoutesDropdown, initTaskCancelButton } from \"./view\";\nimport { showNotification } from \"./notifications\";\nimport { initCallRecordingSections, initProductSelect, initAddProductButtonEvent, deleteTaskPhoto } from \"../tasks\";\nimport { initTooltips, orderItemHistory, visitHistory } from \"./tooltips\";\nimport {\n initCodStatusDropdown,\n initTaskGeolocationsEditModal,\n initTaskSmsButton,\n initTechnicalDataModal,\n initIgnoreVisitWarningBtn\n} from \"./tasks/view\";\nimport { initArrowFunction } from \"./store_visits/table\";\nimport * as Ladda from \"ladda\";\nimport { initSmsTemplatesSelect } from \"./sms_templates\";\nimport { showOrderItemPickingModal } from \"./tasks/order_items\";\nimport { deleteSweetAlert } from '../helpers/sweetalerts';\nimport Swal from 'sweetalert2';\nimport {syncShopifyOrder} from \"./shopify\";\n\nexport const initTaskPanelView = (\n $elements,\n {\n onOpen = () => {},\n onTaskStatusUpdate = () => {},\n onDriverUpdate = () => {},\n onPickupAtUpdate = () => {}\n } = {}\n) => {\n $elements.off('click').on('click', (e) => {\n if (e.shiftKey || e.ctrlKey) return\n\n e.preventDefault()\n const taskId = e.currentTarget.dataset.taskId\n\n executeTaskPanelView(e, taskId, '', {\n onOpen: onOpen,\n onTaskStatusUpdate: onTaskStatusUpdate,\n onDriverUpdate: onDriverUpdate,\n onPickupAtUpdate: onPickupAtUpdate\n });\n })\n}\n\nexport const setUpTaskPanelView = () => {\n initTaskPanelView($('.task-panel-view-open'), {\n onOpen: (e) => {\n const row = $(e.currentTarget).parents('tr')\n row.addClass('task-row-active')\n }\n })\n\n const offcanvas = taskOffcanvas();\n initArrowFunction(offcanvas);\n offcanvas.on('afterHide', () => {\n $('tr.task-row-active').removeClass('task-row-active')\n });\n}\n\nlet panelViewMap;\nexport const executeTaskPanelView = (event, taskId, tab = '', { onOpen = () => {}, onTaskStatusUpdate = () => {}, onDriverUpdate = () => {}, onPickupAtUpdate = () => {}} = {}) => {\n const container = $('#task_offcanvas')\n const offcanvas = taskOffcanvas()\n\n const loader = $('.data-preloader')\n loader.removeClass('d-none')\n\n fetch(`/tasks/${taskId}/panel_view`, {\n method: 'POST',\n headers: {\n 'X-CSRF-TOKEN': csrfToken(),\n 'Content-Type': 'application/json',\n }\n }).then(res => res.text()).then(html => {\n container.html(html)\n const locations = Object.values(JSON.parse($('#task_offcanvas #task_locations').val()));\n const driverLocation = JSON.parse($('#task_offcanvas #driver_location').val() || '{}')\n initTaskPanelViewMapContainer(locations, driverLocation);\n\n initTooltips($('.visit-tooltip').not('.tooltipstered'), '/visits/:id/fetch_visit_history_json', 600, visitHistory)\n initTooltips($('.order-item-history-json').not('.tooltipstered'), '/order_items/:id/fetch_history_json', 600, orderItemHistory)\n initTechnicalDataModal($('#task_offcanvas #task-delivery-transfer-logs'), $('#task_offcanvas #task-delivery-transfer-logs-modal'), 'delivery_transfer_logs')\n initTechnicalDataModal($('#task_offcanvas #task-origin-orders'), $('#task_offcanvas #task-origin-orders-modal'), 'origin_orders')\n initTechnicalDataModal($('#task_offcanvas #task-logs'), $('#task_offcanvas #task-logs-modal'), 'webhook_logs')\n initIgnoreVisitWarningBtn($('.ignore-visit-warning-btn'))\n initHoverCopy()\n initProductSelect()\n initAddProductButtonEvent()\n\n $('#task_offcanvas .select2-init').select2({\n dir: i18n.t('direction'),\n width: '100%',\n matcher: (params, data) => matchStart(params, data)\n })\n\n $('.timepicker-1m-init').timepicker({\n minuteStep: 1,\n defaultTime: null,\n showMeridian: timepickerMeridian(),\n icons: {\n up: 'ki ki-arrow-up',\n down: 'ki ki-arrow-down'\n }\n })\n\n initDriversDropdown((data) => {\n $('#task_offcanvas .drivers-dropdown-current-driver').text(data.new_driver_name || i18n.t('models.driver.driver'))\n $('#task_offcanvas .drivers-dropdown-current-driver-icon').html(``)\n onDriverUpdate(data)\n })\n $('#task_offcanvas .input-group.allow-past').datepicker({\n format: getDateFormat(),\n language: i18n.t('locale'),\n rtl: isRTL(),\n orientation: 'bottom',\n defaultDate: getFormattedDate(),\n autoclose: true,\n todayHighlight: true,\n }).on('hide', e => e.stopPropagation())\n initVisitPickUpAtDatepicker($('.task-visit-pickup-date'), onPickupAtUpdate)\n $('#task_offcanvas .visit-drivers-select2:not([data-select2-id^=\"select2\"])').each((i, d) => initVisitDriversSelect(d, onDriverUpdate))\n\n $('#task_offcanvas .task-set-status').off('click').on('click', (e) => {\n const taskId = e.currentTarget.dataset.taskId\n const status = e.currentTarget.dataset.newStatus\n updateTaskStatus(taskId, status, onTaskStatusUpdate)\n })\n\n initCodStatusDropdown($('.update-cod-status'), (data) => {\n $('.cod-returned-by-driver-at').text(data.returned_by_driver_at)\n $('.cod-returned-to-company-at').text(data.returned_to_company_at)\n })\n\n if ($('#set-pick-status-modal').length) {\n $('#task_offcanvas .task-set-pick-status').off('click').on('click', (e) => {\n const { taskId, newStatus, packagesQuantity } = e.currentTarget.dataset\n if (newStatus === 'PICKED') {\n handleTaskPickStatusModal(taskId, newStatus, packagesQuantity ? packagesQuantity : 1)\n } else {\n updateTaskPickStatus(taskId, newStatus)\n }\n })\n } else {\n $('#task_offcanvas .task-pick-status-dropdown').addClass('d-none')\n }\n\n initOffcanvasEditableFields(taskId)\n\n const reloadPanel = (tab) => (() => {\n executeTaskPanelView(event, taskId, tab, {\n onOpen: onOpen,\n onTaskStatusUpdate: onTaskStatusUpdate,\n onDriverUpdate: onDriverUpdate,\n onPickupAtUpdate: onPickupAtUpdate\n })\n })\n\n initRoutesDropdown(reloadPanel(''))\n initTaskCancelButton($('#task_offcanvas .task-cancel-button'), reloadPanel(''))\n\n $('#task_offcanvas .inaccurate-location-form').on('submit', (e) => {\n showNotification({ message: i18n.t('shared.email_sent_successfully') })\n $(e.currentTarget).closest('.modal').modal('hide')\n })\n\n $('.sync-shop-panel').on('click', syncShopifyOrder)\n\n initTaskGeolocationsEditModal($('#task_offcanvas .edit-task-geolocation-btn'), reloadPanel(''))\n\n $('#task_offcanvas .archive-task').on('click', (e) => {\n e.preventDefault();\n const url = e.currentTarget.dataset.url;\n deleteSweetAlert(\n url, window.location.href, i18n.t('models.task.delete_warning'),\n i18n.t('recycle_bin'), i18n.t('views.tasks.sweetalert.moved_to_recycle_bin')\n )\n })\n\n initTaskSmsButton($('#task_offcanvas .task-sms-btn'))\n initSmsTemplatesSelect($('.sms-templates-select'), $('#message-body'))\n\n Ladda.bind('.ladda-button')\n\n $('#offcanvas-modals').empty()\n $('.modal-backdrop').remove()\n\n const modals = $('#task_offcanvas .modal')\n modals.on('ajax:success', onAjaxSuccess).on('ajax:error', onAjaxError).on('ajax:complete', reloadPanel(''))\n modals.each((_id, el) => { $('#offcanvas-modals').append($(el)) })\n\n initTaskPanelViewTabs(reloadPanel)\n $('.offcanvas-close').on('click', () => { offcanvas.hide() })\n loader.addClass('d-none')\n onOpen(event, taskId)\n offcanvas.show()\n if (tab) $(`.panel-view-tabs[data-content='${tab}']`).trigger('click')\n\n ajaxForm($('#new_ticket'), (response) => {\n if (response.ticket_id) {\n var html = `\n ${i18n.t('view_ticket')}\n `;\n $('#ticket-btn-container').html('').html(html);\n showNotification({ message: response.message, type: 'success'});\n $('#new-ticket-modal').modal('hide');\n } else {\n showNotification({ message: response.message, type: 'danger'})\n }\n });\n\n $('#btn-pick-order-item').on('click', (e) => showOrderItemPickingModal(e));\n $(document).on('click', '#task_offcanvas .btn-task-photo-delete', (e) => deleteTaskPhoto(e.currentTarget));\n })\n}\n\nexport const setupMapPanelViewLink = () => {\n const onOpen = (e, _taskId) => {\n const visitId = e.target.dataset.visitId;\n const row = $(document).find(`.task-row-${visitId}`).parents('tr');\n row.addClass('task-row-active');\n }\n\n $(document).on('click', '.map-task-link', (e) => {\n e.preventDefault();\n\n const taskId = e.currentTarget.dataset.taskId;\n executeTaskPanelView(e, taskId, '', {\n onOpen: onOpen,\n onTaskStatusUpdate: () => {},\n onDriverUpdate: () => {},\n onPickupAtUpdate: () => {}\n });\n })\n}\n\nconst initTaskPanelViewTabs = (reloadPanel = (_) => {}) => {\n $('.panel-view-tabs').off('click').on('click', (e) => {\n const tabLink = e.currentTarget;\n const { taskId, content } = tabLink.dataset;\n const icon = $(tabLink).find('i')[0];\n\n $('.panel-view-icons').removeClass('text-primary');\n if (icon != undefined) { $(icon).addClass('text-primary'); }\n\n const container = $(`#${content}-container`);\n const url = content == 'versions' ? `/tasks/${taskId}/versions?panel_view=true` : `/tasks/${taskId}/panel_view_tabs?tab=${content}`;\n\n if ($(container).is(':empty')){\n fetch(url, {\n method: 'GET',\n headers: {\n 'X-CSRF-TOKEN': csrfToken(),\n 'Content-Type': 'application/json',\n }\n }).then(res => res.text()).then(html => {\n $(`.${content}-loader`).hide();\n container.html(html)\n\n const modals = container.find('.modal')\n modals.on('ajax:success', onAjaxSuccess).on('ajax:error', onAjaxError).on('ajax:complete', reloadPanel(content)) // handle modal ajax requests\n modals.each((_id, el) => { $('#offcanvas-modals').append($(el)) })\n\n container.on('ajax:success', onAjaxSuccess).on('ajax:error', onAjaxError).on('ajax:complete', reloadPanel(content)) // handle container ajax requests\n\n Ladda.bind('.ladda-button')\n\n if (content === 'call_recordings') initCallRecordingSections();\n if (content === 'proof_of_delivery') initOffcanvasEditableFields(taskId);\n })\n }\n })\n}\n\nconst onAjaxSuccess = (event) => {\n const data = event.detail[0]\n\n if (data?.message) showNotification({ message: data.message, type: data.type })\n}\n\nconst onAjaxError = () => {\n showNotification({ message: i18n.t('shared.something_went_wrong'), type: 'danger' })\n}\n\nconst initOffcanvasEditableFields = (taskId) => {\n const wrappers = $('.editable-wrapper')\n wrappers.on('wheel', 'input[type=number]', (e) => { $(e.currentTarget).blur() })\n\n const fields = wrappers.map((_i, el) => {\n const wrapper = $(el)\n const input = wrapper.find('.editable-input')\n const fieldName = wrapper.data('name')\n if (!fieldName) return null\n\n const obj = {\n name: fieldName,\n wrapper: wrapper,\n input: input,\n textEl: wrapper.find('.editable-text'),\n initialValue: () => (wrapper.data('initial-value')),\n value: () => (input.val()),\n textToShow: () => (input.prop('tagName') === 'SELECT' ? input.find(`option[value='${obj.value()}']`).text() : obj.value()),\n isValueShown: () => (!wrapper.data('hide-on-empty') || (!!obj.value() && obj.value() !== 'false'))\n }\n\n wrapper.data('initial-value', obj.value())\n\n return obj\n }).get().filter(f => f)\n\n const toggleMode = () => {\n $('.editable-text, .editable-enable, .editable-input-wrapper, .editable-cancel, .editable-save, .street-view-link').toggleClass('d-none')\n const isEditEnabled = $('.editable-enable').hasClass('d-none')\n fields.forEach((f) => { f.wrapper.toggleClass('d-none', !(f.isValueShown() || isEditEnabled)) })\n }\n $('.editable-enable').off('click').on('click', () => { toggleMode() })\n $('.editable-cancel').off('click').on('click', () => {\n fields.forEach(field => { field.input.val(field.initialValue()) })\n toggleMode()\n })\n\n $('.editable-save').off('click').on('click', () => {\n const body = {}\n\n fields.forEach((field) => { setPropertyByPath(body, field.name, field.input.val()) })\n document.querySelectorAll('.editable-hidden-input').forEach((el) => { setPropertyByPath(body, el.getAttribute('name'), el.value) })\n\n const loader = $('.data-preloader');\n\n loader.removeClass('d-none')\n fetch(`/tasks/${taskId}/async_update`, {\n method: 'POST',\n headers: {\n 'X-CSRF-TOKEN': csrfToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ task: body })\n }).then(res => res.json()).then(data => {\n if (data.error) {\n showNotification({ message: data.error || i18n.t('shared.something_went_wrong'), type: 'danger'})\n } else {\n if (data.locations) {\n const driverLocation = JSON.parse($('#task_offcanvas #driver_location').val() || '{}')\n initTaskPanelViewMapContainer(Object.values(data.locations), driverLocation);\n }\n\n fields.forEach((field) => {\n field.wrapper.data('initial-value', field.value())\n field.textEl.text(field.textToShow())\n })\n\n toggleMode()\n showNotification({ message: i18n.t('saved_successfully') })\n }\n\n loader.addClass('d-none')\n })\n })\n}\n\nconst initTaskPanelViewMapContainer = (locations, driverLocation = null) => {\n if(panelViewMap) {\n panelViewMap.off();\n panelViewMap.remove();\n }\n\n const mapContainer = document.querySelector('#task_offcanvas .task-map')\n if (mapContainer) {\n $(mapContainer).html('');\n panelViewMap = initMap(mapContainer, (map) => {\n const numberIcon = window.L.divIcon({\n className: 'blue-number-icon',\n iconSize: [29, 47],\n iconAnchor: [15, 47]\n });\n const markers = [];\n\n locations.forEach(location => {\n if (location.latitude) {\n let circle;\n if (gon.is_organization && gon.support_destinations_only && location.is_geo_fenced) {\n // Add circle with 200m radius around marker\n circle = window.L.circle([location.latitude, location.longitude], { color: '#3388ff',\n fillColor: '#3388ff', fillOpacity: 0.2, radius: 200 }).addTo(map);\n }\n\n let markerOptions = { icon: numberIcon, draggable: true, locationType: location.type,\n taskId: location.task_id, ogLat: location.latitude, ogLon: location.longitude,\n circle: circle };\n const marker = window.L.marker([location.latitude, location.longitude], markerOptions)\n .bindPopup(buildTip(location))\n .openPopup().addTo(map);\n\n // Update circle position when marker is dragged\n if (circle) { marker.on('drag', (e) => circle.setLatLng(e.target.getLatLng())); }\n marker.on('dragend', updateLatlongToVisits);\n markers.push(marker);\n }\n });\n\n if (driverLocation?.latitude && driverLocation?.longitude) {\n const driverIcon = L.divIcon({\n className: 'driver-icon',\n iconSize: [30, 30],\n iconAnchor: [22, 15]\n })\n\n const { latitude, longitude } = driverLocation\n const driverMarker = L.marker([latitude, longitude], { icon: driverIcon }).addTo(map)\n markers.push(driverMarker)\n }\n\n if (markers.length) {\n map.fitBounds(window.L.featureGroup(markers).getBounds(), { padding: [10, 10] });\n }\n })\n\n setTimeout(() => { panelViewMap.invalidateSize() }, 250);\n }\n}\n\nconst buildTip = (location) => {\n const icon = location.type == \"source\" ? 'fa-arrow-up' : 'fa-arrow-down';\n\n return '
' +\n `
` +\n '
' +\n `

${location.name}

`+\n `

${location.partial_address}

` +\n '
' +\n '
';\n}\n\nconst updateLatlongToVisits = (event) => {\n Swal.fire({\n title: i18n.t('views.tasks.location_update'),\n icon: 'warning',\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn btn-success',\n confirmButtonText: i18n.t('yes_str'),\n cancelButtonText: i18n.t('cancel'),\n cancelButtonClass: 'btn btn-grey'\n }).then(async (result) => {\n const marker = event.target;\n if (result.isConfirmed) {\n const newPosition = marker.getLatLng();\n const taskId = marker.options.taskId;\n const locationType = marker.options.locationType;\n let data = {\n [`${locationType}_latitude`]: newPosition.lat,\n [`${locationType}_longitude`]: newPosition.lng,\n }\n const response = await asyncUpdateTask(taskId, data);\n if (response.success)\n showNotification({ message: i18n.t('saved_successfully'), type: 'success'});\n else\n showNotification({ message: response.error || i18n.t('shared.something_went_wrong'), type: 'danger'});\n } else {\n var circle = marker.options.circle;\n var newLatLng = new L.LatLng(marker.options.ogLat, marker.options.ogLon);\n marker.setLatLng(newLatLng);\n if (circle) { circle.setLatLng(newLatLng); }\n }\n })\n}\n\nconst asyncUpdateTask = (taskId, data) => {\n return new Promise((resolve, reject) => {\n fetch(`/tasks/${taskId}/async_update`, {\n method: 'POST',\n headers: {\n 'X-CSRF-TOKEN': csrfToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ task: data })\n }).then(\n (res) => { resolve(res.json()); },\n (_error) => { reject({}); }\n );\n });\n}\n","import Quill from 'quill/core'\nimport Toolbar from 'quill/modules/toolbar'\nimport Snow from 'quill/themes/snow'\nimport Bold from 'quill/formats/bold'\nimport Italic from 'quill/formats/italic'\nimport Header from 'quill/formats/header'\nimport Underline from \"quill/formats/underline\"\nimport Strike from \"quill/formats/strike\"\nimport { DirectionClass } from \"quill/formats/direction\"\nimport { AlignClass } from \"quill/formats/align\"\nimport { isRTL } from \"./locale\";\nimport { ColorStyle, ColorClass } from 'quill/formats/color'\nimport Link from 'quill/formats/link'\n\nQuill.register({\n 'formats/header': Header,\n 'modules/toolbar': Toolbar,\n 'themes/snow': Snow,\n 'formats/bold': Bold,\n 'formats/italic': Italic,\n 'formats/underline': Underline,\n 'formats/strike': Strike,\n 'formats/direction': DirectionClass,\n 'formats/align': AlignClass,\n 'formats/color': ColorClass,\n 'formats/color': ColorStyle,\n 'formats/link': Link\n})\n\nexport default Quill\n\nexport const modules = {\n toolbar: [\n ['bold', 'italic', 'underline', 'strike'],\n ['link', { 'color': [] }],\n ['clean']\n ]\n}\n\nexport const initializeQuillEditor = (editorId, inputId) => {\n if (document.getElementById(editorId)) {\n const editor = new Quill(`#${editorId}`, {\n theme: 'snow',\n modules: modules\n })\n\n if (isRTL()) {\n const editorText = document.querySelector(\"#editor .ql-editor\")\n if (editorText) {\n editorText.style.textAlign = 'right'\n editorText.style.direction = 'rtl'\n }\n }\n\n editor.root.innerHTML = document.getElementById(inputId).value\n\n editor.on('text-change', () => {\n const input = document.getElementById(inputId)\n input.value = editor.root.innerHTML\n input.dispatchEvent(new Event('change'))\n })\n }\n}\n","import { i18n } from \"../i18n\";\nimport { defaultTranslations, saveTableOrderConfig, search } from \"../datatables\";\nimport { flyOnMapToCoordinates } from \"../view\";\nimport { isRTL } from \"../locale\";\nimport { initTaskPanelView } from \"../panel_view\";\nimport { initRouteDriversSelect, initRouteVehiclesSelect } from \"../visits/common\";\nimport { ARROWHEADS_OPTIONS, POLYLINE_OPTIONS } from \"../../constants\";\n\nexport const initRoutesTable = ($el, name, mapObj) => {\n return $el.DataTable({\n drawCallback: () => {\n $('.show-on-map').off('click').on('click', e => {\n e.preventDefault()\n flyOnMapToCoordinates(gon.full_visits.filter(v => (v.visit_id == e.currentTarget.dataset.id))[0], mapObj)\n })\n },\n initComplete: () => {\n setTimeout(() => { window.dispatchEvent(new Event('resize')) }, 100)\n },\n stateSave: true,\n stateSaveCallback: (settings, data) => { localStorage.setItem(`DataTables_${name}`, JSON.stringify(data)) },\n stateLoadCallback: () => (JSON.parse(localStorage.getItem(`DataTables_${name}`))),\n stateSaveParams: (settings, data) => {\n data.columns.forEach(column => { delete column.search })\n delete data.search\n delete data.length\n delete data.start\n },\n stateDuration: 0,\n dom: 't',\n responsive: true,\n ordering: false,\n paging: false,\n buttons: [\n {\n extend: 'colvis',\n columns: ':not(.noVis)'\n }\n ],\n columnDefs: [\n {\n targets: [0],\n width: '25px'\n },\n {\n targets: [0, 1, 2],\n className: 'noVis'\n },\n {\n targets: 'default-invisible',\n visible: false\n },\n {\n targets: 'space-column',\n orderable: false,\n className: 'noVis'\n }\n ],\n language: {\n zeroRecords: i18n.t('zero_records'),\n infoEmpty: 'No records available',\n infoFiltered: '(filtered from _MAX_ total records)',\n paginate: {\n first: i18n.t('paginate.first'),\n last: i18n.t('paginate.last'),\n next: i18n.t('paginate.next'),\n previous: i18n.t('paginate.previous')\n },\n buttons: {\n colvis: ''\n },\n }\n })\n}\n\nexport const createStartEndMarkers = (doneRoute, undoneRoute) => {\n const allRoute = doneRoute.concat(undoneRoute)\n if (allRoute.length > 1) {\n const startCoords = allRoute.shift()\n const endCoords = allRoute.pop()\n let startMarker, endMarker\n if (startCoords.length === 2) {\n startMarker = L.marker(startCoords, { icon: startIcon() })\n }\n if (endCoords.length === 2) {\n endMarker = L.marker(endCoords, { icon: endIcon() })\n }\n return [startMarker, endMarker]\n }\n return []\n}\n\nexport const createStartEndMarkersPlanned = (startCoords, endCoords) => {\n let startMarker, endMarker\n if (startCoords && startCoords.length === 2) {\n startMarker = L.marker(startCoords, { icon: startIcon() })\n }\n if (endCoords && endCoords.length === 2) {\n endMarker = L.marker(endCoords, { icon: endIcon() })\n }\n return [startMarker, endMarker].filter(Boolean)\n}\n\nconst startIcon = () => (\n L.divIcon({\n className: 'red-flag-icon',\n iconSize: [29, 37],\n iconAnchor: [4, 37]\n })\n)\n\nconst endIcon = () => (\n L.divIcon({\n className: 'blue-flag-icon',\n iconSize: [29, 37],\n iconAnchor: [4, 37]\n })\n)\n\nexport const fillMoneyTransferredSum = () => {\n const moneySum = document.getElementById('total-returned-cod')\n if (!moneySum) return\n\n const moneyCollects = new Map()\n\n $('.cod-container').each((_i, el) => {\n const { taskId, codSum, codStatus } = el.dataset\n if (codStatus === 'unreturned') return\n\n moneyCollects.set(taskId, parseInt(codSum))\n })\n\n const returnedCodSum = [...moneyCollects.values()].reduce((partialSum, cod) => partialSum + cod, 0)\n moneySum.innerText = (returnedCodSum / 100).toString()\n}\n\nexport const initRoutesIndexTable = ($el) => (\n $el.DataTable({\n drawCallback: (settings) => {\n const api = new $.fn.dataTable.Api(settings)\n $(api.table().body()).unhighlight().highlight(api.search())\n },\n createdRow: (el) => {\n initRouteDriversSelect($(`.route-drivers-select2-${el.dataset.routeId}`))\n initRouteVehiclesSelect($(`.route-vehicles-select2-${el.dataset.routeId}`))\n },\n dom: '<\"top\"i>rt<\"bottom\"><\"clear\">',\n searchHighlight: true,\n bInfo: false,\n paging: false,\n order: [0],\n responsive: true,\n language: defaultTranslations(),\n ...saveTableOrderConfig(),\n columnDefs: [\n { targets: 'actions', width: 50 },\n { targets: 'invisible', visible: false }\n ],\n })\n)\n\nexport const initRouteVisitsTable = ($el) => {\n const table = $el.DataTable({\n drawCallback: () => {\n initTaskPanelView($('.task-panel-view-open'))\n },\n dom: 'irtp',\n searchHighlight: true,\n paging: false,\n responsive: true,\n ordering: true,\n order: [0, 'asc'],\n autoWidth: false,\n language: { ...defaultTranslations(), info: i18n.t('info_total') },\n createdRow: (row, data) => {\n $(row).attr('id', `visit-row-${data.id}`).attr('data-task-id', data.task_id).attr('data-visit-id', data.id)\n },\n columns: [\n {\n title: 'Order',\n data: 'order_id'\n },\n {\n title: '',\n width: '45px',\n render: (_data, _type, row) => {\n return (`\n
\n ${row.order_id}\n \n \n
`)\n }\n },\n {\n title: i18n.t('models.task.task'),\n data: 'task_id',\n render: (data) => (`\n \n ${data}\n \n `)\n },\n {\n title: i18n.t('models.company.company'),\n data: 'company_name',\n visible: gon.allow_companies,\n render: (_data, _type, row) => (row.company_id ? `${row.company_name}` : '')\n },\n {\n title: i18n.t('models.visit.kind'),\n data: 'kind',\n visible: gon.show_visit_kind,\n render: (kind) => (`${i18n.t(`models.visit.kind_enum.${kind}`)}`)\n },\n {\n title: i18n.t('drivers.daily_route_plan.arrival_time'),\n data: 'eta_at_formatted'\n },\n {\n title: i18n.t(\"drivers.daily_route_plan.time_window\"),\n render: (_data, _type, row) => (\n (row.earliest_at || row.latest_at) ? `
${row.earliest_at || ''} - ${row.latest_at || ''}
` : ''\n ),\n createdCell: (td) => { $(td).css('direction', 'ltr') }\n },\n {\n title: i18n.t('models.order_item.weight'),\n data: 'weight'\n },\n {\n title: i18n.t('models.task.surfaces_quantity'),\n data: 'surfaces_quantity',\n visible: gon.allow_surfaces_quantity\n },\n {\n title: i18n.t(\"models.location.address\"),\n data: 'partial_address'\n },\n {\n title: i18n.t('models.location.location_name'),\n data: 'location_name'\n }\n ],\n columnDefs: [\n {\n targets: [0],\n visible: false\n },\n {\n targets: '_all',\n orderable: false\n }\n ]\n })\n $('.route-visits-search').on('input', (e) => $('#route-visits-table-tbody').unhighlight().highlight(e.currentTarget.value))\n return table\n}\n\nexport const initUnassignedVisitsTable = ($el) => {\n const table = $el.DataTable({\n drawCallback: (settings) => {\n const api = new $.fn.dataTable.Api(settings)\n $(api.table().body()).unhighlight().highlight(api.search())\n initTaskPanelView($('.task-panel-view-open'))\n },\n dom: 'irtp',\n searchHighlight: true,\n lengthChange: false,\n pageLength: gon.pagination_size,\n responsive: true,\n order: [1, 'desc'],\n language: { ...defaultTranslations(), info: i18n.t('info_total') },\n ...saveTableOrderConfig(),\n createdRow: (row, data) => {\n $(row).attr('id', `visit-row-${data.id}`).attr('data-task-id', data.task_id).attr('data-visit-id', data.id)\n },\n columns: [\n {\n title: '',\n width: '30px',\n orderable: false,\n render: () => (`\n \n \n \n \n `)\n },\n {\n title: i18n.t('models.task.task'),\n data: 'task_id',\n render: (data) => (`\n \n ${data}\n \n `)\n },\n {\n title: i18n.t('models.company.company'),\n data: 'company_name',\n visible: gon.allow_companies,\n render: (_data, _type, row) => (row.company_id ? `${row.company_name}` : '')\n },\n {\n title: i18n.t('models.visit.kind'),\n data: 'kind',\n visible: gon.show_visit_kind,\n render: (kind) => (`${i18n.t(`models.visit.kind_enum.${kind}`)}`)\n },\n {\n title: i18n.t('drivers.daily_route_plan.arrival_time'),\n data: 'eta_at_formatted',\n orderable: false,\n class: 'd-none'\n },\n {\n title: i18n.t(\"drivers.daily_route_plan.time_window\"),\n render: (_data, _type, row) => ((row.earliest_at || row.latest_at) ? `
${row.earliest_at || ''} - ${row.latest_at || ''}
` : ''),\n createdCell: (td) => {\n $(td).css('direction', 'ltr')\n }\n },\n {\n title: i18n.t('models.order_item.weight'),\n data: 'weight'\n },\n {\n title: i18n.t('models.task.surfaces_quantity'),\n data: 'surfaces_quantity',\n visible: gon.allow_surfaces_quantity\n },\n {\n title: i18n.t(\"models.location.address\"),\n data: 'partial_address'\n },\n {\n title: i18n.t('models.location.location_name'),\n data: 'location_name'\n }\n ]\n })\n $('.unassigned-visits-search').on('input', search(table))\n return table\n}\n\nexport const showIturanRoutes = (map, url, controlLayers) => {\n fetch(url, {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' }\n }).then(res => res.json()).then(response => {\n const trips = response.ituran_routes;\n let actualRoute = [];\n let markers = [];\n let stopIndex = 1;\n\n trips.forEach((location, _index) => {\n actualRoute.push([location.lat, location.lon]);\n\n if (location.stops && Object.keys(location.stops).length > 0) {\n var marker = L.circleMarker([location.lat, location.lon], { radius: 5 });\n var stop = location.stops;\n var numberedIcon = renderNumberedStopIcon(stop.duration);\n var content = `
\n
\n \n ${stopIndex}\n
\n
\n ${location.address}\n
\n
\n ${stop.time}\n \n \n ${i18n.t('datetime.distance_in_words.x_minutes', { count: stop.duration })}\n \n
\n
`\n\n marker = L.marker([location.lat, location.lon], { icon: numberedIcon }).addTo(map)\n stopIndex += 1\n marker.bindPopup(content, { offset: [0, -20] });\n markers.push(marker);\n }\n });\n\n const startEndMarkers = createStartEndMarkers(actualRoute, []);\n L.featureGroup(startEndMarkers).addTo(map)\n\n const ituranOverlay = L.featureGroup([\n L.featureGroup(markers),\n L.featureGroup(startEndMarkers),\n L.featureGroup([L.polyline(actualRoute, {...POLYLINE_OPTIONS, color: 'blue'}).arrowheads({...ARROWHEADS_OPTIONS, yawn: 30, size: '10px'})])\n ]).addTo(map);\n\n controlLayers.addOverlay(ituranOverlay, i18n.t('views.map.ituran_routes'));\n\n // download csv button\n addDownloadCSVButton(map, trips);\n });\n}\n\nconst renderNumberedStopIcon = (waitTime) => {\n let radius = Math.min(30 + (waitTime - 5), 150)\n let iconAnchor = [radius / 2, radius / 2]\n\n return L.divIcon({\n className: 'map-icon-circle-parent',\n iconSize: [radius, radius],\n iconAnchor: iconAnchor,\n html: `
`\n })\n}\n\nconst addDownloadCSVButton = (map, trips) => {\n const downloadCSV = () => {\n const csvContent = [\n [\n i18n.t('latitude'), i18n.t('longitude'), i18n.t('models.task.address'), i18n.t('views.routes.speed'),\n i18n.t('shared.event'), i18n.t('shared.stop_time_duration'), i18n.t('shared.stop_time_at')\n ].join(','),\n ...trips.map(route => {\n const stop = route.stops || {};\n return [ route.lat, route.lon, (route.address || '').replace(/,/g, ' '), route.speed || '', stop.event_name || '',\n stop.duration || '', stop.time || ''\n ].join(',');\n })\n ].join('\\n');\n\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });\n const link = document.createElement('a');\n const url = URL.createObjectURL(blob);\n link.setAttribute('href', url);\n link.setAttribute('download', `${i18n.t('views.map.ituran_routes')}.csv`);\n link.style.visibility = 'hidden';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n };\n\n L.Control.DownloadButton = L.Control.extend({\n onAdd: function() {\n const button = L.DomUtil.create('button', 'download-csv-btn');\n button.innerHTML = ``;\n button.style.cssText = 'padding: 5px 10px; background: white; border: 2px solid rgba(0,0,0,0.2); border-radius: 4px; cursor: pointer;';\n L.DomEvent.on(button, 'click', downloadCSV);\n return button;\n }\n });\n\n new L.Control.DownloadButton({ position: 'topright' }).addTo(map);\n}\n\nexport const initCreateRouteModal = () => {\n const colorPicker = $('.route-color-select')\n\n $('.route-driver-select').on('select2:selecting', (e) => {\n const form = $(e.currentTarget).closest('form')\n const option = e.params.args.data.element\n const color = option.dataset.color\n form.find('input[id=route_name]').val(e.params.args.data.text + ' ' + form.find('input[id=route_date]').val()).trigger('change')\n\n if (!color) return\n if (colorPicker.data('customColor')) return\n colorPicker.val(color).trigger('change').data('customColor', false)\n })\n\n colorPicker.on('change', (e) => { $(e.currentTarget).data('customColor', true) })\n}\n","export const enableScanner = () => {\n let reading = false\n $(document).on('keypress', function (e) {\n if (e.target.tagName === 'INPUT' && e.keyCode !== 13) return\n\n // send or submit on Enter\n if (e.keyCode === 13) {\n if (e.target.tagName === 'INPUT' && e.target.form) {\n e.target.form.submit()\n } else {\n if (window.BarcodesScanner.tmpData.length > 4) {\n onScannerNavigate(window.BarcodesScanner.tmpData, 'FAKE_SCANNER', 'WEDGE', window.BarcodesScanner.tmpTimestamp, window.BarcodesScanner.tmpData.length)\n }\n window.BarcodesScanner.tmpData = '';\n reading = false\n }\n }\n\n // send on timeout\n if (!reading) {\n reading = true\n setTimeout(() => {\n if (!reading) return\n\n if (window.BarcodesScanner.tmpData.length > 4) {\n onScannerNavigate(window.BarcodesScanner.tmpData, 'FAKE_SCANNER', 'WEDGE', window.BarcodesScanner.tmpTimestamp, window.BarcodesScanner.tmpData.length)\n }\n window.BarcodesScanner.tmpData = '';\n reading = false\n }, 300);\n }\n\n if (e.keyCode !== 13) {\n let keyCode = e.code.includes('Digit') || e.code.includes('Key') ? e.code.replace('Digit', '').replace('Key', '') : e.key.replace(';', ':')\n let symbol = (e.key.toLowerCase() === keyCode.toLowerCase()) ? e.key : keyCode\n window.BarcodesScanner.tmpData += symbol\n }\n })\n}\n\nexport const onScannerNavigate = (barcodeData, deviceId, symbology, timestamp, dataLength) => {\n window.BarcodesScanner.barcodeData = barcodeData\n window.BarcodesScanner.deviceId = deviceId\n window.BarcodesScanner.symbology = symbology\n window.BarcodesScanner.timestamp = timestamp\n window.BarcodesScanner.dataLength = dataLength\n $(window.BarcodesScanner).trigger('scan')\n}\n","import Swal from \"sweetalert2\";\nimport {i18n} from \"./i18n\";\nimport {showNotification} from \"./notifications\";\nimport * as Ladda from \"ladda\";\n\nexport const syncShopifyOrder = e => {\n e.preventDefault()\n Swal.fire({\n text: i18n.t('views.shopify.bulk_confirmation'),\n icon: \"warning\",\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn font-weight-bold btn-primary',\n cancelButtonClass: 'btn btn-grey',\n confirmButtonText: i18n.t('views.update_pricing.bulk_btn_yes'),\n cancelButtonText: i18n.t('views.update_pricing.bulk_btn_no')\n }).then((result) => {\n if (result.isConfirmed) {\n const url = e.currentTarget.dataset.url\n fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': document.head.querySelector('meta[name=\"csrf-token\"]').content\n }\n }).then((res) => {\n if (res.status === 200) {\n showNotification({message: i18n.t('successfully_updated')})\n Ladda.stopAll()\n setTimeout(function() { window.location.reload() }, 100)\n } else {\n res.json().then(response => {\n showNotification({message: response.message, type: 'danger'})\n Ladda.stopAll()\n })\n }\n })\n } else {\n Ladda.stopAll()\n }\n })\n}\n","import { i18n } from \"./i18n\";\nimport { matchStart } from \"./date\";\n\nexport const initSmsTemplatesSelect = (select, textarea) => {\n select.select2({\n dir: i18n.t('direction'),\n width: '100%',\n matcher: (params, data) => (matchStart(params, data))\n })\n\n select.on('select2:select', e => { textarea.val(e.params.data.element.dataset.body) })\n}\n","import { i18n } from \"../i18n\";\nimport {\n flyOnMapToCoordinates,\n initTaskPhotoModal,\n renderPickStatusAjax,\n renderSmallAjaxStatus,\n tooltipsTaskLink\n} from '../view'\nimport { handleTaskPickStatusModal, updateTaskPickStatus, updateTaskStatus } from '../../actions/tasks'\nimport { transformCoords } from '../leaflet'\nimport { ADDRESS_PRECISIONS, initVisitDriversSelect, initVisitPickUpAtDatepicker } from '../visits/common'\nimport { isRTL } from \"../locale\";\nimport { formattedDate, getDateFormat, getFormattedDate } from \"../date\";\nimport { checkedSet, updatePrintLabelsForSelected } from \"../../tasks\";\nimport { updateFloatingActionsVisibility } from \"../floating-actions\";\nimport { defaultTranslations, search } from \"../datatables\";\nimport { checkedCount, dataOrNA, initEscButtonEvent, isEmpty, selectedIds } from \"../utils\";\nimport { taskOffcanvas } from \"../metronic/task_offcanvas\";\nimport { initTaskPanelView } from \"../panel_view\";\nimport { initCustomColvis } from \"../tables/colvis\";\nimport { initTooltips, taskSmsTooltip } from \"../tooltips\";\nimport moment from \"moment\";\nimport { visitsTransferStatus } from \"../drivers/confirmations\";\n\nexport const renderStoreVisitsTable = (visitProxyObjects, mapObj = null) => {\n let mapPolygons = []\n let renderedVisits = []\n\n $(document).on('addedPolygon', (_e, polygon) => {\n mapPolygons.push(polygon)\n })\n\n if (gon.full_visits) {\n visitProxyObjects.clear()\n gon.full_visits.forEach(v => {\n visitProxyObjects.set(v.visit_id, { checked: false })\n })\n }\n\n const selector = '#operator-store-visits-table'\n\n const extraToColumns = (customFields) => (\n customFields.map((field) => ({\n title: field.name,\n name: field.name.replace(/['\"`()[\\] ]/g, ''),\n data: 'task.extra',\n defaultContent: '',\n render: {\n '_': (_data, _type, row) => (row.task.extra ? row.task.extra[field.name] : ''),\n 'sort': (_data, _type, row) => {\n if (field.field_type === 'time') {\n return (row.task.extra ? moment(row.task.extra[field.name], ['h:m a', 'H:m']).format(\"X\") : '')\n } else {\n return (row.task.extra ? row.task.extra[field.name] : '')\n }\n }\n }\n }))\n )\n\n const operatorStoreVisitsTable = $(`${selector}`).DataTable({\n drawCallback: () => {\n const onTaskStatusUpdate = (data) => { updateRowDataByTask(data.task_id, { status_name: i18n.t(`models.task.status_enum.${data.new_status}`) }, { status: data.new_status }) }\n const onDriverUpdate = (data) => { updateRowData(data.visit_id, { driver_id: data.new_driver, marker_color: data.new_marker_color }) }\n const onPickupAtUpdate = (data) => { updateRowData(data.visit_id, { visit_at: data.new_visit_date }) }\n\n setTimeout(() => $('.visit-drivers-select2:not([data-select2-id^=\"select2\"])').each((_i, d) => initVisitDriversSelect(d, onDriverUpdate)), 50);\n\n $('.input-group.allow-past').datepicker({\n format: getDateFormat(),\n language: i18n.t('locale'),\n rtl: isRTL(),\n orientation: 'bottom',\n defaultDate: getFormattedDate(),\n autoclose: true,\n todayHighlight: true,\n }).on('hide', e => e.stopPropagation())\n initVisitPickUpAtDatepicker($('.visit-pickup-date'), onPickupAtUpdate)\n syncCheckedVisits(visitProxyObjects)\n $('.visits-bulk-actions-btn').prop('disabled', checkedCount(visitProxyObjects) === 0)\n\n $('[data-toggle=\"tooltip\"]').tooltip()\n if ($('.selected-counter').length === 0) {\n $(`${selector}_filter`).parent().prev().append(`

0 ${i18n.t('items_selected')}

`)\n }\n $('.bulk-visit-checkbox').off('click').on('click', (e) => {\n const id = e.target.getAttribute('visit-id')\n visitProxyObjects.set(parseInt(id), { checked: e.target.checked })\n $(document).trigger('selectedUpdated')\n $(e.currentTarget).parents('tr').css('background-color', e.target.checked ? 'aliceblue' : '')\n })\n\n $('.task-set-status').off('click').on('click', (e) => {\n const taskId = e.currentTarget.dataset.taskId\n const status = e.currentTarget.dataset.newStatus\n updateTaskStatus(taskId, status, onTaskStatusUpdate)\n })\n\n $('.task-set-pick-status').off('click').on('click', (e) => {\n const { taskId, newStatus, packagesQuantity } = e.currentTarget.dataset\n if (newStatus === 'PICKED') {\n handleTaskPickStatusModal(taskId, newStatus, packagesQuantity ? packagesQuantity : 1)\n } else {\n updateTaskPickStatus(taskId, newStatus)\n }\n })\n\n initTaskPhotoModal();\n initTaskPanelView($('.task-panel-view-open'), {\n onOpen: (e) => {\n const row = $(e.currentTarget).parents('tr')\n row.addClass('task-row-active')\n },\n onTaskStatusUpdate: onTaskStatusUpdate,\n onDriverUpdate: onDriverUpdate,\n onPickupAtUpdate: onPickupAtUpdate\n })\n initTooltips($('.task-sms-tooltip').not('.tooltipstered'), '/tasks/:id/sms_logs', 800, taskSmsTooltip)\n if (mapObj) {\n $('.show-on-map').off('click').on('click', e => {\n e.preventDefault()\n flyOnMapToCoordinates(gon.full_visits.filter(v => (v.visit_id == e.currentTarget.dataset.id))[0], mapObj)\n })\n }\n },\n createdRow: (row, data) => { $(row).attr('id', `visit-row-${data.visit_id}`).attr('data-task-id', data.task.id) },\n initComplete: (settings) => {\n const table = new $.fn.dataTable.Api(settings)\n $(table.column(columnIndexByName(table, 'space_column')).header()).addClass('space-column')\n table.draw()\n setTimeout(() => { window.dispatchEvent(new Event('resize')) }, 100)\n },\n dom: 'irt<\"pagination-left\"p>',\n stateSave: true,\n colReorder: { fixedColumnsLeft: 1 },\n stateSaveParams: (settings, data) => {\n data.columns.forEach(column => { delete column.search })\n delete data.search\n delete data.length\n delete data.start\n },\n stateDuration: 0,\n searchHighlight: true,\n lengthChange: false,\n pageLength: gon.pagination_size,\n data: gon.full_visits,\n deferRender: true,\n language: defaultTranslations(),\n infoCallback: (setting, start, end, max, total, pre) => ((start === 1 && end === max) ? '' : pre),\n order: [[2, 'asc']],\n columns: [\n {\n name: 'checkbox',\n orderable: false,\n className: 'noVis',\n title: gon.full_visits.length > 0 ? `` : '',\n width: '25px',\n render: (data, type, row) => {\n return ``\n }\n },\n {\n name: 'validation',\n orderable: false,\n className: 'noVis pt-2',\n data: 'task.validation_status',\n defaultContent: '',\n render: (status, type) =>{\n if (type === 'sort' || type === 'filter') {\n return status ? i18n.t(`models.task.validation_status_enum.${status}`) : i18n.t('shared.no_data')\n } else {\n if (!status) return\n\n return (`\n \n ${ status === \"ACCEPTED\" ? (`\n \n `) : ''}\n ${ status === \"REJECTED\" ? (`\n \n `) : ''}\n ${ status === \"RESCHEDULED\" ? (`\n \n `) : ''}\n ${ status === \"GEO_CHANGED\" ? (`\n \n `) : ''}\n \n `)\n }\n }\n },\n {\n name: 'task_id',\n title: i18n.t('models.task.task'),\n className: 'noVis',\n render: (_data, type, row) => {\n if (type === 'display') {\n return tooltipsTaskLink(row.task.id, row.task.is_photo_attached, row.task.signature_url,\n row.printed_at, row.task.comments, (row.lat && row.lon) && row.visit_id, row.visit_id, row.task.vip_client)\n } else {\n return row.task.id\n }\n }\n },\n {\n name: 'wp_order_id',\n title: i18n.t('models.task.wp_order_id'),\n data: 'task.wp_order_id',\n defaultContent: ''\n },\n {\n name: 'created_at',\n title: i18n.t('models.task.created_at'),\n visible: false,\n width: '90px',\n render: (data, type, row) => {\n return type === 'sort' ? row.created_at_epoch : row.created_at\n }\n },\n {\n name: 'location_name',\n visible: false,\n title: i18n.t('models.location.location_name'),\n data: 'location_name',\n defaultContent: ''\n },\n {\n name: 'time_window',\n title: i18n.t(\"drivers.daily_route_plan.time_window\"),\n className: gon.allow_time_window ? '' : 'noVis d-none',\n defaultContent: '',\n render: (_data, _type, row) => (\n (row.earliest_time || row.latest_time) ? `
${row.earliest_time || ''} - ${row.latest_time || ''}
` : ''\n ),\n createdCell: (td) => { $(td).css('direction', 'ltr') }\n },\n {\n name: 'eta_at',\n title: i18n.t('models.visit.eta_at'),\n searchable: false,\n orderable: false,\n data: 'eta_at_formatted',\n defaultContent: '',\n render: (data) => (dataOrNA(data))\n },\n {\n name: 'city',\n title: i18n.t('models.location.city'),\n data: 'city',\n defaultContent: ''\n },\n {\n name: 'address',\n title: i18n.t('models.location.address'),\n defaultContent: '',\n render: (_data, _type, row) => {\n const address = dataOrNA(row.add_no_city)\n if (address.length > 24) {\n return `${address.slice(0, 24)}...`\n }\n return address\n },\n createdCell: (td, cellData, rowData) => {\n const color = ADDRESS_PRECISIONS[rowData.precision_status]?.color\n if (color) $(td).css('background-color', color)\n }\n },\n {\n name: 'zip_code',\n title: i18n.t('models.visit.zip_code'),\n data: 'zip_code',\n defaultContent: '',\n className: gon.allow_zip_code ? '' : 'noVis d-none'\n },\n {\n name: 'recipient_name',\n title: i18n.t('models.location.contact_name'),\n data: 'recipient_name',\n defaultContent: '',\n },\n {\n name: 'destination_phone',\n visible: false,\n title: i18n.t('models.task.destination_phone'),\n data: 'task.destination_phone',\n defaultContent: ''\n },\n {\n name: 'status',\n searchable: true,\n title: i18n.t('models.task.status'),\n render: (data, type, row) => {\n const { task } = row\n if (type === 'filter' || type === 'sort') {\n return i18n.t(`models.task.status_enum.${task.status}`)\n }\n\n if (task.invoice_id) {\n const statusClass = task.status.replace('_', '-').toLowerCase();\n const statusName = i18n.t(`models.task.status_enum.${task.status}`);\n\n return `\n ${statusName}\n `\n }\n\n return renderSmallAjaxStatus(task.status, task.id, task.refund_present, gon.allow_inventory)\n }\n },\n {\n name: 'pick_status',\n title: i18n.t('models.task.pick_status'),\n data: 'task.pick_status',\n defaultContent: '',\n render: (pickStatus, type, row) => {\n if (!gon.allow_picking) return;\n if (type === 'filter' || type === 'sort') { return i18n.t(`models.task.pick_status_enum.${pickStatus}`) }\n return renderPickStatusAjax(row.task.id, pickStatus, row.task.packages_quantity ? row.task.packages_quantity : 1)\n },\n className: gon.allow_picking ? '' : 'noVis d-none'\n },\n {\n name: 'visit_at',\n title: i18n.t('date_str'),\n searchable: false,\n render: (data, type, row) => {\n const { visit_id: visitId, visit_at: visitAt, visit_at_epoch: visitAtEpoch, route } = row\n return type === 'sort'\n ? visitAtEpoch\n : `
\n \n
\n \n \n \n
\n
`\n }\n },\n {\n name: 'driver',\n searchable: true,\n title: i18n.t('models.driver.driver'),\n type: 'string',\n render: (data, type, row) => {\n if (type === 'filter' || type === 'sort') {\n return row.driver_name || row.task.ext_service_name\n }\n return `\n
\n
\n \n \n
\n ${row.driver_id ? `\n \n \n ` : ''}\n
\n `\n }\n },\n {\n name: 'route',\n title: i18n.t('models.route.route'),\n className: gon.allow_routes ? '' : 'noVis d-none',\n render: (data, type, row) => {\n if (isEmpty(row.route)) {\n return ''\n } else {\n return `${row.route.name}`\n }\n },\n },\n {\n name: 'urgency',\n data: 'task.urgency',\n visible: false,\n searchable: true,\n title: i18n.t('models.task.urgency'),\n className: gon.allow_urgency ? '' : 'noVis d-none',\n defaultContent: 'REGULAR',\n render: (urgency) => (i18n.t(`models.task.urgency_enum.${urgency}`)),\n createdCell: (td, _cellData, row) => $(td).css('background-color', row.urgency_color)\n },\n {\n name: 'region',\n title: i18n.t('models.region.region'),\n data: 'region_str',\n defaultContent: ''\n },\n {\n name: 'notes',\n searchable: false,\n title: i18n.t('models.task.notes'),\n render: (data, type, row) => {\n const { visit_notes: visitNotes, notes_html: taskNotes } = row\n let notesSummary = ''\n if (taskNotes) {\n notesSummary = notesSummary + '
' + taskNotes\n }\n\n if (visitNotes) {\n notesSummary = notesSummary + '
' + visitNotes\n }\n\n if (notesSummary) {\n notesSummary = notesSummary.replaceAll('\"', '"')\n return `` +\n '' +\n ''\n }\n return ''\n }\n },\n {\n name: 'failure_reasons',\n searchable: false,\n title: i18n.t('models.failure_reason.failure_reasons'),\n render: (data, type, row) => {\n if (row.task.failure_reason) {\n return `` +\n '' +\n ''\n }\n return ''\n }\n },\n {\n name: 'company',\n searchable: true,\n title: i18n.t('models.company.company'),\n data: 'company_name',\n defaultContent: '',\n className: gon.allow_companies ? '' : 'noVis d-none'\n },\n {\n name: 'agent',\n searchable: true,\n title: i18n.t('models.agent.agent'),\n data: 'task.agent',\n defaultContent: '',\n className: gon.allow_agents ? '' : 'noVis d-none'\n },\n {\n name: 'visit_kind',\n searchable: true,\n title: i18n.t('models.visit.visit'),\n data: 'kind',\n defaultContent: '',\n render: (kind) => (i18n.t(`models.visit.kind_enum.${kind}`)),\n className: gon.support_destinations_only ? 'noVis d-none' : ''\n },\n {\n name: 'delivery_method',\n searchable: true,\n title: i18n.t('models.task.delivery_method'),\n data: 'task.delivery_method',\n defaultContent: '',\n className: (gon.is_shopify || gon.is_wix) ? '' : 'noVis d-none'\n },\n {\n name: 'loaded',\n title: i18n.t('models.visit.loaded_at'),\n data: 'loaded',\n defaultContent: '',\n className: gon.allow_loading ? '' : 'noVis d-none',\n render: (data, type, row) => {\n if (type === 'filter' || type === 'sort') {\n return row.loaded ? i18n.t('yes_str') : i18n.t('no_str')\n }\n return row.loaded_at\n }\n },\n {\n name: 'self_pickup',\n title: i18n.t('models.task.is_self_pickup'),\n data: 'task.is_self_pickup',\n defaultContent: '',\n className: gon.allow_self_pickup ? '' : 'noVis d-none',\n render: (data) => (data ? i18n.t('yes_str') : i18n.t('no_str'))\n },\n {\n visible: false,\n name: 'leave_next_to_door',\n title: i18n.t('models.task.leave_next_to_door'),\n data: 'task.leave_next_to_door',\n defaultContent: '',\n className: gon.allow_leave_next_to_door ? '' : 'noVis d-none',\n render: (data) => (data ? i18n.t('yes_str') : i18n.t('no_str'))\n },\n {\n visible: false,\n name: 'price',\n title: i18n.t('models.task.price'),\n data: 'task_price',\n defaultContent: ''\n },\n {\n visible: false,\n name: 'payment_method',\n title: i18n.t('models.task.payment_method'),\n data: 'task.payment_method',\n defaultContent: ''\n },\n {\n visible: false,\n name: 'order_total',\n title: i18n.t('models.task.order_total'),\n data: 'task.order_total',\n defaultContent: ''\n },\n {\n name: 'money_collect',\n title: i18n.t('models.task.money_collect'),\n data: 'money_collect',\n defaultContent: '',\n className: gon.allow_money_collect ? '' : 'noVis d-none'\n },\n {\n name: 'cod_type',\n visible: false,\n title: `${i18n.t('models.task.money_collect')} ${i18n.t('models.cod.kind')}`,\n data: 'cod_type',\n defaultContent: '',\n className: gon.allow_money_collect ? '' : 'noVis d-none',\n render: (type) => (type ? i18n.t(`models.cod.kind_enum.${type}`) : ''),\n },\n {\n name: 'task_rating',\n title: i18n.t('views.task_review.task_rating'),\n data: 'task.task_review.task_rating',\n defaultContent: '',\n className: gon.show_reviews ? '' : 'noVis d-none',\n render: {\n '_': (data) => data,\n 'display': (data) => data ? `` : ''\n }\n },\n {\n name: 'driver_rating',\n title: i18n.t('views.task_review.driver_rating'),\n data: 'task.task_review.driver_rating',\n defaultContent: '',\n className: gon.show_reviews ? '' : 'noVis d-none',\n render: {\n '_': (data) => data,\n 'display': (data) => data ? `` : ''\n }\n },\n {\n name: 'order_items_count',\n visible: false,\n title: i18n.t('operator.order_items.order_items_count'),\n data: 'order_items_count',\n defaultContent: '',\n className: gon.allow_order_items ? '' : 'noVis d-none'\n },\n {\n name: 'orders_count',\n visible: false,\n title: i18n.t('models.order.orders_count'),\n data: 'orders_count',\n defaultContent: '',\n className: gon.allow_orders ? '' : 'noVis d-none'\n },\n {\n name: 'order_codes',\n title: i18n.t('models.order.orders'),\n className: gon.allow_orders ? '' : 'noVis d-none',\n defaultContent: '',\n render: (_data, _type, row) => {\n let orderCodes = row.order_codes;\n\n if (row.orders_count > 5) {\n var truncatedOrderCodes = orderCodes.split(',').slice(0, 5);\n\n return ``\n + truncatedOrderCodes + ' ...' +\n ''\n }\n\n return orderCodes;\n }\n },\n {\n name: 'gifter_name',\n visible: false,\n title: i18n.t(\"views.sms.dv_gifter_name\"),\n data: 'task.gifter_name',\n defaultContent: '',\n className: gon.allow_gifter ? '' : 'noVis d-none'\n },\n {\n name: 'greeting',\n visible: false,\n title: i18n.t(\"models.task.greeting\"),\n data: 'task.greeting',\n defaultContent: '',\n className: gon.allow_gifter ? '' : 'noVis d-none'\n },\n {\n name: 'weight',\n visible: false,\n title: i18n.t(\"models.task.weight\"),\n data: 'task.weight',\n defaultContent: '',\n className: gon.allow_weight ? '' : 'noVis d-none'\n },\n {\n name: 'surfaces_quantity',\n visible: false,\n title: i18n.t('models.task.surfaces_quantity'),\n data: 'task.surfaces_quantity',\n defaultContent: '',\n className: gon.allow_surfaces_quantity ? '' : 'noVis d-none'\n },\n {\n name: 'volume',\n title: i18n.t('models.order_item.volume'),\n data: 'task.volume',\n defaultContent: '',\n className: gon.allow_volume_constraint ? '' : 'noVis d-none'\n },\n {\n name: 'packages_quantity',\n visible: false,\n title: i18n.t(\"models.task.packages_quantity\"),\n data: 'task.packages_quantity',\n defaultContent: '',\n className: gon.allow_packages_quantity ? '' : 'noVis d-none'\n },\n {\n name: 'late_days',\n visible: false,\n title: i18n.t('operator.late_days'),\n data: 'late_days',\n defaultContent: '',\n render: (data) => data > 0 ? data : ''\n },\n {\n name: 'precision_status',\n visible: false,\n title: \"Address Precision\",\n data: 'precision_status',\n defaultContent: '',\n className: 'noVis d-none',\n render: (precisionStatus) => (ADDRESS_PRECISIONS[precisionStatus]?.name())\n },\n {\n name: 'origin_partner_task_id',\n visible: false,\n title: i18n.t(\"models.task.origin_partner_task_id_short\"),\n data: 'task.origin_partner_task_id',\n defaultContent: ''\n },\n {\n name: 'origin_partner_company',\n title: i18n.t('models.task.origin_partner_company'),\n data: 'task.origin_partner_company',\n defaultContent: '',\n className: gon.allow_origin_partner_company ? '' : 'noVis d-none'\n },\n {\n name: 'target_partner_task_id',\n visible: false,\n title: i18n.t(\"models.task.target_partner_task_id_short\"),\n data: 'task.target_partner_task_id',\n defaultContent: ''\n },\n {\n name: 'target_partner_task_status',\n visible: false,\n title: i18n.t('models.task.target_partner_task_status'),\n data: 'task.target_partner_task_status',\n defaultContent: ''\n },\n {\n name: 'is_photo_attached',\n title: i18n.t(\"operator.photo\"),\n data: 'task.is_photo_attached',\n defaultContent: '',\n render: (data, type, row) =>{\n if (type === 'filter') {\n return data ? i18n.t('yes_str') : i18n.t('no_str');\n } else {\n return data ?\n `\n \n \n \n `\n : '';\n }\n }\n },\n {\n name: 'signature_url',\n title: i18n.t(\"operator.signature\"),\n data: 'task.signature_url',\n defaultContent: '',\n render: (data, type, row) =>{\n if (type === 'filter') {\n return data ? i18n.t('yes_str') : i18n.t('no_str');\n } else {\n return data ?\n `\n \n \n \n `\n : '';\n }\n }\n },\n {\n name: 'sms',\n title: \"SMS\",\n data: 'task.sms_amount',\n defaultContent: '',\n render: {\n '_': (smsAmount) => smsAmount,\n 'filter': (smsAmount) => smsAmount ? i18n.t('yes_str') : i18n.t('no_str'),\n 'display': (smsAmount, _type, visit) => (smsAmount > 0 ? `\n \n ${smsAmount}\n \n ` : '')\n },\n className: gon.allow_sms ? '' : 'noVis d-none'\n },\n {\n name: 'task_type',\n visible: false,\n title: i18n.t(\"views.tasks.task_type\"),\n data: 'task.task_type',\n defaultContent: '',\n render: (type) => (type ? i18n.t(`views.tasks.types.${type}`) : ''),\n class: gon.allow_task_type ? '' : 'noVis d-none'\n },\n {\n name: 'vehicle_kind',\n visible: false,\n title: i18n.t('models.task.vehicle_kind'),\n data: 'task.vehicle_kind',\n defaultContent: '',\n render: (kind) => (kind ? i18n.t(`models.task.vehicle_kind_enum.${kind}`) : ''),\n className: gon.allow_vehicle_kind ? '' : 'noVis d-none'\n },\n {\n name: 'salary',\n title: i18n.t('models.visit.salary'),\n data: 'salary',\n defaultContent: '',\n className: gon.allow_driver_salary ? '' : 'noVis d-none'\n },\n {\n name: 'creation_origin',\n title: i18n.t('models.task.creation_origin'),\n data: 'task.creation_origin',\n visible: false\n },\n {\n name: 'printed_at',\n title: i18n.t('models.task.printed_at'),\n data: 'printed_at',\n defaultContent: '',\n visible: false,\n render: (printedAt) => printedAt ? i18n.t('yes_str') : i18n.t('no_str')\n },\n ...extraToColumns(gon.custom_fields),\n {\n name: 'space_column',\n orderable: false,\n className: 'noVis',\n defaultContent: ''\n }\n ],\n buttons: [\n {\n extend: 'colvis',\n columns: ':not(.noVis)'\n }\n ]\n })\n\n initCustomColvis(operatorStoreVisitsTable)\n\n const offcanvas = taskOffcanvas();\n initArrowFunction(offcanvas);\n\n offcanvas.on('afterHide', () => { $('tr.task-row-active').removeClass('task-row-active') })\n\n $('.table-search').on('input', search(operatorStoreVisitsTable))\n operatorStoreVisitsTable.on('search.dt', () => {\n updateRenderedVisits(operatorStoreVisitsTable)\n if (mapPolygons.length > 0) {\n $('#line-polygon').trigger('change')\n }\n $(document).trigger('storeVisitsWereUpdated', { visits: renderedVisits })\n\n const uniqueTasks = renderedVisits.map((visit) => visit.task).filter((task, index, self) => self.findIndex((t) => t.id === task.id) === index)\n\n const packages_summary = uniqueTasks.reduce((acc, task) => (acc += task.packages_quantity ?? 0), 0)\n const cartons_summary = uniqueTasks.reduce((acc, task) => (acc += task.cartons_quantity ?? 0), 0)\n const surfaces_summary = uniqueTasks.reduce((acc, task) => (acc += task.surfaces_quantity ?? 0), 0)\n\n const text_arr = [\n packages_summary > 0 ? `${i18n.t('drivers.daily_route_plan.quantity_packages_on_track')}: ${packages_summary}` : null,\n surfaces_summary > 0 ? `${i18n.t('drivers.daily_route_plan.number_surfaces_in_track')}: ${surfaces_summary}` : null,\n cartons_summary > 0 ? `${i18n.t('drivers.daily_route_plan.number_cartons_in_track')}: ${cartons_summary}` : null\n ].filter(i => i)\n\n $('.packages-summary').text(text_arr.join(' | '))\n })\n\n operatorStoreVisitsTable.on('column-reorder', () => { operatorStoreVisitsTable.draw() })\n\n const updateRenderedVisits = (table) => {\n renderedVisits = table.rows({ filter: 'applied' }).data().toArray()\n }\n\n $(document).on('selectedUpdated', () => {\n const selected = checkedCount(visitProxyObjects)\n const visitIds = [...visitProxyObjects.entries()].filter(([_, value]) => value.checked).map(([key]) => key);\n const visits = operatorStoreVisitsTable.rows().data().toArray()\n const selectedVisits = visits.filter((v) => visitIds.includes(v.visit_id))\n const uniqueTasks = selectedVisits.map((visit) => visit.task).filter((task, index, self) => self.findIndex((t) => t.id === task.id) === index)\n\n const totalSurfaces = uniqueTasks.reduce((acc, t) => (acc + parseFloat(t.surfaces_quantity || '0')), 0)\n const totalWeight = uniqueTasks.reduce((acc, t) => (acc + +parseFloat(t.weight ? t.weight.replaceAll(\",\", \"\") : '0').toFixed(2)), 0)\n const totalVolume = uniqueTasks.reduce((acc, t) => (acc + +parseFloat(t.volume ? t.volume.replaceAll(\",\", \"\") : '0').toFixed(2)), 0)\n\n $('.selected-visits-surfaces-container').toggleClass('d-none', totalSurfaces === 0).toggleClass('d-flex', totalSurfaces !== 0)\n $('.selected-visits-surfaces').html(totalSurfaces)\n\n $('.selected-visits-weight-container').toggleClass('d-none', totalWeight === 0).toggleClass('d-flex', totalWeight !== 0)\n $('.selected-visits-weight').html(totalWeight)\n\n $('.selected-visits-volume-container').toggleClass('d-none', totalVolume === 0).toggleClass('d-flex', totalVolume !== 0)\n $('.selected-visits-volume').html(totalVolume)\n\n updateFloatingActionsVisibility(selected)\n $('.visits-bulk-actions-btn').prop('disabled', selected === 0)\n })\n\n initEscButtonEvent('.unselect-all-visits');\n\n $('#line-polygon').change(event => {\n const polygon = event.currentTarget.value\n const positiveVisits = visitsInPolygon(operatorStoreVisitsTable.rows({ filter: 'applied' }).data(), polygon)\n $('#js_clear_polygons').removeClass('d-none')\n for (let i = 0; i < positiveVisits.length; i++) {\n const visitId = positiveVisits[i].visit_id\n const taskId = positiveVisits[i].task.id\n visitProxyObjects.set(parseInt(visitId), { checked: true })\n checkedSet.add(taskId.toString())\n const el = $('input[visit-id=' + visitId.toString() + ']')\n el.prop('checked', true)\n el.parents('tr').css('background-color', 'aliceblue')\n $('.visits-bulk-actions-btn').prop('disabled', false)\n }\n $(document).trigger('selectedUpdated')\n updatePrintLabelsForSelected()\n })\n\n $('#js_clear_polygons').click((event) => {\n $(event.target).addClass('d-none')\n mapPolygons.forEach(polygon => {\n const polygonVisits = visitsInPolygon(operatorStoreVisitsTable.rows({ filter: 'applied' }).data(), transformCoords(polygon.getLatLngs()))\n for (let i = 0; i < polygonVisits.length; i++) {\n const visitId = polygonVisits[i].visit_id\n const taskId = polygonVisits[i].task.id\n visitProxyObjects.set(parseInt(visitId), { checked: false })\n checkedSet.delete(taskId.toString())\n const el = $('input[visit-id=' + visitId.toString() + ']')\n el.prop('checked', false)\n el.parents('tr').css('background-color', '')\n }\n })\n mapPolygons.forEach(polygon => polygon.remove())\n mapPolygons = []\n $(document).trigger('selectedUpdated')\n })\n\n operatorStoreVisitsTable.on('draw', () => {\n const body = $(operatorStoreVisitsTable.table().body())\n\n body.unhighlight()\n body.highlight(operatorStoreVisitsTable.search())\n })\n\n $('.visits-bulk-actions-btn').on('click', async () => {\n const modal = $('#bulk-update-visits-modal')\n const allSelected = selectedIds(visitProxyObjects)\n $('.visit_ids').val(allSelected.join(','))\n $('.will-update').text(i18n.t('will_update', { count: allSelected.length }))\n const transferredResult = await visitsTransferStatus(allSelected)\n modal.find('.transferred-update-warning').toggleClass('d-none', !transferredResult.any_transferred)\n\n if (gon.allow_routes) {\n const hasRoute = gon.full_visits.find(v => (allSelected.includes(v.visit_id) && !isEmpty(v.route)))\n const dateInp = $('#task_task_date')\n dateInp.removeData('toggle')\n dateInp.removeAttr('title')\n if (hasRoute) {\n dateInp.data('toggle', 'tooltip').attr('title', i18n.t('operator.visits.cannot_set_date_msg'))\n dateInp.prop('disabled', true).val('')\n }\n }\n modal.modal('show')\n })\n\n $(document).on('click', '.bulk-send-sms-submit-btn', (e) => {\n e.preventDefault()\n $('.bulk_visit_ids').val(selectedIds(visitProxyObjects).join(','))\n $(e.target).closest('form').submit()\n $('#bulk-send-sms-to-route-modal').modal('hide')\n })\n $('.create-route-modal-btn').on('click', () => {\n const id = visitProxyObjects.entries().next().value[0]\n const visit = gon.full_visits.find(v => (v.visit_id === id))\n $('#route_date').val(visit.visit_at)\n $('.visit_ids').val(selectedIds(visitProxyObjects).join(','))\n })\n $('#plan-by-regions-form').on('submit', () => ($('.visit_ids').val(selectedIds(visitProxyObjects).join(','))))\n\n $('#select-all-visits').click((e) => {\n const $checkboxes = $('.bulk-visit-checkbox')\n $checkboxes.prop('checked', e.target.checked)\n\n const filteredRows = operatorStoreVisitsTable.rows({ filter: 'applied' }).data()\n filteredRows.each(visit => {\n visitProxyObjects.set(visit.visit_id, { checked: e.currentTarget.checked })\n e.currentTarget.checked ? checkedSet.add(visit.task.id.toString()) : checkedSet.delete(visit.task.id.toString())\n $(`${selector} tbody tr`).css('background-color', e.currentTarget.checked ? 'aliceblue' : '')\n })\n\n $(document).trigger('selectedUpdated')\n updatePrintLabelsForSelected()\n })\n\n $('.unselect-all-visits').click(() => {\n $('#select-all-visits').prop('checked', false)\n $('.bulk-visit-checkbox').prop('checked', false)\n gon.full_visits.forEach(visit => { visitProxyObjects.set(visit.visit_id, { checked: false }) })\n checkedSet.clear()\n $(`${selector} tbody tr`).css('background-color', '')\n $('#js_clear_polygons').addClass('d-none')\n mapPolygons.forEach(polygon => polygon.remove())\n mapPolygons = []\n $(document).trigger('selectedUpdated')\n updatePrintLabelsForSelected()\n })\n\n const updateRowData = (visitId, newData) => {\n const row = operatorStoreVisitsTable.row(`#visit-row-${visitId}`)\n row.data({ ...row.data(), ...newData }).draw(false)\n $(\".select2-container--open\").remove()\n }\n\n const updateRowDataByTask = (taskId, visitData, taskData = {}) => {\n operatorStoreVisitsTable.rows(`[data-task-id='${taskId}']`).every((rowId) => {\n const row = operatorStoreVisitsTable.row(rowId)\n row.data({ ...row.data(), ...visitData, task: { ...row.data().task, ...taskData } }).draw(false)\n })\n $(\".select2-container--open\").remove()\n }\n\n // lasso events\n if (mapObj) {\n mapObj.on(\"lasso.finished\", (event) => {\n const lassoPolygon = L.polygon(event.latLngs, { color: \"red\" })\n $(document).trigger('addedPolygon', lassoPolygon)\n lassoPolygon.addTo(mapObj);\n let lassoVisits = visitsInLassoPolygon(operatorStoreVisitsTable.rows({ filter: 'applied' }).data(), event.latLngs);\n\n lassoVisits.each((visit) => {\n const visitId = visit.visit_id;\n const taskId = visit.task.id;\n visitProxyObjects.set(parseInt(visitId), { checked: true });\n checkedSet.add(taskId.toString());\n const el = $('input[visit-id=' + visitId.toString() + ']');\n el.prop('checked', true);\n el.parents('tr').css('background-color', 'aliceblue');\n $('.visits-bulk-actions-btn').prop('disabled', false);\n })\n\n $(document).trigger('selectedUpdated');\n updatePrintLabelsForSelected();\n $('#js_clear_polygons').removeClass('d-none')\n });\n }\n\n return operatorStoreVisitsTable\n}\n\nexport const visitsInPolygon = (visits, geojson) => {\n const polygon = []\n const split_geojson = geojson.split(';')\n for (let i = 0; i < split_geojson.length; i++) {\n const split_point = split_geojson[i].split(',')\n polygon.push([parseFloat(split_point[0]), parseFloat(split_point[1])])\n }\n\n return visits.map(v => {\n if (inside([v.lat, v.lon], polygon)) {\n return v\n }\n }).filter(e => (e !== undefined))\n}\n\nexport function inside (point, vs) {\n // ray-casting algorithm based on\n // http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html\n\n const x = point[0]; const y = point[1]\n\n let inside = false\n for (let i = 0, j = vs.length - 1; i < vs.length; j = i++) {\n const xi = vs[i][0]; const yi = vs[i][1]\n const xj = vs[j][0]; const yj = vs[j][1]\n\n const intersect = ((yi > y) !== (yj > y)) &&\n (x < (xj - xi) * (y - yi) / (yj - yi) + xi)\n if (intersect) inside = !inside\n }\n\n return inside\n}\n\nfunction syncCheckedVisits (proxyObjects) {\n const pageCheckboxes = $('.bulk-visit-checkbox')\n for (let i = 0; i < pageCheckboxes.length; i++) {\n const visitId = pageCheckboxes[i].getAttribute('visit-id')\n const val = proxyObjects.get(parseInt(visitId))\n if (val !== undefined) {\n pageCheckboxes[i].checked = val.checked\n $(pageCheckboxes[i]).parents('tr').css('background-color', val.checked ? 'aliceblue' : '')\n }\n }\n}\n\nexport const initArrowFunction = (offcanvas) => {\n $(document).off('keydown.arrow-function').on('keydown.arrow-function', (e) => {\n if (!offcanvas.isShown()) return\n if (!$('.data-preloader').hasClass('d-none')) return\n\n switch (e.key) {\n case 'ArrowUp': {\n e.preventDefault()\n const activeRow = $('tr.task-row-active')\n const prevRow = activeRow.prev('tr')\n if (prevRow.length === 0) return\n\n prevRow.find('.task-panel-view-open')[0]?.click()\n prevRow.addClass('task-row-active')\n activeRow.removeClass('task-row-active')\n break;\n }\n case 'ArrowDown': {\n e.preventDefault()\n const activeRow = $('tr.task-row-active')\n const nextRow = activeRow.next('tr')\n if (nextRow.length === 0) return\n\n nextRow.find('.task-panel-view-open')[0]?.click()\n nextRow.addClass('task-row-active')\n activeRow.removeClass('task-row-active')\n break;\n }\n case 'Escape': {\n offcanvas.hide()\n break;\n }\n }\n })\n}\n\nexport const columnIndexByName = (table, name) => table.column(`${name}:name`).index()\n\nconst visitsInLassoPolygon = (visits, latLngs) => {\n const polygon = []\n latLngs.forEach((latlng) => {\n if (latlng.lat && latlng.lng) {\n polygon.push([parseFloat(latlng.lat), parseFloat(latlng.lng)]);\n }\n });\n\n return visits.map(v => { if (inside([v.lat, v.lon], polygon)) { return v; } }).filter(e => (e !== undefined));\n}\n","import { fetchJSON } from './utils';\nimport { i18n } from './i18n';\nimport Swal from 'sweetalert2/dist/sweetalert2'\nimport * as Ladda from 'ladda';\n\nexport const deleteSweetAlert = (apiUrl, redirectUrl, titleTxt, confirmBtnTxt, alertTxt) => {\n Swal.fire({\n title: titleTxt,\n icon: 'warning',\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn btn-danger',\n confirmButtonText: ` ${confirmBtnTxt}`,\n cancelButtonText: i18n.t('cancel'),\n cancelButtonClass: 'btn btn-grey'\n }).then(async (result) => {\n if (result.isConfirmed) {\n const [response] = await Promise.all([fetchJSON(apiUrl, 'DELETE', {})]);\n Swal.fire(\n alertTxt,\n response.message,\n 'success'\n ).then(() => {\n window.location.href = redirectUrl\n })\n } else {\n Ladda.stopAll();\n }\n })\n}\n\nexport const showSweetAlertMessage = (title, htmlText, icon) => {\n Swal.fire({\n title: `

${title}

`,\n html: htmlText,\n icon: icon,\n width: 500,\n heightAuto: false,\n padding: '2.5rem',\n buttonsStyling: false,\n stopKeydownPropagation: false,\n confirmButtonClass: 'btn btn-primary px-6',\n confirmButtonColor: null,\n })\n}\n","export const initTableCheckboxes = (\n checkboxesSelector,\n selectAllCheckboxSelector,\n unselectAllBtnSelector,\n allIds = [],\n onStateUpdate = () => {},\n onCheckboxUpdate = () => {}\n) => {\n const checkboxStates = new Map()\n let filteredIds = null // For server side processing\n let table = null\n\n allIds.forEach((id) => { checkboxStates.set(parseInt(id), { checked: false }) })\n\n const checkboxes = () => {\n const rows = table.rows().nodes().toArray()\n return $(rows.map((row) => row.querySelector(`${checkboxesSelector}:not(:disabled)`)).filter(el => el))\n }\n const filteredCheckboxes = () => {\n const rows = table.rows({ search: 'applied' }).nodes().toArray()\n return $(rows.map((row) => row.querySelector(`${checkboxesSelector}:not(:disabled)`)).filter(el => el))\n }\n const currentPageCheckboxes = () => {\n const rows = table.rows({ page: 'current' }).nodes().toArray()\n return $(rows.map((row) => row.querySelector(`${checkboxesSelector}:not(:disabled)`)).filter(el => el))\n }\n const selectAllCheckbox = () => $(selectAllCheckboxSelector)\n const unselectAllBtn = () => $(unselectAllBtnSelector)\n\n const onUpdate = () => {\n onStateUpdate({ checkboxStates: checkboxStates, table: table, selectedCountFn: selectedCount, selectedIdsFn: selectedIds })\n }\n\n const initCheckboxes = () => {\n if (!table) return\n\n checkboxes().off('click.checkbox').on('click.checkbox', (e) => {\n const targetId = parseInt(e.currentTarget.dataset.targetId)\n checkboxStates.set(targetId, { checked: e.currentTarget.checked })\n\n onUpdate()\n onCheckboxUpdate(e.currentTarget, e.currentTarget.checked)\n syncSelectAllCheckbox()\n })\n }\n\n const initSelectAllCheckbox = () => {\n if (!table) return\n\n selectAllCheckbox().off(`click.checkbox-${tableId()}`).on(`click.checkbox-${tableId()}`, (e) => {\n filteredCheckboxes().each((_i, el) => {\n $(el).prop('checked', e.currentTarget.checked)\n const targetId = parseInt(el.dataset.targetId)\n checkboxStates.set(targetId, { checked: e.currentTarget.checked })\n })\n\n // For server side processing when we don't have all the rows in the table\n if (Array.isArray(filteredIds)) {\n filteredIds.forEach((id) => { checkboxStates.set(id, { checked: e.currentTarget.checked }) })\n }\n\n onUpdate()\n currentPageCheckboxes().each((_i, el) => { onCheckboxUpdate(el, e.currentTarget.checked) })\n })\n }\n\n const initUnselectAllBtn = () => {\n if (!table) return\n\n unselectAllBtn().off(`click.checkbox-${tableId()}`).on(`click.checkbox-${tableId()}`, () => { unselectAll() })\n }\n\n const initTable = (_table) => {\n table = _table\n }\n\n const tableId = () => (table ? table.table().node().id : '')\n\n const syncCheckboxes = () => {\n if (!table) return\n\n currentPageCheckboxes().each((_i, el) => {\n const targetId = parseInt(el.dataset.targetId)\n const isChecked = checkboxStates.get(targetId)?.checked\n $(el).prop('checked', isChecked)\n onCheckboxUpdate(el, isChecked)\n })\n }\n\n const syncSelectAllCheckbox = () => {\n if (!table) return\n\n if (Array.isArray(filteredIds)) {\n selectAllCheckbox().prop('checked', filteredIds.length > 0 && !filteredIds.some((id) => !checkboxStates.get(id)?.checked))\n } else {\n const checkboxes = filteredCheckboxes()\n selectAllCheckbox().prop('checked', checkboxes.length > 0 && !checkboxes.map((_i, el) => el.checked).get().some((checked) => !checked))\n }\n }\n\n const setFilteredIds = (ids) => { filteredIds = ids }\n\n const selectedIds = () => (\n Array.from(checkboxStates.entries()).filter(([_, state]) => state.checked).map(([id, _]) => id)\n )\n\n const selectedCount = () => (\n Array.from(checkboxStates.values()).filter(state => state.checked).length\n )\n\n const unselectAll = () => {\n if (!table) return\n\n checkboxes().prop('checked', false)\n selectAllCheckbox().prop('checked', false)\n checkboxStates.forEach((value, key) => { checkboxStates.set(key, { checked: false }) })\n\n onUpdate()\n currentPageCheckboxes().each((_i, el) => { onCheckboxUpdate(el, false) })\n }\n\n return {\n checkboxStates: checkboxStates,\n initTable: initTable,\n initCheckboxes: initCheckboxes,\n initSelectAllCheckbox: initSelectAllCheckbox,\n initUnselectAllBtn: initUnselectAllBtn,\n syncCheckboxes: syncCheckboxes,\n syncSelectAllCheckbox: syncSelectAllCheckbox,\n setFilteredIds: setFilteredIds,\n selectedIds: selectedIds,\n selectedCount: selectedCount,\n unselectAll: unselectAll\n }\n}\n\nexport const tablePreInitCheckboxes = (checkboxesObj) => (\n (_e, settings) => { checkboxesObj.initTable(new $.fn.dataTable.Api(settings)) }\n)\n","export const initCustomColvis = (table, columnWidth = 190, colvisParent = \"\") => {\n const dropdownMenu = $('.colvis-custom-dropdown .dropdown-menu')\n var className = colvisParent ? `.${colvisParent} .colvis-custom-dropdown .colvis-custom-items` : '.colvis-custom-dropdown .colvis-custom-items';\n const colvisContainer = $(className);\n let columnsCount = 0\n\n table.columns().every((index) => {\n const column = table.column(index)\n const header = column.header()\n if (!header.classList.contains('noVis')) {\n columnsCount += 1\n colvisContainer.append(`\n
\n \n
\n `)\n }\n })\n\n const dropdownClass = colvisParent ? `.${colvisParent} .colvis-custom-dropdown` : '.colvis-custom-dropdown';\n $(dropdownClass).on('show.bs.dropdown', () => {\n const dropdownPaddingX = dropdownMenu.innerWidth() - dropdownMenu.width()\n const maxHeight = window.innerHeight * 0.4\n dropdownMenu.css({ display: 'block', visibility: 'hidden', minWidth: columnWidth + dropdownPaddingX }) // to correctly calculate item height\n const itemHeight = Math.ceil(colvisContainer.children().map((_i, el) => ($(el).outerHeight(true))).get().reduce((sum, h) => sum + h, 0) / columnsCount)\n dropdownMenu.removeAttr('style')\n\n const itemsPerColumn = maxHeight / itemHeight\n const contentWidth = Math.ceil(columnsCount / itemsPerColumn) * columnWidth\n dropdownMenu.css({ maxWidth: Math.min(contentWidth + dropdownPaddingX, window.innerWidth - 13), overflowX: 'auto' })\n colvisContainer.css({ maxHeight: maxHeight, minWidth: contentWidth })\n })\n\n $('.colvis-custom-toggle').on('change', (e) => {\n table.column(e.currentTarget.dataset.columnId).visible(e.currentTarget.checked)\n })\n}\n\nconst columnNameToIcon = (columnName) => {\n switch (columnName) {\n case 'task_id': return 'fa-light fa-cube'\n case 'wp_order_id': case 'origin_partner_task_id': case 'target_partner_task_id': case 'driver_note': return 'fa-light fa-memo'\n case 'created_at': case 'visit_at': case 'pickup_at': case 'completed_at': return 'fa-light fa-clock'\n case 'created_at_time': return 'fa-light fa-watch'\n case 'time_window': case 'wait_time': case 'start_time': return 'fa-light fa-calendar-clock'\n case 'eta_at': return 'fa-light fa-truck-clock'\n case 'city': return 'fa-light fa-city'\n case 'address': return 'fa-light fa-location-dot'\n case 'zip_code': return 'fa-light fa-mailbox'\n case 'recipient_name': return 'fa-light fa-address-book'\n case 'destination_phone': return 'fa-light fa-phone'\n case 'status': case 'target_partner_task_status': return 'fa-light fa-list'\n case 'pick_status': return 'fa-light fa-truck-ramp-box'\n case 'driver': return 'fa-light fa-user'\n case 'urgency': return 'fa-light fa-truck-fast'\n case 'region': return 'fa-light fa-map-location-dot'\n case 'notes': return 'fa-light fa-notes'\n case 'company': case 'origin_partner_company': return 'fa-light fa-bank'\n case 'self_pickup': return 'fa-light fa-hand-holding-box'\n case 'price': return 'fa-light fa-dollar'\n case 'payment_method': return 'fa-light fa-credit-card'\n case 'order_total': case 'salary': return 'fa-light fa-money-bills-simple'\n case 'money_collect': return 'fa-light fa-money-bill-transfer'\n case 'order_items_count': case 'packages_quantity': case 'surfaces_quantity': case 'returned_pallets': case 'cartons_quantity': return 'fa-light fa-boxes-stacked'\n case 'gifter_name': return 'fa-light fa-gift'\n case 'greeting': return 'fa-light fa-quote-left'\n case 'weight': return 'fa-light fa-weight-hanging'\n case 'late_days': return 'fa-light fa-alarm-exclamation'\n case 'is_photo_attached': return 'fa-light fa-image'\n case 'signature_url': return 'fa-light fa-signature'\n case 'sms': return 'fa-light fa-message-sms'\n case 'delivered_at': return 'fa-light fa-person-carry-box'\n case 'failed_at': return 'fa-light fa-triangle-exclamation'\n case 'task_rating': case 'driver_rating': return 'fa-light fa-star'\n case 'orders': return 'fa-light fa-cubes'\n case 'delivery_method': return 'fa-light fa-truck'\n case 'leave_next_to_door': return 'fa-light fa-door-open'\n case 'cod_type': return 'fa-light fa-money-check-dollar'\n case 'destination_name': return 'fa-light fa-map-pin'\n case 'vehicle_kind': return 'fa-light fa-truck'\n case 'location_name': return 'fa-light fa-house'\n case 'roundtrip': return 'fa-light fa-retweet'\n case 'worth_of_goods': return 'fa-light fa-money-check-dollar'\n case 'agent': return 'fa-light fa-user'\n default: return 'fa-light fa-gear'\n }\n}\n","export const initFilter = (inputs, table, column, onUpdate = () => {}, limited = true, searchOnLoad = false) => {\n const filterName = inputs.attr('name')\n const titleEl = $(`.filter-title[data-filter-name='${filterName}']`)[0] || inputs.parents('.filter-wrapper').find('.filter-title')[0]\n const title = $(titleEl).text().trim()\n $('.applied-filters-container').prepend(appliedFilterHtml(filterName))\n const appliedFilters = $(`[data-filter=${filterName}]`)\n const clearFilter = appliedFilters.find('.filter-clear')\n\n inputs.click(() => {\n filterSearch(table, inputs, appliedFilters, column, title, limited)\n setTimeout(onUpdate, 10)\n })\n clearFilter.click(() => {\n filterClear(table, inputs, appliedFilters, column, limited)\n onUpdate()\n })\n if (searchOnLoad) filterSearch(table, inputs, appliedFilters, column, title, limited)\n}\n\nexport const initServerFilter = inputs => {\n const filterName = inputs.attr('name')\n const title = inputs.parents('.filter-wrapper').find('span').text().trim()\n $('.applied-filters-container').prepend(appliedFilterHtml(filterName))\n const appliedFilters = $(`[data-filter=${filterName}]`)\n const clearFilter = appliedFilters.find('.filter-clear')\n\n inputs.click(() => {\n const allValues = inputs.filter(':checked').map((_i, input) => ($(input).next().next().text())).toArray()\n appliedFilters.find('span').text(`${title}: ${allValues.join(', ')}`)\n appliedFilters.toggleClass('d-none', !allValues.length)\n $('.applied-filters-wrapper').toggleClass('d-none', !$('.filter-applied').not('.d-none').length)\n })\n\n clearFilter.click(() => {\n appliedFilters.addClass('d-none')\n $('.applied-filters-wrapper').toggleClass('d-none', !$('.filter-applied').not('.d-none').length)\n inputs.prop('checked', false)\n })\n}\n\nexport const filterSearch = (table, inputs, appliedFilters, column, title, limited = true) => {\n setTimeout(() => {\n const checkedInputs = inputs.filter(':checked')\n const hasCheckedInputs = checkedInputs.length > 0\n const labels = []\n const values = []\n\n checkedInputs.each((_i, input) => {\n labels.push($(input).parent().find(\".filter-option-label\").text())\n values.push($.fn.dataTable.util.escapeRegex(input.value))\n })\n appliedFilters.find('span').text(`${title}: ${labels.join(', ')}`)\n appliedFilters.toggleClass('d-none', !hasCheckedInputs)\n $('.applied-filters-wrapper').toggleClass('d-none', !$('.filter-applied').not('.d-none').length)\n\n const searchRegex = values.length ? values.map(el => limited ? `^${el}$` : el).join('|') : ''\n table.column(column).search(searchRegex, true, false, true).draw()\n }, 0)\n}\n\nexport const filterClear = (table, inputs, appliedFilters, column) => {\n appliedFilters.addClass('d-none')\n $('.applied-filters-wrapper').toggleClass('d-none', !$('.filter-applied').not('.d-none').length)\n inputs.prop('checked', false)\n table.column(column).search('', true, false, true).draw()\n}\n\nconst appliedFilterHtml = (filterName) => (\n `\n
\n \n \n
\n `\n)\n\nexport const filterValues = inputs => (inputs.filter(':checked').toArray().map((ch) => (ch.value)))\n","import { i18n } from \"../i18n\";\nimport { partPrint } from '../view'\nimport { csrfToken } from \"../utils\";\nimport { defaultTranslations, search } from \"../datatables\";\nimport { updateTaskPickStatus, handleTaskPickStatusModal } from '../../actions/tasks';\n\nexport const renderOrderItemsTable = (async = false) => {\n const orderItemsTableContainer = document.getElementById('order-items-table')\n if (orderItemsTableContainer) {\n const orderItemsTable = $(orderItemsTableContainer).DataTable({\n dom: 't',\n paging: false,\n order: [[1, 'desc']],\n columns: [\n { data: 'transformed_name' },\n { data: 'quantity' }\n ],\n language: {\n zeroRecords: i18n.t('zero_records'),\n search: i18n.t('search'),\n infoEmpty: 'No records available',\n infoFiltered: '(filtered from _MAX_ total records)',\n paginate: {\n first: i18n.t('paginate.first'),\n last: i18n.t('paginate.last'),\n next: i18n.t('paginate.next'),\n previous: i18n.t('paginate.previous')\n }\n }\n })\n\n $('#print-order-items-summary').click(() => partPrint('order-items-summary-print-content'))\n $('#excel-order-items-summary-form').on('submit', () => {\n const taskIds = $('#order-items-table').data('taskIds')\n $('#order-items-task-ids').val(taskIds)\n })\n\n if (async) {\n initOrderItemsAsyncLoading()\n } else {\n if (gon.order_items?.length) updateOrderItemsTableData(orderItemsTable, gon.order_items)\n }\n\n return orderItemsTable\n }\n}\n\nexport const updateOrderItemsTableData = (table, items) => {\n if (!table) return\n\n const task_ids = [...new Set(items.map((i) => i.task_id))]\n const tableElement = $(table.table().container()).find('table')\n tableElement.data('taskIds', task_ids.join(','))\n\n const groupedOrderItems = new Map()\n items.forEach(el => {\n const key = el.transformed_name\n const collection = groupedOrderItems.get(key)\n if (!collection) {\n groupedOrderItems.set(key, { transformed_name: key, quantity: parseInt(el.quantity) });\n } else {\n collection.quantity += parseInt(el.quantity)\n }\n })\n\n table.clear()\n table.rows.add([...groupedOrderItems.values()]).draw()\n}\n\nexport const orderItemsSummaryModal = (e, taskIds = undefined, routeId = undefined) => {\n e.preventDefault();\n let payload = { task_ids: taskIds ? taskIds : gon.task_ids };\n let groupedItems = e.currentTarget.dataset.groupedItems == \"true\";\n let url = `/order_items/items${groupedItems ? '?grouped_items=true' : ''}`;\n if (routeId) payload['route_id'] = routeId;\n showOrderItemsSummaryModal(url, payload, !groupedItems);\n}\n\nexport const showOrderItemPickingModal = (e) => {\n const modalContainer = $('#modal-container');\n const loader = $('.data-preloader');\n const taskId = e.currentTarget.dataset.taskId;\n loader.removeClass('d-none');\n\n fetch(`/tasks/${taskId}/order_items_modal`, {\n method: 'GET',\n headers: {\n 'X-CSRF-TOKEN': csrfToken(),\n 'Content-Type': 'application/json',\n }\n }).then(res => res.text()).then(html => {\n modalContainer.html(html);\n const modal = modalContainer.children();\n initDataTableForOrderItems();\n initPartialPickButton();\n loader.addClass('d-none');\n modal.modal('show');\n $('.order-item-checked').off('click').on('click', (e) => checkOrderItems(e));\n $('.confirm-picked-order-item').on('click', (e) => updateOrderItemPickStatus(e));\n })\n}\n\nexport const showOrderItemsSummaryModal = (url, payload, initItemTable = false) => {\n const modalContainer = $('#modal-container');\n const loader = $('.data-preloader');\n\n loader.removeClass('d-none');\n fetch(url, {\n method: 'POST',\n headers: {\n 'X-CSRF-TOKEN': csrfToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(payload)\n }).then(res => res.text()).then(html => {\n modalContainer.html(html);\n const modal = modalContainer.children();\n if (initItemTable) { initOrderItemTable(); }\n loader.addClass('d-none');\n modal.modal('show');\n })\n}\n\nconst checkOrderItems = (e) => {\n e.preventDefault();\n const orderItemCheckbox = e.currentTarget;\n const orderItem = $(orderItemCheckbox).parents('.pick-order-item-row')[0];\n const dataset = orderItemCheckbox.dataset;\n const itemChecked = !(dataset.itemChecked == 'true');\n $(orderItemCheckbox).attr('data-item-checked', itemChecked);\n const itemQuantityInput = $(orderItem).find('.order-item-quantity-input');\n const maxOrderQuantity = parseInt($(itemQuantityInput).attr('max'));\n let itemQuantity = parseInt($(itemQuantityInput).val());\n\n if (itemChecked) {\n var bgColor = '';\n var checkColor = '';\n if (itemQuantity == 0 || itemQuantity == maxOrderQuantity) {\n $(itemQuantityInput).val(maxOrderQuantity).attr('disabled', true);\n bgColor = 'bg-success-picked';\n checkColor = 'item-check-picked';\n } else if (itemQuantity < maxOrderQuantity) {\n bgColor = 'bg-success-partially_picked';\n checkColor = 'item-check-partially_picked';\n }\n\n $(orderItem).addClass(bgColor);\n $(orderItemCheckbox).addClass(checkColor);\n } else {\n $(itemQuantityInput).val(0).attr('disabled', false);\n $(orderItem).removeClass('bg-success-picked bg-success-partially_picked');\n $(orderItemCheckbox).removeClass('item-check-picked item-check-partially_picked');\n }\n}\n\nconst updateOrderItemPickStatus = (e) => {\n e.preventDefault();\n const dataset = e.target.dataset;\n const loader = $('.data-preloader');\n let items = {};\n $('.order-item-quantity-input').each((_i, ib) => items[ib.dataset.itemId] = $(ib).val());\n loader.removeClass('d-none');\n\n fetch('/order_items/bulk_update', {\n method: 'POST',\n headers: {\n 'X-CSRF-TOKEN': csrfToken(),\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ order_item: { items: items }, task_id: dataset.taskId})\n }).then(res => res.json()).then(data => {\n if (data.error) {\n showNotification({ message: i18n.t('errors.something_wrong'), type: 'danger' });\n } else {\n loader.addClass('d-none');\n const newPickStatus = data.task_status;\n if (newPickStatus == \"PICKED\") {\n $(\"#pick-order-items-modal\").modal('hide');\n handleTaskPickStatusModal(dataset.taskId, newPickStatus, dataset.package);\n return;\n }\n\n const dropdown = $('.task-pick-status-dropdown-' + dataset.taskId);\n const pickStatusContainer = dropdown.find('.pick-status');\n const pickStatusText = dropdown.find('.pick-status-text');\n pickStatusContainer.removeClass((_index, className) => (className.match (/(^|\\s)pick-status-\\S+/g) || []).join(' '));\n pickStatusContainer.addClass('pick-status-' + newPickStatus.toLowerCase());\n pickStatusText.text(i18n.t('models.task.pick_status_enum.' + newPickStatus));\n $('#pick-order-items-modal').modal('hide');\n }\n })\n}\n\nconst initDataTableForOrderItems = () => {\n const table = $('.pick-order-item-table').DataTable({\n dom: 'itp',\n order: false,\n sort: false,\n searchHighlight: true,\n responsive: false,\n paging: false,\n language: defaultTranslations(),\n });\n $('.table-search').on('input', search(table));\n $('#pick-order-items-modal .dataTables_info').hide();\n}\n\nconst initPartialPickButton = () => {\n $('#pick-order-items-modal .pick-status-partially_picked').off('click').click((e) => {\n e.preventDefault();\n updateTaskPickStatus(e.currentTarget.dataset.taskId, 'PARTIALLY_PICKED');\n $(\"#pick-order-items-modal\").modal(\"hide\");\n })\n}\n\nconst initOrderItemTable = () => {\n const table = $('.order-item-table').DataTable({\n dom: 'itp',\n order: [[0, 'desc']],\n paging: false,\n bInfo: false,\n searchHighlight: true,\n responsive: true,\n language: defaultTranslations(),\n columnDefs: [{\n targets: 'unorderable',\n orderable: false\n }]\n });\n\n table.on('order.dt', () => {\n const currentOrder = table.order()[0];\n const columns = table.columns().names();\n\n $('#order-item-print-form #column').val(columns[currentOrder[0]]);\n $('#order-item-print-form #order').val(currentOrder[1]);\n });\n}\n\nconst initOrderItemsAsyncLoading = () => {\n $('.order-items-summary-async').on('click', () => {\n const tableElement = $('#order-items-table')\n let taskIds = tableElement.data('taskIds')?.split(',') || []\n let loadedTaskIds = tableElement.data('loadedTaskIds')?.split(',') || []\n if (JSON.stringify(loadedTaskIds) !== JSON.stringify(taskIds)) {\n updateOrderItemsAsync($('#order-items-table').DataTable(), taskIds, () => {\n $('#order-items-summary-modal').modal('show')\n })\n } else {\n $('#order-items-summary-modal').modal('show')\n }\n })\n}\n\nconst updateOrderItemsAsync = (table, taskIds, callback = () => {}) => {\n if (!table) return\n\n $('.data-preloader').removeClass('d-none')\n\n const tableElement = $(table.table().container()).find('table')\n\n fetch('/tasks/order_items_summary.json', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-Token': csrfToken()\n },\n body: JSON.stringify({ task_ids: taskIds.join(',') })\n }).then(res => res.json()).then(items => {\n table.clear()\n table.rows.add(items).draw()\n tableElement.data('loadedTaskIds', taskIds.join(','))\n callback(items)\n $('.data-preloader').addClass('d-none')\n })\n}\n","import { i18n } from \"../i18n\";\nimport { renderPickStatusAjax, renderSmallAjaxStatus, tooltipsTaskLink } from '../view'\nimport { handleTaskPickStatusModal, updateTaskPickStatus, updateTaskStatus } from '../../actions/tasks'\nimport { initTaskDriversSelect, initTaskPickUpAtDatepicker } from '../visits/common'\nimport { isRTL } from \"../locale\";\nimport { formattedDate, getDateFormat, getFormattedDate } from '../date'\nimport { defaultTranslations, search } from '../datatables'\nimport { updateFloatingActionsVisibility } from \"../floating-actions\";\nimport Swal from \"sweetalert2\";\nimport { taskOffcanvas } from \"../metronic/task_offcanvas\";\nimport { initArrowFunction } from \"../store_visits/table\";\nimport { checkedCount, initEscButtonEvent, selectedIds } from \"../utils\";\nimport { initTaskPanelView } from \"../panel_view\";\nimport { showNotification } from \"../notifications\";\nimport { initCustomColvis } from \"../tables/colvis\";\nimport { tasksTransferStatus } from \"../drivers/confirmations\";\nimport { filterValues, initServerFilter } from \"../tables/filters\";\nimport { initTableCheckboxes, tablePreInitCheckboxes } from \"../tables/checkboxes\";\n\nconst extraToColumns = (customFields) => (\n customFields.map(item => (\n {\n name: item.map_name,\n title: item.name,\n orderable: false,\n data: 'extra',\n defaultContent: '',\n render: (extra) => (extra ? extra[item.name] : '')\n }\n ))\n)\n\nconst initFilters = (table) => {\n initServerFilter($('input[name=filterStatus]'))\n initServerFilter($('input[name=filterDriver]'))\n initServerFilter($('input[name=filterRoute]'))\n initServerFilter($('input[name=filterCompany]'))\n initServerFilter($('input[name=filterUrgency]'))\n initServerFilter($('input[name=filterLabelPrint]'))\n initServerFilter($('input[name=filterRegion]'))\n initServerFilter($('input[name=filterOriginPartnerCompany]'))\n gon.custom_fields.forEach(field => initServerFilter($(`input[name=${field.map_name}]`)))\n\n $('#apply-filters').click(e => {\n e.preventDefault()\n let searchObj\n const searchArr = []\n const filterCompany = $('.company-filter')\n const filterDriver = $('.driver-filter')\n const filterRoute = $('.route-filter')\n const filterUrgency = $('.urgency-filter')\n const filterRegion = $('.region-filter')\n const filterLabelPrint = $('.label-print-filter')\n const filterOriginPartnerCompany = $('.origin-partner-company-filter')\n\n searchArr.push({name: 'status', data: filterValues($('.status-filter input'))})\n if (filterCompany.length > 0) {\n searchArr.push({name: 'company_name', data: filterValues($('.company-filter input'))})\n }\n if (filterDriver.length > 0) {\n searchArr.push({name: 'driver_id', data: filterValues($('.driver-filter input'))})\n }\n if (filterRoute.length > 0) {\n searchArr.push({name: 'route_id', data: filterValues($('.route-filter input'))})\n }\n if (filterUrgency.length > 0) {\n searchArr.push({name: 'urgency', data: filterValues($('.urgency-filter input'))})\n }\n if (filterRegion.length > 0) {\n searchArr.push({name: 'destination_region', data: filterValues($('.region-filter input'))})\n }\n if (filterLabelPrint.length > 0) {\n searchArr.push({name: 'printed_at', data: filterValues($('.label-print-filter input'))})\n }\n if (filterOriginPartnerCompany.length > 0) {\n searchArr.push({name: 'origin_partner_company', data: filterValues($('.origin-partner-company-filter input'))})\n }\n gon.custom_fields.forEach(field => {\n searchArr.push({name: field.map_name, data: filterValues($(`.${field.map_name} input`))})\n })\n searchArr.forEach(obj => searchObj = table.column(`${obj.name}:name`).search(obj.data.join()))\n searchObj && searchObj.draw()\n })\n}\n\nexport const renderTasksTable = (isCompanyTable) => {\n const checkboxesObj = initTableCheckboxes(\n '.task-checkbox',\n '.select-all-task-checkboxes',\n '.unselect-all-task-checkboxes',\n gon.task_ids,\n ({ checkboxStates, selectedCountFn }) => {\n const selectedCount = selectedCountFn()\n setTaskIDs(checkboxStates)\n updateFloatingActionsVisibility(selectedCount)\n $('.tasks-bulk-actions-btn, .print-labels-for-selected').prop('disabled', selectedCount === 0)\n },\n (el, isChecked) => {\n $(el).parents('tr').css('background-color', isChecked ? 'aliceblue' : '')\n }\n )\n\n checkboxesObj.setFilteredIds(gon.task_ids)\n\n const tasksTable = $('#tasks-table2').on('preInit.dt', tablePreInitCheckboxes(checkboxesObj)).DataTable({\n drawCallback: () => {\n $('.task-drivers-select2').each((i, d) => initTaskDriversSelect(d))\n $('.input-group.allow-past').datepicker({\n format: getDateFormat(),\n language: i18n.t('locale'),\n rtl: isRTL(),\n orientation: 'bottom',\n defaultDate: getFormattedDate(),\n autoclose: true,\n todayHighlight: true\n }).on('hide', e => e.stopPropagation())\n $('[data-toggle=\"tooltip\"]').tooltip();\n initTaskPickUpAtDatepicker($('.task-pickup-date'))\n $('.task-set-status').off('click').on('click', (e) => {\n const taskId = e.currentTarget.dataset.taskId\n const status = e.currentTarget.dataset.newStatus\n updateTaskStatus(taskId, status)\n })\n\n initTaskPanelView($('.task-panel-view-open'), {\n onOpen: (e) => {\n const row = $(e.currentTarget).parents('tr')\n row.addClass('task-row-active')\n }\n })\n\n checkboxesObj.initCheckboxes()\n checkboxesObj.syncCheckboxes()\n checkboxesObj.syncSelectAllCheckbox()\n\n $('.tasks-bulk-actions-btn').off('click').on('click', async () => {\n const modal = $('#bulk-update-tasks-modal')\n const allSelected = selectedIds(checkboxesObj.checkboxStates)\n $('#bulk_update_tasks_ids').val(allSelected.join(','))\n $('.will-update').text(i18n.t('will_update', { count: allSelected.length }))\n const transferredResult = await tasksTransferStatus(allSelected)\n modal.find('.transferred-update-warning').toggleClass('d-none', !transferredResult.any_transferred)\n modal.modal('show')\n })\n\n if(isCompanyTable) {\n $('.bulk-duplicate').off('click').on('click', () => {\n const allSelected = selectedIds(checkboxesObj.checkboxStates)\n $('.task_ids').val(allSelected.join(','));\n $('#pickup_at').val(getFormattedDate());\n $('#bulk-duplicate-modal').modal('show');\n\n $('#bulk_duplicate_form').on('submit', (e) => {\n e.preventDefault();\n\n Swal.fire({\n text: i18n.t('views.tasks.bulk_duplicate_confirmation'),\n icon: \"warning\",\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn font-weight-bold btn-primary',\n cancelButtonClass: 'btn btn-grey',\n confirmButtonText: i18n.t('yes_str'),\n cancelButtonText: i18n.t('cancel')\n }).then((result) => {\n if (result.value) {\n $('#bulk_duplicate_form').unbind('submit').submit();\n } else {\n $('#bulk_duplicate_form').find(':submit').prop(\"disabled\", false);\n }\n });\n });\n })\n } else {\n $('.task-set-pick-status').off('click').on('click', (e) => {\n const { taskId, newStatus, packagesQuantity } = e.currentTarget.dataset\n if (newStatus === 'PICKED') {\n handleTaskPickStatusModal(taskId, newStatus, packagesQuantity ? packagesQuantity : 1)\n } else {\n updateTaskPickStatus(taskId, newStatus)\n }\n })\n }\n\n $('[data-toggle=\"tooltip\"]').tooltip();\n },\n initComplete: settings => {\n $('#colvis').append($('.buttons-colvis'))\n $('.dt-buttons').remove()\n const table = new $.fn.dataTable.Api( settings )\n\n checkboxesObj.initSelectAllCheckbox()\n checkboxesObj.initUnselectAllBtn()\n\n if (gon.total_tasks > 0 && isCompanyTable) {\n $('.action-buttons').append(\n `\n \n ${i18n.t('print_all_labels')}\n \n `\n )\n }\n\n if (gon.status) {\n table.column('status:name').search(gon.status).draw()\n }\n\n const printLabelsForSelectedButton = $('.print-labels-for-selected')\n printLabelsForSelectedButton.click(e => {\n e.preventDefault()\n if (checkboxesObj.checkboxStates.size === 0) return false\n\n $('#labels-on-page-modal').modal('show')\n })\n\n $('.archive-tasks-bulk-btn').on('click', () => {\n const tasksCount = checkedCount(checkboxesObj.checkboxStates)\n $('.will-archived').text(i18n.t('move_all_to_recycle_bin', { count: tasksCount }))\n })\n\n table.draw()\n },\n bInfo: false,\n dom: '<\"d-none\"B><\"top\"i>rtp<\"bottom\"><\"clear\">',\n colReorder: { fixedColumnsLeft: 2 },\n stateSave: true,\n stateSaveParams: (settings, data) => {\n data.columns.forEach(column => { delete column.search })\n delete data.search\n delete data.length\n delete data.start\n },\n stateDuration: 0,\n processing: true,\n deferLoading: 0,\n serverSide: true,\n lengthChange: false,\n pageLength: gon.pagination_size,\n language: defaultTranslations(),\n ajax: {\n url: '/tasks/index_data',\n type: 'POST',\n data: d => {\n d.date = gon.date\n d.time_by = gon.time_by\n d.from = gon.from\n d.to = gon.to\n d.count = gon.total_tasks\n },\n error: (_xhr, _error, code) => {\n if (code === 'Unauthorized') {\n showNotification({ message: i18n.t('shared.access_denied') , type: 'danger' })\n window.location.reload()\n } else {\n showNotification({ message: i18n.t('shared.something_went_wrong'), type: 'danger' })\n }\n }\n },\n responsive: true,\n order: [[1, gon.time_interval === 'future' ? 'ASC' : 'DESC']],\n buttons: [\n {\n extend: 'colvis',\n columns: ':not(.noVis)'\n }\n ],\n columns: [\n {\n name: 'select-checkbox',\n orderable: false,\n className: 'noVis',\n title: ``,\n render: (data, type, row) => {\n return ``\n }\n },\n {\n name: 'id',\n title: i18n.t('models.task.task'),\n className: 'noVis',\n render: (_data, _type, row) => tooltipsTaskLink(row.task_id, row.is_photo_attached, row.signature, row.printed_at)\n },\n {\n name: 'pickup_at',\n title: gon.support_destinations_only ? i18n.t('models.task.delivery_date') : i18n.t('models.task.pickup_at'),\n width: '78px',\n data: 'pickup_at',\n render: (pickupAt, type, row) => {\n return gon.is_organization\n ? `
\n \n
\n \n \n \n \n
\n
`\n : formattedDate(pickupAt)\n }\n },\n {\n name: 'completed_at',\n title: i18n.t('models.visit.delivered_at'),\n width: '78px',\n data: 'completed_at',\n defaultContent: '',\n render: (_data, type, row) => {\n return type === 'sort' ? row.completed_at_epoch : row.completed_at;\n }\n },\n {\n name: 'company_name',\n className: gon.is_organization && gon.allow_companies ? '' : 'noVis d-none',\n title: i18n.t('task_company'),\n data: 'company'\n },\n {\n name: 'status',\n title: i18n.t('models.task.status'),\n data: 'status',\n render: (data, type, row) => {\n return gon.is_organization\n ? renderSmallAjaxStatus(row.status, row.task_id, row.refund_present, gon.allow_inventory)\n : `\n
\n ${row.status + row.status_name}\n \n ${row.status_name}\n \n
\n `\n }\n },\n {\n name: 'pick_status',\n title: i18n.t('models.task.pick_status'),\n visible: gon.is_organization && gon.allow_picking,\n className: gon.is_organization && gon.allow_picking ? '' : 'noVis d-none',\n data: 'pick_status',\n render: (data, type, row) => renderPickStatusAjax(row.task_id, row.pick_status, row.packages_quantity)\n },\n {\n name: 'eta_at',\n title: i18n.t('models.visit.eta_at'),\n searchable: false,\n orderable: false,\n data: 'eta_at_formatted',\n className: isCompanyTable && gon.show_eta ? '' : 'noVis d-none',\n defaultContent: ''\n },\n {\n name: 'urgency',\n title: i18n.t('models.task.urgency'),\n className: gon.allow_urgency ? '' : 'noVis d-none',\n data: 'urgency_name',\n createdCell: (td, cellData, rowData) => $(td).css('background-color', rowData.urgency_color),\n render: (_data, _type, row) => row.urgency_name\n },\n {\n name: 'is_roundtrip',\n title: i18n.t('models.task.is_roundtrip'),\n className: gon.allow_roundtrip ? '' : 'noVis d-none',\n data: 'is_roundtrip',\n render: (_data, _type, row) => row.is_roundtrip,\n createdCell: (td, cellData, rowData) => $(td).css('background-color', rowData.color_roundtrip)\n },\n {\n name: 'vehicle_kind',\n title: i18n.t('models.task.vehicle_kind'),\n data: 'vehicle_kind',\n className: gon.allow_vehicle_kind ? '' : 'noVis d-none',\n render: (_data, _type, row) => row.vehicle_kind,\n createdCell: (td, cellData, rowData) => $(td).css('background-color', rowData.td_vehicle_type_cls)\n },\n {\n name: 'money_collect',\n title: i18n.t('models.task.money_collect'),\n data: 'money_collect',\n className: gon.allow_money_collect ? '' : 'noVis d-none',\n render: (_data, _type, row) => row.money_collect\n },\n {\n name: 'driver_id',\n title: i18n.t('models.task.driver_id'),\n visible: (gon.is_organization === true),\n className: (gon.allow_routes || (isCompanyTable && !gon.allow_to_see_drivers)) ? 'noVis d-none' : '',\n data: 'driver_id',\n render: (data, type, row) => {\n if(!gon.is_organization && gon.allow_to_see_drivers) return row.driver_name;\n\n if(gon.is_organization) {\n return `\n `\n }\n\n return '';\n }\n },\n {\n name: 'route_id',\n title: i18n.t('models.route.route'),\n className: gon.is_organization && gon.allow_routes ? '' : 'noVis d-none',\n data: 'route',\n defaultContent: '',\n },\n {\n name: 'source',\n orderable: false,\n title: i18n.t('models.task.source_name'),\n searchable: false,\n class: gon.support_destinations_only ? 'noVis d-none' : '',\n data: 'source'\n },\n {\n name: 'destination',\n orderable: false,\n title: i18n.t('task_destination'),\n data: 'destination',\n width: '180px',\n },\n {\n name: 'destination_region',\n orderable: false,\n className: gon.is_organization ? '' : 'noVis d-none',\n title: i18n.t('models.region.region'),\n data: 'destination_region'\n },\n {\n name: 'destination_recipient_name',\n title: i18n.t('models.task.destination_recipient_name'),\n data: 'destination_recipient_name',\n width: '150px',\n },\n {\n name: 'notes',\n searchable: false,\n title: i18n.t('models.task.notes'),\n className: (gon.is_organization || gon.show_notes) ? '' : 'noVis d-none',\n render: (_data, _type, row) => {\n if (row.notes && row.notes.length > 0) {\n var notesSummary = `${i18n.t('models.task.notes')}:` + '
' + row.notes + '
';\n return `` +\n '' +\n '';\n }\n\n return '';\n }\n },\n {\n visible: false,\n name: 'driver_note',\n searchable: false,\n title: i18n.t('models.task.driver_note'),\n className: gon.is_organization ? '' : 'noVis d-none',\n render: (_data, _type, row) => {\n if (row.driver_notes && row.driver_notes.length > 0) {\n return `` +\n '' +\n '';\n }\n\n return '';\n }\n },\n {\n visible: false,\n name: 'price',\n title: i18n.t('models.task.price'),\n data: 'price',\n defaultContent: ''\n },\n {\n visible: false,\n name: 'fee_cost',\n title: i18n.t('models.task.fee_cost'),\n data: 'fee_cost',\n defaultContent: '',\n className: gon.allow_task_fee_cost ? '' : 'noVis d-none'\n },\n {\n visible: false,\n name: 'late_days',\n title: i18n.t('operator.late_days'),\n data: 'late_days',\n defaultContent: '',\n className: gon.is_organization ? '' : 'noVis d-none'\n },\n {\n name: 'created_at',\n title: i18n.t('models.task.created_at'),\n data: 'created_at'\n },\n {\n name: 'wp_order_id',\n title: i18n.t('models.task.wp_order_id'),\n data: 'wp_order_id'\n },\n {\n name: 'packages_quantity',\n title: i18n.t('models.task.packages_quantity'),\n data: 'packages_quantity',\n className: gon.allow_packages_quantity ? '' : 'noVis d-none'\n },\n {\n name: 'surfaces_quantity',\n title: i18n.t('models.task.surfaces_quantity'),\n data: 'surfaces_quantity',\n className: gon.allow_surfaces_quantity ? '' : 'noVis d-none'\n },\n {\n visible: false,\n name: 'returned_pallets',\n title: i18n.t('models.task.returned_pallets'),\n data: 'returned_pallets',\n className: gon.allow_returned_pallets ? '' : 'noVis d-none'\n },\n {\n name: 'task_rating',\n orderable: false,\n title: i18n.t('views.task_review.task_rating'),\n data: 'task_rating',\n className: gon.allow_reviews && gon.is_organization ? '' : 'noVis d-none',\n render: (data) => data ? `` : ''\n },\n {\n name: 'driver_rating',\n orderable: false,\n title: i18n.t('views.task_review.driver_rating'),\n data: 'driver_rating',\n className: gon.allow_reviews && gon.is_organization ? '' : 'noVis d-none',\n render: (data) => data ? `` : ''\n },\n {\n name: 'agent',\n title: i18n.t('models.agent.agent'),\n data: 'agent',\n className: gon.is_organization && gon.allow_agents ? '' : 'noVis d-none',\n },\n {\n name: 'failure_reason_id',\n title: i18n.t('models.failure_reason.failure_reasons'),\n data: 'failure_reason_id',\n className: gon.is_organization ? '' : 'noVis d-none',\n },\n {\n name: 'printed_at',\n title: i18n.t('models.task.task'),\n className: 'noVis d-none',\n data: 'printed_at'\n },\n {\n name: 'origin_partner_company',\n title: i18n.t('models.task.origin_partner_company'),\n data: 'origin_partner_company',\n className: gon.allow_origin_partner_company && gon.is_organization ? '' : 'noVis d-none'\n },\n ...extraToColumns(gon.custom_fields)\n ]\n })\n\n initCustomColvis(tasksTable, 240);\n const offcanvas = taskOffcanvas();\n initArrowFunction(offcanvas);\n offcanvas.on('afterHide', () => { $('tr.task-row-active').removeClass('task-row-active') });\n\n $('.table-search').on('keyup', e => {\n if (e.keyCode === 13) { search(tasksTable)(e) }\n })\n initFilters(tasksTable)\n\n tasksTable.on('draw', () => {\n const body = $(tasksTable.table().body())\n\n body.unhighlight()\n body.highlight(tasksTable.search())\n })\n\n tasksTable.on('xhr.dt', (e, settings, json) => {\n $('#packages-quantity-sum').text(json.packagesQuantitySum)\n gon.task_ids = json.searchedTasksIds\n checkboxesObj.setFilteredIds(json.searchedTasksIds)\n $('#order-items-table').data('taskIds', gon.task_ids.join(','))\n $('.tasks-count').text(json.searchedTasksIds.length)\n })\n\n initEscButtonEvent('.unselect-all-task-checkboxes');\n}\n\nexport const setTaskIDs = (taskProxyObjects) => {\n const taskIds = new Set([...taskProxyObjects].filter(([, v]) => (v.checked === true)).map(el => el[0]))\n $('.hidden-tasks').val([...taskIds].join(','))\n $('.task_ids').val([...taskIds].join(','))\n}\n","import { csrfToken } from \"../utils\";\nimport * as Ladda from \"ladda\";\nimport { updateCodStatus } from \"../../actions/tasks\";\nimport { geolocationMapCallback, initMap } from \"../../services/map\";\nimport { showNotification } from \"../notifications\";\nimport { i18n } from \"../i18n\";\n\nexport const initTechnicalDataModal = ($button, $modal, action) => {\n $button.on('click', async (e) => {\n const id = e.currentTarget.dataset.id\n const res = await fetch(`/tasks/${id}/${action}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n }\n })\n Ladda.stopAll()\n\n if (res.status === 200) {\n const data = await res.json()\n if (data) {\n if ((action === \"delivery_transfer_logs\" && data.partner_bridge) || action === 'origin_orders') {\n $modal.find('.container-fluid').html(data.data);\n } else {\n const text = JSON.stringify(data.data, null, 3).replaceAll('<', '<').replaceAll('>', '>')\n $modal.find('.container-fluid').html(`
${text}
`)\n }\n }\n }\n $modal.modal('show')\n })\n}\n\nexport const initIgnoreVisitWarningBtn = ($elements) => {\n $elements.on('click', async (e) => {\n const visitId = e.currentTarget.dataset.visitId\n const btn = $(e.currentTarget).addClass('disabled')\n\n const res = await fetch(`/visits/${visitId}.json`, {\n method: \"PATCH\",\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ visit: { ignore_location_warning: true } })\n })\n\n if (res.ok) {\n btn.closest('.visit-location-warning').addClass('d-none')\n showNotification({ message: i18n.t('models.visit.warning_ignored') })\n } else {\n showNotification({ message: i18n.t('shared.something_went_wrong'), type: 'danger' })\n }\n })\n}\n\nexport const initCodStatusDropdown = (element, onSuccess = () => {}) => {\n element.off('click').on('click', (e) => {\n const { status, taskId } = e.currentTarget.dataset\n updateCodStatus(taskId, status, onSuccess)\n })\n}\n\nexport const initTaskSmsButton = ($element) => {\n $element.off('click').on('click', (e) => {\n const taskId = e.currentTarget.dataset.taskId\n const modal = $(`.task-message-modal[data-task-id='${taskId}']`)\n modal.find('#sms-recipient-name').text(e.currentTarget.dataset.name)\n modal.find('#sms-recipient-phone').val(e.currentTarget.dataset.phone)\n modal.modal('show')\n })\n}\n\nexport const initTaskGeolocationsEditModal = ($buttons, onComplete = () => {}) => {\n $buttons.off('click').on('click', (e) => {\n const taskId = e.currentTarget.dataset.taskId;\n const container = $('#modal-container');\n\n $('.data-preloader').removeClass('d-none');\n fetch(`/tasks/${taskId}/edit_geolocation_modal`, {\n method: 'GET',\n headers: {\n 'X-CSRF-TOKEN': csrfToken(),\n 'Content-Type': 'application/json',\n }\n }).then(res => res.text()).then(html => {\n $(container).html('').html(html);\n\n const locations = JSON.parse($('#geolocation-task-edit-modal #task_geolocations').val());\n initEditGeolocationMaps(locations);\n\n const modal = $('#geolocation-task-edit-modal')\n Ladda.bind('.ladda-button');\n\n const onAjaxSuccess = (event) => {\n const data = event.detail[0]\n\n if (data?.message) showNotification({ message: data.message, type: data.type })\n }\n\n const onAjaxError = () => {\n showNotification({ message: i18n.t('shared.something_went_wrong'), type: 'danger' })\n }\n\n modal.on('ajax:success', onAjaxSuccess).on('ajax:error', onAjaxError).on('ajax:complete', () => { modal.modal('hide'); onComplete() })\n\n modal.modal('show')\n\n $('.data-preloader').addClass('d-none');\n });\n })\n}\n\nexport const initEditGeolocationMaps = (locations) => {\n const deliveryMapContainer = document.getElementById('edit_geolocation_map_delivery');\n const taskGeolocationMap = initMap(\n deliveryMapContainer,\n geolocationMapCallback(locations.destination.latitude, locations.destination.longitude,\n '#task_destination_latitude', '#task_destination_longitude')\n )\n setTimeout(() => { taskGeolocationMap.invalidateSize(true) }, 300, taskGeolocationMap);\n\n const sourceMapContainer = document.getElementById('edit_geolocation_map_pickup');\n if (sourceMapContainer) {\n const taskPickupGeolocationMap = initMap(\n sourceMapContainer,\n geolocationMapCallback(locations.source.latitude, locations.source.longitude,\n '#task_source_latitude', '#task_source_longitude')\n )\n\n $(\"#linkSourceGeolocation\").off('click').on('click', () => {\n setTimeout(() => { taskPickupGeolocationMap.invalidateSize(true) }, 300, taskPickupGeolocationMap);\n })\n }\n}\n","import { i18n } from \"./i18n\";\nimport { isRTL } from \"./locale\";\nimport { csrfToken } from \"./utils\";\n\nexport const initTooltips = (elements, url, maxWidth, callback, dataFunction = (instance, helper) => (helper.origin.dataset.tooltipContent.split('-').pop())) => {\n elements.tooltipster({\n content: '
Loading...
',\n contentAsHTML: true,\n animation: 'fade',\n updateAnimation: null,\n position: isRTL() ? 'left' : 'right',\n delay: 200,\n theme: 'tooltipster-shadow',\n interactive: true,\n maxWidth,\n trigger: ('ontouchstart' in window) ? 'click' : 'hover',\n functionBefore: (instance, helper) => {\n const $origin = $(helper.origin)\n const objectId = dataFunction(instance, helper)\n if (!$origin.data('loaded')) {\n fetch(url.replace(':id', objectId), {\n method: 'GET',\n headers: {\n 'X-CSRF-TOKEN': csrfToken()\n }\n }).then(resp => resp.json())\n .then(object => {\n if (object['error']) instance.content(`
${object['error']}
`)\n else instance.content(callback(object))\n\n $origin.data('loaded', true)\n })\n }\n }\n })\n}\n\nexport const visitHistory = (visit) => historyTooltip(i18n.t(`models.visit.kind_enum.${visit.kind}`), visit.versions)\nexport const orderItemHistory = (orderItem) => historyTooltip(orderItem.name, orderItem.versions)\n\nconst historyTooltip = (title, versions) => (`\n
\n
\n \n ${title} - ${i18n.t('models.task.log_of_operations')}\n \n
\n \n \n \n \n \n \n \n \n \n ${historyVersionRows(versions)}\n \n
${i18n.t('date_str')}${i18n.t('models.user.username')}${i18n.t('models.task.changes')}
\n
\n`)\n\nconst historyVersionRows = (versions) => (\n versions.map(version => (\n `\n \n ${version.created_at}\n ${version.username}\n \n \n \n \n \n \n \n \n \n \n \n ${historyChangeRows(version.changes)}\n \n
${i18n.t('field')}${i18n.t('old')}${i18n.t('new')}
\n \n \n `\n )).join('')\n)\n\nconst historyChangeRows = (changes) => (\n changes.map(change => (\n `\n \n ${change.field}\n ${change.old}\n \n ${change.new}\n \n `\n )).join('')\n)\n\nexport const taskSmsTooltip = (sms_logs) => {\n return `\n \n \n \n \n \n \n \n \n \n \n ${sms_logs.map(log => (\n `\n \n \n \n \n \n \n `\n )).join('')}\n \n
${i18n.t('date_str')}${i18n.t('models.task.content')}${i18n.t('models.driver.phone')}${i18n.t('models.task.status')}
${log.date || ''}${log.body || ''}${log.to || ''}${log.status || ''}
\n `\n}\n\nexport const driverAppInfoTooltip = (appInfo) => {\n if (!appInfo.device_name && !appInfo.recent_active_at) return i18n.t('drivers.no_device_data_available')\n\n const device = deviceInfo(appInfo.os, appInfo.manufacturer)\n const batteryIconClass = batteryLevelIconClass(appInfo.battery_level, appInfo.battery_charging)\n const tooltipInfo = `${appInfo.manufacturer} ${appInfo.device_name} (${appInfo.os} ${appInfo.os_version})`\n\n return `\n
\n
\n
\n ${device.iconClass ? `` : ''}\n ${device.showManufacturer ? `${appInfo.manufacturer} ` : ''}\n ${appInfo.device_name}\n
\n
\n ${batteryIconClass ? `` : ''}\n
\n
\n
\n ${appInfo.recent_active_at ? `${i18n.t('models.driver.recent_active_at')}: ${appInfo.recent_active_at}` : ''}\n
\n
\n `\n}\n\nconst deviceInfo = (os, manufacturer) => {\n switch (os?.toLowerCase()) {\n case 'android':\n switch (manufacturer?.toLowerCase()) {\n case 'google':\n return {showManufacturer: false, iconClass: 'fa-brands fa-google'}\n default:\n return {showManufacturer: true, iconClass: 'fa-brands fa-android text-success'}\n }\n case 'ios':\n return {showManufacturer: false, iconClass: 'fa-brands fa-apple'}\n default:\n return {showManufacturer: true, iconClass: ''}\n }\n}\n\nconst batteryLevelIconClass = (batteryLevel, batteryCharging) => {\n const level = parseInt(batteryLevel)\n if (!level) return ''\n\n if (batteryCharging) return 'fa-thin fa-battery-bolt text-success'\n\n switch (true) {\n case level <= 10:\n return 'fa-thin fa-battery-empty text-danger'\n case level <= 35:\n return 'fa-thin fa-battery-quarter text-danger'\n case level <= 65:\n return 'fa-thin fa-battery-half text-warning'\n case level <= 90:\n return 'fa-thin fa-battery-three-quarters text-success'\n case level <= 100:\n return 'fa-thin fa-battery-full text-success'\n default:\n return ''\n }\n}\n","import { csrfToken } from \"../helpers/utils\";\n\nexport const updateRegionsDriver = async (regionId, params) => {\n return await fetch('/regions/' + regionId + '/set_driver', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ region: params })\n })\n}\n","import { i18n } from \"../i18n\";\nimport {\n updateRouteAssistantDriver,\n updateRouteDriver, updateRouteVehicle,\n updateTasksPickUpAt, updateVisitRoute,\n updateVisitsDriver,\n updateVisitsPickUpAt\n} from '../../actions/visits'\nimport { updateTasksDriver } from '../../actions/tasks'\nimport { updateRegionsDriver } from '../../actions/regions'\nimport { showNotification } from '../notifications'\nimport { dateOrCurrent } from \"../date\";\nimport { openWoltModal } from \"../external_deliveries/wolt\";\nimport { openGettModal } from \"../external_deliveries/gett\";\nimport { dataOrNA, fetchJSON } from \"../utils\";\nimport { cancelTransferConfirmation, initTransferConfirmation } from \"../drivers/confirmations\";\nimport { openGetPackageModal } from \"../external_deliveries/get_package\";\n\nexport const initVisitPickUpAtDatepicker = (el, callback) => initPickUpAtDatepicker(el, 'visit', callback)\nexport const initTaskPickUpAtDatepicker = (el) => initPickUpAtDatepicker(el, 'task')\n\nconst initPickUpAtDatepicker = (el, strategy = 'visit', callback = () => {}) => {\n el.off('change').on('change', async e => {\n let res\n $(e.target).siblings('.input-group-append').find('.fa-calendar').addClass('d-none')\n $(e.target).siblings('.input-group-append').find('.fa-refresh').removeClass('d-none')\n if (strategy === 'task') {\n res = await updateTasksPickUpAt(e.target.dataset.targetId, dateOrCurrent(e.target.value))\n } else {\n res = await updateVisitsPickUpAt(e.target.dataset.targetId, dateOrCurrent(e.target.value))\n }\n if (res.status === 204 || res.status === 200) {\n res.json().then(data => callback(data))\n $(e.target).siblings('.input-group-append').find('.fa-refresh').addClass('d-none')\n $(e.target).siblings('.input-group-append').find('.fa-calendar').removeClass('d-none')\n } else {\n showNotification({ message: i18n.t('errors.something_wrong') })\n }\n })\n}\n\nconst driversData = async (currentId, strategy) => {\n const orgDrivers = await gon.org_drivers\n const drivers = orgDrivers.filter(d => d.active === true || currentId === d.id)\n\n return [\n {\n text: \"\",\n children: drivers.filter(d => !d.partner_bridge_id).map(d => ({\n id: d.id,\n text: `${dataOrNA(d.first_name)} ${dataOrNA(d.last_name)}`,\n selected: currentId === d.id,\n html: `
\n ${d.image ? `${d.first_name}` : ''}\n ${dataOrNA(d.first_name)} ${dataOrNA(d.last_name)}\n
`\n }))\n },\n {\n text: i18n.t('drivers.partner_drivers'),\n children: [\n ...drivers.filter(d => d.partner_bridge_id).map(d => ({\n id: d.id,\n text: `${dataOrNA(d.first_name)} ${dataOrNA(d.last_name)}`,\n html: `
\n ${d.partner_bridge_image ? `${d.partner_bridge_name}` : ''}\n ${dataOrNA(d.first_name)} ${dataOrNA(d.last_name)}\n
`,\n selected: currentId === d.id\n })),\n ...(strategy === 'visit' || strategy === 'task' ? partnerDrivers(currentId) : [])\n ]\n }\n ].filter(d => d.children.length > 0)\n}\n\nconst routesData = currentId => (\n gon.org_routes.map(r => (\n {\n id: r.id,\n text: r.name,\n selected: currentId === r.id,\n html: `
\n \n ${r.name}\n
`,\n }\n ))\n)\n\nexport const initRoutesSelect = (el, callback = () => {}) => initSelect(el, 'route', routesData, callback)\nexport const initRouteDriversSelect = (el, callback = () => {}) => initSelect(el, 'route_driver', driversData, callback, '170px')\nexport const initVisitDriversSelect = (el, callback = () => {}, width=\"150px\") => initSelect(el, 'visit', driversData, callback, width)\nexport const initTaskDriversSelect = el => initSelect(el, 'task', driversData)\nexport const initRegionDeliveryDriversSelect = (el, callback = () => {}, width=\"150px\") => initSelect(el, 'delivery_driver', driversData, callback, width)\nexport const initRegionPickupDriversSelect = (el, callback = () => {}, width=\"150px\") => initSelect(el, 'pickup_driver', driversData, callback, width)\nexport const initRegionReturnDriversSelect = (el, callback = () => {}, width=\"150px\") => initSelect(el, 'return_driver', driversData, callback, width)\nexport const initRouteVehiclesSelect = (el, callback = () => {}) => initSelect(el, 'route_vehicle', (currentId) => (gon.vehicles.map(v => ({...v, selected: currentId === v.id}))), callback, '200px')\nexport const initRouteAssistantDriverSelect = (el, callback = () => {}, width=\"150px\") => initSelect(el, 'route_assistant_driver', driversData, callback, width)\n\nconst initSelect = async (el, strategy = 'visit', dataParams, callback = () => {}, width = '150px') => {\n const customMatch = (params, data) => {\n if ($.trim(params.term) === '' || data.id === '-1') return data\n return $.fn.select2.defaults.defaults.matcher(params, data)\n }\n\n const $container = $(el)\n const id = $container.data('current-id')\n const placeholder = $container.data('placeholder') || ''\n if (!gon.org_drivers) {\n gon.org_drivers = fetchJSON(`/api/web/organizations/drivers`, 'POST', JSON.stringify({ ids: gon.driver_ids_to_load || [] }))\n }\n const data = await dataParams(id, strategy)\n let unassignTitle\n switch (strategy) {\n case 'route':\n unassignTitle = i18n.t('views.routes.unassign_route')\n break\n case 'route_vehicle':\n unassignTitle = i18n.t('views.routes.unassign_vehicle')\n break\n default:\n unassignTitle = i18n.t('drivers.unassign_driver')\n break\n }\n\n data.unshift({ id: 0, text: placeholder, disabled: true, selected: true })\n data.unshift({ id: -1, html: `${unassignTitle}` })\n\n $container.select2({\n placeholder: '',\n dir: i18n.t('direction'),\n width: width,\n data: data,\n matcher: customMatch,\n dropdownCssClass: 'drivers-select2-container',\n templateSelection: (state) => {\n if (state.id === -1 || state.id === '-1') return '';\n if (state.html && (strategy === 'visit' || strategy === 'route')) { return $(state.html) }\n\n return state.text;\n },\n templateResult: (state, container) => {\n const $element = $(container)\n if (state.id === -1 || state.id === '-1') $element.addClass('unassign-option')\n if (state.id === 0 || state.id === '0') $element.addClass('d-none')\n\n if ('children' in state) {\n $element.addClass(state.text ? 'border-bottom' : 'd-none')\n return state.text\n } else {\n return state.html ? $(state.html) : state.text\n }\n }\n })\n\n // prevent strange behaviour on mobile touch\n $container.off('select2:open').on('select2:open', () => {\n $container.addClass('select-prevent')\n setTimeout(() => { $container.removeClass('select-prevent') }, 50)\n })\n $container.off('select2:selecting').on('select2:selecting', (e) => {\n if ($container.hasClass('select-prevent')) return false\n\n if (strategy === 'task' || strategy === 'visit') {\n if (handleIntegrations(e, strategy)) return false\n\n const checksQueue = []\n checksQueue.push(handleTransferCancel)\n if (gon.confirm_task_transfers) checksQueue.push(handleTransferConfirm)\n\n const params = e.params.args;\n\n (async () => {\n for (const check of checksQueue) {\n const res = await check(e, strategy)\n if (!res.shouldContinue) return\n if (res.data) params.data = { ...params.data, ...res.data }\n }\n\n $(e.currentTarget).val(e.params.args.data.id).trigger('change').trigger({ type: 'select2:select', params: params })\n })()\n\n return false\n }\n })\n\n $container.off('select2:select').on('select2:select', async e => {\n const spinner = $(e.target).siblings('.spinner')\n const targetId = e.target.dataset.targetId;\n spinner.removeClass('d-none')\n\n if (!targetId) return;\n\n let response = null\n switch (strategy) {\n case 'task':\n response = await updateTasksDriver(targetId, e.params.data.id)\n break\n case 'route':\n response = await updateVisitRoute(targetId, e.params.data.id)\n break\n case 'route_driver':\n response = await updateRouteDriver(targetId, e.params.data.id)\n break\n case 'route_assistant_driver':\n response = await updateRouteAssistantDriver(targetId, e.params.data.id)\n break\n case 'delivery_driver':\n response = await updateRegionsDriver(targetId, { delivery_driver_id: e.params.data.id })\n break\n case 'pickup_driver':\n response = await updateRegionsDriver(targetId, { pickup_driver_id: e.params.data.id })\n break\n case 'return_driver':\n response = await updateRegionsDriver(targetId, { return_driver_id: e.params.data.id })\n break\n case 'route_vehicle':\n response = await updateRouteVehicle(targetId, e.params.data.id)\n break\n case 'batch_visits':\n break\n default: {\n const additionalData = { keep_transfer_connection: e.params.data.keep_transfer_connection, transfer_details: e.params.data.transfer_details }\n response = await updateVisitsDriver(targetId, e.params.data.id, additionalData)\n break\n }\n }\n\n spinner.addClass('d-none')\n\n response && response.json().then(data => callback(data))\n })\n}\n\nexport const ADDRESS_PRECISIONS = {\n 'warning_ignored': {\n color: '#D8F0D8',\n name: () => (i18n.t('models.visit.warning_ignored'))\n },\n 'inaccurate': {\n color: '#FFE2E5',\n name: () => (i18n.t('models.location.inaccurate'))\n },\n 'ambiguous': {\n color: '#FFF4DE',\n name: () => (i18n.t('models.location.ambiguous'))\n },\n 'accurate': {\n color: '',\n name: () => (i18n.t('models.location.accurate'))\n }\n}\n\nconst partnerDrivers = (currentDriver) => (\n [\n { name: 'Wolt', condition: gon.allow_wolt, image: '/wolt.png' },\n { name: 'Gett', condition: gon.allow_gett, image: '/gett-icon.png' },\n { name: 'Get Package', condition: gon.allow_get_package, image: '/get_package.webp' },\n ].filter(p => p.condition).map(p => ({\n id: p.name,\n text: p.name,\n selected: currentDriver === p.name,\n html: `
${p.name}${p.name}
`\n }))\n)\n\nconst handleIntegrations = (e, strategy) => {\n const taskId = (strategy === 'task') ? e.currentTarget.dataset.targetId : null\n const visitId = (strategy === 'visit') ? e.currentTarget.dataset.targetId : null\n const select2 = $(e.currentTarget)\n\n const optionId = e.params.args.data.id\n\n if (optionId === 'Wolt') openWoltModal(taskId, visitId, () => { select2.val(optionId).trigger('change') })\n if (optionId === 'Gett') openGettModal(taskId, visitId, () => { select2.val(optionId).trigger('change') })\n if (optionId === 'Get Package') openGetPackageModal(taskId, visitId, () => { select2.val(optionId).trigger('change') })\n\n if (optionId === 'Wolt' || optionId === 'Get Package' || optionId === 'Gett') {\n select2.select2('close')\n return true\n }\n\n return false\n}\n\nconst handleTransferCancel = async (e) => {\n const select2 = $(e.currentTarget)\n const previousDriverId = $(e.currentTarget).val()\n const orgDrivers = await gon.org_drivers\n const previousDriver = previousDriverId ? orgDrivers.find(d => d.id === parseInt(previousDriverId)) : null\n\n if (previousDriver?.partner_bridge_id) {\n const result = await cancelTransferConfirmation()\n\n return { shouldContinue: result.isConfirmed, data: { keep_transfer_connection: result.value === 0 } }\n }\n select2.select2('close')\n return { shouldContinue: true }\n}\n\nconst handleTransferConfirm = async (e, strategy) => {\n const driverId = e.params.args.data.id\n const orgDrivers = await gon.org_drivers\n const driver = driverId ? orgDrivers.find(d => d.id === parseInt(driverId)) : null\n const select2 = $(e.currentTarget)\n select2.select2('close')\n\n if (driver?.partner_bridge_id) {\n const targetId = e.currentTarget.dataset.targetId\n const body = (strategy === 'task') ? { task_id: targetId } : { visit_id: targetId }\n\n const res = await initTransferConfirmation(driverId, body)\n return { shouldContinue: res.isConfirmed, data: { transfer_details: res.transferDetails } }\n }\n return { shouldContinue: true }\n}\n","import { csrfToken } from \"../helpers/utils\";\n\nexport const updateVisitsDriver = async (visitId, driverId, additionalData = {}) => {\n return await fetch('/visits/' + visitId + '/set_driver', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ new_driver: driverId, ...additionalData })\n })\n}\n\nexport const updateVisitRoute = async (visitId, routeId) => {\n return await fetch('/visits/' + visitId + '/set_route', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ new_route: routeId })\n })\n}\n\nexport const updateRouteDriver = async (routeId, driverId) => {\n return await fetch('/routes/' + routeId + '?fetch=1', {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': document.head.querySelector('meta[name=\"csrf-token\"]').content\n },\n body: JSON.stringify({ route: { driver_id: driverId } })\n })\n}\n\nexport const updateRouteAssistantDriver = async (routeId, driverId) => {\n return await fetch(`/routes/${routeId}`, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ route: { assistant_driver_id: driverId } })\n })\n}\n\nexport const updateRouteVehicle = async (routeId, vehicleId) => {\n return await fetch('/routes/' + routeId + '?fetch=1', {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': document.head.querySelector('meta[name=\"csrf-token\"]').content\n },\n body: JSON.stringify({ route: { vehicle_id: vehicleId } })\n })\n}\n\nexport const updateVisitsPickUpAt = async (visitId, date) => (\n await fetch('/visits/' + visitId + '/set_visit_at', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ date })\n })\n)\n\nexport const updateTasksPickUpAt = async (taskId, date) => (\n await fetch('/tasks/' + taskId + '/set_pickup', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': csrfToken()\n },\n body: JSON.stringify({ date })\n })\n)\n","L.Control.Fullscreen=L.Control.extend({options:{position:\"topleft\",title:{\"false\":\"View Fullscreen\",\"true\":\"Exit Fullscreen\"}},onAdd:function(map){var container=L.DomUtil.create(\"div\",\"leaflet-control-fullscreen leaflet-bar leaflet-control\");this.link=L.DomUtil.create(\"a\",\"leaflet-control-fullscreen-button leaflet-bar-part\",container);this.link.href=\"#\";this._map=map;this._map.on(\"fullscreenchange\",this._toggleTitle,this);this._toggleTitle();L.DomEvent.on(this.link,\"click\",this._click,this);return container},_click:function(e){L.DomEvent.stopPropagation(e);L.DomEvent.preventDefault(e);this._map.toggleFullscreen(this.options)},_toggleTitle:function(){this.link.title=this.options.title[this._map.isFullscreen()]}});L.Map.include({isFullscreen:function(){return this._isFullscreen||false},toggleFullscreen:function(options){var container=this.getContainer();if(this.isFullscreen()){if(options&&options.pseudoFullscreen){this._disablePseudoFullscreen(container)}else if(document.exitFullscreen){document.exitFullscreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.webkitCancelFullScreen){document.webkitCancelFullScreen()}else if(document.msExitFullscreen){document.msExitFullscreen()}else{this._disablePseudoFullscreen(container)}}else{if(options&&options.pseudoFullscreen){this._enablePseudoFullscreen(container)}else if(container.requestFullscreen){container.requestFullscreen()}else if(container.mozRequestFullScreen){container.mozRequestFullScreen()}else if(container.webkitRequestFullscreen){container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}else if(container.msRequestFullscreen){container.msRequestFullscreen()}else{this._enablePseudoFullscreen(container)}}},_enablePseudoFullscreen:function(container){L.DomUtil.addClass(container,\"leaflet-pseudo-fullscreen\");this._setFullscreen(true);this.invalidateSize();this.fire(\"fullscreenchange\")},_disablePseudoFullscreen:function(container){L.DomUtil.removeClass(container,\"leaflet-pseudo-fullscreen\");this._setFullscreen(false);this.invalidateSize();this.fire(\"fullscreenchange\")},_setFullscreen:function(fullscreen){this._isFullscreen=fullscreen;var container=this.getContainer();if(fullscreen){L.DomUtil.addClass(container,\"leaflet-fullscreen-on\")}else{L.DomUtil.removeClass(container,\"leaflet-fullscreen-on\")}},_onFullscreenChange:function(e){var fullscreenElement=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;if(fullscreenElement===this.getContainer()&&!this._isFullscreen){this._setFullscreen(true);this.fire(\"fullscreenchange\")}else if(fullscreenElement!==this.getContainer()&&this._isFullscreen){this._setFullscreen(false);this.fire(\"fullscreenchange\")}}});L.Map.mergeOptions({fullscreenControl:false});L.Map.addInitHook(function(){if(this.options.fullscreenControl){this.fullscreenControl=new L.Control.Fullscreen(this.options.fullscreenControl);this.addControl(this.fullscreenControl)}var fullscreenchange;if(\"onfullscreenchange\"in document){fullscreenchange=\"fullscreenchange\"}else if(\"onmozfullscreenchange\"in document){fullscreenchange=\"mozfullscreenchange\"}else if(\"onwebkitfullscreenchange\"in document){fullscreenchange=\"webkitfullscreenchange\"}else if(\"onmsfullscreenchange\"in document){fullscreenchange=\"MSFullscreenChange\"}if(fullscreenchange){var onFullscreenChange=L.bind(this._onFullscreenChange,this);this.whenReady(function(){L.DomEvent.on(document,fullscreenchange,onFullscreenChange)});this.on(\"unload\",function(){L.DomEvent.off(document,fullscreenchange,onFullscreenChange)})}});L.control.fullscreen=function(options){return new L.Control.Fullscreen(options)};\n","/*\n (c) 2014, Vladimir Agafonkin\n simpleheat, a tiny JavaScript library for drawing heatmaps with Canvas\n https://github.com/mourner/simpleheat\n*/\n!function(){\"use strict\";function t(i){return this instanceof t?(this._canvas=i=\"string\"==typeof i?document.getElementById(i):i,this._ctx=i.getContext(\"2d\"),this._width=i.width,this._height=i.height,this._max=1,void this.clear()):new t(i)}t.prototype={defaultRadius:25,defaultGradient:{.4:\"blue\",.6:\"cyan\",.7:\"lime\",.8:\"yellow\",1:\"red\"},data:function(t,i){return this._data=t,this},max:function(t){return this._max=t,this},add:function(t){return this._data.push(t),this},clear:function(){return this._data=[],this},radius:function(t,i){i=i||15;var a=this._circle=document.createElement(\"canvas\"),s=a.getContext(\"2d\"),e=this._r=t+i;return a.width=a.height=2*e,s.shadowOffsetX=s.shadowOffsetY=200,s.shadowBlur=i,s.shadowColor=\"black\",s.beginPath(),s.arc(e-200,e-200,t,0,2*Math.PI,!0),s.closePath(),s.fill(),this},gradient:function(t){var i=document.createElement(\"canvas\"),a=i.getContext(\"2d\"),s=a.createLinearGradient(0,0,0,256);i.width=1,i.height=256;for(var e in t)s.addColorStop(e,t[e]);return a.fillStyle=s,a.fillRect(0,0,1,256),this._grad=a.getImageData(0,0,1,256).data,this},draw:function(t){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var i=this._ctx;i.clearRect(0,0,this._width,this._height);for(var a,s=0,e=this._data.length;e>s;s++)a=this._data[s],i.globalAlpha=Math.max(a[2]/this._max,t||.05),i.drawImage(this._circle,a[0]-this._r,a[1]-this._r);var n=i.getImageData(0,0,this._width,this._height);return this._colorize(n.data,this._grad),i.putImageData(n,0,0),this},_colorize:function(t,i){for(var a,s=3,e=t.length;e>s;s+=4)a=4*t[s],a&&(t[s-3]=i[a],t[s-2]=i[a+1],t[s-1]=i[a+2])}},window.simpleheat=t}(),/*\n (c) 2014, Vladimir Agafonkin\n Leaflet.heat, a tiny and fast heatmap plugin for Leaflet.\n https://github.com/Leaflet/Leaflet.heat\n*/\nL.HeatLayer=(L.Layer?L.Layer:L.Class).extend({initialize:function(t,i){this._latlngs=t,L.setOptions(this,i)},setLatLngs:function(t){return this._latlngs=t,this.redraw()},addLatLng:function(t){return this._latlngs.push(t),this.redraw()},setOptions:function(t){return L.setOptions(this,t),this._heat&&this._updateOptions(),this.redraw()},redraw:function(){return!this._heat||this._frame||this._map._animating||(this._frame=L.Util.requestAnimFrame(this._redraw,this)),this},onAdd:function(t){this._map=t,this._canvas||this._initCanvas(),t._panes.overlayPane.appendChild(this._canvas),t.on(\"moveend\",this._reset,this),t.options.zoomAnimation&&L.Browser.any3d&&t.on(\"zoomanim\",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._canvas),t.off(\"moveend\",this._reset,this),t.options.zoomAnimation&&t.off(\"zoomanim\",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},_initCanvas:function(){var t=this._canvas=L.DomUtil.create(\"canvas\",\"leaflet-heatmap-layer leaflet-layer\"),i=L.DomUtil.testProp([\"transformOrigin\",\"WebkitTransformOrigin\",\"msTransformOrigin\"]);t.style[i]=\"50% 50%\";var a=this._map.getSize();t.width=a.x,t.height=a.y;var s=this._map.options.zoomAnimation&&L.Browser.any3d;L.DomUtil.addClass(t,\"leaflet-zoom-\"+(s?\"animated\":\"hide\")),this._heat=simpleheat(t),this._updateOptions()},_updateOptions:function(){this._heat.radius(this.options.radius||this._heat.defaultRadius,this.options.blur),this.options.gradient&&this._heat.gradient(this.options.gradient),this.options.max&&this._heat.max(this.options.max)},_reset:function(){var t=this._map.containerPointToLayerPoint([0,0]);L.DomUtil.setPosition(this._canvas,t);var i=this._map.getSize();this._heat._width!==i.x&&(this._canvas.width=this._heat._width=i.x),this._heat._height!==i.y&&(this._canvas.height=this._heat._height=i.y),this._redraw()},_redraw:function(){var t,i,a,s,e,n,h,o,r,d=[],_=this._heat._r,l=this._map.getSize(),m=new L.Bounds(L.point([-_,-_]),l.add([_,_])),c=void 0===this.options.max?1:this.options.max,u=void 0===this.options.maxZoom?this._map.getMaxZoom():this.options.maxZoom,f=1/Math.pow(2,Math.max(0,Math.min(u-this._map.getZoom(),12))),g=_/2,p=[],v=this._map._getMapPanePos(),w=v.x%g,y=v.y%g;for(t=0,i=this._latlngs.length;i>t;t++)if(a=this._map.latLngToContainerPoint(this._latlngs[t]),m.contains(a)){e=Math.floor((a.x-w)/g)+2,n=Math.floor((a.y-y)/g)+2;var x=void 0!==this._latlngs[t].alt?this._latlngs[t].alt:void 0!==this._latlngs[t][2]?+this._latlngs[t][2]:1;r=x*f,p[n]=p[n]||[],s=p[n][e],s?(s[0]=(s[0]*s[2]+a.x*r)/(s[2]+r),s[1]=(s[1]*s[2]+a.y*r)/(s[2]+r),s[2]+=r):p[n][e]=[a.x,a.y,r]}for(t=0,i=p.length;i>t;t++)if(p[t])for(h=0,o=p[t].length;o>h;h++)s=p[t][h],s&&d.push([Math.round(s[0]),Math.round(s[1]),Math.min(s[2],c)]);this._heat.data(d).draw(this.options.minOpacity),this._frame=null},_animateZoom:function(t){var i=this._map.getZoomScale(t.zoom),a=this._map._getCenterOffset(t.center)._multiplyBy(-i).subtract(this._map._getMapPanePos());L.DomUtil.setTransform?L.DomUtil.setTransform(this._canvas,a,i):this._canvas.style[L.DomUtil.TRANSFORM]=L.DomUtil.getTranslateString(a)+\" scale(\"+i+\")\"}}),L.heatLayer=function(t,i){return new L.HeatLayer(t,i)};","// Keenthemes' plugins\nwindow.KTAppSettings = { breakpoints: { sm: 576, md: 768, lg: 992, xl: 1200, xxl: 1400 }, colors: { theme: { base: { white: '#ffffff', primary: '#3699FF', secondary: '#E5EAEE', success: '#1BC5BD', info: '#8950FC', warning: '#FFA800', danger: '#F64E60', light: '#E4E6EF', dark: '#181C32' }, light: { white: '#ffffff', primary: '#E1F0FF', secondary: '#EBEDF3', success: '#C9F7F5', info: '#EEE5FF', warning: '#FFF4DE', danger: '#FFE2E5', light: '#F3F6F9', dark: '#D6D6E0' }, inverse: { white: '#ffffff', primary: '#ffffff', secondary: '#3F4254', success: '#ffffff', info: '#ffffff', warning: '#ffffff', danger: '#ffffff', light: '#464E5F', dark: '#ffffff' } }, gray: { 'gray-100': '#F3F6F9', 'gray-200': '#EBEDF3', 'gray-300': '#E4E6EF', 'gray-400': '#D1D3E0', 'gray-500': '#B5B5C3', 'gray-600': '#7E8299', 'gray-700': '#5E6278', 'gray-800': '#3F4254', 'gray-900': '#181C32' } }, 'font-family': 'Poppins' }\nwindow.PerfectScrollbar = require('perfect-scrollbar/dist/perfect-scrollbar')\nwindow.KTUtil = require('./components/util.js')\nwindow.KTApp = require('./components/app.js')\nwindow.KTOffcanvas = require('./components/offcanvas.js')\nwindow.KTMenu = require('./components/menu.js')\nwindow.KTCookie = require('./components/cookie.js')\nwindow.KTToggle = require('./components/toggle.js')\n\n// Metronic layout base js\nwindow.KTLayoutHeader = require('./layout/base/header.js')\nwindow.KTLayoutHeaderMenu = require('./layout/base/header-menu.js')\nwindow.KTLayoutHeaderTopbar = require('./layout/base/header-topbar.js')\nwindow.KTLayoutBrand = require('./layout/base/brand.js')\nwindow.KTLayoutAside = require('./layout/base/aside.js')\nwindow.KTLayoutAsideToggle = require('./layout/base/aside-toggle.js')\nwindow.KTLayoutAsideMenu = require('./layout/base/aside-menu.js')\nwindow.KTLayoutSubheader = require('./layout/base/subheader.js')\nwindow.KTLayoutContent = require('./layout/base/content.js')\nwindow.KTLayoutFooter = require('./layout/base/footer.js')\n\nwindow.KTProfile = require('./pages/custom/profile/profile.js')\nwindow.KTImageInput = require('./components/image-input.js')\n\nwindow.KTCard = require('./components/card.js')\n\nrequire('./layout/initialize.js')\n","\"use strict\";\n\n// Class definition\nvar KTProfile = function () {\n\t// Elements\n\tvar avatar;\n\tvar offcanvas;\n\n\t// Private functions\n\tvar _initAside = function () {\n\t\t// Mobile offcanvas for mobile mode\n\t\toffcanvas = new KTOffcanvas('kt_profile_aside', {\n overlay: true,\n baseClass: 'offcanvas-mobile',\n //closeBy: 'kt_user_profile_aside_close',\n toggleBy: 'kt_subheader_mobile_toggle'\n });\n\t}\n\n\tvar _initForm = function() {\n\t\tavatar = new KTImageInput('kt_profile_avatar');\n\t}\n\n\treturn {\n\t\t// public functions\n\t\tinit: function() {\n\t\t\t_initAside();\n\t\t\t_initForm();\n\t\t}\n\t};\n}();\n\njQuery(document).ready(function() {\n\tKTProfile.init();\n});\n","$(() => {\n if (gon.is_organization || gon.is_company) {\n $(document).on('keydown', function (e) {\n if ((e.metaKey || e.ctrlKey) && (String.fromCharCode(e.which).toLowerCase() === 'k')) {\n e.preventDefault();\n document.querySelector('#r-new-task a').click()\n }\n });\n }\n\n $(document).on('keydown', function (e) {\n if ((e.metaKey || e.ctrlKey) && (e.keyCode == 66)) {\n e.preventDefault();\n $('.header-search').focus();\n }\n });\n})\n","import * as Ladda from 'ladda'\nimport {\n getDateFormat,\n getFormattedDate,\n matchStart,\n timepickerMeridian\n} from './helpers/date'\nimport { renderTasksTable } from './helpers/tasks/table'\nimport {geolocationMapCallback, initMap} from './services/map'\nimport { initDriversDropdown, initDateRangePicker, initRoutesDropdown, initTaskCancelButton } from './helpers/view'\nimport { handleTaskPickStatusModal, updateTaskPickStatus, updateTaskStatus } from './actions/tasks'\nimport {dataOrNA, getParameterByName} from './helpers/utils'\nimport { buildTip } from './helpers/leaflet'\nimport { isRTL } from './helpers/locale'\nimport { initVisitDriversSelect, initVisitPickUpAtDatepicker } from './helpers/visits/common'\nimport { defaultTranslations, search } from \"./helpers/datatables\";\nimport { initSmsTemplatesSelect } from \"./helpers/sms_templates\";\nimport { renderOrderItemsTable, showOrderItemPickingModal } from './helpers/tasks/order_items'\nimport { i18n } from \"./helpers/i18n\";\nimport {showNotification} from \"./helpers/notifications\";\nimport WaveSurfer from 'wavesurfer.js'\nimport { deleteSweetAlert } from './helpers/sweetalerts';\nimport { initTooltips, orderItemHistory, visitHistory } from \"./helpers/tooltips\";\nimport {\n initCodStatusDropdown,\n initTaskGeolocationsEditModal,\n initTaskSmsButton,\n initTechnicalDataModal,\n initIgnoreVisitWarningBtn\n} from \"./helpers/tasks/view\";\nimport { initializeQuillEditor } from \"./helpers/quill\";\nimport Swal from 'sweetalert2/dist/sweetalert2';\nimport {syncShopifyOrder} from \"./helpers/shopify\";\n\nexport const checkedSet = new Set()\n\n$(async () => {\n const body = $('body')\n if (body.hasClass('public_pages task_info')) return\n\n $.rails.refreshCSRFTokens()\n initDriversDropdown()\n initRoutesDropdown()\n\n $('#labels_on_page').on('change', (e) => {\n const labelsAmount = e.currentTarget.value\n $('.label-start-position').removeClass('active')\n $(`.label-start-position[data-position='0']`).addClass('active')\n $('#start_position').val(0)\n $('.grid-4-labels-per-page').toggleClass('d-none', labelsAmount !== '4')\n $('.grid-8-labels-per-page').toggleClass('d-none', labelsAmount !== '8')\n })\n\n $('.label-start-position').on('click', (e) => {\n const position = e.currentTarget.dataset.position\n $('.label-start-position').removeClass('active')\n $(`.label-start-position[data-position='${position}']`).addClass('active')\n $('#start_position').val(position)\n })\n\n $(\".order-items-add-btn a.add_fields\")\n .data(\"association-insertion-method\", 'append')\n .data(\"association-insertion-node\", '.order-items-form');\n\n $('.order-items-add-btn a').click(() => {\n $('.order-items-form').removeClass('d-none')\n $('.order-items-empty').addClass('d-none')\n })\n\n $('.task-set-status').on('click', (e) => {\n const taskId = e.currentTarget.dataset.taskId\n const status = e.currentTarget.dataset.newStatus\n updateTaskStatus(taskId, status)\n })\n\n if (body.hasClass('tasks show')) {\n initMap(document.querySelector('.task-map'), mapCallback)\n\n $('.sync-shop').on('click', syncShopifyOrder)\n\n $('.failure-reasons').select2({\n dir: i18n.t('direction'),\n width: '100%',\n matcher: function (params, data) {\n return matchStart(params, data)\n }\n })\n\n $('.failure-reasons').on('select2:select', async e => {\n const res = await fetch(`/tasks/${$('.failure-reasons').data('task-id')}`, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': document.head.querySelector('meta[name=\"csrf-token\"]').content\n },\n body: JSON.stringify({task: {failure_reason_id: e.currentTarget.value}})\n })\n if (res.status === 200) {\n showNotification({ message: i18n.t('saved_successfully') })\n } else {\n showNotification({ message: i18n.t('errors.something_wrong'), type: 'danger' })\n }\n })\n\n initTaskSmsButton($('.task-sms-btn'))\n\n initVisitPickUpAtDatepicker($('.task-visit-pickup-date'))\n $('.visit-drivers-select2:not([data-select2-id^=\"select2\"])').each((i, d) => initVisitDriversSelect(d))\n\n initSmsTemplatesSelect($('.sms-templates-select'), $('#message-body'))\n initCodStatusDropdown($('.update-cod-status'), (data) => {\n $('.cod-returned-by-driver-at').text(data.returned_by_driver_at)\n $('.cod-returned-to-company-at').text(data.returned_to_company_at)\n })\n $('.task-set-pick-status').on('click', (e) => {\n const { taskId, newStatus, packagesQuantity } = e.currentTarget.dataset\n if (newStatus === 'PICKED') {\n handleTaskPickStatusModal(taskId, newStatus, packagesQuantity)\n } else {\n updateTaskPickStatus(taskId, newStatus)\n }\n })\n\n initTaskGeolocationsEditModal($('.edit-task-geolocation-btn'), () => { location.reload() })\n\n if(gon.has_twilio_calls) {\n initCallRecordingSections();\n }\n\n $('.archive-task').on('click', (e) => {\n e.preventDefault();\n const url = e.currentTarget.dataset.url;\n deleteSweetAlert(\n url, \"/\", i18n.t('models.task.delete_warning'),\n i18n.t('recycle_bin'), i18n.t('views.tasks.sweetalert.moved_to_recycle_bin')\n )\n })\n\n $(\".task_es_versions\").each(async function() {\n fetch(`/tasks/${gon.task_id}/versions`)\n .then(res => res.text()).then(html => {\n $('.task-versions-loader').addClass('d-none');\n $(\".task_es_versions\").html('').html(html);\n })\n });\n\n initTaskCancelButton($('.task-cancel-button'))\n initAddProductButtonEvent();\n\n $('#btn-pick-order-item').on('click', (e) => {\n showOrderItemPickingModal(e);\n })\n\n $('.inaccurate-location-form').on('submit', (e) => {\n showNotification({ message: i18n.t('shared.email_sent_successfully') })\n $(e.currentTarget).closest('.modal').modal('hide');\n })\n\n $(document).on('focusout', '.order-item-quantity-input', (e) => {\n const quantityInput = e.currentTarget;\n const maxValue = $(quantityInput).attr('max');\n const currentValue = $(quantityInput).val();\n\n if(parseInt(currentValue) > parseInt(maxValue)) { $(quantityInput).val(maxValue); }\n });\n\n $('.btn-task-photo-delete').on('click', (e) => deleteTaskPhoto(e.currentTarget));\n $('.order-item-quantity-input').on('click', (e) => e.stopPropagation());\n initTooltips($('.order-item-history-json').not('.tooltipstered'), '/order_items/:id/fetch_history_json', 600, orderItemHistory)\n initTechnicalDataModal($('#task-delivery-transfer-logs'), $('#task-delivery-transfer-logs-modal'), 'delivery_transfer_logs')\n initTechnicalDataModal($('#task-origin-orders'), $('#task-origin-orders-modal'), 'origin_orders')\n initTechnicalDataModal($('#task-logs'), $('#task-logs-modal'), 'webhook_logs')\n initIgnoreVisitWarningBtn($('.ignore-visit-warning-btn'))\n }\n\n if (body.hasClass('tasks show')) {\n initProductSelect()\n }\n\n if (body.hasClass('tasks street_view')) {\n const mapDiv = document.getElementById('street-view');\n\n const loader = new Loader({\n apiKey: gon.map_key,\n version: 'weekly',\n language: i18n.locale\n })\n\n loader.load().then((google) => {\n new google.maps.StreetViewPanorama(mapDiv, {\n position: { lat: parseFloat(gon.latitude), lng: parseFloat(gon.longitude) },\n pov: { heading: 165, pitch: 0 },\n zoom: 1\n });\n })\n }\n\n Ladda.bind('.ladda-button')\n\n if ($('#tasks-table2').length > 0) {\n renderTasksTable(gon.is_company)\n }\n\n if ($('#tasks-table').length > 0) {\n const tasksTable = $('#tasks-table').DataTable({\n dom: '<\"top\"i>rt<\"bottom\"><\"clear\">',\n searchHighlight: true,\n bInfo: false,\n paging: false,\n order: [[1, 'desc']],\n responsive: true,\n language: defaultTranslations()\n })\n tasksTable.on('draw', () => {\n const body = $(tasksTable.table().body())\n\n body.unhighlight()\n body.highlight(tasksTable.search())\n })\n\n $('.table-search').on('input', search(tasksTable))\n }\n\n // disable form submission on enter stroke\n $('#new_task').on('keyup keypress', function (e) {\n const keyCode = e.keyCode || e.which\n if (keyCode === 13 && e.target.id != 'task_notes') {\n e.preventDefault()\n return false\n }\n })\n\n $('#assigned-btn').on('click', (event) => {\n event.target.innerHTML = ''\n })\n $('#active-btn').on('click', (event) => {\n event.target.innerHTML = ''\n })\n $('#completed-btn').on('click', (event) => {\n event.target.innerHTML = ''\n })\n $('#roundtrip-delivered-btn').on('click', (event) => {\n event.target.innerHTML = ''\n })\n\n $('#change-driver-visits-date-btn').on('click', () => {\n $('#change-driver-visits-date-model').modal('show')\n })\n\n $('#partial-task-edit-btn').on('click', e => {\n if (e.target.classList.contains('disabled') || e.target.parentElement.classList.contains('disabled')) {\n return false\n }\n $('#partial-task-edit-modal').modal('show')\n\n if ($('#task_company').length) {\n $('#task_company').select2({\n dir: i18n.t('direction'),\n width: '100%',\n dropdownCssClass: 'increasedzindexclass',\n matcher: function (params, data) {\n return matchStart(params, data)\n }\n })\n }\n\n if ($('#task_user_id').length) {\n const loaded_users = []\n const users = gon.company_users\n // loaded_users.push( { user_id: \"\", id: \"\", text: \"\", html: \"\"});\n for (let i = 0; i < users.length; i++) {\n // destination_street_array = destination_streets_array[i].split(',');\n users[i].email = users[i].email || ''\n users[i].name = users[i].name || ''\n users[i].username = users[i].username || ''\n\n loaded_users.push({\n user_id: users[i].id,\n id: users[i].id,\n html: ' ' + users[i].username + '  
' + users[i].name + ', ' + users[i].email + ' ',\n text: users[i].username,\n username: users[i].username,\n name: users[i].name,\n email: users[i].email\n })\n }\n\n $('#task_user_id').select2({\n dir: i18n.t('direction'),\n width: '100%',\n dropdownCssClass: 'increasedzindexclass',\n tags: true,\n templateResult: function (d) {\n if (d !== false) {\n return $(d.html)\n }\n\n return d.text\n },\n escapeMarkup: function (markup) {\n return markup\n },\n matcher: function (params, data) {\n return matchStart(params, data)\n },\n data: loaded_users\n })\n\n if (gon.selected_user != undefined) {\n $('#task_user_id').val(gon.selected_user).trigger('change')\n } else {\n if (gon.selected_other_user != null) {\n const newState = new Option(gon.selected_other_user, gon.selected_other_user, true, true)\n // Append it to the select\n $('#task_user_id').append(newState).trigger('change')\n }\n }\n }\n })\n\n $('.partial-task-edit-btn-submit').on('click', e => {\n e.preventDefault()\n\n if ($(e.target).parent().data('has-invoice-alert')) {\n Swal.fire({\n title: i18n.t('shared.are_you_sure'),\n text: i18n.t('models.task.has_invoice_warning'),\n icon: 'warning',\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonClass: 'btn btn-danger',\n confirmButtonText: i18n.t('shared.confirm'),\n cancelButtonText: i18n.t('cancel'),\n cancelButtonClass: 'btn btn-grey'\n }).then(async (result) => {\n if (result.isConfirmed) {\n $(e.target).closest('form').submit()\n } else {\n Ladda.stopAll()\n }\n })\n } else {\n $(e.target).closest('form').submit()\n }\n })\n\n $('#send-company-email-btn').on('click', () => { $('#send-company-email-modal').modal('show') })\n\n $( \"#send-company-email-modal\" ).on('show.bs.modal', function() {\n initializeQuillEditor('editor', 'quill_html');\n initializeQuillEditor('validation_message_editor', 'validation_message_quill_html');\n });\n\n let selected_status = getParameterByName('status')\n if (!selected_status) {\n selected_status = 'All'\n }\n $('#status-select').val(selected_status)\n $('#status-select').change(e => {\n const new_status = e.target.value\n const updated_url = updateQueryStringParameter(window.location.href, 'status', new_status)\n window.location.href = updated_url\n })\n\n if (body.hasClass('tasks index') || body.hasClass('reports lates')) {\n $('.report-tasks-btn, .email-report-tasks-btn').click((e) => {\n $('#form-report-email').attr('action', e.target.dataset.url)\n $('.filtered-task-ids').val(gon.task_ids.join(','))\n })\n $('.report-tasks-btn').click(() => setTimeout(() => {Ladda.stopAll()}, 3000))\n\n initDateRangePicker($('.daterangepicker-init'))\n $('#order-items-table').data('taskIds', gon.task_ids.join(','))\n renderOrderItemsTable(true)\n setFocusOnSearchBoxForCompanies();\n }\n\n const selected_timy_by = gon.time_by\n $('#determination-date-select').val(selected_timy_by)\n $('#determination-date-select').change(e => {\n const new_time_by = e.currentTarget.value\n const updated_url = updateQueryStringParameter(window.location.href, 'time_by', new_time_by)\n window.location.href = updated_url\n })\n\n const from_date = getParameterByName('from_date')\n if (from_date) {\n $('#from_datepicker').val(from_date)\n }\n\n const to_date = getParameterByName('to_date')\n if (to_date) {\n $('#to_datepicker').val(to_date)\n }\n\n if (gon.non_workdays) {\n $('.input-group.workdays-only').datepicker({\n format: getDateFormat(),\n language: i18n.t('locale'),\n rtl: isRTL(),\n startDate: getFormattedDate(),\n defaultDate: getFormattedDate(),\n autoclose: true,\n todayHighlight: true,\n daysOfWeekDisabled: gon.non_workdays\n })\n }\n\n $('.input-group.simple').datepicker({\n format: getDateFormat(),\n language: i18n.t('locale'),\n rtl: isRTL(),\n orientation: 'bottom',\n startDate: getFormattedDate(),\n defaultDate: getFormattedDate(),\n autoclose: true,\n todayHighlight: true\n })\n\n $('.input-group.allow-past').datepicker({\n format: getDateFormat(),\n language: i18n.locale,\n rtl: isRTL(),\n orientation: 'bottom',\n defaultDate: getFormattedDate(),\n autoclose: true,\n todayHighlight: true\n }).on('hide', e => e.stopPropagation())\n\n $('.earliest-time').timepicker({\n minuteStep: 10,\n defaultTime: null,\n showMeridian: timepickerMeridian(),\n icons: {\n up: 'ki ki-arrow-up',\n down: 'ki ki-arrow-down'\n }\n })\n\n $('.latest-time').timepicker({\n minuteStep: 10,\n defaultTime: null,\n showMeridian: timepickerMeridian(),\n icons: {\n up: 'ki ki-arrow-up',\n down: 'ki ki-arrow-down'\n }\n })\n\n $('#apply_custom_dates').click(function () {\n let from_date = $('#from_datepicker')[0].value;\n (from_date == '') ? from_date = '01/01/2000' : null\n let to_date = $('#to_datepicker')[0].value\n to_date == '' ? to_date = getFormattedDate() : null\n const base_url = window.location.href.split('?')[0]\n const time_by = getParameterByName('time_by')\n\n window.location.href = base_url + '?interval=custom_dates&from_date=' + from_date + '&to_date=' + to_date + '&time_by=' + time_by\n })\n\n // share date from ReactNative WebView to react native app\n if (body.hasClass('tasks driver_tasks')) {\n const driver_id = gon.driver_id\n const token = $('meta[name=\"csrf-token\"]').attr('content')\n const driver_data = JSON.stringify({ driver_id: driver_id, token: token })\n\n onWebViewBridgeReady(function () {\n window.postMessage(driver_data)\n })\n }\n\n if (body.hasClass('public_pages validate_task_details')) {\n const mapContainer = document.getElementById('edit_geolocation_map')\n if (mapContainer) initMap(mapContainer, geolocationMapCallback(gon.latitude, gon.longitude, '#task_destination_latitude', '#task_destination_longitude'))\n\n $('.get-current-location').click(() => {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(moveMapToPosition, showError);\n } else {\n alert(\"The Browser Does not Support Geolocation\");\n }\n\n function moveMapToPosition(position) {\n $('#task_destination_latitude').val(position.coords.latitude)\n $('#task_destination_longitude').val(position.coords.longitude).trigger('input')\n }\n\n function showError(error) {\n if(error.PERMISSION_DENIED){\n alert(\"The User have denied the request for Geolocation.\")\n }\n }\n })\n }\n\n // populate partial edit modal\n $('#task_pickup_at_date').val(gon.pickup_at_date)\n\n if ($('.print-on-open')[0]) {\n window.print()\n }\n\n initTooltips($('.visit-tooltip'), '/visits/:id/fetch_visit_history_json', 600, visitHistory)\n\n const printLabelsForSelectedButton = $('.print-labels-for-selected')\n const printAllLabelsButton = document.getElementById('print-all-labels')\n const printReturnLabelsButton = $('#print-return-labels')\n const continuePrintLabelsButton = document.getElementById('continue-print-labels-button')\n\n $(document).on('change', '.bulk-task-checkbox', function () {\n if (this.checked) checkedSet.add($(this).attr('task-id'))\n else checkedSet.delete($(this).attr('task-id'))\n\n $('.hidden-tasks').val([...checkedSet].join(','))\n updatePrintLabelsForSelected()\n })\n\n printReturnLabelsButton.click((e) => {\n e.preventDefault()\n $('#labels-on-page-modal').modal('show')\n $('.hidden-tasks').val(gon.task_ids.join(','))\n $('#return_only').val('true')\n })\n\n if (printLabelsForSelectedButton) {\n printLabelsForSelectedButton.click(event => {\n event.preventDefault()\n if (!checkedSet.size) {\n return false\n }\n continuePrintLabelsButton.removeAttribute('disabled')\n $('#labels-on-page-modal').modal('show')\n $('.hidden-tasks').val([...checkedSet].join(','))\n $('#return_only').val('')\n })\n }\n\n if (continuePrintLabelsButton) {\n continuePrintLabelsButton.onclick = () => {\n $('#labels-on-page-modal').modal('hide')\n }\n }\n\n if (printAllLabelsButton) {\n printAllLabelsButton.onclick = event => {\n event.preventDefault()\n continuePrintLabelsButton.removeAttribute('disabled')\n $('#labels-on-page-modal').modal('show')\n if (gon.task_ids) {\n $('.hidden-tasks').val(gon.task_ids.join(','))\n } else {\n $('.hidden-tasks').val(gon.tasks.map(task => task[0]).join(','))\n }\n $('#return_only').val('')\n }\n }\n\n $('.select-all-checkboxes').click((e) => {\n const $checkboxes = $('.bulk-task-checkbox')\n $checkboxes.prop('checked', e.target.checked)\n\n if (e.target.checked) $checkboxes.each((_, box) => checkedSet.add(box.getAttribute('task-id')))\n else checkedSet.clear()\n\n $('.hidden-tasks').val([...checkedSet].join(','))\n updatePrintLabelsForSelected()\n })\n})\n\nexport const updatePrintLabelsForSelected = () => {\n $('.print-labels-for-selected').toggleClass('disabled', !checkedSet.size)\n}\n\nfunction onWebViewBridgeReady (cb) {\n if (window.postMessage.length !== 1) {\n setTimeout(function () {\n onWebViewBridgeReady(cb)\n }, 100)\n } else {\n cb()\n }\n}\n\nfunction updateQueryStringParameter (uri, key, value) {\n const re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i')\n const separator = uri.indexOf('?') !== -1 ? '&' : '?'\n if (uri.match(re)) {\n return uri.replace(re, '$1' + key + '=' + value + '$2')\n } else {\n return uri + separator + key + '=' + value\n }\n}\n\nconst mapCallback = map => {\n const numberIcon = L.divIcon({\n className: 'blue-number-icon',\n iconSize: [29, 47],\n iconAnchor: [15, 47]\n })\n const driverIcon = L.divIcon({\n className: 'driver-icon',\n iconSize: [30, 30],\n iconAnchor: [22, 15]\n })\n\n const markers = []\n for (const loc in gon.locations) {\n const location = gon.locations[loc]\n if (location.latitude) {\n const marker = L.marker([location.latitude, location.longitude], { icon: numberIcon })\n .bindPopup(buildTip({ name: location.name, address: location.partial_address })).openPopup().addTo(map)\n markers.push(marker)\n }\n }\n\n if (gon.driver_location) {\n const { latitude, longitude } = gon.driver_location\n const driverMarker = L.marker([latitude, longitude], { icon: driverIcon }).addTo(map)\n markers.push(driverMarker)\n }\n\n if (markers.length) {\n map.fitBounds(L.featureGroup(markers).getBounds(), { padding: [10, 10] })\n }\n}\n\nexport const setFocusOnSearchBoxForCompanies = (klasses = ['company-filter']) => {\n klasses.forEach((klass) => {\n $(`.${klass}-btn`).on('click', function () {\n setTimeout(function() {\n $(`.${klass} .dropdown-search`).focus();\n }, 1);\n });\n });\n}\n\nexport const initCallRecordingSections = () => {\n $('.call_recording_sections').each(function(i, obj) {\n const div = $(obj);\n const callId = div.data('call-id');\n const duration = $(`#waveform_timer_${callId}`).data('duration')\n var wavesurfer = WaveSurfer.create({\n container: `#${div.attr('id')}`,\n waveColor: '#c9dcef',\n progressColor: '#3699FF',\n barWidth: 2,\n barHeight: 2,\n barGap: null\n });\n\n $(`#waveform_timer_${callId} .duration`).text(`(${secondsToTimestamp(duration)})`)\n\n wavesurfer.on('loading', function(x) {\n if(x == 100) {\n var loader = $('#audio_preloader_' + callId)\n loader.removeClass('justify-content-center d-flex')\n loader.addClass('d-none')\n }\n });\n\n wavesurfer.load(div.data('call-url'));\n\n wavesurfer.on('ready', function() {\n $(`#play_${callId}`).click(function() {\n $(this).toggleClass('d-none');\n $(`#pause_${callId}`).toggleClass('d-none');\n wavesurfer.play();\n })\n\n $(`#pause_${callId}`).click(function() {\n $(this).toggleClass('d-none');\n $(`#play_${callId}`).toggleClass('d-none');\n wavesurfer.pause();\n })\n });\n\n wavesurfer.on('ready', function(){ updateTimer(callId, wavesurfer) });\n wavesurfer.on('audioprocess', function(){ updateTimer(callId, wavesurfer) });\n wavesurfer.on('seek', function(){ updateTimer(callId, wavesurfer) });\n });\n}\n\nfunction updateTimer(callId, wavesurfer) {\n var formattedTime = secondsToTimestamp(wavesurfer.getCurrentTime());\n $(`#waveform_timer_${callId} .time`).text(formattedTime);\n}\n\nfunction secondsToTimestamp(seconds) {\n seconds = Math.floor(seconds);\n var h = Math.floor(seconds / 3600);\n var m = Math.floor((seconds - (h * 3600)) / 60);\n var s = seconds - (h * 3600) - (m * 60);\n\n h = h < 10 ? '0' + h : h;\n m = m < 10 ? '0' + m : m;\n s = s < 10 ? '0' + s : s;\n var time = h == '00' ? m + ':' + s : h + ':' + m + ':' + s;\n return time\n}\n\nexport const initProductSelect = () => {\n $('#products-select').select2({\n dir: i18n.t('direction'),\n width: '100%',\n ajax: {\n url: '/products/select_search',\n dataType: 'json',\n method: 'post',\n delay: 250,\n data: (params) => ({\n search: params.term,\n page: params.page || 1\n })\n },\n templateResult: (p) => (p ? `${dataOrNA(p.sku)} - ${dataOrNA(p.name)}` : ''),\n templateSelection: (p) => (p ? `${dataOrNA(p.sku)} - ${dataOrNA(p.name)}` : ''),\n })\n}\n\nexport const initAddProductButtonEvent = () => {\n $('.add-product-btn').on('click', () => {\n const selectedProduct = $('#products-select').select2('data')[0]\n if (!selectedProduct) return\n\n $('.order-items-container:visible .order-items-actions a.add_fields').first().trigger('click')\n const newRow = $('.order-items-container:visible .order-item-row').last()\n newRow.find('.order-item-sku').val(selectedProduct.sku)\n newRow.find('.order-item-name').val(selectedProduct.name)\n newRow.find('.order-item-weight').val(selectedProduct.weight)\n })\n}\n\nexport const deleteTaskPhoto = (elem) => {\n Swal.fire({\n title: i18n.t('views.tasks.pod_image_delete_confirm'),\n icon: 'warning',\n showCancelButton: true,\n showCloseButton: true,\n confirmButtonText: ` ${i18n.t('delete')}`,\n cancelButtonText: i18n.t('cancel'),\n }).then(async (result) => {\n if (result.isConfirmed) {\n const url = elem.dataset.url;\n const imageContainer = $(elem).parent();\n const loader = $('.data-preloader');\n loader.removeClass('d-none');\n\n fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json',\n 'X-CSRF-TOKEN': document.head.querySelector('meta[name=\"csrf-token\"]').content }\n }).then(res => res.json()).then(_json => {\n $(imageContainer).remove();\n showNotification({message: i18n.t('deleted_successfully')});\n loader.addClass('d-none');\n })\n } else {\n Ladda.stopAll();\n }\n })\n}\n"],"names":["_gon","gon","locale","slice","require","dayjs","customParseFormat","advancedFormat","weekday","localeData","weekOfYear","weekYear","utc","timezone","duration","isToday","isYesterday","setDefault","$","is_company","pusher","Pusher","key","cluster","authEndpoint","auth","headers","attr","task_created_notify","task_failed_notify","xhr","initXhr","audioCtx","window","AudioContext","webkitAudioContext","XMLHttpRequest","open","responseType","addEventListener","decodeAudioData","response","then","audioBuffer","source","createBufferSource","buffer","connect","destination","loop","start","catch","e","console","log","channel","subscribe","pusher_channel_name","bind","data","_xhr","showNotification","message","i18n","t","id","task_id","send","_xhr2","task_url","company","Object","entries","reason","driver","driver_note","filter","_data$key","length","map","translation","join","type","delay","on","preventDefault","unbind","click","async","modalContainer","url","currentTarget","dataset","fetch","csrfToken","method","res","status","text","html","children","modal","Ladda","location","href","language","updateQueryStringParameter","change","input","value","dateOrCurrent","keyup","blur","select2","dir","width","matcher","params","matchStart","result","original_matcher","fn","defaults","toLowerCase","includes","term","baseUrl","getPathFromUrl","replace","target","isFolded","classList","contains","document","cookie","fullscreenElement","exitFullscreen","documentElement","requestFullscreen","timepicker","minuteStep","defaultTime","showMeridian","timepickerMeridian","icons","up","down","initColorPicker","hex","el","style","background","stopPropagation","val","closest","find","i","toggle","indexOf","initHoverCopy","temp","append","copy","select","execCommand","remove","radio","css","parseFloat","this","which","is_organization","_$$","_$$get","_$$get2","get","initPasswordToggle","scroller","querySelector","dropdowns","handleAsideScroll","each","_i","topPosition","parentNode","getBoundingClientRect","top","offset","offsetHeight","innerHeight","transform","scrollTop","$el","addClass","removeClass","toggleClass","confirm_task_transfers","form","driverId","orgDrivers","fetchJSON","JSON","stringify","ids","driver_ids_to_load","d","parseInt","partner_bridge_id","initTransferConfirmation","transferDetails","submit","Array","from","files","forEach","file","match","_e$clickEvent","clickEvent","tooltip","initDateRangePicker","loader","_$$get3","_$$get4","selectedCount","updateFloatingActionsVisibility","trim","toggleSideBarButton","sideBar","pageContent","pageFooter","innerWidth","add","onclick","isRTL","setTimeout","setProperty","marginLeft","marginRight","initFilters","table","initServerFilter","filterDate","datepicker","format","getDateFormat","orientation","rtl","autoClose","todayHighlight","clearBtn","searchObj","searchArr","push","name","filterValues","date","moment","obj","column","search","draw","initStoreVisitFilters","recountFilters","recountStoreVisitFilters","filteredData","rows","toArray","task_ids","row","filtersData","f","filterOptions","optionsFunctions","optionsFunction","options","NA","initCustomFilter","inputs","columnName","initFilter","columnIndexByName","appliedFilters","columns","every","index","filterNames","keys","recountFilter","Map","o","count","optionsMap","has","initOptions","reduce","acc","option","dataOrNA","initStatusOptions","statuses","allow_inventory","initTimeWindowOptions","timeWindows","timeWindow","initUrgencyOptions","visits","dataModifier","Set","visit","getPropertyByPath","j","v","sort","a","b","booleanOptions","trueValue","falseValue","optionsStatus","s","task","optionsDriver","drivers","arr","full_name","ext_service_name","driver_name","unshift","driver_id","org_drivers","active","optionsTimeWindow","optionsPickStatus","pick_status","validationOptions","validation_status","optionsValidation","_visit$route","route","_i$route","_i$route2","optionsRoute","optionsUrgency","u","urgency","addressPrecisionOptions","ADDRESS_PRECISIONS","precision","precision_status","deliveryVisits","kind","destinationZipCodes","otherVisitsCount","destinationNames","extraToFilters","custom_fields","customFields","field","toString","currentFilters","applyFilters","filters","escapeSelector","body","hasClass","renderedVisits","visitProxyObjects","renderExtendedVisitsTable","operatorTable","DataTable","drawCallback","setUpTaskPanelView","defaultDate","getFormattedDate","autoclose","initVisitDriversSelect","initVisitPickUpAtDatepicker","off","taskId","newStatus","updateTaskStatus","initComplete","settings","json","recordsTotal","bInfo","dom","processing","serverSide","lengthChange","pageLength","pagination_size","zeroRecords","infoEmpty","lengthMenu","info","infoFiltered","paginate","first","last","next","previous","ajax","responsive","order","render","_data","_type","formattedDate","created_at","formattedTime","company_name","title","renderSmallAjaxStatus","is_roundtrip","allow_urgency","createdCell","td","_cellData","urgency_color","defaultContent","orderable","pickup","cellData","rowData","delivered_at","city","region_name","visit_at","delivery","return","completed_at","keyCode","unhighlight","highlight","setFocusOnSearchBoxForCompanies","visit_ids","full_visits","initStoreVisitsPage","sum_str","checkedSet","tasksCount","size","$form","Swal","icon","showCancelButton","showCloseButton","confirmButtonClass","cancelButtonClass","confirmButtonText","cancelButtonText","isConfirmed","storeVisitsTable","storeVisitsMap","mapContainer","getElementById","initMap","mapCallback","L","control","lasso","position","intersect","addTo","renderStoreVisitsTable","columnNames","names","visibleColumnsIndexes","visible","visibleColumns","header","visitIds","visit_id","handleTableSpace","adjustTableSpaceWithMap","mapPanel","onPanelOpen","markersRebuild","initSidePanel","initPanelMapMoving","getParameterByName","kind_text","_e","parse","sessionStorage","getItem","selectedIds","prop","trigger","taskIds","openGettModal","reload","openWoltModal","openGetPackageModal","orderItemsSummaryModal","showOrderItemsSummaryModal","drawFilterPresets","localStorage","savedFilterPresets","inputLabel","inputPlaceholder","heightAuto","customClass","confirmButton","buttonsStyling","inputValidator","preset","setItem","initCreateRouteModal","initTable","allCheckboxes","checkedCheckboxes","updateTaskIds","getAttribute","scanningTable","searchHighlight","paging","defaultTranslations","initial_tasks","initTaskDriversSelect","initTaskPickUpAtDatepicker","checkedCount","packagesQuantity","handleTaskPickStatusModal","updateTaskPickStatus","driverName","pickStatus","renderPickStatusAjax","packages_quantity","className","allow_picking","map_name","extra","checked","allTaskIds","history","pushState","enableScanner","addNewTask","onSuccess","onError","task_code","currentTaskIds","error","showSweetAlertMessage","Audio","play","showScanningModal","BarcodesScanner","barcodeData","onManualTaskAddition","taskIdInput","initEscButtonEvent","statusClass","m","fields","wp_order_id","pickup_at","region_str","container","show","hide","presets","presetName","p","reverseButtons","cancelButton","eachLayer","layer","markers","buildMarkers","buildUnitedMarker","buildSingleMarker","boundMarkers","divIcon","iconSize","iconAnchor","marker_color","ambiguousMarkerAddition","contentString","constructFancyInfoWindowContent","marker","lat","lon","opacity","bindPopup","openPopup","allow_routes","initRoutesSelect","onRouteUpdate","onDriverUpdate","firstVisit","latitude","longitude","popup","allow_companies","recipient_name","numberedSvgMarker","parent","parents","htmlPopup","drawLinePolygons","lines","enableDrawTool","polygon","transformCoords","getLatLngs","routes_to_plot","polyline","featureGroup","decodePolyline","POLYLINE_OPTIONS","color","arrowheads","ARROWHEADS_OPTIONS","setupMapPanelViewLink","new_driver","new_marker_color","new_route","fitBounds","getBounds","padding","alert","nativeAlert","warn","initTabs","initializeQuillEditor","contentField","content","previewModal","jQuery","validator","addMethod","element","currentStickyCard","onTabChange","tab","scrollTo","updateCurrentStickyCard","validate","rules","required","maxlength","noSpace","messages","amount","behavior","pre_verified_phone_id","FB","login","authResponse","code","access_token","stopKeydownPropagation","confirmButtonColor","config_id","response_type","override_default_response_type","extras","setup","solutionID","preVerifiedPhone","elem","updateSmsLengthWarning","renderDynamicVariableModal","allow_sms","smsModal","initSmsTemplatesSelect","dynamicVariableModal","smsLength","smsText","initStatusSummaryChart","initDailyProgressChart","colorMapping","STATUSES","seriesMapping","initMonthlyChart","monthly_chart_data","loadOnboarding","preloader","lng","address","invalidateSize","create","hexColor","tagName","initCityStreetSelect","valid","locations","locationIds","checkbox","locationId","set","locationsTable","columnDefs","targets","selected","selectedLocations","geolocationMap","geolocationMapCallback","redirectUrl","redirection","location_name","location_partial_address","numberIcon","latLngBounds","getLatLng","billingTable","billing2Table","fixedHeader","headerOffset","height","initBilling2Table","sortBy","color_urgent","color_super_urgent","colorpicker","hexaColor","toHex","isRtl","createChart","tasks_per_month","months","tasks_per_day","days","sms_per_month","sms_per_day","companies_per_month","drivers_per_month","daily_routes_per_day","renderStatisticsCharts","email","initializeUsersTable","activityTable","initImageInput","iframe","iframeLoader","updatePreview","debounce","values","serializeArray","setPropertyByPath","encodeURIComponent","organization","tabName","formTab","reasonId","deleteSweetAlert","number","phoneId","skillId","navigator","platform","orgUsersTable","xAxis","seriesName","xAxisLabelsOffsetY","xAxisLabelsOffsetX","series","chart","direction","plotOptions","bar","borderRadius","dataLabels","enabled","align","grid","colors","xaxis","categories","labels","offsetY","offsetX","ApexCharts","deviceId","symbology","timestamp","dataLength","tmpTimestamp","tmpData","charCode","String","fromCharCode","keycode","Date","now","onScannerNavigate","origin","initTaskPanelView","onOpen","offcanvas","taskOffcanvas","initArrowFunction","initTaskPhotoModal","numberOnly","test","success","searchedTaskId","executeTaskPanelView","dropdownCssClass","templateResult","org_routes","r","escapeMarkup","markup","selectedVisits","orderChanged","pendingVisitsChanged","fillMoneyTransferredSum","initCodStatusDropdown","patternsSelect","$checkboxes","_","box","clear","calculateVisitsSummary","updateBulkEdit","chekcedVisits","ch","sumitBulkSmsForm","gripContainers","deliveriesTableBody","klass","querySelectorAll","drake","dragula","moves","_source","handle","accepts","_el","_target","sibling","tbodyId","td_width","offsetWidth","saveDailyRoutePlanVisitsSchedule","renderOrderItemsTable","visitId","earliestTime","latestTime","visitType","earliestAt","latestAt","earliest_at","latest_at","initTooltips","not","taskSmsTooltip","multi_timeline","startTime","actual_start_time","start_time","endTime","actual_end_time","end_time","initMultiRouteTimeline","initRouteTimeline","timeline","routeId","historyModal","hideWarning","is","route_ids","idx","routesMap","routesTable","api","dataTable","Api","initRouteDriversSelect","initRouteVehiclesSelect","initRouteAssistantDriverSelect","orderDataType","stateSave","colReorder","fixedColumnsLeft","stateDuration","stateSaveParams","_settings","buttons","extend","initCustomColvis","ext","col","nodes","routeIds","init","snapshot","idsSnapshot","currentSnapshot","arrayXor","capitalize","_idx","Promise","all","activeRouteId","activeRouteLocked","activeRouteMaxWeight","unsavedChanges","initRoutesIndexTable","routeVisitsTable","initRouteVisitsTable","initUnassignedVisitsTable","unassigned_visits","confirm","locked","maxWeight","routeName","order_id","updateWeightProgress","weight_number","dragAndDrop","containers","currentOrder","to","rowId","fromTable","toTable","reorderTable","fromEntries","cell","elemId","clearOtherCheckboxes","delete","event","positiveVisits","visitsInPolygon","visits_data","updateCheckboxes","polygonVisits","removeAttr","elements","elemIndex","splice","currentWeight","after","percents","backgroundClass","backgroundByPercents","toFixed","maxZoom","featureGroups","routes","allMarkers","decodedPolyline","startEndMarkers","createStartEndMarkers","bounds","shift","fg","dest_add","destination_phone","phone","totalSurfaces","totalWeight","totalVolume","isChecked","controlLayers","optimized","undoneMarkers","renderNumberedUnitedMarkers","undone_visits","undone","completedMarkers","done_visits","doneMarkers","done","failedMarkers","failed","doneRoute","done_route","undoneRoute","undone_route","undoneFG","doneFG","failedFG","startEndFG","undoneRouteFG","overlays","layers","locationsApiPoll","show_ituran_route","showIturanRoutes","route_id","placeholder","routePlanMap","routePlanTable","initRoutesTable","initVehiclesDropdown","saveDailyVisitsSchedule","routeDatepicker","createStartEndMarkersPlanned","start_point","end_point","isDev","route_date","dailyRoutesMap","country","is_wix","is_shopify","tileLayer","attribution","tableElem","underscoredElemId","replaceAll","call","ajaxForm","availableContentSpace","handleDragScroll","scrollableContainer","isDragging","shouldScrollTop","shouldScrollBottom","timeoutId","checkScroll","currentY","clientY","bottom","clearTimeout","deltaY","organization_id","orgId","company_id","companyId","activeTaskId","visit_kind","visit_is_done","task_details","task_driver_id","token","credentials","dataType","contentType","order_time","packages","surfaces","cartons","roundtrip","source_notes","destination_notes","source_name","destination_name","source_floor","source_apartment","destination_floor","destination_apartment","source_recipient_name","source_phone","destination_recipient_name","source_latitude","source_longitude","destination_latitude","destination_longitude","notes","document_number","signee_name","wait_time","vehicle_kind","money_collect","greeting","payment_method","innerHTML","wp_order_items","orderItemsTable","quantity","tableData","createElement","tableBody","cssText","appendChild","createTextNode","createTableOrderItems","toggleField","not_done_button","done_button","empty","assign_button","active_button","roundtrip_delivered_button","completed_button","href_string","source_waze_url","destination_waze_url","isEmpty","toggleFieldWithHtml","canvas","signaturePad","SignaturePad","backgroundColor","taskDetails","setAttribute","base64_string","toDataURL","signature","originalEvent","reader","FileReader","onload","base64String","photo_url","readAsDataURL","tooltipster","contentAsHTML","animation","maxWidth","interactive","functionInit","instance","helper","list","item","head","import_config","start_row","pagination_enabled","selectedFileName","fileName","textContent","scrollToBottom","messageDiv","animate","scrollHeight","setChatBoxHeight","screenHeight","chatBoxHeight","Math","round","chatBoxs","divElem","allow_ticketing","ticket_id","tickets","prepend","unreadDivId","notificationIconElem","unreadCount","notification","cookiesEu","cookiesEuOKButton","addListener","attachEvent","setCookie","isSecure","protocol","Cookies","path","expires","setFullYear","getFullYear","secure","removeChild","dispatchEvent","CustomEvent","isReady","param","optional","dates","daysShort","daysMin","monthsShort","today","registerPlural","setter","iterator","aoColumns","undefined","sName","_window$Rollbar","Rollbar","configure","master_session","dropdown","$search","focus","mainConfig","user_mode","fetchConfigAction","updateTasksDriver","callback","spinner","currentStatusElement","currentStatusTextElement","checks","statusChangeChecks","shouldContinue","updatedStatus","new_status","complete","new_task_status","isTaskTransferred","transferConfirmResult","cancelTransferConfirmation","keep_transfer_connection","new_pick_status","isRemote","packagesQuantityInput","printLabels","print","updateCodStatus","codUpdate","$container","valueStr","valueName","menuButton","cod","_chatAsideEl","KTAppChat","KTUtil","getById","KTOffcanvas","overlay","baseClass","toggleBy","cardScrollEl","cardBodyEl","searchEl","scrollInit","mobileNativeScroll","desktopNativeScroll","resetHeightOnDestroy","handleWindowResize","rememberPosition","isBreakpointUp","KTLayoutContent","getHeight","getViewPort","_initAside","ready","defaultSeriesMapping","colorsMapping","year","month","daily_data","dailyData","days_amount","daysCount","reverse","stacked","toolbar","zoom","yaxis","tickPlacement","legend","inverseOrder","shared","x","formatter","day","fill","breakpoint","total","hasNoData","isDailyProgress","events","dataPointSelection","chartContext","config","dataPointIndex","pie","donut","label","noData","fontSize","opts","w","globals","seriesIndex","itemMargin","vertical","states","hover","stroke","completed","uncompleted","complete_percents","completePercents","daily_progress_chart_data","mainColors","labelColors","startAngle","endAngle","showAlways","_val","initCompanyOverviewChart","borderRadiusApplication","axisTicks","categoryLabels","uppercase","timelineData","routeStartTime","routeEndTime","y","toDate","getTime","chartWidth","horizontal","barHeight","rangeBarGroupRows","min","max","custom","y1","y2","_timelineData$actual","plannedSeries","planned","actualVisits","actual","flatMap","_v$visits","seriesData","startTimestamp","endTimestamp","fillColor","orders","plannedStop","Boolean","horizontalAlign","customLegendItems","fillColors","dataObj","fromDate","initLateReportsPieChart","divId","displaySelectedDataTable","pie_chart_data","_event","seriesTitle","israelCities","load_cities","resolve","ISRAEL_CITIES_URL","initCitySelect","city_select","city_other","city_other_btn","city_other_content","loadedCities","toggleOther","chosen_city","street_select","street_other","street_other_btn","street_other_content","$select","streets","cityId","cityStreets","args","city_id","chosen_street","defaultColor","extensions","namesAsValues","cpContainer","colvis","saveTableOrderConfig","fixedColumns","spacePerColumn","minWidth","columnsCount","tableWidth","mapWidth","availableWidth","neededWidth","emptySpace","sortOrder","translations","enableTableHighlight","tables","actions","stop","queue","imageWrapper","URL","createObjectURL","initCropper","preview","fakeInput","realInput","modalImage","cropButton","cropper","src","Cropper","aspectRatio","viewMode","destroy","imageData","getCroppedCanvas","$elements","onTaskStatusUpdate","onPickupAtUpdate","shiftKey","ctrlKey","panelViewMap","driverLocation","initTaskPanelViewMapContainer","visitHistory","orderItemHistory","initTechnicalDataModal","initIgnoreVisitWarningBtn","initProductSelect","initAddProductButtonEvent","initDriversDropdown","new_driver_name","returned_by_driver_at","returned_to_company_at","initOffcanvasEditableFields","reloadPanel","initRoutesDropdown","initTaskCancelButton","syncShopifyOrder","initTaskGeolocationsEditModal","initTaskSmsButton","modals","onAjaxSuccess","onAjaxError","_id","initTaskPanelViewTabs","showOrderItemPickingModal","deleteTaskPhoto","_taskId","tabLink","initCallRecordingSections","detail","wrappers","wrapper","fieldName","textEl","initialValue","textToShow","isValueShown","toggleMode","isEditEnabled","circle","support_destinations_only","is_geo_fenced","fillOpacity","radius","markerOptions","draggable","locationType","ogLat","ogLon","buildTip","setLatLng","updateLatlongToVisits","driverIcon","driverMarker","partial_address","newPosition","asyncUpdateTask","newLatLng","LatLng","reject","_error","Quill","register","Header","Toolbar","Snow","Bold","Italic","Underline","Strike","DirectionClass","AlignClass","ColorClass","ColorStyle","Link","modules","editorId","inputId","editor","theme","editorText","textAlign","root","Event","mapObj","flyOnMapToCoordinates","stateSaveCallback","stateLoadCallback","ordering","allRoute","concat","startCoords","endCoords","pop","startMarker","endMarker","startIcon","endIcon","moneySum","moneyCollects","codSum","codStatus","returnedCodSum","partialSum","innerText","createdRow","autoWidth","show_visit_kind","allow_surfaces_quantity","class","trips","ituran_routes","actualRoute","stopIndex","_index","stops","circleMarker","numberedIcon","renderNumberedStopIcon","time","ituranOverlay","yawn","addOverlay","addDownloadCSVButton","waitTime","downloadCSV","csvContent","speed","event_name","blob","Blob","link","visibility","Control","DownloadButton","onAdd","button","DomUtil","DomEvent","colorPicker","reading","symbol","textarea","mapPolygons","selector","operatorStoreVisitsTable","updateRowDataByTask","status_name","updateRowData","new_visit_date","proxyObjects","pageCheckboxes","syncCheckedVisits","prev","deferRender","infoCallback","setting","end","pre","tooltipsTaskLink","is_photo_attached","signature_url","printed_at","comments","vip_client","created_at_epoch","allow_time_window","earliest_time","latest_time","searchable","add_no_city","_ADDRESS_PRECISIONS$r","allow_zip_code","invoice_id","statusName","refund_present","visitAt","visit_at_epoch","visitAtEpoch","visit_notes","visitNotes","notes_html","taskNotes","notesSummary","failure_reason","allow_agents","allow_loading","loaded","loaded_at","allow_self_pickup","allow_leave_next_to_door","allow_money_collect","show_reviews","allow_order_items","allow_orders","orderCodes","order_codes","orders_count","truncatedOrderCodes","split","allow_gifter","allow_weight","allow_volume_constraint","allow_packages_quantity","precisionStatus","_ADDRESS_PRECISIONS$p","allow_origin_partner_company","smsAmount","display","allow_task_type","allow_vehicle_kind","allow_driver_salary","printedAt","field_type","updateRenderedVisits","uniqueTasks","self","findIndex","packages_summary","_task$packages_quanti","cartons_summary","_task$cartons_quantit","cartons_quantity","surfaces_summary","_task$surfaces_quanti","surfaces_quantity","text_arr","weight","volume","updatePrintLabelsForSelected","allSelected","transferredResult","visitsTransferStatus","any_transferred","hasRoute","dateInp","removeData","newData","visitData","taskData","lassoPolygon","latLngs","visitsInLassoPolygon","geojson","split_geojson","split_point","inside","point","vs","xi","yi","xj","yj","isShown","_prevRow$find$","activeRow","prevRow","_nextRow$find$","nextRow","latlng","apiUrl","titleTxt","confirmBtnTxt","alertTxt","htmlText","initTableCheckboxes","checkboxesSelector","selectAllCheckboxSelector","unselectAllBtnSelector","allIds","onStateUpdate","onCheckboxUpdate","checkboxStates","filteredIds","checkboxes","filteredCheckboxes","currentPageCheckboxes","page","selectAllCheckbox","onUpdate","selectedCountFn","selectedIdsFn","tableId","node","syncSelectAllCheckbox","isArray","some","_checkboxStates$get2","state","unselectAll","_table","initCheckboxes","targetId","initSelectAllCheckbox","initUnselectAllBtn","syncCheckboxes","_checkboxStates$get","setFilteredIds","tablePreInitCheckboxes","checkboxesObj","columnWidth","colvisParent","dropdownMenu","colvisContainer","columnNameToIcon","dropdownPaddingX","maxHeight","itemHeight","ceil","outerHeight","sum","h","itemsPerColumn","contentWidth","overflowX","columnId","limited","searchOnLoad","filterName","titleEl","appliedFilterHtml","clearFilter","filterSearch","filterClear","allValues","checkedInputs","hasCheckedInputs","util","escapeRegex","searchRegex","orderItemsTableContainer","_gon$order_items","partPrint","initOrderItemsAsyncLoading","order_items","updateOrderItemsTableData","items","groupedOrderItems","transformed_name","collection","payload","groupedItems","initDataTableForOrderItems","initPartialPickButton","checkOrderItems","updateOrderItemPickStatus","initItemTable","initOrderItemTable","orderItemCheckbox","orderItem","itemChecked","itemQuantityInput","maxOrderQuantity","itemQuantity","bgColor","checkColor","ib","itemId","order_item","newPickStatus","task_status","package","pickStatusContainer","pickStatusText","_tableElement$data","_tableElement$data2","tableElement","loadedTaskIds","updateOrderItemsAsync","renderTasksTable","isCompanyTable","setTaskIDs","tasksTable","tasksTransferStatus","total_tasks","deferLoading","time_by","time_interval","pickupAt","completed_at_epoch","show_eta","urgency_name","allow_roundtrip","color_roundtrip","td_vehicle_type_cls","allow_to_see_drivers","external_service_name","show_notes","driver_notes","allow_task_fee_cost","allow_returned_pallets","allow_reviews","filterCompany","filterDriver","filterRoute","filterUrgency","filterRegion","filterLabelPrint","filterOriginPartnerCompany","packagesQuantitySum","searchedTasksIds","taskProxyObjects","$button","$modal","action","partner_bridge","btn","ignore_location_warning","ok","$element","$buttons","onComplete","initEditGeolocationMaps","deliveryMapContainer","taskGeolocationMap","sourceMapContainer","taskPickupGeolocationMap","dataFunction","tooltipContent","updateAnimation","functionBefore","$origin","objectId","resp","object","historyTooltip","versions","historyVersionRows","version","username","historyChangeRows","changes","old","new","sms_logs","driverAppInfoTooltip","appInfo","device_name","recent_active_at","device","deviceInfo","os","manufacturer","batteryIconClass","batteryLevelIconClass","battery_level","battery_charging","tooltipInfo","os_version","iconClass","showManufacturer","batteryLevel","batteryCharging","level","updateRegionsDriver","regionId","region","initPickUpAtDatepicker","strategy","siblings","updateTasksPickUpAt","updateVisitsPickUpAt","driversData","currentId","first_name","last_name","image","partner_bridge_image","partner_bridge_name","partnerDrivers","routesData","initSelect","initRegionDeliveryDriversSelect","initRegionPickupDriversSelect","initRegionReturnDriversSelect","vehicles","dataParams","unassignTitle","disabled","customMatch","templateSelection","handleIntegrations","checksQueue","handleTransferCancel","handleTransferConfirm","check","updateVisitRoute","updateRouteDriver","assistant_driver_id","updateRouteAssistantDriver","delivery_driver_id","pickup_driver_id","return_driver_id","vehicleId","vehicle_id","updateRouteVehicle","additionalData","transfer_details","updateVisitsDriver","currentDriver","condition","allow_wolt","allow_gett","allow_get_package","optionId","previousDriverId","previousDriver","Fullscreen","_map","_toggleTitle","_click","toggleFullscreen","isFullscreen","include","_isFullscreen","getContainer","pseudoFullscreen","_disablePseudoFullscreen","mozCancelFullScreen","webkitCancelFullScreen","msExitFullscreen","_enablePseudoFullscreen","mozRequestFullScreen","webkitRequestFullscreen","Element","ALLOW_KEYBOARD_INPUT","msRequestFullscreen","_setFullscreen","fire","fullscreen","_onFullscreenChange","mozFullScreenElement","webkitFullscreenElement","msFullscreenElement","mergeOptions","fullscreenControl","addInitHook","fullscreenchange","addControl","onFullscreenChange","whenReady","_canvas","_ctx","getContext","_width","_height","_max","prototype","defaultRadius","defaultGradient","_circle","_r","shadowOffsetX","shadowOffsetY","shadowBlur","shadowColor","beginPath","arc","PI","closePath","gradient","createLinearGradient","addColorStop","fillStyle","fillRect","_grad","getImageData","clearRect","globalAlpha","drawImage","n","_colorize","putImageData","simpleheat","HeatLayer","Layer","Class","initialize","_latlngs","setOptions","setLatLngs","redraw","addLatLng","_heat","_updateOptions","_frame","_animating","Util","requestAnimFrame","_redraw","_initCanvas","_panes","overlayPane","_reset","zoomAnimation","Browser","any3d","_animateZoom","onRemove","getPanes","addLayer","testProp","getSize","containerPointToLayerPoint","setPosition","l","Bounds","c","getMaxZoom","pow","getZoom","g","_getMapPanePos","latLngToContainerPoint","floor","alt","minOpacity","getZoomScale","_getCenterOffset","center","_multiplyBy","subtract","setTransform","TRANSFORM","getTranslateString","heatLayer","KTAppSettings","breakpoints","sm","md","lg","xl","xxl","base","white","primary","secondary","warning","danger","light","dark","inverse","gray","PerfectScrollbar","KTApp","KTMenu","KTCookie","KTToggle","KTLayoutHeader","KTLayoutHeaderMenu","KTLayoutHeaderTopbar","KTLayoutBrand","KTLayoutAside","KTLayoutAsideToggle","KTLayoutAsideMenu","KTLayoutSubheader","KTLayoutFooter","KTProfile","KTImageInput","KTCard","metaKey","rails","refreshCSRFTokens","labelsAmount","failure_reason_id","has_twilio_calls","quantityInput","maxValue","currentValue","mapDiv","Loader","apiKey","map_key","load","google","maps","StreetViewPanorama","pov","heading","pitch","parentElement","loaded_users","users","company_users","user_id","tags","selected_user","selected_other_user","newState","Option","selected_status","updated_url","selected_timy_by","new_time_by","from_date","to_date","non_workdays","startDate","daysOfWeekDisabled","base_url","driver_data","onWebViewBridgeReady","postMessage","geolocation","getCurrentPosition","coords","PERMISSION_DENIED","pickup_at_date","printLabelsForSelectedButton","printAllLabelsButton","printReturnLabelsButton","continuePrintLabelsButton","removeAttribute","tasks","cb","uri","re","RegExp","separator","loc","driver_location","klasses","div","callId","wavesurfer","WaveSurfer","waveColor","progressColor","barWidth","barGap","secondsToTimestamp","pause","updateTimer","getCurrentTime","seconds","sku","selectedProduct","newRow","imageContainer","_json"],"sourceRoot":""}