@weng-lab/genomebrowser 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/tracks/ld/ld.d.ts +1 -1
- package/dist/components/tracks/types.d.ts +2 -0
- package/dist/gbc.cjs.js +72 -72
- package/dist/gbc.cjs.js.map +1 -1
- package/dist/gbc.es.js +3484 -3351
- package/dist/gbc.es.js.map +1 -1
- package/dist/gbc.umd.js +56 -56
- package/dist/gbc.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/gbc.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(xe,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],p):(xe=typeof globalThis<"u"?globalThis:xe||self,p(xe.gb={},xe["react/jsx-runtime"],xe.React,xe.ReactDOM))})(this,function(xe,p,w,tn){"use strict";function Df(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}function Mf(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const
|
|
1
|
+
(function(xe,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],p):(xe=typeof globalThis<"u"?globalThis:xe||self,p(xe.gb={},xe["react/jsx-runtime"],xe.React,xe.ReactDOM))})(this,function(xe,p,w,tn){"use strict";function Df(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}function Mf(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const Hn=Df(w),Lf=`M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946
|
|
2
2
|
s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634
|
|
3
3
|
c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z`,If=`M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0
|
|
4
4
|
C22.32,8.481,24.301,9.057,26.013,10.047z`,Pf=({width:e,height:t})=>p.jsxs("svg",{width:e,height:t,viewBox:"0 0 40 40",children:[p.jsx("path",{opacity:"0.2",fill:"#000",d:Lf}),p.jsx("path",{fill:"#000",d:If,children:p.jsx("animateTransform",{attributeType:"xml",attributeName:"transform",type:"rotate",from:"0 20 20",to:"360 20 20",dur:"0.5s",repeatCount:"indefinite"})})]}),Nf=`M446.324,367.381L262.857,41.692c-15.644-28.444-58.311-28.444-73.956,0L5.435,367.381
|
|
@@ -27,28 +27,28 @@ C207.39,178.225,194.59,193.87,196.013,212.359z`,Yo=({width:e,height:t})=>p.jsxs(
|
|
|
27
27
|
C23,2.35,23.35,2,23.78,2h6.439C30.65,2,31,2.35,31,2.78v5.052c0,1.624,0.932,3.019,2.432,3.64\r
|
|
28
28
|
c1.502,0.622,3.146,0.294,4.294-0.854l3.571-3.571c0.306-0.305,0.801-0.305,1.104,0l4.553,4.553c0.305,0.305,0.305,0.8,0,1.104\r
|
|
29
29
|
l-3.572,3.571c-1.148,1.148-1.476,2.794-0.854,4.294c0.621,1.5,2.016,2.432,3.64,2.432h5.052C51.65,23,52,23.35,52,23.78V30.22z`}),p.jsx("path",{d:`M27,18c-4.963,0-9,4.037-9,9s4.037,9,9,9s9-4.037,9-9S31.963,18,27,18z M27,34c-3.859,0-7-3.141-7-7s3.141-7,7-7\r
|
|
30
|
-
s7,3.141,7,7S30.859,34,27,34z`})]})})}var Rf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ko(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jf(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var
|
|
30
|
+
s7,3.141,7,7S30.859,34,27,34z`})]})})}var Rf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ko(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jf(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var zn={exports:{}},Xo={},Gi={exports:{}},Qn={exports:{}},ke={};/** @license React v16.13.1
|
|
31
31
|
* react-is.production.min.js
|
|
32
32
|
*
|
|
33
33
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the MIT license found in the
|
|
36
36
|
* LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/var Jo;function Vf(){if(Jo)return ke;Jo=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,T=e?Symbol.for("react.fundamental"):60117,
|
|
37
|
+
*/var Jo;function Vf(){if(Jo)return ke;Jo=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,T=e?Symbol.for("react.fundamental"):60117,O=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function m(S){if(typeof S=="object"&&S!==null){var P=S.$$typeof;switch(P){case t:switch(S=S.type,S){case c:case u:case n:case a:case i:case d:return S;default:switch(S=S&&S.$$typeof,S){case s:case l:case E:case v:case o:return S;default:return P}}case r:return P}}}function C(S){return m(S)===u}return ke.AsyncMode=c,ke.ConcurrentMode=u,ke.ContextConsumer=s,ke.ContextProvider=o,ke.Element=t,ke.ForwardRef=l,ke.Fragment=n,ke.Lazy=E,ke.Memo=v,ke.Portal=r,ke.Profiler=a,ke.StrictMode=i,ke.Suspense=d,ke.isAsyncMode=function(S){return C(S)||m(S)===c},ke.isConcurrentMode=C,ke.isContextConsumer=function(S){return m(S)===s},ke.isContextProvider=function(S){return m(S)===o},ke.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},ke.isForwardRef=function(S){return m(S)===l},ke.isFragment=function(S){return m(S)===n},ke.isLazy=function(S){return m(S)===E},ke.isMemo=function(S){return m(S)===v},ke.isPortal=function(S){return m(S)===r},ke.isProfiler=function(S){return m(S)===a},ke.isStrictMode=function(S){return m(S)===i},ke.isSuspense=function(S){return m(S)===d},ke.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===n||S===u||S===a||S===i||S===d||S===f||typeof S=="object"&&S!==null&&(S.$$typeof===E||S.$$typeof===v||S.$$typeof===o||S.$$typeof===s||S.$$typeof===l||S.$$typeof===T||S.$$typeof===O||S.$$typeof===_||S.$$typeof===x)},ke.typeOf=m,ke}var De={};/** @license React v16.13.1
|
|
38
38
|
* react-is.development.js
|
|
39
39
|
*
|
|
40
40
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
41
41
|
*
|
|
42
42
|
* This source code is licensed under the MIT license found in the
|
|
43
43
|
* LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/var Zo;function qf(){return Zo||(Zo=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,T=e?Symbol.for("react.fundamental"):60117,
|
|
44
|
+
*/var Zo;function qf(){return Zo||(Zo=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,T=e?Symbol.for("react.fundamental"):60117,O=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function m(L){return typeof L=="string"||typeof L=="function"||L===n||L===u||L===a||L===i||L===d||L===f||typeof L=="object"&&L!==null&&(L.$$typeof===E||L.$$typeof===v||L.$$typeof===o||L.$$typeof===s||L.$$typeof===l||L.$$typeof===T||L.$$typeof===O||L.$$typeof===_||L.$$typeof===x)}function C(L){if(typeof L=="object"&&L!==null){var ae=L.$$typeof;switch(ae){case t:var ce=L.type;switch(ce){case c:case u:case n:case a:case i:case d:return ce;default:var oe=ce&&ce.$$typeof;switch(oe){case s:case l:case E:case v:case o:return oe;default:return ae}}case r:return ae}}}var S=c,P=u,A=s,j=o,U=t,V=l,me=n,Le=E,ye=v,Se=r,Ve=a,Pe=i,Y=d,$=!1;function Z(L){return $||($=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),N(L)||C(L)===c}function N(L){return C(L)===u}function R(L){return C(L)===s}function K(L){return C(L)===o}function se(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function ee(L){return C(L)===l}function ge(L){return C(L)===n}function W(L){return C(L)===E}function ie(L){return C(L)===v}function ve(L){return C(L)===r}function le(L){return C(L)===a}function pe(L){return C(L)===i}function I(L){return C(L)===d}De.AsyncMode=S,De.ConcurrentMode=P,De.ContextConsumer=A,De.ContextProvider=j,De.Element=U,De.ForwardRef=V,De.Fragment=me,De.Lazy=Le,De.Memo=ye,De.Portal=Se,De.Profiler=Ve,De.StrictMode=Pe,De.Suspense=Y,De.isAsyncMode=Z,De.isConcurrentMode=N,De.isContextConsumer=R,De.isContextProvider=K,De.isElement=se,De.isForwardRef=ee,De.isFragment=ge,De.isLazy=W,De.isMemo=ie,De.isPortal=ve,De.isProfiler=le,De.isStrictMode=pe,De.isSuspense=I,De.isValidElementType=m,De.typeOf=C}()),De}var es;function ts(){return es||(es=1,process.env.NODE_ENV==="production"?Qn.exports=Vf():Qn.exports=qf()),Qn.exports}/*
|
|
45
45
|
object-assign
|
|
46
46
|
(c) Sindre Sorhus
|
|
47
47
|
@license MIT
|
|
48
|
-
*/var Yi,rs;function $f(){if(rs)return Yi;rs=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function i(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},s=0;s<10;s++)o["_"+String.fromCharCode(s)]=s;var c=Object.getOwnPropertyNames(o).map(function(l){return o[l]});if(c.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(l){u[l]=l}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Yi=i()?Object.assign:function(a,o){for(var s,c=n(a),u,l=1;l<arguments.length;l++){s=Object(arguments[l]);for(var d in s)t.call(s,d)&&(c[d]=s[d]);if(e){u=e(s);for(var f=0;f<u.length;f++)r.call(s,u[f])&&(c[u[f]]=s[u[f]])}}return c},Yi}var Ki,ns;function Xi(){if(ns)return Ki;ns=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ki=e,Ki}var Ji,is;function as(){return is||(is=1,Ji=Function.call.bind(Object.prototype.hasOwnProperty)),Ji}var Zi,os;function Uf(){if(os)return Zi;os=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Xi(),r={},n=as();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(a,o,s,c,u){if(process.env.NODE_ENV!=="production"){for(var l in a)if(n(a,l)){var d;try{if(typeof a[l]!="function"){var f=Error((c||"React class")+": "+s+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=a[l](o,l,c,s,null,t)}catch(E){d=E}if(d&&!(d instanceof Error)&&e((c||"React class")+": type specification of "+s+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in r)){r[d.message]=!0;var v=u?u():"";e("Failed "+s+" type: "+d.message+(v??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},Zi=i,Zi}var ea,ss;function Bf(){if(ss)return ea;ss=1;var e=ts(),t=$f(),r=Xi(),n=as(),i=Uf(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function o(){return null}return ea=function(s,c){var u=typeof Symbol=="function"&&Symbol.iterator,l="@@iterator";function d(N){var R=N&&(u&&N[u]||N[l]);if(typeof R=="function")return R}var f="<<anonymous>>",v={array:
|
|
49
|
-
Valid keys: `+JSON.stringify(Object.keys(N),null," "));var L=I(ie,pe,ee,ge,
|
|
48
|
+
*/var Yi,rs;function $f(){if(rs)return Yi;rs=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function i(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},s=0;s<10;s++)o["_"+String.fromCharCode(s)]=s;var c=Object.getOwnPropertyNames(o).map(function(l){return o[l]});if(c.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(l){u[l]=l}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Yi=i()?Object.assign:function(a,o){for(var s,c=n(a),u,l=1;l<arguments.length;l++){s=Object(arguments[l]);for(var d in s)t.call(s,d)&&(c[d]=s[d]);if(e){u=e(s);for(var f=0;f<u.length;f++)r.call(s,u[f])&&(c[u[f]]=s[u[f]])}}return c},Yi}var Ki,ns;function Xi(){if(ns)return Ki;ns=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ki=e,Ki}var Ji,is;function as(){return is||(is=1,Ji=Function.call.bind(Object.prototype.hasOwnProperty)),Ji}var Zi,os;function Uf(){if(os)return Zi;os=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Xi(),r={},n=as();e=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(a,o,s,c,u){if(process.env.NODE_ENV!=="production"){for(var l in a)if(n(a,l)){var d;try{if(typeof a[l]!="function"){var f=Error((c||"React class")+": "+s+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=a[l](o,l,c,s,null,t)}catch(E){d=E}if(d&&!(d instanceof Error)&&e((c||"React class")+": type specification of "+s+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in r)){r[d.message]=!0;var v=u?u():"";e("Failed "+s+" type: "+d.message+(v??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},Zi=i,Zi}var ea,ss;function Bf(){if(ss)return ea;ss=1;var e=ts(),t=$f(),r=Xi(),n=as(),i=Uf(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function o(){return null}return ea=function(s,c){var u=typeof Symbol=="function"&&Symbol.iterator,l="@@iterator";function d(N){var R=N&&(u&&N[u]||N[l]);if(typeof R=="function")return R}var f="<<anonymous>>",v={array:O("array"),bigint:O("bigint"),bool:O("boolean"),func:O("function"),number:O("number"),object:O("object"),string:O("string"),symbol:O("symbol"),any:_(),arrayOf:m,element:C(),elementType:S(),instanceOf:P,node:V(),objectOf:j,oneOf:A,oneOfType:U,shape:Le,exact:ye};function E(N,R){return N===R?N!==0||1/N===1/R:N!==N&&R!==R}function x(N,R){this.message=N,this.data=R&&typeof R=="object"?R:{},this.stack=""}x.prototype=Error.prototype;function T(N){if(process.env.NODE_ENV!=="production")var R={},K=0;function se(ge,W,ie,ve,le,pe,I){if(ve=ve||f,pe=pe||ie,I!==r){if(c){var L=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw L.name="Invariant Violation",L}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ae=ve+":"+ie;!R[ae]&&K<3&&(a("You are manually calling a React.PropTypes validation function for the `"+pe+"` prop on `"+ve+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),R[ae]=!0,K++)}}return W[ie]==null?ge?W[ie]===null?new x("The "+le+" `"+pe+"` is marked as required "+("in `"+ve+"`, but its value is `null`.")):new x("The "+le+" `"+pe+"` is marked as required in "+("`"+ve+"`, but its value is `undefined`.")):null:N(W,ie,ve,le,pe)}var ee=se.bind(null,!1);return ee.isRequired=se.bind(null,!0),ee}function O(N){function R(K,se,ee,ge,W,ie){var ve=K[se],le=Pe(ve);if(le!==N){var pe=Y(ve);return new x("Invalid "+ge+" `"+W+"` of type "+("`"+pe+"` supplied to `"+ee+"`, expected ")+("`"+N+"`."),{expectedType:N})}return null}return T(R)}function _(){return T(o)}function m(N){function R(K,se,ee,ge,W){if(typeof N!="function")return new x("Property `"+W+"` of component `"+ee+"` has invalid PropType notation inside arrayOf.");var ie=K[se];if(!Array.isArray(ie)){var ve=Pe(ie);return new x("Invalid "+ge+" `"+W+"` of type "+("`"+ve+"` supplied to `"+ee+"`, expected an array."))}for(var le=0;le<ie.length;le++){var pe=N(ie,le,ee,ge,W+"["+le+"]",r);if(pe instanceof Error)return pe}return null}return T(R)}function C(){function N(R,K,se,ee,ge){var W=R[K];if(!s(W)){var ie=Pe(W);return new x("Invalid "+ee+" `"+ge+"` of type "+("`"+ie+"` supplied to `"+se+"`, expected a single ReactElement."))}return null}return T(N)}function S(){function N(R,K,se,ee,ge){var W=R[K];if(!e.isValidElementType(W)){var ie=Pe(W);return new x("Invalid "+ee+" `"+ge+"` of type "+("`"+ie+"` supplied to `"+se+"`, expected a single ReactElement type."))}return null}return T(N)}function P(N){function R(K,se,ee,ge,W){if(!(K[se]instanceof N)){var ie=N.name||f,ve=Z(K[se]);return new x("Invalid "+ge+" `"+W+"` of type "+("`"+ve+"` supplied to `"+ee+"`, expected ")+("instance of `"+ie+"`."))}return null}return T(R)}function A(N){if(!Array.isArray(N))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function R(K,se,ee,ge,W){for(var ie=K[se],ve=0;ve<N.length;ve++)if(E(ie,N[ve]))return null;var le=JSON.stringify(N,function(I,L){var ae=Y(L);return ae==="symbol"?String(L):L});return new x("Invalid "+ge+" `"+W+"` of value `"+String(ie)+"` "+("supplied to `"+ee+"`, expected one of "+le+"."))}return T(R)}function j(N){function R(K,se,ee,ge,W){if(typeof N!="function")return new x("Property `"+W+"` of component `"+ee+"` has invalid PropType notation inside objectOf.");var ie=K[se],ve=Pe(ie);if(ve!=="object")return new x("Invalid "+ge+" `"+W+"` of type "+("`"+ve+"` supplied to `"+ee+"`, expected an object."));for(var le in ie)if(n(ie,le)){var pe=N(ie,le,ee,ge,W+"."+le,r);if(pe instanceof Error)return pe}return null}return T(R)}function U(N){if(!Array.isArray(N))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var R=0;R<N.length;R++){var K=N[R];if(typeof K!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+$(K)+" at index "+R+"."),o}function se(ee,ge,W,ie,ve){for(var le=[],pe=0;pe<N.length;pe++){var I=N[pe],L=I(ee,ge,W,ie,ve,r);if(L==null)return null;L.data&&n(L.data,"expectedType")&&le.push(L.data.expectedType)}var ae=le.length>0?", expected one of type ["+le.join(", ")+"]":"";return new x("Invalid "+ie+" `"+ve+"` supplied to "+("`"+W+"`"+ae+"."))}return T(se)}function V(){function N(R,K,se,ee,ge){return Se(R[K])?null:new x("Invalid "+ee+" `"+ge+"` supplied to "+("`"+se+"`, expected a ReactNode."))}return T(N)}function me(N,R,K,se,ee){return new x((N||"React class")+": "+R+" type `"+K+"."+se+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ee+"`.")}function Le(N){function R(K,se,ee,ge,W){var ie=K[se],ve=Pe(ie);if(ve!=="object")return new x("Invalid "+ge+" `"+W+"` of type `"+ve+"` "+("supplied to `"+ee+"`, expected `object`."));for(var le in N){var pe=N[le];if(typeof pe!="function")return me(ee,ge,W,le,Y(pe));var I=pe(ie,le,ee,ge,W+"."+le,r);if(I)return I}return null}return T(R)}function ye(N){function R(K,se,ee,ge,W){var ie=K[se],ve=Pe(ie);if(ve!=="object")return new x("Invalid "+ge+" `"+W+"` of type `"+ve+"` "+("supplied to `"+ee+"`, expected `object`."));var le=t({},K[se],N);for(var pe in le){var I=N[pe];if(n(N,pe)&&typeof I!="function")return me(ee,ge,W,pe,Y(I));if(!I)return new x("Invalid "+ge+" `"+W+"` key `"+pe+"` supplied to `"+ee+"`.\nBad object: "+JSON.stringify(K[se],null," ")+`
|
|
49
|
+
Valid keys: `+JSON.stringify(Object.keys(N),null," "));var L=I(ie,pe,ee,ge,W+"."+pe,r);if(L)return L}return null}return T(R)}function Se(N){switch(typeof N){case"number":case"string":case"undefined":return!0;case"boolean":return!N;case"object":if(Array.isArray(N))return N.every(Se);if(N===null||s(N))return!0;var R=d(N);if(R){var K=R.call(N),se;if(R!==N.entries){for(;!(se=K.next()).done;)if(!Se(se.value))return!1}else for(;!(se=K.next()).done;){var ee=se.value;if(ee&&!Se(ee[1]))return!1}}else return!1;return!0;default:return!1}}function Ve(N,R){return N==="symbol"?!0:R?R["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&R instanceof Symbol:!1}function Pe(N){var R=typeof N;return Array.isArray(N)?"array":N instanceof RegExp?"object":Ve(R,N)?"symbol":R}function Y(N){if(typeof N>"u"||N===null)return""+N;var R=Pe(N);if(R==="object"){if(N instanceof Date)return"date";if(N instanceof RegExp)return"regexp"}return R}function $(N){var R=Y(N);switch(R){case"array":case"object":return"an "+R;case"boolean":case"date":case"regexp":return"a "+R;default:return R}}function Z(N){return!N.constructor||!N.constructor.name?f:N.constructor.name}return v.checkPropTypes=i,v.resetWarningCache=i.resetWarningCache,v.PropTypes=v,v},ea}var ta,cs;function Hf(){if(cs)return ta;cs=1;var e=Xi();function t(){}function r(){}return r.resetWarningCache=t,ta=function(){function n(o,s,c,u,l,d){if(d!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:t};return a.PropTypes=a,a},ta}if(process.env.NODE_ENV!=="production"){var zf=ts(),Qf=!0;Gi.exports=Bf()(zf.isElement,Qf)}else Gi.exports=Hf()();var us=Gi.exports;function ls(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=ls(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function fs(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=ls(e))&&(n&&(n+=" "),n+=t);return n}const Wf=jf(Object.freeze(Object.defineProperty({__proto__:null,clsx:fs,default:fs},Symbol.toStringTag,{value:"Module"})));var Be={},Bt={};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.dontSetMe=Jf,Bt.findInArray=Gf,Bt.int=Xf,Bt.isFunction=Yf,Bt.isNum=Kf;function Gf(e,t){for(let r=0,n=e.length;r<n;r++)if(t.apply(t,[e[r],r,e]))return e[r]}function Yf(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Kf(e){return typeof e=="number"&&!isNaN(e)}function Xf(e){return parseInt(e,10)}function Jf(e,t,r){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(r," - do not set this, set it on the child."))}var gr={};Object.defineProperty(gr,"__esModule",{value:!0}),gr.browserPrefixToKey=hs,gr.browserPrefixToStyle=Zf,gr.default=void 0,gr.getPrefix=ds;const ra=["Moz","Webkit","O","ms"];function ds(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const r=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!r||t in r)return"";for(let n=0;n<ra.length;n++)if(hs(t,ra[n])in r)return ra[n];return""}function hs(e,t){return t?"".concat(t).concat(ed(e)):e}function Zf(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function ed(e){let t="",r=!0;for(let n=0;n<e.length;n++)r?(t+=e[n].toUpperCase(),r=!1):e[n]==="-"?r=!0:t+=e[n];return t}gr.default=ds(),Object.defineProperty(Be,"__esModule",{value:!0}),Be.addClassName=ys,Be.addEvent=nd,Be.addUserSelectStyles=pd,Be.createCSSTransform=ld,Be.createSVGTransform=fd,Be.getTouch=dd,Be.getTouchIdentifier=hd,Be.getTranslation=na,Be.innerHeight=sd,Be.innerWidth=cd,Be.matchesSelector=vs,Be.matchesSelectorAndParentsTo=rd,Be.offsetXYFromParent=ud,Be.outerHeight=ad,Be.outerWidth=od,Be.removeClassName=ms,Be.removeEvent=id,Be.removeUserSelectStyles=gd;var Ot=Bt,ps=td(gr);function gs(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(gs=function(n){return n?r:t})(e)}function td(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=gs(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}let Wn="";function vs(e,t){return Wn||(Wn=(0,Ot.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(r){return(0,Ot.isFunction)(e[r])})),(0,Ot.isFunction)(e[Wn])?e[Wn](t):!1}function rd(e,t,r){let n=e;do{if(vs(n,t))return!0;if(n===r)return!1;n=n.parentNode}while(n);return!1}function nd(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.addEventListener?e.addEventListener(t,r,i):e.attachEvent?e.attachEvent("on"+t,r):e["on"+t]=r}function id(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent?e.detachEvent("on"+t,r):e["on"+t]=null}function ad(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Ot.int)(r.borderTopWidth),t+=(0,Ot.int)(r.borderBottomWidth),t}function od(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Ot.int)(r.borderLeftWidth),t+=(0,Ot.int)(r.borderRightWidth),t}function sd(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Ot.int)(r.paddingTop),t-=(0,Ot.int)(r.paddingBottom),t}function cd(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Ot.int)(r.paddingLeft),t-=(0,Ot.int)(r.paddingRight),t}function ud(e,t,r){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),a=(e.clientX+t.scrollLeft-i.left)/r,o=(e.clientY+t.scrollTop-i.top)/r;return{x:a,y:o}}function ld(e,t){const r=na(e,t,"px");return{[(0,ps.browserPrefixToKey)("transform",ps.default)]:r}}function fd(e,t){return na(e,t,"")}function na(e,t,r){let{x:n,y:i}=e,a="translate(".concat(n).concat(r,",").concat(i).concat(r,")");if(t){const o="".concat(typeof t.x=="string"?t.x:t.x+r),s="".concat(typeof t.y=="string"?t.y:t.y+r);a="translate(".concat(o,", ").concat(s,")")+a}return a}function dd(e,t){return e.targetTouches&&(0,Ot.findInArray)(e.targetTouches,r=>t===r.identifier)||e.changedTouches&&(0,Ot.findInArray)(e.changedTouches,r=>t===r.identifier)}function hd(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function pd(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
50
50
|
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
51
|
-
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&ys(e.body,"react-draggable-transparent-selection")}function gh(e){if(e)try{if(e.body&&ms(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function ys(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function ms(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var zt={};Object.defineProperty(zt,"__esModule",{value:!0}),zt.canDragX=mh,zt.canDragY=bh,zt.createCoreData=wh,zt.createDraggableData=xh,zt.getBoundPosition=vh,zt.getControlPosition=Eh,zt.snapToGrid=yh;var Tt=Bt,Tr=Be;function vh(e,t,r){if(!e.props.bounds)return[t,r];let{bounds:n}=e.props;n=typeof n=="string"?n:Oh(n);const i=ia(e);if(typeof n=="string"){const{ownerDocument:a}=i,o=a.defaultView;let s;if(n==="parent"?s=i.parentNode:s=a.querySelector(n),!(s instanceof o.HTMLElement))throw new Error('Bounds selector "'+n+'" could not find an element.');const c=s,u=o.getComputedStyle(i),l=o.getComputedStyle(c);n={left:-i.offsetLeft+(0,Tt.int)(l.paddingLeft)+(0,Tt.int)(u.marginLeft),top:-i.offsetTop+(0,Tt.int)(l.paddingTop)+(0,Tt.int)(u.marginTop),right:(0,Tr.innerWidth)(c)-(0,Tr.outerWidth)(i)-i.offsetLeft+(0,Tt.int)(l.paddingRight)-(0,Tt.int)(u.marginRight),bottom:(0,Tr.innerHeight)(c)-(0,Tr.outerHeight)(i)-i.offsetTop+(0,Tt.int)(l.paddingBottom)-(0,Tt.int)(u.marginBottom)}}return(0,Tt.isNum)(n.right)&&(t=Math.min(t,n.right)),(0,Tt.isNum)(n.bottom)&&(r=Math.min(r,n.bottom)),(0,Tt.isNum)(n.left)&&(t=Math.max(t,n.left)),(0,Tt.isNum)(n.top)&&(r=Math.max(r,n.top)),[t,r]}function yh(e,t,r){const n=Math.round(t/e[0])*e[0],i=Math.round(r/e[1])*e[1];return[n,i]}function mh(e){return e.props.axis==="both"||e.props.axis==="x"}function bh(e){return e.props.axis==="both"||e.props.axis==="y"}function Eh(e,t,r){const n=typeof t=="number"?(0,Tr.getTouch)(e,t):null;if(typeof t=="number"&&!n)return null;const i=ia(r),a=r.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,Tr.offsetXYFromParent)(n||e,a,r.props.scale)}function wh(e,t,r){const n=!(0,Tt.isNum)(e.lastX),i=ia(e);return n?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:r,x:t,y:r}:{node:i,deltaX:t-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:r}}function xh(e,t){const r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}}function Oh(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function ia(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Gn={},Yn={};Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.default=Sh;function Sh(){}Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.default=void 0;var aa=Ch(w),bt=sa(us),Th=sa(tn),pt=Be,er=zt,oa=Bt,rn=sa(Yn);function sa(e){return e&&e.__esModule?e:{default:e}}function bs(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(bs=function(n){return n?r:t})(e)}function Ch(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=bs(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function vt(e,t,r){return t=_h(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _h(e){var t=kh(e,"string");return typeof t=="symbol"?t:String(t)}function kh(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const It={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let tr=It.mouse,Kn=class extends aa.Component{constructor(){super(...arguments),vt(this,"dragging",!1),vt(this,"lastX",NaN),vt(this,"lastY",NaN),vt(this,"touchIdentifier",null),vt(this,"mounted",!1),vt(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const r=this.findDOMNode();if(!r||!r.ownerDocument||!r.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=r;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!(0,pt.matchesSelectorAndParentsTo)(t.target,this.props.handle,r)||this.props.cancel&&(0,pt.matchesSelectorAndParentsTo)(t.target,this.props.cancel,r))return;t.type==="touchstart"&&t.preventDefault();const i=(0,pt.getTouchIdentifier)(t);this.touchIdentifier=i;const a=(0,er.getControlPosition)(t,i,this);if(a==null)return;const{x:o,y:s}=a,c=(0,er.createCoreData)(this,o,s);(0,rn.default)("DraggableCore: handleDragStart: %j",c),(0,rn.default)("calling",this.props.onStart),!(this.props.onStart(t,c)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,pt.addUserSelectStyles)(n),this.dragging=!0,this.lastX=o,this.lastY=s,(0,pt.addEvent)(n,tr.move,this.handleDrag),(0,pt.addEvent)(n,tr.stop,this.handleDragStop))}),vt(this,"handleDrag",t=>{const r=(0,er.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let s=n-this.lastX,c=i-this.lastY;if([s,c]=(0,er.snapToGrid)(this.props.grid,s,c),!s&&!c)return;n=this.lastX+s,i=this.lastY+c}const a=(0,er.createCoreData)(this,n,i);if((0,rn.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(t,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const c=document.createEvent("MouseEvents");c.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(c)}return}this.lastX=n,this.lastY=i}),vt(this,"handleDragStop",t=>{if(!this.dragging)return;const r=(0,er.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let c=n-this.lastX||0,u=i-this.lastY||0;[c,u]=(0,er.snapToGrid)(this.props.grid,c,u),n=this.lastX+c,i=this.lastY+u}const a=(0,er.createCoreData)(this,n,i);if(this.props.onStop(t,a)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,pt.removeUserSelectStyles)(s.ownerDocument),(0,rn.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,rn.default)("DraggableCore: Removing handlers"),(0,pt.removeEvent)(s.ownerDocument,tr.move,this.handleDrag),(0,pt.removeEvent)(s.ownerDocument,tr.stop,this.handleDragStop))}),vt(this,"onMouseDown",t=>(tr=It.mouse,this.handleDragStart(t))),vt(this,"onMouseUp",t=>(tr=It.mouse,this.handleDragStop(t))),vt(this,"onTouchStart",t=>(tr=It.touch,this.handleDragStart(t))),vt(this,"onTouchEnd",t=>(tr=It.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,pt.addEvent)(t,It.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:r}=t;(0,pt.removeEvent)(r,It.mouse.move,this.handleDrag),(0,pt.removeEvent)(r,It.touch.move,this.handleDrag),(0,pt.removeEvent)(r,It.mouse.stop,this.handleDragStop),(0,pt.removeEvent)(r,It.touch.stop,this.handleDragStop),(0,pt.removeEvent)(t,It.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,pt.removeUserSelectStyles)(r)}}findDOMNode(){var t,r;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(r=this.props)===null||r===void 0||(r=r.nodeRef)===null||r===void 0?void 0:r.current:Th.default.findDOMNode(this)}render(){return aa.cloneElement(aa.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Gn.default=Kn,vt(Kn,"displayName","DraggableCore"),vt(Kn,"propTypes",{allowAnyClick:bt.default.bool,children:bt.default.node.isRequired,disabled:bt.default.bool,enableUserSelectHack:bt.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:bt.default.arrayOf(bt.default.number),handle:bt.default.string,cancel:bt.default.string,nodeRef:bt.default.object,onStart:bt.default.func,onDrag:bt.default.func,onStop:bt.default.func,onMouseDown:bt.default.func,scale:bt.default.number,className:oa.dontSetMe,style:oa.dontSetMe,transform:oa.dontSetMe}),vt(Kn,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=f(w),r=l(us),n=l(tn),i=l(Hf),a=Be,o=zt,s=Bt,c=l(Gn),u=l(Yn);function l(_){return _&&_.__esModule?_:{default:_}}function d(_){if(typeof WeakMap!="function")return null;var m=new WeakMap,C=new WeakMap;return(d=function(O){return O?C:m})(_)}function f(_,m){if(_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var C=d(m);if(C&&C.has(_))return C.get(_);var O={},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in _)if(A!=="default"&&Object.prototype.hasOwnProperty.call(_,A)){var j=P?Object.getOwnPropertyDescriptor(_,A):null;j&&(j.get||j.set)?Object.defineProperty(O,A,j):O[A]=_[A]}return O.default=_,C&&C.set(_,O),O}function v(){return v=Object.assign?Object.assign.bind():function(_){for(var m=1;m<arguments.length;m++){var C=arguments[m];for(var O in C)Object.prototype.hasOwnProperty.call(C,O)&&(_[O]=C[O])}return _},v.apply(this,arguments)}function E(_,m,C){return m=x(m),m in _?Object.defineProperty(_,m,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[m]=C,_}function x(_){var m=T(_,"string");return typeof m=="symbol"?m:String(m)}function T(_,m){if(typeof _!="object"||_===null)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var O=C.call(_,m||"default");if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(_)}class S extends t.Component{static getDerivedStateFromProps(m,C){let{position:O}=m,{prevPropsPosition:P}=C;return O&&(!P||O.x!==P.x||O.y!==P.y)?((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:O,prevPropsPosition:P}),{x:O.x,y:O.y,prevPropsPosition:{...O}}):null}constructor(m){super(m),E(this,"onDragStart",(C,O)=>{if((0,u.default)("Draggable: onDragStart: %j",O),this.props.onStart(C,(0,o.createDraggableData)(this,O))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),E(this,"onDrag",(C,O)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",O);const P=(0,o.createDraggableData)(this,O),A={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:U,y:V}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[me,Le]=(0,o.getBoundPosition)(this,A.x,A.y);A.x=me,A.y=Le,A.slackX=this.state.slackX+(U-A.x),A.slackY=this.state.slackY+(V-A.y),P.x=A.x,P.y=A.y,P.deltaX=A.x-this.state.x,P.deltaY=A.y-this.state.y}if(this.props.onDrag(C,P)===!1)return!1;this.setState(A)}),E(this,"onDragStop",(C,O)=>{if(!this.state.dragging||this.props.onStop(C,(0,o.createDraggableData)(this,O))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",O);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:U,y:V}=this.props.position;A.x=U,A.y=V}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:m.position?m.position.x:m.defaultPosition.x,y:m.position?m.position.y:m.defaultPosition.y,prevPropsPosition:{...m.position},slackX:0,slackY:0,isElementSVG:!1},m.position&&!(m.onDrag||m.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var m,C;return(m=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&m!==void 0?m:n.default.findDOMNode(this)}render(){const{axis:m,bounds:C,children:O,defaultPosition:P,defaultClassName:A,defaultClassNameDragging:j,defaultClassNameDragged:U,position:V,positionOffset:me,scale:Le,...ye}=this.props;let Oe={},Ve=null;const K=!!!V||this.state.dragging,$=V||P,Z={x:(0,o.canDragX)(this)&&K?this.state.x:$.x,y:(0,o.canDragY)(this)&&K?this.state.y:$.y};this.state.isElementSVG?Ve=(0,a.createSVGTransform)(Z,me):Oe=(0,a.createCSSTransform)(Z,me);const N=(0,i.default)(O.props.className||"",A,{[j]:this.state.dragging,[U]:this.state.dragged});return t.createElement(c.default,v({},ye,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(O),{className:N,style:{...O.props.style,...Oe},transform:Ve}))}}e.default=S,E(S,"displayName","Draggable"),E(S,"propTypes",{...c.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),E(S,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Xo);const{default:Es,DraggableCore:Dh}=Xo;Wn.exports=Es,Wn.exports.default=Es,Wn.exports.DraggableCore=Dh;var Mh=Wn.exports;const Xn=Ko(Mh);var Re=(e=>(e.FULL="full",e.DENSE="dense",e.SQUISH="squish",e.PACK="pack",e.HIDE="hide",e.DOWNLOAD="download",e))(Re||{}),G=(e=>(e.UNDEFINED="undefined",e.RULER="ruler",e.BIGWIG="bigwig",e.BIGBED="bigbed",e.IMPORTANCE="importance",e.TRANSCRIPT="transcript",e.BAM="bam",e.MOTIF="motif",e.LDTRACK="ldtrack",e))(G||{});function Lh(e){return null}function Ih(e){return null}var Jn=(e=>(e[e.V29=29]="V29",e[e.V40=40]="V40",e[e.V47=47]="V47",e))(Jn||{}),ca=(e=>(e[e.V21=21]="V21",e[e.V25=25]="V25",e[e.V36=36]="V36",e))(ca||{});function Ph(e){return null}const vr=w.createContext({}),Pt=w.createContext(()=>{});var ue=(e=>(e.SET_DOMAIN="setDomain",e.SHIFT_DOMAIN="shiftDomain",e.ZOOM_DOMAIN="zoomDomain",e.SLIDE_DOMAIN="slideDomain",e.SET_DELTA="setDelta",e.ADD_TRACK="addTrack",e.UPDATE_TRACK="updateTrack",e.SET_TRACK_HEIGHT="setTrackHeight",e.SET_TRACK_DATA="setTrackData",e.SET_LOADING="setLoading",e.SWAP_TRACKS="swapTracks",e.RELOAD_TRACKS="reloadTracks",e.SHIFT_TRACK="shiftTrack",e.REMOVE_TRANSLATION="removeTranslation",e.INSERT_TRACK="insertTrack",e.DELETE_TRACK="deleteTrack",e.TRANSLATE_TRACK="translateTrack",e.SET_RANGE="setRange",e.UPDATE_PROPS="updateProps",e.BRING_TO_TOP="bringToTop",e.SET_HOVER="setHover",e.ADD_HIGHLIGHT="addHighlight",e.REMOVE_LAST_HIGHLIGHT="removeLastHighlight",e.REMOVE_HIGHLIGHT="removeHighlight",e))(ue||{});function Nh(e,t){switch(t.type){case"setDomain":const r=t.domain,n=Math.floor((r.end-r.start)/e.preRenderedWidth);return{...e,domain:t.domain,zoomLevel:n};case"addTrack":return e.tracks.find(m=>m.id===t.track.id)?e:{...e,tracks:[...e.tracks,t.track]};case"updateTrack":const a=e.tracks.find(m=>m.id===t.id);if(a){const m={...a,...t.track};return{...e,tracks:e.tracks.map(C=>C.id===t.id?m:C)}}return e;case"setTrackHeight":return{...e,tracks:e.tracks.map(m=>m.id===t.id?{...m,actualHeight:t.height}:m)};case"setTrackData":return{...e,tracks:e.tracks.map(m=>m.id===t.id?{...m,data:t.data}:m)};case"shiftDomain":const o=Math.floor(t.delta/e.preRenderedWidth*(e.domain.end-e.domain.start));return{...e,domain:{...e.domain,start:e.domain.start-o,end:e.domain.end-o}};case"setLoading":return{...e,tracks:e.tracks.map(m=>({...m,data:void 0,...m.trackType===G.MOTIF?{peaks:void 0}:{}}))};case"shiftTrack":const s=e.tracks.findIndex(m=>m.id===t.id1);if(s===-1)return e;const c=e.tracks.findIndex(m=>m.id===t.id2);if(c<0||c>=e.tracks.length)return e;const u=[...e.tracks],[l]=u.splice(s,1);return u.splice(c,0,l),{...e,tracks:u};case"swapTracks":const d=e.tracks.findIndex(m=>m.id===t.id1);if(d===-1)return e;const f=e.tracks.findIndex(m=>m.id===t.id2);if(f<0||f>=e.tracks.length)return e;const v=[...e.tracks];return[v[d],v[f]]=[v[f],v[d]],{...e,tracks:v};case"translateTrack":const E=e.tracks.find(m=>m.id===t.id);if(!E)return e;const x={...E.props,transform:`translate(0, ${t.dist})`};return{...e,tracks:e.tracks.map(m=>m.id===E.id?{...m,props:x}:m)};case"removeTranslation":return t.id==="ALL"?{...e,tracks:e.tracks.map(m=>{if(!m.props)return m;const{transform:C,...O}=m.props;return{...m,props:O}})}:{...e,tracks:e.tracks.map(m=>m.id===t.id?{...m,props:(()=>{if(!m.props)return m.props;const{transform:C,...O}=m.props;return O})()}:m)};case"insertTrack":return{...e,tracks:[...e.tracks.slice(0,t.index),t.track,...e.tracks.slice(t.index)]};case"deleteTrack":return{...e,tracks:e.tracks.filter(m=>m.id!==t.id)};case"setRange":return{...e,tracks:e.tracks.map(m=>m.id===t.id?{...m,props:{...m.props,range:t.range}}:m)};case"updateProps":return{...e,tracks:e.tracks.map(m=>m.id===t.id?{...m,props:{...m.props,...t.props}}:m)};case"bringToTop":const T=e.tracks.find(m=>m.id===t.id);return T?{...e,tracks:[T,...e.tracks.filter(m=>m.id!==t.id)]}:e;case"setDelta":return{...e,delta:t.delta};case"zoomDomain":const S=(e.domain.start+e.domain.end)/2,_=(e.domain.end-e.domain.start)*t.factor;return{...e,domain:{...e.domain,start:Math.floor(S-_/2),end:Math.ceil(S+_/2)},zoomLevel:e.zoomLevel};case"slideDomain":return{...e,domain:{...e.domain,start:e.domain.start+t.delta,end:e.domain.end+t.delta}};case"addHighlight":return e.highlights.some(m=>m.id===t.highlight.id)?e:{...e,highlights:[...e.highlights,t.highlight]};case"removeLastHighlight":return e.highlights.length===0||e.highlights[e.highlights.length-1].domain.chromosome?e:{...e,highlights:e.highlights.slice(0,-1)};case"removeHighlight":return{...e,highlights:e.highlights.filter(m=>m.id!==t.id)};default:return e}}const ws=w.createContext(!1);function Ah({canDrag:e,id:t,height:r,children:n}){var Pe;const a=w.useRef(null),o=w.useContext(Pt),s=w.useContext(vr),[c,u]=w.useState(0),[l,d]=w.useState({x:0,y:0}),[f,v]=w.useState(!1),[E,x]=w.useState({x:0,y:0}),[T,S]=w.useState([]),[_,m]=w.useState([]),[C,O]=w.useState(-1),[P,A]=w.useState(null),[j,U]=w.useState(1);w.useEffect(()=>{const K=document.getElementById("browserSVG");if(A(K),K){const $=K,Z=$.getBoundingClientRect();U(Z.width/$.viewBox.baseVal.width)}},[]);const V=w.useRef(((Pe=s.tracks)==null?void 0:Pe.find(K=>K.id===t))||null);w.useEffect(()=>{if(!s.tracks||f)return;const K=s.tracks.map(N=>N.actualHeight||N.height),$=s.tracks.findIndex(N=>N.id===t);let Z=new Array(K.length).fill(0);Z=K.map((N,R)=>R<$?-K.slice(R,$).reduce((X,se)=>X+se,0):R>$?K.slice($+1,R+1).reduce((X,se)=>X+se,0):0),m(new Array(s.tracks.length).fill(!1)),S(Z)},[s.tracks?s.tracks:[]]);const me=()=>{const K=T.reduce(($,Z,N)=>Math.abs(Z-c)<Math.abs(T[$]-c)?N:$,0);return C!=K&&(C!=-1&&_[C]&&_[K]&&(m($=>{const Z=[...$];return Z[C]=!1,Z}),o({type:ue.REMOVE_TRANSLATION,id:s.tracks[C].id})),m($=>{const Z=[...$];return Z[K]=!0,Z}),o({type:ue.TRANSLATE_TRACK,id:s.tracks[K].id,dist:c<0?r:-r}),O(K)),K},Le=()=>{if(!s.tracks)return;const K=s.tracks.find(Z=>Z.id===t);if(!K)return;const $=s.tracks.slice(0,s.tracks.indexOf(K)).reduce((Z,N)=>Z+(N.actualHeight||N.height),0);x({x:0,y:$+80}),u(0),v(!0)},ye=()=>{s.tracks&&(d({x:0,y:0}),v(!1),o({type:ue.SHIFT_TRACK,id1:t,id2:s.tracks[me()].id}),o({type:ue.REMOVE_TRANSLATION,id:"ALL"}))},Oe=(K,$)=>{u($.y),d({x:0,y:$.y});const Z=me(),N=s.tracks.indexOf(V.current);Z==N||s.tracks[Z]},Ve=w.useRef(null);return p.jsx(ws.Provider,{value:f,children:p.jsx(Xn,{scale:j,nodeRef:a,position:l,axis:"y",handle:".swap-handle",onStart:e&&P?Le:()=>!1,onStop:ye,onDrag:Oe,children:p.jsxs("g",{ref:a,"data-track-id":t,children:[!f&&n,f&&(P?tn.createPortal(p.jsx(Xn,{scale:j,nodeRef:Ve,position:{x:0,y:E.y+l.y},axis:"y",children:p.jsx("g",{ref:Ve,style:{cursor:"grabbing",filter:"drop-shadow(2px 2px 2px gray)"},children:n})}),P):n)]})})})}w.createContext({}),w.createContext(()=>{});const ua=w.createContext({delta:0,setDelta:()=>{}}),la=w.createContext({openModal:null,showModal:()=>{},closeModal:()=>{}});function Fh({children:e,browserState:t,browserDispatch:r,modalState:n,deltaContext:i}){return p.jsx(la.Provider,{value:{...n},children:p.jsx(vr.Provider,{value:t,children:p.jsx(Pt.Provider,{value:r,children:p.jsx(ua.Provider,{value:i,children:e})})})})}function Rh(e){return p.jsxs("svg",{x:e.x,y:e.y,width:e.width,height:e.height,viewBox:"0 0 24.000001 24.000001",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[p.jsx("filter",{id:"a",colorInterpolationFilters:"sRGB",height:"1.39486",width:"1.311082",x:"-.155541",y:"-.19743",children:p.jsx("feGaussianBlur",{stdDeviation:"1.2313672"})}),p.jsxs("g",{transform:"matrix(.96344673 0 0 .96344673 -123.36427 -955.289756)",children:[p.jsx("path",{d:"m132.5 995.4062c-.831 0-1.5 1.5-1.5 1.5s.669 1.5 1.5 1.5h7.6875c-.25613.088-.47997.2851-.59375.5313l-3 6c-.2396.5108.0576 1.1992.59375 1.375l1.8125.625v2.4375c.00005.5236.47642 1 1 1h1c.52358 0 .99995-.4764 1-1v-2.4375l1.8125-.625c.53611-.1758.83335-.8642.59375-1.375l-3-6c-.13219-.2754-.39056-.4647-.6875-.5313h7.78125c.831 0 1.5-1.5 1.5-1.5s-.669-1.5-1.5-1.5z",filter:"url(#a)",opacity:".2"}),p.jsx("path",{d:"m140.3125 997.375c-.31022.06-.58621.2757-.71875.5625l-3 6c-.2396.5108.0576 1.1992.59375 1.375l1.8125.625v2.4375c.00005.5236.47642 1 1 1h1c.52358 0 .99995-.4764 1-1v-2.4375l1.8125-.625c.53611-.1758.83335-.8642.59375-1.375l-3-6c-.17625-.3672-.59466-.6026-1-.5625-.0312-.001-.0625-.001-.0937 0z"}),p.jsx("path",{d:"m140.5 998.375-3 6 2.5.8437v3.1563h1v-3.1563l2.5-.8437z",fill:"#fefefe"}),p.jsxs("g",{transform:"rotate(-90)",children:[p.jsx("rect",{height:"18.999969",rx:"1.43934",ry:"1.5",width:"3.049988",x:"-997.41217",y:"131.00003"}),p.jsx("path",{d:"m-996.41217 132.00003h1v16.999969h-1z",fill:"#fefefe"})]})]})]})}function fa(e){return e/6<10?e<10?e:10:e/6}const xs=({fontSize:e,position:t,width:r,children:n})=>p.jsxs(p.Fragment,{children:[p.jsx("text",{textAnchor:"end",alignmentBaseline:"middle",y:t-3,x:r*.94,fontSize:`${e}px`,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:n}),p.jsx("line",{x1:r*.96,x2:r,y1:t,y2:t,stroke:"#aaa"})]}),jh=e=>{const t=fa(50),[r,n]=w.useState(null);w.useEffect(()=>{const E=document.getElementById("browserSVG");n(E)},[]);const{showModal:i}=w.useContext(la),[a,o]=w.useState(void 0),s=w.useContext(Pt),c=w.useContext(vr);let u=-1;c.tracks&&(u=c.tracks.findIndex(E=>E.id===e.trackId));const l=E=>{i(e.trackId,E.clientX,E.clientY)},d=E=>{E.preventDefault(),s({type:ue.BRING_TO_TOP,id:e.trackId})};w.useEffect(()=>{o(e.range)},[e.range]);const f=w.useContext(ws),v=E=>{s({type:ue.UPDATE_TRACK,id:e.trackId,track:{hoverColor:E?e.color:void 0}})};return p.jsx("svg",{style:{cursor:e.canDrag&&r?f?"grabbing":"grab":"default"},width:e.width,height:e.height,viewBox:`0 0 ${e.width} ${e.height}`,preserveAspectRatio:"xMinYMin meet",children:p.jsxs("g",{onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),height:e.height,width:e.width,children:[p.jsx("rect",{x:0,y:0,width:e.width,height:e.height,fill:"white",className:"swap-handle"}),p.jsx("rect",{x:0,y:0,width:e.width/15,height:e.height,stroke:"#000000",strokeWidth:.5,fill:e.color||"rgb(225,225,225)",style:{cursor:"default"}}),p.jsx("text",{fontSize:`${t}px`,y:e.range===void 0?e.height/2:(e.height+t)/2,x:e.width/10,alignmentBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.shortLabel}),p.jsx("line",{stroke:"#ccc",x1:e.width,x2:e.width,y1:0,y2:e.height}),e.trackType!==G.RULER&&r&&p.jsxs("svg",{x:e.width/10,y:e.range===void 0?e.height/2+5:(e.height+t)/2+5,width:35,height:20,cursor:"pointer",children:[p.jsxs("g",{onClick:l,children:[p.jsx("circle",{cx:7.5,cy:7.5,r:7.5,strokeWidth:0,fill:"transparent"}),p.jsx(Ff,{x:0,y:0,height:15,width:15})]}),u>0&&p.jsxs("g",{onClick:d,children:[p.jsx("circle",{cx:22.5,cy:7.5,r:7.5,strokeWidth:0,fill:"transparent"}),p.jsx(Rh,{x:15,y:2,height:15,width:15})]})]}),a&&p.jsxs(p.Fragment,{children:[p.jsx(xs,{position:e.rangePositions.min,width:e.width,fontSize:t||e.height/6,children:Number(a.min).toFixed(2)}),p.jsx(xs,{position:e.rangePositions.max,width:e.width,fontSize:t||e.height/6,children:Number(a.max).toFixed(2)})]})]})})};function Vh(e){return e&&e.props!==void 0}const qh=0,Os=255;function Ss(e){if(e=e.replace(/[^0-9a-f]/gi,""),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e.length===8&&(e=e.substring(0,6)),e.length!==6)throw new Error(e+" is not a valid hex color");return e}function Zn(e,t){e=Ss(e);let r="#";for(let n=0;n<3;++n){const i=parseInt(e.substr(n*2,2),16),a=Math.round(Math.min(Math.max(qh,i+t*Os),Os)).toString(16);r+=("00"+a).substr(a.length)}return r}function Ts(e){return parseInt(Ss(e),16)}function $h(e){return e>=16?e.toString(16):`0${e.toString(16)}`}const ha=w.createContext({show:!1,x:0,y:0,id:"",setContextMenu:()=>{},displayMode:void 0}),Uh=e=>{const{x:t,y:r,show:n}=w.useContext(ha);return p.jsx("g",{id:"context-menu",transform:`translate(${t}, ${r})`,style:{visibility:n?"visible":"hidden"},children:p.jsx("foreignObject",{width:e.width,height:e.height,children:e.children})})},rr=(e,t)=>{if(e.createSVGPoint&&e){let n=e.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}const r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]},Bh=(e,t)=>{const r=e.cloneNode(!0),n=t.cloneNode(!0);return'<?xml version="1.0" standalone="no"?>'+'<svg xmlns="http://www.w3.org/2000/svg">'+n.outerHTML.replace(/\n/g,"").replace(/[ ]{8}/g,"")+'<g transform="translate (0,50)">'+r.outerHTML.replace(/\n/g,"").replace(/[ ]{8}/g,"")+"</g></svg>"},zh=(e,t,r)=>{const n=new Blob([Bh(e,t)],{type:"image/svg;charset=utf-8"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a)};function Wh(e){return p.jsx("rect",{width:e.width,height:e.height,fill:e.hoverColor||"transparent",fillOpacity:e.hoverColor?.15:0,style:{pointerEvents:"none"}})}const Qh=(e,t)=>e||(!t||!t.substring||!t.length?"":t.length<=20?t:t.substring(0,20)+"..."),et=e=>{var _;const t=w.useContext(Pt),r=w.useContext(ha);w.useEffect(()=>{const m=C=>{const O=document.getElementById("context-menu");O&&!O.contains(C.target)&&r.setContextMenu({show:!1,x:0,y:0,id:""})};return document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[r]);const n=()=>{var O,P,A,j;const m=(P=(O=e.svgRef)==null?void 0:O.current)==null?void 0:P.getElementById("wrapped-track-"+e.id),C=(j=(A=e.svgRef)==null?void 0:A.current)==null?void 0:j.getElementById("wrapped-track-ruler");zh(m,C,e.id+".svg")},[i,a]=w.useState(e.height||0),o=w.useCallback(m=>{a(m),e.onHeightChanged&&e.onHeightChanged(m)},[e]);w.useEffect(()=>{t({type:ue.SET_TRACK_HEIGHT,id:e.id,height:i}),e.onHeightChanged&&e.height!==void 0&&e.onHeightChanged(e.height)},[e.height,i]);const s=e.trackMargin||(e.height||e.rowHeight||i)/6,c=e.titleSize||s*2.5,u=e.title?c+5:0,l=s+u,d=Qh(e.shortLabel||"",e.title||""),f=i-l,v=e.width<1e3?e.width/8:150,E=e.width-v,x=i/3,S=(_=e.displayMode)==null?void 0:_.toLowerCase();return p.jsx(Ah,{canDrag:e.canDrag||!1,id:e.id,height:i,children:p.jsxs("g",{id:"wrapped-track-"+e.id,children:[p.jsx("rect",{width:e.width,height:i,fill:"white",style:{pointerEvents:"none"}}),p.jsx("line",{stroke:"#ccc",x1:e.width,x2:e.width,y1:0,y2:i,strokeWidth:2}),e.loading&&!e.error&&p.jsx("g",{transform:`translate(${v+(E-x)/2},${(i-x)/2})`,children:p.jsx(Pf,{width:x,height:x})}),e.error&&p.jsxs("g",{transform:`translate(${v+(E-x)/2},${(i-x)/2})`,children:[p.jsx(Yo,{width:x,height:x}),p.jsx("g",{transform:`translate(${x/2},${x+10})`,children:p.jsx("text",{textAnchor:"middle",fontSize:`${e.titleSize}px`,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.error})})]}),!e.loading&&!e.error&&e.title&&p.jsx("g",{id:`title-${e.id}`,children:p.jsx("text",{style:{cursor:"default"},fill:e.titleColor||"#000000",textAnchor:"middle",x:v+E/2,y:c/2+5,fontSize:`${c}px`,transform:`translate(0,${s})`,alignmentBaseline:"baseline",children:e.title})}),!e.loading&&!e.error&&p.jsx("g",{onContextMenu:m=>{if(e.trackType==G.RULER||!e.svgRef)return;m.preventDefault();const C=rr(e.svgRef.current,m);r.setContextMenu({show:!0,x:C[0]>e.width-80?C[0]-80:C[0],y:C[1],id:e.id,displayMode:S,downloadSVG:n,displayModeOptions:Hh(e.trackType)})},transform:`translate(${v},${i-f})`,children:w.Children.map(e.children,m=>Vh(m)?w.cloneElement(m,{...m.props,height:f,width:e.width-v,hoverColor:e.hoverColor,onHeightChanged:C=>{o(C+l)}}):m)}),e.height!=0&&p.jsx(jh,{canDrag:e.canDrag||!1,trackType:e.trackType||G.UNDEFINED,trackId:e.id,color:e.color,hoverColor:e.hoverColor,shortLabel:d,width:v,height:i,rangePositions:{min:i,max:l},range:e.range}),p.jsx(Wh,{width:e.width,height:i,hoverColor:e.hoverColor})]})})};function Hh(e){switch(e){case G.BIGBED:case G.BAM:return["dense","squish","hide","download"];case G.BIGWIG:return["full","dense","hide","download"];case G.TRANSCRIPT:return["pack","squish","hide","download"];case G.LDTRACK:return["dense","hide","download"];case G.MOTIF:return["dense","squish","hide","download"];default:return["hide","download"]}}let ei;const Gh=new Uint8Array(16);function Yh(){if(!ei&&(ei=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ei))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ei(Gh)}const ut=[];for(let e=0;e<256;++e)ut.push((e+256).toString(16).slice(1));function Kh(e,t=0){return ut[e[t+0]]+ut[e[t+1]]+ut[e[t+2]]+ut[e[t+3]]+"-"+ut[e[t+4]]+ut[e[t+5]]+"-"+ut[e[t+6]]+ut[e[t+7]]+"-"+ut[e[t+8]]+ut[e[t+9]]+"-"+ut[e[t+10]]+ut[e[t+11]]+ut[e[t+12]]+ut[e[t+13]]+ut[e[t+14]]+ut[e[t+15]]}let Cs,da,pa=0,ga=0;function Nt(e,t,r){let n=t&&r||0;const i=t||new Array(16);e=e||{};let a=e.node||Cs,o=e.clockseq!==void 0?e.clockseq:da;if(a==null||o==null){const f=e.random||(e.rng||Yh)();a==null&&(a=Cs=[f[0]|1,f[1],f[2],f[3],f[4],f[5]]),o==null&&(o=da=(f[6]<<8|f[7])&16383)}let s=e.msecs!==void 0?e.msecs:Date.now(),c=e.nsecs!==void 0?e.nsecs:ga+1;const u=s-pa+(c-ga)/1e4;if(u<0&&e.clockseq===void 0&&(o=o+1&16383),(u<0||s>pa)&&e.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");pa=s,ga=c,da=o,s+=122192928e5;const l=((s&268435455)*1e4+c)%4294967296;i[n++]=l>>>24&255,i[n++]=l>>>16&255,i[n++]=l>>>8&255,i[n++]=l&255;const d=s/4294967296*1e4&268435455;i[n++]=d>>>8&255,i[n++]=d&255,i[n++]=d>>>24&15|16,i[n++]=d>>>16&255,i[n++]=o>>>8|128,i[n++]=o&255;for(let f=0;f<6;++f)i[n+f]=a[f];return t||Kh(i)}function Cr(e,t){return` M ${e} ${t}`}function Ce(e,t){return` L ${e} ${t}`}function Ct(e,t){return r=>(r-e.start)*t/(e.end-e.start)}function _s(e,t){return r=>e.max===e.min?0:(e.max-r)*t/(e.max-e.min)}function Xh(e,t){const r=e.end-e.start,n=t.end-t.start;return i=>(i-e.start)*n/r+t.start}function ks(e,t,r){return Ct(e||t.reduce((n,i)=>({start:i.start<n.start?i.start:n.start,end:i.end>n.end?i.end:n.end}),{start:1/0,end:-1/0}),r)}function nn(e,t,r,n=10){return r=r||0,e.reduce((i,a)=>{let o=!1;for(let s=0;s<i.length;++s)if(t(i[s][i[s].length-1].coordinates.end)+n+r*i[s][i[s].length-1].name.length<=t(a.coordinates.start)){i[s].push(a),o=!0;break}return o||i.push([a]),i},[])}function Jh(e){return e==null?"":""+(e<1e5?e===Math.floor(e)?e:e.toFixed(2):e.toExponential(2))}const Wt=({width:e,height:t,id:r})=>p.jsx("clipPath",{id:r,children:p.jsx("rect",{x:0,y:0,width:e,height:t})}),Kt=w.createContext({show:!1,x:0,y:0,width:0,height:0,content:void 0,setTooltip:()=>{}});var Ds=(e=>(e.ValuedPoint="valuedPoint",e.BigZoomData="bigZoomData",e.BigWigData="bigWigData",e))(Ds||{});function _r(e){return e[0].x!==void 0?"valuedPoint":e[0].minVal!==void 0?"bigZoomData":"bigWigData"}function va(e){return _r(e)==="bigWigData"?e.map(t=>({...t})):_r(e)==="bigZoomData"?e.map(t=>({...t})):_r(e)==="valuedPoint"?e.map(t=>({...t})):[]}const Ms=(e,t)=>{switch(_r(e)){case"bigWigData":return e.forEach(r=>{r.value<t.min&&(r.value=t.min),r.value>t.max&&(r.value=t.max)}),e;case"bigZoomData":return e.forEach(r=>{r.minVal<t.min&&(r.minVal=t.min),r.maxVal>t.max&&(r.maxVal=t.max)}),e;case"valuedPoint":return e.forEach(r=>{r.min<t.min&&(r.min=t.min),r.max>t.max&&(r.max=t.max)}),e;default:return[]}},ya=(e,t)=>({min:e.reduce((r,n)=>t(n)<r?t(n):r,1/0),max:e.reduce((r,n)=>t(n)>r?t(n):r,-1/0)}),ti=e=>{switch(_r(e)){case"bigWigData":return ya(e,t=>t.value);case"bigZoomData":return ya(e,t=>t.maxVal);case"valuedPoint":return ya(e,t=>t.max);default:return{min:0,max:0}}};function Ls(e){return e.value!==void 0}const Zh=e=>{const t={start:e[0].x,end:e[e.length-1].x},r=ks(t,e.map(i=>({start:i.x,end:i.x+1})),100),n=[];for(let i=0;i<=100;++i)n.push({x:i,max:-1/0,min:1/0});return e.reduce((i,a)=>{const o=Math.floor(r(a.x)),s=Math.floor(r(a.x));a.min<i.renderPoints[o].min&&(i.renderPoints[o].min=a.min),a.max>i.renderPoints[o].max&&(i.renderPoints[o].max=a.max);for(let c=o+1;c<=s;++c)i.renderPoints[c].min=a.min,i.renderPoints[c].max=a.max;return a.min<i.range.min&&(i.range.min=a.min),a.max>i.range.max&&(i.range.max=a.max),i},{renderPoints:n,range:{max:-1/0,min:1/0}})};function Is(e,t){if(!e)return{renderPoints:[],range:{max:1,min:0}};const r=e.reduce((s,c)=>({start:c.start<s.start?c.start:s.start,end:c.end>s.end?c.end:s.end}),{start:1/0,end:-1/0}),n=ks(r,e,t),i=[],a={start:Math.floor(n(e[0].start)),end:Math.floor(n(e[e.length-1].end))};for(let s=a.start;s<a.end;++s)i.push({x:s,max:-1/0,min:1/0});const o={renderPoints:i,range:{max:-1/0,min:1/0}};return e.forEach(s=>{const c=Math.floor(n(s.start)),u=Math.floor(n(s.end)),l=Ls(s)?s.value:s.minVal,d=Ls(s)?s.value:s.maxVal;l<o.renderPoints[c].min&&(o.renderPoints[c].min=l),d>o.renderPoints[c].max&&(o.renderPoints[c].max=d);for(let f=c+1;f<u;++f)o.renderPoints[f].min=l,o.renderPoints[f].max=d;l<o.range.min&&(o.range.min=l),d>o.range.max&&(o.range.max=d)}),o}function Dt({canDrag:e,children:t}){const r=w.useRef(null),n=w.useContext(Pt),[i,a]=w.useState(!1),{delta:o,setDelta:s}=w.useContext(ua),[c,u]=w.useState({x:0,y:0}),[l,d]=w.useState(null),[f,v]=w.useState(1);w.useEffect(()=>{const T=document.getElementById("browserSVG");if(d(T),T){const S=T,_=S.getBoundingClientRect();v(_.width/S.viewBox.baseVal.width)}},[]);const E=(T,S)=>{T.preventDefault(),a(!0);const _=S.deltaX;s(o+_)},x=()=>{Math.abs(o)<10||(u({x:o,y:0}),n({type:ue.SHIFT_DOMAIN,delta:o}),a(!1))};return w.useEffect(()=>{i||u({x:o,y:0})},[o]),p.jsx(Xn,{nodeRef:r,scale:f,position:c,axis:"x",onStart:e&&l?()=>{}:()=>!1,onDrag:(T,S)=>E(T,S),onStop:x,children:p.jsx("g",{ref:r,height:"100%",style:{cursor:e&&l?i?"grabbing":"grab":"default"},children:t})})}function kr(e,t){return` L ${e} ${t}`}const ed=e=>{const t=w.useContext(vr),r=w.useContext(Pt),[n,i]=w.useState(va(e.data)),[a,o]=w.useState();w.useEffect(()=>{const C=ti(n);C.min=C.min>0?0:C.min,r({type:ue.UPDATE_PROPS,id:e.id,props:{defaultRange:C}}),o(C)},[]),w.useEffect(()=>{const C=va(e.data),O=ti(C),P={min:O.min>0?0:O.min,max:O.max};i(Ms(C,P)),r({type:ue.UPDATE_PROPS,id:e.id,props:{range:P}}),r({type:ue.UPDATE_PROPS,id:e.id,props:{defaultRange:P}})},[e.data,a,e.domain]),w.useEffect(()=>{if(!e.range)return;const C=va(e.data);i(Ms(C,e.range))},[e.range]);const s=w.useContext(Kt),[c,u]=w.useState(),[l,d]=w.useState(null),f=w.useCallback(C=>{var U;if(t.delta!=0||!((U=e.svgRef)!=null&&U.current))return;const O=rr(e.svgRef.current,C);d([O[0],O[1]]);const P=Math.round(O[0]-150),A=x.renderPoints.find(V=>V.min<1/0&&V.max>-1/0&&V.x===P);if(!A)return;const j=O[0]>e.width-60?O[0]-60+5:O[0]+5;s.setTooltip({show:!0,x:j,y:O[1]-e.height/2,height:80,width:60,content:p.jsx("div",{style:{fontSize:"10px",backgroundColor:"#ffffff",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.2)",padding:"5px",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"5px"},children:p.jsxs("div",{style:{whiteSpace:"nowrap",minWidth:"50px"},children:["value: ",Number(Jh(A.max))]})})})},[e.svgRef,e.width,e.height,t.delta]);w.useEffect(()=>{u(l?l[0]:void 0)},[l]);const v=()=>{s.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0}),u(void 0)};w.useEffect(()=>{if(t.delta!=0){v();return}},[t.delta]);const E=w.useRef(Nt()),x=w.useMemo(()=>n&&n.length&&_r(n)===Ds.ValuedPoint?{renderPoints:n,range:e.range||ti(n)}:Is(n,e.width),[n,e.width,e.domain]),T=w.useMemo(()=>{const C=_s(x.range,e.height),O=x.renderPoints.filter(A=>A.min<1/0&&A.max>-1/0),P=A=>Math.max(0,Math.min(e.height,C(A)));return{maxPath:O.reduce((A,j,U,V)=>A+(j.x?kr(j.x,P(V[U-1]?V[U-1].max:0)):"")+kr(j.x,P(j.max)),"M 0 "+P(0)+" ")+kr(e.width,P(0)),minPath:O.reduce((A,j,U,V)=>A+(j.x?kr(j.x,P(V[U-1]?V[U-1].min:0)):"")+kr(j.x,P(j.min)),"M 0 "+P(0)+" ")+kr(e.width,P(0))}},[x,e.height,e.width]),S=e.color||"#000000",_=w.useMemo(()=>e.noTransparency?S:Zn(S,.5),[e]),m=e.id||E.current.toString();return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{className:e.className,width:e.width,height:e.height,clipPath:`url(#${m})`,children:[p.jsx("rect",{width:e.width,height:e.height,fill:"white",onMouseOut:v}),p.jsx("defs",{children:p.jsx(Wt,{id:m,width:e.width,height:e.height})}),p.jsx("path",{d:T.maxPath,fill:_,style:{cursor:"default",clipPath:`url(#${m})`}}),p.jsx("path",{d:T.minPath,fill:S,style:{cursor:"default",clipPath:`url(#${m})`}}),c!==void 0&&p.jsx("line",{stroke:"#ccc",x1:c-150,x2:c-150,y1:0,y2:e.height}),p.jsx("rect",{width:e.width,height:e.height,fill:"transparent",onMouseMove:C=>{f(C)},onMouseOut:()=>{v()}})]})})},td=e=>{const t=w.useRef(Nt()),r=w.useMemo(()=>e.data&&e.data.length&&e.data[0].x!==void 0?Zh(e.data):Is(e.data,100),[e.data,e.width,e.domain]);r.range||(r.range=ti(r.renderPoints));const n=w.useMemo(()=>{const i=_s(r.range,1),a=r.renderPoints.filter(s=>s.min<1/0&&s.max>-1/0),o=e.color||"#000000";return a.map(s=>Zn(o,i(s.max)))},[e.color,r]);return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{className:e.className,width:e.width,height:e.height,children:[p.jsx("defs",{children:p.jsx("linearGradient",{id:t.current,children:n.map((i,a)=>p.jsx("stop",{offset:`${a}%`,stopColor:i},`${t.current}_pt_${a}`))})}),p.jsx("rect",{width:e.width,height:e.height,fill:"white"}),p.jsx("rect",{width:e.width,height:e.height,fill:e.hoverColor||"transparent",fillOpacity:e.hoverColor?.2:0}),p.jsx("rect",{width:e.width,x:0,y:e.height/3,height:e.height/3,fill:`url('#${t.current}')`})]})})},Dr=e=>{w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]);const t=12,r=32,n=e.height,i=e.width;return p.jsxs("g",{className:e.className,width:e.width,height:e.height,transform:e.transform,children:[e.height!=0&&p.jsx("rect",{width:e.width,height:e.height,fill:"none",onClick:e.onClick}),e.error&&p.jsxs("g",{transform:`translate(${t+(i-r)/2},${(n-r)/2})`,children:[p.jsx(Yo,{width:r,height:r}),p.jsx("g",{transform:`translate(${r/2},${r+10})`,children:p.jsx("text",{textAnchor:"middle",fontSize:"12px",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.text})})]}),!e.error&&e.text&&e.height!=0&&p.jsx("text",{textAnchor:"middle",x:Math.round(+e.width/2),y:Math.round(+e.height/2),style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.text})]})},Ps={trackType:G.BIGWIG,titleSize:12,trackMargin:12,displayMode:Re.FULL,canDrag:!0,noTransparency:!0,color:"#ff5555"};function Ns(e){const t=e.data&&e.data[0]?{loading:!1}:{loading:!0},r={...e,trackType:G.BIGWIG,displayMode:e.displayMode};switch(e.displayMode){case Re.FULL:return p.jsx(et,{...r,...t,trackType:G.BIGWIG,displayMode:e.displayMode,children:p.jsx(ed,{...e})});case Re.DENSE:return p.jsx(et,{...r,...t,trackType:G.BIGWIG,displayMode:e.displayMode,children:p.jsx(td,{...e})});case Re.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(et,{...r,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function rd(e,t){const r=[];return e.forEach((n,i)=>(i===0||n.start>e[i-1].end||n.color!=e[i-1].color?r.push({start:t(n.start)<0?0:t(n.start),end:t(n.end)<0?0:t(n.end),color:n.color,name:n.name,score:n.score}):r[r.length-1].end=t(n.end),r)),r}function nd(e,t){return nn(e.sort((r,n)=>r.start-n.start).map(r=>({coordinates:{start:r.start,end:r.end},color:r.color,name:"",score:r.score,rectname:r.name})),t,0).map(r=>r.map(n=>({start:t(n.coordinates.start)<0?0:t(n.coordinates.start),end:t(n.coordinates.end),color:n.color,rectname:n.rectname,name:n.rectname,score:n.score})))}const id={fontSize:"12px",backgroundColor:"#ffffff",border:"1px solid",padding:"1em"},As=e=>p.jsxs("div",{style:id,children:[e.name?`name: ${e.name}`:"",p.jsx("br",{}),e.score!==void 0?`score: ${e.score}`:""]});function Fs(e,t,r,n,i){const a=w.useContext(Kt),o=w.useCallback((c,u)=>{if(!r||!r.current)return;const[l,d]=rr(r.current,c);a.setTooltip({show:!0,x:l>t-100?l-90:l+10,y:d+10,width:100,height:50,content:w.createElement(e,u)})},[e,t,r,a]),s=w.useCallback(()=>{a.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},[a]);return[o,s]}const ad=e=>{const[t,r]=Fs(e.tooltipContent||As,e.width,e.svgRef),n=w.useRef(Nt()),i=w.useCallback(Ct(e.domain,e.width),[e.data]),a=e.color||"#000000",o=e.id||n.current.toString(),s=w.useMemo(()=>rd(e.data||[],i),[e.width,e.data,e.domain]);return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:e.height,clipPath:`url(#${o})`,className:e.className,children:[p.jsx("rect",{width:e.width,height:e.height,fill:"white"}),p.jsx("defs",{children:p.jsx(Wt,{id:o,width:e.width,height:e.height})}),s.map((c,u)=>p.jsx("rect",{style:{cursor:e.onClick?"pointer":"default"},height:e.height*.6,width:c.end-c.start,x:c.start,y:e.height*.2,fill:c.color||a,onClick:()=>e.onClick&&e.onClick(c),onMouseOut:()=>{e.onMouseOut&&e.onMouseOut(),r()},onMouseOver:l=>{l.persist(),e.onMouseOver&&e.onMouseOver(c),t(l,c)}},`${o}_${u}`))]})})},od=e=>{const[t,r]=Fs(e.tooltipContent||As,e.width,e.svgRef),n=w.useRef(Nt()),i=w.useCallback(Ct(e.domain,e.width),[e.data]),a=w.useMemo(()=>{const c=e.data?[...e.data]:[];return nd(c,i)},[e.width,e.data,e.domain]),o=e.rowHeight*a.length,s=e.id||n.current.toString();return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(o)},[a,e.rowHeight,e.onHeightChanged]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:o,clipPath:`url(#${s})`,children:[p.jsx("rect",{width:e.width,height:o,fill:"white"}),p.jsx("defs",{children:p.jsx(Wt,{id:s,width:e.width,height:o})}),a.map((c,u)=>p.jsx("g",{transform:`translate(0, ${u*e.rowHeight})`,children:c.map((l,d)=>p.jsx("rect",{style:{cursor:e.onClick?"pointer":"default"},height:e.rowHeight*.6,width:l.end-l.start<1?1:l.end-l.start,x:l.start,y:e.rowHeight*.2,fill:l.color,onClick:()=>e.onClick&&e.onClick(l),onMouseOut:()=>{e.onMouseOut&&e.onMouseOut(),r()},onMouseOver:f=>{f.persist(),e.onMouseOver&&e.onMouseOver(l),t(f,l)}},`${s}_${d}`))},`group_${u}`))]})})},Rs={trackType:G.BIGBED,displayMode:Re.SQUISH,rowHeight:10,titleSize:12,trackMargin:12,canDrag:!0};function js(e){const t=e.data&&e.data[0]?{loading:!1}:{loading:!0},r={...e,trackType:G.BIGBED,displayMode:e.displayMode};switch(e.displayMode){case Re.DENSE:return p.jsx(et,{...r,...t,trackType:G.BIGBED,displayMode:e.displayMode,children:p.jsx(ad,{...e})});case Re.SQUISH:return p.jsx(et,{...r,...t,trackType:G.BIGBED,displayMode:e.displayMode,children:p.jsx(od,{...e})});case Re.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigBed`),p.jsx(et,{...r,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function sd(e,t){return e.coordinates.start===t.coordinates.start?e.coordinates.end-t.coordinates.end:e.coordinates.start-t.coordinates.start}function cd(e,t){return e.reduce((r,n)=>(n.transcripts.filter(i=>i.coordinates.start<t.end&&i.coordinates.end>t.start).forEach(i=>r.push({...i,strand:n.strand})),r),[]).sort((r,n)=>r.coordinates.start-n.coordinates.start)}function ud(e){if(e.length===0)return[];const t=[{coordinates:{...e[0].coordinates}}];return e.slice(1).forEach(r=>{r.coordinates.start<t[t.length-1].coordinates.end?t[t.length-1].coordinates.end=Math.max(t[t.length-1].coordinates.end,r.coordinates.end):t.push({coordinates:{...r.coordinates}})}),t}function ld(e,t){var s;const n=e.transcripts.reduce((c,u)=>[...c,...u.exons||[]],[]).sort(sd),i=n.length===0?[]:[{coordinates:{...n[0].coordinates},UTRs:n[0].UTRs&&[...n[0].UTRs]}],a=new Set(e.transcripts.map(c=>c.color));n.slice(1).forEach(c=>{c.coordinates.start<i[i.length-1].coordinates.end?(i[i.length-1].UTRs=[...i[i.length-1].UTRs||[],...c.UTRs||[]],i[i.length-1].coordinates.end=Math.max(c.coordinates.end,i[i.length-1].coordinates.end)):i.push({coordinates:{...c.coordinates},UTRs:c.UTRs&&[...c.UTRs]})}),i.forEach(c=>{c.UTRs=ud(c.UTRs||[])});let o=a.size===1?a.values().next().value:void 0;return t&&(o=(s=e.name)!=null&&s.includes(t)?"#ff5555":o),{name:e.name||"",strand:e.strand,id:e.id||"",coordinates:{start:Math.min(...n.map(c=>c.coordinates.start)),end:Math.max(...n.map(c=>c.coordinates.end))},exons:i,color:o}}function fd(e,t,r){var n;return{strand:e.strand,name:e.name,id:e.id,color:e.color,coordinates:{end:t(e.coordinates.end),start:t(e.coordinates.start)},exons:((n=e.exons)==null?void 0:n.filter(i=>i.coordinates.end>r.start&&i.coordinates.start<r.end).map(i=>{var a;return{coordinates:{start:t(i.coordinates.start),end:t(i.coordinates.end)},UTRs:((a=i.UTRs)==null?void 0:a.map(o=>({coordinates:{start:t(o.coordinates.start),end:t(o.coordinates.end)}})))||[]}}))||[]}}function hd(e,t,r,n,i,a){let o="";if(e=e<0?0:e,t=t>a?a:t,r==="+")for(let s=e+10;s<t-10;s+=20)o+=Cr(s-i,n-i)+Ce(s,n)+Ce(s-i,n+i)+Ce(s,n)+Ce(s-i,n-i);else if(r==="-")for(let s=e+10;s<t-10;s+=20)o+=Cr(s+i,n-i)+Ce(s,n)+Ce(s+i,n+i)+Ce(s,n)+Ce(s+i,n-i);return o+" M "+e+" "+n+" L "+t+" "+n}function dd(e,t,r,n){var d,f;if(e.coordinates.start>n||e.coordinates.end<0)return"";const i=((d=e.UTRs)==null?void 0:d.filter(v=>v.coordinates.start===e.coordinates.start))||[],a=((f=e.UTRs)==null?void 0:f.filter(v=>v.coordinates.end===e.coordinates.end))||[],o=t-r*.2,s=t+r*.2,c=t-r*.3,u=t+r*.3;if(!i[0]&&!a[0])return Cr(e.coordinates.start,c)+Ce(e.coordinates.end,c)+Ce(e.coordinates.end,u)+Ce(e.coordinates.start,u)+Ce(e.coordinates.start,c);if(i[0]&&i[0].coordinates.end===e.coordinates.end)return Cr(i[0].coordinates.start,o)+Ce(i[0].coordinates.end,o)+Ce(i[0].coordinates.end,s)+Ce(i[0].coordinates.start,s)+Ce(i[0].coordinates.start,o);let l=i[0]?Cr(i[0].coordinates.start,o)+Ce(i[0].coordinates.end,o)+Ce(i[0].coordinates.end,c):Cr(e.coordinates.start,c);return l+=a[0]?Ce(a[0].coordinates.start,c)+Ce(a[0].coordinates.start,o)+Ce(a[0].coordinates.end,o)+Ce(a[0].coordinates.end,s)+Ce(a[0].coordinates.start,s)+Ce(a[0].coordinates.start,u):Ce(e.coordinates.end,c)+Ce(e.coordinates.end,u),l+(i[0]?Ce(i[0].coordinates.end,u)+Ce(i[0].coordinates.end,s)+Ce(i[0].coordinates.start,s)+Ce(i[0].coordinates.start,o):Ce(e.coordinates.start,u)+Ce(e.coordinates.start,c))}function Vs(e,t,r,n,i){var s;const a=fd(e,t,r),o={exons:((s=a.exons)==null?void 0:s.reduce((c,u)=>c+dd(u,n/2,n,i),""))||"",introns:hd(a.coordinates.start,a.coordinates.end,a.strand,n/2,n*.19,i)};return{transcript:a,paths:o}}const pd=e=>{const t=w.useContext(Kt),r=(l,d)=>{if(e.svgRef){const f=rr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-150?f[0]-150+5:f[0]+5,y:f[1],width:150,height:50,content:p.jsx("span",{style:{fontSize:"10px"},children:d.id})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=w.useRef(Nt()),a=w.useCallback(Ct(e.domain,e.width),[e.data]),o=e.color||"#000000",s=fa(e.rowHeight)*1.25,c=w.useMemo(()=>nn(cd(e.data||[],e.domain),a,s).map((l,d)=>({y:d*e.rowHeight,transcripts:l.map(f=>Vs(f,a,e.domain,e.rowHeight,e.width))})),[e.data,e.rowHeight,e.width,e.domain]),u=w.useMemo(()=>Math.max(e.rowHeight*c.length,35),[e.rowHeight,c.length]);return console.log(u),w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(u)},[u]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{children:[p.jsx("rect",{width:e.width,height:u,fill:"white"}),p.jsx("defs",{children:p.jsx(Wt,{id:i.current,width:e.width,height:c.length*e.rowHeight})}),c.map((l,d)=>p.jsx("g",{style:{clipPath:`url(#${i.current})`},transform:`translate(0,${l.y})`,height:e.rowHeight,width:e.width,children:l.transcripts.map((f,v)=>p.jsxs(w.Fragment,{children:[p.jsx("path",{stroke:f.transcript.color||o,fill:f.transcript.color||o,strokeWidth:e.rowHeight/16,d:f.paths.introns+f.paths.exons,style:{cursor:e.onTranscriptClick?"pointer":"default"},onMouseOver:E=>r(E,f.transcript),onMouseOut:n,onClick:()=>e.onTranscriptClick&&e.onTranscriptClick(f.transcript)}),p.jsx("text",{fill:f.transcript.color||o,fontSize:s,x:f.transcript.coordinates.end+5,y:e.rowHeight/2,dominantBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:f.transcript.name})]},`transcript_${v}`))},`row_${d}`))]})})},gd=e=>{const t=w.useContext(Kt),r=(l,d)=>{if(e.svgRef){const f=rr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-150?f[0]-150+5:f[0]+5,y:f[1],width:150,height:50,content:p.jsx("span",{style:{fontSize:"10px"},children:d.id})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=w.useRef(Nt()),a=w.useCallback(Ct(e.domain,e.width),[e.data]),o=e.color||"#000000",s=fa(e.rowHeight)*1.25,c=w.useMemo(()=>{var l;return nn(((l=e.data)==null?void 0:l.map(d=>ld(d,e.geneName)))||[],a,s).map((d,f)=>({y:f*e.rowHeight,transcripts:d.map(v=>Vs(v,a,e.domain,e.rowHeight,e.width))}))},[e.data,e.rowHeight,e.width,e.domain]),u=w.useMemo(()=>Math.max(e.rowHeight*c.length,35),[e.rowHeight,c.length]);return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(u)},[u]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{children:[p.jsx("rect",{width:e.width,height:u,fill:"white"}),p.jsx("defs",{children:p.jsx(Wt,{id:i.current,width:e.width,height:c.length*e.rowHeight})}),c.map((l,d)=>p.jsx("g",{style:{clipPath:`url(#${i.current})`},transform:`translate(0,${l.y})`,height:e.rowHeight,width:e.width,children:l.transcripts.map((f,v)=>p.jsxs(w.Fragment,{children:[p.jsx("path",{stroke:f.transcript.color||o,fill:f.transcript.color||o,strokeWidth:e.rowHeight/16,d:f.paths.introns+f.paths.exons,style:{cursor:e.onTranscriptClick?"pointer":"default"},onMouseOver:E=>r(E,f.transcript),onMouseOut:n,onClick:()=>e.onTranscriptClick&&e.onTranscriptClick(f.transcript)}),p.jsx("text",{fill:f.transcript.color||o,fontSize:s,x:f.transcript.coordinates.end+5,y:e.rowHeight/2,dominantBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:f.transcript.name})]},`transcript_${v}`))},`row_${d}`))]})})},qs={trackType:G.TRANSCRIPT,displayMode:Re.SQUISH,rowHeight:14,titleSize:12,trackMargin:12,canDrag:!0};function $s(e){const[t,r]=w.useState(!e.data),[n,i]=w.useState(e.data),a={...e,trackType:G.TRANSCRIPT,displayMode:e.displayMode};switch(w.useEffect(()=>{e.data?(i(e.data),r(!1)):r(!0)},[e.data]),w.useEffect(()=>{e.refetch&&e.refetch({variables:{assembly:e.assembly,chromosome:e.domain.chromosome,start:e.domain.start,end:e.domain.end,version:e.version}}).then(({data:o,loading:s,error:c})=>{i(o.gene),r(s)})},[e.version]),e.displayMode){case Re.PACK:return p.jsx(et,{...a,loading:t,trackType:G.TRANSCRIPT,displayMode:e.displayMode,children:p.jsx(pd,{...e,data:n})});case Re.SQUISH:return p.jsx(et,{...a,loading:t,trackType:G.TRANSCRIPT,displayMode:e.displayMode,children:p.jsx(gd,{...e,data:n})});case Re.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(et,{...a,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function vd(e,t){const r=[];return e.sort((n,i)=>n.start-i.start).forEach((n,i)=>(i===0||n.start>e[i-1].end||n.color!=e[i-1].color?r.push({start:t(n.start)<0?0:t(n.start),end:t(n.end),color:n.color,cigarOps:n.cigarOps,strand:n.strand,seq:n.seq}):r[r.length-1].end=t(n.end),r)),r}function yd(e,t,r){return nn(e.sort((n,i)=>n.start-i.start).map(n=>({coordinates:{start:n.start,end:n.end},color:n.color,name:"",cigarOps:n.cigarOps,strand:n.strand,seq:n.seq})),t,0).map(n=>n.map(i=>{var a;return{start:t(i.coordinates.start)<0?0:t(i.coordinates.start),end:t(i.coordinates.end),color:i.color,cigarOps:i.cigarOps.map(o=>({opStart:t(o.opStart)<0?0:t(o.opStart),opEnd:t(o.opEnd),op:o.op})),strand:i.strand,seq:t(i.coordinates.start)<0?(a=i.seq)==null?void 0:a.slice(r.start-i.coordinates.start,i.seq.length):i.seq}}))}const md=e=>{const t=w.useRef(Nt()),r=Ct(e.domain,e.width),n=e.color||"#000000",i=w.useMemo(()=>yd(e.data,r,e.domain),[e.data,e.domain,e.width]),a=e.rowHeight*i.length,o=e.id||t.current.toString();return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(a)},[i,e.rowHeight,e.onHeightChanged]),p.jsxs("g",{width:e.width,height:a,transform:e.transform,clipPath:`url(#${o})`,children:[p.jsx("defs",{children:p.jsx(Wt,{id:o,width:e.width,height:a})}),i.map((s,c)=>p.jsx("g",{transform:`translate(0, ${c*e.rowHeight})`,children:s.map((u,l)=>{const d=u.cigarOps.map((f,v)=>{let E;return f.op==="S"?E=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,style:{fill:"none",strokeDasharray:"2,2",stroke:"black",strokeWidth:.5}},`${l}_${v}`):f.op==="I"?E=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,fill:"#ff69b4",children:p.jsx("title",{children:"Insertion"})},`${l}_${v}`):f.op==="D"||f.op==="N"?E=p.jsx("line",{y2:e.rowHeight*.2+e.rowHeight*.6/2,x2:f.opEnd,x1:f.opStart,y1:e.rowHeight*.2+e.rowHeight*.6/2,stroke:"red"},`${l}_${v}`):E=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,fill:u.strand!==void 0?u.strand?"#F7F71A":"#53F71A":u.color||n},`${l}_${v}`),E});return p.jsxs("g",{children:[d,e.domain.end-e.domain.start<=200&&u.seq&&p.jsx("text",{fontSize:8,x:u.start,y:e.rowHeight*.2+e.rowHeight*.5,fill:"black",textLength:u.end-u.start,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:u.seq})]},e.id+"_"+l)})},`group_${c}`))]})},bd=e=>{const t=w.useRef(Nt()),r=Ct(e.domain,e.width),n=e.color||"#000000",i=e.id||t.current.toString(),a=w.useMemo(()=>vd(e.data,r),[e.domain,e.width,e.data]);return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsxs("g",{width:e.width,height:e.height,transform:e.transform,clipPath:`url(#${i})`,children:[p.jsx("defs",{children:p.jsx(Wt,{id:i,width:e.width,height:e.height})}),a.map((o,s)=>p.jsx("rect",{height:e.height*.6,width:o.end-o.start,x:o.start,y:e.height*.2,fill:o.strand!==void 0?o.strand?"#F7F71A":"#53F71A":o.color||n},`${i}_${s}`))]})},Ed={displayMode:Re.DENSE,rowHeight:10};function wd(e){const t=e.data&&e.data[0]?{loading:!1}:{loading:!0},r={...e,trackType:G.BIGBED,displayMode:e.displayMode};switch(e.displayMode){case Re.DENSE:return p.jsx(et,{...r,...t,trackType:G.BAM,displayMode:e.displayMode,children:p.jsx(bd,{...e})});case Re.SQUISH:return p.jsx(et,{...r,...t,trackType:G.BAM,displayMode:e.displayMode,children:p.jsx(md,{...e})});case Re.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigBed`),p.jsx(et,{...r,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function xd(e,t){return r=>t.start+(t.end-t.start)*((r-e.start)/(e.end-e.start))}function Od(e,t){const r=e.map(t),n=Math.min(...r),i=Math.max(...r);return{start:n>0?0:n,end:i<0?0:i}}function Sd(e){return t=>{const r=e((t<0,t)),n=e((t<0,0)),i=Math.abs(n-r)/100;return[r*(t<0?-1:1),i,t<0?"scale(1,-1)":""]}}function Td(e,t){const r=w.useMemo(()=>Md(e)?e.importance.map((o,s)=>({base:e.sequence.charAt(s),importance:o})):e,[e]),n=w.useMemo(()=>Od(r,o=>o.importance),[r]),i=xd(n,{start:t,end:0}),a=w.useCallback(Sd(i),[n,t]);return[r,a,i]}function Cd(e,t,r){return w.useMemo(()=>e.map(n=>{const i=t.slice(n.coordinates[0],n.coordinates[1]+1).map(s=>s.importance),a=[Math.min(...i),Math.max(...i)],o=r(a[1]);return{...n,y:o,height:r(a[0])-o}}),[e,r])}var Us={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(Rf,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{enumerable:!0,get:s})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,o){if(1&o&&(a=i(a)),8&o||4&o&&typeof a=="object"&&a&&a.__esModule)return a;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:a}),2&o&&typeof a!="string")for(var c in a)i.d(s,c,(function(u){return a[u]}).bind(null,c));return s},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="/",i(i.s=5)}([function(r,n,i){r.exports=i(3)},function(r,n,i){r.exports=i(4)},function(r,n,i){/*
|
|
51
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&ys(e.body,"react-draggable-transparent-selection")}function gd(e){if(e)try{if(e.body&&ms(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function ys(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function ms(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.canDragX=md,Ht.canDragY=bd,Ht.createCoreData=wd,Ht.createDraggableData=xd,Ht.getBoundPosition=vd,Ht.getControlPosition=Ed,Ht.snapToGrid=yd;var Tt=Bt,Tr=Be;function vd(e,t,r){if(!e.props.bounds)return[t,r];let{bounds:n}=e.props;n=typeof n=="string"?n:Sd(n);const i=ia(e);if(typeof n=="string"){const{ownerDocument:a}=i,o=a.defaultView;let s;if(n==="parent"?s=i.parentNode:s=a.querySelector(n),!(s instanceof o.HTMLElement))throw new Error('Bounds selector "'+n+'" could not find an element.');const c=s,u=o.getComputedStyle(i),l=o.getComputedStyle(c);n={left:-i.offsetLeft+(0,Tt.int)(l.paddingLeft)+(0,Tt.int)(u.marginLeft),top:-i.offsetTop+(0,Tt.int)(l.paddingTop)+(0,Tt.int)(u.marginTop),right:(0,Tr.innerWidth)(c)-(0,Tr.outerWidth)(i)-i.offsetLeft+(0,Tt.int)(l.paddingRight)-(0,Tt.int)(u.marginRight),bottom:(0,Tr.innerHeight)(c)-(0,Tr.outerHeight)(i)-i.offsetTop+(0,Tt.int)(l.paddingBottom)-(0,Tt.int)(u.marginBottom)}}return(0,Tt.isNum)(n.right)&&(t=Math.min(t,n.right)),(0,Tt.isNum)(n.bottom)&&(r=Math.min(r,n.bottom)),(0,Tt.isNum)(n.left)&&(t=Math.max(t,n.left)),(0,Tt.isNum)(n.top)&&(r=Math.max(r,n.top)),[t,r]}function yd(e,t,r){const n=Math.round(t/e[0])*e[0],i=Math.round(r/e[1])*e[1];return[n,i]}function md(e){return e.props.axis==="both"||e.props.axis==="x"}function bd(e){return e.props.axis==="both"||e.props.axis==="y"}function Ed(e,t,r){const n=typeof t=="number"?(0,Tr.getTouch)(e,t):null;if(typeof t=="number"&&!n)return null;const i=ia(r),a=r.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,Tr.offsetXYFromParent)(n||e,a,r.props.scale)}function wd(e,t,r){const n=!(0,Tt.isNum)(e.lastX),i=ia(e);return n?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:r,x:t,y:r}:{node:i,deltaX:t-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:r}}function xd(e,t){const r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}}function Sd(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function ia(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Gn={},Yn={};Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.default=Od;function Od(){}Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.default=void 0;var aa=Cd(w),bt=sa(us),Td=sa(tn),pt=Be,er=Ht,oa=Bt,rn=sa(Yn);function sa(e){return e&&e.__esModule?e:{default:e}}function bs(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(bs=function(n){return n?r:t})(e)}function Cd(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=bs(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(a!=="default"&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}function vt(e,t,r){return t=_d(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _d(e){var t=kd(e,"string");return typeof t=="symbol"?t:String(t)}function kd(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const It={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let tr=It.mouse,Kn=class extends aa.Component{constructor(){super(...arguments),vt(this,"dragging",!1),vt(this,"lastX",NaN),vt(this,"lastY",NaN),vt(this,"touchIdentifier",null),vt(this,"mounted",!1),vt(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const r=this.findDOMNode();if(!r||!r.ownerDocument||!r.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=r;if(this.props.disabled||!(t.target instanceof n.defaultView.Node)||this.props.handle&&!(0,pt.matchesSelectorAndParentsTo)(t.target,this.props.handle,r)||this.props.cancel&&(0,pt.matchesSelectorAndParentsTo)(t.target,this.props.cancel,r))return;t.type==="touchstart"&&t.preventDefault();const i=(0,pt.getTouchIdentifier)(t);this.touchIdentifier=i;const a=(0,er.getControlPosition)(t,i,this);if(a==null)return;const{x:o,y:s}=a,c=(0,er.createCoreData)(this,o,s);(0,rn.default)("DraggableCore: handleDragStart: %j",c),(0,rn.default)("calling",this.props.onStart),!(this.props.onStart(t,c)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,pt.addUserSelectStyles)(n),this.dragging=!0,this.lastX=o,this.lastY=s,(0,pt.addEvent)(n,tr.move,this.handleDrag),(0,pt.addEvent)(n,tr.stop,this.handleDragStop))}),vt(this,"handleDrag",t=>{const r=(0,er.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let s=n-this.lastX,c=i-this.lastY;if([s,c]=(0,er.snapToGrid)(this.props.grid,s,c),!s&&!c)return;n=this.lastX+s,i=this.lastY+c}const a=(0,er.createCoreData)(this,n,i);if((0,rn.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(t,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const c=document.createEvent("MouseEvents");c.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(c)}return}this.lastX=n,this.lastY=i}),vt(this,"handleDragStop",t=>{if(!this.dragging)return;const r=(0,er.getControlPosition)(t,this.touchIdentifier,this);if(r==null)return;let{x:n,y:i}=r;if(Array.isArray(this.props.grid)){let c=n-this.lastX||0,u=i-this.lastY||0;[c,u]=(0,er.snapToGrid)(this.props.grid,c,u),n=this.lastX+c,i=this.lastY+u}const a=(0,er.createCoreData)(this,n,i);if(this.props.onStop(t,a)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,pt.removeUserSelectStyles)(s.ownerDocument),(0,rn.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,rn.default)("DraggableCore: Removing handlers"),(0,pt.removeEvent)(s.ownerDocument,tr.move,this.handleDrag),(0,pt.removeEvent)(s.ownerDocument,tr.stop,this.handleDragStop))}),vt(this,"onMouseDown",t=>(tr=It.mouse,this.handleDragStart(t))),vt(this,"onMouseUp",t=>(tr=It.mouse,this.handleDragStop(t))),vt(this,"onTouchStart",t=>(tr=It.touch,this.handleDragStart(t))),vt(this,"onTouchEnd",t=>(tr=It.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,pt.addEvent)(t,It.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:r}=t;(0,pt.removeEvent)(r,It.mouse.move,this.handleDrag),(0,pt.removeEvent)(r,It.touch.move,this.handleDrag),(0,pt.removeEvent)(r,It.mouse.stop,this.handleDragStop),(0,pt.removeEvent)(r,It.touch.stop,this.handleDragStop),(0,pt.removeEvent)(t,It.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,pt.removeUserSelectStyles)(r)}}findDOMNode(){var t,r;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(r=this.props)===null||r===void 0||(r=r.nodeRef)===null||r===void 0?void 0:r.current:Td.default.findDOMNode(this)}render(){return aa.cloneElement(aa.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Gn.default=Kn,vt(Kn,"displayName","DraggableCore"),vt(Kn,"propTypes",{allowAnyClick:bt.default.bool,children:bt.default.node.isRequired,disabled:bt.default.bool,enableUserSelectHack:bt.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:bt.default.arrayOf(bt.default.number),handle:bt.default.string,cancel:bt.default.string,nodeRef:bt.default.object,onStart:bt.default.func,onDrag:bt.default.func,onStop:bt.default.func,onMouseDown:bt.default.func,scale:bt.default.number,className:oa.dontSetMe,style:oa.dontSetMe,transform:oa.dontSetMe}),vt(Kn,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=f(w),r=l(us),n=l(tn),i=l(Wf),a=Be,o=Ht,s=Bt,c=l(Gn),u=l(Yn);function l(_){return _&&_.__esModule?_:{default:_}}function d(_){if(typeof WeakMap!="function")return null;var m=new WeakMap,C=new WeakMap;return(d=function(S){return S?C:m})(_)}function f(_,m){if(_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var C=d(m);if(C&&C.has(_))return C.get(_);var S={},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in _)if(A!=="default"&&Object.prototype.hasOwnProperty.call(_,A)){var j=P?Object.getOwnPropertyDescriptor(_,A):null;j&&(j.get||j.set)?Object.defineProperty(S,A,j):S[A]=_[A]}return S.default=_,C&&C.set(_,S),S}function v(){return v=Object.assign?Object.assign.bind():function(_){for(var m=1;m<arguments.length;m++){var C=arguments[m];for(var S in C)Object.prototype.hasOwnProperty.call(C,S)&&(_[S]=C[S])}return _},v.apply(this,arguments)}function E(_,m,C){return m=x(m),m in _?Object.defineProperty(_,m,{value:C,enumerable:!0,configurable:!0,writable:!0}):_[m]=C,_}function x(_){var m=T(_,"string");return typeof m=="symbol"?m:String(m)}function T(_,m){if(typeof _!="object"||_===null)return _;var C=_[Symbol.toPrimitive];if(C!==void 0){var S=C.call(_,m||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(_)}class O extends t.Component{static getDerivedStateFromProps(m,C){let{position:S}=m,{prevPropsPosition:P}=C;return S&&(!P||S.x!==P.x||S.y!==P.y)?((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:S,prevPropsPosition:P}),{x:S.x,y:S.y,prevPropsPosition:{...S}}):null}constructor(m){super(m),E(this,"onDragStart",(C,S)=>{if((0,u.default)("Draggable: onDragStart: %j",S),this.props.onStart(C,(0,o.createDraggableData)(this,S))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),E(this,"onDrag",(C,S)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",S);const P=(0,o.createDraggableData)(this,S),A={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:U,y:V}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[me,Le]=(0,o.getBoundPosition)(this,A.x,A.y);A.x=me,A.y=Le,A.slackX=this.state.slackX+(U-A.x),A.slackY=this.state.slackY+(V-A.y),P.x=A.x,P.y=A.y,P.deltaX=A.x-this.state.x,P.deltaY=A.y-this.state.y}if(this.props.onDrag(C,P)===!1)return!1;this.setState(A)}),E(this,"onDragStop",(C,S)=>{if(!this.state.dragging||this.props.onStop(C,(0,o.createDraggableData)(this,S))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",S);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:U,y:V}=this.props.position;A.x=U,A.y=V}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:m.position?m.position.x:m.defaultPosition.x,y:m.position?m.position.y:m.defaultPosition.y,prevPropsPosition:{...m.position},slackX:0,slackY:0,isElementSVG:!1},m.position&&!(m.onDrag||m.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var m,C;return(m=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&m!==void 0?m:n.default.findDOMNode(this)}render(){const{axis:m,bounds:C,children:S,defaultPosition:P,defaultClassName:A,defaultClassNameDragging:j,defaultClassNameDragged:U,position:V,positionOffset:me,scale:Le,...ye}=this.props;let Se={},Ve=null;const Y=!!!V||this.state.dragging,$=V||P,Z={x:(0,o.canDragX)(this)&&Y?this.state.x:$.x,y:(0,o.canDragY)(this)&&Y?this.state.y:$.y};this.state.isElementSVG?Ve=(0,a.createSVGTransform)(Z,me):Se=(0,a.createCSSTransform)(Z,me);const N=(0,i.default)(S.props.className||"",A,{[j]:this.state.dragging,[U]:this.state.dragged});return t.createElement(c.default,v({},ye,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(S),{className:N,style:{...S.props.style,...Se},transform:Ve}))}}e.default=O,E(O,"displayName","Draggable"),E(O,"propTypes",{...c.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),E(O,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Xo);const{default:Es,DraggableCore:Dd}=Xo;zn.exports=Es,zn.exports.default=Es,zn.exports.DraggableCore=Dd;var Md=zn.exports;const Xn=Ko(Md);var Ae=(e=>(e.FULL="full",e.DENSE="dense",e.SQUISH="squish",e.PACK="pack",e.HIDE="hide",e.DOWNLOAD="download",e))(Ae||{}),J=(e=>(e.UNDEFINED="undefined",e.RULER="ruler",e.BIGWIG="bigwig",e.BIGBED="bigbed",e.IMPORTANCE="importance",e.TRANSCRIPT="transcript",e.BAM="bam",e.MOTIF="motif",e.LDTRACK="ldtrack",e))(J||{});function Ld(e){return null}function Id(e){return null}var Jn=(e=>(e[e.V29=29]="V29",e[e.V40=40]="V40",e[e.V47=47]="V47",e))(Jn||{}),ca=(e=>(e[e.V21=21]="V21",e[e.V25=25]="V25",e[e.V36=36]="V36",e))(ca||{});function Pd(e){return null}const vr=w.createContext({}),Pt=w.createContext(()=>{});var ue=(e=>(e.SET_DOMAIN="setDomain",e.SHIFT_DOMAIN="shiftDomain",e.ZOOM_DOMAIN="zoomDomain",e.SLIDE_DOMAIN="slideDomain",e.SET_DELTA="setDelta",e.ADD_TRACK="addTrack",e.UPDATE_TRACK="updateTrack",e.SET_TRACK_HEIGHT="setTrackHeight",e.SET_TRACK_DATA="setTrackData",e.SET_LOADING="setLoading",e.SWAP_TRACKS="swapTracks",e.RELOAD_TRACKS="reloadTracks",e.SHIFT_TRACK="shiftTrack",e.REMOVE_TRANSLATION="removeTranslation",e.INSERT_TRACK="insertTrack",e.DELETE_TRACK="deleteTrack",e.TRANSLATE_TRACK="translateTrack",e.SET_RANGE="setRange",e.UPDATE_PROPS="updateProps",e.BRING_TO_TOP="bringToTop",e.SET_HOVER="setHover",e.ADD_HIGHLIGHT="addHighlight",e.REMOVE_LAST_HIGHLIGHT="removeLastHighlight",e.REMOVE_HIGHLIGHT="removeHighlight",e))(ue||{});function Nd(e,t){switch(t.type){case"setDomain":const r=t.domain,n=Math.floor((r.end-r.start)/e.preRenderedWidth);return{...e,domain:t.domain,zoomLevel:n};case"addTrack":return e.tracks.find(m=>m.id===t.track.id)?e:{...e,tracks:[...e.tracks,t.track]};case"updateTrack":const a=e.tracks.find(m=>m.id===t.id);if(a){const m={...a,...t.track};return{...e,tracks:e.tracks.map(C=>C.id===t.id?m:C)}}return e;case"setTrackHeight":return{...e,tracks:e.tracks.map(m=>m.id===t.id?{...m,actualHeight:t.height}:m)};case"setTrackData":return{...e,tracks:e.tracks.map(m=>m.id===t.id?{...m,data:t.data}:m)};case"shiftDomain":const o=Math.floor(t.delta/e.preRenderedWidth*(e.domain.end-e.domain.start));return{...e,domain:{...e.domain,start:e.domain.start-o,end:e.domain.end-o}};case"setLoading":return{...e,tracks:e.tracks.map(m=>({...m,data:void 0,...m.trackType===J.MOTIF?{peaks:void 0}:{}}))};case"shiftTrack":const s=e.tracks.findIndex(m=>m.id===t.id1);if(s===-1)return e;const c=e.tracks.findIndex(m=>m.id===t.id2);if(c<0||c>=e.tracks.length)return e;const u=[...e.tracks],[l]=u.splice(s,1);return u.splice(c,0,l),{...e,tracks:u};case"swapTracks":const d=e.tracks.findIndex(m=>m.id===t.id1);if(d===-1)return e;const f=e.tracks.findIndex(m=>m.id===t.id2);if(f<0||f>=e.tracks.length)return e;const v=[...e.tracks];return[v[d],v[f]]=[v[f],v[d]],{...e,tracks:v};case"translateTrack":const E=e.tracks.find(m=>m.id===t.id);if(!E)return e;const x={...E.props,transform:`translate(0, ${t.dist})`};return{...e,tracks:e.tracks.map(m=>m.id===E.id?{...m,props:x}:m)};case"removeTranslation":return t.id==="ALL"?{...e,tracks:e.tracks.map(m=>{if(!m.props)return m;const{transform:C,...S}=m.props;return{...m,props:S}})}:{...e,tracks:e.tracks.map(m=>m.id===t.id?{...m,props:(()=>{if(!m.props)return m.props;const{transform:C,...S}=m.props;return S})()}:m)};case"insertTrack":return{...e,tracks:[...e.tracks.slice(0,t.index),t.track,...e.tracks.slice(t.index)]};case"deleteTrack":return{...e,tracks:e.tracks.filter(m=>m.id!==t.id)};case"setRange":return{...e,tracks:e.tracks.map(m=>m.id===t.id?{...m,props:{...m.props,range:t.range}}:m)};case"updateProps":return{...e,tracks:e.tracks.map(m=>m.id===t.id?{...m,props:{...m.props,...t.props}}:m)};case"bringToTop":const T=e.tracks.find(m=>m.id===t.id);return T?{...e,tracks:[T,...e.tracks.filter(m=>m.id!==t.id)]}:e;case"setDelta":return{...e,delta:t.delta};case"zoomDomain":const O=(e.domain.start+e.domain.end)/2,_=(e.domain.end-e.domain.start)*t.factor;return{...e,domain:{...e.domain,start:Math.floor(O-_/2),end:Math.ceil(O+_/2)},zoomLevel:e.zoomLevel};case"slideDomain":return{...e,domain:{...e.domain,start:e.domain.start+t.delta,end:e.domain.end+t.delta}};case"addHighlight":return e.highlights.some(m=>m.id===t.highlight.id)?e:{...e,highlights:[...e.highlights,t.highlight]};case"removeLastHighlight":return e.highlights.length===0||e.highlights[e.highlights.length-1].domain.chromosome?e:{...e,highlights:e.highlights.slice(0,-1)};case"removeHighlight":return{...e,highlights:e.highlights.filter(m=>m.id!==t.id)};default:return e}}const ws=w.createContext(!1);function Ad({canDrag:e,id:t,height:r,children:n}){var Pe;const a=w.useRef(null),o=w.useContext(Pt),s=w.useContext(vr),[c,u]=w.useState(0),[l,d]=w.useState({x:0,y:0}),[f,v]=w.useState(!1),[E,x]=w.useState({x:0,y:0}),[T,O]=w.useState([]),[_,m]=w.useState([]),[C,S]=w.useState(-1),[P,A]=w.useState(null),[j,U]=w.useState(1);w.useEffect(()=>{const Y=document.getElementById("browserSVG");if(A(Y),Y){const $=Y,Z=$.getBoundingClientRect();U(Z.width/$.viewBox.baseVal.width)}},[]);const V=w.useRef(((Pe=s.tracks)==null?void 0:Pe.find(Y=>Y.id===t))||null);w.useEffect(()=>{if(!s.tracks||f)return;const Y=s.tracks.map(N=>N.actualHeight||N.height),$=s.tracks.findIndex(N=>N.id===t);let Z=new Array(Y.length).fill(0);Z=Y.map((N,R)=>R<$?-Y.slice(R,$).reduce((K,se)=>K+se,0):R>$?Y.slice($+1,R+1).reduce((K,se)=>K+se,0):0),m(new Array(s.tracks.length).fill(!1)),O(Z)},[s.tracks?s.tracks:[]]);const me=()=>{const Y=T.reduce(($,Z,N)=>Math.abs(Z-c)<Math.abs(T[$]-c)?N:$,0);return C!=Y&&(C!=-1&&_[C]&&_[Y]&&(m($=>{const Z=[...$];return Z[C]=!1,Z}),o({type:ue.REMOVE_TRANSLATION,id:s.tracks[C].id})),m($=>{const Z=[...$];return Z[Y]=!0,Z}),o({type:ue.TRANSLATE_TRACK,id:s.tracks[Y].id,dist:c<0?r:-r}),S(Y)),Y},Le=()=>{if(!s.tracks)return;const Y=s.tracks.find(Z=>Z.id===t);if(!Y)return;const $=s.tracks.slice(0,s.tracks.indexOf(Y)).reduce((Z,N)=>Z+(N.actualHeight||N.height),0);x({x:0,y:$+80}),u(0),v(!0)},ye=()=>{s.tracks&&(d({x:0,y:0}),v(!1),o({type:ue.SHIFT_TRACK,id1:t,id2:s.tracks[me()].id}),o({type:ue.REMOVE_TRANSLATION,id:"ALL"}))},Se=(Y,$)=>{u($.y),d({x:0,y:$.y});const Z=me(),N=s.tracks.indexOf(V.current);Z==N||s.tracks[Z]},Ve=w.useRef(null);return p.jsx(ws.Provider,{value:f,children:p.jsx(Xn,{scale:j,nodeRef:a,position:l,axis:"y",handle:".swap-handle",onStart:e&&P?Le:()=>!1,onStop:ye,onDrag:Se,children:p.jsxs("g",{ref:a,"data-track-id":t,children:[!f&&n,f&&(P?tn.createPortal(p.jsx(Xn,{scale:j,nodeRef:Ve,position:{x:0,y:E.y+l.y},axis:"y",children:p.jsx("g",{ref:Ve,style:{cursor:"grabbing",filter:"drop-shadow(2px 2px 2px gray)"},children:n})}),P):n)]})})})}w.createContext({}),w.createContext(()=>{});const ua=w.createContext({delta:0,setDelta:()=>{}}),la=w.createContext({openModal:null,showModal:()=>{},closeModal:()=>{}});function Fd({children:e,browserState:t,browserDispatch:r,modalState:n,deltaContext:i}){return p.jsx(la.Provider,{value:{...n},children:p.jsx(vr.Provider,{value:t,children:p.jsx(Pt.Provider,{value:r,children:p.jsx(ua.Provider,{value:i,children:e})})})})}function Rd(e){return p.jsxs("svg",{x:e.x,y:e.y,width:e.width,height:e.height,viewBox:"0 0 24.000001 24.000001",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[p.jsx("filter",{id:"a",colorInterpolationFilters:"sRGB",height:"1.39486",width:"1.311082",x:"-.155541",y:"-.19743",children:p.jsx("feGaussianBlur",{stdDeviation:"1.2313672"})}),p.jsxs("g",{transform:"matrix(.96344673 0 0 .96344673 -123.36427 -955.289756)",children:[p.jsx("path",{d:"m132.5 995.4062c-.831 0-1.5 1.5-1.5 1.5s.669 1.5 1.5 1.5h7.6875c-.25613.088-.47997.2851-.59375.5313l-3 6c-.2396.5108.0576 1.1992.59375 1.375l1.8125.625v2.4375c.00005.5236.47642 1 1 1h1c.52358 0 .99995-.4764 1-1v-2.4375l1.8125-.625c.53611-.1758.83335-.8642.59375-1.375l-3-6c-.13219-.2754-.39056-.4647-.6875-.5313h7.78125c.831 0 1.5-1.5 1.5-1.5s-.669-1.5-1.5-1.5z",filter:"url(#a)",opacity:".2"}),p.jsx("path",{d:"m140.3125 997.375c-.31022.06-.58621.2757-.71875.5625l-3 6c-.2396.5108.0576 1.1992.59375 1.375l1.8125.625v2.4375c.00005.5236.47642 1 1 1h1c.52358 0 .99995-.4764 1-1v-2.4375l1.8125-.625c.53611-.1758.83335-.8642.59375-1.375l-3-6c-.17625-.3672-.59466-.6026-1-.5625-.0312-.001-.0625-.001-.0937 0z"}),p.jsx("path",{d:"m140.5 998.375-3 6 2.5.8437v3.1563h1v-3.1563l2.5-.8437z",fill:"#fefefe"}),p.jsxs("g",{transform:"rotate(-90)",children:[p.jsx("rect",{height:"18.999969",rx:"1.43934",ry:"1.5",width:"3.049988",x:"-997.41217",y:"131.00003"}),p.jsx("path",{d:"m-996.41217 132.00003h1v16.999969h-1z",fill:"#fefefe"})]})]})]})}function fa(e){return e/6<10?e<10?e:10:e/6}const xs=({fontSize:e,position:t,width:r,children:n})=>p.jsxs(p.Fragment,{children:[p.jsx("text",{textAnchor:"end",alignmentBaseline:"middle",y:t-3,x:r*.94,fontSize:`${e}px`,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:n}),p.jsx("line",{x1:r*.96,x2:r,y1:t,y2:t,stroke:"#aaa"})]}),jd=e=>{const t=fa(50),[r,n]=w.useState(null);w.useEffect(()=>{const E=document.getElementById("browserSVG");n(E)},[]);const{showModal:i}=w.useContext(la),[a,o]=w.useState(void 0),s=w.useContext(Pt),c=w.useContext(vr);let u=-1;c.tracks&&(u=c.tracks.findIndex(E=>E.id===e.trackId));const l=E=>{i(e.trackId,E.clientX,E.clientY)},d=E=>{E.preventDefault(),s({type:ue.BRING_TO_TOP,id:e.trackId})};w.useEffect(()=>{o(e.range)},[e.range]);const f=w.useContext(ws),v=E=>{s({type:ue.UPDATE_TRACK,id:e.trackId,track:{hoverColor:E?e.color:void 0}})};return p.jsx("svg",{style:{cursor:e.canDrag&&r?f?"grabbing":"grab":"default"},width:e.width,height:e.height,viewBox:`0 0 ${e.width} ${e.height}`,preserveAspectRatio:"xMinYMin meet",children:p.jsxs("g",{onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),height:e.height,width:e.width,children:[p.jsx("rect",{x:0,y:0,width:e.width,height:e.height,fill:"white",className:"swap-handle"}),p.jsx("rect",{x:0,y:0,width:e.width/15,height:e.height,stroke:"#000000",strokeWidth:.5,fill:e.color||"rgb(225,225,225)",style:{cursor:"default"}}),p.jsx("text",{fontSize:`${t}px`,y:e.range===void 0?e.height/2:(e.height+t)/2,x:e.width/10,alignmentBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.shortLabel}),p.jsx("line",{stroke:"#ccc",x1:e.width,x2:e.width,y1:0,y2:e.height}),e.trackType!==J.RULER&&r&&p.jsxs("svg",{x:e.width/10,y:e.range===void 0?e.height/2+5:(e.height+t)/2+5,width:35,height:20,cursor:"pointer",children:[p.jsxs("g",{onClick:l,children:[p.jsx("circle",{cx:7.5,cy:7.5,r:7.5,strokeWidth:0,fill:"transparent"}),p.jsx(Ff,{x:0,y:0,height:15,width:15})]}),u>0&&p.jsxs("g",{onClick:d,children:[p.jsx("circle",{cx:22.5,cy:7.5,r:7.5,strokeWidth:0,fill:"transparent"}),p.jsx(Rd,{x:15,y:2,height:15,width:15})]})]}),a&&p.jsxs(p.Fragment,{children:[p.jsx(xs,{position:e.rangePositions.min,width:e.width,fontSize:t||e.height/6,children:Number(a.min).toFixed(2)}),p.jsx(xs,{position:e.rangePositions.max,width:e.width,fontSize:t||e.height/6,children:Number(a.max).toFixed(2)})]})]})})};function Vd(e){return e&&e.props!==void 0}const qd=0,Ss=255;function Os(e){if(e=e.replace(/[^0-9a-f]/gi,""),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e.length===8&&(e=e.substring(0,6)),e.length!==6)throw new Error(e+" is not a valid hex color");return e}function Zn(e,t){e=Os(e);let r="#";for(let n=0;n<3;++n){const i=parseInt(e.substr(n*2,2),16),a=Math.round(Math.min(Math.max(qd,i+t*Ss),Ss)).toString(16);r+=("00"+a).substr(a.length)}return r}function Ts(e){return parseInt(Os(e),16)}function $d(e){return e>=16?e.toString(16):`0${e.toString(16)}`}const da=w.createContext({show:!1,x:0,y:0,id:"",setContextMenu:()=>{},displayMode:void 0}),Ud=e=>{const{x:t,y:r,show:n}=w.useContext(da);return p.jsx("g",{id:"context-menu",transform:`translate(${t}, ${r})`,style:{visibility:n?"visible":"hidden"},children:p.jsx("foreignObject",{width:e.width,height:e.height,children:e.children})})},rr=(e,t)=>{if(e.createSVGPoint&&e){let n=e.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}const r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]},Bd=(e,t)=>{const r=e.cloneNode(!0),n=t.cloneNode(!0);return'<?xml version="1.0" standalone="no"?>'+'<svg xmlns="http://www.w3.org/2000/svg">'+n.outerHTML.replace(/\n/g,"").replace(/[ ]{8}/g,"")+'<g transform="translate (0,50)">'+r.outerHTML.replace(/\n/g,"").replace(/[ ]{8}/g,"")+"</g></svg>"},Hd=(e,t,r)=>{const n=new Blob([Bd(e,t)],{type:"image/svg;charset=utf-8"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a)};function zd(e){return p.jsx("rect",{width:e.width,height:e.height,fill:e.hoverColor||"transparent",fillOpacity:e.hoverColor?.15:0,style:{pointerEvents:"none"}})}const Qd=(e,t)=>e||(!t||!t.substring||!t.length?"":t.length<=20?t:t.substring(0,20)+"..."),et=e=>{var _;const t=w.useContext(Pt),r=w.useContext(da);w.useEffect(()=>{const m=C=>{const S=document.getElementById("context-menu");S&&!S.contains(C.target)&&r.setContextMenu({show:!1,x:0,y:0,id:""})};return document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[r]);const n=()=>{var S,P,A,j;const m=(P=(S=e.svgRef)==null?void 0:S.current)==null?void 0:P.getElementById("wrapped-track-"+e.id),C=(j=(A=e.svgRef)==null?void 0:A.current)==null?void 0:j.getElementById("wrapped-track-ruler");Hd(m,C,e.id+".svg")},[i,a]=w.useState(e.height||0),o=w.useCallback(m=>{a(m),e.onHeightChanged&&e.onHeightChanged(m)},[e]);w.useEffect(()=>{t({type:ue.SET_TRACK_HEIGHT,id:e.id,height:i}),e.onHeightChanged&&e.height!==void 0&&e.onHeightChanged(e.height)},[e.height,i]);const s=e.trackMargin||(e.height||e.rowHeight||i)/6,c=e.titleSize||s*2.5,u=e.title?c+5:0,l=s+u,d=Qd(e.shortLabel||"",e.title||""),f=i-l,v=e.width<1e3?e.width/8:150,E=e.width-v,x=i/3,O=(_=e.displayMode)==null?void 0:_.toLowerCase();return p.jsx(Ad,{canDrag:e.canDrag||!1,id:e.id,height:i,children:p.jsxs("g",{id:"wrapped-track-"+e.id,children:[p.jsx("rect",{width:e.width,height:i,fill:"white",style:{pointerEvents:"none"}}),p.jsx("line",{stroke:"#ccc",x1:e.width,x2:e.width,y1:0,y2:i,strokeWidth:2}),e.loading&&!e.error&&p.jsx("g",{transform:`translate(${v+(E-x)/2},${(i-x)/2})`,children:p.jsx(Pf,{width:x,height:x})}),e.error&&p.jsxs("g",{transform:`translate(${v+(E-x)/2},${(i-x)/2})`,children:[p.jsx(Yo,{width:x,height:x}),p.jsx("g",{transform:`translate(${x/2},${x+10})`,children:p.jsx("text",{textAnchor:"middle",fontSize:`${e.titleSize}px`,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.error})})]}),!e.loading&&!e.error&&e.title&&p.jsx("g",{id:`title-${e.id}`,children:p.jsx("text",{style:{cursor:"default"},fill:e.titleColor||"#000000",textAnchor:"middle",x:v+E/2,y:c/2+5,fontSize:`${c}px`,transform:`translate(0,${s})`,alignmentBaseline:"baseline",children:e.title})}),!e.loading&&!e.error&&p.jsx("g",{onContextMenu:m=>{if(e.trackType==J.RULER||!e.svgRef)return;m.preventDefault();const C=rr(e.svgRef.current,m);r.setContextMenu({show:!0,x:C[0]>e.width-80?C[0]-80:C[0],y:C[1],id:e.id,displayMode:O,downloadSVG:n,displayModeOptions:Wd(e.trackType)})},transform:`translate(${v},${i-f})`,children:w.Children.map(e.children,m=>Vd(m)?w.cloneElement(m,{...m.props,height:f,width:e.width-v,hoverColor:e.hoverColor,onHeightChanged:C=>{o(C+l)}}):m)}),e.height!=0&&p.jsx(jd,{canDrag:e.canDrag||!1,trackType:e.trackType||J.UNDEFINED,trackId:e.id,color:e.color,hoverColor:e.hoverColor,shortLabel:d,width:v,height:i,rangePositions:{min:i,max:l},range:e.range}),p.jsx(zd,{width:e.width,height:i,hoverColor:e.hoverColor})]})})};function Wd(e){switch(e){case J.BIGBED:case J.BAM:return["dense","squish","hide","download"];case J.BIGWIG:return["full","dense","hide","download"];case J.TRANSCRIPT:return["pack","squish","hide","download"];case J.LDTRACK:return["full","hide","download"];case J.MOTIF:return["dense","squish","hide","download"];default:return["hide","download"]}}let ei;const Gd=new Uint8Array(16);function Yd(){if(!ei&&(ei=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ei))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ei(Gd)}const ut=[];for(let e=0;e<256;++e)ut.push((e+256).toString(16).slice(1));function Kd(e,t=0){return ut[e[t+0]]+ut[e[t+1]]+ut[e[t+2]]+ut[e[t+3]]+"-"+ut[e[t+4]]+ut[e[t+5]]+"-"+ut[e[t+6]]+ut[e[t+7]]+"-"+ut[e[t+8]]+ut[e[t+9]]+"-"+ut[e[t+10]]+ut[e[t+11]]+ut[e[t+12]]+ut[e[t+13]]+ut[e[t+14]]+ut[e[t+15]]}let Cs,ha,pa=0,ga=0;function Nt(e,t,r){let n=t&&r||0;const i=t||new Array(16);e=e||{};let a=e.node||Cs,o=e.clockseq!==void 0?e.clockseq:ha;if(a==null||o==null){const f=e.random||(e.rng||Yd)();a==null&&(a=Cs=[f[0]|1,f[1],f[2],f[3],f[4],f[5]]),o==null&&(o=ha=(f[6]<<8|f[7])&16383)}let s=e.msecs!==void 0?e.msecs:Date.now(),c=e.nsecs!==void 0?e.nsecs:ga+1;const u=s-pa+(c-ga)/1e4;if(u<0&&e.clockseq===void 0&&(o=o+1&16383),(u<0||s>pa)&&e.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");pa=s,ga=c,ha=o,s+=122192928e5;const l=((s&268435455)*1e4+c)%4294967296;i[n++]=l>>>24&255,i[n++]=l>>>16&255,i[n++]=l>>>8&255,i[n++]=l&255;const d=s/4294967296*1e4&268435455;i[n++]=d>>>8&255,i[n++]=d&255,i[n++]=d>>>24&15|16,i[n++]=d>>>16&255,i[n++]=o>>>8|128,i[n++]=o&255;for(let f=0;f<6;++f)i[n+f]=a[f];return t||Kd(i)}function Cr(e,t){return` M ${e} ${t}`}function Ce(e,t){return` L ${e} ${t}`}function Ct(e,t){return r=>(r-e.start)*t/(e.end-e.start)}function _s(e,t){return r=>e.max===e.min?0:(e.max-r)*t/(e.max-e.min)}function Xd(e,t){const r=e.end-e.start,n=t.end-t.start;return i=>(i-e.start)*n/r+t.start}function ks(e,t,r){return Ct(e||t.reduce((n,i)=>({start:i.start<n.start?i.start:n.start,end:i.end>n.end?i.end:n.end}),{start:1/0,end:-1/0}),r)}function nn(e,t,r,n=10){return r=r||0,e.reduce((i,a)=>{let o=!1;for(let s=0;s<i.length;++s)if(t(i[s][i[s].length-1].coordinates.end)+n+r*i[s][i[s].length-1].name.length<=t(a.coordinates.start)){i[s].push(a),o=!0;break}return o||i.push([a]),i},[])}function Jd(e){return e==null?"":""+(e<1e5?e===Math.floor(e)?e:e.toFixed(2):e.toExponential(2))}const zt=({width:e,height:t,id:r})=>p.jsx("clipPath",{id:r,children:p.jsx("rect",{x:0,y:0,width:e,height:t})}),Kt=w.createContext({show:!1,x:0,y:0,width:0,height:0,content:void 0,setTooltip:()=>{}});var Ds=(e=>(e.ValuedPoint="valuedPoint",e.BigZoomData="bigZoomData",e.BigWigData="bigWigData",e))(Ds||{});function _r(e){return e[0].x!==void 0?"valuedPoint":e[0].minVal!==void 0?"bigZoomData":"bigWigData"}function va(e){return _r(e)==="bigWigData"?e.map(t=>({...t})):_r(e)==="bigZoomData"?e.map(t=>({...t})):_r(e)==="valuedPoint"?e.map(t=>({...t})):[]}const Ms=(e,t)=>{switch(_r(e)){case"bigWigData":return e.forEach(r=>{r.value<t.min&&(r.value=t.min),r.value>t.max&&(r.value=t.max)}),e;case"bigZoomData":return e.forEach(r=>{r.minVal<t.min&&(r.minVal=t.min),r.maxVal>t.max&&(r.maxVal=t.max)}),e;case"valuedPoint":return e.forEach(r=>{r.min<t.min&&(r.min=t.min),r.max>t.max&&(r.max=t.max)}),e;default:return[]}},ya=(e,t)=>({min:e.reduce((r,n)=>t(n)<r?t(n):r,1/0),max:e.reduce((r,n)=>t(n)>r?t(n):r,-1/0)}),ti=e=>{switch(_r(e)){case"bigWigData":return ya(e,t=>t.value);case"bigZoomData":return ya(e,t=>t.maxVal);case"valuedPoint":return ya(e,t=>t.max);default:return{min:0,max:0}}};function Ls(e){return e.value!==void 0}const Zd=e=>{const t={start:e[0].x,end:e[e.length-1].x},r=ks(t,e.map(i=>({start:i.x,end:i.x+1})),100),n=[];for(let i=0;i<=100;++i)n.push({x:i,max:-1/0,min:1/0});return e.reduce((i,a)=>{const o=Math.floor(r(a.x)),s=Math.floor(r(a.x));a.min<i.renderPoints[o].min&&(i.renderPoints[o].min=a.min),a.max>i.renderPoints[o].max&&(i.renderPoints[o].max=a.max);for(let c=o+1;c<=s;++c)i.renderPoints[c].min=a.min,i.renderPoints[c].max=a.max;return a.min<i.range.min&&(i.range.min=a.min),a.max>i.range.max&&(i.range.max=a.max),i},{renderPoints:n,range:{max:-1/0,min:1/0}})};function Is(e,t){if(!e)return{renderPoints:[],range:{max:1,min:0}};const r=e.reduce((s,c)=>({start:c.start<s.start?c.start:s.start,end:c.end>s.end?c.end:s.end}),{start:1/0,end:-1/0}),n=ks(r,e,t),i=[],a={start:Math.floor(n(e[0].start)),end:Math.floor(n(e[e.length-1].end))};for(let s=a.start;s<a.end;++s)i.push({x:s,max:-1/0,min:1/0});const o={renderPoints:i,range:{max:-1/0,min:1/0}};return e.forEach(s=>{const c=Math.floor(n(s.start)),u=Math.floor(n(s.end)),l=Ls(s)?s.value:s.minVal,d=Ls(s)?s.value:s.maxVal;l<o.renderPoints[c].min&&(o.renderPoints[c].min=l),d>o.renderPoints[c].max&&(o.renderPoints[c].max=d);for(let f=c+1;f<u;++f)o.renderPoints[f].min=l,o.renderPoints[f].max=d;l<o.range.min&&(o.range.min=l),d>o.range.max&&(o.range.max=d)}),o}function Dt({canDrag:e,children:t}){const r=w.useRef(null),n=w.useContext(Pt),[i,a]=w.useState(!1),{delta:o,setDelta:s}=w.useContext(ua),[c,u]=w.useState({x:0,y:0}),[l,d]=w.useState(null),[f,v]=w.useState(1);w.useEffect(()=>{const T=document.getElementById("browserSVG");if(d(T),T){const O=T,_=O.getBoundingClientRect();v(_.width/O.viewBox.baseVal.width)}},[]);const E=(T,O)=>{T.preventDefault(),a(!0);const _=O.deltaX;s(o+_)},x=()=>{Math.abs(o)<10||(u({x:o,y:0}),n({type:ue.SHIFT_DOMAIN,delta:o}),a(!1))};return w.useEffect(()=>{i||u({x:o,y:0})},[o]),p.jsx(Xn,{nodeRef:r,scale:f,position:c,axis:"x",onStart:e&&l?()=>{}:()=>!1,onDrag:(T,O)=>E(T,O),onStop:x,children:p.jsx("g",{ref:r,height:"100%",style:{cursor:e&&l?i?"grabbing":"grab":"default"},children:t})})}function kr(e,t){return` L ${e} ${t}`}const eh=e=>{const t=w.useContext(vr),r=w.useContext(Pt),[n,i]=w.useState(va(e.data)),[a,o]=w.useState();w.useEffect(()=>{const C=ti(n);C.min=C.min>0?0:C.min,r({type:ue.UPDATE_PROPS,id:e.id,props:{defaultRange:C}}),o(C)},[]),w.useEffect(()=>{const C=va(e.data),S=ti(C),P={min:S.min>0?0:S.min,max:S.max};i(Ms(C,P)),r({type:ue.UPDATE_PROPS,id:e.id,props:{range:P}}),r({type:ue.UPDATE_PROPS,id:e.id,props:{defaultRange:P}})},[e.data,a,e.domain]),w.useEffect(()=>{if(!e.range)return;const C=va(e.data);i(Ms(C,e.range))},[e.range]);const s=w.useContext(Kt),[c,u]=w.useState(),[l,d]=w.useState(null),f=w.useCallback(C=>{var U;if(t.delta!=0||!((U=e.svgRef)!=null&&U.current))return;const S=rr(e.svgRef.current,C);d([S[0],S[1]]);const P=Math.round(S[0]-150),A=x.renderPoints.find(V=>V.min<1/0&&V.max>-1/0&&V.x===P);if(!A)return;const j=S[0]>e.width-60?S[0]-60+5:S[0]+5;s.setTooltip({show:!0,x:j,y:S[1]-e.height/2,height:80,width:60,content:p.jsx("div",{style:{fontSize:"10px",backgroundColor:"#ffffff",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.2)",padding:"5px",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"5px"},children:p.jsxs("div",{style:{whiteSpace:"nowrap",minWidth:"50px"},children:["value: ",Number(Jd(A.max))]})})})},[e.svgRef,e.width,e.height,t.delta]);w.useEffect(()=>{u(l?l[0]:void 0)},[l]);const v=()=>{s.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0}),u(void 0)};w.useEffect(()=>{if(t.delta!=0){v();return}},[t.delta]);const E=w.useRef(Nt()),x=w.useMemo(()=>n&&n.length&&_r(n)===Ds.ValuedPoint?{renderPoints:n,range:e.range||ti(n)}:Is(n,e.width),[n,e.width,e.domain]),T=w.useMemo(()=>{const C=_s(x.range,e.height),S=x.renderPoints.filter(A=>A.min<1/0&&A.max>-1/0),P=A=>Math.max(0,Math.min(e.height,C(A)));return{maxPath:S.reduce((A,j,U,V)=>A+(j.x?kr(j.x,P(V[U-1]?V[U-1].max:0)):"")+kr(j.x,P(j.max)),"M 0 "+P(0)+" ")+kr(e.width,P(0)),minPath:S.reduce((A,j,U,V)=>A+(j.x?kr(j.x,P(V[U-1]?V[U-1].min:0)):"")+kr(j.x,P(j.min)),"M 0 "+P(0)+" ")+kr(e.width,P(0))}},[x,e.height,e.width]),O=e.color||"#000000",_=w.useMemo(()=>e.noTransparency?O:Zn(O,.5),[e]),m=e.id||E.current.toString();return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{className:e.className,width:e.width,height:e.height,clipPath:`url(#${m})`,children:[p.jsx("rect",{width:e.width,height:e.height,fill:"white",onMouseOut:v}),p.jsx("defs",{children:p.jsx(zt,{id:m,width:e.width,height:e.height})}),p.jsx("path",{d:T.maxPath,fill:_,style:{cursor:"default",clipPath:`url(#${m})`}}),p.jsx("path",{d:T.minPath,fill:O,style:{cursor:"default",clipPath:`url(#${m})`}}),c!==void 0&&p.jsx("line",{stroke:"#ccc",x1:c-150,x2:c-150,y1:0,y2:e.height}),p.jsx("rect",{width:e.width,height:e.height,fill:"transparent",onMouseMove:C=>{f(C)},onMouseOut:()=>{v()}})]})})},th=e=>{const t=w.useRef(Nt()),r=w.useMemo(()=>e.data&&e.data.length&&e.data[0].x!==void 0?Zd(e.data):Is(e.data,100),[e.data,e.width,e.domain]);r.range||(r.range=ti(r.renderPoints));const n=w.useMemo(()=>{const i=_s(r.range,1),a=r.renderPoints.filter(s=>s.min<1/0&&s.max>-1/0),o=e.color||"#000000";return a.map(s=>Zn(o,i(s.max)))},[e.color,r]);return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{className:e.className,width:e.width,height:e.height,children:[p.jsx("defs",{children:p.jsx("linearGradient",{id:t.current,children:n.map((i,a)=>p.jsx("stop",{offset:`${a}%`,stopColor:i},`${t.current}_pt_${a}`))})}),p.jsx("rect",{width:e.width,height:e.height,fill:"white"}),p.jsx("rect",{width:e.width,height:e.height,fill:e.hoverColor||"transparent",fillOpacity:e.hoverColor?.2:0}),p.jsx("rect",{width:e.width,x:0,y:e.height/3,height:e.height/3,fill:`url('#${t.current}')`})]})})},Dr=e=>{w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]);const t=12,r=32,n=e.height,i=e.width;return p.jsxs("g",{className:e.className,width:e.width,height:e.height,transform:e.transform,children:[e.height!=0&&p.jsx("rect",{width:e.width,height:e.height,fill:"none",onClick:e.onClick}),e.error&&p.jsxs("g",{transform:`translate(${t+(i-r)/2},${(n-r)/2})`,children:[p.jsx(Yo,{width:r,height:r}),p.jsx("g",{transform:`translate(${r/2},${r+10})`,children:p.jsx("text",{textAnchor:"middle",fontSize:"12px",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.text})})]}),!e.error&&e.text&&e.height!=0&&p.jsx("text",{textAnchor:"middle",x:Math.round(+e.width/2),y:Math.round(+e.height/2),style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:e.text})]})},Ps={trackType:J.BIGWIG,titleSize:12,trackMargin:12,displayMode:Ae.FULL,canDrag:!0,noTransparency:!0,color:"#ff5555"};function Ns(e){const[t,r]=w.useState(!e.data),[n,i]=w.useState(e.data);w.useEffect(()=>{e.data?(i(e.data),r(!1)):r(!0)},[e.data]);const a={...e,trackType:J.BIGWIG,displayMode:e.displayMode};switch(e.displayMode){case Ae.FULL:return p.jsx(et,{...a,loading:t,trackType:J.BIGWIG,displayMode:e.displayMode,children:p.jsx(eh,{...e,data:n})});case Ae.DENSE:return p.jsx(et,{...a,loading:t,trackType:J.BIGWIG,displayMode:e.displayMode,children:p.jsx(th,{...e,data:n})});case Ae.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(et,{...a,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function rh(e,t){const r=[];return e.forEach((n,i)=>(i===0||n.start>e[i-1].end||n.color!=e[i-1].color?r.push({start:t(n.start)<0?0:t(n.start),end:t(n.end)<0?0:t(n.end),color:n.color,name:n.name,score:n.score}):r[r.length-1].end=t(n.end),r)),r}function nh(e,t){return nn(e.sort((r,n)=>r.start-n.start).map(r=>({coordinates:{start:r.start,end:r.end},color:r.color,name:"",score:r.score,rectname:r.name})),t,0).map(r=>r.map(n=>({start:t(n.coordinates.start)<0?0:t(n.coordinates.start),end:t(n.coordinates.end),color:n.color,rectname:n.rectname,name:n.rectname,score:n.score})))}const ih={fontSize:"12px",backgroundColor:"#ffffff",border:"1px solid",padding:"1em"},As=e=>p.jsxs("div",{style:ih,children:[e.name?`name: ${e.name}`:"",p.jsx("br",{}),e.score!==void 0?`score: ${e.score}`:""]});function Fs(e,t,r,n,i){const a=w.useContext(Kt),o=w.useCallback((c,u)=>{if(!r||!r.current)return;const[l,d]=rr(r.current,c);a.setTooltip({show:!0,x:l>t-100?l-90:l+10,y:d+10,width:100,height:50,content:w.createElement(e,u)})},[e,t,r,a,n]),s=w.useCallback(()=>{a.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},[a,i]);return[o,s]}const ah=e=>{const[t,r]=Fs(e.tooltipContent||As,e.width,e.svgRef),n=w.useRef(Nt()),i=w.useCallback(Ct(e.domain,e.width),[e.data]),a=e.color||"#000000",o=e.id||n.current.toString(),s=w.useMemo(()=>rh(e.data||[],i),[e.width,e.data,e.domain]);return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:e.height,clipPath:`url(#${o})`,className:e.className,children:[p.jsx("rect",{width:e.width,height:e.height,fill:"white"}),p.jsx("defs",{children:p.jsx(zt,{id:o,width:e.width,height:e.height})}),s.map((c,u)=>p.jsx("rect",{style:{cursor:e.onClick?"pointer":"default"},height:e.height*.6,width:c.end-c.start,x:c.start,y:e.height*.2,fill:c.color||a,onClick:()=>e.onClick&&e.onClick(c),onMouseOut:()=>{e.onMouseOut&&e.onMouseOut(),r()},onMouseOver:l=>{l.persist(),e.onMouseOver&&e.onMouseOver(c),t(l,c)}},`${o}_${u}`))]})})},oh=e=>{const[r,n]=Fs(e.tooltipContent||As,e.width,e.svgRef),i=w.useRef(Nt()),a=w.useCallback(Ct(e.domain,e.width),[e.data]),o=w.useMemo(()=>{const u=e.data?[...e.data]:[];return nh(u,a)},[e.width,e.data,e.domain]),s=e.rowHeight*o.length||12,c=e.id||i.current.toString();return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(s)},[o,e.rowHeight,e.onHeightChanged]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:s,clipPath:`url(#${c})`,children:[p.jsx("rect",{width:e.width,height:s,fill:"white"}),p.jsx("defs",{children:p.jsx(zt,{id:c,width:e.width,height:s})}),o.map((u,l)=>p.jsx("g",{transform:`translate(0, ${l*e.rowHeight})`,children:u.map((d,f)=>p.jsx("rect",{style:{cursor:e.onClick?"pointer":"default"},height:e.rowHeight*.6,width:d.end-d.start<1?1:d.end-d.start,x:d.start,y:e.rowHeight*.2,fill:d.color,onClick:()=>e.onClick&&e.onClick(d),onMouseOut:()=>{e.onMouseOut&&e.onMouseOut(),n()},onMouseOver:v=>{v.persist(),e.onMouseOver&&e.onMouseOver(d),r(v,d)}},`${c}_${f}`))},`group_${l}`))]})})},Rs={trackType:J.BIGBED,displayMode:Ae.SQUISH,rowHeight:10,titleSize:12,trackMargin:12,canDrag:!0};function js(e){const[t,r]=w.useState(!e.data),[n,i]=w.useState(e.data),a={...e,trackType:J.BIGBED,displayMode:e.displayMode};switch(w.useEffect(()=>{e.data?(i(e.data),r(!1)):r(!0)},[e.data]),e.displayMode){case Ae.DENSE:return p.jsx(et,{...a,loading:t,trackType:J.BIGBED,displayMode:e.displayMode,children:p.jsx(ah,{...e,data:n})});case Ae.SQUISH:return p.jsx(et,{...a,loading:t,trackType:J.BIGBED,displayMode:e.displayMode,children:p.jsx(oh,{...e,data:n})});case Ae.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigBed`),p.jsx(et,{...a,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function sh(e,t){return e.coordinates.start===t.coordinates.start?e.coordinates.end-t.coordinates.end:e.coordinates.start-t.coordinates.start}function ch(e,t){return e.reduce((r,n)=>(n.transcripts.filter(i=>i.coordinates.start<t.end&&i.coordinates.end>t.start).forEach(i=>r.push({...i,strand:n.strand})),r),[]).sort((r,n)=>r.coordinates.start-n.coordinates.start)}function uh(e){if(e.length===0)return[];const t=[{coordinates:{...e[0].coordinates}}];return e.slice(1).forEach(r=>{r.coordinates.start<t[t.length-1].coordinates.end?t[t.length-1].coordinates.end=Math.max(t[t.length-1].coordinates.end,r.coordinates.end):t.push({coordinates:{...r.coordinates}})}),t}function lh(e,t){var s;const n=e.transcripts.reduce((c,u)=>[...c,...u.exons||[]],[]).sort(sh),i=n.length===0?[]:[{coordinates:{...n[0].coordinates},UTRs:n[0].UTRs&&[...n[0].UTRs]}],a=new Set(e.transcripts.map(c=>c.color));n.slice(1).forEach(c=>{c.coordinates.start<i[i.length-1].coordinates.end?(i[i.length-1].UTRs=[...i[i.length-1].UTRs||[],...c.UTRs||[]],i[i.length-1].coordinates.end=Math.max(c.coordinates.end,i[i.length-1].coordinates.end)):i.push({coordinates:{...c.coordinates},UTRs:c.UTRs&&[...c.UTRs]})}),i.forEach(c=>{c.UTRs=uh(c.UTRs||[])});let o=a.size===1?a.values().next().value:void 0;return t&&(o=(s=e.name)!=null&&s.includes(t)?"#ff5555":o),{name:e.name||"",strand:e.strand,id:e.id||"",coordinates:{start:Math.min(...n.map(c=>c.coordinates.start)),end:Math.max(...n.map(c=>c.coordinates.end))},exons:i,color:o}}function fh(e,t,r){var n;return{strand:e.strand,name:e.name,id:e.id,color:e.color,coordinates:{end:t(e.coordinates.end),start:t(e.coordinates.start)},exons:((n=e.exons)==null?void 0:n.filter(i=>i.coordinates.end>r.start&&i.coordinates.start<r.end).map(i=>{var a;return{coordinates:{start:t(i.coordinates.start),end:t(i.coordinates.end)},UTRs:((a=i.UTRs)==null?void 0:a.map(o=>({coordinates:{start:t(o.coordinates.start),end:t(o.coordinates.end)}})))||[]}}))||[]}}function dh(e,t,r,n,i,a){let o="";if(e=e<0?0:e,t=t>a?a:t,r==="+")for(let s=e+10;s<t-10;s+=20)o+=Cr(s-i,n-i)+Ce(s,n)+Ce(s-i,n+i)+Ce(s,n)+Ce(s-i,n-i);else if(r==="-")for(let s=e+10;s<t-10;s+=20)o+=Cr(s+i,n-i)+Ce(s,n)+Ce(s+i,n+i)+Ce(s,n)+Ce(s+i,n-i);return o+" M "+e+" "+n+" L "+t+" "+n}function hh(e,t,r,n){var d,f;if(e.coordinates.start>n||e.coordinates.end<0)return"";const i=((d=e.UTRs)==null?void 0:d.filter(v=>v.coordinates.start===e.coordinates.start))||[],a=((f=e.UTRs)==null?void 0:f.filter(v=>v.coordinates.end===e.coordinates.end))||[],o=t-r*.2,s=t+r*.2,c=t-r*.3,u=t+r*.3;if(!i[0]&&!a[0])return Cr(e.coordinates.start,c)+Ce(e.coordinates.end,c)+Ce(e.coordinates.end,u)+Ce(e.coordinates.start,u)+Ce(e.coordinates.start,c);if(i[0]&&i[0].coordinates.end===e.coordinates.end)return Cr(i[0].coordinates.start,o)+Ce(i[0].coordinates.end,o)+Ce(i[0].coordinates.end,s)+Ce(i[0].coordinates.start,s)+Ce(i[0].coordinates.start,o);let l=i[0]?Cr(i[0].coordinates.start,o)+Ce(i[0].coordinates.end,o)+Ce(i[0].coordinates.end,c):Cr(e.coordinates.start,c);return l+=a[0]?Ce(a[0].coordinates.start,c)+Ce(a[0].coordinates.start,o)+Ce(a[0].coordinates.end,o)+Ce(a[0].coordinates.end,s)+Ce(a[0].coordinates.start,s)+Ce(a[0].coordinates.start,u):Ce(e.coordinates.end,c)+Ce(e.coordinates.end,u),l+(i[0]?Ce(i[0].coordinates.end,u)+Ce(i[0].coordinates.end,s)+Ce(i[0].coordinates.start,s)+Ce(i[0].coordinates.start,o):Ce(e.coordinates.start,u)+Ce(e.coordinates.start,c))}function Vs(e,t,r,n,i){var s;const a=fh(e,t,r),o={exons:((s=a.exons)==null?void 0:s.reduce((c,u)=>c+hh(u,n/2,n,i),""))||"",introns:dh(a.coordinates.start,a.coordinates.end,a.strand,n/2,n*.19,i)};return{transcript:a,paths:o}}const ph=e=>{const t=w.useContext(Kt),r=(l,d)=>{if(e.svgRef){const f=rr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-150?f[0]-150+5:f[0]+5,y:f[1],width:150,height:50,content:p.jsx("span",{style:{fontSize:"10px"},children:d.id})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=w.useRef(Nt()),a=w.useCallback(Ct(e.domain,e.width),[e.data]),o=e.color||"#000000",s=fa(e.rowHeight)*1.25,c=w.useMemo(()=>nn(ch(e.data||[],e.domain),a,s).map((l,d)=>({y:d*e.rowHeight,transcripts:l.map(f=>Vs(f,a,e.domain,e.rowHeight,e.width))})),[e.data,e.rowHeight,e.width,e.domain]),u=w.useMemo(()=>Math.max(e.rowHeight*c.length,35),[e.rowHeight,c.length]);return console.log(u),w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(u)},[u]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{children:[p.jsx("rect",{width:e.width,height:u,fill:"white"}),p.jsx("defs",{children:p.jsx(zt,{id:i.current,width:e.width,height:c.length*e.rowHeight})}),c.map((l,d)=>p.jsx("g",{style:{clipPath:`url(#${i.current})`},transform:`translate(0,${l.y})`,height:e.rowHeight,width:e.width,children:l.transcripts.map((f,v)=>p.jsxs(w.Fragment,{children:[p.jsx("path",{stroke:f.transcript.color||o,fill:f.transcript.color||o,strokeWidth:e.rowHeight/16,d:f.paths.introns+f.paths.exons,style:{cursor:e.onTranscriptClick?"pointer":"default"},onMouseOver:E=>r(E,f.transcript),onMouseOut:n,onClick:()=>e.onTranscriptClick&&e.onTranscriptClick(f.transcript)}),p.jsx("text",{fill:f.transcript.color||o,fontSize:s,x:f.transcript.coordinates.end+5,y:e.rowHeight/2,dominantBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:f.transcript.name})]},`transcript_${v}`))},`row_${d}`))]})})},gh=e=>{const t=w.useContext(Kt),r=(l,d)=>{if(e.svgRef){const f=rr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-150?f[0]-150+5:f[0]+5,y:f[1],width:150,height:50,content:p.jsx("span",{style:{fontSize:"10px"},children:d.id})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=w.useRef(Nt()),a=w.useCallback(Ct(e.domain,e.width),[e.data]),o=e.color||"#000000",s=fa(e.rowHeight)*1.25,c=w.useMemo(()=>{var l;return nn(((l=e.data)==null?void 0:l.map(d=>lh(d,e.geneName)))||[],a,s).map((d,f)=>({y:f*e.rowHeight,transcripts:d.map(v=>Vs(v,a,e.domain,e.rowHeight,e.width))}))},[e.data,e.rowHeight,e.width,e.domain]),u=w.useMemo(()=>Math.max(e.rowHeight*c.length,35),[e.rowHeight,c.length]);return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(u)},[u]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{children:[p.jsx("rect",{width:e.width,height:u,fill:"white"}),p.jsx("defs",{children:p.jsx(zt,{id:i.current,width:e.width,height:c.length*e.rowHeight})}),c.map((l,d)=>p.jsx("g",{style:{clipPath:`url(#${i.current})`},transform:`translate(0,${l.y})`,height:e.rowHeight,width:e.width,children:l.transcripts.map((f,v)=>p.jsxs(w.Fragment,{children:[p.jsx("path",{stroke:f.transcript.color||o,fill:f.transcript.color||o,strokeWidth:e.rowHeight/16,d:f.paths.introns+f.paths.exons,style:{cursor:e.onTranscriptClick?"pointer":"default"},onMouseOver:E=>r(E,f.transcript),onMouseOut:n,onClick:()=>e.onTranscriptClick&&e.onTranscriptClick(f.transcript)}),p.jsx("text",{fill:f.transcript.color||o,fontSize:s,x:f.transcript.coordinates.end+5,y:e.rowHeight/2,dominantBaseline:"middle",style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:f.transcript.name})]},`transcript_${v}`))},`row_${d}`))]})})},qs={trackType:J.TRANSCRIPT,displayMode:Ae.SQUISH,rowHeight:14,titleSize:12,trackMargin:12,canDrag:!0};function $s(e){const[t,r]=w.useState(!e.data),[n,i]=w.useState(e.data),a={...e,trackType:J.TRANSCRIPT,displayMode:e.displayMode};switch(w.useEffect(()=>{e.data?(i(e.data),r(!1)):r(!0)},[e.data]),w.useEffect(()=>{e.refetch&&e.refetch({variables:{assembly:e.assembly,chromosome:e.domain.chromosome,start:e.domain.start,end:e.domain.end,version:e.version}}).then(({data:o,loading:s,error:c})=>{i(o.gene),r(s)})},[e.version]),e.displayMode){case Ae.PACK:return p.jsx(et,{...a,loading:t,trackType:J.TRANSCRIPT,displayMode:e.displayMode,children:p.jsx(ph,{...e,data:n})});case Ae.SQUISH:return p.jsx(et,{...a,loading:t,trackType:J.TRANSCRIPT,displayMode:e.displayMode,children:p.jsx(gh,{...e,data:n})});case Ae.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(et,{...a,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function vh(e,t){const r=[];return e.sort((n,i)=>n.start-i.start).forEach((n,i)=>(i===0||n.start>e[i-1].end||n.color!=e[i-1].color?r.push({start:t(n.start)<0?0:t(n.start),end:t(n.end),color:n.color,cigarOps:n.cigarOps,strand:n.strand,seq:n.seq}):r[r.length-1].end=t(n.end),r)),r}function yh(e,t,r){return nn(e.sort((n,i)=>n.start-i.start).map(n=>({coordinates:{start:n.start,end:n.end},color:n.color,name:"",cigarOps:n.cigarOps,strand:n.strand,seq:n.seq})),t,0).map(n=>n.map(i=>{var a;return{start:t(i.coordinates.start)<0?0:t(i.coordinates.start),end:t(i.coordinates.end),color:i.color,cigarOps:i.cigarOps.map(o=>({opStart:t(o.opStart)<0?0:t(o.opStart),opEnd:t(o.opEnd),op:o.op})),strand:i.strand,seq:t(i.coordinates.start)<0?(a=i.seq)==null?void 0:a.slice(r.start-i.coordinates.start,i.seq.length):i.seq}}))}const mh=e=>{const t=w.useRef(Nt()),r=Ct(e.domain,e.width),n=e.color||"#000000",i=w.useMemo(()=>yh(e.data,r,e.domain),[e.data,e.domain,e.width]),a=e.rowHeight*i.length,o=e.id||t.current.toString();return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(a)},[i,e.rowHeight,e.onHeightChanged]),p.jsxs("g",{width:e.width,height:a,transform:e.transform,clipPath:`url(#${o})`,children:[p.jsx("defs",{children:p.jsx(zt,{id:o,width:e.width,height:a})}),i.map((s,c)=>p.jsx("g",{transform:`translate(0, ${c*e.rowHeight})`,children:s.map((u,l)=>{const d=u.cigarOps.map((f,v)=>{let E;return f.op==="S"?E=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,style:{fill:"none",strokeDasharray:"2,2",stroke:"black",strokeWidth:.5}},`${l}_${v}`):f.op==="I"?E=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,fill:"#ff69b4",children:p.jsx("title",{children:"Insertion"})},`${l}_${v}`):f.op==="D"||f.op==="N"?E=p.jsx("line",{y2:e.rowHeight*.2+e.rowHeight*.6/2,x2:f.opEnd,x1:f.opStart,y1:e.rowHeight*.2+e.rowHeight*.6/2,stroke:"red"},`${l}_${v}`):E=p.jsx("rect",{height:e.rowHeight*.6,width:f.opEnd-f.opStart<1?1:f.opEnd-f.opStart,x:f.opStart,y:e.rowHeight*.2,fill:u.strand!==void 0?u.strand?"#F7F71A":"#53F71A":u.color||n},`${l}_${v}`),E});return p.jsxs("g",{children:[d,e.domain.end-e.domain.start<=200&&u.seq&&p.jsx("text",{fontSize:8,x:u.start,y:e.rowHeight*.2+e.rowHeight*.5,fill:"black",textLength:u.end-u.start,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:u.seq})]},e.id+"_"+l)})},`group_${c}`))]})},bh=e=>{const t=w.useRef(Nt()),r=Ct(e.domain,e.width),n=e.color||"#000000",i=e.id||t.current.toString(),a=w.useMemo(()=>vh(e.data,r),[e.domain,e.width,e.data]);return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height,e.onHeightChanged]),p.jsxs("g",{width:e.width,height:e.height,transform:e.transform,clipPath:`url(#${i})`,children:[p.jsx("defs",{children:p.jsx(zt,{id:i,width:e.width,height:e.height})}),a.map((o,s)=>p.jsx("rect",{height:e.height*.6,width:o.end-o.start,x:o.start,y:e.height*.2,fill:o.strand!==void 0?o.strand?"#F7F71A":"#53F71A":o.color||n},`${i}_${s}`))]})},Eh={displayMode:Ae.DENSE,rowHeight:10};function wh(e){const t=e.data&&e.data[0]?{loading:!1}:{loading:!0},r={...e,trackType:J.BIGBED,displayMode:e.displayMode};switch(e.displayMode){case Ae.DENSE:return p.jsx(et,{...r,...t,trackType:J.BAM,displayMode:e.displayMode,children:p.jsx(bh,{...e})});case Ae.SQUISH:return p.jsx(et,{...r,...t,trackType:J.BAM,displayMode:e.displayMode,children:p.jsx(mh,{...e})});case Ae.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigBed`),p.jsx(et,{...r,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}function xh(e,t){return r=>t.start+(t.end-t.start)*((r-e.start)/(e.end-e.start))}function Sh(e,t){const r=e.map(t),n=Math.min(...r),i=Math.max(...r);return{start:n>0?0:n,end:i<0?0:i}}function Oh(e){return t=>{const r=e((t<0,t)),n=e((t<0,0)),i=Math.abs(n-r)/100;return[r*(t<0?-1:1),i,t<0?"scale(1,-1)":""]}}function Th(e,t){const r=w.useMemo(()=>Mh(e)?e.importance.map((o,s)=>({base:e.sequence.charAt(s),importance:o})):e,[e]),n=w.useMemo(()=>Sh(r,o=>o.importance),[r]),i=xh(n,{start:t,end:0}),a=w.useCallback(Oh(i),[n,t]);return[r,a,i]}function Ch(e,t,r){return w.useMemo(()=>e.map(n=>{const i=t.slice(n.coordinates[0],n.coordinates[1]+1).map(s=>s.importance),a=[Math.min(...i),Math.max(...i)],o=r(a[1]);return{...n,y:o,height:r(a[0])-o}}),[e,r])}var Us={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(Rf,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{enumerable:!0,get:s})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,o){if(1&o&&(a=i(a)),8&o||4&o&&typeof a=="object"&&a&&a.__esModule)return a;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:a}),2&o&&typeof a!="string")for(var c in a)i.d(s,c,(function(u){return a[u]}).bind(null,c));return s},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="/",i(i.s=5)}([function(r,n,i){r.exports=i(3)},function(r,n,i){r.exports=i(4)},function(r,n,i){/*
|
|
52
52
|
object-assign
|
|
53
53
|
(c) Sindre Sorhus
|
|
54
54
|
@license MIT
|
|
@@ -59,16 +59,16 @@ object-assign
|
|
|
59
59
|
*
|
|
60
60
|
* This source code is licensed under the MIT license found in the
|
|
61
61
|
* LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/var a=i(2),o=typeof Symbol=="function"&&Symbol.for,s=o?Symbol.for("react.element"):60103,c=o?Symbol.for("react.portal"):60106,u=o?Symbol.for("react.fragment"):60107,l=o?Symbol.for("react.strict_mode"):60108,d=o?Symbol.for("react.profiler"):60114,f=o?Symbol.for("react.provider"):60109,v=o?Symbol.for("react.context"):60110,E=o?Symbol.for("react.forward_ref"):60112,x=o?Symbol.for("react.suspense"):60113,T=o?Symbol.for("react.suspense_list"):60120,
|
|
62
|
+
*/var a=i(2),o=typeof Symbol=="function"&&Symbol.for,s=o?Symbol.for("react.element"):60103,c=o?Symbol.for("react.portal"):60106,u=o?Symbol.for("react.fragment"):60107,l=o?Symbol.for("react.strict_mode"):60108,d=o?Symbol.for("react.profiler"):60114,f=o?Symbol.for("react.provider"):60109,v=o?Symbol.for("react.context"):60110,E=o?Symbol.for("react.forward_ref"):60112,x=o?Symbol.for("react.suspense"):60113,T=o?Symbol.for("react.suspense_list"):60120,O=o?Symbol.for("react.memo"):60115,_=o?Symbol.for("react.lazy"):60116,m=typeof Symbol=="function"&&Symbol.iterator;function C(I){for(var L=I.message,ae="https://reactjs.org/docs/error-decoder.html?invariant="+L,ce=1;ce<arguments.length;ce++)ae+="&args[]="+encodeURIComponent(arguments[ce]);return I.message="Minified React error #"+L+"; visit "+ae+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",I}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P={};function A(I,L,ae){this.props=I,this.context=L,this.refs=P,this.updater=ae||S}function j(){}function U(I,L,ae){this.props=I,this.context=L,this.refs=P,this.updater=ae||S}A.prototype.isReactComponent={},A.prototype.setState=function(I,L){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw C(Error(85));this.updater.enqueueSetState(this,I,L,"setState")},A.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")},j.prototype=A.prototype;var V=U.prototype=new j;V.constructor=U,a(V,A.prototype),V.isPureReactComponent=!0;var me={current:null},Le={suspense:null},ye={current:null},Se=Object.prototype.hasOwnProperty,Ve={key:!0,ref:!0,__self:!0,__source:!0};function Pe(I,L,ae){var ce=void 0,oe={},Ne=null,We=null;if(L!=null)for(ce in L.ref!==void 0&&(We=L.ref),L.key!==void 0&&(Ne=""+L.key),L)Se.call(L,ce)&&!Ve.hasOwnProperty(ce)&&(oe[ce]=L[ce]);var Ze=arguments.length-2;if(Ze===1)oe.children=ae;else if(1<Ze){for(var Ie=Array(Ze),Ue=0;Ue<Ze;Ue++)Ie[Ue]=arguments[Ue+2];oe.children=Ie}if(I&&I.defaultProps)for(ce in Ze=I.defaultProps)oe[ce]===void 0&&(oe[ce]=Ze[ce]);return{$$typeof:s,type:I,key:Ne,ref:We,props:oe,_owner:ye.current}}function Y(I){return typeof I=="object"&&I!==null&&I.$$typeof===s}var $=/\/+/g,Z=[];function N(I,L,ae,ce){if(Z.length){var oe=Z.pop();return oe.result=I,oe.keyPrefix=L,oe.func=ae,oe.context=ce,oe.count=0,oe}return{result:I,keyPrefix:L,func:ae,context:ce,count:0}}function R(I){I.result=null,I.keyPrefix=null,I.func=null,I.context=null,I.count=0,10>Z.length&&Z.push(I)}function K(I,L,ae){return I==null?0:function ce(oe,Ne,We,Ze){var Ie=typeof oe;Ie!=="undefined"&&Ie!=="boolean"||(oe=null);var Ue=!1;if(oe===null)Ue=!0;else switch(Ie){case"string":case"number":Ue=!0;break;case"object":switch(oe.$$typeof){case s:case c:Ue=!0}}if(Ue)return We(Ze,oe,Ne===""?"."+se(oe,0):Ne),1;if(Ue=0,Ne=Ne===""?".":Ne+":",Array.isArray(oe))for(var wt=0;wt<oe.length;wt++){var kt=Ne+se(Ie=oe[wt],wt);Ue+=ce(Ie,kt,We,Ze)}else if(oe===null||typeof oe!="object"?kt=null:kt=typeof(kt=m&&oe[m]||oe["@@iterator"])=="function"?kt:null,typeof kt=="function")for(oe=kt.call(oe),wt=0;!(Ie=oe.next()).done;)Ue+=ce(Ie=Ie.value,kt=Ne+se(Ie,wt++),We,Ze);else if(Ie==="object")throw We=""+oe,C(Error(31),We==="[object Object]"?"object with keys {"+Object.keys(oe).join(", ")+"}":We,"");return Ue}(I,"",L,ae)}function se(I,L){return typeof I=="object"&&I!==null&&I.key!=null?function(ae){var ce={"=":"=0",":":"=2"};return"$"+(""+ae).replace(/[=:]/g,function(oe){return ce[oe]})}(I.key):L.toString(36)}function ee(I,L){I.func.call(I.context,L,I.count++)}function ge(I,L,ae){var ce=I.result,oe=I.keyPrefix;I=I.func.call(I.context,L,I.count++),Array.isArray(I)?W(I,ce,ae,function(Ne){return Ne}):I!=null&&(Y(I)&&(I=function(Ne,We){return{$$typeof:s,type:Ne.type,key:We,ref:Ne.ref,props:Ne.props,_owner:Ne._owner}}(I,oe+(!I.key||L&&L.key===I.key?"":(""+I.key).replace($,"$&/")+"/")+ae)),ce.push(I))}function W(I,L,ae,ce,oe){var Ne="";ae!=null&&(Ne=(""+ae).replace($,"$&/")+"/"),K(I,ge,L=N(L,Ne,ce,oe)),R(L)}function ie(){var I=me.current;if(I===null)throw C(Error(321));return I}var ve={Children:{map:function(I,L,ae){if(I==null)return I;var ce=[];return W(I,ce,null,L,ae),ce},forEach:function(I,L,ae){if(I==null)return I;K(I,ee,L=N(null,null,L,ae)),R(L)},count:function(I){return K(I,function(){return null},null)},toArray:function(I){var L=[];return W(I,L,null,function(ae){return ae}),L},only:function(I){if(!Y(I))throw C(Error(143));return I}},createRef:function(){return{current:null}},Component:A,PureComponent:U,createContext:function(I,L){return L===void 0&&(L=null),(I={$$typeof:v,_calculateChangedBits:L,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:f,_context:I},I.Consumer=I},forwardRef:function(I){return{$$typeof:E,render:I}},lazy:function(I){return{$$typeof:_,_ctor:I,_status:-1,_result:null}},memo:function(I,L){return{$$typeof:O,type:I,compare:L===void 0?null:L}},useCallback:function(I,L){return ie().useCallback(I,L)},useContext:function(I,L){return ie().useContext(I,L)},useEffect:function(I,L){return ie().useEffect(I,L)},useImperativeHandle:function(I,L,ae){return ie().useImperativeHandle(I,L,ae)},useDebugValue:function(){},useLayoutEffect:function(I,L){return ie().useLayoutEffect(I,L)},useMemo:function(I,L){return ie().useMemo(I,L)},useReducer:function(I,L,ae){return ie().useReducer(I,L,ae)},useRef:function(I){return ie().useRef(I)},useState:function(I){return ie().useState(I)},Fragment:u,Profiler:d,StrictMode:l,Suspense:x,unstable_SuspenseList:T,createElement:Pe,cloneElement:function(I,L,ae){if(I==null)throw C(Error(267),I);var ce=void 0,oe=a({},I.props),Ne=I.key,We=I.ref,Ze=I._owner;if(L!=null){L.ref!==void 0&&(We=L.ref,Ze=ye.current),L.key!==void 0&&(Ne=""+L.key);var Ie=void 0;for(ce in I.type&&I.type.defaultProps&&(Ie=I.type.defaultProps),L)Se.call(L,ce)&&!Ve.hasOwnProperty(ce)&&(oe[ce]=L[ce]===void 0&&Ie!==void 0?Ie[ce]:L[ce])}if((ce=arguments.length-2)===1)oe.children=ae;else if(1<ce){Ie=Array(ce);for(var Ue=0;Ue<ce;Ue++)Ie[Ue]=arguments[Ue+2];oe.children=Ie}return{$$typeof:s,type:I.type,key:Ne,ref:We,props:oe,_owner:Ze}},createFactory:function(I){var L=Pe.bind(null,I);return L.type=I,L},isValidElement:Y,version:"16.9.0",unstable_withSuspenseConfig:function(I,L){var ae=Le.suspense;Le.suspense=L===void 0?null:L;try{I()}finally{Le.suspense=ae}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:me,ReactCurrentBatchConfig:Le,ReactCurrentOwner:ye,IsSomeRendererActing:{current:!1},assign:a}},le={default:ve},pe=le&&ve||le;r.exports=pe.default||pe},function(r,n,i){/** @license React v16.9.0
|
|
63
63
|
* react-dom-server.browser.production.min.js
|
|
64
64
|
*
|
|
65
65
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
66
66
|
*
|
|
67
67
|
* This source code is licensed under the MIT license found in the
|
|
68
68
|
* LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/var a=i(2),o=i(0);function s(k){for(var M=k.message,z="https://reactjs.org/docs/error-decoder.html?invariant="+M,q=1;q<arguments.length;q++)z+="&args[]="+encodeURIComponent(arguments[q]);return k.message="Minified React error #"+M+"; visit "+z+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",k}var c=typeof Symbol=="function"&&Symbol.for,u=c?Symbol.for("react.portal"):60106,l=c?Symbol.for("react.fragment"):60107,d=c?Symbol.for("react.strict_mode"):60108,f=c?Symbol.for("react.profiler"):60114,v=c?Symbol.for("react.provider"):60109,E=c?Symbol.for("react.context"):60110,x=c?Symbol.for("react.concurrent_mode"):60111,T=c?Symbol.for("react.forward_ref"):60112,S=c?Symbol.for("react.suspense"):60113,_=c?Symbol.for("react.suspense_list"):60120,m=c?Symbol.for("react.memo"):60115,C=c?Symbol.for("react.lazy"):60116,O=c?Symbol.for("react.fundamental"):60117;function P(k){if(k==null)return null;if(typeof k=="function")return k.displayName||k.name||null;if(typeof k=="string")return k;switch(k){case l:return"Fragment";case u:return"Portal";case f:return"Profiler";case d:return"StrictMode";case S:return"Suspense";case _:return"SuspenseList"}if(typeof k=="object")switch(k.$$typeof){case E:return"Context.Consumer";case v:return"Context.Provider";case T:var M=k.render;return M=M.displayName||M.name||"",k.displayName||(M!==""?"ForwardRef("+M+")":"ForwardRef");case m:return P(k.type);case C:if(k=k._status===1?k._result:null)return P(k)}return null}var A=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;A.hasOwnProperty("ReactCurrentDispatcher")||(A.ReactCurrentDispatcher={current:null}),A.hasOwnProperty("ReactCurrentBatchConfig")||(A.ReactCurrentBatchConfig={suspense:null});var j={};function U(k,M){for(var z=0|k._threadCount;z<=M;z++)k[z]=k._currentValue2,k._threadCount=z+1}for(var V=new Uint16Array(16),me=0;15>me;me++)V[me]=me+1;V[15]=0;var Le=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ye=Object.prototype.hasOwnProperty,Oe={},Ve={};function Pe(k){return!!ye.call(Ve,k)||!ye.call(Oe,k)&&(Le.test(k)?Ve[k]=!0:(Oe[k]=!0,!1))}function K(k,M,z,q,B,W){this.acceptsBooleans=M===2||M===3||M===4,this.attributeName=q,this.attributeNamespace=B,this.mustUseProperty=z,this.propertyName=k,this.type=M,this.sanitizeURL=W}var $={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(k){$[k]=new K(k,0,!1,k,null,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(k){var M=k[0];$[M]=new K(M,1,!1,k[1],null,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(k){$[k]=new K(k,2,!1,k.toLowerCase(),null,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(k){$[k]=new K(k,2,!1,k,null,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(k){$[k]=new K(k,3,!1,k.toLowerCase(),null,!1)}),["checked","multiple","muted","selected"].forEach(function(k){$[k]=new K(k,3,!0,k,null,!1)}),["capture","download"].forEach(function(k){$[k]=new K(k,4,!1,k,null,!1)}),["cols","rows","size","span"].forEach(function(k){$[k]=new K(k,6,!1,k,null,!1)}),["rowSpan","start"].forEach(function(k){$[k]=new K(k,5,!1,k.toLowerCase(),null,!1)});var Z=/[\-:]([a-z])/g;function N(k){return k[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(k){var M=k.replace(Z,N);$[M]=new K(M,1,!1,k,null,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(k){var M=k.replace(Z,N);$[M]=new K(M,1,!1,k,"http://www.w3.org/1999/xlink",!1)}),["xml:base","xml:lang","xml:space"].forEach(function(k){var M=k.replace(Z,N);$[M]=new K(M,1,!1,k,"http://www.w3.org/XML/1998/namespace",!1)}),["tabIndex","crossOrigin"].forEach(function(k){$[k]=new K(k,1,!1,k.toLowerCase(),null,!1)}),$.xlinkHref=new K("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach(function(k){$[k]=new K(k,1,!1,k.toLowerCase(),null,!0)});var R=/["'&<>]/;function X(k){if(typeof k=="boolean"||typeof k=="number")return""+k;k=""+k;var M=R.exec(k);if(M){var z,q="",B=0;for(z=M.index;z<k.length;z++){switch(k.charCodeAt(z)){case 34:M=""";break;case 38:M="&";break;case 39:M="'";break;case 60:M="<";break;case 62:M=">";break;default:continue}B!==z&&(q+=k.substring(B,z)),B=z+1,q+=M}k=B!==z?q+k.substring(B,z):q}return k}function se(k,M){var z,q=$.hasOwnProperty(k)?$[k]:null;return(z=k!=="style")&&(z=q!==null?q.type===0:2<k.length&&(k[0]==="o"||k[0]==="O")&&(k[1]==="n"||k[1]==="N")),z||function(B,W,te,re){if(W==null||function(qe,Ge,Ee,at){if(Ee!==null&&Ee.type===0)return!1;switch(typeof Ge){case"function":case"symbol":return!0;case"boolean":return Ee!==null?!Ee.acceptsBooleans:(qe=qe.toLowerCase().slice(0,5))!=="data-"&&qe!=="aria-";default:return!1}}(B,W,te))return!0;if(te!==null)switch(te.type){case 3:return!W;case 4:return W===!1;case 5:return isNaN(W);case 6:return isNaN(W)||1>W}return!1}(k,M,q)?"":q!==null?(k=q.attributeName,(z=q.type)===3||z===4&&M===!0?k+'=""':(q.sanitizeURL&&(M=""+M),k+'="'+X(M)+'"')):Pe(k)?k+'="'+X(M)+'"':""}var ee=null,ge=null,H=null,ie=!1,ve=!1,le=null,pe=0;function I(){if(ee===null)throw s(Error(321));return ee}function L(){if(0<pe)throw s(Error(312));return{memoizedState:null,queue:null,next:null}}function ae(){return H===null?ge===null?(ie=!1,ge=H=L()):(ie=!0,H=ge):H.next===null?(ie=!1,H=H.next=L()):(ie=!0,H=H.next),H}function ce(k,M,z,q){for(;ve;)ve=!1,pe+=1,H=null,z=k(M,q);return ge=ee=null,pe=0,H=le=null,z}function oe(k,M){return typeof M=="function"?M(k):M}function Ne(k,M,z){if(ee=I(),H=ae(),ie){var q=H.queue;if(M=q.dispatch,le!==null&&(z=le.get(q))!==void 0){le.delete(q),q=H.memoizedState;do q=k(q,z.action),z=z.next;while(z!==null);return H.memoizedState=q,[q,M]}return[H.memoizedState,M]}return k=k===oe?typeof M=="function"?M():M:z!==void 0?z(M):M,H.memoizedState=k,k=(k=H.queue={last:null,dispatch:null}).dispatch=He.bind(null,ee,k),[H.memoizedState,k]}function He(k,M,z){if(!(25>pe))throw s(Error(301));if(k===ee)if(ve=!0,k={action:z,next:null},le===null&&(le=new Map),(z=le.get(M))===void 0)le.set(M,k);else{for(M=z;M.next!==null;)M=M.next;M.next=k}}function Ze(){}var Ie=0,Ue={readContext:function(k){var M=Ie;return U(k,M),k[M]},useContext:function(k){I();var M=Ie;return U(k,M),k[M]},useMemo:function(k,M){if(ee=I(),M=M===void 0?null:M,(H=ae())!==null){var z=H.memoizedState;if(z!==null&&M!==null){e:{var q=z[1];if(q===null)q=!1;else{for(var B=0;B<q.length&&B<M.length;B++){var W=M[B],te=q[B];if((W!==te||W===0&&1/W!=1/te)&&(W==W||te==te)){q=!1;break e}}q=!0}}if(q)return z[0]}}return k=k(),H.memoizedState=[k,M],k},useReducer:Ne,useRef:function(k){ee=I();var M=(H=ae()).memoizedState;return M===null?(k={current:k},H.memoizedState=k):M},useState:function(k){return Ne(oe,k)},useLayoutEffect:function(){},useCallback:function(k){return k},useImperativeHandle:Ze,useEffect:Ze,useDebugValue:Ze,useResponder:function(k,M){return{props:M,responder:k}}},wt={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function kt(k){switch(k){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var Ln={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Ri=a({menuitem:!0},Ln),dr={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ji=["Webkit","ms","Moz","O"];Object.keys(dr).forEach(function(k){ji.forEach(function(M){M=M+k.charAt(0).toUpperCase()+k.substring(1),dr[M]=dr[k]})});var Vi=/([A-Z])/g,qi=/^ms-/,jt=o.Children.toArray,Yr=A.ReactCurrentDispatcher,$i={listing:!0,pre:!0,textarea:!0},Ui=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,In={},Kr={},Bi=Object.prototype.hasOwnProperty,Pn={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function Nn(k,M){if(k===void 0)throw s(Error(152),P(M)||"Component")}function An(k,M,z){function q(te,re){var qe=re.prototype&&re.prototype.isReactComponent,Ge=function(Qe,mt,Vt,qt){if(qt&&typeof(qt=Qe.contextType)=="object"&&qt!==null)return U(qt,Vt),qt[Vt];if(Qe=Qe.contextTypes){for(var qn in Vt={},Qe)Vt[qn]=mt[qn];mt=Vt}else mt=j;return mt}(re,M,z,qe),Ee=[],at=!1,Ye={isMounted:function(){return!1},enqueueForceUpdate:function(){if(Ee===null)return null},enqueueReplaceState:function(Qe,mt){at=!0,Ee=[mt]},enqueueSetState:function(Qe,mt){if(Ee===null)return null;Ee.push(mt)}},be=void 0;if(qe)be=new re(te.props,Ge,Ye),typeof re.getDerivedStateFromProps=="function"&&(qe=re.getDerivedStateFromProps.call(null,te.props,be.state))!=null&&(be.state=a({},be.state,qe));else if(ee={},be=re(te.props,Ge,Ye),(be=ce(re,te.props,be,Ge))==null||be.render==null)return void Nn(k=be,re);if(be.props=te.props,be.context=Ge,be.updater=Ye,(Ye=be.state)===void 0&&(be.state=Ye=null),typeof be.UNSAFE_componentWillMount=="function"||typeof be.componentWillMount=="function")if(typeof be.componentWillMount=="function"&&typeof re.getDerivedStateFromProps!="function"&&be.componentWillMount(),typeof be.UNSAFE_componentWillMount=="function"&&typeof re.getDerivedStateFromProps!="function"&&be.UNSAFE_componentWillMount(),Ee.length){Ye=Ee;var Ke=at;if(Ee=null,at=!1,Ke&&Ye.length===1)be.state=Ye[0];else{qe=Ke?Ye[0]:be.state;var gt=!0;for(Ke=Ke?1:0;Ke<Ye.length;Ke++){var ot=Ye[Ke];(ot=typeof ot=="function"?ot.call(be,qe,te.props,Ge):ot)!=null&&(gt?(gt=!1,qe=a({},qe,ot)):a(qe,ot))}be.state=qe}}else Ee=null;if(Nn(k=be.render(),re),te=void 0,typeof be.getChildContext=="function"&&typeof(Ge=re.childContextTypes)=="object"){for(var xr in te=be.getChildContext())if(!(xr in Ge))throw s(Error(108),P(re)||"Unknown",xr)}te&&(M=a({},M,te))}for(;o.isValidElement(k);){var B=k,W=B.type;if(typeof W!="function")break;q(B,W)}return{child:k,context:M}}var Fn=function(){function k(M,z){if(!(this instanceof k))throw new TypeError("Cannot call a class as a function");o.isValidElement(M)?M.type!==l?M=[M]:(M=M.props.children,M=o.isValidElement(M)?[M]:jt(M)):M=jt(M),M={type:null,domNamespace:wt.html,children:M,childIndex:0,context:j,footer:""};var q=V[0];if(q===0){var B=V,W=2*(q=B.length);if(!(65536>=W))throw s(Error(304));var te=new Uint16Array(W);for(te.set(B),(V=te)[0]=q+1,B=q;B<W-1;B++)V[B]=B+1;V[W-1]=0}else V[0]=V[q];this.threadID=q,this.stack=[M],this.exhausted=!1,this.currentSelectValue=null,this.previousWasTextNode=!1,this.makeStaticMarkup=z,this.suspenseDepth=0,this.contextIndex=-1,this.contextStack=[],this.contextValueStack=[]}return k.prototype.destroy=function(){if(!this.exhausted){this.exhausted=!0,this.clearProviders();var M=this.threadID;V[M]=V[0],V[0]=M}},k.prototype.pushProvider=function(M){var z=++this.contextIndex,q=M.type._context,B=this.threadID;U(q,B);var W=q[B];this.contextStack[z]=q,this.contextValueStack[z]=W,q[B]=M.props.value},k.prototype.popProvider=function(){var M=this.contextIndex,z=this.contextStack[M],q=this.contextValueStack[M];this.contextStack[M]=null,this.contextValueStack[M]=null,this.contextIndex--,z[this.threadID]=q},k.prototype.clearProviders=function(){for(var M=this.contextIndex;0<=M;M--)this.contextStack[M][this.threadID]=this.contextValueStack[M]},k.prototype.read=function(M){if(this.exhausted)return null;var z=Ie;Ie=this.threadID;var q=Yr.current;Yr.current=Ue;try{for(var B=[""],W=!1;B[0].length<M;){if(this.stack.length===0){this.exhausted=!0;var te=this.threadID;V[te]=V[0],V[0]=te;break}var re=this.stack[this.stack.length-1];if(W||re.childIndex>=re.children.length){var qe=re.footer;if(qe!==""&&(this.previousWasTextNode=!1),this.stack.pop(),re.type==="select")this.currentSelectValue=null;else if(re.type!=null&&re.type.type!=null&&re.type.type.$$typeof===v)this.popProvider(re.type);else if(re.type===S){this.suspenseDepth--;var Ge=B.pop();if(W){W=!1;var Ee=re.fallbackFrame;if(!Ee)throw s(Error(303));this.stack.push(Ee),B[this.suspenseDepth]+="<!--$!-->";continue}B[this.suspenseDepth]+=Ge}B[this.suspenseDepth]+=qe}else{var at=re.children[re.childIndex++],Ye="";try{Ye+=this.render(at,re.context,re.domNamespace)}catch(be){throw be}B.length<=this.suspenseDepth&&B.push(""),B[this.suspenseDepth]+=Ye}}return B[0]}finally{Yr.current=q,Ie=z}},k.prototype.render=function(M,z,q){if(typeof M=="string"||typeof M=="number")return(q=""+M)==""?"":this.makeStaticMarkup?X(q):this.previousWasTextNode?"<!-- -->"+X(q):(this.previousWasTextNode=!0,X(q));if(M=(z=An(M,z,this.threadID)).child,z=z.context,M===null||M===!1)return"";if(!o.isValidElement(M)){if(M!=null&&M.$$typeof!=null)throw(q=M.$$typeof)===u?s(Error(257)):s(Error(258),q.toString());return M=jt(M),this.stack.push({type:null,domNamespace:q,children:M,childIndex:0,context:z,footer:""}),""}var B=M.type;if(typeof B=="string")return this.renderDOM(M,z,q);switch(B){case d:case x:case f:case _:case l:return M=jt(M.props.children),this.stack.push({type:null,domNamespace:q,children:M,childIndex:0,context:z,footer:""}),"";case S:throw s(Error(294))}if(typeof B=="object"&&B!==null)switch(B.$$typeof){case T:ee={};var W=B.render(M.props,M.ref);return W=ce(B.render,M.props,W,M.ref),W=jt(W),this.stack.push({type:null,domNamespace:q,children:W,childIndex:0,context:z,footer:""}),"";case m:return M=[o.createElement(B.type,a({ref:M.ref},M.props))],this.stack.push({type:null,domNamespace:q,children:M,childIndex:0,context:z,footer:""}),"";case v:return q={type:M,domNamespace:q,children:B=jt(M.props.children),childIndex:0,context:z,footer:""},this.pushProvider(M),this.stack.push(q),"";case E:B=M.type,W=M.props;var te=this.threadID;return U(B,te),B=jt(W.children(B[te])),this.stack.push({type:M,domNamespace:q,children:B,childIndex:0,context:z,footer:""}),"";case O:throw s(Error(338));case C:throw s(Error(295))}throw s(Error(130),B==null?B:typeof B,"")},k.prototype.renderDOM=function(M,z,q){var B=M.type.toLowerCase();if(!In.hasOwnProperty(B)){if(!Ui.test(B))throw s(Error(65),B);In[B]=!0}var W=M.props;if(B==="input")W=a({type:void 0},W,{defaultChecked:void 0,defaultValue:void 0,value:W.value!=null?W.value:W.defaultValue,checked:W.checked!=null?W.checked:W.defaultChecked});else if(B==="textarea"){var te=W.value;if(te==null){te=W.defaultValue;var re=W.children;if(re!=null){if(te!=null)throw s(Error(92));if(Array.isArray(re)){if(!(1>=re.length))throw s(Error(93));re=re[0]}te=""+re}te==null&&(te="")}W=a({},W,{value:void 0,children:""+te})}else if(B==="select")this.currentSelectValue=W.value!=null?W.value:W.defaultValue,W=a({},W,{value:void 0});else if(B==="option"){re=this.currentSelectValue;var qe=function(mt){if(mt==null)return mt;var Vt="";return o.Children.forEach(mt,function(qt){qt!=null&&(Vt+=qt)}),Vt}(W.children);if(re!=null){var Ge=W.value!=null?W.value+"":qe;if(te=!1,Array.isArray(re)){for(var Ee=0;Ee<re.length;Ee++)if(""+re[Ee]===Ge){te=!0;break}}else te=""+re===Ge;W=a({selected:void 0,children:void 0},W,{selected:te,children:qe})}}if(te=W){if(Ri[B]&&(te.children!=null||te.dangerouslySetInnerHTML!=null))throw s(Error(137),B,"");if(te.dangerouslySetInnerHTML!=null){if(te.children!=null)throw s(Error(60));if(!(typeof te.dangerouslySetInnerHTML=="object"&&"__html"in te.dangerouslySetInnerHTML))throw s(Error(61))}if(te.style!=null&&typeof te.style!="object")throw s(Error(62),"")}for(Qe in te=W,re=this.makeStaticMarkup,qe=this.stack.length===1,Ge="<"+M.type,te)if(Bi.call(te,Qe)){var at=te[Qe];if(at!=null){if(Qe==="style"){Ee=void 0;var Ye="",be="";for(Ee in at)if(at.hasOwnProperty(Ee)){var Ke=Ee.indexOf("--")===0,gt=at[Ee];if(gt!=null){if(Ke)var ot=Ee;else if(ot=Ee,Kr.hasOwnProperty(ot))ot=Kr[ot];else{var xr=ot.replace(Vi,"-$1").toLowerCase().replace(qi,"-ms-");ot=Kr[ot]=xr}Ye+=be+ot+":",be=Ee,Ye+=Ke=gt==null||typeof gt=="boolean"||gt===""?"":Ke||typeof gt!="number"||gt===0||dr.hasOwnProperty(be)&&dr[be]?(""+gt).trim():gt+"px",be=";"}}at=Ye||null}Ee=null;e:if(Ke=B,gt=te,Ke.indexOf("-")===-1)Ke=typeof gt.is=="string";else switch(Ke){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":Ke=!1;break e;default:Ke=!0}Ke?Pn.hasOwnProperty(Qe)||(Ee=Pe(Ee=Qe)&&at!=null?Ee+'="'+X(at)+'"':""):Ee=se(Qe,at),Ee&&(Ge+=" "+Ee)}}re||qe&&(Ge+=' data-reactroot=""');var Qe=Ge;te="",Ln.hasOwnProperty(B)?Qe+="/>":(Qe+=">",te="</"+M.type+">");e:{if((re=W.dangerouslySetInnerHTML)!=null){if(re.__html!=null){re=re.__html;break e}}else if(typeof(re=W.children)=="string"||typeof re=="number"){re=X(re);break e}re=null}return re!=null?(W=[],$i[B]&&re.charAt(0)===`
|
|
69
|
+
*/var a=i(2),o=i(0);function s(k){for(var M=k.message,H="https://reactjs.org/docs/error-decoder.html?invariant="+M,q=1;q<arguments.length;q++)H+="&args[]="+encodeURIComponent(arguments[q]);return k.message="Minified React error #"+M+"; visit "+H+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",k}var c=typeof Symbol=="function"&&Symbol.for,u=c?Symbol.for("react.portal"):60106,l=c?Symbol.for("react.fragment"):60107,d=c?Symbol.for("react.strict_mode"):60108,f=c?Symbol.for("react.profiler"):60114,v=c?Symbol.for("react.provider"):60109,E=c?Symbol.for("react.context"):60110,x=c?Symbol.for("react.concurrent_mode"):60111,T=c?Symbol.for("react.forward_ref"):60112,O=c?Symbol.for("react.suspense"):60113,_=c?Symbol.for("react.suspense_list"):60120,m=c?Symbol.for("react.memo"):60115,C=c?Symbol.for("react.lazy"):60116,S=c?Symbol.for("react.fundamental"):60117;function P(k){if(k==null)return null;if(typeof k=="function")return k.displayName||k.name||null;if(typeof k=="string")return k;switch(k){case l:return"Fragment";case u:return"Portal";case f:return"Profiler";case d:return"StrictMode";case O:return"Suspense";case _:return"SuspenseList"}if(typeof k=="object")switch(k.$$typeof){case E:return"Context.Consumer";case v:return"Context.Provider";case T:var M=k.render;return M=M.displayName||M.name||"",k.displayName||(M!==""?"ForwardRef("+M+")":"ForwardRef");case m:return P(k.type);case C:if(k=k._status===1?k._result:null)return P(k)}return null}var A=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;A.hasOwnProperty("ReactCurrentDispatcher")||(A.ReactCurrentDispatcher={current:null}),A.hasOwnProperty("ReactCurrentBatchConfig")||(A.ReactCurrentBatchConfig={suspense:null});var j={};function U(k,M){for(var H=0|k._threadCount;H<=M;H++)k[H]=k._currentValue2,k._threadCount=H+1}for(var V=new Uint16Array(16),me=0;15>me;me++)V[me]=me+1;V[15]=0;var Le=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ye=Object.prototype.hasOwnProperty,Se={},Ve={};function Pe(k){return!!ye.call(Ve,k)||!ye.call(Se,k)&&(Le.test(k)?Ve[k]=!0:(Se[k]=!0,!1))}function Y(k,M,H,q,B,z){this.acceptsBooleans=M===2||M===3||M===4,this.attributeName=q,this.attributeNamespace=B,this.mustUseProperty=H,this.propertyName=k,this.type=M,this.sanitizeURL=z}var $={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(k){$[k]=new Y(k,0,!1,k,null,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(k){var M=k[0];$[M]=new Y(M,1,!1,k[1],null,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(k){$[k]=new Y(k,2,!1,k.toLowerCase(),null,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(k){$[k]=new Y(k,2,!1,k,null,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(k){$[k]=new Y(k,3,!1,k.toLowerCase(),null,!1)}),["checked","multiple","muted","selected"].forEach(function(k){$[k]=new Y(k,3,!0,k,null,!1)}),["capture","download"].forEach(function(k){$[k]=new Y(k,4,!1,k,null,!1)}),["cols","rows","size","span"].forEach(function(k){$[k]=new Y(k,6,!1,k,null,!1)}),["rowSpan","start"].forEach(function(k){$[k]=new Y(k,5,!1,k.toLowerCase(),null,!1)});var Z=/[\-:]([a-z])/g;function N(k){return k[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(k){var M=k.replace(Z,N);$[M]=new Y(M,1,!1,k,null,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(k){var M=k.replace(Z,N);$[M]=new Y(M,1,!1,k,"http://www.w3.org/1999/xlink",!1)}),["xml:base","xml:lang","xml:space"].forEach(function(k){var M=k.replace(Z,N);$[M]=new Y(M,1,!1,k,"http://www.w3.org/XML/1998/namespace",!1)}),["tabIndex","crossOrigin"].forEach(function(k){$[k]=new Y(k,1,!1,k.toLowerCase(),null,!1)}),$.xlinkHref=new Y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach(function(k){$[k]=new Y(k,1,!1,k.toLowerCase(),null,!0)});var R=/["'&<>]/;function K(k){if(typeof k=="boolean"||typeof k=="number")return""+k;k=""+k;var M=R.exec(k);if(M){var H,q="",B=0;for(H=M.index;H<k.length;H++){switch(k.charCodeAt(H)){case 34:M=""";break;case 38:M="&";break;case 39:M="'";break;case 60:M="<";break;case 62:M=">";break;default:continue}B!==H&&(q+=k.substring(B,H)),B=H+1,q+=M}k=B!==H?q+k.substring(B,H):q}return k}function se(k,M){var H,q=$.hasOwnProperty(k)?$[k]:null;return(H=k!=="style")&&(H=q!==null?q.type===0:2<k.length&&(k[0]==="o"||k[0]==="O")&&(k[1]==="n"||k[1]==="N")),H||function(B,z,te,re){if(z==null||function(qe,Ge,Ee,at){if(Ee!==null&&Ee.type===0)return!1;switch(typeof Ge){case"function":case"symbol":return!0;case"boolean":return Ee!==null?!Ee.acceptsBooleans:(qe=qe.toLowerCase().slice(0,5))!=="data-"&&qe!=="aria-";default:return!1}}(B,z,te))return!0;if(te!==null)switch(te.type){case 3:return!z;case 4:return z===!1;case 5:return isNaN(z);case 6:return isNaN(z)||1>z}return!1}(k,M,q)?"":q!==null?(k=q.attributeName,(H=q.type)===3||H===4&&M===!0?k+'=""':(q.sanitizeURL&&(M=""+M),k+'="'+K(M)+'"')):Pe(k)?k+'="'+K(M)+'"':""}var ee=null,ge=null,W=null,ie=!1,ve=!1,le=null,pe=0;function I(){if(ee===null)throw s(Error(321));return ee}function L(){if(0<pe)throw s(Error(312));return{memoizedState:null,queue:null,next:null}}function ae(){return W===null?ge===null?(ie=!1,ge=W=L()):(ie=!0,W=ge):W.next===null?(ie=!1,W=W.next=L()):(ie=!0,W=W.next),W}function ce(k,M,H,q){for(;ve;)ve=!1,pe+=1,W=null,H=k(M,q);return ge=ee=null,pe=0,W=le=null,H}function oe(k,M){return typeof M=="function"?M(k):M}function Ne(k,M,H){if(ee=I(),W=ae(),ie){var q=W.queue;if(M=q.dispatch,le!==null&&(H=le.get(q))!==void 0){le.delete(q),q=W.memoizedState;do q=k(q,H.action),H=H.next;while(H!==null);return W.memoizedState=q,[q,M]}return[W.memoizedState,M]}return k=k===oe?typeof M=="function"?M():M:H!==void 0?H(M):M,W.memoizedState=k,k=(k=W.queue={last:null,dispatch:null}).dispatch=We.bind(null,ee,k),[W.memoizedState,k]}function We(k,M,H){if(!(25>pe))throw s(Error(301));if(k===ee)if(ve=!0,k={action:H,next:null},le===null&&(le=new Map),(H=le.get(M))===void 0)le.set(M,k);else{for(M=H;M.next!==null;)M=M.next;M.next=k}}function Ze(){}var Ie=0,Ue={readContext:function(k){var M=Ie;return U(k,M),k[M]},useContext:function(k){I();var M=Ie;return U(k,M),k[M]},useMemo:function(k,M){if(ee=I(),M=M===void 0?null:M,(W=ae())!==null){var H=W.memoizedState;if(H!==null&&M!==null){e:{var q=H[1];if(q===null)q=!1;else{for(var B=0;B<q.length&&B<M.length;B++){var z=M[B],te=q[B];if((z!==te||z===0&&1/z!=1/te)&&(z==z||te==te)){q=!1;break e}}q=!0}}if(q)return H[0]}}return k=k(),W.memoizedState=[k,M],k},useReducer:Ne,useRef:function(k){ee=I();var M=(W=ae()).memoizedState;return M===null?(k={current:k},W.memoizedState=k):M},useState:function(k){return Ne(oe,k)},useLayoutEffect:function(){},useCallback:function(k){return k},useImperativeHandle:Ze,useEffect:Ze,useDebugValue:Ze,useResponder:function(k,M){return{props:M,responder:k}}},wt={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function kt(k){switch(k){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var Ln={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Ri=a({menuitem:!0},Ln),hr={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ji=["Webkit","ms","Moz","O"];Object.keys(hr).forEach(function(k){ji.forEach(function(M){M=M+k.charAt(0).toUpperCase()+k.substring(1),hr[M]=hr[k]})});var Vi=/([A-Z])/g,qi=/^ms-/,jt=o.Children.toArray,Yr=A.ReactCurrentDispatcher,$i={listing:!0,pre:!0,textarea:!0},Ui=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,In={},Kr={},Bi=Object.prototype.hasOwnProperty,Pn={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function Nn(k,M){if(k===void 0)throw s(Error(152),P(M)||"Component")}function An(k,M,H){function q(te,re){var qe=re.prototype&&re.prototype.isReactComponent,Ge=function(Qe,mt,Vt,qt){if(qt&&typeof(qt=Qe.contextType)=="object"&&qt!==null)return U(qt,Vt),qt[Vt];if(Qe=Qe.contextTypes){for(var qn in Vt={},Qe)Vt[qn]=mt[qn];mt=Vt}else mt=j;return mt}(re,M,H,qe),Ee=[],at=!1,Ye={isMounted:function(){return!1},enqueueForceUpdate:function(){if(Ee===null)return null},enqueueReplaceState:function(Qe,mt){at=!0,Ee=[mt]},enqueueSetState:function(Qe,mt){if(Ee===null)return null;Ee.push(mt)}},be=void 0;if(qe)be=new re(te.props,Ge,Ye),typeof re.getDerivedStateFromProps=="function"&&(qe=re.getDerivedStateFromProps.call(null,te.props,be.state))!=null&&(be.state=a({},be.state,qe));else if(ee={},be=re(te.props,Ge,Ye),(be=ce(re,te.props,be,Ge))==null||be.render==null)return void Nn(k=be,re);if(be.props=te.props,be.context=Ge,be.updater=Ye,(Ye=be.state)===void 0&&(be.state=Ye=null),typeof be.UNSAFE_componentWillMount=="function"||typeof be.componentWillMount=="function")if(typeof be.componentWillMount=="function"&&typeof re.getDerivedStateFromProps!="function"&&be.componentWillMount(),typeof be.UNSAFE_componentWillMount=="function"&&typeof re.getDerivedStateFromProps!="function"&&be.UNSAFE_componentWillMount(),Ee.length){Ye=Ee;var Ke=at;if(Ee=null,at=!1,Ke&&Ye.length===1)be.state=Ye[0];else{qe=Ke?Ye[0]:be.state;var gt=!0;for(Ke=Ke?1:0;Ke<Ye.length;Ke++){var ot=Ye[Ke];(ot=typeof ot=="function"?ot.call(be,qe,te.props,Ge):ot)!=null&&(gt?(gt=!1,qe=a({},qe,ot)):a(qe,ot))}be.state=qe}}else Ee=null;if(Nn(k=be.render(),re),te=void 0,typeof be.getChildContext=="function"&&typeof(Ge=re.childContextTypes)=="object"){for(var xr in te=be.getChildContext())if(!(xr in Ge))throw s(Error(108),P(re)||"Unknown",xr)}te&&(M=a({},M,te))}for(;o.isValidElement(k);){var B=k,z=B.type;if(typeof z!="function")break;q(B,z)}return{child:k,context:M}}var Fn=function(){function k(M,H){if(!(this instanceof k))throw new TypeError("Cannot call a class as a function");o.isValidElement(M)?M.type!==l?M=[M]:(M=M.props.children,M=o.isValidElement(M)?[M]:jt(M)):M=jt(M),M={type:null,domNamespace:wt.html,children:M,childIndex:0,context:j,footer:""};var q=V[0];if(q===0){var B=V,z=2*(q=B.length);if(!(65536>=z))throw s(Error(304));var te=new Uint16Array(z);for(te.set(B),(V=te)[0]=q+1,B=q;B<z-1;B++)V[B]=B+1;V[z-1]=0}else V[0]=V[q];this.threadID=q,this.stack=[M],this.exhausted=!1,this.currentSelectValue=null,this.previousWasTextNode=!1,this.makeStaticMarkup=H,this.suspenseDepth=0,this.contextIndex=-1,this.contextStack=[],this.contextValueStack=[]}return k.prototype.destroy=function(){if(!this.exhausted){this.exhausted=!0,this.clearProviders();var M=this.threadID;V[M]=V[0],V[0]=M}},k.prototype.pushProvider=function(M){var H=++this.contextIndex,q=M.type._context,B=this.threadID;U(q,B);var z=q[B];this.contextStack[H]=q,this.contextValueStack[H]=z,q[B]=M.props.value},k.prototype.popProvider=function(){var M=this.contextIndex,H=this.contextStack[M],q=this.contextValueStack[M];this.contextStack[M]=null,this.contextValueStack[M]=null,this.contextIndex--,H[this.threadID]=q},k.prototype.clearProviders=function(){for(var M=this.contextIndex;0<=M;M--)this.contextStack[M][this.threadID]=this.contextValueStack[M]},k.prototype.read=function(M){if(this.exhausted)return null;var H=Ie;Ie=this.threadID;var q=Yr.current;Yr.current=Ue;try{for(var B=[""],z=!1;B[0].length<M;){if(this.stack.length===0){this.exhausted=!0;var te=this.threadID;V[te]=V[0],V[0]=te;break}var re=this.stack[this.stack.length-1];if(z||re.childIndex>=re.children.length){var qe=re.footer;if(qe!==""&&(this.previousWasTextNode=!1),this.stack.pop(),re.type==="select")this.currentSelectValue=null;else if(re.type!=null&&re.type.type!=null&&re.type.type.$$typeof===v)this.popProvider(re.type);else if(re.type===O){this.suspenseDepth--;var Ge=B.pop();if(z){z=!1;var Ee=re.fallbackFrame;if(!Ee)throw s(Error(303));this.stack.push(Ee),B[this.suspenseDepth]+="<!--$!-->";continue}B[this.suspenseDepth]+=Ge}B[this.suspenseDepth]+=qe}else{var at=re.children[re.childIndex++],Ye="";try{Ye+=this.render(at,re.context,re.domNamespace)}catch(be){throw be}B.length<=this.suspenseDepth&&B.push(""),B[this.suspenseDepth]+=Ye}}return B[0]}finally{Yr.current=q,Ie=H}},k.prototype.render=function(M,H,q){if(typeof M=="string"||typeof M=="number")return(q=""+M)==""?"":this.makeStaticMarkup?K(q):this.previousWasTextNode?"<!-- -->"+K(q):(this.previousWasTextNode=!0,K(q));if(M=(H=An(M,H,this.threadID)).child,H=H.context,M===null||M===!1)return"";if(!o.isValidElement(M)){if(M!=null&&M.$$typeof!=null)throw(q=M.$$typeof)===u?s(Error(257)):s(Error(258),q.toString());return M=jt(M),this.stack.push({type:null,domNamespace:q,children:M,childIndex:0,context:H,footer:""}),""}var B=M.type;if(typeof B=="string")return this.renderDOM(M,H,q);switch(B){case d:case x:case f:case _:case l:return M=jt(M.props.children),this.stack.push({type:null,domNamespace:q,children:M,childIndex:0,context:H,footer:""}),"";case O:throw s(Error(294))}if(typeof B=="object"&&B!==null)switch(B.$$typeof){case T:ee={};var z=B.render(M.props,M.ref);return z=ce(B.render,M.props,z,M.ref),z=jt(z),this.stack.push({type:null,domNamespace:q,children:z,childIndex:0,context:H,footer:""}),"";case m:return M=[o.createElement(B.type,a({ref:M.ref},M.props))],this.stack.push({type:null,domNamespace:q,children:M,childIndex:0,context:H,footer:""}),"";case v:return q={type:M,domNamespace:q,children:B=jt(M.props.children),childIndex:0,context:H,footer:""},this.pushProvider(M),this.stack.push(q),"";case E:B=M.type,z=M.props;var te=this.threadID;return U(B,te),B=jt(z.children(B[te])),this.stack.push({type:M,domNamespace:q,children:B,childIndex:0,context:H,footer:""}),"";case S:throw s(Error(338));case C:throw s(Error(295))}throw s(Error(130),B==null?B:typeof B,"")},k.prototype.renderDOM=function(M,H,q){var B=M.type.toLowerCase();if(!In.hasOwnProperty(B)){if(!Ui.test(B))throw s(Error(65),B);In[B]=!0}var z=M.props;if(B==="input")z=a({type:void 0},z,{defaultChecked:void 0,defaultValue:void 0,value:z.value!=null?z.value:z.defaultValue,checked:z.checked!=null?z.checked:z.defaultChecked});else if(B==="textarea"){var te=z.value;if(te==null){te=z.defaultValue;var re=z.children;if(re!=null){if(te!=null)throw s(Error(92));if(Array.isArray(re)){if(!(1>=re.length))throw s(Error(93));re=re[0]}te=""+re}te==null&&(te="")}z=a({},z,{value:void 0,children:""+te})}else if(B==="select")this.currentSelectValue=z.value!=null?z.value:z.defaultValue,z=a({},z,{value:void 0});else if(B==="option"){re=this.currentSelectValue;var qe=function(mt){if(mt==null)return mt;var Vt="";return o.Children.forEach(mt,function(qt){qt!=null&&(Vt+=qt)}),Vt}(z.children);if(re!=null){var Ge=z.value!=null?z.value+"":qe;if(te=!1,Array.isArray(re)){for(var Ee=0;Ee<re.length;Ee++)if(""+re[Ee]===Ge){te=!0;break}}else te=""+re===Ge;z=a({selected:void 0,children:void 0},z,{selected:te,children:qe})}}if(te=z){if(Ri[B]&&(te.children!=null||te.dangerouslySetInnerHTML!=null))throw s(Error(137),B,"");if(te.dangerouslySetInnerHTML!=null){if(te.children!=null)throw s(Error(60));if(!(typeof te.dangerouslySetInnerHTML=="object"&&"__html"in te.dangerouslySetInnerHTML))throw s(Error(61))}if(te.style!=null&&typeof te.style!="object")throw s(Error(62),"")}for(Qe in te=z,re=this.makeStaticMarkup,qe=this.stack.length===1,Ge="<"+M.type,te)if(Bi.call(te,Qe)){var at=te[Qe];if(at!=null){if(Qe==="style"){Ee=void 0;var Ye="",be="";for(Ee in at)if(at.hasOwnProperty(Ee)){var Ke=Ee.indexOf("--")===0,gt=at[Ee];if(gt!=null){if(Ke)var ot=Ee;else if(ot=Ee,Kr.hasOwnProperty(ot))ot=Kr[ot];else{var xr=ot.replace(Vi,"-$1").toLowerCase().replace(qi,"-ms-");ot=Kr[ot]=xr}Ye+=be+ot+":",be=Ee,Ye+=Ke=gt==null||typeof gt=="boolean"||gt===""?"":Ke||typeof gt!="number"||gt===0||hr.hasOwnProperty(be)&&hr[be]?(""+gt).trim():gt+"px",be=";"}}at=Ye||null}Ee=null;e:if(Ke=B,gt=te,Ke.indexOf("-")===-1)Ke=typeof gt.is=="string";else switch(Ke){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":Ke=!1;break e;default:Ke=!0}Ke?Pn.hasOwnProperty(Qe)||(Ee=Pe(Ee=Qe)&&at!=null?Ee+'="'+K(at)+'"':""):Ee=se(Qe,at),Ee&&(Ge+=" "+Ee)}}re||qe&&(Ge+=' data-reactroot=""');var Qe=Ge;te="",Ln.hasOwnProperty(B)?Qe+="/>":(Qe+=">",te="</"+M.type+">");e:{if((re=z.dangerouslySetInnerHTML)!=null){if(re.__html!=null){re=re.__html;break e}}else if(typeof(re=z.children)=="string"||typeof re=="number"){re=K(re);break e}re=null}return re!=null?(z=[],$i[B]&&re.charAt(0)===`
|
|
70
70
|
`&&(Qe+=`
|
|
71
|
-
`),Qe+=re):
|
|
71
|
+
`),Qe+=re):z=jt(z.children),M=M.type,q=q==null||q==="http://www.w3.org/1999/xhtml"?kt(M):q==="http://www.w3.org/2000/svg"&&M==="foreignObject"?"http://www.w3.org/1999/xhtml":q,this.stack.push({domNamespace:q,type:B,children:z,childIndex:0,context:H,footer:te}),this.previousWasTextNode=!1,Qe},k}(),Rn={renderToString:function(k){k=new Fn(k,!1);try{return k.read(1/0)}finally{k.destroy()}},renderToStaticMarkup:function(k){k=new Fn(k,!0);try{return k.read(1/0)}finally{k.destroy()}},renderToNodeStream:function(){throw s(Error(207))},renderToStaticNodeStream:function(){throw s(Error(208))},version:"16.9.0"},jn={default:Rn},Vn=jn&&Rn||jn;r.exports=Vn.default||Vn},function(r,n,i){i.r(n);var a=i(0),o=i.n(a);function s(){return(s=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var c=function(h){return o.a.createElement("g",null,o.a.createElement("path",s({},h,{d:`M 0 100 L 33 0 L 66 0 L 100 100 L 75 100
|
|
72
72
|
L 66 75 L 33 75 L 25 100 L 0 100`})),o.a.createElement("path",{fill:"#ffffff",d:"M 41 55 L 50 25 L 58 55 L 41 55"}))};function u(){return(u=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var l=function(h){return o.a.createElement("g",null,o.a.createElement("path",u({},h,{d:`M 0 0 L 80 0 C 105 0 105 50 80 50
|
|
73
73
|
C 105 50 105 100 80 100 L 00 100
|
|
74
74
|
L 0 0`})),o.a.createElement("path",{d:"M 20 15 L 70 15 C 80 15 80 35 70 35 L 20 35 L 20 15",fill:"#ffffff"}),o.a.createElement("path",{d:"M 20 65 L 70 65 C 80 65 80 85 70 85 L 20 85 L 20 65",fill:"#ffffff"}))};function d(){return(d=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var f=function(h){return o.a.createElement("path",d({},h,{d:`M 100 28 C 100 -13 0 -13 0 50
|
|
@@ -78,22 +78,22 @@ object-assign
|
|
|
78
78
|
L 0 100 L 0 0`})),o.a.createElement("path",{fill:"#ffffff",d:`M 20 15 L 40 15 C 85 15 85 85 40 85
|
|
79
79
|
L 20 85 L 20 15`}))};function x(){return(x=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var T=function(h){return o.a.createElement("path",x({},h,{d:`M 0 0 L 100 0 L 100 20 L 20 20 L 20 40
|
|
80
80
|
L 90 40 L 90 60 L 20 60 L 20 80 L 100 80
|
|
81
|
-
L 100 100 L 0 100 L 0 0`}))};function
|
|
81
|
+
L 100 100 L 0 100 L 0 0`}))};function O(){return(O=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var _=function(h){return o.a.createElement("path",O({},h,{d:`M 0 0 L 100 0 L 100 20 L 20 20 L 20 40
|
|
82
82
|
L 80 40 L 80 60 L 20 60 L 20 100 L 0 100
|
|
83
83
|
L 0 0`}))};function m(){return(m=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var C=function(h){return o.a.createElement("path",m({},h,{d:`M 100 28 C 100 -13 0 -13 0 50 C 0 113 100 113 100 72
|
|
84
84
|
L 100 48 L 55 48 L 55 72 L 75 72 C 75 90 30 90 30 50
|
|
85
|
-
C 30 10 75 5 75 28 L 100 28`}))};function
|
|
85
|
+
C 30 10 75 5 75 28 L 100 28`}))};function S(){return(S=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var P=function(h){return o.a.createElement("path",S({},h,{d:`M 0 0 L 20 0 L 20 40 L 80 40 L 80 0
|
|
86
86
|
L 100 0 L 100 100 L 80 100 L 80 60
|
|
87
87
|
L 20 60 L 20 100 L 0 100 L 0 0`}))};function A(){return(A=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var j=function(h){return o.a.createElement("path",A({},h,{d:"M 40 0 L 60 0 L 60 100 L 40 100 L 40 0"}))};function U(){return(U=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var V=function(h){return o.a.createElement("path",U({},h,{d:`M 0 60 C 0 111 100 111 100 60
|
|
88
88
|
L 100 0 L 75 0 L 75 60
|
|
89
89
|
C 80 90 20 90 25 60`}))};function me(){return(me=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Le=function(h){return o.a.createElement("path",me({},h,{d:`M 0 0 L 20 0 L 20 40 L 75 0 L 100 0
|
|
90
90
|
L 50 50 L 100 100 L 75 100 L 30 65
|
|
91
|
-
L 20 75 L 20 100 L 0 100 L 0 0`}))};function ye(){return(ye=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var
|
|
91
|
+
L 20 75 L 20 100 L 0 100 L 0 0`}))};function ye(){return(ye=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Se=function(h){return o.a.createElement("path",ye({},h,{d:`M 0 0 L 0 100 L 100 100 L 100 80
|
|
92
92
|
L 20 80 L 20 0 L 0 0`}))};function Ve(){return(Ve=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Pe=function(h){return o.a.createElement("path",Ve({},h,{d:`M 0 0 L 20 0 L 50 35 L 80 0 L 100 0 L 100 100
|
|
93
93
|
L 80 100 L 80 30 L 50 65 L 20 30 L 20 100
|
|
94
|
-
L 0 100 L 0 0`}))};function
|
|
95
|
-
L 100 0 L 100 100 L 80 100 L 20 25 L 20 100 L 0 100`}))};function Z(){return(Z=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var N=function(h){return o.a.createElement("g",null,o.a.createElement("circle",Z({cx:"50",cy:"50",r:"50"},h)),o.a.createElement("circle",{cx:"50",cy:"50",r:"32",fill:"#ffffff"}))};function R(){return(R=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var
|
|
96
|
-
L 20 50 L 20 100 L 0 100 L 0 0`})),o.a.createElement("path",{fill:"#ffffff",d:"M 20 15 L 70 15 C 80 15 80 35 70 35 L 20 35 L 20 15"}))};function se(){return(se=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var ee=function(h){return o.a.createElement("g",null,o.a.createElement("circle",se({cx:"50",cy:"50",r:"50"},h)),o.a.createElement("circle",{cx:"50",cy:"50",r:"32",fill:"#ffffff"}),o.a.createElement("path",se({d:"M 85 100 L 55 70 L 70 55 L 100 85 L 85 100"},h)))};function ge(){return(ge=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var
|
|
94
|
+
L 0 100 L 0 0`}))};function Y(){return(Y=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var $=function(h){return o.a.createElement("path",Y({},h,{d:`M 0 100 L 0 0 L 20 0 L 80 75 L 80 0
|
|
95
|
+
L 100 0 L 100 100 L 80 100 L 20 25 L 20 100 L 0 100`}))};function Z(){return(Z=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var N=function(h){return o.a.createElement("g",null,o.a.createElement("circle",Z({cx:"50",cy:"50",r:"50"},h)),o.a.createElement("circle",{cx:"50",cy:"50",r:"32",fill:"#ffffff"}))};function R(){return(R=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var K=function(h){return o.a.createElement("g",null,o.a.createElement("path",R({},h,{d:`M 0 0 L 80 0 C 105 0 105 50 80 50
|
|
96
|
+
L 20 50 L 20 100 L 0 100 L 0 0`})),o.a.createElement("path",{fill:"#ffffff",d:"M 20 15 L 70 15 C 80 15 80 35 70 35 L 20 35 L 20 15"}))};function se(){return(se=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var ee=function(h){return o.a.createElement("g",null,o.a.createElement("circle",se({cx:"50",cy:"50",r:"50"},h)),o.a.createElement("circle",{cx:"50",cy:"50",r:"32",fill:"#ffffff"}),o.a.createElement("path",se({d:"M 85 100 L 55 70 L 70 55 L 100 85 L 85 100"},h)))};function ge(){return(ge=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var W=function(h){return o.a.createElement("g",null,o.a.createElement("path",ge({},h,{d:`M 0 0 L 80 0 C 105 0 105 50 80 50
|
|
97
97
|
C 100 50 100 70 100 70 L 100 100 L 80 100
|
|
98
98
|
L 80 80 C 80 80 80 60 50 60 L 20 60
|
|
99
99
|
L 20 100 L 0 100 L 0 0`})),o.a.createElement("path",{fill:"#ffffff",d:"M 20 15 L 70 15 C 80 15 80 35 70 35 L 20 35 L 20 15"}))},ie=function(h){var g=h.fill,y=h.fillOpacity;return o.a.createElement("path",{fill:"#ffffff",stroke:g,strokeOpacity:y,strokeWidth:"18",d:"M92 26 A43 20 0 1 0 43 46 A42 23 0 1 1 9 68"})};function ve(){return(ve=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var le=function(h){return o.a.createElement("path",ve({},h,{d:`M 0 0 L 0 20 L 35 20 L 35 100
|
|
@@ -103,24 +103,24 @@ object-assign
|
|
|
103
103
|
C 80 90 20 90 25 60 L 25 0 L 0 0`}))};function L(){return(L=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var ae=function(h){return o.a.createElement("path",L({},h,{d:`M 0 0 L 20 0 L 50 80 L 80 0
|
|
104
104
|
L 100 0 L 60 100 L 40 100 L 0 0`}))};function ce(){return(ce=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var oe=function(h){return o.a.createElement("path",ce({},h,{d:`M 0 0 L 20 0 L 30 70 L 50 30 L 70 70 L 80 0
|
|
105
105
|
L 100 0 L 90 100 L 70 100 L 50 65 L 30 100
|
|
106
|
-
L 10 100 L 0 0`}))};function Ne(){return(Ne=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var
|
|
106
|
+
L 10 100 L 0 0`}))};function Ne(){return(Ne=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var We=function(h){return o.a.createElement("path",Ne({},h,{d:`M 0 0 L 20 0 L 50 40 L 80 0 L 100 0 L 70 50
|
|
107
107
|
L 100 100 L 80 100 L 50 60 L 20 100 L 0 100
|
|
108
108
|
L 30 50 L 0 0`}))};function Ze(){return(Ze=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Ie=function(h){return o.a.createElement("path",Ze({},h,{d:`M 0 0 L 20 0 L 50 45 L 80 0 L 100 0
|
|
109
109
|
L 60 60 L 60 100 L 40 100 L 40 60 L 0 0`}))};function Ue(){return(Ue=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var wt=function(h){return o.a.createElement("path",Ue({},h,{d:`M 0 0 L 100 0 L 100 20 L 35 80 L 100 80
|
|
110
110
|
L 100 100 L 0 100 L 0 80 L 65 20 L 0 20
|
|
111
|
-
L 0 0`}))};function kt(){return(kt=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Ln=function(h){return o.a.createElement("g",null,o.a.createElement("path",kt({d:"M 10 20 C 5 -5 95 -10 100 35 L 100 100 L 80 100 L 80 90 C 90 105 10 105 0 80 C 0 45 40 40 60 45 L 80 50 C 95 30 40 5 10 35"},h)),o.a.createElement("path",{fill:"#ffffff",d:"M 77 70 C 70 90 30 90 22 80 C 10 50 80 60 77 70"}))};function Ri(){return(Ri=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var dr=function(h){return o.a.createElement("g",null,o.a.createElement("path",Ri({d:"M 20 0 L 0 0 L 0 100 L 20 100 L 20 80 C 10 110 90 110 100 70 L 100 60 C 90 10 10 10 20 40 L 20 40 L 20 0"},h)),o.a.createElement("path",{d:"M 79 60 C 80 95 20 95 20 65 C 20 30 80 30 79 65",fill:"#ffffff"}))};function ji(){return(ji=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Vi=function(h){return o.a.createElement("g",null,o.a.createElement("path",ji({d:"M 80 0 L 100 0 L 100 100 L 80 100 L 80 80 C 90 110 10 110 0 70 L 0 60 C 10 10 90 10 80 40 L 80 40 L 80 0"},h)),o.a.createElement("path",{d:"M 79 60 C 80 95 20 95 20 65 C 20 30 80 30 79 65",fill:"#ffffff"}))};function qi(){return(qi=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var jt=function(h){return o.a.createElement("g",null,o.a.createElement("path",qi({d:"M 25 50 L 100 50 C 85 -17 15 -17 0 50 C 0 75 25 100 50 100 L 95 100 L 95 80 L 50 80 Q 25 70 25 50"},h)),o.a.createElement("path",{d:"M 33 37 L 68 37 C 58 10 42 10 33 37",fill:"#ffffff"}))};function Yr(){return(Yr=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var $i=function(h){return o.a.createElement("path",Yr({d:"M 95 32 C 80 -17 20 -5 20 37 L 7 37 L 7 50 L 20 50 L 20 100 L 45 100 L 45 50 L 57 50 L 57 37 L 45 37 C 45 10 70 10 75 32 L 95 32"},h))};function Ui(){return(Ui=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var In=function(h){return o.a.createElement("g",null,o.a.createElement("path",Ui({d:"M 100 15 L 100 0 L 80 0 L 80 15 C 85 -8 15 -8 0 25 C 2 75 80 75 80 50 L 75 65 C 65 85 45 85 10 75 L 10 90 C 25 110 85 110 100 75 L 100 25"},h)),o.a.createElement("path",{d:"M 67 30 C 70 10 25 10 27 30 C 25 50 70 50 67 30",fill:"#ffffff"}))};function Kr(){return(Kr=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Bi=function(h){return o.a.createElement("path",Kr({d:"M 0 0 L 0 100 L 20 100 L 20 80 C 20 40 80 40 80 80 L 80 100 L 100 100 L 100 50 C 80 20 20 20 20 45 L 20 0 L 0 0"},h))};function Pn(){return(Pn=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Nn=function(h){return o.a.createElement("g",null,o.a.createElement("rect",Pn({},h,{x:40,y:20,width:20,height:80})),o.a.createElement("rect",Pn({},h,{x:40,y:0,width:20,height:15})))};function An(){return(An=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Fn=function(h){return o.a.createElement("g",null,o.a.createElement("path",An({d:"M 0 60 C 0 115 100 115 100 60 L 100 20 L 80 20 L 80 60 C 80 90 20 90 25 60"},h)),o.a.createElement("rect",An({x:80,width:20,height:15},h)))};function Rn(){return(Rn=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var jn=function(h){return o.a.createElement("path",Rn({d:"M 0 0 L 20 0 L 20 60 L 75 30 L 100 30 L 50 65 L 100 100 L 75 100 L 27 80 L 20 85 L 20 100 L 0 100 L 0 0"},h))};function Vn(){return(Vn=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var k=function(h){return o.a.createElement("rect",Vn({x:40,y:0,width:20,height:100},h))};function M(){return(M=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var z=function(h){return o.a.createElement("path",M({d:"M 0 0 L 0 100 L 20 100 L 20 60 C 20 20 40 20 40 50 L 40 100 L 60 100 L 60 50 C 60 20 80 20 80 50 L 80 100 L 100 100 L 100 50 C 100 -10 40 -10 50 50 C 50 -5 20 -5 20 20 L 20 0 L 0 0"},h))};function q(){return(q=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var B=function(h){return o.a.createElement("path",q({d:"M 0 0 L 0 100 L 20 100 L 20 60 C 20 0 80 0 80 50 L 80 100 L 100 100 L 100 25 C 80 -10 20 -10 20 20 L 20 0 L 0 0"},h))};function W(){return(W=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var te=function(h){return o.a.createElement("g",null,o.a.createElement("path",W({d:"M 20 100 L 0 100 L 0 0 L 20 0 L 20 20 C 10 -10 90 -10 100 30 L 100 40 C 90 90 10 90 20 60 L 20 60 L 20 100"},h)),o.a.createElement("path",{d:"M 79 40 C 80 5 20 5 20 35 C 20 70 80 70 79 35",fill:"#ffffff"}))};function re(){return(re=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var qe=function(h){return o.a.createElement("g",null,o.a.createElement("path",re({d:"M 80 100 L 100 100 L 100 0 L 80 0 L 80 20 C 90 -10 10 -10 0 30 L 0 40 C 10 90 90 90 80 60 L 80 60 L 80 100"},h)),o.a.createElement("path",{d:"M 79 40 C 80 5 20 5 20 35 C 20 70 80 70 79 35",fill:"#ffffff"}))};function Ge(){return(Ge=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Ee=function(h){return o.a.createElement("path",Ge({d:"M 0 0 L 0 100 L 20 100 L 20 60 C 20 0 80 0 80 50 L 100 50 L 100 25 C 80 -10 20 -10 20 20 L 20 0 L 0 0"},h))};function at(){return(at=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Ye=function(h){return o.a.createElement("path",at({d:"M 95 68 C 80 117 20 105 20 63 L 20 47 L 7 47 L 7 27 L 20 27 L 20 0 L 45 0 L 45 27 L 57 27 L 57 47 L 45 47 L 45 63 C 45 90 70 90 75 68 L 95 68"},h))};function be(){return(be=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Ke=function(h){return o.a.createElement("g",null,o.a.createElement("path",be({d:"M 0 0 L 0 60 C 0 111 100 111 100 60 L 100 0 L 75 0 L 75 60 C 80 90 20 90 25 60 L 25 0 L 0 0"},h)),o.a.createElement("rect",be({},h,{x:75,y:0,height:100,width:25})))};function gt(){return(gt=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var ot=function(h){return o.a.createElement("path",gt({d:"M 0 0 L 25 0 L 50 36 L 75 0 L 100 0 L 40 100 L 12 100 L 37 55 L 0 0"},h))};function xr(){return(xr=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Qe=function(h){return o.a.createElement("path",xr({},h,{d:"M 0 80 L 0 100 L 100 100 L 100 80 L 68 80 L 68 0 L 32 0 L 0 15 L 0 40 L 32 25 L 32 80 L 0 80"}))};function mt(){return(mt=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Vt=function(h){return o.a.createElement("path",mt({},h,{d:"M 0 25 C 20 -8 80 -8 100 25 C 100 90 30 50 20 85 L 100 85 L 100 100 L 0 100 L 0 70 C 10 40 75 70 75 25 C 70 10 30 10 25 28 L 0 25"}))};function qt(){return(qt=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var qn=function(h){return o.a.createElement("path",qt({},h,{d:"M 0 35 L 0 25 C 20 -8 80 -8 100 25 C 100 30 100 50 75 50 C 100 50 100 70 100 75 C 80 108 20 108 0 75 L 0 65 L 25 65 L 25 75 C 30 88 70 88 75 75 C 75 68 75 65 47 58 L 47 42 C 75 32 75 35 75 25 C 70 12 30 12 25 25 L 25 35"}))};function zl(){return(zl=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Wl=function(h){return o.a.createElement("path",zl({},h,{d:"M 50 0 L 0 50 L 0 70 L 50 70 L 50 100 L 75 100 L 75 70 L 100 70 L 100 50 L 75 50 L 75 0 L 50 15 L 50 50 L 30 50 L 75 0 L 50 0"}))};function Ql(){return(Ql=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Hl=function(h){return o.a.createElement("path",Ql({},h,{d:"M 95 20 L 100 0 L 10 0 L 0 60 L 25 60 C 30 45 90 50 75 77 C 66 87 30 90 26 72 L 0 80 C 20 110 80 110 100 70 C 100 25 10 25 25 40 L 30 20 L 95 20"}))};function Gl(){return(Gl=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Yl=function(h){return o.a.createElement("path",Gl({},h,{d:"M 50 0 C -40 70 10 100 50 100 C 90 100 100 80 100 55 C 80 30 30 30 35 50 L 30 60 C 80 50 80 85 50 80 C 10 80 48 10 90 0 L 50 0"}))};function Kl(){return(Kl=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Xl=function(h){return o.a.createElement("path",Kl({},h,{d:"M 0 0 L 100 0 L 50 100 L 20 100 L 60 20 L 0 20 L 0 0"}))};function Vo(){return(Vo=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Jl=function(h){return o.a.createElement("g",null,o.a.createElement("path",Vo({},h,{d:"M 0 35 L 0 25 C 20 -8 80 -8 100 25 C 100 30 100 50 75 50 C 100 50 100 70 100 75 C 80 108 20 108 0 75 L 0 65 L 25 65 L 25 75 C 30 88 70 88 75 75 C 75 68 75 65 47 58 L 47 42 C 75 32 75 35 75 25 C 70 12 30 12 25 25 L 25 35"})),o.a.createElement("path",Vo({},h,{d:"M 100 35 L 100 25 C 80 -8 20 -8 0 25 C 0 30 0 50 25 50 C 0 50 0 70 0 75 C 20 108 80 108 100 75 L 100 65 L 75 65 L 75 75 C 70 88 30 88 25 75 C 25 68 25 65 53 58 L 53 42 C 25 32 25 35 25 25 C 30 12 70 12 75 25 L 75 35"})))};function Zl(){return(Zl=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var ef=function(h){return o.a.createElement("path",Zl({},h,{d:"M 50 100 C 140 30 90 0 50 0 C 10 0 0 20 0 45 C 20 70 70 70 65 50 L 70 40 C 20 50 20 15 50 20 C 90 20 52 90 10 100 L 50 100"}))},qo=[{component:c,regex:"A",color:"red"},{component:l,regex:"B",color:"maroon"},{component:f,regex:"C",color:"blue"},{component:E,regex:"D",color:"green"},{component:T,regex:"E",color:"olive"},{component:_,regex:"F",color:"navy"},{component:C,regex:"G",color:"orange"},{component:P,regex:"H",color:"teal"},{component:j,regex:"I",color:"cadetblue"},{component:V,regex:"J",color:"lavender"},{component:Le,regex:"K",color:"chocolate"},{component:Oe,regex:"L",color:"coral"},{component:Pe,regex:"M",color:"darkolivegreen"},{component:$,regex:"N",color:"darkorange"},{component:N,regex:"O",color:"gold"},{component:X,regex:"P",color:"darkorchid"},{component:ee,regex:"Q",color:"darkslateblue"},{component:H,regex:"R",color:"firebrick"},{component:ie,regex:"S",color:"darkslategrey"},{component:le,regex:"T",color:"#228b22"},{component:I,regex:"U",color:"seagreen"},{component:ae,regex:"V",color:"indigo"},{component:oe,regex:"W",color:"mediumseagreen"},{component:He,regex:"X",color:"black"},{component:Ie,regex:"Y",color:"palevioletred"},{component:wt,regex:"Z",color:"peru"},{component:Ln,regex:"a",color:"red"},{component:dr,regex:"b",color:"maroon"},{component:f,regex:"c",color:"purple"},{component:Vi,regex:"d",color:"green"},{component:jt,regex:"e",color:"olive"},{component:$i,regex:"f",color:"navy"},{component:In,regex:"g",color:"orange"},{component:Bi,regex:"h",color:"teal"},{component:Nn,regex:"i",color:"cadetblue"},{component:Fn,regex:"j",color:"lavender"},{component:jn,regex:"k",color:"chocolate"},{component:k,regex:"l",color:"coral"},{component:z,regex:"m",color:"darkolivegreen"},{component:B,regex:"n",color:"darkorange"},{component:N,regex:"o",color:"gold"},{component:te,regex:"p",color:"darkorchid"},{component:qe,regex:"q",color:"darkslateblue"},{component:Ee,regex:"r",color:"firebrick"},{component:ie,regex:"s",color:"darkslategrey"},{component:Ye,regex:"t",color:"#228b22"},{component:Ke,regex:"u",color:"seagreen"},{component:ae,regex:"v",color:"indigo"},{component:oe,regex:"w",color:"mediumseagreen"},{component:He,regex:"x",color:"black"},{component:ot,regex:"y",color:"palevioletred"},{component:wt,regex:"z",color:"peru"},{component:N,regex:"0",color:"indianred"},{component:Qe,regex:"1",color:"red"},{component:Vt,regex:"2",color:"green"},{component:qn,regex:"3",color:"purple"},{component:Wl,regex:"4",color:"navy"},{component:Hl,regex:"5",color:"teal"},{component:Yl,regex:"6",color:"gold"},{component:Xl,regex:"7",color:"olive"},{component:Jl,regex:"8",color:"slate"},{component:ef,regex:"9",color:"firebrick"}],qy=o.a.forwardRef(function(h,g){var y=h.ppm,b=h.pfm,Q=h.scale,de=h.startpos,fe=h.mode;return o.a.createElement(Xr,{ppm:y,alphabet:qo,scale:Q,mode:fe,startpos:de,pfm:b,ref:g})});function zi(h){return function(g){if(Array.isArray(g)){for(var y=0,b=new Array(g.length);y<g.length;y++)b[y]=g[y];return b}}(h)||function(g){if(Symbol.iterator in Object(g)||Object.prototype.toString.call(g)==="[object Arguments]")return Array.from(g)}(h)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var $o,tf=function(h,g){for(var y=(""+h).length,b=h+1;b<h+g;++b)(""+b).length>y&&(y=(""+b).length);return y},rf=($o={},qo.forEach(function(h){$o[h.regex]=h}),$o),Uo=function(h){return h.map(function(g){if(g.regex.length===1)return Object.assign({},g,{component:rf[g.regex].component});for(var y=(g.color&&g.color.map&&g.color.length>=1?g.color[0]:g.color)||"#000000",b=Object.assign({},g,{component:[],color:g.color&&g.color.map&&g.color.length===g.regex.length?g.color:[]}),Q=0;Q<b.regex.length;++Q)b.component.push(rf[b.regex[Q]].component),b.color.length===Q&&b.color.push(y);return b})},nf=function(h){return h.map(function(g,y){return y}).sort(function(g,y){return h[g]<h[y]?-1:h[g]===h[y]?0:1})},Wi=function(h){return zi(Array(Math.floor(h)).keys())},$y=function(h){var g=0;return h.filter(function(y){return y>0}).forEach(function(y){g+=y}),g},Uy=function(h){return h.reduce(function(g,y){return[].concat(zi(g),zi(h.reduce(function(b,Q){return[].concat(zi(b),[{component:[y.component,Q.component],color:[y.color,Q.color],regex:y.regex+Q.regex}])},[])))},[])};function By(h){return function(g){if(Array.isArray(g)){for(var y=0,b=new Array(g.length);y<g.length;y++)b[y]=g[y];return b}}(h)||function(g){if(Symbol.iterator in Object(g)||Object.prototype.toString.call(g)==="[object Arguments]")return Array.from(g)}(h)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var af=function(h,g,y){for(var b=[],Q=Math.max.apply(Math,By(y.map(function(fe){return fe.length}))),de=0;de<Q;++de)b.push(h.map(function(fe){return 0}));return y.forEach(function(fe){for(var Se=0;Se<fe.length;++Se)++b[Se][g[fe[Se]]]}),{count:y.length,pfm:b}},zy=function(h,g){var y={},b=[];return h.forEach(function(Q,de){y[Q.regex]=de}),g.split(`
|
|
112
|
-
`).forEach(function(Q){Q[0]===">"?b.push(""):b[b.length-1]+=Q.trim()}),af(h,y,b)},
|
|
113
|
-
`).map(function(b){return b.trim()}))},of=function(h){var g=h.yscale,y=h.inverted,b=h.xscale,Q=h.children,de=g*(y?-1:1);return o.a.createElement("g",{transform:"scale("+b+","+de+")"},Q)};function Bo(){return(Bo=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var sf=function(h){var g=h.height,y=h.width,b=h.indices,Q=h.alphabet,de=h.lv,fe=h.transform,Se=h.alpha,tt=h.inverted,Xe=h.onSymbolMouseOver,rt=h.onSymbolMouseOut,st=h.onSymbolClick,Fe=g,ht=y/100;Se=Se||1;var ct=b.map(function(he){if(!Q[he]||!Q[he].component||de[he]===0)return null;Fe-=100*de[he];var $e=tt?Fe+100*de[he]:Fe;if(!Q[he].component.map){var dt=Q[he].component;return o.a.createElement("g",{transform:"translate(0,"+$e+")",key:he,onMouseOver:Xe&&function(){return Xe(Q[he])},onMouseOut:rt&&function(){return rt(Q[he])},onClick:st&&function(){return st(Q[he])}},o.a.createElement(of,{xscale:ht,yscale:de[he],inverted:tt},o.a.createElement(dt,Bo({fill:Q[he].color,fillOpacity:Se},Q[he]))))}var Lt=.8*ht/Q[he].component.length;return Q[he].color.map||(Q[he].color=Q[he].component.map(function(Gt){return Q[he].color})),Q[he].component.map(function(Gt,Yt){return o.a.createElement("g",{transform:"translate("+(Yt*y*.8/Q[he].component.length+.1*y)+","+$e+")",key:he+"_"+Yt,onMouseOver:Xe&&function(){return Xe(Q[he])},onMouseOut:rt&&function(){return rt(Q[he])},onClick:st&&function(){return st(Q[he])}},o.a.createElement(of,{xscale:Lt,yscale:de[he],inverted:tt},o.a.createElement(Gt,Bo({fill:Q[he].color[Yt],fillOpacity:Se},Q[he]))))})});return o.a.createElement("g",{transform:fe},ct)},cf=function(h){var g=h.n,y=h.transform,b=h.glyphWidth,Q=h.startpos,de=Wi(g);return o.a.createElement("g",{transform:y},o.a.createElement("g",{transform:"rotate(-90)"},de.map(function(fe){return o.a.createElement("text",{x:"0",y:b*(fe+.66),fontSize:"18",textAnchor:"end",key:fe},fe+Q)})))},Qy=function(h){var g=h.bits,y=h.transform,b=h.height,Q=h.width,de=h.zeroPoint,fe=Wi(g+1);return de===void 0&&(de=1),o.a.createElement("g",{transform:y},o.a.createElement("rect",{height:b,width:4,x:Q+1,y:0,fill:"#000000"}),fe.map(function(Se){return o.a.createElement("g",{key:Se,transform:"translate(0,"+(b*de-Math.floor(Se*(b*de)/g))+")"},o.a.createElement("text",{x:Q-15,textAnchor:"end",y:"4",fontSize:"18"},Se),o.a.createElement("rect",{x:Q-10,width:"15",height:"4",y:"-2",fill:"#000000"}))}),o.a.createElement("g",{transform:"rotate(-90)"},o.a.createElement("text",{y:"20",x:-b/2,textAnchor:"middle",fontSize:"18"},"bits")))},Hy=function(h){var g=h.ticks,y=h.transform,b=h.height,Q=h.width,de=Wi(g+1).map(function(fe){return fe/g});return o.a.createElement("g",{transform:y},o.a.createElement("rect",{height:b,width:4,x:Q+1,y:"0",fill:"#000000"}),de.map(function(fe){return o.a.createElement("g",{key:fe,transform:"translate(0,"+(b-Math.floor(fe*b))+")"},o.a.createElement("text",{x:Q-10,textAnchor:"end",y:"4",fontSize:"18"},(fe+"").substring(0,4)),o.a.createElement("rect",{x:Q-5,width:"10",height:"4",y:"-2",fill:"#000000"}))}),o.a.createElement("g",{transform:"rotate(-90)"},o.a.createElement("text",{y:"15",x:-b/2,textAnchor:"middle",fontSize:"18"},"frequency")))},uf=function(h){var g=h.minrange,y=h.maxrange,b=h.xstart,Q=h.width,de=h.height,fe=h.xaxis_y,Se=h.numberofgridlines,tt=h.stroke,Xe=function(he,$e){return function(dt){return $e[0]+($e[1]-$e[0])*((dt-he[0])/(he[1]-he[0]))}}([g,y],[b,Q]),rt=y-g,st=fe+de,Fe=Math.ceil(rt)/Se,ht=Math.ceil(rt/Fe),ct=Array.from(Array(ht).keys());return o.a.createElement("g",{stroke:tt},ct.map(function(he){var $e=g+Fe*he;return o.a.createElement("line",{key:he,x1:Xe($e),x2:Xe($e),y1:fe,y2:st})}),o.a.createElement("line",{x1:Xe(y),x2:Xe(y),y1:fe,y2:st}),";")};function lf(h){return function(g){if(Array.isArray(g)){for(var y=0,b=new Array(g.length);y<g.length;y++)b[y]=g[y];return b}}(h)||function(g){if(Symbol.iterator in Object(g)||Object.prototype.toString.call(g)==="[object Arguments]")return Array.from(g)}(h)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var zo=function(h){var g,y,b=h.values,Q=h.glyphWidth,de=h.stackHeight,fe=h.alphabet,Se=h.onSymbolMouseOver,tt=h.onSymbolMouseOut,Xe=h.onSymbolClick,rt=(g=Q,y=de,function(Fe,ht,ct,he,$e){var dt=nf(Fe),Lt=$e||{},Gt=Lt.onSymbolMouseOver,Yt=Lt.onSymbolMouseOut,Zr=Lt.onSymbolClick;return o.a.createElement(sf,{indices:dt,alphabet:he,onSymbolMouseOver:Gt?function(xt){return Gt(ct,xt)}:null,onSymbolClick:Zr?function(xt){return Zr(ct,xt)}:null,onSymbolMouseOut:Yt?function(xt){return Yt(ct,xt)}:null,lv:Fe,transform:ht,width:g,height:y,key:ct})});for(var st in fe)if(!st.component){fe=Uo(fe);break}return b.map(function(Fe,ht){return rt(Fe,"translate("+Q*ht+",0)",ht,fe,{onSymbolMouseOver:Se,onSymbolMouseOut:tt,onSymbolClick:Xe})})},Xr=o.a.forwardRef(function(h,g){var y=h.ppm,b=h.pfm,Q=h.values,de=h.fasta,fe=h.mode,Se=h.height,tt=h.width,Xe=h.alphabet,rt=h.glyphwidth,st=h.scale,Fe=h.startpos,ht=h.showGridLines,ct=h.backgroundFrequencies,he=h.constantPseudocount,$e=h.smallSampleCorrectionOff,dt=h.yAxisMax,Lt=h.onSymbolMouseOver,Gt=h.onSymbolMouseOut,Yt=h.onSymbolClick,Zr=h.noFastaNames,xt=h.countUnaligned,$t=null,Ut=!(!b&&!de||he||xt)&&!$e,en=Ut?0:(he||0)/Xe.length;if(!y&&!b&&de){var Of=(Zr?Wy:zy)(Xe,de.toUpperCase());b=Of.pfm,$t=Of.count||1}var km=Ut&&b&&b.map&&b.map(function(Ot){return Ot.reduce(function(Sr,Un,pr){return pr===void 0?Sr:Un+Sr},0)}).map(function(Ot){return Ot===0?0:(Xe.length-1)/(2*Math.log(2)*Ot)});if(!y&&b&&b.map&&(y=b.map(function(Ot,Sr){var Un=($t&&xt?$t:Ot.reduce(function(pr,Go){return pr+Go},0)+en*Xe.length)||1;return Ot.map(function(pr){return(pr+en)/Un})})),y.length===0||y[0].length===0)return o.a.createElement("div",null);var Wo=y[0].length;ct||(ct=y[0].map(function(Ot){return 1/Wo}));var $n=Q||(fe!=="FREQUENCY"?y.map(function(Ot,Sr){return function(Un){return function(pr,Go){var _f=0,Mm=Go||0;return pr.map(function(Bn,Hi){return _f+=Bn===0?0:Bn*Math.log2(Bn/(Un[Hi]||.01))}),pr.map(function(Bn){var Hi=Bn*(_f-Mm);return Hi<=0?0:Hi})}}(ct)(Ot,km[Sr])}):y.map(function(Ot){return Ot.map(function(Sr){return Sr*Math.log2(Wo)})})),Sf=fe==="FREQUENCY"?[Math.log2(Wo)]:ct.map(function(Ot){return Math.log2(1/(Ot||.01))}),Qi=dt||Math.max.apply(Math,lf(Sf)),Tf=Math.min.apply(Math,lf(Sf)),Dm=Tf<0?Qi/(Qi-Tf):1;Fe=!isNaN(parseFloat(Fe))&&isFinite(Fe)?Fe:1;var Or=100*Qi,Qo=Or/6*(rt||1),Ho=$n.length*Qo+80,Cf=Or+18*(tf(Fe,$n.length)+1);return st&&(Ho>Cf?tt=st:Se=st),o.a.createElement("svg",{width:tt,height:Se,viewBox:"0 0 "+Ho+" "+Cf,ref:g},ht&&o.a.createElement(uf,{minrange:Fe,maxrange:Fe+y.length,xstart:70,width:Ho,height:Or,xaxis_y:10,numberofgridlines:10*$n.length}),o.a.createElement(cf,{transform:"translate(80,"+(Or+20)+")",n:$n.length,glyphWidth:Qo,startpos:Fe}),fe==="FREQUENCY"?o.a.createElement(Hy,{transform:"translate(0,10)",width:65,height:Or,ticks:2}):o.a.createElement(Qy,{transform:"translate(0,10)",width:65,height:Or,bits:Qi,zeroPoint:Dm}),o.a.createElement("g",{transform:"translate(80,10)"},o.a.createElement(zo,{values:$n,glyphWidth:Qo,stackHeight:Or,alphabet:Xe,onSymbolMouseOver:Lt,onSymbolMouseOut:Gt,onSymbolClick:Yt})))}),Gy=function(h){var g=h.transform,y=h.min,b=h.max,Q=h.width,de=h.height,fe=[y,0,b];return o.a.createElement("g",{transform:g},o.a.createElement("rect",{height:de,width:4,x:Q+1,y:"0",fill:"#000000"}),fe.map(function(Se){return o.a.createElement("g",{key:Se,transform:"translate(0,"+(de-Se/b*de)/2+")"},o.a.createElement("text",{x:Q-10,textAnchor:"end",y:"4",fontSize:"18"},(Se+"").substring(0,4)),o.a.createElement("rect",{x:Q-5,width:"10",height:"4",y:"-2",fill:"#000000"}))}),o.a.createElement("g",{transform:"rotate(-90)"},o.a.createElement("text",{y:"15",x:-de/2,textAnchor:"middle",fontSize:"18"},"frequency")))};function ff(h){return function(g){if(Array.isArray(g)){for(var y=0,b=new Array(g.length);y<g.length;y++)b[y]=g[y];return b}}(h)||function(g){if(Symbol.iterator in Object(g)||Object.prototype.toString.call(g)==="[object Arguments]")return Array.from(g)}(h)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var hf=function(h,g,y,b){return function(Q,de,fe,Se,tt,Xe){var rt,st=tt?(rt=Q).map(function($e,dt){return dt}).sort(function($e,dt){return rt[$e]<rt[dt]?1:rt[$e]===rt[dt]?0:-1}):nf(Q),Fe=Xe||{},ht=Fe.onSymbolMouseOver,ct=Fe.onSymbolMouseOut,he=Fe.onSymbolClick;return o.a.createElement(sf,{indices:st,alphabet:Se,alpha:y,lv:Q,transform:de,width:h,height:g,onSymbolMouseOver:ht?function($e){return ht(fe,$e)}:null,onSymbolClick:he?function($e){return he(fe,$e)}:null,onSymbolMouseOut:ct?function($e){return ct(fe,$e)}:null,key:fe,inverted:b})}},df=o.a.forwardRef(function(h,g){var y=h.values,b=h.height,Q=h.width,de=h.alphabet,fe=h.scale,Se=h.startpos,tt=h.negativealpha,Xe=h.showGridLines,rt=h.inverted,st=h.onSymbolMouseOver,Fe=h.onSymbolMouseOut,ht=h.onSymbolClick;if(y.length===0||y[0].length===0)return o.a.createElement("div",null);y[0].length;for(var ct in de)if(!ct.component){de=Uo(de);break}Se=Se??1,tt=(tt=tt<0?0:tt)>255?255:tt;var he=y.map($y),$e=y.map(function(xt){return-function($t){var Ut=0;return $t.filter(function(en){return en<0}).forEach(function(en){Ut+=en}),Ut}(xt)}),dt=Math.max.apply(Math,ff(he).concat(ff($e))),Lt=y.length*(200/6)+80,Gt=200+18*(tf(Se,y.length)+1),Yt=hf(200/6,200/2.05),Zr=hf(200/6,-200/2.05,tt/255,rt);return fe&&(Lt>Gt?Q=fe:b=fe),o.a.createElement("svg",{ref:g,width:Q,height:b,viewBox:"0 0 "+Lt+" "+Gt},Xe&&o.a.createElement(uf,{minrange:Se,maxrange:Se+y.length,xstart:70,width:Lt,height:200,xaxis_y:10,numberofgridlines:10*y.length}),o.a.createElement(cf,{transform:"translate(80,220)",n:y.length,glyphWidth:200/6,startpos:Se}),o.a.createElement(Gy,{transform:"translate(0,10)",width:65,height:200,min:-dt,max:dt}),o.a.createElement("line",{style:{fill:"none",stroke:"#000000",strokeWidth:2,strokeLinecap:"butt",strokeLinejoin:"miter",strokeOpacity:1,strokeMiterlimit:4,strokeDasharray:"0.53,1.59",strokeDashoffset:0},transform:"translate(80,111)",x1:0,x2:Lt-80}),o.a.createElement("g",{transform:"translate(80,10)"},y.map(function(xt,$t){return Yt(xt.map(function(Ut){return Ut>0?Ut/dt:0}),"translate("+200/6*$t+",0)",$t,de,!1,{onSymbolMouseOver:st,onSymbolMouseOut:Fe,onSymbolClick:ht})}),y.map(function(xt,$t){return Zr(xt.map(function(Ut){return Ut<0?Ut/dt:0}),"translate("+200/6*$t+",200)",$t,de,!0,{onSymbolMouseOver:st,onSymbolMouseOut:Fe,onSymbolClick:ht})})))});function pf(){return(pf=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var gf=[{component:c,regex:"A",color:"black"},{component:l,regex:"B",color:"#bb8800"},{component:f,regex:"C",color:"#008811"},{component:E,regex:"D",color:"#ff0000"},{component:T,regex:"E",color:"#ff0022"},{component:_,regex:"F",color:"#333333"},{component:C,regex:"G",color:"#007700"},{component:P,regex:"H",color:"#220099"},{component:j,regex:"I",color:"#111111"},{component:Le,regex:"K",color:"#0000aa"},{component:Oe,regex:"L",color:"#002222"},{component:Pe,regex:"M",color:"#220022"},{component:$,regex:"N",color:"#009911"},{component:X,regex:"P",color:"#080808"},{component:ee,regex:"Q",color:"#00aa00"},{component:H,regex:"R",color:"#0022aa"},{component:ie,regex:"S",color:"#008f00"},{component:le,regex:"T",color:"#006600"},{component:ae,regex:"V",color:"#222200"},{component:oe,regex:"W",color:"#080808"},{component:Ie,regex:"Y",color:"#00a800"},{component:wt,regex:"Z",color:"#aaaa00"}],vf=o.a.forwardRef(function(h,g){return o.a.createElement(Xr,pf({alphabet:gf},h,{ref:g}))});function yf(){return(yf=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var mf=[{component:c,regex:"A",color:"red"},{component:f,regex:"C",color:"blue"},{component:C,regex:"G",color:"orange"},{component:le,regex:"T",color:"#228b22"}],bf=o.a.forwardRef(function(h,g){return o.a.createElement(Xr,yf({alphabet:mf},h,{ref:g}))});function Ef(){return(Ef=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var wf=[{component:c,regex:"A",color:"red"},{component:f,regex:"C",color:"blue"},{component:C,regex:"G",color:"orange"},{component:I,regex:"U",color:"seagreen"}],xf=o.a.forwardRef(function(h,g){return o.a.createElement(Xr,Ef({alphabet:wf},h,{ref:g}))}),Jr=i(1),Yy=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(bf,g))},Ky=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(xf,g))},Xy=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(vf,g))},Jy=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(Xr,g))},Zy=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(zo,g))},em=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(df,g))};i.d(n,"LC_a",function(){return tm}),i.d(n,"LC_b",function(){return rm}),i.d(n,"LC_c",function(){return nm}),i.d(n,"LC_d",function(){return im}),i.d(n,"LC_e",function(){return am}),i.d(n,"LC_f",function(){return om}),i.d(n,"LC_g",function(){return sm}),i.d(n,"LC_h",function(){return cm}),i.d(n,"LC_i",function(){return um}),i.d(n,"LC_j",function(){return lm}),i.d(n,"LC_k",function(){return fm}),i.d(n,"LC_l",function(){return hm}),i.d(n,"LC_m",function(){return dm}),i.d(n,"LC_n",function(){return pm}),i.d(n,"LC_o",function(){return gm}),i.d(n,"LC_p",function(){return vm}),i.d(n,"LC_q",function(){return ym}),i.d(n,"LC_r",function(){return mm}),i.d(n,"LC_s",function(){return bm}),i.d(n,"LC_t",function(){return Em}),i.d(n,"LC_u",function(){return wm}),i.d(n,"LC_v",function(){return xm}),i.d(n,"LC_w",function(){return Om}),i.d(n,"LC_x",function(){return Sm}),i.d(n,"LC_y",function(){return Tm}),i.d(n,"LC_z",function(){return Cm}),i.d(n,"N0",function(){return _m}),i.d(n,"Logo",function(){return Xr}),i.d(n,"ProteinLogo",function(){return vf}),i.d(n,"DNALogo",function(){return bf}),i.d(n,"RNALogo",function(){return xf}),i.d(n,"ProteinAlphabet",function(){return gf}),i.d(n,"DNAAlphabet",function(){return mf}),i.d(n,"RNAAlphabet",function(){return wf}),i.d(n,"CompleteLogo",function(){return qy}),i.d(n,"CompleteAlphabet",function(){return qo}),i.d(n,"INFORMATION_CONTENT",function(){return"INFORMATION_CONTENT"}),i.d(n,"FREQUENCY",function(){return"FREQUENCY"}),i.d(n,"xrange",function(){return Wi}),i.d(n,"LogoWithNegatives",function(){return df}),i.d(n,"embedDNALogo",function(){return Yy}),i.d(n,"disymbolAlphabet",function(){return Uy}),i.d(n,"RawLogo",function(){return zo}),i.d(n,"embedRNALogo",function(){return Ky}),i.d(n,"embedLogoWithNegatives",function(){return em}),i.d(n,"embedProteinLogo",function(){return Xy}),i.d(n,"embedLogo",function(){return Jy}),i.d(n,"embedRawLogo",function(){return Zy}),i.d(n,"loadGlyphComponents",function(){return Uo}),i.d(n,"A",function(){return c}),i.d(n,"B",function(){return l}),i.d(n,"C",function(){return f}),i.d(n,"D",function(){return E}),i.d(n,"E",function(){return T}),i.d(n,"F",function(){return _}),i.d(n,"G",function(){return C}),i.d(n,"H",function(){return P}),i.d(n,"I",function(){return j}),i.d(n,"J",function(){return V}),i.d(n,"K",function(){return Le}),i.d(n,"L",function(){return Oe}),i.d(n,"M",function(){return Pe}),i.d(n,"N",function(){return $}),i.d(n,"O",function(){return N}),i.d(n,"P",function(){return X}),i.d(n,"Q",function(){return ee}),i.d(n,"R",function(){return H}),i.d(n,"S",function(){return ie}),i.d(n,"T",function(){return le}),i.d(n,"U",function(){return I}),i.d(n,"V",function(){return ae}),i.d(n,"W",function(){return oe}),i.d(n,"X",function(){return He}),i.d(n,"Y",function(){return Ie}),i.d(n,"Z",function(){return wt}),i.d(n,"N1",function(){return Qe}),i.d(n,"N2",function(){return Vt}),i.d(n,"N3",function(){return qn}),i.d(n,"N4",function(){return Wl}),i.d(n,"N5",function(){return Hl}),i.d(n,"N6",function(){return Yl}),i.d(n,"N7",function(){return Xl}),i.d(n,"N8",function(){return Jl}),i.d(n,"N9",function(){return ef});var tm=Ln,rm=dr,nm=f,im=Vi,am=jt,om=$i,sm=In,cm=Bi,um=Nn,lm=Fn,fm=jn,hm=k,dm=z,pm=B,gm=N,vm=te,ym=qe,mm=Ee,bm=ie,Em=Ye,wm=Ke,xm=ae,Om=oe,Sm=He,Tm=ot,Cm=wt,_m=N}])})})(Us);var _d=Us.exports,Mr=_d;const Bs=new Map([["A",Mr.A],["C",Mr.C],["G",Mr.G],["T",Mr.T]]),kd=new Map([["A","#008800"],["C","#000088"],["G","#a89132"],["T","#880000"]]),Dd=e=>{const[t,r,n]=w.useMemo(()=>e.transform(e.importance),[e.transform,e.importance]);return Bs.get(e.base)?p.jsxs(p.Fragment,{children:[p.jsx("rect",{fill:"#000000",fillOpacity:0,y:0,x:e.x,width:e.totalWidth,height:e.totalHeight,onMouseOver:e.onMouseOver,onMouseOut:e.onMouseOut,onMouseDown:e.onClick,onMouseUp:e.onMouseUp}),p.jsx("g",{transform:`${n} translate(${e.x},${t}) scale(${e.xScale},${r})`,children:w.createElement(Bs.get(e.base),{fill:kd.get(e.base)})})]}):null};function Md(e){return e.sequence!==void 0}const Ld=e=>{const[t,r,n]=Td(e.data,e.height),i=Cd(e.annotations||[],t,n),[a]=w.useState(null),o=w.useMemo(()=>e.width/t.length/100,[e.width,t.length]),s=w.useMemo(()=>r(0)[0],[r]),c=w.useMemo(()=>i.map((d,f)=>{const v=100*o*Math.abs(d.coordinates[1]-d.coordinates[0]),E=Math.min(...d.coordinates)*o*100,x=d.y+d.height,T=80;return p.jsxs(w.Fragment,{children:[p.jsx("rect",{fill:d.color,fillOpacity:.4,x:E,width:v,height:d.height,y:d.y}),p.jsx("path",{fill:d.color,fillOpacity:.4,d:`M ${E} ${x} L ${E-v} ${x+T} L ${E-v} ${x+d.height*3} L ${E+v*2} ${x+d.height*3} L ${E+v*2} ${x+T} L ${E+v} ${x} L ${E} ${x}`}),p.jsx("g",{transform:`translate(${E-v},${x+T})`,children:d.children})]},f)}),[i,o]),u=w.useMemo(()=>t.map((d,f)=>d.importance?p.jsx(Dd,{totalWidth:o*100,totalHeight:e.height,x:f*o*100,xScale:o,transform:r,onMouseOut:e.onBaseMousedOut,...d},f):null),[t,o,e.height,r,e.onBaseMousedOut]),l=w.useMemo(()=>t.filter(d=>d.importance).length>0?p.jsx("line",{stroke:"#ff0000",strokeWidth:1,...e.zeroLineProps,x1:0,x2:e.width,y1:s,y2:s}):p.jsx("text",{x:0,y:e.height/2,children:"No importance track data"}),[t,e.width,e.height,s,e.zeroLineProps]);return p.jsx(Dt,{canDrag:!0,children:p.jsxs("g",{children:[a!==null&&p.jsx("rect",{fill:"#93ceed",fillOpacity:.4,x:Math.min(...a)*o*100,width:100*o*Math.abs(a[1]-a[0]),height:e.height}),c,u,l]})})},zs={titleSize:12,trackMargin:12,canDrag:!0};function Ws(e){const t=e.data?{loading:!1}:{loading:!0},r={...e,trackType:G.IMPORTANCE,displayMode:e.displayMode};return p.jsx(et,{...r,...t,trackType:G.BIGWIG,displayMode:e.displayMode,children:p.jsx(Ld,{...e})})}function Qs(e,t,r){const n=[],i=e.sort((a,o)=>a.start-o.start);return i.forEach((a,o)=>{var l;let s=0,c=a.pwm&&a.pwm.length||0;s=a.start<r.start?r.start-a.start:0,c=a.end>r.end?r.end-a.start:c;const u=a.pwm?(l=a.pwm)==null?void 0:l.slice(s,c):void 0;o===0||a.start>i[o-1].end?n.push({start:t(a.start)<0?0:t(a.start),end:t(a.end)<0?0:t(a.end),pwm:u}):n[n.length-1].end=t(a.end)}),n}function Hs(e,t,r){return nn(e.sort((n,i)=>n.start-i.start).map(n=>({coordinates:{start:n.start,end:n.end},pwm:n.pwm,name:""})),t,0).map(n=>n.map(i=>{var c;let a=0,o=i.pwm&&i.pwm.length||0;a=i.coordinates.start<r.start?r.start-i.coordinates.start:0,o=i.coordinates.end>r.end?r.end-i.coordinates.start:o;const s=i.pwm?(c=i.pwm)==null?void 0:c.slice(a,o):void 0;return{start:t(i.coordinates.start)<0?0:t(i.coordinates.start),end:t(i.coordinates.end),pwm:s}}))}const Id=e=>{const t=w.useContext(Kt),r=(l,d)=>{if(e.svgRef){const f=rr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-d.pwm.length*20?f[0]-d.pwm.length*20+10:f[0]+10,y:f[1],width:d.pwm.length*20,height:150,content:p.jsx("div",{style:{boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.2)",paddingRight:"15px",paddingTop:"10px",paddingLeft:"5px",position:"relative",width:d.pwm.length*20,height:150,backgroundColor:"white"},children:p.jsx(Mr.DNALogo,{ppm:d.pwm,mode:"INFORMATION_CONTENT",width:d.pwm.length*20,height:150})})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=w.useRef(Nt()),a=w.useCallback(Ct(e.domain,e.width),[e.data]),o=w.useMemo(()=>Hs(e.data,a,e.domain),[e.data,e.domain,e.width]),s=w.useMemo(()=>Hs(e.peaks||[],a,e.domain),[e.peaks,e.domain,e.width]),c=Math.max(e.rowHeight*o.length,35),u=e.id||i.current.toString();return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(c)},[o,e.rowHeight,e.onHeightChanged]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:c,clipPath:`url(#${u})`,children:[p.jsx("rect",{width:e.width,height:c,fill:"white"}),p.jsx("defs",{children:p.jsx(Wt,{id:u,width:e.width,height:c})}),s.map((l,d)=>p.jsx("g",{transform:`translate(0, ${d*e.rowHeight})`,children:l.map((f,v)=>p.jsx("rect",{height:e.rowHeight*.6,width:f.end-f.start<1?1:f.end-f.start,x:f.start,y:e.rowHeight*.2,fill:e.peakColor||"#3287a8",style:{cursor:"pointer"}},`${u}_peak_${d}_${v}`))},`group_peak_${d}`)),o.map((l,d)=>p.jsx("g",{transform:`translate(0, ${d*e.rowHeight})`,children:l.map((f,v)=>p.jsx("rect",{height:e.rowHeight*.6,width:f.end-f.start<1?1:f.end-f.start,x:f.start,y:e.rowHeight*.2,fill:e.color||"#000088",style:{cursor:"pointer"},onMouseOut:n,onMouseOver:E=>{E.persist(),f.pwm&&r(E,f)}},`${u}_${d}_${v}`))},`group_${d}`))]})})},Pd=e=>{const t=w.useContext(Kt),r=(l,d)=>{if(e.svgRef){const f=rr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-d.pwm.length*20?f[0]-d.pwm.length*20+10:f[0]+10,y:f[1],width:d.pwm.length*20,height:150,content:p.jsx("div",{style:{boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.2)",paddingRight:"15px",paddingTop:"10px",paddingLeft:"5px",position:"relative",width:d.pwm.length*20,height:150,backgroundColor:"white"},children:p.jsx(Mr.DNALogo,{ppm:d.pwm,mode:"INFORMATION_CONTENT",width:d.pwm.length*20,height:150})})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=w.useRef(Nt()),a=w.useCallback(Ct(e.domain,e.width),[e.data]),o=e.id||i.current.toString(),s=w.useMemo(()=>Qs(e.data,a,e.domain),[e.domain,e.width,e.data]),c=w.useMemo(()=>Qs(e.peaks||[],a,e.domain),[e.domain,e.width,e.peaks]);w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]);const u=Math.max(e.height,35);return p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:u,clipPath:`url(#${o})`,children:[p.jsx("rect",{width:e.width,height:u,fill:"white"}),p.jsx("defs",{children:p.jsx(Wt,{id:o,width:e.width,height:u})}),c.map((l,d)=>p.jsx("rect",{height:u*.6,width:l.end-l.start,x:l.start,y:u*.2,fill:e.peakColor||"#3287a8",style:{cursor:"pointer"}},`${o}_peak_${d}`)),s.map((l,d)=>p.jsx("rect",{height:u*.6,width:l.end-l.start,x:l.start,y:u*.2,fill:e.color||"#000088",style:{cursor:"pointer"},onMouseOut:n,onMouseOver:f=>{f.persist(),l.pwm&&r(f,l)}},`${o}_${d}`))]})})},Gs={trackType:G.MOTIF,titleSize:12,trackMargin:12,height:50,displayMode:Re.SQUISH,canDrag:!0};function Ys(e){const t=e.data||e.peaks?{loading:!1}:{loading:!0},r={...e,trackType:G.MOTIF,displayMode:e.displayMode};switch(e.displayMode){case Re.SQUISH:return p.jsx(et,{...r,...t,trackType:G.MOTIF,displayMode:e.displayMode,children:p.jsx(Id,{...e})});case Re.DENSE:return p.jsx(et,{...r,...t,trackType:G.MOTIF,displayMode:e.displayMode,children:p.jsx(Pd,{...e})});case Re.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(et,{...r,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}const Nd=[{text:"African",value:"AFRICAN"},{text:"Native American",value:"AMERICAN"},{text:"East Asian",value:"EAST_ASIAN"},{text:"European",value:"EUROPEAN"},{text:"South Asian",value:"SOUTH_ASIAN"}],Ad=new Map([["AFRICAN",[null,{text:"Gambian",value:"GAMBIAN"},{text:"Mende",value:"MENDE"},{text:"Easn",value:"ESAN"},{text:"African American",value:"AFRICAN_AMERICAN"},{text:"African Caribbean",value:"AFRICAN_CARIBBEAN"}]],["AMERICAN",[null,{text:"Mexican",value:"MEXICAN"},{text:"Puerto Rican",value:"PUERTO_RICAN"},{text:"Colombian",value:"COLOMBIAN"},{text:"Peruvian",value:"PERUVIAN"}]],["EAST_ASIAN",[null,{text:"Han Chinese from Beijing",value:"HAN_CHINESE_BEIJING"},{text:"Japanese",value:"JAPANESE"},{text:"Dai",value:"DAI"},{text:"Kinh",value:"KINH"},{text:"Southern Han Chinese",value:"SOUTHERN_HAN_CHINESE"}]],["EUROPEAN",[null,{text:"Iberian",value:"IBERIAN"},{text:"British",value:"BRITISH"},{text:"Finnish",value:"FINNISH"},{text:"Toscani",value:"TOSCANI"},{text:"Utah resident northwest European",value:"UTAH_RESIDENT_NW_EUROPEAN"}]],["SOUTH_ASIAN",[null,{text:"Gujarati",value:"GUJARATI"},{text:"Punjabi",value:"PUNJABI"},{text:"Bengali",value:"BENGALI"},{text:"Sri Lankan Tamil",value:"SRI_LANKAN_TAMIL"},{text:"Indian Telugu",value:"INDIAN_TELUGU"}]]]),Ks=Nd.flatMap(e=>(Ad.get(e.value)??[]).filter(r=>r!==null).map(r=>({population:e.value,subpopulation:r.value})));function Fd(e,t,r,n,i){const a=new Map,o=[];return e.sort((s,c)=>s.domain.start-c.domain.start).forEach(s=>{const c=t.has(s.id),u=c?2:1,l=r(s.domain.start),d=r(s.domain.end)-l<u?l+u:r(s.domain.end),f=o[o.length-1]&&o[o.length-1].domain.end;a.set(s.id,(d+l)/2),f&&f>l?(o[o.length-1].domain.end=d,c&&(o[o.length-1].taller=!0,o[o.length-1].color=n)):o.push({...s,domain:{start:l,end:d},color:c?n:i,taller:c})}),{snps:o,coords:a}}function Rd(e,t,r,n,i,a){const o=e.get(t),s=u=>n((u.coordinates.start+u.coordinates.end)/2),c=Xh({start:i,end:1},{start:Ts("0000ED"),end:Ts("000000")});return o===void 0?[]:r.filter(u=>u.rSquared>i).map(u=>({d:`M ${o} ${a*.7} Q ${(o+s(u))/2} 0 ${s(u)} ${a*.7}`,stroke:`#FF${$h(Math.floor(c(u.rSquared)))}00`}))}const jd=e=>{var T,S,_;const[t,r]=w.useState(e.anchor),n=w.useContext(Kt),i=(m,C)=>{if(r(C.id),e.svgRef){const O=rr(e.svgRef.current,m);n.setTooltip({show:!0,x:O[0]>e.width-120?O[0]-120+15:O[0]+15,y:O[1]+10,width:120,height:50,content:p.jsx("span",{style:{fontSize:"10px"},children:C.id})})}e.onVariantMouseOver&&e.onVariantMouseOver(C)},a=()=>{n.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},o=w.useRef(Nt()),s=w.useCallback(Ct(e.domain,e.width),[(T=e.data)==null?void 0:T.snps]),c=e.color||"#000000",u=e.ldThreshold||.7,l=e.highlightColor||"#ff0000",d=e.highlighted||new Set,f=w.useMemo(()=>Fd(e.data.snps,d,s,l,c),[e.domain,e.width,e.data.snps,e.highlighted,l,c]),v=e.data.ld&&w.useMemo(()=>Rd(f.coords,t||"",e.data.ld.filter(m=>m.coordinates),s,u,e.height),[f,e.height,t,e.data.ld,e.domain,e.ldThreshold]);w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]);const E=t&&f.snps.find(m=>m.id===t),x=f.snps.find(m=>m.id===t);return w.useMemo(()=>p.jsxs(Dt,{canDrag:e.canDrag||!1,children:[p.jsx("rect",{width:e.width,height:e.height,fill:"white",onMouseOut:a}),p.jsxs("g",{className:e.className,width:e.width,height:e.height,clipPath:`url(#${o.current})`,children:[p.jsx("defs",{children:p.jsx(Wt,{id:o.current,width:e.width,height:e.height})}),E&&(v==null?void 0:v.length)===0&&p.jsx("text",{fill:"#ff0000",fontSize:10,x:e.width/2-150,y:20,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:`There are no SNPs in LD (r-squared > ${u}) with ${t} in ${e.id} track`}),E&&p.jsx("rect",{height:e.height*(x.taller?1:.6)*(t?.25:.6),width:1,x:x.domain.end,y:e.height-e.height*(x.taller?1:.6)*(t?.25:.6),fill:"#0000ff"},`${t}`),f.snps.map((m,C)=>{const O=e.height*(m.taller?1:.6)*(t?.25:.6);return p.jsx("rect",{style:{cursor:"pointer"},height:O,width:m.domain.end-m.domain.start,x:m.domain.start,y:e.height-O,fill:m.color,onMouseOver:P=>i(P,m),onMouseOut:()=>{a(),e.onVariantMouseOut&&e.onVariantMouseOut(m)},onClick:()=>e.onVariantClick&&e.onVariantClick(m)},`${e.id}_${C}`)}),v&&v.map((m,C)=>p.jsx("path",{d:m.d,stroke:m.stroke,fill:"none",strokeWidth:2},`${e.id}_path_${C}`))]})]}),[c,(S=e.data)==null?void 0:S.snps,e.ldThreshold,e.highlighted,e.highlightColor,(_=e.data)==null?void 0:_.ld,e.domain,e.height,e.width,e.id])};var ma=function(e,t){return ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},ma(e,t)};function Qt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ma(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var D=function(){return D=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},D.apply(this,arguments)};function At(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function nr(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{u(n.next(l))}catch(d){o(d)}}function c(l){try{u(n.throw(l))}catch(d){o(d)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}function ir(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.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(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=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 r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Et(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ba="Invariant Violation",Xs=Object.setPrototypeOf,Vd=Xs===void 0?function(e,t){return e.__proto__=t,e}:Xs,Js=function(e){Qt(t,e);function t(r){r===void 0&&(r=ba);var n=e.call(this,typeof r=="number"?ba+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=ba,Vd(n,t.prototype),n}return t}(Error);function yr(e,t){if(!e)throw new Js(t)}var Zs=["debug","log","warn","error","silent"],qd=Zs.indexOf("log");function ri(e){return function(){if(Zs.indexOf(e)>=qd){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=ri("debug"),e.log=ri("log"),e.warn=ri("warn"),e.error=ri("error")})(yr||(yr={}));var Ea="3.11.10";function Ft(e){try{return e()}catch{}}const wa=Ft(function(){return globalThis})||Ft(function(){return window})||Ft(function(){return self})||Ft(function(){return global})||Ft(function(){return Ft.constructor("return this")()});var ec=new Map;function xa(e){var t=ec.get(e)||1;return ec.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function tc(e,t){t===void 0&&(t=0);var r=xa("stringifyForDisplay");return JSON.stringify(e,function(n,i){return i===void 0?r:i},t).split(JSON.stringify(r)).join("<undefined>")}function ni(e){return function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(typeof t=="number"){var i=t;t=Oa(i),t||(t=Sa(i,r),r=[])}e.apply(void 0,[t].concat(r))}}var ne=Object.assign(function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];t||yr(t,Oa(r,n)||Sa(r,n))},{debug:ni(yr.debug),log:ni(yr.log),warn:ni(yr.warn),error:ni(yr.error)});function yt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new Js(Oa(e,t)||Sa(e,t))}var rc=Symbol.for("ApolloErrorMessageHandler_"+Ea);function nc(e){if(typeof e=="string")return e;try{return tc(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function Oa(e,t){if(t===void 0&&(t=[]),!!e)return wa[rc]&&wa[rc](e,t.map(nc))}function Sa(e,t){if(t===void 0&&(t=[]),!!e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Ea,message:e,args:t.map(nc)})))}function ii(e,t){if(!!!e)throw new Error(t)}function $d(e){return typeof e=="object"&&e!==null}function Ud(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const Bd=/\r\n|[\n\r]/g;function Ta(e,t){let r=0,n=1;for(const i of e.body.matchAll(Bd)){if(typeof i.index=="number"||Ud(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function zd(e){return ic(e.source,Ta(e.source,e.start))}function ic(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?r:0,c=t.column+s,u=`${e.name}:${o}:${c}
|
|
111
|
+
L 0 0`}))};function kt(){return(kt=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Ln=function(h){return o.a.createElement("g",null,o.a.createElement("path",kt({d:"M 10 20 C 5 -5 95 -10 100 35 L 100 100 L 80 100 L 80 90 C 90 105 10 105 0 80 C 0 45 40 40 60 45 L 80 50 C 95 30 40 5 10 35"},h)),o.a.createElement("path",{fill:"#ffffff",d:"M 77 70 C 70 90 30 90 22 80 C 10 50 80 60 77 70"}))};function Ri(){return(Ri=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var hr=function(h){return o.a.createElement("g",null,o.a.createElement("path",Ri({d:"M 20 0 L 0 0 L 0 100 L 20 100 L 20 80 C 10 110 90 110 100 70 L 100 60 C 90 10 10 10 20 40 L 20 40 L 20 0"},h)),o.a.createElement("path",{d:"M 79 60 C 80 95 20 95 20 65 C 20 30 80 30 79 65",fill:"#ffffff"}))};function ji(){return(ji=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Vi=function(h){return o.a.createElement("g",null,o.a.createElement("path",ji({d:"M 80 0 L 100 0 L 100 100 L 80 100 L 80 80 C 90 110 10 110 0 70 L 0 60 C 10 10 90 10 80 40 L 80 40 L 80 0"},h)),o.a.createElement("path",{d:"M 79 60 C 80 95 20 95 20 65 C 20 30 80 30 79 65",fill:"#ffffff"}))};function qi(){return(qi=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var jt=function(h){return o.a.createElement("g",null,o.a.createElement("path",qi({d:"M 25 50 L 100 50 C 85 -17 15 -17 0 50 C 0 75 25 100 50 100 L 95 100 L 95 80 L 50 80 Q 25 70 25 50"},h)),o.a.createElement("path",{d:"M 33 37 L 68 37 C 58 10 42 10 33 37",fill:"#ffffff"}))};function Yr(){return(Yr=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var $i=function(h){return o.a.createElement("path",Yr({d:"M 95 32 C 80 -17 20 -5 20 37 L 7 37 L 7 50 L 20 50 L 20 100 L 45 100 L 45 50 L 57 50 L 57 37 L 45 37 C 45 10 70 10 75 32 L 95 32"},h))};function Ui(){return(Ui=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var In=function(h){return o.a.createElement("g",null,o.a.createElement("path",Ui({d:"M 100 15 L 100 0 L 80 0 L 80 15 C 85 -8 15 -8 0 25 C 2 75 80 75 80 50 L 75 65 C 65 85 45 85 10 75 L 10 90 C 25 110 85 110 100 75 L 100 25"},h)),o.a.createElement("path",{d:"M 67 30 C 70 10 25 10 27 30 C 25 50 70 50 67 30",fill:"#ffffff"}))};function Kr(){return(Kr=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Bi=function(h){return o.a.createElement("path",Kr({d:"M 0 0 L 0 100 L 20 100 L 20 80 C 20 40 80 40 80 80 L 80 100 L 100 100 L 100 50 C 80 20 20 20 20 45 L 20 0 L 0 0"},h))};function Pn(){return(Pn=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Nn=function(h){return o.a.createElement("g",null,o.a.createElement("rect",Pn({},h,{x:40,y:20,width:20,height:80})),o.a.createElement("rect",Pn({},h,{x:40,y:0,width:20,height:15})))};function An(){return(An=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Fn=function(h){return o.a.createElement("g",null,o.a.createElement("path",An({d:"M 0 60 C 0 115 100 115 100 60 L 100 20 L 80 20 L 80 60 C 80 90 20 90 25 60"},h)),o.a.createElement("rect",An({x:80,width:20,height:15},h)))};function Rn(){return(Rn=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var jn=function(h){return o.a.createElement("path",Rn({d:"M 0 0 L 20 0 L 20 60 L 75 30 L 100 30 L 50 65 L 100 100 L 75 100 L 27 80 L 20 85 L 20 100 L 0 100 L 0 0"},h))};function Vn(){return(Vn=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var k=function(h){return o.a.createElement("rect",Vn({x:40,y:0,width:20,height:100},h))};function M(){return(M=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var H=function(h){return o.a.createElement("path",M({d:"M 0 0 L 0 100 L 20 100 L 20 60 C 20 20 40 20 40 50 L 40 100 L 60 100 L 60 50 C 60 20 80 20 80 50 L 80 100 L 100 100 L 100 50 C 100 -10 40 -10 50 50 C 50 -5 20 -5 20 20 L 20 0 L 0 0"},h))};function q(){return(q=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var B=function(h){return o.a.createElement("path",q({d:"M 0 0 L 0 100 L 20 100 L 20 60 C 20 0 80 0 80 50 L 80 100 L 100 100 L 100 25 C 80 -10 20 -10 20 20 L 20 0 L 0 0"},h))};function z(){return(z=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var te=function(h){return o.a.createElement("g",null,o.a.createElement("path",z({d:"M 20 100 L 0 100 L 0 0 L 20 0 L 20 20 C 10 -10 90 -10 100 30 L 100 40 C 90 90 10 90 20 60 L 20 60 L 20 100"},h)),o.a.createElement("path",{d:"M 79 40 C 80 5 20 5 20 35 C 20 70 80 70 79 35",fill:"#ffffff"}))};function re(){return(re=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var qe=function(h){return o.a.createElement("g",null,o.a.createElement("path",re({d:"M 80 100 L 100 100 L 100 0 L 80 0 L 80 20 C 90 -10 10 -10 0 30 L 0 40 C 10 90 90 90 80 60 L 80 60 L 80 100"},h)),o.a.createElement("path",{d:"M 79 40 C 80 5 20 5 20 35 C 20 70 80 70 79 35",fill:"#ffffff"}))};function Ge(){return(Ge=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Ee=function(h){return o.a.createElement("path",Ge({d:"M 0 0 L 0 100 L 20 100 L 20 60 C 20 0 80 0 80 50 L 100 50 L 100 25 C 80 -10 20 -10 20 20 L 20 0 L 0 0"},h))};function at(){return(at=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Ye=function(h){return o.a.createElement("path",at({d:"M 95 68 C 80 117 20 105 20 63 L 20 47 L 7 47 L 7 27 L 20 27 L 20 0 L 45 0 L 45 27 L 57 27 L 57 47 L 45 47 L 45 63 C 45 90 70 90 75 68 L 95 68"},h))};function be(){return(be=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Ke=function(h){return o.a.createElement("g",null,o.a.createElement("path",be({d:"M 0 0 L 0 60 C 0 111 100 111 100 60 L 100 0 L 75 0 L 75 60 C 80 90 20 90 25 60 L 25 0 L 0 0"},h)),o.a.createElement("rect",be({},h,{x:75,y:0,height:100,width:25})))};function gt(){return(gt=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var ot=function(h){return o.a.createElement("path",gt({d:"M 0 0 L 25 0 L 50 36 L 75 0 L 100 0 L 40 100 L 12 100 L 37 55 L 0 0"},h))};function xr(){return(xr=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Qe=function(h){return o.a.createElement("path",xr({},h,{d:"M 0 80 L 0 100 L 100 100 L 100 80 L 68 80 L 68 0 L 32 0 L 0 15 L 0 40 L 32 25 L 32 80 L 0 80"}))};function mt(){return(mt=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Vt=function(h){return o.a.createElement("path",mt({},h,{d:"M 0 25 C 20 -8 80 -8 100 25 C 100 90 30 50 20 85 L 100 85 L 100 100 L 0 100 L 0 70 C 10 40 75 70 75 25 C 70 10 30 10 25 28 L 0 25"}))};function qt(){return(qt=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var qn=function(h){return o.a.createElement("path",qt({},h,{d:"M 0 35 L 0 25 C 20 -8 80 -8 100 25 C 100 30 100 50 75 50 C 100 50 100 70 100 75 C 80 108 20 108 0 75 L 0 65 L 25 65 L 25 75 C 30 88 70 88 75 75 C 75 68 75 65 47 58 L 47 42 C 75 32 75 35 75 25 C 70 12 30 12 25 25 L 25 35"}))};function Hl(){return(Hl=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var zl=function(h){return o.a.createElement("path",Hl({},h,{d:"M 50 0 L 0 50 L 0 70 L 50 70 L 50 100 L 75 100 L 75 70 L 100 70 L 100 50 L 75 50 L 75 0 L 50 15 L 50 50 L 30 50 L 75 0 L 50 0"}))};function Ql(){return(Ql=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Wl=function(h){return o.a.createElement("path",Ql({},h,{d:"M 95 20 L 100 0 L 10 0 L 0 60 L 25 60 C 30 45 90 50 75 77 C 66 87 30 90 26 72 L 0 80 C 20 110 80 110 100 70 C 100 25 10 25 25 40 L 30 20 L 95 20"}))};function Gl(){return(Gl=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Yl=function(h){return o.a.createElement("path",Gl({},h,{d:"M 50 0 C -40 70 10 100 50 100 C 90 100 100 80 100 55 C 80 30 30 30 35 50 L 30 60 C 80 50 80 85 50 80 C 10 80 48 10 90 0 L 50 0"}))};function Kl(){return(Kl=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Xl=function(h){return o.a.createElement("path",Kl({},h,{d:"M 0 0 L 100 0 L 50 100 L 20 100 L 60 20 L 0 20 L 0 0"}))};function Vo(){return(Vo=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var Jl=function(h){return o.a.createElement("g",null,o.a.createElement("path",Vo({},h,{d:"M 0 35 L 0 25 C 20 -8 80 -8 100 25 C 100 30 100 50 75 50 C 100 50 100 70 100 75 C 80 108 20 108 0 75 L 0 65 L 25 65 L 25 75 C 30 88 70 88 75 75 C 75 68 75 65 47 58 L 47 42 C 75 32 75 35 75 25 C 70 12 30 12 25 25 L 25 35"})),o.a.createElement("path",Vo({},h,{d:"M 100 35 L 100 25 C 80 -8 20 -8 0 25 C 0 30 0 50 25 50 C 0 50 0 70 0 75 C 20 108 80 108 100 75 L 100 65 L 75 65 L 75 75 C 70 88 30 88 25 75 C 25 68 25 65 53 58 L 53 42 C 25 32 25 35 25 25 C 30 12 70 12 75 25 L 75 35"})))};function Zl(){return(Zl=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var ef=function(h){return o.a.createElement("path",Zl({},h,{d:"M 50 100 C 140 30 90 0 50 0 C 10 0 0 20 0 45 C 20 70 70 70 65 50 L 70 40 C 20 50 20 15 50 20 C 90 20 52 90 10 100 L 50 100"}))},qo=[{component:c,regex:"A",color:"red"},{component:l,regex:"B",color:"maroon"},{component:f,regex:"C",color:"blue"},{component:E,regex:"D",color:"green"},{component:T,regex:"E",color:"olive"},{component:_,regex:"F",color:"navy"},{component:C,regex:"G",color:"orange"},{component:P,regex:"H",color:"teal"},{component:j,regex:"I",color:"cadetblue"},{component:V,regex:"J",color:"lavender"},{component:Le,regex:"K",color:"chocolate"},{component:Se,regex:"L",color:"coral"},{component:Pe,regex:"M",color:"darkolivegreen"},{component:$,regex:"N",color:"darkorange"},{component:N,regex:"O",color:"gold"},{component:K,regex:"P",color:"darkorchid"},{component:ee,regex:"Q",color:"darkslateblue"},{component:W,regex:"R",color:"firebrick"},{component:ie,regex:"S",color:"darkslategrey"},{component:le,regex:"T",color:"#228b22"},{component:I,regex:"U",color:"seagreen"},{component:ae,regex:"V",color:"indigo"},{component:oe,regex:"W",color:"mediumseagreen"},{component:We,regex:"X",color:"black"},{component:Ie,regex:"Y",color:"palevioletred"},{component:wt,regex:"Z",color:"peru"},{component:Ln,regex:"a",color:"red"},{component:hr,regex:"b",color:"maroon"},{component:f,regex:"c",color:"purple"},{component:Vi,regex:"d",color:"green"},{component:jt,regex:"e",color:"olive"},{component:$i,regex:"f",color:"navy"},{component:In,regex:"g",color:"orange"},{component:Bi,regex:"h",color:"teal"},{component:Nn,regex:"i",color:"cadetblue"},{component:Fn,regex:"j",color:"lavender"},{component:jn,regex:"k",color:"chocolate"},{component:k,regex:"l",color:"coral"},{component:H,regex:"m",color:"darkolivegreen"},{component:B,regex:"n",color:"darkorange"},{component:N,regex:"o",color:"gold"},{component:te,regex:"p",color:"darkorchid"},{component:qe,regex:"q",color:"darkslateblue"},{component:Ee,regex:"r",color:"firebrick"},{component:ie,regex:"s",color:"darkslategrey"},{component:Ye,regex:"t",color:"#228b22"},{component:Ke,regex:"u",color:"seagreen"},{component:ae,regex:"v",color:"indigo"},{component:oe,regex:"w",color:"mediumseagreen"},{component:We,regex:"x",color:"black"},{component:ot,regex:"y",color:"palevioletred"},{component:wt,regex:"z",color:"peru"},{component:N,regex:"0",color:"indianred"},{component:Qe,regex:"1",color:"red"},{component:Vt,regex:"2",color:"green"},{component:qn,regex:"3",color:"purple"},{component:zl,regex:"4",color:"navy"},{component:Wl,regex:"5",color:"teal"},{component:Yl,regex:"6",color:"gold"},{component:Xl,regex:"7",color:"olive"},{component:Jl,regex:"8",color:"slate"},{component:ef,regex:"9",color:"firebrick"}],$y=o.a.forwardRef(function(h,g){var y=h.ppm,b=h.pfm,Q=h.scale,he=h.startpos,fe=h.mode;return o.a.createElement(Xr,{ppm:y,alphabet:qo,scale:Q,mode:fe,startpos:he,pfm:b,ref:g})});function Hi(h){return function(g){if(Array.isArray(g)){for(var y=0,b=new Array(g.length);y<g.length;y++)b[y]=g[y];return b}}(h)||function(g){if(Symbol.iterator in Object(g)||Object.prototype.toString.call(g)==="[object Arguments]")return Array.from(g)}(h)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var $o,tf=function(h,g){for(var y=(""+h).length,b=h+1;b<h+g;++b)(""+b).length>y&&(y=(""+b).length);return y},rf=($o={},qo.forEach(function(h){$o[h.regex]=h}),$o),Uo=function(h){return h.map(function(g){if(g.regex.length===1)return Object.assign({},g,{component:rf[g.regex].component});for(var y=(g.color&&g.color.map&&g.color.length>=1?g.color[0]:g.color)||"#000000",b=Object.assign({},g,{component:[],color:g.color&&g.color.map&&g.color.length===g.regex.length?g.color:[]}),Q=0;Q<b.regex.length;++Q)b.component.push(rf[b.regex[Q]].component),b.color.length===Q&&b.color.push(y);return b})},nf=function(h){return h.map(function(g,y){return y}).sort(function(g,y){return h[g]<h[y]?-1:h[g]===h[y]?0:1})},zi=function(h){return Hi(Array(Math.floor(h)).keys())},Uy=function(h){var g=0;return h.filter(function(y){return y>0}).forEach(function(y){g+=y}),g},By=function(h){return h.reduce(function(g,y){return[].concat(Hi(g),Hi(h.reduce(function(b,Q){return[].concat(Hi(b),[{component:[y.component,Q.component],color:[y.color,Q.color],regex:y.regex+Q.regex}])},[])))},[])};function Hy(h){return function(g){if(Array.isArray(g)){for(var y=0,b=new Array(g.length);y<g.length;y++)b[y]=g[y];return b}}(h)||function(g){if(Symbol.iterator in Object(g)||Object.prototype.toString.call(g)==="[object Arguments]")return Array.from(g)}(h)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var af=function(h,g,y){for(var b=[],Q=Math.max.apply(Math,Hy(y.map(function(fe){return fe.length}))),he=0;he<Q;++he)b.push(h.map(function(fe){return 0}));return y.forEach(function(fe){for(var Oe=0;Oe<fe.length;++Oe)++b[Oe][g[fe[Oe]]]}),{count:y.length,pfm:b}},zy=function(h,g){var y={},b=[];return h.forEach(function(Q,he){y[Q.regex]=he}),g.split(`
|
|
112
|
+
`).forEach(function(Q){Q[0]===">"?b.push(""):b[b.length-1]+=Q.trim()}),af(h,y,b)},Qy=function(h,g){var y={};return h.forEach(function(b,Q){y[b.regex]=Q}),af(h,y,g.split(`
|
|
113
|
+
`).map(function(b){return b.trim()}))},of=function(h){var g=h.yscale,y=h.inverted,b=h.xscale,Q=h.children,he=g*(y?-1:1);return o.a.createElement("g",{transform:"scale("+b+","+he+")"},Q)};function Bo(){return(Bo=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var sf=function(h){var g=h.height,y=h.width,b=h.indices,Q=h.alphabet,he=h.lv,fe=h.transform,Oe=h.alpha,tt=h.inverted,Xe=h.onSymbolMouseOver,rt=h.onSymbolMouseOut,st=h.onSymbolClick,Re=g,dt=y/100;Oe=Oe||1;var ct=b.map(function(de){if(!Q[de]||!Q[de].component||he[de]===0)return null;Re-=100*he[de];var $e=tt?Re+100*he[de]:Re;if(!Q[de].component.map){var ht=Q[de].component;return o.a.createElement("g",{transform:"translate(0,"+$e+")",key:de,onMouseOver:Xe&&function(){return Xe(Q[de])},onMouseOut:rt&&function(){return rt(Q[de])},onClick:st&&function(){return st(Q[de])}},o.a.createElement(of,{xscale:dt,yscale:he[de],inverted:tt},o.a.createElement(ht,Bo({fill:Q[de].color,fillOpacity:Oe},Q[de]))))}var Lt=.8*dt/Q[de].component.length;return Q[de].color.map||(Q[de].color=Q[de].component.map(function(Gt){return Q[de].color})),Q[de].component.map(function(Gt,Yt){return o.a.createElement("g",{transform:"translate("+(Yt*y*.8/Q[de].component.length+.1*y)+","+$e+")",key:de+"_"+Yt,onMouseOver:Xe&&function(){return Xe(Q[de])},onMouseOut:rt&&function(){return rt(Q[de])},onClick:st&&function(){return st(Q[de])}},o.a.createElement(of,{xscale:Lt,yscale:he[de],inverted:tt},o.a.createElement(Gt,Bo({fill:Q[de].color[Yt],fillOpacity:Oe},Q[de]))))})});return o.a.createElement("g",{transform:fe},ct)},cf=function(h){var g=h.n,y=h.transform,b=h.glyphWidth,Q=h.startpos,he=zi(g);return o.a.createElement("g",{transform:y},o.a.createElement("g",{transform:"rotate(-90)"},he.map(function(fe){return o.a.createElement("text",{x:"0",y:b*(fe+.66),fontSize:"18",textAnchor:"end",key:fe},fe+Q)})))},Wy=function(h){var g=h.bits,y=h.transform,b=h.height,Q=h.width,he=h.zeroPoint,fe=zi(g+1);return he===void 0&&(he=1),o.a.createElement("g",{transform:y},o.a.createElement("rect",{height:b,width:4,x:Q+1,y:0,fill:"#000000"}),fe.map(function(Oe){return o.a.createElement("g",{key:Oe,transform:"translate(0,"+(b*he-Math.floor(Oe*(b*he)/g))+")"},o.a.createElement("text",{x:Q-15,textAnchor:"end",y:"4",fontSize:"18"},Oe),o.a.createElement("rect",{x:Q-10,width:"15",height:"4",y:"-2",fill:"#000000"}))}),o.a.createElement("g",{transform:"rotate(-90)"},o.a.createElement("text",{y:"20",x:-b/2,textAnchor:"middle",fontSize:"18"},"bits")))},Gy=function(h){var g=h.ticks,y=h.transform,b=h.height,Q=h.width,he=zi(g+1).map(function(fe){return fe/g});return o.a.createElement("g",{transform:y},o.a.createElement("rect",{height:b,width:4,x:Q+1,y:"0",fill:"#000000"}),he.map(function(fe){return o.a.createElement("g",{key:fe,transform:"translate(0,"+(b-Math.floor(fe*b))+")"},o.a.createElement("text",{x:Q-10,textAnchor:"end",y:"4",fontSize:"18"},(fe+"").substring(0,4)),o.a.createElement("rect",{x:Q-5,width:"10",height:"4",y:"-2",fill:"#000000"}))}),o.a.createElement("g",{transform:"rotate(-90)"},o.a.createElement("text",{y:"15",x:-b/2,textAnchor:"middle",fontSize:"18"},"frequency")))},uf=function(h){var g=h.minrange,y=h.maxrange,b=h.xstart,Q=h.width,he=h.height,fe=h.xaxis_y,Oe=h.numberofgridlines,tt=h.stroke,Xe=function(de,$e){return function(ht){return $e[0]+($e[1]-$e[0])*((ht-de[0])/(de[1]-de[0]))}}([g,y],[b,Q]),rt=y-g,st=fe+he,Re=Math.ceil(rt)/Oe,dt=Math.ceil(rt/Re),ct=Array.from(Array(dt).keys());return o.a.createElement("g",{stroke:tt},ct.map(function(de){var $e=g+Re*de;return o.a.createElement("line",{key:de,x1:Xe($e),x2:Xe($e),y1:fe,y2:st})}),o.a.createElement("line",{x1:Xe(y),x2:Xe(y),y1:fe,y2:st}),";")};function lf(h){return function(g){if(Array.isArray(g)){for(var y=0,b=new Array(g.length);y<g.length;y++)b[y]=g[y];return b}}(h)||function(g){if(Symbol.iterator in Object(g)||Object.prototype.toString.call(g)==="[object Arguments]")return Array.from(g)}(h)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var Ho=function(h){var g,y,b=h.values,Q=h.glyphWidth,he=h.stackHeight,fe=h.alphabet,Oe=h.onSymbolMouseOver,tt=h.onSymbolMouseOut,Xe=h.onSymbolClick,rt=(g=Q,y=he,function(Re,dt,ct,de,$e){var ht=nf(Re),Lt=$e||{},Gt=Lt.onSymbolMouseOver,Yt=Lt.onSymbolMouseOut,Zr=Lt.onSymbolClick;return o.a.createElement(sf,{indices:ht,alphabet:de,onSymbolMouseOver:Gt?function(xt){return Gt(ct,xt)}:null,onSymbolClick:Zr?function(xt){return Zr(ct,xt)}:null,onSymbolMouseOut:Yt?function(xt){return Yt(ct,xt)}:null,lv:Re,transform:dt,width:g,height:y,key:ct})});for(var st in fe)if(!st.component){fe=Uo(fe);break}return b.map(function(Re,dt){return rt(Re,"translate("+Q*dt+",0)",dt,fe,{onSymbolMouseOver:Oe,onSymbolMouseOut:tt,onSymbolClick:Xe})})},Xr=o.a.forwardRef(function(h,g){var y=h.ppm,b=h.pfm,Q=h.values,he=h.fasta,fe=h.mode,Oe=h.height,tt=h.width,Xe=h.alphabet,rt=h.glyphwidth,st=h.scale,Re=h.startpos,dt=h.showGridLines,ct=h.backgroundFrequencies,de=h.constantPseudocount,$e=h.smallSampleCorrectionOff,ht=h.yAxisMax,Lt=h.onSymbolMouseOver,Gt=h.onSymbolMouseOut,Yt=h.onSymbolClick,Zr=h.noFastaNames,xt=h.countUnaligned,$t=null,Ut=!(!b&&!he||de||xt)&&!$e,en=Ut?0:(de||0)/Xe.length;if(!y&&!b&&he){var Sf=(Zr?Qy:zy)(Xe,he.toUpperCase());b=Sf.pfm,$t=Sf.count||1}var Dm=Ut&&b&&b.map&&b.map(function(St){return St.reduce(function(Or,Un,pr){return pr===void 0?Or:Un+Or},0)}).map(function(St){return St===0?0:(Xe.length-1)/(2*Math.log(2)*St)});if(!y&&b&&b.map&&(y=b.map(function(St,Or){var Un=($t&&xt?$t:St.reduce(function(pr,Go){return pr+Go},0)+en*Xe.length)||1;return St.map(function(pr){return(pr+en)/Un})})),y.length===0||y[0].length===0)return o.a.createElement("div",null);var zo=y[0].length;ct||(ct=y[0].map(function(St){return 1/zo}));var $n=Q||(fe!=="FREQUENCY"?y.map(function(St,Or){return function(Un){return function(pr,Go){var _f=0,Lm=Go||0;return pr.map(function(Bn,Wi){return _f+=Bn===0?0:Bn*Math.log2(Bn/(Un[Wi]||.01))}),pr.map(function(Bn){var Wi=Bn*(_f-Lm);return Wi<=0?0:Wi})}}(ct)(St,Dm[Or])}):y.map(function(St){return St.map(function(Or){return Or*Math.log2(zo)})})),Of=fe==="FREQUENCY"?[Math.log2(zo)]:ct.map(function(St){return Math.log2(1/(St||.01))}),Qi=ht||Math.max.apply(Math,lf(Of)),Tf=Math.min.apply(Math,lf(Of)),Mm=Tf<0?Qi/(Qi-Tf):1;Re=!isNaN(parseFloat(Re))&&isFinite(Re)?Re:1;var Sr=100*Qi,Qo=Sr/6*(rt||1),Wo=$n.length*Qo+80,Cf=Sr+18*(tf(Re,$n.length)+1);return st&&(Wo>Cf?tt=st:Oe=st),o.a.createElement("svg",{width:tt,height:Oe,viewBox:"0 0 "+Wo+" "+Cf,ref:g},dt&&o.a.createElement(uf,{minrange:Re,maxrange:Re+y.length,xstart:70,width:Wo,height:Sr,xaxis_y:10,numberofgridlines:10*$n.length}),o.a.createElement(cf,{transform:"translate(80,"+(Sr+20)+")",n:$n.length,glyphWidth:Qo,startpos:Re}),fe==="FREQUENCY"?o.a.createElement(Gy,{transform:"translate(0,10)",width:65,height:Sr,ticks:2}):o.a.createElement(Wy,{transform:"translate(0,10)",width:65,height:Sr,bits:Qi,zeroPoint:Mm}),o.a.createElement("g",{transform:"translate(80,10)"},o.a.createElement(Ho,{values:$n,glyphWidth:Qo,stackHeight:Sr,alphabet:Xe,onSymbolMouseOver:Lt,onSymbolMouseOut:Gt,onSymbolClick:Yt})))}),Yy=function(h){var g=h.transform,y=h.min,b=h.max,Q=h.width,he=h.height,fe=[y,0,b];return o.a.createElement("g",{transform:g},o.a.createElement("rect",{height:he,width:4,x:Q+1,y:"0",fill:"#000000"}),fe.map(function(Oe){return o.a.createElement("g",{key:Oe,transform:"translate(0,"+(he-Oe/b*he)/2+")"},o.a.createElement("text",{x:Q-10,textAnchor:"end",y:"4",fontSize:"18"},(Oe+"").substring(0,4)),o.a.createElement("rect",{x:Q-5,width:"10",height:"4",y:"-2",fill:"#000000"}))}),o.a.createElement("g",{transform:"rotate(-90)"},o.a.createElement("text",{y:"15",x:-he/2,textAnchor:"middle",fontSize:"18"},"frequency")))};function ff(h){return function(g){if(Array.isArray(g)){for(var y=0,b=new Array(g.length);y<g.length;y++)b[y]=g[y];return b}}(h)||function(g){if(Symbol.iterator in Object(g)||Object.prototype.toString.call(g)==="[object Arguments]")return Array.from(g)}(h)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var df=function(h,g,y,b){return function(Q,he,fe,Oe,tt,Xe){var rt,st=tt?(rt=Q).map(function($e,ht){return ht}).sort(function($e,ht){return rt[$e]<rt[ht]?1:rt[$e]===rt[ht]?0:-1}):nf(Q),Re=Xe||{},dt=Re.onSymbolMouseOver,ct=Re.onSymbolMouseOut,de=Re.onSymbolClick;return o.a.createElement(sf,{indices:st,alphabet:Oe,alpha:y,lv:Q,transform:he,width:h,height:g,onSymbolMouseOver:dt?function($e){return dt(fe,$e)}:null,onSymbolClick:de?function($e){return de(fe,$e)}:null,onSymbolMouseOut:ct?function($e){return ct(fe,$e)}:null,key:fe,inverted:b})}},hf=o.a.forwardRef(function(h,g){var y=h.values,b=h.height,Q=h.width,he=h.alphabet,fe=h.scale,Oe=h.startpos,tt=h.negativealpha,Xe=h.showGridLines,rt=h.inverted,st=h.onSymbolMouseOver,Re=h.onSymbolMouseOut,dt=h.onSymbolClick;if(y.length===0||y[0].length===0)return o.a.createElement("div",null);y[0].length;for(var ct in he)if(!ct.component){he=Uo(he);break}Oe=Oe??1,tt=(tt=tt<0?0:tt)>255?255:tt;var de=y.map(Uy),$e=y.map(function(xt){return-function($t){var Ut=0;return $t.filter(function(en){return en<0}).forEach(function(en){Ut+=en}),Ut}(xt)}),ht=Math.max.apply(Math,ff(de).concat(ff($e))),Lt=y.length*(200/6)+80,Gt=200+18*(tf(Oe,y.length)+1),Yt=df(200/6,200/2.05),Zr=df(200/6,-200/2.05,tt/255,rt);return fe&&(Lt>Gt?Q=fe:b=fe),o.a.createElement("svg",{ref:g,width:Q,height:b,viewBox:"0 0 "+Lt+" "+Gt},Xe&&o.a.createElement(uf,{minrange:Oe,maxrange:Oe+y.length,xstart:70,width:Lt,height:200,xaxis_y:10,numberofgridlines:10*y.length}),o.a.createElement(cf,{transform:"translate(80,220)",n:y.length,glyphWidth:200/6,startpos:Oe}),o.a.createElement(Yy,{transform:"translate(0,10)",width:65,height:200,min:-ht,max:ht}),o.a.createElement("line",{style:{fill:"none",stroke:"#000000",strokeWidth:2,strokeLinecap:"butt",strokeLinejoin:"miter",strokeOpacity:1,strokeMiterlimit:4,strokeDasharray:"0.53,1.59",strokeDashoffset:0},transform:"translate(80,111)",x1:0,x2:Lt-80}),o.a.createElement("g",{transform:"translate(80,10)"},y.map(function(xt,$t){return Yt(xt.map(function(Ut){return Ut>0?Ut/ht:0}),"translate("+200/6*$t+",0)",$t,he,!1,{onSymbolMouseOver:st,onSymbolMouseOut:Re,onSymbolClick:dt})}),y.map(function(xt,$t){return Zr(xt.map(function(Ut){return Ut<0?Ut/ht:0}),"translate("+200/6*$t+",200)",$t,he,!0,{onSymbolMouseOver:st,onSymbolMouseOut:Re,onSymbolClick:dt})})))});function pf(){return(pf=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var gf=[{component:c,regex:"A",color:"black"},{component:l,regex:"B",color:"#bb8800"},{component:f,regex:"C",color:"#008811"},{component:E,regex:"D",color:"#ff0000"},{component:T,regex:"E",color:"#ff0022"},{component:_,regex:"F",color:"#333333"},{component:C,regex:"G",color:"#007700"},{component:P,regex:"H",color:"#220099"},{component:j,regex:"I",color:"#111111"},{component:Le,regex:"K",color:"#0000aa"},{component:Se,regex:"L",color:"#002222"},{component:Pe,regex:"M",color:"#220022"},{component:$,regex:"N",color:"#009911"},{component:K,regex:"P",color:"#080808"},{component:ee,regex:"Q",color:"#00aa00"},{component:W,regex:"R",color:"#0022aa"},{component:ie,regex:"S",color:"#008f00"},{component:le,regex:"T",color:"#006600"},{component:ae,regex:"V",color:"#222200"},{component:oe,regex:"W",color:"#080808"},{component:Ie,regex:"Y",color:"#00a800"},{component:wt,regex:"Z",color:"#aaaa00"}],vf=o.a.forwardRef(function(h,g){return o.a.createElement(Xr,pf({alphabet:gf},h,{ref:g}))});function yf(){return(yf=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var mf=[{component:c,regex:"A",color:"red"},{component:f,regex:"C",color:"blue"},{component:C,regex:"G",color:"orange"},{component:le,regex:"T",color:"#228b22"}],bf=o.a.forwardRef(function(h,g){return o.a.createElement(Xr,yf({alphabet:mf},h,{ref:g}))});function Ef(){return(Ef=Object.assign||function(h){for(var g=1;g<arguments.length;g++){var y=arguments[g];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])}return h}).apply(this,arguments)}var wf=[{component:c,regex:"A",color:"red"},{component:f,regex:"C",color:"blue"},{component:C,regex:"G",color:"orange"},{component:I,regex:"U",color:"seagreen"}],xf=o.a.forwardRef(function(h,g){return o.a.createElement(Xr,Ef({alphabet:wf},h,{ref:g}))}),Jr=i(1),Ky=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(bf,g))},Xy=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(xf,g))},Jy=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(vf,g))},Zy=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(Xr,g))},em=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(Ho,g))},tm=function(h,g){h.innerHTML=Object(Jr.renderToStaticMarkup)(o.a.createElement(hf,g))};i.d(n,"LC_a",function(){return rm}),i.d(n,"LC_b",function(){return nm}),i.d(n,"LC_c",function(){return im}),i.d(n,"LC_d",function(){return am}),i.d(n,"LC_e",function(){return om}),i.d(n,"LC_f",function(){return sm}),i.d(n,"LC_g",function(){return cm}),i.d(n,"LC_h",function(){return um}),i.d(n,"LC_i",function(){return lm}),i.d(n,"LC_j",function(){return fm}),i.d(n,"LC_k",function(){return dm}),i.d(n,"LC_l",function(){return hm}),i.d(n,"LC_m",function(){return pm}),i.d(n,"LC_n",function(){return gm}),i.d(n,"LC_o",function(){return vm}),i.d(n,"LC_p",function(){return ym}),i.d(n,"LC_q",function(){return mm}),i.d(n,"LC_r",function(){return bm}),i.d(n,"LC_s",function(){return Em}),i.d(n,"LC_t",function(){return wm}),i.d(n,"LC_u",function(){return xm}),i.d(n,"LC_v",function(){return Sm}),i.d(n,"LC_w",function(){return Om}),i.d(n,"LC_x",function(){return Tm}),i.d(n,"LC_y",function(){return Cm}),i.d(n,"LC_z",function(){return _m}),i.d(n,"N0",function(){return km}),i.d(n,"Logo",function(){return Xr}),i.d(n,"ProteinLogo",function(){return vf}),i.d(n,"DNALogo",function(){return bf}),i.d(n,"RNALogo",function(){return xf}),i.d(n,"ProteinAlphabet",function(){return gf}),i.d(n,"DNAAlphabet",function(){return mf}),i.d(n,"RNAAlphabet",function(){return wf}),i.d(n,"CompleteLogo",function(){return $y}),i.d(n,"CompleteAlphabet",function(){return qo}),i.d(n,"INFORMATION_CONTENT",function(){return"INFORMATION_CONTENT"}),i.d(n,"FREQUENCY",function(){return"FREQUENCY"}),i.d(n,"xrange",function(){return zi}),i.d(n,"LogoWithNegatives",function(){return hf}),i.d(n,"embedDNALogo",function(){return Ky}),i.d(n,"disymbolAlphabet",function(){return By}),i.d(n,"RawLogo",function(){return Ho}),i.d(n,"embedRNALogo",function(){return Xy}),i.d(n,"embedLogoWithNegatives",function(){return tm}),i.d(n,"embedProteinLogo",function(){return Jy}),i.d(n,"embedLogo",function(){return Zy}),i.d(n,"embedRawLogo",function(){return em}),i.d(n,"loadGlyphComponents",function(){return Uo}),i.d(n,"A",function(){return c}),i.d(n,"B",function(){return l}),i.d(n,"C",function(){return f}),i.d(n,"D",function(){return E}),i.d(n,"E",function(){return T}),i.d(n,"F",function(){return _}),i.d(n,"G",function(){return C}),i.d(n,"H",function(){return P}),i.d(n,"I",function(){return j}),i.d(n,"J",function(){return V}),i.d(n,"K",function(){return Le}),i.d(n,"L",function(){return Se}),i.d(n,"M",function(){return Pe}),i.d(n,"N",function(){return $}),i.d(n,"O",function(){return N}),i.d(n,"P",function(){return K}),i.d(n,"Q",function(){return ee}),i.d(n,"R",function(){return W}),i.d(n,"S",function(){return ie}),i.d(n,"T",function(){return le}),i.d(n,"U",function(){return I}),i.d(n,"V",function(){return ae}),i.d(n,"W",function(){return oe}),i.d(n,"X",function(){return We}),i.d(n,"Y",function(){return Ie}),i.d(n,"Z",function(){return wt}),i.d(n,"N1",function(){return Qe}),i.d(n,"N2",function(){return Vt}),i.d(n,"N3",function(){return qn}),i.d(n,"N4",function(){return zl}),i.d(n,"N5",function(){return Wl}),i.d(n,"N6",function(){return Yl}),i.d(n,"N7",function(){return Xl}),i.d(n,"N8",function(){return Jl}),i.d(n,"N9",function(){return ef});var rm=Ln,nm=hr,im=f,am=Vi,om=jt,sm=$i,cm=In,um=Bi,lm=Nn,fm=Fn,dm=jn,hm=k,pm=H,gm=B,vm=N,ym=te,mm=qe,bm=Ee,Em=ie,wm=Ye,xm=Ke,Sm=ae,Om=oe,Tm=We,Cm=ot,_m=wt,km=N}])})})(Us);var _h=Us.exports,Mr=_h;const Bs=new Map([["A",Mr.A],["C",Mr.C],["G",Mr.G],["T",Mr.T]]),kh=new Map([["A","#008800"],["C","#000088"],["G","#a89132"],["T","#880000"]]),Dh=e=>{const[t,r,n]=w.useMemo(()=>e.transform(e.importance),[e.transform,e.importance]);return Bs.get(e.base)?p.jsxs(p.Fragment,{children:[p.jsx("rect",{fill:"#000000",fillOpacity:0,y:0,x:e.x,width:e.totalWidth,height:e.totalHeight,onMouseOver:e.onMouseOver,onMouseOut:e.onMouseOut,onMouseDown:e.onClick,onMouseUp:e.onMouseUp}),p.jsx("g",{transform:`${n} translate(${e.x},${t}) scale(${e.xScale},${r})`,children:w.createElement(Bs.get(e.base),{fill:kh.get(e.base)})})]}):null};function Mh(e){return e.sequence!==void 0}const Lh=e=>{const[t,r,n]=Th(e.data,e.height),i=Ch(e.annotations||[],t,n),[a]=w.useState(null),o=w.useMemo(()=>e.width/t.length/100,[e.width,t.length]),s=w.useMemo(()=>r(0)[0],[r]),c=w.useMemo(()=>i.map((d,f)=>{const v=100*o*Math.abs(d.coordinates[1]-d.coordinates[0]),E=Math.min(...d.coordinates)*o*100,x=d.y+d.height,T=80;return p.jsxs(w.Fragment,{children:[p.jsx("rect",{fill:d.color,fillOpacity:.4,x:E,width:v,height:d.height,y:d.y}),p.jsx("path",{fill:d.color,fillOpacity:.4,d:`M ${E} ${x} L ${E-v} ${x+T} L ${E-v} ${x+d.height*3} L ${E+v*2} ${x+d.height*3} L ${E+v*2} ${x+T} L ${E+v} ${x} L ${E} ${x}`}),p.jsx("g",{transform:`translate(${E-v},${x+T})`,children:d.children})]},f)}),[i,o]),u=w.useMemo(()=>t.map((d,f)=>d.importance?p.jsx(Dh,{totalWidth:o*100,totalHeight:e.height,x:f*o*100,xScale:o,transform:r,onMouseOut:e.onBaseMousedOut,...d},f):null),[t,o,e.height,r,e.onBaseMousedOut]),l=w.useMemo(()=>t.filter(d=>d.importance).length>0?p.jsx("line",{stroke:"#ff0000",strokeWidth:1,...e.zeroLineProps,x1:0,x2:e.width,y1:s,y2:s}):p.jsx("text",{x:0,y:e.height/2,children:"No importance track data"}),[t,e.width,e.height,s,e.zeroLineProps]);return p.jsx(Dt,{canDrag:!0,children:p.jsxs("g",{children:[a!==null&&p.jsx("rect",{fill:"#93ceed",fillOpacity:.4,x:Math.min(...a)*o*100,width:100*o*Math.abs(a[1]-a[0]),height:e.height}),c,u,l]})})},Hs={titleSize:12,trackMargin:12,canDrag:!0};function zs(e){const[t,r]=w.useState(!e.data),[n,i]=w.useState(e.data);w.useEffect(()=>{e.data?(i(e.data),r(!1)):r(!0)},[e.data]);const a={...e,trackType:J.IMPORTANCE,displayMode:e.displayMode};return p.jsx(et,{...a,loading:t,trackType:J.IMPORTANCE,displayMode:e.displayMode,children:p.jsx(Lh,{...e,data:n})})}function Qs(e,t,r){const n=[],i=e.sort((a,o)=>a.start-o.start);return i.forEach((a,o)=>{var l;let s=0,c=a.pwm&&a.pwm.length||0;s=a.start<r.start?r.start-a.start:0,c=a.end>r.end?r.end-a.start:c;const u=a.pwm?(l=a.pwm)==null?void 0:l.slice(s,c):void 0;o===0||a.start>i[o-1].end?n.push({start:t(a.start)<0?0:t(a.start),end:t(a.end)<0?0:t(a.end),pwm:u}):n[n.length-1].end=t(a.end)}),n}function Ws(e,t,r){return nn(e.sort((n,i)=>n.start-i.start).map(n=>({coordinates:{start:n.start,end:n.end},pwm:n.pwm,name:""})),t,0).map(n=>n.map(i=>{var c;let a=0,o=i.pwm&&i.pwm.length||0;a=i.coordinates.start<r.start?r.start-i.coordinates.start:0,o=i.coordinates.end>r.end?r.end-i.coordinates.start:o;const s=i.pwm?(c=i.pwm)==null?void 0:c.slice(a,o):void 0;return{start:t(i.coordinates.start)<0?0:t(i.coordinates.start),end:t(i.coordinates.end),pwm:s}}))}const Ih=e=>{const t=w.useContext(Kt),r=(l,d)=>{if(e.svgRef){const f=rr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-d.pwm.length*20?f[0]-d.pwm.length*20+10:f[0]+10,y:f[1],width:d.pwm.length*20,height:150,content:p.jsx("div",{style:{boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.2)",paddingRight:"15px",paddingTop:"10px",paddingLeft:"5px",position:"relative",width:d.pwm.length*20,height:150,backgroundColor:"white"},children:p.jsx(Mr.DNALogo,{ppm:d.pwm,mode:"INFORMATION_CONTENT",width:d.pwm.length*20,height:150})})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=w.useRef(Nt()),a=w.useCallback(Ct(e.domain,e.width),[e.data]),o=w.useMemo(()=>Ws(e.data,a,e.domain),[e.data,e.domain,e.width]),s=w.useMemo(()=>Ws(e.peaks||[],a,e.domain),[e.peaks,e.domain,e.width]),c=Math.max(e.rowHeight*o.length,35),u=e.id||i.current.toString();return w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(c)},[o,e.rowHeight,e.onHeightChanged]),p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:c,clipPath:`url(#${u})`,children:[p.jsx("rect",{width:e.width,height:c,fill:"white"}),p.jsx("defs",{children:p.jsx(zt,{id:u,width:e.width,height:c})}),s.map((l,d)=>p.jsx("g",{transform:`translate(0, ${d*e.rowHeight})`,children:l.map((f,v)=>p.jsx("rect",{height:e.rowHeight*.6,width:f.end-f.start<1?1:f.end-f.start,x:f.start,y:e.rowHeight*.2,fill:e.peakColor||"#3287a8",style:{cursor:"pointer"}},`${u}_peak_${d}_${v}`))},`group_peak_${d}`)),o.map((l,d)=>p.jsx("g",{transform:`translate(0, ${d*e.rowHeight})`,children:l.map((f,v)=>p.jsx("rect",{height:e.rowHeight*.6,width:f.end-f.start<1?1:f.end-f.start,x:f.start,y:e.rowHeight*.2,fill:e.color||"#000088",style:{cursor:"pointer"},onMouseOut:n,onMouseOver:E=>{E.persist(),f.pwm&&r(E,f)}},`${u}_${d}_${v}`))},`group_${d}`))]})})},Ph=e=>{const t=w.useContext(Kt),r=(l,d)=>{if(e.svgRef){const f=rr(e.svgRef.current,l);t.setTooltip({show:!0,x:f[0]>e.width-d.pwm.length*20?f[0]-d.pwm.length*20+10:f[0]+10,y:f[1],width:d.pwm.length*20,height:150,content:p.jsx("div",{style:{boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.2)",paddingRight:"15px",paddingTop:"10px",paddingLeft:"5px",position:"relative",width:d.pwm.length*20,height:150,backgroundColor:"white"},children:p.jsx(Mr.DNALogo,{ppm:d.pwm,mode:"INFORMATION_CONTENT",width:d.pwm.length*20,height:150})})})}},n=()=>{t.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},i=w.useRef(Nt()),a=w.useCallback(Ct(e.domain,e.width),[e.data]),o=e.id||i.current.toString(),s=w.useMemo(()=>Qs(e.data,a,e.domain),[e.domain,e.width,e.data]),c=w.useMemo(()=>Qs(e.peaks||[],a,e.domain),[e.domain,e.width,e.peaks]);w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]);const u=Math.max(e.height,35);return p.jsx(Dt,{canDrag:e.canDrag||!1,children:p.jsxs("g",{width:e.width,height:u,clipPath:`url(#${o})`,children:[p.jsx("rect",{width:e.width,height:u,fill:"white"}),p.jsx("defs",{children:p.jsx(zt,{id:o,width:e.width,height:u})}),c.map((l,d)=>p.jsx("rect",{height:u*.6,width:l.end-l.start,x:l.start,y:u*.2,fill:e.peakColor||"#3287a8",style:{cursor:"pointer"}},`${o}_peak_${d}`)),s.map((l,d)=>p.jsx("rect",{height:u*.6,width:l.end-l.start,x:l.start,y:u*.2,fill:e.color||"#000088",style:{cursor:"pointer"},onMouseOut:n,onMouseOver:f=>{f.persist(),l.pwm&&r(f,l)}},`${o}_${d}`))]})})},Gs={trackType:J.MOTIF,titleSize:12,trackMargin:12,height:50,displayMode:Ae.SQUISH,canDrag:!0};function Ys(e){const[t,r]=w.useState(!e.data),[n,i]=w.useState(e.data);w.useEffect(()=>{e.data?(i(e.data),r(!1)):r(!0)},[e.data]);const a={...e,trackType:J.MOTIF,displayMode:e.displayMode};switch(e.displayMode){case Ae.SQUISH:return p.jsx(et,{...a,loading:t,trackType:J.MOTIF,displayMode:e.displayMode,children:p.jsx(Ih,{...e,data:n})});case Ae.DENSE:return p.jsx(et,{...a,loading:t,trackType:J.MOTIF,displayMode:e.displayMode,children:p.jsx(Ph,{...e,data:n})});case Ae.HIDE:return null;default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(et,{...a,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}const Nh=[{text:"African",value:"AFRICAN"},{text:"Native American",value:"AMERICAN"},{text:"East Asian",value:"EAST_ASIAN"},{text:"European",value:"EUROPEAN"},{text:"South Asian",value:"SOUTH_ASIAN"}],Ah=new Map([["AFRICAN",[null,{text:"Gambian",value:"GAMBIAN"},{text:"Mende",value:"MENDE"},{text:"Easn",value:"ESAN"},{text:"African American",value:"AFRICAN_AMERICAN"},{text:"African Caribbean",value:"AFRICAN_CARIBBEAN"}]],["AMERICAN",[null,{text:"Mexican",value:"MEXICAN"},{text:"Puerto Rican",value:"PUERTO_RICAN"},{text:"Colombian",value:"COLOMBIAN"},{text:"Peruvian",value:"PERUVIAN"}]],["EAST_ASIAN",[null,{text:"Han Chinese from Beijing",value:"HAN_CHINESE_BEIJING"},{text:"Japanese",value:"JAPANESE"},{text:"Dai",value:"DAI"},{text:"Kinh",value:"KINH"},{text:"Southern Han Chinese",value:"SOUTHERN_HAN_CHINESE"}]],["EUROPEAN",[null,{text:"Iberian",value:"IBERIAN"},{text:"British",value:"BRITISH"},{text:"Finnish",value:"FINNISH"},{text:"Toscani",value:"TOSCANI"},{text:"Utah resident northwest European",value:"UTAH_RESIDENT_NW_EUROPEAN"}]],["SOUTH_ASIAN",[null,{text:"Gujarati",value:"GUJARATI"},{text:"Punjabi",value:"PUNJABI"},{text:"Bengali",value:"BENGALI"},{text:"Sri Lankan Tamil",value:"SRI_LANKAN_TAMIL"},{text:"Indian Telugu",value:"INDIAN_TELUGU"}]]]),Ks=Nh.flatMap(e=>(Ah.get(e.value)??[]).filter(r=>r!==null).map(r=>({population:e.value,subpopulation:r.value})));function Fh(e,t,r,n,i){const a=new Map,o=[];return e.sort((s,c)=>s.domain.start-c.domain.start).forEach(s=>{const c=t.has(s.id),u=c?2:1,l=r(s.domain.start),d=r(s.domain.end)-l<u?l+u:r(s.domain.end),f=o[o.length-1]&&o[o.length-1].domain.end;a.set(s.id,(d+l)/2),f&&f>l?(o[o.length-1].domain.end=d,c&&(o[o.length-1].taller=!0,o[o.length-1].color=n)):o.push({...s,domain:{start:l,end:d},color:c?n:i,taller:c})}),{snps:o,coords:a}}function Rh(e,t,r,n,i,a){const o=e.get(t),s=u=>n((u.coordinates.start+u.coordinates.end)/2),c=Xd({start:i,end:1},{start:Ts("0000ED"),end:Ts("000000")});return o===void 0?[]:r.filter(u=>u.rSquared>i).map(u=>({d:`M ${o} ${a*.7} Q ${(o+s(u))/2} 0 ${s(u)} ${a*.7}`,stroke:`#FF${$d(Math.floor(c(u.rSquared)))}00`}))}const jh=e=>{var T,O,_;const[t,r]=w.useState(e.anchor),n=w.useContext(Kt),i=(m,C)=>{if(r(C.id),e.svgRef){const S=rr(e.svgRef.current,m);n.setTooltip({show:!0,x:S[0]>e.width-120?S[0]-120+15:S[0]+15,y:S[1]+10,width:120,height:50,content:p.jsx("span",{style:{fontSize:"10px"},children:C.id})})}e.onVariantMouseOver&&e.onVariantMouseOver(C)},a=()=>{n.setTooltip({show:!1,x:0,y:0,content:void 0,width:0,height:0})},o=w.useRef(Nt()),s=w.useCallback(Ct(e.domain,e.width),[(T=e.data)==null?void 0:T.snps]),c=e.color||"#000000",u=e.ldThreshold||.7,l=e.highlightColor||"#ff0000",d=e.highlighted||new Set,f=w.useMemo(()=>Fh(e.data.snps,d,s,l,c),[e.domain,e.width,e.data.snps,e.highlighted,l,c]),v=e.data.ld&&w.useMemo(()=>Rh(f.coords,t||"",e.data.ld.filter(m=>m.coordinates),s,u,e.height),[f,e.height,t,e.data.ld,e.domain,e.ldThreshold]);w.useEffect(()=>{e.onHeightChanged&&e.onHeightChanged(e.height)},[e.height]);const E=t&&f.snps.find(m=>m.id===t),x=f.snps.find(m=>m.id===t);return w.useMemo(()=>p.jsxs(Dt,{canDrag:e.canDrag||!1,children:[p.jsx("rect",{width:e.width,height:e.height,fill:"white",onMouseOut:a}),p.jsxs("g",{className:e.className,width:e.width,height:e.height,clipPath:`url(#${o.current})`,children:[p.jsx("defs",{children:p.jsx(zt,{id:o.current,width:e.width,height:e.height})}),E&&(v==null?void 0:v.length)===0&&p.jsx("text",{fill:"#ff0000",fontSize:10,x:e.width/2-150,y:20,style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},children:`There are no SNPs in LD (r-squared > ${u}) with ${t} in ${e.id} track`}),E&&p.jsx("rect",{height:e.height*(x.taller?1:.6)*(t?.25:.6),width:1,x:x.domain.end,y:e.height-e.height*(x.taller?1:.6)*(t?.25:.6),fill:"#0000ff"},`${t}`),f.snps.map((m,C)=>{const S=e.height*(m.taller?1:.6)*(t?.25:.6);return p.jsx("rect",{style:{cursor:"pointer"},height:S,width:m.domain.end-m.domain.start,x:m.domain.start,y:e.height-S,fill:m.color,onMouseOver:P=>i(P,m),onMouseOut:()=>{a(),e.onVariantMouseOut&&e.onVariantMouseOut(m)},onClick:()=>e.onVariantClick&&e.onVariantClick(m)},`${e.id}_${C}`)}),v&&v.map((m,C)=>p.jsx("path",{d:m.d,stroke:m.stroke,fill:"none",strokeWidth:2},`${e.id}_path_${C}`))]})]}),[c,(O=e.data)==null?void 0:O.snps,e.ldThreshold,e.highlighted,e.highlightColor,(_=e.data)==null?void 0:_.ld,e.domain,e.height,e.width,e.id])};var ma=function(e,t){return ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},ma(e,t)};function Qt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ma(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var D=function(){return D=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},D.apply(this,arguments)};function At(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function nr(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{u(n.next(l))}catch(d){o(d)}}function c(l){try{u(n.throw(l))}catch(d){o(d)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})}function ir(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.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(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=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 r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Et(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ba="Invariant Violation",Xs=Object.setPrototypeOf,Vh=Xs===void 0?function(e,t){return e.__proto__=t,e}:Xs,Js=function(e){Qt(t,e);function t(r){r===void 0&&(r=ba);var n=e.call(this,typeof r=="number"?ba+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=ba,Vh(n,t.prototype),n}return t}(Error);function yr(e,t){if(!e)throw new Js(t)}var Zs=["debug","log","warn","error","silent"],qh=Zs.indexOf("log");function ri(e){return function(){if(Zs.indexOf(e)>=qh){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=ri("debug"),e.log=ri("log"),e.warn=ri("warn"),e.error=ri("error")})(yr||(yr={}));var Ea="3.11.10";function Ft(e){try{return e()}catch{}}const wa=Ft(function(){return globalThis})||Ft(function(){return window})||Ft(function(){return self})||Ft(function(){return global})||Ft(function(){return Ft.constructor("return this")()});var ec=new Map;function xa(e){var t=ec.get(e)||1;return ec.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function tc(e,t){t===void 0&&(t=0);var r=xa("stringifyForDisplay");return JSON.stringify(e,function(n,i){return i===void 0?r:i},t).split(JSON.stringify(r)).join("<undefined>")}function ni(e){return function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(typeof t=="number"){var i=t;t=Sa(i),t||(t=Oa(i,r),r=[])}e.apply(void 0,[t].concat(r))}}var ne=Object.assign(function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];t||yr(t,Sa(r,n)||Oa(r,n))},{debug:ni(yr.debug),log:ni(yr.log),warn:ni(yr.warn),error:ni(yr.error)});function yt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new Js(Sa(e,t)||Oa(e,t))}var rc=Symbol.for("ApolloErrorMessageHandler_"+Ea);function nc(e){if(typeof e=="string")return e;try{return tc(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function Sa(e,t){if(t===void 0&&(t=[]),!!e)return wa[rc]&&wa[rc](e,t.map(nc))}function Oa(e,t){if(t===void 0&&(t=[]),!!e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Ea,message:e,args:t.map(nc)})))}function ii(e,t){if(!!!e)throw new Error(t)}function $h(e){return typeof e=="object"&&e!==null}function Uh(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const Bh=/\r\n|[\n\r]/g;function Ta(e,t){let r=0,n=1;for(const i of e.body.matchAll(Bh)){if(typeof i.index=="number"||Uh(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function Hh(e){return ic(e.source,Ta(e.source,e.start))}function ic(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?r:0,c=t.column+s,u=`${e.name}:${o}:${c}
|
|
114
114
|
`,l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){const f=Math.floor(c/80),v=c%80,E=[];for(let x=0;x<d.length;x+=80)E.push(d.slice(x,x+80));return u+ac([[`${o} |`,E[0]],...E.slice(1,f+1).map(x=>["|",x]),["|","^".padStart(v)],["|",E[f+1]]])}return u+ac([[`${o-1} |`,l[i-1]],[`${o} |`,d],["|","^".padStart(c)],[`${o+1} |`,l[i+1]]])}function ac(e){const t=e.filter(([n,i])=>i!==void 0),r=Math.max(...t.map(([n])=>n.length));return t.map(([n,i])=>n.padStart(r)+(i?" "+i:"")).join(`
|
|
115
|
-
`)}function
|
|
115
|
+
`)}function zh(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class Ca extends Error{constructor(t,...r){var n,i,a;const{nodes:o,source:s,positions:c,path:u,originalError:l,extensions:d}=zh(r);super(t),this.name="GraphQLError",this.path=u??void 0,this.originalError=l??void 0,this.nodes=oc(Array.isArray(o)?o:o?[o]:void 0);const f=oc((n=this.nodes)===null||n===void 0?void 0:n.map(E=>E.loc).filter(E=>E!=null));this.source=s??(f==null||(i=f[0])===null||i===void 0?void 0:i.source),this.positions=c??(f==null?void 0:f.map(E=>E.start)),this.locations=c&&s?c.map(E=>Ta(s,E)):f==null?void 0:f.map(E=>Ta(E.source,E.start));const v=$h(l==null?void 0:l.extensions)?l==null?void 0:l.extensions:void 0;this.extensions=(a=d??v)!==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,Ca):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const r of this.nodes)r.loc&&(t+=`
|
|
116
116
|
|
|
117
|
-
`+
|
|
117
|
+
`+Hh(r.loc));else if(this.source&&this.locations)for(const r of this.locations)t+=`
|
|
118
118
|
|
|
119
|
-
`+ic(this.source,r);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function oc(e){return e===void 0||e.length===0?void 0:e}function nt(e,t,r){return new Ca(`Syntax Error: ${r}`,{source:e,positions:[t]})}class
|
|
119
|
+
`+ic(this.source,r);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function oc(e){return e===void 0||e.length===0?void 0:e}function nt(e,t,r){return new Ca(`Syntax Error: ${r}`,{source:e,positions:[t]})}class Qh{constructor(t,r,n){this.start=t.start,this.end=r.end,this.startToken=t,this.endToken=r,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class sc{constructor(t,r,n,i,a,o){this.kind=t,this.start=r,this.end=n,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 cc={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"]},Wh=new Set(Object.keys(cc));function uc(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&Wh.has(t)}var Lr;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(Lr||(Lr={}));var _a;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(_a||(_a={}));var G;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(G||(G={}));function ka(e){return e===9||e===32}function an(e){return e>=48&&e<=57}function lc(e){return e>=97&&e<=122||e>=65&&e<=90}function fc(e){return lc(e)||e===95}function Gh(e){return lc(e)||an(e)||e===95}function Yh(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let o=0;o<e.length;++o){var a;const s=e[o],c=Kh(s);c!==s.length&&(n=(a=n)!==null&&a!==void 0?a:o,i=o,o!==0&&c<r&&(r=c))}return e.map((o,s)=>s===0?o:o.slice(r)).slice((t=n)!==null&&t!==void 0?t:0,i+1)}function Kh(e){let t=0;for(;t<e.length&&ka(e.charCodeAt(t));)++t;return t}function Xh(e,t){const r=e.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=n.length===1,a=n.length>1&&n.slice(1).every(v=>v.length===0||ka(v.charCodeAt(0))),o=r.endsWith('\\"""'),s=e.endsWith('"')&&!o,c=e.endsWith("\\"),u=s||c,l=!i||e.length>70||u||a||o;let d="";const f=i&&ka(e.charCodeAt(0));return(l&&!f||a)&&(d+=`
|
|
120
120
|
`),d+=r,(l||u)&&(d+=`
|
|
121
|
-
`),'"""'+d+'"""'}var F;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(F||(F={}));class
|
|
122
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw nt(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function s0(e,t){const r=e.source.body,n=r.length;let i=e.lineStart,a=t+3,o=a,s="";const c=[];for(;a<n;){const u=r.charCodeAt(a);if(u===34&&r.charCodeAt(a+1)===34&&r.charCodeAt(a+2)===34){s+=r.slice(o,a),c.push(s);const l=Je(e,F.BLOCK_STRING,t,a+3,
|
|
123
|
-
`));return e.line+=c.length-1,e.lineStart=i,l}if(u===92&&r.charCodeAt(a+1)===34&&r.charCodeAt(a+2)===34&&r.charCodeAt(a+3)===34){s+=r.slice(o,a),o=a+1,a+=4;continue}if(u===10||u===13){s+=r.slice(o,a),c.push(s),u===13&&r.charCodeAt(a+1)===10?a+=2:++a,s="",o=a,i=a;continue}if(Ir(u))++a;else if(ai(r,a))a+=2;else throw nt(e.source,a,`Invalid character within String: ${mr(e,a)}.`)}throw nt(e.source,a,"Unterminated string.")}function c0(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const a=r.charCodeAt(i);if(
|
|
121
|
+
`),'"""'+d+'"""'}var F;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(F||(F={}));class Jh{constructor(t){const r=new sc(F.SOF,0,0,0,0);this.source=t,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==F.EOF)do if(t.next)t=t.next;else{const r=e0(this,t.end);t.next=r,r.prev=t,t=r}while(t.kind===F.COMMENT);return t}}function Zh(e){return e===F.BANG||e===F.DOLLAR||e===F.AMP||e===F.PAREN_L||e===F.PAREN_R||e===F.SPREAD||e===F.COLON||e===F.EQUALS||e===F.AT||e===F.BRACKET_L||e===F.BRACKET_R||e===F.BRACE_L||e===F.PIPE||e===F.BRACE_R}function Ir(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function ai(e,t){return dc(e.charCodeAt(t))&&hc(e.charCodeAt(t+1))}function dc(e){return e>=55296&&e<=56319}function hc(e){return e>=56320&&e<=57343}function mr(e,t){const r=e.source.body.codePointAt(t);if(r===void 0)return F.EOF;if(r>=32&&r<=126){const n=String.fromCodePoint(r);return n==='"'?`'"'`:`"${n}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function Je(e,t,r,n,i){const a=e.line,o=1+r-e.lineStart;return new sc(t,r,n,a,o,i)}function e0(e,t){const r=e.source.body,n=r.length;let i=t;for(;i<n;){const a=r.charCodeAt(i);switch(a){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:r.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return t0(e,i);case 33:return Je(e,F.BANG,i,i+1);case 36:return Je(e,F.DOLLAR,i,i+1);case 38:return Je(e,F.AMP,i,i+1);case 40:return Je(e,F.PAREN_L,i,i+1);case 41:return Je(e,F.PAREN_R,i,i+1);case 46:if(r.charCodeAt(i+1)===46&&r.charCodeAt(i+2)===46)return Je(e,F.SPREAD,i,i+3);break;case 58:return Je(e,F.COLON,i,i+1);case 61:return Je(e,F.EQUALS,i,i+1);case 64:return Je(e,F.AT,i,i+1);case 91:return Je(e,F.BRACKET_L,i,i+1);case 93:return Je(e,F.BRACKET_R,i,i+1);case 123:return Je(e,F.BRACE_L,i,i+1);case 124:return Je(e,F.PIPE,i,i+1);case 125:return Je(e,F.BRACE_R,i,i+1);case 34:return r.charCodeAt(i+1)===34&&r.charCodeAt(i+2)===34?s0(e,i):n0(e,i)}if(an(a)||a===45)return r0(e,i,a);if(fc(a))return c0(e,i);throw nt(e.source,i,a===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ir(a)||ai(r,i)?`Unexpected character: ${mr(e,i)}.`:`Invalid character: ${mr(e,i)}.`)}return Je(e,F.EOF,n,n)}function t0(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const a=r.charCodeAt(i);if(a===10||a===13)break;if(Ir(a))++i;else if(ai(r,i))i+=2;else break}return Je(e,F.COMMENT,t,i,r.slice(t+1,i))}function r0(e,t,r){const n=e.source.body;let i=t,a=r,o=!1;if(a===45&&(a=n.charCodeAt(++i)),a===48){if(a=n.charCodeAt(++i),an(a))throw nt(e.source,i,`Invalid number, unexpected digit after 0: ${mr(e,i)}.`)}else i=Da(e,i,a),a=n.charCodeAt(i);if(a===46&&(o=!0,a=n.charCodeAt(++i),i=Da(e,i,a),a=n.charCodeAt(i)),(a===69||a===101)&&(o=!0,a=n.charCodeAt(++i),(a===43||a===45)&&(a=n.charCodeAt(++i)),i=Da(e,i,a),a=n.charCodeAt(i)),a===46||fc(a))throw nt(e.source,i,`Invalid number, expected digit but got: ${mr(e,i)}.`);return Je(e,o?F.FLOAT:F.INT,t,i,n.slice(t,i))}function Da(e,t,r){if(!an(r))throw nt(e.source,t,`Invalid number, expected digit but got: ${mr(e,t)}.`);const n=e.source.body;let i=t+1;for(;an(n.charCodeAt(i));)++i;return i}function n0(e,t){const r=e.source.body,n=r.length;let i=t+1,a=i,o="";for(;i<n;){const s=r.charCodeAt(i);if(s===34)return o+=r.slice(a,i),Je(e,F.STRING,t,i+1,o);if(s===92){o+=r.slice(a,i);const c=r.charCodeAt(i+1)===117?r.charCodeAt(i+2)===123?i0(e,i):a0(e,i):o0(e,i);o+=c.value,i+=c.size,a=i;continue}if(s===10||s===13)break;if(Ir(s))++i;else if(ai(r,i))i+=2;else throw nt(e.source,i,`Invalid character within String: ${mr(e,i)}.`)}throw nt(e.source,i,"Unterminated string.")}function i0(e,t){const r=e.source.body;let n=0,i=3;for(;i<12;){const a=r.charCodeAt(t+i++);if(a===125){if(i<5||!Ir(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|on(a),n<0)break}throw nt(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+i)}".`)}function a0(e,t){const r=e.source.body,n=pc(r,t+2);if(Ir(n))return{value:String.fromCodePoint(n),size:6};if(dc(n)&&r.charCodeAt(t+6)===92&&r.charCodeAt(t+7)===117){const i=pc(r,t+8);if(hc(i))return{value:String.fromCodePoint(n,i),size:12}}throw nt(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}function pc(e,t){return on(e.charCodeAt(t))<<12|on(e.charCodeAt(t+1))<<8|on(e.charCodeAt(t+2))<<4|on(e.charCodeAt(t+3))}function on(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function o0(e,t){const r=e.source.body;switch(r.charCodeAt(t+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:`
|
|
122
|
+
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw nt(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function s0(e,t){const r=e.source.body,n=r.length;let i=e.lineStart,a=t+3,o=a,s="";const c=[];for(;a<n;){const u=r.charCodeAt(a);if(u===34&&r.charCodeAt(a+1)===34&&r.charCodeAt(a+2)===34){s+=r.slice(o,a),c.push(s);const l=Je(e,F.BLOCK_STRING,t,a+3,Yh(c).join(`
|
|
123
|
+
`));return e.line+=c.length-1,e.lineStart=i,l}if(u===92&&r.charCodeAt(a+1)===34&&r.charCodeAt(a+2)===34&&r.charCodeAt(a+3)===34){s+=r.slice(o,a),o=a+1,a+=4;continue}if(u===10||u===13){s+=r.slice(o,a),c.push(s),u===13&&r.charCodeAt(a+1)===10?a+=2:++a,s="",o=a,i=a;continue}if(Ir(u))++a;else if(ai(r,a))a+=2;else throw nt(e.source,a,`Invalid character within String: ${mr(e,a)}.`)}throw nt(e.source,a,"Unterminated string.")}function c0(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const a=r.charCodeAt(i);if(Gh(a))++i;else break}return Je(e,F.NAME,t,i,r.slice(t,i))}const u0=10,gc=2;function Ma(e){return oi(e,[])}function oi(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return l0(e,t);default:return String(e)}}function l0(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(f0(e)){const n=e.toJSON();if(n!==e)return typeof n=="string"?n:oi(n,r)}else if(Array.isArray(e))return h0(e,r);return d0(e,r)}function f0(e){return typeof e.toJSON=="function"}function d0(e,t){const r=Object.entries(e);return r.length===0?"{}":t.length>gc?"["+p0(e)+"]":"{ "+r.map(([i,a])=>i+": "+oi(a,t)).join(", ")+" }"}function h0(e,t){if(e.length===0)return"[]";if(t.length>gc)return"[Array]";const r=Math.min(u0,e.length),n=e.length-r,i=[];for(let a=0;a<r;++a)i.push(oi(e[a],t));return n===1?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}function p0(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}const g0=globalThis.process&&process.env.NODE_ENV==="production"?function(t,r){return t instanceof r}:function(t,r){if(t instanceof r)return!0;if(typeof t=="object"&&t!==null){var n;const i=r.prototype[Symbol.toStringTag],a=Symbol.toStringTag in t?t[Symbol.toStringTag]:(n=t.constructor)===null||n===void 0?void 0:n.name;if(i===a){const o=Ma(t);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
|
|
124
124
|
|
|
125
125
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
126
126
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -131,42 +131,42 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
131
131
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
132
132
|
versions may have different capabilities and behavior. The data from one
|
|
133
133
|
version used in the function from another could produce confusing and
|
|
134
|
-
spurious results.`)}}return!1};class vc{constructor(t,r="GraphQL request",n={line:1,column:1}){typeof t=="string"||ii(!1,`Body must be a string. Received: ${Ma(t)}.`),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||ii(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ii(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function v0(e){return g0(e,vc)}function y0(e,t){return new m0(e,t).parseDocument()}class m0{constructor(t,r={}){const n=v0(t)?t:new vc(t);this._lexer=new Jd(n),this._options=r,this._tokenCounter=0}parseName(){const t=this.expectToken(F.NAME);return this.node(t,{kind:Y.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:Y.DOCUMENT,definitions:this.many(F.SOF,this.parseDefinition,F.EOF)})}parseDefinition(){if(this.peek(F.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),r=t?this._lexer.lookahead():this._lexer.token;if(r.kind===F.NAME){switch(r.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(t)throw nt(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(F.BRACE_L))return this.node(t,{kind:Y.OPERATION_DEFINITION,operation:Lr.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const r=this.parseOperationType();let n;return this.peek(F.NAME)&&(n=this.parseName()),this.node(t,{kind:Y.OPERATION_DEFINITION,operation:r,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(F.NAME);switch(t.value){case"query":return Lr.QUERY;case"mutation":return Lr.MUTATION;case"subscription":return Lr.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(F.PAREN_L,this.parseVariableDefinition,F.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Y.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(F.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(F.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(F.DOLLAR),this.node(t,{kind:Y.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Y.SELECTION_SET,selections:this.many(F.BRACE_L,this.parseSelection,F.BRACE_R)})}parseSelection(){return this.peek(F.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,r=this.parseName();let n,i;return this.expectOptionalToken(F.COLON)?(n=r,i=this.parseName()):i=r,this.node(t,{kind:Y.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(F.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const r=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(F.PAREN_L,r,F.PAREN_R)}parseArgument(t=!1){const r=this._lexer.token,n=this.parseName();return this.expectToken(F.COLON),this.node(r,{kind:Y.ARGUMENT,name:n,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(F.SPREAD);const r=this.expectOptionalKeyword("on");return!r&&this.peek(F.NAME)?this.node(t,{kind:Y.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:Y.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:Y.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:Y.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(t){const r=this._lexer.token;switch(r.kind){case F.BRACKET_L:return this.parseList(t);case F.BRACE_L:return this.parseObject(t);case F.INT:return this.advanceLexer(),this.node(r,{kind:Y.INT,value:r.value});case F.FLOAT:return this.advanceLexer(),this.node(r,{kind:Y.FLOAT,value:r.value});case F.STRING:case F.BLOCK_STRING:return this.parseStringLiteral();case F.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:Y.BOOLEAN,value:!0});case"false":return this.node(r,{kind:Y.BOOLEAN,value:!1});case"null":return this.node(r,{kind:Y.NULL});default:return this.node(r,{kind:Y.ENUM,value:r.value})}case F.DOLLAR:if(t)if(this.expectToken(F.DOLLAR),this._lexer.token.kind===F.NAME){const n=this._lexer.token.value;throw nt(this._lexer.source,r.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:Y.STRING,value:t.value,block:t.kind===F.BLOCK_STRING})}parseList(t){const r=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:Y.LIST,values:this.any(F.BRACKET_L,r,F.BRACKET_R)})}parseObject(t){const r=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:Y.OBJECT,fields:this.any(F.BRACE_L,r,F.BRACE_R)})}parseObjectField(t){const r=this._lexer.token,n=this.parseName();return this.expectToken(F.COLON),this.node(r,{kind:Y.OBJECT_FIELD,name:n,value:this.parseValueLiteral(t)})}parseDirectives(t){const r=[];for(;this.peek(F.AT);)r.push(this.parseDirective(t));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const r=this._lexer.token;return this.expectToken(F.AT),this.node(r,{kind:Y.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let r;if(this.expectOptionalToken(F.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(F.BRACKET_R),r=this.node(t,{kind:Y.LIST_TYPE,type:n})}else r=this.parseNamedType();return this.expectOptionalToken(F.BANG)?this.node(t,{kind:Y.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:Y.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(F.STRING)||this.peek(F.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(F.BRACE_L,this.parseOperationTypeDefinition,F.BRACE_R);return this.node(t,{kind:Y.SCHEMA_DEFINITION,description:r,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const t=this._lexer.token,r=this.parseOperationType();this.expectToken(F.COLON);const n=this.parseNamedType();return this.node(t,{kind:Y.OPERATION_TYPE_DEFINITION,operation:r,type:n})}parseScalarTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:Y.SCALAR_TYPE_DEFINITION,description:r,name:n,directives:i})}parseObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:Y.OBJECT_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:a,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(F.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(F.BRACE_L,this.parseFieldDefinition,F.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(F.COLON);const a=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:Y.FIELD_DEFINITION,description:r,name:n,arguments:i,type:a,directives:o})}parseArgumentDefs(){return this.optionalMany(F.PAREN_L,this.parseInputValueDef,F.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(F.COLON);const i=this.parseTypeReference();let a;this.expectOptionalToken(F.EQUALS)&&(a=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:Y.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:a,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:Y.INTERFACE_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:a,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseUnionMemberTypes();return this.node(t,{kind:Y.UNION_TYPE_DEFINITION,description:r,name:n,directives:i,types:a})}parseUnionMemberTypes(){return this.expectOptionalToken(F.EQUALS)?this.delimitedMany(F.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseEnumValuesDefinition();return this.node(t,{kind:Y.ENUM_TYPE_DEFINITION,description:r,name:n,directives:i,values:a})}parseEnumValuesDefinition(){return this.optionalMany(F.BRACE_L,this.parseEnumValueDefinition,F.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:Y.ENUM_VALUE_DEFINITION,description:r,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw nt(this._lexer.source,this._lexer.token.start,`${si(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseInputFieldsDefinition();return this.node(t,{kind:Y.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:n,directives:i,fields:a})}parseInputFieldsDefinition(){return this.optionalMany(F.BRACE_L,this.parseInputValueDef,F.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===F.NAME)switch(t.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(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.optionalMany(F.BRACE_L,this.parseOperationTypeDefinition,F.BRACE_R);if(r.length===0&&n.length===0)throw this.unexpected();return this.node(t,{kind:Y.SCHEMA_EXTENSION,directives:r,operationTypes:n})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(t,{kind:Y.SCALAR_TYPE_EXTENSION,name:r,directives:n})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:Y.OBJECT_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:a})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:Y.INTERFACE_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:a})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:Y.UNION_TYPE_EXTENSION,name:r,directives:n,types:i})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:Y.ENUM_TYPE_EXTENSION,name:r,directives:n,values:i})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:Y.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:n,fields:i})}parseDirectiveDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(F.AT);const n=this.parseName(),i=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:Y.DIRECTIVE_DEFINITION,description:r,name:n,arguments:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(F.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(_a,r.value))return r;throw this.unexpected(t)}node(t,r){return this._options.noLocation!==!0&&(r.loc=new Qd(t,this._lexer.lastToken,this._lexer.source)),r}peek(t){return this._lexer.token.kind===t}expectToken(t){const r=this._lexer.token;if(r.kind===t)return this.advanceLexer(),r;throw nt(this._lexer.source,r.start,`Expected ${yc(t)}, found ${si(r)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const r=this._lexer.token;if(r.kind===F.NAME&&r.value===t)this.advanceLexer();else throw nt(this._lexer.source,r.start,`Expected "${t}", found ${si(r)}.`)}expectOptionalKeyword(t){const r=this._lexer.token;return r.kind===F.NAME&&r.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const r=t??this._lexer.token;return nt(this._lexer.source,r.start,`Unexpected ${si(r)}.`)}any(t,r,n){this.expectToken(t);const i=[];for(;!this.expectOptionalToken(n);)i.push(r.call(this));return i}optionalMany(t,r,n){if(this.expectOptionalToken(t)){const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(t,r,n){this.expectToken(t);const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(t,r){this.expectOptionalToken(t);const n=[];do n.push(r.call(this));while(this.expectOptionalToken(t));return n}advanceLexer(){const{maxTokens:t}=this._options,r=this._lexer.advance();if(t!==void 0&&r.kind!==F.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw nt(this._lexer.source,r.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function si(e){const t=e.value;return yc(e.kind)+(t!=null?` "${t}"`:"")}function yc(e){return Zd(e)?`"${e}"`:e}function b0(e){return`"${e.replace(E0,w0)}"`}const E0=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function w0(e){return x0[e.charCodeAt(0)]}const x0=["\\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"],La=Object.freeze({});function Xt(e,t,r=cc){const n=new Map;for(const S of Object.values(Y))n.set(S,O0(t,S));let i,a=Array.isArray(e),o=[e],s=-1,c=[],u=e,l,d;const f=[],v=[];do{s++;const S=s===o.length,_=S&&c.length!==0;if(S){if(l=v.length===0?void 0:f[f.length-1],u=d,d=v.pop(),_)if(a){u=u.slice();let C=0;for(const[O,P]of c){const A=O-C;P===null?(u.splice(A,1),C++):u[A]=P}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(const[C,O]of c)u[C]=O}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(d){if(l=a?s:o[s],u=d[l],u==null)continue;f.push(l)}let m;if(!Array.isArray(u)){var E,x;uc(u)||ii(!1,`Invalid AST Node: ${Ma(u)}.`);const C=S?(E=n.get(u.kind))===null||E===void 0?void 0:E.leave:(x=n.get(u.kind))===null||x===void 0?void 0:x.enter;if(m=C==null?void 0:C.call(t,u,l,d,f,v),m===La)break;if(m===!1){if(!S){f.pop();continue}}else if(m!==void 0&&(c.push([l,m]),!S))if(uc(m))u=m;else{f.pop();continue}}if(m===void 0&&_&&c.push([l,u]),S)f.pop();else{var T;i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(u),o=a?u:(T=r[u.kind])!==null&&T!==void 0?T:[],s=-1,c=[],d&&v.push(d),d=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:e}function O0(e,t){const r=e[t];return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}function S0(e){return Xt(e,C0)}const T0=80,C0={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>J(e.definitions,`
|
|
134
|
+
spurious results.`)}}return!1};class vc{constructor(t,r="GraphQL request",n={line:1,column:1}){typeof t=="string"||ii(!1,`Body must be a string. Received: ${Ma(t)}.`),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||ii(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ii(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function v0(e){return g0(e,vc)}function y0(e,t){return new m0(e,t).parseDocument()}class m0{constructor(t,r={}){const n=v0(t)?t:new vc(t);this._lexer=new Jh(n),this._options=r,this._tokenCounter=0}parseName(){const t=this.expectToken(F.NAME);return this.node(t,{kind:G.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:G.DOCUMENT,definitions:this.many(F.SOF,this.parseDefinition,F.EOF)})}parseDefinition(){if(this.peek(F.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),r=t?this._lexer.lookahead():this._lexer.token;if(r.kind===F.NAME){switch(r.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(t)throw nt(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(F.BRACE_L))return this.node(t,{kind:G.OPERATION_DEFINITION,operation:Lr.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const r=this.parseOperationType();let n;return this.peek(F.NAME)&&(n=this.parseName()),this.node(t,{kind:G.OPERATION_DEFINITION,operation:r,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(F.NAME);switch(t.value){case"query":return Lr.QUERY;case"mutation":return Lr.MUTATION;case"subscription":return Lr.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(F.PAREN_L,this.parseVariableDefinition,F.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:G.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(F.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(F.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(F.DOLLAR),this.node(t,{kind:G.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:G.SELECTION_SET,selections:this.many(F.BRACE_L,this.parseSelection,F.BRACE_R)})}parseSelection(){return this.peek(F.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,r=this.parseName();let n,i;return this.expectOptionalToken(F.COLON)?(n=r,i=this.parseName()):i=r,this.node(t,{kind:G.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(F.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const r=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(F.PAREN_L,r,F.PAREN_R)}parseArgument(t=!1){const r=this._lexer.token,n=this.parseName();return this.expectToken(F.COLON),this.node(r,{kind:G.ARGUMENT,name:n,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(F.SPREAD);const r=this.expectOptionalKeyword("on");return!r&&this.peek(F.NAME)?this.node(t,{kind:G.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:G.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:G.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:G.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(t){const r=this._lexer.token;switch(r.kind){case F.BRACKET_L:return this.parseList(t);case F.BRACE_L:return this.parseObject(t);case F.INT:return this.advanceLexer(),this.node(r,{kind:G.INT,value:r.value});case F.FLOAT:return this.advanceLexer(),this.node(r,{kind:G.FLOAT,value:r.value});case F.STRING:case F.BLOCK_STRING:return this.parseStringLiteral();case F.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:G.BOOLEAN,value:!0});case"false":return this.node(r,{kind:G.BOOLEAN,value:!1});case"null":return this.node(r,{kind:G.NULL});default:return this.node(r,{kind:G.ENUM,value:r.value})}case F.DOLLAR:if(t)if(this.expectToken(F.DOLLAR),this._lexer.token.kind===F.NAME){const n=this._lexer.token.value;throw nt(this._lexer.source,r.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:G.STRING,value:t.value,block:t.kind===F.BLOCK_STRING})}parseList(t){const r=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:G.LIST,values:this.any(F.BRACKET_L,r,F.BRACKET_R)})}parseObject(t){const r=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:G.OBJECT,fields:this.any(F.BRACE_L,r,F.BRACE_R)})}parseObjectField(t){const r=this._lexer.token,n=this.parseName();return this.expectToken(F.COLON),this.node(r,{kind:G.OBJECT_FIELD,name:n,value:this.parseValueLiteral(t)})}parseDirectives(t){const r=[];for(;this.peek(F.AT);)r.push(this.parseDirective(t));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const r=this._lexer.token;return this.expectToken(F.AT),this.node(r,{kind:G.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let r;if(this.expectOptionalToken(F.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(F.BRACKET_R),r=this.node(t,{kind:G.LIST_TYPE,type:n})}else r=this.parseNamedType();return this.expectOptionalToken(F.BANG)?this.node(t,{kind:G.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:G.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(F.STRING)||this.peek(F.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(F.BRACE_L,this.parseOperationTypeDefinition,F.BRACE_R);return this.node(t,{kind:G.SCHEMA_DEFINITION,description:r,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const t=this._lexer.token,r=this.parseOperationType();this.expectToken(F.COLON);const n=this.parseNamedType();return this.node(t,{kind:G.OPERATION_TYPE_DEFINITION,operation:r,type:n})}parseScalarTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:G.SCALAR_TYPE_DEFINITION,description:r,name:n,directives:i})}parseObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:G.OBJECT_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:a,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(F.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(F.BRACE_L,this.parseFieldDefinition,F.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(F.COLON);const a=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:G.FIELD_DEFINITION,description:r,name:n,arguments:i,type:a,directives:o})}parseArgumentDefs(){return this.optionalMany(F.PAREN_L,this.parseInputValueDef,F.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(F.COLON);const i=this.parseTypeReference();let a;this.expectOptionalToken(F.EQUALS)&&(a=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:G.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:a,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:G.INTERFACE_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:a,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseUnionMemberTypes();return this.node(t,{kind:G.UNION_TYPE_DEFINITION,description:r,name:n,directives:i,types:a})}parseUnionMemberTypes(){return this.expectOptionalToken(F.EQUALS)?this.delimitedMany(F.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseEnumValuesDefinition();return this.node(t,{kind:G.ENUM_TYPE_DEFINITION,description:r,name:n,directives:i,values:a})}parseEnumValuesDefinition(){return this.optionalMany(F.BRACE_L,this.parseEnumValueDefinition,F.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:G.ENUM_VALUE_DEFINITION,description:r,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw nt(this._lexer.source,this._lexer.token.start,`${si(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),a=this.parseInputFieldsDefinition();return this.node(t,{kind:G.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:n,directives:i,fields:a})}parseInputFieldsDefinition(){return this.optionalMany(F.BRACE_L,this.parseInputValueDef,F.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===F.NAME)switch(t.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(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.optionalMany(F.BRACE_L,this.parseOperationTypeDefinition,F.BRACE_R);if(r.length===0&&n.length===0)throw this.unexpected();return this.node(t,{kind:G.SCHEMA_EXTENSION,directives:r,operationTypes:n})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(t,{kind:G.SCALAR_TYPE_EXTENSION,name:r,directives:n})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:G.OBJECT_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:a})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(t,{kind:G.INTERFACE_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:a})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:G.UNION_TYPE_EXTENSION,name:r,directives:n,types:i})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:G.ENUM_TYPE_EXTENSION,name:r,directives:n,values:i})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:G.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:n,fields:i})}parseDirectiveDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(F.AT);const n=this.parseName(),i=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:G.DIRECTIVE_DEFINITION,description:r,name:n,arguments:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(F.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(_a,r.value))return r;throw this.unexpected(t)}node(t,r){return this._options.noLocation!==!0&&(r.loc=new Qh(t,this._lexer.lastToken,this._lexer.source)),r}peek(t){return this._lexer.token.kind===t}expectToken(t){const r=this._lexer.token;if(r.kind===t)return this.advanceLexer(),r;throw nt(this._lexer.source,r.start,`Expected ${yc(t)}, found ${si(r)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const r=this._lexer.token;if(r.kind===F.NAME&&r.value===t)this.advanceLexer();else throw nt(this._lexer.source,r.start,`Expected "${t}", found ${si(r)}.`)}expectOptionalKeyword(t){const r=this._lexer.token;return r.kind===F.NAME&&r.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const r=t??this._lexer.token;return nt(this._lexer.source,r.start,`Unexpected ${si(r)}.`)}any(t,r,n){this.expectToken(t);const i=[];for(;!this.expectOptionalToken(n);)i.push(r.call(this));return i}optionalMany(t,r,n){if(this.expectOptionalToken(t)){const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(t,r,n){this.expectToken(t);const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(t,r){this.expectOptionalToken(t);const n=[];do n.push(r.call(this));while(this.expectOptionalToken(t));return n}advanceLexer(){const{maxTokens:t}=this._options,r=this._lexer.advance();if(t!==void 0&&r.kind!==F.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw nt(this._lexer.source,r.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function si(e){const t=e.value;return yc(e.kind)+(t!=null?` "${t}"`:"")}function yc(e){return Zh(e)?`"${e}"`:e}function b0(e){return`"${e.replace(E0,w0)}"`}const E0=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function w0(e){return x0[e.charCodeAt(0)]}const x0=["\\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"],La=Object.freeze({});function Xt(e,t,r=cc){const n=new Map;for(const O of Object.values(G))n.set(O,S0(t,O));let i,a=Array.isArray(e),o=[e],s=-1,c=[],u=e,l,d;const f=[],v=[];do{s++;const O=s===o.length,_=O&&c.length!==0;if(O){if(l=v.length===0?void 0:f[f.length-1],u=d,d=v.pop(),_)if(a){u=u.slice();let C=0;for(const[S,P]of c){const A=S-C;P===null?(u.splice(A,1),C++):u[A]=P}}else{u=Object.defineProperties({},Object.getOwnPropertyDescriptors(u));for(const[C,S]of c)u[C]=S}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(d){if(l=a?s:o[s],u=d[l],u==null)continue;f.push(l)}let m;if(!Array.isArray(u)){var E,x;uc(u)||ii(!1,`Invalid AST Node: ${Ma(u)}.`);const C=O?(E=n.get(u.kind))===null||E===void 0?void 0:E.leave:(x=n.get(u.kind))===null||x===void 0?void 0:x.enter;if(m=C==null?void 0:C.call(t,u,l,d,f,v),m===La)break;if(m===!1){if(!O){f.pop();continue}}else if(m!==void 0&&(c.push([l,m]),!O))if(uc(m))u=m;else{f.pop();continue}}if(m===void 0&&_&&c.push([l,u]),O)f.pop();else{var T;i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(u),o=a?u:(T=r[u.kind])!==null&&T!==void 0?T:[],s=-1,c=[],d&&v.push(d),d=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:e}function S0(e,t){const r=e[t];return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}function O0(e){return Xt(e,C0)}const T0=80,C0={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>X(e.definitions,`
|
|
135
135
|
|
|
136
|
-
`)},OperationDefinition:{leave(e){const t=we("(",
|
|
137
|
-
`,ci(
|
|
136
|
+
`)},OperationDefinition:{leave(e){const t=we("(",X(e.variableDefinitions,", "),")"),r=X([e.operation,X([e.name,t]),X(e.directives," ")]," ");return(r==="query"?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+we(" = ",r)+we(" ",X(n," "))},SelectionSet:{leave:({selections:e})=>Rt(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const a=we("",e,": ")+t;let o=a+we("(",X(r,", "),")");return o.length>T0&&(o=a+we(`(
|
|
137
|
+
`,ci(X(r,`
|
|
138
138
|
`)),`
|
|
139
|
-
)`)),
|
|
140
|
-
`)+
|
|
141
|
-
`)+
|
|
142
|
-
`)+
|
|
139
|
+
)`)),X([o,X(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+we(" ",X(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>X(["...",we("on ",e),X(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${we("(",X(r,", "),")")} on ${t} ${we("",X(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Xh(e):b0(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+X(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+X(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+we("(",X(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>we("",e,`
|
|
140
|
+
`)+X(["schema",X(t," "),Rt(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>we("",e,`
|
|
141
|
+
`)+X(["scalar",t,X(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>we("",e,`
|
|
142
|
+
`)+X(["type",t,we("implements ",X(r," & ")),X(n," "),Rt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>we("",e,`
|
|
143
143
|
`)+t+(mc(r)?we(`(
|
|
144
|
-
`,ci(
|
|
144
|
+
`,ci(X(r,`
|
|
145
145
|
`)),`
|
|
146
|
-
)`):we("(",
|
|
147
|
-
`)+
|
|
148
|
-
`)+
|
|
149
|
-
`)+
|
|
150
|
-
`)+
|
|
151
|
-
`)+
|
|
152
|
-
`)+
|
|
146
|
+
)`):we("(",X(r,", "),")"))+": "+n+we(" ",X(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>we("",e,`
|
|
147
|
+
`)+X([t+": "+r,we("= ",n),X(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>we("",e,`
|
|
148
|
+
`)+X(["interface",t,we("implements ",X(r," & ")),X(n," "),Rt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>we("",e,`
|
|
149
|
+
`)+X(["union",t,X(r," "),we("= ",X(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>we("",e,`
|
|
150
|
+
`)+X(["enum",t,X(r," "),Rt(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>we("",e,`
|
|
151
|
+
`)+X([t,X(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>we("",e,`
|
|
152
|
+
`)+X(["input",t,X(r," "),Rt(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>we("",e,`
|
|
153
153
|
`)+"directive @"+t+(mc(r)?we(`(
|
|
154
|
-
`,ci(
|
|
154
|
+
`,ci(X(r,`
|
|
155
155
|
`)),`
|
|
156
|
-
)`):we("(",
|
|
157
|
-
`,ci(
|
|
156
|
+
)`):we("(",X(r,", "),")"))+(n?" repeatable":"")+" on "+X(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>X(["extend schema",X(e," "),Rt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>X(["extend scalar",e,X(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>X(["extend type",e,we("implements ",X(t," & ")),X(r," "),Rt(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>X(["extend interface",e,we("implements ",X(t," & ")),X(r," "),Rt(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>X(["extend union",e,X(t," "),we("= ",X(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>X(["extend enum",e,X(t," "),Rt(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>X(["extend input",e,X(t," "),Rt(r)]," ")}};function X(e,t=""){var r;return(r=e==null?void 0:e.filter(n=>n).join(t))!==null&&r!==void 0?r:""}function Rt(e){return we(`{
|
|
157
|
+
`,ci(X(e,`
|
|
158
158
|
`)),`
|
|
159
159
|
}`)}function we(e,t,r=""){return t!=null&&t!==""?e+t+r:""}function ci(e){return we(" ",e.replace(/\n/g,`
|
|
160
160
|
`))}function mc(e){var t;return(t=e==null?void 0:e.some(r=>r.includes(`
|
|
161
|
-
`)))!==null&&t!==void 0?t:!1}function bc(e){return e.kind===Y.FIELD||e.kind===Y.FRAGMENT_SPREAD||e.kind===Y.INLINE_FRAGMENT}function sn(e,t){var r=e.directives;return!r||!r.length?!0:D0(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=t&&t[a.value.name.value],ne(o!==void 0,70,i.name.value)):o=a.value.value,i.name.value==="skip"?!o:o})}function cn(e,t,r){var n=new Set(e),i=n.size;return Xt(t,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return La}}),r?!n.size:n.size<i}function _0(e){return e&&cn(["client","export"],e,!0)}function k0(e){var t=e.name.value;return t==="skip"||t==="include"}function D0(e){var t=[];return e&&e.length&&e.forEach(function(r){if(k0(r)){var n=r.arguments,i=r.name.value;ne(n&&n.length===1,71,i);var a=n[0];ne(a.name&&a.name.value==="if",72,i);var o=a.value;ne(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),73,i),t.push({directive:r,ifArgument:a})}}),t}const M0=()=>Object.create(null),{forEach:L0,slice:Ec}=Array.prototype,{hasOwnProperty:I0}=Object.prototype;let Pr=class kf{constructor(t=!0,r=M0){this.weakness=t,this.makeData=r}lookup(){return this.lookupArray(arguments)}lookupArray(t){let r=this;return L0.call(t,n=>r=r.getChildTrie(n)),I0.call(r,"data")?r.data:r.data=this.makeData(Ec.call(t))}peek(){return this.peekArray(arguments)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=r.mapFor(t[n],!1);r=a&&a.get(t[n])}return r&&r.data}remove(){return this.removeArray(arguments)}removeArray(t){let r;if(t.length){const n=t[0],i=this.mapFor(n,!1),a=i&&i.get(n);a&&(r=a.removeArray(Ec.call(t,1)),!a.data&&!a.weak&&!(a.strong&&a.strong.size)&&i.delete(n))}else r=this.data,delete this.data;return r}getChildTrie(t){const r=this.mapFor(t,!0);let n=r.get(t);return n||r.set(t,n=new kf(this.weakness,this.makeData)),n}mapFor(t,r){return this.weakness&&P0(t)?this.weak||(r?this.weak=new WeakMap:void 0):this.strong||(r?this.strong=new Map:void 0)}};function P0(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}var wc=Ft(function(){return navigator.product})=="ReactNative",Nr=typeof WeakMap=="function"&&!(wc&&!global.HermesInternal),xc=typeof WeakSet=="function",Ia=typeof Symbol=="function"&&typeof Symbol.for=="function",ui=Ia&&Symbol.asyncIterator,Oc=typeof Ft(function(){return window.document.createElement})=="function",N0=Ft(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,A0=(Oc||wc)&&!N0;function ze(e){return e!==null&&typeof e=="object"}function F0(e,t){var r=t,n=[];e.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw yt(74,a.operation,a.name?" named '".concat(a.name.value,"'"):"");a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(ne(n.length===1,75,n.length),r=n[0].name.value);var i=D(D({},e),{definitions:Et([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions,!0)});return i}function li(e){e===void 0&&(e=[]);var t={};return e.forEach(function(r){t[r.name.value]=r}),t}function fi(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{var r=e.name.value;if(typeof t=="function")return t(r);var n=t&&t[r];return ne(n,76,r),n||null}default:return null}}function R0(){}class Pa{constructor(t=1/0,r=R0){this.max=t,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}get size(){return this.map.size}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(t,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(t){const r=this.map.get(t);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(t),this.dispose(r.value,t),!0):!1}}function Na(){}const j0=Na,V0=typeof WeakRef<"u"?WeakRef:function(e){return{deref:()=>e}},q0=typeof WeakMap<"u"?WeakMap:Map,$0=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Na,unregister:Na}},U0=10024;class hi{constructor(t=1/0,r=j0){this.max=t,this.dispose=r,this.map=new q0,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const n=this.unfinalizedNodes.values();for(let i=0;i<U0;i++){const a=n.next().value;if(!a)break;this.unfinalizedNodes.delete(a);const o=a.key;delete a.key,a.keyRef=new V0(o),this.registry.register(o,a,a)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new $0(this.deleteNode.bind(this))}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(t,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(t){t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.size--;const r=t.key||t.keyRef&&t.keyRef.deref();this.dispose(t.value,r),t.keyRef?this.registry.unregister(t):this.unfinalizedNodes.delete(t),r&&this.map.delete(r)}delete(t){const r=this.map.get(t);return r?(this.deleteNode(r),!0):!1}scheduleFinalization(t){this.unfinalizedNodes.add(t),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Aa=new WeakSet;function Sc(e){e.size<=(e.max||-1)||Aa.has(e)||(Aa.add(e),setTimeout(function(){e.clean(),Aa.delete(e)},100))}var Fa=function(e,t){var r=new hi(e,t);return r.set=function(n,i){var a=hi.prototype.set.call(this,n,i);return Sc(this),a},r},B0=function(e,t){var r=new Pa(e,t);return r.set=function(n,i){var a=Pa.prototype.set.call(this,n,i);return Sc(this),a},r},z0=Symbol.for("apollo.cacheSize"),Ht=D({},wa[z0]),br={};function Ra(e,t){br[e]=t}var W0=globalThis.__DEV__!==!1?Y0:void 0,Q0=globalThis.__DEV__!==!1?K0:void 0,H0=globalThis.__DEV__!==!1?Tc:void 0;function G0(){var e={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(e).map(function(t){var r=t[0],n=t[1];return[r,Ht[r]||n]}))}function Y0(){var e,t,r,n,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:G0(),sizes:D({print:(e=br.print)===null||e===void 0?void 0:e.call(br),parser:(t=br.parser)===null||t===void 0?void 0:t.call(br),canonicalStringify:(r=br.canonicalStringify)===null||r===void 0?void 0:r.call(br),links:Va(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:_c(this.queryManager.documentTransform)}},(i=(n=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(n))}}function Tc(){return{cache:{fragmentQueryDocuments:ar(this.getFragmentDoc)}}}function K0(){var e=this.config.fragments;return D(D({},Tc.apply(this)),{addTypenameDocumentTransform:_c(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:ar(this.storeReader.executeSelectionSet),executeSubSelectedArray:ar(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:ar(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:ar(e==null?void 0:e.findFragmentSpreads),lookup:ar(e==null?void 0:e.lookup),transform:ar(e==null?void 0:e.transform)}})}function X0(e){return!!e&&"dirtyKey"in e}function ar(e){return X0(e)?e.size:void 0}function Cc(e){return e!=null}function _c(e){return ja(e).map(function(t){return{cache:t}})}function ja(e){return e?Et(Et([ar(e==null?void 0:e.performWork)],ja(e==null?void 0:e.left),!0),ja(e==null?void 0:e.right),!0).filter(Cc):[]}function Va(e){var t;return e?Et(Et([(t=e==null?void 0:e.getMemoryInternals)===null||t===void 0?void 0:t.call(e)],Va(e==null?void 0:e.left),!0),Va(e==null?void 0:e.right),!0).filter(Cc):[]}var or=Object.assign(function(t){return JSON.stringify(t,J0)},{reset:function(){Ar=new B0(Ht.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&Ra("canonicalStringify",function(){return Ar.size});var Ar;or.reset();function J0(e,t){if(t&&typeof t=="object"){var r=Object.getPrototypeOf(t);if(r===Object.prototype||r===null){var n=Object.keys(t);if(n.every(Z0))return t;var i=JSON.stringify(n),a=Ar.get(i);if(!a){n.sort();var o=JSON.stringify(n);a=Ar.get(o)||n,Ar.set(i,a),Ar.set(o,a)}var s=Object.create(r);return a.forEach(function(c){s[c]=t[c]}),s}}return t}function Z0(e,t,r){return t===0||r[t-1]<=e}function Fr(e){return{__ref:String(e)}}function Me(e){return!!(e&&typeof e=="object"&&typeof e.__ref=="string")}function ep(e){return ze(e)&&e.kind==="Document"&&Array.isArray(e.definitions)}function tp(e){return e.kind==="StringValue"}function rp(e){return e.kind==="BooleanValue"}function np(e){return e.kind==="IntValue"}function ip(e){return e.kind==="FloatValue"}function ap(e){return e.kind==="Variable"}function op(e){return e.kind==="ObjectValue"}function sp(e){return e.kind==="ListValue"}function cp(e){return e.kind==="EnumValue"}function up(e){return e.kind==="NullValue"}function Rr(e,t,r,n){if(np(r)||ip(r))e[t.value]=Number(r.value);else if(rp(r)||tp(r))e[t.value]=r.value;else if(op(r)){var i={};r.fields.map(function(o){return Rr(i,o.name,o.value,n)}),e[t.value]=i}else if(ap(r)){var a=(n||{})[r.name.value];e[t.value]=a}else if(sp(r))e[t.value]=r.values.map(function(o){var s={};return Rr(s,t,o,n),s[t.value]});else if(cp(r))e[t.value]=r.value;else if(up(r))e[t.value]=null;else throw yt(85,t.value,r.kind)}function lp(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return Rr(r[i.name.value],o,s,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(i){var a=i.name,o=i.value;return Rr(n,a,o,t)})),kc(e.name.value,n,r)}var fp=["connection","include","skip","client","rest","export","nonreactive"],un=or,kc=Object.assign(function(e,t,r){if(t&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=t[s]}),"".concat(r.connection.key,"(").concat(un(i),")")}else return r.connection.key;var a=e;if(t){var o=un(t);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){fp.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(un(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(e){var t=un;return un=e,t}});function di(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(n){var i=n.name,a=n.value;return Rr(r,i,a,t)}),r}return null}function sr(e){return e.alias?e.alias.value:e.name.value}function qa(e,t,r){for(var n,i=0,a=t.selections;i<a.length;i++){var o=a[i];if(cr(o)){if(o.name.value==="__typename")return e[sr(o)]}else n?n.push(o):n=[o]}if(typeof e.__typename=="string")return e.__typename;if(n)for(var s=0,c=n;s<c.length;s++){var o=c[s],u=qa(e,fi(o,r).selectionSet,r);if(typeof u=="string")return u}}function cr(e){return e.kind==="Field"}function hp(e){return e.kind==="InlineFragment"}function ln(e){ne(e&&e.kind==="Document",77);var t=e.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw yt(78,r.kind);return r});return ne(t.length<=1,79,t.length),e}function fn(e){return ln(e),e.definitions.filter(function(t){return t.kind==="OperationDefinition"})[0]}function $a(e){return e.definitions.filter(function(t){return t.kind==="OperationDefinition"&&!!t.name}).map(function(t){return t.name.value})[0]||null}function pi(e){return e.definitions.filter(function(t){return t.kind==="FragmentDefinition"})}function Dc(e){var t=fn(e);return ne(t&&t.operation==="query",80),t}function dp(e){ne(e.kind==="Document",81),ne(e.definitions.length<=1,82);var t=e.definitions[0];return ne(t.kind==="FragmentDefinition",83),t}function hn(e){ln(e);for(var t,r=0,n=e.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!t&&(t=i)}if(t)return t;throw yt(84)}function Ua(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Rr(t,n.variable.name,n.defaultValue)}),t}const pp=()=>Object.create(null),{forEach:gp,slice:vp}=Array.prototype,{hasOwnProperty:yp}=Object.prototype;class Ba{constructor(t=!0,r=pp){this.weakness=t,this.makeData=r}lookup(...t){return this.lookupArray(t)}lookupArray(t){let r=this;return gp.call(t,n=>r=r.getChildTrie(n)),yp.call(r,"data")?r.data:r.data=this.makeData(vp.call(t))}peek(...t){return this.peekArray(t)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=this.weakness&&Mc(t[n])?r.weak:r.strong;r=a&&a.get(t[n])}return r&&r.data}getChildTrie(t){const r=this.weakness&&Mc(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let n=r.get(t);return n||r.set(t,n=new Ba(this.weakness,this.makeData)),n}}function Mc(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}let lt=null;const Lc={};let mp=1;const bp=()=>class{constructor(){this.id=["slot",mp++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=lt;t;t=t.parent)if(this.id in t.slots){const r=t.slots[this.id];if(r===Lc)break;return t!==lt&&(lt.slots[this.id]=r),!0}return lt&&(lt.slots[this.id]=Lc),!1}getValue(){if(this.hasValue())return lt.slots[this.id]}withValue(t,r,n,i){const a={__proto__:null,[this.id]:t},o=lt;lt={parent:o,slots:a};try{return r.apply(i,n)}finally{lt=o}}static bind(t){const r=lt;return function(){const n=lt;try{return lt=r,t.apply(this,arguments)}finally{lt=n}}}static noContext(t,r,n){if(lt){const i=lt;try{return lt=null,t.apply(n,r)}finally{lt=i}}else return t.apply(n,r)}};function Ic(e){try{return e()}catch{}}const za="@wry/context:Slot",Pc=Ic(()=>globalThis)||Ic(()=>global)||Object.create(null),Nc=Pc[za]||Array[za]||function(e){try{Object.defineProperty(Pc,za,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(bp()),gi=new Nc,{hasOwnProperty:Ep}=Object.prototype,Wa=Array.from||function(e){const t=[];return e.forEach(r=>t.push(r)),t};function Qa(e){const{unsubscribe:t}=e;typeof t=="function"&&(e.unsubscribe=void 0,t())}const dn=[],wp=100;function jr(e,t){if(!e)throw new Error(t||"assertion failure")}function Ac(e,t){const r=e.length;return r>0&&r===t.length&&e[r-1]===t[r-1]}function Fc(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function Rc(e){return e.slice(0)}class vi{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++vi.count}peek(){if(this.value.length===1&&!ur(this))return jc(this),this.value[0]}recompute(t){return jr(!this.recomputing,"already recomputing"),jc(this),ur(this)?xp(this,t):Fc(this.value)}setDirty(){this.dirty||(this.dirty=!0,Vc(this),Qa(this))}dispose(){this.setDirty(),zc(this),Ha(this,(t,r)=>{t.setDirty(),Wc(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=dn.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(Wa(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),dn.push(this.deps),this.deps=null)}}vi.count=0;function jc(e){const t=gi.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),ur(e)?$c(t,e):Uc(t,e),t}function xp(e,t){return zc(e),gi.withValue(e,Op,[e,t]),Tp(e,t)&&Sp(e),Fc(e.value)}function Op(e,t){e.recomputing=!0;const{normalizeResult:r}=e;let n;r&&e.value.length===1&&(n=Rc(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),r&&n&&!Ac(n,e.value))try{e.value[0]=r(e.value[0],n[0])}catch{}}catch(i){e.value[1]=i}e.recomputing=!1}function ur(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function Sp(e){e.dirty=!1,!ur(e)&&qc(e)}function Vc(e){Ha(e,$c)}function qc(e){Ha(e,Uc)}function Ha(e,t){const r=e.parents.size;if(r){const n=Wa(e.parents);for(let i=0;i<r;++i)t(n[i],e)}}function $c(e,t){jr(e.childValues.has(t)),jr(ur(t));const r=!ur(e);if(!e.dirtyChildren)e.dirtyChildren=dn.pop()||new Set;else if(e.dirtyChildren.has(t))return;e.dirtyChildren.add(t),r&&Vc(e)}function Uc(e,t){jr(e.childValues.has(t)),jr(!ur(t));const r=e.childValues.get(t);r.length===0?e.childValues.set(t,Rc(t.value)):Ac(r,t.value)||e.setDirty(),Bc(e,t),!ur(e)&&qc(e)}function Bc(e,t){const r=e.dirtyChildren;r&&(r.delete(t),r.size===0&&(dn.length<wp&&dn.push(r),e.dirtyChildren=null))}function zc(e){e.childValues.size>0&&e.childValues.forEach((t,r)=>{Wc(e,r)}),e.forgetDeps(),jr(e.dirtyChildren===null)}function Wc(e,t){t.parents.delete(e),e.childValues.delete(t),Bc(e,t)}function Tp(e,t){if(typeof e.subscribe=="function")try{Qa(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}const Cp={setDirty:!0,dispose:!0,forget:!0};function Qc(e){const t=new Map;function r(n){const i=gi.getValue();if(i){let a=t.get(n);a||t.set(n,a=new Set),i.dependOn(a)}}return r.dirty=function(i,a){const o=t.get(i);if(o){const s=a&&Ep.call(Cp,a)?a:"setDirty";Wa(o).forEach(c=>c[s]()),t.delete(i),Qa(o)}},r}let Hc;function _p(...e){return(Hc||(Hc=new Ba(typeof WeakMap=="function"))).lookupArray(e)}const Ga=new Set;function pn(e,{max:t=Math.pow(2,16),keyArgs:r,makeCacheKey:n=_p,normalizeResult:i,subscribe:a,cache:o=Pa}=Object.create(null)){const s=typeof o=="function"?new o(t,f=>f.dispose()):o,c=function(){const f=n.apply(null,r?r.apply(null,arguments):arguments);if(f===void 0)return e.apply(null,arguments);let v=s.get(f);v||(s.set(f,v=new vi(e)),v.normalizeResult=i,v.subscribe=a,v.forget=()=>s.delete(f));const E=v.recompute(Array.prototype.slice.call(arguments));return s.set(f,v),Ga.add(s),gi.hasValue()||(Ga.forEach(x=>x.clean()),Ga.clear()),E};Object.defineProperty(c,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:t,keyArgs:r,makeCacheKey:n,normalizeResult:i,subscribe:a,cache:s});function u(f){const v=f&&s.get(f);v&&v.setDirty()}c.dirtyKey=u,c.dirty=function(){u(n.apply(null,arguments))};function l(f){const v=f&&s.get(f);if(v)return v.peek()}c.peekKey=l,c.peek=function(){return l(n.apply(null,arguments))};function d(f){return f?s.delete(f):!1}return c.forgetKey=d,c.forget=function(){return d(n.apply(null,arguments))},c.makeCacheKey=n,c.getKey=r?function(){return n.apply(null,r.apply(null,arguments))}:n,Object.freeze(c)}function kp(e){return e}var Gc=function(){function e(t,r){r===void 0&&(r=Object.create(null)),this.resultCache=xc?new WeakSet:new Set,this.transform=t,r.getCacheKey&&(this.getCacheKey=r.getCacheKey),this.cached=r.cache!==!1,this.resetCache()}return e.prototype.getCacheKey=function(t){return[t]},e.identity=function(){return new e(kp,{cache:!1})},e.split=function(t,r,n){return n===void 0&&(n=e.identity()),Object.assign(new e(function(i){var a=t(i)?r:n;return a.transformDocument(i)},{cache:!1}),{left:r,right:n})},e.prototype.resetCache=function(){var t=this;if(this.cached){var r=new Pr(Nr);this.performWork=pn(e.prototype.performWork.bind(this),{makeCacheKey:function(n){var i=t.getCacheKey(n);if(i)return ne(Array.isArray(i),69),r.lookupArray(i)},max:Ht["documentTransform.cache"],cache:hi})}},e.prototype.performWork=function(t){return ln(t),this.transform(t)},e.prototype.transformDocument=function(t){if(this.resultCache.has(t))return t;var r=this.performWork(t);return this.resultCache.add(r),r},e.prototype.concat=function(t){var r=this;return Object.assign(new e(function(n){return t.transformDocument(r.transformDocument(n))},{cache:!1}),{left:this,right:t})},e}(),gn,yi=Object.assign(function(e){var t=gn.get(e);return t||(t=S0(e),gn.set(e,t)),t},{reset:function(){gn=new Fa(Ht.print||2e3)}});yi.reset(),globalThis.__DEV__!==!1&&Ra("print",function(){return gn?gn.size:0});var We=Array.isArray;function Mt(e){return Array.isArray(e)&&e.length>0}var Yc={kind:Y.FIELD,name:{kind:Y.NAME,value:"__typename"}};function Kc(e,t){return!e||e.selectionSet.selections.every(function(r){return r.kind===Y.FRAGMENT_SPREAD&&Kc(t[r.name.value],t)})}function Dp(e){return Kc(fn(e)||dp(e),li(pi(e)))?null:e}function Mp(e){var t=new Map,r=new Map;return e.forEach(function(n){n&&(n.name?t.set(n.name,n):n.test&&r.set(n.test,n))}),function(n){var i=t.get(n.name.value);return!i&&r.size&&r.forEach(function(a,o){o(n)&&(i=a)}),i}}function Xc(e){var t=new Map;return function(n){n===void 0&&(n=e);var i=t.get(n);return i||t.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function Jc(e,t){ln(t);for(var r=Xc(""),n=Xc(""),i=function(S){for(var _=0,m=void 0;_<S.length&&(m=S[_]);++_)if(!We(m)){if(m.kind===Y.OPERATION_DEFINITION)return r(m.name&&m.name.value);if(m.kind===Y.FRAGMENT_DEFINITION)return n(m.name.value)}return globalThis.__DEV__!==!1&&ne.error(86),null},a=0,o=t.definitions.length-1;o>=0;--o)t.definitions[o].kind===Y.OPERATION_DEFINITION&&++a;var s=Mp(e),c=function(S){return Mt(S)&&S.map(s).some(function(_){return _&&_.remove})},u=new Map,l=!1,d={enter:function(S){if(c(S.directives))return l=!0,null}},f=Xt(t,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(S,_,m,C,O){var P=i(O);P&&P.variables.add(S.name.value)}},FragmentSpread:{enter:function(S,_,m,C,O){if(c(S.directives))return l=!0,null;var P=i(O);P&&P.fragmentSpreads.add(S.name.value)}},FragmentDefinition:{enter:function(S,_,m,C){u.set(JSON.stringify(C),S)},leave:function(S,_,m,C){var O=u.get(JSON.stringify(C));if(S===O)return S;if(a>0&&S.selectionSet.selections.every(function(P){return P.kind===Y.FIELD&&P.name.value==="__typename"}))return n(S.name.value).removed=!0,l=!0,null}},Directive:{leave:function(S){if(s(S))return l=!0,null}}});if(!l)return t;var v=function(S){return S.transitiveVars||(S.transitiveVars=new Set(S.variables),S.removed||S.fragmentSpreads.forEach(function(_){v(n(_)).transitiveVars.forEach(function(m){S.transitiveVars.add(m)})})),S},E=new Set;f.definitions.forEach(function(S){S.kind===Y.OPERATION_DEFINITION?v(r(S.name&&S.name.value)).fragmentSpreads.forEach(function(_){E.add(_)}):S.kind===Y.FRAGMENT_DEFINITION&&a===0&&!n(S.name.value).removed&&E.add(S.name.value)}),E.forEach(function(S){v(n(S)).fragmentSpreads.forEach(function(_){E.add(_)})});var x=function(S){return!!(!E.has(S)||n(S).removed)},T={enter:function(S){if(x(S.name.value))return null}};return Dp(Xt(f,{FragmentSpread:T,FragmentDefinition:T,OperationDefinition:{leave:function(S){if(S.variableDefinitions){var _=v(r(S.name&&S.name.value)).transitiveVars;if(_.size<S.variableDefinitions.length)return D(D({},S),{variableDefinitions:S.variableDefinitions.filter(function(m){return _.has(m.variable.name.value)})})}}}}))}var Ya=Object.assign(function(e){return Xt(e,{SelectionSet:{enter:function(t,r,n){if(!(n&&n.kind===Y.OPERATION_DEFINITION)){var i=t.selections;if(i){var a=i.some(function(s){return cr(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(cr(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return D(D({},t),{selections:Et(Et([],i,!0),[Yc],!1)})}}}}}})},{added:function(e){return e===Yc}});function Lp(e){var t=hn(e),r=t.operation;if(r==="query")return e;var n=Xt(e,{OperationDefinition:{enter:function(i){return D(D({},i),{operation:"query"})}}});return n}function Zc(e){ln(e);var t=Jc([{test:function(r){return r.name.value==="client"},remove:!0}],e);return t}var Ip=Object.prototype.hasOwnProperty;function eu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return mi(e)}function mi(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new lr,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var Pp=function(e,t,r){return this.merge(e[r],t[r])},lr=function(){function e(t){t===void 0&&(t=Pp),this.reconciler=t,this.isObject=ze,this.pastCopies=new Set}return e.prototype.merge=function(t,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return ze(r)&&ze(t)?(Object.keys(r).forEach(function(o){if(Ip.call(t,o)){var s=t[o];if(r[o]!==s){var c=n.reconciler.apply(n,Et([t,r,o],i,!1));c!==s&&(t=n.shallowCopyForMerge(t),t[o]=c)}}else t=n.shallowCopyForMerge(t),t[o]=r[o]}),t):r},e.prototype.shallowCopyForMerge=function(t){return ze(t)&&(this.pastCopies.has(t)||(Array.isArray(t)?t=t.slice(0):t=D({__proto__:Object.getPrototypeOf(t)},t),this.pastCopies.add(t))),t},e}();function Np(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Ap(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
162
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ap(e,t){if(e){if(typeof e=="string")return tu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tu(e,t)}}function tu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ru(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ka(e,t,r){return t&&ru(e.prototype,t),r&&ru(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Xa=function(){return typeof Symbol=="function"},Ja=function(e){return Xa()&&!!Symbol[e]},Za=function(e){return Ja(e)?Symbol[e]:"@@"+e};Xa()&&!Ja("observable")&&(Symbol.observable=Symbol("observable"));var Fp=Za("iterator"),eo=Za("observable"),nu=Za("species");function bi(e,t){var r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function vn(e){var t=e.constructor;return t!==void 0&&(t=t[nu],t===null&&(t=void 0)),t!==void 0?t:je}function Rp(e){return e instanceof je}function Vr(e){Vr.log?Vr.log(e):setTimeout(function(){throw e})}function Ei(e){Promise.resolve().then(function(){try{e()}catch(t){Vr(t)}})}function iu(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t=="function")t();else{var r=bi(t,"unsubscribe");r&&r.call(t)}}catch(n){Vr(n)}}function to(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function jp(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(au(e,t[r].type,t[r].value),e._state!=="closed");++r);}}function au(e,t,r){e._state="running";var n=e._observer;try{var i=bi(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(to(e),i)i.call(n,r);else throw r;break;case"complete":to(e),i&&i.call(n);break}}catch(a){Vr(a)}e._state==="closed"?iu(e):e._state==="running"&&(e._state="ready")}function ro(e,t,r){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:t,value:r});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:t,value:r}],Ei(function(){return jp(e)});return}au(e,t,r)}}var Vp=function(){function e(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new qp(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var t=e.prototype;return t.unsubscribe=function(){this._state!=="closed"&&(to(this),iu(this))},Ka(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e}(),qp=function(){function e(r){this._subscription=r}var t=e.prototype;return t.next=function(n){ro(this._subscription,"next",n)},t.error=function(n){ro(this._subscription,"error",n)},t.complete=function(){ro(this._subscription,"complete")},Ka(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e}(),je=function(){function e(r){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var t=e.prototype;return t.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Vp(n,this._subscriber)},t.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){c.unsubscribe(),a()}var c=i.subscribe({next:function(u){try{n(u,s)}catch(l){o(l),c.unsubscribe()}},error:o,complete:a})})},t.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(c){return o.error(c)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},t.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(c){return o.error(c)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},t.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this),o=arguments.length>1,s=!1,c=arguments[1],u=c;return new a(function(l){return i.subscribe({next:function(d){var f=!s;if(s=!0,!f||o)try{u=n(u,d)}catch(v){return l.error(v)}else u=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(u),l.complete()}})})},t.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=vn(this);return new s(function(c){var u,l=0;function d(f){u=f.subscribe({next:function(v){c.next(v)},error:function(v){c.error(v)},complete:function(){l===a.length?(u=void 0,c.complete()):d(s.from(a[l++]))}})}return d(n),function(){u&&(u.unsubscribe(),u=void 0)}})},t.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this);return new a(function(o){var s=[],c=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(f){return o.error(f)}var d=a.from(l).subscribe({next:function(f){o.next(f)},error:function(f){o.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,1),u()}});s.push(d)},error:function(l){o.error(l)},complete:function(){u()}});function u(){c.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),c.unsubscribe()}})},t[eo]=function(){return this},e.from=function(n){var i=typeof this=="function"?this:e;if(n==null)throw new TypeError(n+" is not an object");var a=bi(n,eo);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Rp(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Ja("iterator")&&(a=bi(n,Fp),a))return new i(function(s){Ei(function(){if(!s.closed){for(var c=Np(a.call(n)),u;!(u=c()).done;){var l=u.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){Ei(function(){if(!s.closed){for(var c=0;c<n.length;++c)if(s.next(n[c]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},e.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:e;return new o(function(s){Ei(function(){if(!s.closed){for(var c=0;c<i.length;++c)if(s.next(i[c]),s.closed)return;s.complete()}})})},Ka(e,null,[{key:nu,get:function(){return this}}]),e}();Xa()&&Object.defineProperty(je,Symbol("extensions"),{value:{symbol:eo,hostReportError:Vr},configurable:!0});function $p(e){var t,r=e.Symbol;if(typeof r=="function")if(r.observable)t=r.observable;else{typeof r.for=="function"?t=r.for("https://github.com/benlesh/symbol-observable"):t=r("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch{}}else t="@@observable";return t}var qr;typeof self<"u"?qr=self:typeof window<"u"?qr=window:typeof global<"u"?qr=global:typeof module<"u"?qr=module:qr=Function("return this")(),$p(qr);var ou=je.prototype,su="@@observable";ou[su]||(ou[su]=function(){return this});var Up=Object.prototype.toString;function cu(e){return no(e)}function no(e,t){switch(Up.call(e)){case"[object Array]":{if(t=t||new Map,t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(i,a){r[a]=no(i,t)}),r}case"[object Object]":{if(t=t||new Map,t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(i){n[i]=no(e[i],t)}),n}default:return e}}function Bp(e){var t=new Set([e]);return t.forEach(function(r){ze(r)&&zp(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ze(r[n])&&t.add(r[n])})}),e}function zp(e){if(globalThis.__DEV__!==!1&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function yn(e){return globalThis.__DEV__!==!1&&Bp(e),e}function mn(e,t,r){var n=[];e.forEach(function(i){return i[t]&&n.push(i)}),n.forEach(function(i){return i[t](r)})}function io(e,t,r){return new je(function(n){var i={then:function(c){return new Promise(function(u){return u(c())})}};function a(c,u){return function(l){if(c){var d=function(){return n.closed?0:c(l)};i=i.then(d,d).then(function(f){return n.next(f)},function(f){return n.error(f)})}else n[u](l)}}var o={next:a(t,"next"),error:a(r,"error"),complete:function(){i.then(function(){return n.complete()})}},s=e.subscribe(o);return function(){return s.unsubscribe()}})}function uu(e){function t(r){Object.defineProperty(e,r,{value:je})}return Ia&&Symbol.species&&t(Symbol.species),t("@@species"),e}function lu(e){return e&&typeof e.then=="function"}var $r=function(e){Qt(t,e);function t(r){var n=e.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),mn(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),mn(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var c=s.shift();c?lu(c)?c.then(function(u){return n.sub=u.subscribe(n.handlers)},n.handlers.error):n.sub=c.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),mn(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.error(i)},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new je(r)]),lu(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return t.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},t.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},t.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},t.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},t.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},t}(je);uu($r);function Ur(e){return"incremental"in e}function Wp(e){return"hasNext"in e&&"data"in e}function Qp(e){return Ur(e)||Wp(e)}function Hp(e){return ze(e)&&"payload"in e}function fu(e,t){var r=e,n=new lr;return Ur(t)&&Mt(t.incremental)&&t.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}r=n.merge(r,a)}),r}function wi(e){var t=ao(e);return Mt(t)}function ao(e){var t=Mt(e.errors)?e.errors.slice(0):[];return Ur(e)&&Mt(e.incremental)&&e.incremental.forEach(function(r){r.errors&&t.push.apply(t,r.errors)}),t}function Er(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach(function(n){n&&Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}function Br(e,t){return Er(e,t,t.variables&&{variables:Er(D(D({},e&&e.variables),t.variables))})}function oo(e){return new je(function(t){t.error(e)})}var hu=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function Gp(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw yt(44,i)}return e}function Yp(e,t){var r=D({},e),n=function(a){typeof a=="function"?r=D(D({},r),a(r)):r=D(D({},r),a)},i=function(){return D({},r)};return Object.defineProperty(t,"setContext",{enumerable:!1,value:n}),Object.defineProperty(t,"getContext",{enumerable:!1,value:i}),t}function Kp(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName=typeof t.query!="string"?$a(t.query)||void 0:""),t}function Xp(e,t){var r=D({},e),n=new Set(Object.keys(e));return Xt(t,{Variable:function(i,a,o){o&&o.kind!=="VariableDefinition"&&n.delete(i.name.value)}}),n.forEach(function(i){delete r[i]}),r}function du(e,t){return t?t(e):je.of()}function bn(e){return typeof e=="function"?new En(e):e}function xi(e){return e.request.length<=1}var En=function(){function e(t){t&&(this.request=t)}return e.empty=function(){return new e(function(){return je.of()})},e.from=function(t){return t.length===0?e.empty():t.map(bn).reduce(function(r,n){return r.concat(n)})},e.split=function(t,r,n){var i=bn(r),a=bn(n||new e(du)),o;return xi(i)&&xi(a)?o=new e(function(s){return t(s)?i.request(s)||je.of():a.request(s)||je.of()}):o=new e(function(s,c){return t(s)?i.request(s,c)||je.of():a.request(s,c)||je.of()}),Object.assign(o,{left:i,right:a})},e.execute=function(t,r){return t.request(Yp(r.context,Kp(Gp(r))))||je.of()},e.concat=function(t,r){var n=bn(t);if(xi(n))return globalThis.__DEV__!==!1&&ne.warn(36,n),n;var i=bn(r),a;return xi(i)?a=new e(function(o){return n.request(o,function(s){return i.request(s)||je.of()})||je.of()}):a=new e(function(o,s){return n.request(o,function(c){return i.request(c,s)||je.of()})||je.of()}),Object.assign(a,{left:n,right:i})},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(du)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(t,r){throw yt(37)},e.prototype.onError=function(t,r){if(r&&r.error)return r.error(t),!1;throw t},e.prototype.setOnError=function(t){return this.onError=t,this},e}(),so=En.execute;function Jp(e){var t,r=e[Symbol.asyncIterator]();return t={next:function(){return r.next()}},t[Symbol.asyncIterator]=function(){return this},t}function Zp(e){var t=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var f=a.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var f=a.slice();f.forEach(function(v){v[1](d)}),!t||t()}function c(){n=!0;var d=a.slice();d.forEach(function(f){f[0]({value:void 0,done:!0})}),!t||t()}t=function(){t=null,e.removeListener("data",o),e.removeListener("error",s),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",o),e.on("error",s),e.on("end",c),e.on("finish",c),e.on("close",c);function u(){return new Promise(function(d,f){if(r)return f(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,f])})}var l={next:function(){return u()}};return ui&&(l[Symbol.asyncIterator]=function(){return this}),l}function eg(e){var t=!1,r={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise(function(n,i){e.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return ui&&(r[Symbol.asyncIterator]=function(){return this}),r}function pu(e){var t={next:function(){return e.read()}};return ui&&(t[Symbol.asyncIterator]=function(){return this}),t}function tg(e){return!!e.body}function rg(e){return!!e.getReader}function ng(e){return!!(ui&&e[Symbol.asyncIterator])}function ig(e){return!!e.stream}function ag(e){return!!e.arrayBuffer}function og(e){return!!e.pipe}function sg(e){var t=e;if(tg(e)&&(t=e.body),ng(t))return Jp(t);if(rg(t))return pu(t.getReader());if(ig(t))return pu(t.stream().getReader());if(ag(t))return eg(t.arrayBuffer());if(og(t))return Zp(t);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var co=Symbol();function cg(e){return e.extensions?Array.isArray(e.extensions[co]):!1}function gu(e){return e.hasOwnProperty("graphQLErrors")}var ug=function(e){var t=Et(Et(Et([],e.graphQLErrors,!0),e.clientErrors,!0),e.protocolErrors,!0);return e.networkError&&t.push(e.networkError),t.map(function(r){return ze(r)&&r.message||"Error message not found."}).join(`
|
|
163
|
-
`)},Jt=function(e){Qt(t,e);function t(r){var n=r.graphQLErrors,i=r.protocolErrors,a=r.clientErrors,o=r.networkError,s=r.errorMessage,c=r.extraInfo,u=e.call(this,s)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.protocolErrors=i||[],u.clientErrors=a||[],u.networkError=o||null,u.message=s||ug(u),u.extraInfo=c,u.cause=Et(Et(Et([o],n||[],!0),i||[],!0),a||[],!0).find(function(l){return!!l})||null,u.__proto__=t.prototype,u}return t}(Error),vu=Object.prototype.hasOwnProperty;function lg(e,t){return nr(this,void 0,void 0,function(){var r,n,i,a,o,s,c,u,l,d,f,v,E,x,T,
|
|
164
|
-
--`.concat(a),s="",c=sg(e),u=!0,V.label=1;case 1:return u?[4,c.next()]:[3,3];case 2:for(l=V.sent(),d=l.value,f=l.done,v=typeof d=="string"?d:r.decode(d),E=s.length-o.length+1,u=!f,s+=v,x=s.indexOf(o,E);x>-1;){if(T=void 0,A=[s.slice(0,x),s.slice(x+o.length)],T=A[0],s=A[1],
|
|
161
|
+
`)))!==null&&t!==void 0?t:!1}function bc(e){return e.kind===G.FIELD||e.kind===G.FRAGMENT_SPREAD||e.kind===G.INLINE_FRAGMENT}function sn(e,t){var r=e.directives;return!r||!r.length?!0:D0(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=t&&t[a.value.name.value],ne(o!==void 0,70,i.name.value)):o=a.value.value,i.name.value==="skip"?!o:o})}function cn(e,t,r){var n=new Set(e),i=n.size;return Xt(t,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return La}}),r?!n.size:n.size<i}function _0(e){return e&&cn(["client","export"],e,!0)}function k0(e){var t=e.name.value;return t==="skip"||t==="include"}function D0(e){var t=[];return e&&e.length&&e.forEach(function(r){if(k0(r)){var n=r.arguments,i=r.name.value;ne(n&&n.length===1,71,i);var a=n[0];ne(a.name&&a.name.value==="if",72,i);var o=a.value;ne(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),73,i),t.push({directive:r,ifArgument:a})}}),t}const M0=()=>Object.create(null),{forEach:L0,slice:Ec}=Array.prototype,{hasOwnProperty:I0}=Object.prototype;let Pr=class kf{constructor(t=!0,r=M0){this.weakness=t,this.makeData=r}lookup(){return this.lookupArray(arguments)}lookupArray(t){let r=this;return L0.call(t,n=>r=r.getChildTrie(n)),I0.call(r,"data")?r.data:r.data=this.makeData(Ec.call(t))}peek(){return this.peekArray(arguments)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=r.mapFor(t[n],!1);r=a&&a.get(t[n])}return r&&r.data}remove(){return this.removeArray(arguments)}removeArray(t){let r;if(t.length){const n=t[0],i=this.mapFor(n,!1),a=i&&i.get(n);a&&(r=a.removeArray(Ec.call(t,1)),!a.data&&!a.weak&&!(a.strong&&a.strong.size)&&i.delete(n))}else r=this.data,delete this.data;return r}getChildTrie(t){const r=this.mapFor(t,!0);let n=r.get(t);return n||r.set(t,n=new kf(this.weakness,this.makeData)),n}mapFor(t,r){return this.weakness&&P0(t)?this.weak||(r?this.weak=new WeakMap:void 0):this.strong||(r?this.strong=new Map:void 0)}};function P0(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}var wc=Ft(function(){return navigator.product})=="ReactNative",Nr=typeof WeakMap=="function"&&!(wc&&!global.HermesInternal),xc=typeof WeakSet=="function",Ia=typeof Symbol=="function"&&typeof Symbol.for=="function",ui=Ia&&Symbol.asyncIterator,Sc=typeof Ft(function(){return window.document.createElement})=="function",N0=Ft(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,A0=(Sc||wc)&&!N0;function He(e){return e!==null&&typeof e=="object"}function F0(e,t){var r=t,n=[];e.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw yt(74,a.operation,a.name?" named '".concat(a.name.value,"'"):"");a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(ne(n.length===1,75,n.length),r=n[0].name.value);var i=D(D({},e),{definitions:Et([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions,!0)});return i}function li(e){e===void 0&&(e=[]);var t={};return e.forEach(function(r){t[r.name.value]=r}),t}function fi(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{var r=e.name.value;if(typeof t=="function")return t(r);var n=t&&t[r];return ne(n,76,r),n||null}default:return null}}function R0(){}class Pa{constructor(t=1/0,r=R0){this.max=t,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}get size(){return this.map.size}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(t,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(t){const r=this.map.get(t);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(t),this.dispose(r.value,t),!0):!1}}function Na(){}const j0=Na,V0=typeof WeakRef<"u"?WeakRef:function(e){return{deref:()=>e}},q0=typeof WeakMap<"u"?WeakMap:Map,$0=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Na,unregister:Na}},U0=10024;class di{constructor(t=1/0,r=j0){this.max=t,this.dispose=r,this.map=new q0,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const n=this.unfinalizedNodes.values();for(let i=0;i<U0;i++){const a=n.next().value;if(!a)break;this.unfinalizedNodes.delete(a);const o=a.key;delete a.key,a.keyRef=new V0(o),this.registry.register(o,a,a)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new $0(this.deleteNode.bind(this))}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(t,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(t){t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.size--;const r=t.key||t.keyRef&&t.keyRef.deref();this.dispose(t.value,r),t.keyRef?this.registry.unregister(t):this.unfinalizedNodes.delete(t),r&&this.map.delete(r)}delete(t){const r=this.map.get(t);return r?(this.deleteNode(r),!0):!1}scheduleFinalization(t){this.unfinalizedNodes.add(t),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Aa=new WeakSet;function Oc(e){e.size<=(e.max||-1)||Aa.has(e)||(Aa.add(e),setTimeout(function(){e.clean(),Aa.delete(e)},100))}var Fa=function(e,t){var r=new di(e,t);return r.set=function(n,i){var a=di.prototype.set.call(this,n,i);return Oc(this),a},r},B0=function(e,t){var r=new Pa(e,t);return r.set=function(n,i){var a=Pa.prototype.set.call(this,n,i);return Oc(this),a},r},H0=Symbol.for("apollo.cacheSize"),Wt=D({},wa[H0]),br={};function Ra(e,t){br[e]=t}var z0=globalThis.__DEV__!==!1?Y0:void 0,Q0=globalThis.__DEV__!==!1?K0:void 0,W0=globalThis.__DEV__!==!1?Tc:void 0;function G0(){var e={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(e).map(function(t){var r=t[0],n=t[1];return[r,Wt[r]||n]}))}function Y0(){var e,t,r,n,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:G0(),sizes:D({print:(e=br.print)===null||e===void 0?void 0:e.call(br),parser:(t=br.parser)===null||t===void 0?void 0:t.call(br),canonicalStringify:(r=br.canonicalStringify)===null||r===void 0?void 0:r.call(br),links:Va(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:_c(this.queryManager.documentTransform)}},(i=(n=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(n))}}function Tc(){return{cache:{fragmentQueryDocuments:ar(this.getFragmentDoc)}}}function K0(){var e=this.config.fragments;return D(D({},Tc.apply(this)),{addTypenameDocumentTransform:_c(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:ar(this.storeReader.executeSelectionSet),executeSubSelectedArray:ar(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:ar(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:ar(e==null?void 0:e.findFragmentSpreads),lookup:ar(e==null?void 0:e.lookup),transform:ar(e==null?void 0:e.transform)}})}function X0(e){return!!e&&"dirtyKey"in e}function ar(e){return X0(e)?e.size:void 0}function Cc(e){return e!=null}function _c(e){return ja(e).map(function(t){return{cache:t}})}function ja(e){return e?Et(Et([ar(e==null?void 0:e.performWork)],ja(e==null?void 0:e.left),!0),ja(e==null?void 0:e.right),!0).filter(Cc):[]}function Va(e){var t;return e?Et(Et([(t=e==null?void 0:e.getMemoryInternals)===null||t===void 0?void 0:t.call(e)],Va(e==null?void 0:e.left),!0),Va(e==null?void 0:e.right),!0).filter(Cc):[]}var or=Object.assign(function(t){return JSON.stringify(t,J0)},{reset:function(){Ar=new B0(Wt.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&Ra("canonicalStringify",function(){return Ar.size});var Ar;or.reset();function J0(e,t){if(t&&typeof t=="object"){var r=Object.getPrototypeOf(t);if(r===Object.prototype||r===null){var n=Object.keys(t);if(n.every(Z0))return t;var i=JSON.stringify(n),a=Ar.get(i);if(!a){n.sort();var o=JSON.stringify(n);a=Ar.get(o)||n,Ar.set(i,a),Ar.set(o,a)}var s=Object.create(r);return a.forEach(function(c){s[c]=t[c]}),s}}return t}function Z0(e,t,r){return t===0||r[t-1]<=e}function Fr(e){return{__ref:String(e)}}function Me(e){return!!(e&&typeof e=="object"&&typeof e.__ref=="string")}function ep(e){return He(e)&&e.kind==="Document"&&Array.isArray(e.definitions)}function tp(e){return e.kind==="StringValue"}function rp(e){return e.kind==="BooleanValue"}function np(e){return e.kind==="IntValue"}function ip(e){return e.kind==="FloatValue"}function ap(e){return e.kind==="Variable"}function op(e){return e.kind==="ObjectValue"}function sp(e){return e.kind==="ListValue"}function cp(e){return e.kind==="EnumValue"}function up(e){return e.kind==="NullValue"}function Rr(e,t,r,n){if(np(r)||ip(r))e[t.value]=Number(r.value);else if(rp(r)||tp(r))e[t.value]=r.value;else if(op(r)){var i={};r.fields.map(function(o){return Rr(i,o.name,o.value,n)}),e[t.value]=i}else if(ap(r)){var a=(n||{})[r.name.value];e[t.value]=a}else if(sp(r))e[t.value]=r.values.map(function(o){var s={};return Rr(s,t,o,n),s[t.value]});else if(cp(r))e[t.value]=r.value;else if(up(r))e[t.value]=null;else throw yt(85,t.value,r.kind)}function lp(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return Rr(r[i.name.value],o,s,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(i){var a=i.name,o=i.value;return Rr(n,a,o,t)})),kc(e.name.value,n,r)}var fp=["connection","include","skip","client","rest","export","nonreactive"],un=or,kc=Object.assign(function(e,t,r){if(t&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=t[s]}),"".concat(r.connection.key,"(").concat(un(i),")")}else return r.connection.key;var a=e;if(t){var o=un(t);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){fp.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(un(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(e){var t=un;return un=e,t}});function hi(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(n){var i=n.name,a=n.value;return Rr(r,i,a,t)}),r}return null}function sr(e){return e.alias?e.alias.value:e.name.value}function qa(e,t,r){for(var n,i=0,a=t.selections;i<a.length;i++){var o=a[i];if(cr(o)){if(o.name.value==="__typename")return e[sr(o)]}else n?n.push(o):n=[o]}if(typeof e.__typename=="string")return e.__typename;if(n)for(var s=0,c=n;s<c.length;s++){var o=c[s],u=qa(e,fi(o,r).selectionSet,r);if(typeof u=="string")return u}}function cr(e){return e.kind==="Field"}function dp(e){return e.kind==="InlineFragment"}function ln(e){ne(e&&e.kind==="Document",77);var t=e.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw yt(78,r.kind);return r});return ne(t.length<=1,79,t.length),e}function fn(e){return ln(e),e.definitions.filter(function(t){return t.kind==="OperationDefinition"})[0]}function $a(e){return e.definitions.filter(function(t){return t.kind==="OperationDefinition"&&!!t.name}).map(function(t){return t.name.value})[0]||null}function pi(e){return e.definitions.filter(function(t){return t.kind==="FragmentDefinition"})}function Dc(e){var t=fn(e);return ne(t&&t.operation==="query",80),t}function hp(e){ne(e.kind==="Document",81),ne(e.definitions.length<=1,82);var t=e.definitions[0];return ne(t.kind==="FragmentDefinition",83),t}function dn(e){ln(e);for(var t,r=0,n=e.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!t&&(t=i)}if(t)return t;throw yt(84)}function Ua(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Rr(t,n.variable.name,n.defaultValue)}),t}const pp=()=>Object.create(null),{forEach:gp,slice:vp}=Array.prototype,{hasOwnProperty:yp}=Object.prototype;class Ba{constructor(t=!0,r=pp){this.weakness=t,this.makeData=r}lookup(...t){return this.lookupArray(t)}lookupArray(t){let r=this;return gp.call(t,n=>r=r.getChildTrie(n)),yp.call(r,"data")?r.data:r.data=this.makeData(vp.call(t))}peek(...t){return this.peekArray(t)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=this.weakness&&Mc(t[n])?r.weak:r.strong;r=a&&a.get(t[n])}return r&&r.data}getChildTrie(t){const r=this.weakness&&Mc(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let n=r.get(t);return n||r.set(t,n=new Ba(this.weakness,this.makeData)),n}}function Mc(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}let lt=null;const Lc={};let mp=1;const bp=()=>class{constructor(){this.id=["slot",mp++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=lt;t;t=t.parent)if(this.id in t.slots){const r=t.slots[this.id];if(r===Lc)break;return t!==lt&&(lt.slots[this.id]=r),!0}return lt&&(lt.slots[this.id]=Lc),!1}getValue(){if(this.hasValue())return lt.slots[this.id]}withValue(t,r,n,i){const a={__proto__:null,[this.id]:t},o=lt;lt={parent:o,slots:a};try{return r.apply(i,n)}finally{lt=o}}static bind(t){const r=lt;return function(){const n=lt;try{return lt=r,t.apply(this,arguments)}finally{lt=n}}}static noContext(t,r,n){if(lt){const i=lt;try{return lt=null,t.apply(n,r)}finally{lt=i}}else return t.apply(n,r)}};function Ic(e){try{return e()}catch{}}const Ha="@wry/context:Slot",Pc=Ic(()=>globalThis)||Ic(()=>global)||Object.create(null),Nc=Pc[Ha]||Array[Ha]||function(e){try{Object.defineProperty(Pc,Ha,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(bp()),gi=new Nc,{hasOwnProperty:Ep}=Object.prototype,za=Array.from||function(e){const t=[];return e.forEach(r=>t.push(r)),t};function Qa(e){const{unsubscribe:t}=e;typeof t=="function"&&(e.unsubscribe=void 0,t())}const hn=[],wp=100;function jr(e,t){if(!e)throw new Error(t||"assertion failure")}function Ac(e,t){const r=e.length;return r>0&&r===t.length&&e[r-1]===t[r-1]}function Fc(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function Rc(e){return e.slice(0)}class vi{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++vi.count}peek(){if(this.value.length===1&&!ur(this))return jc(this),this.value[0]}recompute(t){return jr(!this.recomputing,"already recomputing"),jc(this),ur(this)?xp(this,t):Fc(this.value)}setDirty(){this.dirty||(this.dirty=!0,Vc(this),Qa(this))}dispose(){this.setDirty(),Hc(this),Wa(this,(t,r)=>{t.setDirty(),zc(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=hn.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(za(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),hn.push(this.deps),this.deps=null)}}vi.count=0;function jc(e){const t=gi.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),ur(e)?$c(t,e):Uc(t,e),t}function xp(e,t){return Hc(e),gi.withValue(e,Sp,[e,t]),Tp(e,t)&&Op(e),Fc(e.value)}function Sp(e,t){e.recomputing=!0;const{normalizeResult:r}=e;let n;r&&e.value.length===1&&(n=Rc(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),r&&n&&!Ac(n,e.value))try{e.value[0]=r(e.value[0],n[0])}catch{}}catch(i){e.value[1]=i}e.recomputing=!1}function ur(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function Op(e){e.dirty=!1,!ur(e)&&qc(e)}function Vc(e){Wa(e,$c)}function qc(e){Wa(e,Uc)}function Wa(e,t){const r=e.parents.size;if(r){const n=za(e.parents);for(let i=0;i<r;++i)t(n[i],e)}}function $c(e,t){jr(e.childValues.has(t)),jr(ur(t));const r=!ur(e);if(!e.dirtyChildren)e.dirtyChildren=hn.pop()||new Set;else if(e.dirtyChildren.has(t))return;e.dirtyChildren.add(t),r&&Vc(e)}function Uc(e,t){jr(e.childValues.has(t)),jr(!ur(t));const r=e.childValues.get(t);r.length===0?e.childValues.set(t,Rc(t.value)):Ac(r,t.value)||e.setDirty(),Bc(e,t),!ur(e)&&qc(e)}function Bc(e,t){const r=e.dirtyChildren;r&&(r.delete(t),r.size===0&&(hn.length<wp&&hn.push(r),e.dirtyChildren=null))}function Hc(e){e.childValues.size>0&&e.childValues.forEach((t,r)=>{zc(e,r)}),e.forgetDeps(),jr(e.dirtyChildren===null)}function zc(e,t){t.parents.delete(e),e.childValues.delete(t),Bc(e,t)}function Tp(e,t){if(typeof e.subscribe=="function")try{Qa(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}const Cp={setDirty:!0,dispose:!0,forget:!0};function Qc(e){const t=new Map;function r(n){const i=gi.getValue();if(i){let a=t.get(n);a||t.set(n,a=new Set),i.dependOn(a)}}return r.dirty=function(i,a){const o=t.get(i);if(o){const s=a&&Ep.call(Cp,a)?a:"setDirty";za(o).forEach(c=>c[s]()),t.delete(i),Qa(o)}},r}let Wc;function _p(...e){return(Wc||(Wc=new Ba(typeof WeakMap=="function"))).lookupArray(e)}const Ga=new Set;function pn(e,{max:t=Math.pow(2,16),keyArgs:r,makeCacheKey:n=_p,normalizeResult:i,subscribe:a,cache:o=Pa}=Object.create(null)){const s=typeof o=="function"?new o(t,f=>f.dispose()):o,c=function(){const f=n.apply(null,r?r.apply(null,arguments):arguments);if(f===void 0)return e.apply(null,arguments);let v=s.get(f);v||(s.set(f,v=new vi(e)),v.normalizeResult=i,v.subscribe=a,v.forget=()=>s.delete(f));const E=v.recompute(Array.prototype.slice.call(arguments));return s.set(f,v),Ga.add(s),gi.hasValue()||(Ga.forEach(x=>x.clean()),Ga.clear()),E};Object.defineProperty(c,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:t,keyArgs:r,makeCacheKey:n,normalizeResult:i,subscribe:a,cache:s});function u(f){const v=f&&s.get(f);v&&v.setDirty()}c.dirtyKey=u,c.dirty=function(){u(n.apply(null,arguments))};function l(f){const v=f&&s.get(f);if(v)return v.peek()}c.peekKey=l,c.peek=function(){return l(n.apply(null,arguments))};function d(f){return f?s.delete(f):!1}return c.forgetKey=d,c.forget=function(){return d(n.apply(null,arguments))},c.makeCacheKey=n,c.getKey=r?function(){return n.apply(null,r.apply(null,arguments))}:n,Object.freeze(c)}function kp(e){return e}var Gc=function(){function e(t,r){r===void 0&&(r=Object.create(null)),this.resultCache=xc?new WeakSet:new Set,this.transform=t,r.getCacheKey&&(this.getCacheKey=r.getCacheKey),this.cached=r.cache!==!1,this.resetCache()}return e.prototype.getCacheKey=function(t){return[t]},e.identity=function(){return new e(kp,{cache:!1})},e.split=function(t,r,n){return n===void 0&&(n=e.identity()),Object.assign(new e(function(i){var a=t(i)?r:n;return a.transformDocument(i)},{cache:!1}),{left:r,right:n})},e.prototype.resetCache=function(){var t=this;if(this.cached){var r=new Pr(Nr);this.performWork=pn(e.prototype.performWork.bind(this),{makeCacheKey:function(n){var i=t.getCacheKey(n);if(i)return ne(Array.isArray(i),69),r.lookupArray(i)},max:Wt["documentTransform.cache"],cache:di})}},e.prototype.performWork=function(t){return ln(t),this.transform(t)},e.prototype.transformDocument=function(t){if(this.resultCache.has(t))return t;var r=this.performWork(t);return this.resultCache.add(r),r},e.prototype.concat=function(t){var r=this;return Object.assign(new e(function(n){return t.transformDocument(r.transformDocument(n))},{cache:!1}),{left:this,right:t})},e}(),gn,yi=Object.assign(function(e){var t=gn.get(e);return t||(t=O0(e),gn.set(e,t)),t},{reset:function(){gn=new Fa(Wt.print||2e3)}});yi.reset(),globalThis.__DEV__!==!1&&Ra("print",function(){return gn?gn.size:0});var ze=Array.isArray;function Mt(e){return Array.isArray(e)&&e.length>0}var Yc={kind:G.FIELD,name:{kind:G.NAME,value:"__typename"}};function Kc(e,t){return!e||e.selectionSet.selections.every(function(r){return r.kind===G.FRAGMENT_SPREAD&&Kc(t[r.name.value],t)})}function Dp(e){return Kc(fn(e)||hp(e),li(pi(e)))?null:e}function Mp(e){var t=new Map,r=new Map;return e.forEach(function(n){n&&(n.name?t.set(n.name,n):n.test&&r.set(n.test,n))}),function(n){var i=t.get(n.name.value);return!i&&r.size&&r.forEach(function(a,o){o(n)&&(i=a)}),i}}function Xc(e){var t=new Map;return function(n){n===void 0&&(n=e);var i=t.get(n);return i||t.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function Jc(e,t){ln(t);for(var r=Xc(""),n=Xc(""),i=function(O){for(var _=0,m=void 0;_<O.length&&(m=O[_]);++_)if(!ze(m)){if(m.kind===G.OPERATION_DEFINITION)return r(m.name&&m.name.value);if(m.kind===G.FRAGMENT_DEFINITION)return n(m.name.value)}return globalThis.__DEV__!==!1&&ne.error(86),null},a=0,o=t.definitions.length-1;o>=0;--o)t.definitions[o].kind===G.OPERATION_DEFINITION&&++a;var s=Mp(e),c=function(O){return Mt(O)&&O.map(s).some(function(_){return _&&_.remove})},u=new Map,l=!1,d={enter:function(O){if(c(O.directives))return l=!0,null}},f=Xt(t,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(O,_,m,C,S){var P=i(S);P&&P.variables.add(O.name.value)}},FragmentSpread:{enter:function(O,_,m,C,S){if(c(O.directives))return l=!0,null;var P=i(S);P&&P.fragmentSpreads.add(O.name.value)}},FragmentDefinition:{enter:function(O,_,m,C){u.set(JSON.stringify(C),O)},leave:function(O,_,m,C){var S=u.get(JSON.stringify(C));if(O===S)return O;if(a>0&&O.selectionSet.selections.every(function(P){return P.kind===G.FIELD&&P.name.value==="__typename"}))return n(O.name.value).removed=!0,l=!0,null}},Directive:{leave:function(O){if(s(O))return l=!0,null}}});if(!l)return t;var v=function(O){return O.transitiveVars||(O.transitiveVars=new Set(O.variables),O.removed||O.fragmentSpreads.forEach(function(_){v(n(_)).transitiveVars.forEach(function(m){O.transitiveVars.add(m)})})),O},E=new Set;f.definitions.forEach(function(O){O.kind===G.OPERATION_DEFINITION?v(r(O.name&&O.name.value)).fragmentSpreads.forEach(function(_){E.add(_)}):O.kind===G.FRAGMENT_DEFINITION&&a===0&&!n(O.name.value).removed&&E.add(O.name.value)}),E.forEach(function(O){v(n(O)).fragmentSpreads.forEach(function(_){E.add(_)})});var x=function(O){return!!(!E.has(O)||n(O).removed)},T={enter:function(O){if(x(O.name.value))return null}};return Dp(Xt(f,{FragmentSpread:T,FragmentDefinition:T,OperationDefinition:{leave:function(O){if(O.variableDefinitions){var _=v(r(O.name&&O.name.value)).transitiveVars;if(_.size<O.variableDefinitions.length)return D(D({},O),{variableDefinitions:O.variableDefinitions.filter(function(m){return _.has(m.variable.name.value)})})}}}}))}var Ya=Object.assign(function(e){return Xt(e,{SelectionSet:{enter:function(t,r,n){if(!(n&&n.kind===G.OPERATION_DEFINITION)){var i=t.selections;if(i){var a=i.some(function(s){return cr(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(cr(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return D(D({},t),{selections:Et(Et([],i,!0),[Yc],!1)})}}}}}})},{added:function(e){return e===Yc}});function Lp(e){var t=dn(e),r=t.operation;if(r==="query")return e;var n=Xt(e,{OperationDefinition:{enter:function(i){return D(D({},i),{operation:"query"})}}});return n}function Zc(e){ln(e);var t=Jc([{test:function(r){return r.name.value==="client"},remove:!0}],e);return t}var Ip=Object.prototype.hasOwnProperty;function eu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return mi(e)}function mi(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new lr,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var Pp=function(e,t,r){return this.merge(e[r],t[r])},lr=function(){function e(t){t===void 0&&(t=Pp),this.reconciler=t,this.isObject=He,this.pastCopies=new Set}return e.prototype.merge=function(t,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return He(r)&&He(t)?(Object.keys(r).forEach(function(o){if(Ip.call(t,o)){var s=t[o];if(r[o]!==s){var c=n.reconciler.apply(n,Et([t,r,o],i,!1));c!==s&&(t=n.shallowCopyForMerge(t),t[o]=c)}}else t=n.shallowCopyForMerge(t),t[o]=r[o]}),t):r},e.prototype.shallowCopyForMerge=function(t){return He(t)&&(this.pastCopies.has(t)||(Array.isArray(t)?t=t.slice(0):t=D({__proto__:Object.getPrototypeOf(t)},t),this.pastCopies.add(t))),t},e}();function Np(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Ap(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
162
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ap(e,t){if(e){if(typeof e=="string")return tu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tu(e,t)}}function tu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ru(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ka(e,t,r){return t&&ru(e.prototype,t),r&&ru(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Xa=function(){return typeof Symbol=="function"},Ja=function(e){return Xa()&&!!Symbol[e]},Za=function(e){return Ja(e)?Symbol[e]:"@@"+e};Xa()&&!Ja("observable")&&(Symbol.observable=Symbol("observable"));var Fp=Za("iterator"),eo=Za("observable"),nu=Za("species");function bi(e,t){var r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function vn(e){var t=e.constructor;return t!==void 0&&(t=t[nu],t===null&&(t=void 0)),t!==void 0?t:je}function Rp(e){return e instanceof je}function Vr(e){Vr.log?Vr.log(e):setTimeout(function(){throw e})}function Ei(e){Promise.resolve().then(function(){try{e()}catch(t){Vr(t)}})}function iu(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t=="function")t();else{var r=bi(t,"unsubscribe");r&&r.call(t)}}catch(n){Vr(n)}}function to(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function jp(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(au(e,t[r].type,t[r].value),e._state!=="closed");++r);}}function au(e,t,r){e._state="running";var n=e._observer;try{var i=bi(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(to(e),i)i.call(n,r);else throw r;break;case"complete":to(e),i&&i.call(n);break}}catch(a){Vr(a)}e._state==="closed"?iu(e):e._state==="running"&&(e._state="ready")}function ro(e,t,r){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:t,value:r});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:t,value:r}],Ei(function(){return jp(e)});return}au(e,t,r)}}var Vp=function(){function e(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new qp(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var t=e.prototype;return t.unsubscribe=function(){this._state!=="closed"&&(to(this),iu(this))},Ka(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e}(),qp=function(){function e(r){this._subscription=r}var t=e.prototype;return t.next=function(n){ro(this._subscription,"next",n)},t.error=function(n){ro(this._subscription,"error",n)},t.complete=function(){ro(this._subscription,"complete")},Ka(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e}(),je=function(){function e(r){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var t=e.prototype;return t.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Vp(n,this._subscriber)},t.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){c.unsubscribe(),a()}var c=i.subscribe({next:function(u){try{n(u,s)}catch(l){o(l),c.unsubscribe()}},error:o,complete:a})})},t.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(c){return o.error(c)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},t.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(c){return o.error(c)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},t.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this),o=arguments.length>1,s=!1,c=arguments[1],u=c;return new a(function(l){return i.subscribe({next:function(d){var f=!s;if(s=!0,!f||o)try{u=n(u,d)}catch(v){return l.error(v)}else u=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(u),l.complete()}})})},t.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=vn(this);return new s(function(c){var u,l=0;function d(f){u=f.subscribe({next:function(v){c.next(v)},error:function(v){c.error(v)},complete:function(){l===a.length?(u=void 0,c.complete()):d(s.from(a[l++]))}})}return d(n),function(){u&&(u.unsubscribe(),u=void 0)}})},t.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this);return new a(function(o){var s=[],c=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(f){return o.error(f)}var d=a.from(l).subscribe({next:function(f){o.next(f)},error:function(f){o.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,1),u()}});s.push(d)},error:function(l){o.error(l)},complete:function(){u()}});function u(){c.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),c.unsubscribe()}})},t[eo]=function(){return this},e.from=function(n){var i=typeof this=="function"?this:e;if(n==null)throw new TypeError(n+" is not an object");var a=bi(n,eo);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Rp(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Ja("iterator")&&(a=bi(n,Fp),a))return new i(function(s){Ei(function(){if(!s.closed){for(var c=Np(a.call(n)),u;!(u=c()).done;){var l=u.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){Ei(function(){if(!s.closed){for(var c=0;c<n.length;++c)if(s.next(n[c]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},e.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:e;return new o(function(s){Ei(function(){if(!s.closed){for(var c=0;c<i.length;++c)if(s.next(i[c]),s.closed)return;s.complete()}})})},Ka(e,null,[{key:nu,get:function(){return this}}]),e}();Xa()&&Object.defineProperty(je,Symbol("extensions"),{value:{symbol:eo,hostReportError:Vr},configurable:!0});function $p(e){var t,r=e.Symbol;if(typeof r=="function")if(r.observable)t=r.observable;else{typeof r.for=="function"?t=r.for("https://github.com/benlesh/symbol-observable"):t=r("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch{}}else t="@@observable";return t}var qr;typeof self<"u"?qr=self:typeof window<"u"?qr=window:typeof global<"u"?qr=global:typeof module<"u"?qr=module:qr=Function("return this")(),$p(qr);var ou=je.prototype,su="@@observable";ou[su]||(ou[su]=function(){return this});var Up=Object.prototype.toString;function cu(e){return no(e)}function no(e,t){switch(Up.call(e)){case"[object Array]":{if(t=t||new Map,t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(i,a){r[a]=no(i,t)}),r}case"[object Object]":{if(t=t||new Map,t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(i){n[i]=no(e[i],t)}),n}default:return e}}function Bp(e){var t=new Set([e]);return t.forEach(function(r){He(r)&&Hp(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){He(r[n])&&t.add(r[n])})}),e}function Hp(e){if(globalThis.__DEV__!==!1&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function yn(e){return globalThis.__DEV__!==!1&&Bp(e),e}function mn(e,t,r){var n=[];e.forEach(function(i){return i[t]&&n.push(i)}),n.forEach(function(i){return i[t](r)})}function io(e,t,r){return new je(function(n){var i={then:function(c){return new Promise(function(u){return u(c())})}};function a(c,u){return function(l){if(c){var d=function(){return n.closed?0:c(l)};i=i.then(d,d).then(function(f){return n.next(f)},function(f){return n.error(f)})}else n[u](l)}}var o={next:a(t,"next"),error:a(r,"error"),complete:function(){i.then(function(){return n.complete()})}},s=e.subscribe(o);return function(){return s.unsubscribe()}})}function uu(e){function t(r){Object.defineProperty(e,r,{value:je})}return Ia&&Symbol.species&&t(Symbol.species),t("@@species"),e}function lu(e){return e&&typeof e.then=="function"}var $r=function(e){Qt(t,e);function t(r){var n=e.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),mn(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),mn(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var c=s.shift();c?lu(c)?c.then(function(u){return n.sub=u.subscribe(n.handlers)},n.handlers.error):n.sub=c.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),mn(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.error(i)},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new je(r)]),lu(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return t.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},t.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},t.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},t.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},t.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},t}(je);uu($r);function Ur(e){return"incremental"in e}function zp(e){return"hasNext"in e&&"data"in e}function Qp(e){return Ur(e)||zp(e)}function Wp(e){return He(e)&&"payload"in e}function fu(e,t){var r=e,n=new lr;return Ur(t)&&Mt(t.incremental)&&t.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}r=n.merge(r,a)}),r}function wi(e){var t=ao(e);return Mt(t)}function ao(e){var t=Mt(e.errors)?e.errors.slice(0):[];return Ur(e)&&Mt(e.incremental)&&e.incremental.forEach(function(r){r.errors&&t.push.apply(t,r.errors)}),t}function Er(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach(function(n){n&&Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}function Br(e,t){return Er(e,t,t.variables&&{variables:Er(D(D({},e&&e.variables),t.variables))})}function oo(e){return new je(function(t){t.error(e)})}var du=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function Gp(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw yt(44,i)}return e}function Yp(e,t){var r=D({},e),n=function(a){typeof a=="function"?r=D(D({},r),a(r)):r=D(D({},r),a)},i=function(){return D({},r)};return Object.defineProperty(t,"setContext",{enumerable:!1,value:n}),Object.defineProperty(t,"getContext",{enumerable:!1,value:i}),t}function Kp(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName=typeof t.query!="string"?$a(t.query)||void 0:""),t}function Xp(e,t){var r=D({},e),n=new Set(Object.keys(e));return Xt(t,{Variable:function(i,a,o){o&&o.kind!=="VariableDefinition"&&n.delete(i.name.value)}}),n.forEach(function(i){delete r[i]}),r}function hu(e,t){return t?t(e):je.of()}function bn(e){return typeof e=="function"?new En(e):e}function xi(e){return e.request.length<=1}var En=function(){function e(t){t&&(this.request=t)}return e.empty=function(){return new e(function(){return je.of()})},e.from=function(t){return t.length===0?e.empty():t.map(bn).reduce(function(r,n){return r.concat(n)})},e.split=function(t,r,n){var i=bn(r),a=bn(n||new e(hu)),o;return xi(i)&&xi(a)?o=new e(function(s){return t(s)?i.request(s)||je.of():a.request(s)||je.of()}):o=new e(function(s,c){return t(s)?i.request(s,c)||je.of():a.request(s,c)||je.of()}),Object.assign(o,{left:i,right:a})},e.execute=function(t,r){return t.request(Yp(r.context,Kp(Gp(r))))||je.of()},e.concat=function(t,r){var n=bn(t);if(xi(n))return globalThis.__DEV__!==!1&&ne.warn(36,n),n;var i=bn(r),a;return xi(i)?a=new e(function(o){return n.request(o,function(s){return i.request(s)||je.of()})||je.of()}):a=new e(function(o,s){return n.request(o,function(c){return i.request(c,s)||je.of()})||je.of()}),Object.assign(a,{left:n,right:i})},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(hu)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(t,r){throw yt(37)},e.prototype.onError=function(t,r){if(r&&r.error)return r.error(t),!1;throw t},e.prototype.setOnError=function(t){return this.onError=t,this},e}(),so=En.execute;function Jp(e){var t,r=e[Symbol.asyncIterator]();return t={next:function(){return r.next()}},t[Symbol.asyncIterator]=function(){return this},t}function Zp(e){var t=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var f=a.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var f=a.slice();f.forEach(function(v){v[1](d)}),!t||t()}function c(){n=!0;var d=a.slice();d.forEach(function(f){f[0]({value:void 0,done:!0})}),!t||t()}t=function(){t=null,e.removeListener("data",o),e.removeListener("error",s),e.removeListener("end",c),e.removeListener("finish",c),e.removeListener("close",c)},e.on("data",o),e.on("error",s),e.on("end",c),e.on("finish",c),e.on("close",c);function u(){return new Promise(function(d,f){if(r)return f(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,f])})}var l={next:function(){return u()}};return ui&&(l[Symbol.asyncIterator]=function(){return this}),l}function eg(e){var t=!1,r={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise(function(n,i){e.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return ui&&(r[Symbol.asyncIterator]=function(){return this}),r}function pu(e){var t={next:function(){return e.read()}};return ui&&(t[Symbol.asyncIterator]=function(){return this}),t}function tg(e){return!!e.body}function rg(e){return!!e.getReader}function ng(e){return!!(ui&&e[Symbol.asyncIterator])}function ig(e){return!!e.stream}function ag(e){return!!e.arrayBuffer}function og(e){return!!e.pipe}function sg(e){var t=e;if(tg(e)&&(t=e.body),ng(t))return Jp(t);if(rg(t))return pu(t.getReader());if(ig(t))return pu(t.stream().getReader());if(ag(t))return eg(t.arrayBuffer());if(og(t))return Zp(t);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var co=Symbol();function cg(e){return e.extensions?Array.isArray(e.extensions[co]):!1}function gu(e){return e.hasOwnProperty("graphQLErrors")}var ug=function(e){var t=Et(Et(Et([],e.graphQLErrors,!0),e.clientErrors,!0),e.protocolErrors,!0);return e.networkError&&t.push(e.networkError),t.map(function(r){return He(r)&&r.message||"Error message not found."}).join(`
|
|
163
|
+
`)},Jt=function(e){Qt(t,e);function t(r){var n=r.graphQLErrors,i=r.protocolErrors,a=r.clientErrors,o=r.networkError,s=r.errorMessage,c=r.extraInfo,u=e.call(this,s)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.protocolErrors=i||[],u.clientErrors=a||[],u.networkError=o||null,u.message=s||ug(u),u.extraInfo=c,u.cause=Et(Et(Et([o],n||[],!0),i||[],!0),a||[],!0).find(function(l){return!!l})||null,u.__proto__=t.prototype,u}return t}(Error),vu=Object.prototype.hasOwnProperty;function lg(e,t){return nr(this,void 0,void 0,function(){var r,n,i,a,o,s,c,u,l,d,f,v,E,x,T,O,_,m,C,S,P,A,j,U;return ir(this,function(V){switch(V.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");r=new TextDecoder("utf-8"),n=(U=e.headers)===null||U===void 0?void 0:U.get("content-type"),i="boundary=",a=n!=null&&n.includes(i)?n==null?void 0:n.substring((n==null?void 0:n.indexOf(i))+i.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",o=`\r
|
|
164
|
+
--`.concat(a),s="",c=sg(e),u=!0,V.label=1;case 1:return u?[4,c.next()]:[3,3];case 2:for(l=V.sent(),d=l.value,f=l.done,v=typeof d=="string"?d:r.decode(d),E=s.length-o.length+1,u=!f,s+=v,x=s.indexOf(o,E);x>-1;){if(T=void 0,A=[s.slice(0,x),s.slice(x+o.length)],T=A[0],s=A[1],O=T.indexOf(`\r
|
|
165
165
|
\r
|
|
166
|
-
`),_=fg(T.slice(0,
|
|
167
|
-
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();t[i]=a}}),t}function yu(e,t){if(e.status>=300){var r=function(){try{return JSON.parse(t)}catch{return t}};hu(e,r(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(i){var n=i;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}function hg(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}function dg(e){return function(t){return t.text().then(function(r){return yu(t,r)}).then(function(r){return!Array.isArray(r)&&!vu.call(r,"data")&&!vu.call(r,"errors")&&hu(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(n){return n.operationName}):e.operationName,"'.")),r})}}var uo=function(e,t){var r;try{r=JSON.stringify(e)}catch(i){var n=yt(40,t,i.message);throw n.parseError=i,n}return r},pg={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},gg={accept:"*/*","content-type":"application/json"},vg={method:"POST"},yg={http:pg,headers:gg,options:vg},mg=function(e,t){return t(e)};function bg(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=D(D(D({},i),d.options),{headers:D(D({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=D(D({},a),d.http)}),i.headers&&(i.headers=Eg(i.headers,a.preserveHeaderCase));var o=e.operationName,s=e.extensions,c=e.variables,u=e.query,l={operationName:o,variables:c};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=t(u,yi)),{options:i,body:l}}function Eg(e,t){if(!t){var r={};return Object.keys(Object(e)).forEach(function(a){r[a.toLowerCase()]=e[a]}),r}var n={};Object.keys(Object(e)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:e[a]}});var i={};return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var wg=function(e){if(!e&&typeof fetch>"u")throw yt(38)},xg=function(e,t){var r=e.getContext(),n=r.uri;return n||(typeof t=="function"?t(e):t||"/graphql")};function Og(e,t){var r=[],n=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=uo(t.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(t.extensions){var a=void 0;try{a=uo(t.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=e,c=e.indexOf("#");c!==-1&&(o=e.substr(c),s=e.substr(0,c));var u=s.indexOf("?")===-1?"?":"&",l=s+u+r.join("&")+o;return{newURI:l}}var mu=Ft(function(){return fetch}),Sg=function(e){e===void 0&&(e={});var t=e.uri,r=t===void 0?"/graphql":t,n=e.fetch,i=e.print,a=i===void 0?mg:i,o=e.includeExtensions,s=e.preserveHeaderCase,c=e.useGETForQueries,u=e.includeUnusedVariables,l=u===void 0?!1:u,d=At(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&wg(n||mu);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new En(function(v){var E=xg(v,r),x=v.getContext(),T={};if(x.clientAwareness){var S=x.clientAwareness,_=S.name,m=S.version;_&&(T["apollographql-client-name"]=_),m&&(T["apollographql-client-version"]=m)}var C=D(D({},T),x.headers),O={http:x.http,options:x.fetchOptions,credentials:x.credentials,headers:C};if(cn(["client"],v.query)){var P=Zc(v.query);if(!P)return oo(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`."));v.query=P}var A=bg(v,a,yg,f,O),j=A.options,U=A.body;U.variables&&!l&&(U.variables=Xp(U.variables,v.query));var V;!j.signal&&typeof AbortController<"u"&&(V=new AbortController,j.signal=V.signal);var me=function(Z){return Z.kind==="OperationDefinition"&&Z.operation==="mutation"},Le=function(Z){return Z.kind==="OperationDefinition"&&Z.operation==="subscription"},ye=Le(hn(v.query)),Oe=cn(["defer"],v.query);if(c&&!v.query.definitions.some(me)&&(j.method="GET"),Oe||ye){j.headers=j.headers||{};var Ve="multipart/mixed;";ye&&Oe&&globalThis.__DEV__!==!1&&ne.warn(39),ye?Ve+="boundary=graphql;subscriptionSpec=1.0,application/json":Oe&&(Ve+="deferSpec=20220824,application/json"),j.headers.accept=Ve}if(j.method==="GET"){var Pe=Og(E,U),K=Pe.newURI,$=Pe.parseError;if($)return oo($);E=K}else try{j.body=uo(U,"Payload")}catch(Z){return oo(Z)}return new je(function(Z){var N=n||Ft(function(){return fetch})||mu,R=Z.next.bind(Z);return N(E,j).then(function(X){var se;v.setContext({response:X});var ee=(se=X.headers)===null||se===void 0?void 0:se.get("content-type");return ee!==null&&/^multipart\/mixed/i.test(ee)?lg(X,R):dg(v)(X).then(R)}).then(function(){V=void 0,Z.complete()}).catch(function(X){V=void 0,hg(X,Z)}),function(){V&&V.abort()}})})},Tg=function(e){Qt(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,Sg(r).request)||this;return n.options=r,n}return t}(En);const{toString:bu,hasOwnProperty:Cg}=Object.prototype,Eu=Function.prototype.toString,lo=new Map;function Ae(e,t){try{return fo(e,t)}finally{lo.clear()}}function fo(e,t){if(e===t)return!0;const r=bu.call(e),n=bu.call(t);if(r!==n)return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(xu(e,t))return!0;const i=wu(e),a=wu(t),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Cg.call(t,i[s]))return!1;for(let s=0;s<o;++s){const c=i[s];if(!fo(e[c],t[c]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!==e)return t!==t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(xu(e,t))return!0;const i=e.entries(),a=r==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[s,c]=o.value;if(!t.has(s)||a&&!fo(c,t.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]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let i=e.byteLength;if(i===t.byteLength)for(;i--&&e[i]===t[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=Eu.call(e);return i!==Eu.call(t)?!1:!Dg(i,kg)}}return!1}function wu(e){return Object.keys(e).filter(_g,e)}function _g(e){return this[e]!==void 0}const kg="{ [native code] }";function Dg(e,t){const r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function xu(e,t){let r=lo.get(e);if(r){if(r.has(t))return!0}else lo.set(e,r=new Set);return r.add(t),!1}function Ou(e,t,r,n){var i=t.data,a=At(t,["data"]),o=r.data,s=At(r,["data"]);return Ae(a,s)&&Oi(hn(e).selectionSet,i,o,{fragmentMap:li(pi(e)),variables:n})}function Oi(e,t,r,n){if(t===r)return!0;var i=new Set;return e.selections.every(function(a){if(i.has(a)||(i.add(a),!sn(a,n.variables))||Su(a))return!0;if(cr(a)){var o=sr(a),s=t&&t[o],c=r&&r[o],u=a.selectionSet;if(!u)return Ae(s,c);var l=Array.isArray(s),d=Array.isArray(c);if(l!==d)return!1;if(l&&d){var f=s.length;if(c.length!==f)return!1;for(var v=0;v<f;++v)if(!Oi(u,s[v],c[v],n))return!1;return!0}return Oi(u,s,c,n)}else{var E=fi(a,n.fragmentMap);if(E)return Su(E)?!0:Oi(E.selectionSet,t,r,n)}})}function Su(e){return!!e.directives&&e.directives.some(Mg)}function Mg(e){return e.name.value==="nonreactive"}var Tu=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=pn(F0,{max:Ht["cache.fragmentQueryDocuments"]||1e3,cache:hi})}return e.prototype.batch=function(t){var r=this,n=typeof t.optimistic=="string"?t.optimistic:t.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=t.update(r)},n),i},e.prototype.recordOptimisticTransaction=function(t,r){this.performTransaction(t,r)},e.prototype.transformDocument=function(t){return t},e.prototype.transformForLink=function(t){return t},e.prototype.identify=function(t){},e.prototype.gc=function(){return[]},e.prototype.modify=function(t){return!1},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(D(D({},t),{rootId:t.id||"ROOT_QUERY",optimistic:r}))},e.prototype.watchFragment=function(t){var r=this,n=t.fragment,i=t.fragmentName,a=t.from,o=t.optimistic,s=o===void 0?!0:o,c=At(t,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(n,i),l=D(D({},c),{returnPartialData:!0,id:typeof a>"u"||typeof a=="string"?a:this.identify(a),query:u,optimistic:s}),d;return new je(function(f){return r.watch(D(D({},l),{immediate:!0,callback:function(v){if(!(d&&Ou(u,{data:d==null?void 0:d.result},{data:v.result}))){var E={data:v.result,complete:!!v.complete};v.missing&&(E.missing=mi(v.missing.map(function(x){return x.missing}))),d=v,f.next(E)}}}))})},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(D(D({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:r}))},e.prototype.writeQuery=function(t){var r=t.id,n=t.data,i=At(t,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(t){var r=t.id,n=t.data,i=t.fragment,a=t.fragmentName,o=At(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},e.prototype.updateQuery=function(t,r){return this.batch({update:function(n){var i=n.readQuery(t),a=r(i);return a==null?i:(n.writeQuery(D(D({},t),{data:a})),a)}})},e.prototype.updateFragment=function(t,r){return this.batch({update:function(n){var i=n.readFragment(t),a=r(i);return a==null?i:(n.writeFragment(D(D({},t),{data:a})),a)}})},e}();globalThis.__DEV__!==!1&&(Tu.prototype.getMemoryInternals=H0);var Cu=function(e){Qt(t,e);function t(r,n,i,a){var o,s=e.call(this,r)||this;if(s.message=r,s.path=n,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__=t.prototype,s}return t}(Error),it=Object.prototype.hasOwnProperty;function wn(e){return e==null}function _u(e,t){var r=e.__typename,n=e.id,i=e._id;if(typeof r=="string"&&(t&&(t.keyObject=wn(n)?wn(i)?void 0:{_id:i}:{id:n}),wn(n)&&!wn(i)&&(n=i),!wn(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var ku={dataIdFromObject:_u,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Lg(e){return Er(ku,e)}function Du(e){var t=e.canonizeResults;return t===void 0?ku.canonizeResults:t}function Ig(e,t){return Me(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var Mu=/^[_a-z][_0-9a-z]*/i;function fr(e){var t=e.match(Mu);return t?t[0]:e}function ho(e,t,r){return ze(t)?We(t)?t.every(function(n){return ho(e,n,r)}):e.selections.every(function(n){if(cr(n)&&sn(n,r)){var i=sr(n);return it.call(t,i)&&(!n.selectionSet||ho(n.selectionSet,t[i],r))}return!0}):!1}function zr(e){return ze(e)&&!Me(e)&&!We(e)}function Pg(){return new lr}function Lu(e,t){var r=li(pi(e));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&t&&(i=t.lookup(n)),i||null}}}var Si=Object.create(null),po=function(){return Si},Iu=Object.create(null),xn=function(){function e(t,r){var n=this;this.policies=t,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return yn(Me(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return Me(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Fr(i);if(Me(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Fr(o);return a&&n.merge(o,i),s}}}return e.prototype.toObject=function(){return D({},this.data)},e.prototype.has=function(t){return this.lookup(t,!0)!==void 0},e.prototype.get=function(t,r){if(this.group.depend(t,r),it.call(this.data,t)){var n=this.data[t];if(n&&it.call(n,r))return n[r]}if(r==="__typename"&&it.call(this.policies.rootTypenamesById,t))return this.policies.rootTypenamesById[t];if(this instanceof hr)return this.parent.get(t,r)},e.prototype.lookup=function(t,r){if(r&&this.group.depend(t,"__exists"),it.call(this.data,t))return this.data[t];if(this instanceof hr)return this.parent.lookup(t,r);if(this.policies.rootTypenamesById[t])return Object.create(null)},e.prototype.merge=function(t,r){var n=this,i;Me(t)&&(t=t.__ref),Me(r)&&(r=r.__ref);var a=typeof t=="string"?this.lookup(i=t):t,o=typeof r=="string"?this.lookup(i=r):r;if(o){ne(typeof i=="string",1);var s=new lr(Ag).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=fr(u);l!==u&&!n.policies.hasKeyArgs(s.__typename,l)&&(c[l]=1),s[u]===void 0&&!(n instanceof hr)&&delete s[u]}}),c.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete c.__typename,Object.keys(c).forEach(function(u){return n.group.dirty(i,u)})}}},e.prototype.modify=function(t,r){var n=this,i=this.lookup(t);if(i){var a=Object.create(null),o=!1,s=!0,c={DELETE:Si,INVALIDATE:Iu,isReference:Me,toReference:this.toReference,canRead:this.canRead,readField:function(u,l){return n.policies.readField(typeof u=="string"?{fieldName:u,from:l||Fr(t)}:u,{store:n})}};if(Object.keys(i).forEach(function(u){var l=fr(u),d=i[u];if(d!==void 0){var f=typeof r=="function"?r:r[u]||r[l];if(f){var v=f===po?Si:f(yn(d),D(D({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(t,u)}));if(v===Iu)n.group.dirty(t,u);else if(v===Si&&(v=void 0),v!==d&&(a[u]=v,o=!0,d=v,globalThis.__DEV__!==!1)){var E=function(O){if(n.lookup(O.__ref)===void 0)return globalThis.__DEV__!==!1&&ne.warn(2,O),!0};if(Me(v))E(v);else if(Array.isArray(v))for(var x=!1,T=void 0,S=0,_=v;S<_.length;S++){var m=_[S];if(Me(m)){if(x=!0,E(m))break}else if(typeof m=="object"&&m){var C=n.policies.identify(m)[0];C&&(T=m)}if(x&&T!==void 0){globalThis.__DEV__!==!1&&ne.warn(3,T);break}}}}d!==void 0&&(s=!1)}}),o)return this.merge(t,a),s&&(this instanceof hr?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},e.prototype.delete=function(t,r,n){var i,a=this.lookup(t);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(t,s?(i={},i[s]=po,i):po)}return!1},e.prototype.evict=function(t,r){var n=!1;return t.id&&(it.call(this.data,t.id)&&(n=this.delete(t.id,t.fieldName,t.args)),this instanceof hr&&this!==r&&(n=this.parent.evict(t,r)||n),(t.fieldName||n)&&this.group.dirty(t.id,t.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var t=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){it.call(t.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},e.prototype.replace=function(t){var r=this;if(Object.keys(this.data).forEach(function(a){t&&it.call(t,a)||r.delete(a)}),t){var n=t.__META,i=At(t,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(t){return this.rootIds[t]=(this.rootIds[t]||0)+1},e.prototype.release=function(t){if(this.rootIds[t]>0){var r=--this.rootIds[t];return r||delete this.rootIds[t],r}return 0},e.prototype.getRootIdSet=function(t){return t===void 0&&(t=new Set),Object.keys(this.rootIds).forEach(t.add,t),this instanceof hr?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t},e.prototype.gc=function(){var t=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){it.call(n,o)&&(Object.keys(t.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof hr;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},e.prototype.findChildRefIds=function(t){if(!it.call(this.refs,t)){var r=this.refs[t]=Object.create(null),n=this.data[t];if(!n)return r;var i=new Set([n]);i.forEach(function(a){Me(a)&&(r[a.__ref]=!0),ze(a)&&Object.keys(a).forEach(function(o){var s=a[o];ze(s)&&i.add(s)})})}return this.refs[t]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Pu=function(){function e(t,r){r===void 0&&(r=null),this.caching=t,this.parent=r,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?Qc():null,this.keyMaker=new Pr(Nr)},e.prototype.depend=function(t,r){if(this.d){this.d(go(t,r));var n=fr(r);n!==r&&this.d(go(t,n)),this.parent&&this.parent.depend(t,r)}},e.prototype.dirty=function(t,r){this.d&&this.d.dirty(go(t,r),r==="__exists"?"forget":"setDirty")},e}();function go(e,t){return t+"#"+e}function Nu(e,t){On(e)&&e.group.depend(t,"__exists")}(function(e){var t=function(r){Qt(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,c=i.seed,u=r.call(this,a,new Pu(s))||this;return u.stump=new Ng(u),u.storageTrie=new Pr(Nr),c&&u.replace(c),u}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(e);e.Root=t})(xn||(xn={}));var hr=function(e){Qt(t,e);function t(r,n,i,a){var o=e.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return t.prototype.addLayer=function(r,n){return new t(r,this,n,this.group)},t.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(c){Ae(o[c],s[c])||n.group.dirty(a,c)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(c){n.group.dirty(a,c)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return D(D({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return it.call(this.data,r)?D(D({},n),e.prototype.findChildRefIds.call(this,r)):n},t.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},t}(xn),Ng=function(e){Qt(t,e);function t(r){return e.call(this,"EntityStore.Stump",r,function(){},new Pu(r.group.caching,r.group))||this}return t.prototype.removeLayer=function(){return this},t.prototype.merge=function(r,n){return this.parent.merge(r,n)},t}(hr);function Ag(e,t,r){var n=e[r],i=t[r];return Ae(n,i)?n:i}function On(e){return!!(e instanceof xn&&e.group.caching)}function Fg(e){return ze(e)?We(e)?e.slice(0):D({__proto__:Object.getPrototypeOf(e)},e):e}var Au=function(){function e(){this.known=new(xc?WeakSet:Set),this.pool=new Pr(Nr),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(t){return ze(t)&&this.known.has(t)},e.prototype.pass=function(t){if(ze(t)){var r=Fg(t);return this.passes.set(r,t),r}return t},e.prototype.admit=function(t){var r=this;if(ze(t)){var n=this.passes.get(t);if(n)return n;var i=Object.getPrototypeOf(t);switch(i){case Array.prototype:{if(this.known.has(t))return t;var a=t.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(t))return t;var s=Object.getPrototypeOf(t),c=[s],u=this.sortedKeys(t);c.push(u.json);var l=c.length;u.sorted.forEach(function(v){c.push(r.admit(t[v]))});var o=this.pool.lookupArray(c);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),u.sorted.forEach(function(v,E){d[v]=c[l+E]}),globalThis.__DEV__!==!1&&Object.freeze(d)}return o.object}}}return t},e.prototype.sortedKeys=function(t){var r=Object.keys(t),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},e}();function Fu(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Rg=function(){function e(t){var r=this;this.knownResults=new(Nr?WeakMap:Map),this.config=Er(t,{addTypename:t.addTypename!==!1,canonizeResults:Du(t)}),this.canon=t.canon||new Au,this.executeSelectionSet=pn(function(n){var i,a=n.context.canonizeResults,o=Fu(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?D(D({},s),{result:r.canon.admit(s.result)}):s:(Nu(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize||Ht["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Fu,makeCacheKey:function(n,i,a,o){if(On(a.store))return a.store.makeCacheKey(n,Me(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=pn(function(n){return Nu(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize||Ht["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(On(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return e.prototype.resetCanon=function(){this.canon=new Au},e.prototype.diffQueryAgainstStore=function(t){var r=t.store,n=t.query,i=t.rootId,a=i===void 0?"ROOT_QUERY":i,o=t.variables,s=t.returnPartialData,c=s===void 0?!0:s,u=t.canonizeResults,l=u===void 0?this.config.canonizeResults:u,d=this.config.cache.policies;o=D(D({},Ua(Dc(n))),o);var f=Fr(a),v=this.executeSelectionSet({selectionSet:hn(n).selectionSet,objectOrReference:f,enclosingRef:f,context:D({store:r,query:n,policies:d,variables:o,varString:or(o),canonizeResults:l},Lu(n,this.config.fragments))}),E;if(v.missing&&(E=[new Cu(jg(v.missing),v.missing,n,o)],!c))throw E[0];return{result:v.result,complete:!E,missing:E}},e.prototype.isFresh=function(t,r,n,i){if(On(i.store)&&this.knownResults.get(t)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(t));if(a&&t===a.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(t){var r=this,n=t.selectionSet,i=t.objectOrReference,a=t.enclosingRef,o=t.context;if(Me(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"),d=[],f,v=new lr;this.config.addTypename&&typeof l=="string"&&!c.rootIdsByTypename[l]&&d.push({__typename:l});function E(m,C){var O;return m.missing&&(f=v.merge(f,(O={},O[C]=m.missing,O))),m.result}var x=new Set(n.selections);x.forEach(function(m){var C,O;if(sn(m,s))if(cr(m)){var P=c.readField({fieldName:m.name.value,field:m,variables:o.variables,from:i},o),A=sr(m);P===void 0?Ya.added(m)||(f=v.merge(f,(C={},C[A]="Can't find field '".concat(m.name.value,"' on ").concat(Me(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),C))):We(P)?P.length>0&&(P=E(r.executeSubSelectedArray({field:m,array:P,enclosingRef:a,context:o}),A)):m.selectionSet?P!=null&&(P=E(r.executeSelectionSet({selectionSet:m.selectionSet,objectOrReference:P,enclosingRef:Me(P)?P:a,context:o}),A)):o.canonizeResults&&(P=r.canon.pass(P)),P!==void 0&&d.push((O={},O[A]=P,O))}else{var j=fi(m,o.lookupFragment);if(!j&&m.kind===Y.FRAGMENT_SPREAD)throw yt(9,m.name.value);j&&c.fragmentMatches(j,l)&&j.selectionSet.selections.forEach(x.add,x)}});var T=mi(d),S={result:T,missing:f},_=o.canonizeResults?this.canon.admit(S):yn(S);return _.result&&this.knownResults.set(_.result,n),_},e.prototype.execSubSelectedArrayImpl=function(t){var r=this,n=t.field,i=t.array,a=t.enclosingRef,o=t.context,s,c=new lr;function u(l,d){var f;return l.missing&&(s=c.merge(s,(f={},f[d]=l.missing,f))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:We(l)?u(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?u(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:Me(l)?l:a,context:o}),d):(globalThis.__DEV__!==!1&&Vg(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},e}();function jg(e){try{JSON.stringify(e,function(t,r){if(typeof r=="string")throw r;return r})}catch(t){return t}}function Vg(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach(function(i){ze(i)&&(ne(!Me(i),10,Ig(e,i),t.name.value),Object.values(i).forEach(n.add,n))})}}var vo=new Nc,Ru=new WeakMap;function Sn(e){var t=Ru.get(e);return t||Ru.set(e,t={vars:new Set,dep:Qc()}),t}function ju(e){Sn(e).vars.forEach(function(t){return t.forgetCache(e)})}function qg(e){Sn(e).vars.forEach(function(t){return t.attachCache(e)})}function $g(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(c){Sn(c).dep.dirty(n),Ug(c)});var o=Array.from(r);r.clear(),o.forEach(function(c){return c(e)})}}else{var s=vo.getValue();s&&(i(s),Sn(s).dep(n))}return e};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return t.add(a),Sn(a).vars.add(n),n};return n.forgetCache=function(a){return t.delete(a)},n}function Ug(e){e.broadcastWatches&&e.broadcastWatches()}var Vu=Object.create(null);function yo(e){var t=JSON.stringify(e);return Vu[t]||(Vu[t]=Object.create(null))}function qu(e){var t=yo(e);return t.keyFieldsFn||(t.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=mo(e,function(o){var s=Wr(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&it.call(r,o[0])&&(s=Wr(r,o,Bu)),ne(s!==void 0,4,o.join("."),r),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function $u(e){var t=yo(e);return t.keyArgsFn||(t.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=mo(e,function(u){var l=u[0],d=l.charAt(0);if(d==="@"){if(i&&Mt(i.directives)){var f=l.slice(1),v=i.directives.find(function(S){return S.name.value===f}),E=v&&di(v,a);return E&&Wr(E,u.slice(1))}return}if(d==="$"){var x=l.slice(1);if(a&&it.call(a,x)){var T=u.slice(0);return T[0]=x,Wr(a,T)}return}if(r)return Wr(r,u)}),c=JSON.stringify(s);return(r||c!=="{}")&&(o+=":"+c),o})}function mo(e,t){var r=new lr;return Uu(e).reduce(function(n,i){var a,o=t(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function Uu(e){var t=yo(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach(function(i,a){We(i)?(Uu(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),We(e[a+1])||(r.push(n.slice(0)),n.length=0))})}return t.paths}function Bu(e,t){return e[t]}function Wr(e,t,r){return r=r||Bu,zu(t.reduce(function n(i,a){return We(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},e))}function zu(e){return ze(e)?We(e)?e.map(zu):mo(Object.keys(e).sort(),function(t){return Wr(e,t)}):e}function bo(e){return e.args!==void 0?e.args:e.field?di(e.field,e.variables):null}var Bg=function(){},Wu=function(e,t){return t.fieldName},Qu=function(e,t,r){var n=r.mergeObjects;return n(e,t)},Hu=function(e,t){return t},zg=function(){function e(t){this.config=t,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=D({dataIdFromObject:_u},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return e.prototype.identify=function(t,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||t.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||t,s=D(D({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var f=Eo(arguments,o);return i.readField(f,{store:i.cache.data,variables:f.variables})}}),c,u=a&&this.getTypePolicy(a),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var d=l(D(D({},t),o),s);if(We(d))l=qu(d);else{c=d;break}}return c=c?String(c):void 0,s.keyObject?[c,s.keyObject]:[c]},e.prototype.addTypePolicies=function(t){var r=this;Object.keys(t).forEach(function(n){var i=t[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,c=At(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),it.call(r.toBeAdded,n)?r.toBeAdded[n].push(c):r.toBeAdded[n]=[c]})},e.prototype.updateTypePolicy=function(t,r){var n=this,i=this.getTypePolicy(t),a=r.keyFields,o=r.fields;function s(c,u){c.merge=typeof u=="function"?u:u===!0?Qu:u===!1?Hu:c.merge}s(i,r.merge),i.keyFn=a===!1?Bg:We(a)?qu(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(c){var u=n.getFieldPolicy(t,c,!0),l=o[c];if(typeof l=="function")u.read=l;else{var d=l.keyArgs,f=l.read,v=l.merge;u.keyFn=d===!1?Wu:We(d)?$u(d):typeof d=="function"?d:u.keyFn,typeof f=="function"&&(u.read=f),s(u,v)}u.read&&u.merge&&(u.keyFn=u.keyFn||Wu)})},e.prototype.setRootTypename=function(t,r){r===void 0&&(r=t);var n="ROOT_"+t.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(ne(!i||i===t,5,t),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},e.prototype.addPossibleTypes=function(t){var r=this;this.usingPossibleTypes=!0,Object.keys(t).forEach(function(n){r.getSupertypeSet(n,!0),t[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(Mu);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},e.prototype.getTypePolicy=function(t){var r=this;if(!it.call(this.typePolicies,t)){var n=this.typePolicies[t]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(t);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach(function(o,s){if(o.test(t)){var c=r.supertypeMap.get(s);c&&c.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),c=s.fields,u=At(s,["fields"]);Object.assign(n,u),Object.assign(n.fields,c)})}var a=this.toBeAdded[t];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(t,o)}),this.typePolicies[t]},e.prototype.getFieldPolicy=function(t,r,n){if(t){var i=this.getTypePolicy(t).fields;return i[r]||n&&(i[r]=Object.create(null))}},e.prototype.getSupertypeSet=function(t,r){var n=this.supertypeMap.get(t);return!n&&r&&this.supertypeMap.set(t,n=new Set),n},e.prototype.fragmentMatches=function(t,r,n,i){var a=this;if(!t.typeCondition)return!0;if(!r)return!1;var o=t.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),c=[s],u=function(E){var x=a.getSupertypeSet(E,!1);x&&x.size&&c.indexOf(x)<0&&c.push(x)},l=!!(n&&this.fuzzySubtypes.size),d=!1,f=0;f<c.length;++f){var v=c[f];if(v.has(o))return s.has(o)||(d&&globalThis.__DEV__!==!1&&ne.warn(6,r,o),s.add(o)),!0;v.forEach(u),l&&f===c.length-1&&ho(t.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(E,x){var T=r.match(E);T&&T[0]===r&&u(x)}))}return!1},e.prototype.hasKeyArgs=function(t,r){var n=this.getFieldPolicy(t,r,!1);return!!(n&&n.keyFn)},e.prototype.getStoreFieldName=function(t){var r=t.typename,n=t.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:t.field||null,variables:t.variables},c=bo(t);o;){var u=o(c,s);if(We(u))o=$u(u);else{a=u||n;break}}return a===void 0&&(a=t.field?lp(t.field,t.variables):kc(n,bo(t))),a===!1?n:n===fr(a)?a:n+":"+a},e.prototype.readField=function(t,r){var n=t.from;if(n){var i=t.field||t.fieldName;if(i){if(t.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(t.typename=a)}var o=this.getStoreFieldName(t),s=fr(o),c=r.store.getFieldValue(n,o),u=this.getFieldPolicy(t.typename,s,!1),l=u&&u.read;if(l){var d=Gu(this,n,t,r,r.store.getStorage(Me(n)?n.__ref:n,o));return vo.withValue(this.cache,l,[c,d])}return c}}},e.prototype.getReadFunction=function(t,r){var n=this.getFieldPolicy(t,r,!1);return n&&n.read},e.prototype.getMergeFunction=function(t,r,n){var i=this.getFieldPolicy(t,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},e.prototype.runMergeFunction=function(t,r,n,i,a){var o=n.field,s=n.typename,c=n.merge;return c===Qu?Yu(i.store)(t,r):c===Hu?r:(i.overwrite&&(t=void 0),c(t,r,Gu(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},e}();function Gu(e,t,r,n,i){var a=e.getStoreFieldName(r),o=fr(a),s=r.variables||n.variables,c=n.store,u=c.toReference,l=c.canRead;return{args:bo(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:Me,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(Eo(arguments,t,s),n)},mergeObjects:Yu(n.store)}}function Eo(e,t,r){var n=e[0],i=e[1],a=e.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:t}:(o=D({},n),it.call(o,"from")||(o.from=t)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&ne.warn(7,tc(Array.from(e))),o.variables===void 0&&(o.variables=r),o}function Yu(e){return function(r,n){if(We(r)||We(n))throw yt(8);if(ze(r)&&ze(n)){var i=e.getFieldValue(r,"__typename"),a=e.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(Me(r)&&zr(n))return e.merge(r.__ref,n),r;if(zr(r)&&Me(n))return e.merge(r,n.__ref),n;if(zr(r)&&zr(n))return D(D({},r),n)}return n}}function wo(e,t,r){var n="".concat(t).concat(r),i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:D(D({},e),{clientOnly:t,deferred:r})),i}var Wg=function(){function e(t,r,n){this.cache=t,this.reader=r,this.fragments=n}return e.prototype.writeToStore=function(t,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,c=r.overwrite,u=fn(i),l=Pg();s=D(D({},Ua(u)),s);var d=D(D({store:t,written:Object.create(null),merge:function(v,E){return l.merge(v,E)},variables:s,varString:or(s)},Lu(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:d});if(!Me(f))throw yt(11,a);return d.incomingById.forEach(function(v,E){var x=v.storeObject,T=v.mergeTree,S=v.fieldNodeSet,_=Fr(E);if(T&&T.map.size){var m=n.applyMerges(T,_,x,d);if(Me(m))return;x=m}if(globalThis.__DEV__!==!1&&!d.overwrite){var C=Object.create(null);S.forEach(function(A){A.selectionSet&&(C[A.name.value]=!0)});var O=function(A){return C[fr(A)]===!0},P=function(A){var j=T&&T.map.get(A);return!!(j&&j.info&&j.info.merge)};Object.keys(x).forEach(function(A){O(A)&&!P(A)&&Qg(_,x,A,d.store)})}t.merge(E,x)}),t.retain(f.__ref),f},e.prototype.processSelectionSet=function(t){var r=this,n=t.dataId,i=t.result,a=t.selectionSet,o=t.context,s=t.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||qa(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(u.__typename=l);var d=function(){var m=Eo(arguments,u,o.variables);if(Me(m.from)){var C=o.incomingById.get(m.from.__ref);if(C){var O=c.readField(D(D({},m),{from:C.storeObject}),o);if(O!==void 0)return O}}return c.readField(m,o)},f=new Set;this.flattenFields(a,i,o,l).forEach(function(m,C){var O,P=sr(C),A=i[P];if(f.add(C),A!==void 0){var j=c.getStoreFieldName({typename:l,fieldName:C.name.value,field:C,variables:m.variables}),U=Xu(s,j),V=r.processFieldValue(A,C,C.selectionSet?wo(m,!1,!1):m,U),me=void 0;C.selectionSet&&(Me(V)||zr(V))&&(me=d("__typename",V));var Le=c.getMergeFunction(l,C.name.value,me);Le?U.info={field:C,typename:l,merge:Le}:Ju(s,j),u=m.merge(u,(O={},O[j]=V,O))}else globalThis.__DEV__!==!1&&!m.clientOnly&&!m.deferred&&!Ya.added(C)&&!c.getReadFunction(l,C.name.value)&&globalThis.__DEV__!==!1&&ne.error(12,sr(C),i)});try{var v=c.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:u,readField:d}),E=v[0],x=v[1];n=n||E,x&&(u=o.merge(u,x))}catch(m){if(!n)throw m}if(typeof n=="string"){var T=Fr(n),S=o.written[n]||(o.written[n]=[]);if(S.indexOf(a)>=0||(S.push(a),this.reader&&this.reader.isFresh(i,T,a,o)))return T;var _=o.incomingById.get(n);return _?(_.storeObject=o.merge(_.storeObject,u),_.mergeTree=xo(_.mergeTree,s),f.forEach(function(m){return _.fieldNodeSet.add(m)})):o.incomingById.set(n,{storeObject:u,mergeTree:Ti(s)?void 0:s,fieldNodeSet:f}),T}return u},e.prototype.processFieldValue=function(t,r,n,i){var a=this;return!r.selectionSet||t===null?globalThis.__DEV__!==!1?cu(t):t:We(t)?t.map(function(o,s){var c=a.processFieldValue(o,r,n,Xu(i,s));return Ju(i,s),c}):this.processSelectionSet({result:t,selectionSet:r.selectionSet,context:n,mergeTree:i})},e.prototype.flattenFields=function(t,r,n,i){i===void 0&&(i=qa(r,t,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Pr(!1);return function c(u,l){var d=s.lookup(u,l.clientOnly,l.deferred);d.visited||(d.visited=!0,u.selections.forEach(function(f){if(sn(f,n.variables)){var v=l.clientOnly,E=l.deferred;if(!(v&&E)&&Mt(f.directives)&&f.directives.forEach(function(S){var _=S.name.value;if(_==="client"&&(v=!0),_==="defer"){var m=di(S,n.variables);(!m||m.if!==!1)&&(E=!0)}}),cr(f)){var x=a.get(f);x&&(v=v&&x.clientOnly,E=E&&x.deferred),a.set(f,wo(n,v,E))}else{var T=fi(f,n.lookupFragment);if(!T&&f.kind===Y.FRAGMENT_SPREAD)throw yt(13,f.name.value);T&&o.fragmentMatches(T,i,r,n.variables)&&c(T.selectionSet,wo(n,v,E))}}}))}(t,n),a},e.prototype.applyMerges=function(t,r,n,i,a){var o,s=this;if(t.map.size&&!Me(n)){var c=!We(n)&&(Me(r)||zr(r))?r:void 0,u=n;c&&!a&&(a=[Me(c)?c.__ref:c]);var l,d=function(f,v){return We(f)?typeof v=="number"?f[v]:void 0:i.store.getFieldValue(f,String(v))};t.map.forEach(function(f,v){var E=d(c,v),x=d(u,v);if(x!==void 0){a&&a.push(v);var T=s.applyMerges(f,E,x,i,a);T!==x&&(l=l||new Map,l.set(v,T)),a&&ne(a.pop()===v)}}),l&&(n=We(u)?u.slice(0):D({},u),l.forEach(function(f,v){n[v]=f}))}return t.info?this.cache.policies.runMergeFunction(r,n,t.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},e}(),Ku=[];function Xu(e,t){var r=e.map;return r.has(t)||r.set(t,Ku.pop()||{map:new Map}),r.get(t)}function xo(e,t){if(e===t||!t||Ti(t))return e;if(!e||Ti(e))return t;var r=e.info&&t.info?D(D({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i=n?new Map:e.map.size?e.map:t.map,a={info:r,map:i};if(n){var o=new Set(t.map.keys());e.map.forEach(function(s,c){a.map.set(c,xo(s,t.map.get(c))),o.delete(c)}),o.forEach(function(s){a.map.set(s,xo(t.map.get(s),e.map.get(s)))})}return a}function Ti(e){return!e||!(e.info||e.map.size)}function Ju(e,t){var r=e.map,n=r.get(t);n&&Ti(n)&&(Ku.push(n),r.delete(t))}var Zu=new Set;function Qg(e,t,r,n){var i=function(d){var f=n.getFieldValue(d,r);return typeof f=="object"&&f},a=i(e);if(a){var o=i(t);if(o&&!Me(a)&&!Ae(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),c=fr(r),u="".concat(s,".").concat(c);if(!Zu.has(u)){Zu.add(u);var l=[];!We(a)&&!We(o)&&[a,o].forEach(function(d){var f=n.getFieldValue(d,"__typename");typeof f=="string"&&!l.includes(f)&&l.push(f)}),globalThis.__DEV__!==!1&&ne.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,D({},a),D({},o))}}}}var el=function(e){Qt(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new Gc(Ya),n.assumeImmutableResults=!0,n.makeVar=$g,n.txCount=0,n.config=Lg(r),n.addTypename=!!n.config.addTypename,n.policies=new zg({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return t.prototype.init=function(){var r=this.data=new xn.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},t.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new Wg(this,this.storeReader=new Rg({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Du(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=pn(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize||Ht["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(On(s)){var c=o.optimistic,u=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,or({optimistic:c,id:u,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},t.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},t.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},t.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(D(D({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Cu)return null;throw a}},t.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.modify=function(r){if(it.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(D(D({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(r){var n=this;return this.watches.size||qg(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&ju(n),n.maybeBroadcastWatch.forget(r)}},t.prototype.gc=function(r){var n;or.reset(),yi.reset(),this.addTypenameTransform.resetCache(),(n=this.config.fragments)===null||n===void 0||n.resetCaches();var i=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),i},t.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},t.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},t.prototype.identify=function(r){if(Me(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){globalThis.__DEV__!==!1&&ne.warn(n)}},t.prototype.evict=function(r){if(!r.id){if(it.call(r,"id"))return!1;r=D(D({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.reset=function(r){var n=this;return this.init(),or.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),ju(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},t.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,c=r.onWatchUpdated,u,l=function(f){var v=n,E=v.data,x=v.optimisticData;++n.txCount,f&&(n.data=n.optimisticData=f);try{return u=i(n)}finally{--n.txCount,n.data=E,n.optimisticData=x}},d=new Set;return c&&!this.txCount&&this.broadcastWatches(D(D({},r),{onWatchUpdated:function(f){return d.add(f),!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&&d.size?(this.broadcastWatches(D(D({},r),{onWatchUpdated:function(f,v){var E=c.call(this,f,v);return E!==!1&&d.delete(f),E}})),d.size&&d.forEach(function(f){return n.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(r),u},t.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},t.prototype.transformDocument=function(r){return this.addTypenameToDocument(this.addFragmentsToDocument(r))},t.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},t.prototype.addFragmentsToDocument=function(r){var n=this.config.fragments;return n?n.transform(r):r},t.prototype.addTypenameToDocument=function(r){return this.addTypename?this.addTypenameTransform.transformDocument(r):r},t.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,a=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,i)===!1)||(!i||!Ae(i.result,a.result))&&r.callback(r.lastDiff=a,i)},t}(Tu);globalThis.__DEV__!==!1&&(el.prototype.getMemoryInternals=Q0);var Te;(function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"})(Te||(Te={}));function Tn(e){return e?e<7:!1}var tl=Object.assign,Hg=Object.hasOwnProperty,Oo=function(e){Qt(t,e);function t(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=e.call(this,function(T){try{var S=T._subscription._observer;S&&!S.error&&(S.error=Gg)}catch{}var _=!o.observers.size;o.observers.add(T);var m=o.last;return m&&m.error?T.error&&T.error(m.error):m&&m.result&&T.next&&T.next(m.result),_&&o.reobserve().catch(function(){}),function(){o.observers.delete(T)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.waitForOwnResult=So(a.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var s=n.defaultOptions.watchQuery,c=s===void 0?{}:s,u=c.fetchPolicy,l=u===void 0?"cache-first":u,d=a.fetchPolicy,f=d===void 0?l:d,v=a.initialFetchPolicy,E=v===void 0?f==="standby"?l:f:v;o.options=D(D({},a),{initialFetchPolicy:E,fetchPolicy:f}),o.queryId=i.queryId||n.generateQueryId();var x=fn(o.query);return o.queryName=x&&x.name&&x.name.value,o}return Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||Te.ready,a=D(D({},n),{loading:Tn(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(So(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),Ae(a.data,{})&&(a.data=void 0),c.complete?(delete a.partial,c.complete&&a.networkStatus===Te.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=Te.ready,a.loading=!1)):a.partial=!0,globalThis.__DEV__!==!1&&!c.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&nl(c.missing)}return r&&this.updateLastResult(a),a},t.prototype.isDifferentFromLastResult=function(r,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!Ou(this.query,this.last.result,r,this.variables):!Ae(this.last.result,r);return i||n&&!Ae(this.last.variables,n)},t.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||Ae(i.variables,this.variables)))return i[r]},t.prototype.getLastResult=function(r){return this.getLast("result",r)},t.prototype.getLastError=function(r){return this.getLast("error",r)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(r){var n,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&&r&&Hg.call(r,"variables")){var o=Dc(this.query),s=o.variableDefinitions;(!s||!s.some(function(c){return c.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&ne.warn(20,r,((n=o.name)===null||n===void 0?void 0:n.value)||o)}return r&&!Ae(this.options.variables,r)&&(i.variables=this.options.variables=D(D({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,Te.refetch)},t.prototype.fetchMore=function(r){var n=this,i=D(D({},r.query?r:D(D(D(D({},this.options),{query:this.options.query}),r),{variables:D(D({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var a=this.queryManager.generateQueryId();this.lastQuery=r.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,s=o.networkStatus;o.networkStatus=Te.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set,u=r==null?void 0:r.updateQuery,l=this.options.fetchPolicy!=="no-cache";return l||ne(u,21),this.queryManager.fetchQuery(a,i,Te.fetchMore).then(function(d){if(n.queryManager.removeQuery(a),o.networkStatus===Te.fetchMore&&(o.networkStatus=s),l)n.queryManager.cache.batch({update:function(E){var x=r.updateQuery;x?E.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(T){return x(T,{fetchMoreResult:d.data,variables:i.variables})}):E.writeQuery({query:i.query,variables:i.variables,data:d.data})},onWatchUpdated:function(E){c.add(E.query)}});else{var f=n.getLast("result"),v=u(f.data,{fetchMoreResult:d.data,variables:i.variables});n.reportResult(D(D({},f),{data:v}),n.variables)}return d}).finally(function(){l&&!c.has(n.query)&&rl(n)})},t.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,c){var u=c.variables;return o(s,{subscriptionData:a,variables:u})})},error:function(a){if(r.onError){r.onError(a);return}globalThis.__DEV__!==!1&&ne.error(22,a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(r){return this.reobserve(r)},t.prototype.silentSetOptions=function(r){var n=Er(this.options,r||{});tl(this.options,n)},t.prototype.setVariables=function(r){return Ae(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},Te.setVariables):Promise.resolve())},t.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},t.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},t.prototype.fetch=function(r,n,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,r,n,i)},t.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){ne(a,23);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){var u,l;r.pollingInfo&&(!Tn(r.queryInfo.networkStatus)&&!(!((l=(u=r.options).skipPollAttempt)===null||l===void 0)&&l.call(u))?r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Te.poll).then(c,c):c())},c=function(){var u=r.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(s,u.interval))};c()}}},t.prototype.updateLastResult=function(r,n){n===void 0&&(n=this.variables);var i=this.getLastError();return i&&this.last&&!Ae(n,this.last.variables)&&(i=void 0),this.last=D({result:this.queryManager.assumeImmutableResults?r:cu(r),variables:n},i?{error:i}:null)},t.prototype.reobserveAsConcast=function(r,n){var i=this;this.isTornDown=!1;var a=n===Te.refetch||n===Te.fetchMore||n===Te.poll,o=this.options.variables,s=this.options.fetchPolicy,c=Er(this.options,r||{}),u=a?c:tl(this.options,c),l=this.transformDocument(u.query);this.lastQuery=l,a||(this.updatePolling(),r&&r.variables&&!Ae(r.variables,o)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===s||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=Te.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=So(u.fetchPolicy));var d=function(){i.concast===E&&(i.waitForOwnResult=!1)},f=u.variables&&D({},u.variables),v=this.fetch(u,n,l),E=v.concast,x=v.fromLink,T={next:function(S){Ae(i.variables,f)&&(d(),i.reportResult(S,f))},error:function(S){Ae(i.variables,f)&&(gu(S)||(S=new Jt({networkError:S})),d(),i.reportError(S,f))}};return!a&&(x||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=E,this.observer=T),E.addObserver(T),E},t.prototype.reobserve=function(r,n){return this.reobserveAsConcast(r,n).promise},t.prototype.resubscribeAfterError=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this.last;this.resetLastResults();var a=this.subscribe.apply(this,r);return this.last=i,a},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(r,n){var i=this.getLastError(),a=this.isDifferentFromLastResult(r,n);(i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),(i||a)&&mn(this.observers,"next",r)},t.prototype.reportError=function(r,n){var i=D(D({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:Te.error,loading:!1});this.updateLastResult(i,n),mn(this.observers,"error",this.last.error=r)},t.prototype.hasObservers=function(){return this.observers.size>0},t.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(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(r){return this.queryManager.transform(r)},t}(je);uu(Oo);function rl(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,a){return this.nextFetchPolicy=n,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,a):r}}):e.reobserve()}function Gg(e){globalThis.__DEV__!==!1&&ne.error(24,e.message,e.stack)}function nl(e){globalThis.__DEV__!==!1&&e&&globalThis.__DEV__!==!1&&ne.debug(25,e)}function So(e){return e==="network-only"||e==="no-cache"||e==="standby"}var Qr=new(Nr?WeakMap:Map);function To(e,t){var r=e[t];typeof r=="function"&&(e[t]=function(){return Qr.set(e,(Qr.get(e)+1)%1e15),r.apply(this,arguments)})}function il(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Co=function(){function e(t,r){r===void 0&&(r=t.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=t.cache;Qr.has(n)||(Qr.set(n,0),To(n,"evict"),To(n,"modify"),To(n,"reset"))}return e.prototype.init=function(t){var r=t.networkStatus||Te.loading;return this.variables&&this.networkStatus!==Te.loading&&!Ae(this.variables,t.variables)&&(r=Te.setVariables),Ae(t.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:t.document,variables:t.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),t.observableQuery&&this.setObservableQuery(t.observableQuery),t.lastRequestId&&(this.lastRequestId=t.lastRequestId),this},e.prototype.reset=function(){il(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var t=this.getDiffOptions();if(this.lastDiff&&Ae(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var r=this.observableQuery;if(r&&r.options.fetchPolicy==="no-cache")return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(t,r){this.lastDiff=t?{diff:t,options:r||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(t){var r;return t===void 0&&(t=this.variables),{query:this.document,variables:t,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},e.prototype.setDiff=function(t){var r=this,n,i=this.lastDiff&&this.lastDiff.diff;t&&!t.complete&&(!((n=this.observableQuery)===null||n===void 0)&&n.getLastError())||(this.updateLastDiff(t),!this.dirty&&!Ae(i&&i.result,t&&t.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0))))},e.prototype.setObservableQuery=function(t){var r=this;t!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=t,t?(t.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?t.observe():rl(t)})):delete this.oqListener)},e.prototype.notify=function(){var t=this;il(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(t)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Tn(this.networkStatus)&&this.observableQuery){var t=this.observableQuery.options.fetchPolicy;if(t!=="cache-only"&&t!=="cache-and-network")return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(t){var r=this;t===void 0&&(t=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=D(D({},this.getDiffOptions(t)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!Ae(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(t,r){var n=this.lastWrite;return!(n&&n.dmCount===Qr.get(this.cache)&&Ae(r,n.variables)&&Ae(t.data,n.result.data))},e.prototype.markResult=function(t,r,n,i){var a=this,o=new lr,s=Mt(t.errors)?t.errors.slice(0):[];if(this.reset(),"incremental"in t&&Mt(t.incremental)){var c=fu(this.getDiff().result,t);t.data=c}else if("hasNext"in t&&t.hasNext){var u=this.getDiff();t.data=o.merge(u.result,t.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:t.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(_o(t,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(t,n.variables))l.writeQuery({query:r,data:t.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:t,variables:n.variables,dmCount:Qr.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){t.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),f=l.diff(d);!a.stopped&&Ae(a.variables,n.variables)&&a.updateWatch(n.variables),a.updateLastDiff(f,d),f.complete&&(t.data=f.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Te.ready},e.prototype.markError=function(t){return this.networkStatus=Te.error,this.lastWrite=void 0,this.reset(),t.graphQLErrors&&(this.graphQLErrors=t.graphQLErrors),t.networkError&&(this.networkError=t.networkError),t},e}();function _o(e,t){t===void 0&&(t="none");var r=t==="ignore"||t==="all",n=!wi(e);return!n&&r&&e.data&&(n=!0),n}var Yg=Object.prototype.hasOwnProperty,al=Object.create(null),Kg=function(){function e(t){var r=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new Fa(Ht["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Pr(!1);var n=new Gc(function(a){return r.cache.transformDocument(a)},{cache:!1});this.cache=t.cache,this.link=t.link,this.defaultOptions=t.defaultOptions,this.queryDeduplication=t.queryDeduplication,this.clientAwareness=t.clientAwareness,this.localState=t.localState,this.ssrMode=t.ssrMode,this.assumeImmutableResults=t.assumeImmutableResults;var i=t.documentTransform;this.documentTransform=i?n.concat(i).concat(n):n,this.defaultContext=t.defaultContext||Object.create(null),(this.onBroadcast=t.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var t=this;this.queries.forEach(function(r,n){t.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(yt(26))},e.prototype.cancelPendingFetches=function(t){this.fetchCancelFns.forEach(function(r){return r(t)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(t){return nr(this,arguments,void 0,function(r){var n,i,a,o,s,c,u,l=r.mutation,d=r.variables,f=r.optimisticResponse,v=r.updateQueries,E=r.refetchQueries,x=E===void 0?[]:E,T=r.awaitRefetchQueries,S=T===void 0?!1:T,_=r.update,m=r.onQueryUpdated,C=r.fetchPolicy,O=C===void 0?((c=this.defaultOptions.mutate)===null||c===void 0?void 0:c.fetchPolicy)||"network-only":C,P=r.errorPolicy,A=P===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":P,j=r.keepRootFields,U=r.context;return ir(this,function(V){switch(V.label){case 0:return ne(l,27),ne(O==="network-only"||O==="no-cache",28),n=this.generateMutationId(),l=this.cache.transformForLink(this.transform(l)),i=this.getDocumentInfo(l).hasClientExports,d=this.getVariables(l,d),i?[4,this.localState.addExportedVariables(l,d,U)]:[3,2];case 1:d=V.sent(),V.label=2;case 2:return a=this.mutationStore&&(this.mutationStore[n]={mutation:l,variables:d,loading:!0,error:null}),o=f&&this.markMutationOptimistic(f,{mutationId:n,document:l,variables:d,fetchPolicy:O,errorPolicy:A,context:U,updateQueries:v,update:_,keepRootFields:j}),this.broadcastQueries(),s=this,[2,new Promise(function(me,Le){return io(s.getObservableFromLink(l,D(D({},U),{optimisticResponse:o?f:void 0}),d,{},!1),function(ye){if(wi(ye)&&A==="none")throw new Jt({graphQLErrors:ao(ye)});a&&(a.loading=!1,a.error=null);var Oe=D({},ye);return typeof x=="function"&&(x=x(Oe)),A==="ignore"&&wi(Oe)&&delete Oe.errors,s.markMutationResult({mutationId:n,result:Oe,document:l,variables:d,fetchPolicy:O,errorPolicy:A,context:U,update:_,updateQueries:v,awaitRefetchQueries:S,refetchQueries:x,removeOptimistic:o?n:void 0,onQueryUpdated:m,keepRootFields:j})}).subscribe({next:function(ye){s.broadcastQueries(),(!("hasNext"in ye)||ye.hasNext===!1)&&me(ye)},error:function(ye){a&&(a.loading=!1,a.error=ye),o&&s.cache.removeOptimistic(n),s.broadcastQueries(),Le(ye instanceof Jt?ye:new Jt({networkError:ye}))}})})]}})})},e.prototype.markMutationResult=function(t,r){var n=this;r===void 0&&(r=this.cache);var i=t.result,a=[],o=t.fetchPolicy==="no-cache";if(!o&&_o(i,t.errorPolicy)){if(Ur(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),Ur(i)&&Mt(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=fu(s.result,i)),typeof c<"u"&&(i.data=c,a.push({result:c,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var u=t.updateQueries;u&&this.queries.forEach(function(d,f){var v=d.observableQuery,E=v&&v.queryName;if(!(!E||!Yg.call(u,E))){var x=u[E],T=n.queries.get(f),S=T.document,_=T.variables,m=r.diff({query:S,variables:_,returnPartialData:!0,optimistic:!1}),C=m.result,O=m.complete;if(O&&C){var P=x(C,{mutationResult:i,queryName:S&&$a(S)||void 0,queryVariables:_});P&&a.push({result:P,dataId:"ROOT_QUERY",query:S,variables:_})}}})}if(a.length>0||(t.refetchQueries||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(x){return d.write(x)});var f=t.update,v=!Qp(i)||Ur(i)&&!i.hasNext;if(f){if(!o){var E=d.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});E.complete&&(i=D(D({},i),{data:E.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}v&&f(d,i,{context:t.context,variables:t.variables})}!o&&!t.keepRootFields&&v&&d.modify({id:"ROOT_MUTATION",fields:function(x,T){var S=T.fieldName,_=T.DELETE;return S==="__typename"?x:_}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(t,r){var n=this,i=typeof t=="function"?t(r.variables,{IGNORE:al}):t;return i===al?!1:(this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(D(D({},r),{result:{data:i}}),a)}catch(o){globalThis.__DEV__!==!1&&ne.error(o)}},r.mutationId),!0)},e.prototype.fetchQuery=function(t,r,n){return this.fetchConcastWithInfo(t,r,n).concast.promise},e.prototype.getQueryStore=function(){var t=Object.create(null);return this.queries.forEach(function(r,n){t[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),t},e.prototype.resetErrors=function(t){var r=this.queries.get(t);r&&(r.networkError=void 0,r.graphQLErrors=[])},e.prototype.transform=function(t){return this.documentTransform.transformDocument(t)},e.prototype.getDocumentInfo=function(t){var r=this.transformCache;if(!r.has(t)){var n={hasClientExports:_0(t),hasForcedResolvers:this.localState.shouldForceResolvers(t),hasNonreactiveDirective:cn(["nonreactive"],t),clientQuery:this.localState.clientQuery(t),serverQuery:Jc([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],t),defaultVars:Ua(fn(t)),asQuery:D(D({},t),{definitions:t.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?D(D({},i),{operation:"query"}):i})})};r.set(t,n)}return r.get(t)},e.prototype.getVariables=function(t,r){return D(D({},this.getDocumentInfo(t).defaultVars),r)},e.prototype.watchQuery=function(t){var r=this.transform(t.query);t=D(D({},t),{variables:this.getVariables(r,t.variables)}),typeof t.notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!1);var n=new Co(this),i=new Oo({queryManager:this,queryInfo:n,options:t});return i.lastQuery=r,this.queries.set(i.queryId,n),n.init({document:r,observableQuery:i,variables:i.variables}),i},e.prototype.query=function(t,r){var n=this;return r===void 0&&(r=this.generateQueryId()),ne(t.query,29),ne(t.query.kind==="Document",30),ne(!t.returnPartialData,31),ne(!t.pollInterval,32),this.fetchQuery(r,D(D({},t),{query:this.transform(t.query)})).finally(function(){return n.stopQuery(r)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(t){var r=this.queries.get(t);r&&r.stop()},e.prototype.clearStore=function(t){return t===void 0&&(t={discardWatches:!0}),this.cancelPendingFetches(yt(33)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=Te.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(t)},e.prototype.getObservableQueries=function(t){var r=this;t===void 0&&(t="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(t)&&t.forEach(function(o){typeof o=="string"?i.set(o,!1):ep(o)?i.set(r.transform(o),!1):ze(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var c=o.observableQuery,u=o.document;if(c){if(t==="all"){n.set(s,c);return}var l=c.queryName,d=c.options.fetchPolicy;if(d==="standby"||t==="active"&&!c.hasObservers())return;(t==="active"||l&&i.has(l)||u&&i.has(u))&&(n.set(s,c),l&&i.set(l,!0),u&&i.set(u,!0))}}),a.size&&a.forEach(function(o){var s=xa("legacyOneTimeQuery"),c=r.getQuery(s).init({document:o.query,variables:o.variables}),u=new Oo({queryManager:r,queryInfo:c,options:D(D({},o),{fetchPolicy:"network-only"})});ne(u.queryId===s),c.setObservableQuery(u),n.set(s,u)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,s){o||globalThis.__DEV__!==!1&&ne.warn(typeof s=="string"?34:35,s)}),n},e.prototype.reFetchObservableQueries=function(t){var r=this;t===void 0&&(t=!1);var n=[];return this.getObservableQueries(t?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(t||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(t){this.getQuery(t.queryId).setObservableQuery(t)},e.prototype.startGraphQLSubscription=function(t){var r=this,n=t.query,i=t.fetchPolicy,a=t.errorPolicy,o=a===void 0?"none":a,s=t.variables,c=t.context,u=c===void 0?{}:c,l=t.extensions,d=l===void 0?{}:l;n=this.transform(n),s=this.getVariables(n,s);var f=function(E){return r.getObservableFromLink(n,u,E,d).map(function(x){i!=="no-cache"&&(_o(x,o)&&r.cache.write({query:n,result:x.data,dataId:"ROOT_SUBSCRIPTION",variables:E}),r.broadcastQueries());var T=wi(x),S=cg(x);if(T||S){var _={};if(T&&(_.graphQLErrors=x.errors),S&&(_.protocolErrors=x.extensions[co]),o==="none"||S)throw new Jt(_)}return o==="ignore"&&delete x.errors,x})};if(this.getDocumentInfo(n).hasClientExports){var v=this.localState.addExportedVariables(n,s,u).then(f);return new je(function(E){var x=null;return v.then(function(T){return x=T.subscribe(E)},E.error),function(){return x&&x.unsubscribe()}})}return f(s)},e.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},e.prototype.removeQuery=function(t){this.fetchCancelFns.delete(t),this.queries.has(t)&&(this.getQuery(t).stop(),this.queries.delete(t))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(t){return t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(t,r,n,i,a){var o=this,s;a===void 0&&(a=(s=r==null?void 0:r.queryDeduplication)!==null&&s!==void 0?s:this.queryDeduplication);var c,u=this.getDocumentInfo(t),l=u.serverQuery,d=u.clientQuery;if(l){var f=this,v=f.inFlightLinkObservables,E=f.link,x={query:l,variables:n,operationName:$a(l)||void 0,context:this.prepareContext(D(D({},r),{forceFetch:!a})),extensions:i};if(r=x.context,a){var T=yi(l),S=or(n),_=v.lookup(T,S);if(c=_.observable,!c){var m=new $r([so(E,x)]);c=_.observable=m,m.beforeNext(function(){v.remove(T,S)})}}else c=new $r([so(E,x)])}else c=new $r([je.of({data:{}})]),r=this.prepareContext(r);return d&&(c=io(c,function(C){return o.localState.runResolvers({document:d,remoteResult:C,context:r,variables:n})})),c},e.prototype.getResultsFromLink=function(t,r,n){var i=t.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(n.query);return io(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=ao(o),c=s.length>0,u=n.errorPolicy;if(i>=t.lastRequestId){if(c&&u==="none")throw t.markError(new Jt({graphQLErrors:s}));t.markResult(o,a,n,r),t.markReady()}var l={data:o.data,loading:!1,networkStatus:Te.ready};return c&&u==="none"&&(l.data=void 0),c&&u!=="ignore"&&(l.errors=s,l.networkStatus=Te.error),l},function(o){var s=gu(o)?o:new Jt({networkError:o});throw i>=t.lastRequestId&&t.markError(s),s})},e.prototype.fetchConcastWithInfo=function(t,r,n,i){var a=this;n===void 0&&(n=Te.loading),i===void 0&&(i=r.query);var o=this.getVariables(i,r.variables),s=this.getQuery(t),c=this.defaultOptions.watchQuery,u=r.fetchPolicy,l=u===void 0?c&&c.fetchPolicy||"cache-first":u,d=r.errorPolicy,f=d===void 0?c&&c.errorPolicy||"none":d,v=r.returnPartialData,E=v===void 0?!1:v,x=r.notifyOnNetworkStatusChange,T=x===void 0?!1:x,S=r.context,_=S===void 0?{}:S,m=Object.assign({},r,{query:i,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:E,notifyOnNetworkStatusChange:T,context:_}),C=function(U){m.variables=U;var V=a.fetchQueryByPolicy(s,m,n);return m.fetchPolicy!=="standby"&&V.sources.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),V},O=function(){return a.fetchCancelFns.delete(t)};this.fetchCancelFns.set(t,function(U){O(),setTimeout(function(){return P.cancel(U)})});var P,A;if(this.getDocumentInfo(m.query).hasClientExports)P=new $r(this.localState.addExportedVariables(m.query,m.variables,m.context).then(C).then(function(U){return U.sources})),A=!0;else{var j=C(m.variables);A=j.fromLink,P=new $r(j.sources)}return P.promise.then(O,O),{concast:P,fromLink:A}},e.prototype.refetchQueries=function(t){var r=this,n=t.updateCache,i=t.include,a=t.optimistic,o=a===void 0?!1:a,s=t.removeOptimistic,c=s===void 0?o?xa("refetchQueries"):void 0:s,u=t.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(f,v){l.set(v,{oq:f,lastDiff:r.getQuery(v).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&c||!1,removeOptimistic:c,onWatchUpdated:function(f,v,E){var x=f.watcher instanceof Co&&f.watcher.observableQuery;if(x){if(u){l.delete(x.queryId);var T=u(x,v,E);return T===!0&&(T=x.refetch()),T!==!1&&d.set(x,T),T}u!==null&&l.set(x.queryId,{oq:x,lastDiff:E,diff:v})}}}),l.size&&l.forEach(function(f,v){var E=f.oq,x=f.lastDiff,T=f.diff,S;if(u){if(!T){var _=E.queryInfo;_.reset(),T=_.getDiff()}S=u(E,T,x)}(!u||S===!0)&&(S=E.refetch()),S!==!1&&d.set(E,S),v.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(v)}),c&&this.cache.removeOptimistic(c),d},e.prototype.fetchQueryByPolicy=function(t,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,c=r.refetchWritePolicy,u=r.errorPolicy,l=r.returnPartialData,d=r.context,f=r.notifyOnNetworkStatusChange,v=t.networkStatus;t.init({document:a,variables:o,networkStatus:n});var E=function(){return t.getDiff()},x=function(C,O){O===void 0&&(O=t.networkStatus||Te.loading);var P=C.result;globalThis.__DEV__!==!1&&!l&&!Ae(P,{})&&nl(C.missing);var A=function(j){return je.of(D({data:j,loading:Tn(O),networkStatus:O},C.complete?null:{partial:!0}))};return P&&i.getDocumentInfo(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:P},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(j){return A(j.data||void 0)}):u==="none"&&O===Te.refetch&&Array.isArray(C.missing)?A(void 0):A(P)},T=s==="no-cache"?0:n===Te.refetch&&c!=="merge"?1:2,S=function(){return i.getResultsFromLink(t,T,{query:a,variables:o,context:d,fetchPolicy:s,errorPolicy:u})},_=f&&typeof v=="number"&&v!==n&&Tn(n);switch(s){default:case"cache-first":{var m=E();return m.complete?{fromLink:!1,sources:[x(m,t.markReady())]}:l||_?{fromLink:!0,sources:[x(m),S()]}:{fromLink:!0,sources:[S()]}}case"cache-and-network":{var m=E();return m.complete||l||_?{fromLink:!0,sources:[x(m),S()]}:{fromLink:!0,sources:[S()]}}case"cache-only":return{fromLink:!1,sources:[x(E(),t.markReady())]};case"network-only":return _?{fromLink:!0,sources:[x(E()),S()]}:{fromLink:!0,sources:[S()]};case"no-cache":return _?{fromLink:!0,sources:[x(t.getDiff()),S()]}:{fromLink:!0,sources:[S()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(t){return t&&!this.queries.has(t)&&this.queries.set(t,new Co(this,t)),this.queries.get(t)},e.prototype.prepareContext=function(t){t===void 0&&(t={});var r=this.localState.prepareContext(t);return D(D(D({},this.defaultContext),r),{clientAwareness:this.clientAwareness})},e}(),Xg=function(){function e(t){var r=t.cache,n=t.client,i=t.resolvers,a=t.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return e.prototype.addResolvers=function(t){var r=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach(function(n){r.resolvers=eu(r.resolvers,n)}):this.resolvers=eu(this.resolvers,t)},e.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(t){return nr(this,arguments,void 0,function(r){var n=r.document,i=r.remoteResult,a=r.context,o=r.variables,s=r.onlyRunForcedResolvers,c=s===void 0?!1:s;return ir(this,function(u){return n?[2,this.resolveDocument(n,i.data,a,o,this.fragmentMatcher,c).then(function(l){return D(D({},i),{data:l.result})})]:[2,i]})})},e.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(t){return cn(["client"],t)&&this.resolvers?t:null},e.prototype.serverQuery=function(t){return Zc(t)},e.prototype.prepareContext=function(t){var r=this.cache;return D(D({},t),{cache:r,getCacheKey:function(n){return r.identify(n)}})},e.prototype.addExportedVariables=function(t){return nr(this,arguments,void 0,function(r,n,i){return n===void 0&&(n={}),i===void 0&&(i={}),ir(this,function(a){return r?[2,this.resolveDocument(r,this.buildRootValueFromCache(r,n)||{},this.prepareContext(i),n).then(function(o){return D(D({},n),o.exportedVariables)})]:[2,D({},n)]})})},e.prototype.shouldForceResolvers=function(t){var r=!1;return Xt(t,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return La}}}),r},e.prototype.buildRootValueFromCache=function(t,r){return this.cache.diff({query:Lp(t),variables:r,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(t,r){return nr(this,arguments,void 0,function(n,i,a,o,s,c){var u,l,d,f,v,E,x,T,S,_,m;return a===void 0&&(a={}),o===void 0&&(o={}),s===void 0&&(s=function(){return!0}),c===void 0&&(c=!1),ir(this,function(C){return u=hn(n),l=pi(n),d=li(l),f=this.collectSelectionsToResolve(u,d),v=u.operation,E=v?v.charAt(0).toUpperCase()+v.slice(1):"Query",x=this,T=x.cache,S=x.client,_={fragmentMap:d,context:D(D({},a),{cache:T,client:S}),variables:o,fragmentMatcher:s,defaultOperationType:E,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:c},m=!1,[2,this.resolveSelectionSet(u.selectionSet,m,i,_).then(function(O){return{result:O,exportedVariables:_.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(t,r,n,i){return nr(this,void 0,void 0,function(){var a,o,s,c,u,l=this;return ir(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,c=[n],u=function(f){return nr(l,void 0,void 0,function(){var v,E;return ir(this,function(x){return!r&&!i.selectionsToResolve.has(f)?[2]:sn(f,s)?cr(f)?[2,this.resolveField(f,r,n,i).then(function(T){var S;typeof T<"u"&&c.push((S={},S[sr(f)]=T,S))})]:(hp(f)?v=f:(v=a[f.name.value],ne(v,18,f.name.value)),v&&v.typeCondition&&(E=v.typeCondition.name.value,i.fragmentMatcher(n,E,o))?[2,this.resolveSelectionSet(v.selectionSet,r,n,i).then(function(T){c.push(T)})]:[2]):[2]})})},[2,Promise.all(t.selections.map(u)).then(function(){return mi(c)})]})})},e.prototype.resolveField=function(t,r,n,i){return nr(this,void 0,void 0,function(){var a,o,s,c,u,l,d,f,v,E=this;return ir(this,function(x){return n?(a=i.variables,o=t.name.value,s=sr(t),c=o!==s,u=n[s]||n[o],l=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(t))&&(d=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(v=f[c?o:s],v&&(l=Promise.resolve(vo.withValue(this.cache,v,[n,di(t,a),i.context,{field:t,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(T){var S,_;if(T===void 0&&(T=u),t.directives&&t.directives.forEach(function(C){C.name.value==="export"&&C.arguments&&C.arguments.forEach(function(O){O.name.value==="as"&&O.value.kind==="StringValue"&&(i.exportedVariables[O.value.value]=T)})}),!t.selectionSet||T==null)return T;var m=(_=(S=t.directives)===null||S===void 0?void 0:S.some(function(C){return C.name.value==="client"}))!==null&&_!==void 0?_:!1;if(Array.isArray(T))return E.resolveSubSelectedArray(t,r||m,T,i);if(t.selectionSet)return E.resolveSelectionSet(t.selectionSet,r||m,T,i)})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(t,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(t,r,o,i);if(t.selectionSet)return a.resolveSelectionSet(t.selectionSet,r,o,i)}))},e.prototype.collectSelectionsToResolve=function(t,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Xt(o,{Directive:function(c,u,l,d,f){c.name.value==="client"&&f.forEach(function(v){n(v)&&bc(v)&&s.add(v)})},FragmentSpread:function(c,u,l,d,f){var v=r[c.name.value];ne(v,19,c.name.value);var E=a(v);E.size>0&&(f.forEach(function(x){n(x)&&bc(x)&&s.add(x)}),s.add(c),E.forEach(function(x){s.add(x)}))}})}return i.get(o)}return a(t)},e}(),ol=!1,sl=function(){function e(t){var r=this,n;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!t.cache)throw yt(15);var i=t.uri,a=t.credentials,o=t.headers,s=t.cache,c=t.documentTransform,u=t.ssrMode,l=u===void 0?!1:u,d=t.ssrForceFetchDelay,f=d===void 0?0:d,v=t.connectToDevTools,E=t.queryDeduplication,x=E===void 0?!0:E,T=t.defaultOptions,S=t.defaultContext,_=t.assumeImmutableResults,m=_===void 0?s.assumeImmutableResults:_,C=t.resolvers,O=t.typeDefs,P=t.fragmentMatcher,A=t.name,j=t.version,U=t.devtools,V=t.link;V||(V=i?new Tg({uri:i,credentials:a,headers:o}):En.empty()),this.link=V,this.cache=s,this.disableNetworkFetches=l||f>0,this.queryDeduplication=x,this.defaultOptions=T||Object.create(null),this.typeDefs=O,this.devtoolsConfig=D(D({},U),{enabled:(n=U==null?void 0:U.enabled)!==null&&n!==void 0?n:v}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),f&&setTimeout(function(){return r.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=Ea,this.localState=new Xg({cache:s,client:this,resolvers:C,fragmentMatcher:P}),this.queryManager=new Kg({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:S,documentTransform:c,queryDeduplication:x,ssrMode:l,clientAwareness:{name:A,version:j},localState:this.localState,assumeImmutableResults:m,onBroadcast:this.devtoolsConfig.enabled?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var t=window,r=Symbol.for("apollo.devtools");(t[r]=t[r]||[]).push(this),t.__APOLLO_CLIENT__=this,!ol&&globalThis.__DEV__!==!1&&(ol=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var n=window.navigator,i=n&&n.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&&ne.log("Download the Apollo DevTools for a better development experience: %s",a)}},1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=Br(this.defaultOptions.watchQuery,t)),this.disableNetworkFetches&&(t.fetchPolicy==="network-only"||t.fetchPolicy==="cache-and-network")&&(t=D(D({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},e.prototype.query=function(t){return this.defaultOptions.query&&(t=Br(this.defaultOptions.query,t)),ne(t.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&t.fetchPolicy==="network-only"&&(t=D(D({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},e.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=Br(this.defaultOptions.mutate,t)),this.queryManager.mutate(t)},e.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!1),this.cache.readQuery(t,r)},e.prototype.watchFragment=function(t){return this.cache.watchFragment(t)},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!1),this.cache.readFragment(t,r)},e.prototype.writeQuery=function(t){var r=this.cache.writeQuery(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.writeFragment=function(t){var r=this.cache.writeFragment(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},e.prototype.__requestRaw=function(t){return so(this.link,t)},e.prototype.resetStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(t.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return t.reFetchObservableQueries()})},e.prototype.clearStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(t.clearStoreCallbacks.map(function(r){return r()}))})},e.prototype.onResetStore=function(t){var r=this;return this.resetStoreCallbacks.push(t),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.onClearStore=function(t){var r=this;return this.clearStoreCallbacks.push(t),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},e.prototype.refetchQueries=function(t){var r=this.queryManager.refetchQueries(t),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){globalThis.__DEV__!==!1&&ne.debug(17,o)}),a},e.prototype.getObservableQueries=function(t){return t===void 0&&(t="active"),this.queryManager.getObservableQueries(t)},e.prototype.extract=function(t){return this.cache.extract(t)},e.prototype.restore=function(t){return this.cache.restore(t)},e.prototype.addResolvers=function(t){this.localState.addResolvers(t)},e.prototype.setResolvers=function(t){this.localState.setResolvers(t)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},e.prototype.setLink=function(t){this.link=this.queryManager.link=t},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();globalThis.__DEV__!==!1&&(sl.prototype.getMemoryInternals=W0);var Ci=new Map,ko=new Map,cl=!0,_i=!1;function ul(e){return e.replace(/[\s,]+/g," ").trim()}function Jg(e){return ul(e.source.body.substring(e.start,e.end))}function Zg(e){var t=new Set,r=[];return e.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=Jg(n.loc),o=ko.get(i);o&&!o.has(a)?cl&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
166
|
+
`),_=fg(T.slice(0,O)),m=_["content-type"],m&&m.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(C=T.slice(O),C){if(S=yu(e,C),Object.keys(S).length>1||"data"in S||"incremental"in S||"errors"in S||"payload"in S)if(Wp(S)){if(P={},"payload"in S){if(Object.keys(S).length===1&&S.payload===null)return[2];P=D({},S.payload)}"errors"in S&&(P=D(D({},P),{extensions:D(D({},"extensions"in P?P.extensions:null),(j={},j[co]=S.errors,j))})),t(P)}else t(S);else if(Object.keys(S).length===1&&"hasNext"in S&&!S.hasNext)return[2]}x=s.indexOf(o)}return[3,1];case 3:return[2]}})})}function fg(e){var t={};return e.split(`
|
|
167
|
+
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();t[i]=a}}),t}function yu(e,t){if(e.status>=300){var r=function(){try{return JSON.parse(t)}catch{return t}};du(e,r(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(i){var n=i;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}function dg(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}function hg(e){return function(t){return t.text().then(function(r){return yu(t,r)}).then(function(r){return!Array.isArray(r)&&!vu.call(r,"data")&&!vu.call(r,"errors")&&du(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(n){return n.operationName}):e.operationName,"'.")),r})}}var uo=function(e,t){var r;try{r=JSON.stringify(e)}catch(i){var n=yt(40,t,i.message);throw n.parseError=i,n}return r},pg={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},gg={accept:"*/*","content-type":"application/json"},vg={method:"POST"},yg={http:pg,headers:gg,options:vg},mg=function(e,t){return t(e)};function bg(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=D(D(D({},i),d.options),{headers:D(D({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=D(D({},a),d.http)}),i.headers&&(i.headers=Eg(i.headers,a.preserveHeaderCase));var o=e.operationName,s=e.extensions,c=e.variables,u=e.query,l={operationName:o,variables:c};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=t(u,yi)),{options:i,body:l}}function Eg(e,t){if(!t){var r={};return Object.keys(Object(e)).forEach(function(a){r[a.toLowerCase()]=e[a]}),r}var n={};Object.keys(Object(e)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:e[a]}});var i={};return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var wg=function(e){if(!e&&typeof fetch>"u")throw yt(38)},xg=function(e,t){var r=e.getContext(),n=r.uri;return n||(typeof t=="function"?t(e):t||"/graphql")};function Sg(e,t){var r=[],n=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=uo(t.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(t.extensions){var a=void 0;try{a=uo(t.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=e,c=e.indexOf("#");c!==-1&&(o=e.substr(c),s=e.substr(0,c));var u=s.indexOf("?")===-1?"?":"&",l=s+u+r.join("&")+o;return{newURI:l}}var mu=Ft(function(){return fetch}),Og=function(e){e===void 0&&(e={});var t=e.uri,r=t===void 0?"/graphql":t,n=e.fetch,i=e.print,a=i===void 0?mg:i,o=e.includeExtensions,s=e.preserveHeaderCase,c=e.useGETForQueries,u=e.includeUnusedVariables,l=u===void 0?!1:u,d=At(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&wg(n||mu);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new En(function(v){var E=xg(v,r),x=v.getContext(),T={};if(x.clientAwareness){var O=x.clientAwareness,_=O.name,m=O.version;_&&(T["apollographql-client-name"]=_),m&&(T["apollographql-client-version"]=m)}var C=D(D({},T),x.headers),S={http:x.http,options:x.fetchOptions,credentials:x.credentials,headers:C};if(cn(["client"],v.query)){var P=Zc(v.query);if(!P)return oo(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`."));v.query=P}var A=bg(v,a,yg,f,S),j=A.options,U=A.body;U.variables&&!l&&(U.variables=Xp(U.variables,v.query));var V;!j.signal&&typeof AbortController<"u"&&(V=new AbortController,j.signal=V.signal);var me=function(Z){return Z.kind==="OperationDefinition"&&Z.operation==="mutation"},Le=function(Z){return Z.kind==="OperationDefinition"&&Z.operation==="subscription"},ye=Le(dn(v.query)),Se=cn(["defer"],v.query);if(c&&!v.query.definitions.some(me)&&(j.method="GET"),Se||ye){j.headers=j.headers||{};var Ve="multipart/mixed;";ye&&Se&&globalThis.__DEV__!==!1&&ne.warn(39),ye?Ve+="boundary=graphql;subscriptionSpec=1.0,application/json":Se&&(Ve+="deferSpec=20220824,application/json"),j.headers.accept=Ve}if(j.method==="GET"){var Pe=Sg(E,U),Y=Pe.newURI,$=Pe.parseError;if($)return oo($);E=Y}else try{j.body=uo(U,"Payload")}catch(Z){return oo(Z)}return new je(function(Z){var N=n||Ft(function(){return fetch})||mu,R=Z.next.bind(Z);return N(E,j).then(function(K){var se;v.setContext({response:K});var ee=(se=K.headers)===null||se===void 0?void 0:se.get("content-type");return ee!==null&&/^multipart\/mixed/i.test(ee)?lg(K,R):hg(v)(K).then(R)}).then(function(){V=void 0,Z.complete()}).catch(function(K){V=void 0,dg(K,Z)}),function(){V&&V.abort()}})})},Tg=function(e){Qt(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,Og(r).request)||this;return n.options=r,n}return t}(En);const{toString:bu,hasOwnProperty:Cg}=Object.prototype,Eu=Function.prototype.toString,lo=new Map;function Fe(e,t){try{return fo(e,t)}finally{lo.clear()}}function fo(e,t){if(e===t)return!0;const r=bu.call(e),n=bu.call(t);if(r!==n)return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(xu(e,t))return!0;const i=wu(e),a=wu(t),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Cg.call(t,i[s]))return!1;for(let s=0;s<o;++s){const c=i[s];if(!fo(e[c],t[c]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!==e)return t!==t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(xu(e,t))return!0;const i=e.entries(),a=r==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[s,c]=o.value;if(!t.has(s)||a&&!fo(c,t.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]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let i=e.byteLength;if(i===t.byteLength)for(;i--&&e[i]===t[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=Eu.call(e);return i!==Eu.call(t)?!1:!Dg(i,kg)}}return!1}function wu(e){return Object.keys(e).filter(_g,e)}function _g(e){return this[e]!==void 0}const kg="{ [native code] }";function Dg(e,t){const r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function xu(e,t){let r=lo.get(e);if(r){if(r.has(t))return!0}else lo.set(e,r=new Set);return r.add(t),!1}function Su(e,t,r,n){var i=t.data,a=At(t,["data"]),o=r.data,s=At(r,["data"]);return Fe(a,s)&&Si(dn(e).selectionSet,i,o,{fragmentMap:li(pi(e)),variables:n})}function Si(e,t,r,n){if(t===r)return!0;var i=new Set;return e.selections.every(function(a){if(i.has(a)||(i.add(a),!sn(a,n.variables))||Ou(a))return!0;if(cr(a)){var o=sr(a),s=t&&t[o],c=r&&r[o],u=a.selectionSet;if(!u)return Fe(s,c);var l=Array.isArray(s),d=Array.isArray(c);if(l!==d)return!1;if(l&&d){var f=s.length;if(c.length!==f)return!1;for(var v=0;v<f;++v)if(!Si(u,s[v],c[v],n))return!1;return!0}return Si(u,s,c,n)}else{var E=fi(a,n.fragmentMap);if(E)return Ou(E)?!0:Si(E.selectionSet,t,r,n)}})}function Ou(e){return!!e.directives&&e.directives.some(Mg)}function Mg(e){return e.name.value==="nonreactive"}var Tu=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=pn(F0,{max:Wt["cache.fragmentQueryDocuments"]||1e3,cache:di})}return e.prototype.batch=function(t){var r=this,n=typeof t.optimistic=="string"?t.optimistic:t.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=t.update(r)},n),i},e.prototype.recordOptimisticTransaction=function(t,r){this.performTransaction(t,r)},e.prototype.transformDocument=function(t){return t},e.prototype.transformForLink=function(t){return t},e.prototype.identify=function(t){},e.prototype.gc=function(){return[]},e.prototype.modify=function(t){return!1},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(D(D({},t),{rootId:t.id||"ROOT_QUERY",optimistic:r}))},e.prototype.watchFragment=function(t){var r=this,n=t.fragment,i=t.fragmentName,a=t.from,o=t.optimistic,s=o===void 0?!0:o,c=At(t,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(n,i),l=D(D({},c),{returnPartialData:!0,id:typeof a>"u"||typeof a=="string"?a:this.identify(a),query:u,optimistic:s}),d;return new je(function(f){return r.watch(D(D({},l),{immediate:!0,callback:function(v){if(!(d&&Su(u,{data:d==null?void 0:d.result},{data:v.result}))){var E={data:v.result,complete:!!v.complete};v.missing&&(E.missing=mi(v.missing.map(function(x){return x.missing}))),d=v,f.next(E)}}}))})},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(D(D({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:r}))},e.prototype.writeQuery=function(t){var r=t.id,n=t.data,i=At(t,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(t){var r=t.id,n=t.data,i=t.fragment,a=t.fragmentName,o=At(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},e.prototype.updateQuery=function(t,r){return this.batch({update:function(n){var i=n.readQuery(t),a=r(i);return a==null?i:(n.writeQuery(D(D({},t),{data:a})),a)}})},e.prototype.updateFragment=function(t,r){return this.batch({update:function(n){var i=n.readFragment(t),a=r(i);return a==null?i:(n.writeFragment(D(D({},t),{data:a})),a)}})},e}();globalThis.__DEV__!==!1&&(Tu.prototype.getMemoryInternals=W0);var Cu=function(e){Qt(t,e);function t(r,n,i,a){var o,s=e.call(this,r)||this;if(s.message=r,s.path=n,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__=t.prototype,s}return t}(Error),it=Object.prototype.hasOwnProperty;function wn(e){return e==null}function _u(e,t){var r=e.__typename,n=e.id,i=e._id;if(typeof r=="string"&&(t&&(t.keyObject=wn(n)?wn(i)?void 0:{_id:i}:{id:n}),wn(n)&&!wn(i)&&(n=i),!wn(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var ku={dataIdFromObject:_u,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Lg(e){return Er(ku,e)}function Du(e){var t=e.canonizeResults;return t===void 0?ku.canonizeResults:t}function Ig(e,t){return Me(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var Mu=/^[_a-z][_0-9a-z]*/i;function fr(e){var t=e.match(Mu);return t?t[0]:e}function ho(e,t,r){return He(t)?ze(t)?t.every(function(n){return ho(e,n,r)}):e.selections.every(function(n){if(cr(n)&&sn(n,r)){var i=sr(n);return it.call(t,i)&&(!n.selectionSet||ho(n.selectionSet,t[i],r))}return!0}):!1}function Hr(e){return He(e)&&!Me(e)&&!ze(e)}function Pg(){return new lr}function Lu(e,t){var r=li(pi(e));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&t&&(i=t.lookup(n)),i||null}}}var Oi=Object.create(null),po=function(){return Oi},Iu=Object.create(null),xn=function(){function e(t,r){var n=this;this.policies=t,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return yn(Me(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return Me(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Fr(i);if(Me(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Fr(o);return a&&n.merge(o,i),s}}}return e.prototype.toObject=function(){return D({},this.data)},e.prototype.has=function(t){return this.lookup(t,!0)!==void 0},e.prototype.get=function(t,r){if(this.group.depend(t,r),it.call(this.data,t)){var n=this.data[t];if(n&&it.call(n,r))return n[r]}if(r==="__typename"&&it.call(this.policies.rootTypenamesById,t))return this.policies.rootTypenamesById[t];if(this instanceof dr)return this.parent.get(t,r)},e.prototype.lookup=function(t,r){if(r&&this.group.depend(t,"__exists"),it.call(this.data,t))return this.data[t];if(this instanceof dr)return this.parent.lookup(t,r);if(this.policies.rootTypenamesById[t])return Object.create(null)},e.prototype.merge=function(t,r){var n=this,i;Me(t)&&(t=t.__ref),Me(r)&&(r=r.__ref);var a=typeof t=="string"?this.lookup(i=t):t,o=typeof r=="string"?this.lookup(i=r):r;if(o){ne(typeof i=="string",1);var s=new lr(Ag).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=fr(u);l!==u&&!n.policies.hasKeyArgs(s.__typename,l)&&(c[l]=1),s[u]===void 0&&!(n instanceof dr)&&delete s[u]}}),c.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete c.__typename,Object.keys(c).forEach(function(u){return n.group.dirty(i,u)})}}},e.prototype.modify=function(t,r){var n=this,i=this.lookup(t);if(i){var a=Object.create(null),o=!1,s=!0,c={DELETE:Oi,INVALIDATE:Iu,isReference:Me,toReference:this.toReference,canRead:this.canRead,readField:function(u,l){return n.policies.readField(typeof u=="string"?{fieldName:u,from:l||Fr(t)}:u,{store:n})}};if(Object.keys(i).forEach(function(u){var l=fr(u),d=i[u];if(d!==void 0){var f=typeof r=="function"?r:r[u]||r[l];if(f){var v=f===po?Oi:f(yn(d),D(D({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(t,u)}));if(v===Iu)n.group.dirty(t,u);else if(v===Oi&&(v=void 0),v!==d&&(a[u]=v,o=!0,d=v,globalThis.__DEV__!==!1)){var E=function(S){if(n.lookup(S.__ref)===void 0)return globalThis.__DEV__!==!1&&ne.warn(2,S),!0};if(Me(v))E(v);else if(Array.isArray(v))for(var x=!1,T=void 0,O=0,_=v;O<_.length;O++){var m=_[O];if(Me(m)){if(x=!0,E(m))break}else if(typeof m=="object"&&m){var C=n.policies.identify(m)[0];C&&(T=m)}if(x&&T!==void 0){globalThis.__DEV__!==!1&&ne.warn(3,T);break}}}}d!==void 0&&(s=!1)}}),o)return this.merge(t,a),s&&(this instanceof dr?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},e.prototype.delete=function(t,r,n){var i,a=this.lookup(t);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(t,s?(i={},i[s]=po,i):po)}return!1},e.prototype.evict=function(t,r){var n=!1;return t.id&&(it.call(this.data,t.id)&&(n=this.delete(t.id,t.fieldName,t.args)),this instanceof dr&&this!==r&&(n=this.parent.evict(t,r)||n),(t.fieldName||n)&&this.group.dirty(t.id,t.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var t=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){it.call(t.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},e.prototype.replace=function(t){var r=this;if(Object.keys(this.data).forEach(function(a){t&&it.call(t,a)||r.delete(a)}),t){var n=t.__META,i=At(t,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(t){return this.rootIds[t]=(this.rootIds[t]||0)+1},e.prototype.release=function(t){if(this.rootIds[t]>0){var r=--this.rootIds[t];return r||delete this.rootIds[t],r}return 0},e.prototype.getRootIdSet=function(t){return t===void 0&&(t=new Set),Object.keys(this.rootIds).forEach(t.add,t),this instanceof dr?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t},e.prototype.gc=function(){var t=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){it.call(n,o)&&(Object.keys(t.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof dr;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},e.prototype.findChildRefIds=function(t){if(!it.call(this.refs,t)){var r=this.refs[t]=Object.create(null),n=this.data[t];if(!n)return r;var i=new Set([n]);i.forEach(function(a){Me(a)&&(r[a.__ref]=!0),He(a)&&Object.keys(a).forEach(function(o){var s=a[o];He(s)&&i.add(s)})})}return this.refs[t]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Pu=function(){function e(t,r){r===void 0&&(r=null),this.caching=t,this.parent=r,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?Qc():null,this.keyMaker=new Pr(Nr)},e.prototype.depend=function(t,r){if(this.d){this.d(go(t,r));var n=fr(r);n!==r&&this.d(go(t,n)),this.parent&&this.parent.depend(t,r)}},e.prototype.dirty=function(t,r){this.d&&this.d.dirty(go(t,r),r==="__exists"?"forget":"setDirty")},e}();function go(e,t){return t+"#"+e}function Nu(e,t){Sn(e)&&e.group.depend(t,"__exists")}(function(e){var t=function(r){Qt(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,c=i.seed,u=r.call(this,a,new Pu(s))||this;return u.stump=new Ng(u),u.storageTrie=new Pr(Nr),c&&u.replace(c),u}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(e);e.Root=t})(xn||(xn={}));var dr=function(e){Qt(t,e);function t(r,n,i,a){var o=e.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return t.prototype.addLayer=function(r,n){return new t(r,this,n,this.group)},t.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(c){Fe(o[c],s[c])||n.group.dirty(a,c)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(c){n.group.dirty(a,c)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return D(D({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return it.call(this.data,r)?D(D({},n),e.prototype.findChildRefIds.call(this,r)):n},t.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},t}(xn),Ng=function(e){Qt(t,e);function t(r){return e.call(this,"EntityStore.Stump",r,function(){},new Pu(r.group.caching,r.group))||this}return t.prototype.removeLayer=function(){return this},t.prototype.merge=function(r,n){return this.parent.merge(r,n)},t}(dr);function Ag(e,t,r){var n=e[r],i=t[r];return Fe(n,i)?n:i}function Sn(e){return!!(e instanceof xn&&e.group.caching)}function Fg(e){return He(e)?ze(e)?e.slice(0):D({__proto__:Object.getPrototypeOf(e)},e):e}var Au=function(){function e(){this.known=new(xc?WeakSet:Set),this.pool=new Pr(Nr),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(t){return He(t)&&this.known.has(t)},e.prototype.pass=function(t){if(He(t)){var r=Fg(t);return this.passes.set(r,t),r}return t},e.prototype.admit=function(t){var r=this;if(He(t)){var n=this.passes.get(t);if(n)return n;var i=Object.getPrototypeOf(t);switch(i){case Array.prototype:{if(this.known.has(t))return t;var a=t.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(t))return t;var s=Object.getPrototypeOf(t),c=[s],u=this.sortedKeys(t);c.push(u.json);var l=c.length;u.sorted.forEach(function(v){c.push(r.admit(t[v]))});var o=this.pool.lookupArray(c);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),u.sorted.forEach(function(v,E){d[v]=c[l+E]}),globalThis.__DEV__!==!1&&Object.freeze(d)}return o.object}}}return t},e.prototype.sortedKeys=function(t){var r=Object.keys(t),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},e}();function Fu(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var Rg=function(){function e(t){var r=this;this.knownResults=new(Nr?WeakMap:Map),this.config=Er(t,{addTypename:t.addTypename!==!1,canonizeResults:Du(t)}),this.canon=t.canon||new Au,this.executeSelectionSet=pn(function(n){var i,a=n.context.canonizeResults,o=Fu(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?D(D({},s),{result:r.canon.admit(s.result)}):s:(Nu(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize||Wt["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Fu,makeCacheKey:function(n,i,a,o){if(Sn(a.store))return a.store.makeCacheKey(n,Me(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=pn(function(n){return Nu(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize||Wt["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(Sn(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return e.prototype.resetCanon=function(){this.canon=new Au},e.prototype.diffQueryAgainstStore=function(t){var r=t.store,n=t.query,i=t.rootId,a=i===void 0?"ROOT_QUERY":i,o=t.variables,s=t.returnPartialData,c=s===void 0?!0:s,u=t.canonizeResults,l=u===void 0?this.config.canonizeResults:u,d=this.config.cache.policies;o=D(D({},Ua(Dc(n))),o);var f=Fr(a),v=this.executeSelectionSet({selectionSet:dn(n).selectionSet,objectOrReference:f,enclosingRef:f,context:D({store:r,query:n,policies:d,variables:o,varString:or(o),canonizeResults:l},Lu(n,this.config.fragments))}),E;if(v.missing&&(E=[new Cu(jg(v.missing),v.missing,n,o)],!c))throw E[0];return{result:v.result,complete:!E,missing:E}},e.prototype.isFresh=function(t,r,n,i){if(Sn(i.store)&&this.knownResults.get(t)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(t));if(a&&t===a.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(t){var r=this,n=t.selectionSet,i=t.objectOrReference,a=t.enclosingRef,o=t.context;if(Me(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"),d=[],f,v=new lr;this.config.addTypename&&typeof l=="string"&&!c.rootIdsByTypename[l]&&d.push({__typename:l});function E(m,C){var S;return m.missing&&(f=v.merge(f,(S={},S[C]=m.missing,S))),m.result}var x=new Set(n.selections);x.forEach(function(m){var C,S;if(sn(m,s))if(cr(m)){var P=c.readField({fieldName:m.name.value,field:m,variables:o.variables,from:i},o),A=sr(m);P===void 0?Ya.added(m)||(f=v.merge(f,(C={},C[A]="Can't find field '".concat(m.name.value,"' on ").concat(Me(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),C))):ze(P)?P.length>0&&(P=E(r.executeSubSelectedArray({field:m,array:P,enclosingRef:a,context:o}),A)):m.selectionSet?P!=null&&(P=E(r.executeSelectionSet({selectionSet:m.selectionSet,objectOrReference:P,enclosingRef:Me(P)?P:a,context:o}),A)):o.canonizeResults&&(P=r.canon.pass(P)),P!==void 0&&d.push((S={},S[A]=P,S))}else{var j=fi(m,o.lookupFragment);if(!j&&m.kind===G.FRAGMENT_SPREAD)throw yt(9,m.name.value);j&&c.fragmentMatches(j,l)&&j.selectionSet.selections.forEach(x.add,x)}});var T=mi(d),O={result:T,missing:f},_=o.canonizeResults?this.canon.admit(O):yn(O);return _.result&&this.knownResults.set(_.result,n),_},e.prototype.execSubSelectedArrayImpl=function(t){var r=this,n=t.field,i=t.array,a=t.enclosingRef,o=t.context,s,c=new lr;function u(l,d){var f;return l.missing&&(s=c.merge(s,(f={},f[d]=l.missing,f))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:ze(l)?u(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?u(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:Me(l)?l:a,context:o}),d):(globalThis.__DEV__!==!1&&Vg(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},e}();function jg(e){try{JSON.stringify(e,function(t,r){if(typeof r=="string")throw r;return r})}catch(t){return t}}function Vg(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach(function(i){He(i)&&(ne(!Me(i),10,Ig(e,i),t.name.value),Object.values(i).forEach(n.add,n))})}}var vo=new Nc,Ru=new WeakMap;function On(e){var t=Ru.get(e);return t||Ru.set(e,t={vars:new Set,dep:Qc()}),t}function ju(e){On(e).vars.forEach(function(t){return t.forgetCache(e)})}function qg(e){On(e).vars.forEach(function(t){return t.attachCache(e)})}function $g(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(c){On(c).dep.dirty(n),Ug(c)});var o=Array.from(r);r.clear(),o.forEach(function(c){return c(e)})}}else{var s=vo.getValue();s&&(i(s),On(s).dep(n))}return e};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return t.add(a),On(a).vars.add(n),n};return n.forgetCache=function(a){return t.delete(a)},n}function Ug(e){e.broadcastWatches&&e.broadcastWatches()}var Vu=Object.create(null);function yo(e){var t=JSON.stringify(e);return Vu[t]||(Vu[t]=Object.create(null))}function qu(e){var t=yo(e);return t.keyFieldsFn||(t.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=mo(e,function(o){var s=zr(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&it.call(r,o[0])&&(s=zr(r,o,Bu)),ne(s!==void 0,4,o.join("."),r),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function $u(e){var t=yo(e);return t.keyArgsFn||(t.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=mo(e,function(u){var l=u[0],d=l.charAt(0);if(d==="@"){if(i&&Mt(i.directives)){var f=l.slice(1),v=i.directives.find(function(O){return O.name.value===f}),E=v&&hi(v,a);return E&&zr(E,u.slice(1))}return}if(d==="$"){var x=l.slice(1);if(a&&it.call(a,x)){var T=u.slice(0);return T[0]=x,zr(a,T)}return}if(r)return zr(r,u)}),c=JSON.stringify(s);return(r||c!=="{}")&&(o+=":"+c),o})}function mo(e,t){var r=new lr;return Uu(e).reduce(function(n,i){var a,o=t(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function Uu(e){var t=yo(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach(function(i,a){ze(i)?(Uu(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ze(e[a+1])||(r.push(n.slice(0)),n.length=0))})}return t.paths}function Bu(e,t){return e[t]}function zr(e,t,r){return r=r||Bu,Hu(t.reduce(function n(i,a){return ze(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},e))}function Hu(e){return He(e)?ze(e)?e.map(Hu):mo(Object.keys(e).sort(),function(t){return zr(e,t)}):e}function bo(e){return e.args!==void 0?e.args:e.field?hi(e.field,e.variables):null}var Bg=function(){},zu=function(e,t){return t.fieldName},Qu=function(e,t,r){var n=r.mergeObjects;return n(e,t)},Wu=function(e,t){return t},Hg=function(){function e(t){this.config=t,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=D({dataIdFromObject:_u},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return e.prototype.identify=function(t,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||t.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||t,s=D(D({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var f=Eo(arguments,o);return i.readField(f,{store:i.cache.data,variables:f.variables})}}),c,u=a&&this.getTypePolicy(a),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var d=l(D(D({},t),o),s);if(ze(d))l=qu(d);else{c=d;break}}return c=c?String(c):void 0,s.keyObject?[c,s.keyObject]:[c]},e.prototype.addTypePolicies=function(t){var r=this;Object.keys(t).forEach(function(n){var i=t[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,c=At(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),it.call(r.toBeAdded,n)?r.toBeAdded[n].push(c):r.toBeAdded[n]=[c]})},e.prototype.updateTypePolicy=function(t,r){var n=this,i=this.getTypePolicy(t),a=r.keyFields,o=r.fields;function s(c,u){c.merge=typeof u=="function"?u:u===!0?Qu:u===!1?Wu:c.merge}s(i,r.merge),i.keyFn=a===!1?Bg:ze(a)?qu(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(c){var u=n.getFieldPolicy(t,c,!0),l=o[c];if(typeof l=="function")u.read=l;else{var d=l.keyArgs,f=l.read,v=l.merge;u.keyFn=d===!1?zu:ze(d)?$u(d):typeof d=="function"?d:u.keyFn,typeof f=="function"&&(u.read=f),s(u,v)}u.read&&u.merge&&(u.keyFn=u.keyFn||zu)})},e.prototype.setRootTypename=function(t,r){r===void 0&&(r=t);var n="ROOT_"+t.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(ne(!i||i===t,5,t),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},e.prototype.addPossibleTypes=function(t){var r=this;this.usingPossibleTypes=!0,Object.keys(t).forEach(function(n){r.getSupertypeSet(n,!0),t[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(Mu);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},e.prototype.getTypePolicy=function(t){var r=this;if(!it.call(this.typePolicies,t)){var n=this.typePolicies[t]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(t);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach(function(o,s){if(o.test(t)){var c=r.supertypeMap.get(s);c&&c.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),c=s.fields,u=At(s,["fields"]);Object.assign(n,u),Object.assign(n.fields,c)})}var a=this.toBeAdded[t];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(t,o)}),this.typePolicies[t]},e.prototype.getFieldPolicy=function(t,r,n){if(t){var i=this.getTypePolicy(t).fields;return i[r]||n&&(i[r]=Object.create(null))}},e.prototype.getSupertypeSet=function(t,r){var n=this.supertypeMap.get(t);return!n&&r&&this.supertypeMap.set(t,n=new Set),n},e.prototype.fragmentMatches=function(t,r,n,i){var a=this;if(!t.typeCondition)return!0;if(!r)return!1;var o=t.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),c=[s],u=function(E){var x=a.getSupertypeSet(E,!1);x&&x.size&&c.indexOf(x)<0&&c.push(x)},l=!!(n&&this.fuzzySubtypes.size),d=!1,f=0;f<c.length;++f){var v=c[f];if(v.has(o))return s.has(o)||(d&&globalThis.__DEV__!==!1&&ne.warn(6,r,o),s.add(o)),!0;v.forEach(u),l&&f===c.length-1&&ho(t.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(E,x){var T=r.match(E);T&&T[0]===r&&u(x)}))}return!1},e.prototype.hasKeyArgs=function(t,r){var n=this.getFieldPolicy(t,r,!1);return!!(n&&n.keyFn)},e.prototype.getStoreFieldName=function(t){var r=t.typename,n=t.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:t.field||null,variables:t.variables},c=bo(t);o;){var u=o(c,s);if(ze(u))o=$u(u);else{a=u||n;break}}return a===void 0&&(a=t.field?lp(t.field,t.variables):kc(n,bo(t))),a===!1?n:n===fr(a)?a:n+":"+a},e.prototype.readField=function(t,r){var n=t.from;if(n){var i=t.field||t.fieldName;if(i){if(t.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(t.typename=a)}var o=this.getStoreFieldName(t),s=fr(o),c=r.store.getFieldValue(n,o),u=this.getFieldPolicy(t.typename,s,!1),l=u&&u.read;if(l){var d=Gu(this,n,t,r,r.store.getStorage(Me(n)?n.__ref:n,o));return vo.withValue(this.cache,l,[c,d])}return c}}},e.prototype.getReadFunction=function(t,r){var n=this.getFieldPolicy(t,r,!1);return n&&n.read},e.prototype.getMergeFunction=function(t,r,n){var i=this.getFieldPolicy(t,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},e.prototype.runMergeFunction=function(t,r,n,i,a){var o=n.field,s=n.typename,c=n.merge;return c===Qu?Yu(i.store)(t,r):c===Wu?r:(i.overwrite&&(t=void 0),c(t,r,Gu(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},e}();function Gu(e,t,r,n,i){var a=e.getStoreFieldName(r),o=fr(a),s=r.variables||n.variables,c=n.store,u=c.toReference,l=c.canRead;return{args:bo(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:Me,toReference:u,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(Eo(arguments,t,s),n)},mergeObjects:Yu(n.store)}}function Eo(e,t,r){var n=e[0],i=e[1],a=e.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:t}:(o=D({},n),it.call(o,"from")||(o.from=t)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&ne.warn(7,tc(Array.from(e))),o.variables===void 0&&(o.variables=r),o}function Yu(e){return function(r,n){if(ze(r)||ze(n))throw yt(8);if(He(r)&&He(n)){var i=e.getFieldValue(r,"__typename"),a=e.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(Me(r)&&Hr(n))return e.merge(r.__ref,n),r;if(Hr(r)&&Me(n))return e.merge(r,n.__ref),n;if(Hr(r)&&Hr(n))return D(D({},r),n)}return n}}function wo(e,t,r){var n="".concat(t).concat(r),i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:D(D({},e),{clientOnly:t,deferred:r})),i}var zg=function(){function e(t,r,n){this.cache=t,this.reader=r,this.fragments=n}return e.prototype.writeToStore=function(t,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,c=r.overwrite,u=fn(i),l=Pg();s=D(D({},Ua(u)),s);var d=D(D({store:t,written:Object.create(null),merge:function(v,E){return l.merge(v,E)},variables:s,varString:or(s)},Lu(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:d});if(!Me(f))throw yt(11,a);return d.incomingById.forEach(function(v,E){var x=v.storeObject,T=v.mergeTree,O=v.fieldNodeSet,_=Fr(E);if(T&&T.map.size){var m=n.applyMerges(T,_,x,d);if(Me(m))return;x=m}if(globalThis.__DEV__!==!1&&!d.overwrite){var C=Object.create(null);O.forEach(function(A){A.selectionSet&&(C[A.name.value]=!0)});var S=function(A){return C[fr(A)]===!0},P=function(A){var j=T&&T.map.get(A);return!!(j&&j.info&&j.info.merge)};Object.keys(x).forEach(function(A){S(A)&&!P(A)&&Qg(_,x,A,d.store)})}t.merge(E,x)}),t.retain(f.__ref),f},e.prototype.processSelectionSet=function(t){var r=this,n=t.dataId,i=t.result,a=t.selectionSet,o=t.context,s=t.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||qa(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(u.__typename=l);var d=function(){var m=Eo(arguments,u,o.variables);if(Me(m.from)){var C=o.incomingById.get(m.from.__ref);if(C){var S=c.readField(D(D({},m),{from:C.storeObject}),o);if(S!==void 0)return S}}return c.readField(m,o)},f=new Set;this.flattenFields(a,i,o,l).forEach(function(m,C){var S,P=sr(C),A=i[P];if(f.add(C),A!==void 0){var j=c.getStoreFieldName({typename:l,fieldName:C.name.value,field:C,variables:m.variables}),U=Xu(s,j),V=r.processFieldValue(A,C,C.selectionSet?wo(m,!1,!1):m,U),me=void 0;C.selectionSet&&(Me(V)||Hr(V))&&(me=d("__typename",V));var Le=c.getMergeFunction(l,C.name.value,me);Le?U.info={field:C,typename:l,merge:Le}:Ju(s,j),u=m.merge(u,(S={},S[j]=V,S))}else globalThis.__DEV__!==!1&&!m.clientOnly&&!m.deferred&&!Ya.added(C)&&!c.getReadFunction(l,C.name.value)&&globalThis.__DEV__!==!1&&ne.error(12,sr(C),i)});try{var v=c.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:u,readField:d}),E=v[0],x=v[1];n=n||E,x&&(u=o.merge(u,x))}catch(m){if(!n)throw m}if(typeof n=="string"){var T=Fr(n),O=o.written[n]||(o.written[n]=[]);if(O.indexOf(a)>=0||(O.push(a),this.reader&&this.reader.isFresh(i,T,a,o)))return T;var _=o.incomingById.get(n);return _?(_.storeObject=o.merge(_.storeObject,u),_.mergeTree=xo(_.mergeTree,s),f.forEach(function(m){return _.fieldNodeSet.add(m)})):o.incomingById.set(n,{storeObject:u,mergeTree:Ti(s)?void 0:s,fieldNodeSet:f}),T}return u},e.prototype.processFieldValue=function(t,r,n,i){var a=this;return!r.selectionSet||t===null?globalThis.__DEV__!==!1?cu(t):t:ze(t)?t.map(function(o,s){var c=a.processFieldValue(o,r,n,Xu(i,s));return Ju(i,s),c}):this.processSelectionSet({result:t,selectionSet:r.selectionSet,context:n,mergeTree:i})},e.prototype.flattenFields=function(t,r,n,i){i===void 0&&(i=qa(r,t,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Pr(!1);return function c(u,l){var d=s.lookup(u,l.clientOnly,l.deferred);d.visited||(d.visited=!0,u.selections.forEach(function(f){if(sn(f,n.variables)){var v=l.clientOnly,E=l.deferred;if(!(v&&E)&&Mt(f.directives)&&f.directives.forEach(function(O){var _=O.name.value;if(_==="client"&&(v=!0),_==="defer"){var m=hi(O,n.variables);(!m||m.if!==!1)&&(E=!0)}}),cr(f)){var x=a.get(f);x&&(v=v&&x.clientOnly,E=E&&x.deferred),a.set(f,wo(n,v,E))}else{var T=fi(f,n.lookupFragment);if(!T&&f.kind===G.FRAGMENT_SPREAD)throw yt(13,f.name.value);T&&o.fragmentMatches(T,i,r,n.variables)&&c(T.selectionSet,wo(n,v,E))}}}))}(t,n),a},e.prototype.applyMerges=function(t,r,n,i,a){var o,s=this;if(t.map.size&&!Me(n)){var c=!ze(n)&&(Me(r)||Hr(r))?r:void 0,u=n;c&&!a&&(a=[Me(c)?c.__ref:c]);var l,d=function(f,v){return ze(f)?typeof v=="number"?f[v]:void 0:i.store.getFieldValue(f,String(v))};t.map.forEach(function(f,v){var E=d(c,v),x=d(u,v);if(x!==void 0){a&&a.push(v);var T=s.applyMerges(f,E,x,i,a);T!==x&&(l=l||new Map,l.set(v,T)),a&&ne(a.pop()===v)}}),l&&(n=ze(u)?u.slice(0):D({},u),l.forEach(function(f,v){n[v]=f}))}return t.info?this.cache.policies.runMergeFunction(r,n,t.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},e}(),Ku=[];function Xu(e,t){var r=e.map;return r.has(t)||r.set(t,Ku.pop()||{map:new Map}),r.get(t)}function xo(e,t){if(e===t||!t||Ti(t))return e;if(!e||Ti(e))return t;var r=e.info&&t.info?D(D({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i=n?new Map:e.map.size?e.map:t.map,a={info:r,map:i};if(n){var o=new Set(t.map.keys());e.map.forEach(function(s,c){a.map.set(c,xo(s,t.map.get(c))),o.delete(c)}),o.forEach(function(s){a.map.set(s,xo(t.map.get(s),e.map.get(s)))})}return a}function Ti(e){return!e||!(e.info||e.map.size)}function Ju(e,t){var r=e.map,n=r.get(t);n&&Ti(n)&&(Ku.push(n),r.delete(t))}var Zu=new Set;function Qg(e,t,r,n){var i=function(d){var f=n.getFieldValue(d,r);return typeof f=="object"&&f},a=i(e);if(a){var o=i(t);if(o&&!Me(a)&&!Fe(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),c=fr(r),u="".concat(s,".").concat(c);if(!Zu.has(u)){Zu.add(u);var l=[];!ze(a)&&!ze(o)&&[a,o].forEach(function(d){var f=n.getFieldValue(d,"__typename");typeof f=="string"&&!l.includes(f)&&l.push(f)}),globalThis.__DEV__!==!1&&ne.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,D({},a),D({},o))}}}}var el=function(e){Qt(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new Gc(Ya),n.assumeImmutableResults=!0,n.makeVar=$g,n.txCount=0,n.config=Lg(r),n.addTypename=!!n.config.addTypename,n.policies=new Hg({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return t.prototype.init=function(){var r=this.data=new xn.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},t.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new zg(this,this.storeReader=new Rg({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Du(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=pn(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize||Wt["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(Sn(s)){var c=o.optimistic,u=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,or({optimistic:c,id:u,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},t.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},t.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},t.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(D(D({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Cu)return null;throw a}},t.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.modify=function(r){if(it.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(D(D({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(r){var n=this;return this.watches.size||qg(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&ju(n),n.maybeBroadcastWatch.forget(r)}},t.prototype.gc=function(r){var n;or.reset(),yi.reset(),this.addTypenameTransform.resetCache(),(n=this.config.fragments)===null||n===void 0||n.resetCaches();var i=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),i},t.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},t.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},t.prototype.identify=function(r){if(Me(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){globalThis.__DEV__!==!1&&ne.warn(n)}},t.prototype.evict=function(r){if(!r.id){if(it.call(r,"id"))return!1;r=D(D({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.reset=function(r){var n=this;return this.init(),or.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),ju(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},t.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,c=r.onWatchUpdated,u,l=function(f){var v=n,E=v.data,x=v.optimisticData;++n.txCount,f&&(n.data=n.optimisticData=f);try{return u=i(n)}finally{--n.txCount,n.data=E,n.optimisticData=x}},d=new Set;return c&&!this.txCount&&this.broadcastWatches(D(D({},r),{onWatchUpdated:function(f){return d.add(f),!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&&d.size?(this.broadcastWatches(D(D({},r),{onWatchUpdated:function(f,v){var E=c.call(this,f,v);return E!==!1&&d.delete(f),E}})),d.size&&d.forEach(function(f){return n.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(r),u},t.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},t.prototype.transformDocument=function(r){return this.addTypenameToDocument(this.addFragmentsToDocument(r))},t.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},t.prototype.addFragmentsToDocument=function(r){var n=this.config.fragments;return n?n.transform(r):r},t.prototype.addTypenameToDocument=function(r){return this.addTypename?this.addTypenameTransform.transformDocument(r):r},t.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,a=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,i)===!1)||(!i||!Fe(i.result,a.result))&&r.callback(r.lastDiff=a,i)},t}(Tu);globalThis.__DEV__!==!1&&(el.prototype.getMemoryInternals=Q0);var Te;(function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"})(Te||(Te={}));function Tn(e){return e?e<7:!1}var tl=Object.assign,Wg=Object.hasOwnProperty,So=function(e){Qt(t,e);function t(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=e.call(this,function(T){try{var O=T._subscription._observer;O&&!O.error&&(O.error=Gg)}catch{}var _=!o.observers.size;o.observers.add(T);var m=o.last;return m&&m.error?T.error&&T.error(m.error):m&&m.result&&T.next&&T.next(m.result),_&&o.reobserve().catch(function(){}),function(){o.observers.delete(T)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.waitForOwnResult=Oo(a.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var s=n.defaultOptions.watchQuery,c=s===void 0?{}:s,u=c.fetchPolicy,l=u===void 0?"cache-first":u,d=a.fetchPolicy,f=d===void 0?l:d,v=a.initialFetchPolicy,E=v===void 0?f==="standby"?l:f:v;o.options=D(D({},a),{initialFetchPolicy:E,fetchPolicy:f}),o.queryId=i.queryId||n.generateQueryId();var x=fn(o.query);return o.queryName=x&&x.name&&x.name.value,o}return Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||Te.ready,a=D(D({},n),{loading:Tn(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(Oo(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),Fe(a.data,{})&&(a.data=void 0),c.complete?(delete a.partial,c.complete&&a.networkStatus===Te.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=Te.ready,a.loading=!1)):a.partial=!0,globalThis.__DEV__!==!1&&!c.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&nl(c.missing)}return r&&this.updateLastResult(a),a},t.prototype.isDifferentFromLastResult=function(r,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!Su(this.query,this.last.result,r,this.variables):!Fe(this.last.result,r);return i||n&&!Fe(this.last.variables,n)},t.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||Fe(i.variables,this.variables)))return i[r]},t.prototype.getLastResult=function(r){return this.getLast("result",r)},t.prototype.getLastError=function(r){return this.getLast("error",r)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(r){var n,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&&r&&Wg.call(r,"variables")){var o=Dc(this.query),s=o.variableDefinitions;(!s||!s.some(function(c){return c.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&ne.warn(20,r,((n=o.name)===null||n===void 0?void 0:n.value)||o)}return r&&!Fe(this.options.variables,r)&&(i.variables=this.options.variables=D(D({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,Te.refetch)},t.prototype.fetchMore=function(r){var n=this,i=D(D({},r.query?r:D(D(D(D({},this.options),{query:this.options.query}),r),{variables:D(D({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var a=this.queryManager.generateQueryId();this.lastQuery=r.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,s=o.networkStatus;o.networkStatus=Te.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set,u=r==null?void 0:r.updateQuery,l=this.options.fetchPolicy!=="no-cache";return l||ne(u,21),this.queryManager.fetchQuery(a,i,Te.fetchMore).then(function(d){if(n.queryManager.removeQuery(a),o.networkStatus===Te.fetchMore&&(o.networkStatus=s),l)n.queryManager.cache.batch({update:function(E){var x=r.updateQuery;x?E.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(T){return x(T,{fetchMoreResult:d.data,variables:i.variables})}):E.writeQuery({query:i.query,variables:i.variables,data:d.data})},onWatchUpdated:function(E){c.add(E.query)}});else{var f=n.getLast("result"),v=u(f.data,{fetchMoreResult:d.data,variables:i.variables});n.reportResult(D(D({},f),{data:v}),n.variables)}return d}).finally(function(){l&&!c.has(n.query)&&rl(n)})},t.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,c){var u=c.variables;return o(s,{subscriptionData:a,variables:u})})},error:function(a){if(r.onError){r.onError(a);return}globalThis.__DEV__!==!1&&ne.error(22,a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(r){return this.reobserve(r)},t.prototype.silentSetOptions=function(r){var n=Er(this.options,r||{});tl(this.options,n)},t.prototype.setVariables=function(r){return Fe(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},Te.setVariables):Promise.resolve())},t.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},t.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},t.prototype.fetch=function(r,n,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,r,n,i)},t.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){ne(a,23);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){var u,l;r.pollingInfo&&(!Tn(r.queryInfo.networkStatus)&&!(!((l=(u=r.options).skipPollAttempt)===null||l===void 0)&&l.call(u))?r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Te.poll).then(c,c):c())},c=function(){var u=r.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(s,u.interval))};c()}}},t.prototype.updateLastResult=function(r,n){n===void 0&&(n=this.variables);var i=this.getLastError();return i&&this.last&&!Fe(n,this.last.variables)&&(i=void 0),this.last=D({result:this.queryManager.assumeImmutableResults?r:cu(r),variables:n},i?{error:i}:null)},t.prototype.reobserveAsConcast=function(r,n){var i=this;this.isTornDown=!1;var a=n===Te.refetch||n===Te.fetchMore||n===Te.poll,o=this.options.variables,s=this.options.fetchPolicy,c=Er(this.options,r||{}),u=a?c:tl(this.options,c),l=this.transformDocument(u.query);this.lastQuery=l,a||(this.updatePolling(),r&&r.variables&&!Fe(r.variables,o)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===s||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=Te.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=Oo(u.fetchPolicy));var d=function(){i.concast===E&&(i.waitForOwnResult=!1)},f=u.variables&&D({},u.variables),v=this.fetch(u,n,l),E=v.concast,x=v.fromLink,T={next:function(O){Fe(i.variables,f)&&(d(),i.reportResult(O,f))},error:function(O){Fe(i.variables,f)&&(gu(O)||(O=new Jt({networkError:O})),d(),i.reportError(O,f))}};return!a&&(x||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=E,this.observer=T),E.addObserver(T),E},t.prototype.reobserve=function(r,n){return this.reobserveAsConcast(r,n).promise},t.prototype.resubscribeAfterError=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this.last;this.resetLastResults();var a=this.subscribe.apply(this,r);return this.last=i,a},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(r,n){var i=this.getLastError(),a=this.isDifferentFromLastResult(r,n);(i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),(i||a)&&mn(this.observers,"next",r)},t.prototype.reportError=function(r,n){var i=D(D({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:Te.error,loading:!1});this.updateLastResult(i,n),mn(this.observers,"error",this.last.error=r)},t.prototype.hasObservers=function(){return this.observers.size>0},t.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(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(r){return this.queryManager.transform(r)},t}(je);uu(So);function rl(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,a){return this.nextFetchPolicy=n,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,a):r}}):e.reobserve()}function Gg(e){globalThis.__DEV__!==!1&&ne.error(24,e.message,e.stack)}function nl(e){globalThis.__DEV__!==!1&&e&&globalThis.__DEV__!==!1&&ne.debug(25,e)}function Oo(e){return e==="network-only"||e==="no-cache"||e==="standby"}var Qr=new(Nr?WeakMap:Map);function To(e,t){var r=e[t];typeof r=="function"&&(e[t]=function(){return Qr.set(e,(Qr.get(e)+1)%1e15),r.apply(this,arguments)})}function il(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Co=function(){function e(t,r){r===void 0&&(r=t.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=t.cache;Qr.has(n)||(Qr.set(n,0),To(n,"evict"),To(n,"modify"),To(n,"reset"))}return e.prototype.init=function(t){var r=t.networkStatus||Te.loading;return this.variables&&this.networkStatus!==Te.loading&&!Fe(this.variables,t.variables)&&(r=Te.setVariables),Fe(t.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:t.document,variables:t.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),t.observableQuery&&this.setObservableQuery(t.observableQuery),t.lastRequestId&&(this.lastRequestId=t.lastRequestId),this},e.prototype.reset=function(){il(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var t=this.getDiffOptions();if(this.lastDiff&&Fe(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var r=this.observableQuery;if(r&&r.options.fetchPolicy==="no-cache")return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(t,r){this.lastDiff=t?{diff:t,options:r||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(t){var r;return t===void 0&&(t=this.variables),{query:this.document,variables:t,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},e.prototype.setDiff=function(t){var r=this,n,i=this.lastDiff&&this.lastDiff.diff;t&&!t.complete&&(!((n=this.observableQuery)===null||n===void 0)&&n.getLastError())||(this.updateLastDiff(t),!this.dirty&&!Fe(i&&i.result,t&&t.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0))))},e.prototype.setObservableQuery=function(t){var r=this;t!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=t,t?(t.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?t.observe():rl(t)})):delete this.oqListener)},e.prototype.notify=function(){var t=this;il(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(t)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Tn(this.networkStatus)&&this.observableQuery){var t=this.observableQuery.options.fetchPolicy;if(t!=="cache-only"&&t!=="cache-and-network")return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(t){var r=this;t===void 0&&(t=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=D(D({},this.getDiffOptions(t)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!Fe(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(t,r){var n=this.lastWrite;return!(n&&n.dmCount===Qr.get(this.cache)&&Fe(r,n.variables)&&Fe(t.data,n.result.data))},e.prototype.markResult=function(t,r,n,i){var a=this,o=new lr,s=Mt(t.errors)?t.errors.slice(0):[];if(this.reset(),"incremental"in t&&Mt(t.incremental)){var c=fu(this.getDiff().result,t);t.data=c}else if("hasNext"in t&&t.hasNext){var u=this.getDiff();t.data=o.merge(u.result,t.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:t.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(_o(t,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(t,n.variables))l.writeQuery({query:r,data:t.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:t,variables:n.variables,dmCount:Qr.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){t.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),f=l.diff(d);!a.stopped&&Fe(a.variables,n.variables)&&a.updateWatch(n.variables),a.updateLastDiff(f,d),f.complete&&(t.data=f.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Te.ready},e.prototype.markError=function(t){return this.networkStatus=Te.error,this.lastWrite=void 0,this.reset(),t.graphQLErrors&&(this.graphQLErrors=t.graphQLErrors),t.networkError&&(this.networkError=t.networkError),t},e}();function _o(e,t){t===void 0&&(t="none");var r=t==="ignore"||t==="all",n=!wi(e);return!n&&r&&e.data&&(n=!0),n}var Yg=Object.prototype.hasOwnProperty,al=Object.create(null),Kg=function(){function e(t){var r=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new Fa(Wt["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Pr(!1);var n=new Gc(function(a){return r.cache.transformDocument(a)},{cache:!1});this.cache=t.cache,this.link=t.link,this.defaultOptions=t.defaultOptions,this.queryDeduplication=t.queryDeduplication,this.clientAwareness=t.clientAwareness,this.localState=t.localState,this.ssrMode=t.ssrMode,this.assumeImmutableResults=t.assumeImmutableResults;var i=t.documentTransform;this.documentTransform=i?n.concat(i).concat(n):n,this.defaultContext=t.defaultContext||Object.create(null),(this.onBroadcast=t.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var t=this;this.queries.forEach(function(r,n){t.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(yt(26))},e.prototype.cancelPendingFetches=function(t){this.fetchCancelFns.forEach(function(r){return r(t)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(t){return nr(this,arguments,void 0,function(r){var n,i,a,o,s,c,u,l=r.mutation,d=r.variables,f=r.optimisticResponse,v=r.updateQueries,E=r.refetchQueries,x=E===void 0?[]:E,T=r.awaitRefetchQueries,O=T===void 0?!1:T,_=r.update,m=r.onQueryUpdated,C=r.fetchPolicy,S=C===void 0?((c=this.defaultOptions.mutate)===null||c===void 0?void 0:c.fetchPolicy)||"network-only":C,P=r.errorPolicy,A=P===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":P,j=r.keepRootFields,U=r.context;return ir(this,function(V){switch(V.label){case 0:return ne(l,27),ne(S==="network-only"||S==="no-cache",28),n=this.generateMutationId(),l=this.cache.transformForLink(this.transform(l)),i=this.getDocumentInfo(l).hasClientExports,d=this.getVariables(l,d),i?[4,this.localState.addExportedVariables(l,d,U)]:[3,2];case 1:d=V.sent(),V.label=2;case 2:return a=this.mutationStore&&(this.mutationStore[n]={mutation:l,variables:d,loading:!0,error:null}),o=f&&this.markMutationOptimistic(f,{mutationId:n,document:l,variables:d,fetchPolicy:S,errorPolicy:A,context:U,updateQueries:v,update:_,keepRootFields:j}),this.broadcastQueries(),s=this,[2,new Promise(function(me,Le){return io(s.getObservableFromLink(l,D(D({},U),{optimisticResponse:o?f:void 0}),d,{},!1),function(ye){if(wi(ye)&&A==="none")throw new Jt({graphQLErrors:ao(ye)});a&&(a.loading=!1,a.error=null);var Se=D({},ye);return typeof x=="function"&&(x=x(Se)),A==="ignore"&&wi(Se)&&delete Se.errors,s.markMutationResult({mutationId:n,result:Se,document:l,variables:d,fetchPolicy:S,errorPolicy:A,context:U,update:_,updateQueries:v,awaitRefetchQueries:O,refetchQueries:x,removeOptimistic:o?n:void 0,onQueryUpdated:m,keepRootFields:j})}).subscribe({next:function(ye){s.broadcastQueries(),(!("hasNext"in ye)||ye.hasNext===!1)&&me(ye)},error:function(ye){a&&(a.loading=!1,a.error=ye),o&&s.cache.removeOptimistic(n),s.broadcastQueries(),Le(ye instanceof Jt?ye:new Jt({networkError:ye}))}})})]}})})},e.prototype.markMutationResult=function(t,r){var n=this;r===void 0&&(r=this.cache);var i=t.result,a=[],o=t.fetchPolicy==="no-cache";if(!o&&_o(i,t.errorPolicy)){if(Ur(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),Ur(i)&&Mt(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=fu(s.result,i)),typeof c<"u"&&(i.data=c,a.push({result:c,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var u=t.updateQueries;u&&this.queries.forEach(function(d,f){var v=d.observableQuery,E=v&&v.queryName;if(!(!E||!Yg.call(u,E))){var x=u[E],T=n.queries.get(f),O=T.document,_=T.variables,m=r.diff({query:O,variables:_,returnPartialData:!0,optimistic:!1}),C=m.result,S=m.complete;if(S&&C){var P=x(C,{mutationResult:i,queryName:O&&$a(O)||void 0,queryVariables:_});P&&a.push({result:P,dataId:"ROOT_QUERY",query:O,variables:_})}}})}if(a.length>0||(t.refetchQueries||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(x){return d.write(x)});var f=t.update,v=!Qp(i)||Ur(i)&&!i.hasNext;if(f){if(!o){var E=d.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});E.complete&&(i=D(D({},i),{data:E.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}v&&f(d,i,{context:t.context,variables:t.variables})}!o&&!t.keepRootFields&&v&&d.modify({id:"ROOT_MUTATION",fields:function(x,T){var O=T.fieldName,_=T.DELETE;return O==="__typename"?x:_}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(t,r){var n=this,i=typeof t=="function"?t(r.variables,{IGNORE:al}):t;return i===al?!1:(this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(D(D({},r),{result:{data:i}}),a)}catch(o){globalThis.__DEV__!==!1&&ne.error(o)}},r.mutationId),!0)},e.prototype.fetchQuery=function(t,r,n){return this.fetchConcastWithInfo(t,r,n).concast.promise},e.prototype.getQueryStore=function(){var t=Object.create(null);return this.queries.forEach(function(r,n){t[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),t},e.prototype.resetErrors=function(t){var r=this.queries.get(t);r&&(r.networkError=void 0,r.graphQLErrors=[])},e.prototype.transform=function(t){return this.documentTransform.transformDocument(t)},e.prototype.getDocumentInfo=function(t){var r=this.transformCache;if(!r.has(t)){var n={hasClientExports:_0(t),hasForcedResolvers:this.localState.shouldForceResolvers(t),hasNonreactiveDirective:cn(["nonreactive"],t),clientQuery:this.localState.clientQuery(t),serverQuery:Jc([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],t),defaultVars:Ua(fn(t)),asQuery:D(D({},t),{definitions:t.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?D(D({},i),{operation:"query"}):i})})};r.set(t,n)}return r.get(t)},e.prototype.getVariables=function(t,r){return D(D({},this.getDocumentInfo(t).defaultVars),r)},e.prototype.watchQuery=function(t){var r=this.transform(t.query);t=D(D({},t),{variables:this.getVariables(r,t.variables)}),typeof t.notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!1);var n=new Co(this),i=new So({queryManager:this,queryInfo:n,options:t});return i.lastQuery=r,this.queries.set(i.queryId,n),n.init({document:r,observableQuery:i,variables:i.variables}),i},e.prototype.query=function(t,r){var n=this;return r===void 0&&(r=this.generateQueryId()),ne(t.query,29),ne(t.query.kind==="Document",30),ne(!t.returnPartialData,31),ne(!t.pollInterval,32),this.fetchQuery(r,D(D({},t),{query:this.transform(t.query)})).finally(function(){return n.stopQuery(r)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(t){var r=this.queries.get(t);r&&r.stop()},e.prototype.clearStore=function(t){return t===void 0&&(t={discardWatches:!0}),this.cancelPendingFetches(yt(33)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=Te.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(t)},e.prototype.getObservableQueries=function(t){var r=this;t===void 0&&(t="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(t)&&t.forEach(function(o){typeof o=="string"?i.set(o,!1):ep(o)?i.set(r.transform(o),!1):He(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var c=o.observableQuery,u=o.document;if(c){if(t==="all"){n.set(s,c);return}var l=c.queryName,d=c.options.fetchPolicy;if(d==="standby"||t==="active"&&!c.hasObservers())return;(t==="active"||l&&i.has(l)||u&&i.has(u))&&(n.set(s,c),l&&i.set(l,!0),u&&i.set(u,!0))}}),a.size&&a.forEach(function(o){var s=xa("legacyOneTimeQuery"),c=r.getQuery(s).init({document:o.query,variables:o.variables}),u=new So({queryManager:r,queryInfo:c,options:D(D({},o),{fetchPolicy:"network-only"})});ne(u.queryId===s),c.setObservableQuery(u),n.set(s,u)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,s){o||globalThis.__DEV__!==!1&&ne.warn(typeof s=="string"?34:35,s)}),n},e.prototype.reFetchObservableQueries=function(t){var r=this;t===void 0&&(t=!1);var n=[];return this.getObservableQueries(t?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(t||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(t){this.getQuery(t.queryId).setObservableQuery(t)},e.prototype.startGraphQLSubscription=function(t){var r=this,n=t.query,i=t.fetchPolicy,a=t.errorPolicy,o=a===void 0?"none":a,s=t.variables,c=t.context,u=c===void 0?{}:c,l=t.extensions,d=l===void 0?{}:l;n=this.transform(n),s=this.getVariables(n,s);var f=function(E){return r.getObservableFromLink(n,u,E,d).map(function(x){i!=="no-cache"&&(_o(x,o)&&r.cache.write({query:n,result:x.data,dataId:"ROOT_SUBSCRIPTION",variables:E}),r.broadcastQueries());var T=wi(x),O=cg(x);if(T||O){var _={};if(T&&(_.graphQLErrors=x.errors),O&&(_.protocolErrors=x.extensions[co]),o==="none"||O)throw new Jt(_)}return o==="ignore"&&delete x.errors,x})};if(this.getDocumentInfo(n).hasClientExports){var v=this.localState.addExportedVariables(n,s,u).then(f);return new je(function(E){var x=null;return v.then(function(T){return x=T.subscribe(E)},E.error),function(){return x&&x.unsubscribe()}})}return f(s)},e.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},e.prototype.removeQuery=function(t){this.fetchCancelFns.delete(t),this.queries.has(t)&&(this.getQuery(t).stop(),this.queries.delete(t))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(t){return t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(t,r,n,i,a){var o=this,s;a===void 0&&(a=(s=r==null?void 0:r.queryDeduplication)!==null&&s!==void 0?s:this.queryDeduplication);var c,u=this.getDocumentInfo(t),l=u.serverQuery,d=u.clientQuery;if(l){var f=this,v=f.inFlightLinkObservables,E=f.link,x={query:l,variables:n,operationName:$a(l)||void 0,context:this.prepareContext(D(D({},r),{forceFetch:!a})),extensions:i};if(r=x.context,a){var T=yi(l),O=or(n),_=v.lookup(T,O);if(c=_.observable,!c){var m=new $r([so(E,x)]);c=_.observable=m,m.beforeNext(function(){v.remove(T,O)})}}else c=new $r([so(E,x)])}else c=new $r([je.of({data:{}})]),r=this.prepareContext(r);return d&&(c=io(c,function(C){return o.localState.runResolvers({document:d,remoteResult:C,context:r,variables:n})})),c},e.prototype.getResultsFromLink=function(t,r,n){var i=t.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(n.query);return io(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=ao(o),c=s.length>0,u=n.errorPolicy;if(i>=t.lastRequestId){if(c&&u==="none")throw t.markError(new Jt({graphQLErrors:s}));t.markResult(o,a,n,r),t.markReady()}var l={data:o.data,loading:!1,networkStatus:Te.ready};return c&&u==="none"&&(l.data=void 0),c&&u!=="ignore"&&(l.errors=s,l.networkStatus=Te.error),l},function(o){var s=gu(o)?o:new Jt({networkError:o});throw i>=t.lastRequestId&&t.markError(s),s})},e.prototype.fetchConcastWithInfo=function(t,r,n,i){var a=this;n===void 0&&(n=Te.loading),i===void 0&&(i=r.query);var o=this.getVariables(i,r.variables),s=this.getQuery(t),c=this.defaultOptions.watchQuery,u=r.fetchPolicy,l=u===void 0?c&&c.fetchPolicy||"cache-first":u,d=r.errorPolicy,f=d===void 0?c&&c.errorPolicy||"none":d,v=r.returnPartialData,E=v===void 0?!1:v,x=r.notifyOnNetworkStatusChange,T=x===void 0?!1:x,O=r.context,_=O===void 0?{}:O,m=Object.assign({},r,{query:i,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:E,notifyOnNetworkStatusChange:T,context:_}),C=function(U){m.variables=U;var V=a.fetchQueryByPolicy(s,m,n);return m.fetchPolicy!=="standby"&&V.sources.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),V},S=function(){return a.fetchCancelFns.delete(t)};this.fetchCancelFns.set(t,function(U){S(),setTimeout(function(){return P.cancel(U)})});var P,A;if(this.getDocumentInfo(m.query).hasClientExports)P=new $r(this.localState.addExportedVariables(m.query,m.variables,m.context).then(C).then(function(U){return U.sources})),A=!0;else{var j=C(m.variables);A=j.fromLink,P=new $r(j.sources)}return P.promise.then(S,S),{concast:P,fromLink:A}},e.prototype.refetchQueries=function(t){var r=this,n=t.updateCache,i=t.include,a=t.optimistic,o=a===void 0?!1:a,s=t.removeOptimistic,c=s===void 0?o?xa("refetchQueries"):void 0:s,u=t.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(f,v){l.set(v,{oq:f,lastDiff:r.getQuery(v).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&c||!1,removeOptimistic:c,onWatchUpdated:function(f,v,E){var x=f.watcher instanceof Co&&f.watcher.observableQuery;if(x){if(u){l.delete(x.queryId);var T=u(x,v,E);return T===!0&&(T=x.refetch()),T!==!1&&d.set(x,T),T}u!==null&&l.set(x.queryId,{oq:x,lastDiff:E,diff:v})}}}),l.size&&l.forEach(function(f,v){var E=f.oq,x=f.lastDiff,T=f.diff,O;if(u){if(!T){var _=E.queryInfo;_.reset(),T=_.getDiff()}O=u(E,T,x)}(!u||O===!0)&&(O=E.refetch()),O!==!1&&d.set(E,O),v.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(v)}),c&&this.cache.removeOptimistic(c),d},e.prototype.fetchQueryByPolicy=function(t,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,c=r.refetchWritePolicy,u=r.errorPolicy,l=r.returnPartialData,d=r.context,f=r.notifyOnNetworkStatusChange,v=t.networkStatus;t.init({document:a,variables:o,networkStatus:n});var E=function(){return t.getDiff()},x=function(C,S){S===void 0&&(S=t.networkStatus||Te.loading);var P=C.result;globalThis.__DEV__!==!1&&!l&&!Fe(P,{})&&nl(C.missing);var A=function(j){return je.of(D({data:j,loading:Tn(S),networkStatus:S},C.complete?null:{partial:!0}))};return P&&i.getDocumentInfo(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:P},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(j){return A(j.data||void 0)}):u==="none"&&S===Te.refetch&&Array.isArray(C.missing)?A(void 0):A(P)},T=s==="no-cache"?0:n===Te.refetch&&c!=="merge"?1:2,O=function(){return i.getResultsFromLink(t,T,{query:a,variables:o,context:d,fetchPolicy:s,errorPolicy:u})},_=f&&typeof v=="number"&&v!==n&&Tn(n);switch(s){default:case"cache-first":{var m=E();return m.complete?{fromLink:!1,sources:[x(m,t.markReady())]}:l||_?{fromLink:!0,sources:[x(m),O()]}:{fromLink:!0,sources:[O()]}}case"cache-and-network":{var m=E();return m.complete||l||_?{fromLink:!0,sources:[x(m),O()]}:{fromLink:!0,sources:[O()]}}case"cache-only":return{fromLink:!1,sources:[x(E(),t.markReady())]};case"network-only":return _?{fromLink:!0,sources:[x(E()),O()]}:{fromLink:!0,sources:[O()]};case"no-cache":return _?{fromLink:!0,sources:[x(t.getDiff()),O()]}:{fromLink:!0,sources:[O()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(t){return t&&!this.queries.has(t)&&this.queries.set(t,new Co(this,t)),this.queries.get(t)},e.prototype.prepareContext=function(t){t===void 0&&(t={});var r=this.localState.prepareContext(t);return D(D(D({},this.defaultContext),r),{clientAwareness:this.clientAwareness})},e}(),Xg=function(){function e(t){var r=t.cache,n=t.client,i=t.resolvers,a=t.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return e.prototype.addResolvers=function(t){var r=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach(function(n){r.resolvers=eu(r.resolvers,n)}):this.resolvers=eu(this.resolvers,t)},e.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(t){return nr(this,arguments,void 0,function(r){var n=r.document,i=r.remoteResult,a=r.context,o=r.variables,s=r.onlyRunForcedResolvers,c=s===void 0?!1:s;return ir(this,function(u){return n?[2,this.resolveDocument(n,i.data,a,o,this.fragmentMatcher,c).then(function(l){return D(D({},i),{data:l.result})})]:[2,i]})})},e.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(t){return cn(["client"],t)&&this.resolvers?t:null},e.prototype.serverQuery=function(t){return Zc(t)},e.prototype.prepareContext=function(t){var r=this.cache;return D(D({},t),{cache:r,getCacheKey:function(n){return r.identify(n)}})},e.prototype.addExportedVariables=function(t){return nr(this,arguments,void 0,function(r,n,i){return n===void 0&&(n={}),i===void 0&&(i={}),ir(this,function(a){return r?[2,this.resolveDocument(r,this.buildRootValueFromCache(r,n)||{},this.prepareContext(i),n).then(function(o){return D(D({},n),o.exportedVariables)})]:[2,D({},n)]})})},e.prototype.shouldForceResolvers=function(t){var r=!1;return Xt(t,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return La}}}),r},e.prototype.buildRootValueFromCache=function(t,r){return this.cache.diff({query:Lp(t),variables:r,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(t,r){return nr(this,arguments,void 0,function(n,i,a,o,s,c){var u,l,d,f,v,E,x,T,O,_,m;return a===void 0&&(a={}),o===void 0&&(o={}),s===void 0&&(s=function(){return!0}),c===void 0&&(c=!1),ir(this,function(C){return u=dn(n),l=pi(n),d=li(l),f=this.collectSelectionsToResolve(u,d),v=u.operation,E=v?v.charAt(0).toUpperCase()+v.slice(1):"Query",x=this,T=x.cache,O=x.client,_={fragmentMap:d,context:D(D({},a),{cache:T,client:O}),variables:o,fragmentMatcher:s,defaultOperationType:E,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:c},m=!1,[2,this.resolveSelectionSet(u.selectionSet,m,i,_).then(function(S){return{result:S,exportedVariables:_.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(t,r,n,i){return nr(this,void 0,void 0,function(){var a,o,s,c,u,l=this;return ir(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,c=[n],u=function(f){return nr(l,void 0,void 0,function(){var v,E;return ir(this,function(x){return!r&&!i.selectionsToResolve.has(f)?[2]:sn(f,s)?cr(f)?[2,this.resolveField(f,r,n,i).then(function(T){var O;typeof T<"u"&&c.push((O={},O[sr(f)]=T,O))})]:(dp(f)?v=f:(v=a[f.name.value],ne(v,18,f.name.value)),v&&v.typeCondition&&(E=v.typeCondition.name.value,i.fragmentMatcher(n,E,o))?[2,this.resolveSelectionSet(v.selectionSet,r,n,i).then(function(T){c.push(T)})]:[2]):[2]})})},[2,Promise.all(t.selections.map(u)).then(function(){return mi(c)})]})})},e.prototype.resolveField=function(t,r,n,i){return nr(this,void 0,void 0,function(){var a,o,s,c,u,l,d,f,v,E=this;return ir(this,function(x){return n?(a=i.variables,o=t.name.value,s=sr(t),c=o!==s,u=n[s]||n[o],l=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(t))&&(d=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(v=f[c?o:s],v&&(l=Promise.resolve(vo.withValue(this.cache,v,[n,hi(t,a),i.context,{field:t,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(T){var O,_;if(T===void 0&&(T=u),t.directives&&t.directives.forEach(function(C){C.name.value==="export"&&C.arguments&&C.arguments.forEach(function(S){S.name.value==="as"&&S.value.kind==="StringValue"&&(i.exportedVariables[S.value.value]=T)})}),!t.selectionSet||T==null)return T;var m=(_=(O=t.directives)===null||O===void 0?void 0:O.some(function(C){return C.name.value==="client"}))!==null&&_!==void 0?_:!1;if(Array.isArray(T))return E.resolveSubSelectedArray(t,r||m,T,i);if(t.selectionSet)return E.resolveSelectionSet(t.selectionSet,r||m,T,i)})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(t,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(t,r,o,i);if(t.selectionSet)return a.resolveSelectionSet(t.selectionSet,r,o,i)}))},e.prototype.collectSelectionsToResolve=function(t,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Xt(o,{Directive:function(c,u,l,d,f){c.name.value==="client"&&f.forEach(function(v){n(v)&&bc(v)&&s.add(v)})},FragmentSpread:function(c,u,l,d,f){var v=r[c.name.value];ne(v,19,c.name.value);var E=a(v);E.size>0&&(f.forEach(function(x){n(x)&&bc(x)&&s.add(x)}),s.add(c),E.forEach(function(x){s.add(x)}))}})}return i.get(o)}return a(t)},e}(),ol=!1,sl=function(){function e(t){var r=this,n;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!t.cache)throw yt(15);var i=t.uri,a=t.credentials,o=t.headers,s=t.cache,c=t.documentTransform,u=t.ssrMode,l=u===void 0?!1:u,d=t.ssrForceFetchDelay,f=d===void 0?0:d,v=t.connectToDevTools,E=t.queryDeduplication,x=E===void 0?!0:E,T=t.defaultOptions,O=t.defaultContext,_=t.assumeImmutableResults,m=_===void 0?s.assumeImmutableResults:_,C=t.resolvers,S=t.typeDefs,P=t.fragmentMatcher,A=t.name,j=t.version,U=t.devtools,V=t.link;V||(V=i?new Tg({uri:i,credentials:a,headers:o}):En.empty()),this.link=V,this.cache=s,this.disableNetworkFetches=l||f>0,this.queryDeduplication=x,this.defaultOptions=T||Object.create(null),this.typeDefs=S,this.devtoolsConfig=D(D({},U),{enabled:(n=U==null?void 0:U.enabled)!==null&&n!==void 0?n:v}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),f&&setTimeout(function(){return r.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=Ea,this.localState=new Xg({cache:s,client:this,resolvers:C,fragmentMatcher:P}),this.queryManager=new Kg({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:O,documentTransform:c,queryDeduplication:x,ssrMode:l,clientAwareness:{name:A,version:j},localState:this.localState,assumeImmutableResults:m,onBroadcast:this.devtoolsConfig.enabled?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var t=window,r=Symbol.for("apollo.devtools");(t[r]=t[r]||[]).push(this),t.__APOLLO_CLIENT__=this,!ol&&globalThis.__DEV__!==!1&&(ol=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var n=window.navigator,i=n&&n.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&&ne.log("Download the Apollo DevTools for a better development experience: %s",a)}},1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=Br(this.defaultOptions.watchQuery,t)),this.disableNetworkFetches&&(t.fetchPolicy==="network-only"||t.fetchPolicy==="cache-and-network")&&(t=D(D({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},e.prototype.query=function(t){return this.defaultOptions.query&&(t=Br(this.defaultOptions.query,t)),ne(t.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&t.fetchPolicy==="network-only"&&(t=D(D({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},e.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=Br(this.defaultOptions.mutate,t)),this.queryManager.mutate(t)},e.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!1),this.cache.readQuery(t,r)},e.prototype.watchFragment=function(t){return this.cache.watchFragment(t)},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!1),this.cache.readFragment(t,r)},e.prototype.writeQuery=function(t){var r=this.cache.writeQuery(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.writeFragment=function(t){var r=this.cache.writeFragment(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},e.prototype.__requestRaw=function(t){return so(this.link,t)},e.prototype.resetStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(t.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return t.reFetchObservableQueries()})},e.prototype.clearStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(t.clearStoreCallbacks.map(function(r){return r()}))})},e.prototype.onResetStore=function(t){var r=this;return this.resetStoreCallbacks.push(t),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.onClearStore=function(t){var r=this;return this.clearStoreCallbacks.push(t),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},e.prototype.refetchQueries=function(t){var r=this.queryManager.refetchQueries(t),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){globalThis.__DEV__!==!1&&ne.debug(17,o)}),a},e.prototype.getObservableQueries=function(t){return t===void 0&&(t="active"),this.queryManager.getObservableQueries(t)},e.prototype.extract=function(t){return this.cache.extract(t)},e.prototype.restore=function(t){return this.cache.restore(t)},e.prototype.addResolvers=function(t){this.localState.addResolvers(t)},e.prototype.setResolvers=function(t){this.localState.setResolvers(t)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},e.prototype.setLink=function(t){this.link=this.queryManager.link=t},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();globalThis.__DEV__!==!1&&(sl.prototype.getMemoryInternals=z0);var Ci=new Map,ko=new Map,cl=!0,_i=!1;function ul(e){return e.replace(/[\s,]+/g," ").trim()}function Jg(e){return ul(e.source.body.substring(e.start,e.end))}function Zg(e){var t=new Set,r=[];return e.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=Jg(n.loc),o=ko.get(i);o&&!o.has(a)?cl&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
168
168
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
169
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||ko.set(i,o=new Set),o.add(a),t.has(a)||(t.add(a),r.push(n))}else r.push(n)}),D(D({},e),{definitions:r})}function ev(e){var t=new Set(e.definitions);t.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&t.add(a)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}function tv(e){var t=ul(e);if(!Ci.has(t)){var r=y0(e,{experimentalFragmentVariables:_i,allowLegacyFragmentVariables:_i});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ci.set(t,ev(Zg(r)))}return Ci.get(t)}function _t(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];typeof e=="string"&&(e=[e]);var n=e[0];return t.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=e[a+1]}),tv(n)}function rv(){Ci.clear(),ko.clear()}function nv(){cl=!1}function iv(){_i=!0}function av(){_i=!1}var Cn={gql:_t,resetCaches:rv,disableFragmentWarnings:nv,enableExperimentalFragmentVariables:iv,disableExperimentalFragmentVariables:av};(function(e){e.gql=Cn.gql,e.resetCaches=Cn.resetCaches,e.disableFragmentWarnings=Cn.disableFragmentWarnings,e.enableExperimentalFragmentVariables=Cn.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=Cn.disableExperimentalFragmentVariables})(_t||(_t={})),_t.default=_t;var ll={exports:{}};(function(e){e.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,e.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,e.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(e.exports,w)})(ll);var _e=ll.exports;const fl=Mf({__proto__:null,default:Ko(_e)},[_e]);var hl=Ia?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function Do(){ne("createContext"in fl,46);var e=_e.createContext[hl];return e||(Object.defineProperty(_e.createContext,hl,{value:e=_e.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}var ov=function(e){var t=e.client,r=e.children,n=Do(),i=_e.useContext(n),a=_e.useMemo(function(){return D(D({},i),{client:t||i.client})},[i,t]);return ne(a.client,47),_e.createElement(n.Provider,{value:a},r)};function dl(e){var t=_e.useContext(Do()),r=e||t.client;return ne(!!r,50),r}var pl=!1,sv="useSyncExternalStore",cv=fl[sv],uv=cv||function(e,t,r){var n=t();globalThis.__DEV__!==!1&&!pl&&n!==t()&&(pl=!0,globalThis.__DEV__!==!1&&ne.error(60));var i=_e.useState({inst:{value:n,getSnapshot:t}}),a=i[0].inst,o=i[1];return A0?_e.useLayoutEffect(function(){Object.assign(a,{value:n,getSnapshot:t}),Mo(a)&&o({inst:a})},[e,n,t]):Object.assign(a,{value:n,getSnapshot:t}),_e.useEffect(function(){return Mo(a)&&o({inst:a}),e(function(){Mo(a)&&o({inst:a})})},[e]),n};function Mo(e){var t=e.value,r=e.getSnapshot;try{return t!==r()}catch{return!0}}var Zt;(function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"})(Zt||(Zt={}));var wr;function gl(e){var t;switch(e){case Zt.Query:t="Query";break;case Zt.Mutation:t="Mutation";break;case Zt.Subscription:t="Subscription";break}return t}function vl(e){wr||(wr=new Fa(Ht.parser||1e3));var t=wr.get(e);if(t)return t;var r,n,i;ne(!!e&&!!e.kind,62,e);for(var a=[],o=[],s=[],c=[],u=0,l=e.definitions;u<l.length;u++){var d=l[u];if(d.kind==="FragmentDefinition"){a.push(d);continue}if(d.kind==="OperationDefinition")switch(d.operation){case"query":o.push(d);break;case"mutation":s.push(d);break;case"subscription":c.push(d);break}}ne(!a.length||o.length||s.length||c.length,63),ne(o.length+s.length+c.length<=1,64,e,o.length,c.length,s.length),n=o.length?Zt.Query:Zt.Mutation,!o.length&&!s.length&&(n=Zt.Subscription);var f=o.length?o:s.length?s:c;ne(f.length===1,65,e,f.length);var v=f[0];r=v.variableDefinitions||[],v.name&&v.name.kind==="Name"?i=v.name.value:i="data";var E={name:i,type:n,variables:r};return wr.set(e,E),E}vl.resetCache=function(){wr=void 0},globalThis.__DEV__!==!1&&Ra("parser",function(){return wr?wr.size:0});function lv(e,t){var r=vl(e),n=gl(t),i=gl(r.type);ne(r.type===t,66,n,n,i)}var fv=Oc?_e.useLayoutEffect:_e.useEffect,hv=Symbol.for("apollo.hook.wrappers");function dv(e,t,r){var n=r.queryManager,i=n&&n[hv],a=i&&i[e];return a?a(t):t}var pv=Object.prototype.hasOwnProperty;function yl(){}var ki=Symbol();function ml(e,t){return t===void 0&&(t=Object.create(null)),dv("useQuery",gv,dl(t&&t.client))(e,t)}function gv(e,t){var r=bl(e,t),n=r.result,i=r.obsQueryFields;return _e.useMemo(function(){return D(D({},n),i)},[n,i])}function vv(e,t,r,n,i){function a(d){var f;lv(t,Zt.Query);var v={client:e,query:t,observable:n&&n.getSSRObservable(i())||e.watchQuery(Lo(void 0,e,r,i())),resultData:{previousData:(f=d==null?void 0:d.resultData.current)===null||f===void 0?void 0:f.data}};return v}var o=_e.useState(a),s=o[0],c=o[1];function u(d){var f,v;Object.assign(s.observable,(f={},f[ki]=d,f));var E=s.resultData;c(D(D({},s),{query:d.query,resultData:Object.assign(E,{previousData:((v=E.current)===null||v===void 0?void 0:v.data)||E.previousData,current:void 0})}))}if(e!==s.client||t!==s.query){var l=a(s);return c(l),[l,u]}return[s,u]}function bl(e,t){var r=dl(t.client),n=_e.useContext(Do()).renderPromises,i=!!n,a=r.disableNetworkFetches,o=t.ssr!==!1&&!t.skip,s=t.partialRefetch,c=El(r,e,t,i),u=vv(r,e,t,n,c),l=u[0],d=l.observable,f=l.resultData,v=u[1],E=c(d);bv(f,d,r,t,E);var x=_e.useMemo(function(){return Ov(d)},[d]);mv(d,n,o);var T=yv(f,d,r,t,E,a,s,i,{onCompleted:t.onCompleted||yl,onError:t.onError||yl});return{result:T,obsQueryFields:x,observable:d,resultData:f,client:r,onQueryExecuted:v}}function yv(e,t,r,n,i,a,o,s,c){var u=_e.useRef(c);_e.useEffect(function(){u.current=c});var l=(s||a)&&n.ssr===!1&&!n.skip?xl:n.skip||i.fetchPolicy==="standby"?Ol:void 0,d=e.previousData,f=_e.useMemo(function(){return l&&Di(l,d,t,r)},[r,t,l,d]);return uv(_e.useCallback(function(v){if(s)return function(){};var E=function(){var S=e.current,_=t.getCurrentResult();S&&S.loading===_.loading&&S.networkStatus===_.networkStatus&&Ae(S.data,_.data)||Io(_,e,t,r,o,v,u.current)},x=function(S){if(T.current.unsubscribe(),T.current=t.resubscribeAfterError(E,x),!pv.call(S,"graphQLErrors"))throw S;var _=e.current;(!_||_&&_.loading||!Ae(S,_.error))&&Io({data:_&&_.data,error:S,loading:!1,networkStatus:Te.error},e,t,r,o,v,u.current)},T={current:t.subscribe(E,x)};return function(){setTimeout(function(){return T.current.unsubscribe()})}},[a,s,t,e,o,r]),function(){return f||wl(e,t,u.current,o,r)},function(){return f||wl(e,t,u.current,o,r)})}function mv(e,t,r){t&&r&&(t.registerSSRObservable(e),e.getCurrentResult().loading&&t.addObservableQueryPromise(e))}function bv(e,t,r,n,i){var a;t[ki]&&!Ae(t[ki],i)&&(t.reobserve(Lo(t,r,n,i)),e.previousData=((a=e.current)===null||a===void 0?void 0:a.data)||e.previousData,e.current=void 0),t[ki]=i}function El(e,t,r,n){r===void 0&&(r={});var i=r.skip;r.ssr,r.onCompleted,r.onError;var a=r.defaultOptions,o=At(r,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(s){var c=Object.assign(o,{query:t});return n&&(c.fetchPolicy==="network-only"||c.fetchPolicy==="cache-and-network")&&(c.fetchPolicy="cache-first"),c.variables||(c.variables={}),i?(c.initialFetchPolicy=c.initialFetchPolicy||c.fetchPolicy||Po(a,e.defaultOptions),c.fetchPolicy="standby"):c.fetchPolicy||(c.fetchPolicy=(s==null?void 0:s.options.initialFetchPolicy)||Po(a,e.defaultOptions)),c}}function Lo(e,t,r,n){var i=[],a=t.defaultOptions.watchQuery;return a&&i.push(a),r.defaultOptions&&i.push(r.defaultOptions),i.push(Er(e&&e.options,n)),i.reduce(Br)}function Io(e,t,r,n,i,a,o){var s=t.current;s&&s.data&&(t.previousData=s.data),!e.error&&Mt(e.errors)&&(e.error=new Jt({graphQLErrors:e.errors})),t.current=Di(xv(e,r,i),t.previousData,r,n),a(),Ev(e,s==null?void 0:s.networkStatus,o)}function Ev(e,t,r){if(!e.loading){var n=wv(e);Promise.resolve().then(function(){n?r.onError(n):e.data&&t!==e.networkStatus&&e.networkStatus===Te.ready&&r.onCompleted(e.data)}).catch(function(i){globalThis.__DEV__!==!1&&ne.warn(i)})}}function wl(e,t,r,n,i){return e.current||Io(t.getCurrentResult(),e,t,i,n,function(){},r),e.current}function Po(e,t){var r;return(e==null?void 0:e.fetchPolicy)||((r=t==null?void 0:t.watchQuery)===null||r===void 0?void 0:r.fetchPolicy)||"cache-first"}function wv(e){return Mt(e.errors)?new Jt({graphQLErrors:e.errors}):e.error}function Di(e,t,r,n){var i=e.data;e.partial;var a=At(e,["data","partial"]),o=D(D({data:i},a),{client:n,observable:r,variables:r.variables,called:e!==xl&&e!==Ol,previousData:t});return o}function xv(e,t,r){return e.partial&&r&&!e.loading&&(!e.data||Object.keys(e.data).length===0)&&t.options.fetchPolicy!=="cache-only"?(t.refetch(),D(D({},e),{loading:!0,networkStatus:Te.refetch})):e}var xl=yn({loading:!0,data:void 0,error:void 0,networkStatus:Te.loading}),Ol=yn({loading:!1,data:void 0,error:void 0,networkStatus:Te.ready});function Ov(e){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}}var Sv=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function _n(e,t){var r,n=_e.useRef(),i=_e.useRef(),a=_e.useRef(),o=Br(t,n.current||{}),s=(r=o==null?void 0:o.query)!==null&&r!==void 0?r:e;i.current=t,a.current=s;var c=D(D({},o),{skip:!n.current}),u=bl(s,c),l=u.obsQueryFields,d=u.result,f=u.client,v=u.resultData,E=u.observable,x=u.onQueryExecuted,T=E.options.initialFetchPolicy||Po(c.defaultOptions,f.defaultOptions),S=_e.useReducer(function(j){return j+1},0)[1],_=_e.useMemo(function(){for(var j={},U=function(ye){var Oe=l[ye];j[ye]=function(){return n.current||(n.current=Object.create(null),S()),Oe.apply(this,arguments)}},V=0,me=Sv;V<me.length;V++){var Le=me[V];U(Le)}return j},[S,l]),m=!!n.current,C=_e.useMemo(function(){return D(D(D({},d),_),{called:m})},[d,_,m]),O=_e.useCallback(function(j){n.current=j?D(D({},j),{fetchPolicy:j.fetchPolicy||T}):{fetchPolicy:T};var U=Br(i.current,D({query:a.current},n.current)),V=Tv(v,E,f,s,D(D({},U),{skip:!1}),x).then(function(me){return Object.assign(me,_)});return V.catch(function(){}),V},[f,s,_,T,E,v,x]),P=_e.useRef(O);fv(function(){P.current=O});var A=_e.useCallback(function(){for(var j=[],U=0;U<arguments.length;U++)j[U]=arguments[U];return P.current.apply(P,j)},[]);return[A,C]}function Tv(e,t,r,n,i,a){var o=i.query||n,s=El(r,o,i,!1)(t),c=t.reobserveAsConcast(Lo(t,r,i,s));return a(s),new Promise(function(u){var l;c.subscribe({next:function(d){l=d},error:function(){u(Di(t.getCurrentResult(),e.previousData,t,r))},complete:function(){u(Di(l,e.previousData,t,r))}})})}const Cv=`
|
|
169
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||ko.set(i,o=new Set),o.add(a),t.has(a)||(t.add(a),r.push(n))}else r.push(n)}),D(D({},e),{definitions:r})}function ev(e){var t=new Set(e.definitions);t.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&t.add(a)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}function tv(e){var t=ul(e);if(!Ci.has(t)){var r=y0(e,{experimentalFragmentVariables:_i,allowLegacyFragmentVariables:_i});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ci.set(t,ev(Zg(r)))}return Ci.get(t)}function _t(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];typeof e=="string"&&(e=[e]);var n=e[0];return t.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=e[a+1]}),tv(n)}function rv(){Ci.clear(),ko.clear()}function nv(){cl=!1}function iv(){_i=!0}function av(){_i=!1}var Cn={gql:_t,resetCaches:rv,disableFragmentWarnings:nv,enableExperimentalFragmentVariables:iv,disableExperimentalFragmentVariables:av};(function(e){e.gql=Cn.gql,e.resetCaches=Cn.resetCaches,e.disableFragmentWarnings=Cn.disableFragmentWarnings,e.enableExperimentalFragmentVariables=Cn.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=Cn.disableExperimentalFragmentVariables})(_t||(_t={})),_t.default=_t;var ll={exports:{}};(function(e){e.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,e.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,e.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(e.exports,w)})(ll);var _e=ll.exports;const fl=Mf({__proto__:null,default:Ko(_e)},[_e]);var dl=Ia?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function Do(){ne("createContext"in fl,46);var e=_e.createContext[dl];return e||(Object.defineProperty(_e.createContext,dl,{value:e=_e.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}var ov=function(e){var t=e.client,r=e.children,n=Do(),i=_e.useContext(n),a=_e.useMemo(function(){return D(D({},i),{client:t||i.client})},[i,t]);return ne(a.client,47),_e.createElement(n.Provider,{value:a},r)};function hl(e){var t=_e.useContext(Do()),r=e||t.client;return ne(!!r,50),r}var pl=!1,sv="useSyncExternalStore",cv=fl[sv],uv=cv||function(e,t,r){var n=t();globalThis.__DEV__!==!1&&!pl&&n!==t()&&(pl=!0,globalThis.__DEV__!==!1&&ne.error(60));var i=_e.useState({inst:{value:n,getSnapshot:t}}),a=i[0].inst,o=i[1];return A0?_e.useLayoutEffect(function(){Object.assign(a,{value:n,getSnapshot:t}),Mo(a)&&o({inst:a})},[e,n,t]):Object.assign(a,{value:n,getSnapshot:t}),_e.useEffect(function(){return Mo(a)&&o({inst:a}),e(function(){Mo(a)&&o({inst:a})})},[e]),n};function Mo(e){var t=e.value,r=e.getSnapshot;try{return t!==r()}catch{return!0}}var Zt;(function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"})(Zt||(Zt={}));var wr;function gl(e){var t;switch(e){case Zt.Query:t="Query";break;case Zt.Mutation:t="Mutation";break;case Zt.Subscription:t="Subscription";break}return t}function vl(e){wr||(wr=new Fa(Wt.parser||1e3));var t=wr.get(e);if(t)return t;var r,n,i;ne(!!e&&!!e.kind,62,e);for(var a=[],o=[],s=[],c=[],u=0,l=e.definitions;u<l.length;u++){var d=l[u];if(d.kind==="FragmentDefinition"){a.push(d);continue}if(d.kind==="OperationDefinition")switch(d.operation){case"query":o.push(d);break;case"mutation":s.push(d);break;case"subscription":c.push(d);break}}ne(!a.length||o.length||s.length||c.length,63),ne(o.length+s.length+c.length<=1,64,e,o.length,c.length,s.length),n=o.length?Zt.Query:Zt.Mutation,!o.length&&!s.length&&(n=Zt.Subscription);var f=o.length?o:s.length?s:c;ne(f.length===1,65,e,f.length);var v=f[0];r=v.variableDefinitions||[],v.name&&v.name.kind==="Name"?i=v.name.value:i="data";var E={name:i,type:n,variables:r};return wr.set(e,E),E}vl.resetCache=function(){wr=void 0},globalThis.__DEV__!==!1&&Ra("parser",function(){return wr?wr.size:0});function lv(e,t){var r=vl(e),n=gl(t),i=gl(r.type);ne(r.type===t,66,n,n,i)}var fv=Sc?_e.useLayoutEffect:_e.useEffect,dv=Symbol.for("apollo.hook.wrappers");function hv(e,t,r){var n=r.queryManager,i=n&&n[dv],a=i&&i[e];return a?a(t):t}var pv=Object.prototype.hasOwnProperty;function yl(){}var ki=Symbol();function ml(e,t){return t===void 0&&(t=Object.create(null)),hv("useQuery",gv,hl(t&&t.client))(e,t)}function gv(e,t){var r=bl(e,t),n=r.result,i=r.obsQueryFields;return _e.useMemo(function(){return D(D({},n),i)},[n,i])}function vv(e,t,r,n,i){function a(d){var f;lv(t,Zt.Query);var v={client:e,query:t,observable:n&&n.getSSRObservable(i())||e.watchQuery(Lo(void 0,e,r,i())),resultData:{previousData:(f=d==null?void 0:d.resultData.current)===null||f===void 0?void 0:f.data}};return v}var o=_e.useState(a),s=o[0],c=o[1];function u(d){var f,v;Object.assign(s.observable,(f={},f[ki]=d,f));var E=s.resultData;c(D(D({},s),{query:d.query,resultData:Object.assign(E,{previousData:((v=E.current)===null||v===void 0?void 0:v.data)||E.previousData,current:void 0})}))}if(e!==s.client||t!==s.query){var l=a(s);return c(l),[l,u]}return[s,u]}function bl(e,t){var r=hl(t.client),n=_e.useContext(Do()).renderPromises,i=!!n,a=r.disableNetworkFetches,o=t.ssr!==!1&&!t.skip,s=t.partialRefetch,c=El(r,e,t,i),u=vv(r,e,t,n,c),l=u[0],d=l.observable,f=l.resultData,v=u[1],E=c(d);bv(f,d,r,t,E);var x=_e.useMemo(function(){return Sv(d)},[d]);mv(d,n,o);var T=yv(f,d,r,t,E,a,s,i,{onCompleted:t.onCompleted||yl,onError:t.onError||yl});return{result:T,obsQueryFields:x,observable:d,resultData:f,client:r,onQueryExecuted:v}}function yv(e,t,r,n,i,a,o,s,c){var u=_e.useRef(c);_e.useEffect(function(){u.current=c});var l=(s||a)&&n.ssr===!1&&!n.skip?xl:n.skip||i.fetchPolicy==="standby"?Sl:void 0,d=e.previousData,f=_e.useMemo(function(){return l&&Di(l,d,t,r)},[r,t,l,d]);return uv(_e.useCallback(function(v){if(s)return function(){};var E=function(){var O=e.current,_=t.getCurrentResult();O&&O.loading===_.loading&&O.networkStatus===_.networkStatus&&Fe(O.data,_.data)||Io(_,e,t,r,o,v,u.current)},x=function(O){if(T.current.unsubscribe(),T.current=t.resubscribeAfterError(E,x),!pv.call(O,"graphQLErrors"))throw O;var _=e.current;(!_||_&&_.loading||!Fe(O,_.error))&&Io({data:_&&_.data,error:O,loading:!1,networkStatus:Te.error},e,t,r,o,v,u.current)},T={current:t.subscribe(E,x)};return function(){setTimeout(function(){return T.current.unsubscribe()})}},[a,s,t,e,o,r]),function(){return f||wl(e,t,u.current,o,r)},function(){return f||wl(e,t,u.current,o,r)})}function mv(e,t,r){t&&r&&(t.registerSSRObservable(e),e.getCurrentResult().loading&&t.addObservableQueryPromise(e))}function bv(e,t,r,n,i){var a;t[ki]&&!Fe(t[ki],i)&&(t.reobserve(Lo(t,r,n,i)),e.previousData=((a=e.current)===null||a===void 0?void 0:a.data)||e.previousData,e.current=void 0),t[ki]=i}function El(e,t,r,n){r===void 0&&(r={});var i=r.skip;r.ssr,r.onCompleted,r.onError;var a=r.defaultOptions,o=At(r,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(s){var c=Object.assign(o,{query:t});return n&&(c.fetchPolicy==="network-only"||c.fetchPolicy==="cache-and-network")&&(c.fetchPolicy="cache-first"),c.variables||(c.variables={}),i?(c.initialFetchPolicy=c.initialFetchPolicy||c.fetchPolicy||Po(a,e.defaultOptions),c.fetchPolicy="standby"):c.fetchPolicy||(c.fetchPolicy=(s==null?void 0:s.options.initialFetchPolicy)||Po(a,e.defaultOptions)),c}}function Lo(e,t,r,n){var i=[],a=t.defaultOptions.watchQuery;return a&&i.push(a),r.defaultOptions&&i.push(r.defaultOptions),i.push(Er(e&&e.options,n)),i.reduce(Br)}function Io(e,t,r,n,i,a,o){var s=t.current;s&&s.data&&(t.previousData=s.data),!e.error&&Mt(e.errors)&&(e.error=new Jt({graphQLErrors:e.errors})),t.current=Di(xv(e,r,i),t.previousData,r,n),a(),Ev(e,s==null?void 0:s.networkStatus,o)}function Ev(e,t,r){if(!e.loading){var n=wv(e);Promise.resolve().then(function(){n?r.onError(n):e.data&&t!==e.networkStatus&&e.networkStatus===Te.ready&&r.onCompleted(e.data)}).catch(function(i){globalThis.__DEV__!==!1&&ne.warn(i)})}}function wl(e,t,r,n,i){return e.current||Io(t.getCurrentResult(),e,t,i,n,function(){},r),e.current}function Po(e,t){var r;return(e==null?void 0:e.fetchPolicy)||((r=t==null?void 0:t.watchQuery)===null||r===void 0?void 0:r.fetchPolicy)||"cache-first"}function wv(e){return Mt(e.errors)?new Jt({graphQLErrors:e.errors}):e.error}function Di(e,t,r,n){var i=e.data;e.partial;var a=At(e,["data","partial"]),o=D(D({data:i},a),{client:n,observable:r,variables:r.variables,called:e!==xl&&e!==Sl,previousData:t});return o}function xv(e,t,r){return e.partial&&r&&!e.loading&&(!e.data||Object.keys(e.data).length===0)&&t.options.fetchPolicy!=="cache-only"?(t.refetch(),D(D({},e),{loading:!0,networkStatus:Te.refetch})):e}var xl=yn({loading:!0,data:void 0,error:void 0,networkStatus:Te.loading}),Sl=yn({loading:!1,data:void 0,error:void 0,networkStatus:Te.ready});function Sv(e){return{refetch:e.refetch.bind(e),reobserve:e.reobserve.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}}var Ov=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function _n(e,t){var r,n=_e.useRef(),i=_e.useRef(),a=_e.useRef(),o=Br(t,n.current||{}),s=(r=o==null?void 0:o.query)!==null&&r!==void 0?r:e;i.current=t,a.current=s;var c=D(D({},o),{skip:!n.current}),u=bl(s,c),l=u.obsQueryFields,d=u.result,f=u.client,v=u.resultData,E=u.observable,x=u.onQueryExecuted,T=E.options.initialFetchPolicy||Po(c.defaultOptions,f.defaultOptions),O=_e.useReducer(function(j){return j+1},0)[1],_=_e.useMemo(function(){for(var j={},U=function(ye){var Se=l[ye];j[ye]=function(){return n.current||(n.current=Object.create(null),O()),Se.apply(this,arguments)}},V=0,me=Ov;V<me.length;V++){var Le=me[V];U(Le)}return j},[O,l]),m=!!n.current,C=_e.useMemo(function(){return D(D(D({},d),_),{called:m})},[d,_,m]),S=_e.useCallback(function(j){n.current=j?D(D({},j),{fetchPolicy:j.fetchPolicy||T}):{fetchPolicy:T};var U=Br(i.current,D({query:a.current},n.current)),V=Tv(v,E,f,s,D(D({},U),{skip:!1}),x).then(function(me){return Object.assign(me,_)});return V.catch(function(){}),V},[f,s,_,T,E,v,x]),P=_e.useRef(S);fv(function(){P.current=S});var A=_e.useCallback(function(){for(var j=[],U=0;U<arguments.length;U++)j[U]=arguments[U];return P.current.apply(P,j)},[]);return[A,C]}function Tv(e,t,r,n,i,a){var o=i.query||n,s=El(r,o,i,!1)(t),c=t.reobserveAsConcast(Lo(t,r,i,s));return a(s),new Promise(function(u){var l;c.subscribe({next:function(d){l=d},error:function(){u(Di(t.getCurrentResult(),e.previousData,t,r))},complete:function(){u(Di(l,e.previousData,t,r))}})})}const Cv=`
|
|
170
170
|
query SNP($assembly: String!, $coordinates: [GenomicRangeInput]) {
|
|
171
171
|
snpQuery(assembly: $assembly, coordinates: $coordinates, common: true) {
|
|
172
172
|
id
|
|
@@ -195,7 +195,7 @@ query LD($assembly: String!, $snpids: [String!]) {
|
|
|
195
195
|
`)}
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
`,Sl={titleSize:12,ldThreshold:.7,displayMode:Re.FULL,canDrag:!0};function Tl(e){var c,u;const t=w.useContext(Pt),r={...e,trackType:G.LDTRACK,displayMode:e.displayMode},n=_v(Ks),i=ml(_t(n),{variables:{assembly:"GRCh38",snpids:[e.anchor]}}),a=l=>{t({type:ue.UPDATE_PROPS,id:e.id||"",props:{anchor:l.id}})},o=Ks.map(l=>{var d;return{ld:((d=i.data)==null?void 0:d.snpQuery[0][`${l.population}_${l.subpopulation||""}_ld`])||[]}}),s={snps:((c=e.data)==null?void 0:c.snps)||[],ld:o&&((u=o[0])==null?void 0:u.ld)||[]};switch(e.displayMode){case Re.FULL:return p.jsx(et,{...r,loading:i.loading,trackType:G.LDTRACK,displayMode:e.displayMode,children:p.jsx(jd,{...e,onVariantMouseOver:l=>{a(l),e.onVariantMouseOver&&e.onVariantMouseOver(l)},data:s})});default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(et,{...r,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}const kv=e=>{const t=e.width<1e3?e.width/8:150,r={...e,height:0,marginSize:t,menuHeight:0,preRenderedWidth:e.width-t,zoomLevel:1,delta:0,highlights:e.highlights||[],tracks:e.tracks||[]};return w.useReducer(Nh,r)};var Cl=Object.prototype.hasOwnProperty;function _l(e,t,r){for(r of e.keys())if(kn(r,t))return r}function kn(e,t){var r,n,i;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&kn(e[n],t[n]););return n===-1}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if(i=n,i&&typeof i=="object"&&(i=_l(t,i),!i)||!t.has(i))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if(i=n[0],i&&typeof i=="object"&&(i=_l(t,i),!i)||!kn(n[1],t.get(i)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(Cl.call(e,r)&&++n&&!Cl.call(t,r)||!(r in t)||!kn(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function Dv(e){if(!e||!e.length)throw new Error("useDeepCompareEffect should not be used with no dependencies. Use React.useEffect instead.");if(e.every(Mv))throw new Error("useDeepCompareEffect should not be used with dependencies that are all primitive values. Use React.useEffect instead.")}function Mv(e){return e==null||/^[sbn]/.test(typeof e)}function Lv(e){var t=zn.useRef(e),r=zn.useRef(0);return kn(e,t.current)||(t.current=e,r.current+=1),zn.useMemo(function(){return t.current},[r.current])}function Iv(e,t){return process.env.NODE_ENV!=="production"&&Dv(t),zn.useEffect(e,Lv(t))}function Pv(){const[e,t]=w.useState(null);return{openModal:e,showModal:(i,a,o)=>{t({trackId:i,mouseX:a,mouseY:o})},closeModal:()=>{t(null)}}}function Mi(e,t,r){const[n,i]=w.useState(e),[a,o]=w.useState(r(t)),[s,c]=w.useState(null);return{value:n,valid:a,onChange:l=>{const d=l.target.value,f=d===""?2e3:750;i(d),o(!1),s&&clearTimeout(s);const v=setTimeout(()=>{r(d)||i(t),o(!0)},f);c(v)}}}function Li({children:e}){return p.jsx("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",paddingBlock:"5px"},children:e})}const Nv={position:"fixed",top:"0%",left:"0%",boxShadow:"0 0 10px rgba(0, 0, 0, 0.3)",width:"500px",transform:"translate(-50%, -50%)",background:"#ffffff"},Ii={width:"auto",outline:"#ffffff",border:"1px solid #000000",borderRadius:"2px",paddingRight:"5px"},kl={display:"flex",flexDirection:"column",paddingInline:"5px"},Pi={WebkitAppearance:"none",margin:"0"},Ni={MozAppearance:"textfield",appearance:"textfield"};function Dl(e){switch(e.trackType){case G.BIGWIG:return e.actualHeight;case G.BIGBED:case G.TRANSCRIPT:return e.rowHeight;default:return e.height}}function Av({track:e}){const t=w.useContext(vr),r=w.useContext(Pt),[n,i]=w.useState(t.tracks.find(l=>l.id===e.id)||e),[a,o]=w.useState(Dl(n));w.useEffect(()=>{i(t.tracks.find(l=>l.id===e.id)||e),o(Dl(n))},[e]);const{value:s,valid:c,onChange:u}=Mi((a==null?void 0:a.toString())||"",(a==null?void 0:a.toString())||"",n.trackType===G.BIGWIG?Fv:Rv);return w.useEffect(()=>{c&&(n.trackType===G.BIGWIG?r({type:ue.UPDATE_TRACK,id:n.id,track:{height:parseInt(s)}}):(n.trackType===G.BIGBED||n.trackType===G.TRANSCRIPT)&&r({type:ue.UPDATE_TRACK,id:n.id,track:{rowHeight:parseInt(s)}}))},[s,c]),p.jsxs(Li,{children:[n.trackType===G.BIGWIG?"Height: ":"Row Height: ",p.jsx("input",{id:"heightInput",style:{...Ii,...Pi,...Ni},type:"number",placeholder:(a==null?void 0:a.toString())||"",value:s,onChange:u})]})}function Ml(e){const t=document.getElementById("heightInput");return t?e.length===0?(t.setCustomValidity("Empty input"),t.reportValidity(),!1):isNaN(parseInt(e))?(t.setCustomValidity("Invalid input"),t.reportValidity(),!1):!0:!0}function Fv(e){if(!Ml(e))return!1;const t=document.getElementById("heightInput");return t&&parseInt(e)<50?(t.setCustomValidity("Value must be greater than or equal to 50"),t.reportValidity(),!1):!0}function Rv(e){if(!Ml(e))return!1;const t=document.getElementById("heightInput");return t&&parseInt(e)<10?(t.setCustomValidity("Value must be greater than or equal to 10"),t.reportValidity(),!1):!0}const jv=(e,t,r)=>{if(!r)return!1;const n=document.querySelector('input[id="minInput"]'),i=document.querySelector('input[id="maxInput"]');return!n||!i?!0:e>t?(n.setCustomValidity("Minimum value cannot be greater than maximum value."),n.reportValidity(),!0):e==t?(i.setCustomValidity("Values are equal. Please enter different values."),i.reportValidity(),!0):e<r.min?(n.setCustomValidity("Minimum value cannot be less than the default minimum value."),n.reportValidity(),!0):t>r.max?(i.setCustomValidity("Maximum value cannot be greater than the default maximum value."),i.reportValidity(),!0):!1};function Vv({track:e}){var v,E,x,T,S,_;const t=w.useContext(Pt),[r]=w.useState(((v=e.props)==null?void 0:v.defaultRange)||{min:0,max:0}),[n]=w.useState(((E=e.props)==null?void 0:E.range)||r),i=m=>{const C=document.getElementById("minInput");return C?m.length===0||isNaN(parseFloat(m))?(C.setCustomValidity("Empty input, using default value"),C.reportValidity(),!1):parseFloat(m)<r.min?(C.setCustomValidity("Value must be greater than or equal to "+r.min),C.reportValidity(),!1):(C.setCustomValidity(""),!0):!0},a=m=>{const C=document.getElementById("maxInput");return C?m.length===0||isNaN(parseFloat(m))?(C.setCustomValidity("Empty input, using default value"),C.reportValidity(),!1):parseFloat(m)>r.max?(C.setCustomValidity("Value must be less than or equal to "+r.max),C.reportValidity(),!1):(C.setCustomValidity(""),!0):!0},{value:o,valid:s,onChange:c}=Mi(n.min.toString(),r.min.toString(),i),{value:u,valid:l,onChange:d}=Mi(n.max.toString(),r.max.toString(),a),f=m=>{m.target.select()};return w.useEffect(()=>{!s||!l||jv(parseFloat(o),parseFloat(u),r)||t({type:ue.UPDATE_PROPS,id:e.id,props:{range:{min:parseFloat(o),max:parseFloat(u)}}})},[s,l,o,u]),p.jsxs(Li,{children:[p.jsxs("label",{style:kl,children:["Minimum:",p.jsx("input",{id:"minInput",style:{...Ii,...Pi,...Ni},step:"0.01",type:"number",placeholder:(T=(x=e==null?void 0:e.props)==null?void 0:x.defaultRange)==null?void 0:T.min.toFixed(2),value:Number(o).toFixed(2),onFocus:f,onChange:c})]}),p.jsxs("label",{style:kl,children:["Maximum:",p.jsx("input",{id:"maxInput",style:{...Ii,...Pi,...Ni},step:"0.01",type:"number",placeholder:(_=(S=e==null?void 0:e.props)==null?void 0:S.defaultRange)==null?void 0:_.max.toFixed(2),value:Number(u).toFixed(2),onChange:d,onFocus:f})]})]})}function qv({track:e}){const t=w.useContext(Pt),[r,n]=w.useState(e.version);w.useEffect(()=>{n(e.version)},[e.version]);const i=s=>{n(s);const c=Object.values(Jn).includes(s);t({type:ue.UPDATE_TRACK,id:e.id,track:{version:s,assembly:c?"GRCH38":"mm10"}})},a=s=>({backgroundColor:r===s?e.color:"#858585",color:"white",marginRight:"5px",padding:"10px",border:"none",borderRadius:"5px",cursor:"pointer"}),o=e.assembly.toLowerCase()==="grch38";return p.jsx(Li,{children:p.jsxs("div",{children:[p.jsx("div",{children:o?"Human Assembly Version":"Mouse Assembly Version"}),Object.values(o?Jn:ca).filter(s=>!isNaN(Number(s))).map((s,c)=>p.jsx("button",{onClick:()=>i(Number(s)),style:a(Number(s)),children:s},c))]})})}function Ai(){return(Ai=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Ll(e,t){if(e==null)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(i[r]=e[r]);return i}function No(e){var t=w.useRef(e),r=w.useRef(function(n){t.current&&t.current(n)});return t.current=e,r.current}var Dn=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e<t?t:e},Mn=function(e){return"touches"in e},Ao=function(e){return e&&e.ownerDocument.defaultView||self},Il=function(e,t,r){var n=e.getBoundingClientRect(),i=Mn(t)?function(a,o){for(var s=0;s<a.length;s++)if(a[s].identifier===o)return a[s];return a[0]}(t.touches,r):t;return{left:Dn((i.pageX-(n.left+Ao(e).pageXOffset))/n.width),top:Dn((i.pageY-(n.top+Ao(e).pageYOffset))/n.height)}},Pl=function(e){!Mn(e)&&e.preventDefault()},Nl=w.memo(function(e){var t=e.onMove,r=e.onKey,n=Ll(e,["onMove","onKey"]),i=w.useRef(null),a=No(t),o=No(r),s=w.useRef(null),c=w.useRef(!1),u=w.useMemo(function(){var v=function(T){Pl(T),(Mn(T)?T.touches.length>0:T.buttons>0)&&i.current?a(Il(i.current,T,s.current)):x(!1)},E=function(){return x(!1)};function x(T){var S=c.current,_=Ao(i.current),m=T?_.addEventListener:_.removeEventListener;m(S?"touchmove":"mousemove",v),m(S?"touchend":"mouseup",E)}return[function(T){var S=T.nativeEvent,_=i.current;if(_&&(Pl(S),!function(C,O){return O&&!Mn(C)}(S,c.current)&&_)){if(Mn(S)){c.current=!0;var m=S.changedTouches||[];m.length&&(s.current=m[0].identifier)}_.focus(),a(Il(_,S,s.current)),x(!0)}},function(T){var S=T.which||T.keyCode;S<37||S>40||(T.preventDefault(),o({left:S===39?.05:S===37?-.05:0,top:S===40?.05:S===38?-.05:0}))},x]},[o,a]),l=u[0],d=u[1],f=u[2];return w.useEffect(function(){return f},[f]),w.createElement("div",Ai({},n,{onTouchStart:l,onMouseDown:l,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),Fo=function(e){return e.filter(Boolean).join(" ")},Al=function(e){var t=e.color,r=e.left,n=e.top,i=n===void 0?.5:n,a=Fo(["react-colorful__pointer",e.className]);return w.createElement("div",{className:a,style:{top:100*i+"%",left:100*r+"%"}},w.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},ft=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r},$v=function(e){return Qv(Ro(e))},Ro=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?ft(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?ft(parseInt(e.substring(6,8),16)/255,2):1}},Uv=function(e){return Wv(zv(e))},Bv=function(e){var t=e.s,r=e.v,n=e.a,i=(200-t)*r/100;return{h:ft(e.h),s:ft(i>0&&i<200?t*r/100/(i<=100?i:200-i)*100:0),l:ft(i/2),a:ft(n,2)}},jo=function(e){var t=Bv(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},zv=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),o=n*(1-r),s=n*(1-(t-a)*r),c=n*(1-(1-t+a)*r),u=a%6;return{r:ft(255*[n,s,o,o,c,n][u]),g:ft(255*[c,n,n,s,o,o][u]),b:ft(255*[o,o,c,n,n,s][u]),a:ft(i,2)}},Fi=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Wv=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=i<1?Fi(ft(255*i)):"";return"#"+Fi(t)+Fi(r)+Fi(n)+a},Qv=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=Math.max(t,r,n),o=a-Math.min(t,r,n),s=o?a===t?(r-n)/o:a===r?2+(n-t)/o:4+(t-r)/o:0;return{h:ft(60*(s<0?s+6:s)),s:ft(a?o/a*100:0),v:ft(a/255*100),a:i}},Hv=w.memo(function(e){var t=e.hue,r=e.onChange,n=Fo(["react-colorful__hue",e.className]);return w.createElement("div",{className:n},w.createElement(Nl,{onMove:function(i){r({h:360*i.left})},onKey:function(i){r({h:Dn(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":ft(t),"aria-valuemax":"360","aria-valuemin":"0"},w.createElement(Al,{className:"react-colorful__hue-pointer",left:t/360,color:jo({h:t,s:100,v:100,a:1})})))}),Gv=w.memo(function(e){var t=e.hsva,r=e.onChange,n={backgroundColor:jo({h:t.h,s:100,v:100,a:1})};return w.createElement("div",{className:"react-colorful__saturation",style:n},w.createElement(Nl,{onMove:function(i){r({s:100*i.left,v:100-100*i.top})},onKey:function(i){r({s:Dn(t.s+100*i.left,0,100),v:Dn(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ft(t.s)+"%, Brightness "+ft(t.v)+"%"},w.createElement(Al,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:jo(t)})))}),Fl=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},Yv=function(e,t){return e.toLowerCase()===t.toLowerCase()||Fl(Ro(e),Ro(t))};function Kv(e,t,r){var n=No(r),i=w.useState(function(){return e.toHsva(t)}),a=i[0],o=i[1],s=w.useRef({color:t,hsva:a});w.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},o(u)}},[t,e]),w.useEffect(function(){var u;Fl(a,s.current.hsva)||e.equal(u=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:u},n(u))},[a,e,n]);var c=w.useCallback(function(u){o(function(l){return Object.assign({},l,u)})},[]);return[a,c]}var Xv=typeof window<"u"?w.useLayoutEffect:w.useEffect,Jv=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Rl=new Map,Zv=function(e){Xv(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Rl.has(t)){var r=t.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Rl.set(t,r);var n=Jv();n&&r.setAttribute("nonce",n),t.head.appendChild(r)}},[])},ey=function(e){var t=e.className,r=e.colorModel,n=e.color,i=n===void 0?r.defaultColor:n,a=e.onChange,o=Ll(e,["className","colorModel","color","onChange"]),s=w.useRef(null);Zv(s);var c=Kv(r,i,a),u=c[0],l=c[1],d=Fo(["react-colorful",t]);return w.createElement("div",Ai({},o,{ref:s,className:d}),w.createElement(Gv,{hsva:u,onChange:l}),w.createElement(Hv,{hue:u.h,onChange:l,className:"react-colorful__last-control"}))},ty={defaultColor:"000",toHsva:$v,fromHsva:function(e){return Uv({h:e.h,s:e.s,v:e.v,a:1})},equal:Yv},ry=function(e){return w.createElement(ey,Ai({},e,{colorModel:ty}))};function ny({track:e}){const t=w.useContext(Pt),[r,n]=w.useState(e),[i,a]=w.useState(r.color),{value:o,valid:s,onChange:c}=Mi(r.title,r.title,ay);w.useEffect(()=>{n(e),a(e.color)},[e.id]);const u=l=>{t({type:ue.UPDATE_TRACK,id:r.id,track:l})};return w.useEffect(()=>{i!==r.color&&u({color:i}),s&&o!==r.title&&u({title:o})},[i,s,o]),p.jsxs(Li,{children:[p.jsx("div",{children:"Color: "}),p.jsx(iy,{color:i||"",onChange:a}),p.jsx("div",{children:"Title: "}),p.jsx("input",{style:{...Ii,...Pi,...Ni},id:"titleInput",type:"text",value:o,placeholder:r.title,onChange:c})]})}function iy({color:e,onChange:t}){const[r,n]=w.useState(!1),i={width:"28px",height:"28px",borderRadius:"8px",border:"3px solid #fff",boxShadow:"0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.1)",cursor:"pointer",backgroundColor:e},a={position:"absolute",top:"calc(100% + 2px)",left:"0",borderRadius:"9px",boxShadow:"0 6px 12px rgba(0, 0, 0, 0.15)"};return p.jsxs("div",{style:{position:"relative"},children:[p.jsx("div",{style:i,onClick:()=>n(!r)}),r&&p.jsx("div",{style:a,children:p.jsx(ry,{color:e,onChange:t})})]})}function ay(e){const t=document.getElementById("titleInput");return t==null?!1:e.length===0?(t.setCustomValidity("Empty input"),t.reportValidity(),!1):!0}function oy(){const{openModal:e,closeModal:t}=w.useContext(la),[r,n]=w.useState(!1),i=w.useContext(vr),[a,o]=w.useState(i.tracks.find(l=>l.id===(e==null?void 0:e.trackId))||{});w.useEffect(()=>{o(i.tracks.find(l=>l.id===(e==null?void 0:e.trackId))||{})},[e,i.tracks]);const s=()=>{n(!0)},c=()=>{n(!1)};w.useEffect(()=>{const l=d=>{d.key==="Escape"&&t()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[t]);const u=w.useRef(null);return e?tn.createPortal(p.jsx("div",{className:"modal",children:p.jsx(Xn,{nodeRef:u,handle:".header",onStart:s,onStop:c,children:p.jsxs("div",{ref:u,className:"content",style:{...Nv,position:"absolute",top:e==null?void 0:e.mouseY,left:e==null?void 0:e.mouseX,zIndex:1400},children:[p.jsxs("div",{className:"header",style:{backgroundColor:a.color||"transparent",color:jl(a.color||"transparent"),cursor:r?"grabbing":"grab",display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[p.jsx(sy,{handleClose:t,color:jl(a.color||"transparent")}),p.jsx("div",{style:{margin:"10px"},children:p.jsxs("div",{style:{paddingBottom:"0px",fontSize:"1.2em",fontWeight:"bold"},children:["Configure ",a.title]})})]}),p.jsxs("div",{style:{padding:"5px"},children:[p.jsx(ny,{track:a}),p.jsx(Av,{track:a}),(()=>{switch(a.trackType){case G.BIGWIG:return p.jsx(Vv,{track:a});case G.TRANSCRIPT:return p.jsx(qv,{track:a});default:return null}})()]})]})})}),document.body):null}function sy({handleClose:e,color:t}){const r="25px";return p.jsx("svg",{style:{color:t,fontSize:r,cursor:"pointer",position:"absolute",top:"5px",right:"5px"},onClick:e,width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z",fill:t})})}function jl(e){if(!e)return"#000000";let t,r,n;const i=e.slice(1);return t=parseInt(i.slice(0,2),16),r=parseInt(i.slice(2,4),16),n=parseInt(i.slice(4,6),16),(.299*t+.587*r+.114*n)/255>.5?"#000000":"#ffffff"}function cy(e){return e>=1e9?Math.round(e/1e9)+" Gb":e>=1e6?Math.round(e/1e6)+" Mb":e>=1e3?Math.round(e/1e3)+" kb":e+" bp"}const uy=e=>{const t=w.useMemo(()=>{const r=e.domain.end-e.domain.start,n={start:e.domain.start,end:e.domain.end},i=Ct(n,e.width),o=Math.pow(10,Math.floor(Math.log10(Math.ceil(r/10))))*6,s=(Math.ceil(n.end/o)-Math.ceil(n.start/o))*o/2,c={start:n.start+s/2,end:n.end-s/2},u=[];for(let l=Math.ceil(n.start/o);l<Math.ceil(n.end/o);++l)u.push(p.jsxs("g",{children:[p.jsx("line",{x1:i(l*o),x2:i(l*o),y1:e.height*.6,y2:e.height*.9,stroke:"#000",strokeWidth:.5}),l>=Math.ceil(n.start/o)&&p.jsx("text",{style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},textAnchor:"end",fontSize:e.height/4+"px",x:i(l*o)-5,y:e.height*.85,children:l*o})]},"ruler_"+l));return p.jsxs("g",{width:e.width,height:e.height,children:[p.jsx("line",{x1:i(c.start),x2:i(c.start),y1:e.height*.1,y2:e.height*.4,stroke:"#000",strokeWidth:.5}),p.jsx("line",{x1:i(c.end),x2:i(c.end),y1:e.height*.1,y2:e.height*.4,stroke:"#000",strokeWidth:.5}),p.jsx("line",{x1:i(c.start),x2:i(c.end),y1:e.height*.25,y2:e.height*.25,stroke:"#000",strokeWidth:.5}),p.jsx("text",{style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},x:i(c.start)-5,y:e.height*.35,fontSize:e.height/4+"px",textAnchor:"end",children:cy(c.end-c.start)}),u]})},[e.canDrag===!1&&e.domain]);return p.jsx(Dt,{canDrag:!0,children:t})};function ly(e){return p.jsx(et,{...e,id:"ruler",trackType:G.RULER,children:p.jsx(uy,{...e})})}const fy=e=>{const{x:t,y:r,show:n}=w.useContext(Kt);return p.jsx("g",{transform:`translate(${t}, ${r})`,style:{visibility:n?"visible":"hidden"},children:p.jsx("foreignObject",{width:e.width,height:e.height,style:{overflow:"visible"},children:e.children})})},hy={cursor:"default",fontSize:"12px",padding:"6px 15px 5px 5px"},dy=e=>{var i;const t=w.useCallback(a=>{switch(a){case"download":e.data.downloadSVG&&e.data.downloadSVG();break;default:e.onModeChange&&e.onModeChange(e.data.id,a)}e.setContextMenu({show:!1,x:0,y:0,id:""})},[e.data,e.onModeChange]),[r,n]=w.useState(null);return p.jsx("div",{style:{position:"fixed",background:"white",boxShadow:"0px 2px 10px #999999"},children:(i=e.data.displayModeOptions)==null?void 0:i.map(a=>p.jsx("div",{onMouseOver:()=>n(a),onMouseOut:()=>n(null),onClick:()=>t(a),style:{backgroundColor:e.data.displayMode===a?"#d0d0d0":a===r?"#f0f0f0":"white",...hy},children:e.data.displayMode===a?p.jsx("li",{children:a}):a},a))})};function py(e,t){switch(t.type){case"tooltipChanged":return{...e,tooltip:t.tooltip};case"contextMenuChanged":return{...e,contextmenu:t.contextmenu};default:return e}}function gy({children:e,onModeChange:t}){const[r,n]=w.useReducer(py,{tooltip:{show:!1,x:0,y:0,width:0,height:0,content:void 0},contextmenu:{show:!1,x:0,y:0,id:"",displayMode:void 0,displayModeOptions:void 0}}),i=w.useCallback(o=>{n({type:"tooltipChanged",tooltip:o})},[n]),a=w.useCallback(o=>{n({type:"contextMenuChanged",contextmenu:o})},[n]);return p.jsx(Kt.Provider,{value:{...r.tooltip,setTooltip:i},children:p.jsxs(ha.Provider,{value:{...r.contextmenu,setContextMenu:a},children:[e,p.jsx(fy,{width:r.tooltip.width,height:r.tooltip.height,children:p.jsx("div",{style:{position:"fixed"},children:r.tooltip.content})}),p.jsx(Uh,{width:80,height:150,children:p.jsx(dy,{data:r.contextmenu,onModeChange:t,setContextMenu:a})})]})})}const vy=e=>{const[t,r]=w.useState([0,0]),[n,i]=w.useState(!1),a=w.useCallback((u,l)=>{const d=l.createSVGPoint();d.x=u.clientX,d.y=u.clientY;const f=l.getScreenCTM();return f?d.matrixTransform(f.inverse()):null},[]),o=w.useCallback(u=>{const l=document.getElementById("browserSVG");if(!(l instanceof SVGSVGElement))return;const d=a(u,l);if(!d)return;const f=d.x;r([f,f]),i(!0)},[a]),s=w.useCallback(u=>{if(!n)return;const l=document.getElementById("browserSVG");if(!(l instanceof SVGSVGElement))return;const d=a(u,l);if(!d)return;let f=d.x;f<e.leftMargin&&(f=e.leftMargin),f>e.width&&(f=e.width),r(v=>[v[0],f])},[n,e.width,e.leftMargin,a]),c=w.useCallback(u=>{if(!n||(i(!1),t[1]-t[0]<10))return;u.preventDefault();const l=e.domain.end-e.domain.start,d=e.width-e.leftMargin,f=(Math.min(t[0],t[1])-e.leftMargin)/d,v=(Math.max(t[0],t[1])-e.leftMargin)/d,E={chromosome:e.domain.chromosome,start:Math.floor(e.domain.start+f*l),end:Math.floor(e.domain.start+v*l)};r([0,0]),e.onSelectionEnd(E)},[t]);return w.useEffect(()=>(document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c)}),[s,c]),p.jsxs(p.Fragment,{children:[n?tn.createPortal(p.jsx("rect",{id:"selectRegion",fill:"#6666aaaa",stroke:"#000000",strokeWidth:.5,strokeDasharray:"5 5",x:Math.min(t[0],t[1]),y:0,width:Math.abs(t[1]-t[0]),height:e.height}),document.getElementById("browserSVG")):null,p.jsx("rect",{fill:"#ffffff",width:e.width-e.leftMargin,height:e.dragRegionHeight,x:e.leftMargin,y:0,onMouseDown:o})]})};function yy({width:e,innerWidth:t,height:r,svgRef:n,children:i}){return p.jsx("svg",{id:"browserSVG",width:e,viewBox:`0 0 ${t} ${r}`,ref:n,children:i})}function my({children:e,browserState:t,rulerHeight:r}){const[n,i]=w.useState([]);return w.useEffect(()=>{let a=r;const o=t.tracks.map(s=>{const c=a;return a+=s.actualHeight??s.height??0,c});i(o)},[t.tracks]),p.jsx(p.Fragment,{children:n.length>0&&w.Children.map(e,(a,o)=>{const s=a.props,c=n[o];return p.jsx("g",{id:`stacked-track-${s.track.id}`,transform:typeof c=="number"?`translate(0, ${c})`:void 0,children:a},o)})})}const Vl=_t`
|
|
198
|
+
`,Ol={titleSize:12,ldThreshold:.7,displayMode:Ae.FULL,canDrag:!0};function Tl(e){var c,u,l;const t=w.useContext(Pt),r={...e,trackType:J.LDTRACK,displayMode:e.displayMode},n=_v(Ks),i=ml(_t(n),{variables:{assembly:"GRCh38",snpids:[e.anchor]}}),a=d=>{t({type:ue.UPDATE_PROPS,id:e.id||"",props:{anchor:d.id}})};let o=[];if(i.data){if(i.data.snpQuery.length===0)return;o=Ks.map(d=>{var f;return{ld:((f=i.data)==null?void 0:f.snpQuery[0][`${d.population}_${d.subpopulation||""}_ld`])||[]}})}const s={snps:((c=e.data)==null?void 0:c.snps)||[],ld:o&&((u=o[0])==null?void 0:u.ld)||((l=e.data)==null?void 0:l.ld)||[]};switch(e.displayMode){case Ae.FULL:return p.jsx(et,{...r,loading:i.loading,trackType:J.LDTRACK,displayMode:e.displayMode,children:p.jsx(jh,{...e,onVariantMouseOver:d=>{a(d),e.onVariantMouseOver&&e.onVariantMouseOver(d)},data:s})});default:return console.warn(`Display mode "${e.displayMode}" not supported on BigWig`),p.jsx(et,{...r,children:p.jsx(Dr,{...e,error:!0,text:`Error: Unsupported display mode "${e.displayMode}"`})})}}const kv=e=>{const t=e.width<1e3?e.width/8:150,r={...e,height:0,marginSize:t,menuHeight:0,preRenderedWidth:e.width-t,zoomLevel:1,delta:0,highlights:e.highlights||[],tracks:e.tracks||[]};return w.useReducer(Nd,r)};var Cl=Object.prototype.hasOwnProperty;function _l(e,t,r){for(r of e.keys())if(kn(r,t))return r}function kn(e,t){var r,n,i;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&kn(e[n],t[n]););return n===-1}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if(i=n,i&&typeof i=="object"&&(i=_l(t,i),!i)||!t.has(i))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if(i=n[0],i&&typeof i=="object"&&(i=_l(t,i),!i)||!kn(n[1],t.get(i)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(!r||typeof e=="object"){n=0;for(r in e)if(Cl.call(e,r)&&++n&&!Cl.call(t,r)||!(r in t)||!kn(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function Dv(e){if(!e||!e.length)throw new Error("useDeepCompareEffect should not be used with no dependencies. Use React.useEffect instead.");if(e.every(Mv))throw new Error("useDeepCompareEffect should not be used with dependencies that are all primitive values. Use React.useEffect instead.")}function Mv(e){return e==null||/^[sbn]/.test(typeof e)}function Lv(e){var t=Hn.useRef(e),r=Hn.useRef(0);return kn(e,t.current)||(t.current=e,r.current+=1),Hn.useMemo(function(){return t.current},[r.current])}function Iv(e,t){return process.env.NODE_ENV!=="production"&&Dv(t),Hn.useEffect(e,Lv(t))}function Pv(){const[e,t]=w.useState(null);return{openModal:e,showModal:(i,a,o)=>{t({trackId:i,mouseX:a,mouseY:o})},closeModal:()=>{t(null)}}}function Mi(e,t,r){const[n,i]=w.useState(e),[a,o]=w.useState(r(t)),[s,c]=w.useState(null);return{value:n,valid:a,onChange:l=>{const d=l.target.value,f=d===""?2e3:750;i(d),o(!1),s&&clearTimeout(s);const v=setTimeout(()=>{r(d)||i(t),o(!0)},f);c(v)}}}function Li({children:e}){return p.jsx("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",paddingBlock:"5px"},children:e})}const Nv={position:"fixed",top:"0%",left:"0%",boxShadow:"0 0 10px rgba(0, 0, 0, 0.3)",width:"500px",transform:"translate(-50%, -50%)",background:"#ffffff"},Ii={width:"auto",outline:"#ffffff",border:"1px solid #000000",borderRadius:"2px",paddingRight:"5px"},kl={display:"flex",flexDirection:"column",paddingInline:"5px"},Pi={WebkitAppearance:"none",margin:"0"},Ni={MozAppearance:"textfield",appearance:"textfield"};function Dl(e){switch(e.trackType){case J.BIGWIG:return e.actualHeight;case J.BIGBED:return e.displayMode===Ae.DENSE?e.actualHeight:e.rowHeight;case J.TRANSCRIPT:return e.rowHeight;default:return e.height}}function Av({track:e}){const t=w.useContext(vr),r=w.useContext(Pt),[n,i]=w.useState(t.tracks.find(d=>d.id===e.id)||e),[a,o]=w.useState(Dl(n)),s=jv(n);w.useEffect(()=>{i(t.tracks.find(d=>d.id===e.id)||e),o(Dl(n))},[e]);const{value:c,valid:u,onChange:l}=Mi((a==null?void 0:a.toString())||"",(a==null?void 0:a.toString())||"",n.trackType===J.BIGWIG?Fv:Rv);return w.useEffect(()=>{u&&(s==="Height"?r({type:ue.UPDATE_TRACK,id:n.id,track:{height:parseInt(c)}}):s==="Row Height"&&r({type:ue.UPDATE_TRACK,id:n.id,track:{rowHeight:parseInt(c)}}))},[c,u]),p.jsxs(Li,{children:[s,":",p.jsx("input",{id:"heightInput",style:{...Ii,...Pi,...Ni},type:"number",placeholder:(a==null?void 0:a.toString())||"",value:c,onChange:l})]})}function Ml(e){const t=document.getElementById("heightInput");return t?e.length===0?(t.setCustomValidity("Empty input"),t.reportValidity(),!1):isNaN(parseInt(e))?(t.setCustomValidity("Invalid input"),t.reportValidity(),!1):!0:!0}function Fv(e){if(!Ml(e))return!1;const t=document.getElementById("heightInput");return t&&parseInt(e)<50?(t.setCustomValidity("Value must be greater than or equal to 50"),t.reportValidity(),!1):!0}function Rv(e){if(!Ml(e))return!1;const t=document.getElementById("heightInput");return t&&parseInt(e)<10?(t.setCustomValidity("Value must be greater than or equal to 10"),t.reportValidity(),!1):!0}function jv(e){switch(e.trackType){case J.BIGBED:return e.displayMode===Ae.DENSE?"Height":"Row Height";case J.TRANSCRIPT:return"Row Height";default:return"Height"}}const Vv=(e,t,r)=>{if(!r)return!1;const n=document.querySelector('input[id="minInput"]'),i=document.querySelector('input[id="maxInput"]');return!n||!i?!0:e>t?(n.setCustomValidity("Minimum value cannot be greater than maximum value."),n.reportValidity(),!0):e==t?(i.setCustomValidity("Values are equal. Please enter different values."),i.reportValidity(),!0):e<r.min?(n.setCustomValidity("Minimum value cannot be less than the default minimum value."),n.reportValidity(),!0):t>r.max?(i.setCustomValidity("Maximum value cannot be greater than the default maximum value."),i.reportValidity(),!0):!1};function qv({track:e}){var v,E,x,T,O,_;const t=w.useContext(Pt),[r]=w.useState(((v=e.props)==null?void 0:v.defaultRange)||{min:0,max:0}),[n]=w.useState(((E=e.props)==null?void 0:E.range)||r),i=m=>{const C=document.getElementById("minInput");return C?m.length===0||isNaN(parseFloat(m))?(C.setCustomValidity("Empty input, using default value"),C.reportValidity(),!1):parseFloat(m)<r.min?(C.setCustomValidity("Value must be greater than or equal to "+r.min),C.reportValidity(),!1):(C.setCustomValidity(""),!0):!0},a=m=>{const C=document.getElementById("maxInput");return C?m.length===0||isNaN(parseFloat(m))?(C.setCustomValidity("Empty input, using default value"),C.reportValidity(),!1):parseFloat(m)>r.max?(C.setCustomValidity("Value must be less than or equal to "+r.max),C.reportValidity(),!1):(C.setCustomValidity(""),!0):!0},{value:o,valid:s,onChange:c}=Mi(n.min.toString(),r.min.toString(),i),{value:u,valid:l,onChange:d}=Mi(n.max.toString(),r.max.toString(),a),f=m=>{m.target.select()};return w.useEffect(()=>{!s||!l||Vv(parseFloat(o),parseFloat(u),r)||t({type:ue.UPDATE_PROPS,id:e.id,props:{range:{min:parseFloat(o),max:parseFloat(u)}}})},[s,l,o,u]),p.jsxs(Li,{children:[p.jsxs("label",{style:kl,children:["Minimum:",p.jsx("input",{id:"minInput",style:{...Ii,...Pi,...Ni},step:"0.01",type:"number",placeholder:(T=(x=e==null?void 0:e.props)==null?void 0:x.defaultRange)==null?void 0:T.min.toFixed(2),value:Number(o).toFixed(2),onFocus:f,onChange:c})]}),p.jsxs("label",{style:kl,children:["Maximum:",p.jsx("input",{id:"maxInput",style:{...Ii,...Pi,...Ni},step:"0.01",type:"number",placeholder:(_=(O=e==null?void 0:e.props)==null?void 0:O.defaultRange)==null?void 0:_.max.toFixed(2),value:Number(u).toFixed(2),onChange:d,onFocus:f})]})]})}function $v({track:e}){const t=w.useContext(Pt),[r,n]=w.useState(e.version);w.useEffect(()=>{n(e.version)},[e.version]);const i=s=>{n(s);const c=Object.values(Jn).includes(s);t({type:ue.UPDATE_TRACK,id:e.id,track:{version:s,assembly:c?"GRCH38":"mm10"}})},a=s=>({backgroundColor:r===s?e.color:"#858585",color:"white",marginRight:"5px",padding:"10px",border:"none",borderRadius:"5px",cursor:"pointer"}),o=e.assembly.toLowerCase()==="grch38";return p.jsx(Li,{children:p.jsxs("div",{children:[p.jsx("div",{children:o?"Human Assembly Version":"Mouse Assembly Version"}),Object.values(o?Jn:ca).filter(s=>!isNaN(Number(s))).map((s,c)=>p.jsx("button",{onClick:()=>i(Number(s)),style:a(Number(s)),children:s},c))]})})}function Ai(){return(Ai=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Ll(e,t){if(e==null)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(i[r]=e[r]);return i}function No(e){var t=w.useRef(e),r=w.useRef(function(n){t.current&&t.current(n)});return t.current=e,r.current}var Dn=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e<t?t:e},Mn=function(e){return"touches"in e},Ao=function(e){return e&&e.ownerDocument.defaultView||self},Il=function(e,t,r){var n=e.getBoundingClientRect(),i=Mn(t)?function(a,o){for(var s=0;s<a.length;s++)if(a[s].identifier===o)return a[s];return a[0]}(t.touches,r):t;return{left:Dn((i.pageX-(n.left+Ao(e).pageXOffset))/n.width),top:Dn((i.pageY-(n.top+Ao(e).pageYOffset))/n.height)}},Pl=function(e){!Mn(e)&&e.preventDefault()},Nl=w.memo(function(e){var t=e.onMove,r=e.onKey,n=Ll(e,["onMove","onKey"]),i=w.useRef(null),a=No(t),o=No(r),s=w.useRef(null),c=w.useRef(!1),u=w.useMemo(function(){var v=function(T){Pl(T),(Mn(T)?T.touches.length>0:T.buttons>0)&&i.current?a(Il(i.current,T,s.current)):x(!1)},E=function(){return x(!1)};function x(T){var O=c.current,_=Ao(i.current),m=T?_.addEventListener:_.removeEventListener;m(O?"touchmove":"mousemove",v),m(O?"touchend":"mouseup",E)}return[function(T){var O=T.nativeEvent,_=i.current;if(_&&(Pl(O),!function(C,S){return S&&!Mn(C)}(O,c.current)&&_)){if(Mn(O)){c.current=!0;var m=O.changedTouches||[];m.length&&(s.current=m[0].identifier)}_.focus(),a(Il(_,O,s.current)),x(!0)}},function(T){var O=T.which||T.keyCode;O<37||O>40||(T.preventDefault(),o({left:O===39?.05:O===37?-.05:0,top:O===40?.05:O===38?-.05:0}))},x]},[o,a]),l=u[0],d=u[1],f=u[2];return w.useEffect(function(){return f},[f]),w.createElement("div",Ai({},n,{onTouchStart:l,onMouseDown:l,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),Fo=function(e){return e.filter(Boolean).join(" ")},Al=function(e){var t=e.color,r=e.left,n=e.top,i=n===void 0?.5:n,a=Fo(["react-colorful__pointer",e.className]);return w.createElement("div",{className:a,style:{top:100*i+"%",left:100*r+"%"}},w.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},ft=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r},Uv=function(e){return Wv(Ro(e))},Ro=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?ft(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?ft(parseInt(e.substring(6,8),16)/255,2):1}},Bv=function(e){return Qv(zv(e))},Hv=function(e){var t=e.s,r=e.v,n=e.a,i=(200-t)*r/100;return{h:ft(e.h),s:ft(i>0&&i<200?t*r/100/(i<=100?i:200-i)*100:0),l:ft(i/2),a:ft(n,2)}},jo=function(e){var t=Hv(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},zv=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),o=n*(1-r),s=n*(1-(t-a)*r),c=n*(1-(1-t+a)*r),u=a%6;return{r:ft(255*[n,s,o,o,c,n][u]),g:ft(255*[c,n,n,s,o,o][u]),b:ft(255*[o,o,c,n,n,s][u]),a:ft(i,2)}},Fi=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Qv=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=i<1?Fi(ft(255*i)):"";return"#"+Fi(t)+Fi(r)+Fi(n)+a},Wv=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=Math.max(t,r,n),o=a-Math.min(t,r,n),s=o?a===t?(r-n)/o:a===r?2+(n-t)/o:4+(t-r)/o:0;return{h:ft(60*(s<0?s+6:s)),s:ft(a?o/a*100:0),v:ft(a/255*100),a:i}},Gv=w.memo(function(e){var t=e.hue,r=e.onChange,n=Fo(["react-colorful__hue",e.className]);return w.createElement("div",{className:n},w.createElement(Nl,{onMove:function(i){r({h:360*i.left})},onKey:function(i){r({h:Dn(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":ft(t),"aria-valuemax":"360","aria-valuemin":"0"},w.createElement(Al,{className:"react-colorful__hue-pointer",left:t/360,color:jo({h:t,s:100,v:100,a:1})})))}),Yv=w.memo(function(e){var t=e.hsva,r=e.onChange,n={backgroundColor:jo({h:t.h,s:100,v:100,a:1})};return w.createElement("div",{className:"react-colorful__saturation",style:n},w.createElement(Nl,{onMove:function(i){r({s:100*i.left,v:100-100*i.top})},onKey:function(i){r({s:Dn(t.s+100*i.left,0,100),v:Dn(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ft(t.s)+"%, Brightness "+ft(t.v)+"%"},w.createElement(Al,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:jo(t)})))}),Fl=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},Kv=function(e,t){return e.toLowerCase()===t.toLowerCase()||Fl(Ro(e),Ro(t))};function Xv(e,t,r){var n=No(r),i=w.useState(function(){return e.toHsva(t)}),a=i[0],o=i[1],s=w.useRef({color:t,hsva:a});w.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},o(u)}},[t,e]),w.useEffect(function(){var u;Fl(a,s.current.hsva)||e.equal(u=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:u},n(u))},[a,e,n]);var c=w.useCallback(function(u){o(function(l){return Object.assign({},l,u)})},[]);return[a,c]}var Jv=typeof window<"u"?w.useLayoutEffect:w.useEffect,Zv=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Rl=new Map,ey=function(e){Jv(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Rl.has(t)){var r=t.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Rl.set(t,r);var n=Zv();n&&r.setAttribute("nonce",n),t.head.appendChild(r)}},[])},ty=function(e){var t=e.className,r=e.colorModel,n=e.color,i=n===void 0?r.defaultColor:n,a=e.onChange,o=Ll(e,["className","colorModel","color","onChange"]),s=w.useRef(null);ey(s);var c=Xv(r,i,a),u=c[0],l=c[1],d=Fo(["react-colorful",t]);return w.createElement("div",Ai({},o,{ref:s,className:d}),w.createElement(Yv,{hsva:u,onChange:l}),w.createElement(Gv,{hue:u.h,onChange:l,className:"react-colorful__last-control"}))},ry={defaultColor:"000",toHsva:Uv,fromHsva:function(e){return Bv({h:e.h,s:e.s,v:e.v,a:1})},equal:Kv},ny=function(e){return w.createElement(ty,Ai({},e,{colorModel:ry}))};function iy({track:e}){const t=w.useContext(Pt),[r,n]=w.useState(e),[i,a]=w.useState(r.color),{value:o,valid:s,onChange:c}=Mi(r.title,r.title,oy);w.useEffect(()=>{n(e),a(e.color)},[e.id]);const u=l=>{t({type:ue.UPDATE_TRACK,id:r.id,track:l})};return w.useEffect(()=>{i!==r.color&&u({color:i}),s&&o!==r.title&&u({title:o})},[i,s,o]),p.jsxs(Li,{children:[p.jsx("div",{children:"Color: "}),p.jsx(ay,{color:i||"",onChange:a}),p.jsx("div",{children:"Title: "}),p.jsx("input",{style:{...Ii,...Pi,...Ni},id:"titleInput",type:"text",value:o,placeholder:r.title,onChange:c})]})}function ay({color:e,onChange:t}){const[r,n]=w.useState(!1),i={width:"28px",height:"28px",borderRadius:"8px",border:"3px solid #fff",boxShadow:"0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.1)",cursor:"pointer",backgroundColor:e},a={position:"absolute",top:"calc(100% + 2px)",left:"0",borderRadius:"9px",boxShadow:"0 6px 12px rgba(0, 0, 0, 0.15)"};return p.jsxs("div",{style:{position:"relative"},children:[p.jsx("div",{style:i,onClick:()=>n(!r)}),r&&p.jsx("div",{style:a,children:p.jsx(ny,{color:e,onChange:t})})]})}function oy(e){const t=document.getElementById("titleInput");return t==null?!1:e.length===0?(t.setCustomValidity("Empty input"),t.reportValidity(),!1):!0}function sy(){const{openModal:e,closeModal:t}=w.useContext(la),[r,n]=w.useState(!1),i=w.useContext(vr),[a,o]=w.useState(i.tracks.find(l=>l.id===(e==null?void 0:e.trackId))||{});w.useEffect(()=>{o(i.tracks.find(l=>l.id===(e==null?void 0:e.trackId))||{})},[e,i.tracks]);const s=()=>{n(!0)},c=()=>{n(!1)};w.useEffect(()=>{const l=d=>{d.key==="Escape"&&t()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[t]);const u=w.useRef(null);return e?tn.createPortal(p.jsx("div",{className:"modal",children:p.jsx(Xn,{nodeRef:u,handle:".header",onStart:s,onStop:c,children:p.jsxs("div",{ref:u,className:"content",style:{...Nv,position:"absolute",top:e==null?void 0:e.mouseY,left:e==null?void 0:e.mouseX,zIndex:1400},children:[p.jsxs("div",{className:"header",style:{backgroundColor:a.color||"transparent",color:jl(a.color||"transparent"),cursor:r?"grabbing":"grab",display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[p.jsx(cy,{handleClose:t,color:jl(a.color||"transparent")}),p.jsx("div",{style:{margin:"10px"},children:p.jsxs("div",{style:{paddingBottom:"0px",fontSize:"1.2em",fontWeight:"bold"},children:["Configure ",a.title]})})]}),p.jsxs("div",{style:{padding:"5px"},children:[p.jsx(iy,{track:a}),p.jsx(Av,{track:a}),(()=>{switch(a.trackType){case J.BIGWIG:return p.jsx(qv,{track:a});case J.TRANSCRIPT:return p.jsx($v,{track:a});default:return null}})()]})]})})}),document.body):null}function cy({handleClose:e,color:t}){const r="25px";return p.jsx("svg",{style:{color:t,fontSize:r,cursor:"pointer",position:"absolute",top:"5px",right:"5px"},onClick:e,width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z",fill:t})})}function jl(e){if(!e)return"#000000";const t=e.slice(1),r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16);return(.299*r+.587*n+.114*i)/255>.5?"#000000":"#ffffff"}function uy(e){return e>=1e9?Math.round(e/1e9)+" Gb":e>=1e6?Math.round(e/1e6)+" Mb":e>=1e3?Math.round(e/1e3)+" kb":e+" bp"}const ly=e=>{const t=w.useMemo(()=>{const r=e.domain.end-e.domain.start,n={start:e.domain.start,end:e.domain.end},i=Ct(n,e.width),o=Math.pow(10,Math.floor(Math.log10(Math.ceil(r/10))))*6,s=(Math.ceil(n.end/o)-Math.ceil(n.start/o))*o/2,c={start:n.start+s/2,end:n.end-s/2},u=[];for(let l=Math.ceil(n.start/o);l<Math.ceil(n.end/o);++l)u.push(p.jsxs("g",{children:[p.jsx("line",{x1:i(l*o),x2:i(l*o),y1:e.height*.6,y2:e.height*.9,stroke:"#000",strokeWidth:.5}),l>=Math.ceil(n.start/o)&&p.jsx("text",{style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},textAnchor:"end",fontSize:e.height/4+"px",x:i(l*o)-5,y:e.height*.85,children:l*o})]},"ruler_"+l));return p.jsxs("g",{width:e.width,height:e.height,children:[p.jsx("line",{x1:i(c.start),x2:i(c.start),y1:e.height*.1,y2:e.height*.4,stroke:"#000",strokeWidth:.5}),p.jsx("line",{x1:i(c.end),x2:i(c.end),y1:e.height*.1,y2:e.height*.4,stroke:"#000",strokeWidth:.5}),p.jsx("line",{x1:i(c.start),x2:i(c.end),y1:e.height*.25,y2:e.height*.25,stroke:"#000",strokeWidth:.5}),p.jsx("text",{style:{pointerEvents:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},x:i(c.start)-5,y:e.height*.35,fontSize:e.height/4+"px",textAnchor:"end",children:uy(c.end-c.start)}),u]})},[e.canDrag===!1&&e.domain]);return p.jsx(Dt,{canDrag:!0,children:t})};function fy(e){return p.jsx(et,{...e,id:"ruler",trackType:J.RULER,children:p.jsx(ly,{...e})})}const dy=e=>{const{x:t,y:r,show:n}=w.useContext(Kt);return p.jsx("g",{transform:`translate(${t}, ${r})`,style:{visibility:n?"visible":"hidden"},children:p.jsx("foreignObject",{width:e.width,height:e.height,style:{overflow:"visible"},children:e.children})})},hy={cursor:"default",fontSize:"12px",padding:"6px 15px 5px 5px"},py=e=>{var i;const t=w.useCallback(a=>{switch(a){case"download":e.data.downloadSVG&&e.data.downloadSVG();break;default:e.onModeChange&&e.onModeChange(e.data.id,a)}e.setContextMenu({show:!1,x:0,y:0,id:""})},[e.data,e.onModeChange]),[r,n]=w.useState(null);return p.jsx("div",{style:{position:"fixed",background:"white",boxShadow:"0px 2px 10px #999999"},children:(i=e.data.displayModeOptions)==null?void 0:i.map(a=>p.jsx("div",{onMouseOver:()=>n(a),onMouseOut:()=>n(null),onClick:()=>t(a),style:{backgroundColor:e.data.displayMode===a?"#d0d0d0":a===r?"#f0f0f0":"white",...hy},children:e.data.displayMode===a?p.jsx("li",{children:a}):a},a))})};function gy(e,t){switch(t.type){case"tooltipChanged":return{...e,tooltip:t.tooltip};case"contextMenuChanged":return{...e,contextmenu:t.contextmenu};default:return e}}function vy({children:e,onModeChange:t}){const[r,n]=w.useReducer(gy,{tooltip:{show:!1,x:0,y:0,width:0,height:0,content:void 0},contextmenu:{show:!1,x:0,y:0,id:"",displayMode:void 0,displayModeOptions:void 0}}),i=w.useCallback(o=>{n({type:"tooltipChanged",tooltip:o})},[n]),a=w.useCallback(o=>{n({type:"contextMenuChanged",contextmenu:o})},[n]);return p.jsx(Kt.Provider,{value:{...r.tooltip,setTooltip:i},children:p.jsxs(da.Provider,{value:{...r.contextmenu,setContextMenu:a},children:[e,p.jsx(dy,{width:r.tooltip.width,height:r.tooltip.height,children:p.jsx("div",{style:{position:"fixed"},children:r.tooltip.content})}),p.jsx(Ud,{width:80,height:150,children:p.jsx(py,{data:r.contextmenu,onModeChange:t,setContextMenu:a})})]})})}const yy=e=>{const[t,r]=w.useState([0,0]),[n,i]=w.useState(!1),a=w.useCallback((u,l)=>{const d=l.createSVGPoint();d.x=u.clientX,d.y=u.clientY;const f=l.getScreenCTM();return f?d.matrixTransform(f.inverse()):null},[]),o=w.useCallback(u=>{const l=document.getElementById("browserSVG");if(!(l instanceof SVGSVGElement))return;const d=a(u,l);if(!d)return;const f=d.x;r([f,f]),i(!0)},[a]),s=w.useCallback(u=>{if(!n)return;const l=document.getElementById("browserSVG");if(!(l instanceof SVGSVGElement))return;const d=a(u,l);if(!d)return;let f=d.x;f<e.leftMargin&&(f=e.leftMargin),f>e.width&&(f=e.width),r(v=>[v[0],f])},[n,e.width,e.leftMargin,a]),c=w.useCallback(u=>{if(!n||(i(!1),t[1]-t[0]<10))return;u.preventDefault();const l=e.domain.end-e.domain.start,d=e.width-e.leftMargin,f=(Math.min(t[0],t[1])-e.leftMargin)/d,v=(Math.max(t[0],t[1])-e.leftMargin)/d,E={chromosome:e.domain.chromosome,start:Math.floor(e.domain.start+f*l),end:Math.floor(e.domain.start+v*l)};r([0,0]),e.onSelectionEnd(E)},[t]);return w.useEffect(()=>(document.addEventListener("mousemove",s),document.addEventListener("mouseup",c),()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",c)}),[s,c]),p.jsxs(p.Fragment,{children:[n?tn.createPortal(p.jsx("rect",{id:"selectRegion",fill:"#6666aaaa",stroke:"#000000",strokeWidth:.5,strokeDasharray:"5 5",x:Math.min(t[0],t[1]),y:0,width:Math.abs(t[1]-t[0]),height:e.height}),document.getElementById("browserSVG")):null,p.jsx("rect",{fill:"#ffffff",width:e.width-e.leftMargin,height:e.dragRegionHeight,x:e.leftMargin,y:0,onMouseDown:o})]})};function my({width:e,innerWidth:t,height:r,svgRef:n,children:i}){return p.jsx("svg",{id:"browserSVG",width:e,viewBox:`0 0 ${t} ${r}`,ref:n,children:i})}function by({children:e,browserState:t,rulerHeight:r}){const[n,i]=w.useState([]);return w.useEffect(()=>{let a=r;const o=t.tracks.map(s=>{const c=a;return a+=s.actualHeight??s.height??0,c});i(o)},[t.tracks]),p.jsx(p.Fragment,{children:n.length>0&&w.Children.map(e,(a,o)=>{const s=a.props,c=n[o];return p.jsx("g",{id:`stacked-track-${s.track.id}`,transform:typeof c=="number"?`translate(0, ${c})`:void 0,children:a},o)})})}const Vl=_t`
|
|
199
199
|
query BigRequests($bigRequests: [BigRequest!]!) {
|
|
200
200
|
bigRequests(requests: $bigRequests) {
|
|
201
201
|
data
|
|
@@ -205,7 +205,7 @@ query LD($assembly: String!, $snpids: [String!]) {
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,Ey=_t` query occurrences($prange: [ChromosomeRangeInput]!, $range: [GenomicRegionInput!],$peaks_accession: String, $consensus_regex: String, $limit: Int, $offset: Int, $assembly: String!) {
|
|
209
209
|
meme_occurrences(genomic_region: $range, peaks_accession: $peaks_accession, consensus_regex: $consensus_regex, limit: $limit, offset: $offset) {
|
|
210
210
|
motif {
|
|
211
211
|
pwm
|
|
@@ -280,7 +280,7 @@ query Gene($coordinates: GenomicRangeInput, $assembly: String!) {
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
`;const
|
|
283
|
+
`;const wy=_t`
|
|
284
284
|
query Gene($chromosome: String, $assembly: String!, $start: Int, $end: Int, $version: Int) {
|
|
285
285
|
gene(assembly: $assembly, chromosome: $chromosome, start: $start, end: $end, version: $version) {
|
|
286
286
|
strand
|
|
@@ -308,7 +308,7 @@ query Gene($chromosome: String, $assembly: String!, $start: Int, $end: Int, $ver
|
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
`;function
|
|
311
|
+
`;function xy({browserState:e,browserDispatch:t}){const[r,n]=w.useState(),[i,a]=w.useState(),[o,s]=w.useState(),[c,u]=w.useState(),[l,d]=w.useState(),[f,{data:v,loading:E,error:x}]=_n(Vl),[T,{data:O,loading:_,error:m}]=_n(Ey),[C,{data:S,loading:P,error:A}]=_n(wy),[j,{data:U,loading:V,error:me}]=_n(Vl),[Le,{data:ye,loading:Se,error:Ve}]=_n(_t(Cv)),{setDelta:Pe}=w.useContext(ua);return w.useEffect(()=>{n(e.tracks.filter(R=>R.trackType===J.BIGWIG||R.trackType===J.BIGBED).map(R=>({url:R.url||"",chr1:e.domain.chromosome||"chr11",start:e.domain.start,end:e.domain.end,preRenderedWidth:e.preRenderedWidth,zoomLevel:e.zoomLevel})));const Y=e.tracks.find(R=>R.trackType===J.TRANSCRIPT);Y?(t({type:ue.UPDATE_TRACK,id:Y.id,track:{refetch:C}}),a({chromosome:e.domain.chromosome||"chr11",assembly:Y.assembly,start:e.domain.start,end:e.domain.end,version:Y.version})):a(void 0);const $=e.tracks.find(R=>R.trackType===J.MOTIF);$&&s({range:{chromosome:e.domain.chromosome||"chr11",start:e.domain.start,end:e.domain.end},prange:{chrom:e.domain.chromosome||"chr11",chrom_start:e.domain.start,chrom_end:e.domain.end},assembly:$.assembly,consensus_regex:$.consensusRegex,peaks_accession:$.peaksAccession});const Z=e.tracks.find(R=>R.trackType===J.IMPORTANCE);if(Z){const R=[];R.push({url:Z.url||"",chr1:e.domain.chromosome||"chr11",start:e.domain.start,end:e.domain.end}),R.push({url:Z.signalURL,chr1:e.domain.chromosome||"chr11",start:e.domain.start,end:e.domain.end}),u(R)}const N=e.tracks.find(R=>R.trackType===J.LDTRACK);N&&d({assembly:N.assembly,coordinates:{chromosome:e.domain.chromosome||"chr11",start:e.domain.start,end:e.domain.end}})},[e.tracks.length,e.domain,e.preRenderedWidth,e.zoomLevel]),w.useEffect(()=>{r&&f({variables:{bigRequests:r}})},[r]),w.useEffect(()=>{i&&C({variables:i})},[i]),w.useEffect(()=>{o&&T({variables:o})},[o]),w.useEffect(()=>{c&&j({variables:{bigRequests:c}})},[c]),w.useEffect(()=>{l&&Le({variables:l})},[l]),w.useEffect(()=>{if(E||P||_||V||Se)return;let Y=0;e.tracks.forEach($=>{if($.trackType===J.BIGWIG||$.trackType===J.BIGBED){if(x)t({type:ue.UPDATE_TRACK,id:$.id,track:{error:x.message||""}});else if(v){if(v.bigRequests.length===0)return;t({type:ue.UPDATE_TRACK,id:$.id,track:{data:v.bigRequests[Y++].data}})}}else if($.trackType===J.TRANSCRIPT)A?t({type:ue.UPDATE_TRACK,id:$.id,track:{error:A.message||""}}):S&&t({type:ue.UPDATE_TRACK,id:$.id,track:{data:S.gene}});else if($.trackType===J.MOTIF){if(m)t({type:ue.UPDATE_TRACK,id:$.id,track:{error:m.message||""}});else if(O){const Z=O.peaks.peaks.map(R=>({start:R.chrom_start,end:R.chrom_end})),N=O.meme_occurrences.map(R=>({start:R.genomic_region.start,end:R.genomic_region.end,pwm:R.motif.pwm}));t({type:ue.UPDATE_TRACK,id:$.id,track:{data:N,peaks:Z}})}}else if($.trackType===J.IMPORTANCE){if(me)t({type:ue.UPDATE_TRACK,id:$.id,track:{error:me.message||""}});else if(U){const Z=U.bigRequests[0].data[0],N=U.bigRequests[1].data.map(K=>K.value),R={sequence:Z,importance:N};t({type:ue.UPDATE_TRACK,id:$.id,track:{data:R}})}}else if($.trackType===J.LDTRACK){if(Ve)t({type:ue.UPDATE_TRACK,id:$.id,track:{error:Ve.message||""}});else if(ye){const Z=ye.snpQuery.filter(N=>N.coordinates).map(N=>({...N,domain:N.coordinates}));t({type:ue.UPDATE_TRACK,id:$.id,track:{data:{snps:Z,ld:[]}}})}}}),Pe(0)},[v,S,O,U,x,A,m,me,ye,Ve]),null}function Sy({domain:e,color:t}){const r=w.useContext(vr);if(e.chromosome&&r.domain.chromosome!=e.chromosome)return null;const[n,i]=w.useState(e.chromosome==null||e.chromosome==""?{start:e.start,end:e.end}:ql(e,r));return w.useEffect(()=>{r.delta==0&&i(e.chromosome==null||e.chromosome==""?{start:e.start,end:e.end}:ql(e,r))},[r.domain,r.delta==0]),p.jsx(Dt,{canDrag:!0,children:p.jsx("rect",{x:n.start-(e.chromosome?0:150),width:n.end-n.start,height:r.height-r.menuHeight,fill:t,fillOpacity:.2,style:{pointerEvents:"none"}})})}function ql(e,t){const r=(e.start-t.domain.start)/(t.domain.end-t.domain.start)*t.preRenderedWidth,n=(e.end-t.domain.start)/(t.domain.end-t.domain.start)*t.preRenderedWidth;return{start:r,end:n}}function Oy({children:e,width:t,browserState:r,browserDispatch:n}){const i=w.useRef(null),[a,o]=w.useState(0),s=Pv(),c=80,u=100,l=E=>{v(1),n({type:ue.SET_LOADING}),n({type:ue.SET_DOMAIN,domain:E}),v(0)},d=(E,x)=>{n({type:ue.UPDATE_TRACK,id:E,track:{displayMode:x}}),x===Ae.HIDE&&n({type:ue.DELETE_TRACK,id:E})};Iv(()=>{const E=r.tracks.reduce((x,T)=>x+(T.actualHeight??T.height),0);o(E)},[r.tracks,r.tracks.length]),r.height=c+a+u,r.menuHeight=u,r.marginSize=r.width<1e3?r.width/8:150;const f=w.useRef(!1);w.useEffect(()=>{var x;if(f.current)return;f.current=!0;const E=(x=w.Children.map(e,T=>w.isValidElement(T)?T.props:null))==null?void 0:x.filter(Boolean);E==null||E.forEach(T=>{n({type:ue.ADD_TRACK,track:T}),n({type:ue.BRING_TO_TOP,id:T.id})})},[e,n]);const v=E=>{n({type:ue.SET_DELTA,delta:E})};return p.jsxs(Fd,{browserState:r,browserDispatch:n,modalState:s,deltaContext:{delta:r.delta,setDelta:v},children:[p.jsx(my,{innerWidth:r.width,width:t,height:r.height,svgRef:i,children:p.jsxs(vy,{onModeChange:d,children:[p.jsx(yy,{width:r.width,height:r.height-c,dragRegionHeight:c,leftMargin:r.marginSize,domain:r.domain,onSelectionEnd:E=>l(E)}),p.jsx(fy,{canDrag:r.delta!=0,width:r.width,height:c,title:"scale",id:"ruler",domain:r.domain,titleSize:12,trackMargin:12}),p.jsx(xy,{browserState:r,browserDispatch:n}),p.jsx(by,{browserState:r,rulerHeight:c,children:r.tracks.map(E=>p.jsx(Ty,{track:E,svgRef:i,browserState:r},E.id+E.height))}),p.jsx("svg",{id:"gb-highlights",x:r.marginSize,x2:r.width,y:0,height:r.height-r.menuHeight,viewBox:`0 0 1500 ${r.height-r.menuHeight}`,children:r.highlights.map(E=>p.jsx(Sy,{domain:E.domain,color:E.color},`${E.domain.end}-${E.domain.start}`))})]})}),s.openModal&&p.jsx(sy,{})]})}function Ty({track:e,browserState:t,svgRef:r}){return w.useMemo(()=>{const a=(e.props||{}).transform;if(e.displayMode===Ae.HIDE)return null;const{width:o,domain:s}=t;return p.jsx("g",{id:"swap-track-"+e.id,transform:a,children:(()=>{switch(e.trackType){case J.BIGWIG:return p.jsx(Ns,{svgRef:r,...Ps,width:o,domain:s,...e,...e.props,data:e.data});case J.BIGBED:return p.jsx(js,{svgRef:r,...Rs,width:o,domain:s,...e,...e.props,data:e.data});case J.TRANSCRIPT:return p.jsx($s,{svgRef:r,...qs,width:o,domain:s,...e,...e.props,data:e.data});case J.IMPORTANCE:return p.jsx(zs,{svgRef:r,...Hs,width:o,domain:s,...e,...e.props,data:e.data});case J.MOTIF:return p.jsx(Ys,{svgRef:r,...Gs,width:o,domain:s,...e,...e.props,data:e.data});case J.LDTRACK:return p.jsx(Tl,{svgRef:r,...Ol,...e,width:o,domain:s,...e.props,data:e.data});default:return null}})()})},[e,e.props,t,r])}const Cy=new sl({uri:"https://ga.staging.wenglab.org/graphql",cache:new el,connectToDevTools:!0});function _y({children:e}){return p.jsx(ov,{client:Cy,children:e})}const ky=new Map([["stalk",e=>e.stalk],["gvar",e=>e.default],["gneg",e=>Zn(e.default,.9)]]),Dy=e=>{var r;const t=e.type.slice(0,4)==="gpos"?Zn(e.colors.default,1-+e.type.replace(/gpos/g,"")/100):(r=ky.get(e.type))==null?void 0:r.call(null,e.colors);return t===void 0?null:p.jsx("rect",{width:e.width,height:e.height*.8,y:e.height*.1,x:e.x,fill:t,fillOpacity:e.opacity})};function My(e,t,r,n){return n?`M ${e} ${r*.1} L ${e+t} ${r/2} L ${e} ${r*.9}`:`M ${e+t} ${r*.1} L ${e} ${r/2} L ${e+t} ${r*.9}`}const Ly=e=>p.jsx("path",{d:My(e.x,e.width,e.height,e.opening),fill:e.color}),Iy=({highlight:e,height:t,x:r})=>{const n=`M ${r(e.start)-5} 0 L ${r(e.start)} ${t*.2} L ${r(e.start)+5} 0`,i=`M ${r(e.start)-5} ${t} L ${r(e.start)} ${t*.8} L ${r(e.start)+5} ${t}`;return p.jsxs(p.Fragment,{children:[p.jsx("path",{d:n,stroke:e.color||"#ff0000",strokeWidth:3,fill:"none"}),p.jsx("path",{d:i,stroke:e.color||"#ff0000",strokeWidth:3,fill:"none"})]})},$l=e=>e.x(e.highlight.end)-e.x(e.highlight.start)<10?p.jsx(Iy,{highlight:e.highlight,x:e.x,height:e.height}):p.jsx("rect",{x:e.x(e.highlight.start),y:0,width:e.x(e.highlight.end)-e.x(e.highlight.start),height:e.height,fill:e.highlight.color||"#ff000088",onMouseOver:e.onMouseOver,onMouseOut:e.onMouseOut,onClick:e.onClick}),Py={default:"#000000",centromere:"#880000",stalk:"#ff0000"},Ny=e=>{const t=e.colors||Py,r=e.domain||{start:0,end:Math.max(...e.data.map(a=>a.coordinates.end))},n=Ct(r,e.width);let i=0;return p.jsxs("g",{width:e.width,height:e.height,transform:e.transform,children:[e.data.map((a,o)=>{const s=n(a.coordinates.start),c=n(a.coordinates.end)-s;return a.stain==="acen"?p.jsx(Ly,{width:c,x:s,height:e.height,color:t.centromere,opening:i++===0},o):p.jsx(Dy,{type:a.stain,width:c,x:s,height:e.height,colors:t,opacity:e.opacity},o)}),e.highlight?p.jsx($l,{onMouseOut:e.onHighlightMouseOut,onMouseOver:()=>e.onHighlightMouseOver&&e.onHighlightMouseOver(e.highlight,n((e.highlight.start+e.highlight.end)/2),0),onClick:()=>e.onHighlightClick&&e.onHighlightClick(e.highlight,n((e.highlight.start+e.highlight.end)/2),0),highlight:e.highlight,x:n,height:e.height,width:e.width}):null,e.highlights?e.highlights.map((a,o)=>p.jsx($l,{onMouseOut:e.onHighlightMouseOut,onMouseOver:()=>e.onHighlightMouseOver&&e.onHighlightMouseOver(a,n((a.start+a.end)/2),o),highlight:a,x:n,height:e.height,width:e.width,onClick:()=>e.onHighlightClick&&e.onHighlightClick(a,n((a.start+a.end)/2),o)})):null,e.children]})},Ay=_t`
|
|
312
312
|
query cytobands($assembly: String!, $chromosome: String) {
|
|
313
313
|
cytoband(assembly: $assembly, chromosome: $chromosome) {
|
|
314
314
|
stain
|
|
@@ -319,5 +319,5 @@ query Gene($chromosome: String, $assembly: String!, $start: Int, $end: Int, $ver
|
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
`;function
|
|
322
|
+
`;function Fy({assembly:e,currentDomain:t}){const{data:r,loading:n,error:i}=ml(Ay,{variables:{assembly:e,chromosome:t.chromosome||""}});if(n)return p.jsx("g",{width:700,height:20,children:p.jsx("text",{x:"350",y:"15",textAnchor:"middle",style:{fontSize:"14px",fontFamily:"sans-serif"},children:"Loading..."})});if(i)return p.jsx("g",{width:700,height:20,children:p.jsxs("text",{x:"350",y:"15",textAnchor:"middle",style:{fontSize:"14px",fontFamily:"sans-serif"},children:["Error: ",i.message]})});const a={...t,color:"rgba(50,50,255,0.75)"};return p.jsx(Ny,{data:r.cytoband,width:700,height:20,id:"cytobands",highlight:a})}function Wr({text:e,shift:t,dispatch:r,style:n,buttonComponent:i}){return i?w.cloneElement(i,{value:e,style:n,type:"button",children:e,onClick:()=>{r({type:ue.SET_LOADING}),r({type:ue.SLIDE_DOMAIN,delta:Math.floor(t)})}}):p.jsx(p.Fragment,{children:p.jsx("button",{className:"shift-button",type:"button",value:e,onClick:()=>{r({type:ue.SET_LOADING}),r({type:ue.SLIDE_DOMAIN,delta:Math.floor(t)})},style:n,children:e})})}const Gr=({text:e,factor:t,dispatch:r,style:n,buttonComponent:i})=>i?w.cloneElement(i,{value:e,style:n,type:"button",children:e,onClick:()=>{r({type:ue.SET_LOADING}),r({type:ue.ZOOM_DOMAIN,factor:t})}}):p.jsx("button",{className:"zoom-button",style:n,value:e,onClick:()=>{r({type:ue.SET_LOADING}),r({type:ue.ZOOM_DOMAIN,factor:t})},children:e});function Ry({domain:e,size:t,dispatch:r,style:n,inputComponent:i,inputButtonComponent:a}){const o="GRCh38",s=e.chromosome+":"+e.start+"-"+e.end,c=Ul(o,s),[u,l]=w.useState(s),[d,f]=w.useState(c),v=w.useCallback(T=>{l(T.target.value),f(Ul(o,T.target.value))},[u]),E=w.useCallback(()=>{if(!d){const T=document.getElementById("region-input-gbc");T==null||T.setCustomValidity("Invalid input"),T==null||T.reportValidity();return}r({type:ue.SET_DOMAIN,domain:{start:d.start,end:d.end,chromosome:"chr"+d.chromosome}})},[d]),x=T=>{T.key==="Tab"&&T.currentTarget.value===""&&c&&(T.preventDefault(),T.currentTarget.value=s,v({target:{value:s}}))};return i&&a?p.jsxs("form",{onSubmit:E,style:{display:"flex",flexDirection:"row"},children:[w.cloneElement(i,{onChange:v,onKeyDown:x,placeholder:s}),w.cloneElement(a,{onClick:E})]}):p.jsxs("div",{style:{display:"flex",flexDirection:"row",...n},children:[p.jsx("input",{id:"region-input-gbc",placeholder:s,type:"text",size:t,value:u,onChange:v,style:{outline:"none",border:d?"2px solid #000":"2px solid red",borderRadius:"4px"},onKeyDown:x}),p.jsx("input",{type:"button",onClick:E,value:"Go",style:{outline:"none"}})]})}const Ul=(e,t)=>{var i;const r=/^chr(\d+|X|Y):[0-9,]*-[0-9,]*$/;if(t.includes(" ")){const a=t.split(" "),o=a[0],s=a[1].replace(/,/g,""),c=a[2].replace(/,/g,"");t=`${o}:${s}-${c}`}const n=t.match(/^chr(\d+|X|Y):/);if(r.test(t)){const a=n?n[1]:null,o=(i=t.split(":")[1])==null?void 0:i.split("-"),s=o!=null&&o[0]?parseInt(o[0].replace(/,/g,"")):null,c=o!=null&&o[1]?parseInt(o[1].replace(/,/g,"")):null;if(a&&s!==null&&c!==null&&a in Bl[e]&&s<c&&s>0&&c<=Bl[e][a])return{chromosome:a,start:s,end:c}}return null},Bl={GRCh38:{1:248956422,2:242193529,3:198295559,4:190214555,5:181538259,6:170805979,7:159345973,8:145138636,9:138394717,10:133797422,11:135086622,12:133275309,13:114364328,14:107043718,15:101991189,16:90338345,17:83257441,18:80373285,19:58617616,20:64444167,21:46709983,22:50818468,X:156040895,Y:57227415},mm10:{1:195471971,2:182113224,3:160039680,4:156508116,5:151834684,6:149736546,7:145441459,8:129401213,9:124595110,10:130694993,11:122082543,12:120129022,13:120421639,14:124902244,15:104043685,16:98207768,17:94987271,18:90702639,19:61431566,X:171031299,Y:91744698}};function jy({buttonComponent:e,domain:t,dispatch:r}){return p.jsxs(p.Fragment,{children:[p.jsxs("div",{id:"gb-shift-left-buttons",style:{display:"flex",flexDirection:"column",alignItems:"center"},children:["Move Left",p.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[p.jsx(Wr,{buttonComponent:e,text:"◄◄◄",shift:t.start-t.end,dispatch:r}),p.jsx(Wr,{buttonComponent:e,text:"◄◄",shift:(t.start-t.end)/2,dispatch:r}),p.jsx(Wr,{buttonComponent:e,text:"◄",shift:(t.start-t.end)/4,dispatch:r})]})]}),p.jsx("div",{style:{width:10}}),p.jsxs("div",{id:"gb-shift-right-buttons",style:{display:"flex",flexDirection:"column",alignItems:"center"},children:["Move Right",p.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[p.jsx(Wr,{buttonComponent:e,text:"►",shift:(t.end-t.start)/4,dispatch:r}),p.jsx(Wr,{buttonComponent:e,text:"►►",shift:(t.end-t.start)/2,dispatch:r}),p.jsx(Wr,{buttonComponent:e,text:"►►►",shift:t.end-t.start,dispatch:r})]})]})]})}function Vy({buttonComponent:e,domain:t,dispatch:r}){return p.jsxs(p.Fragment,{children:[p.jsxs("div",{id:"gb-zoom-in-buttons",style:{display:"flex",flexDirection:"column",alignItems:"center"},children:["Zoom In",p.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[p.jsx(Gr,{buttonComponent:e,text:"+1.5x",factor:1/1.5,domain:t,dispatch:r}),p.jsx(Gr,{buttonComponent:e,text:"+3x",factor:1/3,domain:t,dispatch:r}),p.jsx(Gr,{buttonComponent:e,text:"+10x",factor:1/10,domain:t,dispatch:r})]})]}),p.jsx("div",{style:{width:10}}),p.jsxs("div",{id:"gb-zoom-out-buttons",style:{display:"flex",flexDirection:"column",alignItems:"center"},children:["Zoom Out",p.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[p.jsx(Gr,{buttonComponent:e,text:"-1.5x",factor:1.5,domain:t,dispatch:r}),p.jsx(Gr,{buttonComponent:e,text:"-3x",factor:3,domain:t,dispatch:r}),p.jsx(Gr,{buttonComponent:e,text:"-10x",factor:10,domain:t,dispatch:r})]})]})]})}function qy({buttonComponent:e,inputComponent:t,inputButtonComponent:r,domain:n,dispatch:i,withInput:a,style:o}){return p.jsxs("div",{id:"gb-controls",style:{display:"flex",flexDirection:"column",alignItems:"center",...o},children:[p.jsxs("div",{id:"gb-controls-buttons",style:{display:"flex",flexDirection:"row",justifyContent:"center"},children:[p.jsx(jy,{buttonComponent:e||void 0,domain:n,dispatch:i}),p.jsx("div",{style:{width:35}}),p.jsx(Vy,{buttonComponent:e||void 0,domain:n,dispatch:i}),p.jsx("div",{style:{width:35}}),a&&p.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end"},children:[t?null:"Set Region",p.jsx(Ry,{inputButtonComponent:r||void 0,inputComponent:t||void 0,size:20,domain:n,dispatch:i})]})]}),!a&&p.jsxs("div",{id:"gb-controls-region",style:{fontSize:12},children:[n.chromosome,":",n.start,"-",n.end]})]})}xe.Bam=wh,xe.BigBed=js,xe.BigBedTrack=Id,xe.BigWig=Ns,xe.BigWigTrack=Ld,xe.BrowserActionType=ue,xe.Controls=qy,xe.DefaultBam=Eh,xe.DefaultBigBed=Rs,xe.DefaultBigWig=Ps,xe.DefaultImportance=Hs,xe.DefaultLD=Ol,xe.DefaultMotif=Gs,xe.DefaultTranscript=qs,xe.DisplayMode=Ae,xe.GQLCytobands=Fy,xe.GQLWrapper=_y,xe.GenomeBrowser=Oy,xe.Importance=zs,xe.LD=Tl,xe.Motif=Ys,xe.TrackType=J,xe.Transcript=$s,xe.TranscriptHumanVersion=Jn,xe.TranscriptMouseVersion=ca,xe.TranscriptTrack=Pd,xe.useBrowserState=kv,Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"})});
|
|
323
323
|
//# sourceMappingURL=gbc.umd.js.map
|