var ucVersion;try{ucVersion=navigator.userAgent.match(/UCBS\/(\d+\.\d+)/)}catch(e){console.err(e)}var isUC=void 0!=ucVersion;console.log('inject h5_bridge with isUC: '+isUC);if(!isUC){console.log('try inject androidEmbedViewManager script in non UC webview!');document.androidEmbedViewManager||function(){var e={parseObjectElement:function(e){var t,n;if(e.children)for(var o=e.children.length,a=0;a<o;a++){var i=e.children[a];'type'===i.getAttribute('name')?t=i.getAttribute('value'):'id'===i.getAttribute('name')&&(n=i.getAttribute('value'))}void 0===n&&(n=e.id);var l=e.getBoundingClientRect(),c=0;document.documentElement&&document.documentElement.scrollLeft?c=document.documentElement.scrollLeft:document.body&&(c=document.body.scrollLeft);var r=0;document.documentElement&&document.documentElement.scrollTop?r=document.documentElement.scrollTop:document.body&&(r=document.body.scrollTop);return{elementId:n,type:t,x:l.left+c,y:l.top+r,width:l.width,height:l.height}},render:function(e){var t=document.getElementById(e);if(t&&"OBJECT"===t.tagName){console.log('render '+e);if(!t.ListenDOMNodeRemoved){console.log('addEventListener DOMNodeRemoved for '+e);t.addEventListener('DOMNodeRemoved',function(t){AlipayJSBridge.call('NBComponent.remove',{element:e})});t.ListenDOMNodeRemoved=1}return this.parseObjectElement(t)}}};document.androidEmbedViewManager=e}()}document.addNebulaDocumentFlag||function(){console.log("begin load AlipayJSBridge");var messenger=window.__alipayConsole__||window.console,log=messenger.log,e=function(e){log.call(messenger,"{bridge_token}h5container.message: "+JSON.stringify(e))},t=null,n=null;window.addEventListener("message",function(e){if(e&&"__RENDER_WORKER_IPC_MP__"===e.data&&null===n&&e.ports&&1===e.ports.length){(n=e.ports[0]).onmessage=function(e){try{var t=JSON.parse(e.data),n='postMessage'===t.handlerName?'message':t.handlerName;if(t.responseId){var a=o[t.responseId];'boolean'==typeof t.keepCallback&&t.keepCallback||delete o[t.responseId];'function'==typeof a&&setTimeout(function(){a(t.responseData)},0)}else n&&AlipayJSBridge.trigger(n,t,t.callbackId)}catch(t){log.call(messenger,"failed to process message: "+e.data);log.call(messenger,t)}};t=function(e){e.__FastPath__=1;var t=JSON.stringify(e);n.postMessage(t)}}});var o={};window.AlipayJSBridge={call:function(n,a,i){if('string'==typeof n){if('function'==typeof a){i=a;a=null}else'object'!=typeof a&&(a=null);var l=''+(new Date).getTime()+Math.random();'function'==typeof i&&(o[l]=i);var c={func:n,param:a,msgType:'call',clientId:l};'postMessage'===n&&null!==t?t(c):e(c)}},callback:function(n,o){var a={clientId:n,param:o};null!==t&&'string'==typeof n&&'native_'!==n.substring(0,7)?t(a):e(a)},trigger:function(e,t,n){if(e){var o=document.createEvent('Events');o.initEvent(e,!1,!0);o.syncJsApis=[];if('object'==typeof t)for(var a in t)o[a]=t[a];o.clientId=n;var i=!document.dispatchEvent(o);n&&'back'===e&&AlipayJSBridge.callback(n,{prevent:i});n&&'closeWindow'===e&&AlipayJSBridge.callback(n,{prevent:i});n&&'firePullToRefresh'===e&&AlipayJSBridge.callback(n,{prevent:i});n&&'onShare'===e&&AlipayJSBridge.callback(n,{prevent:i});n&&'collectDestroyJsApi'===e&&AlipayJSBridge.callback(n,{syncJsApis:o.syncJsApis});n&&'pullIntercept'===e&&AlipayJSBridge.callback(n,{prevent:i});n&&'collectPerformanceBeforeDestroy'===e&&AlipayJSBridge.callback(n,{eventExtraData:o.eventExtraData});n&&'segControlClick'===e&&AlipayJSBridge.callback(n,{prevent:i})}},_invokeJS:function(e){e=JSON.parse(e);console.log("invokeJS msgType "+e.msgType+" func "+e.func);if('callback'===e.msgType){var t=o[e.clientId];'boolean'==typeof e.keepCallback&&e.keepCallback||delete o[e.clientId];'function'==typeof t&&setTimeout(function(){t(e.param)},1)}else'call'===e.msgType&&e.func&&this.trigger(e.func,e.param,e.clientId)},devPerformance4Test:""};document.addNebulaDocumentFlag={};AlipayJSBridge.startupParams='{startupParams}';window.POSTMESSAGE_FAST='{POSTMESSAGE_FAST}';window.APVIEWID='{APVIEWID}';var a=document.createEvent('Events');a.initEvent('AlipayJSBridgeReady',!1,!1);var i=document.addEventListener;document.addEventListener=function(e,t){e===a.type&&setTimeout(function(){t(a)},1);i.apply(document,arguments)};document.dispatchEvent(a);console.log("load AlipayJSBridge dispatchEvent AlipayJSBridgeReady")}();
// do not modify
