Icard/angular-clarity-master(work.../node_modules/highcharts/modules/export-data.js

9 lines
12 KiB
JavaScript
Raw Normal View History

2024-07-16 14:55:36 +00:00
!/**
* Highcharts JS v11.4.1 (2024-04-04)
*
* Exporting module
*
* (c) 2010-2024 Torstein Honsi
*
* License: www.highcharts.com/license
*/function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/export-data",["highcharts","highcharts/modules/exporting"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function o(t,e,o,a){t.hasOwnProperty(e)||(t[e]=a.apply(null,o),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}o(e,"Extensions/DownloadURL.js",[e["Core/Globals.js"]],function(t){let{isSafari:e,win:o,win:{document:a}}=t,n=o.URL||o.webkitURL||o;function i(t){let e=t.replace(/filename=.*;/,"").match(/data:([^;]*)(;base64)?,([0-9A-Za-z+/]+)/);if(e&&e.length>3&&o.atob&&o.ArrayBuffer&&o.Uint8Array&&o.Blob&&n.createObjectURL){let t=o.atob(e[3]),a=new o.ArrayBuffer(t.length),i=new o.Uint8Array(a);for(let e=0;e<i.length;++e)i[e]=t.charCodeAt(e);return n.createObjectURL(new o.Blob([i],{type:e[1]}))}}return{dataURLtoBlob:i,downloadURL:function(t,n){let r=o.navigator,s=a.createElement("a");if("string"!=typeof t&&!(t instanceof String)&&r.msSaveOrOpenBlob){r.msSaveOrOpenBlob(t,n);return}t=""+t;let l=/Edge\/\d+/.test(r.userAgent);if((e&&"string"==typeof t&&0===t.indexOf("data:application/pdf")||l||t.length>2e6)&&!(t=i(t)||""))throw Error("Failed to convert to blob");if(void 0!==s.download)s.href=t,s.download=n,a.body.appendChild(s),s.click(),a.body.removeChild(s);else try{if(!o.open(t,"chart"))throw Error("Failed to open window")}catch{o.location.href=t}}}}),o(e,"Extensions/ExportData/ExportDataDefaults.js",[],function(){return{exporting:{csv:{annotations:{itemDelimiter:"; ",join:!1},columnHeaderFormatter:null,dateFormat:"%Y-%m-%d %H:%M:%S",decimalPoint:null,itemDelimiter:null,lineDelimiter:"\n"},showTable:!1,useMultiLevelHeaders:!0,useRowspanHeaders:!0,showExportInProgress:!0},lang:{downloadCSV:"Download CSV",downloadXLS:"Download XLS",exportData:{annotationHeader:"Annotations",categoryHeader:"Category",categoryDatetimeHeader:"DateTime"},viewData:"View data table",hideData:"Hide data table",exportInProgress:"Exporting..."}}}),o(e,"Extensions/ExportData/ExportData.js",[e["Core/Renderer/HTML/AST.js"],e["Core/Defaults.js"],e["Extensions/DownloadURL.js"],e["Extensions/ExportData/ExportDataDefaults.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,o,a,n,i){let{getOptions:r,setOptions:s}=e,{downloadURL:l}=o,{doc:h,win:c}=n,{addEvent:d,defined:p,extend:u,find:m,fireEvent:g,isNumber:x,pick:f}=i;function b(t){let e=!!this.options.exporting?.showExportInProgress,o=c.requestAnimationFrame||setTimeout;o(()=>{e&&this.showLoading(this.options.lang.exportInProgress),o(()=>{try{t.call(this)}finally{e&&this.hideLoading()}})})}function y(){b.call(this,()=>{let t=this.getCSV(!0);l(A(t,"text/csv")||"data:text/csv,\uFEFF"+encodeURIComponent(t),this.getFilename()+".csv")})}function w(){b.call(this,()=>{let t='<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>Ark1</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><style>td{border:none;font-family: Calibri, sans-serif;} .number{mso-number-format:"0.00";} .text{ mso-number-format:"@";}</style><meta name=ProgId content=Excel.Sheet><meta charset=UTF-8></head><body>'+this.getTable(!0)+"</body></html>";l(A(t,"application/vnd.ms-excel")||"data:application/vnd.ms-excel;base64,"+c.btoa(unescape(encodeURIComponent(t))),this.getFilename()+".xls")})}function D(t){let e="",o=this.getDataRows(),a=this.options.exporting.csv,n=f(a.decimalPoint,","!==a.itemDelimiter&&t?1.1.toLocaleString()[1]:"."),i=f(a.itemDelimiter,","===n?";":","),r=a.lineDelimiter;return o.forEach((t,a)=>{let s="",l=t.length;for(;l--;)"string"==typeof(s=t[l])&&(s=`"${s}"`),"number"==typeof s&&"."!==n&&(s=s.toString().replace(".",n)),t[l]=