@plitzi/plitzi-sdk 0.32.9 → 0.32.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/plitzi-sdk-devtools.css +1 -1
- package/dist/plitzi-sdk-devtools.css.gz +0 -0
- package/dist/plitzi-sdk.js +3 -3
- package/dist/plitzi-sdk.js.gz +0 -0
- package/package.json +24 -24
package/dist/plitzi-sdk.js
CHANGED
|
@@ -4,7 +4,7 @@ return A(Ba,{value:n,children:t})},Wa=({ref:e,children:t,tag:n="div",className:r
|
|
|
4
4
|
/* webpackIgnore: true */
|
|
5
5
|
URL.createObjectURL(n))}else{let t={default:void 0,ComponentProvider:az,ComponentContext:Qa,usePlitziServiceContext:Ua,RootElement:Wa},n={__WEBPACK_EXTERNAL_MODULE_react__:e,__WEBPACK_EXTERNAL_MODULE_react_dom__:z,__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__:O,__WEBPACK_EXTERNAL_MODULE__plitzi_plitzi_sdk__:t},a=K(window,`plitziPlugins.${r}`);if(!a||"function"!=typeof a)return;i=await a(t,void 0,n)}}catch(NL){return}return i},Ka=e=>{let t={};if(!e)return t;t[e.type]=e;let{plugins:n}=e;return n&&Object.keys(n).length>0&&Object.keys(n).forEach(e=>{Object.assign(t,Ka(n[e]))}),t},Xa=e=>{let t={};return e&&Object.values(e).forEach(e=>{e.type&&Object.assign(t,Ka(e))}),t},Za=(e,t)=>{if(!e)return{};let n={};return Object.keys(e).forEach(r=>{let i=e[r],{version:a,pluginSettings:o,initialItems:s,plugins:l,extraProps:c}=i;n[r]=CO(i),n[r].origin=t,n[r].version=a,n[r].type=r,n[r].initialItems=s,n[r].pluginSettings=o,n[r].extraProps=c,n[r].plugins=Za(l,t)}),n},eo=e=>{let t={};return e&&Object.values(e).forEach(e=>{if(!e.type)return;let{type:n,pluginSettings:r,version:i,initialItems:a,plugins:o,assets:s,content:l,extraProps:c}=e,u=CO(e);u.version=i,u.type=n,u.assets=s,u.initialItems=a,u.pluginSettings=r,u.origin="local-custom",u.content=l,u.extraProps=c,u.plugins=Za(o,"local-custom"),Object.assign(t,Ka(u))}),t},to=/* @__PURE__ */new Map,no=(e,t,n,r=!0,i=!1)=>async()=>{let a=`${e}::${t}`;if(!to.get(a)){let n=Ja(e,e.endsWith(".mjs")||e.includes(".esm.")||e.includes(".module."),t).finally(()=>{to.delete(a)});to.set(a,{promise:n,timestamp:Date.now()})}let o=await(to.get(a)?.promise);if(!o)return{default:TO};let{type:s,pluginSettings:l}=K(o,"default",{}),{version:c,initialItems:u,plugins:d}=o;if(!s)return{default:TO};let p=o.default;return i||(p=CO(o.default)),p.version=c,p.origin="remote",p.type=s,p.initialItems=u,p.pluginSettings=l,p.plugins=Za(d,"remote"),r&&n(p),{default:p}},ro=({url:e="",scope:t="",internalProps:n,autoRegister:r=!0,plitziJsxSkipHOC:i=!1,plitziJsxProps:a=ea})=>{let{register:s}=h(Qa),l=w(()=>p(no(e,t,s,r,i)),[e,t]);/* @__PURE__ */
|
|
6
6
|
return A(o,i?{children:/* @__PURE__ */A(l,{internalProps:n,plitziJsxSkipHOC:i,...a})}:{children:/* @__PURE__ */A(l,{internalProps:n})})},io=({type:e,plugins:t})=>{let n=(e?t[e]:void 0)??((e,t)=>Object.values(e).find(e=>e.subPlugins.find(e=>e===t)))(t,e);if(!n)return;let r=K(n,"assets",[]).filter(e=>"script"===e.type),{scope:i}=n;return{url:r.find(e=>e.isMain)?.params.src??K(r,"0.params.src",""),scope:i}},ao=({key:e,plitziElementLayout:t,type:n,internalProps:r,components:i,plugins:a})=>{let o={...r,plitziElementLayout:t},s=i.notFound?/* @__PURE__ */A(i.notFound,{internalProps:o},e):void 0;if(!n)return s;let l=i[n];if(l)/* @__PURE__ */return A(l,{internalProps:o,extraProps:l.extraProps},e);let c=io({type:n,plugins:a});return c?/* @__PURE__ */A(ro,{url:c.url,scope:c.scope,internalProps:o},e):s},oo=e=>{let t={};for(let n of e.split(";")){let e=n.indexOf(":");if(-1===e)continue;let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();if(r&&i){let e=r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());t[e]=i}}return t},so=({id:e})=>{let[t]=N(()=>{if(typeof document>"u")return null;let t=document.querySelector(`[data-rsc-id="${e}"]`);if(!t)return null;let n={};for(let e=0;e<t.attributes.length;e++){let{name:r,value:i}=t.attributes[e];"class"!==r&&"style"!==r&&"data-rsc-id"!==r&&(n[r]=i)}let r=t.getAttribute("style");return{tag:t.tagName.toLowerCase(),className:t.className,style:r?oo(r):void 0,attrs:n,html:t.innerHTML}});return t?c(t.tag,{"data-rsc-id":e,className:t.className||void 0,style:t.style,...t.attrs,dangerouslySetInnerHTML:{__html:t.html}}):null},lo=l({});lo.displayName="CollectionContext";var co=(e,t)=>t.idRef?`${e}_${t.idRef}`:"",uo=e=>{let t="number";return/^"/.test(e)?t=/:$/.test(e)?"text-red-700":"text-green-700":/true|false/.test(e)?t="text-blue-700":/null/.test(e)&&(t=""),`<span class="${t}">${e}</span>`},po=/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,fo=e=>e?.replace(po,uo)??e,ho=Symbol("twigArrowParams"),mo=(e,t)=>e===t?0:null==e?-1:null==t?1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t)),go=e=>null==e?"":String(e),yo=e=>"object"==typeof e&&!!e&&"__PLITZI_RAW__"===e.__marker,bo=e=>yo(e)?e.__raw:e,vo={raw:e=>(e=>({__raw:e,__marker:"__PLITZI_RAW__"}))(e),to_json:e=>"object"==typeof e&&e?JSON.stringify(e):go(e),json_encode:e=>"object"==typeof e&&e?JSON.stringify(e):go(e),object_as_json:e=>"object"==typeof e&&e?JSON.stringify(e):e,default:(e,t)=>(e=>null==e||""===e)(e)?t[0]:e,upper:e=>"string"==typeof e?e.toUpperCase():e,lower:e=>"string"==typeof e?e.toLowerCase():e,trim:e=>"string"==typeof e?e.trim():e,capitalize:e=>"string"==typeof e&&e.length>0?e[0].toUpperCase()+e.slice(1).toLowerCase():e,title:e=>"string"==typeof e?e.replace(/\b\w/g,e=>e.toUpperCase()):e,camelize:e=>"string"==typeof e?e.replace(/[-_]+(.)?/g,(e,t)=>t?t.toUpperCase():""):e,kebab:e=>"string"==typeof e?e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():e,snake:e=>"string"==typeof e?e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase():e,ltrim:e=>"string"==typeof e?e.trimStart():e,rtrim:e=>"string"==typeof e?e.trimEnd():e,pad:(e,t)=>{if("string"!=typeof e)return e;let n=Number(t[0])||0,r=t.length>1?go(t[1]):" ";if(""===r)return e;let i=n-e.length;if(i<=0)return e;let a=Math.ceil(i/r.length);return r.repeat(a).slice(0,i)+e},padRight:(e,t)=>{if("string"!=typeof e)return e;let n=Number(t[0])||0,r=t.length>1?go(t[1]):" ";if(""===r)return e;let i=n-e.length;if(i<=0)return e;let a=Math.ceil(i/r.length);return e+r.repeat(a).slice(0,i)},number:(e,t)=>{if("number"==typeof e){let n=Number(t[0])||0;return e.toFixed(n)}if("string"!=typeof e)return e;let n=e.match(/-?\d+(?:\.\d+)?/);return n?Number(n[0]):0},replace:(e,t)=>"string"!=typeof e||0===t.length?e:e.split(go(t[0])).join(go(t[1])),slice:(e,t)=>{if(0===t.length)return e;let n=Number(t[0])||0,r=t.length>1&&Number.isFinite(Number(t[1]))?n+Number(t[1]):void 0;return"string"==typeof e||Array.isArray(e)?e.slice(n,r):e},split:(e,t)=>"string"==typeof e&&t.length>0?e.split(go(t[0])):e,join:(e,t)=>Array.isArray(e)?e.join(0===t.length?"":go(t[0])):e,reverse:e=>"string"==typeof e?e.split("").reverse().join(""):Array.isArray(e)?[...e].reverse():e,length:e=>"string"==typeof e||Array.isArray(e)?e.length:"number"==typeof e?go(e).length:"object"==typeof e&&e?Object.keys(e).length:0,first:e=>"string"==typeof e?e.length>0?e[0]:"":Array.isArray(e)?e.length>0?e[0]:void 0:e,last:e=>"string"==typeof e?e.length>0?e[e.length-1]:"":Array.isArray(e)?e.length>0?e[e.length-1]:void 0:e,contains:(e,t)=>{if(0===t.length)return!1;let n=t[0];return"string"==typeof e?e.includes(go(n)):!!Array.isArray(e)&&e.includes(n)},startswith:(e,t)=>"string"==typeof e&&t.length>0&&e.startsWith(go(t[0])),endswith:(e,t)=>"string"==typeof e&&t.length>0&&e.endsWith(go(t[0])),number_format:(e,t)=>{if("number"!=typeof e)return e;let n=Number(t[0])||0,r=null==t[1]?".":go(t[1]),i=null==t[2]?"":go(t[2]),a=e.toFixed(n);if(""===i)return a.replace(".",r);let o=a.split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,i),o.join(r)},sort:(e,t)=>{if(!Array.isArray(e))return e;let n=[...e],r=t[0];if("function"==typeof r){let e=r;return(e[ho]??1)>=2?n.sort((t,n)=>Number(e(t,n))):n.sort((t,n)=>mo(e(t),e(n)))}return n.sort(mo)},batch:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=Number(t[0]);if(n<=0)return e;let r=[];for(let i=0;i<e.length;i+=n)r.push(e.slice(i,i+n));return r},map:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=t[0];return"function"==typeof n?e.map((e,t)=>n(e,t)):e},reduce:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=t[0];if("function"!=typeof n)return e;let r=t[1],i=+(void 0===r),a=void 0===r?e[0]:r;for(let o=i;o<e.length;o++)a=n(a,e[o],o);return a},merge:(e,t)=>{if(0===t.length)return e;let n=t[0];return Array.isArray(e)&&Array.isArray(n)?[...e,...n]:"object"==typeof e&&e&&"object"==typeof n&&n&&!Array.isArray(n)?{...e,...n}:e},keys:e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.keys(e):e,values:e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.values(e):e,filter:(e,t)=>{if(!Array.isArray(e))return e;if(0===t.length)return e.filter(Boolean);let n=t[0];if("function"==typeof n)return e.filter((e,t)=>n(e,t));let r=go(n);return e.filter(e=>{if("object"==typeof e&&e){let t=e[r];return null!=t&&!1!==t&&""!==t}return!!e})},column:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=go(t[0]);return e.map(e=>"object"==typeof e&&e?e[n]:void 0)},url_encode:e=>"string"==typeof e?encodeURIComponent(e):"object"==typeof e&&e&&!Array.isArray(e)?new URLSearchParams(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,go(t)]))).toString():e,nl2br:e=>"string"==typeof e?e.replace(/\n/g,"<br>"):e,striptags:(e,t)=>{if("string"!=typeof e)return e;let n=t.length>0?go(t[0]).trim():"";if(n){let t=n.split(/(?:\s*>\s*<\s*|<\s*|>\s*)/).filter(Boolean).map(e=>e.replace(/[/>]/g,"").trim());if(t.length>0){let n=RegExp(`<(?!/?(?:${t.join("|")})\\b)[^>]+>`,"gi");return e.replace(n,"").replace(/\s+/g," ").trim()}}return e.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()},abs:e=>"number"==typeof e?Math.abs(e):e,round:(e,t)=>{if("number"!=typeof e)return e;let n=Number(t[0])||0,r=null==t[1]?"common":go(t[1]),i=10**n;return"ceil"===r?Math.ceil(e*i)/i:"floor"===r?Math.floor(e*i)/i:Math.round(e*i)/i},format:(e,t)=>{if("string"!=typeof e)return e;let n=0;return e.replace(/%s|%d|%f|%%/g,e=>{if("%%"===e)return"%";let r=t[n];return n++,void 0===r?e:"%d"===e?String(Math.floor(Number(r))):"%f"===e?String(Number(r)):go(r)})},spaceless:e=>"string"==typeof e?e.replace(/>\s+</g,"><").trim():e,random:e=>Array.isArray(e)?e.length>0?e[Math.floor(Math.random()*e.length)]:void 0:"string"==typeof e?e.length>0?e[Math.floor(Math.random()*e.length)]:"":"number"==typeof e?Math.floor(Math.random()*e):e,date:(e,t)=>{if(0===t.length)return e;let n=go(t[0]),r=e instanceof Date?e:new Date(String(e));if(Number.isNaN(r.getTime()))return"";let i=e=>String(e).padStart(2,"0"),a={Y:String(r.getFullYear()),m:i(r.getMonth()+1),d:i(r.getDate()),H:i(r.getHours()),i:i(r.getMinutes()),s:i(r.getSeconds()),l:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][r.getDay()],F:["January","February","March","April","May","June","July","August","September","October","November","December"][r.getMonth()],M:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.getMonth()]},o="";for(let s of n)o+=Object.prototype.hasOwnProperty.call(a,s)?a[s]:s;return o},base64_encode:e=>"string"==typeof e?(e=>{let t=(new TextEncoder).encode(e),n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n)})(e):e,base64_decode:e=>"string"==typeof e?(e=>{let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return(new TextDecoder).decode(n)})(e):e,md5:e=>"string"==typeof e?(e=>{let t=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],n=/* @__PURE__ */new Uint32Array(64);for(let h=0;h<64;h++)n[h]=Math.floor(4294967296*Math.abs(Math.sin(h+1)));let r=(new TextEncoder).encode(e),i=8*r.length,a=1+(r.length+8>>6)<<6,o=new Uint8Array(a);o.set(r),o[r.length]=128;let s=new DataView(o.buffer);s.setUint32(a-8,i>>>0,!0),s.setUint32(a-4,Math.floor(i/4294967296)>>>0,!0);let l=1732584193,c=4023233417,u=2562383102,d=271733878,p=(e,t)=>e<<t|e>>>32-t;for(let h=0;h<a;h+=64){let e=/* @__PURE__ */new Uint32Array(16);for(let t=0;t<16;t++)e[t]=s.getUint32(h+4*t,!0);let r=l,i=c,a=u,o=d;for(let s=0;s<64;s++){let l,c;s<16?(l=i&a|~i&o,c=s):s<32?(l=o&i|~o&a,c=(5*s+1)%16):s<48?(l=i^a^o,c=(3*s+5)%16):(l=a^(i|~o),c=7*s%16),l=l+r+n[s]+e[c]|0,r=o,o=a,a=i,i=i+p(l,t[s])|0}l=l+r|0,c=c+i|0,u=u+a|0,d=d+o|0}let f=e=>{let t="";for(let n=0;n<4;n++)t+=(e>>>8*n&255).toString(16).padStart(2,"0");return t};return f(l)+f(c)+f(u)+f(d)})(e):e,without:(e,t)=>{if("object"!=typeof e||!e||Array.isArray(e))return e;let n=t.map(go),r={};for(let[i,a]of Object.entries(e))n.includes(i)||(r[i]=a);return r},only:(e,t)=>{if("object"!=typeof e||!e||Array.isArray(e))return e;let n=t.map(go),r={};for(let[i,a]of Object.entries(e))n.includes(i)&&(r[i]=a);return r},find:(e,t)=>{if(!Array.isArray(e)||0===t.length)return;let n=t[0];if("function"==typeof n)return e.find((e,t)=>n(e,t));if(t.length<2)return;let r=go(n),i=t[1];return e.find(e=>"object"==typeof e&&e?e[r]===i:e===i)},pluck:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=go(t[0]);return e.map(e=>"object"==typeof e&&e?e[n]:void 0)},unique:e=>Array.isArray(e)?[...new Set(e)]:e,flatten:e=>Array.isArray(e)?e.flat():e,sum:e=>Array.isArray(e)?e.reduce((e,t)=>e+("number"==typeof t?t:0),0):e,chunk:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=Number(t[0]);if(n<=0)return e;let r=[];for(let i=0;i<e.length;i+=n)r.push(e.slice(i,i+n));return r},index_by:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=go(t[0]),r={};for(let i of e)"object"==typeof i&&i&&(r[String(i[n]??"")]=i);return r},group_by:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let n=go(t[0]),r={};for(let i of e)if("object"==typeof i&&i){let e=String(i[n]??"");r[e]=r[e]??[],r[e].push(i)}return r}},xo=e=>!(null==e||!1===e||""===e||0===e||Array.isArray(e)&&0===e.length),wo=(e,t)=>"string"==typeof t?t.includes(String(e)):Array.isArray(t)?t.includes(e):!("object"!=typeof t||!t)&&String(e)in t,ko=[],So=class e{variables;keepEmptyTokens;breakFlag=!1;continueFlag=!1;hasSet=!1;constructor(e,t=!1){this.variables={...e},this.keepEmptyTokens=t}evalNodes(e){let t=e.length;if(0===t)return"";if(1===t)return this.evalNode(e[0]);let n="";for(let r=0;r<t&&(n+=this.evalNode(e[r]),!this.breakFlag&&!this.continueFlag);r++);return n}evalNode(e){switch(e.type){case"text":return e.value;case"variable":return this.evalVariable(e);case"if":return this.evalIf(e);case"for":return this.evalFor(e);case"set":return this.evalSet(e);case"apply":return this.evalApply(e);case"break":return this.breakFlag=!0,"";case"continue":return this.continueFlag=!0,""}}evalVariable(e){let t=this.evalExpression(e.expression);return!this.keepEmptyTokens||null!=t&&""!==t?yo(t)?String(bo(t)):"function"==typeof t?"":null!=t&&"object"!=typeof t?String(t):e.raw?null==t?"":String(t):"object"==typeof t&&t?JSON.stringify(t):"":e.source}evalIf(e){if(xo(this.evalExpression(e.condition)))return this.evalNodes(e.body);for(let t of e.elseifClauses)if(xo(this.evalExpression(t.condition)))return this.evalNodes(t.body);return e.elseBody?this.evalNodes(e.elseBody):""}evalFor(e){let t=this.evalExpression(e.collection);if(void 0!==e.source&&void 0===t)return e.source;let n,r=null;if(null!==e.keyVar){let i=(e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.entries(e):null)(t);if(!i||0===i.length)return e.elseBody?this.evalNodes(e.elseBody):"";let a=i.length;r=Array(a),n=Array(a);for(let e=0;e<a;e++)r[e]=i[e][0],n[e]=i[e][1]}else{let r=(e=>Array.isArray(e)?e:"object"==typeof e&&e?Object.values(e):null)(t);if(!r||0===r.length)return e.elseBody?this.evalNodes(e.elseBody):"";n=r}return this.runLoop(e,n,r)}runLoop(e,t,n){let{valueVar:r,keyVar:i,body:a}=e,o=t.length,s=this.variables.loop,l={index:0,index0:0,first:!1,last:!1,length:o,revindex:0};this.variables.loop=l;let c="";for(let u=0;u<o;u++){if(l.index=u+1,l.index0=u,l.first=0===u,l.last=u===o-1,l.revindex=o-u,null!==n&&null!==i&&(this.variables[i]=n[u]),this.variables[r]=t[u],c+=this.evalNodes(a),this.breakFlag){this.breakFlag=!1;break}this.continueFlag&&=!1}return void 0===s?delete this.variables.loop:this.variables.loop=s,c}evalSet(e){return this.hasSet=!0,this.variables[e.name]=Array.isArray(e.value)?this.evalNodes(e.value):this.evalExpression(e.value),""}evalApply(e){let t=this.applyFilters(this.evalNodes(e.body),e.filters);return yo(t)?String(bo(t)):"object"==typeof t&&t?JSON.stringify(t):null==t?"":String(t)}applyFilters(e,t){let n=e;for(let r of t){let e=vo[r.name];void 0!==e&&(n=e(n,0===r.args.length?ko:this.evalArgs(r.args)))}return n}evalArgs(e){let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=this.evalExpression(e[r]);return n}evalExpression(e){switch(e.type){case"literal":return e.value;case"array":{let t=e.elements,n=Array(t.length);for(let e=0;e<t.length;e++)n[e]=this.evalExpression(t[e]);return n}case"object":{let t={};for(let n of e.entries){let e=this.evalExpression(n.key);t["string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):""]=this.evalExpression(n.value)}return t}case"range":return this.evalRange(e.start,e.end);case"path":return this.resolvePath(e.segments);case"function":return this.evalFunction(e.name,e.args);case"filter":return this.applyFilters(this.evalExpression(e.subject),e.filters);case"concat":{let t=e.parts,n=t.length,r="";for(let e=0;e<n;e++){let n=this.evalExpression(t[e]);r+=null==n?"":String(n)}return r}case"unary":return"-"===e.operator?-Number(this.evalExpression(e.operand)):!xo(this.evalExpression(e.operand));case"binary":return this.evalBinary(e.operator,e.left,e.right);case"default":return this.evalExpression(e.value)??this.evalExpression(e.defaultExpr);case"ternary":return xo(this.evalExpression(e.condition))?this.evalExpression(e.trueExpr):this.evalExpression(e.falseExpr);case"arrow":return this.createArrowFunction(e.params,e.body)}}createArrowFunction(t,n){let r={...this.variables},i=this.keepEmptyTokens,a=(...a)=>{let o=new e(r,i);for(let e=0;e<t.length;e++)o.variables[t[e]]=a[e];return o.evalExpression(n)};return a[ho]=t.length,a}resolvePath(e){let t=e.length;if(0===t)return;let n=this.variables[e[0]];for(let r=1;r<t;r++){if(null==n)return;n=n[e[r]]}return n}evalRange(e,t){let n=Number(this.evalExpression(e)),r=Number(this.evalExpression(t)),i=n<=r,a=1+(i?r-n:n-r),o=Array(a);for(let s=0;s<a;s++)o[s]=i?n+s:n-s;return o}evalFunction(e,t){let n=this.evalArgs(t);switch(e){case"cycle":{let e=n[0],t=n[1];return Array.isArray(e)&&"number"==typeof t?e[t%e.length]:""}case"max":return this.minMax(n,Math.max);case"min":return this.minMax(n,Math.min);case"range":return this.rangeFunction(n);default:return""}}minMax(e,t){return 0===e.length?void 0:t(...1===e.length&&Array.isArray(e[0])?e[0]:e)}rangeFunction(e){if(0===e.length)return[];if(1===e.length){let t=Number(e[0]),n=Array(t+1);for(let e=0;e<=t;e++)n[e]=e;return n}let t=Number(e[0]),n=Number(e[1]),r=e.length>2?Number(e[2]):t<=n?1:-1;if(0===r)return[];let i=Math.floor((r>0?n-t:t-n)/Math.abs(r))+1;if(i<=0)return[];let a=Array(i);for(let o=0;o<i;o++)a[o]=t+o*r;return a}evalBinary(e,t,n){if("or"===e)return xo(this.evalExpression(t))||xo(this.evalExpression(n));if("and"===e)return xo(this.evalExpression(t))&&xo(this.evalExpression(n));let r=this.evalExpression(t),i=this.evalExpression(n),a="number"==typeof r&&"number"==typeof i;switch(e){case"+":return a?r+i:Number(r)+Number(i);case"-":return a?r-i:Number(r)-Number(i);case"*":return a?r*i:Number(r)*Number(i);case"/":return a?r/i:Number(r)/Number(i);case"%":return a?r%i:Number(r)%Number(i);case"==":return r===i||String(r)===String(i);case"!=":return r!==i&&String(r)!==String(i);case">":return a?r>i:Number(r)>Number(i);case"<":return a?r<i:Number(r)<Number(i);case">=":return a?r>=i:Number(r)>=Number(i);case"<=":return a?r<=i:Number(r)<=Number(i);case"in":return wo(r,i);case"not in":return!wo(r,i);case"is":return r===i;case"is not":return r!==i;default:return!1}}},No=(e,t)=>e[t],Co=(e,t)=>{let n=t.indexOf(".");if(-1===n)return e[t];let r=e[t.slice(0,n)],i=n+1,a=t.length;for(;i<a;){if(null==r)return;let e=t.indexOf(".",i);if(-1===e)return r[t.slice(i)];r=r[t.slice(i,e)],i=e+1}return r},To=e=>null==e?"":"object"==typeof e?JSON.stringify(e):String(e),Eo=e=>{try{return JSON.parse(e)||e}catch{return e}},Oo=41,_o=e=>e>=97&&e<=122||e>=65&&e<=90||95===e,Ao=e=>_o(e)||e>=48&&e<=57,Io=e=>Ao(e)||45===e,zo=e=>e>=48&&e<=57,Do=e=>32===e||9===e||10===e||13===e,Mo=e=>{let t=e.length;if(0===t||!_o(e.charCodeAt(0)))return!1;for(let n=1;n<t;n++)if(!Ao(e.charCodeAt(n)))return!1;return!0},Po=e=>{let t=e.length;if(0===t)return!1;let n=!0;for(let r=0;r<t;r++){let t=e.charCodeAt(r);if(46===t){if(n)return!1;n=!0}else{if(n&&!_o(t)||!n&&!Ao(t))return!1;n=!1}}return!n},jo=e=>Mo(e),Ro=(e,t)=>t?`{{{${e}}}}`:`{{${e}}}`,Lo=e=>{switch(e.type){case"text":return e.value;case"variable":return Ro(e.content,e.raw);case"tag":return`{%${e.content}%}`}},Fo=class{src;pos=0;constructor(e){this.src=e}eof(){return this.pos>=this.src.length}peek(){return this.pos<this.src.length?this.src.charCodeAt(this.pos):-1}at(e){let t=this.pos+e;return t<this.src.length?this.src.charCodeAt(t):-1}skipWs(){for(;this.pos<this.src.length&&Do(this.src.charCodeAt(this.pos));)this.pos++}scanName(){let e=this.pos;if(!this.eof()&&_o(this.src.charCodeAt(this.pos)))for(this.pos++;!this.eof()&&Io(this.src.charCodeAt(this.pos));)this.pos++;return this.src.slice(e,this.pos)}scanStringLiteral(){let e=this.src.charCodeAt(this.pos);this.pos++;let t="";for(;this.pos<this.src.length&&this.src.charCodeAt(this.pos)!==e;)if(92===this.src.charCodeAt(this.pos)&&this.pos+1<this.src.length){this.pos++;let n=this.src.charCodeAt(this.pos);t+=110===n?"\n":116===n?"\t":114===n?"\r":92===n?"\\":n===e?String.fromCharCode(n):String.fromCharCode(92)+String.fromCharCode(n),this.pos++}else t+=this.src[this.pos],this.pos++;return this.pos<this.src.length&&this.pos++,t}scanNumber(){let e=this.pos;for(45===this.src.charCodeAt(this.pos)&&this.pos++;this.pos<this.src.length&&zo(this.src.charCodeAt(this.pos));)this.pos++;if(46===this.src.charCodeAt(this.pos))for(this.pos++;this.pos<this.src.length&&zo(this.src.charCodeAt(this.pos));)this.pos++;return Number(this.src.slice(e,this.pos))}matchKeyword(e){let t=this.pos+e.length;if(t>this.src.length)return!1;for(let n=0;n<e.length;n++)if(this.src.charCodeAt(this.pos+n)!==e.charCodeAt(n))return!1;return!(t<this.src.length&&Ao(this.src.charCodeAt(t))||(this.pos=t,this.skipWs(),0))}matchBinaryOp(){this.skipWs();let e=this.peek();if(61===this.at(1)){if(61===e)return this.pos+=2,"==";if(33===e)return this.pos+=2,"!=";if(62===e)return this.pos+=2,">=";if(60===e)return this.pos+=2,"<="}return 62===e?(this.pos++,">"):60===e?(this.pos++,"<"):null}},$o=e=>new qo(e).parseTernary(),qo=class extends Fo{parseTernary(){let e=this.parseOr();if(this.skipWs(),63===this.peek()){this.pos++,this.skipWs();let t=this.parseOr();if(this.skipWs(),58===this.peek())return this.pos++,this.skipWs(),{type:"ternary",condition:e,trueExpr:t,falseExpr:this.parseTernary()}}return e}parseOr(){let e=this.parseAnd();for(this.skipWs();this.matchKeyword("or");)e={type:"binary",operator:"or",left:e,right:this.parseAnd()},this.skipWs();return e}parseAnd(){let e=this.parseNot();for(this.skipWs();this.matchKeyword("and");)e={type:"binary",operator:"and",left:e,right:this.parseNot()},this.skipWs();return e}parseNot(){return this.skipWs(),this.matchKeyword("not")?{type:"unary",operator:"not",operand:this.parseComparison()}:this.parseComparison()}parseComparison(){let e=this.parseConcat();for(this.skipWs();!this.eof();){if(this.matchKeyword("is")){this.skipWs(),e={type:"binary",operator:this.matchKeyword("not")?"is not":"is",left:e,right:this.parseConcat()},this.skipWs();continue}if(this.matchKeyword("not")){if(this.skipWs(),this.matchKeyword("in")){e={type:"binary",operator:"not in",left:e,right:this.parseConcat()},this.skipWs();continue}let t=this.src.slice(this.pos-4);return this.pos=this.src.length,{type:"unary",operator:"not",operand:$o(t)}}if(this.matchKeyword("in")){e={type:"binary",operator:"in",left:e,right:this.parseConcat()},this.skipWs();continue}let t=this.matchBinaryOp();if(!t)break;e={type:"binary",operator:t,left:e,right:this.parseConcat()},this.skipWs()}return e}parseConcat(){let e=this.parseAdditive();for(this.skipWs();126===this.peek();){this.pos++;let t=this.parseAdditive();e="concat"===e.type?{type:"concat",parts:[...e.parts,t]}:{type:"concat",parts:[e,t]},this.skipWs()}return e}parseAdditive(){let e=this.parseMultiplicative();this.skipWs();for(let t=this.peek();43===t||45===t;t=this.peek())this.pos++,e={type:"binary",operator:43===t?"+":"-",left:e,right:this.parseMultiplicative()},this.skipWs();return e}parseMultiplicative(){let e=this.parseDefault();this.skipWs();for(let t=this.peek();42===t||47===t||37===t;t=this.peek())this.pos++,e={type:"binary",operator:42===t?"*":47===t?"/":"%",left:e,right:this.parseDefault()},this.skipWs();return e}parseDefault(){if(this.skipWs(),45===this.peek()&&zo(this.at(1)))return this.maybeTrailingFilters({type:"literal",value:this.scanNumber()});if(45===this.peek())return this.pos++,{type:"unary",operator:"-",operand:this.parseDefault()};let e=this.parseAtom();for(this.skipWs();63===this.peek()&&63===this.at(1);)this.pos+=2,this.skipWs(),e={type:"default",value:e,defaultExpr:this.parseAtom()},this.skipWs();return e}parseAtom(){this.skipWs();let e=this.peek();if(40===e){this.pos++,this.skipWs();let e=this.pos,t=this.tryParseArrowParams();if(null!==t)return this.maybeTrailingFilters({type:"arrow",params:t,body:this.parseTernary()});this.pos=e;let n=this.parseTernary();return this.skipWs(),this.peek()===Oo&&this.pos++,this.maybeTrailingFilters(n)}return 39===e||34===e?this.maybeTrailingFilters({type:"literal",value:this.scanStringLiteral()}):zo(e)?this.maybeTrailingFilters({type:"literal",value:this.scanNumber()}):91===e?(this.pos++,this.maybeTrailingFilters({type:"array",elements:this.parseArgList(93)})):123===e?(this.pos++,this.maybeTrailingFilters(this.parseObjectLiteral())):this.parsePathOrFunctionOrArrow()}tryParseArrowParams(){let e=this.pos,t=[];for(this.skipWs();this.peek()!==Oo;){let n=this.scanName();if(!n)return this.pos=e,null;if(t.push(n),this.skipWs(),44!==this.peek())break;this.pos++,this.skipWs()}return this.skipWs(),this.peek()===Oo&&(this.pos++,this.skipWs(),61===this.peek()&&62===this.at(1))?(this.pos+=2,t):(this.pos=e,null)}parsePathOrFunctionOrArrow(){let e=this.scanName();if(!e)return this.pos++,{type:"literal",value:""};if("true"===e||"false"===e)return this.maybeTrailingFilters({type:"literal",value:"true"===e});if(this.skipWs(),61===this.peek()&&62===this.at(1))return this.pos+=2,this.maybeTrailingFilters({type:"arrow",params:[e],body:this.parseTernary()});if(40===this.peek()){this.pos++;let t=this.parseArgList(Oo);return this.maybeTrailingFilters({type:"function",name:e,args:t})}let t=[e];for(;46===this.peek();){this.pos++;let e=this.scanName();e&&t.push(e)}return this.maybeTrailingFilters({type:"path",segments:t})}maybeTrailingFilters(e){return this.skipWs(),124===this.peek()?{type:"filter",subject:e,filters:this.parseTrailingFilters()}:e}parseObjectLiteral(){let e=[];for(this.skipWs();!this.eof()&&125!==this.peek();){let t=this.parseObjectKey();this.skipWs(),58===this.peek()&&this.pos++,this.skipWs(),e.push({key:t,value:this.parseTernary()}),this.skipWs(),44===this.peek()&&(this.pos++,this.skipWs())}return 125===this.peek()&&this.pos++,{type:"object",entries:e}}parseObjectKey(){let e=this.peek();if(39===e||34===e)return{type:"literal",value:this.scanStringLiteral()};if(zo(e))return{type:"literal",value:this.scanNumber()};if(40===e){this.pos++,this.skipWs();let e=this.parseTernary();return this.skipWs(),this.peek()===Oo&&this.pos++,e}return{type:"literal",value:this.scanName()}}parseArgList(e){let t=[];for(this.skipWs();!this.eof()&&this.peek()!==e;)t.push(this.parseTernary()),this.skipWs(),44===this.peek()&&(this.pos++,this.skipWs());return this.peek()===e&&this.pos++,t}parseTrailingFilters(){let e=[];for(;124===this.peek();)this.pos++,this.skipWs(),e.push(this.readFilter()),this.skipWs();return e}parseApplyChain(){this.skipWs();let e=[this.readFilter()];for(this.skipWs();124===this.peek();)this.pos++,this.skipWs(),e.push(this.readFilter()),this.skipWs();return e}readFilter(){let e=this.scanName();return this.skipWs(),40===this.peek()?(this.pos++,{name:e,args:this.parseArgList(Oo)}):{name:e,args:[]}}},Vo=e=>{let t=0;for(;t<e.length&&!Do(e.charCodeAt(t));)t++;return e.slice(0,t)},Bo=(e,t=!1)=>{let n=new Ho(e,t),r=n.parseBody();if(!n.error){let e=n.peek();if(e&&"tag"===e.type){let t=Vo(e.content.trim());Uo.has(t)&&(n.error=`Orphan closing tag: {% ${t} %} without matching opening tag`)}}return{nodes:r,error:n.error}},Uo=/* @__PURE__ */new Set(["endif","endfor","endset","endapply","else","elseif"]),Ho=class{tokens;keepEmptyTokens;pos=0;error=null;constructor(e,t=!1){this.tokens=e,this.keepEmptyTokens=t}peek(){return this.tokens[this.pos]}advance(){let e=this.tokens[this.pos];return e&&this.pos++,e}isTag(e){let t=this.peek();if(!t||"tag"!==t.type)return!1;let n=t.content.trim();return n===e||n.startsWith(e+" ")||n.startsWith(e+"\t")}parseBody(){let e=[];for(;this.pos<this.tokens.length;){let t=this.peek();if(!t||"tag"===t.type&&Uo.has(Vo(t.content.trim())))break;let n=this.parseNode();n&&e.push(n)}return e}parseNode(){let e=this.peek();return e?"text"===e.type?(this.advance(),{type:"text",value:e.value}):"variable"===e.type?this.parseVariable():this.parseTag():null}parseVariable(){let e=this.advance();if(!e||"variable"!==e.type)return{type:"variable",raw:!1,expression:{type:"literal",value:""},source:""};let t=e.content.trim(),n=this.keepEmptyTokens?Ro(e.content,e.raw):"";if(Mo(t))return{type:"variable",raw:e.raw,expression:{type:"path",segments:[t]},source:n};let r=$o(t);return{type:"variable",raw:e.raw,expression:r,source:n}}parseTag(){let e=this.peek();if(!e||"tag"!==e.type)return null;switch(Vo(e.content.trim())){case"if":return this.parseIf();case"for":return this.parseFor();case"set":return this.parseSet();case"apply":return this.parseApply();case"break":return this.advance(),{type:"break"};case"continue":return this.advance(),{type:"continue"};default:return this.advance(),null}}parseIf(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return this.error="Malformed {% if %} tag",{type:"if",condition:{type:"literal",value:!1},body:[],elseifClauses:[],elseBody:null};let t=e.content.trim(),n=-1===t.indexOf(" ")?"":t.slice(t.indexOf(" ")+1).trim();if(!n)return this.error="Malformed {% if %} tag: missing condition",{type:"if",condition:{type:"literal",value:!1},body:[],elseifClauses:[],elseBody:null};let r=$o(n),i=this.parseBody(),a=[],o=null,s=!1;for(;this.peek();){let e=this.peek();if(!e||"tag"!==e.type)break;let t=Vo(e.content.trim());if("elseif"===t){this.advance();let t=e.content.trim(),n=$o(t.slice(t.indexOf(" ")+1).trim()),r=this.parseBody();a.push({condition:n,body:r})}else{if("else"!==t){if("endif"===t){this.advance(),s=!0;break}break}this.advance(),o=this.parseBody()}}return s||(this.error="Malformed {% if %} block: missing {% endif %}"),{type:"if",condition:r,body:i,elseifClauses:a,elseBody:o}}parseFor(){let e=this.pos;this.advance();let t=this.tokens[this.pos-1];if("tag"!==t.type)return{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let n=t.content.trim(),r=n.slice(n.indexOf(" ")+1).trim(),i=/\sin\s/.exec(r);if(!i)return this.error="Invalid {% for %} syntax: missing the `in` keyword",{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let a=r.slice(0,i.index).trim(),o=r.slice(i.index+i[0].length).trim(),s=(e=>{let t=0;for(let n=0;n+1<e.length;n++){let r=e.charCodeAt(n);if(0!==t)r===t&&(t=0);else if(39===r||34===r)t=r;else if(46===r&&46===e.charCodeAt(n+1))return[e.slice(0,n).trim(),e.slice(n+2).trim()]}return null})(o),l=s?{type:"range",start:$o(s[0]),end:$o(s[1])}:$o(o),c=a.indexOf(","),u=-1===c?null:a.slice(0,c).trim(),d=-1===c?a:a.slice(c+1).trim();if(!jo(d))return this.error=`Invalid {% for %} variable name: "${d}"`,{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};if(null!==u&&!jo(u))return this.error=`Invalid {% for %} key variable name: "${u}"`,{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let p=this.parseBody(),f=null;if(this.peek()){let e=this.peek();e&&"tag"===e.type&&"else"===Vo(e.content.trim())&&(this.advance(),f=this.parseBody())}let h=this.peek();return h&&"tag"===h.type&&"endfor"===Vo(h.content.trim())?this.advance():this.error="Malformed {% for %} block: missing {% endfor %}",{type:"for",valueVar:d,keyVar:u,collection:l,body:p,elseBody:f,source:this.keepEmptyTokens?this.reconstructRange(e,this.pos):void 0}}reconstructRange(e,t){let n="";for(let r=e;r<t;r++)n+=Lo(this.tokens[r]);return n}parseSet(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return{type:"set",name:"_unknown",value:{type:"literal",value:""}};let t=e.content.trim(),n=t.slice(t.indexOf(" ")+1).trim(),r=n.indexOf("=");if(-1===r){let e=n.trim(),t=this.parseBody(),r=this.peek();return r&&"tag"===r.type&&this.advance(),{type:"set",name:e,value:t}}return{type:"set",name:n.slice(0,r).trim(),value:$o(n.slice(r+1).trim())}}parseApply(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return{type:"apply",filters:[],body:[]};let t=e.content.trim(),n=(e=>new qo(e).parseApplyChain())(t.slice(t.indexOf(" ")+1).trim()),r=this.parseBody(),i=this.peek();return i&&"tag"===i.type&&this.advance(),{type:"apply",filters:n,body:r}}},Wo=/* @__PURE__ */new Map,Yo={hits:0,misses:0},Go=e=>{let t=Wo.get(e);if(t)return Yo.hits++,t;Yo.misses++;let n=(e=>{let t=(e=>{let t=[],n=0;for(;n<e.length;){let r,i,a=e.indexOf("{{",n),o=e.indexOf("{%",n);if(-1===a&&-1===o)break;if(-1===a?(r=o,i=!0):-1===o||a<o?(r=a,i=!1):(r=o,i=!0),r>n&&t.push({type:"text",value:e.slice(n,r)}),i||123!==e.charCodeAt(r+2))if(i){let i=e.indexOf("%}",r+2);if(-1===i)return{tokens:t,error:"Unclosed tag"};t.push({type:"tag",content:e.slice(r+2,i)}),n=i+2}else{let i=e.indexOf("}}",r+2);if(-1===i)return{tokens:t,error:"Unclosed double-brace token"};t.push({type:"variable",content:e.slice(r+2,i),raw:!1}),n=i+2}else{let i=e.indexOf("}}}",r+3);if(-1===i)return{tokens:t,error:"Unclosed triple-brace token"};t.push({type:"variable",content:e.slice(r+3,i),raw:!0}),n=i+3}}return n<e.length&&t.push({type:"text",value:e.slice(n)}),{tokens:t,error:null}})(e);if(t.error)return null;let n=t.tokens,{hasTags:r,allSimpleOrDotted:i}=(e=>{let t=!1,n=!0;for(let r=0;r<e.length;r++){let i=e[r];if("tag"===i.type){t=!0;break}if("variable"===i.type&&!Po(i.content.trim())){n=!1;break}}return{hasTags:t,allSimpleOrDotted:n}})(n),a=null,o=null;if(r||!i){let e=Bo(n,!1);if(e.error)return null;a=e.nodes;let t=Bo(n,!0);t.error||(o=t.nodes)}else{let e=Bo(n,!0);e.error||(o=e.nodes)}return{tokens:n,hasTags:r,allSimpleOrDotted:i,nodes:a,nodesWithSource:o}})(e);return n?((()=>{if(Wo.size>=256){let e=Wo.keys().next().value;void 0!==e&&Wo.delete(e)}})(),Wo.set(e,n),n):null},Qo=(e,t={},n=!1,r=!1)=>{if("string"!=typeof e)return e;try{if(-1===e.indexOf("{%")&&-1===e.indexOf("{{"))return e;let i="variables"in t?(e=>{let t={},n=e.variables;for(let r in n)t[r]=n[r];for(let r in e)t[r]=e[r];return t})(t):t,a=Go(e);if(!a)return e;if(!n&&!a.hasTags&&a.allSimpleOrDotted){let e=((e,t)=>{let n="";for(let r of e.tokens)if("text"===r.type)n+=r.value;else if("variable"===r.type){let e=r.content.trim(),i=-1===r.content.indexOf(".")?No(t,e):Co(t,e);n+=r.raw?null==i?"":String(i):To(i)}return n})(a,i);return r?Eo(e):e}let o=((e,t)=>t?e.nodesWithSource:e.nodes)(a,n);if(!o)return e;let{output:s,variables:l,hasSet:c}=((e,t,n=!1)=>{let r=new So(t,n);return{output:r.evalNodes(e),variables:r.variables,hasSet:r.hasSet}})(o,i,n);return c&&Object.assign(t,l),n&&s===e?e:r?Eo(s):s}catch{return e}},Jo="[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*",Ko=`${Jo}(?:\\??\\.${Jo})*(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`,Xo=`(?:\\{\\{\\{\\s*${Ko}\\s*\\}\\}\\}|\\{\\{\\s*${Ko}\\s*\\}\\})`,Zo=new RegExp(Xo,"g"),es=RegExp(`^${Xo}$`),ts=(e,t=!1)=>{if("string"!=typeof e)return!1;let n=t?es:Zo;return n.lastIndex=0,n.test(e.trim())};function ns(e){return rs(e,[])}function rs(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:rs(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let a=0;a<n;++a)i.push(rs(e[a],t));return 1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);return 0===n.length?"{}":t.length>2?"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]":"{ "+n.map(([e,n])=>e+": "+rs(n,t)).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function is(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}var as=/\r\n|[\n\r]/g;function os(e,t){let n=0,r=1;for(const i of e.body.matchAll(as)){if("number"!=typeof i.index&&is(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function ss(e){return ls(e.source,os(e.source,e.start))}function ls(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=1===t.line?n:0,l=t.column+s,c=`${e.name}:${o}:${l}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){const e=Math.floor(l/80),t=l%80,n=[];for(let r=0;r<d.length;r+=80)n.push(d.slice(r,r+80));return c+cs([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return c+cs([[o-1+" |",u[i-1]],[`${o} |`,d],["|","^".padStart(l)],[`${o+1} |`,u[i+1]]])}function cs(e){const t=e.filter(([e,t])=>void 0!==t),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?" "+t:"")).join("\n")}var us=class e extends Error{constructor(t,n={}){const{nodes:r,source:i,positions:a,path:o,originalError:s,cause:l,extensions:c}=n,u="cause"in n;super(t,u||null!=s?{cause:u?l:s}:void 0),this.name="GraphQLError",this.path=o??void 0;const d=s??(l instanceof Error?l:void 0);this.originalError=d,this.nodes=ds(Array.isArray(r)?r:r?[r]:void 0);const p=ds(this.nodes?.map(e=>e.loc).filter(e=>null!=e));this.source=i??p?.[0]?.source,this.positions=a??p?.map(e=>e.start),this.locations=a&&i?a.map(e=>os(i,e)):p?.map(e=>os(e.source,e.start));const f=(h=d?.extensions,"object"==typeof h&&null!==h?d.extensions:void 0);var h;this.extensions=c??f??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s?.stack?Object.defineProperty(this,"stack",{value:s.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+ss(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+ls(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function ds(e){return void 0===e||0===e.length?void 0:e}var ps=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},fs=class{constructor(e,t,n,r,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},hs={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},ms=new Set(Object.keys(hs));function gs(e){const t=e?.kind;return"string"==typeof t&&ms.has(t)}var ys="query",bs="mutation",vs="subscription",xs=/* @__PURE__ */V({ARGUMENT:()=>Es,ARGUMENT_COORDINATE:()=>hl,BOOLEAN:()=>js,DIRECTIVE:()=>Vs,DIRECTIVE_ARGUMENT_COORDINATE:()=>gl,DIRECTIVE_COORDINATE:()=>ml,DIRECTIVE_DEFINITION:()=>rl,DIRECTIVE_EXTENSION:()=>al,DOCUMENT:()=>ks,ENUM:()=>Ls,ENUM_TYPE_DEFINITION:()=>el,ENUM_TYPE_EXTENSION:()=>ul,ENUM_VALUE_DEFINITION:()=>tl,FIELD:()=>Ts,FIELD_DEFINITION:()=>Js,FLOAT:()=>Ms,FRAGMENT_ARGUMENT:()=>Os,FRAGMENT_DEFINITION:()=>Is,FRAGMENT_SPREAD:()=>_s,INLINE_FRAGMENT:()=>As,INPUT_OBJECT_TYPE_DEFINITION:()=>nl,INPUT_OBJECT_TYPE_EXTENSION:()=>dl,INPUT_VALUE_DEFINITION:()=>Ks,INT:()=>Ds,INTERFACE_TYPE_DEFINITION:()=>Xs,INTERFACE_TYPE_EXTENSION:()=>ll,LIST:()=>Fs,LIST_TYPE:()=>Us,MEMBER_COORDINATE:()=>fl,NAME:()=>ws,NAMED_TYPE:()=>Bs,NON_NULL_TYPE:()=>Hs,NULL:()=>Rs,OBJECT:()=>$s,OBJECT_FIELD:()=>qs,OBJECT_TYPE_DEFINITION:()=>Qs,OBJECT_TYPE_EXTENSION:()=>sl,OPERATION_DEFINITION:()=>Ss,OPERATION_TYPE_DEFINITION:()=>Ys,SCALAR_TYPE_DEFINITION:()=>Gs,SCALAR_TYPE_EXTENSION:()=>ol,SCHEMA_DEFINITION:()=>Ws,SCHEMA_EXTENSION:()=>il,SELECTION_SET:()=>Cs,STRING:()=>Ps,TYPE_COORDINATE:()=>pl,UNION_TYPE_DEFINITION:()=>Zs,UNION_TYPE_EXTENSION:()=>cl,VARIABLE:()=>zs,VARIABLE_DEFINITION:()=>Ns}),ws="Name",ks="Document",Ss="OperationDefinition",Ns="VariableDefinition",Cs="SelectionSet",Ts="Field",Es="Argument",Os="FragmentArgument",_s="FragmentSpread",As="InlineFragment",Is="FragmentDefinition",zs="Variable",Ds="IntValue",Ms="FloatValue",Ps="StringValue",js="BooleanValue",Rs="NullValue",Ls="EnumValue",Fs="ListValue",$s="ObjectValue",qs="ObjectField",Vs="Directive",Bs="NamedType",Us="ListType",Hs="NonNullType",Ws="SchemaDefinition",Ys="OperationTypeDefinition",Gs="ScalarTypeDefinition",Qs="ObjectTypeDefinition",Js="FieldDefinition",Ks="InputValueDefinition",Xs="InterfaceTypeDefinition",Zs="UnionTypeDefinition",el="EnumTypeDefinition",tl="EnumValueDefinition",nl="InputObjectTypeDefinition",rl="DirectiveDefinition",il="SchemaExtension",al="DirectiveExtension",ol="ScalarTypeExtension",sl="ObjectTypeExtension",ll="InterfaceTypeExtension",cl="UnionTypeExtension",ul="EnumTypeExtension",dl="InputObjectTypeExtension",pl="TypeCoordinate",fl="MemberCoordinate",hl="ArgumentCoordinate",ml="DirectiveCoordinate",gl="DirectiveArgumentCoordinate";function yl(e,t){if(!e)throw new Error(t)}function bl(e){return 9===e||32===e}function vl(e){return e>=48&&e<=57}function xl(e){return e>=97&&e<=122||e>=65&&e<=90}function wl(e){return xl(e)||95===e}function kl(e){return xl(e)||vl(e)||95===e}function Sl(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i<e.length;++i){const a=e[i],o=Nl(a);o!==a.length&&(n??=i,r=i,0!==i&&o<t&&(t=o))}return e.map((e,n)=>0===n?e:e.slice(t)).slice(n??0,r+1)}function Nl(e){let t=0;for(;t<e.length&&bl(e.charCodeAt(t));)++t;return t}var Cl=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Tl(e){return El[e.charCodeAt(0)]}var El=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Ol=Object.freeze({});function _l(e,t,n=hs){const r=/* @__PURE__ */new Map;for(const h of Object.values(xs))r.set(h,Al(t,h));let i,a,o,s=Array.isArray(e),l=[e],c=-1,u=[],d=e;const p=[],f=[];do{c++;const e=c===l.length,h=e&&0!==u.length;if(e){if(a=0===f.length?void 0:p[p.length-1],d=o,o=f.pop(),h)if(s){d=d.slice();let e=0;for(const[t,n]of u){const r=t-e;null===n?(d.splice(r,1),e++):d[r]=n}}else{d={...d};for(const[e,t]of u)d[e]=t}c=i.index,l=i.keys,u=i.edits,s=i.inArray,i=i.prev}else if(null!=o){if(a=s?c:l[c],d=o[a],null==d)continue;p.push(a)}let m;if(!Array.isArray(d)){if(gs(d)||yl(!1,`Invalid AST Node: ${ns(d)}.`),m=(e?r.get(d.kind)?.leave:r.get(d.kind)?.enter)?.call(t,d,a,o,p,f),m===Ol)break;if(!1===m){if(!e){p.pop();continue}}else if(void 0!==m&&(u.push([a,m]),!e)){if(!gs(m)){p.pop();continue}d=m}}void 0===m&&h&&u.push([a,d]),e?p.pop():(i={inArray:s,index:c,keys:l,edits:u,prev:i},s=Array.isArray(d),l=s?d:n[d.kind]??[],c=-1,u=[],null!=o&&f.push(o),o=d)}while(void 0!==i);return 0!==u.length?u.at(-1)[1]:e}function Al(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}var Il={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>zl(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=jl(e.variableDefinitions)?Ml("(\n",zl(e.variableDefinitions,"\n"),"\n)"):Ml("(",zl(e.variableDefinitions,", "),")"),n=Ml("",e.description,"\n")+zl([e.operation,zl([e.name,t]),zl(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>Ml("",i,"\n")+e+": "+t+Ml(" = ",n)+Ml(" ",zl(r," "))},SelectionSet:{leave:({selections:e})=>Dl(e)},Field:{leave:({alias:e,name:t,arguments:n,directives:r,selectionSet:i})=>zl([Rl(zl([Ml("",e,": "),t],""),n),Ml(" ",zl(r," ")),Ml(" ",i)])},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>Rl("..."+e,t)+Ml(" ",zl(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>zl(["...",Ml("on ",e),zl(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>Ml("",a,"\n")+`fragment ${e}${Ml("(",zl(n,", "),")")} on ${t} ${Ml("",zl(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e){const t=e.replaceAll('"""','\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every(e=>0===e.length||bl(e.charCodeAt(0))),a=t.endsWith('\\"""'),o=e.endsWith('"')&&!a,s=e.endsWith("\\"),l=o||s,c=!r||e.length>70||l||i||a;let u="";const d=r&&bl(e.charCodeAt(0));return(c&&!d||i)&&(u+="\n"),u+=t,(c||l)&&(u+="\n"),'"""'+u+'"""'}(e):`"${e.replace(Cl,Tl)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+zl(e,", ")+"]";return t.length>80?"[\n"+Pl(zl(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+zl(e,", ")+" }";return t.length>80?Dl(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Ml("(",zl(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Ml("",e,"\n")+zl(["schema",zl(t," "),Dl(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Ml("",e,"\n")+zl(["scalar",t,zl(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Ml("",e,"\n")+zl(["type",t,Ml("implements ",zl(n," & ")),zl(r," "),Dl(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Ml("",e,"\n")+t+(jl(n)?Ml("(\n",Pl(zl(n,"\n")),"\n)"):Ml("(",zl(n,", "),")"))+": "+r+Ml(" ",zl(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Ml("",e,"\n")+zl([t+": "+n,Ml("= ",r),zl(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Ml("",e,"\n")+zl(["interface",t,Ml("implements ",zl(n," & ")),zl(r," "),Dl(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Ml("",e,"\n")+zl(["union",t,zl(n," "),Ml("= ",zl(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Ml("",e,"\n")+zl(["enum",t,zl(n," "),Dl(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Ml("",e,"\n")+zl([t,zl(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Ml("",e,"\n")+zl(["input",t,zl(n," "),Dl(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:a})=>Ml("",e,"\n")+"directive @"+t+(jl(n)?Ml("(\n",Pl(zl(n,"\n")),"\n)"):Ml("(",zl(n,", "),")"))+Ml(" ",zl(r," "))+(i?" repeatable":"")+" on "+zl(a," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>zl(["extend schema",zl(e," "),Dl(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>zl(["extend scalar",e,zl(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>zl(["extend type",e,Ml("implements ",zl(t," & ")),zl(n," "),Dl(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>zl(["extend interface",e,Ml("implements ",zl(t," & ")),zl(n," "),Dl(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>zl(["extend union",e,zl(t," "),Ml("= ",zl(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>zl(["extend enum",e,zl(t," "),Dl(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>zl(["extend input",e,zl(t," "),Dl(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>zl(["extend directive @"+e,zl(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>zl([e,Ml(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>zl([e,Ml(".",t),Ml("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>zl(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>zl(["@",e,Ml("(",t,":)")])}};function zl(e,t=""){return e?.filter(e=>void 0!==e&&""!==e).join(t)??""}function Dl(e){return Ml("{\n",Pl(zl(e,"\n")),"\n}")}function Ml(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Pl(e){return Ml(" ",e.replaceAll("\n","\n "))}function jl(e){return e?.some(e=>e.includes("\n"))??!1}function Rl(e,t){let n=e+Ml("(",zl(t,", "),")");return n.length>80&&(n=e+Ml("(\n",Pl(zl(t,"\n")),"\n)")),n}var Ll={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};function Fl(e,t,n){return new us(`Syntax Error: ${n}`,{source:e,positions:[t]})}var $l=function(){let e;try{const t=globalThis.process;"function"==typeof t?.getBuiltinModule&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}(),ql=$l?.tracingChannel("graphql:parse"),Vl=($l?.tracingChannel("graphql:validate"),$l?.tracingChannel("graphql:execute"),$l?.tracingChannel("graphql:execute:variableCoercion"),$l?.tracingChannel("graphql:execute:rootSelectionSet"),$l?.tracingChannel("graphql:subscribe"),$l?.tracingChannel("graphql:resolve"),["start","end","asyncStart","asyncEnd","error"]),Bl="<SOF>",Ul="<EOF>",Hl="$",Wl="(",Yl=")",Gl="...",Ql=":",Jl="=",Kl="@",Xl="[",Zl="]",ec="{",tc="|",nc="}",rc="Name",ic="Float",ac="String",oc="BlockString",sc="Comment",lc=class{constructor(e){const t=new fs(Bl,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Ul)do{if(e.next)e=e.next;else{const t=mc(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===sc);return e}};function cc(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function uc(e,t){return dc(e.charCodeAt(t))&&pc(e.charCodeAt(t+1))}function dc(e){return e>=55296&&e<=56319}function pc(e){return e>=56320&&e<=57343}function fc(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return Ul;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function hc(e,t,n,r,i){const a=e.line;return new fs(t,n,r,a,1+n-e.lineStart,i)}function mc(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return gc(e,i);case 33:return hc(e,"!",i,i+1);case 36:return hc(e,Hl,i,i+1);case 38:return hc(e,"&",i,i+1);case 40:return hc(e,Wl,i,i+1);case 41:return hc(e,Yl,i,i+1);case 46:{const t=n.charCodeAt(i+1);if(46===t&&46===n.charCodeAt(i+2))return hc(e,Gl,i,i+3);if(46===t)throw Fl(e.source,i,'Unexpected "..", did you mean "..."?');if(vl(t)){const n=e.source.body.slice(i+1,bc(e,i+1,t));throw Fl(e.source,i,`Invalid number, expected digit before ".", did you mean "0.${n}"?`)}break}case 58:return hc(e,Ql,i,i+1);case 61:return hc(e,Jl,i,i+1);case 64:return hc(e,Kl,i,i+1);case 91:return hc(e,Xl,i,i+1);case 93:return hc(e,Zl,i,i+1);case 123:return hc(e,ec,i,i+1);case 124:return hc(e,tc,i,i+1);case 125:return hc(e,nc,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?Cc(e,i):vc(e,i)}if(vl(t)||45===t)return yc(e,i,t);if(wl(t))return Tc(e,i);throw Fl(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":cc(t)||uc(n,i)?`Unexpected character: ${fc(e,i)}.`:`Invalid character: ${fc(e,i)}.`)}return hc(e,Ul,r,r)}function gc(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(cc(e))++i;else{if(!uc(n,i))break;i+=2}}return hc(e,sc,t,i,n.slice(t+1,i))}function yc(e,t,n){const r=e.source.body;let i=t,a=n,o=!1;if(45===a&&(a=r.charCodeAt(++i)),48===a){if(a=r.charCodeAt(++i),vl(a))throw Fl(e.source,i,`Invalid number, unexpected digit after 0: ${fc(e,i)}.`)}else i=bc(e,i,a),a=r.charCodeAt(i);if(46===a&&(o=!0,a=r.charCodeAt(++i),i=bc(e,i,a),a=r.charCodeAt(i)),69!==a&&101!==a||(o=!0,a=r.charCodeAt(++i),43!==a&&45!==a||(a=r.charCodeAt(++i)),i=bc(e,i,a),a=r.charCodeAt(i)),46===a||wl(a))throw Fl(e.source,i,`Invalid number, expected digit but got: ${fc(e,i)}.`);return hc(e,o?ic:"Int",t,i,r.slice(t,i))}function bc(e,t,n){if(!vl(n))throw Fl(e.source,t,`Invalid number, expected digit but got: ${fc(e,t)}.`);const r=e.source.body;let i=t+1;for(;vl(r.charCodeAt(i));)++i;return i}function vc(e,t){const n=e.source.body,r=n.length;let i=t+1,a=i,o="";for(;i<r;){const r=n.charCodeAt(i);if(34===r)return o+=n.slice(a,i),hc(e,ac,t,i+1,o);if(92===r){o+=n.slice(a,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?xc(e,i):wc(e,i):Nc(e,i);o+=t.value,i+=t.size,a=i;continue}if(10===r||13===r)break;if(cc(r))++i;else{if(!uc(n,i))throw Fl(e.source,i,`Invalid character within String: ${fc(e,i)}.`);i+=2}}throw Fl(e.source,i,"Unterminated string.")}function xc(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const e=n.charCodeAt(t+i++);if(125===e){if(i<5||!cc(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Sc(e),r<0)break}throw Fl(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function wc(e,t){const n=e.source.body,r=kc(n,t+2);if(cc(r))return{value:String.fromCodePoint(r),size:6};if(dc(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=kc(n,t+8);if(pc(e))return{value:String.fromCodePoint(r,e),size:12}}throw Fl(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function kc(e,t){return Sc(e.charCodeAt(t))<<12|Sc(e.charCodeAt(t+1))<<8|Sc(e.charCodeAt(t+2))<<4|Sc(e.charCodeAt(t+3))}function Sc(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Nc(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw Fl(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Cc(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,a=t+3,o=a,s="";const l=[];for(;a<r;){const r=n.charCodeAt(a);if(34===r&&34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2)){s+=n.slice(o,a),l.push(s);const r=hc(e,oc,t,a+3,Sl(l).join("\n"));return e.line+=l.length-1,e.lineStart=i,r}if(92!==r||34!==n.charCodeAt(a+1)||34!==n.charCodeAt(a+2)||34!==n.charCodeAt(a+3))if(10!==r&&13!==r)if(cc(r))++a;else{if(!uc(n,a))throw Fl(e.source,a,`Invalid character within String: ${fc(e,a)}.`);a+=2}else s+=n.slice(o,a),l.push(s),13===r&&10===n.charCodeAt(a+1)?a+=2:++a,s="",o=a,i=a;else s+=n.slice(o,a),o=a+1,a+=4}throw Fl(e.source,a,"Unterminated string.")}function Tc(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r&&kl(n.charCodeAt(i));)++i;return hc(e,rc,t,i,n.slice(t,i))}var Ec=Symbol("Source"),Oc=class{constructor(e,t="GraphQL request",n={line:1,column:1}){this.__kind=Ec,this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||yl(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||yl(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function _c(e,t){const n=new Ac(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}var Ac=class{constructor(e,t={}){const{lexer:n,...r}=t;if(n)this._lexer=n;else{const t=function(e){return t=e,n=Ec,t?.__kind===n;var t,n}(e)?e:new Oc(e);this._lexer=new lc(t)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(rc);return this.node(e,{kind:ws,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:ks,definitions:this.many(Bl,this.parseDefinition,Ul)})}parseDefinition(){if(this.peek(ec))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===ec)throw Fl(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===rc){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw Fl(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(ec))return this.node(e,{kind:Ss,operation:ys,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});const t=this.parseDescription(),n=this.parseOperationType();let r;return this.peek(rc)&&(r=this.parseName()),this.node(e,{kind:Ss,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(rc);switch(e.value){case"query":return ys;case"mutation":return bs;case"subscription":return vs}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Wl,this.parseVariableDefinition,Yl)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Ns,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(Ql),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Jl)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Hl),this.node(e,{kind:zs,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Cs,selections:this.many(ec,this.parseSelection,nc)})}parseSelection(){return this.peek(Gl)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Ql)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:Ts,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(ec)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Wl,t,Yl)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(Wl,e,Yl)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Ql),this.node(t,{kind:Es,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(Ql),this.node(e,{kind:Os,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(Gl);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(rc)){const t=this.parseFragmentName();return this.peek(Wl)&&this._options.experimentalFragmentArguments?this.node(e,{kind:_s,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:_s,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:As,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),!0===this._options.experimentalFragmentArguments?this.node(e,{kind:Is,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:Is,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Xl:return this.parseList(e);case ec:return this.parseObject(e);case"Int":return this.advanceLexer(),this.node(t,{kind:Ds,value:t.value});case ic:return this.advanceLexer(),this.node(t,{kind:Ms,value:t.value});case ac:case oc:return this.parseStringLiteral();case rc:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:js,value:!0});case"false":return this.node(t,{kind:js,value:!1});case"null":return this.node(t,{kind:Rs});default:return this.node(t,{kind:Ls,value:t.value})}case Hl:if(e){if(this.expectToken(Hl),this._lexer.token.kind===rc){const e=this._lexer.token.value;throw Fl(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:Ps,value:e.value,block:e.kind===oc})}parseList(e){return this.node(this._lexer.token,{kind:Fs,values:this.any(Xl,()=>this.parseValueLiteral(e),Zl)})}parseObject(e){return this.node(this._lexer.token,{kind:$s,fields:this.any(ec,()=>this.parseObjectField(e),nc)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Ql),this.node(t,{kind:qs,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Kl);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Kl),this.node(t,{kind:Vs,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Xl)){const n=this.parseTypeReference();this.expectToken(Zl),t=this.node(e,{kind:Us,type:n})}else t=this.parseNamedType();return this.expectOptionalToken("!")?this.node(e,{kind:Hs,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:Bs,name:this.parseName()})}peekDescription(){return this.peek(ac)||this.peek(oc)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(ec,this.parseOperationTypeDefinition,nc);return this.node(e,{kind:Ws,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Ql);const n=this.parseNamedType();return this.node(e,{kind:Ys,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:Gs,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:Qs,description:t,name:n,interfaces:r,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany("&",this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(ec,this.parseFieldDefinition,nc)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Ql);const i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:Js,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(Wl,this.parseInputValueDef,Yl)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Ql);const r=this.parseTypeReference();let i;this.expectOptionalToken(Jl)&&(i=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(e,{kind:Ks,description:t,name:n,type:r,defaultValue:i,directives:a})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:Xs,description:t,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:Zs,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Jl)?this.delimitedMany(tc,this.parseNamedType):void 0}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:el,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(ec,this.parseEnumValueDefinition,nc)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:tl,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw Fl(this._lexer.source,this._lexer.token.start,`${Ic(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:nl,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(ec,this.parseInputValueDef,nc)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===rc)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(ec,this.parseOperationTypeDefinition,nc);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:il,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:ol,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:sl,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:ll,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:cl,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:ul,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:dl,name:t,directives:n,fields:r})}parseDirectiveExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(Kl);const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:al,name:t,directives:n})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Kl);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.parseConstDirectives(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:rl,description:t,name:n,arguments:r,directives:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(tc,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(Ll,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,t=this.expectOptionalToken(Kl),n=this.parseName();let r,i;return!t&&this.expectOptionalToken(".")&&(r=this.parseName()),(t||r)&&this.expectOptionalToken(Wl)&&(i=this.parseName(),this.expectToken(Ql),this.expectToken(Yl)),t?i?this.node(e,{kind:gl,name:n,argumentName:i}):this.node(e,{kind:ml,name:n}):r?i?this.node(e,{kind:hl,name:n,fieldName:r,argumentName:i}):this.node(e,{kind:fl,name:n,memberName:r}):this.node(e,{kind:pl,name:n})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new ps(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw Fl(this._lexer.source,t.start,`Expected ${zc(e)}, found ${Ic(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==rc||t.value!==e)throw Fl(this._lexer.source,t.start,`Expected "${e}", found ${Ic(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===rc&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return Fl(this._lexer.source,t.start,`Unexpected ${Ic(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==Ul&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw Fl(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}};function Ic(e){const t=e.value;return zc(e.kind)+(null!=t?` "${t}"`:"")}function zc(e){return function(e){return"!"===e||e===Hl||"&"===e||e===Wl||e===Yl||"."===e||e===Gl||e===Ql||e===Jl||e===Kl||e===Xl||e===Zl||e===ec||e===tc||e===nc}(e)?`"${e}"`:e}var Dc=function(e,t){return Dc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Dc(e,t)};function Mc(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Dc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Pc=function(){return Pc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Pc.apply(this,arguments)};function jc(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(NL){s=[6,NL],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function Rc(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Lc(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function Fc(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function $c(e){return this instanceof $c?(this.v=e,this):new $c(e)}function qc(e){return"function"==typeof e}function Vc(e){var t=e(function(e){Error.call(e),e.stack=/* @__PURE__ */(new Error).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Bc=Vc(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}});function Uc(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Hc=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Rc(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(f){e={error:f}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var l=this.initialTeardown;if(qc(l))try{l()}catch(NL){i=NL instanceof Bc?NL.errors:[NL]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var u=Rc(c),d=u.next();!d.done;d=u.next()){var p=d.value;try{Gc(p)}catch(h){i=null!=i?i:[],h instanceof Bc?i=Fc(Fc([],Lc(i)),Lc(h.errors)):i.push(h)}}}catch(m){n={error:m}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new Bc(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Gc(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Uc(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Uc(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Wc=Hc.EMPTY;function Yc(e){return e instanceof Hc||e&&"closed"in e&&qc(e.remove)&&qc(e.add)&&qc(e.unsubscribe)}function Gc(e){qc(e)?e():e.unsubscribe()}var Qc={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Qc.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,Fc([e,t],Lc(n))):setTimeout.apply(void 0,Fc([e,t],Lc(n)))},clearTimeout:function(e){var t=Qc.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Jc(e){Qc.setTimeout(function(){throw e})}function Kc(){}var Xc=Zc("C",void 0,void 0);function Zc(e,t,n){return{kind:e,value:t,error:n}}function eu(e){e()}var tu=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Yc(t)&&t.add(n)):n.destination=ou,n}return Mc(t,e),t.create=function(e,t,n){return new ru(e,t,n)},t.prototype.next=function(e){this.isStopped?au(function(e){return Zc("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?au(Zc("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?au(Xc,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Hc);Function.prototype.bind;var nu=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){iu(n)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){iu(n)}else iu(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){iu(t)}},e}(),ru=function(e){function t(t,n,r){var i,a=e.call(this)||this;return i=qc(t)||!t?{next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:t,a.destination=new nu(i),a}return Mc(t,e),t}(tu);function iu(e){Jc(e)}function au(e,t){var n=null;n&&Qc.setTimeout(function(){return n(e,t)})}var ou={closed:!0,next:Kc,error:function(e){throw e},complete:Kc},su="function"==typeof Symbol&&Symbol.observable||"@@observable";function lu(e){return e}var cu=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,i=this,a=(r=e)&&r instanceof tu||function(e){return e&&qc(e.next)&&qc(e.error)&&qc(e.complete)}(r)&&Yc(r)?e:new ru(e,t,n);return eu(function(){var e=i,t=e.operator,n=e.source;a.add(t?t.call(a,n):n?i._subscribe(a):i._trySubscribe(a))}),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=uu(t))(function(t,r){var i=new ru({next:function(t){try{e(t)}catch(n){r(n),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[su]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(0===(e=t).length?lu:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=uu(e))(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function uu(e){var t;return null!==(t=null!=e?e:void 0)&&void 0!==t?t:Promise}function du(e){return function(t){if(function(e){return qc(null==e?void 0:e.lift)}(t))return t.lift(function(t){try{return e(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function pu(e,t,n,r,i){return new fu(e,t,n,r,i)}var fu=function(e){function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(r){t.error(r)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return Mc(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(tu),hu=Vc(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),mu=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return Mc(t,e),t.prototype.lift=function(e){var t=new gu(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new hu},t.prototype.next=function(e){var t=this;eu(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=Rc(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(o){n={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;eu(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;eu(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?Wc:(this.currentObservers=null,a.push(e),new Hc(function(){t.currentObservers=null,Uc(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new cu;return e.source=this,e},t.create=function(e,t){return new gu(e,t)},t}(cu),gu=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return Mc(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:Wc},t}(mu),yu=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return Mc(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(mu),bu={now:function(){return(bu.delegate||Date).now()},delegate:void 0},vu=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=bu);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return Mc(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,l=1;l<r.length&&r[l]<=o;l+=2)s=l;s&&r.splice(0,s+1)}},t}(mu),xu=function(e){function t(t,n){return e.call(this)||this}return Mc(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(Hc),wu={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=wu.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,Fc([e,t],Lc(n))):setInterval.apply(void 0,Fc([e,t],Lc(n)))},clearInterval:function(e){var t=wu.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},ku=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return Mc(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),wu.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&wu.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)/* @__PURE__ */return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(NL){r=!0,n=NL||/* @__PURE__ */new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Uc(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(xu),Su=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=bu.now,e}(),Nu=new(function(e){function t(t,n){void 0===n&&(n=Su.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return Mc(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Su))(ku),Cu=new cu(function(e){return e.complete()});function Tu(e){return e&&qc(e.schedule)}function Eu(e){return Tu((t=e)[t.length-1])?e.pop():void 0;var t}var Ou=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function _u(e){return qc(null==e?void 0:e.then)}function Au(e){return qc(e[su])}function Iu(e){return Symbol.asyncIterator&&qc(null==e?void 0:e[Symbol.asyncIterator])}function zu(e){/* @__PURE__ */
|
|
7
|
-
return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Du,Mu="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Pu(e){return qc(null==e?void 0:e[Mu])}function ju(e){return function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){i[e]&&(r[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||s(e,t)})},t&&(r[e]=t(r[e])))}function s(e,t){try{!function(e){e.value instanceof $c?Promise.resolve(e.value.v).then(l,c):u(a[0][2],e)}(i[e](t))}catch(NL){u(a[0][3],NL)}}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}(this,arguments,function(){var t,n,r;return jc(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,$c(t.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,$c(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,$c(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function Ru(e){return qc(null==e?void 0:e.getReader)}function Lu(e){if(e instanceof cu)return e;if(null!=e){if(Au(e))return i=e,new cu(function(e){var t=i[su]();if(qc(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")});if(Ou(e))return r=e,new cu(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()});if(_u(e))return n=e,new cu(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Jc)});if(Iu(e))return Fu(e);if(Pu(e))return t=e,new cu(function(e){var n,r;try{for(var i=Rc(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()});if(Ru(e))return Fu(ju(e))}var t,n,r,i;throw zu(e)}function Fu(e){return new cu(function(t){(function(e,t){var n,r,i,a;return function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{l(r.next(e))}catch(NL){a(NL)}}function s(e){try{l(r.throw(e))}catch(NL){a(NL)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function(){var o,s;return jc(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Rc(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){!function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}(r,i,(t=e[n](t)).done,t.value)})}}}(e),l.label=1;case 1:return[4,n.next()];case 2:if((r=l.sent()).done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),i={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}function $u(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function qu(e,t){return void 0===t&&(t=0),du(function(n,r){n.subscribe(pu(r,function(n){return $u(r,e,function(){return r.next(n)},t)},function(){return $u(r,e,function(){return r.complete()},t)},function(n){return $u(r,e,function(){return r.error(n)},t)}))})}function Vu(e,t){return void 0===t&&(t=0),du(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function Bu(e,t){if(!e)throw new Error("Iterable cannot be null");return new cu(function(n){$u(n,t,function(){var r=e[Symbol.asyncIterator]();$u(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function Uu(e,t){return t?function(e,t){if(null!=e){if(Au(e))return function(e,t){return Lu(e).pipe(Vu(t),qu(t))}(e,t);if(Ou(e))return function(e,t){return new cu(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}(e,t);if(_u(e))return function(e,t){return Lu(e).pipe(Vu(t),qu(t))}(e,t);if(Iu(e))return Bu(e,t);if(Pu(e))return function(e,t){return new cu(function(n){var r;return $u(n,t,function(){r=e[Mu](),$u(n,t,function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(a){return void n.error(a)}i?n.complete():n.next(t)},0,!0)}),function(){return qc(null==r?void 0:r.return)&&r.return()}})}(e,t);if(Ru(e))return function(e,t){return Bu(ju(e),t)}(e,t)}throw zu(e)}(e,t):Lu(e)}function Hu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Uu(e,Eu(e))}function Wu(e,t){var n=qc(e)?e:function(){return e},r=function(e){return e.error(n())};return new cu(t?function(e){return t.schedule(r,0,e)}:r)}!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(Du||(Du={}));var Yu=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){return function(e,t){var n,r,i,a=e,o=a.kind,s=a.value,l=a.error;if("string"!=typeof o)throw new TypeError('Invalid notification, missing "kind"');"N"===o?null===(n=t.next)||void 0===n||n.call(t,s):"E"===o?null===(r=t.error)||void 0===r||r.call(t,l):null===(i=t.complete)||void 0===i||i.call(t)}(this,e)},e.prototype.do=function(e,t,n){var r=this,i=r.kind,a=r.value,o=r.error;return"N"===i?null==e?void 0:e(a):"E"===i?null==t?void 0:t(o):null==n?void 0:n()},e.prototype.accept=function(e,t,n){var r;return qc(null===(r=e)||void 0===r?void 0:r.next)?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){var e=this,t=e.kind,n=e.value,r=e.error,i="N"===t?Hu(n):"E"===t?Wu(function(){return r}):"C"===t?Cu:0;if(!i)throw new TypeError("Unexpected notification kind "+t);return i},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();Vc(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Gu(e,t){return du(function(n,r){var i=0;n.subscribe(pu(r,function(n){r.next(e.call(t,n,i++))}))})}function Qu(e,t,n){return void 0===n&&(n=1/0),qc(t)?Qu(function(n,r){return Gu(function(e,i){return t(n,e,r,i)})(Lu(e(n,r)))},n):("number"==typeof t&&(n=t),du(function(t,r){return function(e,t,n,r){var i=[],a=0,o=0,s=!1,l=function(){!s||i.length||a||t.complete()},c=function(e){return a<r?u(e):i.push(e)},u=function(e){a++;var s=!1;Lu(n(e,o++)).subscribe(pu(t,function(e){t.next(e)},function(){s=!0},void 0,function(){if(s)try{a--;for(var e=function(){var e=i.shift();u(e)};i.length&&a<r;)e();l()}catch(n){t.error(n)}}))};return e.subscribe(pu(t,c,function(){s=!0,l()})),function(){}}(t,r,e,n)}))}function Ju(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(void 0===(n=1)&&(n=1/0),Qu(lu,n))(Uu(e,Eu(e)));var n}function Ku(e,t){return du(function(n,r){var i=0;n.subscribe(pu(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function Xu(e){return du(function(t,n){var r,i=null,a=!1;i=t.subscribe(pu(n,void 0,void 0,function(o){r=Lu(e(o,Xu(e)(t))),i?(i.unsubscribe(),i=null,r.subscribe(n)):a=!0})),a&&(i.unsubscribe(),i=null,r.subscribe(n))})}function Zu(e,t){return e===t}function ed(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new mu}:t,r=e.resetOnError,i=void 0===r||r,a=e.resetOnComplete,o=void 0===a||a,s=e.resetOnRefCountZero,l=void 0===s||s;return function(e){var t,r,a,s=0,c=!1,u=!1,d=function(){null==r||r.unsubscribe(),r=void 0},p=function(){d(),t=a=void 0,c=u=!1},f=function(){var e=t;p(),null==e||e.unsubscribe()};return du(function(e,h){s++,u||c||d();var m=a=null!=a?a:n();h.add(function(){0!==--s||u||c||(r=td(f,l))}),m.subscribe(h),!t&&s>0&&(t=new ru({next:function(e){return m.next(e)},error:function(e){u=!0,d(),r=td(p,i,e),m.error(e)},complete:function(){c=!0,d(),r=td(p,o),m.complete()}}),Lu(e).subscribe(t))})(e)}}function td(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0!==t){if(!1!==t){var i=new ru({next:function(){i.unsubscribe(),e()}});return Lu(t.apply(void 0,Fc([],Lc(n)))).subscribe(i)}}else e()}function nd(e,t,n){var r,i,a,o,s=!1;return e&&"object"==typeof e?(r=e.bufferSize,o=void 0===r?1/0:r,i=e.windowTime,t=void 0===i?1/0:i,s=void 0!==(a=e.refCount)&&a,n=e.scheduler):o=null!=e?e:1/0,ed({connector:function(){return new vu(o,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}function rd(e,t,n){var r=qc(e)||t||n?{next:e,error:t,complete:n}:e;return r?du(function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var i=!0;e.subscribe(pu(t,function(e){var n;null===(n=r.next)||void 0===n||n.call(r,e),t.next(e)},function(){var e;i=!1,null===(e=r.complete)||void 0===e||e.call(r),t.complete()},function(e){var n;i=!1,null===(n=r.error)||void 0===n||n.call(r,e),t.error(e)},function(){var e,t;i&&(null===(e=r.unsubscribe)||void 0===e||e.call(r)),null===(t=r.finalize)||void 0===t||t.call(r)}))}):lu}function id(e){try{return e()}catch{}}var ad=id(()=>globalThis)||id(()=>window)||id(()=>self)||id(()=>global)||id(function(){return id.constructor("return this")()}),od="4.2.7",sd=/* @__PURE__ */new Map;function ld(e){const t=sd.get(e)||1;return sd.set(e,t+1),`${e}:${t}:${Math.random().toString(36).slice(2)}`}var cd="Invariant Violation",ud=class e extends Error{constructor(t=cd){super(t),this.name=cd,Object.setPrototypeOf(this,e.prototype)}},dd=["debug","log","warn","error","silent"],pd=dd.indexOf("silent");function fd(e,...t){if(!e)throw md(...t)}function hd(e){return function(t,...n){if(dd.indexOf(e)>=pd){const r=console[e]||console.log;if("number"==typeof t){const e=t;(t=bd(e))||(t=vd(e,n),n=[])}r(t,...n)}}}function md(e,...t){return new ud(bd(e,t)||vd(e,t))}fd.debug=hd("debug"),fd.log=hd("log"),fd.warn=hd("warn"),fd.error=hd("error");var gd=Symbol.for("ApolloErrorMessageHandler_"+od);function yd(e){if("string"==typeof e)return e;try{return function(e,t=0){const n=ld("stringifyForDisplay");return JSON.stringify(e,(e,t)=>void 0===t?n:t,t).split(JSON.stringify(n)).join("<undefined>")}(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function bd(e,t=[]){if(e)return ad[gd]&&ad[gd](e,t.map(yd))}function vd(e,t=[]){if(e)return"string"==typeof e?t.reduce((e,t)=>e.replace(/%[sdfo]/,yd(t)),e):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:od,message:e,args:t.map(yd)}))}`}function xd(e,t,n,r){if("IntValue"===n.kind||"FloatValue"===n.kind)e[t.value]=Number(n.value);else if("BooleanValue"===n.kind||"StringValue"===n.kind)e[t.value]=n.value;else if("ObjectValue"===n.kind){const i={};n.fields.map(e=>xd(i,e.name,e.value,r)),e[t.value]=i}else if("Variable"===n.kind){const i=(r||{})[n.name.value];e[t.value]=i}else if("ListValue"===n.kind)e[t.value]=n.values.map(e=>{const n={};return xd(n,t,e,r),n[t.value]});else if("EnumValue"===n.kind)e[t.value]=n.value;else{if("NullValue"!==n.kind)throw md(19,t.value,n.kind);e[t.value]=null}}function wd(e,t){if(e.arguments&&e.arguments.length){const n={};return e.arguments.forEach(({name:e,value:r})=>xd(n,e,r,t)),n}return null}var kd=Symbol.for("apollo.cacheSize"),Sd={...ad[kd]};function Nd(e,t){return e.definitions.find(e=>"OperationDefinition"===e.kind&&!!e.name)?.name.value??t}var Cd=()=>Object.create(null),{forEach:Td,slice:Ed}=Array.prototype,{hasOwnProperty:Od}=Object.prototype,_d=class e{constructor(e=!0,t=Cd){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Td.call(e,e=>t=t.getChildTrie(e)),Od.call(t,"data")?t.data:t.data=this.makeData(Ed.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){const r=t.mapFor(e[n],!1);t=r&&r.get(e[n])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const n=e[0],r=this.mapFor(n,!1),i=r&&r.get(n);i&&(t=i.removeArray(Ed.call(e,1)),i.data||i.weak||i.strong&&i.strong.size||r.delete(n))}else t=this.data,delete this.data;return t}getChildTrie(t){const n=this.mapFor(t,!0);let r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r}mapFor(e,t){return this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(e)?this.weak||(t?this.weak=/* @__PURE__ */new WeakMap:void 0):this.strong||(t?this.strong=/* @__PURE__ */new Map:void 0)}};function Ad(){}var Id=class{constructor(e=1/0,t=Ad){this.max=e,this.dispose=t,this.map=/* @__PURE__ */new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}};function zd(){}var Dd=zd,Md="undefined"!=typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},Pd="undefined"!=typeof WeakMap?WeakMap:Map,jd="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:zd,unregister:zd}},Rd=class{constructor(e=1/0,t=Dd){this.max=e,this.dispose=t,this.map=new Pd,this.newest=null,this.oldest=null,this.unfinalizedNodes=/* @__PURE__ */new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const e=this.unfinalizedNodes.values();for(let t=0;t<10024;t++){const t=e.next().value;if(!t)break;this.unfinalizedNodes.delete(t);const n=t.key;delete t.key,t.keyRef=new Md(n),this.registry.register(n,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new jd(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}},Ld=/* @__PURE__ */new WeakSet;function Fd(e){e.size<=(e.max||-1)||Ld.has(e)||(Ld.add(e),setTimeout(()=>{e.clean(),Ld.delete(e)},100))}var $d=function(e,t){const n=new Rd(e,t);return n.set=function(e,t){const n=Rd.prototype.set.call(this,e,t);return Fd(this),n},n},qd=function(e,t){const n=new Id(e,t);return n.set=function(e,t){const n=Id.prototype.set.call(this,e,t);return Fd(this),n},n};function Vd(e,{max:t,makeCacheKey:n=e=>e}){const r=new _d(!0),i=new $d(t);return(...t)=>{const a=r.lookupArray(n(t)),o=i.get(a);if(o){if(o.error)throw o.error;return o.result}const s=i.set(a,{});try{return s.result=e(...t)}catch(l){throw s.error=l,l}}}var Bd=Vd((e,t)=>{fd(e&&"Document"===e.kind,1);const n=e.definitions.filter(e=>"OperationDefinition"===e.kind);t&&fd(1==n.length&&n[0].operation===t,4,t,t,n[0].operation),_l(e,{Field(t,r,i,a){if(t.alias&&("__typename"===t.alias.value||t.alias.value.startsWith("__ac_"))&&t.alias.value!==t.name.value){let r=e,i=[];for(const e of a)r=r[e],"Field"===r.kind&&i.push(r.alias?.value||r.name.value);throw i.splice(-1,1,t.name.value),md(5,t.alias.value,i.join("."),n[0].operation,Nd(e,"(anonymous)"))}}})},{max:Sd.checkDocument||2e3}),{toString:Ud}=Object.prototype;function Hd(...e){const t={};return e.forEach(e=>{e&&Reflect.ownKeys(e).forEach(n=>{const r=e[n];void 0!==r&&(t[n]=r)})}),t}function Wd(e=[]){const t={};return e.forEach(e=>{t[e.name.value]=e}),t}function Yd(e){return null!==e&&"object"==typeof e}var{hasOwnProperty:Gd}=Object.prototype,Qd=function(e,t,n){return this.merge(e[n],t[n])},Jd=e=>isNaN(+e)?{}:[],Kd=class{options;reconciler;constructor(e={}){this.options=e,this.reconciler=e.reconciler||Qd}merge(e,t,n={}){const r=n.atPath;if(r?.length){const[i,...a]=r;void 0===e&&(e=Jd(i));let o=e[i];void 0===o&&a.length&&(o=Jd(a[0]));const s=this.merge(o,t,{...n,atPath:a});return o!==s&&((e=this.shallowCopyForMerge(e))[i]=s),e}return Array.isArray(e)&&Array.isArray(t)&&"truncate"===this.options.arrayMerge&&e.length>t.length&&(e=e.slice(0,t.length),this.pastCopies.add(e)),Yd(t)&&Yd(e)?(Object.keys(t).forEach(n=>{if(Gd.call(e,n)){const r=e[n];if(t[n]!==r){const i=this.reconciler(e,t,n);i!==r&&((e=this.shallowCopyForMerge(e))[n]=i)}}else(e=this.shallowCopyForMerge(e))[n]=t[n]}),e):t}isObject=Yd;pastCopies=/* @__PURE__ */new Set;shallowCopyForMerge(e){return Yd(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):{__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}};function Xd(e){const t={},n=e&&e.variableDefinitions;return n&&n.length&&n.forEach(e=>{e.defaultValue&&xd(t,e.variable.name,e.defaultValue)}),t}function Zd(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{const n=e.name.value;if("function"==typeof t)return t(n);const r=t&&t[n];return fd(r,9,n),r||null}default:return null}}function ep(e,t){let n=t;const r=[];return e.definitions.forEach(e=>{if("OperationDefinition"===e.kind)throw md(10,e.operation,e.name?` named '${e.name.value}'`:"");"FragmentDefinition"===e.kind&&r.push(e)}),void 0===n&&(fd(1===r.length,11,r.length),n=r[0].name.value),{...e,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}},...e.definitions]}}function tp(e){return e.definitions.filter(e=>"FragmentDefinition"===e.kind)}function np(e){let t;Bd(e);for(let n of e.definitions){if("OperationDefinition"===n.kind)return n;"FragmentDefinition"!==n.kind||t||(t=n)}if(t)return t;throw md(12)}function rp(e){return Bd(e),e.definitions.filter(e=>"OperationDefinition"===e.kind)[0]}function ip(e){const t=rp(e);return fd(t&&"query"===t.operation,13),t}var ap,op=Object.assign(function(e){return JSON.stringify(e,sp)},{reset(){ap=new qd(Sd.canonicalStringify||1e3)}});function sp(e,t){if(t&&"object"==typeof t){const e=Object.getPrototypeOf(t);if(e===Object.prototype||null===e){const n=Object.keys(t);if(n.every(lp))return t;const r=JSON.stringify(n);let i=ap.get(r);if(!i){n.sort();const e=JSON.stringify(n);i=ap.get(e)||n,ap.set(r,i),ap.set(e,i)}const a=Object.create(e);return i.forEach(e=>{a[e]=t[e]}),a}}return t}function lp(e,t,n){return 0===t||n[t-1]<=e}op.reset();var cp=["connection","include","skip","client","rest","export","nonreactive","stream"],up=op,dp=Object.assign(function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){const e=n.connection.filter?n.connection.filter:[];e.sort();const r={};e.forEach(e=>{r[e]=t[e]});const i=up(r);if("{}"!==i)return`${n.connection.key}(${i})`}return n.connection.key}let r=e;if(t){const e=up(t);"{}"!==e&&(r+=`(${e})`)}return n&&Object.keys(n).forEach(e=>{-1===cp.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?r+=`@${e}(${up(n[e])})`:r+=`@${e}`)}),r},{setStringify(e){const t=up;return up=e,t}});function pp(e){return!!e.errors?.length}function fp(e,t,n){const r=new Set(e),i=r.size;return _l(t,{Directive(e){if(r.delete(e.name.value)&&(!n||!r.size))return Ol}}),n?!r.size:r.size<i}function hp(e){let t=!1;return _l(e,{Directive:{enter(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(e=>"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value),t))return Ol}}}),t}var mp=Array.isArray;function gp(e){return"Field"===e.kind}function yp(e){return Array.isArray(e)&&e.length>0}function bp(e){return{__ref:String(e)}}function vp(e){let t=e[0]||{};const n=e.length;if(n>1){const r=new Kd;for(let i=1;i<n;++i)t=r.merge(t,e[i])}return t}function xp(e,t){return Hd(e,t,t.variables&&{variables:Hd({...e&&e.variables,...t.variables})})}function wp(e){return e.catch(()=>{}),e}function kp(e,t){Bd(t);const n=Sp(""),r=Sp(""),i=e=>{for(let t,i=0;i<e.length&&(t=e[i]);++i)if(!mp(t)){if("OperationDefinition"===t.kind)return n(t.name&&t.name.value);if("FragmentDefinition"===t.kind)return r(t.name.value)}return fd.error(14),null};let a=0;for(let m=t.definitions.length-1;m>=0;--m)"OperationDefinition"===t.definitions[m].kind&&++a;const o=function(e){const t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;return e.forEach(e=>{e&&(e.name?t.set(e.name,e):e.test&&n.set(e.test,e))}),e=>{let r=t.get(e.name.value);return!r&&n.size&&n.forEach((t,n)=>{n(e)&&(r=t)}),r}}(e),s=e=>yp(e)&&e.map(o).some(e=>e&&e.remove),l=/* @__PURE__ */new Map;let c=!1;const u={enter(e){if(s(e.directives))return c=!0,null}},d=_l(t,{Field:u,InlineFragment:u,VariableDefinition:{enter:()=>!1},Variable:{enter(e,t,n,r,a){const o=i(a);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter(e,t,n,r,a){if(s(e.directives))return c=!0,null;const o=i(a);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter(e,t,n,r){l.set(JSON.stringify(r),e)},leave:(e,t,n,i)=>e===l.get(JSON.stringify(i))?e:a>0&&e.selectionSet.selections.every(e=>"Field"===e.kind&&"__typename"===e.name.value)?(r(e.name.value).removed=!0,c=!0,null):void 0},Directive:{leave(e){if(o(e))return c=!0,null}}});if(!c)return t;const p=e=>(e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach(t=>{p(r(t)).transitiveVars.forEach(t=>{e.transitiveVars.add(t)})})),e),f=/* @__PURE__ */new Set;d.definitions.forEach(e=>{"OperationDefinition"===e.kind?p(n(e.name&&e.name.value)).fragmentSpreads.forEach(e=>{f.add(e)}):"FragmentDefinition"!==e.kind||0!==a||r(e.name.value).removed||f.add(e.name.value)}),f.forEach(e=>{p(r(e)).fragmentSpreads.forEach(e=>{f.add(e)})});const h={enter(e){if(t=e.name.value,!f.has(t)||r(t).removed)return null;var t}};return function(e){return Np(rp(e)||function(e){fd("Document"===e.kind,6),fd(e.definitions.length<=1,7);const t=e.definitions[0];return fd("FragmentDefinition"===t.kind,8),t}(e),Wd(tp(e)))?null:e}(_l(d,{FragmentSpread:h,FragmentDefinition:h,OperationDefinition:{leave(e){if(e.variableDefinitions){const t=p(n(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return{...e,variableDefinitions:e.variableDefinitions.filter(e=>t.has(e.variable.name.value))}}}}}))}function Sp(e){const t=/* @__PURE__ */new Map;return function(n=e){let r=t.get(n);return r||t.set(n,r={variables:/* @__PURE__ */new Set,fragmentSpreads:/* @__PURE__ */new Set}),r}}function Np(e,t){return!e||e.selectionSet.selections.every(e=>"FragmentSpread"===e.kind&&Np(t[e.name.value],t))}function Cp(e){return _l(e,{FragmentSpread(e){if(!e.directives?.some(({name:e})=>"unmask"===e.value))return null}})}function Tp(e){return e.alias?e.alias.value:e.name.value}function Ep({directives:e},t){return!e||!e.length||function(e){const t=[];return e&&e.length&&e.forEach(e=>{if(!function({name:{value:e}}){return"skip"===e||"include"===e}(e))return;const n=e.arguments,r=e.name.value;fd(n&&1===n.length,16,r);const i=n[0];fd(i.name&&"if"===i.name.value,17,r);const a=i.value;fd(a&&("Variable"===a.kind||"BooleanValue"===a.kind),18,r),t.push({directive:e,ifArgument:i})}),t}(e).every(({directive:e,ifArgument:n})=>{let r=!1;return"Variable"===n.value.kind?(r=t&&t[n.value.name.value],fd(void 0!==r,15,e.name.value)):r=n.value.value,"skip"===e.name.value?!r:r})}function Op(e){const t={data:e.data};return e.error&&(t.error=e.error),t}function _p(e,t=()=>{}){return n=>new cu(r=>{let i=t();return n.subscribe({next(t){let n;try{n=e(t,i)}catch(NL){r.error(NL)}void 0!==n&&r.next(n)},error(e){r.error(e)},complete(){r.complete()}})})}var{toString:Ap,hasOwnProperty:Ip}=Object.prototype,zp=Function.prototype.toString,Dp=/* @__PURE__ */new Map;function Mp(e,t){try{return Pp(e,t)}finally{Dp.clear()}}function Pp(e,t){if(e===t)return!0;const n=Ap.call(e);if(n!==Ap.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(Fp(e,t))return!0;const n=jp(e),r=jp(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!Ip.call(t,n[e]))return!1;for(let a=0;a<i;++a){const r=n[a];if(!Pp(e[r],t[r]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e===+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(Fp(e,t))return!0;const r=e.entries(),i="[object Map]"===n;for(;;){const e=r.next();if(e.done)break;const[n,a]=e.value;if(!t.has(n))return!1;if(i&&!Pp(a,t.get(n)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let n=e.byteLength;if(n===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const n=zp.call(e);return n===zp.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,Lp)}}return!1}function jp(e){return Object.keys(e).filter(Rp,e)}function Rp(e){return void 0!==this[e]}var Lp="{ [native code] }";function Fp(e,t){let n=Dp.get(e);if(n){if(n.has(t))return!0}else Dp.set(e,n=/* @__PURE__ */new Set);return n.add(t),!1}function $p(e,{data:t,...n},{data:r,...i},a){return Mp(n,i)&&qp(np(e).selectionSet,t,r,{fragmentMap:Wd(tp(e)),variables:a})}function qp(e,t,n,r){if(t===n)return!0;const i=/* @__PURE__ */new Set;return e.selections.every(e=>{if(i.has(e))return!0;if(i.add(e),!Ep(e,r.variables))return!0;if(Vp(e))return!0;if(gp(e)){const i=Tp(e),a=t&&t[i],o=n&&n[i],s=e.selectionSet;if(!s)return Mp(a,o);const l=Array.isArray(a),c=Array.isArray(o);if(l!==c)return!1;if(l&&c){const e=a.length;if(o.length!==e)return!1;for(let t=0;t<e;++t)if(!qp(s,a[t],o[t],r))return!1;return!0}return qp(s,a,o,r)}{const i=Zd(e,r.fragmentMap);if(i)return!!Vp(i)||qp(i.selectionSet,t,n,r)}})}function Vp(e){return!!e.directives&&e.directives.some(Bp)}function Bp(e){return"nonreactive"===e.name.value}var Up=Vd(function(e,t,n){return function(e,t){let n,r;function i(e){return e!==n&&(n=e,r=t(n)),r}return Object.assign(e.pipe(Gu(i),nd({bufferSize:1,refCount:!0})),{getCurrentResult:()=>i(e.getCurrentResult())})}(e,n)},{max:1,makeCacheKey:e=>e.slice(0,2)}),Hp=Symbol.for("apollo.result.extensions"),Wp=Symbol.for("apollo.result.streamInfo"),Yp=Symbol.for("apollo.observableQuery.variablesUnknown"),Gp=null,Qp={},Jp=1;function Kp(e){try{return e()}catch(t){}}var Xp="@wry/context:Slot",Zp=Kp(()=>globalThis)||Kp(()=>global)||Object.create(null),ef=Zp[Xp]||Array[Xp]||function(e){try{Object.defineProperty(Zp,Xp,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",Jp++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Gp;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===Qp)break;return e!==Gp&&(Gp.slots[this.id]=t),!0}return Gp&&(Gp.slots[this.id]=Qp),!1}getValue(){if(this.hasValue())return Gp.slots[this.id]}withValue(e,t,n,r){const i={__proto__:null,[this.id]:e},a=Gp;Gp={parent:a,slots:i};try{return t.apply(r,n)}finally{Gp=a}}static bind(e){const t=Gp;return function(){const n=Gp;try{return Gp=t,e.apply(this,arguments)}finally{Gp=n}}}static noContext(e,t,n){if(!Gp)return e.apply(n,t);{const r=Gp;try{return Gp=null,e.apply(n,t)}finally{Gp=r}}}}),{bind:tf,noContext:nf}=ef,rf=new ef,{hasOwnProperty:af}=Object.prototype,of=Array.from||function(e){const t=[];return e.forEach(e=>t.push(e)),t};function sf(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}var lf=[];function cf(e,t){if(!e)throw new Error(t||"assertion failure")}function uf(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function df(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function pf(e){return e.slice(0)}var ff=class e{constructor(t){this.fn=t,this.parents=/* @__PURE__ */new Set,this.childValues=/* @__PURE__ */new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}peek(){if(1===this.value.length&&!gf(this))return hf(this),this.value[0]}recompute(e){return cf(!this.recomputing,"already recomputing"),hf(this),gf(this)?function(e,t){return Sf(e),rf.withValue(e,mf,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{sf(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(NL){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,gf(e)||bf(e)}(e),df(e.value)}(this,e):df(this.value)}setDirty(){this.dirty||(this.dirty=!0,yf(this),sf(this))}dispose(){this.setDirty(),Sf(this),vf(this,(e,t)=>{e.setDirty(),Nf(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=lf.pop()||/* @__PURE__ */new Set),this.deps.add(e)}forgetDeps(){this.deps&&(of(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),lf.push(this.deps),this.deps=null)}};function hf(e){const t=rf.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),gf(e)?xf(t,e):wf(t,e),t}function mf(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=pf(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!uf(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch(i){}}catch(NL){e.value[1]=NL}e.recomputing=!1}function gf(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function yf(e){vf(e,xf)}function bf(e){vf(e,wf)}function vf(e,t){const n=e.parents.size;if(n){const r=of(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function xf(e,t){cf(e.childValues.has(t)),cf(gf(t));const n=!gf(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=lf.pop()||/* @__PURE__ */new Set;e.dirtyChildren.add(t),n&&yf(e)}function wf(e,t){cf(e.childValues.has(t)),cf(!gf(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,pf(t.value)):uf(n,t.value)||e.setDirty(),kf(e,t),gf(e)||bf(e)}function kf(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(lf.length<100&&lf.push(n),e.dirtyChildren=null))}function Sf(e){e.childValues.size>0&&e.childValues.forEach((t,n)=>{Nf(e,n)}),e.forgetDeps(),cf(null===e.dirtyChildren)}function Nf(e,t){t.parents.delete(e),e.childValues.delete(t),kf(e,t)}ff.count=0;var Cf,Tf={setDirty:!0,dispose:!0,forget:!0};function Ef(e){const t=/* @__PURE__ */new Map,n=e&&e.subscribe;function r(e){const r=rf.getValue();if(r){let i=t.get(e);i||t.set(e,i=/* @__PURE__ */new Set),r.dependOn(i),"function"==typeof n&&(sf(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){const r=t.get(e);if(r){const i=n&&af.call(Tf,n)?n:"setDirty";of(r).forEach(e=>e[i]()),t.delete(e),sf(r)}},r}function Of(...e){return(Cf||(Cf=new _d("function"==typeof WeakMap))).lookupArray(e)}var _f=/* @__PURE__ */new Set;function Af(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=Of,normalizeResult:i,subscribe:a,cache:o=Id}=Object.create(null)){const s="function"==typeof o?new o(t,e=>e.dispose()):o,l=function(){const t=r.apply(null,n?n.apply(null,arguments):arguments);if(void 0===t)return e.apply(null,arguments);let o=s.get(t);o||(s.set(t,o=new ff(e)),o.normalizeResult=i,o.subscribe=a,o.forget=()=>s.delete(t));const l=o.recompute(Array.prototype.slice.call(arguments));return s.set(t,o),_f.add(s),rf.hasValue()||(_f.forEach(e=>e.clean()),_f.clear()),l};function c(e){const t=e&&s.get(e);t&&t.setDirty()}function u(e){const t=e&&s.get(e);if(t)return t.peek()}function d(e){return!!e&&s.delete(e)}return Object.defineProperty(l,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(l.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:a,cache:s}),l.dirtyKey=c,l.dirty=function(){c(r.apply(null,arguments))},l.peekKey=u,l.peek=function(){return u(r.apply(null,arguments))},l.forgetKey=d,l.forget=function(){return d(r.apply(null,arguments))},l.makeCacheKey=r,l.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(l)}function If(...e){return Of.bind(null,...e)}var zf=class{isIncrementalResult(e){return!1}prepareRequest(e){return fd(!fp(["defer","stream"],e.query),67),e}extractErrors(){}startRequest=void 0},Df=class e{static empty(){return new e(()=>Cu)}static from(t){if(0===t.length)return e.empty();const[n,...r]=t;return n.concat(...r)}static split(t,n,r=new e((e,t)=>t(e))){const i=new e((e,i)=>t(e)?n.request(e,i):r.request(e,i));return Object.assign(i,{left:n,right:r})}static execute(e,t,n){return e.request(function(e,{client:t}){const n={query:e.query,variables:e.variables||{},extensions:e.extensions||{},operationName:Nd(e.query),operationType:rp(e.query).operation};let r={...e.context};const i=()=>Object.freeze({...r});return Object.defineProperty(n,"setContext",{enumerable:!1,value:e=>{r="function"==typeof e?{...r,...e(i())}:{...r,...e}}}),Object.defineProperty(n,"getContext",{enumerable:!1,value:i}),Object.defineProperty(n,"client",{enumerable:!1,value:t}),n}(t,n),()=>Cu)}static concat(...t){return e.from(t)}constructor(e){e&&(this.request=e)}split(t,n,r){return this.concat(e.split(t,n,r))}concat(...e){return 0===e.length?this:e.reduce(this.combine.bind(this),this)}combine(t,n){const r=new e((e,r)=>t.request(e,e=>n.request(e,r)));return Object.assign(r,{left:t,right:n})}request(e,t){throw md(65)}left;right},Mf=Df.execute;function Pf(e){return e}var jf,Rf=class e{transform;cached;resultCache=/* @__PURE__ */new WeakSet;getCacheKey(e){return[e]}static identity(){return new e(Pf,{cache:!1})}static split(t,n,r=e.identity()){return Object.assign(new e(e=>(t(e)?n:r).transformDocument(e),{cache:!1}),{left:n,right:r})}constructor(e,t={}){this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}resetCache(){if(this.cached){const t=new _d;this.performWork=Af(e.prototype.performWork.bind(this),{makeCacheKey:e=>{const n=this.getCacheKey(e);if(n)return fd(Array.isArray(n),20),t.lookupArray(n)},max:Sd["documentTransform.cache"],cache:Rd})}}performWork(e){return Bd(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;const t=this.performWork(e);return this.resultCache.add(t),t}concat(t){return Object.assign(new e(e=>t.transformDocument(this.transformDocument(e)),{cache:!1}),{left:this,right:t})}left;right},Lf=Object.assign(e=>{let t=jf.get(e);return t||(t=function(e){return _l(e,Il)}(e),jf.set(e,t)),t},{reset(){jf=new $d(Sd.print||2e3)}});function Ff(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}Lf.reset();var $f={kind:Ts,name:{kind:ws,value:"__typename"}},qf=Object.assign(function(e){return _l(e,{SelectionSet:{enter(e,t,n){if(n&&"OperationDefinition"===n.kind)return;const{selections:r}=e;if(!r)return;if(r.some(e=>"Field"===e.kind&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))))return;const i=n;return"Field"===i.kind&&i.directives&&i.directives.some(e=>"export"===e.name.value)?void 0:{...e,selections:[...r,$f]}}}})},{added:e=>e===$f});function Vf(e,t){return rp(e)?.operation===t}function Bf(e){return 7===e||8===e}function Uf(e){return!Bf(e)}var Hf=class{assumeImmutableResults=!1;lookupFragment(e){return null}batch(e){const t="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;let n;return this.performTransaction(()=>n=e.update(this),t),n}recordOptimisticTransaction(e,t){this.performTransaction(e,t)}transformDocument(e){return e}transformForLink(e){return e}identify(e){}gc(){return[]}modify(e){return!1}readQuery(e,t=!!e.optimistic){return this.read({...e,rootId:e.id||"ROOT_QUERY",optimistic:t})}fragmentWatches=new _d(!0);watchFragment(e){const{fragment:t,fragmentName:n,from:r}=e,i=this.getFragmentDoc(t,n),a=(Array.isArray(r)?r:[r]).map(e=>null==e?e:this.toCacheId(e));if(!Array.isArray(r)){const t=this.watchSingleFragment(a[0],i,e);return null===r?t:Up(t,Symbol.for("apollo.transform.individualResult"),e=>({...e,data:e.data??{}}))}let o;function s(e){const t=e.reduce((e,t,n)=>(e.data.push(t.data),e.complete&&=t.complete,e.dataState=e.complete?"complete":"partial",t.missing&&(e.missing||={},e.missing[n]=t.missing),e),{data:[],dataState:"complete",complete:!0});return Mp(o,t)||(o=t),o}if(0===a.length)return Qf;let l=!1;const c=a.map(t=>this.watchSingleFragment(t,i,e)),u=function(e){return 0===e.length?Cu:new cu(t=>{const{length:n}=e,r=new Array(n),i=/* @__PURE__ */new Map;e.forEach((e,t)=>{i.has(e)||i.set(e,/* @__PURE__ */new Set),i.get(e).add(t)});let a,o=i.size,s=i.size;i.forEach((n,i)=>{let l=!1;const c=i.subscribe({next:o=>{n.forEach(e=>r[e]=o),l||(l=!0,s--),s||(a||=new Set(e.filter(e=>e.dirty)),a.delete(i),a.size||(t.next(r.slice()),a=void 0))},complete:()=>{o--,o||t.complete()},error:t.error.bind(t)});t.add(c)})})}(c).pipe(Gu(s),rd({subscribe:()=>l=!0,unsubscribe:()=>l=!1}),nd({bufferSize:1,refCount:!0}));return Object.assign(u,{getCurrentResult:()=>l&&o?o:s(c.map(e=>e.getCurrentResult()))})}onAfterBroadcast=e=>e();watchSingleFragment(e,t,n){if(null===e)return Yf;const{optimistic:r=!0,variables:i}=n,a=[t,op({id:e,optimistic:r,variables:i})],o=this.fragmentWatches.lookupArray(a);if(!o.observable){let c,u=!1;function d(e){const r=e.result;return c&&$p(t,{data:c.data},{data:r},n.variables)||(c={data:r,dataState:e.complete?"complete":"partial",complete:e.complete},e.missing&&(c.missing=e.missing.missing)),c}const p=new cu(n=>{u=!0;const o=this.watch({variables:i,returnPartialData:!0,id:e,query:t,optimistic:r,immediate:!0,callback:e=>{p.dirty=!0,this.onAfterBroadcast(()=>{n.next(d(e)),p.dirty=!1})}});return()=>{u=!1,o(),this.fragmentWatches.removeArray(a)}}).pipe((void 0===l&&(l=lu),s=null!=s?s:Zu,du(function(e,t){var n,r=!0;e.subscribe(pu(t,function(e){var i=l(e);!r&&s(n,i)||(r=!1,n=i,t.next(e))}))})),ed({connector:()=>new vu(1),resetOnRefCountZero:()=>function(e,t,n){void 0===e&&(e=0),void 0===n&&(n=Nu);var r=-1;return null!=t&&(Tu(t)?n=t:r=t),new cu(function(t){var i,a=(i=e)instanceof Date&&!isNaN(i)?+e-n.now():e;a<0&&(a=0);var o=0;return n.schedule(function(){t.closed||(t.next(o++),0<=r?this.schedule(void 0,r):t.complete())},a)})}(0)}));o.observable=Object.assign(p,{dirty:!1,getCurrentResult:()=>u&&c?c:d(this.diff({id:e,query:t,returnPartialData:!0,optimistic:r,variables:i}))})}var s,l;return o.observable}getFragmentDoc=Af(ep,{max:Sd["cache.fragmentQueryDocuments"]||1e3,cache:Rd,makeCacheKey:If(this)});readFragment(e,t=!!e.optimistic){const n=void 0!==e.from?this.toCacheId(e.from):e.id;return this.read({...e,query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:n,optimistic:t})}writeQuery({id:e,data:t,...n}){return this.write(Object.assign(n,{dataId:e||"ROOT_QUERY",result:t}))}writeFragment({data:e,fragment:t,fragmentName:n,...r}){const i=void 0!==r.from?this.toCacheId(r.from):r.id;return this.write(Object.assign(r,{query:this.getFragmentDoc(t,n),dataId:i,result:e}))}updateQuery(e,t){return this.batch({update(n){const r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery({...e,data:i}),i)}})}updateFragment(e,t){return this.batch({update(n){const r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment({...e,data:i}),i)}})}toCacheId(e){return"string"==typeof e?e:this.identify(e)}},Wf=Object.freeze({data:null,dataState:"complete",complete:!0}),Yf=Object.assign(new cu(e=>{e.next(Wf)}),{dirty:!1,getCurrentResult:()=>Wf}),Gf=Object.freeze({data:[],dataState:"complete",complete:!0}),Qf=Object.assign(new cu(e=>{e.next(Gf)}),{getCurrentResult:()=>Gf}),Jf=class e extends Error{message;path;query;variables;constructor(t,n,r,i){if(super(t),this.message=t,this.path=n,this.query=r,this.variables=i,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let e=this.path.length-1;e>=0;--e)this.missing={[this.path[e]]:this.missing}}else this.missing=this.path;this.__proto__=e.prototype}missing},{hasOwnProperty:Kf}=Object.prototype;function Xf({__typename:e,id:t,_id:n},r){if("string"==typeof e&&(r&&(r.keyObject=null!=t?{id:t}:null!=n?{_id:n}:void 0),null==t&&null!=n&&(t=n),null!=t))return`${e}:${"number"==typeof t||"string"==typeof t?t:JSON.stringify(t)}`}var Zf={dataIdFromObject:Xf,resultCaching:!0},eh=/^[_a-z][_0-9a-z]*/i;function th(e){const t=e.match(eh);return t?t[0]:e}function nh(e,t,n){return!!Yd(t)&&(mp(t)?t.every(t=>nh(e,t,n)):e.selections.every(e=>{if(gp(e)&&Ep(e,n)){const r=Tp(e);return Kf.call(t,r)&&(!e.selectionSet||nh(e.selectionSet,t[r],n))}return!0}))}function rh(e){return Yd(e)&&!Ff(e)&&!mp(e)}function ih(e,t){const n=Wd(tp(e));return{fragmentMap:n,lookupFragment(e){let r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var ah={},oh=()=>ah,sh={},lh=class{policies;group;data={};constructor(e,t){this.policies=e,this.group=t}toObject(){return{...this.data}}has(e){return void 0!==this.lookup(e,!0)}get(e,t){if(this.group.depend(e,t),Kf.call(this.data,e)){const n=this.data[e];if(n&&Kf.call(n,t))return n[t]}return"__typename"===t&&Kf.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof ph?this.parent.get(e,t):void 0}lookup(e,t){return t&&this.group.depend(e,"__exists"),Kf.call(this.data,e)?this.data[e]:this instanceof ph?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?{}:void 0}merge(e,t){let n;Ff(e)&&(e=e.__ref),Ff(t)&&(t=t.__ref);const r="string"==typeof e?this.lookup(n=e):e,i="string"==typeof t?this.lookup(n=t):t;if(!i)return;fd("string"==typeof n,104);const a=new Kd({reconciler:hh}).merge(r,i);if(this.data[n]=a,a!==r&&(delete this.refs[n],this.group.caching)){const e={};r||(e.__exists=1),Object.keys(i).forEach(t=>{if(!r||r[t]!==a[t]){e[t]=1;const n=th(t);n===t||this.policies.hasKeyArgs(a.__typename,n)||(e[n]=1),void 0!==a[t]||this instanceof ph||delete a[t]}}),!e.__typename||r&&r.__typename||this.policies.rootTypenamesById[n]!==a.__typename||delete e.__typename,Object.keys(e).forEach(e=>this.group.dirty(n,e))}}modify(e,t,n){const r=this.lookup(e);if(r){const i={};let a=!1,o=!0;const s={DELETE:ah,INVALIDATE:sh,isReference:Ff,toReference:this.toReference,canRead:this.canRead,readField:(t,n)=>this.policies.readField("string"==typeof t?{fieldName:t,from:n||bp(e)}:t,{store:this})};if(Object.keys(r).forEach(l=>{const c=th(l);let u=r[l];if(void 0===u)return;const d="function"==typeof t?t:t[l]||(n?void 0:t[c]);if(d){let t=d===oh?ah:d(u,{...s,fieldName:c,storeFieldName:l,storage:this.getStorage(e,l)});t===sh?this.group.dirty(e,l):(t===ah&&(t=void 0),t!==u&&(i[l]=t,a=!0,u=t))}void 0!==u&&(o=!1)}),a)return this.merge(e,i),o&&(this instanceof ph?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1}delete(e,t,n){const r=this.lookup(e);if(r){const i=this.getFieldValue(r,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:i,fieldName:t,args:n}):t;return this.modify(e,a?{[a]:oh}:oh,!!n)}return!1}evict(e,t){let n=!1;return e.id&&(Kf.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof ph&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n}clear(){this.replace(null)}extract(){const e=this.toObject(),t=[];return this.getRootIdSet().forEach(e=>{Kf.call(this.policies.rootTypenamesById,e)||t.push(e)}),t.length&&(e.__META={extraRootIds:t.sort()}),e}replace(e){if(Object.keys(this.data).forEach(t=>{e&&Kf.call(e,t)||this.delete(t)}),e){const{__META:t,...n}=e;Object.keys(n).forEach(e=>{this.merge(e,n[e])}),t&&t.extraRootIds.forEach(this.retain,this)}}rootIds={};retain(e){return this.rootIds[e]=(this.rootIds[e]||0)+1}release(e){if(this.rootIds[e]>0){const t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0}getRootIdSet(e=/* @__PURE__ */new Set){return Object.keys(this.rootIds).forEach(e.add,e),this instanceof ph?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e}gc(){const e=this.getRootIdSet(),t=this.toObject();e.forEach(n=>{Kf.call(t,n)&&(Object.keys(this.findChildRefIds(n)).forEach(e.add,e),delete t[n])});const n=Object.keys(t);if(n.length){let e=this;for(;e instanceof ph;)e=e.parent;n.forEach(t=>e.delete(t))}return n}refs={};findChildRefIds(e){if(!Kf.call(this.refs,e)){const t=this.refs[e]={},n=this.data[e];if(!n)return t;const r=/* @__PURE__ */new Set([n]);r.forEach(e=>{Ff(e)&&(t[e.__ref]=!0),Yd(e)&&Object.keys(e).forEach(t=>{const n=e[t];Yd(n)&&r.add(n)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,t)=>Ff(e)?this.get(e.__ref,t):e&&e[t];canRead=e=>Ff(e)?this.has(e.__ref):"object"==typeof e;toReference=(e,t)=>{if("string"==typeof e)return bp(e);if(Ff(e))return e;const[n]=this.policies.identify(e);if(n){const r=bp(n);return t&&this.merge(n,e),r}};get supportsResultCaching(){return this.group.caching}},ch=class{caching;parent;d=null;keyMaker;constructor(e,t=null){this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?Ef():null,this.keyMaker=new _d}depend(e,t){if(this.d){this.d(uh(e,t));const n=th(t);n!==t&&this.d(uh(e,n)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(uh(e,t),"__exists"===t?"forget":"setDirty")}};function uh(e,t){return t+"#"+e}function dh(e,t){mh(e)&&e.group.depend(t,"__exists")}lh.Root=class extends lh{constructor({policies:e,resultCaching:t=!0,seed:n}){super(e,new ch(t)),n&&this.replace(n)}stump=new fh(this);addLayer(e,t){return this.stump.addLayer(e,t)}removeLayer(){return this}storageTrie=new _d;getStorage(){return this.storageTrie.lookupArray(arguments)}};var ph=class e extends lh{id;parent;replay;group;constructor(e,t,n,r){super(t.policies,r),this.id=e,this.parent=t,this.replay=n,this.group=r,n(this)}addLayer(t,n){return new e(t,this,n,this.group)}removeLayer(e){const t=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(e=>{const n=this.data[e],r=t.lookup(e);r?n?n!==r&&Object.keys(n).forEach(t=>{Mp(n[t],r[t])||this.group.dirty(e,t)}):(this.group.dirty(e,"__exists"),Object.keys(r).forEach(t=>{this.group.dirty(e,t)})):this.delete(e)}),t):t===this.parent?this:t.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(e){const t=this.parent.findChildRefIds(e);return Kf.call(this.data,e)?{...t,...super.findChildRefIds(e)}:t}getStorage(...e){let t=this.parent;for(;t.parent;)t=t.parent;return t.getStorage(...e)}},fh=class extends ph{constructor(e){super("EntityStore.Stump",e,()=>{},new ch(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}};function hh(e,t,n){const r=e[n],i=t[n];return Mp(r,i)?r:i}function mh(e){return!(!e||!e.supportsResultCaching)}var gh=new ef;function yh(e){const t=e.directives?.find(({name:e})=>"unmask"===e.value);if(!t)return"mask";const n=t.arguments?.find(({name:e})=>"mode"===e.value);return n&&"value"in n.value&&"migrate"===n.value.value?"migrate":"unmask"}function bh(e,t,n){return gh.withValue(!0,()=>{const r=vh(e,t,n,!1);return Object.isFrozen(e),r})}function vh(e,t,n,r,i){const{knownChanged:a}=n,o=function(e,t){if(t.has(e))return t.get(e);const n=Array.isArray(e)?[]:{};return t.set(e,n),n}(e,n.mutableTargets);if(Array.isArray(e)){for(const[i,s]of Array.from(e.entries())){if(null===s){o[i]=null;continue}const e=vh(s,t,n,r,void 0);a.has(e)&&a.add(o),o[i]=e}return a.has(o)?o:e}for(const s of t.selections){let t;if(r&&a.add(o),"Field"===s.kind){const i=Tp(s),l=s.selectionSet;if(t=o[i]||e[i],void 0===t)continue;if(l&&null!==t){const o=vh(e[i],l,n,r,void 0);a.has(o)&&(t=o)}o[i]=t}if("InlineFragment"!==s.kind||s.typeCondition&&!n.cache.fragmentMatches(s,e.__typename)||(t=vh(e,s.selectionSet,n,r,i)),"FragmentSpread"===s.kind){const r=s.name.value,a=n.fragmentMap[r]||(n.fragmentMap[r]=n.cache.lookupFragment(r));fd(a,39,r);const o=yh(s);"mask"!==o&&(t=vh(e,a.selectionSet,n,"migrate"===o,i))}a.has(t)&&a.add(o)}return"__typename"in e&&!("__typename"in o)&&(o.__typename=e.__typename),Object.keys(o).length!==Object.keys(e).length&&a.add(o),a.has(o)?o:e}var xh={};function wh(e){const t=JSON.stringify(e);return xh[t]||(xh[t]={})}function kh(e){const t=wh(e);return t.keyFieldsFn||(t.keyFieldsFn=(t,n)=>{const r=(e,t)=>n.readField(t,e),i=n.keyObject=Nh(e,e=>{let i=Eh(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&Kf.call(t,e[0])&&(i=Eh(t,e,Th)),fd(void 0!==i,107,e.join("."),t),i});return`${n.typename}:${JSON.stringify(i)}`})}function Sh(e){const t=wh(e);return t.keyArgsFn||(t.keyArgsFn=(t,{field:n,variables:r,fieldName:i})=>{const a=Nh(e,e=>{const i=e[0],a=i.charAt(0);if("@"!==a){if("$"===a){const t=i.slice(1);if(r&&Kf.call(r,t)){const n=e.slice(0);return n[0]=t,Eh(r,n)}return}if(t)return Eh(t,e)}else if(n&&yp(n.directives)){const t=i.slice(1),a=n.directives.find(e=>e.name.value===t),o=a&&wd(a,r);return o&&Eh(o,e.slice(1))}}),o=JSON.stringify(a);return(t||"{}"!==o)&&(i+=":"+o),i})}function Nh(e,t){const n=new Kd;return Ch(e).reduce((e,r)=>{let i=t(r);if(void 0!==i){for(let e=r.length-1;e>=0;--e)i={[r[e]]:i};e=n.merge(e,i)}return e},{})}function Ch(e){const t=wh(e);if(!t.paths){const n=t.paths=[],r=[];e.forEach((t,i)=>{mp(t)?(Ch(t).forEach(e=>n.push(r.concat(e))),r.length=0):(r.push(t),mp(e[i+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function Th(e,t){return e[t]}function Eh(e,t,n){return n=n||Th,Oh(t.reduce(function e(t,r){return mp(t)?t.map(t=>e(t,r)):t&&n(t,r)},e))}function Oh(e){return Yd(e)?mp(e)?e.map(Oh):Nh(Object.keys(e).sort(),t=>Eh(e,t)):e}var _h=new ef,Ah=/* @__PURE__ */new WeakMap;function Ih(e){let t=Ah.get(e);return t||Ah.set(e,t={vars:/* @__PURE__ */new Set,dep:Ef()}),t}function zh(e){Ih(e).vars.forEach(t=>t.forgetCache(e))}function Dh(e){const t=/* @__PURE__ */new Set,n=/* @__PURE__ */new Set,r=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(e=>{Ih(e).dep.dirty(r),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)});const i=Array.from(n);n.clear(),i.forEach(t=>t(e))}}else{const e=_h.getValue();e&&(i(e),Ih(e).dep(r))}return e};r.onNextChange=e=>(n.add(e),()=>{n.delete(e)});const i=r.attachCache=e=>(t.add(e),Ih(e).vars.add(r),r);return r.forgetCache=e=>t.delete(e),r}function Mh(e){return void 0!==e.args?e.args:e.field?wd(e.field,e.variables):null}var Ph=()=>{},jh=(e,t)=>t.fieldName,Rh=(e,t,{mergeObjects:n})=>n(e,t),Lh=(e,t)=>t,Fh=(e,t,{streamFieldInfo:n,existingData:r})=>{if(!e&&!r)return t;const i=[],a=e??r,o=n?.isLastChunk?t.length:Math.max(a.length,t.length);for(let s=0;s<o;s++)i[s]=void 0===t[s]?a[s]:t[s];return i},$h=class{config;typePolicies={};toBeAdded={};supertypeMap=/* @__PURE__ */new Map;fuzzySubtypes=/* @__PURE__ */new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(e){this.config=e,this.config={dataIdFromObject:Xf,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,t){const n=this,r=t&&(t.typename||t.storeObject?.__typename)||e.__typename;if(r===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const i=t&&t.storeObject||e,a={...t,typename:r,storeObject:i,readField:t&&t.readField||((...e)=>{const t=Vh(e,i);return n.readField(t,{store:n.cache.data,variables:t.variables})})};let o;const s=r&&this.getTypePolicy(r);let l=s&&s.keyFn||this.config.dataIdFromObject;return gh.withValue(!0,()=>{for(;l;){const t=l({...e,...i},a);if(!mp(t)){o=t;break}l=kh(t)}}),o=o?String(o):void 0,a.keyObject?[o,a.keyObject]:[o]}addTypePolicies(e){Object.keys(e).forEach(t=>{const{queryType:n,mutationType:r,subscriptionType:i,...a}=e[t];n&&this.setRootTypename("Query",t),r&&this.setRootTypename("Mutation",t),i&&this.setRootTypename("Subscription",t),Kf.call(this.toBeAdded,t)?this.toBeAdded[t].push(a):this.toBeAdded[t]=[a]})}updateTypePolicy(e,t,n){const r=this.getTypePolicy(e),{keyFields:i,fields:a}=t;function o(e,t){e.merge="function"==typeof t?t:!0===t?Rh:!1===t?Lh:e.merge}o(r,t.merge),r.keyFn=!1===i?Ph:mp(i)?kh(i):"function"==typeof i?i:r.keyFn,a&&Object.keys(a).forEach(t=>{let r=n[t];r&&r?.typename===e||(r=n[t]={typename:e});const i=a[t];if("function"==typeof i)r.read=i;else{const{keyArgs:e,read:t,merge:n}=i;r.keyFn=!1===e?jh:mp(e)?Sh(e):"function"==typeof e?e:r.keyFn,"function"==typeof t&&(r.read=t),o(r,n)}r.read&&r.merge&&(r.keyFn=r.keyFn||jh)})}setRootTypename(e,t=e){const n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(fd(!r||r===e,108,e),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)}addPossibleTypes(e){this.usingPossibleTypes=!0,Object.keys(e).forEach(t=>{this.getSupertypeSet(t,!0),e[t].forEach(e=>{this.getSupertypeSet(e,!0).add(t);const n=e.match(eh);n&&n[0]===e||this.fuzzySubtypes.set(e,new RegExp(e))})})}getTypePolicy(e){if(!Kf.call(this.typePolicies,e)){const t=this.typePolicies[e]={};t.fields={};let n=this.supertypeMap.get(e);!n&&this.fuzzySubtypes.size&&(n=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((t,r)=>{if(t.test(e)){const e=this.supertypeMap.get(r);e&&e.forEach(e=>n.add(e))}})),n&&n.size&&n.forEach(e=>{const{fields:n,...r}=this.getTypePolicy(e);Object.assign(t,r),Object.assign(t.fields,n)})}const t=this.toBeAdded[e];return t&&t.length&&t.splice(0).forEach(t=>{this.updateTypePolicy(e,t,this.typePolicies[e].fields)}),this.typePolicies[e]}getFieldPolicy(e,t){if(e)return this.getTypePolicy(e).fields[t]}getSupertypeSet(e,t){let n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=/* @__PURE__ */new Set),n}fragmentMatches(e,t,n,r){if(!e.typeCondition)return!0;if(!t)return!1;const i=e.typeCondition.name.value;if(t===i)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(i)){const a=this.getSupertypeSet(t,!0),o=[a],s=e=>{const t=this.getSupertypeSet(e,!1);t&&t.size&&o.indexOf(t)<0&&o.push(t)};let l=!(!n||!this.fuzzySubtypes.size),c=!1;for(let u=0;u<o.length;++u){const d=o[u];if(d.has(i))return a.has(i)||a.add(i),!0;d.forEach(s),l&&u===o.length-1&&nh(e.selectionSet,n,r)&&(l=!1,c=!0,this.fuzzySubtypes.forEach((e,n)=>{const r=t.match(e);r&&r[0]===t&&s(n)}))}}return!1}hasKeyArgs(e,t){const n=this.getFieldPolicy(e,t);return!(!n||!n.keyFn)}getStoreFieldName(e){const{typename:t,fieldName:n}=e,r=this.getFieldPolicy(t,n);let i,a=r&&r.keyFn;if(a&&t){const r={typename:t,fieldName:n,field:e.field||null,variables:e.variables},o=Mh(e);for(;a;){const e=a(o,r);if(!mp(e)){i=e||n;break}a=Sh(e)}}return void 0===i&&(i=e.field?function(e,t){let n=null;e.directives&&(n={},e.directives.forEach(e=>{n[e.name.value]={},e.arguments&&e.arguments.forEach(({name:r,value:i})=>xd(n[e.name.value],r,i,t))}));let r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach(({name:e,value:n})=>xd(r,e,n,t))),dp(e.name.value,r,n)}(e.field,e.variables):dp(n,Mh(e))),!1===i?n:n===th(i)?i:n+":"+i}readField(e,t){const n=e.from;if(!n)return;if(!e.field&&!e.fieldName)return;if(void 0===e.typename){const r=t.store.getFieldValue(n,"__typename");r&&(e.typename=r)}const r=this.getStoreFieldName(e),i=th(r),a=t.store.getFieldValue(n,r),o=this.getFieldPolicy(e.typename,i),s=o&&o.read;if(s){const i=qh(this,n,e,t,t.store.getStorage(Ff(n)?n.__ref:n,r));return _h.withValue(this.cache,s,[a,i])}return a}getReadFunction(e,t){const n=this.getFieldPolicy(e,t);return n&&n.read}getMergeFunction(e,t,n){let r=this.getFieldPolicy(e,t),i=r&&r.merge;return!i&&n&&(r=this.getTypePolicy(n),i=r&&r.merge),i}runMergeFunction(e,t,{field:n,typename:r,merge:i,path:a},o,s){const l=e;if(i===Rh)return Bh(o.store)(e,t);if(i===Lh)return t;o.overwrite&&(e=void 0);const c=o.extensions?.[Wp]?.deref()?.peekArray(a);if(c){const{current:e,previous:n}=c;if(n&&Mp(n.incoming,t)&&Mp(n.streamFieldInfo,e))return n.result}const u=i(e,t,function(e,t,n,r,i,a){const o={...qh(e,void 0,n,r,i),extensions:r.extensions,existingData:a},s=r.extensions;if(s&&Wp in s){const{[Wp]:e,...t}=s,r=e?.deref()?.peekArray(n.path);r&&(o.streamFieldInfo=r.current),o.extensions=0===Object.keys(t).length?void 0:t}return o}(this,0,{typename:r,fieldName:n.name.value,field:n,variables:o.variables,path:a},o,s||{},l));return c&&(c.previous={incoming:t,streamFieldInfo:c.current,result:u}),u}};function qh(e,t,n,r,i){const a=e.getStoreFieldName(n),o=th(a),s=n.variables||r.variables,{toReference:l,canRead:c}=r.store;return{args:Mh(n),field:n.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:Ff,toReference:l,storage:i,cache:e.cache,canRead:c,readField:(...n)=>e.readField(Vh(n,t,s),r),mergeObjects:Bh(r.store)}}function Vh(e,t,n){const{0:r,1:i,length:a}=e;let o;return"string"==typeof r?o={fieldName:r,from:a>1?i:t}:(o={...r},Kf.call(o,"from")||(o.from=t)),void 0===o.variables&&(o.variables=n),o}function Bh(e){return function(t,n){if(mp(t)||mp(n))throw md(111);if(Yd(t)&&Yd(n)){const r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(Ff(t)&&rh(n))return e.merge(t.__ref,n),t;if(rh(t)&&Ff(n))return e.merge(t,n.__ref),n;if(rh(t)&&rh(n))return{...t,...n}}return n}}function Uh(e){return[e.selectionSet,e.objectOrReference,e.context]}var Hh=class{executeSelectionSet;executeSubSelectedArray;config;knownResults=/* @__PURE__ */new WeakMap;constructor(e){this.config=e,this.executeSelectionSet=Af(e=>{const t=Uh(e);return this.executeSelectionSet.peek(...t)||(dh(e.context.store,e.enclosingRef.__ref),this.execSelectionSetImpl(e))},{max:Sd["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Uh,makeCacheKey(e,t,n){if(mh(n.store))return n.store.makeCacheKey(e,Ff(t)?t.__ref:t,n.varString)}}),this.executeSubSelectedArray=Af(e=>(dh(e.context.store,e.enclosingRef.__ref),this.execSubSelectedArrayImpl(e)),{max:Sd["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:e,array:t,context:n}){if(mh(n.store))return n.store.makeCacheKey(e,t,n.varString)}})}diffQueryAgainstStore({store:e,query:t,rootId:n="ROOT_QUERY",variables:r,returnPartialData:i=!0}){const a=this.config.cache.policies;r={...Xd(ip(t)),...r};const o=bp(n),s=this.executeSelectionSet({selectionSet:np(t).selectionSet,objectOrReference:o,enclosingRef:o,context:{store:e,query:t,policies:a,variables:r,varString:op(r),...ih(t,this.config.fragments)}});let l;s.missing&&(l=new Jf(function(e){try{JSON.stringify(e,(e,t)=>{if("string"==typeof t)throw t;return t})}catch(u){return u}}(s.missing),s.missing,t,r));const c=!l,{result:u}=s;return{result:c?u:i?0===Object.keys(u).length?null:u:null,complete:c,missing:l}}isFresh(e,t,n,r){if(mh(r.store)&&this.knownResults.get(e)===n){const i=this.executeSelectionSet.peek(n,t,r);if(i&&e===i.result)return!0}return!1}execSelectionSetImpl({selectionSet:e,objectOrReference:t,enclosingRef:n,context:r}){if(Ff(t)&&!r.policies.rootTypenamesById[t.__ref]&&!r.store.has(t.__ref))return{result:{},missing:`Dangling reference to missing ${t.__ref} object`};const{variables:i,policies:a,store:o}=r,s=o.getFieldValue(t,"__typename"),l=[];let c;const u=new Kd;function d(e,t){return e.missing&&(c=u.merge(c,{[t]:e.missing})),e.result}"string"!=typeof s||a.rootIdsByTypename[s]||l.push({__typename:s});const p=new Set(e.selections);p.forEach(e=>{if(Ep(e,i))if(gp(e)){let i=a.readField({fieldName:e.name.value,field:e,variables:r.variables,from:t},r);const o=Tp(e);void 0===i?qf.added(e)||(c=u.merge(c,{[o]:`Can't find field '${e.name.value}' on ${Ff(t)?t.__ref+" object":"object "+JSON.stringify(t,null,2)}`})):mp(i)?i.length>0&&(i=d(this.executeSubSelectedArray({field:e,array:i,enclosingRef:n,context:r}),o)):e.selectionSet&&null!=i&&(i=d(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:i,enclosingRef:Ff(i)?i:n,context:r}),o)),void 0!==i&&l.push({[o]:i})}else{const t=Zd(e,r.lookupFragment);if(!t&&"FragmentSpread"===e.kind)throw md(112,e.name.value);t&&a.fragmentMatches(t,s)&&t.selectionSet.selections.forEach(p.add,p)}});const f={result:vp(l),missing:c};return f.result&&this.knownResults.set(f.result,e),f}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:n,context:r}){let i,a=new Kd;function o(e,t){return e.missing&&(i=a.merge(i,{[t]:e.missing})),e.result}return e.selectionSet&&(t=t.filter(e=>void 0===e||r.store.canRead(e))),t=t.map((t,i)=>null===t?null:mp(t)?o(this.executeSubSelectedArray({field:e,array:t,enclosingRef:n,context:r}),i):e.selectionSet?o(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:t,enclosingRef:Ff(t)?t:n,context:r}),i):t),{result:t,missing:i}}};function Wh(e,t,n){const r=`${t}${n}`;let i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:{...e,clientOnly:t,deferred:n}),i}var Yh=class{cache;reader;fragments;constructor(e,t,n){this.cache=e,this.reader=t,this.fragments=n}writeToStore(e,{query:t,result:n,dataId:r,variables:i,overwrite:a,extensions:o}){const s=rp(t),l=new Kd;i={...Xd(s),...i};const c={store:e,written:{},merge:(e,t)=>l.merge(e,t),variables:i,varString:op(i),...ih(t,this.fragments),overwrite:!!a,incomingById:/* @__PURE__ */new Map,clientOnly:!1,deferred:!1,flavors:/* @__PURE__ */new Map,extensions:o},u=this.processSelectionSet({result:n||{},dataId:r,selectionSet:s.selectionSet,mergeTree:{map:/* @__PURE__ */new Map},context:c,path:[]});if(!Ff(u))throw md(114,n);return c.incomingById.forEach(({storeObject:t,mergeTree:n,fieldNodeSet:r},i)=>{const a=bp(i);if(n&&n.map.size){const e=this.applyMerges(n,a,t,c);if(Ff(e))return;t=e}e.merge(i,t)}),e.retain(u.__ref),u}processSelectionSet({dataId:e,result:t,selectionSet:n,context:r,mergeTree:i,path:a}){const{policies:o}=this.cache;let s={};const l=e&&o.rootTypenamesById[e]||Zh(t,n,r.fragmentMap)||e&&r.store.get(e,"__typename");"string"==typeof l&&(s.__typename=l);const c=(...e)=>{const t=Vh(e,s,r.variables);if(Ff(t.from)){const e=r.incomingById.get(t.from.__ref);if(e){const n=o.readField({...t,from:e.storeObject},r);if(void 0!==n)return n}}return o.readField(t,r)},u=/* @__PURE__ */new Set;this.flattenFields(n,t,r,l).forEach((e,n)=>{const r=t[Tp(n)],d=[...a,n.name.value];if(u.add(n),void 0!==r){const t=o.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),a=Qh(i,t);let u,p=this.processFieldValue(r,n,n.selectionSet?Wh(e,!1,!1):e,a,d);n.selectionSet&&(Ff(p)||rh(p))&&(u=c("__typename",p));const f=o.getMergeFunction(l,n.name.value,u);f?a.info={field:n,typename:l,merge:f,path:d}:e.extensions?.[Wp]&&Array.isArray(p)&&function(e){return!!e.directives&&e.directives.some(e=>"stream"===e.name.value)}(n)?a.info={field:n,typename:l,merge:Fh,path:d}:Xh(i,t),s=e.merge(s,{[t]:p})}});try{const[i,a]=o.identify(t,{typename:l,selectionSet:n,fragmentMap:r.fragmentMap,storeObject:s,readField:c});e=e||i,a&&(s=r.merge(s,a))}catch(NL){if(!e)throw NL}if("string"==typeof e){const a=bp(e),o=r.written[e]||(r.written[e]=[]);if(o.indexOf(n)>=0)return a;if(o.push(n),this.reader&&this.reader.isFresh(t,a,n,r))return a;const l=r.incomingById.get(e);return l?(l.storeObject=r.merge(l.storeObject,s),l.mergeTree=Jh(l.mergeTree,i),u.forEach(e=>l.fieldNodeSet.add(e))):r.incomingById.set(e,{storeObject:s,mergeTree:Kh(i)?void 0:i,fieldNodeSet:u}),a}return s}processFieldValue(e,t,n,r,i){return t.selectionSet&&null!==e?mp(e)?e.map((e,a)=>{const o=this.processFieldValue(e,t,n,Qh(r,a),[...i,a]);return Xh(r,a),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r,path:i}):e}flattenFields(e,t,n,r=Zh(t,e,n.fragmentMap)){const i=/* @__PURE__ */new Map,{policies:a}=this.cache,o=new _d(!1);return function e(s,l){const c=o.lookup(s,l.clientOnly,l.deferred);c.visited||(c.visited=!0,s.selections.forEach(o=>{if(!Ep(o,n.variables))return;let{clientOnly:s,deferred:c}=l;if(s&&c||!yp(o.directives)||o.directives.forEach(e=>{const t=e.name.value;if("client"===t&&(s=!0),"defer"===t){const t=wd(e,n.variables);t&&!1===t.if||(c=!0)}}),gp(o)){const e=i.get(o);e&&(s=s&&e.clientOnly,c=c&&e.deferred),i.set(o,Wh(n,s,c))}else{const i=Zd(o,n.lookupFragment);if(!i&&"FragmentSpread"===o.kind)throw md(116,o.name.value);i&&a.fragmentMatches(i,r,t,n.variables)&&e(i.selectionSet,Wh(n,s,c))}}))}(e,n),i}applyMerges(e,t,n,r,i){if(e.map.size&&!Ff(n)){const a=mp(n)||!Ff(t)&&!rh(t)?void 0:t,o=n;let s;a&&!i&&(i=[Ff(a)?a.__ref:a]);const l=(e,t)=>mp(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t));e.map.forEach((e,t)=>{const n=l(a,t),c=l(o,t);if(void 0===c)return;i&&i.push(t);const u=this.applyMerges(e,n,c,r,i);u!==c&&(s=s||/* @__PURE__ */new Map,s.set(t,u)),i&&fd(i.pop()===t)}),s&&(n=mp(o)?o.slice(0):{...o},s.forEach((e,t)=>{n[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&r.store.getStorage(...i)):n}},Gh=[];function Qh({map:e},t){return e.has(t)||e.set(t,Gh.pop()||{map:/* @__PURE__ */new Map}),e.get(t)}function Jh(e,t){if(e===t||!t||Kh(t))return e;if(!e||Kh(e))return t;const n=e.info&&t.info?{...e.info,...t.info}:e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?/* @__PURE__ */new Map:e.map.size?e.map:t.map};if(r){const n=new Set(t.map.keys());e.map.forEach((e,r)=>{i.map.set(r,Jh(e,t.map.get(r))),n.delete(r)}),n.forEach(n=>{i.map.set(n,Jh(t.map.get(n),e.map.get(n)))})}return i}function Kh(e){return!e||!(e.info||e.map.size)}function Xh({map:e},t){const n=e.get(t);n&&Kh(n)&&(Gh.push(n),e.delete(t))}function Zh(e,t,n){let r;for(const i of t.selections)if(gp(i)){if("__typename"===i.name.value)return e[Tp(i)]}else r?r.push(i):r=[i];if("string"==typeof e.__typename)return e.__typename;if(r)for(const i of r){const t=Zh(e,Zd(i,n).selectionSet,n);if("string"==typeof t)return t}}var em=class extends Hf{data;optimisticData;config;watches=/* @__PURE__ */new Set;storeReader;storeWriter;addTypenameTransform=new Rf(qf);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=Dh;constructor(e={}){super(),this.config=function(e){return Hd(Zf,e)}(e),this.policies=new $h({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const e=this.data=new lh.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()}resetResultCache(){const{fragments:e}=this.config;this.addTypenameTransform.resetCache(),e?.resetCaches(),this.storeWriter=new Yh(this,this.storeReader=new Hh({cache:this,fragments:e}),e),this.maybeBroadcastWatch=Af((e,t)=>this.broadcastWatch(e,t),{max:Sd["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:e=>{const t=e.optimistic?this.optimisticData:this.data;if(mh(t)){const{optimistic:n,id:r,variables:i}=e;return t.makeCacheKey(e.query,e.callback,op({optimistic:n,id:r,variables:i}))}}}),
|
|
7
|
+
return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Du,Mu="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Pu(e){return qc(null==e?void 0:e[Mu])}function ju(e){return function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){i[e]&&(r[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||s(e,t)})},t&&(r[e]=t(r[e])))}function s(e,t){try{!function(e){e.value instanceof $c?Promise.resolve(e.value.v).then(l,c):u(a[0][2],e)}(i[e](t))}catch(NL){u(a[0][3],NL)}}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}(this,arguments,function(){var t,n,r;return jc(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,$c(t.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,$c(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,$c(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function Ru(e){return qc(null==e?void 0:e.getReader)}function Lu(e){if(e instanceof cu)return e;if(null!=e){if(Au(e))return i=e,new cu(function(e){var t=i[su]();if(qc(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")});if(Ou(e))return r=e,new cu(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()});if(_u(e))return n=e,new cu(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Jc)});if(Iu(e))return Fu(e);if(Pu(e))return t=e,new cu(function(e){var n,r;try{for(var i=Rc(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()});if(Ru(e))return Fu(ju(e))}var t,n,r,i;throw zu(e)}function Fu(e){return new cu(function(t){(function(e,t){var n,r,i,a;return function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{l(r.next(e))}catch(NL){a(NL)}}function s(e){try{l(r.throw(e))}catch(NL){a(NL)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function(){var o,s;return jc(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Rc(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){!function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}(r,i,(t=e[n](t)).done,t.value)})}}}(e),l.label=1;case 1:return[4,n.next()];case 2:if((r=l.sent()).done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),i={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}function $u(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function qu(e,t){return void 0===t&&(t=0),du(function(n,r){n.subscribe(pu(r,function(n){return $u(r,e,function(){return r.next(n)},t)},function(){return $u(r,e,function(){return r.complete()},t)},function(n){return $u(r,e,function(){return r.error(n)},t)}))})}function Vu(e,t){return void 0===t&&(t=0),du(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function Bu(e,t){if(!e)throw new Error("Iterable cannot be null");return new cu(function(n){$u(n,t,function(){var r=e[Symbol.asyncIterator]();$u(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function Uu(e,t){return t?function(e,t){if(null!=e){if(Au(e))return function(e,t){return Lu(e).pipe(Vu(t),qu(t))}(e,t);if(Ou(e))return function(e,t){return new cu(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}(e,t);if(_u(e))return function(e,t){return Lu(e).pipe(Vu(t),qu(t))}(e,t);if(Iu(e))return Bu(e,t);if(Pu(e))return function(e,t){return new cu(function(n){var r;return $u(n,t,function(){r=e[Mu](),$u(n,t,function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(a){return void n.error(a)}i?n.complete():n.next(t)},0,!0)}),function(){return qc(null==r?void 0:r.return)&&r.return()}})}(e,t);if(Ru(e))return function(e,t){return Bu(ju(e),t)}(e,t)}throw zu(e)}(e,t):Lu(e)}function Hu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Uu(e,Eu(e))}function Wu(e,t){var n=qc(e)?e:function(){return e},r=function(e){return e.error(n())};return new cu(t?function(e){return t.schedule(r,0,e)}:r)}!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(Du||(Du={}));var Yu=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){return function(e,t){var n,r,i,a=e,o=a.kind,s=a.value,l=a.error;if("string"!=typeof o)throw new TypeError('Invalid notification, missing "kind"');"N"===o?null===(n=t.next)||void 0===n||n.call(t,s):"E"===o?null===(r=t.error)||void 0===r||r.call(t,l):null===(i=t.complete)||void 0===i||i.call(t)}(this,e)},e.prototype.do=function(e,t,n){var r=this,i=r.kind,a=r.value,o=r.error;return"N"===i?null==e?void 0:e(a):"E"===i?null==t?void 0:t(o):null==n?void 0:n()},e.prototype.accept=function(e,t,n){var r;return qc(null===(r=e)||void 0===r?void 0:r.next)?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){var e=this,t=e.kind,n=e.value,r=e.error,i="N"===t?Hu(n):"E"===t?Wu(function(){return r}):"C"===t?Cu:0;if(!i)throw new TypeError("Unexpected notification kind "+t);return i},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();Vc(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Gu(e,t){return du(function(n,r){var i=0;n.subscribe(pu(r,function(n){r.next(e.call(t,n,i++))}))})}function Qu(e,t,n){return void 0===n&&(n=1/0),qc(t)?Qu(function(n,r){return Gu(function(e,i){return t(n,e,r,i)})(Lu(e(n,r)))},n):("number"==typeof t&&(n=t),du(function(t,r){return function(e,t,n,r){var i=[],a=0,o=0,s=!1,l=function(){!s||i.length||a||t.complete()},c=function(e){return a<r?u(e):i.push(e)},u=function(e){a++;var s=!1;Lu(n(e,o++)).subscribe(pu(t,function(e){t.next(e)},function(){s=!0},void 0,function(){if(s)try{a--;for(var e=function(){var e=i.shift();u(e)};i.length&&a<r;)e();l()}catch(n){t.error(n)}}))};return e.subscribe(pu(t,c,function(){s=!0,l()})),function(){}}(t,r,e,n)}))}function Ju(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(void 0===(n=1)&&(n=1/0),Qu(lu,n))(Uu(e,Eu(e)));var n}function Ku(e,t){return du(function(n,r){var i=0;n.subscribe(pu(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function Xu(e){return du(function(t,n){var r,i=null,a=!1;i=t.subscribe(pu(n,void 0,void 0,function(o){r=Lu(e(o,Xu(e)(t))),i?(i.unsubscribe(),i=null,r.subscribe(n)):a=!0})),a&&(i.unsubscribe(),i=null,r.subscribe(n))})}function Zu(e,t){return e===t}function ed(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new mu}:t,r=e.resetOnError,i=void 0===r||r,a=e.resetOnComplete,o=void 0===a||a,s=e.resetOnRefCountZero,l=void 0===s||s;return function(e){var t,r,a,s=0,c=!1,u=!1,d=function(){null==r||r.unsubscribe(),r=void 0},p=function(){d(),t=a=void 0,c=u=!1},f=function(){var e=t;p(),null==e||e.unsubscribe()};return du(function(e,h){s++,u||c||d();var m=a=null!=a?a:n();h.add(function(){0!==--s||u||c||(r=td(f,l))}),m.subscribe(h),!t&&s>0&&(t=new ru({next:function(e){return m.next(e)},error:function(e){u=!0,d(),r=td(p,i,e),m.error(e)},complete:function(){c=!0,d(),r=td(p,o),m.complete()}}),Lu(e).subscribe(t))})(e)}}function td(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0!==t){if(!1!==t){var i=new ru({next:function(){i.unsubscribe(),e()}});return Lu(t.apply(void 0,Fc([],Lc(n)))).subscribe(i)}}else e()}function nd(e,t,n){var r,i,a,o,s=!1;return e&&"object"==typeof e?(r=e.bufferSize,o=void 0===r?1/0:r,i=e.windowTime,t=void 0===i?1/0:i,s=void 0!==(a=e.refCount)&&a,n=e.scheduler):o=null!=e?e:1/0,ed({connector:function(){return new vu(o,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}function rd(e,t,n){var r=qc(e)||t||n?{next:e,error:t,complete:n}:e;return r?du(function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var i=!0;e.subscribe(pu(t,function(e){var n;null===(n=r.next)||void 0===n||n.call(r,e),t.next(e)},function(){var e;i=!1,null===(e=r.complete)||void 0===e||e.call(r),t.complete()},function(e){var n;i=!1,null===(n=r.error)||void 0===n||n.call(r,e),t.error(e)},function(){var e,t;i&&(null===(e=r.unsubscribe)||void 0===e||e.call(r)),null===(t=r.finalize)||void 0===t||t.call(r)}))}):lu}function id(e){try{return e()}catch{}}var ad=id(()=>globalThis)||id(()=>window)||id(()=>self)||id(()=>global)||id(function(){return id.constructor("return this")()}),od="4.2.8",sd=/* @__PURE__ */new Map;function ld(e){const t=sd.get(e)||1;return sd.set(e,t+1),`${e}:${t}:${Math.random().toString(36).slice(2)}`}var cd="Invariant Violation",ud=class e extends Error{constructor(t=cd){super(t),this.name=cd,Object.setPrototypeOf(this,e.prototype)}},dd=["debug","log","warn","error","silent"],pd=dd.indexOf("silent");function fd(e,...t){if(!e)throw md(...t)}function hd(e){return function(t,...n){if(dd.indexOf(e)>=pd){const r=console[e]||console.log;if("number"==typeof t){const e=t;(t=bd(e))||(t=vd(e,n),n=[])}r(t,...n)}}}function md(e,...t){return new ud(bd(e,t)||vd(e,t))}fd.debug=hd("debug"),fd.log=hd("log"),fd.warn=hd("warn"),fd.error=hd("error");var gd=Symbol.for("ApolloErrorMessageHandler_"+od);function yd(e){if("string"==typeof e)return e;try{return function(e,t=0){const n=ld("stringifyForDisplay");return JSON.stringify(e,(e,t)=>void 0===t?n:t,t).split(JSON.stringify(n)).join("<undefined>")}(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function bd(e,t=[]){if(e)return ad[gd]&&ad[gd](e,t.map(yd))}function vd(e,t=[]){if(e)return"string"==typeof e?t.reduce((e,t)=>e.replace(/%[sdfo]/,yd(t)),e):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:od,message:e,args:t.map(yd)}))}`}function xd(e,t,n,r){if("IntValue"===n.kind||"FloatValue"===n.kind)e[t.value]=Number(n.value);else if("BooleanValue"===n.kind||"StringValue"===n.kind)e[t.value]=n.value;else if("ObjectValue"===n.kind){const i={};n.fields.map(e=>xd(i,e.name,e.value,r)),e[t.value]=i}else if("Variable"===n.kind){const i=(r||{})[n.name.value];e[t.value]=i}else if("ListValue"===n.kind)e[t.value]=n.values.map(e=>{const n={};return xd(n,t,e,r),n[t.value]});else if("EnumValue"===n.kind)e[t.value]=n.value;else{if("NullValue"!==n.kind)throw md(19,t.value,n.kind);e[t.value]=null}}function wd(e,t){if(e.arguments&&e.arguments.length){const n={};return e.arguments.forEach(({name:e,value:r})=>xd(n,e,r,t)),n}return null}var kd=Symbol.for("apollo.cacheSize"),Sd={...ad[kd]};function Nd(e,t){return e.definitions.find(e=>"OperationDefinition"===e.kind&&!!e.name)?.name.value??t}var Cd=()=>Object.create(null),{forEach:Td,slice:Ed}=Array.prototype,{hasOwnProperty:Od}=Object.prototype,_d=class e{constructor(e=!0,t=Cd){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Td.call(e,e=>t=t.getChildTrie(e)),Od.call(t,"data")?t.data:t.data=this.makeData(Ed.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){const r=t.mapFor(e[n],!1);t=r&&r.get(e[n])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const n=e[0],r=this.mapFor(n,!1),i=r&&r.get(n);i&&(t=i.removeArray(Ed.call(e,1)),i.data||i.weak||i.strong&&i.strong.size||r.delete(n))}else t=this.data,delete this.data;return t}getChildTrie(t){const n=this.mapFor(t,!0);let r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r}mapFor(e,t){return this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(e)?this.weak||(t?this.weak=/* @__PURE__ */new WeakMap:void 0):this.strong||(t?this.strong=/* @__PURE__ */new Map:void 0)}};function Ad(){}var Id=class{constructor(e=1/0,t=Ad){this.max=e,this.dispose=t,this.map=/* @__PURE__ */new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}};function zd(){}var Dd=zd,Md="undefined"!=typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},Pd="undefined"!=typeof WeakMap?WeakMap:Map,jd="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:zd,unregister:zd}},Rd=class{constructor(e=1/0,t=Dd){this.max=e,this.dispose=t,this.map=new Pd,this.newest=null,this.oldest=null,this.unfinalizedNodes=/* @__PURE__ */new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const e=this.unfinalizedNodes.values();for(let t=0;t<10024;t++){const t=e.next().value;if(!t)break;this.unfinalizedNodes.delete(t);const n=t.key;delete t.key,t.keyRef=new Md(n),this.registry.register(n,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new jd(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}},Ld=/* @__PURE__ */new WeakSet;function Fd(e){e.size<=(e.max||-1)||Ld.has(e)||(Ld.add(e),setTimeout(()=>{e.clean(),Ld.delete(e)},100))}var $d=function(e,t){const n=new Rd(e,t);return n.set=function(e,t){const n=Rd.prototype.set.call(this,e,t);return Fd(this),n},n},qd=function(e,t){const n=new Id(e,t);return n.set=function(e,t){const n=Id.prototype.set.call(this,e,t);return Fd(this),n},n};function Vd(e,{max:t,makeCacheKey:n=e=>e}){const r=new _d(!0),i=new $d(t);return(...t)=>{const a=r.lookupArray(n(t)),o=i.get(a);if(o){if(o.error)throw o.error;return o.result}const s=i.set(a,{});try{return s.result=e(...t)}catch(l){throw s.error=l,l}}}var Bd=Vd((e,t)=>{fd(e&&"Document"===e.kind,1);const n=e.definitions.filter(e=>"OperationDefinition"===e.kind);t&&fd(1==n.length&&n[0].operation===t,4,t,t,n[0].operation),_l(e,{Field(t,r,i,a){if(t.alias&&("__typename"===t.alias.value||t.alias.value.startsWith("__ac_"))&&t.alias.value!==t.name.value){let r=e,i=[];for(const e of a)r=r[e],"Field"===r.kind&&i.push(r.alias?.value||r.name.value);throw i.splice(-1,1,t.name.value),md(5,t.alias.value,i.join("."),n[0].operation,Nd(e,"(anonymous)"))}}})},{max:Sd.checkDocument||2e3}),{toString:Ud}=Object.prototype;function Hd(...e){const t={};return e.forEach(e=>{e&&Reflect.ownKeys(e).forEach(n=>{const r=e[n];void 0!==r&&(t[n]=r)})}),t}function Wd(e=[]){const t={};return e.forEach(e=>{t[e.name.value]=e}),t}function Yd(e){return null!==e&&"object"==typeof e}var{hasOwnProperty:Gd}=Object.prototype,Qd=function(e,t,n){return this.merge(e[n],t[n])},Jd=e=>isNaN(+e)?{}:[],Kd=class{options;reconciler;constructor(e={}){this.options=e,this.reconciler=e.reconciler||Qd}merge(e,t,n={}){const r=n.atPath;if(r?.length){const[i,...a]=r;void 0===e&&(e=Jd(i));let o=e[i];void 0===o&&a.length&&(o=Jd(a[0]));const s=this.merge(o,t,{...n,atPath:a});return o!==s&&((e=this.shallowCopyForMerge(e))[i]=s),e}return Array.isArray(e)&&Array.isArray(t)&&"truncate"===this.options.arrayMerge&&e.length>t.length&&(e=e.slice(0,t.length),this.pastCopies.add(e)),Yd(t)&&Yd(e)?(Object.keys(t).forEach(n=>{if(Gd.call(e,n)){const r=e[n];if(t[n]!==r){const i=this.reconciler(e,t,n);i!==r&&((e=this.shallowCopyForMerge(e))[n]=i)}}else(e=this.shallowCopyForMerge(e))[n]=t[n]}),e):t}isObject=Yd;pastCopies=/* @__PURE__ */new Set;shallowCopyForMerge(e){return Yd(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):{__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}};function Xd(e){const t={},n=e&&e.variableDefinitions;return n&&n.length&&n.forEach(e=>{e.defaultValue&&xd(t,e.variable.name,e.defaultValue)}),t}function Zd(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{const n=e.name.value;if("function"==typeof t)return t(n);const r=t&&t[n];return fd(r,9,n),r||null}default:return null}}function ep(e,t){let n=t;const r=[];return e.definitions.forEach(e=>{if("OperationDefinition"===e.kind)throw md(10,e.operation,e.name?` named '${e.name.value}'`:"");"FragmentDefinition"===e.kind&&r.push(e)}),void 0===n&&(fd(1===r.length,11,r.length),n=r[0].name.value),{...e,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}},...e.definitions]}}function tp(e){return e.definitions.filter(e=>"FragmentDefinition"===e.kind)}function np(e){let t;Bd(e);for(let n of e.definitions){if("OperationDefinition"===n.kind)return n;"FragmentDefinition"!==n.kind||t||(t=n)}if(t)return t;throw md(12)}function rp(e){return Bd(e),e.definitions.filter(e=>"OperationDefinition"===e.kind)[0]}function ip(e){const t=rp(e);return fd(t&&"query"===t.operation,13),t}var ap,op=Object.assign(function(e){return JSON.stringify(e,sp)},{reset(){ap=new qd(Sd.canonicalStringify||1e3)}});function sp(e,t){if(t&&"object"==typeof t){const e=Object.getPrototypeOf(t);if(e===Object.prototype||null===e){const n=Object.keys(t);if(n.every(lp))return t;const r=JSON.stringify(n);let i=ap.get(r);if(!i){n.sort();const e=JSON.stringify(n);i=ap.get(e)||n,ap.set(r,i),ap.set(e,i)}const a=Object.create(e);return i.forEach(e=>{a[e]=t[e]}),a}}return t}function lp(e,t,n){return 0===t||n[t-1]<=e}op.reset();var cp=["connection","include","skip","client","rest","export","nonreactive","stream"],up=op,dp=Object.assign(function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){const e=n.connection.filter?n.connection.filter:[];e.sort();const r={};e.forEach(e=>{r[e]=t[e]});const i=up(r);if("{}"!==i)return`${n.connection.key}(${i})`}return n.connection.key}let r=e;if(t){const e=up(t);"{}"!==e&&(r+=`(${e})`)}return n&&Object.keys(n).forEach(e=>{-1===cp.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?r+=`@${e}(${up(n[e])})`:r+=`@${e}`)}),r},{setStringify(e){const t=up;return up=e,t}});function pp(e){return!!e.errors?.length}function fp(e,t,n){const r=new Set(e),i=r.size;return _l(t,{Directive(e){if(r.delete(e.name.value)&&(!n||!r.size))return Ol}}),n?!r.size:r.size<i}function hp(e){let t=!1;return _l(e,{Directive:{enter(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(e=>"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value),t))return Ol}}}),t}var mp=Array.isArray;function gp(e){return"Field"===e.kind}function yp(e){return Array.isArray(e)&&e.length>0}function bp(e){return{__ref:String(e)}}function vp(e){let t=e[0]||{};const n=e.length;if(n>1){const r=new Kd;for(let i=1;i<n;++i)t=r.merge(t,e[i])}return t}function xp(e,t){return Hd(e,t,t.variables&&{variables:Hd({...e&&e.variables,...t.variables})})}function wp(e){return e.catch(()=>{}),e}function kp(e,t){Bd(t);const n=Sp(""),r=Sp(""),i=e=>{for(let t,i=0;i<e.length&&(t=e[i]);++i)if(!mp(t)){if("OperationDefinition"===t.kind)return n(t.name&&t.name.value);if("FragmentDefinition"===t.kind)return r(t.name.value)}return fd.error(14),null};let a=0;for(let m=t.definitions.length-1;m>=0;--m)"OperationDefinition"===t.definitions[m].kind&&++a;const o=function(e){const t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;return e.forEach(e=>{e&&(e.name?t.set(e.name,e):e.test&&n.set(e.test,e))}),e=>{let r=t.get(e.name.value);return!r&&n.size&&n.forEach((t,n)=>{n(e)&&(r=t)}),r}}(e),s=e=>yp(e)&&e.map(o).some(e=>e&&e.remove),l=/* @__PURE__ */new Map;let c=!1;const u={enter(e){if(s(e.directives))return c=!0,null}},d=_l(t,{Field:u,InlineFragment:u,VariableDefinition:{enter:()=>!1},Variable:{enter(e,t,n,r,a){const o=i(a);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter(e,t,n,r,a){if(s(e.directives))return c=!0,null;const o=i(a);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter(e,t,n,r){l.set(JSON.stringify(r),e)},leave:(e,t,n,i)=>e===l.get(JSON.stringify(i))?e:a>0&&e.selectionSet.selections.every(e=>"Field"===e.kind&&"__typename"===e.name.value)?(r(e.name.value).removed=!0,c=!0,null):void 0},Directive:{leave(e){if(o(e))return c=!0,null}}});if(!c)return t;const p=e=>(e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach(t=>{p(r(t)).transitiveVars.forEach(t=>{e.transitiveVars.add(t)})})),e),f=/* @__PURE__ */new Set;d.definitions.forEach(e=>{"OperationDefinition"===e.kind?p(n(e.name&&e.name.value)).fragmentSpreads.forEach(e=>{f.add(e)}):"FragmentDefinition"!==e.kind||0!==a||r(e.name.value).removed||f.add(e.name.value)}),f.forEach(e=>{p(r(e)).fragmentSpreads.forEach(e=>{f.add(e)})});const h={enter(e){if(t=e.name.value,!f.has(t)||r(t).removed)return null;var t}};return function(e){return Np(rp(e)||function(e){fd("Document"===e.kind,6),fd(e.definitions.length<=1,7);const t=e.definitions[0];return fd("FragmentDefinition"===t.kind,8),t}(e),Wd(tp(e)))?null:e}(_l(d,{FragmentSpread:h,FragmentDefinition:h,OperationDefinition:{leave(e){if(e.variableDefinitions){const t=p(n(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return{...e,variableDefinitions:e.variableDefinitions.filter(e=>t.has(e.variable.name.value))}}}}}))}function Sp(e){const t=/* @__PURE__ */new Map;return function(n=e){let r=t.get(n);return r||t.set(n,r={variables:/* @__PURE__ */new Set,fragmentSpreads:/* @__PURE__ */new Set}),r}}function Np(e,t){return!e||e.selectionSet.selections.every(e=>"FragmentSpread"===e.kind&&Np(t[e.name.value],t))}function Cp(e){return _l(e,{FragmentSpread(e){if(!e.directives?.some(({name:e})=>"unmask"===e.value))return null}})}function Tp(e){return e.alias?e.alias.value:e.name.value}function Ep({directives:e},t){return!e||!e.length||function(e){const t=[];return e&&e.length&&e.forEach(e=>{if(!function({name:{value:e}}){return"skip"===e||"include"===e}(e))return;const n=e.arguments,r=e.name.value;fd(n&&1===n.length,16,r);const i=n[0];fd(i.name&&"if"===i.name.value,17,r);const a=i.value;fd(a&&("Variable"===a.kind||"BooleanValue"===a.kind),18,r),t.push({directive:e,ifArgument:i})}),t}(e).every(({directive:e,ifArgument:n})=>{let r=!1;return"Variable"===n.value.kind?(r=t&&t[n.value.name.value],fd(void 0!==r,15,e.name.value)):r=n.value.value,"skip"===e.name.value?!r:r})}function Op(e){const t={data:e.data};return e.error&&(t.error=e.error),t}function _p(e,t=()=>{}){return n=>new cu(r=>{let i=t();return n.subscribe({next(t){let n;try{n=e(t,i)}catch(NL){r.error(NL)}void 0!==n&&r.next(n)},error(e){r.error(e)},complete(){r.complete()}})})}var{toString:Ap,hasOwnProperty:Ip}=Object.prototype,zp=Function.prototype.toString,Dp=/* @__PURE__ */new Map;function Mp(e,t){try{return Pp(e,t)}finally{Dp.clear()}}function Pp(e,t){if(e===t)return!0;const n=Ap.call(e);if(n!==Ap.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(Fp(e,t))return!0;const n=jp(e),r=jp(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!Ip.call(t,n[e]))return!1;for(let a=0;a<i;++a){const r=n[a];if(!Pp(e[r],t[r]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e===+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(Fp(e,t))return!0;const r=e.entries(),i="[object Map]"===n;for(;;){const e=r.next();if(e.done)break;const[n,a]=e.value;if(!t.has(n))return!1;if(i&&!Pp(a,t.get(n)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let n=e.byteLength;if(n===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const n=zp.call(e);return n===zp.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,Lp)}}return!1}function jp(e){return Object.keys(e).filter(Rp,e)}function Rp(e){return void 0!==this[e]}var Lp="{ [native code] }";function Fp(e,t){let n=Dp.get(e);if(n){if(n.has(t))return!0}else Dp.set(e,n=/* @__PURE__ */new Set);return n.add(t),!1}function $p(e,{data:t,...n},{data:r,...i},a){return Mp(n,i)&&qp(np(e).selectionSet,t,r,{fragmentMap:Wd(tp(e)),variables:a})}function qp(e,t,n,r){if(t===n)return!0;const i=/* @__PURE__ */new Set;return e.selections.every(e=>{if(i.has(e))return!0;if(i.add(e),!Ep(e,r.variables))return!0;if(Vp(e))return!0;if(gp(e)){const i=Tp(e),a=t&&t[i],o=n&&n[i],s=e.selectionSet;if(!s)return Mp(a,o);const l=Array.isArray(a),c=Array.isArray(o);if(l!==c)return!1;if(l&&c){const e=a.length;if(o.length!==e)return!1;for(let t=0;t<e;++t)if(!qp(s,a[t],o[t],r))return!1;return!0}return qp(s,a,o,r)}{const i=Zd(e,r.fragmentMap);if(i)return!!Vp(i)||qp(i.selectionSet,t,n,r)}})}function Vp(e){return!!e.directives&&e.directives.some(Bp)}function Bp(e){return"nonreactive"===e.name.value}var Up=Vd(function(e,t,n){return function(e,t){let n,r;function i(e){return e!==n&&(n=e,r=t(n)),r}return Object.assign(e.pipe(Gu(i),nd({bufferSize:1,refCount:!0})),{getCurrentResult:()=>i(e.getCurrentResult())})}(e,n)},{max:1,makeCacheKey:e=>e.slice(0,2)}),Hp=Symbol.for("apollo.result.extensions"),Wp=Symbol.for("apollo.result.streamInfo"),Yp=Symbol.for("apollo.observableQuery.variablesUnknown"),Gp=null,Qp={},Jp=1;function Kp(e){try{return e()}catch(t){}}var Xp="@wry/context:Slot",Zp=Kp(()=>globalThis)||Kp(()=>global)||Object.create(null),ef=Zp[Xp]||Array[Xp]||function(e){try{Object.defineProperty(Zp,Xp,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",Jp++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Gp;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===Qp)break;return e!==Gp&&(Gp.slots[this.id]=t),!0}return Gp&&(Gp.slots[this.id]=Qp),!1}getValue(){if(this.hasValue())return Gp.slots[this.id]}withValue(e,t,n,r){const i={__proto__:null,[this.id]:e},a=Gp;Gp={parent:a,slots:i};try{return t.apply(r,n)}finally{Gp=a}}static bind(e){const t=Gp;return function(){const n=Gp;try{return Gp=t,e.apply(this,arguments)}finally{Gp=n}}}static noContext(e,t,n){if(!Gp)return e.apply(n,t);{const r=Gp;try{return Gp=null,e.apply(n,t)}finally{Gp=r}}}}),{bind:tf,noContext:nf}=ef,rf=new ef,{hasOwnProperty:af}=Object.prototype,of=Array.from||function(e){const t=[];return e.forEach(e=>t.push(e)),t};function sf(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}var lf=[];function cf(e,t){if(!e)throw new Error(t||"assertion failure")}function uf(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function df(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function pf(e){return e.slice(0)}var ff=class e{constructor(t){this.fn=t,this.parents=/* @__PURE__ */new Set,this.childValues=/* @__PURE__ */new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}peek(){if(1===this.value.length&&!gf(this))return hf(this),this.value[0]}recompute(e){return cf(!this.recomputing,"already recomputing"),hf(this),gf(this)?function(e,t){return Sf(e),rf.withValue(e,mf,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{sf(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(NL){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,gf(e)||bf(e)}(e),df(e.value)}(this,e):df(this.value)}setDirty(){this.dirty||(this.dirty=!0,yf(this),sf(this))}dispose(){this.setDirty(),Sf(this),vf(this,(e,t)=>{e.setDirty(),Nf(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=lf.pop()||/* @__PURE__ */new Set),this.deps.add(e)}forgetDeps(){this.deps&&(of(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),lf.push(this.deps),this.deps=null)}};function hf(e){const t=rf.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),gf(e)?xf(t,e):wf(t,e),t}function mf(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=pf(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!uf(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch(i){}}catch(NL){e.value[1]=NL}e.recomputing=!1}function gf(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function yf(e){vf(e,xf)}function bf(e){vf(e,wf)}function vf(e,t){const n=e.parents.size;if(n){const r=of(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function xf(e,t){cf(e.childValues.has(t)),cf(gf(t));const n=!gf(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=lf.pop()||/* @__PURE__ */new Set;e.dirtyChildren.add(t),n&&yf(e)}function wf(e,t){cf(e.childValues.has(t)),cf(!gf(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,pf(t.value)):uf(n,t.value)||e.setDirty(),kf(e,t),gf(e)||bf(e)}function kf(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(lf.length<100&&lf.push(n),e.dirtyChildren=null))}function Sf(e){e.childValues.size>0&&e.childValues.forEach((t,n)=>{Nf(e,n)}),e.forgetDeps(),cf(null===e.dirtyChildren)}function Nf(e,t){t.parents.delete(e),e.childValues.delete(t),kf(e,t)}ff.count=0;var Cf,Tf={setDirty:!0,dispose:!0,forget:!0};function Ef(e){const t=/* @__PURE__ */new Map,n=e&&e.subscribe;function r(e){const r=rf.getValue();if(r){let i=t.get(e);i||t.set(e,i=/* @__PURE__ */new Set),r.dependOn(i),"function"==typeof n&&(sf(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){const r=t.get(e);if(r){const i=n&&af.call(Tf,n)?n:"setDirty";of(r).forEach(e=>e[i]()),t.delete(e),sf(r)}},r}function Of(...e){return(Cf||(Cf=new _d("function"==typeof WeakMap))).lookupArray(e)}var _f=/* @__PURE__ */new Set;function Af(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=Of,normalizeResult:i,subscribe:a,cache:o=Id}=Object.create(null)){const s="function"==typeof o?new o(t,e=>e.dispose()):o,l=function(){const t=r.apply(null,n?n.apply(null,arguments):arguments);if(void 0===t)return e.apply(null,arguments);let o=s.get(t);o||(s.set(t,o=new ff(e)),o.normalizeResult=i,o.subscribe=a,o.forget=()=>s.delete(t));const l=o.recompute(Array.prototype.slice.call(arguments));return s.set(t,o),_f.add(s),rf.hasValue()||(_f.forEach(e=>e.clean()),_f.clear()),l};function c(e){const t=e&&s.get(e);t&&t.setDirty()}function u(e){const t=e&&s.get(e);if(t)return t.peek()}function d(e){return!!e&&s.delete(e)}return Object.defineProperty(l,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(l.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:a,cache:s}),l.dirtyKey=c,l.dirty=function(){c(r.apply(null,arguments))},l.peekKey=u,l.peek=function(){return u(r.apply(null,arguments))},l.forgetKey=d,l.forget=function(){return d(r.apply(null,arguments))},l.makeCacheKey=r,l.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(l)}function If(...e){return Of.bind(null,...e)}var zf=class{isIncrementalResult(e){return!1}prepareRequest(e){return fd(!fp(["defer","stream"],e.query),67),e}extractErrors(){}startRequest=void 0},Df=class e{static empty(){return new e(()=>Cu)}static from(t){if(0===t.length)return e.empty();const[n,...r]=t;return n.concat(...r)}static split(t,n,r=new e((e,t)=>t(e))){const i=new e((e,i)=>t(e)?n.request(e,i):r.request(e,i));return Object.assign(i,{left:n,right:r})}static execute(e,t,n){return e.request(function(e,{client:t}){const n={query:e.query,variables:e.variables||{},extensions:e.extensions||{},operationName:Nd(e.query),operationType:rp(e.query).operation};let r={...e.context};const i=()=>Object.freeze({...r});return Object.defineProperty(n,"setContext",{enumerable:!1,value:e=>{r="function"==typeof e?{...r,...e(i())}:{...r,...e}}}),Object.defineProperty(n,"getContext",{enumerable:!1,value:i}),Object.defineProperty(n,"client",{enumerable:!1,value:t}),n}(t,n),()=>Cu)}static concat(...t){return e.from(t)}constructor(e){e&&(this.request=e)}split(t,n,r){return this.concat(e.split(t,n,r))}concat(...e){return 0===e.length?this:e.reduce(this.combine.bind(this),this)}combine(t,n){const r=new e((e,r)=>t.request(e,e=>n.request(e,r)));return Object.assign(r,{left:t,right:n})}request(e,t){throw md(65)}left;right},Mf=Df.execute;function Pf(e){return e}var jf,Rf=class e{transform;cached;resultCache=/* @__PURE__ */new WeakSet;getCacheKey(e){return[e]}static identity(){return new e(Pf,{cache:!1})}static split(t,n,r=e.identity()){return Object.assign(new e(e=>(t(e)?n:r).transformDocument(e),{cache:!1}),{left:n,right:r})}constructor(e,t={}){this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}resetCache(){if(this.cached){const t=new _d;this.performWork=Af(e.prototype.performWork.bind(this),{makeCacheKey:e=>{const n=this.getCacheKey(e);if(n)return fd(Array.isArray(n),20),t.lookupArray(n)},max:Sd["documentTransform.cache"],cache:Rd})}}performWork(e){return Bd(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;const t=this.performWork(e);return this.resultCache.add(t),t}concat(t){return Object.assign(new e(e=>t.transformDocument(this.transformDocument(e)),{cache:!1}),{left:this,right:t})}left;right},Lf=Object.assign(e=>{let t=jf.get(e);return t||(t=function(e){return _l(e,Il)}(e),jf.set(e,t)),t},{reset(){jf=new $d(Sd.print||2e3)}});function Ff(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}Lf.reset();var $f={kind:Ts,name:{kind:ws,value:"__typename"}},qf=Object.assign(function(e){return _l(e,{SelectionSet:{enter(e,t,n){if(n&&"OperationDefinition"===n.kind)return;const{selections:r}=e;if(!r)return;if(r.some(e=>"Field"===e.kind&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))))return;const i=n;return"Field"===i.kind&&i.directives&&i.directives.some(e=>"export"===e.name.value)?void 0:{...e,selections:[...r,$f]}}}})},{added:e=>e===$f});function Vf(e,t){return rp(e)?.operation===t}function Bf(e){return 7===e||8===e}function Uf(e){return!Bf(e)}var Hf=class{assumeImmutableResults=!1;lookupFragment(e){return null}batch(e){const t="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;let n;return this.performTransaction(()=>n=e.update(this),t),n}recordOptimisticTransaction(e,t){this.performTransaction(e,t)}transformDocument(e){return e}transformForLink(e){return e}identify(e){}gc(){return[]}modify(e){return!1}readQuery(e,t=!!e.optimistic){return this.read({...e,rootId:e.id||"ROOT_QUERY",optimistic:t})}fragmentWatches=new _d(!0);watchFragment(e){const{fragment:t,fragmentName:n,from:r}=e,i=this.getFragmentDoc(t,n),a=(Array.isArray(r)?r:[r]).map(e=>null==e?e:this.toCacheId(e));if(!Array.isArray(r)){const t=this.watchSingleFragment(a[0],i,e);return null===r?t:Up(t,Symbol.for("apollo.transform.individualResult"),e=>({...e,data:e.data??{}}))}let o;function s(e){const t=e.reduce((e,t,n)=>(e.data.push(t.data),e.complete&&=t.complete,e.dataState=e.complete?"complete":"partial",t.missing&&(e.missing||={},e.missing[n]=t.missing),e),{data:[],dataState:"complete",complete:!0});return Mp(o,t)||(o=t),o}if(0===a.length)return Qf;let l=!1;const c=a.map(t=>this.watchSingleFragment(t,i,e)),u=function(e){return 0===e.length?Cu:new cu(t=>{const{length:n}=e,r=new Array(n),i=/* @__PURE__ */new Map;e.forEach((e,t)=>{i.has(e)||i.set(e,/* @__PURE__ */new Set),i.get(e).add(t)});let a,o=i.size,s=i.size;i.forEach((n,i)=>{let l=!1;const c=i.subscribe({next:o=>{n.forEach(e=>r[e]=o),l||(l=!0,s--),s||(a||=new Set(e.filter(e=>e.dirty)),a.delete(i),a.size||(t.next(r.slice()),a=void 0))},complete:()=>{o--,o||t.complete()},error:t.error.bind(t)});t.add(c)})})}(c).pipe(Gu(s),rd({subscribe:()=>l=!0,unsubscribe:()=>l=!1}),nd({bufferSize:1,refCount:!0}));return Object.assign(u,{getCurrentResult:()=>l&&o?o:s(c.map(e=>e.getCurrentResult()))})}onAfterBroadcast=e=>e();watchSingleFragment(e,t,n){if(null===e)return Yf;const{optimistic:r=!0,variables:i}=n,a=[t,op({id:e,optimistic:r,variables:i})],o=this.fragmentWatches.lookupArray(a);if(!o.observable){let c,u=!1;function d(e){const r=e.result;return c&&$p(t,{data:c.data},{data:r},n.variables)||(c={data:r,dataState:e.complete?"complete":"partial",complete:e.complete},e.missing&&(c.missing=e.missing.missing)),c}const p=new cu(n=>{u=!0;const o=this.watch({variables:i,returnPartialData:!0,id:e,query:t,optimistic:r,immediate:!0,callback:e=>{p.dirty=!0,this.onAfterBroadcast(()=>{n.next(d(e)),p.dirty=!1})}});return()=>{u=!1,o(),this.fragmentWatches.removeArray(a)}}).pipe((void 0===l&&(l=lu),s=null!=s?s:Zu,du(function(e,t){var n,r=!0;e.subscribe(pu(t,function(e){var i=l(e);!r&&s(n,i)||(r=!1,n=i,t.next(e))}))})),ed({connector:()=>new vu(1),resetOnRefCountZero:()=>function(e,t,n){void 0===e&&(e=0),void 0===n&&(n=Nu);var r=-1;return null!=t&&(Tu(t)?n=t:r=t),new cu(function(t){var i,a=(i=e)instanceof Date&&!isNaN(i)?+e-n.now():e;a<0&&(a=0);var o=0;return n.schedule(function(){t.closed||(t.next(o++),0<=r?this.schedule(void 0,r):t.complete())},a)})}(0)}));o.observable=Object.assign(p,{dirty:!1,getCurrentResult:()=>u&&c?c:d(this.diff({id:e,query:t,returnPartialData:!0,optimistic:r,variables:i}))})}var s,l;return o.observable}getFragmentDoc=Af(ep,{max:Sd["cache.fragmentQueryDocuments"]||1e3,cache:Rd,makeCacheKey:If(this)});readFragment(e,t=!!e.optimistic){const n=void 0!==e.from?this.toCacheId(e.from):e.id;return this.read({...e,query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:n,optimistic:t})}writeQuery({id:e,data:t,...n}){return this.write(Object.assign(n,{dataId:e||"ROOT_QUERY",result:t}))}writeFragment({data:e,fragment:t,fragmentName:n,...r}){const i=void 0!==r.from?this.toCacheId(r.from):r.id;return this.write(Object.assign(r,{query:this.getFragmentDoc(t,n),dataId:i,result:e}))}updateQuery(e,t){return this.batch({update(n){const r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery({...e,data:i}),i)}})}updateFragment(e,t){return this.batch({update(n){const r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment({...e,data:i}),i)}})}toCacheId(e){return"string"==typeof e?e:this.identify(e)}},Wf=Object.freeze({data:null,dataState:"complete",complete:!0}),Yf=Object.assign(new cu(e=>{e.next(Wf)}),{dirty:!1,getCurrentResult:()=>Wf}),Gf=Object.freeze({data:[],dataState:"complete",complete:!0}),Qf=Object.assign(new cu(e=>{e.next(Gf)}),{getCurrentResult:()=>Gf}),Jf=class e extends Error{message;path;query;variables;constructor(t,n,r,i){if(super(t),this.message=t,this.path=n,this.query=r,this.variables=i,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let e=this.path.length-1;e>=0;--e)this.missing={[this.path[e]]:this.missing}}else this.missing=this.path;this.__proto__=e.prototype}missing},{hasOwnProperty:Kf}=Object.prototype;function Xf({__typename:e,id:t,_id:n},r){if("string"==typeof e&&(r&&(r.keyObject=null!=t?{id:t}:null!=n?{_id:n}:void 0),null==t&&null!=n&&(t=n),null!=t))return`${e}:${"number"==typeof t||"string"==typeof t?t:JSON.stringify(t)}`}var Zf={dataIdFromObject:Xf,resultCaching:!0},eh=/^[_a-z][_0-9a-z]*/i;function th(e){const t=e.match(eh);return t?t[0]:e}function nh(e,t,n){return!!Yd(t)&&(mp(t)?t.every(t=>nh(e,t,n)):e.selections.every(e=>{if(gp(e)&&Ep(e,n)){const r=Tp(e);return Kf.call(t,r)&&(!e.selectionSet||nh(e.selectionSet,t[r],n))}return!0}))}function rh(e){return Yd(e)&&!Ff(e)&&!mp(e)}function ih(e,t){const n=Wd(tp(e));return{fragmentMap:n,lookupFragment(e){let r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}var ah={},oh=()=>ah,sh={},lh=class{policies;group;data={};constructor(e,t){this.policies=e,this.group=t}toObject(){return{...this.data}}has(e){return void 0!==this.lookup(e,!0)}get(e,t){if(this.group.depend(e,t),Kf.call(this.data,e)){const n=this.data[e];if(n&&Kf.call(n,t))return n[t]}return"__typename"===t&&Kf.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof ph?this.parent.get(e,t):void 0}lookup(e,t){return t&&this.group.depend(e,"__exists"),Kf.call(this.data,e)?this.data[e]:this instanceof ph?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?{}:void 0}merge(e,t){let n;Ff(e)&&(e=e.__ref),Ff(t)&&(t=t.__ref);const r="string"==typeof e?this.lookup(n=e):e,i="string"==typeof t?this.lookup(n=t):t;if(!i)return;fd("string"==typeof n,104);const a=new Kd({reconciler:hh}).merge(r,i);if(this.data[n]=a,a!==r&&(delete this.refs[n],this.group.caching)){const e={};r||(e.__exists=1),Object.keys(i).forEach(t=>{if(!r||r[t]!==a[t]){e[t]=1;const n=th(t);n===t||this.policies.hasKeyArgs(a.__typename,n)||(e[n]=1),void 0!==a[t]||this instanceof ph||delete a[t]}}),!e.__typename||r&&r.__typename||this.policies.rootTypenamesById[n]!==a.__typename||delete e.__typename,Object.keys(e).forEach(e=>this.group.dirty(n,e))}}modify(e,t,n){const r=this.lookup(e);if(r){const i={};let a=!1,o=!0;const s={DELETE:ah,INVALIDATE:sh,isReference:Ff,toReference:this.toReference,canRead:this.canRead,readField:(t,n)=>this.policies.readField("string"==typeof t?{fieldName:t,from:n||bp(e)}:t,{store:this})};if(Object.keys(r).forEach(l=>{const c=th(l);let u=r[l];if(void 0===u)return;const d="function"==typeof t?t:t[l]||(n?void 0:t[c]);if(d){let t=d===oh?ah:d(u,{...s,fieldName:c,storeFieldName:l,storage:this.getStorage(e,l)});t===sh?this.group.dirty(e,l):(t===ah&&(t=void 0),t!==u&&(i[l]=t,a=!0,u=t))}void 0!==u&&(o=!1)}),a)return this.merge(e,i),o&&(this instanceof ph?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1}delete(e,t,n){const r=this.lookup(e);if(r){const i=this.getFieldValue(r,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:i,fieldName:t,args:n}):t;return this.modify(e,a?{[a]:oh}:oh,!!n)}return!1}evict(e,t){let n=!1;return e.id&&(Kf.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof ph&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n}clear(){this.replace(null)}extract(){const e=this.toObject(),t=[];return this.getRootIdSet().forEach(e=>{Kf.call(this.policies.rootTypenamesById,e)||t.push(e)}),t.length&&(e.__META={extraRootIds:t.sort()}),e}replace(e){if(Object.keys(this.data).forEach(t=>{e&&Kf.call(e,t)||this.delete(t)}),e){const{__META:t,...n}=e;Object.keys(n).forEach(e=>{this.merge(e,n[e])}),t&&t.extraRootIds.forEach(this.retain,this)}}rootIds={};retain(e){return this.rootIds[e]=(this.rootIds[e]||0)+1}release(e){if(this.rootIds[e]>0){const t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0}getRootIdSet(e=/* @__PURE__ */new Set){return Object.keys(this.rootIds).forEach(e.add,e),this instanceof ph?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e}gc(){const e=this.getRootIdSet(),t=this.toObject();e.forEach(n=>{Kf.call(t,n)&&(Object.keys(this.findChildRefIds(n)).forEach(e.add,e),delete t[n])});const n=Object.keys(t);if(n.length){let e=this;for(;e instanceof ph;)e=e.parent;n.forEach(t=>e.delete(t))}return n}refs={};findChildRefIds(e){if(!Kf.call(this.refs,e)){const t=this.refs[e]={},n=this.data[e];if(!n)return t;const r=/* @__PURE__ */new Set([n]);r.forEach(e=>{Ff(e)&&(t[e.__ref]=!0),Yd(e)&&Object.keys(e).forEach(t=>{const n=e[t];Yd(n)&&r.add(n)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,t)=>Ff(e)?this.get(e.__ref,t):e&&e[t];canRead=e=>Ff(e)?this.has(e.__ref):"object"==typeof e;toReference=(e,t)=>{if("string"==typeof e)return bp(e);if(Ff(e))return e;const[n]=this.policies.identify(e);if(n){const r=bp(n);return t&&this.merge(n,e),r}};get supportsResultCaching(){return this.group.caching}},ch=class{caching;parent;d=null;keyMaker;constructor(e,t=null){this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?Ef():null,this.keyMaker=new _d}depend(e,t){if(this.d){this.d(uh(e,t));const n=th(t);n!==t&&this.d(uh(e,n)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(uh(e,t),"__exists"===t?"forget":"setDirty")}};function uh(e,t){return t+"#"+e}function dh(e,t){mh(e)&&e.group.depend(t,"__exists")}lh.Root=class extends lh{constructor({policies:e,resultCaching:t=!0,seed:n}){super(e,new ch(t)),n&&this.replace(n)}stump=new fh(this);addLayer(e,t){return this.stump.addLayer(e,t)}removeLayer(){return this}storageTrie=new _d;getStorage(){return this.storageTrie.lookupArray(arguments)}};var ph=class e extends lh{id;parent;replay;group;constructor(e,t,n,r){super(t.policies,r),this.id=e,this.parent=t,this.replay=n,this.group=r,n(this)}addLayer(t,n){return new e(t,this,n,this.group)}removeLayer(e){const t=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(e=>{const n=this.data[e],r=t.lookup(e);r?n?n!==r&&Object.keys(n).forEach(t=>{Mp(n[t],r[t])||this.group.dirty(e,t)}):(this.group.dirty(e,"__exists"),Object.keys(r).forEach(t=>{this.group.dirty(e,t)})):this.delete(e)}),t):t===this.parent?this:t.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(e){const t=this.parent.findChildRefIds(e);return Kf.call(this.data,e)?{...t,...super.findChildRefIds(e)}:t}getStorage(...e){let t=this.parent;for(;t.parent;)t=t.parent;return t.getStorage(...e)}},fh=class extends ph{constructor(e){super("EntityStore.Stump",e,()=>{},new ch(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}};function hh(e,t,n){const r=e[n],i=t[n];return Mp(r,i)?r:i}function mh(e){return!(!e||!e.supportsResultCaching)}var gh=new ef;function yh(e){const t=e.directives?.find(({name:e})=>"unmask"===e.value);if(!t)return"mask";const n=t.arguments?.find(({name:e})=>"mode"===e.value);return n&&"value"in n.value&&"migrate"===n.value.value?"migrate":"unmask"}function bh(e,t,n){return gh.withValue(!0,()=>{const r=vh(e,t,n,!1);return Object.isFrozen(e),r})}function vh(e,t,n,r,i){const{knownChanged:a}=n,o=function(e,t){if(t.has(e))return t.get(e);const n=Array.isArray(e)?[]:{};return t.set(e,n),n}(e,n.mutableTargets);if(Array.isArray(e)){for(const[i,s]of Array.from(e.entries())){if(null===s){o[i]=null;continue}const e=vh(s,t,n,r,void 0);a.has(e)&&a.add(o),o[i]=e}return a.has(o)?o:e}for(const s of t.selections){let t;if(r&&a.add(o),"Field"===s.kind){const i=Tp(s),l=s.selectionSet;if(t=o[i]||e[i],void 0===t)continue;if(l&&null!==t){const o=vh(e[i],l,n,r,void 0);a.has(o)&&(t=o)}o[i]=t}if("InlineFragment"!==s.kind||s.typeCondition&&!n.cache.fragmentMatches(s,e.__typename)||(t=vh(e,s.selectionSet,n,r,i)),"FragmentSpread"===s.kind){const r=s.name.value,a=n.fragmentMap[r]||(n.fragmentMap[r]=n.cache.lookupFragment(r));fd(a,39,r);const o=yh(s);"mask"!==o&&(t=vh(e,a.selectionSet,n,"migrate"===o,i))}a.has(t)&&a.add(o)}return"__typename"in e&&!("__typename"in o)&&(o.__typename=e.__typename),Object.keys(o).length!==Object.keys(e).length&&a.add(o),a.has(o)?o:e}var xh={};function wh(e){const t=JSON.stringify(e);return xh[t]||(xh[t]={})}function kh(e){const t=wh(e);return t.keyFieldsFn||(t.keyFieldsFn=(t,n)=>{const r=(e,t)=>n.readField(t,e),i=n.keyObject=Nh(e,e=>{let i=Eh(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&Kf.call(t,e[0])&&(i=Eh(t,e,Th)),fd(void 0!==i,107,e.join("."),t),i});return`${n.typename}:${JSON.stringify(i)}`})}function Sh(e){const t=wh(e);return t.keyArgsFn||(t.keyArgsFn=(t,{field:n,variables:r,fieldName:i})=>{const a=Nh(e,e=>{const i=e[0],a=i.charAt(0);if("@"!==a){if("$"===a){const t=i.slice(1);if(r&&Kf.call(r,t)){const n=e.slice(0);return n[0]=t,Eh(r,n)}return}if(t)return Eh(t,e)}else if(n&&yp(n.directives)){const t=i.slice(1),a=n.directives.find(e=>e.name.value===t),o=a&&wd(a,r);return o&&Eh(o,e.slice(1))}}),o=JSON.stringify(a);return(t||"{}"!==o)&&(i+=":"+o),i})}function Nh(e,t){const n=new Kd;return Ch(e).reduce((e,r)=>{let i=t(r);if(void 0!==i){for(let e=r.length-1;e>=0;--e)i={[r[e]]:i};e=n.merge(e,i)}return e},{})}function Ch(e){const t=wh(e);if(!t.paths){const n=t.paths=[],r=[];e.forEach((t,i)=>{mp(t)?(Ch(t).forEach(e=>n.push(r.concat(e))),r.length=0):(r.push(t),mp(e[i+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function Th(e,t){return e[t]}function Eh(e,t,n){return n=n||Th,Oh(t.reduce(function e(t,r){return mp(t)?t.map(t=>e(t,r)):t&&n(t,r)},e))}function Oh(e){return Yd(e)?mp(e)?e.map(Oh):Nh(Object.keys(e).sort(),t=>Eh(e,t)):e}var _h=new ef,Ah=/* @__PURE__ */new WeakMap;function Ih(e){let t=Ah.get(e);return t||Ah.set(e,t={vars:/* @__PURE__ */new Set,dep:Ef()}),t}function zh(e){Ih(e).vars.forEach(t=>t.forgetCache(e))}function Dh(e){const t=/* @__PURE__ */new Set,n=/* @__PURE__ */new Set,r=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(e=>{Ih(e).dep.dirty(r),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)});const i=Array.from(n);n.clear(),i.forEach(t=>t(e))}}else{const e=_h.getValue();e&&(i(e),Ih(e).dep(r))}return e};r.onNextChange=e=>(n.add(e),()=>{n.delete(e)});const i=r.attachCache=e=>(t.add(e),Ih(e).vars.add(r),r);return r.forgetCache=e=>t.delete(e),r}function Mh(e){return void 0!==e.args?e.args:e.field?wd(e.field,e.variables):null}var Ph=()=>{},jh=(e,t)=>t.fieldName,Rh=(e,t,{mergeObjects:n})=>n(e,t),Lh=(e,t)=>t,Fh=(e,t,{streamFieldInfo:n,existingData:r})=>{if(!e&&!r)return t;const i=[],a=e??r,o=n?.isLastChunk?t.length:Math.max(a.length,t.length);for(let s=0;s<o;s++)i[s]=void 0===t[s]?a[s]:t[s];return i},$h=class{config;typePolicies={};toBeAdded={};supertypeMap=/* @__PURE__ */new Map;fuzzySubtypes=/* @__PURE__ */new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(e){this.config=e,this.config={dataIdFromObject:Xf,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,t){const n=this,r=t&&(t.typename||t.storeObject?.__typename)||e.__typename;if(r===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const i=t&&t.storeObject||e,a={...t,typename:r,storeObject:i,readField:t&&t.readField||((...e)=>{const t=Vh(e,i);return n.readField(t,{store:n.cache.data,variables:t.variables})})};let o;const s=r&&this.getTypePolicy(r);let l=s&&s.keyFn||this.config.dataIdFromObject;return gh.withValue(!0,()=>{for(;l;){const t=l({...e,...i},a);if(!mp(t)){o=t;break}l=kh(t)}}),o=o?String(o):void 0,a.keyObject?[o,a.keyObject]:[o]}addTypePolicies(e){Object.keys(e).forEach(t=>{const{queryType:n,mutationType:r,subscriptionType:i,...a}=e[t];n&&this.setRootTypename("Query",t),r&&this.setRootTypename("Mutation",t),i&&this.setRootTypename("Subscription",t),Kf.call(this.toBeAdded,t)?this.toBeAdded[t].push(a):this.toBeAdded[t]=[a]})}updateTypePolicy(e,t,n){const r=this.getTypePolicy(e),{keyFields:i,fields:a}=t;function o(e,t){e.merge="function"==typeof t?t:!0===t?Rh:!1===t?Lh:e.merge}o(r,t.merge),r.keyFn=!1===i?Ph:mp(i)?kh(i):"function"==typeof i?i:r.keyFn,a&&Object.keys(a).forEach(t=>{let r=n[t];r&&r?.typename===e||(r=n[t]={typename:e});const i=a[t];if("function"==typeof i)r.read=i;else{const{keyArgs:e,read:t,merge:n}=i;r.keyFn=!1===e?jh:mp(e)?Sh(e):"function"==typeof e?e:r.keyFn,"function"==typeof t&&(r.read=t),o(r,n)}r.read&&r.merge&&(r.keyFn=r.keyFn||jh)})}setRootTypename(e,t=e){const n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(fd(!r||r===e,108,e),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)}addPossibleTypes(e){this.usingPossibleTypes=!0,Object.keys(e).forEach(t=>{this.getSupertypeSet(t,!0),e[t].forEach(e=>{this.getSupertypeSet(e,!0).add(t);const n=e.match(eh);n&&n[0]===e||this.fuzzySubtypes.set(e,new RegExp(e))})})}getTypePolicy(e){if(!Kf.call(this.typePolicies,e)){const t=this.typePolicies[e]={};t.fields={};let n=this.supertypeMap.get(e);!n&&this.fuzzySubtypes.size&&(n=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((t,r)=>{if(t.test(e)){const e=this.supertypeMap.get(r);e&&e.forEach(e=>n.add(e))}})),n&&n.size&&n.forEach(e=>{const{fields:n,...r}=this.getTypePolicy(e);Object.assign(t,r),Object.assign(t.fields,n)})}const t=this.toBeAdded[e];return t&&t.length&&t.splice(0).forEach(t=>{this.updateTypePolicy(e,t,this.typePolicies[e].fields)}),this.typePolicies[e]}getFieldPolicy(e,t){if(e)return this.getTypePolicy(e).fields[t]}getSupertypeSet(e,t){let n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=/* @__PURE__ */new Set),n}fragmentMatches(e,t,n,r){if(!e.typeCondition)return!0;if(!t)return!1;const i=e.typeCondition.name.value;if(t===i)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(i)){const a=this.getSupertypeSet(t,!0),o=[a],s=e=>{const t=this.getSupertypeSet(e,!1);t&&t.size&&o.indexOf(t)<0&&o.push(t)};let l=!(!n||!this.fuzzySubtypes.size),c=!1;for(let u=0;u<o.length;++u){const d=o[u];if(d.has(i))return a.has(i)||a.add(i),!0;d.forEach(s),l&&u===o.length-1&&nh(e.selectionSet,n,r)&&(l=!1,c=!0,this.fuzzySubtypes.forEach((e,n)=>{const r=t.match(e);r&&r[0]===t&&s(n)}))}}return!1}hasKeyArgs(e,t){const n=this.getFieldPolicy(e,t);return!(!n||!n.keyFn)}getStoreFieldName(e){const{typename:t,fieldName:n}=e,r=this.getFieldPolicy(t,n);let i,a=r&&r.keyFn;if(a&&t){const r={typename:t,fieldName:n,field:e.field||null,variables:e.variables},o=Mh(e);for(;a;){const e=a(o,r);if(!mp(e)){i=e||n;break}a=Sh(e)}}return void 0===i&&(i=e.field?function(e,t){let n=null;e.directives&&(n={},e.directives.forEach(e=>{n[e.name.value]={},e.arguments&&e.arguments.forEach(({name:r,value:i})=>xd(n[e.name.value],r,i,t))}));let r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach(({name:e,value:n})=>xd(r,e,n,t))),dp(e.name.value,r,n)}(e.field,e.variables):dp(n,Mh(e))),!1===i?n:n===th(i)?i:n+":"+i}readField(e,t){const n=e.from;if(!n)return;if(!e.field&&!e.fieldName)return;if(void 0===e.typename){const r=t.store.getFieldValue(n,"__typename");r&&(e.typename=r)}const r=this.getStoreFieldName(e),i=th(r),a=t.store.getFieldValue(n,r),o=this.getFieldPolicy(e.typename,i),s=o&&o.read;if(s){const i=qh(this,n,e,t,t.store.getStorage(Ff(n)?n.__ref:n,r));return _h.withValue(this.cache,s,[a,i])}return a}getReadFunction(e,t){const n=this.getFieldPolicy(e,t);return n&&n.read}getMergeFunction(e,t,n){let r=this.getFieldPolicy(e,t),i=r&&r.merge;return!i&&n&&(r=this.getTypePolicy(n),i=r&&r.merge),i}runMergeFunction(e,t,{field:n,typename:r,merge:i,path:a},o,s){const l=e;if(i===Rh)return Bh(o.store)(e,t);if(i===Lh)return t;o.overwrite&&(e=void 0);const c=o.extensions?.[Wp]?.deref()?.peekArray(a);if(c){const{current:e,previous:n}=c;if(n&&Mp(n.incoming,t)&&Mp(n.streamFieldInfo,e))return n.result}const u=i(e,t,function(e,t,n,r,i,a){const o={...qh(e,void 0,n,r,i),extensions:r.extensions,existingData:a},s=r.extensions;if(s&&Wp in s){const{[Wp]:e,...t}=s,r=e?.deref()?.peekArray(n.path);r&&(o.streamFieldInfo=r.current),o.extensions=0===Object.keys(t).length?void 0:t}return o}(this,0,{typename:r,fieldName:n.name.value,field:n,variables:o.variables,path:a},o,s||{},l));return c&&(c.previous={incoming:t,streamFieldInfo:c.current,result:u}),u}};function qh(e,t,n,r,i){const a=e.getStoreFieldName(n),o=th(a),s=n.variables||r.variables,{toReference:l,canRead:c}=r.store;return{args:Mh(n),field:n.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:Ff,toReference:l,storage:i,cache:e.cache,canRead:c,readField:(...n)=>e.readField(Vh(n,t,s),r),mergeObjects:Bh(r.store)}}function Vh(e,t,n){const{0:r,1:i,length:a}=e;let o;return"string"==typeof r?o={fieldName:r,from:a>1?i:t}:(o={...r},Kf.call(o,"from")||(o.from=t)),void 0===o.variables&&(o.variables=n),o}function Bh(e){return function(t,n){if(mp(t)||mp(n))throw md(111);if(Yd(t)&&Yd(n)){const r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(Ff(t)&&rh(n))return e.merge(t.__ref,n),t;if(rh(t)&&Ff(n))return e.merge(t,n.__ref),n;if(rh(t)&&rh(n))return{...t,...n}}return n}}function Uh(e){return[e.selectionSet,e.objectOrReference,e.context]}var Hh=class{executeSelectionSet;executeSubSelectedArray;config;knownResults=/* @__PURE__ */new WeakMap;constructor(e){this.config=e,this.executeSelectionSet=Af(e=>{const t=Uh(e);return this.executeSelectionSet.peek(...t)||(dh(e.context.store,e.enclosingRef.__ref),this.execSelectionSetImpl(e))},{max:Sd["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Uh,makeCacheKey(e,t,n){if(mh(n.store))return n.store.makeCacheKey(e,Ff(t)?t.__ref:t,n.varString)}}),this.executeSubSelectedArray=Af(e=>(dh(e.context.store,e.enclosingRef.__ref),this.execSubSelectedArrayImpl(e)),{max:Sd["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:e,array:t,context:n}){if(mh(n.store))return n.store.makeCacheKey(e,t,n.varString)}})}diffQueryAgainstStore({store:e,query:t,rootId:n="ROOT_QUERY",variables:r,returnPartialData:i=!0}){const a=this.config.cache.policies;r={...Xd(ip(t)),...r};const o=bp(n),s=this.executeSelectionSet({selectionSet:np(t).selectionSet,objectOrReference:o,enclosingRef:o,context:{store:e,query:t,policies:a,variables:r,varString:op(r),...ih(t,this.config.fragments)}});let l;s.missing&&(l=new Jf(function(e){try{JSON.stringify(e,(e,t)=>{if("string"==typeof t)throw t;return t})}catch(u){return u}}(s.missing),s.missing,t,r));const c=!l,{result:u}=s;return{result:c?u:i?0===Object.keys(u).length?null:u:null,complete:c,missing:l}}isFresh(e,t,n,r){if(mh(r.store)&&this.knownResults.get(e)===n){const i=this.executeSelectionSet.peek(n,t,r);if(i&&e===i.result)return!0}return!1}execSelectionSetImpl({selectionSet:e,objectOrReference:t,enclosingRef:n,context:r}){if(Ff(t)&&!r.policies.rootTypenamesById[t.__ref]&&!r.store.has(t.__ref))return{result:{},missing:`Dangling reference to missing ${t.__ref} object`};const{variables:i,policies:a,store:o}=r,s=o.getFieldValue(t,"__typename"),l=[];let c;const u=new Kd;function d(e,t){return e.missing&&(c=u.merge(c,{[t]:e.missing})),e.result}"string"!=typeof s||a.rootIdsByTypename[s]||l.push({__typename:s});const p=new Set(e.selections);p.forEach(e=>{if(Ep(e,i))if(gp(e)){let i=a.readField({fieldName:e.name.value,field:e,variables:r.variables,from:t},r);const o=Tp(e);void 0===i?qf.added(e)||(c=u.merge(c,{[o]:`Can't find field '${e.name.value}' on ${Ff(t)?t.__ref+" object":"object "+JSON.stringify(t,null,2)}`})):mp(i)?i.length>0&&(i=d(this.executeSubSelectedArray({field:e,array:i,enclosingRef:n,context:r}),o)):e.selectionSet&&null!=i&&(i=d(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:i,enclosingRef:Ff(i)?i:n,context:r}),o)),void 0!==i&&l.push({[o]:i})}else{const t=Zd(e,r.lookupFragment);if(!t&&"FragmentSpread"===e.kind)throw md(112,e.name.value);t&&a.fragmentMatches(t,s)&&t.selectionSet.selections.forEach(p.add,p)}});const f={result:vp(l),missing:c};return f.result&&this.knownResults.set(f.result,e),f}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:n,context:r}){let i,a=new Kd;function o(e,t){return e.missing&&(i=a.merge(i,{[t]:e.missing})),e.result}return e.selectionSet&&(t=t.filter(e=>void 0===e||r.store.canRead(e))),t=t.map((t,i)=>null===t?null:mp(t)?o(this.executeSubSelectedArray({field:e,array:t,enclosingRef:n,context:r}),i):e.selectionSet?o(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:t,enclosingRef:Ff(t)?t:n,context:r}),i):t),{result:t,missing:i}}};function Wh(e,t,n){const r=`${t}${n}`;let i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:{...e,clientOnly:t,deferred:n}),i}var Yh=class{cache;reader;fragments;constructor(e,t,n){this.cache=e,this.reader=t,this.fragments=n}writeToStore(e,{query:t,result:n,dataId:r,variables:i,overwrite:a,extensions:o}){const s=rp(t),l=new Kd;i={...Xd(s),...i};const c={store:e,written:{},merge:(e,t)=>l.merge(e,t),variables:i,varString:op(i),...ih(t,this.fragments),overwrite:!!a,incomingById:/* @__PURE__ */new Map,clientOnly:!1,deferred:!1,flavors:/* @__PURE__ */new Map,extensions:o},u=this.processSelectionSet({result:n||{},dataId:r,selectionSet:s.selectionSet,mergeTree:{map:/* @__PURE__ */new Map},context:c,path:[]});if(!Ff(u))throw md(114,n);return c.incomingById.forEach(({storeObject:t,mergeTree:n,fieldNodeSet:r},i)=>{const a=bp(i);if(n&&n.map.size){const e=this.applyMerges(n,a,t,c);if(Ff(e))return;t=e}e.merge(i,t)}),e.retain(u.__ref),u}processSelectionSet({dataId:e,result:t,selectionSet:n,context:r,mergeTree:i,path:a}){const{policies:o}=this.cache;let s={};const l=e&&o.rootTypenamesById[e]||Zh(t,n,r.fragmentMap)||e&&r.store.get(e,"__typename");"string"==typeof l&&(s.__typename=l);const c=(...e)=>{const t=Vh(e,s,r.variables);if(Ff(t.from)){const e=r.incomingById.get(t.from.__ref);if(e){const n=o.readField({...t,from:e.storeObject},r);if(void 0!==n)return n}}return o.readField(t,r)},u=/* @__PURE__ */new Set;this.flattenFields(n,t,r,l).forEach((e,n)=>{const r=t[Tp(n)],d=[...a,n.name.value];if(u.add(n),void 0!==r){const t=o.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),a=Qh(i,t);let u,p=this.processFieldValue(r,n,n.selectionSet?Wh(e,!1,!1):e,a,d);n.selectionSet&&(Ff(p)||rh(p))&&(u=c("__typename",p));const f=o.getMergeFunction(l,n.name.value,u);f?a.info={field:n,typename:l,merge:f,path:d}:e.extensions?.[Wp]&&Array.isArray(p)&&function(e){return!!e.directives&&e.directives.some(e=>"stream"===e.name.value)}(n)?a.info={field:n,typename:l,merge:Fh,path:d}:Xh(i,t),s=e.merge(s,{[t]:p})}});try{const[i,a]=o.identify(t,{typename:l,selectionSet:n,fragmentMap:r.fragmentMap,storeObject:s,readField:c});e=e||i,a&&(s=r.merge(s,a))}catch(NL){if(!e)throw NL}if("string"==typeof e){const a=bp(e),o=r.written[e]||(r.written[e]=[]);if(o.indexOf(n)>=0)return a;if(o.push(n),this.reader&&this.reader.isFresh(t,a,n,r))return a;const l=r.incomingById.get(e);return l?(l.storeObject=r.merge(l.storeObject,s),l.mergeTree=Jh(l.mergeTree,i),u.forEach(e=>l.fieldNodeSet.add(e))):r.incomingById.set(e,{storeObject:s,mergeTree:Kh(i)?void 0:i,fieldNodeSet:u}),a}return s}processFieldValue(e,t,n,r,i){return t.selectionSet&&null!==e?mp(e)?e.map((e,a)=>{const o=this.processFieldValue(e,t,n,Qh(r,a),[...i,a]);return Xh(r,a),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r,path:i}):e}flattenFields(e,t,n,r=Zh(t,e,n.fragmentMap)){const i=/* @__PURE__ */new Map,{policies:a}=this.cache,o=new _d(!1);return function e(s,l){const c=o.lookup(s,l.clientOnly,l.deferred);c.visited||(c.visited=!0,s.selections.forEach(o=>{if(!Ep(o,n.variables))return;let{clientOnly:s,deferred:c}=l;if(s&&c||!yp(o.directives)||o.directives.forEach(e=>{const t=e.name.value;if("client"===t&&(s=!0),"defer"===t){const t=wd(e,n.variables);t&&!1===t.if||(c=!0)}}),gp(o)){const e=i.get(o);e&&(s=s&&e.clientOnly,c=c&&e.deferred),i.set(o,Wh(n,s,c))}else{const i=Zd(o,n.lookupFragment);if(!i&&"FragmentSpread"===o.kind)throw md(116,o.name.value);i&&a.fragmentMatches(i,r,t,n.variables)&&e(i.selectionSet,Wh(n,s,c))}}))}(e,n),i}applyMerges(e,t,n,r,i){if(e.map.size&&!Ff(n)){const a=mp(n)||!Ff(t)&&!rh(t)?void 0:t,o=n;let s;a&&!i&&(i=[Ff(a)?a.__ref:a]);const l=(e,t)=>mp(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t));e.map.forEach((e,t)=>{const n=l(a,t),c=l(o,t);if(void 0===c)return;i&&i.push(t);const u=this.applyMerges(e,n,c,r,i);u!==c&&(s=s||/* @__PURE__ */new Map,s.set(t,u)),i&&fd(i.pop()===t)}),s&&(n=mp(o)?o.slice(0):{...o},s.forEach((e,t)=>{n[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&r.store.getStorage(...i)):n}},Gh=[];function Qh({map:e},t){return e.has(t)||e.set(t,Gh.pop()||{map:/* @__PURE__ */new Map}),e.get(t)}function Jh(e,t){if(e===t||!t||Kh(t))return e;if(!e||Kh(e))return t;const n=e.info&&t.info?{...e.info,...t.info}:e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?/* @__PURE__ */new Map:e.map.size?e.map:t.map};if(r){const n=new Set(t.map.keys());e.map.forEach((e,r)=>{i.map.set(r,Jh(e,t.map.get(r))),n.delete(r)}),n.forEach(n=>{i.map.set(n,Jh(t.map.get(n),e.map.get(n)))})}return i}function Kh(e){return!e||!(e.info||e.map.size)}function Xh({map:e},t){const n=e.get(t);n&&Kh(n)&&(Gh.push(n),e.delete(t))}function Zh(e,t,n){let r;for(const i of t.selections)if(gp(i)){if("__typename"===i.name.value)return e[Tp(i)]}else r?r.push(i):r=[i];if("string"==typeof e.__typename)return e.__typename;if(r)for(const i of r){const t=Zh(e,Zd(i,n).selectionSet,n);if("string"==typeof t)return t}}var em=class extends Hf{data;optimisticData;config;watches=/* @__PURE__ */new Set;storeReader;storeWriter;addTypenameTransform=new Rf(qf);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=Dh;constructor(e={}){super(),this.config=function(e){return Hd(Zf,e)}(e),this.policies=new $h({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const e=this.data=new lh.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()}resetResultCache(){const{fragments:e}=this.config;this.addTypenameTransform.resetCache(),e?.resetCaches(),this.storeWriter=new Yh(this,this.storeReader=new Hh({cache:this,fragments:e}),e),this.maybeBroadcastWatch=Af((e,t)=>this.broadcastWatch(e,t),{max:Sd["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:e=>{const t=e.optimistic?this.optimisticData:this.data;if(mh(t)){const{optimistic:n,id:r,variables:i}=e;return t.makeCacheKey(e.query,e.callback,op({optimistic:n,id:r,variables:i}))}}}),
|
|
8
8
|
/* @__PURE__ */new Set([this.data.group,this.optimisticData.group]).forEach(e=>e.resetCaching())}restore(e){return this.init(),e&&this.data.replace(e),this}extract(e=!1){return(e?this.optimisticData:this.data).extract()}read(e){const{returnPartialData:t=!1}=e;return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:t}).result}write(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}}modify(e){if(Kf.call(e,"id")&&!e.id)return!1;const t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields,!1)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}}diff(e){return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config})}watch(e){var t;return this.watches.size||Ih(t=this).vars.forEach(e=>e.attachCache(t)),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&zh(this),this.maybeBroadcastWatch.forget(e)}}gc(e){op.reset(),Lf.reset();const t=this.optimisticData.gc();return e&&!this.txCount&&e.resetResultCache&&this.resetResultCache(),t}retain(e,t){return(t?this.optimisticData:this.data).retain(e)}release(e,t){return(t?this.optimisticData:this.data).release(e)}identify(e){if(Ff(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(NL){}}evict(e){if(!e.id){if(Kf.call(e,"id"))return!1;e={...e,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}}reset(e){return this.init(),op.reset(),e&&e.discardWatches?(this.watches.forEach(e=>this.maybeBroadcastWatch.forget(e)),this.watches.clear(),zh(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(e){const t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())}txCount=0;batch(e){const{update:t,optimistic:n=!0,removeOptimistic:r,onWatchUpdated:i}=e;let a;const o=e=>{const{data:n,optimisticData:r}=this;++this.txCount,e&&(this.data=this.optimisticData=e);try{return a=t(this)}finally{--this.txCount,this.data=n,this.optimisticData=r}},s=/* @__PURE__ */new Set;return i&&!this.txCount&&this.broadcastWatches({...e,onWatchUpdated:e=>(s.add(e),!1)}),"string"==typeof n?this.optimisticData=this.optimisticData.addLayer(n,o):!1===n?o(this.data):o(),"string"==typeof r&&(this.optimisticData=this.optimisticData.removeLayer(r)),i&&s.size?(this.broadcastWatches({...e,onWatchUpdated(e,t){const n=i.call(this,e,t);return!1!==n&&s.delete(e),n}}),s.size&&s.forEach(e=>this.maybeBroadcastWatch.dirty(e))):this.broadcastWatches(e),a}performTransaction(e,t){return this.batch({update:e,optimistic:t||null!==t})}transformDocument(e){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(e))}fragmentMatches(e,t){return this.policies.fragmentMatches(e,t)}lookupFragment(e){return this.config.fragments?.lookup(e)||null}resolvesClientField(e,t){return!!this.policies.getReadFunction(e,t)}broadcastWatches(e){if(!this.txCount){const t=this.onAfterBroadcast,n=/* @__PURE__ */new Set;this.onAfterBroadcast=e=>{n.add(e)};try{this.watches.forEach(t=>this.maybeBroadcastWatch(t,e)),n.forEach(e=>e())}finally{this.onAfterBroadcast=t}}}addFragmentsToDocument(e){const{fragments:t}=this.config;return t?t.transform(e):e}broadcastWatch(e,t){const{lastDiff:n}=e,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&Mp(n.result,r.result)||e.callback(e.lastDiff=r,n)}};function tm(e,t){return"object"==typeof e&&null!==e&&e[Symbol.for("apollo.error")]===t}function nm(e){Object.defineProperty(e,Symbol.for("apollo.error"),{value:e.name,enumerable:!1,writable:!1,configurable:!1})}function rm(e){return e.map(e=>e.message||"Error message not found.").join("\n")}var im=class e extends Error{static is(e){return tm(e,"CombinedProtocolErrors")}static formatMessage=rm;errors;constructor(t){super(e.formatMessage(t,{defaultFormatMessage:rm})),this.name="CombinedProtocolErrors",this.errors=t,nm(this),Object.setPrototypeOf(this,e.prototype)}},am=class e extends Error{static is(e){return tm(e,"UnconventionalError")}constructor(t){super("An error of unexpected shape occurred.",{cause:t}),this.name="UnconventionalError",nm(this),Object.setPrototypeOf(this,e.prototype)}};function om(e){return e.filter(e=>e).map(e=>e.message||"Error message not found.").join("\n")}var sm,lm=class e extends Error{static is(e){return tm(e,"CombinedGraphQLErrors")}static formatMessage=om;errors;data;extensions;constructor(t,n=t.errors||[]){super(e.formatMessage(n,{result:t,defaultFormatMessage:om})),this.errors=n,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",nm(this),Object.setPrototypeOf(this,e.prototype)}},cm=/* @__PURE__ */new WeakSet,um=class e extends Error{static is(e){return tm(e,"ServerError")}response;statusCode;bodyText;constructor(t,n){super(t),this.name="ServerError",this.response=n.response,this.statusCode=n.response.status,this.bodyText=n.bodyText,nm(this),Object.setPrototypeOf(this,e.prototype)}},dm=class e extends Error{static is(e){return tm(e,"ServerParseError")}response;statusCode;bodyText;constructor(t,n){super(t instanceof Error?t.message:"Could not parse server response",{cause:t}),this.name="ServerParseError",this.response=n.response,this.statusCode=n.response.status,this.bodyText=n.bodyText,nm(this),Object.setPrototypeOf(this,e.prototype)}},pm=Symbol();!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error",e[e.streaming=9]="streaming"}(sm||(sm={}));var{assign:fm,hasOwnProperty:hm}=Object,mm={loading:!0,networkStatus:sm.loading,data:void 0,dataState:"empty",partial:!0},gm={loading:!1,networkStatus:sm.ready,data:void 0,dataState:"empty",partial:!0},ym=class{options;queryName;variablesUnknown=!1;_lastWrite;get query(){return this.lastQuery}get variables(){return this.options.variables}unsubscribeFromCache;input;subject;isTornDown;queryManager;subscriptions=/* @__PURE__ */new Set;waitForNetworkResult;lastQuery;linkSubscription;pollingInfo;get networkStatus(){return this.subject.getValue().result.networkStatus}get cache(){return this.queryManager.cache}constructor({queryManager:e,options:t,transformedQuery:n=e.transform(t.query)}){this.queryManager=e,this.waitForNetworkResult="network-only"===t.fetchPolicy,this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:r="cache-first"}={}}=e.defaultOptions,{fetchPolicy:i=r,initialFetchPolicy:a=("standby"===i?r:i)}=t;t[Yp]&&(fd("standby"===i,82),this.variablesUnknown=!0),this.lastQuery=n,this.options={...t,initialFetchPolicy:a,fetchPolicy:i,variables:this.getVariablesWithDefaults(t.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const o=rp(this.query);this.queryName=o&&o.name&&o.name.value}initializeObservablesQueue(){this.subject=new yu({query:this.query,variables:this.variables,result:mm,meta:{}});const e=this.subject.pipe(rd({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),_p(({query:e,variables:t,result:n,meta:r},i)=>{const{shouldEmit:a}=r;if(n===mm&&(i.previous=void 0,i.previousVariables=void 0),"standby"===this.options.fetchPolicy||2===a)return;if(1===a)return l();const{previous:o,previousVariables:s}=i;if(o){const r=this.queryManager.getDocumentInfo(e),i=this.queryManager.dataMasking,a=i?r.nonReactiveQuery:e;if((i||r.hasNonreactiveDirective?$p(a,o,n,t):Mp(o,n))&&Mp(s,t))return}if(3!==a||this.options.notifyOnNetworkStatusChange&&!Mp(o,n))return l();function l(){return i.previous=n,i.previousVariables=t,n}},()=>({})));this.pipe=e.pipe.bind(e),this.subscribe=e.subscribe.bind(e),this.input=new mu,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:e=!0}={}){return this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e})}getInitialResult(e){let t=e||this.options.fetchPolicy;!this.queryManager.prioritizeCacheValues||"network-only"!==t&&"cache-and-network"!==t||(t="cache-first");const n=()=>{const e=this.getCacheDiff(),t=this.options.returnPartialData||e.complete?e.result??void 0:void 0;return this.maskResult({data:t,dataState:e.complete?"complete":void 0===t?"empty":"partial",loading:!e.complete,networkStatus:e.complete?sm.ready:sm.loading,partial:!e.complete})};switch(t){case"cache-only":return{...n(),loading:!1,networkStatus:sm.ready};case"cache-first":return n();case"cache-and-network":return{...n(),loading:!0,networkStatus:sm.loading};case"standby":return gm;default:return mm}}resubscribeCache(){const{variables:e,fetchPolicy:t}=this.options,n=this.query,r="standby"===t||"no-cache"===t||this.waitForNetworkResult,i=!bm({query:n,variables:e},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((r||i)&&this.unsubscribeFromCache?.(),r||!i)return;const a={query:n,variables:e,optimistic:!0,watcher:this,callback:e=>{const t=this.queryManager.getDocumentInfo(n);if((t.hasClientExports||t.hasForcedResolvers)&&(a.lastDiff=void 0),a.lastOwnDiff===e)return;const{result:r}=this.subject.getValue();(e.complete||!r.error&&r!==mm&&r!==gm)&&(Mp(r.data,e.result)||this.scheduleNotify())}},o=this.cache.watch(a);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,o()},{query:n,variables:e})}stableLastResult;getCurrentResult(){const{result:e}=this.subject.getValue();let t=e.networkStatus===sm.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?e:this.getInitialResult();return t===mm&&(t=this.getInitialResult()),Mp(this.stableLastResult,t)||(this.stableLastResult=t),this.stableLastResult}refetch(e){const{fetchPolicy:t}=this.options,n={pollInterval:0};return n.fetchPolicy="no-cache"===t?"no-cache":"network-only",e&&!Mp(this.variables,e)&&(n.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._lastWrite=void 0,this._reobserve(n,{newNetworkStatus:sm.refetch})}fetchMore({query:e,variables:t,context:n,errorPolicy:r,updateQuery:i}){fd("cache-only"!==this.options.fetchPolicy,84,Nd(this.query,"(anonymous)"));const a={...Hd(this.options,{errorPolicy:"none"},{query:e,context:n,errorPolicy:r}),variables:e?t:{...this.variables,...t},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};a.query=this.transformDocument(a.query),this.lastQuery=e?this.transformDocument(this.options.query):a.query;let o=!1;const s="no-cache"!==this.options.fetchPolicy;s||fd(i,85);const{finalize:l,pushNotification:c}=this.pushOperation(sm.fetchMore);c({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:u,operator:d}=vm(),{observable:p}=this.queryManager.fetchObservableWithInfo(a,{networkStatus:sm.fetchMore,exposeExtensions:!0}),f=p.pipe(d,Ku(e=>"N"===e.kind&&"network"===e.source)).subscribe({next:e=>{o=!1;const t=e.value,n=t[Hp];if(Bf(e.value.networkStatus)&&l(),s){const e=this.getCacheDiff();this.cache.batch({update:e=>{i?e.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:n},e=>i(e,{fetchMoreResult:t.data,variables:a.variables})):e.writeQuery({query:a.query,variables:a.variables,data:t.data,extensions:n})},onWatchUpdated:(n,r)=>{if(n.watcher===this&&!Mp(r.result,e.result)){o=!0;const e=this.getCurrentResult();Uf(t.networkStatus)&&c({kind:"N",source:"network",value:{...e,networkStatus:t.networkStatus===sm.error?sm.ready:t.networkStatus,loading:!1,data:r.result,dataState:"streaming"===t.dataState?"streaming":"complete"}})}}})}else{const e=this.getCurrentResult(),n=i(e.data,{fetchMoreResult:t.data,variables:a.variables});c({kind:"N",value:{...e,networkStatus:sm.ready,loading:!1,data:n,dataState:"streaming"===e.dataState?"streaming":"complete"},source:"network"})}}});return wp(u.then(e=>Op(this.maskResult(e))).finally(()=>{if(f.unsubscribe(),l(),s&&!o){const e=this.getCurrentResult();"streaming"===e.dataState?c({kind:"N",source:"network",value:{...e,dataState:"complete",networkStatus:sm.ready}}):c({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})}}))}subscribeToMore(e){const t=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:t=>{const{updateQuery:n,onError:r}=e,{error:i}=t;i?r?r(i):fd.error(86,i):n&&this.updateQuery((e,r)=>n(e,{subscriptionData:t,...r}))}});return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)&&t.unsubscribe()}}applyOptions(e){const t=Hd(this.options,e||{});fm(this.options,t),this.updatePolling()}async setVariables(e){return e=this.getVariablesWithDefaults(e),Mp(this.variables,e)?Op(this.getCurrentResult()):(this.options.variables=e,this.hasObservers()?this._reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},{newNetworkStatus:sm.setVariables}):Op(this.getCurrentResult()))}updateQuery(e){const{queryManager:t}=this,{result:n,complete:r}=this.getCacheDiff({optimistic:!1}),i=e(n,{variables:this.variables,complete:!!r,previousData:n});i&&(this.cache.writeQuery({query:this.options.query,data:i,variables:this.variables}),t.broadcastQueries())}startPolling(e){this.options.pollInterval=e,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(e,t){if(t.nextFetchPolicy){const{fetchPolicy:n="cache-first",initialFetchPolicy:r=n}=t;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy.call(t,n,{reason:e,options:t,observable:this,initialFetchPolicy:r}):t.fetchPolicy="variables-changed"===e?r:t.nextFetchPolicy)}return t.fetchPolicy}fetch(e,t,n,r){const i=this.options.fetchPolicy;e.context??={};let a=!1,{observable:o,fromLink:s}=this.queryManager.fetchObservableWithInfo(e,{networkStatus:t,query:n,onCacheHit:()=>{a=!0},fetchQueryOperator:e=>new cu(n=>{try{return e.subscribe({next(e){a=!0,n.next(e)},error:e=>n.error(e),complete:()=>n.complete()})}finally{a||(u.override=t,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:l,variables:c,meta:{shouldEmit:3,fetchPolicy:i}}))}}),observableQuery:this});const{query:l,variables:c}=this,u={abort:()=>{p.unsubscribe()},query:l,variables:c};this.activeOperations.add(u);let d=t==sm.refetch||t==sm.setVariables;o=o.pipe(r,ed());const p=o.pipe(rd({next:e=>{"newNetworkStatus"===e.source||"N"===e.kind&&e.value.loading?u.override=t:delete u.override},finalize:()=>this.activeOperations.delete(u)})).subscribe({next:e=>{const t={};d&&"N"===e.kind&&"loading"in e.value&&!e.value.loading&&(d=!1,t.shouldEmit=1),this.input.next({...e,query:l,variables:c,meta:t})}});return{fromLink:s,subscription:p,observable:o}}didWarnCacheOnlyPolling=!1;updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:e,options:{fetchPolicy:t,pollInterval:n}}=this,r=()=>{const{options:e}=this;return!e.pollInterval||!this.hasObservers()||"cache-only"===e.fetchPolicy||"standby"===e.fetchPolicy};if(r())return void this.cancelPolling();if(e?.interval===n)return;(e||(this.pollingInfo={})).interval=n;const i=()=>{if(r())return this.cancelPolling();this.pollingInfo&&(Uf(this.networkStatus)||this.options.skipPollAttempt?.()?a():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:sm.poll}).then(a,a))},a=()=>{const e=this.pollingInfo;e&&(clearTimeout(e.timeout),e.timeout=setTimeout(i,e.interval))};a()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(e){return this._reobserve(e)}_reobserve(e,t){this.isTornDown=!1;let{newNetworkStatus:n}=t||{};this.queryManager.obsQueries.add(this);const r=n===sm.refetch||n===sm.poll,i=this.variables,a=this.options.fetchPolicy,o=Hd(this.options,e||{});this.variablesUnknown&&="standby"===o.fetchPolicy;const s=r?o:fm(this.options,o),l=this.transformDocument(s.query);this.lastQuery=l,e&&"variables"in e&&(s.variables=this.getVariablesWithDefaults(e.variables)),r||(this.updatePolling(),!e||!e.variables||Mp(e.variables,i)||"standby"===s.fetchPolicy||s.fetchPolicy!==a&&"function"!=typeof s.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",s),void 0===n&&(n=sm.setVariables)));const c=this.networkStatus;n||(n=sm.loading,c!==sm.loading&&e?.variables&&!Mp(e.variables,i)&&(n=sm.setVariables),"standby"===s.fetchPolicy&&(n=sm.ready)),"standby"===s.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:u,operator:d}=vm("standby"===s.fetchPolicy?{data:void 0}:void 0),{subscription:p,observable:f,fromLink:h}=this.fetch(s,n,l,d);r||!h&&this.linkSubscription||(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=p);const m=Object.assign(wp(u.then(e=>Op(this.maskResult(e))).finally(()=>{this.hasObservers()||0!==this.activeOperations.size||this.tearDownQuery()})),{retain:()=>{const e=f.subscribe({}),t=()=>e.unsubscribe();return u.then(t,t),m}});return m}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){this.isTornDown||(this.resetNotifications(),this.unsubscribeFromCache?.(),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(e){return this.queryManager.transform(e)}maskResult(e){const t=this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,cause:this});return t===e.data?e:{...e,data:t}}dirty=!1;notifyTimeout;resetNotifications(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0),this.dirty=!1}scheduleNotify(){this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(()=>this.notify(!0),0)))}notify(e=!1){if(!e){const e=this.queryManager.getDocumentInfo(this.query);if(e.hasClientExports||e.hasForcedResolvers)return}const{dirty:t}=this;if(this.resetNotifications(),t&&("cache-only"===this.options.fetchPolicy||"cache-and-network"===this.options.fetchPolicy||!this.activeOperations.size)){const e=this.getCacheDiff();Mp(e.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:e.result,dataState:e.complete?"complete":e.result?"partial":"empty",networkStatus:sm.ready,loading:!1,error:void 0,partial:!e.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}activeOperations=/* @__PURE__ */new Set;pushOperation(e){let t=!1;const{query:n,variables:r}=this,i=()=>{this.activeOperations.delete(a)},a={override:e,abort:()=>{t=!0,i()},query:n,variables:r};return this.activeOperations.add(a),{finalize:i,pushNotification:(e,i)=>{t||this.input.next({...e,query:n,variables:r,meta:{...i}})}}}calculateNetworkStatus(e){return e===sm.streaming?e:Array.from(this.activeOperations.values()).reverse().find(e=>bm(e,this)&&void 0!==e.override)?.override??e}abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){const e="cache-only"===this.options.fetchPolicy;this.setResult(e?gm:mm,{shouldEmit:e?1:2}),this.abortActiveOperations()}setResult(e,t){this.input.next({source:"setResult",kind:"N",value:e,query:this.query,variables:this.variables,meta:{...t}})}operator=_p(e=>{const{query:t,variables:n,meta:r}=e;if("setResult"===e.source)return{query:t,variables:n,result:e.value,meta:r};if("C"===e.kind||!bm(e,this))return;let i;const a=this.subject.getValue();if("cache"===e.source){if(i=e.value,i.networkStatus===sm.ready&&i.partial&&(!this.options.returnPartialData||a.result.networkStatus===sm.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===e.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),i="E"===e.kind?{...bm(a,e)?a.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:sm.error,loading:!1}:e.value,"E"===e.kind&&"streaming"===i.dataState&&(i.dataState="complete"),i.error&&(r.shouldEmit=1);else if("newNetworkStatus"===e.source){const t=bm(a,e)?a.result:this.getInitialResult(r.fetchPolicy),{resetError:n}=e.value,o=n?void 0:t.error,s=o?sm.error:sm.ready;i={...t,error:o,networkStatus:s}}return fd(i),i.error||delete i.error,i.networkStatus=this.calculateNetworkStatus(i.networkStatus),i.loading=Uf(i.networkStatus),i=this.maskResult(i),void 0!==a.result.data&&i.data!==a.result.data&&Mp(i.data,a.result.data)&&(i.data=a.result.data),{query:t,variables:n,result:i,meta:r}});reobserveCacheFirst(){const{fetchPolicy:e,nextFetchPolicy:t}=this.options;"cache-and-network"===e||"network-only"===e?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(n,r){return this.nextFetchPolicy=t,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(n,r):e}}):this.reobserve()}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}};function bm(e,t){return!!(e&&t&&e.query===t.query&&Mp(e.variables,t.variables))}function vm(e){let t,n,r=e;return{promise:new Promise((e,r)=>{t=e,n=r}),operator:rd({next(e){if("E"===e.kind)return n(e.error);"N"!==e.kind||"newNetworkStatus"===e.source||e.value.loading||(r=e.value)},finalize:()=>{if(r)t(r);else{const e="The operation was aborted.",t="AbortError";n("undefined"!=typeof DOMException?new DOMException(e,t):Object.assign(/* @__PURE__ */new Error(e),{name:t}))}}})}}var xm={},wm=/* @__PURE__ */new WeakMap;function km(e,t){const n=e[t];"function"==typeof n&&(e[t]=function(){return wm.set(e,(wm.get(e)+1)%1e15),n.apply(this,arguments)})}var Sm=/* @__PURE__ */new WeakMap,Nm=class{cache;queryManager;id;observableQuery;incremental;constructor(e,t){const n=this.cache=e.cache,r=(Sm.get(e)||0)+1;Sm.set(e,r),this.id=r+"",this.observableQuery=t,this.queryManager=e,wm.has(n)||(wm.set(n,0),km(n,"evict"),km(n,"modify"),km(n,"reset"))}_lastWrite;get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(e){(this.observableQuery||this)._lastWrite=e}resetLastWrite(){this.lastWrite=void 0}shouldWrite(e,t){const{lastWrite:n}=this;return!(n&&n.dmCount===wm.get(this.cache)&&Mp(t,n.variables)&&Mp(e.data,n.result.data)&&e.extensions?.[Wp]===n.result.extensions?.[Wp])}get hasNext(){return!!this.incremental&&this.incremental.hasNext}maybeHandleIncrementalResult(e,t,n){const{incrementalHandler:r}=this.queryManager;return r.isIncrementalResult(t)?(this.incremental||=r.startRequest({query:n}),this.incremental.handle(e,t)):t}markQueryResult(e,{document:t,variables:n,errorPolicy:r,cacheWriteBehavior:i}){const a={query:t,variables:n,returnPartialData:!0,optimistic:!0};this.observableQuery?.resetNotifications();const o=0===i,s=o?void 0:this.cache.diff(a);let l=this.maybeHandleIncrementalResult(s?.result,e,t);return o||(Cm(l,r)?this.cache.batch({onWatchUpdated:(e,t)=>{e.watcher===this.observableQuery&&(e.lastOwnDiff=t)},update:e=>{if(this.shouldWrite(l,n))e.writeQuery({query:t,data:l.data,variables:n,overwrite:1===i,extensions:l.extensions}),this.lastWrite={result:l,variables:n,dmCount:wm.get(this.cache)};else if(s&&s.complete)return void(l={...l,data:s.result});const r=e.diff(a);r.complete&&(l={...l,data:r.result})}}):this.lastWrite=void 0),l}markMutationResult(e,t,n=this.cache){const r=[],i=0===t.cacheWriteBehavior;let a=this.maybeHandleIncrementalResult(i?void 0:n.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}).result,e,t.document);if("ignore"===t.errorPolicy&&(a={...a,errors:[]}),pp(a)&&"none"===t.errorPolicy)return Promise.resolve(a);const o=()=>({...a,dataState:this.hasNext?"streaming":"complete"});if(!i&&Cm(a,t.errorPolicy)){r.push({result:a.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables,extensions:a.extensions});const{updateQueries:e}=t;e&&this.queryManager.getObservableQueries("all").forEach(t=>{const n=t&&t.queryName;if(!n||!Object.hasOwnProperty.call(e,n))return;const i=e[n],{query:a,variables:s}=t,{result:l,complete:c}=t.getCacheDiff({optimistic:!1});if(c&&l){const e=i(l,{mutationResult:o(),queryName:a&&Nd(a)||void 0,queryVariables:s});e&&r.push({result:e,dataId:"ROOT_QUERY",query:a,variables:s})}})}let s=t.refetchQueries;if("function"==typeof s&&(s=s(o())),r.length>0||(s||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){const e=[];if(this.queryManager.refetchQueries({updateCache:e=>{i||r.forEach(t=>e.write(t));const{update:n}=t;if(n){if(!i){const n=e.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});n.complete&&(a={...a,data:n.result})}this.hasNext||n(e,a,{context:t.context,variables:t.variables})}i||t.keepRootFields||this.hasNext||e.modify({id:"ROOT_MUTATION",fields:(e,{fieldName:t,DELETE:n})=>"__typename"===t?e:n})},include:s,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(t=>e.push(t)),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(e).then(()=>a)}return Promise.resolve(a)}markMutationOptimistic(e,t){const n="function"==typeof e?e(t.variables,{IGNORE:xm}):e;return n!==xm&&(this.cache.recordOptimisticTransaction(e=>{try{this.markMutationResult({data:n},t,e)}catch(r){fd.error(r)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:n,errorPolicy:r,cacheWriteBehavior:i}){0!==i&&(Cm(e,r)&&this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:n,extensions:e.extensions}),this.queryManager.broadcastQueries())}};function Cm(e,t="none"){const n="ignore"===t||"all"===t;let r=!pp(e);return!r&&n&&e.data&&(r=!0),r}var Tm=class{defaultOptions;client;clientOptions;assumeImmutableResults;documentTransform;ssrMode;defaultContext;dataMasking;incrementalHandler;localState;queryDeduplication;prioritizeCacheValues=!1;onBroadcast;mutationStore;obsQueries=/* @__PURE__ */new Set;fetchCancelFns=/* @__PURE__ */new Map;constructor(e){const t=new Rf(e=>this.cache.transformDocument(e),{cache:!1});this.client=e.client,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientOptions=e.clientOptions,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking,this.localState=e.localState,this.incrementalHandler=e.incrementalHandler;const n=e.documentTransform;this.documentTransform=n?t.concat(n).concat(t):t,this.defaultContext=e.defaultContext||{},(this.onBroadcast=e.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(e=>e.stop()),this.cancelPendingFetches(md(89))}cancelPendingFetches(e){this.fetchCancelFns.forEach(t=>t(e)),this.fetchCancelFns.clear()}async mutate({mutation:e,variables:t,optimisticResponse:n,updateQueries:r,refetchQueries:i=[],awaitRefetchQueries:a=!1,update:o,onQueryUpdated:s,fetchPolicy:l,errorPolicy:c,keepRootFields:u,context:d}){const p=new Nm(this);e=this.cache.transformForLink(this.transform(e));const{hasClientExports:f}=this.getDocumentInfo(e);t=this.getVariables(e,t),f&&(t=await this.localState.getExportedVariables({client:this.client,document:e,variables:t,context:d}));const h=this.mutationStore&&(this.mutationStore[p.id]={mutation:e,variables:t,loading:!0,error:null}),m=n&&p.markMutationOptimistic(n,{document:e,variables:t,cacheWriteBehavior:"no-cache"===l?0:2,errorPolicy:c,context:d,updateQueries:r,update:o,keepRootFields:u});return this.broadcastQueries(),new Promise((f,g)=>{const y={};return this.getObservableFromLink(e,{...d,optimisticResponse:m?n:void 0},t,l,{},!1).observable.pipe(Em(),Qu(n=>{const f={...n};return Uu(p.markMutationResult(f,{document:e,variables:t,cacheWriteBehavior:"no-cache"===l?0:2,errorPolicy:c,context:d,update:o,updateQueries:r,awaitRefetchQueries:a,refetchQueries:i,removeOptimistic:m?p.id:void 0,onQueryUpdated:s,keepRootFields:u}))})).pipe(Gu(e=>{if(pp(e)&&"none"===c)throw new lm(_m(e));return h&&(h.loading=!1,h.error=null),e})).subscribe({next:t=>{if(this.broadcastQueries(),!p.hasNext){const n={data:this.maskOperation({document:e,data:t.data,fetchPolicy:l,cause:y})};pp(t)&&(n.error=new lm(t)),Object.keys(t.extensions||{}).length&&(n.extensions=t.extensions),f(n)}},error:e=>(h&&(h.loading=!1,h.error=e),m&&this.cache.removeOptimistic(p.id),this.broadcastQueries(),"ignore"===c?f({data:void 0}):"all"===c?f({data:void 0,error:e}):void g(e))})})}fetchQuery(e,t){return Bd(e.query,ys),(async()=>{return n=this.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(_p(e=>{switch(e.kind){case"E":throw e.error;case"N":if("newNetworkStatus"!==e.source)return Op(e.value)}})),r={defaultValue:{data:void 0}},new Promise(function(e,t){var i,a=!1;n.subscribe({next:function(e){i=e,a=!0},error:t,complete:function(){e(a?i:r.defaultValue)}})});var n,r})()}transform(e){return this.documentTransform.transformDocument(e)}transformCache=new $d(Sd["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const n=rp(e),r={hasClientExports:fp(["client","export"],e,!0),hasForcedResolvers:hp(e),hasNonreactiveDirective:fp(["nonreactive"],e),hasIncrementalDirective:fp(["defer"],e),nonReactiveQuery:Om(e),clientQuery:fp(["client"],e)?e:null,serverQuery:kp([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:n?.operation,defaultVars:Xd(n),asQuery:{...e,definitions:e.definitions.map(e=>"OperationDefinition"===e.kind&&"query"!==e.operation?{...e,operation:"query"}:e)}};t.set(e,r)}const n=t.get(e);if(n.violation)throw n.violation;return n}getVariables(e,t){const n=this.getDocumentInfo(e).defaultVars,r=Object.entries(t??{}).map(([e,t])=>[e,void 0===t?n[e]:t]);return{...n,...Object.fromEntries(r)}}watchQuery(e){Bd(e.query,ys);const t=this.transform(e.query);return void 0===(e={...e,variables:this.getVariables(t,e.variables)}).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!0),new ym({queryManager:this,options:e,transformedQuery:t})}query(e){const t=this.transform(e.query);return this.fetchQuery({...e,query:t}).then(n=>({...n,data:this.maskOperation({document:t,data:n?.data,fetchPolicy:e.fetchPolicy})}))}clearStore(e={discardWatches:!0}){return this.cancelPendingFetches(md(91)),this.obsQueries.forEach(e=>{e.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(e)}getObservableQueries(e="active"){const t=/* @__PURE__ */new Set,n=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map,i=/* @__PURE__ */new Set;return Array.isArray(e)&&e.forEach(e=>{if("string"==typeof e)n.set(e,e),r.set(e,!1);else if(Yd(t=e)&&"Document"===t.kind&&Array.isArray(t.definitions)){const t=Lf(this.transform(e));n.set(t,Nd(e)),r.set(t,!1)}else Yd(e)&&e.query&&i.add(e);var t}),this.obsQueries.forEach(n=>{const i=Lf(this.transform(n.options.query));if("all"===e)return void t.add(n);const{queryName:a,options:{fetchPolicy:o}}=n;"active"===e&&"standby"===o||("active"===e||a&&r.has(a)||i&&r.has(i))&&(t.add(n),a&&r.set(a,!0),i&&r.set(i,!0))}),i.size&&i.forEach(e=>{const n=new ym({queryManager:this,options:{...xp(this.defaultOptions.watchQuery,e),fetchPolicy:"network-only"}});t.add(n)}),t}refetchObservableQueries(e=!1){const t=[];return this.getObservableQueries(e?"all":"active").forEach(n=>{const{fetchPolicy:r}=n.options;!e&&"standby"===r||"cache-only"===r||t.push(n.refetch())}),this.broadcastQueries(),Promise.all(t)}startGraphQLSubscription(e){let{query:t,variables:n}=e;const{fetchPolicy:r="cache-first",errorPolicy:i="none",context:a={},extensions:o={}}=e;let s;Bd(t,vs),t=this.transform(t),n=this.getVariables(t,n);const l=(this.getDocumentInfo(t).hasClientExports?Uu(this.localState.getExportedVariables({client:this.client,document:t,variables:n,context:a})):Hu(n)).pipe(Qu(e=>{const{observable:n,restart:l}=this.getObservableFromLink(t,a,e,r,o),c=new Nm(this);return s=l,n.pipe(Gu(n=>{c.markSubscriptionResult(n,{document:t,variables:e,errorPolicy:i,cacheWriteBehavior:"no-cache"===r?0:2});const a={data:n.data??void 0};return pp(n)?a.error=new lm(n):function(e){return"extensions"in e&&im.is(e.extensions[pm])}(n)&&(a.error=n.extensions[pm],delete n.extensions[pm]),n.extensions&&Object.keys(n.extensions).length&&(a.extensions=n.extensions),a.error&&"none"===i&&(a.data=void 0),"ignore"===i&&delete a.error,a}),Xu(e=>Hu("ignore"===i?{data:void 0}:{data:void 0,error:e})),Ku(e=>!(!e.data&&!e.error)))}));return Object.assign(l,{restart:()=>s?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new _d(!1);getObservableFromLink(e,t,n,r,i,a=t?.queryDeduplication??this.queryDeduplication){let o={};const{serverQuery:s,clientQuery:l,operationType:c,hasIncrementalDirective:u}=this.getDocumentInfo(e),d=Nd(e),p={client:this.client};if(s){const{inFlightLinkObservables:m,link:g}=this;try{const y=this.incrementalHandler.prepareRequest({query:s,variables:n,context:{...this.defaultContext,...t,queryDeduplication:a},extensions:i});function b(e){return new cu(t=>{function n(){return e.subscribe({next:t.next.bind(t),complete:t.complete.bind(t),error:t.error.bind(t)})}let r=n();return o.restart||=()=>{r.unsubscribe(),r=n()},()=>{r.unsubscribe(),o.restart=void 0}})}if(t=y.context,a){const v=Lf(s),x=op(n);o=m.lookup(v,x),o.observable||(o.observable=Mf(g,y,p).pipe(b,(f=()=>{m.peek(v,x)===o&&m.remove(v,x)},du(function(e,t){try{e.subscribe(t)}finally{t.add(f)}})),c===vs?ed():nd({refCount:!0})))}else o.observable=Mf(g,y,p).pipe(b)}catch(h){o.observable=Wu(()=>h)}}else o.observable=Hu({data:{}});var f;if(l){const{operation:w}=rp(e);fd(!u,96,w[0].toUpperCase()+w.slice(1),d??"(anonymous)"),o.observable=o.observable.pipe(Qu(e=>Uu(this.localState.execute({client:this.client,document:l,remoteResult:e,context:t,variables:n,fetchPolicy:r}))))}return{restart:()=>o.restart?.(),observable:o.observable.pipe(Xu(e=>{throw function(e){cm.add(e)}(e=function(e){return function(e){return null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name&&("string"==typeof e.stack||void 0===e.stack)}(e)?e:"string"==typeof e?new Error(e,{cause:e}):new am(e)}(e)),e}))}}getResultsFromLink(e,{queryInfo:t,cacheWriteBehavior:n,observableQuery:r,exposeExtensions:i}){const{errorPolicy:a}=e,o=this.cache.transformForLink(e.query);return this.getObservableFromLink(o,e.context,e.variables,e.fetchPolicy).observable.pipe(Gu(s=>{const l=t.markQueryResult(s,{...e,document:o,cacheWriteBehavior:n}),c=pp(l);if(c&&"none"===a)throw t.resetLastWrite(),r?.resetNotifications(),new lm(_m(l));const u={data:l.data,...t.hasNext?{loading:!0,networkStatus:sm.streaming,dataState:"streaming",partial:!0}:{dataState:l.data?"complete":"empty",loading:!1,networkStatus:sm.ready,partial:!l.data}};return i&&"extensions"in l&&(u[Hp]=l.extensions),c&&("none"===a&&(u.data=void 0,u.dataState="empty"),"ignore"!==a&&(u.error=new lm(_m(l)),"streaming"!==u.dataState&&(u.networkStatus=sm.error))),u}),Xu(e=>{if("none"===a)throw t.resetLastWrite(),r?.resetNotifications(),e;const n={data:void 0,dataState:"empty",loading:!1,networkStatus:sm.ready,partial:!0};return"ignore"!==a&&(n.error=e,n.networkStatus=sm.error),Hu(n)}))}fetchObservableWithInfo(e,{networkStatus:t=sm.loading,query:n=e.query,fetchQueryOperator:r=e=>e,onCacheHit:i=()=>{},observableQuery:a,exposeExtensions:o}){const s=this.getVariables(n,e.variables);let{fetchPolicy:l="cache-first",errorPolicy:c="none",returnPartialData:u=!1,notifyOnNetworkStatusChange:d=!0,context:p={}}=e;!this.prioritizeCacheValues||"network-only"!==l&&"cache-and-network"!==l||(l="cache-first");const f=Object.assign({},e,{query:n,variables:s,fetchPolicy:l,errorPolicy:c,returnPartialData:u,notifyOnNetworkStatusChange:d,context:p}),h=new Nm(this,a),m=n=>{f.variables=n;const s="no-cache"===l?0:t===sm.refetch&&"merge"!==f.refetchWritePolicy?1:2,c=this.fetchQueryByPolicy(f,{queryInfo:h,cacheWriteBehavior:s,onCacheHit:i,observableQuery:a,exposeExtensions:o});return c.observable=c.observable.pipe(r),"standby"!==f.fetchPolicy&&a?.applyNextFetchPolicy("after-fetch",e),c},g=()=>{this.fetchCancelFns.delete(h.id)};this.fetchCancelFns.set(h.id,e=>{y.next({kind:"E",error:e,source:"network"})});const y=new mu;let b,v;if(this.getDocumentInfo(f.query).hasClientExports)b=Uu(this.localState.getExportedVariables({client:this.client,document:f.query,variables:f.variables,context:f.context})).pipe(Qu(e=>m(e).observable)),v=!0;else{const e=m(f.variables);v=e.fromLink,b=e.observable}return{observable:new cu(e=>{e.add(g),b.subscribe(e),y.subscribe(e)}).pipe(ed()),fromLink:v}}refetchQueries({updateCache:e,include:t,optimistic:n=!1,removeOptimistic:r=(n?ld("refetchQueries"):void 0),onQueryUpdated:i}){const a=/* @__PURE__ */new Map;t&&this.getObservableQueries(t).forEach(e=>{if("cache-only"===e.options.fetchPolicy||e.variablesUnknown)return;const t=e.getCurrentResult();a.set(e,{oq:e,lastDiff:{result:t?.data,complete:!t?.partial}})});const o=/* @__PURE__ */new Map;if(e){const t=/* @__PURE__ */new Set;this.cache.batch({update:e,optimistic:n&&r||!1,removeOptimistic:r,onWatchUpdated(e,n,r){const s=e.watcher;if(s instanceof ym&&!t.has(s)){if(t.add(s),i){a.delete(s);let e=i(s,n,r);return!0===e&&(e=s.refetch().retain()),!1!==e&&o.set(s,e),e}null!==i&&"cache-only"!==s.options.fetchPolicy&&a.set(s,{oq:s,lastDiff:r,diff:n})}}})}return a.size&&a.forEach(({oq:e,lastDiff:t,diff:n})=>{let r;i&&(n||(n=e.getCacheDiff()),r=i(e,n,t)),i&&!0!==r||(r=e.refetch().retain()),!1!==r&&o.set(e,r)}),r&&this.cache.removeOptimistic(r),o}noCacheWarningsByCause=/* @__PURE__ */new WeakSet;maskOperation(e){const{document:t,data:n}=e;return this.dataMasking?function(e,t,n){const r=rp(t);return fd(r,43),null==e?e:bh(e,r.selectionSet,{operationType:r.operation,operationName:r.name?.value,fragmentMap:Wd(tp(t)),cache:n,mutableTargets:/* @__PURE__ */new WeakMap,knownChanged:/* @__PURE__ */new WeakSet})}(n,t,this.cache):n}maskFragment(e){const{data:t,fragment:n,fragmentName:r}=e;return this.dataMasking?function(e,t,n,r){const i=t.definitions.filter(e=>e.kind===Is);void 0===r&&(fd(1===i.length,41,i.length),r=i[0].name.value);const a=i.find(e=>e.name.value===r);return fd(!!a,42,r),null==e||Mp(e,{})?e:bh(e,a.selectionSet,{operationType:"fragment",operationName:a.name.value,fragmentMap:Wd(tp(t)),cache:n,mutableTargets:/* @__PURE__ */new WeakMap,knownChanged:/* @__PURE__ */new WeakSet})}(t,n,this.cache,r):t}fetchQueryByPolicy({query:e,variables:t,fetchPolicy:n,errorPolicy:r,returnPartialData:i,context:a},{cacheWriteBehavior:o,onCacheHit:s,queryInfo:l,observableQuery:c,exposeExtensions:u}){const d=()=>this.cache.diff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),p=(o,l)=>{const c=o.result,u=e=>(o.complete||i||(e=void 0),{data:e,dataState:o.complete?"complete":e?"partial":"empty",loading:Uf(l),networkStatus:l,partial:!o.complete}),d=e=>Hu({kind:"N",value:u(e),source:"cache"});return(o.complete||i)&&this.getDocumentInfo(e).hasForcedResolvers?(s(),Uu(this.localState.execute({client:this.client,document:e,remoteResult:c?{data:c}:void 0,context:a,variables:t,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:n}).then(e=>({kind:"N",value:u(e.data||void 0),source:"cache"})))):"none"===r&&l===sm.refetch&&o.missing?d(void 0):d(c||void 0)},f=()=>this.getResultsFromLink({query:e,variables:t,context:a,fetchPolicy:n,errorPolicy:r},{cacheWriteBehavior:o,queryInfo:l,observableQuery:c,exposeExtensions:u}).pipe(Em(),du(function(e,t){e.subscribe(pu(t,function(e){t.next(Yu.createNext(e))},function(){t.next(Yu.createComplete()),t.complete()},function(e){t.next(Yu.createError(e)),t.complete()}))}),Gu(e=>({...e,source:"network"})));switch(n){default:case"cache-first":{const e=d();return e.complete?{fromLink:!1,observable:p(e,sm.ready)}:i?{fromLink:!0,observable:Ju(p(e,sm.loading),f())}:{fromLink:!0,observable:f()}}case"cache-and-network":{const e=d();return e.complete||i?{fromLink:!0,observable:Ju(p(e,sm.loading),f())}:{fromLink:!0,observable:f()}}case"cache-only":return{fromLink:!1,observable:Ju(p(d(),sm.ready))};case"network-only":case"no-cache":return{fromLink:!0,observable:f()};case"standby":return{fromLink:!1,observable:Cu}}}};function Em(){let e=!1;return rd({next(){e=!0},complete(){fd(e,100)}})}function Om(e){return _l(e,{FragmentSpread:e=>{if(!e.directives?.some(e=>"unmask"===e.name.value))return{...e,directives:[...e.directives||[],{kind:Vs,name:{kind:ws,value:"nonreactive"}}]}}})}function _m(e){if(null==e.extensions?.[Wp])return e;const{extensions:{[Wp]:t,...n},...r}=e;return Object.keys(n).length>0&&(r.extensions=n),r}var Am=class{link;cache;disableNetworkFetches;set prioritizeCacheValues(e){this.queryManager.prioritizeCacheValues=e}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}version;queryDeduplication;defaultOptions;devtoolsConfig;refetchEventManager;queryManager;devToolsHookCb;resetStoreCallbacks=[];clearStoreCallbacks=[];constructor(e){const{cache:t,documentTransform:n,ssrMode:r=!1,ssrForceFetchDelay:i=0,queryDeduplication:a=!0,defaultOptions:o,defaultContext:s,assumeImmutableResults:l=t.assumeImmutableResults,localState:c,devtools:u,dataMasking:d,link:p,incrementalHandler:f=new zf,experiments:h=[],refetchEventManager:m}=e;this.link=p,this.cache=t,this.queryDeduplication=a,this.defaultOptions=o||{},this.devtoolsConfig={...u,enabled:u?.enabled??!1},this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.refetchObservableQueries=this.refetchObservableQueries.bind(this),this.version=od,this.queryManager=new Tm({client:this,defaultOptions:this.defaultOptions,defaultContext:s,documentTransform:n,queryDeduplication:a,ssrMode:r,dataMasking:!!d,clientOptions:e,incrementalHandler:f,assumeImmutableResults:l,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:c}),this.prioritizeCacheValues=r||i>0,i&&setTimeout(()=>{this.prioritizeCacheValues=!1},i),this.devtoolsConfig.enabled&&this.connectToDevTools(),h.forEach(t=>t.call(this,e)),this.refetchEventManager=m,this.refetchEventManager?.connect(this)}connectToDevTools(){if("undefined"==typeof window)return;const e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(e){this.queryManager.localState=e}stop(){this.queryManager.stop(),this.refetchEventManager?.disconnect(this)}watchQuery(e){const{refetchOn:t}=e;if(this.defaultOptions.watchQuery){const n=this.defaultOptions.watchQuery.refetchOn;let r;t&&"object"==typeof t&&("object"==typeof n?r={...n,...t}:null!=n&&(r=e=>{const r=t[e.source]??n;return"function"==typeof r?r(e):r})),e=xp(this.defaultOptions.watchQuery,e),r&&(e.refetchOn=r)}return this.queryManager.watchQuery(e)}query=e=>(this.defaultOptions.query&&(e=xp(this.defaultOptions.query,e)),this.queryManager.query(e));mutate=e=>{const t=xp(Hd({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return Bd(t.mutation,bs),this.queryManager.mutate(t)};subscribe(e){const t={},n=this.queryManager.startGraphQLSubscription(e),r=n.pipe(Gu(n=>({...n,data:this.queryManager.maskOperation({document:e.query,data:n.data,fetchPolicy:e.fetchPolicy,cause:t})})));return Object.assign(r,{restart:n.restart})}readQuery(e,t=!!e.optimistic){return this.cache.readQuery({...e,query:this.transform(e.query)},t)}watchFragment(e){const t=this.queryManager.dataMasking;return this.cache.watchFragment({...e,fragment:this.transform(e.fragment,t)})}readFragment(e,t=!!e.optimistic){return this.cache.readFragment({...e,fragment:this.transform(e.fragment)},t)}writeQuery(e){const t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}writeFragment(e){const t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}__actionHookForDevTools(e){this.devToolsHookCb=e}__requestRaw(e){return Mf(this.link,e,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(e=>e()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(e=>e())))}onResetStore(e){return this.resetStoreCallbacks.push(e),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(t=>t!==e)}}onClearStore(e){return this.clearStoreCallbacks.push(e),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(t=>t!==e)}}reFetchObservableQueries;refetchObservableQueries(e){return this.queryManager.refetchObservableQueries(e)}refetchQueries(e){const t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((e,t)=>{n.push(t),r.push(e)});const i=Promise.all(r);return i.queries=n,i.results=r,i.catch(e=>{}),i}getObservableQueries(e="active"){return this.queryManager.getObservableQueries(e)}extract(e){return this.cache.extract(e)}restore(e){return this.cache.restore(e)}setLink(e){this.link=e}get defaultContext(){return this.queryManager.defaultContext}maskedFragmentTransform=new Rf(Cp);transform(e,t=!1){const n=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(n):n}},{hasOwnProperty:Im}=Object.prototype;function zm(e){return Yd(e)&&"payload"in e}function Dm(e){const t={};return e.split("\n").forEach(e=>{const n=e.indexOf(":");if(n>-1){const r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]=i}}),t}function Mm(e,t){if(e.status>=300)throw new um(`Response not successful: Received status code ${e.status}`,{response:e,bodyText:t});try{return JSON.parse(t)}catch(n){throw new dm(n,{response:e,bodyText:t})}}var Pm={http:{includeQuery:!0,includeExtensions:!0,preserveHeaderCase:!1},headers:{accept:"application/graphql-response+json,application/json;q=0.9","content-type":"application/json"},options:{method:"POST"}},jm=(e,t)=>t(e);function Rm(e,t,...n){let r={},i={};n.forEach(e=>{r={...r,...e.options,headers:{...r.headers,...e.headers}},e.credentials&&(r.credentials=e.credentials),r.headers.accept=(e.http?.accept||[]).concat(r.headers.accept).join(","),i={...i,...e.http}}),r.headers=function(e,t){if(!t){const t={};return Object.keys(Object(e)).forEach(n=>{t[n.toLowerCase()]=e[n]}),t}const n={};Object.keys(Object(e)).forEach(t=>{n[t.toLowerCase()]={originalName:t,value:e[t]}});const r={};return Object.keys(n).forEach(e=>{r[n[e].originalName]=n[e].value}),r}(r.headers,i.preserveHeaderCase);const{operationName:a,extensions:o,variables:s,query:l}=e,c={operationName:a,variables:s};return i.includeExtensions&&Object.keys(o||{}).length&&(c.extensions=o),i.includeQuery&&(c.query=t(l,Lf)),{options:r,body:c}}var Lm=id(()=>fetch);function Fm(){}var $m=class extends Df{constructor(e={}){let{uri:t="/graphql",fetch:n,print:r=jm,includeExtensions:i,preserveHeaderCase:a,useGETForQueries:o,includeUnusedVariables:s=!1,...l}=e;const c={http:Hd({includeExtensions:i,preserveHeaderCase:a}),options:l.fetchOptions,credentials:l.credentials,headers:l.headers};super(e=>{let i=((e,t)=>e.getContext().uri||("function"==typeof t?t(e):t||"/graphql"))(e,t);const a=e.getContext(),l={...a.http};(function(e){return Vf(e,"subscription")})(e.query)&&(l.accept=["multipart/mixed;boundary=graphql;subscriptionSpec=1.0",...l.accept||[]]);const u={http:l,options:a.fetchOptions,credentials:a.credentials,headers:a.headers},{options:d,body:p}=Rm(e,r,Pm,c,u);p.variables&&!s&&(p.variables=function(e,t){const n={...e},r=new Set(Object.keys(e));return _l(t,{Variable(e,t,n){n&&"VariableDefinition"!==n.kind&&r.delete(e.name.value)}}),r.forEach(e=>{delete n[e]}),n}(p.variables,e.query));let f=new AbortController,h=()=>{f=void 0};if(d.signal){const e=d.signal,t=()=>{f?.abort(e.reason)};e.addEventListener("abort",t,{once:!0}),h=()=>{f?.signal.removeEventListener("abort",h),f=void 0,e.removeEventListener("abort",t),h=Fm},f.signal.addEventListener("abort",h,{once:!0})}return d.signal=f.signal,o&&!function(e){return Vf(e,"mutation")}(e.query)&&(d.method="GET"),new cu(t=>{if("GET"===d.method){const{newURI:e,parseError:t}=function(e,n){const r=[],i=(e,t)=>{r.push(`${e}=${encodeURIComponent(t)}`)};if("query"in n&&i("query",n.query),n.operationName&&i("operationName",n.operationName),n.variables){let e;try{e=JSON.stringify(n.variables)}catch(t){return{parseError:t}}i("variables",e)}if(n.extensions){let e;try{e=JSON.stringify(n.extensions)}catch(t){return{parseError:t}}i("extensions",e)}let a="",o=e;const s=e.indexOf("#");-1!==s&&(a=e.substr(s),o=e.substr(0,s));const l=-1===o.indexOf("?")?"?":"&";return{newURI:o+l+r.join("&")+a}}(i,p);if(t)throw t;i=e}else d.body=JSON.stringify(p);const r=n||id(()=>fetch)||Lm,a=t.next.bind(t);return r(i,d).then(t=>{e.setContext({response:t});const n=t.headers?.get("content-type");return null!==n&&/^multipart\/mixed/i.test(n)?async function(e,t){for await(const n of async function*(e){const t=new TextDecoder("utf-8"),n=(e.headers?.get("content-type"))?.match(/;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i),r="\r\n--"+(n?n[1]??n[2]??n[3]??"-":"-");let i="";fd(e.body&&"function"==typeof e.body.getReader,62);const a=e.body.getReader();let o,s=!1,l=!1;const c=()=>l&&"-"==i[0]&&"-"==i[1];try{for(;!s;){({value:o,done:s}=await a.read());const e="string"==typeof o?o:t.decode(o),n=i.length-r.length+1;i+=e;let u=i.indexOf(r,n);for(;u>-1&&!c();){let e;l=!0,[e,i]=[i.slice(0,u),i.slice(u+r.length)];const t=e.indexOf("\r\n\r\n"),n=Dm(e.slice(0,t))["content-type"];if(n&&-1===n.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");const a=e.slice(t);a&&(yield a),u=i.indexOf(r)}if(c())return}throw new Error("premature end of multipart body")}finally{a.cancel()}}(e)){const r=Mm(e,n);if(0!=Object.keys(r).length)if(zm(r)){if(1===Object.keys(r).length&&null===r.payload)return;let e={...r.payload};"errors"in r&&(e.extensions={...e.extensions,[pm]:new im(r.errors??[])}),t(e)}else t(r)}}(t,a):(r=e,e=>e.text().then(t=>{const n=function(e,t){return e.headers.get("content-type")?.includes("application/graphql-response+json")?function(e,t){try{return JSON.parse(t)}catch(n){throw new dm(n,{response:e,bodyText:t})}}(e,t):Mm(e,t)}(e,t);if(!Array.isArray(n)&&!Im.call(n,"data")&&!Im.call(n,"errors"))throw new um(`Server response was malformed for query '${Array.isArray(r)?r.map(e=>e.operationName):r.operationName}'.`,{response:e,bodyText:t});return n}))(t).then(a);var r}).then(()=>{h(),t.complete()}).catch(e=>{h(),t.error(e)}),()=>{f&&f.abort()}})})}},qm=class extends Df{constructor(e={}){super((t,n)=>{const r=t.client,i=r.queryManager.clientOptions,a=t.getContext();{const{name:n,version:r,transport:o="headers"}=Hd({},i.clientAwareness,e.clientAwareness,a.clientAwareness);"headers"===o&&t.setContext(({headers:e})=>({headers:Hd({"apollographql-client-name":n,"apollographql-client-version":r},e)}))}{const{transport:n="extensions"}=Hd({},i.enhancedClientAwareness,e.enhancedClientAwareness);"extensions"===n&&(t.extensions=Hd({clientLibrary:{name:"@apollo/client",version:r.version}},t.extensions)),"headers"===n&&t.setContext(({headers:e})=>({headers:Hd({"apollographql-library-name":"@apollo/client","apollographql-library-version":r.version},e)}))}return n(t)})}},Vm=class extends Df{constructor(e={}){const{left:t,right:n,request:r}=Df.from([new qm(e),new $m(e)]);super(r),Object.assign(this,{left:t,right:n})}},Bm=/* @__PURE__ */new Map,Um=/* @__PURE__ */new Map,Hm=!1;function Wm(e){return e.replace(/[\s,]+/g," ").trim()}function Ym(e){var t,n,r,i=Wm(e);if(!Bm.has(i)){var a=function(e,t){return function(e){if(null==e)return!1;const t=e.hasSubscribers;if(void 0!==t)return t;for(const n of Vl)if(e[n].hasSubscribers)return!0;return!1}(ql)?ql.traceSync(()=>_c(e,t),{source:e}):_c(e,t)}(e,{experimentalFragmentVariables:Hm,allowLegacyFragmentVariables:Hm,experimentalFragmentArguments:Hm});if(!a||"Document"!==a.kind)throw new Error("Not a valid GraphQL document.");Bm.set(i,function(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}((t=a,n=/* @__PURE__ */new Set,r=[],t.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=Wm((o=e.loc).source.body.substring(o.start,o.end)),a=Um.get(t);a&&!a.has(i)||a||Um.set(t,a=/* @__PURE__ */new Set),a.add(i),n.has(i)||(n.add(i),r.push(e))}else r.push(e);var o}),Pc(Pc({},t),{definitions:r}))))}return Bm.get(i)}function Gm(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach(function(t,n){t&&"Document"===t.kind?r+=t.loc.source.body:r+=t,r+=e[n+1]}),Ym(r)}var Qm,Jm=Gm;function Km(e){if(Array.isArray(e)){let t=!1,n=e.map(e=>{let n=Km(e);return n!==e&&(t=!0),n});return t?n:e}if("object"==typeof e&&e){let t={},n=!1;for(let r in e){if("__typename"===r){n=!0;continue}let i=e[r],a=Km(i);a!==i&&(n=!0),t[r]=a}return n?t:e}return e}(Qm=Gm||(Gm={})).gql=Jm,Qm.resetCaches=function(){Bm.clear(),Um.clear()},Qm.disableFragmentWarnings=function(){},Qm.enableExperimentalFragmentVariables=function(){Hm=!0},Qm.disableExperimentalFragmentVariables=function(){Hm=!1},Gm.default=Gm;var Xm=({id:e="",source:t,name:n,fields:r=[]})=>{let{useStoreSetter:i}=zi(),a=i(),o=w(()=>`${e}_${((e,t=!0,n=!0)=>{let r="",i="abcdefghijklmnopqrstuvwxyz";t&&(i=`ABCDEFGHIJKLMNOPQRSTUVWXYZ${i}`),n&&(i=`${i}0123456789`);let a=i.length;for(let o=0;o<e;o++)r+=i.charAt(Math.floor(Math.random()*a));return r})(8)}`,[e]);y(()=>{if(t)return a(`sources.${o}`,{id:o,meta:{id:e,source:t,name:n,fields:r}}),()=>a(`sources.${o}`,void 0,{unmount:!0})},[o,t]),y(()=>{t&&a(`sources.${o}.meta.fields`,r)},[r,t,o,a])},Zm={action:"arrayMap",title:"Array Map",type:"utility",params:{keys:{defaultValue:'[{"from": "", "to": ""}]',type:"textarea"}},preview:{sourceParsed:""},callback:(e,t)=>{let{keys:n}=t;if(!Array.isArray(e))return e;try{"string"==typeof n&&(n=JSON.parse(n))}catch{return e}return e.map(e=>{let t={};return n.forEach(n=>{"object"==typeof n&&n.from&&n.to&&X(t,n.to,K(e,n.from,""))}),t})}},eg={action:"dateConverter",title:"Date Converter",type:"utility",params:{format:{defaultValue:"dd/MM/yyyy",type:"text"},asAge:{defaultValue:!1,type:"checkbox"},isUnix:{defaultValue:!0,type:"checkbox"},isUtc:{defaultValue:!1,type:"checkbox"},locale:{defaultValue:"en",type:"select",options:[{label:"en",value:"en"},{label:"es",value:"es"},{label:"pt",value:"pt"}]}},preview:{format:"",asAge:"",isUnix:"",isUtc:"",locale:""},callback:(e,{format:t="dd/MM/yyyy",asAge:n=!1,isUnix:r=!0,isUtc:i=!1,locale:a="en"})=>{if("string"!=typeof e&&"number"!=typeof e)return e;try{let o=Ra(r?Number(e):e);return isNaN(o.getTime())?e:n?function(e,t="en",n){if(!e)return"";let r=Ra(e);return isNaN(r.getTime())?"":mt(r,{...n,locale:ja[t]})}(o,a,{addSuffix:!0}):i?Fa(o,t,a):La(o,t,a)}catch{return e}}},tg={action:"styleSelector",title:"Style Selector",type:"utility",params:{originalSelector:{label:"Original Selector",description:"This will append the original selector (require append option enabled)",defaultValue:!1,disabled:({append:e})=>!e,type:"checkbox"},append:{label:"Append Selector",defaultValue:!1,type:"checkbox"},selector:{label:"Selector",defaultValue:"",type:"select",options:(e,t,n)=>{let r=n?.stylePlatform;return r?Object.keys(r).map(e=>({label:e,options:Object.values(r[e]).filter(e=>"class"===e.type).map(e=>({label:e.name,value:e.name}))})):[]}}},preview:{append:"",originalSelector:"",selector:""},callback:(e,t,n,r={})=>{let{originalSelector:i,append:a,selector:o}=t,s=[];if(a&&!i&&r.sourceTo)s.push(r.sourceTo,o);else if(i&&a){let e=K(n,"definition.styleSelectors.base","");e?s.push(e,o):s.push(o)}return s.length?1===s.length?s[0]:s.join(" "):""}},ng={action:"styleVariant",title:"Style Variant",type:"utility",params:{key:{label:"Selector Key",defaultValue:"",type:"select",options:(e,t)=>{let n=t?.definition?.styleSelectors;if(!t||!t.definition||!n)return[];let r=t.definition.type;return(e=>{let t=e.reduce((e,{groupLabel:t,option:n})=>(t in e||(e[t]=[]),e[t].push(n),e),{});return Object.entries(t).map(([e,t])=>({label:e,options:t}))})(Object.entries(n).flatMap(([e,t])=>(t?[r,...t.split(" ")]:[r]).map(t=>({groupLabel:e,option:{value:`${t}.${e}`,label:`${t} (${e})`}}))))}},variant:{label:"Variant",defaultValue:"",type:"select",options:(e,t,n)=>{let r=t?.definition?.styleSelectors,i=e.key||"";if(!(t&&t.definition&&r&&n?.stylePlatform&&i.includes(".")))return[];let a=t.definition.type,o=i.split(".").pop()||"",s=r[o];if(!s)return[];let l=[],c=[a,...s.split(" ").filter(Boolean)];return Object.entries(n.stylePlatform).forEach(([e,t])=>{c.forEach(n=>{let r=t[n];if(!r)return;let i=r.attributes[o];Object.keys(i.variants||{}).forEach(t=>{l.push({value:t,label:`${e}: ${t}`})})})}),l}},append:{label:"Append to Variant",description:"Merge with existing variant values instead of replacing",defaultValue:!1,type:"checkbox"}},preview:{key:"",variant:"",append:""},callback:(e,t,n,r={})=>{let{key:i,variant:a,append:o}=t;if(!i)return r.sourceTo??{};let s=i||"base",l=a||e;return"object"!=typeof l||Array.isArray(l)?X(o?{...r.sourceTo}:{},s,l):l}},rg={action:"twigTemplate",title:"Twig Template",type:"utility",params:{template:{label:"Template",defaultValue:"Tokens {{source}} from the value selected to bind previously, {{sourceTo}} is your original value, other tokens via autocomplete",type:"codemirror-text"}},preview:{template:""},callback:(e,t,n,r={})=>{let{template:i}=t,a=e;try{let t=Qo(i,{source:e,...r});("string"==typeof t||"object"==typeof t&&t)&&(a=t)}catch{a=e}return a}},ig={twigTemplate:rg,dateConverter:eg,staticValue:{action:"staticValue",title:"Static Value",type:"utility",params:{valueType:{label:"Value Type",defaultValue:"text",type:"select",options:[{label:"Text",value:"text"},{label:"Long Text",value:"textarea"},{label:"Boolean",value:"select"}]},value:{defaultValue:"",type:({valueType:e})=>e,options:[{label:"True",value:"true"},{label:"False",value:"false"}]}},preview:{valueType:"",value:""},callback:(e,t)=>{let{valueType:n,value:r}=t;return"select"===n?"true"===r:r}},capitalize:{action:"capitalize",title:"Capitalize",type:"utility",params:{},preview:{content:""},callback:e=>"string"==typeof e?function(e){return null!=e&&"string"==typeof e&&e.trim()?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}(e):e},arrayMap:Zm,stringToArray:{action:"stringToArray",title:"Text to List",type:"utility",params:{separator:{label:"Separator",defaultValue:",",type:"text"}},preview:{valueType:"",value:""},callback:(e,t)=>{let{separator:n}=t;return"string"==typeof e?e.split(n).map(e=>e.trim()):e}},styleSelector:tg,styleVariant:ng},ag=(Object.values(ig).map(({title:e,action:t})=>({label:e,value:t})),(e,t)=>{if(e&&typeof localStorage<"u")try{let t=localStorage.getItem(e);if("dark"===t||"light"===t)return t}catch{}return"system"===t?(()=>{if(typeof window>"u")return"light";try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}})():t}),og=l({theme:{components:{}},colorMode:"light",toggleColorMode:()=>{},setColorMode:()=>{}});og.displayName="ThemeContext";var sg=({children:e,components:t,defaultColorMode:n="light",colorModeStorageKey:r,applyColorModeClass:i=!0,colorModeRoot:a})=>{let o="system"===n,[s,l]=N(()=>ag(r,n));y(()=>{if(!o||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),t=e=>l(e.matches?"dark":"light");return e.addEventListener("change",t),()=>{e.removeEventListener("change",t)}},[o]),y(()=>{if(!i||typeof document>"u")return;let e=a??document.documentElement;"dark"===s?e.classList.add("dark"):e.classList.remove("dark")},[s,i,a]);let c=m(()=>{o||l(e=>{let t="dark"===e?"light":"dark";if(r)try{localStorage.setItem(r,t)}catch{}return t})},[o,r]),u=m(e=>{if(!o&&(l(e),r))try{localStorage.setItem(r,e)}catch{}},[o,r]);/* @__PURE__ */
|
|
9
9
|
return A(og,{value:w(()=>({theme:{components:t&&Object.keys(t).length>0?t:{}},colorMode:s,toggleColorMode:c,setColorMode:u}),[t,s,c,u]),children:e})},lg=(e,t)=>Object.getOwnPropertyDescriptor(e,t)?.enumerable,cg=(e,t,n="soft",r={})=>{let{skip:i=[],skipFunctions:a=!1}=r;if(e===t&&"soft"===n)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let a,o,s=[];if(Array.isArray(e)){if(a=e.length,a!=t.length)return!1;for(o=a;0!==o--;)if(!cg(e[o],t[o],n,r))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.values())if(!t.has(o))return!1;for(o of e.entries())if(!cg(o[1],t.get(o[0]),n,r))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(a=e.length,a!=t.length)return!1;for(o=a;0!==o--;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.unicode===t.unicode&&e.lastIndex===t.lastIndex&&e.sticky===t.sticky;if((e.valueOf!==Object.prototype.valueOf||t.valueOf!==Object.prototype.valueOf)&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if((e.toString!==Object.prototype.toString||t.toString!==Object.prototype.toString)&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if(s="soft"===n?Object.keys(e):Object.getOwnPropertyNames(e),a=s.length,a!==("soft"===n?Object.keys(t).length:Object.getOwnPropertyNames(t).length))return!1;for(o=a;0!==o--;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=a;0!==o--;){let a=s[o];if("_owner"===a&&e.$$typeof)continue;let l="soft"===n||lg(e,a)||!i.includes(a);if(!cg(e[a],t[a],n,r)&&l)return!1}return!0}return!!("hard"===n&&e===t||a&&"function"==typeof e&&"function"==typeof t)||e!=e&&t!=t},ug=cg,dg=(e,t="soft",n={})=>{let r=S(e);return ug(r.current,e,t,n)?r.current:(r.current=e,e)},pg=(e=/* @__PURE__ */new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),fg="-",hg=[],mg=e=>{const t=bg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return yg(e);const n=e.split(fg),r=""===n[0]&&n.length>1?1:0;return gg(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],i=n[e];return t?i?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(i,t):t:i||hg}return n[e]||hg}}},gg=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],i=n.nextPart.get(r);if(i){const n=gg(e,t+1,i);if(n)return n}const a=n.validators;if(null===a)return;const o=0===t?e.join(fg):e.slice(t).join(fg),s=a.length;for(let l=0;l<s;l++){const e=a[l];if(e.validator(o))return e.classGroupId}},yg=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),bg=e=>{const{theme:t,classGroups:n}=e;return vg(n,t)},vg=(e,t)=>{const n=pg();for(const r in e){const i=e[r];xg(i,n,r,t)}return n},xg=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const i=e[a];wg(i,t,n,r)}},wg=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?Ng(e,t,n,r):Sg(e,t,n,r):kg(e,t,n)},kg=(e,t,n)=>{(""===e?t:Cg(t,e)).classGroupId=n},Sg=(e,t,n,r)=>{Tg(e)?xg(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},Ng=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[e,a]=i[o];xg(a,Cg(t,e),n,r)}},Cg=(e,t)=>{let n=e;const r=t.split(fg),i=r.length;for(let a=0;a<i;a++){const e=r[a];let t=n.nextPart.get(e);t||(t=pg(),n.nextPart.set(e,t)),n=t}return n},Tg=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Eg=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(i(e,t),t):void 0},set(e,t){e in n?n[e]=t:i(e,t)}}},Og=[],_g=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ag=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,i=0,a=0;const o=e.length;for(let u=0;u<o;u++){const o=e[u];if(0===r&&0===i){if(":"===o){t.push(e.slice(a,u)),a=u+1;continue}if("/"===o){n=u;continue}}"["===o?r++:"]"===o?r--:"("===o?i++:")"===o&&i--}const s=0===t.length?e:e.slice(a);let l=s,c=!1;return s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0),_g(t,c,l,n&&n>a?n-a:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):_g(Og,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Ig=e=>{const t=/* @__PURE__ */new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let i=0;i<e.length;i++){const a=e[i],o="["===a[0],s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},zg=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Dg=/\s+/,Mg=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Mg(e[r]))&&(n&&(n+=" "),n+=t);return n},Pg=(e,...t)=>{let n,r,i,a;const o=e=>{const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],l=e.trim().split(Dg);let c="";for(let u=l.length-1;u>=0;u-=1){const e=l[u],{isExternal:t,modifiers:d,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:h}=n(e);if(t){c=e+(c.length>0?" "+c:c);continue}let m,g=!!h;if(g){m=r(f.substring(0,h));const e=m&&o[m]?r(f):void 0;e&&e!==m&&(m=e,g=!1)}else m=r(f);if(!m){if(!g){c=e+(c.length>0?" "+c:c);continue}if(m=r(f),!m){c=e+(c.length>0?" "+c:c);continue}g=!1}const y=0===d.length?"":1===d.length?d[0]:a(d).join(":"),b=p?y+"!":y,v=b+m;if(s.indexOf(v)>-1)continue;s.push(v);const x=i(m,g);for(let n=0;n<x.length;++n){const e=x[n];s.push(b+e)}c=e+(c.length>0?" "+c:c)}return c})(e,n);return i(e,a),a};return a=s=>{const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Eg(e.cacheSize),parseClassName:Ag(e),sortModifiers:Ig(e),postfixLookupClassGroupIds:zg(e),...mg(e)}))(l),r=n.cache.get,i=n.cache.set,a=o,o(s)},(...e)=>a(((...e)=>{let t,n,r=0,i="";for(;r<e.length;)(t=e[r++])&&(n=Mg(t))&&(i&&(i+=" "),i+=n);return i})(...e))},jg=[],Rg=e=>{const t=t=>t[e]||jg;return t.isThemeGetter=!0,t},Lg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$g=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vg=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Bg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ug=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hg=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wg=e=>$g.test(e),Yg=e=>!!e&&!Number.isNaN(Number(e)),Gg=e=>!!e&&Number.isInteger(Number(e)),Qg=e=>e.endsWith("%")&&Yg(e.slice(0,-1)),Jg=e=>qg.test(e),Kg=()=>!0,Xg=e=>Vg.test(e)&&!Bg.test(e),Zg=()=>!1,ey=e=>Ug.test(e),ty=e=>Hg.test(e),ny=e=>!ay(e)&&!fy(e),ry=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),iy=e=>wy(e,Cy,Zg),ay=e=>Lg.test(e),oy=e=>wy(e,Ty,Xg),sy=e=>wy(e,Ey,Yg),ly=e=>wy(e,_y,Kg),cy=e=>wy(e,Oy,Zg),uy=e=>wy(e,Sy,Zg),dy=e=>wy(e,Ny,ty),py=e=>wy(e,Ay,ey),fy=e=>Fg.test(e),hy=e=>ky(e,Ty),my=e=>ky(e,Oy),gy=e=>ky(e,Sy),yy=e=>ky(e,Cy),by=e=>ky(e,Ny),vy=e=>ky(e,Ay,!0),xy=e=>ky(e,_y,!0),wy=(e,t,n)=>{const r=Lg.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ky=(e,t,n=!1)=>{const r=Fg.exec(e);return!!r&&(r[1]?t(r[1]):n)},Sy=e=>"position"===e||"percentage"===e,Ny=e=>"image"===e||"url"===e,Cy=e=>"length"===e||"size"===e||"bg-size"===e,Ty=e=>"length"===e,Ey=e=>"number"===e,Oy=e=>"family-name"===e,_y=e=>"number"===e||"weight"===e,Ay=e=>"shadow"===e,Iy=/*#__PURE__*/Pg(()=>{const e=Rg("color"),t=Rg("font"),n=Rg("text"),r=Rg("font-weight"),i=Rg("tracking"),a=Rg("leading"),o=Rg("breakpoint"),s=Rg("container"),l=Rg("spacing"),c=Rg("radius"),u=Rg("shadow"),d=Rg("inset-shadow"),p=Rg("text-shadow"),f=Rg("drop-shadow"),h=Rg("blur"),m=Rg("perspective"),g=Rg("aspect"),y=Rg("ease"),b=Rg("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",fy,ay],x=()=>[fy,ay,l],w=()=>[Wg,"full","auto",...x()],k=()=>[Gg,"none","subgrid",fy,ay],S=()=>["auto",{span:["full",Gg,fy,ay]},Gg,fy,ay],N=()=>[Gg,"auto",fy,ay],C=()=>["auto","min","max","fr",fy,ay],T=()=>["auto",...x()],E=()=>[Wg,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],O=()=>[Wg,"screen","full","dvw","lvw","svw","min","max","fit",...x()],_=()=>[Wg,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],A=()=>[e,fy,ay],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",gy,uy,{position:[fy,ay]}],z=()=>["auto","cover","contain",yy,iy,{size:[fy,ay]}],D=()=>[Qg,hy,oy],M=()=>["","none","full",c,fy,ay],P=()=>["",Yg,hy,oy],j=()=>[Yg,Qg,gy,uy],R=()=>["","none",h,fy,ay],L=()=>["none",Yg,fy,ay],F=()=>["none",Yg,fy,ay],$=()=>[Yg,fy,ay],q=()=>[Wg,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jg],breakpoint:[Jg],color:[Kg],container:[Jg],"drop-shadow":[Jg],ease:["in","out","in-out"],font:[ny],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jg],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jg],shadow:[Jg],spacing:["px",Yg],text:[Jg],"text-shadow":[Jg],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Wg,ay,fy,g]}],container:["container"],"container-type":[{"@container":["","normal","size",fy,ay]}],"container-named":[ry],columns:[{columns:[Yg,ay,fy,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[Gg,"auto",fy,ay]}],basis:[{basis:[Wg,"full","auto",s,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Yg,Wg,"auto","initial","none",ay]}],grow:[{grow:["",Yg,fy,ay]}],shrink:[{shrink:["",Yg,fy,ay]}],order:[{order:[Gg,"first","last","none",fy,ay]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mbs:[{mbs:T()}],mbe:[{mbe:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],"inline-size":[{inline:["auto",...O()]}],"min-inline-size":[{"min-inline":["auto",...O()]}],"max-inline-size":[{"max-inline":["none",...O()]}],"block-size":[{block:["auto",..._()]}],"min-block-size":[{"min-block":["auto",..._()]}],"max-block-size":[{"max-block":["none",..._()]}],w:[{w:[s,"screen",...E()]}],"min-w":[{"min-w":[s,"screen","none",...E()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",n,hy,oy]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,xy,ly]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qg,ay]}],"font-family":[{font:[my,cy,t]}],"font-features":[{"font-features":[ay]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,fy,ay]}],"line-clamp":[{"line-clamp":[Yg,"none",fy,sy]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":["none",fy,ay]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fy,ay]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Yg,"from-font","auto",fy,oy]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Yg,"auto",fy,ay]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"tab-size":[{tab:[Gg,fy,ay]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fy,ay]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fy,ay]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Gg,fy,ay],radial:["",fy,ay],conic:[Gg,fy,ay]},by,dy]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-bs":[{"border-bs":P()}],"border-w-be":[{"border-be":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Yg,fy,ay]}],"outline-w":[{outline:["",Yg,hy,oy]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",u,vy,py]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",d,vy,py]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Yg,oy]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",p,vy,py]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Yg,fy,ay]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Yg]}],"mask-image-linear-from-pos":[{"mask-linear-from":j()}],"mask-image-linear-to-pos":[{"mask-linear-to":j()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":j()}],"mask-image-t-to-pos":[{"mask-t-to":j()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":j()}],"mask-image-r-to-pos":[{"mask-r-to":j()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":j()}],"mask-image-b-to-pos":[{"mask-b-to":j()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":j()}],"mask-image-l-to-pos":[{"mask-l-to":j()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":j()}],"mask-image-x-to-pos":[{"mask-x-to":j()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":j()}],"mask-image-y-to-pos":[{"mask-y-to":j()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[fy,ay]}],"mask-image-radial-from-pos":[{"mask-radial-from":j()}],"mask-image-radial-to-pos":[{"mask-radial-to":j()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Yg]}],"mask-image-conic-from-pos":[{"mask-conic-from":j()}],"mask-image-conic-to-pos":[{"mask-conic-to":j()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fy,ay]}],filter:[{filter:["","none",fy,ay]}],blur:[{blur:R()}],brightness:[{brightness:[Yg,fy,ay]}],contrast:[{contrast:[Yg,fy,ay]}],"drop-shadow":[{"drop-shadow":["","none",f,vy,py]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Yg,fy,ay]}],"hue-rotate":[{"hue-rotate":[Yg,fy,ay]}],invert:[{invert:["",Yg,fy,ay]}],saturate:[{saturate:[Yg,fy,ay]}],sepia:[{sepia:["",Yg,fy,ay]}],"backdrop-filter":[{"backdrop-filter":["","none",fy,ay]}],"backdrop-blur":[{"backdrop-blur":R()}],"backdrop-brightness":[{"backdrop-brightness":[Yg,fy,ay]}],"backdrop-contrast":[{"backdrop-contrast":[Yg,fy,ay]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Yg,fy,ay]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Yg,fy,ay]}],"backdrop-invert":[{"backdrop-invert":["",Yg,fy,ay]}],"backdrop-opacity":[{"backdrop-opacity":[Yg,fy,ay]}],"backdrop-saturate":[{"backdrop-saturate":[Yg,fy,ay]}],"backdrop-sepia":[{"backdrop-sepia":["",Yg,fy,ay]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fy,ay]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Yg,"initial",fy,ay]}],ease:[{ease:["linear","initial",y,fy,ay]}],delay:[{delay:[Yg,fy,ay]}],animate:[{animate:["none",b,fy,ay]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,fy,ay]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:$()}],"skew-x":[{"skew-x":$()}],"skew-y":[{"skew-y":$()}],transform:[{transform:[fy,ay,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:q()}],"translate-x":[{"translate-x":q()}],"translate-y":[{"translate-y":q()}],"translate-z":[{"translate-z":q()}],"translate-none":["translate-none"],zoom:[{zoom:[Gg,fy,ay]}],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fy,ay]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":A()}],"scrollbar-track-color":[{"scrollbar-track":A()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fy,ay]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Yg,hy,oy,sy]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),zy=function(e,{componentKey:t,className:n,variants:r}){let{theme:i}=h(og);e=dg(e);let a=dg(n),o=m((t,n={},r="")=>(n={...n,className:r},"string"==typeof e?K(i.components[e],t,void 0)?.(n)??r:e.map(e=>K(i.components[e],t,void 0)?.(n)).filter(Boolean).join(" ")||r),[i.components,e]);return t=w(()=>void 0!==t?t:e&&"string"==typeof e?Object.keys(i.components[e]):Array.isArray(e)&&e.length>0?e.map(e=>Object.keys(i.components[e])).flat():void 0,[e,i.components]),w(()=>{if(t&&"string"==typeof t)return Iy(o(t,r,a&&"object"==typeof a?K(a,t,""):a));if(t&&Array.isArray(t)){let e={};return t.forEach((t,n)=>{let i;"object"==typeof a?i=K(a,t):"string"==typeof a&&0===n&&(i=a);let s=Iy(o(t,r,i));t.split(".").length>1?X(e,t.split(".").slice(1).join("."),s):X(e,t,s)}),e}return""},[t,a,o,r])},Dy=({ref:e,className:t,children:n,testId:r,direction:i,wrap:a,items:o,gap:s,justify:l,grow:c,basis:u,alignItems:d,shrink:p,...f})=>(t=zy("Flex",{className:t,componentKey:"root",variants:{direction:i,wrap:a,items:o,gap:s,justify:l,grow:c,basis:u,shrink:p,alignItems:d}}),/* @__PURE__ */A("div",{...f,"data-testid":r,className:t,ref:e,children:n})),My=(e,t,n="primary")=>e?"disabled":t&&"primary"===n?"primaryActive":t&&"secondary"===n?"secondaryActive":t&&"tertiary"===n?"tertiaryActive":n,Py=({className:e,children:t,icon:r,active:i=!1,disabled:a=!1,testId:o,intent:l,size:c,cursor:u,title:p,...f})=>{let h=zy("Icon",{className:e,componentKey:"root",variants:{intent:My(a,i,l),size:c,cursor:a?"disabled":u}}),{iconChildren:m}=w(()=>{let e={iconChildren:void 0};return n.forEach(t,t=>{d(t)&&(e.iconChildren=s(t,{...f,className:ce({"h-[1em] w-[1em]":"custom"!==c},h,t.props.className),title:p}))}),e},[t,h,f,c,p]);return m||/* @__PURE__ */A("i",{...f,title:p,"data-testid":o,className:ce(r,h)})},jy={root:he("flex outline-none select-none border transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:["border-transparent bg-primary-500 text-white","hover:bg-primary-600","focus-visible:ring-primary-500","dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus-visible:ring-primary-400"],secondary:["border-gray-300 text-zinc-700 hover:border-gray-400 hover:bg-gray-50 hover:text-zinc-900","focus-visible:ring-gray-400","dark:border-zinc-700 dark:text-zinc-300 dark:hover:border-zinc-400 dark:hover:bg-zinc-700/50 dark:hover:text-white dark:focus-visible:ring-zinc-500"],danger:["border-transparent bg-red-500 text-white hover:bg-red-600","focus-visible:ring-red-500","dark:bg-red-600 dark:hover:bg-red-700"],custom:""},disabled:{true:["disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none"],false:"cursor-pointer"},aspect:{square:"aspect-square",custom:""},size:{md:"py-2 px-4 gap-2 text-sm rounded-lg",sm:"py-1.5 px-3 gap-1.5 text-sm rounded",xs:"py-1 px-2 gap-1 text-xs rounded-sm min-w-6",custom:""},border:{solid:"border-solid",none:"border-none",custom:""},items:{start:"",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},justify:{normal:"justify-normal",start:"",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"}},compoundVariants:[],defaultVariants:{items:"center",justify:"center",intent:"primary",border:"solid",size:"md",disabled:!1,aspect:"custom"}}),icon:he("shrink-0",{variants:{intent:{default:""},size:{md:"text-sm",sm:"text-xs",xs:"text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"default",size:"md"}})},Ry=({className:e,message:t,disabled:n=!1,error:r=!1,intent:i,size:a})=>(e=zy("ErrorMessage",{className:e,componentKey:"root",variants:{intent:i,size:a,error:r,disabled:n}}),/* @__PURE__ */A("p",{className:e,children:t})),Ly=({className:e,children:t,disabled:n=!1,error:r=!1,intent:i,size:a,...o})=>(e=zy("Label",{className:e,componentKey:"root",variants:{intent:i,size:a,error:r,disabled:n}}),/* @__PURE__ */A("label",{className:e,...o,children:t})),Fy=({ref:e,className:t,id:r,label:i,error:a,disabled:o,intent:l,size:c,prefix:u,children:p,loading:f,clearable:h,inline:g,value:y,onClear:b,...v})=>{let x=zy("Input",{className:t,componentKey:["root","label","inputContainer","iconFloatingContainer","icon","iconError","iconClear"],variants:{intent:l,size:c,disabled:o||f,error:!!a,inline:g}}),k=m(e=>b?.(e),[b]),{iconChildren:S,inputChildren:N}=w(()=>{let e={iconChildren:void 0,inputChildren:[]};return n.forEach(p,t=>{if(d(t))if(t.type===Py){let n=t.props;e.iconChildren=s(t,{className:ce(x.icon,n.className),size:c,...n,intent:n.intent??"custom"})}else e.inputChildren.push(t)}),e},[p,x.icon,c]);/* @__PURE__ */
|
|
10
10
|
return I("div",{className:x.root,ref:e,...v,children:[i&&!g&&/* @__PURE__ */A(Ly,{error:!!a,disabled:o,intent:l,size:c,htmlFor:r,className:x.label,children:i}),
|
|
@@ -650,7 +650,7 @@ return A(Zy,{className:ce("component__container-resizable-sidebar relative z-[10
|
|
|
650
650
|
/* @__PURE__ */A(dL,{orientation:t,onChangeOrientation:n,onTabSelect:p,tabSelected:r}),["store","elements"].includes(r)&&/* @__PURE__ */A(fL,{elementSelected:l,onSelectElement:f,currentPageId:s}),
|
|
651
651
|
/* @__PURE__ */A(cL,{orientation:t,tabSelected:r,elementSelected:l,onSelectElement:f})]})})},mL=({children:e})=>{let[t,n]=N([]),[r,i]=N({}),a=S(!1),o=m((e,t,r,i,a)=>{n(n=>[...n,{logType:e,category:t,message:r,time:a,params:i}])},[n]),s=m((e,t)=>i(n=>({...n,[e]:t})),[]),l=m(e=>i(t=>ie(t,[e])),[]),c=m((e,...t)=>{if(e&&"function"==typeof r[e])return r[e](...t)},[r]),u=m(()=>n([]),[]);return a.current||=(qa.setCallback(o),qa.setCallbackAddProvider(s),qa.setCallbackRemoveProvider(l),!0),y(()=>(qa.setCallback(o),qa.setCallbackAddProvider(s),qa.setCallbackRemoveProvider(l),qa.processPendingLogs(),()=>{qa.setCallback(void 0),qa.setCallbackAddProvider(void 0),qa.setCallbackRemoveProvider(void 0),qa.flush()}),[o,s,l]),/* @__PURE__ */A(IE,{value:w(()=>({providers:r,logs:t,setLogs:n,clearLogs:u,getData:c}),[r,t,n,u,c]),children:e})},gL=0,yL=({children:e,className:t,innerClassName:n,enabled:r=!1,instanceId:i,renderMode:a="default",devToolsStyle:o="",devToolsStyleLink:s=""})=>{let{theme:l}=h(FE),[c,u]=OE("plitzi-sdk.dev-tools.orientation","horizontal"),d=S(void 0);d.current||="sdk-instance-"+ ++gL;let p=i||d.current,f=((e,t)=>{y(()=>{if(t)return(e=>(OD.push(e),void 0===xD&&(xD=e),ID(),()=>{let t=OD.indexOf(e);-1!==t&&OD.splice(t,1),xD===e&&(xD=OD[0]),ID()}))(e)},[t,e]);let n=C(zD,MD,MD);return t&&n===e})(p,r),g=m(e=>u(e),[u]);return r?/* @__PURE__ */I("div",{className:ce("flex grow overflow-auto",{"flex-col":"horizontal"===c,"h-screen":"vertical"===c},t),children:[/* @__PURE__ */A(jr,{value:p,children:/* @__PURE__ */A("div",{className:ce("grow basis-0 flex-col overflow-auto",n),children:e})}),f&&/* @__PURE__ */I(mL,{children:["default"===a&&/* @__PURE__ */A(hL,{orientation:c,onChangeOrientation:g}),"shadow"===a&&/* @__PURE__ */I(lb,{children:[s&&/* @__PURE__ */A(lb.Link,{href:s}),/* @__PURE__ */I(lb.Content,{children:[/* @__PURE__ */A("style",{dangerouslySetInnerHTML:{__html:o}}),/* @__PURE__ */A(hL,{className:ce({dark:"dark"===l}),orientation:c,onChangeOrientation:g})]})]})]})]}):e},bL=({children:e,environment:t="main"})=>{let{routeParams:n,queryParams:r,hostname:i,currentPageId:a}=h(rz),[o]=Vi("schema.variables"),s=w(()=>o?o.reduce((e,a)=>{let{name:o,value:s,subValues:l}=a;if(!Array.isArray(l)||0===l.length)return{...e,[o]:s};let c={routeParams:n,queryParams:r,hostname:i,environment:t},u=l.find(e=>jT(e.when,c));return{...e,[o]:u?u.value:s}},{}):{},[t,i,r,n,o]);Xm({id:"global",source:"variables",name:"Variables",fields:m(()=>ta(s).map(e=>({path:e,name:`variables.${e}`})),[s])}),Bi("runtime.sources.variables",s);let[l={}]=Vi("pageDefinitions"),c=w(()=>Object.values(l).map(e=>({value:e.id,label:K(e,"attributes.name",e.id)})),[l]),u=w(()=>({routeParams:n,queryParams:r,currentPageId:a}),[n,r,a]);Xm({id:"global",source:"navigation",name:"Navigation",fields:m(()=>[...ta({routeParams:n,queryParams:r}).map(e=>({path:e,name:`navigation.${e}`})),c.length>0?{path:"currentPageId",name:"Current Page",inputType:"select",values:c}:{path:"currentPageId",name:"Current Page"}],[n,r,c])}),Bi("runtime.sources.navigation",u);let{user:d,authenticated:p}=h(Kz),[f="basic"]=Vi("schema.settings.userProvider"),g=w(()=>{switch(f){case"auth0":return{isAuthenticated:p,user:{given_name:"",family_name:"",nickname:"",name:"",picture:"",locale:"",updated_at:"",email:"",email_verified:!1,sub:"",...d}};case"basic":return{isAuthenticated:p,accessToken:d?.accessToken??"",details:{username:"",email:"",roles:"",permissions:"",verified:"",...d?.details??{}}};default:return{}}},[f,d,p]);Xm({id:"global",source:"auth",name:"Auth State",fields:m(()=>ta(g).map(e=>({path:e,name:`user.${e}`})),[g])}),Bi("runtime.sources.auth",g);let[y]=Vi("runtime.state");return Xm({id:"global",source:"state",name:"State",fields:m(()=>ta(y).map(e=>({path:e,name:`state.${e}`})),[y])}),Bi("runtime.sources.state",y),e},vL=class{debugMode=!1;events;listeners=/* @__PURE__ */new Map;constructor({events:e,debugMode:t=!1}={}){this.events=e??{},this.debugMode=t}has(e,t){if(!e)throw Error("Module name is required");return this.events[e]&&this.events[e][t]}on(e,t,n,r={}){let{filter:i,override:a=!1}=r;if(!e)throw Error("Module name is required");if(!n||"function"!=typeof n)throw Error("Callback must be a function");this.events[e]||(this.events[e]={}),(!this.events[e][t]||a&&this.events[e][t].length>0)&&(this.events[e][t]=[]),this.events[e][t].push({callback:n,filter:i})}get(e,t){return this.has(e,t)?this.events[e]?.[t]:[]}off(e,t,n){!this.has(e,t)||!this.events[e]||(this.events[e][t]=n?this.events[e][t]?.filter(e=>e.callback!==n):[],0===this.events[e][t]?.length&&delete this.events[e][t],0===Object.keys(this.events[e]).length&&delete this.events[e])}async emit(e,t=[],...n){let r;this.debugMode&&qa.info("eventBridge","Event Triggered",{module:e,events:t,data:n}),r=Array.isArray(t)?t:[t];let i=[];r.forEach(t=>{if(!this.has(e,t))return;let r=this.get(e,t);r&&r.forEach(e=>{let{callback:t,filter:r}=e;(!r||"function"!=typeof r||r(...n))&&i.push(t(...n))})});let a=await Promise.all(i);return this.touch(r.reduce((e,t)=>({...e,[t]:n}),{})),a}async emitWithResponse(e,t,...n){if(!this.has(e,t))return;let r=this.get(e,t);if(!r)return;let i=await Promise.all(r.filter(e=>!e.filter||e.filter(...n)).map(e=>e.callback(...n)));return 1===i.length?i[0]:i}once(e,t,n,r){if(!e)throw Error("Module name is required");let i=async r=>{await n(r),this.off(e,t,i)};this.on(e,t,i,{filter:r})}clear(e){e?this.events[e]&&delete this.events[e]:this.events={}}getEvents(e){return e?this.events[e]?this.events[e]:{}:this.events}getModuleEventsNames(e){return e&&this.events[e]?Object.keys(this.events[e]):[]}getModuleEventsCount(e){return this.getModuleEventsNames(e).length}listen(e,t){let n=Array.isArray(e)?e:[e];return n.forEach(e=>{this.listeners.has(e)||this.listeners.set(e,/* @__PURE__ */new Set),this.listeners.get(e)?.add(t)}),()=>{n.forEach(e=>{let n=this.listeners.get(e);n&&(n.delete(t),0===n.size&&this.listeners.delete(e))})}}touch(e){for(let t in e){let n=this.listeners.get(t);if(n)for(let t of n)t(e)}}},xL=({children:e,debugMode:t,onInit:n})=>{let r=w(()=>new vL({debugMode:t}),[t]);y(()=>()=>{r.clear()},[r]);let i=w(()=>({eventBridge:r}),[r]);return y(()=>{n?.(i)},[n,i]),/* @__PURE__ */A(tO,{value:i,children:e})},wL=({id:e,interactions:t,triggers:n,callbacks:r,getAdditionalParams:i})=>{let{interactionsManager:a}=h(sD);y(()=>{if(e)return a.subscribe(e,t,n,r,i),()=>{a.unsubscribe(e)}},[e,t,n,r,i,a])},kL={action:"delayTime",title:"Delay Time",type:"utility",params:{time:{label:"Time (Milliseconds)",type:"text"}},preview:{},callback:({time:e})=>new Promise(t=>{setTimeout(t,e)})},SL={action:"twigTemplate",title:"Twig Template",type:"utility",params:{returnMode:{label:"Mode",canBind:!1,type:"select",defaultValue:"text",options:[{label:"Text",value:"text"},{label:"Json Text",value:"json"},{label:"Json Object",value:"jsonObject"}]},template:{label:"Template",canBind:!1,defaultValue:"",type:e=>{let{returnMode:t}=e;return"text"===t?"codemirror-text":"codemirror-json"}}},preview:e=>{let{template:t,returnMode:n}=e;if("jsonObject"===n)try{let n=JSON.parse(Qo(t,e));if(n&&"object"==typeof n)return{template:"",content:ta(n).reduce((e,t)=>({...e,[t]:""}),{})}}catch{}return{template:"",content:""}},callback:e=>{let{template:t,returnMode:n}=e,r="";try{r=Qo(t,e)}catch(NL){}if("jsonObject"===n)try{return{content:JSON.parse(r)}}catch(NL){}else if("json"===n)try{return JSON.parse(r),{content:r}}catch{return{content:""}}return{content:r}}},NL={action:"webHook",title:"Webhook",type:"utility",params:{url:{canBind:!0,defaultValue:"",type:"text",label:"Url"},method:{label:"Method",type:"select",defaultValue:"get",options:[{label:"Get",value:"get"},{label:"Post",value:"post"},{label:"Put",value:"put"},{label:"Delete",value:"delete"},{label:"Patch",value:"patch"},{label:"Head",value:"head"}]},body:{canBind:!0,defaultValue:"",type:"textarea",label:"Body"},authorizationToken:{canBind:!0,defaultValue:"",type:"text",label:"Authorization Token"},credentials:{canBind:!0,defaultValue:"same-origin",type:"select",options:[{label:"Include",value:"include"},{label:"Omit",value:"omit"},{label:"Same Origin",value:"same-origin"}],label:"Credentials"}},preview:{response:{status:"",data:""}},callback:async e=>{let{url:t,authorizationToken:n,body:r,credentials:i}=e,{method:a}=e,o={};try{a=a.toUpperCase();let e={};n&&(e.Authorization=`Bearer ${n}`),Object.values(r).forEach(t=>{t instanceof Blob&&"multipart/form-data"!==e["Content-Type"]&&(e["Content-Type"]="multipart/form-data")});let s=new FormData;Object.entries(r).forEach(([e,t])=>{s?.append(e,t)});let l={method:a,headers:e,credentials:i};(!a||"get"!==a.toLowerCase())&&(l.body=s);let c=await fetch(t,l),u="";try{u=await c.json()}catch{}o={status:c.status,data:u}}catch(e){}return{response:o}}},CL={delayTime:kL,twigTemplate:SL,webHook:NL},TL=(e,t,n,r,i)=>"utility"===e&&"twigTemplate"===i?t:Object.keys(t).reduce((i,a)=>{let o=t[a];if("trigger"!==e){let e=5;for(;"string"==typeof o&&ts(o)&&e>0;)o=Qo(o,{...n,...r},!1,!0),e--;"string"==typeof o&&ts(o)&&qa.warning("interactions",/* @__PURE__ */I("span",{children:["Twig token resolution exceeded ",5," passes for ",
|
|
652
652
|
/* @__PURE__ */A("b",{children:a}),", leaving unresolved tokens"]}),{param:a,value:o})}return{...i,[a]:o}},{}),EL=async(e,t={},n={},r={})=>{let i={},a=[],{id:o,action:s,enabled:l,params:c,elementId:u,type:d,when:p}=e;if(!s||!l)return{status:"disabled",result:i,postCallbacks:a};let f={...r,...n,[o]:c};if(p&&!jT(p,f))return{status:"skipped",result:i,postCallbacks:a,whenParams:f};let h={...n,...r,...TL(d,c,n,r,s)};try{switch(d){case"callback":case"globalCallback":{if(!u)return{status:"failed",result:i,postCallbacks:a,whenParams:f};let e=K(t,`${u}.${s}`);if(!e)return{status:"failed",result:i,postCallbacks:a,whenParams:f};let{callback:n,postCallback:r}=e;n&&(i=await n(h)),r&&a.push({id:o,callback:r,params:{...h,[o]:i}});break}case"utility":{let{callback:e,postCallback:t}=K(CL,s,{});e&&(i=await e(h)),t&&a.push({id:o,callback:t,params:{...h,[o]:i}});break}}}catch(NL){return qa.danger("interactions",/* @__PURE__ */I("span",{children:["Interaction node failed ",/* @__PURE__ */A("b",{children:s})]}),{error:NL instanceof Error?NL.message:String(NL),node:e}),{status:"failed",result:i,postCallbacks:a,whenParams:f}}return{status:"success",result:i,postCallbacks:a,whenParams:f}},OL=async(e,t={},n={},r={},i={},a=[],o={})=>{if(!e)return o;let s=K(t,e.afterNode);if(!s&&a.length>0&&await(async(e=[])=>{let t={};return await Promise.all(e.reverse().map(async({id:e,callback:n,params:r})=>{t[e]=await(n?.(ie(r,[e]),r[e]))})),t})(a),!s)return o;let l=qa.getTime().valueOf(),{status:c,result:u,postCallbacks:d,whenParams:p}=await EL(s,n,r,i);return o[s.id]={node:s,status:c,result:u,postCallbacks:d,whenParams:p,startTime:l,endTime:qa.getTime().valueOf()},a.push(...d),OL(s,t,n,{...r,[s.id]:u},i,a,o)},_L=(e,t,n={},r)=>{let i=qa.getTime().valueOf(),a="skipped";"completed"===r&&(a="success"),qa.info("interactions",/* @__PURE__ */I("span",{children:["Interaction triggered ",/* @__PURE__ */A("b",{children:`${e.title} [${e.action}]`})]}),{status:r,node:e,elementId:e.elementId,nodes:{...n,[e.id]:{node:e,status:a,result:void 0,postCallbacks:[],startTime:t,endTime:i}},startTime:t,endTime:i})},AL=vL,IL=class e{eventBridge;parentManager;childManagers;interactionsData;subscriptors;callbacksAvailables;interactionsRunning;lastUpdate;listeners=/* @__PURE__ */new Set;constructor(e="",t={},n={}){this.eventBridge=new AL,this.parentManager=void 0,this.childManagers=[],this.subscriptors={},this.callbacksAvailables={},this.interactionsRunning={},this.interactionsData={currentPageId:e,...t,...n},this.lastUpdate=Date.now()}eventBridgeCallback=e=>async(t,n,r)=>{if(e&&n&&t&&!K(this.interactionsRunning,`${t}.${n}`)){X(this.interactionsRunning,`${t}.${n}`,!0);try{let i,a=K(this.subscriptors,`${t}.getAdditionalParams`,void 0);"function"==typeof a&&({dataSource:i}=a());let o=Object.values(e).filter(e=>"trigger"===e.type&&e.action===n&&e.enabled);await Promise.all(o.map(t=>(async(e,t={},n={},r={},i={},a=[])=>{let o=qa.getTime().valueOf(),{action:s,enabled:l,when:c}=e;s&&l&&(!c||jT(c,{...i,...r}))?_L(e,o,await OL(e,t,n,r,i,a),"completed"):_L(e,o,{},"skipped")})(t,e,this.getCallbacksAvailables(),{[t.id]:r},{...this.interactionsData,...i})))}finally{X(this.interactionsRunning,`${t}.${n}`,!1)}}};subscribe(e,t={},n={},r={},i){if(!e||this.subscriptors[e])return!1;X(this.subscriptors,e,{id:e,triggers:n,getAdditionalParams:i});let a=Object.keys(r);return a.length>0&&(this.callbacksAvailables[e]=a.reduce((t,n)=>{let{title:i,callback:a,postCallback:o,params:s,preview:l,type:c}=r[n];return"function"==typeof a?{...t,[n]:{elementId:e,title:i,action:n,type:c,callback:a,postCallback:o,params:s,preview:l}}:t},{})),Object.keys(n).length>0&&this.eventBridge.on("interaction",e,this.eventBridgeCallback(t),{override:!0}),this.touch(),!0}unsubscribe(e){return!!this.subscriptors[e]&&(this.eventBridge.off("interaction",e),delete this.subscriptors[e],this.callbacksAvailables[e]&&delete this.callbacksAvailables[e],this.touch(),!0)}getRootManager(){return this.parentManager?this.parentManager.getRootManager():this}getSubscriptorInternal(e){let t=K(this.subscriptors,e);if(!t&&this.childManagers.length>0)for(let n of this.childManagers)if(t=n.getSubscriptorInternal(e),t)break;return t}getSubscriptor(e){return this.parentManager?this.getRootManager()?.getSubscriptorInternal(e):this.getSubscriptorInternal(e)}getCallbacksAvailablesInternal(){let e={};if(this.childManagers.length>0)for(let t of this.childManagers)e={...e,...t.getCallbacksAvailablesInternal()};return{...e,...this.callbacksAvailables}}getCallbacksAvailables(){return this.parentManager?this.getRootManager()?.getCallbacksAvailablesInternal()??{}:this.getCallbacksAvailablesInternal()}interactionTrigger(e,t,n={}){if(e)return this.eventBridge.emit("interaction",e,e,t,n)}createChildManager=(t={},n={})=>{let r=new e(this.interactionsData.currentPageId,t,n);return r.parentManager=this,this.childManagers.push(r),r};removeChildManager=e=>{this.childManagers=this.childManagers.filter(t=>t!==e)};onUpdate(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}touch(){let e=Date.now();this.lastUpdate=e;for(let t of this.listeners)t(e)}},zL=({children:e,currentPageId:t,routeParams:n,queryParams:r})=>{let i=w(()=>new IL(t,n,r),[]);return i.interactionsData=w(()=>({currentPageId:t,...n,...r}),[t,n,r]),/* @__PURE__ */A(sD,{value:w(()=>({interactionsManager:i,useInteractions:wL}),[i]),children:e})},DL=({children:e,authProvider:t="basic"})=>{let{login:n,refresh:r,logout:i}=h(Kz),{useInteractions:a}=h(sD),o=m(e=>n(e),[n]),s=m(e=>r(e),[r]),l=m(()=>i(),[i]);return a({id:"auth",callbacks:w(()=>{let e={};return"auth0"===t?e={login:{action:"authLogin",title:"Auth Login",type:"globalCallback",callback:o,params:{}},logout:{action:"authLogout",title:"Auth Logout",type:"globalCallback",callback:l,params:{}}}:"basic"===t&&(e={login:{action:"authLogin",title:"Auth Login",type:"globalCallback",callback:o,params:{mode:{label:"Mode",canBind:!1,type:"select",defaultValue:"normal",options:[{label:"Token",value:"token"},{label:"User and Password",value:"normal"}]},username:{type:"text",defaultValue:"",when:e=>"normal"===e.mode},password:{type:"text",defaultValue:"",when:e=>"normal"===e.mode},token:{type:"text",defaultValue:"",when:e=>"token"===e.mode}},preview:{errors:{username:"",password:"",token:""},success:"",access_token:"",expires_at:"",details:{id:"",username:"",email:"",verified:"",permissions:""}}},refreshDetails:{action:"authRefreshDetails",title:"Auth Refresh Details",type:"globalCallback",callback:s,params:{},preview:{errors:"",success:"",access_token:"",expires_at:"",details:{id:"",username:"",email:"",roles:"",permissions:"",verified:""}}},logout:{action:"authLogout",title:"Auth Logout",type:"globalCallback",callback:l,preview:{},params:{}}}),e},[o,l,s,t])}),e},ML={text:{icon:"fas fa-font",label:"Plain Text"},richText:{icon:"fas fa-align-justify",label:"Rich Text"},image:{icon:"far fa-image",label:"Image"},multiImage:{icon:"far fa-images",label:"Multi Image"},video:{icon:"fab fa-youtube",label:"Video Link"},link:{icon:"fas fa-link",label:"Link"},email:{icon:"far fa-envelope",label:"Email"},phone:{icon:"fas fa-phone",label:"Phone"},number:{icon:"fas fa-hashtag",label:"Number"},date:{icon:"fas fa-calendar-day",label:"Date / Time"},switch:{icon:"fas fa-toggle-off",label:"Switch"},color:{icon:"fas fa-tint",label:"Color"},option:{icon:"",label:"Option"},file:{icon:"far fa-file",label:"File"}},PL=e=>{let t;switch(e){case"switch":case"boolean":t="boolean";break;case"option":t="select";break;default:t="text"}return t},jL=(Object.keys(ML).map(e=>({label:e,value:e,icon:/* @__PURE__ */A(Py,{icon:ML[e].icon,size:"xs"})})),({children:e})=>{let{useInteractions:t}=h(sD),{collections:n,addRecord:r,updateRecord:i,removeRecord:a}=h(lo),o=m((e,t)=>{if(!e)return!1;let{fields:n}=e;if("object"!=typeof n)return!0;let r=Object.values(n).filter(e=>e.params.required);if(0===r.length)return!0;let i=!0;return r.forEach(e=>{t[e.machineName]||!i||(i=!1)}),i},[]),s=m(async e=>{let{collectionId:t,recordStatus:i="draft"}=e,a=K(n,t,void 0);if(!a||!o(a,e))return{success:!1,record:void 0};let{fields:s}=a,l=Z(e,Object.keys(s));return{success:!0,collectionId:t,record:await r(t,i,l)}},[r,n,o]),l=m(async e=>{let{collectionId:t,recordStatus:r="draft",recordId:a}=e,s=K(n,t,void 0);if(!s||!a||!o(s,e))return{success:!1,record:void 0};let{fields:l}=s,c=Z(e,Object.keys(l));return{success:!0,collectionId:t,record:await i(t,a,r,c)}},[n,i,o]),c=m(async e=>{let{collectionId:t,recordId:r}=e;return K(n,t,void 0)&&r?(await a(t,r),{success:!0,collectionId:t,recordId:r}):{success:!1,record:void 0}},[n,a]),u=w(()=>n&&"object"==typeof n?Object.keys(n).reduce((e,t)=>[...e,{value:t,label:K(n[t],"name",t)}],[]):[],[n]);return t({id:"collection",callbacks:w(()=>({addCollectionRecord:{action:"addCollectionRecord",title:"Add Collection Record",type:"globalCallback",callback:s,preview:{success:"",collectionId:"",record:{id:"",status:"",values:{}}},params:e=>{let t=K(n,`${e.collectionId}.fields`,{});return{collectionId:{label:"Collection",defaultValue:void 0,type:"select",options:u},recordStatus:{label:"Record Status",defaultValue:"draft",type:"select",options:[{value:"published",label:"Published"},{value:"draft",label:"Draft"},{value:"archived",label:"Archived"},{value:"deleted",label:"Deleted"},{value:"created",label:"Created"}]},...Object.values(t).reduce((e,t)=>{let{machineName:n,name:r,type:i}=t;return{...e,[n]:{label:r,defaultValue:void 0,when:e=>!!e.collectionId,type:PL(i)}}},{})}}},updateCollectionRecord:{action:"updateCollectionRecord",title:"Update Collection Record",type:"globalCallback",callback:l,preview:{success:"",collectionId:"",record:{id:"",status:"",values:{}}},params:e=>{let t=K(n,`${e.collectionId}.fields`,{});return{collectionId:{label:"Collection",defaultValue:void 0,type:"select",options:u},recordStatus:{label:"Record Status",defaultValue:"draft",type:"select",options:[{value:"published",label:"Published"},{value:"draft",label:"Draft"},{value:"archived",label:"Archived"},{value:"deleted",label:"Deleted"},{value:"created",label:"Created"}]},recordId:{label:"Record",defaultValue:void 0,type:"select",when:e=>!!e.collectionId,options:e=>{let{collectionId:t}=e,r=n[t];if(!t||!r)return[];let i=Object.values(r.fields).find(e=>e.params.primary);return r.records.map(e=>{let t="";return t=i?e.values[i.machineName]:JSON.stringify(e.values),{value:e.id,label:t}})}},...Object.values(t).reduce((e,t)=>{let{machineName:n,name:r,type:i}=t;return{...e,[n]:{label:r,defaultValue:void 0,when:e=>!!e.collectionId,type:PL(i)}}},{})}}},removeCollectionRecord:{action:"removeCollectionRecord",title:"Remove Collection Record",type:"globalCallback",callback:c,preview:{success:"",collectionId:"",recordId:""},params:{collectionId:{label:"Collection",defaultValue:void 0,type:"select",options:u},recordId:{label:"Record",defaultValue:void 0,type:"select",when:e=>!!e.collectionId,options:e=>{let{collectionId:t}=e,r=n[t];if(!t||!r)return[];let i=Object.values(r.fields).find(e=>e.params.primary);return r.records.map(e=>{let t="";return t=i?e.values[i.machineName]:JSON.stringify(e.values),{value:e.id,label:t}})}}}}}),[n,u,s,c,l])}),e}),RL=({children:e,previewMode:t=!1})=>{let{useInteractions:n}=h(sD),{navigate:r}=h(rz),[[i,a]]=Vi(["schema.pages","pageDefinitions"]),o=w(()=>{let e=Z(a,i);return Object.keys(e).reduce((t,n)=>{let r=e[n];return[...t,{key:n,label:K(r,"attributes.name",n),defaultPage:K(r,"attributes.default",!1)}]},[])},[a,i]),s=m(e=>{if(!t)return;let{url:n,urlType:i}=e;"page"===i||"internal"===i?r(n):r(n,!0)},[r,t]);return n({id:"navigation",callbacks:w(()=>({navigate:{action:"navigate",title:"Navigate",type:"globalCallback",callback:s,preview:{},params:{urlType:{label:"Url Type",defaultValue:void 0,type:"select",options:[{value:"page",label:"Space Page"},{value:"internal",label:"Inside Space"},{value:"external",label:"Outside Space"}]},url:{defaultValue:o.find(e=>e.defaultPage)?.key??"",type:e=>"page"===e.urlType?"select":"text",when:e=>!!e.urlType,options:o.map(e=>({value:e.key,label:e.label}))}}}}),[s,o])}),e},LL=({children:e})=>{let{useInteractions:t}=h(sD),n=Hi(),r=m(e=>{let{key:t,type:r}=e,{value:i}=e;"boolean"===r?i="true"===i:"number"===r&&(i=parseInt(i,10)),n(`runtime.state.${t}`,i)},[n]),i=m(()=>{n("runtime.state",{})},[n]);return t({id:"state",callbacks:w(()=>({setState:{action:"setState",title:"Set State",type:"globalCallback",callback:r,preview:{},params:{key:{defaultValue:"",type:"text"},type:{defaultValue:void 0,type:"select",options:[{value:"boolean",label:"True / False"},{value:"number",label:"Numeric"},{value:"text",label:"Text"}]},value:{defaultValue:void 0,type:e=>"boolean"===e.type?"select":"text",when:e=>!!e.type,options:[{value:"true",label:"True"},{value:"false",label:"False"}]}}},clearState:{action:"clearState",title:"Clear State",type:"globalCallback",callback:i,preview:{},params:{}}}),[r,i])}),e},FL=({children:e,previewMode:t=!1})=>{let{currentPageId:n,routeParams:r,queryParams:i}=h(rz),[a="basic"]=Vi("schema.settings.userProvider");/* @__PURE__ */
|
|
653
|
-
return A(zL,{currentPageId:n,routeParams:r,queryParams:i,children:/* @__PURE__ */A(DL,{authProvider:a,children:/* @__PURE__ */A(jL,{children:/* @__PURE__ */A(LL,{children:/* @__PURE__ */A(RL,{previewMode:t,children:e})})})})})},$L=l({});$L.displayName="StyleContext";var qL,VL,BL=({children:e,style:t})=>{let{style:n}=h(PE),r=w(()=>({}),[]);return Ki("style",t??(n||zE)),/* @__PURE__ */A($L,{value:r,children:e})},UL="/plitzi-sdk.css",HL=({revision:e,webKey:t="",webId:n,environment:r="main",currentPageId:i,server:a,isHydrating:o=!1,offlineMode:s=!1,offlineData:l,offlineDataType:c="json",instanceId:u,renderMode:d="iframe",sdkStylePath:p="./plitzi-sdk.css",sdkDevToolsStylePath:f,previewMode:m=!0,debugMode:g=!1,onInitEventBridge:b,onInitStateManager:v,ssrResult:x,...k})=>{const S=h(Rr),N=w(()=>S?.withBase("runtime.state"),[S]),C=w(()=>({get state(){return N?.getState()??{}},setState:e=>N?.setState(void 0,e),setStateByKey:(e,t)=>N?.setState(e,t),clearState:()=>N?.setState(void 0,{})}),[N]);return y(()=>{v?.(C)},[v,C]),/* @__PURE__ */A(rD,{webKey:t,webId:n,instanceId:u,server:a,offlineMode:s,offlineData:l,offlineDataType:c,environment:r,revision:e,debugMode:g,children:/* @__PURE__ */A(oD,{children:/* @__PURE__ */A(Jz,{children:/* @__PURE__ */A(aD,{renderMode:d,sdkStylePath:UL,children:/* @__PURE__ */A(BL,{children:/* @__PURE__ */A(xL,{onInit:b,debugMode:g,children:/* @__PURE__ */A(SD,{children:/* @__PURE__ */A(ED,{previewMode:m,environment:r,server:a,isHydrating:o,children:/* @__PURE__ */A(Zz,{renderMode:d,currentPageId:i,previewMode:m,ssrResult:x,children:/* @__PURE__ */A(bL,{environment:r,children:/* @__PURE__ */A(FL,{previewMode:m,children:/* @__PURE__ */A(yL,{enabled:g,instanceId:u,devToolsStyleLink:f||"/plitzi-sdk-devtools.css",renderMode:"shadow",innerClassName:ce({flex:"iframe"===d}),children:/* @__PURE__ */A(kD,{renderMode:d,previewMode:m,debugMode:g,environment:r,isHydrating:o,sdkStylePath:UL,server:a,...k})})})})})})})})})})})})})},WL={Button:jy,ContentEditable:mb,Input:bb,Heading:wb,ContainerResizable:Ky,ContainerCollapsable:By,Text:FT,Markdown:kb,ContainerTabs:pb},YL=({className:e="min-h-screen",children:t,webKey:r="",server:a,renderMode:o="iframe",debugMode:s=!1,state:l,...c})=>{const u=w(()=>function(e){if(!e)return 0;let t={};try{let n=e.split(".")[1],r=typeof window<"u"?window.atob(n):Buffer.from(n,"base64").toString();t=JSON.parse(r)}catch{return 0}return K(t,"data.spaceId",0)}(r),[r]),p=S(l).current,f=w(()=>({segments:{},runtime:{sources:{},state:p??{}}}),[p]),[h,g]=OE("plitzi_debug",s,"cookie"),b=w(()=>(e=>({apiServer:"https://api.plitzi.com",ssrServer:"https://ssr.plitzi.com",serverUrl:"https://server.plitzi.com",websocketServer:"wss://server.plitzi.com",subscriptionServer:"wss://server.plitzi.com/subscriptions",...e}))(a),[a]),v=w(()=>((e,t)=>{const n=new Vm({uri:e.serverUrl}),r=new em;return new Am({link:new Hz(e=>({headers:{...e.headers,"sdk-version":"0.32.
|
|
653
|
+
return A(zL,{currentPageId:n,routeParams:r,queryParams:i,children:/* @__PURE__ */A(DL,{authProvider:a,children:/* @__PURE__ */A(jL,{children:/* @__PURE__ */A(LL,{children:/* @__PURE__ */A(RL,{previewMode:t,children:e})})})})})},$L=l({});$L.displayName="StyleContext";var qL,VL,BL=({children:e,style:t})=>{let{style:n}=h(PE),r=w(()=>({}),[]);return Ki("style",t??(n||zE)),/* @__PURE__ */A($L,{value:r,children:e})},UL="/plitzi-sdk.css",HL=({revision:e,webKey:t="",webId:n,environment:r="main",currentPageId:i,server:a,isHydrating:o=!1,offlineMode:s=!1,offlineData:l,offlineDataType:c="json",instanceId:u,renderMode:d="iframe",sdkStylePath:p="./plitzi-sdk.css",sdkDevToolsStylePath:f,previewMode:m=!0,debugMode:g=!1,onInitEventBridge:b,onInitStateManager:v,ssrResult:x,...k})=>{const S=h(Rr),N=w(()=>S?.withBase("runtime.state"),[S]),C=w(()=>({get state(){return N?.getState()??{}},setState:e=>N?.setState(void 0,e),setStateByKey:(e,t)=>N?.setState(e,t),clearState:()=>N?.setState(void 0,{})}),[N]);return y(()=>{v?.(C)},[v,C]),/* @__PURE__ */A(rD,{webKey:t,webId:n,instanceId:u,server:a,offlineMode:s,offlineData:l,offlineDataType:c,environment:r,revision:e,debugMode:g,children:/* @__PURE__ */A(oD,{children:/* @__PURE__ */A(Jz,{children:/* @__PURE__ */A(aD,{renderMode:d,sdkStylePath:UL,children:/* @__PURE__ */A(BL,{children:/* @__PURE__ */A(xL,{onInit:b,debugMode:g,children:/* @__PURE__ */A(SD,{children:/* @__PURE__ */A(ED,{previewMode:m,environment:r,server:a,isHydrating:o,children:/* @__PURE__ */A(Zz,{renderMode:d,currentPageId:i,previewMode:m,ssrResult:x,children:/* @__PURE__ */A(bL,{environment:r,children:/* @__PURE__ */A(FL,{previewMode:m,children:/* @__PURE__ */A(yL,{enabled:g,instanceId:u,devToolsStyleLink:f||"/plitzi-sdk-devtools.css",renderMode:"shadow",innerClassName:ce({flex:"iframe"===d}),children:/* @__PURE__ */A(kD,{renderMode:d,previewMode:m,debugMode:g,environment:r,isHydrating:o,sdkStylePath:UL,server:a,...k})})})})})})})})})})})})})},WL={Button:jy,ContentEditable:mb,Input:bb,Heading:wb,ContainerResizable:Ky,ContainerCollapsable:By,Text:FT,Markdown:kb,ContainerTabs:pb},YL=({className:e="min-h-screen",children:t,webKey:r="",server:a,renderMode:o="iframe",debugMode:s=!1,state:l,...c})=>{const u=w(()=>function(e){if(!e)return 0;let t={};try{let n=e.split(".")[1],r=typeof window<"u"?window.atob(n):Buffer.from(n,"base64").toString();t=JSON.parse(r)}catch{return 0}return K(t,"data.spaceId",0)}(r),[r]),p=S(l).current,f=w(()=>({segments:{},runtime:{sources:{},state:p??{}}}),[p]),[h,g]=OE("plitzi_debug",s,"cookie"),b=w(()=>(e=>({apiServer:"https://api.plitzi.com",ssrServer:"https://ssr.plitzi.com",serverUrl:"https://server.plitzi.com",websocketServer:"wss://server.plitzi.com",subscriptionServer:"wss://server.plitzi.com/subscriptions",...e}))(a),[a]),v=w(()=>((e,t)=>{const n=new Vm({uri:e.serverUrl}),r=new em;return new Am({link:new Hz(e=>({headers:{...e.headers,"sdk-version":"0.32.10",authorization:t?`Bearer ${t}`:""}})).concat(new Df((e,t)=>new cu(n=>{let r=t(e).subscribe({next:e=>{n.next(e.data?{...e,data:Km(e.data)}:e)},error:e=>n.error(e),complete:()=>n.complete()});return()=>{r.unsubscribe()}})),n),cache:r})})(b,r),[b,r]);y(()=>{},[]);const x=m(e=>{e.shiftKey&&"F12"===e.key&&g(e=>!e)},[g]);y(()=>{if("production"!==c.environment)return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[x,c.environment]),y(()=>{c.isHydrating&&SO.setHydrated()},[c.isHydrating]);const k=w(()=>{const e={};return n.forEach(t,t=>{if(!d(t))return;if(t.type!==bD)return;const{renderType:n,component:r,assets:i=[],...a}=t.props;if(!n||!r)return;const o=r;o.type=n,o.assets=i,o.extraProps=a,e[n]=o}),e},[t]);"undefined"==typeof window&&b.requestUrl;const N="widget"===o?i:"undefined"==typeof window?qA:MA,C="widget"===o?{}:{basename:K(b,"basePath","/"),location:"undefined"==typeof window?b.requestUrl??"":void 0};/* @__PURE__ */
|
|
654
654
|
return A(Ai,{value:f,middlewares:[UE(Va("sdk")),WE(u),...h?[()=>({onChange:e=>SO.recordStoreChange(e)}),Ri({shouldRecord:e=>!e?.startsWith("runtime.elements")})]:[]],children:/* @__PURE__ */A($E,{children:/* @__PURE__ */A(sT,{components:WL,children:/* @__PURE__ */A(nb,{className:ce("plitzi-sdk flex",e,{"sdk-debug-mode":h}),children:/* @__PURE__ */A(qz,{children:/* @__PURE__ */A(N,{...C,children:/* @__PURE__ */A(lz,{client:v,children:/* @__PURE__ */A(az,{localCustomComponents:k,localComponents:QL,children:/* @__PURE__ */A(HL,{server:b,webKey:r,renderMode:o,debugMode:h,webId:u,...c})})})})})})})})})},GL=CO(({ref:e,className:t,spaceKey:n,environment:r="main"})=>{const{settings:{previewMode:i},contexts:{NetworkContext:a}}=Ua(),{server:o}=h(a);/* @__PURE__ */
|
|
655
655
|
return A(Wa,{ref:e,className:ce("plitzi-component__plitzi-sdk",t,{"with__plitzi-sdk":!i}),children:n&&/* @__PURE__ */A(YL,{webKey:n,environment:r,renderMode:"widget",server:o,className:"h-full w-full"})})}),QL={plitziSdk:Object.assign(GL,{type:"plitziSdk",content:{attributes:{spaceId:"",spaceKey:"",environment:"main"},definition:{label:"Plitzi Sdk",type:"plitziSdk",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"advanced",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:/* @__PURE__ */A(AE,{})},defaultStyle:{name:"Plitzi Sdk",displayMode:"desktop",style:{base:{default:{"min-width":"50px","min-height":"50px"}}}},settings:{}}})};function JL(e,t={},n={},r=!1,i=!1){const a=({isHydrating:e=!1})=>{const i=Object.keys(n);r||(()=>{if(typeof window>"u")return;let e=()=>{},t=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;"object"==typeof t&&Object.keys(t).forEach(n=>{let r=t[n];t[n]="function"==typeof r?e:null})})();const a=m(e=>{qL=e},[]),o=m(e=>{VL=e},[]);/* @__PURE__ */
|
|
656
|
-
return A(YL,{...t,debugMode:r,isHydrating:e,onInitStateManager:a,onInitEventBridge:o,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */A(kD.Plugin,{renderType:e,component:n[e].component,...n[e].props},e))})},o="undefined"!=typeof document?document.getElementById(e):void 0;o&&(i?E(o,/* @__PURE__ */A(a,{isHydrating:!0})):T(o).render(/* @__PURE__ */A(a,{})))}Promise.resolve({ });var KL=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a="iframe",...o})=>/* @__PURE__ */A(YL,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});KL.Plugin=kD.Plugin;var XL=Ua,ZL="0.32.
|
|
656
|
+
return A(YL,{...t,debugMode:r,isHydrating:e,onInitStateManager:a,onInitEventBridge:o,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */A(kD.Plugin,{renderType:e,component:n[e].component,...n[e].props},e))})},o="undefined"!=typeof document?document.getElementById(e):void 0;o&&(i?E(o,/* @__PURE__ */A(a,{isHydrating:!0})):T(o).render(/* @__PURE__ */A(a,{})))}Promise.resolve({ });var KL=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a="iframe",...o})=>/* @__PURE__ */A(YL,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});KL.Plugin=kD.Plugin;var XL=Ua,ZL="0.32.10",eF=()=>qL,tF=()=>VL;export{Qa as ComponentContext,az as ComponentProvider,EO as JsxManager,Ha as PlitziServiceProvider,jO as PluginManager,ro as PluginRemote,FI as ReplicaProvider,Wa as RootElement,KL as default,tF as getEventBridge,eF as getStateManager,JL as render,QL as sdkComponents,H as useElement,XL as usePlitziServiceContext,Y as useRscData,ZL as version,CO as withElement};
|