@braze/web-sdk 3.5.0 → 4.0.1

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.
Files changed (169) hide show
  1. package/README.md +5 -11
  2. package/index.d.ts +472 -547
  3. package/package.json +9 -7
  4. package/shared-lib/braze-shared-lib.js +1 -0
  5. package/shared-lib/encoding-utils.js +1 -0
  6. package/shared-lib/event-types.js +1 -0
  7. package/shared-lib/guid.js +1 -0
  8. package/shared-lib/indexed-db-adapter.js +1 -0
  9. package/shared-lib/logger.js +1 -0
  10. package/shared-lib/supported-options.js +1 -0
  11. package/src/Card/card-manager-factory.js +1 -0
  12. package/src/Card/card-manager.js +1 -0
  13. package/src/Card/display/card-display.js +1 -0
  14. package/src/Card/index.js +1 -0
  15. package/src/Card/log-card-click.js +1 -0
  16. package/src/Card/log-card-dismissal.js +1 -0
  17. package/src/Card/log-card-impressions.js +1 -0
  18. package/src/Card/models/banner.js +1 -0
  19. package/src/Card/models/captioned-image.js +1 -0
  20. package/src/Card/models/card.js +1 -0
  21. package/src/Card/models/classic-card.js +1 -0
  22. package/src/Card/models/control-card.js +1 -0
  23. package/src/Card/models/index.js +1 -0
  24. package/src/Card/util/card-factory.js +1 -0
  25. package/src/ContentCards/content-cards-provider-factory.js +1 -0
  26. package/src/ContentCards/content-cards-provider.js +1 -0
  27. package/src/ContentCards/content-cards.js +1 -0
  28. package/src/ContentCards/get-cached-content-cards.js +1 -0
  29. package/src/ContentCards/index.js +1 -0
  30. package/src/ContentCards/log-content-cards-displayed.js +1 -0
  31. package/src/ContentCards/request-content-cards-refresh.js +1 -0
  32. package/src/ContentCards/subscribe-to-content-cards-updates.js +1 -0
  33. package/src/ContentCards/ui/hide-content-cards.js +1 -0
  34. package/src/ContentCards/ui/show-content-cards.js +1 -0
  35. package/src/ContentCards/ui/toggle-content-cards.js +1 -0
  36. package/src/Core/add-sdk-metadata.js +1 -0
  37. package/src/Core/braze-sdk-metadata.js +1 -0
  38. package/src/Core/change-user.js +1 -0
  39. package/src/Core/destroy.js +1 -0
  40. package/src/Core/device-properties.js +1 -0
  41. package/src/Core/disable-sdk.js +1 -0
  42. package/src/Core/enable-sdk.js +1 -0
  43. package/src/Core/get-device-id.js +1 -0
  44. package/src/Core/get-user.js +1 -0
  45. package/src/Core/handle-braze-action.js +1 -0
  46. package/src/Core/index.js +1 -0
  47. package/src/Core/initialize.js +1 -0
  48. package/src/Core/is-disabled.js +1 -0
  49. package/src/Core/log-custom-event.js +1 -0
  50. package/src/Core/log-purchase.js +1 -0
  51. package/src/Core/open-session.js +1 -0
  52. package/src/Core/remove-all-subscriptions.js +1 -0
  53. package/src/Core/remove-subscription.js +1 -0
  54. package/src/Core/request-immediate-data-flush.js +1 -0
  55. package/src/Core/set-logger.js +1 -0
  56. package/src/Core/set-sdk-authentication-signature.js +1 -0
  57. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -0
  58. package/src/Core/toggle-logging.js +1 -0
  59. package/src/Core/wipe-data.js +1 -0
  60. package/src/Feed/feed-provider-factory.js +1 -0
  61. package/src/Feed/feed-provider.js +1 -0
  62. package/src/Feed/feed.js +1 -0
  63. package/src/Feed/get-cached-feed.js +1 -0
  64. package/src/Feed/index.js +1 -0
  65. package/src/Feed/log-feed-displayed.js +1 -0
  66. package/src/Feed/request-feed-refresh.js +1 -0
  67. package/src/Feed/subscribe-to-feed-updates.js +1 -0
  68. package/src/Feed/ui/hide-feed.js +1 -0
  69. package/src/Feed/ui/show-feed.js +1 -0
  70. package/src/Feed/ui/toggle-feed.js +1 -0
  71. package/src/InAppMessage/display/get-animation-effect.js +1 -0
  72. package/src/InAppMessage/display/html-message-to-html.js +1 -0
  73. package/src/InAppMessage/display/in-app-message-to-html.js +1 -0
  74. package/src/InAppMessage/display/modal-utils.js +1 -0
  75. package/src/InAppMessage/in-app-message-factory.js +1 -0
  76. package/src/InAppMessage/in-app-message-manager-factory.js +1 -0
  77. package/src/InAppMessage/in-app-message-manager.js +1 -0
  78. package/src/InAppMessage/index.js +1 -0
  79. package/src/InAppMessage/log-in-app-message-button-click.js +1 -0
  80. package/src/InAppMessage/log-in-app-message-click.js +1 -0
  81. package/src/InAppMessage/log-in-app-message-html-click.js +1 -0
  82. package/src/InAppMessage/log-in-app-message-impression.js +1 -0
  83. package/src/InAppMessage/models/control-message.js +1 -0
  84. package/src/InAppMessage/models/full-screen-message.js +1 -0
  85. package/src/InAppMessage/models/html-message.js +1 -0
  86. package/src/InAppMessage/models/in-app-message-button.js +1 -0
  87. package/src/InAppMessage/models/in-app-message.js +1 -0
  88. package/src/InAppMessage/models/modal-message.js +1 -0
  89. package/src/InAppMessage/models/slide-up-message.js +1 -0
  90. package/src/InAppMessage/models/templated-in-app-message.js +1 -0
  91. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -0
  92. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +1 -0
  93. package/src/InAppMessage/ui/show-in-app-message.js +1 -0
  94. package/src/Push/index.js +1 -0
  95. package/src/Push/is-push-blocked.js +1 -0
  96. package/src/Push/is-push-permission-granted.js +1 -0
  97. package/src/Push/is-push-supported.js +1 -0
  98. package/src/Push/push-manager-factory.js +1 -0
  99. package/src/Push/push-manager.js +1 -0
  100. package/src/Push/request-push-permission.js +1 -0
  101. package/src/Push/unregister-push.js +1 -0
  102. package/src/User/index.js +1 -0
  103. package/src/User/user-manager.js +1 -0
  104. package/src/User/user.js +1 -0
  105. package/src/common/base-feed.js +1 -0
  106. package/src/common/base-provider.js +1 -0
  107. package/src/common/constants.js +1 -0
  108. package/src/common/event-logger.js +1 -0
  109. package/src/common/feed-display.js +1 -0
  110. package/src/common/translations.js +1 -0
  111. package/src/index.js +1 -0
  112. package/src/l10n/l10n-manager-factory.js +1 -0
  113. package/src/l10n/l10n-manager.js +1 -0
  114. package/src/managers/auth-manager.js +1 -0
  115. package/src/managers/braze-instance.js +1 -0
  116. package/src/managers/device-manager.js +1 -0
  117. package/src/managers/network-manager.js +1 -0
  118. package/src/managers/server-config-manager.js +1 -0
  119. package/src/managers/session-manager.js +1 -0
  120. package/src/managers/storage-manager-factory.js +1 -0
  121. package/src/managers/storage-manager.js +1 -0
  122. package/src/managers/subscription-manager.js +1 -0
  123. package/src/models/backend-errors.js +1 -0
  124. package/src/models/braze-event.js +1 -0
  125. package/src/models/braze-sdk-metadata.js +1 -0
  126. package/src/models/device.js +1 -0
  127. package/src/models/identifier.js +1 -0
  128. package/src/models/push-token.js +1 -0
  129. package/src/models/request-result.js +1 -0
  130. package/src/models/server-config.js +1 -0
  131. package/src/request-controller.js +1 -0
  132. package/src/triggers/models/custom-event-data.js +1 -0
  133. package/src/triggers/models/custom-event-property-data.js +1 -0
  134. package/src/triggers/models/filter-set.js +1 -0
  135. package/src/triggers/models/filter.js +1 -0
  136. package/src/triggers/models/in-app-message-click-data.js +1 -0
  137. package/src/triggers/models/purchase-data.js +1 -0
  138. package/src/triggers/models/purchase-property-data.js +1 -0
  139. package/src/triggers/models/push-click-data.js +1 -0
  140. package/src/triggers/models/trigger-condition.js +1 -0
  141. package/src/triggers/models/trigger-events.js +1 -0
  142. package/src/triggers/models/trigger.js +1 -0
  143. package/src/triggers/triggers-provider-factory.js +1 -0
  144. package/src/triggers/triggers-provider.js +1 -0
  145. package/src/ui/js/attach-css.js +1 -0
  146. package/src/ui/js/feed-css.js +1 -0
  147. package/src/ui/js/iam-css.js +1 -0
  148. package/src/ui/js/index.js +1 -0
  149. package/src/ui/js/load-font-awesome.js +1 -0
  150. package/src/util/base-device-parser.js +1 -0
  151. package/src/util/braze-actions.js +1 -0
  152. package/src/util/browser-detector.js +1 -0
  153. package/src/util/client-hints-parser.js +1 -0
  154. package/src/util/code-utils.js +1 -0
  155. package/src/util/color-utils.js +1 -0
  156. package/src/util/component-utils.js +1 -0
  157. package/src/util/date-utils.js +1 -0
  158. package/src/util/deprecation-utils.js +1 -0
  159. package/src/util/device-constants.js +1 -0
  160. package/src/util/dom-utils.js +1 -0
  161. package/src/util/key-codes.js +1 -0
  162. package/src/util/math.js +1 -0
  163. package/src/util/net.js +1 -0
  164. package/src/util/string-utils.js +1 -0
  165. package/src/util/url-utils.js +1 -0
  166. package/src/util/user-agent-parser.js +1 -0
  167. package/src/util/validation-utils.js +1 -0
  168. package/src/util/window-utils.js +1 -0
  169. package/appboy.min.js +0 -278
@@ -0,0 +1 @@
1
+ import{isArray as p,isEqual as ii}from"../util/code-utils.js";import ei from"../models/push-token.js";import r from"../../shared-lib/braze-shared-lib.js";import{STORAGE_KEYS as o}from"../managers/storage-manager.js";import{User}from"../User/index.js";import{WindowUtils as P}from"../util/window-utils.js";export default class aa{constructor(i,e,t,s,n,r,o,u,a,h){this.ki=i,this.Wi=e,this.xi=t,this.Vi=s+"/safari/"+e,this.qi=n||"/service-worker.js",this.Gi=r,this.wt=o,this.Yi=u||!1,this.Ji=a||!1,this.h=h,this.Ki="serviceWorker"in navigator&&"undefined"!=typeof ServiceWorkerRegistration&&"showNotification"in ServiceWorkerRegistration.prototype&&"PushManager"in window,this.Qi="safari"in window&&"pushNotification"in window.safari&&"function"==typeof window.safari.pushNotification.permission&&"function"==typeof window.safari.pushNotification.requestPermission}Xi(){return this.Ji}isPushSupported(){return this.Ki||this.Qi}isPushBlocked(){const i=this.isPushSupported()&&"Notification"in window&&null!=window.Notification&&null!=window.Notification.permission&&"denied"===window.Notification.permission,e=this.isPushSupported()&&(!("Notification"in window)||null==window.Notification);return i||e}isPushPermissionGranted(){return this.isPushSupported()&&"Notification"in window&&null!=window.Notification&&null!=window.Notification.permission&&"granted"===window.Notification.permission}Zi(i,e,t,s,n){i.unsubscribe().then((i=>{i?this.$i(e,t,s,n):(r.D.error("Failed to unsubscribe device from push."),"function"==typeof n&&n(!1))})).catch((i=>{r.D.error("Push unsubscription error: "+i),"function"==typeof n&&n(!1)}))}hn(i,e,t){const s=(i=>{if("string"==typeof i)return i;if(0!==i.endpoint.indexOf("https://android.googleapis.com/gcm/send"))return i.endpoint;let e=i.endpoint;return i.dn&&-1===i.endpoint.indexOf(i.dn)&&(e=i.endpoint+"/"+i.dn),e})(i);let n=null,r=null;if(null!=i.getKey)try{n=btoa(String.fromCharCode.apply(null,new Uint8Array(i.getKey("p256dh")))),r=btoa(String.fromCharCode.apply(null,new Uint8Array(i.getKey("auth"))))}catch(i){if("invalid arguments"!==i.message)throw i}const o=(i=>{let e;return i.options&&(e=i.options.applicationServerKey)&&e.byteLength&&e.byteLength>0?btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_"):null})(i);this.ki.fn(s,t,n,r,o),s&&"function"==typeof e&&e(s,n,r)}pn(){this.ki.wn(!0)}bn(i,e){this.ki.wn(!1),r.D.info(i),"function"==typeof e&&e(!1)}gn(i,e,t,s){if("default"===e.permission)try{window.safari.pushNotification.requestPermission(this.Vi,i,{api_key:this.Wi,device_id:this.xi.te().id},(e=>{"granted"===e.permission&&this.ki.setPushNotificationSubscriptionType(User.NotificationSubscriptionTypes.OPTED_IN),this.gn(i,e,t,s)}))}catch(i){this.bn("Could not request permission for push: "+i,s)}else"denied"===e.permission?this.bn("The user has blocked notifications from this site, or Safari push is not configured in the Braze dashboard.",s):"granted"===e.permission&&(r.D.info("Device successfully subscribed to push."),this.hn(e.deviceToken,t,new Date))}yn(i,e,t){const s=s=>{switch(s){case"granted":return void("function"==typeof i&&i());case"default":return void("function"==typeof e&&e());case"denied":return void("function"==typeof t&&t());default:r.D.error("Received unexpected permission result "+s)}};let n=!1;const o=window.Notification.requestPermission((i=>{n&&s(i)}));o?o.then((i=>{s(i)})):n=!0}$i(i,e,t,s){const n={userVisibleOnly:!0};null!=e&&(n.applicationServerKey=e),i.pushManager.subscribe(n).then((i=>{r.D.info("Device successfully subscribed to push."),this.hn(i,t,new Date)})).catch((i=>{this.isPushBlocked()?(r.D.info("Permission for push notifications was denied."),"function"==typeof s&&s(!1)):r.D.error("Push subscription failed: "+i)}))}vn(){return this.Yi?navigator.serviceWorker.getRegistration():navigator.serviceWorker.register(this.qi).then((()=>navigator.serviceWorker.ready.then((i=>(i&&"function"==typeof i.update&&i.update().catch((i=>{r.D.info("ServiceWorker update failed: "+i)})),i)))))}kn(i){this.Yi||(i.unregister(),r.D.info("Service worker successfully unregistered."))}subscribe(i,e){if(this.isPushSupported()){if(this.Ki){if(!this.Yi&&null!=window.location){let i=this.qi;-1===i.indexOf(window.location.host)&&(i=window.location.host+i),-1===i.indexOf(window.location.protocol)&&(i=window.location.protocol+"//"+i);const e=i.substr(0,i.lastIndexOf("/")+1);if(0!==P.Pn().indexOf(e))return void r.D.error("Cannot subscribe to push from a path higher than the service worker location (tried to subscribe from "+window.location.pathname+" but service worker is at "+i+")")}if(this.isPushBlocked())return void this.bn("Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.",e);if(this.wt&&!this.wt.Sn()&&0===this.wt.Gs())return r.D.info("Waiting for VAPID key from server config before subscribing to push."),void this.wt.Dn((()=>{this.subscribe(i,e)}));const t=()=>{r.D.info("Permission for push notifications was denied."),"function"==typeof e&&e(!1)},s=()=>{let i="Permission for push notifications was ignored.";this.isPushBlocked()&&(i+=" The browser has automatically blocked further permission requests for a period (probably 1 week)."),r.D.info(i),"function"==typeof e&&e(!0)},n=this.isPushPermissionGranted(),u=()=>{n||this.ki.setPushNotificationSubscriptionType(User.NotificationSubscriptionTypes.OPTED_IN),this.vn().then((t=>{if(null==t)return r.D.error("No service worker registration. Set the `manageServiceWorkerExternally` initialization option to false or ensure that your service worker is registered before calling registerPush."),void("function"==typeof e&&e());t.pushManager.getSubscription().then((s=>{let n=null;if(this.wt&&null!=this.wt.Sn()&&(n=r.Nn._n(this.wt.Sn())),s){let u=null,a=null;const h=this.h.I(o.q.Wn);if(h&&!p(h)){let i;try{i=ei.jn(h).An}catch(e){i=null}null==i||isNaN(i.getTime())||0===i.getTime()||(u=i,a=new Date(u),a.setMonth(u.getMonth()+6))}null!=n&&s.options&&s.options.applicationServerKey&&s.options.applicationServerKey.byteLength&&s.options.applicationServerKey.byteLength>0&&!ii(n,new Uint8Array(s.options.applicationServerKey))?(s.options.applicationServerKey.byteLength>12?r.D.info("Device was already subscribed to push using a different VAPID provider, creating new subscription."):r.D.info("Attempting to upgrade a gcm_sender_id-based push registration to VAPID - depending on the browser this may or may not result in the same gcm_sender_id-based subscription."),this.Zi(s,t,n,i,e)):s.expirationTime&&new Date(s.expirationTime)<=(new Date).valueOf()?(r.D.info("Push subscription is expired, creating new subscription."),this.Zi(s,t,n,i,e)):h&&p(h)?this.Zi(s,t,n,i,e):null==a?(r.D.info("No push subscription creation date found, creating new subscription."),this.Zi(s,t,n,i,e)):a<=(new Date).valueOf()?(r.D.info("Push subscription older than 6 months, creating new subscription."),this.Zi(s,t,n,i,e)):(r.D.info("Device already subscribed to push, sending existing subscription to backend."),this.hn(s,i,u))}else this.$i(t,n,i,e)})).catch((i=>{r.D.error("Error checking current push subscriptions: "+i)}))})).catch((i=>{r.D.error("ServiceWorker registration failed: "+i)}))};this.yn(u,s,t)}else if(this.Qi){if(null==this.Gi||""===this.Gi)return void r.D.error("You must supply the safariWebsitePushId initialization option in order to use registerPush on Safari");const t=window.safari.pushNotification.permission(this.Gi);this.gn(this.Gi,t,i,e)}}else r.D.info(this.Un)}unsubscribe(i,e){this.isPushSupported()?this.Ki?navigator.serviceWorker.getRegistration().then((t=>{t&&t.pushManager.getSubscription().then((s=>{s&&(this.pn(),s.unsubscribe().then((s=>{s?(r.D.info("Device successfully unsubscribed from push."),"function"==typeof i&&i()):(r.D.error("Failed to unsubscribe device from push."),"function"==typeof e&&e()),this.kn(t)})).catch((i=>{r.D.error("Push unsubscription error: "+i),"function"==typeof e&&e()})))})).catch((i=>{r.D.error("Error unsubscribing from push: "+i),"function"==typeof e&&e()}))})):this.Qi&&(this.pn(),r.D.info("Device unsubscribed from push."),"function"==typeof i&&i()):r.D.info(this.Un)}}aa.Un="Push notifications are not supported in this browser.";
@@ -0,0 +1 @@
1
+ import e from"../managers/braze-instance.js";import or from"./push-manager-factory.js";export function requestPushPermission(r,n){if(e.rr())return or.Br().subscribe(((n,o,t)=>{e.pr().requestImmediateDataFlush(),"function"==typeof r&&r(n,o,t)}),n)}
@@ -0,0 +1 @@
1
+ import e from"../managers/braze-instance.js";import or from"./push-manager-factory.js";export function unregisterPush(r,n){if(e.rr())return or.Br().unsubscribe(r,n)}
@@ -0,0 +1 @@
1
+ export{default as User}from"./user.js";
@@ -0,0 +1 @@
1
+ import mt from"../models/identifier.js";import{getByteLength as U}from"../util/string-utils.js";import ei from"../models/push-token.js";import r from"../../shared-lib/braze-shared-lib.js";import{STORAGE_KEYS as o}from"../managers/storage-manager.js";import{User}from"../User/index.js";export default class pt{constructor(t,s){this.wt=t,this.h=s}getUserId(){const t=this.h._r(o.Cr.Ur);if(null==t)return null;let s=t.Ir,i=U(s);if(i>User.ee){for(;i>User.ee;)s=s.slice(0,s.length-1),i=U(s);t.Ir=s,this.h.Lr(o.Cr.Ur,t)}return s}Er(t){const s=null==this.getUserId();this.h.Lr(o.Cr.Ur,new mt(t)),s&&this.h.Gr(t)}setCustomUserAttribute(t,s){if(this.wt.Hr(t))return r.D.info('Custom Attribute "'+t+'" is blocklisted, ignoring.'),!1;const i={};return i[t]=s,this.Jr(User.Kr,i,!0)}Jr(t,s,i,e){const u=this.h.Mr(this.getUserId(),t,s);return!e&&u&&r.D.info(`Logged${i?" custom":""} attribute ${t} with value ${s}`),u}fn(t,s,i,e,u){this.Jr("push_token",t,!1,!0),this.Jr("custom_push_public_key",i,!1,!0),this.Jr("custom_push_user_auth",e,!1,!0),this.Jr("custom_push_vapid_public_key",u,!1,!0);const h=r.Ft.xt,n=new r.qt(h,r.D),l=new ei(t,s,i,e,u);this.h.B(o.q.Wn,l.ss()),n.setItem(h.Pt.Nr,h.se,!0)}wn(t){if(this.Jr("push_token",null,!1,!0),this.Jr("custom_push_public_key",null,!1,!0),this.Jr("custom_push_user_auth",null,!1,!0),this.Jr("custom_push_vapid_public_key",null,!1,!0),t){const t=r.Ft.xt,s=new r.qt(t,r.D);this.h.B(o.q.Wn,!1),s.setItem(t.Pt.Nr,t.se,!1)}}}
@@ -0,0 +1 @@
1
+ import{isArray as p,isDate as bt,validateValueIsFromEnum as B}from"../util/code-utils.js";import r from"../../shared-lib/braze-shared-lib.js";import{toValidBackendTimeString as gt}from"../util/date-utils.js";import{isValidEmail as yt,validateCustomString as W,validateStandardString as R}from"../util/validation-utils.js";export default class User{constructor(t,e){this.v=t,this.Is=e}getUserId(t){null==t&&r.D.error("getUserId must be supplied with a callback. e.g., braze.getUser().getUserId(function(userId) {console.log('the user id is ' + userId)})"),"function"==typeof t&&t(this.v.getUserId())}addAlias(t,e){return!R(t,"add alias","the alias",!1)||t.length<=0?(r.D.error("addAlias requires a non-empty alias"),!1):!R(e,"add alias","the label",!1)||e.length<=0?(r.D.error("addAlias requires a non-empty label"),!1):this.Is.Sr(t,e).S}setFirstName(t){return!!R(t,"set first name","the firstName",!0)&&this.v.Jr("first_name",t)}setLastName(t){return!!R(t,"set last name","the lastName",!0)&&this.v.Jr("last_name",t)}setEmail(t){return null===t||yt(t)?this.v.Jr("email",t):(r.D.error(`Cannot set email address - "${t}" did not pass RFC-5322 validation.`),!1)}setGender(t){return"string"==typeof t&&(t=t.toLowerCase()),!(null!==t&&!B(User.Genders,t,`Gender "${t}" is not a valid gender.`,"User.Genders"))&&this.v.Jr("gender",t)}setDateOfBirth(t,e,s){return null===t&&null===e&&null===s?this.v.Jr("dob",null):(t=parseInt(t),e=parseInt(e),s=parseInt(s),isNaN(t)||isNaN(e)||isNaN(s)||e>12||e<1||s>31||s<1?(r.D.error("Cannot set date of birth - parameters should comprise a valid date e.g. setDateOfBirth(1776, 7, 4);"),!1):this.v.Jr("dob",`${t}-${e}-${s}`))}setCountry(t){return!!R(t,"set country","the country",!0)&&this.v.Jr("country",t)}setHomeCity(t){return!!R(t,"set home city","the homeCity",!0)&&this.v.Jr("home_city",t)}setLanguage(t){return!!R(t,"set language","the language",!0)&&this.v.Jr("language",t)}setEmailNotificationSubscriptionType(t){return!!B(User.NotificationSubscriptionTypes,t,`Email notification setting "${t}" is not a valid subscription type.`,"User.NotificationSubscriptionTypes")&&this.v.Jr("email_subscribe",t)}setPushNotificationSubscriptionType(t){return!!B(User.NotificationSubscriptionTypes,t,`Push notification setting "${t}" is not a valid subscription type.`,"User.NotificationSubscriptionTypes")&&this.v.Jr("push_subscribe",t)}setPhoneNumber(t){return!!R(t,"set phone number","the phoneNumber",!0)&&(null===t||t.match(User.Or)?this.v.Jr("phone",t):(r.D.error(`Cannot set phone number - "${t}" did not pass validation.`),!1))}setLastKnownLocation(t,e,s,i,n){return null==t||null==e?(r.D.error("Cannot set last-known location - latitude and longitude are required."),!1):(t=parseFloat(t),e=parseFloat(e),null!=s&&(s=parseFloat(s)),null!=i&&(i=parseFloat(i)),null!=n&&(n=parseFloat(n)),isNaN(t)||isNaN(e)||null!=s&&isNaN(s)||null!=i&&isNaN(i)||null!=n&&isNaN(n)?(r.D.error("Cannot set last-known location - all supplied parameters must be numeric."),!1):t>90||t<-90||e>180||e<-180?(r.D.error("Cannot set last-known location - latitude and longitude are bounded by ±90 and ±180 respectively."),!1):null!=s&&s<0||null!=n&&n<0?(r.D.error("Cannot set last-known location - accuracy and altitudeAccuracy may not be negative."),!1):this.Is.setLastKnownLocation(this.v.getUserId(),t,e,i,s,n).S)}setCustomUserAttribute(t,e){if(!W(t,"set custom user attribute","the given key"))return!1;const s=typeof e,i=bt(e),n=p(e);if("number"!==s&&"boolean"!==s&&!i&&!n&&null!==e&&!W(e,`set custom user attribute "${t}"`,"the given value"))return!1;if(i&&(e=gt(e)),n){for(let s=0;s<e.length;s++){const r=e[s];if(!W(r,`set custom user attribute "${t}"`,"the element in the given array"))return!1}return this.Is.Vr(r.A.Wr,t,e).S}return this.v.setCustomUserAttribute(t,e)}addToCustomAttributeArray(t,e){return!!W(t,"add to custom user attribute array","the given key")&&(!(null!=e&&!W(e,"add to custom user attribute array","the given value"))&&this.Is.Vr(r.A.Yr,t,e).S)}removeFromCustomAttributeArray(t,e){return!!W(t,"remove from custom user attribute array","the given key")&&(!(null!=e&&!W(e,"remove from custom user attribute array","the given value"))&&this.Is.Vr(r.A.Qr,t,e).S)}incrementCustomUserAttribute(t,e){if(!W(t,"increment custom user attribute","the given key"))return!1;null==e&&(e=1);const s=parseInt(e);return isNaN(s)||s!==parseFloat(e)?(r.D.error(`Cannot increment custom user attribute because the given incrementValue "${e}" is not an integer.`),!1):this.Is.Vr(r.A.Xr,t,s).S}setCustomLocationAttribute(t,e,s){return!!W(t,"set custom location attribute","the given key")&&((null!==e||null!==s)&&(e=parseFloat(e),s=parseFloat(s),isNaN(e)||e>90||e<-90||isNaN(s)||s>180||s<-180)?(r.D.error("Received invalid values for latitude and/or longitude. Latitude and longitude are bounded by ±90 and ±180 respectively, or must both be null for removal."),!1):this.Is.Zr(t,e,s).S)}addToSubscriptionGroup(t){return!R(t,"add user to subscription group","subscription group ID",!1)||t.length<=0?(r.D.error("addToSubscriptionGroup requires a non-empty subscription group ID"),!1):this.Is.Cn(t,User.In.SUBSCRIBED).S}removeFromSubscriptionGroup(t){return!R(t,"remove user from subscription group","subscription group ID",!1)||t.length<=0?(r.D.error("removeFromSubscriptionGroup requires a non-empty subscription group ID"),!1):this.Is.Cn(t,User.In.UNSUBSCRIBED).S}fn(t,e,s,r,i){this.v.fn(t,e,s,r,i),this.Is.En()}wn(t){this.v.wn(t)}}User.Or=/^[0-9 .\\(\\)\\+\\-]+$/,User.Genders={MALE:"m",FEMALE:"f",OTHER:"o",UNKNOWN:"u",NOT_APPLICABLE:"n",PREFER_NOT_TO_SAY:"p"},User.NotificationSubscriptionTypes={OPTED_IN:"opted_in",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed"},User.In={SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed"},User.Fn="user_id",User.Kr="custom",User.ee=997;
@@ -0,0 +1 @@
1
+ import{ControlCard}from"../Card/index.js";export const FEED_ANIMATION_DURATION=500;export default class x{constructor(e,r){this.cards=e,this.lastUpdated=r}getUnreadCardCount(){let e=0;for(const r of this.cards)r.viewed||r instanceof ControlCard||e++;return e}dr(){throw new Error("Must be implemented in a subclass")}logCardImpressions(){throw new Error("Must be implemented in subclass")}logCardClick(){throw new Error("Must be implemented in subclass")}sr(){throw new Error("Must be implemented in subclass")}}x.ur=6e4,x.Ni=500,x.ro=1e4;
@@ -0,0 +1 @@
1
+ export default class C{constructor(){}_s(){}changeUser(a){}clearData(){}}
@@ -0,0 +1 @@
1
+ export const MAX_PURCHASE_QUANTITY=100;export const MUST_BE_IN_APP_MESSAGE_WARNING="inAppMessage must be an InAppMessage object";export const MUST_BE_CARD_WARNING_SUFFIX="must be a Card object";export const FEED_ANIMATION_DURATION=500;
@@ -0,0 +1 @@
1
+ import r from"../../shared-lib/braze-shared-lib.js";import e from"../managers/braze-instance.js";import ue from"../models/braze-event.js";import t from"../models/request-result.js";const s={G:(o,n,s)=>{const a=new t,i=e.g();if(!i)return r.D.info(`Not logging event with type "${o}" because the current session ID could not be found.`),a;const m=i.no();return a.ve.push(new ue(s||e.p().getUserId(),o,(new Date).valueOf(),m,n)),a.S=e.l().so(a.ve),a}};export default s;
@@ -0,0 +1 @@
1
+ import x from"./base-feed.js";import{bottomHadImpression as de,getCardId as fe,impressOnBottom as pe,impressOnTop as be,markCardAsRead as ye,topHadImpression as Fe}from"../Card/display/card-display.js";import{bottomIsInView as Te,topIsInView as he}from"../util/dom-utils.js";import{Card,ControlCard}from"../Card/index.js";import{cardToHtml as _e}from"../Card/display/card-display.js";import{isArray as p}from"../util/code-utils.js";import{KeyCodes as at}from"../util/key-codes.js";import xe from"../l10n/l10n-manager-factory.js";import{removeSubscription}from"../Core/remove-subscription.js";import r from"../../shared-lib/braze-shared-lib.js";export const LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE="data-last-requested-refresh";export const _SUBSCRIPTION_ID_DATA_ATTRIBUTE="data-update-subscription-id";export function destroyFeedHtml(e){e&&(e.className=e.className.replace("ab-show","ab-hide"),setTimeout((()=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),x.Ni));const t=e.getAttribute("data-update-subscription-id");null!=t&&removeSubscription(t)}export function _generateFeedBody(e,t){const o=document.createElement("div");if(o.className="ab-feed-body",o.setAttribute("aria-label","Feed"),o.setAttribute("role","feed"),null==e.lastUpdated){const e=document.createElement("div");e.className="ab-no-cards-message";const t=document.createElement("i");t.className="fa fa-spinner fa-spin fa-4x ab-initial-spinner",e.appendChild(t),o.appendChild(e)}else{let s=!1;const logCardClick=t=>{e.logCardClick(t)};for(const n of e.cards){const a=n instanceof ControlCard;!a||e.dr()?(o.appendChild(_e(n,logCardClick,t)),s=s||!a):r.D.error("Received a control card for a legacy news feed. Control cards are only supported with content cards.")}if(!s){const e=document.createElement("div");e.className="ab-no-cards-message",e.innerHTML=xe.m().get("NO_CARDS_MESSAGE"),e.setAttribute("role","article"),o.appendChild(e)}}return o}export function detectFeedImpressions(e,t){if(null!=t){const o=[],r=t.querySelectorAll(".ab-card");e.ao||(e.ao={});for(let t=0;t<r.length;t++){const s=fe(r[t]);if(e.ao[s])continue;let n=Fe(r[t]),a=de(r[t]);const i=n,d=a,c=he(r[t]),f=Te(r[t]);if(!n&&c&&(n=!0,be(r[t])),!a&&f&&(a=!0,pe(r[t])),n&&a){if(c||f||ye(r[t]),i&&d)continue;for(const t of e.cards)if(t.id===s){e.ao[t.id]=!0,o.push(t);break}}}o.length>0&&e.logCardImpressions(o)}}export function refreshFeed(e,t){t.setAttribute("aria-busy","true");const o=t.querySelectorAll(".ab-refresh-button")[0];null!=o&&(o.className+=" fa-spin");const r=(new Date).valueOf().toString();t.setAttribute("data-last-requested-refresh",r),setTimeout((()=>{if(t.getAttribute("data-last-requested-refresh")===r){const e=t.querySelectorAll(".fa-spin");for(let t=0;t<e.length;t++)e[t].className=e[t].className.replace(/fa-spin/g,"");const o=t.querySelectorAll(".ab-initial-spinner")[0];if(null!=o){const e=document.createElement("span");e.innerHTML=xe.m().get("FEED_TIMEOUT_MESSAGE"),o.parentNode.appendChild(e),o.parentNode.removeChild(o)}"true"===t.getAttribute("aria-busy")&&t.setAttribute("aria-busy","false")}}),x.ro),e.sr()}export function feedToHtml(e,t){const o=document.createElement("div");o.className="ab-feed ab-hide ab-effect-slide",o.setAttribute("role","dialog"),o.setAttribute("aria-label","Feed"),o.setAttribute("tabindex","-1");const r=document.createElement("div");r.className="ab-feed-buttons-wrapper",r.setAttribute("role","group"),o.appendChild(r);const s=document.createElement("i");s.className="fa fa-times ab-close-button",s.setAttribute("aria-label","Close Feed"),s.setAttribute("tabindex","0"),s.setAttribute("role","button");const n=e=>{destroyFeedHtml(o),e.stopPropagation()};s.addEventListener("keydown",(e=>{e.keyCode!==at.io&&e.keyCode!==at.do||n(e)})),s.onclick=n;const a=document.createElement("i");a.className="fa fa-refresh ab-refresh-button",null==e.lastUpdated&&(a.className+=" fa-spin"),a.setAttribute("aria-label","Refresh Feed"),a.setAttribute("tabindex","0"),a.setAttribute("role","button");const i=t=>{refreshFeed(e,o),t.stopPropagation()};return a.addEventListener("keydown",(e=>{e.keyCode!==at.io&&e.keyCode!==at.do||i(e)})),a.onclick=i,r.appendChild(a),r.appendChild(s),o.appendChild(_generateFeedBody(e,t)),o.onscroll=()=>{detectFeedImpressions(e,o)},o}export function updateFeedCards(e,t,o,r,s){if(!p(t))return;const n=[];for(let e=0;e<t.length;e++)t[e]instanceof Card&&n.push(t[e]);if(e.cards=n,e.lastUpdated=o,null!=r)if(r.setAttribute("aria-busy","false"),null==e.lastUpdated)destroyFeedHtml(r);else{const t=r.querySelectorAll(".ab-feed-body")[0];if(null!=t){const o=_generateFeedBody(e,s);t.parentNode.replaceChild(o,t),detectFeedImpressions(e,o.parentNode)}}}export function registerFeedSubscriptionId(e,t){t.setAttribute("data-update-subscription-id",e)}
@@ -0,0 +1 @@
1
+ export default{en:{NO_CARDS_MESSAGE:"We have no updates for you at this time.<br/>Please check again later.",FEED_TIMEOUT_MESSAGE:"Sorry, this refresh timed out.<br/>Please try again later."},ar:{NO_CARDS_MESSAGE:"ليس لدينا أي تحديث. يرجى التحقق مرة أخرى لاحقاً",FEED_TIMEOUT_MESSAGE:"يرجى تكرار المحاولة لاحقا"},cs:{NO_CARDS_MESSAGE:"V tuto chvíli pro vás nemáme žádné aktualizace.<br/>Zkontrolujte prosím znovu později.",FEED_TIMEOUT_MESSAGE:"Prosím zkuste to znovu později."},da:{NO_CARDS_MESSAGE:"Vi har ingen updates.<br/>Prøv venligst senere.",FEED_TIMEOUT_MESSAGE:"Prøv venligst senere."},de:{NO_CARDS_MESSAGE:"Derzeit sind keine Updates verfügbar.<br/>Bitte später noch einmal versuchen.",FEED_TIMEOUT_MESSAGE:"Bitte später noch einmal versuchen."},es:{NO_CARDS_MESSAGE:"No tenemos actualizaciones.<br/>Por favor compruébelo más tarde.",FEED_TIMEOUT_MESSAGE:"Por favor inténtelo más tarde."},"es-mx":{NO_CARDS_MESSAGE:"No tenemos ninguna actualización.<br/>Vuelva a verificar más tarde.",FEED_TIMEOUT_MESSAGE:"Por favor, vuelva a intentarlo más tarde."},et:{NO_CARDS_MESSAGE:"Uuendusi pole praegu saadaval.<br/>Proovige hiljem uuesti.",FEED_TIMEOUT_MESSAGE:"Palun proovige hiljem uuesti."},fi:{NO_CARDS_MESSAGE:"Päivityksiä ei ole saatavilla.<br/>Tarkista myöhemmin uudelleen.",FEED_TIMEOUT_MESSAGE:"Yritä myöhemmin uudelleen."},fr:{NO_CARDS_MESSAGE:"Aucune mise à jour disponible.<br/>Veuillez vérifier ultérieurement.",FEED_TIMEOUT_MESSAGE:"Veuillez réessayer ultérieurement."},he:{NO_CARDS_MESSAGE:".אין לנו עדכונים. בבקשה בדוק שוב בקרוב",FEED_TIMEOUT_MESSAGE:".בבקשה נסה שוב בקרוב"},hi:{NO_CARDS_MESSAGE:"हमारे पास कोई अपडेट नहीं हैं। कृपया बाद में फिर से जाँच करें.।",FEED_TIMEOUT_MESSAGE:"कृपया बाद में दोबारा प्रयास करें।."},id:{NO_CARDS_MESSAGE:"Kami tidak memiliki pembaruan. Coba lagi nanti.",FEED_TIMEOUT_MESSAGE:"Coba lagi nanti."},it:{NO_CARDS_MESSAGE:"Non ci sono aggiornamenti.<br/>Ricontrollare più tardi.",FEED_TIMEOUT_MESSAGE:"Riprovare più tardi."},ja:{NO_CARDS_MESSAGE:"アップデートはありません。<br/>後でもう一度確認してください。",FEED_TIMEOUT_MESSAGE:"後でもう一度試してください。"},ko:{NO_CARDS_MESSAGE:"업데이트가 없습니다. 다음에 다시 확인해 주십시오.",FEED_TIMEOUT_MESSAGE:"나중에 다시 시도해 주십시오."},ms:{NO_CARDS_MESSAGE:"Tiada kemas kini. Sila periksa kemudian.",FEED_TIMEOUT_MESSAGE:"Sila cuba kemudian."},nl:{NO_CARDS_MESSAGE:"Er zijn geen updates.<br/>Probeer het later opnieuw.",FEED_TIMEOUT_MESSAGE:"Probeer het later opnieuw."},no:{NO_CARDS_MESSAGE:"Vi har ingen oppdateringer.<br/>Vennligst sjekk igjen senere.",FEED_TIMEOUT_MESSAGE:"Vennligst prøv igjen senere."},pl:{NO_CARDS_MESSAGE:"Brak aktualizacji.<br/>Proszę sprawdzić ponownie później.",FEED_TIMEOUT_MESSAGE:"Proszę spróbować ponownie później."},pt:{NO_CARDS_MESSAGE:"Não temos atualizações.<br/>Por favor, verifique mais tarde.",FEED_TIMEOUT_MESSAGE:"Por favor, tente mais tarde."},"pt-br":{NO_CARDS_MESSAGE:"Não temos nenhuma atualização.<br/>Verifique novamente mais tarde.",FEED_TIMEOUT_MESSAGE:"Tente novamente mais tarde."},ru:{NO_CARDS_MESSAGE:"Обновления недоступны.<br/>Пожалуйста, проверьте снова позже.",FEED_TIMEOUT_MESSAGE:"Пожалуйста, повторите попытку позже."},sv:{NO_CARDS_MESSAGE:"Det finns inga uppdateringar.<br/>Försök igen senare.",FEED_TIMEOUT_MESSAGE:"Försök igen senare."},th:{NO_CARDS_MESSAGE:"เราไม่มีการอัพเดต กรุณาตรวจสอบภายหลัง.",FEED_TIMEOUT_MESSAGE:"กรุณาลองใหม่ภายหลัง."},uk:{NO_CARDS_MESSAGE:"Оновлення недоступні.<br/>ласка, перевірте знову пізніше.",FEED_TIMEOUT_MESSAGE:"Будь ласка, спробуйте ще раз пізніше."},vi:{NO_CARDS_MESSAGE:"Chúng tôi không có cập nhật nào.<br/>Vui lòng kiểm tra lại sau.",FEED_TIMEOUT_MESSAGE:"Vui lòng thử lại sau."},"zh-hk":{NO_CARDS_MESSAGE:"暫時沒有更新.<br/>請稍候再試.",FEED_TIMEOUT_MESSAGE:"請稍候再試."},"zh-hans":{NO_CARDS_MESSAGE:"暂时没有更新.<br/>请稍后再试.",FEED_TIMEOUT_MESSAGE:"请稍候再试."},"zh-hant":{NO_CARDS_MESSAGE:"暫時沒有更新.<br/>請稍候再試.",FEED_TIMEOUT_MESSAGE:"請稍候再試."},"zh-tw":{NO_CARDS_MESSAGE:"暫時沒有更新.<br/>請稍候再試.",FEED_TIMEOUT_MESSAGE:"請稍候再試."},zh:{NO_CARDS_MESSAGE:"暂时没有更新.<br/>请稍后再试.",FEED_TIMEOUT_MESSAGE:"请稍候再试."}};
package/src/index.js ADDED
@@ -0,0 +1 @@
1
+ export*from"./Card/index.js";export*from"./ContentCards/index.js";export*from"./Core/index.js";export*from"./Feed/index.js";export*from"./InAppMessage/index.js";export*from"./Push/index.js";export*from"./User/index.js";export{WindowUtils}from"./util/window-utils.js";
@@ -0,0 +1 @@
1
+ import e,{OPTIONS as D}from"../managers/braze-instance.js";import et from"../util/browser-detector.js";import er from"./l10n-manager.js";const xe={t:!1,i:null,m:()=>{if(xe.o(),!xe.i){let r=et.language,t=!1;e.nn(D.zn)&&(r=e.nn(D.zn),t=!0),xe.i=new er(r,t)}return xe.i},o:()=>{xe.t||(e.u(xe),xe.t=!0)},destroy:()=>{xe.i=null,xe.t=!1}};export default xe;
@@ -0,0 +1 @@
1
+ import r from"../../shared-lib/braze-shared-lib.js";import ft from"../common/translations.js";export default class er{constructor(t,l){if(null!=t&&(t=t.toLowerCase()),null!=t&&null==ft[t]){const l=t.indexOf("-");l>0&&(t=t.substring(0,l))}if(null==ft[t]){const a="Braze does not yet have a localization for language "+t+", defaulting to English. Please contact us if you are willing and able to help us translate our SDK into this language.";l?r.D.error(a):r.D.info(a),t="en"}this.language=t}get(t){return ft[this.language][t]}}
@@ -0,0 +1 @@
1
+ import{STORAGE_KEYS as o}from"./storage-manager.js";import u from"./subscription-manager.js";import r from"../../shared-lib/braze-shared-lib.js";export default class St{constructor(t,i,s){this.h=t,this.xn=i||!1,this.Tn=s,this.qn=new u,this.Bn=0,this.Gn=1}Hn(){return this.xn}Jn(){return this.h.I(o.q.Kn)}setSdkAuthenticationSignature(t){const i=this.Jn();this.h.B(o.q.Kn,t);const s=r.Ft.xt;new r.qt(s,r.D).setItem(s.Pt.Ln,this.Gn,t),i!==t&&this.Es()}Mn(){this.h.$s(o.q.Kn);const t=r.Ft.xt;new r.qt(t,r.D).gr(t.Pt.Ln,this.Gn)}subscribeToSdkAuthenticationFailures(t){return this.Tn.Et(t)}On(t){this.Tn.Nt(t)}Qn(){this.qn.removeAllSubscriptions()}Rn(){this.Bn+=1}Vn(){return this.Bn}Es(){this.Bn=0}}
@@ -0,0 +1 @@
1
+ import St from"./auth-manager.js";import C from"../common/base-provider.js";import et from"../util/browser-detector.js";import _t from"./device-manager.js";import DeviceProperties from"../Core/device-properties.js";import{isArray as p,keys as X,validateValueIsFromEnum as B,values as It}from"../util/code-utils.js";import{logDeprecationWarning as At}from"../util/deprecation-utils.js";import Nt from"./network-manager.js";import wt from"../request-controller.js";import Tt from"./server-config-manager.js";import Ot from"./session-manager.js";import r from"../../shared-lib/braze-shared-lib.js";import K,{STORAGE_KEYS as o}from"./storage-manager.js";import vt from"./storage-manager-factory.js";import u from"./subscription-manager.js";import{TriggersProviderFactory as Q}from"../triggers/triggers-provider-factory.js";import pt from"../User/user-manager.js";import{User}from"../User/index.js";import{parseQueryStringKeyValues as st}from"../util/url-utils.js";import{WindowUtils as P}from"../util/window-utils.js";const D={$n:"allowCrawlerActivity",ea:"baseUrl",Yn:"noCookies",Xn:"devicePropertyAllowlist",ta:"disablePushTokenMaintenance",Zn:"enableLogging",ho:"enableSdkAuthentication",ia:"manageServiceWorkerExternally",lo:"minimumIntervalBetweenTriggerActionsInSeconds",uo:"sessionTimeoutInSeconds",po:"appVersion",na:"serviceWorkerLocation",ra:"safariWebsitePushId",zn:"localization",yi:"contentSecurityNonce",co:"enableHtmlInAppMessages",mo:"allowUserSuppliedJavascript",vi:"inAppMessageZIndex",zi:"openInAppMessagesInNewTab",tn:"openCardsInNewTab",en:"openNewsFeedCardsInNewTab",Oi:"requireExplicitInAppMessageDismissal",Eo:"doNotLoadFontAwesome",_o:"sdkFlavor"};class Ct{constructor(){this.fo=!1,this.Io=!1,this.Ao=new u,this.So=new u,this.No={},this.wo=[],this.To=[],this.De=[],this.Oo="4.0.1"}vo(t){this.Ao.Et(t)}Mi(t){this.So.Et(t)}initialize(t,i){if(this.bo())return r.D.info("Braze has already been initialized with an API key."),!0;this.No=i||{};let s=this.nn(D.Zn);const e=st(P.Pn());if(e&&"true"===e.brazeLogging&&(s=!0),r.D.init(s),r.D.info(`Initialization Options: ${JSON.stringify(this.No,null,2)}`),null==t||""===t||"string"!=typeof t)return r.D.error("Braze requires a valid API key to be initialized."),!1;this.Wi=t;let n=this.nn(D.ea);if(null==n||""===n||"string"!=typeof n)return r.D.error("Braze requires a valid baseUrl to be initialized."),!1;if(n=n.replace(/(\.[a-z]+)[^\.]*$/i,"$1/api/v3"),0!==n.indexOf("http")&&(n="https://"+n),this.Co=n,et.Lo&&!this.nn(D.$n))return r.D.info("Ignoring activity from crawler bot "+navigator.userAgent),this.Io=!0,!1;const a=this.nn(Ct.Yn)||!1;if(this.h=vt.Po(t,a),new K.ne(null,!0).wr(o.ae))return r.D.info("Ignoring all activity due to previous opt out"),this.Io=!0,!1;for(const t of X(this.No))-1===It(r.Ro).indexOf(t)&&r.D.warn(`Ignoring unknown initialization option '${t}'.`);const h=["mparticle","wordpress","tealium"];if(null!=this.nn(D._o)){const t=this.nn(D._o);-1!==h.indexOf(t)?this.Mo=t:r.D.error("Invalid sdk flavor passed: "+t)}let l=this.nn(r.Ro.Xn);if(null!=l)if(p(l)){const t=[];for(let i=0;i<l.length;i++)B(DeviceProperties,l[i],"devicePropertyAllowlist contained an invalid value.","DeviceProperties")&&t.push(l[i]);l=t}else r.D.error("devicePropertyAllowlist must be an array. Defaulting to all properties."),l=null;this.xi=new _t(this.h,l),this.wt=new Tt(this.h),this.v=new pt(this.wt,this.h),this.j=new Ot(this.h,this.v,this.wt,this.nn(D.uo));const c=new u;return this.yo=new St(this.h,this.nn(D.ho),c),this.Ut(c),this.jt=new Nt(this.xi,this.h,this.yo,this.v,this.j,this.wt,this.Wi,this.Co,this.Oo,this.Mo,this.nn(D.po)),this.Is=new wt(this.Wi,this.Co,this.j,this.xi,this.v,this.wt,this.h,(t=>{if(this.bo())for(const i of this.re())i._s(t)}),this.yo,this.jt),this.Is.initialize(),r.D.info(`Initialized for the Braze backend at "${this.nn(D.ea)}" with API key "${this.Wi}".`),null!=this.nn(D.co)&&At("enableHtmlInAppMessages","initialization option","allowUserSuppliedJavascript"),Q.init(),this.Ao.Nt(this.No),this.fo=!0,!0}destroy(t){if(r.D.destroy(),this.bo()){this.So.Nt(),this.So.removeAllSubscriptions();for(const t of this.wo)t.destroy();this.wo=[];for(const t of this.To)t.clearData(!1);this.To=[],this.removeAllSubscriptions(),this.De=[],this.Is.destroy(),this.Is=null,this.yo=null,this.xi=null,this.jt=null,this.wt=null,this.j=null,this.v=null,this.No={},this.Mo=void 0,this.fo=!1,this.Io=!1,t&&(this.h=null)}}rr(){if(this.Do())return!1;if(!this.bo())throw new Error("Braze must be initialized before calling methods.");return!0}aa(){return this.Wi}ti(){return this.yo}ce(){return this.xi}nr(){return this.jt}nn(t){return this.No[t]}re(){return this.To}pr(){return this.Is}ir(){return this.wt}g(){return this.j}l(){return this.h}jr(){if(this.v&&this.Is)return new User(this.v,this.Is)}p(){return this.v}tr(){return!0===this.nn(D.mo)||!0===this.nn(D.co)}u(t){let i=!1;for(const s of this.wo)s===t&&(i=!0);i||this.wo.push(t)}ar(t){let i=!1;for(const s of this.To)s.constructor===t.constructor&&(i=!0);t instanceof C&&!i&&this.To.push(t)}Ut(t){t instanceof u&&this.De.push(t)}removeAllSubscriptions(){if(this.rr())for(const t of this.De)t.removeAllSubscriptions()}removeSubscription(t){if(this.rr())for(const i of this.De)i.removeSubscription(t)}le(t){this.Io=t}bo(){return this.fo}Do(){return this.Io}}const e=new Ct;export{e as default,Ct as BrazeSdkInstance,D as OPTIONS};
@@ -0,0 +1 @@
1
+ import et from"../util/browser-detector.js";import Ie from"../models/device.js";import DeviceProperties from"../Core/device-properties.js";import mt from"../models/identifier.js";import r from"../../shared-lib/braze-shared-lib.js";import{STORAGE_KEYS as o}from"../managers/storage-manager.js";import{values as It}from"../util/code-utils.js";export default class _t{constructor(e,t){this.h=e,null==t&&(t=It(DeviceProperties)),this.jo=t}te(){let e=this.h._r(o.Cr.zo);null==e&&(e=new mt(r.nt.et()),this.h.Lr(o.Cr.zo,e));const t=new Ie(e.Ir);for(let e=0;e<this.jo.length;e++){const r=this.jo[e];switch(r){case DeviceProperties.BROWSER:t[r]=et.browser;break;case DeviceProperties.BROWSER_VERSION:t[r]=et.version;break;case DeviceProperties.OS:t[r]=this.xo();break;case DeviceProperties.RESOLUTION:t[r]=screen.width+"x"+screen.height;break;case DeviceProperties.LANGUAGE:t[r]=et.language;break;case DeviceProperties.TIME_ZONE:t[r]=this.Go(new Date);break;case DeviceProperties.USER_AGENT:t[r]=et.userAgent}}return t}xo(){if(et.Fo())return et.Fo();const e=this.h.I(o.q.Jo);return e&&e.os_version?e.os_version:et.qo()}Go(e){if("undefined"!=typeof Intl&&"function"==typeof Intl.DateTimeFormat)try{if("function"==typeof Intl.DateTimeFormat().resolvedOptions){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(null!=e&&""!==e)return e}}catch(e){r.D.info("Intl.DateTimeFormat threw an error, probably https://bugs.chromium.org/p/chromium/issues/detail?id=811403, falling back to GTM offset: "+e.message)}const t=e.getTimezoneOffset();return this.Bo(t)}Bo(e){const t=parseInt(e/60),r=parseInt(e%60);let s="GMT";return 0!==e&&(s+=e<0?"+":"-",s+=("00"+Math.abs(t)).slice(-2)+":"+("00"+Math.abs(r)).slice(-2)),s}}
@@ -0,0 +1 @@
1
+ import Rt from"../models/backend-errors.js";import{convertMsToSeconds as l,convertSecondsToMs as qt}from"../util/date-utils.js";import ue from"../models/braze-event.js";import{isArray as p,isEqual as ii}from"../util/code-utils.js";import r from"../../shared-lib/braze-shared-lib.js";import{STORAGE_KEYS as o}from"./storage-manager.js";import s from"../common/event-logger.js";export default class Nt{constructor(t,e,s,i,r,o,n,a,h,u,c){this.xi=t,this.h=e,this.yo=s,this.v=i,this.j=r,this.wt=o,this.Wi=n,this.Co=a,this.Oo=h,this.Mo=u,this.Xo=c,this.$o=["npm"]}Ls(t,e){const s=this.xi.te(),i=s.Xe(),r=this.h.I(o.q.Jo);ii(r,i)||(t.device=i),t.api_key=this.Wi,t.time=l((new Date).valueOf(),!0);const n=this.h.I(o.q.Ko)||[],a=this.h.I(o.q.Ho)||"";if(this.$o.length>0&&(!ii(n,this.$o)||a!==this.j.Uo())&&(t.sdk_metadata=this.$o),t.sdk_version=this.Oo,this.Mo&&(t.sdk_flavor=this.Mo),t.app_version=this.Xo,t.device_id=s.id,e){const e=this.v.getUserId();null!=e&&(t.user_id=e)}return t}qs(t,e,i){const o=e.auth_error,n=e.error;if(!o&&!n)return!0;if(o){let e;this.yo.Rn();const s={errorCode:o.error_code};for(const t of i)p(t)&&"X-Braze-Auth-Signature"===t[0]&&(s.signature=t[1]);t.respond_with&&t.respond_with.user_id?s.userId=t.respond_with.user_id:t.user_id&&(s.userId=t.user_id);const n=o.reason;return n?(s.reason=n,e=`due to ${n}`):e=`with error code ${o.error_code}.`,this.yo.Hn()||(e+=' Please use the "enableSdkAuthentication" initialization option to enable authentication.'),r.D.error(`SDK Authentication failed ${e}`),this.Wo(t.events,t.attributes),this.yo.On(s),!1}if(n){let i=n;switch(i){case Rt.Qo:const o="Received successful response with empty body.";return s.G(r.A.Vo,{e:o}),r.D.info(o),!1;case Rt.Yo:const n="Received successful response with invalid JSON";return s.G(r.A.Vo,{e:n+": "+e.response}),r.D.info(n),!1;case Rt.Zo:i=`The API key "${t.api_key}" is invalid for the baseUrl ${this.Co}`;break;case Rt.sa:i="Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.";break;case Rt.oa:i="No device identifier. Please contact support@braze.com"}r.D.error("Backend error: "+i)}return!1}ha(t,e,s,i){return!!(t&&0!==t.length||e&&0!==e.length||s||i)}ua(t,e,s,i){const r=t=>t||"",o=r(this.v.getUserId());let n,a,h,u=this.We(t,e);if(s.length>0){const t=[];for(const e of s)n=e.Xe(),this.yo.Hn()&&r(n.user_id)&&r(n.user_id)!==o?(a||(a=[]),a.push(n)):t.push(n);t.length>0&&(u.events=t)}if(i.length>0){const t=[];for(const e of i)this.yo.Hn()&&r(e.user_id)!==o?(h||(h=[]),h.push(e)):t.push(e);t.length>0&&(u.attributes=t)}if(this.Wo(a,h),u=this.Ls(u),u&&!this.ha(u.events,u.attributes,t,e))return null;return{requestData:u,headers:this.Ns(u)}}Wo(t,e){if(t){const e=[];for(const s of t){const t=ue.fromJson(s);t.time=qt(t.time),e.push(t)}this.h.so(e)}if(e)for(const t of e)this.h.ca(t)}Ms(t,e){let s="HTTP error ";null!=t&&(s+=t+" "),s+=e,r.D.error(s)}mr(t){return s.G(r.A.la,{n:t})}We(t,e,s){const i={};t&&(i.feed=!0),e&&(i.triggers=!0);const r=null!=s?s:this.v.getUserId();return r&&(i.user_id=r),i.config={config_time:this.wt.Gs()},{respond_with:i}}Ns(t,e){const s=[["X-Braze-Api-Key",this.Wi]];let i=!1;if(null!=t.respond_with&&t.respond_with.triggers&&(s.push(["X-Braze-TriggersRequest","true"]),i=!0),null!=t.respond_with&&t.respond_with.feed&&(s.push(["X-Braze-FeedRequest","true"]),i=!0),e&&(s.push(["X-Braze-ContentCardsRequest","true"]),i=!0),i&&s.push(["X-Braze-DataRequest","true"]),this.yo.Hn()){const t=this.yo.Jn();null!=t&&s.push(["X-Braze-Auth-Signature",t])}return s}As(t,e){const s=t.device;s&&s.os_version instanceof Promise?s.os_version.then((s=>{t.device.os_version=s,e()})):e()}Es(){this.yo.Es()}Js(){return this.Co}addSdkMetadata(t){for(const e of t)-1===this.$o.indexOf(e)&&this.$o.push(e)}}
@@ -0,0 +1 @@
1
+ import{STORAGE_KEYS as o}from"./storage-manager.js";import u from"./subscription-manager.js";import jt from"../models/server-config.js";export default class Tt{constructor(t){this.h=t,this.sh=new u,this.eh=new u,this.ih=null}rh(){if(null==this.ih){const t=this.h.I(o.q.nh);this.ih=null!=t?jt.jn(t):new jt}return this.ih}Gs(){return this.rh().hh}lh(t){if(null!=t&&null!=t.config){const s=t.config;if(s.time>this.rh().hh){const t=new jt(s.time,s.events_blacklist,s.attributes_blacklist,s.purchases_blacklist,s.messaging_session_timeout,s.vapid_public_key,s.content_cards);let e=!1;null!=t.oh&&this.Sn()!==t.oh&&(e=!0);let i=!1;null!=t.uh.enabled&&this.Bs()!==t.uh.enabled&&(i=!0),this.ih=t,this.h.B(o.q.nh,t.ss()),e&&this.sh.Nt(),i&&this.eh.Nt()}}}Dn(t){let s=this.sh.Et(t);return this.ah&&this.sh.removeSubscription(this.ah),this.ah=s,s}Rs(t){return this.eh.Et(t)}ge(t){return-1!==this.rh().gh.indexOf(t)}Hr(t){return-1!==this.rh().mh.indexOf(t)}Dr(t){return-1!==this.rh().fh.indexOf(t)}dh(){return this.rh().ph}Sn(){return this.rh().oh}Bs(){return this.rh().uh.enabled||!1}}
@@ -0,0 +1 @@
1
+ import{STORAGE_KEYS as o}from"../managers/storage-manager.js";import ue from"../models/braze-event.js";import mt from"../models/identifier.js";import{convertMsToSeconds as l}from"../util/date-utils.js";import r from"../../shared-lib/braze-shared-lib.js";export default class Ot{constructor(s,t,e,i){this.h=s,this.v=t,this.wt=e,this.wh=1e3,i=parseFloat(i),isNaN(i)&&(i=1800),i<this.wh/1e3&&(r.D.info("Specified session timeout of "+i+"s is too small, using the minimum session timeout of "+this.wh/1e3+"s instead."),i=this.wh/1e3),this.Sh=i}jh(s,t){return new ue(this.v.getUserId(),r.A.bh,s,t.Ir,{d:l(s-t.xh)})}Uo(){const s=this.h._r(o.Cr.Dh);return null==s?null:s.Ir}Eh(){const s=(new Date).valueOf(),t=this.wt.dh(),e=this.h.I(o.q.Ch);if(null!=e&&null==t)return!1;const i=null==e||s-e>1e3*t;return i&&this.h.B(o.q.Ch,s),i}Gh(s,t){return null==t||!(s-t.xh<this.wh)&&t.Nh<s}no(){const s=(new Date).valueOf(),t=s+1e3*this.Sh,e=this.h._r(o.Cr.Dh);if(this.Gh(s,e)){let i="Generating session start event with time "+s;if(null!=e){let s=e._h;s-e.xh<this.wh&&(s=e.xh+this.Fh),this.h.Hh(this.jh(s,e)),i+=" (old session ended "+s+")"}i+=". Will expire "+t.valueOf(),r.D.info(i);const n=new mt(r.nt.et(),t);this.h.Hh(new ue(this.v.getUserId(),r.A.Wh,s,n.Ir)),this.h.Lr(o.Cr.Dh,n);return null==this.h.I(o.q.Ch)&&this.h.B(o.q.Ch,s),n.Ir}return e._h=s,e.Nh=t,this.h.Lr(o.Cr.Dh,e),e.Ir}kh(){const s=this.h._r(o.Cr.Dh);null!=s&&(this.h.qh(o.Cr.Dh),this.h.Hh(this.jh((new Date).valueOf(),s)))}}
@@ -0,0 +1 @@
1
+ import K,{STORAGE_KEYS as o}from"./storage-manager.js";import r from"../../shared-lib/braze-shared-lib.js";const vt={Po:(e,t)=>{let a=!1;try{if(localStorage&&localStorage.getItem)try{localStorage.setItem(o.q.ga,!0),localStorage.getItem(o.q.ga)&&(localStorage.removeItem(o.q.ga),a=!0)}catch(e){if("QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||!(localStorage.length>0))throw e;a=!0}}catch(e){r.D.info("Local Storage not supported!")}const l=vt.ma(),c=new K.Sa(e,l&&!t,a);let n=null;return n=a?new K.Ea(e):new K.fa,new K(c,n)},ma:()=>navigator.cookieEnabled||"cookie"in document&&(document.cookie.length>0||(document.cookie="test").indexOf.call(document.cookie,"test")>-1)};export default vt;
@@ -0,0 +1 @@
1
+ import et from"../util/browser-detector.js";import ue from"../models/braze-event.js";import mt from"../models/identifier.js";import{isArray as p,keys as X,validateValueIsFromEnum as B,values as It}from"../util/code-utils.js";import r from"../../shared-lib/braze-shared-lib.js";import{User}from"../User/index.js";export const STORAGE_KEYS={Cr:{Ur:"ab.storage.userId",zo:"ab.storage.deviceId",Dh:"ab.storage.sessionId"},q:{ga:"ab.test",_a:"ab.storage.events",Ta:"ab.storage.attributes",Aa:"ab.storage.attributes.anonymous_user",Jo:"ab.storage.device",Ko:"ab.storage.sdk_metadata",Ho:"ab.storage.session_id_for_cached_metadata",Wn:"ab.storage.pushToken",Ks:"ab.storage.newsFeed",Qs:"ab.storage.lastNewsFeedRefresh",P:"ab.storage.cardImpressions",nh:"ab.storage.serverConfig",Oa:"ab.storage.triggers",Ra:"ab.storage.triggers.ts",Ch:"ab.storage.messagingSessionStart",Wt:"ab.storage.cc",Cs:"ab.storage.ccLastFullSync",ws:"ab.storage.ccLastCardUpdated",$:"ab.storage.ccClicks",O:"ab.storage.ccImpressions",K:"ab.storage.ccDismissals",ba:"ab.storage.lastDisplayedTriggerTimesById",Ia:"ab.storage.lastDisplayedTriggerTime",Ka:"ab.storage.triggerFireInstancesById",Kn:"ab.storage.signature"},ae:"ab.optOut"};export default class K{constructor(t,e){this.Ya=t,this.Da=e}Lr(t,e){let s=e;null!=e&&e instanceof mt&&(s=e.ss()),this.Ya.store(t,s)}Ga(t){const e=this._r(t);null!=e&&(e._h=(new Date).valueOf(),this.Lr(t,e))}_r(t){return mt.jn(this.Ya.wr(t))}qh(t){this.Ya.remove(t)}so(t){if(null==t||0===t.length)return!1;p(t)||(t=[t]);let e=this.Da.wr(STORAGE_KEYS.q._a);null!=e&&p(e)||(e=[]);for(let s=0;s<t.length;s++)e.push(t[s].ss());return this.Da.store(STORAGE_KEYS.q._a,e)}Hh(t){return null!=t&&this.so([t])}va(){let t=this.Da.wr(STORAGE_KEYS.q._a);this.Da.remove(STORAGE_KEYS.q._a),null==t&&(t=[]);const e=[];let s=!1,o=null;if(p(t))for(let s=0;s<t.length;s++)ue.Na(t[s])?e.push(ue.jn(t[s])):o=s;else s=!0;if(s||null!=o){let n="Stored events could not be deserialized as Events";s&&(n+=", was "+Object.prototype.toString.call(t)+" not an array"),null!=o&&(n+=", value at index "+o+" does not look like an event"),n+=", serialized values were of type "+typeof t+": "+JSON.stringify(t),e.push(new ue(null,r.A.Vo,(new Date).valueOf(),null,{e:n}))}return e}B(t,e){return!!B(STORAGE_KEYS.q,t,"StorageManager cannot store object.","STORAGE_KEYS.OBJECTS")&&this.Da.store(t,e)}I(t){return!!B(STORAGE_KEYS.q,t,"StorageManager cannot retrieve object.","STORAGE_KEYS.OBJECTS")&&this.Da.wr(t)}$s(t){return!!B(STORAGE_KEYS.q,t,"StorageManager cannot remove object.","STORAGE_KEYS.OBJECTS")&&(this.Da.remove(t),!0)}clearData(){const t=X(STORAGE_KEYS.Cr),e=X(STORAGE_KEYS.q);for(let e=0;e<t.length;e++){const s=t[e];this.Ya.remove(STORAGE_KEYS.Cr[s])}for(let t=0;t<e.length;t++){const s=e[t];this.Da.remove(STORAGE_KEYS.q[s])}}pa(t){return t||STORAGE_KEYS.q.Aa}ca(t){let e=this.Da.wr(STORAGE_KEYS.q.Ta);null==e&&(e={});const s=this.pa(t[User.Fn]);for(let r in t)r===User.Fn||null!=e[s]&&null!=e[s][r]||this.Mr(t[User.Fn],r,t[r])}Mr(t,e,s){let r=this.Da.wr(STORAGE_KEYS.q.Ta);null==r&&(r={});const o=this.pa(t);let n=r[o];if(null==n&&(n={},null!=t&&(n[User.Fn]=t)),e===User.Kr){null==n[e]&&(n[e]={});for(let t in s)n[e][t]=s[t]}else n[e]=s;return r[o]=n,this.Da.store(STORAGE_KEYS.q.Ta,r)}Ma(){const t=this.Da.wr(STORAGE_KEYS.q.Ta);this.Da.remove(STORAGE_KEYS.q.Ta);const e=[];for(let s in t)null!=t[s]&&e.push(t[s]);return e}Gr(t){const e=this.Da.wr(STORAGE_KEYS.q.Ta);if(null!=e){const s=this.pa(null),r=e[s];null!=r&&(e[s]=void 0,this.Da.store(STORAGE_KEYS.q.Ta,e),r[User.Fn]=t,this.ca(r))}const s=this._r(STORAGE_KEYS.Cr.Dh);let r=null;null!=s&&(r=s.Ir);const o=this.va();if(null!=o)for(let e=0;e<o.length;e++){const s=o[e];null==s.userId&&s.sessionId==r&&(s.userId=t),this.Hh(s)}}Ca(){return this.Da.ya}}K.Ea=class{constructor(t){this.Wi=t,this.ya=et.Ua()?3:10}wa(t){return t+"."+this.Wi}store(t,e){const s={v:e};try{return localStorage.setItem(this.wa(t),JSON.stringify(s)),!0}catch(t){return r.D.info("Storage failure: "+t.message),!1}}wr(t){try{const e=JSON.parse(localStorage.getItem(this.wa(t)));return null==e?null:e.v}catch(t){return r.D.info("Storage retrieval failure: "+t.message),null}}remove(t){try{localStorage.removeItem(this.wa(t))}catch(t){return r.D.info("Storage removal failure: "+t.message),!1}}};K.ne=class{constructor(t,e){this.Wi=t,this.Ba=this.Fa(),this.La=525949,this.Pa=!!e}wa(t){return null!=this.Wi?t+"."+this.Wi:t}Fa(){let t=0,e=document.location.hostname;const s=e.split("."),r="ab._gd";for(;t<s.length-1&&-1===document.cookie.indexOf(r+"="+r);)t++,e="."+s.slice(-1-t).join("."),document.cookie=r+"="+r+";domain="+e+";";return document.cookie=r+"=;expires="+new Date(0).toGMTString()+";domain="+e+";",e}ie(){const t=new Date;return t.setTime(t.getTime()+60*this.La*1e3),t.getFullYear()}xa(){const t=It(STORAGE_KEYS.Cr),e=document.cookie.split(";");for(let s=0;s<e.length;s++){let r=e[s];for(;" "===r.charAt(0);)r=r.substring(1);let o=!1;for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e])){o=!0;break}if(o){const t=r.split("=")[0];-1===t.indexOf("."+this.Wi)&&this.Ja(t)}}}store(t,e){this.xa();const s=new Date;s.setTime(s.getTime()+60*this.La*1e3);const o="expires="+s.toUTCString(),n="domain="+this.Ba;let i;i=this.Pa?e:encodeURIComponent(JSON.stringify(e));const a=this.wa(t)+"="+i+";"+o+";"+n+";path=/";return a.length>=4093?(r.D.info("Storage failure: string is "+a.length+" chars which is too large to store as a cookie."),!1):(document.cookie=a,!0)}wr(t){const e=[],s=this.wa(t)+"=",o=document.cookie.split(";");for(let n=0;n<o.length;n++){let i=o[n];for(;" "===i.charAt(0);)i=i.substring(1);if(0===i.indexOf(s))try{let t;t=this.Pa?i.substring(s.length,i.length):JSON.parse(decodeURIComponent(i.substring(s.length,i.length))),e.push(t)}catch(e){return r.D.info("Storage retrieval failure: "+e.message),this.remove(t),null}}return e.length>0?e[e.length-1]:null}remove(t){this.Ja(this.wa(t))}Ja(t){const e=t+"=;expires="+new Date(0).toGMTString();document.cookie=e,document.cookie=e+";path=/",document.cookie=e+";path="+document.location.pathname;const s=e+";domain="+this.Ba;document.cookie=s,document.cookie=s+";path=/",document.cookie=s+";path="+document.location.pathname}};K.fa=class{constructor(){this.ka={},this.za=5242880,this.ya=3}store(t,e){const s={value:e},o=this.Qa(e);return o>this.za?(r.D.info("Storage failure: object is ≈"+o+" bytes which is greater than the max of "+this.za),!1):(this.ka[t]=s,!0)}Qa(t){const e=[],s=[t];let r=0;for(;s.length;){const t=s.pop();if("boolean"==typeof t)r+=4;else if("string"==typeof t)r+=2*t.length;else if("number"==typeof t)r+=8;else if("object"==typeof t&&-1===e.indexOf(t)){e.push(t);for(let e in t)s.push(t[e])}}return r}wr(t){const e=this.ka[t];return null==e?null:e.value}remove(t){this.ka[t]=null}};K.Sa=class{constructor(t,e,s){this.Va=[],e&&this.Va.push(new K.ne(t)),s&&this.Va.push(new K.Ea(t)),this.Va.push(new K.fa(t))}store(t,e){let s=!0;for(let r=0;r<this.Va.length;r++)s=this.Va[r].store(t,e)&&s;return s}wr(t){for(let e=0;e<this.Va.length;e++){const s=this.Va[e].wr(t);if(null!=s)return s}return null}remove(t){for(let e=0;e<this.Va.length;e++)this.Va[e].remove(t)}};
@@ -0,0 +1 @@
1
+ import r from"../../shared-lib/braze-shared-lib.js";export default class u{constructor(){this.De={}}Et(t){if("function"!=typeof t)return null;const i=r.nt.et();return this.De[i]=t,i}removeSubscription(t){delete this.De[t]}removeAllSubscriptions(){this.De={}}Nt(t){const i=[];for(let r in this.De)i.push(this.De[r](t));return i}}
@@ -0,0 +1 @@
1
+ export default{Zo:"invalid_api_key",sa:"blacklisted",oa:"no_device_identifier",Yo:"invalid_json_response",Qo:"empty_response",__:"sdk_auth_error"};
@@ -0,0 +1 @@
1
+ import{isObject as zt}from"../util/code-utils.js";import{convertMsToSeconds as l,timestampOrNow as Jt}from"../util/date-utils.js";export default class ue{constructor(t,i,s,r,e){this.userId=t,this.type=i,this.time=Jt(s),this.sessionId=r,this.data=e}Xe(){const t={name:this.type,time:l(this.time),data:this.data||{},session_id:this.sessionId};return null!=this.userId&&(t.user_id=this.userId),t}ss(){return{u:this.userId,t:this.type,ts:this.time,s:this.sessionId,d:this.data}}static fromJson(t){return new ue(t.user_id,t.name,t.time,t.session_id,t.data)}static Na(t){return null!=t&&zt(t)&&null!=t.t&&""!==t.t}static jn(t){return new ue(t.u,t.t,t.ts,t.s,t.d)}}
@@ -0,0 +1 @@
1
+ export default{GOOGLE_TAG_MANAGER:"gg",MPARTICLE:"mp",SEGMENT:"sg",TEALIUM:"tl",MANUAL:"manu",NPM:"npm",CDN:"wcd",SHOPIFY:"shp"};
@@ -0,0 +1 @@
1
+ import DeviceProperties from"../Core/device-properties.js";export default class Ie{constructor(s){this.id=s}Xe(){const s={};return null!=this[DeviceProperties.BROWSER]&&(s.browser=this[DeviceProperties.BROWSER]),null!=this[DeviceProperties.BROWSER_VERSION]&&(s.browser_version=this[DeviceProperties.BROWSER_VERSION]),null!=this[DeviceProperties.OS]&&(s.os_version=this[DeviceProperties.OS]),null!=this[DeviceProperties.RESOLUTION]&&(s.resolution=this[DeviceProperties.RESOLUTION]),null!=this[DeviceProperties.LANGUAGE]&&(s.locale=this[DeviceProperties.LANGUAGE]),null!=this[DeviceProperties.TIME_ZONE]&&(s.time_zone=this[DeviceProperties.TIME_ZONE]),null!=this[DeviceProperties.USER_AGENT]&&(s.user_agent=this[DeviceProperties.USER_AGENT]),s}}
@@ -0,0 +1 @@
1
+ import r from"../../shared-lib/braze-shared-lib.js";export default class mt{constructor(t,e,s){null==t&&(t=r.nt.et()),s=parseInt(s),(isNaN(s)||0===s)&&(s=(new Date).valueOf()),this.Ir=t,this.xh=s,this._h=(new Date).valueOf(),this.Nh=e}ss(){return{g:this.Ir,e:this.Nh,c:this.xh,l:this._h}}static jn(t){if(null==t||null==t.g)return null;const e=new mt(t.g,t.e,t.c);return e._h=t.l,e}}
@@ -0,0 +1 @@
1
+ import{rehydrateDateAfterJsonization as w}from"../util/date-utils.js";export default class ei{constructor(t,i,l,s,u){this.endpoint=t||null,this.An=i||null,this.publicKey=l||null,this.tl=s||null,this.oh=u||null}ss(){return{e:this.endpoint,c:this.An,p:this.publicKey,u:this.tl,v:this.oh}}static jn(t){return new ei(t.e,w(t.c),t.p,t.u,t.v)}}
@@ -0,0 +1 @@
1
+ export default class t{constructor(t,s){this.S=!!t,this.ve=s||[]}V(t){this.S=this.S&&t.S,this.ve.push(...t.ve)}}
@@ -0,0 +1 @@
1
+ export default class jt{constructor(t,s,i,h,l,e,r){this.hh=t||0,this.gh=s||[],this.mh=i||[],this.fh=h||[],this.ph=l,null!=l&&""!==l||(this.ph=null),this.oh=e||null,this.uh=r||{}}ss(){return{s:"4.0.1",l:this.hh,e:this.gh,a:this.mh,p:this.fh,m:this.ph,v:this.oh,c:this.uh}}static jn(t){let s=t.l;return"4.0.1"!==t.s&&(s=0),new jt(s,t.e,t.a,t.p,t.m,t.v,t.c)}}
@@ -0,0 +1 @@
1
+ import b from"./util/net.js";import ue from"./models/braze-event.js";import s from"./common/event-logger.js";import{randomInclusive as lt}from"./util/math.js";import t from"./models/request-result.js";import r from"../shared-lib/braze-shared-lib.js";import{STORAGE_KEYS as o}from"./managers/storage-manager.js";import u from"./managers/subscription-manager.js";export default class wt{constructor(t,s,i,e,n,l,h,o,r,a){this.Wi=t,this.Co=s,this.sl=0,this.il=h.Ca(),this.el=null,this.j=i,this.xi=e,this.v=n,this.wt=l,this.h=h,this.yo=r,this.jt=a,this.hl=o,this.ol=new u,this.rl=50}al(t,s){return!t&&!s&&this.yo.Vn()>=this.rl}cl(t){let s=this.j.Eh();if(t.length>0){const i=this.v.getUserId();for(const e of t){const t=!e.userId&&!i||e.userId===i;e.type===r.A.Wh&&t&&(s=!0)}}return s}dl(t,s,i,e,n,l,h){null==i&&(i=!0),i&&this.ml();const u=this.h.va(),a=this.h.Ma();let c=!1;const d=(t,s)=>{let h=!1;b.Fs({url:this.Co+"/data/",data:t,headers:s,S:i=>{null!=t.respond_with&&t.respond_with.triggers&&(this.sl=Math.max(this.sl-1,0)),this.jt.qs(t,i,s)?(this.yo.Es(),this.wt.lh(i),null!=t.respond_with&&t.respond_with.user_id!=this.v.getUserId()||(null!=t.device&&this.h.B(o.q.Jo,t.device),null!=t.sdk_metadata&&(this.h.B(o.q.Ko,t.sdk_metadata),this.h.B(o.q.Ho,this.j.Uo())),this.hl(i),"function"==typeof e&&e())):i.auth_error&&(h=!0)},error:()=>{null!=t.respond_with&&t.respond_with.triggers&&(this.sl=Math.max(this.sl-1,0)),this.jt.Wo(t.events,t.attributes),"function"==typeof n&&n()},gl:t=>{if("function"==typeof l&&l(t),i&&!c){if(t&&!h)this.fl();else{let t=this.el;(null==t||t<1e3*this.il)&&(t=1e3*this.il),this.fl(Math.min(3e5,lt(1e3*this.il,3*t)))}c=!0}}})},m=this.cl(u),g=s||m;if(this.al(h,m))return void r.D.info("Declining to flush data due to 50 consecutive authentication failures");if(i&&!this.jt.ha(u,a,t,g))return this.fl(),void("function"==typeof l&&l(!0));const f=this.jt.ua(t,g,u,a);g&&this.sl++;let p=!1;f&&(this.jt.As(f.requestData,(()=>d(f.requestData,f.headers))),p=!0),this.yo.Hn()&&i&&!p?this.fl():m&&(r.D.info("Invoking new session subscriptions"),this.ol.Nt())}bl(){return this.sl>0}fl(t){this.kl||(null==t&&(t=1e3*this.il),this.ml(),this.wl=setTimeout((()=>{if(document.hidden){const t="visibilitychange",s=()=>{document.hidden||(document.removeEventListener(t,s,!1),this.dl())};document.addEventListener(t,s,!1)}else this.dl()}),t),this.el=t)}ml(){null!=this.wl&&(clearTimeout(this.wl),this.wl=null)}initialize(){this.kl=!1,this.fl()}destroy(){this.ol.removeAllSubscriptions(),this.yo.Qn(),this.ml(),this.kl=!0,this.dl(null,null,!1),this.wl=null}cr(t){return this.ol.Et(t)}openSession(){const t=this.j.Uo()!==this.j.no();t&&(this.h.Ga(o.Cr.zo),this.h.Ga(o.Cr.Ur)),this.dl(null,!1,null,null,null),this.En(),t&&import("./Push/push-manager-factory.js").then((t=>{if(this.kl)return;const s=t.default.Br();if(null!=s&&(s.isPushPermissionGranted()||s.isPushBlocked())){const t=()=>{s.Xi()?r.D.info("Push token maintenance is disabled, not refreshing token for backend."):s.subscribe()},i=(s,i)=>{i&&t()},e=()=>{const s=this.h.I(o.q.Wn);(null==s||s)&&t()},n=r.Ft.xt;new r.qt(n,r.D).hr(n.Pt.Nr,i,e)}}))}changeUser(t,s,i){const e=this.v.getUserId();if(e!==t){this.j.kh(),null!=e&&this.dl(null,!1,null,null,null),this.v.Er(t),i?this.yo.setSdkAuthenticationSignature(i):this.yo.Mn();for(let t=0;t<s.length;t++)s[t].changeUser(null==e);null!=e&&this.h.$s(o.q.P),this.h.$s(o.q.Jo),this.openSession(),r.D.info('Changed user to "'+t+'".')}else{let s="Doing nothing.";i&&this.yo.Jn()!==i&&(this.yo.setSdkAuthenticationSignature(i),s="Updated SDK authentication signature"),r.D.info(`Current user is already ${t}. ${s}`)}}requestImmediateDataFlush(t){this.ml(),this.j.no(),this.dl(null,null,null,null,null,t,!0)}requestFeedRefresh(){this.j.no(),this.dl(!0)}$r(t,s){this.j.no(),r.D.info("Requesting explicit trigger refresh."),this.dl(null,!0,null,t,s)}Sr(t,i){const e=r.A.yl,n={a:t,l:i},l=s.G(e,n);return l&&r.D.info(`Logged alias ${t} with label ${i}`),l}Vr(i,e,n){if(this.wt.Hr(e))return r.D.info(`Custom Attribute "${e}" is blocklisted, ignoring.`),new t;const l={key:e,value:n},h=s.G(i,l);return h&&r.D.info(`Logged custom attribute: ${e} with value: ${n}`),h}setLastKnownLocation(t,i,e,n,l,h){const o={latitude:i,longitude:e};null!=n&&(o.altitude=n),null!=l&&(o.ll_accuracy=l),null!=h&&(o.alt_accuracy=h);const u=s.G(r.A.vl,o,t);return u&&r.D.info(`Set user last known location as ${JSON.stringify(o,null,2)}`),u}vr(t,s){const i=this.j.no();return new ue(this.v.getUserId(),r.A.Sl,t,i,{cid:s})}En(){const t=r.Ft.xt;new r.qt(t,r.D).setItem(t.Pt.jl,1,{baseUrl:this.Co,data:{api_key:this.Wi,device_id:this.xi.te().id},userId:this.v.getUserId(),sdkAuthEnabled:this.yo.Hn()})}Fr(t){for(const s of t)if(s.api_key===this.Wi)this.jt.Wo(s.events,s.attributes);else{const t=r.Ft.xt;new r.qt(t,r.D).setItem(t.Pt.yr,r.nt.et(),s)}}Zr(i,e,n){if(this.wt.Hr(i))return r.D.info(`Custom Attribute "${i}" is blocklisted, ignoring.`),new t;let l,h;return null===e&&null===n?(l=r.A.$l,h={key:i}):(l=r.A.Al,h={key:i,latitude:e,longitude:n}),s.G(l,h)}Cn(t,i){const e={group_id:t,status:i};return s.G(r.A.Cl,e)}}
@@ -0,0 +1 @@
1
+ export default class xt{constructor(t){this.xl=t}zl(t){return null==this.xl||this.xl===t[0]}static fromJson(t){return new xt(t?t.event_name:null)}ss(){return this.xl}}
@@ -0,0 +1 @@
1
+ import Bt from"./filter-set.js";export default class Mt{constructor(t,s){this.xl=t,this.Bl=s}zl(t){if(null==this.xl||null==this.Bl)return!1;const s=t[0],r=t[1];return s===this.xl&&this.Bl.zl(r)}static fromJson(t){return new Mt(t?t.event_name:null,t?Bt.fromJson(t.property_filters):null)}ss(){return{e:this.xl,pf:this.Bl.ss()}}}
@@ -0,0 +1 @@
1
+ import kt from"./filter.js";import{isArray as p}from"../../util/code-utils.js";export default class Bt{constructor(t){this.filters=t}zl(t){let r=!0;for(let e=0;e<this.filters.length;e++){const o=this.filters[e];let s=!1;for(let r=0;r<o.length;r++)if(o[r].zl(t)){s=!0;break}if(!s){r=!1;break}}return r}static fromJson(t){if(null==t||!p(t))return null;const r=[];for(let e=0;e<t.length;e++){const o=[],s=t[e];for(let t=0;t<s.length;t++)o.push(kt.fromJson(s[t]));r.push(o)}return new Bt(r)}ss(){const t=[];for(let r=0;r<this.filters.length;r++){const e=this.filters[r],o=[];for(let t=0;t<e.length;t++)o.push(e[t].ss());t.push(o)}return t}static jn(t){const r=[];for(let e=0;e<t.length;e++){const o=[],s=t[e];for(let t=0;t<s.length;t++)o.push(kt.jn(s[t]));r.push(o)}return new Bt(r)}}
@@ -0,0 +1 @@
1
+ import{isDate as bt}from"../../util/code-utils.js";import{convertMsToSeconds as l,dateFromUnixTimestamp as h,secondsAgo as Ht,secondsInTheFuture as Lt}from"../../util/date-utils.js";export default class kt{constructor(t,s,e,i){this.El=t,this.Tl=s,this.comparator=e,this._l=i,this.Tl===kt.Ml.Nl&&this.comparator!==kt.Hl.Rl&&this.comparator!==kt.Hl.Ll&&this.comparator!==kt.Hl.Il&&this.comparator!==kt.Hl.Ol&&(this._l=h(this._l))}zl(t){let s=null;switch(null!=t&&(s=t[this.El]),this.comparator){case kt.Hl.Ul:return null!=s&&s.valueOf()===this._l.valueOf();case kt.Hl.Dl:return null==s||s.valueOf()!==this._l.valueOf();case kt.Hl.Ql:return typeof s==typeof this._l&&s>this._l;case kt.Hl.Rl:return this.Tl===kt.Ml.Nl?null!=s&&bt(s)&&Ht(s)<=this._l:typeof s==typeof this._l&&s>=this._l;case kt.Hl.Xl:return typeof s==typeof this._l&&s<this._l;case kt.Hl.Ll:return this.Tl===kt.Ml.Nl?null!=s&&bt(s)&&Ht(s)>=this._l:typeof s==typeof this._l&&s<=this._l;case kt.Hl.Gl:return null!=s&&"string"==typeof s&&typeof s==typeof this._l&&null!=s.match(this._l);case kt.Hl.Fl:return null!=s;case kt.Hl.Jl:return null==s;case kt.Hl.Il:return null!=s&&bt(s)&&Lt(s)<this._l;case kt.Hl.Ol:return null!=s&&bt(s)&&Lt(s)>this._l;case kt.Hl.Vl:return null==s||typeof s!=typeof this._l||"string"!=typeof s||null==s.match(this._l)}return!1}static fromJson(t){return new kt(t.property_key,t.property_type,t.comparator,t.property_value)}ss(){let t=this._l;return bt(this._l)&&(t=l(t.valueOf())),{k:this.El,t:this.Tl,c:this.comparator,v:t}}static jn(t){return new kt(t.k,t.t,t.c,t.v)}}kt.Hl={Ul:1,Dl:2,Ql:3,Rl:4,Xl:5,Ll:6,Gl:10,Fl:11,Jl:12,Il:15,Ol:16,Vl:17},kt.Ml={ql:"boolean",Kl:"number",Pl:"string",Nl:"date"};
@@ -0,0 +1 @@
1
+ import Dt from"./trigger-condition.js";export default class Ft{constructor(t,i){this.Wl=t,this.Yl=i}zl(t){if(null==this.Wl)return!1;const i=Dt.Zl(t[0],this.Wl);if(!i)return!1;let r=null==this.Yl||0===this.Yl.length;if(null!=this.Yl)for(let i=0;i<this.Yl.length;i++)if(this.Yl[i]===t[1]){r=!0;break}return i&&r}static fromJson(t){return new Ft(t?t.id:null,t?t.buttons:null)}ss(){return this.Wl}}
@@ -0,0 +1 @@
1
+ export default class Gt{constructor(t){this.productId=t}zl(t){return null==this.productId||t[0]===this.productId}static fromJson(t){return new Gt(t?t.product_id:null)}ss(){return this.productId}}
@@ -0,0 +1 @@
1
+ import Bt from"./filter-set.js";export default class Kt{constructor(t,s){this.productId=t,this.Bl=s}zl(t){if(null==this.productId||null==this.Bl)return!1;const s=t[0],i=t[1];return s===this.productId&&this.Bl.zl(i)}static fromJson(t){return new Kt(t?t.product_id:null,t?Bt.fromJson(t.property_filters):null)}ss(){return{id:this.productId,pf:this.Bl.ss()}}}
@@ -0,0 +1 @@
1
+ import Dt from"./trigger-condition.js";export default class Pt{constructor(t){this.Wl=t}zl(t){return null==this.Wl||Dt.Zl(t[0],this.Wl)}static fromJson(t){return new Pt(t?t.campaign_id:null)}ss(){return this.Wl}}
@@ -0,0 +1 @@
1
+ import xt from"./custom-event-data.js";import Mt from"./custom-event-property-data.js";import Bt from"./filter-set.js";import Ft from"./in-app-message-click-data.js";import Gt from"./purchase-data.js";import Kt from"./purchase-property-data.js";import Pt from"./push-click-data.js";import H from"./trigger-events.js";import r from"../../../shared-lib/braze-shared-lib.js";export default class Dt{constructor(e,t){this.type=e,this.data=t}Ha(e,t){return Dt.qa[this.type]===e&&(null==this.data||this.data.zl(t))}static Zl(e,t){let a=null;try{a=window.atob(e)}catch(t){return r.D.info("Failed to unencode analytics id "+e+": "+t.message),!1}return t===a.split("_")[0]}static fromJson(e){const t=e.type;let r;switch(t){case Dt.Wa.OPEN:r=null;break;case Dt.Wa.Rr:r=Gt.fromJson(e.data);break;case Dt.Wa.Xa:r=Kt.fromJson(e.data);break;case Dt.Wa.zr:r=Pt.fromJson(e.data);break;case Dt.Wa.be:r=xt.fromJson(e.data);break;case Dt.Wa.Za:r=Mt.fromJson(e.data);break;case Dt.Wa.Ar:r=Ft.fromJson(e.data);break;case Dt.Wa.ks:r=null}return new Dt(t,r)}ss(){return{t:this.type,d:this.data?this.data.ss():null}}static jn(e){let t,r;switch(e.t){case Dt.Wa.OPEN:t=null;break;case Dt.Wa.Rr:t=new Gt(e.d);break;case Dt.Wa.Xa:r=e.d||{},t=new Kt(r.id,Bt.jn(r.pf||[]));break;case Dt.Wa.zr:t=new Pt(e.d);break;case Dt.Wa.be:t=new xt(e.d);break;case Dt.Wa.Za:r=e.d||{},t=new Mt(r.e,Bt.jn(r.pf||[]));break;case Dt.Wa.Ar:t=new Ft(e.d);break;case Dt.Wa.ks:t=null}return new Dt(e.t,t)}}Dt.Wa={OPEN:"open",Rr:"purchase",Xa:"purchase_property",zr:"push_click",be:"custom_event",Za:"custom_event_property",Ar:"iam_click",ks:"test"},Dt.qa={},Dt.qa[Dt.Wa.OPEN]=H.OPEN,Dt.qa[Dt.Wa.Rr]=H.Rr,Dt.qa[Dt.Wa.Xa]=H.Rr,Dt.qa[Dt.Wa.zr]=H.zr,Dt.qa[Dt.Wa.be]=H.be,Dt.qa[Dt.Wa.Za]=H.be,Dt.qa[Dt.Wa.Ar]=H.Ar,Dt.qa[Dt.Wa.ks]=H.ks;
@@ -0,0 +1 @@
1
+ export default{OPEN:"open",Rr:"purchase",zr:"push_click",be:"custom_event",Ar:"iam_click",ks:"test"};
@@ -0,0 +1 @@
1
+ import{dateFromUnixTimestamp as h,rehydrateDateAfterJsonization as w}from"../../util/date-utils.js";import r from"../../../shared-lib/braze-shared-lib.js";import Dt from"./trigger-condition.js";import{validateValueIsFromEnum as B}from"../../util/code-utils.js";export default class ut{constructor(t,i,s,e,r,l,o,n,h,a,u,d){this.id=t,this.Th=i||[],void 0===s&&(s=null),this.startTime=s,void 0===e&&(e=null),this.endTime=e,this.priority=r||0,this.type=l,this.Ph=n||0,null==a&&(a=1e3*(this.Ph+30)),this.ai=a,this.data=o,null==h&&(h=ut.yh),this.Ah=h,this.Ih=u,this.$h=d||null}Mh(t){return null==this.$h||this.Ah!==ut.yh&&t-this.$h>=1e3*this.Ah}Bh(t){this.$h=t}Jh(t){const i=t+1e3*this.Ph;return Math.max(i-(new Date).valueOf(),0)}Lh(t){const i=(new Date).valueOf()-t,s=null==t||isNaN(i)||null==this.ai||i<this.ai;return s||r.D.info(`Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.ai}ms.`),!s}static fromJson(t){const i=t.id,s=[];for(let i=0;i<t.trigger_condition.length;i++)s.push(Dt.fromJson(t.trigger_condition[i]));const e=h(t.start_time),r=h(t.end_time),l=t.priority,o=t.type,n=t.delay,a=t.re_eligibility,u=t.timeout,d=t.data,m=t.min_seconds_since_last_trigger;return B(ut.ii,o,"Could not construct Trigger from server data","Trigger.Types")?new ut(i,s,e,r,l,o,d,n,a,u,m):null}ss(){const t=[];for(let i=0;i<this.Th.length;i++)t.push(this.Th[i].ss());return{i:this.id,c:t,s:this.startTime,e:this.endTime,p:this.priority,t:this.type,da:this.data,d:this.Ph,r:this.Ah,tm:this.ai,ss:this.Ih,ld:this.$h}}static jn(t){const i=[];for(let s=0;s<t.c.length;s++)i.push(Dt.jn(t.c[s]));return new ut(t.i,i,w(t.s),w(t.e),t.p,t.t,t.da,t.d,t.r,t.tm,t.ss,t.ld)}}ut.yh=-1,ut.ii={ei:"inapp",Rh:"templated_iam"};
@@ -0,0 +1 @@
1
+ import me from"../InAppMessage/in-app-message-manager-factory.js";import e,{OPTIONS as D}from"../managers/braze-instance.js";import ir from"./triggers-provider.js";export const TriggersProviderFactory={t:!1,provider:null,er:()=>(TriggersProviderFactory.init(),TriggersProviderFactory.provider),rg:()=>{TriggersProviderFactory.provider||(TriggersProviderFactory.provider=new ir(e.nn(D.lo)??30,me.m().Be(),e.l(),e.pr(),me.m()),e.ar(TriggersProviderFactory.provider))},init:()=>{TriggersProviderFactory.t||(TriggersProviderFactory.rg(),e.u(TriggersProviderFactory),TriggersProviderFactory.t=!0)},destroy:()=>{TriggersProviderFactory.provider=null,TriggersProviderFactory.t=!1}};
@@ -0,0 +1 @@
1
+ import C from"../common/base-provider.js";import{newInAppMessageFromJson as it}from"../InAppMessage/in-app-message-factory.js";import ue from"../models/braze-event.js";import{InAppMessage}from"../InAppMessage/index.js";import{isArray as p,isEqual as ii,validateValueIsFromEnum as B}from"../util/code-utils.js";import{STORAGE_KEYS as o}from"../managers/storage-manager.js";import ct from"../InAppMessage/models/templated-in-app-message.js";import ut from"./models/trigger.js";import H from"./models/trigger-events.js";import r from"../../shared-lib/braze-shared-lib.js";export default class ir extends C{constructor(t,i,s,e,r){super(),this.Oh=t,this.vt=i,this.h=s,this.Is=e,this.Uh=r,this.Kh=[],this.Qh=[],this.Vh=null,this.Xh={},this.Yh={},this.Zh(),this.$a()}tg(){this.Vh=this.h.I(o.q.Ia)||this.Vh,this.Xh=this.h.I(o.q.Ka)||this.Xh,this.Yh=this.h.I(o.q.ba)||this.Yh;for(let t=0;t<this.ig.length;t++){const i=this.ig[t];null!=this.Yh[i.id]&&i.Bh(this.Yh[i.id])}}Zh(){this.sg=this.h.I(o.q.Ra)||0;const t=this.h.I(o.q.Oa)||[],i=[];for(let s=0;s<t.length;s++)i.push(ut.jn(t[s]));this.ig=i,this.tg()}$a(){const t=this,i=function(i,s,e,r,h){return function(){t.eg(i,s,e,r,h)}},s={};for(let t=0;t<this.ig.length;t++)s[this.ig[t].id]=this.ig[t];let e=!1;for(let t=0;t<this.ig.length;t++){const r=this.ig[t];if(null!=this.Xh[r.id]){const t=this.Xh[r.id],h=[];for(let e=0;e<t.length;e++){const o=t[e],n=r.Jh(o.ni);if(n>0){let t,e;h.push(o),null!=o.hg&&(t=o.hg),null!=o.og&&ue.Na(o.og)&&(e=ue.jn(o.og));const l=[];if(p(o.ng))for(let t=0;t<o.ng.length;t++){const i=s[o.ng[t]];null!=i&&l.push(i)}this.Qh.push(setTimeout(i(r,o.ni,t,e,l),n))}}this.Xh[r.id].length>h.length&&(this.Xh[r.id]=h,e=!0,0===this.Xh[r.id].length&&delete this.Xh[r.id])}}e&&this.h.B(o.q.Ka,this.Xh)}lg(){const t=[];for(let i=0;i<this.ig.length;i++)t.push(this.ig[i].ss());this.sg=(new Date).valueOf(),this.h.B(o.q.Oa,t),this.h.B(o.q.Ra,this.sg)}ag(){(this.h.I(o.q.Ra)||0)>this.sg?this.Zh():this.tg()}_s(t){let i=!1;if(null!=t&&t.triggers){this.tg();const s={},e={};this.ig=[];for(let r=0;r<t.triggers.length;r++){const h=ut.fromJson(t.triggers[r]);null!=this.Yh[h.id]&&(h.Bh(this.Yh[h.id]),s[h.id]=this.Yh[h.id]),null!=this.Xh[h.id]&&(e[h.id]=this.Xh[h.id]);for(let t=0;t<h.Th.length;t++)if(h.Th[t].Ha(H.ks,null)){i=!0;break}null!=h&&this.ig.push(h)}ii(this.Yh,s)||(this.Yh=s,this.h.B(o.q.ba,this.Yh)),ii(this.Xh,e)||(this.Xh=e,this.h.B(o.q.Ka,this.Xh)),this.lg(),i&&(r.D.info("Trigger with test condition found, firing test."),this.je(H.ks)),this.je(H.OPEN);const h=this.Kh;this.Kh=[];for(let t=0;t<h.length;t++)this.je.apply(this,h[t])}}eg(t,i,s,e,h){const o=e=>{this.tg();const h=(new Date).valueOf();if(!t.Lh(i))return!1===navigator.onLine&&t.type===ut.ii.ei&&e.imageUrl?(r.D.info(`Not showing ${t.type} trigger action ${t.id} due to offline state.`),void this.Uh.qe(t.id,InAppMessage.Oe.pi)):void(t.Mh(h)&&this.gg(t,h,s)?(this.vt.Nt([e]),this.fg(t,h)):r.D.info(`Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`));t.type===ut.ii.Rh?this.Uh.qe(t.id,InAppMessage.Oe.Ye):this.Uh.qe(t.id,InAppMessage.Oe.fi)},n=()=>{this.tg();const o=h.pop();if(null!=o)if(this.cg(o,i,s,e,h),o.Lh(i)){let t=`Server aborted in-app message display, but the timeout on fallback trigger ${o.id} has already elapsed.`;h.length>0&&(t+=" Continuing to fall back."),r.D.info(t),this.Uh.qe(o.id,InAppMessage.Oe.fi),n()}else{r.D.info(`Server aborted in-app message display. Falling back to lower priority ${o.type} trigger action ${t.id}.`);const n=1e3*o.Ph-((new Date).valueOf()-i);n>0?this.Qh.push(setTimeout((()=>{this.eg(o,i,s,e,h)}),n)):this.eg(o,i,s,e,h)}};switch(t.type){case ut.ii.ei:const h=it(t.data);if(null==h){r.D.error(`Could not parse trigger data for trigger ${t.id}, ignoring.`),this.Uh.qe(t.id,InAppMessage.Oe.si);break}o(h);break;case ut.ii.Rh:const l=ct.fromJson(t.data,o,n,i,t.ai);if(null==l){r.D.error(`Could not parse trigger data for trigger ${t.id}, ignoring.`),this.Uh.qe(t.id,InAppMessage.Oe.si);break}this.Uh.Ve(l,s,e);break;default:r.D.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`),this.Uh.qe(t.id,InAppMessage.Oe.si)}}je(t,i,s){if(!B(H,t,"Cannot fire trigger action.","TriggerEvents"))return;if(this.Is.bl())return r.D.info("Trigger sync is currently in progress, awaiting sync completion before firing trigger event."),void this.Kh.push(arguments);this.ag();const e=(new Date).valueOf(),h=e-this.Vh;let o=!0,n=!0;const l=[];for(let s=0;s<this.ig.length;s++){const r=this.ig[s],h=e+1e3*r.Ph;if(r.Mh(h)&&(null==r.startTime||r.startTime<=e)&&(null==r.endTime||r.endTime>=e)){let s=!1;for(let e=0;e<r.Th.length;e++)if(r.Th[e].Ha(t,i)){s=!0;break}s&&(o=!1,this.gg(r,h,t)&&(n=!1,l.push(r)))}}if(o)return void r.D.info(`Trigger event ${t} did not match any trigger conditions.`);if(n)return void r.D.info(`Ignoring ${t} trigger event because a trigger was displayed ${h/1e3}s ago.`);l.sort(((t,i)=>t.priority-i.priority));const a=l.pop();null!=a&&(r.D.info(`Firing ${a.type} trigger action ${a.id} from trigger event ${t}.`),this.cg(a,e,t,s,l),0===a.Ph?this.eg(a,e,t,s,l):this.Qh.push(setTimeout((()=>{this.eg(a,e,t,s,l)}),1e3*a.Ph)))}changeUser(t){if(this.ig=[],this.h.$s(o.q.Oa),!t){this.Kh=[],this.Vh=null,this.Yh={},this.Xh={};for(let t=0;t<this.Qh.length;t++)clearTimeout(this.Qh[t]);this.Qh=[],this.h.$s(o.q.Ia),this.h.$s(o.q.ba),this.h.$s(o.q.Ka)}}clearData(){this.ig=[],this.Vh=null,this.Yh={},this.Xh={};for(let t=0;t<this.Qh.length;t++)clearTimeout(this.Qh[t]);this.Qh=[]}gg(t,i,s){if(null==this.Vh)return!0;if(s===H.ks)return r.D.info("Ignoring minimum interval between trigger because it is a test type."),!0;let e=t.Ih;return null==e&&(e=this.Oh),i-this.Vh>=1e3*e}cg(t,i,s,e,r){this.tg(),this.Xh[t.id]=this.Xh[t.id]||[];const h={};let n;h.ni=i,h.hg=s,null!=e&&(n=e.ss()),h.og=n;const l=[];for(let t=0;t<r.length;t++)l.push(r[t].id);h.ng=l,this.Xh[t.id].push(h),this.h.B(o.q.Ka,this.Xh)}fg(t,i){this.tg(),t.Bh(i),this.Vh=i,this.h.B(o.q.Ia,i),this.Yh[t.id]=i,this.h.B(o.q.ba,this.Yh)}}
@@ -0,0 +1 @@
1
+ import e,{OPTIONS as D}from"../../managers/braze-instance.js";export function attachCSS(n,t,o){const c=n??document.querySelector("head"),s=`ab-${t}-css-definitions-${"4.0.1".replace(/\./g,"-")}`,a=c.ownerDocument??document;if(null==a.getElementById(s)){const n=a.createElement("style");n.innerHTML=o,n.id=s;const t=e.nn(D.yi);null!=t&&n.setAttribute("nonce",t),c.appendChild(n)}}
@@ -0,0 +1 @@
1
+ import{attachCSS as Ut}from"./attach-css.js";import{loadFontAwesome as Qt}from"./load-font-awesome.js";export function attachFeedCSS(t){Ut(t,"feed","body>.ab-feed{position:fixed;top:0;right:0;bottom:0;width:421px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}body>.ab-feed .ab-feed-body{position:absolute;top:0;left:0;right:0;border:none;border-left:1px solid #d0d0d0;padding-top:70px;min-height:100%}body>.ab-feed .ab-initial-spinner{float:none}body>.ab-feed .ab-no-cards-message{position:absolute;width:100%;margin-left:-20px;top:40%}.ab-feed{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);-moz-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);box-shadow:0 1px 7px 1px rgba(66,82,113,.15);width:402px;background-color:#eee;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px;line-height:130%;letter-spacing:normal;overflow-y:auto;overflow-x:visible;z-index:9011;-webkit-overflow-scrolling:touch}.ab-feed :focus,.ab-feed:focus{outline:0}.ab-feed .ab-feed-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #d0d0d0;border-top:none;padding:20px 20px 0 20px}.ab-feed.ab-effect-slide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px);-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-feed.ab-effect-slide.ab-show{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ab-feed.ab-effect-slide.ab-hide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card{position:relative;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100%;border:1px solid #d0d0d0;margin-bottom:20px;overflow:hidden;background-color:#fff;-webkit-transition:height .4s ease-in-out,margin .4s ease-in-out;-moz-transition:height .4s ease-in-out,margin .4s ease-in-out;-o-transition:height .4s ease-in-out,margin .4s ease-in-out;transition:height .4s ease-in-out,margin .4s ease-in-out}.ab-feed .ab-card .ab-pinned-indicator{position:absolute;right:0;top:0;margin-right:-1px;width:0;height:0;border-style:solid;border-width:0 24px 24px 0;border-color:transparent #1676d0 transparent transparent}.ab-feed .ab-card .ab-pinned-indicator .fa-star{position:absolute;right:-21px;top:2px;font-size:9px;color:#fff}.ab-feed .ab-card.ab-effect-card.ab-hide{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-left{-webkit-transform:translateX(-450px);-moz-transform:translateX(-450px);-ms-transform:translateX(-450px);transform:translateX(-450px)}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-right{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card.ab-effect-card.ab-hide:not(.ab-swiped-left):not(.ab-swiped-right){opacity:0}.ab-feed .ab-card .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;right:0;top:0;z-index:9021;opacity:0;-webkit-transition:.5s;-moz-transition:.5s;-o-transition:.5s;transition:.5s}.ab-feed .ab-card .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b}.ab-feed .ab-card .ab-close-button svg.ab-chevron{display:none}.ab-feed .ab-card .ab-close-button:active{background-color:transparent}.ab-feed .ab-card .ab-close-button:focus{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover svg{fill-opacity:.8}.ab-feed .ab-card .ab-close-button:hover{opacity:1}.ab-feed .ab-card .ab-close-button:focus{opacity:1}.ab-feed .ab-card a{float:none;color:inherit;text-decoration:none}.ab-feed .ab-card a:hover{text-decoration:underline}.ab-feed .ab-card .ab-image-area{float:none;display:inline-block;vertical-align:top;line-height:0;overflow:hidden;width:100%;-webkit-box-sizing:initial;-moz-box-sizing:initial;box-sizing:initial}.ab-feed .ab-card .ab-image-area img{float:none;height:auto;width:100%}.ab-feed .ab-card.ab-banner .ab-card-body{display:none}.ab-feed .ab-card .ab-card-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:inline-block;width:100%;position:relative}.ab-feed .ab-card .ab-unread-indicator{position:absolute;bottom:0;margin-right:-1px;width:100%;height:5px;background-color:#1676d0}.ab-feed .ab-card .ab-unread-indicator.read{background-color:transparent}.ab-feed .ab-card .ab-title{float:none;letter-spacing:0;margin:0;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;display:block;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;font-size:18px;line-height:130%;padding:20px 25px 0 25px}.ab-feed .ab-card .ab-description{float:none;color:#545454;padding:15px 25px 20px 25px;word-wrap:break-word;white-space:pre-wrap}.ab-feed .ab-card .ab-description.ab-no-title{padding-top:20px}.ab-feed .ab-card .ab-url-area{float:none;color:#1676d0;margin-top:12px;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif}.ab-feed .ab-card.ab-classic-card .ab-card-body{min-height:40px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body{min-height:100px;padding-left:72px}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area{width:60px;height:60px;padding:20px 0 25px 25px;position:absolute}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area img{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;max-width:100%;max-height:100%;width:auto;height:auto}.ab-feed .ab-card.ab-classic-card.with-image .ab-title{background-color:transparent;font-size:16px}.ab-feed .ab-card.ab-classic-card.with-image .ab-description{padding-top:10px}.ab-feed .ab-card.ab-control-card{height:0;width:0;margin:0;border:0}.ab-feed .ab-feed-buttons-wrapper{float:none;position:relative;background-color:#282828;height:50px;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);z-index:1}.ab-feed .ab-feed-buttons-wrapper .ab-close-button,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{float:none;cursor:pointer;color:#fff;font-size:18px;padding:16px;-webkit-transition:.2s;-moz-transition:.2s;-o-transition:.2s;transition:.2s}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{font-size:22px}.ab-feed .ab-feed-buttons-wrapper .ab-close-button{float:right}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover{padding-top:12px;padding-right:14px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{padding-left:17px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{padding-top:13px;padding-left:14px}.ab-feed .ab-no-cards-message{text-align:center;margin-bottom:20px}@media (max-width:600px){body>.ab-feed{width:100%}}")}export function setupFeedUI(){attachFeedCSS(),Qt()}
@@ -0,0 +1 @@
1
+ import{attachCSS as Ut}from"./attach-css.js";import{loadFontAwesome as Qt}from"./load-font-awesome.js";export function attachInAppMessageCSS(t){Ut(t,"iam",".ab-pause-scrolling,body.ab-pause-scrolling,html.ab-pause-scrolling{overflow:hidden;touch-action:none}.ab-centering-div,.ab-iam-root.v3{position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:9011;-webkit-tap-highlight-color:transparent}.ab-centering-div:focus,.ab-iam-root.v3:focus{outline:0}.ab-centering-div.ab-effect-fullscreen,.ab-centering-div.ab-effect-html,.ab-centering-div.ab-effect-modal,.ab-iam-root.v3.ab-effect-fullscreen,.ab-iam-root.v3.ab-effect-html,.ab-iam-root.v3.ab-effect-modal{opacity:0}.ab-centering-div.ab-effect-fullscreen.ab-show,.ab-centering-div.ab-effect-html.ab-show,.ab-centering-div.ab-effect-modal.ab-show,.ab-iam-root.v3.ab-effect-fullscreen.ab-show,.ab-iam-root.v3.ab-effect-html.ab-show,.ab-iam-root.v3.ab-effect-modal.ab-show{opacity:1}.ab-centering-div.ab-effect-fullscreen.ab-show.ab-animate-in,.ab-centering-div.ab-effect-html.ab-show.ab-animate-in,.ab-centering-div.ab-effect-modal.ab-show.ab-animate-in,.ab-iam-root.v3.ab-effect-fullscreen.ab-show.ab-animate-in,.ab-iam-root.v3.ab-effect-html.ab-show.ab-animate-in,.ab-iam-root.v3.ab-effect-modal.ab-show.ab-animate-in{-webkit-transition:opacity .5s;-moz-transition:opacity .5s;-o-transition:opacity .5s;transition:opacity .5s}.ab-centering-div.ab-effect-fullscreen.ab-hide,.ab-centering-div.ab-effect-html.ab-hide,.ab-centering-div.ab-effect-modal.ab-hide,.ab-iam-root.v3.ab-effect-fullscreen.ab-hide,.ab-iam-root.v3.ab-effect-html.ab-hide,.ab-iam-root.v3.ab-effect-modal.ab-hide{opacity:0}.ab-centering-div.ab-effect-fullscreen.ab-hide.ab-animate-out,.ab-centering-div.ab-effect-html.ab-hide.ab-animate-out,.ab-centering-div.ab-effect-modal.ab-hide.ab-animate-out,.ab-iam-root.v3.ab-effect-fullscreen.ab-hide.ab-animate-out,.ab-iam-root.v3.ab-effect-html.ab-hide.ab-animate-out,.ab-iam-root.v3.ab-effect-modal.ab-hide.ab-animate-out{-webkit-transition:opacity .5s;-moz-transition:opacity .5s;-o-transition:opacity .5s;transition:opacity .5s}.ab-centering-div.ab-effect-slide .ab-in-app-message,.ab-iam-root.v3.ab-effect-slide .ab-in-app-message{-webkit-transform:translateX(535px);-moz-transform:translateX(535px);-ms-transform:translateX(535px);transform:translateX(535px)}.ab-centering-div.ab-effect-slide.ab-show .ab-in-app-message,.ab-iam-root.v3.ab-effect-slide.ab-show .ab-in-app-message{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ab-centering-div.ab-effect-slide.ab-show.ab-animate-in .ab-in-app-message,.ab-iam-root.v3.ab-effect-slide.ab-show.ab-animate-in .ab-in-app-message{-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-centering-div.ab-effect-slide.ab-hide .ab-in-app-message,.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message{-webkit-transform:translateX(535px);-moz-transform:translateX(535px);-ms-transform:translateX(535px);transform:translateX(535px)}.ab-centering-div.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-left,.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-left{-webkit-transform:translateX(-535px);-moz-transform:translateX(-535px);-ms-transform:translateX(-535px);transform:translateX(-535px)}.ab-centering-div.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-up,.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-up{-webkit-transform:translateY(-535px);-moz-transform:translateY(-535px);-ms-transform:translateY(-535px);transform:translateY(-535px)}.ab-centering-div.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-down,.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-down{-webkit-transform:translateY(535px);-moz-transform:translateY(535px);-ms-transform:translateY(535px);transform:translateY(535px)}.ab-centering-div.ab-effect-slide.ab-hide.ab-animate-out .ab-in-app-message,.ab-iam-root.v3.ab-effect-slide.ab-hide.ab-animate-out .ab-in-app-message{-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-centering-div .ab-ios-scroll-wrapper,.ab-iam-root.v3 .ab-ios-scroll-wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;pointer-events:all;touch-action:auto;-webkit-overflow-scrolling:touch}.ab-centering-div .ab-in-app-message,.ab-iam-root.v3 .ab-in-app-message{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:fixed;text-align:center;-webkit-box-shadow:0 0 4px rgba(0,0,0,.3);-moz-box-shadow:0 0 4px rgba(0,0,0,.3);box-shadow:0 0 4px rgba(0,0,0,.3);line-height:normal;letter-spacing:normal;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;z-index:9011;max-width:100%;overflow:hidden;display:inline-block;pointer-events:all;color:#333}.ab-centering-div .ab-in-app-message.ab-no-shadow,.ab-iam-root.v3 .ab-in-app-message.ab-no-shadow{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ab-centering-div .ab-in-app-message :focus,.ab-centering-div .ab-in-app-message:focus,.ab-iam-root.v3 .ab-in-app-message :focus,.ab-iam-root.v3 .ab-in-app-message:focus{outline:0}.ab-centering-div .ab-in-app-message.ab-clickable,.ab-iam-root.v3 .ab-in-app-message.ab-clickable{cursor:pointer}.ab-centering-div .ab-in-app-message.ab-background,.ab-iam-root.v3 .ab-in-app-message.ab-background{background-color:#fff}.ab-centering-div .ab-in-app-message .ab-close-button,.ab-iam-root.v3 .ab-in-app-message .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;right:0;top:0;z-index:9021}.ab-centering-div .ab-in-app-message .ab-close-button svg,.ab-iam-root.v3 .ab-in-app-message .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b}.ab-centering-div .ab-in-app-message .ab-close-button svg.ab-chevron,.ab-iam-root.v3 .ab-in-app-message .ab-close-button svg.ab-chevron{display:none}.ab-centering-div .ab-in-app-message .ab-close-button:active,.ab-iam-root.v3 .ab-in-app-message .ab-close-button:active{background-color:transparent}.ab-centering-div .ab-in-app-message .ab-close-button:focus,.ab-iam-root.v3 .ab-in-app-message .ab-close-button:focus{background-color:transparent}.ab-centering-div .ab-in-app-message .ab-close-button:hover,.ab-iam-root.v3 .ab-in-app-message .ab-close-button:hover{background-color:transparent}.ab-centering-div .ab-in-app-message .ab-close-button:hover svg,.ab-iam-root.v3 .ab-in-app-message .ab-close-button:hover svg{fill-opacity:.8}.ab-centering-div .ab-in-app-message .ab-message-text,.ab-iam-root.v3 .ab-in-app-message .ab-message-text{float:none;line-height:1.5;margin:20px 25px;max-width:100%;overflow:hidden;overflow-y:auto;vertical-align:text-bottom;word-wrap:break-word;white-space:pre-wrap;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif}.ab-centering-div .ab-in-app-message .ab-message-text.start-aligned,.ab-iam-root.v3 .ab-in-app-message .ab-message-text.start-aligned{text-align:left;text-align:start}.ab-centering-div .ab-in-app-message .ab-message-text.end-aligned,.ab-iam-root.v3 .ab-in-app-message .ab-message-text.end-aligned{text-align:right;text-align:end}.ab-centering-div .ab-in-app-message .ab-message-text.center-aligned,.ab-iam-root.v3 .ab-in-app-message .ab-message-text.center-aligned{text-align:center}.ab-centering-div .ab-in-app-message .ab-message-text::-webkit-scrollbar,.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar{-webkit-appearance:none;width:14px}.ab-centering-div .ab-in-app-message .ab-message-text::-webkit-scrollbar-thumb,.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar-thumb{-webkit-appearance:none;border:4px solid transparent;background-clip:padding-box;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;background-color:rgba(0,0,0,.2)}.ab-centering-div .ab-in-app-message .ab-message-text::-webkit-scrollbar-button,.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar-button{width:0;height:0;display:none}.ab-centering-div .ab-in-app-message .ab-message-text::-webkit-scrollbar-corner,.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar-corner{background-color:transparent}.ab-centering-div .ab-in-app-message .ab-message-header,.ab-iam-root.v3 .ab-in-app-message .ab-message-header{float:none;letter-spacing:0;margin:0;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;display:block;font-size:20px;margin-bottom:10px;line-height:1.3}.ab-centering-div .ab-in-app-message .ab-message-header.start-aligned,.ab-iam-root.v3 .ab-in-app-message .ab-message-header.start-aligned{text-align:left;text-align:start}.ab-centering-div .ab-in-app-message .ab-message-header.end-aligned,.ab-iam-root.v3 .ab-in-app-message .ab-message-header.end-aligned{text-align:right;text-align:end}.ab-centering-div .ab-in-app-message .ab-message-header.center-aligned,.ab-iam-root.v3 .ab-in-app-message .ab-message-header.center-aligned{text-align:center}.ab-centering-div .ab-in-app-message.ab-fullscreen,.ab-centering-div .ab-in-app-message.ab-modal,.ab-centering-div .ab-in-app-message.ab-slideup,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen,.ab-iam-root.v3 .ab-in-app-message.ab-modal,.ab-iam-root.v3 .ab-in-app-message.ab-slideup{-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px}.ab-centering-div .ab-in-app-message.ab-slideup,.ab-iam-root.v3 .ab-in-app-message.ab-slideup{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;cursor:pointer;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;font-size:14px;font-weight:700;margin:20px;margin-top:calc(constant(safe-area-inset-top,0) + 20px);margin-right:calc(constant(safe-area-inset-right,0) + 20px);margin-bottom:calc(constant(safe-area-inset-bottom,0) + 20px);margin-left:calc(constant(safe-area-inset-left,0) + 20px);margin-top:calc(env(safe-area-inset-top,0) + 20px);margin-right:calc(env(safe-area-inset-right,0) + 20px);margin-bottom:calc(env(safe-area-inset-bottom,0) + 20px);margin-left:calc(env(safe-area-inset-left,0) + 20px);max-height:150px;padding:10px;right:0;background-color:#efefef}.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone{max-height:66px;margin:10px;margin-top:calc(constant(safe-area-inset-top,0) + 10px);margin-right:calc(constant(safe-area-inset-right,0) + 10px);margin-bottom:calc(constant(safe-area-inset-bottom,0) + 10px);margin-left:calc(constant(safe-area-inset-left,0) + 10px);margin-top:calc(env(safe-area-inset-top,0) + 10px);margin-right:calc(env(safe-area-inset-right,0) + 10px);margin-bottom:calc(env(safe-area-inset-bottom,0) + 10px);margin-left:calc(env(safe-area-inset-left,0) + 10px);max-width:90%;max-width:calc(100% - 40px);min-width:90%;min-width:calc(100% - 40px)}.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone .ab-close-button,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-close-button{display:none}.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone .ab-close-button svg:not(.ab-chevron),.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-close-button svg:not(.ab-chevron){display:none}.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-close-button,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-close-button{display:block;height:20px;padding:0 20px 0 18px;pointer-events:none;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:12px}.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-close-button svg.ab-chevron,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-close-button svg.ab-chevron{display:inline}.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-message-text{border-right-width:40px}.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text{max-width:100%;border-right-width:10px}.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text span,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text span{max-height:66px}.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text.ab-with-icon,.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text.ab-with-image,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text.ab-with-image{max-width:80%;max-width:calc(100% - 50px - 5px - 10px - 25px)}.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-image-area{width:50px;height:50px}.ab-centering-div .ab-in-app-message.ab-slideup.simulate-phone .ab-image-area img,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-image-area img{max-width:100%;max-height:100%;width:auto;height:auto}.ab-centering-div .ab-in-app-message.ab-slideup.ab-clickable:active .ab-message-text,.ab-centering-div .ab-in-app-message.ab-slideup.ab-clickable:focus .ab-message-text,.ab-centering-div .ab-in-app-message.ab-slideup.ab-clickable:hover .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:active .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:focus .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:hover .ab-message-text{opacity:.8}.ab-centering-div .ab-in-app-message.ab-slideup.ab-clickable:active .ab-close-button svg.ab-chevron,.ab-centering-div .ab-in-app-message.ab-slideup.ab-clickable:focus .ab-close-button svg.ab-chevron,.ab-centering-div .ab-in-app-message.ab-slideup.ab-clickable:hover .ab-close-button svg.ab-chevron,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:active .ab-close-button svg.ab-chevron,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:focus .ab-close-button svg.ab-chevron,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:hover .ab-close-button svg.ab-chevron{fill-opacity:.8}.ab-centering-div .ab-in-app-message.ab-slideup .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:table-cell;border-color:transparent;border-style:solid;border-width:5px 25px 5px 10px;max-width:430px;vertical-align:middle;margin:0}.ab-centering-div .ab-in-app-message.ab-slideup .ab-message-text span,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text span{display:block;max-height:150px;overflow:auto}.ab-centering-div .ab-in-app-message.ab-slideup .ab-message-text.ab-with-icon,.ab-centering-div .ab-in-app-message.ab-slideup .ab-message-text.ab-with-image,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-image{max-width:365px;border-top:0;border-bottom:0}.ab-centering-div .ab-in-app-message.ab-slideup .ab-close-button,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;right:0;top:0;z-index:9021}.ab-centering-div .ab-in-app-message.ab-slideup .ab-close-button svg,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b}.ab-centering-div .ab-in-app-message.ab-slideup .ab-close-button svg.ab-chevron,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button svg.ab-chevron{display:none}.ab-centering-div .ab-in-app-message.ab-slideup .ab-close-button:active,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:active{background-color:transparent}.ab-centering-div .ab-in-app-message.ab-slideup .ab-close-button:focus,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:focus{background-color:transparent}.ab-centering-div .ab-in-app-message.ab-slideup .ab-close-button:hover,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:hover{background-color:transparent}.ab-centering-div .ab-in-app-message.ab-slideup .ab-close-button:hover svg,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:hover svg{fill-opacity:.8}.ab-centering-div .ab-in-app-message.ab-slideup .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area{float:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:table-cell;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;vertical-align:top;width:60px;margin:0}.ab-centering-div .ab-in-app-message.ab-slideup .ab-image-area.ab-icon-area,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area.ab-icon-area{width:auto}.ab-centering-div .ab-in-app-message.ab-slideup .ab-image-area img,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area img{float:none;width:100%}.ab-centering-div .ab-in-app-message.ab-fullscreen,.ab-centering-div .ab-in-app-message.ab-modal,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen,.ab-iam-root.v3 .ab-in-app-message.ab-modal{font-size:14px}.ab-centering-div .ab-in-app-message.ab-fullscreen .ab-image-area,.ab-centering-div .ab-in-app-message.ab-modal .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area{float:none;position:relative;display:block;overflow:hidden}.ab-centering-div .ab-in-app-message.ab-fullscreen .ab-image-area .ab-center-cropped-img,.ab-centering-div .ab-in-app-message.ab-modal .ab-image-area .ab-center-cropped-img,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area .ab-center-cropped-img,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area .ab-center-cropped-img{background-size:cover;background-repeat:no-repeat;background-position:50% 50%;position:absolute;top:0;right:0;bottom:0;left:0}.ab-centering-div .ab-in-app-message.ab-fullscreen .ab-icon,.ab-centering-div .ab-in-app-message.ab-modal .ab-icon,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-icon,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-icon{margin-top:20px}.ab-centering-div .ab-in-app-message.ab-fullscreen.graphic,.ab-centering-div .ab-in-app-message.ab-modal.graphic,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic{padding:0}.ab-centering-div .ab-in-app-message.ab-fullscreen.graphic .ab-message-text,.ab-centering-div .ab-in-app-message.ab-modal.graphic .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-message-text{display:none}.ab-centering-div .ab-in-app-message.ab-fullscreen.graphic .ab-message-buttons,.ab-centering-div .ab-in-app-message.ab-modal.graphic .ab-message-buttons,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-message-buttons,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-message-buttons{bottom:0;left:0}.ab-centering-div .ab-in-app-message.ab-fullscreen.graphic .ab-image-area,.ab-centering-div .ab-in-app-message.ab-modal.graphic .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area{float:none;height:auto;margin:0}.ab-centering-div .ab-in-app-message.ab-fullscreen.graphic .ab-image-area img,.ab-centering-div .ab-in-app-message.ab-modal.graphic .ab-image-area img,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-image-area img,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area img{display:block;top:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none}.ab-centering-div .ab-in-app-message.ab-modal,.ab-iam-root.v3 .ab-in-app-message.ab-modal{padding-top:20px;width:450px;max-width:450px;max-height:720px}.ab-centering-div .ab-in-app-message.ab-modal.simulate-phone,.ab-iam-root.v3 .ab-in-app-message.ab-modal.simulate-phone{max-width:91%;max-width:calc(100% - 30px)}.ab-centering-div .ab-in-app-message.ab-modal.simulate-phone.graphic .ab-image-area img,.ab-iam-root.v3 .ab-in-app-message.ab-modal.simulate-phone.graphic .ab-image-area img{max-width:91vw;max-width:calc(100vw - 30px)}.ab-centering-div .ab-in-app-message.ab-modal .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text{max-height:660px}.ab-centering-div .ab-in-app-message.ab-modal .ab-message-text.ab-with-image,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-image{max-height:524.82758621px}.ab-centering-div .ab-in-app-message.ab-modal .ab-message-text.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-icon{max-height:610px}.ab-centering-div .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons{margin-bottom:93px;max-height:587px}.ab-centering-div .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons.ab-with-image,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons.ab-with-image{max-height:451.82758621px}.ab-centering-div .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons.ab-with-icon{max-height:537px}.ab-centering-div .ab-in-app-message.ab-modal .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area{margin-top:-20px;max-height:155.17241379px}.ab-centering-div .ab-in-app-message.ab-modal .ab-image-area img,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area img{max-width:100%;max-height:155.17241379px}.ab-centering-div .ab-in-app-message.ab-modal .ab-image-area.ab-icon-area,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area.ab-icon-area{height:auto}.ab-centering-div .ab-in-app-message.ab-modal.graphic,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic{width:auto;overflow:hidden}.ab-centering-div .ab-in-app-message.ab-modal.graphic .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area{display:inline}.ab-centering-div .ab-in-app-message.ab-modal.graphic .ab-image-area img,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area img{max-height:720px;max-width:450px}.ab-centering-div .ab-in-app-message.ab-fullscreen,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen{width:450px;max-height:720px}.ab-centering-div .ab-in-app-message.ab-fullscreen.landscape,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape{width:720px;max-height:450px}.ab-centering-div .ab-in-app-message.ab-fullscreen.landscape .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape .ab-image-area{height:225px}.ab-centering-div .ab-in-app-message.ab-fullscreen.landscape.graphic .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape.graphic .ab-image-area{height:450px}.ab-centering-div .ab-in-app-message.ab-fullscreen.landscape .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape .ab-message-text{max-height:112px}.ab-centering-div .ab-in-app-message.ab-fullscreen .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-message-text{max-height:247px}.ab-centering-div .ab-in-app-message.ab-fullscreen .ab-message-text.ab-with-buttons,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-message-text.ab-with-buttons{margin-bottom:93px}.ab-centering-div .ab-in-app-message.ab-fullscreen .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area{height:360px}.ab-centering-div .ab-in-app-message.ab-fullscreen.graphic .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-image-area{height:720px}.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone{-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-close-button,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone .ab-image-area,.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-image-area{height:50%}.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone .ab-message-text.ab-with-buttons,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-message-text.ab-with-buttons,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone:not(.graphic),.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone:not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone:not(.graphic) .ab-message-buttons,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone:not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone.graphic,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.graphic{display:block}.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone.graphic .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.graphic .ab-image-area{height:100%}.ab-centering-div .ab-in-app-message.ab-fullscreen.simulate-phone.graphic .ab-message-button,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}.ab-centering-div .ab-in-app-message.ab-html-message,.ab-iam-root.v3 .ab-in-app-message.ab-html-message{background-color:transparent;border:none;height:100%;overflow:auto;position:relative;touch-action:auto;width:100%}.ab-centering-div .ab-in-app-message .ab-message-buttons,.ab-iam-root.v3 .ab-in-app-message .ab-message-buttons{position:absolute;bottom:0;width:100%;padding:17px 25px 30px 25px;z-index:inherit;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ab-centering-div .ab-in-app-message .ab-message-button,.ab-iam-root.v3 .ab-in-app-message .ab-message-button{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;cursor:pointer;display:inline-block;font-size:14px;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;height:44px;line-height:normal;letter-spacing:normal;margin:0;max-width:100%;min-width:80px;padding:0 12px;position:relative;text-transform:none;width:48%;width:calc(50% - 5px);border:1px solid #1b78cf;-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;word-wrap:normal;white-space:nowrap}.ab-centering-div .ab-in-app-message .ab-message-button:first-of-type,.ab-iam-root.v3 .ab-in-app-message .ab-message-button:first-of-type{float:left;background-color:#fff;color:#1b78cf}.ab-centering-div .ab-in-app-message .ab-message-button:last-of-type,.ab-iam-root.v3 .ab-in-app-message .ab-message-button:last-of-type{float:right;background-color:#1b78cf;color:#fff}.ab-centering-div .ab-in-app-message .ab-message-button:first-of-type:last-of-type,.ab-iam-root.v3 .ab-in-app-message .ab-message-button:first-of-type:last-of-type{float:none;width:auto}.ab-centering-div .ab-in-app-message .ab-message-button:after,.ab-iam-root.v3 .ab-in-app-message .ab-message-button:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent}.ab-centering-div .ab-in-app-message .ab-message-button:after,.ab-iam-root.v3 .ab-in-app-message .ab-message-button:after{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease}.ab-centering-div .ab-in-app-message .ab-message-button:hover,.ab-iam-root.v3 .ab-in-app-message .ab-message-button:hover{opacity:.8}.ab-centering-div .ab-in-app-message .ab-message-button:active:after,.ab-iam-root.v3 .ab-in-app-message .ab-message-button:active:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.08)}.ab-centering-div .ab-in-app-message .ab-message-button:focus:after,.ab-iam-root.v3 .ab-in-app-message .ab-message-button:focus:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.15)}.ab-centering-div .ab-in-app-message .ab-message-button a,.ab-iam-root.v3 .ab-in-app-message .ab-message-button a{color:inherit;text-decoration:inherit}.ab-centering-div .ab-in-app-message img,.ab-iam-root.v3 .ab-in-app-message img{float:none;display:inline-block}.ab-centering-div .ab-in-app-message .ab-icon,.ab-iam-root.v3 .ab-in-app-message .ab-icon{float:none;display:inline-block;padding:10px;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px}.ab-centering-div .ab-in-app-message .ab-icon .fa,.ab-iam-root.v3 .ab-in-app-message .ab-icon .fa{float:none;font-size:30px;width:30px}.ab-centering-div .ab-start-hidden,.ab-iam-root.v3 .ab-start-hidden{visibility:hidden}.ab-centering-div .ab-centered,.ab-centering-div.ab-centering-div .ab-modal,.ab-iam-root.v3 .ab-centered,.ab-iam-root.v3.ab-centering-div .ab-modal{margin:auto;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ab-email-capture,.ab-iam-root.v3{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.ab-email-capture .ab-page-blocker,.ab-iam-root.v3 .ab-page-blocker{position:fixed;top:0;left:0;width:100%;height:100%;z-index:9001;pointer-events:all;background-color:rgba(51,51,51,.75)}.ab-email-capture .ab-in-app-message.ab-modal .ab-email-capture-input{margin-bottom:30px}.ab-email-capture .ab-in-app-message.ab-modal .ab-message-buttons~.ab-message-text{max-height:541px;margin-bottom:160px}.ab-email-capture .ab-in-app-message.ab-modal .ab-message-buttons~.ab-message-text.with-explanatory-link{max-height:513px;margin-bottom:188px}.ab-email-capture .ab-in-app-message.ab-modal .ab-image-area~.ab-message-text{max-height:385.82758621px}.ab-email-capture .ab-in-app-message.ab-modal .ab-image-area~.ab-message-text.with-explanatory-link{max-height:357.82758621px}.ab-email-capture .ab-in-app-message.ab-modal .ab-email-validation-error{margin-top:62px}.ab-email-capture .ab-in-app-message.ab-modal .ab-explanatory-link{display:block}.ab-email-capture .ab-in-app-message.ab-modal .ab-background,.ab-email-capture .ab-in-app-message.ab-modal .ab-mask{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1}.ab-email-capture .ab-in-app-message.ab-modal .ab-close-button{line-height:normal}.ab-email-capture .ab-in-app-message.ab-modal .ab-html-close-button{right:3px;top:-1px;font-size:34px;padding-top:0}@media (max-width:600px){.ab-iam-root.v3 .ab-in-app-message.ab-slideup{max-height:66px;margin:10px;margin-top:calc(constant(safe-area-inset-top,0) + 10px);margin-right:calc(constant(safe-area-inset-right,0) + 10px);margin-bottom:calc(constant(safe-area-inset-bottom,0) + 10px);margin-left:calc(constant(safe-area-inset-left,0) + 10px);margin-top:calc(env(safe-area-inset-top,0) + 10px);margin-right:calc(env(safe-area-inset-right,0) + 10px);margin-bottom:calc(env(safe-area-inset-bottom,0) + 10px);margin-left:calc(env(safe-area-inset-left,0) + 10px);max-width:90%;max-width:calc(100% - 40px);min-width:90%;min-width:calc(100% - 40px)}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button{display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button svg:not(.ab-chevron){display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable .ab-close-button{display:block;height:20px;padding:0 20px 0 18px;pointer-events:none;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:12px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable .ab-close-button svg.ab-chevron{display:inline}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable .ab-message-text{border-right-width:40px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text{max-width:100%;border-right-width:10px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text span{max-height:66px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-image{max-width:80%;max-width:calc(100% - 50px - 5px - 10px - 25px)}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area{width:50px;height:50px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area img{max-width:100%;max-height:100%;width:auto;height:auto}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape{-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-close-button,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen .ab-image-area,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-image-area,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen .ab-message-text,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen .ab-message-text.ab-with-buttons,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-message-text.ab-with-buttons,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape:not(.graphic),.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen:not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape:not(.graphic) .ab-message-buttons,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen:not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.graphic,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.graphic{display:block}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.graphic .ab-image-area,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.graphic .ab-message-button,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}}@media (max-width:480px){.ab-email-capture .ab-in-app-message.ab-modal:not(.force-desktop),.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop){max-width:91%;max-width:calc(100% - 30px)}.ab-email-capture .ab-in-app-message.ab-modal:not(.force-desktop).graphic .ab-image-area img,.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop).graphic .ab-image-area img{max-width:91vw;max-width:calc(100vw - 30px)}}@media (max-height:750px){.ab-email-capture .ab-in-app-message.ab-modal:not(.force-desktop),.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop){max-height:91%;max-height:calc(100% - 30px)}.ab-email-capture .ab-in-app-message.ab-modal:not(.force-desktop).graphic .ab-image-area img,.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop).graphic .ab-image-area img{max-height:91vh;max-height:calc(100vh - 30px)}.ab-email-capture .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text{max-height:65vh;max-height:calc(100vh - 30px - 60px)}.ab-email-capture .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-image,.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-image{max-height:45vh;max-height:calc(100vh - 30px - 155.17241379310346px - 40px)}.ab-email-capture .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-icon{max-height:45vh;max-height:calc(100vh - 30px - 70px - 40px)}.ab-email-capture .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons,.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons{max-height:50vh;max-height:calc(100vh - 30px - 93px - 40px)}.ab-email-capture .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons.ab-with-image,.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons.ab-with-image{max-height:30vh;max-height:calc(100vh - 30px - 155.17241379310346px - 93px - 20px)}.ab-email-capture .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons.ab-with-icon{max-height:30vh;max-height:calc(100vh - 30px - 70px - 93px - 20px)}}@media (min-width:601px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area img{max-height:100%;max-width:100%}}@media (max-height:750px) and (min-width:601px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop){-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important;width:450px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop) .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop) .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop) .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop):not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop):not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).graphic{display:block}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}}@media (max-height:480px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop){-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic{display:block}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}}@media (max-width:750px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop){-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic{display:block}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}}")}export function setupInAppMessageUI(){attachInAppMessageCSS(),Qt()}
@@ -0,0 +1 @@
1
+ export{attachFeedCSS,setupFeedUI}from"./feed-css.js";export{attachInAppMessageCSS,setupInAppMessageUI}from"./iam-css.js";export{loadFontAwesome}from"./load-font-awesome.js";
@@ -0,0 +1 @@
1
+ import e,{OPTIONS as D}from"../../managers/braze-instance.js";export function loadFontAwesome(){if(e.nn(D.Eo))return;const t="https://use.fontawesome.com/7f85a56ba4.css";if(!(null!==document.querySelector('link[rel=stylesheet][href="'+t+'"]'))){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",t),document.getElementsByTagName("head")[0].appendChild(e)}}
@@ -0,0 +1 @@
1
+ import{isArray as p}from"./code-utils.js";export default class Vt{constructor(){}tf(){}ef(){}qo(t){}static rf(t,e){if(t&&e)if(t=t.toLowerCase(),p(e.if)){for(let r=0;r<e.if.length;r++)if(-1!==t.indexOf(e.if[r].toLowerCase()))return e.identity}else if(-1!==t.indexOf(e.if.toLowerCase()))return e.identity}}
@@ -0,0 +1 @@
1
+ export default{types:{de:"container",logCustomEvent:"logCustomEvent",setEmailNotificationSubscriptionType:"setEmailNotificationSubscriptionType",setPushNotificationSubscriptionType:"setPushNotificationSubscriptionType",setCustomUserAttribute:"setCustomUserAttribute",requestPushPermission:"requestPushPermission",addToSubscriptionGroup:"addToSubscriptionGroup",removeFromSubscriptionGroup:"removeFromSubscriptionGroup",addToCustomAttributeArray:"addToCustomAttributeArray",removeFromCustomAttributeArray:"removeFromCustomAttributeArray",me:"openLink",pe:"openLinkInWebView"},properties:{type:"type",ue:"steps",fe:"args"}};
@@ -0,0 +1 @@
1
+ import Wt from"./client-hints-parser.js";import Xt from"./user-agent-parser.js";import{Browsers as Yt,OperatingSystems as ot}from"./device-constants.js";class Zt{constructor(){const t=navigator.userAgentData?Wt:Xt;this.ug=new t,this.userAgent=navigator.userAgent,this.browser=this.ug.tf(),this.version=this.ug.ef(),this.qo().then((t=>this.OS=t)),this.language=(navigator.userLanguage||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"").toLowerCase(),this.Lo=Zt.dg(this.userAgent)}Sg(){return this.browser!==Yt.bg||this.version>8}Ua(){return this.browser===Yt.vg}Fo(){return this.OS||null}qo(){return this.OS?Promise.resolve(this.OS):this.ug.qo(Zt.yg).then((t=>(this.OS=t,t)))}static dg(t){t=t.toLowerCase();const i=["googlebot","bingbot","slurp","duckduckbot","baiduspider","yandex","facebookexternalhit","sogou","ia_archiver","https://github.com/prerender/prerender","aolbuild","bingpreview","msnbot","adsbot","mediapartners-google","teoma"];for(let n=0;n<i.length;n++)if(-1!==t.indexOf(i[n]))return!0;return!1}}Zt.yg=[{string:navigator.platform,if:"Win",identity:ot.pg},{string:navigator.platform,if:"Mac",identity:ot.mg},{string:navigator.platform,if:"BlackBerry",identity:"BlackBerry"},{string:navigator.platform,if:"FreeBSD",identity:"FreeBSD"},{string:navigator.platform,if:"OpenBSD",identity:"OpenBSD"},{string:navigator.platform,if:"Nintendo",identity:"Nintendo"},{string:navigator.platform,if:"SunOS",identity:"SunOS"},{string:navigator.platform,if:"PlayStation",identity:"PlayStation"},{string:navigator.platform,if:"X11",identity:"X11"},{string:navigator.userAgent,if:["iPhone","iPad","iPod"],identity:ot.ln},{string:navigator.platform,if:"Pike v",identity:ot.ln},{string:navigator.userAgent,if:["Web0S"],identity:"WebOS"},{string:navigator.platform,if:["Linux armv7l","Android"],identity:ot.Bg},{string:navigator.userAgent,if:["Android"],identity:ot.Bg},{string:navigator.platform,if:"Linux",identity:"Linux"}];const et=new Zt;export{et as default,Zt as BrowserDetector};
@@ -0,0 +1 @@
1
+ import Vt from"./base-device-parser.js";import{Browsers as Yt}from"./device-constants.js";export default class Wt extends Vt{constructor(){if(super(),this.userAgentData=navigator.userAgentData,this.userAgentData){const t=this.tc();this.browser=t.browser||"Unknown Browser",this.version=t.version||"Unknown Version"}}tf(){return this.browser}ef(){return this.version}qo(t){if(this.OS)return Promise.resolve(this.OS);const r=r=>{for(let s=0;s<t.length;s++){const e=Wt.rf(r,t[s]);if(e)return this.OS=e,this.OS}return r};return this.userAgentData.platform?Promise.resolve(r(this.userAgentData.platform)):this.rc().then((t=>r(t.platform))).catch((()=>navigator.platform))}tc(){const t={},r=this.userAgentData.brands;if(r&&r.length)for(const s of r){const r=this.sc(Yt),e=s.brand.match(r);if(e&&e.length>0){t.browser=e[0],t.version=s.version;break}}return t}sc(t){const r=[];for(const s in t)t[s]!==Yt.bg&&r.push(t[s]);return new RegExp("("+r.join("|")+")","i")}rc(){return this.userAgentData.getHighEntropyValues?this.userAgentData.getHighEntropyValues(["platform"]):Promise.reject()}}
@@ -0,0 +1 @@
1
+ import r from"../../shared-lib/braze-shared-lib.js";export function values(t){const e=[];for(let r in t)t.hasOwnProperty(r)&&void 0!==t[r]&&e.push(t[r]);return e}export function validateValueIsFromEnum(t,e,n,o){const c=values(t);return-1!==c.indexOf(e)||(r.D.error(`${n} Valid values from ${o} are "${c.join('"/"')}".`),!1)}export function isArray(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}export function isDate(t){return"[object Date]"===Object.prototype.toString.call(t)}export function isObject(t){return"[object Object]"===Object.prototype.toString.call(t)}export function intersection(t){null==t&&(t=[]);const e=[],r=arguments.length;for(let n=0,o=t.length;n<o;n++){const o=t[n];if(-1!==e.indexOf(o))continue;let c=1;for(c=1;c<r&&-1!==arguments[c].indexOf(o);c++);c===r&&e.push(o)}return e}export function keys(t){const e=[];for(let r in t)t.hasOwnProperty(r)&&e.push(r);return e}export function isEqual(t,e){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;const r=t.toString();if(r!==e.toString())return!1;switch(r){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e}const n="[object Array]"===r;if(!n){if("object"!=typeof t||"object"!=typeof e)return!1;const r=t.constructor,n=e.constructor;if(r!==n&&!("function"==typeof r&&r instanceof r&&"function"==typeof n&&n instanceof n)&&"constructor"in t&&"constructor"in e)return!1}const o=[],c=[];let i=o.length;for(;i--;)if(o[i]===t)return c[i]===e;if(o.push(t),c.push(e),n){if(i=t.length,i!==e.length)return!1;for(;i--;)if(!isEqual(t[i],e[i],o,c))return!1}else{let r,n=keys(t);if(i=n.length,keys(e).length!==i)return!1;for(;i--;)if(r=n[i],!e.hasOwnProperty(r)||!isEqual(t[r],e[r],o,c))return!1}return o.pop(),c.pop(),!0}
@@ -0,0 +1 @@
1
+ import et from"./browser-detector.js";export function isTransparent(r){return r=parseInt(r),!isNaN(r)&&(4278190080&r)>>>24==0}export function toRgba(r,t){if(r=parseInt(r),isNaN(r))return"";t=parseFloat(t),isNaN(t)&&(t=1);const n=255&(r>>>=0),e=(65280&r)>>>8,o=(16711680&r)>>>16,a=((4278190080&r)>>>24)/255;return et.Sg()?"rgba("+[o,e,n,a*t].join(",")+")":"rgb("+[o,e,n].join(",")+")"}export function toRgb(r){if(r=parseInt(r),isNaN(r))return"";return"rgb("+[(16711680&(r>>>=0))>>>16,(65280&r)>>>8,255&r].join(",")+")"}
@@ -0,0 +1 @@
1
+ import{addPassiveEventListener as oe,buildSvg as ne}from"./dom-utils.js";import{KeyCodes as at}from"./key-codes.js";export function createCloseButton(t,o,e){const n=document.createElement("button");n.setAttribute("aria-label",t),n.setAttribute("tabindex","0"),n.setAttribute("role","button"),oe(n,"touchstart",(()=>{})),n.className="ab-close-button";const r=ne("0 0 15 15","M15 1.5L13.5 0l-6 6-6-6L0 1.5l6 6-6 6L1.5 15l6-6 6 6 1.5-1.5-6-6 6-6z",o);return n.appendChild(r),n.addEventListener("keydown",(t=>{t.keyCode!==at.io&&t.keyCode!==at.do||(e(),t.stopPropagation())})),n.onclick=t=>{e(),t.stopPropagation()},n}
@@ -0,0 +1 @@
1
+ import{isDate as bt}from"./code-utils.js";export function convertMsToSeconds(e,n){let t=e/1e3;return n&&(t=Math.floor(t)),t}export function convertSecondsToMs(e){return 1e3*e}export function dateFromUnixTimestamp(e){const n=parseInt(e);return null==e||isNaN(n)?null:new Date(1e3*n)}export function toValidBackendTimeString(e){return null!=e&&bt(e)?e.toISOString().replace(/\.[0-9]{3}Z$/,""):e}export function rehydrateDateAfterJsonization(e){return null==e||""===e?null:new Date(e)}export function timestampOrNow(e){return null==e||""===e?(new Date).valueOf():e}export function secondsAgo(e){return((new Date).valueOf()-e.valueOf())/1e3}export function secondsInTheFuture(e){return(e.valueOf()-(new Date).valueOf())/1e3}
@@ -0,0 +1 @@
1
+ import r from"../../shared-lib/braze-shared-lib.js";export function logDeprecationWarning(e,a,i){let s=`The '${e}' ${a} is deprecated.`;i&&(s+=` Please use '${i}' instead.`),r.D.warn(s)}
@@ -0,0 +1 @@
1
+ export const Browsers={rE:"Chrome",eE:"Edge",bg:"Internet Explorer",EE:"Opera",vg:"Safari",oE:"Firefox"};export const OperatingSystems={Bg:"Android",ln:"iOS",mg:"Mac",pg:"Windows"};
@@ -0,0 +1 @@
1
+ export function _isInView(t,n,e,s){if(null==t)return!1;n=n||!1,e=e||!1;const i=t.getBoundingClientRect();return null!=i&&((i.top>=0&&i.top<=(window.innerHeight||document.documentElement.clientHeight)||!n)&&(i.left>=0||!s)&&(i.bottom>=0&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)||!e)&&(i.right<=(window.innerWidth||document.documentElement.clientWidth)||!s))}export const DOMUtils={tu:null,eo:_isInView};export const DIRECTIONS={Te:"up",$e:"down",ot:"left",at:"right"};export function supportsPassive(){if(null==DOMUtils.tu){DOMUtils.tu=!1;try{const t=Object.defineProperty({},"passive",{get:()=>{DOMUtils.tu=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(t){}}return DOMUtils.tu}export function addPassiveEventListener(t,n,e){t.addEventListener(n,e,!!supportsPassive()&&{passive:!0})}export function topIsInView(t){return DOMUtils.eo(t,!0,!1,!1)}export function bottomIsInView(t){return DOMUtils.eo(t,!1,!0,!1)}export function clickElement(t){if(t.onclick){const n=document.createEvent("MouseEvents");n.initEvent("click",!0,!0),t.onclick.apply(t,[n])}}export function detectSwipe(t,n,e){let s=null,i=null;addPassiveEventListener(t,"touchstart",(t=>{s=t.touches[0].clientX,i=t.touches[0].clientY})),addPassiveEventListener(t,"touchmove",(o=>{if(null==s||null==i)return;const l=s-o.touches[0].clientX,u=i-o.touches[0].clientY;Math.abs(l)>Math.abs(u)&&Math.abs(l)>=25?((l>0&&n===DIRECTIONS.ot||l<0&&n===DIRECTIONS.at)&&e(o),s=null,i=null):Math.abs(u)>=25&&((u>0&&n===DIRECTIONS.Te&&t.scrollTop===t.scrollHeight-t.offsetHeight||u<0&&n===DIRECTIONS.$e&&0===t.scrollTop)&&e(o),s=null,i=null)}))}export function buildSvg(t,n,e){const s="http://www.w3.org/2000/svg",i=document.createElementNS(s,"svg");i.setAttribute("viewBox",t),i.setAttribute("xmlns",s);const o=document.createElementNS(s,"path");return o.setAttribute("d",n),null!=e&&o.setAttribute("fill",e),i.appendChild(o),i}
@@ -0,0 +1 @@
1
+ export const KeyCodes={io:32,oo:9,do:13,di:27};
@@ -0,0 +1 @@
1
+ export const randomInclusive=(t,a)=>(t=Math.ceil(t),a=Math.floor(a),Math.floor(Math.random()*(a-t+1))+t);
@@ -0,0 +1 @@
1
+ import r from"../../shared-lib/braze-shared-lib.js";import Rt from"../models/backend-errors.js";const b={Fs:e=>{let t,o,n=!1;try{if(window.XMLHttpRequest&&(t=new XMLHttpRequest)&&void 0!==t.withCredentials||("undefined"!=typeof XDomainRequest?(t=new XDomainRequest,t.async=!0,n=!0):r.D.error("This browser does not have any supported ajax options!")),null!=t){const s=()=>{"function"==typeof e.error&&e.error(t.status),"function"==typeof e.gl&&e.gl(!1)};if(t.onload=()=>{let o=!1;if(n)o=!0;else{if(4!==t.readyState)return;o=t.status>=200&&t.status<300||304===t.status}if(o){if("function"==typeof e.S){let o;try{o=JSON.parse(t.responseText)}catch(o){const n={error:""===t.responseText?Rt.Qo:Rt.Yo,response:t.responseText};e.S(n)}o&&e.S(o)}"function"==typeof e.gl&&e.gl(!0)}else s()},t.onerror=()=>{s()},t.ontimeout=()=>{s()},o=JSON.stringify(e.data),n)t.onprogress=()=>{},t.open("post",e.url);else{t.open("POST",e.url,!0),t.setRequestHeader("Content-type","application/json"),t.setRequestHeader("X-Requested-With","XMLHttpRequest");const o=e.headers||[];for(let e=0;e<o.length;e++)t.setRequestHeader(o[e][0],o[e][1])}t.send(o)}}catch(e){r.D.error(`Network request error: ${e.message}`)}}};export default b;
@@ -0,0 +1 @@
1
+ import r from"../../shared-lib/braze-shared-lib.js";export function getByteLength(e){let t=e.length;for(let r=e.length-1;r>=0;r--){const n=e.charCodeAt(r);n>127&&n<=2047?t++:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&r--}return t}export function decodeBrazeActions(e){try{e=e.replace(/-/g,"+").replace(/_/g,"/");let t=window.atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);let n=new Uint16Array(r.buffer);return String.fromCharCode(...n)}catch(e){return r.D.error("Unable to decode Base64: "+e),null}}
@@ -0,0 +1 @@
1
+ export function parseQueryStringKeyValues(t){null==t&&(t="");const r=t.split("?").slice(1).join("?"),n={};if(null!=r){const t=r.split("&");for(let r=0;r<t.length;r++){const a=t[r].split("=");""!==a[0]&&(n[a[0]]=a[1])}}return n}export function isURIJavascriptOrData(t){return!(!t||0!==(t=t.toString().toLowerCase()).lastIndexOf("javascript:",0)&&0!==t.lastIndexOf("data:",0))}
@@ -0,0 +1 @@
1
+ import Vt from"./base-device-parser.js";import{Browsers as Yt,OperatingSystems as ot}from"./device-constants.js";export default class Xt extends Vt{constructor(){super(),this.eu=Xt.nu(navigator.userAgent||"")}tf(){return this.eu[0]||"Unknown Browser"}ef(){return this.eu[1]||"Unknown Version"}qo(r){for(let e=0;e<r.length;e++){let n=r[e].string,i=Xt.rf(n,r[e]);if(i)return i===ot.mg&&navigator.maxTouchPoints>1&&(i=ot.ln),Promise.resolve(i)}return Promise.resolve(navigator.platform)}static nu(r){let e,n=r.match(/(samsungbrowser|tizen|roku|konqueror|icab|crios|opera|ucbrowser|chrome|safari|firefox|camino|msie|trident(?=\/))\/?\s*(\.?\d+(\.\d+)*)/i)||[];if(/trident/i.test(n[1]))return e=/\brv[ :]+(\.?\d+(\.\d+)*)/g.exec(r)||[],[Yt.bg,e[1]||""];if(-1!==r.indexOf("(Web0S; Linux/SmartTV)"))return["LG Smart TV",null];if(-1!==r.indexOf("CrKey"))return["Chromecast",null];if(-1!==r.indexOf("BRAVIA")||-1!==r.indexOf("SonyCEBrowser")||-1!==r.indexOf("SonyDTV"))return["Sony Smart TV",null];if(-1!==r.indexOf("PhilipsTV"))return["Philips Smart TV",null];if(r.match(/\b(Roku)\b/))return["Roku",null];if(r.match(/\bAFTM\b/))return["Amazon Fire Stick",null];if(n[1]===Yt.rE&&(e=r.match(/\b(OPR|Edge|EdgA|Edg|UCBrowser)\/(\.?\d+(\.\d+)*)/),null!=e))return e=e.slice(1),e[0]=e[0].replace("OPR",Yt.EE),e[0]=e[0].replace("EdgA",Yt.eE),"Edg"===e[0]&&(e[0]=Yt.eE),[e[0],e[1]];if(n[1]===Yt.vg&&(e=r.match(/\b(EdgiOS)\/(\.?\d+(\.\d+)*)/),null!=e))return e=e.slice(1),e[0]=e[0].replace("EdgiOS",Yt.eE),[e[0],e[1]];if(n=n[2]?[n[1],n[2]]:[null,null],n[0]===Yt.vg&&null!=(e=r.match(/version\/(\.?\d+(\.\d+)*)/i))&&n.splice(1,1,e[1]),null!=(e=r.match(/\b(UCBrowser)\/(\.?\d+(\.\d+)*)/))&&n.splice(1,1,e[2]),n[0]===Yt.EE&&null!=(e=r.match(/mini\/(\.?\d+(\.\d+)*)/i)))return["Opera Mini",e[1]||""];if(n[0]){const r=n[0].toLowerCase();"msie"===r&&(n[0]=Yt.bg),"crios"===r&&(n[0]=Yt.rE),"tizen"===r&&(n[0]="Samsung Smart TV",n[1]=null),"samsungbrowser"===r&&(n[0]="Samsung Browser")}return n}}