diff --git a/CHANGELOG.md b/CHANGELOG.md index 70876e7f8..f895cefc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Unreleased * Support Unified Admin [#1658](https://github.com/Shopify/shopify_app/pull/1658) * Set `access_scopes` column to string by default [#1636](https://github.com/Shopify/shopify_app/pull/1636) +* Updated AppBridge to 3.7.5 [#1680](https://github.com/Shopify/shopify_app/pull/1680) 21.4.1 (Feb 21, 2023) ---------- diff --git a/app/assets/javascripts/shopify_app/app_bridge_3.1.1.js b/app/assets/javascripts/shopify_app/app_bridge_3.1.1.js deleted file mode 100644 index 804691a07..000000000 --- a/app/assets/javascripts/shopify_app/app_bridge_3.1.1.js +++ /dev/null @@ -1,10 +0,0 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("app-bridge",[],e):"object"==typeof exports?exports["app-bridge"]=e():t["app-bridge"]=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=24)}([function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&(o+=o.length>0?i.SEPARATOR:"",a.forEach((function(t,e){o+=""+t.toUpperCase()+(e0?i.SEPARATOR:"")+s.toUpperCase())}return o&&(o+=""+(o.length>0?i.SEPARATOR:"")+r.toUpperCase()),""+i.PREFIX+i.SEPARATOR+o},e.isValidOptionalNumber=function(t){return null==t||"number"==typeof t},e.isValidOptionalString=function(t){return null==t||"string"==typeof t},e.updateActionFromPayload=function(t,e){return t.id===e.id&&(Object.assign(t,p(t,e)),!0)},e.getMergedProps=p,e.forEachInEnum=function(t,e){Object.keys(t).forEach((function(r){e(t[r])}))},e.findMatchInEnum=function(t,e){var r=Object.keys(t).find((function(r){return e===t[r]}));return r?t[r]:void 0},e.NonSnakeCaseGroup=[s.Group.AuthCode,s.Group.Button,s.Group.ButtonGroup,s.Group.Cart,s.Group.Error,s.Group.Features,s.Group.Fullscreen,s.Group.Link,s.Group.Loading,s.Group.Menu,s.Group.Modal,s.Group.Navigation,s.Group.Pos,s.Group.Print,s.Group.ResourcePicker,s.Group.Scanner,s.Group.SessionToken,s.Group.Share,s.Group.TitleBar,s.Group.Toast,s.Group.unstable_Picker]},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ComponentType=e.Group=void 0,function(t){t.AuthCode="AuthCode",t.Button="Button",t.ButtonGroup="ButtonGroup",t.Cart="Cart",t.Client="Client",t.ContextualSaveBar="ContextualSaveBar",t.Error="Error",t.Features="Features",t.FeedbackModal="FeedbackModal",t.Fullscreen="Fullscreen",t.LeaveConfirmation="LeaveConfirmation",t.Link="Link",t.Loading="Loading",t.Menu="Menu",t.Modal="Modal",t.Navigation="Navigation",t.Performance="Performance",t.Pos="Pos",t.Print="Print",t.ResourcePicker="Resource_Picker",t.unstable_Picker="unstable_Picker",t.Scanner="Scanner",t.SessionToken="SessionToken",t.Share="Share",t.TitleBar="TitleBar",t.Toast="Toast",t.MarketingExternalActivityTopBar="MarketingExternalActivityTopBar"}(e.Group||(e.Group={})),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup"}(e.ComponentType||(e.ComponentType={}))},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=0?this.subscriptions[n].unsubscribe():n=void 0,this.group=e,this.subgroups=r,Object.assign(a,{subgroups:this.subgroups}),this.subscribe(o,i,a,n)},t.prototype.error=function(t){var e=this,r=[];return h.forEachInEnum(p.Action,(function(n){r.push(e.subscriptions.length),e.subscribe(n,t)})),function(){r.map((function(t){return e.subscriptions[t]})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))}},t.prototype.subscribe=function(t,e,r,n){var o,a=this,s=r||this.component,u=t.toUpperCase(),c="number"==typeof n?e:e.bind(this);o=p.isErrorEventName(t)?h.getEventNameSpace(f.Group.Error,t,i(i({},s),{type:""})):h.getEventNameSpace(this.group,t,s);var l=this.app.subscribe(o,c,r?r.id:this.id),d={eventType:u,unsubscribe:l,callback:c,component:s,updateSubscribe:function(t,e){return a.updateSubscription(d,t,e)}};return"number"==typeof n&&n>=0&&n=0?this.children[e]:void 0},e.prototype.getChildIndex=function(t){return this.children.findIndex((function(e){return e.id===t}))},e.prototype.getChildSubscriptions=function(t,e){return this.subscriptions.filter((function(r){return r.component.id===t&&(!e||e===r.eventType)}))},e.prototype.addChild=function(t,r,n){var o=this,i=t.subscriptions;return this.getChild(t.id)||this.children.push(t),!i||r===t.group&&n===t.subgroups||(i.forEach((function(t){(0,t.updateSubscribe)(r,n)})),Object.assign(t,{group:r,subgroups:n}),t instanceof e&&t.children.forEach((function(t){return o.addChild(t,r,n)}))),this},e.prototype.removeChild=function(t){var e=this;return c.removeFromCollection(this.children,this.getChild(t),(function(){e.subscriptions.filter((function(e){return e.component.id===t})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))})),this},e.prototype.subscribeToChild=function(t,e,r){var n=this,o=r.bind(this);if(e instanceof Array)return e.forEach((function(e){return n.subscribeToChild(t,e,r)})),this;if("string"!=typeof e)return this;var i=e.toUpperCase(),a=this.getChildSubscriptions(t.id,i);if(a.length>0)a.forEach((function(e){return e.updateSubscribe(n.group,t.subgroups)}));else{var s={id:t.id,subgroups:t.subgroups,type:t.type};this.subscribe(i,o,s)}return this},e.prototype.getUpdatedChildActions=function(t,e){if(0!==t.length){for(var r=t.filter((function(t,e,r){return e===r.indexOf(t)})),n=r.map((function(t){return t.id})),o=e.filter((function(t){return n.indexOf(t.id)<0}));o.length>0;){if(!(i=o.pop()))break;this.removeChild(i.id)}return r}for(;e.length>0;){var i;if(!(i=e.pop()))break;this.removeChild(i.id)}},e}(d);function A(t,e,r){void 0===r&&(r=!1),t.forEach((function(t){r?(0,t.updateSubscribe)(e,[]):(0,t.unsubscribe)()})),r||(t.length=0)}e.ActionSetWithChildren=y},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=e.fromAction=e.AppBridgeError=e.invalidOriginAction=e.isErrorEventName=e.permissionAction=e.networkAction=e.persistenceAction=e.unsupportedOperationAction=e.unexpectedAction=e.invalidAction=e.invalidActionType=e.invalidPayload=e.Message=e.AppActionType=e.Action=void 0;var n,o=r(0),i=r(1);function a(t,e,r){var n=e.payload;return o.actionWrapper({type:t,group:i.Group.Error,payload:{action:e,message:r,type:t,id:n&&n.id?n.id:void 0}})}!function(t){t.INVALID_ACTION="APP::ERROR::INVALID_ACTION",t.INVALID_ACTION_TYPE="APP::ERROR::INVALID_ACTION_TYPE",t.INVALID_PAYLOAD="APP::ERROR::INVALID_PAYLOAD",t.INVALID_OPTIONS="APP::ERROR::INVALID_OPTIONS",t.UNEXPECTED_ACTION="APP::ERROR::UNEXPECTED_ACTION",t.PERSISTENCE="APP::ERROR::PERSISTENCE",t.UNSUPPORTED_OPERATION="APP::ERROR::UNSUPPORTED_OPERATION",t.NETWORK="APP::ERROR::NETWORK",t.PERMISSION="APP::ERROR::PERMISSION",t.FAILED_AUTHENTICATION="APP::ERROR::FAILED_AUTHENTICATION",t.INVALID_ORIGIN="APP::ERROR::INVALID_ORIGIN"}(n=e.Action||(e.Action={})),function(t){t.INVALID_CONFIG="APP::ERROR::INVALID_CONFIG",t.MISSING_CONFIG="APP::APP_ERROR::MISSING_CONFIG",t.MISSING_APP_BRIDGE_MIDDLEWARE="APP::APP_ERROR::MISSING_APP_BRIDGE_MIDDLEWARE",t.WINDOW_UNDEFINED="APP::APP_ERROR::WINDOW_UNDEFINED",t.REDUX_REINSTANTIATED="APP::APP_ERROR::REDUX_REINSTANTIATED",t.MISSING_LOCAL_ORIGIN="APP::APP_ERROR::MISSING_LOCAL_ORIGIN",t.MISSING_HOST_PROVIDER="APP::APP_ERROR::MISSING_HOST_PROVIDER",t.MISSING_ROUTER_CONTEXT="APP::APP_ERROR::MISSING_ROUTER_CONTEXT",t.MISSING_HISTORY_BLOCK="APP::APP_ERROR::MISSING_HISTORY_BLOCK"}(e.AppActionType||(e.AppActionType={})),function(t){t.MISSING_PAYLOAD="Missing payload",t.INVALID_PAYLOAD_ID="Id in payload is missing or invalid"}(e.Message||(e.Message={})),e.invalidPayload=function(t,e){return a(n.INVALID_PAYLOAD,t,e||"The action's payload is missing required properties or has invalid properties")},e.invalidActionType=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action type is invalid or unsupported",type:n.INVALID_ACTION_TYPE},type:n.INVALID_ACTION_TYPE})},e.invalidAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action's has missing/invalid values for `group`, `type` or `version`",type:n.INVALID_ACTION},type:n.INVALID_ACTION})},e.unexpectedAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"Action cannot be called at this time",type:n.UNEXPECTED_ACTION},type:n.UNEXPECTED_ACTION})},e.unsupportedOperationAction=function(t,e){return a(n.UNSUPPORTED_OPERATION,t,e||"The action type is unsupported")},e.persistenceAction=function(t,e){return a(n.PERSISTENCE,t,e||"Action cannot be persisted on server")},e.networkAction=function(t,e){return a(n.NETWORK,t,e||"Network error")},e.permissionAction=function(t,e){return a(n.PERMISSION,t,e||"Action is not permitted")},e.isErrorEventName=function(t){return"string"==typeof o.findMatchInEnum(n,t)},e.invalidOriginAction=function(t){return o.actionWrapper({group:i.Group.Error,payload:{message:t,type:n.INVALID_ORIGIN},type:n.INVALID_ORIGIN})};var s=function(t){this.name="AppBridgeError",this.message=t,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(this.message).stack};function u(t,e,r){var n=new s(t?e+": "+t:e);return n.action=r,n.type=e,n}e.AppBridgeError=s,s.prototype=Object.create(Error.prototype),e.fromAction=u,e.throwError=function(){for(var t=[],e=0;e=0&&(t.splice(n,1),r&&r(e),!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.removeFromCollection=e.addAndRemoveFromCollection=void 0,e.addAndRemoveFromCollection=function(t,e,r){return t.push(e),function(){return n(t,e,r)}},e.removeFromCollection=n},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&void 0!==e.label},e.isGroupedButtonPayload=function(t){var e=t;return Array.isArray(e.buttons)&&"string"==typeof e.id&&"string"==typeof e.label};var l=function(t){function e(e,r){var n=t.call(this,e,p.ComponentType.ButtonGroup,p.Group.ButtonGroup)||this;return n.disabled=!1,n.plain=!1,n.buttonsOptions=[],n.buttons=[],n.set(r,!1),n}return o(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{buttons:this.buttonsOptions,disabled:this.disabled,label:this.label,plain:this.plain}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var r=u.getMergedProps(this.options,t),n=r.label,o=r.disabled,i=r.buttons,s=r.plain;return this.label=n,this.disabled=Boolean(o),this.buttons=this.getButtons(i),this.plain=Boolean(s),e&&this.dispatch(a.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case a.UPDATE:var e=f(this.group,this.component,this.payload);this.app.dispatch(e)}return this},e.prototype.updateButtons=function(t){if(this.buttons&&0!==this.buttons.length){for(var e,r=0,n=this.buttons;r0}).call(this,r(27))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initialize=e.Action=void 0;var n,o=r(1),i=r(0);!function(t){t.INITIALIZE="APP::CLIENT::INITIALIZE"}(n=e.Action||(e.Action={})),e.initialize=function(){return i.actionWrapper({group:o.Group.Client,type:n.INITIALIZE})}},function(t,e,r){"use strict";function n(){return o()?window.location:void 0}function o(){return"undefined"!=typeof window}Object.defineProperty(e,"__esModule",{value:!0}),e.getWindow=e.getLocation=e.redirect=e.shouldRedirect=void 0,e.shouldRedirect=function(t){return t===window},e.redirect=function(t){var e=n();e&&e.assign(t)},e.getLocation=n,e.getWindow=function(){return o()?window:void 0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=void 0,function(t){t.UPDATE="APP::FEATURES::UPDATE",t.REQUEST="APP::FEATURES::REQUEST",t.REQUEST_UPDATE="APP::FEATURES::REQUEST::UPDATE"}(e.Action||(e.Action={}))},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r - * @license MIT - */ -var n=r(63),o=r(64),i=r(65);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return x(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return m(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function A(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function P(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:E(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):E(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function E(t,e,r,n,o){var i,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var p=-1;for(i=r;is&&(r=s-u),i=r;i>=0;i--){for(var f=!0,l=0;lo&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function m(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(p=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(p=u);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(p=u);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(p=u)}null===p?(p=65533,f=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|1023&p),n.push(p),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(i,a),c=this.slice(n,o),p=t.slice(e,r),f=0;fo)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return O(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;on)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function N(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o>>8*(n?o:1-o)}function U(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o>>8*(n?o:3-o)&255}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,n,i){return i||L(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,i){return i||L(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||D(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):U(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);D(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);D(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):U(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function x(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(62))},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createApp=e.default=e.actions=void 0;var i=r(6),a=r(31);Object.defineProperty(e,"actions",{enumerable:!0,get:function(){return a.compatibilityActions}});var s=r(59);function u(t){return s.compatibilityCreateApp(t,i.createApp)}o(r(67),e),e.default=u,e.createApp=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,r){if(null==r)return r;if(void 0===e||!Object.prototype.isPrototypeOf.call(Object.getPrototypeOf(e),r)||"Object"!==r.constructor.name&&"Array"!==r.constructor.name)return r;var n={};return Object.keys(r).forEach((function(o){Object.prototype.hasOwnProperty.call(e,o)?"object"!=typeof e[o]||Array.isArray(e[o])?n[o]=r[o]:n[o]=t(e[o],r[o]):n[o]=r[o]})),Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(r,t)||(n[t]=e[t])})),Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}},function(t){t.exports=JSON.parse('{"name":"@shopify/app-bridge","version":"3.1.1","types":"index.d.ts","main":"index.js","unpkg":"umd/index.js","jsdelivr":"umd/index.js","files":["/actions/","/client/","/umd/","/util/","/validate/","/development.d.ts","/development.js","/index.d.ts","/index.js","/MessageTransport.d.ts","/MessageTransport.js","/production.d.ts","/production.js"],"private":false,"publishConfig":{"access":"public","@shopify:registry":"https://registry.npmjs.org"},"repository":"git@github.com:Shopify/app-bridge.git","homepage":"https://shopify.dev/tools/app-bridge","author":"Shopify Inc.","license":"MIT","scripts":{"build":"yarn build:tsc && yarn build:npm && yarn build:umd","build:tsc":"NODE_ENV=production tsc","build:umd":"NODE_ENV=production webpack -p","build:npm":"shx cp -r ./npm/index.js ./index.js","check":"tsc","clean":"cat package.json | node -pe \\"JSON.parse(require(\'fs\').readFileSync(\'/dev/stdin\').toString()).files.map(f => \'./\'+f).join(\' \')\\" | xargs rm -rf","pack":"yarn pack","size":"size-limit"},"sideEffects":false,"size-limit":[{"limit":"17 KB","path":"production.js"}],"dependencies":{"base64url":"^3.0.1"},"devDependencies":{"@types/node":"^10.12.5","shx":"^0.3.3"}}')},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,c=[],p=!1,f=-1;function l(){p&&u&&(p=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!p){var t=s(l);p=!0;for(var e=c.length;e;){for(u=c,c=[];++f1)for(var r=1;r=0?i():o()}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8),o=function(){function t(){this.map={}}return t.prototype.set=function(t,e){Object.prototype.hasOwnProperty.call(this.map,t)||(this.map[t]=[]);var r={handler:e,remove:function(){}},o=n.addAndRemoveFromCollection(this.map[t],r);return r={handler:e,remove:o},o},t.prototype.get=function(t){var e=this.map[t];return e?e.map((function(t){return t.handler})):void 0},t.prototype.run=function(t,e,r){for(var n=[],o=3;o0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?a-4:a;for(r=0;r>16&255,u[p++]=e>>8&255,u[p++]=255&e;2===s&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,u[p++]=255&e);1===s&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,u[p++]=e>>8&255,u[p++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,s=r-o;as?s:a+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function p(t,e,r){for(var o,i,a=[],s=e;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){ -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ -e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,u=(1<>1,p=-7,f=r?o-1:0,l=r?-1:1,h=t[e+f];for(f+=l,i=h&(1<<-p)-1,h>>=-p,p+=s;p>0;i=256*i+t[e+f],f+=l,p-=8);for(a=i&(1<<-p)-1,i>>=-p,p+=n;p>0;a=256*a+t[e+f],f+=l,p-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,u,c=8*i-o-1,p=(1<>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=p?(s=0,a=p):a+f>=1?(s=(e*u-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+h]=255&s,h+=d,s/=256,o-=8);for(a=a<0;t[r+h]=255&a,h+=d,a/=256,c-=8);t[r+h-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){var r=e.length,n=r%4;if(!n)return e;var o=r,i=4-n,a=r+i,s=t.alloc(a);for(s.write(e);i--;)s.write("=",o++);return s.toString()}}).call(this,r(23).Buffer)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(6);Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i.createApp}}),o(r(15),e),o(r(6),e)}])})); \ No newline at end of file diff --git a/app/assets/javascripts/shopify_app/app_bridge_3.7.5.js b/app/assets/javascripts/shopify_app/app_bridge_3.7.5.js new file mode 100644 index 000000000..7e666319e --- /dev/null +++ b/app/assets/javascripts/shopify_app/app_bridge_3.7.5.js @@ -0,0 +1,10 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("app-bridge",[],t):"object"==typeof exports?exports["app-bridge"]=t():e["app-bridge"]=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=53)}([function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.updateActionFromPayload=t.isValidOptionalString=t.isValidOptionalNumber=t.forEachInEnum=t.getMergedProps=t.findMatchInEnum=t.getEventNameSpace=t.NonSnakeCaseGroup=t.actionWrapper=void 0;var o=r(n(54)),i=n(23),a=n(1);function u(e,t){var n=o.default(e,t);return n||Object.assign(e,t)}t.actionWrapper=function(e){return e},t.NonSnakeCaseGroup=[a.Group.AuthCode,a.Group.Button,a.Group.ButtonGroup,a.Group.Cart,a.Group.Error,a.Group.Features,a.Group.Fullscreen,a.Group.Link,a.Group.Loading,a.Group.Menu,a.Group.Modal,a.Group.Navigation,a.Group.Pos,a.Group.Print,a.Group.ResourcePicker,a.Group.Scanner,a.Group.SessionToken,a.Group.Share,a.Group.TitleBar,a.Group.Toast,a.Group.unstable_Picker],t.getEventNameSpace=function(e,n,r){if(n.startsWith(""+i.PREFIX+i.SEPARATOR))return n;var o=function(e){return t.NonSnakeCaseGroup.includes(e)?e.toUpperCase():(n=e,n.replace(/([A-Z])/g,(function(e,t,n){return(0===n?"":"_")+e[0].toLowerCase()}))).toUpperCase();var n}(e);if(r){var a=r.subgroups,u=r.type;a&&a.length>0&&(o+=o.length>0?i.SEPARATOR:"",a.forEach((function(e,t){o+=""+e.toUpperCase()+(t0?i.SEPARATOR:"")+u.toUpperCase())}return o&&(o+=""+(o.length>0?i.SEPARATOR:"")+n.toUpperCase()),""+i.PREFIX+i.SEPARATOR+o},t.findMatchInEnum=function(e,t){var n=Object.keys(e).find((function(n){return t===e[n]}));return n?e[n]:void 0},t.getMergedProps=u,t.forEachInEnum=function(e,t){Object.keys(e).forEach((function(n){t(e[n])}))},t.isValidOptionalNumber=function(e){return null==e||"number"==typeof e},t.isValidOptionalString=function(e){return null==e||"string"==typeof e},t.updateActionFromPayload=function(e,t){return e.id===t.id&&(Object.assign(e,u(e,t)),!0)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentType=t.Group=void 0,function(e){e.AuthCode="AuthCode",e.Button="Button",e.ButtonGroup="ButtonGroup",e.Cart="Cart",e.Client="Client",e.ContextualSaveBar="ContextualSaveBar",e.Error="Error",e.Features="Features",e.FeedbackModal="FeedbackModal",e.Fullscreen="Fullscreen",e.LeaveConfirmation="LeaveConfirmation",e.Link="Link",e.Loading="Loading",e.Menu="Menu",e.Modal="Modal",e.Navigation="Navigation",e.Performance="Performance",e.Pos="Pos",e.Print="Print",e.ResourcePicker="Resource_Picker",e.unstable_Picker="unstable_Picker",e.Scanner="Scanner",e.SessionToken="SessionToken",e.Share="Share",e.TitleBar="TitleBar",e.Toast="Toast",e.MarketingExternalActivityTopBar="MarketingExternalActivityTopBar",e.WebVitals="WebVitals"}(t.Group||(t.Group={})),function(e){e.Button="Button",e.ButtonGroup="ButtonGroup"}(t.ComponentType||(t.ComponentType={}))},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?this.subscriptions[r].unsubscribe():r=void 0,this.group=t,this.subgroups=n,Object.assign(a,{subgroups:this.subgroups}),this.subscribe(o,i,a,r)},e.prototype.error=function(e){var t=this,n=[];return d.forEachInEnum(p.Action,(function(r){n.push(t.subscriptions.length),t.subscribe(r,e)})),function(){n.map((function(e){return t.subscriptions[e]})).forEach((function(e){s.removeFromCollection(t.subscriptions,e,(function(e){e.unsubscribe()}))}))}},e.prototype.subscribe=function(e,t,n,r){var o,a=this,u=n||this.component,c=e.toUpperCase(),s="number"==typeof r?t:t.bind(this);o=p.isErrorEventName(e)?d.getEventNameSpace(f.Group.Error,e,i(i({},u),{type:""})):d.getEventNameSpace(this.group,e,u);var l=this.app.subscribe(o,s,n?n.id:this.id),h={eventType:c,unsubscribe:l,callback:s,component:u,updateSubscribe:function(e,t){return a.updateSubscription(h,e,t)}};return"number"==typeof r&&r>=0&&r=0?this.children[t]:void 0},t.prototype.getChildIndex=function(e){return this.children.findIndex((function(t){return t.id===e}))},t.prototype.getChildSubscriptions=function(e,t){return this.subscriptions.filter((function(n){return n.component.id===e&&(!t||t===n.eventType)}))},t.prototype.addChild=function(e,n,r){var o=this,i=e.subscriptions;return this.getChild(e.id)||this.children.push(e),!i||n===e.group&&r===e.subgroups||(i.forEach((function(e){(0,e.updateSubscribe)(n,r)})),Object.assign(e,{group:n,subgroups:r}),e instanceof t&&e.children.forEach((function(e){return o.addChild(e,n,r)}))),this},t.prototype.removeChild=function(e){var t=this;return s.removeFromCollection(this.children,this.getChild(e),(function(){t.subscriptions.filter((function(t){return t.component.id===e})).forEach((function(e){s.removeFromCollection(t.subscriptions,e,(function(e){e.unsubscribe()}))}))})),this},t.prototype.subscribeToChild=function(e,t,n){var r=this,o=n.bind(this);if(t instanceof Array)return t.forEach((function(t){return r.subscribeToChild(e,t,n)})),this;if("string"!=typeof t)return this;var i=t.toUpperCase(),a=this.getChildSubscriptions(e.id,i);if(a.length>0)a.forEach((function(t){return t.updateSubscribe(r.group,e.subgroups)}));else{var u={id:e.id,subgroups:e.subgroups,type:e.type};this.subscribe(i,o,u)}return this},t.prototype.getUpdatedChildActions=function(e,t){if(0!==e.length){for(var n=e.filter((function(e,t,n){return t===n.indexOf(e)})),r=n.map((function(e){return e.id})),o=t.filter((function(e){return r.indexOf(e.id)<0}));o.length>0;){if(!(i=o.pop()))break;this.removeChild(i.id)}return n}for(;t.length>0;){var i;if(!(i=t.pop()))break;this.removeChild(i.id)}},t}(h);function b(e,t,n){void 0===n&&(n=!1),e.forEach((function(e){n?(0,e.updateSubscribe)(t,[]):(0,e.unsubscribe)()})),n||(e.length=0)}t.ActionSetWithChildren=y,t.unsubscribeActions=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPackageName=t.getVersion=t.getMergedProps=t.updateActionFromPayload=t.isValidOptionalString=t.isValidOptionalNumber=t.NonSnakeCaseGroup=t.getEventNameSpace=t.forEachInEnum=t.findMatchInEnum=t.actionWrapper=void 0;var r=n(0);Object.defineProperty(t,"actionWrapper",{enumerable:!0,get:function(){return r.actionWrapper}}),Object.defineProperty(t,"findMatchInEnum",{enumerable:!0,get:function(){return r.findMatchInEnum}}),Object.defineProperty(t,"forEachInEnum",{enumerable:!0,get:function(){return r.forEachInEnum}}),Object.defineProperty(t,"getEventNameSpace",{enumerable:!0,get:function(){return r.getEventNameSpace}}),Object.defineProperty(t,"NonSnakeCaseGroup",{enumerable:!0,get:function(){return r.NonSnakeCaseGroup}}),Object.defineProperty(t,"isValidOptionalNumber",{enumerable:!0,get:function(){return r.isValidOptionalNumber}}),Object.defineProperty(t,"isValidOptionalString",{enumerable:!0,get:function(){return r.isValidOptionalString}}),Object.defineProperty(t,"updateActionFromPayload",{enumerable:!0,get:function(){return r.updateActionFromPayload}}),Object.defineProperty(t,"getMergedProps",{enumerable:!0,get:function(){return r.getMergedProps}});var o=n(55);t.getVersion=function(){return o.version},t.getPackageName=function(){return o.name}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionSetPayload=t.ComplexDispatch=t.DispatchAction=t.ClickAction=t.ComponentType=t.ActionSetProps=t.ActionSetOptions=t.Dispatch=t.ErrorCallback=t.UpdateSubscribe=t.ActionSubscription=t.ErrorSubscriber=t.UpdateSubscription=t.ActionSetInterface=t.Component=t.Group=t.ClientInterface=t.SimpleDispatch=t.Unsubscribe=t.MetaAction=t.AnyAction=t.ActionCallback=void 0;var r=n(1);Object.defineProperty(t,"ActionCallback",{enumerable:!0,get:function(){return r.ActionCallback}}),Object.defineProperty(t,"AnyAction",{enumerable:!0,get:function(){return r.AnyAction}}),Object.defineProperty(t,"MetaAction",{enumerable:!0,get:function(){return r.MetaAction}}),Object.defineProperty(t,"Unsubscribe",{enumerable:!0,get:function(){return r.Unsubscribe}}),Object.defineProperty(t,"SimpleDispatch",{enumerable:!0,get:function(){return r.SimpleDispatch}}),Object.defineProperty(t,"ClientInterface",{enumerable:!0,get:function(){return r.ClientInterface}}),Object.defineProperty(t,"Group",{enumerable:!0,get:function(){return r.Group}}),Object.defineProperty(t,"Component",{enumerable:!0,get:function(){return r.Component}}),Object.defineProperty(t,"ActionSetInterface",{enumerable:!0,get:function(){return r.ActionSetInterface}}),Object.defineProperty(t,"UpdateSubscription",{enumerable:!0,get:function(){return r.UpdateSubscription}}),Object.defineProperty(t,"ErrorSubscriber",{enumerable:!0,get:function(){return r.ErrorSubscriber}}),Object.defineProperty(t,"ActionSubscription",{enumerable:!0,get:function(){return r.ActionSubscription}}),Object.defineProperty(t,"UpdateSubscribe",{enumerable:!0,get:function(){return r.UpdateSubscribe}}),Object.defineProperty(t,"ErrorCallback",{enumerable:!0,get:function(){return r.ErrorCallback}}),Object.defineProperty(t,"Dispatch",{enumerable:!0,get:function(){return r.Dispatch}}),Object.defineProperty(t,"ActionSetOptions",{enumerable:!0,get:function(){return r.ActionSetOptions}}),Object.defineProperty(t,"ActionSetProps",{enumerable:!0,get:function(){return r.ActionSetProps}}),Object.defineProperty(t,"ComponentType",{enumerable:!0,get:function(){return r.ComponentType}}),Object.defineProperty(t,"ClickAction",{enumerable:!0,get:function(){return r.ClickAction}}),Object.defineProperty(t,"DispatchAction",{enumerable:!0,get:function(){return r.DispatchAction}}),Object.defineProperty(t,"ComplexDispatch",{enumerable:!0,get:function(){return r.ComplexDispatch}}),Object.defineProperty(t,"ActionSetPayload",{enumerable:!0,get:function(){return r.ActionSetPayload}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.permissionAction=t.isErrorEventName=t.throwError=t.invalidOriginAction=t.fromAction=t.AppBridgeError=t.AppActionType=t.Action=void 0;var r,o=n(1),i=n(0);!function(e){e.INVALID_ACTION="APP::ERROR::INVALID_ACTION",e.INVALID_ACTION_TYPE="APP::ERROR::INVALID_ACTION_TYPE",e.INVALID_PAYLOAD="APP::ERROR::INVALID_PAYLOAD",e.INVALID_OPTIONS="APP::ERROR::INVALID_OPTIONS",e.UNEXPECTED_ACTION="APP::ERROR::UNEXPECTED_ACTION",e.PERSISTENCE="APP::ERROR::PERSISTENCE",e.UNSUPPORTED_OPERATION="APP::ERROR::UNSUPPORTED_OPERATION",e.NETWORK="APP::ERROR::NETWORK",e.PERMISSION="APP::ERROR::PERMISSION",e.FAILED_AUTHENTICATION="APP::ERROR::FAILED_AUTHENTICATION",e.INVALID_ORIGIN="APP::ERROR::INVALID_ORIGIN"}(r=t.Action||(t.Action={})),function(e){e.INVALID_CONFIG="APP::ERROR::INVALID_CONFIG",e.MISSING_CONFIG="APP::APP_ERROR::MISSING_CONFIG",e.MISSING_APP_BRIDGE_MIDDLEWARE="APP::APP_ERROR::MISSING_APP_BRIDGE_MIDDLEWARE",e.WINDOW_UNDEFINED="APP::APP_ERROR::WINDOW_UNDEFINED",e.REDUX_REINSTANTIATED="APP::APP_ERROR::REDUX_REINSTANTIATED",e.MISSING_LOCAL_ORIGIN="APP::APP_ERROR::MISSING_LOCAL_ORIGIN",e.MISSING_HOST_PROVIDER="APP::APP_ERROR::MISSING_HOST_PROVIDER",e.MISSING_ROUTER_CONTEXT="APP::APP_ERROR::MISSING_ROUTER_CONTEXT",e.MISSING_HISTORY_BLOCK="APP::APP_ERROR::MISSING_HISTORY_BLOCK"}(t.AppActionType||(t.AppActionType={}));var a=function(e){this.name="AppBridgeError",this.message=e,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(this.message).stack};function u(e,t,n){var r=new a(e?t+": "+e:t);return r.action=n,r.type=t,r}t.AppBridgeError=a,a.prototype=Object.create(Error.prototype),t.fromAction=u,t.invalidOriginAction=function(e){return i.actionWrapper({group:o.Group.Error,payload:{message:e,type:r.INVALID_ORIGIN},type:r.INVALID_ORIGIN})},t.throwError=function(){for(var e=[],t=0;t0&&void 0!==t.label},t.isGroupedButtonPayload=function(e){var t=e;return Array.isArray(t.buttons)&&"string"==typeof t.id&&"string"==typeof t.label};var l=function(e){function t(t,n){var r=e.call(this,t,p.ComponentType.ButtonGroup,p.Group.ButtonGroup)||this;return r.disabled=!1,r.plain=!1,r.buttonsOptions=[],r.buttons=[],r.set(n,!1),r}return o(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return{buttons:this.buttonsOptions,disabled:this.disabled,label:this.label,plain:this.plain}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"payload",{get:function(){return i(i({},this.options),{buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),t.prototype.set=function(e,t){void 0===t&&(t=!0);var n=c.getMergedProps(this.options,e),r=n.label,o=n.disabled,i=n.buttons,u=n.plain;return this.label=r,this.disabled=Boolean(o),this.buttons=this.getButtons(i),this.plain=Boolean(u),t&&this.dispatch(a.UPDATE),this},t.prototype.dispatch=function(e){switch(e){case a.UPDATE:var t=f(this.group,this.component,this.payload);this.app.dispatch(t)}return this},t.prototype.updateButtons=function(e){if(this.buttons&&0!==this.buttons.length){for(var t,n=0,r=this.buttons;n=0&&(e.splice(r,1),n&&n(t),!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.removeFromCollection=t.addAndRemoveFromCollection=void 0,t.addAndRemoveFromCollection=function(e,t,n){return e.push(t),function(){return r(e,t,n)}},t.removeFromCollection=r},function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.isUnframed=t.isClient=t.isServer=void 0,t.isServer="undefined"==typeof window,t.isClient=!t.isServer,t.isUnframed=t.isClient&&(null===(o=null===(r=window.navigator)||void 0===r?void 0:r.userAgent)||void 0===o?void 0:o.indexOf("Unframed"))>0},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.isDevelopmentClient=t.isProduction=t.isDevelopment=t.isUnframed=t.isServer=t.isClient=void 0;var r=n(15),o=n(15);Object.defineProperty(t,"isClient",{enumerable:!0,get:function(){return o.isClient}}),Object.defineProperty(t,"isServer",{enumerable:!0,get:function(){return o.isServer}}),Object.defineProperty(t,"isUnframed",{enumerable:!0,get:function(){return o.isUnframed}}),t.isDevelopment=void 0!==e&&e.env&&!1,t.isProduction=!t.isDevelopment,t.isDevelopmentClient=t.isDevelopment&&r.isClient}).call(this,n(59))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isShopifyPing=t.isShopifyPOS=t.isShopifyMobile=t.isShopifyEmbedded=t.isMobile=void 0;var r=n(16);function o(){return"undefined"!=typeof navigator&&navigator.userAgent.indexOf("Shopify Mobile")>=0}function i(){return"undefined"!=typeof navigator&&navigator.userAgent.indexOf("Shopify POS")>=0}function a(){return"undefined"!=typeof navigator&&navigator.userAgent.indexOf("Shopify Ping")>=0}t.isMobile=function(){return o()||i()||a()},t.isShopifyEmbedded=function(){return r.isClient&&window.top!==window.self||r.isUnframed},t.isShopifyMobile=o,t.isShopifyPOS=i,t.isShopifyPing=a},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1] + * @license MIT + */ +var r=n(111),o=n(112),i=n(113);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return x(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return j(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function P(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:A(e,t,n,r,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):A(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function A(e,t,n,r,o){var i,a=1,u=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,u/=2,c/=2,n/=2}function s(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var p=-1;for(i=n;iu&&(n=u-c),i=n;i>=0;i--){for(var f=!0,l=0;lo&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function S(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:s>223?3:s>191?2:1;if(o+f<=n)switch(f){case 1:s<128&&(p=s);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&s)<<6|63&i)>127&&(p=c);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(c=(15&s)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(p=c);break;case 4:i=e[o+1],a=e[o+2],u=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(c=(15&s)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(p=c)}null===p?(p=65533,f=1):p>65535&&(p-=65536,r.push(p>>>10&1023|55296),p=56320|1023&p),r.push(p),o+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,r,o){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),u=Math.min(i,a),s=this.slice(r,o),p=e.slice(t,n),f=0;fo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return O(this,e,t,n);case"ascii":return m(this,e,t,n);case"latin1":case"binary":return v(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function j(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function w(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function D(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function N(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(e,t,n,r,i){return i||N(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,i){return i||N(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUInt8=function(e,t){return t||M(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||M(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||M(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||M(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||M(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||M(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||M(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||M(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||M(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||w(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||w(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||w(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||w(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||w(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||w(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);w(this,e,t,n,o-1,-o)}var i=0,a=1,u=0;for(this[t]=255&e;++i>0)-u&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);w(this,e,t,n,o-1,-o)}var i=n-1,a=1,u=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/a>>0)-u&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||w(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||w(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||w(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||w(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||w(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function x(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(110))},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1)for(var n=1;n=0?r="back-forward-cache":n&&(r=document.prerendering||f()>0?"prerender":document.wasDiscarded?"restore":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},d=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},h=function(e,t,n,r){var o,i;return function(a){t.value>=0&&(a||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},y=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},b=function(e){var t=function(t){"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},P=function(e){var t=!1;return function(n){t||(e(n),t=!0)}},A=-1,g=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},O=function(e){"hidden"===document.visibilityState&&A>-1&&(A="visibilitychange"===e.type?e.timeStamp:0,v())},m=function(){addEventListener("visibilitychange",O,!0),addEventListener("prerenderingchange",O,!0)},v=function(){removeEventListener("visibilitychange",O,!0),removeEventListener("prerenderingchange",O,!0)},_=function(){return A<0&&(A=g(),m(),s((function(){setTimeout((function(){A=g(),m()}),0)}))),{get firstHiddenTime(){return A}}},E=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},T=function(e,t){t=t||{},E((function(){var n,r=[1800,3e3],o=_(),i=l("FCP"),a=d("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(a.disconnect(),e.startTimeo.value&&(o.value=i,o.entries=a,n())},c=d("layout-shift",u);c&&(n=h(e,o,r,t.reportAllChanges),b((function(){u(c.takeRecords()),n(!0)})),s((function(){i=0,o=l("CLS",0),n=h(e,o,r,t.reportAllChanges),y((function(){return n()}))})),setTimeout(n,0))})))},j={passive:!0,capture:!0},C=new Date,R=function(e,t){r||(r=t,o=e,i=new Date,w(removeEventListener),I())},I=function(){if(o>=0&&o1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){R(e,t),o()},r=function(){o()},o=function(){removeEventListener("pointerup",n,j),removeEventListener("pointercancel",r,j)};addEventListener("pointerup",n,j),addEventListener("pointercancel",r,j)}(t,e):R(t,e)}},w=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,M,j)}))},L=function(e,t){t=t||{},E((function(){var n,i=[100,300],u=_(),c=l("FID"),p=function(e){e.startTimet.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};W[r.id]=r,V.push(r)}V.sort((function(e,t){return t.latency-e.latency})),V.splice(10).forEach((function(e){delete W[e.id]}))}},Y=function(e,t){t=t||{},E((function(){var n=[200,500];G();var r,o=l("INP"),i=function(e){e.forEach((function(e){e.interactionId&&H(e),"first-input"===e.entryType&&!V.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&H(e)}));var t,n=(t=Math.min(V.length-1,Math.floor(x()/50)),V[t]);n&&n.latency!==o.value&&(o.value=n.latency,o.entries=n.entries,r())},a=d("event",i,{durationThreshold:t.durationThreshold||40});r=h(e,o,n,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),b((function(){i(a.takeRecords()),o.value<0&&x()>0&&(o.value=0,o.entries=[]),r(!0)})),s((function(){V=[],F=k(),o=l("INP"),r=h(e,o,n,t.reportAllChanges)})))}))},z={},K=function(e,t){t=t||{},E((function(){var n,r=[2500,4e3],o=_(),i=l("LCP"),a=function(e){var t=e[e.length-1];if(t){var r=Math.max(t.startTime-f(),0);rperformance.now())return;r.value=Math.max(a-f(),0),r.entries=[i],o(!0),s((function(){r=l("TTFB",0),(o=h(e,r,n,t.reportAllChanges))(!0)}))}}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Action=void 0,function(e){e.LARGEST_CONTENTFUL_PAINT="APP::WEB_VITALS::LARGEST_CONTENTFUL_PAINT",e.FIRST_INPUT_DELAY="APP::WEB_VITALS::FIRST_INPUT_DELAY",e.CUMULATIVE_LAYOUT_SHIFT="APP::WEB_VITALS::CUMULATIVE_LAYOUT_SHIFT",e.FIRST_CONTENTFUL_PAINT="APP::WEB_VITALS::FIRST_CONTENTFUL_PAINT",e.TIME_TO_FIRST_BYTE="APP::WEB_VITALS::TIME_TO_FIRST_BYTE",e.INTERACTION_TO_NEXT_PAINT="APP::WEB_VITALS::INTERACTION_TO_NEXT_PAINT"}(t.Action||(t.Action={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleAppPrint=void 0;var r=n(28);function o(){var e;null===(e=r.getWindow())||void 0===e||e.print()}function i(){var e=function(){var e=r.getWindow();if(e&&e.document&&e.document.body){var t=e.document.createElement("input");return t.style.display="none",e.document.body.appendChild(t),t}}();e&&(e.select(),o(),e.remove())}t.handleAppPrint=function(){navigator.userAgent.indexOf("iOS")>=0?i():o()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66),o=function(){function e(){this.map={}}return e.prototype.set=function(e,t){Object.prototype.hasOwnProperty.call(this.map,e)||(this.map[e]=[]);var n={handler:t,remove:function(){}},o=r.addAndRemoveFromCollection(this.map[e],n);return n={handler:t,remove:o},o},e.prototype.get=function(e){var t=this.map[e];return t?t.map((function(e){return e.handler})):void 0},e.prototype.run=function(e,t,n){for(var r=[],o=3;o0?a-4:a;for(n=0;n>16&255,c[p++]=t>>8&255,c[p++]=255&t;2===u&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,c[p++]=255&t);1===u&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,c[p++]=t>>8&255,c[p++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,u=n-o;au?u:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=a.length;u0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function p(e,t,n){for(var o,i,a=[],u=t;u>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +t.read=function(e,t,n,r,o){var i,a,u=8*o-r-1,c=(1<>1,p=-7,f=n?o-1:0,l=n?-1:1,d=e[t+f];for(f+=l,i=d&(1<<-p)-1,d>>=-p,p+=u;p>0;i=256*i+e[t+f],f+=l,p-=8);for(a=i&(1<<-p)-1,i>>=-p,p+=r;p>0;a=256*a+e[t+f],f+=l,p-=8);if(0===i)i=1-s;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=s}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,u,c,s=8*i-o-1,p=(1<>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=p):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?l/c:l*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=p?(u=0,a=p):a+f>=1?(u=(t*c-1)*Math.pow(2,o),a+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&u,d+=h,u/=256,o-=8);for(a=a<0;e[n+d]=255&a,d+=h,a/=256,s-=8);e[n+d-h]|=128*y}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var n=t.length,r=n%4;if(!r)return t;var o=n,i=4-r,a=n+i,u=e.alloc(a);for(u.write(t);i--;)u.write("=",o++);return u.toString()}}).call(this,n(50).Buffer)},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(8);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i.createApp}}),o(n(13),t),o(n(8),t)},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(117),t),o(n(17),t),o(n(118),t),o(n(120),t)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&(o+=o.length>0?i.SEPARATOR:"",a.forEach((function(t,e){o+=""+t.toUpperCase()+(e0?i.SEPARATOR:"")+u.toUpperCase())}return o&&(o+=""+(o.length>0?i.SEPARATOR:"")+n.toUpperCase()),""+i.PREFIX+i.SEPARATOR+o},e.isValidOptionalNumber=function(t){return null==t||"number"==typeof t},e.isValidOptionalString=function(t){return null==t||"string"==typeof t},e.updateActionFromPayload=function(t,e){return t.id===e.id&&(Object.assign(t,p(t,e)),!0)},e.getMergedProps=p,e.forEachInEnum=function(t,e){Object.keys(t).forEach((function(n){e(t[n])}))},e.findMatchInEnum=function(t,e){var n=Object.keys(t).find((function(n){return e===t[n]}));return n?t[n]:void 0},e.NonSnakeCaseGroup=[u.Group.AuthCode,u.Group.Button,u.Group.ButtonGroup,u.Group.Cart,u.Group.Error,u.Group.Features,u.Group.Fullscreen,u.Group.Link,u.Group.Loading,u.Group.Menu,u.Group.Modal,u.Group.Navigation,u.Group.Pos,u.Group.Print,u.Group.ResourcePicker,u.Group.Scanner,u.Group.SessionToken,u.Group.Share,u.Group.TitleBar,u.Group.Toast,u.Group.unstable_Picker]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ComponentType=e.Group=void 0,function(t){t.AuthCode="AuthCode",t.Button="Button",t.ButtonGroup="ButtonGroup",t.Cart="Cart",t.Client="Client",t.ContextualSaveBar="ContextualSaveBar",t.Error="Error",t.Features="Features",t.FeedbackModal="FeedbackModal",t.Fullscreen="Fullscreen",t.LeaveConfirmation="LeaveConfirmation",t.Link="Link",t.Loading="Loading",t.Menu="Menu",t.Modal="Modal",t.Navigation="Navigation",t.Performance="Performance",t.Pos="Pos",t.Print="Print",t.ResourcePicker="Resource_Picker",t.unstable_Picker="unstable_Picker",t.Scanner="Scanner",t.SessionToken="SessionToken",t.Share="Share",t.TitleBar="TitleBar",t.Toast="Toast",t.MarketingExternalActivityTopBar="MarketingExternalActivityTopBar"}(e.Group||(e.Group={})),function(t){t.Button="Button",t.ButtonGroup="ButtonGroup"}(e.ComponentType||(e.ComponentType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throwError=e.fromAction=e.AppBridgeError=e.invalidOriginAction=e.isErrorEventName=e.permissionAction=e.networkAction=e.persistenceAction=e.unsupportedOperationAction=e.unexpectedAction=e.invalidAction=e.invalidActionType=e.invalidPayload=e.Message=e.AppActionType=e.Action=void 0;var r,o=n(0),i=n(1);function a(t,e,n){var r=e.payload;return o.actionWrapper({type:t,group:i.Group.Error,payload:{action:e,message:n,type:t,id:r&&r.id?r.id:void 0}})}!function(t){t.INVALID_ACTION="APP::ERROR::INVALID_ACTION",t.INVALID_ACTION_TYPE="APP::ERROR::INVALID_ACTION_TYPE",t.INVALID_PAYLOAD="APP::ERROR::INVALID_PAYLOAD",t.INVALID_OPTIONS="APP::ERROR::INVALID_OPTIONS",t.UNEXPECTED_ACTION="APP::ERROR::UNEXPECTED_ACTION",t.PERSISTENCE="APP::ERROR::PERSISTENCE",t.UNSUPPORTED_OPERATION="APP::ERROR::UNSUPPORTED_OPERATION",t.NETWORK="APP::ERROR::NETWORK",t.PERMISSION="APP::ERROR::PERMISSION",t.FAILED_AUTHENTICATION="APP::ERROR::FAILED_AUTHENTICATION",t.INVALID_ORIGIN="APP::ERROR::INVALID_ORIGIN"}(r=e.Action||(e.Action={})),function(t){t.INVALID_CONFIG="APP::ERROR::INVALID_CONFIG",t.MISSING_CONFIG="APP::APP_ERROR::MISSING_CONFIG",t.MISSING_APP_BRIDGE_MIDDLEWARE="APP::APP_ERROR::MISSING_APP_BRIDGE_MIDDLEWARE",t.WINDOW_UNDEFINED="APP::APP_ERROR::WINDOW_UNDEFINED",t.REDUX_REINSTANTIATED="APP::APP_ERROR::REDUX_REINSTANTIATED",t.MISSING_LOCAL_ORIGIN="APP::APP_ERROR::MISSING_LOCAL_ORIGIN",t.MISSING_HOST_PROVIDER="APP::APP_ERROR::MISSING_HOST_PROVIDER",t.MISSING_ROUTER_CONTEXT="APP::APP_ERROR::MISSING_ROUTER_CONTEXT",t.MISSING_HISTORY_BLOCK="APP::APP_ERROR::MISSING_HISTORY_BLOCK"}(e.AppActionType||(e.AppActionType={})),function(t){t.MISSING_PAYLOAD="Missing payload",t.INVALID_PAYLOAD_ID="Id in payload is missing or invalid"}(e.Message||(e.Message={})),e.invalidPayload=function(t,e){return a(r.INVALID_PAYLOAD,t,e||"The action's payload is missing required properties or has invalid properties")},e.invalidActionType=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action type is invalid or unsupported",type:r.INVALID_ACTION_TYPE},type:r.INVALID_ACTION_TYPE})},e.invalidAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"The action's has missing/invalid values for `group`, `type` or `version`",type:r.INVALID_ACTION},type:r.INVALID_ACTION})},e.unexpectedAction=function(t,e){return o.actionWrapper({group:i.Group.Error,payload:{action:t,message:e||"Action cannot be called at this time",type:r.UNEXPECTED_ACTION},type:r.UNEXPECTED_ACTION})},e.unsupportedOperationAction=function(t,e){return a(r.UNSUPPORTED_OPERATION,t,e||"The action type is unsupported")},e.persistenceAction=function(t,e){return a(r.PERSISTENCE,t,e||"Action cannot be persisted on server")},e.networkAction=function(t,e){return a(r.NETWORK,t,e||"Network error")},e.permissionAction=function(t,e){return a(r.PERMISSION,t,e||"Action is not permitted")},e.isErrorEventName=function(t){return"string"==typeof o.findMatchInEnum(r,t)},e.invalidOriginAction=function(t){return o.actionWrapper({group:i.Group.Error,payload:{message:t,type:r.INVALID_ORIGIN},type:r.INVALID_ORIGIN})};var u=function(t){this.name="AppBridgeError",this.message=t,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(this.message).stack};function s(t,e,n){var r=new u(t?e+": "+t:e);return r.action=n,r.type=e,r}e.AppBridgeError=u,u.prototype=Object.create(Error.prototype),e.fromAction=s,e.throwError=function(){for(var t=[],e=0;e=0?this.subscriptions[r].unsubscribe():r=void 0,this.group=e,this.subgroups=n,Object.assign(a,{subgroups:this.subgroups}),this.subscribe(o,i,a,r)},t.prototype.error=function(t){var e=this,n=[];return d.forEachInEnum(p.Action,(function(r){n.push(e.subscriptions.length),e.subscribe(r,t)})),function(){n.map((function(t){return e.subscriptions[t]})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))}},t.prototype.subscribe=function(t,e,n,r){var o,a=this,u=n||this.component,s=t.toUpperCase(),c="number"==typeof r?e:e.bind(this);o=p.isErrorEventName(t)?d.getEventNameSpace(l.Group.Error,t,i(i({},u),{type:""})):d.getEventNameSpace(this.group,t,u);var f=this.app.subscribe(o,c,n?n.id:this.id),h={eventType:s,unsubscribe:f,callback:c,component:u,updateSubscribe:function(t,e){return a.updateSubscription(h,t,e)}};return"number"==typeof r&&r>=0&&r=0?this.children[e]:void 0},e.prototype.getChildIndex=function(t){return this.children.findIndex((function(e){return e.id===t}))},e.prototype.getChildSubscriptions=function(t,e){return this.subscriptions.filter((function(n){return n.component.id===t&&(!e||e===n.eventType)}))},e.prototype.addChild=function(t,n,r){var o=this,i=t.subscriptions;return this.getChild(t.id)||this.children.push(t),!i||n===t.group&&r===t.subgroups||(i.forEach((function(t){(0,t.updateSubscribe)(n,r)})),Object.assign(t,{group:n,subgroups:r}),t instanceof e&&t.children.forEach((function(t){return o.addChild(t,n,r)}))),this},e.prototype.removeChild=function(t){var e=this;return c.removeFromCollection(this.children,this.getChild(t),(function(){e.subscriptions.filter((function(e){return e.component.id===t})).forEach((function(t){c.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))})),this},e.prototype.subscribeToChild=function(t,e,n){var r=this,o=n.bind(this);if(e instanceof Array)return e.forEach((function(e){return r.subscribeToChild(t,e,n)})),this;if("string"!=typeof e)return this;var i=e.toUpperCase(),a=this.getChildSubscriptions(t.id,i);if(a.length>0)a.forEach((function(e){return e.updateSubscribe(r.group,t.subgroups)}));else{var u={id:t.id,subgroups:t.subgroups,type:t.type};this.subscribe(i,o,u)}return this},e.prototype.getUpdatedChildActions=function(t,e){if(0!==t.length){for(var n=t.filter((function(t,e,n){return e===n.indexOf(t)})),r=n.map((function(t){return t.id})),o=e.filter((function(t){return r.indexOf(t.id)<0}));o.length>0;){if(!(i=o.pop()))break;this.removeChild(i.id)}return n}for(;e.length>0;){var i;if(!(i=e.pop()))break;this.removeChild(i.id)}},e}(h);function b(t,e,n){void 0===n&&(n=!1),t.forEach((function(t){n?(0,t.updateSubscribe)(e,[]):(0,t.unsubscribe)()})),n||(t.length=0)}e.ActionSetWithChildren=y},function(t,e,n){"use strict";function r(t,e,n){var r=t.findIndex((function(t){return t===e}));return r>=0&&(t.splice(r,1),n&&n(e),!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.removeFromCollection=e.addAndRemoveFromCollection=void 0,e.addAndRemoveFromCollection=function(t,e,n){return t.push(e),function(){return r(t,e,n)}},e.removeFromCollection=r},function(t,e,n){"use strict";function r(t){return Array.from(t).map((function(t){return("00"+t.toString(16)).slice(-2)})).join("")}function o(t){if("function"==typeof Uint8Array&&"object"==typeof window&&window.crypto){var e=new Uint8Array(t),n=window.crypto.getRandomValues(e);if(n)return n}return Array.from(new Array(t),(function(){return 255*Math.random()|0}))}function i(){var t=o(1),e=o(2);return t[0]&=191,e[0]&=79,[r(o(4)),"-",r(o(2)),"-",r(e),"-",r(t),r(o(1)),"-",r(o(6))].join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=void 0,e.generateUuid=i,e.default=i},function(t,e,n){"use strict";(function(t){var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.isUnframed=e.isDevelopmentClient=e.isProduction=e.isDevelopment=e.isClient=e.isServer=void 0,e.isServer="undefined"==typeof window,e.isClient=!e.isServer,e.isDevelopment=void 0!==t&&t.env&&!1,e.isProduction=!e.isDevelopment,e.isDevelopmentClient=e.isDevelopment&&e.isClient,e.isUnframed=e.isClient&&(null===(r=null===(n=window.navigator)||void 0===n?void 0:n.userAgent)||void 0===r?void 0:r.indexOf("Unframed"))>0}).call(this,n(22))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isShopifyPing=e.isShopifyPOS=e.isShopifyMobile=e.isShopifyEmbedded=e.isMobile=void 0;var r=n(9);function o(){return"undefined"!=typeof navigator&&navigator.userAgent.indexOf("Shopify Mobile")>=0}function i(){return"undefined"!=typeof navigator&&navigator.userAgent.indexOf("Shopify POS")>=0}function a(){return"undefined"!=typeof navigator&&navigator.userAgent.indexOf("Shopify Ping")>=0}e.isMobile=function(){return o()||i()||a()},e.isShopifyEmbedded=function(){return r.isClient&&window.top!==window.self||r.isUnframed},e.isShopifyMobile=o,e.isShopifyPOS=i,e.isShopifyPing=a},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function u(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},u=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1] \'./\'+f).join(\' \')\\" | xargs rm -rf","pack":"yarn pack","size":"size-limit"},"sideEffects":false,"size-limit":[{"limit":"17 KB","path":"production.js"}],"dependencies":{"base64url":"^3.0.1"},"devDependencies":{"@types/node":"^10.12.5","shx":"^0.3.3"}}')},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createTransportListener=e.fromWindow=e.fromFrame=e.Context=void 0;var r=n(2),o=n(21),i=n(3),a=n(7),u=n(9);!function(t){t.Modal="Modal",t.Main="Main"}(e.Context||(e.Context={})),e.fromFrame=function(t,e,n){var i=[],s=t.host,c=t.window;if(!s)throw r.fromAction("App frame is undefined",r.AppActionType.WINDOW_UNDEFINED);return u.isUnframed&&window.MobileWebView&&Object.assign(window.MobileWebView,{postMessageToIframe:function(t,e){null==c||c.postMessage(t,e),function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&"dispatch"===t.type&&"object"==typeof t.payload}(t)&&s.postMessage(JSON.stringify(t.payload),location.origin)},updateIframeUrl:function(n){var r=window.location,o=(t.window||{}).location;try{new URL(n).origin===e&&o?o.replace(n):r.href=n}catch(t){}}}),s.addEventListener("message",(function(t){if(t.source!==s&&o.isAppMessage(t))if(t.origin===e)if(u.isUnframed&&window.MobileWebView){p=JSON.stringify({id:"unframed://fromClient",origin:e,data:t.data});window.MobileWebView.postMessage(p)}else for(var n=0,a=i;n1)for(var n=1;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1] { const sandbox = sinon.createSandbox(); const url = '/settings'; + const originalAppBridge = window['app-bridge']; setup(() => { window['app-bridge'] = { @@ -26,6 +27,7 @@ suite('appBridgeRedirect', () => { teardown(() => { sandbox.restore(); delete window['app-bridge']; + window['app-bridge'] = originalAppBridge; }); @@ -62,4 +64,4 @@ suite('appBridgeRedirect', () => { normalizedUrl ); }); -}); \ No newline at end of file +});