import{$b as p,Le as S,Ma as r,Me as L,Na as f,Va as _,Wb as l,Xb as E,ab as g,bc as u,cb as b,cc as k}from"./chunk-UJH7VVYJ.js";import{e as h}from"./chunk-4KQZYG2V.js";var n,v,w,U,F,P=h(()=>{E();k();L();_();b();n=p(),v=u(),w={EXCEL:"xlsx",CSS:"css",PNG:"png",JPEG:"jpeg",GIF:"gif",SVG:"svg",PDF:"pdf"},U={CSS:"text/css",EXCEL:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",PNG:"image/png",JPEG:"image/jpeg",GIF:"image/gif",SVG:"image/svg+xml",PDF:"application/pdf"},F={_revokeObjectURLTimeout:3e4,_getDataUri:function(e,t){var i=this._getMimeType(e);return"data:".concat(i,";base64,").concat(t)},_getMimeType:function(e){return U[e]||"application/octet-stream"},_linkDownloader:function(e,t){var i=l.createElement("a");return i.download=e,i.href=t,i.target="_blank",i},_winJSBlobSave:function(e,t,i){var o=new Windows.Storage.Pickers.FileSavePicker;o.suggestedStartLocation=Windows.Storage.Pickers.PickerLocationId.documentsLibrary;var s=w[i];if(s){var a=this._getMimeType(i);o.fileTypeChoices.insert(a,["."+s])}o.suggestedFileName=t,o.pickSaveFileAsync().then(function(d){d&&d.openAsync(Windows.Storage.FileAccessMode.readWrite).then(function(c){var m=e.msDetachStream();Windows.Storage.Streams.RandomAccessStream.copyAsync(m,c).then(function(){c.flushAsync().done(function(){m.close(),c.close()})})})})},_click:function(e){try{e.dispatchEvent(new MouseEvent("click",{cancelable:!0}))}catch{var t=l.getDocument().createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,n,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}},_saveBlobAs:function(e,t,i){if(this._blobSaved=!1,r(v.msSaveOrOpenBlob))v.msSaveOrOpenBlob(i,e),this._blobSaved=!0;else if(r(n.WinJS))this._winJSBlobSave(i,e,t),this._blobSaved=!0;else{var o=n.URL||n.webkitURL||n.mozURL||n.msURL||n.oURL;if(r(o)){var s=o.createObjectURL(i),a=this._linkDownloader(e,s);setTimeout(()=>{o.revokeObjectURL(s),this._objectUrlRevoked=!0},this._revokeObjectURLTimeout),this._click(a)}else g.warn("window.URL || window.webkitURL || window.mozURL || window.msURL || window.oURL is not defined")}},saveAs:function(e,t,i){var o=w[t];if(o&&(e+="."+o),f(n.Blob))this._saveBlobAs(e,t,i);else{r(v.userAgent.match(/iPad/i))||S.log("E1034");var s=this._linkDownloader(e,this._getDataUri(t,i));this._click(s)}}}});export{F as a,P as b};
