@dashx/react 0.0.6 → 0.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.
Files changed (256) hide show
  1. package/README.md +0 -70
  2. package/dist/cjs/components/button.d.ts +8 -0
  3. package/dist/cjs/components/button.js +2 -0
  4. package/dist/cjs/components/button.js.map +7 -0
  5. package/dist/cjs/components/card.d.ts +8 -0
  6. package/dist/cjs/components/card.js +2 -0
  7. package/dist/cjs/components/card.js.map +7 -0
  8. package/dist/cjs/components/flex.d.ts +210 -0
  9. package/dist/cjs/components/flex.js +2 -0
  10. package/dist/cjs/components/flex.js.map +7 -0
  11. package/dist/cjs/components/heading.d.ts +8 -0
  12. package/dist/cjs/components/heading.js +2 -0
  13. package/dist/cjs/components/heading.js.map +7 -0
  14. package/dist/cjs/components/icon-button.d.ts +3 -0
  15. package/dist/cjs/components/icon-button.js +2 -0
  16. package/dist/cjs/components/icon-button.js.map +7 -0
  17. package/dist/cjs/components/index.d.ts +11 -0
  18. package/dist/cjs/components/index.js +2 -0
  19. package/dist/cjs/components/index.js.map +7 -0
  20. package/dist/cjs/components/popover.d.ts +47 -0
  21. package/dist/cjs/components/popover.js +2 -0
  22. package/dist/cjs/components/popover.js.map +7 -0
  23. package/dist/cjs/components/text-field.d.ts +2 -0
  24. package/dist/cjs/components/text-field.js +2 -0
  25. package/dist/cjs/components/text-field.js.map +7 -0
  26. package/dist/cjs/components/text.d.ts +20 -0
  27. package/dist/cjs/components/text.js +2 -0
  28. package/dist/cjs/components/text.js.map +7 -0
  29. package/dist/cjs/components/theme.d.ts +17 -0
  30. package/dist/cjs/components/theme.js +2 -0
  31. package/dist/cjs/components/theme.js.map +7 -0
  32. package/dist/cjs/components/toast.d.ts +4 -0
  33. package/dist/cjs/components/toast.js +2 -0
  34. package/dist/cjs/components/toast.js.map +7 -0
  35. package/dist/cjs/components/tooltip.d.ts +13 -0
  36. package/dist/cjs/components/tooltip.js +2 -0
  37. package/dist/cjs/components/tooltip.js.map +7 -0
  38. package/dist/cjs/hooks/index.d.ts +2 -0
  39. package/dist/cjs/hooks/index.js +2 -0
  40. package/dist/cjs/hooks/index.js.map +7 -0
  41. package/dist/cjs/hooks/use-dashx-provider.d.ts +3 -0
  42. package/dist/cjs/hooks/use-dashx-provider.js +2 -0
  43. package/dist/cjs/hooks/use-dashx-provider.js.map +7 -0
  44. package/dist/cjs/hooks/use-in-app.d.ts +9 -0
  45. package/dist/cjs/hooks/use-in-app.js +2 -0
  46. package/dist/cjs/hooks/use-in-app.js.map +7 -0
  47. package/dist/cjs/icons/index.d.ts +1 -0
  48. package/dist/cjs/icons/index.js +2 -0
  49. package/dist/cjs/icons/index.js.map +7 -0
  50. package/dist/cjs/index.d.ts +3 -0
  51. package/dist/cjs/index.js +2 -0
  52. package/dist/cjs/index.js.map +7 -0
  53. package/dist/cjs/providers/DashXProvider.d.ts +6 -0
  54. package/dist/cjs/providers/DashXProvider.js +2 -0
  55. package/dist/cjs/providers/DashXProvider.js.map +7 -0
  56. package/dist/cjs/providers/index.d.ts +1 -0
  57. package/dist/cjs/providers/index.js +2 -0
  58. package/dist/cjs/providers/index.js.map +7 -0
  59. package/dist/cjs/tsconfig.tsbuildinfo +1 -0
  60. package/dist/cjs/utils/cn.d.ts +3 -0
  61. package/dist/cjs/utils/cn.js +2 -0
  62. package/dist/cjs/utils/cn.js.map +7 -0
  63. package/dist/cjs/variants/base-element.d.ts +58 -0
  64. package/dist/cjs/variants/base-element.js +2 -0
  65. package/dist/cjs/variants/base-element.js.map +7 -0
  66. package/dist/cjs/variants/button.d.ts +147 -0
  67. package/dist/cjs/variants/button.js +2 -0
  68. package/dist/cjs/variants/button.js.map +7 -0
  69. package/dist/cjs/variants/card.d.ts +117 -0
  70. package/dist/cjs/variants/card.js +2 -0
  71. package/dist/cjs/variants/card.js.map +7 -0
  72. package/dist/cjs/variants/heading.d.ts +377 -0
  73. package/dist/cjs/variants/heading.js +2 -0
  74. package/dist/cjs/variants/heading.js.map +7 -0
  75. package/dist/cjs/variants/index.d.ts +6 -0
  76. package/dist/cjs/variants/index.js +2 -0
  77. package/dist/cjs/variants/index.js.map +7 -0
  78. package/dist/cjs/variants/popover.d.ts +106 -0
  79. package/dist/cjs/variants/popover.js +2 -0
  80. package/dist/cjs/variants/popover.js.map +7 -0
  81. package/dist/cjs/variants/text-field.d.ts +93 -0
  82. package/dist/cjs/variants/text-field.js +2 -0
  83. package/dist/cjs/variants/text-field.js.map +7 -0
  84. package/dist/cjs/variants/text.d.ts +377 -0
  85. package/dist/cjs/variants/text.js +2 -0
  86. package/dist/cjs/variants/text.js.map +7 -0
  87. package/dist/cjs/variants/tooltip.d.ts +2 -0
  88. package/dist/cjs/variants/tooltip.js +2 -0
  89. package/dist/cjs/variants/tooltip.js.map +7 -0
  90. package/dist/cjs/variants/typography.d.ts +285 -0
  91. package/dist/cjs/variants/typography.js +2 -0
  92. package/dist/cjs/variants/typography.js.map +7 -0
  93. package/dist/cjs/widgets/NotificationBell.d.ts +2 -0
  94. package/dist/cjs/widgets/NotificationBell.js +2 -0
  95. package/dist/cjs/widgets/NotificationBell.js.map +7 -0
  96. package/dist/cjs/widgets/Preference.d.ts +15 -0
  97. package/dist/cjs/widgets/Preference.js +2 -0
  98. package/dist/cjs/widgets/Preference.js.map +7 -0
  99. package/dist/cjs/widgets/Preferences.d.ts +19 -0
  100. package/dist/cjs/widgets/Preferences.js +2 -0
  101. package/dist/cjs/widgets/Preferences.js.map +7 -0
  102. package/dist/cjs/widgets/Toast.d.ts +4 -0
  103. package/dist/cjs/widgets/Toast.js +2 -0
  104. package/dist/cjs/widgets/Toast.js.map +7 -0
  105. package/dist/cjs/widgets/index.d.ts +3 -0
  106. package/dist/cjs/widgets/index.js +2 -0
  107. package/dist/cjs/widgets/index.js.map +7 -0
  108. package/dist/esm/components/button.d.ts +8 -0
  109. package/dist/esm/components/button.js +2 -0
  110. package/dist/esm/components/button.js.map +7 -0
  111. package/dist/esm/components/card.d.ts +8 -0
  112. package/dist/esm/components/card.js +2 -0
  113. package/dist/esm/components/card.js.map +7 -0
  114. package/dist/esm/components/flex.d.ts +210 -0
  115. package/dist/esm/components/flex.js +2 -0
  116. package/dist/esm/components/flex.js.map +7 -0
  117. package/dist/esm/components/heading.d.ts +8 -0
  118. package/dist/esm/components/heading.js +2 -0
  119. package/dist/esm/components/heading.js.map +7 -0
  120. package/dist/esm/components/icon-button.d.ts +3 -0
  121. package/dist/esm/components/icon-button.js +2 -0
  122. package/dist/esm/components/icon-button.js.map +7 -0
  123. package/dist/esm/components/index.d.ts +11 -0
  124. package/dist/esm/components/index.js +2 -0
  125. package/dist/esm/components/index.js.map +7 -0
  126. package/dist/esm/components/popover.d.ts +47 -0
  127. package/dist/esm/components/popover.js +2 -0
  128. package/dist/esm/components/popover.js.map +7 -0
  129. package/dist/esm/components/text-field.d.ts +2 -0
  130. package/dist/esm/components/text-field.js +2 -0
  131. package/dist/esm/components/text-field.js.map +7 -0
  132. package/dist/esm/components/text.d.ts +20 -0
  133. package/dist/esm/components/text.js +2 -0
  134. package/dist/esm/components/text.js.map +7 -0
  135. package/dist/esm/components/theme.d.ts +17 -0
  136. package/dist/esm/components/theme.js +2 -0
  137. package/dist/esm/components/theme.js.map +7 -0
  138. package/dist/esm/components/toast.d.ts +4 -0
  139. package/dist/esm/components/toast.js +2 -0
  140. package/dist/esm/components/toast.js.map +7 -0
  141. package/dist/esm/components/tooltip.d.ts +13 -0
  142. package/dist/esm/components/tooltip.js +2 -0
  143. package/dist/esm/components/tooltip.js.map +7 -0
  144. package/dist/esm/hooks/index.d.ts +2 -0
  145. package/dist/esm/hooks/index.js +2 -0
  146. package/dist/esm/hooks/index.js.map +7 -0
  147. package/dist/esm/hooks/use-dashx-provider.d.ts +3 -0
  148. package/dist/esm/hooks/use-dashx-provider.js +2 -0
  149. package/dist/esm/hooks/use-dashx-provider.js.map +7 -0
  150. package/dist/esm/hooks/use-in-app.d.ts +9 -0
  151. package/dist/esm/hooks/use-in-app.js +2 -0
  152. package/dist/esm/hooks/use-in-app.js.map +7 -0
  153. package/dist/esm/icons/index.d.ts +1 -0
  154. package/dist/esm/icons/index.js +2 -0
  155. package/dist/esm/icons/index.js.map +7 -0
  156. package/dist/esm/index.d.ts +3 -0
  157. package/dist/esm/index.js +2 -0
  158. package/dist/esm/index.js.map +7 -0
  159. package/dist/esm/package.json +3 -0
  160. package/dist/esm/providers/DashXProvider.d.ts +6 -0
  161. package/dist/esm/providers/DashXProvider.js +2 -0
  162. package/dist/esm/providers/DashXProvider.js.map +7 -0
  163. package/dist/esm/providers/index.d.ts +1 -0
  164. package/dist/esm/providers/index.js +2 -0
  165. package/dist/esm/providers/index.js.map +7 -0
  166. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  167. package/dist/esm/utils/cn.d.ts +3 -0
  168. package/dist/esm/utils/cn.js +2 -0
  169. package/dist/esm/utils/cn.js.map +7 -0
  170. package/dist/esm/variants/base-element.d.ts +58 -0
  171. package/dist/esm/variants/base-element.js +2 -0
  172. package/dist/esm/variants/base-element.js.map +7 -0
  173. package/dist/esm/variants/button.d.ts +147 -0
  174. package/dist/esm/variants/button.js +2 -0
  175. package/dist/esm/variants/button.js.map +7 -0
  176. package/dist/esm/variants/card.d.ts +117 -0
  177. package/dist/esm/variants/card.js +2 -0
  178. package/dist/esm/variants/card.js.map +7 -0
  179. package/dist/esm/variants/heading.d.ts +377 -0
  180. package/dist/esm/variants/heading.js +2 -0
  181. package/dist/esm/variants/heading.js.map +7 -0
  182. package/dist/esm/variants/index.d.ts +6 -0
  183. package/dist/esm/variants/index.js +2 -0
  184. package/dist/esm/variants/index.js.map +7 -0
  185. package/dist/esm/variants/popover.d.ts +106 -0
  186. package/dist/esm/variants/popover.js +2 -0
  187. package/dist/esm/variants/popover.js.map +7 -0
  188. package/dist/esm/variants/text-field.d.ts +93 -0
  189. package/dist/esm/variants/text-field.js +2 -0
  190. package/dist/esm/variants/text-field.js.map +7 -0
  191. package/dist/esm/variants/text.d.ts +377 -0
  192. package/dist/esm/variants/text.js +2 -0
  193. package/dist/esm/variants/text.js.map +7 -0
  194. package/dist/esm/variants/tooltip.d.ts +2 -0
  195. package/dist/esm/variants/tooltip.js +2 -0
  196. package/dist/esm/variants/tooltip.js.map +7 -0
  197. package/dist/esm/variants/typography.d.ts +285 -0
  198. package/dist/esm/variants/typography.js +2 -0
  199. package/dist/esm/variants/typography.js.map +7 -0
  200. package/dist/esm/widgets/NotificationBell.d.ts +2 -0
  201. package/dist/esm/widgets/NotificationBell.js +2 -0
  202. package/dist/esm/widgets/NotificationBell.js.map +7 -0
  203. package/dist/esm/widgets/Preference.d.ts +15 -0
  204. package/dist/esm/widgets/Preference.js +2 -0
  205. package/dist/esm/widgets/Preference.js.map +7 -0
  206. package/dist/esm/widgets/Preferences.d.ts +19 -0
  207. package/dist/esm/widgets/Preferences.js +2 -0
  208. package/dist/esm/widgets/Preferences.js.map +7 -0
  209. package/dist/esm/widgets/Toast.d.ts +4 -0
  210. package/dist/esm/widgets/Toast.js +2 -0
  211. package/dist/esm/widgets/Toast.js.map +7 -0
  212. package/dist/esm/widgets/index.d.ts +3 -0
  213. package/dist/esm/widgets/index.js +2 -0
  214. package/dist/esm/widgets/index.js.map +7 -0
  215. package/package.json +165 -34
  216. package/src/components/button.tsx +88 -0
  217. package/src/components/card.tsx +32 -0
  218. package/src/components/flex.tsx +61 -0
  219. package/src/components/heading.tsx +42 -0
  220. package/src/components/icon-button.tsx +24 -0
  221. package/src/components/index.ts +11 -0
  222. package/src/components/popover.tsx +145 -0
  223. package/src/components/text-field.tsx +7 -0
  224. package/src/components/text.tsx +42 -0
  225. package/src/components/theme.tsx +81 -0
  226. package/src/components/toast.tsx +19 -0
  227. package/src/components/tooltip.tsx +62 -0
  228. package/src/hooks/index.ts +2 -0
  229. package/src/hooks/use-dashx-provider.ts +17 -0
  230. package/src/hooks/use-in-app.ts +96 -0
  231. package/src/icons/index.ts +1 -0
  232. package/src/index.ts +3 -0
  233. package/src/providers/DashXProvider.tsx +30 -0
  234. package/src/providers/index.ts +1 -0
  235. package/src/styles/index.css +368 -0
  236. package/src/utils/cn.ts +8 -0
  237. package/src/variants/base-element.ts +15 -0
  238. package/src/variants/button.ts +191 -0
  239. package/src/variants/card.ts +40 -0
  240. package/src/variants/heading.ts +28 -0
  241. package/src/variants/index.ts +6 -0
  242. package/src/variants/popover.ts +42 -0
  243. package/src/variants/text-field.ts +15 -0
  244. package/src/variants/text.ts +28 -0
  245. package/src/variants/tooltip.ts +7 -0
  246. package/src/variants/typography.ts +100 -0
  247. package/src/widgets/NotificationBell.tsx +101 -0
  248. package/src/widgets/Preference.tsx +80 -0
  249. package/src/widgets/Preferences.tsx +109 -0
  250. package/src/widgets/Toast.tsx +19 -0
  251. package/src/widgets/index.ts +3 -0
  252. package/styles.css +1255 -0
  253. package/dist/index.d.ts +0 -65
  254. package/dist/index.es.js +0 -11779
  255. package/dist/index.umd.js +0 -238
  256. package/dist/style.css +0 -1
package/dist/index.umd.js DELETED
@@ -1,238 +0,0 @@
1
- (function(ne,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],D):(ne=typeof globalThis<"u"?globalThis:ne||self,D(ne["dashx-react"]={},ne.React,ne.ReactDOM))})(this,function(ne,D,Ji){"use strict";function Hi(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const C=Hi(D),lu=Hi(Ji);var du=Object.defineProperty,fu=(t,e,n)=>e in t?du(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ce=(t,e,n)=>(fu(t,typeof e!="symbol"?e+"":e,n),n),Yi=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},P=(t,e,n)=>(Yi(t,e,"read from private field"),n?n.call(t):e.get(t)),mr=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Mt=(t,e,n,r)=>(Yi(t,e,"write to private field"),e.set(t,n),n);function pu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function hu(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}function mu(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xi={exports:{}};const vu={},yu=Object.freeze(Object.defineProperty({__proto__:null,default:vu},Symbol.toStringTag,{value:"Module"})),gu=hu(yu);(function(t){(function(){var e,n=0,r=[],i;for(i=0;i<256;i++)r[i]=(i+256).toString(16).substr(1);c.BUFFER_SIZE=4096,c.bin=s,c.clearBuffer=function(){e=null,n=0},c.test=function(u){return typeof u=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(u):!1};var a;typeof crypto<"u"?a=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(a=window.msCrypto),typeof mu=="function"?(a=a||gu,t.exports=c):typeof window<"u"&&(window.uuid=c),c.randomBytes=function(){if(a){if(a.randomBytes)return a.randomBytes;if(a.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(u){var l=new Uint8Array(u);return a.getRandomValues(l),Array.from(l)}:function(u){var l=new Uint8Array(u);return a.getRandomValues(l),l}}return function(u){var l,f=[];for(l=0;l<u;l++)f.push(Math.floor(Math.random()*256));return f}}();function o(u){return(!e||n+u>c.BUFFER_SIZE)&&(n=0,e=c.randomBytes(c.BUFFER_SIZE)),e.slice(n,n+=u)}function s(){var u=o(16);return u[6]=u[6]&15|64,u[8]=u[8]&63|128,u}function c(){var u=s();return r[u[0]]+r[u[1]]+r[u[2]]+r[u[3]]+"-"+r[u[4]]+r[u[5]]+"-"+r[u[6]]+r[u[7]]+"-"+r[u[8]]+r[u[9]]+"-"+r[u[10]]+r[u[11]]+r[u[12]]+r[u[13]]+r[u[14]]+r[u[15]]}})()})(Xi);var ku=Xi.exports;const vr=pu(ku);var yr=function(t,e){return yr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},yr(t,e)};function ge(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");yr(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var g=function(){return g=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},g.apply(this,arguments)};function Te(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Pe(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(l){try{u(r.next(l))}catch(f){o(f)}}function c(l){try{u(r.throw(l))}catch(f){o(f)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((r=r.apply(t,e||[])).next())})}function Re(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(l){return c([u,l])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(l){u=[6,l],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function he(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}var gr="Invariant Violation",Zi=Object.setPrototypeOf,bu=Zi===void 0?function(t,e){return t.__proto__=e,t}:Zi,ea=function(t){ge(e,t);function e(n){n===void 0&&(n=gr);var r=t.call(this,typeof n=="number"?gr+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=gr,bu(r,e.prototype),r}return e}(Error);function Ze(t,e){if(!t)throw new ea(e)}var ta=["debug","log","warn","error","silent"],Nu=ta.indexOf("log");function yn(t){return function(){if(ta.indexOf(t)>=Nu){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=yn("debug"),t.log=yn("log"),t.warn=yn("warn"),t.error=yn("error")})(Ze||(Ze={}));var kr="3.10.4";function me(t){try{return t()}catch{}}const br=me(function(){return globalThis})||me(function(){return window})||me(function(){return self})||me(function(){return global})||me(function(){return me.constructor("return this")()});var na=new Map;function Nr(t){var e=na.get(t)||1;return na.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function ra(t,e){e===void 0&&(e=0);var n=Nr("stringifyForDisplay");return JSON.stringify(t,function(r,i){return i===void 0?n:i},e).split(JSON.stringify(n)).join("<undefined>")}function gn(t){return function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(typeof e=="number"){var i=e;e=Sr(i),e||(e=Er(i,n),n=[])}t.apply(void 0,[e].concat(n))}}var A=Object.assign(function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];t||Ze(t,Sr(e,n)||Er(e,n))},{debug:gn(Ze.debug),log:gn(Ze.log),warn:gn(Ze.warn),error:gn(Ze.error)});function ee(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new ea(Sr(t,e)||Er(t,e))}var ia=Symbol.for("ApolloErrorMessageHandler_"+kr);function aa(t){return typeof t=="string"?t:ra(t,2).slice(0,1e3)}function Sr(t,e){if(e===void 0&&(e=[]),!!t)return br[ia]&&br[ia](t,e.map(aa))}function Er(t,e){if(e===void 0&&(e=[]),!!t)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:kr,message:t,args:e.map(aa)})))}function kn(t,e){throw new Error(e)}function Su(t){return typeof t=="object"&&t!==null}function Eu(t,e){throw new Error("Unexpected invariant triggered.")}const wu=/\r\n|[\n\r]/g;function wr(t,e){let n=0,r=1;for(const i of t.body.matchAll(wu)){if(typeof i.index=="number"||Eu(),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function Ou(t){return oa(t.source,wr(t.source,t.start))}function oa(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?n:0,c=e.column+s,u=`${t.name}:${o}:${c}
2
- `,l=r.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){const d=Math.floor(c/80),p=c%80,h=[];for(let y=0;y<f.length;y+=80)h.push(f.slice(y,y+80));return u+sa([[`${o} |`,h[0]],...h.slice(1,d+1).map(y=>["|",y]),["|","^".padStart(p)],["|",h[d+1]]])}return u+sa([[`${o-1} |`,l[i-1]],[`${o} |`,f],["|","^".padStart(c)],[`${o+1} |`,l[i+1]]])}function sa(t){const e=t.filter(([r,i])=>i!==void 0),n=Math.max(...e.map(([r])=>r.length));return e.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
3
- `)}function Tu(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}class Or extends Error{constructor(e,...n){var r,i,a;const{nodes:o,source:s,positions:c,path:u,originalError:l,extensions:f}=Tu(n);super(e),this.name="GraphQLError",this.path=u??void 0,this.originalError=l??void 0,this.nodes=ua(Array.isArray(o)?o:o?[o]:void 0);const d=ua((r=this.nodes)===null||r===void 0?void 0:r.map(h=>h.loc).filter(h=>h!=null));this.source=s??(d==null||(i=d[0])===null||i===void 0?void 0:i.source),this.positions=c??(d==null?void 0:d.map(h=>h.start)),this.locations=c&&s?c.map(h=>wr(s,h)):d==null?void 0:d.map(h=>wr(h.source,h.start));const p=Su(l==null?void 0:l.extensions)?l==null?void 0:l.extensions:void 0;this.extensions=(a=f??p)!==null&&a!==void 0?a:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Or):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+=`
4
-
5
- `+Ou(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=`
6
-
7
- `+oa(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function ua(t){return t===void 0||t.length===0?void 0:t}function Y(t,e,n){return new Or(`Syntax Error: ${n}`,{source:t,positions:[e]})}class _u{constructor(e,n,r){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class ca{constructor(e,n,r,i,a,o){this.kind=e,this.start=n,this.end=r,this.line=i,this.column=a,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const la={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Fu=new Set(Object.keys(la));function da(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&Fu.has(e)}var lt;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(lt||(lt={}));var Tr;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Tr||(Tr={}));var T;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(T||(T={}));function _r(t){return t===9||t===32}function jt(t){return t>=48&&t<=57}function fa(t){return t>=97&&t<=122||t>=65&&t<=90}function pa(t){return fa(t)||t===95}function Du(t){return fa(t)||jt(t)||t===95}function Iu(t){var e;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<t.length;++o){var a;const s=t[o],c=Au(s);c!==s.length&&(r=(a=r)!==null&&a!==void 0?a:o,i=o,o!==0&&c<n&&(n=c))}return t.map((o,s)=>s===0?o:o.slice(n)).slice((e=r)!==null&&e!==void 0?e:0,i+1)}function Au(t){let e=0;for(;e<t.length&&_r(t.charCodeAt(e));)++e;return e}function xu(t,e){const n=t.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,a=r.length>1&&r.slice(1).every(p=>p.length===0||_r(p.charCodeAt(0))),o=n.endsWith('\\"""'),s=t.endsWith('"')&&!o,c=t.endsWith("\\"),u=s||c,l=!i||t.length>70||u||a||o;let f="";const d=i&&_r(t.charCodeAt(0));return(l&&!d||a)&&(f+=`
8
- `),f+=n,(l||u)&&(f+=`
9
- `),'"""'+f+'"""'}var N;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(N||(N={}));class Cu{constructor(e){const n=new ca(N.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==N.EOF)do if(e.next)e=e.next;else{const n=Ru(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===N.COMMENT);return e}}function Pu(t){return t===N.BANG||t===N.DOLLAR||t===N.AMP||t===N.PAREN_L||t===N.PAREN_R||t===N.SPREAD||t===N.COLON||t===N.EQUALS||t===N.AT||t===N.BRACKET_L||t===N.BRACKET_R||t===N.BRACE_L||t===N.PIPE||t===N.BRACE_R}function dt(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function bn(t,e){return ha(t.charCodeAt(e))&&ma(t.charCodeAt(e+1))}function ha(t){return t>=55296&&t<=56319}function ma(t){return t>=56320&&t<=57343}function et(t,e){const n=t.source.body.codePointAt(e);if(n===void 0)return N.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function G(t,e,n,r,i){const a=t.line,o=1+n-t.lineStart;return new ca(e,n,r,a,o,i)}function Ru(t,e){const n=t.source.body,r=n.length;let i=e;for(;i<r;){const a=n.charCodeAt(i);switch(a){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++t.line,t.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++t.line,t.lineStart=i;continue;case 35:return Mu(t,i);case 33:return G(t,N.BANG,i,i+1);case 36:return G(t,N.DOLLAR,i,i+1);case 38:return G(t,N.AMP,i,i+1);case 40:return G(t,N.PAREN_L,i,i+1);case 41:return G(t,N.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return G(t,N.SPREAD,i,i+3);break;case 58:return G(t,N.COLON,i,i+1);case 61:return G(t,N.EQUALS,i,i+1);case 64:return G(t,N.AT,i,i+1);case 91:return G(t,N.BRACKET_L,i,i+1);case 93:return G(t,N.BRACKET_R,i,i+1);case 123:return G(t,N.BRACE_L,i,i+1);case 124:return G(t,N.PIPE,i,i+1);case 125:return G(t,N.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?Bu(t,i):Lu(t,i)}if(jt(a)||a===45)return ju(t,i,a);if(pa(a))return Qu(t,i);throw Y(t.source,i,a===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:dt(a)||bn(n,i)?`Unexpected character: ${et(t,i)}.`:`Invalid character: ${et(t,i)}.`)}return G(t,N.EOF,r,r)}function Mu(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const a=n.charCodeAt(i);if(a===10||a===13)break;if(dt(a))++i;else if(bn(n,i))i+=2;else break}return G(t,N.COMMENT,e,i,n.slice(e+1,i))}function ju(t,e,n){const r=t.source.body;let i=e,a=n,o=!1;if(a===45&&(a=r.charCodeAt(++i)),a===48){if(a=r.charCodeAt(++i),jt(a))throw Y(t.source,i,`Invalid number, unexpected digit after 0: ${et(t,i)}.`)}else i=Fr(t,i,a),a=r.charCodeAt(i);if(a===46&&(o=!0,a=r.charCodeAt(++i),i=Fr(t,i,a),a=r.charCodeAt(i)),(a===69||a===101)&&(o=!0,a=r.charCodeAt(++i),(a===43||a===45)&&(a=r.charCodeAt(++i)),i=Fr(t,i,a),a=r.charCodeAt(i)),a===46||pa(a))throw Y(t.source,i,`Invalid number, expected digit but got: ${et(t,i)}.`);return G(t,o?N.FLOAT:N.INT,e,i,r.slice(e,i))}function Fr(t,e,n){if(!jt(n))throw Y(t.source,e,`Invalid number, expected digit but got: ${et(t,e)}.`);const r=t.source.body;let i=e+1;for(;jt(r.charCodeAt(i));)++i;return i}function Lu(t,e){const n=t.source.body,r=n.length;let i=e+1,a=i,o="";for(;i<r;){const s=n.charCodeAt(i);if(s===34)return o+=n.slice(a,i),G(t,N.STRING,e,i+1,o);if(s===92){o+=n.slice(a,i);const c=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?qu(t,i):Vu(t,i):Uu(t,i);o+=c.value,i+=c.size,a=i;continue}if(s===10||s===13)break;if(dt(s))++i;else if(bn(n,i))i+=2;else throw Y(t.source,i,`Invalid character within String: ${et(t,i)}.`)}throw Y(t.source,i,"Unterminated string.")}function qu(t,e){const n=t.source.body;let r=0,i=3;for(;i<12;){const a=n.charCodeAt(e+i++);if(a===125){if(i<5||!dt(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Lt(a),r<0)break}throw Y(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+i)}".`)}function Vu(t,e){const n=t.source.body,r=va(n,e+2);if(dt(r))return{value:String.fromCodePoint(r),size:6};if(ha(r)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const i=va(n,e+8);if(ma(i))return{value:String.fromCodePoint(r,i),size:12}}throw Y(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function va(t,e){return Lt(t.charCodeAt(e))<<12|Lt(t.charCodeAt(e+1))<<8|Lt(t.charCodeAt(e+2))<<4|Lt(t.charCodeAt(e+3))}function Lt(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Uu(t,e){const n=t.source.body;switch(n.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
10
- `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Y(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function Bu(t,e){const n=t.source.body,r=n.length;let i=t.lineStart,a=e+3,o=a,s="";const c=[];for(;a<r;){const u=n.charCodeAt(a);if(u===34&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34){s+=n.slice(o,a),c.push(s);const l=G(t,N.BLOCK_STRING,e,a+3,Iu(c).join(`
11
- `));return t.line+=c.length-1,t.lineStart=i,l}if(u===92&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34&&n.charCodeAt(a+3)===34){s+=n.slice(o,a),o=a+1,a+=4;continue}if(u===10||u===13){s+=n.slice(o,a),c.push(s),u===13&&n.charCodeAt(a+1)===10?a+=2:++a,s="",o=a,i=a;continue}if(dt(u))++a;else if(bn(n,a))a+=2;else throw Y(t.source,a,`Invalid character within String: ${et(t,a)}.`)}throw Y(t.source,a,"Unterminated string.")}function Qu(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const a=n.charCodeAt(i);if(Du(a))++i;else break}return G(t,N.NAME,e,i,n.slice(e,i))}const Wu=10,ya=2;function Dr(t){return Nn(t,[])}function Nn(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return zu(t,e);default:return String(t)}}function zu(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const n=[...e,t];if($u(t)){const r=t.toJSON();if(r!==t)return typeof r=="string"?r:Nn(r,n)}else if(Array.isArray(t))return Gu(t,n);return Ku(t,n)}function $u(t){return typeof t.toJSON=="function"}function Ku(t,e){const n=Object.entries(t);return n.length===0?"{}":e.length>ya?"["+Ju(t)+"]":"{ "+n.map(([r,i])=>r+": "+Nn(i,e)).join(", ")+" }"}function Gu(t,e){if(t.length===0)return"[]";if(e.length>ya)return"[Array]";const n=Math.min(Wu,t.length),r=t.length-n,i=[];for(let a=0;a<n;++a)i.push(Nn(t[a],e));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function Ju(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){const n=t.constructor.name;if(typeof n=="string"&&n!=="")return n}return e}const Hu=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(t,e){return t instanceof e}:function(t,e){if(t instanceof e)return!0;if(typeof t=="object"&&t!==null){var n;const r=e.prototype[Symbol.toStringTag],i=Symbol.toStringTag in t?t[Symbol.toStringTag]:(n=t.constructor)===null||n===void 0?void 0:n.name;if(r===i){const a=Dr(t);throw new Error(`Cannot use ${r} "${a}" from another module or realm.
12
-
13
- Ensure that there is only one instance of "graphql" in the node_modules
14
- directory. If different versions of "graphql" are the dependencies of other
15
- relied on modules, use "resolutions" to ensure only one version is installed.
16
-
17
- https://yarnpkg.com/en/docs/selective-version-resolutions
18
-
19
- Duplicate "graphql" modules cannot be used at the same time since different
20
- versions may have different capabilities and behavior. The data from one
21
- version used in the function from another could produce confusing and
22
- spurious results.`)}}return!1};class ga{constructor(e,n="GraphQL request",r={line:1,column:1}){typeof e=="string"||kn(!1,`Body must be a string. Received: ${Dr(e)}.`),this.body=e,this.name=n,this.locationOffset=r,this.locationOffset.line>0||kn(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||kn(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function Yu(t){return Hu(t,ga)}function Xu(t,e){return new Zu(t,e).parseDocument()}class Zu{constructor(e,n={}){const r=Yu(e)?e:new ga(e);this._lexer=new Cu(r),this._options=n,this._tokenCounter=0}parseName(){const e=this.expectToken(N.NAME);return this.node(e,{kind:T.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:T.DOCUMENT,definitions:this.many(N.SOF,this.parseDefinition,N.EOF)})}parseDefinition(){if(this.peek(N.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===N.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Y(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(N.BRACE_L))return this.node(e,{kind:T.OPERATION_DEFINITION,operation:lt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let r;return this.peek(N.NAME)&&(r=this.parseName()),this.node(e,{kind:T.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(N.NAME);switch(e.value){case"query":return lt.QUERY;case"mutation":return lt.MUTATION;case"subscription":return lt.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(N.PAREN_L,this.parseVariableDefinition,N.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:T.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(N.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(N.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(N.DOLLAR),this.node(e,{kind:T.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:T.SELECTION_SET,selections:this.many(N.BRACE_L,this.parseSelection,N.BRACE_R)})}parseSelection(){return this.peek(N.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let r,i;return this.expectOptionalToken(N.COLON)?(r=n,i=this.parseName()):i=n,this.node(e,{kind:T.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(N.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(N.PAREN_L,n,N.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(N.COLON),this.node(n,{kind:T.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(N.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(N.NAME)?this.node(e,{kind:T.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:T.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:T.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:T.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const n=this._lexer.token;switch(n.kind){case N.BRACKET_L:return this.parseList(e);case N.BRACE_L:return this.parseObject(e);case N.INT:return this.advanceLexer(),this.node(n,{kind:T.INT,value:n.value});case N.FLOAT:return this.advanceLexer(),this.node(n,{kind:T.FLOAT,value:n.value});case N.STRING:case N.BLOCK_STRING:return this.parseStringLiteral();case N.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:T.BOOLEAN,value:!0});case"false":return this.node(n,{kind:T.BOOLEAN,value:!1});case"null":return this.node(n,{kind:T.NULL});default:return this.node(n,{kind:T.ENUM,value:n.value})}case N.DOLLAR:if(e)if(this.expectToken(N.DOLLAR),this._lexer.token.kind===N.NAME){const r=this._lexer.token.value;throw Y(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:T.STRING,value:e.value,block:e.kind===N.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:T.LIST,values:this.any(N.BRACKET_L,n,N.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:T.OBJECT,fields:this.any(N.BRACE_L,n,N.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,r=this.parseName();return this.expectToken(N.COLON),this.node(n,{kind:T.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(N.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(N.AT),this.node(n,{kind:T.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(N.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(N.BRACKET_R),n=this.node(e,{kind:T.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(N.BANG)?this.node(e,{kind:T.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:T.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(N.STRING)||this.peek(N.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),i=this.many(N.BRACE_L,this.parseOperationTypeDefinition,N.BRACE_R);return this.node(e,{kind:T.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(N.COLON);const r=this.parseNamedType();return this.node(e,{kind:T.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:T.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:T.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:a,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(N.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(N.BRACE_L,this.parseFieldDefinition,N.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(N.COLON);const a=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:T.FIELD_DEFINITION,description:n,name:r,arguments:i,type:a,directives:o})}parseArgumentDefs(){return this.optionalMany(N.PAREN_L,this.parseInputValueDef,N.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(N.COLON);const i=this.parseTypeReference();let a;this.expectOptionalToken(N.EQUALS)&&(a=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:T.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:a,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:T.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:a,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),i=this.parseConstDirectives(),a=this.parseUnionMemberTypes();return this.node(e,{kind:T.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:a})}parseUnionMemberTypes(){return this.expectOptionalToken(N.EQUALS)?this.delimitedMany(N.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),i=this.parseConstDirectives(),a=this.parseEnumValuesDefinition();return this.node(e,{kind:T.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:a})}parseEnumValuesDefinition(){return this.optionalMany(N.BRACE_L,this.parseEnumValueDefinition,N.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:T.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Y(this._lexer.source,this._lexer.token.start,`${Sn(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),i=this.parseConstDirectives(),a=this.parseInputFieldsDefinition();return this.node(e,{kind:T.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:a})}parseInputFieldsDefinition(){return this.optionalMany(N.BRACE_L,this.parseInputValueDef,N.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===N.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(N.BRACE_L,this.parseOperationTypeDefinition,N.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:T.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(e,{kind:T.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(e,{kind:T.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:a})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(e,{kind:T.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:T.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:T.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:T.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(N.AT);const r=this.parseName(),i=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:T.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(N.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(Tr,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new _u(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw Y(this._lexer.source,n.start,`Expected ${ka(e)}, found ${Sn(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===N.NAME&&n.value===e)this.advanceLexer();else throw Y(this._lexer.source,n.start,`Expected "${e}", found ${Sn(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===N.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e??this._lexer.token;return Y(this._lexer.source,n.start,`Unexpected ${Sn(n)}.`)}any(e,n,r){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(e,n,r){if(this.expectOptionalToken(e)){const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(e,n,r){this.expectToken(e);const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(e,n){this.expectOptionalToken(e);const r=[];do r.push(n.call(this));while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(e!==void 0&&n.kind!==N.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw Y(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function Sn(t){const e=t.value;return ka(t.kind)+(e!=null?` "${e}"`:"")}function ka(t){return Pu(t)?`"${t}"`:t}function ec(t){return`"${t.replace(tc,nc)}"`}const tc=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function nc(t){return rc[t.charCodeAt(0)]}const rc=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Ir=Object.freeze({});function _e(t,e,n=la){const r=new Map;for(const v of Object.values(T))r.set(v,ic(e,v));let i,a=Array.isArray(t),o=[t],s=-1,c=[],u=t,l,f;const d=[],p=[];do{s++;const v=s===o.length,b=v&&c.length!==0;if(v){if(l=p.length===0?void 0:d[d.length-1],u=f,f=p.pop(),b)if(a){u=u.slice();let S=0;for(const[E,w]of c){const O=E-S;w===null?(u.splice(O,1),S++):u[O]=w}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(const[S,E]of c)u[S]=E}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(f){if(l=a?s:o[s],u=f[l],u==null)continue;d.push(l)}let k;if(!Array.isArray(u)){var h,y;da(u)||kn(!1,`Invalid AST Node: ${Dr(u)}.`);const S=v?(h=r.get(u.kind))===null||h===void 0?void 0:h.leave:(y=r.get(u.kind))===null||y===void 0?void 0:y.enter;if(k=S==null?void 0:S.call(e,u,l,f,d,p),k===Ir)break;if(k===!1){if(!v){d.pop();continue}}else if(k!==void 0&&(c.push([l,k]),!v))if(da(k))u=k;else{d.pop();continue}}if(k===void 0&&b&&c.push([l,u]),v)d.pop();else{var m;i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(u),o=a?u:(m=n[u.kind])!==null&&m!==void 0?m:[],s=-1,c=[],f&&p.push(f),f=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:t}function ic(t,e){const n=t[e];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}function ac(t){return _e(t,sc)}const oc=80,sc={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>_(t.definitions,`
23
-
24
- `)},OperationDefinition:{leave(t){const e=R("(",_(t.variableDefinitions,", "),")"),n=_([t.operation,_([t.name,e]),_(t.directives," ")]," ");return(n==="query"?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+R(" = ",n)+R(" ",_(r," "))},SelectionSet:{leave:({selections:t})=>ve(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:i}){const a=R("",t,": ")+e;let o=a+R("(",_(n,", "),")");return o.length>oc&&(o=a+R(`(
25
- `,En(_(n,`
26
- `)),`
27
- )`)),_([o,_(r," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+R(" ",_(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>_(["...",R("on ",t),_(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${t}${R("(",_(n,", "),")")} on ${e} ${R("",_(r," ")," ")}`+i},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?xu(t):ec(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+_(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+_(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+R("(",_(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>R("",t,`
28
- `)+_(["schema",_(e," "),ve(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>R("",t,`
29
- `)+_(["scalar",e,_(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>R("",t,`
30
- `)+_(["type",e,R("implements ",_(n," & ")),_(r," "),ve(i)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:r,directives:i})=>R("",t,`
31
- `)+e+(ba(n)?R(`(
32
- `,En(_(n,`
33
- `)),`
34
- )`):R("(",_(n,", "),")"))+": "+r+R(" ",_(i," "))},InputValueDefinition:{leave:({description:t,name:e,type:n,defaultValue:r,directives:i})=>R("",t,`
35
- `)+_([e+": "+n,R("= ",r),_(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>R("",t,`
36
- `)+_(["interface",e,R("implements ",_(n," & ")),_(r," "),ve(i)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:n,types:r})=>R("",t,`
37
- `)+_(["union",e,_(n," "),R("= ",_(r," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:n,values:r})=>R("",t,`
38
- `)+_(["enum",e,_(n," "),ve(r)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:n})=>R("",t,`
39
- `)+_([e,_(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:n,fields:r})=>R("",t,`
40
- `)+_(["input",e,_(n," "),ve(r)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:n,repeatable:r,locations:i})=>R("",t,`
41
- `)+"directive @"+e+(ba(n)?R(`(
42
- `,En(_(n,`
43
- `)),`
44
- )`):R("(",_(n,", "),")"))+(r?" repeatable":"")+" on "+_(i," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>_(["extend schema",_(t," "),ve(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>_(["extend scalar",t,_(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>_(["extend type",t,R("implements ",_(e," & ")),_(n," "),ve(r)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>_(["extend interface",t,R("implements ",_(e," & ")),_(n," "),ve(r)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:n})=>_(["extend union",t,_(e," "),R("= ",_(n," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:n})=>_(["extend enum",t,_(e," "),ve(n)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:n})=>_(["extend input",t,_(e," "),ve(n)]," ")}};function _(t,e=""){var n;return(n=t==null?void 0:t.filter(r=>r).join(e))!==null&&n!==void 0?n:""}function ve(t){return R(`{
45
- `,En(_(t,`
46
- `)),`
47
- }`)}function R(t,e,n=""){return e!=null&&e!==""?t+e+n:""}function En(t){return R(" ",t.replace(/\n/g,`
48
- `))}function ba(t){var e;return(e=t==null?void 0:t.some(n=>n.includes(`
49
- `)))!==null&&e!==void 0?e:!1}function Na(t){return t.kind===T.FIELD||t.kind===T.FRAGMENT_SPREAD||t.kind===T.INLINE_FRAGMENT}function qt(t,e){var n=t.directives;return!n||!n.length?!0:lc(n).every(function(r){var i=r.directive,a=r.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],A(o!==void 0,68,i.name.value)):o=a.value.value,i.name.value==="skip"?!o:o})}function Vt(t,e,n){var r=new Set(t),i=r.size;return _e(e,{Directive:function(a){if(r.delete(a.name.value)&&(!n||!r.size))return Ir}}),n?!r.size:r.size<i}function uc(t){return t&&Vt(["client","export"],t,!0)}function cc(t){var e=t.name.value;return e==="skip"||e==="include"}function lc(t){var e=[];return t&&t.length&&t.forEach(function(n){if(cc(n)){var r=n.arguments,i=n.name.value;A(r&&r.length===1,69,i);var a=r[0];A(a.name&&a.name.value==="if",70,i);var o=a.value;A(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),71,i),e.push({directive:n,ifArgument:a})}}),e}const dc=()=>Object.create(null),{forEach:fc,slice:Sa}=Array.prototype,{hasOwnProperty:pc}=Object.prototype;let ft=class cu{constructor(e=!0,n=dc){this.weakness=e,this.makeData=n}lookup(){return this.lookupArray(arguments)}lookupArray(e){let n=this;return fc.call(e,r=>n=n.getChildTrie(r)),pc.call(n,"data")?n.data:n.data=this.makeData(Sa.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let n=this;for(let r=0,i=e.length;n&&r<i;++r){const a=n.mapFor(e[r],!1);n=a&&a.get(e[r])}return n&&n.data}remove(){return this.removeArray(arguments)}removeArray(e){let n;if(e.length){const r=e[0],i=this.mapFor(r,!1),a=i&&i.get(r);a&&(n=a.removeArray(Sa.call(e,1)),!a.data&&!a.weak&&!(a.strong&&a.strong.size)&&i.delete(r))}else n=this.data,delete this.data;return n}getChildTrie(e){const n=this.mapFor(e,!0);let r=n.get(e);return r||n.set(e,r=new cu(this.weakness,this.makeData)),r}mapFor(e,n){return this.weakness&&hc(e)?this.weak||(n?this.weak=new WeakMap:void 0):this.strong||(n?this.strong=new Map:void 0)}};function hc(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var pt=typeof WeakMap=="function"&&!me(function(){return navigator.product=="ReactNative"&&!global.HermesInternal}),Ea=typeof WeakSet=="function",wa=typeof Symbol=="function"&&typeof Symbol.for=="function",wn=wa&&Symbol.asyncIterator;me(function(){return window.document.createElement}),me(function(){return navigator.userAgent.indexOf("jsdom")>=0});function Q(t){return t!==null&&typeof t=="object"}function mc(t,e){var n=e,r=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw ee(72,a.operation,a.name?" named '".concat(a.name.value,"'"):"");a.kind==="FragmentDefinition"&&r.push(a)}),typeof n>"u"&&(A(r.length===1,73,r.length),n=r[0].name.value);var i=g(g({},t),{definitions:he([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],t.definitions,!0)});return i}function On(t){t===void 0&&(t=[]);var e={};return t.forEach(function(n){e[n.name.value]=n}),e}function Tn(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var n=t.name.value;if(typeof e=="function")return e(n);var r=e&&e[n];return A(r,74,n),r||null}default:return null}}function vc(){}class Ar{constructor(e=1/0,n=vc){this.max=e,this.dispose=n,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const n=this.getNode(e);return n&&n.value}get size(){return this.map.size}getNode(e){const n=this.map.get(e);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(e,n){let r=this.getNode(e);return r?r.value=n:(r={key:e,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const n=this.map.get(e);return n?(n===this.newest&&(this.newest=n.older),n===this.oldest&&(this.oldest=n.newer),n.newer&&(n.newer.older=n.older),n.older&&(n.older.newer=n.newer),this.map.delete(e),this.dispose(n.value,e),!0):!1}}function xr(){}const yc=xr,gc=typeof WeakRef<"u"?WeakRef:function(t){return{deref:()=>t}},kc=typeof WeakMap<"u"?WeakMap:Map,bc=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:xr,unregister:xr}},Nc=10024;class _n{constructor(e=1/0,n=yc){this.max=e,this.dispose=n,this.map=new kc,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const r=this.unfinalizedNodes.values();for(let i=0;i<Nc;i++){const a=r.next().value;if(!a)break;this.unfinalizedNodes.delete(a);const o=a.key;delete a.key,a.keyRef=new gc(o),this.registry.register(o,a,a)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new bc(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const n=this.getNode(e);return n&&n.value}getNode(e){const n=this.map.get(e);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(e,n){let r=this.getNode(e);return r?r.value=n:(r={key:e,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.scheduleFinalization(r),this.map.set(e,r),this.size++,r.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const n=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,n),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),n&&this.map.delete(n)}delete(e){const n=this.map.get(e);return n?(this.deleteNode(n),!0):!1}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Cr=new WeakSet;function Oa(t){t.size<=(t.max||-1)||Cr.has(t)||(Cr.add(t),setTimeout(function(){t.clean(),Cr.delete(t)},100))}var Ta=function(t,e){var n=new _n(t,e);return n.set=function(r,i){var a=_n.prototype.set.call(this,r,i);return Oa(this),a},n},Sc=function(t,e){var n=new Ar(t,e);return n.set=function(r,i){var a=Ar.prototype.set.call(this,r,i);return Oa(this),a},n},Ec=Symbol.for("apollo.cacheSize"),Fe=g({},br[Ec]),tt={};function _a(t,e){tt[t]=e}var wc=globalThis.__DEV__!==!1?Fc:void 0,Oc=globalThis.__DEV__!==!1?Dc:void 0,Tc=globalThis.__DEV__!==!1?Fa:void 0;function _c(){var t={parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4};return Object.fromEntries(Object.entries(t).map(function(e){var n=e[0],r=e[1];return[n,Fe[n]||r]}))}function Fc(){var t,e,n,r,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:_c(),sizes:g({print:(t=tt.print)===null||t===void 0?void 0:t.call(tt),parser:(e=tt.parser)===null||e===void 0?void 0:e.call(tt),canonicalStringify:(n=tt.canonicalStringify)===null||n===void 0?void 0:n.call(tt),links:Rr(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:Ia(this.queryManager.documentTransform)}},(i=(r=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(r))}}function Fa(){return{cache:{fragmentQueryDocuments:Me(this.getFragmentDoc)}}}function Dc(){var t=this.config.fragments;return g(g({},Fa.apply(this)),{addTypenameDocumentTransform:Ia(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:Me(this.storeReader.executeSelectionSet),executeSubSelectedArray:Me(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:Me(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:Me(t==null?void 0:t.findFragmentSpreads),lookup:Me(t==null?void 0:t.lookup),transform:Me(t==null?void 0:t.transform)}})}function Ic(t){return!!t&&"dirtyKey"in t}function Me(t){return Ic(t)?t.size:void 0}function Da(t){return t!=null}function Ia(t){return Pr(t).map(function(e){return{cache:e}})}function Pr(t){return t?he(he([Me(t==null?void 0:t.performWork)],Pr(t==null?void 0:t.left),!0),Pr(t==null?void 0:t.right),!0).filter(Da):[]}function Rr(t){var e;return t?he(he([(e=t==null?void 0:t.getMemoryInternals)===null||e===void 0?void 0:e.call(t)],Rr(t==null?void 0:t.left),!0),Rr(t==null?void 0:t.right),!0).filter(Da):[]}var je=Object.assign(function(t){return JSON.stringify(t,Ac)},{reset:function(){ht=new Sc(Fe.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&_a("canonicalStringify",function(){return ht.size});var ht;je.reset();function Ac(t,e){if(e&&typeof e=="object"){var n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){var r=Object.keys(e);if(r.every(xc))return e;var i=JSON.stringify(r),a=ht.get(i);if(!a){r.sort();var o=JSON.stringify(r);a=ht.get(o)||r,ht.set(i,a),ht.set(o,a)}var s=Object.create(n);return a.forEach(function(c){s[c]=e[c]}),s}}return e}function xc(t,e,n){return e===0||n[e-1]<=t}function mt(t){return{__ref:String(t)}}function L(t){return!!(t&&typeof t=="object"&&typeof t.__ref=="string")}function Cc(t){return Q(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Pc(t){return t.kind==="StringValue"}function Rc(t){return t.kind==="BooleanValue"}function Mc(t){return t.kind==="IntValue"}function jc(t){return t.kind==="FloatValue"}function Lc(t){return t.kind==="Variable"}function qc(t){return t.kind==="ObjectValue"}function Vc(t){return t.kind==="ListValue"}function Uc(t){return t.kind==="EnumValue"}function Bc(t){return t.kind==="NullValue"}function vt(t,e,n,r){if(Mc(n)||jc(n))t[e.value]=Number(n.value);else if(Rc(n)||Pc(n))t[e.value]=n.value;else if(qc(n)){var i={};n.fields.map(function(o){return vt(i,o.name,o.value,r)}),t[e.value]=i}else if(Lc(n)){var a=(r||{})[n.name.value];t[e.value]=a}else if(Vc(n))t[e.value]=n.values.map(function(o){var s={};return vt(s,e,o,r),s[e.value]});else if(Uc(n))t[e.value]=n.value;else if(Bc(n))t[e.value]=null;else throw ee(83,e.value,n.kind)}function Qc(t,e){var n=null;t.directives&&(n={},t.directives.forEach(function(i){n[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return vt(n[i.name.value],o,s,e)})}));var r=null;return t.arguments&&t.arguments.length&&(r={},t.arguments.forEach(function(i){var a=i.name,o=i.value;return vt(r,a,o,e)})),Aa(t.name.value,r,n)}var Wc=["connection","include","skip","client","rest","export","nonreactive"],Ut=je,Aa=Object.assign(function(t,e,n){if(e&&n&&n.connection&&n.connection.key)if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach(function(s){i[s]=e[s]}),"".concat(n.connection.key,"(").concat(Ut(i),")")}else return n.connection.key;var a=t;if(e){var o=Ut(e);a+="(".concat(o,")")}return n&&Object.keys(n).forEach(function(s){Wc.indexOf(s)===-1&&(n[s]&&Object.keys(n[s]).length?a+="@".concat(s,"(").concat(Ut(n[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=Ut;return Ut=t,e}});function Fn(t,e){if(t.arguments&&t.arguments.length){var n={};return t.arguments.forEach(function(r){var i=r.name,a=r.value;return vt(n,i,a,e)}),n}return null}function Le(t){return t.alias?t.alias.value:t.name.value}function Mr(t,e,n){for(var r,i=0,a=e.selections;i<a.length;i++){var o=a[i];if(qe(o)){if(o.name.value==="__typename")return t[Le(o)]}else r?r.push(o):r=[o]}if(typeof t.__typename=="string")return t.__typename;if(r)for(var s=0,c=r;s<c.length;s++){var o=c[s],u=Mr(t,Tn(o,n).selectionSet,n);if(typeof u=="string")return u}}function qe(t){return t.kind==="Field"}function zc(t){return t.kind==="InlineFragment"}function Bt(t){A(t&&t.kind==="Document",75);var e=t.definitions.filter(function(n){return n.kind!=="FragmentDefinition"}).map(function(n){if(n.kind!=="OperationDefinition")throw ee(76,n.kind);return n});return A(e.length<=1,77,e.length),t}function Qt(t){return Bt(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function jr(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Dn(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function xa(t){var e=Qt(t);return A(e&&e.operation==="query",78),e}function $c(t){A(t.kind==="Document",79),A(t.definitions.length<=1,80);var e=t.definitions[0];return A(e.kind==="FragmentDefinition",81),e}function Wt(t){Bt(t);for(var e,n=0,r=t.definitions;n<r.length;n++){var i=r[n];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw ee(82)}function Lr(t){var e=Object.create(null),n=t&&t.variableDefinitions;return n&&n.length&&n.forEach(function(r){r.defaultValue&&vt(e,r.variable.name,r.defaultValue)}),e}const Kc=()=>Object.create(null),{forEach:Gc,slice:Jc}=Array.prototype,{hasOwnProperty:Hc}=Object.prototype;class qr{constructor(e=!0,n=Kc){this.weakness=e,this.makeData=n}lookup(...e){return this.lookupArray(e)}lookupArray(e){let n=this;return Gc.call(e,r=>n=n.getChildTrie(r)),Hc.call(n,"data")?n.data:n.data=this.makeData(Jc.call(e))}peek(...e){return this.peekArray(e)}peekArray(e){let n=this;for(let r=0,i=e.length;n&&r<i;++r){const a=this.weakness&&Ca(e[r])?n.weak:n.strong;n=a&&a.get(e[r])}return n&&n.data}getChildTrie(e){const n=this.weakness&&Ca(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let r=n.get(e);return r||n.set(e,r=new qr(this.weakness,this.makeData)),r}}function Ca(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}let Z=null;const Pa={};let Yc=1;const Xc=()=>class{constructor(){this.id=["slot",Yc++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=Z;t;t=t.parent)if(this.id in t.slots){const e=t.slots[this.id];if(e===Pa)break;return t!==Z&&(Z.slots[this.id]=e),!0}return Z&&(Z.slots[this.id]=Pa),!1}getValue(){if(this.hasValue())return Z.slots[this.id]}withValue(t,e,n,r){const i={__proto__:null,[this.id]:t},a=Z;Z={parent:a,slots:i};try{return e.apply(r,n)}finally{Z=a}}static bind(t){const e=Z;return function(){const n=Z;try{return Z=e,t.apply(this,arguments)}finally{Z=n}}}static noContext(t,e,n){if(Z){const r=Z;try{return Z=null,t.apply(n,e)}finally{Z=r}}else return t.apply(n,e)}};function Ra(t){try{return t()}catch{}}const Vr="@wry/context:Slot",Zc=Ra(()=>globalThis)||Ra(()=>global)||Object.create(null),Ma=Zc,ja=Ma[Vr]||Array[Vr]||function(t){try{Object.defineProperty(Ma,Vr,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(Xc()),In=new ja,{hasOwnProperty:el}=Object.prototype,Ur=Array.from||function(t){const e=[];return t.forEach(n=>e.push(n)),e};function Br(t){const{unsubscribe:e}=t;typeof e=="function"&&(t.unsubscribe=void 0,e())}const zt=[],tl=100;function yt(t,e){if(!t)throw new Error(e||"assertion failure")}function La(t,e){const n=t.length;return n>0&&n===e.length&&t[n-1]===e[n-1]}function qa(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Va(t){return t.slice(0)}class An{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++An.count}peek(){if(this.value.length===1&&!Ve(this))return Ua(this),this.value[0]}recompute(e){return yt(!this.recomputing,"already recomputing"),Ua(this),Ve(this)?nl(this,e):qa(this.value)}setDirty(){this.dirty||(this.dirty=!0,Ba(this),Br(this))}dispose(){this.setDirty(),Ka(this),Qr(this,(e,n)=>{e.setDirty(),Ga(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=zt.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(Ur(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),zt.push(this.deps),this.deps=null)}}An.count=0;function Ua(t){const e=In.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Ve(t)?Wa(e,t):za(e,t),e}function nl(t,e){return Ka(t),In.withValue(t,rl,[t,e]),al(t,e)&&il(t),qa(t.value)}function rl(t,e){t.recomputing=!0;const{normalizeResult:n}=t;let r;n&&t.value.length===1&&(r=Va(t.value)),t.value.length=0;try{if(t.value[0]=t.fn.apply(null,e),n&&r&&!La(r,t.value))try{t.value[0]=n(t.value[0],r[0])}catch{}}catch(i){t.value[1]=i}t.recomputing=!1}function Ve(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function il(t){t.dirty=!1,!Ve(t)&&Qa(t)}function Ba(t){Qr(t,Wa)}function Qa(t){Qr(t,za)}function Qr(t,e){const n=t.parents.size;if(n){const r=Ur(t.parents);for(let i=0;i<n;++i)e(r[i],t)}}function Wa(t,e){yt(t.childValues.has(e)),yt(Ve(e));const n=!Ve(t);if(!t.dirtyChildren)t.dirtyChildren=zt.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),n&&Ba(t)}function za(t,e){yt(t.childValues.has(e)),yt(!Ve(e));const n=t.childValues.get(e);n.length===0?t.childValues.set(e,Va(e.value)):La(n,e.value)||t.setDirty(),$a(t,e),!Ve(t)&&Qa(t)}function $a(t,e){const n=t.dirtyChildren;n&&(n.delete(e),n.size===0&&(zt.length<tl&&zt.push(n),t.dirtyChildren=null))}function Ka(t){t.childValues.size>0&&t.childValues.forEach((e,n)=>{Ga(t,n)}),t.forgetDeps(),yt(t.dirtyChildren===null)}function Ga(t,e){e.parents.delete(t),t.childValues.delete(e),$a(t,e)}function al(t,e){if(typeof t.subscribe=="function")try{Br(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}const ol={setDirty:!0,dispose:!0,forget:!0};function Ja(t){const e=new Map;function n(r){const i=In.getValue();if(i){let a=e.get(r);a||e.set(r,a=new Set),i.dependOn(a)}}return n.dirty=function(r,i){const a=e.get(r);if(a){const o=i&&el.call(ol,i)?i:"setDirty";Ur(a).forEach(s=>s[o]()),e.delete(r),Br(a)}},n}let Ha;function sl(...t){return(Ha||(Ha=new qr(typeof WeakMap=="function"))).lookupArray(t)}const Wr=new Set;function $t(t,{max:e=Math.pow(2,16),keyArgs:n,makeCacheKey:r=sl,normalizeResult:i,subscribe:a,cache:o=Ar}=Object.create(null)){const s=typeof o=="function"?new o(e,d=>d.dispose()):o,c=function(){const d=r.apply(null,n?n.apply(null,arguments):arguments);if(d===void 0)return t.apply(null,arguments);let p=s.get(d);p||(s.set(d,p=new An(t)),p.normalizeResult=i,p.subscribe=a,p.forget=()=>s.delete(d));const h=p.recompute(Array.prototype.slice.call(arguments));return s.set(d,p),Wr.add(s),In.hasValue()||(Wr.forEach(y=>y.clean()),Wr.clear()),h};Object.defineProperty(c,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:e,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:a,cache:s});function u(d){const p=d&&s.get(d);p&&p.setDirty()}c.dirtyKey=u,c.dirty=function(){u(r.apply(null,arguments))};function l(d){const p=d&&s.get(d);if(p)return p.peek()}c.peekKey=l,c.peek=function(){return l(r.apply(null,arguments))};function f(d){return d?s.delete(d):!1}return c.forgetKey=f,c.forget=function(){return f(r.apply(null,arguments))},c.makeCacheKey=r,c.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(c)}function ul(t){return t}var Ya=function(){function t(e,n){n===void 0&&(n=Object.create(null)),this.resultCache=Ea?new WeakSet:new Set,this.transform=e,n.getCacheKey&&(this.getCacheKey=n.getCacheKey),this.cached=n.cache!==!1,this.resetCache()}return t.prototype.getCacheKey=function(e){return[e]},t.identity=function(){return new t(ul,{cache:!1})},t.split=function(e,n,r){return r===void 0&&(r=t.identity()),Object.assign(new t(function(i){var a=e(i)?n:r;return a.transformDocument(i)},{cache:!1}),{left:n,right:r})},t.prototype.resetCache=function(){var e=this;if(this.cached){var n=new ft(pt);this.performWork=$t(t.prototype.performWork.bind(this),{makeCacheKey:function(r){var i=e.getCacheKey(r);if(i)return A(Array.isArray(i),67),n.lookupArray(i)},max:Fe["documentTransform.cache"],cache:_n})}},t.prototype.performWork=function(e){return Bt(e),this.transform(e)},t.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var n=this.performWork(e);return this.resultCache.add(n),n},t.prototype.concat=function(e){var n=this;return Object.assign(new t(function(r){return e.transformDocument(n.transformDocument(r))},{cache:!1}),{left:this,right:e})},t}(),Kt,xn=Object.assign(function(t){var e=Kt.get(t);return e||(e=ac(t),Kt.set(t,e)),e},{reset:function(){Kt=new Ta(Fe.print||2e3)}});xn.reset(),globalThis.__DEV__!==!1&&_a("print",function(){return Kt?Kt.size:0});var W=Array.isArray;function ke(t){return Array.isArray(t)&&t.length>0}var Xa={kind:T.FIELD,name:{kind:T.NAME,value:"__typename"}};function Za(t,e){return!t||t.selectionSet.selections.every(function(n){return n.kind===T.FRAGMENT_SPREAD&&Za(e[n.name.value],e)})}function cl(t){return Za(Qt(t)||$c(t),On(Dn(t)))?null:t}function ll(t){var e=new Map,n=new Map;return t.forEach(function(r){r&&(r.name?e.set(r.name,r):r.test&&n.set(r.test,r))}),function(r){var i=e.get(r.name.value);return!i&&n.size&&n.forEach(function(a,o){o(r)&&(i=a)}),i}}function eo(t){var e=new Map;return function(n){n===void 0&&(n=t);var r=e.get(n);return r||e.set(n,r={variables:new Set,fragmentSpreads:new Set}),r}}function to(t,e){Bt(e);for(var n=eo(""),r=eo(""),i=function(v){for(var b=0,k=void 0;b<v.length&&(k=v[b]);++b)if(!W(k)){if(k.kind===T.OPERATION_DEFINITION)return n(k.name&&k.name.value);if(k.kind===T.FRAGMENT_DEFINITION)return r(k.name.value)}return globalThis.__DEV__!==!1&&A.error(84),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===T.OPERATION_DEFINITION&&++a;var s=ll(t),c=function(v){return ke(v)&&v.map(s).some(function(b){return b&&b.remove})},u=new Map,l=!1,f={enter:function(v){if(c(v.directives))return l=!0,null}},d=_e(e,{Field:f,InlineFragment:f,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(v,b,k,S,E){var w=i(E);w&&w.variables.add(v.name.value)}},FragmentSpread:{enter:function(v,b,k,S,E){if(c(v.directives))return l=!0,null;var w=i(E);w&&w.fragmentSpreads.add(v.name.value)}},FragmentDefinition:{enter:function(v,b,k,S){u.set(JSON.stringify(S),v)},leave:function(v,b,k,S){var E=u.get(JSON.stringify(S));if(v===E)return v;if(a>0&&v.selectionSet.selections.every(function(w){return w.kind===T.FIELD&&w.name.value==="__typename"}))return r(v.name.value).removed=!0,l=!0,null}},Directive:{leave:function(v){if(s(v))return l=!0,null}}});if(!l)return e;var p=function(v){return v.transitiveVars||(v.transitiveVars=new Set(v.variables),v.removed||v.fragmentSpreads.forEach(function(b){p(r(b)).transitiveVars.forEach(function(k){v.transitiveVars.add(k)})})),v},h=new Set;d.definitions.forEach(function(v){v.kind===T.OPERATION_DEFINITION?p(n(v.name&&v.name.value)).fragmentSpreads.forEach(function(b){h.add(b)}):v.kind===T.FRAGMENT_DEFINITION&&a===0&&!r(v.name.value).removed&&h.add(v.name.value)}),h.forEach(function(v){p(r(v)).fragmentSpreads.forEach(function(b){h.add(b)})});var y=function(v){return!!(!h.has(v)||r(v).removed)},m={enter:function(v){if(y(v.name.value))return null}};return cl(_e(d,{FragmentSpread:m,FragmentDefinition:m,OperationDefinition:{leave:function(v){if(v.variableDefinitions){var b=p(n(v.name&&v.name.value)).transitiveVars;if(b.size<v.variableDefinitions.length)return g(g({},v),{variableDefinitions:v.variableDefinitions.filter(function(k){return b.has(k.variable.name.value)})})}}}}))}var zr=Object.assign(function(t){return _e(t,{SelectionSet:{enter:function(e,n,r){if(!(r&&r.kind===T.OPERATION_DEFINITION)){var i=e.selections;if(i){var a=i.some(function(s){return qe(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=r;if(!(qe(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return g(g({},e),{selections:he(he([],i,!0),[Xa],!1)})}}}}}})},{added:function(t){return t===Xa}});function dl(t){var e=Wt(t),n=e.operation;if(n==="query")return t;var r=_e(t,{OperationDefinition:{enter:function(i){return g(g({},i),{operation:"query"})}}});return r}function no(t){Bt(t);var e=to([{test:function(n){return n.name.value==="client"},remove:!0}],t);return e}var fl=Object.prototype.hasOwnProperty;function ro(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Cn(t)}function Cn(t){var e=t[0]||{},n=t.length;if(n>1)for(var r=new Ue,i=1;i<n;++i)e=r.merge(e,t[i]);return e}var pl=function(t,e,n){return this.merge(t[n],e[n])},Ue=function(){function t(e){e===void 0&&(e=pl),this.reconciler=e,this.isObject=Q,this.pastCopies=new Set}return t.prototype.merge=function(e,n){for(var r=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return Q(n)&&Q(e)?(Object.keys(n).forEach(function(o){if(fl.call(e,o)){var s=e[o];if(n[o]!==s){var c=r.reconciler.apply(r,he([e,n,o],i,!1));c!==s&&(e=r.shallowCopyForMerge(e),e[o]=c)}}else e=r.shallowCopyForMerge(e),e[o]=n[o]}),e):n},t.prototype.shallowCopyForMerge=function(e){return Q(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=g({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function hl(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=ml(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
50
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ml(t,e){if(t){if(typeof t=="string")return io(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return io(t,e)}}function io(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ao(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $r(t,e,n){return e&&ao(t.prototype,e),n&&ao(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Kr=function(){return typeof Symbol=="function"},Gr=function(t){return Kr()&&!!Symbol[t]},Jr=function(t){return Gr(t)?Symbol[t]:"@@"+t};Kr()&&!Gr("observable")&&(Symbol.observable=Symbol("observable"));var vl=Jr("iterator"),Hr=Jr("observable"),oo=Jr("species");function Pn(t,e){var n=t[e];if(n!=null){if(typeof n!="function")throw new TypeError(n+" is not a function");return n}}function Gt(t){var e=t.constructor;return e!==void 0&&(e=e[oo],e===null&&(e=void 0)),e!==void 0?e:U}function yl(t){return t instanceof U}function gt(t){gt.log?gt.log(t):setTimeout(function(){throw t})}function Rn(t){Promise.resolve().then(function(){try{t()}catch(e){gt(e)}})}function so(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var n=Pn(e,"unsubscribe");n&&n.call(e)}}catch(r){gt(r)}}function Yr(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function gl(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var n=0;n<e.length&&(uo(t,e[n].type,e[n].value),t._state!=="closed");++n);}}function uo(t,e,n){t._state="running";var r=t._observer;try{var i=Pn(r,e);switch(e){case"next":i&&i.call(r,n);break;case"error":if(Yr(t),i)i.call(r,n);else throw n;break;case"complete":Yr(t),i&&i.call(r);break}}catch(a){gt(a)}t._state==="closed"?so(t):t._state==="running"&&(t._state="ready")}function Xr(t,e,n){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:n});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:n}],Rn(function(){return gl(t)});return}uo(t,e,n)}}var kl=function(){function t(n,r){this._cleanup=void 0,this._observer=n,this._queue=void 0,this._state="initializing";var i=new bl(this);try{this._cleanup=r.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(Yr(this),so(this))},$r(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),bl=function(){function t(n){this._subscription=n}var e=t.prototype;return e.next=function(n){Xr(this._subscription,"next",n)},e.error=function(n){Xr(this._subscription,"error",n)},e.complete=function(){Xr(this._subscription,"complete")},$r(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),U=function(){function t(n){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof n!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=n}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new kl(n,this._subscriber)},e.forEach=function(n){var r=this;return new Promise(function(i,a){if(typeof n!="function"){a(new TypeError(n+" is not a function"));return}function o(){s.unsubscribe(),i()}var s=r.subscribe({next:function(c){try{n(c,o)}catch(u){a(u),s.unsubscribe()}},error:a,complete:i})})},e.map=function(n){var r=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var i=Gt(this);return new i(function(a){return r.subscribe({next:function(o){try{o=n(o)}catch(s){return a.error(s)}a.next(o)},error:function(o){a.error(o)},complete:function(){a.complete()}})})},e.filter=function(n){var r=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var i=Gt(this);return new i(function(a){return r.subscribe({next:function(o){try{if(!n(o))return}catch(s){return a.error(s)}a.next(o)},error:function(o){a.error(o)},complete:function(){a.complete()}})})},e.reduce=function(n){var r=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var i=Gt(this),a=arguments.length>1,o=!1,s=arguments[1],c=s;return new i(function(u){return r.subscribe({next:function(l){var f=!o;if(o=!0,!f||a)try{c=n(c,l)}catch(d){return u.error(d)}else c=l},error:function(l){u.error(l)},complete:function(){if(!o&&!a)return u.error(new TypeError("Cannot reduce an empty sequence"));u.next(c),u.complete()}})})},e.concat=function(){for(var n=this,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=Gt(this);return new o(function(s){var c,u=0;function l(f){c=f.subscribe({next:function(d){s.next(d)},error:function(d){s.error(d)},complete:function(){u===i.length?(c=void 0,s.complete()):l(o.from(i[u++]))}})}return l(n),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(n){var r=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var i=Gt(this);return new i(function(a){var o=[],s=r.subscribe({next:function(u){if(n)try{u=n(u)}catch(f){return a.error(f)}var l=i.from(u).subscribe({next:function(f){a.next(f)},error:function(f){a.error(f)},complete:function(){var f=o.indexOf(l);f>=0&&o.splice(f,1),c()}});o.push(l)},error:function(u){a.error(u)},complete:function(){c()}});function c(){s.closed&&o.length===0&&a.complete()}return function(){o.forEach(function(u){return u.unsubscribe()}),s.unsubscribe()}})},e[Hr]=function(){return this},t.from=function(n){var r=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var i=Pn(n,Hr);if(i){var a=i.call(n);if(Object(a)!==a)throw new TypeError(a+" is not an object");return yl(a)&&a.constructor===r?a:new r(function(o){return a.subscribe(o)})}if(Gr("iterator")&&(i=Pn(n,vl),i))return new r(function(o){Rn(function(){if(!o.closed){for(var s=hl(i.call(n)),c;!(c=s()).done;){var u=c.value;if(o.next(u),o.closed)return}o.complete()}})});if(Array.isArray(n))return new r(function(o){Rn(function(){if(!o.closed){for(var s=0;s<n.length;++s)if(o.next(n[s]),o.closed)return;o.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=typeof this=="function"?this:t;return new a(function(o){Rn(function(){if(!o.closed){for(var s=0;s<r.length;++s)if(o.next(r[s]),o.closed)return;o.complete()}})})},$r(t,null,[{key:oo,get:function(){return this}}]),t}();Kr()&&Object.defineProperty(U,Symbol("extensions"),{value:{symbol:Hr,hostReportError:gt},configurable:!0});function Nl(t){var e,n=t.Symbol;if(typeof n=="function")if(n.observable)e=n.observable;else{typeof n.for=="function"?e=n.for("https://github.com/benlesh/symbol-observable"):e=n("https://github.com/benlesh/symbol-observable");try{n.observable=e}catch{}}else e="@@observable";return e}var kt;typeof self<"u"?kt=self:typeof window<"u"?kt=window:typeof global<"u"?kt=global:typeof module<"u"?kt=module:kt=Function("return this")(),Nl(kt);var co=U.prototype,lo="@@observable";co[lo]||(co[lo]=function(){return this});var Sl=Object.prototype.toString;function fo(t){return Zr(t)}function Zr(t,e){switch(Sl.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var n=t.slice(0);return e.set(t,n),n.forEach(function(i,a){n[a]=Zr(i,e)}),n}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var r=Object.create(Object.getPrototypeOf(t));return e.set(t,r),Object.keys(t).forEach(function(i){r[i]=Zr(t[i],e)}),r}default:return t}}function El(t){var e=new Set([t]);return e.forEach(function(n){Q(n)&&wl(n)===n&&Object.getOwnPropertyNames(n).forEach(function(r){Q(n[r])&&e.add(n[r])})}),t}function wl(t){if(globalThis.__DEV__!==!1&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function ei(t){return globalThis.__DEV__!==!1&&El(t),t}function Jt(t,e,n){var r=[];t.forEach(function(i){return i[e]&&r.push(i)}),r.forEach(function(i){return i[e](n)})}function ti(t,e,n){return new U(function(r){var i={then:function(c){return new Promise(function(u){return u(c())})}};function a(c,u){return function(l){if(c){var f=function(){return r.closed?0:c(l)};i=i.then(f,f).then(function(d){return r.next(d)},function(d){return r.error(d)})}else r[u](l)}}var o={next:a(e,"next"),error:a(n,"error"),complete:function(){i.then(function(){return r.complete()})}},s=t.subscribe(o);return function(){return s.unsubscribe()}})}function po(t){function e(n){Object.defineProperty(t,n,{value:U})}return wa&&Symbol.species&&e(Symbol.species),e("@@species"),t}function ho(t){return t&&typeof t.then=="function"}var bt=function(t){ge(e,t);function e(n){var r=t.call(this,function(i){return r.addObserver(i),function(){return r.removeObserver(i)}})||this;return r.observers=new Set,r.promise=new Promise(function(i,a){r.resolve=i,r.reject=a}),r.handlers={next:function(i){r.sub!==null&&(r.latest=["next",i],r.notify("next",i),Jt(r.observers,"next",i))},error:function(i){var a=r.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),r.sub=null,r.latest=["error",i],r.reject(i),r.notify("error",i),Jt(r.observers,"error",i))},complete:function(){var i=r,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var c=s.shift();c?ho(c)?c.then(function(u){return r.sub=u.subscribe(r.handlers)},r.handlers.error):r.sub=c.subscribe(r.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),r.sub=null,r.latest&&r.latest[0]==="next"?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),Jt(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(i){r.reject(i),r.sources=[],r.handlers.complete()},r.promise.catch(function(i){}),typeof n=="function"&&(n=[new U(n)]),ho(n)?n.then(function(i){return r.start(i)},r.handlers.error):r.start(n),r}return e.prototype.start=function(n){this.sub===void 0&&(this.sources=Array.from(n),this.handlers.complete())},e.prototype.deliverLastMessage=function(n){if(this.latest){var r=this.latest[0],i=n[r];i&&i.call(n,this.latest[1]),this.sub===null&&r==="next"&&n.complete&&n.complete()}},e.prototype.addObserver=function(n){this.observers.has(n)||(this.deliverLastMessage(n),this.observers.add(n))},e.prototype.removeObserver=function(n){this.observers.delete(n)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(n,r){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(n,r)}))},e.prototype.beforeNext=function(n){var r=!1;this.nextResultListeners.add(function(i,a){r||(r=!0,n(i,a))})},e}(U);po(bt);function Nt(t){return"incremental"in t}function Ol(t){return"hasNext"in t&&"data"in t}function Tl(t){return Nt(t)||Ol(t)}function _l(t){return Q(t)&&"payload"in t}function mo(t,e){var n=t,r=new Ue;return Nt(e)&&ke(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var c=o[s],u=!isNaN(+c),l=u?[]:{};l[c]=a,a=l}n=r.merge(n,a)}),n}function Mn(t){var e=ni(t);return ke(e)}function ni(t){var e=ke(t.errors)?t.errors.slice(0):[];return Nt(t)&&ke(t.incremental)&&t.incremental.forEach(function(n){n.errors&&e.push.apply(e,n.errors)}),e}function St(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Object.create(null);return t.forEach(function(r){r&&Object.keys(r).forEach(function(i){var a=r[i];a!==void 0&&(n[i]=a)})}),n}function ri(t,e){return St(t,e,e.variables&&{variables:St(g(g({},t&&t.variables),e.variables))})}function ii(t){return new U(function(e){e.error(t)})}var vo=function(t,e,n){var r=new Error(n);throw r.name="ServerError",r.response=t,r.statusCode=t.status,r.result=e,r};function Fl(t){for(var e=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];if(e.indexOf(i)<0)throw ee(43,i)}return t}function Dl(t,e){var n=g({},t),r=function(a){typeof a=="function"?n=g(g({},n),a(n)):n=g(g({},n),a)},i=function(){return g({},n)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:r}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Il(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?jr(e.query)||void 0:""),e}function Al(t,e){var n=g({},t),r=new Set(Object.keys(t));return _e(e,{Variable:function(i,a,o){o&&o.kind!=="VariableDefinition"&&r.delete(i.name.value)}}),r.forEach(function(i){delete n[i]}),n}function yo(t,e){return e?e(t):U.of()}function Ht(t){return typeof t=="function"?new nt(t):t}function jn(t){return t.request.length<=1}var nt=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return U.of()})},t.from=function(e){return e.length===0?t.empty():e.map(Ht).reduce(function(n,r){return n.concat(r)})},t.split=function(e,n,r){var i=Ht(n),a=Ht(r||new t(yo)),o;return jn(i)&&jn(a)?o=new t(function(s){return e(s)?i.request(s)||U.of():a.request(s)||U.of()}):o=new t(function(s,c){return e(s)?i.request(s,c)||U.of():a.request(s,c)||U.of()}),Object.assign(o,{left:i,right:a})},t.execute=function(e,n){return e.request(Dl(n.context,Il(Fl(n))))||U.of()},t.concat=function(e,n){var r=Ht(e);if(jn(r))return globalThis.__DEV__!==!1&&A.warn(35,r),r;var i=Ht(n),a;return jn(i)?a=new t(function(o){return r.request(o,function(s){return i.request(s)||U.of()})||U.of()}):a=new t(function(o,s){return r.request(o,function(c){return i.request(c,s)||U.of()})||U.of()}),Object.assign(a,{left:r,right:i})},t.prototype.split=function(e,n,r){return this.concat(t.split(e,n,r||new t(yo)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,n){throw ee(36)},t.prototype.onError=function(e,n){if(n&&n.error)return n.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}(),ai=nt.execute;function xl(t){var e,n=t[Symbol.asyncIterator]();return e={next:function(){return n.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Cl(t){var e=null,n=null,r=!1,i=[],a=[];function o(f){if(!n){if(a.length){var d=a.shift();if(Array.isArray(d)&&d[0])return d[0]({value:f,done:!1})}i.push(f)}}function s(f){n=f;var d=a.slice();d.forEach(function(p){p[1](f)}),!e||e()}function c(){r=!0;var f=a.slice();f.forEach(function(d){d[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",c),t.removeListener("finish",c),t.removeListener("close",c)},t.on("data",o),t.on("error",s),t.on("end",c),t.on("finish",c),t.on("close",c);function u(){return new Promise(function(f,d){if(n)return d(n);if(i.length)return f({value:i.shift(),done:!1});if(r)return f({value:void 0,done:!0});a.push([f,d])})}var l={next:function(){return u()}};return wn&&(l[Symbol.asyncIterator]=function(){return this}),l}function Pl(t){var e=!1,n={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(r,i){t.then(function(a){r({value:a,done:!1})}).catch(i)}))}};return wn&&(n[Symbol.asyncIterator]=function(){return this}),n}function go(t){var e={next:function(){return t.read()}};return wn&&(e[Symbol.asyncIterator]=function(){return this}),e}function Rl(t){return!!t.body}function Ml(t){return!!t.getReader}function jl(t){return!!(wn&&t[Symbol.asyncIterator])}function Ll(t){return!!t.stream}function ql(t){return!!t.arrayBuffer}function Vl(t){return!!t.pipe}function Ul(t){var e=t;if(Rl(t)&&(e=t.body),jl(e))return xl(e);if(Ml(e))return go(e.getReader());if(Ll(e))return go(e.stream().getReader());if(ql(e))return Pl(e.arrayBuffer());if(Vl(e))return Cl(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var oi=Symbol();function Bl(t){return t.extensions?Array.isArray(t.extensions[oi]):!1}function Ql(t){return t.hasOwnProperty("graphQLErrors")}var Wl=function(t){var e=he(he(he([],t.graphQLErrors,!0),t.clientErrors,!0),t.protocolErrors,!0);return t.networkError&&e.push(t.networkError),e.map(function(n){return Q(n)&&n.message||"Error message not found."}).join(`
51
- `)},Et=function(t){ge(e,t);function e(n){var r=n.graphQLErrors,i=n.protocolErrors,a=n.clientErrors,o=n.networkError,s=n.errorMessage,c=n.extraInfo,u=t.call(this,s)||this;return u.name="ApolloError",u.graphQLErrors=r||[],u.protocolErrors=i||[],u.clientErrors=a||[],u.networkError=o||null,u.message=s||Wl(u),u.extraInfo=c,u.__proto__=e.prototype,u}return e}(Error),ko=Object.prototype.hasOwnProperty;function zl(t,e){return Pe(this,void 0,void 0,function(){var n,r,i,a,o,s,c,u,l,f,d,p,h,y,m,v,b,k,S,E,w,O,F,I;return Re(this,function(x){switch(x.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");n=new TextDecoder("utf-8"),r=(I=t.headers)===null||I===void 0?void 0:I.get("content-type"),i="boundary=",a=r!=null&&r.includes(i)?r==null?void 0:r.substring((r==null?void 0:r.indexOf(i))+i.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",o=`\r
52
- --`.concat(a),s="",c=Ul(t),u=!0,x.label=1;case 1:return u?[4,c.next()]:[3,3];case 2:for(l=x.sent(),f=l.value,d=l.done,p=typeof f=="string"?f:n.decode(f),h=s.length-o.length+1,u=!d,s+=p,y=s.indexOf(o,h);y>-1;){if(m=void 0,O=[s.slice(0,y),s.slice(y+o.length)],m=O[0],s=O[1],v=m.indexOf(`\r
53
- \r
54
- `),b=$l(m.slice(0,v)),k=b["content-type"],k&&k.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(S=m.slice(v),S){if(E=bo(t,S),Object.keys(E).length>1||"data"in E||"incremental"in E||"errors"in E||"payload"in E)if(_l(E)){if(w={},"payload"in E){if(Object.keys(E).length===1&&E.payload===null)return[2];w=g({},E.payload)}"errors"in E&&(w=g(g({},w),{extensions:g(g({},"extensions"in w?w.extensions:null),(F={},F[oi]=E.errors,F))})),e(w)}else e(E);else if(Object.keys(E).length===1&&"hasNext"in E&&!E.hasNext)return[2]}y=s.indexOf(o)}return[3,1];case 3:return[2]}})})}function $l(t){var e={};return t.split(`
55
- `).forEach(function(n){var r=n.indexOf(":");if(r>-1){var i=n.slice(0,r).trim().toLowerCase(),a=n.slice(r+1).trim();e[i]=a}}),e}function bo(t,e){if(t.status>=300){var n=function(){try{return JSON.parse(e)}catch{return e}};vo(t,n(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var r=i;throw r.name="ServerParseError",r.response=t,r.statusCode=t.status,r.bodyText=e,r}}function Kl(t,e){t.result&&t.result.errors&&t.result.data&&e.next(t.result),e.error(t)}function Gl(t){return function(e){return e.text().then(function(n){return bo(e,n)}).then(function(n){return!Array.isArray(n)&&!ko.call(n,"data")&&!ko.call(n,"errors")&&vo(e,n,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(r){return r.operationName}):t.operationName,"'.")),n})}}var si=function(t,e){var n;try{n=JSON.stringify(t)}catch(i){var r=ee(39,e,i.message);throw r.parseError=i,r}return n},Jl={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Hl={accept:"*/*","content-type":"application/json"},Yl={method:"POST"},Xl={http:Jl,headers:Hl,options:Yl},Zl=function(t,e){return e(t)};function ed(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={},a={};n.forEach(function(f){i=g(g(g({},i),f.options),{headers:g(g({},i.headers),f.headers)}),f.credentials&&(i.credentials=f.credentials),a=g(g({},a),f.http)}),i.headers&&(i.headers=td(i.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,c=t.variables,u=t.query,l={operationName:o,variables:c};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(u,xn)),{options:i,body:l}}function td(t,e){if(!e){var n=Object.create(null);return Object.keys(Object(t)).forEach(function(a){n[a.toLowerCase()]=t[a]}),n}var r=Object.create(null);Object.keys(Object(t)).forEach(function(a){r[a.toLowerCase()]={originalName:a,value:t[a]}});var i=Object.create(null);return Object.keys(r).forEach(function(a){i[r[a].originalName]=r[a].value}),i}var nd=function(t){if(!t&&typeof fetch>"u")throw ee(37)},rd=function(t,e){var n=t.getContext(),r=n.uri;return r||(typeof e=="function"?e(t):e||"/graphql")};function id(t,e){var n=[],r=function(f,d){n.push("".concat(f,"=").concat(encodeURIComponent(d)))};if("query"in e&&r("query",e.query),e.operationName&&r("operationName",e.operationName),e.variables){var i=void 0;try{i=si(e.variables,"Variables map")}catch(f){return{parseError:f}}r("variables",i)}if(e.extensions){var a=void 0;try{a=si(e.extensions,"Extensions map")}catch(f){return{parseError:f}}r("extensions",a)}var o="",s=t,c=t.indexOf("#");c!==-1&&(o=t.substr(c),s=t.substr(0,c));var u=s.indexOf("?")===-1?"?":"&",l=s+u+n.join("&")+o;return{newURI:l}}var No=me(function(){return fetch}),ad=function(t){t===void 0&&(t={});var e=t.uri,n=e===void 0?"/graphql":e,r=t.fetch,i=t.print,a=i===void 0?Zl:i,o=t.includeExtensions,s=t.preserveHeaderCase,c=t.useGETForQueries,u=t.includeUnusedVariables,l=u===void 0?!1:u,f=Te(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&nd(r||No);var d={http:{includeExtensions:o,preserveHeaderCase:s},options:f.fetchOptions,credentials:f.credentials,headers:f.headers};return new nt(function(p){var h=rd(p,n),y=p.getContext(),m={};if(y.clientAwareness){var v=y.clientAwareness,b=v.name,k=v.version;b&&(m["apollographql-client-name"]=b),k&&(m["apollographql-client-version"]=k)}var S=g(g({},m),y.headers),E={http:y.http,options:y.fetchOptions,credentials:y.credentials,headers:S};if(Vt(["client"],p.query)){var w=no(p.query);if(!w)return ii(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));p.query=w}var O=ed(p,a,Xl,d,E),F=O.options,I=O.body;I.variables&&!l&&(I.variables=Al(I.variables,p.query));var x;!F.signal&&typeof AbortController<"u"&&(x=new AbortController,F.signal=x.signal);var q=function(H){return H.kind==="OperationDefinition"&&H.operation==="mutation"},K=function(H){return H.kind==="OperationDefinition"&&H.operation==="subscription"},M=K(Wt(p.query)),$=Vt(["defer"],p.query);if(c&&!p.query.definitions.some(q)&&(F.method="GET"),$||M){F.headers=F.headers||{};var se="multipart/mixed;";M&&$&&globalThis.__DEV__!==!1&&A.warn(38),M?se+="boundary=graphql;subscriptionSpec=1.0,application/json":$&&(se+="deferSpec=20220824,application/json"),F.headers.accept=se}if(F.method==="GET"){var J=id(h,I),ue=J.newURI,st=J.parseError;if(st)return ii(st);h=ue}else try{F.body=si(I,"Payload")}catch(H){return ii(H)}return new U(function(H){var Pt=r||me(function(){return fetch})||No,Rt=H.next.bind(H);return Pt(h,F).then(function(pe){var Ye;p.setContext({response:pe});var xe=(Ye=pe.headers)===null||Ye===void 0?void 0:Ye.get("content-type");return xe!==null&&/^multipart\/mixed/i.test(xe)?zl(pe,Rt):Gl(p)(pe).then(Rt)}).then(function(){x=void 0,H.complete()}).catch(function(pe){x=void 0,Kl(pe,H)}),function(){x&&x.abort()}})})},So=function(t){ge(e,t);function e(n){n===void 0&&(n={});var r=t.call(this,ad(n).request)||this;return r.options=n,r}return e}(nt);const{toString:Eo,hasOwnProperty:od}=Object.prototype,wo=Function.prototype.toString,ui=new Map;function B(t,e){try{return ci(t,e)}finally{ui.clear()}}function ci(t,e){if(t===e)return!0;const n=Eo.call(t),r=Eo.call(e);if(n!==r)return!1;switch(n){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(To(t,e))return!0;const i=Oo(t),a=Oo(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!od.call(e,i[s]))return!1;for(let s=0;s<o;++s){const c=i[s];if(!ci(t[c],e[c]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(To(t,e))return!0;const i=t.entries(),a=n==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[s,c]=o.value;if(!e.has(s)||a&&!ci(c,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=wo.call(t);return i!==wo.call(e)?!1:!cd(i,ud)}}return!1}function Oo(t){return Object.keys(t).filter(sd,t)}function sd(t){return this[t]!==void 0}const ud="{ [native code] }";function cd(t,e){const n=t.length-e.length;return n>=0&&t.indexOf(e,n)===n}function To(t,e){let n=ui.get(t);if(n){if(n.has(e))return!0}else ui.set(t,n=new Set);return n.add(e),!1}function _o(t,e,n,r){var i=e.data,a=Te(e,["data"]),o=n.data,s=Te(n,["data"]);return B(a,s)&&Ln(Wt(t).selectionSet,i,o,{fragmentMap:On(Dn(t)),variables:r})}function Ln(t,e,n,r){if(e===n)return!0;var i=new Set;return t.selections.every(function(a){if(i.has(a)||(i.add(a),!qt(a,r.variables))||Fo(a))return!0;if(qe(a)){var o=Le(a),s=e&&e[o],c=n&&n[o],u=a.selectionSet;if(!u)return B(s,c);var l=Array.isArray(s),f=Array.isArray(c);if(l!==f)return!1;if(l&&f){var d=s.length;if(c.length!==d)return!1;for(var p=0;p<d;++p)if(!Ln(u,s[p],c[p],r))return!1;return!0}return Ln(u,s,c,r)}else{var h=Tn(a,r.fragmentMap);if(h)return Fo(h)?!0:Ln(h.selectionSet,e,n,r)}})}function Fo(t){return!!t.directives&&t.directives.some(ld)}function ld(t){return t.name.value==="nonreactive"}var Do=function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=$t(mc,{max:Fe["cache.fragmentQueryDocuments"]||1e3,cache:_n})}return t.prototype.batch=function(e){var n=this,r=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(n)},r),i},t.prototype.recordOptimisticTransaction=function(e,n){this.performTransaction(e,n)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,n){return n===void 0&&(n=!!e.optimistic),this.read(g(g({},e),{rootId:e.id||"ROOT_QUERY",optimistic:n}))},t.prototype.watchFragment=function(e){var n=this,r=e.fragment,i=e.fragmentName,a=e.from,o=e.optimistic,s=o===void 0?!0:o,c=this.getFragmentDoc(r,i),u={returnPartialData:!0,id:typeof a=="string"?a:this.identify(a),query:c,optimistic:s},l;return new U(function(f){return n.watch(g(g({},u),{immediate:!0,callback:function(d){if(!(l&&_o(c,{data:l==null?void 0:l.result},{data:d.result}))){var p={data:d.result,complete:!!d.complete};d.missing&&(p.missing=Cn(d.missing.map(function(h){return h.missing}))),l=d,f.next(p)}}}))})},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!!e.optimistic),this.read(g(g({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:n}))},t.prototype.writeQuery=function(e){var n=e.id,r=e.data,i=Te(e,["id","data"]);return this.write(Object.assign(i,{dataId:n||"ROOT_QUERY",result:r}))},t.prototype.writeFragment=function(e){var n=e.id,r=e.data,i=e.fragment,a=e.fragmentName,o=Te(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:n,result:r}))},t.prototype.updateQuery=function(e,n){return this.batch({update:function(r){var i=r.readQuery(e),a=n(i);return a==null?i:(r.writeQuery(g(g({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,n){return this.batch({update:function(r){var i=r.readFragment(e),a=n(i);return a==null?i:(r.writeFragment(g(g({},e),{data:a})),a)}})},t}();globalThis.__DEV__!==!1&&(Do.prototype.getMemoryInternals=Tc);var Io=function(t){ge(e,t);function e(n,r,i,a){var o,s=t.call(this,n)||this;if(s.message=n,s.path=r,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var c=s.path.length-1;c>=0;--c)s.missing=(o={},o[s.path[c]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error),X=Object.prototype.hasOwnProperty;function Yt(t){return t==null}function Ao(t,e){var n=t.__typename,r=t.id,i=t._id;if(typeof n=="string"&&(e&&(e.keyObject=Yt(r)?Yt(i)?void 0:{_id:i}:{id:r}),Yt(r)&&!Yt(i)&&(r=i),!Yt(r)))return"".concat(n,":").concat(typeof r=="number"||typeof r=="string"?r:JSON.stringify(r))}var xo={dataIdFromObject:Ao,addTypename:!0,resultCaching:!0,canonizeResults:!1};function dd(t){return St(xo,t)}function Co(t){var e=t.canonizeResults;return e===void 0?xo.canonizeResults:e}function fd(t,e){return L(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Po=/^[_a-z][_0-9a-z]*/i;function Be(t){var e=t.match(Po);return e?e[0]:t}function li(t,e,n){return Q(e)?W(e)?e.every(function(r){return li(t,r,n)}):t.selections.every(function(r){if(qe(r)&&qt(r,n)){var i=Le(r);return X.call(e,i)&&(!r.selectionSet||li(r.selectionSet,e[i],n))}return!0}):!1}function wt(t){return Q(t)&&!L(t)&&!W(t)}function pd(){return new Ue}function Ro(t,e){var n=On(Dn(t));return{fragmentMap:n,lookupFragment:function(r){var i=n[r];return!i&&e&&(i=e.lookup(r)),i||null}}}var qn=Object.create(null),di=function(){return qn},Mo=Object.create(null),Xt=function(){function t(e,n){var r=this;this.policies=e,this.group=n,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return ei(L(i)?r.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return L(i)?r.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return mt(i);if(L(i))return i;var o=r.policies.identify(i)[0];if(o){var s=mt(o);return a&&r.merge(o,i),s}}}return t.prototype.toObject=function(){return g({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,n){if(this.group.depend(e,n),X.call(this.data,e)){var r=this.data[e];if(r&&X.call(r,n))return r[n]}if(n==="__typename"&&X.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Qe)return this.parent.get(e,n)},t.prototype.lookup=function(e,n){if(n&&this.group.depend(e,"__exists"),X.call(this.data,e))return this.data[e];if(this instanceof Qe)return this.parent.lookup(e,n);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,n){var r=this,i;L(e)&&(e=e.__ref),L(n)&&(n=n.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof n=="string"?this.lookup(i=n):n;if(o){A(typeof i=="string",1);var s=new Ue(md).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var c=Object.create(null);a||(c.__exists=1),Object.keys(o).forEach(function(u){if(!a||a[u]!==s[u]){c[u]=1;var l=Be(u);l!==u&&!r.policies.hasKeyArgs(s.__typename,l)&&(c[l]=1),s[u]===void 0&&!(r instanceof Qe)&&delete s[u]}}),c.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete c.__typename,Object.keys(c).forEach(function(u){return r.group.dirty(i,u)})}}},t.prototype.modify=function(e,n){var r=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,c={DELETE:qn,INVALIDATE:Mo,isReference:L,toReference:this.toReference,canRead:this.canRead,readField:function(u,l){return r.policies.readField(typeof u=="string"?{fieldName:u,from:l||mt(e)}:u,{store:r})}};if(Object.keys(i).forEach(function(u){var l=Be(u),f=i[u];if(f!==void 0){var d=typeof n=="function"?n:n[u]||n[l];if(d){var p=d===di?qn:d(ei(f),g(g({},c),{fieldName:l,storeFieldName:u,storage:r.getStorage(e,u)}));if(p===Mo)r.group.dirty(e,u);else if(p===qn&&(p=void 0),p!==f&&(a[u]=p,o=!0,f=p,globalThis.__DEV__!==!1)){var h=function(E){if(r.lookup(E.__ref)===void 0)return globalThis.__DEV__!==!1&&A.warn(2,E),!0};if(L(p))h(p);else if(Array.isArray(p))for(var y=!1,m=void 0,v=0,b=p;v<b.length;v++){var k=b[v];if(L(k)){if(y=!0,h(k))break}else if(typeof k=="object"&&k){var S=r.policies.identify(k)[0];S&&(m=k)}if(y&&m!==void 0){globalThis.__DEV__!==!1&&A.warn(3,m);break}}}}f!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Qe?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,n,r){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=n&&r?this.policies.getStoreFieldName({typename:o,fieldName:n,args:r}):n;return this.modify(e,s?(i={},i[s]=di,i):di)}return!1},t.prototype.evict=function(e,n){var r=!1;return e.id&&(X.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof Qe&&this!==n&&(r=this.parent.evict(e,n)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,n=this.toObject(),r=[];return this.getRootIdSet().forEach(function(i){X.call(e.policies.rootTypenamesById,i)||r.push(i)}),r.length&&(n.__META={extraRootIds:r.sort()}),n},t.prototype.replace=function(e){var n=this;if(Object.keys(this.data).forEach(function(a){e&&X.call(e,a)||n.delete(a)}),e){var r=e.__META,i=Te(e,["__META"]);Object.keys(i).forEach(function(a){n.merge(a,i[a])}),r&&r.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var n=--this.rootIds[e];return n||delete this.rootIds[e],n}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Qe?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,n=this.getRootIdSet(),r=this.toObject();n.forEach(function(o){X.call(r,o)&&(Object.keys(e.findChildRefIds(o)).forEach(n.add,n),delete r[o])});var i=Object.keys(r);if(i.length){for(var a=this;a instanceof Qe;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!X.call(this.refs,e)){var n=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return n;var i=new Set([r]);i.forEach(function(a){L(a)&&(n[a.__ref]=!0),Q(a)&&Object.keys(a).forEach(function(o){var s=a[o];Q(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),jo=function(){function t(e,n){n===void 0&&(n=null),this.caching=e,this.parent=n,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?Ja():null,this.keyMaker=new ft(pt)},t.prototype.depend=function(e,n){if(this.d){this.d(fi(e,n));var r=Be(n);r!==n&&this.d(fi(e,r)),this.parent&&this.parent.depend(e,n)}},t.prototype.dirty=function(e,n){this.d&&this.d.dirty(fi(e,n),n==="__exists"?"forget":"setDirty")},t}();function fi(t,e){return e+"#"+t}function Lo(t,e){Zt(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(n){ge(r,n);function r(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,c=i.seed,u=n.call(this,a,new jo(s))||this;return u.stump=new hd(u),u.storageTrie=new ft(pt),c&&u.replace(c),u}return r.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},r.prototype.removeLayer=function(){return this},r.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},r}(t);t.Root=e})(Xt||(Xt={}));var Qe=function(t){ge(e,t);function e(n,r,i,a){var o=t.call(this,r.policies,a)||this;return o.id=n,o.parent=r,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(n,r){return new e(n,this,r,this.group)},e.prototype.removeLayer=function(n){var r=this,i=this.parent.removeLayer(n);return n===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=r.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(c){B(o[c],s[c])||r.group.dirty(a,c)}):(r.group.dirty(a,"__exists"),Object.keys(s).forEach(function(c){r.group.dirty(a,c)})):r.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return g(g({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(n){var r=this.parent.findChildRefIds(n);return X.call(this.data,n)?g(g({},r),t.prototype.findChildRefIds.call(this,n)):r},e.prototype.getStorage=function(){for(var n=this.parent;n.parent;)n=n.parent;return n.getStorage.apply(n,arguments)},e}(Xt),hd=function(t){ge(e,t);function e(n){return t.call(this,"EntityStore.Stump",n,function(){},new jo(n.group.caching,n.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(n,r){return this.parent.merge(n,r)},e}(Qe);function md(t,e,n){var r=t[n],i=e[n];return B(r,i)?r:i}function Zt(t){return!!(t instanceof Xt&&t.group.caching)}function vd(t){return Q(t)?W(t)?t.slice(0):g({__proto__:Object.getPrototypeOf(t)},t):t}var qo=function(){function t(){this.known=new(Ea?WeakSet:Set),this.pool=new ft(pt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return Q(e)&&this.known.has(e)},t.prototype.pass=function(e){if(Q(e)){var n=vd(e);return this.passes.set(n,e),n}return e},t.prototype.admit=function(e){var n=this;if(Q(e)){var r=this.passes.get(e);if(r)return r;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),globalThis.__DEV__!==!1&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),c=[s],u=this.sortedKeys(e);c.push(u.json);var l=c.length;u.sorted.forEach(function(p){c.push(n.admit(e[p]))});var o=this.pool.lookupArray(c);if(!o.object){var f=o.object=Object.create(s);this.known.add(f),u.sorted.forEach(function(p,h){f[p]=c[l+h]}),globalThis.__DEV__!==!1&&Object.freeze(f)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var n=Object.keys(e),r=this.pool.lookupArray(n);if(!r.keys){n.sort();var i=JSON.stringify(n);(r.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,r.keys={sorted:n,json:i})}return r.keys},t}();function Vo(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var yd=function(){function t(e){var n=this;this.knownResults=new(pt?WeakMap:Map),this.config=St(e,{addTypename:e.addTypename!==!1,canonizeResults:Co(e)}),this.canon=e.canon||new qo,this.executeSelectionSet=$t(function(r){var i,a=r.context.canonizeResults,o=Vo(r);o[3]=!a;var s=(i=n.executeSelectionSet).peek.apply(i,o);return s?a?g(g({},s),{result:n.canon.admit(s.result)}):s:(Lo(r.context.store,r.enclosingRef.__ref),n.execSelectionSetImpl(r))},{max:this.config.resultCacheMaxSize||Fe["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Vo,makeCacheKey:function(r,i,a,o){if(Zt(a.store))return a.store.makeCacheKey(r,L(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=$t(function(r){return Lo(r.context.store,r.enclosingRef.__ref),n.execSubSelectedArrayImpl(r)},{max:this.config.resultCacheMaxSize||Fe["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(r){var i=r.field,a=r.array,o=r.context;if(Zt(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new qo},t.prototype.diffQueryAgainstStore=function(e){var n=e.store,r=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,c=s===void 0?!0:s,u=e.canonizeResults,l=u===void 0?this.config.canonizeResults:u,f=this.config.cache.policies;o=g(g({},Lr(xa(r))),o);var d=mt(a),p=this.executeSelectionSet({selectionSet:Wt(r).selectionSet,objectOrReference:d,enclosingRef:d,context:g({store:n,query:r,policies:f,variables:o,varString:je(o),canonizeResults:l},Ro(r,this.config.fragments))}),h;if(p.missing&&(h=[new Io(gd(p.missing),p.missing,r,o)],!c))throw h[0];return{result:p.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,n,r,i){if(Zt(i.store)&&this.knownResults.get(e)===r){var a=this.executeSelectionSet.peek(r,n,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var n=this,r=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(L(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,c=o.policies,u=o.store,l=u.getFieldValue(i,"__typename"),f=[],d,p=new Ue;this.config.addTypename&&typeof l=="string"&&!c.rootIdsByTypename[l]&&f.push({__typename:l});function h(k,S){var E;return k.missing&&(d=p.merge(d,(E={},E[S]=k.missing,E))),k.result}var y=new Set(r.selections);y.forEach(function(k){var S,E;if(qt(k,s))if(qe(k)){var w=c.readField({fieldName:k.name.value,field:k,variables:o.variables,from:i},o),O=Le(k);w===void 0?zr.added(k)||(d=p.merge(d,(S={},S[O]="Can't find field '".concat(k.name.value,"' on ").concat(L(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),S))):W(w)?w.length>0&&(w=h(n.executeSubSelectedArray({field:k,array:w,enclosingRef:a,context:o}),O)):k.selectionSet?w!=null&&(w=h(n.executeSelectionSet({selectionSet:k.selectionSet,objectOrReference:w,enclosingRef:L(w)?w:a,context:o}),O)):o.canonizeResults&&(w=n.canon.pass(w)),w!==void 0&&f.push((E={},E[O]=w,E))}else{var F=Tn(k,o.lookupFragment);if(!F&&k.kind===T.FRAGMENT_SPREAD)throw ee(9,k.name.value);F&&c.fragmentMatches(F,l)&&F.selectionSet.selections.forEach(y.add,y)}});var m=Cn(f),v={result:m,missing:d},b=o.canonizeResults?this.canon.admit(v):ei(v);return b.result&&this.knownResults.set(b.result,r),b},t.prototype.execSubSelectedArrayImpl=function(e){var n=this,r=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,c=new Ue;function u(l,f){var d;return l.missing&&(s=c.merge(s,(d={},d[f]=l.missing,d))),l.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,f){return l===null?null:W(l)?u(n.executeSubSelectedArray({field:r,array:l,enclosingRef:a,context:o}),f):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:l,enclosingRef:L(l)?l:a,context:o}),f):(globalThis.__DEV__!==!1&&kd(o.store,r,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function gd(t){try{JSON.stringify(t,function(e,n){if(typeof n=="string")throw n;return n})}catch(e){return e}}function kd(t,e,n){if(!e.selectionSet){var r=new Set([n]);r.forEach(function(i){Q(i)&&(A(!L(i),10,fd(t,i),e.name.value),Object.values(i).forEach(r.add,r))})}}var pi=new ja,Uo=new WeakMap;function en(t){var e=Uo.get(t);return e||Uo.set(t,e={vars:new Set,dep:Ja()}),e}function Bo(t){en(t).vars.forEach(function(e){return e.forgetCache(t)})}function bd(t){en(t).vars.forEach(function(e){return e.attachCache(t)})}function Nd(t){var e=new Set,n=new Set,r=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(c){en(c).dep.dirty(r),Sd(c)});var o=Array.from(n);n.clear(),o.forEach(function(c){return c(t)})}}else{var s=pi.getValue();s&&(i(s),en(s).dep(r))}return t};r.onNextChange=function(a){return n.add(a),function(){n.delete(a)}};var i=r.attachCache=function(a){return e.add(a),en(a).vars.add(r),r};return r.forgetCache=function(a){return e.delete(a)},r}function Sd(t){t.broadcastWatches&&t.broadcastWatches()}var Qo=Object.create(null);function hi(t){var e=JSON.stringify(t);return Qo[e]||(Qo[e]=Object.create(null))}function Wo(t){var e=hi(t);return e.keyFieldsFn||(e.keyFieldsFn=function(n,r){var i=function(o,s){return r.readField(s,o)},a=r.keyObject=mi(t,function(o){var s=Ot(r.storeObject,o,i);return s===void 0&&n!==r.storeObject&&X.call(n,o[0])&&(s=Ot(n,o,Ko)),A(s!==void 0,4,o.join("."),n),s});return"".concat(r.typename,":").concat(JSON.stringify(a))})}function zo(t){var e=hi(t);return e.keyArgsFn||(e.keyArgsFn=function(n,r){var i=r.field,a=r.variables,o=r.fieldName,s=mi(t,function(u){var l=u[0],f=l.charAt(0);if(f==="@"){if(i&&ke(i.directives)){var d=l.slice(1),p=i.directives.find(function(v){return v.name.value===d}),h=p&&Fn(p,a);return h&&Ot(h,u.slice(1))}return}if(f==="$"){var y=l.slice(1);if(a&&X.call(a,y)){var m=u.slice(0);return m[0]=y,Ot(a,m)}return}if(n)return Ot(n,u)}),c=JSON.stringify(s);return(n||c!=="{}")&&(o+=":"+c),o})}function mi(t,e){var n=new Ue;return $o(t).reduce(function(r,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);r=n.merge(r,o)}return r},Object.create(null))}function $o(t){var e=hi(t);if(!e.paths){var n=e.paths=[],r=[];t.forEach(function(i,a){W(i)?($o(i).forEach(function(o){return n.push(r.concat(o))}),r.length=0):(r.push(i),W(t[a+1])||(n.push(r.slice(0)),r.length=0))})}return e.paths}function Ko(t,e){return t[e]}function Ot(t,e,n){return n=n||Ko,Go(e.reduce(function r(i,a){return W(i)?i.map(function(o){return r(o,a)}):i&&n(i,a)},t))}function Go(t){return Q(t)?W(t)?t.map(Go):mi(Object.keys(t).sort(),function(e){return Ot(t,e)}):t}function vi(t){return t.args!==void 0?t.args:t.field?Fn(t.field,t.variables):null}var Ed=function(){},Jo=function(t,e){return e.fieldName},Ho=function(t,e,n){var r=n.mergeObjects;return r(t,e)},Yo=function(t,e){return e},wd=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=g({dataIdFromObject:Ao},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,n){var r,i=this,a=n&&(n.typename||((r=n.storeObject)===null||r===void 0?void 0:r.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=n&&n.storeObject||e,s=g(g({},n),{typename:a,storeObject:o,readField:n&&n.readField||function(){var d=yi(arguments,o);return i.readField(d,{store:i.cache.data,variables:d.variables})}}),c,u=a&&this.getTypePolicy(a),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var f=l(g(g({},e),o),s);if(W(f))l=Wo(f);else{c=f;break}}return c=c?String(c):void 0,s.keyObject?[c,s.keyObject]:[c]},t.prototype.addTypePolicies=function(e){var n=this;Object.keys(e).forEach(function(r){var i=e[r],a=i.queryType,o=i.mutationType,s=i.subscriptionType,c=Te(i,["queryType","mutationType","subscriptionType"]);a&&n.setRootTypename("Query",r),o&&n.setRootTypename("Mutation",r),s&&n.setRootTypename("Subscription",r),X.call(n.toBeAdded,r)?n.toBeAdded[r].push(c):n.toBeAdded[r]=[c]})},t.prototype.updateTypePolicy=function(e,n){var r=this,i=this.getTypePolicy(e),a=n.keyFields,o=n.fields;function s(c,u){c.merge=typeof u=="function"?u:u===!0?Ho:u===!1?Yo:c.merge}s(i,n.merge),i.keyFn=a===!1?Ed:W(a)?Wo(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(c){var u=r.getFieldPolicy(e,c,!0),l=o[c];if(typeof l=="function")u.read=l;else{var f=l.keyArgs,d=l.read,p=l.merge;u.keyFn=f===!1?Jo:W(f)?zo(f):typeof f=="function"?f:u.keyFn,typeof d=="function"&&(u.read=d),s(u,p)}u.read&&u.merge&&(u.keyFn=u.keyFn||Jo)})},t.prototype.setRootTypename=function(e,n){n===void 0&&(n=e);var r="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[r];n!==i&&(A(!i||i===e,5,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[n]=r,this.rootTypenamesById[r]=n)},t.prototype.addPossibleTypes=function(e){var n=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(r){n.getSupertypeSet(r,!0),e[r].forEach(function(i){n.getSupertypeSet(i,!0).add(r);var a=i.match(Po);(!a||a[0]!==i)&&n.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var n=this;if(!X.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(o,s){if(o.test(e)){var c=n.supertypeMap.get(s);c&&c.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(o){var s=n.getTypePolicy(o),c=s.fields,u=Te(s,["fields"]);Object.assign(r,u),Object.assign(r.fields,c)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){n.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,n,r){if(e){var i=this.getTypePolicy(e).fields;return i[n]||r&&(i[n]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,n){var r=this.supertypeMap.get(e);return!r&&n&&this.supertypeMap.set(e,r=new Set),r},t.prototype.fragmentMatches=function(e,n,r,i){var a=this;if(!e.typeCondition)return!0;if(!n)return!1;var o=e.typeCondition.name.value;if(n===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(n,!0),c=[s],u=function(h){var y=a.getSupertypeSet(h,!1);y&&y.size&&c.indexOf(y)<0&&c.push(y)},l=!!(r&&this.fuzzySubtypes.size),f=!1,d=0;d<c.length;++d){var p=c[d];if(p.has(o))return s.has(o)||(f&&globalThis.__DEV__!==!1&&A.warn(6,n,o),s.add(o)),!0;p.forEach(u),l&&d===c.length-1&&li(e.selectionSet,r,i)&&(l=!1,f=!0,this.fuzzySubtypes.forEach(function(h,y){var m=n.match(h);m&&m[0]===n&&u(y)}))}return!1},t.prototype.hasKeyArgs=function(e,n){var r=this.getFieldPolicy(e,n,!1);return!!(r&&r.keyFn)},t.prototype.getStoreFieldName=function(e){var n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),a,o=i&&i.keyFn;if(o&&n)for(var s={typename:n,fieldName:r,field:e.field||null,variables:e.variables},c=vi(e);o;){var u=o(c,s);if(W(u))o=zo(u);else{a=u||r;break}}return a===void 0&&(a=e.field?Qc(e.field,e.variables):Aa(r,vi(e))),a===!1?r:r===Be(a)?a:r+":"+a},t.prototype.readField=function(e,n){var r=e.from;if(r){var i=e.field||e.fieldName;if(i){if(e.typename===void 0){var a=n.store.getFieldValue(r,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=Be(o),c=n.store.getFieldValue(r,o),u=this.getFieldPolicy(e.typename,s,!1),l=u&&u.read;if(l){var f=Xo(this,r,e,n,n.store.getStorage(L(r)?r.__ref:r,o));return pi.withValue(this.cache,l,[c,f])}return c}}},t.prototype.getReadFunction=function(e,n){var r=this.getFieldPolicy(e,n,!1);return r&&r.read},t.prototype.getMergeFunction=function(e,n,r){var i=this.getFieldPolicy(e,n,!1),a=i&&i.merge;return!a&&r&&(i=this.getTypePolicy(r),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,n,r,i,a){var o=r.field,s=r.typename,c=r.merge;return c===Ho?Zo(i.store)(e,n):c===Yo?n:(i.overwrite&&(e=void 0),c(e,n,Xo(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Xo(t,e,n,r,i){var a=t.getStoreFieldName(n),o=Be(a),s=n.variables||r.variables,c=r.store,u=c.toReference,l=c.canRead;return{args:vi(n),field:n.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:L,toReference:u,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(yi(arguments,e,s),r)},mergeObjects:Zo(r.store)}}function yi(t,e,n){var r=t[0],i=t[1],a=t.length,o;return typeof r=="string"?o={fieldName:r,from:a>1?i:e}:(o=g({},r),X.call(o,"from")||(o.from=e)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&A.warn(7,ra(Array.from(t))),o.variables===void 0&&(o.variables=n),o}function Zo(t){return function(e,n){if(W(e)||W(n))throw ee(8);if(Q(e)&&Q(n)){var r=t.getFieldValue(e,"__typename"),i=t.getFieldValue(n,"__typename"),a=r&&i&&r!==i;if(a)return n;if(L(e)&&wt(n))return t.merge(e.__ref,n),e;if(wt(e)&&L(n))return t.merge(e,n.__ref),n;if(wt(e)&&wt(n))return g(g({},e),n)}return n}}function gi(t,e,n){var r="".concat(e).concat(n),i=t.flavors.get(r);return i||t.flavors.set(r,i=t.clientOnly===e&&t.deferred===n?t:g(g({},t),{clientOnly:e,deferred:n})),i}var Od=function(){function t(e,n,r){this.cache=e,this.reader=n,this.fragments=r}return t.prototype.writeToStore=function(e,n){var r=this,i=n.query,a=n.result,o=n.dataId,s=n.variables,c=n.overwrite,u=Qt(i),l=pd();s=g(g({},Lr(u)),s);var f=g(g({store:e,written:Object.create(null),merge:function(p,h){return l.merge(p,h)},variables:s,varString:je(s)},Ro(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),d=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:f});if(!L(d))throw ee(11,a);return f.incomingById.forEach(function(p,h){var y=p.storeObject,m=p.mergeTree,v=p.fieldNodeSet,b=mt(h);if(m&&m.map.size){var k=r.applyMerges(m,b,y,f);if(L(k))return;y=k}if(globalThis.__DEV__!==!1&&!f.overwrite){var S=Object.create(null);v.forEach(function(O){O.selectionSet&&(S[O.name.value]=!0)});var E=function(O){return S[Be(O)]===!0},w=function(O){var F=m&&m.map.get(O);return!!(F&&F.info&&F.info.merge)};Object.keys(y).forEach(function(O){E(O)&&!w(O)&&Td(b,y,O,f.store)})}e.merge(h,y)}),e.retain(d.__ref),d},t.prototype.processSelectionSet=function(e){var n=this,r=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,c=this.cache.policies,u=Object.create(null),l=r&&c.rootTypenamesById[r]||Mr(i,a,o.fragmentMap)||r&&o.store.get(r,"__typename");typeof l=="string"&&(u.__typename=l);var f=function(){var k=yi(arguments,u,o.variables);if(L(k.from)){var S=o.incomingById.get(k.from.__ref);if(S){var E=c.readField(g(g({},k),{from:S.storeObject}),o);if(E!==void 0)return E}}return c.readField(k,o)},d=new Set;this.flattenFields(a,i,o,l).forEach(function(k,S){var E,w=Le(S),O=i[w];if(d.add(S),O!==void 0){var F=c.getStoreFieldName({typename:l,fieldName:S.name.value,field:S,variables:k.variables}),I=ts(s,F),x=n.processFieldValue(O,S,S.selectionSet?gi(k,!1,!1):k,I),q=void 0;S.selectionSet&&(L(x)||wt(x))&&(q=f("__typename",x));var K=c.getMergeFunction(l,S.name.value,q);K?I.info={field:S,typename:l,merge:K}:ns(s,F),u=k.merge(u,(E={},E[F]=x,E))}else globalThis.__DEV__!==!1&&!k.clientOnly&&!k.deferred&&!zr.added(S)&&!c.getReadFunction(l,S.name.value)&&globalThis.__DEV__!==!1&&A.error(12,Le(S),i)});try{var p=c.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:u,readField:f}),h=p[0],y=p[1];r=r||h,y&&(u=o.merge(u,y))}catch(k){if(!r)throw k}if(typeof r=="string"){var m=mt(r),v=o.written[r]||(o.written[r]=[]);if(v.indexOf(a)>=0||(v.push(a),this.reader&&this.reader.isFresh(i,m,a,o)))return m;var b=o.incomingById.get(r);return b?(b.storeObject=o.merge(b.storeObject,u),b.mergeTree=ki(b.mergeTree,s),d.forEach(function(k){return b.fieldNodeSet.add(k)})):o.incomingById.set(r,{storeObject:u,mergeTree:Vn(s)?void 0:s,fieldNodeSet:d}),m}return u},t.prototype.processFieldValue=function(e,n,r,i){var a=this;return!n.selectionSet||e===null?globalThis.__DEV__!==!1?fo(e):e:W(e)?e.map(function(o,s){var c=a.processFieldValue(o,n,r,ts(i,s));return ns(i,s),c}):this.processSelectionSet({result:e,selectionSet:n.selectionSet,context:r,mergeTree:i})},t.prototype.flattenFields=function(e,n,r,i){i===void 0&&(i=Mr(n,e,r.fragmentMap));var a=new Map,o=this.cache.policies,s=new ft(!1);return function c(u,l){var f=s.lookup(u,l.clientOnly,l.deferred);f.visited||(f.visited=!0,u.selections.forEach(function(d){if(qt(d,r.variables)){var p=l.clientOnly,h=l.deferred;if(!(p&&h)&&ke(d.directives)&&d.directives.forEach(function(v){var b=v.name.value;if(b==="client"&&(p=!0),b==="defer"){var k=Fn(v,r.variables);(!k||k.if!==!1)&&(h=!0)}}),qe(d)){var y=a.get(d);y&&(p=p&&y.clientOnly,h=h&&y.deferred),a.set(d,gi(r,p,h))}else{var m=Tn(d,r.lookupFragment);if(!m&&d.kind===T.FRAGMENT_SPREAD)throw ee(13,d.name.value);m&&o.fragmentMatches(m,i,n,r.variables)&&c(m.selectionSet,gi(r,p,h))}}}))}(e,r),a},t.prototype.applyMerges=function(e,n,r,i,a){var o,s=this;if(e.map.size&&!L(r)){var c=!W(r)&&(L(n)||wt(n))?n:void 0,u=r;c&&!a&&(a=[L(c)?c.__ref:c]);var l,f=function(d,p){return W(d)?typeof p=="number"?d[p]:void 0:i.store.getFieldValue(d,String(p))};e.map.forEach(function(d,p){var h=f(c,p),y=f(u,p);if(y!==void 0){a&&a.push(p);var m=s.applyMerges(d,h,y,i,a);m!==y&&(l=l||new Map,l.set(p,m)),a&&A(a.pop()===p)}}),l&&(r=W(u)?u.slice(0):g({},u),l.forEach(function(d,p){r[p]=d}))}return e.info?this.cache.policies.runMergeFunction(n,r,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):r},t}(),es=[];function ts(t,e){var n=t.map;return n.has(e)||n.set(e,es.pop()||{map:new Map}),n.get(e)}function ki(t,e){if(t===e||!e||Vn(e))return t;if(!t||Vn(t))return e;var n=t.info&&e.info?g(g({},t.info),e.info):t.info||e.info,r=t.map.size&&e.map.size,i=r?new Map:t.map.size?t.map:e.map,a={info:n,map:i};if(r){var o=new Set(e.map.keys());t.map.forEach(function(s,c){a.map.set(c,ki(s,e.map.get(c))),o.delete(c)}),o.forEach(function(s){a.map.set(s,ki(e.map.get(s),t.map.get(s)))})}return a}function Vn(t){return!t||!(t.info||t.map.size)}function ns(t,e){var n=t.map,r=n.get(e);r&&Vn(r)&&(es.push(r),n.delete(e))}var rs=new Set;function Td(t,e,n,r){var i=function(f){var d=r.getFieldValue(f,n);return typeof d=="object"&&d},a=i(t);if(a){var o=i(e);if(o&&!L(a)&&!B(a,o)&&!Object.keys(a).every(function(f){return r.getFieldValue(o,f)!==void 0})){var s=r.getFieldValue(t,"__typename")||r.getFieldValue(e,"__typename"),c=Be(n),u="".concat(s,".").concat(c);if(!rs.has(u)){rs.add(u);var l=[];!W(a)&&!W(o)&&[a,o].forEach(function(f){var d=r.getFieldValue(f,"__typename");typeof d=="string"&&!l.includes(d)&&l.push(d)}),globalThis.__DEV__!==!1&&A.warn(14,c,s,l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"",u,g({},a),g({},o))}}}}var is=function(t){ge(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.watches=new Set,r.addTypenameTransform=new Ya(zr),r.assumeImmutableResults=!0,r.makeVar=Nd,r.txCount=0,r.config=dd(n),r.addTypename=!!r.config.addTypename,r.policies=new wd({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return e.prototype.init=function(){var n=this.data=new Xt.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=n.stump,this.resetResultCache()},e.prototype.resetResultCache=function(n){var r=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new Od(this,this.storeReader=new yd({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Co(this.config),canon:n?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=$t(function(o,s){return r.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize||Fe["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var s=o.optimistic?r.optimisticData:r.data;if(Zt(s)){var c=o.optimistic,u=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,je({optimistic:c,id:u,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(n){return this.init(),n&&this.data.replace(n),this},e.prototype.extract=function(n){return n===void 0&&(n=!1),(n?this.optimisticData:this.data).extract()},e.prototype.read=function(n){var r=n.returnPartialData,i=r===void 0?!1:r;try{return this.storeReader.diffQueryAgainstStore(g(g({},n),{store:n.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Io)return null;throw a}},e.prototype.write=function(n){try{return++this.txCount,this.storeWriter.writeToStore(this.data,n)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(n){if(X.call(n,"id")&&!n.id)return!1;var r=n.optimistic?this.optimisticData:this.data;try{return++this.txCount,r.modify(n.id||"ROOT_QUERY",n.fields)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(n){return this.storeReader.diffQueryAgainstStore(g(g({},n),{store:n.optimistic?this.optimisticData:this.data,rootId:n.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(n){var r=this;return this.watches.size||bd(this),this.watches.add(n),n.immediate&&this.maybeBroadcastWatch(n),function(){r.watches.delete(n)&&!r.watches.size&&Bo(r),r.maybeBroadcastWatch.forget(n)}},e.prototype.gc=function(n){var r;je.reset(),xn.reset(),this.addTypenameTransform.resetCache(),(r=this.config.fragments)===null||r===void 0||r.resetCaches();var i=this.optimisticData.gc();return n&&!this.txCount&&(n.resetResultCache?this.resetResultCache(n.resetResultIdentities):n.resetResultIdentities&&this.storeReader.resetCanon()),i},e.prototype.retain=function(n,r){return(r?this.optimisticData:this.data).retain(n)},e.prototype.release=function(n,r){return(r?this.optimisticData:this.data).release(n)},e.prototype.identify=function(n){if(L(n))return n.__ref;try{return this.policies.identify(n)[0]}catch(r){globalThis.__DEV__!==!1&&A.warn(r)}},e.prototype.evict=function(n){if(!n.id){if(X.call(n,"id"))return!1;n=g(g({},n),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(n,this.data)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(n){var r=this;return this.init(),je.reset(),n&&n.discardWatches?(this.watches.forEach(function(i){return r.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Bo(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(n){var r=this.optimisticData.removeLayer(n);r!==this.optimisticData&&(this.optimisticData=r,this.broadcastWatches())},e.prototype.batch=function(n){var r=this,i=n.update,a=n.optimistic,o=a===void 0?!0:a,s=n.removeOptimistic,c=n.onWatchUpdated,u,l=function(d){var p=r,h=p.data,y=p.optimisticData;++r.txCount,d&&(r.data=r.optimisticData=d);try{return u=i(r)}finally{--r.txCount,r.data=h,r.optimisticData=y}},f=new Set;return c&&!this.txCount&&this.broadcastWatches(g(g({},n),{onWatchUpdated:function(d){return f.add(d),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),c&&f.size?(this.broadcastWatches(g(g({},n),{onWatchUpdated:function(d,p){var h=c.call(this,d,p);return h!==!1&&f.delete(d),h}})),f.size&&f.forEach(function(d){return r.maybeBroadcastWatch.dirty(d)})):this.broadcastWatches(n),u},e.prototype.performTransaction=function(n,r){return this.batch({update:n,optimistic:r||r!==null})},e.prototype.transformDocument=function(n){return this.addTypenameToDocument(this.addFragmentsToDocument(n))},e.prototype.broadcastWatches=function(n){var r=this;this.txCount||this.watches.forEach(function(i){return r.maybeBroadcastWatch(i,n)})},e.prototype.addFragmentsToDocument=function(n){var r=this.config.fragments;return r?r.transform(n):n},e.prototype.addTypenameToDocument=function(n){return this.addTypename?this.addTypenameTransform.transformDocument(n):n},e.prototype.broadcastWatch=function(n,r){var i=n.lastDiff,a=this.diff(n);r&&(n.optimistic&&typeof r.optimistic=="string"&&(a.fromOptimisticTransaction=!0),r.onWatchUpdated&&r.onWatchUpdated.call(this,n,a,i)===!1)||(!i||!B(i.result,a.result))&&n.callback(n.lastDiff=a,i)},e}(Do);globalThis.__DEV__!==!1&&(is.prototype.getMemoryInternals=Oc);var V;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(V||(V={}));function tn(t){return t?t<7:!1}var as=Object.assign,_d=Object.hasOwnProperty,bi=function(t){ge(e,t);function e(n){var r=n.queryManager,i=n.queryInfo,a=n.options,o=t.call(this,function(m){try{var v=m._subscription._observer;v&&!v.error&&(v.error=Fd)}catch{}var b=!o.observers.size;o.observers.add(m);var k=o.last;return k&&k.error?m.error&&m.error(k.error):k&&k.result&&m.next&&m.next(k.result),b&&o.reobserve().catch(function(){}),function(){o.observers.delete(m)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=r,o.waitForOwnResult=Ni(a.fetchPolicy),o.isTornDown=!1;var s=r.defaultOptions.watchQuery,c=s===void 0?{}:s,u=c.fetchPolicy,l=u===void 0?"cache-first":u,f=a.fetchPolicy,d=f===void 0?l:f,p=a.initialFetchPolicy,h=p===void 0?d==="standby"?l:d:p;o.options=g(g({},a),{initialFetchPolicy:h,fetchPolicy:d}),o.queryId=i.queryId||r.generateQueryId();var y=Qt(o.query);return o.queryName=y&&y.name&&y.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var n=this;return new Promise(function(r,i){var a={next:function(s){r(s),n.observers.delete(a),n.observers.size||n.queryManager.removeQuery(n.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=n.subscribe(a)})},e.prototype.resetDiff=function(){this.queryInfo.resetDiff()},e.prototype.getCurrentResult=function(n){n===void 0&&(n=!0);var r=this.getLastResult(!0),i=this.queryInfo.networkStatus||r&&r.networkStatus||V.ready,a=g(g({},r),{loading:tn(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(Ni(s)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(a.data=c.result),B(a.data,{})&&(a.data=void 0),c.complete?(delete a.partial,c.complete&&a.networkStatus===V.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=V.ready,a.loading=!1)):a.partial=!0,globalThis.__DEV__!==!1&&!c.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&ss(c.missing)}return n&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(n,r){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!_o(this.query,this.last.result,n,this.variables):!B(this.last.result,n);return i||r&&!B(this.last.variables,r)},e.prototype.getLast=function(n,r){var i=this.last;if(i&&i[n]&&(!r||B(i.variables,this.variables)))return i[n]},e.prototype.getLastResult=function(n){return this.getLast("result",n)},e.prototype.getLastError=function(n){return this.getLast("error",n)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(n){var r,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&n&&_d.call(n,"variables")){var o=xa(this.query),s=o.variableDefinitions;(!s||!s.some(function(c){return c.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&A.warn(20,n,((r=o.name)===null||r===void 0?void 0:r.value)||o)}return n&&!B(this.options.variables,n)&&(i.variables=this.options.variables=g(g({},this.options.variables),n)),this.queryInfo.resetLastWrite(),this.reobserve(i,V.refetch)},e.prototype.fetchMore=function(n){var r=this,i=g(g({},n.query?n:g(g(g(g({},this.options),{query:this.options.query}),n),{variables:g(g({},this.options.variables),n.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var a=this.queryManager.generateQueryId();this.lastQuery=n.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,s=o.networkStatus;o.networkStatus=V.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set;return this.queryManager.fetchQuery(a,i,V.fetchMore).then(function(u){return r.queryManager.removeQuery(a),o.networkStatus===V.fetchMore&&(o.networkStatus=s),r.queryManager.cache.batch({update:function(l){var f=n.updateQuery;f?l.updateQuery({query:r.query,variables:r.variables,returnPartialData:!0,optimistic:!1},function(d){return f(d,{fetchMoreResult:u.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:u.data})},onWatchUpdated:function(l){c.add(l.query)}}),u}).finally(function(){c.has(r.query)||os(r)})},e.prototype.subscribeToMore=function(n){var r=this,i=this.queryManager.startGraphQLSubscription({query:n.document,variables:n.variables,context:n.context}).subscribe({next:function(a){var o=n.updateQuery;o&&r.updateQuery(function(s,c){var u=c.variables;return o(s,{subscriptionData:a,variables:u})})},error:function(a){if(n.onError){n.onError(a);return}globalThis.__DEV__!==!1&&A.error(21,a)}});return this.subscriptions.add(i),function(){r.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(n){return this.reobserve(n)},e.prototype.silentSetOptions=function(n){var r=St(this.options,n||{});as(this.options,r)},e.prototype.setVariables=function(n){return B(this.variables,n)?this.observers.size?this.result():Promise.resolve():(this.options.variables=n,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:n},V.setVariables):Promise.resolve())},e.prototype.updateQuery=function(n){var r=this.queryManager,i=r.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=n(i,{variables:this.variables});a&&(r.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),r.broadcastQueries())},e.prototype.startPolling=function(n){this.options.pollInterval=n,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(n,r){if(r.nextFetchPolicy){var i=r.fetchPolicy,a=i===void 0?"cache-first":i,o=r.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof r.nextFetchPolicy=="function"?r.fetchPolicy=r.nextFetchPolicy(a,{reason:n,options:r,observable:this,initialFetchPolicy:s}):n==="variables-changed"?r.fetchPolicy=s:r.fetchPolicy=r.nextFetchPolicy)}return r.fetchPolicy},e.prototype.fetch=function(n,r,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,n,r,i)},e.prototype.updatePolling=function(){var n=this;if(!this.queryManager.ssrMode){var r=this,i=r.pollingInfo,a=r.options.pollInterval;if(!a||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){A(a,22);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){var u,l;n.pollingInfo&&(!tn(n.queryInfo.networkStatus)&&!(!((l=(u=n.options).skipPollAttempt)===null||l===void 0)&&l.call(u))?n.reobserve({fetchPolicy:n.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},V.poll).then(c,c):c())},c=function(){var u=n.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(s,u.interval))};c()}}},e.prototype.updateLastResult=function(n,r){r===void 0&&(r=this.variables);var i=this.getLastError();return i&&this.last&&!B(r,this.last.variables)&&(i=void 0),this.last=g({result:this.queryManager.assumeImmutableResults?n:fo(n),variables:r},i?{error:i}:null)},e.prototype.reobserveAsConcast=function(n,r){var i=this;this.isTornDown=!1;var a=r===V.refetch||r===V.fetchMore||r===V.poll,o=this.options.variables,s=this.options.fetchPolicy,c=St(this.options,n||{}),u=a?c:as(this.options,c),l=this.transformDocument(u.query);this.lastQuery=l,a||(this.updatePolling(),n&&n.variables&&!B(n.variables,o)&&u.fetchPolicy!=="standby"&&u.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",u),r===void 0&&(r=V.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Ni(u.fetchPolicy));var f=function(){i.concast===h&&(i.waitForOwnResult=!1)},d=u.variables&&g({},u.variables),p=this.fetch(u,r,l),h=p.concast,y=p.fromLink,m={next:function(v){B(i.variables,d)&&(f(),i.reportResult(v,d))},error:function(v){B(i.variables,d)&&(f(),i.reportError(v,d))}};return!a&&(y||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=h,this.observer=m),h.addObserver(m),h},e.prototype.reobserve=function(n,r){return this.reobserveAsConcast(n,r).promise},e.prototype.resubscribeAfterError=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=this.last;this.resetLastResults();var a=this.subscribe.apply(this,n);return this.last=i,a},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(n,r){var i=this.getLastError(),a=this.isDifferentFromLastResult(n,r);(i||!n.partial||this.options.returnPartialData)&&this.updateLastResult(n,r),(i||a)&&Jt(this.observers,"next",n)},e.prototype.reportError=function(n,r){var i=g(g({},this.getLastResult()),{error:n,errors:n.graphQLErrors,networkStatus:V.error,loading:!1});this.updateLastResult(i,r),Jt(this.observers,"error",this.last.error=n)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(n){return n.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e.prototype.transformDocument=function(n){return this.queryManager.transform(n)},e}(U);po(bi);function os(t){var e=t.options,n=e.fetchPolicy,r=e.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,a){return this.nextFetchPolicy=r,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,a):n}}):t.reobserve()}function Fd(t){globalThis.__DEV__!==!1&&A.error(23,t.message,t.stack)}function ss(t){globalThis.__DEV__!==!1&&t&&globalThis.__DEV__!==!1&&A.debug(24,t)}function Ni(t){return t==="network-only"||t==="no-cache"||t==="standby"}var us=function(){function t(e){var n=e.cache,r=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=n,r&&(this.client=r),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var n=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(r){n.resolvers=ro(n.resolvers,r)}):this.resolvers=ro(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){return Pe(this,arguments,void 0,function(n){var r=n.document,i=n.remoteResult,a=n.context,o=n.variables,s=n.onlyRunForcedResolvers,c=s===void 0?!1:s;return Re(this,function(u){return r?[2,this.resolveDocument(r,i.data,a,o,this.fragmentMatcher,c).then(function(l){return g(g({},i),{data:l.result})})]:[2,i]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return Vt(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return no(e)},t.prototype.prepareContext=function(e){var n=this.cache;return g(g({},e),{cache:n,getCacheKey:function(r){return n.identify(r)}})},t.prototype.addExportedVariables=function(e){return Pe(this,arguments,void 0,function(n,r,i){return r===void 0&&(r={}),i===void 0&&(i={}),Re(this,function(a){return n?[2,this.resolveDocument(n,this.buildRootValueFromCache(n,r)||{},this.prepareContext(i),r).then(function(o){return g(g({},r),o.exportedVariables)})]:[2,g({},r)]})})},t.prototype.shouldForceResolvers=function(e){var n=!1;return _e(e,{Directive:{enter:function(r){if(r.name.value==="client"&&r.arguments&&(n=r.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),n))return Ir}}}),n},t.prototype.buildRootValueFromCache=function(e,n){return this.cache.diff({query:dl(e),variables:n,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,n){return Pe(this,arguments,void 0,function(r,i,a,o,s,c){var u,l,f,d,p,h,y,m,v,b,k;return a===void 0&&(a={}),o===void 0&&(o={}),s===void 0&&(s=function(){return!0}),c===void 0&&(c=!1),Re(this,function(S){return u=Wt(r),l=Dn(r),f=On(l),d=this.collectSelectionsToResolve(u,f),p=u.operation,h=p?p.charAt(0).toUpperCase()+p.slice(1):"Query",y=this,m=y.cache,v=y.client,b={fragmentMap:f,context:g(g({},a),{cache:m,client:v}),variables:o,fragmentMatcher:s,defaultOperationType:h,exportedVariables:{},selectionsToResolve:d,onlyRunForcedResolvers:c},k=!1,[2,this.resolveSelectionSet(u.selectionSet,k,i,b).then(function(E){return{result:E,exportedVariables:b.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,n,r,i){return Pe(this,void 0,void 0,function(){var a,o,s,c,u,l=this;return Re(this,function(f){return a=i.fragmentMap,o=i.context,s=i.variables,c=[r],u=function(d){return Pe(l,void 0,void 0,function(){var p,h;return Re(this,function(y){return!n&&!i.selectionsToResolve.has(d)?[2]:qt(d,s)?qe(d)?[2,this.resolveField(d,n,r,i).then(function(m){var v;typeof m<"u"&&c.push((v={},v[Le(d)]=m,v))})]:(zc(d)?p=d:(p=a[d.name.value],A(p,18,d.name.value)),p&&p.typeCondition&&(h=p.typeCondition.name.value,i.fragmentMatcher(r,h,o))?[2,this.resolveSelectionSet(p.selectionSet,n,r,i).then(function(m){c.push(m)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return Cn(c)})]})})},t.prototype.resolveField=function(e,n,r,i){return Pe(this,void 0,void 0,function(){var a,o,s,c,u,l,f,d,p,h=this;return Re(this,function(y){return r?(a=i.variables,o=e.name.value,s=Le(e),c=o!==s,u=r[s]||r[o],l=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(f=r.__typename||i.defaultOperationType,d=this.resolvers&&this.resolvers[f],d&&(p=d[c?o:s],p&&(l=Promise.resolve(pi.withValue(this.cache,p,[r,Fn(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(m){var v,b;if(m===void 0&&(m=u),e.directives&&e.directives.forEach(function(S){S.name.value==="export"&&S.arguments&&S.arguments.forEach(function(E){E.name.value==="as"&&E.value.kind==="StringValue"&&(i.exportedVariables[E.value.value]=m)})}),!e.selectionSet||m==null)return m;var k=(b=(v=e.directives)===null||v===void 0?void 0:v.some(function(S){return S.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(m))return h.resolveSubSelectedArray(e,n||k,m,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,n||k,m,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,n,r,i){var a=this;return Promise.all(r.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,n,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,n,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,n){var r=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),_e(o,{Directive:function(c,u,l,f,d){c.name.value==="client"&&d.forEach(function(p){r(p)&&Na(p)&&s.add(p)})},FragmentSpread:function(c,u,l,f,d){var p=n[c.name.value];A(p,19,c.name.value);var h=a(p);h.size>0&&(d.forEach(function(y){r(y)&&Na(y)&&s.add(y)}),s.add(c),h.forEach(function(y){s.add(y)}))}})}return i.get(o)}return a(e)},t}(),Tt=new(pt?WeakMap:Map);function Si(t,e){var n=t[e];typeof n=="function"&&(t[e]=function(){return Tt.set(t,(Tt.get(t)+1)%1e15),n.apply(this,arguments)})}function cs(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Ei=function(){function t(e,n){n===void 0&&(n=e.generateQueryId()),this.queryId=n,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;Tt.has(r)||(Tt.set(r,0),Si(r,"evict"),Si(r,"modify"),Si(r,"reset"))}return t.prototype.init=function(e){var n=e.networkStatus||V.loading;return this.variables&&this.networkStatus!==V.loading&&!B(this.variables,e.variables)&&(n=V.setVariables),B(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:n}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){cs(this),this.dirty=!1},t.prototype.resetDiff=function(){this.lastDiff=void 0},t.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&B(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var r=this.cache.diff(e);return this.updateLastDiff(r,e),r},t.prototype.updateLastDiff=function(e,n){this.lastDiff=e?{diff:e,options:n||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var n;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(n=this.observableQuery)===null||n===void 0?void 0:n.options.canonizeResults}},t.prototype.setDiff=function(e){var n=this,r,i=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&!((r=this.observableQuery)===null||r===void 0)&&r.getLastError()||(this.updateLastDiff(e),!this.dirty&&!B(i&&i.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return n.notify()},0))))},t.prototype.setObservableQuery=function(e){var n=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var r=n.getDiff();r.fromOptimisticTransaction?e.observe():os(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;cs(this),this.shouldNotify()&&this.listeners.forEach(function(n){return n(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(tn(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel;var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var n=this;e===void 0&&(e=this.variables);var r=this.observableQuery;if(!(r&&r.options.fetchPolicy==="no-cache")){var i=g(g({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return n.setDiff(a)}});(!this.lastWatch||!B(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,n){var r=this.lastWrite;return!(r&&r.dmCount===Tt.get(this.cache)&&B(n,r.variables)&&B(e.data,r.result.data))},t.prototype.markResult=function(e,n,r,i){var a=this,o=new Ue,s=ke(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&ke(e.incremental)){var c=mo(this.getDiff().result,e);e.data=c}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=s,r.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):i!==0&&(wi(e,r.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,r.variables))l.writeQuery({query:n,data:e.data,variables:r.variables,overwrite:i===1}),a.lastWrite={result:e,variables:r.variables,dmCount:Tt.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var f=a.getDiffOptions(r.variables),d=l.diff(f);!a.stopped&&B(a.variables,r.variables)&&a.updateWatch(r.variables),a.updateLastDiff(d,f),d.complete&&(e.data=d.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=V.ready},t.prototype.markError=function(e){return this.networkStatus=V.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function wi(t,e){e===void 0&&(e="none");var n=e==="ignore"||e==="all",r=!Mn(t);return!r&&n&&t.data&&(r=!0),r}var Dd=Object.prototype.hasOwnProperty,ls=Object.create(null),Id=function(){function t(e){var n=e.cache,r=e.link,i=e.defaultOptions,a=e.documentTransform,o=e.queryDeduplication,s=o===void 0?!1:o,c=e.onBroadcast,u=e.ssrMode,l=u===void 0?!1:u,f=e.clientAwareness,d=f===void 0?{}:f,p=e.localState,h=e.assumeImmutableResults,y=h===void 0?!!n.assumeImmutableResults:h,m=e.defaultContext,v=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new Ta(Fe["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new ft(!1);var b=new Ya(function(k){return v.cache.transformDocument(k)},{cache:!1});this.cache=n,this.link=r,this.defaultOptions=i||Object.create(null),this.queryDeduplication=s,this.clientAwareness=d,this.localState=p||new us({cache:n}),this.ssrMode=l,this.assumeImmutableResults=y,this.documentTransform=a?b.concat(a).concat(b):b,this.defaultContext=m||Object.create(null),(this.onBroadcast=c)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(n,r){e.stopQueryNoBroadcast(r)}),this.cancelPendingFetches(ee(25))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(n){return n(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){return Pe(this,arguments,void 0,function(n){var r,i,a,o,s,c,u,l=n.mutation,f=n.variables,d=n.optimisticResponse,p=n.updateQueries,h=n.refetchQueries,y=h===void 0?[]:h,m=n.awaitRefetchQueries,v=m===void 0?!1:m,b=n.update,k=n.onQueryUpdated,S=n.fetchPolicy,E=S===void 0?((c=this.defaultOptions.mutate)===null||c===void 0?void 0:c.fetchPolicy)||"network-only":S,w=n.errorPolicy,O=w===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":w,F=n.keepRootFields,I=n.context;return Re(this,function(x){switch(x.label){case 0:return A(l,26),A(E==="network-only"||E==="no-cache",27),r=this.generateMutationId(),l=this.cache.transformForLink(this.transform(l)),i=this.getDocumentInfo(l).hasClientExports,f=this.getVariables(l,f),i?[4,this.localState.addExportedVariables(l,f,I)]:[3,2];case 1:f=x.sent(),x.label=2;case 2:return a=this.mutationStore&&(this.mutationStore[r]={mutation:l,variables:f,loading:!0,error:null}),o=d&&this.markMutationOptimistic(d,{mutationId:r,document:l,variables:f,fetchPolicy:E,errorPolicy:O,context:I,updateQueries:p,update:b,keepRootFields:F}),this.broadcastQueries(),s=this,[2,new Promise(function(q,K){return ti(s.getObservableFromLink(l,g(g({},I),{optimisticResponse:o?d:void 0}),f,!1),function(M){if(Mn(M)&&O==="none")throw new Et({graphQLErrors:ni(M)});a&&(a.loading=!1,a.error=null);var $=g({},M);return typeof y=="function"&&(y=y($)),O==="ignore"&&Mn($)&&delete $.errors,s.markMutationResult({mutationId:r,result:$,document:l,variables:f,fetchPolicy:E,errorPolicy:O,context:I,update:b,updateQueries:p,awaitRefetchQueries:v,refetchQueries:y,removeOptimistic:o?r:void 0,onQueryUpdated:k,keepRootFields:F})}).subscribe({next:function(M){s.broadcastQueries(),(!("hasNext"in M)||M.hasNext===!1)&&q(M)},error:function(M){a&&(a.loading=!1,a.error=M),o&&s.cache.removeOptimistic(r),s.broadcastQueries(),K(M instanceof Et?M:new Et({networkError:M}))}})})]}})})},t.prototype.markMutationResult=function(e,n){var r=this;n===void 0&&(n=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&wi(i,e.errorPolicy)){if(Nt(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Nt(i)&&ke(i.incremental)){var s=n.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=mo(s.result,i)),typeof c<"u"&&(i.data=c,a.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(f,d){var p=f.observableQuery,h=p&&p.queryName;if(!(!h||!Dd.call(u,h))){var y=u[h],m=r.queries.get(d),v=m.document,b=m.variables,k=n.diff({query:v,variables:b,returnPartialData:!0,optimistic:!1}),S=k.result,E=k.complete;if(E&&S){var w=y(S,{mutationResult:i,queryName:v&&jr(v)||void 0,queryVariables:b});w&&a.push({result:w,dataId:"ROOT_QUERY",query:v,variables:b})}}})}if(a.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(f){o||a.forEach(function(y){return f.write(y)});var d=e.update,p=!Tl(i)||Nt(i)&&!i.hasNext;if(d){if(!o){var h=f.diff({id:"ROOT_MUTATION",query:r.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=g(g({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}p&&d(f,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&f.modify({id:"ROOT_MUTATION",fields:function(y,m){var v=m.fieldName,b=m.DELETE;return v==="__typename"?y:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(f){return l.push(f)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,n){var r=this,i=typeof e=="function"?e(n.variables,{IGNORE:ls}):e;return i===ls?!1:(this.cache.recordOptimisticTransaction(function(a){try{r.markMutationResult(g(g({},n),{result:{data:i}}),a)}catch(o){globalThis.__DEV__!==!1&&A.error(o)}},n.mutationId),!0)},t.prototype.fetchQuery=function(e,n,r){return this.fetchConcastWithInfo(e,n,r).concast.promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(n,r){e[r]={variables:n.variables,networkStatus:n.networkStatus,networkError:n.networkError,graphQLErrors:n.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var n=this.queries.get(e);n&&(n.networkError=void 0,n.graphQLErrors=[])},t.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},t.prototype.getDocumentInfo=function(e){var n=this.transformCache;if(!n.has(e)){var r={hasClientExports:uc(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:Vt(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:to([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:Lr(Qt(e)),asQuery:g(g({},e),{definitions:e.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?g(g({},i),{operation:"query"}):i})})};n.set(e,r)}return n.get(e)},t.prototype.getVariables=function(e,n){return g(g({},this.getDocumentInfo(e).defaultVars),n)},t.prototype.watchQuery=function(e){var n=this.transform(e.query);e=g(g({},e),{variables:this.getVariables(n,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Ei(this),i=new bi({queryManager:this,queryInfo:r,options:e});return i.lastQuery=n,this.queries.set(i.queryId,r),r.init({document:n,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(e,n){var r=this;return n===void 0&&(n=this.generateQueryId()),A(e.query,28),A(e.query.kind==="Document",29),A(!e.returnPartialData,30),A(!e.pollInterval,31),this.fetchQuery(n,g(g({},e),{query:this.transform(e.query)})).finally(function(){return r.stopQuery(n)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var n=this.queries.get(e);n&&n.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(ee(32)),this.queries.forEach(function(n){n.observableQuery?n.networkStatus=V.loading:n.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var n=this;e===void 0&&(e="active");var r=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):Cc(o)?i.set(n.transform(o),!1):Q(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var c=o.observableQuery,u=o.document;if(c){if(e==="all"){r.set(s,c);return}var l=c.queryName,f=c.options.fetchPolicy;if(f==="standby"||e==="active"&&!c.hasObservers())return;(e==="active"||l&&i.has(l)||u&&i.has(u))&&(r.set(s,c),l&&i.set(l,!0),u&&i.set(u,!0))}}),a.size&&a.forEach(function(o){var s=Nr("legacyOneTimeQuery"),c=n.getQuery(s).init({document:o.query,variables:o.variables}),u=new bi({queryManager:n,queryInfo:c,options:g(g({},o),{fetchPolicy:"network-only"})});A(u.queryId===s),c.setObservableQuery(u),r.set(s,u)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,s){o||globalThis.__DEV__!==!1&&A.warn(typeof s=="string"?33:34,s)}),r},t.prototype.reFetchObservableQueries=function(e){var n=this;e===void 0&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&r.push(i.refetch()),n.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(r)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var n=this,r=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=a===void 0?"none":a,s=e.variables,c=e.context,u=c===void 0?{}:c;r=this.transform(r),s=this.getVariables(r,s);var l=function(d){return n.getObservableFromLink(r,u,d).map(function(p){i!=="no-cache"&&(wi(p,o)&&n.cache.write({query:r,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),n.broadcastQueries());var h=Mn(p),y=Bl(p);if(h||y){var m={};if(h&&(m.graphQLErrors=p.errors),y&&(m.protocolErrors=p.extensions[oi]),o==="none"||y)throw new Et(m)}return o==="ignore"&&delete p.errors,p})};if(this.getDocumentInfo(r).hasClientExports){var f=this.localState.addExportedVariables(r,s,u).then(l);return new U(function(d){var p=null;return f.then(function(h){return p=h.subscribe(d)},d.error),function(){return p&&p.unsubscribe()}})}return l(s)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,n,r,i){var a=this,o;i===void 0&&(i=(o=n==null?void 0:n.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,c=this.getDocumentInfo(e),u=c.serverQuery,l=c.clientQuery;if(u){var f=this,d=f.inFlightLinkObservables,p=f.link,h={query:u,variables:r,operationName:jr(u)||void 0,context:this.prepareContext(g(g({},n),{forceFetch:!i}))};if(n=h.context,i){var y=xn(u),m=je(r),v=d.lookup(y,m);if(s=v.observable,!s){var b=new bt([ai(p,h)]);s=v.observable=b,b.beforeNext(function(){d.remove(y,m)})}}else s=new bt([ai(p,h)])}else s=new bt([U.of({data:{}})]),n=this.prepareContext(n);return l&&(s=ti(s,function(k){return a.localState.runResolvers({document:l,remoteResult:k,context:n,variables:r})})),s},t.prototype.getResultsFromLink=function(e,n,r){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(r.query);return ti(this.getObservableFromLink(a,r.context,r.variables),function(o){var s=ni(o),c=s.length>0;if(i>=e.lastRequestId){if(c&&r.errorPolicy==="none")throw e.markError(new Et({graphQLErrors:s}));e.markResult(o,a,r,n),e.markReady()}var u={data:o.data,loading:!1,networkStatus:V.ready};return c&&r.errorPolicy!=="ignore"&&(u.errors=s,u.networkStatus=V.error),u},function(o){var s=Ql(o)?o:new Et({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchConcastWithInfo=function(e,n,r,i){var a=this;r===void 0&&(r=V.loading),i===void 0&&(i=n.query);var o=this.getVariables(i,n.variables),s=this.getQuery(e),c=this.defaultOptions.watchQuery,u=n.fetchPolicy,l=u===void 0?c&&c.fetchPolicy||"cache-first":u,f=n.errorPolicy,d=f===void 0?c&&c.errorPolicy||"none":f,p=n.returnPartialData,h=p===void 0?!1:p,y=n.notifyOnNetworkStatusChange,m=y===void 0?!1:y,v=n.context,b=v===void 0?{}:v,k=Object.assign({},n,{query:i,variables:o,fetchPolicy:l,errorPolicy:d,returnPartialData:h,notifyOnNetworkStatusChange:m,context:b}),S=function(I){k.variables=I;var x=a.fetchQueryByPolicy(s,k,r);return k.fetchPolicy!=="standby"&&x.sources.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",n),x},E=function(){return a.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(I){E(),setTimeout(function(){return w.cancel(I)})});var w,O;if(this.getDocumentInfo(k.query).hasClientExports)w=new bt(this.localState.addExportedVariables(k.query,k.variables,k.context).then(S).then(function(I){return I.sources})),O=!0;else{var F=S(k.variables);O=F.fromLink,w=new bt(F.sources)}return w.promise.then(E,E),{concast:w,fromLink:O}},t.prototype.refetchQueries=function(e){var n=this,r=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,c=s===void 0?o?Nr("refetchQueries"):void 0:s,u=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(d,p){l.set(p,{oq:d,lastDiff:n.getQuery(p).getDiff()})});var f=new Map;return r&&this.cache.batch({update:r,optimistic:o&&c||!1,removeOptimistic:c,onWatchUpdated:function(d,p,h){var y=d.watcher instanceof Ei&&d.watcher.observableQuery;if(y){if(u){l.delete(y.queryId);var m=u(y,p,h);return m===!0&&(m=y.refetch()),m!==!1&&f.set(y,m),m}u!==null&&l.set(y.queryId,{oq:y,lastDiff:h,diff:p})}}}),l.size&&l.forEach(function(d,p){var h=d.oq,y=d.lastDiff,m=d.diff,v;if(u){if(!m){var b=h.queryInfo;b.reset(),m=b.getDiff()}v=u(h,m,y)}(!u||v===!0)&&(v=h.refetch()),v!==!1&&f.set(h,v),p.indexOf("legacyOneTimeQuery")>=0&&n.stopQueryNoBroadcast(p)}),c&&this.cache.removeOptimistic(c),f},t.prototype.fetchQueryByPolicy=function(e,n,r){var i=this,a=n.query,o=n.variables,s=n.fetchPolicy,c=n.refetchWritePolicy,u=n.errorPolicy,l=n.returnPartialData,f=n.context,d=n.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:a,variables:o,networkStatus:r});var h=function(){return e.getDiff()},y=function(S,E){E===void 0&&(E=e.networkStatus||V.loading);var w=S.result;globalThis.__DEV__!==!1&&!l&&!B(w,{})&&ss(S.missing);var O=function(F){return U.of(g({data:F,loading:tn(E),networkStatus:E},S.complete?null:{partial:!0}))};return w&&i.getDocumentInfo(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:w},context:f,variables:o,onlyRunForcedResolvers:!0}).then(function(F){return O(F.data||void 0)}):u==="none"&&E===V.refetch&&Array.isArray(S.missing)?O(void 0):O(w)},m=s==="no-cache"?0:r===V.refetch&&c!=="merge"?1:2,v=function(){return i.getResultsFromLink(e,m,{query:a,variables:o,context:f,fetchPolicy:s,errorPolicy:u})},b=d&&typeof p=="number"&&p!==r&&tn(r);switch(s){default:case"cache-first":{var k=h();return k.complete?{fromLink:!1,sources:[y(k,e.markReady())]}:l||b?{fromLink:!0,sources:[y(k),v()]}:{fromLink:!0,sources:[v()]}}case"cache-and-network":{var k=h();return k.complete||l||b?{fromLink:!0,sources:[y(k),v()]}:{fromLink:!0,sources:[v()]}}case"cache-only":return{fromLink:!1,sources:[y(h(),e.markReady())]};case"network-only":return b?{fromLink:!0,sources:[y(h()),v()]}:{fromLink:!0,sources:[v()]};case"no-cache":return b?{fromLink:!0,sources:[y(e.getDiff()),v()]}:{fromLink:!0,sources:[v()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Ei(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var n=this.localState.prepareContext(e);return g(g(g({},this.defaultContext),n),{clientAwareness:this.clientAwareness})},t}(),ds=!1,fs=function(){function t(e){var n=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw ee(15);var r=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.documentTransform,c=e.ssrMode,u=c===void 0?!1:c,l=e.ssrForceFetchDelay,f=l===void 0?0:l,d=e.connectToDevTools,p=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&globalThis.__DEV__!==!1:d,h=e.queryDeduplication,y=h===void 0?!0:h,m=e.defaultOptions,v=e.defaultContext,b=e.assumeImmutableResults,k=b===void 0?o.assumeImmutableResults:b,S=e.resolvers,E=e.typeDefs,w=e.fragmentMatcher,O=e.name,F=e.version,I=e.link;I||(I=r?new So({uri:r,credentials:i,headers:a}):nt.empty()),this.link=I,this.cache=o,this.disableNetworkFetches=u||f>0,this.queryDeduplication=y,this.defaultOptions=m||Object.create(null),this.typeDefs=E,f&&setTimeout(function(){return n.disableNetworkFetches=!1},f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=kr,this.localState=new us({cache:o,client:this,resolvers:S,fragmentMatcher:w}),this.queryManager=new Id({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:v,documentTransform:s,queryDeduplication:y,ssrMode:u,clientAwareness:{name:O,version:F},localState:this.localState,assumeImmutableResults:k,onBroadcast:p?function(){n.devToolsHookCb&&n.devToolsHookCb({action:{},state:{queries:n.queryManager.getQueryStore(),mutations:n.queryManager.mutationStore||{}},dataWithOptimisticResults:n.cache.extract(!0)})}:void 0}),p&&this.connectToDevTools()}return t.prototype.connectToDevTools=function(){if(typeof window=="object"){var e=window,n=Symbol.for("apollo.devtools");(e[n]=e[n]||[]).push(this),e.__APOLLO_CLIENT__=this}!ds&&globalThis.__DEV__!==!1&&(ds=!0,setTimeout(function(){if(typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__&&/^(https?|file):$/.test(window.location.protocol)){var r=window.navigator,i=r&&r.userAgent,a=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?a="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(a="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),a&&globalThis.__DEV__!==!1&&A.log("Download the Apollo DevTools for a better development experience: %s",a)}},1e4))},Object.defineProperty(t.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=ri(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=g(g({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=ri(this.defaultOptions.query,e)),A(e.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=g(g({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=ri(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,n){return n===void 0&&(n=!1),this.cache.readQuery(e,n)},t.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!1),this.cache.readFragment(e,n)},t.prototype.writeQuery=function(e){var n=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.writeFragment=function(e){var n=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return ai(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(n){return n()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(n){return n()}))})},t.prototype.onResetStore=function(e){var n=this;return this.resetStoreCallbacks.push(e),function(){n.resetStoreCallbacks=n.resetStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.onClearStore=function(e){var n=this;return this.clearStoreCallbacks.push(e),function(){n.clearStoreCallbacks=n.clearStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var n=this.queryManager.refetchQueries(e),r=[],i=[];n.forEach(function(o,s){r.push(s),i.push(o)});var a=Promise.all(i);return a.queries=r,a.results=i,a.catch(function(o){globalThis.__DEV__!==!1&&A.debug(17,o)}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(t.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),t}();globalThis.__DEV__!==!1&&(fs.prototype.getMemoryInternals=wc);var Un=new Map,Oi=new Map,ps=!0,Bn=!1;function hs(t){return t.replace(/[\s,]+/g," ").trim()}function Ad(t){return hs(t.source.body.substring(t.start,t.end))}function xd(t){var e=new Set,n=[];return t.definitions.forEach(function(r){if(r.kind==="FragmentDefinition"){var i=r.name.value,a=Ad(r.loc),o=Oi.get(i);o&&!o.has(a)?ps&&console.warn("Warning: fragment with name "+i+` already exists.
56
- graphql-tag enforces all fragment names across your application to be unique; read more about
57
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Oi.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),n.push(r))}else n.push(r)}),g(g({},t),{definitions:n})}function Cd(t){var e=new Set(t.definitions);e.forEach(function(r){r.loc&&delete r.loc,Object.keys(r).forEach(function(i){var a=r[i];a&&typeof a=="object"&&e.add(a)})});var n=t.loc;return n&&(delete n.startToken,delete n.endToken),t}function Pd(t){var e=hs(t);if(!Un.has(e)){var n=Xu(t,{experimentalFragmentVariables:Bn,allowLegacyFragmentVariables:Bn});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");Un.set(e,Cd(xd(n)))}return Un.get(e)}function _t(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];typeof t=="string"&&(t=[t]);var r=t[0];return e.forEach(function(i,a){i&&i.kind==="Document"?r+=i.loc.source.body:r+=i,r+=t[a+1]}),Pd(r)}function Rd(){Un.clear(),Oi.clear()}function Md(){ps=!1}function jd(){Bn=!0}function Ld(){Bn=!1}var nn={gql:_t,resetCaches:Rd,disableFragmentWarnings:Md,enableExperimentalFragmentVariables:jd,disableExperimentalFragmentVariables:Ld};(function(t){t.gql=nn.gql,t.resetCaches=nn.resetCaches,t.disableFragmentWarnings=nn.disableFragmentWarnings,t.enableExperimentalFragmentVariables=nn.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=nn.disableExperimentalFragmentVariables})(_t||(_t={})),_t.default=_t;function qd(t){return new nt(function(e,n){var r=Te(e,[]);return new U(function(i){var a,o=!1;return Promise.resolve(r).then(function(s){return t(s,e.getContext())}).then(e.setContext).then(function(){o||(a=n(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){o=!0,a&&a.unsubscribe()}})})}const ms=(t={})=>{const e={};return Object.keys(t).forEach(n=>{if(n.startsWith("_")){e[n.substring(1)]=t[n];return}e.data={[n]:t[n],...e.data}}),e};class Vd{constructor(e){Ce(this,"options"),Ce(this,"callback"),this.options={},this.callback=e}limit(e){return this.options.limit=e,this}filter(e){return this.options.filter=ms(e),this}order(e){return this.options.order=e,this}language(e){return this.options.language=e,this}fields(e){return this.options.fields=e,this}include(e){return this.options.include=e,this}exclude(e){return this.options.exclude=e,this}preview(e=!0){return this.options.preview=e,this}all(e){return this.options={...this.options,...e,returnType:"all"},this.callback(this.options)}async one(e){this.options={...this.options,...e,returnType:"one"};const n=await this.callback(this.options);return Array.isArray(n)?n[0]:null}}const Ud="@dashx/browser",Bd="dashx-browser",Qd="0.2.0",Wd="DashX SDK for Browser",zd=["dist"],$d="./dist/index.umd.js",Kd="./dist/index.es.js",Gd="./dist/index.es.d.ts",Jd={".":{import:"./dist/index.es.js",require:"./dist/index.umd.c.jsjs",types:"./dist/index.es.d.ts"}},Hd={dev:"vite",build:"tsc && vite build",preview:"vite preview",codegen:"graphql-codegen && eslint --fix ./src/generated",lint:"eslint .","lint:fix":"eslint . --fix"},Yd={type:"git",url:"git+https://github.com/dashxhq/dashx-browser"},Xd=["dashx"],Zd="MIT",ef={"@apollo/client":"^3.10.4","@graphql-typed-document-node/core":"^3.2.0",graphql:"^16.8.1","uuid-random":"^1.3.2"},tf={"@graphql-codegen/add":"^5.0.2","@graphql-codegen/cli":"^5.0.2","@graphql-codegen/typed-document-node":"^5.0.7","@types/node":"^20.12.12","@typescript-eslint/eslint-plugin":"^7.10.0","@typescript-eslint/parser":"^7.10.0",dotenv:"^16.4.5",eslint:"^8.2.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-airbnb-typescript":"^18.0.0","eslint-plugin-import":"^2.29.1","graphql-codegen-typescript-operation-types":"^2.0.1",typescript:"^5.4.5",vite:"^5.2.0","vite-plugin-dts":"^3.9.1"},vs={name:Ud,title:Bd,version:Qd,description:Wd,files:zd,main:$d,module:Kd,types:Gd,exports:Jd,scripts:Hd,repository:Yd,keywords:Xd,license:Zd,dependencies:ef,devDependencies:tf};function nf(){return{density:window.devicePixelRatio,height:window.screen.height,width:window.screen.width}}function rf(){return{name:vs.name,version:vs.version}}function af(){return navigator.language}function of(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function sf(){return navigator.userAgent}function uf(){return"NA"}function cf(){return{ipV4:uf(),userAgent:sf(),screen:nf(),library:rf(),locale:af(),timeZone:of()}}const Ti="dashx-sdk";function _i(t){const e=window.localStorage.getItem(Ti);return e?JSON.parse(e)[t]:null}function Fi(t,e){const n=window.localStorage.getItem(Ti),r=n?JSON.parse(n):{};r[t]=e,window.localStorage.setItem(Ti,JSON.stringify(r))}const lf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AddContent"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AddContentInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"addContent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ContentFragment"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ContentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CustomContent"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"position"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}}]},df={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AddItemToCart"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AddItemToCartInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"addItemToCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CartFragment"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ItemFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Item"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"pricings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"amount"}},{kind:"Field",name:{kind:"Name",value:"originalAmount"}},{kind:"Field",name:{kind:"Name",value:"isRecurring"}},{kind:"Field",name:{kind:"Name",value:"recurringInterval"}},{kind:"Field",name:{kind:"Name",value:"recurringIntervalUnit"}},{kind:"Field",name:{kind:"Name",value:"appleProductIdentifier"}},{kind:"Field",name:{kind:"Name",value:"googleProductIdentifier"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"CartFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Order"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"subtotal"}},{kind:"Field",name:{kind:"Name",value:"discount"}},{kind:"Field",name:{kind:"Name",value:"tax"}},{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"gatewayMeta"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"orderItems"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"quantity"}},{kind:"Field",name:{kind:"Name",value:"unitPrice"}},{kind:"Field",name:{kind:"Name",value:"subtotal"}},{kind:"Field",name:{kind:"Name",value:"discount"}},{kind:"Field",name:{kind:"Name",value:"tax"}},{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"custom"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"item"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ItemFragment"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"couponRedemptions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"coupon"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"discountType"}},{kind:"Field",name:{kind:"Name",value:"discountAmount"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"expiresAt"}}]}}]}}]}}]},ff={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ApplyCouponToCart"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ApplyCouponToCartInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"applyCouponToCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CartFragment"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ItemFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Item"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"pricings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"amount"}},{kind:"Field",name:{kind:"Name",value:"originalAmount"}},{kind:"Field",name:{kind:"Name",value:"isRecurring"}},{kind:"Field",name:{kind:"Name",value:"recurringInterval"}},{kind:"Field",name:{kind:"Name",value:"recurringIntervalUnit"}},{kind:"Field",name:{kind:"Name",value:"appleProductIdentifier"}},{kind:"Field",name:{kind:"Name",value:"googleProductIdentifier"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"CartFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Order"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"subtotal"}},{kind:"Field",name:{kind:"Name",value:"discount"}},{kind:"Field",name:{kind:"Name",value:"tax"}},{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"gatewayMeta"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"orderItems"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"quantity"}},{kind:"Field",name:{kind:"Name",value:"unitPrice"}},{kind:"Field",name:{kind:"Name",value:"subtotal"}},{kind:"Field",name:{kind:"Name",value:"discount"}},{kind:"Field",name:{kind:"Name",value:"tax"}},{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"custom"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"item"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ItemFragment"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"couponRedemptions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"coupon"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"discountType"}},{kind:"Field",name:{kind:"Name",value:"discountAmount"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"expiresAt"}}]}}]}}]}}]},pf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"Asset"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UUID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"asset"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"AssetFragment"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"AssetFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Asset"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"attributeId"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"mimeType"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"processingStatus"}},{kind:"Field",name:{kind:"Name",value:"resourceId"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"storageProviderId"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"uploadStatus"}},{kind:"Field",name:{kind:"Name",value:"uploaderId"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"workspaceId"}}]}}]},hf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"EditContent"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"EditContentInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"editContent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ContentFragment"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ContentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CustomContent"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"position"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}}]},mf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FetchCart"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FetchCartInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fetchCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CartFragment"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ItemFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Item"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"pricings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"amount"}},{kind:"Field",name:{kind:"Name",value:"originalAmount"}},{kind:"Field",name:{kind:"Name",value:"isRecurring"}},{kind:"Field",name:{kind:"Name",value:"recurringInterval"}},{kind:"Field",name:{kind:"Name",value:"recurringIntervalUnit"}},{kind:"Field",name:{kind:"Name",value:"appleProductIdentifier"}},{kind:"Field",name:{kind:"Name",value:"googleProductIdentifier"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"CartFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Order"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"subtotal"}},{kind:"Field",name:{kind:"Name",value:"discount"}},{kind:"Field",name:{kind:"Name",value:"tax"}},{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"gatewayMeta"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"orderItems"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"quantity"}},{kind:"Field",name:{kind:"Name",value:"unitPrice"}},{kind:"Field",name:{kind:"Name",value:"subtotal"}},{kind:"Field",name:{kind:"Name",value:"discount"}},{kind:"Field",name:{kind:"Name",value:"tax"}},{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"custom"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"item"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ItemFragment"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"couponRedemptions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"coupon"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"discountType"}},{kind:"Field",name:{kind:"Name",value:"discountAmount"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"expiresAt"}}]}}]}}]}}]},vf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FetchContacts"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FetchContactsInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fetchContacts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contacts"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ContactFragment"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ContactFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Contact"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"accountId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"value"}},{kind:"Field",name:{kind:"Name",value:"unverifiedValue"}},{kind:"Field",name:{kind:"Name",value:"verifiedAt"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"tag"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}}]},yf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FetchContent"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FetchContentInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fetchContent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}]}]}}]},Qn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FetchInAppNotifications"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FetchInAppNotificationsInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"notifications"},name:{kind:"Name",value:"fetchInAppNotifications"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"sentAt"}},{kind:"Field",name:{kind:"Name",value:"readAt"}},{kind:"Field",name:{kind:"Name",value:"renderedContent"}}]}}]}}]},Ft={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FetchInAppNotificationsAggregate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FetchInAppNotificationsAggregateInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"notificationsAggregate"},name:{kind:"Name",value:"fetchInAppNotificationsAggregate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"count"}}]}}]}}]},gf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FetchStoredPreferences"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FetchStoredPreferencesInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fetchStoredPreferences"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"preferenceData"}}]}}]}}]},kf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"IdentifyAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"IdentifyAccountInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifyAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},bf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"prepareAsset"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PrepareAssetInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"prepareAsset"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"AssetFragment"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"AssetFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Asset"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"attributeId"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"mimeType"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"processingStatus"}},{kind:"Field",name:{kind:"Name",value:"resourceId"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"storageProviderId"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"uploadStatus"}},{kind:"Field",name:{kind:"Name",value:"uploaderId"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"workspaceId"}}]}}]},Nf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RemoveCouponFromCart"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"RemoveCouponFromCartInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"removeCouponFromCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CartFragment"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ItemFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Item"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"pricings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"amount"}},{kind:"Field",name:{kind:"Name",value:"originalAmount"}},{kind:"Field",name:{kind:"Name",value:"isRecurring"}},{kind:"Field",name:{kind:"Name",value:"recurringInterval"}},{kind:"Field",name:{kind:"Name",value:"recurringIntervalUnit"}},{kind:"Field",name:{kind:"Name",value:"appleProductIdentifier"}},{kind:"Field",name:{kind:"Name",value:"googleProductIdentifier"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"CartFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Order"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"subtotal"}},{kind:"Field",name:{kind:"Name",value:"discount"}},{kind:"Field",name:{kind:"Name",value:"tax"}},{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"gatewayMeta"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"orderItems"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"quantity"}},{kind:"Field",name:{kind:"Name",value:"unitPrice"}},{kind:"Field",name:{kind:"Name",value:"subtotal"}},{kind:"Field",name:{kind:"Name",value:"discount"}},{kind:"Field",name:{kind:"Name",value:"tax"}},{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"custom"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"item"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ItemFragment"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"couponRedemptions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"coupon"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"discountType"}},{kind:"Field",name:{kind:"Name",value:"discountAmount"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"expiresAt"}}]}}]}}]}}]},Sf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SaveContacts"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SaveContactsInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"saveContacts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contacts"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ContactFragment"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ContactFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Contact"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"accountId"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"value"}},{kind:"Field",name:{kind:"Name",value:"unverifiedValue"}},{kind:"Field",name:{kind:"Name",value:"verifiedAt"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"tag"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}}]},Ef={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SaveStoredPreferences"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SaveStoredPreferencesInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"saveStoredPreferences"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"success"}}]}}]}}]},ys={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchContent"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SearchContentInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchContent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}]}]}}]},wf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"TrackEvent"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"TrackEventInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"trackEvent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"success"}}]}}]}}]},Of={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"TrackNotification"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"TrackNotificationInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"trackNotification"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"success"}}]}}]}}]},Tf={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"TransferCart"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"TransferCartInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transferCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CartFragment"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ItemFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Item"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}},{kind:"Field",name:{kind:"Name",value:"pricings"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"kind"}},{kind:"Field",name:{kind:"Name",value:"amount"}},{kind:"Field",name:{kind:"Name",value:"originalAmount"}},{kind:"Field",name:{kind:"Name",value:"isRecurring"}},{kind:"Field",name:{kind:"Name",value:"recurringInterval"}},{kind:"Field",name:{kind:"Name",value:"recurringIntervalUnit"}},{kind:"Field",name:{kind:"Name",value:"appleProductIdentifier"}},{kind:"Field",name:{kind:"Name",value:"googleProductIdentifier"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"updatedAt"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"CartFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Order"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"subtotal"}},{kind:"Field",name:{kind:"Name",value:"discount"}},{kind:"Field",name:{kind:"Name",value:"tax"}},{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"gatewayMeta"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"orderItems"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"quantity"}},{kind:"Field",name:{kind:"Name",value:"unitPrice"}},{kind:"Field",name:{kind:"Name",value:"subtotal"}},{kind:"Field",name:{kind:"Name",value:"discount"}},{kind:"Field",name:{kind:"Name",value:"tax"}},{kind:"Field",name:{kind:"Name",value:"total"}},{kind:"Field",name:{kind:"Name",value:"custom"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"item"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ItemFragment"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"couponRedemptions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"coupon"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"identifier"}},{kind:"Field",name:{kind:"Name",value:"discountType"}},{kind:"Field",name:{kind:"Name",value:"discountAmount"}},{kind:"Field",name:{kind:"Name",value:"currencyCode"}},{kind:"Field",name:{kind:"Name",value:"expiresAt"}}]}}]}}]}}]},_f=5,Ff=3e3,be="This operation can be performed only by an identified user. Ensure `dashx.identify` is run before calling this method.";var rn=(t=>(t.SUBSCRIBE="SUBSCRIBE",t.SUBSCRIPTION_SUCCEEDED="SUBSCRIPTION_SUCCEEDED",t.IN_APP_NOTIFICATION="IN_APP_NOTIFICATION",t))(rn||{}),ce,j,We;class Df{constructor({publicKey:e,baseUri:n="https://api.dashx.com/graphql",realtimeBaseUri:r="wss://realtime.dashx.com",targetEnvironment:i}){mr(this,ce,void 0),mr(this,j,null),mr(this,We,null),Ce(this,"graphqlClient"),Ce(this,"targetEnvironment"),Ce(this,"context"),Ce(this,"publicKey"),Ce(this,"baseUri"),Ce(this,"realtimeBaseUri"),this.baseUri=n,this.realtimeBaseUri=r,this.publicKey=e,this.targetEnvironment=i,this.context=cf(),this.loadIdentity(),this.initGraphqlClient()}get accountAnonymousUid(){return P(this,ce)}set accountAnonymousUid(e){if(!vr.test(e))throw new Error("Anonymous UID must be a valid UUID");Mt(this,ce,e),Fi("accountAnonymousUid",P(this,ce))}get accountUid(){return P(this,j)}set accountUid(e){e==null?Mt(this,j,e):Mt(this,j,String(e)),Fi("accountUid",P(this,j))}get identityToken(){return P(this,We)}set identityToken(e){e==null?Mt(this,We,e):Mt(this,We,String(e)),Fi("identityToken",P(this,We))}initGraphqlClient(){const e=new So({uri:this.baseUri}),n=qd((r,{headers:i})=>({headers:{...i,"X-Public-Key":this.publicKey,...this.targetEnvironment?{"X-Target-Environment":this.targetEnvironment}:{},...P(this,We)?{"X-Identity-Token":P(this,We)}:{}}}));this.graphqlClient=new fs({link:nt.from([n,e]),cache:new is,connectToDevTools:!0,defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"}}})}loadIdentity(){this.accountAnonymousUid=_i("accountAnonymousUid")||vr(),this.accountUid=_i("accountUid")||null,this.identityToken=_i("identityToken")||null}identify(e){if(typeof e=="string"){this.accountUid=e;return}this.accountUid=e==null?void 0:e.uid;const n={input:{uid:e==null?void 0:e.uid,anonymousUid:P(this,ce),...e}};return this.graphqlClient.mutate({mutation:kf,variables:n}).then(r=>r.data).catch(r=>r.errors)}setIdentity(e,n){this.accountUid=e,this.identityToken=n}setAnonymousIdentity(e){this.accountAnonymousUid=e}reset(){this.accountAnonymousUid=vr(),this.accountUid=null,this.identityToken=null}track(e,n){const r={input:{event:e,data:n,accountUid:P(this,j),accountAnonymousUid:P(this,ce),systemContext:this.context}};return this.graphqlClient.mutate({mutation:wf,variables:r})}trackNotification({id:e,status:n,timestamp:r}){const i={input:{id:e,status:n,timestamp:r||new Date}};let a;if(n==="READ"||n==="UNREAD"){if(!P(this,j))throw new Error(be);a=o=>{o.writeFragment({data:{id:e,readAt:n==="UNREAD"?null:new Date,__typename:"Notification"},fragment:_t`
58
- fragment UpdateNotification on Notification {
59
- id
60
- readAt
61
- }
62
- `});const s={input:{accountUid:P(this,j),filter:{readAt:"null"}}},c=o.readQuery({query:Ft,variables:s});let u=0;n==="READ"?u=-1:n==="UNREAD"&&(u=1),o.writeQuery({query:Ft,data:{notificationsAggregate:{__typename:"FetchInAppNotificationsAggregateResponse",count:((c==null?void 0:c.notificationsAggregate.count)||0)+u}},variables:s})}}return this.graphqlClient.mutate({mutation:Of,variables:i,update:a})}fetchInAppNotifications(){if(!P(this,j))throw new Error(be);const e={input:{accountUid:P(this,j)}};this.graphqlClient.query({query:Qn,variables:e});const n={input:{...e.input,filter:{readAt:"null"}}};this.graphqlClient.query({query:Ft,variables:n})}addInAppNotificationToCache(e){if(!P(this,j))throw new Error(be);const n={input:{accountUid:P(this,j)}},r=this.graphqlClient.readQuery({query:Qn,variables:n});this.graphqlClient.writeQuery({query:Qn,data:{notifications:[{...e,__typename:"Notification"},...(r==null?void 0:r.notifications)||[]]},variables:n});const i={input:{...n.input,filter:{readAt:"null"}}},a=this.graphqlClient.readQuery({query:Ft,variables:i});this.graphqlClient.writeQuery({query:Ft,data:{notificationsAggregate:{__typename:"FetchInAppNotificationsAggregateResponse",count:((a==null?void 0:a.notificationsAggregate.count)||0)+1}},variables:i})}watchFetchInAppNotifications(e){if(!P(this,j))throw new Error(be);const n={input:{accountUid:P(this,j)}};this.graphqlClient.watchQuery({query:Qn,variables:n}).subscribe({next(r){e(r.data.notifications)},error(r){console.error(r),e([])}})}watchFetchInAppNotificationsAggregate(e){if(!P(this,j))throw new Error(be);const n={input:{accountUid:P(this,j),filter:{readAt:"null"}}};this.graphqlClient.watchQuery({query:Ft,variables:n}).subscribe({next(r){e(r.data.notificationsAggregate.count||0)},error(r){console.error(r),e(0)}})}addContent(e,n){let r,i;e.includes("/")?[i,r]=e.split("/"):i=e;const a={input:{content:r,contentType:i,data:n}};return this.graphqlClient.mutate({mutation:lf,variables:a}).then(o=>o.data).catch(o=>o.errors)}editContent(e,n){let r,i;e.includes("/")?[i,r]=e.split("/"):i=e;const a={input:{content:r,contentType:i,data:n}};return this.graphqlClient.mutate({mutation:hf,variables:a}).then(o=>o.data).catch(o=>o.errors)}searchContent(e,n){if(!n)return new Vd(o=>{const s={input:{...o,contentType:e}};return this.graphqlClient.query({query:ys,variables:s}).then(c=>{var u;return(u=c.data)==null?void 0:u.searchContent})});const r=ms(n.filter),i={input:{...n,contentType:e,filter:r}},a=this.graphqlClient.query({query:ys,variables:i}).then(o=>{var s;return(s=o.data)==null?void 0:s.searchContent});return n.returnType==="all"?a:a.then(o=>Array.isArray(o)?o[0]:null)}async fetchContent(e,n){var r;if(!e.includes("/"))throw new Error("URN must be of form: {contentType}/{content}");const[i,a]=e.split("/"),o={input:{content:a,contentType:i,...n}};return(r=(await this.graphqlClient.query({query:yf,variables:o})).data)==null?void 0:r.fetchContent}async addItemToCart({custom:e={},...n}){var r;const i={input:{custom:e,...n,accountUid:P(this,j),accountAnonymousUid:P(this,ce)}};return(r=(await this.graphqlClient.mutate({mutation:df,variables:i})).data)==null?void 0:r.addItemToCart}async applyCouponToCart(e){var n;const r={input:{...e,accountUid:P(this,j),accountAnonymousUid:P(this,ce)}};return(n=(await this.graphqlClient.mutate({mutation:ff,variables:r})).data)==null?void 0:n.applyCouponToCart}async removeCouponFromCart(e){var n;const r={input:{...e,accountUid:P(this,j),accountAnonymousUid:P(this,ce)}};return(n=(await this.graphqlClient.mutate({mutation:Nf,variables:r})).data)==null?void 0:n.removeCouponFromCart}async fetchCart(e){var n;const r={input:{...e,accountUid:P(this,j),accountAnonymousUid:P(this,ce)}};return(n=(await this.graphqlClient.query({query:mf,variables:r})).data)==null?void 0:n.fetchCart}async transferCart(e){var n;if(!P(this,j))throw new Error(be);const r={input:{...e,accountUid:P(this,j),accountAnonymousUid:P(this,ce)}};return(n=(await this.graphqlClient.mutate({mutation:Tf,variables:r})).data)==null?void 0:n.transferCart}async fetchStoredPreferences(){var e;if(!P(this,j))throw new Error(be);const n={input:{accountUid:P(this,j)}};return(e=(await this.graphqlClient.query({query:gf,variables:n})).data)==null?void 0:e.fetchStoredPreferences.preferenceData}async saveStoredPreferences(e){var n;if(!P(this,j))throw new Error(be);const r={input:{accountUid:P(this,j),preferenceData:e}},i=await this.graphqlClient.mutate({mutation:Ef,variables:r});return(n=i==null?void 0:i.data)==null?void 0:n.saveStoredPreferences}async fetchContacts(){var e,n;if(!P(this,j))throw new Error(be);const r={input:{uid:P(this,j)}},i=await this.graphqlClient.query({query:vf,variables:r});return(n=(e=i==null?void 0:i.data)==null?void 0:e.fetchContacts)==null?void 0:n.contacts}async saveContacts(e){var n;if(!P(this,j))throw new Error(be);const r={input:{uid:P(this,j),contacts:e}},i=await this.graphqlClient.mutate({mutation:Sf,variables:r});return(n=i==null?void 0:i.data)==null?void 0:n.saveContacts}async upload(e){var n,r,i,a,o,s;const{file:c,attribute:u,resource:l}=e,f={input:{name:c.name,size:c.size,mimeType:c.type,attribute:u,resource:l,targetEnvironment:this.targetEnvironment}},d=await this.graphqlClient.mutate({mutation:bf,variables:f}),p=(r=(n=d==null?void 0:d.data)==null?void 0:n.prepareAsset)==null?void 0:r.id,h=(s=(o=(a=(i=d==null?void 0:d.data)==null?void 0:i.prepareAsset)==null?void 0:a.data)==null?void 0:o.upload)==null?void 0:s.url;if(!h||!p)throw new Error("Something went wrong");await fetch(h,{method:"PUT",body:c,headers:{"Content-Type":c.type,"x-goog-meta-origin-id":p}});let y=_f;const m=async()=>{const v=await this.getAsset({id:p});return(v==null?void 0:v.uploadStatus)==="UPLOADED"?Promise.resolve(v):(await new Promise(b=>{setTimeout(b,Ff)}),y-=1,y?m():Promise.reject(new Error("Something went wrong")))};return m()}async getAsset(e){var n;const{id:r}=e,i={id:r},a=await this.graphqlClient.query({query:pf,variables:i});return(n=a==null?void 0:a.data)==null?void 0:n.asset}}ce=new WeakMap,j=new WeakMap,We=new WeakMap;const If=t=>new Df(t),gs=D.createContext(null);function Af({children:t,publicKey:e,baseUri:n,realtimeBaseUri:r,targetEnvironment:i}){const a=D.useMemo(()=>If({publicKey:e,baseUri:n,realtimeBaseUri:r,targetEnvironment:i}),[e,n,i]);return D.createElement(gs.Provider,{value:a},t)}const Di=()=>{const t=D.useContext(gs);if(!t)throw new Error("DashXProvider not initialized. Make sure your app is wrapped in DashXProvider.");return t};let xf={data:""},Cf=t=>typeof window=="object"?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||xf,Pf=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Rf=/\/\*[^]*?\*\/| +/g,ks=/\n+/g,ze=(t,e)=>{let n="",r="",i="";for(let a in t){let o=t[a];a[0]=="@"?a[1]=="i"?n=a+" "+o+";":r+=a[1]=="f"?ze(o,a):a+"{"+ze(o,a[1]=="k"?"":e)+"}":typeof o=="object"?r+=ze(o,e?e.replace(/([^,])+/g,s=>a.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,s):s?s+" "+c:c)):a):o!=null&&(a=/^--/.test(a)?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=ze.p?ze.p(a,o):a+":"+o+";")}return n+(e&&i?e+"{"+i+"}":i)+r},De={},bs=t=>{if(typeof t=="object"){let e="";for(let n in t)e+=n+bs(t[n]);return e}return t},Mf=(t,e,n,r,i)=>{let a=bs(t),o=De[a]||(De[a]=(c=>{let u=0,l=11;for(;u<c.length;)l=101*l+c.charCodeAt(u++)>>>0;return"go"+l})(a));if(!De[o]){let c=a!==t?t:(u=>{let l,f,d=[{}];for(;l=Pf.exec(u.replace(Rf,""));)l[4]?d.shift():l[3]?(f=l[3].replace(ks," ").trim(),d.unshift(d[0][f]=d[0][f]||{})):d[0][l[1]]=l[2].replace(ks," ").trim();return d[0]})(t);De[o]=ze(i?{["@keyframes "+o]:c}:c,n?"":"."+o)}let s=n&&De.g?De.g:null;return n&&(De.g=De[o]),((c,u,l,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=l?c+u.data:u.data+c)})(De[o],e,r,s),o},jf=(t,e,n)=>t.reduce((r,i,a)=>{let o=e[a];if(o&&o.call){let s=o(n),c=s&&s.props&&s.props.className||/^go/.test(s)&&s;o=c?"."+c:s&&typeof s=="object"?s.props?"":ze(s,""):s===!1?"":s}return r+i+(o??"")},"");function Wn(t){let e=this||{},n=t.call?t(e.p):t;return Mf(n.unshift?n.raw?jf(n,[].slice.call(arguments,1),e.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(e.p):i),{}):n,Cf(e.target),e.g,e.o,e.k)}let Ns,Ii,Ai;Wn.bind({g:1});let Ie=Wn.bind({k:1});function Lf(t,e,n,r){ze.p=e,Ns=t,Ii=n,Ai=r}function $e(t,e){let n=this||{};return function(){let r=arguments;function i(a,o){let s=Object.assign({},a),c=s.className||i.className;n.p=Object.assign({theme:Ii&&Ii()},s),n.o=/ *go\d+/.test(c),s.className=Wn.apply(n,r)+(c?" "+c:"");let u=t;return t[0]&&(u=s.as||t,delete s.as),Ai&&u[0]&&Ai(s),Ns(u,s)}return i}}var qf=t=>typeof t=="function",zn=(t,e)=>qf(t)?t(e):t,Vf=(()=>{let t=0;return()=>(++t).toString()})(),Ss=(()=>{let t;return()=>{if(t===void 0&&typeof window<"u"){let e=matchMedia("(prefers-reduced-motion: reduce)");t=!e||e.matches}return t}})(),Uf=20,$n=new Map,Bf=1e3,Es=t=>{if($n.has(t))return;let e=setTimeout(()=>{$n.delete(t),rt({type:4,toastId:t})},Bf);$n.set(t,e)},Qf=t=>{let e=$n.get(t);e&&clearTimeout(e)},xi=(t,e)=>{switch(e.type){case 0:return{...t,toasts:[e.toast,...t.toasts].slice(0,Uf)};case 1:return e.toast.id&&Qf(e.toast.id),{...t,toasts:t.toasts.map(a=>a.id===e.toast.id?{...a,...e.toast}:a)};case 2:let{toast:n}=e;return t.toasts.find(a=>a.id===n.id)?xi(t,{type:1,toast:n}):xi(t,{type:0,toast:n});case 3:let{toastId:r}=e;return r?Es(r):t.toasts.forEach(a=>{Es(a.id)}),{...t,toasts:t.toasts.map(a=>a.id===r||r===void 0?{...a,visible:!1}:a)};case 4:return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(a=>a.id!==e.toastId)};case 5:return{...t,pausedAt:e.time};case 6:let i=e.time-(t.pausedAt||0);return{...t,pausedAt:void 0,toasts:t.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+i}))}}},Kn=[],Gn={toasts:[],pausedAt:void 0},rt=t=>{Gn=xi(Gn,t),Kn.forEach(e=>{e(Gn)})},Wf={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},zf=(t={})=>{let[e,n]=D.useState(Gn);D.useEffect(()=>(Kn.push(n),()=>{let i=Kn.indexOf(n);i>-1&&Kn.splice(i,1)}),[e]);let r=e.toasts.map(i=>{var a,o;return{...t,...t[i.type],...i,duration:i.duration||((a=t[i.type])==null?void 0:a.duration)||(t==null?void 0:t.duration)||Wf[i.type],style:{...t.style,...(o=t[i.type])==null?void 0:o.style,...i.style}}});return{...e,toasts:r}},$f=(t,e="blank",n)=>({createdAt:Date.now(),visible:!0,type:e,ariaProps:{role:"status","aria-live":"polite"},message:t,pauseDuration:0,...n,id:(n==null?void 0:n.id)||Vf()}),an=t=>(e,n)=>{let r=$f(e,t,n);return rt({type:2,toast:r}),r.id},ae=(t,e)=>an("blank")(t,e);ae.error=an("error"),ae.success=an("success"),ae.loading=an("loading"),ae.custom=an("custom"),ae.dismiss=t=>{rt({type:3,toastId:t})},ae.remove=t=>rt({type:4,toastId:t}),ae.promise=(t,e,n)=>{let r=ae.loading(e.loading,{...n,...n==null?void 0:n.loading});return t.then(i=>(ae.success(zn(e.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{ae.error(zn(e.error,i),{id:r,...n,...n==null?void 0:n.error})}),t};var Kf=(t,e)=>{rt({type:1,toast:{id:t,height:e}})},Gf=()=>{rt({type:5,time:Date.now()})},Jf=t=>{let{toasts:e,pausedAt:n}=zf(t);D.useEffect(()=>{if(n)return;let a=Date.now(),o=e.map(s=>{if(s.duration===1/0)return;let c=(s.duration||0)+s.pauseDuration-(a-s.createdAt);if(c<0){s.visible&&ae.dismiss(s.id);return}return setTimeout(()=>ae.dismiss(s.id),c)});return()=>{o.forEach(s=>s&&clearTimeout(s))}},[e,n]);let r=D.useCallback(()=>{n&&rt({type:6,time:Date.now()})},[n]),i=D.useCallback((a,o)=>{let{reverseOrder:s=!1,gutter:c=8,defaultPosition:u}=o||{},l=e.filter(p=>(p.position||u)===(a.position||u)&&p.height),f=l.findIndex(p=>p.id===a.id),d=l.filter((p,h)=>h<f&&p.visible).length;return l.filter(p=>p.visible).slice(...s?[d+1]:[0,d]).reduce((p,h)=>p+(h.height||0)+c,0)},[e]);return{toasts:e,handlers:{updateHeight:Kf,startPause:Gf,endPause:r,calculateOffset:i}}},Hf=Ie`
63
- from {
64
- transform: scale(0) rotate(45deg);
65
- opacity: 0;
66
- }
67
- to {
68
- transform: scale(1) rotate(45deg);
69
- opacity: 1;
70
- }`,Yf=Ie`
71
- from {
72
- transform: scale(0);
73
- opacity: 0;
74
- }
75
- to {
76
- transform: scale(1);
77
- opacity: 1;
78
- }`,Xf=Ie`
79
- from {
80
- transform: scale(0) rotate(90deg);
81
- opacity: 0;
82
- }
83
- to {
84
- transform: scale(1) rotate(90deg);
85
- opacity: 1;
86
- }`,Zf=$e("div")`
87
- width: 20px;
88
- opacity: 0;
89
- height: 20px;
90
- border-radius: 10px;
91
- background: ${t=>t.primary||"#ff4b4b"};
92
- position: relative;
93
- transform: rotate(45deg);
94
-
95
- animation: ${Hf} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
96
- forwards;
97
- animation-delay: 100ms;
98
-
99
- &:after,
100
- &:before {
101
- content: '';
102
- animation: ${Yf} 0.15s ease-out forwards;
103
- animation-delay: 150ms;
104
- position: absolute;
105
- border-radius: 3px;
106
- opacity: 0;
107
- background: ${t=>t.secondary||"#fff"};
108
- bottom: 9px;
109
- left: 4px;
110
- height: 2px;
111
- width: 12px;
112
- }
113
-
114
- &:before {
115
- animation: ${Xf} 0.15s ease-out forwards;
116
- animation-delay: 180ms;
117
- transform: rotate(90deg);
118
- }
119
- `,ep=Ie`
120
- from {
121
- transform: rotate(0deg);
122
- }
123
- to {
124
- transform: rotate(360deg);
125
- }
126
- `,tp=$e("div")`
127
- width: 12px;
128
- height: 12px;
129
- box-sizing: border-box;
130
- border: 2px solid;
131
- border-radius: 100%;
132
- border-color: ${t=>t.secondary||"#e0e0e0"};
133
- border-right-color: ${t=>t.primary||"#616161"};
134
- animation: ${ep} 1s linear infinite;
135
- `,np=Ie`
136
- from {
137
- transform: scale(0) rotate(45deg);
138
- opacity: 0;
139
- }
140
- to {
141
- transform: scale(1) rotate(45deg);
142
- opacity: 1;
143
- }`,rp=Ie`
144
- 0% {
145
- height: 0;
146
- width: 0;
147
- opacity: 0;
148
- }
149
- 40% {
150
- height: 0;
151
- width: 6px;
152
- opacity: 1;
153
- }
154
- 100% {
155
- opacity: 1;
156
- height: 10px;
157
- }`,ip=$e("div")`
158
- width: 20px;
159
- opacity: 0;
160
- height: 20px;
161
- border-radius: 10px;
162
- background: ${t=>t.primary||"#61d345"};
163
- position: relative;
164
- transform: rotate(45deg);
165
-
166
- animation: ${np} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
167
- forwards;
168
- animation-delay: 100ms;
169
- &:after {
170
- content: '';
171
- box-sizing: border-box;
172
- animation: ${rp} 0.2s ease-out forwards;
173
- opacity: 0;
174
- animation-delay: 200ms;
175
- position: absolute;
176
- border-right: 2px solid;
177
- border-bottom: 2px solid;
178
- border-color: ${t=>t.secondary||"#fff"};
179
- bottom: 6px;
180
- left: 6px;
181
- height: 10px;
182
- width: 6px;
183
- }
184
- `,ap=$e("div")`
185
- position: absolute;
186
- `,op=$e("div")`
187
- position: relative;
188
- display: flex;
189
- justify-content: center;
190
- align-items: center;
191
- min-width: 20px;
192
- min-height: 20px;
193
- `,sp=Ie`
194
- from {
195
- transform: scale(0.6);
196
- opacity: 0.4;
197
- }
198
- to {
199
- transform: scale(1);
200
- opacity: 1;
201
- }`,up=$e("div")`
202
- position: relative;
203
- transform: scale(0.6);
204
- opacity: 0.4;
205
- min-width: 20px;
206
- animation: ${sp} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
207
- forwards;
208
- `,cp=({toast:t})=>{let{icon:e,type:n,iconTheme:r}=t;return e!==void 0?typeof e=="string"?C.createElement(up,null,e):e:n==="blank"?null:C.createElement(op,null,C.createElement(tp,{...r}),n!=="loading"&&C.createElement(ap,null,n==="error"?C.createElement(Zf,{...r}):C.createElement(ip,{...r})))},lp=t=>`
209
- 0% {transform: translate3d(0,${t*-200}%,0) scale(.6); opacity:.5;}
210
- 100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
211
- `,dp=t=>`
212
- 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
213
- 100% {transform: translate3d(0,${t*-150}%,-1px) scale(.6); opacity:0;}
214
- `,fp="0%{opacity:0;} 100%{opacity:1;}",pp="0%{opacity:1;} 100%{opacity:0;}",hp=$e("div")`
215
- display: flex;
216
- align-items: center;
217
- background: #fff;
218
- color: #363636;
219
- line-height: 1.3;
220
- will-change: transform;
221
- box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
222
- max-width: 350px;
223
- pointer-events: auto;
224
- padding: 8px 10px;
225
- border-radius: 8px;
226
- `,mp=$e("div")`
227
- display: flex;
228
- justify-content: center;
229
- margin: 4px 10px;
230
- color: inherit;
231
- flex: 1 1 auto;
232
- white-space: pre-line;
233
- `,vp=(t,e)=>{let n=t.includes("top")?1:-1,[r,i]=Ss()?[fp,pp]:[lp(n),dp(n)];return{animation:e?`${Ie(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ie(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},yp=C.memo(({toast:t,position:e,style:n,children:r})=>{let i=t.height?vp(t.position||e||"top-center",t.visible):{opacity:0},a=C.createElement(cp,{toast:t}),o=C.createElement(mp,{...t.ariaProps},zn(t.message,t));return C.createElement(hp,{className:t.className,style:{...i,...n,...t.style}},typeof r=="function"?r({icon:a,message:o}):C.createElement(C.Fragment,null,a,o))});Lf(C.createElement);var gp=({id:t,className:e,style:n,onHeightUpdate:r,children:i})=>{let a=C.useCallback(o=>{if(o){let s=()=>{let c=o.getBoundingClientRect().height;r(t,c)};s(),new MutationObserver(s).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[t,r]);return C.createElement("div",{ref:a,className:e,style:n},i)},kp=(t,e)=>{let n=t.includes("top"),r=n?{top:0}:{bottom:0},i=t.includes("center")?{justifyContent:"center"}:t.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Ss()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${e*(n?1:-1)}px)`,...r,...i}},bp=Wn`
234
- z-index: 9999;
235
- > * {
236
- pointer-events: auto;
237
- }
238
- `,Jn=16,Np=({reverseOrder:t,position:e="top-center",toastOptions:n,gutter:r,children:i,containerStyle:a,containerClassName:o})=>{let{toasts:s,handlers:c}=Jf(n);return C.createElement("div",{style:{position:"fixed",zIndex:9999,top:Jn,left:Jn,right:Jn,bottom:Jn,pointerEvents:"none",...a},className:o,onMouseEnter:c.startPause,onMouseLeave:c.endPause},s.map(u=>{let l=u.position||e,f=c.calculateOffset(u,{reverseOrder:t,gutter:r,defaultPosition:e}),d=kp(l,f);return C.createElement(gp,{id:u.id,key:u.id,onHeightUpdate:c.updateHeight,className:u.visible?bp:"",style:d},u.type==="custom"?zn(u.message,u):i?i(u):C.createElement(yp,{toast:u,position:l}))}))},Sp=ae,z=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ws(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Os={},Dt={},ye={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isEventSourceSupported=t.isReactNative=t.ReadyState=t.DEFAULT_HEARTBEAT=t.UNPARSABLE_JSON_OBJECT=t.DEFAULT_RECONNECT_INTERVAL_MS=t.DEFAULT_RECONNECT_LIMIT=t.SOCKET_IO_PING_CODE=t.SOCKET_IO_PATH=t.SOCKET_IO_PING_INTERVAL=t.DEFAULT_EVENT_SOURCE_OPTIONS=t.EMPTY_EVENT_HANDLERS=t.DEFAULT_OPTIONS=void 0;var e=1,n=1e3*e;t.DEFAULT_OPTIONS={},t.EMPTY_EVENT_HANDLERS={},t.DEFAULT_EVENT_SOURCE_OPTIONS={withCredentials:!1,events:t.EMPTY_EVENT_HANDLERS},t.SOCKET_IO_PING_INTERVAL=25*n,t.SOCKET_IO_PATH="/socket.io/?EIO=3&transport=websocket",t.SOCKET_IO_PING_CODE="2",t.DEFAULT_RECONNECT_LIMIT=20,t.DEFAULT_RECONNECT_INTERVAL_MS=5e3,t.UNPARSABLE_JSON_OBJECT={},t.DEFAULT_HEARTBEAT={message:"ping",timeout:6e4,interval:25e3},function(i){i[i.UNINSTANTIATED=-1]="UNINSTANTIATED",i[i.CONNECTING=0]="CONNECTING",i[i.OPEN=1]="OPEN",i[i.CLOSING=2]="CLOSING",i[i.CLOSED=3]="CLOSED"}(t.ReadyState||(t.ReadyState={}));var r=function(){try{return"EventSource"in globalThis}catch{return!1}};t.isReactNative=typeof navigator<"u"&&navigator.product==="ReactNative",t.isEventSourceSupported=!t.isReactNative&&r()})(ye);var Hn={},Yn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.resetWebSockets=t.sharedWebSockets=void 0,t.sharedWebSockets={};var e=function(n){if(n&&t.sharedWebSockets.hasOwnProperty(n))delete t.sharedWebSockets[n];else for(var r in t.sharedWebSockets)t.sharedWebSockets.hasOwnProperty(r)&&delete t.sharedWebSockets[r]};t.resetWebSockets=e})(Yn);var Xn={},Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.setUpSocketIOPing=Ne.appendQueryParams=Ne.parseSocketIOUrl=void 0;var Zn=ye,Ep=function(t){if(t){var e=/^https|wss/.test(t),n=t.replace(/^(https?|wss?)(:\/\/)?/,""),r=n.replace(/\/$/,""),i=e?"wss":"ws";return"".concat(i,"://").concat(r).concat(Zn.SOCKET_IO_PATH)}else if(t===""){var e=/^https/.test(window.location.protocol),i=e?"wss":"ws",a=window.location.port?":".concat(window.location.port):"";return"".concat(i,"://").concat(window.location.hostname).concat(a).concat(Zn.SOCKET_IO_PATH)}return t};Ne.parseSocketIOUrl=Ep;var wp=function(t,e){e===void 0&&(e={});var n=/\?([\w]+=[\w]+)/,r=n.test(t),i="".concat(Object.entries(e).reduce(function(a,o){var s=o[0],c=o[1];return a+"".concat(s,"=").concat(c,"&")},"").slice(0,-1));return"".concat(t).concat(r?"&":"?").concat(i)};Ne.appendQueryParams=wp;var Op=function(t,e){e===void 0&&(e=Zn.SOCKET_IO_PING_INTERVAL);var n=function(){return t(Zn.SOCKET_IO_PING_CODE)};return window.setInterval(n,e)};Ne.setUpSocketIOPing=Op;var on={};Object.defineProperty(on,"__esModule",{value:!0}),on.heartbeat=void 0;var Ci=ye;function Tp(t,e){var n=e||{},r=n.interval,i=r===void 0?Ci.DEFAULT_HEARTBEAT.interval:r,a=n.timeout,o=a===void 0?Ci.DEFAULT_HEARTBEAT.timeout:a,s=n.message,c=s===void 0?Ci.DEFAULT_HEARTBEAT.message:s,u=!1,l=setInterval(function(){try{typeof c=="function"?t.send(c()):t.send(c)}catch{}},i),f=setInterval(function(){u?u=!1:t.close()},o);return t.addEventListener("close",function(){clearInterval(l),clearInterval(f)}),function(){u=!0}}on.heartbeat=Tp;var Ke={},er={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.resetSubscribers=t.removeSubscriber=t.addSubscriber=t.hasSubscribers=t.getSubscribers=void 0;var e={},n=[],r=function(c){return(0,t.hasSubscribers)(c)?Array.from(e[c]):n};t.getSubscribers=r;var i=function(c){var u;return((u=e[c])===null||u===void 0?void 0:u.size)>0};t.hasSubscribers=i;var a=function(c,u){e[c]=e[c]||new Set,e[c].add(u)};t.addSubscriber=a;var o=function(c,u){e[c].delete(u)};t.removeSubscriber=o;var s=function(c){if(c&&e.hasOwnProperty(c))delete e[c];else for(var u in e)e.hasOwnProperty(u)&&delete e[u]};t.resetSubscribers=s})(er),Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.resetGlobalState=Ke.assertIsWebSocket=void 0;var _p=Yn,Fp=er;function Dp(t,e){if(!e&&!(t instanceof WebSocket))throw new Error("")}Ke.assertIsWebSocket=Dp;function Ip(t){(0,Fp.resetSubscribers)(t),(0,_p.resetWebSockets)(t)}Ke.resetGlobalState=Ip;var tr=z&&z.__assign||function(){return tr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},tr.apply(this,arguments)};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.attachListeners=void 0;var Ap=Ne,xp=on,Se=ye,Cp=Ke,Pp=function(t,e,n){var r;if(e.current.heartbeat&&t instanceof WebSocket){var i=typeof e.current.heartbeat=="boolean"?void 0:e.current.heartbeat;r=(0,xp.heartbeat)(t,i)}t.onmessage=function(a){var o;r==null||r(),e.current.onMessage&&e.current.onMessage(a),!(typeof e.current.filter=="function"&&e.current.filter(a)!==!0)&&(e.current.heartbeat&&typeof e.current.heartbeat!="boolean"&&((o=e.current.heartbeat)===null||o===void 0?void 0:o.returnMessage)===a.data||n(a))}},Rp=function(t,e,n,r){t.onopen=function(i){e.current.onOpen&&e.current.onOpen(i),r.current=0,n(Se.ReadyState.OPEN)}},Mp=function(t,e,n,r,i){if(Se.isEventSourceSupported&&t instanceof EventSource)return function(){};(0,Cp.assertIsWebSocket)(t,e.current.skipAssert);var a;return t.onclose=function(o){var s;if(e.current.onClose&&e.current.onClose(o),n(Se.ReadyState.CLOSED),e.current.shouldReconnect&&e.current.shouldReconnect(o)){var c=(s=e.current.reconnectAttempts)!==null&&s!==void 0?s:Se.DEFAULT_RECONNECT_LIMIT;if(i.current<c){var u=typeof e.current.reconnectInterval=="function"?e.current.reconnectInterval(i.current):e.current.reconnectInterval;a=window.setTimeout(function(){i.current++,r()},u??Se.DEFAULT_RECONNECT_INTERVAL_MS)}else e.current.onReconnectStop&&e.current.onReconnectStop(c),console.warn("Max reconnect attempts of ".concat(c," exceeded"))}},function(){return a&&window.clearTimeout(a)}},jp=function(t,e,n,r,i){var a;return t.onerror=function(o){var s;if(e.current.onError&&e.current.onError(o),Se.isEventSourceSupported&&t instanceof EventSource&&(e.current.onClose&&e.current.onClose(tr(tr({},o),{code:1006,reason:"An error occurred with the EventSource: ".concat(o),wasClean:!1})),n(Se.ReadyState.CLOSED),t.close()),e.current.retryOnError)if(i.current<((s=e.current.reconnectAttempts)!==null&&s!==void 0?s:Se.DEFAULT_RECONNECT_LIMIT)){var c=typeof e.current.reconnectInterval=="function"?e.current.reconnectInterval(i.current):e.current.reconnectInterval;a=window.setTimeout(function(){i.current++,r()},c??Se.DEFAULT_RECONNECT_INTERVAL_MS)}else e.current.onReconnectStop&&e.current.onReconnectStop(e.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(e.current.reconnectAttempts," exceeded"))},function(){return a&&window.clearTimeout(a)}},Lp=function(t,e,n,r,i,a){var o=e.setLastMessage,s=e.setReadyState,c,u,l;return n.current.fromSocketIO&&(c=(0,Ap.setUpSocketIOPing)(a)),Pp(t,n,o),Rp(t,n,s,i),u=Mp(t,n,s,r,i),l=jp(t,n,s,r,i),function(){s(Se.ReadyState.CLOSING),u(),l(),t.close(),c&&clearInterval(c)}};Xn.attachListeners=Lp;var nr={},rr=z&&z.__assign||function(){return rr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},rr.apply(this,arguments)};Object.defineProperty(nr,"__esModule",{value:!0}),nr.attachSharedListeners=void 0;var qp=Yn,it=ye,sn=er,Vp=Ne,Up=on,Bp=function(t,e,n){var r;n&&t instanceof WebSocket&&(r=(0,Up.heartbeat)(t,typeof n=="boolean"?void 0:n)),t.onmessage=function(i){r==null||r(),(0,sn.getSubscribers)(e).forEach(function(a){a.optionsRef.current.onMessage&&a.optionsRef.current.onMessage(i),!(typeof a.optionsRef.current.filter=="function"&&a.optionsRef.current.filter(i)!==!0)&&(n&&typeof n!="boolean"&&(n==null?void 0:n.returnMessage)===i.data||a.setLastMessage(i))})}},Qp=function(t,e){t.onopen=function(n){(0,sn.getSubscribers)(e).forEach(function(r){r.reconnectCount.current=0,r.optionsRef.current.onOpen&&r.optionsRef.current.onOpen(n),r.setReadyState(it.ReadyState.OPEN)})}},Wp=function(t,e){t instanceof WebSocket&&(t.onclose=function(n){(0,sn.getSubscribers)(e).forEach(function(r){r.optionsRef.current.onClose&&r.optionsRef.current.onClose(n),r.setReadyState(it.ReadyState.CLOSED)}),delete qp.sharedWebSockets[e],(0,sn.getSubscribers)(e).forEach(function(r){var i;if(r.optionsRef.current.shouldReconnect&&r.optionsRef.current.shouldReconnect(n)){var a=(i=r.optionsRef.current.reconnectAttempts)!==null&&i!==void 0?i:it.DEFAULT_RECONNECT_LIMIT;if(r.reconnectCount.current<a){var o=typeof r.optionsRef.current.reconnectInterval=="function"?r.optionsRef.current.reconnectInterval(r.reconnectCount.current):r.optionsRef.current.reconnectInterval;setTimeout(function(){r.reconnectCount.current++,r.reconnect.current()},o??it.DEFAULT_RECONNECT_INTERVAL_MS)}else r.optionsRef.current.onReconnectStop&&r.optionsRef.current.onReconnectStop(r.optionsRef.current.reconnectAttempts),console.warn("Max reconnect attempts of ".concat(a," exceeded"))}})})},zp=function(t,e){t.onerror=function(n){(0,sn.getSubscribers)(e).forEach(function(r){r.optionsRef.current.onError&&r.optionsRef.current.onError(n),it.isEventSourceSupported&&t instanceof EventSource&&(r.optionsRef.current.onClose&&r.optionsRef.current.onClose(rr(rr({},n),{code:1006,reason:"An error occurred with the EventSource: ".concat(n),wasClean:!1})),r.setReadyState(it.ReadyState.CLOSED))}),it.isEventSourceSupported&&t instanceof EventSource&&t.close()}},$p=function(t,e,n,r){var i;return n.current.fromSocketIO&&(i=(0,Vp.setUpSocketIOPing)(r)),Bp(t,e,n.current.heartbeat),Wp(t,e),Qp(t,e),zp(t,e),function(){i&&clearInterval(i)}};nr.attachSharedListeners=$p,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.createOrJoinSocket=void 0;var Ge=Yn,un=ye,Kp=Xn,Gp=nr,Pi=er,Jp=function(t,e,n,r,i){return function(){if((0,Pi.removeSubscriber)(t,e),!(0,Pi.hasSubscribers)(t)){try{var a=Ge.sharedWebSockets[t];a instanceof WebSocket&&(a.onclose=function(o){n.current.onClose&&n.current.onClose(o),r(un.ReadyState.CLOSED)}),a.close()}catch{}i&&i(),delete Ge.sharedWebSockets[t]}}},Hp=function(t,e,n,r,i,a,o,s){if(!un.isEventSourceSupported&&r.current.eventSourceOptions)throw un.isReactNative?new Error("EventSource is not supported in ReactNative"):new Error("EventSource is not supported");if(r.current.share){var c=null;Ge.sharedWebSockets[e]===void 0?(Ge.sharedWebSockets[e]=r.current.eventSourceOptions?new EventSource(e,r.current.eventSourceOptions):new WebSocket(e,r.current.protocols),t.current=Ge.sharedWebSockets[e],n(un.ReadyState.CONNECTING),c=(0,Gp.attachSharedListeners)(Ge.sharedWebSockets[e],e,r,s)):(t.current=Ge.sharedWebSockets[e],n(Ge.sharedWebSockets[e].readyState));var u={setLastMessage:i,setReadyState:n,optionsRef:r,reconnectCount:o,reconnect:a};return(0,Pi.addSubscriber)(e,u),Jp(e,u,r,n,c)}else{if(t.current=r.current.eventSourceOptions?new EventSource(e,r.current.eventSourceOptions):new WebSocket(e,r.current.protocols),n(un.ReadyState.CONNECTING),!t.current)throw new Error("WebSocket failed to be created");return(0,Kp.attachListeners)(t.current,{setLastMessage:i,setReadyState:n},r,a.current,o,s)}};Hn.createOrJoinSocket=Hp;var Ts={};(function(t){var e=z&&z.__awaiter||function(s,c,u,l){function f(d){return d instanceof u?d:new u(function(p){p(d)})}return new(u||(u=Promise))(function(d,p){function h(v){try{m(l.next(v))}catch(b){p(b)}}function y(v){try{m(l.throw(v))}catch(b){p(b)}}function m(v){v.done?d(v.value):f(v.value).then(h,y)}m((l=l.apply(s,c||[])).next())})},n=z&&z.__generator||function(s,c){var u={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},l,f,d,p;return p={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function h(m){return function(v){return y([m,v])}}function y(m){if(l)throw new TypeError("Generator is already executing.");for(;u;)try{if(l=1,f&&(d=m[0]&2?f.return:m[0]?f.throw||((d=f.return)&&d.call(f),0):f.next)&&!(d=d.call(f,m[1])).done)return d;switch(f=0,d&&(m=[m[0]&2,d.value]),m[0]){case 0:case 1:d=m;break;case 4:return u.label++,{value:m[1],done:!1};case 5:u.label++,f=m[1],m=[0];continue;case 7:m=u.ops.pop(),u.trys.pop();continue;default:if(d=u.trys,!(d=d.length>0&&d[d.length-1])&&(m[0]===6||m[0]===2)){u=0;continue}if(m[0]===3&&(!d||m[1]>d[0]&&m[1]<d[3])){u.label=m[1];break}if(m[0]===6&&u.label<d[1]){u.label=d[1],d=m;break}if(d&&u.label<d[2]){u.label=d[2],u.ops.push(m);break}d[2]&&u.ops.pop(),u.trys.pop();continue}m=c.call(s,u)}catch(v){m=[6,v],f=0}finally{l=d=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getUrl=void 0;var r=Ne,i=ye,a=function(s){return new Promise(function(c){return window.setTimeout(c,s)})},o=function(s,c,u){return u===void 0&&(u=0),e(void 0,void 0,void 0,function(){var l,f,d,p,h,y,m,v;return n(this,function(b){switch(b.label){case 0:if(typeof s!="function")return[3,10];b.label=1;case 1:return b.trys.push([1,3,,9]),[4,s()];case 2:return l=b.sent(),[3,9];case 3:return b.sent(),c.current.retryOnError?(f=(y=c.current.reconnectAttempts)!==null&&y!==void 0?y:i.DEFAULT_RECONNECT_LIMIT,u<f?(d=typeof c.current.reconnectInterval=="function"?c.current.reconnectInterval(u):c.current.reconnectInterval,[4,a(d??i.DEFAULT_RECONNECT_INTERVAL_MS)]):[3,5]):[3,7];case 4:return b.sent(),[2,(0,t.getUrl)(s,c,u+1)];case 5:return(v=(m=c.current).onReconnectStop)===null||v===void 0||v.call(m,u),[2,null];case 6:return[3,8];case 7:return[2,null];case 8:return[3,9];case 9:return[3,11];case 10:l=s,b.label=11;case 11:return p=c.current.fromSocketIO?(0,r.parseSocketIOUrl)(l):l,h=c.current.queryParams?(0,r.appendQueryParams)(p,c.current.queryParams):p,[2,h]}})})};t.getUrl=o})(Ts);var _s={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.websocketWrapper=void 0;var e=function(n,r){return new Proxy(n,{get:function(i,a){var o=i[a];return a==="reconnect"?r:typeof o=="function"?(console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."),function(){}):o},set:function(i,a,o){return/^on/.test(a)?(console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."),!1):(i[a]=o,!0)}})};t.websocketWrapper=e,t.default=t.websocketWrapper})(_s);var Je=z&&z.__assign||function(){return Je=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Je.apply(this,arguments)},Yp=z&&z.__awaiter||function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(l){try{u(r.next(l))}catch(f){o(f)}}function c(l){try{u(r.throw(l))}catch(f){o(f)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((r=r.apply(t,e||[])).next())})},Xp=z&&z.__generator||function(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(l){return c([u,l])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(l){u=[6,l],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Zp=z&&z.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.useWebSocket=void 0;var te=D,Ri=Ji,Ee=ye,eh=Hn,th=Ts,nh=Zp(_s),Fs=Ke,rh=function(t,e,n){e===void 0&&(e=Ee.DEFAULT_OPTIONS),n===void 0&&(n=!0);var r=(0,te.useState)(null),i=r[0],a=r[1],o=(0,te.useState)({}),s=o[0],c=o[1],u=(0,te.useMemo)(function(){if(i)try{return JSON.parse(i.data)}catch{return Ee.UNPARSABLE_JSON_OBJECT}return null},[i]),l=(0,te.useRef)(null),f=(0,te.useRef)(null),d=(0,te.useRef)(function(){}),p=(0,te.useRef)(0),h=(0,te.useRef)([]),y=(0,te.useRef)(null),m=(0,te.useRef)(e);m.current=e;var v=l.current&&s[l.current]!==void 0?s[l.current]:t!==null&&n===!0?Ee.ReadyState.CONNECTING:Ee.ReadyState.UNINSTANTIATED,b=e.queryParams?JSON.stringify(e.queryParams):null,k=(0,te.useCallback)(function(w,O){var F;if(O===void 0&&(O=!0),Ee.isEventSourceSupported&&f.current instanceof EventSource){console.warn("Unable to send a message from an eventSource");return}((F=f.current)===null||F===void 0?void 0:F.readyState)===Ee.ReadyState.OPEN?((0,Fs.assertIsWebSocket)(f.current,m.current.skipAssert),f.current.send(w)):O&&h.current.push(w)},[]),S=(0,te.useCallback)(function(w,O){O===void 0&&(O=!0),k(JSON.stringify(w),O)},[k]),E=(0,te.useCallback)(function(){return m.current.share!==!0||Ee.isEventSourceSupported&&f.current instanceof EventSource?f.current:(y.current===null&&f.current&&((0,Fs.assertIsWebSocket)(f.current,m.current.skipAssert),y.current=(0,nh.default)(f.current,d)),y.current)},[]);return(0,te.useEffect)(function(){if(t!==null&&n===!0){var w,O=!1,F=!0,I=function(){return Yp(void 0,void 0,void 0,function(){var x,q,K;return Xp(this,function(M){switch(M.label){case 0:return x=l,[4,(0,th.getUrl)(t,m)];case 1:return x.current=M.sent(),l.current===null?(console.error("Failed to get a valid URL. WebSocket connection aborted."),l.current="ABORTED",(0,Ri.flushSync)(function(){return c(function($){return Je(Je({},$),{ABORTED:Ee.ReadyState.CLOSED})})}),[2]):(q=function($){O||(0,Ri.flushSync)(function(){return a($)})},K=function($){O||(0,Ri.flushSync)(function(){return c(function(se){var J;return Je(Je({},se),l.current&&(J={},J[l.current]=$,J))})})},F&&(w=(0,eh.createOrJoinSocket)(f,l.current,K,m,q,d,p,k)),[2])}})})};return d.current=function(){O||(y.current&&(y.current=null),w==null||w(),I())},I(),function(){O=!0,F=!1,y.current&&(y.current=null),w==null||w(),a(null)}}else(t===null||n===!1)&&(p.current=0,c(function(x){var q;return Je(Je({},x),l.current&&(q={},q[l.current]=Ee.ReadyState.CLOSED,q))}))},[t,n,b,k]),(0,te.useEffect)(function(){v===Ee.ReadyState.OPEN&&h.current.splice(0).forEach(function(w){k(w)})},[v]),{sendMessage:k,sendJsonMessage:S,lastMessage:i,lastJsonMessage:u,readyState:v,getWebSocket:E}};Dt.useWebSocket=rh;var ir={},ar=z&&z.__assign||function(){return ar=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ar.apply(this,arguments)};Object.defineProperty(ir,"__esModule",{value:!0}),ir.useSocketIO=void 0;var Ds=D,ih=Dt,ah=ye,Mi={type:"empty",payload:null},oh=function(t){if(!t||!t.data)return Mi;var e=t.data.match(/\[.*]/);if(!e)return Mi;var n=JSON.parse(e);return!Array.isArray(n)||!n[1]?Mi:{type:n[0],payload:n[1]}},sh=function(t,e,n){e===void 0&&(e=ah.DEFAULT_OPTIONS),n===void 0&&(n=!0);var r=(0,Ds.useMemo)(function(){return ar(ar({},e),{fromSocketIO:!0})},[]),i=(0,ih.useWebSocket)(t,r,n),a=i.sendMessage,o=i.sendJsonMessage,s=i.lastMessage,c=i.readyState,u=i.getWebSocket,l=(0,Ds.useMemo)(function(){return oh(s)},[s]);return{sendMessage:a,sendJsonMessage:o,lastMessage:l,lastJsonMessage:l,readyState:c,getWebSocket:u}};ir.useSocketIO=sh;var or={},sr=z&&z.__assign||function(){return sr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},sr.apply(this,arguments)},uh=z&&z.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(or,"__esModule",{value:!0}),or.useEventSource=void 0;var Is=D,ch=Dt,As=ye,lh=function(t,e,n){e===void 0&&(e=As.DEFAULT_EVENT_SOURCE_OPTIONS);var r=e.withCredentials,i=e.events,a=uh(e,["withCredentials","events"]);n===void 0&&(n=!0);var o=sr(sr({},a),{eventSourceOptions:{withCredentials:r}}),s=(0,Is.useRef)(As.EMPTY_EVENT_HANDLERS);i&&(s.current=i);var c=(0,ch.useWebSocket)(t,o,n),u=c.lastMessage,l=c.readyState,f=c.getWebSocket;return(0,Is.useEffect)(function(){u!=null&&u.type&&Object.entries(s.current).forEach(function(d){var p=d[0],h=d[1];p===u.type&&h(u)})},[u]),{lastEvent:u,readyState:l,getEventSource:f}};or.useEventSource=lh,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.resetGlobalState=t.useEventSource=t.ReadyState=t.useSocketIO=t.default=void 0;var e=Dt;Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.useWebSocket}});var n=ir;Object.defineProperty(t,"useSocketIO",{enumerable:!0,get:function(){return n.useSocketIO}});var r=ye;Object.defineProperty(t,"ReadyState",{enumerable:!0,get:function(){return r.ReadyState}});var i=or;Object.defineProperty(t,"useEventSource",{enumerable:!0,get:function(){return i.useEventSource}});var a=Ke;Object.defineProperty(t,"resetGlobalState",{enumerable:!0,get:function(){return a.resetGlobalState}})}(Os);const dh=ws(Os),fh=[4e4,40001,5e4],xs=()=>{let t=Di();const[e,n]=D.useState(!1),[r,i]=D.useState([]),[a,o]=D.useState(null),s=f=>t.trackNotification({id:f,status:"READ"}),c=async f=>t.trackNotification({id:f,status:"UNREAD"}),u=()=>t.fetchInAppNotifications();D.useEffect(()=>{t.watchFetchInAppNotifications(i),t.watchFetchInAppNotificationsAggregate(o)},[]);let{sendJsonMessage:l}=dh(t.realtimeBaseUri,{queryParams:{publicKey:t.publicKey,...t.identityToken&&{identityToken:t.identityToken},...t.targetEnvironment&&{targetEnvironment:t.targetEnvironment}},shouldReconnect:f=>!fh.includes(f.code),onError:f=>console.error({errorEvent:f}),onClose:f=>console.log({closeEvent:f}),onMessage:async f=>{let d=JSON.parse(f.data);switch(d==null?void 0:d.type){case rn.SUBSCRIBE:break;case rn.IN_APP_NOTIFICATION:t.trackNotification({id:d.data.id,status:"DELIVERED"}),t.addInAppNotificationToCache(d.data),Sp(d.data.renderedContent.body);break;case rn.SUBSCRIPTION_SUCCEEDED:u();break;default:throw new Error(`Unknown message type ${d}`)}},onOpen:f=>{let d={type:rn.SUBSCRIBE,data:{accountUid:t.accountUid}};l(d)}},e);return D.useEffect(()=>{n(!0)},[]),{notifications:r,unreadNotificationsCount:a,fetchInAppNotifications:u,markNotificationAsRead:s,markNotificationAsUnread:c}};function ph({title:t,titleId:e,...n},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M5.25 9a6.75 6.75 0 0 1 13.5 0v.75c0 2.123.8 4.057 2.118 5.52a.75.75 0 0 1-.297 1.206c-1.544.57-3.16.99-4.831 1.243a3.75 3.75 0 1 1-7.48 0 24.585 24.585 0 0 1-4.831-1.244.75.75 0 0 1-.298-1.205A8.217 8.217 0 0 0 5.25 9.75V9Zm4.502 8.9a2.25 2.25 0 1 0 4.496 0 25.057 25.057 0 0 1-4.496 0Z",clipRule:"evenodd"}))}const hh=C.forwardRef(ph);function mh({title:t,titleId:e,...n},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?C.createElement("title",{id:e},t):null,C.createElement("path",{d:"M19.5 22.5a3 3 0 0 0 3-3v-8.174l-6.879 4.022 3.485 1.876a.75.75 0 1 1-.712 1.321l-5.683-3.06a1.5 1.5 0 0 0-1.422 0l-5.683 3.06a.75.75 0 0 1-.712-1.32l3.485-1.877L1.5 11.326V19.5a3 3 0 0 0 3 3h15Z"}),C.createElement("path",{d:"M1.5 9.589v-.745a3 3 0 0 1 1.578-2.642l7.5-4.038a3 3 0 0 1 2.844 0l7.5 4.038A3 3 0 0 1 22.5 8.844v.745l-8.426 4.926-.652-.351a3 3 0 0 0-2.844 0l-.652.351L1.5 9.589Z"}))}const vh=C.forwardRef(mh);function yh({title:t,titleId:e,...n},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?C.createElement("title",{id:e},t):null,C.createElement("path",{d:"M1.5 8.67v8.58a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V8.67l-8.928 5.493a3 3 0 0 1-3.144 0L1.5 8.67Z"}),C.createElement("path",{d:"M22.5 6.908V6.75a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3v.158l9.714 5.978a1.5 1.5 0 0 0 1.572 0L22.5 6.908Z"}))}const gh=C.forwardRef(yh);function kh({title:t,titleId:e,...n},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const bh=C.forwardRef(kh);var Cs=function(e){return e.reduce(function(n,r){var i=r[0],a=r[1];return n[i]=a,n},{})},Ps=typeof window<"u"&&window.document&&window.document.createElement?C.useLayoutEffect:C.useEffect,re="top",le="bottom",de="right",ie="left",ji="auto",cn=[re,le,de,ie],It="start",ln="end",Nh="clippingParents",Rs="viewport",dn="popper",Sh="reference",Ms=cn.reduce(function(t,e){return t.concat([e+"-"+It,e+"-"+ln])},[]),js=[].concat(cn,[ji]).reduce(function(t,e){return t.concat([e,e+"-"+It,e+"-"+ln])},[]),Eh="beforeRead",wh="read",Oh="afterRead",Th="beforeMain",_h="main",Fh="afterMain",Dh="beforeWrite",Ih="write",Ah="afterWrite",xh=[Eh,wh,Oh,Th,_h,Fh,Dh,Ih,Ah];function we(t){return t?(t.nodeName||"").toLowerCase():null}function oe(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function at(t){var e=oe(t).Element;return t instanceof e||t instanceof Element}function fe(t){var e=oe(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Li(t){if(typeof ShadowRoot>"u")return!1;var e=oe(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Ch(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},a=e.elements[n];!fe(a)||!we(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function Ph(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],a=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),s=o.reduce(function(c,u){return c[u]="",c},{});!fe(i)||!we(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(c){i.removeAttribute(c)}))})}}const Rh={name:"applyStyles",enabled:!0,phase:"write",fn:Ch,effect:Ph,requires:["computeStyles"]};function Oe(t){return t.split("-")[0]}var ot=Math.max,ur=Math.min,At=Math.round;function qi(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ls(){return!/^((?!chrome|android).)*safari/i.test(qi())}function xt(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,a=1;e&&fe(t)&&(i=t.offsetWidth>0&&At(r.width)/t.offsetWidth||1,a=t.offsetHeight>0&&At(r.height)/t.offsetHeight||1);var o=at(t)?oe(t):window,s=o.visualViewport,c=!Ls()&&n,u=(r.left+(c&&s?s.offsetLeft:0))/i,l=(r.top+(c&&s?s.offsetTop:0))/a,f=r.width/i,d=r.height/a;return{width:f,height:d,top:l,right:u+f,bottom:l+d,left:u,x:u,y:l}}function Vi(t){var e=xt(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function qs(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Li(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ae(t){return oe(t).getComputedStyle(t)}function Mh(t){return["table","td","th"].indexOf(we(t))>=0}function He(t){return((at(t)?t.ownerDocument:t.document)||window.document).documentElement}function cr(t){return we(t)==="html"?t:t.assignedSlot||t.parentNode||(Li(t)?t.host:null)||He(t)}function Vs(t){return!fe(t)||Ae(t).position==="fixed"?null:t.offsetParent}function jh(t){var e=/firefox/i.test(qi()),n=/Trident/i.test(qi());if(n&&fe(t)){var r=Ae(t);if(r.position==="fixed")return null}var i=cr(t);for(Li(i)&&(i=i.host);fe(i)&&["html","body"].indexOf(we(i))<0;){var a=Ae(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||e&&a.willChange==="filter"||e&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function fn(t){for(var e=oe(t),n=Vs(t);n&&Mh(n)&&Ae(n).position==="static";)n=Vs(n);return n&&(we(n)==="html"||we(n)==="body"&&Ae(n).position==="static")?e:n||jh(t)||e}function Ui(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function pn(t,e,n){return ot(t,ur(e,n))}function Lh(t,e,n){var r=pn(t,e,n);return r>n?n:r}function Us(){return{top:0,right:0,bottom:0,left:0}}function Bs(t){return Object.assign({},Us(),t)}function Qs(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var qh=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Bs(typeof e!="number"?e:Qs(e,cn))};function Vh(t){var e,n=t.state,r=t.name,i=t.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=Oe(n.placement),c=Ui(s),u=[ie,de].indexOf(s)>=0,l=u?"height":"width";if(!(!a||!o)){var f=qh(i.padding,n),d=Vi(a),p=c==="y"?re:ie,h=c==="y"?le:de,y=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],m=o[c]-n.rects.reference[c],v=fn(a),b=v?c==="y"?v.clientHeight||0:v.clientWidth||0:0,k=y/2-m/2,S=f[p],E=b-d[l]-f[h],w=b/2-d[l]/2+k,O=pn(S,w,E),F=c;n.modifiersData[r]=(e={},e[F]=O,e.centerOffset=O-w,e)}}function Uh(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||qs(e.elements.popper,i)&&(e.elements.arrow=i))}const Bh={name:"arrow",enabled:!0,phase:"main",fn:Vh,effect:Uh,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ct(t){return t.split("-")[1]}var Qh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wh(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:At(n*i)/i||0,y:At(r*i)/i||0}}function Ws(t){var e,n=t.popper,r=t.popperRect,i=t.placement,a=t.variation,o=t.offsets,s=t.position,c=t.gpuAcceleration,u=t.adaptive,l=t.roundOffsets,f=t.isFixed,d=o.x,p=d===void 0?0:d,h=o.y,y=h===void 0?0:h,m=typeof l=="function"?l({x:p,y}):{x:p,y};p=m.x,y=m.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),k=ie,S=re,E=window;if(u){var w=fn(n),O="clientHeight",F="clientWidth";if(w===oe(n)&&(w=He(n),Ae(w).position!=="static"&&s==="absolute"&&(O="scrollHeight",F="scrollWidth")),w=w,i===re||(i===ie||i===de)&&a===ln){S=le;var I=f&&w===E&&E.visualViewport?E.visualViewport.height:w[O];y-=I-r.height,y*=c?1:-1}if(i===ie||(i===re||i===le)&&a===ln){k=de;var x=f&&w===E&&E.visualViewport?E.visualViewport.width:w[F];p-=x-r.width,p*=c?1:-1}}var q=Object.assign({position:s},u&&Qh),K=l===!0?Wh({x:p,y},oe(n)):{x:p,y};if(p=K.x,y=K.y,c){var M;return Object.assign({},q,(M={},M[S]=b?"0":"",M[k]=v?"0":"",M.transform=(E.devicePixelRatio||1)<=1?"translate("+p+"px, "+y+"px)":"translate3d("+p+"px, "+y+"px, 0)",M))}return Object.assign({},q,(e={},e[S]=b?y+"px":"",e[k]=v?p+"px":"",e.transform="",e))}function zh(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,s=n.roundOffsets,c=s===void 0?!0:s,u={placement:Oe(e.placement),variation:Ct(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Ws(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ws(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const $h={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:zh,data:{}};var lr={passive:!0};function Kh(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,a=i===void 0?!0:i,o=r.resize,s=o===void 0?!0:o,c=oe(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&u.forEach(function(l){l.addEventListener("scroll",n.update,lr)}),s&&c.addEventListener("resize",n.update,lr),function(){a&&u.forEach(function(l){l.removeEventListener("scroll",n.update,lr)}),s&&c.removeEventListener("resize",n.update,lr)}}const Gh={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Kh,data:{}};var Jh={left:"right",right:"left",bottom:"top",top:"bottom"};function dr(t){return t.replace(/left|right|bottom|top/g,function(e){return Jh[e]})}var Hh={start:"end",end:"start"};function zs(t){return t.replace(/start|end/g,function(e){return Hh[e]})}function Bi(t){var e=oe(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Qi(t){return xt(He(t)).left+Bi(t).scrollLeft}function Yh(t,e){var n=oe(t),r=He(t),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var u=Ls();(u||!u&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+Qi(t),y:c}}function Xh(t){var e,n=He(t),r=Bi(t),i=(e=t.ownerDocument)==null?void 0:e.body,a=ot(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=ot(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Qi(t),c=-r.scrollTop;return Ae(i||n).direction==="rtl"&&(s+=ot(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:c}}function Wi(t){var e=Ae(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function $s(t){return["html","body","#document"].indexOf(we(t))>=0?t.ownerDocument.body:fe(t)&&Wi(t)?t:$s(cr(t))}function hn(t,e){var n;e===void 0&&(e=[]);var r=$s(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),a=oe(r),o=i?[a].concat(a.visualViewport||[],Wi(r)?r:[]):r,s=e.concat(o);return i?s:s.concat(hn(cr(o)))}function zi(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Zh(t,e){var n=xt(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Ks(t,e,n){return e===Rs?zi(Yh(t,n)):at(e)?Zh(e,n):zi(Xh(He(t)))}function em(t){var e=hn(cr(t)),n=["absolute","fixed"].indexOf(Ae(t).position)>=0,r=n&&fe(t)?fn(t):t;return at(r)?e.filter(function(i){return at(i)&&qs(i,r)&&we(i)!=="body"}):[]}function tm(t,e,n,r){var i=e==="clippingParents"?em(t):[].concat(e),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(c,u){var l=Ks(t,u,r);return c.top=ot(l.top,c.top),c.right=ur(l.right,c.right),c.bottom=ur(l.bottom,c.bottom),c.left=ot(l.left,c.left),c},Ks(t,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Gs(t){var e=t.reference,n=t.element,r=t.placement,i=r?Oe(r):null,a=r?Ct(r):null,o=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,c;switch(i){case re:c={x:o,y:e.y-n.height};break;case le:c={x:o,y:e.y+e.height};break;case de:c={x:e.x+e.width,y:s};break;case ie:c={x:e.x-n.width,y:s};break;default:c={x:e.x,y:e.y}}var u=i?Ui(i):null;if(u!=null){var l=u==="y"?"height":"width";switch(a){case It:c[u]=c[u]-(e[l]/2-n[l]/2);break;case ln:c[u]=c[u]+(e[l]/2-n[l]/2);break}}return c}function mn(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,a=n.strategy,o=a===void 0?t.strategy:a,s=n.boundary,c=s===void 0?Nh:s,u=n.rootBoundary,l=u===void 0?Rs:u,f=n.elementContext,d=f===void 0?dn:f,p=n.altBoundary,h=p===void 0?!1:p,y=n.padding,m=y===void 0?0:y,v=Bs(typeof m!="number"?m:Qs(m,cn)),b=d===dn?Sh:dn,k=t.rects.popper,S=t.elements[h?b:d],E=tm(at(S)?S:S.contextElement||He(t.elements.popper),c,l,o),w=xt(t.elements.reference),O=Gs({reference:w,element:k,strategy:"absolute",placement:i}),F=zi(Object.assign({},k,O)),I=d===dn?F:w,x={top:E.top-I.top+v.top,bottom:I.bottom-E.bottom+v.bottom,left:E.left-I.left+v.left,right:I.right-E.right+v.right},q=t.modifiersData.offset;if(d===dn&&q){var K=q[i];Object.keys(x).forEach(function(M){var $=[de,le].indexOf(M)>=0?1:-1,se=[re,le].indexOf(M)>=0?"y":"x";x[M]+=K[se]*$})}return x}function nm(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?js:c,l=Ct(r),f=l?s?Ms:Ms.filter(function(h){return Ct(h)===l}):cn,d=f.filter(function(h){return u.indexOf(h)>=0});d.length===0&&(d=f);var p=d.reduce(function(h,y){return h[y]=mn(t,{placement:y,boundary:i,rootBoundary:a,padding:o})[Oe(y)],h},{});return Object.keys(p).sort(function(h,y){return p[h]-p[y]})}function rm(t){if(Oe(t)===ji)return[];var e=dr(t);return[zs(t),e,zs(e)]}function im(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!0:o,c=n.fallbackPlacements,u=n.padding,l=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,y=n.allowedAutoPlacements,m=e.options.placement,v=Oe(m),b=v===m,k=c||(b||!h?[dr(m)]:rm(m)),S=[m].concat(k).reduce(function(xe,Xe){return xe.concat(Oe(Xe)===ji?nm(e,{placement:Xe,boundary:l,rootBoundary:f,padding:u,flipVariations:h,allowedAutoPlacements:y}):Xe)},[]),E=e.rects.reference,w=e.rects.popper,O=new Map,F=!0,I=S[0],x=0;x<S.length;x++){var q=S[x],K=Oe(q),M=Ct(q)===It,$=[re,le].indexOf(K)>=0,se=$?"width":"height",J=mn(e,{placement:q,boundary:l,rootBoundary:f,altBoundary:d,padding:u}),ue=$?M?de:ie:M?le:re;E[se]>w[se]&&(ue=dr(ue));var st=dr(ue),H=[];if(a&&H.push(J[K]<=0),s&&H.push(J[ue]<=0,J[st]<=0),H.every(function(xe){return xe})){I=q,F=!1;break}O.set(q,H)}if(F)for(var Pt=h?3:1,Rt=function(Xe){var vn=S.find(function(pr){var ut=O.get(pr);if(ut)return ut.slice(0,Xe).every(function($i){return $i})});if(vn)return I=vn,"break"},pe=Pt;pe>0;pe--){var Ye=Rt(pe);if(Ye==="break")break}e.placement!==I&&(e.modifiersData[r]._skip=!0,e.placement=I,e.reset=!0)}}const am={name:"flip",enabled:!0,phase:"main",fn:im,requiresIfExists:["offset"],data:{_skip:!1}};function Js(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Hs(t){return[re,de,le,ie].some(function(e){return t[e]>=0})}function om(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=mn(e,{elementContext:"reference"}),s=mn(e,{altBoundary:!0}),c=Js(o,r),u=Js(s,i,a),l=Hs(c),f=Hs(u);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:l,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}const sm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:om};function um(t,e,n){var r=Oe(t),i=[ie,re].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[ie,de].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function cm(t){var e=t.state,n=t.options,r=t.name,i=n.offset,a=i===void 0?[0,0]:i,o=js.reduce(function(l,f){return l[f]=um(f,e.rects,a),l},{}),s=o[e.placement],c=s.x,u=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=o}const lm={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:cm};function dm(t){var e=t.state,n=t.name;e.modifiersData[n]=Gs({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const fm={name:"popperOffsets",enabled:!0,phase:"read",fn:dm,data:{}};function pm(t){return t==="x"?"y":"x"}function hm(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!1:o,c=n.boundary,u=n.rootBoundary,l=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,h=n.tetherOffset,y=h===void 0?0:h,m=mn(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:l}),v=Oe(e.placement),b=Ct(e.placement),k=!b,S=Ui(v),E=pm(S),w=e.modifiersData.popperOffsets,O=e.rects.reference,F=e.rects.popper,I=typeof y=="function"?y(Object.assign({},e.rects,{placement:e.placement})):y,x=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),q=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,K={x:0,y:0};if(w){if(a){var M,$=S==="y"?re:ie,se=S==="y"?le:de,J=S==="y"?"height":"width",ue=w[S],st=ue+m[$],H=ue-m[se],Pt=p?-F[J]/2:0,Rt=b===It?O[J]:F[J],pe=b===It?-F[J]:-O[J],Ye=e.elements.arrow,xe=p&&Ye?Vi(Ye):{width:0,height:0},Xe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Us(),vn=Xe[$],pr=Xe[se],ut=pn(0,O[J],xe[J]),$i=k?O[J]/2-Pt-ut-vn-x.mainAxis:Rt-ut-vn-x.mainAxis,Vm=k?-O[J]/2+Pt+ut+pr+x.mainAxis:pe+ut+pr+x.mainAxis,Ki=e.elements.arrow&&fn(e.elements.arrow),Um=Ki?S==="y"?Ki.clientTop||0:Ki.clientLeft||0:0,eu=(M=q==null?void 0:q[S])!=null?M:0,Bm=ue+$i-eu-Um,Qm=ue+Vm-eu,tu=pn(p?ur(st,Bm):st,ue,p?ot(H,Qm):H);w[S]=tu,K[S]=tu-ue}if(s){var nu,Wm=S==="x"?re:ie,zm=S==="x"?le:de,ct=w[E],hr=E==="y"?"height":"width",ru=ct+m[Wm],iu=ct-m[zm],Gi=[re,ie].indexOf(v)!==-1,au=(nu=q==null?void 0:q[E])!=null?nu:0,ou=Gi?ru:ct-O[hr]-F[hr]-au+x.altAxis,su=Gi?ct+O[hr]+F[hr]-au-x.altAxis:iu,uu=p&&Gi?Lh(ou,ct,su):pn(p?ou:ru,ct,p?su:iu);w[E]=uu,K[E]=uu-ct}e.modifiersData[r]=K}}const mm={name:"preventOverflow",enabled:!0,phase:"main",fn:hm,requiresIfExists:["offset"]};function vm(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function ym(t){return t===oe(t)||!fe(t)?Bi(t):vm(t)}function gm(t){var e=t.getBoundingClientRect(),n=At(e.width)/t.offsetWidth||1,r=At(e.height)/t.offsetHeight||1;return n!==1||r!==1}function km(t,e,n){n===void 0&&(n=!1);var r=fe(e),i=fe(e)&&gm(e),a=He(e),o=xt(t,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((we(e)!=="body"||Wi(a))&&(s=ym(e)),fe(e)?(c=xt(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=Qi(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function bm(t){var e=new Map,n=new Set,r=[];t.forEach(function(a){e.set(a.name,a)});function i(a){n.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!n.has(s)){var c=e.get(s);c&&i(c)}}),r.push(a)}return t.forEach(function(a){n.has(a.name)||i(a)}),r}function Nm(t){var e=bm(t);return xh.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function Sm(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Em(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Ys={placement:"bottom",modifiers:[],strategy:"absolute"};function Xs(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function wm(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,a=i===void 0?Ys:i;return function(s,c,u){u===void 0&&(u=a);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ys,a),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},f=[],d=!1,p={state:l,setOptions:function(v){var b=typeof v=="function"?v(l.options):v;y(),l.options=Object.assign({},a,l.options,b),l.scrollParents={reference:at(s)?hn(s):s.contextElement?hn(s.contextElement):[],popper:hn(c)};var k=Nm(Em([].concat(r,l.options.modifiers)));return l.orderedModifiers=k.filter(function(S){return S.enabled}),h(),p.update()},forceUpdate:function(){if(!d){var v=l.elements,b=v.reference,k=v.popper;if(Xs(b,k)){l.rects={reference:km(b,fn(k),l.options.strategy==="fixed"),popper:Vi(k)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(x){return l.modifiersData[x.name]=Object.assign({},x.data)});for(var S=0;S<l.orderedModifiers.length;S++){if(l.reset===!0){l.reset=!1,S=-1;continue}var E=l.orderedModifiers[S],w=E.fn,O=E.options,F=O===void 0?{}:O,I=E.name;typeof w=="function"&&(l=w({state:l,options:F,name:I,instance:p})||l)}}}},update:Sm(function(){return new Promise(function(m){p.forceUpdate(),m(l)})}),destroy:function(){y(),d=!0}};if(!Xs(s,c))return p;p.setOptions(u).then(function(m){!d&&u.onFirstUpdate&&u.onFirstUpdate(m)});function h(){l.orderedModifiers.forEach(function(m){var v=m.name,b=m.options,k=b===void 0?{}:b,S=m.effect;if(typeof S=="function"){var E=S({state:l,name:v,instance:p,options:k}),w=function(){};f.push(E||w)}})}function y(){f.forEach(function(m){return m()}),f=[]}return p}}var Om=[Gh,fm,$h,Rh,lm,am,mm,Bh,sm],Tm=wm({defaultModifiers:Om}),_m=typeof Element<"u",Fm=typeof Map=="function",Dm=typeof Set=="function",Im=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function fr(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!fr(t[r],e[r]))return!1;return!0}var a;if(Fm&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a=t.entries();!(r=a.next()).done;)if(!e.has(r.value[0]))return!1;for(a=t.entries();!(r=a.next()).done;)if(!fr(r.value[1],e.get(r.value[0])))return!1;return!0}if(Dm&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a=t.entries();!(r=a.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(Im&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(_m&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&t.$$typeof)&&!fr(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}var Am=function(e,n){try{return fr(e,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const xm=ws(Am);var Cm=[],Pm=function(e,n,r){r===void 0&&(r={});var i=C.useRef(null),a={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||Cm},o=C.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=o[0],c=o[1],u=C.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(p){var h=p.state,y=Object.keys(h.elements);lu.flushSync(function(){c({styles:Cs(y.map(function(m){return[m,h.styles[m]||{}]})),attributes:Cs(y.map(function(m){return[m,h.attributes[m]]}))})})},requires:["computeStyles"]}},[]),l=C.useMemo(function(){var d={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return xm(i.current,d)?i.current||d:(i.current=d,d)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),f=C.useRef();return Ps(function(){f.current&&f.current.setOptions(l)},[l]),Ps(function(){if(!(e==null||n==null)){var d=r.createPopper||Tm,p=d(e,n,l);return f.current=p,function(){p.destroy(),f.current=null}}},[e,n,r.createPopper]),{state:f.current?f.current.state:null,styles:s.styles,attributes:s.attributes,update:f.current?f.current.update:null,forceUpdate:f.current?f.current.forceUpdate:null}};const Rm=()=>{const[t,e]=D.useState(null),[n,r]=D.useState(null),{styles:i,attributes:a}=Pm(n,t,{placement:"bottom-end"}),[o,s]=D.useState(!1);let{markNotificationAsRead:c,markNotificationAsUnread:u,notifications:l,unreadNotificationsCount:f,fetchInAppNotifications:d}=xs();D.useEffect(()=>{o&&d()},[o]);const p=()=>l.length<1?D.createElement("p",{className:"text-black"},"No Notifications"):l.map(h=>{let y=new Date(h.sentAt||new Date).toLocaleString();return D.createElement("div",{className:`flex justify-between px-4 py-2 [&:not(:last-child)]:border-b-2 ${h.readAt?"bg-gray-500":"bg-gray-700"}`,key:h.id},D.createElement("p",null,h.renderedContent.body),D.createElement("div",{className:"flex items-center"},D.createElement("p",{className:"pr-2"},y),h.readAt?D.createElement(vh,{className:"h-4 w-4 cursor-pointer",onClick:()=>u(h.id)}):D.createElement(gh,{className:"h-4 w-4 cursor-pointer",onClick:()=>c(h.id)})))});return D.createElement(D.Fragment,null,D.createElement(hh,{"aria-hidden":"true",className:`h-6 w-6 ${f&&"text-red-600"}`,onClick:()=>s(!o),ref:r}),o&&D.createElement("div",{ref:e,style:i.popper,...a.popper,className:"rounded-xl text-white cursor-default overflow-hidden"},D.createElement("div",{className:"flex justify-between items-center border-y-2 border-white px-4 py-2 bg-gray-900 text-white"},D.createElement("div",{className:"flex items-center"},D.createElement("p",null,"Notifications"),!!f&&D.createElement("p",{className:"pl-2 text-red-600"},f)),D.createElement(bh,{height:20,width:20,className:"cursor-pointer",onClick:()=>s(!1)})),D.createElement("div",{className:"bg-white h-96 w-96 overflow-scroll"},p()),D.createElement("p",{className:"bold px-4 py-2 bg-gray-900"},"Powered by DashX")))},Mm=({preference:t,onChange:e})=>{const n=r=>{e(r,t)};return React.createElement("div",null,React.createElement("p",null,t[0]),React.createElement("label",null,"Email",React.createElement("input",{name:"email",type:"checkbox",defaultChecked:t[1].email,onChange:n})),React.createElement("label",null,"Push",React.createElement("input",{name:"push",type:"checkbox",defaultChecked:t[1].push,onChange:n})),React.createElement("label",null,"SMS",React.createElement("input",{name:"sms",type:"checkbox",defaultChecked:t[1].sms,onChange:n})),React.createElement("label",null,"Whatsapp",React.createElement("input",{name:"whatsapp",type:"checkbox",defaultChecked:t[1].whatsapp,onChange:n})),React.createElement("br",null))};function Zs({preference:t,onChange:e,renderPreference:n=Mm}){return n({preference:t,onChange:e})}const jm=({preferences:t,onChange:e,loading:n})=>t?D.createElement(D.Fragment,null,t.map(r=>D.createElement(Zs,{key:r[0],preference:r,onChange:e}))):n?D.createElement(D.Fragment,null,"Loading..."):D.createElement(D.Fragment,null,"An unexpected error ocurred");function Lm({renderPreferences:t=jm}){const e=Di(),[n,r]=D.useState(null),[i,a]=D.useState(!0),[o,s]=D.useState(null),[c,u]=D.useState(!1),l=(f,d)=>{u(!0);const[p,h]=d;r(y=>({...y||{},[p]:{...h,[f.target.name]:f.target.checked}}))};return D.useEffect(()=>{if(!c)return;const f=setTimeout(async()=>{await e.saveStoredPreferences(n),u(!1)},100);return()=>clearTimeout(f)},[n,c,e]),D.useEffect(()=>{async function f(){a(!0);try{const d=await e.fetchStoredPreferences();r(d)}catch(d){s(d)}finally{a(!1)}}f()},[e]),t({preferences:n&&Object.entries(n).map(([f,d])=>[f,d]),onChange:l,loading:i,error:o})}const qm=t=>D.createElement(D.Fragment,null,D.createElement(Np,{toastOptions:{className:"bg-gray-900 text-white"},...t}));ne.DashXProvider=Af,ne.NotificationBell=Rm,ne.Preference=Zs,ne.Preferences=Lm,ne.Toast=qm,ne.useDashXProvider=Di,ne.useInApp=xs,Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"})});