@saasquatch/component-boilerplate 1.4.0 → 1.4.1-0
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.
- package/dist/hooks/managedIdentity/useRegisterViaRegistrationFormMutation.d.ts +38 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +51 -15
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +1 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProvider as t}from"dom-context";import{useEffect as
|
|
1
|
+
import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProvider as t}from"dom-context";import{useEffect as r,useReducer as n,useCallback as o,useMemo as a,useRef as i,useState as s}from"@saasquatch/universal-hooks";import{gql as u,GraphQLClient as c}from"graphql-request";import l from"jwt-decode";import{equal as d}from"@wry/equality";import{parse as f,print as p}from"graphql";import m from"fast-memoize";import{Subject as y}from"rxjs";import{bufferTime as g}from"rxjs/operators";import{nanoid as h}from"nanoid";import{ClientError as v}from"graphql-request/dist/types";import b from"graphql-combine-query";import{createMemoryHistory as w,createBrowserHistory as C}from"history";import S from"debounce";import _ from"jsonpointer";const E={current:void 0};function P(){if(void 0===E.current)throw new Error("no implementation of useHost provided");return E.current()}function k(e){if(!e)throw new Error("Must supply an implementation");if("function"!=typeof e)throw new Error("implementation must be a function");E.current=e}function F(){var e;window.squatchProgramId||(window.squatchProgramId=new t({element:document.documentElement,initialState:(null==(e=window.widgetIdent)?void 0:e.programId)||void 0,contextName:"sq:program-id"}).start())}function I(){F();const t=P();return e(t,"sq:program-id")}function $(e){F(),window.squatchProgramId.context=e}let j;const R=u(j||(j=(e=>e)`
|
|
2
2
|
query {
|
|
3
3
|
viewer {
|
|
4
4
|
... on User {
|
|
@@ -6,7 +6,7 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
`));function k(){!function(){var e;const r=window.squatchLocale,a=ee();n(()=>{if(!a&&r)return r.context=void 0;o({})},[a]);const[o,{data:i}]=ze(A),s=null==i||null==(e=i.viewer)?void 0:e.locale;var c;r?s!==r.context&&(r.context=s):window.squatchLocale=new t({element:document.documentElement,initialState:s||(null==(c=window.widgetIdent)?void 0:c.locale)||void 0,contextName:"sq:locale"}).start()}();const r=S();return e(r,"sq:locale")}function x(e){const t=window.squatchLocale;t&&(t.context=e)}function j(){var e,t;return window.SquatchAndroid?{type:"SquatchAndroid",android:window.SquatchAndroid,widgetIdent:window.widgetIdent}:window.SquatchPortal?{type:"SquatchPortal",env:window.SquatchPortal}:window.SquatchAdmin?{type:"SquatchAdmin",adminSDK:window.SquatchAdmin}:window.widgetIdent&&"demo"!==(null==(e=window.widgetIdent)?void 0:e.env)?{type:"SquatchJS2",api:null==(t=window.frameElement)?void 0:t.squatchJsApi,widgetIdent:window.widgetIdent}:{type:"None"}}function R(){const e=j();return"None"===e.type||"SquatchAdmin"===e.type}function V(){const e=j();switch(e.type){case"SquatchAndroid":case"SquatchJS2":return e.widgetIdent.tenantAlias;case"SquatchAdmin":case"None":return"demo";case"SquatchPortal":return e.env.tenantAlias}}function N(){var e;const t=j();switch(t.type){case"SquatchAndroid":case"SquatchJS2":return t.widgetIdent.appDomain;case"SquatchPortal":return(null==(e=t.env)?void 0:e.appDomain)||"https://app.referralsaasquatch.com";case"SquatchAdmin":case"None":return"https://app.referralsaasquatch.com"}}function O(){const e=j();switch(e.type){case"SquatchJS2":return e.widgetIdent.engagementMedium||"EMBED";case"SquatchAndroid":case"SquatchPortal":case"SquatchAdmin":case"None":return"EMBED"}}function H(){return(H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var L=1e3,W=60*L,U=60*W,J=24*U,_=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return 6048e5*n;case"days":case"day":case"d":return n*J;case"hours":case"hour":case"hrs":case"hr":case"h":return n*U;case"minutes":case"minute":case"mins":case"min":case"m":return n*W;case"seconds":case"second":case"secs":case"sec":case"s":return n*L;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=J?Q(e,t,J,"day"):t>=U?Q(e,t,U,"hour"):t>=W?Q(e,t,W,"minute"):t>=L?Q(e,t,L,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=J?Math.round(e/J)+"d":t>=U?Math.round(e/U)+"h":t>=W?Math.round(e/W)+"m":t>=L?Math.round(e/L)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Q(e,t,n,r){var a=t>=1.5*n;return Math.round(e/n)+" "+r+(a?"s":"")}var T,z=(function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,a=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(a=r))}),t.splice(a,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=function(e){function t(e){let r,a=null;function o(...e){if(!o.enabled)return;const n=o,a=Number(new Date);n.diff=a-(r||a),n.prev=r,n.curr=a,r=a,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,a)=>{if("%%"===r)return"%";i++;const o=t.formatters[a];return"function"==typeof o&&(r=o.call(n,e[i]),e.splice(i,1),i--),r}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=n,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null===a?t.enabled(e):a,set:e=>{a=e}}),"function"==typeof t.init&&t.init(o),o}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),a=r.length;for(n=0;n<a;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=_,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(T={exports:{}},T.exports),T.exports);const G=z("sq:user-identity");function B(){window.squatchUserIdentity||(window.squatchUserIdentity=new t({element:document.documentElement,initialState:Z(),contextName:"sq:user-identity"}).start())}function K(e){if(e)try{const t=d(e),n=t.exp;let r,a;if(function(e){return e.sub&&/.*:.*@.*:users/.test(e.sub)}(t)){const e=t.sub.match(/(.*):(.*)@(.*):users/);a=atob(e[1]),r=atob(e[2])}else(function(e){return e.user&&e.user.id&&e.user.accountId})(t)&&(a=t.user.accountId,r=t.user.id);if(!r||!a)return;if(n&&Date.now()>=1e3*n)return;return{id:r,accountId:a,jwt:e}}catch(e){return}}function Z(){const e=j();switch(e.type){case"SquatchAndroid":case"SquatchJS2":return{id:e.widgetIdent.userId,accountId:e.widgetIdent.accountId,jwt:e.widgetIdent.token};case"SquatchPortal":const t=new URLSearchParams(document.location.search);if(t.has("jwt"))return K(t.get("jwt"));const n=localStorage.getItem("sq:user-identity");if(!n)return;try{const e=JSON.parse(n),t=K(e.jwt);return t?H({},e,t):void 0}catch(e){return}case"SquatchAdmin":case"None":return}}function X(e){B();const t=window.squatchUserIdentity;l(t.context,e)||(x(void 0),t.context=e),e&&"SquatchPortal"===j().type?localStorage.setItem("sq:user-identity",JSON.stringify(e)):e||(G("Deleting user from localStorage"),localStorage.removeItem("sq:user-identity"))}function Y(){var e;return null==(e=ee())?void 0:e.jwt}function ee(){B();const t=S(),n=e(t,"sq:user-identity"),r=K(null==n?void 0:n.jwt);return n&&!r?(X(void 0),void x(void 0)):n}var te=function(){return(te=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},ne=new Map,re=new Map,ae=!0,oe=!1;function ie(e){return e.replace(/[\s,]+/g," ").trim()}function se(e){var t,n,r,a=ie(e);if(!ne.has(a)){var o=m(e,{experimentalFragmentVariables:oe});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");ne.set(a,function(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}((t=o,n=new Set,r=[],t.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,a=ie((i=e.loc).source.body.substring(i.start,i.end)),o=re.get(t);o&&!o.has(a)?ae&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||re.set(t,o=new Set),o.add(a),n.has(a)||(n.add(a),r.push(e))}else r.push(e);var i}),te(te({},t),{definitions:r}))))}return ne.get(a)}function ce(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach(function(t,n){r+=t&&"Document"===t.kind?t.loc.source.body:t,r+=e[n+1]}),se(r)}var ue,de=ce;(ue=ce||(ce={})).gql=de,ue.resetCaches=function(){ne.clear(),re.clear()},ue.disableFragmentWarnings=function(){ae=!1},ue.enableExperimentalFragmentVariables=function(){oe=!0},ue.disableExperimentalFragmentVariables=function(){oe=!1},ce.default=ce;var le=ce;class me extends u{constructor(e,t){var n;super(e,t),n=this,this.subject=new p;const r=new p;this.subject.pipe(h(200,void 0,10)).subscribe(async function(e){if(!e.length)return;const{mergedQuery:t,mergedVariables:a,mergedQueryAddedEvents:o,unmergedQueryAddedEvents:i}=he(e);for(const e of i)r.next(e);if(o.length)try{const e=await n.superRequest(t,a);ve(e,o)}catch(e){if(e instanceof w){const{data:t,errors:n}=e.response;if(!t)return be(o,e);const r=Object.keys(t);let a=[...o];for(const t of n){let n;t.path.find((o,i,s)=>{if(r.includes(o)){const c=pe(o),u=a.findIndex(e=>e.id===c);if(-1===u)return!1;r.splice(i,1),n=a.splice(u,1)[0];const d=ye(e.response.data,n);s[i]=ge(s[i],c);const{query:l,variables:m}=n,g=H({},e.response,{errors:[t],data:d,path:s}),p=new w(g,{query:"string"!=typeof l?f(l):l,variables:m});return Ce(n,p),!0}return!1})}ve(t,a)}else be(o,e)}}),r.subscribe(async function(e){try{const{query:t,variables:r}=e,a=await n.superRequest(t,r);we(a,e)}catch(t){Ce(e,t)}})}superRequest(e,t){return super.request(e,t)}request(e,t){return new Promise((n,r)=>{const a={query:e,variables:t,id:fe(),resolve:n,reject:r};this.subject.next(a)})}}const fe=()=>y().replace(/[-_]/g,""),ge=(e,t)=>e.replace(`_${t}`,""),pe=e=>{const t=e.split("_");return t[t.length-1]},he=e=>{const t=[],n=[],{document:r,variables:a}=e.reduce((e,r)=>{const{query:a,variables:o,id:i}=r;try{const s="string"==typeof a?m(a):a,c=s.definitions.find(e=>"FragmentDefinition"===e.kind),u="string"==typeof a?a:f(a),d=/@/.test(u);if(c||d)return n.push(r),e;const l=e=>((e,t)=>`${e}_${t}`)(e,i);return e=e.addN(s,[o],l,l),t.push(r),e}catch(t){return n.push(r),e}},v("BatchedQuery"));return{mergedQuery:r&&f(r),mergedVariables:a,mergedQueryAddedEvents:t,unmergedQueryAddedEvents:n}},ye=(e,t)=>{if(!e)return e;const n=Object.keys(e),{id:r}=t;return n.reduce((t,n)=>(n.endsWith(r)&&(t=H({},t,{[ge(n,r)]:e[n]})),t),{})},we=(e,t)=>{const{resolve:n}=t;n(e)},ve=(e,t)=>{for(const n of t){const t=ye(e,n);n.resolve(t)}},Ce=(e,t)=>{const{reject:n}=e;n(t)},be=(e,t)=>{for(const n of e){const{reject:e}=n;e(t)}},Ie="sq:graphql-client",Fe=g(function(e,t,n){return new me(e+"/api/v1/"+t+"/graphql",{headers:{Authorization:`Bearer ${n||""}`}})});function qe(e,t){switch(t.type){case"loading":return{data:void 0,errors:void 0,loading:!0};case"data":return{data:t.payload,errors:void 0,loading:!1};case"errors":return{data:void 0,errors:t.payload,loading:!1}}}function Se(t,n){const o=function(){const t=Y(),n=N(),r=V(),a=Fe(n,r,t),o=S(),i=e(o,"sq:graphql-client",{attempts:0});return null!=i?i:a}(),[i,s]=r(qe,n);return[i,a(async function(e,n=!1){if(o)try{n||s({type:"loading"});const r=await o.request(t,e);s({type:"data",payload:r})}catch(e){s({type:"errors",payload:e})}else s({type:"errors",payload:new Error("No GraphQL client found")})},[o,t,s])]}const Ee={loading:!1,data:void 0,errors:void 0};function Pe(e){const[t,n]=Se(e,Ee);return[n,t]}let Me;const De=le(Me||(Me=(e=>e)`
|
|
9
|
+
`));function q(){!function(){var e;const n=window.squatchLocale,o=ee();r(()=>{if(!o&&n)return n.context=void 0;a({})},[o]);const[a,{data:i}]=ot(R),s=null==i||null==(e=i.viewer)?void 0:e.locale;var u;n?s!==n.context&&(n.context=s):window.squatchLocale=new t({element:document.documentElement,initialState:s||(null==(u=window.widgetIdent)?void 0:u.locale)||void 0,contextName:"sq:locale"}).start()}();const n=P();return e(n,"sq:locale")}function O(e){const t=window.squatchLocale;t&&(t.context=e)}function D(){var e,t;return window.SquatchAndroid?{type:"SquatchAndroid",android:window.SquatchAndroid,widgetIdent:window.widgetIdent}:window.SquatchPortal?{type:"SquatchPortal",env:window.SquatchPortal}:window.SquatchAdmin?{type:"SquatchAdmin",adminSDK:window.SquatchAdmin}:window.widgetIdent&&"demo"!==(null==(e=window.widgetIdent)?void 0:e.env)?{type:"SquatchJS2",api:null==(t=window.frameElement)?void 0:t.squatchJsApi,widgetIdent:window.widgetIdent}:{type:"None"}}function x(){const e=D();return"None"===e.type||"SquatchAdmin"===e.type}function A(){const e=D();switch(e.type){case"SquatchAndroid":case"SquatchJS2":return e.widgetIdent.tenantAlias;case"SquatchAdmin":case"None":return"demo";case"SquatchPortal":return e.env.tenantAlias}}function M(){var e;const t=D();switch(t.type){case"SquatchAndroid":case"SquatchJS2":return t.widgetIdent.appDomain;case"SquatchPortal":return(null==(e=t.env)?void 0:e.appDomain)||"https://app.referralsaasquatch.com";case"SquatchAdmin":case"None":return"https://app.referralsaasquatch.com"}}function N(){const e=D();switch(e.type){case"SquatchJS2":return e.widgetIdent.engagementMedium||"EMBED";case"SquatchAndroid":case"SquatchPortal":case"SquatchAdmin":case"None":return"EMBED"}}function V(){return(V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function T(e){var t={exports:{}};return e(t,t.exports),t.exports}var U=1e3,L=60*U,H=60*L,W=24*H,z=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return r*W;case"hours":case"hour":case"hrs":case"hr":case"h":return r*H;case"minutes":case"minute":case"mins":case"min":case"m":return r*L;case"seconds":case"second":case"secs":case"sec":case"s":return r*U;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===r&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=W?J(e,t,W,"day"):t>=H?J(e,t,H,"hour"):t>=L?J(e,t,L,"minute"):t>=U?J(e,t,U,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=W?Math.round(e/W)+"d":t>=H?Math.round(e/H)+"h":t>=L?Math.round(e/L)+"m":t>=U?Math.round(e/U)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function J(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}var B=T(function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=function(e){function t(e){let n,o=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date);r.diff=o-(n||o),r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return"%";i++;const a=t.formatters[o];return"function"==typeof a&&(n=a.call(r,e[i]),e.splice(i,1),i--),n}),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null===o?t.enabled(e):o,set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=z,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});const Y=B("sq:user-identity");function Q(){window.squatchUserIdentity||(window.squatchUserIdentity=new t({element:document.documentElement,initialState:K(),contextName:"sq:user-identity"}).start())}function G(e){if(e)try{const t=l(e),r=t.exp;let n,o;if(function(e){return e.sub&&/.*:.*@.*:users/.test(e.sub)}(t)){const e=t.sub.match(/(.*):(.*)@(.*):users/);o=atob(e[1]),n=atob(e[2])}else(function(e){return e.user&&e.user.id&&e.user.accountId})(t)&&(o=t.user.accountId,n=t.user.id);if(!n||!o)return;if(r&&Date.now()>=1e3*r)return;return{id:n,accountId:o,jwt:e}}catch(e){return}}function K(){const e=D();switch(e.type){case"SquatchAndroid":case"SquatchJS2":return{id:e.widgetIdent.userId,accountId:e.widgetIdent.accountId,jwt:e.widgetIdent.token};case"SquatchPortal":const t=new URLSearchParams(document.location.search);if(t.has("jwt"))return G(t.get("jwt"));const r=localStorage.getItem("sq:user-identity");if(!r)return;try{const e=JSON.parse(r),t=G(e.jwt);return t?V({},e,t):void 0}catch(e){return}case"SquatchAdmin":case"None":return}}function X(e){Q();const t=window.squatchUserIdentity;d(t.context,e)||(O(void 0),t.context=e),e&&"SquatchPortal"===D().type?localStorage.setItem("sq:user-identity",JSON.stringify(e)):e||(Y("Deleting user from localStorage"),localStorage.removeItem("sq:user-identity"))}function Z(){var e;return null==(e=ee())?void 0:e.jwt}function ee(){Q();const t=P(),r=e(t,"sq:user-identity"),n=G(null==r?void 0:r.jwt);return r&&!n?(X(void 0),void O(void 0)):r}var te=function(){return(te=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},re=new Map,ne=new Map,oe=!0,ae=!1;function ie(e){return e.replace(/[\s,]+/g," ").trim()}function se(e){var t,r,n,o=ie(e);if(!re.has(o)){var a=f(e,{experimentalFragmentVariables:ae});if(!a||"Document"!==a.kind)throw new Error("Not a valid GraphQL document.");re.set(o,function(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}((t=a,r=new Set,n=[],t.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,o=ie((i=e.loc).source.body.substring(i.start,i.end)),a=ne.get(t);a&&!a.has(o)?oe&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||ne.set(t,a=new Set),a.add(o),r.has(o)||(r.add(o),n.push(e))}else n.push(e);var i}),te(te({},t),{definitions:n}))))}return re.get(o)}function ue(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach(function(t,r){n+=t&&"Document"===t.kind?t.loc.source.body:t,n+=e[r+1]}),se(n)}var ce,le=ue;(ce=ue||(ue={})).gql=le,ce.resetCaches=function(){re.clear(),ne.clear()},ce.disableFragmentWarnings=function(){oe=!1},ce.enableExperimentalFragmentVariables=function(){ae=!0},ce.disableExperimentalFragmentVariables=function(){ae=!1},ue.default=ue;var de=ue;class fe extends c{constructor(e,t){var r;super(e,t),r=this,this.subject=new y;const n=new y;this.subject.pipe(g(200,void 0,10)).subscribe(async function(e){if(!e.length)return;const{mergedQuery:t,mergedVariables:o,mergedQueryAddedEvents:a,unmergedQueryAddedEvents:i}=ge(e);for(const e of i)n.next(e);if(a.length)try{const e=await r.superRequest(t,o);be(e,a)}catch(e){if(e instanceof v){const{data:t,errors:r}=e.response;if(!t)return Ce(a,e);const n=Object.keys(t);let o=[...a];for(const t of r){let r;t.path.find((a,i,s)=>{if(n.includes(a)){const u=ye(a),c=o.findIndex(e=>e.id===u);if(-1===c)return!1;n.splice(i,1),r=o.splice(c,1)[0];const l=he(e.response.data,r);s[i]=me(s[i],u);const{query:d,variables:f}=r,m=V({},e.response,{errors:[t],data:l,path:s}),y=new v(m,{query:"string"!=typeof d?p(d):d,variables:f});return we(r,y),!0}return!1})}be(t,o)}else Ce(a,e)}}),n.subscribe(async function(e){try{const{query:t,variables:n}=e,o=await r.superRequest(t,n);ve(o,e)}catch(t){we(e,t)}})}superRequest(e,t){return super.request(e,t)}request(e,t){return new Promise((r,n)=>{const o={query:e,variables:t,id:pe(),resolve:r,reject:n};this.subject.next(o)})}}const pe=()=>h().replace(/[-_]/g,""),me=(e,t)=>e.replace(`_${t}`,""),ye=e=>{const t=e.split("_");return t[t.length-1]},ge=e=>{const t=[],r=[],{document:n,variables:o}=e.reduce((e,n)=>{const{query:o,variables:a,id:i}=n;try{const s="string"==typeof o?f(o):o,u=s.definitions.find(e=>"FragmentDefinition"===e.kind),c="string"==typeof o?o:p(o),l=/@/.test(c);if(u||l)return r.push(n),e;const d=e=>((e,t)=>`${e}_${t}`)(e,i);return e=e.addN(s,[a],d,d),t.push(n),e}catch(t){return r.push(n),e}},b("BatchedQuery"));return{mergedQuery:n&&p(n),mergedVariables:o,mergedQueryAddedEvents:t,unmergedQueryAddedEvents:r}},he=(e,t)=>{if(!e)return e;const r=Object.keys(e),{id:n}=t;return r.reduce((t,r)=>(r.endsWith(n)&&(t=V({},t,{[me(r,n)]:e[r]})),t),{})},ve=(e,t)=>{const{resolve:r}=t;r(e)},be=(e,t)=>{for(const r of t){const t=he(e,r);r.resolve(t)}},we=(e,t)=>{const{reject:r}=e;r(t)},Ce=(e,t)=>{for(const r of e){const{reject:e}=r;e(t)}},Se="sq:graphql-client",_e=m(function(e,t,r){return new fe(e+"/api/v1/"+t+"/graphql",{headers:{Authorization:`Bearer ${r||""}`}})});function Ee(e,t){switch(t.type){case"loading":return{data:void 0,errors:void 0,loading:!0};case"data":return{data:t.payload,errors:void 0,loading:!1};case"errors":return{data:void 0,errors:t.payload,loading:!1}}}function Pe(t,r){const a=function(){const t=Z(),r=M(),n=A(),o=_e(r,n,t),a=P(),i=e(a,"sq:graphql-client",{attempts:0});return null!=i?i:o}(),[i,s]=n(Ee,r);return[i,o(async function(e,r=!1){if(a)try{r||s({type:"loading"});const n=await a.request(t,e);s({type:"data",payload:n})}catch(e){s({type:"errors",payload:e})}else s({type:"errors",payload:new Error("No GraphQL client found")})},[a,t,s])]}const ke={loading:!1,data:void 0,errors:void 0};function Fe(e){const[t,r]=Pe(e,ke);return[r,t]}let Ie;const $e=de(Ie||(Ie=(e=>e)`
|
|
10
10
|
mutation AuthenticateWithEmailAndPassword(
|
|
11
11
|
$email: String!
|
|
12
12
|
$password: String!
|
|
@@ -23,7 +23,7 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
23
23
|
sessionData
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`));function
|
|
26
|
+
`));function je(){const[e,{loading:t,data:n,errors:o}]=Fe($e);return r(()=>{if(null!=n&&n.authenticateManagedIdentityWithEmailAndPassword){const{authenticateManagedIdentityWithEmailAndPassword:e}=n,t=e.token,{user:r}=l(t);X({jwt:t,id:r.id,accountId:r.accountId,managedIdentity:{email:e.email,emailVerified:e.emailVerified,sessionData:e.sessionData}})}},[null==n?void 0:n.authenticateManagedIdentityWithEmailAndPassword]),[e,{loading:t,data:n,errors:o}]}let Re;const qe=de(Re||(Re=(e=>e)`
|
|
27
27
|
mutation RegisterWithEmailAndPassword(
|
|
28
28
|
$email: String!
|
|
29
29
|
$password: String!
|
|
@@ -44,7 +44,43 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
44
44
|
sessionData
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
`));function xe(){const[e,{loading:t,data:r,errors:a}]=Pe(ke);return n(()=>{if(null!=r&&r.registerManagedIdentityWithEmailAndPassword){const{registerManagedIdentityWithEmailAndPassword:e}=r,t=e.token,{user:n}=d(t);X({jwt:t,id:n.id,accountId:n.accountId,managedIdentity:{email:e.email,emailVerified:e.emailVerified,sessionData:e.sessionData}})}},[null==r?void 0:r.registerManagedIdentityWithEmailAndPassword]),[e,{loading:t,data:r,errors:a}]}let je;const Re=le(je||(je=(e=>e)`
|
|
47
|
+
`));function Oe(){const[e,{loading:t,data:n,errors:o}]=Fe(qe);return r(()=>{if(null!=n&&n.registerManagedIdentityWithEmailAndPassword){const{registerManagedIdentityWithEmailAndPassword:e}=n,t=e.token,{user:r}=l(t);X({jwt:t,id:r.id,accountId:r.accountId,managedIdentity:{email:e.email,emailVerified:e.emailVerified,sessionData:e.sessionData}})}},[null==n?void 0:n.registerManagedIdentityWithEmailAndPassword]),[e,{loading:t,data:n,errors:o}]}var De=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable;function Me(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var Ne=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,o=Me(e),a=1;a<arguments.length;a++){for(var i in r=Object(arguments[a]))xe.call(r,i)&&(o[i]=r[i]);if(De){n=De(r);for(var s=0;s<n.length;s++)Ae.call(r,n[s])&&(o[n[s]]=r[n[s]])}}return o},Ve=T(function(e,t){var r=60103,n=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,a=60110,i=60112;t.Suspense=60113;var s=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var c=Symbol.for;r=c("react.element"),n=c("react.portal"),t.Fragment=c("react.fragment"),t.StrictMode=c("react.strict_mode"),t.Profiler=c("react.profiler"),o=c("react.provider"),a=c("react.context"),i=c("react.forward_ref"),t.Suspense=c("react.suspense"),s=c("react.memo"),u=c("react.lazy")}var l="function"==typeof Symbol&&Symbol.iterator;function d(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p={};function m(e,t,r){this.props=e,this.context=t,this.refs=p,this.updater=r||f}function y(){}function g(e,t,r){this.props=e,this.context=t,this.refs=p,this.updater=r||f}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(d(85));this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=m.prototype;var h=g.prototype=new y;h.constructor=g,Ne(h,m.prototype),h.isPureReactComponent=!0;var v={current:null},b=Object.prototype.hasOwnProperty,w={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,n){var o,a={},i=null,s=null;if(null!=t)for(o in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(i=""+t.key),t)b.call(t,o)&&!w.hasOwnProperty(o)&&(a[o]=t[o]);var u=arguments.length-2;if(1===u)a.children=n;else if(1<u){for(var c=Array(u),l=0;l<u;l++)c[l]=arguments[l+2];a.children=c}if(e&&e.defaultProps)for(o in u=e.defaultProps)void 0===a[o]&&(a[o]=u[o]);return{$$typeof:r,type:e,key:i,ref:s,props:a,_owner:v.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var _=/\/+/g;function E(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function P(e,t,o,a,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var u=!1;if(null===e)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case r:case n:u=!0}}if(u)return i=i(u=e),e=""===a?"."+E(u,0):a,Array.isArray(i)?(o="",null!=e&&(o=e.replace(_,"$&/")+"/"),P(i,t,o,"",function(e){return e})):null!=i&&(S(i)&&(i=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,o+(!i.key||u&&u.key===i.key?"":(""+i.key).replace(_,"$&/")+"/")+e)),t.push(i)),1;if(u=0,a=""===a?".":a+":",Array.isArray(e))for(var c=0;c<e.length;c++){var f=a+E(s=e[c],c);u+=P(s,t,o,f,i)}else if("function"==typeof(f=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=l&&e[l]||e["@@iterator"])?e:null}(e)))for(e=f.call(e),c=0;!(s=e.next()).done;)u+=P(s=s.value,t,o,f=a+E(s,c++),i);else if("object"===s)throw t=""+e,Error(d(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return u}function k(e,t,r){if(null==e)return e;var n=[],o=0;return P(e,n,"","",function(e){return t.call(r,e,o++)}),n}function F(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then(function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)},function(t){0===e._status&&(e._status=2,e._result=t)})}if(1===e._status)return e._result;throw e._result}var I={current:null};function $(){var e=I.current;if(null===e)throw Error(d(321));return e}var j={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:v,IsSomeRendererActing:{current:!1},assign:Ne};t.Children={map:k,forEach:function(e,t,r){k(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return k(e,function(){t++}),t},toArray:function(e){return k(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error(d(143));return e}},t.Component=m,t.PureComponent=g,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,t.cloneElement=function(e,t,n){if(null==e)throw Error(d(267,e));var o=Ne({},e.props),a=e.key,i=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,s=v.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)b.call(t,c)&&!w.hasOwnProperty(c)&&(o[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)o.children=n;else if(1<c){u=Array(c);for(var l=0;l<c;l++)u[l]=arguments[l+2];o.children=u}return{$$typeof:r,type:e.type,key:a,ref:i,props:o,_owner:s}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:a,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=C,t.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:i,render:e}},t.isValidElement=S,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:F}},t.memo=function(e,t){return{$$typeof:s,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return $().useCallback(e,t)},t.useContext=function(e,t){return $().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return $().useEffect(e,t)},t.useImperativeHandle=function(e,t,r){return $().useImperativeHandle(e,t,r)},t.useLayoutEffect=function(e,t){return $().useLayoutEffect(e,t)},t.useMemo=function(e,t){return $().useMemo(e,t)},t.useReducer=function(e,t,r){return $().useReducer(e,t,r)},t.useRef=function(e){return $().useRef(e)},t.useState=function(e){return $().useState(e)},t.version="17.0.1"}),Te=T(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e=Ne,r=60103,n=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,a=60110,i=60112;t.Suspense=60113;var s=60120,u=60115,c=60116,l=60121,d=60122,f=60117,p=60129,m=60131;if("function"==typeof Symbol&&Symbol.for){var y=Symbol.for;r=y("react.element"),n=y("react.portal"),t.Fragment=y("react.fragment"),t.StrictMode=y("react.strict_mode"),t.Profiler=y("react.profiler"),o=y("react.provider"),a=y("react.context"),i=y("react.forward_ref"),t.Suspense=y("react.suspense"),s=y("react.suspense_list"),u=y("react.memo"),c=y("react.lazy"),l=y("react.block"),d=y("react.server.block"),f=y("react.fundamental"),y("react.scope"),y("react.opaque.id"),p=y("react.debug_trace_mode"),y("react.offscreen"),m=y("react.legacy_hidden")}var g="function"==typeof Symbol&&Symbol.iterator;function h(e){if(null===e||"object"!=typeof e)return null;var t=g&&e[g]||e["@@iterator"];return"function"==typeof t?t:null}var v={current:null},b={current:null},w={},C=null;function S(e){C=e}w.setExtraStackFrame=function(e){C=e},w.getCurrentStack=null,w.getStackAddendum=function(){var e="";C&&(e+=C);var t=w.getCurrentStack;return t&&(e+=t()||""),e};var _={ReactCurrentDispatcher:v,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:b,IsSomeRendererActing:{current:!1},assign:e};function E(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];k("warn",e,r)}function P(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];k("error",e,r)}function k(e,t,r){var n=_.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(t+="%s",r=r.concat([n]));var o=r.map(function(e){return""+e});o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}_.ReactDebugCurrentFrame=w;var F={};function I(e,t){var r=e.constructor,n=r&&(r.displayName||r.name)||"ReactClass",o=n+"."+t;F[o]||(P("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,n),F[o]=!0)}var $={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){I(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){I(e,"replaceState")},enqueueSetState:function(e,t,r,n){I(e,"setState")}},j={};function R(e,t,r){this.props=e,this.context=t,this.refs=j,this.updater=r||$}Object.freeze(j),R.prototype.isReactComponent={},R.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},R.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var q={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},O=function(e,t){Object.defineProperty(R.prototype,e,{get:function(){E("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var D in q)q.hasOwnProperty(D)&&O(D,q[D]);function x(){}function A(e,t,r){this.props=e,this.context=t,this.refs=j,this.updater=r||$}x.prototype=R.prototype;var M=A.prototype=new x;function N(e){return e.displayName||"Context"}function V(e){if(null==e)return null;if("number"==typeof e.tag&&P("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case t.Fragment:return"Fragment";case n:return"Portal";case t.Profiler:return"Profiler";case t.StrictMode:return"StrictMode";case t.Suspense:return"Suspense";case s:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case a:return N(e)+".Consumer";case o:return N(e._context)+".Provider";case i:return p=(f=e.render).displayName||f.name||"",e.displayName||(""!==p?"ForwardRef("+p+")":"ForwardRef");case u:return V(e.type);case l:return V(e._render);case c:var r=e._payload,d=e._init;try{return V(d(r))}catch(e){return null}}var f,p;return null}M.constructor=A,e(M,R.prototype),M.isPureReactComponent=!0;var T,U,L,H=Object.prototype.hasOwnProperty,W={key:!0,ref:!0,__self:!0,__source:!0};function z(e){if(H.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function J(e){if(H.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}function B(e,t){var r=function(){T||(T=!0,P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}function Y(e,t){var r=function(){U||(U=!0,P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}function Q(e){if("string"==typeof e.ref&&b.current&&e.__self&&b.current.stateNode!==e.__self){var t=V(b.current.type);L[t]||(P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',t,e.ref),L[t]=!0)}}L={};var G=function(e,t,n,o,a,i,s){var u={$$typeof:r,type:e,key:t,ref:n,props:s,_owner:i,_store:{}};return Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function K(e,t,r){var n,o={},a=null,i=null,s=null,u=null;if(null!=t)for(n in z(t)&&(i=t.ref,Q(t)),J(t)&&(a=""+t.key),s=void 0===t.__self?null:t.__self,u=void 0===t.__source?null:t.__source,t)H.call(t,n)&&!W.hasOwnProperty(n)&&(o[n]=t[n]);var c=arguments.length-2;if(1===c)o.children=r;else if(c>1){for(var l=Array(c),d=0;d<c;d++)l[d]=arguments[d+2];Object.freeze&&Object.freeze(l),o.children=l}if(e&&e.defaultProps){var f=e.defaultProps;for(n in f)void 0===o[n]&&(o[n]=f[n])}if(a||i){var p="function"==typeof e?e.displayName||e.name||"Unknown":e;a&&B(o,p),i&&Y(o,p)}return G(e,a,i,s,u,b.current,o)}function X(t,r,n){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o,a,i=e({},t.props),s=t.key,u=t.ref,c=t._self,l=t._source,d=t._owner;if(null!=r)for(o in z(r)&&(u=r.ref,d=b.current),J(r)&&(s=""+r.key),t.type&&t.type.defaultProps&&(a=t.type.defaultProps),r)H.call(r,o)&&!W.hasOwnProperty(o)&&(i[o]=void 0===r[o]&&void 0!==a?a[o]:r[o]);var f=arguments.length-2;if(1===f)i.children=n;else if(f>1){for(var p=Array(f),m=0;m<f;m++)p[m]=arguments[m+2];i.children=p}return G(t.type,s,u,c,l,d,i)}function Z(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var ee=!1,te=/\/+/g;function re(e){return e.replace(te,"$&/")}function ne(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(r={"=":"=0",":":"=2"},"$"+(""+e.key).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function oe(e,t,o,a,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var u,c,l,d=!1;if(null===e)d=!0;else switch(s){case"string":case"number":d=!0;break;case"object":switch(e.$$typeof){case r:case n:d=!0}}if(d){var f=e,p=i(f),m=""===a?"."+ne(f,0):a;if(Array.isArray(p)){var y="";null!=m&&(y=re(m)+"/"),oe(p,t,y,"",function(e){return e})}else null!=p&&(Z(p)&&(u=p,c=o+(!p.key||f&&f.key===p.key?"":re(""+p.key)+"/")+m,p=G(u.type,c,u.ref,u._self,u._source,u._owner,u.props)),t.push(p));return 1}var g=0,v=""===a?".":a+":";if(Array.isArray(e))for(var b=0;b<e.length;b++)g+=oe(l=e[b],t,o,v+ne(l,b),i);else{var w=h(e);if("function"==typeof w){var C=e;w===C.entries&&(ee||E("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ee=!0);for(var S,_=w.call(C),P=0;!(S=_.next()).done;)g+=oe(l=S.value,t,o,v+ne(l,P++),i)}else if("object"===s){var k=""+e;throw Error("Objects are not valid as a React child (found: "+("[object Object]"===k?"object with keys {"+Object.keys(e).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}}return g}function ae(e,t,r){if(null==e)return e;var n=[],o=0;return oe(e,n,"","",function(e){return t.call(r,e,o++)}),n}function ie(e){if(-1===e._status){var t=(0,e._result)(),r=e;r._status=0,r._result=t,t.then(function(t){if(0===e._status){var r=t.default;void 0===r&&P("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",t);var n=e;n._status=1,n._result=r}},function(t){if(0===e._status){var r=e;r._status=2,r._result=t}})}if(1===e._status)return e._result;throw e._result}function se(e){return"string"==typeof e||"function"==typeof e||e===t.Fragment||e===t.Profiler||e===p||e===t.StrictMode||e===t.Suspense||e===s||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===c||e.$$typeof===u||e.$$typeof===o||e.$$typeof===a||e.$$typeof===i||e.$$typeof===f||e.$$typeof===l||e[0]===d)}function ue(){var e=v.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");return e}var ce,le,de,fe,pe,me,ye,ge=0;function he(){}he.__reactDisabledLog=!0;var ve,be=_.ReactCurrentDispatcher;function we(e,t,r){if(void 0===ve)try{throw Error()}catch(e){var n=e.stack.trim().match(/\n( *(at )?)/);ve=n&&n[1]||""}return"\n"+ve+e}var Ce,Se=!1,_e="function"==typeof WeakMap?WeakMap:Map;function Ee(t,r){if(!t||Se)return"";var n,o=Ce.get(t);if(void 0!==o)return o;Se=!0;var a,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,a=be.current,be.current=null,function(){if(0===ge){ce=console.log,le=console.info,de=console.warn,fe=console.error,pe=console.group,me=console.groupCollapsed,ye=console.groupEnd;var e={configurable:!0,enumerable:!0,value:he,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ge++}();try{if(r){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(s,[])}catch(e){n=e}Reflect.construct(t,[],s)}else{try{s.call()}catch(e){n=e}t.call(s.prototype)}}else{try{throw Error()}catch(e){n=e}t()}}catch(e){if(e&&n&&"string"==typeof e.stack){for(var u=e.stack.split("\n"),c=n.stack.split("\n"),l=u.length-1,d=c.length-1;l>=1&&d>=0&&u[l]!==c[d];)d--;for(;l>=1&&d>=0;l--,d--)if(u[l]!==c[d]){if(1!==l||1!==d)do{if(l--,--d<0||u[l]!==c[d]){var f="\n"+u[l].replace(" at new "," at ");return"function"==typeof t&&Ce.set(t,f),f}}while(l>=1&&d>=0);break}}}finally{Se=!1,be.current=a,function(){if(0==--ge){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:e({},t,{value:ce}),info:e({},t,{value:le}),warn:e({},t,{value:de}),error:e({},t,{value:fe}),group:e({},t,{value:pe}),groupCollapsed:e({},t,{value:me}),groupEnd:e({},t,{value:ye})})}ge<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var p=t?t.displayName||t.name:"",m=p?we(p):"";return"function"==typeof t&&Ce.set(t,m),m}function Pe(e,t,r){return Ee(e,!1)}function ke(e,r,n){if(null==e)return"";if("function"==typeof e)return Ee(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return we(e);switch(e){case t.Suspense:return we("Suspense");case s:return we("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case i:return Pe(e.render);case u:return ke(e.type,r,n);case l:return Pe(e._render);case c:var o=e._payload,a=e._init;try{return ke(a(o),r,n)}catch(e){}}return""}Ce=new _e;var Fe,Ie={},$e=_.ReactDebugCurrentFrame;function je(e){if(e){var t=e._owner,r=ke(e.type,e._source,t?t.type:null);$e.setExtraStackFrame(r)}else $e.setExtraStackFrame(null)}function Re(e){if(e){var t=e._owner;S(ke(e.type,e._source,t?t.type:null))}else S(null)}function qe(){if(b.current){var e=V(b.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}function Oe(e){return null!=e&&void 0!==(t=e.__source)?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":"";var t}Fe=!1;var De={};function xe(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=function(e){var t=qe();if(!t){var r="string"==typeof e?e:e.displayName||e.name;r&&(t="\n\nCheck the top-level render call using <"+r+">.")}return t}(t);if(!De[r]){De[r]=!0;var n="";e&&e._owner&&e._owner!==b.current&&(n=" It was passed a child from "+V(e._owner.type)+"."),Re(e),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),Re(null)}}}function Ae(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];Z(n)&&xe(n,t)}else if(Z(e))e._store&&(e._store.validated=!0);else if(e){var o=h(e);if("function"==typeof o&&o!==e.entries)for(var a,i=o.call(e);!(a=i.next()).done;)Z(a.value)&&xe(a.value,t)}}function Me(e){var t,r=e.type;if(null!=r&&"string"!=typeof r){if("function"==typeof r)t=r.propTypes;else{if("object"!=typeof r||r.$$typeof!==i&&r.$$typeof!==u)return;t=r.propTypes}if(t){var n=V(r);!function(e,t,r,n,o){var a=Function.call.bind(Object.prototype.hasOwnProperty);for(var i in e)if(a(e,i)){var s=void 0;try{if("function"!=typeof e[i]){var u=Error((n||"React class")+": prop type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}s=e[i](t,i,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}!s||s instanceof Error||(je(o),P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",r,i,typeof s),je(null)),s instanceof Error&&!(s.message in Ie)&&(Ie[s.message]=!0,je(o),P("Failed %s type: %s",r,s.message),je(null))}}(t,e.props,"prop",n,e)}else void 0===r.PropTypes||Fe||(Fe=!0,P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V(r)||"Unknown"));"function"!=typeof r.getDefaultProps||r.getDefaultProps.isReactClassApproved||P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ve(e){for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){Re(e),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),Re(null);break}}null!==e.ref&&(Re(e),P("Invalid attribute `ref` supplied to `React.Fragment`."),Re(null))}function Te(e,n,o){var a=se(e);if(!a){var i="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var s,u=Oe(n);i+=u||qe(),null===e?s="null":Array.isArray(e)?s="array":void 0!==e&&e.$$typeof===r?(s="<"+(V(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,P("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,i)}var c=K.apply(this,arguments);if(null==c)return c;if(a)for(var l=2;l<arguments.length;l++)Ae(arguments[l],e);return e===t.Fragment?Ve(c):Me(c),c}var Ue=!1;try{var Le=Object.freeze({});new Map([[Le,null]]),new Set([Le])}catch(e){}var He=Te;t.Children={map:ae,forEach:function(e,t,r){ae(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return ae(e,function(){t++}),t},toArray:function(e){return ae(e,function(e){return e})||[]},only:function(e){if(!Z(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=R,t.PureComponent=A,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_,t.cloneElement=function(e,t,r){for(var n=X.apply(this,arguments),o=2;o<arguments.length;o++)Ae(arguments[o],n.type);return Me(n),n},t.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&P("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:a,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null};r.Provider={$$typeof:o,_context:r};var n=!1,i=!1,s=!1,u={$$typeof:a,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(u,{Provider:{get:function(){return i||(i=!0,P("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(e){r.Provider=e}},_currentValue:{get:function(){return r._currentValue},set:function(e){r._currentValue=e}},_currentValue2:{get:function(){return r._currentValue2},set:function(e){r._currentValue2=e}},_threadCount:{get:function(){return r._threadCount},set:function(e){r._threadCount=e}},Consumer:{get:function(){return n||(n=!0,P("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}},displayName:{get:function(){return r.displayName},set:function(e){s||(E("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),s=!0)}}}),r.Consumer=u,r._currentRenderer=null,r._currentRenderer2=null,r},t.createElement=He,t.createFactory=function(e){var t=Te.bind(null,e);return t.type=e,Ue||(Ue=!0,E("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return E("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===u?P("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?P("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&P("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||P("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var t,r={$$typeof:i,render:e};return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(r){t=r,null==e.displayName&&(e.displayName=r)}}),r},t.isValidElement=Z,t.lazy=function(e){var t,r,n={$$typeof:c,_payload:{_status:-1,_result:e},_init:ie};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){P("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){P("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},t.memo=function(e,t){se(e)||P("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var r,n={$$typeof:u,type:e,compare:void 0===t?null:t};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return r},set:function(t){r=t,null==e.displayName&&(e.displayName=t)}}),n},t.useCallback=function(e,t){return ue().useCallback(e,t)},t.useContext=function(e,t){var r=ue();if(void 0!==t&&P("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://reactjs.org/link/rules-of-hooks":""),void 0!==e._context){var n=e._context;n.Consumer===e?P("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===e&&P("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return r.useContext(e,t)},t.useDebugValue=function(e,t){return ue().useDebugValue(e,t)},t.useEffect=function(e,t){return ue().useEffect(e,t)},t.useImperativeHandle=function(e,t,r){return ue().useImperativeHandle(e,t,r)},t.useLayoutEffect=function(e,t){return ue().useLayoutEffect(e,t)},t.useMemo=function(e,t){return ue().useMemo(e,t)},t.useReducer=function(e,t,r){return ue().useReducer(e,t,r)},t.useRef=function(e){return ue().useRef(e)},t.useState=function(e){return ue().useState(e)},t.version="17.0.1"}()}),Ue=T(function(e){e.exports="production"===process.env.NODE_ENV?Ve:Te});let Le;const He=de(Le||(Le=(e=>e)`
|
|
48
|
+
mutation RegisterViaRegistrationForm(
|
|
49
|
+
$email: String!
|
|
50
|
+
$password: String!
|
|
51
|
+
$formData: RSJsonNode
|
|
52
|
+
$redirectPath: String
|
|
53
|
+
) {
|
|
54
|
+
submitForm(
|
|
55
|
+
formInput: {
|
|
56
|
+
formData: {
|
|
57
|
+
email: $email
|
|
58
|
+
password: $password
|
|
59
|
+
formData: $formData
|
|
60
|
+
redirectPath: $redirectPath
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
) {
|
|
64
|
+
results {
|
|
65
|
+
... on FormHandlerSubmissionResult {
|
|
66
|
+
result
|
|
67
|
+
formHandler {
|
|
68
|
+
namespace
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
... on FormHandlerError {
|
|
72
|
+
errorCode
|
|
73
|
+
error
|
|
74
|
+
errorType
|
|
75
|
+
formHandler {
|
|
76
|
+
name
|
|
77
|
+
endpointUrl
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`));function We(){const[e,{loading:t,data:n,errors:o}]=Fe(He),[a,i]=Ue.useState();return r(()=>{var e;const t=null==n||null==(e=n.submitForm)?void 0:e.results.find(e=>"identity"===e.formHandler.namespace);if(t&&t.result.results.length){const e=t.result.results[0];if(e.success){i(void 0);const t=e.data.token,{user:r}=l(t);X({jwt:t,id:r.id,accountId:r.accountId,managedIdentity:{email:e.data.email,emailVerified:e.data.emailVerified,sessionData:e.data.sessionData}})}else i(e.message)}},[null==n?void 0:n.submitForm]),[e,{loading:t,data:n,errors:o,formError:a}]}let ze;const Je=de(ze||(ze=(e=>e)`
|
|
48
84
|
mutation ChangePassword($password: String!) {
|
|
49
85
|
changeManagedIdentityPassword(
|
|
50
86
|
changeManagedIdentityPasswordInput: { password: $password }
|
|
@@ -52,7 +88,7 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
52
88
|
success
|
|
53
89
|
}
|
|
54
90
|
}
|
|
55
|
-
`));function
|
|
91
|
+
`));function Be(){const[e,{loading:t,data:r,errors:n}]=Fe(Je);return[e,{loading:t,data:r,errors:n}]}let Ye;const Qe=de(Ye||(Ye=(e=>e)`
|
|
56
92
|
mutation ResetPassword($oobCode: String!, $password: String!) {
|
|
57
93
|
resetManagedIdentityPassword(
|
|
58
94
|
resetManagedIdentityPasswordInput: {
|
|
@@ -66,7 +102,7 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
66
102
|
sessionData
|
|
67
103
|
}
|
|
68
104
|
}
|
|
69
|
-
`));function
|
|
105
|
+
`));function Ge(){const[e,{loading:t,data:n,errors:o}]=Fe(Qe);return r(()=>{if(null!=n&&n.resetManagedIdentityPassword){const{resetManagedIdentityPassword:e}=n,t=e.token,{user:r}=l(t);X({jwt:t,id:r.id,accountId:r.accountId,managedIdentity:{email:e.email,emailVerified:e.emailVerified,sessionData:e.sessionData}})}},[null==n?void 0:n.resetManagedIdentityPassword]),[e,{loading:t,data:n,errors:o}]}let Ke;const Xe=de(Ke||(Ke=(e=>e)`
|
|
70
106
|
mutation VerifyPasswordResetCode($oobCode: String!) {
|
|
71
107
|
verifyManagedIdentityPasswordResetCode(
|
|
72
108
|
verifyManagedIdentityPasswordResetCodeInput: { oobCode: $oobCode }
|
|
@@ -74,7 +110,7 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
74
110
|
success
|
|
75
111
|
}
|
|
76
112
|
}
|
|
77
|
-
`));function
|
|
113
|
+
`));function Ze(){return Fe(Xe)}function et(){const e=P();return{refresh:o(()=>{e.dispatchEvent(new CustomEvent("sq:refresh",{bubbles:!0,composed:!0,cancelable:!0,detail:{}}))},[e])}}function tt({skip:e=!1,update:t,variables:n}){r(()=>{const r=r=>{!e&&t(n,!0)};return document.addEventListener("sq:refresh",r),()=>document.removeEventListener("sq:refresh",r)},function(e){const t=i(e),r=i(0);return d(e,t.current)||(t.current=e,r.current+=1),a(()=>t.current,[r.current])}([n,t,e]))}const rt={loading:!1,data:void 0,errors:void 0},nt=Symbol();function ot(e){const[t,r]=Pe(e,rt),n=i(nt);return tt({skip:n.current===nt,update:r,variables:n.current}),[r,V({},t,{refetch:e=>{n.current=e,r(e)}})]}let at;const it=de(at||(at=(e=>e)`
|
|
78
114
|
query ManagedIdentitySession {
|
|
79
115
|
managedIdentitySession {
|
|
80
116
|
email
|
|
@@ -82,7 +118,7 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
82
118
|
sessionData
|
|
83
119
|
}
|
|
84
120
|
}
|
|
85
|
-
`));function
|
|
121
|
+
`));function st(){const e=ee(),[t,{loading:n,data:a,errors:i,refetch:s}]=ot(it);return r(()=>{if(null!=a&&a.managedIdentitySession){const{managedIdentitySession:t}=a;X(V({},e,{managedIdentity:t}))}},[null==a?void 0:a.managedIdentitySession]),[o(()=>t({}),[t]),{loading:n,data:a,errors:i,refetch:s}]}let ut;const ct=de(ut||(ut=(e=>e)`
|
|
86
122
|
mutation VerifyEmail($oobCode: String!) {
|
|
87
123
|
verifyManagedIdentityEmail(
|
|
88
124
|
verifyManagedIdentityEmailInput: { oobCode: $oobCode }
|
|
@@ -90,7 +126,7 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
90
126
|
success
|
|
91
127
|
}
|
|
92
128
|
}
|
|
93
|
-
`));function
|
|
129
|
+
`));function lt(){var e;const[t]=st(),[n,{loading:o,data:a,errors:i}]=Fe(ct);return r(()=>{var e;null!=a&&null!=(e=a.verifyManagedIdentityEmail)&&e.success&&t()},[null==a||null==(e=a.verifyManagedIdentityEmail)?void 0:e.success]),[n,{loading:o,data:a,errors:i}]}let dt;const ft=de(dt||(dt=(e=>e)`
|
|
94
130
|
mutation RequestPasswordResetEmail(
|
|
95
131
|
$email: String!
|
|
96
132
|
$urlParams: RSJsonNode
|
|
@@ -106,7 +142,7 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
106
142
|
success
|
|
107
143
|
}
|
|
108
144
|
}
|
|
109
|
-
`));function
|
|
145
|
+
`));function pt(){return Fe(ft)}let mt;const yt=de(mt||(mt=(e=>e)`
|
|
110
146
|
mutation RequestVerificationEmail(
|
|
111
147
|
$email: String!
|
|
112
148
|
$urlParams: RSJsonNode
|
|
@@ -122,11 +158,11 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
122
158
|
success
|
|
123
159
|
}
|
|
124
160
|
}
|
|
125
|
-
`));function
|
|
161
|
+
`));function gt(){return Fe(yt)}function ht(e,t){const r=i();return r.current&&d(t,r.current.key)||(r.current={key:t,value:e()}),r.current.value}function vt(){return n(e=>e+1,0)}function bt(e){const t=Object.getOwnPropertyNames(e);for(const r of t){const t=e[r];t&&"object"==typeof t&&bt(t)}return Object.freeze(e)}const wt={loading:!0,data:void 0,errors:void 0};function Ct(e,t,r){const[n,o]=Pe(e,wt),[a,i]=vt();return ht(()=>{!r&&o(t)},[e,t,o,a,r]),tt({skip:r,update:o,variables:t}),bt(V({},n,{refetch:i}))}function St(){return window.squatchHistory=window.squatchHistory||function(){switch(D().type){case"SquatchPortal":return C();default:return w()}}(),window.squatchHistory}const _t={createHref:(...e)=>St().createHref(...e),push:(...e)=>St().push(...e),replace:(...e)=>St().replace(...e),go:(...e)=>St().go(...e),back:()=>St().back(),forward:(...e)=>St().forward(...e)};function Et(){const[,e]=vt();return r(()=>St().listen(()=>{e()}),[]),St().location}function Pt(e){const[t,r]=s({limit:e.limit,offset:e.offset}),{offset:n,limit:o}=t,a=(e,t)=>e*t,i=(e,t)=>Math.ceil(e/t)||0;return{limit:o,setLimit:e=>{const o=i(n,e),s=a(e,o);r(V({},t,{limit:e,offset:s}))},offset:n,setCurrentPage:e=>{let t=a(e,o);r(e=>V({},e,{offset:t}))},calculatePagination:function(e,t){const r=i(n,o),a=((e,t)=>Math.ceil(e/t)||0)(t,o),s=0===e?"0":e>1?`${n+1}-${n+e}`:`${n+1}`;return{currentPage:r,pageCount:a,rangeOnPage:s,pageProgress:`${s} of ${t}`}}}}function kt(e,t,r,n={},o=!1){var a;const{limit:i,offset:s,setLimit:u,setCurrentPage:c,calculatePagination:l}=Pt(r),d=V({limit:i,offset:s},n),{loading:f,errors:p,data:m,refetch:y}=Ct(e,d,o),g=t(m),{currentPage:h,pageCount:v,pageProgress:b}=l((null==g||null==(a=g.data)?void 0:a.length)||0,(null==g?void 0:g.totalCount)||0);return{envelope:g,states:{errors:p,loading:f,limit:i,currentPage:h,pageCount:v,pageProgress:b},callbacks:{refetch:y,setLimit:u,setCurrentPage:c}}}function Ft(e,t){return e===t}function It(e,t,n){const a=n&&n.equalityFn||Ft,[u,c]=s(e),l=$t(o(e=>c(e),[]),t,n),d=i(e);return r(()=>{a(d.current,e)||(l.callback(e),d.current=e)},[e,l,a]),[u,{cancel:l.cancel,flush:l.flush}]}function $t(e,t=0,r={leading:!1}){const n=a(()=>S(e,t,r.leading),[e,t,r.leading]),{flush:o,clear:i}=n;return{flush:o,cancel:i,callback:n}}let jt;const Rt=u(jt||(jt=(e=>e)`
|
|
126
162
|
mutation ($eventMeta: UserAnalyticsEvent!) {
|
|
127
163
|
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
128
164
|
}
|
|
129
|
-
`));function
|
|
165
|
+
`));function qt(){const e=N(),t=ee(),r=I(),[n]=Fe(Rt);return t?o=>{n({eventMeta:{id:t.id,accountId:t.accountId,programId:r,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:e,shareMedium:o}}})}:()=>{}}let Ot,Dt,xt,At=e=>e;const Mt=B("sq:useForm"),Nt=u(Ot||(Ot=At`
|
|
130
166
|
query ($key: String!) {
|
|
131
167
|
form(key: $key) {
|
|
132
168
|
schema
|
|
@@ -137,7 +173,7 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
137
173
|
}
|
|
138
174
|
}
|
|
139
175
|
}
|
|
140
|
-
`)),
|
|
176
|
+
`)),Vt=u(Dt||(Dt=At`
|
|
141
177
|
mutation ($formSubmissionInput: FormSubmissionInput!) {
|
|
142
178
|
submitForm(formSubmissionInput: $formSubmissionInput) {
|
|
143
179
|
success
|
|
@@ -167,7 +203,7 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
167
203
|
}
|
|
168
204
|
}
|
|
169
205
|
}
|
|
170
|
-
`)),
|
|
206
|
+
`)),Tt=u(xt||(xt=At`
|
|
171
207
|
query ($formValidationInput: FormValidationInput!) {
|
|
172
208
|
validateForm(formValidationInput: $formValidationInput) {
|
|
173
209
|
valid
|
|
@@ -197,5 +233,5 @@ import{useDomContext as e}from"@saasquatch/dom-context-hooks";import{ContextProv
|
|
|
197
233
|
}
|
|
198
234
|
}
|
|
199
235
|
}
|
|
200
|
-
`));function
|
|
236
|
+
`));function Ut(e){var t,o,a,i;const{formKey:s,formRef:u,autoSubmit:c=!1}=e,[l,{data:d,loading:f}]=ot(Nt),[p,m]=Fe(Vt),[y,g]=ot(Tt),h={enabled:!1,validating:!1,valid:!0,validationMessage:"",error:"",disabledMessage:"",formData:{},validationData:g,submitData:m},[v,b]=n((e,t)=>V({},e,t),h),{enabled:w,disabledMessage:C,validating:S,valid:E,error:P,formData:k}=v;async function F(e){await y({formValidationInput:{key:s,formData:e}})}return ht(()=>{Mt("submitData useEffect",m),b({submitData:m})},[m]),ht(()=>{Mt("validationData useEffect",g),b({validationData:g})},[g]),r(()=>{!f&&d&&function(){var t,r,n,o,a;b({enabled:null==d||null==(t=d.form.initialData)?void 0:t.isEnabled,disabledMessage:null==d||null==(r=d.form)||null==(n=r.initialData)?void 0:n.isEnabledErrorMessage});const i=u;if(!i)return;const s=null==d||null==(o=d.form)||null==(a=o.initialData)?void 0:a.initialData;void 0!==e.setInitialData?e.setInitialData(i,s):async function(e,t){const r=e.elements,n=new FormData(e);Mt({htmlForm:e,formContent:n}),null==n||n.forEach((e,n)=>{Mt({value:e,key:n,inputs:r});const o=r.namedItem(n);try{"checkbox"==o.type?o.checked=_.get(t,n):o.value=_.get(t,n)||""}catch(e){Mt("no initialData found for key",n)}})}(i,s)}()},[f]),r(()=>{var e,t,r,n,o,a;v.validationData&&(b({validating:!1,valid:(null==(e=v.validationData)||null==(t=e.data)||null==(r=t.validateForm)?void 0:r.valid)||!1}),c&&null!=(n=v.validationData)&&null!=(o=n.data)&&null!=(a=o.validateForm)&&a.valid&&p({formSubmissionInput:{key:s,formData:k}}))},[null==(t=v.validationData)||null==(o=t.data)||null==(a=o.validateForm)?void 0:a.valid]),{states:{enabled:w,disabledMessage:C,loadingForm:f,validating:S,valid:E,error:P,validationData:v.validationData,submitData:v.submitData},data:{formKey:s,schema:null==d||null==(i=d.form)?void 0:i.schema},callbacks:{getForm:l,handleSubmit:async function(e){e.preventDefault(),b({validating:!0});const t=e.target;Mt("submit form",t);const r=new FormData(t);let n={};for(var o of r.entries())_.set(n,o[0],o[1]);b({formData:n}),await F(n)},validateForm:F,submitForm:async function(e){await p({formSubmissionInput:{key:s,formData:e}})},setFormState:b,getValidationErrors:function(){var e,t,r,n;const o=null==g||null==(e=g.data)||null==(t=e.validateForm)||null==(r=t.results[0])||null==(n=r.result)?void 0:n.errors;function a(e){return null==o?void 0:o.filter(t=>t.instanceLocation.substring(1).startsWith(`${e}`))}return{getErrorAtPath:function(e){return null==o?void 0:o.filter(t=>t.instanceLocation.substring(1)===e)},getSubErrorsAtPath:a,hasSubErrors:e=>{var t;return(null==(t=a(e))?void 0:t.length)>0}}},getSubmissionErrors:function(){var e;if(!v.submitData)return[];const t=null==(e=v.submitData.data)?void 0:e.submitForm.results;return(null==t?void 0:t.map(e=>{var t,r,n,o,a,i,s;const u=null==(t=e.result)||null==(r=t.results)?void 0:r.flatMap(e=>!e.success&&e.message).filter(e=>e),c=null==(n=e.result)||null==(o=n.results)?void 0:o.flatMap(e=>!e.success&&{error:e.error,errorType:e.errorType,errorCode:e.errorCode}).filter(({error:e})=>e);return{integration:null==(a=e.formHandler)||null==(i=a.integration)?void 0:i.name,formHandler:null==(s=e.formHandler)?void 0:s.name,messages:u,errors:c}}))||[]}}}}export{fe as BatchedGraphQLClient,Se as GRAPHQL_CONTEXT,D as getEnvironmentSDK,x as isDemo,_e as memoizedGraphQLClient,_t as navigation,$ as setProgramId,k as setUseHostImplementation,X as setUserIdentity,M as useAppDomain,je as useAuthenticateWithEmailAndPasswordMutation,Be as useChangePasswordMutation,Et as useCurrentPage,It as useDebounce,$t as useDebouncedCallback,N as useEngagementMedium,Ut as useForm,P as useHost,ot as useLazyQuery,q as useLocale,st as useManagedIdentitySessionQuery,Fe as useMutation,kt as usePaginatedQuery,Pt as usePagination,I as useProgramId,Ct as useQuery,et as useRefreshDispatcher,We as useRegisterViaRegistrationFormMutation,Oe as useRegisterWithEmailAndPasswordMutation,pt as useRequestPasswordResetEmailMutation,gt as useRequestVerificationEmailMutation,Ge as useResetPasswordMutation,qt as useShareEvent,A as useTenantAlias,vt as useTick,Z as useToken,ee as useUserIdentity,lt as useVerifyEmailMutation,Ze as useVerifyPasswordResetCodeMutation};
|
|
201
237
|
//# sourceMappingURL=index.modern.js.map
|