@machinemetrics/mm-react-tools 4.0.0-0 → 4.0.1

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.
@@ -22936,7 +22936,7 @@ const sl = Ms.createContext(), SF = () => {
22936
22936
  ge
22937
22937
  ]
22938
22938
  );
22939
- return /* @__PURE__ */ sr.jsx(Yo.Provider, { value: We, children: c.pathname !== "/mm-embedded-interop" && c.pathname !== "/mm-embedded-login" ? t : /* @__PURE__ */ sr.jsx(sr.Fragment, {}) });
22939
+ return /* @__PURE__ */ sr.jsx(Yo.Provider, { value: We, children: c.pathname !== "/mm-embedded-interop" && c.pathname !== "/mm-embedded-login" && c.pathname !== "/mm-embedded-print" ? t : /* @__PURE__ */ sr.jsx(sr.Fragment, {}) });
22940
22940
  }, EF = () => {
22941
22941
  const { urls: r, jwtRef: e, accessToken: t } = di(), { graphQLRoleOverride: n, children: i } = hi(sl), [a, u] = xt(), [c, f] = xt(), h = () => {
22942
22942
  const g = new URL(r.graphQLUrl);
@@ -128,7 +128,7 @@ function print() { __p += __j.call(arguments, '') }
128
128
  `;T(Z)},[y,m,h]),me.useEffect(()=>{_&&P()},[_,S]);const[P,{data:M,loading:U}]=U1(_,{fetchPolicy:"no-cache"});return me.useEffect(()=>{if(!M||!M.quantities)return;const z=ci.last(M.quantities);if(z&&d(z.eventTime),!n)i(M.quantities);else{const Z=ci.drop(M.quantities);i([...n,...Z])}},[M]),{data:n,error:c,loading:a}},YA=r=>{const[e,t]=me.useState(),[n,i]=me.useState(!0),[a,u]=me.useState(),{urls:c,request:f}=ti();return bo(async h=>{try{i(!0);const d=await f(`${c.apiUrl}/reports/downtime`,{method:"POST",body:r,signal:h});u(null),t(d)}catch(d){u(d)}i(!1)},[r]),{data:e,error:a,loading:n}},KA=r=>{const[e,t]=me.useState(),{urls:n,request:i,clientId:a}=ti(),u=`lab:${a}:${r}`,{data:c,loading:f,error:h}=f0("/templates");return me.useEffect(()=>{if(!c)return;const m=ci.filter(c.templates,{namespace:u});t(m)},[c]),[async({name:m,public:b,config:I})=>{const S={name:m,public:b,namespace:u,config:JSON.stringify(I)},_=JSON.stringify(S),T=await i(`${n.apiUrl}/templates`,{method:"POST",body:_});return t([...e,T.template]),T.template},async(m,{name:b,public:I,config:S})=>{const _={name:b,public:I,namespace:u,config:JSON.stringify(S)},T=JSON.stringify(_),P=await i(`${n.apiUrl}/templates/${m}`,{method:"PUT",body:T}),M=ci.findIndex(e,{id:m}),U=e.slice(0,M),z=e.slice(M+1);return t([...U,P.template,...z]),P.template},async m=>{await i(`${n.apiUrl}/templates/${m}`,{method:"DELETE"}),t(ci.reject(e,{id:m}))},{templates:e,loading:f,error:h}]},ZA=()=>{const[r,e]=me.useState(),[t,n]=me.useState(),{urls:i}=ti();return me.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]),me.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}]},ti=()=>me.useContext(c0),XA=()=>{throw new Error("useMMEmbeddedApp is deprecated. Use useMMAppTools and useMMAppContext.")},ek=()=>{throw new Error("useMMAppTools is deprecated. Use useMMAppParams and useMMAppCommands.")},tk=()=>{const{context:r}=me.useContext(vo);return r},h0=()=>{const{params:r}=me.useContext(vo);return r},d0=()=>{const{commands:r}=me.useContext(vo);return r},rk=(r,e,t=[])=>{const{addSetting:n}=me.useContext(vo);me.useEffect(()=>{n(r,e)},[...t])},nk=()=>me.useContext(u0),ik=()=>{const{login:r,isAuthenticated:e}=ti();return bo(async()=>{e===!1&&await r()},[e]),e?nr.jsx(pn.Outlet,{}):nr.jsx("div",{})},p0="%[a-f0-9]{2}",m0=new RegExp("("+p0+")|([^%]+?)","gi"),y0=new RegExp("("+p0+")+","gi");function ah(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([],ah(t),ah(n))}function sk(r){try{return decodeURIComponent(r)}catch{let e=r.match(m0)||[];for(let t=1;t<e.length;t++)r=ah(e,t).join(""),e=r.match(m0)||[];return r}}function ak(r){const e={"%FE%FF":"��","%FF%FE":"��"};let t=y0.exec(r);for(;t;){try{e[t[0]]=decodeURIComponent(t[0])}catch{const i=sk(t[0]);i!==t[0]&&(e[t[0]]=i)}t=y0.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 ok(r){if(typeof r!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return decodeURIComponent(r)}catch{return ak(r)}}function uk(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}function g0(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)]}const ck=r=>r==null,lk=r=>encodeURIComponent(r).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),oh=Symbol("encodeFragmentIdentifier");function fk(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,[Sr(e,r),"[",i,"]"].join("")]:[...t,[Sr(e,r),"[",Sr(i,r),"]=",Sr(n,r)].join("")]};case"bracket":return e=>(t,n)=>n===void 0||r.skipNull&&n===null||r.skipEmptyString&&n===""?t:n===null?[...t,[Sr(e,r),"[]"].join("")]:[...t,[Sr(e,r),"[]=",Sr(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,[Sr(e,r),":list="].join("")]:[...t,[Sr(e,r),":list=",Sr(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?[[Sr(t,r),e,Sr(i,r)].join("")]:[[n,Sr(i,r)].join(r.arrayFormatSeparator)])}default:return e=>(t,n)=>n===void 0||r.skipNull&&n===null||r.skipEmptyString&&n===""?t:n===null?[...t,Sr(e,r)]:[...t,[Sr(e,r),"=",Sr(n,r)].join("")]}}function hk(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?[]:wi(n,r).split(r.arrayFormatSeparator);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 v0(r){if(typeof r!="string"||r.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Sr(r,e){return e.encode?e.strict?lk(r):encodeURIComponent(r):r}function wi(r,e){return e.decode?ok(r):r}function b0(r){return Array.isArray(r)?r.sort():typeof r=="object"?b0(Object.keys(r)).sort((e,t)=>Number(e)-Number(t)).map(e=>r[e]):r}function w0(r){const e=r.indexOf("#");return e!==-1&&(r=r.slice(0,e)),r}function dk(r){let e="";const t=r.indexOf("#");return t!==-1&&(e=r.slice(t)),e}function _0(r,e,t){return t==="string"&&typeof r=="string"?r:typeof t=="function"&&typeof r=="string"?t(r):e.parseBooleans&&r!==null&&(r.toLowerCase()==="true"||r.toLowerCase()==="false")?r.toLowerCase()==="true":t==="number"&&!Number.isNaN(Number(r))&&typeof r=="string"&&r.trim()!==""||e.parseNumbers&&!Number.isNaN(Number(r))&&typeof r=="string"&&r.trim()!==""?Number(r):r}function uh(r){r=w0(r);const e=r.indexOf("?");return e===-1?"":r.slice(e+1)}function ch(r,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...e},v0(e.arrayFormatSeparator);const t=hk(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]=g0(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&&e.types[i]!=="string")for(const[u,c]of Object.entries(a)){const f=e.types[i]?e.types[i].replace("[]",""):void 0;a[u]=_0(c,e,f)}else typeof a=="object"&&a!==null&&e.types[i]==="string"?n[i]=Object.values(a).join(e.arrayFormatSeparator):n[i]=_0(a,e,e.types[i]);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)?b0(u):u,i},Object.create(null))}function x0(r,e){if(!r)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},v0(e.arrayFormatSeparator);const t=u=>e.skipNull&&ck(r[u])||e.skipEmptyString&&r[u]==="",n=fk(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?Sr(u,e):Array.isArray(c)?c.length===0&&e.arrayFormat==="bracket-separator"?Sr(u,e)+"[]":c.reduce(n(u),[]).join("&"):Sr(u,e)+"="+Sr(c,e)}).filter(u=>u.length>0).join("&")}function S0(r,e){var i;e={decode:!0,...e};let[t,n]=g0(r,"#");return t===void 0&&(t=r),{url:((i=t==null?void 0:t.split("?"))==null?void 0:i[0])??"",query:ch(uh(r),e),...e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:wi(n,e)}:{}}}function E0(r,e){e={encode:!0,strict:!0,[oh]:!0,...e};const t=w0(r.url).split("?")[0]||"",n=uh(r.url),i={...ch(n,{sort:!1}),...r.query};let a=x0(i,e);a&&(a=`?${a}`);let u=dk(r.url);if(typeof r.fragmentIdentifier=="string"){const c=new URL(t);c.hash=r.fragmentIdentifier,u=e[oh]?c.hash:`#${r.fragmentIdentifier}`}return`${t}${a}${u}`}function O0(r,e,t){t={parseFragmentIdentifier:!0,[oh]:!1,...t};const{url:n,query:i,fragmentIdentifier:a}=S0(r,t);return E0({url:n,query:uk(i,e),fragmentIdentifier:a},t)}function pk(r,e,t){const n=Array.isArray(e)?i=>!e.includes(i):(i,a)=>!e(i,a);return O0(r,n,t)}const mk=Object.freeze(Object.defineProperty({__proto__:null,exclude:pk,extract:uh,parse:ch,parseUrl:S0,pick:O0,stringify:x0,stringifyUrl:E0},Symbol.toStringTag,{value:"Module"})),Ur=[];for(let r=0;r<256;++r)Ur.push((r+256).toString(16).slice(1));function yk(r,e=0){return(Ur[r[e+0]]+Ur[r[e+1]]+Ur[r[e+2]]+Ur[r[e+3]]+"-"+Ur[r[e+4]]+Ur[r[e+5]]+"-"+Ur[r[e+6]]+Ur[r[e+7]]+"-"+Ur[r[e+8]]+Ur[r[e+9]]+"-"+Ur[r[e+10]]+Ur[r[e+11]]+Ur[r[e+12]]+Ur[r[e+13]]+Ur[r[e+14]]+Ur[r[e+15]]).toLowerCase()}let lh;const gk=new Uint8Array(16);function vk(){if(!lh){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");lh=crypto.getRandomValues.bind(crypto)}return lh(gk)}const T0={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function A0(r,e,t){if(T0.randomUUID&&!e&&!r)return T0.randomUUID();r=r||{};const n=r.random||(r.rng||vk)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,yk(n)}const fh="mm-auth-state",hh="mm-auth-destination",dh="mm-auth-access-token",_i=window.localStorage,bk=()=>_i.getItem(dh),wk=r=>{r?_i.setItem(dh,r):_i.removeItem(dh)},_k=()=>_i.getItem(hh),k0=r=>{r?_i.setItem(hh,r):_i.removeItem(hh)},xk=()=>_i.getItem(fh),I0=r=>{r?_i.setItem(fh,r):_i.removeItem(fh)},C0=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 Sk(r){return er(r)&&"code"in r&&"reason"in r}function Ek(r){var e;return er(r)&&((e=r.target)===null||e===void 0?void 0:e.readyState)===WebSocket.CLOSED}var Ok=function(r){Pn(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 Pt(function(i){return n.client.subscribe(L(L({},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=Sk(a);return u||Ek(a)?i.error(new Error("Socket closed".concat(u?" with event ".concat(a.code):"").concat(u?" ".concat(a.reason):""))):i.error(new yn({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(Kr);function un(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function ks(r){return un(r)==="object"}function Tk(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function P0(r,e){return r.length<124?r:e}const Ak="graphql-transport-ws";var vn;(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"})(vn||(vn={}));var mr;(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"})(mr||(mr={}));function N0(r){if(!ks(r))throw new Error(`Message is expected to be an object, but got ${un(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 ${un(r.type)}`);switch(r.type){case mr.ConnectionInit:case mr.ConnectionAck:case mr.Ping:case mr.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 mr.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${un(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 ${un(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 ${un(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 ${un(r.payload.variables)}`);if(r.payload.operationName!=null&&un(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 ${un(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 ${un(r.payload.extensions)}`);break}case mr.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${un(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 ${un(r.payload)}`);break}case mr.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${un(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Tk(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 mr.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${un(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 kk(r,e){return N0(typeof r=="string"?JSON.parse(r,e):r)}function _o(r,e){return N0(r),JSON.stringify(r,e)}var fa=function(r){return this instanceof fa?(this.v=r,this):new fa(r)},Ik=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(b,I){a.push([g,m,b,I])>1||c(g,m)})})}function c(g,m){try{f(n[g](m))}catch(b){y(a[0][3],b)}}function f(g){g.value instanceof fa?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 Ck(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(ze){let he=1e3;for(let re=0;re<ze;re++)he*=2;await new Promise(re=>setTimeout(re,he+Math.floor(Math.random()*2700+300)))},shouldRetry:y=ph,isFatalConnectionProblem:g,on:m,webSocketImpl:b,generateID:I=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,ze=>{const he=Math.random()*16|0;return(ze=="x"?he:he&3|8).toString(16)})},jsonMessageReplacer:S,jsonMessageReviver:_}=r;let T;if(b){if(!Nk(b))throw new Error("Invalid WebSocket implementation provided");T=b}else typeof WebSocket<"u"?T=WebSocket:typeof global<"u"?T=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(T=window.WebSocket||window.MozWebSocket);if(!T)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const P=T,M=(()=>{const ve=(()=>{const he={};return{on(re,ge){return he[re]=ge,()=>{delete he[re]}},emit(re){var ge;"id"in re&&((ge=he[re.id])===null||ge===void 0||ge.call(he,re))}}})(),ze={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?[ve.emit,m.message]:[ve.emit],closed:m!=null&&m.closed?[m.closed]:[],error:m!=null&&m.error?[m.error]:[]};return{onMessage:ve.on,on(he,re){const ge=ze[he];return ge.push(re),()=>{ge.splice(ge.indexOf(re),1)}},emit(he,...re){for(const ge of[...ze[he]])ge(...re)}}})();function U(ve){const ze=[M.on("error",he=>{ze.forEach(re=>re()),ve(he)}),M.on("closed",he=>{ze.forEach(re=>re()),ve(he)})]}let z,Z=0,X,fe=!1,se=0,ke=!1;async function ye(){clearTimeout(X);const[ve,ze]=await(z??(z=new Promise((ge,je)=>(async()=>{if(fe){if(await d(se),!Z)return z=void 0,je({code:1e3,reason:"All Subscriptions Gone"});se++}M.emit("connecting",fe);const Se=new P(typeof e=="function"?await e():e,Ak);let He,ht;function Vt(){isFinite(u)&&u>0&&(clearTimeout(ht),ht=setTimeout(()=>{Se.readyState===P.OPEN&&(Se.send(_o({type:mr.Ping})),M.emit("ping",!1,void 0))},u))}U(tt=>{z=void 0,clearTimeout(He),clearTimeout(ht),je(tt),tt instanceof R0&&(Se.close(4499,"Terminated"),Se.onerror=null,Se.onclose=null)}),Se.onerror=tt=>M.emit("error",tt),Se.onclose=tt=>M.emit("closed",tt),Se.onopen=async()=>{try{M.emit("opened",Se);const tt=typeof t=="function"?await t():t;if(Se.readyState!==P.OPEN)return;Se.send(_o(tt?{type:mr.ConnectionInit,payload:tt}:{type:mr.ConnectionInit},S)),isFinite(f)&&f>0&&(He=setTimeout(()=>{Se.close(vn.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},f)),Vt()}catch(tt){M.emit("error",tt),Se.close(vn.InternalClientError,P0(tt instanceof Error?tt.message:new Error(tt).message,"Internal client error"))}};let Rt=!1;Se.onmessage=({data:tt})=>{try{const it=kk(tt,_);if(M.emit("message",it),it.type==="ping"||it.type==="pong"){M.emit(it.type,!0,it.payload),it.type==="pong"?Vt():c||(Se.send(_o(it.payload?{type:mr.Pong,payload:it.payload}:{type:mr.Pong})),M.emit("pong",!1,it.payload));return}if(Rt)return;if(it.type!==mr.ConnectionAck)throw new Error(`First message cannot be of type ${it.type}`);clearTimeout(He),Rt=!0,M.emit("connected",Se,it.payload,fe),fe=!1,se=0,ge([Se,new Promise((Et,Me)=>U(Me))])}catch(it){Se.onmessage=null,M.emit("error",it),Se.close(vn.BadResponse,P0(it instanceof Error?it.message:new Error(it).message,"Bad response"))}}})())));ve.readyState===P.CLOSING&&await ze;let he=()=>{};const re=new Promise(ge=>he=ge);return[ve,he,Promise.race([re.then(()=>{if(!Z){const ge=()=>ve.close(1e3,"Normal Closure");isFinite(a)&&a>0?X=setTimeout(()=>{ve.readyState===P.OPEN&&ge()},a):ge()}}),ze])]}function Pe(ve){if(ph(ve)&&(Pk(ve.code)||[vn.InternalServerError,vn.InternalClientError,vn.BadRequest,vn.BadResponse,vn.Unauthorized,vn.SubprotocolNotAcceptable,vn.SubscriberAlreadyExists,vn.TooManyInitialisationRequests].includes(ve.code)))throw ve;if(ke)return!1;if(ph(ve)&&ve.code===1e3)return Z>0;if(!h||se>=h||!y(ve)||g!=null&&g(ve))throw ve;return fe=!0}n||(async()=>{for(Z++;;)try{const[,,ve]=await ye();await ve}catch(ve){try{if(!Pe(ve))return}catch(ze){return i==null?void 0:i(ze)}}})();function Ie(ve,ze){const he=I(ve);let re=!1,ge=!1,je=()=>{Z--,re=!0};return(async()=>{for(Z++;;)try{const[Se,He,ht]=await ye();if(re)return He();const Vt=M.onMessage(he,Rt=>{switch(Rt.type){case mr.Next:{ze.next(Rt.payload);return}case mr.Error:{ge=!0,re=!0,ze.error(Rt.payload),je();return}case mr.Complete:{re=!0,je();return}}});Se.send(_o({id:he,type:mr.Subscribe,payload:ve},S)),je=()=>{!re&&Se.readyState===P.OPEN&&Se.send(_o({id:he,type:mr.Complete},S)),Z--,re=!0,He()},await ht.finally(Vt);return}catch(Se){if(!Pe(Se))return}})().then(()=>{ge||ze.complete()}).catch(Se=>{ze.error(Se)}),()=>{re||je()}}return{on:M.on,subscribe:Ie,iterate(ve){const ze=[],he={done:!1,error:null,resolve:()=>{}},re=Ie(ve,{next(je){ze.push(je),he.resolve()},error(je){he.done=!0,he.error=je,he.resolve()},complete(){he.done=!0,he.resolve()}}),ge=function(){return Ik(this,arguments,function*(){for(;;){for(ze.length||(yield fa(new Promise(He=>he.resolve=He)));ze.length;)yield yield fa(ze.shift());if(he.error)throw he.error;if(he.done)return yield fa(void 0)}})}();return ge.throw=async je=>(he.done||(he.done=!0,he.error=je,he.resolve()),{done:!0,value:void 0}),ge.return=async()=>(re(),{done:!0,value:void 0}),ge},async dispose(){if(ke=!0,z){const[ve]=await z;ve.close(1e3,"Normal Closure")}},terminate(){z&&M.emit("closed",new R0)}}}class R0 extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function ph(r){return ks(r)&&"code"in r&&"reason"in r}function Pk(r){return[1e3,1001,1006,1005,1012,1013,1014].includes(r)?!1:r>=1e3&&r<=1999}function Nk(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function M0(r){return new Kr(function(e,t){var n=on(e,[]);return new Pt(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 D0(r){return new Kr(function(e,t){return new Pt(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){Pn(e,r);function e(t){var n=r.call(this)||this;return n.link=D0(t),n}return e.prototype.request=function(t,n){return this.link.request(t,n)},e})(Kr);var mh={exports:{}};const Rk=ol(O1),Mk=ol(gO);var yh,F0;function ha(){return F0||(F0=1,yh=TypeError),yh}const Dk=ol(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var gh,L0;function ec(){if(L0)return gh;L0=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,b=Boolean.prototype.valueOf,I=Object.prototype.toString,S=Function.prototype.toString,_=String.prototype.match,T=String.prototype.slice,P=String.prototype.replace,M=String.prototype.toUpperCase,U=String.prototype.toLowerCase,z=RegExp.prototype.test,Z=Array.prototype.concat,X=Array.prototype.join,fe=Array.prototype.slice,se=Math.floor,ke=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ye=Object.getOwnPropertySymbols,Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ve=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ie||!0)?Symbol.toStringTag:null,ze=Object.prototype.propertyIsEnumerable,he=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(H){return H.__proto__}:null);function re(H,G){if(H===1/0||H===-1/0||H!==H||H&&H>-1e3&&H<1e3||z.call(/e/,G))return G;var st=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof H=="number"){var vt=H<0?-se(-H):se(H);if(vt!==H){var lt=String(vt),We=T.call(G,lt.length+1);return P.call(lt,st,"$&_")+"."+P.call(P.call(We,/([0-9]{3})/g,"$&_"),/_$/,"")}}return P.call(G,st,"$&_")}var ge=Dk,je=ge.custom,Se=q(je)?je:null,He={__proto__:null,double:'"',single:"'"},ht={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};gh=function H(G,st,vt,lt){var We=st||{};if(V(We,"quoteStyle")&&!V(He,We.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(We,"maxStringLength")&&(typeof We.maxStringLength=="number"?We.maxStringLength<0&&We.maxStringLength!==1/0:We.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Kt=V(We,"customInspect")?We.customInspect:!0;if(typeof Kt!="boolean"&&Kt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(We,"indent")&&We.indent!==null&&We.indent!==" "&&!(parseInt(We.indent,10)===We.indent&&We.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(We,"numericSeparator")&&typeof We.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Zt=We.numericSeparator;if(typeof G>"u")return"undefined";if(G===null)return"null";if(typeof G=="boolean")return G?"true":"false";if(typeof G=="string")return Ot(G,We);if(typeof G=="number"){if(G===0)return 1/0/G>0?"0":"-0";var Qt=String(G);return Zt?re(G,Qt):Qt}if(typeof G=="bigint"){var kr=String(G)+"n";return Zt?re(G,kr):kr}var Hr=typeof We.depth>"u"?5:We.depth;if(typeof vt>"u"&&(vt=0),vt>=Hr&&Hr>0&&typeof G=="object")return tt(G)?"[Array]":"[Object]";var Fr=dr(We,vt);if(typeof lt>"u")lt=[];else if($e(lt,G)>=0)return"[Circular]";function jt(Ye,Xe,et){if(Xe&&(lt=fe.call(lt),lt.push(Xe)),et){var gt={depth:We.depth};return V(We,"quoteStyle")&&(gt.quoteStyle=We.quoteStyle),H(Ye,gt,vt+1,lt)}return H(Ye,We,vt+1,lt)}if(typeof G=="function"&&!Et(G)){var Or=Ve(G),$r=Ht(G,jt);return"[Function"+(Or?": "+Or:" (anonymous)")+"]"+($r.length>0?" { "+X.call($r,", ")+" }":"")}if(q(G)){var Lr=Ie?P.call(String(G),/^(Symbol\(.*\))_[^)]*$/,"$1"):Pe.call(G);return typeof G=="object"&&!Ie?Gt(Lr):Lr}if(Yt(G)){for(var ar="<"+U.call(String(G.nodeName)),Gr=G.attributes||[],Tr=0;Tr<Gr.length;Tr++)ar+=" "+Gr[Tr].name+"="+Vt(Rt(Gr[Tr].value),"double",We);return ar+=">",G.childNodes&&G.childNodes.length&&(ar+="..."),ar+="</"+U.call(String(G.nodeName))+">",ar}if(tt(G)){if(G.length===0)return"[]";var gr=Ht(G,jt);return Fr&&!sr(gr)?"["+Ar(gr,Fr)+"]":"[ "+X.call(gr,", ")+" ]"}if(Me(G)){var Ir=Ht(G,jt);return!("cause"in Error.prototype)&&"cause"in G&&!ze.call(G,"cause")?"{ ["+String(G)+"] "+X.call(Z.call("[cause]: "+jt(G.cause),Ir),", ")+" }":Ir.length===0?"["+String(G)+"]":"{ ["+String(G)+"] "+X.call(Ir,", ")+" }"}if(typeof G=="object"&&Kt){if(Se&&typeof G[Se]=="function"&&ge)return ge(G,{depth:Hr-vt});if(Kt!=="symbol"&&typeof G.inspect=="function")return G.inspect()}if(ae(G)){var Sn=[];return n&&n.call(G,function(Ye,Xe){Sn.push(jt(Xe,G,!0)+" => "+jt(Ye,G))}),zt("Map",t.call(G),Sn,Fr)}if(pt(G)){var Un=[];return c&&c.call(G,function(Ye){Un.push(jt(Ye,G))}),zt("Set",u.call(G),Un,Fr)}if(_e(G))return Er("WeakMap");if(mt(G))return Er("WeakSet");if(Qe(G))return Er("WeakRef");if(B(G))return Gt(jt(Number(G)));if(J(G))return Gt(jt(ke.call(G)));if(Q(G))return Gt(b.call(G));if(Ge(G))return Gt(jt(String(G)));if(typeof window<"u"&&G===window)return"{ [object Window] }";if(typeof globalThis<"u"&&G===globalThis||typeof pi<"u"&&G===pi)return"{ [object globalThis] }";if(!it(G)&&!Et(G)){var R=Ht(G,jt),ue=he?he(G)===Object.prototype:G instanceof Object||G.constructor===Object,be=G instanceof Object?"":"null prototype",Ce=!ue&&ve&&Object(G)===G&&ve in G?T.call(xe(G),8,-1):be?"Object":"",Be=ue||typeof G.constructor!="function"?"":G.constructor.name?G.constructor.name+" ":"",ut=Be+(Ce||be?"["+X.call(Z.call([],Ce||[],be||[]),": ")+"] ":"");return R.length===0?ut+"{}":Fr?ut+"{"+Ar(R,Fr)+"}":ut+"{ "+X.call(R,", ")+" }"}return String(G)};function Vt(H,G,st){var vt=st.quoteStyle||G,lt=He[vt];return lt+H+lt}function Rt(H){return P.call(String(H),/"/g,"&quot;")}function tt(H){return xe(H)==="[object Array]"&&(!ve||!(typeof H=="object"&&ve in H))}function it(H){return xe(H)==="[object Date]"&&(!ve||!(typeof H=="object"&&ve in H))}function Et(H){return xe(H)==="[object RegExp]"&&(!ve||!(typeof H=="object"&&ve in H))}function Me(H){return xe(H)==="[object Error]"&&(!ve||!(typeof H=="object"&&ve in H))}function Ge(H){return xe(H)==="[object String]"&&(!ve||!(typeof H=="object"&&ve in H))}function B(H){return xe(H)==="[object Number]"&&(!ve||!(typeof H=="object"&&ve in H))}function Q(H){return xe(H)==="[object Boolean]"&&(!ve||!(typeof H=="object"&&ve in H))}function q(H){if(Ie)return H&&typeof H=="object"&&H instanceof Symbol;if(typeof H=="symbol")return!0;if(!H||typeof H!="object"||!Pe)return!1;try{return Pe.call(H),!0}catch{}return!1}function J(H){if(!H||typeof H!="object"||!ke)return!1;try{return ke.call(H),!0}catch{}return!1}var ee=Object.prototype.hasOwnProperty||function(H){return H in this};function V(H,G){return ee.call(H,G)}function xe(H){return I.call(H)}function Ve(H){if(H.name)return H.name;var G=_.call(S.call(H),/^function\s*([\w$]+)/);return G?G[1]:null}function $e(H,G){if(H.indexOf)return H.indexOf(G);for(var st=0,vt=H.length;st<vt;st++)if(H[st]===G)return st;return-1}function ae(H){if(!t||!H||typeof H!="object")return!1;try{t.call(H);try{u.call(H)}catch{return!0}return H instanceof Map}catch{}return!1}function _e(H){if(!h||!H||typeof H!="object")return!1;try{h.call(H,h);try{y.call(H,y)}catch{return!0}return H instanceof WeakMap}catch{}return!1}function Qe(H){if(!m||!H||typeof H!="object")return!1;try{return m.call(H),!0}catch{}return!1}function pt(H){if(!u||!H||typeof H!="object")return!1;try{u.call(H);try{t.call(H)}catch{return!0}return H instanceof Set}catch{}return!1}function mt(H){if(!y||!H||typeof H!="object")return!1;try{y.call(H,y);try{h.call(H,h)}catch{return!0}return H instanceof WeakSet}catch{}return!1}function Yt(H){return!H||typeof H!="object"?!1:typeof HTMLElement<"u"&&H instanceof HTMLElement?!0:typeof H.nodeName=="string"&&typeof H.getAttribute=="function"}function Ot(H,G){if(H.length>G.maxStringLength){var st=H.length-G.maxStringLength,vt="... "+st+" more character"+(st>1?"s":"");return Ot(T.call(H,0,G.maxStringLength),G)+vt}var lt=ht[G.quoteStyle||"single"];lt.lastIndex=0;var We=P.call(P.call(H,lt,"\\$1"),/[\x00-\x1f]/g,Wt);return Vt(We,"single",G)}function Wt(H){var G=H.charCodeAt(0),st={8:"b",9:"t",10:"n",12:"f",13:"r"}[G];return st?"\\"+st:"\\x"+(G<16?"0":"")+M.call(G.toString(16))}function Gt(H){return"Object("+H+")"}function Er(H){return H+" { ? }"}function zt(H,G,st,vt){var lt=vt?Ar(st,vt):X.call(st,", ");return H+" ("+G+") {"+lt+"}"}function sr(H){for(var G=0;G<H.length;G++)if($e(H[G],`
129
129
  `)>=0)return!1;return!0}function dr(H,G){var st;if(H.indent===" ")st=" ";else if(typeof H.indent=="number"&&H.indent>0)st=X.call(Array(H.indent+1)," ");else return null;return{base:st,prev:X.call(Array(G+1),st)}}function Ar(H,G){if(H.length===0)return"";var st=`
130
130
  `+G.prev+G.base;return st+X.call(H,","+st)+`
131
- `+G.prev}function Ht(H,G){var st=tt(H),vt=[];if(st){vt.length=H.length;for(var lt=0;lt<H.length;lt++)vt[lt]=V(H,lt)?G(H[lt],H):""}var We=typeof ye=="function"?ye(H):[],Kt;if(Ie){Kt={};for(var Zt=0;Zt<We.length;Zt++)Kt["$"+We[Zt]]=We[Zt]}for(var Qt in H)V(H,Qt)&&(st&&String(Number(Qt))===Qt&&Qt<H.length||Ie&&Kt["$"+Qt]instanceof Symbol||(z.call(/[^\w$]/,Qt)?vt.push(G(Qt,H)+": "+G(H[Qt],H)):vt.push(Qt+": "+G(H[Qt],H))));if(typeof ye=="function")for(var kr=0;kr<We.length;kr++)ze.call(H,We[kr])&&vt.push("["+G(We[kr])+"]: "+G(H[We[kr]],H));return vt}return gh}var vh,q0;function Fk(){if(q0)return vh;q0=1;var r=ec(),e=ha(),t=function(c,f,h){for(var d=c,y;(y=d.next)!=null;d=y)if(y.key===f)return d.next=y.next,h||(y.next=c.next,c.next=y),y},n=function(c,f){if(c){var h=t(c,f);return h&&h.value}},i=function(c,f,h){var d=t(c,f);d?d.value=h:c.next={key:f,next:c.next,value:h}},a=function(c,f){return c?!!t(c,f):!1},u=function(c,f){if(c)return t(c,f,!0)};return vh=function(){var f,h={assert:function(d){if(!h.has(d))throw new e("Side channel does not contain "+r(d))},delete:function(d){var y=f&&f.next,g=u(f,d);return g&&y&&y===g&&(f=void 0),!!g},get:function(d){return n(f,d)},has:function(d){return a(f,d)},set:function(d,y){f||(f={next:void 0}),i(f,d,y)}};return h},vh}var bh,j0;function U0(){return j0||(j0=1,bh=Object),bh}var wh,$0;function Lk(){return $0||($0=1,wh=Error),wh}var _h,B0;function qk(){return B0||(B0=1,_h=EvalError),_h}var xh,V0;function jk(){return V0||(V0=1,xh=RangeError),xh}var Sh,W0;function Uk(){return W0||(W0=1,Sh=ReferenceError),Sh}var Eh,z0;function $k(){return z0||(z0=1,Eh=SyntaxError),Eh}var Oh,H0;function Bk(){return H0||(H0=1,Oh=URIError),Oh}var Th,G0;function Vk(){return G0||(G0=1,Th=Math.abs),Th}var Ah,Q0;function Wk(){return Q0||(Q0=1,Ah=Math.floor),Ah}var kh,J0;function zk(){return J0||(J0=1,kh=Math.max),kh}var Ih,Y0;function Hk(){return Y0||(Y0=1,Ih=Math.min),Ih}var Ch,K0;function Gk(){return K0||(K0=1,Ch=Math.pow),Ch}var Ph,Z0;function Qk(){return Z0||(Z0=1,Ph=Math.round),Ph}var Nh,X0;function Jk(){return X0||(X0=1,Nh=Number.isNaN||function(e){return e!==e}),Nh}var Rh,eb;function Yk(){if(eb)return Rh;eb=1;var r=Jk();return Rh=function(t){return r(t)||t===0?t:t<0?-1:1},Rh}var Mh,tb;function Kk(){return tb||(tb=1,Mh=Object.getOwnPropertyDescriptor),Mh}var Dh,rb;function nb(){if(rb)return Dh;rb=1;var r=Kk();if(r)try{r([],"length")}catch{r=null}return Dh=r,Dh}var Fh,ib;function Zk(){if(ib)return Fh;ib=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return Fh=r,Fh}var Lh,sb;function Xk(){return sb||(sb=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(var a 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 u=Object.getOwnPropertySymbols(e);if(u.length!==1||u[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(e,t);if(c.value!==i||c.enumerable!==!0)return!1}return!0}),Lh}var qh,ab;function eI(){if(ab)return qh;ab=1;var r=typeof Symbol<"u"&&Symbol,e=Xk();return qh=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},qh}var jh,ob;function ub(){return ob||(ob=1,jh=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),jh}var Uh,cb;function lb(){if(cb)return Uh;cb=1;var r=U0();return Uh=r.getPrototypeOf||null,Uh}var $h,fb;function tI(){if(fb)return $h;fb=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 $h=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 _=h.apply(this,i(d,arguments));return Object(_)===_?_:this}return h.apply(f,i(d,arguments))},m=t(0,h.length-d.length),b=[],I=0;I<m;I++)b[I]="$"+I;if(y=Function("binder","return function ("+u(b,",")+"){ return binder.apply(this,arguments); }")(g),h.prototype){var S=function(){};S.prototype=h.prototype,y.prototype=new S,S.prototype=null}return y},$h}var Bh,hb;function tc(){if(hb)return Bh;hb=1;var r=tI();return Bh=Function.prototype.bind||r,Bh}var Vh,db;function Wh(){return db||(db=1,Vh=Function.prototype.call),Vh}var zh,pb;function mb(){return pb||(pb=1,zh=Function.prototype.apply),zh}var Hh,yb;function rI(){return yb||(yb=1,Hh=typeof Reflect<"u"&&Reflect&&Reflect.apply),Hh}var Gh,gb;function nI(){if(gb)return Gh;gb=1;var r=tc(),e=mb(),t=Wh(),n=rI();return Gh=n||r.call(t,e),Gh}var Qh,vb;function bb(){if(vb)return Qh;vb=1;var r=tc(),e=ha(),t=Wh(),n=nI();return Qh=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return n(r,t,a)},Qh}var Jh,wb;function iI(){if(wb)return Jh;wb=1;var r=bb(),e=nb(),t;try{t=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var n=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return Jh=n&&typeof n.get=="function"?r([n.get]):typeof a=="function"?function(c){return a(c==null?c:i(c))}:!1,Jh}var Yh,_b;function sI(){if(_b)return Yh;_b=1;var r=ub(),e=lb(),t=iI();return Yh=r?function(i){return r(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,Yh}var Kh,xb;function aI(){if(xb)return Kh;xb=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=tc();return Kh=t.call(r,e),Kh}var Zh,Sb;function Xh(){if(Sb)return Zh;Sb=1;var r,e=U0(),t=Lk(),n=qk(),i=jk(),a=Uk(),u=$k(),c=ha(),f=Bk(),h=Vk(),d=Wk(),y=zk(),g=Hk(),m=Gk(),b=Qk(),I=Yk(),S=Function,_=function(Me){try{return S('"use strict"; return ('+Me+").constructor;")()}catch{}},T=nb(),P=Zk(),M=function(){throw new c},U=T?function(){try{return arguments.callee,M}catch{try{return T(arguments,"callee").get}catch{return M}}}():M,z=eI()(),Z=sI(),X=lb(),fe=ub(),se=mb(),ke=Wh(),ye={},Pe=typeof Uint8Array>"u"||!Z?r:Z(Uint8Array),Ie={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":z&&Z?Z([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":ye,"%AsyncGenerator%":ye,"%AsyncGeneratorFunction%":ye,"%AsyncIteratorPrototype%":ye,"%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%":t,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":S,"%GeneratorFunction%":ye,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":z&&Z?Z(Z([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!z||!Z?r:Z(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":T,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!z||!Z?r:Z(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":z&&Z?Z(""[Symbol.iterator]()):r,"%Symbol%":z?Symbol:r,"%SyntaxError%":u,"%ThrowTypeError%":U,"%TypedArray%":Pe,"%TypeError%":c,"%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%":f,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":ke,"%Function.prototype.apply%":se,"%Object.defineProperty%":P,"%Object.getPrototypeOf%":X,"%Math.abs%":h,"%Math.floor%":d,"%Math.max%":y,"%Math.min%":g,"%Math.pow%":m,"%Math.round%":b,"%Math.sign%":I,"%Reflect.getPrototypeOf%":fe};if(Z)try{null.error}catch(Me){var ve=Z(Z(Me));Ie["%Error.prototype%"]=ve}var ze=function Me(Ge){var B;if(Ge==="%AsyncFunction%")B=_("async function () {}");else if(Ge==="%GeneratorFunction%")B=_("function* () {}");else if(Ge==="%AsyncGeneratorFunction%")B=_("async function* () {}");else if(Ge==="%AsyncGenerator%"){var Q=Me("%AsyncGeneratorFunction%");Q&&(B=Q.prototype)}else if(Ge==="%AsyncIteratorPrototype%"){var q=Me("%AsyncGenerator%");q&&Z&&(B=Z(q.prototype))}return Ie[Ge]=B,B},he={__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"]},re=tc(),ge=aI(),je=re.call(ke,Array.prototype.concat),Se=re.call(se,Array.prototype.splice),He=re.call(ke,String.prototype.replace),ht=re.call(ke,String.prototype.slice),Vt=re.call(ke,RegExp.prototype.exec),Rt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,tt=/\\(\\)?/g,it=function(Ge){var B=ht(Ge,0,1),Q=ht(Ge,-1);if(B==="%"&&Q!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(Q==="%"&&B!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var q=[];return He(Ge,Rt,function(J,ee,V,xe){q[q.length]=V?He(xe,tt,"$1"):ee||J}),q},Et=function(Ge,B){var Q=Ge,q;if(ge(he,Q)&&(q=he[Q],Q="%"+q[0]+"%"),ge(Ie,Q)){var J=Ie[Q];if(J===ye&&(J=ze(Q)),typeof J>"u"&&!B)throw new c("intrinsic "+Ge+" exists, but is not available. Please file an issue!");return{alias:q,name:Q,value:J}}throw new u("intrinsic "+Ge+" does not exist!")};return Zh=function(Ge,B){if(typeof Ge!="string"||Ge.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof B!="boolean")throw new c('"allowMissing" argument must be a boolean');if(Vt(/^%?[^%]*%?$/,Ge)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Q=it(Ge),q=Q.length>0?Q[0]:"",J=Et("%"+q+"%",B),ee=J.name,V=J.value,xe=!1,Ve=J.alias;Ve&&(q=Ve[0],Se(Q,je([0,1],Ve)));for(var $e=1,ae=!0;$e<Q.length;$e+=1){var _e=Q[$e],Qe=ht(_e,0,1),pt=ht(_e,-1);if((Qe==='"'||Qe==="'"||Qe==="`"||pt==='"'||pt==="'"||pt==="`")&&Qe!==pt)throw new u("property names with quotes must have matching quotes");if((_e==="constructor"||!ae)&&(xe=!0),q+="."+_e,ee="%"+q+"%",ge(Ie,ee))V=Ie[ee];else if(V!=null){if(!(_e in V)){if(!B)throw new c("base intrinsic for "+Ge+" exists, but the property is not available.");return}if(T&&$e+1>=Q.length){var mt=T(V,_e);ae=!!mt,ae&&"get"in mt&&!("originalValue"in mt.get)?V=mt.get:V=V[_e]}else ae=ge(V,_e),V=V[_e];ae&&!xe&&(Ie[ee]=V)}}return V},Zh}var ed,Eb;function Ob(){if(Eb)return ed;Eb=1;var r=Xh(),e=bb(),t=e([r("%String.prototype.indexOf%")]);return ed=function(i,a){var u=r(i,!!a);return typeof u=="function"&&t(i,".prototype.")>-1?e([u]):u},ed}var td,Tb;function Ab(){if(Tb)return td;Tb=1;var r=Xh(),e=Ob(),t=ec(),n=ha(),i=r("%Map%",!0),a=e("Map.prototype.get",!0),u=e("Map.prototype.set",!0),c=e("Map.prototype.has",!0),f=e("Map.prototype.delete",!0),h=e("Map.prototype.size",!0);return td=!!i&&function(){var y,g={assert:function(m){if(!g.has(m))throw new n("Side channel does not contain "+t(m))},delete:function(m){if(y){var b=f(y,m);return h(y)===0&&(y=void 0),b}return!1},get:function(m){if(y)return a(y,m)},has:function(m){return y?c(y,m):!1},set:function(m,b){y||(y=new i),u(y,m,b)}};return g},td}var rd,kb;function oI(){if(kb)return rd;kb=1;var r=Xh(),e=Ob(),t=ec(),n=Ab(),i=ha(),a=r("%WeakMap%",!0),u=e("WeakMap.prototype.get",!0),c=e("WeakMap.prototype.set",!0),f=e("WeakMap.prototype.has",!0),h=e("WeakMap.prototype.delete",!0);return rd=a?function(){var y,g,m={assert:function(b){if(!m.has(b))throw new i("Side channel does not contain "+t(b))},delete:function(b){if(a&&b&&(typeof b=="object"||typeof b=="function")){if(y)return h(y,b)}else if(n&&g)return g.delete(b);return!1},get:function(b){return a&&b&&(typeof b=="object"||typeof b=="function")&&y?u(y,b):g&&g.get(b)},has:function(b){return a&&b&&(typeof b=="object"||typeof b=="function")&&y?f(y,b):!!g&&g.has(b)},set:function(b,I){a&&b&&(typeof b=="object"||typeof b=="function")?(y||(y=new a),c(y,b,I)):n&&(g||(g=n()),g.set(b,I))}};return m}:n,rd}var nd,Ib;function uI(){if(Ib)return nd;Ib=1;var r=ha(),e=ec(),t=Fk(),n=Ab(),i=oI(),a=i||n||t;return nd=function(){var c,f={assert:function(h){if(!f.has(h))throw new r("Side channel does not contain "+e(h))},delete:function(h){return!!c&&c.delete(h)},get:function(h){return c&&c.get(h)},has:function(h){return!!c&&c.has(h)},set:function(h,d){c||(c=a()),c.set(h,d)}};return f},nd}var id,Cb;function sd(){if(Cb)return id;Cb=1;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return id={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},id}var ad,Pb;function Nb(){if(Pb)return ad;Pb=1;var r=sd(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var S=[],_=0;_<256;++_)S.push("%"+((_<16?"0":"")+_.toString(16)).toUpperCase());return S}(),i=function(_){for(;_.length>1;){var T=_.pop(),P=T.obj[T.prop];if(t(P)){for(var M=[],U=0;U<P.length;++U)typeof P[U]<"u"&&M.push(P[U]);T.obj[T.prop]=M}}},a=function(_,T){for(var P=T&&T.plainObjects?Object.create(null):{},M=0;M<_.length;++M)typeof _[M]<"u"&&(P[M]=_[M]);return P},u=function S(_,T,P){if(!T)return _;if(typeof T!="object"){if(t(_))_.push(T);else if(_&&typeof _=="object")(P&&(P.plainObjects||P.allowPrototypes)||!e.call(Object.prototype,T))&&(_[T]=!0);else return[_,T];return _}if(!_||typeof _!="object")return[_].concat(T);var M=_;return t(_)&&!t(T)&&(M=a(_,P)),t(_)&&t(T)?(T.forEach(function(U,z){if(e.call(_,z)){var Z=_[z];Z&&typeof Z=="object"&&U&&typeof U=="object"?_[z]=S(Z,U,P):_.push(U)}else _[z]=U}),_):Object.keys(T).reduce(function(U,z){var Z=T[z];return e.call(U,z)?U[z]=S(U[z],Z,P):U[z]=Z,U},M)},c=function(_,T){return Object.keys(T).reduce(function(P,M){return P[M]=T[M],P},_)},f=function(S,_,T){var P=S.replace(/\+/g," ");if(T==="iso-8859-1")return P.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(P)}catch{return P}},h=1024,d=function(_,T,P,M,U){if(_.length===0)return _;var z=_;if(typeof _=="symbol"?z=Symbol.prototype.toString.call(_):typeof _!="string"&&(z=String(_)),P==="iso-8859-1")return escape(z).replace(/%u[0-9a-f]{4}/gi,function(Pe){return"%26%23"+parseInt(Pe.slice(2),16)+"%3B"});for(var Z="",X=0;X<z.length;X+=h){for(var fe=z.length>=h?z.slice(X,X+h):z,se=[],ke=0;ke<fe.length;++ke){var ye=fe.charCodeAt(ke);if(ye===45||ye===46||ye===95||ye===126||ye>=48&&ye<=57||ye>=65&&ye<=90||ye>=97&&ye<=122||U===r.RFC1738&&(ye===40||ye===41)){se[se.length]=fe.charAt(ke);continue}if(ye<128){se[se.length]=n[ye];continue}if(ye<2048){se[se.length]=n[192|ye>>6]+n[128|ye&63];continue}if(ye<55296||ye>=57344){se[se.length]=n[224|ye>>12]+n[128|ye>>6&63]+n[128|ye&63];continue}ke+=1,ye=65536+((ye&1023)<<10|fe.charCodeAt(ke)&1023),se[se.length]=n[240|ye>>18]+n[128|ye>>12&63]+n[128|ye>>6&63]+n[128|ye&63]}Z+=se.join("")}return Z},y=function(_){for(var T=[{obj:{o:_},prop:"o"}],P=[],M=0;M<T.length;++M)for(var U=T[M],z=U.obj[U.prop],Z=Object.keys(z),X=0;X<Z.length;++X){var fe=Z[X],se=z[fe];typeof se=="object"&&se!==null&&P.indexOf(se)===-1&&(T.push({obj:z,prop:fe}),P.push(se))}return i(T),_},g=function(_){return Object.prototype.toString.call(_)==="[object RegExp]"},m=function(_){return!_||typeof _!="object"?!1:!!(_.constructor&&_.constructor.isBuffer&&_.constructor.isBuffer(_))},b=function(_,T){return[].concat(_,T)},I=function(_,T){if(t(_)){for(var P=[],M=0;M<_.length;M+=1)P.push(T(_[M]));return P}return T(_)};return ad={arrayToObject:a,assign:c,combine:b,compact:y,decode:f,encode:d,isBuffer:m,isRegExp:g,maybeMap:I,merge:u},ad}var od,Rb;function cI(){if(Rb)return od;Rb=1;var r=uI(),e=Nb(),t=sd(),n=Object.prototype.hasOwnProperty,i={brackets:function(S){return S+"[]"},comma:"comma",indices:function(S,_){return S+"["+_+"]"},repeat:function(S){return S}},a=Array.isArray,u=Array.prototype.push,c=function(I,S){u.apply(I,a(S)?S:[S])},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(S){return f.call(S)},skipNulls:!1,strictNullHandling:!1},y=function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"},g={},m=function I(S,_,T,P,M,U,z,Z,X,fe,se,ke,ye,Pe,Ie,ve,ze,he){for(var re=S,ge=he,je=0,Se=!1;(ge=ge.get(g))!==void 0&&!Se;){var He=ge.get(S);if(je+=1,typeof He<"u"){if(He===je)throw new RangeError("Cyclic object value");Se=!0}typeof ge.get(g)>"u"&&(je=0)}if(typeof fe=="function"?re=fe(_,re):re instanceof Date?re=ye(re):T==="comma"&&a(re)&&(re=e.maybeMap(re,function(ee){return ee instanceof Date?ye(ee):ee})),re===null){if(U)return X&&!ve?X(_,d.encoder,ze,"key",Pe):_;re=""}if(y(re)||e.isBuffer(re)){if(X){var ht=ve?_:X(_,d.encoder,ze,"key",Pe);return[Ie(ht)+"="+Ie(X(re,d.encoder,ze,"value",Pe))]}return[Ie(_)+"="+Ie(String(re))]}var Vt=[];if(typeof re>"u")return Vt;var Rt;if(T==="comma"&&a(re))ve&&X&&(re=e.maybeMap(re,X)),Rt=[{value:re.length>0?re.join(",")||null:void 0}];else if(a(fe))Rt=fe;else{var tt=Object.keys(re);Rt=se?tt.sort(se):tt}var it=Z?_.replace(/\./g,"%2E"):_,Et=P&&a(re)&&re.length===1?it+"[]":it;if(M&&a(re)&&re.length===0)return Et+"[]";for(var Me=0;Me<Rt.length;++Me){var Ge=Rt[Me],B=typeof Ge=="object"&&typeof Ge.value<"u"?Ge.value:re[Ge];if(!(z&&B===null)){var Q=ke&&Z?Ge.replace(/\./g,"%2E"):Ge,q=a(re)?typeof T=="function"?T(Et,Q):Et:Et+(ke?"."+Q:"["+Q+"]");he.set(S,je);var J=r();J.set(g,he),c(Vt,I(B,q,T,P,M,U,z,Z,T==="comma"&&ve&&a(re)?null:X,fe,se,ke,ye,Pe,Ie,ve,ze,J))}}return Vt},b=function(S){if(!S)return d;if(typeof S.allowEmptyArrays<"u"&&typeof S.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof S.encodeDotInKeys<"u"&&typeof S.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(S.encoder!==null&&typeof S.encoder<"u"&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var _=S.charset||d.charset;if(typeof S.charset<"u"&&S.charset!=="utf-8"&&S.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var T=t.default;if(typeof S.format<"u"){if(!n.call(t.formatters,S.format))throw new TypeError("Unknown format option provided.");T=S.format}var P=t.formatters[T],M=d.filter;(typeof S.filter=="function"||a(S.filter))&&(M=S.filter);var U;if(S.arrayFormat in i?U=S.arrayFormat:"indices"in S?U=S.indices?"indices":"repeat":U=d.arrayFormat,"commaRoundTrip"in S&&typeof S.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var z=typeof S.allowDots>"u"?S.encodeDotInKeys===!0?!0:d.allowDots:!!S.allowDots;return{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:d.addQueryPrefix,allowDots:z,allowEmptyArrays:typeof S.allowEmptyArrays=="boolean"?!!S.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:U,charset:_,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:d.charsetSentinel,commaRoundTrip:S.commaRoundTrip,delimiter:typeof S.delimiter>"u"?d.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:d.encode,encodeDotInKeys:typeof S.encodeDotInKeys=="boolean"?S.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof S.encoder=="function"?S.encoder:d.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:d.encodeValuesOnly,filter:M,format:T,formatter:P,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:d.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:d.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:d.strictNullHandling}};return od=function(I,S){var _=I,T=b(S),P,M;typeof T.filter=="function"?(M=T.filter,_=M("",_)):a(T.filter)&&(M=T.filter,P=M);var U=[];if(typeof _!="object"||_===null)return"";var z=i[T.arrayFormat],Z=z==="comma"&&T.commaRoundTrip;P||(P=Object.keys(_)),T.sort&&P.sort(T.sort);for(var X=r(),fe=0;fe<P.length;++fe){var se=P[fe];T.skipNulls&&_[se]===null||c(U,m(_[se],se,z,Z,T.allowEmptyArrays,T.strictNullHandling,T.skipNulls,T.encodeDotInKeys,T.encode?T.encoder:null,T.filter,T.sort,T.allowDots,T.serializeDate,T.format,T.formatter,T.encodeValuesOnly,T.charset,X))}var ke=U.join(T.delimiter),ye=T.addQueryPrefix===!0?"?":"";return T.charsetSentinel&&(T.charset==="iso-8859-1"?ye+="utf8=%26%2310003%3B&":ye+="utf8=%E2%9C%93&"),ke.length>0?ye+ke:""},od}var ud,Mb;function lI(){if(Mb)return ud;Mb=1;var r=Nb(),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,strictDepth:!1,strictNullHandling:!1},i=function(g){return g.replace(/&#(\d+);/g,function(m,b){return String.fromCharCode(parseInt(b,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,b){var I={__proto__:null},S=b.ignoreQueryPrefix?m.replace(/^\?/,""):m;S=S.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var _=b.parameterLimit===1/0?void 0:b.parameterLimit,T=S.split(b.delimiter,_),P=-1,M,U=b.charset;if(b.charsetSentinel)for(M=0;M<T.length;++M)T[M].indexOf("utf8=")===0&&(T[M]===c?U="utf-8":T[M]===u&&(U="iso-8859-1"),P=M,M=T.length);for(M=0;M<T.length;++M)if(M!==P){var z=T[M],Z=z.indexOf("]="),X=Z===-1?z.indexOf("="):Z+1,fe,se;X===-1?(fe=b.decoder(z,n.decoder,U,"key"),se=b.strictNullHandling?null:""):(fe=b.decoder(z.slice(0,X),n.decoder,U,"key"),se=r.maybeMap(a(z.slice(X+1),b),function(ye){return b.decoder(ye,n.decoder,U,"value")})),se&&b.interpretNumericEntities&&U==="iso-8859-1"&&(se=i(se)),z.indexOf("[]=")>-1&&(se=t(se)?[se]:se);var ke=e.call(I,fe);ke&&b.duplicates==="combine"?I[fe]=r.combine(I[fe],se):(!ke||b.duplicates==="last")&&(I[fe]=se)}return I},h=function(g,m,b,I){for(var S=I?m:a(m,b),_=g.length-1;_>=0;--_){var T,P=g[_];if(P==="[]"&&b.parseArrays)T=b.allowEmptyArrays&&(S===""||b.strictNullHandling&&S===null)?[]:[].concat(S);else{T=b.plainObjects?Object.create(null):{};var M=P.charAt(0)==="["&&P.charAt(P.length-1)==="]"?P.slice(1,-1):P,U=b.decodeDotInKeys?M.replace(/%2E/g,"."):M,z=parseInt(U,10);!b.parseArrays&&U===""?T={0:S}:!isNaN(z)&&P!==U&&String(z)===U&&z>=0&&b.parseArrays&&z<=b.arrayLimit?(T=[],T[z]=S):U!=="__proto__"&&(T[U]=S)}S=T}return S},d=function(m,b,I,S){if(m){var _=I.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m,T=/(\[[^[\]]*])/,P=/(\[[^[\]]*])/g,M=I.depth>0&&T.exec(_),U=M?_.slice(0,M.index):_,z=[];if(U){if(!I.plainObjects&&e.call(Object.prototype,U)&&!I.allowPrototypes)return;z.push(U)}for(var Z=0;I.depth>0&&(M=P.exec(_))!==null&&Z<I.depth;){if(Z+=1,!I.plainObjects&&e.call(Object.prototype,M[1].slice(1,-1))&&!I.allowPrototypes)return;z.push(M[1])}if(M){if(I.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+I.depth+" and strictDepth is true");z.push("["+_.slice(M.index)+"]")}return h(z,b,I,S)}},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 b=typeof m.charset>"u"?n.charset:m.charset,I=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(I!=="combine"&&I!=="first"&&I!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var S=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:S,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:b,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:I,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,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:n.strictDepth,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling}};return ud=function(g,m){var b=y(m);if(g===""||g===null||typeof g>"u")return b.plainObjects?Object.create(null):{};for(var I=typeof g=="string"?f(g,b):g,S=b.plainObjects?Object.create(null):{},_=Object.keys(I),T=0;T<_.length;++T){var P=_[T],M=d(P,I[P],b,typeof g=="string");S=r.merge(S,M,b)}return b.allowSparse===!0?S:r.compact(S)},ud}var cd,Db;function fI(){if(Db)return cd;Db=1;var r=cI(),e=lI(),t=sd();return cd={formats:t,parse:e,stringify:r},cd}(function(r,e){(function(t,n){n(e,Rk,Mk,fI())})(pi,function(t,n,i,a){var u=function(B,Q,q,J){function ee(V){return V instanceof q?V:new q(function(xe){xe(V)})}return new(q||(q=Promise))(function(V,xe){function Ve(_e){try{ae(J.next(_e))}catch(Qe){xe(Qe)}}function $e(_e){try{ae(J.throw(_e))}catch(Qe){xe(Qe)}}function ae(_e){_e.done?V(_e.value):ee(_e.value).then(Ve,$e)}ae((J=J.apply(B,Q||[])).next())})},c=function(B,Q){var q={label:0,sent:function(){if(V[0]&1)throw V[1];return V[1]},trys:[],ops:[]},J,ee,V,xe;return xe={next:Ve(0),throw:Ve(1),return:Ve(2)},typeof Symbol=="function"&&(xe[Symbol.iterator]=function(){return this}),xe;function Ve(ae){return function(_e){return $e([ae,_e])}}function $e(ae){if(J)throw new TypeError("Generator is already executing.");for(;q;)try{if(J=1,ee&&(V=ae[0]&2?ee.return:ae[0]?ee.throw||((V=ee.return)&&V.call(ee),0):ee.next)&&!(V=V.call(ee,ae[1])).done)return V;switch(ee=0,V&&(ae=[ae[0]&2,V.value]),ae[0]){case 0:case 1:V=ae;break;case 4:return q.label++,{value:ae[1],done:!1};case 5:q.label++,ee=ae[1],ae=[0];continue;case 7:ae=q.ops.pop(),q.trys.pop();continue;default:if(V=q.trys,!(V=V.length>0&&V[V.length-1])&&(ae[0]===6||ae[0]===2)){q=0;continue}if(ae[0]===3&&(!V||ae[1]>V[0]&&ae[1]<V[3])){q.label=ae[1];break}if(ae[0]===6&&q.label<V[1]){q.label=V[1],V=ae;break}if(V&&q.label<V[2]){q.label=V[2],q.ops.push(ae);break}V[2]&&q.ops.pop(),q.trys.pop();continue}ae=Q.call(B,q)}catch(_e){ae=[6,_e],ee=0}finally{J=V=0}if(ae[0]&5)throw ae[1];return{value:ae[0]?ae[1]:void 0,done:!0}}};function f(B,Q){if(B.directives&&B.directives.length){var q={};return B.directives.forEach(function(J){q[J.name.value]=i.argumentsObjectFromField(J,Q)}),q}return null}var h=Object.prototype.hasOwnProperty;function d(B,Q){Q!==null&&typeof Q=="object"&&Object.keys(Q).forEach(function(q){var J=Q[q];h.call(B,q)?d(B[q],J):B[q]=J})}function y(B,Q,q,J,ee,V){V===void 0&&(V={});var xe=i.getMainDefinition(Q),Ve=i.getFragmentDefinitions(Q),$e=i.createFragmentMap(Ve),ae=V.resultMapper,_e=V.fragmentMatcher||function(){return!0},Qe={fragmentMap:$e,contextValue:J,variableValues:ee,resultMapper:ae,resolver:B,fragmentMatcher:_e};return g(xe.selectionSet,q,Qe)}function g(B,Q,q){return u(this,void 0,void 0,function(){var J,ee,V,xe,Ve,$e=this;return c(this,function(ae){switch(ae.label){case 0:return J=q.fragmentMap,ee=q.contextValue,V=q.variableValues,xe={},Ve=function(_e){return u($e,void 0,void 0,function(){var Qe,pt,mt,Yt,Ot;return c(this,function(Wt){switch(Wt.label){case 0:return i.shouldInclude(_e,V)?i.isField(_e)?[4,m(_e,Q,q)]:[3,2]:[2];case 1:return Qe=Wt.sent(),pt=i.resultKeyNameFromField(_e),Qe!==void 0&&(xe[pt]===void 0?xe[pt]=Qe:d(xe[pt],Qe)),[2];case 2:if(i.isInlineFragment(_e))mt=_e;else if(mt=J[_e.name.value],!mt)throw new Error("No fragment named "+_e.name.value);return Yt=mt.typeCondition.name.value,q.fragmentMatcher(Q,Yt,ee)?[4,g(mt.selectionSet,Q,q)]:[3,4];case 3:Ot=Wt.sent(),d(xe,Ot),Wt.label=4;case 4:return[2]}})})},[4,Promise.all(B.selections.map(Ve))];case 1:return ae.sent(),q.resultMapper?[2,q.resultMapper(xe,Q)]:[2,xe]}})})}function m(B,Q,q){return u(this,void 0,void 0,function(){var J,ee,V,xe,Ve,$e,ae;return c(this,function(_e){switch(_e.label){case 0:return J=q.variableValues,ee=q.contextValue,V=q.resolver,xe=B.name.value,Ve=i.argumentsObjectFromField(B,J),$e={isLeaf:!B.selectionSet,resultKey:i.resultKeyNameFromField(B),directives:f(B,J),field:B},[4,V(xe,Q,Ve,ee,$e)];case 1:return ae=_e.sent(),B.selectionSet?ae==null?[2,ae]:Array.isArray(ae)?[2,b(B,ae,q)]:[2,g(B.selectionSet,ae,q)]:[2,ae]}})})}function b(B,Q,q){return Promise.all(Q.map(function(J){return J===null?null:Array.isArray(J)?b(B,J,q):g(B.selectionSet,J,q)}))}var I=function(){var B=function(Q,q){return B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,ee){J.__proto__=ee}||function(J,ee){for(var V in ee)ee.hasOwnProperty(V)&&(J[V]=ee[V])},B(Q,q)};return function(Q,q){B(Q,q);function J(){this.constructor=Q}Q.prototype=q===null?Object.create(q):(J.prototype=q.prototype,new J)}}(),S=function(){return S=Object.assign||function(B){for(var Q,q=1,J=arguments.length;q<J;q++){Q=arguments[q];for(var ee in Q)Object.prototype.hasOwnProperty.call(Q,ee)&&(B[ee]=Q[ee])}return B},S.apply(this,arguments)},_=function(B,Q,q,J){function ee(V){return V instanceof q?V:new q(function(xe){xe(V)})}return new(q||(q=Promise))(function(V,xe){function Ve(_e){try{ae(J.next(_e))}catch(Qe){xe(Qe)}}function $e(_e){try{ae(J.throw(_e))}catch(Qe){xe(Qe)}}function ae(_e){_e.done?V(_e.value):ee(_e.value).then(Ve,$e)}ae((J=J.apply(B,Q||[])).next())})},T=function(B,Q){var q={label:0,sent:function(){if(V[0]&1)throw V[1];return V[1]},trys:[],ops:[]},J,ee,V,xe;return xe={next:Ve(0),throw:Ve(1),return:Ve(2)},typeof Symbol=="function"&&(xe[Symbol.iterator]=function(){return this}),xe;function Ve(ae){return function(_e){return $e([ae,_e])}}function $e(ae){if(J)throw new TypeError("Generator is already executing.");for(;q;)try{if(J=1,ee&&(V=ae[0]&2?ee.return:ae[0]?ee.throw||((V=ee.return)&&V.call(ee),0):ee.next)&&!(V=V.call(ee,ae[1])).done)return V;switch(ee=0,V&&(ae=[ae[0]&2,V.value]),ae[0]){case 0:case 1:V=ae;break;case 4:return q.label++,{value:ae[1],done:!1};case 5:q.label++,ee=ae[1],ae=[0];continue;case 7:ae=q.ops.pop(),q.trys.pop();continue;default:if(V=q.trys,!(V=V.length>0&&V[V.length-1])&&(ae[0]===6||ae[0]===2)){q=0;continue}if(ae[0]===3&&(!V||ae[1]>V[0]&&ae[1]<V[3])){q.label=ae[1];break}if(ae[0]===6&&q.label<V[1]){q.label=V[1],V=ae;break}if(V&&q.label<V[2]){q.label=V[2],q.ops.push(ae);break}V[2]&&q.ops.pop(),q.trys.pop();continue}ae=Q.call(B,q)}catch(_e){ae=[6,_e],ee=0}finally{J=V=0}if(ae[0]&5)throw ae[1];return{value:ae[0]?ae[1]:void 0,done:!0}}},P=function(){for(var B=0,Q=0,q=arguments.length;Q<q;Q++)B+=arguments[Q].length;for(var J=Array(B),ee=0,Q=0;Q<q;Q++)for(var V=arguments[Q],xe=0,Ve=V.length;xe<Ve;xe++,ee++)J[ee]=V[xe];return J},M=function(B){var Q=B.replace(/\s/g,""),q=Q.replace(/\[(.*)\]/,function(J,ee,V,xe){return((ee!=null&&ee.length)>0?ee:null)||Q});return q},U=function(B,Q,q,J){if(Array.isArray(B)){var ee=M(Q);return B.map(function(V){return U(V,ee,q,J)})}return B==null||typeof B=="number"||typeof B=="boolean"||typeof B=="string"?B:q(B,Q,q,J)},z=function(B){return B.directives&&B.directives.length?B.directives.find(function(Q){return Q.name.value==="rest"}):null};function Z(B,Q,q,J,ee){return ee==null||Q==null||typeof Q=="number"||typeof Q=="boolean"||typeof Q=="string"||ee.selections.forEach(function(V){if(i.isInlineFragment(V))Z(B,Q,q,J,V.selectionSet);else if(V.kind==="FragmentSpread"){var xe=J[V.name.value];Z(B,Q,q,J,xe.selectionSet)}else if(i.isField(V)){var Ve=i.resultKeyNameFromField(V);Ve===B&&z(V)!=null?X(Q,q,J,V.selectionSet):Z(B,Q,q,J,V.selectionSet)}else return function($e){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()}),Q}function X(B,Q,q,J){if(!(B==null||typeof B=="number"||typeof B=="boolean"||typeof B=="string")){if(Array.isArray(B)){B.forEach(function(ee){return X(ee,Q,q,J)});return}J.selections.forEach(function(ee){if(i.isInlineFragment(ee))X(B,Q,q,ee.selectionSet);else if(ee.kind==="FragmentSpread"){var V=q[ee.name.value];X(B,Q,q,V.selectionSet)}else if(i.isField(ee)){var xe=B[ee.name.value];ee.name.value==="__typename"||(typeof xe>"u"?B[ee.name.value]=null:xe!=null&&typeof xe=="object"&&ee.selectionSet!=null&&X(xe,Q,q,ee.selectionSet))}else return function(Ve){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()})}}var fe=function(B,Q){var q=B[Q||tt]||B[tt];return typeof q=="string"?{uri:q}:S({responseTransformer:null},q)},se=function(B,Q,q){return q===void 0||Q===void 0?B:B.replace(":"+Q,q)},ke=function(){function B(){}return B.replacerForPath=function(Q){if(Q in B.cache)return B.cache[Q];var q=Q.indexOf("?"),J=Q.split(B.argReplacement),ee=[],V=!1;J.reduce(function(Ve,$e){if($e===""||$e==="{}")return Ve+$e.length;var ae=Ve+$e.length;if($e[0]==="{"&&$e[$e.length-1]==="}"){var _e=$e.slice(1,$e.length-1).split(".");ee.push(function(Qe,pt){try{var mt=ye(Qe,_e);return!pt||typeof mt!="object"||mt==null?String(mt):a.stringify(mt)}catch{var Yt=[Q,_e.join(".")].join("|");return Yt in B.warnTable||(console.warn("Warning: RestLink caught an error while unpacking",Yt,"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."),B.warnTable[Yt]=!0),""}})}else ee.push($e),!V&&ae>=q&&(V=!0,ee.push(!0));return ae},0);var xe=function(Ve){var $e=!1,ae=ee.reduce(function(_e,Qe){return typeof Qe=="string"?_e+Qe:typeof Qe=="boolean"?($e=!0,_e):_e+Qe(Ve,$e)},"");return ae};return B.cache[Q]=xe},B.cache={},B.warnTable={},B.argReplacement=/({[._a-zA-Z0-9]*})/,B}();function ye(B,Q){if(Q.length===0)return B;var q=P(Q),J=q.shift();return ye(B[J],q)}var Pe=["__typename"],Ie=typeof globalThis=="object"&&globalThis||pi,ve=function(B,Q,q){q===void 0&&(q=[]);var J=null;return Q.length!=2?J=function(ee,V){return Q(ee)}:J=Q,Array.isArray(B)?B.map(function(ee,V){return ve(ee,J,P(q,[String(V)]))}):B==null||typeof B!="object"||B.constructor!==Object||Ie.FileList&&B instanceof FileList||Ie.File&&B instanceof File?B:Object.keys(B).reduce(function(ee,V){var xe=B[V];if(Pe.indexOf(V)!==-1)return ee[V]=xe,ee;var Ve=P(q,[V]);return ee[J(V,Ve)]=ve(xe,J,Ve),ee},{})},ze=function(B){return B},he=function(B){return B instanceof Headers?B:new Headers(B||{})},re=function(){for(var B=[],Q=0;Q<arguments.length;Q++)B[Q]=arguments[Q];return B.reduce(function(q,J){return J&&(J.forEach||(J=he(J)),J.forEach(function(ee,V){q.append(V,ee)})),q},new Headers)},ge=function(B,Q,q){var J=new Headers;return B.forEach(function(ee,V){Q.indexOf(V)===-1&&J.append(V,ee)}),re(J,q||new Headers)},je=function(B){return function(Q,q){return ge(Q,B,q)}},Se=["GET","POST","PUT","PATCH","DELETE"],He=function(B,Q){switch(Q){case"query":if(Se.indexOf(B.toUpperCase())!==-1)return;throw new Error('A "query" operation can only support "GET" requests but got "'+B+'".');case"mutation":if(Se.indexOf(B.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 q=Q;return q}},ht=function(B,Q,q){var J=new Error(q);throw J.response=B,J.statusCode=B.status,J.result=Q,J},Vt=function(B,Q){return B==null||typeof B!="object"?B:Array.isArray(B)?B.map(function(q){return Vt(q,Q)}):(B.__typename=Q,B)},Rt=function(B,Q,q,J,ee){return _(void 0,void 0,void 0,function(){var V,xe,Ve,$e,ae,_e,Qe,pt,mt,Yt,Ot,Wt,Gt,Er,zt,sr,dr,Ar,Ht,H,G,st,vt,lt,We,Kt,Zt,Qt,kr,Hr,Fr,jt,Or,$r,Lr,ar,Gr,Tr,gr,Ir,Sn,Un,R,ue,be,Ce,Be,ut,Ye,Xe;return T(this,function(et){switch(et.label){case 0:if(V=ee.directives,xe=ee.isLeaf,Ve=ee.resultKey,$e=J.exportVariablesByNode,ae=$e.get(Q)||{},_e=function(gt){return gt instanceof Array?gt.forEach(_e):$e.set(gt,S({},ae)),gt},Qe=(Q||{})[Ve],pt=(Q||{})[B],Q&&V&&V.export&&(ae[V.export.as]=pt),mt=V&&V.type,!xe&&mt){if(V.rest)throw new Error("Invalid use of @type(name: ...) directive on a call that also has @rest(...)");return _e(pt),[2,Vt(pt,V.type.name)]}if(Yt=!V||!V.rest,Yt)return[2,_e(Qe||pt)];if(Ot=J.credentials,Wt=J.endpoints,Gt=J.headers,Er=J.customFetch,zt=J.operationType,sr=J.typePatcher,dr=J.mainDefinition,Ar=J.fragmentDefinitions,Ht=J.fieldNameNormalizer,H=J.fieldNameDenormalizer,G=J.serializers,st=J.responseTransformer,vt=i.createFragmentMap(Ar),lt=V.rest,We=lt.path,Kt=lt.endpoint,Zt=lt.pathBuilder,Qt=fe(Wt,Kt),kr=We==null&&Zt==null,kr)throw new Error('One of ("path" | "pathBuilder") must be set in the @rest() directive. This request had neither, please add one');if(Zt||(We.includes(":")?(console.warn("Deprecated: '@rest(path:' contains a ':' colon, this format will be removed in future versions"),Zt=function(gt){var w=gt.args,k=gt.exportVariables,A=S(S({},w),k),C=Object.keys(A).reduce(function(D,$){return se(D,$,A[$])},We);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}):Zt=ke.replacerForPath(We)),Hr={args:q,exportVariables:ae,context:J,"@rest":V.rest,replacer:Zt},Fr=Zt(Hr),jt=V.rest,Or=jt.method,$r=jt.type,Lr=jt.bodyBuilder,ar=jt.bodyKey,Gr=jt.fieldNameDenormalizer,Tr=jt.fieldNameNormalizer,gr=jt.bodySerializer,Or||(Or="GET"),ar||(ar="input"),Ir=void 0,Sn=void 0,["GET","DELETE"].indexOf(Or)===-1){if(!Lr){if(Un=Hr.exportVariables[ar]||Hr.args&&Hr.args[ar],!Un)throw new Error("[GraphQL "+Or+" "+zt+" using a REST call without a body]. No `"+ar+"` was detected. Pass bodyKey, or bodyBuilder to the @rest() directive to resolve this.");Lr=function(gt){return Un}}if(Ir=ve(Lr(Hr),Gr||H||ze),R=void 0,typeof gr=="string"){if(!G.hasOwnProperty(gr))throw new Error('"bodySerializer" must correspond to configured serializer. '+("Please make sure to specify a serializer called "+gr+' in the "bodySerializers" property of the RestLink.'));R=G[gr](Ir,Gt)}else R=gr?gr(Ir,Gt):G[it](Ir,Gt);Ir=R.body,Sn=new Headers(R.headers)}return He(Or,zt||"query"),ue=S({method:Or,headers:Sn||Gt,body:Ir},Ot?{credentials:Ot}:{}),be=""+Qt.uri+Fr,[4,(Er||fetch)(be,ue)];case 1:return Ce=et.sent(),J.responses.push(Ce),Ce.ok?(Ce.status===204||Ce.headers.get("Content-Length")==="0"?Be={}:Be=Ce,[3,9]):[3,2];case 2:return Ce.status!==404?[3,3]:(Be=null,[3,9]);case 3:ut=void 0,et.label=4;case 4:return et.trys.push([4,6,,8]),[4,Ce.clone().json()];case 5:return ut=et.sent(),[3,8];case 6:return et.sent(),[4,Ce.clone().text()];case 7:return ut=et.sent(),[3,8];case 8:ht(Ce,ut,"Response not successful: Received status code "+Ce.status),et.label=9;case 9:if(Ye=Qt.responseTransformer||st,!Ye)return[3,14];et.label=10;case 10:return et.trys.push([10,12,,13]),[4,Ye(Be,$r)];case 11:return Be=et.sent(),[3,13];case 12:throw Xe=et.sent(),console.warn("An error occurred in a responseTransformer:"),Xe;case 13:return[3,16];case 14:return Be&&Be.json?[4,Be.json()]:[3,16];case 15:Be=et.sent(),et.label=16;case 16:return Be=ve(Be,Tr||Ht||ze),Be=Z(Ve,Be,dr,vt,dr.selectionSet),Be=U(Be,$r,sr,{resolverParams:{fieldName:B,root:Q,args:q,context:J,info:ee}}),[2,_e(Be)]}})})},tt="",it="",Et=function(B,Q){return Q.has("content-type")||Q.append("Content-Type","application/json"),{body:JSON.stringify(B),headers:Q}},Me={test:function(B){return B.name.value==="rest"},remove:!0},Ge=function(B){I(Q,B);function Q(q){var J,ee=q.uri,V=q.endpoints,xe=q.headers,Ve=q.fieldNameNormalizer,$e=q.fieldNameDenormalizer,ae=q.typePatcher,_e=q.customFetch,Qe=q.credentials,pt=q.bodySerializers,mt=q.defaultSerializer,Yt=q.responseTransformer,Ot=B.call(this)||this,Wt={};if(Wt[tt]=ee||"",Ot.endpoints=Object.assign({},V||Wt),ee==null&&V==null)throw new Error("A RestLink must be initialized with either 1 uri, or a map of keyed-endpoints");if(ee!=null){var Gt=(V||{})[tt];if(Gt!=null&&Gt!=ee)throw new Error("RestLink was configured with a default uri that doesn't match what's passed in to the endpoints map.");Ot.endpoints[tt]=ee}if(Ot.endpoints[tt]==null&&console.warn("RestLink configured without a default URI. All @rest(…) directives must provide an endpoint key!"),ae==null)Ot.typePatcher=function(zt,sr,dr){return S({__typename:sr},zt)};else if(!Array.isArray(ae)&&typeof ae=="object"&&Object.keys(ae).map(function(zt){return ae[zt]}).reduce(function(zt,sr){return zt&&typeof sr=="function"},!0)){var Er=ae;Ot.typePatcher=function(zt,sr,dr,Ar){var Ht=zt.__typename||sr;if(Array.isArray(zt))return zt.map(function(G){return dr(G,Ht,dr,Ar)});var H=Er[Ht]||function(G){return G};return S({__typename:Ht},H(zt,Ht,dr,Ar))}}else throw new Error("RestLink was configured with a typePatcher of invalid type!");return pt&&pt.hasOwnProperty(it)&&console.warn("RestLink was configured to override the default serializer! This may result in unexpected behavior"),Ot.responseTransformer=Yt||null,Ot.fieldNameNormalizer=Ve||null,Ot.fieldNameDenormalizer=$e||null,Ot.headers=he(xe),Ot.credentials=Qe||null,Ot.customFetch=_e,Ot.serializers=S((J={},J[it]=mt||Et,J),pt||{}),Ot.processedDocuments=new Map,Ot}return Q.prototype.removeRestSetsFromDocument=function(q){var J=this.processedDocuments.get(q);if(J)return J;i.checkDocument(q);var ee=i.removeDirectivesFromDocument([Me],q);return this.processedDocuments.set(q,ee),ee},Q.prototype.request=function(q,J){var ee=q.query,V=q.variables,xe=q.getContext,Ve=q.setContext,$e=xe(),ae=i.hasDirectives(["rest"],ee);if(!ae)return J(q);var _e=this.removeRestSetsFromDocument(ee),Qe=$e.headersMergePolicy;Qe==null&&Array.isArray($e.headersToOverride)?Qe=je($e.headersToOverride):Qe==null&&(Qe=re);var pt=Qe(this.headers,$e.headers);pt.has("Accept")||pt.append("Accept","application/json");var mt=$e.credentials||this.credentials,Yt=i.addTypenameToDocument(ee),Ot=i.getMainDefinition(ee),Wt=i.getFragmentDefinitions(ee),Gt=(Ot||{}).operation||"query",Er={headers:pt,endpoints:this.endpoints,exportVariablesByNode:new Map,credentials:mt,customFetch:this.customFetch,operationType:Gt,fieldNameNormalizer:this.fieldNameNormalizer,fieldNameDenormalizer:this.fieldNameDenormalizer,mainDefinition:Ot,fragmentDefinitions:Wt,typePatcher:this.typePatcher,serializers:this.serializers,responses:[],responseTransformer:this.responseTransformer},zt={},sr;return _e&&J?(q.query=_e,sr=J(q)):sr=n.Observable.of({data:{}}),sr.flatMap(function(dr){var Ar=dr.data,Ht=dr.errors;return new n.Observable(function(H){y(Rt,Yt,Ar,Er,V,zt).then(function(G){Ve({restResponses:($e.restResponses||[]).concat(Er.responses)}),H.next({data:G,errors:Ht}),H.complete()}).catch(function(G){G.name!=="AbortError"&&(G.result&&G.result.errors&&H.next(G.result),H.error(G))})})})},Q}(n.ApolloLink);t.RestLink=Ge,t.PathBuilder=ke,Object.defineProperty(t,"__esModule",{value:!0})})})(mh,mh.exports);var hI=mh.exports;const rc=me.createContext(),dI=()=>{const{isAuthenticated:r,login:e}=ti(),{children:t,isEmbedded:n,setIsEmbedded:i,authError:a}=me.useContext(rc),u=pn.useNavigate(),c=pn.useLocation(),[f,h]=me.useState(!1),[d,y]=me.useState(),[g,m]=me.useState(),[b,I]=me.useState({}),[S,_]=me.useState({}),[T,P]=me.useState({}),[M,U]=me.useState({}),[z,Z]=me.useState(!1),[X,fe]=me.useState({});me.useEffect(()=>{var he;if(!(!c||c.pathname!=="/mm-embedded-login")){if(r||a)if(((he=new URL(origin))==null?void 0:he.protocol)==="http:"){window.close();return}else{const ge=new URLSearchParams(c.search),je=ge.get("id"),Se=ge.get("origin");a?window.parent.postMessage({type:"authorize-failed",instanceId:je,error:a,authUrl:window.location.href},Se):window.parent.postMessage({type:"authorized",instanceId:je,authUrl:window.location.href},Se);return}r===!1&&e()}},[c]),me.useEffect(()=>{var je,Se;if(r===null||!c||c.pathname!=="/mm-embedded-interop")return;const he=new URLSearchParams(c.search),re=he.get("id"),ge=he.get("origin");if(ge){const He=(je=new URL(ge))==null?void 0:je.hostname;if(/^(?:[\w-]+\.)*(?:machinemetrics\.com|machinemetrics-us-gov\.com|m12s\.com)$/.test(He))y(ge);else{alert("Invalid Embeddable Zone Host");return}}if(r===!1){if(ge){const He={instanceId:re,authUrl:`${window.location.protocol}//${window.location.host}/mm-embedded-login?id=${re}&origin=${ge}`,origin:ge};if(((Se=new URL(ge))==null?void 0:Se.protocol)==="http:"){window.parent.postMessage({type:"login",...He},ge);return}e({mm_instanceId:He.instanceId,mm_authUrl:encodeURIComponent(He.authUrl),mm_origin:He.origin});return}e();return}re&&m(re),re&&ge&&i(!0)},[c,r]),pn.useBlocker(({nextLocation:he})=>{var re;return n?(re=he.state)!=null&&re.fromParent?(h(!0),!1):(se(`${he.pathname}${he.search}`),!0):!1}),me.useEffect(()=>{if(!n||!d)return;const he=re=>{re.metaKey&&re.key==="k"&&window.parent.postMessage({type:"open-search",instanceId:g},d)};return window.addEventListener("keydown",he),()=>{window.removeEventListener("keydown",he)}},[n,d]),me.useEffect(()=>{if(!n||!d)return;const he=({origin:re,data:ge})=>{var je,Se,He;if(re===d)switch(ge.type){case"navigate":u(ge.path,{replace:!0,state:{fromParent:!0}});break;case"set-context":I(ge.context||{});break;case"set-configuring":Z(ge.isConfiguring);break;case"set-params":fe(ge.params);break;case"load-options":(je=S[ge.name])==null||je.call(S,{filter:ge.filter});break;case"validate":(Se=T[ge.name])==null||Se.call(T,{value:ge.value});break;case"response":(He=M[ge.callbackId])==null||He.call(M,ge.response);break}};return window.addEventListener("message",he),!f&&r&&window.parent.postMessage({type:"ready",instanceId:g},d),()=>{window.removeEventListener("message",he)}},[u,f,n,r,d,S,T,M]);const se=(he,re)=>{!f&&!r||window.parent.postMessage({type:"set-path",instanceId:g,path:he,...re},d)},ke=he=>{f&&window.parent.postMessage({type:"set-summary",instanceId:g,summary:he},d)},ye=he=>{f&&window.parent.postMessage({type:"toast",instanceId:g,message:he},d)},Pe=he=>{f&&window.parent.postMessage({type:"popup",instanceId:g,message:he},d)},Ie=async({header:he,body:re,choices:ge})=>f?new Promise(je=>{const Se=A0(),He=async ht=>{U(Vt=>{const{[Se]:Rt,...tt}=Vt;return tt}),je(ht)};U(ht=>({...ht,[Se]:He})),window.parent.postMessage({type:"confirm",instanceId:g,header:he,body:re,choices:ge,callbackId:Se},d)}):Promise.reject(new Error("Not ready")),ve=async(he,re)=>{f&&(re.validate&&typeof re.validate=="function"&&P(ge=>{const je=async Se=>{const He=await re.validate(Se);window.parent.postMessage({type:"set-validation",instanceId:g,name:he,validation:He},d)};return ge[he]&&je({value:""}),{...ge,[he]:je}}),re.options&&_(ge=>{const je=async Se=>{const ht=await(typeof re.options=="function"?re.options:()=>re.options)(Se);window.parent.postMessage({type:"set-options",instanceId:g,name:he,options:ht},d)};return ge[he]&&je({filter:""}),{...ge,[he]:je}}),window.parent.postMessage({type:"add-setting",instanceId:g,setting:{name:he,...re,options:void 0,validate:void 0}},d))},ze=me.useMemo(()=>({commands:{navigateParent:se,setSummary:ke,toast:ye,popup:Pe,confirm:Ie},context:{...b,get colorMode(){throw new Error("colorMode has been moved to useMMAppParams")},get isFullScreen(){throw new Error("isFullScreen has been moved to useMMAppParams")}},params:{isEmbedded:n,isConfiguring:z,colorMode:b.colorMode,isFullScreen:b.isFullScreen,...X},addSetting:ve}),[n,z,se,ke,ye,Pe,Ie,b,X,ve]);return nr.jsx(vo.Provider,{value:ze,children:c.pathname!=="/mm-embedded-interop"&&c.pathname!=="/mm-embedded-login"?t:nr.jsx(nr.Fragment,{})})},pI=()=>{const{urls:r,jwtRef:e,accessToken:t}=ti(),{graphQLRoleOverride:n,children:i}=me.useContext(rc),[a,u]=me.useState(),[c,f]=me.useState(),h=()=>{const g=new URL(r.graphQLUrl);return`//${g.host}${g.pathname}`},d=()=>n?{"X-Hasura-Role":n}:{};me.useEffect(()=>{const g=new Ok(Ck({url:`wss:${h()}`,lazy:!0,reconnect:!0,connectionParams:async()=>({headers:{Authorization:`Bearer ${e.current}`,...d()}})})),m=D0(({operation:P,networkError:M,forward:U})=>(Bi(P.query).operation==="subscription"&&M&&g.client.terminate(),U(P))),I=M0(async(P,{headers:M})=>({headers:{...M,Authorization:`Bearer ${e.current}`,...d()}})).concat(uf({uri:`https:${h()}`,fetch:window.fetch})),S=m.split(({query:P})=>{const M=Bi(P);return M.kind==="OperationDefinition"&&M.operation==="subscription"},g,I),T=M0(async(P,{headers:M})=>({headers:{...M,Authorization:`Bearer ${t}`}})).concat(new hI.RestLink({uri:r.apiUrl}));f(Kr.from([T,S]))},[]),me.useEffect(()=>{c&&u(new Cf({link:c,cache:new Of}))},[c]);const y=me.useMemo(()=>({link:c}),[c]);return nr.jsx(u0.Provider,{value:y,children:a?nr.jsx(T1,{client:a,children:nr.jsx(zA,{children:nr.jsx(dI,{children:i})})}):nr.jsx(nr.Fragment,{})})},mI=Qp.div`
131
+ `+G.prev}function Ht(H,G){var st=tt(H),vt=[];if(st){vt.length=H.length;for(var lt=0;lt<H.length;lt++)vt[lt]=V(H,lt)?G(H[lt],H):""}var We=typeof ye=="function"?ye(H):[],Kt;if(Ie){Kt={};for(var Zt=0;Zt<We.length;Zt++)Kt["$"+We[Zt]]=We[Zt]}for(var Qt in H)V(H,Qt)&&(st&&String(Number(Qt))===Qt&&Qt<H.length||Ie&&Kt["$"+Qt]instanceof Symbol||(z.call(/[^\w$]/,Qt)?vt.push(G(Qt,H)+": "+G(H[Qt],H)):vt.push(Qt+": "+G(H[Qt],H))));if(typeof ye=="function")for(var kr=0;kr<We.length;kr++)ze.call(H,We[kr])&&vt.push("["+G(We[kr])+"]: "+G(H[We[kr]],H));return vt}return gh}var vh,q0;function Fk(){if(q0)return vh;q0=1;var r=ec(),e=ha(),t=function(c,f,h){for(var d=c,y;(y=d.next)!=null;d=y)if(y.key===f)return d.next=y.next,h||(y.next=c.next,c.next=y),y},n=function(c,f){if(c){var h=t(c,f);return h&&h.value}},i=function(c,f,h){var d=t(c,f);d?d.value=h:c.next={key:f,next:c.next,value:h}},a=function(c,f){return c?!!t(c,f):!1},u=function(c,f){if(c)return t(c,f,!0)};return vh=function(){var f,h={assert:function(d){if(!h.has(d))throw new e("Side channel does not contain "+r(d))},delete:function(d){var y=f&&f.next,g=u(f,d);return g&&y&&y===g&&(f=void 0),!!g},get:function(d){return n(f,d)},has:function(d){return a(f,d)},set:function(d,y){f||(f={next:void 0}),i(f,d,y)}};return h},vh}var bh,j0;function U0(){return j0||(j0=1,bh=Object),bh}var wh,$0;function Lk(){return $0||($0=1,wh=Error),wh}var _h,B0;function qk(){return B0||(B0=1,_h=EvalError),_h}var xh,V0;function jk(){return V0||(V0=1,xh=RangeError),xh}var Sh,W0;function Uk(){return W0||(W0=1,Sh=ReferenceError),Sh}var Eh,z0;function $k(){return z0||(z0=1,Eh=SyntaxError),Eh}var Oh,H0;function Bk(){return H0||(H0=1,Oh=URIError),Oh}var Th,G0;function Vk(){return G0||(G0=1,Th=Math.abs),Th}var Ah,Q0;function Wk(){return Q0||(Q0=1,Ah=Math.floor),Ah}var kh,J0;function zk(){return J0||(J0=1,kh=Math.max),kh}var Ih,Y0;function Hk(){return Y0||(Y0=1,Ih=Math.min),Ih}var Ch,K0;function Gk(){return K0||(K0=1,Ch=Math.pow),Ch}var Ph,Z0;function Qk(){return Z0||(Z0=1,Ph=Math.round),Ph}var Nh,X0;function Jk(){return X0||(X0=1,Nh=Number.isNaN||function(e){return e!==e}),Nh}var Rh,eb;function Yk(){if(eb)return Rh;eb=1;var r=Jk();return Rh=function(t){return r(t)||t===0?t:t<0?-1:1},Rh}var Mh,tb;function Kk(){return tb||(tb=1,Mh=Object.getOwnPropertyDescriptor),Mh}var Dh,rb;function nb(){if(rb)return Dh;rb=1;var r=Kk();if(r)try{r([],"length")}catch{r=null}return Dh=r,Dh}var Fh,ib;function Zk(){if(ib)return Fh;ib=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return Fh=r,Fh}var Lh,sb;function Xk(){return sb||(sb=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(var a 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 u=Object.getOwnPropertySymbols(e);if(u.length!==1||u[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(e,t);if(c.value!==i||c.enumerable!==!0)return!1}return!0}),Lh}var qh,ab;function eI(){if(ab)return qh;ab=1;var r=typeof Symbol<"u"&&Symbol,e=Xk();return qh=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},qh}var jh,ob;function ub(){return ob||(ob=1,jh=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),jh}var Uh,cb;function lb(){if(cb)return Uh;cb=1;var r=U0();return Uh=r.getPrototypeOf||null,Uh}var $h,fb;function tI(){if(fb)return $h;fb=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 $h=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 _=h.apply(this,i(d,arguments));return Object(_)===_?_:this}return h.apply(f,i(d,arguments))},m=t(0,h.length-d.length),b=[],I=0;I<m;I++)b[I]="$"+I;if(y=Function("binder","return function ("+u(b,",")+"){ return binder.apply(this,arguments); }")(g),h.prototype){var S=function(){};S.prototype=h.prototype,y.prototype=new S,S.prototype=null}return y},$h}var Bh,hb;function tc(){if(hb)return Bh;hb=1;var r=tI();return Bh=Function.prototype.bind||r,Bh}var Vh,db;function Wh(){return db||(db=1,Vh=Function.prototype.call),Vh}var zh,pb;function mb(){return pb||(pb=1,zh=Function.prototype.apply),zh}var Hh,yb;function rI(){return yb||(yb=1,Hh=typeof Reflect<"u"&&Reflect&&Reflect.apply),Hh}var Gh,gb;function nI(){if(gb)return Gh;gb=1;var r=tc(),e=mb(),t=Wh(),n=rI();return Gh=n||r.call(t,e),Gh}var Qh,vb;function bb(){if(vb)return Qh;vb=1;var r=tc(),e=ha(),t=Wh(),n=nI();return Qh=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return n(r,t,a)},Qh}var Jh,wb;function iI(){if(wb)return Jh;wb=1;var r=bb(),e=nb(),t;try{t=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var n=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return Jh=n&&typeof n.get=="function"?r([n.get]):typeof a=="function"?function(c){return a(c==null?c:i(c))}:!1,Jh}var Yh,_b;function sI(){if(_b)return Yh;_b=1;var r=ub(),e=lb(),t=iI();return Yh=r?function(i){return r(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,Yh}var Kh,xb;function aI(){if(xb)return Kh;xb=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=tc();return Kh=t.call(r,e),Kh}var Zh,Sb;function Xh(){if(Sb)return Zh;Sb=1;var r,e=U0(),t=Lk(),n=qk(),i=jk(),a=Uk(),u=$k(),c=ha(),f=Bk(),h=Vk(),d=Wk(),y=zk(),g=Hk(),m=Gk(),b=Qk(),I=Yk(),S=Function,_=function(Me){try{return S('"use strict"; return ('+Me+").constructor;")()}catch{}},T=nb(),P=Zk(),M=function(){throw new c},U=T?function(){try{return arguments.callee,M}catch{try{return T(arguments,"callee").get}catch{return M}}}():M,z=eI()(),Z=sI(),X=lb(),fe=ub(),se=mb(),ke=Wh(),ye={},Pe=typeof Uint8Array>"u"||!Z?r:Z(Uint8Array),Ie={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":z&&Z?Z([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":ye,"%AsyncGenerator%":ye,"%AsyncGeneratorFunction%":ye,"%AsyncIteratorPrototype%":ye,"%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%":t,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":S,"%GeneratorFunction%":ye,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":z&&Z?Z(Z([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!z||!Z?r:Z(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":T,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!z||!Z?r:Z(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":z&&Z?Z(""[Symbol.iterator]()):r,"%Symbol%":z?Symbol:r,"%SyntaxError%":u,"%ThrowTypeError%":U,"%TypedArray%":Pe,"%TypeError%":c,"%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%":f,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":ke,"%Function.prototype.apply%":se,"%Object.defineProperty%":P,"%Object.getPrototypeOf%":X,"%Math.abs%":h,"%Math.floor%":d,"%Math.max%":y,"%Math.min%":g,"%Math.pow%":m,"%Math.round%":b,"%Math.sign%":I,"%Reflect.getPrototypeOf%":fe};if(Z)try{null.error}catch(Me){var ve=Z(Z(Me));Ie["%Error.prototype%"]=ve}var ze=function Me(Ge){var B;if(Ge==="%AsyncFunction%")B=_("async function () {}");else if(Ge==="%GeneratorFunction%")B=_("function* () {}");else if(Ge==="%AsyncGeneratorFunction%")B=_("async function* () {}");else if(Ge==="%AsyncGenerator%"){var Q=Me("%AsyncGeneratorFunction%");Q&&(B=Q.prototype)}else if(Ge==="%AsyncIteratorPrototype%"){var q=Me("%AsyncGenerator%");q&&Z&&(B=Z(q.prototype))}return Ie[Ge]=B,B},he={__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"]},re=tc(),ge=aI(),je=re.call(ke,Array.prototype.concat),Se=re.call(se,Array.prototype.splice),He=re.call(ke,String.prototype.replace),ht=re.call(ke,String.prototype.slice),Vt=re.call(ke,RegExp.prototype.exec),Rt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,tt=/\\(\\)?/g,it=function(Ge){var B=ht(Ge,0,1),Q=ht(Ge,-1);if(B==="%"&&Q!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(Q==="%"&&B!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var q=[];return He(Ge,Rt,function(J,ee,V,xe){q[q.length]=V?He(xe,tt,"$1"):ee||J}),q},Et=function(Ge,B){var Q=Ge,q;if(ge(he,Q)&&(q=he[Q],Q="%"+q[0]+"%"),ge(Ie,Q)){var J=Ie[Q];if(J===ye&&(J=ze(Q)),typeof J>"u"&&!B)throw new c("intrinsic "+Ge+" exists, but is not available. Please file an issue!");return{alias:q,name:Q,value:J}}throw new u("intrinsic "+Ge+" does not exist!")};return Zh=function(Ge,B){if(typeof Ge!="string"||Ge.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof B!="boolean")throw new c('"allowMissing" argument must be a boolean');if(Vt(/^%?[^%]*%?$/,Ge)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Q=it(Ge),q=Q.length>0?Q[0]:"",J=Et("%"+q+"%",B),ee=J.name,V=J.value,xe=!1,Ve=J.alias;Ve&&(q=Ve[0],Se(Q,je([0,1],Ve)));for(var $e=1,ae=!0;$e<Q.length;$e+=1){var _e=Q[$e],Qe=ht(_e,0,1),pt=ht(_e,-1);if((Qe==='"'||Qe==="'"||Qe==="`"||pt==='"'||pt==="'"||pt==="`")&&Qe!==pt)throw new u("property names with quotes must have matching quotes");if((_e==="constructor"||!ae)&&(xe=!0),q+="."+_e,ee="%"+q+"%",ge(Ie,ee))V=Ie[ee];else if(V!=null){if(!(_e in V)){if(!B)throw new c("base intrinsic for "+Ge+" exists, but the property is not available.");return}if(T&&$e+1>=Q.length){var mt=T(V,_e);ae=!!mt,ae&&"get"in mt&&!("originalValue"in mt.get)?V=mt.get:V=V[_e]}else ae=ge(V,_e),V=V[_e];ae&&!xe&&(Ie[ee]=V)}}return V},Zh}var ed,Eb;function Ob(){if(Eb)return ed;Eb=1;var r=Xh(),e=bb(),t=e([r("%String.prototype.indexOf%")]);return ed=function(i,a){var u=r(i,!!a);return typeof u=="function"&&t(i,".prototype.")>-1?e([u]):u},ed}var td,Tb;function Ab(){if(Tb)return td;Tb=1;var r=Xh(),e=Ob(),t=ec(),n=ha(),i=r("%Map%",!0),a=e("Map.prototype.get",!0),u=e("Map.prototype.set",!0),c=e("Map.prototype.has",!0),f=e("Map.prototype.delete",!0),h=e("Map.prototype.size",!0);return td=!!i&&function(){var y,g={assert:function(m){if(!g.has(m))throw new n("Side channel does not contain "+t(m))},delete:function(m){if(y){var b=f(y,m);return h(y)===0&&(y=void 0),b}return!1},get:function(m){if(y)return a(y,m)},has:function(m){return y?c(y,m):!1},set:function(m,b){y||(y=new i),u(y,m,b)}};return g},td}var rd,kb;function oI(){if(kb)return rd;kb=1;var r=Xh(),e=Ob(),t=ec(),n=Ab(),i=ha(),a=r("%WeakMap%",!0),u=e("WeakMap.prototype.get",!0),c=e("WeakMap.prototype.set",!0),f=e("WeakMap.prototype.has",!0),h=e("WeakMap.prototype.delete",!0);return rd=a?function(){var y,g,m={assert:function(b){if(!m.has(b))throw new i("Side channel does not contain "+t(b))},delete:function(b){if(a&&b&&(typeof b=="object"||typeof b=="function")){if(y)return h(y,b)}else if(n&&g)return g.delete(b);return!1},get:function(b){return a&&b&&(typeof b=="object"||typeof b=="function")&&y?u(y,b):g&&g.get(b)},has:function(b){return a&&b&&(typeof b=="object"||typeof b=="function")&&y?f(y,b):!!g&&g.has(b)},set:function(b,I){a&&b&&(typeof b=="object"||typeof b=="function")?(y||(y=new a),c(y,b,I)):n&&(g||(g=n()),g.set(b,I))}};return m}:n,rd}var nd,Ib;function uI(){if(Ib)return nd;Ib=1;var r=ha(),e=ec(),t=Fk(),n=Ab(),i=oI(),a=i||n||t;return nd=function(){var c,f={assert:function(h){if(!f.has(h))throw new r("Side channel does not contain "+e(h))},delete:function(h){return!!c&&c.delete(h)},get:function(h){return c&&c.get(h)},has:function(h){return!!c&&c.has(h)},set:function(h,d){c||(c=a()),c.set(h,d)}};return f},nd}var id,Cb;function sd(){if(Cb)return id;Cb=1;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return id={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},id}var ad,Pb;function Nb(){if(Pb)return ad;Pb=1;var r=sd(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var S=[],_=0;_<256;++_)S.push("%"+((_<16?"0":"")+_.toString(16)).toUpperCase());return S}(),i=function(_){for(;_.length>1;){var T=_.pop(),P=T.obj[T.prop];if(t(P)){for(var M=[],U=0;U<P.length;++U)typeof P[U]<"u"&&M.push(P[U]);T.obj[T.prop]=M}}},a=function(_,T){for(var P=T&&T.plainObjects?Object.create(null):{},M=0;M<_.length;++M)typeof _[M]<"u"&&(P[M]=_[M]);return P},u=function S(_,T,P){if(!T)return _;if(typeof T!="object"){if(t(_))_.push(T);else if(_&&typeof _=="object")(P&&(P.plainObjects||P.allowPrototypes)||!e.call(Object.prototype,T))&&(_[T]=!0);else return[_,T];return _}if(!_||typeof _!="object")return[_].concat(T);var M=_;return t(_)&&!t(T)&&(M=a(_,P)),t(_)&&t(T)?(T.forEach(function(U,z){if(e.call(_,z)){var Z=_[z];Z&&typeof Z=="object"&&U&&typeof U=="object"?_[z]=S(Z,U,P):_.push(U)}else _[z]=U}),_):Object.keys(T).reduce(function(U,z){var Z=T[z];return e.call(U,z)?U[z]=S(U[z],Z,P):U[z]=Z,U},M)},c=function(_,T){return Object.keys(T).reduce(function(P,M){return P[M]=T[M],P},_)},f=function(S,_,T){var P=S.replace(/\+/g," ");if(T==="iso-8859-1")return P.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(P)}catch{return P}},h=1024,d=function(_,T,P,M,U){if(_.length===0)return _;var z=_;if(typeof _=="symbol"?z=Symbol.prototype.toString.call(_):typeof _!="string"&&(z=String(_)),P==="iso-8859-1")return escape(z).replace(/%u[0-9a-f]{4}/gi,function(Pe){return"%26%23"+parseInt(Pe.slice(2),16)+"%3B"});for(var Z="",X=0;X<z.length;X+=h){for(var fe=z.length>=h?z.slice(X,X+h):z,se=[],ke=0;ke<fe.length;++ke){var ye=fe.charCodeAt(ke);if(ye===45||ye===46||ye===95||ye===126||ye>=48&&ye<=57||ye>=65&&ye<=90||ye>=97&&ye<=122||U===r.RFC1738&&(ye===40||ye===41)){se[se.length]=fe.charAt(ke);continue}if(ye<128){se[se.length]=n[ye];continue}if(ye<2048){se[se.length]=n[192|ye>>6]+n[128|ye&63];continue}if(ye<55296||ye>=57344){se[se.length]=n[224|ye>>12]+n[128|ye>>6&63]+n[128|ye&63];continue}ke+=1,ye=65536+((ye&1023)<<10|fe.charCodeAt(ke)&1023),se[se.length]=n[240|ye>>18]+n[128|ye>>12&63]+n[128|ye>>6&63]+n[128|ye&63]}Z+=se.join("")}return Z},y=function(_){for(var T=[{obj:{o:_},prop:"o"}],P=[],M=0;M<T.length;++M)for(var U=T[M],z=U.obj[U.prop],Z=Object.keys(z),X=0;X<Z.length;++X){var fe=Z[X],se=z[fe];typeof se=="object"&&se!==null&&P.indexOf(se)===-1&&(T.push({obj:z,prop:fe}),P.push(se))}return i(T),_},g=function(_){return Object.prototype.toString.call(_)==="[object RegExp]"},m=function(_){return!_||typeof _!="object"?!1:!!(_.constructor&&_.constructor.isBuffer&&_.constructor.isBuffer(_))},b=function(_,T){return[].concat(_,T)},I=function(_,T){if(t(_)){for(var P=[],M=0;M<_.length;M+=1)P.push(T(_[M]));return P}return T(_)};return ad={arrayToObject:a,assign:c,combine:b,compact:y,decode:f,encode:d,isBuffer:m,isRegExp:g,maybeMap:I,merge:u},ad}var od,Rb;function cI(){if(Rb)return od;Rb=1;var r=uI(),e=Nb(),t=sd(),n=Object.prototype.hasOwnProperty,i={brackets:function(S){return S+"[]"},comma:"comma",indices:function(S,_){return S+"["+_+"]"},repeat:function(S){return S}},a=Array.isArray,u=Array.prototype.push,c=function(I,S){u.apply(I,a(S)?S:[S])},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(S){return f.call(S)},skipNulls:!1,strictNullHandling:!1},y=function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"},g={},m=function I(S,_,T,P,M,U,z,Z,X,fe,se,ke,ye,Pe,Ie,ve,ze,he){for(var re=S,ge=he,je=0,Se=!1;(ge=ge.get(g))!==void 0&&!Se;){var He=ge.get(S);if(je+=1,typeof He<"u"){if(He===je)throw new RangeError("Cyclic object value");Se=!0}typeof ge.get(g)>"u"&&(je=0)}if(typeof fe=="function"?re=fe(_,re):re instanceof Date?re=ye(re):T==="comma"&&a(re)&&(re=e.maybeMap(re,function(ee){return ee instanceof Date?ye(ee):ee})),re===null){if(U)return X&&!ve?X(_,d.encoder,ze,"key",Pe):_;re=""}if(y(re)||e.isBuffer(re)){if(X){var ht=ve?_:X(_,d.encoder,ze,"key",Pe);return[Ie(ht)+"="+Ie(X(re,d.encoder,ze,"value",Pe))]}return[Ie(_)+"="+Ie(String(re))]}var Vt=[];if(typeof re>"u")return Vt;var Rt;if(T==="comma"&&a(re))ve&&X&&(re=e.maybeMap(re,X)),Rt=[{value:re.length>0?re.join(",")||null:void 0}];else if(a(fe))Rt=fe;else{var tt=Object.keys(re);Rt=se?tt.sort(se):tt}var it=Z?_.replace(/\./g,"%2E"):_,Et=P&&a(re)&&re.length===1?it+"[]":it;if(M&&a(re)&&re.length===0)return Et+"[]";for(var Me=0;Me<Rt.length;++Me){var Ge=Rt[Me],B=typeof Ge=="object"&&typeof Ge.value<"u"?Ge.value:re[Ge];if(!(z&&B===null)){var Q=ke&&Z?Ge.replace(/\./g,"%2E"):Ge,q=a(re)?typeof T=="function"?T(Et,Q):Et:Et+(ke?"."+Q:"["+Q+"]");he.set(S,je);var J=r();J.set(g,he),c(Vt,I(B,q,T,P,M,U,z,Z,T==="comma"&&ve&&a(re)?null:X,fe,se,ke,ye,Pe,Ie,ve,ze,J))}}return Vt},b=function(S){if(!S)return d;if(typeof S.allowEmptyArrays<"u"&&typeof S.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof S.encodeDotInKeys<"u"&&typeof S.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(S.encoder!==null&&typeof S.encoder<"u"&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var _=S.charset||d.charset;if(typeof S.charset<"u"&&S.charset!=="utf-8"&&S.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var T=t.default;if(typeof S.format<"u"){if(!n.call(t.formatters,S.format))throw new TypeError("Unknown format option provided.");T=S.format}var P=t.formatters[T],M=d.filter;(typeof S.filter=="function"||a(S.filter))&&(M=S.filter);var U;if(S.arrayFormat in i?U=S.arrayFormat:"indices"in S?U=S.indices?"indices":"repeat":U=d.arrayFormat,"commaRoundTrip"in S&&typeof S.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var z=typeof S.allowDots>"u"?S.encodeDotInKeys===!0?!0:d.allowDots:!!S.allowDots;return{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:d.addQueryPrefix,allowDots:z,allowEmptyArrays:typeof S.allowEmptyArrays=="boolean"?!!S.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:U,charset:_,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:d.charsetSentinel,commaRoundTrip:S.commaRoundTrip,delimiter:typeof S.delimiter>"u"?d.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:d.encode,encodeDotInKeys:typeof S.encodeDotInKeys=="boolean"?S.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof S.encoder=="function"?S.encoder:d.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:d.encodeValuesOnly,filter:M,format:T,formatter:P,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:d.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:d.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:d.strictNullHandling}};return od=function(I,S){var _=I,T=b(S),P,M;typeof T.filter=="function"?(M=T.filter,_=M("",_)):a(T.filter)&&(M=T.filter,P=M);var U=[];if(typeof _!="object"||_===null)return"";var z=i[T.arrayFormat],Z=z==="comma"&&T.commaRoundTrip;P||(P=Object.keys(_)),T.sort&&P.sort(T.sort);for(var X=r(),fe=0;fe<P.length;++fe){var se=P[fe];T.skipNulls&&_[se]===null||c(U,m(_[se],se,z,Z,T.allowEmptyArrays,T.strictNullHandling,T.skipNulls,T.encodeDotInKeys,T.encode?T.encoder:null,T.filter,T.sort,T.allowDots,T.serializeDate,T.format,T.formatter,T.encodeValuesOnly,T.charset,X))}var ke=U.join(T.delimiter),ye=T.addQueryPrefix===!0?"?":"";return T.charsetSentinel&&(T.charset==="iso-8859-1"?ye+="utf8=%26%2310003%3B&":ye+="utf8=%E2%9C%93&"),ke.length>0?ye+ke:""},od}var ud,Mb;function lI(){if(Mb)return ud;Mb=1;var r=Nb(),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,strictDepth:!1,strictNullHandling:!1},i=function(g){return g.replace(/&#(\d+);/g,function(m,b){return String.fromCharCode(parseInt(b,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,b){var I={__proto__:null},S=b.ignoreQueryPrefix?m.replace(/^\?/,""):m;S=S.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var _=b.parameterLimit===1/0?void 0:b.parameterLimit,T=S.split(b.delimiter,_),P=-1,M,U=b.charset;if(b.charsetSentinel)for(M=0;M<T.length;++M)T[M].indexOf("utf8=")===0&&(T[M]===c?U="utf-8":T[M]===u&&(U="iso-8859-1"),P=M,M=T.length);for(M=0;M<T.length;++M)if(M!==P){var z=T[M],Z=z.indexOf("]="),X=Z===-1?z.indexOf("="):Z+1,fe,se;X===-1?(fe=b.decoder(z,n.decoder,U,"key"),se=b.strictNullHandling?null:""):(fe=b.decoder(z.slice(0,X),n.decoder,U,"key"),se=r.maybeMap(a(z.slice(X+1),b),function(ye){return b.decoder(ye,n.decoder,U,"value")})),se&&b.interpretNumericEntities&&U==="iso-8859-1"&&(se=i(se)),z.indexOf("[]=")>-1&&(se=t(se)?[se]:se);var ke=e.call(I,fe);ke&&b.duplicates==="combine"?I[fe]=r.combine(I[fe],se):(!ke||b.duplicates==="last")&&(I[fe]=se)}return I},h=function(g,m,b,I){for(var S=I?m:a(m,b),_=g.length-1;_>=0;--_){var T,P=g[_];if(P==="[]"&&b.parseArrays)T=b.allowEmptyArrays&&(S===""||b.strictNullHandling&&S===null)?[]:[].concat(S);else{T=b.plainObjects?Object.create(null):{};var M=P.charAt(0)==="["&&P.charAt(P.length-1)==="]"?P.slice(1,-1):P,U=b.decodeDotInKeys?M.replace(/%2E/g,"."):M,z=parseInt(U,10);!b.parseArrays&&U===""?T={0:S}:!isNaN(z)&&P!==U&&String(z)===U&&z>=0&&b.parseArrays&&z<=b.arrayLimit?(T=[],T[z]=S):U!=="__proto__"&&(T[U]=S)}S=T}return S},d=function(m,b,I,S){if(m){var _=I.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m,T=/(\[[^[\]]*])/,P=/(\[[^[\]]*])/g,M=I.depth>0&&T.exec(_),U=M?_.slice(0,M.index):_,z=[];if(U){if(!I.plainObjects&&e.call(Object.prototype,U)&&!I.allowPrototypes)return;z.push(U)}for(var Z=0;I.depth>0&&(M=P.exec(_))!==null&&Z<I.depth;){if(Z+=1,!I.plainObjects&&e.call(Object.prototype,M[1].slice(1,-1))&&!I.allowPrototypes)return;z.push(M[1])}if(M){if(I.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+I.depth+" and strictDepth is true");z.push("["+_.slice(M.index)+"]")}return h(z,b,I,S)}},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 b=typeof m.charset>"u"?n.charset:m.charset,I=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(I!=="combine"&&I!=="first"&&I!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var S=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:S,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:b,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:I,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,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:n.strictDepth,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling}};return ud=function(g,m){var b=y(m);if(g===""||g===null||typeof g>"u")return b.plainObjects?Object.create(null):{};for(var I=typeof g=="string"?f(g,b):g,S=b.plainObjects?Object.create(null):{},_=Object.keys(I),T=0;T<_.length;++T){var P=_[T],M=d(P,I[P],b,typeof g=="string");S=r.merge(S,M,b)}return b.allowSparse===!0?S:r.compact(S)},ud}var cd,Db;function fI(){if(Db)return cd;Db=1;var r=cI(),e=lI(),t=sd();return cd={formats:t,parse:e,stringify:r},cd}(function(r,e){(function(t,n){n(e,Rk,Mk,fI())})(pi,function(t,n,i,a){var u=function(B,Q,q,J){function ee(V){return V instanceof q?V:new q(function(xe){xe(V)})}return new(q||(q=Promise))(function(V,xe){function Ve(_e){try{ae(J.next(_e))}catch(Qe){xe(Qe)}}function $e(_e){try{ae(J.throw(_e))}catch(Qe){xe(Qe)}}function ae(_e){_e.done?V(_e.value):ee(_e.value).then(Ve,$e)}ae((J=J.apply(B,Q||[])).next())})},c=function(B,Q){var q={label:0,sent:function(){if(V[0]&1)throw V[1];return V[1]},trys:[],ops:[]},J,ee,V,xe;return xe={next:Ve(0),throw:Ve(1),return:Ve(2)},typeof Symbol=="function"&&(xe[Symbol.iterator]=function(){return this}),xe;function Ve(ae){return function(_e){return $e([ae,_e])}}function $e(ae){if(J)throw new TypeError("Generator is already executing.");for(;q;)try{if(J=1,ee&&(V=ae[0]&2?ee.return:ae[0]?ee.throw||((V=ee.return)&&V.call(ee),0):ee.next)&&!(V=V.call(ee,ae[1])).done)return V;switch(ee=0,V&&(ae=[ae[0]&2,V.value]),ae[0]){case 0:case 1:V=ae;break;case 4:return q.label++,{value:ae[1],done:!1};case 5:q.label++,ee=ae[1],ae=[0];continue;case 7:ae=q.ops.pop(),q.trys.pop();continue;default:if(V=q.trys,!(V=V.length>0&&V[V.length-1])&&(ae[0]===6||ae[0]===2)){q=0;continue}if(ae[0]===3&&(!V||ae[1]>V[0]&&ae[1]<V[3])){q.label=ae[1];break}if(ae[0]===6&&q.label<V[1]){q.label=V[1],V=ae;break}if(V&&q.label<V[2]){q.label=V[2],q.ops.push(ae);break}V[2]&&q.ops.pop(),q.trys.pop();continue}ae=Q.call(B,q)}catch(_e){ae=[6,_e],ee=0}finally{J=V=0}if(ae[0]&5)throw ae[1];return{value:ae[0]?ae[1]:void 0,done:!0}}};function f(B,Q){if(B.directives&&B.directives.length){var q={};return B.directives.forEach(function(J){q[J.name.value]=i.argumentsObjectFromField(J,Q)}),q}return null}var h=Object.prototype.hasOwnProperty;function d(B,Q){Q!==null&&typeof Q=="object"&&Object.keys(Q).forEach(function(q){var J=Q[q];h.call(B,q)?d(B[q],J):B[q]=J})}function y(B,Q,q,J,ee,V){V===void 0&&(V={});var xe=i.getMainDefinition(Q),Ve=i.getFragmentDefinitions(Q),$e=i.createFragmentMap(Ve),ae=V.resultMapper,_e=V.fragmentMatcher||function(){return!0},Qe={fragmentMap:$e,contextValue:J,variableValues:ee,resultMapper:ae,resolver:B,fragmentMatcher:_e};return g(xe.selectionSet,q,Qe)}function g(B,Q,q){return u(this,void 0,void 0,function(){var J,ee,V,xe,Ve,$e=this;return c(this,function(ae){switch(ae.label){case 0:return J=q.fragmentMap,ee=q.contextValue,V=q.variableValues,xe={},Ve=function(_e){return u($e,void 0,void 0,function(){var Qe,pt,mt,Yt,Ot;return c(this,function(Wt){switch(Wt.label){case 0:return i.shouldInclude(_e,V)?i.isField(_e)?[4,m(_e,Q,q)]:[3,2]:[2];case 1:return Qe=Wt.sent(),pt=i.resultKeyNameFromField(_e),Qe!==void 0&&(xe[pt]===void 0?xe[pt]=Qe:d(xe[pt],Qe)),[2];case 2:if(i.isInlineFragment(_e))mt=_e;else if(mt=J[_e.name.value],!mt)throw new Error("No fragment named "+_e.name.value);return Yt=mt.typeCondition.name.value,q.fragmentMatcher(Q,Yt,ee)?[4,g(mt.selectionSet,Q,q)]:[3,4];case 3:Ot=Wt.sent(),d(xe,Ot),Wt.label=4;case 4:return[2]}})})},[4,Promise.all(B.selections.map(Ve))];case 1:return ae.sent(),q.resultMapper?[2,q.resultMapper(xe,Q)]:[2,xe]}})})}function m(B,Q,q){return u(this,void 0,void 0,function(){var J,ee,V,xe,Ve,$e,ae;return c(this,function(_e){switch(_e.label){case 0:return J=q.variableValues,ee=q.contextValue,V=q.resolver,xe=B.name.value,Ve=i.argumentsObjectFromField(B,J),$e={isLeaf:!B.selectionSet,resultKey:i.resultKeyNameFromField(B),directives:f(B,J),field:B},[4,V(xe,Q,Ve,ee,$e)];case 1:return ae=_e.sent(),B.selectionSet?ae==null?[2,ae]:Array.isArray(ae)?[2,b(B,ae,q)]:[2,g(B.selectionSet,ae,q)]:[2,ae]}})})}function b(B,Q,q){return Promise.all(Q.map(function(J){return J===null?null:Array.isArray(J)?b(B,J,q):g(B.selectionSet,J,q)}))}var I=function(){var B=function(Q,q){return B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,ee){J.__proto__=ee}||function(J,ee){for(var V in ee)ee.hasOwnProperty(V)&&(J[V]=ee[V])},B(Q,q)};return function(Q,q){B(Q,q);function J(){this.constructor=Q}Q.prototype=q===null?Object.create(q):(J.prototype=q.prototype,new J)}}(),S=function(){return S=Object.assign||function(B){for(var Q,q=1,J=arguments.length;q<J;q++){Q=arguments[q];for(var ee in Q)Object.prototype.hasOwnProperty.call(Q,ee)&&(B[ee]=Q[ee])}return B},S.apply(this,arguments)},_=function(B,Q,q,J){function ee(V){return V instanceof q?V:new q(function(xe){xe(V)})}return new(q||(q=Promise))(function(V,xe){function Ve(_e){try{ae(J.next(_e))}catch(Qe){xe(Qe)}}function $e(_e){try{ae(J.throw(_e))}catch(Qe){xe(Qe)}}function ae(_e){_e.done?V(_e.value):ee(_e.value).then(Ve,$e)}ae((J=J.apply(B,Q||[])).next())})},T=function(B,Q){var q={label:0,sent:function(){if(V[0]&1)throw V[1];return V[1]},trys:[],ops:[]},J,ee,V,xe;return xe={next:Ve(0),throw:Ve(1),return:Ve(2)},typeof Symbol=="function"&&(xe[Symbol.iterator]=function(){return this}),xe;function Ve(ae){return function(_e){return $e([ae,_e])}}function $e(ae){if(J)throw new TypeError("Generator is already executing.");for(;q;)try{if(J=1,ee&&(V=ae[0]&2?ee.return:ae[0]?ee.throw||((V=ee.return)&&V.call(ee),0):ee.next)&&!(V=V.call(ee,ae[1])).done)return V;switch(ee=0,V&&(ae=[ae[0]&2,V.value]),ae[0]){case 0:case 1:V=ae;break;case 4:return q.label++,{value:ae[1],done:!1};case 5:q.label++,ee=ae[1],ae=[0];continue;case 7:ae=q.ops.pop(),q.trys.pop();continue;default:if(V=q.trys,!(V=V.length>0&&V[V.length-1])&&(ae[0]===6||ae[0]===2)){q=0;continue}if(ae[0]===3&&(!V||ae[1]>V[0]&&ae[1]<V[3])){q.label=ae[1];break}if(ae[0]===6&&q.label<V[1]){q.label=V[1],V=ae;break}if(V&&q.label<V[2]){q.label=V[2],q.ops.push(ae);break}V[2]&&q.ops.pop(),q.trys.pop();continue}ae=Q.call(B,q)}catch(_e){ae=[6,_e],ee=0}finally{J=V=0}if(ae[0]&5)throw ae[1];return{value:ae[0]?ae[1]:void 0,done:!0}}},P=function(){for(var B=0,Q=0,q=arguments.length;Q<q;Q++)B+=arguments[Q].length;for(var J=Array(B),ee=0,Q=0;Q<q;Q++)for(var V=arguments[Q],xe=0,Ve=V.length;xe<Ve;xe++,ee++)J[ee]=V[xe];return J},M=function(B){var Q=B.replace(/\s/g,""),q=Q.replace(/\[(.*)\]/,function(J,ee,V,xe){return((ee!=null&&ee.length)>0?ee:null)||Q});return q},U=function(B,Q,q,J){if(Array.isArray(B)){var ee=M(Q);return B.map(function(V){return U(V,ee,q,J)})}return B==null||typeof B=="number"||typeof B=="boolean"||typeof B=="string"?B:q(B,Q,q,J)},z=function(B){return B.directives&&B.directives.length?B.directives.find(function(Q){return Q.name.value==="rest"}):null};function Z(B,Q,q,J,ee){return ee==null||Q==null||typeof Q=="number"||typeof Q=="boolean"||typeof Q=="string"||ee.selections.forEach(function(V){if(i.isInlineFragment(V))Z(B,Q,q,J,V.selectionSet);else if(V.kind==="FragmentSpread"){var xe=J[V.name.value];Z(B,Q,q,J,xe.selectionSet)}else if(i.isField(V)){var Ve=i.resultKeyNameFromField(V);Ve===B&&z(V)!=null?X(Q,q,J,V.selectionSet):Z(B,Q,q,J,V.selectionSet)}else return function($e){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()}),Q}function X(B,Q,q,J){if(!(B==null||typeof B=="number"||typeof B=="boolean"||typeof B=="string")){if(Array.isArray(B)){B.forEach(function(ee){return X(ee,Q,q,J)});return}J.selections.forEach(function(ee){if(i.isInlineFragment(ee))X(B,Q,q,ee.selectionSet);else if(ee.kind==="FragmentSpread"){var V=q[ee.name.value];X(B,Q,q,V.selectionSet)}else if(i.isField(ee)){var xe=B[ee.name.value];ee.name.value==="__typename"||(typeof xe>"u"?B[ee.name.value]=null:xe!=null&&typeof xe=="object"&&ee.selectionSet!=null&&X(xe,Q,q,ee.selectionSet))}else return function(Ve){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()})}}var fe=function(B,Q){var q=B[Q||tt]||B[tt];return typeof q=="string"?{uri:q}:S({responseTransformer:null},q)},se=function(B,Q,q){return q===void 0||Q===void 0?B:B.replace(":"+Q,q)},ke=function(){function B(){}return B.replacerForPath=function(Q){if(Q in B.cache)return B.cache[Q];var q=Q.indexOf("?"),J=Q.split(B.argReplacement),ee=[],V=!1;J.reduce(function(Ve,$e){if($e===""||$e==="{}")return Ve+$e.length;var ae=Ve+$e.length;if($e[0]==="{"&&$e[$e.length-1]==="}"){var _e=$e.slice(1,$e.length-1).split(".");ee.push(function(Qe,pt){try{var mt=ye(Qe,_e);return!pt||typeof mt!="object"||mt==null?String(mt):a.stringify(mt)}catch{var Yt=[Q,_e.join(".")].join("|");return Yt in B.warnTable||(console.warn("Warning: RestLink caught an error while unpacking",Yt,"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."),B.warnTable[Yt]=!0),""}})}else ee.push($e),!V&&ae>=q&&(V=!0,ee.push(!0));return ae},0);var xe=function(Ve){var $e=!1,ae=ee.reduce(function(_e,Qe){return typeof Qe=="string"?_e+Qe:typeof Qe=="boolean"?($e=!0,_e):_e+Qe(Ve,$e)},"");return ae};return B.cache[Q]=xe},B.cache={},B.warnTable={},B.argReplacement=/({[._a-zA-Z0-9]*})/,B}();function ye(B,Q){if(Q.length===0)return B;var q=P(Q),J=q.shift();return ye(B[J],q)}var Pe=["__typename"],Ie=typeof globalThis=="object"&&globalThis||pi,ve=function(B,Q,q){q===void 0&&(q=[]);var J=null;return Q.length!=2?J=function(ee,V){return Q(ee)}:J=Q,Array.isArray(B)?B.map(function(ee,V){return ve(ee,J,P(q,[String(V)]))}):B==null||typeof B!="object"||B.constructor!==Object||Ie.FileList&&B instanceof FileList||Ie.File&&B instanceof File?B:Object.keys(B).reduce(function(ee,V){var xe=B[V];if(Pe.indexOf(V)!==-1)return ee[V]=xe,ee;var Ve=P(q,[V]);return ee[J(V,Ve)]=ve(xe,J,Ve),ee},{})},ze=function(B){return B},he=function(B){return B instanceof Headers?B:new Headers(B||{})},re=function(){for(var B=[],Q=0;Q<arguments.length;Q++)B[Q]=arguments[Q];return B.reduce(function(q,J){return J&&(J.forEach||(J=he(J)),J.forEach(function(ee,V){q.append(V,ee)})),q},new Headers)},ge=function(B,Q,q){var J=new Headers;return B.forEach(function(ee,V){Q.indexOf(V)===-1&&J.append(V,ee)}),re(J,q||new Headers)},je=function(B){return function(Q,q){return ge(Q,B,q)}},Se=["GET","POST","PUT","PATCH","DELETE"],He=function(B,Q){switch(Q){case"query":if(Se.indexOf(B.toUpperCase())!==-1)return;throw new Error('A "query" operation can only support "GET" requests but got "'+B+'".');case"mutation":if(Se.indexOf(B.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 q=Q;return q}},ht=function(B,Q,q){var J=new Error(q);throw J.response=B,J.statusCode=B.status,J.result=Q,J},Vt=function(B,Q){return B==null||typeof B!="object"?B:Array.isArray(B)?B.map(function(q){return Vt(q,Q)}):(B.__typename=Q,B)},Rt=function(B,Q,q,J,ee){return _(void 0,void 0,void 0,function(){var V,xe,Ve,$e,ae,_e,Qe,pt,mt,Yt,Ot,Wt,Gt,Er,zt,sr,dr,Ar,Ht,H,G,st,vt,lt,We,Kt,Zt,Qt,kr,Hr,Fr,jt,Or,$r,Lr,ar,Gr,Tr,gr,Ir,Sn,Un,R,ue,be,Ce,Be,ut,Ye,Xe;return T(this,function(et){switch(et.label){case 0:if(V=ee.directives,xe=ee.isLeaf,Ve=ee.resultKey,$e=J.exportVariablesByNode,ae=$e.get(Q)||{},_e=function(gt){return gt instanceof Array?gt.forEach(_e):$e.set(gt,S({},ae)),gt},Qe=(Q||{})[Ve],pt=(Q||{})[B],Q&&V&&V.export&&(ae[V.export.as]=pt),mt=V&&V.type,!xe&&mt){if(V.rest)throw new Error("Invalid use of @type(name: ...) directive on a call that also has @rest(...)");return _e(pt),[2,Vt(pt,V.type.name)]}if(Yt=!V||!V.rest,Yt)return[2,_e(Qe||pt)];if(Ot=J.credentials,Wt=J.endpoints,Gt=J.headers,Er=J.customFetch,zt=J.operationType,sr=J.typePatcher,dr=J.mainDefinition,Ar=J.fragmentDefinitions,Ht=J.fieldNameNormalizer,H=J.fieldNameDenormalizer,G=J.serializers,st=J.responseTransformer,vt=i.createFragmentMap(Ar),lt=V.rest,We=lt.path,Kt=lt.endpoint,Zt=lt.pathBuilder,Qt=fe(Wt,Kt),kr=We==null&&Zt==null,kr)throw new Error('One of ("path" | "pathBuilder") must be set in the @rest() directive. This request had neither, please add one');if(Zt||(We.includes(":")?(console.warn("Deprecated: '@rest(path:' contains a ':' colon, this format will be removed in future versions"),Zt=function(gt){var w=gt.args,k=gt.exportVariables,A=S(S({},w),k),C=Object.keys(A).reduce(function(D,$){return se(D,$,A[$])},We);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}):Zt=ke.replacerForPath(We)),Hr={args:q,exportVariables:ae,context:J,"@rest":V.rest,replacer:Zt},Fr=Zt(Hr),jt=V.rest,Or=jt.method,$r=jt.type,Lr=jt.bodyBuilder,ar=jt.bodyKey,Gr=jt.fieldNameDenormalizer,Tr=jt.fieldNameNormalizer,gr=jt.bodySerializer,Or||(Or="GET"),ar||(ar="input"),Ir=void 0,Sn=void 0,["GET","DELETE"].indexOf(Or)===-1){if(!Lr){if(Un=Hr.exportVariables[ar]||Hr.args&&Hr.args[ar],!Un)throw new Error("[GraphQL "+Or+" "+zt+" using a REST call without a body]. No `"+ar+"` was detected. Pass bodyKey, or bodyBuilder to the @rest() directive to resolve this.");Lr=function(gt){return Un}}if(Ir=ve(Lr(Hr),Gr||H||ze),R=void 0,typeof gr=="string"){if(!G.hasOwnProperty(gr))throw new Error('"bodySerializer" must correspond to configured serializer. '+("Please make sure to specify a serializer called "+gr+' in the "bodySerializers" property of the RestLink.'));R=G[gr](Ir,Gt)}else R=gr?gr(Ir,Gt):G[it](Ir,Gt);Ir=R.body,Sn=new Headers(R.headers)}return He(Or,zt||"query"),ue=S({method:Or,headers:Sn||Gt,body:Ir},Ot?{credentials:Ot}:{}),be=""+Qt.uri+Fr,[4,(Er||fetch)(be,ue)];case 1:return Ce=et.sent(),J.responses.push(Ce),Ce.ok?(Ce.status===204||Ce.headers.get("Content-Length")==="0"?Be={}:Be=Ce,[3,9]):[3,2];case 2:return Ce.status!==404?[3,3]:(Be=null,[3,9]);case 3:ut=void 0,et.label=4;case 4:return et.trys.push([4,6,,8]),[4,Ce.clone().json()];case 5:return ut=et.sent(),[3,8];case 6:return et.sent(),[4,Ce.clone().text()];case 7:return ut=et.sent(),[3,8];case 8:ht(Ce,ut,"Response not successful: Received status code "+Ce.status),et.label=9;case 9:if(Ye=Qt.responseTransformer||st,!Ye)return[3,14];et.label=10;case 10:return et.trys.push([10,12,,13]),[4,Ye(Be,$r)];case 11:return Be=et.sent(),[3,13];case 12:throw Xe=et.sent(),console.warn("An error occurred in a responseTransformer:"),Xe;case 13:return[3,16];case 14:return Be&&Be.json?[4,Be.json()]:[3,16];case 15:Be=et.sent(),et.label=16;case 16:return Be=ve(Be,Tr||Ht||ze),Be=Z(Ve,Be,dr,vt,dr.selectionSet),Be=U(Be,$r,sr,{resolverParams:{fieldName:B,root:Q,args:q,context:J,info:ee}}),[2,_e(Be)]}})})},tt="",it="",Et=function(B,Q){return Q.has("content-type")||Q.append("Content-Type","application/json"),{body:JSON.stringify(B),headers:Q}},Me={test:function(B){return B.name.value==="rest"},remove:!0},Ge=function(B){I(Q,B);function Q(q){var J,ee=q.uri,V=q.endpoints,xe=q.headers,Ve=q.fieldNameNormalizer,$e=q.fieldNameDenormalizer,ae=q.typePatcher,_e=q.customFetch,Qe=q.credentials,pt=q.bodySerializers,mt=q.defaultSerializer,Yt=q.responseTransformer,Ot=B.call(this)||this,Wt={};if(Wt[tt]=ee||"",Ot.endpoints=Object.assign({},V||Wt),ee==null&&V==null)throw new Error("A RestLink must be initialized with either 1 uri, or a map of keyed-endpoints");if(ee!=null){var Gt=(V||{})[tt];if(Gt!=null&&Gt!=ee)throw new Error("RestLink was configured with a default uri that doesn't match what's passed in to the endpoints map.");Ot.endpoints[tt]=ee}if(Ot.endpoints[tt]==null&&console.warn("RestLink configured without a default URI. All @rest(…) directives must provide an endpoint key!"),ae==null)Ot.typePatcher=function(zt,sr,dr){return S({__typename:sr},zt)};else if(!Array.isArray(ae)&&typeof ae=="object"&&Object.keys(ae).map(function(zt){return ae[zt]}).reduce(function(zt,sr){return zt&&typeof sr=="function"},!0)){var Er=ae;Ot.typePatcher=function(zt,sr,dr,Ar){var Ht=zt.__typename||sr;if(Array.isArray(zt))return zt.map(function(G){return dr(G,Ht,dr,Ar)});var H=Er[Ht]||function(G){return G};return S({__typename:Ht},H(zt,Ht,dr,Ar))}}else throw new Error("RestLink was configured with a typePatcher of invalid type!");return pt&&pt.hasOwnProperty(it)&&console.warn("RestLink was configured to override the default serializer! This may result in unexpected behavior"),Ot.responseTransformer=Yt||null,Ot.fieldNameNormalizer=Ve||null,Ot.fieldNameDenormalizer=$e||null,Ot.headers=he(xe),Ot.credentials=Qe||null,Ot.customFetch=_e,Ot.serializers=S((J={},J[it]=mt||Et,J),pt||{}),Ot.processedDocuments=new Map,Ot}return Q.prototype.removeRestSetsFromDocument=function(q){var J=this.processedDocuments.get(q);if(J)return J;i.checkDocument(q);var ee=i.removeDirectivesFromDocument([Me],q);return this.processedDocuments.set(q,ee),ee},Q.prototype.request=function(q,J){var ee=q.query,V=q.variables,xe=q.getContext,Ve=q.setContext,$e=xe(),ae=i.hasDirectives(["rest"],ee);if(!ae)return J(q);var _e=this.removeRestSetsFromDocument(ee),Qe=$e.headersMergePolicy;Qe==null&&Array.isArray($e.headersToOverride)?Qe=je($e.headersToOverride):Qe==null&&(Qe=re);var pt=Qe(this.headers,$e.headers);pt.has("Accept")||pt.append("Accept","application/json");var mt=$e.credentials||this.credentials,Yt=i.addTypenameToDocument(ee),Ot=i.getMainDefinition(ee),Wt=i.getFragmentDefinitions(ee),Gt=(Ot||{}).operation||"query",Er={headers:pt,endpoints:this.endpoints,exportVariablesByNode:new Map,credentials:mt,customFetch:this.customFetch,operationType:Gt,fieldNameNormalizer:this.fieldNameNormalizer,fieldNameDenormalizer:this.fieldNameDenormalizer,mainDefinition:Ot,fragmentDefinitions:Wt,typePatcher:this.typePatcher,serializers:this.serializers,responses:[],responseTransformer:this.responseTransformer},zt={},sr;return _e&&J?(q.query=_e,sr=J(q)):sr=n.Observable.of({data:{}}),sr.flatMap(function(dr){var Ar=dr.data,Ht=dr.errors;return new n.Observable(function(H){y(Rt,Yt,Ar,Er,V,zt).then(function(G){Ve({restResponses:($e.restResponses||[]).concat(Er.responses)}),H.next({data:G,errors:Ht}),H.complete()}).catch(function(G){G.name!=="AbortError"&&(G.result&&G.result.errors&&H.next(G.result),H.error(G))})})})},Q}(n.ApolloLink);t.RestLink=Ge,t.PathBuilder=ke,Object.defineProperty(t,"__esModule",{value:!0})})})(mh,mh.exports);var hI=mh.exports;const rc=me.createContext(),dI=()=>{const{isAuthenticated:r,login:e}=ti(),{children:t,isEmbedded:n,setIsEmbedded:i,authError:a}=me.useContext(rc),u=pn.useNavigate(),c=pn.useLocation(),[f,h]=me.useState(!1),[d,y]=me.useState(),[g,m]=me.useState(),[b,I]=me.useState({}),[S,_]=me.useState({}),[T,P]=me.useState({}),[M,U]=me.useState({}),[z,Z]=me.useState(!1),[X,fe]=me.useState({});me.useEffect(()=>{var he;if(!(!c||c.pathname!=="/mm-embedded-login")){if(r||a)if(((he=new URL(origin))==null?void 0:he.protocol)==="http:"){window.close();return}else{const ge=new URLSearchParams(c.search),je=ge.get("id"),Se=ge.get("origin");a?window.parent.postMessage({type:"authorize-failed",instanceId:je,error:a,authUrl:window.location.href},Se):window.parent.postMessage({type:"authorized",instanceId:je,authUrl:window.location.href},Se);return}r===!1&&e()}},[c]),me.useEffect(()=>{var je,Se;if(r===null||!c||c.pathname!=="/mm-embedded-interop")return;const he=new URLSearchParams(c.search),re=he.get("id"),ge=he.get("origin");if(ge){const He=(je=new URL(ge))==null?void 0:je.hostname;if(/^(?:[\w-]+\.)*(?:machinemetrics\.com|machinemetrics-us-gov\.com|m12s\.com)$/.test(He))y(ge);else{alert("Invalid Embeddable Zone Host");return}}if(r===!1){if(ge){const He={instanceId:re,authUrl:`${window.location.protocol}//${window.location.host}/mm-embedded-login?id=${re}&origin=${ge}`,origin:ge};if(((Se=new URL(ge))==null?void 0:Se.protocol)==="http:"){window.parent.postMessage({type:"login",...He},ge);return}e({mm_instanceId:He.instanceId,mm_authUrl:encodeURIComponent(He.authUrl),mm_origin:He.origin});return}e();return}re&&m(re),re&&ge&&i(!0)},[c,r]),pn.useBlocker(({nextLocation:he})=>{var re;return n?(re=he.state)!=null&&re.fromParent?(h(!0),!1):(se(`${he.pathname}${he.search}`),!0):!1}),me.useEffect(()=>{if(!n||!d)return;const he=re=>{re.metaKey&&re.key==="k"&&window.parent.postMessage({type:"open-search",instanceId:g},d)};return window.addEventListener("keydown",he),()=>{window.removeEventListener("keydown",he)}},[n,d]),me.useEffect(()=>{if(!n||!d)return;const he=({origin:re,data:ge})=>{var je,Se,He;if(re===d)switch(ge.type){case"navigate":u(ge.path,{replace:!0,state:{fromParent:!0}});break;case"set-context":I(ge.context||{});break;case"set-configuring":Z(ge.isConfiguring);break;case"set-params":fe(ge.params);break;case"load-options":(je=S[ge.name])==null||je.call(S,{filter:ge.filter});break;case"validate":(Se=T[ge.name])==null||Se.call(T,{value:ge.value});break;case"response":(He=M[ge.callbackId])==null||He.call(M,ge.response);break}};return window.addEventListener("message",he),!f&&r&&window.parent.postMessage({type:"ready",instanceId:g},d),()=>{window.removeEventListener("message",he)}},[u,f,n,r,d,S,T,M]);const se=(he,re)=>{!f&&!r||window.parent.postMessage({type:"set-path",instanceId:g,path:he,...re},d)},ke=he=>{f&&window.parent.postMessage({type:"set-summary",instanceId:g,summary:he},d)},ye=he=>{f&&window.parent.postMessage({type:"toast",instanceId:g,message:he},d)},Pe=he=>{f&&window.parent.postMessage({type:"popup",instanceId:g,message:he},d)},Ie=async({header:he,body:re,choices:ge})=>f?new Promise(je=>{const Se=A0(),He=async ht=>{U(Vt=>{const{[Se]:Rt,...tt}=Vt;return tt}),je(ht)};U(ht=>({...ht,[Se]:He})),window.parent.postMessage({type:"confirm",instanceId:g,header:he,body:re,choices:ge,callbackId:Se},d)}):Promise.reject(new Error("Not ready")),ve=async(he,re)=>{f&&(re.validate&&typeof re.validate=="function"&&P(ge=>{const je=async Se=>{const He=await re.validate(Se);window.parent.postMessage({type:"set-validation",instanceId:g,name:he,validation:He},d)};return ge[he]&&je({value:""}),{...ge,[he]:je}}),re.options&&_(ge=>{const je=async Se=>{const ht=await(typeof re.options=="function"?re.options:()=>re.options)(Se);window.parent.postMessage({type:"set-options",instanceId:g,name:he,options:ht},d)};return ge[he]&&je({filter:""}),{...ge,[he]:je}}),window.parent.postMessage({type:"add-setting",instanceId:g,setting:{name:he,...re,options:void 0,validate:void 0}},d))},ze=me.useMemo(()=>({commands:{navigateParent:se,setSummary:ke,toast:ye,popup:Pe,confirm:Ie},context:{...b,get colorMode(){throw new Error("colorMode has been moved to useMMAppParams")},get isFullScreen(){throw new Error("isFullScreen has been moved to useMMAppParams")}},params:{isEmbedded:n,isConfiguring:z,colorMode:b.colorMode,isFullScreen:b.isFullScreen,...X},addSetting:ve}),[n,z,se,ke,ye,Pe,Ie,b,X,ve]);return nr.jsx(vo.Provider,{value:ze,children:c.pathname!=="/mm-embedded-interop"&&c.pathname!=="/mm-embedded-login"&&c.pathname!=="/mm-embedded-print"?t:nr.jsx(nr.Fragment,{})})},pI=()=>{const{urls:r,jwtRef:e,accessToken:t}=ti(),{graphQLRoleOverride:n,children:i}=me.useContext(rc),[a,u]=me.useState(),[c,f]=me.useState(),h=()=>{const g=new URL(r.graphQLUrl);return`//${g.host}${g.pathname}`},d=()=>n?{"X-Hasura-Role":n}:{};me.useEffect(()=>{const g=new Ok(Ck({url:`wss:${h()}`,lazy:!0,reconnect:!0,connectionParams:async()=>({headers:{Authorization:`Bearer ${e.current}`,...d()}})})),m=D0(({operation:P,networkError:M,forward:U})=>(Bi(P.query).operation==="subscription"&&M&&g.client.terminate(),U(P))),I=M0(async(P,{headers:M})=>({headers:{...M,Authorization:`Bearer ${e.current}`,...d()}})).concat(uf({uri:`https:${h()}`,fetch:window.fetch})),S=m.split(({query:P})=>{const M=Bi(P);return M.kind==="OperationDefinition"&&M.operation==="subscription"},g,I),T=M0(async(P,{headers:M})=>({headers:{...M,Authorization:`Bearer ${t}`}})).concat(new hI.RestLink({uri:r.apiUrl}));f(Kr.from([T,S]))},[]),me.useEffect(()=>{c&&u(new Cf({link:c,cache:new Of}))},[c]);const y=me.useMemo(()=>({link:c}),[c]);return nr.jsx(u0.Provider,{value:y,children:a?nr.jsx(T1,{client:a,children:nr.jsx(zA,{children:nr.jsx(dI,{children:i})})}):nr.jsx(nr.Fragment,{})})},mI=Qp.div`
132
132
  text-align: center;
133
133
  padding-top: 200px;
134
134
  `,Fb=({loadError:r})=>{const e=_k();return r&&(!e||e.indexOf("mm-embedded-login")===-1)?nr.jsx(mI,{children:r}):(k0(),nr.jsx(pn.Navigate,{replace:!0,to:e||"/"}))};Qp.div`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machinemetrics/mm-react-tools",
3
- "version": "4.0.0-0",
3
+ "version": "4.0.1",
4
4
  "description": "Components, hooks, and helper functions for writing React apps using MachineMetrics APIs.",
5
5
  "author": "machinemetrics",
6
6
  "license": "MIT",