!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.peach=t():e.peach=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},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 r(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")}function i(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 a(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)}var u=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.app.doReady().then(function(){return t="string"==typeof t?t:JSON.stringify(t),e=e?String(e):"",s.default.sendReq({channel:s.default.handleQuery(!1),event_type:"event",event:[{device_id:s.default.getDeviceId(),trace_id:s.default.getSessionId(),span_id:s.default.generateUUID(),web_event_uid:s.default.generateUUID(),web_event_id:0,web_event_name:e,web_business_event:t,event_type:"click",type:s.default.isAPP?"h5":"web",web_path:location.href,ua:navigator.userAgent,request_date:s.default.getNowStr(),timestamp:(new Date).getTime(),userid:s.default.getHnUserId()?Number(s.default.getHnUserId()):0}]},n)})}},{key:"logPage",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.app.doReady().then(function(){var t=s.default.generateUUID(),n=sessionStorage.getItem("peach_parent_span_id")||"";sessionStorage.setItem("peach_parent_span_id",t),s.default.sendReq({channel:s.default.handleQuery(!1),event_type:"page",page:[{device_id:s.default.getDeviceId(),trace_id:s.default.getSessionId(),span_id:t,parent_span_id:n,type:s.default.isAPP?"h5":"web",ua:navigator.userAgent,url:location.href,ref:p||document.referrer||s.default.getQueryString("pageForm"),duration_time:0,page_id:0,page_name:"",request_date:s.default.getNowStr(),timestamp:(new Date).getTime(),userid:s.default.getHnUserId()?Number(s.default.getHnUserId()):0}]},e),p=location.href})}}]),t}(l.default);e.exports=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o={utm_source:"",utm_campaign:"",utm_medium:"",utm_term:"",utm_content:"",utm_landpage:""};t.default={isAPP:-1!==navigator.userAgent.indexOf("cnhnb_iOS")||-1!==navigator.userAgent.indexOf("cnhnb_Android_"),app:null,getEnv:function(){var e=void 0;if(!e){var t="undefined"!=typeof window,n="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,r=n&&WXEnvironment.platform.toLowerCase(),o=t&&window.navigator.userAgent.toLowerCase(),i=o&&/msie|trident/.test(o),a=o&&o.indexOf("msie 9.0")>0,u=o&&o.indexOf("edge/")>0,c=o&&o.indexOf("android")>0||"android"===r,s=o&&/iphone|ipad|ipod|ios/.test(o)||"ios"===r,f=o&&/chrome\/\d+/.test(o)&&!u,l=o&&/phantomjs/.test(o),p=t&&window.screen.width>=768,d=o&&/cnhnb_ios/.test(o),v=o&&/cnhnb_android_/.test(o),y=d||v,h=90;if(n&&r){var g={ios:{"1125_2436":90,"828_1792":72,"1242_2688":72}},x=g[r];if(x){h+=x[[WXEnvironment.deviceWidth,WXEnvironment.deviceHeight].join("_")]||0}}e={inDesktop:p,inBrowser:t,inWeex:n,inApp:y,inAppIOS:d,inAppAndroid:v,weexPlatform:r,UA:o,isIE:i,isIE9:a,isEdge:u,isAndroid:c,isIOS:s,isChrome:f,isPhantomJS:l,barHeight:h}}return e},newUUID:function(e){var t=(new Date).getTime();return(e?"xxxxxxxxxxxxxyxxxxyxxxxxxxxxxxxx":"xxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxx").replace(/[xy]/g,function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)})},generateUUID:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)})},getNowStr:function(){var e=new Date,t=function(e){return e>=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(){var e=this.app||{},t=e.settings;t=void 0===t?{}:t;var n=t.deviceId;if(this.isAPP&&n)return n;var r=void 0;return this.getEnv().inBrowser&&((r=window.localStorage?window.localStorage.getItem("HN-CLIENT-ID-NEW"):Cookies.get("HN-CLIENT-ID-NEW"))||(r=this.newUUID(),window.localStorage?window.localStorage.setItem("HN-CLIENT-ID-NEW",r):Cookies.set("HN-CLIENT-ID-NEW",r))),r},getSessionId:function(){if(this.isAPP&&this.app.settings.sessionId)return this.app.settings.sessionId;var e=sessionStorage.getItem("sessionId");return e||(e=this.generateUUID(),sessionStorage.setItem("sessionId",e)),e},sendReq:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t?"http://www.lianlianny.com/agricprod/lib/gather/peach/userlog/write/log/file/h5":"http://www.lianlianny.com/agricprod/lib/gather/app/web";if(fetch)fetch(n,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json; charset=UTF-8"},keepalive:!0});else{var r=new XMLHttpRequest;r.open("POST",n,!0),r.setRequestHeader("Content-Type","application/json; charset=UTF-8"),r.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 r=new Date;r.setDate(r.getDate()+n),document.cookie=e+"="+escape(t)+(null==n?"":";expires="+r.toGMTString())},handleQuery:function(e){var t=Object.keys(o),n={},r=!0,i=!1,a=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var s=u.value;if(e){var f=this.getSearchOrHash(s);f&&sessionStorage.setItem(s,f)}else{var l=sessionStorage.getItem(s);l&&(n[s]=decodeURIComponent(l))}}}catch(e){i=!0,a=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw a}}return JSON.stringify(n)},getHnUserId:function(){return this.isAPP?this.app.settings.hnUserId:this.getCookie("hnUserId")},getSearchOrHash:function(e){var t={},n=location.search||location.hash,o=n.split("?"),i=r(o,2),a=i[1];return((void 0===a?"":a).split("&")||[]).forEach(function(e){var n=e.split("=");t[n[0]]=n[1]}),t[e]?t[e]:null},getQueryString:function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(t);return null!=n?unescape(n[2]):null}}},function(e,t,n){"use strict";function r(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 i(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(){function e(e,t){for(var n=0;nt.priority)return-1;if(e.priority