@machinemetrics/mm-react-tools 3.0.1-beta → 3.0.2-beta

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.
@@ -22132,7 +22132,7 @@ function WD() {
22132
22132
  })(td, td.exports);
22133
22133
  var zD = td.exports;
22134
22134
  const Zc = Fs.createContext(), T_ = Fs.createContext(), HD = () => {
22135
- const { urls: r } = fi(), { children: e } = Aa(Zc), t = ek(), [n, i] = Zt(!1), a = !!window.parent;
22135
+ const { urls: r } = fi(), { children: e } = Aa(Zc), t = ek(), [n, i] = Zt(!1), a = window.parent !== window.self;
22136
22136
  tk(({ nextLocation: f }) => {
22137
22137
  var h;
22138
22138
  return a ? (h = f.state) != null && h.fromParent ? (i(!0), !1) : (u(`${f.pathname}${f.search}`), !0) : !1;
@@ -128,7 +128,7 @@ function print() { __p += __j.call(arguments, '') }
128
128
  `;A(X)},[y,m,h]),ve.useEffect(()=>{S&&P()},[S,w]);const[P,{data:F,loading:L}]=AO(S,{fetchPolicy:"no-cache"});return ve.useEffect(()=>{if(!F||!F.quantities)return;const $=bi.last(F.quantities);if($&&d($.eventTime),!n)i(F.quantities);else{const X=bi.drop(F.quantities);i([...n,...X])}},[F]),{data:n,error:c,loading:a}},CT=r=>{const[e,t]=ve.useState(),[n,i]=ve.useState(!0),[a,u]=ve.useState(),{urls:c,request:f}=Xn();return yo(async h=>{try{const d=await f(`${c.apiUrl}/reports/downtime`,{method:"POST",body:r,signal:h});t(d)}catch(d){u(d)}i(!1)},[r]),{data:e,error:a,loading:n}},NT=r=>{const[e,t]=ve.useState(),{urls:n,request:i,clientId:a}=Xn(),u=`lab:${a}:${r}`,{data:c,loading:f,error:h}=Pv("/templates");return ve.useEffect(()=>{if(!c)return;const m=bi.filter(c.templates,{namespace:u});t(m)},[c]),[async({name:m,public:x,config:T})=>{const w={name:m,public:x,namespace:u,config:JSON.stringify(T)},S=JSON.stringify(w),A=await i(`${n.apiUrl}/templates`,{method:"POST",body:S});return t([...e,A.template]),A.template},async(m,{name:x,public:T,config:w})=>{const S={name:x,public:T,namespace:u,config:JSON.stringify(w)},A=JSON.stringify(S),P=await i(`${n.apiUrl}/templates/${m}`,{method:"PUT",body:A}),F=bi.findIndex(e,{id:m}),L=e.slice(0,F),$=e.slice(F+1);return t([...L,P.template,...$]),P.template},async m=>{await i(`${n.apiUrl}/templates/${m}`,{method:"DELETE"}),t(bi.reject(e,{id:m}))},{templates:e,loading:f,error:h}]},RT=()=>{const[r,e]=ve.useState(),[t,n]=ve.useState(),{urls:i}=Xn();return ve.useEffect(()=>{window===window.top?(n(window.location.hash.substring(1)),e(!0)):(window.addEventListener("message",a=>{switch(a.data.event){case"init":n(a.data.hash.substring(1)),e(!0);break}}),window.top.postMessage({event:"ready"},i.appUrl))},[i]),ve.useEffect(()=>{r&&(window===window.top?window.location.hash=t:window.top.postMessage({event:"set-hash",hash:t},i.appUrl))},[r,t,i]),[n,{ready:r,hash:t}]},Xn=()=>ve.useContext(Iv),DT=()=>ve.useContext(kv),FT=()=>{const{login:r,isAuthenticated:e}=Xn();return yo(async()=>{e===!1&&await r()},[e]),e?Mr.jsx(Hn.Outlet,{}):Mr.jsx("div",{})},Cv="%[a-f0-9]{2}",Nv=new RegExp("("+Cv+")|([^%]+?)","gi"),Rv=new RegExp("("+Cv+")+","gi");function Qf(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;const t=r.slice(0,e),n=r.slice(e);return Array.prototype.concat.call([],Qf(t),Qf(n))}function MT(r){try{return decodeURIComponent(r)}catch{let e=r.match(Nv)||[];for(let t=1;t<e.length;t++)r=Qf(e,t).join(""),e=r.match(Nv)||[];return r}}function LT(r){const e={"%FE%FF":"��","%FF%FE":"��"};let t=Rv.exec(r);for(;t;){try{e[t[0]]=decodeURIComponent(t[0])}catch{const i=MT(t[0]);i!==t[0]&&(e[t[0]]=i)}t=Rv.exec(r)}e["%C2"]="�";const n=Object.keys(e);for(const i of n)r=r.replace(new RegExp(i,"g"),e[i]);return r}function qT(r){if(typeof r!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return decodeURIComponent(r)}catch{return LT(r)}}function Dv(r,e){if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(r===""||e==="")return[];const t=r.indexOf(e);return t===-1?[]:[r.slice(0,t),r.slice(t+e.length)]}function jT(r,e){const t={};if(Array.isArray(e))for(const n of e){const i=Object.getOwnPropertyDescriptor(r,n);i!=null&&i.enumerable&&Object.defineProperty(t,n,i)}else for(const n of Reflect.ownKeys(r)){const i=Object.getOwnPropertyDescriptor(r,n);if(i.enumerable){const a=r[n];e(n,a,r)&&Object.defineProperty(t,n,i)}}return t}const UT=r=>r==null,$T=r=>encodeURIComponent(r).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Gf=Symbol("encodeFragmentIdentifier");function BT(r){switch(r.arrayFormat){case"index":return e=>(t,n)=>{const i=t.length;return n===void 0||r.skipNull&&n===null||r.skipEmptyString&&n===""?t:n===null?[...t,[wr(e,r),"[",i,"]"].join("")]:[...t,[wr(e,r),"[",wr(i,r),"]=",wr(n,r)].join("")]};case"bracket":return e=>(t,n)=>n===void 0||r.skipNull&&n===null||r.skipEmptyString&&n===""?t:n===null?[...t,[wr(e,r),"[]"].join("")]:[...t,[wr(e,r),"[]=",wr(n,r)].join("")];case"colon-list-separator":return e=>(t,n)=>n===void 0||r.skipNull&&n===null||r.skipEmptyString&&n===""?t:n===null?[...t,[wr(e,r),":list="].join("")]:[...t,[wr(e,r),":list=",wr(n,r)].join("")];case"comma":case"separator":case"bracket-separator":{const e=r.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(n,i)=>i===void 0||r.skipNull&&i===null||r.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[wr(t,r),e,wr(i,r)].join("")]:[[n,wr(i,r)].join(r.arrayFormatSeparator)])}default:return e=>(t,n)=>n===void 0||r.skipNull&&n===null||r.skipEmptyString&&n===""?t:n===null?[...t,wr(e,r)]:[...t,[wr(e,r),"=",wr(n,r)].join("")]}}function VT(r){let e;switch(r.arrayFormat){case"index":return(t,n,i)=>{if(e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!e){i[t]=n;return}i[t]===void 0&&(i[t]={}),i[t][e[1]]=n};case"bracket":return(t,n,i)=>{if(e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!e){i[t]=n;return}if(i[t]===void 0){i[t]=[n];return}i[t]=[...i[t],n]};case"colon-list-separator":return(t,n,i)=>{if(e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!e){i[t]=n;return}if(i[t]===void 0){i[t]=[n];return}i[t]=[...i[t],n]};case"comma":case"separator":return(t,n,i)=>{const a=typeof n=="string"&&n.includes(r.arrayFormatSeparator),u=typeof n=="string"&&!a&&wi(n,r).includes(r.arrayFormatSeparator);n=u?wi(n,r):n;const c=a||u?n.split(r.arrayFormatSeparator).map(f=>wi(f,r)):n===null?n:wi(n,r);i[t]=c};case"bracket-separator":return(t,n,i)=>{const a=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!a){i[t]=n&&wi(n,r);return}const u=n===null?[]:n.split(r.arrayFormatSeparator).map(c=>wi(c,r));if(i[t]===void 0){i[t]=u;return}i[t]=[...i[t],...u]};default:return(t,n,i)=>{if(i[t]===void 0){i[t]=n;return}i[t]=[...[i[t]].flat(),n]}}}function Fv(r){if(typeof r!="string"||r.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function wr(r,e){return e.encode?e.strict?$T(r):encodeURIComponent(r):r}function wi(r,e){return e.decode?qT(r):r}function Mv(r){return Array.isArray(r)?r.sort():typeof r=="object"?Mv(Object.keys(r)).sort((e,t)=>Number(e)-Number(t)).map(e=>r[e]):r}function Lv(r){const e=r.indexOf("#");return e!==-1&&(r=r.slice(0,e)),r}function WT(r){let e="";const t=r.indexOf("#");return t!==-1&&(e=r.slice(t)),e}function qv(r,e){return e.parseNumbers&&!Number.isNaN(Number(r))&&typeof r=="string"&&r.trim()!==""?r=Number(r):e.parseBooleans&&r!==null&&(r.toLowerCase()==="true"||r.toLowerCase()==="false")&&(r=r.toLowerCase()==="true"),r}function Jf(r){r=Lv(r);const e=r.indexOf("?");return e===-1?"":r.slice(e+1)}function Yf(r,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e},Fv(e.arrayFormatSeparator);const t=VT(e),n=Object.create(null);if(typeof r!="string"||(r=r.trim().replace(/^[?#&]/,""),!r))return n;for(const i of r.split("&")){if(i==="")continue;const a=e.decode?i.replaceAll("+"," "):i;let[u,c]=Dv(a,"=");u===void 0&&(u=a),c=c===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?c:wi(c,e),t(wi(u,e),c,n)}for(const[i,a]of Object.entries(n))if(typeof a=="object"&&a!==null)for(const[u,c]of Object.entries(a))a[u]=qv(c,e);else n[i]=qv(a,e);return e.sort===!1?n:(e.sort===!0?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((i,a)=>{const u=n[a];return i[a]=u&&typeof u=="object"&&!Array.isArray(u)?Mv(u):u,i},Object.create(null))}function jv(r,e){if(!r)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},Fv(e.arrayFormatSeparator);const t=u=>e.skipNull&&UT(r[u])||e.skipEmptyString&&r[u]==="",n=BT(e),i={};for(const[u,c]of Object.entries(r))t(u)||(i[u]=c);const a=Object.keys(i);return e.sort!==!1&&a.sort(e.sort),a.map(u=>{const c=r[u];return c===void 0?"":c===null?wr(u,e):Array.isArray(c)?c.length===0&&e.arrayFormat==="bracket-separator"?wr(u,e)+"[]":c.reduce(n(u),[]).join("&"):wr(u,e)+"="+wr(c,e)}).filter(u=>u.length>0).join("&")}function Uv(r,e){var i;e={decode:!0,...e};let[t,n]=Dv(r,"#");return t===void 0&&(t=r),{url:((i=t==null?void 0:t.split("?"))==null?void 0:i[0])??"",query:Yf(Jf(r),e),...e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:wi(n,e)}:{}}}function $v(r,e){e={encode:!0,strict:!0,[Gf]:!0,...e};const t=Lv(r.url).split("?")[0]||"",n=Jf(r.url),i={...Yf(n,{sort:!1}),...r.query};let a=jv(i,e);a&&(a=`?${a}`);let u=WT(r.url);if(typeof r.fragmentIdentifier=="string"){const c=new URL(t);c.hash=r.fragmentIdentifier,u=e[Gf]?c.hash:`#${r.fragmentIdentifier}`}return`${t}${a}${u}`}function Bv(r,e,t){t={parseFragmentIdentifier:!0,[Gf]:!1,...t};const{url:n,query:i,fragmentIdentifier:a}=Uv(r,t);return $v({url:n,query:jT(i,e),fragmentIdentifier:a},t)}function zT(r,e,t){const n=Array.isArray(e)?i=>!e.includes(i):(i,a)=>!e(i,a);return Bv(r,n,t)}const HT=Object.freeze(Object.defineProperty({__proto__:null,exclude:zT,extract:Jf,parse:Yf,parseUrl:Uv,pick:Bv,stringify:jv,stringifyUrl:$v},Symbol.toStringTag,{value:"Module"}));for(var jr=[],Kf=0;Kf<256;++Kf)jr.push((Kf+256).toString(16).slice(1));function QT(r,e=0){return(jr[r[e+0]]+jr[r[e+1]]+jr[r[e+2]]+jr[r[e+3]]+"-"+jr[r[e+4]]+jr[r[e+5]]+"-"+jr[r[e+6]]+jr[r[e+7]]+"-"+jr[r[e+8]]+jr[r[e+9]]+"-"+jr[r[e+10]]+jr[r[e+11]]+jr[r[e+12]]+jr[r[e+13]]+jr[r[e+14]]+jr[r[e+15]]).toLowerCase()}var Gu,GT=new Uint8Array(16);function JT(){if(!Gu&&(Gu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Gu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gu(GT)}var YT=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Vv={randomUUID:YT};function KT(r,e,t){if(Vv.randomUUID&&!e&&!r)return Vv.randomUUID();r=r||{};var n=r.random||(r.rng||JT)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,QT(n)}const Zf="mm-auth-state",Xf="mm-auth-destination",eh="mm-auth-access-token",_i=window.localStorage,ZT=()=>_i.getItem(eh),XT=r=>{r?_i.setItem(eh,r):_i.removeItem(eh)},eA=()=>_i.getItem(Xf),Wv=r=>{r?_i.setItem(Xf,r):_i.removeItem(Xf)},tA=()=>_i.getItem(Zf),zv=r=>{r?_i.setItem(Zf,r):_i.removeItem(Zf)},Hv=async(r,e)=>{const t=await window.fetch(r,e),n=await t.text(),i=n&&JSON.parse(n);return t.status>=200&&t.status<300?i:{...i,error:{message:t.statusText,status:t.status}}};function rA(r){return Kt(r)&&"code"in r&&"reason"in r}function nA(r){var e;return Kt(r)&&((e=r.target)===null||e===void 0?void 0:e.readyState)===WebSocket.CLOSED}var iA=function(r){kn(e,r);function e(t){var n=r.call(this)||this;return n.client=t,n}return e.prototype.request=function(t){var n=this;return new Ct(function(i){return n.client.subscribe(j(j({},t),{query:Hs(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){if(a instanceof Error)return i.error(a);var u=rA(a);return u||nA(a)?i.error(new Error("Socket closed".concat(u?" with event ".concat(a.code):"").concat(u?" ".concat(a.reason):""))):i.error(new oi({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(Jr);function an(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function ks(r){return an(r)==="object"}function sA(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function Qv(r,e){return r.length<124?r:e}const aA="graphql-transport-ws";var gn;(function(r){r[r.InternalServerError=4500]="InternalServerError",r[r.InternalClientError=4005]="InternalClientError",r[r.BadRequest=4400]="BadRequest",r[r.BadResponse=4004]="BadResponse",r[r.Unauthorized=4401]="Unauthorized",r[r.Forbidden=4403]="Forbidden",r[r.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",r[r.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",r[r.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",r[r.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",r[r.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(gn||(gn={}));var pr;(function(r){r.ConnectionInit="connection_init",r.ConnectionAck="connection_ack",r.Ping="ping",r.Pong="pong",r.Subscribe="subscribe",r.Next="next",r.Error="error",r.Complete="complete"})(pr||(pr={}));function Gv(r){if(!ks(r))throw new Error(`Message is expected to be an object, but got ${an(r)}`);if(!r.type)throw new Error("Message is missing the 'type' property");if(typeof r.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${an(r.type)}`);switch(r.type){case pr.ConnectionInit:case pr.ConnectionAck:case pr.Ping:case pr.Pong:{if(r.payload!=null&&!ks(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${r.payload}"`);break}case pr.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${an(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!ks(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${an(r.payload)}`);if(typeof r.payload.query!="string")throw new Error(`"${r.type}" message payload expects the 'query' property to be a string, but got ${an(r.payload.query)}`);if(r.payload.variables!=null&&!ks(r.payload.variables))throw new Error(`"${r.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${an(r.payload.variables)}`);if(r.payload.operationName!=null&&an(r.payload.operationName)!=="string")throw new Error(`"${r.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${an(r.payload.operationName)}`);if(r.payload.extensions!=null&&!ks(r.payload.extensions))throw new Error(`"${r.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${an(r.payload.extensions)}`);break}case pr.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${an(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!ks(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${an(r.payload)}`);break}case pr.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${an(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!sA(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(r.payload)}`);break}case pr.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${an(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${r.type}"`)}return r}function oA(r,e){return Gv(typeof r=="string"?JSON.parse(r,e):r)}function vo(r,e){return Gv(r),JSON.stringify(r,e)}var ca=function(r){return this instanceof ca?(this.v=r,this):new ca(r)},uA=function(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},u("next"),u("throw"),u("return"),i[Symbol.asyncIterator]=function(){return this},i;function u(g){n[g]&&(i[g]=function(m){return new Promise(function(x,T){a.push([g,m,x,T])>1||c(g,m)})})}function c(g,m){try{f(n[g](m))}catch(x){y(a[0][3],x)}}function f(g){g.value instanceof ca?Promise.resolve(g.value.v).then(h,d):y(a[0][2],g)}function h(g){c("next",g)}function d(g){c("throw",g)}function y(g,m){g(m),a.shift(),a.length&&c(a[0][0],a[0][1])}};function cA(r){const{url:e,connectionParams:t,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:u=0,disablePong:c,connectionAckWaitTimeout:f=0,retryAttempts:h=5,retryWait:d=async function(Je){let ge=1e3;for(let ue=0;ue<Je;ue++)ge*=2;await new Promise(ue=>setTimeout(ue,ge+Math.floor(Math.random()*2700+300)))},shouldRetry:y=th,isFatalConnectionProblem:g,on:m,webSocketImpl:x,generateID:T=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Je=>{const ge=Math.random()*16|0;return(Je=="x"?ge:ge&3|8).toString(16)})},jsonMessageReplacer:w,jsonMessageReviver:S}=r;let A;if(x){if(!fA(x))throw new Error("Invalid WebSocket implementation provided");A=x}else typeof WebSocket<"u"?A=WebSocket:typeof global<"u"?A=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(A=window.WebSocket||window.MozWebSocket);if(!A)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const P=A,F=(()=>{const ye=(()=>{const ge={};return{on(ue,Ee){return ge[ue]=Ee,()=>{delete ge[ue]}},emit(ue){var Ee;"id"in ue&&((Ee=ge[ue.id])===null||Ee===void 0||Ee.call(ge,ue))}}})(),Je={connecting:m!=null&&m.connecting?[m.connecting]:[],opened:m!=null&&m.opened?[m.opened]:[],connected:m!=null&&m.connected?[m.connected]:[],ping:m!=null&&m.ping?[m.ping]:[],pong:m!=null&&m.pong?[m.pong]:[],message:m!=null&&m.message?[ye.emit,m.message]:[ye.emit],closed:m!=null&&m.closed?[m.closed]:[],error:m!=null&&m.error?[m.error]:[]};return{onMessage:ye.on,on(ge,ue){const Ee=Je[ge];return Ee.push(ue),()=>{Ee.splice(Ee.indexOf(ue),1)}},emit(ge,...ue){for(const Ee of[...Je[ge]])Ee(...ue)}}})();function L(ye){const Je=[F.on("error",ge=>{Je.forEach(ue=>ue()),ye(ge)}),F.on("closed",ge=>{Je.forEach(ue=>ue()),ye(ge)})]}let $,X=0,te,he=!1,de=0,Ve=!1;async function Ae(){clearTimeout(te);const[ye,Je]=await($??($=new Promise((Ee,Ne)=>(async()=>{if(he){if(await d(de),!X)return $=void 0,Ne({code:1e3,reason:"All Subscriptions Gone"});de++}F.emit("connecting",he);const xe=new P(typeof e=="function"?await e():e,aA);let Xe,Et;function lt(){isFinite(u)&&u>0&&(clearTimeout(Et),Et=setTimeout(()=>{xe.readyState===P.OPEN&&(xe.send(vo({type:pr.Ping})),F.emit("ping",!1,void 0))},u))}L(et=>{$=void 0,clearTimeout(Xe),clearTimeout(Et),Ne(et),et instanceof Jv&&(xe.close(4499,"Terminated"),xe.onerror=null,xe.onclose=null)}),xe.onerror=et=>F.emit("error",et),xe.onclose=et=>F.emit("closed",et),xe.onopen=async()=>{try{F.emit("opened",xe);const et=typeof t=="function"?await t():t;if(xe.readyState!==P.OPEN)return;xe.send(vo(et?{type:pr.ConnectionInit,payload:et}:{type:pr.ConnectionInit},w)),isFinite(f)&&f>0&&(Xe=setTimeout(()=>{xe.close(gn.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},f)),lt()}catch(et){F.emit("error",et),xe.close(gn.InternalClientError,Qv(et instanceof Error?et.message:new Error(et).message,"Internal client error"))}};let It=!1;xe.onmessage=({data:et})=>{try{const Ye=oA(et,S);if(F.emit("message",Ye),Ye.type==="ping"||Ye.type==="pong"){F.emit(Ye.type,!0,Ye.payload),Ye.type==="pong"?lt():c||(xe.send(vo(Ye.payload?{type:pr.Pong,payload:Ye.payload}:{type:pr.Pong})),F.emit("pong",!1,Ye.payload));return}if(It)return;if(Ye.type!==pr.ConnectionAck)throw new Error(`First message cannot be of type ${Ye.type}`);clearTimeout(Xe),It=!0,F.emit("connected",xe,Ye.payload,he),he=!1,de=0,Ee([xe,new Promise((dt,Re)=>L(Re))])}catch(Ye){xe.onmessage=null,F.emit("error",Ye),xe.close(gn.BadResponse,Qv(Ye instanceof Error?Ye.message:new Error(Ye).message,"Bad response"))}}})())));ye.readyState===P.CLOSING&&await Je;let ge=()=>{};const ue=new Promise(Ee=>ge=Ee);return[ye,ge,Promise.race([ue.then(()=>{if(!X){const Ee=()=>ye.close(1e3,"Normal Closure");isFinite(a)&&a>0?te=setTimeout(()=>{ye.readyState===P.OPEN&&Ee()},a):Ee()}}),Je])]}function je(ye){if(th(ye)&&(lA(ye.code)||[gn.InternalServerError,gn.InternalClientError,gn.BadRequest,gn.BadResponse,gn.Unauthorized,gn.SubprotocolNotAcceptable,gn.SubscriberAlreadyExists,gn.TooManyInitialisationRequests].includes(ye.code)))throw ye;if(Ve)return!1;if(th(ye)&&ye.code===1e3)return X>0;if(!h||de>=h||!y(ye)||g!=null&&g(ye))throw ye;return he=!0}n||(async()=>{for(X++;;)try{const[,,ye]=await Ae();await ye}catch(ye){try{if(!je(ye))return}catch(Je){return i==null?void 0:i(Je)}}})();function Ge(ye,Je){const ge=T(ye);let ue=!1,Ee=!1,Ne=()=>{X--,ue=!0};return(async()=>{for(X++;;)try{const[xe,Xe,Et]=await Ae();if(ue)return Xe();const lt=F.onMessage(ge,It=>{switch(It.type){case pr.Next:{Je.next(It.payload);return}case pr.Error:{Ee=!0,ue=!0,Je.error(It.payload),Ne();return}case pr.Complete:{ue=!0,Ne();return}}});xe.send(vo({id:ge,type:pr.Subscribe,payload:ye},w)),Ne=()=>{!ue&&xe.readyState===P.OPEN&&xe.send(vo({id:ge,type:pr.Complete},w)),X--,ue=!0,Xe()},await Et.finally(lt);return}catch(xe){if(!je(xe))return}})().then(()=>{Ee||Je.complete()}).catch(xe=>{Je.error(xe)}),()=>{ue||Ne()}}return{on:F.on,subscribe:Ge,iterate(ye){const Je=[],ge={done:!1,error:null,resolve:()=>{}},ue=Ge(ye,{next(Ne){Je.push(Ne),ge.resolve()},error(Ne){ge.done=!0,ge.error=Ne,ge.resolve()},complete(){ge.done=!0,ge.resolve()}}),Ee=function(){return uA(this,arguments,function*(){for(;;){for(Je.length||(yield ca(new Promise(Xe=>ge.resolve=Xe)));Je.length;)yield yield ca(Je.shift());if(ge.error)throw ge.error;if(ge.done)return yield ca(void 0)}})}();return Ee.throw=async Ne=>(ge.done||(ge.done=!0,ge.error=Ne,ge.resolve()),{done:!0,value:void 0}),Ee.return=async()=>(ue(),{done:!0,value:void 0}),Ee},async dispose(){if(Ve=!0,$){const[ye]=await $;ye.close(1e3,"Normal Closure")}},terminate(){$&&F.emit("closed",new Jv)}}}class Jv extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function th(r){return ks(r)&&"code"in r&&"reason"in r}function lA(r){return[1e3,1001,1006,1005,1012,1013,1014].includes(r)?!1:r>=1e3&&r<=1999}function fA(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function Yv(r){return new Jr(function(e,t){var n=pn(e,[]);return new Ct(function(i){var a,u=!1;return Promise.resolve(n).then(function(c){return r(c,e.getContext())}).then(e.setContext).then(function(){u||(a=t(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){u=!0,a&&a.unsubscribe()}})})}function Kv(r){return new Jr(function(e,t){return new Ct(function(n){var i,a,u;try{i=t(e).subscribe({next:function(c){if(c.errors&&(u=r({graphQLErrors:c.errors,response:c,operation:e,forward:t}),u)){a=u.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.next(c)},error:function(c){if(u=r({operation:e,networkError:c,graphQLErrors:c&&c.result&&c.result.errors||void 0,forward:t}),u){a=u.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.error(c)},complete:function(){u||n.complete.bind(n)()}})}catch(c){r({networkError:c,operation:e,forward:t}),n.error(c)}return function(){i&&i.unsubscribe(),a&&i.unsubscribe()}})})}(function(r){kn(e,r);function e(t){var n=r.call(this)||this;return n.link=Kv(t),n}return e.prototype.request=function(t,n){return this.link.request(t,n)},e})(Jr);var rh={exports:{}};const hA=el(vO),dA=el(fE);var nh,Zv;function pA(){return Zv||(Zv=1,nh=Error),nh}var ih,Xv;function mA(){return Xv||(Xv=1,ih=EvalError),ih}var sh,e0;function yA(){return e0||(e0=1,sh=RangeError),sh}var ah,t0;function gA(){return t0||(t0=1,ah=ReferenceError),ah}var oh,r0;function n0(){return r0||(r0=1,oh=SyntaxError),oh}var uh,i0;function bo(){return i0||(i0=1,uh=TypeError),uh}var ch,s0;function vA(){return s0||(s0=1,ch=URIError),ch}var lh,a0;function bA(){return a0||(a0=1,lh=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(e,t);if(u.value!==i||u.enumerable!==!0)return!1}return!0}),lh}var fh,o0;function wA(){if(o0)return fh;o0=1;var r=typeof Symbol<"u"&&Symbol,e=bA();return fh=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},fh}var hh,u0;function _A(){if(u0)return hh;u0=1;var r={__proto__:null,foo:{}},e=Object;return hh=function(){return{__proto__:r}.foo===r.foo&&!(r instanceof e)},hh}var dh,c0;function xA(){if(c0)return dh;c0=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(f,h){for(var d=[],y=0;y<f.length;y+=1)d[y]=f[y];for(var g=0;g<h.length;g+=1)d[g+f.length]=h[g];return d},a=function(f,h){for(var d=[],y=h,g=0;y<f.length;y+=1,g+=1)d[g]=f[y];return d},u=function(c,f){for(var h="",d=0;d<c.length;d+=1)h+=c[d],d+1<c.length&&(h+=f);return h};return dh=function(f){var h=this;if(typeof h!="function"||e.apply(h)!==n)throw new TypeError(r+h);for(var d=a(arguments,1),y,g=function(){if(this instanceof y){var S=h.apply(this,i(d,arguments));return Object(S)===S?S:this}return h.apply(f,i(d,arguments))},m=t(0,h.length-d.length),x=[],T=0;T<m;T++)x[T]="$"+T;if(y=Function("binder","return function ("+u(x,",")+"){ return binder.apply(this,arguments); }")(g),h.prototype){var w=function(){};w.prototype=h.prototype,y.prototype=new w,w.prototype=null}return y},dh}var ph,l0;function mh(){if(l0)return ph;l0=1;var r=xA();return ph=Function.prototype.bind||r,ph}var yh,f0;function SA(){if(f0)return yh;f0=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=mh();return yh=t.call(r,e),yh}var gh,h0;function la(){if(h0)return gh;h0=1;var r,e=pA(),t=mA(),n=yA(),i=gA(),a=n0(),u=bo(),c=vA(),f=Function,h=function(ge){try{return f('"use strict"; return ('+ge+").constructor;")()}catch{}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch{d=null}var y=function(){throw new u},g=d?function(){try{return arguments.callee,y}catch{try{return d(arguments,"callee").get}catch{return y}}}():y,m=wA()(),x=_A()(),T=Object.getPrototypeOf||(x?function(ge){return ge.__proto__}:null),w={},S=typeof Uint8Array>"u"||!T?r:T(Uint8Array),A={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":m&&T?T([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":t,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&T?T(T([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m||!T?r:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!m||!T?r:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&T?T(""[Symbol.iterator]()):r,"%Symbol%":m?Symbol:r,"%SyntaxError%":a,"%ThrowTypeError%":g,"%TypedArray%":S,"%TypeError%":u,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet};if(T)try{null.error}catch(ge){var P=T(T(ge));A["%Error.prototype%"]=P}var F=function ge(ue){var Ee;if(ue==="%AsyncFunction%")Ee=h("async function () {}");else if(ue==="%GeneratorFunction%")Ee=h("function* () {}");else if(ue==="%AsyncGeneratorFunction%")Ee=h("async function* () {}");else if(ue==="%AsyncGenerator%"){var Ne=ge("%AsyncGeneratorFunction%");Ne&&(Ee=Ne.prototype)}else if(ue==="%AsyncIteratorPrototype%"){var xe=ge("%AsyncGenerator%");xe&&T&&(Ee=T(xe.prototype))}return A[ue]=Ee,Ee},L={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},$=mh(),X=SA(),te=$.call(Function.call,Array.prototype.concat),he=$.call(Function.apply,Array.prototype.splice),de=$.call(Function.call,String.prototype.replace),Ve=$.call(Function.call,String.prototype.slice),Ae=$.call(Function.call,RegExp.prototype.exec),je=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ge=/\\(\\)?/g,ye=function(ue){var Ee=Ve(ue,0,1),Ne=Ve(ue,-1);if(Ee==="%"&&Ne!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(Ne==="%"&&Ee!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var xe=[];return de(ue,je,function(Xe,Et,lt,It){xe[xe.length]=lt?de(It,Ge,"$1"):Et||Xe}),xe},Je=function(ue,Ee){var Ne=ue,xe;if(X(L,Ne)&&(xe=L[Ne],Ne="%"+xe[0]+"%"),X(A,Ne)){var Xe=A[Ne];if(Xe===w&&(Xe=F(Ne)),typeof Xe>"u"&&!Ee)throw new u("intrinsic "+ue+" exists, but is not available. Please file an issue!");return{alias:xe,name:Ne,value:Xe}}throw new a("intrinsic "+ue+" does not exist!")};return gh=function(ue,Ee){if(typeof ue!="string"||ue.length===0)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Ee!="boolean")throw new u('"allowMissing" argument must be a boolean');if(Ae(/^%?[^%]*%?$/,ue)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Ne=ye(ue),xe=Ne.length>0?Ne[0]:"",Xe=Je("%"+xe+"%",Ee),Et=Xe.name,lt=Xe.value,It=!1,et=Xe.alias;et&&(xe=et[0],he(Ne,te([0,1],et)));for(var Ye=1,dt=!0;Ye<Ne.length;Ye+=1){var Re=Ne[Ye],bt=Ve(Re,0,1),z=Ve(Re,-1);if((bt==='"'||bt==="'"||bt==="`"||z==='"'||z==="'"||z==="`")&&bt!==z)throw new a("property names with quotes must have matching quotes");if((Re==="constructor"||!dt)&&(It=!0),xe+="."+Re,Et="%"+xe+"%",X(A,Et))lt=A[Et];else if(lt!=null){if(!(Re in lt)){if(!Ee)throw new u("base intrinsic for "+ue+" exists, but the property is not available.");return}if(d&&Ye+1>=Ne.length){var Y=d(lt,Re);dt=!!Y,dt&&"get"in Y&&!("originalValue"in Y.get)?lt=Y.get:lt=lt[Re]}else dt=X(lt,Re),lt=lt[Re];dt&&!It&&(A[Et]=lt)}}return lt},gh}var vh={exports:{}},bh,d0;function wh(){if(d0)return bh;d0=1;var r=la(),e=r("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return bh=e,bh}var _h,p0;function m0(){if(p0)return _h;p0=1;var r=la(),e=r("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return _h=e,_h}var xh,y0;function EA(){if(y0)return xh;y0=1;var r=wh(),e=n0(),t=bo(),n=m0();return xh=function(a,u,c){if(!a||typeof a!="object"&&typeof a!="function")throw new t("`obj` must be an object or a function`");if(typeof u!="string"&&typeof u!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var f=arguments.length>3?arguments[3]:null,h=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,y=arguments.length>6?arguments[6]:!1,g=!!n&&n(a,u);if(r)r(a,u,{configurable:d===null&&g?g.configurable:!d,enumerable:f===null&&g?g.enumerable:!f,value:c,writable:h===null&&g?g.writable:!h});else if(y||!f&&!h&&!d)a[u]=c;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},xh}var Sh,g0;function OA(){if(g0)return Sh;g0=1;var r=wh(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},Sh=e,Sh}var Eh,v0;function TA(){if(v0)return Eh;v0=1;var r=la(),e=EA(),t=OA()(),n=m0(),i=bo(),a=r("%Math.floor%");return Eh=function(c,f){if(typeof c!="function")throw new i("`fn` is not a function");if(typeof f!="number"||f<0||f>4294967295||a(f)!==f)throw new i("`length` must be a positive 32-bit integer");var h=arguments.length>2&&!!arguments[2],d=!0,y=!0;if("length"in c&&n){var g=n(c,"length");g&&!g.configurable&&(d=!1),g&&!g.writable&&(y=!1)}return(d||y||!h)&&(t?e(c,"length",f,!0,!0):e(c,"length",f)),c},Eh}var b0;function AA(){return b0||(b0=1,function(r){var e=mh(),t=la(),n=TA(),i=bo(),a=t("%Function.prototype.apply%"),u=t("%Function.prototype.call%"),c=t("%Reflect.apply%",!0)||e.call(u,a),f=wh(),h=t("%Math.max%");r.exports=function(g){if(typeof g!="function")throw new i("a function is required");var m=c(e,u,arguments);return n(m,1+h(0,g.length-(arguments.length-1)),!0)};var d=function(){return c(e,a,arguments)};f?f(r.exports,"apply",{value:d}):r.exports.apply=d}(vh)),vh.exports}var Oh,w0;function kA(){if(w0)return Oh;w0=1;var r=la(),e=AA(),t=e(r("String.prototype.indexOf"));return Oh=function(i,a){var u=r(i,!!a);return typeof u=="function"&&t(i,".prototype.")>-1?e(u):u},Oh}const IA=el(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Th,_0;function PA(){if(_0)return Th;_0=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=r&&e&&typeof e.get=="function"?e.get:null,n=r&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=i&&a&&typeof a.get=="function"?a.get:null,c=i&&Set.prototype.forEach,f=typeof WeakMap=="function"&&WeakMap.prototype,h=f?WeakMap.prototype.has:null,d=typeof WeakSet=="function"&&WeakSet.prototype,y=d?WeakSet.prototype.has:null,g=typeof WeakRef=="function"&&WeakRef.prototype,m=g?WeakRef.prototype.deref:null,x=Boolean.prototype.valueOf,T=Object.prototype.toString,w=Function.prototype.toString,S=String.prototype.match,A=String.prototype.slice,P=String.prototype.replace,F=String.prototype.toUpperCase,L=String.prototype.toLowerCase,$=RegExp.prototype.test,X=Array.prototype.concat,te=Array.prototype.join,he=Array.prototype.slice,de=Math.floor,Ve=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ae=Object.getOwnPropertySymbols,je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ye=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ge||!0)?Symbol.toStringTag:null,Je=Object.prototype.propertyIsEnumerable,ge=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(W){return W.__proto__}:null);function ue(W,H){if(W===1/0||W===-1/0||W!==W||W&&W>-1e3&&W<1e3||$.call(/e/,H))return H;var Be=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof W=="number"){var $e=W<0?-de(-W):de(W);if($e!==W){var Tt=String($e),Ke=A.call(H,Tt.length+1);return P.call(Tt,Be,"$&_")+"."+P.call(P.call(Ke,/([0-9]{3})/g,"$&_"),/_$/,"")}}return P.call(H,Be,"$&_")}var Ee=IA,Ne=Ee.custom,xe=z(Ne)?Ne:null;Th=function W(H,Be,$e,Tt){var Ke=Be||{};if(G(Ke,"quoteStyle")&&Ke.quoteStyle!=="single"&&Ke.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(Ke,"maxStringLength")&&(typeof Ke.maxStringLength=="number"?Ke.maxStringLength<0&&Ke.maxStringLength!==1/0:Ke.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var nr=G(Ke,"customInspect")?Ke.customInspect:!0;if(typeof nr!="boolean"&&nr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(Ke,"indent")&&Ke.indent!==null&&Ke.indent!==" "&&!(parseInt(Ke.indent,10)===Ke.indent&&Ke.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(Ke,"numericSeparator")&&typeof Ke.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var fr=Ke.numericSeparator;if(typeof H>"u")return"undefined";if(H===null)return"null";if(typeof H=="boolean")return H?"true":"false";if(typeof H=="string")return wt(H,Ke);if(typeof H=="number"){if(H===0)return 1/0/H>0?"0":"-0";var Dt=String(H);return fr?ue(H,Dt):Dt}if(typeof H=="bigint"){var Ht=String(H)+"n";return fr?ue(H,Ht):Ht}var Ur=typeof Ke.depth>"u"?5:Ke.depth;if(typeof $e>"u"&&($e=0),$e>=Ur&&Ur>0&&typeof H=="object")return lt(H)?"[Array]":"[Object]";var $r=zt(Ke,$e);if(typeof Tt>"u")Tt=[];else if(Te(Tt,H)>=0)return"[Circular]";function ir(Le,at,nt){if(at&&(Tt=he.call(Tt),Tt.push(at)),nt){var tt={depth:Ke.depth};return G(Ke,"quoteStyle")&&(tt.quoteStyle=Ke.quoteStyle),W(Le,tt,$e+1,Tt)}return W(Le,Ke,$e+1,Tt)}if(typeof H=="function"&&!et(H)){var un=Q(H),_r=Zt(H,ir);return"[Function"+(un?": "+un:" (anonymous)")+"]"+(_r.length>0?" { "+te.call(_r,", ")+" }":"")}if(z(H)){var xr=Ge?P.call(String(H),/^(Symbol\(.*\))_[^)]*$/,"$1"):je.call(H);return typeof H=="object"&&!Ge?pt(xr):xr}if(Ot(H)){for(var Sr="<"+L.call(String(H.nodeName)),Or=H.attributes||[],ur=0;ur<Or.length;ur++)Sr+=" "+Or[ur].name+"="+Xe(Et(Or[ur].value),"double",Ke);return Sr+=">",H.childNodes&&H.childNodes.length&&(Sr+="..."),Sr+="</"+L.call(String(H.nodeName))+">",Sr}if(lt(H)){if(H.length===0)return"[]";var zr=Zt(H,ir);return $r&&!Rr(zr)?"["+Jt(zr,$r)+"]":"[ "+te.call(zr,", ")+" ]"}if(Ye(H)){var Tr=Zt(H,ir);return!("cause"in Error.prototype)&&"cause"in H&&!Je.call(H,"cause")?"{ ["+String(H)+"] "+te.call(X.call("[cause]: "+ir(H.cause),Tr),", ")+" }":Tr.length===0?"["+String(H)+"]":"{ ["+String(H)+"] "+te.call(Tr,", ")+" }"}if(typeof H=="object"&&nr){if(xe&&typeof H[xe]=="function"&&Ee)return Ee(H,{depth:Ur-$e});if(nr!=="symbol"&&typeof H.inspect=="function")return H.inspect()}if(ze(H)){var Er=[];return n&&n.call(H,function(Le,at){Er.push(ir(at,H,!0)+" => "+ir(Le,H))}),rr("Map",t.call(H),Er,$r)}if(be(H)){var Dr=[];return c&&c.call(H,function(Le){Dr.push(ir(Le,H))}),rr("Set",u.call(H),Dr,$r)}if(Ue(H))return Lt("WeakMap");if(Ze(H))return Lt("WeakSet");if(ce(H))return Lt("WeakRef");if(Re(H))return pt(ir(Number(H)));if(Y(H))return pt(ir(Ve.call(H)));if(bt(H))return pt(x.call(H));if(dt(H))return pt(ir(String(H)));if(typeof window<"u"&&H===window)return"{ [object Window] }";if(typeof globalThis<"u"&&H===globalThis||typeof di<"u"&&H===di)return"{ [object globalThis] }";if(!It(H)&&!et(H)){var cn=Zt(H,ir),Ln=ge?ge(H)===Object.prototype:H instanceof Object||H.constructor===Object,R=H instanceof Object?"":"null prototype",se=!Ln&&ye&&Object(H)===H&&ye in H?A.call(Z(H),8,-1):R?"Object":"",me=Ln||typeof H.constructor!="function"?"":H.constructor.name?H.constructor.name+" ":"",ke=me+(se||R?"["+te.call(X.call([],se||[],R||[]),": ")+"] ":"");return cn.length===0?ke+"{}":$r?ke+"{"+Jt(cn,$r)+"}":ke+"{ "+te.call(cn,", ")+" }"}return String(H)};function Xe(W,H,Be){var $e=(Be.quoteStyle||H)==="double"?'"':"'";return $e+W+$e}function Et(W){return P.call(String(W),/"/g,"&quot;")}function lt(W){return Z(W)==="[object Array]"&&(!ye||!(typeof W=="object"&&ye in W))}function It(W){return Z(W)==="[object Date]"&&(!ye||!(typeof W=="object"&&ye in W))}function et(W){return Z(W)==="[object RegExp]"&&(!ye||!(typeof W=="object"&&ye in W))}function Ye(W){return Z(W)==="[object Error]"&&(!ye||!(typeof W=="object"&&ye in W))}function dt(W){return Z(W)==="[object String]"&&(!ye||!(typeof W=="object"&&ye in W))}function Re(W){return Z(W)==="[object Number]"&&(!ye||!(typeof W=="object"&&ye in W))}function bt(W){return Z(W)==="[object Boolean]"&&(!ye||!(typeof W=="object"&&ye in W))}function z(W){if(Ge)return W&&typeof W=="object"&&W instanceof Symbol;if(typeof W=="symbol")return!0;if(!W||typeof W!="object"||!je)return!1;try{return je.call(W),!0}catch{}return!1}function Y(W){if(!W||typeof W!="object"||!Ve)return!1;try{return Ve.call(W),!0}catch{}return!1}var V=Object.prototype.hasOwnProperty||function(W){return W in this};function G(W,H){return V.call(W,H)}function Z(W){return T.call(W)}function Q(W){if(W.name)return W.name;var H=S.call(w.call(W),/^function\s*([\w$]+)/);return H?H[1]:null}function Te(W,H){if(W.indexOf)return W.indexOf(H);for(var Be=0,$e=W.length;Be<$e;Be++)if(W[Be]===H)return Be;return-1}function ze(W){if(!t||!W||typeof W!="object")return!1;try{t.call(W);try{u.call(W)}catch{return!0}return W instanceof Map}catch{}return!1}function Ue(W){if(!h||!W||typeof W!="object")return!1;try{h.call(W,h);try{y.call(W,y)}catch{return!0}return W instanceof WeakMap}catch{}return!1}function ce(W){if(!m||!W||typeof W!="object")return!1;try{return m.call(W),!0}catch{}return!1}function be(W){if(!u||!W||typeof W!="object")return!1;try{u.call(W);try{t.call(W)}catch{return!0}return W instanceof Set}catch{}return!1}function Ze(W){if(!y||!W||typeof W!="object")return!1;try{y.call(W,y);try{h.call(W,h)}catch{return!0}return W instanceof WeakSet}catch{}return!1}function Ot(W){return!W||typeof W!="object"?!1:typeof HTMLElement<"u"&&W instanceof HTMLElement?!0:typeof W.nodeName=="string"&&typeof W.getAttribute=="function"}function wt(W,H){if(W.length>H.maxStringLength){var Be=W.length-H.maxStringLength,$e="... "+Be+" more character"+(Be>1?"s":"");return wt(A.call(W,0,H.maxStringLength),H)+$e}var Tt=P.call(P.call(W,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Gt);return Xe(Tt,"single",H)}function Gt(W){var H=W.charCodeAt(0),Be={8:"b",9:"t",10:"n",12:"f",13:"r"}[H];return Be?"\\"+Be:"\\x"+(H<16?"0":"")+F.call(H.toString(16))}function pt(W){return"Object("+W+")"}function Lt(W){return W+" { ? }"}function rr(W,H,Be,$e){var Tt=$e?Jt(Be,$e):te.call(Be,", ");return W+" ("+H+") {"+Tt+"}"}function Rr(W){for(var H=0;H<W.length;H++)if(Te(W[H],`
129
129
  `)>=0)return!1;return!0}function zt(W,H){var Be;if(W.indent===" ")Be=" ";else if(typeof W.indent=="number"&&W.indent>0)Be=te.call(Array(W.indent+1)," ");else return null;return{base:Be,prev:te.call(Array(H+1),Be)}}function Jt(W,H){if(W.length===0)return"";var Be=`
130
130
  `+H.prev+H.base;return Be+te.call(W,","+Be)+`
131
- `+H.prev}function Zt(W,H){var Be=lt(W),$e=[];if(Be){$e.length=W.length;for(var Tt=0;Tt<W.length;Tt++)$e[Tt]=G(W,Tt)?H(W[Tt],W):""}var Ke=typeof Ae=="function"?Ae(W):[],nr;if(Ge){nr={};for(var fr=0;fr<Ke.length;fr++)nr["$"+Ke[fr]]=Ke[fr]}for(var Dt in W)G(W,Dt)&&(Be&&String(Number(Dt))===Dt&&Dt<W.length||Ge&&nr["$"+Dt]instanceof Symbol||($.call(/[^\w$]/,Dt)?$e.push(H(Dt,W)+": "+H(W[Dt],W)):$e.push(Dt+": "+H(W[Dt],W))));if(typeof Ae=="function")for(var Ht=0;Ht<Ke.length;Ht++)Je.call(W,Ke[Ht])&&$e.push("["+H(Ke[Ht])+"]: "+H(W[Ke[Ht]],W));return $e}return Th}var Ah,x0;function CA(){if(x0)return Ah;x0=1;var r=la(),e=kA(),t=PA(),n=bo(),i=r("%WeakMap%",!0),a=r("%Map%",!0),u=e("WeakMap.prototype.get",!0),c=e("WeakMap.prototype.set",!0),f=e("WeakMap.prototype.has",!0),h=e("Map.prototype.get",!0),d=e("Map.prototype.set",!0),y=e("Map.prototype.has",!0),g=function(w,S){for(var A=w,P;(P=A.next)!==null;A=P)if(P.key===S)return A.next=P.next,P.next=w.next,w.next=P,P},m=function(w,S){var A=g(w,S);return A&&A.value},x=function(w,S,A){var P=g(w,S);P?P.value=A:w.next={key:S,next:w.next,value:A}},T=function(w,S){return!!g(w,S)};return Ah=function(){var S,A,P,F={assert:function(L){if(!F.has(L))throw new n("Side channel does not contain "+t(L))},get:function(L){if(i&&L&&(typeof L=="object"||typeof L=="function")){if(S)return u(S,L)}else if(a){if(A)return h(A,L)}else if(P)return m(P,L)},has:function(L){if(i&&L&&(typeof L=="object"||typeof L=="function")){if(S)return f(S,L)}else if(a){if(A)return y(A,L)}else if(P)return T(P,L);return!1},set:function(L,$){i&&L&&(typeof L=="object"||typeof L=="function")?(S||(S=new i),c(S,L,$)):a?(A||(A=new a),d(A,L,$)):(P||(P={key:{},next:null}),x(P,L,$))}};return F},Ah}var kh,S0;function Ih(){if(S0)return kh;S0=1;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return kh={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},kh}var Ph,E0;function O0(){if(E0)return Ph;E0=1;var r=Ih(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var w=[],S=0;S<256;++S)w.push("%"+((S<16?"0":"")+S.toString(16)).toUpperCase());return w}(),i=function(S){for(;S.length>1;){var A=S.pop(),P=A.obj[A.prop];if(t(P)){for(var F=[],L=0;L<P.length;++L)typeof P[L]<"u"&&F.push(P[L]);A.obj[A.prop]=F}}},a=function(S,A){for(var P=A&&A.plainObjects?Object.create(null):{},F=0;F<S.length;++F)typeof S[F]<"u"&&(P[F]=S[F]);return P},u=function w(S,A,P){if(!A)return S;if(typeof A!="object"){if(t(S))S.push(A);else if(S&&typeof S=="object")(P&&(P.plainObjects||P.allowPrototypes)||!e.call(Object.prototype,A))&&(S[A]=!0);else return[S,A];return S}if(!S||typeof S!="object")return[S].concat(A);var F=S;return t(S)&&!t(A)&&(F=a(S,P)),t(S)&&t(A)?(A.forEach(function(L,$){if(e.call(S,$)){var X=S[$];X&&typeof X=="object"&&L&&typeof L=="object"?S[$]=w(X,L,P):S.push(L)}else S[$]=L}),S):Object.keys(A).reduce(function(L,$){var X=A[$];return e.call(L,$)?L[$]=w(L[$],X,P):L[$]=X,L},F)},c=function(S,A){return Object.keys(A).reduce(function(P,F){return P[F]=A[F],P},S)},f=function(w,S,A){var P=w.replace(/\+/g," ");if(A==="iso-8859-1")return P.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(P)}catch{return P}},h=1024,d=function(S,A,P,F,L){if(S.length===0)return S;var $=S;if(typeof S=="symbol"?$=Symbol.prototype.toString.call(S):typeof S!="string"&&($=String(S)),P==="iso-8859-1")return escape($).replace(/%u[0-9a-f]{4}/gi,function(je){return"%26%23"+parseInt(je.slice(2),16)+"%3B"});for(var X="",te=0;te<$.length;te+=h){for(var he=$.length>=h?$.slice(te,te+h):$,de=[],Ve=0;Ve<he.length;++Ve){var Ae=he.charCodeAt(Ve);if(Ae===45||Ae===46||Ae===95||Ae===126||Ae>=48&&Ae<=57||Ae>=65&&Ae<=90||Ae>=97&&Ae<=122||L===r.RFC1738&&(Ae===40||Ae===41)){de[de.length]=he.charAt(Ve);continue}if(Ae<128){de[de.length]=n[Ae];continue}if(Ae<2048){de[de.length]=n[192|Ae>>6]+n[128|Ae&63];continue}if(Ae<55296||Ae>=57344){de[de.length]=n[224|Ae>>12]+n[128|Ae>>6&63]+n[128|Ae&63];continue}Ve+=1,Ae=65536+((Ae&1023)<<10|he.charCodeAt(Ve)&1023),de[de.length]=n[240|Ae>>18]+n[128|Ae>>12&63]+n[128|Ae>>6&63]+n[128|Ae&63]}X+=de.join("")}return X},y=function(S){for(var A=[{obj:{o:S},prop:"o"}],P=[],F=0;F<A.length;++F)for(var L=A[F],$=L.obj[L.prop],X=Object.keys($),te=0;te<X.length;++te){var he=X[te],de=$[he];typeof de=="object"&&de!==null&&P.indexOf(de)===-1&&(A.push({obj:$,prop:he}),P.push(de))}return i(A),S},g=function(S){return Object.prototype.toString.call(S)==="[object RegExp]"},m=function(S){return!S||typeof S!="object"?!1:!!(S.constructor&&S.constructor.isBuffer&&S.constructor.isBuffer(S))},x=function(S,A){return[].concat(S,A)},T=function(S,A){if(t(S)){for(var P=[],F=0;F<S.length;F+=1)P.push(A(S[F]));return P}return A(S)};return Ph={arrayToObject:a,assign:c,combine:x,compact:y,decode:f,encode:d,isBuffer:m,isRegExp:g,maybeMap:T,merge:u},Ph}var Ch,T0;function NA(){if(T0)return Ch;T0=1;var r=CA(),e=O0(),t=Ih(),n=Object.prototype.hasOwnProperty,i={brackets:function(w){return w+"[]"},comma:"comma",indices:function(w,S){return w+"["+S+"]"},repeat:function(w){return w}},a=Array.isArray,u=Array.prototype.push,c=function(T,w){u.apply(T,a(w)?w:[w])},f=Date.prototype.toISOString,h=t.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:h,formatter:t.formatters[h],indices:!1,serializeDate:function(w){return f.call(w)},skipNulls:!1,strictNullHandling:!1},y=function(w){return typeof w=="string"||typeof w=="number"||typeof w=="boolean"||typeof w=="symbol"||typeof w=="bigint"},g={},m=function T(w,S,A,P,F,L,$,X,te,he,de,Ve,Ae,je,Ge,ye,Je,ge){for(var ue=w,Ee=ge,Ne=0,xe=!1;(Ee=Ee.get(g))!==void 0&&!xe;){var Xe=Ee.get(w);if(Ne+=1,typeof Xe<"u"){if(Xe===Ne)throw new RangeError("Cyclic object value");xe=!0}typeof Ee.get(g)>"u"&&(Ne=0)}if(typeof he=="function"?ue=he(S,ue):ue instanceof Date?ue=Ae(ue):A==="comma"&&a(ue)&&(ue=e.maybeMap(ue,function(Z){return Z instanceof Date?Ae(Z):Z})),ue===null){if(L)return te&&!ye?te(S,d.encoder,Je,"key",je):S;ue=""}if(y(ue)||e.isBuffer(ue)){if(te){var Et=ye?S:te(S,d.encoder,Je,"key",je);return[Ge(Et)+"="+Ge(te(ue,d.encoder,Je,"value",je))]}return[Ge(S)+"="+Ge(String(ue))]}var lt=[];if(typeof ue>"u")return lt;var It;if(A==="comma"&&a(ue))ye&&te&&(ue=e.maybeMap(ue,te)),It=[{value:ue.length>0?ue.join(",")||null:void 0}];else if(a(he))It=he;else{var et=Object.keys(ue);It=de?et.sort(de):et}var Ye=X?S.replace(/\./g,"%2E"):S,dt=P&&a(ue)&&ue.length===1?Ye+"[]":Ye;if(F&&a(ue)&&ue.length===0)return dt+"[]";for(var Re=0;Re<It.length;++Re){var bt=It[Re],z=typeof bt=="object"&&typeof bt.value<"u"?bt.value:ue[bt];if(!($&&z===null)){var Y=Ve&&X?bt.replace(/\./g,"%2E"):bt,V=a(ue)?typeof A=="function"?A(dt,Y):dt:dt+(Ve?"."+Y:"["+Y+"]");ge.set(w,Ne);var G=r();G.set(g,ge),c(lt,T(z,V,A,P,F,L,$,X,A==="comma"&&ye&&a(ue)?null:te,he,de,Ve,Ae,je,Ge,ye,Je,G))}}return lt},x=function(w){if(!w)return d;if(typeof w.allowEmptyArrays<"u"&&typeof w.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof w.encodeDotInKeys<"u"&&typeof w.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(w.encoder!==null&&typeof w.encoder<"u"&&typeof w.encoder!="function")throw new TypeError("Encoder has to be a function.");var S=w.charset||d.charset;if(typeof w.charset<"u"&&w.charset!=="utf-8"&&w.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var A=t.default;if(typeof w.format<"u"){if(!n.call(t.formatters,w.format))throw new TypeError("Unknown format option provided.");A=w.format}var P=t.formatters[A],F=d.filter;(typeof w.filter=="function"||a(w.filter))&&(F=w.filter);var L;if(w.arrayFormat in i?L=w.arrayFormat:"indices"in w?L=w.indices?"indices":"repeat":L=d.arrayFormat,"commaRoundTrip"in w&&typeof w.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var $=typeof w.allowDots>"u"?w.encodeDotInKeys===!0?!0:d.allowDots:!!w.allowDots;return{addQueryPrefix:typeof w.addQueryPrefix=="boolean"?w.addQueryPrefix:d.addQueryPrefix,allowDots:$,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:L,charset:S,charsetSentinel:typeof w.charsetSentinel=="boolean"?w.charsetSentinel:d.charsetSentinel,commaRoundTrip:w.commaRoundTrip,delimiter:typeof w.delimiter>"u"?d.delimiter:w.delimiter,encode:typeof w.encode=="boolean"?w.encode:d.encode,encodeDotInKeys:typeof w.encodeDotInKeys=="boolean"?w.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof w.encoder=="function"?w.encoder:d.encoder,encodeValuesOnly:typeof w.encodeValuesOnly=="boolean"?w.encodeValuesOnly:d.encodeValuesOnly,filter:F,format:A,formatter:P,serializeDate:typeof w.serializeDate=="function"?w.serializeDate:d.serializeDate,skipNulls:typeof w.skipNulls=="boolean"?w.skipNulls:d.skipNulls,sort:typeof w.sort=="function"?w.sort:null,strictNullHandling:typeof w.strictNullHandling=="boolean"?w.strictNullHandling:d.strictNullHandling}};return Ch=function(T,w){var S=T,A=x(w),P,F;typeof A.filter=="function"?(F=A.filter,S=F("",S)):a(A.filter)&&(F=A.filter,P=F);var L=[];if(typeof S!="object"||S===null)return"";var $=i[A.arrayFormat],X=$==="comma"&&A.commaRoundTrip;P||(P=Object.keys(S)),A.sort&&P.sort(A.sort);for(var te=r(),he=0;he<P.length;++he){var de=P[he];A.skipNulls&&S[de]===null||c(L,m(S[de],de,$,X,A.allowEmptyArrays,A.strictNullHandling,A.skipNulls,A.encodeDotInKeys,A.encode?A.encoder:null,A.filter,A.sort,A.allowDots,A.serializeDate,A.format,A.formatter,A.encodeValuesOnly,A.charset,te))}var Ve=L.join(A.delimiter),Ae=A.addQueryPrefix===!0?"?":"";return A.charsetSentinel&&(A.charset==="iso-8859-1"?Ae+="utf8=%26%2310003%3B&":Ae+="utf8=%E2%9C%93&"),Ve.length>0?Ae+Ve:""},Ch}var Nh,A0;function RA(){if(A0)return Nh;A0=1;var r=O0(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(g){return g.replace(/&#(\d+);/g,function(m,x){return String.fromCharCode(parseInt(x,10))})},a=function(g,m){return g&&typeof g=="string"&&m.comma&&g.indexOf(",")>-1?g.split(","):g},u="utf8=%26%2310003%3B",c="utf8=%E2%9C%93",f=function(m,x){var T={__proto__:null},w=x.ignoreQueryPrefix?m.replace(/^\?/,""):m;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var S=x.parameterLimit===1/0?void 0:x.parameterLimit,A=w.split(x.delimiter,S),P=-1,F,L=x.charset;if(x.charsetSentinel)for(F=0;F<A.length;++F)A[F].indexOf("utf8=")===0&&(A[F]===c?L="utf-8":A[F]===u&&(L="iso-8859-1"),P=F,F=A.length);for(F=0;F<A.length;++F)if(F!==P){var $=A[F],X=$.indexOf("]="),te=X===-1?$.indexOf("="):X+1,he,de;te===-1?(he=x.decoder($,n.decoder,L,"key"),de=x.strictNullHandling?null:""):(he=x.decoder($.slice(0,te),n.decoder,L,"key"),de=r.maybeMap(a($.slice(te+1),x),function(Ae){return x.decoder(Ae,n.decoder,L,"value")})),de&&x.interpretNumericEntities&&L==="iso-8859-1"&&(de=i(de)),$.indexOf("[]=")>-1&&(de=t(de)?[de]:de);var Ve=e.call(T,he);Ve&&x.duplicates==="combine"?T[he]=r.combine(T[he],de):(!Ve||x.duplicates==="last")&&(T[he]=de)}return T},h=function(g,m,x,T){for(var w=T?m:a(m,x),S=g.length-1;S>=0;--S){var A,P=g[S];if(P==="[]"&&x.parseArrays)A=x.allowEmptyArrays&&(w===""||x.strictNullHandling&&w===null)?[]:[].concat(w);else{A=x.plainObjects?Object.create(null):{};var F=P.charAt(0)==="["&&P.charAt(P.length-1)==="]"?P.slice(1,-1):P,L=x.decodeDotInKeys?F.replace(/%2E/g,"."):F,$=parseInt(L,10);!x.parseArrays&&L===""?A={0:w}:!isNaN($)&&P!==L&&String($)===L&&$>=0&&x.parseArrays&&$<=x.arrayLimit?(A=[],A[$]=w):L!=="__proto__"&&(A[L]=w)}w=A}return w},d=function(m,x,T,w){if(m){var S=T.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m,A=/(\[[^[\]]*])/,P=/(\[[^[\]]*])/g,F=T.depth>0&&A.exec(S),L=F?S.slice(0,F.index):S,$=[];if(L){if(!T.plainObjects&&e.call(Object.prototype,L)&&!T.allowPrototypes)return;$.push(L)}for(var X=0;T.depth>0&&(F=P.exec(S))!==null&&X<T.depth;){if(X+=1,!T.plainObjects&&e.call(Object.prototype,F[1].slice(1,-1))&&!T.allowPrototypes)return;$.push(F[1])}return F&&$.push("["+S.slice(F.index)+"]"),h($,x,T,w)}},y=function(m){if(!m)return n;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var x=typeof m.charset>"u"?n.charset:m.charset,T=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(T!=="combine"&&T!=="first"&&T!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:w,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:n.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:n.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:n.arrayLimit,charset:x,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:n.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:n.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:n.decoder,delimiter:typeof m.delimiter=="string"||r.isRegExp(m.delimiter)?m.delimiter:n.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:n.depth,duplicates:T,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:n.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:n.plainObjects,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling}};return Nh=function(g,m){var x=y(m);if(g===""||g===null||typeof g>"u")return x.plainObjects?Object.create(null):{};for(var T=typeof g=="string"?f(g,x):g,w=x.plainObjects?Object.create(null):{},S=Object.keys(T),A=0;A<S.length;++A){var P=S[A],F=d(P,T[P],x,typeof g=="string");w=r.merge(w,F,x)}return x.allowSparse===!0?w:r.compact(w)},Nh}var Rh,k0;function DA(){if(k0)return Rh;k0=1;var r=NA(),e=RA(),t=Ih();return Rh={formats:t,parse:e,stringify:r},Rh}(function(r,e){(function(t,n){n(e,hA,dA,DA())})(di,function(t,n,i,a){var u=function(z,Y,V,G){function Z(Q){return Q instanceof V?Q:new V(function(Te){Te(Q)})}return new(V||(V=Promise))(function(Q,Te){function ze(be){try{ce(G.next(be))}catch(Ze){Te(Ze)}}function Ue(be){try{ce(G.throw(be))}catch(Ze){Te(Ze)}}function ce(be){be.done?Q(be.value):Z(be.value).then(ze,Ue)}ce((G=G.apply(z,Y||[])).next())})},c=function(z,Y){var V={label:0,sent:function(){if(Q[0]&1)throw Q[1];return Q[1]},trys:[],ops:[]},G,Z,Q,Te;return Te={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(Te[Symbol.iterator]=function(){return this}),Te;function ze(ce){return function(be){return Ue([ce,be])}}function Ue(ce){if(G)throw new TypeError("Generator is already executing.");for(;V;)try{if(G=1,Z&&(Q=ce[0]&2?Z.return:ce[0]?Z.throw||((Q=Z.return)&&Q.call(Z),0):Z.next)&&!(Q=Q.call(Z,ce[1])).done)return Q;switch(Z=0,Q&&(ce=[ce[0]&2,Q.value]),ce[0]){case 0:case 1:Q=ce;break;case 4:return V.label++,{value:ce[1],done:!1};case 5:V.label++,Z=ce[1],ce=[0];continue;case 7:ce=V.ops.pop(),V.trys.pop();continue;default:if(Q=V.trys,!(Q=Q.length>0&&Q[Q.length-1])&&(ce[0]===6||ce[0]===2)){V=0;continue}if(ce[0]===3&&(!Q||ce[1]>Q[0]&&ce[1]<Q[3])){V.label=ce[1];break}if(ce[0]===6&&V.label<Q[1]){V.label=Q[1],Q=ce;break}if(Q&&V.label<Q[2]){V.label=Q[2],V.ops.push(ce);break}Q[2]&&V.ops.pop(),V.trys.pop();continue}ce=Y.call(z,V)}catch(be){ce=[6,be],Z=0}finally{G=Q=0}if(ce[0]&5)throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}};function f(z,Y){if(z.directives&&z.directives.length){var V={};return z.directives.forEach(function(G){V[G.name.value]=i.argumentsObjectFromField(G,Y)}),V}return null}var h=Object.prototype.hasOwnProperty;function d(z,Y){Y!==null&&typeof Y=="object"&&Object.keys(Y).forEach(function(V){var G=Y[V];h.call(z,V)?d(z[V],G):z[V]=G})}function y(z,Y,V,G,Z,Q){Q===void 0&&(Q={});var Te=i.getMainDefinition(Y),ze=i.getFragmentDefinitions(Y),Ue=i.createFragmentMap(ze),ce=Q.resultMapper,be=Q.fragmentMatcher||function(){return!0},Ze={fragmentMap:Ue,contextValue:G,variableValues:Z,resultMapper:ce,resolver:z,fragmentMatcher:be};return g(Te.selectionSet,V,Ze)}function g(z,Y,V){return u(this,void 0,void 0,function(){var G,Z,Q,Te,ze,Ue=this;return c(this,function(ce){switch(ce.label){case 0:return G=V.fragmentMap,Z=V.contextValue,Q=V.variableValues,Te={},ze=function(be){return u(Ue,void 0,void 0,function(){var Ze,Ot,wt,Gt,pt;return c(this,function(Lt){switch(Lt.label){case 0:return i.shouldInclude(be,Q)?i.isField(be)?[4,m(be,Y,V)]:[3,2]:[2];case 1:return Ze=Lt.sent(),Ot=i.resultKeyNameFromField(be),Ze!==void 0&&(Te[Ot]===void 0?Te[Ot]=Ze:d(Te[Ot],Ze)),[2];case 2:if(i.isInlineFragment(be))wt=be;else if(wt=G[be.name.value],!wt)throw new Error("No fragment named "+be.name.value);return Gt=wt.typeCondition.name.value,V.fragmentMatcher(Y,Gt,Z)?[4,g(wt.selectionSet,Y,V)]:[3,4];case 3:pt=Lt.sent(),d(Te,pt),Lt.label=4;case 4:return[2]}})})},[4,Promise.all(z.selections.map(ze))];case 1:return ce.sent(),V.resultMapper?[2,V.resultMapper(Te,Y)]:[2,Te]}})})}function m(z,Y,V){return u(this,void 0,void 0,function(){var G,Z,Q,Te,ze,Ue,ce;return c(this,function(be){switch(be.label){case 0:return G=V.variableValues,Z=V.contextValue,Q=V.resolver,Te=z.name.value,ze=i.argumentsObjectFromField(z,G),Ue={isLeaf:!z.selectionSet,resultKey:i.resultKeyNameFromField(z),directives:f(z,G),field:z},[4,Q(Te,Y,ze,Z,Ue)];case 1:return ce=be.sent(),z.selectionSet?ce==null?[2,ce]:Array.isArray(ce)?[2,x(z,ce,V)]:[2,g(z.selectionSet,ce,V)]:[2,ce]}})})}function x(z,Y,V){return Promise.all(Y.map(function(G){return G===null?null:Array.isArray(G)?x(z,G,V):g(z.selectionSet,G,V)}))}var T=function(){var z=function(Y,V){return z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,Z){G.__proto__=Z}||function(G,Z){for(var Q in Z)Z.hasOwnProperty(Q)&&(G[Q]=Z[Q])},z(Y,V)};return function(Y,V){z(Y,V);function G(){this.constructor=Y}Y.prototype=V===null?Object.create(V):(G.prototype=V.prototype,new G)}}(),w=function(){return w=Object.assign||function(z){for(var Y,V=1,G=arguments.length;V<G;V++){Y=arguments[V];for(var Z in Y)Object.prototype.hasOwnProperty.call(Y,Z)&&(z[Z]=Y[Z])}return z},w.apply(this,arguments)},S=function(z,Y,V,G){function Z(Q){return Q instanceof V?Q:new V(function(Te){Te(Q)})}return new(V||(V=Promise))(function(Q,Te){function ze(be){try{ce(G.next(be))}catch(Ze){Te(Ze)}}function Ue(be){try{ce(G.throw(be))}catch(Ze){Te(Ze)}}function ce(be){be.done?Q(be.value):Z(be.value).then(ze,Ue)}ce((G=G.apply(z,Y||[])).next())})},A=function(z,Y){var V={label:0,sent:function(){if(Q[0]&1)throw Q[1];return Q[1]},trys:[],ops:[]},G,Z,Q,Te;return Te={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(Te[Symbol.iterator]=function(){return this}),Te;function ze(ce){return function(be){return Ue([ce,be])}}function Ue(ce){if(G)throw new TypeError("Generator is already executing.");for(;V;)try{if(G=1,Z&&(Q=ce[0]&2?Z.return:ce[0]?Z.throw||((Q=Z.return)&&Q.call(Z),0):Z.next)&&!(Q=Q.call(Z,ce[1])).done)return Q;switch(Z=0,Q&&(ce=[ce[0]&2,Q.value]),ce[0]){case 0:case 1:Q=ce;break;case 4:return V.label++,{value:ce[1],done:!1};case 5:V.label++,Z=ce[1],ce=[0];continue;case 7:ce=V.ops.pop(),V.trys.pop();continue;default:if(Q=V.trys,!(Q=Q.length>0&&Q[Q.length-1])&&(ce[0]===6||ce[0]===2)){V=0;continue}if(ce[0]===3&&(!Q||ce[1]>Q[0]&&ce[1]<Q[3])){V.label=ce[1];break}if(ce[0]===6&&V.label<Q[1]){V.label=Q[1],Q=ce;break}if(Q&&V.label<Q[2]){V.label=Q[2],V.ops.push(ce);break}Q[2]&&V.ops.pop(),V.trys.pop();continue}ce=Y.call(z,V)}catch(be){ce=[6,be],Z=0}finally{G=Q=0}if(ce[0]&5)throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}},P=function(){for(var z=0,Y=0,V=arguments.length;Y<V;Y++)z+=arguments[Y].length;for(var G=Array(z),Z=0,Y=0;Y<V;Y++)for(var Q=arguments[Y],Te=0,ze=Q.length;Te<ze;Te++,Z++)G[Z]=Q[Te];return G},F=function(z){var Y=z.replace(/\s/g,""),V=Y.replace(/\[(.*)\]/,function(G,Z,Q,Te){return((Z!=null&&Z.length)>0?Z:null)||Y});return V},L=function(z,Y,V,G){if(Array.isArray(z)){var Z=F(Y);return z.map(function(Q){return L(Q,Z,V,G)})}return z==null||typeof z=="number"||typeof z=="boolean"||typeof z=="string"?z:V(z,Y,V,G)},$=function(z){return z.directives&&z.directives.length?z.directives.find(function(Y){return Y.name.value==="rest"}):null};function X(z,Y,V,G,Z){return Z==null||Y==null||typeof Y=="number"||typeof Y=="boolean"||typeof Y=="string"||Z.selections.forEach(function(Q){if(i.isInlineFragment(Q))X(z,Y,V,G,Q.selectionSet);else if(Q.kind==="FragmentSpread"){var Te=G[Q.name.value];X(z,Y,V,G,Te.selectionSet)}else if(i.isField(Q)){var ze=i.resultKeyNameFromField(Q);ze===z&&$(Q)!=null?te(Y,V,G,Q.selectionSet):X(z,Y,V,G,Q.selectionSet)}else return function(Ue){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()}),Y}function te(z,Y,V,G){if(!(z==null||typeof z=="number"||typeof z=="boolean"||typeof z=="string")){if(Array.isArray(z)){z.forEach(function(Z){return te(Z,Y,V,G)});return}G.selections.forEach(function(Z){if(i.isInlineFragment(Z))te(z,Y,V,Z.selectionSet);else if(Z.kind==="FragmentSpread"){var Q=V[Z.name.value];te(z,Y,V,Q.selectionSet)}else if(i.isField(Z)){var Te=z[Z.name.value];Z.name.value==="__typename"||(typeof Te>"u"?z[Z.name.value]=null:Te!=null&&typeof Te=="object"&&Z.selectionSet!=null&&te(Te,Y,V,Z.selectionSet))}else return function(ze){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()})}}var he=function(z,Y){var V=z[Y||et]||z[et];return typeof V=="string"?{uri:V}:w({responseTransformer:null},V)},de=function(z,Y,V){return V===void 0||Y===void 0?z:z.replace(":"+Y,V)},Ve=function(){function z(){}return z.replacerForPath=function(Y){if(Y in z.cache)return z.cache[Y];var V=Y.indexOf("?"),G=Y.split(z.argReplacement),Z=[],Q=!1;G.reduce(function(ze,Ue){if(Ue===""||Ue==="{}")return ze+Ue.length;var ce=ze+Ue.length;if(Ue[0]==="{"&&Ue[Ue.length-1]==="}"){var be=Ue.slice(1,Ue.length-1).split(".");Z.push(function(Ze,Ot){try{var wt=Ae(Ze,be);return!Ot||typeof wt!="object"||wt==null?String(wt):a.stringify(wt)}catch{var Gt=[Y,be.join(".")].join("|");return Gt in z.warnTable||(console.warn("Warning: RestLink caught an error while unpacking",Gt,"This tends to happen if you forgot to pass a parameter needed for creating an @rest(path, or if RestLink was configured to deeply unpack a path parameter that wasn't provided. This message will only log once per detected instance. Trouble-shooting hint: check @rest(path: and the variables provided to this query."),z.warnTable[Gt]=!0),""}})}else Z.push(Ue),!Q&&ce>=V&&(Q=!0,Z.push(!0));return ce},0);var Te=function(ze){var Ue=!1,ce=Z.reduce(function(be,Ze){return typeof Ze=="string"?be+Ze:typeof Ze=="boolean"?(Ue=!0,be):be+Ze(ze,Ue)},"");return ce};return z.cache[Y]=Te},z.cache={},z.warnTable={},z.argReplacement=/({[._a-zA-Z0-9]*})/,z}();function Ae(z,Y){if(Y.length===0)return z;var V=P(Y),G=V.shift();return Ae(z[G],V)}var je=["__typename"],Ge=typeof globalThis=="object"&&globalThis||di,ye=function(z,Y,V){V===void 0&&(V=[]);var G=null;return Y.length!=2?G=function(Z,Q){return Y(Z)}:G=Y,Array.isArray(z)?z.map(function(Z,Q){return ye(Z,G,P(V,[String(Q)]))}):z==null||typeof z!="object"||z.constructor!==Object||Ge.FileList&&z instanceof FileList||Ge.File&&z instanceof File?z:Object.keys(z).reduce(function(Z,Q){var Te=z[Q];if(je.indexOf(Q)!==-1)return Z[Q]=Te,Z;var ze=P(V,[Q]);return Z[G(Q,ze)]=ye(Te,G,ze),Z},{})},Je=function(z){return z},ge=function(z){return z instanceof Headers?z:new Headers(z||{})},ue=function(){for(var z=[],Y=0;Y<arguments.length;Y++)z[Y]=arguments[Y];return z.reduce(function(V,G){return G&&(G.forEach||(G=ge(G)),G.forEach(function(Z,Q){V.append(Q,Z)})),V},new Headers)},Ee=function(z,Y,V){var G=new Headers;return z.forEach(function(Z,Q){Y.indexOf(Q)===-1&&G.append(Q,Z)}),ue(G,V||new Headers)},Ne=function(z){return function(Y,V){return Ee(Y,z,V)}},xe=["GET","POST","PUT","PATCH","DELETE"],Xe=function(z,Y){switch(Y){case"query":if(xe.indexOf(z.toUpperCase())!==-1)return;throw new Error('A "query" operation can only support "GET" requests but got "'+z+'".');case"mutation":if(xe.indexOf(z.toUpperCase())!==-1)return;throw new Error('"mutation" operations do not support that HTTP-verb');case"subscription":throw new Error('A "subscription" operation is not supported yet.');default:var V=Y;return V}},Et=function(z,Y,V){var G=new Error(V);throw G.response=z,G.statusCode=z.status,G.result=Y,G},lt=function(z,Y){return z==null||typeof z!="object"?z:Array.isArray(z)?z.map(function(V){return lt(V,Y)}):(z.__typename=Y,z)},It=function(z,Y,V,G,Z){return S(void 0,void 0,void 0,function(){var Q,Te,ze,Ue,ce,be,Ze,Ot,wt,Gt,pt,Lt,rr,Rr,zt,Jt,Zt,W,H,Be,$e,Tt,Ke,nr,fr,Dt,Ht,Ur,$r,ir,un,_r,xr,Sr,Or,ur,zr,Tr,Er,Dr,cn,Ln,R,se,me,ke,Le,at,nt,tt;return A(this,function(rt){switch(rt.label){case 0:if(Q=Z.directives,Te=Z.isLeaf,ze=Z.resultKey,Ue=G.exportVariablesByNode,ce=Ue.get(Y)||{},be=function(_t){return _t instanceof Array?_t.forEach(be):Ue.set(_t,w({},ce)),_t},Ze=(Y||{})[ze],Ot=(Y||{})[z],Y&&Q&&Q.export&&(ce[Q.export.as]=Ot),wt=Q&&Q.type,!Te&&wt){if(Q.rest)throw new Error("Invalid use of @type(name: ...) directive on a call that also has @rest(...)");return be(Ot),[2,lt(Ot,Q.type.name)]}if(Gt=!Q||!Q.rest,Gt)return[2,be(Ze||Ot)];if(pt=G.credentials,Lt=G.endpoints,rr=G.headers,Rr=G.customFetch,zt=G.operationType,Jt=G.typePatcher,Zt=G.mainDefinition,W=G.fragmentDefinitions,H=G.fieldNameNormalizer,Be=G.fieldNameDenormalizer,$e=G.serializers,Tt=G.responseTransformer,Ke=i.createFragmentMap(W),nr=Q.rest,fr=nr.path,Dt=nr.endpoint,Ht=nr.pathBuilder,Ur=he(Lt,Dt),$r=fr==null&&Ht==null,$r)throw new Error('One of ("path" | "pathBuilder") must be set in the @rest() directive. This request had neither, please add one');if(Ht||(fr.includes(":")?(console.warn("Deprecated: '@rest(path:' contains a ':' colon, this format will be removed in future versions"),Ht=function(_t){var b=_t.args,I=_t.exportVariables,k=w(w({},b),I),C=Object.keys(k).reduce(function(D,U){return de(D,U,k[U])},fr);if(C.includes(":"))throw new Error('Missing parameters to run query, specify it in the query params or use an export directive. (If you need to use ":" inside a variable string make sure to encode the variables properly using `encodeURIComponent`. Alternatively see documentation about using pathBuilder.)');return C}):Ht=Ve.replacerForPath(fr)),ir={args:V,exportVariables:ce,context:G,"@rest":Q.rest,replacer:Ht},un=Ht(ir),_r=Q.rest,xr=_r.method,Sr=_r.type,Or=_r.bodyBuilder,ur=_r.bodyKey,zr=_r.fieldNameDenormalizer,Tr=_r.fieldNameNormalizer,Er=_r.bodySerializer,xr||(xr="GET"),ur||(ur="input"),Dr=void 0,cn=void 0,["GET","DELETE"].indexOf(xr)===-1){if(!Or){if(Ln=ir.exportVariables[ur]||ir.args&&ir.args[ur],!Ln)throw new Error("[GraphQL "+xr+" "+zt+" using a REST call without a body]. No `"+ur+"` was detected. Pass bodyKey, or bodyBuilder to the @rest() directive to resolve this.");Or=function(_t){return Ln}}if(Dr=ye(Or(ir),zr||Be||Je),R=void 0,typeof Er=="string"){if(!$e.hasOwnProperty(Er))throw new Error('"bodySerializer" must correspond to configured serializer. '+("Please make sure to specify a serializer called "+Er+' in the "bodySerializers" property of the RestLink.'));R=$e[Er](Dr,rr)}else R=Er?Er(Dr,rr):$e[Ye](Dr,rr);Dr=R.body,cn=new Headers(R.headers)}return Xe(xr,zt||"query"),se=w({method:xr,headers:cn||rr,body:Dr},pt?{credentials:pt}:{}),me=""+Ur.uri+un,[4,(Rr||fetch)(me,se)];case 1:return ke=rt.sent(),G.responses.push(ke),ke.ok?(ke.status===204||ke.headers.get("Content-Length")==="0"?Le={}:Le=ke,[3,9]):[3,2];case 2:return ke.status!==404?[3,3]:(Le=null,[3,9]);case 3:at=void 0,rt.label=4;case 4:return rt.trys.push([4,6,,8]),[4,ke.clone().json()];case 5:return at=rt.sent(),[3,8];case 6:return rt.sent(),[4,ke.clone().text()];case 7:return at=rt.sent(),[3,8];case 8:Et(ke,at,"Response not successful: Received status code "+ke.status),rt.label=9;case 9:if(nt=Ur.responseTransformer||Tt,!nt)return[3,14];rt.label=10;case 10:return rt.trys.push([10,12,,13]),[4,nt(Le,Sr)];case 11:return Le=rt.sent(),[3,13];case 12:throw tt=rt.sent(),console.warn("An error occurred in a responseTransformer:"),tt;case 13:return[3,16];case 14:return Le&&Le.json?[4,Le.json()]:[3,16];case 15:Le=rt.sent(),rt.label=16;case 16:return Le=ye(Le,Tr||H||Je),Le=X(ze,Le,Zt,Ke,Zt.selectionSet),Le=L(Le,Sr,Jt,{resolverParams:{fieldName:z,root:Y,args:V,context:G,info:Z}}),[2,be(Le)]}})})},et="",Ye="",dt=function(z,Y){return Y.has("content-type")||Y.append("Content-Type","application/json"),{body:JSON.stringify(z),headers:Y}},Re={test:function(z){return z.name.value==="rest"},remove:!0},bt=function(z){T(Y,z);function Y(V){var G,Z=V.uri,Q=V.endpoints,Te=V.headers,ze=V.fieldNameNormalizer,Ue=V.fieldNameDenormalizer,ce=V.typePatcher,be=V.customFetch,Ze=V.credentials,Ot=V.bodySerializers,wt=V.defaultSerializer,Gt=V.responseTransformer,pt=z.call(this)||this,Lt={};if(Lt[et]=Z||"",pt.endpoints=Object.assign({},Q||Lt),Z==null&&Q==null)throw new Error("A RestLink must be initialized with either 1 uri, or a map of keyed-endpoints");if(Z!=null){var rr=(Q||{})[et];if(rr!=null&&rr!=Z)throw new Error("RestLink was configured with a default uri that doesn't match what's passed in to the endpoints map.");pt.endpoints[et]=Z}if(pt.endpoints[et]==null&&console.warn("RestLink configured without a default URI. All @rest(…) directives must provide an endpoint key!"),ce==null)pt.typePatcher=function(zt,Jt,Zt){return w({__typename:Jt},zt)};else if(!Array.isArray(ce)&&typeof ce=="object"&&Object.keys(ce).map(function(zt){return ce[zt]}).reduce(function(zt,Jt){return zt&&typeof Jt=="function"},!0)){var Rr=ce;pt.typePatcher=function(zt,Jt,Zt,W){var H=zt.__typename||Jt;if(Array.isArray(zt))return zt.map(function($e){return Zt($e,H,Zt,W)});var Be=Rr[H]||function($e){return $e};return w({__typename:H},Be(zt,H,Zt,W))}}else throw new Error("RestLink was configured with a typePatcher of invalid type!");return Ot&&Ot.hasOwnProperty(Ye)&&console.warn("RestLink was configured to override the default serializer! This may result in unexpected behavior"),pt.responseTransformer=Gt||null,pt.fieldNameNormalizer=ze||null,pt.fieldNameDenormalizer=Ue||null,pt.headers=ge(Te),pt.credentials=Ze||null,pt.customFetch=be,pt.serializers=w((G={},G[Ye]=wt||dt,G),Ot||{}),pt.processedDocuments=new Map,pt}return Y.prototype.removeRestSetsFromDocument=function(V){var G=this.processedDocuments.get(V);if(G)return G;i.checkDocument(V);var Z=i.removeDirectivesFromDocument([Re],V);return this.processedDocuments.set(V,Z),Z},Y.prototype.request=function(V,G){var Z=V.query,Q=V.variables,Te=V.getContext,ze=V.setContext,Ue=Te(),ce=i.hasDirectives(["rest"],Z);if(!ce)return G(V);var be=this.removeRestSetsFromDocument(Z),Ze=Ue.headersMergePolicy;Ze==null&&Array.isArray(Ue.headersToOverride)?Ze=Ne(Ue.headersToOverride):Ze==null&&(Ze=ue);var Ot=Ze(this.headers,Ue.headers);Ot.has("Accept")||Ot.append("Accept","application/json");var wt=Ue.credentials||this.credentials,Gt=i.addTypenameToDocument(Z),pt=i.getMainDefinition(Z),Lt=i.getFragmentDefinitions(Z),rr=(pt||{}).operation||"query",Rr={headers:Ot,endpoints:this.endpoints,exportVariablesByNode:new Map,credentials:wt,customFetch:this.customFetch,operationType:rr,fieldNameNormalizer:this.fieldNameNormalizer,fieldNameDenormalizer:this.fieldNameDenormalizer,mainDefinition:pt,fragmentDefinitions:Lt,typePatcher:this.typePatcher,serializers:this.serializers,responses:[],responseTransformer:this.responseTransformer},zt={},Jt;return be&&G?(V.query=be,Jt=G(V)):Jt=n.Observable.of({data:{}}),Jt.flatMap(function(Zt){var W=Zt.data,H=Zt.errors;return new n.Observable(function(Be){y(It,Gt,W,Rr,Q,zt).then(function($e){ze({restResponses:(Ue.restResponses||[]).concat(Rr.responses)}),Be.next({data:$e,errors:H}),Be.complete()}).catch(function($e){$e.name!=="AbortError"&&($e.result&&$e.result.errors&&Be.next($e.result),Be.error($e))})})})},Y}(n.ApolloLink);t.RestLink=bt,t.PathBuilder=Ve,Object.defineProperty(t,"__esModule",{value:!0})})})(rh,rh.exports);var FA=rh.exports;const Ju=ve.createContext(),I0=ve.createContext(),MA=()=>{const{urls:r}=Xn(),{children:e}=ve.useContext(Ju),t=Hn.useNavigate(),[n,i]=ve.useState(!1),a=!!window.parent;Hn.useBlocker(({nextLocation:f})=>{var h;return a?(h=f.state)!=null&&h.fromParent?(i(!0),!1):(u(`${f.pathname}${f.search}`),!0):!1}),ve.useEffect(()=>{if(!a)return;const f=h=>{h.metaKey&&h.key==="k"&&window.parent.postMessage({type:"open-search"},r.appUrl)};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}},[]),ve.useEffect(()=>{if(!a)return;const f=({origin:h,data:d})=>{if(h===r.appUrl)switch(d.type){case"navigate":t(d.path,{replace:!0,state:{fromParent:!0}});break}};return window.addEventListener("message",f),n||window.parent.postMessage({type:"ready"},r.appUrl),()=>{window.removeEventListener("message",f)}},[t,n]);const u=f=>{n&&window.parent.postMessage({type:"set-path",path:f},r.appUrl)},c=ve.useMemo(()=>({isEmbedded:a,navigateParent:u}),[a,u]);return Mr.jsx(I0.Provider,{value:c,children:e})},LA=()=>{const{urls:r,jwtRef:e,accessToken:t}=Xn(),{graphQLRoleOverride:n,children:i}=ve.useContext(Ju),[a,u]=ve.useState(),[c,f]=ve.useState(),h=()=>{const g=new URL(r.graphQLUrl);return`//${g.host}${g.pathname}`},d=()=>n?{"X-Hasura-Role":n}:{};ve.useEffect(()=>{const g=new iA(cA({url:`wss:${h()}`,lazy:!0,reconnect:!0,connectionParams:async()=>({headers:{Authorization:`Bearer ${e.current}`,...d()}})})),m=Kv(({operation:P,networkError:F,forward:L})=>(Vi(P.query).operation==="subscription"&&F&&g.client.terminate(),L(P))),T=Yv(async(P,{headers:F})=>({headers:{...F,Authorization:`Bearer ${e.current}`,...d()}})).concat(Zl({uri:`https:${h()}`,fetch:window.fetch})),w=m.split(({query:P})=>{const F=Vi(P);return F.kind==="OperationDefinition"&&F.operation==="subscription"},g,T),A=Yv(async(P,{headers:F})=>({headers:{...F,Authorization:`Bearer ${t}`}})).concat(new FA.RestLink({uri:r.apiUrl}));f(Jr.from([A,w]))},[]),ve.useEffect(()=>{c&&u(new _f({link:c,cache:new yf}))},[c]);const y=ve.useMemo(()=>({link:c}),[c]);return Mr.jsx(kv.Provider,{value:y,children:a&&Mr.jsx(bO,{client:a,children:Mr.jsx(MA,{children:i})})})},qA=bp.div`
131
+ `+H.prev}function Zt(W,H){var Be=lt(W),$e=[];if(Be){$e.length=W.length;for(var Tt=0;Tt<W.length;Tt++)$e[Tt]=G(W,Tt)?H(W[Tt],W):""}var Ke=typeof Ae=="function"?Ae(W):[],nr;if(Ge){nr={};for(var fr=0;fr<Ke.length;fr++)nr["$"+Ke[fr]]=Ke[fr]}for(var Dt in W)G(W,Dt)&&(Be&&String(Number(Dt))===Dt&&Dt<W.length||Ge&&nr["$"+Dt]instanceof Symbol||($.call(/[^\w$]/,Dt)?$e.push(H(Dt,W)+": "+H(W[Dt],W)):$e.push(Dt+": "+H(W[Dt],W))));if(typeof Ae=="function")for(var Ht=0;Ht<Ke.length;Ht++)Je.call(W,Ke[Ht])&&$e.push("["+H(Ke[Ht])+"]: "+H(W[Ke[Ht]],W));return $e}return Th}var Ah,x0;function CA(){if(x0)return Ah;x0=1;var r=la(),e=kA(),t=PA(),n=bo(),i=r("%WeakMap%",!0),a=r("%Map%",!0),u=e("WeakMap.prototype.get",!0),c=e("WeakMap.prototype.set",!0),f=e("WeakMap.prototype.has",!0),h=e("Map.prototype.get",!0),d=e("Map.prototype.set",!0),y=e("Map.prototype.has",!0),g=function(w,S){for(var A=w,P;(P=A.next)!==null;A=P)if(P.key===S)return A.next=P.next,P.next=w.next,w.next=P,P},m=function(w,S){var A=g(w,S);return A&&A.value},x=function(w,S,A){var P=g(w,S);P?P.value=A:w.next={key:S,next:w.next,value:A}},T=function(w,S){return!!g(w,S)};return Ah=function(){var S,A,P,F={assert:function(L){if(!F.has(L))throw new n("Side channel does not contain "+t(L))},get:function(L){if(i&&L&&(typeof L=="object"||typeof L=="function")){if(S)return u(S,L)}else if(a){if(A)return h(A,L)}else if(P)return m(P,L)},has:function(L){if(i&&L&&(typeof L=="object"||typeof L=="function")){if(S)return f(S,L)}else if(a){if(A)return y(A,L)}else if(P)return T(P,L);return!1},set:function(L,$){i&&L&&(typeof L=="object"||typeof L=="function")?(S||(S=new i),c(S,L,$)):a?(A||(A=new a),d(A,L,$)):(P||(P={key:{},next:null}),x(P,L,$))}};return F},Ah}var kh,S0;function Ih(){if(S0)return kh;S0=1;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return kh={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},kh}var Ph,E0;function O0(){if(E0)return Ph;E0=1;var r=Ih(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var w=[],S=0;S<256;++S)w.push("%"+((S<16?"0":"")+S.toString(16)).toUpperCase());return w}(),i=function(S){for(;S.length>1;){var A=S.pop(),P=A.obj[A.prop];if(t(P)){for(var F=[],L=0;L<P.length;++L)typeof P[L]<"u"&&F.push(P[L]);A.obj[A.prop]=F}}},a=function(S,A){for(var P=A&&A.plainObjects?Object.create(null):{},F=0;F<S.length;++F)typeof S[F]<"u"&&(P[F]=S[F]);return P},u=function w(S,A,P){if(!A)return S;if(typeof A!="object"){if(t(S))S.push(A);else if(S&&typeof S=="object")(P&&(P.plainObjects||P.allowPrototypes)||!e.call(Object.prototype,A))&&(S[A]=!0);else return[S,A];return S}if(!S||typeof S!="object")return[S].concat(A);var F=S;return t(S)&&!t(A)&&(F=a(S,P)),t(S)&&t(A)?(A.forEach(function(L,$){if(e.call(S,$)){var X=S[$];X&&typeof X=="object"&&L&&typeof L=="object"?S[$]=w(X,L,P):S.push(L)}else S[$]=L}),S):Object.keys(A).reduce(function(L,$){var X=A[$];return e.call(L,$)?L[$]=w(L[$],X,P):L[$]=X,L},F)},c=function(S,A){return Object.keys(A).reduce(function(P,F){return P[F]=A[F],P},S)},f=function(w,S,A){var P=w.replace(/\+/g," ");if(A==="iso-8859-1")return P.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(P)}catch{return P}},h=1024,d=function(S,A,P,F,L){if(S.length===0)return S;var $=S;if(typeof S=="symbol"?$=Symbol.prototype.toString.call(S):typeof S!="string"&&($=String(S)),P==="iso-8859-1")return escape($).replace(/%u[0-9a-f]{4}/gi,function(je){return"%26%23"+parseInt(je.slice(2),16)+"%3B"});for(var X="",te=0;te<$.length;te+=h){for(var he=$.length>=h?$.slice(te,te+h):$,de=[],Ve=0;Ve<he.length;++Ve){var Ae=he.charCodeAt(Ve);if(Ae===45||Ae===46||Ae===95||Ae===126||Ae>=48&&Ae<=57||Ae>=65&&Ae<=90||Ae>=97&&Ae<=122||L===r.RFC1738&&(Ae===40||Ae===41)){de[de.length]=he.charAt(Ve);continue}if(Ae<128){de[de.length]=n[Ae];continue}if(Ae<2048){de[de.length]=n[192|Ae>>6]+n[128|Ae&63];continue}if(Ae<55296||Ae>=57344){de[de.length]=n[224|Ae>>12]+n[128|Ae>>6&63]+n[128|Ae&63];continue}Ve+=1,Ae=65536+((Ae&1023)<<10|he.charCodeAt(Ve)&1023),de[de.length]=n[240|Ae>>18]+n[128|Ae>>12&63]+n[128|Ae>>6&63]+n[128|Ae&63]}X+=de.join("")}return X},y=function(S){for(var A=[{obj:{o:S},prop:"o"}],P=[],F=0;F<A.length;++F)for(var L=A[F],$=L.obj[L.prop],X=Object.keys($),te=0;te<X.length;++te){var he=X[te],de=$[he];typeof de=="object"&&de!==null&&P.indexOf(de)===-1&&(A.push({obj:$,prop:he}),P.push(de))}return i(A),S},g=function(S){return Object.prototype.toString.call(S)==="[object RegExp]"},m=function(S){return!S||typeof S!="object"?!1:!!(S.constructor&&S.constructor.isBuffer&&S.constructor.isBuffer(S))},x=function(S,A){return[].concat(S,A)},T=function(S,A){if(t(S)){for(var P=[],F=0;F<S.length;F+=1)P.push(A(S[F]));return P}return A(S)};return Ph={arrayToObject:a,assign:c,combine:x,compact:y,decode:f,encode:d,isBuffer:m,isRegExp:g,maybeMap:T,merge:u},Ph}var Ch,T0;function NA(){if(T0)return Ch;T0=1;var r=CA(),e=O0(),t=Ih(),n=Object.prototype.hasOwnProperty,i={brackets:function(w){return w+"[]"},comma:"comma",indices:function(w,S){return w+"["+S+"]"},repeat:function(w){return w}},a=Array.isArray,u=Array.prototype.push,c=function(T,w){u.apply(T,a(w)?w:[w])},f=Date.prototype.toISOString,h=t.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:h,formatter:t.formatters[h],indices:!1,serializeDate:function(w){return f.call(w)},skipNulls:!1,strictNullHandling:!1},y=function(w){return typeof w=="string"||typeof w=="number"||typeof w=="boolean"||typeof w=="symbol"||typeof w=="bigint"},g={},m=function T(w,S,A,P,F,L,$,X,te,he,de,Ve,Ae,je,Ge,ye,Je,ge){for(var ue=w,Ee=ge,Ne=0,xe=!1;(Ee=Ee.get(g))!==void 0&&!xe;){var Xe=Ee.get(w);if(Ne+=1,typeof Xe<"u"){if(Xe===Ne)throw new RangeError("Cyclic object value");xe=!0}typeof Ee.get(g)>"u"&&(Ne=0)}if(typeof he=="function"?ue=he(S,ue):ue instanceof Date?ue=Ae(ue):A==="comma"&&a(ue)&&(ue=e.maybeMap(ue,function(Z){return Z instanceof Date?Ae(Z):Z})),ue===null){if(L)return te&&!ye?te(S,d.encoder,Je,"key",je):S;ue=""}if(y(ue)||e.isBuffer(ue)){if(te){var Et=ye?S:te(S,d.encoder,Je,"key",je);return[Ge(Et)+"="+Ge(te(ue,d.encoder,Je,"value",je))]}return[Ge(S)+"="+Ge(String(ue))]}var lt=[];if(typeof ue>"u")return lt;var It;if(A==="comma"&&a(ue))ye&&te&&(ue=e.maybeMap(ue,te)),It=[{value:ue.length>0?ue.join(",")||null:void 0}];else if(a(he))It=he;else{var et=Object.keys(ue);It=de?et.sort(de):et}var Ye=X?S.replace(/\./g,"%2E"):S,dt=P&&a(ue)&&ue.length===1?Ye+"[]":Ye;if(F&&a(ue)&&ue.length===0)return dt+"[]";for(var Re=0;Re<It.length;++Re){var bt=It[Re],z=typeof bt=="object"&&typeof bt.value<"u"?bt.value:ue[bt];if(!($&&z===null)){var Y=Ve&&X?bt.replace(/\./g,"%2E"):bt,V=a(ue)?typeof A=="function"?A(dt,Y):dt:dt+(Ve?"."+Y:"["+Y+"]");ge.set(w,Ne);var G=r();G.set(g,ge),c(lt,T(z,V,A,P,F,L,$,X,A==="comma"&&ye&&a(ue)?null:te,he,de,Ve,Ae,je,Ge,ye,Je,G))}}return lt},x=function(w){if(!w)return d;if(typeof w.allowEmptyArrays<"u"&&typeof w.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof w.encodeDotInKeys<"u"&&typeof w.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(w.encoder!==null&&typeof w.encoder<"u"&&typeof w.encoder!="function")throw new TypeError("Encoder has to be a function.");var S=w.charset||d.charset;if(typeof w.charset<"u"&&w.charset!=="utf-8"&&w.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var A=t.default;if(typeof w.format<"u"){if(!n.call(t.formatters,w.format))throw new TypeError("Unknown format option provided.");A=w.format}var P=t.formatters[A],F=d.filter;(typeof w.filter=="function"||a(w.filter))&&(F=w.filter);var L;if(w.arrayFormat in i?L=w.arrayFormat:"indices"in w?L=w.indices?"indices":"repeat":L=d.arrayFormat,"commaRoundTrip"in w&&typeof w.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var $=typeof w.allowDots>"u"?w.encodeDotInKeys===!0?!0:d.allowDots:!!w.allowDots;return{addQueryPrefix:typeof w.addQueryPrefix=="boolean"?w.addQueryPrefix:d.addQueryPrefix,allowDots:$,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:L,charset:S,charsetSentinel:typeof w.charsetSentinel=="boolean"?w.charsetSentinel:d.charsetSentinel,commaRoundTrip:w.commaRoundTrip,delimiter:typeof w.delimiter>"u"?d.delimiter:w.delimiter,encode:typeof w.encode=="boolean"?w.encode:d.encode,encodeDotInKeys:typeof w.encodeDotInKeys=="boolean"?w.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof w.encoder=="function"?w.encoder:d.encoder,encodeValuesOnly:typeof w.encodeValuesOnly=="boolean"?w.encodeValuesOnly:d.encodeValuesOnly,filter:F,format:A,formatter:P,serializeDate:typeof w.serializeDate=="function"?w.serializeDate:d.serializeDate,skipNulls:typeof w.skipNulls=="boolean"?w.skipNulls:d.skipNulls,sort:typeof w.sort=="function"?w.sort:null,strictNullHandling:typeof w.strictNullHandling=="boolean"?w.strictNullHandling:d.strictNullHandling}};return Ch=function(T,w){var S=T,A=x(w),P,F;typeof A.filter=="function"?(F=A.filter,S=F("",S)):a(A.filter)&&(F=A.filter,P=F);var L=[];if(typeof S!="object"||S===null)return"";var $=i[A.arrayFormat],X=$==="comma"&&A.commaRoundTrip;P||(P=Object.keys(S)),A.sort&&P.sort(A.sort);for(var te=r(),he=0;he<P.length;++he){var de=P[he];A.skipNulls&&S[de]===null||c(L,m(S[de],de,$,X,A.allowEmptyArrays,A.strictNullHandling,A.skipNulls,A.encodeDotInKeys,A.encode?A.encoder:null,A.filter,A.sort,A.allowDots,A.serializeDate,A.format,A.formatter,A.encodeValuesOnly,A.charset,te))}var Ve=L.join(A.delimiter),Ae=A.addQueryPrefix===!0?"?":"";return A.charsetSentinel&&(A.charset==="iso-8859-1"?Ae+="utf8=%26%2310003%3B&":Ae+="utf8=%E2%9C%93&"),Ve.length>0?Ae+Ve:""},Ch}var Nh,A0;function RA(){if(A0)return Nh;A0=1;var r=O0(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(g){return g.replace(/&#(\d+);/g,function(m,x){return String.fromCharCode(parseInt(x,10))})},a=function(g,m){return g&&typeof g=="string"&&m.comma&&g.indexOf(",")>-1?g.split(","):g},u="utf8=%26%2310003%3B",c="utf8=%E2%9C%93",f=function(m,x){var T={__proto__:null},w=x.ignoreQueryPrefix?m.replace(/^\?/,""):m;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var S=x.parameterLimit===1/0?void 0:x.parameterLimit,A=w.split(x.delimiter,S),P=-1,F,L=x.charset;if(x.charsetSentinel)for(F=0;F<A.length;++F)A[F].indexOf("utf8=")===0&&(A[F]===c?L="utf-8":A[F]===u&&(L="iso-8859-1"),P=F,F=A.length);for(F=0;F<A.length;++F)if(F!==P){var $=A[F],X=$.indexOf("]="),te=X===-1?$.indexOf("="):X+1,he,de;te===-1?(he=x.decoder($,n.decoder,L,"key"),de=x.strictNullHandling?null:""):(he=x.decoder($.slice(0,te),n.decoder,L,"key"),de=r.maybeMap(a($.slice(te+1),x),function(Ae){return x.decoder(Ae,n.decoder,L,"value")})),de&&x.interpretNumericEntities&&L==="iso-8859-1"&&(de=i(de)),$.indexOf("[]=")>-1&&(de=t(de)?[de]:de);var Ve=e.call(T,he);Ve&&x.duplicates==="combine"?T[he]=r.combine(T[he],de):(!Ve||x.duplicates==="last")&&(T[he]=de)}return T},h=function(g,m,x,T){for(var w=T?m:a(m,x),S=g.length-1;S>=0;--S){var A,P=g[S];if(P==="[]"&&x.parseArrays)A=x.allowEmptyArrays&&(w===""||x.strictNullHandling&&w===null)?[]:[].concat(w);else{A=x.plainObjects?Object.create(null):{};var F=P.charAt(0)==="["&&P.charAt(P.length-1)==="]"?P.slice(1,-1):P,L=x.decodeDotInKeys?F.replace(/%2E/g,"."):F,$=parseInt(L,10);!x.parseArrays&&L===""?A={0:w}:!isNaN($)&&P!==L&&String($)===L&&$>=0&&x.parseArrays&&$<=x.arrayLimit?(A=[],A[$]=w):L!=="__proto__"&&(A[L]=w)}w=A}return w},d=function(m,x,T,w){if(m){var S=T.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m,A=/(\[[^[\]]*])/,P=/(\[[^[\]]*])/g,F=T.depth>0&&A.exec(S),L=F?S.slice(0,F.index):S,$=[];if(L){if(!T.plainObjects&&e.call(Object.prototype,L)&&!T.allowPrototypes)return;$.push(L)}for(var X=0;T.depth>0&&(F=P.exec(S))!==null&&X<T.depth;){if(X+=1,!T.plainObjects&&e.call(Object.prototype,F[1].slice(1,-1))&&!T.allowPrototypes)return;$.push(F[1])}return F&&$.push("["+S.slice(F.index)+"]"),h($,x,T,w)}},y=function(m){if(!m)return n;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var x=typeof m.charset>"u"?n.charset:m.charset,T=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(T!=="combine"&&T!=="first"&&T!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:w,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:n.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:n.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:n.arrayLimit,charset:x,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:n.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:n.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:n.decoder,delimiter:typeof m.delimiter=="string"||r.isRegExp(m.delimiter)?m.delimiter:n.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:n.depth,duplicates:T,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:n.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:n.plainObjects,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling}};return Nh=function(g,m){var x=y(m);if(g===""||g===null||typeof g>"u")return x.plainObjects?Object.create(null):{};for(var T=typeof g=="string"?f(g,x):g,w=x.plainObjects?Object.create(null):{},S=Object.keys(T),A=0;A<S.length;++A){var P=S[A],F=d(P,T[P],x,typeof g=="string");w=r.merge(w,F,x)}return x.allowSparse===!0?w:r.compact(w)},Nh}var Rh,k0;function DA(){if(k0)return Rh;k0=1;var r=NA(),e=RA(),t=Ih();return Rh={formats:t,parse:e,stringify:r},Rh}(function(r,e){(function(t,n){n(e,hA,dA,DA())})(di,function(t,n,i,a){var u=function(z,Y,V,G){function Z(Q){return Q instanceof V?Q:new V(function(Te){Te(Q)})}return new(V||(V=Promise))(function(Q,Te){function ze(be){try{ce(G.next(be))}catch(Ze){Te(Ze)}}function Ue(be){try{ce(G.throw(be))}catch(Ze){Te(Ze)}}function ce(be){be.done?Q(be.value):Z(be.value).then(ze,Ue)}ce((G=G.apply(z,Y||[])).next())})},c=function(z,Y){var V={label:0,sent:function(){if(Q[0]&1)throw Q[1];return Q[1]},trys:[],ops:[]},G,Z,Q,Te;return Te={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(Te[Symbol.iterator]=function(){return this}),Te;function ze(ce){return function(be){return Ue([ce,be])}}function Ue(ce){if(G)throw new TypeError("Generator is already executing.");for(;V;)try{if(G=1,Z&&(Q=ce[0]&2?Z.return:ce[0]?Z.throw||((Q=Z.return)&&Q.call(Z),0):Z.next)&&!(Q=Q.call(Z,ce[1])).done)return Q;switch(Z=0,Q&&(ce=[ce[0]&2,Q.value]),ce[0]){case 0:case 1:Q=ce;break;case 4:return V.label++,{value:ce[1],done:!1};case 5:V.label++,Z=ce[1],ce=[0];continue;case 7:ce=V.ops.pop(),V.trys.pop();continue;default:if(Q=V.trys,!(Q=Q.length>0&&Q[Q.length-1])&&(ce[0]===6||ce[0]===2)){V=0;continue}if(ce[0]===3&&(!Q||ce[1]>Q[0]&&ce[1]<Q[3])){V.label=ce[1];break}if(ce[0]===6&&V.label<Q[1]){V.label=Q[1],Q=ce;break}if(Q&&V.label<Q[2]){V.label=Q[2],V.ops.push(ce);break}Q[2]&&V.ops.pop(),V.trys.pop();continue}ce=Y.call(z,V)}catch(be){ce=[6,be],Z=0}finally{G=Q=0}if(ce[0]&5)throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}};function f(z,Y){if(z.directives&&z.directives.length){var V={};return z.directives.forEach(function(G){V[G.name.value]=i.argumentsObjectFromField(G,Y)}),V}return null}var h=Object.prototype.hasOwnProperty;function d(z,Y){Y!==null&&typeof Y=="object"&&Object.keys(Y).forEach(function(V){var G=Y[V];h.call(z,V)?d(z[V],G):z[V]=G})}function y(z,Y,V,G,Z,Q){Q===void 0&&(Q={});var Te=i.getMainDefinition(Y),ze=i.getFragmentDefinitions(Y),Ue=i.createFragmentMap(ze),ce=Q.resultMapper,be=Q.fragmentMatcher||function(){return!0},Ze={fragmentMap:Ue,contextValue:G,variableValues:Z,resultMapper:ce,resolver:z,fragmentMatcher:be};return g(Te.selectionSet,V,Ze)}function g(z,Y,V){return u(this,void 0,void 0,function(){var G,Z,Q,Te,ze,Ue=this;return c(this,function(ce){switch(ce.label){case 0:return G=V.fragmentMap,Z=V.contextValue,Q=V.variableValues,Te={},ze=function(be){return u(Ue,void 0,void 0,function(){var Ze,Ot,wt,Gt,pt;return c(this,function(Lt){switch(Lt.label){case 0:return i.shouldInclude(be,Q)?i.isField(be)?[4,m(be,Y,V)]:[3,2]:[2];case 1:return Ze=Lt.sent(),Ot=i.resultKeyNameFromField(be),Ze!==void 0&&(Te[Ot]===void 0?Te[Ot]=Ze:d(Te[Ot],Ze)),[2];case 2:if(i.isInlineFragment(be))wt=be;else if(wt=G[be.name.value],!wt)throw new Error("No fragment named "+be.name.value);return Gt=wt.typeCondition.name.value,V.fragmentMatcher(Y,Gt,Z)?[4,g(wt.selectionSet,Y,V)]:[3,4];case 3:pt=Lt.sent(),d(Te,pt),Lt.label=4;case 4:return[2]}})})},[4,Promise.all(z.selections.map(ze))];case 1:return ce.sent(),V.resultMapper?[2,V.resultMapper(Te,Y)]:[2,Te]}})})}function m(z,Y,V){return u(this,void 0,void 0,function(){var G,Z,Q,Te,ze,Ue,ce;return c(this,function(be){switch(be.label){case 0:return G=V.variableValues,Z=V.contextValue,Q=V.resolver,Te=z.name.value,ze=i.argumentsObjectFromField(z,G),Ue={isLeaf:!z.selectionSet,resultKey:i.resultKeyNameFromField(z),directives:f(z,G),field:z},[4,Q(Te,Y,ze,Z,Ue)];case 1:return ce=be.sent(),z.selectionSet?ce==null?[2,ce]:Array.isArray(ce)?[2,x(z,ce,V)]:[2,g(z.selectionSet,ce,V)]:[2,ce]}})})}function x(z,Y,V){return Promise.all(Y.map(function(G){return G===null?null:Array.isArray(G)?x(z,G,V):g(z.selectionSet,G,V)}))}var T=function(){var z=function(Y,V){return z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,Z){G.__proto__=Z}||function(G,Z){for(var Q in Z)Z.hasOwnProperty(Q)&&(G[Q]=Z[Q])},z(Y,V)};return function(Y,V){z(Y,V);function G(){this.constructor=Y}Y.prototype=V===null?Object.create(V):(G.prototype=V.prototype,new G)}}(),w=function(){return w=Object.assign||function(z){for(var Y,V=1,G=arguments.length;V<G;V++){Y=arguments[V];for(var Z in Y)Object.prototype.hasOwnProperty.call(Y,Z)&&(z[Z]=Y[Z])}return z},w.apply(this,arguments)},S=function(z,Y,V,G){function Z(Q){return Q instanceof V?Q:new V(function(Te){Te(Q)})}return new(V||(V=Promise))(function(Q,Te){function ze(be){try{ce(G.next(be))}catch(Ze){Te(Ze)}}function Ue(be){try{ce(G.throw(be))}catch(Ze){Te(Ze)}}function ce(be){be.done?Q(be.value):Z(be.value).then(ze,Ue)}ce((G=G.apply(z,Y||[])).next())})},A=function(z,Y){var V={label:0,sent:function(){if(Q[0]&1)throw Q[1];return Q[1]},trys:[],ops:[]},G,Z,Q,Te;return Te={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(Te[Symbol.iterator]=function(){return this}),Te;function ze(ce){return function(be){return Ue([ce,be])}}function Ue(ce){if(G)throw new TypeError("Generator is already executing.");for(;V;)try{if(G=1,Z&&(Q=ce[0]&2?Z.return:ce[0]?Z.throw||((Q=Z.return)&&Q.call(Z),0):Z.next)&&!(Q=Q.call(Z,ce[1])).done)return Q;switch(Z=0,Q&&(ce=[ce[0]&2,Q.value]),ce[0]){case 0:case 1:Q=ce;break;case 4:return V.label++,{value:ce[1],done:!1};case 5:V.label++,Z=ce[1],ce=[0];continue;case 7:ce=V.ops.pop(),V.trys.pop();continue;default:if(Q=V.trys,!(Q=Q.length>0&&Q[Q.length-1])&&(ce[0]===6||ce[0]===2)){V=0;continue}if(ce[0]===3&&(!Q||ce[1]>Q[0]&&ce[1]<Q[3])){V.label=ce[1];break}if(ce[0]===6&&V.label<Q[1]){V.label=Q[1],Q=ce;break}if(Q&&V.label<Q[2]){V.label=Q[2],V.ops.push(ce);break}Q[2]&&V.ops.pop(),V.trys.pop();continue}ce=Y.call(z,V)}catch(be){ce=[6,be],Z=0}finally{G=Q=0}if(ce[0]&5)throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}},P=function(){for(var z=0,Y=0,V=arguments.length;Y<V;Y++)z+=arguments[Y].length;for(var G=Array(z),Z=0,Y=0;Y<V;Y++)for(var Q=arguments[Y],Te=0,ze=Q.length;Te<ze;Te++,Z++)G[Z]=Q[Te];return G},F=function(z){var Y=z.replace(/\s/g,""),V=Y.replace(/\[(.*)\]/,function(G,Z,Q,Te){return((Z!=null&&Z.length)>0?Z:null)||Y});return V},L=function(z,Y,V,G){if(Array.isArray(z)){var Z=F(Y);return z.map(function(Q){return L(Q,Z,V,G)})}return z==null||typeof z=="number"||typeof z=="boolean"||typeof z=="string"?z:V(z,Y,V,G)},$=function(z){return z.directives&&z.directives.length?z.directives.find(function(Y){return Y.name.value==="rest"}):null};function X(z,Y,V,G,Z){return Z==null||Y==null||typeof Y=="number"||typeof Y=="boolean"||typeof Y=="string"||Z.selections.forEach(function(Q){if(i.isInlineFragment(Q))X(z,Y,V,G,Q.selectionSet);else if(Q.kind==="FragmentSpread"){var Te=G[Q.name.value];X(z,Y,V,G,Te.selectionSet)}else if(i.isField(Q)){var ze=i.resultKeyNameFromField(Q);ze===z&&$(Q)!=null?te(Y,V,G,Q.selectionSet):X(z,Y,V,G,Q.selectionSet)}else return function(Ue){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()}),Y}function te(z,Y,V,G){if(!(z==null||typeof z=="number"||typeof z=="boolean"||typeof z=="string")){if(Array.isArray(z)){z.forEach(function(Z){return te(Z,Y,V,G)});return}G.selections.forEach(function(Z){if(i.isInlineFragment(Z))te(z,Y,V,Z.selectionSet);else if(Z.kind==="FragmentSpread"){var Q=V[Z.name.value];te(z,Y,V,Q.selectionSet)}else if(i.isField(Z)){var Te=z[Z.name.value];Z.name.value==="__typename"||(typeof Te>"u"?z[Z.name.value]=null:Te!=null&&typeof Te=="object"&&Z.selectionSet!=null&&te(Te,Y,V,Z.selectionSet))}else return function(ze){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()})}}var he=function(z,Y){var V=z[Y||et]||z[et];return typeof V=="string"?{uri:V}:w({responseTransformer:null},V)},de=function(z,Y,V){return V===void 0||Y===void 0?z:z.replace(":"+Y,V)},Ve=function(){function z(){}return z.replacerForPath=function(Y){if(Y in z.cache)return z.cache[Y];var V=Y.indexOf("?"),G=Y.split(z.argReplacement),Z=[],Q=!1;G.reduce(function(ze,Ue){if(Ue===""||Ue==="{}")return ze+Ue.length;var ce=ze+Ue.length;if(Ue[0]==="{"&&Ue[Ue.length-1]==="}"){var be=Ue.slice(1,Ue.length-1).split(".");Z.push(function(Ze,Ot){try{var wt=Ae(Ze,be);return!Ot||typeof wt!="object"||wt==null?String(wt):a.stringify(wt)}catch{var Gt=[Y,be.join(".")].join("|");return Gt in z.warnTable||(console.warn("Warning: RestLink caught an error while unpacking",Gt,"This tends to happen if you forgot to pass a parameter needed for creating an @rest(path, or if RestLink was configured to deeply unpack a path parameter that wasn't provided. This message will only log once per detected instance. Trouble-shooting hint: check @rest(path: and the variables provided to this query."),z.warnTable[Gt]=!0),""}})}else Z.push(Ue),!Q&&ce>=V&&(Q=!0,Z.push(!0));return ce},0);var Te=function(ze){var Ue=!1,ce=Z.reduce(function(be,Ze){return typeof Ze=="string"?be+Ze:typeof Ze=="boolean"?(Ue=!0,be):be+Ze(ze,Ue)},"");return ce};return z.cache[Y]=Te},z.cache={},z.warnTable={},z.argReplacement=/({[._a-zA-Z0-9]*})/,z}();function Ae(z,Y){if(Y.length===0)return z;var V=P(Y),G=V.shift();return Ae(z[G],V)}var je=["__typename"],Ge=typeof globalThis=="object"&&globalThis||di,ye=function(z,Y,V){V===void 0&&(V=[]);var G=null;return Y.length!=2?G=function(Z,Q){return Y(Z)}:G=Y,Array.isArray(z)?z.map(function(Z,Q){return ye(Z,G,P(V,[String(Q)]))}):z==null||typeof z!="object"||z.constructor!==Object||Ge.FileList&&z instanceof FileList||Ge.File&&z instanceof File?z:Object.keys(z).reduce(function(Z,Q){var Te=z[Q];if(je.indexOf(Q)!==-1)return Z[Q]=Te,Z;var ze=P(V,[Q]);return Z[G(Q,ze)]=ye(Te,G,ze),Z},{})},Je=function(z){return z},ge=function(z){return z instanceof Headers?z:new Headers(z||{})},ue=function(){for(var z=[],Y=0;Y<arguments.length;Y++)z[Y]=arguments[Y];return z.reduce(function(V,G){return G&&(G.forEach||(G=ge(G)),G.forEach(function(Z,Q){V.append(Q,Z)})),V},new Headers)},Ee=function(z,Y,V){var G=new Headers;return z.forEach(function(Z,Q){Y.indexOf(Q)===-1&&G.append(Q,Z)}),ue(G,V||new Headers)},Ne=function(z){return function(Y,V){return Ee(Y,z,V)}},xe=["GET","POST","PUT","PATCH","DELETE"],Xe=function(z,Y){switch(Y){case"query":if(xe.indexOf(z.toUpperCase())!==-1)return;throw new Error('A "query" operation can only support "GET" requests but got "'+z+'".');case"mutation":if(xe.indexOf(z.toUpperCase())!==-1)return;throw new Error('"mutation" operations do not support that HTTP-verb');case"subscription":throw new Error('A "subscription" operation is not supported yet.');default:var V=Y;return V}},Et=function(z,Y,V){var G=new Error(V);throw G.response=z,G.statusCode=z.status,G.result=Y,G},lt=function(z,Y){return z==null||typeof z!="object"?z:Array.isArray(z)?z.map(function(V){return lt(V,Y)}):(z.__typename=Y,z)},It=function(z,Y,V,G,Z){return S(void 0,void 0,void 0,function(){var Q,Te,ze,Ue,ce,be,Ze,Ot,wt,Gt,pt,Lt,rr,Rr,zt,Jt,Zt,W,H,Be,$e,Tt,Ke,nr,fr,Dt,Ht,Ur,$r,ir,un,_r,xr,Sr,Or,ur,zr,Tr,Er,Dr,cn,Ln,R,se,me,ke,Le,at,nt,tt;return A(this,function(rt){switch(rt.label){case 0:if(Q=Z.directives,Te=Z.isLeaf,ze=Z.resultKey,Ue=G.exportVariablesByNode,ce=Ue.get(Y)||{},be=function(_t){return _t instanceof Array?_t.forEach(be):Ue.set(_t,w({},ce)),_t},Ze=(Y||{})[ze],Ot=(Y||{})[z],Y&&Q&&Q.export&&(ce[Q.export.as]=Ot),wt=Q&&Q.type,!Te&&wt){if(Q.rest)throw new Error("Invalid use of @type(name: ...) directive on a call that also has @rest(...)");return be(Ot),[2,lt(Ot,Q.type.name)]}if(Gt=!Q||!Q.rest,Gt)return[2,be(Ze||Ot)];if(pt=G.credentials,Lt=G.endpoints,rr=G.headers,Rr=G.customFetch,zt=G.operationType,Jt=G.typePatcher,Zt=G.mainDefinition,W=G.fragmentDefinitions,H=G.fieldNameNormalizer,Be=G.fieldNameDenormalizer,$e=G.serializers,Tt=G.responseTransformer,Ke=i.createFragmentMap(W),nr=Q.rest,fr=nr.path,Dt=nr.endpoint,Ht=nr.pathBuilder,Ur=he(Lt,Dt),$r=fr==null&&Ht==null,$r)throw new Error('One of ("path" | "pathBuilder") must be set in the @rest() directive. This request had neither, please add one');if(Ht||(fr.includes(":")?(console.warn("Deprecated: '@rest(path:' contains a ':' colon, this format will be removed in future versions"),Ht=function(_t){var b=_t.args,I=_t.exportVariables,k=w(w({},b),I),C=Object.keys(k).reduce(function(D,U){return de(D,U,k[U])},fr);if(C.includes(":"))throw new Error('Missing parameters to run query, specify it in the query params or use an export directive. (If you need to use ":" inside a variable string make sure to encode the variables properly using `encodeURIComponent`. Alternatively see documentation about using pathBuilder.)');return C}):Ht=Ve.replacerForPath(fr)),ir={args:V,exportVariables:ce,context:G,"@rest":Q.rest,replacer:Ht},un=Ht(ir),_r=Q.rest,xr=_r.method,Sr=_r.type,Or=_r.bodyBuilder,ur=_r.bodyKey,zr=_r.fieldNameDenormalizer,Tr=_r.fieldNameNormalizer,Er=_r.bodySerializer,xr||(xr="GET"),ur||(ur="input"),Dr=void 0,cn=void 0,["GET","DELETE"].indexOf(xr)===-1){if(!Or){if(Ln=ir.exportVariables[ur]||ir.args&&ir.args[ur],!Ln)throw new Error("[GraphQL "+xr+" "+zt+" using a REST call without a body]. No `"+ur+"` was detected. Pass bodyKey, or bodyBuilder to the @rest() directive to resolve this.");Or=function(_t){return Ln}}if(Dr=ye(Or(ir),zr||Be||Je),R=void 0,typeof Er=="string"){if(!$e.hasOwnProperty(Er))throw new Error('"bodySerializer" must correspond to configured serializer. '+("Please make sure to specify a serializer called "+Er+' in the "bodySerializers" property of the RestLink.'));R=$e[Er](Dr,rr)}else R=Er?Er(Dr,rr):$e[Ye](Dr,rr);Dr=R.body,cn=new Headers(R.headers)}return Xe(xr,zt||"query"),se=w({method:xr,headers:cn||rr,body:Dr},pt?{credentials:pt}:{}),me=""+Ur.uri+un,[4,(Rr||fetch)(me,se)];case 1:return ke=rt.sent(),G.responses.push(ke),ke.ok?(ke.status===204||ke.headers.get("Content-Length")==="0"?Le={}:Le=ke,[3,9]):[3,2];case 2:return ke.status!==404?[3,3]:(Le=null,[3,9]);case 3:at=void 0,rt.label=4;case 4:return rt.trys.push([4,6,,8]),[4,ke.clone().json()];case 5:return at=rt.sent(),[3,8];case 6:return rt.sent(),[4,ke.clone().text()];case 7:return at=rt.sent(),[3,8];case 8:Et(ke,at,"Response not successful: Received status code "+ke.status),rt.label=9;case 9:if(nt=Ur.responseTransformer||Tt,!nt)return[3,14];rt.label=10;case 10:return rt.trys.push([10,12,,13]),[4,nt(Le,Sr)];case 11:return Le=rt.sent(),[3,13];case 12:throw tt=rt.sent(),console.warn("An error occurred in a responseTransformer:"),tt;case 13:return[3,16];case 14:return Le&&Le.json?[4,Le.json()]:[3,16];case 15:Le=rt.sent(),rt.label=16;case 16:return Le=ye(Le,Tr||H||Je),Le=X(ze,Le,Zt,Ke,Zt.selectionSet),Le=L(Le,Sr,Jt,{resolverParams:{fieldName:z,root:Y,args:V,context:G,info:Z}}),[2,be(Le)]}})})},et="",Ye="",dt=function(z,Y){return Y.has("content-type")||Y.append("Content-Type","application/json"),{body:JSON.stringify(z),headers:Y}},Re={test:function(z){return z.name.value==="rest"},remove:!0},bt=function(z){T(Y,z);function Y(V){var G,Z=V.uri,Q=V.endpoints,Te=V.headers,ze=V.fieldNameNormalizer,Ue=V.fieldNameDenormalizer,ce=V.typePatcher,be=V.customFetch,Ze=V.credentials,Ot=V.bodySerializers,wt=V.defaultSerializer,Gt=V.responseTransformer,pt=z.call(this)||this,Lt={};if(Lt[et]=Z||"",pt.endpoints=Object.assign({},Q||Lt),Z==null&&Q==null)throw new Error("A RestLink must be initialized with either 1 uri, or a map of keyed-endpoints");if(Z!=null){var rr=(Q||{})[et];if(rr!=null&&rr!=Z)throw new Error("RestLink was configured with a default uri that doesn't match what's passed in to the endpoints map.");pt.endpoints[et]=Z}if(pt.endpoints[et]==null&&console.warn("RestLink configured without a default URI. All @rest(…) directives must provide an endpoint key!"),ce==null)pt.typePatcher=function(zt,Jt,Zt){return w({__typename:Jt},zt)};else if(!Array.isArray(ce)&&typeof ce=="object"&&Object.keys(ce).map(function(zt){return ce[zt]}).reduce(function(zt,Jt){return zt&&typeof Jt=="function"},!0)){var Rr=ce;pt.typePatcher=function(zt,Jt,Zt,W){var H=zt.__typename||Jt;if(Array.isArray(zt))return zt.map(function($e){return Zt($e,H,Zt,W)});var Be=Rr[H]||function($e){return $e};return w({__typename:H},Be(zt,H,Zt,W))}}else throw new Error("RestLink was configured with a typePatcher of invalid type!");return Ot&&Ot.hasOwnProperty(Ye)&&console.warn("RestLink was configured to override the default serializer! This may result in unexpected behavior"),pt.responseTransformer=Gt||null,pt.fieldNameNormalizer=ze||null,pt.fieldNameDenormalizer=Ue||null,pt.headers=ge(Te),pt.credentials=Ze||null,pt.customFetch=be,pt.serializers=w((G={},G[Ye]=wt||dt,G),Ot||{}),pt.processedDocuments=new Map,pt}return Y.prototype.removeRestSetsFromDocument=function(V){var G=this.processedDocuments.get(V);if(G)return G;i.checkDocument(V);var Z=i.removeDirectivesFromDocument([Re],V);return this.processedDocuments.set(V,Z),Z},Y.prototype.request=function(V,G){var Z=V.query,Q=V.variables,Te=V.getContext,ze=V.setContext,Ue=Te(),ce=i.hasDirectives(["rest"],Z);if(!ce)return G(V);var be=this.removeRestSetsFromDocument(Z),Ze=Ue.headersMergePolicy;Ze==null&&Array.isArray(Ue.headersToOverride)?Ze=Ne(Ue.headersToOverride):Ze==null&&(Ze=ue);var Ot=Ze(this.headers,Ue.headers);Ot.has("Accept")||Ot.append("Accept","application/json");var wt=Ue.credentials||this.credentials,Gt=i.addTypenameToDocument(Z),pt=i.getMainDefinition(Z),Lt=i.getFragmentDefinitions(Z),rr=(pt||{}).operation||"query",Rr={headers:Ot,endpoints:this.endpoints,exportVariablesByNode:new Map,credentials:wt,customFetch:this.customFetch,operationType:rr,fieldNameNormalizer:this.fieldNameNormalizer,fieldNameDenormalizer:this.fieldNameDenormalizer,mainDefinition:pt,fragmentDefinitions:Lt,typePatcher:this.typePatcher,serializers:this.serializers,responses:[],responseTransformer:this.responseTransformer},zt={},Jt;return be&&G?(V.query=be,Jt=G(V)):Jt=n.Observable.of({data:{}}),Jt.flatMap(function(Zt){var W=Zt.data,H=Zt.errors;return new n.Observable(function(Be){y(It,Gt,W,Rr,Q,zt).then(function($e){ze({restResponses:(Ue.restResponses||[]).concat(Rr.responses)}),Be.next({data:$e,errors:H}),Be.complete()}).catch(function($e){$e.name!=="AbortError"&&($e.result&&$e.result.errors&&Be.next($e.result),Be.error($e))})})})},Y}(n.ApolloLink);t.RestLink=bt,t.PathBuilder=Ve,Object.defineProperty(t,"__esModule",{value:!0})})})(rh,rh.exports);var FA=rh.exports;const Ju=ve.createContext(),I0=ve.createContext(),MA=()=>{const{urls:r}=Xn(),{children:e}=ve.useContext(Ju),t=Hn.useNavigate(),[n,i]=ve.useState(!1),a=window.parent!==window.self;Hn.useBlocker(({nextLocation:f})=>{var h;return a?(h=f.state)!=null&&h.fromParent?(i(!0),!1):(u(`${f.pathname}${f.search}`),!0):!1}),ve.useEffect(()=>{if(!a)return;const f=h=>{h.metaKey&&h.key==="k"&&window.parent.postMessage({type:"open-search"},r.appUrl)};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}},[]),ve.useEffect(()=>{if(!a)return;const f=({origin:h,data:d})=>{if(h===r.appUrl)switch(d.type){case"navigate":t(d.path,{replace:!0,state:{fromParent:!0}});break}};return window.addEventListener("message",f),n||window.parent.postMessage({type:"ready"},r.appUrl),()=>{window.removeEventListener("message",f)}},[t,n]);const u=f=>{n&&window.parent.postMessage({type:"set-path",path:f},r.appUrl)},c=ve.useMemo(()=>({isEmbedded:a,navigateParent:u}),[a,u]);return Mr.jsx(I0.Provider,{value:c,children:e})},LA=()=>{const{urls:r,jwtRef:e,accessToken:t}=Xn(),{graphQLRoleOverride:n,children:i}=ve.useContext(Ju),[a,u]=ve.useState(),[c,f]=ve.useState(),h=()=>{const g=new URL(r.graphQLUrl);return`//${g.host}${g.pathname}`},d=()=>n?{"X-Hasura-Role":n}:{};ve.useEffect(()=>{const g=new iA(cA({url:`wss:${h()}`,lazy:!0,reconnect:!0,connectionParams:async()=>({headers:{Authorization:`Bearer ${e.current}`,...d()}})})),m=Kv(({operation:P,networkError:F,forward:L})=>(Vi(P.query).operation==="subscription"&&F&&g.client.terminate(),L(P))),T=Yv(async(P,{headers:F})=>({headers:{...F,Authorization:`Bearer ${e.current}`,...d()}})).concat(Zl({uri:`https:${h()}`,fetch:window.fetch})),w=m.split(({query:P})=>{const F=Vi(P);return F.kind==="OperationDefinition"&&F.operation==="subscription"},g,T),A=Yv(async(P,{headers:F})=>({headers:{...F,Authorization:`Bearer ${t}`}})).concat(new FA.RestLink({uri:r.apiUrl}));f(Jr.from([A,w]))},[]),ve.useEffect(()=>{c&&u(new _f({link:c,cache:new yf}))},[c]);const y=ve.useMemo(()=>({link:c}),[c]);return Mr.jsx(kv.Provider,{value:y,children:a&&Mr.jsx(bO,{client:a,children:Mr.jsx(MA,{children:i})})})},qA=bp.div`
132
132
  text-align: center;
133
133
  padding-top: 200px;
134
134
  `,P0=({loadError:r})=>{const e=eA();return r?Mr.jsx(qA,{children:r}):(Wv(),Mr.jsx(Hn.Navigate,{replace:!0,to:e||"/"}))},jA=bp.div`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machinemetrics/mm-react-tools",
3
- "version": "3.0.1-beta",
3
+ "version": "3.0.2-beta",
4
4
  "description": "Components, hooks, and helper functions for writing React apps using MachineMetrics APIs.",
5
5
  "author": "machinemetrics",
6
6
  "license": "MIT",