text: 'use strict';
  
  var volume = void 0;
  
  if (weex && weex.requireModule) {
  	volume = weex.requireModule('nat/device/volume');
  } else if (typeof __weex_define__ === 'function') {
  	__weex_define__('@weex-temp/x', function (__weex_require__) {
  		volume = __weex_require__('@weex-module/nat/device/volume');
  	});
  }
  
  // get
  
  var get = function get(cb) {
  	return new Promise(function (resolve, reject) {
  		volume.get(function (ret) {
  			ret = ret || {};
  
  			if (ret.error) {
  				reject(ret.error);
  				if (typeof cb === 'function') cb(ret.error, null);
  			} else {
  				resolve(ret);
  				if (typeof cb === 'function') cb(null, ret);
  			}
  		});
  	});
  };
  
  // set
  
  var set = function set(vol, cb) {
  	return new Promise(function (resolve, reject) {
  		volume.set(vol, function (ret) {
  			ret = ret || {};
  
  			if (ret.error) {
  				reject(ret.error);
  				if (typeof cb === 'function') cb(ret.error, null);
  			} else {
  				resolve(ret);
  				if (typeof cb === 'function') cb(null, ret);
  			}
  		});
  	});
  };
  
  module.exports = {
  	get: get,
  	set: set
  };