Files
sam-api/public/admin/js/highchart/code/export-data.js

9 lines
12 KiB
JavaScript
Raw Normal View History

2025-07-17 10:05:47 +09:00
/**
* Highcharts JS v11.2.0 (2023-10-30)
*
* Exporting module
*
* (c) 2010-2021 Torstein Honsi
*
* License: www.highcharts.com/license
*/!function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/modules/export-data",["highcharts","highcharts/modules/exporting"],function(t){return e(t),e.Highcharts=t,e}):e("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(e){"use strict";var t=e?e._modules:{};function a(e,t,a,o){e.hasOwnProperty(t)||(e[t]=o.apply(null,a),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:e[t]}})))}a(t,"Extensions/DownloadURL.js",[t["Core/Globals.js"]],function(e){let{isSafari:t,win:a,win:{document:o}}=e,n=a.URL||a.webkitURL||a;function i(e){let t=e.replace(/filename=.*;/,"").match(/data:([^;]*)(;base64)?,([0-9A-Za-z+/]+)/);if(t&&t.length>3&&a.atob&&a.ArrayBuffer&&a.Uint8Array&&a.Blob&&n.createObjectURL){let e=a.atob(t[3]),o=new a.ArrayBuffer(e.length),i=new a.Uint8Array(o);for(let t=0;t<i.length;++t)i[t]=e.charCodeAt(t);return n.createObjectURL(new a.Blob([i],{type:t[1]}))}}return{dataURLtoBlob:i,downloadURL:function(e,n){let r=a.navigator,s=o.createElement("a");if("string"!=typeof e&&!(e instanceof String)&&r.msSaveOrOpenBlob){r.msSaveOrOpenBlob(e,n);return}e=""+e;let l=/Edge\/\d+/.test(r.userAgent),h=t&&"string"==typeof e&&0===e.indexOf("data:application/pdf");if((h||l||e.length>2e6)&&!(e=i(e)||""))throw Error("Failed to convert to blob");if(void 0!==s.download)s.href=e,s.download=n,o.body.appendChild(s),s.click(),o.body.removeChild(s);else try{if(!a.open(e,"chart"))throw Error("Failed to open window")}catch{a.location.href=e}}}}),a(t,"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},lang:{downloadCSV:"Download CSV",downloadXLS:"Download XLS",exportData:{annotationHeader:"Annotations",categoryHeader:"Category",categoryDatetimeHeader:"DateTime"},viewData:"View data table",hideData:"Hide data table"}}}),a(t,"Extensions/ExportData/ExportData.js",[t["Core/Renderer/HTML/AST.js"],t["Extensions/ExportData/ExportDataDefaults.js"],t["Core/Globals.js"],t["Core/Defaults.js"],t["Extensions/DownloadURL.js"],t["Core/Series/SeriesRegistry.js"],t["Core/Utilities.js"]],function(e,t,a,o,n,i,r){let{doc:s,win:l}=a,{getOptions:h,setOptions:c}=o,{downloadURL:d}=n,{series:p,seriesTypes:{arearange:u,gantt:m,map:f,mapbubble:x,treemap:g,xrange:b}}=i,{addEvent:y,defined:D,extend:w,find:T,fireEvent:v,isNumber:E,pick:S}=r,C=[];function L(){let e=this.getCSV(!0);d(V(e,"text/csv")||"data:text/csv,\uFEFF"+encodeURIComponent(e),this.getFilename()+".csv")}function U(){let e='<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>";d(V(e,"application/vnd.ms-excel")||"data:application/vnd.ms-excel;base64,"+l.btoa(unescape(encodeURIComponent(e))),this.getFilename()+".xls")}function A(e){let t="",a=this.getDataRows(),o=this.options.exporting.csv,n=S(o.decimalPoint,","!==o.itemDelimiter&&e?1.1.toLocaleString()[1]:"."),i=S(o.itemDelimiter,","===n?";":","),r=o.lineDelimiter;return a.forEach((e,o)=>{let s="",l=e.length;for(;l--;)"string"==typeof(s=e[l])&&(s=`"${s}"`),"number"==typeof s&&"."!==n&&(s=s.toString().replace(".",n)),e[l]=s;e.length=a.length?a[0].length:0,t+=e.join(i),o<a.length-1&&(t+=r)}),t}function R(e){let t,a;let o=this.hasParallelCoordinates,n=this.time,i=this.options.exporting&&this.options.exporting.c