import{g as e}from"./index-B1MHyEgd.js";function t(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}var r,n={exports:{}};var s,o=r?n.exports:(r=1,s="undefined"==typeof window?n.exports:window,n.exports=((e,t)=>(()=>{var r={660:e=>{e.exports=t},944:t=>{t.exports=e}},n={};function s(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var o={};s.d(o,{default:()=>w});var i=s(944),l=s.n(i),u=s(660),c=s.n(u);let{composed:h}=l(),{addEvent:p,fireEvent:a,pushUnique:f}=l();function d(){this.fullscreen=new g(this)}class g{static compose(e){f(h,"Fullscreen")&&p(e,"beforeRender",d)}constructor(e){this.chart=e,this.isOpen=!1;let t=e.renderTo;!this.browserProps&&("function"==typeof t.requestFullscreen?this.browserProps={fullscreenChange:"fullscreenchange",requestFullscreen:"requestFullscreen",exitFullscreen:"exitFullscreen"}:t.mozRequestFullScreen?this.browserProps={fullscreenChange:"mozfullscreenchange",requestFullscreen:"mozRequestFullScreen",exitFullscreen:"mozCancelFullScreen"}:t.webkitRequestFullScreen?this.browserProps={fullscreenChange:"webkitfullscreenchange",requestFullscreen:"webkitRequestFullScreen",exitFullscreen:"webkitExitFullscreen"}:t.msRequestFullscreen&&(this.browserProps={fullscreenChange:"MSFullscreenChange",requestFullscreen:"msRequestFullscreen",exitFullscreen:"msExitFullscreen"}))}close(){let e=this,t=e.chart,r=t.options.chart;a(t,"fullscreenClose",null,function(){e.isOpen&&e.browserProps&&t.container.ownerDocument instanceof Document&&t.container.ownerDocument[e.browserProps.exitFullscreen](),e.unbindFullscreenEvent&&(e.unbindFullscreenEvent=e.unbindFullscreenEvent()),t.setSize(e.origWidth,e.origHeight,!1),e.origWidth=void 0,e.origHeight=void 0,r.width=e.origWidthOption,r.height=e.origHeightOption,e.origWidthOption=void 0,e.origHeightOption=void 0,e.isOpen=!1,e.setButtonText()})}open(){let e=this,t=e.chart,r=t.options.chart;a(t,"fullscreenOpen",null,function(){if(r&&(e.origWidthOption=r.width,e.origHeightOption=r.height),e.origWidth=t.chartWidth,e.origHeight=t.chartHeight,e.browserProps){let r=p(t.container.ownerDocument,e.browserProps.fullscreenChange,function(){e.isOpen?(e.isOpen=!1,e.close()):(t.setSize(null,null,!1),e.isOpen=!0,e.setButtonText())}),n=p(t,"destroy",r);e.unbindFullscreenEvent=()=>{r(),n()};let s=t.renderTo[e.browserProps.requestFullscreen]();s&&s.catch(function(){alert("Full screen is not supported inside a frame.")})}})}setButtonText(){let e=this.chart,t=e.exporting?.divElements,r=e.options.exporting,n=r&&r.buttons&&r.buttons.contextButton.menuItems,s=e.options.lang;if(r&&r.menuItemDefinitions&&s&&s.exitFullscreen&&s.viewFullscreen&&n&&t){let e=t[n.indexOf("viewFullscreen")];e&&c().setElementHTML(e,this.isOpen?s.exitFullscreen:r.menuItemDefinitions.viewFullscreen.text||s.viewFullscreen)}}toggle(){this.isOpen?this.close():this.open()}}let F=l();F.Fullscreen=F.Fullscreen||g,F.Fullscreen.compose(F.Chart);let w=l();return o.default})())(s._Highcharts,s._Highcharts.AST)),i=t({__proto__:null,default:e(o)},[o]);export{i as f};
//# sourceMappingURL=full-screen-CnQ8Al4y.js.map
