@shopify/hydrogen-react 0.0.0-next-ebab9ba → 0.0.0-next-6783a31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,7 +43,7 @@
43
43
  *
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
- */var Re;function vt(){return Re||(Re=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=D.default,t=Ue();function r(f,l){return f===l&&(f!==0||1/f===1/l)||f!==f&&l!==l}var a=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,i=e.useRef,u=e.useEffect,n=e.useMemo,d=e.useDebugValue;function c(f,l,_,m,E){var T=i(null),S;T.current===null?(S={hasValue:!1,value:null},T.current=S):S=T.current;var b=n(function(){var y=!1,g,w,N=function(V){if(!y){y=!0,g=V;var P=m(V);if(E!==void 0&&S.hasValue){var H=S.value;if(E(H,P))return w=H,H}return w=P,P}var K=g,B=w;if(a(K,V))return B;var O=m(V);return E!==void 0&&E(B,O)?B:(g=V,w=O,O)},v=_===void 0?null:_,I=function(){return N(l())},R=v===null?void 0:function(){return N(v())};return[I,R]},[l,_,m,E]),C=b[0],p=b[1],s=o(f,C,p);return u(function(){S.hasValue=!0,S.value=s},[s]),d(s),s}ye.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),ye}(function(e){process.env.NODE_ENV==="production"?e.exports=bt():e.exports=vt()})(Ie);function Tt(e){var t=Se.useRef();return t.current||(t.current={v:e()}),t.current.v}var $e=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),o,i=[],u;try{for(;(t===void 0||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(n){u={error:n}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(u)throw u.error}}return i};function At(e){return e}var wt=function(e){var t;return e.subscribe(function(r){t=r}).unsubscribe(),t};function Nt(e,t){var r=h.useRef();if(process.env.NODE_ENV!=="production"){var a=$e(h.useState(e),1),o=a[0];e!==o&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var i=$e(Tt(function(){var c=[],f=Et(we(e.config,t||e._options)),l=f.send;return f.send=function(_){if(f.status===Y.NotStarted){c.push(_);return}l(_),r.current=f.state},[f,c]}),2),u=i[0],n=i[1];St(function(){t&&(u._machine._options=t)});var d=Ot(u);return h.useEffect(function(){return u.start(r.current),n.forEach(u.send),r.current=u.state,function(){u.stop()}},[]),d}var It=function(e,t){return t.changed===!1};function Ot(e){var t=h.useCallback(function(){return wt(e)},[e]),r=h.useCallback(function(o){var i=e.subscribe(o).unsubscribe;return i},[e]),a=Ie.exports.useSyncExternalStoreWithSelector(r,t,t,At,It);return[a,e.send,e]}function q(e){if(!e){const t=`flattenConnection(): needs a 'connection' to flatten, but received '${e}' instead`;return console.error(t),[]}return e.nodes?e.nodes:e.edges?e.edges.map(t=>{if(!(t!=null&&t.node))throw new Error("Connection edges must contain nodes");return t.node}):[]}const Dt=e=>`
46
+ */var Re;function vt(){return Re||(Re=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=D.default,t=Ue();function r(f,l){return f===l&&(f!==0||1/f===1/l)||f!==f&&l!==l}var a=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,i=e.useRef,u=e.useEffect,n=e.useMemo,d=e.useDebugValue;function c(f,l,_,m,E){var T=i(null),S;T.current===null?(S={hasValue:!1,value:null},T.current=S):S=T.current;var b=n(function(){var y=!1,g,w,N=function(V){if(!y){y=!0,g=V;var P=m(V);if(E!==void 0&&S.hasValue){var H=S.value;if(E(H,P))return w=H,H}return w=P,P}var K=g,B=w;if(a(K,V))return B;var O=m(V);return E!==void 0&&E(B,O)?B:(g=V,w=O,O)},v=_===void 0?null:_,I=function(){return N(l())},R=v===null?void 0:function(){return N(v())};return[I,R]},[l,_,m,E]),C=b[0],p=b[1],s=o(f,C,p);return u(function(){S.hasValue=!0,S.value=s},[s]),d(s),s}ye.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),ye}(function(e){process.env.NODE_ENV==="production"?e.exports=bt():e.exports=vt()})(Ie);function Tt(e){var t=Se.useRef();return t.current||(t.current={v:e()}),t.current.v}var $e=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),o,i=[],u;try{for(;(t===void 0||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(n){u={error:n}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(u)throw u.error}}return i};function At(e){return e}var wt=function(e){var t;return e.subscribe(function(r){t=r}).unsubscribe(),t};function Nt(e,t){var r=h.useRef();if(process.env.NODE_ENV!=="production"){var a=$e(h.useState(e),1),o=a[0];e!==o&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var i=$e(Tt(function(){var c=[],f=Et(we(e.config,t||e._options)),l=f.send;return f.send=function(_){if(f.status===Y.NotStarted){c.push(_);return}l(_),r.current=f.state},[f,c]}),2),u=i[0],n=i[1];St(function(){t&&(u._machine._options=t)});var d=Ot(u);return h.useEffect(function(){return u.start(r.current),n.forEach(u.send),r.current=u.state,function(){u.stop()}},[]),d}var It=function(e,t){return t.changed===!1};function Ot(e){var t=h.useCallback(function(){return wt(e)},[e]),r=h.useCallback(function(o){var i=e.subscribe(o).unsubscribe;return i},[e]),a=Ie.exports.useSyncExternalStoreWithSelector(r,t,t,At,It);return[a,e.send,e]}function q(e){if(!e){const t=`flattenConnection(): needs a 'connection' to flatten, but received '${e}' instead.`;return console.error(t+" Returning an empty array"),[]}return"nodes"in e?e.nodes:"edges"in e&&Array.isArray(e.edges)?e.edges.map(t=>{if(!(t!=null&&t.node))throw new Error("flattenConnection(): Connection edges must contain nodes");return t.node}):[]}const Dt=e=>`
47
47
  mutation CartLineAdd(
48
48
  $cartId: ID!
49
49
  $lines: [CartLineInput!]!