<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* @public_path/build/carto.240d0f43.js */
class __TwigTemplate_975e10cf77c7827b3eb3b44595a097cd83a99df8c2a4fb21b0520fecb9d28e25 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@public_path/build/carto.240d0f43.js"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@public_path/build/carto.240d0f43.js"));

        yield "(self.webpackChunk=self.webpackChunk||[]).push([[786],{30591:(e,t,n)=>{\"use strict\";e.exports=n.p+\"images/legende.56e89d5f.png\"},44519:(e,t,n)=>{\"use strict\";e.exports=n.p+\"images/punaise-white.fbd71a1e.png\"},29497:(e,t,n)=>{\"use strict\";n(89554),n(54747),n(69720),n(26833),n(68304),n(30489),n(69826),n(74916),n(4723),n(73210),n(23123),n(57327),n(66992),n(41539),n(70189),n(78783),n(33948),n(92222),n(69600),n(15306),n(91058),n(21249),n(9653),n(28733),n(83710),n(68309),n(12419),n(78011),n(79753),n(82526),n(41817),n(32165),n(47042),n(91038),n(69070),n(47941),n(38880),n(49337),n(33321);var o=n(28),r=n(19530),c=n(50974),a=n(98966),i=n(39164),u=n(30254),s=n(44519),l=n(30591),d=n(82766),p=n(23068),f=n(44538),g=n(31219),m=n(20767),h=n(19755);function y(e){return(y=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}function b(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}(e)||O(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&(\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"]);if(null==n)return;var o,r,c=[],a=!0,i=!1;try{for(n=n.call(e);!(a=(o=n.next()).done)&&(c.push(o.value),!t||c.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==n.return||n.return()}finally{if(i)throw r}}return c}(e,t)||O(e,t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function O(e,t){if(e){if(\"string\"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array\$/.test(n)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=S(e);if(t){var r=S(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return k(this,n)}}function k(e,t){return!t||\"object\"!==y(t)&&\"function\"!=typeof t?function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var I={\"Domicile du technicien\":{text:\"?\",unicode:o.fM.home.unicode,font:o.fM.home.font,color:\"white\",img:c,pos:1},\"Dernière position connue du technicien\":{text:\"?\",unicode:o.fM.tech.unicode,font:o.fM.tech.font,color:\"white\",img:c,pos:1},Journée:{text:\"?\",unicode:\"?\",font:\"\",color:\"white\",img:a,pos:2},Matin:{text:\"?\",unicode:\"?\",font:\"\",color:\"white\",img:i,pos:2},\"Après-midi\":{text:\"?\",unicode:\"?\",font:\"\",color:\"white\",img:u,pos:2},\"En attente\":{text:\"?\",unicode:o.fM[0].unicode,font:o.fM[0].font,color:\"black\",img:s,pos:3},\"Reçu sur la tablette\":{text:\"?\",unicode:o.fM[1].unicode,font:o.fM[1].font,color:\"black\",img:s,pos:3},\"En cours\":{text:\"?\",unicode:o.fM[2].unicode,font:o.fM[2].font,color:\"black\",img:s,pos:3},Terminée:{text:\"?\",unicode:o.fM[3].unicode,font:o.fM[3].font,color:\"black\",img:s,pos:3}},T=function(e){!function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(n,e);var t=j(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,n);var r=document.createElement(\"div\");r.className=\"legend ol-control\";var c=document.createElement(\"a\");c.innerHTML='<img src=\"'+l+'\" alt=\"Légende\">',c.setAttribute(\"data-popup-id\",\"popup-carto-legende\"),c.setAttribute(\"data-popup-title\",\"Légende\"),c.setAttribute(\"data-popup-width\",\"auto\"),c.setAttribute(\"data-dxpopup\",\"\"),r.appendChild(c);var a=document.getElementById(\"legend-container-tech\"),i=document.getElementById(\"legend-container-interv\");a.innerHTML=\"\",i.innerHTML=\"\";var u={};return Object.entries(I).forEach((function(e){var t=x(e,2),n=t[0],o=t[1];u[o.pos]||(u[o.pos]=[]),u[o.pos].push(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({key:n},o))})),Object.values(u).forEach((function(e,t){var n=document.createElement(\"tr\");e.forEach((function(e){var t=document.createElement(\"td\"),r=document.createElement(\"div\");r.classList.add(\"me-2\",\"mb-2\"),r.style.display=\"flex\",r.style.alignItems=\"center\",r.style.gap=\"8px\";var c=new Image;c.width=24,c.height=32,(0,o.cl)(e.text,e.unicode,e.font,e.img,e.color,(function(e){c.src=e}));var a=document.createElement(\"span\");a.textContent=e.key,r.appendChild(c),r.appendChild(a),t.appendChild(r),n.appendChild(t)})),1===e[0].pos?a.appendChild(n):i.appendChild(n)})),t.call(this,{element:r})}return n}(r.Z);function C(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.getElementById(\"form_carto\"),r=new FormData(n);h.ajax({method:\"POST\",url:\"/map/filter_carto\",data:{name:e,site:r.get(\"site\"),groupes:r.get(\"selected_options_groupes\").split(\",\").map(Number),agents:r.get(\"selected_options_agents\").split(\",\").map(Number),date:r.get(\"date_tournee\")},dataType:\"json\",success:function(n){\"reset\"===e&&(t=!0),\"reset\"===e&&(document.querySelector(\"#etiquettes\").innerHTML=n.etiquettes,(0,o.K1)(n,t),n.groupes&&M(\"groupes\",n.groupes,\"typeNom\"),n.agents&&M(\"agents\",n.agents,\"codeNom\"),document.getElementsByName(\"date_tournee\")[0].value=(new Date).toISOString().split(\"T\")[0],document.querySelectorAll(\".checkbox-option\").forEach((function(e){return e.checked=!1})),document.querySelectorAll(\".selected-options\").forEach((function(e){return e.value=\"\"})),document.querySelectorAll(\".dropdown-button\").forEach((function(e){e.textContent=e.dataset.defaultText}))),n.interventions?(document.querySelector(\"#etiquettes\").innerHTML=n.etiquettes,document.querySelector(\"#selected_etiquettes\").value=r.get(\"selected_options_agents\"),(0,o.K1)(n,t)):(n.groupes&&M(\"groupes\",n.groupes,\"typeNom\"),n.agents&&M(\"agents\",n.agents,\"codeNom\")),h(window).trigger(\"resize\")}})}function M(e,t,n){var o=document.getElementById(\"dropdown-content-\".concat(e));o.innerHTML=\"\",t.forEach((function(t){var r=document.createElement(\"label\"),c=document.createElement(\"input\");c.type=\"checkbox\",c.name=\"options_\".concat(e,\"[]\"),c.value=t.id,c.classList.add(\"checkbox-option\"),r.appendChild(c);var a=t[n];r.appendChild(document.createTextNode(a)),o.appendChild(r)}))}h(document).ready((function(){o.UI.addControl(new T);var e=h(\"#map\");h(window).resize((function(){var t=148;t+=h(\"#etiquettes\").outerHeight(!0);var n=h(window).height()-t;e.css({height:n+\"px\",\"max-height\":n+\"px\"})})),h(window).trigger(\"resize\"),o.UI.addOverlay(o.Vz),o.UI.addOverlay(o.fI),(0,o.K1)(data,!0),o.UI.on(\"singleclick\",(function(e){(0,o.k\$)(e)})),h(\"#reset-form-carto\").on(\"click\",(function(e){e.preventDefault(),C(\"reset\")})),h(\"#submit-form-carto\").on(\"click\",(function(e){e.preventDefault(),C(\"submit\")})),h(\"select\").on(\"change\",(function(e){C(\"site\")})),h(\".dropdown-container\").each((function(){var e=h(this),t=e.find(\".dropdown-button\"),n=e.find(\".dropdown-content\"),o=e.find(\".selected-options\");t.data(\"defaultText\",t.text()),t.on(\"click\",(function(e){h(\".dropdown-content\").not(n).hide(),n.toggle(),e.stopPropagation()})),h(document).on(\"click\",(function(t){e.is(t.target)||0!==e.has(t.target).length||n.hide()})),n.on(\"change\",(function(e){if(h(e.target).hasClass(\"checkbox-option\")){var r=[],c=[],a=o.attr(\"name\").match(/selected_options_(\\w+)/);if(n.find(\".checkbox-option:checked\").each((function(){r.push(h(this).val()),c.push(h(this).parent().text().trim())})),a&&\"agents\"===a[1]){var i=o.val()?o.val().split(\",\"):[];h(e.target).is(\":checked\")||(i=i.filter((function(t){return t!==h(e.target).val()}))),r=b(new Set([].concat(b(i),b(r))))}o.val(r.join(\",\"));var u=t.data(\"defaultText\").replace(\"Sélectionnez des \",\"\").trim(),s=t.data(\"defaultText\");1===c.length?s=c[0]:c.length>1&&(s=\"\".concat(c.length,\" \").concat(u,\" sélectionnés\")),t.text(s),a&&\"groupes\"===a[1]&&C(a[1])}}))})),h(document).on(\"click\",\".remove-etiquette\",(function(e){var t=h(this).data(\"id\"),n=parseInt(h(this).data(\"agent\")),r=h(\"#\"+t);if(r.length){var c=h(\"[name='selected_options_agents']\"),a=c.val().split(\",\").map(Number);a=a.filter((function(e){return e!==n})),c.val(a.join(\",\"));var i=h('#dropdown-content-agents input[value=\"'.concat(n,'\"]'));i.prop(\"checked\",!1);var u=i.closest(\".dropdown-container\").find(\".dropdown-button\"),s=u.data(\"defaultText\").replace(\"Sélectionnez des \",\"\").trim(),l=\"\";1===a.length?l=i.closest(\".dropdown-container\").find('.checkbox-option[value=\"'.concat(a[0],'\"]')).parent().text().trim():a.length>1?l=\"\".concat(a.length,\" \").concat(s,\" sélectionnés\"):(l=u.data(\"defaultText\"),C(\"submit\",!0)),u.text(l),a.length>0&&((0,o.rH)(\"agentId\",n),r.remove(),(0,o.Ke)())}})),h(document).on(\"click\",\".gps\",(function(e){h(this).toggleClass(\"active-gps\");var t=parseInt(h(this).data(\"agent\")),n=\"gps_\"+t;h(this).hasClass(\"active-gps\")?h.ajax({method:\"POST\",url:\"/map/gps\",data:{agent:t,date:h(this).data(\"date\")},dataType:\"json\",success:function(e){(0,o.MR)();var r=[],c=0;e.forEach((function(a,i){var u=[a.longitude,a.latitude],s={agent:\"Agent \".concat(a.utilisateur_agent.code_agent),date_heure:(0,o.p6)(a.date_heure),type:\"gps\",gpsAgentId:n,agentId:t},l=a.utilisateur_agent.code_agent;(0,o._q)(u,l,\"\",\"gps\",\"#2C3E50\",s,(function(){if(r[i]=(0,d.mi)(u),++c===e.length){var t=new p.Z({geometry:new f.Z(r)});t.set(\"datas\",s),t.setStyle(new g.ZP({stroke:new m.Z({color:\"#2C3E50\",width:1})})),o.nc.addFeature(t),(0,o.Ke)()}}))}))}}):(0,o.rH)(\"gpsAgentId\",n)}))}))}},e=>{\"use strict\";e.O(0,[818,755,235,356,617,843,28],(()=>{return t=29497,e(e.s=t);var t}));e.O()}]);";
        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        return; yield '';
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName()
    {
        return "@public_path/build/carto.240d0f43.js";
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array ();
    }

    public function getSourceContext()
    {
        return new Source("(self.webpackChunk=self.webpackChunk||[]).push([[786],{30591:(e,t,n)=>{\"use strict\";e.exports=n.p+\"images/legende.56e89d5f.png\"},44519:(e,t,n)=>{\"use strict\";e.exports=n.p+\"images/punaise-white.fbd71a1e.png\"},29497:(e,t,n)=>{\"use strict\";n(89554),n(54747),n(69720),n(26833),n(68304),n(30489),n(69826),n(74916),n(4723),n(73210),n(23123),n(57327),n(66992),n(41539),n(70189),n(78783),n(33948),n(92222),n(69600),n(15306),n(91058),n(21249),n(9653),n(28733),n(83710),n(68309),n(12419),n(78011),n(79753),n(82526),n(41817),n(32165),n(47042),n(91038),n(69070),n(47941),n(38880),n(49337),n(33321);var o=n(28),r=n(19530),c=n(50974),a=n(98966),i=n(39164),u=n(30254),s=n(44519),l=n(30591),d=n(82766),p=n(23068),f=n(44538),g=n(31219),m=n(20767),h=n(19755);function y(e){return(y=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}function b(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}(e)||O(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&(\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"]);if(null==n)return;var o,r,c=[],a=!0,i=!1;try{for(n=n.call(e);!(a=(o=n.next()).done)&&(c.push(o.value),!t||c.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==n.return||n.return()}finally{if(i)throw r}}return c}(e,t)||O(e,t)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function O(e,t){if(e){if(\"string\"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array\$/.test(n)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=S(e);if(t){var r=S(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return k(this,n)}}function k(e,t){return!t||\"object\"!==y(t)&&\"function\"!=typeof t?function(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var I={\"Domicile du technicien\":{text:\"?\",unicode:o.fM.home.unicode,font:o.fM.home.font,color:\"white\",img:c,pos:1},\"Dernière position connue du technicien\":{text:\"?\",unicode:o.fM.tech.unicode,font:o.fM.tech.font,color:\"white\",img:c,pos:1},Journée:{text:\"?\",unicode:\"?\",font:\"\",color:\"white\",img:a,pos:2},Matin:{text:\"?\",unicode:\"?\",font:\"\",color:\"white\",img:i,pos:2},\"Après-midi\":{text:\"?\",unicode:\"?\",font:\"\",color:\"white\",img:u,pos:2},\"En attente\":{text:\"?\",unicode:o.fM[0].unicode,font:o.fM[0].font,color:\"black\",img:s,pos:3},\"Reçu sur la tablette\":{text:\"?\",unicode:o.fM[1].unicode,font:o.fM[1].font,color:\"black\",img:s,pos:3},\"En cours\":{text:\"?\",unicode:o.fM[2].unicode,font:o.fM[2].font,color:\"black\",img:s,pos:3},Terminée:{text:\"?\",unicode:o.fM[3].unicode,font:o.fM[3].font,color:\"black\",img:s,pos:3}},T=function(e){!function(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function\");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(n,e);var t=j(n);function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,n);var r=document.createElement(\"div\");r.className=\"legend ol-control\";var c=document.createElement(\"a\");c.innerHTML='<img src=\"'+l+'\" alt=\"Légende\">',c.setAttribute(\"data-popup-id\",\"popup-carto-legende\"),c.setAttribute(\"data-popup-title\",\"Légende\"),c.setAttribute(\"data-popup-width\",\"auto\"),c.setAttribute(\"data-dxpopup\",\"\"),r.appendChild(c);var a=document.getElementById(\"legend-container-tech\"),i=document.getElementById(\"legend-container-interv\");a.innerHTML=\"\",i.innerHTML=\"\";var u={};return Object.entries(I).forEach((function(e){var t=x(e,2),n=t[0],o=t[1];u[o.pos]||(u[o.pos]=[]),u[o.pos].push(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({key:n},o))})),Object.values(u).forEach((function(e,t){var n=document.createElement(\"tr\");e.forEach((function(e){var t=document.createElement(\"td\"),r=document.createElement(\"div\");r.classList.add(\"me-2\",\"mb-2\"),r.style.display=\"flex\",r.style.alignItems=\"center\",r.style.gap=\"8px\";var c=new Image;c.width=24,c.height=32,(0,o.cl)(e.text,e.unicode,e.font,e.img,e.color,(function(e){c.src=e}));var a=document.createElement(\"span\");a.textContent=e.key,r.appendChild(c),r.appendChild(a),t.appendChild(r),n.appendChild(t)})),1===e[0].pos?a.appendChild(n):i.appendChild(n)})),t.call(this,{element:r})}return n}(r.Z);function C(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.getElementById(\"form_carto\"),r=new FormData(n);h.ajax({method:\"POST\",url:\"/map/filter_carto\",data:{name:e,site:r.get(\"site\"),groupes:r.get(\"selected_options_groupes\").split(\",\").map(Number),agents:r.get(\"selected_options_agents\").split(\",\").map(Number),date:r.get(\"date_tournee\")},dataType:\"json\",success:function(n){\"reset\"===e&&(t=!0),\"reset\"===e&&(document.querySelector(\"#etiquettes\").innerHTML=n.etiquettes,(0,o.K1)(n,t),n.groupes&&M(\"groupes\",n.groupes,\"typeNom\"),n.agents&&M(\"agents\",n.agents,\"codeNom\"),document.getElementsByName(\"date_tournee\")[0].value=(new Date).toISOString().split(\"T\")[0],document.querySelectorAll(\".checkbox-option\").forEach((function(e){return e.checked=!1})),document.querySelectorAll(\".selected-options\").forEach((function(e){return e.value=\"\"})),document.querySelectorAll(\".dropdown-button\").forEach((function(e){e.textContent=e.dataset.defaultText}))),n.interventions?(document.querySelector(\"#etiquettes\").innerHTML=n.etiquettes,document.querySelector(\"#selected_etiquettes\").value=r.get(\"selected_options_agents\"),(0,o.K1)(n,t)):(n.groupes&&M(\"groupes\",n.groupes,\"typeNom\"),n.agents&&M(\"agents\",n.agents,\"codeNom\")),h(window).trigger(\"resize\")}})}function M(e,t,n){var o=document.getElementById(\"dropdown-content-\".concat(e));o.innerHTML=\"\",t.forEach((function(t){var r=document.createElement(\"label\"),c=document.createElement(\"input\");c.type=\"checkbox\",c.name=\"options_\".concat(e,\"[]\"),c.value=t.id,c.classList.add(\"checkbox-option\"),r.appendChild(c);var a=t[n];r.appendChild(document.createTextNode(a)),o.appendChild(r)}))}h(document).ready((function(){o.UI.addControl(new T);var e=h(\"#map\");h(window).resize((function(){var t=148;t+=h(\"#etiquettes\").outerHeight(!0);var n=h(window).height()-t;e.css({height:n+\"px\",\"max-height\":n+\"px\"})})),h(window).trigger(\"resize\"),o.UI.addOverlay(o.Vz),o.UI.addOverlay(o.fI),(0,o.K1)(data,!0),o.UI.on(\"singleclick\",(function(e){(0,o.k\$)(e)})),h(\"#reset-form-carto\").on(\"click\",(function(e){e.preventDefault(),C(\"reset\")})),h(\"#submit-form-carto\").on(\"click\",(function(e){e.preventDefault(),C(\"submit\")})),h(\"select\").on(\"change\",(function(e){C(\"site\")})),h(\".dropdown-container\").each((function(){var e=h(this),t=e.find(\".dropdown-button\"),n=e.find(\".dropdown-content\"),o=e.find(\".selected-options\");t.data(\"defaultText\",t.text()),t.on(\"click\",(function(e){h(\".dropdown-content\").not(n).hide(),n.toggle(),e.stopPropagation()})),h(document).on(\"click\",(function(t){e.is(t.target)||0!==e.has(t.target).length||n.hide()})),n.on(\"change\",(function(e){if(h(e.target).hasClass(\"checkbox-option\")){var r=[],c=[],a=o.attr(\"name\").match(/selected_options_(\\w+)/);if(n.find(\".checkbox-option:checked\").each((function(){r.push(h(this).val()),c.push(h(this).parent().text().trim())})),a&&\"agents\"===a[1]){var i=o.val()?o.val().split(\",\"):[];h(e.target).is(\":checked\")||(i=i.filter((function(t){return t!==h(e.target).val()}))),r=b(new Set([].concat(b(i),b(r))))}o.val(r.join(\",\"));var u=t.data(\"defaultText\").replace(\"Sélectionnez des \",\"\").trim(),s=t.data(\"defaultText\");1===c.length?s=c[0]:c.length>1&&(s=\"\".concat(c.length,\" \").concat(u,\" sélectionnés\")),t.text(s),a&&\"groupes\"===a[1]&&C(a[1])}}))})),h(document).on(\"click\",\".remove-etiquette\",(function(e){var t=h(this).data(\"id\"),n=parseInt(h(this).data(\"agent\")),r=h(\"#\"+t);if(r.length){var c=h(\"[name='selected_options_agents']\"),a=c.val().split(\",\").map(Number);a=a.filter((function(e){return e!==n})),c.val(a.join(\",\"));var i=h('#dropdown-content-agents input[value=\"'.concat(n,'\"]'));i.prop(\"checked\",!1);var u=i.closest(\".dropdown-container\").find(\".dropdown-button\"),s=u.data(\"defaultText\").replace(\"Sélectionnez des \",\"\").trim(),l=\"\";1===a.length?l=i.closest(\".dropdown-container\").find('.checkbox-option[value=\"'.concat(a[0],'\"]')).parent().text().trim():a.length>1?l=\"\".concat(a.length,\" \").concat(s,\" sélectionnés\"):(l=u.data(\"defaultText\"),C(\"submit\",!0)),u.text(l),a.length>0&&((0,o.rH)(\"agentId\",n),r.remove(),(0,o.Ke)())}})),h(document).on(\"click\",\".gps\",(function(e){h(this).toggleClass(\"active-gps\");var t=parseInt(h(this).data(\"agent\")),n=\"gps_\"+t;h(this).hasClass(\"active-gps\")?h.ajax({method:\"POST\",url:\"/map/gps\",data:{agent:t,date:h(this).data(\"date\")},dataType:\"json\",success:function(e){(0,o.MR)();var r=[],c=0;e.forEach((function(a,i){var u=[a.longitude,a.latitude],s={agent:\"Agent \".concat(a.utilisateur_agent.code_agent),date_heure:(0,o.p6)(a.date_heure),type:\"gps\",gpsAgentId:n,agentId:t},l=a.utilisateur_agent.code_agent;(0,o._q)(u,l,\"\",\"gps\",\"#2C3E50\",s,(function(){if(r[i]=(0,d.mi)(u),++c===e.length){var t=new p.Z({geometry:new f.Z(r)});t.set(\"datas\",s),t.setStyle(new g.ZP({stroke:new m.Z({color:\"#2C3E50\",width:1})})),o.nc.addFeature(t),(0,o.Ke)()}}))}))}}):(0,o.rH)(\"gpsAgentId\",n)}))}))}},e=>{\"use strict\";e.O(0,[818,755,235,356,617,843,28],(()=>{return t=29497,e(e.s=t);var t}));e.O()}]);", "@public_path/build/carto.240d0f43.js", "/builds/dev/refonte_sav/public/build/carto.240d0f43.js");
    }
}
