fastman2 3.0.0-alpha.6 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jsbridgeman.js +2 -2
- package/package.json +1 -1
package/jsbridgeman.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fastman=e():t.fastman=e()}(this,function(){return function(t){function e(
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fastman=e():t.fastman=e()}(this,function(){return function(t){function e(n){if(o[n])return o[n].exports;var i=o[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var o={};return e.m=t,e.c=o,e.i=function(t){return t},e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=20)}({1:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){var e=document.createElement("a");e.setAttribute("href",t);var o=e.href;return e=null,o},i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},r=function(t){return!(null!=t&&(t.length||t.length>0))},a=function(t){if(t){if(1==t.length)return t;var e=t.substring(t.length-1,t.length);return(t.length>=3?"**":"*")+e}return t};e.getAbsoluteUrl=n,e._extends=i,e.isEmpty=r,e.maskName=a},10:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e){for(var o=t.split(".").length;o<e;)t+=".0",o++;return t},i=function(t){var e=navigator.userAgent.toLowerCase().match(/DFYJ\/([\d.]+)/i);return e?e[1]:void 0},r=function(t,e){var o=t.split("."),i=e.split("."),r=Math.max(o.length,i.length);t=n(t,r),e=n(e,r);var a=t.split("."),s=e.split(".");if(t===e)return 0;for(var f=0;f<a.length;f++){var c=parseInt(a[f]);if(!s[f])return 1;var l=parseInt(s[f]);if(c<l)return-1;if(c>l)return 1}return-1},a=function(t){var e=i();return e?r(e,t):1};e.getVersion=i,e.compareVersion=a,e._compareVersion=r},17:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),o.d(e,"DEFAULT_OPTIONS",function(){return f}),o.d(e,"Notyf",function(){return l}),o.d(e,"NotyfArray",function(){return s}),o.d(e,"NotyfArrayEvent",function(){return n}),o.d(e,"NotyfEvent",function(){return a}),o.d(e,"NotyfNotification",function(){return r}),o.d(e,"NotyfView",function(){return c});/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -12,4 +12,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
12
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
14
14
|
***************************************************************************** */
|
|
15
|
-
var o,i=function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},i.apply(this,arguments)},a=function(){function t(t){this.options=t,this.listeners={}}return t.prototype.on=function(t,e){var n=this.listeners[t]||[];this.listeners[t]=n.concat([e])},t.prototype.triggerEvent=function(t,e){var n=this;(this.listeners[t]||[]).forEach(function(t){return t({target:n,event:e})})},t}();!function(t){t[t.Add=0]="Add",t[t.Remove=1]="Remove"}(o||(o={}));var r,s=function(){function t(){this.notifications=[]}return t.prototype.push=function(t){this.notifications.push(t),this.updateFn(t,o.Add,this.notifications)},t.prototype.splice=function(t,e){var n=this.notifications.splice(t,e)[0];return this.updateFn(n,o.Remove,this.notifications),n},t.prototype.indexOf=function(t){return this.notifications.indexOf(t)},t.prototype.onUpdate=function(t){this.updateFn=t},t}();!function(t){t.Dismiss="dismiss",t.Click="click"}(r||(r={}));var f={types:[{type:"success",className:"notyf__toast--success",backgroundColor:"#3dc763",icon:{className:"notyf__icon--success",tagName:"i"}},{type:"error",className:"notyf__toast--error",backgroundColor:"#ed3d3d",icon:{className:"notyf__icon--error",tagName:"i"}}],duration:2e3,ripple:!0,position:{x:"right",y:"bottom"},dismissible:!1},c=function(){function t(){this.notifications=[],this.events={},this.X_POSITION_FLEX_MAP={left:"flex-start",center:"center",right:"flex-end"},this.Y_POSITION_FLEX_MAP={top:"flex-start",center:"center",bottom:"flex-end"};var t=document.createDocumentFragment(),e=this._createHTMLElement({tagName:"div",className:"notyf"});t.appendChild(e),document.body.appendChild(t),this.container=e,this.animationEndEventName=this._getAnimationEndEventName(),this._createA11yContainer()}return t.prototype.on=function(t,e){var n;this.events=i(i({},this.events),(n={},n[t]=e,n))},t.prototype.update=function(t,e){e===o.Add?this.addNotification(t):e===o.Remove&&this.removeNotification(t)},t.prototype.removeNotification=function(t){var e,n=this,o=this._popRenderedNotification(t);if(o){e=o.node,e.classList.add("notyf__toast--disappear");var i;e.addEventListener(this.animationEndEventName,i=function(t){t.target===e&&(e.removeEventListener(n.animationEndEventName,i),n.container.removeChild(e))})}},t.prototype.addNotification=function(t){var e=this._renderNotification(t);this.notifications.push({notification:t,node:e}),this._announce(t.options.message||"Notification")},t.prototype._renderNotification=function(t){var e,n=this._buildNotificationCard(t),o=t.options.className;return o&&(e=n.classList).add.apply(e,o.split(" ")),this.container.appendChild(n),n},t.prototype._popRenderedNotification=function(t){for(var e=-1,n=0;n<this.notifications.length&&e<0;n++)this.notifications[n].notification===t&&(e=n);if(-1!==e)return this.notifications.splice(e,1)[0]},t.prototype.getXPosition=function(t){var e;return(null===(e=null===t||void 0===t?void 0:t.position)||void 0===e?void 0:e.x)||"right"},t.prototype.getYPosition=function(t){var e;return(null===(e=null===t||void 0===t?void 0:t.position)||void 0===e?void 0:e.y)||"bottom"},t.prototype.adjustContainerAlignment=function(t){var e=this.X_POSITION_FLEX_MAP[this.getXPosition(t)],n=this.Y_POSITION_FLEX_MAP[this.getYPosition(t)],o=this.container.style;o.setProperty("justify-content",n),o.setProperty("align-items",e)},t.prototype._buildNotificationCard=function(t){var e=this,n=t.options,o=n.icon;this.adjustContainerAlignment(n);var i=this._createHTMLElement({tagName:"div",className:"notyf__toast"}),a=this._createHTMLElement({tagName:"div",className:"notyf__ripple"}),s=this._createHTMLElement({tagName:"div",className:"notyf__wrapper"}),f=this._createHTMLElement({tagName:"div",className:"notyf__message"});f.innerHTML=n.message||"";var c=n.background||n.backgroundColor;if(o){var p=this._createHTMLElement({tagName:"div",className:"notyf__icon"});if(("string"==typeof o||o instanceof String)&&(p.innerHTML=new String(o).valueOf()),"object"==typeof o){var l=o.tagName,d=void 0===l?"i":l,u=o.className,y=o.text,g=o.color,m=void 0===g?c:g,h=this._createHTMLElement({tagName:d,className:u,text:y});m&&(h.style.color=m),p.appendChild(h)}s.appendChild(p)}if(s.appendChild(f),i.appendChild(s),c&&(n.ripple?(a.style.background=c,i.appendChild(a)):i.style.background=c),n.dismissible){var v=this._createHTMLElement({tagName:"div",className:"notyf__dismiss"}),_=this._createHTMLElement({tagName:"button",className:"notyf__dismiss-btn"});v.appendChild(_),s.appendChild(v),i.classList.add("notyf__toast--dismissible"),_.addEventListener("click",function(n){var o,i;null===(i=(o=e.events)[r.Dismiss])||void 0===i||i.call(o,{target:t,event:n}),n.stopPropagation()})}i.addEventListener("click",function(n){var o,i;return null===(i=(o=e.events)[r.Click])||void 0===i?void 0:i.call(o,{target:t,event:n})});var b="top"===this.getYPosition(n)?"upper":"lower";return i.classList.add("notyf__toast--"+b),i},t.prototype._createHTMLElement=function(t){var e=t.tagName,n=t.className,o=t.text,i=document.createElement(e);return n&&(i.className=n),i.textContent=o||null,i},t.prototype._createA11yContainer=function(){var t=this._createHTMLElement({tagName:"div",className:"notyf-announcer"});t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","polite"),t.style.border="0",t.style.clip="rect(0 0 0 0)",t.style.height="1px",t.style.margin="-1px",t.style.overflow="hidden",t.style.padding="0",t.style.position="absolute",t.style.width="1px",t.style.outline="0",document.body.appendChild(t),this.a11yContainer=t},t.prototype._announce=function(t){var e=this;this.a11yContainer.textContent="",setTimeout(function(){e.a11yContainer.textContent=t},100)},t.prototype._getAnimationEndEventName=function(){var t,e=document.createElement("_fake"),n={MozTransition:"animationend",OTransition:"oAnimationEnd",WebkitTransition:"webkitAnimationEnd",transition:"animationend"};for(t in n)if(void 0!==e.style[t])return n[t];return"animationend"},t}(),p=function(){function t(t){var e=this;this.dismiss=this._removeNotification,this.notifications=new s,this.view=new c;var n=this.registerTypes(t);this.options=i(i({},f),t),this.options.types=n,this.notifications.onUpdate(function(t,n){return e.view.update(t,n)}),this.view.on(r.Dismiss,function(t){var n=t.target,o=t.event;e._removeNotification(n),n.triggerEvent(r.Dismiss,o)}),this.view.on(r.Click,function(t){var e=t.target,n=t.event;return e.triggerEvent(r.Click,n)})}return t.prototype.error=function(t){var e=this.normalizeOptions("error",t);return this.open(e)},t.prototype.success=function(t){var e=this.normalizeOptions("success",t);return this.open(e)},t.prototype.open=function(t){var e=this.options.types.find(function(e){return e.type===t.type})||{},n=i(i({},e),t);this.assignProps(["ripple","position","dismissible"],n);var o=new a(n);return this._pushNotification(o),o},t.prototype.dismissAll=function(){for(;this.notifications.splice(0,1););},t.prototype.assignProps=function(t,e){var n=this;t.forEach(function(t){e[t]=null==e[t]?n.options[t]:e[t]})},t.prototype._pushNotification=function(t){var e=this;this.notifications.push(t);var n=void 0!==t.options.duration?t.options.duration:this.options.duration;n&&setTimeout(function(){return e._removeNotification(t)},n)},t.prototype._removeNotification=function(t){var e=this.notifications.indexOf(t);-1!==e&&this.notifications.splice(e,1)},t.prototype.normalizeOptions=function(t,e){var n={type:t};return"string"==typeof e?n.message=e:"object"==typeof e&&(n=i(i({},n),e)),n},t.prototype.registerTypes=function(t){var e=(t&&t.types||[]).slice();return f.types.map(function(t){var n=-1;e.forEach(function(e,o){e.type===t.type&&(n=o)});var o=-1!==n?e.splice(n,1)[0]:{};return i(i({},t),o)}).concat(e)},t}()},20:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.onApiRequest=e.pageWillAppear=e.onRequest=e.onDynamicLink=e.subscribeNotify=e.onNotify=e.onPushView=e.onNavigationBar=e.onRefresh=e.onBack=e.ready=e.wrapNotOkPayload=e.wrapOkPayload=void 0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},i=n(1),a=n(9),r=n(10),s=n(17);!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}('@-webkit-keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@-webkit-keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@-webkit-keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@-webkit-keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@-webkit-keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}@keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}.notyf{position:fixed;top:0;left:0;height:100%;width:100%;color:#fff;z-index:9999;display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-end;pointer-events:none;box-sizing:border-box;padding:20px}.notyf__icon--error,.notyf__icon--success{height:21px;width:21px;background:#fff;border-radius:50%;display:block;margin:0 auto;position:relative}.notyf__icon--error:after,.notyf__icon--error:before{content:"";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px;left:9px;height:12px;top:5px}.notyf__icon--error:after{transform:rotate(-45deg)}.notyf__icon--error:before{transform:rotate(45deg)}.notyf__icon--success:after,.notyf__icon--success:before{content:"";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px}.notyf__icon--success:after{height:6px;transform:rotate(-45deg);top:9px;left:6px}.notyf__icon--success:before{height:11px;transform:rotate(45deg);top:5px;left:10px}.notyf__toast{display:block;overflow:hidden;pointer-events:auto;-webkit-animation:notyf-fadeinup .3s ease-in forwards;animation:notyf-fadeinup .3s ease-in forwards;box-shadow:0 3px 7px 0 rgba(0,0,0,.25);position:relative;padding:0 15px;border-radius:2px;max-width:300px;transform:translateY(25%);box-sizing:border-box;flex-shrink:0}.notyf__toast--disappear{transform:translateY(0);-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s}.notyf__toast--disappear .notyf__icon,.notyf__toast--disappear .notyf__message{-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;opacity:1;transform:translateY(0)}.notyf__toast--disappear .notyf__dismiss{-webkit-animation:notyf-fadeoutright .3s forwards;animation:notyf-fadeoutright .3s forwards;opacity:1;transform:translateX(0)}.notyf__toast--disappear .notyf__message{-webkit-animation-delay:.05s;animation-delay:.05s}.notyf__toast--upper{margin-bottom:20px}.notyf__toast--lower{margin-top:20px}.notyf__toast--dismissible .notyf__wrapper{padding-right:30px}.notyf__ripple{height:400px;width:400px;position:absolute;transform-origin:bottom right;right:0;top:0;border-radius:50%;transform:scale(0) translateY(-51%) translateX(13%);z-index:5;-webkit-animation:ripple .4s ease-out forwards;animation:ripple .4s ease-out forwards}.notyf__wrapper{font-size:18px;display:flex;align-items:center;padding-top:17px;padding-bottom:17px;padding-right:15px;border-radius:3px;position:relative;z-index:10}.notyf__icon{width:22px;text-align:center;font-size:1.0em;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.3s;animation-delay:.3s;margin-right:13px}.notyf__dismiss{position:absolute;top:0;right:0;height:100%;width:26px;margin-right:-15px;-webkit-animation:notyf-fadeinleft .3s forwards;animation:notyf-fadeinleft .3s forwards;-webkit-animation-delay:.35s;animation-delay:.35s;opacity:0}.notyf__dismiss-btn{background-color:rgba(0,0,0,.25);border:none;cursor:pointer;transition:opacity .2s ease,background-color .2s ease;outline:none;opacity:.35;height:100%;width:100%}.notyf__dismiss-btn:after,.notyf__dismiss-btn:before{content:"";background:#fff;height:12px;width:2px;border-radius:3px;position:absolute;left:calc(50% - 1px);top:calc(50% - 5px)}.notyf__dismiss-btn:after{transform:rotate(-45deg)}.notyf__dismiss-btn:before{transform:rotate(45deg)}.notyf__dismiss-btn:hover{opacity:.7;background-color:rgba(0,0,0,.15)}.notyf__dismiss-btn:active{opacity:.8}.notyf__message{vertical-align:middle;position:relative;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s;line-height:1.5em}@media only screen and (max-width:480px){.notyf{padding:0}.notyf__ripple{height:600px;width:600px;-webkit-animation-duration:.5s;animation-duration:.5s}.notyf__toast{max-width:none;border-radius:0;box-shadow:0 -2px 7px 0 rgba(0,0,0,.13);width:100%}.notyf__dismiss{width:56px}}');var f=navigator.userAgent,c=f.match(/(Android);?[\s\/]+([\d.]+)?/),p=f.match(/(iPad).*OS\s([\d_]+)/),l=f.match(/(iPod)(.*OS\s([\d_]+))?/),d=!p&&f.match(/(iPhone\sOS)\s([\d_]+)/),u=!!f.toLowerCase().match(/DFYJ/i),y=!!f.toLowerCase().match(/ArkWeb/i),g=function(t){return t.init(function(t,e){e&&e(data)}),t},m=function(t){var e=function(e){(0,a.log)("[ready] <-"),t(e)};if((0,a.log)("[ready] ->"),u)if(p||d||l){if(window.WebViewJavascriptBridge)return e(WebViewJavascriptBridge);if(window.WVJBCallbacks)return window.WVJBCallbacks.push(e);window.WVJBCallbacks=[e];var n=document.createElement("iframe");n.style.display="none",n.src="https://__bridge_loaded__",document.documentElement.appendChild(n),setTimeout(function(){document.documentElement.removeChild(n)},0)}else c?window.WebViewJavascriptBridge?e(g(WebViewJavascriptBridge)):document.addEventListener("WebViewJavascriptBridgeReady",function(){e(g(WebViewJavascriptBridge))},!1):e();else e()},h=function(){},v=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}},_=function(){return{code:arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,info:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error"}},b=function(t){var e={complete:h};e=(0,i._extends)({},e,t),(0,a.log)("onBack->"+JSON.stringify(e)),y?window.LightSDK.native.back({number:e.step},function(t){(0,a.log)("onBack <- "+JSON.stringify(t))}):WebViewJavascriptBridge.callHandler("back",e,function(t){(0,a.log)("onBack <-"+JSON.stringify(t)),e.complete(t)})},w=function(t){var e={complete:h};e=(0,i._extends)({},e,t),(0,a.log)("onRefresh->"+JSON.stringify(e)),y?location.reload():WebViewJavascriptBridge.callHandler("refresh",e,function(t){(0,a.log)("onRefresh<-"+JSON.stringify(t)),e.complete(t)})},N=function(t){var e={complete:h};e=(0,i._extends)({},e,t),(0,a.log)("onBasicNavigationBar->"+JSON.stringify(e)),y?(window.LightSDK.native.setTitle&&e.title&&((0,a.log)("[Harmony setTitle] -> "+JSON.stringify(e)),window.LightSDK.native.setTitle({title:e.title},function(t){(0,a.log)("[Harmony setTitle] <- "+JSON.stringify(t))})),window.LightSDK.native.removeButton&&((0,a.log)("[Harmony removeButton] -> "),window.LightSDK.native.removeButton({position:"right"},function(t){(0,a.log)("[Harmony removeButton] <- "+JSON.stringify(t))})),window.LightSDK.native.addButton&&(e.rightButtonTitle||e.rightButtonIcon)&&((0,a.log)("[Harmony addButton] -> "),e.rightButtonIcon&&(e.rightButtonIcon="base64://"+e.rightButtonIcon,e.rightButtonTitle=""),e.rightButtonTitle&&(e.rightButtonIcon=""),window.LightSDK.native.addButton({title:e.rightButtonTitle,icon:e.rightButtonIcon,position:"right",action:e.onRightButtonPress},function(t){(0,a.log)("[Harmony addButton] <- "+JSON.stringify(t))}))):WebViewJavascriptBridge.callHandler("navigationBar",e,function(t){(0,a.log)("onBasicNavigationBar <-"+JSON.stringify(t)),e.complete(t)})},k=function(t){var e={title:"",isFullScreen:!1,isStatusBarLight:!0,ver:"v1"};e=(0,i._extends)({},e,t),1==e.isFullScreen&&(e.ver="v2"),e.uri&&(-1!=e.uri.indexOf("http")||-1!=e.uri.indexOf("https")||(e.uri=(0,i.getAbsoluteUrl)(e.uri))),y?(e.url=e.uri,(0,a.log)("onPushView->"+JSON.stringify(e)),window.LightSDK.native.callNative("winner_base.router",e,function(t){(0,a.log)("onPushView <-"+JSON.stringify(t))})):((0,a.log)("onPushView->"+JSON.stringify(e)),WebViewJavascriptBridge.callHandler("pushView",e,function(t){(0,a.log)("onPushView <-"+JSON.stringify(t))}))},x=function(t){"function"==typeof t&&(y?window.LightSDK.event.on("viewappear",function(){(0,a.log)("pageWillAppear 被回调"),"function"==typeof t&&t()}):WebViewJavascriptBridge.registerHandler("pageWillAppear",t))},O=function(t){var e={type:"javascriptNotify"};e=(0,i._extends)({},e,t),(0,a.log)("onNotify->"+JSON.stringify(e)),y||WebViewJavascriptBridge.callHandler("notify",e,function(t){(0,a.log)("onNotify<-"+JSON.stringify(t))})},S={},L=function(t,e){if("function"==typeof e){var n=t;"sae_video"!=n&&"result_video"!=n||(n="notify"),S[n]=e,(0,a.log)("subscribeNotify->"+t),y||WebViewJavascriptBridge.registerHandler(n,function(e){if((0,a.log)("subscribeNotify<-"+JSON.stringify(e)),Object.prototype.toString.call(e).toLocaleLowerCase()=="[object String]".toLocaleLowerCase()&&(e=JSON.parse(e)),"result_video"==t&&e.payload){Object.prototype.toString.call(e.payload).toLocaleLowerCase()=="[object String]".toLocaleLowerCase()&&(e.payload=JSON.parse(e.payload)),(p||d||l)&&(e.payload=o({},e.payload.params));var i=[];if(e.payload.result&&e.payload.result.length){e.payload.result.forEach(function(t){t.reasons&&"[object Array]"==Object.prototype.toString.call(t.reasons)&&(i=i.concat(t.reasons))})}e.payload.reject_reasons=i.reduce(function(t,e){return t.concat(e.split(";"))},[])}S[n]&&(c?"sae_video"==e.type||"result_video"==e.type?((0,a.log)("安卓notify被调用."),S.notify(e)):e.type==n&&((0,a.log)("安卓"+e.type+"被调用!"),S[n](e)):((0,a.log)("iOS notify被调用;"),S[n](e)))})}},J=function(t){var e={url:""};if(e=(0,i._extends)({},e,t),(0,a.log)("onDynamicLink->"+JSON.stringify(e)),y)0==e.url.indexOf("https")||0==e.url.indexOf("http")?window.LightSDK.native.openURL({url:e.url},function(){}):location.href=e.url;else{if((0,r.compareVersion)("5.22.2")<0&&-1!=e.url.indexOf("dl/videoreview"))return void alert("您当前的APP版本过低,请升级至V5.22.2以上版本后,再进行使用");WebViewJavascriptBridge.callHandler("dynamicLink",e,function(t){(0,a.log)("onDynamicLink<-"+JSON.stringify(t))})}},B={},E=!1,C=function(t,e){switch(arguments.length){case 1:return parseInt(Math.random()*t+1,10);case 2:return parseInt(Math.random()*(e-t+1)+t,10);default:return 0}},A=[],P=function t(){var e=C(1e3,9999);return-1!==A.indexOf(e)?t(e):(A.push(e),e)},T=function(t,e,n,o){var i={type:t||"1",payload:e||{},callbackId:P()};if(B[t+"-ok"]="function"==typeof n?n:h,B[t+"-notok"]="function"==typeof o?o:h,B[t+"_"+i.callbackId+"-ok"]="function"==typeof n?n:h,B[t+"_"+i.callbackId+"-notok"]="function"==typeof o?o:h,y){var r=void 0;if(r||(r=new s.Notyf({duration:2e3})),window.LightSDK)if("1"==i.type||"2"==i.type)window.LightSDK.native.callNative("dfyj.longLogin",i,function(t){"0"==t.info.error_code?(t=t.data,(0,a.log)("[Harmony onLogin] <- "+JSON.stringify(t)),B[i.type+"-ok"](v(t))):((0,a.errorlog)("[Harmony onLogin] <- "+JSON.stringify(t.info)),B[i.type+"-notok"](_(-1,t.info.error_message)))});else if("4"==i.type){r.error({message:"该功能在鸿蒙系统中,暂不支持",dismissible:!0})}else if("5"==i.type){r.error({message:"该功能在鸿蒙系统中,暂不支持",dismissible:!0})}else if("9"==i.type){r.error({message:"该功能在鸿蒙系统中,暂不支持",dismissible:!0})}else if("10"==i.type){r.error({message:"该功能在鸿蒙系统中,暂不支持",dismissible:!0})}else if("14"==i.type)window.LightSDK.native.callNative("dfyj.queryAgeAppropriateMode",i,function(t){"0"==t.info.error_code?(t=t.data,(0,a.log)("[Harmony onQueryAgeAppropriateMode] <- "+JSON.stringify(t)),B[i.type+"-ok"](v(t))):((0,a.errorlog)("[Harmony onQueryAgeAppropriateMode] <- "+JSON.stringify(t.info)),B[i.type+"-notok"](_(-1,t.info.error_message)))});else{r.error({message:"该功能在鸿蒙系统中,暂不支持",dismissible:!0})}}else WebViewJavascriptBridge.callHandler("request",i,function(t){"string"==typeof t&&(t=JSON.parse(t)),t.error||"true"===t.error?t.callbackId&&"function"==typeof B[t.type+"_"+t.callbackId+"-notok"]?B[t.type+"_"+t.callbackId+"-notok"](_(-1,t.info)):"function"==typeof B[t.type+"-notok"]&&B[t.type+"-notok"](_(-1,t.info)):t.callbackId&&"function"==typeof B[t.type+"_"+t.callbackId+"-ok"]?(p||d||l||t.payload)&&B[t.type+"_"+t.callbackId+"-ok"](v(t.payload)):"function"==typeof B[t.type+"-ok"]&&(p||d||l||t.payload)&&B[t.type+"-ok"](v(t.payload))}),E||(WebViewJavascriptBridge.registerHandler("request",function(t){"string"==typeof t&&(t=JSON.parse(t)),t.error||"true"===t.error?t.callbackId&&"function"==typeof B[t.type+"_"+t.callbackId+"-notok"]?B[t.type+"_"+t.callbackId+"-notok"](_(-1,t.info)):"function"==typeof B[t.type+"-notok"]&&B[t.type+"-notok"](_(-1,t.info)):t.callbackId&&"function"==typeof B[t.type+"_"+t.callbackId+"-ok"]?B[t.type+"_"+t.callbackId+"-ok"](v(t.payload)):"function"==typeof B[t.type+"-ok"]&&B[t.type+"-ok"](v(t.payload))}),E=!0)},H=function(t,e,n,o){if((0,i.isEmpty)(t))throw new Error("functionNo is required ...");var r={funcId:t,payload:e||{}};(0,a.log)("onApiRequest->"+JSON.stringify(r)),y||WebViewJavascriptBridge.callHandler("apiRequest",r,function(t){if((0,a.log)("onApiRequest<-"+JSON.stringify(t)),"string"==typeof t&&(t=JSON.parse(t)),p||d||l){if(t.error||"true"===t.error)t.payload?"function"==typeof o&&o(_(t.payload.code,t.payload.info)):"function"==typeof o&&o(_(-1,t.info));else if("function"==typeof n){var e={};t.payload&&(e="string"==typeof t.payload.data?JSON.parse(t.payload.data):t.payload.data),n(v(e))}}else if(t.error||"true"===t.error)"function"==typeof o&&o(_(-1,t.info));else{var i={};i="string"==typeof t.payload.data?JSON.parse(t.payload.data):t.payload.data?t.payload.data:{},"0"!=t.payload.code?"function"==typeof o&&o(_(t.payload.code,t.payload.info)):"function"==typeof n&&n(v(i))}})};e.wrapOkPayload=v,e.wrapNotOkPayload=_,e.ready=m,e.onBack=b,e.onRefresh=w,e.onNavigationBar=N,e.onPushView=k,e.onNotify=O,e.subscribeNotify=L,e.onDynamicLink=J,e.onRequest=T,e.pageWillAppear=x,e.onApiRequest=H},9:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){var t=new Date;t.getDate();return(t.getHours()<10?"0"+t.getHours():t.getHours())+":"+(t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes())+":"+(t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds())+"."+t.getMilliseconds()},i=function(t){t&&(t=o()+"[赢家]: "+t)},a=function(t){t&&(t=o()+"[赢家]: "+t)};e.log=i,e.errorlog=a}})});
|
|
15
|
+
var n,i=function(){return i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++){e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},i.apply(this,arguments)},r=function(){function t(t){this.options=t,this.listeners={}}return t.prototype.on=function(t,e){var o=this.listeners[t]||[];this.listeners[t]=o.concat([e])},t.prototype.triggerEvent=function(t,e){var o=this;(this.listeners[t]||[]).forEach(function(t){return t({target:o,event:e})})},t}();!function(t){t[t.Add=0]="Add",t[t.Remove=1]="Remove"}(n||(n={}));var a,s=function(){function t(){this.notifications=[]}return t.prototype.push=function(t){this.notifications.push(t),this.updateFn(t,n.Add,this.notifications)},t.prototype.splice=function(t,e){var o=this.notifications.splice(t,e)[0];return this.updateFn(o,n.Remove,this.notifications),o},t.prototype.indexOf=function(t){return this.notifications.indexOf(t)},t.prototype.onUpdate=function(t){this.updateFn=t},t}();!function(t){t.Dismiss="dismiss",t.Click="click"}(a||(a={}));var f={types:[{type:"success",className:"notyf__toast--success",backgroundColor:"#3dc763",icon:{className:"notyf__icon--success",tagName:"i"}},{type:"error",className:"notyf__toast--error",backgroundColor:"#ed3d3d",icon:{className:"notyf__icon--error",tagName:"i"}}],duration:2e3,ripple:!0,position:{x:"right",y:"bottom"},dismissible:!1},c=function(){function t(){this.notifications=[],this.events={},this.X_POSITION_FLEX_MAP={left:"flex-start",center:"center",right:"flex-end"},this.Y_POSITION_FLEX_MAP={top:"flex-start",center:"center",bottom:"flex-end"};var t=document.createDocumentFragment(),e=this._createHTMLElement({tagName:"div",className:"notyf"});t.appendChild(e),document.body.appendChild(t),this.container=e,this.animationEndEventName=this._getAnimationEndEventName(),this._createA11yContainer()}return t.prototype.on=function(t,e){var o;this.events=i(i({},this.events),(o={},o[t]=e,o))},t.prototype.update=function(t,e){e===n.Add?this.addNotification(t):e===n.Remove&&this.removeNotification(t)},t.prototype.removeNotification=function(t){var e,o=this,n=this._popRenderedNotification(t);if(n){e=n.node,e.classList.add("notyf__toast--disappear");var i;e.addEventListener(this.animationEndEventName,i=function(t){t.target===e&&(e.removeEventListener(o.animationEndEventName,i),o.container.removeChild(e))})}},t.prototype.addNotification=function(t){var e=this._renderNotification(t);this.notifications.push({notification:t,node:e}),this._announce(t.options.message||"Notification")},t.prototype._renderNotification=function(t){var e,o=this._buildNotificationCard(t),n=t.options.className;return n&&(e=o.classList).add.apply(e,n.split(" ")),this.container.appendChild(o),o},t.prototype._popRenderedNotification=function(t){for(var e=-1,o=0;o<this.notifications.length&&e<0;o++)this.notifications[o].notification===t&&(e=o);if(-1!==e)return this.notifications.splice(e,1)[0]},t.prototype.getXPosition=function(t){var e;return(null===(e=null===t||void 0===t?void 0:t.position)||void 0===e?void 0:e.x)||"right"},t.prototype.getYPosition=function(t){var e;return(null===(e=null===t||void 0===t?void 0:t.position)||void 0===e?void 0:e.y)||"bottom"},t.prototype.adjustContainerAlignment=function(t){var e=this.X_POSITION_FLEX_MAP[this.getXPosition(t)],o=this.Y_POSITION_FLEX_MAP[this.getYPosition(t)],n=this.container.style;n.setProperty("justify-content",o),n.setProperty("align-items",e)},t.prototype._buildNotificationCard=function(t){var e=this,o=t.options,n=o.icon;this.adjustContainerAlignment(o);var i=this._createHTMLElement({tagName:"div",className:"notyf__toast"}),r=this._createHTMLElement({tagName:"div",className:"notyf__ripple"}),s=this._createHTMLElement({tagName:"div",className:"notyf__wrapper"}),f=this._createHTMLElement({tagName:"div",className:"notyf__message"});f.innerHTML=o.message||"";var c=o.background||o.backgroundColor;if(n){var l=this._createHTMLElement({tagName:"div",className:"notyf__icon"});if(("string"==typeof n||n instanceof String)&&(l.innerHTML=new String(n).valueOf()),"object"==typeof n){var d=n.tagName,p=void 0===d?"i":d,u=n.className,y=n.text,g=n.color,m=void 0===g?c:g,h=this._createHTMLElement({tagName:p,className:u,text:y});m&&(h.style.color=m),l.appendChild(h)}s.appendChild(l)}if(s.appendChild(f),i.appendChild(s),c&&(o.ripple?(r.style.background=c,i.appendChild(r)):i.style.background=c),o.dismissible){var v=this._createHTMLElement({tagName:"div",className:"notyf__dismiss"}),_=this._createHTMLElement({tagName:"button",className:"notyf__dismiss-btn"});v.appendChild(_),s.appendChild(v),i.classList.add("notyf__toast--dismissible"),_.addEventListener("click",function(o){var n,i;null===(i=(n=e.events)[a.Dismiss])||void 0===i||i.call(n,{target:t,event:o}),o.stopPropagation()})}i.addEventListener("click",function(o){var n,i;return null===(i=(n=e.events)[a.Click])||void 0===i?void 0:i.call(n,{target:t,event:o})});var b="top"===this.getYPosition(o)?"upper":"lower";return i.classList.add("notyf__toast--"+b),i},t.prototype._createHTMLElement=function(t){var e=t.tagName,o=t.className,n=t.text,i=document.createElement(e);return o&&(i.className=o),i.textContent=n||null,i},t.prototype._createA11yContainer=function(){var t=this._createHTMLElement({tagName:"div",className:"notyf-announcer"});t.setAttribute("aria-atomic","true"),t.setAttribute("aria-live","polite"),t.style.border="0",t.style.clip="rect(0 0 0 0)",t.style.height="1px",t.style.margin="-1px",t.style.overflow="hidden",t.style.padding="0",t.style.position="absolute",t.style.width="1px",t.style.outline="0",document.body.appendChild(t),this.a11yContainer=t},t.prototype._announce=function(t){var e=this;this.a11yContainer.textContent="",setTimeout(function(){e.a11yContainer.textContent=t},100)},t.prototype._getAnimationEndEventName=function(){var t,e=document.createElement("_fake"),o={MozTransition:"animationend",OTransition:"oAnimationEnd",WebkitTransition:"webkitAnimationEnd",transition:"animationend"};for(t in o)if(void 0!==e.style[t])return o[t];return"animationend"},t}(),l=function(){function t(t){var e=this;this.dismiss=this._removeNotification,this.notifications=new s,this.view=new c;var o=this.registerTypes(t);this.options=i(i({},f),t),this.options.types=o,this.notifications.onUpdate(function(t,o){return e.view.update(t,o)}),this.view.on(a.Dismiss,function(t){var o=t.target,n=t.event;e._removeNotification(o),o.triggerEvent(a.Dismiss,n)}),this.view.on(a.Click,function(t){var e=t.target,o=t.event;return e.triggerEvent(a.Click,o)})}return t.prototype.error=function(t){var e=this.normalizeOptions("error",t);return this.open(e)},t.prototype.success=function(t){var e=this.normalizeOptions("success",t);return this.open(e)},t.prototype.open=function(t){var e=this.options.types.find(function(e){return e.type===t.type})||{},o=i(i({},e),t);this.assignProps(["ripple","position","dismissible"],o);var n=new r(o);return this._pushNotification(n),n},t.prototype.dismissAll=function(){for(;this.notifications.splice(0,1););},t.prototype.assignProps=function(t,e){var o=this;t.forEach(function(t){e[t]=null==e[t]?o.options[t]:e[t]})},t.prototype._pushNotification=function(t){var e=this;this.notifications.push(t);var o=void 0!==t.options.duration?t.options.duration:this.options.duration;o&&setTimeout(function(){return e._removeNotification(t)},o)},t.prototype._removeNotification=function(t){var e=this.notifications.indexOf(t);-1!==e&&this.notifications.splice(e,1)},t.prototype.normalizeOptions=function(t,e){var o={type:t};return"string"==typeof e?o.message=e:"object"==typeof e&&(o=i(i({},o),e)),o},t.prototype.registerTypes=function(t){var e=(t&&t.types||[]).slice();return f.types.map(function(t){var o=-1;e.forEach(function(e,n){e.type===t.type&&(o=n)});var n=-1!==o?e.splice(o,1)[0]:{};return i(i({},t),n)}).concat(e)},t}()},20:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.onApiRequest=e.pageWillAppear=e.onRequest=e.onDynamicLink=e.subscribeNotify=e.onNotify=e.onPushView=e.onNavigationBar=e.onRefresh=e.onBack=e.ready=e.wrapNotOkPayload=e.wrapOkPayload=void 0;var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},i=o(1),r=o(9),a=o(10),s=o(17);!function(t,e){void 0===e&&(e={});var o=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}('@-webkit-keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@-webkit-keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@-webkit-keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@-webkit-keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@-webkit-keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}@keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}.notyf{position:fixed;top:0;left:0;height:100%;width:100%;color:#fff;z-index:9999;display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-end;pointer-events:none;box-sizing:border-box;padding:20px}.notyf__icon--error,.notyf__icon--success{height:21px;width:21px;background:#fff;border-radius:50%;display:block;margin:0 auto;position:relative}.notyf__icon--error:after,.notyf__icon--error:before{content:"";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px;left:9px;height:12px;top:5px}.notyf__icon--error:after{transform:rotate(-45deg)}.notyf__icon--error:before{transform:rotate(45deg)}.notyf__icon--success:after,.notyf__icon--success:before{content:"";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px}.notyf__icon--success:after{height:6px;transform:rotate(-45deg);top:9px;left:6px}.notyf__icon--success:before{height:11px;transform:rotate(45deg);top:5px;left:10px}.notyf__toast{display:block;overflow:hidden;pointer-events:auto;-webkit-animation:notyf-fadeinup .3s ease-in forwards;animation:notyf-fadeinup .3s ease-in forwards;box-shadow:0 3px 7px 0 rgba(0,0,0,.25);position:relative;padding:0 15px;border-radius:2px;max-width:300px;transform:translateY(25%);box-sizing:border-box;flex-shrink:0}.notyf__toast--disappear{transform:translateY(0);-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s}.notyf__toast--disappear .notyf__icon,.notyf__toast--disappear .notyf__message{-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;opacity:1;transform:translateY(0)}.notyf__toast--disappear .notyf__dismiss{-webkit-animation:notyf-fadeoutright .3s forwards;animation:notyf-fadeoutright .3s forwards;opacity:1;transform:translateX(0)}.notyf__toast--disappear .notyf__message{-webkit-animation-delay:.05s;animation-delay:.05s}.notyf__toast--upper{margin-bottom:20px}.notyf__toast--lower{margin-top:20px}.notyf__toast--dismissible .notyf__wrapper{padding-right:30px}.notyf__ripple{height:400px;width:400px;position:absolute;transform-origin:bottom right;right:0;top:0;border-radius:50%;transform:scale(0) translateY(-51%) translateX(13%);z-index:5;-webkit-animation:ripple .4s ease-out forwards;animation:ripple .4s ease-out forwards}.notyf__wrapper{font-size:18px;display:flex;align-items:center;padding-top:17px;padding-bottom:17px;padding-right:15px;border-radius:3px;position:relative;z-index:10}.notyf__icon{width:22px;text-align:center;font-size:1.0em;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.3s;animation-delay:.3s;margin-right:13px}.notyf__dismiss{position:absolute;top:0;right:0;height:100%;width:26px;margin-right:-15px;-webkit-animation:notyf-fadeinleft .3s forwards;animation:notyf-fadeinleft .3s forwards;-webkit-animation-delay:.35s;animation-delay:.35s;opacity:0}.notyf__dismiss-btn{background-color:rgba(0,0,0,.25);border:none;cursor:pointer;transition:opacity .2s ease,background-color .2s ease;outline:none;opacity:.35;height:100%;width:100%}.notyf__dismiss-btn:after,.notyf__dismiss-btn:before{content:"";background:#fff;height:12px;width:2px;border-radius:3px;position:absolute;left:calc(50% - 1px);top:calc(50% - 5px)}.notyf__dismiss-btn:after{transform:rotate(-45deg)}.notyf__dismiss-btn:before{transform:rotate(45deg)}.notyf__dismiss-btn:hover{opacity:.7;background-color:rgba(0,0,0,.15)}.notyf__dismiss-btn:active{opacity:.8}.notyf__message{vertical-align:middle;position:relative;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s;line-height:1.5em}@media only screen and (max-width:480px){.notyf{padding:0}.notyf__ripple{height:600px;width:600px;-webkit-animation-duration:.5s;animation-duration:.5s}.notyf__toast{max-width:none;border-radius:0;box-shadow:0 -2px 7px 0 rgba(0,0,0,.13);width:100%}.notyf__dismiss{width:56px}}');var f=navigator.userAgent,c=f.match(/(Android);?[\s\/]+([\d.]+)?/),l=f.match(/(iPad).*OS\s([\d_]+)/),d=f.match(/(iPod)(.*OS\s([\d_]+))?/),p=!l&&f.match(/(iPhone\sOS)\s([\d_]+)/),u=!!f.toLowerCase().match(/DFYJ/i),y=!!f.toLowerCase().match(/ArkWeb/i),g=function(t){return t.init(function(t,e){e&&e(data)}),t},m=function(t){var e=function(e){(0,r.log)("[ready] <-"),t(e)};if((0,r.log)("[ready] ->"),u)if(l||p||d){if(window.WebViewJavascriptBridge)return e(WebViewJavascriptBridge);if(window.WVJBCallbacks)return window.WVJBCallbacks.push(e);window.WVJBCallbacks=[e];var o=document.createElement("iframe");o.style.display="none",o.src="https://__bridge_loaded__",document.documentElement.appendChild(o),setTimeout(function(){document.documentElement.removeChild(o)},0)}else c?window.WebViewJavascriptBridge?e(g(WebViewJavascriptBridge)):document.addEventListener("WebViewJavascriptBridgeReady",function(){e(g(WebViewJavascriptBridge))},!1):e();else e()},h=function(){},v=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}},_=function(){return{code:arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,info:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error"}},b=function(t){var e={complete:h};e=(0,i._extends)({},e,t),(0,r.log)("onBack->"+JSON.stringify(e)),y?window.LightSDK.native.close(null,function(t){(0,r.log)("onBack <- "+JSON.stringify(t))}):WebViewJavascriptBridge.callHandler("back",e,function(t){(0,r.log)("onBack <-"+JSON.stringify(t)),e.complete(t)})},w=function(t){var e={complete:h};e=(0,i._extends)({},e,t),(0,r.log)("onRefresh->"+JSON.stringify(e)),y?location.reload():WebViewJavascriptBridge.callHandler("refresh",e,function(t){(0,r.log)("onRefresh<-"+JSON.stringify(t)),e.complete(t)})},N=function(t){var e={complete:h};e=(0,i._extends)({},e,t),(0,r.log)("onBasicNavigationBar->"+JSON.stringify(e)),y?(window.LightSDK.native.setTitle&&e.title&&((0,r.log)("[Harmony setTitle] -> "+JSON.stringify(e)),window.LightSDK.native.setTitle({title:e.title},function(t){(0,r.log)("[Harmony setTitle] <- "+JSON.stringify(t))})),window.LightSDK.native.removeButton&&((0,r.log)("[Harmony removeButton] -> "),window.LightSDK.native.removeButton({position:"right"},function(t){(0,r.log)("[Harmony removeButton] <- "+JSON.stringify(t))})),window.LightSDK.native.addButton&&(e.rightButtonTitle||e.rightButtonIcon)&&((0,r.log)("[Harmony addButton] -> "),e.rightButtonIcon&&(e.rightButtonIcon="base64://"+e.rightButtonIcon,e.rightButtonTitle=""),e.rightButtonTitle&&(e.rightButtonIcon=""),window.LightSDK.native.addButton({title:e.rightButtonTitle,icon:e.rightButtonIcon,position:"right",action:e.onRightButtonPress},function(t){(0,r.log)("[Harmony addButton] <- "+JSON.stringify(t))}))):WebViewJavascriptBridge.callHandler("navigationBar",e,function(t){(0,r.log)("onBasicNavigationBar <-"+JSON.stringify(t)),e.complete(t)})},k=function(t){var e={title:"",isFullScreen:!1,isStatusBarLight:!0,ver:"v1"};e=(0,i._extends)({},e,t),1==e.isFullScreen&&(e.ver="v2"),e.uri&&(-1!=e.uri.indexOf("http")||-1!=e.uri.indexOf("https")||(e.uri=(0,i.getAbsoluteUrl)(e.uri))),y?(e.url=e.uri,(0,r.log)("onPushView->"+JSON.stringify(e)),window.LightSDK.native.callNative("winner_base.router",e,function(t){(0,r.log)("onPushView <-"+JSON.stringify(t))})):((0,r.log)("onPushView->"+JSON.stringify(e)),WebViewJavascriptBridge.callHandler("pushView",e,function(t){(0,r.log)("onPushView <-"+JSON.stringify(t))}))},x=function(t){"function"==typeof t&&(y?window.LightSDK.event.on("viewappear",function(){(0,r.log)("pageWillAppear 被回调"),"function"==typeof t&&t()}):WebViewJavascriptBridge.registerHandler("pageWillAppear",t))},O=function(t){var e={type:"javascriptNotify"};e=(0,i._extends)({},e,t),(0,r.log)("onNotify->"+JSON.stringify(e)),y||WebViewJavascriptBridge.callHandler("notify",e,function(t){(0,r.log)("onNotify<-"+JSON.stringify(t))})},S={},L=function(t,e){if("function"==typeof e){var o=t;"sae_video"!=o&&"result_video"!=o||(o="notify"),S[o]=e,(0,r.log)("subscribeNotify->"+t),y?window.LightSDK.event.on(o,function(e){(0,r.log)("[harmony]subscribeNotify<-"+JSON.stringify(e)),Object.prototype.toString.call(e).toLocaleLowerCase()=="[object String]".toLocaleLowerCase()&&(e=JSON.parse(e));var n={};if(n.type=t,n.payload=e,"result_video"==t&&e){(0,r.log)("[harmony]subscribeNotify detail<-"+JSON.stringify(n));var i=[];if(n.payload.result&&n.payload.result.length){n.payload.result.forEach(function(t){t.reasons&&"[object Array]"==Object.prototype.toString.call(t.reasons)&&(i=i.concat(t.reasons))})}n.payload.reject_reasons=i.reduce(function(t,e){return t.concat(e.split(";"))},[])}S[o]&&((0,r.log)("[harmony]subscribeNotify final<-"+JSON.stringify(n)),S[o](n))}):WebViewJavascriptBridge.registerHandler(o,function(e){if((0,r.log)("subscribeNotify<-"+JSON.stringify(e)),Object.prototype.toString.call(e).toLocaleLowerCase()=="[object String]".toLocaleLowerCase()&&(e=JSON.parse(e)),"result_video"==t&&e.payload){Object.prototype.toString.call(e.payload).toLocaleLowerCase()=="[object String]".toLocaleLowerCase()&&(e.payload=JSON.parse(e.payload)),(l||p||d)&&(e.payload=n({},e.payload.params));var i=[];if(e.payload.result&&e.payload.result.length){e.payload.result.forEach(function(t){t.reasons&&"[object Array]"==Object.prototype.toString.call(t.reasons)&&(i=i.concat(t.reasons))})}e.payload.reject_reasons=i.reduce(function(t,e){return t.concat(e.split(";"))},[])}S[o]&&(c?"sae_video"==e.type||"result_video"==e.type?((0,r.log)("安卓notify被调用."),S.notify(e)):e.type==o&&((0,r.log)("安卓"+e.type+"被调用!"),S[o](e)):((0,r.log)("iOS notify被调用;"),S[o](e)))})}},J=function(t){var e={url:""};if(e=(0,i._extends)({},e,t),(0,r.log)("onDynamicLink->"+JSON.stringify(e)),y)0==e.url.indexOf("https")||0==e.url.indexOf("http")?window.LightSDK.native.openURL({url:e.url},function(){}):location.href=e.url;else{if((0,a.compareVersion)("5.22.2")<0&&-1!=e.url.indexOf("dl/videoreview"))return void alert("您当前的APP版本过低,请升级至V5.22.2以上版本后,再进行使用");WebViewJavascriptBridge.callHandler("dynamicLink",e,function(t){(0,r.log)("onDynamicLink<-"+JSON.stringify(t))})}},C={},B=!1,E=function(t,e){switch(arguments.length){case 1:return parseInt(Math.random()*t+1,10);case 2:return parseInt(Math.random()*(e-t+1)+t,10);default:return 0}},H=[],P=function t(){var e=E(1e3,9999);return-1!==H.indexOf(e)?t(e):(H.push(e),e)},A=function(t,e,o,n){var i={type:t||"1",payload:e||{},callbackId:P()};if(C[t+"-ok"]="function"==typeof o?o:h,C[t+"-notok"]="function"==typeof n?n:h,C[t+"_"+i.callbackId+"-ok"]="function"==typeof o?o:h,C[t+"_"+i.callbackId+"-notok"]="function"==typeof n?n:h,y){var a=void 0;if(a||(a=new s.Notyf({duration:2e3})),window.LightSDK)if("1"==i.type||"2"==i.type)window.LightSDK.native.callNative("dfyj.longLogin",i,function(t){"0"==t.info.error_code?(t=t.data,(0,r.log)("[Harmony onLogin] <- "+JSON.stringify(t)),C[i.type+"-ok"](v(t))):((0,r.errorlog)("[Harmony onLogin] <- "+JSON.stringify(t.info)),C[i.type+"-notok"](_(-1,t.info.error_message)))});else if("4"==i.type)window.LightSDK.native.callNative("dfyj.share",i,function(t){"0"==t.info.error_code?(t=t.data,(0,r.log)("[Harmony onShare] <- "+JSON.stringify(t)),C[i.type+"-ok"](v(t))):((0,r.errorlog)("[Harmony onShare] <- "+JSON.stringify(t.info)),C[i.type+"-notok"](_(-1,t.info.error_message)))});else if("5"==i.type)window.LightSDK.native.callNative("dfyj.wxPay",i,function(t){"0"==t.info.error_code?(t=t.data,(0,r.log)("[Harmony onWxPay] <- "+JSON.stringify(t)),C[i.type+"-ok"](v(t))):((0,r.errorlog)("[Harmony onWxPay] <- "+JSON.stringify(t.info)),C[i.type+"-notok"](_(-1,t.info.error_message)))});else if("9"==i.type)window.LightSDK.native.callNative("dfyj.ocrIdCard",i,function(t){"0"==t.info.error_code?(t=t.data,(0,r.log)("[Harmony dfyj.ocrIdCard] <- "+JSON.stringify(t)),C[i.type+"-ok"](v(t))):((0,r.errorlog)("[Harmony dfyj.ocrIdCard] <- "+JSON.stringify(t.info)),C[i.type+"-notok"](_(-1,t.info.error_message)))});else if("10"==i.type)window.LightSDK.native.callNative("dfyj.faceRecognition",i,function(t){"0"==t.info.error_code?(t=t.data,(0,r.log)("[Harmony onFaceRecognition] <- "+JSON.stringify(t)),C[i.type+"-ok"](v(t))):((0,r.errorlog)("[Harmony onFaceRecognition] <- "+JSON.stringify(t.info)),C[i.type+"-notok"](_(-1,t.info.error_message)))});else if("14"==i.type)window.LightSDK.native.callNative("dfyj.queryAgeAppropriateMode",i,function(t){"0"==t.info.error_code?(t=t.data,(0,r.log)("[Harmony onQueryAgeAppropriateMode] <- "+JSON.stringify(t)),C[i.type+"-ok"](v(t))):((0,r.errorlog)("[Harmony onQueryAgeAppropriateMode] <- "+JSON.stringify(t.info)),C[i.type+"-notok"](_(-1,t.info.error_message)))});else if("20"==i.type)window.LightSDK.native.callNative("dfyj.imageShare",i,function(t){"0"==t.info.error_code?(t=t.data,(0,r.log)("[Harmony imageShare] <- "+JSON.stringify(t)),C[i.type+"-ok"](v(t))):((0,r.errorlog)("[Harmony imageShare] <- "+JSON.stringify(t.info)),C[i.type+"-notok"](_(-1,t.info.error_message)))});else if("25"==i.type)window.LightSDK.native.callNative("dfyj.onWifiConnect",i,function(t){"0"==t.info.error_code?(t=t.data,(0,r.log)("[Harmony onWifiConnect] <- "+JSON.stringify(t)),C[i.type+"-ok"](v(t))):((0,r.errorlog)("[Harmony onWifiConnect] <- "+JSON.stringify(t.info)),C[i.type+"-notok"](_(-1,t.info.error_message)))});else{a.error({message:"该功能在鸿蒙系统中,暂不支持",dismissible:!0})}}else WebViewJavascriptBridge.callHandler("request",i,function(t){"string"==typeof t&&(t=JSON.parse(t)),t.error||"true"===t.error?t.callbackId&&"function"==typeof C[t.type+"_"+t.callbackId+"-notok"]?C[t.type+"_"+t.callbackId+"-notok"](_(-1,t.info)):"function"==typeof C[t.type+"-notok"]&&C[t.type+"-notok"](_(-1,t.info)):t.callbackId&&"function"==typeof C[t.type+"_"+t.callbackId+"-ok"]?(l||p||d||t.payload)&&C[t.type+"_"+t.callbackId+"-ok"](v(t.payload)):"function"==typeof C[t.type+"-ok"]&&(l||p||d||t.payload)&&C[t.type+"-ok"](v(t.payload))}),B||(WebViewJavascriptBridge.registerHandler("request",function(t){"string"==typeof t&&(t=JSON.parse(t)),t.error||"true"===t.error?t.callbackId&&"function"==typeof C[t.type+"_"+t.callbackId+"-notok"]?C[t.type+"_"+t.callbackId+"-notok"](_(-1,t.info)):"function"==typeof C[t.type+"-notok"]&&C[t.type+"-notok"](_(-1,t.info)):t.callbackId&&"function"==typeof C[t.type+"_"+t.callbackId+"-ok"]?C[t.type+"_"+t.callbackId+"-ok"](v(t.payload)):"function"==typeof C[t.type+"-ok"]&&C[t.type+"-ok"](v(t.payload))}),B=!0)},j=function(t,e,o,n){if((0,i.isEmpty)(t))throw new Error("functionNo is required ...");var a={funcId:t,payload:e||{}};(0,r.log)("onApiRequest->"+JSON.stringify(a)),y||WebViewJavascriptBridge.callHandler("apiRequest",a,function(t){if((0,r.log)("onApiRequest<-"+JSON.stringify(t)),"string"==typeof t&&(t=JSON.parse(t)),l||p||d){if(t.error||"true"===t.error)t.payload?"function"==typeof n&&n(_(t.payload.code,t.payload.info)):"function"==typeof n&&n(_(-1,t.info));else if("function"==typeof o){var e={};t.payload&&(e="string"==typeof t.payload.data?JSON.parse(t.payload.data):t.payload.data),o(v(e))}}else if(t.error||"true"===t.error)"function"==typeof n&&n(_(-1,t.info));else{var i={};i="string"==typeof t.payload.data?JSON.parse(t.payload.data):t.payload.data?t.payload.data:{},"0"!=t.payload.code?"function"==typeof n&&n(_(t.payload.code,t.payload.info)):"function"==typeof o&&o(v(i))}})};e.wrapOkPayload=v,e.wrapNotOkPayload=_,e.ready=m,e.onBack=b,e.onRefresh=w,e.onNavigationBar=N,e.onPushView=k,e.onNotify=O,e.subscribeNotify=L,e.onDynamicLink=J,e.onRequest=A,e.pageWillAppear=x,e.onApiRequest=j},9:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){var t=new Date;t.getDate();return(t.getHours()<10?"0"+t.getHours():t.getHours())+":"+(t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes())+":"+(t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds())+"."+t.getMilliseconds()},i=function(t){t&&(t=n()+"[赢家]: "+t)},r=function(t){t&&(t=n()+"[赢家]: "+t)};e.log=i,e.errorlog=r}})});
|