'use strict'
!(function(require, directRequire) {
  const a = require('./15ba1827c7f6564a45df6bd44da3a977.js'),
    b = require('./3bfffbe88b3d923921f851c0697974fe.js'),
    c = require('./f171257bbcaef547a3cf27266ccb0db2.js'),
    d = require('./0634ee2ebd3e560d9d4804ecc960160f.js')
  module.exports = {
    getUserAutoFillData: async function(d, e) {
      let f = e.args,
        g = {
          appid: b.getProjectAppID(),
          get_all_info: !1,
          source: 1,
          user_info_list: f.fields
        },
        { body: h } = await a({
          url: `${c.getUserAutoFillData}`,
          method: 'post',
          body: JSON.stringify(g),
          needToken: 1,
          needAppID: 1
        })
      return {
        errMsg: `${e.api}:ok`,
        userData: h.user_info_json || '{}',
        authStatus: h.auth_status,
        authInfo: h.auth_info,
        authGroupList: h.auth_group_list
      }
    },
    setUserAutoFillData: async function(d, e) {
      let f = {
          appid: b.getProjectAppID(),
          source: 1,
          user_info_json: args.dataList
        },
        { body: g } = await a({
          url: `${c.setUserAutoFillData}`,
          method: 'post',
          body: JSON.stringify(f),
          needToken: 1,
          needAppID: 1
        })
      return { errMsg: `${e.api}:ok` }
    },
    requestAuthUserAutoFillData: async function(e, f, g) {
      let h = f.args,
        i = f.callbackID,
        j = f.api
      e({
        type: d.SIMULATOR_SET_CONFIRM,
        data: {
          show: !0,
          title: '\u662F\u5426\u5141\u8BB8\u81EA\u52A8\u586B\u5199',
          content: h.wording,
          subList: h.authGroupList,
          callback: async f => {
            let k = {
                appid: b.getProjectAppID(),
                source: 1,
                auth_info_list: h.fields || [],
                auth_status: h.authStatus,
                user_confirm: f
              },
              { body: l } = await a({
                url: `${c.requestAuthUserAutoFillData}`,
                method: 'post',
                body: JSON.stringify(k),
                needToken: 1,
                needAppID: 1
              })
                .then(() => {
                  e({
                    type: d.JSSDK_CALLBACK,
                    webviewID: g,
                    callbackID: i,
                    res: { errMsg: `${j}:ok` }
                  })
                })
                .catch(a => {
                  e({
                    type: d.JSSDK_CALLBACK,
                    webviewID: g,
                    callbackID: i,
                    res: { errMsg: `${j}:fail ${a}` }
                  })
                })
          }
        }
      })
    },
    deleteUserAutoFillData: async function(d, e) {
      let f = e.args,
        g = {
          appid: b.getProjectAppID(),
          source: 1,
          group_key: f.groupKey,
          group_id: f.groupId
        },
        { body: h } = await a({
          url: `${c.deleteUserAutoFillData}`,
          method: 'post',
          body: JSON.stringify(g),
          needToken: 1,
          needAppID: 1
        })
      return { errMsg: `${e.api}:ok` }
    }
  }
})(require('lazyload'), require)
