function installCopyToClipboard(Highcharts) {
    if (!Highcharts) return;
    const {Chart, extend} = Highcharts;

    extend(Chart.prototype, {
        copyToClipboardAsync: async function() {
            if (!Highcharts.isWebKit) {
                XH.dangerToast('Copying charts to the clipboard is not supported on this browser');
                return;
            }

            try {
                const blobPromise = convertChartToPngAsync(this),
                    clipboardItemInput = new window.ClipboardItem({
                        // Safari requires an unresolved promise.  See https://bugs.webkit.org/show_bug.cgi?id=222262 for discussion
                        'image/png': Highcharts.isSafari ? blobPromise : await blobPromise
                    });
                await window.navigator.clipboard.write([clipboardItemInput]);
                XH.successToast('Chart copied to clipboard');
            } catch (e) {
                XH.handleException(e, {showAlert: false, logOnServer: true});
                XH.dangerToast('Error: Chart could not be copied.  This error has been logged.');
            }
        }
    });
}
/**
 * Copy the chart in it's current state to the clipboard.
 *  Works only on webkit based browsers.
 * @private
 */
Copy the chart in it's current state to the clipboard.
Works only on webkit based browsers.
@private
Copy the chart in it ' s current state to the clipboard . Works only on webkit based browsers . @private
function installCopyToClipboard(Highcharts) {
    if (!Highcharts) return;
    const {Chart, extend} = Highcharts;
    extend(Chart.prototype, {
        copyToClipboardAsync: async function() {
            if (!Highcharts.isWebKit) {
                XH.dangerToast('Copying charts to the clipboard is not supported on this browser');
                return;
            }
            try {
                const blobPromise = convertChartToPngAsync(this),
                    clipboardItemInput = new window.ClipboardItem({
                        'image/png': Highcharts.isSafari ? blobPromise : await blobPromise
                    });
                await window.navigator.clipboard.write([clipboardItemInput]);
                XH.successToast('Chart copied to clipboard');
            } catch (e) {
                XH.handleException(e, {showAlert: false, logOnServer: true});
                XH.dangerToast('Error: Chart could not be copied.  This error has been logged.');
            }
        }
    });
}
function installCopyToClipboard ( Highcharts ) { if ( ! Highcharts ) return ; const { Chart , extend } = Highcharts ; extend ( Chart . prototype , { copyToClipboardAsync : async function ( ) { if ( ! Highcharts . isWebKit ) { XH . dangerToast ( 'Copying charts to the clipboard is not supported on this browser' ) ; return ; } try { const blobPromise = convertChartToPngAsync ( this ) , clipboardItemInput = new window . ClipboardItem ( { 'image/png' : Highcharts . isSafari ? blobPromise : await blobPromise } ) ; await window . navigator . clipboard . write ( [ clipboardItemInput ] ) ; XH . successToast ( 'Chart copied to clipboard' ) ; } catch ( e ) { XH . handleException ( e , { showAlert : false , logOnServer : true } ) ; XH . dangerToast ( 'Error: Chart could not be copied.  This error has been logged.' ) ; } } } ) ; }
Copy the chart in it's current state to the clipboard.
Copy the chart in it ' s current state to the clipboard .
// Safari requires an unresolved promise.  See https://bugs.webkit.org/show_bug.cgi?id=222262 for discussion