!function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";this.app.doReady().then(function(){t="string"==typeof t?t:JSON.stringify(t),e=e?String(e):"",c.default.sendReq({event_type:"event",event:[{device_id:c.default.getDeviceId(),trace_id:c.default.getSessionId(),span_id:c.default.generateUUID(),web_event_uid:c.default.generateUUID(),web_event_id:0,web_event_name:e,web_business_event:t,event_type:"click",type:c.default.isAPP?"h5":"web",web_path:location.href,ua:navigator.userAgent,request_date:c.default.getNowStr(),timestamp:(new Date).getTime(),userid:c.default.getHnUserId()?Number(c.default.getHnUserId()):0}]})})}},{key:"_logPage",value:function(){this.app.doReady().then(function(){var e=c.default.generateUUID(),t=sessionStorage.getItem("peach_parent_span_id")||"";sessionStorage.setItem("peach_parent_span_id",e),c.default.sendReq({event_type:"page",page:[{device_id:c.default.getDeviceId(),trace_id:c.default.getSessionId(),span_id:e,parent_span_id:t,type:c.default.isAPP?"h5":"web",ua:navigator.userAgent,url:location.href,ref:document.referrer,duration_time:0,page_id:0,page_name:"",request_date:c.default.getNowStr(),timestamp:(new Date).getTime(),userid:c.default.getHnUserId()?Number(c.default.getHnUserId()):0}]})})}}]),e}(),f=new d;f._init(),t.default=f},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"buyPage";this.gotoNative("homePage",e)}},{key:"setTitle",value:function(e){this.putData("title",e)}},{key:"share",value:function(e){this.doAction("share",e)}},{key:"init",value:function(){var e=this;this.bridge=window.HnJsBridge,setTimeout(function(){e.setTitle({show:0,titleStr:"",share:0,more:0,search:0})},200),["hnUserId","hnUserTicket","appChannel","deviceId","location","sysVersion","osType","appVersion","sessionId"].forEach(function(t){e.settings[t]=e.getData(t)})}}]),t}(c.default);["getData","putData","doAction","gotoNative","doAsyncAction"].forEach(function(e){d.prototype[e]=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n="object"===(void 0===n?"undefined":a(n))?JSON.stringify(n):String(n),this.bridge&&this.bridge[e].call(this.bridge,t,n)}}),t.default=d},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n=10?e:"0"+e};return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+" "+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())},getDeviceId:function(){if(this.isAPP)return this.app.settings.deviceId;var e=this.getCookie("deviceId");return e||(e=this.generateUUID(),this.setCookie("deviceId",e,365)),e},getSessionId:function(){if(this.isAPP)return this.app.settings.deviceId;var e=sessionStorage.getItem("sessionId");return e||(e=this.generateUUID(),sessionStorage.setItem("sessionId",e)),e},sendReq:function(e){var t=new XMLHttpRequest;t.open("POST","http://www.lianlianny.com/agricprod/lib/gather/peach/userlog/write/log/file/h5",!0),t.setRequestHeader("Content-Type","application/json; charset=UTF-8"),t.send(JSON.stringify(e))},getCookie:function(e){if(document.cookie.length>0){var t=document.cookie.indexOf(e+"=");if(-1!==t){t=t+e.length+1;var n=document.cookie.indexOf(";",t);return-1===n&&(n=document.cookie.length),unescape(document.cookie.substring(t,n))}}},setCookie:function(e,t,n){var i=new Date;i.setDate(i.getDate()+n),document.cookie=e+"="+escape(t)+(null==n?"":";expires="+i.toGMTString())},getHnUserId:function(){return this.isAPP?this.app.settings.hnUserId:this.getCookie("hnUserId")}}}]);