(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var HitalkObject_1 = require("./const/HitalkObject");
var HitalkLog_1 = require("./utils/HitalkLog");
var HitalkConfig_1 = require("./const/HitalkConfig");
var HitalkRequest_1 = require("./utils/HitalkRequest");
var HitalkReturn_1 = require("./utils/HitalkReturn");
var HitalkCheck_1 = require("./utils/HitalkCheck");
var GameExtraStatusUtil_1 = require("./coreUtils/GameExtraStatusUtil");
var LoadChannelUtil_1 = require("./coreUtils/LoadChannelUtil");
var ExtraParamsUtil_1 = require("./coreUtils/ExtraParamsUtil");
var GetOpenIdUtil_1 = require("./coreUtils/GetOpenIdUtil");
var JudgePlatformUtil_1 = require("./coreUtils/JudgePlatformUtil");
var GetIsGamePayUtil_1 = require("./coreUtils/GetIsGamePayUtil");
/**指尖互娱SDK */
var HitalkOpenSDK = /** @class */ (function () {
    function HitalkOpenSDK() {
        /**获取开关状态 */
        this.switchStatus = { gamePay: true }; //新接口---gamePay参数已废弃
        /**日志输出类*/
        this.hitalkLog = HitalkLog_1.HitalkLog;
        /**通用回调处理类*/
        this.hitalkReturn = HitalkReturn_1.HitalkReturn;
        /**SDK测试环境状态 */
        this.hitalkConfig = HitalkConfig_1.HitalkConfig;
    }
    /**初始化参数以及SDK*/
    HitalkOpenSDK.prototype.init = function (initCallback, initSDKData) {
        this.initSDKData = initSDKData;
        this.initCallback = initCallback;
        var paramName = HitalkCheck_1.HitalkCheck.checkInitVO(initSDKData);
        if (paramName) {
            HitalkReturn_1.HitalkReturn.paramsError(initCallback, 'init', paramName);
            return;
        }
        // this.loadChannelParams()
        LoadChannelUtil_1.LoadChannelUtil.loadChannelParams();
        // this.isFormal() //是否进入测试服
        JudgePlatformUtil_1.JudgePlatformUtil.isFormal(); //是否进入测试服
        // ThinkingData.init() //数据上报初始化
        this.loadChannelID();
        this.initSDK();
    };
    /**获取渠道ID */
    HitalkOpenSDK.prototype.loadChannelID = function () {
        var initSDKData = this.initSDKData;
        for (var k in initSDKData) {
            this[k] = initSDKData[k];
        }
        //判断是否小游戏平台
        if (!JudgePlatformUtil_1.JudgePlatformUtil.isMiNiGame()) {
            //不是小游戏,从url上获取参数
            this.snKey = LoadChannelUtil_1.LoadChannelUtil.getSnKey();
            this.tsKey = LoadChannelUtil_1.LoadChannelUtil.getTsKey();
            this.zoneKey = LoadChannelUtil_1.LoadChannelUtil.getZoneKey();
        }
        this.gameId = initSDKData.gameId;
        if (initSDKData.debug) {
            this.snKey = initSDKData.snKey;
            this.tsKey = initSDKData.tsKey;
            this.zoneKey = initSDKData.zoneKey;
        }
    };
    /**初始化SDK---*/
    HitalkOpenSDK.prototype.initSDK = function () {
        var self = this;
        var channelType = self.snKey;
        //是否是小游戏平台
        if (JudgePlatformUtil_1.JudgePlatformUtil.isMiNiGame()) {
            //小游戏渠道初始化
            self.xyxImpl.init(function () {
                console.log("小游戏渠道初始化完成");
                self.onload(); //init回调
            });
            return;
        }
        if (channelType || self.tsKey != '') {
            HitalkLog_1.HitalkLog.info('====开始加载SDK文件====,加载' + channelType + '渠道SDK文件');
            var baseUrl = HitalkConfig_1.HitalkConfig.getClientFileURL() + 'platform/';
            var platformUrl = baseUrl + 'hitalk.sdk_' + channelType + '.js?v=' + Math.random();
            if (self.tsKey != '') {
                platformUrl = baseUrl + 'hitalk.sdk_' + self.tsKey + '.js?v=' + Math.random();
                HitalkLog_1.HitalkLog.info(channelType + '渠道开始加载平台SDK文件,url:' + platformUrl);
            }
            self.loadScript(platformUrl);
        }
        else {
            HitalkLog_1.HitalkLog.error('=====无' + channelType + 'SDK文件加载=====');
            // this.onload();
        }
    };
    /**sdk文件加载完毕*/
    HitalkOpenSDK.prototype.onload = function () {
        var self = this;
        var success = self.initCallback;
        HitalkReturn_1.HitalkReturn.success(success, 'initSDK'); //init()回调
    };
    /**加载渠道SDK */
    HitalkOpenSDK.prototype.loadScript = function (src, callback) {
        var s = document.createElement('script');
        s.setAttribute('type', 'text/javascript');
        s.setAttribute('async', 'async');
        s.setAttribute('src', src);
        s.addEventListener('load', function () {
            callback && callback();
        });
        document.getElementsByTagName('head')[0].appendChild(s);
    };
    /**加载文件 */
    HitalkOpenSDK.prototype.loadScripts = function (list, callback) {
        var loadNum = 0;
        var _loop_1 = function (i, length_1) {
            var src = list[i];
            this_1.loadScript(src, function () {
                loadNum++;
                if (loadNum >= length_1) {
                    callback && callback();
                }
            });
        };
        var this_1 = this;
        for (var i = 0, length_1 = list.length; i < length_1; i++) {
            _loop_1(i, length_1);
        }
    };
    /**设置平台SDK
     * callback 引擎文件加载完成时的回调
     * thisobj 回调函数的this作用域,可不传
     */
    HitalkOpenSDK.prototype.setChannelSdk = function (sdk) {
        if (typeof sdk != 'object') {
            HitalkLog_1.HitalkLog.info('添加平台SDK文件失败');
        }
        else {
            HitalkLog_1.HitalkLog.info('添加平台SDK文件成功');
            this.channelSDK = sdk;
            //小游戏渠道文件与核心文件是合并的,加载核心文件时,会自动初始化,所以此处不需要onload
            if (!JudgePlatformUtil_1.JudgePlatformUtil.isMiNiGame()) {
                //渠道sdk初始化完成后回调进入游戏--H5渠道使用
                this.onload();
            }
        }
    };
    HitalkOpenSDK.prototype.request = function (params, callback, thisobj) {
        var channelSDK = this.channelSDK;
        if (channelSDK && typeof channelSDK.request === 'function') {
            channelSDK.request(params, callback, thisobj);
            return;
        }
        HitalkRequest_1.HitalkRequest.request(params, callback, thisobj);
    };
    /**从缓存在全局的url对象获取参数 */
    HitalkOpenSDK.prototype.getUrlParameter = function (paramName) {
        var urlParams = this.urlParams;
        return urlParams[paramName] || '';
    };
    /**获取服务器域名 */
    HitalkOpenSDK.prototype.getIspServerURL = function () {
        return HitalkConfig_1.HitalkConfig.getIspServerURL();
    };
    /**[渠道文件调用]组装请求sdk服务器URL(华圣上报接口加密...) */
    HitalkOpenSDK.prototype.getSdkServerURL = function (data) {
        return HitalkConfig_1.HitalkConfig.getSDKReportSignURL();
    };
    /**[渠道文件调用]组装请求渠道的URL(7477引用...) */
    HitalkOpenSDK.prototype.getServerURL = function (url, data) {
        return url + HitalkConfig_1.HitalkConfig.assmebleParams(data);
    };
    /**
     * 查询支付开关状态
     * @param params 暂时默认为空
     * @param callback boolean(true:开启支付,false:关闭支付)
     */
    HitalkOpenSDK.prototype.getServerIsGamePay = function (callback, params) {
        return GetIsGamePayUtil_1.GetIsGamePayUtil.getServerIsGamePay(callback, params);
    };
    /*安卓支付回调失败后的回调机制 */
    HitalkOpenSDK.prototype.wxErrorPayCallback = function (self, requestUrl, data, callback) {
        return GetIsGamePayUtil_1.GetIsGamePayUtil.wxErrorPayCallback(self, requestUrl, data, callback);
    };
    ///****************************************通用接口START*****************************************///
    ///*****************************针对于各个渠道都会使用到的通用接口*********************************///
    ///*********************************************************************************************///
    ///*********************************************************************************************///
    HitalkOpenSDK.prototype.getChannelData = function () {
        // let data: SnVO = this.getExtraChannelParams() //旧接口方式
        var data = ExtraParamsUtil_1.ExtraParamsUtil.getExtraChannelParams(); //新工具类调用
        return data;
    };
    HitalkOpenSDK.prototype.login = function (callback, loginSDKData) {
        var channelSDK = this.channelSDK;
        var snKey = this.snKey;
        HitalkLog_1.HitalkLog.info('====login(接口调用)====');
        if (!channelSDK) {
            HitalkReturn_1.HitalkReturn.noSDK(callback, snKey);
            return;
        }
        if (typeof channelSDK.login !== 'function') {
            HitalkReturn_1.HitalkReturn.noInterface(callback, snKey, 'login');
            return;
        }
        // this.getOpenId(callback, loginSDKData)//旧
        GetOpenIdUtil_1.GetOpenIdUtil.getOpenId(callback, loginSDKData, channelSDK);
    };
    HitalkOpenSDK.prototype.gamePay = function (params, callback) {
        var channelSDK = this.channelSDK;
        var snKey = this.snKey;
        HitalkLog_1.HitalkLog.info('====gamePay(接口调用)====');
        if (!channelSDK) {
            HitalkReturn_1.HitalkReturn.noSDK(callback, snKey);
            return;
        }
        if (typeof channelSDK.gamePay !== 'function') {
            HitalkReturn_1.HitalkReturn.noInterface(callback, snKey, 'gamePay');
            return;
        }
        // params = this.getExtraPayParams(params)
        params = ExtraParamsUtil_1.ExtraParamsUtil.getExtraPayParams(params);
        var paramName = HitalkCheck_1.HitalkCheck.checkPayParams(params);
        if (paramName) {
            HitalkReturn_1.HitalkReturn.paramsError(callback, 'gamePay游戏支付缺少参数/或类型错误', paramName);
            return;
        }
        //获取部分渠道,创建订单需要获取渠道的特殊数据
        ExtraParamsUtil_1.ExtraParamsUtil.assemblePayParams(params, channelSDK, function (resParams) {
            var requestParamsUrl = HitalkConfig_1.HitalkConfig.getSDKPayParamsURL() + "/" + exports.hitalkOpenSDK.snKey;
            var requestParams = {
                url: requestParamsUrl,
                data: resParams
            };
            //向服务器请求创建支付订单
            exports.hitalkOpenSDK.request(requestParams, function (payParams) {
                if ((payParams.data.snPaycode && payParams.data.snPaycode === 5) || (payParams.data.snPayCode && payParams.data.snPayCode === 5) || (payParams.data.code && payParams.data.code === 5)) {
                    var errmsg = payParams.data.snPaymsg ? payParams.data.snPaymsg : "登录信息过期,请重新登录后再发起充值";
                    HitalkReturn_1.HitalkReturn.retAllPay(callback, 5, errmsg, payParams.data);
                }
                else if (payParams.code === 0) {
                    channelSDK.gamePay(payParams.data, callback);
                }
                else {
                    if (typeof channelSDK.informGamePayFail == 'function') {
                        channelSDK.informGamePayFail(payParams); //创建订单失败通知渠道类回调
                    }
                    HitalkReturn_1.HitalkReturn.failErrorPay(callback, HitalkConfig_1.HitalkConfig.SDK_SERVER_PAY_PARAMS, payParams);
                }
            });
        });
    };
    HitalkOpenSDK.prototype.gameReport = function (actionNumber, params, callback) {
        var action;
        HitalkLog_1.HitalkLog.info('上报传入的actionNumber:' + actionNumber);
        if (typeof actionNumber === 'number') {
            action = HitalkCheck_1.HitalkCheck.checkReportAction(actionNumber);
            HitalkLog_1.HitalkLog.info('========数字转换后的action:' + action);
        }
        else if (actionNumber != undefined && actionNumber.length === 1) {
            // let  number= Number(actionNumber)
            var number = parseInt(actionNumber);
            action = HitalkCheck_1.HitalkCheck.checkReportAction(number);
            HitalkLog_1.HitalkLog.info('========字符串数字转换后的action:' + action);
        }
        else {
            action = actionNumber;
        }
        // ThinkingData.reportData(action, params) //数据上报测试
        //检查该渠道需要上报的接口
        var channelSDK = this.channelSDK;
        var snKey = this.snKey;
        HitalkLog_1.HitalkLog.info('====gameReport(接口调用)====action:' + action);
        if (!channelSDK) {
            HitalkReturn_1.HitalkReturn.noSDK(callback, snKey);
            return;
        }
        if (typeof channelSDK[action] !== 'function') {
            HitalkReturn_1.HitalkReturn.noInterface(callback, snKey, action);
            return;
        }
        //校验传递的数据
        // params = this.getExtraReportParams(params)
        params = ExtraParamsUtil_1.ExtraParamsUtil.getExtraReportParams(params);
        var paramName = HitalkCheck_1.HitalkCheck.checkReportParams(action, params);
        if (paramName) {
            HitalkReturn_1.HitalkReturn.paramsError(callback, action, paramName);
            return;
        }
        channelSDK[action](params);
        HitalkReturn_1.HitalkReturn.success(callback, action);
    };
    //扩展接口功能:平台接口---需要携带参数的扩展接口,action:扩展接口名称  params:扩展接口的参数
    HitalkOpenSDK.prototype.gameExtraAction = function (action, params, callback) {
        var channelSDK = this.channelSDK;
        var snKey = this.snKey;
        HitalkLog_1.HitalkLog.info('====gameExtraAction(接口调用)====action:' + action);
        if (!channelSDK) {
            HitalkReturn_1.HitalkReturn.noSDK(callback, snKey);
            return;
        }
        if (typeof params == 'string' && params == '' || params == null || params == undefined) {
            params = {};
        }
        //添加额外参数
        if (typeof params == 'function') {
            params = ExtraParamsUtil_1.ExtraParamsUtil.getExtraReportParams(params); //日语params传入是字符串.则不需要赋值
        }
        if (typeof channelSDK[action] !== 'function') {
            HitalkReturn_1.HitalkReturn.noInterface(callback, snKey, action);
            return;
        }
        channelSDK[action](params, callback);
    };
    /**
     * 1.扩展接口功能:平台接口状态---只有两种结果扩展接口
     * 2.此接口游戏初始化时需要实现--目前只有188wan第三方渠道需要
     */
    HitalkOpenSDK.prototype.gameExtraStatus = function (callback) {
        var self = this;
        var channelSDK = self.channelSDK;
        var snKey = self.snKey;
        HitalkLog_1.HitalkLog.info('====gameExtraStatus(接口调用)====');
        if (!channelSDK) {
            HitalkReturn_1.HitalkReturn.noSDK(callback, snKey);
            return;
        }
        /**分享功能需要判断两个条件:是否有分享功能;渠道文件是否已实现分享的代码 */
        GameExtraStatusUtil_1.GameExtraStatusUtil.shareMessage(channelSDK, self, callback);
        /**公众号功能需要判断是三个条件:是否有关注公众号的功能;玩家是否已经关注了公众号;渠道文件中是否已经实现了关注公众号功能代码 */
        GameExtraStatusUtil_1.GameExtraStatusUtil.showFocus(channelSDK, self, callback);
        /**实名认证功能需要判断两个条件:是否有实名认证功能;渠道文件是否已实现实名认证的代码 */
        GameExtraStatusUtil_1.GameExtraStatusUtil.realNameStatus(channelSDK, self, callback); //是否显示实名认证功能
        GameExtraStatusUtil_1.GameExtraStatusUtil.collectionStatus(channelSDK, self, callback); //是否显示收藏功能
        GameExtraStatusUtil_1.GameExtraStatusUtil.subscribeStatus(channelSDK, self, callback); //玩家是否已订阅(QQ小游戏和微信小游戏)
        GameExtraStatusUtil_1.GameExtraStatusUtil.shareRecommend(channelSDK, self, callback); //是否开启互推功能(微信小游戏)
        GameExtraStatusUtil_1.GameExtraStatusUtil.isRedPack(channelSDK, self, callback); //是否开启红包功能(微信小游戏) 
        GameExtraStatusUtil_1.GameExtraStatusUtil.customerServiceStatus(channelSDK, self, callback); //是否客服功能(微信小游戏)
        GameExtraStatusUtil_1.GameExtraStatusUtil.showRewardedVideoAdStatus(channelSDK, self, callback); //是否开启视频功能(QQ小游戏)
        GameExtraStatusUtil_1.GameExtraStatusUtil.exitOutStatus(channelSDK, self, callback); //是否开启退出功能状态
        GameExtraStatusUtil_1.GameExtraStatusUtil.isSomeChannel(channelSDK, self, callback); //是否玩吧渠道的某平台
        GameExtraStatusUtil_1.GameExtraStatusUtil.isPC(channelSDK, self, callback); //判断是否是PC端(玩吧)
        GameExtraStatusUtil_1.GameExtraStatusUtil.addColorSignStatus(channelSDK, self, callback); //是否开启游戏内显示彩签功能状态(QQ小游戏)
        GameExtraStatusUtil_1.GameExtraStatusUtil.saveImageToPhotosAlbumStatus(channelSDK, self, callback); //是否支持保存图片到系统相册功能(QQ小游戏)
        GameExtraStatusUtil_1.GameExtraStatusUtil.isSVIPStatus(channelSDK, self, callback); //是否支持Svip功能(疯狂游乐场)
        GameExtraStatusUtil_1.GameExtraStatusUtil.addRecentColorSignStatus(channelSDK, self, callback); //是否开启游戏内显示最近浏览彩签功能状态(QQ小游戏)
        GameExtraStatusUtil_1.GameExtraStatusUtil.isContentCheckStatus(channelSDK, self, callback); //是否支持敏感字校验接口功能
        GameExtraStatusUtil_1.GameExtraStatusUtil.isBindPhoneStatus(channelSDK, self, callback); //是否支持玩家绑定账号功能
        GameExtraStatusUtil_1.GameExtraStatusUtil.isDownloadStatus(channelSDK, self, callback); //是否支持下载微端
        GameExtraStatusUtil_1.GameExtraStatusUtil.isUserCenterStatus(channelSDK, self, callback); //是否支持个人中心
        GameExtraStatusUtil_1.GameExtraStatusUtil.isSurveyViewStatus(channelSDK, self, callback); //是否支持调查问卷
        GameExtraStatusUtil_1.GameExtraStatusUtil.isGameClubStatus(channelSDK, self, callback); //是否支持游戏圈
        GameExtraStatusUtil_1.GameExtraStatusUtil.isGetQRCodeStatus(channelSDK, self, callback); //是否支持获取二维码
        GameExtraStatusUtil_1.GameExtraStatusUtil.isJumpAppletStatus(channelSDK, self, callback); //是否支持跳转小程序
        GameExtraStatusUtil_1.GameExtraStatusUtil.isBlueVipStatus(channelSDK, self, callback); //是否支持蓝钻充值
        GameExtraStatusUtil_1.GameExtraStatusUtil.isVideoAdStatus(channelSDK, self, callback); //是否激励视频充值
        GameExtraStatusUtil_1.GameExtraStatusUtil.isActivityIconShowStatus(channelSDK, self, callback); //获取是否开启冲榜活动功能--高热
        GameExtraStatusUtil_1.GameExtraStatusUtil.isVipImg(channelSDK, self, callback); //获取是否开启获取VIP图片
        GameExtraStatusUtil_1.GameExtraStatusUtil.getUserNotice_fq(channelSDK, self, callback); //获取飞趣渠道获取转端配置
        GameExtraStatusUtil_1.GameExtraStatusUtil.isGameClubDecryptStatus(channelSDK, self, callback); //是否支持游戏圈数据解密
    };
    /**
     * 是否开启支付功能
     * @param params 判断是否开启支付的参数
     * @param callback 是否开启支付,true:开启(默认值),false:不需要支付
     */
    HitalkOpenSDK.prototype.isGamePay = function (params, callback) {
        var channelSDK = this.channelSDK;
        var snKey = this.snKey;
        if (!channelSDK) {
            HitalkReturn_1.HitalkReturn.noSDK(callback, snKey);
            return;
        }
        //添加额外参数
        params = ExtraParamsUtil_1.ExtraParamsUtil.getExtraReportParams(params);
        if (typeof channelSDK["isGamePay"] !== 'function') {
            HitalkLog_1.HitalkLog.info('==渠道未实现isGamePay接口,统一使用平台SGM后台管理系统控制==');
            return exports.hitalkOpenSDK.getServerIsGamePay(callback, params);
            // return callback(true)
        }
        channelSDK["isGamePay"](params, callback);
    };
    /**
     * 玩吧跳转链接,重新openUrl
     */
    HitalkOpenSDK.prototype.openUrl = function (params, callback) {
        var channelSDK = this.channelSDK;
        if (channelSDK && typeof channelSDK.openUrl === 'function') {
            channelSDK.openUrl(params, callback);
            return;
        }
        var url = params.url;
        window.open(url);
    };
    //游戏修改测试环境
    HitalkOpenSDK.prototype.resetConfig = function (param) {
        //是否是小游戏平台
        if (JudgePlatformUtil_1.JudgePlatformUtil.isMiNiGame()) {
            //不是小游戏渠道游戏不能修改
            HitalkConfig_1.HitalkConfig.IS_NORMAL = param;
            HitalkLog_1.HitalkLog.info('游戏修改SDK客户端进入测试环境,HitalkConfig.IS_NORMAL:' + HitalkConfig_1.HitalkConfig.IS_NORMAL);
            return;
        }
        HitalkLog_1.HitalkLog.error('不是小游戏渠道禁止修改SDK客户端测试环境');
    };
    return HitalkOpenSDK;
}());
exports.HitalkOpenSDK = HitalkOpenSDK;
exports.hitalkOpenSDK = new HitalkOpenSDK();
HitalkObject_1.HitalkObject.hitalkGlobal.hitalkOpenSDK = exports.hitalkOpenSDK;

},{"./const/HitalkConfig":4,"./const/HitalkObject":5,"./coreUtils/ExtraParamsUtil":6,"./coreUtils/GameExtraStatusUtil":7,"./coreUtils/GetIsGamePayUtil":8,"./coreUtils/GetOpenIdUtil":9,"./coreUtils/JudgePlatformUtil":10,"./coreUtils/LoadChannelUtil":11,"./utils/HitalkCheck":12,"./utils/HitalkLog":13,"./utils/HitalkRequest":14,"./utils/HitalkReturn":15}],2:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**平台接口类型 */
var ExtraAction = /** @class */ (function () {
    function ExtraAction() {
    }
    /**退出 */
    ExtraAction.EXITOUT = 'exitOut';
    /**打开分享 */
    ExtraAction.SHARE_MESSAGE = 'shareMessage';
    /**打开关注二维码 */
    ExtraAction.SHOW_FOCUS = 'showFocus';
    /**玩家是否已关注公众号 */
    ExtraAction.GET_IS_FOCUS = 'getIsFocus';
    /**实名认证realNameStatus */
    ExtraAction.REAL_NAME = 'verifyRealName';
    /**收藏功能 */
    ExtraAction.COLLECTION = 'collection';
    //以下为特殊渠道使用
    /**是否订阅功能(QQ小游戏和微信小游戏) */
    ExtraAction.SUBSCRIBE = 'subscribe';
    /**是否开启互推(微信小游戏) */
    ExtraAction.SHARE_RECOMMEND = 'shareRecommend';
    /**是否开启红包功能(QQ小游戏)  */
    ExtraAction.RED_PACK = 'redPack';
    /**客服功能常量  */
    ExtraAction.CUSTOMER_SERVICE = 'customerService';
    /**QQ小游戏视频接口常量 */
    ExtraAction.SHOW_REWARDED_VIDEO_AD = 'showRewardedVideoAd';
    /**是否玩吧渠道某平台 */
    ExtraAction.ISSOMECHANNEL = 'isSomeChannel';
    /**是否是PC端(玩吧) */
    ExtraAction.ISPC = 'isPC';
    /**是否在游戏内显示彩签功能(QQ小游戏) */
    ExtraAction.ADD_COLOR_SIGN = 'addColorSign';
    /**是否在游戏内显示最近浏览彩签功能(QQ小游戏) */
    ExtraAction.ADD_RECENT_COLOR_SIGN = 'addRecentColorSign';
    /**保存图片到系统相册功能(QQ小游戏)*/
    ExtraAction.SAVE_IMAGE_TO_PHOTOS_ALBUM = 'saveImageToPhotosAlbum';
    /**SVIP功能(疯狂游乐场) */
    ExtraAction.OPEN_SVIP = 'openSVIP';
    /**切换账号 */
    ExtraAction.SWITCH_ACCOUT = 'switchAccount';
    /**绑定账号 */
    ExtraAction.BIND_ACCOUT = 'bindAccount';
    /**support按钮 */
    ExtraAction.SUPPORT_INTERFACE = 'supportInterface';
    /**twitter按钮功能*/
    ExtraAction.TWITTER_BUTTON = 'twitterButton';
    /**敏感字功能*/
    ExtraAction.CONTENT_CHECK = 'contentCheck';
    /**玩家绑定手机号 */
    ExtraAction.BIND_PHONE = 'bindPhone';
    /**下载微端 */
    ExtraAction.DOWNLOAD = 'download';
    /**获取二维码图片 */
    ExtraAction.GETQRCODE = 'getQRCode';
    /**个人中心 */
    ExtraAction.USER_CENTER = 'userCenter';
    /**调查问卷 */
    ExtraAction.SURVEY_VIEW = 'surveyView';
    /**游戏圈 */
    ExtraAction.GAME_CLUB = 'gameClub';
    /**游戏圈数据解密 */
    ExtraAction.GAME_CLUB_DECRYPT = 'gameClubDecrypt';
    /**跳转小程序 */
    ExtraAction.JUMP_APPLET = 'jumpApplet';
    /**蓝钻充值 */
    ExtraAction.BLUE_VIP = 'blueVip';
    /**激励视频 */
    ExtraAction.VIDEO_AD = 'videoAd';
    /**冲榜活动功能--高热 */
    ExtraAction.ACTIVITY_ICON_SHOW = 'activityIconShow';
    /**获取VIP图片 */
    ExtraAction.VIP_IMG = 'vipImg';
    /**获取飞趣渠道获取转端配置 */
    ExtraAction.GET_USER_NOTICE_FQ = 'getUserNotice_fq';
    return ExtraAction;
}());
exports.ExtraAction = ExtraAction;

},{}],3:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**全局常量 */
var GlobalConstant = /** @class */ (function () {
    function GlobalConstant() {
    }
    /**注册上报常量 */
    GlobalConstant.REPORT_REGISTER = "reportRegister";
    /**创角上报常量 */
    GlobalConstant.REPORT_CREATE_ROLE = "reportCreateRole";
    /**登录上报常量 */
    GlobalConstant.REPORT_LOGIN = "reportLogin";
    /**等级上报常量 */
    GlobalConstant.REPORT_LEVEL_UP = "reportLevelUp";
    /**vip等级上报常量 */
    GlobalConstant.REPORT_VIP_LEVEL = "reportVipLevel";
    /**有效创角上报 */
    GlobalConstant.REPORT_EFFECTIVE_CREATE_ROLE = "reportEffectiveCreateRole";
    /**手Q打点上报 */
    GlobalConstant.REPORT_POINT = "reportPoint";
    return GlobalConstant;
}());
exports.GlobalConstant = GlobalConstant;

},{}],4:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var HitalkConfig = /** @class */ (function () {
    function HitalkConfig() {
    }
    /**向SDK服务器请求登录参数URL */
    HitalkConfig.getSDKLoginParamsURL = function (params) {
        var address = HitalkConfig.IS_NORMAL ? HitalkConfig.SERVER_ADDRESS_NORMAL_URL : HitalkConfig.SERVER_ADDRESS_TEST_URL;
        return (address + HitalkConfig.SDK_SERVER_LOGIN_PARAMS + HitalkConfig.assmebleParams(params));
    };
    /**向SDK服务器请求Openid URL */
    HitalkConfig.getSDKLoginOpenidURL = function (params) {
        var address = HitalkConfig.IS_NORMAL ? HitalkConfig.SERVER_ADDRESS_NORMAL_URL : HitalkConfig.SERVER_ADDRESS_TEST_URL;
        return (address +
            HitalkConfig.SDK_SERVER_LOGIN_OPENID +
            HitalkConfig.assmebleParams(params));
    };
    /**向SDK服务器请求支付参数 URL */
    HitalkConfig.getSDKPayParamsURL = function (params) {
        var address = HitalkConfig.IS_NORMAL
            ? HitalkConfig.SERVER_ADDRESS_NORMAL_URL
            : HitalkConfig.SERVER_ADDRESS_TEST_URL;
        return (address +
            HitalkConfig.SDK_SERVER_PAY_PARAMS +
            HitalkConfig.assmebleParams(params));
    };
    /**获取SDK客户端文件URL */
    HitalkConfig.getClientFileURL = function (params) {
        var address = HitalkConfig.IS_NORMAL
            ? HitalkConfig.CLIENT_ADDRESS_NORMAL_URL
            : HitalkConfig.CLIENT_ADDRESS_TEST_URL;
        return address;
    };
    /**向SDK服务器请求上报数据加密接口 URL */
    HitalkConfig.getSDKReportSignURL = function (params) {
        var address = HitalkConfig.IS_NORMAL
            ? HitalkConfig.SERVER_ADDRESS_NORMAL_URL
            : HitalkConfig.SERVER_ADDRESS_TEST_URL;
        return (address +
            HitalkConfig.SDK_SERVER_REPORT_SIGN +
            HitalkConfig.assmebleParams(params));
    };
    //获取服务器域名
    HitalkConfig.getIspServerURL = function () {
        var address = HitalkConfig.IS_NORMAL ? HitalkConfig.SERVER_ADDRESS_NORMAL_URL : HitalkConfig.SERVER_ADDRESS_TEST_URL;
        return address;
    };
    /**将对象转换为字符串健对值 */
    HitalkConfig.assmebleParams = function (params) {
        if (!params)
            return '';
        var urlParams;
        for (var key in params) {
            if (urlParams) {
                urlParams += '&' + key + '=' + params[key];
            }
            else {
                urlParams = '?' + key + '=' + params[key];
            }
        }
        return urlParams;
    };
    /**是否debug模式，debug模式会连入测试服 */
    HitalkConfig.IS_NORMAL = true; //true:正式服  false:测试服,根据url判断
    /**客户端SDK平台文件地址-测试服 */
    HitalkConfig.CLIENT_ADDRESS_TEST_URL = '//client2-dev.hhycdk.com/';
    /**客户端SDK平台文件地址-正式服 */
    HitalkConfig.CLIENT_ADDRESS_NORMAL_URL = '//client2.hhycdk.com/';
    /**SDK服务器请求地址-测试服 */
    HitalkConfig.SERVER_ADDRESS_TEST_URL = '//isp2-dev.hhycdk.com/';
    /**SDK服务器请求地址-正式服 */
    HitalkConfig.SERVER_ADDRESS_NORMAL_URL = '//isp2.hhycdk.com/';
    /**请求登录参数接口 */
    HitalkConfig.SDK_SERVER_LOGIN_PARAMS = 'login/params';
    /**请求OPENID接口 */
    HitalkConfig.SDK_SERVER_LOGIN_OPENID = 'login/index';
    /**请求支付参数接口 */
    HitalkConfig.SDK_SERVER_PAY_PARAMS = 'pay/create';
    /**渠道上报数据加密接口 */
    HitalkConfig.SDK_SERVER_REPORT_SIGN = 'report/sign';
    return HitalkConfig;
}());
exports.HitalkConfig = HitalkConfig;

},{}],5:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**海拓对象管理 */
var HitalkObject = /** @class */ (function () {
    function HitalkObject() {
    }
    /**全局对象 */
    HitalkObject.hitalkGlobal = window;
    return HitalkObject;
}());
exports.HitalkObject = HitalkObject;

},{}],6:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * 获取额外参数的工具类
 */
var ExtraParamsUtil = /** @class */ (function () {
    function ExtraParamsUtil() {
    }
    /**附带额外登录请求参数 */
    ExtraParamsUtil.getRequestLoginParams = function (params) {
        if (!params) {
            params = {};
        }
        params = this.getSnParams(params);
        params = this.getGameIdParams(params);
        return params;
    };
    /**附带额外上报参数  */
    ExtraParamsUtil.getExtraReportParams = function (params) {
        if (!params) {
            params = {};
        }
        params = this.getSnParams(params);
        params = this.getGameIdParams(params);
        params = this.getOpenIdParams(params);
        return params;
    };
    /**附带额外支付参数  */
    ExtraParamsUtil.getExtraPayParams = function (params) {
        if (!params) {
            params = {};
        }
        params = this.getSnParams(params);
        return params;
    };
    /**附带额外渠道参数  */
    ExtraParamsUtil.getExtraChannelParams = function (params) {
        if (!params) {
            params = {};
        }
        params = this.getSnParams(params);
        return params;
    };
    /**部分渠道特殊渠道的支付参数,需要从渠道url获取参数,例如:h0006(7477) */
    ExtraParamsUtil.assemblePayParams = function (params, channelSDK, callback) {
        if (!channelSDK) {
            return callback(params);
        }
        if (typeof channelSDK.assemblePayParams == 'function') {
            var assembleParams = channelSDK.assemblePayParams(params);
            callback(assembleParams);
        }
        else if (typeof channelSDK.assemblePayParamsCallback == 'function') {
            channelSDK.assemblePayParamsCallback(params, function (resParams) {
                callback(resParams);
            });
        }
        else {
            callback(params);
        }
    };
    /**获取sn参数 */
    ExtraParamsUtil.getSnParams = function (params) {
        params.snKey = hitalkOpenSDK.snKey;
        params.zoneKey = hitalkOpenSDK.zoneKey;
        params.tsKey = hitalkOpenSDK.tsKey;
        return params;
    };
    /**获取游戏id参数 */
    ExtraParamsUtil.getGameIdParams = function (params) {
        // params.gameId = this.initSDKData.gameId
        params.gameId = hitalkOpenSDK.gameId;
        return params;
    };
    /**获取openid参数 */
    ExtraParamsUtil.getOpenIdParams = function (params) {
        params.openId = hitalkOpenSDK.openId;
        return params;
    };
    return ExtraParamsUtil;
}());
exports.ExtraParamsUtil = ExtraParamsUtil;

},{}],7:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ExtraAction_1 = require("../const/ExtraAction");
/**
 * gameExtraStatus判断扩展接口状态工具类
 */
var GameExtraStatusUtil = /** @class */ (function () {
    function GameExtraStatusUtil() {
    }
    /**********************************gameExtraStatus接口核心功能START********************************* */
    /**
     * gameExtraStatus接口回调功能判断
     * 作用:处理需要判断多个callBack回调异步的问题
     */
    GameExtraStatusUtil.complete = function (code, callback) {
        this.sumCode |= code; //进行位运算赋值,并同时赋值给全局对象sumCode
        if (this.sumCode === -1 /* result */) {
            // this.send(callback)
            this.sumCode = 0; //清空位运算的结果
            callback && callback(hitalkOpenSDK.switchStatus); //gameExtraStatus接口回调方法
        }
    };
    /**********************************gameExtraStatus接口核心功能END*********************************** */
    /***************************************以下为扩展功能接口状态调用************************************************ */
    //获取分享功能状态
    GameExtraStatusUtil.shareMessage = function (channelSDK, self, callback) {
        /**分享功能需要判断两个条件:是否有分享功能;渠道文件是否已实现分享的代码 */
        if (channelSDK.isOpenShareMessage && channelSDK.shareMessage && channelSDK.isOpenShareMessage()) {
            // status[ExtraAction.SHARE_MESSAGE] = channelSDK.isOpenShareMessage()//true:有分享(显示)  false:没有分享(不显示)
            // self.switchStatus[ExtraAction.SHARE_MESSAGE] = {} //{}默认需要实现该功能--新接口
            var shareMessage = {};
            if (channelSDK.getShareUID && channelSDK.getShareUID() != undefined) { //渠道文件未配置该方法则跳过
                shareMessage = channelSDK.getShareUID();
            }
            self.switchStatus[ExtraAction_1.ExtraAction.SHARE_MESSAGE] = shareMessage; //获取分享人Id
            GameExtraStatusUtil.complete(1 /* SHARE_MESSAGE_CODE */, callback);
            // this.complete(1 <<0, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(1 /* SHARE_MESSAGE_CODE */, callback);
        }
    };
    //获取关注公众号功能状态
    GameExtraStatusUtil.showFocus = function (channelSDK, self, callback) {
        if (typeof channelSDK.isOpenShowFocus == 'function' &&
            typeof channelSDK.getIsFocus == 'function' &&
            typeof channelSDK.showFocus == 'function') {
            //channelSDK.isOpenShowFocus()---true:需要,false:不需要 是否打开关注二维码(该渠道是否有关注公众号的功能)
            channelSDK.isOpenShowFocus(function (isShow) {
                if (isShow) {
                    channelSDK.getIsFocus(function (isFocus) {
                        var switchStatus = {}; //{}默认需要实现该功能
                        //玩家是否已关注公众号
                        switchStatus['status'] = isFocus; //{status:true}--->true:已关注,false:未关注
                        self.switchStatus[ExtraAction_1.ExtraAction.SHOW_FOCUS] = switchStatus; //新接口
                        return;
                    });
                }
                console.log("该渠道不支持关注功能");
            });
            //调用回调
            GameExtraStatusUtil.complete(2 /* SHOW_FOCUS_CODE */, callback);
            // this.complete(1 << 1, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(2 /* SHOW_FOCUS_CODE */, callback);
        }
    };
    //获取实名认证信息
    GameExtraStatusUtil.realNameStatus = function (channelSDK, self, callback) {
        //该渠道是否有该功能
        if (typeof channelSDK.getRealNameStatus == 'function') {
            channelSDK.getRealNameStatus(function (res) {
                self.switchStatus[ExtraAction_1.ExtraAction.REAL_NAME] = res; //0:成年,1:未成年,2:未填写----新接口
                GameExtraStatusUtil.complete(4 /* REAL_NAME_CODE */, callback);
                // this.complete(1 << 2, callback)
            }.bind(self));
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(4 /* REAL_NAME_CODE */, callback);
        }
    };
    //获取收藏功能状态/添加到桌面(QQ小游戏)//创建桌面图标(oppo小游戏)
    GameExtraStatusUtil.collectionStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.collection == 'function' &&
            typeof channelSDK.isCollection == 'function' && channelSDK.isCollection()) {
            self.switchStatus[ExtraAction_1.ExtraAction.COLLECTION] = {}; //新接口 需要收藏功能
            //调用回调
            GameExtraStatusUtil.complete(8 /* COLLECTION_CODE */, callback);
            // this.complete(1 << 3, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(8 /* COLLECTION_CODE */, callback);
        }
    };
    //获取订阅功能状态(QQ小游戏) 
    GameExtraStatusUtil.subscribeStatus = function (channelSDK, self, callback) {
        /**订阅功能需要判断两个条件:是否有订阅功能;渠道文件是否已实现订阅的代码 */
        if (typeof channelSDK.isSubscribe == 'function' && typeof channelSDK.subscribe == 'function' && channelSDK.isSubscribe()) {
            //获取玩家是否订阅结果
            channelSDK.isSubscribe(function (res) {
                self.switchStatus[ExtraAction_1.ExtraAction.SUBSCRIBE] = res; //玩家是否订阅
                GameExtraStatusUtil.complete(16 /* SUBSCRIBE_CODE */, callback);
                // this.complete(1 <<4, callback)
            });
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(16 /* SUBSCRIBE_CODE */, callback);
        }
    };
    //是否开启互推功能(微信小游戏) 
    GameExtraStatusUtil.shareRecommend = function (channelSDK, self, callback) {
        /*
        判断条件:
        1.是否实现is_push()方法
        2.is_push()返回结果;true:需要,false:不需要
        */
        if (typeof channelSDK.shareRecommend == 'function' &&
            typeof channelSDK.getShareRecommend == 'function' && channelSDK.isPush) {
            //需要开启互推功能
            channelSDK.getShareRecommend({}, function (res) {
                var data = [];
                if (res) {
                    data = res;
                }
                // if (res && res.code == 1) {
                //     data = res.data
                // }
                self.switchStatus[ExtraAction_1.ExtraAction.SHARE_RECOMMEND] = data; //设置IS_PUSH空对象==true,既需要互推功能
                GameExtraStatusUtil.complete(32 /* SHARE_RECOMMEND */, callback);
                // this.complete(1 <<5, callback)
            });
        }
        else {
            //该渠道不需要互推功能,直接设置回调
            GameExtraStatusUtil.complete(32 /* SHARE_RECOMMEND */, callback);
            // this.complete(1 <<5, callback)
        }
    };
    //是否开启红包功能(QQ小游戏,微信小游戏) 
    GameExtraStatusUtil.isRedPack = function (channelSDK, self, callback) {
        /*
        判断条件:
        1.是否实现is_red_pack()方法
        2.is_red_pack()返回结果;true:需要,false:不需要
        */
        if (typeof channelSDK.isRedPack == 'function' && channelSDK.isRedPack()) {
            //需要开启红包功能
            self.switchStatus[ExtraAction_1.ExtraAction.RED_PACK] = {};
            GameExtraStatusUtil.complete(64 /* RED_PACK */, callback);
            // this.complete(1 <<6, callback)
        }
        else {
            //该渠道不需要红包功能,直接设置回调
            GameExtraStatusUtil.complete(64 /* RED_PACK */, callback);
            // this.complete(1 <<6, callback)
        }
    };
    //是否开启客服功能
    GameExtraStatusUtil.customerServiceStatus = function (channelSDK, self, callback) {
        /**客服功能需要判断两个条件:是否有客服功能;渠道文件是否已实现客服的代码 */
        if (typeof channelSDK.isCustomerService == 'function' &&
            typeof channelSDK.customerService == 'function' &&
            channelSDK.isCustomerService()) {
            //是否开启客服功能
            self.switchStatus[ExtraAction_1.ExtraAction.CUSTOMER_SERVICE] = {}; //是否开启客服功能
            GameExtraStatusUtil.complete(128 /* CUSTOMER_SERVICE */, callback);
            // this.complete(1 <<7, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(128 /* CUSTOMER_SERVICE */, callback);
        }
    };
    //是否开启QQ小游戏视频功能状态
    GameExtraStatusUtil.showRewardedVideoAdStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.showRewardedVideoAd == 'function' && channelSDK.isShowRewardedVideoAdBoolean()) {
            self.switchStatus[ExtraAction_1.ExtraAction.SHOW_REWARDED_VIDEO_AD] = {}; //新接口 需要视频功能
            //调用回调
            GameExtraStatusUtil.complete(256 /* SHOW_REWARDED_VIDEO_AD */, callback);
            // this.complete(1 << 8, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(256 /* SHOW_REWARDED_VIDEO_AD */, callback);
        }
    };
    //是否开启退出功能状态---废弃,游戏内没有退出功能
    GameExtraStatusUtil.exitOutStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.exitOut == 'function') {
            self.switchStatus[ExtraAction_1.ExtraAction.EXITOUT] = {}; //新接口 需要退出功能
            //调用回调
            GameExtraStatusUtil.complete(512 /* EXITOUT_CODE */, callback);
            // this.complete(1 << 9, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(512 /* EXITOUT_CODE */, callback);
        }
    };
    //是否玩吧渠道的某平台
    GameExtraStatusUtil.isSomeChannel = function (channelSDK, self, callback) {
        if (typeof channelSDK.isSomeChannel == 'function') {
            channelSDK.isSomeChannel(function (channelCode) {
                self.switchStatus[ExtraAction_1.ExtraAction.ISSOMECHANNEL] = channelCode; //0-玩吧原生,1-玩吧微信,2-玩吧心悦
                GameExtraStatusUtil.complete(1024 /* ISSOMECHANNEL_CODE */, callback);
                // this.complete(1 << 10, callback)
            });
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(1024 /* ISSOMECHANNEL_CODE */, callback);
        }
    };
    //判断是否是PC端(玩吧)
    GameExtraStatusUtil.isPC = function (channelSDK, self, callback) {
        if (typeof channelSDK.isPC == 'function') {
            channelSDK.isPC({}, function (boo) {
                self.switchStatus[ExtraAction_1.ExtraAction.ISPC] = boo; //true/false
                GameExtraStatusUtil.complete(2048 /* ISPC_CODE */, callback);
                // this.complete(1 << 11, callback)
            });
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(2048 /* ISPC_CODE */, callback);
        }
    };
    //是否开启游戏内显示彩签功能状态(QQ小游戏)
    GameExtraStatusUtil.addColorSignStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.addColorSign == 'function' && typeof channelSDK.isAddColorSign == "function" && channelSDK.isAddColorSignBoolean()) {
            var params = {
                status: 0 /* ADULT_CODE */,
            };
            channelSDK.isAddColorSign(params, function (res) {
                self.switchStatus[ExtraAction_1.ExtraAction.ADD_COLOR_SIGN] = res;
                //调用回调
                GameExtraStatusUtil.complete(4096 /* ADD_COLOR_SIGN_CODE */, callback);
                // this.complete(1 << 12, callback)
            });
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(4096 /* ADD_COLOR_SIGN_CODE */, callback);
        }
    };
    //是否开启游戏内显示最近浏览彩签功能状态(QQ小游戏)
    GameExtraStatusUtil.addRecentColorSignStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.addRecentColorSign == 'function' && typeof channelSDK.isAddRecentColorSign == "function" && channelSDK.isAddRecentColorSignBoolean()) {
            var params = {
                status: 0 /* ADULT_CODE */,
            };
            channelSDK.isAddRecentColorSign(params, function (res) {
                self.switchStatus[ExtraAction_1.ExtraAction.ADD_RECENT_COLOR_SIGN] = res;
                //调用回调
                GameExtraStatusUtil.complete(32768 /* ADD_RECENT_COLOR_SIGN_CODE */, callback);
                // this.complete(1 << 15, callback)
            });
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(32768 /* ADD_RECENT_COLOR_SIGN_CODE */, callback);
        }
    };
    //是否支持保存图片到系统相册功能(QQ小游戏)
    GameExtraStatusUtil.saveImageToPhotosAlbumStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.saveImageToPhotosAlbum == 'function' && typeof channelSDK.isSaveImageToPhotosAlbum == "function" && channelSDK.isSaveImageToPhotosAlbum()) {
            var params = {
                status: 1 /* MINOR_CODE */,
            };
            channelSDK.isSaveImageToPhotosAlbum(params, function (res) {
                self.switchStatus[ExtraAction_1.ExtraAction.SAVE_IMAGE_TO_PHOTOS_ALBUM] = res;
                //调用回调
                GameExtraStatusUtil.complete(8192 /* SAVE_IMAGE_TO_PHOTOS_ALBUM_CODE */, callback);
                // this.complete(1 << 13, callback)
            });
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(8192 /* SAVE_IMAGE_TO_PHOTOS_ALBUM_CODE */, callback);
        }
    };
    //是否支持Svip功能(爱微游,疯狂游乐场)
    GameExtraStatusUtil.isSVIPStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.openSVIP == 'function' && typeof channelSDK.getSVIPIcon == "function" && channelSDK.isSVIPStatus()) {
            channelSDK.getSVIPIcon(function (res) {
                self.switchStatus[ExtraAction_1.ExtraAction.OPEN_SVIP] = {
                    buttonIcon: res.buttonIcon
                };
                //调用回调
                GameExtraStatusUtil.complete(16384 /* OPEN_SVIP_CODE */, callback);
                // this.complete(1 << 14, callback)
            });
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(16384 /* OPEN_SVIP_CODE */, callback);
        }
    };
    //是否支持敏感字校验接口功能
    GameExtraStatusUtil.isContentCheckStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.contentCheck == 'function') {
            if (typeof channelSDK.isClientOrServer == 'function') {
                self.switchStatus[ExtraAction_1.ExtraAction.CONTENT_CHECK] = {
                    status: channelSDK.isClientOrServer() //true:由客户端校验敏感字,false:由服务端校验敏感字
                };
            }
            else {
                self.switchStatus[ExtraAction_1.ExtraAction.CONTENT_CHECK] = { status: true }; //默认客户端检验
            }
            //调用回调
            GameExtraStatusUtil.complete(1048576 /* CONTENT_CHECK_CODE */, callback);
            // this.complete(1 << 20, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(1048576 /* CONTENT_CHECK_CODE */, callback);
        }
    };
    //绑定玩家手机号功能
    GameExtraStatusUtil.isBindPhoneStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.bindPhone == "function" && channelSDK.isBindPhone()) {
            var VCodeStatus = { verificationCodeStatus: false };
            if (typeof channelSDK.verificationCode == 'function') {
                VCodeStatus.verificationCodeStatus = true;
            }
            self.switchStatus[ExtraAction_1.ExtraAction.BIND_PHONE] = VCodeStatus;
            //调用回调
            GameExtraStatusUtil.complete(2097152 /* BIND_PHONE_CODE */, callback);
            // this.complete(1 << 21, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(2097152 /* BIND_PHONE_CODE */, callback);
        }
    };
    //下载微端
    GameExtraStatusUtil.isDownloadStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.download == "function" && channelSDK.isDownload()) {
            self.switchStatus[ExtraAction_1.ExtraAction.DOWNLOAD] = {};
            //调用回调
            GameExtraStatusUtil.complete(4194304 /* DOWNLOAD_CODE */, callback);
            // this.complete(1 << 22, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(4194304 /* DOWNLOAD_CODE */, callback);
        }
    };
    //个人中心
    GameExtraStatusUtil.isUserCenterStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.userCenter == "function" && channelSDK.isUserCenter()) {
            self.switchStatus[ExtraAction_1.ExtraAction.USER_CENTER] = {};
            //调用回调
            GameExtraStatusUtil.complete(8388608 /* USER_CENTER_CODE */, callback);
            // this.complete(1 << 23, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(8388608 /* USER_CENTER_CODE */, callback);
        }
    };
    //调查问卷
    GameExtraStatusUtil.isSurveyViewStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.surveyView == "function" && channelSDK.isSurveyView()) {
            self.switchStatus[ExtraAction_1.ExtraAction.SURVEY_VIEW] = {};
            //调用回调
            GameExtraStatusUtil.complete(16777216 /* SURVEY_VIEW_CODE */, callback);
            // this.complete(1 << 24, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(16777216 /* SURVEY_VIEW_CODE */, callback);
        }
    };
    //游戏圈
    GameExtraStatusUtil.isGameClubStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.isGameClub == "function" && channelSDK.isGameClub()) {
            self.switchStatus[ExtraAction_1.ExtraAction.GAME_CLUB] = {};
            //调用回调
            GameExtraStatusUtil.complete(33554432 /* GAMECLUB_CODE */, callback);
            // this.complete(1 << 25, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(33554432 /* GAMECLUB_CODE */, callback);
        }
    };
    //是否支持游戏圈数据解密接口功能
    GameExtraStatusUtil.isGameClubDecryptStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.gameClubDecrypt == 'function') {
            if (typeof channelSDK.isGameClubDecrypt == 'function') {
                self.switchStatus[ExtraAction_1.ExtraAction.GAME_CLUB_DECRYPT] = {
                    status: channelSDK.isGameClubDecrypt() //true:由客户端解密游戏圈数据,false:由服务端解密游戏圈数据
                };
            }
            else {
                self.switchStatus[ExtraAction_1.ExtraAction.GAME_CLUB_DECRYPT] = { status: true }; //默认客户端解密游戏圈数据
            }
            //调用回调
            GameExtraStatusUtil.complete(4 /* GAME_CLIB_DECRYPT_CODE */, callback);
            // this.complete(1 << 20, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(4 /* GAME_CLIB_DECRYPT_CODE */, callback);
        }
    };
    //获取二维码图片
    GameExtraStatusUtil.isGetQRCodeStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.getQRCode == "function" && channelSDK.isGetQRCode()) {
            self.switchStatus[ExtraAction_1.ExtraAction.GETQRCODE] = {};
            //调用回调
            GameExtraStatusUtil.complete(67108864 /* GETQRCODE_CODE */, callback);
            // this.complete(1 << 26, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(67108864 /* GETQRCODE_CODE */, callback);
        }
    };
    //获取是否跳转小程序状态
    GameExtraStatusUtil.isJumpAppletStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.isJumpApplet == "function" && channelSDK.isJumpApplet()) {
            self.switchStatus[ExtraAction_1.ExtraAction.JUMP_APPLET] = {};
            //调用回调
            GameExtraStatusUtil.complete(134217728 /* JUMP_APPLET_CODE */, callback);
            // this.complete(1 << 27, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(134217728 /* JUMP_APPLET_CODE */, callback);
        }
    };
    //获取是否开启蓝钻充值功能
    GameExtraStatusUtil.isBlueVipStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.isBlueVip == "function" && channelSDK.isBlueVip()) {
            self.switchStatus[ExtraAction_1.ExtraAction.BLUE_VIP] = true;
            //调用回调
            GameExtraStatusUtil.complete(268435456 /* BLUE_VIP_CODE */, callback);
            // this.complete(1 << 28, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(268435456 /* BLUE_VIP_CODE */, callback);
        }
    };
    //获取是否开启激励视频功能
    GameExtraStatusUtil.isVideoAdStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.isVideoAd == "function" && channelSDK.isVideoAd()) {
            self.switchStatus[ExtraAction_1.ExtraAction.VIDEO_AD] = true;
            //调用回调
            GameExtraStatusUtil.complete(536870912 /* VIDEO_AD_CODE */, callback);
            // this.complete(1 << 29, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(536870912 /* VIDEO_AD_CODE */, callback);
        }
    };
    //获取是否开启冲榜活动功能--高热
    GameExtraStatusUtil.isActivityIconShowStatus = function (channelSDK, self, callback) {
        if (typeof channelSDK.isActivityIconShow == "function" && channelSDK.isActivityIconShow()) {
            self.switchStatus[ExtraAction_1.ExtraAction.ACTIVITY_ICON_SHOW] = true;
            //调用回调
            GameExtraStatusUtil.complete(1073741824 /* ACTIVITY_ICON_SHOW_CODE */, callback);
            // this.complete(1 << 30, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(1073741824 /* ACTIVITY_ICON_SHOW_CODE */, callback);
        }
    };
    //获取是否开启获取VIP图片
    GameExtraStatusUtil.isVipImg = function (channelSDK, self, callback) {
        if (typeof channelSDK.isVipImg == "function" && channelSDK.isVipImg()) {
            self.switchStatus[ExtraAction_1.ExtraAction.VIP_IMG] = true;
            //调用回调
            GameExtraStatusUtil.complete(-2147483648 /* VIP_IMG */, callback);
            // this.complete(1 << 31, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(-2147483648 /* VIP_IMG */, callback);
        }
    };
    //获取飞趣渠道获取转端配置
    GameExtraStatusUtil.getUserNotice_fq = function (channelSDK, self, callback) {
        if (typeof channelSDK.getUserNotice_fq == "function" && channelSDK.getUserNotice_fq()) {
            self.switchStatus[ExtraAction_1.ExtraAction.GET_USER_NOTICE_FQ] = true;
            //调用回调
            GameExtraStatusUtil.complete(2 /* GET_USER_NOTICE_FQ */, callback);
            // this.complete(1 << 32, callback)
        }
        else {
            //渠道未实现该功能,直接设置回调
            GameExtraStatusUtil.complete(2 /* GET_USER_NOTICE_FQ */, callback);
        }
    };
    GameExtraStatusUtil.sumCode = 0;
    return GameExtraStatusUtil;
}());
exports.GameExtraStatusUtil = GameExtraStatusUtil;

},{"../const/ExtraAction":2}],8:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * 获取支付状态工具类
 */
var GetIsGamePayUtil = /** @class */ (function () {
    function GetIsGamePayUtil() {
    }
    /**获取玩家的OPENID */
    GetIsGamePayUtil.getServerIsGamePay = function (callback, params) {
        //该渠道支持isGamePay接口
        var url = hitalkOpenSDK.getIspServerURL();
        // 拼接url
        url = url + 'issueExt/getIsGamePay/' + hitalkOpenSDK.snKey;
        var requestVo = {
            url: url,
            data: params
        };
        hitalkOpenSDK.request(requestVo, function (res) {
            hitalkOpenSDK.hitalkLog.info('获取SDK支付状态成功，回调参数：' + JSON.stringify(res));
            if (res.code == 0) {
                // 查询成功 获取isgamepay状态值 0：开启，1：关闭
                if (res.data.isGamePay == 1) {
                    // 确认支付开关为1，关闭状态
                    hitalkOpenSDK.hitalkLog.info('SDK支付状态为关闭状态，(0:开启,1:关闭)状态值为：' + res.data.isGamePay);
                    callback(false);
                    return;
                }
            }
            hitalkOpenSDK.hitalkLog.info('SDK支付状态开启，(0:开启,1:关闭)状态值为res:' + JSON.stringify(res));
            callback(true);
        });
    };
    /**
     * 微信支付回调通用
     * 安卓支付回调失败后的回调机制
     * @param requestUrl 回调url
     * @param data 回调的参数
     */
    GetIsGamePayUtil.wxErrorPayCallback = function (self, requestUrl, data, callback) {
        var paramsBack = {
            requestUrl: requestUrl,
            data: data
        };
        self.wxPayCallback(paramsBack, self, 1, 0, function (boo) {
            if (boo) {
                hitalkOpenSDK.hitalkReturn.successPay(callback, 'gamePay successPay', "ok"); //setClipboardData回调
                return;
            }
            hitalkOpenSDK.hitalkReturn.failErrorPay(callback, 'gamePay failErrorPay', boo); //setClipboardData回调
        });
    };
    /*
    * 微信支付回调失败后的,重复回调机制
    *
    * params:通知回调的参数
    * self:作用域
    * backNumber:当前回调次数
    * timeoutID:定时器Id
    * callback:通知回调
    * 回调时间间隔:回调次数*3秒=下次回调的间隔时间(3、6、9、12、15秒)，5次回调后不再回调
    * 回调成功判断:服务端返回"SUCCESS"字符串,即为发货成功
    */
    GetIsGamePayUtil.prototype.wxPayCallback = function (params, self, backNumber, timeoutID, callback) {
        //通知游戏发货
        var requestUrl = params.requestUrl;
        var data = params.data;
        //取消延时定时器
        if (timeoutID != 0) {
            clearTimeout(timeoutID);
        }
        // 发起网络请求
        self.Wx.request({
            url: requestUrl,
            method: 'POST',
            data: data,
            header: {
                'content-type': 'application/json' // 默认值
            },
            success: function (res) {
                if (res.data.indexOf("SUCCESS") == -1) {
                    // if(res.data.indexOf("PayController.charge error.")>-1||res.data.indexOf("ERROR")>-1){
                    //再次发起支付回调
                    hitalkOpenSDK.hitalkLog.error(self.snKey + '发货失败,第' + backNumber + '次支付回调,res.data:' + JSON.stringify(res.data));
                    //重新发起回调
                    if (backNumber < 6) {
                        setTimeout(function (timeoutNum) {
                            self.wxPayCallback(params, self, backNumber + 1, timeoutNum, callback);
                        }, 3000 * backNumber, params); //3秒后再次发起回调  n*3秒之后再回调
                    }
                    else {
                        callback(false);
                    }
                    return;
                }
                hitalkOpenSDK.hitalkLog.info(self.snKey + '发货成功,第' + backNumber + '次支付回调,res.data:' + JSON.stringify(res.data));
                callback(true);
            },
            fail: function (res) {
                hitalkOpenSDK.hitalkLog.error(self.snKey + '发货失败fail,第' + backNumber + '次支付回调,res.data:' + JSON.stringify(res.data));
                //重新发起回调
                if (backNumber < 6) {
                    setTimeout(function (timeoutNum) {
                        self.wxPayCallback(params, self, backNumber + 1, timeoutNum, callback);
                    }, 3000 * backNumber, params); //2秒后再次发起回调
                }
                else {
                    callback(false);
                }
            }
        });
    };
    return GetIsGamePayUtil;
}());
exports.GetIsGamePayUtil = GetIsGamePayUtil;

},{}],9:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ExtraParamsUtil_1 = require("../coreUtils/ExtraParamsUtil");
var HitalkConfig_1 = require("../const/HitalkConfig");
var HitalkReturn_1 = require("../utils/HitalkReturn");
/**
 * 获取玩家OpenId工具类
 */
var GetOpenIdUtil = /** @class */ (function () {
    function GetOpenIdUtil() {
    }
    /**获取玩家的OPENID */
    GetOpenIdUtil.getOpenId = function (callback, loginSDKData, channelSDK) {
        var self = this;
        var channelSDKSelf = channelSDK;
        var loginSDKDataSelf = loginSDKData;
        var loginParams = ExtraParamsUtil_1.ExtraParamsUtil.getRequestLoginParams();
        var requestParamsUrl = HitalkConfig_1.HitalkConfig.getSDKLoginParamsURL() + "/" + hitalkOpenSDK.snKey;
        var requestParams = {
            url: requestParamsUrl,
            data: loginParams
        };
        //请求获取渠道登录参数(/params)
        hitalkOpenSDK.request(requestParams, function (params) {
            if (params.code === 0) {
                self.channelSDKLogin(callback, loginSDKDataSelf, channelSDKSelf, params.data);
            }
            else {
                HitalkReturn_1.HitalkReturn.fail(callback, HitalkConfig_1.HitalkConfig.SDK_SERVER_LOGIN_PARAMS, params.data);
            }
        });
        // }
    };
    GetOpenIdUtil.channelSDKLogin = function (callback, loginSDKData, channelSDK, params) {
        var self = this;
        console.log("进入channelSDKLogin:" + hitalkOpenSDK.snKey);
        channelSDK.login(function (channelParams) {
            if (channelParams.retCode && channelParams.retCode == -1) {
                HitalkReturn_1.HitalkReturn.fail(callback, 'login()接口登录失败', channelParams);
                return;
            }
            //初始化开关状态
            hitalkOpenSDK.gameExtraStatus(function () {
            }.bind(self));
            channelParams = ExtraParamsUtil_1.ExtraParamsUtil.getRequestLoginParams(channelParams);
            var requestOpenidUrl = HitalkConfig_1.HitalkConfig.getSDKLoginOpenidURL() + "/" + hitalkOpenSDK.snKey;
            var requestOpenidVo = {
                url: requestOpenidUrl,
                data: channelParams
            };
            //请求获取平台OpenId(/index)
            hitalkOpenSDK.request(requestOpenidVo, function (openidParams) {
                if (openidParams.code !== 0) {
                    HitalkReturn_1.HitalkReturn.failCode(callback, HitalkConfig_1.HitalkConfig.SDK_SERVER_LOGIN_OPENID, openidParams);
                    if (typeof channelSDK.informLoginFail == 'function') {
                        channelSDK.informLoginFail(openidParams); //登录失败通知渠道类回调
                    }
                    return;
                }
                hitalkOpenSDK.openId = openidParams.data.openId;
                hitalkOpenSDK.snOpenId = openidParams.data.snOpenId;
                hitalkOpenSDK.snUserInfoJson = openidParams.data.snUserInfoJson;
                if (hitalkOpenSDK.tsKey == "quickSdk") {
                    hitalkOpenSDK.snKey = JSON.parse(openidParams.data.snUserInfoJson).snKey;
                    console.log("[quickSdk]snKey:" + hitalkOpenSDK.snKey);
                }
                if (typeof channelSDK.informLoginSuccess == 'function') {
                    channelSDK.informLoginSuccess(openidParams.data); //登录成功通知渠道类回调
                }
                HitalkReturn_1.HitalkReturn.success(callback, 'login', openidParams.data);
            });
        }, loginSDKData, params);
    };
    return GetOpenIdUtil;
}());
exports.GetOpenIdUtil = GetOpenIdUtil;

},{"../const/HitalkConfig":4,"../coreUtils/ExtraParamsUtil":6,"../utils/HitalkReturn":15}],10:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var HitalkLog_1 = require("../utils/HitalkLog");
var HitalkConfig_1 = require("../const/HitalkConfig");
/**
 * 判断环境或小游戏平台工具类
 */
var JudgePlatformUtil = /** @class */ (function () {
    function JudgePlatformUtil() {
    }
    /**判断是否是正式服环境;判断url上是否携带debug参数*/
    JudgePlatformUtil.isFormal = function () {
        //通过url获取标识
        var debug = hitalkOpenSDK.getUrlParameter('hitalkDebug');
        // let xyxConfig = hitalkOpenSDK.xyxConfig
        if (debug || debug === '1') {
            HitalkLog_1.HitalkLog.info('SDK客户端进入测试环境,hitalkDebug:' + debug + ';返回结果IS_NORMAL:false');
            HitalkConfig_1.HitalkConfig.IS_NORMAL = false;
        }
        else if (hitalkOpenSDK.snKey != undefined && hitalkOpenSDK.is_normal === 1) {
            //小游戏渠道,使用xyxConfig.ts中的is_normal字段判断
            HitalkLog_1.HitalkLog.info('SDK客户端小游戏渠道进入测试环境,hitalkOpenSDK.is_normal:' + hitalkOpenSDK.is_normal);
            HitalkConfig_1.HitalkConfig.IS_NORMAL = false; //进入测试环境
        }
        else {
            HitalkLog_1.HitalkLog.info('SDK客户端进入正式环境,hitalkDebug:' + debug + ';返回结果IS_NORMAL:true');
        }
        var isAbroad = hitalkOpenSDK.getUrlParameter('isAbroad');
        console.log("isAbroad:" + isAbroad);
        // 自动区分国内/海外SDK域名
        if (!hitalkOpenSDK.snKey) {
            if (isAbroad && isAbroad == "2") {
                this.isOverseasDomainName2();
            }
            else if (isAbroad || isAbroad == '1') {
                this.isOverseasDomainName();
            }
        }
    };
    /**是否小游戏平台 */
    JudgePlatformUtil.isMiNiGame = function () {
        if (!hitalkOpenSDK.getUrlParameter('snKey')) {
            return true;
        }
        return false;
    };
    //自动切换海外域名
    JudgePlatformUtil.isOverseasDomainName = function () {
        //海外域名1--使用国内已备案域名
        HitalkConfig_1.HitalkConfig.CLIENT_ADDRESS_TEST_URL = '//int-client-dev.hhycdk.com/';
        HitalkConfig_1.HitalkConfig.CLIENT_ADDRESS_NORMAL_URL = '//int-client.hhycdk.com/';
        HitalkConfig_1.HitalkConfig.SERVER_ADDRESS_TEST_URL = '//int-isp-dev.hhycdk.com/';
        HitalkConfig_1.HitalkConfig.SERVER_ADDRESS_NORMAL_URL = '//int-isp.hhycdk.com/';
        console.log("当前页面是海外域名,修改为海外域名url:" +
            "\nHitalkConfig.CLIENT_ADDRESS_TEST_URL==>" + HitalkConfig_1.HitalkConfig.CLIENT_ADDRESS_TEST_URL +
            "\nHitalkConfig.CLIENT_ADDRESS_NORMAL_URL==>" + HitalkConfig_1.HitalkConfig.CLIENT_ADDRESS_NORMAL_URL +
            "\nHitalkConfig.SERVER_ADDRESS_TEST_URL==>" + HitalkConfig_1.HitalkConfig.SERVER_ADDRESS_TEST_URL +
            "\nHitalkConfig.SERVER_ADDRESS_NORMAL_URL==>" + HitalkConfig_1.HitalkConfig.SERVER_ADDRESS_NORMAL_URL);
    };
    //自动切换海外未备案域名
    JudgePlatformUtil.isOverseasDomainName2 = function () {
        //海外域名2--使用海外未备案域名
        HitalkConfig_1.HitalkConfig.CLIENT_ADDRESS_TEST_URL = '//int-client-dev.hkcxsd.com/';
        HitalkConfig_1.HitalkConfig.CLIENT_ADDRESS_NORMAL_URL = '//int-client.hkcxsd.com/';
        HitalkConfig_1.HitalkConfig.SERVER_ADDRESS_TEST_URL = '//int-isp-dev.hkcxsd.com/';
        HitalkConfig_1.HitalkConfig.SERVER_ADDRESS_NORMAL_URL = '//int-isp.hkcxsd.com/';
        console.log("当前页面是海外域名,修改为海外未备案域名url:" +
            "\nHitalkConfig.CLIENT_ADDRESS_TEST_URL==>" + HitalkConfig_1.HitalkConfig.CLIENT_ADDRESS_TEST_URL +
            "\nHitalkConfig.CLIENT_ADDRESS_NORMAL_URL==>" + HitalkConfig_1.HitalkConfig.CLIENT_ADDRESS_NORMAL_URL +
            "\nHitalkConfig.SERVER_ADDRESS_TEST_URL==>" + HitalkConfig_1.HitalkConfig.SERVER_ADDRESS_TEST_URL +
            "\nHitalkConfig.SERVER_ADDRESS_NORMAL_URL==>" + HitalkConfig_1.HitalkConfig.SERVER_ADDRESS_NORMAL_URL);
    };
    return JudgePlatformUtil;
}());
exports.JudgePlatformUtil = JudgePlatformUtil;

},{"../const/HitalkConfig":4,"../utils/HitalkLog":13}],11:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// import { HitalkConfig } from './const/HitalkConfig'
var HitalkObject_1 = require("../const/HitalkObject");
/**
 * 获取渠道参数工具类
 */
var LoadChannelUtil = /** @class */ (function () {
    function LoadChannelUtil() {
    }
    /**获取url后的渠道参数 */
    LoadChannelUtil.loadChannelParams = function () {
        if (!HitalkObject_1.HitalkObject.hitalkGlobal)
            return;
        var htgwindow = HitalkObject_1.HitalkObject.hitalkGlobal;
        var htgurl = htgwindow.location.search; //获取url中"?"符后的字串
        if (htgwindow['OPEN_DATA'] && htgwindow['OPEN_DATA'].appurl) {
            var realStr = htgwindow['OPEN_DATA'].appurl.split('?')[1];
            if (realStr)
                htgurl = '?' + realStr;
        }
        var htgobj = {};
        if (htgurl && htgurl.indexOf('?') != -1) {
            var strs = htgurl.substr(1).split('&');
            for (var i = 0; i < strs.length; i++) {
                var param = strs[i].split('=');
                htgobj[param[0]] = decodeURIComponent(param[1]);
            }
        }
        hitalkOpenSDK.urlParams = htgobj;
    };
    /**获取当前渠道ID */
    LoadChannelUtil.getSnKey = function () {
        //通过url传入渠道标识
        var snKey = hitalkOpenSDK.getUrlParameter('snKey');
        if (snKey) {
            return snKey;
        }
        return '';
    };
    /**获取当前子渠道ID */
    LoadChannelUtil.getZoneKey = function () {
        // let zoneKey = hitalkOpenSDK.urlParams.zoneKey
        var zoneKey = hitalkOpenSDK.getUrlParameter('zoneKey');
        if (zoneKey) {
            return zoneKey;
        }
        return 'hitalkZone';
    };
    /**判断该渠道是否使用第三方SDK对接(例如QuickSDK) */
    LoadChannelUtil.getTsKey = function () {
        //通过url获取标识
        // let tsKey = hitalkOpenSDK.urlParams.tsKey || ''
        var tsKey = hitalkOpenSDK.getUrlParameter('tsKey');
        if (tsKey) {
            return tsKey;
        }
        return '';
    };
    return LoadChannelUtil;
}());
exports.LoadChannelUtil = LoadChannelUtil;

},{"../const/HitalkObject":5}],12:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GlobalConstant_1 = require("../const/GlobalConstant");
var HitalkLog_1 = require("./HitalkLog");
var HitalkCheck = /** @class */ (function () {
    function HitalkCheck() {
    }
    HitalkCheck.checkSnVO = function (params) {
        if (!params)
            return "\u4F20\u5165\u53C2\u6570\u5BF9\u8C61\u4E3A\u7A7A" /* PARAMS_UNDIFINED */;
        if (typeof params.snKey !== 'string') {
            return 'snKey';
        }
        if (typeof params.zoneKey !== 'string') {
            return 'zoneKey';
        }
        return undefined;
    };
    HitalkCheck.checkUserInfoVO = function (params, errParamName) {
        if (!params)
            return "\u4F20\u5165\u53C2\u6570\u5BF9\u8C61\u4E3A\u7A7A" /* PARAMS_UNDIFINED */;
        if (typeof params.openId !== 'string') {
            errParamName += '\nopenId';
            // return 'openId'
        }
        if (typeof params.roleId !== 'string') {
            errParamName += '\nroleId';
            // return 'roleId'
        }
        if (typeof params.roleName !== 'string') {
            errParamName += '\nroleName';
            // return 'roleName'
        }
        if (typeof params.roleLevel !== 'number') {
            errParamName += '\nroleLevel';
            // return 'roleLevel'
        }
        if (typeof params.vipGrade !== 'number') {
            errParamName += '\nvipGrade';
            // return 'vipGrade'
        }
        //areaId默认是string类型,目前少年封神是数值的,还没有做修改,如果此处做验证少年封神会不能支付
        if (typeof params.areaId !== 'string') {
            //有些游戏还未修改,暂时只做提示不做限制
            HitalkLog_1.HitalkLog.error('缺少参数/类型错误--->areaId');
            // errParamName += '\nareaId'
            // return "areaId";
        }
        if (typeof params.areaName !== 'string') {
            errParamName += '\nareaName';
            // return 'areaName'
        }
        // return undefined
        return errParamName;
    };
    HitalkCheck.checkGameIdVO = function (params) {
        if (!params)
            return "\u4F20\u5165\u53C2\u6570\u5BF9\u8C61\u4E3A\u7A7A" /* PARAMS_UNDIFINED */;
        if (typeof params.gameId !== 'number') {
            return 'gameId';
        }
        return undefined;
    };
    /**检查init参数 */
    HitalkCheck.checkInitVO = function (params) {
        if (!params)
            return "\u4F20\u5165\u53C2\u6570\u5BF9\u8C61\u4E3A\u7A7A" /* PARAMS_UNDIFINED */;
        var paramName;
        paramName = HitalkCheck.checkGameIdVO(params);
        if (paramName) {
            return paramName;
        }
        return undefined;
    };
    /**检查pay参数 */
    HitalkCheck.checkPayParams = function (params) {
        var errParamName = ''; //错误参数名
        if (!params)
            return "\u4F20\u5165\u53C2\u6570\u5BF9\u8C61\u4E3A\u7A7A" /* PARAMS_UNDIFINED */;
        var paramName;
        paramName = HitalkCheck.checkGameIdVO(params);
        if (paramName) {
            return paramName;
        }
        paramName = HitalkCheck.checkSnVO(params);
        if (paramName) {
            return paramName;
        }
        paramName = HitalkCheck.checkUserInfoVO(params, errParamName);
        if (paramName) {
            errParamName += '\n' + paramName;
            // return paramName
        }
        if (typeof params.productId !== 'string' || params.productId == '0') {
            HitalkLog_1.HitalkLog.error('商品ID参数错误--->productId');
            errParamName += '\nproductId';
            // return 'productId'
        }
        if (typeof params.amount !== 'number') {
            errParamName += '\namount';
            // return 'amount'
        }
        if (typeof params.gameOrderNo !== 'string') {
            errParamName += '\ngameOrderNo';
            // return 'gameOrderNo'
        }
        if (typeof params.timestamp !== 'number') {
            errParamName += '\ntimestamp';
            // return 'timestamp'
        }
        if (typeof params.sign !== 'string') {
            errParamName += '\nsign';
            // return 'sign'
        }
        if (typeof params.extension !== 'string') {
            errParamName += '\nextension';
            // return 'extension'
        }
        // return undefined
        return errParamName;
    };
    /**检查report参数 */
    HitalkCheck.checkReportParams = function (action, params) {
        var errParamName = ''; //存储上报错误字段名
        if (action == 'reportRegister') {
            //注册上报只需要校验createTime参数(其余参数都是全局变量获取的)
            if (typeof params.createTime !== 'string') {
                HitalkLog_1.HitalkLog.error('reportRegister缺少参数/类型错误--->createTime');
                // return 'createTime' //有些游戏未实现,暂时只做提示不做限制
            }
            return undefined;
        }
        if (action == 'reportPoint') {
            //打点上报只需要校验部分参数参数
            if (typeof params.pointType !== 'string') {
                HitalkLog_1.HitalkLog.error('自定义打点缺少打点类型参数/类型错误--->pointType');
                // errParamName += '\npointType'
            }
            if (typeof params.pointName !== 'string') {
                HitalkLog_1.HitalkLog.error('自定义打点缺少打点名称参数/类型错误--->pointName');
                // errParamName += '\npointName'
            }
            if (typeof params.pointValue !== 'string') {
                HitalkLog_1.HitalkLog.error('自定义打点缺少打点值参数/类型错误--->pointValue');
                // errParamName += '\npointValue'
            }
            return errParamName;
        }
        if (!params)
            return "\u4F20\u5165\u53C2\u6570\u5BF9\u8C61\u4E3A\u7A7A" /* PARAMS_UNDIFINED */;
        var paramName;
        paramName = HitalkCheck.checkGameIdVO(params);
        if (paramName) {
            return paramName;
        }
        paramName = HitalkCheck.checkSnVO(params);
        if (paramName) {
            return paramName;
        }
        paramName = HitalkCheck.checkUserInfoVO(params, errParamName);
        if (paramName) {
            errParamName += '\n' + paramName;
            // return paramName
        }
        if (typeof params.roleTurnup !== 'number') {
            errParamName += '\nroleTurnup';
            // return 'roleTurnup'
        }
        if (typeof params.roleTurnupName !== 'string') {
            HitalkLog_1.HitalkLog.error('缺少角色战力参数/类型错误--->roleTurnupName');
            // errParamName += '\nroleTurnupName'
            // return 'roleTurnup'
        }
        if (typeof params.createTime !== 'number') {
            errParamName += '\ncreateTime';
            // return 'createTime'
        }
        if (typeof params.moneyNum !== 'number') {
            errParamName += '\nmoneyNum';
            // return 'moneyNum'
        }
        if (typeof params.rolePower !== 'number') {
            HitalkLog_1.HitalkLog.error('缺少角色战力参数/类型错误--->rolePower');
            // errParamName += '\nrolePower'//只做提示
            // return 'rolePower'
        }
        if (typeof params.createRoleTime !== 'number') {
            HitalkLog_1.HitalkLog.error('缺少创角时间参数上报--->createRoleTime');
            // errParamName += '\nroleTurnupName'
            // return 'roleTurnup'
        }
        // return undefined
        return errParamName;
    };
    //上报类型转换
    HitalkCheck.checkReportAction = function (action) {
        if (action == 1) {
            //注册上报
            return GlobalConstant_1.GlobalConstant.REPORT_REGISTER;
        }
        else if (action == 2) {
            //创角上报
            return GlobalConstant_1.GlobalConstant.REPORT_CREATE_ROLE;
        }
        else if (action == 3) {
            //登录上报
            return GlobalConstant_1.GlobalConstant.REPORT_LOGIN;
        }
        else if (action == 4) {
            //等级上报
            return GlobalConstant_1.GlobalConstant.REPORT_LEVEL_UP;
        }
        else if (action == 5) {
            //vip等级上报
            return GlobalConstant_1.GlobalConstant.REPORT_VIP_LEVEL;
        }
        else if (action == 6) {
            //自定义打点数据上报
            return GlobalConstant_1.GlobalConstant.REPORT_POINT;
        }
        else if (action == 7) {
            //有效创角上报
            return GlobalConstant_1.GlobalConstant.REPORT_EFFECTIVE_CREATE_ROLE;
        }
        else {
            console.error('====gameReport上报类型action错误====>' + action);
            return undefined;
        }
    };
    return HitalkCheck;
}());
exports.HitalkCheck = HitalkCheck;

},{"../const/GlobalConstant":3,"./HitalkLog":13}],13:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * 日志打印类
 *
 */
var HitalkLog = /** @class */ (function () {
    function HitalkLog() {
    }
    HitalkLog.info = function (msg) {
        if (!this.isOpen)
            return;
        var logStyle = this.logStyle("#989898");
        var logMsg = this.logMsg(msg);
        console.info(logMsg, logStyle);
    };
    HitalkLog.warn = function (msg) {
        if (!this.isOpen)
            return;
        var logStyle = this.logStyle("#00768f");
        var logMsg = this.logMsg(msg);
        console.info(logMsg, logStyle);
    };
    HitalkLog.error = function (msg) {
        if (!this.isOpen)
            return;
        var logStyle = this.logStyle("#ff4238");
        var logMsg = this.logMsg(msg);
        console.info(logMsg, logStyle);
    };
    /**打印信息 */
    HitalkLog.logMsg = function (msg) {
        return '%c ' + this.headMsg + msg;
    };
    /** 打印样式 */
    HitalkLog.logStyle = function (color) {
        if (color === void 0) { color = "grey"; }
        return "color:" + color;
    };
    /**是否开启日志打印 */
    HitalkLog.isOpen = true;
    HitalkLog.headMsg = "FP-SDK日志:";
    return HitalkLog;
}());
exports.HitalkLog = HitalkLog;

},{}],14:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var HitalkRequest = /** @class */ (function () {
    function HitalkRequest() {
    }
    /**网络请求 */
    HitalkRequest.request = function (params, callback, thisobj) {
        var url = params.url;
        var requestType = params.requestType || 'POST';
        var xhr = new XMLHttpRequest();
        var postData;
        xhr.open(requestType, url, true);
        xhr.setRequestHeader('Content-type', 'application/json');
        xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
        xhr.setRequestHeader('Access-Control-Allow-Methods', 'POST, PUT, GET, OPTIONS, DELETE');
        xhr.setRequestHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, client_id, uuid, Authorization');
        xhr.addEventListener('load', function () {
            if (callback) {
                callback.call(thisobj, JSON.parse(xhr.response));
            }
        });
        if (params.data) {
            console.log('ruquert发送的参数:' + JSON.stringify(params));
            postData = JSON.stringify(params.data);
            xhr.send(postData);
        }
        else {
            xhr.send(null);
        }
    };
    return HitalkRequest;
}());
exports.HitalkRequest = HitalkRequest;

},{}],15:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var HitalkLog_1 = require("./HitalkLog");
/**回调处理类 */
var HitalkReturn = /** @class */ (function () {
    function HitalkReturn() {
    }
    /**请求错误 */
    HitalkReturn.fail = function (callback, interfaceName, errorData) {
        if (errorData === void 0) { errorData = {}; }
        HitalkLog_1.HitalkLog.error(interfaceName + "接口请求失败,errorData:" + JSON.stringify(errorData));
        var ret = {};
        ret.retCode = -1 /* FAIL */;
        ret.retMsg = "\u8BE5\u53C2\u6570\u7F3A\u5C11\u6216\u7C7B\u578B\u6709\u8BEF" /* PARAMS_ERROR */;
        ret.data = errorData;
        HitalkReturn.returnFun(callback, ret);
    };
    /**服务端错误信息 */
    HitalkReturn.failCode = function (callback, interfaceName, errorData) {
        if (errorData === void 0) { errorData = {}; }
        HitalkLog_1.HitalkLog.error(interfaceName + "接口请求失败,errorData:" + JSON.stringify(errorData));
        var ret = {};
        ret.retCode = errorData.code;
        ret.retMsg = errorData.msg;
        ret.data = errorData;
        HitalkReturn.returnFun(callback, ret);
    };
    /**请求成功 */
    HitalkReturn.success = function (callback, interfaceName, data) {
        if (data === void 0) { data = {}; }
        HitalkLog_1.HitalkLog.info(interfaceName + "接口请求成功,data:" + JSON.stringify(data));
        var ret = {};
        ret.retCode = 0 /* SUCEESS */;
        ret.retMsg = "\u8BF7\u6C42\u6210\u529F" /* SUCEESS */;
        ret.data = data;
        HitalkReturn.returnFun(callback, ret);
    };
    /**无SDK*/
    HitalkReturn.noSDK = function (callback, snKey) {
        HitalkLog_1.HitalkLog.error(snKey + "平台SDK文件未加载！");
        var ret = {};
        ret.retCode = -5 /* NO_SDK */;
        ret.retMsg = "channel\u4E3A\u7A7A\u6216\u8005\u6682\u672A\u63A5\u5165\u8BE5\u6E20\u9053" /* NO_SDK */;
        HitalkReturn.returnFun(callback, ret);
    };
    /**接口无实现 */
    HitalkReturn.noInterface = function (callback, snKey, interfaceName) {
        HitalkLog_1.HitalkLog.warn(snKey + "平台不支持该接口===" + interfaceName + "===");
        var ret = {};
        ret.retCode = -3 /* NO_INTERFACE */;
        ret.retMsg = "\u8BE5\u6E20\u9053\u672A\u5B9E\u73B0\u8BE5\u63A5\u53E3" /* NO_INTERFACE */ + ":" + interfaceName;
        HitalkReturn.returnFun(callback, ret);
    };
    /*参数缺少或者类型错误 */
    HitalkReturn.paramsError = function (callback, interfaceName, paramName) {
        HitalkLog_1.HitalkLog.error(interfaceName + ":参数缺少或者数据类型错误->" + paramName);
        var ret = {};
        ret.retCode = -4 /* PARAMS_ERROR */;
        ret.retMsg = "\u8BE5\u53C2\u6570\u7F3A\u5C11\u6216\u7C7B\u578B\u6709\u8BEF" /* PARAMS_ERROR */ + ":" + paramName;
        HitalkReturn.returnFun(callback, ret);
    };
    /**回调处理函数*/
    HitalkReturn.returnFun = function (callback, ret) {
        if (callback) {
            callback.call(null, ret);
        }
    };
    /**支付成功--0 */
    HitalkReturn.successPay = function (callback, interfaceName, data) {
        if (data === void 0) { data = {}; }
        HitalkLog_1.HitalkLog.info(interfaceName + "接口请求成功,data:" + JSON.stringify(data));
        var ret = {};
        ret.retCode = 0 /* SUCEESS */;
        ret.retMsg = "\u8BF7\u6C42\u6210\u529F" /* SUCEESS */;
        ret.data = data;
        HitalkReturn.returnFun(callback, ret);
    };
    /**支付通用回调接口 */
    HitalkReturn.retAllPay = function (callback, retCode, retMsg, data) {
        if (data === void 0) { data = {}; }
        var ret = {};
        ret.retCode = retCode;
        if (retMsg != "" && retMsg != undefined) {
            ret.retMsg = retMsg;
        }
        ret.data = data;
        HitalkReturn.returnFun(callback, ret);
    };
    /**支付失败--1 */
    HitalkReturn.failErrorPay = function (callback, interfaceName, errorData) {
        if (errorData === void 0) { errorData = {}; }
        HitalkLog_1.HitalkLog.error(interfaceName + "接口请求失败,errorData:" + JSON.stringify(errorData));
        var ret = {};
        ret.retCode = 1 /* PAY_FAIL */;
        ret.retMsg = "\u652F\u4ED8\u5931\u8D25" /* PAY_FAIL */;
        ret.data = errorData;
        HitalkReturn.returnFun(callback, ret);
    };
    /**支付取消--2 */
    HitalkReturn.failCancelPay = function (callback, interfaceName, errorData) {
        if (errorData === void 0) { errorData = {}; }
        HitalkLog_1.HitalkLog.error(interfaceName + "接口请求取消,errorData:" + JSON.stringify(errorData));
        var ret = {};
        ret.retCode = 2 /* PAY_CANCLE */;
        ret.retMsg = "\u652F\u4ED8\u53D6\u6D88" /* PAY_CANCLE */;
        ret.data = errorData;
        HitalkReturn.returnFun(callback, ret);
    };
    /**支付失败,需要重新发起支付订单--3 */
    HitalkReturn.failAfreshPay = function (callback, interfaceName, errorData) {
        if (errorData === void 0) { errorData = {}; }
        HitalkLog_1.HitalkLog.error(interfaceName + "接口请求取消,errorData:" + JSON.stringify(errorData));
        var ret = {};
        ret.retCode = 3 /* PAY_AFRESH */;
        ret.retMsg = "\u652F\u4ED8\u5931\u8D25,\u9700\u8981\u91CD\u65B0\u53D1\u8D77\u652F\u4ED8\u8BA2\u5355" /* PAY_AFRESH */;
        ret.data = errorData;
        HitalkReturn.returnFun(callback, ret);
    };
    /**登录失败,需要实名认证再登陆==-2 */
    HitalkReturn.failRealName = function (callback, interfaceName, errorData) {
        if (errorData === void 0) { errorData = {}; }
        HitalkLog_1.HitalkLog.error(interfaceName + "接口请求失败,errorData:" + JSON.stringify(errorData));
        var ret = {};
        ret.retCode = -2 /* FAIL_REAL_NAME */;
        ret.retMsg = "\u767B\u5F55\u5931\u8D25,\u9700\u8981\u5B9E\u540D\u8BA4\u8BC1\u518D\u767B\u9646" /* FAIL_REAL_NAME */;
        ret.data = errorData;
        HitalkReturn.returnFun(callback, ret);
    };
    return HitalkReturn;
}());
exports.HitalkReturn = HitalkReturn;

},{"./HitalkLog":13}]},{},[1]);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var arkSDK = require("./sn_js/gfWxXyx/arkSdk_wxXyx.js");
var GFWxXyx = /** @class */ (function () {
    function GFWxXyx() {
        this.snKey = hitalkOpenSDK.snKey;
        this.zoneKey = hitalkOpenSDK.zoneKey;
        this.gameId = hitalkOpenSDK.gameId;
        this.Wx = window["wx"]; //微信小游戏全局对象
    }
    GFWxXyx.prototype.init = function (callback) {
        var self = this;
        self.arkXyxSDK = arkSDK;
        self.arkXyxSDK = window["arkXyxSDK"];
        //获取当前手机系统,支付的时候区分支付方式
        self.SystemInfoSync = self.Wx.getSystemInfoSync();
        hitalkOpenSDK.setChannelSdk(self); //将初始化完成对象赋值给channelSDK全局对象
        callback(self); //渠道文件初始化完成回调
    };
    GFWxXyx.prototype.login = function (callback, loginSDKData, params) {
        var self = this;
        //调用登录接口,在初始化完成之后调用,获取玩家openId等信息
        self.arkXyxSDK.init(function (res) {
            if (res.code === 1) {
                hitalkOpenSDK.hitalkLog.info('arkSDK初始化成功:' + JSON.stringify(res));
                self.arkXyxSDK.login(function (res) {
                    if (res.code === 1) {
                        hitalkOpenSDK.hitalkLog.info('登录成功: res=>' + JSON.stringify(res));
                        self.gamePackageId = res.data.gamePackageId;
                        self.xyxOpenId = res.data.xyxOpenId;
                        res.data.query = self.Wx.getLaunchOptionsSync().query;
                        res.data.scene = self.Wx.getLaunchOptionsSync().scene;
                        res.data.platform = self.SystemInfoSync.platform;
                        hitalkOpenSDK.hitalkLog.info('获取LaunchOptionsSync.query的参数:' + JSON.stringify(res.data.query));
                        callback(res.data);
                    }
                    else {
                        hitalkOpenSDK.hitalkLog.error('登录失败: res=>' + JSON.stringify(res));
                        //注意:调用平台登录接口失败后,需要跳转游戏页面显示重新登录的按钮
                    }
                });
            }
            else {
                hitalkOpenSDK.hitalkLog.info('arkSDK初始化失败:' + JSON.stringify(res));
            }
            //debug:1(测试环境),不传或其它为正式环境
        }, { debug: params.debug });
    };
    //该渠道支付参数需要新增的额外参数
    GFWxXyx.prototype.assemblePayParams = function (params) {
        var self = this;
        var data = {
            gamePackageId: self.gamePackageId
        };
        params.system = self.SystemInfoSync.platform;
        params.snExtension = JSON.stringify(data);
        return params;
    };
    GFWxXyx.prototype.gamePay = function (params, callback) {
        var self = this;
        hitalkOpenSDK.hitalkLog.info('gzFangZhou支付接口游戏参数 param:' + JSON.stringify(params));
        self.arkXyxSDK.pay(params, function (ret) {
            hitalkOpenSDK.hitalkLog.info('gzFangZhou支付接口,回调数据:' + JSON.stringify(ret));
            if (ret.code == -1) {
                hitalkOpenSDK.hitalkLog.info("base64Code:" + JSON.stringify(ret.data));
                hitalkOpenSDK.hitalkReturn.retAllPay(callback, 4 /* PAY_QR_CODE */, "", ret.data);
            }
        });
    };
    //******************************************* 扩展功能:敏感字功能 START ***********************************************//
    //检测敏感词接口
    GFWxXyx.prototype.contentCheck = function (params, callback) {
        var self = this;
        var checData = {
            scene: params.scene,
            content: params.content,
        };
        self.arkXyxSDK.msgSecCheck(checData, function (ret) {
            hitalkOpenSDK.hitalkLog.info('msgSecCheck 接口回调的参数：' + JSON.stringify(ret));
            if (ret.code == 1) {
                hitalkOpenSDK.hitalkReturn.success(callback, "contentCheck success", params);
            }
            else {
                hitalkOpenSDK.hitalkReturn.fail(callback, "contentCheck fail", "");
            }
        });
    };
    GFWxXyx.prototype.isClientOrServer = function () {
        return true; //true:由客户端校验敏感字,false:由服务端校验敏感字
    };
    //******************************************* 扩展功能:敏感字功能 END ***********************************************//
    //*******************************************扩展功能:分享功能START***********************************************//
    // /**分享接口*/
    // shareMessage(params?: any, callback?: Function): void {
    //     let self = this
    //     self.shareData(function (res: any) {
    //         if(res.retCode==-1){
    //             hitalkOpenSDK.hitalkLog.info('获取分享数据失败')
    //             hitalkOpenSDK.hitalkReturn.fail(callback, 'shareMessage  error', '获取分享数据失败')
    //             return 
    //         }
    //         let query: string = 'shareSnOpenId=' + hitalkOpenSDK.snOpenId //获取分享人渠道openId
    //         let shareParams = self.paramsJsonStr(params)
    //         if (shareParams != '') {
    //             query += "&" + shareParams
    //         }
    //         hitalkOpenSDK.hitalkLog.info('分享接口传递的数据query:' + query)
    //         let data: any = {
    //             title: res.data['title'], //非必传 转发标题，不传则默认使用当前小游戏的昵称。
    //             imageUrl: res.data['imgUrl'], //非必传 转发显示图片的链接，可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5:4
    //             query: query, //非必传 查询字符串，从这条转发消息进入后，可通过 wx.getLaunchOptionsSync() 或 wx.onShow() 获取启动参数中的 query。必须是 key1=val1&key2=val2 的格式。
    //             imageUrlId: "", //非必传 审核通过的图片 ID
    //             toCurrentGroup: "", //非必传 （默认值为true）是否转发到当前群。该参数只对从群工具栏打开的场景下生效，默认转发到当前群，填入false时可转发到其他会话。
    //             path: "", //非必传 独立分包路径。
    //         };
    //         self.Wx.shareAppMessage(data)
    //         setTimeout(function () {
    //             //直接返回分享成功
    //             hitalkOpenSDK.hitalkReturn.success(callback, 'shareMessage', '默认返回成功')
    //         }, 5000); //延时5秒
    //     })
    // }
    // /**获取分享人ID*/
    // getShareUID() {
    //     let res = {}
    //     // //获取分享人的id,缓存值全局
    //     let query = this.Wx.getLaunchOptionsSync().query
    //     res['query'] = query
    //     hitalkOpenSDK.hitalkLog.info('获取分享的数据query:' + JSON.stringify(query))
    //     return res
    // }
    // /**是否可以分享 */
    // isOpenShareMessage() {
    //     return true //true:显示分享按钮   false:隐藏分享按钮
    // }
    // //获取服务器配置的分享数据
    // private shareData(callback: Function) {
    //     let self = this
    //     //1.获取url
    //     let requestUrl: string = hitalkOpenSDK.getIspServerURL() + 'issueExt/share/' + hitalkOpenSDK.snKey //获取url
    //     // let requestUrl: string = '//isp-dev.hhycdk.com/ext/share/' +slWxXyx.snKey + '/' +slWxXyx.zoneKey + '/' +slWxXyx.gameId //获取url
    //     hitalkOpenSDK.hitalkLog.info('分享请求的url:' + requestUrl)
    //     //2.拼装请求的url和data
    //     let data = {
    //         snKey: self.snKey
    //     }
    //     let requestOpenidVo: RequestParamsVO = { url: requestUrl, data: JSON.stringify(data), requestType: "POST" }
    //     //3.向服务器获取分享标题和imageUrl
    //     hitalkOpenSDK.request(requestOpenidVo, function (resParams: any) {
    //         // hitalkOpenSDK.hitalkLog.info('微信小游戏服务器获取分享信息成功,返回结果resParams:' + JSON.stringify(resParams))
    //         if (resParams.code != 0) {
    //             // hitalkOpenSDK.hitalkLog.error('微信小游戏服务器获取分享信息失败,返回结果resParams:' + JSON.stringify(resParams))
    //             hitalkOpenSDK.hitalkReturn.fail(callback, 'shareData', '微信小游戏服务器获取分享信息失败,返回结果resParams:' + JSON.stringify(resParams))
    //             return
    //         }
    //         hitalkOpenSDK.hitalkReturn.success(callback, 'shareData', resParams.data)
    //     })
    // }
    //*******************************************扩展功能:分享功能END***********************************************//
    //*******************************************扩展接口功能:订阅接口START***********************************************//
    //查询用户的订阅状态:初始化查询用户订阅状态,以便游戏确定显示"订阅"图标
    //获取玩家订阅结果
    GFWxXyx.prototype.isSubscribe = function (callback) {
        if (callback) {
            callback({ oneStatus: false });
        }
        return true;
    };
    //发起主动订阅请求:用户点击"允许订阅"时触发,如果用户点击"取消"则不触发!! 
    //params.type-->0:长期订阅 1:一次性订阅 (默认)
    //发起主动订阅请求:用户点击"允许订阅"时触发,如果用户点击"取消"则不触发!! 
    GFWxXyx.prototype.subscribe = function (params, callback) {
        var self = this;
        //获取订阅模板id
        var tmplIds = params.tmplIds;
        hitalkOpenSDK.hitalkLog.info("订阅消息,params:" + JSON.stringify(params) + ";;tmplIds:" + JSON.stringify(tmplIds));
        var data = {
            "type": 0,
            "tmplIds": tmplIds,
        };
        self.arkXyxSDK.extraAction("subscribe", data, function (res) {
            if (res.code == 1) {
                //表示订阅成功
                hitalkOpenSDK.switchStatus.subscribe.oneStatus = true;
                hitalkOpenSDK.hitalkReturn.success(callback, "subscribe", res.data);
            }
            else {
                //表示订阅失败
                hitalkOpenSDK.switchStatus.subscribe.oneStatus = false;
                hitalkOpenSDK.hitalkLog.error("用户拒绝接收一次性订阅消息");
                hitalkOpenSDK.hitalkReturn.fail(callback, "subscribe", res.data);
            }
        });
    };
    //*******************************************扩展接口功能:订阅接口end***********************************************//
    //*******************************************扩展接口功能:激励视频接口start***********************************************//
    GFWxXyx.prototype.isVideoAd = function () {
        return true;
    };
    //激励视频
    GFWxXyx.prototype.videoAd = function (params, callback) {
        var self = this;
        var data = {
            "adUnitId": params.adUnitId,
        };
        self.arkXyxSDK.extraAction("rewardedVideoAd", data, function (res) {
            if (res.code == 1) {
                hitalkOpenSDK.hitalkLog.info("正常播放结束，可以下发游戏奖励,adUnitId:" + data.adUnitId);
                hitalkOpenSDK.hitalkReturn.success(callback, 'videoAd', '已看完视频');
            }
            else {
                // 播放中途退出，不下发游戏奖励
                hitalkOpenSDK.hitalkLog.info("播放中途退出，不下发游戏奖励,adUnitId:" + data.adUnitId);
                hitalkOpenSDK.hitalkReturn.fail(callback, 'videoAd', "未看完视频");
            }
        });
    };
    //*******************************************扩展接口功能:激励视频接口end***********************************************//
    /**拼接json字段*/
    GFWxXyx.prototype.paramsJsonStr = function (paramsJson) {
        var str = '';
        if (paramsJson != undefined && paramsJson != null && JSON.stringify(paramsJson) != '{}') {
            for (var key in paramsJson) {
                str += key + '=' + paramsJson[key] + '&';
            }
            str = str.substring(0, str.length - 1);
        }
        return str;
    };
    /**获取手机系统版本*/
    GFWxXyx.prototype.getSystemVersion = function () {
        var systemVersion = '';
        var sysinfo = this.SystemInfoSync;
        if (sysinfo.system && sysinfo.system != '') {
            systemVersion = sysinfo.system;
        }
        return systemVersion;
    };
    GFWxXyx.prototype.request = function (params, callback, thisobj) {
        var self = this;
        hitalkOpenSDK.hitalkLog.info('request请求的参数' + JSON.stringify(params));
        var startTime = Date.now();
        var requestUrl = 'https:' + params.url;
        // 发起网络请求
        this.Wx.request({
            url: requestUrl,
            method: params.requestType || 'POST',
            data: params.data,
            header: {
                'content-type': 'application/json' // 默认值
            },
            success: function (res) {
                var endTime = Date.now();
                hitalkOpenSDK.hitalkLog.info('request请求成功,响应耗时:' + (endTime - startTime) + '毫秒\n请求参数:' + JSON.stringify(params) + '\n响应返回结果:' + JSON.stringify(res.data));
                hitalkOpenSDK.hitalkLog.info('request请求成功' + JSON.stringify(res.data));
                callback(res.data);
            },
            fail: function (res) {
                var endTime = Date.now();
                hitalkOpenSDK.hitalkLog.error('request请求失败,响应耗时:' + (endTime - startTime) + '毫秒\n请求参数:' + JSON.stringify(params) + '\n响应返回结果:' + JSON.stringify(res.data));
                hitalkOpenSDK.hitalkLog.error('request请求失败' + JSON.stringify(res.data));
                callback("error");
            }
        });
    };
    return GFWxXyx;
}());
var gfWxXyx = new GFWxXyx();
hitalkOpenSDK.xyxImpl = gfWxXyx; //改用XyxImpl全局对象初始化---与H5渠道不同
