/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/leaflet.export@1.0.0/leaflet_export.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(t){t.Map.addInitHook((function(){this.whenReady((function(){t.Map.mergeOptions({preferCanvas:!0}),"exportError"in this||(this.exportError={wrongBeginSelector:"Селектор JQuery не имеет начальной скобки (",wrongEndSelector:"Селектор JQuery не заканчивается скобкой )",jqueryNotAvailable:"В опциях используется JQuery селектор, но JQuery не подключен.Подключите JQuery или используйте DOM-селекторы .class, #id или DOM-элементы",popupWindowBlocked:"Окно печати было заблокировано браузером. Пожалуйста разрешите всплывающие окна на этой странице",emptyFilename:"При выгрузке карты в виде файла не указано его имя"}),this.supportedCanvasMimeTypes=function(){if("_supportedCanvasMimeTypes"in this)return this._supportedCanvasMimeTypes;var t={PNG:"image/png",JPEG:"image/jpeg",JPG:"image/jpg",GIF:"image/gif",BMP:"image/bmp",TIFF:"image/tiff",XICON:"image/x-icon",SVG:"image/svg+xml",WEBP:"image/webp"},e=document.createElement("canvas");e.style.display="none";var r=(e=document.body.appendChild(e)).getContext("2d");for(var n in r.fillStyle="red",r.fillRect(0,0,1,1),this._supportedCanvasMimeTypes={},t){var o=t[n];o===e.toDataURL(o).replace(/^data:([^;]*).*/,"$1")&&(this._supportedCanvasMimeTypes[n]=o)}return document.body.removeChild(e),this._supportedCanvasMimeTypes},this.export=function(t){var e={},r=[],n="image/png";if("caption"in(t=t||{caption:{},exclude:[]})&&"position"in(e=t.caption)){var o=e.position;Array.isArray(o)||(o=[0,0]),2!=o.length&&(0===o.length&&(o[0]=0),1===o.length&&(o[1]=0)),"number"!=typeof o[0]&&"string"==typeof o[0]&&(o[0]=parseInt(o[0]),isNaN(o[0])&&(o[0]=0)),"number"!=typeof o[1]&&"string"==typeof o[1]&&(o[1]=parseInt(o[1]),isNaN(o[1])&&(o[1]=0)),e.position=o}"exclude"in t&&Array.isArray(t.exclude)&&(r=t.exclude),"format"in t&&(n=t.format);var i=t.afterRender;"function"!=typeof i&&(i=function(t){return t});var a=t.afterExport;"function"!=typeof a&&(a=function(t){return t});for(var s=t.container||this._container,p=[],l=0;l<r.length;l++){var u=r[l];switch(typeof u){case"object":"tagName"in u&&p.push(u);break;case"string":switch(u.substr(0,1)){case".":for(var d=s.getElementsByClassName(u.substr(1)),h=0;h<d.length;h++)p.push(d.item(h));break;case"#":var c=s.getElementById(u.substr(1));c&&p.push(c);break;case"$":var f=u.trim().substr(1);if("("!==f.substr(0,1))throw new Error(this.exportError.wrongBeginSelector);if(")"!==(f=f.substr(1)).substr(-1))throw new Error(this.exportError.wrongEndSelector);if(f=f.substr(0,f.length-1),"undefined"==typeof jQuery)throw new Error(this.exportError.jqueryNotAvailable);for(d=$(f,s),h=0;h<d.length;h++)p.push(d[l])}}}for(l=0;l<p.length;l++)p[l].setAttribute("data-html2canvas-ignore","true");return html2canvas(s,{useCORS:!0}).then(i).then((function(t){for(var r=0;r<p.length;r++)p[r].removeAttribute("data-html2canvas-ignore");if("text"in e&&e.text){var o,i;"position"in e?(o=e.position[0],i=e.position[1]):(o=0,i=0);var a=t.getContext("2d");"font"in e&&(a.font=e.font),"fillStyle"in e&&(a.fillStyle=e.fillStyle),a.fillText(e.text,o,i)}return"canvas"===n?t:{data:t.toDataURL(n),width:t.width,height:t.height,type:n}}),(function(t){alert(t)})).then(a)},this.printExport=function(t){t=t||{};var e=this,r=[],n=function(t,o){return(t[o].export||e.export)(t[o]).then((function(e){return r.push(e),o<t.length-1?n(t,o+1):r}))};return Array.isArray(t)?n(t,0).then((function(r){return e._printExport(t,r)})):(t.export||this.export)(t).then((function(r){return e._printExport(t,[r])}))},this._printExport=function(t,e){var r=window.open("","_blank");if(!r)throw new Error(this.exportError.popupWindowBlocked);var n=r.document;return n.write("<html><head><style>@media print { @page { padding: 0; margin: 0; } }</style><title>"+(t.text?t.text:"")+"</title></head><body onload='window.print(); window.close();'></body></html>"),e.forEach((function(t){var e=n.createElement("img");e.height=t.height-20,e.width=t.width-10,e.src=t.data,n.body.appendChild(e)})),n.close(),r.focus(),e},this.downloadExport=function(t){return t=t||{},Array.isArray(t)?this._runDownloadTasks(t,0):this._downloadExport(t)},this._runDownloadTasks=function(t,e){var r=this,n=e;return this._downloadExport(t[n]).then((function(e){return++n<t.length?r._runDownloadTasks(t,n).then((function(t){return[e].concat(t)})):[e]}))},this._downloadExport=function(t){if(!("fileName"in t))throw new Error(this.exportError.emptyFilename);var e=t.export||this.export,r=t.fileName;delete t.fileName;return e(t).then((function(t){for(var e,n=atob(t.data.split(",")[1]),o=new ArrayBuffer(n.length),i=new Uint8Array(o),a=0;a<n.length;a++)i[a]=255&n.charCodeAt(a);if("function"==typeof Blob)e=new Blob([o],{type:"application/octet-stream"});else{var s=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);s.append(o),e=s.getBlob("application/octet-stream")}if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(e,r);else{var p=(window.URL||window.webkitURL).createObjectURL(e),l=document.createElement("a");l.style="display: none",l.download=r,l.href=p,document.body.appendChild(l),l.click(),document.body.removeChild(l)}return t}))}}))}))}(L);
//# sourceMappingURL=/sm/c56f33be3188920423d46148cceae0f97bd0b2b48df13801af27e057843b6d3f.map