shopify_app 18.0.0 → 18.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7da18fdd3924eb35146d7ca4dbd928567e377757d0f3cc11c72ef6aa732e1cec
4
- data.tar.gz: 5e90219d351aab20f23e247c28d63626ecbd1a26f960157a2e91221940b09b5f
3
+ metadata.gz: e0945fed22675681ffec4e7818341d42ad7d62ebe6b9309a8132f65c5a954e37
4
+ data.tar.gz: 51c7ec2c5e1c43b06fc2dc67b57418b24197b0bf98a252b6940980614daa5a79
5
5
  SHA512:
6
- metadata.gz: f29dcc0b4504248d2811d9d61be42fa03f2a161eb16f79dde1b044db71e6f2697847dabb80563cb1cd21cdcc3979b1eb147d6ff07e4a51baad571a8830ed4969
7
- data.tar.gz: a2138081a6942f4418cf3efb72f63ed61a3de162686c2e3d1b9316ed7f292c0adf8fa5e248b8a5396504096d561248427de32a36b87d1f84bb6901fd9efca661
6
+ metadata.gz: 07b2adbc4b9c44023a6fed8ffaa358f07b463d9713d9825803d356184d1d2392194f71adf239371b9311e67326336b8de9f5b7fc9778c15e2f38c2d2903a2357
7
+ data.tar.gz: e4771d9ef9a4c337c6a1902be6a4d04ac859cd0a446f641d40ec66813464aa4b329defa75d1349017bfad040f355d3a27e67be89807fbc9da33399fa0221e56d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
- Unreleased
1
+ 18.0.4 (Jan 27, 2022)
2
2
  ----------
3
+ * Use App Bridge client for redirect [#1247](https://github.com/Shopify/shopify_app/pull/1247)
4
+ * Replaces deprecated EASDK with App Bridge when redirecting out of an embedded iframe.
5
+
6
+ 18.0.3 (Jan 7, 2022)
7
+ ----------
8
+ * Change regexp to match standard ngrok URLs. [#1311](https://github.com/Shopify/shopify_app/pull/1311)
9
+ * Make `EnsureAuthenticatedLinks` compatible with AppBridge 2.0. [#1277](https://github.com/Shopify/shopify_app/pull/1277)
10
+ * Includes the `host` parameter when redirecting to the splash page in an unauthenticated state.
11
+
12
+ 18.0.2 (Jun 15, 2021)
13
+ ----------
14
+ * Added careers link to readme. [#1274](https://github.com/Shopify/shopify_app/pull/1274)
15
+
16
+ 18.0.1 (May 7, 2021)
17
+ ----------
18
+ * Fix bug causing OAuth flow to fail due to CSP violation. [#1265](https://github.com/Shopify/shopify_app/pull/1265)
3
19
 
4
20
  18.0.0 (May 3, 2021)
5
21
  ----------
data/CONTRIBUTING.md CHANGED
@@ -73,4 +73,9 @@ Please follow these steps to have your contribution considered by the maintainer
73
73
  <summary>What if the status checks are failing?</summary>
74
74
 
75
75
  While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
76
- </details>
76
+ </details>
77
+
78
+ ### App Bridge client
79
+
80
+ This gem ships with a UMD version of the App Bridge client. It lives inside the assets folder: `app/assets/javascripts/shopify_app/`. To update the client, simply download the UMD build from [unpkg.com](https://unpkg.com/@shopify/app-bridge) and save it into the folder.
81
+ Please follow the convention of including the client version number in the filename. Finally, change the reference to the new App Bridge client inside `app/assets/javascripts/shopify_app/app_bridge_redirect.js`.
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_app (18.0.0)
5
- browser_sniffer (~> 1.2.2)
4
+ shopify_app (18.0.4)
5
+ browser_sniffer (~> 1.4.0)
6
6
  jwt (>= 2.2.3)
7
7
  omniauth-rails_csrf_protection
8
8
  omniauth-shopify-oauth2 (~> 2.3)
@@ -80,12 +80,12 @@ GEM
80
80
  minitest (>= 5.1)
81
81
  tzinfo (~> 2.0)
82
82
  zeitwerk (~> 2.3)
83
- addressable (2.7.0)
83
+ addressable (2.8.0)
84
84
  public_suffix (>= 2.0.2, < 5.0)
85
85
  ast (2.4.1)
86
86
  binding_of_caller (0.8.0)
87
87
  debug_inspector (>= 0.0.1)
88
- browser_sniffer (1.2.2)
88
+ browser_sniffer (1.4.0)
89
89
  builder (3.2.4)
90
90
  byebug (11.1.3)
91
91
  coderay (1.1.3)
@@ -94,32 +94,46 @@ GEM
94
94
  crass (1.0.6)
95
95
  debug_inspector (0.0.3)
96
96
  erubi (1.10.0)
97
- faraday (1.4.1)
97
+ faraday (1.9.3)
98
+ faraday-em_http (~> 1.0)
99
+ faraday-em_synchrony (~> 1.0)
98
100
  faraday-excon (~> 1.1)
101
+ faraday-httpclient (~> 1.0)
102
+ faraday-multipart (~> 1.0)
99
103
  faraday-net_http (~> 1.0)
100
- faraday-net_http_persistent (~> 1.1)
101
- multipart-post (>= 1.2, < 3)
104
+ faraday-net_http_persistent (~> 1.0)
105
+ faraday-patron (~> 1.0)
106
+ faraday-rack (~> 1.0)
107
+ faraday-retry (~> 1.0)
102
108
  ruby2_keywords (>= 0.0.4)
109
+ faraday-em_http (1.0.0)
110
+ faraday-em_synchrony (1.0.0)
103
111
  faraday-excon (1.1.0)
112
+ faraday-httpclient (1.0.1)
113
+ faraday-multipart (1.0.2)
114
+ multipart-post (>= 1.2, < 3)
104
115
  faraday-net_http (1.0.1)
105
- faraday-net_http_persistent (1.1.0)
106
- globalid (0.4.2)
107
- activesupport (>= 4.2.0)
108
- graphql (1.12.8)
109
- graphql-client (0.16.0)
116
+ faraday-net_http_persistent (1.2.0)
117
+ faraday-patron (1.0.0)
118
+ faraday-rack (1.0.0)
119
+ faraday-retry (1.0.3)
120
+ globalid (1.0.0)
121
+ activesupport (>= 5.0)
122
+ graphql (1.13.4)
123
+ graphql-client (0.17.0)
110
124
  activesupport (>= 3.0)
111
- graphql (~> 1.8)
125
+ graphql (~> 1.10)
112
126
  hashdiff (1.0.1)
113
- hashie (4.1.0)
127
+ hashie (5.0.0)
114
128
  i18n (1.8.9)
115
129
  concurrent-ruby (~> 1.0)
116
- jwt (2.2.3)
130
+ jwt (2.3.0)
117
131
  loofah (2.9.0)
118
132
  crass (~> 1.0.2)
119
133
  nokogiri (>= 1.5.9)
120
134
  mail (2.7.1)
121
135
  mini_mime (>= 0.1.1)
122
- marcel (1.0.1)
136
+ marcel (1.0.2)
123
137
  method_source (0.9.2)
124
138
  mini_mime (1.0.3)
125
139
  mini_portile2 (2.5.0)
@@ -128,7 +142,7 @@ GEM
128
142
  multi_json (1.15.0)
129
143
  multi_xml (0.6.0)
130
144
  multipart-post (2.1.1)
131
- nio4r (2.5.7)
145
+ nio4r (2.5.8)
132
146
  nokogiri (1.11.2)
133
147
  mini_portile2 (~> 2.5.0)
134
148
  racc (~> 1.4)
@@ -142,7 +156,7 @@ GEM
142
156
  hashie (>= 3.4.6)
143
157
  rack (>= 1.6.2, < 3)
144
158
  rack-protection
145
- omniauth-oauth2 (1.7.1)
159
+ omniauth-oauth2 (1.7.2)
146
160
  oauth2 (~> 1.4)
147
161
  omniauth (>= 1.9, < 3)
148
162
  omniauth-rails_csrf_protection (1.0.0)
@@ -220,20 +234,21 @@ GEM
220
234
  rubocop-shopify (1.0.7)
221
235
  rubocop (~> 1.4)
222
236
  ruby-progressbar (1.10.1)
223
- ruby2_keywords (0.0.4)
224
- shopify_api (9.4.1)
237
+ ruby2_keywords (0.0.5)
238
+ shopify_api (9.5)
225
239
  activeresource (>= 4.1.0, < 6.0.0)
226
240
  graphql-client
227
241
  rack
242
+ webrick
228
243
  sprockets (4.0.2)
229
244
  concurrent-ruby (~> 1.0)
230
245
  rack (> 1, < 3)
231
- sprockets-rails (3.2.2)
232
- actionpack (>= 4.0)
233
- activesupport (>= 4.0)
246
+ sprockets-rails (3.4.2)
247
+ actionpack (>= 5.2)
248
+ activesupport (>= 5.2)
234
249
  sprockets (>= 3.0.0)
235
250
  sqlite3 (1.4.2)
236
- thor (1.1.0)
251
+ thor (1.2.1)
237
252
  tzinfo (2.0.4)
238
253
  concurrent-ruby (~> 1.0)
239
254
  unicode-display_width (1.7.0)
@@ -241,7 +256,8 @@ GEM
241
256
  addressable (>= 2.3.6)
242
257
  crack (>= 0.3.2)
243
258
  hashdiff (>= 0.4.0, < 2.0.0)
244
- websocket-driver (0.7.3)
259
+ webrick (1.7.0)
260
+ websocket-driver (0.7.5)
245
261
  websocket-extensions (>= 0.1.0)
246
262
  websocket-extensions (0.1.5)
247
263
  zeitwerk (2.4.2)
@@ -265,4 +281,4 @@ DEPENDENCIES
265
281
  webmock
266
282
 
267
283
  BUNDLED WITH
268
- 2.1.4
284
+ 2.2.29
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Shopify App
2
2
 
3
+ **Shopify is doubling our engineering staff in 2021! [Join our team and work on libraries like this one.](https://smrtr.io/5GGrK)**
4
+
3
5
  [![Version][gem]][gem_url] [![Build Status](https://github.com/Shopify/shopify_app/workflows/CI/badge.svg)](https://github.com/Shopify/shopify_app/actions?query=workflow%3ACI) ![Supported Rails version][supported_rails_version]
4
6
 
5
7
  [gem]: https://img.shields.io/gem/v/shopify_app.svg
@@ -23,7 +25,6 @@ This gem includes a Rails engine, generators, modules, and mixins that help crea
23
25
  ## Requirements
24
26
 
25
27
  > **Rails compatibility**
26
- > * Rails 6.1 or above is not yet supported due to the new `cookies_same_site_protection` setting.
27
28
  > * Use Shopify App `<= v7.2.8` if you need to work with Rails 4.
28
29
 
29
30
  To become a Shopify app developer, you will need a [Shopify Partners](https://www.shopify.com/partners) account. Explore the [Shopify dev docs](https://shopify.dev/concepts/shopify-introduction) to learn more about [building Shopify apps](https://shopify.dev/concepts/apps).
@@ -0,0 +1 @@
1
+ !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 n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=34)}([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.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.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";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},c=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),r=0;for(e=0;e<n;e++)for(var i=arguments[e],c=0,a=i.length;c<a;c++,r++)o[r]=i[c];return o},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NonSnakeCaseGroup=e.findMatchInEnum=e.forEachInEnum=e.getMergedProps=e.updateActionFromPayload=e.ActionSetWithChildren=e.ActionSet=e.isValidOptionalString=e.isValidOptionalNumber=e.getEventNameSpace=e.getVersion=e.actionWrapper=void 0;var s=n(2),u=n(7),p=n(3),d=n(16),f=a(n(39)),h=n(0),l=a(n(40)),A=n(41);function y(){return A.version}function P(t,n,o){var r=function(t){if(e.NonSnakeCaseGroup.includes(t))return t.toUpperCase();return(n=t,n.replace(/([A-Z])/g,(function(t,e,n){return(0!==n?"_":"")+t[0].toLowerCase()}))).toUpperCase();var n}(t);if(o){var i=o.subgroups,c=o.type;i&&i.length>0&&(r+=r.length>0?d.SEPARATOR:"",i.forEach((function(t,e){r+=""+t.toUpperCase()+(e<i.length-1?d.SEPARATOR:"")}))),c!==t&&c&&(r+=""+(r.length>0?d.SEPARATOR:"")+c.toUpperCase())}return r&&(r+=""+(r.length>0?d.SEPARATOR:"")+n.toUpperCase()),""+d.PREFIX+d.SEPARATOR+r}e.actionWrapper=function(t){return i(i({},t),{version:y(),clientInterface:{name:A.name,version:y()}})},e.getVersion=y,e.getEventNameSpace=P,e.isValidOptionalNumber=function(t){return null==t||"number"==typeof t},e.isValidOptionalString=function(t){return null==t||"string"==typeof t};var E=function(){function t(t,e,n,o){var r=this;this.app=t,this.type=e,this.group=n,this.subgroups=[],this.subscriptions=[],t||p.throwError(p.ActionType.INVALID_OPTIONS,"Missing required `app`"),this.id=o||l.default(),this.defaultGroup=n;var i=this.set;this.set=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return r.app.hooks?(t=r.app.hooks).run.apply(t,c([s.LifecycleHook.UpdateAction,i,r],e)):i.apply(r,e)}}return t.prototype.set=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},Object.defineProperty(t.prototype,"component",{get:function(){return{id:this.id,subgroups:this.subgroups,type:this.type}},enumerable:!1,configurable:!0}),t.prototype.updateSubscription=function(t,e,n){var o,r=t.eventType,i=t.callback,c=t.component;return(o=this.subscriptions.findIndex((function(e){return e===t})))>=0?this.subscriptions[o].unsubscribe():o=void 0,this.group=e,this.subgroups=n,Object.assign(c,{subgroups:this.subgroups}),this.subscribe(r,i,c,o)},t.prototype.error=function(t){var e=this,n=[];return v(p.Action,(function(o){n.push(e.subscriptions.length),e.subscribe(o,t)})),function(){n.map((function(t){return e.subscriptions[t]})).forEach((function(t){u.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))}},t.prototype.subscribe=function(t,e,n,o){var r,c=this,a=n||this.component,s=t.toUpperCase(),u="number"==typeof o?e:e.bind(this);r=p.isErrorEventName(t)?P(h.Group.Error,t,i(i({},a),{type:""})):P(this.group,t,a);var d=this.app.subscribe(r,u,n?n.id:this.id),f={eventType:s,unsubscribe:d,callback:u,component:a,updateSubscribe:function(t,e){return c.updateSubscription.call(c,f,t,e)}};return"number"==typeof o&&o>=0&&o<this.subscriptions.length?this.subscriptions[o]=f:this.subscriptions.push(f),d},t.prototype.unsubscribe=function(t){return void 0===t&&(t=!1),_(this.subscriptions,this.defaultGroup,t),this},t}();e.ActionSet=E;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=[],e}return r(e,t),e.prototype.unsubscribe=function(t,n){return void 0===t&&(t=!0),void 0===n&&(n=!1),_(this.subscriptions,this.defaultGroup,n),this.children.forEach((function(n){e.prototype.isPrototypeOf(n)?n.unsubscribe(t,!t):n.unsubscribe(!t)})),this},e.prototype.getChild=function(t){var e=this.children.findIndex((function(e){return e.id===t}));return e>=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,o){var r=this,i=t.subscriptions;return this.getChild(t.id)||this.children.push(t),!i||n===t.group&&o===t.subgroups||(i.forEach((function(t){(0,t.updateSubscribe)(n,o)})),Object.assign(t,{group:n,subgroups:o}),e.prototype.isPrototypeOf(t)&&t.children.forEach((function(t){return r.addChild(t,n,o)}))),this},e.prototype.removeChild=function(t){var e=this;return u.removeFromCollection(this.children,this.getChild(t),(function(){e.subscriptions.filter((function(e){return e.component.id===t})).forEach((function(t){u.removeFromCollection(e.subscriptions,t,(function(t){t.unsubscribe()}))}))})),this},e.prototype.subscribeToChild=function(t,e,n){var o=this,r=n.bind(this);if(e instanceof Array)return e.forEach((function(e){return o.subscribeToChild(t,e,n)})),this;if("string"!=typeof e)return this;var i=e.toUpperCase(),c=this.getChildSubscriptions(t.id,i);if(c.length>0)c.forEach((function(e){return e.updateSubscribe(o.group,t.subgroups)}));else{var a={id:t.id,subgroups:t.subgroups,type:t.type};this.subscribe(i,r,a)}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)})),o=n.map((function(t){return t.id})),r=e.filter((function(t){return o.indexOf(t.id)<0}));r.length>0;){if(!(i=r.pop()))break;this.removeChild(i.id)}return n}for(;e.length>0;){var i;if(!(i=e.pop()))break;this.removeChild(i.id)}},e}(E);function _(t,e,n){void 0===n&&(n=!1),t.forEach((function(t){n?(0,t.updateSubscribe)(e,[]):(0,t.unsubscribe)()})),n||(t.length=0)}function T(t,e){var n=f.default(t,e);return n||Object.assign(t,e)}function v(t,e){Object.keys(t).forEach((function(n){e(t[n])}))}e.ActionSetWithChildren=O,e.updateActionFromPayload=function(t,e){return t.id===e.id&&(Object.assign(t,T(t,e)),!0)},e.getMergedProps=T,e.forEachInEnum=v,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=[h.Group.AuthCode,h.Group.Button,h.Group.ButtonGroup,h.Group.Cart,h.Group.Error,h.Group.Features,h.Group.Fullscreen,h.Group.Link,h.Group.Loading,h.Group.Menu,h.Group.Modal,h.Group.Navigation,h.Group.Pos,h.Group.Print,h.Group.ResourcePicker,h.Group.Scanner,h.Group.SessionToken,h.Group.Share,h.Group.TitleBar,h.Group.Toast]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Unsubscribe=e.HandlerData=e.Handler=e.Dispatch=e.AnyAction=e.LifecycleHook=e.MessageType=e.PermissionType=void 0;var o=n(0);Object.defineProperty(e,"AnyAction",{enumerable:!0,get:function(){return o.AnyAction}}),Object.defineProperty(e,"Dispatch",{enumerable:!0,get:function(){return o.Dispatch}}),Object.defineProperty(e,"Unsubscribe",{enumerable:!0,get:function(){return o.Unsubscribe}});var r=n(6);Object.defineProperty(e,"Handler",{enumerable:!0,get:function(){return r.Handler}}),Object.defineProperty(e,"HandlerData",{enumerable:!0,get:function(){return r.HandlerData}}),function(t){t.Dispatch="Dispatch",t.Subscribe="Subscribe"}(e.PermissionType||(e.PermissionType={})),function(t){t.GetState="getState",t.Dispatch="dispatch",t.Subscribe="subscribe",t.Unsubscribe="unsubscribe"}(e.MessageType||(e.MessageType={})),function(t){t.UpdateAction="UpdateAction",t.DispatchAction="DispatchAction"}(e.LifecycleHook||(e.LifecycleHook={}))},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(37),e),r(n(14),e)},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(42),e),r(n(18),e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSingleButton=void 0;var o=n(4);e.getSingleButton=function(t,e,n,r){return t.addChild(e,t.group,n),t.subscribeToChild(e,o.Action.UPDATE,r),e.payload}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createTransportListener=e.fromWindow=e.fromFrame=e.Context=void 0;var o=n(3),r=n(15),i=n(2),c=n(7),a=n(17);!function(t){t.Modal="Modal",t.Main="Main"}(e.Context||(e.Context={})),e.fromFrame=function(t,e,n){var i=[];if(void 0===t||!t.ownerDocument||!t.ownerDocument.defaultView)throw o.fromAction("App frame is undefined",o.AppActionType.WINDOW_UNDEFINED);var a=t.ownerDocument.defaultView;return a.addEventListener("message",(function(n){if(r.isAppMessage(n))if(n.origin===e)for(var c=0,a=i;c<a.length;c++){(0,a[c])(n)}else{var s=t.contentWindow;if(s){var u="Message origin '"+n.origin+"' does not match app origin '"+e+"'.",p={type:"dispatch",payload:o.invalidOriginAction(u)};s.postMessage(p,n.origin)}}})),{context:n,localOrigin:e,frameWindow:t.contentWindow,hostFrame:a,dispatch:function(n){var o=t.contentWindow;o&&o.postMessage(n,e)},subscribe:function(t){return c.addAndRemoveFromCollection(i,t)}}},e.fromWindow=function(t,e){var n=[];return void 0!==typeof window&&window.addEventListener("message",(function(e){if((window!==t||a.isFrameless)&&e.source===t&&(r.isAppBridgeAction(e.data.payload)||r.isAppMessage(e)))for(var o=0,i=n;o<i.length;o++){(0,i[o])(e)}})),{localOrigin:e,hostFrame:t,dispatch:function(e){if(e.source&&e.source.shopOrigin)if(a.isFrameless&&window&&window.SmartWebView)window.SmartWebView.handleMessage("frameless://fromClient",JSON.stringify(e));else{var n="https://"+e.source.shopOrigin;t.postMessage(e,n)}},subscribe:function(t){return c.addAndRemoveFromCollection(n,t)}}},e.createTransportListener=function(){var t=[],e={};return{createSubscribeHandler:function(n){return function(){if(arguments.length<2)return c.addAndRemoveFromCollection(t,{callback:arguments[0]});var o=Array.from(arguments),r=o[0],a=o[1],s=o[2],u={callback:a,id:s},p={type:r,id:s};return Object.prototype.hasOwnProperty.call(e,r)||(e[r]=[]),n&&n(i.MessageType.Subscribe,p),c.addAndRemoveFromCollection(e[r],u,(function(){n&&n(i.MessageType.Unsubscribe,p)}))}},handleMessage:function(e){t.forEach((function(t){return t.callback(e)}))},handleActionDispatch:function(t){var n=t.type,o=t.payload,r=!1;if(Object.prototype.hasOwnProperty.call(e,n))for(var i=0,c=e[n];i<c.length;i++){var a=c[i],s=a.id,u=a.callback;!(o&&o.id===s)&&s||(u(o),r=!0)}return r}}}},function(t,e,n){"use strict";function o(t,e,n){var o=t.findIndex((function(t){return t===e}));return o>=0&&(t.splice(o,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 o(t,e,n)}},e.removeFromCollection=o},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(43),e),r(n(19),e)},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(48),e),r(n(10),e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=e.ActionType=void 0,function(t){t.SHOW="APP::TOAST::SHOW",t.CLEAR="APP::TOAST::CLEAR"}(e.ActionType||(e.ActionType={})),function(t){t.SHOW="SHOW",t.CLEAR="CLEAR"}(e.Action||(e.Action={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Size=e.ActionType=e.Action=void 0,function(t){t.OPEN="OPEN",t.CLOSE="CLOSE",t.UPDATE="UPDATE",t.UPDATE_SIZE="UPDATE_SIZE",t.UPDATE_CONTENT="CONTENT::UPDATE",t.DATA="DATA"}(e.Action||(e.Action={})),function(t){t.OPEN="APP::MODAL::OPEN",t.CLOSE="APP::MODAL::CLOSE",t.UPDATE="APP::MODAL::UPDATE",t.UPDATE_CONTENT="APP::MODAL::CONTENT::UPDATE",t.FOOTER_BUTTON_CLICK="APP::MODAL::FOOTER::BUTTON::CLICK",t.FOOTER_BUTTON_UPDATE="APP::MODAL::FOOTER::BUTTON::UPDATE",t.UPDATE_SIZE="APP::MODAL::UPDATE_SIZE",t.DATA="APP::MODAL::DATA"}(e.ActionType||(e.ActionType={})),function(t){t.Small="small",t.Medium="medium",t.Large="large",t.Full="full",t.Auto="auto"}(e.Size||(e.Size={}))},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.AppLink=e.update=e.ActionType=e.Action=void 0;var i,c=n(1),a=n(0),s=n(25);function u(t){return c.actionWrapper({group:a.Group.Link,type:i.UPDATE,payload:t})}!function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.UPDATE="APP::LINK::UPDATE"}(i=e.ActionType||(e.ActionType={})),e.update=u;var p=function(t){function e(e,n){var o=t.call(this,e,a.Group.Link,a.Group.Link)||this;return o.label="",o.destination="",o.set(n,!1),o}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{label:this.label,destination:this.destination,redirectType:s.Action.APP}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){var t=this.options,e=t.label,n=t.destination,o=t.redirectType,r=n;return{id:this.id,label:e,destination:{path:r},redirectType:o}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),o=n.label,r=n.destination;return this.label=o,this.destination=r,e&&this.dispatch(i.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case i.UPDATE:this.app.dispatch(u(this.payload))}return this},e}(c.ActionSet);e.AppLink=p,e.create=function(t,e){return new p(t,e)}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(6),e),r(n(81),e);var i=n(13);Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i.createApp}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AppActionType=e.ActionType=e.Action=void 0,function(t){t.INVALID_ACTION="INVALID_ACTION",t.INVALID_ACTION_TYPE="INVALID_ACTION_TYPE",t.INVALID_OPTIONS="INVALID_OPTIONS",t.INVALID_PAYLOAD="INVALID_PAYLOAD",t.UNEXPECTED_ACTION="UNEXPECTED_ACTION",t.PERSISTENCE="PERSISTENCE",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK="NETWORK",t.PERMISSION="PERMISSION"}(e.Action||(e.Action={})),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"}(e.ActionType||(e.ActionType={})),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.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,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAppMessage=e.isPermitted=e.getPermissionKey=e.isFromApp=e.isAppBridgeAction=void 0;var o=n(2),r=n(16),i=n(1);function c(t){return t.replace(new RegExp("^"+r.PREFIX+r.SEPARATOR+"\\w+"+r.SEPARATOR),"")}e.isAppBridgeAction=function(t){return t instanceof Object&&t.hasOwnProperty("type")&&t.type.toString().startsWith(r.PREFIX)},e.isFromApp=function(t){return"object"==typeof t&&"object"==typeof t.source&&"string"==typeof t.source.apiKey},e.getPermissionKey=c,e.isPermitted=function(t,e,n){var o=e.group,r=e.type;if(!o||!t.hasOwnProperty(o))return!1;var i=t[o];if(!i)return!1;var a=c(r);return!!i[a]&&!0===i[a][n]},e.isAppMessage=function(t){if("object"!=typeof t||!t.data||"object"!=typeof t.data)return!1;var e=t.data;return e.hasOwnProperty("type")&&void 0!==i.findMatchInEnum(o.MessageType,e.type)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SEPARATOR=e.PREFIX=void 0,e.PREFIX="APP",e.SEPARATOR="::"},function(t,e,n){"use strict";(function(t){var n,o;Object.defineProperty(e,"__esModule",{value:!0}),e.isFrameless=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.isFrameless=e.isClient&&(null===(o=null===(n=window.navigator)||void 0===n?void 0:n.userAgent)||void 0===o?void 0:o.indexOf(" Frameless "))>0}).call(this,n(38))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Style=e.Icon=e.ActionType=e.Action=void 0,function(t){t.CLICK="CLICK",t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.CLICK="APP::BUTTON::CLICK",t.UPDATE="APP::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.Print="print"}(e.Icon||(e.Icon={})),function(t){t.Danger="danger"}(e.Style||(e.Style={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ActionType=e.Action=void 0,function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.UPDATE="APP::BUTTONGROUP::UPDATE"}(e.ActionType||(e.ActionType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=e.ActionType=void 0,function(t){t.FETCH="APP::CART::FETCH",t.UPDATE="APP::CART::UPDATE",t.SET_CUSTOMER="APP::CART::SET_CUSTOMER",t.REMOVE_CUSTOMER="APP::CART::REMOVE_CUSTOMER",t.ADD_CUSTOMER_ADDRESS="APP::CART::ADD_CUSTOMER_ADDRESS",t.UPDATE_CUSTOMER_ADDRESS="APP::CART::UPDATE_CUSTOMER_ADDRESS",t.SET_DISCOUNT="APP::CART::SET_DISCOUNT",t.REMOVE_DISCOUNT="APP::CART::REMOVE_DISCOUNT",t.SET_PROPERTIES="APP::CART::SET_PROPERTIES",t.REMOVE_PROPERTIES="APP::CART::REMOVE_PROPERTIES",t.CLEAR="APP::CART::CLEAR",t.ADD_LINE_ITEM="APP::CART::ADD_LINE_ITEM",t.UPDATE_LINE_ITEM="APP::CART::UPDATE_LINE_ITEM",t.REMOVE_LINE_ITEM="APP::CART::REMOVE_LINE_ITEM",t.SET_LINE_ITEM_DISCOUNT="APP::CART::SET_LINE_ITEM_DISCOUNT",t.REMOVE_LINE_ITEM_DISCOUNT="APP::CART::REMOVE_LINE_ITEM_DISCOUNT",t.SET_LINE_ITEM_PROPERTIES="APP::CART::SET_LINE_ITEM_PROPERTIES",t.REMOVE_LINE_ITEM_PROPERTIES="APP::CART::REMOVE_LINE_ITEM_PROPERTIES"}(e.ActionType||(e.ActionType={})),function(t){t.FETCH="FETCH",t.UPDATE="UPDATE",t.SET_CUSTOMER="SET_CUSTOMER",t.REMOVE_CUSTOMER="REMOVE_CUSTOMER",t.ADD_CUSTOMER_ADDRESS="ADD_CUSTOMER_ADDRESS",t.UPDATE_CUSTOMER_ADDRESS="UPDATE_CUSTOMER_ADDRESS",t.SET_DISCOUNT="SET_DISCOUNT",t.REMOVE_DISCOUNT="REMOVE_DISCOUNT",t.SET_PROPERTIES="SET_PROPERTIES",t.REMOVE_PROPERTIES="REMOVE_PROPERTIES",t.CLEAR="CLEAR",t.ADD_LINE_ITEM="ADD_LINE_ITEM",t.UPDATE_LINE_ITEM="UPDATE_LINE_ITEM",t.REMOVE_LINE_ITEM="REMOVE_LINE_ITEM",t.SET_LINE_ITEM_DISCOUNT="SET_LINE_ITEM_DISCOUNT",t.REMOVE_LINE_ITEM_DISCOUNT="REMOVE_LINE_ITEM_DISCOUNT",t.SET_LINE_ITEM_PROPERTIES="SET_LINE_ITEM_PROPERTIES",t.REMOVE_LINE_ITEM_PROPERTIES="REMOVE_LINE_ITEM_PROPERTIES"}(e.Action||(e.Action={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=e.ActionType=void 0,function(t){t.UPDATE="APP::FEATURES::UPDATE",t.REQUEST="APP::FEATURES::REQUEST",t.REQUEST_UPDATE="APP::FEATURES::REQUEST::UPDATE"}(e.ActionType||(e.ActionType={})),function(t){t.UPDATE="UPDATE",t.REQUEST="REQUEST",t.REQUEST_UPDATE="REQUEST::UPDATE"}(e.Action||(e.Action={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=e.ActionType=void 0,function(t){t.START="APP::LOADING::START",t.STOP="APP::LOADING::STOP"}(e.ActionType||(e.ActionType={})),function(t){t.START="START",t.STOP="STOP"}(e.Action||(e.Action={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=void 0,function(t){t.LOADING="LOADING",t.LOADED="LOADED"}(e.Action||(e.Action={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=e.ActionType=void 0,function(t){t.PUSH="APP::NAVIGATION::HISTORY::PUSH",t.REPLACE="APP::NAVIGATION::HISTORY::REPLACE"}(e.ActionType||(e.ActionType={})),function(t){t.PUSH="PUSH",t.REPLACE="REPLACE"}(e.Action||(e.Action={}))},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(62),e),r(n(26),e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ResourceType=e.ActionType=e.Action=void 0,function(t){t.ADMIN_PATH="ADMIN::PATH",t.ADMIN_SECTION="ADMIN::SECTION",t.REMOTE="REMOTE",t.APP="APP"}(e.Action||(e.Action={})),function(t){t.ADMIN_SECTION="APP::NAVIGATION::REDIRECT::ADMIN::SECTION",t.ADMIN_PATH="APP::NAVIGATION::REDIRECT::ADMIN::PATH",t.REMOTE="APP::NAVIGATION::REDIRECT::REMOTE",t.APP="APP::NAVIGATION::REDIRECT::APP"}(e.ActionType||(e.ActionType={})),function(t){t.Product="products",t.Collection="collections",t.Order="orders",t.Customer="customers",t.Discount="discounts"}(e.ResourceType||(e.ResourceType={}))},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(63),e),r(n(28),e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=e.ActionType=void 0,function(t){t.APP="APP::PRINT::APP"}(e.ActionType||(e.ActionType={})),function(t){t.APP="APP"}(e.Action||(e.Action={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ActionVerb=e.ResourceType=e.ProductStatus=e.ProductVariantInventoryManagement=e.ProductVariantInventoryPolicy=e.WeightUnit=e.FulfillmentServiceType=e.CollectionSortOrder=e.ActionType=e.Action=void 0,function(t){t.OPEN="OPEN",t.SELECT="SELECT",t.CLOSE="CLOSE",t.UPDATE="UPDATE",t.CANCEL="CANCEL"}(e.Action||(e.Action={})),function(t){t.OPEN="APP::RESOURCE_PICKER::OPEN",t.SELECT="APP::RESOURCE_PICKER::SELECT",t.CLOSE="APP::RESOURCE_PICKER::CLOSE",t.UPDATE="APP::RESOURCE_PICKER::UPDATE",t.CANCEL="APP::RESOURCE_PICKER::CANCEL"}(e.ActionType||(e.ActionType={})),function(t){t.Manual="MANUAL",t.BestSelling="BEST_SELLING",t.AlphaAsc="ALPHA_ASC",t.AlphaDesc="ALPHA_DESC",t.PriceDesc="PRICE_DESC",t.PriceAsc="PRICE_ASC",t.CreatedDesc="CREATED_DESC",t.Created="CREATED"}(e.CollectionSortOrder||(e.CollectionSortOrder={})),function(t){t.GiftCard="GIFT_CARD",t.Manual="MANUAL",t.ThirdParty="THIRD_PARTY"}(e.FulfillmentServiceType||(e.FulfillmentServiceType={})),function(t){t.Kilograms="KILOGRAMS",t.Grams="GRAMS",t.Pounds="POUNDS",t.Ounces="OUNCES"}(e.WeightUnit||(e.WeightUnit={})),function(t){t.Deny="DENY",t.Continue="CONTINUE"}(e.ProductVariantInventoryPolicy||(e.ProductVariantInventoryPolicy={})),function(t){t.Shopify="SHOPIFY",t.NotManaged="NOT_MANAGED",t.FulfillmentService="FULFILLMENT_SERVICE"}(e.ProductVariantInventoryManagement||(e.ProductVariantInventoryManagement={})),function(t){t.Active="ACTIVE",t.Archived="ARCHIVED",t.Draft="DRAFT"}(e.ProductStatus||(e.ProductStatus={})),function(t){t.Product="product",t.ProductVariant="variant",t.Collection="collection"}(e.ResourceType||(e.ResourceType={})),function(t){t.Add="add",t.Select="select"}(e.ActionVerb||(e.ActionVerb={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Action=e.ActionType=void 0,function(t){t.OPEN_CAMERA="APP::SCANNER::OPEN::CAMERA",t.CAPTURE="APP::SCANNER::CAPTURE"}(e.ActionType||(e.ActionType={})),function(t){t.OPEN_CAMERA="OPEN::CAMERA",t.CAPTURE="CAPTURE"}(e.Action||(e.Action={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ActionType=e.Action=void 0,function(t){t.UPDATE="UPDATE"}(e.Action||(e.Action={})),function(t){t.UPDATE="APP::TITLEBAR::UPDATE",t.BUTTON_CLICK="APP::TITLEBAR::BUTTONS::BUTTON::CLICK",t.BUTTON_UPDATE="APP::TITLEBAR::BUTTONS::BUTTON::UPDATE",t.BUTTON_GROUP_UPDATE="APP::TITLEBAR::BUTTONS::BUTTONGROUP::UPDATE",t.BREADCRUMBS_CLICK="APP::TITLEBAR::BREADCRUMBS::BUTTON::CLICK",t.BREADCRUMBS_UPDATE="APP::TITLEBAR::BREADCRUMBS::BUTTON::UPDATE"}(e.ActionType||(e.ActionType={}))},function(t,e,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createApp=e.createAppWrapper=e.createClientApp=e.getShopOrigin=e.getUrlParams=e.WINDOW_UNDEFINED_MESSAGE=void 0;var i=n(1),c=n(3),a=n(27),s=n(6),u=n(82),p=n(17),d=n(83),f=n(33),h=n(2),l=r(n(84));function A(){var t={},e=f.getLocation();return e?e.search.slice(e.search.indexOf("?")+1).split("&").reduce((function(t,e){var n,r=e.split("="),i=r[0],c=r[1];return o(o({},t),((n={})[decodeURIComponent(i)]=decodeURIComponent(c),n))}),t):t}function y(t,n,o){if(void 0===o&&(o=[]),!t)throw c.fromAction(e.WINDOW_UNDEFINED_MESSAGE,c.AppActionType.WINDOW_UNDEFINED);var r=f.getLocation(),i=n||r&&r.origin;if(!i)throw c.fromAction("local origin cannot be blank",c.AppActionType.MISSING_LOCAL_ORIGIN);var a=s.fromWindow(t,i);return e.createClientApp(a,o)}function P(t){var e=f.getWindow();return e?y(e.top)(t):u.serverAppBridge}e.WINDOW_UNDEFINED_MESSAGE="window is not defined. Running an app outside a browser is not supported",e.getUrlParams=A,e.getShopOrigin=function(){return A().shop},e.createClientApp=function(t,e){void 0===e&&(e=[]);var n=[],o=s.createTransportListener();return t.subscribe((function(t){var e=t.data,r=e.type,a=e.payload;switch(r){case"getState":n.splice(0).forEach((function(t){return t(a)}));break;case"dispatch":if(o.handleMessage(a),o.handleActionDispatch(a))return;var s=i.findMatchInEnum(c.ActionType,a.type);s&&c.throwError(s,a)}})),function(r){if(!r.shopOrigin)throw c.fromAction("shopOrigin must be provided",c.AppActionType.INVALID_CONFIG);var s=/^https?:\/\//;if(s.test(r.shopOrigin)){var u="shopOrigin should not include protocol, please use: "+r.shopOrigin.replace(s,"");throw c.fromAction(u,c.AppActionType.INVALID_CONFIG)}if(!r.apiKey)throw c.fromAction("apiKey must be provided",c.AppActionType.INVALID_CONFIG);var A=function(t,e){return function(n,o){t.dispatch({payload:o,source:e,type:n})}}(t,r),y=o.createSubscribeHandler(A);function P(t){return A(h.MessageType.Dispatch,t),t}A(h.MessageType.Unsubscribe),function(t,e){var n=e.apiKey,o=e.shopOrigin,r=e.forceRedirect,i=void 0===r?!p.isDevelopmentClient:r,c=f.getLocation();if(!p.isFrameless&&c&&n&&o&&i&&f.shouldRedirect(t)){var a="https://"+o+"/admin/apps/"+n+c.pathname+(c.search||"");f.redirect(a)}}(t.hostFrame,r);for(var E=new l.default,O={localOrigin:t.localOrigin,hooks:E,dispatch:function(t){return O.hooks?O.hooks.run(h.LifecycleHook.DispatchAction,P,O,t):P(t)},featuresAvailable:function(t){return O.getState("features").then((function(e){return t&&Object.keys(e).forEach((function(n){t.includes(n)||delete e[n]})),e}))},getState:function(t){return new Promise((function(t){n.push(t),A(h.MessageType.GetState)})).then((function(e){return t?t.split(".").reduce((function(t,n){if("object"==typeof e&&!Array.isArray(e))return t=e[n],e=t,t}),void 0):e}))},subscribe:y,error:function(t,e){var n=[];return i.forEachInEnum(c.ActionType,(function(o){n.push(y(o,t,e))})),function(){n.forEach((function(t){return t()}))}}},_=0,T=e;_<T.length;_++){(0,T[_])(E,O)}return function(t){t.subscribe(a.ActionType.APP,d.handleAppPrint)}(O),O}},e.createAppWrapper=y,e.createApp=P,e.default=P},function(t,e,n){"use strict";function o(){return r()?window.location:void 0}function r(){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=o();e&&e.assign(t)},e.getLocation=o,e.getWindow=function(){return r()?window:void 0}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=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.hasOwnProperty.call(t,n)&&o(e,t,n);return r(e,t),e},c=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.actions=void 0;var a=i(n(35));e.actions=a,c(n(13),e);var s=n(13);Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s.createApp}})},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=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.hasOwnProperty.call(t,n)&&o(e,t,n);return r(e,t),e},c=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.Performance=e.Pos=e.AppLink=e.ChannelMenu=e.NavigationMenu=e.Share=e.ContextualSaveBar=e.MarketingExternalActivityTopBar=e.TitleBar=e.SessionToken=e.ResourcePicker=e.Redirect=e.Print=e.ModalContent=e.Modal=e.Loading=e.LeaveConfirmation=e.History=e.Toast=e.Fullscreen=e.FeedbackModal=e.Features=e.Flash=e.Error=e.Cart=e.Scanner=e.ButtonGroup=e.Button=e.AuthCode=void 0;var a=i(n(36));e.AuthCode=a;var s=i(n(4));e.Button=s;var u=i(n(8));e.ButtonGroup=u;var p=i(n(44));e.Cart=p;var d=i(n(3));e.Error=d;var f=i(n(46));e.Flash=f;var h=i(n(49));e.Features=h;var l=i(n(51));e.FeedbackModal=l;var A=i(n(52));e.Fullscreen=A;var y=i(n(53));e.LeaveConfirmation=y;var P=i(n(54));e.Loading=P;var E=i(n(56));e.Modal=E;var O=i(n(58));e.ModalContent=O;var _=i(n(60));e.History=_;var T=i(n(25));e.Redirect=T;var v=i(n(27));e.Print=v;var b=i(n(64));e.ResourcePicker=b;var g=i(n(66));e.Scanner=g;var S=i(n(68));e.SessionToken=S;var I=i(n(69));e.TitleBar=I;var m=i(n(9));e.Toast=m;var R=i(n(72));e.ContextualSaveBar=R;var C=i(n(73));e.Share=C;var D=i(n(74));e.NavigationMenu=D;var N=i(n(76));e.ChannelMenu=N;var M=i(n(12));e.AppLink=M;var U=i(n(78));e.Pos=U;var L=i(n(79));e.MarketingExternalActivityTopBar=L;var j=i(n(80));e.Performance=j;var w=n(15);Object.defineProperty(e,"isAppBridgeAction",{enumerable:!0,get:function(){return w.isAppBridgeAction}}),c(n(0),e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.respond=e.request=e.Action=e.ActionType=void 0;var o,r=n(1),i=n(0);!function(t){t.REQUEST="APP::AUTH_CODE::REQUEST",t.RESPOND="APP::AUTH_CODE::RESPOND"}(o=e.ActionType||(e.ActionType={})),function(t){t.REQUEST="REQUEST",t.RESPOND="RESPOND"}(e.Action||(e.Action={})),e.request=function(t){return r.actionWrapper({group:i.Group.AuthCode,type:o.REQUEST,payload:{id:t}})},e.respond=function(t){return r.actionWrapper({payload:t,group:i.Group.AuthCode,type:o.RESPOND})}},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=void 0;var o=n(1),r=n(0),i=n(14);function c(t,e,n){var i=e.payload;return o.actionWrapper({type:t,group:r.Group.Error,payload:{action:e,message:n,type:t,id:i&&i.id?i.id:void 0}})}!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 c(i.ActionType.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:r.Group.Error,payload:{action:t,message:e||"The action type is invalid or unsupported",type:i.ActionType.INVALID_ACTION_TYPE},type:i.ActionType.INVALID_ACTION_TYPE})},e.invalidAction=function(t,e){return o.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"The action's has missing/invalid values for `group`, `type` or `version`",type:i.ActionType.INVALID_ACTION},type:i.ActionType.INVALID_ACTION})},e.unexpectedAction=function(t,e){return o.actionWrapper({group:r.Group.Error,payload:{action:t,message:e||"Action cannot be called at this time",type:i.ActionType.UNEXPECTED_ACTION},type:i.ActionType.UNEXPECTED_ACTION})},e.unsupportedOperationAction=function(t,e){return c(i.ActionType.UNSUPPORTED_OPERATION,t,e||"The action type is unsupported")},e.persistenceAction=function(t,e){return c(i.ActionType.PERSISTENCE,t,e||"Action cannot be persisted on server")},e.networkAction=function(t,e){return c(i.ActionType.NETWORK,t,e||"Network error")},e.permissionAction=function(t,e){return c(i.ActionType.PERMISSION,t,e||"Action is not permitted")},e.isErrorEventName=function(t){return"string"==typeof o.findMatchInEnum(i.Action,t)},e.invalidOriginAction=function(t){return o.actionWrapper({group:r.Group.Error,payload:{message:t,type:i.ActionType.INVALID_ORIGIN},type:i.ActionType.INVALID_ORIGIN})};var a=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 o=new a(t?e+": "+t:e);return o.action=n,o.type=e,o}e.AppBridgeError=a,a.prototype=Object.create(Error.prototype),e.fromAction=s,e.throwError=function(){var t,e,n=arguments[0];throw"string"==typeof arguments[1]?t=arguments[1]:(e=arguments[1],t=arguments[2]||""),s(t,n,e)}},function(t,e){var n,o,r=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{o="function"==typeof clearTimeout?clearTimeout:c}catch(t){o=c}}();var s,u=[],p=!1,d=-1;function f(){p&&s&&(p=!1,s.length?u=s.concat(u):d=-1,u.length&&h())}function h(){if(!p){var t=a(f);p=!0;for(var e=u.length;e;){for(s=u,u=[];++d<e;)s&&s[d].run();d=-1,e=u.length}s=null,p=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function l(t,e){this.fun=t,this.array=e}function A(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new l(t,e)),1!==u.length||p||a(h)},l.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=A,r.addListener=A,r.once=A,r.off=A,r.removeListener=A,r.removeAllListeners=A,r.emit=A,r.prependListener=A,r.prependOnceListener=A,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e,n){if(null==n)return n;if(void 0===e||!Object.getPrototypeOf(e).isPrototypeOf(n)||"Object"!==n.constructor.name&&"Array"!==n.constructor.name)return n;var o={};return Object.keys(n).forEach((function(r){e.hasOwnProperty(r)?"object"!=typeof e[r]||Array.isArray(e[r])?o[r]=n[r]:o[r]=t(e[r],n[r]):o[r]=n[r]})),Object.keys(e).forEach((function(t){n.hasOwnProperty(t)||(o[t]=e[t])})),Object.setPrototypeOf(o,Object.getPrototypeOf(e)),o}},function(t,e,n){"use strict";function o(t){return Array.from(t).map((function(t){return("00"+t.toString(16)).slice(-2)})).join("")}function r(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=r(1),e=r(2);return t[0]&=191,e[0]&=79,[o(r(4)),"-",o(r(2)),"-",o(e),"-",o(t),o(r(1)),"-",o(r(6))].join("")}Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=void 0,e.generateUuid=i,e.default=i},function(t){t.exports=JSON.parse('{"name":"@shopify/app-bridge","version":"1.30.0","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:umd","build:tsc":"NODE_ENV=production tsc","build:umd":"NODE_ENV=production webpack -p","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":"16 KB","path":"production.js"}],"devDependencies":{"@types/node":"^10.12.5"}}')},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Button=e.isValidButtonProps=e.update=e.clickButton=void 0;var c=n(1),a=n(0),s=n(18);function u(t,e,n){var o=e.id,r=c.getEventNameSpace(t,s.Action.CLICK,e),i={id:o,payload:n};return c.actionWrapper({type:r,group:t,payload:i})}function p(t,e,n){var o=e.id,r=n.label,a=c.getEventNameSpace(t,s.Action.UPDATE,e),u=i(i({},n),{id:o,label:r});return c.actionWrapper({type:a,group:t,payload:u})}e.clickButton=u,e.update=p,e.isValidButtonProps=function(t){return"string"==typeof t.id&&"string"==typeof t.label};var d=function(t){function e(e,n){var o=t.call(this,e,a.ComponentType.Button,a.Group.Button)||this;return o.disabled=!1,o.loading=!1,o.set(n,!1),o}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{disabled:this.disabled,icon:this.icon,label:this.label,style:this.style,loading:this.loading}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),o=n.label,r=n.disabled,i=n.icon,a=n.style,u=n.loading;return this.label=o,this.disabled=Boolean(r),this.icon=i,this.style=a,this.loading=Boolean(u),e&&this.dispatch(s.Action.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case s.Action.CLICK:this.app.dispatch(u(this.group,this.component,e));break;case s.Action.UPDATE:var n=p(this.group,this.component,this.payload);this.app.dispatch(n)}return this},e}(c.ActionSet);e.Button=d,e.create=function(t,e){return new d(t,e)}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ButtonGroup=e.isGroupedButtonPayload=e.isGroupedButton=e.update=void 0;var c=n(5),a=n(1),s=n(0),u=n(19);function p(t,e,n){return function(t,e,n,o,r){var c=e.id,s=o.label,u=a.getEventNameSpace(t,n,e),p=i(i({},o),{id:c,label:s,payload:r});return a.actionWrapper({type:u,group:t,payload:p})}(t,e,u.Action.UPDATE,n)}e.update=p,e.isGroupedButton=function(t){var e=t;return e.buttons&&e.buttons.length>0&&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 d=function(t){function e(e,n){var o=t.call(this,e,s.ComponentType.ButtonGroup,s.Group.ButtonGroup)||this;return o.disabled=!1,o.buttonsOptions=[],o.buttons=[],o.set(n,!1),o}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{buttons:this.buttonsOptions,disabled:this.disabled,label:this.label}},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 n=a.getMergedProps(this.options,t),o=n.label,r=n.disabled,i=n.buttons;return this.label=o,this.disabled=Boolean(r),this.buttons=this.getButtons(i),e&&this.dispatch(u.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case u.Action.UPDATE:var e=p(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,n=0,o=this.buttons;n<o.length;n++){var r=o[n];if(e=a.updateActionFromPayload(r,t))break}e&&this.dispatch(u.Action.UPDATE)}},e.prototype.getSingleButton=function(t){return c.getSingleButton(this,t,this.subgroups,this.updateButtons)},e.prototype.getButtons=function(t){var e=this,n=[];return t?(t.forEach((function(t){var o=c.getSingleButton(e,t,e.subgroups,e.updateButtons);n.push(o)})),this.buttonsOptions=t,n):[]},e}(a.ActionSetWithChildren);e.ButtonGroup=d,e.create=function(t,e){return new d(t,e)}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(45),e),r(n(20),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Cart=e.setLineItemProperties=e.removeLineItemDiscount=e.setLineItemDiscount=e.removeLineItem=e.updateLineItem=e.addLineItem=e.removeProperties=e.setProperties=e.setDiscount=e.updateCustomerAddress=e.addCustomerAddress=e.setCustomer=e.update=e.fetch=void 0;var c=n(1),a=n(0),s=n(20);function u(t,e){return void 0===e&&(e={}),c.actionWrapper({group:a.Group.Cart,type:t,payload:e})}e.fetch=function(){return u(s.ActionType.FETCH)},e.update=function(t){return u(s.ActionType.UPDATE,t)},e.setCustomer=function(t){return u(s.ActionType.SET_CUSTOMER,t)},e.addCustomerAddress=function(t){return u(s.ActionType.ADD_CUSTOMER_ADDRESS,t)},e.updateCustomerAddress=function(t){return u(s.ActionType.UPDATE_CUSTOMER_ADDRESS,t)},e.setDiscount=function(t){return u(s.ActionType.SET_DISCOUNT,t)},e.setProperties=function(t){return u(s.ActionType.SET_PROPERTIES,t)},e.removeProperties=function(t){return u(s.ActionType.REMOVE_PROPERTIES,t)},e.addLineItem=function(t){return u(s.ActionType.ADD_LINE_ITEM,t)},e.updateLineItem=function(t){return u(s.ActionType.UPDATE_LINE_ITEM,t)},e.removeLineItem=function(t){return u(s.ActionType.REMOVE_LINE_ITEM,t)},e.setLineItemDiscount=function(t){return u(s.ActionType.SET_LINE_ITEM_DISCOUNT,t)},e.removeLineItemDiscount=function(t){return u(s.ActionType.REMOVE_LINE_ITEM_DISCOUNT,t)},e.setLineItemProperties=function(t){return u(s.ActionType.SET_LINE_ITEM_PROPERTIES,t)};var p=function(t){function e(e,n){return t.call(this,e,a.Group.Cart,a.Group.Cart,n?n.id:void 0)||this}return r(e,t),e.prototype.dispatch=function(t,e){switch(t){case s.Action.FETCH:this.dispatchCartAction(s.ActionType.FETCH);break;case s.Action.UPDATE:this.dispatchCartAction(s.ActionType.UPDATE,e);break;case s.Action.SET_CUSTOMER:this.dispatchCartAction(s.ActionType.SET_CUSTOMER,e);break;case s.Action.REMOVE_CUSTOMER:this.dispatchCartAction(s.ActionType.REMOVE_CUSTOMER,e);break;case s.Action.ADD_CUSTOMER_ADDRESS:this.dispatchCartAction(s.ActionType.ADD_CUSTOMER_ADDRESS,e);break;case s.Action.UPDATE_CUSTOMER_ADDRESS:this.dispatchCartAction(s.ActionType.UPDATE_CUSTOMER_ADDRESS,e);break;case s.Action.SET_DISCOUNT:this.dispatchCartAction(s.ActionType.SET_DISCOUNT,e);break;case s.Action.REMOVE_DISCOUNT:this.dispatchCartAction(s.ActionType.REMOVE_DISCOUNT,e);break;case s.Action.SET_PROPERTIES:this.dispatchCartAction(s.ActionType.SET_PROPERTIES,e);break;case s.Action.REMOVE_PROPERTIES:this.dispatchCartAction(s.ActionType.REMOVE_PROPERTIES,e);break;case s.Action.CLEAR:this.dispatchCartAction(s.ActionType.CLEAR,e);break;case s.Action.ADD_LINE_ITEM:this.dispatchCartAction(s.ActionType.ADD_LINE_ITEM,e);break;case s.Action.UPDATE_LINE_ITEM:this.dispatchCartAction(s.ActionType.UPDATE_LINE_ITEM,e);break;case s.Action.REMOVE_LINE_ITEM:this.dispatchCartAction(s.ActionType.REMOVE_LINE_ITEM,e);break;case s.Action.SET_LINE_ITEM_DISCOUNT:this.dispatchCartAction(s.ActionType.SET_LINE_ITEM_DISCOUNT,e);break;case s.Action.REMOVE_LINE_ITEM_DISCOUNT:this.dispatchCartAction(s.ActionType.REMOVE_LINE_ITEM_DISCOUNT,e);break;case s.Action.SET_LINE_ITEM_PROPERTIES:this.dispatchCartAction(s.ActionType.SET_LINE_ITEM_PROPERTIES,e);break;case s.Action.REMOVE_LINE_ITEM_PROPERTIES:this.dispatchCartAction(s.ActionType.REMOVE_LINE_ITEM_PROPERTIES,e)}return this},e.prototype.dispatchCartAction=function(t,e){this.app.dispatch(u(t,i(i({},e),{id:this.id})))},e}(c.ActionSet);e.Cart=p,e.create=function(t,e){return new p(t,e)}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(47),e),r(n(10),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Flash=void 0;var i=n(9),c=n(9);Object.defineProperty(e,"ActionBase",{enumerable:!0,get:function(){return c.ActionBase}}),Object.defineProperty(e,"clear",{enumerable:!0,get:function(){return c.clear}}),Object.defineProperty(e,"ClearAction",{enumerable:!0,get:function(){return c.ClearAction}}),Object.defineProperty(e,"show",{enumerable:!0,get:function(){return c.show}}),Object.defineProperty(e,"ShowAction",{enumerable:!0,get:function(){return c.ShowAction}}),Object.defineProperty(e,"FlashAction",{enumerable:!0,get:function(){return c.ToastAction}});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(i.Toast);e.Flash=a,e.create=function(t,e){return new a(t,e)}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Toast=e.clear=e.show=void 0;var c=n(1),a=n(0),s=n(10);function u(t){return c.actionWrapper({group:a.Group.Toast,payload:t,type:s.ActionType.SHOW})}function p(t){return c.actionWrapper({payload:t,group:a.Group.Toast,type:s.ActionType.CLEAR})}e.show=u,e.clear=p;var d=function(t){function e(e,n){var o=t.call(this,e,a.Group.Toast,a.Group.Toast)||this;return o.message="",o.duration=5e3,o.set(n),o}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{duration:this.duration,isError:this.isError,message:this.message}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){var e=c.getMergedProps(this.options,t),n=e.message,o=e.duration,r=e.isError;return this.message=n,this.duration=o,this.isError=r,this},e.prototype.dispatch=function(t){switch(t){case s.Action.SHOW:var e=u(this.payload);this.app.dispatch(e);break;case s.Action.CLEAR:this.app.dispatch(p({id:this.id}))}return this},e}(c.ActionSet);e.Toast=d,e.create=function(t,e){return new d(t,e)}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(50),e),r(n(21),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Features=void 0;var c=n(1),a=n(0),s=n(21),u=function(t){function e(e,n){return t.call(this,e,a.Group.Features,a.Group.Features,n?n.id:void 0)||this}return r(e,t),e.prototype.dispatch=function(t,e){switch(t){case s.Action.REQUEST:this.dispatchFeaturesAction(s.ActionType.REQUEST,e)}return this},e.prototype.dispatchFeaturesAction=function(t,e){this.app.dispatch(c.actionWrapper({group:a.Group.Features,type:t,payload:i(i({},e||{}),{id:this.id})}))},e}(c.ActionSet);e.Features=u,e.create=function(t,e){return new u(t,e)}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.FeedbackModal=e.close=e.open=e.ActionType=e.Action=void 0;var c,a,s=n(1),u=n(0);function p(t){return s.actionWrapper({group:u.Group.FeedbackModal,payload:t,type:a.OPEN})}function d(t){return s.actionWrapper({group:u.Group.FeedbackModal,payload:t,type:a.CLOSE})}!function(t){t.OPEN="OPEN",t.CLOSE="CLOSE"}(c=e.Action||(e.Action={})),function(t){t.OPEN="APP::FEEDBACK_MODAL::OPEN",t.CLOSE="APP::FEEDBACK_MODAL::CLOSE"}(a=e.ActionType||(e.ActionType={})),e.open=p,e.close=d;var f=function(t){function e(e,n){var o=t.call(this,e,u.Group.FeedbackModal,u.Group.FeedbackModal)||this;return o.options=n,o.set(n),o}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){return this.options=s.getMergedProps(this.options,t),this},e.prototype.dispatch=function(t){switch(t){case c.OPEN:var e=p(this.payload);this.app.dispatch(e);break;case c.CLOSE:var n=d(this.payload);this.app.dispatch(n)}return this},e}(s.ActionSet);e.FeedbackModal=f,e.create=function(t,e){return new f(t,e)}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Fullscreen=e.exit=e.enter=e.ActionType=e.Action=void 0;var i,c=n(1),a=n(0);!function(t){t.ENTER="ENTER",t.EXIT="EXIT"}(e.Action||(e.Action={})),function(t){t.ENTER="APP::FULLSCREEN::ENTER",t.EXIT="APP::FULLSCREEN::EXIT"}(i=e.ActionType||(e.ActionType={})),e.enter=function(){return c.actionWrapper({group:a.Group.Fullscreen,type:i.ENTER})},e.exit=function(){return c.actionWrapper({group:a.Group.Fullscreen,type:i.EXIT})};var s=function(t){function e(e){return t.call(this,e,a.Group.Fullscreen,a.Group.Fullscreen)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t){return this.app.dispatch(c.actionWrapper({group:this.group,type:i[t],payload:this.payload})),this},e}(c.ActionSet);e.Fullscreen=s,e.create=function(t){return new s(t)}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.LeaveConfirmation=e.confirm=e.disable=e.enable=e.ActionType=e.Action=void 0;var c,a,s=n(1),u=n(0);function p(t){return void 0===t&&(t={}),s.actionWrapper({group:u.Group.LeaveConfirmation,payload:t,type:a.ENABLE})}function d(t){return void 0===t&&(t={}),s.actionWrapper({group:u.Group.LeaveConfirmation,payload:t,type:a.DISABLE})}function f(t){return void 0===t&&(t={}),s.actionWrapper({group:u.Group.LeaveConfirmation,payload:t,type:a.CONFIRM})}!function(t){t.ENABLE="ENABLE",t.DISABLE="DISABLE",t.CONFIRM="CONFIRM"}(c=e.Action||(e.Action={})),function(t){t.ENABLE="APP::LEAVE_CONFIRMATION::ENABLE",t.DISABLE="APP::LEAVE_CONFIRMATION::DISABLE",t.CONFIRM="APP::LEAVE_CONFIRMATION::CONFIRM"}(a=e.ActionType||(e.ActionType={})),e.enable=p,e.disable=d,e.confirm=f;var h=function(t){function e(e,n){void 0===n&&(n={});var o=t.call(this,e,u.Group.LeaveConfirmation,u.Group.LeaveConfirmation)||this;return o.options=n,o.set(n),o}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t){return this.options=s.getMergedProps(this.options,t),this},e.prototype.dispatch=function(t){switch(t){case c.ENABLE:var e=p(this.payload);this.app.dispatch(e);break;case c.DISABLE:var n=d(this.payload);this.app.dispatch(n);break;case c.CONFIRM:var o=f(this.payload);this.app.dispatch(o)}return this},e}(s.ActionSet);e.LeaveConfirmation=h,e.create=function(t,e){return void 0===e&&(e={}),new h(t,e)}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(55),e),r(n(22),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Loading=e.stop=e.start=void 0;var i=n(1),c=n(0),a=n(22);function s(t){return i.actionWrapper({payload:t,group:c.Group.Loading,type:a.ActionType.START})}function u(t){return i.actionWrapper({payload:t,group:c.Group.Loading,type:a.ActionType.STOP})}e.start=s,e.stop=u;var p=function(t){function e(e){return t.call(this,e,c.Group.Loading,c.Group.Loading)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t){switch(t){case a.Action.START:this.app.dispatch(s(this.payload));break;case a.Action.STOP:this.app.dispatch(u(this.payload))}return this},e}(i.ActionSet);e.Loading=p,e.create=function(t){return new p(t)}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(57),e),r(n(11),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ModalIframe=e.ModalMessage=e.Modal=e.isMessageModal=e.isIframeModal=e.data=e.update=e.clickFooterButton=e.updateModalSize=e.closeModal=e.openModal=void 0;var c=n(5),a=n(1),s=n(0),u=n(4),p=n(11),d={group:s.Group.Modal,subgroups:["Footer"],type:s.ComponentType.Button};function f(t){return a.actionWrapper({group:s.Group.Modal,payload:t,type:p.ActionType.OPEN})}function h(t){return a.actionWrapper({group:s.Group.Modal,payload:t,type:p.ActionType.CLOSE})}function l(t){return a.actionWrapper({payload:t,group:s.Group.Modal,type:p.ActionType.UPDATE})}function A(t){return a.actionWrapper({payload:t,group:s.Group.Modal,type:p.ActionType.DATA})}function y(t){return"string"==typeof t.url||"string"==typeof t.path}e.openModal=f,e.closeModal=h,e.updateModalSize=function(t){return a.actionWrapper({group:s.Group.Modal,payload:t,type:p.ActionType.UPDATE_SIZE})},e.clickFooterButton=function(t,e){var n=i({id:t},d);return u.clickButton(s.Group.Modal,n,e)},e.update=l,e.data=A,e.isIframeModal=y,e.isMessageModal=function(t){return"string"==typeof t.message};var P=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=p.Size.Small,e}return r(e,t),Object.defineProperty(e.prototype,"footer",{get:function(){if(this.footerPrimary||this.footerSecondary)return{buttons:{primary:this.footerPrimary,secondary:this.footerSecondary}}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"footerOptions",{get:function(){if(this.footerPrimaryOptions||this.footerSecondaryOptions)return{buttons:{primary:this.footerPrimaryOptions,secondary:this.footerSecondaryOptions}}},enumerable:!1,configurable:!0}),e.prototype.close=function(){this.app.dispatch(h({id:this.id}))},e.prototype.setFooterPrimaryButton=function(t,e){var n=this,o=d.subgroups;this.footerPrimaryOptions=this.getChildButton(t,this.footerPrimaryOptions),this.footerPrimary=this.footerPrimaryOptions?c.getSingleButton(this,this.footerPrimaryOptions,o,(function(t){n.updatePrimaryFooterButton(t,e)})):void 0},e.prototype.setFooterSecondaryButtons=function(t,e){var n=this,o=d.subgroups,r=t||[],i=this.footerOptions&&this.footerOptions.buttons.secondary||[];this.footerSecondaryOptions=this.getUpdatedChildActions(r,i),this.footerSecondary=this.footerSecondaryOptions?this.footerSecondaryOptions.map((function(t){return c.getSingleButton(n,t,o,(function(t){n.updateSecondaryFooterButton(t,e)}))})):void 0},e.prototype.getChildButton=function(t,e){var n=t?[t]:[],o=e?[e]:[],r=this.getUpdatedChildActions(n,o);return r?r[0]:void 0},e.prototype.updatePrimaryFooterButton=function(t,e){this.footer&&this.footer.buttons.primary&&a.updateActionFromPayload(this.footer.buttons.primary,t)&&e()},e.prototype.updateSecondaryFooterButton=function(t,e){if(this.footer&&this.footer.buttons&&this.footer.buttons.secondary){for(var n,o=0,r=this.footer.buttons.secondary;o<r.length;o++){var i=r[o];if(n=a.updateActionFromPayload(i,t))break}n&&e()}},e}(a.ActionSetWithChildren);e.Modal=P;var E=function(t){function e(e,n){var o=t.call(this,e,s.Group.Modal,s.Group.Modal)||this;return o.set(n,!1),o}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{footer:this.footer,id:this.id})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,message:this.message,size:this.size,title:this.title}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){var n=this;void 0===e&&(e=!0);var o=a.getMergedProps(this.options,t),r=o.title,i=o.footer,c=o.message,s=o.size;return this.title=r,this.message=c,this.size=s,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,(function(){n.dispatch(p.Action.UPDATE)})),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,(function(){n.dispatch(p.Action.UPDATE)})),e&&this.dispatch(p.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case p.Action.OPEN:this.app.dispatch(f(this.payload));break;case p.Action.CLOSE:this.close();break;case p.Action.UPDATE:this.app.dispatch(l(this.payload))}return this},e}(P);e.ModalMessage=E;var O=function(t){function e(e,n){var o=t.call(this,e,s.Group.Modal,s.Group.Modal)||this;return o.set(n,!1),o}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{footer:this.footer,id:this.id})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{footer:this.footerOptions,path:this.path,size:this.size,title:this.title,url:this.url,loading:this.loading}},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){var n=this;void 0===e&&(e=!0);var o=a.getMergedProps(this.options,t),r=o.title,i=o.footer,c=o.path,s=o.url,u=o.size,d=o.loading;return this.title=r,this.url=s,this.path=c,this.size=u,this.loading=d,this.setFooterPrimaryButton(i?i.buttons.primary:void 0,(function(){n.dispatch(p.Action.UPDATE)})),this.setFooterSecondaryButtons(i?i.buttons.secondary:void 0,(function(){n.dispatch(p.Action.UPDATE)})),e&&this.dispatch(p.Action.UPDATE),this},e.prototype.dispatch=function(t,e){switch(t){case p.Action.OPEN:this.app.dispatch(f(this.payload));break;case p.Action.CLOSE:this.close();break;case p.Action.UPDATE:this.app.dispatch(l(this.payload));break;case p.Action.DATA:this.app.dispatch(A(e||{}))}return this},e}(P);e.ModalIframe=O,e.create=function(t,e){return y(e)?new O(t,e):new E(t,e)}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(59),e),r(n(23),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},c=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))((function(r,i){function c(t){try{s(o.next(t))}catch(t){i(t)}}function a(t){try{s(o.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(c,a)}s((o=o.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,o,r,i,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,o=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(r=c.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){c.label=i[1];break}if(6===i[0]&&c.label<r[1]){c.label=r[1],r=i;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(i);break}r[2]&&c.ops.pop(),c.trys.pop();continue}i=e.call(t,c)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ModalContent=void 0;var s=n(1),u=n(0),p=n(11),d=n(23),f=function(t){function e(e,n){return t.call(this,e,u.Group.Modal,u.Group.Modal,n?n.id:void 0)||this}return r(e,t),e.prototype.loaded=function(){this.dispatch(d.Action.LOADED)},e.prototype.loading=function(){this.dispatch(d.Action.LOADING)},e.prototype.dispatch=function(t){switch(t){case d.Action.LOADED:this.dispatchModalAction(p.ActionType.UPDATE_CONTENT,{loading:!1});break;case d.Action.LOADING:this.dispatchModalAction(p.ActionType.UPDATE_CONTENT,{loading:!0})}return this},e.prototype.dispatchModalAction=function(t,e){return c(this,void 0,void 0,(function(){var n;return a(this,(function(o){return n=s.actionWrapper({type:t,group:u.Group.Modal,payload:i({},e)}),this.app.dispatch(n),[2]}))}))},e}(s.ActionSet);e.ModalContent=f,e.create=function(t,e){return new f(t,e)}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(61),e),r(n(24),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.History=e.replace=e.push=void 0;var c=n(1),a=n(0),s=n(24);function u(t){return c.actionWrapper({payload:t,group:a.Group.Navigation,type:s.ActionType.PUSH})}function p(t){return c.actionWrapper({payload:t,group:a.Group.Navigation,type:s.ActionType.REPLACE})}e.push=u,e.replace=p;var d=function(t){function e(e){return t.call(this,e,"History",a.Group.Navigation)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t,e){var n=i(i({},this.payload),{path:e});switch(t){case s.Action.PUSH:this.app.dispatch(u(n));break;case s.Action.REPLACE:this.app.dispatch(p(n))}return this},e}(c.ActionSet);e.History=d,e.create=function(t){return new d(t)}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Redirect=e.isRemotePayload=e.isAdminSectionPayload=e.isAdminPathPayload=e.isAppPayload=e.toDestination=e.toApp=e.toRemote=e.toAdminSection=e.toAdminPath=e.isProductVariantCreateResourcePayload=e.isProductVariantResourcePayload=e.isCreateResourcePayload=e.isResourcePayload=void 0;var c=n(1),a=n(0),s=n(26);function u(t){return!0===t.create}function p(t){var e=t;return void 0!==e.id&&void 0!==e.variant}function d(t){return c.actionWrapper({payload:t,group:a.Group.Navigation,type:s.ActionType.ADMIN_PATH})}function f(t){return c.actionWrapper({payload:t,group:a.Group.Navigation,type:s.ActionType.ADMIN_SECTION})}function h(t){return c.actionWrapper({payload:t,group:a.Group.Navigation,type:s.ActionType.REMOTE})}function l(t){return c.actionWrapper({payload:t,group:a.Group.Navigation,type:s.ActionType.APP})}function A(t,e,n){switch(t){case s.Action.APP:var o=y(e)?e:{path:e};return l(i({id:n},o));case s.Action.ADMIN_PATH:var r=P(e)?e:{path:e};return d(i({id:n},r));case s.Action.ADMIN_SECTION:var c=E(e)?e:{section:e};return f(i({id:n},c));case s.Action.REMOTE:var a=O(e)?e:{url:e};return h(i({id:n},a))}}function y(t){return"object"==typeof t&&t.hasOwnProperty("path")}function P(t){return"object"==typeof t&&t.hasOwnProperty("path")}function E(t){return"object"==typeof t&&"object"==typeof t.section&&t.section.hasOwnProperty("name")}function O(t){return"object"==typeof t&&t.hasOwnProperty("url")}e.isResourcePayload=function(t){return"string"==typeof t.id},e.isCreateResourcePayload=u,e.isProductVariantResourcePayload=p,e.isProductVariantCreateResourcePayload=function(t){return!!p(t)&&u(t.variant)},e.toAdminPath=d,e.toAdminSection=f,e.toRemote=h,e.toApp=l,e.toDestination=A,e.isAppPayload=y,e.isAdminPathPayload=P,e.isAdminSectionPayload=E,e.isRemotePayload=O;var _=function(t){function e(e){return t.call(this,e,"Redirect",a.Group.Navigation)||this}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return{id:this.id}},enumerable:!1,configurable:!0}),e.prototype.dispatch=function(t,e){var n=A(t,e,this.payload.id);return this.app.dispatch(n),this},e}(c.ActionSet);e.Redirect=_,e.create=function(t){return new _(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.app=void 0;var o=n(1),r=n(0),i=n(28);e.app=function(){return o.actionWrapper({group:r.Group.Print,type:i.ActionType.APP})}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(65),e),r(n(29),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ResourcePicker=e.update=e.close=e.cancel=e.open=e.select=void 0;var c=n(1),a=n(0),s=n(29);function u(t){return c.actionWrapper({payload:t,group:a.Group.ResourcePicker,type:s.ActionType.SELECT})}function p(t){return c.actionWrapper({payload:t,group:a.Group.ResourcePicker,type:s.ActionType.OPEN})}function d(t){return c.actionWrapper({payload:t,group:a.Group.ResourcePicker,type:s.ActionType.CANCEL})}function f(t){return c.actionWrapper({payload:t,group:a.Group.ResourcePicker,type:s.ActionType.UPDATE})}e.select=u,e.open=p,e.cancel=d,e.close=function(t){return c.actionWrapper({payload:t,group:a.Group.ResourcePicker,type:s.ActionType.CANCEL})},e.update=f;var h=function(t){function e(e,n,o){var r=t.call(this,e,a.Group.ResourcePicker,a.Group.ResourcePicker)||this;return r.initialSelectionIds=[],r.selection=[],r.resourceType=o,r.set(n,!1),r}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{id:this.id,resourceType:this.resourceType})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){var t={initialQuery:this.initialQuery,selectMultiple:this.selectMultiple,initialSelectionIds:this.initialSelectionIds,showHidden:this.showHidden,actionVerb:this.actionVerb};return this.resourceType===s.ResourceType.Product?i(i({},t),{showVariants:this.showVariants,showDraft:this.showDraft,showArchived:this.showArchived,showDraftBadge:this.showDraftBadge,showArchivedBadge:this.showArchivedBadge}):t},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=c.getMergedProps(this.options,t),o=n.initialQuery,r=n.initialSelectionIds,i=void 0===r?[]:r,a=n.showHidden,u=void 0===a||a,p=n.showVariants,d=void 0===p||p,f=n.showDraft,h=void 0===f||f,l=n.showArchived,A=void 0===l||l,y=n.showDraftBadge,P=void 0!==y&&y,E=n.showArchivedBadge,O=void 0!==E&&E,_=n.selectMultiple,T=void 0===_||_,v=n.actionVerb,b=void 0===v?s.ActionVerb.Add:v;return this.initialQuery=o,this.initialSelectionIds=i,this.showHidden=u,this.showVariants=d,this.showDraft=h,this.showArchived=A,this.showDraftBadge=P,this.showArchivedBadge=O,this.selectMultiple=T,this.actionVerb=b,e&&this.update(),this},e.prototype.dispatch=function(t,e){return t===s.Action.OPEN?this.open():t===s.Action.UPDATE?this.update():t===s.Action.CLOSE||t===s.Action.CANCEL?this.cancel():t===s.Action.SELECT&&(this.selection=e,this.app.dispatch(u({id:this.id,selection:this.selection}))),this},e.prototype.update=function(){this.app.dispatch(f(this.payload))},e.prototype.open=function(){this.app.dispatch(p(this.payload))},e.prototype.cancel=function(){this.app.dispatch(d({id:this.id}))},e.prototype.close=function(){this.cancel()},e}(c.ActionSet);e.ResourcePicker=h,e.create=function(t,e){var n=e.resourceType,o=e.options;return new h(t,void 0===o?{}:o,n)}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(67),e),r(n(30),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.capture=e.openCamera=e.create=e.Scanner=void 0;var i=n(1),c=n(0),a=n(30),s=function(t){function e(e,n){return t.call(this,e,c.Group.Scanner,c.Group.Scanner,n?n.id:void 0)||this}return r(e,t),e.prototype.dispatch=function(t){switch(t){case a.Action.OPEN_CAMERA:this.dispatchScannerAction(a.ActionType.OPEN_CAMERA)}return this},e.prototype.dispatchScannerAction=function(t){this.app.dispatch(i.actionWrapper({type:t,group:c.Group.Scanner,payload:{id:this.id}}))},e}(i.ActionSet);e.Scanner=s,e.create=function(t,e){return new s(t,e)},e.openCamera=function(){return i.actionWrapper({group:c.Group.Scanner,type:a.ActionType.OPEN_CAMERA})},e.capture=function(t){return i.actionWrapper({group:c.Group.Scanner,type:a.ActionType.CAPTURE,payload:t})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.respond=e.request=e.Action=e.ActionType=void 0;var o,r=n(1),i=n(0);!function(t){t.REQUEST="APP::SESSION_TOKEN::REQUEST",t.RESPOND="APP::SESSION_TOKEN::RESPOND"}(o=e.ActionType||(e.ActionType={})),function(t){t.REQUEST="REQUEST",t.RESPOND="RESPOND"}(e.Action||(e.Action={})),e.request=function(){return r.actionWrapper({group:i.Group.SessionToken,type:o.REQUEST})},e.respond=function(t){return r.actionWrapper({payload:t,group:i.Group.SessionToken,type:o.RESPOND})}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(70),e),r(n(31),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.TitleBar=e.update=e.clickBreadcrumb=e.clickActionButton=void 0;var c=n(4),a=n(8),s=n(71),u=n(5),p=n(1),d=n(0),f=n(31),h={group:d.Group.TitleBar,subgroups:["Buttons"]},l={group:d.Group.TitleBar,subgroups:["Breadcrumbs"],type:d.ComponentType.Button};function A(t){return p.actionWrapper({payload:t,group:d.Group.TitleBar,type:f.ActionType.UPDATE})}e.clickActionButton=function(t,e){var n=d.ComponentType.Button,o=i({id:t,type:n},h);return c.clickButton(d.Group.TitleBar,o,e)},e.clickBreadcrumb=function(t,e){var n=i({id:t},l);return c.clickButton(d.Group.TitleBar,n,e)},e.update=A;var y=function(t){function e(e,n){var o=t.call(this,e,d.Group.TitleBar,d.Group.TitleBar)||this;return o.set(n),o}return r(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{breadcrumbs:this.breadcrumbsOption,buttons:this.buttonsOptions,title:this.title}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{breadcrumbs:this.breadcrumb,buttons:this.buttons,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=p.getMergedProps(this.options,t),o=n.title,r=n.buttons,i=n.breadcrumbs;return this.title=o,this.setBreadcrumbs(i),this.setPrimaryButton(r?r.primary:void 0),this.setSecondaryButton(r?r.secondary:void 0),e&&this.dispatch(f.Action.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case f.Action.UPDATE:this.app.dispatch(A(this.payload))}return this},e.prototype.getButton=function(t,e,n){return t instanceof a.ButtonGroup?s.getGroupedButton(this,t,e,n):u.getSingleButton(this,t,e,n)},e.prototype.updatePrimaryButton=function(t){this.primary&&p.updateActionFromPayload(this.primary,t)&&this.dispatch(f.Action.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find((function(e){return e.id===t.id}));if(e){(a.isGroupedButtonPayload(t),p.updateActionFromPayload(e,t))&&this.dispatch(f.Action.UPDATE)}}},e.prototype.updateBreadcrumbButton=function(t){this.breadcrumb&&p.updateActionFromPayload(this.breadcrumb,t)&&this.dispatch(f.Action.UPDATE)},e.prototype.setPrimaryButton=function(t){this.primaryOptions=this.getChildButton(t,this.primaryOptions),this.primary=this.primaryOptions?this.getButton(this.primaryOptions,h.subgroups,this.updatePrimaryButton):void 0},e.prototype.setSecondaryButton=function(t){var e=this,n=t||[],o=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(n,o),this.secondary=this.secondaryOptions?this.secondaryOptions.map((function(t){return e.getButton(t,h.subgroups,e.updateSecondaryButtons)})):void 0},e.prototype.setBreadcrumbs=function(t){this.breadcrumbsOption=this.getChildButton(t,this.breadcrumbsOption),this.breadcrumb=this.breadcrumbsOption?this.getButton(this.breadcrumbsOption,l.subgroups,this.updateBreadcrumbButton):void 0},e.prototype.getChildButton=function(t,e){var n=t?[t]:[],o=e?[e]:[],r=this.getUpdatedChildActions(n,o);return r?r[0]:void 0},e}(p.ActionSetWithChildren);e.TitleBar=y,e.create=function(t,e){return new y(t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getGroupedButton=void 0;var o=n(8);e.getGroupedButton=function(t,e,n,r){t.addChild(e,t.group,n);var i=e.id,c=e.label,a=e.disabled,s=e.buttons;return t.subscribeToChild(e,o.Action.UPDATE,r),{id:i,label:c,buttons:s,disabled:a}}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ContextualSaveBar=e.discard=e.save=e.hide=e.show=e.ActionType=e.Action=void 0;var c,a,s=n(1),u=n(0);function p(t,e){return s.actionWrapper({group:u.Group.ContextualSaveBar,type:a[t],payload:e})}!function(t){t.DISCARD="DISCARD",t.SAVE="SAVE",t.SHOW="SHOW",t.HIDE="HIDE",t.UPDATE="UPDATE"}(c=e.Action||(e.Action={})),function(t){t.DISCARD="APP::CONTEXTUAL_SAVE_BAR::DISCARD",t.SAVE="APP::CONTEXTUAL_SAVE_BAR::SAVE",t.SHOW="APP::CONTEXTUAL_SAVE_BAR::SHOW",t.HIDE="APP::CONTEXTUAL_SAVE_BAR::HIDE",t.UPDATE="APP::CONTEXTUAL_SAVE_BAR::UPDATE"}(a=e.ActionType||(e.ActionType={})),e.show=function(t){return p(c.SHOW,t)},e.hide=function(t){return p(c.HIDE,t)},e.save=function(t){return p(c.SAVE,t)},e.discard=function(t){return p(c.DISCARD,t)};var d=function(t){function e(e,n){void 0===n&&(n={});var o=t.call(this,e,u.Group.ContextualSaveBar,u.Group.ContextualSaveBar)||this;return o.options=n,o.set(n,!1),o}return r(e,t),Object.defineProperty(e.prototype,"payload",{get:function(){return i({id:this.id},this.options)},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=s.getMergedProps(this.options,t);return this.options=n,e&&this.dispatch(c.UPDATE),this},e.prototype.dispatch=function(t){return this.app.dispatch(p(t,this.payload)),this},e}(s.ActionSet);e.ContextualSaveBar=d,e.create=function(t,e){return new d(t,e)}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.close=e.show=e.create=e.Share=e.Action=e.ActionType=void 0;var c,a,s=n(0),u=n(1);!function(t){t.SHOW="APP::SHARE::SHOW",t.CLOSE="APP::SHARE::CLOSE"}(c=e.ActionType||(e.ActionType={})),function(t){t.SHOW="SHOW",t.CLOSE="CLOSE"}(a=e.Action||(e.Action={}));var p=function(t){function e(e){return t.call(this,e,s.Group.Share,s.Group.Share)||this}return r(e,t),e.prototype.dispatch=function(t,e){switch(t){case a.SHOW:this.dispatchShareAction(c.SHOW,e);break;default:throw"Action: "+t+" not supported"}return this},e.prototype.dispatchShareAction=function(t,e){this.app.dispatch(u.actionWrapper({type:t,group:s.Group.Share,payload:i({id:this.id},e)}))},e}(u.ActionSet);e.Share=p,e.create=function(t){return new p(t)},e.show=function(){return u.actionWrapper({group:s.Group.Share,type:c.SHOW})},e.close=function(){return u.actionWrapper({group:s.Group.Share,type:c.CLOSE})}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(75),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.NavigationMenu=e.update=e.ActionType=e.Action=void 0;var c,a,s=n(12),u=n(1),p=n(0),d=["Navigation_Menu"];function f(t){return u.actionWrapper({payload:t,group:p.Group.Menu,type:a.UPDATE})}!function(t){t.UPDATE="UPDATE",t.LINK_UPDATE="LINK::UPDATE"}(c=e.Action||(e.Action={})),function(t){t.UPDATE="APP::MENU::NAVIGATION_MENU::UPDATE",t.LINK_UPDATE="APP::MENU::NAVIGATION_MENU::LINK::UPDATE"}(a=e.ActionType||(e.ActionType={})),e.update=f;var h=function(t){function e(e,n){var o=t.call(this,e,"Navigation_Menu",p.Group.Menu)||this;return o.items=[],o.set(n),o}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{items:this.itemsOptions,active:this.activeOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{active:this.active,items:this.items,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=u.getMergedProps(this.options,t),o=n.items,r=n.active;return this.setItems(o),this.activeOptions=r,this.active=r&&r.id,e&&this.dispatch(c.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case c.UPDATE:this.app.dispatch(f(this.payload))}return this},e.prototype.updateItem=function(t){if(this.items){var e=this.items.find((function(e){return e.id===t.id}));e&&u.updateActionFromPayload(e,t)&&this.dispatch(c.UPDATE)}},e.prototype.setItems=function(t){var e=this,n=t||[],o=this.itemsOptions||[];this.itemsOptions=this.getUpdatedChildActions(n,o),this.items=this.itemsOptions?this.itemsOptions.map((function(t){return e.addChild(t,e.group,d),e.subscribeToChild(t,s.Action.UPDATE,e.updateItem),t.payload})):[]},e}(u.ActionSetWithChildren);e.NavigationMenu=h,e.create=function(t,e){return new h(t,e)}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(77),e)},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.ChannelMenu=e.update=e.ActionType=e.Action=void 0;var c,a,s=n(12),u=n(1),p=n(0),d=["Channel_Menu"];function f(t){return u.actionWrapper({payload:t,group:p.Group.Menu,type:a.UPDATE})}!function(t){t.UPDATE="UPDATE",t.LINK_UPDATE="LINK::UPDATE"}(c=e.Action||(e.Action={})),function(t){t.UPDATE="APP::MENU::CHANNEL_MENU::UPDATE",t.LINK_UPDATE="APP::MENU::CHANNEL_MENU::LINK::UPDATE"}(a=e.ActionType||(e.ActionType={})),e.update=f;var h=function(t){function e(e,n){var o=t.call(this,e,"Channel_Menu",p.Group.Menu)||this;return o.items=[],o.set(n),o}return r(e,t),Object.defineProperty(e.prototype,"options",{get:function(){return{items:this.itemsOptions,active:this.activeOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return i(i({},this.options),{active:this.active,items:this.items,id:this.id})},enumerable:!1,configurable:!0}),e.prototype.set=function(t,e){void 0===e&&(e=!0);var n=u.getMergedProps(this.options,t),o=n.items,r=n.active;return this.setItems(o),this.activeOptions=r,this.active=r&&r.id,e&&this.dispatch(c.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case c.UPDATE:this.app.dispatch(f(this.payload))}return this},e.prototype.updateItem=function(t){if(this.items){var e=this.items.find((function(e){return e.id===t.id}));e&&u.updateActionFromPayload(e,t)&&this.dispatch(c.UPDATE)}},e.prototype.setItems=function(t){var e=this,n=t||[],o=this.itemsOptions||[];this.itemsOptions=this.getUpdatedChildActions(n,o),this.items=this.itemsOptions?this.itemsOptions.map((function(t){return e.addChild(t,e.group,d),e.subscribeToChild(t,s.Action.UPDATE,e.updateItem),t.payload})):[]},e}(u.ActionSetWithChildren);e.ChannelMenu=h,e.create=function(t,e){return new h(t,e)}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.Pos=e.close=e.ActionType=e.Action=void 0;var i,c=n(1),a=n(0);function s(){return c.actionWrapper({group:a.Group.Pos,type:i.CLOSE})}!function(t){t.CLOSE="CLOSE"}(e.Action||(e.Action={})),function(t){t.CLOSE="APP::POS::CLOSE",t.LOCATION_UPDATE="APP::POS::LOCATION::UPDATE",t.USER_UPDATE="APP::POS::USER::UPDATE",t.DEVICE_UPDATE="APP::POS::DEVICE::UPDATE"}(i=e.ActionType||(e.ActionType={})),e.close=s;var u=function(t){function e(e){return t.call(this,e,a.Group.Pos,a.Group.Pos)||this}return r(e,t),e.prototype.dispatch=function(t){switch(t){case i.CLOSE:this.app.dispatch(s())}return this},e}(c.ActionSet);e.Pos=u,e.create=function(t){return new u(t)}},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.create=e.MarketingExternalActivityTopBar=e.update=e.clickActionButton=e.MarketingActivityStatusBadgeType=e.ActionType=e.Action=void 0;var c,a,s=n(4),u=n(5),p=n(1),d=n(0);!function(t){t.UPDATE="UPDATE"}(c=e.Action||(e.Action={})),function(t){t.UPDATE="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::UPDATE",t.BUTTON_CLICK="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::BUTTONS::BUTTON::CLICK",t.BUTTON_UPDATE="APP::MARKETING_EXTERNAL_ACTIVITY_TOP_BAR::BUTTONS::BUTTON::UPDATE"}(a=e.ActionType||(e.ActionType={})),function(t){t.Default="DEFAULT",t.Success="SUCCESS",t.Attention="ATTENTION",t.Warning="WARNING",t.Info="INFO"}(e.MarketingActivityStatusBadgeType||(e.MarketingActivityStatusBadgeType={}));var f={group:d.Group.MarketingExternalActivityTopBar,subgroups:["Buttons"]};function h(t){return p.actionWrapper({payload:t,group:d.Group.MarketingExternalActivityTopBar,type:a.UPDATE})}e.clickActionButton=function(t,e){var n=d.ComponentType.Button,o=i({id:t,type:n},f);return s.clickButton(d.Group.MarketingExternalActivityTopBar,o,e)},e.update=h;var l=function(t){function e(e,n){var o=t.call(this,e,d.Group.MarketingExternalActivityTopBar,d.Group.MarketingExternalActivityTopBar)||this;return o.set(n),o}return r(e,t),Object.defineProperty(e.prototype,"buttons",{get:function(){if(this.primary||this.secondary)return{primary:this.primary,secondary:this.secondary}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buttonsOptions",{get:function(){if(this.primaryOptions||this.secondaryOptions)return{primary:this.primaryOptions,secondary:this.secondaryOptions}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return{title:this.title,status:this.status,saving:this.saving,saved:this.saved,buttons:this.buttonsOptions}},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 n=p.getMergedProps(this.options,t),o=n.title,r=n.buttons,i=n.saved,a=n.saving,s=n.status;return this.title=o,this.saving=a,this.saved=i,this.status=s,this.setPrimaryButton(r?r.primary:void 0),this.setSecondaryButtons(r?r.secondary:void 0),e&&this.dispatch(c.UPDATE),this},e.prototype.dispatch=function(t){switch(t){case c.UPDATE:this.app.dispatch(h(this.payload))}return this},e.prototype.getButton=function(t,e,n){return u.getSingleButton(this,t,e,n)},e.prototype.updatePrimaryButton=function(t){this.primary&&p.updateActionFromPayload(this.primary,t)&&this.dispatch(c.UPDATE)},e.prototype.updateSecondaryButtons=function(t){if(this.secondary){var e=this.secondary.find((function(e){return e.id===t.id}));if(e)p.updateActionFromPayload(e,t)&&this.dispatch(c.UPDATE)}},e.prototype.setPrimaryButton=function(t){this.primaryOptions=this.getChildButton(t,this.primaryOptions),this.primary=this.primaryOptions?this.getButton(this.primaryOptions,f.subgroups,this.updatePrimaryButton):void 0},e.prototype.setSecondaryButtons=function(t){var e=this,n=t||[],o=this.secondaryOptions||[];this.secondaryOptions=this.getUpdatedChildActions(n,o),this.secondary=this.secondaryOptions?this.secondaryOptions.map((function(t){return e.getButton(t,f.subgroups,e.updateSecondaryButtons)})):void 0},e.prototype.updateSaving=function(t){this.saving=t,this.dispatch(c.UPDATE)},e.prototype.updateSaved=function(t){this.saved=t,this.dispatch(c.UPDATE)},e.prototype.updateStatus=function(t){this.status=t,this.dispatch(c.UPDATE)},e.prototype.getChildButton=function(t,e){var n=t?[t]:[],o=e?[e]:[],r=this.getUpdatedChildActions(n,o);return r?r[0]:void 0},e}(p.ActionSetWithChildren);e.MarketingExternalActivityTopBar=l,e.create=function(t,e){return new l(t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fullPageLoad=e.skeletonPageLoad=e.Action=e.ActionType=void 0;var o,r=n(0),i=n(1);!function(t){t.SKELETON_PAGE_LOAD="APP::PERFORMANCE::SKELETON_PAGE_LOAD",t.FULL_PAGE_LOAD="APP::PERFORMANCE::FULL_PAGE_LOAD"}(o=e.ActionType||(e.ActionType={})),function(t){t.SKELETON_PAGE_LOAD="SKELETON_PAGE_LOAD",t.FULL_PAGE_LOAD="FULL_PAGE_LOAD"}(e.Action||(e.Action={})),e.skeletonPageLoad=function(){return i.actionWrapper({group:r.Group.Performance,type:o.SKELETON_PAGE_LOAD})},e.fullPageLoad=function(){return i.actionWrapper({group:r.Group.Performance,type:o.FULL_PAGE_LOAD})}},function(t,e,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||o(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0});var i=n(32);r(n(2),e),r(n(32),e),e.default=i.createClientApp},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.serverAppBridge=void 0;var o=n(3),r=function(){};e.serverAppBridge={dispatch:function(){return{}},error:function(){return r},featuresAvailable:function(){return Promise.reject(o.fromAction("Feature detection is only available on the client side.",o.AppActionType.WINDOW_UNDEFINED))},getState:function(){return Promise.reject(o.fromAction("State is only available on the client side.",o.AppActionType.WINDOW_UNDEFINED))},localOrigin:"",subscribe:function(){return r}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.handleAppPrint=void 0;var o=n(33);function r(){o.getWindow()&&window.print()}function i(){var t=function(){var t=o.getWindow();if(t&&t.document&&t.document.body){var e=window.document.createElement("input");return e.style.display="none",window.document.body.appendChild(e),e}}();t&&(t.select(),r(),t.remove())}e.handleAppPrint=function(){navigator.userAgent.indexOf("iOS")>=0?i():r()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(7),r=function(){function t(){this.map={}}return t.prototype.set=function(t,e){this.map.hasOwnProperty(t)||(this.map[t]=[]);var n={handler:e,remove:function(){}},r=o.addAndRemoveFromCollection(this.map[t],n);return n={handler:e,remove:r},r},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,n){for(var o=[],r=3;r<arguments.length;r++)o[r-3]=arguments[r];var i=0,c=this.get(t)||[];function a(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];var r=c[i++];return r?r(a).apply(n,t):e.apply(n,t)}return a.apply(n,o)},t}();e.default=r}])}));
@@ -0,0 +1,23 @@
1
+ //= require ./app_bridge_1.30.0.js
2
+
3
+ (function(window) {
4
+ function appBridgeRedirect(url) {
5
+ var AppBridge = window['app-bridge'];
6
+ var createApp = AppBridge.default;
7
+ var Redirect = AppBridge.actions.Redirect;
8
+ var shopifyData = window.shopifyData;
9
+
10
+ var app = createApp({
11
+ apiKey: shopifyData.apiKey,
12
+ shopOrigin: shopifyData.shopOrigin,
13
+ forceRedirect: false,
14
+ });
15
+
16
+ var normalizedLink = document.createElement('a');
17
+ normalizedLink.href = url;
18
+
19
+ Redirect.create(app).dispatch(Redirect.Action.REMOTE, normalizedLink.href);
20
+ }
21
+
22
+ window.appBridgeRedirect = appBridgeRedirect;
23
+ })(window);
@@ -0,0 +1,9 @@
1
+ (function() {
2
+ function redirect() {
3
+ var form = document.getElementById("redirect-form");
4
+ if (form) {
5
+ form.submit();
6
+ }
7
+ }
8
+ document.addEventListener("DOMContentLoaded", redirect);
9
+ })();
@@ -1,4 +1,6 @@
1
- (function() {
1
+ //= require ./app_bridge_redirect.js
2
+
3
+ (function () {
2
4
  function redirect() {
3
5
  var redirectTargetElement = document.getElementById("redirection-target");
4
6
 
@@ -6,21 +8,17 @@
6
8
  return;
7
9
  }
8
10
 
9
- var targetInfo = JSON.parse(redirectTargetElement.dataset.target)
11
+ var targetInfo = JSON.parse(redirectTargetElement.dataset.target);
10
12
 
11
13
  if (window.top == window.self) {
12
14
  // If the current window is the 'parent', change the URL by setting location.href
13
15
  window.top.location.href = targetInfo.url;
14
16
  } else {
15
- // If the current window is the 'child', change the parent's URL with postMessage
16
- normalizedLink = document.createElement('a');
17
- normalizedLink.href = targetInfo.url;
18
-
19
- data = JSON.stringify({
20
- message: 'Shopify.API.remoteRedirect',
21
- data: {location: normalizedLink.href}
22
- });
23
- window.parent.postMessage(data, targetInfo.myshopifyUrl);
17
+ // If the current window is the 'child' or embedded, change the parent's URL with
18
+ // App Bridge redirect. This case can happen when an app updates its access scopes,
19
+ // or the unlikely scenario where the shop thinks the app is installed, but the
20
+ // app does not have an record for the shop.
21
+ window.appBridgeRedirect(targetInfo.url);
24
22
  }
25
23
  }
26
24
 
@@ -1,3 +1,5 @@
1
+ //= require ./app_bridge_redirect.js
2
+
1
3
  (function() {
2
4
  var ACCESS_GRANTED_STATUS = 'storage_access_granted';
3
5
  var ACCESS_DENIED_STATUS = 'storage_access_denied';
@@ -13,15 +15,7 @@
13
15
  StorageAccessHelper.prototype.redirectToAppTLD = function(storageAccessStatus) {
14
16
  var normalizedLink = document.createElement('a');
15
17
 
16
- normalizedLink.href = this.setNormalizedLink(storageAccessStatus);
17
-
18
- data = JSON.stringify({
19
- message: 'Shopify.API.remoteRedirect',
20
- data: {
21
- location: normalizedLink.href,
22
- }
23
- });
24
- window.parent.postMessage(data, this.redirectData.myshopifyUrl);
18
+ window.appBridgeRedirect(this.setNormalizedLink(storageAccessStatus));
25
19
  }
26
20
 
27
21
  StorageAccessHelper.prototype.redirectToAppsIndex = function() {
@@ -132,8 +126,8 @@
132
126
 
133
127
  /* ITP 2.0 solution: handles cookie partitioning */
134
128
  StorageAccessHelper.prototype.setUpHelper = function() {
135
- var shopifyData = document.body.dataset;
136
- return new ITPHelper({redirectUrl: shopifyData.shopOrigin + "/admin/apps/" + shopifyData.apiKey + shopifyData.returnTo});
129
+ var shopifyData = window.shopifyData;
130
+ return new ITPHelper({redirectUrl: "https://" + shopifyData.shopOrigin + "/admin/apps/" + shopifyData.apiKey + shopifyData.returnTo});
137
131
  }
138
132
 
139
133
  StorageAccessHelper.prototype.setCookieAndRedirect = function() {
@@ -10,9 +10,22 @@ module ShopifyApp
10
10
 
11
11
  private
12
12
 
13
+ def splash_page
14
+ splash_page_with_params(
15
+ return_to: request.fullpath,
16
+ shop: current_shopify_domain,
17
+ host: params[:host]
18
+ )
19
+ end
20
+
21
+ def splash_page_with_params(params)
22
+ uri = URI(root_path)
23
+ uri.query = params.compact.to_query
24
+ uri.to_s
25
+ end
26
+
13
27
  def redirect_to_splash_page
14
- splash_page_path = root_path(return_to: request.fullpath, shop: current_shopify_domain)
15
- redirect_to(splash_page_path)
28
+ redirect_to(splash_page)
16
29
  rescue ShopifyApp::LoginProtection::ShopifyDomainNotFound => error
17
30
  Rails.logger.warn("[ShopifyApp::EnsureAuthenticatedLinks] Redirecting to login: [#{error.class}] "\
18
31
  "Could not determine current shop domain")
@@ -5,6 +5,13 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <base target="_top">
7
7
  <title>Redirecting…</title>
8
+ <script>
9
+ window.shopifyData = {
10
+ apiKey: '<%= ShopifyApp.configuration.api_key %>',
11
+ shopOrigin: '<%= @shop %>',
12
+ returnTo: '<%= params[:return_to] %>',
13
+ };
14
+ </script>
8
15
  <%= render 'shopify_app/partials/layout_styles' %>
9
16
  <%= render 'shopify_app/partials/typography_styles' %>
10
17
  <%= render 'shopify_app/partials/card_styles' %>
@@ -17,7 +24,7 @@
17
24
 
18
25
  <%= javascript_include_tag('shopify_app/enable_cookies', crossorigin: 'anonymous', integrity: true) %>
19
26
  </head>
20
- <body data-api-key="<%= ShopifyApp.configuration.api_key %>" data-shop-origin="https://<%= @shop %>" data-redirect-url="<%= @url %>">
27
+ <body data-redirect-url="<%= @url %>">
21
28
  <%=
22
29
  content_tag(
23
30
  :div, nil,
@@ -5,6 +5,13 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <base target="_top">
7
7
  <title>Redirecting…</title>
8
+ <script>
9
+ window.shopifyData = {
10
+ apiKey: '<%= ShopifyApp.configuration.api_key %>',
11
+ shopOrigin: '<%= current_shopify_domain %>',
12
+ returnTo: '<%= params[:return_to] %>',
13
+ };
14
+ </script>
8
15
  <%= render 'shopify_app/partials/layout_styles' %>
9
16
  <%= render 'shopify_app/partials/typography_styles' %>
10
17
  <%= render 'shopify_app/partials/card_styles' %>
@@ -18,16 +25,16 @@
18
25
  <body>
19
26
  <%=
20
27
  content_tag(:div, nil,
21
- id: 'redirection-target',
22
- data: {
23
- target: {
24
- myshopifyUrl: "https://#{current_shopify_domain}",
25
- hasStorageAccessUrl: "#{has_storage_access_url}",
26
- doesNotHaveStorageAccessUrl: "#{does_not_have_storage_access_url}",
27
- appTargetUrl: "#{app_target_url}"
28
- },
29
- },
30
- )
28
+ id: 'redirection-target',
29
+ data: {
30
+ target: {
31
+ myshopifyUrl: "https://#{current_shopify_domain}",
32
+ hasStorageAccessUrl: "#{has_storage_access_url}",
33
+ doesNotHaveStorageAccessUrl: "#{does_not_have_storage_access_url}",
34
+ appTargetUrl: "#{app_target_url}"
35
+ },
36
+ },
37
+ )
31
38
  %>
32
39
  <main id="RequestStorageAccess">
33
40
  <div class="Polaris-Page">
@@ -5,15 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <base target="_top">
7
7
  <title>Redirecting…</title>
8
- <script>
9
- function redirect() {
10
- var form = document.getElementById("redirect-form");
11
- if (form) {
12
- form.submit();
13
- }
14
- }
15
- document.addEventListener("DOMContentLoaded", redirect);
16
- </script>
8
+ <%= javascript_include_tag('shopify_app/post_redirect', crossorigin: 'anonymous', integrity: true) %>
17
9
  </head>
18
10
  <body>
19
11
  <%= form_tag '/auth/shopify', id: 'redirect-form' %>
@@ -1,10 +1,16 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en">
2
+ <html lang="<%= I18n.locale %>">
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <base target="_top">
7
7
  <title>Redirecting…</title>
8
+ <script>
9
+ window.shopifyData = {
10
+ apiKey: '<%= ShopifyApp.configuration.api_key %>',
11
+ shopOrigin: '<%= current_shopify_domain %>',
12
+ };
13
+ </script>
8
14
  <%= javascript_include_tag('shopify_app/redirect', crossorigin: 'anonymous', integrity: true) %>
9
15
  </head>
10
16
  <body>
@@ -11,6 +11,7 @@
11
11
  [App installation](#app-installation)
12
12
  * [My app won't install](#my-app-wont-install)
13
13
  * [My app keeps redirecting to login](#my-app-keeps-redirecting-to-login)
14
+ * [My app returns 401 during oauth](#my-app-returns-401-during-oauth)
14
15
 
15
16
  [JWT session tokens](#jwt-session-tokens)
16
17
  * [My app is still using cookies to authenticate](#my-app-is-still-using-cookies-to-authenticate)
@@ -67,6 +68,10 @@ Alternatively, you can upgrade to [`v17.2.0` of the shopify_app gem](/docs/Upgra
67
68
 
68
69
  This issue can occur when the session (the model you set as `ShopifyApp::SessionRepository.storage`) isn't deleted when the user uninstalls your app. A possible fix for this is listening to the `app/uninstalled` webhook and deleting the corresponding session in the webhook handler.
69
70
 
71
+ ### My app returns 401 during oauth
72
+
73
+ If your local dev env uses the `cookie_store` session storage strategy, you may encounter 401 errors during oauth due to a race condition between asset requests and `/auth/shopify`. You should be able to work around for local testing by using a different browser or session storage strategy. [Read more about the status of this issue](https://github.com/Shopify/shopify_app/issues/1269).
74
+
70
75
  ## JWT session tokens
71
76
 
72
77
  ### My app is still using cookies to authenticate
@@ -15,7 +15,7 @@ While you can customize the login view by creating a `/app/views/shopify_app/ses
15
15
 
16
16
  ```ruby
17
17
  ShopifyApp.configure do |config|
18
- config.login_url = 'https://my.domain.com/nested/login'
18
+ config.login_url = 'https://example.com/nested/login'
19
19
  end
20
20
  ```
21
21
 
@@ -77,6 +77,6 @@ class ReviewsController < ApplicationController
77
77
  end
78
78
  ```
79
79
 
80
- Create your app proxy URL in the [Shopify Partners dashboard](https://partners.shopify.com/organizations), making sure to point it to `https://your_app_website.com/app_proxy`.
80
+ Create your app proxy URL in the [Shopify Partners dashboard](https://partners.shopify.com/organizations), making sure to point it to `https://example.com/app_proxy`.
81
81
 
82
82
  ![Creating an App Proxy](/images/app-proxy-screenshot.png)
@@ -1,5 +1,15 @@
1
1
  # Handling changes in access scopes
2
- The Shopify App gem provides handling changes to scopes for both shop/offline and user/online tokens. To enable your app to login via OAuth on scope changes, you can set the following configuration flag in your `config/initializers/shopify_app.rb`:
2
+ ## Updating the list of scopes the app requests
3
+
4
+ Your app specifies the [access scopes](https://shopify.dev/api/usage/access-scopes) it requires in the Shopify App initializer, located at`config/initializers/shopify_app.rb`. To modify this list, update the comma-delimited configuration option:
5
+
6
+ ```ruby
7
+ config.scope = "read_products,write_discounts"
8
+ ```
9
+
10
+ ## Requesting new scopes from merchants
11
+
12
+ The Shopify App gem will automatically request new scopes from merchants for both shop/offline and user/online tokens. To enable your app to reauth via OAuth on scope changes, you can set the following configuration flag in your `config/initializers/shopify_app.rb`:
3
13
  ```ruby
4
14
  config.reauth_on_access_scope_changes = true
5
15
  ```
@@ -11,7 +11,7 @@ As with webhooks, ShopifyApp can manage your app's [ScriptTags](https://shopify-
11
11
  ```ruby
12
12
  ShopifyApp.configure do |config|
13
13
  config.scripttags = [
14
- {event:'onload', src: 'https://my-shopifyapp.herokuapp.com/fancy.js'},
14
+ {event:'onload', src: 'https://example.com/fancy.js'},
15
15
  {event:'onload', src: ->(domain) { dynamic_tag_url(domain) } }
16
16
  ]
17
17
  end
@@ -12,7 +12,7 @@ ShopifyApp can manage your app's webhooks for you if you set which webhooks you
12
12
  ```ruby
13
13
  ShopifyApp.configure do |config|
14
14
  config.webhooks = [
15
- {topic: 'carts/update', address: 'https://example-app.com/webhooks/carts_update'}
15
+ {topic: 'carts/update', address: 'https://example.com/webhooks/carts_update'}
16
16
  ]
17
17
  end
18
18
  ```
@@ -34,7 +34,7 @@ If you are only interested in particular fields, you can optionally filter the d
34
34
  ```ruby
35
35
  ShopifyApp.configure do |config|
36
36
  config.webhooks = [
37
- {topic: 'products/update', address: 'https://example-app.com/webhooks/products_update', fields: ['title', 'vendor']}
37
+ {topic: 'products/update', address: 'https://example.com/webhooks/products_update', fields: ['title', 'vendor']}
38
38
  ]
39
39
  end
40
40
  ```
@@ -67,7 +67,7 @@ module ShopifyApp
67
67
  def insert_hosts_into_development_config
68
68
  inject_into_file(
69
69
  'config/environments/development.rb',
70
- " config.hosts = (config.hosts rescue []) << /\\w+\\.ngrok\\.io/\n",
70
+ " config.hosts = (config.hosts rescue []) << /\[-\w]+\\.ngrok\\.io/\n",
71
71
  after: "Rails.application.configure do\n"
72
72
  )
73
73
  end
@@ -17,6 +17,7 @@ module ShopifyApp
17
17
  initializer "shopify_app.assets.precompile" do |app|
18
18
  app.config.assets.precompile += %w[
19
19
  shopify_app/redirect.js
20
+ shopify_app/post_redirect.js
20
21
  shopify_app/top_level.js
21
22
  shopify_app/enable_cookies.js
22
23
  shopify_app/request_storage_access.js
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ShopifyApp
3
- VERSION = '18.0.0'
3
+ VERSION = '18.0.4'
4
4
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopify_app",
3
- "version": "18.0.0",
3
+ "version": "18.0.4",
4
4
  "repository": "git@github.com:Shopify/shopify_app.git",
5
5
  "author": "Shopify",
6
6
  "license": "MIT",
data/service.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  audience: partner
2
2
  classification: library
3
3
  slack_channels:
4
- - core-build-extend
4
+ - shopify_app_gem
data/shopify_app.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.metadata['allowed_push_host'] = 'https://rubygems.org'
15
15
 
16
- s.add_runtime_dependency('browser_sniffer', '~> 1.2.2')
16
+ s.add_runtime_dependency('browser_sniffer', '~> 1.4.0')
17
17
  s.add_runtime_dependency('omniauth-rails_csrf_protection')
18
18
  s.add_runtime_dependency('rails', '> 5.2.1', '< 6.2')
19
19
  s.add_runtime_dependency('shopify_api', '~> 9.4')
data/translation.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  source_language: en
2
- target_languages: [cs, da, de, es, fi, fr, hi, it, ja, ko, ms, nb, nl, pl, pt-BR, pt-PT, sv, th, tr, vi, zh-CN, zh-TW]
2
+ target_languages: [cs, da, de, es, fi, fr, it, ja, ko, nb, nl, pl, pt-BR, pt-PT, sv, th, tr, vi, zh-CN, zh-TW]
3
3
  components:
4
4
  - name: 'merchant'
5
5
  paths:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.0.0
4
+ version: 18.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-03 00:00:00.000000000 Z
11
+ date: 2022-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser_sniffer
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.2
19
+ version: 1.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.2.2
26
+ version: 1.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: omniauth-rails_csrf_protection
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -283,9 +283,12 @@ files:
283
283
  - Rakefile
284
284
  - SECURITY.md
285
285
  - app/assets/images/storage_access.svg
286
+ - app/assets/javascripts/shopify_app/app_bridge_1.30.0.js
287
+ - app/assets/javascripts/shopify_app/app_bridge_redirect.js
286
288
  - app/assets/javascripts/shopify_app/enable_cookies.js
287
289
  - app/assets/javascripts/shopify_app/itp_helper.js
288
290
  - app/assets/javascripts/shopify_app/partition_cookies.js
291
+ - app/assets/javascripts/shopify_app/post_redirect.js
289
292
  - app/assets/javascripts/shopify_app/redirect.js
290
293
  - app/assets/javascripts/shopify_app/request_storage_access.js
291
294
  - app/assets/javascripts/shopify_app/storage_access.js
@@ -320,11 +323,9 @@ files:
320
323
  - config/locales/es.yml
321
324
  - config/locales/fi.yml
322
325
  - config/locales/fr.yml
323
- - config/locales/hi.yml
324
326
  - config/locales/it.yml
325
327
  - config/locales/ja.yml
326
328
  - config/locales/ko.yml
327
- - config/locales/ms.yml
328
329
  - config/locales/nb.yml
329
330
  - config/locales/nl.yml
330
331
  - config/locales/pl.yml
@@ -460,7 +461,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
460
461
  - !ruby/object:Gem::Version
461
462
  version: '0'
462
463
  requirements: []
463
- rubygems_version: 3.0.3
464
+ rubygems_version: 3.2.20
464
465
  signing_key:
465
466
  specification_version: 4
466
467
  summary: This gem is used to get quickly started with the Shopify API
@@ -1,23 +0,0 @@
1
- ---
2
- hi:
3
- logged_out: सफलतापूर्वक लॉग आउट कर दिया
4
- could_not_log_in: Shopify स्टोर में लॉग इन नहीं किया जा सका
5
- invalid_shop_url: अमान्य शॉप डोमेन
6
- enable_cookies_heading: "%{app} के कुकीज़ सक्षम करें"
7
- enable_cookies_body: आपको %{app} का उपयोग Shopify में करने के लिए इस ब्राउज़र में
8
- कुकीज़ मैन्युअल रूप से सक्षम करने चाहिए.
9
- enable_cookies_footer: कुकीज़ अस्थायी रूप से आपकी वरीयताएं और व्यक्तिगत जानकारी स्टोर
10
- कर ऐप को आपको प्रमाणित करने देते हैं. इनकी समय-सीमा 30 दिनों बाद समाप्त हो जाती
11
- है.
12
- enable_cookies_action: कुकीज़ को सक्षम करें
13
- top_level_interaction_heading: आपके ब्राउज़र को %{app} प्रमाणित करने की आवश्यकता
14
- है
15
- top_level_interaction_body: आपके ब्राउज़र को %{app} जैसे ऐप की ज़रूरत होती है, जो
16
- Shopify द्वारा आपके लिए उसे खोलने से पहले कुकीज़ पर पहुंचने करने की अनुमति मांगे.
17
- top_level_interaction_action: जारी रखें
18
- request_storage_access_heading: "%{app} को कुकीज़ पर पहुंच करने की आवश्यकता है"
19
- request_storage_access_body: यह आपकी व्यक्तिगत जानकारी अस्थायी रूप से स्टोर कर ऐप
20
- को आपको प्रमाणित करने देता है. जारी रखें पर क्लिक करें और कुकीज़ को ऐप उपयोग करने
21
- की अनुमति दें.
22
- request_storage_access_footer: कुकीज़ की समय-सीमा 30 दिनों बाद समाप्त हो जाती है.
23
- request_storage_access_action: जारी रखें
@@ -1,22 +0,0 @@
1
- ---
2
- ms:
3
- logged_out: Berjaya log keluar
4
- could_not_log_in: Tidak dapat log masuk ke kedai Shopify
5
- invalid_shop_url: Domain kedai tidak sah
6
- enable_cookies_heading: Dayakan kuki dari %{app}
7
- enable_cookies_body: Anda mesti mengaktifkan kuki secara manual dalam pelayar ini
8
- untuk %{app} digunakan dalam Shopify.
9
- enable_cookies_footer: Kuki membenarkan aplikasi mengesahkan anda dengan menyimpan
10
- keutamaan dan maklumat peribadi anda buat sementara waktu. Ia tamat tempoh selepas
11
- 30 hari.
12
- enable_cookies_action: Dayakan kuki
13
- top_level_interaction_heading: Pelayar anda perlu mengesahkan %{app}
14
- top_level_interaction_body: Pelayar anda memerlukan aplikasi seperti %{app} untuk
15
- meminta anda akses kepada kuki sebelum Shopify boleh membukanya untuk anda.
16
- top_level_interaction_action: Teruskan
17
- request_storage_access_heading: "%{app} memerlukan akses kepada kuki"
18
- request_storage_access_body: Ini membolehkan aplikasi mengesahkan anda dengan menyimpan
19
- maklumat peribadi anda buat sementara waktu. Klik teruskan dan benarkan kuki untuk
20
- menggunakan aplikasi.
21
- request_storage_access_footer: Kuki akan tamat tempoh selepas 30 hari.
22
- request_storage_access_action: Teruskan