var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
(function() {
    var accessToken = window.localStorage.getItem('access_token');
    if (accessToken) window.IS_ADMIN = true;
    var IS_INJECTED_SITE_SETTING = false;
    let sseAccessToken = window.sessionStorage.getItem('sse_access_token');
    const sseValue = sseAccessToken;
    if (false && window.IS_ADMIN && !inIframe() /* don't add for edit mode */) {
        // Show admin menu
        var adminMenu =      '<div class="admin-menu-wrap">'
                            +   '<div class="admin-icon"><div class="admin-menu-item"><a href="EDIT_URL"><img src="/images/pen.png" style="height: 20px;"></a></div></div>'
                            // +   '<div class="admin-menu">'
                            // +       '<div class="admin-menu-item"><a href="EDIT_URL">Edit Mode</a></div>'
                            // +       '<div class="admin-menu-item"><a href="/dashboard/dist/site-setting/index.html" id="js-open-sitesetting">Site Setting</a></div>'
                            // +   '</div>'
                            + '</div>';
        adminMenu = adminMenu.replace('EDIT_URL', document.location.href + '?edit=1&ssetk=' + sseValue);
        document.body.insertAdjacentHTML('afterbegin', adminMenu);

        var css = '.admin-menu-wrap {position: fixed;padding: 3px;right: 0;top: 20px;border: 1px solid #ccc;border-radius: 3px 0 0 3px;z-index: 9999;background: #fff;box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);}'
                + '.admin-icon {border-right: none;cursor: pointer; text-align: right;}'
                + '.admin-menu { display: none; }'
                + '.admin-menu-wrap:hover .admin-menu { display: block; }'
                + '#admin-sitesetting-wrapper {position: fixed; z-index: 10000; width: 100%; height: 100%; top: 0; left: 0; background: rgba(0,0,0, 0.5); display: none;}'
                + '#admin-sitesetting-wrapper > iframe {border: none; width: calc(100% - 40px); height: calc(100% - 40px); background: #fff; margin: 20px;}'
                + '#close-admin-sitesetting {position: absolute; top: 0; left: 20px; border: none; height: 20px; padding: 0 10px; cursor: pointer; background: #ff2907; color: #fff;    transition: 0.5s;}'
                + '#close-admin-sitesetting:hover {background: #000}'
                ;
        var head = document.head || document.getElementsByTagName('head')[0],
            style = document.createElement('style');

        style.type = 'text/css';
        if (style.styleSheet){
          // This is required for IE8 and below.
          style.styleSheet.cssText = css;
        } else {
          style.appendChild(document.createTextNode(css));
        }
        head.appendChild(style);

        // Add even for sitesetting item
        // document.getElementById('js-open-sitesetting').addEventListener('click', function(event) {
        //     event.preventDefault();
        //     if (!IS_INJECTED_SITE_SETTING) {
        //         var siteSettingIframe = '<div id="admin-sitesetting-wrapper"><button id="close-admin-sitesetting">Close</button><iframe src="/dashboard/dist/site-setting/index.html"></iframe></div>';
        //         document.body.insertAdjacentHTML('afterbegin', siteSettingIframe);
        //         document.getElementById('admin-sitesetting-wrapper').style.display = 'block';

        //         // Add event for close button
        //         document.getElementById('close-admin-sitesetting').addEventListener('click', function() {
        //             document.getElementById('admin-sitesetting-wrapper').style.display = 'none';
        //         });
        //     } else {
        //         document.getElementById('admin-sitesetting-wrapper').style.display = 'block';
        //     }
        // });
    }

    function inIframe () {
        try {
            return window.self !== window.top;
        } catch (e) {
            return true;
        }
    }
})();
}