webtonative 1.0.25 → 1.0.26

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.stop=exports.start=void 0;var _utills=require("../utills"),start=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.data,c=a.callback,d=a.backgroundIndicator,e=a.pauseAutomatically,f=a.distanceFilter,g=void 0===f?0:f,h=a.desiredAccuracy,i=void 0===h?"best":h,j=a.activityType,k=void 0===j?"other":j,l=a.apiUrl,m=a.timeout;(0,_utills.registerCb)(function(a){var b=a.type;"LOCATION_UPDATE"===b&&c&&c(a)},{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"startLocation",data:b,backgroundIndicator:void 0!==d&&d,pauseAutomatically:!(void 0!==e)||e,distanceFilter:g,desiredAccuracy:i,activityType:k,apiUrl:l,timeout:m})}};exports.start=start;/**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.stop=exports.start=void 0;var _utills=require("../utills"),start=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.data,c=a.callback,d=a.backgroundIndicator,e=a.pauseAutomatically,f=a.distanceFilter,g=void 0===f?0:f,h=a.desiredAccuracy,i=void 0===h?"best":h,j=a.activityType,k=void 0===j?"other":j,l=a.apiUrl,m=a.timeout;(0,_utills.registerCb)(function(a){var b=a.type;"LOCATION_UPDATE"===b&&c&&c(a)},{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"startLocation",data:b,backgroundIndicator:void 0!==d&&d,pauseAutomatically:!(void 0!==e)||e,distanceFilter:g,desiredAccuracy:i,activityType:k,apiUrl:l,timeout:m}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.startTrackingLocation(JSON.stringify({action:"startLocation",data:b,interval:m,callback:c,apiUrl:l,displacement:g}))}};exports.start=start;/**
2
2
  *
3
3
  *
4
- */var stop=function(){0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.deRegisterCbByKey)("LOCATION_UPDATE"),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"stopLocation"}))};exports.stop=stop;
4
+ */var stop=function(){0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.deRegisterCbByKey)("LOCATION_UPDATE"),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"stopLocation"}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.stopTrackingLocation())};exports.stop=stop;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _utills=require("../utills"),inAppPurchase=function(a){if(["IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.productId;(0,_utills.registerCb)(function(a){var c=a.type;"inAppPurchase"===c&&b&&b(a)}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"inAppPurchase",productId:c})}},_default=inAppPurchase;exports["default"]=_default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.inAppPurchase=exports.getAllPurchases=void 0;var _utills=require("../utills"),inAppPurchase=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.callback,c=a.productId,d=a.productType,e=a.isConsumable;(0,_utills.registerCb)(function(a){var c=a.type;"inAppPurchase"===c&&b&&b(a)}),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"inAppPurchase",productId:c}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.inAppPurchase(JSON.stringify({action:"inAppPurchase",productId:c,productType:d,isConsumable:void 0!==e&&e}))}};exports.inAppPurchase=inAppPurchase;var getAllPurchases=function(a){if(["ANDROID_APP"].includes(_utills.platform)){var b=a.callback;(0,_utills.registerCb)(function(a){var c=a.type;"purchaseList"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.getAllPurchases({action:"purchaseList"})}};exports.getAllPurchases=getAllPurchases;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webtonative",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/utills.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.webToNativeIos=exports.webToNative=exports.registerForAbMobCb=exports.registerCb=exports.platform=exports.isNativeApp=exports.isClient=exports.deRegisterForAbMobCb=exports.deRegisterCbByKey=void 0;var isClient="undefined"!=typeof window;exports.isClient=isClient;var webToNative=isClient&&window.WebToNativeInterface||{};exports.webToNative=webToNative;var webToNativeIos=isClient&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface;exports.webToNativeIos=webToNativeIos;var platform=webToNative.getAndroidVersion?"ANDROID_APP":webToNativeIos?"IOS_APP":"WEBSITE";exports.platform=platform;var isNativeApp=isClient&&"WEBSITE"!==platform;exports.isNativeApp=isNativeApp;var cbObj={},counter=1,abMobCb=null;isNativeApp&&(webToNative.androidCBHook=function(a){var b=JSON.parse(a),c=b.type;for(var d in cbObj)b&&b.reqType?d==b.reqType&&(cbObj[d].cb(b),delete cbObj[d]):(cbObj[d].cb(b),delete cbObj[d])},webToNative.androidAdMobCBHook=function(a){var b=JSON.parse(a);abMobCb&&abMobCb(b)},window.iosCBHook=function(a){var b=a;try{b=JSON.parse(a)}catch(a){console.log(a)}for(var c in cbObj){var d=cbObj[c],e=d.cb,f=d.ignoreDelete,g=void 0!==f&&f;b&&b.reqType?c==b.reqType&&(e(b),!g&&delete cbObj[c]):(e(b),!g&&delete cbObj[c])}});var registerCb=function(a,b){"function"==typeof a&&(b&&b.key?cbObj[b.key]={cb:a,ignoreDelete:!!b.ignoreDelete}:(cbObj[counter]={cb:a,ignoreDelete:!!(b&&b.ignoreDelete)},counter+=1))};exports.registerCb=registerCb;var registerForAbMobCb=function(a){"function"==typeof a&&(abMobCb=a)};exports.registerForAbMobCb=registerForAbMobCb;var deRegisterForAbMobCb=function(){abMobCb&&(abMobCb=null)};exports.deRegisterForAbMobCb=deRegisterForAbMobCb;var deRegisterCbByKey=function(a){delete cbObj[a]};exports.deRegisterCbByKey=deRegisterCbByKey;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.webToNativeIos=exports.webToNative=exports.registerForAbMobCb=exports.registerCb=exports.platform=exports.isNativeApp=exports.isClient=exports.deRegisterForAbMobCb=exports.deRegisterCbByKey=void 0;var isClient="undefined"!=typeof window;exports.isClient=isClient;var webToNative=isClient&&window.WebToNativeInterface||{};exports.webToNative=webToNative;var webToNativeIos=isClient&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface;exports.webToNativeIos=webToNativeIos;var platform=webToNative.getAndroidVersion?"ANDROID_APP":webToNativeIos?"IOS_APP":"WEBSITE";exports.platform=platform;var isNativeApp=isClient&&"WEBSITE"!==platform;exports.isNativeApp=isNativeApp;var cbObj={},counter=1,abMobCb=null;isNativeApp&&(webToNative.androidCBHook=function(a){var b=a;try{b=JSON.parse(a)}catch(a){console.log(a)}var c=b,d=c.type;for(var e in cbObj){var f=cbObj[e],g=f.cb,h=f.ignoreDelete,i=void 0!==h&&h;b&&b.reqType?e==b.reqType&&(g(b),!i&&delete cbObj[e]):(g(b),!i&&delete cbObj[e])}},webToNative.androidAdMobCBHook=function(a){var b=JSON.parse(a);abMobCb&&abMobCb(b)},window.iosCBHook=function(a){var b=a;try{b=JSON.parse(a)}catch(a){console.log(a)}for(var c in cbObj){var d=cbObj[c],e=d.cb,f=d.ignoreDelete,g=void 0!==f&&f;b&&b.reqType?c==b.reqType&&(e(b),!g&&delete cbObj[c]):(e(b),!g&&delete cbObj[c])}});var registerCb=function(a,b){"function"==typeof a&&(b&&b.key?cbObj[b.key]={cb:a,ignoreDelete:!!b.ignoreDelete}:(cbObj[counter]={cb:a,ignoreDelete:!!(b&&b.ignoreDelete)},counter+=1))};exports.registerCb=registerCb;var registerForAbMobCb=function(a){"function"==typeof a&&(abMobCb=a)};exports.registerForAbMobCb=registerForAbMobCb;var deRegisterForAbMobCb=function(){abMobCb&&(abMobCb=null)};exports.deRegisterForAbMobCb=deRegisterForAbMobCb;var deRegisterCbByKey=function(a){delete cbObj[a]};exports.deRegisterCbByKey=deRegisterCbByKey;
@@ -1 +1 @@
1
- !function(){"use strict";var e={d:function(n,t){for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:function(){return W},deviceInfo:function(){return E},hideSplashScreen:function(){return k},isAndroidApp:function(){return R},isIosApp:function(){return h},isNativeApp:function(){return S},platform:function(){return _},shareLink:function(){return C},showInAppReview:function(){return M},statusBar:function(){return m}});var t={};e.r(t),e.d(t,{getPlayerId:function(){return F},removeExternalUserId:function(){return L},setExternalUserId:function(){return U},setTags:function(){return B}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return J},Format:function(){return H},Types:function(){return q}});var i={};e.r(i),e.d(i,{bannerAd:function(){return K},fullScreenAd:function(){return X},rewardsAd:function(){return z}});var r={};e.r(r),e.d(r,{logEvent:function(){return Y},setCustomerUserId:function(){return Z}});var a={};e.r(a),e.d(a,{send:function(){return $},sendPurchase:function(){return ee}});var s={};e.r(s),e.d(s,{hide:function(){return ne},show:function(){return te}});var c={};e.r(c),e.d(c,{getAll:function(){return ie},getPermissionStatus:function(){return oe}});var u={};e.r(u),e.d(u,{start:function(){return re},stop:function(){return ae}});var P={};e.r(P),e.d(P,{keepScreenNormal:function(){return ce},keepScreenOn:function(){return se}});var d={};e.r(d),e.d(d,{get:function(){return ue},set:function(){return Pe}});var A={};e.r(A),e.d(A,{prompt:function(){return de}});var l={};e.r(l),e.d(l,{request:function(){return Ae},status:function(){return le}});var f={};e.r(f),e.d(f,{logEvent:function(){return ge},logScreen:function(){return ve},setCollection:function(){return fe},setDefaultEventParameters:function(){return Oe},setUserId:function(){return Ie},setUserProperty:function(){return pe}});var I={};e.r(I),e.d(I,{events:function(){return f}});var p={};e.r(p),e.d(p,{trigger:function(){return _e}});var O="undefined"!=typeof window,g=O&&window.WebToNativeInterface||{},v=O&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,_=g.getAndroidVersion?"ANDROID_APP":v?"IOS_APP":"WEBSITE",S=O&&"WEBSITE"!==_,D={},N=1,w=null;S&&(g.androidCBHook=function(e){var n=JSON.parse(e);for(var t in n.type,D)n&&n.reqType?t==n.reqType&&(D[t].cb(n),delete D[t]):(D[t].cb(n),delete D[t])},g.androidAdMobCBHook=function(e){var n=JSON.parse(e);w&&w(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in D){var o=D[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete D[t]):(i(n),a||delete D[t])}});var y=function(e,n){"function"==typeof e&&(n&&n.key?D[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(D[N]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},N+=1))},T=function(e){"function"==typeof e&&(w=e)},b=function(){w&&(w=null)},R="ANDROID_APP"===_,h="IOS_APP"===_,k=function(){S&&g.hideSplashScreen()},m=function(e){S&&(R?g.statusBar(JSON.stringify(e)):h&&v.postMessage({action:"statusBar",color:e.color,style:e.style}))},E=function(){return new Promise((function(e,n){y((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===_?g.getDeviceInfo():"IOS_APP"===_?v.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},M=function(){S&&g.showInAppReview()},C=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";R&&g.openShareIntent(t),h&&v.postMessage({action:"share",url:t})},W={isAndroidApp:R,isIosApp:h,hideSplashScreen:k,statusBar:m,deviceInfo:E,showInAppReview:M,shareLink:C,platform:_,isNativeApp:S},F=function(){return new Promise((function(e,n){y((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===_?g.getOneSignalId():"IOS_APP"===_?v.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},U=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===_)return S&&g.setExternalUserId(e);"IOS_APP"===_&&v.postMessage({action:"setExternalUserId",userId:e})},L=function(){if("ANDROID_APP"===_)return S&&g.removeExternalUserId();"IOS_APP"===_&&v.postMessage({action:"removeExternalUserId"})},B=function(e){var n=e.tags;if("ANDROID_APP"===_)return S&&g.setUserTags(n);"IOS_APP"===_&&v.postMessage({action:"setUserTags",tags:n})},V=void 0,x=null,H={UNKNOWN:-1,ALL_FORMATS:0,CODE_128:1,CODE_39:2,CODE_93:4,CODABAR:8,DATA_MATRIX:16,EAN_13:32,EAN_8:64,ITF:128,QR_CODE:256,UPC_A:512,UPC_E:1024,PDF417:2048,AZTEC:4096},q={UNKNOWN:0,CONTACT_INFO:1,EMAIL:2,ISBN:3,PHONE:4,PRODUCT:5,SMS:6,TEXT:7,URL:8,WIFI:9,GEO:10,CALENDAR_EVENT:11,DRIVER_LICENSE:12},J=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.onBarcodeSearch,t=e.format;y((function(e){var t=e.type,o=e.value;"BARCODE_SCAN"===t&&n&&n(o)})),"ANDROID_APP"===_&&g.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===_&&v.postMessage({action:"barcodeScan",barcodeFormat:String(t||H.ALL_FORMATS)})}},j=void 0,G=null,K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return S&&g.showBannerAd(JSON.stringify(e)),j},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==_){var n=e.fullScreenAdCallback;return T((function(e){var n=e.status;G&&G(e),"adDismissed"===n&&(G=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&b()})),S&&g.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(G=n),j}},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==_){var n=e.rewardsAdCallback;return T((function(e){var n=e.status;G&&G(e),"adDismissed"===n&&(G=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&b()})),S&&g.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(G=n),j}},Q={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.loginWithFacebook(),"IOS_APP"===_&&v.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.logoutWithFacebook(),"IOS_APP"===_&&v.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.signInWithGoogle(),"IOS_APP"===_&&v.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.signOutWithGoogle(),"IOS_APP"===_&&v.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"appleSignIn",scope:t})}}}},Z=function(e){["ANDROID_APP","IOS_APP"].includes(_)&&("ANDROID_APP"===_&&g.setAppsFlyerUserId(e),"IOS_APP"===_&&v.postMessage({action:"setAppsFlyerUserId",userId:e}))},Y=function(e,n){["ANDROID_APP","IOS_APP"].includes(_)&&("ANDROID_APP"===_&&g.addEventToAppsFlyer(e,n),"IOS_APP"===_&&v.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},$=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.event,t=e.valueToSum,o=e.parameters;"ANDROID_APP"===_&&g.addFbEvents(n,o),"IOS_APP"===_&&v.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:o})}},ee=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.amount,t=e.currency,o=e.parameters;"ANDROID_APP"===_&&g.addFbPurchaseEvent(n,t,o),"IOS_APP"===_&&v.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:o})}},ne=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"showHideStickyFooter",show:!1})},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"showHideStickyFooter",show:!0,key:n})},oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){console.log(e),"contactPermissionStatus"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"askUserForContactPermission"}))},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){var t=e.type;console.log(e),"contactDetails"===t&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"getUserContactDetails"}))},re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.data,t=e.callback,o=e.backgroundIndicator,i=void 0!==o&&o,r=e.pauseAutomatically,a=void 0===r||r,s=e.distanceFilter,c=void 0===s?0:s,u=e.desiredAccuracy,P=void 0===u?"best":u,d=e.activityType,A=void 0===d?"other":d,l=e.apiUrl,f=e.timeout;y((function(e){"LOCATION_UPDATE"===e.type&&t&&t(e)}),{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===_&&v.postMessage({action:"startLocation",data:n,backgroundIndicator:i,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:P,activityType:A,apiUrl:l,timeout:f})}},ae=function(){["ANDROID_APP","IOS_APP"].includes(_)&&(delete D["LOCATION_UPDATE"],"IOS_APP"===_&&v.postMessage({action:"stopLocation"}))},se=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"keepScreenOn",flag:!0})},ce=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"keepScreenOn",flag:!1})},ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"getClipBoardData"}))},Pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"setClipBoardData",text:e.data||""})},de=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"showAppRating"})},Ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(_)&&(y((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"requestTrackingAuthorization"}))},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(_)&&(y((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"trackingConsentStatus"}))},fe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.enabled;"IOS_APP"===_&&v.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n})}},Ie=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.userId;"IOS_APP"===_&&v.postMessage({action:"setFirebaseUserId",userId:n})}},pe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.key,t=e.value;"IOS_APP"===_&&v.postMessage({action:"setFirebaseUserProp",key:n,value:t})}},Oe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.parameters;"IOS_APP"===_&&v.postMessage({action:"setFirebaseDefaultParam",parameters:n})}},ge=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.eventName,t=e.parameters;"IOS_APP"===_&&v.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t})}},ve=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.screenName,t=e.screenClass;"IOS_APP"===_&&v.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t})}},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"haptikEffect",effect:e.effect})};window.WTN=n,window.WTN.OneSignal=t,window.WTN.VoiceSearch=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onVoiceSearch;return y((function(e){var n=e.type,t=e.results;"VOICE_SEARCH_RESULT"===n&&(x&&x(t),x=null)})),S&&g.openVoiceSearch(),"function"==typeof n&&(x=n),V},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=Q,window.WTN.inAppPurchase=function(e){if(["IOS_APP"].includes(_)){var n=e.callback,t=e.productId;y((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"inAppPurchase",productId:t})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=P,window.WTN.backgroundLocation=u,window.WTN.clipboard=d,window.WTN.appReview=A,window.WTN.ATTConsent=l,window.WTN.facebook={events:a},window.WTN.firebaseAnalytics=I,window.WTN.haptics=p,window&&window.WebToNativeInterface&&window.WebToNativeInterface.getAndroidVersion?window.navigator.share=function(e){return new Promise((function(n,t){window.WebToNativeInterface.openShareIntent(e.url),n()}))}:WTN.isIosApp&&(window.navigator.share=function(e){return new Promise((function(n,t){v.postMessage({action:"share",url:e.url}),n()}))})}();
1
+ !function(){"use strict";var e={d:function(n,t){for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:function(){return W},deviceInfo:function(){return E},hideSplashScreen:function(){return k},isAndroidApp:function(){return h},isIosApp:function(){return b},isNativeApp:function(){return D},platform:function(){return _},shareLink:function(){return C},showInAppReview:function(){return M},statusBar:function(){return m}});var t={};e.r(t),e.d(t,{getPlayerId:function(){return L},removeExternalUserId:function(){return U},setExternalUserId:function(){return F},setTags:function(){return B}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return q},Format:function(){return x},Types:function(){return H}});var i={};e.r(i),e.d(i,{bannerAd:function(){return K},fullScreenAd:function(){return X},rewardsAd:function(){return z}});var r={};e.r(r),e.d(r,{logEvent:function(){return Y},setCustomerUserId:function(){return Z}});var a={};e.r(a),e.d(a,{send:function(){return $},sendPurchase:function(){return ee}});var s={};e.r(s),e.d(s,{hide:function(){return ne},show:function(){return te}});var c={};e.r(c),e.d(c,{getAll:function(){return ie},getPermissionStatus:function(){return oe}});var u={};e.r(u),e.d(u,{start:function(){return re},stop:function(){return ae}});var P={};e.r(P),e.d(P,{keepScreenNormal:function(){return ce},keepScreenOn:function(){return se}});var A={};e.r(A),e.d(A,{get:function(){return ue},set:function(){return Pe}});var d={};e.r(d),e.d(d,{prompt:function(){return Ae}});var l={};e.r(l),e.d(l,{request:function(){return de},status:function(){return le}});var f={};e.r(f),e.d(f,{logEvent:function(){return ge},logScreen:function(){return ve},setCollection:function(){return fe},setDefaultEventParameters:function(){return Oe},setUserId:function(){return pe},setUserProperty:function(){return Ie}});var p={};e.r(p),e.d(p,{events:function(){return f}});var I={};e.r(I),e.d(I,{trigger:function(){return _e}});var O="undefined"!=typeof window,g=O&&window.WebToNativeInterface||{},v=O&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,_=g.getAndroidVersion?"ANDROID_APP":v?"IOS_APP":"WEBSITE",D=O&&"WEBSITE"!==_,S={},N=1,w=null;D&&(g.androidCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in n.type,S){var o=S[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete S[t]):(i(n),a||delete S[t])}},g.androidAdMobCBHook=function(e){var n=JSON.parse(e);w&&w(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in S){var o=S[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete S[t]):(i(n),a||delete S[t])}});var y=function(e,n){"function"==typeof e&&(n&&n.key?S[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(S[N]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},N+=1))},T=function(e){"function"==typeof e&&(w=e)},R=function(){w&&(w=null)},h="ANDROID_APP"===_,b="IOS_APP"===_,k=function(){D&&g.hideSplashScreen()},m=function(e){D&&(h?g.statusBar(JSON.stringify(e)):b&&v.postMessage({action:"statusBar",color:e.color,style:e.style}))},E=function(){return new Promise((function(e,n){y((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===_?g.getDeviceInfo():"IOS_APP"===_?v.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},M=function(){D&&g.showInAppReview()},C=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";h&&g.openShareIntent(t),b&&v.postMessage({action:"share",url:t})},W={isAndroidApp:h,isIosApp:b,hideSplashScreen:k,statusBar:m,deviceInfo:E,showInAppReview:M,shareLink:C,platform:_,isNativeApp:D},L=function(){return new Promise((function(e,n){y((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===_?g.getOneSignalId():"IOS_APP"===_?v.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},F=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===_)return D&&g.setExternalUserId(e);"IOS_APP"===_&&v.postMessage({action:"setExternalUserId",userId:e})},U=function(){if("ANDROID_APP"===_)return D&&g.removeExternalUserId();"IOS_APP"===_&&v.postMessage({action:"removeExternalUserId"})},B=function(e){var n=e.tags;if("ANDROID_APP"===_)return D&&g.setUserTags(n);"IOS_APP"===_&&v.postMessage({action:"setUserTags",tags:n})},J=void 0,V=null,x={UNKNOWN:-1,ALL_FORMATS:0,CODE_128:1,CODE_39:2,CODE_93:4,CODABAR:8,DATA_MATRIX:16,EAN_13:32,EAN_8:64,ITF:128,QR_CODE:256,UPC_A:512,UPC_E:1024,PDF417:2048,AZTEC:4096},H={UNKNOWN:0,CONTACT_INFO:1,EMAIL:2,ISBN:3,PHONE:4,PRODUCT:5,SMS:6,TEXT:7,URL:8,WIFI:9,GEO:10,CALENDAR_EVENT:11,DRIVER_LICENSE:12},q=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.onBarcodeSearch,t=e.format;y((function(e){var t=e.type,o=e.value;"BARCODE_SCAN"===t&&n&&n(o)})),"ANDROID_APP"===_&&g.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===_&&v.postMessage({action:"barcodeScan",barcodeFormat:String(t||x.ALL_FORMATS)})}},j=void 0,G=null,K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return D&&g.showBannerAd(JSON.stringify(e)),j},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==_){var n=e.fullScreenAdCallback;return T((function(e){var n=e.status;G&&G(e),"adDismissed"===n&&(G=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&R()})),D&&g.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(G=n),j}},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==_){var n=e.rewardsAdCallback;return T((function(e){var n=e.status;G&&G(e),"adDismissed"===n&&(G=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&R()})),D&&g.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(G=n),j}},Q={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.loginWithFacebook(),"IOS_APP"===_&&v.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.logoutWithFacebook(),"IOS_APP"===_&&v.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.signInWithGoogle(),"IOS_APP"===_&&v.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.signOutWithGoogle(),"IOS_APP"===_&&v.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"appleSignIn",scope:t})}}}},Z=function(e){["ANDROID_APP","IOS_APP"].includes(_)&&("ANDROID_APP"===_&&g.setAppsFlyerUserId(e),"IOS_APP"===_&&v.postMessage({action:"setAppsFlyerUserId",userId:e}))},Y=function(e,n){["ANDROID_APP","IOS_APP"].includes(_)&&("ANDROID_APP"===_&&g.addEventToAppsFlyer(e,n),"IOS_APP"===_&&v.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},$=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.event,t=e.valueToSum,o=e.parameters;"ANDROID_APP"===_&&g.addFbEvents(n,o),"IOS_APP"===_&&v.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:o})}},ee=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.amount,t=e.currency,o=e.parameters;"ANDROID_APP"===_&&g.addFbPurchaseEvent(n,t,o),"IOS_APP"===_&&v.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:o})}},ne=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"showHideStickyFooter",show:!1})},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"showHideStickyFooter",show:!0,key:n})},oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){console.log(e),"contactPermissionStatus"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"askUserForContactPermission"}))},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){var t=e.type;console.log(e),"contactDetails"===t&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"getUserContactDetails"}))},re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.data,t=e.callback,o=e.backgroundIndicator,i=void 0!==o&&o,r=e.pauseAutomatically,a=void 0===r||r,s=e.distanceFilter,c=void 0===s?0:s,u=e.desiredAccuracy,P=void 0===u?"best":u,A=e.activityType,d=void 0===A?"other":A,l=e.apiUrl,f=e.timeout;y((function(e){"LOCATION_UPDATE"===e.type&&t&&t(e)}),{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===_&&v.postMessage({action:"startLocation",data:n,backgroundIndicator:i,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:P,activityType:d,apiUrl:l,timeout:f}),"ANDROID_APP"===_&&g.startTrackingLocation(JSON.stringify({action:"startLocation",data:n,interval:f,callback:t,apiUrl:l,displacement:c}))}},ae=function(){["ANDROID_APP","IOS_APP"].includes(_)&&(delete S["LOCATION_UPDATE"],"IOS_APP"===_&&v.postMessage({action:"stopLocation"}),"ANDROID_APP"===_&&g.stopTrackingLocation())},se=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"keepScreenOn",flag:!0})},ce=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"keepScreenOn",flag:!1})},ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"getClipBoardData"}))},Pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"setClipBoardData",text:e.data||""})},Ae=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"showAppRating"})},de=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(_)&&(y((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"requestTrackingAuthorization"}))},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(_)&&(y((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"trackingConsentStatus"}))},fe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.enabled;"IOS_APP"===_&&v.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n})}},pe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.userId;"IOS_APP"===_&&v.postMessage({action:"setFirebaseUserId",userId:n})}},Ie=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.key,t=e.value;"IOS_APP"===_&&v.postMessage({action:"setFirebaseUserProp",key:n,value:t})}},Oe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.parameters;"IOS_APP"===_&&v.postMessage({action:"setFirebaseDefaultParam",parameters:n})}},ge=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.eventName,t=e.parameters;"IOS_APP"===_&&v.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t})}},ve=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.screenName,t=e.screenClass;"IOS_APP"===_&&v.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t})}},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"haptikEffect",effect:e.effect})};window.WTN=n,window.WTN.OneSignal=t,window.WTN.VoiceSearch=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onVoiceSearch;return y((function(e){var n=e.type,t=e.results;"VOICE_SEARCH_RESULT"===n&&(V&&V(t),V=null)})),D&&g.openVoiceSearch(),"function"==typeof n&&(V=n),J},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=Q,window.WTN.inAppPurchase=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.productId,o=e.productType,i=e.isConsumable,r=void 0!==i&&i;y((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"inAppPurchase",productId:t}),"ANDROID_APP"===_&&g.inAppPurchase(JSON.stringify({action:"inAppPurchase",productId:t,productType:o,isConsumable:r}))}},window.WTN.getAllPurchases=function(e){if(["ANDROID_APP"].includes(_)){var n=e.callback;y((function(e){"purchaseList"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.getAllPurchases({action:"purchaseList"})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=P,window.WTN.backgroundLocation=u,window.WTN.clipboard=A,window.WTN.appReview=d,window.WTN.ATTConsent=l,window.WTN.facebook={events:a},window.WTN.firebaseAnalytics=p,window.WTN.haptics=I,window&&window.WebToNativeInterface&&window.WebToNativeInterface.getAndroidVersion?window.navigator.share=function(e){return new Promise((function(n,t){window.WebToNativeInterface.openShareIntent(e.url),n()}))}:WTN.isIosApp&&(window.navigator.share=function(e){return new Promise((function(n,t){v.postMessage({action:"share",url:e.url}),n()}))})}();