@plitzi/plitzi-sdk 0.34.1 → 0.35.2
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 +71 -0
- package/dist/plitzi-sdk.js +58 -58
- package/dist/plitzi-sdk.js.gz +0 -0
- package/dist/withElement-Nj-YY2Rh.js +5 -0
- package/package.json +12 -12
- package/dist/withElement-aG4S-kGR.js +0 -5
package/dist/plitzi-sdk.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./rolldown-runtime-CxhCXM28.js";import{$ as r,A as i,B as a,C as o,D as s,E as l,F as c,G as u,H as d,I as p,J as h,K as f,L as m,M as g,N as y,O as b,P as v,Q as x,R as k,S as w,T as S,U as N,V as T,W as C,X as E,Y as I,Z as O,_ as z,a as A,b as _,c as D,d as P,f as R,g as M,h as L,i as j,j as F,k as $,l as V,m as q,n as B,o as U,p as H,q as W,r as G,s as J,t as K,u as Q,v as Y,w as X,x as Z,y as ee,z as te}from"./withElement-aG4S-kGR.js";import*as ne from"react";import re,{Children as ie,Fragment as ae,cloneElement as oe,createContext as se,createElement as le,forwardRef as ce,isValidElement as ue,memo as de,use as pe,useCallback as he,useContext as fe,useEffect as me,useId as ge,useImperativeHandle as ye,useLayoutEffect as be,useMemo as ve,useReducer as xe,useRef as ke,useState as we,useSyncExternalStore as Se}from"react";import{createRoot as Ne,hydrateRoot as Te}from"react-dom/client";import{Fragment as Ce,jsx as Ee,jsxs as Ie}from"react/jsx-runtime";import{createPortal as Oe}from"react-dom";import{c as ze}from"react/compiler-runtime";var Ae=Object.defineProperty,_e=(e,t)=>{let n={};for(var r in e)Ae(n,r,{get:e[r],enumerable:!0});return t||Ae(n,Symbol.toStringTag,{value:"Module"}),n},De={previewMode:!0,debugMode:!1,renderMode:"raw",environment:"main",isHydrating:!1,hydrated:!1,overQuota:!1,testAttributes:!0},Pe=()=>{let[[e,t,n,r,i,a,o,s]]=c(["render.previewMode","render.debugMode","render.renderMode","render.environment","render.isHydrating","render.hydrated","render.overQuota","render.testAttributes"]);return ve(()=>({previewMode:e??De.previewMode,debugMode:t??De.debugMode,renderMode:n??De.renderMode,environment:r??De.environment,isHydrating:i??De.isHydrating,hydrated:a??De.hydrated,overQuota:o??De.overQuota,testAttributes:s??De.testAttributes}),[e,t,n,r,i,a,o,s])},Re=(e,t)=>"string"!=typeof e||e===t||e.length>t.length&&e.startsWith(t)&&"."===e[t.length]||t.length>e.length&&t.startsWith(e)&&"."===t[e.length],Me=(e,t,n=12)=>{if(!Object.is(e,t)){if(n<=0||!E(e)||!E(t))return{path:"",value:t};for(let r of/* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)])){if(Object.is(e[r],t[r]))continue;let i=Me(e[r],t[r],n-1);if(i)return{path:i.path?`${r}.${i.path}`:r,value:i.value}}}},Le=/* @__PURE__ */new WeakMap,je=e=>{let t=e?.enabled;return n=>{if(O(t,n.getState()))return;let{handle:r,record:i}=function(e,t={}){let n=t.limit??100,r=t.path,i=t.shouldRecord,a=[{state:e.getState(),timestamp:Date.now()}],o=0,s=!1,l=()=>({entries:a,index:o,canUndo:o>0,canRedo:o<a.length-1}),c=l(),u=/* @__PURE__ */new Set,d=()=>{c=l(),u.forEach(e=>e())},p=t=>{if(t<0||t>=a.length||t===o)return;let n=a[t].state;if(s=!0,r){let t=I(n,r);e.setState(r,()=>t)}else e.setState(void 0,()=>n);s=!1,o=t,d()};return{handle:{getSnapshot:()=>c,subscribe:e=>(u.add(e),()=>u.delete(e)),undo:()=>p(o-1),redo:()=>p(o+1),travelTo:p,clear:()=>{a=[{state:e.getState(),timestamp:Date.now()}],o=0,d()}},record:({path:t})=>{if(s||i&&!i(t)||r&&void 0!==t&&!Re(t,r))return;let l,c=o<a.length-1?a.slice(0,o+1):a,u=c[c.length-1].state,p=e.getState(),h=t??r,f=t??r;if(f)try{let e=Me(I(u,f),I(p,f));e&&(h=e.path?`${f}.${e.path}`:f,l=e.value)}catch{}let m=[...c,{path:h,value:l,state:p,timestamp:Date.now()}];a=m.length>n?m.slice(m.length-n):m,o=a.length-1,d()}}}(n,e);return Le.set(n,r),{onChange:i}}},Fe=e=>{},$e=e=>{},Ve=(e={})=>{let{filter:t,sink:n=Fe,errorSink:r=$e,enabled:i}="function"==typeof e?{sink:e}:e;return e=>{if(!O(i,e.getState()))return{onChange:e=>{(!t||t(e))&&n(e)},onError:r}}},qe=(e="local")=>{if("string"!=typeof e)return e;try{return"session"===e?globalThis.sessionStorage:globalThis.localStorage}catch{return}},Be=Symbol("@plitzi/nexus/ssr-snapshot");function Ue(e){return"object"==typeof e&&!!e&&Be in e}var He,We=/* @__PURE__ */new Map,Ge=/* @__PURE__ */new Set,Je=0,Ke=()=>{He=void 0;for(let e of Ge)e()},Qe=(e,t,n)=>{let r=e;return We.set(r,{uid:"dev-store-"+ ++Je,store:r,scopeId:t,name:n}),Ke(),()=>{We.delete(r),Ke()}},Ye=e=>(Ge.add(e),()=>{Ge.delete(e)}),Xe=()=>(He??=[...We.values()],He),Ze=f({runs:[]},{id:"action-runs"}),et=0,tt=e=>Ze.setState("runs",e),nt=/* @__PURE__ */new Map,rt=(e,t)=>{let{runs:n}=Ze.getState();n.some(t=>t.id===e)&&tt(n.map(n=>n.id===e?{...n,...t}:n))},it=()=>{let e=new Set(Ze.getState().runs.filter(e=>e.cancellable).map(e=>e.id));[...nt.keys()].forEach(t=>{e.has(t)||nt.delete(t)}),tt([])},at=se(void 0);at.displayName="DevStoreScopeContext";var ot=f,st=se(void 0),lt=e=>!0===e.cascade,ct=({store:e,id:t,segment:n,isolate:r,path:i,value:o,inherit:s,autoSync:l=!0,middlewares:c,name:d,children:p})=>{let h=fe(u),f=fe(st),m=fe(N),g=fe(at),y=h?.scopePath??"",b=ve(()=>void 0===n?y:y?`${y}/${n}`:n,[y,n]),v=ke(void 0),x="live"===s,k=ve(()=>{let e="snapshot"===s&&h?h.getState():{},t="function"==typeof o?o(e):{...e,...o};return Ue(t)?function(e){return Ue(e)?{...e}:e}(t):t},[s,h,o]),w=c??[],S=f?[...f,...w]:w,T=ve(()=>{let e=w.filter(lt);return 0===e.length?f:[...f??[],...e]},[f,c]);v.current||=e??ot(()=>k,{id:t,scopePath:b,exclusive:x?r:void 0,parent:x?h:void 0,middlewares:S.length>0?S:void 0,deferHydrate:!0});let E=ve(()=>t?{id:t,store:v.current,parent:m}:m,[t,m]),I=ke(!1);me(()=>{W&&t&&!I.current&&C(m,t)&&(I.current=!0)},[t,m]),me(()=>(x&&!e&&v.current?.reconnect?.(),()=>{x&&!e&&v.current?.destroy?.()}),[x,e]),me(()=>{if(W||void 0!==g)return Qe(v.current,g,d)},[g,d]);let O=ke(!1);me(()=>{!O.current&&v.current?.hydrate&&(v.current.hydrate(),O.current=!0)},[]),a(i,i?o:k,{enabled:!!o&&l,store:v.current});let z=/* @__PURE__ */Ee(u,{value:v.current,children:p});return E!==m&&(z=/* @__PURE__ */Ee(N,{value:E,children:z})),T!==f&&(z=/* @__PURE__ */Ee(st,{value:T,children:z})),z},ut={entries:[],index:-1,canUndo:!1,canRedo:!1},dt=()=>{},pt=()=>dt,ht=()=>ut,ft=/* @__PURE__ */new WeakSet;function mt(e,t){let n={},r=Array.isArray(t)?t:[t];for(let i of r){let t=$(e,i);void 0!==t&&b(n,i,t)}return n}function gt(e,t=0,n={}){let r,i,a,o,s,l=0,c=n.leading??!1,u=n.trailing??!0,d=n.maxWait,p=()=>Date.now();function h(t){if(!r)return a;l=t;let n=r,o=i;return r=void 0,i=void 0,a=e.apply(o,n),a}function f(e){o=setTimeout(g,e)}function m(e){if(void 0===s)return!0;let n=e-s;return n>=t||n<0||void 0!==d&&e-l>=d}function g(){let e=p();if(m(e))return b(e);f(function(e){let n=e-l,r=t-(e-(s??0));return void 0===d?r:Math.min(r,d-n)}(e))}function y(e){return l=e,f(t),c?h(e):a}function b(e){return o=void 0,u&&r?h(e):(r=i=void 0,a)}function v(...e){let n=p(),l=m(n);if(r=e,i=this,s=n,l){if(!o)return y(n);if(void 0!==d)return clearTimeout(o),f(t),h(n)}return o||f(t),a}return v.cancel=()=>{void 0!==o&&clearTimeout(o),l=0,r=s=i=o=void 0},v.flush=()=>void 0===o?a:b(p()),v.pending=()=>void 0!==o,v}function yt(e,t=0,n={}){return gt(e,t,{leading:n.leading??!0,trailing:n.trailing??!0,maxWait:t})}function bt(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=bt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function vt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=bt(e))&&(r&&(r+=" "),r+=t);return r}var xt=/* @__PURE__ */e({cva:()=>St,cx:()=>wt}),kt=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,wt=vt,St=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return wt(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(e=>{const t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;const o=kt(t)||kt(r);return i[e][o]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]);return wt(e,o,l,null==n?void 0:n.class,null==n?void 0:n.className)},{cva:Nt}=xt,Tt=/* @__PURE__ */new Set,Ct=e=>{for(let t of Tt)t(e)},Et=["missing","expired","revoked","inactive","unverified","malformed","outdated","network"],It=(e,t)=>{if(401!==e)return;let n=t?.reason;return"string"==typeof n&&Et.includes(n)?n:"expired"},Ot=e=>/([^.]+\.[^.]+)$/.exec(e)?.[1]??e;function zt(e){return At(e,[])}function At(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:At(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(At(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+": "+At(n,t)).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function _t(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}var Dt=/\r\n|[\n\r]/g;function Pt(e,t){let n=0,r=1;for(const i of e.body.matchAll(Dt)){if("number"!=typeof i.index&&_t(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function Rt(e){return Mt(e.source,Pt(e.source,e.start))}function Mt(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+Lt([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return c+Lt([[o-1+" |",u[i-1]],[`${o} |`,d],["|","^".padStart(l)],[`${o+1} |`,u[i+1]]])}function Lt(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 jt=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=Ft(Array.isArray(r)?r:r?[r]:void 0);const p=Ft(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=>Pt(i,e)):p?.map(e=>Pt(e.source,e.start));const h=(f=d?.extensions,"object"==typeof f&&null!==f?d.extensions:void 0);var f;this.extensions=c??h??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"+Rt(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+Mt(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 Ft(e){return void 0===e||0===e.length?void 0:e}var $t=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}}},Vt=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}}},qt={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"]},Bt=new Set(Object.keys(qt));function Ut(e){const t=e?.kind;return"string"==typeof t&&Bt.has(t)}var Ht="query",Wt="mutation",Gt="subscription",Jt=/* @__PURE__ */e({ARGUMENT:()=>tn,ARGUMENT_COORDINATE:()=>Bn,BOOLEAN:()=>dn,DIRECTIVE:()=>yn,DIRECTIVE_ARGUMENT_COORDINATE:()=>Hn,DIRECTIVE_COORDINATE:()=>Un,DIRECTIVE_DEFINITION:()=>_n,DIRECTIVE_EXTENSION:()=>Pn,DOCUMENT:()=>Qt,ENUM:()=>hn,ENUM_TYPE_DEFINITION:()=>On,ENUM_TYPE_EXTENSION:()=>Fn,ENUM_VALUE_DEFINITION:()=>zn,FIELD:()=>en,FIELD_DEFINITION:()=>Tn,FLOAT:()=>cn,FRAGMENT_ARGUMENT:()=>nn,FRAGMENT_DEFINITION:()=>on,FRAGMENT_SPREAD:()=>rn,INLINE_FRAGMENT:()=>an,INPUT_OBJECT_TYPE_DEFINITION:()=>An,INPUT_OBJECT_TYPE_EXTENSION:()=>$n,INPUT_VALUE_DEFINITION:()=>Cn,INT:()=>ln,INTERFACE_TYPE_DEFINITION:()=>En,INTERFACE_TYPE_EXTENSION:()=>Ln,LIST:()=>fn,LIST_TYPE:()=>vn,MEMBER_COORDINATE:()=>qn,NAME:()=>Kt,NAMED_TYPE:()=>bn,NON_NULL_TYPE:()=>xn,NULL:()=>pn,OBJECT:()=>mn,OBJECT_FIELD:()=>gn,OBJECT_TYPE_DEFINITION:()=>Nn,OBJECT_TYPE_EXTENSION:()=>Mn,OPERATION_DEFINITION:()=>Yt,OPERATION_TYPE_DEFINITION:()=>wn,SCALAR_TYPE_DEFINITION:()=>Sn,SCALAR_TYPE_EXTENSION:()=>Rn,SCHEMA_DEFINITION:()=>kn,SCHEMA_EXTENSION:()=>Dn,SELECTION_SET:()=>Zt,STRING:()=>un,TYPE_COORDINATE:()=>Vn,UNION_TYPE_DEFINITION:()=>In,UNION_TYPE_EXTENSION:()=>jn,VARIABLE:()=>sn,VARIABLE_DEFINITION:()=>Xt}),Kt="Name",Qt="Document",Yt="OperationDefinition",Xt="VariableDefinition",Zt="SelectionSet",en="Field",tn="Argument",nn="FragmentArgument",rn="FragmentSpread",an="InlineFragment",on="FragmentDefinition",sn="Variable",ln="IntValue",cn="FloatValue",un="StringValue",dn="BooleanValue",pn="NullValue",hn="EnumValue",fn="ListValue",mn="ObjectValue",gn="ObjectField",yn="Directive",bn="NamedType",vn="ListType",xn="NonNullType",kn="SchemaDefinition",wn="OperationTypeDefinition",Sn="ScalarTypeDefinition",Nn="ObjectTypeDefinition",Tn="FieldDefinition",Cn="InputValueDefinition",En="InterfaceTypeDefinition",In="UnionTypeDefinition",On="EnumTypeDefinition",zn="EnumValueDefinition",An="InputObjectTypeDefinition",_n="DirectiveDefinition",Dn="SchemaExtension",Pn="DirectiveExtension",Rn="ScalarTypeExtension",Mn="ObjectTypeExtension",Ln="InterfaceTypeExtension",jn="UnionTypeExtension",Fn="EnumTypeExtension",$n="InputObjectTypeExtension",Vn="TypeCoordinate",qn="MemberCoordinate",Bn="ArgumentCoordinate",Un="DirectiveCoordinate",Hn="DirectiveArgumentCoordinate";function Wn(e,t){if(!e)throw new Error(t)}function Gn(e){return 9===e||32===e}function Jn(e){return e>=48&&e<=57}function Kn(e){return e>=97&&e<=122||e>=65&&e<=90}function Qn(e){return Kn(e)||95===e}function Yn(e){return Kn(e)||Jn(e)||95===e}function Xn(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i<e.length;++i){const a=e[i],o=Zn(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 Zn(e){let t=0;for(;t<e.length&&Gn(e.charCodeAt(t));)++t;return t}var er=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function tr(e){return nr[e.charCodeAt(0)]}var nr=["\\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"],rr=Object.freeze({});function ir(e,t,n=qt){const r=/* @__PURE__ */new Map;for(const f of Object.values(Jt))r.set(f,ar(t,f));let i,a,o,s=Array.isArray(e),l=[e],c=-1,u=[],d=e;const p=[],h=[];do{c++;const e=c===l.length,f=e&&0!==u.length;if(e){if(a=0===h.length?void 0:p[p.length-1],d=o,o=h.pop(),f)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(Ut(d)||Wn(!1,`Invalid AST Node: ${zt(d)}.`),m=(e?r.get(d.kind)?.leave:r.get(d.kind)?.enter)?.call(t,d,a,o,p,h),m===rr)break;if(!1===m){if(!e){p.pop();continue}}else if(void 0!==m&&(u.push([a,m]),!e)){if(!Ut(m)){p.pop();continue}d=m}}void 0===m&&f&&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&&h.push(o),o=d)}while(void 0!==i);return 0!==u.length?u.at(-1)[1]:e}function ar(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 or={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>sr(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=dr(e.variableDefinitions)?cr("(\n",sr(e.variableDefinitions,"\n"),"\n)"):cr("(",sr(e.variableDefinitions,", "),")"),n=cr("",e.description,"\n")+sr([e.operation,sr([e.name,t]),sr(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>cr("",i,"\n")+e+": "+t+cr(" = ",n)+cr(" ",sr(r," "))},SelectionSet:{leave:({selections:e})=>lr(e)},Field:{leave:({alias:e,name:t,arguments:n,directives:r,selectionSet:i})=>sr([pr(sr([cr("",e,": "),t],""),n),cr(" ",sr(r," ")),cr(" ",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})=>pr("..."+e,t)+cr(" ",sr(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>sr(["...",cr("on ",e),sr(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>cr("",a,"\n")+`fragment ${e}${cr("(",sr(n,", "),")")} on ${t} ${cr("",sr(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||Gn(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&&Gn(e.charCodeAt(0));return(c&&!d||i)&&(u+="\n"),u+=t,(c||l)&&(u+="\n"),'"""'+u+'"""'}(e):`"${e.replace(er,tr)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+sr(e,", ")+"]";return t.length>80?"[\n"+ur(sr(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+sr(e,", ")+" }";return t.length>80?lr(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+cr("(",sr(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>cr("",e,"\n")+sr(["schema",sr(t," "),lr(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>cr("",e,"\n")+sr(["scalar",t,sr(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>cr("",e,"\n")+sr(["type",t,cr("implements ",sr(n," & ")),sr(r," "),lr(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>cr("",e,"\n")+t+(dr(n)?cr("(\n",ur(sr(n,"\n")),"\n)"):cr("(",sr(n,", "),")"))+": "+r+cr(" ",sr(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>cr("",e,"\n")+sr([t+": "+n,cr("= ",r),sr(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>cr("",e,"\n")+sr(["interface",t,cr("implements ",sr(n," & ")),sr(r," "),lr(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>cr("",e,"\n")+sr(["union",t,sr(n," "),cr("= ",sr(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>cr("",e,"\n")+sr(["enum",t,sr(n," "),lr(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>cr("",e,"\n")+sr([t,sr(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>cr("",e,"\n")+sr(["input",t,sr(n," "),lr(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:a})=>cr("",e,"\n")+"directive @"+t+(dr(n)?cr("(\n",ur(sr(n,"\n")),"\n)"):cr("(",sr(n,", "),")"))+cr(" ",sr(r," "))+(i?" repeatable":"")+" on "+sr(a," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>sr(["extend schema",sr(e," "),lr(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>sr(["extend scalar",e,sr(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>sr(["extend type",e,cr("implements ",sr(t," & ")),sr(n," "),lr(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>sr(["extend interface",e,cr("implements ",sr(t," & ")),sr(n," "),lr(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>sr(["extend union",e,sr(t," "),cr("= ",sr(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>sr(["extend enum",e,sr(t," "),lr(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>sr(["extend input",e,sr(t," "),lr(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>sr(["extend directive @"+e,sr(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>sr([e,cr(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>sr([e,cr(".",t),cr("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>sr(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>sr(["@",e,cr("(",t,":)")])}};function sr(e,t=""){return e?.filter(e=>void 0!==e&&""!==e).join(t)??""}function lr(e){return cr("{\n",ur(sr(e,"\n")),"\n}")}function cr(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function ur(e){return cr(" ",e.replaceAll("\n","\n "))}function dr(e){return e?.some(e=>e.includes("\n"))??!1}function pr(e,t){let n=e+cr("(",sr(t,", "),")");return n.length>80&&(n=e+cr("(\n",ur(sr(t,"\n")),"\n)")),n}var hr={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 fr(e,t,n){return new jt(`Syntax Error: ${n}`,{source:e,positions:[t]})}var mr=function(){let e;try{const t=globalThis.process;"function"==typeof t?.getBuiltinModule&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}(),gr=mr?.tracingChannel("graphql:parse"),yr=(mr?.tracingChannel("graphql:validate"),mr?.tracingChannel("graphql:execute"),mr?.tracingChannel("graphql:execute:variableCoercion"),mr?.tracingChannel("graphql:execute:rootSelectionSet"),mr?.tracingChannel("graphql:subscribe"),mr?.tracingChannel("graphql:resolve"),["start","end","asyncStart","asyncEnd","error"]),br="<SOF>",vr="<EOF>",xr="$",kr="(",wr=")",Sr="...",Nr=":",Tr="=",Cr="@",Er="[",Ir="]",Or="{",zr="|",Ar="}",_r="Name",Dr="Float",Pr="String",Rr="BlockString",Mr="Comment",Lr=class{constructor(e){const t=new Vt(br,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!==vr)do{if(e.next)e=e.next;else{const t=Ur(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Mr);return e}};function jr(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Fr(e,t){return $r(e.charCodeAt(t))&&Vr(e.charCodeAt(t+1))}function $r(e){return e>=55296&&e<=56319}function Vr(e){return e>=56320&&e<=57343}function qr(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return vr;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Br(e,t,n,r,i){const a=e.line,o=1+n-e.lineStart;return new Vt(t,n,r,a,o,i)}function Ur(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 Hr(e,i);case 33:return Br(e,"!",i,i+1);case 36:return Br(e,xr,i,i+1);case 38:return Br(e,"&",i,i+1);case 40:return Br(e,kr,i,i+1);case 41:return Br(e,wr,i,i+1);case 46:{const t=n.charCodeAt(i+1);if(46===t&&46===n.charCodeAt(i+2))return Br(e,Sr,i,i+3);if(46===t)throw fr(e.source,i,'Unexpected "..", did you mean "..."?');if(Jn(t)){const n=e.source.body.slice(i+1,Gr(e,i+1,t));throw fr(e.source,i,`Invalid number, expected digit before ".", did you mean "0.${n}"?`)}break}case 58:return Br(e,Nr,i,i+1);case 61:return Br(e,Tr,i,i+1);case 64:return Br(e,Cr,i,i+1);case 91:return Br(e,Er,i,i+1);case 93:return Br(e,Ir,i,i+1);case 123:return Br(e,Or,i,i+1);case 124:return Br(e,zr,i,i+1);case 125:return Br(e,Ar,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?ei(e,i):Jr(e,i)}if(Jn(t)||45===t)return Wr(e,i,t);if(Qn(t))return ti(e,i);throw fr(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":jr(t)||Fr(n,i)?`Unexpected character: ${qr(e,i)}.`:`Invalid character: ${qr(e,i)}.`)}return Br(e,vr,r,r)}function Hr(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(jr(e))++i;else{if(!Fr(n,i))break;i+=2}}return Br(e,Mr,t,i,n.slice(t+1,i))}function Wr(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),Jn(a))throw fr(e.source,i,`Invalid number, unexpected digit after 0: ${qr(e,i)}.`)}else i=Gr(e,i,a),a=r.charCodeAt(i);if(46===a&&(o=!0,a=r.charCodeAt(++i),i=Gr(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=Gr(e,i,a),a=r.charCodeAt(i)),46===a||Qn(a))throw fr(e.source,i,`Invalid number, expected digit but got: ${qr(e,i)}.`);return Br(e,o?Dr:"Int",t,i,r.slice(t,i))}function Gr(e,t,n){if(!Jn(n))throw fr(e.source,t,`Invalid number, expected digit but got: ${qr(e,t)}.`);const r=e.source.body;let i=t+1;for(;Jn(r.charCodeAt(i));)++i;return i}function Jr(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),Br(e,Pr,t,i+1,o);if(92===r){o+=n.slice(a,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?Kr(e,i):Qr(e,i):Zr(e,i);o+=t.value,i+=t.size,a=i;continue}if(10===r||13===r)break;if(jr(r))++i;else{if(!Fr(n,i))throw fr(e.source,i,`Invalid character within String: ${qr(e,i)}.`);i+=2}}throw fr(e.source,i,"Unterminated string.")}function Kr(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||!jr(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Xr(e),r<0)break}throw fr(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Qr(e,t){const n=e.source.body,r=Yr(n,t+2);if(jr(r))return{value:String.fromCodePoint(r),size:6};if($r(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=Yr(n,t+8);if(Vr(e))return{value:String.fromCodePoint(r,e),size:12}}throw fr(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function Yr(e,t){return Xr(e.charCodeAt(t))<<12|Xr(e.charCodeAt(t+1))<<8|Xr(e.charCodeAt(t+2))<<4|Xr(e.charCodeAt(t+3))}function Xr(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Zr(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 fr(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function ei(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=Br(e,Rr,t,a+3,Xn(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(jr(r))++a;else{if(!Fr(n,a))throw fr(e.source,a,`Invalid character within String: ${qr(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 fr(e.source,a,"Unterminated string.")}function ti(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r&&Yn(n.charCodeAt(i));)++i;return Br(e,_r,t,i,n.slice(t,i))}var ni=Symbol("Source"),ri=class{constructor(e,t="GraphQL request",n={line:1,column:1}){this.__kind=ni,this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Wn(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Wn(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function ii(e,t){const n=new ai(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}var ai=class{constructor(e,t={}){const{lexer:n,...r}=t;if(n)this._lexer=n;else{const t=function(e){return t=e,n=ni,t?.__kind===n;var t,n}(e)?e:new ri(e);this._lexer=new Lr(t)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(_r);return this.node(e,{kind:Kt,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Qt,definitions:this.many(br,this.parseDefinition,vr)})}parseDefinition(){if(this.peek(Or))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===Or)throw fr(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===_r){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 fr(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(Or))return this.node(e,{kind:Yt,operation:Ht,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(_r)&&(r=this.parseName()),this.node(e,{kind:Yt,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(_r);switch(e.value){case"query":return Ht;case"mutation":return Wt;case"subscription":return Gt}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(kr,this.parseVariableDefinition,wr)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Xt,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(Nr),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Tr)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(xr),this.node(e,{kind:sn,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Zt,selections:this.many(Or,this.parseSelection,Ar)})}parseSelection(){return this.peek(Sr)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Nr)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:en,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Or)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(kr,t,wr)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(kr,e,wr)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Nr),this.node(t,{kind:tn,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(Nr),this.node(e,{kind:nn,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(Sr);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(_r)){const t=this.parseFragmentName();return this.peek(kr)&&this._options.experimentalFragmentArguments?this.node(e,{kind:rn,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:rn,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:an,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:on,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:on,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 Er:return this.parseList(e);case Or:return this.parseObject(e);case"Int":return this.advanceLexer(),this.node(t,{kind:ln,value:t.value});case Dr:return this.advanceLexer(),this.node(t,{kind:cn,value:t.value});case Pr:case Rr:return this.parseStringLiteral();case _r:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:dn,value:!0});case"false":return this.node(t,{kind:dn,value:!1});case"null":return this.node(t,{kind:pn});default:return this.node(t,{kind:hn,value:t.value})}case xr:if(e){if(this.expectToken(xr),this._lexer.token.kind===_r){const e=this._lexer.token.value;throw fr(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:un,value:e.value,block:e.kind===Rr})}parseList(e){return this.node(this._lexer.token,{kind:fn,values:this.any(Er,()=>this.parseValueLiteral(e),Ir)})}parseObject(e){return this.node(this._lexer.token,{kind:mn,fields:this.any(Or,()=>this.parseObjectField(e),Ar)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Nr),this.node(t,{kind:gn,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Cr);)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(Cr),this.node(t,{kind:yn,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Er)){const n=this.parseTypeReference();this.expectToken(Ir),t=this.node(e,{kind:vn,type:n})}else t=this.parseNamedType();return this.expectOptionalToken("!")?this.node(e,{kind:xn,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:bn,name:this.parseName()})}peekDescription(){return this.peek(Pr)||this.peek(Rr)}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(Or,this.parseOperationTypeDefinition,Ar);return this.node(e,{kind:kn,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Nr);const n=this.parseNamedType();return this.node(e,{kind:wn,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:Sn,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:Nn,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(Or,this.parseFieldDefinition,Ar)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Nr);const i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:Tn,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(kr,this.parseInputValueDef,wr)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Nr);const r=this.parseTypeReference();let i;this.expectOptionalToken(Tr)&&(i=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(e,{kind:Cn,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:En,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:In,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Tr)?this.delimitedMany(zr,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:On,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Or,this.parseEnumValueDefinition,Ar)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:zn,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw fr(this._lexer.source,this._lexer.token.start,`${oi(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:An,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Or,this.parseInputValueDef,Ar)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===_r)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(Or,this.parseOperationTypeDefinition,Ar);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:Dn,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:Rn,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:Mn,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:Ln,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:jn,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:Fn,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:$n,name:t,directives:n,fields:r})}parseDirectiveExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(Cr);const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:Pn,name:t,directives:n})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Cr);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:_n,description:t,name:n,arguments:r,directives:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(zr,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(hr,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,t=this.expectOptionalToken(Cr),n=this.parseName();let r,i;return!t&&this.expectOptionalToken(".")&&(r=this.parseName()),(t||r)&&this.expectOptionalToken(kr)&&(i=this.parseName(),this.expectToken(Nr),this.expectToken(wr)),t?i?this.node(e,{kind:Hn,name:n,argumentName:i}):this.node(e,{kind:Un,name:n}):r?i?this.node(e,{kind:Bn,name:n,fieldName:r,argumentName:i}):this.node(e,{kind:qn,name:n,memberName:r}):this.node(e,{kind:Vn,name:n})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new $t(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 fr(this._lexer.source,t.start,`Expected ${si(e)}, found ${oi(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==_r||t.value!==e)throw fr(this._lexer.source,t.start,`Expected "${e}", found ${oi(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===_r&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return fr(this._lexer.source,t.start,`Unexpected ${oi(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!==vr&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw fr(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}};function oi(e){const t=e.value;return si(e.kind)+(null!=t?` "${t}"`:"")}function si(e){return function(e){return"!"===e||e===xr||"&"===e||e===kr||e===wr||"."===e||e===Sr||e===Nr||e===Tr||e===Cr||e===Er||e===Ir||e===Or||e===zr||e===Ar}(e)?`"${e}"`:e}var li=function(e,t){return li=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])},li(e,t)};function ci(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}li(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ui=function(){return ui=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},ui.apply(this,arguments)};function di(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(tR){s=[6,tR],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 pi(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 hi(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 fi(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 mi(e){return this instanceof mi?(this.v=e,this):new mi(e)}function gi(e){return"function"==typeof e}function yi(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 bi=yi(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 vi(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var xi=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=pi(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(h){e={error:h}}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(gi(l))try{l()}catch(tR){i=tR instanceof bi?tR.errors:[tR]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var u=pi(c),d=u.next();!d.done;d=u.next()){var p=d.value;try{Si(p)}catch(f){i=null!=i?i:[],f instanceof bi?i=fi(fi([],hi(i)),hi(f.errors)):i.push(f)}}}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 bi(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Si(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)&&vi(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&vi(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),ki=xi.EMPTY;function wi(e){return e instanceof xi||e&&"closed"in e&&gi(e.remove)&&gi(e.add)&&gi(e.unsubscribe)}function Si(e){gi(e)?e():e.unsubscribe()}var Ni={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Ni.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,fi([e,t],hi(n))):setTimeout.apply(void 0,fi([e,t],hi(n)))},clearTimeout:function(e){var t=Ni.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Ti(e){Ni.setTimeout(function(){throw e})}function Ci(){}var Ei=Ii("C",void 0,void 0);function Ii(e,t,n){return{kind:e,value:t,error:n}}function Oi(e){e()}var zi=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,wi(t)&&t.add(n)):n.destination=Ri,n}return ci(t,e),t.create=function(e,t,n){return new _i(e,t,n)},t.prototype.next=function(e){this.isStopped?Pi(function(e){return Ii("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Pi(Ii("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Pi(Ei,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}(xi);Function.prototype.bind;var Ai=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){Di(n)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){Di(n)}else Di(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Di(t)}},e}(),_i=function(e){function t(t,n,r){var i,a=e.call(this)||this;return i=gi(t)||!t?{next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:t,a.destination=new Ai(i),a}return ci(t,e),t}(zi);function Di(e){Ti(e)}function Pi(e,t){var n=null;n&&Ni.setTimeout(function(){return n(e,t)})}var Ri={closed:!0,next:Ci,error:function(e){throw e},complete:Ci},Mi="function"==typeof Symbol&&Symbol.observable||"@@observable";function Li(e){return e}var ji=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 zi||function(e){return e&&gi(e.next)&&gi(e.error)&&gi(e.complete)}(r)&&wi(r)?e:new _i(e,t,n);return Oi(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=Fi(t))(function(t,r){var i=new _i({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[Mi]=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?Li: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=Fi(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 Fi(e){var t;return null!==(t=null!=e?e:void 0)&&void 0!==t?t:Promise}function $i(e){return function(t){if(function(e){return gi(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 Vi(e,t,n,r,i){return new qi(e,t,n,r,i)}var qi=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 ci(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}(zi),Bi=yi(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ui=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 ci(t,e),t.prototype.lift=function(e){var t=new Hi(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Bi},t.prototype.next=function(e){var t=this;Oi(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=pi(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;Oi(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;Oi(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?ki:(this.currentObservers=null,a.push(e),new xi(function(){t.currentObservers=null,vi(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 ji;return e.source=this,e},t.create=function(e,t){return new Hi(e,t)},t}(ji),Hi=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return ci(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:ki},t}(Ui),Wi=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return ci(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}(Ui),Gi={now:function(){return(Gi.delegate||Date).now()},delegate:void 0},Ji=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Gi);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 ci(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}(Ui),Ki=function(e){function t(t,n){return e.call(this)||this}return ci(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(xi),Qi={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Qi.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,fi([e,t],hi(n))):setInterval.apply(void 0,fi([e,t],hi(n)))},clearInterval:function(e){var t=Qi.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},Yi=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 ci(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),Qi.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&&Qi.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(tR){r=!0,n=tR||/* @__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,vi(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Ki),Xi=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=Gi.now,e}(),Zi=new(function(e){function t(t,n){void 0===n&&(n=Xi.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return ci(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}(Xi))(Yi),ea=new ji(function(e){return e.complete()});function ta(e){return e&&gi(e.schedule)}function na(e){return ta((t=e)[t.length-1])?e.pop():void 0;var t}var ra=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function ia(e){return gi(null==e?void 0:e.then)}function aa(e){return gi(e[Mi])}function oa(e){return Symbol.asyncIterator&&gi(null==e?void 0:e[Symbol.asyncIterator])}function sa(e){/* @__PURE__ */
|
|
1
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-CxhCXM28.js";import{$ as r,A as i,B as a,C as o,D as s,E as l,F as c,G as u,H as d,I as p,J as h,K as f,L as m,M as g,N as y,O as b,P as v,Q as x,R as k,S as w,T as S,U as N,V as T,W as C,X as E,Y as I,Z as O,_ as z,a as A,b as _,c as D,d as P,f as R,g as M,h as L,i as j,j as F,k as $,l as V,m as q,n as B,o as U,p as H,q as W,r as G,s as J,t as K,u as Q,v as Y,w as X,x as Z,y as ee,z as te}from"./withElement-Nj-YY2Rh.js";import*as ne from"react";import re,{Children as ie,Fragment as ae,cloneElement as oe,createContext as se,createElement as le,forwardRef as ce,isValidElement as ue,memo as de,use as pe,useCallback as he,useContext as fe,useEffect as me,useId as ge,useImperativeHandle as ye,useLayoutEffect as be,useMemo as ve,useReducer as xe,useRef as ke,useState as we,useSyncExternalStore as Se}from"react";import{createRoot as Ne,hydrateRoot as Te}from"react-dom/client";import{Fragment as Ce,jsx as Ee,jsxs as Ie}from"react/jsx-runtime";import{createPortal as Oe}from"react-dom";import{c as ze}from"react/compiler-runtime";var Ae=Object.defineProperty,_e=(e,t)=>{let n={};for(var r in e)Ae(n,r,{get:e[r],enumerable:!0});return t||Ae(n,Symbol.toStringTag,{value:"Module"}),n},De={previewMode:!0,debugMode:!1,renderMode:"raw",environment:"main",isHydrating:!1,hydrated:!1,overQuota:!1,testAttributes:!0},Pe=()=>{let[[e,t,n,r,i,a,o,s]]=c(["render.previewMode","render.debugMode","render.renderMode","render.environment","render.isHydrating","render.hydrated","render.overQuota","render.testAttributes"]);return ve(()=>({previewMode:e??De.previewMode,debugMode:t??De.debugMode,renderMode:n??De.renderMode,environment:r??De.environment,isHydrating:i??De.isHydrating,hydrated:a??De.hydrated,overQuota:o??De.overQuota,testAttributes:s??De.testAttributes}),[e,t,n,r,i,a,o,s])},Re=(e,t)=>"string"!=typeof e||e===t||e.length>t.length&&e.startsWith(t)&&"."===e[t.length]||t.length>e.length&&t.startsWith(e)&&"."===t[e.length],Me=(e,t,n=12)=>{if(!Object.is(e,t)){if(n<=0||!E(e)||!E(t))return{path:"",value:t};for(let r of/* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)])){if(Object.is(e[r],t[r]))continue;let i=Me(e[r],t[r],n-1);if(i)return{path:i.path?`${r}.${i.path}`:r,value:i.value}}}},Le=/* @__PURE__ */new WeakMap,je=e=>{let t=e?.enabled;return n=>{if(O(t,n.getState()))return;let{handle:r,record:i}=function(e,t={}){let n=t.limit??100,r=t.path,i=t.shouldRecord,a=[{state:e.getState(),timestamp:Date.now()}],o=0,s=!1,l=()=>({entries:a,index:o,canUndo:o>0,canRedo:o<a.length-1}),c=l(),u=/* @__PURE__ */new Set,d=()=>{c=l(),u.forEach(e=>e())},p=t=>{if(t<0||t>=a.length||t===o)return;let n=a[t].state;if(s=!0,r){let t=I(n,r);e.setState(r,()=>t)}else e.setState(void 0,()=>n);s=!1,o=t,d()};return{handle:{getSnapshot:()=>c,subscribe:e=>(u.add(e),()=>u.delete(e)),undo:()=>p(o-1),redo:()=>p(o+1),travelTo:p,clear:()=>{a=[{state:e.getState(),timestamp:Date.now()}],o=0,d()}},record:({path:t})=>{if(s||i&&!i(t)||r&&void 0!==t&&!Re(t,r))return;let l,c=o<a.length-1?a.slice(0,o+1):a,u=c[c.length-1].state,p=e.getState(),h=t??r,f=t??r;if(f)try{let e=Me(I(u,f),I(p,f));e&&(h=e.path?`${f}.${e.path}`:f,l=e.value)}catch{}let m=[...c,{path:h,value:l,state:p,timestamp:Date.now()}];a=m.length>n?m.slice(m.length-n):m,o=a.length-1,d()}}}(n,e);return Le.set(n,r),{onChange:i}}},Fe=e=>{},$e=e=>{},Ve=(e={})=>{let{filter:t,sink:n=Fe,errorSink:r=$e,enabled:i}="function"==typeof e?{sink:e}:e;return e=>{if(!O(i,e.getState()))return{onChange:e=>{(!t||t(e))&&n(e)},onError:r}}},qe=(e="local")=>{if("string"!=typeof e)return e;try{return"session"===e?globalThis.sessionStorage:globalThis.localStorage}catch{return}},Be=Symbol("@plitzi/nexus/ssr-snapshot");function Ue(e){return"object"==typeof e&&!!e&&Be in e}var He,We=/* @__PURE__ */new Map,Ge=/* @__PURE__ */new Set,Je=0,Ke=()=>{He=void 0;for(let e of Ge)e()},Qe=(e,t,n)=>{let r=e;return We.set(r,{uid:"dev-store-"+ ++Je,store:r,scopeId:t,name:n}),Ke(),()=>{We.delete(r),Ke()}},Ye=e=>(Ge.add(e),()=>{Ge.delete(e)}),Xe=()=>(He??=[...We.values()],He),Ze=f({runs:[]},{id:"action-runs"}),et=0,tt=e=>Ze.setState("runs",e),nt=/* @__PURE__ */new Map,rt=(e,t)=>{let{runs:n}=Ze.getState();n.some(t=>t.id===e)&&tt(n.map(n=>n.id===e?{...n,...t}:n))},it=()=>{let e=new Set(Ze.getState().runs.filter(e=>e.cancellable).map(e=>e.id));[...nt.keys()].forEach(t=>{e.has(t)||nt.delete(t)}),tt([])},at=se(void 0);at.displayName="DevStoreScopeContext";var ot=f,st=se(void 0),lt=e=>!0===e.cascade,ct=({store:e,id:t,segment:n,isolate:r,path:i,value:o,inherit:s,autoSync:l=!0,middlewares:c,name:d,children:p})=>{let h=fe(u),f=fe(st),m=fe(N),g=fe(at),y=h?.scopePath??"",b=ve(()=>void 0===n?y:y?`${y}/${n}`:n,[y,n]),v=ke(void 0),x="live"===s,k=ve(()=>{let e="snapshot"===s&&h?h.getState():{},t="function"==typeof o?o(e):{...e,...o};return Ue(t)?function(e){return Ue(e)?{...e}:e}(t):t},[s,h,o]),w=c??[],S=f?[...f,...w]:w,T=ve(()=>{let e=w.filter(lt);return 0===e.length?f:[...f??[],...e]},[f,c]);v.current||=e??ot(()=>k,{id:t,scopePath:b,exclusive:x?r:void 0,parent:x?h:void 0,middlewares:S.length>0?S:void 0,deferHydrate:!0});let E=ve(()=>t?{id:t,store:v.current,parent:m}:m,[t,m]),I=ke(!1);me(()=>{W&&t&&!I.current&&C(m,t)&&(I.current=!0)},[t,m]),me(()=>(x&&!e&&v.current?.reconnect?.(),()=>{x&&!e&&v.current?.destroy?.()}),[x,e]),me(()=>{if(W||void 0!==g)return Qe(v.current,g,d)},[g,d]);let O=ke(!1);me(()=>{!O.current&&v.current?.hydrate&&(v.current.hydrate(),O.current=!0)},[]),a(i,i?o:k,{enabled:!!o&&l,store:v.current});let z=/* @__PURE__ */Ee(u,{value:v.current,children:p});return E!==m&&(z=/* @__PURE__ */Ee(N,{value:E,children:z})),T!==f&&(z=/* @__PURE__ */Ee(st,{value:T,children:z})),z},ut={entries:[],index:-1,canUndo:!1,canRedo:!1},dt=()=>{},pt=()=>dt,ht=()=>ut,ft=/* @__PURE__ */new WeakSet;function mt(e,t){let n={},r=Array.isArray(t)?t:[t];for(let i of r){let t=s(e,i);void 0!==t&&l(n,i,t)}return n}function gt(e,t=0,n={}){let r,i,a,o,s,l=0,c=n.leading??!1,u=n.trailing??!0,d=n.maxWait,p=()=>Date.now();function h(t){if(!r)return a;l=t;let n=r,o=i;return r=void 0,i=void 0,a=e.apply(o,n),a}function f(e){o=setTimeout(g,e)}function m(e){if(void 0===s)return!0;let n=e-s;return n>=t||n<0||void 0!==d&&e-l>=d}function g(){let e=p();if(m(e))return b(e);f(function(e){let n=e-l,r=t-(e-(s??0));return void 0===d?r:Math.min(r,d-n)}(e))}function y(e){return l=e,f(t),c?h(e):a}function b(e){return o=void 0,u&&r?h(e):(r=i=void 0,a)}function v(...e){let n=p(),l=m(n);if(r=e,i=this,s=n,l){if(!o)return y(n);if(void 0!==d)return clearTimeout(o),f(t),h(n)}return o||f(t),a}return v.cancel=()=>{void 0!==o&&clearTimeout(o),l=0,r=s=i=o=void 0},v.flush=()=>void 0===o?a:b(p()),v.pending=()=>void 0!==o,v}function yt(e,t=0,n={}){return gt(e,t,{leading:n.leading??!0,trailing:n.trailing??!0,maxWait:t})}function bt(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=bt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function vt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=bt(e))&&(r&&(r+=" "),r+=t);return r}var xt=/* @__PURE__ */e({cva:()=>St,cx:()=>wt}),kt=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,wt=vt,St=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return wt(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(e=>{const t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;const o=kt(t)||kt(r);return i[e][o]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]);return wt(e,o,l,null==n?void 0:n.class,null==n?void 0:n.className)},{cva:Nt}=xt,Tt=/* @__PURE__ */new Set,Ct=e=>{for(let t of Tt)t(e)},Et=["missing","expired","revoked","inactive","unverified","malformed","outdated","network"],It=(e,t)=>{if(401!==e)return;let n=t?.reason;return"string"==typeof n&&Et.includes(n)?n:"expired"},Ot=e=>/([^.]+\.[^.]+)$/.exec(e)?.[1]??e;function zt(e){return At(e,[])}function At(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:At(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(At(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+": "+At(n,t)).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function _t(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}var Dt=/\r\n|[\n\r]/g;function Pt(e,t){let n=0,r=1;for(const i of e.body.matchAll(Dt)){if("number"!=typeof i.index&&_t(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function Rt(e){return Mt(e.source,Pt(e.source,e.start))}function Mt(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+Lt([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return c+Lt([[o-1+" |",u[i-1]],[`${o} |`,d],["|","^".padStart(l)],[`${o+1} |`,u[i+1]]])}function Lt(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 jt=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=Ft(Array.isArray(r)?r:r?[r]:void 0);const p=Ft(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=>Pt(i,e)):p?.map(e=>Pt(e.source,e.start));const h=(f=d?.extensions,"object"==typeof f&&null!==f?d.extensions:void 0);var f;this.extensions=c??h??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"+Rt(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+Mt(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 Ft(e){return void 0===e||0===e.length?void 0:e}var $t=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}}},Vt=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}}},qt={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"]},Bt=new Set(Object.keys(qt));function Ut(e){const t=e?.kind;return"string"==typeof t&&Bt.has(t)}var Ht="query",Wt="mutation",Gt="subscription",Jt=/* @__PURE__ */e({ARGUMENT:()=>tn,ARGUMENT_COORDINATE:()=>Bn,BOOLEAN:()=>dn,DIRECTIVE:()=>yn,DIRECTIVE_ARGUMENT_COORDINATE:()=>Hn,DIRECTIVE_COORDINATE:()=>Un,DIRECTIVE_DEFINITION:()=>_n,DIRECTIVE_EXTENSION:()=>Pn,DOCUMENT:()=>Qt,ENUM:()=>hn,ENUM_TYPE_DEFINITION:()=>On,ENUM_TYPE_EXTENSION:()=>Fn,ENUM_VALUE_DEFINITION:()=>zn,FIELD:()=>en,FIELD_DEFINITION:()=>Tn,FLOAT:()=>cn,FRAGMENT_ARGUMENT:()=>nn,FRAGMENT_DEFINITION:()=>on,FRAGMENT_SPREAD:()=>rn,INLINE_FRAGMENT:()=>an,INPUT_OBJECT_TYPE_DEFINITION:()=>An,INPUT_OBJECT_TYPE_EXTENSION:()=>$n,INPUT_VALUE_DEFINITION:()=>Cn,INT:()=>ln,INTERFACE_TYPE_DEFINITION:()=>En,INTERFACE_TYPE_EXTENSION:()=>Ln,LIST:()=>fn,LIST_TYPE:()=>vn,MEMBER_COORDINATE:()=>qn,NAME:()=>Kt,NAMED_TYPE:()=>bn,NON_NULL_TYPE:()=>xn,NULL:()=>pn,OBJECT:()=>mn,OBJECT_FIELD:()=>gn,OBJECT_TYPE_DEFINITION:()=>Nn,OBJECT_TYPE_EXTENSION:()=>Mn,OPERATION_DEFINITION:()=>Yt,OPERATION_TYPE_DEFINITION:()=>wn,SCALAR_TYPE_DEFINITION:()=>Sn,SCALAR_TYPE_EXTENSION:()=>Rn,SCHEMA_DEFINITION:()=>kn,SCHEMA_EXTENSION:()=>Dn,SELECTION_SET:()=>Zt,STRING:()=>un,TYPE_COORDINATE:()=>Vn,UNION_TYPE_DEFINITION:()=>In,UNION_TYPE_EXTENSION:()=>jn,VARIABLE:()=>sn,VARIABLE_DEFINITION:()=>Xt}),Kt="Name",Qt="Document",Yt="OperationDefinition",Xt="VariableDefinition",Zt="SelectionSet",en="Field",tn="Argument",nn="FragmentArgument",rn="FragmentSpread",an="InlineFragment",on="FragmentDefinition",sn="Variable",ln="IntValue",cn="FloatValue",un="StringValue",dn="BooleanValue",pn="NullValue",hn="EnumValue",fn="ListValue",mn="ObjectValue",gn="ObjectField",yn="Directive",bn="NamedType",vn="ListType",xn="NonNullType",kn="SchemaDefinition",wn="OperationTypeDefinition",Sn="ScalarTypeDefinition",Nn="ObjectTypeDefinition",Tn="FieldDefinition",Cn="InputValueDefinition",En="InterfaceTypeDefinition",In="UnionTypeDefinition",On="EnumTypeDefinition",zn="EnumValueDefinition",An="InputObjectTypeDefinition",_n="DirectiveDefinition",Dn="SchemaExtension",Pn="DirectiveExtension",Rn="ScalarTypeExtension",Mn="ObjectTypeExtension",Ln="InterfaceTypeExtension",jn="UnionTypeExtension",Fn="EnumTypeExtension",$n="InputObjectTypeExtension",Vn="TypeCoordinate",qn="MemberCoordinate",Bn="ArgumentCoordinate",Un="DirectiveCoordinate",Hn="DirectiveArgumentCoordinate";function Wn(e,t){if(!e)throw new Error(t)}function Gn(e){return 9===e||32===e}function Jn(e){return e>=48&&e<=57}function Kn(e){return e>=97&&e<=122||e>=65&&e<=90}function Qn(e){return Kn(e)||95===e}function Yn(e){return Kn(e)||Jn(e)||95===e}function Xn(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i<e.length;++i){const a=e[i],o=Zn(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 Zn(e){let t=0;for(;t<e.length&&Gn(e.charCodeAt(t));)++t;return t}var er=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function tr(e){return nr[e.charCodeAt(0)]}var nr=["\\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"],rr=Object.freeze({});function ir(e,t,n=qt){const r=/* @__PURE__ */new Map;for(const f of Object.values(Jt))r.set(f,ar(t,f));let i,a,o,s=Array.isArray(e),l=[e],c=-1,u=[],d=e;const p=[],h=[];do{c++;const e=c===l.length,f=e&&0!==u.length;if(e){if(a=0===h.length?void 0:p[p.length-1],d=o,o=h.pop(),f)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(Ut(d)||Wn(!1,`Invalid AST Node: ${zt(d)}.`),m=(e?r.get(d.kind)?.leave:r.get(d.kind)?.enter)?.call(t,d,a,o,p,h),m===rr)break;if(!1===m){if(!e){p.pop();continue}}else if(void 0!==m&&(u.push([a,m]),!e)){if(!Ut(m)){p.pop();continue}d=m}}void 0===m&&f&&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&&h.push(o),o=d)}while(void 0!==i);return 0!==u.length?u.at(-1)[1]:e}function ar(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 or={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>sr(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=dr(e.variableDefinitions)?cr("(\n",sr(e.variableDefinitions,"\n"),"\n)"):cr("(",sr(e.variableDefinitions,", "),")"),n=cr("",e.description,"\n")+sr([e.operation,sr([e.name,t]),sr(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>cr("",i,"\n")+e+": "+t+cr(" = ",n)+cr(" ",sr(r," "))},SelectionSet:{leave:({selections:e})=>lr(e)},Field:{leave:({alias:e,name:t,arguments:n,directives:r,selectionSet:i})=>sr([pr(sr([cr("",e,": "),t],""),n),cr(" ",sr(r," ")),cr(" ",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})=>pr("..."+e,t)+cr(" ",sr(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>sr(["...",cr("on ",e),sr(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>cr("",a,"\n")+`fragment ${e}${cr("(",sr(n,", "),")")} on ${t} ${cr("",sr(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||Gn(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&&Gn(e.charCodeAt(0));return(c&&!d||i)&&(u+="\n"),u+=t,(c||l)&&(u+="\n"),'"""'+u+'"""'}(e):`"${e.replace(er,tr)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+sr(e,", ")+"]";return t.length>80?"[\n"+ur(sr(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+sr(e,", ")+" }";return t.length>80?lr(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+cr("(",sr(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>cr("",e,"\n")+sr(["schema",sr(t," "),lr(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>cr("",e,"\n")+sr(["scalar",t,sr(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>cr("",e,"\n")+sr(["type",t,cr("implements ",sr(n," & ")),sr(r," "),lr(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>cr("",e,"\n")+t+(dr(n)?cr("(\n",ur(sr(n,"\n")),"\n)"):cr("(",sr(n,", "),")"))+": "+r+cr(" ",sr(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>cr("",e,"\n")+sr([t+": "+n,cr("= ",r),sr(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>cr("",e,"\n")+sr(["interface",t,cr("implements ",sr(n," & ")),sr(r," "),lr(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>cr("",e,"\n")+sr(["union",t,sr(n," "),cr("= ",sr(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>cr("",e,"\n")+sr(["enum",t,sr(n," "),lr(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>cr("",e,"\n")+sr([t,sr(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>cr("",e,"\n")+sr(["input",t,sr(n," "),lr(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:a})=>cr("",e,"\n")+"directive @"+t+(dr(n)?cr("(\n",ur(sr(n,"\n")),"\n)"):cr("(",sr(n,", "),")"))+cr(" ",sr(r," "))+(i?" repeatable":"")+" on "+sr(a," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>sr(["extend schema",sr(e," "),lr(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>sr(["extend scalar",e,sr(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>sr(["extend type",e,cr("implements ",sr(t," & ")),sr(n," "),lr(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>sr(["extend interface",e,cr("implements ",sr(t," & ")),sr(n," "),lr(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>sr(["extend union",e,sr(t," "),cr("= ",sr(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>sr(["extend enum",e,sr(t," "),lr(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>sr(["extend input",e,sr(t," "),lr(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>sr(["extend directive @"+e,sr(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>sr([e,cr(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>sr([e,cr(".",t),cr("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>sr(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>sr(["@",e,cr("(",t,":)")])}};function sr(e,t=""){return e?.filter(e=>void 0!==e&&""!==e).join(t)??""}function lr(e){return cr("{\n",ur(sr(e,"\n")),"\n}")}function cr(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function ur(e){return cr(" ",e.replaceAll("\n","\n "))}function dr(e){return e?.some(e=>e.includes("\n"))??!1}function pr(e,t){let n=e+cr("(",sr(t,", "),")");return n.length>80&&(n=e+cr("(\n",ur(sr(t,"\n")),"\n)")),n}var hr={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 fr(e,t,n){return new jt(`Syntax Error: ${n}`,{source:e,positions:[t]})}var mr=function(){let e;try{const t=globalThis.process;"function"==typeof t?.getBuiltinModule&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}(),gr=mr?.tracingChannel("graphql:parse"),yr=(mr?.tracingChannel("graphql:validate"),mr?.tracingChannel("graphql:execute"),mr?.tracingChannel("graphql:execute:variableCoercion"),mr?.tracingChannel("graphql:execute:rootSelectionSet"),mr?.tracingChannel("graphql:subscribe"),mr?.tracingChannel("graphql:resolve"),["start","end","asyncStart","asyncEnd","error"]),br="<SOF>",vr="<EOF>",xr="$",kr="(",wr=")",Sr="...",Nr=":",Tr="=",Cr="@",Er="[",Ir="]",Or="{",zr="|",Ar="}",_r="Name",Dr="Float",Pr="String",Rr="BlockString",Mr="Comment",Lr=class{constructor(e){const t=new Vt(br,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!==vr)do{if(e.next)e=e.next;else{const t=Ur(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Mr);return e}};function jr(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Fr(e,t){return $r(e.charCodeAt(t))&&Vr(e.charCodeAt(t+1))}function $r(e){return e>=55296&&e<=56319}function Vr(e){return e>=56320&&e<=57343}function qr(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return vr;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Br(e,t,n,r,i){const a=e.line,o=1+n-e.lineStart;return new Vt(t,n,r,a,o,i)}function Ur(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 Hr(e,i);case 33:return Br(e,"!",i,i+1);case 36:return Br(e,xr,i,i+1);case 38:return Br(e,"&",i,i+1);case 40:return Br(e,kr,i,i+1);case 41:return Br(e,wr,i,i+1);case 46:{const t=n.charCodeAt(i+1);if(46===t&&46===n.charCodeAt(i+2))return Br(e,Sr,i,i+3);if(46===t)throw fr(e.source,i,'Unexpected "..", did you mean "..."?');if(Jn(t)){const n=e.source.body.slice(i+1,Gr(e,i+1,t));throw fr(e.source,i,`Invalid number, expected digit before ".", did you mean "0.${n}"?`)}break}case 58:return Br(e,Nr,i,i+1);case 61:return Br(e,Tr,i,i+1);case 64:return Br(e,Cr,i,i+1);case 91:return Br(e,Er,i,i+1);case 93:return Br(e,Ir,i,i+1);case 123:return Br(e,Or,i,i+1);case 124:return Br(e,zr,i,i+1);case 125:return Br(e,Ar,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?ei(e,i):Jr(e,i)}if(Jn(t)||45===t)return Wr(e,i,t);if(Qn(t))return ti(e,i);throw fr(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":jr(t)||Fr(n,i)?`Unexpected character: ${qr(e,i)}.`:`Invalid character: ${qr(e,i)}.`)}return Br(e,vr,r,r)}function Hr(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(jr(e))++i;else{if(!Fr(n,i))break;i+=2}}return Br(e,Mr,t,i,n.slice(t+1,i))}function Wr(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),Jn(a))throw fr(e.source,i,`Invalid number, unexpected digit after 0: ${qr(e,i)}.`)}else i=Gr(e,i,a),a=r.charCodeAt(i);if(46===a&&(o=!0,a=r.charCodeAt(++i),i=Gr(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=Gr(e,i,a),a=r.charCodeAt(i)),46===a||Qn(a))throw fr(e.source,i,`Invalid number, expected digit but got: ${qr(e,i)}.`);return Br(e,o?Dr:"Int",t,i,r.slice(t,i))}function Gr(e,t,n){if(!Jn(n))throw fr(e.source,t,`Invalid number, expected digit but got: ${qr(e,t)}.`);const r=e.source.body;let i=t+1;for(;Jn(r.charCodeAt(i));)++i;return i}function Jr(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),Br(e,Pr,t,i+1,o);if(92===r){o+=n.slice(a,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?Kr(e,i):Qr(e,i):Zr(e,i);o+=t.value,i+=t.size,a=i;continue}if(10===r||13===r)break;if(jr(r))++i;else{if(!Fr(n,i))throw fr(e.source,i,`Invalid character within String: ${qr(e,i)}.`);i+=2}}throw fr(e.source,i,"Unterminated string.")}function Kr(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||!jr(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Xr(e),r<0)break}throw fr(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Qr(e,t){const n=e.source.body,r=Yr(n,t+2);if(jr(r))return{value:String.fromCodePoint(r),size:6};if($r(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=Yr(n,t+8);if(Vr(e))return{value:String.fromCodePoint(r,e),size:12}}throw fr(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function Yr(e,t){return Xr(e.charCodeAt(t))<<12|Xr(e.charCodeAt(t+1))<<8|Xr(e.charCodeAt(t+2))<<4|Xr(e.charCodeAt(t+3))}function Xr(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Zr(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 fr(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function ei(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=Br(e,Rr,t,a+3,Xn(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(jr(r))++a;else{if(!Fr(n,a))throw fr(e.source,a,`Invalid character within String: ${qr(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 fr(e.source,a,"Unterminated string.")}function ti(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r&&Yn(n.charCodeAt(i));)++i;return Br(e,_r,t,i,n.slice(t,i))}var ni=Symbol("Source"),ri=class{constructor(e,t="GraphQL request",n={line:1,column:1}){this.__kind=ni,this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Wn(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Wn(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function ii(e,t){const n=new ai(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}var ai=class{constructor(e,t={}){const{lexer:n,...r}=t;if(n)this._lexer=n;else{const t=function(e){return t=e,n=ni,t?.__kind===n;var t,n}(e)?e:new ri(e);this._lexer=new Lr(t)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(_r);return this.node(e,{kind:Kt,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Qt,definitions:this.many(br,this.parseDefinition,vr)})}parseDefinition(){if(this.peek(Or))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===Or)throw fr(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===_r){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 fr(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(Or))return this.node(e,{kind:Yt,operation:Ht,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(_r)&&(r=this.parseName()),this.node(e,{kind:Yt,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(_r);switch(e.value){case"query":return Ht;case"mutation":return Wt;case"subscription":return Gt}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(kr,this.parseVariableDefinition,wr)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Xt,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(Nr),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Tr)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(xr),this.node(e,{kind:sn,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Zt,selections:this.many(Or,this.parseSelection,Ar)})}parseSelection(){return this.peek(Sr)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Nr)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:en,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Or)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(kr,t,wr)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(kr,e,wr)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Nr),this.node(t,{kind:tn,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(Nr),this.node(e,{kind:nn,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(Sr);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(_r)){const t=this.parseFragmentName();return this.peek(kr)&&this._options.experimentalFragmentArguments?this.node(e,{kind:rn,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:rn,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:an,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:on,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:on,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 Er:return this.parseList(e);case Or:return this.parseObject(e);case"Int":return this.advanceLexer(),this.node(t,{kind:ln,value:t.value});case Dr:return this.advanceLexer(),this.node(t,{kind:cn,value:t.value});case Pr:case Rr:return this.parseStringLiteral();case _r:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:dn,value:!0});case"false":return this.node(t,{kind:dn,value:!1});case"null":return this.node(t,{kind:pn});default:return this.node(t,{kind:hn,value:t.value})}case xr:if(e){if(this.expectToken(xr),this._lexer.token.kind===_r){const e=this._lexer.token.value;throw fr(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:un,value:e.value,block:e.kind===Rr})}parseList(e){return this.node(this._lexer.token,{kind:fn,values:this.any(Er,()=>this.parseValueLiteral(e),Ir)})}parseObject(e){return this.node(this._lexer.token,{kind:mn,fields:this.any(Or,()=>this.parseObjectField(e),Ar)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Nr),this.node(t,{kind:gn,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Cr);)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(Cr),this.node(t,{kind:yn,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Er)){const n=this.parseTypeReference();this.expectToken(Ir),t=this.node(e,{kind:vn,type:n})}else t=this.parseNamedType();return this.expectOptionalToken("!")?this.node(e,{kind:xn,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:bn,name:this.parseName()})}peekDescription(){return this.peek(Pr)||this.peek(Rr)}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(Or,this.parseOperationTypeDefinition,Ar);return this.node(e,{kind:kn,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Nr);const n=this.parseNamedType();return this.node(e,{kind:wn,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:Sn,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:Nn,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(Or,this.parseFieldDefinition,Ar)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Nr);const i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:Tn,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(kr,this.parseInputValueDef,wr)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Nr);const r=this.parseTypeReference();let i;this.expectOptionalToken(Tr)&&(i=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(e,{kind:Cn,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:En,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:In,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Tr)?this.delimitedMany(zr,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:On,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Or,this.parseEnumValueDefinition,Ar)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:zn,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw fr(this._lexer.source,this._lexer.token.start,`${oi(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:An,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Or,this.parseInputValueDef,Ar)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===_r)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(Or,this.parseOperationTypeDefinition,Ar);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:Dn,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:Rn,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:Mn,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:Ln,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:jn,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:Fn,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:$n,name:t,directives:n,fields:r})}parseDirectiveExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(Cr);const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:Pn,name:t,directives:n})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Cr);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:_n,description:t,name:n,arguments:r,directives:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(zr,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(hr,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,t=this.expectOptionalToken(Cr),n=this.parseName();let r,i;return!t&&this.expectOptionalToken(".")&&(r=this.parseName()),(t||r)&&this.expectOptionalToken(kr)&&(i=this.parseName(),this.expectToken(Nr),this.expectToken(wr)),t?i?this.node(e,{kind:Hn,name:n,argumentName:i}):this.node(e,{kind:Un,name:n}):r?i?this.node(e,{kind:Bn,name:n,fieldName:r,argumentName:i}):this.node(e,{kind:qn,name:n,memberName:r}):this.node(e,{kind:Vn,name:n})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new $t(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 fr(this._lexer.source,t.start,`Expected ${si(e)}, found ${oi(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==_r||t.value!==e)throw fr(this._lexer.source,t.start,`Expected "${e}", found ${oi(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===_r&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return fr(this._lexer.source,t.start,`Unexpected ${oi(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!==vr&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw fr(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}};function oi(e){const t=e.value;return si(e.kind)+(null!=t?` "${t}"`:"")}function si(e){return function(e){return"!"===e||e===xr||"&"===e||e===kr||e===wr||"."===e||e===Sr||e===Nr||e===Tr||e===Cr||e===Er||e===Ir||e===Or||e===zr||e===Ar}(e)?`"${e}"`:e}var li=function(e,t){return li=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])},li(e,t)};function ci(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}li(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ui=function(){return ui=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},ui.apply(this,arguments)};function di(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(tR){s=[6,tR],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 pi(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 hi(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 fi(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 mi(e){return this instanceof mi?(this.v=e,this):new mi(e)}function gi(e){return"function"==typeof e}function yi(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 bi=yi(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 vi(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var xi=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=pi(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(h){e={error:h}}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(gi(l))try{l()}catch(tR){i=tR instanceof bi?tR.errors:[tR]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var u=pi(c),d=u.next();!d.done;d=u.next()){var p=d.value;try{Si(p)}catch(f){i=null!=i?i:[],f instanceof bi?i=fi(fi([],hi(i)),hi(f.errors)):i.push(f)}}}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 bi(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Si(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)&&vi(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&vi(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),ki=xi.EMPTY;function wi(e){return e instanceof xi||e&&"closed"in e&&gi(e.remove)&&gi(e.add)&&gi(e.unsubscribe)}function Si(e){gi(e)?e():e.unsubscribe()}var Ni={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Ni.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,fi([e,t],hi(n))):setTimeout.apply(void 0,fi([e,t],hi(n)))},clearTimeout:function(e){var t=Ni.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Ti(e){Ni.setTimeout(function(){throw e})}function Ci(){}var Ei=Ii("C",void 0,void 0);function Ii(e,t,n){return{kind:e,value:t,error:n}}function Oi(e){e()}var zi=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,wi(t)&&t.add(n)):n.destination=Ri,n}return ci(t,e),t.create=function(e,t,n){return new _i(e,t,n)},t.prototype.next=function(e){this.isStopped?Pi(function(e){return Ii("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Pi(Ii("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Pi(Ei,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}(xi);Function.prototype.bind;var Ai=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){Di(n)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){Di(n)}else Di(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Di(t)}},e}(),_i=function(e){function t(t,n,r){var i,a=e.call(this)||this;return i=gi(t)||!t?{next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:t,a.destination=new Ai(i),a}return ci(t,e),t}(zi);function Di(e){Ti(e)}function Pi(e,t){var n=null;n&&Ni.setTimeout(function(){return n(e,t)})}var Ri={closed:!0,next:Ci,error:function(e){throw e},complete:Ci},Mi="function"==typeof Symbol&&Symbol.observable||"@@observable";function Li(e){return e}var ji=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 zi||function(e){return e&&gi(e.next)&&gi(e.error)&&gi(e.complete)}(r)&&wi(r)?e:new _i(e,t,n);return Oi(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=Fi(t))(function(t,r){var i=new _i({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[Mi]=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?Li: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=Fi(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 Fi(e){var t;return null!==(t=null!=e?e:void 0)&&void 0!==t?t:Promise}function $i(e){return function(t){if(function(e){return gi(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 Vi(e,t,n,r,i){return new qi(e,t,n,r,i)}var qi=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 ci(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}(zi),Bi=yi(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ui=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 ci(t,e),t.prototype.lift=function(e){var t=new Hi(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Bi},t.prototype.next=function(e){var t=this;Oi(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=pi(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;Oi(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;Oi(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?ki:(this.currentObservers=null,a.push(e),new xi(function(){t.currentObservers=null,vi(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 ji;return e.source=this,e},t.create=function(e,t){return new Hi(e,t)},t}(ji),Hi=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return ci(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:ki},t}(Ui),Wi=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return ci(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}(Ui),Gi={now:function(){return(Gi.delegate||Date).now()},delegate:void 0},Ji=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Gi);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 ci(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}(Ui),Ki=function(e){function t(t,n){return e.call(this)||this}return ci(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(xi),Qi={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Qi.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,fi([e,t],hi(n))):setInterval.apply(void 0,fi([e,t],hi(n)))},clearInterval:function(e){var t=Qi.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},Yi=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 ci(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),Qi.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&&Qi.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(tR){r=!0,n=tR||/* @__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,vi(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Ki),Xi=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=Gi.now,e}(),Zi=new(function(e){function t(t,n){void 0===n&&(n=Xi.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return ci(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}(Xi))(Yi),ea=new ji(function(e){return e.complete()});function ta(e){return e&&gi(e.schedule)}function na(e){return ta((t=e)[t.length-1])?e.pop():void 0;var t}var ra=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function ia(e){return gi(null==e?void 0:e.then)}function aa(e){return gi(e[Mi])}function oa(e){return Symbol.asyncIterator&&gi(null==e?void 0:e[Symbol.asyncIterator])}function sa(e){/* @__PURE__ */
|
|
2
2
|
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 la,ca="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function ua(e){return gi(null==e?void 0:e[ca])}function da(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 mi?Promise.resolve(e.value.v).then(l,c):u(a[0][2],e)}(i[e](t))}catch(tR){u(a[0][3],tR)}}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 di(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,mi(t.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,mi(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,mi(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 pa(e){return gi(null==e?void 0:e.getReader)}function ha(e){if(e instanceof ji)return e;if(null!=e){if(aa(e))return i=e,new ji(function(e){var t=i[Mi]();if(gi(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")});if(ra(e))return r=e,new ji(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()});if(ia(e))return n=e,new ji(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Ti)});if(oa(e))return fa(e);if(ua(e))return t=e,new ji(function(e){var n,r;try{for(var i=pi(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(pa(e))return fa(da(e))}var t,n,r,i;throw sa(e)}function fa(e){return new ji(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(tR){a(tR)}}function s(e){try{l(r.throw(e))}catch(tR){a(tR)}}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 di(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=pi(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 ma(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 ga(e,t){return void 0===t&&(t=0),$i(function(n,r){n.subscribe(Vi(r,function(n){return ma(r,e,function(){return r.next(n)},t)},function(){return ma(r,e,function(){return r.complete()},t)},function(n){return ma(r,e,function(){return r.error(n)},t)}))})}function ya(e,t){return void 0===t&&(t=0),$i(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function ba(e,t){if(!e)throw new Error("Iterable cannot be null");return new ji(function(n){ma(n,t,function(){var r=e[Symbol.asyncIterator]();ma(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function va(e,t){return t?function(e,t){if(null!=e){if(aa(e))return function(e,t){return ha(e).pipe(ya(t),ga(t))}(e,t);if(ra(e))return function(e,t){return new ji(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(ia(e))return function(e,t){return ha(e).pipe(ya(t),ga(t))}(e,t);if(oa(e))return ba(e,t);if(ua(e))return function(e,t){return new ji(function(n){var r;return ma(n,t,function(){r=e[ca](),ma(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 gi(null==r?void 0:r.return)&&r.return()}})}(e,t);if(pa(e))return function(e,t){return ba(da(e),t)}(e,t)}throw sa(e)}(e,t):ha(e)}function xa(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return va(e,na(e))}function ka(e,t){var n=gi(e)?e:function(){return e},r=function(e){return e.error(n())};return new ji(t?function(e){return t.schedule(r,0,e)}:r)}!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(la||(la={}));var wa=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 gi(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?xa(n):"E"===t?ka(function(){return r}):"C"===t?ea: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}();yi(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Sa(e,t){return $i(function(n,r){var i=0;n.subscribe(Vi(r,function(n){r.next(e.call(t,n,i++))}))})}function Na(e,t,n){return void 0===n&&(n=1/0),gi(t)?Na(function(n,r){return Sa(function(e,i){return t(n,e,r,i)})(ha(e(n,r)))},n):("number"==typeof t&&(n=t),$i(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;ha(n(e,o++)).subscribe(Vi(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(Vi(t,c,function(){s=!0,l()})),function(){}}(t,r,e,n)}))}function Ta(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(void 0===(n=1)&&(n=1/0),Na(Li,n))(va(e,na(e)));var n}function Ca(e,t){return $i(function(n,r){var i=0;n.subscribe(Vi(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function Ea(e){return $i(function(t,n){var r,i=null,a=!1;i=t.subscribe(Vi(n,void 0,void 0,function(o){r=ha(e(o,Ea(e)(t))),i?(i.unsubscribe(),i=null,r.subscribe(n)):a=!0})),a&&(i.unsubscribe(),i=null,r.subscribe(n))})}function Ia(e,t){return e===t}function Oa(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new Ui}: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},h=function(){var e=t;p(),null==e||e.unsubscribe()};return $i(function(e,f){s++,u||c||d();var m=a=null!=a?a:n();f.add(function(){0!==--s||u||c||(r=za(h,l))}),m.subscribe(f),!t&&s>0&&(t=new _i({next:function(e){return m.next(e)},error:function(e){u=!0,d(),r=za(p,i,e),m.error(e)},complete:function(){c=!0,d(),r=za(p,o),m.complete()}}),ha(e).subscribe(t))})(e)}}function za(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 _i({next:function(){i.unsubscribe(),e()}});return ha(t.apply(void 0,fi([],hi(n)))).subscribe(i)}}else e()}function Aa(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,Oa({connector:function(){return new Ji(o,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}function _a(e,t,n){var r=gi(e)||t||n?{next:e,error:t,complete:n}:e;return r?$i(function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var i=!0;e.subscribe(Vi(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)}))}):Li}function Da(e){try{return e()}catch{}}var Pa=Da(()=>globalThis)||Da(()=>window)||Da(()=>self)||Da(()=>global)||Da(function(){return Da.constructor("return this")()}),Ra="4.3.0",Ma=/* @__PURE__ */new Map;function La(e){const t=Ma.get(e)||1;return Ma.set(e,t+1),`${e}:${t}:${Math.random().toString(36).slice(2)}`}var ja="Invariant Violation",Fa=class e extends Error{constructor(t=ja){super(t),this.name=ja,Object.setPrototypeOf(this,e.prototype)}},$a=["debug","log","warn","error","silent"],Va=$a.indexOf("silent");function qa(e,...t){if(!e)throw Ua(...t)}function Ba(e){return function(t,...n){if($a.indexOf(e)>=Va){const r=console[e]||console.log;if("number"==typeof t){const e=t;(t=Ga(e))||(t=Ja(e,n),n=[])}r(t,...n)}}}function Ua(e,...t){return new Fa(Ga(e,t)||Ja(e,t))}qa.debug=Ba("debug"),qa.log=Ba("log"),qa.warn=Ba("warn"),qa.error=Ba("error");var Ha=Symbol.for("ApolloErrorMessageHandler_"+Ra);function Wa(e){if("string"==typeof e)return e;try{return function(e,t=0){const n=La("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 Ga(e,t=[]){if(e)return Pa[Ha]&&Pa[Ha](e,t.map(Wa))}function Ja(e,t=[]){if(e)return"string"==typeof e?t.reduce((e,t)=>e.replace(/%[sdfo]/,Wa(t)),e):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:Ra,message:e,args:t.map(Wa)}))}`}function Ka(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=>Ka(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 Ka(n,t,e,r),n[t.value]});else if("EnumValue"===n.kind)e[t.value]=n.value;else{if("NullValue"!==n.kind)throw Ua(21,t.value,n.kind);e[t.value]=null}}function Qa(e,t){if(e.arguments&&e.arguments.length){const n={};return e.arguments.forEach(({name:e,value:r})=>Ka(n,e,r,t)),n}return null}var Ya=Symbol.for("apollo.cacheSize"),Xa={...Pa[Ya]};function Za(e,t){return e.definitions.find(e=>"OperationDefinition"===e.kind&&!!e.name)?.name.value??t}var eo=()=>Object.create(null),{forEach:to,slice:no}=Array.prototype,{hasOwnProperty:ro}=Object.prototype,io=class e{constructor(e=!0,t=eo){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return to.call(e,e=>t=t.getChildTrie(e)),ro.call(t,"data")?t.data:t.data=this.makeData(no.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(no.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 ao(){}var oo=class{constructor(e=1/0,t=ao){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 so(){}var lo=so,co="undefined"!=typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},uo="undefined"!=typeof WeakMap?WeakMap:Map,po="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:so,unregister:so}},ho=class{constructor(e=1/0,t=lo){this.max=e,this.dispose=t,this.map=new uo,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 co(n),this.registry.register(n,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new po(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))}},fo=/* @__PURE__ */new WeakSet;function mo(e){e.size<=(e.max||-1)||fo.has(e)||(fo.add(e),setTimeout(()=>{e.clean(),fo.delete(e)},100))}var go=function(e,t){const n=new ho(e,t);return n.set=function(e,t){const n=ho.prototype.set.call(this,e,t);return mo(this),n},n},yo=function(e,t){const n=new oo(e,t);return n.set=function(e,t){const n=oo.prototype.set.call(this,e,t);return mo(this),n},n};function bo(e,{max:t,makeCacheKey:n=e=>e}){const r=new io(!0),i=new go(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 vo=bo((e,t)=>{qa(e&&"Document"===e.kind,1);const n=e.definitions.filter(e=>"OperationDefinition"===e.kind);t&&qa(1==n.length&&n[0].operation===t,4,t,t,n[0].operation),ir(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),Ua(5,t.alias.value,i.join("."),n[0].operation,Za(e,"(anonymous)"))}}})},{max:Xa.checkDocument||2e3}),{toString:xo}=Object.prototype;function ko(e=[]){const t={};return e.forEach(e=>{t[e.name.value]=e}),t}function wo(e){return e.definitions.filter(e=>"FragmentDefinition"===e.kind)}function So(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 qa(r,11,n),r}default:return null}}function No(e){let t;vo(e);for(let n of e.definitions){if("OperationDefinition"===n.kind)return n;"FragmentDefinition"!==n.kind||t||(t=n)}if(t)return t;throw Ua(14)}function To(e){return vo(e),e.definitions.filter(e=>"OperationDefinition"===e.kind)[0]}function Co(e){return"Field"===e.kind}function Eo(e){return e.match(/^\[(.*)\]$/)}function Io(e){return e.alias?e.alias.value:e.name.value}function Oo(e){return e.replace(/[[\]]/g,"")}function zo(...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 Ao(e){return null!==e&&"object"==typeof e}var{hasOwnProperty:_o}=Object.prototype,Do=function(e,t,n){return this.merge(e[n],t[n])},Po=e=>isNaN(+e)?{}:[],Ro=class{options;reconciler;constructor(e={}){this.options=e,this.reconciler=e.reconciler||Do}merge(e,t,n={}){const r=n.atPath;if(r?.length){const[i,...a]=r;void 0===e&&(e=Po(i));let o=e[i];void 0===o&&a.length&&(o=Po(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)),Ao(t)&&Ao(e)?(Object.keys(t).forEach(n=>{if(_o.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=Ao;pastCopies=/* @__PURE__ */new Set;shallowCopyForMerge(e){return Ao(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):{__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}};function Mo(e){const t={},n=e&&e.variableDefinitions;return n&&n.length&&n.forEach(e=>{e.defaultValue&&Ka(t,e.variable.name,e.defaultValue)}),t}function Lo(e,t){let n=t;const r=[];return e.definitions.forEach(e=>{if("OperationDefinition"===e.kind)throw Ua(12,e.operation,e.name?` named '${e.name.value}'`:"");"FragmentDefinition"===e.kind&&r.push(e)}),void 0===n&&(qa(1===r.length,13,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]}}var jo,Fo=Object.assign(function(e){return JSON.stringify(e,$o)},{reset(){jo=new yo(Xa.canonicalStringify||1e3)}});function $o(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(Vo))return t;const r=JSON.stringify(n);let i=jo.get(r);if(!i){n.sort();const e=JSON.stringify(n);i=jo.get(e)||n,jo.set(r,i),jo.set(e,i)}const a=Object.create(e);return i.forEach(e=>{a[e]=t[e]}),a}}return t}function Vo(e,t,n){return 0===t||n[t-1]<=e}Fo.reset();var qo=["connection","include","skip","client","rest","export","nonreactive","stream"],Bo=Fo,Uo=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=Bo(r);if("{}"!==i)return`${n.connection.key}(${i})`}return n.connection.key}let r=e;if(t){const e=Bo(t);"{}"!==e&&(r+=`(${e})`)}return n&&Object.keys(n).forEach(e=>{-1===qo.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?r+=`@${e}(${Bo(n[e])})`:r+=`@${e}`)}),r},{setStringify(e){const t=Bo;return Bo=e,t}});function Ho(e){return!!e.errors?.length}function Wo(e,t,n){const r=new Set(e),i=r.size;return ir(t,{Directive(e){if(r.delete(e.name.value)&&(!n||!r.size))return rr}}),n?!r.size:r.size<i}function Go(e){let t=!1;return ir(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 rr}}}),t}var Jo=Array.isArray,Ko=bo(function(e,t){return!!e.directives?.some(e=>{if("defer"!==e.name.value)return!1;for(const n of e.arguments??[])if("if"===n.name.value)switch(n.value.kind){case dn:return n.value.value;case sn:return!!t?.[n.value.name.value]}return!0})},{max:Xa.isDeferredFragment||2e3,makeCacheKey:([e,t])=>[e,Fo(t)]});function Qo(e){return Array.isArray(e)&&e.length>0}function Yo(e){return null!==e&&"object"==typeof e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}var Xo=bo(function(e,t){return!!e.directives?.some(e=>{if("stream"!==e.name.value)return!1;for(const n of e.arguments??[])if("if"===n.name.value)switch(n.value.kind){case dn:return n.value.value;case sn:return!!t?.[n.value.name.value]}return!0})},{max:Xa.isStreamField||2e3,makeCacheKey:([e,t])=>[e,Fo(t)]}),Zo=null,es={},ts=1;function ns(e){try{return e()}catch(t){}}var rs="@wry/context:Slot",is=ns(()=>globalThis)||ns(()=>global)||Object.create(null),as=is[rs]||Array[rs]||function(e){try{Object.defineProperty(is,rs,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",ts++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Zo;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===es)break;return e!==Zo&&(Zo.slots[this.id]=t),!0}return Zo&&(Zo.slots[this.id]=es),!1}getValue(){if(this.hasValue())return Zo.slots[this.id]}withValue(e,t,n,r){const i={__proto__:null,[this.id]:e},a=Zo;Zo={parent:a,slots:i};try{return t.apply(r,n)}finally{Zo=a}}static bind(e){const t=Zo;return function(){const n=Zo;try{return Zo=t,e.apply(this,arguments)}finally{Zo=n}}}static noContext(e,t,n){if(!Zo)return e.apply(n,t);{const r=Zo;try{return Zo=null,e.apply(n,t)}finally{Zo=r}}}}),{bind:os,noContext:ss}=as,ls=new as,{hasOwnProperty:cs}=Object.prototype,us=Array.from||function(e){const t=[];return e.forEach(e=>t.push(e)),t};function ds(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}var ps=[];function hs(e,t){if(!e)throw new Error(t||"assertion failure")}function fs(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function ms(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function gs(e){return e.slice(0)}var ys=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&&!xs(this))return bs(this),this.value[0]}recompute(e){return hs(!this.recomputing,"already recomputing"),bs(this),xs(this)?function(e,t){return Es(e),ls.withValue(e,vs,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{ds(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(tR){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,xs(e)||ws(e)}(e),ms(e.value)}(this,e):ms(this.value)}setDirty(){this.dirty||(this.dirty=!0,ks(this),ds(this))}dispose(){this.setDirty(),Es(this),Ss(this,(e,t)=>{e.setDirty(),Is(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=ps.pop()||/* @__PURE__ */new Set),this.deps.add(e)}forgetDeps(){this.deps&&(us(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),ps.push(this.deps),this.deps=null)}};function bs(e){const t=ls.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),xs(e)?Ns(t,e):Ts(t,e),t}function vs(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=gs(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!fs(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch(i){}}catch(tR){e.value[1]=tR}e.recomputing=!1}function xs(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function ks(e){Ss(e,Ns)}function ws(e){Ss(e,Ts)}function Ss(e,t){const n=e.parents.size;if(n){const r=us(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function Ns(e,t){hs(e.childValues.has(t)),hs(xs(t));const n=!xs(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=ps.pop()||/* @__PURE__ */new Set;e.dirtyChildren.add(t),n&&ks(e)}function Ts(e,t){hs(e.childValues.has(t)),hs(!xs(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,gs(t.value)):fs(n,t.value)||e.setDirty(),Cs(e,t),xs(e)||ws(e)}function Cs(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(ps.length<100&&ps.push(n),e.dirtyChildren=null))}function Es(e){e.childValues.size>0&&e.childValues.forEach((t,n)=>{Is(e,n)}),e.forgetDeps(),hs(null===e.dirtyChildren)}function Is(e,t){t.parents.delete(e),e.childValues.delete(t),Cs(e,t)}ys.count=0;var Os,zs={setDirty:!0,dispose:!0,forget:!0};function As(e){const t=/* @__PURE__ */new Map,n=e&&e.subscribe;function r(e){const r=ls.getValue();if(r){let i=t.get(e);i||t.set(e,i=/* @__PURE__ */new Set),r.dependOn(i),"function"==typeof n&&(ds(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){const r=t.get(e);if(r){const i=n&&cs.call(zs,n)?n:"setDirty";us(r).forEach(e=>e[i]()),t.delete(e),ds(r)}},r}function _s(...e){return(Os||(Os=new io("function"==typeof WeakMap))).lookupArray(e)}var Ds=/* @__PURE__ */new Set;function Ps(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=_s,normalizeResult:i,subscribe:a,cache:o=oo}=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 ys(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),Ds.add(s),ls.hasValue()||(Ds.forEach(e=>e.clean()),Ds.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 Rs(e){return{__ref:String(e)}}function Ms(e){let t=e[0]||{};const n=e.length;if(n>1){const r=new Ro;for(let i=1;i<n;++i)t=r.merge(t,e[i])}return t}function Ls(e,t){return zo(e,t,t.variables&&{variables:zo({...e&&e.variables,...t.variables})})}function js(e){return e.catch(()=>{}),e}function Fs(e,t){vo(t);const n=$s(""),r=$s(""),i=e=>{for(let t,i=0;i<e.length&&(t=e[i]);++i)if(!Jo(t)){if("OperationDefinition"===t.kind)return n(t.name&&t.name.value);if("FragmentDefinition"===t.kind)return r(t.name.value)}return qa.error(16),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=>Qo(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=ir(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),h=/* @__PURE__ */new Set;d.definitions.forEach(e=>{"OperationDefinition"===e.kind?p(n(e.name&&e.name.value)).fragmentSpreads.forEach(e=>{h.add(e)}):"FragmentDefinition"!==e.kind||0!==a||r(e.name.value).removed||h.add(e.name.value)}),h.forEach(e=>{p(r(e)).fragmentSpreads.forEach(e=>{h.add(e)})});const f={enter(e){if(t=e.name.value,!h.has(t)||r(t).removed)return null;var t}};return function(e){return Vs(To(e)||function(e){qa("Document"===e.kind,8),qa(e.definitions.length<=1,9);const t=e.definitions[0];return qa("FragmentDefinition"===t.kind,10),t}(e),ko(wo(e)))?null:e}(ir(d,{FragmentSpread:f,FragmentDefinition:f,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 $s(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 Vs(e,t){return!e||e.selectionSet.selections.every(e=>"FragmentSpread"===e.kind&&Vs(t[e.name.value],t))}function qs(e){return ir(e,{FragmentSpread(e){if(!e.directives?.some(({name:e})=>"unmask"===e.value))return null}})}function Bs({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;qa(n&&1===n.length,18,r);const i=n[0];qa(i.name&&"if"===i.name.value,19,r);const a=i.value;qa(a&&("Variable"===a.kind||"BooleanValue"===a.kind),20,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],qa(void 0!==r,17,e.name.value)):r=n.value.value,"skip"===e.name.value?!r:r})}function Us(e){return"dataState"in e?e:{...e,dataState:e.complete?"complete":null===e.result?"empty":"partial"}}function Hs(e){const t={data:e.data};return e.error&&(t.error=e.error),t}function Ws(e,t=()=>{}){return n=>new ji(r=>{let i=t();return n.subscribe({next(t){let n;try{n=e(t,i)}catch(tR){r.error(tR)}void 0!==n&&r.next(n)},error(e){r.error(e)},complete(){r.complete()}})})}var{toString:Gs,hasOwnProperty:Js}=Object.prototype,Ks=Function.prototype.toString,Qs=/* @__PURE__ */new Map;function Ys(e,t){try{return Xs(e,t)}finally{Qs.clear()}}function Xs(e,t){if(e===t)return!0;const n=Gs.call(e);if(n!==Gs.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(nl(e,t))return!0;const n=Zs(e),r=Zs(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!Js.call(t,n[e]))return!1;for(let a=0;a<i;++a){const r=n[a];if(!Xs(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(nl(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&&!Xs(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=Ks.call(e);return n===Ks.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,tl)}}return!1}function Zs(e){return Object.keys(e).filter(el,e)}function el(e){return void 0!==this[e]}var tl="{ [native code] }";function nl(e,t){let n=Qs.get(e);if(n){if(n.has(t))return!0}else Qs.set(e,n=/* @__PURE__ */new Set);return n.add(t),!1}function rl(e,{data:t,...n},{data:r,...i},a){return Ys(n,i)&&il(No(e).selectionSet,t,r,{fragmentMap:ko(wo(e)),variables:a})}function il(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),!Bs(e,r.variables))return!0;if(al(e))return!0;if(Co(e)){const i=Io(e),a=t&&t[i],o=n&&n[i],s=e.selectionSet;if(!s)return Ys(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(!il(s,a[t],o[t],r))return!1;return!0}return il(s,a,o,r)}{const i=So(e,r.fragmentMap);if(i)return!!al(i)||il(i.selectionSet,t,n,r)}})}function al(e){return!!e.directives&&e.directives.some(ol)}function ol(e){return"nonreactive"===e.name.value}var sl=bo(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(Sa(i),Aa({bufferSize:1,refCount:!0})),{getCurrentResult:()=>i(e.getCurrentResult())})}(e,n)},{max:1,makeCacheKey:e=>e.slice(0,2)}),ll=Symbol.for("apollo.result.extensions"),cl=Symbol.for("apollo.result.streamInfo"),ul=Symbol.for("apollo.observableQuery.variablesUnknown"),dl=Symbol.for("apollo.cache.handleIncremental");function pl(...e){return _s.bind(null,...e)}var hl=class{isIncrementalResult(e){return!1}prepareRequest(e){return qa(!Wo(["defer","stream"],e.query),69),e}extractErrors(){}startRequest=void 0};function fl(e){return e}var ml,gl=class e{transform;cached;resultCache=/* @__PURE__ */new WeakSet;getCacheKey(e){return[e]}static identity(){return new e(fl,{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 io;this.performWork=Ps(e.prototype.performWork.bind(this),{makeCacheKey:e=>{const n=this.getCacheKey(e);if(n)return qa(Array.isArray(n),22),t.lookupArray(n)},max:Xa["documentTransform.cache"],cache:ho})}}performWork(e){return vo(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},yl=Object.assign(e=>{let t=ml.get(e);return t||(t=function(e){return ir(e,or)}(e),ml.set(e,t)),t},{reset(){ml=new go(Xa.print||2e3)}});function bl(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}yl.reset();var vl={kind:en,name:{kind:Kt,value:"__typename"}},xl=Object.assign(function(e){return ir(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,vl]}}}})},{added:e=>e===vl});function kl(e,t){return To(e)?.operation===t}function wl(e){return 7===e||8===e}function Sl(e){return!wl(e)}var Nl=class e{static empty(){return new e(()=>ea)}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:Za(e.query),operationType:To(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),()=>ea)}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 Ua(67)}left;right},Tl=Nl.execute,Cl=class{assumeImmutableResults=!1;lookupFragment(e){return null}getRootTypename(e){return(t=e)[0].toUpperCase()+t.slice(1);var t}getScalar(e){}getScalarTypeForField(e,t){}configuresScalars(){return!1}serializeVariables(e,t){return t}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 io(!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:sl(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 Ys(o,t)||(o=t),o}if(0===a.length)return zl;let l=!1;const c=a.map(t=>this.watchSingleFragment(t,i,e)),u=function(e){return 0===e.length?ea:new ji(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(Sa(s),_a({subscribe:()=>l=!0,unsubscribe:()=>l=!1}),Aa({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 Il;const{optimistic:r=!0,variables:i}=n,a=[t,Fo({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&&rl(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 ji(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=Li),s=null!=s?s:Ia,$i(function(e,t){var n,r=!0;e.subscribe(Vi(t,function(e){var i=l(e);!r&&s(n,i)||(r=!1,n=i,t.next(e))}))})),Oa({connector:()=>new Ji(1),resetOnRefCountZero:()=>function(e,t,n){void 0===e&&(e=0),void 0===n&&(n=Zi);var r=-1;return null!=t&&(ta(t)?n=t:r=t),new ji(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=Ps(Lo,{max:Xa["cache.fragmentQueryDocuments"]||1e3,cache:ho,makeCacheKey:pl(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)}},El=Object.freeze({data:null,dataState:"complete",complete:!0}),Il=Object.assign(new ji(e=>{e.next(El)}),{dirty:!1,getCurrentResult:()=>El}),Ol=Object.freeze({data:[],dataState:"complete",complete:!0}),zl=Object.assign(new ji(e=>{e.next(Ol)}),{getCurrentResult:()=>Ol}),Al=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:_l}=Object.prototype;function Dl({__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 Pl={dataIdFromObject:Dl,resultCaching:!0},Rl=/^[_a-z][_0-9a-z]*/i;function Ml(e){const t=e.match(Rl);return t?t[0]:e}function Ll(e,t,n){return!!Ao(t)&&(Jo(t)?t.every(t=>Ll(e,t,n)):e.selections.every(e=>{if(Co(e)&&Bs(e,n)){const r=Io(e);return _l.call(t,r)&&(!e.selectionSet||Ll(e.selectionSet,t[r],n))}return!0}))}function jl(e){return Ao(e)&&!bl(e)&&!Jo(e)}function Fl(e,t){const n=ko(wo(e));return{fragmentMap:n,lookupFragment(e){let r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}function $l(e){switch(e.kind){case bn:return e.name.value;case vn:return`[${$l(e.type)}]`;case xn:return $l(e.type)}}var Vl={},ql=()=>Vl,Bl={},Ul=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),_l.call(this.data,e)){const n=this.data[e];if(n&&_l.call(n,t))return n[t]}return"__typename"===t&&_l.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Jl?this.parent.get(e,t):void 0}lookup(e,t){return t&&this.group.depend(e,"__exists"),_l.call(this.data,e)?this.data[e]:this instanceof Jl?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?{}:void 0}merge(e,t){let n;bl(e)&&(e=e.__ref),bl(t)&&(t=t.__ref);const r="string"==typeof e?this.lookup(n=e):e;let i="string"==typeof t?this.lookup(n=t):t;if(!i)return;qa("string"==typeof n,108),i=this.coerceStoreObject(i,(e,t)=>e.coerceToParsed(t),i.__typename||r?.__typename||this.policies.rootTypenamesById[n]);const a=new Ro({reconciler:Ql}).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=Ml(t);n===t||this.policies.hasKeyArgs(a.__typename,n)||(e[n]=1),void 0!==a[t]||this instanceof Jl||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:Vl,INVALIDATE:Bl,isReference:bl,toReference:this.toReference,canRead:this.canRead,readField:(t,n)=>this.policies.readField("string"==typeof t?{fieldName:t,from:n||Rs(e)}:t,{store:this})};if(Object.keys(r).forEach(l=>{const c=Ml(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===ql?Vl:d(u,{...s,fieldName:c,storeFieldName:l,storage:this.getStorage(e,l)});t===Bl?this.group.dirty(e,l):(t===Vl&&(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 Jl?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]:ql}:ql,!!n)}return!1}evict(e,t){let n=!1;return e.id&&(_l.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Jl&&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(){let e=this.toObject();this.hasScalarConfig()&&(e=Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t&&this.coerceStoreObject(t,(e,t)=>e.coerceToSerialized(t),t?.__typename||this.policies.rootTypenamesById[e])])));const t=[];return this.getRootIdSet().forEach(e=>{_l.call(this.policies.rootTypenamesById,e)||t.push(e)}),t.length&&(e.__META={extraRootIds:t.sort()}),e}hasScalarConfig(){return!!this.policies.cache.config.scalars}coerceStoreObject(e,t,n=e.__typename){if(!n||!this.hasScalarConfig())return e;let r=!1;const i=Object.entries(e).map(([e,i])=>{const a=Ml(e),o=this.policies.getScalarTypeForField(n,a),s=this.coerceValue(i,t,o,`${n}.${a}`);return r||=s!==i,[e,s]});return r?Object.fromEntries(i):e}coerceValue(e,t,n,r){if(null==e)return e;if(n){const i=Eo(n);if(i&&Array.isArray(e))return e.map(e=>this.coerceValue(e,t,i[1],r));const a=this.policies.cache.getScalar(Oo(n));if(a)return t(a,e)}return Array.isArray(e)?e.map(e=>this.coerceValue(e,t,n,r)):Yo(e)&&"__typename"in e?this.coerceStoreObject(e,t):e}replace(e){if(Object.keys(this.data).forEach(t=>{e&&_l.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 Jl?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=>{_l.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 Jl;)e=e.parent;n.forEach(t=>e.delete(t))}return n}refs={};findChildRefIds(e){if(!_l.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=>{bl(e)&&(t[e.__ref]=!0),Ao(e)&&Object.keys(e).forEach(t=>{const n=e[t];Ao(n)&&r.add(n)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,t)=>bl(e)?this.get(e.__ref,t):e&&e[t];canRead=e=>bl(e)?this.has(e.__ref):"object"==typeof e;toReference=(e,t)=>{if("string"==typeof e)return Rs(e);if(bl(e))return e;const[n]=this.policies.identify(e);if(n){const r=Rs(n);return t&&this.merge(n,e),r}};get supportsResultCaching(){return this.group.caching}},Hl=class{caching;parent;d=null;keyMaker;constructor(e,t=null){this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?As():null,this.keyMaker=new io}depend(e,t){if(this.d){this.d(Wl(e,t));const n=Ml(t);n!==t&&this.d(Wl(e,n)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(Wl(e,t),"__exists"===t?"forget":"setDirty")}};function Wl(e,t){return t+"#"+e}function Gl(e,t){Yl(e)&&e.group.depend(t,"__exists")}Ul.Root=class extends Ul{constructor({policies:e,resultCaching:t=!0,seed:n}){super(e,new Hl(t)),n&&this.replace(n)}stump=new Kl(this);addLayer(e,t){return this.stump.addLayer(e,t)}removeLayer(){return this}storageTrie=new io;getStorage(){return this.storageTrie.lookupArray(arguments)}};var Jl=class e extends Ul{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=>{Ys(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 _l.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)}},Kl=class extends Jl{constructor(e){super("EntityStore.Stump",e,()=>{},new Hl(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}};function Ql(e,t,n){const r=e[n],i=t[n];return Ys(r,i)?r:i}function Yl(e){return!(!e||!e.supportsResultCaching)}var Xl=new as;function Zl(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 ec(e,t,n){return Xl.withValue(!0,()=>{const r=tc(e,t,n,!1);return Object.isFrozen(e),r})}function tc(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=tc(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=Io(s),l=s.selectionSet;if(t=o[i]||e[i],void 0===t)continue;if(l&&null!==t){const o=tc(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=tc(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));qa(a,41,r);const o=Zl(s);"mask"!==o&&(t=tc(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 nc={};function rc(e){const t=JSON.stringify(e);return nc[t]||(nc[t]={})}function ic(e){const t=rc(e);return t.keyFieldsFn||(t.keyFieldsFn=(t,n)=>{const r=(e,t)=>n.readField(t,e),i=n.keyObject=oc(e,e=>{let i=cc(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&_l.call(t,e[0])&&(i=cc(t,e,lc)),qa(void 0!==i,113,e.join("."),t),i});return`${n.typename}:${JSON.stringify(i)}`})}function ac(e){const t=rc(e);return t.keyArgsFn||(t.keyArgsFn=(t,{field:n,variables:r,fieldName:i})=>{const a=oc(e,e=>{const i=e[0],a=i.charAt(0);if("@"!==a){if("$"===a){const t=i.slice(1);if(r&&_l.call(r,t)){const n=e.slice(0);return n[0]=t,cc(r,n)}return}if(t)return cc(t,e)}else if(n&&Qo(n.directives)){const t=i.slice(1),a=n.directives.find(e=>e.name.value===t),o=a&&Qa(a,r);return o&&cc(o,e.slice(1))}}),o=JSON.stringify(a);return(t||"{}"!==o)&&(i+=":"+o),i})}function oc(e,t){const n=new Ro;return sc(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 sc(e){const t=rc(e);if(!t.paths){const n=t.paths=[],r=[];e.forEach((t,i)=>{Jo(t)?(sc(t).forEach(e=>n.push(r.concat(e))),r.length=0):(r.push(t),Jo(e[i+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function lc(e,t){return e[t]}function cc(e,t,n){return n=n||lc,uc(t.reduce(function e(t,r){return Jo(t)?t.map(t=>e(t,r)):t&&n(t,r)},e))}function uc(e){return Ao(e)?Jo(e)?e.map(uc):oc(Object.keys(e).sort(),t=>cc(e,t)):e}var dc=new as,pc=/* @__PURE__ */new WeakMap;function hc(e){let t=pc.get(e);return t||pc.set(e,t={vars:/* @__PURE__ */new Set,dep:As()}),t}function fc(e){hc(e).vars.forEach(t=>t.forgetCache(e))}function mc(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=>{hc(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=dc.getValue();e&&(i(e),hc(e).dep(r))}return e};r.onNextChange=e=>(n.add(e),()=>{n.delete(e)});const i=r.attachCache=e=>(t.add(e),hc(e).vars.add(r),r);return r.forgetCache=e=>t.delete(e),r}function gc(e){return void 0!==e.args?e.args:e.field?Qa(e.field,e.variables):null}var yc=()=>{},bc=(e,t)=>t.fieldName,vc=(e,t,{mergeObjects:n})=>n(e,t),xc=(e,t)=>t,kc=(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},wc=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:Dl,...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=Nc(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 Xl.withValue(!0,()=>{for(;l;){const t=l({...e,...i},a);if(!Jo(t)){o=t;break}l=ic(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),_l.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?vc:!1===t?xc:e.merge}o(r,t.merge),r.keyFn=!1===i?yc:Jo(i)?ic(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.scalar||(r.read=i);else{let{keyArgs:e,read:t,merge:n,scalar:a}=i;a&&(r.scalar=a),r.scalar&&(r.read=t=void 0,r.merge=n=void 0),r.keyFn=!1===e?bc:Jo(e)?ac(e):"function"==typeof e?e:r.keyFn,"function"==typeof t&&(r.read=t),o(r,n)}r.read&&r.merge&&(r.keyFn=r.keyFn||bc)})}setRootTypename(e,t=e){const n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(qa(!r||r===e,114,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(Rl);n&&n[0]===e||this.fuzzySubtypes.set(e,new RegExp(e))})})}getTypePolicy(e){if(!_l.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&&Ll(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=gc(e);for(;a;){const e=a(o,r);if(!Jo(e)){i=e||n;break}a=ac(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})=>Ka(n[e.name.value],r,i,t))}));let r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach(({name:e,value:n})=>Ka(r,e,n,t))),Uo(e.name.value,r,n)}(e.field,e.variables):Uo(n,gc(e))),!1===i?n:n===Ml(i)?i:n+":"+i}getScalarTypeForField(e,t){return this.getFieldPolicy(e,t)?.scalar}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=Ml(r),a=t.store.getFieldValue(n,r),o=this.getFieldPolicy(e.typename,i),s=o&&o.read;if(s){const i=Sc(this,n,e,t,t.store.getStorage(bl(n)?n.__ref:n,r));return dc.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===vc)return Tc(o.store)(e,t);if(i===xc)return t;o.overwrite&&(e=void 0);const c=o.extensions?.[cl]?.deref()?.peekArray(a);if(c){const{current:e,previous:n}=c;if(n&&Ys(n.incoming,t)&&Ys(n.streamFieldInfo,e))return n.result}const u=i(e,t,function(e,t,n,r,i,a){const o={...Sc(e,void 0,n,r,i),extensions:r.extensions,existingData:a},s=r.extensions;if(s&&cl in s){const{[cl]: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 Sc(e,t,n,r,i){const a=e.getStoreFieldName(n),o=Ml(a),s=n.variables||r.variables,{toReference:l,canRead:c}=r.store;return{args:gc(n),field:n.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:bl,toReference:l,storage:i,cache:e.cache,canRead:c,readField:(...n)=>e.readField(Nc(n,t,s),r),mergeObjects:Tc(r.store)}}function Nc(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},_l.call(o,"from")||(o.from=t)),void 0===o.variables&&(o.variables=n),o}function Tc(e){return function(t,n){if(Jo(t)||Jo(n))throw Ua(117);if(Ao(t)&&Ao(n)){const r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(bl(t)&&jl(n))return e.merge(t.__ref,n),t;if(jl(t)&&bl(n))return e.merge(t,n.__ref),n;if(jl(t)&&jl(n))return{...t,...n}}return n}}function Cc(e){return[e.selectionSet,e.objectOrReference,e.context]}var Ec=class{executeSelectionSet;executeSubSelectedArray;prunePartialStreamArray;prunePartialBoundaries;config;knownResults=/* @__PURE__ */new WeakMap;keyMaker=new io;constructor(e){this.config=e,this.executeSelectionSet=Ps(e=>{const t=Cc(e);return this.executeSelectionSet.peek(...t)||(Gl(e.context.store,e.enclosingRef.__ref),this.execSelectionSetImpl(e))},{max:Xa["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Cc,makeCacheKey(e,t,n){if(Yl(n.store))return n.store.makeCacheKey(e,bl(t)?t.__ref:t,n.varString)}}),this.executeSubSelectedArray=Ps(e=>(Gl(e.context.store,e.enclosingRef.__ref),this.execSubSelectedArrayImpl(e)),{max:Xa["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:e,array:t,context:n}){if(Yl(n.store))return n.store.makeCacheKey(e,t,n.varString)}}),this.prunePartialBoundaries=Ps(e=>this.prunePartialBoundariesImpl(e),{max:Xa["inMemoryCache.prunePartialBoundaries"]||2e4,makeCacheKey:({boundaries:e,context:t,selectionSet:n})=>{if(Yl(t.store))return this.keyMaker.lookup(n,e,t.streamInfo,t.deferInfo)}}),this.prunePartialStreamArray=Ps(e=>{const{field:t,context:n,path:r}=e;return Xo(t,n.variables)&&n.streamInfo?.lookupArray(r).state.depend(),this.prunePartialStreamArrayImpl(e)},{max:Xa["inMemoryCache.prunePartialStreamArray"]||2e4,makeCacheKey:({field:e,context:t,boundaries:n})=>{if(Yl(t.store))return this.keyMaker.lookup(e,n,t.streamInfo,t.deferInfo)}})}diffQueryAgainstStore({store:e,query:t,rootId:n="ROOT_QUERY",variables:r,returnPartialData:i=!0,...a}){const o=Object.hasOwn(a,dl),s=this.config.cache.policies;r=zo(Mo(function(e){const t=To(e);return qa(t&&"query"===t.operation,15),t}(t)),r);const l=Rs(n),c={store:e,query:t,policies:s,variables:r,varString:Fo(r),...Fl(t,this.config.fragments),...a[dl]};let u=this.executeSelectionSet({selectionSet:No(t).selectionSet,objectOrReference:l,enclosingRef:l,context:c});if(o&&function({dataState:e},t){return"deferPartial"===e||"streamPartial"===e||("complete"===e||"streaming"===e)&&!(!t.streamInfo&&!t.deferInfo)}(u,c)){const e=this.prunePartialBoundaries({selectionSet:No(t).selectionSet,data:u.result,boundaries:u.partialBoundaries,context:c,path:[]});u.result!==e.result&&i||(u={result:e.result,partialBoundaries:u.partialBoundaries,dataState:e.dataState})}let{result:d,dataState:p,missing:h}=u;const f=!(!h||"streaming"===p&&o);let m;"streaming"===p&&0===Object.keys(d).length&&(p="empty"),("deferPartial"===p||"streamPartial"===p||"streaming"===p&&!o)&&(p="partial"),"partial"!==p||i||(p="empty");const g="complete"===p,y={result:g||"streaming"===p||i&&Object.keys(d).length?d:null,complete:g,get missing(){return f&&(m||=new Al(function(e){try{JSON.stringify(e,(e,t)=>{if("string"==typeof t)throw t;return t})}catch(d){return d}}(h),h,t,r)),m}};return o&&(y.dataState=p),y}isFresh(e,t,n,r){if(Yl(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(bl(t)&&!r.policies.rootTypenamesById[t.__ref]&&!r.store.has(t.__ref))return{result:{},dataState:"empty",missing:`Dangling reference to missing ${t.__ref} object`,partialBoundaries:new Ic};const{variables:i,policies:a,store:o}=r,s=o.getFieldValue(t,"__typename"),l=[];let c,u;const d=new Ro,p=new Ic;function h(e,t){return e.missing&&(u=d.merge(u,{[t]:e.missing})),e}"string"!=typeof s||a.rootIdsByTypename[s]||l.push({__typename:s}),new Set(e.selections).forEach(e=>{if(Bs(e,i))if(Co(e)){let i=a.readField({fieldName:e.name.value,field:e,variables:r.variables,from:t},r);const o=Io(e);if(void 0===i){if(!xl.added(e)){const n=bl(t)?t.__ref:t?a.identify(t)[0]:void 0;u=d.merge(u,{[o]:`Can't find field '${e.name.value}' on ${n?`${n} object`:`object ${JSON.stringify(t||{},null,2)}`}`}),c=zc(c,"empty")}}else if(Jo(i))if(i.length>0){const t=h(this.executeSubSelectedArray({field:e,array:i,enclosingRef:n,context:r}),o);i=t.result,c=zc(c,t.dataState),p.set(o,t.partialBoundaries)}else c=zc(c,"complete");else if(e.selectionSet){if(null!=i){const t=h(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:i,enclosingRef:bl(i)?i:n,context:r}),o);i=t.result,p.set(o,t.partialBoundaries),c=zc(c,"empty"===t.dataState?"partial":t.dataState)}}else xl.added(e)||(c=zc(c,"complete"));void 0!==i&&l.push({[o]:i})}else{const i=So(e,r.lookupFragment);if(!i&&"FragmentSpread"===e.kind)throw Ua(120,e.name.value);if(i&&a.fragmentMatches(i,s)){const a=Ko(e,r.variables),o=this.execSelectionSetImpl({selectionSet:i.selectionSet,objectOrReference:t,enclosingRef:n,context:r}),{result:s,dataState:h}=o;p.merge(o.partialBoundaries),void 0!==s&&l.push(s),o.missing&&(u=d.merge(u,o.missing)),!a||"partial"!==h&&"empty"!==h||p.add(e),c=zc(c,a?"empty"===h?"streaming":"partial"===h?"deferPartial":h:h)}}}),c||="complete";const f={result:Ms(l),missing:u,dataState:c,partialBoundaries:p};return f.result&&this.knownResults.set(f.result,e),f}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:n,context:r}){let i,a="complete",o=new Ro;const s=new Ic,l=Xo(e,r.variables);return e.selectionSet&&(t=t.filter(e=>void 0===e||r.store.canRead(e))),t=t.map((t,c)=>{if(null===t)return null;let u;if(Jo(t)?u=this.executeSubSelectedArray({field:e,array:t,enclosingRef:n,context:r}):e.selectionSet&&(u=this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:t,enclosingRef:bl(t)?t:n,context:r})),u){const{dataState:t}=u;return s.set(c,"partial"===t?u.partialBoundaries.clone().add(e):u.partialBoundaries),a=zc(a,l&&"partial"===t?"streamPartial":t),function(e,t){return e.missing&&(i=o.merge(i,{[t]:e.missing})),e.result}(u,c)}return t}),{result:t,dataState:a,missing:i,partialBoundaries:s}}prunePartialBoundariesImpl({boundaries:e,context:t,data:n,path:r,selectionSet:i}){const{variables:a,lookupFragment:o,policies:s}=t;if(null==n||!e)return{result:n,dataState:"complete"};const l=new Ro;let c=!1,u="complete";const d={};Object.hasOwn(n,"__typename")&&(d.__typename=n.__typename);const p=new Set(i.selections);return p.forEach(i=>{if(!Bs(i,a))return;if(Co(i)){const a=Io(i);if(!Object.hasOwn(n,a))return;const o=n[a];if(Array.isArray(o)){const n=this.prunePartialStreamArray({field:i,array:o,boundaries:e.getChild(a),context:t,path:r.concat(a)});c||=n.result!==o,d[a]=n.result,u=zc(u,n.dataState)}else if(i.selectionSet){const n=this.prunePartialBoundaries({data:o,selectionSet:i.selectionSet,boundaries:e.getChild(a),context:t,path:r.concat(a)});c||=n.result!==o,u=zc(u,n.dataState),d[a]=Object.hasOwn(d,a)?l.merge(d[a],n.result):n.result}else d[a]=o;return}const h=So(i,o);let f=!1;if(t.deferInfo&&Ko(i,a)){const e=i.directives?.find(e=>"defer"===e.name.value),n=e&&function(e){const t=e.arguments?.find(e=>"label"===e.name.value);if(t&&"StringValue"===t.value.kind)return t.value.kind===un?t.value.value:void 0}(e);f=!!t.deferInfo.peekArray(r.concat(n||[]))}h&&s.fragmentMatches(h,n.__typename)&&(e.has(i)||f?u=zc(u,"streaming"):h.selectionSet.selections.forEach(p.add,p))}),Object.keys(d).length!==Object.keys(n).length?c=!0:c&&e.hasSelections()&&(c=!Ys(d,n)),{result:c?d:n,dataState:u}}prunePartialStreamArrayImpl({field:e,array:t,boundaries:n,context:r,path:i}){if(!n)return{result:t,dataState:"complete"};let a=!1,o="complete",s=[];const l=r.streamInfo?.peekArray(i)?.state,c=Math.min(t.length,l?.truncate?l.streamPosition:Number.MAX_SAFE_INTEGER);for(let u=0;u<c;u++){const c=t[u];let d={result:c,dataState:"complete"};if(n.getChild(u)?.has(e)){l?(l.truncate=!0,s=s.slice(0,l.streamPosition)):(s=[],o="complete");break}Array.isArray(c)?d=this.prunePartialStreamArray({field:e,array:c,boundaries:n.getChild(u),context:r,path:i.concat(u)}):e.selectionSet&&(d=this.prunePartialBoundaries({data:c,selectionSet:e.selectionSet,boundaries:n.getChild(u),context:r,path:i.concat(u)})),s.push(d.result),a||=d.result!==c,o=zc(o,d.dataState)}return a||=s.length!==t.length,{result:a?s:t,dataState:o}}},Ic=class e{selections=/* @__PURE__ */new Set;children=/* @__PURE__ */new Map;add(e){return this.selections.add(e),this}has(e){return this.selections.has(e)}hasSelections(){return this.selections.size>0}getChild(e){return this.children.get(e)}clone(){return(new e).merge(this)}set(e,t){const n=this.getChild(e);this.children.set(e,n?n.clone().merge(t):t)}merge(e){return e.selections.forEach(e=>this.add(e)),e.children.forEach((e,t)=>this.set(t,e)),this}},Oc={empty:{complete:"partial",deferPartial:"partial",streaming:"partial",streamPartial:"partial"},deferPartial:{empty:"partial"},streamPartial:{deferPartial:"deferPartial",empty:"partial"},streaming:{deferPartial:"deferPartial",empty:"partial",streamPartial:"streamPartial"},complete:{deferPartial:"deferPartial",streaming:"streaming",streamPartial:"streamPartial",empty:"partial"},partial:{}};function zc(e,t){return"partial"===t?"partial":e&&e!==t?Oc[e][t]||e:t}function Ac(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 _c=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=To(t),l=new Ro;i={...Mo(s),...i};const c={store:e,written:{},merge:(e,t)=>l.merge(e,t),variables:i,varString:Fo(i),...Fl(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(!bl(u))throw Ua(122,n);return c.incomingById.forEach(({storeObject:t,mergeTree:n,fieldNodeSet:r},i)=>{const a=Rs(i);if(n&&n.map.size){const e=this.applyMerges(n,a,t,c);if(bl(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]||jc(t,n,r.fragmentMap)||e&&r.store.get(e,"__typename");"string"==typeof l&&(s.__typename=l);const c=(...e)=>{const t=Nc(e,s,r.variables);if(bl(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[Io(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=Pc(i,t);let u,p=this.processFieldValue(r,n,n.selectionSet?Ac(e,!1,!1):e,a,d);n.selectionSet&&(bl(p)||jl(p))&&(u=c("__typename",p));const h=o.getMergeFunction(l,n.name.value,u);h?a.info={field:n,typename:l,merge:h,path:d}:e.extensions?.[cl]&&Array.isArray(p)&&Xo(n,e.variables)?a.info={field:n,typename:l,merge:kc,path:d}:Lc(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(tR){if(!e)throw tR}if("string"==typeof e){const a=Rs(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=Rc(l.mergeTree,i),u.forEach(e=>l.fieldNodeSet.add(e))):r.incomingById.set(e,{storeObject:s,mergeTree:Mc(i)?void 0:i,fieldNodeSet:u}),a}return s}processFieldValue(e,t,n,r,i){return t.selectionSet&&null!==e?Jo(e)?e.map((e,a)=>{const o=this.processFieldValue(e,t,n,Pc(r,a),[...i,a]);return Lc(r,a),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r,path:i}):e}flattenFields(e,t,n,r=jc(t,e,n.fragmentMap)){const i=/* @__PURE__ */new Map,{policies:a}=this.cache,o=new io(!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(!Bs(o,n.variables))return;let{clientOnly:s,deferred:c}=l;if(s&&c||!Qo(o.directives)||o.directives.forEach(e=>{const t=e.name.value;if("client"===t&&(s=!0),"defer"===t){const t=Qa(e,n.variables);t&&!1===t.if||(c=!0)}}),Co(o)){const e=i.get(o);e&&(s=s&&e.clientOnly,c=c&&e.deferred),i.set(o,Ac(n,s,c))}else{const i=So(o,n.lookupFragment);if(!i&&"FragmentSpread"===o.kind)throw Ua(124,o.name.value);i&&a.fragmentMatches(i,r,t,n.variables)&&e(i.selectionSet,Ac(n,s,c))}}))}(e,n),i}applyMerges(e,t,n,r,i){if(e.map.size&&!bl(n)){const a=Jo(n)||!bl(t)&&!jl(t)?void 0:t,o=n;let s;a&&!i&&(i=[bl(a)?a.__ref:a]);const l=(e,t)=>Jo(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&&qa(i.pop()===t)}),s&&(n=Jo(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}},Dc=[];function Pc({map:e},t){return e.has(t)||e.set(t,Dc.pop()||{map:/* @__PURE__ */new Map}),e.get(t)}function Rc(e,t){if(e===t||!t||Mc(t))return e;if(!e||Mc(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,Rc(e,t.map.get(r))),n.delete(r)}),n.forEach(n=>{i.map.set(n,Rc(t.map.get(n),e.map.get(n)))})}return i}function Mc(e){return!e||!(e.info||e.map.size)}function Lc({map:e},t){const n=e.get(t);n&&Mc(n)&&(Dc.push(n),e.delete(t))}function jc(e,t,n){let r;for(const i of t.selections)if(Co(i)){if("__typename"===i.name.value)return e[Io(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=jc(e,So(i,n).selectionSet,n);if("string"==typeof t)return t}}var Fc=class extends Cl{data;optimisticData;config;watches=/* @__PURE__ */new Set;storeReader;storeWriter;addTypenameTransform=new gl(xl);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=mc;constructor(...e){var t;super(),this.config=(t=e[0]??{},zo(Pl,t)),this.policies=new wc({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const e=this.data=new Ul.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 _c(this,this.storeReader=new Ec({cache:this,fragments:e}),e),this.maybeBroadcastWatch=Ps((e,t)=>this.broadcastWatch(e,t),{max:Xa["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:e=>{const t=e.optimistic?this.optimisticData:this.data;if(Yl(t)){const{optimistic:n,id:r,variables:i}=e;return t.makeCacheKey(e.query,e.callback,Fo({optimistic:n,id:r,variables:i}))}}}),
|
|
3
|
-
/* @__PURE__ */new Set([this.data.group,this.optimisticData.group]).forEach(e=>e.resetCaching())}getRootTypename(e){return this.policies.rootTypenamesById[`ROOT_${e.toUpperCase()}`]}getScalar(e){return this.config.scalars?.[e]}getScalarTypeForField(e,t){return this.policies.getScalarTypeForField(e,t)}configuresScalars(){return!!this.config.scalars}serializeVariables(e,t){if(!t||0===Object.keys(t).length||!this.config.scalars&&!this.config.inputObjects)return t;const n=To(e)?.variableDefinitions?.reduce((e,t)=>(e[t.variable.name.value]=$l(t.type),e),{});return n&&0!==Object.keys(n).length?this.serializeVariablesValue(t,n):t}serializeVariablesValue(e,t,n,r){if(null==e)return e;if(n){const i=Eo(n);if(i&&Array.isArray(e))return this.serializeInputArray(e,t,i[1],r);const a=this.getScalar(Oo(n));if(a)return a.coerceToSerialized(e)}return Array.isArray(e)?this.serializeInputArray(e,t,void 0,r):Yo(e)?this.serializeInputObject(e,t,r):e}serializeInputArray(e,t,n,r){let i=!1;const a=e.map(e=>{const a=this.serializeVariablesValue(e,t,n,r);return i||=a!==e,a});return i?a:e}serializeInputObject(e,t,n){let r=!1;const i=Object.entries(e).map(([e,i])=>{const a=t[e],o=n?`${n}.${e}`:e;if(!a)return[e,i];const s=this.config.inputObjects?.[Oo(a)];if(s){const t=this.serializeVariablesValue(i,s.fields,void 0,o);return r||=t!==i,[e,t]}const l=this.serializeVariablesValue(i,t,a,o);return r||=l!==i,[e,l]});return r?Object.fromEntries(i):e}restore(e){return this.init(),e&&this.data.replace(e),this}extract(e=!1){return(e?this.optimisticData:this.data).extract()}read(e){const{query:t,variables:n,returnPartialData:r=!1}=e;return this.storeReader.diffQueryAgainstStore({...e,variables:this.serializeVariables(t,n),store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r}).result}write(e){const{query:t,variables:n}=e;try{return++this.txCount,this.storeWriter.writeToStore(this.data,{...e,variables:this.serializeVariables(t,n)})}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}}modify(e){if(_l.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){const{variables:t}=e;return this.storeReader.diffQueryAgainstStore({...e,variables:this.serializeVariables(e.query,t),store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config})}watch(e){var t;return this.watches.size||hc(t=this).vars.forEach(e=>e.attachCache(t)),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&fc(this),this.maybeBroadcastWatch.forget(e)}}gc(e){Fo.reset(),yl.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(bl(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(tR){}}evict(e){if(!e.id){if(_l.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(),Fo.reset(),e&&e.discardWatches?(this.watches.forEach(e=>this.maybeBroadcastWatch.forget(e)),this.watches.clear(),fc(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&&Ys(n.result,r.result)||e.callback(e.lastDiff=r,n)}};function $c(e,t){return"object"==typeof e&&null!==e&&e[Symbol.for("apollo.error")]===t}function Vc(e){Object.defineProperty(e,Symbol.for("apollo.error"),{value:e.name,enumerable:!1,writable:!1,configurable:!1})}function qc(e){return e.map(e=>e.message||"Error message not found.").join("\n")}var Bc=class e extends Error{static is(e){return $c(e,"CombinedProtocolErrors")}static formatMessage=qc;errors;constructor(t){super(e.formatMessage(t,{defaultFormatMessage:qc})),this.name="CombinedProtocolErrors",this.errors=t,Vc(this),Object.setPrototypeOf(this,e.prototype)}},Uc=class e extends Error{static is(e){return $c(e,"UnconventionalError")}constructor(t){super("An error of unexpected shape occurred.",{cause:t}),this.name="UnconventionalError",Vc(this),Object.setPrototypeOf(this,e.prototype)}};function Hc(e){return e.filter(e=>e).map(e=>e.message||"Error message not found.").join("\n")}var Wc=class e extends Error{static is(e){return $c(e,"CombinedGraphQLErrors")}static formatMessage=Hc;errors;data;extensions;constructor(t,n=t.errors||[]){super(e.formatMessage(n,{result:t,defaultFormatMessage:Hc})),this.errors=n,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",Vc(this),Object.setPrototypeOf(this,e.prototype)}},Gc=/* @__PURE__ */new WeakSet,Jc=class e extends Error{static is(e){return $c(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,Vc(this),Object.setPrototypeOf(this,e.prototype)}},Kc=class e extends Error{static is(e){return $c(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,Vc(this),Object.setPrototypeOf(this,e.prototype)}},Qc=Symbol();function Yc(e){return"extensions"in e&&Bc.is(e.extensions[Qc])}function Xc(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 Uc(e)}var Zc,eu=/* @__PURE__ */new WeakMap;!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"}(Zc||(Zc={}));var{assign:tu,hasOwnProperty:nu}=Object,ru={loading:!0,networkStatus:Zc.loading,data:void 0,dataState:"empty",partial:!0},iu={loading:!1,networkStatus:Zc.ready,data:void 0,dataState:"empty",partial:!0},au=/* @__PURE__ */new WeakMap;function ou(e,t){const n=e[t];"function"==typeof n&&(e[t]=function(){return au.set(e,(au.get(e)+1)%1e15),n.apply(this,arguments)})}var su=class{options;queryName;variablesUnknown=!1;didWarnOnFeud=!1;lastMissing;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;const{cache:r}=e;au.has(r)||(au.set(r,0),ou(r,"evict"),ou(r,"modify"),ou(r,"reset")),this.waitForNetworkResult="network-only"===t.fetchPolicy,this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:i="cache-first"}={}}=e.defaultOptions,{fetchPolicy:a=i,initialFetchPolicy:o=("standby"===a?i:a)}=t;t[ul]&&(qa("standby"===a,84),this.variablesUnknown=!0),this.lastQuery=n,this.options={...t,initialFetchPolicy:o,fetchPolicy:a,variables:this.getVariablesWithDefaults(t.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const s=To(this.query);this.queryName=s&&s.name&&s.name.value}initializeObservablesQueue(){this.subject=new Wi({query:this.query,variables:this.variables,result:ru,meta:{}});const e=this.subject.pipe(_a({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),Ws(({query:e,variables:t,result:n,meta:r},i)=>{const{shouldEmit:a}=r;if(n===ru&&(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?rl(a,o,n,t):Ys(o,n))&&Ys(s,t))return}if(3!==a||this.options.notifyOnNetworkStatusChange&&!Ys(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 Ui,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:e=!0}={}){return Us(this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e,[dl]:void 0}))}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();let{dataState:t}=e;const n=this.options.returnPartialData||e.complete?e.result??void 0:void 0;return void 0===n&&(t="empty"),this.maskResult({data:n,dataState:t,loading:!e.complete,networkStatus:e.complete?Zc.ready:Zc.loading,partial:!e.complete})};switch(t){case"cache-only":return{...n(),loading:!1,networkStatus:Zc.ready};case"cache-first":return n();case"cache-and-network":return{...n(),loading:!0,networkStatus:Zc.loading};case"standby":return iu;default:return ru}}resubscribeCache(){const{variables:e,fetchPolicy:t}=this.options,n=this.query,r="standby"===t||"no-cache"===t||this.waitForNetworkResult,i=!lu({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!==ru&&r!==iu)&&(Ys(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===Zc.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?e:this.getInitialResult();return t===ru&&(t=this.getInitialResult()),Ys(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&&!Ys(this.variables,e)&&(n.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._reobserve(n,{newNetworkStatus:Zc.refetch})}fetchMore({query:e,variables:t,context:n,errorPolicy:r,updateQuery:i}){qa("cache-only"!==this.options.fetchPolicy,86,Za(this.query,"(anonymous)"));const a={...zo(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||qa(i,87);const{finalize:l,pushNotification:c}=this.pushOperation(Zc.fetchMore);c({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:u,operator:d}=cu(),{observable:p}=this.queryManager.fetchObservableWithInfo(a,{networkStatus:Zc.fetchMore,exposeExtensions:!0}),h=p.pipe(d,Ca(e=>"N"===e.kind&&"network"===e.source)).subscribe({next:e=>{o=!1;const t=e.value,n=t[ll];if(wl(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&&!Ys(r.result,e.result)){o=!0;const e=this.getCurrentResult();Sl(t.networkStatus)&&c({kind:"N",source:"network",value:{...e,networkStatus:t.networkStatus===Zc.error?Zc.ready:t.networkStatus,loading:!1,data:r.result,dataState:r.complete?"complete":"streaming"}})}}})}else{const e=this.getCurrentResult(),n=i(e.data,{fetchMoreResult:t.data,variables:a.variables});c({kind:"N",value:{...e,networkStatus:Zc.ready,loading:!1,data:n,dataState:"streaming"===e.dataState?"streaming":"complete"},source:"network"})}}});return js(u.then(e=>Hs(this.maskResult(e))).finally(()=>{if(h.unsubscribe(),l(),s&&!o){const e=this.getCurrentResult();"streaming"===e.dataState?c({kind:"N",source:"network",value:{...e,dataState:"complete",networkStatus:Zc.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):qa.error(88,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=zo(this.options,e||{});tu(this.options,t),this.updatePolling()}async setVariables(e){return e=this.getVariablesWithDefaults(e),Ys(this.variables,e)?Hs(this.getCurrentResult()):(this.options.variables=e,this.hasObservers()?this._reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},{newNetworkStatus:Zc.setVariables}):Hs(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 ji(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==Zc.refetch||t==Zc.setVariables;o=o.pipe(r,Oa());const p=o.pipe(_a({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&&(Sl(this.networkStatus)||this.options.skipPollAttempt?.()?a():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:Zc.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,keepLastMissing:r}=t||{};r||(this.lastMissing=void 0),this.queryManager.obsQueries.add(this);const i=n===Zc.refetch||n===Zc.poll,a=this.variables,o=this.options.fetchPolicy,s=zo(this.options,e||{});this.variablesUnknown&&="standby"===s.fetchPolicy;const l=i?s:tu(this.options,s),c=this.transformDocument(l.query);this.lastQuery=c,e&&"variables"in e&&(l.variables=this.getVariablesWithDefaults(e.variables)),i||(this.updatePolling(),!e||!e.variables||Ys(e.variables,a)||"standby"===l.fetchPolicy||l.fetchPolicy!==o&&"function"!=typeof l.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",l),void 0===n&&(n=Zc.setVariables)));const u=this.networkStatus;n||(n=Zc.loading,u!==Zc.loading&&e?.variables&&!Ys(e.variables,a)&&(n=Zc.setVariables),"standby"===l.fetchPolicy&&(n=Zc.ready)),"standby"===l.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:d,operator:p}=cu("standby"===l.fetchPolicy?{data:void 0}:void 0),{subscription:h,observable:f,fromLink:m}=this.fetch(l,n,c,p);i||!m&&this.linkSubscription||(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=h);const g=Object.assign(js(d.then(e=>Hs(this.maskResult(e))).finally(()=>{this.hasObservers()||0!==this.activeOperations.size||this.tearDownQuery()})),{retain:()=>{const e=f.subscribe({}),t=()=>e.unsubscribe();return d.then(t,t),g}});return g}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.lastMissing=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,lastMissing:n}=this,{fetchPolicy:r}=this.options;if(this.resetNotifications(),!t||"cache-only"!==r&&"cache-and-network"!==r&&this.activeOperations.size)return;const i=this.getCacheDiff(),a=this.getCurrentResult();if(Ys(i.result,this.getCacheDiff({optimistic:!1}).result)&&(i.complete||a.networkStatus!==Zc.streaming)){if(i.complete)this.lastMissing=void 0;else if(n&&n.dmCount===au.get(this.cache)&&Ys(n.variables,this.variables)&&Ys(n.missing,i.missing?.missing)){if("cache-only"!==r)return void("partial"===a.dataState&&this.deliverCacheDiff(i))}else this.didWarnOnFeud=!1,this.lastMissing={variables:this.variables,missing:i.missing?.missing,dmCount:au.get(this.cache)};this.reobserveCacheFirst()}else this.deliverCacheDiff(i)}deliverCacheDiff(e){const t=this.getCurrentResult();this.input.next({kind:"N",value:{data:e.result,dataState:e.dataState,networkStatus:t.networkStatus,loading:t.loading,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===Zc.streaming?e:Array.from(this.activeOperations.values()).reverse().find(e=>lu(e,this)&&void 0!==e.override)?.override??e}abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){const e="cache-only"===this.options.fetchPolicy;this.lastMissing=void 0,this.setResult(e?iu:ru,{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=Ws(e=>{const{query:t,meta:n}=e;if("setResult"===e.source)return{query:t,variables:this.variables,result:e.value,meta:n};if("C"===e.kind)return;const r="resolvedVariables"in e?e.resolvedVariables:void 0;if(e.query!==this.query)return;if(!Ys(r,this.variables)){if(!Ys(e.variables,this.variables))return;r&&(this.options.variables=r,this.resubscribeCache())}const i=this.variables;let a;const o=this.subject.getValue();if("cache"===e.source){if(a=e.value,a.networkStatus===Zc.ready&&"partial"===a.dataState&&(!this.options.returnPartialData||o.result.networkStatus===Zc.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===e.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),a="E"===e.kind?{...lu(o,e)||r&&Ys(r,o.variables)?o.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:Zc.error,loading:!1}:e.value,"E"===e.kind&&"streaming"===a.dataState&&(a.dataState=eu.get(e.error)??"complete"),a.error&&(n.shouldEmit=1);else if("newNetworkStatus"===e.source){const t=lu(o,e)?o.result:this.getInitialResult(n.fetchPolicy),{resetError:r}=e.value,i=r?void 0:t.error,s=i?Zc.error:Zc.ready;a={...t,error:i,networkStatus:s}}return qa(a),a.error||delete a.error,a.networkStatus=this.calculateNetworkStatus(a.networkStatus),a.loading=Sl(a.networkStatus),a=this.maskResult(a),void 0!==o.result.data&&a.data!==o.result.data&&Ys(a.data,o.result.data)&&(a.data=o.result.data),{query:t,variables:i,result:a,meta:n}});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}},{keepLastMissing:!0}):this._reobserve(void 0,{keepLastMissing:!0})}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}};function lu(e,t){return!!(e&&t&&e.query===t.query&&Ys(e.variables,t.variables))}function cu(e){let t,n,r=e;return{promise:new Promise((e,r)=>{t=e,n=r}),operator:_a({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 uu={},du=/* @__PURE__ */new WeakMap,pu=class{cache;queryManager;id;observableQuery;incremental;constructor(e,t){this.cache=e.cache;const n=(du.get(e)||0)+1;du.set(e,n),this.id=n+"",this.observableQuery=t,this.queryManager=e}get hasNext(){return!!this.incremental&&this.incremental.hasNext}get incrementalHandler(){return this.queryManager.incrementalHandler}maybeHandleIncrementalResult(e,t,n){return this.incrementalHandler.isIncrementalResult(t)?(this.incremental||=this.incrementalHandler.startRequest({query:n}),this.incremental.handle(e,t)):t}markQueryResult(e,{document:t,variables:n,errorPolicy:r,cacheWriteBehavior:i,returnPartialData:a,fetchPolicy:o,networkStatus:s,prunePendingDeferFragments:l}){const c={query:t,variables:n,optimistic:!0};this.observableQuery?.resetNotifications();const u=0===i,d=u?void 0:this.getDiff({...c,returnPartialData:"none"!==r||!this.incrementalHandler.extractErrors(e)?.length},this.getIncrementalInfo({prune:l})),p=this.maybeHandleIncrementalResult(d?.result,e,t);let h={...p,dataState:null==p.data?"empty":"complete"};return(this.incremental?.getPendingWithInfo?.().some(e=>"defer"===e.type&&!e.delivered)||!this.incremental?.getPendingWithInfo&&this.hasNext&&Wo(["defer"],t))&&(h.dataState="streaming"),u||!hu(h,r)||this.cache.batch({onWatchUpdated:(e,t)=>{e.watcher===this.observableQuery&&(e.lastOwnDiff=t)},update:e=>{e.writeQuery({query:t,data:h.data,variables:n,overwrite:1===i,extensions:h.extensions});const{dataState:r,result:u}=this.getDiff({...c,returnPartialData:a&&("network-only"!==o||s===Zc.refetch)},this.getIncrementalInfo({prune:l}));("complete"===r||"streaming"===r||a&&"partial"===r)&&(h={...h,data:u,dataState:r})}}),h}getIncrementalInfo({prune:e}){const t=this.incremental?.getPendingWithInfo?.()??[],n=this.incremental?.streamInfo,r={streamInfo:n};if(e)for(const i of t)"defer"!==i.type||i.delivered?n&&"stream"===i.type&&(n.lookupArray(i.path).state.truncate=!0):(r.deferInfo||=new io(!0,()=>!0),r.deferInfo.lookupArray(i.path.concat(i.label||[])));return r}getDiff(e,t){return Us(this.cache.diff({...e,[dl]:t}))}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:[]}),Ho(a)&&"none"===t.errorPolicy)return Promise.resolve(a);const o=()=>({...a,dataState:this.hasNext?"streaming":"complete"});if(!i&&hu(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&&Za(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(!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})}n&&!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:uu}):e;return n!==uu&&(this.cache.recordOptimisticTransaction(e=>{try{this.markMutationResult({data:n},t,e)}catch(r){qa.error(r)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:n,errorPolicy:r,cacheWriteBehavior:i}){if(0!==i){if(hu(e,r)){this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:n,extensions:e.extensions});const r=this.cache.diff({query:this.queryManager.getDocumentInfo(t).asQuery,id:"ROOT_SUBSCRIPTION",variables:n,optimistic:!1,returnPartialData:!0});r.complete&&(e.data=r.result)}this.queryManager.broadcastQueries()}}};function hu(e,t="none"){const n="ignore"===t||"all"===t;let r=!Ho(e);return!r&&n&&e.data&&(r=!0),r}var fu=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 gl(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.incrementalHandler.documentTransform&&(this.documentTransform=this.documentTransform.concat(this.incrementalHandler.documentTransform)),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(Ua(93))}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 pu(this);e=this.cache.transformForLink(this.transform(e));const{hasClientExports:h}=this.getDocumentInfo(e);t=this.getVariables(e,t),h&&(t=await this.localState.getExportedVariables({client:this.client,document:e,variables:t,context:d}));const f=this.mutationStore&&(this.mutationStore[p.id]={mutation:e,variables:this.cache.serializeVariables(e,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((h,g)=>{const y={};return this.getObservableFromLink(e,{...d,optimisticResponse:m?n:void 0},t,l,{},!1).observable.pipe(mu(),Na(n=>{const h={...n};return va(p.markMutationResult(h,{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(Sa(e=>{if(Ho(e)&&"none"===c)throw new Wc(yu(e));return f&&(f.loading=!1,f.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})};Ho(t)&&(n.error=new Wc(t)),Object.keys(t.extensions||{}).length&&(n.extensions=t.extensions),h(n)}},error:e=>(f&&(f.loading=!1,f.error=e),m&&this.cache.removeOptimistic(p.id),this.broadcastQueries(),"ignore"===c?h({data:void 0}):"all"===c?h({data:void 0,error:e}):void g(e))})})}fetchQuery(e,t){return vo(e.query,Ht),(async()=>{return n=this.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(Ws(e=>{switch(e.kind){case"E":throw e.error;case"N":if("newNetworkStatus"!==e.source)return Hs(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 go(Xa["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const n=To(e),r={hasClientExports:Wo(["client","export"],e,!0),hasForcedResolvers:Go(e),hasNonreactiveDirective:Wo(["nonreactive"],e),hasIncrementalDirective:Wo(["defer"],e),nonReactiveQuery:gu(e),clientQuery:Wo(["client"],e)?e:null,serverQuery:Fs([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:n?.operation,defaultVars:Mo(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){vo(e.query,Ht);const t=this.transform(e.query);return void 0===(e={...e,variables:this.getVariables(t,e.variables)}).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!0),new su({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(Ua(95)),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(Ao(t=e)&&"Document"===t.kind&&Array.isArray(t.definitions)){const t=yl(this.transform(e));n.set(t,Za(e)),r.set(t,!1)}else Ao(e)&&e.query&&i.add(e);var t}),this.obsQueries.forEach(n=>{const i=yl(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 su({queryManager:this,options:{...Ls(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;vo(t,Gt),t=this.transform(t),n=this.getVariables(t,n);const l=(this.getDocumentInfo(t).hasClientExports?va(this.localState.getExportedVariables({client:this.client,document:t,variables:n,context:a})):xa(n)).pipe(Na(e=>{const{observable:n,restart:l}=this.getObservableFromLink(t,a,e,r,o),c=new pu(this);return s=l,n.pipe(Sa(n=>{c.markSubscriptionResult(n,{document:t,variables:e,errorPolicy:i,cacheWriteBehavior:"no-cache"===r?0:2});const a={data:n.data??void 0};return Ho(n)?a.error=new Wc(n):Yc(n)&&(a.error=n.extensions[Qc],delete n.extensions[Qc]),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}),Ea(e=>xa("ignore"===i?{data:void 0}:{data:void 0,error:e})),Ca(e=>!(!e.data&&!e.error)))}));return Object.assign(l,{restart:()=>s?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new io(!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=Za(e),p={client:this.client};if(n=this.cache.serializeVariables(e,n),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 ji(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=yl(s),x=Fo(n);o=m.lookup(v,x),o.observable||(o.observable=Tl(g,y,p).pipe(b,(h=()=>{m.peek(v,x)===o&&m.remove(v,x)},$i(function(e,t){try{e.subscribe(t)}finally{t.add(h)}})),c===Gt?Oa():Aa({refCount:!0})))}else o.observable=Tl(g,y,p).pipe(b)}catch(f){o.observable=ka(()=>f)}}else o.observable=xa({data:{}});var h;if(l){const{operation:k}=To(e);qa(!u,100,k[0].toUpperCase()+k.slice(1),d??"(anonymous)"),o.observable=o.observable.pipe(Na(e=>va(this.localState.execute({client:this.client,document:l,remoteResult:e,context:t,variables:n,fetchPolicy:r}))))}return{restart:()=>o.restart?.(),observable:o.observable.pipe(Ea(e=>{throw function(e){Gc.add(e)}(e=Xc(e)),e}))}}getResultsFromLink(e,{queryInfo:t,cacheWriteBehavior:n,observableQuery:r,exposeExtensions:i,prunePendingDeferFragments:a}){const{errorPolicy:o}=e,s=this.cache.transformForLink(e.query);return this.getObservableFromLink(s,e.context,e.variables,e.fetchPolicy).observable.pipe(Sa(l=>{const{dataState:c,...u}=t.markQueryResult(l,{...e,document:s,cacheWriteBehavior:n,returnPartialData:e.returnPartialData,prunePendingDeferFragments:a}),d=Ho(u);if(d&&"none"===o){r?.resetNotifications();const e=new Wc(yu(u));throw eu.set(e,c),e}const p="complete"!==c,h={data:u.data,...t.hasNext?{loading:!0,networkStatus:Zc.streaming,dataState:c,partial:p}:{dataState:c,loading:!1,networkStatus:Zc.ready,partial:p}};return i&&"extensions"in u&&(h[ll]=u.extensions),d&&"ignore"!==o&&(h.error=new Wc(yu(u)),h.networkStatus!==Zc.streaming&&(h.networkStatus=Zc.error)),h}),Ea(e=>{if("none"===o)throw r?.resetNotifications(),e;const t={data:void 0,dataState:"empty",loading:!1,networkStatus:Zc.ready,partial:!0};return"ignore"!==o&&(t.error=e,t.networkStatus=Zc.error),xa(t)}))}fetchObservableWithInfo(e,{networkStatus:t=Zc.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 h=Object.assign({},e,{query:n,variables:s,fetchPolicy:l,errorPolicy:c,returnPartialData:u,networkStatus:t,notifyOnNetworkStatusChange:d,context:p}),f=new pu(this,a),m=n=>{h.variables=n;const s="no-cache"===l?0:t===Zc.refetch&&"merge"!==h.refetchWritePolicy?1:2,c=this.fetchQueryByPolicy(h,{queryInfo:f,cacheWriteBehavior:s,onCacheHit:i,observableQuery:a,exposeExtensions:o});return c.observable=c.observable.pipe(r),"standby"!==h.fetchPolicy&&a?.applyNextFetchPolicy("after-fetch",e),c},g=()=>{this.fetchCancelFns.delete(f.id)};this.fetchCancelFns.set(f.id,e=>{y.next({kind:"E",error:e,source:"network"})});const y=new Ui;let b,v;if(this.getDocumentInfo(h.query).hasClientExports)b=va(this.localState.getExportedVariables({client:this.client,document:h.query,variables:h.variables,context:h.context})).pipe(Na(e=>m(e).observable)),v=!0;else{const e=m(h.variables);v=e.fromLink,b=e.observable}return{observable:new ji(e=>{e.add(g),b.subscribe(e),y.subscribe(e)}).pipe(Oa()),fromLink:v}}refetchQueries({updateCache:e,include:t,optimistic:n=!1,removeOptimistic:r=(n?La("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 su&&!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=To(t);return qa(r,45),null==e?e:ec(e,r.selectionSet,{operationType:r.operation,operationName:r.name?.value,fragmentMap:ko(wo(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===on);void 0===r&&(qa(1===i.length,43,i.length),r=i[0].name.value);const a=i.find(e=>e.name.value===r);return qa(!!a,44,r),null==e||Ys(e,{})?e:ec(e,a.selectionSet,{operationType:"fragment",operationName:a.name.value,fragmentMap:ko(wo(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,networkStatus:o},{cacheWriteBehavior:s,onCacheHit:l,queryInfo:c,observableQuery:u,exposeExtensions:d}){const p=()=>c.getDiff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),h=(o,s)=>{const c=o.result,u=(e,t=o.dataState)=>(o.complete||i||(e=void 0,t="empty"),{data:e,dataState:t,loading:Sl(s),networkStatus:s,partial:!o.complete}),d=e=>xa({kind:"N",value:u(e),resolvedVariables:t,source:"cache"});return(o.complete||i)&&this.getDocumentInfo(e).hasForcedResolvers?(l(),va(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,o.complete?"complete":e.data?"partial":"empty"),resolvedVariables:t,source:"cache"})))):"none"===r&&s===Zc.refetch&&o.missing?d(void 0):d(c||void 0)},f=({prunePendingDeferFragments:l=!0}={})=>this.getResultsFromLink({query:e,variables:t,context:a,fetchPolicy:n,errorPolicy:r,returnPartialData:i,networkStatus:o},{cacheWriteBehavior:s,queryInfo:c,observableQuery:u,exposeExtensions:d,prunePendingDeferFragments:l}).pipe(mu(),$i(function(e,t){e.subscribe(Vi(t,function(e){t.next(wa.createNext(e))},function(){t.next(wa.createComplete()),t.complete()},function(e){t.next(wa.createError(e)),t.complete()}))}),Sa(e=>({...e,resolvedVariables:t,source:"network"})));switch(n){default:case"cache-first":{const e=p();return e.complete?{fromLink:!1,observable:h(e,Zc.ready)}:i?{fromLink:!0,observable:Ta(h(e,Zc.loading),f())}:{fromLink:!0,observable:f()}}case"cache-and-network":{const e=p();return e.complete||i?{fromLink:!0,observable:Ta(h(e,Zc.loading),f({prunePendingDeferFragments:!1}))}:{fromLink:!0,observable:f()}}case"cache-only":return{fromLink:!1,observable:Ta(h(p(),Zc.ready))};case"network-only":return{fromLink:!0,observable:f({prunePendingDeferFragments:o!==Zc.refetch})};case"no-cache":return{fromLink:!0,observable:f().pipe(Sa(t=>("N"===t.kind&&null!=t.value.data&&this.cache.configuresScalars()&&(t.value.data=function(e,t,n){const r=To(t)?.operation,i=ko(wo(t));function a(e,t,n,r){let i=!1;const a=t.map(t=>{const a=o(e,t,n,r);return i||=a!==t,a});return i?a:t}function o(e,t,r,i){if(Array.isArray(t)&&!i)return a(e,t,r,i);if(e.selectionSet)return s(e.selectionSet,t);if(null===t||!r)return t;if(i){const o=Eo(i);if(o&&Array.isArray(t))return a(e,t,r,o[1]);const s=n.getScalar(Oo(i));if(s)return s.coerceToParsed(t)}return t}function s(e,t,r){if(null===t||"object"!=typeof t)return t;const a={...t};let s=!1;Object.hasOwn(t,"__typename")&&(r=t.__typename);const l=new Set(e.selections);return l.forEach(e=>{if(Co(e)){const i=Io(e);if(!Object.hasOwn(t,i))return;const l=t[i],c=o(e,l,r,r?n.getScalarTypeForField(r,e.name.value):void 0);s||=c!==l,a[i]=c}else{const t=So(e,i);t&&r&&n.fragmentMatches(t,r)&&t.selectionSet.selections.forEach(e=>l.add(e))}}),s?a:t}return qa(r,6),s(No(t).selectionSet,e,n.getRootTypename(r))}(t.value.data,e,this.cache)),t)))};case"standby":return{fromLink:!1,observable:ea}}}};function mu(){let e=!1;return _a({next(){e=!0},complete(){qa(e,104)}})}function gu(e){return ir(e,{FragmentSpread:e=>{if(!e.directives?.some(e=>"unmask"===e.name.value))return{...e,directives:[...e.directives||[],{kind:yn,name:{kind:Kt,value:"nonreactive"}}]}}})}function yu(e){if(null==e.extensions?.[cl])return e;const{extensions:{[cl]:t,...n},...r}=e;return Object.keys(n).length>0&&(r.extensions=n),r}var bu=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:h=new hl,experiments:f=[],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=Ra,this.queryManager=new fu({client:this,defaultOptions:this.defaultOptions,defaultContext:s,documentTransform:n,queryDeduplication:a,ssrMode:r,dataMasking:!!d,clientOptions:e,incrementalHandler:h,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(),f.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=Ls(this.defaultOptions.watchQuery,e),r&&(e.refetchOn=r)}return this.queryManager.watchQuery(e)}query=e=>(this.defaultOptions.query&&(e=Ls(this.defaultOptions.query,e)),this.queryManager.query(e));mutate=e=>{const t=Ls(zo({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return vo(t.mutation,Wt),this.queryManager.mutate(t)};subscribe(e){const t={},n=this.queryManager.startGraphQLSubscription(e),r=n.pipe(Sa(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 Tl(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 gl(qs);transform(e,t=!1){const n=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(n):n}},{hasOwnProperty:vu}=Object.prototype;function xu(e){return Ao(e)&&"payload"in e}function ku(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 wu(e,t){if(e.status>=300)throw new Jc(`Response not successful: Received status code ${e.status}`,{response:e,bodyText:t});try{return JSON.parse(t)}catch(n){throw new Kc(n,{response:e,bodyText:t})}}var Su={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"}},Nu=(e,t)=>t(e);function Tu(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,yl)),{options:r,body:c}}var Cu=Da(()=>fetch);function Eu(){}var Iu=class extends Nl{constructor(e={}){let{uri:t="/graphql",fetch:n,print:r=Nu,includeExtensions:i,preserveHeaderCase:a,useGETForQueries:o,includeUnusedVariables:s=!1,...l}=e;const c={http:zo({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 kl(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}=Tu(e,r,Su,c,u);p.variables&&!s&&(p.variables=function(e,t){const n={...e},r=new Set(Object.keys(e));return ir(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 h=new AbortController,f=()=>{h=void 0};if(d.signal){const e=d.signal,t=()=>{h?.abort(e.reason)};e.addEventListener("abort",t,{once:!0}),f=()=>{h?.signal.removeEventListener("abort",f),h=void 0,e.removeEventListener("abort",t),f=Eu},h.signal.addEventListener("abort",f,{once:!0})}return d.signal=h.signal,o&&!function(e){return kl(e,"mutation")}(e.query)&&(d.method="GET"),new ji(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||Da(()=>fetch)||Cu,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="";qa(e.body&&"function"==typeof e.body.getReader,64);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,{stream:!s}),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=ku(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=wu(e,n);if(0!=Object.keys(r).length)if(xu(r)){if(1===Object.keys(r).length&&null===r.payload)return;let e={...r.payload};"errors"in r&&(e.extensions={...e.extensions,[Qc]:new Bc(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 Kc(n,{response:e,bodyText:t})}}(e,t):wu(e,t)}(e,t);if(!Array.isArray(n)&&!vu.call(n,"data")&&!vu.call(n,"errors"))throw new Jc(`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(()=>{f(),t.complete()}).catch(e=>{f(),t.error(e)}),()=>{h&&h.abort()}})})}},Ou=class extends Nl{constructor(e={}){super((t,n)=>{const r=t.client,i=r.queryManager.clientOptions,a=t.getContext();{const{name:n,version:r,transport:o="headers"}=zo({},i.clientAwareness,e.clientAwareness,a.clientAwareness);"headers"===o&&t.setContext(({headers:e})=>({headers:zo({"apollographql-client-name":n,"apollographql-client-version":r},e)}))}{const{transport:n="extensions"}=zo({},i.enhancedClientAwareness,e.enhancedClientAwareness);"extensions"===n&&(t.extensions=zo({clientLibrary:{name:"@apollo/client",version:r.version}},t.extensions)),"headers"===n&&t.setContext(({headers:e})=>({headers:zo({"apollographql-library-name":"@apollo/client","apollographql-library-version":r.version},e)}))}return n(t)})}},zu=class extends Nl{constructor(e={}){const{left:t,right:n,request:r}=Nl.from([new Ou(e),new Iu(e)]);super(r),Object.assign(this,{left:t,right:n})}},Au=/* @__PURE__ */new Map,_u=/* @__PURE__ */new Map,Du=!1;function Pu(e){return e.replace(/[\s,]+/g," ").trim()}function Ru(e){var t,n,r,i=Pu(e);if(!Au.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 yr)if(e[n].hasSubscribers)return!0;return!1}(gr)?gr.traceSync(()=>ii(e,t),{source:e}):ii(e,t)}(e,{experimentalFragmentVariables:Du,allowLegacyFragmentVariables:Du,experimentalFragmentArguments:Du});if(!a||"Document"!==a.kind)throw new Error("Not a valid GraphQL document.");Au.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=Pu((o=e.loc).source.body.substring(o.start,o.end)),a=_u.get(t);a&&!a.has(i)||a||_u.set(t,a=/* @__PURE__ */new Set),a.add(i),n.has(i)||(n.add(i),r.push(e))}else r.push(e);var o}),ui(ui({},t),{definitions:r}))))}return Au.get(i)}function Mu(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]}),Ru(r)}var Lu,ju=Mu;(Lu=Mu||(Mu={})).gql=ju,Lu.resetCaches=function(){Au.clear(),_u.clear()},Lu.disableFragmentWarnings=function(){},Lu.enableExperimentalFragmentVariables=function(){Du=!0},Lu.disableExperimentalFragmentVariables=function(){Du=!1},Mu.default=Mu;var Fu=class extends Nl{constructor(e){super((t,n)=>new ji(r=>{let i,a,o;try{i=n(t).subscribe({next:i=>{const s=t.client.queryManager.incrementalHandler,l=s.isIncrementalResult(i)?s.extractErrors(i):i.errors;l?o=e({error:new Wc(i,l),result:i,operation:t,forward:n}):Yc(i)&&(o=e({error:i.extensions[Qc],result:i,operation:t,forward:n})),a=o?.subscribe(r),a||r.next(i)},error:i=>{o=e({operation:t,error:Xc(i),forward:n}),a=o?.subscribe(r),a||r.error(i)},complete:()=>{o||r.complete()}})}catch(tR){e({error:Xc(tR),operation:t,forward:n}),r.error(tR)}return()=>{i&&i.unsubscribe(),a&&a.unsubscribe()}}))}},$u=e=>new Fu(({error:t})=>{if(!Jc.is(t))return;let n=It(t.statusCode,(e=>{try{return JSON.parse(e)}catch{return}})(t.bodyText));n&&Ct({reason:n,url:e})}),Vu=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>`},qu=/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,Bu=e=>e?.replace(qu,Vu)??e,Uu=(e,t=!1)=>{let{field:n,value:r}=e;return t?{[n]:{$not:{$regex:r,$options:"i"}}}:{[n]:{$regex:r,$options:"i"}}},Hu=(e,t=!1)=>{let{field:n,value:r}=e;return t?{[n]:{$not:{$regex:`^${r}`,$options:"i"}}}:{[n]:{$regex:`^${r}`,$options:"i"}}},Wu=(e,t=!1)=>{let{field:n,value:r}=e;return t?{[n]:{$not:{$regex:`${r}$`,$options:"i"}}}:{[n]:{$regex:`${r}$`,$options:"i"}}},Gu=(e,t=!1)=>{let{field:n}=e;return t?{[n]:{$ne:""}}:{[n]:""}},Ju=(e,t=!1)=>{let{field:n,value:r}=e,i=[];return"string"==typeof r&&r.includes(",")?i=r.split(",").map(e=>e.trim()):("string"==typeof r||"number"==typeof r)&&(i=[r]),t?{[n]:{$nin:i}}:{[n]:{$in:i}}};function Ku(e,t=!1,n={}){if(!e)return{};let{combinator:r,rules:i,enabled:a}=e;if(!Array.isArray(i)||!1===a)return{};let o=i.filter(e=>!1!==e.enabled).map(e=>"rules"in e?Ku(e,t,n):((e,t)=>{if(!e)return{};let{isBinding:n}=e;n&&(e=((e,t)=>{let{isBinding:n}=e;return n?{...e,value:$(t,e.value,e.value)}:e})(e,t));let{operator:r}=e;switch(r){case"=":case"!=":case"<":case">":case"<=":case">=":return(e=>{let{field:t,operator:n,value:r}=e;switch(n){case"=":return{[t]:r};case"!=":return{[t]:{$ne:r}};case"<":return"string"==typeof r&&Q(r)?{[t]:{$lt:parseFloat(r)}}:{[t]:{$lt:r}};case">":return"string"==typeof r&&Q(r)?{[t]:{$gt:parseFloat(r)}}:{[t]:{$gt:r}};case"<=":return"string"==typeof r&&Q(r)?{[t]:{$lte:parseFloat(r)}}:{[t]:{$lte:r}};case">=":return"string"==typeof r&&Q(r)?{[t]:{$gte:parseFloat(r)}}:{[t]:{$gte:r}};default:return{}}})(e);case"contains":return Uu(e);case"doesNotContain":return Uu(e,!0);case"beginsWith":return Hu(e);case"doesNotBeginWith":return Hu(e,!0);case"endsWith":return Wu(e);case"doesNotEndWith":return Wu(e,!0);case"empty":return Gu(e);case"notEmpty":return Gu(e,!0);case"in":return Ju(e);case"notIn":return Ju(e,!0);case"between":return(e=>{let{field:t,value:n}=e,r=[];return"string"==typeof n&&n.includes(",")&&(r=n.split(",").map(e=>e.trim())),r.length<2?{[t]:!1}:S(r[0])&&S(r[1])?{[t]:{$gte:new Date(r[0]),$lte:new Date(r[1])}}:{[t]:{$gte:r[0],$lte:r[1]}}})(e);default:return{}}})(e,n));return t?o:o.length?1===o.length?o[0]:{[`$${r}`]:o}:{}}var Qu=(e,t=!1)=>{let{field:n,value:r}=e;return`${n}${t?" not":""} like '%${r}%'`},Yu=(e,t=!1)=>{let{field:n,value:r}=e;return`${n}${t?" not":""} like '${r}%'`},Xu=(e,t=!1)=>{let{field:n,value:r}=e;return`${n}${t?" not":""} like '%${r}'`},Zu=(e,t=!1)=>{let{field:n}=e;return`${n} is${t?" not":""} NULL`},ed=(e,t=!1)=>{let{field:n,value:r}=e,i=[];return"string"==typeof r&&r.includes(",")?i=r.split(","):("string"==typeof r||"number"==typeof r)&&(i=[r.toString()]),0!==i.length&&`${n}${t?" not":""} in (${i.map(e=>`'${e.trim()}'`).join(", ")})`},td=(e,t=!1)=>{let{field:n,value:r}=e,i=[];return"string"==typeof r&&(i=r.split(",").map(e=>e.trim())),!(i.length<2)&&(S(i[0])&&S(i[1])?`${n}${t?" not":""} between DATE '${i[0]}' and '${i[1]}'`:`${n}${t?" not":""} between '${i[0]}' and '${i[1]}'`)};function nd(e,t=!0,n={}){if(!e)return"";let{combinator:r,rules:i,enabled:a}=e;if(!Array.isArray(i)||!1===a)return"";let o=i.filter(e=>!1!==e.enabled).map(e=>"rules"in e?`(${t?nd(e,t,n).toString():nd(e,t,n)})`:((e,t)=>{if(!e)return{};let{isBinding:n}=e;n&&(e=((e,t)=>e.isBinding?{...e,value:$(t,e.value,e.value)}:e)(e,t));let{operator:r}=e;switch(r){case"=":case"!=":case"<":case">":case"<=":case">=":return(e=>{let{field:t,value:n,operator:r}=e;return"boolean"==typeof n?`${t} ${r} ${n?"TRUE":"FALSE"}`:"string"!=typeof n||Q(n)?"number"==typeof n||Q(n)?`${t} ${r} ${n}`:S(n)?`${t} ${r} DATE '${n.toString()}'`:`${t} ${r} '${JSON.stringify(n)}'`:`${t} ${r} '${n}'`})(e);case"contains":return Qu(e);case"doesNotContain":return!Qu(e,!0);case"beginsWith":return Yu(e);case"doesNotBeginWith":return Yu(e,!0);case"endsWith":return Xu(e);case"doesNotEndWith":return Xu(e,!0);case"empty":return Zu(e);case"notEmpty":return Zu(e,!0);case"in":return ed(e);case"notIn":return ed(e,!0);case"between":return td(e);case"notBetween":return td(e,!0);default:return!1}})(e,n));return t?o:o.join(` ${r} `)}function rd(e){if(Array.isArray(e)){let t=!1,n=e.map(e=>{let n=rd(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=rd(i);a!==i&&(n=!0),t[r]=a}return n?t:e}return e}var id=se({theme:{components:{}},colorMode:"light",toggleColorMode:()=>{},setColorMode:()=>{}});id.displayName="ThemeContext";var ad=(e,t)=>Object.getOwnPropertyDescriptor(e,t)?.enumerable,od=(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(!od(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(!od(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||ad(e,a)||!i.includes(a);if(!od(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},sd=od,ld=(e,t="soft",n={})=>{let r=ke(e);return sd(r.current,e,t,n)?r.current:(r.current=e,e)},cd=(e=/* @__PURE__ */new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ud="-",dd=[],pd=e=>{const t=md(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return fd(e);const n=e.split(ud),r=""===n[0]&&n.length>1?1:0;return hd(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||dd}return n[e]||dd}}},hd=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],i=n.nextPart.get(r);if(i){const n=hd(e,t+1,i);if(n)return n}const a=n.validators;if(null===a)return;const o=0===t?e.join(ud):e.slice(t).join(ud),s=a.length;for(let l=0;l<s;l++){const e=a[l];if(e.validator(o))return e.classGroupId}},fd=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})(),md=e=>{const{theme:t,classGroups:n}=e;return gd(n,t)},gd=(e,t)=>{const n=cd();for(const r in e){const i=e[r];yd(i,n,r,t)}return n},yd=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const i=e[a];bd(i,t,n,r)}},bd=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?kd(e,t,n,r):xd(e,t,n,r):vd(e,t,n)},vd=(e,t,n)=>{(""===e?t:wd(t,e)).classGroupId=n},xd=(e,t,n,r)=>{Sd(e)?yd(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},kd=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[e,a]=i[o];yd(a,wd(t,e),n,r)}},wd=(e,t)=>{let n=e;const r=t.split(ud),i=r.length;for(let a=0;a<i;a++){const e=r[a];let t=n.nextPart.get(e);t||(t=cd(),n.nextPart.set(e,t)),n=t}return n},Sd=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Nd=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)}}},Td=[],Cd=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ed=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),Cd(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)):Cd(Td,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Id=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}},Od=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},zd=/\s+/,Ad=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ad(e[r]))&&(n&&(n+=" "),n+=t);return n},_d=(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(zd);let c="";for(let u=l.length-1;u>=0;u-=1){const e=l[u],{isExternal:t,modifiers:d,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:f}=n(e);if(t){c=e+(c.length>0?" "+c:c);continue}let m,g=!!f;if(g){m=r(h.substring(0,f));const e=m&&o[m]?r(h):void 0;e&&e!==m&&(m=e,g=!1)}else m=r(h);if(!m){if(!g){c=e+(c.length>0?" "+c:c);continue}if(m=r(h),!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:Nd(e.cacheSize),parseClassName:Ed(e),sortModifiers:Id(e),postfixLookupClassGroupIds:Od(e),...pd(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=Ad(t))&&(i&&(i+=" "),i+=n);return i})(...e))},Dd=[],Pd=e=>{const t=t=>t[e]||Dd;return t.isThemeGetter=!0,t},Rd=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Md=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ld=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fd=/\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$/,$d=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bd=e=>Ld.test(e),Ud=e=>!!e&&!Number.isNaN(Number(e)),Hd=e=>!!e&&Number.isInteger(Number(e)),Wd=e=>e.endsWith("%")&&Ud(e.slice(0,-1)),Gd=e=>jd.test(e),Jd=()=>!0,Kd=e=>Fd.test(e)&&!$d.test(e),Qd=()=>!1,Yd=e=>Vd.test(e),Xd=e=>qd.test(e),Zd=e=>!np(e)&&!up(e),ep=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)),tp=e=>bp(e,wp,Qd),np=e=>Rd.test(e),rp=e=>bp(e,Sp,Kd),ip=e=>bp(e,Np,Ud),ap=e=>bp(e,Cp,Jd),op=e=>bp(e,Tp,Qd),sp=e=>bp(e,xp,Qd),lp=e=>bp(e,kp,Xd),cp=e=>bp(e,Ep,Yd),up=e=>Md.test(e),dp=e=>vp(e,Sp),pp=e=>vp(e,Tp),hp=e=>vp(e,xp),fp=e=>vp(e,wp),mp=e=>vp(e,kp),gp=e=>vp(e,Ep,!0),yp=e=>vp(e,Cp,!0),bp=(e,t,n)=>{const r=Rd.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},vp=(e,t,n=!1)=>{const r=Md.exec(e);return!!r&&(r[1]?t(r[1]):n)},xp=e=>"position"===e||"percentage"===e,kp=e=>"image"===e||"url"===e,wp=e=>"length"===e||"size"===e||"bg-size"===e,Sp=e=>"length"===e,Np=e=>"number"===e,Tp=e=>"family-name"===e,Cp=e=>"number"===e||"weight"===e,Ep=e=>"shadow"===e,Ip=/*#__PURE__*/_d(()=>{const e=Pd("color"),t=Pd("font"),n=Pd("text"),r=Pd("font-weight"),i=Pd("tracking"),a=Pd("leading"),o=Pd("breakpoint"),s=Pd("container"),l=Pd("spacing"),c=Pd("radius"),u=Pd("shadow"),d=Pd("inset-shadow"),p=Pd("text-shadow"),h=Pd("drop-shadow"),f=Pd("blur"),m=Pd("perspective"),g=Pd("aspect"),y=Pd("ease"),b=Pd("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",up,np],x=()=>[up,np,l],k=()=>[Bd,"full","auto",...x()],w=()=>[Hd,"none","subgrid",up,np],S=()=>["auto",{span:["full",Hd,up,np]},Hd,up,np],N=()=>[Hd,"auto",up,np],T=()=>["auto","min","max","fr",up,np],C=()=>["auto",...x()],E=()=>[Bd,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],I=()=>[Bd,"screen","full","dvw","lvw","svw","min","max","fit",...x()],O=()=>[Bd,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],z=()=>[e,up,np],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",hp,sp,{position:[up,np]}],_=()=>["auto","cover","contain",fp,tp,{size:[up,np]}],D=()=>[Wd,dp,rp],P=()=>["","none","full",c,up,np],R=()=>["",Ud,dp,rp],M=()=>[Ud,Wd,hp,sp],L=()=>["","none",f,up,np],j=()=>["none",Ud,up,np],F=()=>["none",Ud,up,np],$=()=>[Ud,up,np],V=()=>[Bd,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gd],breakpoint:[Gd],color:[Jd],container:[Gd],"drop-shadow":[Gd],ease:["in","out","in-out"],font:[Zd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gd],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gd],shadow:[Gd],spacing:["px",Ud],text:[Gd],"text-shadow":[Gd],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Bd,np,up,g]}],container:["container"],"container-type":[{"@container":["","normal","size",up,np]}],"container-named":[ep],columns:[{columns:[Ud,np,up,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:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{"inset-s":k(),start:k()}],end:[{"inset-e":k(),end:k()}],"inset-bs":[{"inset-bs":k()}],"inset-be":[{"inset-be":k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Hd,"auto",up,np]}],basis:[{basis:[Bd,"full","auto",s,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ud,Bd,"auto","initial","none",np]}],grow:[{grow:["",Ud,up,np]}],shrink:[{shrink:["",Ud,up,np]}],order:[{order:[Hd,"first","last","none",up,np]}],"grid-cols":[{"grid-cols":w()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":w()}],"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":T()}],"auto-rows":[{"auto-rows":T()}],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:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"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",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...O()]}],"min-block-size":[{"min-block":["auto",...O()]}],"max-block-size":[{"max-block":["none",...O()]}],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,dp,rp]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,yp,ap]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Wd,np]}],"font-family":[{font:[pp,op,t]}],"font-features":[{"font-features":[np]}],"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,up,np]}],"line-clamp":[{"line-clamp":[Ud,"none",up,ip]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":["none",up,np]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",up,np]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Ud,"from-font","auto",up,rp]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Ud,"auto",up,np]}],"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:[Hd,up,np]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",up,np]}],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",up,np]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hd,up,np],radial:["",up,np],conic:[Hd,up,np]},mp,lp]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":R()}],"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:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Ud,up,np]}],"outline-w":[{outline:["",Ud,dp,rp]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,gp,cp]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,gp,cp]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Ud,rp]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",p,gp,cp]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Ud,up,np]}],"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":[Ud]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[up,np]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":[Ud]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",up,np]}],filter:[{filter:["","none",up,np]}],blur:[{blur:L()}],brightness:[{brightness:[Ud,up,np]}],contrast:[{contrast:[Ud,up,np]}],"drop-shadow":[{"drop-shadow":["","none",h,gp,cp]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Ud,up,np]}],"hue-rotate":[{"hue-rotate":[Ud,up,np]}],invert:[{invert:["",Ud,up,np]}],saturate:[{saturate:[Ud,up,np]}],sepia:[{sepia:["",Ud,up,np]}],"backdrop-filter":[{"backdrop-filter":["","none",up,np]}],"backdrop-blur":[{"backdrop-blur":L()}],"backdrop-brightness":[{"backdrop-brightness":[Ud,up,np]}],"backdrop-contrast":[{"backdrop-contrast":[Ud,up,np]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ud,up,np]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ud,up,np]}],"backdrop-invert":[{"backdrop-invert":["",Ud,up,np]}],"backdrop-opacity":[{"backdrop-opacity":[Ud,up,np]}],"backdrop-saturate":[{"backdrop-saturate":[Ud,up,np]}],"backdrop-sepia":[{"backdrop-sepia":["",Ud,up,np]}],"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",up,np]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ud,"initial",up,np]}],ease:[{ease:["linear","initial",y,up,np]}],delay:[{delay:[Ud,up,np]}],animate:[{animate:["none",b,up,np]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,up,np]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:j()}],"rotate-x":[{"rotate-x":j()}],"rotate-y":[{"rotate-y":j()}],"rotate-z":[{"rotate-z":j()}],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:[up,np,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":["translate-none"],zoom:[{zoom:[Hd,up,np]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",up,np]}],"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":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"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",up,np]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Ud,dp,rp,ip]}],stroke:[{stroke:["none",...z()]}],"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"]}}),Op=function(e,{componentKey:t,className:n,variants:r}){let{theme:i}=pe(id);e=ld(e);let a=ld(n),o=he((t,n={},r="")=>(n={...n,className:r},"string"==typeof e?$(i.components[e],t,void 0)?.(n)??r:e.map(e=>$(i.components[e],t,void 0)?.(n)).filter(Boolean).join(" ")||r),[i.components,e]);return t=ve(()=>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]),ve(()=>{if(t&&"string"==typeof t)return Ip(o(t,r,a&&"object"==typeof a?$(a,t,""):a));if(t&&Array.isArray(t)){let e={};return t.forEach((t,n)=>{let i;"object"==typeof a?i=$(a,t):"string"==typeof a&&0===n&&(i=a);let s=Ip(o(t,r,i));t.split(".").length>1?b(e,t.split(".").slice(1).join("."),s):b(e,t,s)}),e}return""},[t,a,o,r])},zp=({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,...h})=>(t=Op("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__ */Ee("div",{...h,"data-testid":r,className:t,ref:e,children:n})),Ap=(e,t,n="primary")=>e?"disabled":t&&"primary"===n?"primaryActive":t&&"secondary"===n?"secondaryActive":t&&"tertiary"===n?"tertiaryActive":n,_p=({className:e,children:t,icon:n,active:r=!1,disabled:i=!1,testId:a,intent:o,size:s,cursor:l,title:c,...u})=>{let d=Op("Icon",{className:e,componentKey:"root",variants:{intent:Ap(i,r,o),size:s,cursor:i?"disabled":l}}),{iconChildren:p}=ve(()=>{let e={iconChildren:void 0};return ie.forEach(t,t=>{ue(t)&&(e.iconChildren=oe(t,{...u,className:vt({"h-[1em] w-[1em]":"custom"!==s},d,t.props.className),title:c}))}),e},[t,d,u,s,c]);return p||/* @__PURE__ */Ee("i",{...u,title:c,"data-testid":a,className:vt(n,d)})},Dp=({ref:e,children:t,testId:n,className:r="",iconPlacement:i="none",loading:a=!1,disabled:o=!1,type:s="button",size:l,intent:c,border:u,justify:d,items:p,aspect:h,...f})=>{let m=Op("Button",{className:r,componentKey:["root","icon"],variants:{intent:c,size:l,border:u,justify:d,items:p,disabled:o,aspect:h}}),{iconChildren:g,contentChildren:y}=ve(()=>{let e={iconChildren:void 0,contentChildren:void 0};return ie.forEach(t,t=>{if("string"!=typeof t){if(ue(t))if(t.type===_p){let r=t.props;e.iconChildren=oe(t,{className:vt(m.icon,r.className),size:l,testId:n?`${n}-icon`:void 0,...r,intent:r.intent??"custom"})}else if("i"===t.type){let r=t.props;e.iconChildren=oe(t,{className:vt(m.icon,r.className),size:l,"data-testid":n?`${n}-icon`:void 0,...r,intent:r.intent??"custom"})}else e.contentChildren=t}else e.contentChildren=t}),e},[t,m.icon,l,n]);/* @__PURE__ */
|
|
3
|
+
/* @__PURE__ */new Set([this.data.group,this.optimisticData.group]).forEach(e=>e.resetCaching())}getRootTypename(e){return this.policies.rootTypenamesById[`ROOT_${e.toUpperCase()}`]}getScalar(e){return this.config.scalars?.[e]}getScalarTypeForField(e,t){return this.policies.getScalarTypeForField(e,t)}configuresScalars(){return!!this.config.scalars}serializeVariables(e,t){if(!t||0===Object.keys(t).length||!this.config.scalars&&!this.config.inputObjects)return t;const n=To(e)?.variableDefinitions?.reduce((e,t)=>(e[t.variable.name.value]=$l(t.type),e),{});return n&&0!==Object.keys(n).length?this.serializeVariablesValue(t,n):t}serializeVariablesValue(e,t,n,r){if(null==e)return e;if(n){const i=Eo(n);if(i&&Array.isArray(e))return this.serializeInputArray(e,t,i[1],r);const a=this.getScalar(Oo(n));if(a)return a.coerceToSerialized(e)}return Array.isArray(e)?this.serializeInputArray(e,t,void 0,r):Yo(e)?this.serializeInputObject(e,t,r):e}serializeInputArray(e,t,n,r){let i=!1;const a=e.map(e=>{const a=this.serializeVariablesValue(e,t,n,r);return i||=a!==e,a});return i?a:e}serializeInputObject(e,t,n){let r=!1;const i=Object.entries(e).map(([e,i])=>{const a=t[e],o=n?`${n}.${e}`:e;if(!a)return[e,i];const s=this.config.inputObjects?.[Oo(a)];if(s){const t=this.serializeVariablesValue(i,s.fields,void 0,o);return r||=t!==i,[e,t]}const l=this.serializeVariablesValue(i,t,a,o);return r||=l!==i,[e,l]});return r?Object.fromEntries(i):e}restore(e){return this.init(),e&&this.data.replace(e),this}extract(e=!1){return(e?this.optimisticData:this.data).extract()}read(e){const{query:t,variables:n,returnPartialData:r=!1}=e;return this.storeReader.diffQueryAgainstStore({...e,variables:this.serializeVariables(t,n),store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r}).result}write(e){const{query:t,variables:n}=e;try{return++this.txCount,this.storeWriter.writeToStore(this.data,{...e,variables:this.serializeVariables(t,n)})}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}}modify(e){if(_l.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){const{variables:t}=e;return this.storeReader.diffQueryAgainstStore({...e,variables:this.serializeVariables(e.query,t),store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config})}watch(e){var t;return this.watches.size||hc(t=this).vars.forEach(e=>e.attachCache(t)),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&fc(this),this.maybeBroadcastWatch.forget(e)}}gc(e){Fo.reset(),yl.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(bl(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(tR){}}evict(e){if(!e.id){if(_l.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(),Fo.reset(),e&&e.discardWatches?(this.watches.forEach(e=>this.maybeBroadcastWatch.forget(e)),this.watches.clear(),fc(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&&Ys(n.result,r.result)||e.callback(e.lastDiff=r,n)}};function $c(e,t){return"object"==typeof e&&null!==e&&e[Symbol.for("apollo.error")]===t}function Vc(e){Object.defineProperty(e,Symbol.for("apollo.error"),{value:e.name,enumerable:!1,writable:!1,configurable:!1})}function qc(e){return e.map(e=>e.message||"Error message not found.").join("\n")}var Bc=class e extends Error{static is(e){return $c(e,"CombinedProtocolErrors")}static formatMessage=qc;errors;constructor(t){super(e.formatMessage(t,{defaultFormatMessage:qc})),this.name="CombinedProtocolErrors",this.errors=t,Vc(this),Object.setPrototypeOf(this,e.prototype)}},Uc=class e extends Error{static is(e){return $c(e,"UnconventionalError")}constructor(t){super("An error of unexpected shape occurred.",{cause:t}),this.name="UnconventionalError",Vc(this),Object.setPrototypeOf(this,e.prototype)}};function Hc(e){return e.filter(e=>e).map(e=>e.message||"Error message not found.").join("\n")}var Wc=class e extends Error{static is(e){return $c(e,"CombinedGraphQLErrors")}static formatMessage=Hc;errors;data;extensions;constructor(t,n=t.errors||[]){super(e.formatMessage(n,{result:t,defaultFormatMessage:Hc})),this.errors=n,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",Vc(this),Object.setPrototypeOf(this,e.prototype)}},Gc=/* @__PURE__ */new WeakSet,Jc=class e extends Error{static is(e){return $c(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,Vc(this),Object.setPrototypeOf(this,e.prototype)}},Kc=class e extends Error{static is(e){return $c(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,Vc(this),Object.setPrototypeOf(this,e.prototype)}},Qc=Symbol();function Yc(e){return"extensions"in e&&Bc.is(e.extensions[Qc])}function Xc(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 Uc(e)}var Zc,eu=/* @__PURE__ */new WeakMap;!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"}(Zc||(Zc={}));var{assign:tu,hasOwnProperty:nu}=Object,ru={loading:!0,networkStatus:Zc.loading,data:void 0,dataState:"empty",partial:!0},iu={loading:!1,networkStatus:Zc.ready,data:void 0,dataState:"empty",partial:!0},au=/* @__PURE__ */new WeakMap;function ou(e,t){const n=e[t];"function"==typeof n&&(e[t]=function(){return au.set(e,(au.get(e)+1)%1e15),n.apply(this,arguments)})}var su=class{options;queryName;variablesUnknown=!1;didWarnOnFeud=!1;lastMissing;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;const{cache:r}=e;au.has(r)||(au.set(r,0),ou(r,"evict"),ou(r,"modify"),ou(r,"reset")),this.waitForNetworkResult="network-only"===t.fetchPolicy,this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:i="cache-first"}={}}=e.defaultOptions,{fetchPolicy:a=i,initialFetchPolicy:o=("standby"===a?i:a)}=t;t[ul]&&(qa("standby"===a,84),this.variablesUnknown=!0),this.lastQuery=n,this.options={...t,initialFetchPolicy:o,fetchPolicy:a,variables:this.getVariablesWithDefaults(t.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const s=To(this.query);this.queryName=s&&s.name&&s.name.value}initializeObservablesQueue(){this.subject=new Wi({query:this.query,variables:this.variables,result:ru,meta:{}});const e=this.subject.pipe(_a({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),Ws(({query:e,variables:t,result:n,meta:r},i)=>{const{shouldEmit:a}=r;if(n===ru&&(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?rl(a,o,n,t):Ys(o,n))&&Ys(s,t))return}if(3!==a||this.options.notifyOnNetworkStatusChange&&!Ys(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 Ui,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:e=!0}={}){return Us(this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e,[dl]:void 0}))}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();let{dataState:t}=e;const n=this.options.returnPartialData||e.complete?e.result??void 0:void 0;return void 0===n&&(t="empty"),this.maskResult({data:n,dataState:t,loading:!e.complete,networkStatus:e.complete?Zc.ready:Zc.loading,partial:!e.complete})};switch(t){case"cache-only":return{...n(),loading:!1,networkStatus:Zc.ready};case"cache-first":return n();case"cache-and-network":return{...n(),loading:!0,networkStatus:Zc.loading};case"standby":return iu;default:return ru}}resubscribeCache(){const{variables:e,fetchPolicy:t}=this.options,n=this.query,r="standby"===t||"no-cache"===t||this.waitForNetworkResult,i=!lu({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!==ru&&r!==iu)&&(Ys(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===Zc.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?e:this.getInitialResult();return t===ru&&(t=this.getInitialResult()),Ys(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&&!Ys(this.variables,e)&&(n.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._reobserve(n,{newNetworkStatus:Zc.refetch})}fetchMore({query:e,variables:t,context:n,errorPolicy:r,updateQuery:i}){qa("cache-only"!==this.options.fetchPolicy,86,Za(this.query,"(anonymous)"));const a={...zo(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||qa(i,87);const{finalize:l,pushNotification:c}=this.pushOperation(Zc.fetchMore);c({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:u,operator:d}=cu(),{observable:p}=this.queryManager.fetchObservableWithInfo(a,{networkStatus:Zc.fetchMore,exposeExtensions:!0}),h=p.pipe(d,Ca(e=>"N"===e.kind&&"network"===e.source)).subscribe({next:e=>{o=!1;const t=e.value,n=t[ll];if(wl(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&&!Ys(r.result,e.result)){o=!0;const e=this.getCurrentResult();Sl(t.networkStatus)&&c({kind:"N",source:"network",value:{...e,networkStatus:t.networkStatus===Zc.error?Zc.ready:t.networkStatus,loading:!1,data:r.result,dataState:r.complete?"complete":"streaming"}})}}})}else{const e=this.getCurrentResult(),n=i(e.data,{fetchMoreResult:t.data,variables:a.variables});c({kind:"N",value:{...e,networkStatus:Zc.ready,loading:!1,data:n,dataState:"streaming"===e.dataState?"streaming":"complete"},source:"network"})}}});return js(u.then(e=>Hs(this.maskResult(e))).finally(()=>{if(h.unsubscribe(),l(),s&&!o){const e=this.getCurrentResult();"streaming"===e.dataState?c({kind:"N",source:"network",value:{...e,dataState:"complete",networkStatus:Zc.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):qa.error(88,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=zo(this.options,e||{});tu(this.options,t),this.updatePolling()}async setVariables(e){return e=this.getVariablesWithDefaults(e),Ys(this.variables,e)?Hs(this.getCurrentResult()):(this.options.variables=e,this.hasObservers()?this._reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},{newNetworkStatus:Zc.setVariables}):Hs(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 ji(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==Zc.refetch||t==Zc.setVariables;o=o.pipe(r,Oa());const p=o.pipe(_a({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&&(Sl(this.networkStatus)||this.options.skipPollAttempt?.()?a():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:Zc.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,keepLastMissing:r}=t||{};r||(this.lastMissing=void 0),this.queryManager.obsQueries.add(this);const i=n===Zc.refetch||n===Zc.poll,a=this.variables,o=this.options.fetchPolicy,s=zo(this.options,e||{});this.variablesUnknown&&="standby"===s.fetchPolicy;const l=i?s:tu(this.options,s),c=this.transformDocument(l.query);this.lastQuery=c,e&&"variables"in e&&(l.variables=this.getVariablesWithDefaults(e.variables)),i||(this.updatePolling(),!e||!e.variables||Ys(e.variables,a)||"standby"===l.fetchPolicy||l.fetchPolicy!==o&&"function"!=typeof l.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",l),void 0===n&&(n=Zc.setVariables)));const u=this.networkStatus;n||(n=Zc.loading,u!==Zc.loading&&e?.variables&&!Ys(e.variables,a)&&(n=Zc.setVariables),"standby"===l.fetchPolicy&&(n=Zc.ready)),"standby"===l.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:d,operator:p}=cu("standby"===l.fetchPolicy?{data:void 0}:void 0),{subscription:h,observable:f,fromLink:m}=this.fetch(l,n,c,p);i||!m&&this.linkSubscription||(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=h);const g=Object.assign(js(d.then(e=>Hs(this.maskResult(e))).finally(()=>{this.hasObservers()||0!==this.activeOperations.size||this.tearDownQuery()})),{retain:()=>{const e=f.subscribe({}),t=()=>e.unsubscribe();return d.then(t,t),g}});return g}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.lastMissing=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,lastMissing:n}=this,{fetchPolicy:r}=this.options;if(this.resetNotifications(),!t||"cache-only"!==r&&"cache-and-network"!==r&&this.activeOperations.size)return;const i=this.getCacheDiff(),a=this.getCurrentResult();if(Ys(i.result,this.getCacheDiff({optimistic:!1}).result)&&(i.complete||a.networkStatus!==Zc.streaming)){if(i.complete)this.lastMissing=void 0;else if(n&&n.dmCount===au.get(this.cache)&&Ys(n.variables,this.variables)&&Ys(n.missing,i.missing?.missing)){if("cache-only"!==r)return void("partial"===a.dataState&&this.deliverCacheDiff(i))}else this.didWarnOnFeud=!1,this.lastMissing={variables:this.variables,missing:i.missing?.missing,dmCount:au.get(this.cache)};this.reobserveCacheFirst()}else this.deliverCacheDiff(i)}deliverCacheDiff(e){const t=this.getCurrentResult();this.input.next({kind:"N",value:{data:e.result,dataState:e.dataState,networkStatus:t.networkStatus,loading:t.loading,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===Zc.streaming?e:Array.from(this.activeOperations.values()).reverse().find(e=>lu(e,this)&&void 0!==e.override)?.override??e}abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){const e="cache-only"===this.options.fetchPolicy;this.lastMissing=void 0,this.setResult(e?iu:ru,{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=Ws(e=>{const{query:t,meta:n}=e;if("setResult"===e.source)return{query:t,variables:this.variables,result:e.value,meta:n};if("C"===e.kind)return;const r="resolvedVariables"in e?e.resolvedVariables:void 0;if(e.query!==this.query)return;if(!Ys(r,this.variables)){if(!Ys(e.variables,this.variables))return;r&&(this.options.variables=r,this.resubscribeCache())}const i=this.variables;let a;const o=this.subject.getValue();if("cache"===e.source){if(a=e.value,a.networkStatus===Zc.ready&&"partial"===a.dataState&&(!this.options.returnPartialData||o.result.networkStatus===Zc.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===e.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),a="E"===e.kind?{...lu(o,e)||r&&Ys(r,o.variables)?o.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:Zc.error,loading:!1}:e.value,"E"===e.kind&&"streaming"===a.dataState&&(a.dataState=eu.get(e.error)??"complete"),a.error&&(n.shouldEmit=1);else if("newNetworkStatus"===e.source){const t=lu(o,e)?o.result:this.getInitialResult(n.fetchPolicy),{resetError:r}=e.value,i=r?void 0:t.error,s=i?Zc.error:Zc.ready;a={...t,error:i,networkStatus:s}}return qa(a),a.error||delete a.error,a.networkStatus=this.calculateNetworkStatus(a.networkStatus),a.loading=Sl(a.networkStatus),a=this.maskResult(a),void 0!==o.result.data&&a.data!==o.result.data&&Ys(a.data,o.result.data)&&(a.data=o.result.data),{query:t,variables:i,result:a,meta:n}});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}},{keepLastMissing:!0}):this._reobserve(void 0,{keepLastMissing:!0})}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}};function lu(e,t){return!!(e&&t&&e.query===t.query&&Ys(e.variables,t.variables))}function cu(e){let t,n,r=e;return{promise:new Promise((e,r)=>{t=e,n=r}),operator:_a({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 uu={},du=/* @__PURE__ */new WeakMap,pu=class{cache;queryManager;id;observableQuery;incremental;constructor(e,t){this.cache=e.cache;const n=(du.get(e)||0)+1;du.set(e,n),this.id=n+"",this.observableQuery=t,this.queryManager=e}get hasNext(){return!!this.incremental&&this.incremental.hasNext}get incrementalHandler(){return this.queryManager.incrementalHandler}maybeHandleIncrementalResult(e,t,n){return this.incrementalHandler.isIncrementalResult(t)?(this.incremental||=this.incrementalHandler.startRequest({query:n}),this.incremental.handle(e,t)):t}markQueryResult(e,{document:t,variables:n,errorPolicy:r,cacheWriteBehavior:i,returnPartialData:a,fetchPolicy:o,networkStatus:s,prunePendingDeferFragments:l}){const c={query:t,variables:n,optimistic:!0};this.observableQuery?.resetNotifications();const u=0===i,d=u?void 0:this.getDiff({...c,returnPartialData:"none"!==r||!this.incrementalHandler.extractErrors(e)?.length},this.getIncrementalInfo({prune:l})),p=this.maybeHandleIncrementalResult(d?.result,e,t);let h={...p,dataState:null==p.data?"empty":"complete"};return(this.incremental?.getPendingWithInfo?.().some(e=>"defer"===e.type&&!e.delivered)||!this.incremental?.getPendingWithInfo&&this.hasNext&&Wo(["defer"],t))&&(h.dataState="streaming"),u||!hu(h,r)||this.cache.batch({onWatchUpdated:(e,t)=>{e.watcher===this.observableQuery&&(e.lastOwnDiff=t)},update:e=>{e.writeQuery({query:t,data:h.data,variables:n,overwrite:1===i,extensions:h.extensions});const{dataState:r,result:u}=this.getDiff({...c,returnPartialData:a&&("network-only"!==o||s===Zc.refetch)},this.getIncrementalInfo({prune:l}));("complete"===r||"streaming"===r||a&&"partial"===r)&&(h={...h,data:u,dataState:r})}}),h}getIncrementalInfo({prune:e}){const t=this.incremental?.getPendingWithInfo?.()??[],n=this.incremental?.streamInfo,r={streamInfo:n};if(e)for(const i of t)"defer"!==i.type||i.delivered?n&&"stream"===i.type&&(n.lookupArray(i.path).state.truncate=!0):(r.deferInfo||=new io(!0,()=>!0),r.deferInfo.lookupArray(i.path.concat(i.label||[])));return r}getDiff(e,t){return Us(this.cache.diff({...e,[dl]:t}))}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:[]}),Ho(a)&&"none"===t.errorPolicy)return Promise.resolve(a);const o=()=>({...a,dataState:this.hasNext?"streaming":"complete"});if(!i&&hu(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&&Za(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(!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})}n&&!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:uu}):e;return n!==uu&&(this.cache.recordOptimisticTransaction(e=>{try{this.markMutationResult({data:n},t,e)}catch(r){qa.error(r)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:n,errorPolicy:r,cacheWriteBehavior:i}){if(0!==i){if(hu(e,r)){this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:n,extensions:e.extensions});const r=this.cache.diff({query:this.queryManager.getDocumentInfo(t).asQuery,id:"ROOT_SUBSCRIPTION",variables:n,optimistic:!1,returnPartialData:!0});r.complete&&(e.data=r.result)}this.queryManager.broadcastQueries()}}};function hu(e,t="none"){const n="ignore"===t||"all"===t;let r=!Ho(e);return!r&&n&&e.data&&(r=!0),r}var fu=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 gl(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.incrementalHandler.documentTransform&&(this.documentTransform=this.documentTransform.concat(this.incrementalHandler.documentTransform)),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(Ua(93))}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 pu(this);e=this.cache.transformForLink(this.transform(e));const{hasClientExports:h}=this.getDocumentInfo(e);t=this.getVariables(e,t),h&&(t=await this.localState.getExportedVariables({client:this.client,document:e,variables:t,context:d}));const f=this.mutationStore&&(this.mutationStore[p.id]={mutation:e,variables:this.cache.serializeVariables(e,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((h,g)=>{const y={};return this.getObservableFromLink(e,{...d,optimisticResponse:m?n:void 0},t,l,{},!1).observable.pipe(mu(),Na(n=>{const h={...n};return va(p.markMutationResult(h,{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(Sa(e=>{if(Ho(e)&&"none"===c)throw new Wc(yu(e));return f&&(f.loading=!1,f.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})};Ho(t)&&(n.error=new Wc(t)),Object.keys(t.extensions||{}).length&&(n.extensions=t.extensions),h(n)}},error:e=>(f&&(f.loading=!1,f.error=e),m&&this.cache.removeOptimistic(p.id),this.broadcastQueries(),"ignore"===c?h({data:void 0}):"all"===c?h({data:void 0,error:e}):void g(e))})})}fetchQuery(e,t){return vo(e.query,Ht),(async()=>{return n=this.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(Ws(e=>{switch(e.kind){case"E":throw e.error;case"N":if("newNetworkStatus"!==e.source)return Hs(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 go(Xa["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const n=To(e),r={hasClientExports:Wo(["client","export"],e,!0),hasForcedResolvers:Go(e),hasNonreactiveDirective:Wo(["nonreactive"],e),hasIncrementalDirective:Wo(["defer"],e),nonReactiveQuery:gu(e),clientQuery:Wo(["client"],e)?e:null,serverQuery:Fs([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:n?.operation,defaultVars:Mo(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){vo(e.query,Ht);const t=this.transform(e.query);return void 0===(e={...e,variables:this.getVariables(t,e.variables)}).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!0),new su({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(Ua(95)),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(Ao(t=e)&&"Document"===t.kind&&Array.isArray(t.definitions)){const t=yl(this.transform(e));n.set(t,Za(e)),r.set(t,!1)}else Ao(e)&&e.query&&i.add(e);var t}),this.obsQueries.forEach(n=>{const i=yl(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 su({queryManager:this,options:{...Ls(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;vo(t,Gt),t=this.transform(t),n=this.getVariables(t,n);const l=(this.getDocumentInfo(t).hasClientExports?va(this.localState.getExportedVariables({client:this.client,document:t,variables:n,context:a})):xa(n)).pipe(Na(e=>{const{observable:n,restart:l}=this.getObservableFromLink(t,a,e,r,o),c=new pu(this);return s=l,n.pipe(Sa(n=>{c.markSubscriptionResult(n,{document:t,variables:e,errorPolicy:i,cacheWriteBehavior:"no-cache"===r?0:2});const a={data:n.data??void 0};return Ho(n)?a.error=new Wc(n):Yc(n)&&(a.error=n.extensions[Qc],delete n.extensions[Qc]),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}),Ea(e=>xa("ignore"===i?{data:void 0}:{data:void 0,error:e})),Ca(e=>!(!e.data&&!e.error)))}));return Object.assign(l,{restart:()=>s?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new io(!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=Za(e),p={client:this.client};if(n=this.cache.serializeVariables(e,n),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 ji(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=yl(s),x=Fo(n);o=m.lookup(v,x),o.observable||(o.observable=Tl(g,y,p).pipe(b,(h=()=>{m.peek(v,x)===o&&m.remove(v,x)},$i(function(e,t){try{e.subscribe(t)}finally{t.add(h)}})),c===Gt?Oa():Aa({refCount:!0})))}else o.observable=Tl(g,y,p).pipe(b)}catch(f){o.observable=ka(()=>f)}}else o.observable=xa({data:{}});var h;if(l){const{operation:k}=To(e);qa(!u,100,k[0].toUpperCase()+k.slice(1),d??"(anonymous)"),o.observable=o.observable.pipe(Na(e=>va(this.localState.execute({client:this.client,document:l,remoteResult:e,context:t,variables:n,fetchPolicy:r}))))}return{restart:()=>o.restart?.(),observable:o.observable.pipe(Ea(e=>{throw function(e){Gc.add(e)}(e=Xc(e)),e}))}}getResultsFromLink(e,{queryInfo:t,cacheWriteBehavior:n,observableQuery:r,exposeExtensions:i,prunePendingDeferFragments:a}){const{errorPolicy:o}=e,s=this.cache.transformForLink(e.query);return this.getObservableFromLink(s,e.context,e.variables,e.fetchPolicy).observable.pipe(Sa(l=>{const{dataState:c,...u}=t.markQueryResult(l,{...e,document:s,cacheWriteBehavior:n,returnPartialData:e.returnPartialData,prunePendingDeferFragments:a}),d=Ho(u);if(d&&"none"===o){r?.resetNotifications();const e=new Wc(yu(u));throw eu.set(e,c),e}const p="complete"!==c,h={data:u.data,...t.hasNext?{loading:!0,networkStatus:Zc.streaming,dataState:c,partial:p}:{dataState:c,loading:!1,networkStatus:Zc.ready,partial:p}};return i&&"extensions"in u&&(h[ll]=u.extensions),d&&"ignore"!==o&&(h.error=new Wc(yu(u)),h.networkStatus!==Zc.streaming&&(h.networkStatus=Zc.error)),h}),Ea(e=>{if("none"===o)throw r?.resetNotifications(),e;const t={data:void 0,dataState:"empty",loading:!1,networkStatus:Zc.ready,partial:!0};return"ignore"!==o&&(t.error=e,t.networkStatus=Zc.error),xa(t)}))}fetchObservableWithInfo(e,{networkStatus:t=Zc.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 h=Object.assign({},e,{query:n,variables:s,fetchPolicy:l,errorPolicy:c,returnPartialData:u,networkStatus:t,notifyOnNetworkStatusChange:d,context:p}),f=new pu(this,a),m=n=>{h.variables=n;const s="no-cache"===l?0:t===Zc.refetch&&"merge"!==h.refetchWritePolicy?1:2,c=this.fetchQueryByPolicy(h,{queryInfo:f,cacheWriteBehavior:s,onCacheHit:i,observableQuery:a,exposeExtensions:o});return c.observable=c.observable.pipe(r),"standby"!==h.fetchPolicy&&a?.applyNextFetchPolicy("after-fetch",e),c},g=()=>{this.fetchCancelFns.delete(f.id)};this.fetchCancelFns.set(f.id,e=>{y.next({kind:"E",error:e,source:"network"})});const y=new Ui;let b,v;if(this.getDocumentInfo(h.query).hasClientExports)b=va(this.localState.getExportedVariables({client:this.client,document:h.query,variables:h.variables,context:h.context})).pipe(Na(e=>m(e).observable)),v=!0;else{const e=m(h.variables);v=e.fromLink,b=e.observable}return{observable:new ji(e=>{e.add(g),b.subscribe(e),y.subscribe(e)}).pipe(Oa()),fromLink:v}}refetchQueries({updateCache:e,include:t,optimistic:n=!1,removeOptimistic:r=(n?La("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 su&&!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=To(t);return qa(r,45),null==e?e:ec(e,r.selectionSet,{operationType:r.operation,operationName:r.name?.value,fragmentMap:ko(wo(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===on);void 0===r&&(qa(1===i.length,43,i.length),r=i[0].name.value);const a=i.find(e=>e.name.value===r);return qa(!!a,44,r),null==e||Ys(e,{})?e:ec(e,a.selectionSet,{operationType:"fragment",operationName:a.name.value,fragmentMap:ko(wo(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,networkStatus:o},{cacheWriteBehavior:s,onCacheHit:l,queryInfo:c,observableQuery:u,exposeExtensions:d}){const p=()=>c.getDiff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),h=(o,s)=>{const c=o.result,u=(e,t=o.dataState)=>(o.complete||i||(e=void 0,t="empty"),{data:e,dataState:t,loading:Sl(s),networkStatus:s,partial:!o.complete}),d=e=>xa({kind:"N",value:u(e),resolvedVariables:t,source:"cache"});return(o.complete||i)&&this.getDocumentInfo(e).hasForcedResolvers?(l(),va(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,o.complete?"complete":e.data?"partial":"empty"),resolvedVariables:t,source:"cache"})))):"none"===r&&s===Zc.refetch&&o.missing?d(void 0):d(c||void 0)},f=({prunePendingDeferFragments:l=!0}={})=>this.getResultsFromLink({query:e,variables:t,context:a,fetchPolicy:n,errorPolicy:r,returnPartialData:i,networkStatus:o},{cacheWriteBehavior:s,queryInfo:c,observableQuery:u,exposeExtensions:d,prunePendingDeferFragments:l}).pipe(mu(),$i(function(e,t){e.subscribe(Vi(t,function(e){t.next(wa.createNext(e))},function(){t.next(wa.createComplete()),t.complete()},function(e){t.next(wa.createError(e)),t.complete()}))}),Sa(e=>({...e,resolvedVariables:t,source:"network"})));switch(n){default:case"cache-first":{const e=p();return e.complete?{fromLink:!1,observable:h(e,Zc.ready)}:i?{fromLink:!0,observable:Ta(h(e,Zc.loading),f())}:{fromLink:!0,observable:f()}}case"cache-and-network":{const e=p();return e.complete||i?{fromLink:!0,observable:Ta(h(e,Zc.loading),f({prunePendingDeferFragments:!1}))}:{fromLink:!0,observable:f()}}case"cache-only":return{fromLink:!1,observable:Ta(h(p(),Zc.ready))};case"network-only":return{fromLink:!0,observable:f({prunePendingDeferFragments:o!==Zc.refetch})};case"no-cache":return{fromLink:!0,observable:f().pipe(Sa(t=>("N"===t.kind&&null!=t.value.data&&this.cache.configuresScalars()&&(t.value.data=function(e,t,n){const r=To(t)?.operation,i=ko(wo(t));function a(e,t,n,r){let i=!1;const a=t.map(t=>{const a=o(e,t,n,r);return i||=a!==t,a});return i?a:t}function o(e,t,r,i){if(Array.isArray(t)&&!i)return a(e,t,r,i);if(e.selectionSet)return s(e.selectionSet,t);if(null===t||!r)return t;if(i){const o=Eo(i);if(o&&Array.isArray(t))return a(e,t,r,o[1]);const s=n.getScalar(Oo(i));if(s)return s.coerceToParsed(t)}return t}function s(e,t,r){if(null===t||"object"!=typeof t)return t;const a={...t};let s=!1;Object.hasOwn(t,"__typename")&&(r=t.__typename);const l=new Set(e.selections);return l.forEach(e=>{if(Co(e)){const i=Io(e);if(!Object.hasOwn(t,i))return;const l=t[i],c=o(e,l,r,r?n.getScalarTypeForField(r,e.name.value):void 0);s||=c!==l,a[i]=c}else{const t=So(e,i);t&&r&&n.fragmentMatches(t,r)&&t.selectionSet.selections.forEach(e=>l.add(e))}}),s?a:t}return qa(r,6),s(No(t).selectionSet,e,n.getRootTypename(r))}(t.value.data,e,this.cache)),t)))};case"standby":return{fromLink:!1,observable:ea}}}};function mu(){let e=!1;return _a({next(){e=!0},complete(){qa(e,104)}})}function gu(e){return ir(e,{FragmentSpread:e=>{if(!e.directives?.some(e=>"unmask"===e.name.value))return{...e,directives:[...e.directives||[],{kind:yn,name:{kind:Kt,value:"nonreactive"}}]}}})}function yu(e){if(null==e.extensions?.[cl])return e;const{extensions:{[cl]:t,...n},...r}=e;return Object.keys(n).length>0&&(r.extensions=n),r}var bu=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:h=new hl,experiments:f=[],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=Ra,this.queryManager=new fu({client:this,defaultOptions:this.defaultOptions,defaultContext:s,documentTransform:n,queryDeduplication:a,ssrMode:r,dataMasking:!!d,clientOptions:e,incrementalHandler:h,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(),f.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=Ls(this.defaultOptions.watchQuery,e),r&&(e.refetchOn=r)}return this.queryManager.watchQuery(e)}query=e=>(this.defaultOptions.query&&(e=Ls(this.defaultOptions.query,e)),this.queryManager.query(e));mutate=e=>{const t=Ls(zo({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return vo(t.mutation,Wt),this.queryManager.mutate(t)};subscribe(e){const t={},n=this.queryManager.startGraphQLSubscription(e),r=n.pipe(Sa(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 Tl(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 gl(qs);transform(e,t=!1){const n=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(n):n}},{hasOwnProperty:vu}=Object.prototype;function xu(e){return Ao(e)&&"payload"in e}function ku(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 wu(e,t){if(e.status>=300)throw new Jc(`Response not successful: Received status code ${e.status}`,{response:e,bodyText:t});try{return JSON.parse(t)}catch(n){throw new Kc(n,{response:e,bodyText:t})}}var Su={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"}},Nu=(e,t)=>t(e);function Tu(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,yl)),{options:r,body:c}}var Cu=Da(()=>fetch);function Eu(){}var Iu=class extends Nl{constructor(e={}){let{uri:t="/graphql",fetch:n,print:r=Nu,includeExtensions:i,preserveHeaderCase:a,useGETForQueries:o,includeUnusedVariables:s=!1,...l}=e;const c={http:zo({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 kl(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}=Tu(e,r,Su,c,u);p.variables&&!s&&(p.variables=function(e,t){const n={...e},r=new Set(Object.keys(e));return ir(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 h=new AbortController,f=()=>{h=void 0};if(d.signal){const e=d.signal,t=()=>{h?.abort(e.reason)};e.addEventListener("abort",t,{once:!0}),f=()=>{h?.signal.removeEventListener("abort",f),h=void 0,e.removeEventListener("abort",t),f=Eu},h.signal.addEventListener("abort",f,{once:!0})}return d.signal=h.signal,o&&!function(e){return kl(e,"mutation")}(e.query)&&(d.method="GET"),new ji(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||Da(()=>fetch)||Cu,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="";qa(e.body&&"function"==typeof e.body.getReader,64);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,{stream:!s}),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=ku(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=wu(e,n);if(0!=Object.keys(r).length)if(xu(r)){if(1===Object.keys(r).length&&null===r.payload)return;let e={...r.payload};"errors"in r&&(e.extensions={...e.extensions,[Qc]:new Bc(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 Kc(n,{response:e,bodyText:t})}}(e,t):wu(e,t)}(e,t);if(!Array.isArray(n)&&!vu.call(n,"data")&&!vu.call(n,"errors"))throw new Jc(`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(()=>{f(),t.complete()}).catch(e=>{f(),t.error(e)}),()=>{h&&h.abort()}})})}},Ou=class extends Nl{constructor(e={}){super((t,n)=>{const r=t.client,i=r.queryManager.clientOptions,a=t.getContext();{const{name:n,version:r,transport:o="headers"}=zo({},i.clientAwareness,e.clientAwareness,a.clientAwareness);"headers"===o&&t.setContext(({headers:e})=>({headers:zo({"apollographql-client-name":n,"apollographql-client-version":r},e)}))}{const{transport:n="extensions"}=zo({},i.enhancedClientAwareness,e.enhancedClientAwareness);"extensions"===n&&(t.extensions=zo({clientLibrary:{name:"@apollo/client",version:r.version}},t.extensions)),"headers"===n&&t.setContext(({headers:e})=>({headers:zo({"apollographql-library-name":"@apollo/client","apollographql-library-version":r.version},e)}))}return n(t)})}},zu=class extends Nl{constructor(e={}){const{left:t,right:n,request:r}=Nl.from([new Ou(e),new Iu(e)]);super(r),Object.assign(this,{left:t,right:n})}},Au=/* @__PURE__ */new Map,_u=/* @__PURE__ */new Map,Du=!1;function Pu(e){return e.replace(/[\s,]+/g," ").trim()}function Ru(e){var t,n,r,i=Pu(e);if(!Au.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 yr)if(e[n].hasSubscribers)return!0;return!1}(gr)?gr.traceSync(()=>ii(e,t),{source:e}):ii(e,t)}(e,{experimentalFragmentVariables:Du,allowLegacyFragmentVariables:Du,experimentalFragmentArguments:Du});if(!a||"Document"!==a.kind)throw new Error("Not a valid GraphQL document.");Au.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=Pu((o=e.loc).source.body.substring(o.start,o.end)),a=_u.get(t);a&&!a.has(i)||a||_u.set(t,a=/* @__PURE__ */new Set),a.add(i),n.has(i)||(n.add(i),r.push(e))}else r.push(e);var o}),ui(ui({},t),{definitions:r}))))}return Au.get(i)}function Mu(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]}),Ru(r)}var Lu,ju=Mu;(Lu=Mu||(Mu={})).gql=ju,Lu.resetCaches=function(){Au.clear(),_u.clear()},Lu.disableFragmentWarnings=function(){},Lu.enableExperimentalFragmentVariables=function(){Du=!0},Lu.disableExperimentalFragmentVariables=function(){Du=!1},Mu.default=Mu;var Fu=class extends Nl{constructor(e){super((t,n)=>new ji(r=>{let i,a,o;try{i=n(t).subscribe({next:i=>{const s=t.client.queryManager.incrementalHandler,l=s.isIncrementalResult(i)?s.extractErrors(i):i.errors;l?o=e({error:new Wc(i,l),result:i,operation:t,forward:n}):Yc(i)&&(o=e({error:i.extensions[Qc],result:i,operation:t,forward:n})),a=o?.subscribe(r),a||r.next(i)},error:i=>{o=e({operation:t,error:Xc(i),forward:n}),a=o?.subscribe(r),a||r.error(i)},complete:()=>{o||r.complete()}})}catch(tR){e({error:Xc(tR),operation:t,forward:n}),r.error(tR)}return()=>{i&&i.unsubscribe(),a&&a.unsubscribe()}}))}},$u=e=>new Fu(({error:t})=>{if(!Jc.is(t))return;let n=It(t.statusCode,(e=>{try{return JSON.parse(e)}catch{return}})(t.bodyText));n&&Ct({reason:n,url:e})}),Vu=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>`},qu=/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,Bu=e=>e?.replace(qu,Vu)??e,Uu=(e,t=!1)=>{let{field:n,value:r}=e;return t?{[n]:{$not:{$regex:r,$options:"i"}}}:{[n]:{$regex:r,$options:"i"}}},Hu=(e,t=!1)=>{let{field:n,value:r}=e;return t?{[n]:{$not:{$regex:`^${r}`,$options:"i"}}}:{[n]:{$regex:`^${r}`,$options:"i"}}},Wu=(e,t=!1)=>{let{field:n,value:r}=e;return t?{[n]:{$not:{$regex:`${r}$`,$options:"i"}}}:{[n]:{$regex:`${r}$`,$options:"i"}}},Gu=(e,t=!1)=>{let{field:n}=e;return t?{[n]:{$ne:""}}:{[n]:""}},Ju=(e,t=!1)=>{let{field:n,value:r}=e,i=[];return"string"==typeof r&&r.includes(",")?i=r.split(",").map(e=>e.trim()):("string"==typeof r||"number"==typeof r)&&(i=[r]),t?{[n]:{$nin:i}}:{[n]:{$in:i}}};function Ku(e,t=!1,n={}){if(!e)return{};let{combinator:r,rules:i,enabled:a}=e;if(!Array.isArray(i)||!1===a)return{};let l=i.filter(e=>!1!==e.enabled).map(e=>"rules"in e?Ku(e,t,n):((e,t)=>{if(!e)return{};let{isBinding:n}=e;n&&(e=((e,t)=>{let{isBinding:n}=e;return n?{...e,value:s(t,e.value,e.value)}:e})(e,t));let{operator:r}=e;switch(r){case"=":case"!=":case"<":case">":case"<=":case">=":return(e=>{let{field:t,operator:n,value:r}=e;switch(n){case"=":return{[t]:r};case"!=":return{[t]:{$ne:r}};case"<":return"string"==typeof r&&Q(r)?{[t]:{$lt:parseFloat(r)}}:{[t]:{$lt:r}};case">":return"string"==typeof r&&Q(r)?{[t]:{$gt:parseFloat(r)}}:{[t]:{$gt:r}};case"<=":return"string"==typeof r&&Q(r)?{[t]:{$lte:parseFloat(r)}}:{[t]:{$lte:r}};case">=":return"string"==typeof r&&Q(r)?{[t]:{$gte:parseFloat(r)}}:{[t]:{$gte:r}};default:return{}}})(e);case"contains":return Uu(e);case"doesNotContain":return Uu(e,!0);case"beginsWith":return Hu(e);case"doesNotBeginWith":return Hu(e,!0);case"endsWith":return Wu(e);case"doesNotEndWith":return Wu(e,!0);case"empty":return Gu(e);case"notEmpty":return Gu(e,!0);case"in":return Ju(e);case"notIn":return Ju(e,!0);case"between":return(e=>{let{field:t,value:n}=e,r=[];return"string"==typeof n&&n.includes(",")&&(r=n.split(",").map(e=>e.trim())),r.length<2?{[t]:!1}:o(r[0])&&o(r[1])?{[t]:{$gte:new Date(r[0]),$lte:new Date(r[1])}}:{[t]:{$gte:r[0],$lte:r[1]}}})(e);default:return{}}})(e,n));return t?l:l.length?1===l.length?l[0]:{[`$${r}`]:l}:{}}var Qu=(e,t=!1)=>{let{field:n,value:r}=e;return`${n}${t?" not":""} like '%${r}%'`},Yu=(e,t=!1)=>{let{field:n,value:r}=e;return`${n}${t?" not":""} like '${r}%'`},Xu=(e,t=!1)=>{let{field:n,value:r}=e;return`${n}${t?" not":""} like '%${r}'`},Zu=(e,t=!1)=>{let{field:n}=e;return`${n} is${t?" not":""} NULL`},ed=(e,t=!1)=>{let{field:n,value:r}=e,i=[];return"string"==typeof r&&r.includes(",")?i=r.split(","):("string"==typeof r||"number"==typeof r)&&(i=[r.toString()]),0!==i.length&&`${n}${t?" not":""} in (${i.map(e=>`'${e.trim()}'`).join(", ")})`},td=(e,t=!1)=>{let{field:n,value:r}=e,i=[];return"string"==typeof r&&(i=r.split(",").map(e=>e.trim())),!(i.length<2)&&(o(i[0])&&o(i[1])?`${n}${t?" not":""} between DATE '${i[0]}' and '${i[1]}'`:`${n}${t?" not":""} between '${i[0]}' and '${i[1]}'`)};function nd(e,t=!0,n={}){if(!e)return"";let{combinator:r,rules:i,enabled:a}=e;if(!Array.isArray(i)||!1===a)return"";let l=i.filter(e=>!1!==e.enabled).map(e=>"rules"in e?`(${t?nd(e,t,n).toString():nd(e,t,n)})`:((e,t)=>{if(!e)return{};let{isBinding:n}=e;n&&(e=((e,t)=>e.isBinding?{...e,value:s(t,e.value,e.value)}:e)(e,t));let{operator:r}=e;switch(r){case"=":case"!=":case"<":case">":case"<=":case">=":return(e=>{let{field:t,value:n,operator:r}=e;return"boolean"==typeof n?`${t} ${r} ${n?"TRUE":"FALSE"}`:"string"!=typeof n||Q(n)?"number"==typeof n||Q(n)?`${t} ${r} ${n}`:o(n)?`${t} ${r} DATE '${n.toString()}'`:`${t} ${r} '${JSON.stringify(n)}'`:`${t} ${r} '${n}'`})(e);case"contains":return Qu(e);case"doesNotContain":return!Qu(e,!0);case"beginsWith":return Yu(e);case"doesNotBeginWith":return Yu(e,!0);case"endsWith":return Xu(e);case"doesNotEndWith":return Xu(e,!0);case"empty":return Zu(e);case"notEmpty":return Zu(e,!0);case"in":return ed(e);case"notIn":return ed(e,!0);case"between":return td(e);case"notBetween":return td(e,!0);default:return!1}})(e,n));return t?l:l.join(` ${r} `)}function rd(e){if(Array.isArray(e)){let t=!1,n=e.map(e=>{let n=rd(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=rd(i);a!==i&&(n=!0),t[r]=a}return n?t:e}return e}var id=se({theme:{components:{}},colorMode:"light",toggleColorMode:()=>{},setColorMode:()=>{}});id.displayName="ThemeContext";var ad=(e,t)=>Object.getOwnPropertyDescriptor(e,t)?.enumerable,od=(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(!od(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(!od(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||ad(e,a)||!i.includes(a);if(!od(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},sd=od,ld=(e,t="soft",n={})=>{let r=ke(e);return sd(r.current,e,t,n)?r.current:(r.current=e,e)},cd=(e=/* @__PURE__ */new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ud="-",dd=[],pd=e=>{const t=md(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return fd(e);const n=e.split(ud),r=""===n[0]&&n.length>1?1:0;return hd(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||dd}return n[e]||dd}}},hd=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],i=n.nextPart.get(r);if(i){const n=hd(e,t+1,i);if(n)return n}const a=n.validators;if(null===a)return;const o=0===t?e.join(ud):e.slice(t).join(ud),s=a.length;for(let l=0;l<s;l++){const e=a[l];if(e.validator(o))return e.classGroupId}},fd=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})(),md=e=>{const{theme:t,classGroups:n}=e;return gd(n,t)},gd=(e,t)=>{const n=cd();for(const r in e){const i=e[r];yd(i,n,r,t)}return n},yd=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const i=e[a];bd(i,t,n,r)}},bd=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?kd(e,t,n,r):xd(e,t,n,r):vd(e,t,n)},vd=(e,t,n)=>{(""===e?t:wd(t,e)).classGroupId=n},xd=(e,t,n,r)=>{Sd(e)?yd(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},kd=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[e,a]=i[o];yd(a,wd(t,e),n,r)}},wd=(e,t)=>{let n=e;const r=t.split(ud),i=r.length;for(let a=0;a<i;a++){const e=r[a];let t=n.nextPart.get(e);t||(t=cd(),n.nextPart.set(e,t)),n=t}return n},Sd=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Nd=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)}}},Td=[],Cd=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ed=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),Cd(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)):Cd(Td,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Id=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}},Od=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},zd=/\s+/,Ad=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ad(e[r]))&&(n&&(n+=" "),n+=t);return n},_d=(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(zd);let c="";for(let u=l.length-1;u>=0;u-=1){const e=l[u],{isExternal:t,modifiers:d,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:f}=n(e);if(t){c=e+(c.length>0?" "+c:c);continue}let m,g=!!f;if(g){m=r(h.substring(0,f));const e=m&&o[m]?r(h):void 0;e&&e!==m&&(m=e,g=!1)}else m=r(h);if(!m){if(!g){c=e+(c.length>0?" "+c:c);continue}if(m=r(h),!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:Nd(e.cacheSize),parseClassName:Ed(e),sortModifiers:Id(e),postfixLookupClassGroupIds:Od(e),...pd(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=Ad(t))&&(i&&(i+=" "),i+=n);return i})(...e))},Dd=[],Pd=e=>{const t=t=>t[e]||Dd;return t.isThemeGetter=!0,t},Rd=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Md=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ld=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fd=/\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$/,$d=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bd=e=>Ld.test(e),Ud=e=>!!e&&!Number.isNaN(Number(e)),Hd=e=>!!e&&Number.isInteger(Number(e)),Wd=e=>e.endsWith("%")&&Ud(e.slice(0,-1)),Gd=e=>jd.test(e),Jd=()=>!0,Kd=e=>Fd.test(e)&&!$d.test(e),Qd=()=>!1,Yd=e=>Vd.test(e),Xd=e=>qd.test(e),Zd=e=>!np(e)&&!up(e),ep=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)),tp=e=>bp(e,wp,Qd),np=e=>Rd.test(e),rp=e=>bp(e,Sp,Kd),ip=e=>bp(e,Np,Ud),ap=e=>bp(e,Cp,Jd),op=e=>bp(e,Tp,Qd),sp=e=>bp(e,xp,Qd),lp=e=>bp(e,kp,Xd),cp=e=>bp(e,Ep,Yd),up=e=>Md.test(e),dp=e=>vp(e,Sp),pp=e=>vp(e,Tp),hp=e=>vp(e,xp),fp=e=>vp(e,wp),mp=e=>vp(e,kp),gp=e=>vp(e,Ep,!0),yp=e=>vp(e,Cp,!0),bp=(e,t,n)=>{const r=Rd.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},vp=(e,t,n=!1)=>{const r=Md.exec(e);return!!r&&(r[1]?t(r[1]):n)},xp=e=>"position"===e||"percentage"===e,kp=e=>"image"===e||"url"===e,wp=e=>"length"===e||"size"===e||"bg-size"===e,Sp=e=>"length"===e,Np=e=>"number"===e,Tp=e=>"family-name"===e,Cp=e=>"number"===e||"weight"===e,Ep=e=>"shadow"===e,Ip=/*#__PURE__*/_d(()=>{const e=Pd("color"),t=Pd("font"),n=Pd("text"),r=Pd("font-weight"),i=Pd("tracking"),a=Pd("leading"),o=Pd("breakpoint"),s=Pd("container"),l=Pd("spacing"),c=Pd("radius"),u=Pd("shadow"),d=Pd("inset-shadow"),p=Pd("text-shadow"),h=Pd("drop-shadow"),f=Pd("blur"),m=Pd("perspective"),g=Pd("aspect"),y=Pd("ease"),b=Pd("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",up,np],x=()=>[up,np,l],k=()=>[Bd,"full","auto",...x()],w=()=>[Hd,"none","subgrid",up,np],S=()=>["auto",{span:["full",Hd,up,np]},Hd,up,np],N=()=>[Hd,"auto",up,np],T=()=>["auto","min","max","fr",up,np],C=()=>["auto",...x()],E=()=>[Bd,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],I=()=>[Bd,"screen","full","dvw","lvw","svw","min","max","fit",...x()],O=()=>[Bd,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],z=()=>[e,up,np],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",hp,sp,{position:[up,np]}],_=()=>["auto","cover","contain",fp,tp,{size:[up,np]}],D=()=>[Wd,dp,rp],P=()=>["","none","full",c,up,np],R=()=>["",Ud,dp,rp],M=()=>[Ud,Wd,hp,sp],L=()=>["","none",f,up,np],j=()=>["none",Ud,up,np],F=()=>["none",Ud,up,np],$=()=>[Ud,up,np],V=()=>[Bd,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gd],breakpoint:[Gd],color:[Jd],container:[Gd],"drop-shadow":[Gd],ease:["in","out","in-out"],font:[Zd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gd],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gd],shadow:[Gd],spacing:["px",Ud],text:[Gd],"text-shadow":[Gd],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Bd,np,up,g]}],container:["container"],"container-type":[{"@container":["","normal","size",up,np]}],"container-named":[ep],columns:[{columns:[Ud,np,up,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:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{"inset-s":k(),start:k()}],end:[{"inset-e":k(),end:k()}],"inset-bs":[{"inset-bs":k()}],"inset-be":[{"inset-be":k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Hd,"auto",up,np]}],basis:[{basis:[Bd,"full","auto",s,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ud,Bd,"auto","initial","none",np]}],grow:[{grow:["",Ud,up,np]}],shrink:[{shrink:["",Ud,up,np]}],order:[{order:[Hd,"first","last","none",up,np]}],"grid-cols":[{"grid-cols":w()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":w()}],"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":T()}],"auto-rows":[{"auto-rows":T()}],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:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"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",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...O()]}],"min-block-size":[{"min-block":["auto",...O()]}],"max-block-size":[{"max-block":["none",...O()]}],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,dp,rp]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,yp,ap]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Wd,np]}],"font-family":[{font:[pp,op,t]}],"font-features":[{"font-features":[np]}],"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,up,np]}],"line-clamp":[{"line-clamp":[Ud,"none",up,ip]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":["none",up,np]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",up,np]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Ud,"from-font","auto",up,rp]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Ud,"auto",up,np]}],"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:[Hd,up,np]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",up,np]}],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",up,np]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hd,up,np],radial:["",up,np],conic:[Hd,up,np]},mp,lp]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":R()}],"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:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Ud,up,np]}],"outline-w":[{outline:["",Ud,dp,rp]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,gp,cp]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,gp,cp]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Ud,rp]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",p,gp,cp]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Ud,up,np]}],"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":[Ud]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[up,np]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":[Ud]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",up,np]}],filter:[{filter:["","none",up,np]}],blur:[{blur:L()}],brightness:[{brightness:[Ud,up,np]}],contrast:[{contrast:[Ud,up,np]}],"drop-shadow":[{"drop-shadow":["","none",h,gp,cp]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Ud,up,np]}],"hue-rotate":[{"hue-rotate":[Ud,up,np]}],invert:[{invert:["",Ud,up,np]}],saturate:[{saturate:[Ud,up,np]}],sepia:[{sepia:["",Ud,up,np]}],"backdrop-filter":[{"backdrop-filter":["","none",up,np]}],"backdrop-blur":[{"backdrop-blur":L()}],"backdrop-brightness":[{"backdrop-brightness":[Ud,up,np]}],"backdrop-contrast":[{"backdrop-contrast":[Ud,up,np]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ud,up,np]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ud,up,np]}],"backdrop-invert":[{"backdrop-invert":["",Ud,up,np]}],"backdrop-opacity":[{"backdrop-opacity":[Ud,up,np]}],"backdrop-saturate":[{"backdrop-saturate":[Ud,up,np]}],"backdrop-sepia":[{"backdrop-sepia":["",Ud,up,np]}],"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",up,np]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ud,"initial",up,np]}],ease:[{ease:["linear","initial",y,up,np]}],delay:[{delay:[Ud,up,np]}],animate:[{animate:["none",b,up,np]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,up,np]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:j()}],"rotate-x":[{"rotate-x":j()}],"rotate-y":[{"rotate-y":j()}],"rotate-z":[{"rotate-z":j()}],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:[up,np,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":["translate-none"],zoom:[{zoom:[Hd,up,np]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",up,np]}],"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":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"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",up,np]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Ud,dp,rp,ip]}],stroke:[{stroke:["none",...z()]}],"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"]}}),Op=function(e,{componentKey:t,className:n,variants:r}){let{theme:i}=pe(id);e=ld(e);let a=ld(n),o=he((t,n={},r="")=>(n={...n,className:r},"string"==typeof e?s(i.components[e],t,void 0)?.(n)??r:e.map(e=>s(i.components[e],t,void 0)?.(n)).filter(Boolean).join(" ")||r),[i.components,e]);return t=ve(()=>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]),ve(()=>{if(t&&"string"==typeof t)return Ip(o(t,r,a&&"object"==typeof a?s(a,t,""):a));if(t&&Array.isArray(t)){let e={};return t.forEach((t,n)=>{let i;"object"==typeof a?i=s(a,t):"string"==typeof a&&0===n&&(i=a);let c=Ip(o(t,r,i));t.split(".").length>1?l(e,t.split(".").slice(1).join("."),c):l(e,t,c)}),e}return""},[t,a,o,r])},zp=({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,...h})=>(t=Op("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__ */Ee("div",{...h,"data-testid":r,className:t,ref:e,children:n})),Ap=(e,t,n="primary")=>e?"disabled":t&&"primary"===n?"primaryActive":t&&"secondary"===n?"secondaryActive":t&&"tertiary"===n?"tertiaryActive":n,_p=({className:e,children:t,icon:n,active:r=!1,disabled:i=!1,testId:a,intent:o,size:s,cursor:l,title:c,...u})=>{let d=Op("Icon",{className:e,componentKey:"root",variants:{intent:Ap(i,r,o),size:s,cursor:i?"disabled":l}}),{iconChildren:p}=ve(()=>{let e={iconChildren:void 0};return ie.forEach(t,t=>{ue(t)&&(e.iconChildren=oe(t,{...u,className:vt({"h-[1em] w-[1em]":"custom"!==s},d,t.props.className),title:c}))}),e},[t,d,u,s,c]);return p||/* @__PURE__ */Ee("i",{...u,title:c,"data-testid":a,className:vt(n,d)})},Dp=({ref:e,children:t,testId:n,className:r="",iconPlacement:i="none",loading:a=!1,disabled:o=!1,type:s="button",size:l,intent:c,border:u,justify:d,items:p,aspect:h,...f})=>{let m=Op("Button",{className:r,componentKey:["root","icon"],variants:{intent:c,size:l,border:u,justify:d,items:p,disabled:o,aspect:h}}),{iconChildren:g,contentChildren:y}=ve(()=>{let e={iconChildren:void 0,contentChildren:void 0};return ie.forEach(t,t=>{if("string"!=typeof t){if(ue(t))if(t.type===_p){let r=t.props;e.iconChildren=oe(t,{className:vt(m.icon,r.className),size:l,testId:n?`${n}-icon`:void 0,...r,intent:r.intent??"custom"})}else if("i"===t.type){let r=t.props;e.iconChildren=oe(t,{className:vt(m.icon,r.className),size:l,"data-testid":n?`${n}-icon`:void 0,...r,intent:r.intent??"custom"})}else e.contentChildren=t}else e.contentChildren=t}),e},[t,m.icon,l,n]);/* @__PURE__ */
|
|
4
4
|
return Ie("button",{ref:e,type:s,"data-testid":n,className:m.root,disabled:o,...f,children:[!a&&y&&/* @__PURE__ */Ie(Ce,{children:[("before"===i||"both"===i)&&y&&g,y,("after"===i||"both"===i)&&y&&g]}),!a&&!y&&g,a&&/* @__PURE__ */Ee("i",{className:"fa-solid fa-sync fa-spin text-base"})]})};Dp.Icon=_p;var Pp={root:Nt("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:Nt("shrink-0",{variants:{intent:{default:""},size:{md:"text-sm",sm:"text-xs",xs:"text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"default",size:"md"}})},Rp=Dp,Mp=({className:e,message:t,disabled:n=!1,error:r=!1,intent:i,size:a})=>(e=Op("ErrorMessage",{className:e,componentKey:"root",variants:{intent:i,size:a,error:r,disabled:n}}),/* @__PURE__ */Ee("p",{className:e,children:t})),Lp=({className:e,children:t,disabled:n=!1,error:r=!1,intent:i,size:a,...o})=>(e=Op("Label",{className:e,componentKey:"root",variants:{intent:i,size:a,error:r,disabled:n}}),/* @__PURE__ */Ee("label",{className:e,...o,children:t})),jp=({ref:e,className:t,id:n,label:r,error:i,disabled:a,intent:o,size:s,prefix:l,children:c,loading:u,clearable:d,inline:p,value:h,onClear:f,...m})=>{let g=Op("Input",{className:t,componentKey:["root","label","inputContainer","iconFloatingContainer","icon","iconError","iconClear"],variants:{intent:o,size:s,disabled:a||u,error:!!i,inline:p}}),y=he(e=>f?.(e),[f]),{iconChildren:b,inputChildren:v}=ve(()=>{let e={iconChildren:void 0,inputChildren:[]};return ie.forEach(c,t=>{if(ue(t))if(t.type===_p){let n=t.props;e.iconChildren=oe(t,{className:vt(g.icon,n.className),size:s,...n,intent:n.intent??"custom"})}else e.inputChildren.push(t)}),e},[c,g.icon,s]);/* @__PURE__ */
|
|
5
5
|
return Ie("div",{className:g.root,ref:e,...m,children:[r&&!p&&/* @__PURE__ */Ee(Lp,{error:!!i,disabled:a,intent:o,size:s,htmlFor:n,className:g.label,children:r}),
|
|
6
6
|
/* @__PURE__ */Ie("div",{className:g.inputContainer,children:[b,!!l&&l,!p&&v,p&&/* @__PURE__ */Ie(Lp,{error:!!i,disabled:a,intent:o,size:s,htmlFor:n,className:g.label,children:[v,r]}),!a&&(!!i||u||d&&!!h)&&/* @__PURE__ */Ie("div",{className:g.iconFloatingContainer,children:[i&&!u&&/* @__PURE__ */Ee(_p,{intent:"custom",icon:"fa-solid fa-circle-exclamation",className:g.iconError}),u&&/* @__PURE__ */Ee(_p,{icon:"fa-solid fa-sync fa-spin",className:g.iconLoading}),!u&&d&&!!h&&/* @__PURE__ */Ee(_p,{className:g.iconClear,icon:"fa-solid fa-xmark",onClick:y})]})]}),i&&/* @__PURE__ */Ee(Mp,{message:"boolean"==typeof i?"":i,intent:o,size:s,error:!!i})]})},Fp=(e,t,n=!1)=>{let r=ke(n),i=ke(t);me(()=>{if(r.current){let n=i.current;return i.current=t,e(n)}r.current=!0,i.current=t},t)},$p=Object.assign(de(({ref:e,children:t,className:n="",id:r,label:i="",placeholder:a="",loading:o=!1,disabled:s=!1,clearable:l=!1,inline:c=!1,prefix:u="",type:d="text",size:p,intent:h="primary",value:f="",error:m=!1,containerProps:g,onChange:y,...b})=>{let v=Op("Input",{className:n&&"object"==typeof n?n.input:"",componentKey:"input",variants:{intent:h,size:p,disabled:s||o,error:!!m,inline:c}}),x=he(e=>y?.(e.target.value),[y]),k=he(()=>y?.(""),[y]);/* @__PURE__ */
|
|
7
|
-
return Ie(jp,{className:n,id:r,label:i,loading:o,clearable:l,value:f,prefix:u,disabled:s,error:m,intent:h,size:p,onClear:k,...g,children:[t,/* @__PURE__ */Ee("input",{ref:e,id:r,type:d,placeholder:a,className:v,disabled:s||o,value:f,onChange:x,...b})]})}),{Icon:_p}),Vp={root:Nt("flex flex-col",{variants:{intent:{primary:"",custom:""},disabled:{true:"opacity-60 pointer-events-none",false:""},size:{md:"gap-1.5",sm:"gap-1 text-sm",xs:"gap-1 text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),inputContainer:Nt("flex items-center border relative transition-colors duration-150 focus-within:ring-2 focus-within:ring-offset-0",{variants:{intent:{primary:"bg-white text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300",custom:""},error:{true:"border-red-500 focus-within:ring-red-500/30",false:"border-gray-300 dark:border-zinc-700 focus-within:ring-primary-500/30 dark:focus-within:ring-primary-400/30 hover:border-gray-400 dark:hover:border-zinc-500"},disabled:{true:"cursor-not-allowed opacity-60 pointer-events-none",false:""},size:{md:"py-2 px-3 gap-2 rounded-lg",sm:"py-1.5 px-2.5 gap-1.5 rounded",xs:"py-1 px-2 gap-1 rounded-sm",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",error:!1,disabled:!1,size:"md"}}),input:Nt("p-0 border-0 outline-none focus:ring-0 w-full bg-transparent",{variants:{intent:{primary:"text-zinc-900 placeholder:text-zinc-400 dark:text-zinc-200 dark:placeholder:text-zinc-500"},error:{true:"",false:""},disabled:{true:"cursor-not-allowed",false:""},size:{md:"text-sm",sm:"text-sm",xs:"text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md",disabled:!1,error:!1}}),label:Nt("text-sm font-medium text-zinc-700 dark:text-zinc-300",{variants:{inline:{true:"flex select-none items-center",false:""},disabled:{true:"",false:""},size:{md:"",sm:"text-sm",xs:"text-xs",custom:""}},compoundVariants:[{inline:!0,disabled:!0,className:"cursor-not-allowed"},{inline:!0,disabled:!1,className:"cursor-pointer"},{inline:!0,size:"md",className:"gap-2"},{inline:!0,size:"sm",className:"gap-1.5"},{inline:!0,size:"xs",className:"gap-1"}],defaultVariants:{inline:!1,disabled:!1,size:"md"}}),iconFloatingContainer:Nt("flex items-center justify-center",{variants:{intent:{primary:""},size:{md:"gap-2",sm:"gap-1.5",xs:"gap-1",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),icon:Nt("border-r border-gray-300 dark:border-zinc-700 text-zinc-400 dark:text-zinc-500 shrink-0",{variants:{intent:{primary:""},error:{true:"text-red-500 dark:text-red-400",false:""},size:{md:"pr-2.5 mr-0.5",sm:"pr-2 mr-0.5",xs:"pr-1.5 mr-0.5",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),iconError:Nt("",{variants:{intent:{primary:""},error:{true:"text-red-500 dark:text-red-400",false:""}},compoundVariants:[],defaultVariants:{intent:"primary"}}),iconClear:Nt("cursor-pointer text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors duration-150"),iconLoading:Nt("text-zinc-400 dark:text-zinc-500")},qp=$p,Bp=(e,t)=>`${e}_${t}`,Up=({id:e="",source:t,name:n,fields:r=[]})=>{let{useStoreSetter:i}=te(),a=i(),o=ve(()=>`${e}_${ee(8)}`,[e]);me(()=>{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]),me(()=>{t&&a(`sources.${o}.meta.fields`,r)},[r,t,o,a])},Hp=(e,t={})=>Array.isArray(e)?e.reduce((e,n)=>{let{name:r,value:i,subValues:a}=n;if(!Array.isArray(a)||0===a.length)return{...e,[r]:i};let o=a.find(e=>V(e.when,t));return{...e,[r]:o?o.value:i}},{}):{},Wp=se({logs:[],providers:{}});Wp.displayName="DevToolsContext";var Gp=new class{callbackInternal;callbackAddProvider;callbackRemoveProvider;pendingLimit=100;logsListenedLimit=1e3;pendingLogs=[];listening=!1;listeningCategory;logsListened=[];listeningParams;#e=[];#t=!1;constructor(e,t=100){this.callbackInternal=e,this.pendingLimit=t}setCallback(e){this.callbackInternal=e}processPendingLogs(){if(this.pendingLogs.length&&this.callbackInternal){for(let e of this.pendingLogs)this.callbackInternal(e.logType,e.category,e.message,e.params,e.time);this.pendingLogs=[]}}setCallbackAddProvider(e){this.callbackAddProvider=e}setCallbackRemoveProvider(e){this.callbackRemoveProvider=e}flush(e=!1){this.logsListened=[],e&&(this.pendingLogs=[])}#n(e,t,n,r){let i=this.getTime(!0);if(!this.callbackInternal)return this.pendingLogs.push({logType:e,category:t,message:n,params:r,time:i}),void(this.pendingLogs.length>this.pendingLimit&&this.pendingLogs.shift());this.listening?this.logsListened.push({logType:e,category:t,message:n,params:r,time:i}):(this.#e.push({logType:e,category:t,message:n,params:r,time:i}),this.#r()),this.logsListened.length>this.logsListenedLimit&&this.logsListened.shift()}#r(){this.#t||(this.#t=!0,queueMicrotask(()=>{this.#t=!1;let e=this.callbackInternal,t=this.#e;if(this.#e=[],e)for(let n of t)e(n.logType,n.category,n.message,n.params,n.time)}))}addProviderMethod(e,t){this.callbackAddProvider?.(e,t)}removeProviderMethod(e){"function"==typeof this.callbackRemoveProvider&&this.callbackRemoveProvider(e)}getTime(e=!1){let t=/* @__PURE__ */new Date;return e?R(t,"HH:mm:ss.SSS"):t}info(e,t,n){this.#n("info",e,t,n)}warning(e,t,n){this.#n("warning",e,t,n)}danger(e,t,n){this.#n("danger",e,t,n)}success(e,t,n){this.#n("success",e,t,n)}begin(e){this.listening=!0,this.listeningParams={category:e}}end(){this.listening=!1,this.listeningCategory&&this.logsListened.length>0&&this.callbackInternal?.("info",this.listeningCategory,`${this.logsListened.length} Log${1===this.logsListened.length?"":"s"}`,{logs:this.logsListened}),this.logsListened=[],this.listeningCategory=void 0}};function Jp(e="store"){return({path:t,prevValue:n,nextValue:r})=>{Gp.info("store",e,{storeName:e,path:t,prev:n,next:r})}}var Kp="data-plitzi-fonts",Qp={platform:{desktop:{},tablet:{},mobile:{}},mode:"desktop-first",theme:{default:"system",schemes:["light","dark"]},variables:{},fonts:[],cache:""},Yp=(Object.values({DISPLAY:"display",FLEX_WRAP:"flex-wrap",FLEX_DIRECTION:"flex-direction",ALIGN_ITEMS:"align-items",JUSTIFY_ITEMS:"justify-items",JUSTIFY_CONTENT:"justify-content",ALIGN_CONTENT:"align-content",ROW_GAP:"row-gap",COLUMN_GAP:"column-gap",GRID_ROW_GAP:"grid-row-gap",GRID_COLUMN_GAP:"grid-column-gap",GRID_TEMPLATE_AREAS:"grid-template-areas",GRID_TEMPLATE_COLUMNS:"grid-template-columns",GRID_TEMPLATE_ROWS:"grid-template-rows",GRID_AUTO_FLOW:"grid-auto-flow",GRID_AUTO_ROWS:"grid-auto-rows",GRID_AUTO_COLUMNS:"grid-auto-columns",GRID_ROW_START:"grid-row-start",GRID_COLUMN_START:"grid-column-start",GRID_ROW_END:"grid-row-end",GRID_COLUMN_END:"grid-column-end",ALIGN_SELF:"align-self",JUSTIFY_SELF:"justify-self",ORDER:"order",FLEX_GROW:"flex-grow",FLEX_SHRINK:"flex-shrink",FLEX_BASIS:"flex-basis",LIST_STYLE:"list-style",LIST_STYLE_TYPE:"list-style-type",LIST_STYLE_POSITION:"list-style-position",LIST_STYLE_IMAGE:"list-style-image",BACKGROUND_COLOR:"background-color",BACKGROUND_IMAGE:"background-image",BACKGROUND_POSITION:"background-position",BACKGROUND_SIZE:"background-size",BACKGROUND_REPEAT:"background-repeat",BACKGROUND_ORIGIN:"background-origin",BACKGROUND_CLIP:"background-clip",BACKGROUND_ATTACHMENT:"background-attachment",BACKGROUND_BLEND_MODE:"background-blend-mode",MASK_IMAGE:"mask-image",BORDER_TOP_STYLE:"border-top-style",BORDER_TOP_WIDTH:"border-top-width",BORDER_TOP_COLOR:"border-top-color",BORDER_BOTTOM_STYLE:"border-bottom-style",BORDER_BOTTOM_WIDTH:"border-bottom-width",BORDER_BOTTOM_COLOR:"border-bottom-color",BORDER_LEFT_STYLE:"border-left-style",BORDER_LEFT_WIDTH:"border-left-width",BORDER_LEFT_COLOR:"border-left-color",BORDER_RIGHT_STYLE:"border-right-style",BORDER_RIGHT_WIDTH:"border-right-width",BORDER_RIGHT_COLOR:"border-right-color",BORDER_TOP_LEFT_RADIUS:"border-top-left-radius",BORDER_TOP_RIGHT_RADIUS:"border-top-right-radius",BORDER_BOTTOM_LEFT_RADIUS:"border-bottom-left-radius",BORDER_BOTTOM_RIGHT_RADIUS:"border-bottom-right-radius",BORDER_COLLAPSE:"border-collapse",BORDER_SPACING:"border-spacing",TABLE_LAYOUT:"table-layout",OPACITY:"opacity",VISIBILITY:"visibility",CURSOR:"cursor",TRANSITION:"transition",TRANSITION_PROPERTY:"transition-property",TRANSITION_DURATION:"transition-duration",TRANSITION_TIMING_FUNCTION:"transition-timing-function",TRANSITION_DELAY:"transition-delay",ANIMATION:"animation",ANIMATION_NAME:"animation-name",ANIMATION_DURATION:"animation-duration",ANIMATION_TIMING_FUNCTION:"animation-timing-function",ANIMATION_DELAY:"animation-delay",ANIMATION_ITERATION_COUNT:"animation-iteration-count",ANIMATION_DIRECTION:"animation-direction",ANIMATION_FILL_MODE:"animation-fill-mode",ANIMATION_PLAY_STATE:"animation-play-state",BOX_SHADOW:"box-shadow",FILTER:"filter",BACKDROP_FILTER:"backdrop-filter",MIX_BLEND_MODE:"mix-blend-mode",ISOLATION:"isolation",CLIP_PATH:"clip-path",TRANSFORM:"transform",TRANSFORM_ORIGIN:"transform-origin",PERSPECTIVE:"perspective",WILL_CHANGE:"will-change",OUTLINE_WIDTH:"outline-width",OUTLINE_STYLE:"outline-style",OUTLINE_COLOR:"outline-color",OUTLINE_OFFSET:"outline-offset",POINTER_EVENTS:"pointer-events",USER_SELECT:"user-select",TOUCH_ACTION:"touch-action",RESIZE:"resize",APPEARANCE:"appearance",SCROLL_BEHAVIOR:"scroll-behavior",OVERSCROLL_BEHAVIOR:"overscroll-behavior",ACCENT_COLOR:"accent-color",CARET_COLOR:"caret-color",COLOR_SCHEME:"color-scheme",POSITION:"position",FLOAT:"float",CLEAR:"clear",Z_INDEX:"z-index",TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right",BOX_SIZING:"box-sizing",ASPECT_RATIO:"aspect-ratio",WIDTH:"width",HEIGHT:"height",MIN_WIDTH:"min-width",MIN_HEIGHT:"min-height",MAX_WIDTH:"max-width",MAX_HEIGHT:"max-height",OVERFLOW:"overflow",OVERFLOW_X:"overflow-x",OVERFLOW_Y:"overflow-y",OBJECT_FIT:"object-fit",OBJECT_POSITION:"object-position",COLUMN_WIDTH:"column-width",COLUMN_COUNT:"column-count",MARGIN_TOP:"margin-top",MARGIN_BOTTOM:"margin-bottom",MARGIN_LEFT:"margin-left",MARGIN_RIGHT:"margin-right",PADDING_TOP:"padding-top",PADDING_BOTTOM:"padding-bottom",PADDING_LEFT:"padding-left",PADDING_RIGHT:"padding-right",FONT_FAMILY:"font-family",FONT_WEIGHT:"font-weight",FONT_SIZE:"font-size",LINE_HEIGHT:"line-height",COLOR:"color",TEXT_ALIGN:"text-align",FONT_STYLE:"font-style",FONT_VARIANT:"font-variant",TEXT_DECORATION:"text-decoration",TEXT_DECORATION_LINE:"text-decoration-line",TEXT_DECORATION_COLOR:"text-decoration-color",TEXT_DECORATION_STYLE:"text-decoration-style",TEXT_DECORATION_THICKNESS:"text-decoration-thickness",TEXT_UNDERLINE_OFFSET:"text-underline-offset",LETTER_SPACING:"letter-spacing",WORD_SPACING:"word-spacing",TEXT_INDENT:"text-indent",TEXT_TRANSFORM:"text-transform",DIRECTION:"direction",WHITE_SPACE:"white-space",TEXT_WRAP:"text-wrap",WORD_BREAK:"word-break",OVERFLOW_WRAP:"overflow-wrap",HYPHENS:"hyphens",VERTICAL_ALIGN:"vertical-align",TEXT_OVERFLOW:"text-overflow",TEXT_SHADOW:"text-shadow",LINE_CLAMP:"line-clamp",WEBKIT_LINE_CLAMP:"-webkit-line-clamp",WEBKIT_BOX_ORIENT:"-webkit-box-orient",FILL:"fill",STROKE:"stroke",STROKE_WIDTH:"stroke-width"}).map(e=>({path:e,label:e})),e=>e.links.filter(e=>"stylesheet"===e.rel).reduce((e,t,n)=>{let r=`font-${n}`;return{...e,[r]:{type:"link",id:r,params:{href:t.href,type:"text/css",rel:"stylesheet"}}}},{})),Xp="https://fonts.googleapis.com",Zp={woff2:"font/woff2",woff:"font/woff"},eh=e=>{try{let t=new URL(e);return"https:"===t.protocol&&!t.username&&!t.password}catch{return!1}},th=e=>{try{return new URL(e).origin}catch{return}},nh={"<":"\\3c ",">":"\\3e "},rh=e=>`"${e.replace(/[\\"<>]/g,e=>nh[e]??`\\${e}`)}"`,ih=/^U\+[0-9A-Fa-f?]{1,6}(-[0-9A-Fa-f]{1,6})?(\s*,\s*U\+[0-9A-Fa-f?]{1,6}(-[0-9A-Fa-f]{1,6})?)*$/,ah=e=>encodeURIComponent(e).replace(/%20/g,"+"),oh=(e,t)=>["@font-face{",`font-family:${rh(e.family)};`,`font-style:${"italic"===t.style?"italic":"normal"};`,`font-weight:${Number.parseInt(String(t.weight),10)||400};`,`font-display:${e.display??"swap"};`,`src:url(${rh(t.url)}) format(${rh(t.format)});`,t.unicodeRange&&ih.test(t.unicodeRange)?`unicode-range:${t.unicodeRange};`:"","}"].join(""),sh={definition:{name:"",permanentUrl:""},flat:{},variables:[],settings:{customCss:""},pages:[],pageFolders:[]},lh=se({mutate:async()=>{},query:async()=>{},subscribe:()=>{},subscriptionManager:{subscribe:()=>{},unsubscribe:()=>{},stop:()=>{}},webKey:"",instanceId:"",server:{},userKey:"",webId:"",environment:"development"});lh.displayName="NetworkContext";var ch=se({});ch.displayName="NetworkInternalContext";var uh={},dh={Init:Mu`
|
|
7
|
+
return Ie(jp,{className:n,id:r,label:i,loading:o,clearable:l,value:f,prefix:u,disabled:s,error:m,intent:h,size:p,onClear:k,...g,children:[t,/* @__PURE__ */Ee("input",{ref:e,id:r,type:d,placeholder:a,className:v,disabled:s||o,value:f,onChange:x,...b})]})}),{Icon:_p}),Vp={root:Nt("flex flex-col",{variants:{intent:{primary:"",custom:""},disabled:{true:"opacity-60 pointer-events-none",false:""},size:{md:"gap-1.5",sm:"gap-1 text-sm",xs:"gap-1 text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),inputContainer:Nt("flex items-center border relative transition-colors duration-150 focus-within:ring-2 focus-within:ring-offset-0",{variants:{intent:{primary:"bg-white text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300",custom:""},error:{true:"border-red-500 focus-within:ring-red-500/30",false:"border-gray-300 dark:border-zinc-700 focus-within:ring-primary-500/30 dark:focus-within:ring-primary-400/30 hover:border-gray-400 dark:hover:border-zinc-500"},disabled:{true:"cursor-not-allowed opacity-60 pointer-events-none",false:""},size:{md:"py-2 px-3 gap-2 rounded-lg",sm:"py-1.5 px-2.5 gap-1.5 rounded",xs:"py-1 px-2 gap-1 rounded-sm",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",error:!1,disabled:!1,size:"md"}}),input:Nt("p-0 border-0 outline-none focus:ring-0 w-full bg-transparent",{variants:{intent:{primary:"text-zinc-900 placeholder:text-zinc-400 dark:text-zinc-200 dark:placeholder:text-zinc-500"},error:{true:"",false:""},disabled:{true:"cursor-not-allowed",false:""},size:{md:"text-sm",sm:"text-sm",xs:"text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md",disabled:!1,error:!1}}),label:Nt("text-sm font-medium text-zinc-700 dark:text-zinc-300",{variants:{inline:{true:"flex select-none items-center",false:""},disabled:{true:"",false:""},size:{md:"",sm:"text-sm",xs:"text-xs",custom:""}},compoundVariants:[{inline:!0,disabled:!0,className:"cursor-not-allowed"},{inline:!0,disabled:!1,className:"cursor-pointer"},{inline:!0,size:"md",className:"gap-2"},{inline:!0,size:"sm",className:"gap-1.5"},{inline:!0,size:"xs",className:"gap-1"}],defaultVariants:{inline:!1,disabled:!1,size:"md"}}),iconFloatingContainer:Nt("flex items-center justify-center",{variants:{intent:{primary:""},size:{md:"gap-2",sm:"gap-1.5",xs:"gap-1",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),icon:Nt("border-r border-gray-300 dark:border-zinc-700 text-zinc-400 dark:text-zinc-500 shrink-0",{variants:{intent:{primary:""},error:{true:"text-red-500 dark:text-red-400",false:""},size:{md:"pr-2.5 mr-0.5",sm:"pr-2 mr-0.5",xs:"pr-1.5 mr-0.5",custom:""}},compoundVariants:[],defaultVariants:{intent:"primary",size:"md"}}),iconError:Nt("",{variants:{intent:{primary:""},error:{true:"text-red-500 dark:text-red-400",false:""}},compoundVariants:[],defaultVariants:{intent:"primary"}}),iconClear:Nt("cursor-pointer text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors duration-150"),iconLoading:Nt("text-zinc-400 dark:text-zinc-500")},qp=$p,Bp=(e,t)=>`${e}_${t}`,Up=({id:e="",source:t,name:n,fields:r=[]})=>{let{useStoreSetter:i}=te(),a=i(),o=ve(()=>`${e}_${z(8)}`,[e]);me(()=>{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]),me(()=>{t&&a(`sources.${o}.meta.fields`,r)},[r,t,o,a])},Hp=(e,t={})=>Array.isArray(e)?e.reduce((e,n)=>{let{name:r,value:i,subValues:a}=n;if(!Array.isArray(a)||0===a.length)return{...e,[r]:i};let o=a.find(e=>V(e.when,t));return{...e,[r]:o?o.value:i}},{}):{},Wp=se({logs:[],providers:{}});Wp.displayName="DevToolsContext";var Gp=new class{callbackInternal;callbackAddProvider;callbackRemoveProvider;pendingLimit=100;logsListenedLimit=1e3;pendingLogs=[];listening=!1;listeningCategory;logsListened=[];listeningParams;#e=[];#t=!1;constructor(e,t=100){this.callbackInternal=e,this.pendingLimit=t}setCallback(e){this.callbackInternal=e}processPendingLogs(){if(this.pendingLogs.length&&this.callbackInternal){for(let e of this.pendingLogs)this.callbackInternal(e.logType,e.category,e.message,e.params,e.time);this.pendingLogs=[]}}setCallbackAddProvider(e){this.callbackAddProvider=e}setCallbackRemoveProvider(e){this.callbackRemoveProvider=e}flush(e=!1){this.logsListened=[],e&&(this.pendingLogs=[])}#n(e,t,n,r){let i=this.getTime(!0);if(!this.callbackInternal)return this.pendingLogs.push({logType:e,category:t,message:n,params:r,time:i}),void(this.pendingLogs.length>this.pendingLimit&&this.pendingLogs.shift());this.listening?this.logsListened.push({logType:e,category:t,message:n,params:r,time:i}):(this.#e.push({logType:e,category:t,message:n,params:r,time:i}),this.#r()),this.logsListened.length>this.logsListenedLimit&&this.logsListened.shift()}#r(){this.#t||(this.#t=!0,queueMicrotask(()=>{this.#t=!1;let e=this.callbackInternal,t=this.#e;if(this.#e=[],e)for(let n of t)e(n.logType,n.category,n.message,n.params,n.time)}))}addProviderMethod(e,t){this.callbackAddProvider?.(e,t)}removeProviderMethod(e){"function"==typeof this.callbackRemoveProvider&&this.callbackRemoveProvider(e)}getTime(e=!1){let t=/* @__PURE__ */new Date;return e?R(t,"HH:mm:ss.SSS"):t}info(e,t,n){this.#n("info",e,t,n)}warning(e,t,n){this.#n("warning",e,t,n)}danger(e,t,n){this.#n("danger",e,t,n)}success(e,t,n){this.#n("success",e,t,n)}begin(e){this.listening=!0,this.listeningParams={category:e}}end(){this.listening=!1,this.listeningCategory&&this.logsListened.length>0&&this.callbackInternal?.("info",this.listeningCategory,`${this.logsListened.length} Log${1===this.logsListened.length?"":"s"}`,{logs:this.logsListened}),this.logsListened=[],this.listeningCategory=void 0}};function Jp(e="store"){return({path:t,prevValue:n,nextValue:r})=>{Gp.info("store",e,{storeName:e,path:t,prev:n,next:r})}}var Kp="data-plitzi-fonts",Qp={platform:{desktop:{},tablet:{},mobile:{}},mode:"desktop-first",theme:{default:"system",schemes:["light","dark"]},variables:{},fonts:[],cache:""},Yp=(Object.values({DISPLAY:"display",FLEX_WRAP:"flex-wrap",FLEX_DIRECTION:"flex-direction",ALIGN_ITEMS:"align-items",JUSTIFY_ITEMS:"justify-items",JUSTIFY_CONTENT:"justify-content",ALIGN_CONTENT:"align-content",ROW_GAP:"row-gap",COLUMN_GAP:"column-gap",GRID_ROW_GAP:"grid-row-gap",GRID_COLUMN_GAP:"grid-column-gap",GRID_TEMPLATE_AREAS:"grid-template-areas",GRID_TEMPLATE_COLUMNS:"grid-template-columns",GRID_TEMPLATE_ROWS:"grid-template-rows",GRID_AUTO_FLOW:"grid-auto-flow",GRID_AUTO_ROWS:"grid-auto-rows",GRID_AUTO_COLUMNS:"grid-auto-columns",GRID_ROW_START:"grid-row-start",GRID_COLUMN_START:"grid-column-start",GRID_ROW_END:"grid-row-end",GRID_COLUMN_END:"grid-column-end",ALIGN_SELF:"align-self",JUSTIFY_SELF:"justify-self",ORDER:"order",FLEX_GROW:"flex-grow",FLEX_SHRINK:"flex-shrink",FLEX_BASIS:"flex-basis",LIST_STYLE:"list-style",LIST_STYLE_TYPE:"list-style-type",LIST_STYLE_POSITION:"list-style-position",LIST_STYLE_IMAGE:"list-style-image",BACKGROUND_COLOR:"background-color",BACKGROUND_IMAGE:"background-image",BACKGROUND_POSITION:"background-position",BACKGROUND_SIZE:"background-size",BACKGROUND_REPEAT:"background-repeat",BACKGROUND_ORIGIN:"background-origin",BACKGROUND_CLIP:"background-clip",BACKGROUND_ATTACHMENT:"background-attachment",BACKGROUND_BLEND_MODE:"background-blend-mode",MASK_IMAGE:"mask-image",BORDER_TOP_STYLE:"border-top-style",BORDER_TOP_WIDTH:"border-top-width",BORDER_TOP_COLOR:"border-top-color",BORDER_BOTTOM_STYLE:"border-bottom-style",BORDER_BOTTOM_WIDTH:"border-bottom-width",BORDER_BOTTOM_COLOR:"border-bottom-color",BORDER_LEFT_STYLE:"border-left-style",BORDER_LEFT_WIDTH:"border-left-width",BORDER_LEFT_COLOR:"border-left-color",BORDER_RIGHT_STYLE:"border-right-style",BORDER_RIGHT_WIDTH:"border-right-width",BORDER_RIGHT_COLOR:"border-right-color",BORDER_TOP_LEFT_RADIUS:"border-top-left-radius",BORDER_TOP_RIGHT_RADIUS:"border-top-right-radius",BORDER_BOTTOM_LEFT_RADIUS:"border-bottom-left-radius",BORDER_BOTTOM_RIGHT_RADIUS:"border-bottom-right-radius",BORDER_COLLAPSE:"border-collapse",BORDER_SPACING:"border-spacing",TABLE_LAYOUT:"table-layout",OPACITY:"opacity",VISIBILITY:"visibility",CURSOR:"cursor",TRANSITION:"transition",TRANSITION_PROPERTY:"transition-property",TRANSITION_DURATION:"transition-duration",TRANSITION_TIMING_FUNCTION:"transition-timing-function",TRANSITION_DELAY:"transition-delay",ANIMATION:"animation",ANIMATION_NAME:"animation-name",ANIMATION_DURATION:"animation-duration",ANIMATION_TIMING_FUNCTION:"animation-timing-function",ANIMATION_DELAY:"animation-delay",ANIMATION_ITERATION_COUNT:"animation-iteration-count",ANIMATION_DIRECTION:"animation-direction",ANIMATION_FILL_MODE:"animation-fill-mode",ANIMATION_PLAY_STATE:"animation-play-state",BOX_SHADOW:"box-shadow",FILTER:"filter",BACKDROP_FILTER:"backdrop-filter",MIX_BLEND_MODE:"mix-blend-mode",ISOLATION:"isolation",CLIP_PATH:"clip-path",TRANSFORM:"transform",TRANSFORM_ORIGIN:"transform-origin",PERSPECTIVE:"perspective",WILL_CHANGE:"will-change",OUTLINE_WIDTH:"outline-width",OUTLINE_STYLE:"outline-style",OUTLINE_COLOR:"outline-color",OUTLINE_OFFSET:"outline-offset",POINTER_EVENTS:"pointer-events",USER_SELECT:"user-select",TOUCH_ACTION:"touch-action",RESIZE:"resize",APPEARANCE:"appearance",SCROLL_BEHAVIOR:"scroll-behavior",OVERSCROLL_BEHAVIOR:"overscroll-behavior",ACCENT_COLOR:"accent-color",CARET_COLOR:"caret-color",COLOR_SCHEME:"color-scheme",POSITION:"position",FLOAT:"float",CLEAR:"clear",Z_INDEX:"z-index",TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right",BOX_SIZING:"box-sizing",ASPECT_RATIO:"aspect-ratio",WIDTH:"width",HEIGHT:"height",MIN_WIDTH:"min-width",MIN_HEIGHT:"min-height",MAX_WIDTH:"max-width",MAX_HEIGHT:"max-height",OVERFLOW:"overflow",OVERFLOW_X:"overflow-x",OVERFLOW_Y:"overflow-y",OBJECT_FIT:"object-fit",OBJECT_POSITION:"object-position",COLUMN_WIDTH:"column-width",COLUMN_COUNT:"column-count",MARGIN_TOP:"margin-top",MARGIN_BOTTOM:"margin-bottom",MARGIN_LEFT:"margin-left",MARGIN_RIGHT:"margin-right",PADDING_TOP:"padding-top",PADDING_BOTTOM:"padding-bottom",PADDING_LEFT:"padding-left",PADDING_RIGHT:"padding-right",FONT_FAMILY:"font-family",FONT_WEIGHT:"font-weight",FONT_SIZE:"font-size",LINE_HEIGHT:"line-height",COLOR:"color",TEXT_ALIGN:"text-align",FONT_STYLE:"font-style",FONT_VARIANT:"font-variant",TEXT_DECORATION:"text-decoration",TEXT_DECORATION_LINE:"text-decoration-line",TEXT_DECORATION_COLOR:"text-decoration-color",TEXT_DECORATION_STYLE:"text-decoration-style",TEXT_DECORATION_THICKNESS:"text-decoration-thickness",TEXT_UNDERLINE_OFFSET:"text-underline-offset",LETTER_SPACING:"letter-spacing",WORD_SPACING:"word-spacing",TEXT_INDENT:"text-indent",TEXT_TRANSFORM:"text-transform",DIRECTION:"direction",WHITE_SPACE:"white-space",TEXT_WRAP:"text-wrap",WORD_BREAK:"word-break",OVERFLOW_WRAP:"overflow-wrap",HYPHENS:"hyphens",VERTICAL_ALIGN:"vertical-align",TEXT_OVERFLOW:"text-overflow",TEXT_SHADOW:"text-shadow",LINE_CLAMP:"line-clamp",WEBKIT_LINE_CLAMP:"-webkit-line-clamp",WEBKIT_BOX_ORIENT:"-webkit-box-orient",FILL:"fill",STROKE:"stroke",STROKE_WIDTH:"stroke-width"}).map(e=>({path:e,label:e})),e=>e.links.filter(e=>"stylesheet"===e.rel).reduce((e,t,n)=>{let r=`font-${n}`;return{...e,[r]:{type:"link",id:r,params:{href:t.href,type:"text/css",rel:"stylesheet"}}}},{})),Xp="https://fonts.googleapis.com",Zp={woff2:"font/woff2",woff:"font/woff"},eh=e=>{try{let t=new URL(e);return"https:"===t.protocol&&!t.username&&!t.password}catch{return!1}},th=e=>{try{return new URL(e).origin}catch{return}},nh={"<":"\\3c ",">":"\\3e "},rh=e=>`"${e.replace(/[\\"<>]/g,e=>nh[e]??`\\${e}`)}"`,ih=/^U\+[0-9A-Fa-f?]{1,6}(-[0-9A-Fa-f]{1,6})?(\s*,\s*U\+[0-9A-Fa-f?]{1,6}(-[0-9A-Fa-f]{1,6})?)*$/,ah=e=>encodeURIComponent(e).replace(/%20/g,"+"),oh=(e,t)=>["@font-face{",`font-family:${rh(e.family)};`,`font-style:${"italic"===t.style?"italic":"normal"};`,`font-weight:${Number.parseInt(String(t.weight),10)||400};`,`font-display:${e.display??"swap"};`,`src:url(${rh(t.url)}) format(${rh(t.format)});`,t.unicodeRange&&ih.test(t.unicodeRange)?`unicode-range:${t.unicodeRange};`:"","}"].join(""),sh={definition:{name:"",permanentUrl:""},flat:{},variables:[],settings:{customCss:""},pages:[],pageFolders:[]},lh=se({mutate:async()=>{},query:async()=>{},subscribe:()=>{},subscriptionManager:{subscribe:()=>{},unsubscribe:()=>{},stop:()=>{}},webKey:"",instanceId:"",server:{},userKey:"",webId:"",environment:"development"});lh.displayName="NetworkContext";var ch=se({});ch.displayName="NetworkInternalContext";var uh={},dh={Init:Mu`
|
|
8
8
|
query InitQuery($environment: String!, $revision: Int) {
|
|
9
9
|
Space(environment: $environment, revision: $revision) {
|
|
10
10
|
schema {
|
|
@@ -185,20 +185,20 @@ return Ie(jp,{className:n,id:r,label:i,loading:o,clearable:l,value:f,prefix:u,di
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`},ph=se({});ph.displayName="SegmentsContext";var hh="theme",fh=["dark","light"],mh=[...fh,"system"],gh=e=>mh.includes(e),yh=(e="theme")=>f({mode:"system",scheme:"light",areas:{}},{id:e}),bh=yh(),vh=(e,t)=>"system"===e?t:e,xh=(e,t=bh)=>{t.batch(()=>{t.setState("mode",e),t.setState("areas",{})})},kh=(e,t=bh)=>{t.setState("scheme",e)},wh=se(void 0),Sh="(prefers-color-scheme: dark)",Nh=({state:e})=>(v(["theme.mode","theme.resolved","theme.areas"],[e.mode,vh(e.mode,e.scheme),e.areas]),null),Th=({defaultTheme:e="system",theme:t,scope:n="document",cookieName:r=hh,children:i})=>{let a="container"===n,o=ge(),[s]=we(()=>a?yh(`theme${o}`):void 0),l=s??bh;T(()=>{let n=a?void 0:((e=hh)=>{try{return((e,t=hh)=>{if(e)for(let n of e.split(";")){let e=n.indexOf("=");if(e>-1&&n.slice(0,e).trim()===t){let t=decodeURIComponent(n.slice(e+1).trim());return gh(t)?t:void 0}}})(document.cookie,e)}catch{return}})(r);l.batch(()=>{kh(window.matchMedia(Sh).matches?"dark":"light",l),xh(t??n??e,l)})},[e,t,r,a,l]);let c=Se(l.subscribe,l.getState,l.getState),d=void 0!==pe(u);me(()=>{let e=window.matchMedia(Sh),t=()=>kh(e.matches?"dark":"light",l);return e.addEventListener("change",t),t(),()=>e.removeEventListener("change",t)},[l]),me(()=>{if(a)return;let e=()=>{let{mode:e}=l.getState();((e,t=hh)=>{try{document.cookie=`${t}=${encodeURIComponent(e)};path=/;max-age=31536000;SameSite=Lax`}catch{}})(e,r),((e,t)=>{for(let n of fh)t.classList.toggle(n,e===n)})(e,document.documentElement)};return e(),l.subscribe(e)},[r,a,l]);let p=d?/* @__PURE__ */Ee(Nh,{state:c}):null;return a?/* @__PURE__ */Ie(wh,{value:s,children:[p,i]}):/* @__PURE__ */Ie(Ce,{children:[p,i]})},Ch=e=>{let t=pe(wh)??bh,n=Se(t.subscribe,t.getState,t.getState),r=((e,t)=>(t?e.areas[t]:void 0)??e.mode)(n,e),i=vh(r,n.scheme),a=he(n=>e?((e,t,n=bh)=>{n.setState(`areas.${e}`,t)})(e,n,t):xh(n,t),[e,t]),o=he(()=>a("dark"===i?"light":"dark"),[i,a]);return ve(()=>({theme:r,resolvedTheme:i,setTheme:a,toggleTheme:o}),[r,i,a,o])},Eh=e=>/^https?:\/\//i.test(e),Ih=e=>e.replace(/{{([a-zA-Z0-9-_:*/]+)}}/i,":$1").replaceAll(/[/]+/gim,"/"),Oh=(e,t)=>{if(!t||!e[t])return"";let{slug:n,parentId:r}=e[t];return r?`${Oh(e,r)}/${n}`:n};function zh(e,t,n,r=!1){let{slug:i="",folder:a,default:o}=e[n]?.attributes??{slug:n,folder:"",default:!1};if(o&&!r)return{"/":n,[`/${n}`]:n};if(o&&r)return"/";if(!a&&!r)return{[Ih(`/${i}`)]:n,[`/${n}`]:n};if(!a&&r)return`/${i}`;if(!t.find(e=>e.id===a))return r?`/${i}`:{[Ih(`/${i}`)]:n,[`/${n}`]:n};let s=[Oh(t.reduce((e,t)=>({...e,[t.id]:t}),{}),a),i||n].filter(Boolean).join("/");return r?`/${s}`:{[`/${s}`]:n,[`/${n}`]:n}}var Ah=(e,t,n=!0)=>!(e&&n&&void 0!==t&&(!t||"authenticated"!==e)&&(t||"public"!==e)&&(t&&"public"===e||e)),_h=(e={},t=[],n,r="",i=!0,a=!0)=>{let o=Object.keys(e).reduce((a,o)=>{let{attributes:{accessLevel:s,enabled:l=!0,unauthorizedBehaviour:c}}=e[o],u=e[o].attributes.unauthorizedPageRedirect;if(!l&&i)return a;u&&=(e=>Eh(e)||e.includes("{{"))(u)?u:zh(e,t,u.replace("/",""),!0);let d=zh(e,t,o),p=Object.keys(d).map(e=>({pageId:o,path:`${r}${e}`.replaceAll("//","/"),accessLevel:s,enabled:l,isRaw:`/${o}`===e,unauthorizedBehaviour:c,unauthorizedPageRedirect:u,hasAccess:Ah(s,n,i)}));return[...a,...p]},[]).filter(e=>"*"!==e.path||e.hasAccess).sort((e,t)=>e.path===t.path?"authenticated"===e.accessLevel?-1:1:e.path>t.path?-1:1);if(!o.find(e=>"*"===e.path)&&!a){let e=o.find(e=>"/"===e.path&&e.hasAccess);e&&"redirect"===e.unauthorizedBehaviour&&e.unauthorizedPageRedirect&&o.push({...e,path:"*",hasAccess:!1,isRaw:!0,unauthorizedBehaviour:"redirect",unauthorizedPageRedirect:"/"})}return o},Dh=(e,t,n)=>{if(!t)return{action:{type:"accessDenied",path:void 0},pathMatch:void 0};let r=[];e.forEach(e=>{let n=((e,t)=>{let n="string"==typeof e?{path:e,caseSensitive:!1,end:!0}:{path:e.path,caseSensitive:e.caseSensitive??!1,end:e.end??!0},[r,i]=((e,t,n)=>{let r=[],i=`^${e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:void 0!==n}),void 0===n)return"/([^\\/]+)";let o=a.charAt(i+e.length);return o&&"/"!==o?"/([^\\/]*)":"(?:/([^\\/]*))?"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2")}`;return e.endsWith("*")?(r.push({paramName:"*",isOptional:!1}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]})(n.path,n.caseSensitive,n.end),a=t.match(r);if(!a)return null;let o=a[0],s=a.slice(1),l=o.replace(/(.)\/+$/,"$1");return{params:i.reduce((e,{paramName:t,isOptional:n},r)=>{let i=s[r];if("*"===t){let e=i??"";l=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}return n&&!i?(e[t]=void 0,e):(e[t]=(i??"").replace(/%2F/g,"/"),e)},{}),pathname:o,pathnameBase:l,pattern:n}})({path:e.path,end:"*"!==e.path},t);n&&r.push({matchResult:n,path:e,pageId:e.pageId})});let i=r.find(({path:{accessLevel:e}})=>"authenticated"===e&&n||"public"===e&&!n||!e);if(i||=r.find(({path:{accessLevel:e}})=>"authenticated"===e&&!n||"public"===e&&n),!i&&e.find(e=>"/"===e.path&&e.hasAccess))return{action:{type:"redirect",path:"/"},pathMatch:void 0};if(!i)return{action:{type:"notFound",path:void 0},pathMatch:void 0};let{pageId:a,matchResult:o,path:{hasAccess:s,unauthorizedBehaviour:l,unauthorizedPageRedirect:c}}=i;return!s&&"redirect"===l&&c?{action:{type:"redirect",path:c},pathMatch:void 0}:s?{action:{type:"normal",path:void 0},pathMatch:o,pageId:a}:{action:{type:"accessDenied",path:void 0},pathMatch:void 0}},Ph=e=>e&&"string"==typeof e?(e.match(/:[a-zA-Z0-9-_:*]+/gim)||[]).map(e=>e.replace(":","")):[],Rh=e=>`rsc.data.${e}`,Mh=()=>typeof window>"u"?"":`${window.location.pathname}${window.location.search}`,Lh=async(e,t,n,r)=>{let{enabled:i,endpoint:a}=e.get("rsc")??{};if(!i||!a||typeof window>"u")return;let o=r??Mh(),s=e.get("schema"),l=e.get("runtime.sources.auth"),c=r?((e,t,n)=>{if(!e)return;let r=e.pages.reduce((t,n)=>(n in e.flat&&(t[n]=e.flat[n]),t),{});return Dh(_h(r,e.pageFolders,n),t.split("?")[0],n).pageId})(s,r,!!l?.details):e.get("navigation.currentPageId");if(s&&((e,t)=>((e,t)=>{if(void 0===t)return[];let n,r=[],i=/* @__PURE__ */new Set,a=[t];for(;a.length>0;){let t=a.pop();if(void 0===t||i.has(t))continue;i.add(t);let o=e.flat[t];if(!o)continue;"server"===o.definition.runtime&&(!n||n.has(o.id))&&r.push(o);let{items:s}=o.definition;s&&a.push(...s)}return r})(e,t).length>0)(s,c))try{let r=new URLSearchParams({location:o});t?.length&&r.set("ids",t.join(",")),Object.entries(n??{}).forEach(([e,t])=>r.set(e,t));let i=await fetch(`${a}?${r.toString()}`,{headers:{Accept:"application/json"}});if(!i.ok){let t=It(i.status,await i.json().catch(()=>{}));return t&&Ct({reason:t,url:a}),void e.set("rsc.stale",!0)}let{serverData:s}=await i.json();e.batch(()=>{t?.length?Object.entries(s??{}).forEach(([t,n])=>e.set(Rh(t),n)):e.set("rsc.data",s??{}),e.set("rsc.loaded",!0),e.set("rsc.stale",!1),e.set("rsc.location",o)})}catch{e.set("rsc.stale",!0)}},jh=()=>{let e=k();return he((t,n)=>Lh(e,t,n),[e])},Fh=e=>(e=>{let{key:t,storage:n,paths:r,partialize:i,version:a=0,migrate:o,merge:s,enabled:l}=e,c="function"==typeof n?n:void 0,u="function"==typeof n?void 0:qe(n);if(!c&&!u)return()=>{};let d=e=>{if(!c)return u;let t=c(e);return t?qe(t):void 0},p=e=>{if(r){let t={};for(let n of r)t[n]=I(e,n);return t}return i?i(e):e};return e=>{if(O(l,e.getState()))return;let n=!1,i=()=>{if(n)return;let i=d(e.getState());i&&(n=!0,function(e,t,n,r,i,a,o){let s=n?.getItem(t);if(s)try{let t=JSON.parse(s),n=t.version!==r;if(n&&!a)return;let l=n&&a?a(t.state,t.version):t.state;if(i){let t=l;return void e.batch(()=>{for(let n of i)n in t&&e.setState(n,t[n])})}let c=l;e.setState(void 0,o?o(c,e.getState()):c)}catch{n?.removeItem(t)}}(e,t,i,a,r,o,s))};return{hydrate:i,onChange:n=>{i(),(e=>!r||r.some(t=>Re(e,t)))(n.path)&&(e=>{let n=e.getState(),r=d(n);if(!r)return;let i={version:a,state:p(n)};r.setItem(t,JSON.stringify(i))})(e)}}}})({key:`plitzi_${e}_state`,paths:["runtime.state"],storage:({schema:e,render:t})=>{if(t?.isHydrating&&!t.hydrated)return!1;let n=e?.settings;return!!n?.keepState&&("sessionStorage"===n.stateStorage?"session":"local")}}),$h=/* @__PURE__ */e({ComponentHelper_exports:()=>Vh,getPlugins:()=>qh,nestedInject:()=>Uh,processLocalCustomPlugins:()=>Hh,processLocalPlugins:()=>Bh}),Vh=/* @__PURE__ */_e({getPlugins:()=>qh,nestedInject:()=>Uh,processLocalCustomPlugins:()=>Hh,processLocalPlugins:()=>Bh}),qh=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,qh(n[e]))}),t},Bh=e=>{let t={};return e&&Object.values(e).forEach(e=>{e.type&&Object.assign(t,qh(e))}),t},Uh=(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]=K(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=Uh(l,t)}),n},Hh=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=K(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=Uh(o,"local-custom"),Object.assign(t,qh(u))}),t},Wh=()=>{let e=pe(r);if(void 0===e)throw Error("Element data not found. Make sure the element is rendered under withElement.");return e},Gh=()=>{let{id:e}=Wh(),[[t=!1,n=!1,r=!1,i,a]]=c(["rsc.enabled","rsc.loaded","rsc.stale","rsc.location",Rh(e)]);return{enabled:t,loaded:n,stale:r,location:i,elementData:a??null,isServerElement:void 0!==a,refresh:jh()}},Jh=({tag:e="div",refProp:t,style:n,className:r,otherProps:i,params:a,serverMarker:o,testMarker:s,events:l,children:c})=>""===e?c:le(e,{ref:t,style:n,className:r,...i,...a,...l,...o,...s},c),Kh={text:"text",textarea:"textarea",select:"select",boolean:"boolean",number:"text",scalar:"text"},Qh=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[-_\s]+/).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(" "),Yh=(e,t)=>({type:t.builderType??Kh[t.type],label:t.label??Qh(e),...void 0===t.default?{}:{defaultValue:t.default},...t.options?{options:t.options.map(e=>({value:e,label:t.optionLabels?.[e]??Qh(e)}))}:{},...t.when?{when:t.when}:{},...void 0===t.canBind?{}:{canBind:t.canBind}}),Xh=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Yh(e,t)])),Zh=(e,t,n,r={})=>({action:e,title:t.title,type:t.type??"globalCallback",callback:n,preview:t.preview??{},params:Xh(t.params),...r}),ef=(e,t,n={})=>Object.fromEntries(Object.keys(e).map(r=>[r,Zh(r,e[r],t[r],n[r]??{})])),tf={title:"Update Element (set attribute / state)",type:"callback",strictParams:!0,params:{category:{type:"select",description:'What to change on the element: "attribute" sets one of its props (the common case — e.g. content, disabled); "state" sets element state (visibility or a style selector). REQUIRED — always set it.',default:"attribute",options:["attribute","state"],required:!0},key:{type:"text",description:'The field to set. When category="attribute", an attribute/prop key of THIS element (e.g. "content", "disabled"). When category="state", "visibility" or "styleSelectors.<selector>". REQUIRED.',required:!0},value:{type:"scalar",description:'The value to set — its type follows the target attribute: a real boolean (true/false) for a boolean attribute, a number for a numeric one, otherwise a string (the strings "true"/"false" also coerce). There is NO separate `type` param (that belongs to the global state setState, not this one). REQUIRED.',when:e=>!!e.category,required:!0},revertOnFinish:{type:"boolean",description:'When true, this change is UNDONE automatically when the whole flow finishes. Use it for a TEMPORARY change (a "loading…" label, disabling a button while it works) instead of adding manual restore steps at the end of the flow.',default:!1,label:"Revert changes after interaction"}}},nf={title:"Toggle Element (flip attribute / state)",type:"callback",strictParams:!0,params:{category:{type:"select",description:'What to flip on the element: "attribute" flips one of its props (e.g. disabled); "state" flips element state ("visibility", or "styleSelectors.<selector>" for an expanded/collapsed look). REQUIRED.',default:"state",options:["attribute","state"],required:!0},key:{type:"text",description:'The field to flip. When category="attribute", an attribute/prop key of THIS element. When category="state", "visibility" or "styleSelectors.<selector>". Anything not already true counts as false, so a field that has never been set flips ON first. REQUIRED.',required:!0},revertOnFinish:{type:"boolean",description:"When true, the flip is UNDONE automatically when the whole flow finishes — a change that lasts only as long as the flow does.",default:!1,label:"Revert changes after interaction"}}},rf=(e,t)=>n=>{let{category:r}=n;return"attribute"===r?Object.keys(e).map(e=>({value:e,label:e})):"state"===r?[{value:"visibility",label:"Visibility"},...Object.keys(t.styleSelectors).map(e=>({value:`styleSelectors.${e}`,label:`Selector - ${e}`}))]:[]},af=e=>{if("string"!=typeof e)return e;let t=e.toLowerCase();return"true"===t||"false"===t||"yes"===t||"no"===t?"true"===t||"yes"===t:e},of={onLoad:{action:"onLoad",title:"On Load",type:"trigger",preview:{},params:{}},onClick:{action:"onClick",title:"On Click",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onMouseEnter:{action:"onMouseEnter",title:"On Mouse Enter",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onMouseLeave:{action:"onMouseLeave",title:"On Mouse Leave",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onHover:{action:"onHover",title:"On Hover",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onFocus:{action:"onFocus",title:"On Focus",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onBlur:{action:"onBlur",title:"On Blur",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onFlowEnd:{action:"onFlowEnd",title:"On Server Action End",type:"trigger",preview:{actionId:"",runId:"",status:"",output:{}},params:{}},onFlowError:{action:"onFlowError",title:"On Server Action Error",type:"trigger",preview:{actionId:"",runId:"",error:"",reason:""},params:{}},onFlowProgress:{action:"onFlowProgress",title:"On Server Action Progress",type:"trigger",preview:{actionId:"",runId:"",chunk:""},params:{}}},sf=["onClick","onHover","onFocus","onBlur","onMouseEnter","onMouseLeave"],lf=({elementContext:e,InteractionsContext:t,previewMode:n,debugMode:r,baseElementId:i,className:a,interactionTriggers:o,interactionCallbacks:s,otherProps:l})=>{let{id:u,className:d,attributes:p,definition:h,definition:{interactions:f},plitziElementLayout:m,elementState:g,setElementState:y}=e,{interactionsManager:v,useInteractions:k}=pe(t),w=he((e,t,n,r,i=!1)=>{i||e.preventDefault(),r&&r(e),v.interactionTrigger(t,n,{event:e})},[v]),S=ve(()=>n&&f?Object.values(f).filter(e=>"trigger"===e.type&&e.action&&sf.includes(e.action)&&e.enabled).reduce((e,t)=>{let n=$(t,"params.propagateEvent",!1);return{...e,[t.action]:e=>w(e,u,t.action,l[t.action],n)}},{}):{},[u,f,l,n,w]),N=r||!(!f||!Object.keys(f).length),[T=_]=c("runtime.sources",{enabled:N}),C=ke({});C.current=T;let E=he(()=>({dataSource:C.current}),[C]),I=ve(()=>({...of,...o}),[o]),O=(({attributes:e,definition:t,setElementState:n})=>{let r=he((e,t)=>{let r,i;return n(n=>(r=n,i=J(n,r=>b(r,e,t($(n,e)))),i)),{prevState:r,nextState:i}},[n]),i=he(e=>{if(!e.key||void 0===e.value)return{prevState:void 0,nextState:void 0};let{key:t}=e,n=af(e.value);return r(t,()=>n)},[r]),a=he(e=>{if(!e.key)return{prevState:void 0,nextState:void 0};let{key:t}=e;return r(t,e=>!0!==af(e))},[r]),o=he((e,t)=>{let r=t?.prevState;e.revertOnFinish&&r&&n(r)},[n]);return ve(()=>((e,t,n,r,i)=>{let a=tf,o=Xh(a.params),s=nf,l=Xh(s.params),c={type:"select",options:rf(e,t),when:e=>"attribute"===e.category||"state"===e.category};return{setState:Zh("setState",a,n,{title:`Update ${t.label}`,postCallback:r,params:{...o,key:{...o.key,...c},value:{...o.value,type:t=>"boolean"==typeof e[t.key]?"select":"text",options:t=>{let{key:n}=t;return"boolean"==typeof e[n]?[{value:"true",label:"True"},{value:"false",label:"False"}]:Object.keys(e).map(e=>({value:e,label:e}))}}}}),toggleState:Zh("toggleState",s,i,{title:`Toggle ${t.label}`,postCallback:r,params:{...l,key:{...l.key,...c}}})}})(e,t,i,o,a),[e,t,i,o,a])})({attributes:p,definition:h,setElementState:y});k({id:u,interactions:f,triggers:I,callbacks:ve(()=>({...s,...O}),[s,O]),getAdditionalParams:E}),me(()=>{n&&f&&Object.keys(f).length&&v.interactionTrigger(u,"onLoad",{})},[]),me(()=>{if(r)return Gp.addProviderMethod(`getElementDataSource-${u}`,()=>C.current),()=>{Gp.removeProviderMethod(`getElementDataSource-${u}`)}},[r,C,u]);let z=(({id:e,className:t,previewMode:n,baseElementId:r,plitziElementLayout:i,definition:a,elementState:o})=>{let{items:s}=a,l=x(o.visibility);return ve(()=>vt(t,{"plitzi-component--hidden":!l,"plitzi-component":!n&&!i,"plitzi-component--layout":!n&&!!i,with__container:!n&&!!s,"container--empty":!n&&!!s&&0===s.length&&!i,"container--base-element":!n&&!!s&&r===e,"plitzi-component--layout-body":i&&e===i.containerId},a.styleSelectors.base),[t,l,n,i,s,r,e,a.styleSelectors.base])})({id:u,className:a,previewMode:n,baseElementId:i,definition:h,elementState:g,plitziElementLayout:m});return{className:vt(d,z),events:S}},cf=({ref:e,children:t,tag:n="div",className:r="",interactionTriggers:i,interactionCallbacks:a,style:o,...s})=>{let l=ve(()=>((e="")=>{if(e)return"object"==typeof e?e:Object.fromEntries(e.split(";").map(e=>e.trim()).filter(Boolean).map(e=>{let[t,n]=e.split(":").map(e=>e.trim());return[t.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),n]}))})(o),[o]),c=Wh(),u=U(),d=u.settings.previewMode??!0,p=!!u.settings.debugMode;if(c.plitziJsxSkipHOC)return Jh({tag:n,refProp:e,style:l,className:r,otherProps:s,children:t});let{root:{baseElementId:h},contexts:f}=u,m=f.InteractionsContext,{id:g,rootId:y,style:b,definition:{type:v,label:x,runtime:k}}=c,w="server"===k?{"data-rsc-id":g}:void 0,S=!1===u.settings.testAttributes?void 0:{"data-plitzi-el":g},N=p||!d&&v&&y===h?{"data-id":g,"data-name":x||v||"unknown","data-root-id":y,"data-type":v||"unknown","data-root-render-element":!0}:{};if(!m)return Jh({tag:n,refProp:e,style:{...b,...l},className:r,otherProps:s,params:N,serverMarker:w,testMarker:S,children:t});let{className:T,events:C}=lf({elementContext:c,InteractionsContext:m,previewMode:d,debugMode:p,baseElementId:h,className:r,interactionTriggers:i,interactionCallbacks:a,otherProps:s});return Jh({tag:n,refProp:e,style:{...b,...l},className:T,otherProps:s,params:N,serverMarker:w,testMarker:S,events:C,children:t})},uf=/* @__PURE__ */e({NotFound:()=>df,default:()=>pf}),df=({ref:e,className:t=""})=>{let{definition:{label:n}}=Wh(),{settings:{isHydrating:r,previewMode:i}}=U();if(!(typeof window>"u"||i||r))/* @__PURE__ */return Ee(cf,{ref:e,className:vt("plitzi-component__not-found",t),children:/* @__PURE__ */Ie("span",{children:[n&&/* @__PURE__ */Ie(Ce,{children:["Component ",
|
|
189
|
-
/* @__PURE__ */Ee("b",{children:n})," Not Found"]}),!n&&"Component Not Found"]})})},pf=K(df),hf=de(({plitziJsxSkipHOC:e=!0,as:t="",internalProps:n,children:r,...i})=>{let{contexts:{PluginsContext:a}}=U(),{components:o}=pe(
|
|
188
|
+
`},ph=se({});ph.displayName="SegmentsContext";var hh="theme",fh=["dark","light"],mh=[...fh,"system"],gh=e=>mh.includes(e),yh=(e="theme")=>f({mode:"system",scheme:"light",areas:{}},{id:e}),bh=yh(),vh=(e,t)=>"system"===e?t:e,xh=(e,t=bh)=>{t.batch(()=>{t.setState("mode",e),t.setState("areas",{})})},kh=(e,t=bh)=>{t.setState("scheme",e)},wh=se(void 0),Sh="(prefers-color-scheme: dark)",Nh=({state:e})=>(v(["theme.mode","theme.resolved","theme.areas"],[e.mode,vh(e.mode,e.scheme),e.areas]),null),Th=({defaultTheme:e="system",theme:t,scope:n="document",cookieName:r=hh,children:i})=>{let a="container"===n,o=ge(),[s]=we(()=>a?yh(`theme${o}`):void 0),l=s??bh;T(()=>{let n=a?void 0:((e=hh)=>{try{return((e,t=hh)=>{if(e)for(let n of e.split(";")){let e=n.indexOf("=");if(e>-1&&n.slice(0,e).trim()===t){let t=decodeURIComponent(n.slice(e+1).trim());return gh(t)?t:void 0}}})(document.cookie,e)}catch{return}})(r);l.batch(()=>{kh(window.matchMedia(Sh).matches?"dark":"light",l),xh(t??n??e,l)})},[e,t,r,a,l]);let c=Se(l.subscribe,l.getState,l.getState),d=void 0!==pe(u);me(()=>{let e=window.matchMedia(Sh),t=()=>kh(e.matches?"dark":"light",l);return e.addEventListener("change",t),t(),()=>e.removeEventListener("change",t)},[l]),me(()=>{if(a)return;let e=()=>{let{mode:e}=l.getState();((e,t=hh)=>{try{document.cookie=`${t}=${encodeURIComponent(e)};path=/;max-age=31536000;SameSite=Lax`}catch{}})(e,r),((e,t)=>{for(let n of fh)t.classList.toggle(n,e===n)})(e,document.documentElement)};return e(),l.subscribe(e)},[r,a,l]);let p=d?/* @__PURE__ */Ee(Nh,{state:c}):null;return a?/* @__PURE__ */Ie(wh,{value:s,children:[p,i]}):/* @__PURE__ */Ie(Ce,{children:[p,i]})},Ch=e=>{let t=pe(wh)??bh,n=Se(t.subscribe,t.getState,t.getState),r=((e,t)=>(t?e.areas[t]:void 0)??e.mode)(n,e),i=vh(r,n.scheme),a=he(n=>e?((e,t,n=bh)=>{n.setState(`areas.${e}`,t)})(e,n,t):xh(n,t),[e,t]),o=he(()=>a("dark"===i?"light":"dark"),[i,a]);return ve(()=>({theme:r,resolvedTheme:i,setTheme:a,toggleTheme:o}),[r,i,a,o])},Eh=e=>/^https?:\/\//i.test(e),Ih=e=>e.replace(/{{([a-zA-Z0-9-_:*/]+)}}/i,":$1").replaceAll(/[/]+/gim,"/"),Oh=(e,t)=>{if(!t||!e[t])return"";let{slug:n,parentId:r}=e[t];return r?`${Oh(e,r)}/${n}`:n};function zh(e,t,n,r=!1){let{slug:i="",folder:a,default:o}=e[n]?.attributes??{slug:n,folder:"",default:!1};if(o&&!r)return{"/":n,[`/${n}`]:n};if(o&&r)return"/";if(!a&&!r)return{[Ih(`/${i}`)]:n,[`/${n}`]:n};if(!a&&r)return`/${i}`;if(!t.find(e=>e.id===a))return r?`/${i}`:{[Ih(`/${i}`)]:n,[`/${n}`]:n};let s=[Oh(t.reduce((e,t)=>({...e,[t.id]:t}),{}),a),i||n].filter(Boolean).join("/");return r?`/${s}`:{[`/${s}`]:n,[`/${n}`]:n}}var Ah=(e,t,n=!0)=>!(e&&n&&void 0!==t&&(!t||"authenticated"!==e)&&(t||"public"!==e)&&(t&&"public"===e||e)),_h=(e={},t=[],n,r="",i=!0,a=!0)=>{let o=Object.keys(e).reduce((a,o)=>{let{attributes:{accessLevel:s,enabled:l=!0,unauthorizedBehaviour:c}}=e[o],u=e[o].attributes.unauthorizedPageRedirect;if(!l&&i)return a;u&&=(e=>Eh(e)||e.includes("{{"))(u)?u:zh(e,t,u.replace("/",""),!0);let d=zh(e,t,o),p=Object.keys(d).map(e=>({pageId:o,path:`${r}${e}`.replaceAll("//","/"),accessLevel:s,enabled:l,isRaw:`/${o}`===e,unauthorizedBehaviour:c,unauthorizedPageRedirect:u,hasAccess:Ah(s,n,i)}));return[...a,...p]},[]).filter(e=>"*"!==e.path||e.hasAccess).sort((e,t)=>e.path===t.path?"authenticated"===e.accessLevel?-1:1:e.path>t.path?-1:1);if(!o.find(e=>"*"===e.path)&&!a){let e=o.find(e=>"/"===e.path&&e.hasAccess);e&&"redirect"===e.unauthorizedBehaviour&&e.unauthorizedPageRedirect&&o.push({...e,path:"*",hasAccess:!1,isRaw:!0,unauthorizedBehaviour:"redirect",unauthorizedPageRedirect:"/"})}return o},Dh=(e,t,n)=>{if(!t)return{action:{type:"accessDenied",path:void 0},pathMatch:void 0};let r=[];e.forEach(e=>{let n=((e,t)=>{let n="string"==typeof e?{path:e,caseSensitive:!1,end:!0}:{path:e.path,caseSensitive:e.caseSensitive??!1,end:e.end??!0},[r,i]=((e,t,n)=>{let r=[],i=`^${e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:void 0!==n}),void 0===n)return"/([^\\/]+)";let o=a.charAt(i+e.length);return o&&"/"!==o?"/([^\\/]*)":"(?:/([^\\/]*))?"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2")}`;return e.endsWith("*")?(r.push({paramName:"*",isOptional:!1}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]})(n.path,n.caseSensitive,n.end),a=t.match(r);if(!a)return null;let o=a[0],s=a.slice(1),l=o.replace(/(.)\/+$/,"$1");return{params:i.reduce((e,{paramName:t,isOptional:n},r)=>{let i=s[r];if("*"===t){let e=i??"";l=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}return n&&!i?(e[t]=void 0,e):(e[t]=(i??"").replace(/%2F/g,"/"),e)},{}),pathname:o,pathnameBase:l,pattern:n}})({path:e.path,end:"*"!==e.path},t);n&&r.push({matchResult:n,path:e,pageId:e.pageId})});let i=r.find(({path:{accessLevel:e}})=>"authenticated"===e&&n||"public"===e&&!n||!e);if(i||=r.find(({path:{accessLevel:e}})=>"authenticated"===e&&!n||"public"===e&&n),!i&&e.find(e=>"/"===e.path&&e.hasAccess))return{action:{type:"redirect",path:"/"},pathMatch:void 0};if(!i)return{action:{type:"notFound",path:void 0},pathMatch:void 0};let{pageId:a,matchResult:o,path:{hasAccess:s,unauthorizedBehaviour:l,unauthorizedPageRedirect:c}}=i;return!s&&"redirect"===l&&c?{action:{type:"redirect",path:c},pathMatch:void 0}:s?{action:{type:"normal",path:void 0},pathMatch:o,pageId:a}:{action:{type:"accessDenied",path:void 0},pathMatch:void 0}},Ph=e=>e&&"string"==typeof e?(e.match(/:[a-zA-Z0-9-_:*]+/gim)||[]).map(e=>e.replace(":","")):[],Rh=e=>`rsc.data.${e}`,Mh=()=>typeof window>"u"?"":`${window.location.pathname}${window.location.search}`,Lh=async(e,t,n,r)=>{let{enabled:i,endpoint:a}=e.get("rsc")??{};if(!i||!a||typeof window>"u")return;let o=r??Mh(),s=e.get("schema"),l=e.get("runtime.sources.auth"),c=r?((e,t,n)=>{if(!e)return;let r=e.pages.reduce((t,n)=>(n in e.flat&&(t[n]=e.flat[n]),t),{});return Dh(_h(r,e.pageFolders,n),t.split("?")[0],n).pageId})(s,r,!!l?.details):e.get("navigation.currentPageId");if(s&&((e,t)=>((e,t)=>{if(void 0===t)return[];let n,r=[],i=/* @__PURE__ */new Set,a=[t];for(;a.length>0;){let t=a.pop();if(void 0===t||i.has(t))continue;i.add(t);let o=e.flat[t];if(!o)continue;"server"===o.definition.runtime&&(!n||n.has(o.id))&&r.push(o);let{items:s}=o.definition;s&&a.push(...s)}return r})(e,t).length>0)(s,c))try{let r=new URLSearchParams({location:o});t?.length&&r.set("ids",t.join(",")),Object.entries(n??{}).forEach(([e,t])=>r.set(e,t));let i=await fetch(`${a}?${r.toString()}`,{headers:{Accept:"application/json"}});if(!i.ok){let t=It(i.status,await i.json().catch(()=>{}));return t&&Ct({reason:t,url:a}),void e.set("rsc.stale",!0)}let{serverData:s}=await i.json();e.batch(()=>{t?.length?Object.entries(s??{}).forEach(([t,n])=>e.set(Rh(t),n)):e.set("rsc.data",s??{}),e.set("rsc.loaded",!0),e.set("rsc.stale",!1),e.set("rsc.location",o)})}catch{e.set("rsc.stale",!0)}},jh=()=>{let e=k();return he((t,n)=>Lh(e,t,n),[e])},Fh=e=>(e=>{let{key:t,storage:n,paths:r,partialize:i,version:a=0,migrate:o,merge:s,enabled:l}=e,c="function"==typeof n?n:void 0,u="function"==typeof n?void 0:qe(n);if(!c&&!u)return()=>{};let d=e=>{if(!c)return u;let t=c(e);return t?qe(t):void 0},p=e=>{if(r){let t={};for(let n of r)t[n]=I(e,n);return t}return i?i(e):e};return e=>{if(O(l,e.getState()))return;let n=!1,i=()=>{if(n)return;let i=d(e.getState());i&&(n=!0,function(e,t,n,r,i,a,o){let s=n?.getItem(t);if(s)try{let t=JSON.parse(s),n=t.version!==r;if(n&&!a)return;let l=n&&a?a(t.state,t.version):t.state;if(i){let t=l;return void e.batch(()=>{for(let n of i)n in t&&e.setState(n,t[n])})}let c=l;e.setState(void 0,o?o(c,e.getState()):c)}catch{n?.removeItem(t)}}(e,t,i,a,r,o,s))};return{hydrate:i,onChange:n=>{i(),(e=>!r||r.some(t=>Re(e,t)))(n.path)&&(e=>{let n=e.getState(),r=d(n);if(!r)return;let i={version:a,state:p(n)};r.setItem(t,JSON.stringify(i))})(e)}}}})({key:`plitzi_${e}_state`,paths:["runtime.state"],storage:({schema:e,render:t})=>{if(t?.isHydrating&&!t.hydrated)return!1;let n=e?.settings;return!!n?.keepState&&("sessionStorage"===n.stateStorage?"session":"local")}}),$h=/* @__PURE__ */e({ComponentHelper_exports:()=>Vh,getPlugins:()=>qh,nestedInject:()=>Uh,processLocalCustomPlugins:()=>Hh,processLocalPlugins:()=>Bh}),Vh=/* @__PURE__ */_e({getPlugins:()=>qh,nestedInject:()=>Uh,processLocalCustomPlugins:()=>Hh,processLocalPlugins:()=>Bh}),qh=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,qh(n[e]))}),t},Bh=e=>{let t={};return e&&Object.values(e).forEach(e=>{e.type&&Object.assign(t,qh(e))}),t},Uh=(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]=K(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=Uh(l,t)}),n},Hh=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=K(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=Uh(o,"local-custom"),Object.assign(t,qh(u))}),t},Wh=()=>{let e=pe(r);if(void 0===e)throw Error("Element data not found. Make sure the element is rendered under withElement.");return e},Gh=()=>{let{id:e}=Wh(),[[t=!1,n=!1,r=!1,i,a]]=c(["rsc.enabled","rsc.loaded","rsc.stale","rsc.location",Rh(e)]);return{enabled:t,loaded:n,stale:r,location:i,elementData:a??null,isServerElement:void 0!==a,refresh:jh()}},Jh=({tag:e="div",refProp:t,style:n,className:r,otherProps:i,params:a,serverMarker:o,testMarker:s,events:l,children:c})=>""===e?c:le(e,{ref:t,style:n,className:r,...i,...a,...l,...o,...s},c),Kh={text:"text",textarea:"textarea",select:"select",boolean:"boolean",number:"text",scalar:"text"},Qh=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[-_\s]+/).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(" "),Yh=(e,t)=>({type:t.builderType??Kh[t.type],label:t.label??Qh(e),...void 0===t.default?{}:{defaultValue:t.default},...t.options?{options:t.options.map(e=>({value:e,label:t.optionLabels?.[e]??Qh(e)}))}:{},...t.when?{when:t.when}:{},...void 0===t.canBind?{}:{canBind:t.canBind}}),Xh=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Yh(e,t)])),Zh=(e,t,n,r={})=>({action:e,title:t.title,type:t.type??"globalCallback",callback:n,preview:t.preview??{},params:Xh(t.params),...r}),ef=(e,t,n={})=>Object.fromEntries(Object.keys(e).map(r=>[r,Zh(r,e[r],t[r],n[r]??{})])),tf={title:"Update Element (set attribute / state)",type:"callback",strictParams:!0,params:{category:{type:"select",description:'What to change on the element: "attribute" sets one of its props (the common case — e.g. content, disabled); "state" sets element state (visibility or a style selector). REQUIRED — always set it.',default:"attribute",options:["attribute","state"],required:!0},key:{type:"text",description:'The field to set. When category="attribute", an attribute/prop key of THIS element (e.g. "content", "disabled"). When category="state", "visibility" or "styleSelectors.<selector>". REQUIRED.',required:!0},value:{type:"scalar",description:'The value to set — its type follows the target attribute: a real boolean (true/false) for a boolean attribute, a number for a numeric one, otherwise a string (the strings "true"/"false" also coerce). There is NO separate `type` param (that belongs to the global state setState, not this one). REQUIRED.',when:e=>!!e.category,required:!0},revertOnFinish:{type:"boolean",description:'When true, this change is UNDONE automatically when the whole flow finishes. Use it for a TEMPORARY change (a "loading…" label, disabling a button while it works) instead of adding manual restore steps at the end of the flow.',default:!1,label:"Revert changes after interaction"}}},nf={title:"Toggle Element (flip attribute / state)",type:"callback",strictParams:!0,params:{category:{type:"select",description:'What to flip on the element: "attribute" flips one of its props (e.g. disabled); "state" flips element state ("visibility", or "styleSelectors.<selector>" for an expanded/collapsed look). REQUIRED.',default:"state",options:["attribute","state"],required:!0},key:{type:"text",description:'The field to flip. When category="attribute", an attribute/prop key of THIS element. When category="state", "visibility" or "styleSelectors.<selector>". Anything not already true counts as false, so a field that has never been set flips ON first. REQUIRED.',required:!0},revertOnFinish:{type:"boolean",description:"When true, the flip is UNDONE automatically when the whole flow finishes — a change that lasts only as long as the flow does.",default:!1,label:"Revert changes after interaction"}}},rf=(e,t)=>n=>{let{category:r}=n;return"attribute"===r?Object.keys(e).map(e=>({value:e,label:e})):"state"===r?[{value:"visibility",label:"Visibility"},...Object.keys(t.styleSelectors).map(e=>({value:`styleSelectors.${e}`,label:`Selector - ${e}`}))]:[]},af=e=>{if("string"!=typeof e)return e;let t=e.toLowerCase();return"true"===t||"false"===t||"yes"===t||"no"===t?"true"===t||"yes"===t:e},of={onLoad:{action:"onLoad",title:"On Load",type:"trigger",preview:{},params:{}},onClick:{action:"onClick",title:"On Click",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onMouseEnter:{action:"onMouseEnter",title:"On Mouse Enter",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onMouseLeave:{action:"onMouseLeave",title:"On Mouse Leave",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onHover:{action:"onHover",title:"On Hover",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onFocus:{action:"onFocus",title:"On Focus",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onBlur:{action:"onBlur",title:"On Blur",type:"trigger",preview:{propagateEvent:""},params:{propagateEvent:{canBind:!1,defaultValue:!1,type:"boolean",label:"Propagate Event"}}},onFlowEnd:{action:"onFlowEnd",title:"On Server Action End",type:"trigger",preview:{actionId:"",runId:"",status:"",output:{}},params:{}},onFlowError:{action:"onFlowError",title:"On Server Action Error",type:"trigger",preview:{actionId:"",runId:"",error:"",reason:""},params:{}},onFlowProgress:{action:"onFlowProgress",title:"On Server Action Progress",type:"trigger",preview:{actionId:"",runId:"",chunk:""},params:{}}},sf=["onClick","onHover","onFocus","onBlur","onMouseEnter","onMouseLeave"],lf=({elementContext:e,InteractionsContext:t,previewMode:n,debugMode:r,baseElementId:i,className:a,interactionTriggers:o,interactionCallbacks:u,otherProps:d})=>{let{id:p,className:h,attributes:f,definition:m,definition:{interactions:g},plitziElementLayout:y,elementState:b,setElementState:v}=e,{interactionsManager:k,useInteractions:w}=pe(t),S=he((e,t,n,r,i=!1)=>{i||e.preventDefault(),r&&r(e),k.interactionTrigger(t,n,{event:e})},[k]),N=ve(()=>n&&g?Object.values(g).filter(e=>"trigger"===e.type&&e.action&&sf.includes(e.action)&&e.enabled).reduce((e,t)=>{let n=s(t,"params.propagateEvent",!1);return{...e,[t.action]:e=>S(e,p,t.action,d[t.action],n)}},{}):{},[p,g,d,n,S]),T=r||!(!g||!Object.keys(g).length),[C=Y]=c("runtime.sources",{enabled:T}),E=ke({});E.current=C;let I=he(()=>({dataSource:E.current}),[E]),O=ve(()=>({...of,...o}),[o]),z=(({attributes:e,definition:t,setElementState:n})=>{let r=he((e,t)=>{let r,i;return n(n=>(r=n,i=J(n,r=>l(r,e,t(s(n,e)))),i)),{prevState:r,nextState:i}},[n]),i=he(e=>{if(!e.key||void 0===e.value)return{prevState:void 0,nextState:void 0};let{key:t}=e,n=af(e.value);return r(t,()=>n)},[r]),a=he(e=>{if(!e.key)return{prevState:void 0,nextState:void 0};let{key:t}=e;return r(t,e=>!0!==af(e))},[r]),o=he((e,t)=>{let r=t?.prevState;e.revertOnFinish&&r&&n(r)},[n]);return ve(()=>((e,t,n,r,i)=>{let a=tf,o=Xh(a.params),s=nf,l=Xh(s.params),c={type:"select",options:rf(e,t),when:e=>"attribute"===e.category||"state"===e.category};return{setState:Zh("setState",a,n,{title:`Update ${t.label}`,postCallback:r,params:{...o,key:{...o.key,...c},value:{...o.value,type:t=>"boolean"==typeof e[t.key]?"select":"text",options:t=>{let{key:n}=t;return"boolean"==typeof e[n]?[{value:"true",label:"True"},{value:"false",label:"False"}]:Object.keys(e).map(e=>({value:e,label:e}))}}}}),toggleState:Zh("toggleState",s,i,{title:`Toggle ${t.label}`,postCallback:r,params:{...l,key:{...l.key,...c}}})}})(e,t,i,o,a),[e,t,i,o,a])})({attributes:f,definition:m,setElementState:v});w({id:p,interactions:g,triggers:O,callbacks:ve(()=>({...u,...z}),[u,z]),getAdditionalParams:I}),me(()=>{n&&g&&Object.keys(g).length&&k.interactionTrigger(p,"onLoad",{})},[]),me(()=>{if(r)return Gp.addProviderMethod(`getElementDataSource-${p}`,()=>E.current),()=>{Gp.removeProviderMethod(`getElementDataSource-${p}`)}},[r,E,p]);let A=(({id:e,className:t,previewMode:n,baseElementId:r,plitziElementLayout:i,definition:a,elementState:o})=>{let{items:s}=a,l=x(o.visibility);return ve(()=>vt(t,{"plitzi-component--hidden":!l,"plitzi-component":!n&&!i,"plitzi-component--layout":!n&&!!i,with__container:!n&&!!s,"container--empty":!n&&!!s&&0===s.length&&!i,"container--base-element":!n&&!!s&&r===e,"plitzi-component--layout-body":i&&e===i.containerId},a.styleSelectors.base),[t,l,n,i,s,r,e,a.styleSelectors.base])})({id:p,className:a,previewMode:n,baseElementId:i,definition:m,elementState:b,plitziElementLayout:y});return{className:vt(h,A),events:N}},cf=({ref:e,children:t,tag:n="div",className:r="",interactionTriggers:i,interactionCallbacks:a,style:o,...s})=>{let l=ve(()=>((e="")=>{if(e)return"object"==typeof e?e:Object.fromEntries(e.split(";").map(e=>e.trim()).filter(Boolean).map(e=>{let[t,n]=e.split(":").map(e=>e.trim());return[t.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),n]}))})(o),[o]),c=Wh(),u=U(),d=u.settings.previewMode??!0,p=!!u.settings.debugMode;if(c.plitziJsxSkipHOC)return Jh({tag:n,refProp:e,style:l,className:r,otherProps:s,children:t});let{root:{baseElementId:h},contexts:f}=u,m=f.InteractionsContext,{id:g,rootId:y,style:b,definition:{type:v,label:x,runtime:k}}=c,w="server"===k?{"data-rsc-id":g}:void 0,S=!1===u.settings.testAttributes?void 0:{"data-plitzi-el":g},N=p||!d&&v&&y===h?{"data-id":g,"data-name":x||v||"unknown","data-root-id":y,"data-type":v||"unknown","data-root-render-element":!0}:{};if(!m)return Jh({tag:n,refProp:e,style:{...b,...l},className:r,otherProps:s,params:N,serverMarker:w,testMarker:S,children:t});let{className:T,events:C}=lf({elementContext:c,InteractionsContext:m,previewMode:d,debugMode:p,baseElementId:h,className:r,interactionTriggers:i,interactionCallbacks:a,otherProps:s});return Jh({tag:n,refProp:e,style:{...b,...l},className:T,otherProps:s,params:N,serverMarker:w,testMarker:S,events:C,children:t})},uf=/* @__PURE__ */e({NotFound:()=>df,default:()=>pf}),df=({ref:e,className:t=""})=>{let{definition:{label:n}}=Wh(),{settings:{isHydrating:r,previewMode:i}}=U();if(!(typeof window>"u"||i||r))/* @__PURE__ */return Ee(cf,{ref:e,className:vt("plitzi-component__not-found",t),children:/* @__PURE__ */Ie("span",{children:[n&&/* @__PURE__ */Ie(Ce,{children:["Component ",
|
|
189
|
+
/* @__PURE__ */Ee("b",{children:n})," Not Found"]}),!n&&"Component Not Found"]})})},pf=K(df),hf=de(({plitziJsxSkipHOC:e=!0,as:t="",internalProps:n,children:r,...i})=>{let{contexts:{PluginsContext:a}}=U(),{components:o}=pe(w),{plugins:s}=pe(a),l=t?o.current[t]:void 0,c=ve(()=>l?void 0:q({type:t,plugins:s}),[l,s,t]);return t?!l&&c?/* @__PURE__ */Ee(L,{internalProps:n,url:c.url,plitziJsxSkipHOC:e,plitziJsxProps:i}):(l||=pf,/* @__PURE__ */Ee(l,{plitziJsxSkipHOC:e,...i,internalProps:n,children:r})):null}),ff=K(({ref:e,content:t="",className:n=""})=>{let{settings:{previewMode:r}}=U(),i=he(e=>new Promise((t,n)=>{if(typeof document>"u")return void n(/* @__PURE__ */Error("Document is not available"));let r=document.createElement("script"),i=e.hasAttribute("src");for(let{name:a,value:o}of e.attributes)r.setAttribute(a,o);i?(r.addEventListener("load",()=>t(r)),r.addEventListener("error",n)):r.textContent=e.innerText,e.replaceWith(r),i||t(r)}),[]),a=he(async e=>{if(!e)return;let t=e.querySelectorAll("script"),n=[],r=[];if(t.forEach(e=>{(e.hasAttribute("async")?r:n).push(()=>i(e))}),t.length){for(let e of r)e();for(let e of n)await e()}},[i]);return me(()=>{let t=e?.current;t&&r&&typeof window<"u"&&typeof document<"u"&&a(t)},[a,r,e]),/* @__PURE__ */Ee(cf,{ref:e,className:vt("plitzi-component__block-html",n,{"block-html--empty":""===t||!t}),dangerouslySetInnerHTML:{__html:t}})}),mf=Object.assign(ff,{type:"blockHtml",content:{attributes:{content:""},definition:{label:"HTML Block",type:"blockHtml",description:"Renders an arbitrary raw HTML string as a block. Escape hatch when no structured element fits.",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:"fa-brands fa-html5"},defaultStyle:{name:"HTML Block",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}}),gf=K(({ref:e,className:t="",props:n="{}",contentCache:r="",...i})=>{let{id:a,rootId:o,plitziElementLayout:s}=Wh(),[l,c]=we(),[u,d]=we(),p=ve(()=>({id:a,rootId:o,plitziElementLayout:s}),[a,s,o]),h=ve(()=>{let e=X(i,["content","children"]);if(!n)return e;if("object"==typeof n)return{...n,...e};if("string"!=typeof n)return e;try{return{...JSON.parse(n),...e}}catch(e){}},[n,i]),f=he(async e=>{let t,n;try{e=`data:text/javascript;base64,${e}`,t=await(import(
|
|
190
190
|
/* @vite-ignore */
|
|
191
191
|
/* webpackIgnore: true */
|
|
192
|
-
e))}catch(e){e instanceof Error&&(n=e.message)}finally{
|
|
192
|
+
e))}catch(e){e instanceof Error&&(n=e.message)}finally{d(n),t&&t.default?c(t):l&&(c(void 0),d("Component not found"))}},[l]);return me(()=>{f(r)},[r,f]),/* @__PURE__ */Ie(cf,{ref:e,className:vt("plitzi-component__block-jsx",t,{"block-jsx--empty":""===r||!r||!l}),children:[!u&&h&&l&&/* @__PURE__ */Ee(l.default,{internalProps:p,...h}),u&&/* @__PURE__ */Ie("div",{children:["JSX Malformed ",u]}),!u&&!h&&/* @__PURE__ */Ee("div",{children:"Settings Malformed"})]})}),yf=Object.assign(gf,{type:"blockJsx",content:{attributes:{content:'import { useCallback } from "react";\nimport { JsxManager } from "@plitzi/plitzi-sdk";\n\nconst BlockJsx = ({ internalProps, content, content2 }) => {\n const handleClick = useCallback(() => {\n alert("Hello World");\n }, []);\n\n return (\n <div style={{ display: "flex", gap: "4px" }}>\n <JsxManager\n as="Heading"\n internalProps={internalProps}\n content={`${content} ${content2}`}\n />\n <button onClick={handleClick} style={{ border: "1px gray solid", cursor: "pointer" }}>\n Click Me\n </button>\n </div>\n );\n};\n\nexport default BlockJsx;',props:'{"content": "Hello", "content2": "World"}',contentCache:"aW1wb3J0ICogYXMgUmVhY3QgZnJvbSAncmVhY3QnOwppbXBvcnQgeyB1c2VDYWxsYmFjayB9IGZyb20gInJlYWN0IjsKaW1wb3J0IHsgSnN4TWFuYWdlciB9IGZyb20gIkBwbGl0emkvcGxpdHppLXNkayI7CnZhciBCbG9ja0pzeCA9IGZ1bmN0aW9uIEJsb2NrSnN4KF9yZWYpIHsKICB2YXIgaW50ZXJuYWxQcm9wcyA9IF9yZWYuaW50ZXJuYWxQcm9wcywKICAgIGNvbnRlbnQgPSBfcmVmLmNvbnRlbnQsCiAgICBjb250ZW50MiA9IF9yZWYuY29udGVudDI7CiAgdmFyIGhhbmRsZUNsaWNrID0gdXNlQ2FsbGJhY2soZnVuY3Rpb24gKCkgewogICAgYWxlcnQoIkhlbGxvIFdvcmxkIik7CiAgfSwgW10pOwogIHJldHVybiAvKiNfX1BVUkVfXyovUmVhY3QuY3JlYXRlRWxlbWVudCgiZGl2IiwgewogICAgc3R5bGU6IHsKICAgICAgZGlzcGxheTogImZsZXgiLAogICAgICBnYXA6ICI0cHgiCiAgICB9CiAgfSwgLyojX19QVVJFX18qL1JlYWN0LmNyZWF0ZUVsZW1lbnQoSnN4TWFuYWdlciwgewogICAgYXM6ICJIZWFkaW5nIiwKICAgIGludGVybmFsUHJvcHM6IGludGVybmFsUHJvcHMsCiAgICBjb250ZW50OiAiIi5jb25jYXQoY29udGVudCwgIiAiKS5jb25jYXQoY29udGVudDIpCiAgfSksIC8qI19fUFVSRV9fKi9SZWFjdC5jcmVhdGVFbGVtZW50KCJidXR0b24iLCB7CiAgICBvbkNsaWNrOiBoYW5kbGVDbGljaywKICAgIHN0eWxlOiB7CiAgICAgIGJvcmRlcjogIjFweCBncmF5IHNvbGlkIiwKICAgICAgY3Vyc29yOiAncG9pbnRlcicKICAgIH0KICB9LCAiQ2xpY2sgTWUiKSk7Cn07CmV4cG9ydCBkZWZhdWx0IEJsb2NrSnN4Ow==",allowEmptyRender:!1},definition:{label:"Block JSX",type:"blockJsx",description:"A compiled JSX block for advanced authoring.",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:"fa-solid fa-code"},defaultStyle:{name:"Block JSX",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}}),bf=K(({ref:e,className:t="",renderType:n="",settings:r="{}",isPlugin:i=!1,assets:a="",scriptUrl:o=""})=>{let{id:s,rootId:l}=Wh(),{contexts:{PluginsContext:c}}=U(),{registerCustomAssets:u,unregisterCustomAssets:d}=pe(c),{components:p}=pe(w),h=ve(()=>{if(!r)return{};try{return JSON.parse(r)}catch{}return!1},[r]),f=!1===h,m=ve(()=>({id:s,rootId:l,...f?{}:h}),[s,l,f,h]),g=ve(()=>a?a.split("\n").filter(e=>!!e&&""!==e.trim()).map(e=>e.endsWith(".js")?{id:e,type:"script",params:{src:e,type:"text/javascript"}}:{id:e,type:"link",params:{href:e,rel:"stylesheet",type:"text/css"}}):[],[a]);if(me(()=>{if(0!==g.length)return u(g),()=>{d(g.map(e=>"script"===e.type?e.params.url:e.params.href))}},[g,u,d]),i&&o&&!f/* @__PURE__ */)return Ee(L,{url:o,internalProps:m,autoRegister:!1});let y=p.current[n];return y&&!f?/* @__PURE__ */Ee(y,{internalProps:m,extraProps:y.extraProps}):/* @__PURE__ */Ie(cf,{ref:e,className:vt("plitzi-component__custom",t),children:[n&&!f&&/* @__PURE__ */Ie("span",{children:["Custom Component ",
|
|
193
193
|
/* @__PURE__ */Ee("b",{children:n})," Not Found"]}),f&&/* @__PURE__ */Ee("span",{children:"Settings Malformed"}),!n&&/* @__PURE__ */Ee("span",{children:"Custom Component"})]})}),vf=Object.assign(bf,{type:"custom",content:{attributes:{renderType:"",settings:"{}",isPlugin:!1,assets:"",scriptUrl:""},definition:{label:"Custom",type:"custom",description:"A custom element slot whose behaviour is supplied by a host/plugin component.",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:"fa-solid fa-paintbrush"},defaultStyle:{name:"Custom Element",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}}),xf=K(({ref:e,className:t="",subType:n="span",children:r,...i})=>{let a=ld(i),o=ve(()=>Object.fromEntries(Object.entries(a).map(([e,t])=>[e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),t])),[a]);/* @__PURE__ */
|
|
194
|
-
return Ee(cf,{ref:e,tag:n,className:vt(`plitzi-component__node-html plitzi-component__node-html-${n}`,t),...o,children:r})}),kf=Object.assign(xf,{type:"nodeHtml",content:{attributes:{subType:"div"},definition:{label:"Html Node",type:"nodeHtml",description:"A single raw HTML tag with custom attributes.",items:[],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:"fa-brands fa-html5"},defaultStyle:{name:"Html Node",displayMode:"desktop",style:{base:{default:{}}},subTypes:{hr:{name:"HR Node",displayMode:"desktop",style:{base:{default:{"border-top-width":"1px"}}}}}},settings:{}}}),wf=de(({plitziElementLayout:e,type:t="",internalProps:n})=>{let{components:r}=pe(
|
|
195
|
-
/* @__PURE__ */Ee(ct,{name:`Reference:${o}`,value:
|
|
194
|
+
return Ee(cf,{ref:e,tag:n,className:vt(`plitzi-component__node-html plitzi-component__node-html-${n}`,t),...o,children:r})}),kf=Object.assign(xf,{type:"nodeHtml",content:{attributes:{subType:"div"},definition:{label:"Html Node",type:"nodeHtml",description:"A single raw HTML tag with custom attributes.",items:[],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:"fa-brands fa-html5"},defaultStyle:{name:"Html Node",displayMode:"desktop",style:{base:{default:{}}},subTypes:{hr:{name:"HR Node",displayMode:"desktop",style:{base:{default:{"border-top-width":"1px"}}}}}},settings:{}}}),wf=de(({plitziElementLayout:e,type:t="",internalProps:n})=>{let{components:r}=pe(w),{contexts:{PluginsContext:i}}=U(),{plugins:a}=pe(i);return H({type:t,internalProps:{...n,plitziElementLayout:e},plitziElementLayout:e,components:r.current,plugins:a})}),Sf=K(({ref:e,children:t,className:n="",referenceType:r="element",referenceId:i="",referenceContainer:a=""})=>{let{id:o,definition:{rootId:l,styleSelectors:u}}=Wh(),{settings:{previewMode:d,environment:p},contexts:{SegmentsContext:h}}=U(),[[f,m]]=c(["schema","segments"]),{segmentGet:g}=pe(h),y=ke(f);y.current=f;let b=ke(m);b.current=m;let v=he((e,t)=>{let n,r;switch(t){case"segment":{let t=s(b.current,e);if(!t)return;let i=s(t,"definition.baseElementId");r=s(t,"schema"),n=s(t,`schema.flat.${i}`);break}default:n=s(y.current,`flat.${e}`),r=y.current}if(n)return{element:n,elementType:s(n,"definition.type"),referenceContextData:{schema:r,prevSchema:y.current}}},[]),[x,k]=we(v(i,r)),w=he(async(e,t)=>{let n,r,i=v(e,t);if(i)k(i);else{switch(t){case"segment":{let t;if(e&&(t=await g(e)),!t)return;let i=s(t,"definition.baseElementId");r=s(t,"schema"),n=s(t,`schema.flat.${i}`);break}default:n=s(y.current,`flat.${e}`),r=y.current}k(n?{element:n,elementType:s(n,"definition.type"),referenceContextData:{schema:r,prevSchema:y.current}}:void 0)}},[v,g]);me(()=>{w(i,r)},[w,i,r]);let S=ve(()=>({bodyChildren:t,containerId:a,type:r,referenceId:o,rootId:o}),[a,t,r,o]),N=ve(()=>({id:x?.element?.id??"",rootId:l,className:u.base}),[x?.element?.id,l,u.base]);if(!x)/* @__PURE__ */return Ee(cf,{ref:e,className:vt("plitzi-component__reference",n,{"reference--build-mode":!d}),children:!d&&/* @__PURE__ */Ie("div",{className:"reference__label",children:["Element Reference ",/* @__PURE__ */Ee("b",{className:"capitalize",children:r})]})});let{element:T,elementType:C,referenceContextData:E}=x;return d&&T&&"element"===r?/* @__PURE__ */Ee(ct,{name:`Reference:${o}`,value:E,children:/* @__PURE__ */Ee(wf,{type:C,internalProps:N,plitziElementLayout:S},`${o}_${i}`)}):/* @__PURE__ */Ie(cf,{ref:e,className:vt("plitzi-component__reference",n,{"reference--build-mode":!d}),children:[
|
|
195
|
+
/* @__PURE__ */Ee(ct,{name:`Reference:${o}`,value:E,children:T&&/* @__PURE__ */Ee(wf,{type:C,internalProps:N,plitziElementLayout:S},`${o}_${i}`)}),!d&&!T&&/* @__PURE__ */Ie("div",{className:"reference__label",children:["Element Reference ",r]}),d&&!T&&"segment"===r&&/* @__PURE__ */Ie("div",{children:["Segment ",
|
|
196
196
|
/* @__PURE__ */Ee("b",{children:i})," not found, publish to ",
|
|
197
|
-
/* @__PURE__ */Ee("b",{children:
|
|
198
|
-
return Ie(cf,{ref:e,tag:"button",type:
|
|
197
|
+
/* @__PURE__ */Ee("b",{children:p})," environment"]})]})}),Nf=Object.assign(Sf,{type:"reference",content:{attributes:{referenceType:"element",referenceId:"",referenceContainer:""},definition:{label:"Reference",type:"reference",description:"Reuses another element or template by id, rendering it in place.",items:[],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:"fa-solid fa-asterisk"},defaultStyle:{name:"Reference Element",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}}),Tf=K(({ref:e,className:t="",children:n,contentPlacement:r="after",content:i="Button",subType:a="button",disabled:o=!1,ariaExpanded:s,ariaPressed:l})=>{let{definition:{label:c}}=Wh(),{settings:{previewMode:u}}=U(),d=ve(()=>"string"==typeof i?i:c,[i,c]);/* @__PURE__ */
|
|
198
|
+
return Ie(cf,{ref:e,tag:"button",type:u?a:"button",className:vt("plitzi-component__button",t,{"container--empty--skip":!u&&!n&&i}),disabled:o,"aria-label":d,"aria-expanded":s,"aria-pressed":l,children:["before"===r&&i,n,"after"===r&&i]})}),Cf=Object.assign(Tf,{type:"button",content:{attributes:{contentPlacement:"after",content:"Button",subType:"button",disabled:!1},definition:{label:"Button",type:"button",description:"A clickable button. On its own it only renders; wire an interaction flow (trigger onClick → callbacks) to make it DO something.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-stop"},defaultStyle:{name:"Button",displayMode:"desktop",style:{base:{default:{}}},subTypes:{button:{name:"Default Button",displayMode:"desktop",style:{base:{default:{"padding-top":"6px","padding-left":"12px","padding-right":"12px","padding-bottom":"6px",cursor:"pointer","font-size":"16px","line-height":"24px","border-top-left-radius":"4px","border-top-right-radius":"4px","border-bottom-left-radius":"4px","border-bottom-right-radius":"4px"}}}},reset:{name:"Reset Button",displayMode:"desktop",style:{base:{default:{"padding-top":"6px","padding-left":"12px","padding-right":"12px","padding-bottom":"6px",cursor:"pointer","font-size":"16px","line-height":"24px","border-top-left-radius":"4px","border-top-right-radius":"4px","border-bottom-left-radius":"4px","border-bottom-right-radius":"4px"}}}},submit:{name:"Submit Button",displayMode:"desktop",style:{base:{default:{"padding-top":"6px","padding-left":"12px","padding-right":"12px","padding-bottom":"6px",cursor:"pointer","font-size":"16px","line-height":"24px","border-top-left-radius":"4px","border-top-right-radius":"4px","border-bottom-left-radius":"4px","border-bottom-right-radius":"4px"}}}}}},settings:{}}}),Ef=se(void 0);Ef.displayName="DropdownContext";var If=K(({ref:e,children:t,className:n="",popupPlacement:r="bottom",openPopup:i=!1,backgroundDisabled:a=!1,closeOnClickBackground:o=!0,closeOnClickPopup:s=!0,containerTopOffset:l=5,containerLeftOffset:c=5,disabled:u=!1})=>{let{setElementState:d,definition:{styleSelectors:p}}=Wh(),{settings:{previewMode:h},utils:{getWindow:f}}=U(),m=ke(null),g=ke(null),y=ve(()=>f(),[f]),b=he(e=>{o&&(e.stopPropagation(),e.preventDefault(),d(e=>({...e,openPopup:!1})))},[o,d]),v=he(e=>{d(t=>({...t,openPopup:e}))},[d]),[,,x,k,,w]=(({ref:e,popupRef:t,open:n,placement:r="bottom",disabled:i=!1,loading:a=!1,closeOnClickPopup:o=!0,offsetX:s=0,offsetY:l=0,myWindow:c,onChange:u})=>{let[d,p]=we(n??!1),[h,f]=we(()=>e?.current?.getBoundingClientRect()),m=ve(()=>c||(typeof window<"u"?window:null),[c]),g=he(e=>{if(!i&&!a){if(e.stopPropagation(),e.preventDefault(),void 0!==n)return void u?.(!d,!1);u?.(!d,!0),p(e=>!e)}},[i,a,u,d,n]),y=he(e=>{if(!i&&!a&&o){if(e.stopPropagation(),e.preventDefault(),void 0!==n)return void u?.(!d,!1);u?.(!d,!0),p(e=>!e)}},[o,i,a,u,d,n]);me(()=>{let t=e?.current;if(!t||typeof window>"u"||!d)return;let n,r=()=>f(e.current?.getBoundingClientRect());return typeof ResizeObserver<"u"&&(n=new ResizeObserver(r),n.observe(t)),window.addEventListener("scroll",r,!0),window.addEventListener("resize",r),()=>{n?.disconnect(),window.removeEventListener("scroll",r,!0),window.removeEventListener("resize",r)}},[d,e]);let b=he(e=>{"Escape"===e.key&&(u?.(!d,void 0!==n),p(e=>!e))},[u,d,n]);me(()=>{if(d&&!i)return window.addEventListener("keydown",b),()=>{window.removeEventListener("keydown",b)}},[d,b,i]);let v=he(e=>{if(!h||!m)return;let t=m.innerWidth,n=m.innerHeight,i=0,a=0;switch(r){case"top":i=h.top-e.height,a=h.left;break;case"bottom":default:i=h.bottom,a=h.left;break;case"left":i=h.top,a=h.left-e.width;break;case"right":i=h.top,a=h.right}return"bottom"===r?(i+=l,a+=s):"top"===r?(i-=l,a+=s):"left"===r?(i+=l,a-=s):"right"===r&&(i+=l,a+=s),"bottom"===r||"top"===r?(a+e.width>t?a=h.right-e.width:a<0&&(a=h.left),i=Math.max(0,Math.min(n-e.height,i))):"left"===r||"right"===r?(i+e.height>n?i=h.bottom-e.height:i<0&&(i=h.top),a=Math.max(0,Math.min(t-e.width,a))):(i=Math.max(0,Math.min(n-e.height,i)),a=Math.max(0,Math.min(t-e.width,a))),{top:i,left:a}},[h,m,r,l,s]);return Fp(()=>{p(n??!1)},[n]),[d,p,g,y,h,ve(()=>{if(!d||!e?.current||!t?.current)return;let n=t.current.getBoundingClientRect();return v(n)},[d,e,t,v])]})({ref:e,popupRef:m,open:i,disabled:!h||u,closeOnClickPopup:s,placement:r,offsetX:c,offsetY:l,myWindow:y,onChange:v}),S=ve(()=>({popupRef:m,openPopup:i,parameters:w,onClick:k}),[k,i,w]);/* @__PURE__ */
|
|
199
199
|
return Ie(cf,{ref:e,className:vt("plitzi-component__dropdown",n,{"container--empty--skip":!h&&!t}),onClick:x,children:[/* @__PURE__ */Ee(Ef,{value:S,children:t}),i&&a&&h&&/* @__PURE__ */Ee("div",{ref:g,className:vt("plitzi-component__dropdown__background-container",p.backgroundContainer),onClick:b})]})}),Of=K(({ref:e,className:t="",children:n})=>{let{popupRef:r,openPopup:i,parameters:a,onClick:o}=pe(Ef);return ye(e,()=>r.current??null,[r]),/* @__PURE__ */Ee(cf,{ref:r,className:vt("plitzi-component__dropdown-popup",t,{"popup-container--no-visible":!i||!a}),style:a,onClick:o,children:n})}),zf=Object.assign(Of,{type:"dropdownPopup",content:{attributes:{},definition:{label:"Dropdown Popup",type:"dropdownPopup",description:"The floating panel revealed by a dropdown.",items:[],bindings:{},styleSelectors:{base:""},initialState:{}},builder:{canDelete:!1,canSelect:!0,canDragDrop:!1,canMove:!1,canTemplate:!1,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:""},defaultStyle:{name:"Dropdown Popup",displayMode:"desktop",style:{base:{default:{"background-color":"white","padding-right":"4px","padding-bottom":"4px","padding-left":"4px","padding-top":"4px",position:"fixed",display:"flex","flex-direction":"column","border-top-right-radius":"4px","border-bottom-right-radius":"4px","border-bottom-left-radius":"4px","border-top-left-radius":"4px","box-shadow":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 4px 11px","z-index":100}}},subTypes:{}},settings:{}},initialItems:[]}),Af=Object.assign(If,{type:"dropdown",content:{attributes:{popupPlacement:"bottom",openPopup:!1,backgroundDisabled:!1,closeOnClickBackground:!0,closeOnClickPopup:!0,containerTopOffset:5,containerLeftOffset:5,disabled:!1},definition:{label:"Dropdown",type:"dropdown",description:"A trigger that toggles an attached popup panel (dropdownPopup) — menus, selects, flyouts.",items:[],bindings:{},styleSelectors:{base:"",backgroundContainer:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-angle-down"},defaultStyle:{name:"Dropdown",displayMode:"desktop",style:{base:{default:{cursor:"pointer","user-select":"none"}},backgroundContainer:{default:{top:0,bottom:0,left:0,right:0,position:"fixed",cursor:"default","z-index":50}}}},settings:{}},initialItems:["dropdownPopup"],plugins:{dropdownPopup:zf}}),_f={root:Nt("",{variants:{size:{md:"",sm:"text-sm",xs:"text-xs",custom:""}},compoundVariants:[],defaultVariants:{size:"md"}})},Df=({className:e="focus-visible:px-1 focus-visible:m-px focus-visible:outline-dashed focus-visible:outline-1",myWindow:t,value:n="",exitOnEnter:r=!0,exitOnEscape:i=!0,updateMode:a="blur",openMode:o="click",size:s,onChange:l,onEditOpen:c,onEditClose:u})=>{e=Op("ContentEditable",{className:e,componentKey:"root",variants:{size:s}});let d=ke(null),p=ve(()=>t||(typeof window<"u"?window:void 0),[t]);me(()=>{d.current&&d.current.textContent!==n&&(d.current.textContent=n)},[n]);let h=he(e=>{"change"===a&&l?.(e.target.textContent)},[l,a]),f=he(e=>{if(!p)return;let t=p.document.createRange(),n=p.getSelection();t.setStart(e,e.childNodes.length),t.collapse(!0),n?.removeAllRanges(),n?.addRange(t)},[p]),m=he(()=>{let e=d.current;e&&(("inherit"===e.contentEditable||"false"===e.contentEditable)&&f(e),"click"===o&&(e.setAttribute("contenteditable","true"),e.focus(),c?.()))},[o,f,c]),g=he(()=>{let e=d.current;e&&"doubleClick"===o&&(e.setAttribute("contenteditable","true"),e.focus(),c?.())},[o,c]),y=he(()=>{let e=d.current;e&&(e.setAttribute("contenteditable","false"),"blur"===a&&e.textContent!==n&&l?.(e.textContent),u?.())},[l,a,n,u]),b=he(e=>{e.stopPropagation(),r&&13===e.keyCode?(e.preventDefault(),e.target.blur()):i&&27===e.keyCode&&(e.preventDefault(),e.target.textContent=n,e.target.blur())},[r,i,n]);/* @__PURE__ */
|
|
200
200
|
return Ee("div",{className:e,ref:d,onClick:m,onDoubleClick:g,onBlur:y,onInput:h,onKeyDown:b})},Pf=K(({ref:e,className:t="",content:n="Heading",subType:r="h1"})=>{let{id:i}=Wh(),{settings:{previewMode:a},contexts:{BuilderContext:o}}=U(),s=o?pe(o):void 0,l=ve(()=>"string"!=typeof n&&"number"!=typeof n?JSON.stringify(n):n||""===n||a?n:"Heading",[n,a]),c=he(e=>!a&&s?.updateElement(i,"content",e),[s?.updateElement,i]);/* @__PURE__ */
|
|
201
|
-
return Ie(cf,{ref:e,tag:a?r:"div",className:vt("plitzi-component__heading",{[`plitzi-component__heading-${r}`]:r},t),children:[a&&l,!a&&/* @__PURE__ */Ee(Df,{value:l,onChange:c,openMode:"doubleClick"})]})}),Rf=Object.assign(Pf,{type:"heading",content:{attributes:{content:"Heading",subType:"h1"},definition:{label:"Heading",type:"heading",description:"A section heading (<h1>–<h6>) for titles and document hierarchy.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-heading"},defaultStyle:{name:"Heading",displayMode:"desktop",style:{base:{default:{}}},subTypes:{h1:{name:"H1 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"38px","font-weight":700,"line-height":"44px"}}}},h2:{name:"H2 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"32px","font-weight":700,"line-height":"36px"}}}},h3:{name:"H3 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"24px","font-weight":700,"line-height":"30px"}}}},h4:{name:"H4 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"18px","font-weight":700,"line-height":"24px"}}}},h5:{name:"H5 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"14px","font-weight":700,"line-height":"20px"}}}},h6:{name:"H6 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"12px","font-weight":700,"line-height":"18px"}}}}}},settings:{}}}),Mf=K(({ref:e,children:t,className:n="",href:r="#",target:i="self",mode:a="page",label:o=""})=>{let{style:s}=Wh(),{settings:{previewMode:l}}=U(),[[c,u,d,p,h]]=F(["pageDefinitions","schema.pageFolders","navigation.routeParams","navigation.queryParams","navigation.navigate"]),f=ve(()=>{if("external"===a)return r;let e=`/${r}`.replaceAll(/[/]+/gim,"/");if("internal"===a){try{let t
|
|
201
|
+
return Ie(cf,{ref:e,tag:a?r:"div",className:vt("plitzi-component__heading",{[`plitzi-component__heading-${r}`]:r},t),children:[a&&l,!a&&/* @__PURE__ */Ee(Df,{value:l,onChange:c,openMode:"doubleClick"})]})}),Rf=Object.assign(Pf,{type:"heading",content:{attributes:{content:"Heading",subType:"h1"},definition:{label:"Heading",type:"heading",description:"A section heading (<h1>–<h6>) for titles and document hierarchy.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-heading"},defaultStyle:{name:"Heading",displayMode:"desktop",style:{base:{default:{}}},subTypes:{h1:{name:"H1 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"38px","font-weight":700,"line-height":"44px"}}}},h2:{name:"H2 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"32px","font-weight":700,"line-height":"36px"}}}},h3:{name:"H3 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"24px","font-weight":700,"line-height":"30px"}}}},h4:{name:"H4 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"18px","font-weight":700,"line-height":"24px"}}}},h5:{name:"H5 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"14px","font-weight":700,"line-height":"20px"}}}},h6:{name:"H6 Heading",displayMode:"desktop",style:{base:{default:{"margin-top":"25px","margin-bottom":"25px","font-size":"12px","font-weight":700,"line-height":"18px"}}}}}},settings:{}}}),Mf=K(({ref:e,children:t,className:n="",href:r="#",target:i="self",mode:a="page",label:o=""})=>{let{style:s}=Wh(),{settings:{previewMode:l}}=U(),[[c,u,d,p,h]]=F(["pageDefinitions","schema.pageFolders","navigation.routeParams","navigation.queryParams","navigation.navigate"]),f=ve(()=>{if("external"===a)return r;let e=`/${r}`.replaceAll(/[/]+/gim,"/");if("internal"===a){try{let t=$(e,{...p,...d},!0);return"string"==typeof t?t:e}catch{}return e}return zh(c,u,r,!0)},[a,r,c,u,p,d]),m=ve(()=>{let t={ref:e,style:s,target:`_${i}`,"aria-label":o||void 0,className:vt("plitzi-component__link",n)};return l?{...t,href:f}:{...t,"href-disabled":f}},[e,s,i,o,n,l,f]);/* @__PURE__ */
|
|
202
202
|
return Ee(cf,{tag:"a",...m,onClick:e=>{l&&(e.stopPropagation(),("page"===a||"internal"===a)&&(e.preventDefault(),h(f)))},children:t})}),Lf=Object.assign(Mf,{type:"link",content:{attributes:{href:"#",target:"self",mode:"page",label:""},definition:{label:"Link",type:"link",description:"Navigation. Moves the user between pages of the site or to an external URL (its `mode`/`href` decide which). Use this to go page-to-page rather than a button + interaction.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:["link"]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-link"},defaultStyle:{name:"Link",displayMode:"desktop",style:{base:{default:{display:"inline-block",color:"#333",cursor:"pointer"}}}},settings:{}}});function jf(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){-1===r&&(r=n.length,a=!0);const e=n.slice(i,r).trim();!e&&a||t.push(e),i=r+1,r=n.indexOf(",",i)}return t}var Ff=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$f=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vf={};function qf(e,t){return((t||Vf).jsx?$f:Ff).test(e)}var Bf=/[ \t\n\f\r]/g;function Uf(e){return""===e.replace(Bf,"")}var Hf=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};function Wf(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Hf(n,r,t)}function Gf(e){return e.toLowerCase()}Hf.prototype.normal={},Hf.prototype.property={},Hf.prototype.space=void 0;var Jf=class{constructor(e,t){this.attribute=t,this.property=e}};Jf.prototype.attribute="",Jf.prototype.booleanish=!1,Jf.prototype.boolean=!1,Jf.prototype.commaOrSpaceSeparated=!1,Jf.prototype.commaSeparated=!1,Jf.prototype.defined=!1,Jf.prototype.mustUseProperty=!1,Jf.prototype.number=!1,Jf.prototype.overloadedBoolean=!1,Jf.prototype.property="",Jf.prototype.spaceSeparated=!1,Jf.prototype.space=void 0;var Kf=/* @__PURE__ */e({boolean:()=>Yf,booleanish:()=>Xf,commaOrSpaceSeparated:()=>rm,commaSeparated:()=>nm,number:()=>em,overloadedBoolean:()=>Zf,spaceSeparated:()=>tm}),Qf=0,Yf=im(),Xf=im(),Zf=im(),em=im(),tm=im(),nm=im(),rm=im();function im(){return 2**++Qf}var am=Object.keys(Kf),om=class extends Jf{constructor(e,t,n,r){let i=-1;if(super(e,t),sm(this,"space",r),"number"==typeof n)for(;++i<am.length;){const e=am[i];sm(this,am[i],(n&Kf[e])===Kf[e])}}};function sm(e,t,n){n&&(e[t]=n)}function lm(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new om(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Gf(r)]=r,n[Gf(a.attribute)]=r}return new Hf(t,n,e.space)}om.prototype.defined=!0;var cm=lm({properties:{ariaActiveDescendant:null,ariaAtomic:Xf,ariaAutoComplete:null,ariaBusy:Xf,ariaChecked:Xf,ariaColCount:em,ariaColIndex:em,ariaColSpan:em,ariaControls:tm,ariaCurrent:null,ariaDescribedBy:tm,ariaDetails:null,ariaDisabled:Xf,ariaDropEffect:tm,ariaErrorMessage:null,ariaExpanded:Xf,ariaFlowTo:tm,ariaGrabbed:Xf,ariaHasPopup:null,ariaHidden:Xf,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tm,ariaLevel:em,ariaLive:null,ariaModal:Xf,ariaMultiLine:Xf,ariaMultiSelectable:Xf,ariaOrientation:null,ariaOwns:tm,ariaPlaceholder:null,ariaPosInSet:em,ariaPressed:Xf,ariaReadOnly:Xf,ariaRelevant:null,ariaRequired:Xf,ariaRoleDescription:tm,ariaRowCount:em,ariaRowIndex:em,ariaRowSpan:em,ariaSelected:Xf,ariaSetSize:em,ariaSort:null,ariaValueMax:em,ariaValueMin:em,ariaValueNow:em,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function um(e,t){return t in e?e[t]:t}function dm(e,t){return um(e,t.toLowerCase())}var pm=lm({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:nm,acceptCharset:tm,accessKey:tm,action:null,allow:null,allowFullScreen:Yf,allowPaymentRequest:Yf,allowUserMedia:Yf,alpha:Yf,alt:null,as:null,async:Yf,autoCapitalize:null,autoComplete:tm,autoFocus:Yf,autoPlay:Yf,blocking:tm,capture:null,charSet:null,checked:Yf,cite:null,className:tm,closedBy:null,colorSpace:null,cols:em,colSpan:em,command:null,commandFor:null,content:null,contentEditable:Xf,controls:Yf,controlsList:tm,coords:em|nm,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Yf,defer:Yf,dir:null,dirName:null,disabled:Yf,download:Zf,draggable:Xf,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Yf,formTarget:null,headers:tm,height:em,hidden:Zf,high:em,href:null,hrefLang:null,htmlFor:tm,httpEquiv:tm,id:null,imageSizes:null,imageSrcSet:null,inert:Yf,inputMode:null,integrity:null,is:null,isMap:Yf,itemId:null,itemProp:tm,itemRef:tm,itemScope:Yf,itemType:tm,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Yf,low:em,manifest:null,max:null,maxLength:em,media:null,method:null,min:null,minLength:em,multiple:Yf,muted:Yf,name:null,nonce:null,noModule:Yf,noValidate:Yf,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Yf,optimum:em,pattern:null,ping:tm,placeholder:null,playsInline:Yf,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Yf,referrerPolicy:null,rel:tm,required:Yf,reversed:Yf,rows:em,rowSpan:em,sandbox:tm,scope:null,scoped:Yf,seamless:Yf,selected:Yf,shadowRootClonable:Yf,shadowRootCustomElementRegistry:Yf,shadowRootDelegatesFocus:Yf,shadowRootMode:null,shadowRootSerializable:Yf,shape:null,size:em,sizes:null,slot:null,span:em,spellCheck:Xf,src:null,srcDoc:null,srcLang:null,srcSet:null,start:em,step:null,style:null,tabIndex:em,target:null,title:null,translate:null,type:null,typeMustMatch:Yf,useMap:null,value:Xf,width:em,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tm,axis:null,background:null,bgColor:null,border:em,borderColor:null,bottomMargin:em,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Yf,declare:Yf,event:null,face:null,frame:null,frameBorder:null,hSpace:em,leftMargin:em,link:null,longDesc:null,lowSrc:null,marginHeight:em,marginWidth:em,noResize:Yf,noHref:Yf,noShade:Yf,noWrap:Yf,object:null,profile:null,prompt:null,rev:null,rightMargin:em,rules:null,scheme:null,scrolling:Xf,standby:null,summary:null,text:null,topMargin:em,valueType:null,version:null,vAlign:null,vLink:null,vSpace:em,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Yf,disablePictureInPicture:Yf,disableRemotePlayback:Yf,exportParts:nm,part:tm,prefix:null,property:null,results:em,security:null,unselectable:null},space:"html",transform:dm}),hm=lm({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:rm,accentHeight:em,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:em,amplitude:em,arabicForm:null,ascent:em,attributeName:null,attributeType:null,azimuth:em,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:em,by:null,calcMode:null,capHeight:em,className:tm,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:em,diffuseConstant:em,direction:null,display:null,dur:null,divisor:em,dominantBaseline:null,download:Yf,dx:null,dy:null,edgeMode:null,editable:null,elevation:em,enableBackground:null,end:null,event:null,exponent:em,externalResourcesRequired:null,fill:null,fillOpacity:em,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:nm,g2:nm,glyphName:nm,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:em,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:em,horizOriginX:em,horizOriginY:em,id:null,ideographic:em,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:em,k:em,k1:em,k2:em,k3:em,k4:em,kernelMatrix:rm,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:em,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:em,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:em,overlineThickness:em,paintOrder:null,panose1:null,path:null,pathLength:em,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tm,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:em,pointsAtY:em,pointsAtZ:em,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rm,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rm,rev:rm,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rm,requiredFeatures:rm,requiredFonts:rm,requiredFormats:rm,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:em,specularExponent:em,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:em,strikethroughThickness:em,string:null,stroke:null,strokeDashArray:rm,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:em,strokeOpacity:em,strokeWidth:null,style:null,surfaceScale:em,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rm,tabIndex:em,tableValues:null,target:null,targetX:em,targetY:em,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rm,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:em,underlineThickness:em,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:em,values:null,vAlphabetic:em,vMathematical:em,vectorEffect:null,vHanging:em,vIdeographic:em,version:null,vertAdvY:em,vertOriginX:em,vertOriginY:em,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:em,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:um}),fm=lm({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),mm=lm({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dm}),gm=lm({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),ym={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},bm=/[A-Z]/g,vm=/-[a-z]/g,xm=/^data[-\w.:]+$/i;function km(e,t){const n=Gf(t);let r=t,i=Jf;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&xm.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(vm,Sm);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!vm.test(e)){let n=e.replace(bm,wm);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=om}return new i(r,t)}function wm(e){return"-"+e.toLowerCase()}function Sm(e){return e.charAt(1).toUpperCase()}var Nm=Wf([cm,pm,fm,mm,gm],"html"),Tm=Wf([cm,hm,fm,mm,gm],"svg");function Cm(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}var Em=/* @__PURE__ */n((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,u="";function d(e){return e?e.replace(c,u):u}t.exports=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var c=1,p=1;function h(e){var t=e.match(r);t&&(c+=t.length);var n=e.lastIndexOf("\n");p=~n?e.length-n:p+e.length}function f(){var e={line:c,column:p};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:c,column:p},this.source=t.source}function g(n){var r=/* @__PURE__ */new Error(t.source+":"+c+":"+p+": "+n);if(r.reason=n,r.filename=t.source,r.line=c,r.column=p,r.source=e,!t.silent)throw r}function y(t){var n=t.exec(e);if(n){var r=n[0];return h(r),e=e.slice(r.length),n}}function b(){y(i)}function v(e){var t;for(e=e||[];t=x();)!1!==t&&e.push(t);return e}function x(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;u!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,u===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return p+=2,h(r),e=e.slice(n),p+=2,t({type:"comment",comment:r})}}function k(){var e=f(),t=y(a);if(t){if(x(),!y(o))return g("property missing ':'");var r=y(s),i=e({type:"declaration",property:d(t[0].replace(n,u)),value:r?d(r[0].replace(n,u)):u});return y(l),i}}return m.prototype.content=e,b(),function(){var e,t=[];for(v(t);e=k();)!1!==e&&(t.push(e),v(t));return t}()}}),Im=/* @__PURE__ */n(e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){let r=null;if(!e||"string"!=typeof e)return r;const i=(0,n.default)(e),a="function"==typeof t;return i.forEach(e=>{if("declaration"!==e.type)return;const{property:n,value:i}=e;a?t(n,i,e):i&&(r=r||{},r[n]=i)}),r};var n=t(Em())}),Om=/* @__PURE__ */n(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e,t){return t.toUpperCase()},s=function(e,t){return"".concat(t,"-")};e.camelCase=function(e,l){return void 0===l&&(l={}),function(e){return!e||r.test(e)||t.test(e)}(e)?e:(e=e.toLowerCase(),(e=l.reactCompat?e.replace(a,s):e.replace(i,s)).replace(n,o))}}),zm=/* @__PURE__ */n((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Im()),r=Om();function i(e,t){var i={};return e&&"string"==typeof e?((0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i):i}i.default=i,t.exports=i}),Am=Dm("end"),_m=Dm("start");function Dm(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Pm(e){return e&&"object"==typeof e?"position"in e||"type"in e?Mm(e.position):"start"in e||"end"in e?Mm(e):"line"in e||"column"in e?Rm(e):"":""}function Rm(e){return Lm(e&&e.line)+":"+Lm(e&&e.column)}function Mm(e){return Rm(e&&e.start)+"-"+Rm(e&&e.end)}function Lm(e){return e&&"number"==typeof e?e:1}var jm=class extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},a=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=o?o.line:void 0,this.name=Pm(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};jm.prototype.file="",jm.prototype.name="",jm.prototype.reason="",jm.prototype.message="",jm.prototype.stack="",jm.prototype.column=void 0,jm.prototype.line=void 0,jm.prototype.ancestors=void 0,jm.prototype.cause=void 0,jm.prototype.fatal=void 0,jm.prototype.place=void 0,jm.prototype.ruleId=void 0,jm.prototype.source=void 0;var Fm=/* @__PURE__ */t(zm(),1),$m={}.hasOwnProperty,Vm=/* @__PURE__ */new Map,qm=/[A-Z]/g,Bm=/* @__PURE__ */new Set(["table","tbody","thead","tfoot","tr"]),Um=/* @__PURE__ */new Set(["td","th"]),Hm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Wm(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(i=Tm,e.schema=i),e.ancestors.push(t);const a=Ym(e,t.tagName,!1),o=function(e,t){const n={};let r,i;for(i in t.properties)if("children"!==i&&$m.call(t.properties,i)){const a=Qm(e,i,t.properties[i]);if(a){const[i,o]=a;e.tableCellAlignToStyle&&"align"===i&&"string"==typeof o&&Um.has(t.tagName)?r=o:n[i]=o}}return r&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),n}(e,t);let s=Km(e,t);return Bm.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&Uf(t.value):Uf(t));var t})),Gm(e,o,a,t),Jm(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];
|
|
203
203
|
/* @__PURE__ */return n.type,e.evaluater.evaluateExpression(n.expression)}Xm(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.name&&"html"===r.space&&(i=Tm,e.schema=i),e.ancestors.push(t);const a=null===t.name?e.Fragment:Ym(e,t.name,!0),o=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];
|
|
204
204
|
/* @__PURE__ */t.type;const i=t.expression;
|
|
@@ -214,41 +214,41 @@ return re.createElement(O,F,/*#__PURE__*/re.createElement(A,u,!g&&M,E({rows:q,st
|
|
|
214
214
|
/* @__PURE__ */this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function Dk(e){this.exit(e),this.data.inTable=void 0}function Pk(e){this.enter({type:"tableRow",children:[]},e)}function Rk(e){this.exit(e)}function Mk(e){this.enter({type:"tableCell",children:[]},e)}function Lk(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,jk));const n=this.stack[this.stack.length-1];
|
|
215
215
|
/* @__PURE__ */n.type,n.value=t,this.exit(e)}function jk(e,t){return"|"===t?t:e}function Fk(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=Ak.inlineCode(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let i=-1;const a=[],o=t.enter("table");for(;++i<r.length;)a[i]=l(r[i],t,n);return o(),a}(e,n,r),e.align)},tableCell:o,tableRow:function(e,t,n,r){const i=s([l(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function o(e,t,n,r){const i=n.enter("tableCell"),o=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function s(e,t){return function(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||lk,a=[],o=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const t=[],r=[];let a=-1;for(e[u].length>c&&(c=e[u].length);++a<e[u].length;){const o=ck(e[u][a]);if(!1!==n.alignDelimiters){const e=i(o);r[a]=e,(void 0===l[a]||e>l[a])&&(l[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if("object"==typeof r&&"length"in r)for(;++d<c;)a[d]=uk(r[d]);else{const e=uk(r);for(;++d<c;)a[d]=e}d=-1;const p=[],h=[];for(;++d<c;){const e=a[d];let t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,l[d]-t.length-r.length);const o=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&(i=t.length+i+r.length,i>l[d]&&(l[d]=i),h[d]=i),p[d]=o}o.splice(1,0,p),s.splice(1,0,h),u=-1;const f=[];for(;++u<o.length;){const e=o[u],t=s[u];d=-1;const r=[];for(;++d<c;){const i=e[d]||"";let o="",s="";if(!1!==n.alignDelimiters){const e=l[d]-(t[d]||0),n=a[d];114===n?o=" ".repeat(e):99===n?e%2?(o=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):(o=" ".repeat(e/2),s=o):s=" ".repeat(e)}!1===n.delimiterStart||d||r.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===i||!1===n.delimiterStart&&!d||r.push(" "),!1!==n.alignDelimiters&&r.push(o),r.push(i),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),!1===n.delimiterEnd&&d===c-1||r.push("|")}f.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return f.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function l(e,t,n){const r=e.children;let i=-1;const a=[],s=t.enter("tableRow");for(;++i<r.length;)a[i]=o(r[i],0,t,n);return s(),a}}function $k(e){const t=this.stack[this.stack.length-2];
|
|
216
216
|
/* @__PURE__ */t.type,t.checked="taskListCheckValueChecked"===e.type}function Vk(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];
|
|
217
|
-
/* @__PURE__ */e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let i,a=-1;for(;++a<r.length;){const e=r[a];if("paragraph"===e.type){i=e;break}}i===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function qk(e,t,n,r){const i=e.children[0],a="boolean"==typeof e.checked&&i&&"paragraph"===i.type,o="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);a&&s.move(o);let l=Ak.listItem(e,t,n,{...r,...s.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+o})),l}for(var Bk={tokenize:function(e,t,n){let r=0;return function t(a){return(87===a||119===a)&&r<3?(r++,e.consume(a),t):46===a&&3===r?(e.consume(a),i):n(a)};function i(e){return null===e?n(e):t(e)}},partial:!0},Uk={tokenize:function(e,t,n){let r,i,a;return o;function o(t){return 46===t||95===t?e.check(Wk,l,s)(t):null===t||Tg(t)||Ig(t)||45!==t&&Eg(t)?l(t):(a=!0,e.consume(t),o)}function s(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),o}function l(e){return i||r||!a?n(e):t(e)}},partial:!0},Hk={tokenize:function(e,t){let n=0,r=0;return i;function i(o){return 40===o?(n++,e.consume(o),i):41===o&&r<n?a(o):33===o||34===o||38===o||39===o||41===o||42===o||44===o||46===o||58===o||59===o||60===o||63===o||93===o||95===o||126===o?e.check(Wk,t,a)(o):null===o||Tg(o)||Ig(o)?t(o):(e.consume(o),i)}function a(t){return 41===t&&r++,e.consume(t),i}},partial:!0},Wk={tokenize:function(e,t,n){return r;function r(o){return 33===o||34===o||39===o||41===o||42===o||44===o||46===o||58===o||59===o||63===o||95===o||126===o?(e.consume(o),r):38===o?(e.consume(o),a):93===o?(e.consume(o),i):60===o||null===o||Tg(o)||Ig(o)?t(o):n(o)}function i(e){return null===e||40===e||91===e||Tg(e)||Ig(e)?t(e):r(e)}function a(e){return yg(e)?o(e):n(e)}function o(t){return 59===t?(e.consume(t),r):yg(t)?(e.consume(t),o):n(t)}},partial:!0},Gk={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return bg(e)?n(e):t(e)}},partial:!0},Jk={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){return 87!==t&&119!==t||!Zk.call(r,r.previous)||rw(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Bk,e.attempt(Uk,e.attempt(Hk,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:Zk},Kk={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let i="",a=!1;return function(t){return 72!==t&&104!==t||!ew.call(r,r.previous)||rw(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),o)};function o(t){if(yg(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),o;if(58===t){const n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),a?l:(a=!0,s)):n(t)}function l(t){return null===t||xg(t)||Tg(t)||Ig(t)||Eg(t)?n(t):e.attempt(Uk,e.attempt(Hk,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:ew},Qk={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let i,a;return function(t){return nw(t)&&tw.call(r,r.previous)&&!rw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(t)):n(t)};function o(t){return nw(t)?(e.consume(t),o):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(Gk,c,l)(t):45===t||95===t||bg(t)?(a=!0,e.consume(t),s):c(t)}function l(t){return e.consume(t),i=!0,s}function c(o){return a&&i&&yg(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(o)):n(o)}},previous:tw},Yk={},Xk=48;Xk<123;)Yk[Xk]=Qk,58===++Xk?Xk=65:91===Xk&&(Xk=97);function Zk(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||Tg(e)}function ew(e){return!yg(e)}function tw(e){return!(47===e||nw(e))}function nw(e){return 43===e||45===e||46===e||95===e||bg(e)}function rw(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}Yk[43]=Qk,Yk[45]=Qk,Yk[46]=Qk,Yk[95]=Qk,Yk[72]=[Qk,Kk],Yk[104]=[Qk,Kk],Yk[87]=[Qk,Jk],Yk[119]=[Qk,Jk];var iw={tokenize:function(e,t,n){const r=this;return Ag(e,function(e){const i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function aw(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const e=r.events[i][1];if("labelImage"===e.type){o=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(i){if(!o||!o._balanced)return n(i);const s=gg(r.sliceSerialize({start:o.end,end:r.now()}));return 94===s.codePointAt(0)&&a.includes(s.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)):n(i)}}function ow(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function sw(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(o>999||93===s&&!a||null===s||91===s||Tg(s))return n(s);if(93===s){e.exit("chunkString");const a=e.exit("gfmFootnoteCallString");return i.includes(gg(r.sliceSerialize(a)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return Tg(s)||(a=!0),o++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,l):l(t)}}function lw(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!o||null===t||91===t||Tg(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return a=gg(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Tg(t)||(o=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(a)||i.push(a),Ag(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function cw(e,t,n){return e.check($g,t,e.attempt(iw,t,n))}function uw(e){e.exit("gfmFootnoteDefinition")}function dw(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const i=this.previous,a=this.events;let o=0;return function(t){return 126===i&&"characterEscape"!==a[a.length-1][1].type?r(t):(e.enter("strikethroughSequenceTemporary"),s(t))};function s(a){const l=Rg(i);if(126===a)return o>1?r(a):(e.consume(a),o++,s);if(o<2&&!t)return r(a);const c=e.exit("strikethroughSequenceTemporary"),u=Rg(a);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(a)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",a,t]],s=t.parser.constructs.insideSpan.null;s&&cg(o,o.length,0,Mg(s,e.slice(r+1,n),t)),cg(o,o.length,0,[["exit",a,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),cg(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}var pw=class{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t)return e.map[i][1]+=n,void e.map[i][2].push(...r);i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}};function hw(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}function fw(e,t,n){const r=this;let i,a=0,o=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const i=t>-1?r.events[t][1].type:null,a="tableHead"===i||"tableRow"===i?x:s;return a===x&&r.parser.lazy[r.now().line]?n(e):a(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){return 124===e||(i=!0,o+=1),l(e)}(t)}function l(t){return null===t?n(t):Ng(t)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):Cg(t)?Ag(e,l,"whitespace")(t):(o+=1,i&&(i=!1,a+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||Tg(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),i=!1,Cg(t)?Ag(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?f(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):v(t)}function h(t){return Cg(t)?Ag(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(o+=1,m(t)):null===t||Ng(t)?b(t):v(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):v(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return Cg(t)?Ag(e,b,"whitespace")(t):b(t)}function b(n){return 124===n?p(n):(null===n||Ng(n))&&i&&a===o?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function x(t){return e.enter("tableRow"),k(t)}function k(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),k):null===n||Ng(n)?(e.exit("tableRow"),t(n)):Cg(n)?Ag(e,k,"whitespace")(n):(e.enter("data"),w(n))}function w(t){return null===t||124===t||Tg(t)?(e.exit("data"),k(t)):(e.consume(t),92===t?S:w)}function S(t){return 92===t||124===t?(e.consume(t),w):w(t)}}function mw(e,t){let n,r,i,a=-1,o=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const p=new pw;for(;++a<e.length;){const h=e[a],f=h[1];"enter"===h[0]?"tableHead"===f.type?(u=!1,0!==d&&(yw(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(a,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(o=!0,i=void 0,l=[0,0,0,0],c=[0,a+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(a,0,[["enter",r,t]])),s="tableDelimiterRow"===f.type?2:r?3:1):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(o?o=!1:(0!==l[1]&&(c[0]=c[1],i=gw(p,t,l,s,void 0,i)),l=c,c=[l[1],a,0,0])):(o=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],i=gw(p,t,l,s,void 0,i),l=[0,0,0,0]),c[2]=a)):"tableHead"===f.type?(u=!0,d=a):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=a,0!==l[1]?(c[0]=c[1],i=gw(p,t,l,s,a,i)):0!==c[1]&&(i=gw(p,t,c,s,a,i)),s=0):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=a)}for(0!==d&&yw(p,t,d,n,r),p.consume(t.events),a=-1;++a<t.events.length;){const e=t.events[a];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=hw(t.events,a))}return e}function gw(e,t,n,r,i,a){const o=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(a.end=Object.assign({},bw(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const s=bw(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",a,t]]),0!==n[2]){const i=bw(t.events,n[2]),a=bw(t.events,n[3]),o={type:"tableContent",start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[["enter",o,t]]),2!==r){const r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",o,t]])}return void 0!==i&&(a.end=Object.assign({},bw(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function yw(e,t,n,r,i){const a=[],o=bw(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function bw(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}var vw={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return Tg(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(t)}function o(r){return Ng(r)?t(r):Cg(r)?e.check({tokenize:xw},t,n)(r):n(r)}}};function xw(e,t,n){return Ag(e,function(e){return null===e?n(e):t(e)},"whitespace")}var kw={},ww=[function(e){const t=e||kw,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),a=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return pg([{text:Yk},{document:{91:{name:"gfmFootnoteDefinition",tokenize:lw,continuation:{tokenize:cw},exit:uw}},text:{91:{name:"gfmFootnoteCall",tokenize:sw},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aw,resolveTo:ow}}},dw(e),{flow:{null:{name:"table",tokenize:fw,resolveAll:mw}}},{text:{91:vw}}])}(t)),i.push([{transforms:[qx],enter:{literalAutolink:Mx,literalAutolinkEmail:Lx,literalAutolinkHttp:Lx,literalAutolinkWww:Lx},exit:{literalAutolink:Vx,literalAutolinkEmail:$x,literalAutolinkHttp:jx,literalAutolinkWww:Fx}},{enter:{gfmFootnoteCallString:Wx,gfmFootnoteCall:Gx,gfmFootnoteDefinitionLabelString:Jx,gfmFootnoteDefinition:Kx},exit:{gfmFootnoteCallString:Qx,gfmFootnoteCall:Yx,gfmFootnoteDefinitionLabelString:Xx,gfmFootnoteDefinition:Zx}},{canContainEols:["delete"],enter:{strikethrough:ak},exit:{strikethrough:ok}},{enter:{table:_k,tableData:Mk,tableHeader:Mk,tableRow:Pk},exit:{codeText:Lk,table:Dk,tableData:Rk,tableHeader:Rk,tableRow:Rk}},{exit:{taskListCheckValueChecked:$k,taskListCheckValueUnchecked:$k,paragraph:Vk}}]),a.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Px,notInConstruct:Rx},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Px,notInConstruct:Rx},{character:":",before:"[ps]",after:"\\/",inConstruct:Px,notInConstruct:Rx}]},tk(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ik}],handlers:{delete:sk}},Fk(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:qk}}]}}(t))}],Sw=e=>e?.default||e;px.registerLanguage("javascript",Sw(Nx)),px.registerLanguage("typescript",Sw(Ox)),px.registerLanguage("jsx",Sw(Cx)),px.registerLanguage("tsx",Sw(Ix)),px.registerLanguage("bash",Sw(wx)),px.registerLanguage("json",Sw(Tx)),px.registerLanguage("css",Sw(Sx)),px.registerLanguage("html",Sw(Ex)),px.registerLanguage("markdown",Sw(Ex));var Nw={root:Nt("")},Tw=({className:e,children:t="",wrapLines:n=!0,showLineNumbers:r=!0})=>(e=Op("Markdown",{className:e,componentKey:"root"}),/* @__PURE__ */Ee("div",{className:vt("markdown",e),children:/* @__PURE__ */Ee(dv,{remarkPlugins:ww,components:{code(e){let{children:t,className:i,...a}=e,o=/language-(\w+)/.exec(i||"");return o?/* @__PURE__ */Ee(px,{...l(a,["node"]),PreTag:"div",language:o[1],style:zx,wrapLines:n,showLineNumbers:r,children:"string"==typeof t?t.replace(/\n$/,""):""}):/* @__PURE__ */Ee("code",{...a,className:i,children:t})}},children:t})})),Cw=K(({ref:e,content:t="Markdown",className:n=""})=>{let{settings:{previewMode:r}}=U();/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let i,a=-1;for(;++a<r.length;){const e=r[a];if("paragraph"===e.type){i=e;break}}i===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function qk(e,t,n,r){const i=e.children[0],a="boolean"==typeof e.checked&&i&&"paragraph"===i.type,o="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);a&&s.move(o);let l=Ak.listItem(e,t,n,{...r,...s.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+o})),l}for(var Bk={tokenize:function(e,t,n){let r=0;return function t(a){return(87===a||119===a)&&r<3?(r++,e.consume(a),t):46===a&&3===r?(e.consume(a),i):n(a)};function i(e){return null===e?n(e):t(e)}},partial:!0},Uk={tokenize:function(e,t,n){let r,i,a;return o;function o(t){return 46===t||95===t?e.check(Wk,l,s)(t):null===t||Tg(t)||Ig(t)||45!==t&&Eg(t)?l(t):(a=!0,e.consume(t),o)}function s(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),o}function l(e){return i||r||!a?n(e):t(e)}},partial:!0},Hk={tokenize:function(e,t){let n=0,r=0;return i;function i(o){return 40===o?(n++,e.consume(o),i):41===o&&r<n?a(o):33===o||34===o||38===o||39===o||41===o||42===o||44===o||46===o||58===o||59===o||60===o||63===o||93===o||95===o||126===o?e.check(Wk,t,a)(o):null===o||Tg(o)||Ig(o)?t(o):(e.consume(o),i)}function a(t){return 41===t&&r++,e.consume(t),i}},partial:!0},Wk={tokenize:function(e,t,n){return r;function r(o){return 33===o||34===o||39===o||41===o||42===o||44===o||46===o||58===o||59===o||63===o||95===o||126===o?(e.consume(o),r):38===o?(e.consume(o),a):93===o?(e.consume(o),i):60===o||null===o||Tg(o)||Ig(o)?t(o):n(o)}function i(e){return null===e||40===e||91===e||Tg(e)||Ig(e)?t(e):r(e)}function a(e){return yg(e)?o(e):n(e)}function o(t){return 59===t?(e.consume(t),r):yg(t)?(e.consume(t),o):n(t)}},partial:!0},Gk={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return bg(e)?n(e):t(e)}},partial:!0},Jk={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){return 87!==t&&119!==t||!Zk.call(r,r.previous)||rw(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Bk,e.attempt(Uk,e.attempt(Hk,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:Zk},Kk={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let i="",a=!1;return function(t){return 72!==t&&104!==t||!ew.call(r,r.previous)||rw(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),o)};function o(t){if(yg(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),o;if(58===t){const n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),a?l:(a=!0,s)):n(t)}function l(t){return null===t||xg(t)||Tg(t)||Ig(t)||Eg(t)?n(t):e.attempt(Uk,e.attempt(Hk,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:ew},Qk={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let i,a;return function(t){return nw(t)&&tw.call(r,r.previous)&&!rw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(t)):n(t)};function o(t){return nw(t)?(e.consume(t),o):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(Gk,c,l)(t):45===t||95===t||bg(t)?(a=!0,e.consume(t),s):c(t)}function l(t){return e.consume(t),i=!0,s}function c(o){return a&&i&&yg(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(o)):n(o)}},previous:tw},Yk={},Xk=48;Xk<123;)Yk[Xk]=Qk,58===++Xk?Xk=65:91===Xk&&(Xk=97);function Zk(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||Tg(e)}function ew(e){return!yg(e)}function tw(e){return!(47===e||nw(e))}function nw(e){return 43===e||45===e||46===e||95===e||bg(e)}function rw(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}Yk[43]=Qk,Yk[45]=Qk,Yk[46]=Qk,Yk[95]=Qk,Yk[72]=[Qk,Kk],Yk[104]=[Qk,Kk],Yk[87]=[Qk,Jk],Yk[119]=[Qk,Jk];var iw={tokenize:function(e,t,n){const r=this;return Ag(e,function(e){const i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function aw(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const e=r.events[i][1];if("labelImage"===e.type){o=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(i){if(!o||!o._balanced)return n(i);const s=gg(r.sliceSerialize({start:o.end,end:r.now()}));return 94===s.codePointAt(0)&&a.includes(s.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),t(i)):n(i)}}function ow(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function sw(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(o>999||93===s&&!a||null===s||91===s||Tg(s))return n(s);if(93===s){e.exit("chunkString");const a=e.exit("gfmFootnoteCallString");return i.includes(gg(r.sliceSerialize(a)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return Tg(s)||(a=!0),o++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,l):l(t)}}function lw(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!o||null===t||91===t||Tg(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return a=gg(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Tg(t)||(o=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i.includes(a)||i.push(a),Ag(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function cw(e,t,n){return e.check($g,t,e.attempt(iw,t,n))}function uw(e){e.exit("gfmFootnoteDefinition")}function dw(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const i=this.previous,a=this.events;let o=0;return function(t){return 126===i&&"characterEscape"!==a[a.length-1][1].type?r(t):(e.enter("strikethroughSequenceTemporary"),s(t))};function s(a){const l=Rg(i);if(126===a)return o>1?r(a):(e.consume(a),o++,s);if(o<2&&!t)return r(a);const c=e.exit("strikethroughSequenceTemporary"),u=Rg(a);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(a)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",a,t]],s=t.parser.constructs.insideSpan.null;s&&cg(o,o.length,0,Mg(s,e.slice(r+1,n),t)),cg(o,o.length,0,[["exit",a,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),cg(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}var pw=class{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t)return e.map[i][1]+=n,void e.map[i][2].push(...r);i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}};function hw(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}function fw(e,t,n){const r=this;let i,a=0,o=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const i=t>-1?r.events[t][1].type:null,a="tableHead"===i||"tableRow"===i?x:s;return a===x&&r.parser.lazy[r.now().line]?n(e):a(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){return 124===e||(i=!0,o+=1),l(e)}(t)}function l(t){return null===t?n(t):Ng(t)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):Cg(t)?Ag(e,l,"whitespace")(t):(o+=1,i&&(i=!1,a+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),i=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||Tg(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),i=!1,Cg(t)?Ag(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?f(t):124===t?(i=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):v(t)}function h(t){return Cg(t)?Ag(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(o+=1,m(t)):null===t||Ng(t)?b(t):v(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):v(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return Cg(t)?Ag(e,b,"whitespace")(t):b(t)}function b(n){return 124===n?p(n):(null===n||Ng(n))&&i&&a===o?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function x(t){return e.enter("tableRow"),k(t)}function k(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),k):null===n||Ng(n)?(e.exit("tableRow"),t(n)):Cg(n)?Ag(e,k,"whitespace")(n):(e.enter("data"),w(n))}function w(t){return null===t||124===t||Tg(t)?(e.exit("data"),k(t)):(e.consume(t),92===t?S:w)}function S(t){return 92===t||124===t?(e.consume(t),w):w(t)}}function mw(e,t){let n,r,i,a=-1,o=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const p=new pw;for(;++a<e.length;){const h=e[a],f=h[1];"enter"===h[0]?"tableHead"===f.type?(u=!1,0!==d&&(yw(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(a,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(o=!0,i=void 0,l=[0,0,0,0],c=[0,a+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(a,0,[["enter",r,t]])),s="tableDelimiterRow"===f.type?2:r?3:1):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type?"tableCellDivider"===f.type&&(o?o=!1:(0!==l[1]&&(c[0]=c[1],i=gw(p,t,l,s,void 0,i)),l=c,c=[l[1],a,0,0])):(o=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],i=gw(p,t,l,s,void 0,i),l=[0,0,0,0]),c[2]=a)):"tableHead"===f.type?(u=!0,d=a):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=a,0!==l[1]?(c[0]=c[1],i=gw(p,t,l,s,a,i)):0!==c[1]&&(i=gw(p,t,c,s,a,i)),s=0):!s||"data"!==f.type&&"tableDelimiterMarker"!==f.type&&"tableDelimiterFiller"!==f.type||(c[3]=a)}for(0!==d&&yw(p,t,d,n,r),p.consume(t.events),a=-1;++a<t.events.length;){const e=t.events[a];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=hw(t.events,a))}return e}function gw(e,t,n,r,i,a){const o=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(a.end=Object.assign({},bw(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const s=bw(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",a,t]]),0!==n[2]){const i=bw(t.events,n[2]),a=bw(t.events,n[3]),o={type:"tableContent",start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[["enter",o,t]]),2!==r){const r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",o,t]])}return void 0!==i&&(a.end=Object.assign({},bw(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function yw(e,t,n,r,i){const a=[],o=bw(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function bw(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}var vw={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return Tg(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(t)}function o(r){return Ng(r)?t(r):Cg(r)?e.check({tokenize:xw},t,n)(r):n(r)}}};function xw(e,t,n){return Ag(e,function(e){return null===e?n(e):t(e)},"whitespace")}var kw={},ww=[function(e){const t=e||kw,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),a=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return pg([{text:Yk},{document:{91:{name:"gfmFootnoteDefinition",tokenize:lw,continuation:{tokenize:cw},exit:uw}},text:{91:{name:"gfmFootnoteCall",tokenize:sw},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aw,resolveTo:ow}}},dw(e),{flow:{null:{name:"table",tokenize:fw,resolveAll:mw}}},{text:{91:vw}}])}(t)),i.push([{transforms:[qx],enter:{literalAutolink:Mx,literalAutolinkEmail:Lx,literalAutolinkHttp:Lx,literalAutolinkWww:Lx},exit:{literalAutolink:Vx,literalAutolinkEmail:$x,literalAutolinkHttp:jx,literalAutolinkWww:Fx}},{enter:{gfmFootnoteCallString:Wx,gfmFootnoteCall:Gx,gfmFootnoteDefinitionLabelString:Jx,gfmFootnoteDefinition:Kx},exit:{gfmFootnoteCallString:Qx,gfmFootnoteCall:Yx,gfmFootnoteDefinitionLabelString:Xx,gfmFootnoteDefinition:Zx}},{canContainEols:["delete"],enter:{strikethrough:ak},exit:{strikethrough:ok}},{enter:{table:_k,tableData:Mk,tableHeader:Mk,tableRow:Pk},exit:{codeText:Lk,table:Dk,tableData:Rk,tableHeader:Rk,tableRow:Rk}},{exit:{taskListCheckValueChecked:$k,taskListCheckValueUnchecked:$k,paragraph:Vk}}]),a.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Px,notInConstruct:Rx},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Px,notInConstruct:Rx},{character:":",before:"[ps]",after:"\\/",inConstruct:Px,notInConstruct:Rx}]},tk(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ik}],handlers:{delete:sk}},Fk(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:qk}}]}}(t))}],Sw=e=>e?.default||e;px.registerLanguage("javascript",Sw(Nx)),px.registerLanguage("typescript",Sw(Ox)),px.registerLanguage("jsx",Sw(Cx)),px.registerLanguage("tsx",Sw(Ix)),px.registerLanguage("bash",Sw(wx)),px.registerLanguage("json",Sw(Tx)),px.registerLanguage("css",Sw(Sx)),px.registerLanguage("html",Sw(Ex)),px.registerLanguage("markdown",Sw(Ex));var Nw={root:Nt("")},Tw=({className:e,children:t="",wrapLines:n=!0,showLineNumbers:r=!0})=>(e=Op("Markdown",{className:e,componentKey:"root"}),/* @__PURE__ */Ee("div",{className:vt("markdown",e),children:/* @__PURE__ */Ee(dv,{remarkPlugins:ww,components:{code(e){let{children:t,className:i,...a}=e,o=/language-(\w+)/.exec(i||"");return o?/* @__PURE__ */Ee(px,{...X(a,["node"]),PreTag:"div",language:o[1],style:zx,wrapLines:n,showLineNumbers:r,children:"string"==typeof t?t.replace(/\n$/,""):""}):/* @__PURE__ */Ee("code",{...a,className:i,children:t})}},children:t})})),Cw=K(({ref:e,content:t="Markdown",className:n=""})=>{let{settings:{previewMode:r}}=U();/* @__PURE__ */
|
|
218
218
|
return Ee(cf,{ref:e,className:vt("plitzi-component__markdown",{"plitzi-component__markdown--edit-mode":!r},n),children:/* @__PURE__ */Ee(Tw,{children:t})})}),Ew=Object.assign(Cw,{type:"markdown",content:{attributes:{content:"Markdown"},definition:{label:"Markdown",type:"markdown",description:"Renders a Markdown source string as formatted HTML.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-brands fa-markdown"},defaultStyle:{name:"Markdown",displayMode:"desktop",style:{base:{default:{"font-size":"14px","line-height":"24px"}}}},settings:{}}}),Iw=K(({ref:e,content:t="Paragraph",className:n=""})=>{let{id:r}=Wh(),{settings:{previewMode:i},contexts:{BuilderContext:a}}=U(),o=a?pe(a):void 0,s=ve(()=>"string"!=typeof t&&"number"!=typeof t?JSON.stringify(t):t||""===t||i?"number"==typeof t?`${t}`:t:"Paragraph",[t,i]),l=he(e=>o?.updateElement(r,"content",e),[o,r]);/* @__PURE__ */
|
|
219
219
|
return Ie(cf,{ref:e,tag:i?"p":"div",className:vt("plitzi-component__paragraph",n),children:[i&&s,!i&&/* @__PURE__ */Ee(Df,{className:"",value:s,onChange:l,openMode:"doubleClick"})]})}),Ow=Object.assign(Iw,{type:"paragraph",content:{attributes:{content:"Paragraph"},definition:{label:"Paragraph",type:"paragraph",description:"A block of body text (a <p>). Use for longer prose passages.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-paragraph"},defaultStyle:{name:"Paragraph",displayMode:"desktop",style:{base:{default:{"margin-top":"14px","margin-bottom":"14px"}}}},settings:{}}}),zw=/<\s*(script|style|iframe|object|embed|link|meta|base|form)\b[^>]*>[\s\S]*?<\s*\/\s*\1\s*>/gi,Aw=/<\s*\/?\s*(script|style|iframe|object|embed|link|meta|base|form)\b[^>]*>/gi,_w=/\son[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,Dw=/\s(href|src|xlink:href)\s*=\s*(?:"\s*(?:javascript|data|vbscript)\s*:[^"]*"|'\s*(?:javascript|data|vbscript)\s*:[^']*'|(?:javascript|data|vbscript)\s*:[^\s>]*)/gi,Pw=K(({ref:e,className:t="",content:n="",format:r="html",mediaBaseUrl:i=""})=>{let{settings:{previewMode:a}}=U(),o=ve(()=>"html"===r?((e,t)=>{if(!t)return e;let n=t.replace(/\/+$/,"");return e.replace(/\s(src|href)\s*=\s*"(\/(?!\/)[^"]*)"/gi,(e,t,r)=>` ${t}="${n}${r}"`)})((e=>e.replace(zw,"").replace(Aw,"").replace(_w,"").replace(Dw,""))(n),i):"",[r,n,i]);/* @__PURE__ */
|
|
220
220
|
return Ie(cf,{ref:e,className:vt("plitzi-component__rich-text",{"plitzi-component__rich-text--edit-mode":!a},t),children:["html"===r&&/* @__PURE__ */Ee("div",{dangerouslySetInnerHTML:{__html:o}}),"markdown"===r&&/* @__PURE__ */Ee(Tw,{children:n}),"text"===r&&/* @__PURE__ */Ee("div",{className:"plitzi-component__rich-text-plain",children:n})]})}),Rw=Object.assign(Pw,{type:"richText",content:{attributes:{content:"",format:"html",mediaBaseUrl:""},definition:{label:"Rich Text",type:"richText",description:"Renders a body field coming from a CMS — HTML, markdown or plain text. Scripts and event handlers are stripped before rendering, so third-party content cannot execute.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-align-left"},defaultStyle:{name:"Rich Text",displayMode:"desktop",style:{base:{default:{}}},subTypes:{}},settings:{}}}),Mw=K(({ref:e,content:t="Text",className:n=""})=>{let{id:r}=Wh(),{settings:{previewMode:i},contexts:{BuilderContext:a}}=U(),o=a?pe(a):void 0,s=ve(()=>"string"!=typeof t&&"number"!=typeof t?JSON.stringify(t):t||""===t||i?"number"==typeof t?`${t}`:t:"Text",[t,i]),l=he(e=>o?.updateElement(r,"content",e),[o,r]);/* @__PURE__ */
|
|
221
|
-
return Ie(cf,{ref:e,className:vt("plitzi-component__text",n),children:[i&&s,!i&&/* @__PURE__ */Ee(Df,{className:"focus-visible:outline-hidden",value:s,onChange:l,openMode:"doubleClick"})]})}),Lw=Object.assign(Mw,{type:"text",content:{attributes:{content:"Text"},definition:{label:"Text",type:"text",description:"Inline plain-text content. Use for short runs of copy; bind its content to data for dynamic text.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-align-left"},defaultStyle:{name:"Text",displayMode:"desktop",style:{base:{default:{"font-size":"14px","line-height":"24px",display:"inline"}}}},settings:{}}}),jw=()=>()=>{},Fw=()=>!0,$w=()=>!1,Vw=()=>/* @__PURE__ */Ie("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:[/* @__PURE__ */Ee("circle",{cx:"12",cy:"12",r:"4.2"}),/* @__PURE__ */Ee("path",{strokeLinecap:"round",d:"M12 2.6v2.2M12 19.2v2.2M4.2 12H2M22 12h-2.2M6.3 6.3 4.8 4.8M19.2 19.2l-1.5-1.5M17.7 6.3l1.5-1.5M4.8 19.2l1.5-1.5"})]}),qw=()=>/* @__PURE__ */Ee("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:/* @__PURE__ */Ee("path",{strokeLinejoin:"round",d:"M20.5 14.3A8.6 8.6 0 0 1 9.7 3.5a8.6 8.6 0 1 0 10.8 10.8Z"})}),Bw=K(({ref:e,className:t="",subType:n="switch",lightLabel:r="Light",darkLabel:i="Dark",systemLabel:a="System",showSystem:o=!1})=>{let{theme:s,setTheme:l,toggleTheme:c}=Ch(),{id:u,definition:{styleSelectors:d}}=Wh(),{settings:{previewMode:p},contexts:{InteractionsContext:h}}=U(),{interactionsManager:f}=pe(h),m=Se(jw,Fw,$w),g=he(e=>t=>{t.preventDefault(),p&&l(e)},[p,l]),y=he(e=>{e.preventDefault(),p&&c()},[p,c]),b=ve(()=>[...o?[{value:"system",label:a,icon:null}]:[],{value:"light",label:r,icon:/* @__PURE__ */Ee(Vw,{})},{value:"dark",label:i,icon:/* @__PURE__ */Ee(qw,{})}],[o,a,r,i]),v=ke(null);me(()=>{let e=v.current;v.current=s,null!==e&&e!==s&&f.interactionTrigger(u,"onThemeChange",{theme:s})},[s,f,u]);let x=ve(()=>({onThemeChange:{action:"onThemeChange",title:"On Theme Change",type:"trigger",params:{},preview:{theme:"dark"}}}),[]);return"segmented"===n?/* @__PURE__ */Ee(cf,{ref:e,tag:"div",className:vt("plitzi-component__theme-toggle plitzi-component__theme-toggle--segmented",t),interactionTriggers:x,children:b.map(e=>/* @__PURE__ */Ie("button",{type:"button",className:vt("plitzi-component__theme-toggle-option",d.option),"data-active":m&&s===e.value?"true":void 0,"data-theme-option":e.value,onClick:g(e.value),children:[e.icon,/* @__PURE__ */Ee("span",{children:e.label})]},e.value))}):/* @__PURE__ */Ie(cf,{ref:e,tag:"button",className:vt("plitzi-component__theme-toggle plitzi-component__theme-toggle--switch",t),interactionTriggers:x,type:"button",onClick:y,"aria-label":`${r} / ${i}`,title:`${r} / ${i}`,children:[/* @__PURE__ */Ee("span",{className:vt("plitzi-component__theme-toggle-icon",d.icon),"data-theme-icon":"light",children:/* @__PURE__ */Ee(Vw,{})}),/* @__PURE__ */Ee("span",{className:vt("plitzi-component__theme-toggle-icon",d.icon),"data-theme-icon":"dark",children:/* @__PURE__ */Ee(qw,{})})]})}),Uw=Object.assign(Bw,{type:"themeToggle",content:{attributes:{subType:"switch",lightLabel:"Light",darkLabel:"Dark",systemLabel:"System",showSystem:!1},definition:{label:"Theme Toggle",type:"themeToggle",description:"Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: style it with the space own classes, and use `data-theme-icon` to decide which icon each scheme shows.",items:[],bindings:{},styleSelectors:{base:"",icon:"",option:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-circle-half-stroke"},defaultStyle:{name:"Theme Toggle",displayMode:"desktop",style:{base:{default:{display:"inline-flex","align-items":"center",cursor:"pointer"}}},subTypes:{}},settings:{}}}),Hw={type:"form",sourceType:"apiContainer",content:{attributes:{method:"get",actionUrl:"",managedByInteractions:!1,errors:{},values:{}},definition:{label:"Form",type:"form",description:"A <form> that groups form controls and handles submission; wire its submit through an interaction flow.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"form",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee"},defaultStyle:{name:"Form",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}},Ww=K(({ref:e,className:t="",children:n,method:r="get",actionUrl:i="",managedByInteractions:a=!1,errors:o=
|
|
222
|
-
return Ee(cf,{tag:"form",ref:e,method:r,className:vt("plitzi-component__form",t),interactionTriggers:I,interactionCallbacks:
|
|
221
|
+
return Ie(cf,{ref:e,className:vt("plitzi-component__text",n),children:[i&&s,!i&&/* @__PURE__ */Ee(Df,{className:"focus-visible:outline-hidden",value:s,onChange:l,openMode:"doubleClick"})]})}),Lw=Object.assign(Mw,{type:"text",content:{attributes:{content:"Text"},definition:{label:"Text",type:"text",description:"Inline plain-text content. Use for short runs of copy; bind its content to data for dynamic text.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-align-left"},defaultStyle:{name:"Text",displayMode:"desktop",style:{base:{default:{"font-size":"14px","line-height":"24px",display:"inline"}}}},settings:{}}}),jw=()=>()=>{},Fw=()=>!0,$w=()=>!1,Vw=()=>/* @__PURE__ */Ie("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:[/* @__PURE__ */Ee("circle",{cx:"12",cy:"12",r:"4.2"}),/* @__PURE__ */Ee("path",{strokeLinecap:"round",d:"M12 2.6v2.2M12 19.2v2.2M4.2 12H2M22 12h-2.2M6.3 6.3 4.8 4.8M19.2 19.2l-1.5-1.5M17.7 6.3l1.5-1.5M4.8 19.2l1.5-1.5"})]}),qw=()=>/* @__PURE__ */Ee("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:/* @__PURE__ */Ee("path",{strokeLinejoin:"round",d:"M20.5 14.3A8.6 8.6 0 0 1 9.7 3.5a8.6 8.6 0 1 0 10.8 10.8Z"})}),Bw=K(({ref:e,className:t="",subType:n="switch",lightLabel:r="Light",darkLabel:i="Dark",systemLabel:a="System",showSystem:o=!1})=>{let{theme:s,setTheme:l,toggleTheme:c}=Ch(),{id:u,definition:{styleSelectors:d}}=Wh(),{settings:{previewMode:p},contexts:{InteractionsContext:h}}=U(),{interactionsManager:f}=pe(h),m=Se(jw,Fw,$w),g=he(e=>t=>{t.preventDefault(),p&&l(e)},[p,l]),y=he(e=>{e.preventDefault(),p&&c()},[p,c]),b=ve(()=>[...o?[{value:"system",label:a,icon:null}]:[],{value:"light",label:r,icon:/* @__PURE__ */Ee(Vw,{})},{value:"dark",label:i,icon:/* @__PURE__ */Ee(qw,{})}],[o,a,r,i]),v=ke(null);me(()=>{let e=v.current;v.current=s,null!==e&&e!==s&&f.interactionTrigger(u,"onThemeChange",{theme:s})},[s,f,u]);let x=ve(()=>({onThemeChange:{action:"onThemeChange",title:"On Theme Change",type:"trigger",params:{},preview:{theme:"dark"}}}),[]);return"segmented"===n?/* @__PURE__ */Ee(cf,{ref:e,tag:"div",className:vt("plitzi-component__theme-toggle plitzi-component__theme-toggle--segmented",t),interactionTriggers:x,children:b.map(e=>/* @__PURE__ */Ie("button",{type:"button",className:vt("plitzi-component__theme-toggle-option",d.option),"data-active":m&&s===e.value?"true":void 0,"data-theme-option":e.value,onClick:g(e.value),children:[e.icon,/* @__PURE__ */Ee("span",{children:e.label})]},e.value))}):/* @__PURE__ */Ie(cf,{ref:e,tag:"button",className:vt("plitzi-component__theme-toggle plitzi-component__theme-toggle--switch",t),interactionTriggers:x,type:"button",onClick:y,"aria-label":`${r} / ${i}`,title:`${r} / ${i}`,children:[/* @__PURE__ */Ee("span",{className:vt("plitzi-component__theme-toggle-icon",d.icon),"data-theme-icon":"light",children:/* @__PURE__ */Ee(Vw,{})}),/* @__PURE__ */Ee("span",{className:vt("plitzi-component__theme-toggle-icon",d.icon),"data-theme-icon":"dark",children:/* @__PURE__ */Ee(qw,{})})]})}),Uw=Object.assign(Bw,{type:"themeToggle",content:{attributes:{subType:"switch",lightLabel:"Light",darkLabel:"Dark",systemLabel:"System",showSystem:!1},definition:{label:"Theme Toggle",type:"themeToggle",description:"Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: style it with the space own classes, and use `data-theme-icon` to decide which icon each scheme shows.",items:[],bindings:{},styleSelectors:{base:"",icon:"",option:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"basic",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-circle-half-stroke"},defaultStyle:{name:"Theme Toggle",displayMode:"desktop",style:{base:{default:{display:"inline-flex","align-items":"center",cursor:"pointer"}}},subTypes:{}},settings:{}}}),Hw={type:"form",sourceType:"apiContainer",content:{attributes:{method:"get",actionUrl:"",managedByInteractions:!1,errors:{},values:{}},definition:{label:"Form",type:"form",description:"A <form> that groups form controls and handles submission; wire its submit through an interaction flow.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"form",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee"},defaultStyle:{name:"Form",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}},Ww=K(({ref:e,className:t="",children:n,method:r="get",actionUrl:i="",managedByInteractions:a=!1,errors:o=Y,values:l=Y})=>{let[c,u]=we({}),d=ke(/* @__PURE__ */new Map),p=ke(!1),{id:h,definition:{label:f="Form"},setElementState:m}=Wh(),g=Bp(Hw.sourceType,h),{settings:{previewMode:y},contexts:{InteractionsContext:b}}=U(),{interactionsManager:v}=pe(b),x=he(e=>u(t=>({...t,[e.name]:e})),[u]);me(()=>(p.current=!1,()=>{p.current=!0}),[]);let k=he(e=>{p.current||(u(t=>J(t,t=>{t[e]&&delete t[e]})),e&&m(t=>({...t,values:X(t,`values.${e}`),errors:X(t,`errors.${e}`)})))},[m]),w=he((e,t)=>{d.current.set(e,t)},[]),S=he(e=>{d.current.delete(e)},[]),N=he((e,t="")=>{e&&(null===t&&(t=""),m(n=>n.errors&&n.errors[e]?{...n,values:{...n.values,[e]:t},errors:X(n.errors,[e])}:{...n,values:{...n.values,[e]:t}}))},[m]),T=he((e,t)=>{e&&m(n=>t||s(n,`errors.${e}`)?!t&&n.errors&&n.errors[e]?{...n,errors:X(n,[`errors.${e}`])}:{...n,errors:{...n.errors,[e]:t}}:n)},[m]),C=he(()=>Object.values(c).filter(e=>!!e.name).reduce((e,t)=>[...e,{path:`fields.${t.name}.id`,name:`${t.name} ID`},{path:`values.${t.name}`,name:`${t.name} Value`},{path:`errors.${t.name}`,name:`${t.name} Error Message`}],[]),[c]),E=ve(()=>({runtime:{sources:{form:{errors:o,values:l,registerField:x,unregisterField:k,registerValidator:w,unregisterValidator:S,setFieldValue:N,setFieldError:T},[g]:{values:l,errors:o}}}}),[g,o,l,x,k,w,S,N,T]);Up({id:h,source:g,name:f||`Form - ${h}`,fields:C});let I=ve(()=>({onSubmit:{action:"onSubmit",title:"On Form Submit",type:"trigger",params:{},preview:{values:Object.values(c).reduce((e,t)=>({...e,[t.name]:""}),{}),actionUrl:"",method:""}}}),[c]),O=he(e=>{let t=[...d.current].reduce((e,[t,n])=>{let r=n(l);return r?{...e,[t]:r}:e},{});if(m(e=>({...e,errors:t})),Object.keys(t).length>0)return e.stopPropagation(),void e.preventDefault();if(!a||(e.stopPropagation(),e.preventDefault(),!y))return;let n=Object.values(c).reduce((e,{name:t})=>({...e,[t]:l[t]}),{});v.interactionTrigger(h,"onSubmit",{values:n,actionUrl:i,method:r})},[m,a,y,c,v,h,i,r,l]),z=he(e=>{a&&(e instanceof Event&&(e.stopPropagation(),e.preventDefault()),m(e=>({...e,values:{},errors:{}})))},[m,a]),A=he(e=>{let{name:t,value:n}=e;N(t,n)},[N]),_=he(e=>{let{name:t,error:n}=e;T(t,n)},[T]),D=ve(()=>({performReset:{action:"performReset",title:`Reset ${f}`,type:"callback",callback:z,params:{}},setFieldValue:{action:"setFieldValue",title:`Set Field Value ${f}`,type:"callback",callback:A,preview:{},params:{name:{label:"Field Name",defaultValue:void 0,type:"select",options:Object.values(c).map(e=>({value:e.name,label:e.name}))},value:{type:"text",defaultValue:""}}},setFieldError:{action:"setFieldError",title:`Set Field Error ${f}`,type:"callback",callback:_,preview:{},params:{name:{label:"Field Name",defaultValue:void 0,type:"select",options:Object.values(c).map(e=>({value:e.name,label:e.name}))},error:{type:"text",defaultValue:""}}}}),[f,z,A,c,_]);/* @__PURE__ */
|
|
222
|
+
return Ee(cf,{tag:"form",ref:e,method:r,className:vt("plitzi-component__form",t),interactionTriggers:I,interactionCallbacks:D,onSubmit:O,onReset:z,action:i,children:/* @__PURE__ */Ee(ct,{inherit:"live",name:`Form:${h}`,value:E,children:n})})}),Gw=e=>/* @__PURE__ */Ie("svg",{...e,viewBox:"0 0 19 18",fill:"none",children:[
|
|
223
223
|
/* @__PURE__ */Ee("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 12.5C0.447715 12.5 0 12.9477 0 13.5V16.5C0 17.0523 0.447715 17.5 1 17.5H18C18.5523 17.5 19 17.0523 19 16.5V13.5C19 12.9477 18.5523 12.5 18 12.5H1ZM17 14.5H2V15.5H17V14.5Z",fill:"currentColor"}),
|
|
224
224
|
/* @__PURE__ */Ee("path",{d:"M0 10.5C0 9.94772 0.447715 9.5 1 9.5H11C11.5523 9.5 12 9.94772 12 10.5C12 11.0523 11.5523 11.5 11 11.5H1C0.447715 11.5 0 11.0523 0 10.5Z",fill:"currentColor"}),
|
|
225
225
|
/* @__PURE__ */Ee("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 3.5C0.447715 3.5 0 3.94772 0 4.5V7.5C0 8.05228 0.447715 8.5 1 8.5H18C18.5523 8.5 19 8.05228 19 7.5V4.5C19 3.94772 18.5523 3.5 18 3.5H1ZM17 5.5H2V6.5H17V5.5Z",fill:"currentColor"}),
|
|
226
226
|
/* @__PURE__ */Ee("path",{d:"M0 1.5C0 0.947715 0.447715 0.5 1 0.5H11C11.5523 0.5 12 0.947715 12 1.5C12 2.05228 11.5523 2.5 11 2.5H1C0.447715 2.5 0 2.05228 0 1.5Z",fill:"currentColor"})]}),Jw=Object.assign(Ww,{...Hw,content:{...Hw.content,market:{...Hw.content.market,icon:/* @__PURE__ */Ee(Gw,{})}}}),Kw={width:"100%",display:"flex","align-items":"center","border-right-color":"#6f7780","border-right-style":"solid","border-right-width":"1px","border-top-right-radius":"4px","border-bottom-color":"#6f7780","border-bottom-style":"solid","border-bottom-width":"1px","border-bottom-right-radius":"4px","border-bottom-left-radius":"4px","border-top-left-radius":"4px","border-left-color":"#6f7780","border-left-style":"solid","border-left-width":"1px","border-top-color":"#6f7780","border-top-style":"solid","border-top-width":"1px","user-select":"none","font-size":"14px","padding-left":"16px","padding-right":"16px","padding-top":"8px","padding-bottom":"8px","line-height":"20px",outline:"none",position:"relative"},Qw={display:"flex",cursor:"pointer","font-weight":"600","font-size":"14px","line-height":"18px",color:"#6b7280","user-select":"none"},Yw={...Qw,"margin-bottom":"4px"},Xw={display:"block",color:"red","margin-top":"4px"},Zw={type:"formControl",content:{attributes:{subType:"text",name:"",label:"Label",placeholder:"",defaultValue:"",autoComplete:!0,disabled:!1,options:[],required:!0,minLength:0,maxLength:0,pattern:"",patternMessage:"",matches:"",matchesMessage:"",readOnly:!1},definition:{label:"Form Control",type:"formControl",description:"A single labelled input (text/select/checkbox/… per its subType) inside a form; captures one field of user input.",bindings:{},styleSelectors:{base:"",label:"",input:"",error:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!1,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"form",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee"},defaultStyle:{name:"Form Control",displayMode:"desktop",style:{base:{default:{}}},subTypes:{hidden:{name:"Form Control Hidden",displayMode:"desktop",style:{base:{},input:{default:{}},label:{default:Yw},error:{default:Xw}}},text:{name:"Form Control Text",displayMode:"desktop",style:{base:{default:{}},input:{default:Kw},label:{default:Yw},error:{default:Xw}}},password:{name:"Form Control Password",displayMode:"desktop",style:{base:{default:{}},input:{default:Kw},label:{default:Yw},error:{default:Xw}}},number:{name:"Form Control Number",displayMode:"desktop",style:{base:{default:{}},input:{default:Kw},label:{default:Yw},error:{default:Xw}}},email:{name:"Form Control Email",displayMode:"desktop",style:{base:{default:{}},input:{default:Kw},label:{default:Yw},error:{default:Xw}}},textarea:{name:"Form Control Textarea",displayMode:"desktop",style:{base:{default:{}},input:{default:Kw},label:{default:Yw},error:{default:Xw}}},checkbox:{name:"Form Control Checkbox",displayMode:"desktop",style:{base:{default:{}},input:{default:{"margin-top":"0px","margin-bottom":"0px","margin-left":"0px","margin-right":"4px"}},label:{default:Qw},error:{default:Xw}}},select:{name:"Form Control Select",displayMode:"desktop",style:{base:{default:{}},input:{default:{...Kw,cursor:"pointer"}},label:Yw,error:{default:Xw}}}}},settings:{}}},eS=({ref:e,children:t,targetInput:n="",type:r="text",previewMode:i=!0,required:a=!0,className:o=""})=>{let s=he(e=>{i||e.preventDefault()},[i]);/* @__PURE__ */
|
|
227
|
-
return Ie("label",i?{ref:e,className:vt(`form-control__label-${r}`,o),htmlFor:n,children:[t,a&&t&&/* @__PURE__ */Ee("span",{className:"form-control__label--required",children:"*"})]}:{ref:e,className:vt(`form-control__label-${r}`,o),onClick:s,children:[t,a&&t&&/* @__PURE__ */Ee("span",{className:"form-control__label--required",children:"*"})]})},tS=e=>"string"==typeof e?e:"number"==typeof e?String(e):"",nS=(e,t,n)=>{if((e=>null==e||""===e||!1===e)(e))return t.required?"This field is required":"";if("boolean"==typeof e)return"";let r=tS(e),i=Array.from(r).length;return t.minLength>0&&i<t.minLength?`Use at least ${t.minLength} characters`:t.maxLength>0&&i>t.maxLength?`Use at most ${t.maxLength} characters`:t.pattern&&!((e,t)=>{try{return RegExp(`^(?:${t})$`,"u").test(e)}catch{return!1}})(r,t.pattern)?t.patternMessage||"This is not in the expected format":t.matches&&r!==tS(
|
|
227
|
+
return Ie("label",i?{ref:e,className:vt(`form-control__label-${r}`,o),htmlFor:n,children:[t,a&&t&&/* @__PURE__ */Ee("span",{className:"form-control__label--required",children:"*"})]}:{ref:e,className:vt(`form-control__label-${r}`,o),onClick:s,children:[t,a&&t&&/* @__PURE__ */Ee("span",{className:"form-control__label--required",children:"*"})]})},tS=e=>"string"==typeof e?e:"number"==typeof e?String(e):"",nS=(e,t,n)=>{if((e=>null==e||""===e||!1===e)(e))return t.required?"This field is required":"";if("boolean"==typeof e)return"";let r=tS(e),i=Array.from(r).length;return t.minLength>0&&i<t.minLength?`Use at least ${t.minLength} characters`:t.maxLength>0&&i>t.maxLength?`Use at most ${t.maxLength} characters`:t.pattern&&!((e,t)=>{try{return RegExp(`^(?:${t})$`,"u").test(e)}catch{return!1}})(r,t.pattern)?t.patternMessage||"This is not in the expected format":t.matches&&r!==tS(s(n,t.matches,""))?t.matchesMessage||"This does not match":""},rS=({className:e="",id:t="",name:n="",placeholder:r="",value:i="",required:a=!0,disabled:o=!1,onChange:s,onValidate:l})=>{let c=he(()=>l?.(),[l]);/* @__PURE__ */
|
|
228
228
|
return Ee("input",{className:vt("form-control__checkbox-container",e),id:t,name:n,type:"checkbox",placeholder:r,value:i,required:a,disabled:o,onChange:s,onBlur:c})},iS=({className:e="",id:t="",name:n="",value:r="",required:i=!0,disabled:a=!1,previewMode:o=!0})=>/* @__PURE__ */Ie("div",{className:vt("form-control__input-hidden-container",e),children:[o&&/* @__PURE__ */Ee("input",{className:"input-container__input-hidden",id:t,name:n,type:"hidden",value:r,required:i,disabled:a}),!o&&/* @__PURE__ */Ee("div",{className:"input-container__input-hidden--no-preview",children:"hidden input"})]}),aS=({className:e="",id:t="",name:n="",placeholder:r="",value:i="",type:a="text",autoComplete:o=!1,required:s=!0,maxLength:l=0,disabled:c=!1,readOnly:u=!1,onChange:d,onValidate:p})=>{let[h,f]=we(!1),m=ke(null),g=he(()=>f(e=>!e),[f]),y=he(()=>{m.current?.focus()},[m]),b=he(()=>p?.(),[p]);/* @__PURE__ */
|
|
229
229
|
return Ie("div",{className:vt("form-control__input-container",e),onClick:y,children:[
|
|
230
230
|
/* @__PURE__ */Ee("input",{ref:m,className:"input-container__input",id:t,name:n,type:"password"===a&&h?"text":a,placeholder:r,value:i,required:s,maxLength:l>0?l:void 0,autoComplete:o?"on":"off",disabled:c,readOnly:u,onChange:d,onBlur:b}),"password"===a&&!h&&/* @__PURE__ */Ee("div",{className:"form-input__icon",onClick:g,children:/* @__PURE__ */Ee("i",{className:"fa-solid fa-eye"})}),"password"===a&&h&&/* @__PURE__ */Ee("div",{className:"form-input__icon",onClick:g,children:/* @__PURE__ */Ee("i",{className:"fa-solid fa-eye-slash"})})]})},oS=({id:e="",name:t,options:n=[],placeholder:r="",value:i="",className:a="",disabled:o=!1,onChange:s,onValidate:l})=>{let c=ke(null),u=he(()=>{c.current?.click()},[c]),d=he(e=>{e.stopPropagation()},[]),p=he(()=>l?.(),[l]),h=ve(()=>Array.isArray(n)?n.map(e=>{if("string"==typeof e)return{value:e,label:e};if(void 0===e.value||void 0===e.label){let t=e.value??e.label??"";return{value:t,label:t}}return{value:e.value,label:e.label}}):[],[n]);/* @__PURE__ */
|
|
231
231
|
return Ee("div",{className:vt("form-control__select-container",a),onClick:u,children:/* @__PURE__ */Ie("select",{ref:c,id:e,name:t,onChange:s,value:i,className:"select-container__select",disabled:o,onClick:d,onBlur:p,children:[r&&/* @__PURE__ */Ee("option",{value:"",children:r}),h.map((e,t)=>/* @__PURE__ */Ee("option",{value:e.value,children:e.label},t))]})})},sS=({className:e="",id:t="",name:n="",placeholder:r="",value:i="",required:a=!0,maxLength:o=0,disabled:s=!1,readOnly:l=!1,onChange:c,onValidate:u})=>{let d=ke(null),p=he(e=>{e.stopPropagation()},[]),h=he(()=>u?.(),[u]);/* @__PURE__ */
|
|
232
|
-
return Ee("textarea",{ref:d,className:vt("form-control__textarea-container",e),id:t,name:n,placeholder:r,value:i,readOnly:l,required:a,maxLength:o>0?o:void 0,disabled:s,onChange:c,onBlur:h,onClick:p})},lS=K((e=>{let t=t=>{let{ref:n,name:r="",subType:i="text",defaultValue:a="",required:o=!0,minLength:
|
|
232
|
+
return Ee("textarea",{ref:d,className:vt("form-control__textarea-container",e),id:t,name:n,placeholder:r,value:i,readOnly:l,required:a,maxLength:o>0?o:void 0,disabled:s,onChange:c,onBlur:h,onClick:p})},lS=K((e=>{let t=t=>{let{ref:n,name:r="",subType:i="text",defaultValue:a="",required:o=!0,minLength:l=0,maxLength:c=0,pattern:u="",patternMessage:d="",matches:p="",matchesMessage:h="",previewError:f=!1}=t,{settings:{previewMode:m}}=U(),{useStore:g}=te(),[y]=g("runtime.sources.form");if(!y)/* @__PURE__ */return Ee(e,{...t});let{setFieldValue:b,setFieldError:v,registerValidator:x,unregisterValidator:k,errors:w,values:S}=y,N=ve(()=>s(S,r,a),[S,r,a]),T=ve(()=>!m&&f?"This is an error message":w[r],[m,f,w,r]),C=ve(()=>({required:o,minLength:l,maxLength:c,pattern:u,patternMessage:d,matches:p,matchesMessage:h}),[o,l,c,u,d,p,h]);me(()=>{if(r)return x(r,e=>nS(s(e,r,a),C,e)),()=>k(r)},[r,a,C,x,k]),me(()=>{a&&N&&r&&b(r,N)},[a,r,b,N]);let E=he(e=>{"radio"===e.target.type||"checkbox"===e.target.type||"switch"===i?b(r,e.target.checked):b(r,e.target.value)},[b,r,i]),I=he(()=>v(r,nS(N,C,S)),[N,C,S,r,v]);return ve(()=>/* @__PURE__ */Ee(e,{...t,ref:n,value:N,error:T,handleChange:E,handleValidate:I}),[t,n,T,N,E,I])};return t.displayName=`withFieldValue(${Z(e)})`,t})(({ref:e,className:t="",subType:n="text",name:r="",label:i="Label",placeholder:a="",autoComplete:o=!0,disabled:s=!1,options:l=[],required:c=!0,maxLength:u=0,readOnly:d=!1,value:p="",error:h="",handleChange:f,handleValidate:m})=>{let{id:g,rootId:y,definition:{styleSelectors:b}}=Wh(),{settings:{previewMode:v},contexts:{InteractionsContext:x}}=U(),{interactionsManager:k}=pe(x),{useStore:w}=te(),[S]=w("runtime.sources.form"),N=ve(()=>({onChange:{action:"onChange",title:"On Change",type:"trigger",params:{},preview:{value:"",name:""}}}),[]),T=he(e=>{if(f?.(e),!v)return;let t=e.target,i="checkbox"===t.type||"switch"===n?t.checked:t.value;k.interactionTrigger(g,"onChange",{value:i,name:r})},[f,v,n,k,g,r]);if(!S&&!v)/* @__PURE__ */return Ee(cf,{ref:e,className:vt("plitzi-component__form-input",{"form-input--out-of-context":!v},t),children:/* @__PURE__ */Ee("div",{children:"Form Input Only Works inside Form element"})});if(!S&&v)return null;let{registerField:C,unregisterField:E}=S,I=["checkbox","switch"].includes(n),O="hidden"===n;return me(()=>(C&&C({name:r,path:r}),()=>{E&&E(r)}),[r,C,E]),/* @__PURE__ */Ie(cf,{ref:e,interactionTriggers:N,className:vt("plitzi-component__form-control",{"form-control--invalid":h&&v,[`plitzi-component__form-control-${n}`]:n},t),children:[!I&&!O&&i&&/* @__PURE__ */Ee(eS,{targetInput:`${y}_${g}`,previewMode:v,className:b.label,type:n,required:c,children:i}),I&&i&&/* @__PURE__ */Ie(eS,{targetInput:`${y}_${g}`,previewMode:v,className:b.label,type:n,required:c,children:["checkbox"===n&&/* @__PURE__ */Ee(rS,{id:`${y}_${g}`,name:r,value:p,className:b.input,placeholder:a,required:c,disabled:s,onChange:T,onValidate:m}),i]}),"checkbox"===n&&!i&&/* @__PURE__ */Ee(rS,{id:`${y}_${g}`,name:r,value:p,className:b.input,placeholder:a,required:c,disabled:s,onChange:T,onValidate:m}),["text","number","email","password","date","time"].includes(n)&&/* @__PURE__ */Ee(aS,{id:`${y}_${g}`,name:r,value:p,type:n,className:b.input,placeholder:a,autoComplete:"password"!==n&&o,required:c,maxLength:u,disabled:s,readOnly:d||!v,onChange:T,onValidate:m}),"hidden"===n&&/* @__PURE__ */Ee(iS,{id:`${y}_${g}`,name:r,value:p,required:c,disabled:s,previewMode:v}),"select"===n&&/* @__PURE__ */Ee(oS,{id:`${y}_${g}`,name:r,onChange:T,onValidate:m,value:p,className:b.input,placeholder:a,disabled:s,options:l}),"textarea"===n&&/* @__PURE__ */Ee(sS,{id:`${y}_${g}`,name:r,value:p,className:b.input,placeholder:a,required:c,maxLength:u,disabled:s,readOnly:d,onChange:T,onValidate:m}),h&&/* @__PURE__ */Ee("div",{className:vt("form-control__error-message",b.error),children:h})]})})),cS=Object.assign(lS,{...Zw,content:{...Zw.content,market:{...Zw.content.market,icon:/* @__PURE__ */Ee(Gw,{})}}}),uS=K(({ref:e,className:t="",children:n,subType:r="div"})=>{let{plitziElementLayout:i}=Wh(),{settings:{previewMode:a}}=U(),o=he((e,t)=>{if(!e||!t)return;let n=t.getBoundingClientRect(),r=n.top-0,i=n.left-0,a=i+n.width+0,o=r+n.height+0,s=`\n polygon(\n evenodd,\n /* outer rect */\n 0 0, 100% 0, 100% 100%, 0% 100%, 0 0,\n /* inner rect */ \n ${i}px ${r}px, ${a}px ${r}px, ${a}px ${o}px, ${i}px ${o}px, ${i}px ${r}px\n )`;e.style.setProperty("--child-clip",s)},[]);return me(()=>{if(!i||!e?.current||a)return;let t=yt(()=>{let t=e.current,n=t.querySelector(".plitzi-component--layout-body");o(t,n)},150),n=new ResizeObserver(t);n.observe(e.current);let r=e.current.querySelector(".plitzi-component--layout-body");return r&&n.observe(r),()=>{t.cancel(),n.disconnect()}},[i,a,e,o]),/* @__PURE__ */Ee(cf,{ref:e,tag:r,className:vt("plitzi-component__layout-container",t),children:n})}),dS=Object.assign(uS,{type:"layoutContainer",content:{attributes:{subType:"div"},definition:{label:"Layout Container",type:"layoutContainer",description:"A reusable layout shell (header/footer chrome) shared across pages.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!1,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"internal",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-border-all"},defaultStyle:{name:"Layout Container",displayMode:"desktop",style:{base:{default:{}}},subTypes:{}},settings:{}}}),pS=K(({ref:e,className:t=""})=>{let{definition:{label:n}}=Wh();/* @__PURE__ */
|
|
233
233
|
return Ee(cf,{ref:e,className:vt("plitzi-component__loading",t),children:/* @__PURE__ */Ie("span",{children:[/* @__PURE__ */Ee("b",{children:n})," Loading..."]})})}),hS=Object.assign(pS,{type:"loading",content:{attributes:{},definition:{label:"Loading",type:"loading",description:"A loading placeholder shown while data or a suspense boundary resolves.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!1,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"internal",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"https://cdn.plitzi.com/resources/img/favicon.svg"},defaultStyle:{name:"Loading",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}}),fS=Object.assign(pf,{type:"notFound",content:{attributes:{},definition:{label:"Not Found",type:"notFound",description:"The 404 screen shown when no route matches.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!1,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"internal",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"https://cdn.plitzi.com/resources/img/favicon.svg"},defaultStyle:{name:"Not Found",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}}),mS=/*#__PURE__*/function(e){return e.CHARSET="charset",e.CSS_TEXT="cssText",e.HREF="href",e.HTTPEQUIV="http-equiv",e.INNER_HTML="innerHTML",e.ITEM_PROP="itemprop",e.NAME="name",e.PROPERTY="property",e.REL="rel",e.SRC="src",e.TARGET="target",e}({}),gS=/*#__PURE__*/function(e){return e.BASE="base",e.BODY="body",e.FRAGMENT="Symbol(react.fragment)",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e}({}),yS={rel:["amphtml","canonical","alternate"]},bS={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},vS={type:["application/ld+json"]},xS=Object.values(gS),kS={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},wS=(()=>{const e={};for(const[t,n]of Object.entries(kS))e[n]=t;return e})(),SS="data-rh",NS=!("undefined"==typeof window||!window.document.createElement);function TS(e,t){for(let n=e.length-1;n>=0;--n){const r=e[n][1][t];if(void 0!==r)return r}}function CS(e){let t=TS(e,gS.TITLE);const n=TS(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=TS(e,"defaultTitle");return(t||r)??void 0}function ES(e,t){const n={};for(const r of t){const t=r[1][e];t&&Object.assign(n,t)}return n}function IS(e){for(let t=e.length-1;t>=0;--t){const n=e[t][1].base;if(n?.href||n?.target)return n}}function OS(e,t,n){const r={};return n.map(([,e])=>e).filter(t=>!!Array.isArray(t[e])||(t[e],!1)).map(t=>t[e]).reverse().reduce((e,n)=>{const i={};n.filter(e=>{const n=function(e,t){let n;for(const r of Object.keys(e)){const i=r;!t.includes(i)||n===mS.REL&&"canonical"===e[n].toLowerCase()||i===mS.REL&&"stylesheet"===e[i].toLowerCase()||(n=i),!t.includes(i)||i!==mS.INNER_HTML&&i!==mS.CSS_TEXT&&i!==mS.ITEM_PROP||(n=i)}return n??null}(e,t);if(!n||!e[n])return!1;const a=e[n].toLowerCase();return r[n]||(r[n]={}),i[n]||(i[n]={}),!r[n][a]&&(i[n][a]=!0,!0)}).reverse().forEach(t=>{e.push(t)});const a=Object.keys(i);for(const t of a){const e={...r[t],...i[t]};r[t]=e}return e},[]).reverse()}function zS(e){return Array.isArray(e)?e.join(""):e}function AS(e,t){for(const n of Object.keys(e))if(t[n]?.includes(e[n]))return!0;return!1}function _S(e,t){const n={default:Array(),priority:Array()};if(e)for(const r of e)AS(r,t)?n.priority.push(r):n.default.push(r);return n}function DS(e,t,n){const r=e[t];r?r.push(n):e[t]=[n]}function PS(e){let t=OS(gS.LINK,[mS.REL,mS.HREF],e),n=OS("meta",[mS.NAME,"charSet","httpEquiv",mS.PROPERTY,"itemProp"],e),r=OS("script",[mS.SRC,mS.INNER_HTML],e);const i=function(e){for(const[,t]of e)if(t.prioritizeSeoTags)return!0;return!1}(e);let a;if(i){const e=_S(t,yS);t=e.default;const i=_S(n,bS);n=i.default;const o=_S(r,vS);r=o.default,a={links:e.priority,meta:i.priority,script:o.priority}}return{base:IS(e),bodyAttributes:ES("bodyAttributes",e),defer:TS(e,"defer"),encodeSpecialCharacters:TS(e,"encodeSpecialCharacters")??!0,htmlAttributes:ES("htmlAttributes",e),links:t,meta:n,noscript:OS("noscript",[mS.INNER_HTML],e),onChangeClientState:TS(e,"onChangeClientState"),priority:a,script:r,style:OS("style",[mS.CSS_TEXT],e),title:CS(e),titleAttributes:ES("titleAttributes",e)}}function RS(e){return wS[e]??e}function MS(e,t){const n=document.head||document.querySelector(gS.HEAD),r=[],i=[...n.querySelectorAll(`${e}[${SS}]`)],a=[];for(const o of t){const t=document.createElement(e);for(const[e,r]of Object.entries(o))if(Object.prototype.hasOwnProperty.call(o,e)){const n=wS[e]??e;n===mS.INNER_HTML?t.innerHTML=r:n===mS.CSS_TEXT?t.styleSheet?t.styleSheet.cssText=o.cssText:t.appendChild(document.createTextNode(o.cssText)):t.setAttribute(n,r??"")}t.setAttribute(SS,"true");const n={};for(const{name:e,value:r}of t.attributes)n[e]=r;r.push(n);for(let e=0;;++e){if(t.isEqualNode(i[e])){i.splice(e,1);break}if(e>=i.length){a.push(t);break}}}return i.forEach(e=>{e.parentNode?.removeChild(e)}),a.forEach(e=>{n.appendChild(e)}),{allTags:r,newTags:a,oldTags:i}}function LS(e,t){const[n]=document.getElementsByTagName(e);if(!n)return;const r=n.getAttribute(SS),i=r?r.split(","):[],a=[...i],o=[];for(const s of Object.keys(t))o.push(wS[s]??s);for(const[s,l]of Object.entries(t)){const e=wS[s]??s;n.getAttribute(e)!==l&&n.setAttribute(e,l??""),i.includes(e)||i.push(e);const t=a.indexOf(e);-1!==t&&a.splice(t,1)}for(let s=a.length-1;s>=0;s-=1)n.removeAttribute(a[s]);i.length===a.length?n.removeAttribute(SS):n.getAttribute("data-rh")!==o.join(",")&&n.setAttribute(SS,o.join(","))}function jS(e,t){const{base:n,bodyAttributes:r,defer:i,htmlAttributes:a,links:o,meta:s,noscript:l,onChangeClientState:c,priority:u,script:d,style:p,title:h,titleAttributes:f}=e;LS(gS.BODY,r??{}),LS(gS.HTML,a??{}),function(e,t){void 0!==e&&document.title!==e&&(document.title=zS(e)),LS(gS.TITLE,t)}(h,f);const m={baseTag:MS(gS.BASE,n?[n]:[]),linkTags:MS(gS.LINK,[...u?.links??[],...o??[]]),metaTags:MS(gS.META,[...u?.meta??[],...s??[]]),noscriptTags:MS(gS.NOSCRIPT,l??[]),scriptTags:MS(gS.SCRIPT,[...u?.script??[],...d??[]]),styleTags:MS(gS.STYLE,p??[])},g={baseTag:[],bodyAttributes:{},defer:i??!1,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],onChangeClientState:c??(()=>{}),scriptTags:[],styleTags:[],title:h??"",titleAttributes:{}},y={},b={};Object.keys(m).forEach(e=>{const{allTags:t,newTags:n,oldTags:r}=m[e];g[e]=t,n.length&&(y[e]=n),r.length&&(b[e]=m[e].oldTags)}),(t||Object.keys(y).length||Object.keys(b).length)&&c?.(g,y,b)}var FS=[gS.NOSCRIPT,gS.SCRIPT,gS.STYLE],$S=(e,t=!0)=>t?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e;function VS(e){let t="";for(const[n,r]of Object.entries(e)){const e=RS(n),i=void 0===r?e:`${e}="${r}"`;i&&t&&(t+=" "),t+=i}return t}function qS(e,t,n){let r="";for(const i of t){let t="";const a=Object.entries(i);for(const[e,r]of a)if(e!==mS.INNER_HTML&&e!==mS.CSS_TEXT){const i=wS[e]??e;let a;a=void 0===r?i:`${i}="${$S("string"==typeof r?r:String(r),n)}"`,t?t+=` ${a}`:t=a}const o=i.innerHTML??i.cssText??"",s=!FS.includes(e);r+=`<${e} ${SS}="true" ${t}${s?"/>":`>${o}</${e}>`}`}return r}function BS(e,t={}){const n={};t.addHelmetDataAttr&&(n[SS]=!0),void 0!==t.addKey&&(n.key=t.addKey);for(const[r,i]of Object.entries(e)){const e=kS[r]??r;switch(e){case"cssText":case"innerHTML":n.dangerouslySetInnerHTML={__html:i};break;default:n[e]=i}}return n}function US(e,t,n){/*#__PURE__*/
|
|
234
234
|
return le(e,BS(t,{addHelmetDataAttr:!0,addKey:n}))}function HS(e,t){const n=[];for(let r=0;r<t.length;++r)n.push(US(e,t[r],r));return n}var WS=/*#__PURE__*/se(void 0),GS=({children:e,onServerState:t})=>{const n=ke(null);if(null===n.current){const e={firstRender:!0,helmets:[],state:void 0};t&&(e.serverState??=function(e){const t=()=>(e.state??=PS(e.helmets),e.state);return{base:{toComponent(){const e=t().base;return e?HS("base",[e]):[]},toString(){const e=t();return e.base?qS("base",[e.base],e.encodeSpecialCharacters):""}},bodyAttributes:{toComponent:()=>BS(t().bodyAttributes??{}),toString:()=>VS(t().bodyAttributes??{})},htmlAttributes:{toComponent:()=>BS(t().htmlAttributes??{}),toString:()=>VS(t().htmlAttributes??{})},link:{toComponent:()=>HS("link",t().links??[]),toString(){const e=t();return qS("link",e.links??[],e.encodeSpecialCharacters)}},meta:{toComponent:()=>HS("meta",t().meta??[]),toString(){const e=t();return qS("meta",e.meta??[],e.encodeSpecialCharacters)}},noscript:{toComponent:()=>HS("noscript",t().noscript??[]),toString(){const e=t();return qS("noscript",e.noscript??[],e.encodeSpecialCharacters)}},priority:{toComponent(){const e=t();return[...HS("meta",e.priority?.meta??[]),...HS("link",e.priority?.links??[]),...HS("script",e.priority?.script??[])]},toString(){const e=t(),n=qS("meta",e.priority?.meta??[],e.encodeSpecialCharacters),r=qS("link",e.priority?.links??[],e.encodeSpecialCharacters),i=qS("script",e.priority?.script??[],e.encodeSpecialCharacters);let a=n;return r&&(a&&(a+=" "),a+=r),i&&(a&&(a+=" "),a+=i),a}},script:{toComponent:()=>HS("script",t().script??[]),toString(){const e=t();return qS("script",e.script??[],e.encodeSpecialCharacters)}},style:{toComponent:()=>HS("style",t().style??[]),toString(){const e=t();return qS("style",e.style??[],e.encodeSpecialCharacters)}},title:{toComponent(){const e=t();return n=e.title??"",r=e.titleAttributes??{},[/*#__PURE__*/Ee("title",{...BS(r,{addHelmetDataAttr:!0}),children:n},n)];var n,r},toString(){const e=t();return((e,t,n)=>{let r=VS(t);r&&(r=` ${r}`);const i=zS(e);return`<title ${SS}="true"${r}>${$S(i,n)}</title>`})(e.title??"",e.titleAttributes??{},e.encodeSpecialCharacters)}}}}(e),t(e.serverState)),n.current=e}const r=n.current,[i]=we(()=>({clientApply(){NS&&!r.state&&(r.state=PS(r.helmets),r.state.defer?r.nextAnimFrameId??=requestAnimationFrame(()=>{r.state??=PS(r.helmets),jS(r.state,r.firstRender),r.firstRender=!1,delete r.nextAnimFrameId}):(void 0!==r.nextAnimFrameId&&(cancelAnimationFrame(r.nextAnimFrameId),delete r.nextAnimFrameId),jS(r.state,r.firstRender),r.firstRender=!1))},update(e,t){const n=r.helmets.findIndex(t=>t[0]===e);n>=0?(delete r.state,t?r.helmets[n][1]=t:r.helmets.splice(n,1)):t&&(delete r.state,r.helmets.push([e,t]))}}));/*#__PURE__*/
|
|
235
235
|
return Ee(WS,{value:i,children:e})};function JS(e){return kS[e]??e}function KS(e){const t=function(e){const t={};for(const[n,r]of Object.entries(e))t[n]=Array.isArray(r)?r.slice():r;return t}(e);for(const n of Object.values(e))if(Array.isArray(n)){for(const e of n)if(e)for(const t of Object.keys(e)){const n=JS(t);n!==t&&(e[n]=e[t],delete e[t])}}else if(n&&"object"==typeof n){const e=n;for(const t of Object.keys(e)){const n=JS(t);n!==t&&(e[n]=e[t],delete e[t])}}return ie.forEach(e.children,e=>{if(null==e)return;if("object"!=typeof e||!("props"in e))throw Error(`"${typeof e}" is not a valid <Helmet> descendant`);let n;const r={};if(e.props)for(const[t,a]of Object.entries(e.props))"children"===t?n=a:r[JS(t)]=a;let{type:i}=e;switch("symbol"==typeof i&&(i=i.toString()),function(e,t){if("string"!=typeof e)throw Error("You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.");if(!xS.includes(e))throw Error(`Only elements types ${xS.join(", ")} are allowed. Helmet does not support rendering <${e}> elements. Refer to our API for more information.`);if(t&&"string"!=typeof t&&!Array.isArray(t))throw Error(`Helmet expects a string as a child of <${e}>. Did you forget to wrap your children in braces? ( <${e}>{\`\`}</${e}> ) Refer to our API for more information.`)}(i,n),i){case gS.BASE:t.base=r;break;case gS.BODY:t.bodyAttributes=r;break;case gS.FRAGMENT:!function(e,t){const n=e;for(const[r,i]of Object.entries(t))if(Array.isArray(i)){const e=n[r];n[r]=e?e.concat(i):i}else n[r]=i}(t,KS({children:n}));break;case gS.HTML:t.htmlAttributes=r;break;case gS.LINK:case gS.META:if(n)throw Error(`<${i} /> elements are self-closing and can not contain children. Refer to our API for more information.`);DS(t,i,r);break;case gS.NOSCRIPT:case gS.SCRIPT:void 0!==n&&(r.innerHTML=n),DS(t,i,r);break;case gS.STYLE:r.cssText=n,DS(t,i,r);break;case gS.TITLE:t.titleAttributes=r,"string"==typeof n?t.title=n:Array.isArray(n)&&(t.title=n.join(""));case gS.HEAD:}}),delete t.children,t}var QS=e=>{const t=ze(8),n=pe(WS);if(!n)throw Error("<Helmet> component must be within a <HelmetProvider> children tree");const r=ge();let i,a,o;return n.update(r,KS(e)),t[0]!==n||t[1]!==r||t[2]!==e?(i=()=>{n.update(r,KS(e)),n.clientApply()},t[0]=n,t[1]=r,t[2]=e,t[3]=i):i=t[3],me(i),t[4]!==n||t[5]!==r?(a=()=>()=>{n.update(r,void 0),n.clientApply()},o=[n,r],t[4]=n,t[5]=r,t[6]=a,t[7]=o):(a=t[6],o=t[7]),me(a,o),null},YS=K(({ref:e,seoEnabled:t=!1,seoPageTitle:n="Title",seoPageDescription:r="Description",className:i="",layout:a="",layoutContainer:o="",children:s})=>{let{id:l}=Wh(),{settings:{previewMode:c},contexts:{InteractionsContext:u}}=U(),{interactionsManager:d}=pe(u),[[p,h]]=F(["navigation.routeParams","navigation.queryParams"]),f=ve(()=>({id:a,rootId:l,plitziElementLayout:{bodyChildren:s,containerId:o||a,referenceId:l,rootId:o||a,type:"layout"}}),[o,a,l,s]),m=ve(()=>({onPageLoad:{action:"onPageLoad",title:"On Page Load",type:"trigger",params:{},preview:{pageId:"",routeParams:"",queryParams:""}}}),[]);return me(()=>{let e=!1;return queueMicrotask(()=>{e||d.interactionTrigger(l,"onPageLoad",{pageId:l,routeParams:p,queryParams:h})}),()=>{e=!0}},[l,d,h,p]),/* @__PURE__ */Ie(cf,{ref:e,className:vt("plitzi-component__page",i),interactionTriggers:m,children:[t&&c&&/* @__PURE__ */Ie(QS,{children:[!!n&&/* @__PURE__ */Ee("title",{children:n}),!!r&&/* @__PURE__ */Ee("meta",{name:"description",content:r})]}),a&&/* @__PURE__ */Ee(dS,{internalProps:f},o||a),!a&&s]})}),XS=Object.assign(YS,{type:"page",content:{attributes:{enabled:!0,name:"Page",slug:"",folder:"",layout:"",layoutContainer:"",seoEnabled:!1,seoPageTitle:"Title",seoPageDescription:"Description"},definition:{label:"Page",type:"page",description:"The root of a routable screen. Managed through the page ops (upsertPage/deletePage), not added as a child element.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!1,canSelect:!0,canDragDrop:!1,canMove:!1,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"internal",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fas fa-file"},defaultStyle:{name:"Page",displayMode:"desktop",style:{base:{default:{display:"flex","flex-direction":"column","min-height":"100%","min-width":"100%","font-family":"Arial",color:"#333","font-size":"14px","font-weight":400,"line-height":"16px","text-align":"left","background-color":"#ffffff"}}}},settings:{}}}),ZS=K(({ref:e,className:t="",icon:n="fas fa-flag",size:r="fa-1x",iconAnimation:i=""})=>/* @__PURE__ */Ee(cf,{ref:e,tag:"i",className:vt("plitzi-component__fontawesome",t,n,r,i)})),eN=Object.assign(ZS,{type:"fontAwesome",content:{attributes:{icon:"fas fa-flag",size:"fa-1x",iconAnimation:""},definition:{label:"Font Awesome",type:"fontAwesome",description:"Renders a Font Awesome icon by its icon name.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"media",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-font-awesome"},defaultStyle:{name:"Font Awesome",displayMode:"desktop",style:{base:{default:{display:"inline-block","font-size":"16px"}}}},settings:{}}}),tN="data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 1200" fill="none">\n <rect width="1200" height="1200" fill="#EAEAEA" rx="3"/>\n <path fill="#FAFAFA" opacity="0.5" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/>\n <path stroke="#C9C9C9" stroke-width="2.418" opacity="0.5" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/>\n <path stroke="url(#a)" stroke-width="2.418" d="M0-1.209h553.581" transform="scale(1 -1) rotate(45 1163.11 91.165)"/>\n <path stroke="url(#b)" stroke-width="2.418" d="M404.846 598.671h391.726"/>\n <path stroke="url(#c)" stroke-width="2.418" d="M599.5 795.742V404.017"/>\n <path stroke="url(#d)" stroke-width="2.418" d="m795.717 796.597-391.441-391.44"/>\n <path fill="#fff" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/>\n <path fill="#666" fill-rule="evenodd" d="M616.426 586.58h-31.434v16.176l3.553-3.554.531-.531h9.068l.074-.074 8.463-8.463h2.565l7.18 7.181V586.58Zm-15.715 14.654 3.698 3.699 1.283 1.282-2.565 2.565-1.282-1.283-5.2-5.199h-6.066l-5.514 5.514-.073.073v2.876a2.418 2.418 0 0 0 2.418 2.418h26.598a2.418 2.418 0 0 0 2.418-2.418v-8.317l-8.463-8.463-7.181 7.181-.071.072Zm-19.347 5.442v4.085a6.045 6.045 0 0 0 6.046 6.045h26.598a6.044 6.044 0 0 0 6.045-6.045v-7.108l1.356-1.355-1.282-1.283-.074-.073v-17.989h-38.689v23.43l-.146.146.146.147Z" clip-rule="evenodd"/>\n <path stroke="#C9C9C9" stroke-width="2.418" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/>\n <defs>\n <linearGradient id="a" x1="554.061" x2="-.48" y1=".083" y2=".087" gradientUnits="userSpaceOnUse">\n <stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/>\n </linearGradient>\n <linearGradient id="b" x1="796.912" x2="404.507" y1="599.963" y2="599.965" gradientUnits="userSpaceOnUse">\n <stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/>\n </linearGradient>\n <linearGradient id="c" x1="600.792" x2="600.794" y1="403.677" y2="796.082" gradientUnits="userSpaceOnUse">\n <stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/>\n </linearGradient>\n <linearGradient id="d" x1="404.85" x2="796.972" y1="403.903" y2="796.02" gradientUnits="userSpaceOnUse">\n <stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/>\n </linearGradient>\n <clipPath id="e"><path fill="#fff" d="M581.364 580.535h38.689v38.689h-38.689z"/></clipPath>\n </defs>\n</svg>'),nN=K(({ref:e,className:t="",src:n,alt:r="",fetchPriority:i="auto",loadMode:a})=>{let{settings:{previewMode:o}}=U(),s=n||"https://cdn.plitzi.com/resources/img/placeholder-img.svg",l=he(e=>{e.currentTarget.onerror=null,e.currentTarget.src=tN},[]);/* @__PURE__ */
|
|
236
236
|
return Ee(cf,o?{tag:"img",draggable:!1,ref:e,className:vt("plitzi-component__image",t),src:s,alt:r,loading:a,fetchPriority:i,onError:l}:{ref:e,className:vt("plitzi-component__image image--edit-mode",t),children:/* @__PURE__ */Ee("img",{draggable:!1,src:s,alt:r,loading:a,fetchPriority:i,onError:l})})}),rN=Object.assign(nN,{type:"image",content:{attributes:{src:"https://cdn.plitzi.com/resources/img/placeholder-img.svg",alt:"",fetchPriority:"auto",loadMode:"auto"},definition:{label:"Image",type:"image",description:"Displays an image from a URL.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"media",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-image"},defaultStyle:{name:"Image",displayMode:"desktop",style:{base:{default:{display:"block",width:"140px",height:"140px"}}}},settings:{}}}),iN=K(({ref:e,src:t,autoPlay:n=!1,playsInline:r=!1,loop:i=!1,muted:a=!0,className:o=""})=>{let{settings:{previewMode:s}}=U();/* @__PURE__ */
|
|
237
|
-
return Ee(cf,s?{tag:"video",draggable:!1,ref:e,className:vt("plitzi-component__video",o),src:t,autoPlay:n,playsInline:r,loop:i,muted:a}:{ref:e,className:vt("plitzi-component__video video--edit-mode",o),children:/* @__PURE__ */Ee("video",{src:t,autoPlay:n,playsInline:r,loop:i,muted:a,children:/* @__PURE__ */Ee("track",{kind:"captions"})})})}),aN=Object.assign(iN,{type:"video",content:{attributes:{src:"",autoPlay:!1,playsInline:!1,loop:!1,muted:!0},definition:{label:"Video",type:"video",description:"Embeds a video from a URL.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"media",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-video"},defaultStyle:{name:"Video",displayMode:"desktop",style:{base:{default:{display:"block",width:"400px",height:"250px"}}}},settings:{}}}),oN={type:"apiContainer",sourceType:"apiContainer",content:{attributes:{query:"",method:"get",accessToken:"",mockData:"{}",subType:"",credentials:"same-origin",connector:"",resource:"",limit:"10",singleRecord:!1,filters:[],pagination:"none",pageParam:"page",renderWhileLoading:!1},definition:{label:"Api Container",type:"apiContainer",description:"Fetches data from a backend HTTP API (its `query`/`method`/`credentials`) and exposes the response as a data source ITS DESCENDANTS bind to (source `apiContainer_<id>.data`; only elements inside it can consume it). This is how you get backend data into the frontend. Its `mockData` prop is builder-only sample data — the published runtime fetches the real `query`, so always set a real query for production.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"provider",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-server"},defaultStyle:{name:"Api Container",displayMode:"desktop",style:{base:{default:{}}},subTypes:{}},settings:{}}},sN=K(({ref:e,className:t="",children:n,query:r="",method:i="get",accessToken:a="",when:o=
|
|
238
|
-
return Ee(cf,{ref:e,tag:
|
|
239
|
-
return Ie(cf,{ref:e,className:vt("plitzi-component__dialog-container",t),interactionTriggers:
|
|
240
|
-
/* @__PURE__ */Ie("div",{className:vt("dialog-container__header",u.headerContainer),children:[/* @__PURE__ */Ee("div",{className:vt("dialog-container__header__title",u.headerTitle),children:r||"Dialog Header"}),/* @__PURE__ */Ee("i",{className:"fa-solid fa-xmark",title:"Close",onClick:
|
|
241
|
-
/* @__PURE__ */Ee("div",{className:vt("dialog-container__body",u.body),children:/* @__PURE__ */Ee(ct,{inherit:"live",name:`Dialog:${l}`,value:
|
|
242
|
-
/* @__PURE__ */Ie("div",{className:vt("dialog-container__footer",u.footerContainer),children:[/* @__PURE__ */Ie("button",{className:vt("footer__button button--accept",u.acceptButton),onClick:
|
|
243
|
-
return Ie(cf,{ref:e,className:vt("plitzi-component__modal-container",t),interactionTriggers:b,interactionCallbacks:v,children:[/* @__PURE__ */Ee("div",{className:vt("modal-container__background",o.backgroundContainer),onClick:y}),/* @__PURE__ */Ie("div",{className:vt("modal-container__root",o.rootContainer),children:[/* @__PURE__ */Ie("div",{className:vt("modal-container__header",o.headerContainer),children:[/* @__PURE__ */Ee("div",{className:vt("modal-container__header__title",o.headerTitle),children:r||"Modal Header"}),/* @__PURE__ */Ee("i",{className:vt("fa-solid fa-xmark",o.headerCloseButton),title:"Close",onClick:g})]}),/* @__PURE__ */Ee("div",{className:vt("modal-container__body",o.bodyContainer),children:/* @__PURE__ */Ee(ct,{inherit:"live",name:`Modal:${a}`,value:k,children:n})})]})]})}),TN=Object.assign(NN,SN),CN=K(({ref:e,className:t="",children:n,pageInfo:r=
|
|
237
|
+
return Ee(cf,s?{tag:"video",draggable:!1,ref:e,className:vt("plitzi-component__video",o),src:t,autoPlay:n,playsInline:r,loop:i,muted:a}:{ref:e,className:vt("plitzi-component__video video--edit-mode",o),children:/* @__PURE__ */Ee("video",{src:t,autoPlay:n,playsInline:r,loop:i,muted:a,children:/* @__PURE__ */Ee("track",{kind:"captions"})})})}),aN=Object.assign(iN,{type:"video",content:{attributes:{src:"",autoPlay:!1,playsInline:!1,loop:!1,muted:!0},definition:{label:"Video",type:"video",description:"Embeds a video from a URL.",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"media",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-video"},defaultStyle:{name:"Video",displayMode:"desktop",style:{base:{default:{display:"block",width:"400px",height:"250px"}}}},settings:{}}}),oN={type:"apiContainer",sourceType:"apiContainer",content:{attributes:{query:"",method:"get",accessToken:"",mockData:"{}",subType:"",credentials:"same-origin",connector:"",resource:"",limit:"10",singleRecord:!1,filters:[],pagination:"none",pageParam:"page",renderWhileLoading:!1},definition:{label:"Api Container",type:"apiContainer",description:"Fetches data from a backend HTTP API (its `query`/`method`/`credentials`) and exposes the response as a data source ITS DESCENDANTS bind to (source `apiContainer_<id>.data`; only elements inside it can consume it). This is how you get backend data into the frontend. Its `mockData` prop is builder-only sample data — the published runtime fetches the real `query`, so always set a real query for production.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"provider",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-server"},defaultStyle:{name:"Api Container",displayMode:"desktop",style:{base:{default:{}}},subTypes:{}},settings:{}}},sN=K(({ref:e,className:t="",children:n,query:r="",method:i="get",accessToken:a="",when:o=Y,headers:s=Y,mockData:l="{}",subType:c="",credentials:u="same-origin",singleRecord:d=!1,pagination:p="none",pageParam:h="page",renderWhileLoading:f=!1})=>{let{id:m,visible:g,definition:{label:y="Api Container",runtime:b,items:v}}=Wh(),x="server"===b,{loaded:k,stale:w,location:S,elementData:N,refresh:T}=Gh(),C=Bp(oN.sourceType,m),{settings:{previewMode:E},contexts:{InteractionsContext:I}}=U(),{interactionsManager:O}=pe(I),[[z,A,D]]=F(["navigation.routeParams","navigation.queryParams","navigation.navigate"]),P=ve(()=>a?{...s,Authorization:`Bearer ${a}`}:s,[s,a]),R=ve(()=>!(x||!g||!(E&&r&&(o===Y||V(o,{...z,...A}))||!E&&(r||l&&"{}"!==l&&l!==Y))),[x,g,E,r,o,z,A,l]),{isLoading:M,isFetching:L,data:j,refetch:$,isSuccess:q,isError:B}=(({url:e="",method:t="get",mock:n=Y,params:r=Y,customHeaders:i=Y,enabled:a=!0,credentials:o="same-origin"})=>{let[s,l]=we(a),[c,u]=we(),d=he(()=>{a&&(l(!0),(async({url:e="",method:t="get",credentials:n="same-origin",params:r=Y,customHeaders:i=Y,mock:a=Y}={})=>{if(a&&"{}"!==a&&a!==Y)try{return"string"==typeof a?{status:200,data:JSON.parse(a)}:{status:200,data:a}}catch(e){return{status:500,data:e.message}}let o=new Headers;if(o.append("Content-Type","application/json"),Object.keys(i).length>0&&Object.keys(i).forEach(e=>{o.append(e,i[e])}),!e)return{status:400,data:"URL is required"};Object.values(r).forEach(e=>{e instanceof Blob&&"multipart/form-data"!==o.get("Content-Type")&&o.set("Content-Type","multipart/form-data")});let s=new FormData;Object.entries(r).forEach(([e,t])=>{s.append(e,t)});let l={method:t,credentials:n,headers:o,body:s};"application/json"===o.get("Content-Type")&&(l.body=JSON.stringify(r)),"get"===t&&delete l.body;try{let t=await fetch(e,l),n=await t.json(),r=It(t.status,n);return r&&Ct({reason:r,url:e}),{status:t.status,data:n}}catch(e){return{status:500,data:e.message}}})({url:e,method:t,credentials:o,mock:n,customHeaders:i,params:r}).then(e=>u(e)).catch(e=>u({status:500,data:e.message})).finally(()=>l(!1)))},[a,e,t,o,n,i,r]);return me(()=>{d()},[a,r,n,e,d]),{isLoading:s&&void 0===c,isFetching:s,data:c,refetch:d,isSuccess:!s&&c&&c.status<400,isError:!s&&c&&c.status>=400}})({url:r,method:i,credentials:u,mock:E?void 0:l,customHeaders:P,enabled:R}),H=x&&!!S&&S!==Mh(),W=x&&k&&!H&&null===N,G=ve(()=>{if(!x)return j??Y;if(N)return N;if(k)return Y;if("string"!=typeof l)return l;try{return JSON.parse(l||"{}")}catch{return Y}},[x,j,N,k,l]),J=x?H:L,K=x?H:M,Q=he(async()=>{x?await T([m]):$()},[x,$,T,m]),X=G,Z=ve(()=>Array.isArray(X.records)?X.records:[],[X.records]),{records:ee,isLoadingMore:te,goToPage:ne,loadMore:re}=(({elementId:e,mode:t,pageParam:n,records:r,page:i,refresh:a,navigate:o})=>{let[s,l]=we(r),[c,u]=we(!1),d=ke(0);me(()=>{if("append"===t){if(i<=1)return d.current=1,void l(r);d.current!==i&&(d.current=i,l(e=>[...e,...r]))}},[t,i,r]);let p=he(async r=>{let i=Math.max(r,1);if("url"!==t){if(a){u(!0);try{await a([e],{[n]:String(i)})}finally{u(!1)}}}else o?.(((e,t)=>{if(typeof window>"u")return"";let n=new URL(window.location.href);return t<=1?n.searchParams.delete(e):n.searchParams.set(e,String(t)),`${n.pathname}${n.search}`})(n,i))},[t,o,n,a,e]),h=he(()=>p(i+1),[p,i]);return{records:"append"===t?s:r,isLoadingMore:c,goToPage:p,loadMore:h}})({elementId:m,mode:p,pageParam:h,records:Z,page:X.pageInfo?.page??1,refresh:T,navigate:D});me(()=>{!J&&m&&(q?O.interactionTrigger(m,"onApiSuccess",{url:r,method:i,...G}):B&&O.interactionTrigger(m,"onApiError",{url:r,method:i,...G}))},[G,m,O,B,J,q,i,r]);let ie=ve(()=>({...G,...Array.isArray(X.records)?{records:ee}:Y,isLoading:J||te,isEmpty:d?void 0===X.record:0===ee.length,hasError:W,errorMessage:W?"The data provider could not be reached":"",isStale:x&&w}),[G,X.records,X.record,ee,J,te,d,W,x,w]),ae=he(()=>_(ie).reduce((e,t)=>{let n=t.split(".");return n.length>1?[...e,{path:t,name:n.slice(n.length-2).join(" ")}]:[...e,{path:t,name:n[n.length-1]}]},[]),[ie]);Up({id:m,source:C,name:y||`API - ${m}`,fields:ae});let{writeRecord:oe}=(({elementId:e,enabled:t,actionPath:n="/_action",onDone:r})=>({writeRecord:he(async(i={})=>{let{action:a,recordId:o,...s}=i;if(!t||"string"!=typeof a||!a)return;let l=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({elementId:e,action:a,recordId:o,values:s})});if(!l.ok){let e=It(l.status,await l.json().catch(()=>{}));throw e&&Ct({reason:e,url:n}),Error(`Write failed with status ${l.status}`)}let c=await l.json();return await(r?.()),c.record},[n,e,t,r])}))({elementId:m,enabled:x,onDone:Q}),se=ve(()=>{let e={performQuery:{action:"performQuery",title:`Perform Query ${y}`,type:"callback",callback:Q,preview:{},params:{}},loadMore:{action:"loadMore",title:`Load More ${y}`,type:"callback",callback:re,preview:{},params:{}},goToPage:{action:"goToPage",title:`Go To Page ${y}`,type:"callback",callback:({page:e})=>ne(Number(e)||1),preview:{},params:{page:{label:"Page",defaultValue:"1",type:"text"}}}};return x&&(e.writeRecord={action:"writeRecord",title:`Write Record ${y}`,type:"callback",callback:oe,preview:{action:"create"},params:{action:{label:"Endpoint",defaultValue:"create",type:"text"},recordId:{label:"Record Id",defaultValue:"",type:"text"}}}),e},[y,Q,re,ne,x,oe]),le=ve(()=>({onApiError:{action:"onApiError",title:"On Api Error",type:"trigger",params:{},preview:{url:"",method:"",status:"",data:""}},onApiSuccess:{action:"onApiSuccess",title:"On Api Success",type:"trigger",params:{},preview:{url:"",method:"",status:"",data:""}}}),[]),ce=ve(()=>C?{runtime:{sources:{[C]:ie}}}:Y,[ie,C]);/* @__PURE__ */
|
|
238
|
+
return Ee(cf,{ref:e,tag:E||v?.length?c:"div",className:vt("plitzi-component__api-container",t),interactionTriggers:le,interactionCallbacks:se,children:(!K||f)&&/* @__PURE__ */Ee(ct,{inherit:"live",name:`Api:${m}`,value:ce,children:n})})}),lN=Object.assign(sN,oN),cN=K(({ref:e,className:t="",subType:n="div",children:r})=>/* @__PURE__ */Ee(cf,{ref:e,tag:n,className:vt(`plitzi-component__container plitzi-component__container-${n}`,t),children:r})),uN=Object.assign(cN,{type:"container",content:{attributes:{subType:"div"},definition:{label:"Container",type:"container",description:"Generic layout box (a div). The primary building block for structure: groups and positions child elements with flex/grid. Reach for it whenever you need to wrap or arrange other elements.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-regular fa-square"},defaultStyle:{name:"Container",displayMode:"desktop",style:{base:{default:{}}},subTypes:{}},settings:{}}}),dN={type:"dialogContainer",sourceType:"dialogContainer",content:{attributes:{headerLabel:"Dialog Header",acceptButtonLabel:"Accept",rejectButtonLabel:"Cancel",autoHideAfterClick:!0},definition:{label:"Dialog Container",type:"dialogContainer",description:"A native <dialog> container shown or hidden through interactions (e.g. an onClick open/close).",items:[],bindings:{},loadStrategy:"lazy",styleSelectors:{base:"",backgroundContainer:"",rootContainer:"",headerContainer:"",headerTitle:"",headerCloseButton:"",bodyContainer:"",footerContainer:"",acceptButton:"",cancelButton:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-regular fa-clone"},defaultStyle:{name:"Dialog Container",displayMode:"desktop",style:{base:{default:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0"}},backgroundContainer:{default:{height:"100%",width:"100%",left:"0",top:"0",position:"absolute","background-color":"black",opacity:"0.5"}},rootContainer:{default:{display:"flex","flex-direction":"column",position:"absolute",top:"50%",left:"50%",width:"500px",height:"300px","background-color":"white",transform:"translate3d(-50%, -50%, 0px)","padding-top":"20px","padding-bottom":"20px","padding-left":"20px","padding-right":"20px","border-top-left-radius":"8px","border-top-right-radius":"8px","border-bottom-left-radius":"8px","border-bottom-right-radius":"8px"}},headerContainer:{default:{display:"flex","align-items":"center","justify-content":"space-between"}},headerTitle:{default:{"font-size":"20px","font-weight":"500","line-height":"1.2",color:"#333"}},headerCloseButton:{default:{height:"20px",width:"20px",padding:"4px",display:"flex","justify-content":"center","align-items":"center",cursor:"pointer"}},bodyContainer:{default:{display:"flex","flex-direction":"column","flex-grow":"1","flex-basis":"0"}},footerContainer:{default:{display:"flex","justify-content":"flex-end","margin-top":"8px"}}},subTypes:{}},settings:{}},initialItems:["container"]},pN=K(({ref:e,className:t="",children:n,headerLabel:r="Dialog Header",acceptButtonLabel:i="Accept",acceptButtonLabelLoading:a="Loading...",rejectButtonLabel:o="Cancel",autoHideAfterClick:s=!0})=>{let{id:l,setElementState:c,definition:{styleSelectors:u,label:d="Dialog"},elementState:p}=Wh(),h=Bp(dN.sourceType,l),{contexts:{InteractionsContext:f}}=U(),{interactionsManager:m}=pe(f),[g,y]=we({}),[b,v]=we(!1),x=he(e=>{let{metadata:t}=e;if(t&&"object"==typeof t)y(t);else if("string"==typeof t)try{y(JSON.parse(t))}catch{y({content:t})}else y("boolean"==typeof t||"number"==typeof t?{content:t}:{});c(e=>({...e,visibility:!0}))},[c,y]),k=he(()=>{m.interactionTrigger(l,"onDialogClose",{metadata:g}),y({}),c(e=>({...e,visibility:!1}))},[m,c,y,g,l]),w=he(()=>{s&&(m.interactionTrigger(l,"onDialogClose",{metadata:g}),y({}),c(e=>({...e,visibility:!1})))},[m,s,c,y,g,l]),S=he(async()=>{v(!0),await m.interactionTrigger(l,"onDialogAccept",{metadata:g}),v(!1),c(e=>({...e,visibility:!1}))},[m,l,g,c]),N=he(async()=>{v(!0),await m.interactionTrigger(l,"onDialogReject",{metadata:g}),v(!1),c(e=>({...e,visibility:!1}))},[m,l,g,c]),T=ve(()=>({onDialogAccept:{action:"onDialogAccept",title:"On Dialog Accept",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onDialogReject:{action:"onDialogReject",title:"On Dialog Reject",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onDialogOpen:{action:"onDialogOpen",title:"On Dialog Open",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onDialogClose:{action:"onDialogClose",title:"On Dialog Close",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}}}),[]),C=ve(()=>({openDialog:{action:"openDialog",title:`Open ${d}`,type:"callback",callback:x,params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},closeDialog:{action:"closeDialog",title:`Close ${d}`,type:"callback",callback:k,preview:{},params:{}}}),[k,x,d]);me(()=>{!1!==p.visibility&&m.interactionTrigger(l,"onDialogOpen",{metadata:g})},[l,m,g,p.visibility]);let E=he(()=>"object"==typeof g?_(g).reduce((e,t)=>{let n=t.split(".");return n.length>1?[...e,{path:t,name:n.slice(n.length-2).join(" ")}]:[...e,{path:t,name:n[n.length-1]}]},[]):[],[g]);Up({id:l,source:h,name:d||`Dialog - ${l}`,fields:E});let I=ve(()=>h?{runtime:{sources:{[h]:g}}}:Y,[h,g]);/* @__PURE__ */
|
|
239
|
+
return Ie(cf,{ref:e,className:vt("plitzi-component__dialog-container",t),interactionTriggers:T,interactionCallbacks:C,children:[/* @__PURE__ */Ee("div",{className:vt("dialog-container__background",u.backgroundContainer),onClick:w}),/* @__PURE__ */Ie("div",{className:vt("dialog-container__root",u.rootContainer),children:[
|
|
240
|
+
/* @__PURE__ */Ie("div",{className:vt("dialog-container__header",u.headerContainer),children:[/* @__PURE__ */Ee("div",{className:vt("dialog-container__header__title",u.headerTitle),children:r||"Dialog Header"}),/* @__PURE__ */Ee("i",{className:"fa-solid fa-xmark",title:"Close",onClick:N})]}),
|
|
241
|
+
/* @__PURE__ */Ee("div",{className:vt("dialog-container__body",u.body),children:/* @__PURE__ */Ee(ct,{inherit:"live",name:`Dialog:${l}`,value:I,children:n})}),
|
|
242
|
+
/* @__PURE__ */Ie("div",{className:vt("dialog-container__footer",u.footerContainer),children:[/* @__PURE__ */Ie("button",{className:vt("footer__button button--accept",u.acceptButton),onClick:S,disabled:b,children:[b&&/* @__PURE__ */Ie("div",{className:"button--accept__container",children:[/* @__PURE__ */Ee("i",{className:"fa-solid fa-rotate fa-spin"}),a]}),!b&&i]}),/* @__PURE__ */Ee("button",{className:vt("footer__button button--cancel",u.cancelButton),onClick:N,disabled:b,children:o})]})]})]})}),hN=Object.assign(pN,dN),fN={type:"list",sourceType:"list",content:{attributes:{items:[],source:"none",subType:"ul"},definition:{label:"List",type:"list",description:"Repeats a template (its listItem/link child) once per entry of a data array — the way to render a dynamic collection. Bind its items to a data source (e.g. an apiContainer response).",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-list"},defaultStyle:{name:"List",displayMode:"desktop",style:{base:{default:{}}},subTypes:{ul:{name:"List UL",displayMode:"desktop",style:{base:{default:{"margin-top":"0px","margin-bottom":"10px","padding-left":"40px"}}}},ol:{name:"List OL",displayMode:"desktop",style:{base:{default:{"margin-top":"0px","margin-bottom":"10px","padding-left":"40px"}}}}}},settings:{}},initialItems:["listItem","listItem","listItem"]},mN=({ref:e,className:t="",subType:n="ul",children:r})=>/* @__PURE__ */Ee(cf,{ref:e,tag:n,className:vt("plitzi-component__list",t),children:r}),gN=({children:e})=>{let{contexts:{InteractionsContext:t}}=U(),n=pe(t),r=ve(()=>n.interactionsManager.createChildManager(),[n]),i=ve(()=>({...n,interactionsManager:r}),[n,r]);return me(()=>()=>{n.interactionsManager.removeChildManager(r)},[n,r]),/* @__PURE__ */Ee(t,{value:i,children:e})},yN=({children:e,className:t="",isTemplate:n=!1,index:r=0,record:i,source:a=""})=>{let o=ge(),s=ve(()=>a?{runtime:{sources:{[a]:{item:i,index:`${r}`}}}}:Y,[a,i,r]),l=/* @__PURE__ */Ee(gN,{children:/* @__PURE__ */Ee(ct,{inherit:"live",name:`Row:${a}`,segment:o,value:s,children:e})});return n?/* @__PURE__ */Ie("div",{className:vt("plitzi-component__controlled-list-item",t),children:[/* @__PURE__ */Ee("div",{className:"controlled-list-item__counter",children:`List Item - ${r+1}`}),l]}):l},bN=({ref:e,className:t="",children:n,items:r=[]})=>{let{id:i,definition:{label:a}}=Wh(),o=Bp(fN.sourceType,i),{settings:{previewMode:l}}=U(),c=ve(()=>Array.isArray(r)?r:[],[r]),u=he(()=>_({item:s(c,"0",{}),index:"0"}).reduce((e,t)=>[...e,{path:t,name:t}],[]),[c]),d=ve(()=>o?{runtime:{sources:{[o]:{items:c}}}}:Y,[o,c]);return Up({id:i,source:o,name:a||`List - ${i}`,fields:u}),/* @__PURE__ */Ie(cf,{ref:e,className:vt("plitzi-component__controlled-list",t,{"controlled-list--build-mode":!l}),children:[/* @__PURE__ */Ee(ct,{inherit:"live",name:`List:${i}`,value:d,children:c.map((e,t)=>!n||Array.isArray(n)&&0===n.length?/* @__PURE__ */Ee("div",{className:"plitzi-component__controlled-list-item controlled-list--empty",children:/* @__PURE__ */Ee("div",{className:"controlled-list-item__counter",children:`List Item - ${t+1}`})},t):/* @__PURE__ */Ee(yN,{index:t,isTemplate:0!==t&&!l,record:e,source:o,children:n},t))}),!l&&0===c.length&&/* @__PURE__ */Ee("div",{className:"controlled-list controlled-list--empty",children:"This list does not contain any items"})]})},vN=K(({ref:e,className:t="",subType:n="ul",children:r,items:i=[],source:a="none"})=>"controlled"===a?/* @__PURE__ */Ee(bN,{ref:e,className:t,items:i,children:r}):/* @__PURE__ */Ee(mN,{ref:e,className:t,subType:n,children:r})),xN=K(({ref:e,className:t="",children:n})=>/* @__PURE__ */Ee(cf,{tag:"li",ref:e,className:vt("plitzi-component__list-item",t),children:n})),kN=Object.assign(xN,{type:"listItem",content:{attributes:{},definition:{label:"List Item",type:"listItem",description:"The List Item element lets you add more items to existing List elements. You can then add any content you would like to them, including links, images, etc.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:["listItem"]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-list"},defaultStyle:{name:"List Item",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}}),wN=Object.assign(vN,{...fN,plugins:{listItem:kN}}),SN={type:"modalContainer",sourceType:"modalContainer",content:{attributes:{title:"Modal Header",autoHideAfterClick:!0},definition:{label:"Modal Container",type:"modalContainer",description:"A modal overlay container opened and closed through interactions; use for dialogs over the page.",items:[],bindings:{},loadStrategy:"lazy",styleSelectors:{base:"",backgroundContainer:"",rootContainer:"",headerContainer:"",headerTitle:"",headerCloseButton:"",bodyContainer:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-regular fa-clone"},defaultStyle:{name:"Modal Container",displayMode:"desktop",style:{base:{default:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0"}},backgroundContainer:{default:{height:"100%",width:"100%",left:"0",top:"0",position:"absolute","background-color":"black",opacity:"0.5"}},rootContainer:{default:{display:"flex","flex-direction":"column",position:"absolute",top:"50%",left:"50%",width:"500px",height:"300px","background-color":"white",transform:"translate3d(-50%, -50%, 0px)","border-top-left-radius":"8px","border-top-right-radius":"8px","border-bottom-left-radius":"8px","border-bottom-right-radius":"8px"}},headerContainer:{default:{display:"flex","align-items":"center","justify-content":"space-between","border-bottom-width":"1px","border-bottom-color":"#d1d5db","border-bottom-style":"solid","padding-left":"20px","padding-right":"20px","padding-top":"10px","padding-bottom":"10px"}},headerTitle:{default:{"font-size":"20px","font-weight":"500","line-height":"1.2"}},headerCloseButton:{default:{height:"20px",width:"20px",padding:"4px",display:"flex","justify-content":"center","align-items":"center",cursor:"pointer"},bodyContainer:{default:{display:"flex","flex-direction":"column","flex-grow":"1","flex-basis":"0","padding-top":"20px","padding-bottom":"20px","padding-left":"20px","padding-right":"20px"}}}},subTypes:{}},settings:{}},initialItems:["container"]},NN=K(({ref:e,className:t="",children:n,title:r="Modal Header",autoHideAfterClick:i=!0})=>{let{id:a,definition:{styleSelectors:o,label:s="Modal"},elementState:l,setElementState:c}=Wh(),u=Bp(SN.sourceType,a),{contexts:{InteractionsContext:d}}=U(),{interactionsManager:p}=pe(d),[h,f]=we({}),m=he(e=>{let{metadata:t}=e;if(t&&"object"==typeof t)f(t);else if("string"==typeof t)try{f(JSON.parse(t))}catch{f({content:t})}else f("boolean"==typeof t||"number"==typeof t?{content:t}:{});c(e=>({...e,visibility:!0}))},[c,f]),g=he(()=>{p.interactionTrigger(a,"onModalClose",{metadata:h}),f({}),c(e=>({...e,visibility:!1}))},[p,c,f,h,a]),y=he(()=>{i&&(p.interactionTrigger(a,"onModalClose",{metadata:h}),f({}),c(e=>({...e,visibility:!1})))},[p,i,c,f,h,a]),b=ve(()=>({onModalOpen:{action:"onModalOpen",title:"On Modal Open",type:"trigger",params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},onModalClose:{action:"onModalClose",title:"On Modal Close",type:"trigger",preview:{},params:{}}}),[]),v=ve(()=>({openModal:{action:"openModal",title:`Open ${s}`,type:"callback",callback:m,params:{metadata:{type:"text",defaultValue:""}},preview:{metadata:""}},closeModal:{action:"closeModal",title:`Close ${s}`,type:"callback",callback:g,params:{},preview:{}}}),[g,m,s]);me(()=>{!1!==l.visibility&&p.interactionTrigger(a,"onModalOpen",{metadata:h})},[a,p,h,l.visibility]);let x=he(()=>_(h).reduce((e,t)=>{let n=t.split(".");return n.length>1?[...e,{path:t,name:n.slice(n.length-2).join(" ")}]:[...e,{path:t,name:n[n.length-1]}]},[]),[h]);Up({id:a,source:u,name:s||`Modal - ${a}`,fields:x});let k=ve(()=>u?{runtime:{sources:{[u]:h}}}:Y,[u,h]);/* @__PURE__ */
|
|
243
|
+
return Ie(cf,{ref:e,className:vt("plitzi-component__modal-container",t),interactionTriggers:b,interactionCallbacks:v,children:[/* @__PURE__ */Ee("div",{className:vt("modal-container__background",o.backgroundContainer),onClick:y}),/* @__PURE__ */Ie("div",{className:vt("modal-container__root",o.rootContainer),children:[/* @__PURE__ */Ie("div",{className:vt("modal-container__header",o.headerContainer),children:[/* @__PURE__ */Ee("div",{className:vt("modal-container__header__title",o.headerTitle),children:r||"Modal Header"}),/* @__PURE__ */Ee("i",{className:vt("fa-solid fa-xmark",o.headerCloseButton),title:"Close",onClick:g})]}),/* @__PURE__ */Ee("div",{className:vt("modal-container__body",o.bodyContainer),children:/* @__PURE__ */Ee(ct,{inherit:"live",name:`Modal:${a}`,value:k,children:n})})]})]})}),TN=Object.assign(NN,SN),CN=K(({ref:e,className:t="",children:n,pageInfo:r=Y,mode:i="pages",pageParam:a="page",target:o="url",windowSize:s=5,previousLabel:l="Previous",nextLabel:c="Next",loadMoreLabel:u="Load more"})=>{let{id:d}=Wh(),{settings:{previewMode:p},contexts:{InteractionsContext:h}}=U(),{interactionsManager:f}=pe(h),[m]=F("navigation.navigate"),g=r.page??1,y=r.pageCount??0,b=r.hasPrevPage??g>1,v=r.hasNextPage??!1,x=ve(()=>((e,t,n)=>{if(t<=0||n<=0)return[];let r=Math.min(n,t),i=Math.min(Math.max(e-Math.floor(r/2),1),t-r+1);return Array.from({length:r},(e,t)=>i+t)})(g,y,s),[g,y,s]),k=he(e=>{let t=Math.max(e,1);d&&f.interactionTrigger(d,"onPageChange",{page:t}),"url"===o&&m(((e,t)=>{if(typeof window>"u")return"";let n=new URL(window.location.href);return t<=1?n.searchParams.delete(e):n.searchParams.set(e,String(t)),`${n.pathname}${n.search}`})(a,t))},[d,f,o,m,a]),w=he(e=>t=>{t.preventDefault(),k(e)},[k]),S=ve(()=>({onPageChange:{action:"onPageChange",title:"On Page Change",type:"trigger",params:{},preview:{page:"1"}}}),[]),N=0===y&&!v&&!b;/* @__PURE__ */
|
|
244
244
|
return Ie(cf,{ref:e,tag:"nav",className:vt("plitzi-component__pagination",t),interactionTriggers:S,children:["loadMore"===i&&/* @__PURE__ */Ee("button",{type:"button",className:"plitzi-component__pagination-more",disabled:!v&&p,onClick:w(g+1),children:u}),"pages"===i&&/* @__PURE__ */Ie(Ce,{children:[
|
|
245
245
|
/* @__PURE__ */Ee("button",{type:"button",className:"plitzi-component__pagination-prev",disabled:!b&&p,onClick:w(g-1),children:l}),x.map(e=>/* @__PURE__ */Ee("button",{type:"button",className:vt("plitzi-component__pagination-page",{"plitzi-component__pagination-page--current":e===g}),onClick:w(e),children:e},e)),
|
|
246
246
|
/* @__PURE__ */Ee("button",{type:"button",className:"plitzi-component__pagination-next",disabled:!v&&p,onClick:w(g+1),children:c})]}),!p&&N&&/* @__PURE__ */Ee("span",{className:"plitzi-component__pagination-hint",children:"Bind pageInfo"}),n]})}),EN=Object.assign(CN,{type:"pagination",content:{attributes:{pageInfo:{},mode:"pages",target:"url",pageParam:"page",windowSize:5,previousLabel:"Previous",nextLabel:"Next",loadMoreLabel:"Load more"},definition:{label:"Pagination",type:"pagination",description:"Pages through a list. Bind it to a provider page info: in URL mode it writes the page into the address bar so the result stays shareable and indexable, and in load-more mode it announces the next page for the provider to append.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-ellipsis"},defaultStyle:{name:"Pagination",displayMode:"desktop",style:{base:{default:{display:"flex","align-items":"center","row-gap":"8px","column-gap":"8px"}}},subTypes:{}},settings:{}}}),IN=se(void 0);IN.displayName="TabContainerContext";var ON=K(({ref:e,className:t="",children:n})=>{let[r,i]=we(0),a=ve(()=>({tabSelected:r,onSelect:i}),[r]);/* @__PURE__ */
|
|
247
247
|
return Ee(cf,{ref:e,className:vt("plitzi-component__tab-container",t),children:/* @__PURE__ */Ee(IN,{value:a,children:n})})}),zN=K(({ref:e,className:t="",children:n})=>{let{tabSelected:r,onSelect:i}=pe(IN),{childrenParsed:a}=ve(()=>{let e={childrenParsed:[]};return ie.forEach(n,(t,n)=>{if(!ue(t))return;let a=t.props;e.childrenParsed.push(oe(t,{...a,internalProps:{...a.internalProps,onSelect:i,tabSelected:r,tabIndex:n}}))}),e},[n,i,r]);/* @__PURE__ */
|
|
248
248
|
return Ee(cf,{ref:e,className:vt("plitzi-component__tab-container-body",t),children:a})}),AN=Object.assign(zN,{type:"tabContainerBody",content:{attributes:{},definition:{label:"Tab Container Body",type:"tabContainerBody",description:"The panel area inside a tabContainer that shows the active tab item.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!1,canSelect:!0,canDragDrop:!1,canMove:!1,canTemplate:!1,itemsAllowed:["tabContainerItem"],itemsNotAllowed:[]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-table-columns"},defaultStyle:{name:"Tab Container Body",displayMode:"desktop",style:{base:{default:{}}},subTypes:{}},settings:{}},initialItems:["tabContainerItem","tabContainerItem","tabContainerItem"]}),_N=K(({ref:e,className:t="",children:n})=>{let{tabSelected:r,onSelect:i}=pe(IN),{childrenParsed:a}=ve(()=>{let e={childrenParsed:[]};return ie.forEach(n,(t,n)=>{if(!ue(t))return;let a=t.props;e.childrenParsed.push(oe(t,{...a,internalProps:{...a.internalProps,isHeader:!0,onSelect:i,tabSelected:r,tabIndex:n}}))}),e},[n,i,r]);/* @__PURE__ */
|
|
249
249
|
return Ee(cf,{ref:e,className:vt("plitzi-component__tab-container-header",t),children:a})}),DN=Object.assign(_N,{type:"tabContainerHeader",content:{attributes:{},definition:{label:"Tab Container Header",type:"tabContainerHeader",description:"The row of tab triggers inside a tabContainer.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!1,canSelect:!0,canDragDrop:!1,canMove:!1,canTemplate:!1,itemsAllowed:["tabContainerItem"],itemsNotAllowed:[]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-table-columns"},defaultStyle:{name:"Tab Container Header",displayMode:"desktop",style:{base:{default:{}}},subTypes:{}},settings:{}},initialItems:["tabContainerItem","tabContainerItem","tabContainerItem"]}),PN=K(({className:e="",children:t,ref:n,tabSelected:r,tabIndex:i=0,isHeader:a,onSelect:o})=>{let s=he(()=>{a&&r!==i&&o?.(i)},[a,r,i,o]);/* @__PURE__ */
|
|
250
|
-
return Ee(cf,{ref:n,onClick:s,className:vt("plitzi-component__tab-container-item",e,{active:r===i}),children:t})}),RN=Object.assign(PN,{type:"tabContainerItem",content:{attributes:{},definition:{label:"Tab Container Item",type:"tabContainerItem",description:"One selectable tab (trigger + panel) inside a tabContainer.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:["tabContainerItem","tabContainerHeader","tabContainerBody"]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-table-columns"},defaultStyle:{name:"Tab Container Item",displayMode:"desktop",style:{base:{default:{}}},subTypes:{}},settings:{}}}),MN=Object.assign(ON,{type:"tabContainer",content:{attributes:{},definition:{label:"Tab Container",type:"tabContainer",description:"A tabbed container that switches between panels; composed of header/body/item parts.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:["tabContainerHeader","tabContainerBody"],itemsNotAllowed:[]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-table-columns"},defaultStyle:{name:"Tab Container",displayMode:"desktop",style:{base:{default:{}}},subTypes:{}},settings:{}},initialItems:["tabContainerHeader","tabContainerBody"],plugins:{tabContainerHeader:DN,tabContainerBody:AN,tabContainerItem:RN}}),LN={root:Nt("text-zinc-900 dark:text-zinc-100",{variants:{as:{h1:"text-5xl font-extrabold",h2:"text-4xl font-extrabold",h3:"text-3xl font-bold",h4:"text-2xl font-bold",h5:"text-xl font-bold",h6:"text-lg font-bold"}},compoundVariants:[],defaultVariants:{as:"h1"}})},jN={dropdown:Af,notFound:fS,loading:hS,custom:vf,reference:Nf,blockHtml:mf,nodeHtml:kf,blockJsx:yf,page:XS,container:uN,layoutContainer:dS,dialogContainer:hN,modalContainer:TN,tabContainer:MN,heading:Rf,image:rN,video:aN,fontAwesome:eN,button:Cf,paragraph:Ow,text:Lw,themeToggle:Uw,list:wN,link:Lf,markdown:Ew,richText:Rw,pagination:EN,form:Jw,formControl:cS,apiContainer:lN},FN=({localComponents:e,localCustomComponents:t,children:n})=>{let r=ve(()=>({...Bh(jN),...Bh(e),...Hh(t)}),[e,t]),i=ke({}),a=ke({...i.current,...r}),o=he((e=[],t=!1)=>{if("string"==typeof e&&!t)return a.current[e];if("string"==typeof e&&t){let t=a.current[e];return t?{[e]:t,...
|
|
251
|
-
return Ee(
|
|
250
|
+
return Ee(cf,{ref:n,onClick:s,className:vt("plitzi-component__tab-container-item",e,{active:r===i}),children:t})}),RN=Object.assign(PN,{type:"tabContainerItem",content:{attributes:{},definition:{label:"Tab Container Item",type:"tabContainerItem",description:"One selectable tab (trigger + panel) inside a tabContainer.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:["tabContainerItem","tabContainerHeader","tabContainerBody"]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-table-columns"},defaultStyle:{name:"Tab Container Item",displayMode:"desktop",style:{base:{default:{}}},subTypes:{}},settings:{}}}),MN=Object.assign(ON,{type:"tabContainer",content:{attributes:{},definition:{label:"Tab Container",type:"tabContainer",description:"A tabbed container that switches between panels; composed of header/body/item parts.",items:[],bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:["tabContainerHeader","tabContainerBody"],itemsNotAllowed:[]},market:{category:"structure",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:"fa-solid fa-table-columns"},defaultStyle:{name:"Tab Container",displayMode:"desktop",style:{base:{default:{}}},subTypes:{}},settings:{}},initialItems:["tabContainerHeader","tabContainerBody"],plugins:{tabContainerHeader:DN,tabContainerBody:AN,tabContainerItem:RN}}),LN={root:Nt("text-zinc-900 dark:text-zinc-100",{variants:{as:{h1:"text-5xl font-extrabold",h2:"text-4xl font-extrabold",h3:"text-3xl font-bold",h4:"text-2xl font-bold",h5:"text-xl font-bold",h6:"text-lg font-bold"}},compoundVariants:[],defaultVariants:{as:"h1"}})},jN={dropdown:Af,notFound:fS,loading:hS,custom:vf,reference:Nf,blockHtml:mf,nodeHtml:kf,blockJsx:yf,page:XS,container:uN,layoutContainer:dS,dialogContainer:hN,modalContainer:TN,tabContainer:MN,heading:Rf,image:rN,video:aN,fontAwesome:eN,button:Cf,paragraph:Ow,text:Lw,themeToggle:Uw,list:wN,link:Lf,markdown:Ew,richText:Rw,pagination:EN,form:Jw,formControl:cS,apiContainer:lN},FN=({localComponents:e,localCustomComponents:t,children:n})=>{let r=ve(()=>({...Bh(jN),...Bh(e),...Hh(t)}),[e,t]),i=ke({}),a=ke({...i.current,...r}),o=he((e=[],t=!1)=>{if("string"==typeof e&&!t)return a.current[e];if("string"==typeof e&&t){let t=a.current[e];return t?{[e]:t,...X(qh(t),[e])}:{}}let n={};return e.forEach(e=>{let r=a.current[e];r&&(t?n={...n,...X(qh(r),[e])}:n[e]=r)}),n},[]),l=he((e=[])=>{let t={};return Array.isArray(e)||(e=[e]),e.forEach(e=>{e.type&&!a.current[e.type]&&(t={...t,[e.type]:e,...qh(e)})}),0===Object.keys(t).length||(a.current={...i.current,...t,...r},i.current={...i.current,...t}),t},[r]),c=he(e=>{if(!e)return[];Array.isArray(e)||(e=[e]);let t=e;return e.forEach(e=>{let n=o([e],!0);Object.keys(n).length>0&&(t=[...t,...Object.keys(X(n,e))])}),a.current={...X(i.current,t),...r},i.current=X(i.current,t),t},[o,r]),u=ke(Object.keys(a.current).reduce((e,t)=>{let n=s(a.current,t,void 0);return n&&n.content?{...e,[t]:{...n.content,initialItems:n.initialItems}}:e},{})),d=he(e=>{u.current={...u.current,...e}},[]),p=he(e=>{let t=s(u.current,`${e}.builder.pluginChildren`,[]);u.current=X(u.current,[e,...t])},[]),h=ve(()=>({components:a,componentDefinitions:u,getComponent:o,register:l,unregister:c,unregisterDefinition:p,registerDefinition:d}),[l,c,d,p,o]);/* @__PURE__ */
|
|
251
|
+
return Ee(w,{value:h,children:n})},$N=e=>/* @__PURE__ */Ie("svg",{...e,viewBox:"0 0 147.5 149",children:[
|
|
252
252
|
/* @__PURE__ */Ee("path",{fill:"currentColor",d:"M94.008,120.333l-14.699,14.699c-17.816,17.816-46.86,17.816-64.676,0s-17.816-46.86,0-64.676l14.699-14.699 l5.88,5.88L20.513,76.236c-14.581,14.581-14.581,38.335,0,52.917s38.335,14.581,52.917,0l14.699-14.699L94.008,120.333z"}),
|
|
253
253
|
/* @__PURE__ */Ee("circle",{fill:"currentColor",cx:"32.058",cy:"58.79",r:"4.178"}),
|
|
254
254
|
/* @__PURE__ */Ee("ellipse",{fill:"currentColor",cx:"90.876",cy:"117.587",rx:"4.165",ry:"4.15"}),
|
|
@@ -278,20 +278,20 @@ e.module));return t[e.id]=n,n}catch(n){return window.__reactRouterContext&&windo
|
|
|
278
278
|
return ne.createElement(ne.Fragment,null,p.map(e=>/* @__PURE__ */ne.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n})),h.map(e=>/* @__PURE__ */ne.createElement("link",{key:e,rel:"modulepreload",href:e,...n})),f.map(({key:e,link:t})=>/* @__PURE__ */ne.createElement("link",{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}WC.displayName="FrameworkContext";function XC(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}ne.Component;var ZC="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{ZC&&(window.__reactRouterVersion="7.18.3")}catch(tR){}function eE({basename:e,children:t,useTransitions:n,window:r}){let i=ne.useRef();null==i.current&&(i.current=function(e={}){return function(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s="POP",l=null,c=u();function u(){return(o.state||{idx:null}).idx}function d(){s="POP";let e=u(),t=null==e?null:e-c;c=e,l&&l({action:s,location:h.location,delta:t})}function p(e){return function(e,t,n=!1){let r="http://localhost";e&&(r="null"!==e.location.origin?e.location.origin:e.location.href),hT(r,"No window.location.(origin|href) available to create URL");let i="string"==typeof t?t:yT(t);return i=i.replace(/ $/,"%20"),!n&&uT.test(i)&&(i=r+i),new URL(i,r)}(i,e)}null==c&&(c=0,o.replaceState({...o.state,idx:c},""));let h={get action(){return s},get location(){return e(i,o)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(dT,d),l=e,()=>{i.removeEventListener(dT,d),l=null}},createHref:e=>t(i,e),createURL:p,encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s="PUSH";let r=pT(e)?e:gT(h.location,e,t);n&&n(r,e),c=u()+1;let d=mT(r,c),p=h.createHref(r.mask||r);try{o.pushState(d,"",p)}catch(f){if(f instanceof DOMException&&"DataCloneError"===f.name)throw f;i.location.assign(p)}a&&l&&l({action:s,location:h.location,delta:1})},replace:function(e,t){s="REPLACE";let r=pT(e)?e:gT(h.location,e,t);n&&n(r,e),c=u();let i=mT(r,c),d=h.createHref(r.mask||r);o.replaceState(i,"",d),a&&l&&l({action:s,location:h.location,delta:0})},go:e=>o.go(e)};return h}(function(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return gT("",{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default",n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"==typeof t?t:yT(t)},null,e)}({window:r,v5Compat:!0}));let a=i.current,[o,s]=ne.useState({action:a.action,location:a.location}),l=ne.useCallback(e=>{!1===n?s(e):ne.startTransition(()=>s(e))},[n]);return ne.useLayoutEffect(()=>a.listen(l),[a,l]),/* @__PURE__ */ne.createElement(_C,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var tE=ne.forwardRef(function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:l,to:c,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:p,...h},f){let{basename:m,navigator:g,useTransitions:y}=ne.useContext(cC),b="string"==typeof c&&cT.test(c),v=QT(c,m),x=function(e,{relative:t}={}){hT(fC(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=ne.useContext(cC),{hash:i,pathname:a,search:o}=vC(e,{relative:t}),s=a;return"/"!==n&&(s="/"===a?n:VT([n,a])),r.createHref({pathname:s,search:o,hash:i})}(c=v.to,{relative:r}),k=mC(),w=null;if(o){let e=FT(o,[],k.mask?k.mask.pathname:"/",!0);"/"!==m&&(e.pathname="/"===e.pathname?m:VT([m,e.pathname])),w=g.createHref(e)}let[S,N,T]=function(e,t){let n=ne.useContext(WC),[r,i]=ne.useState(!1),[a,o]=ne.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:d}=t,p=ne.useRef(null);ne.useEffect(()=>{if("render"===e&&o(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),ne.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let h=()=>{i(!0)},f=()=>{i(!1),o(!1)};return n?"intent"!==e?[a,p,{}]:[a,p,{onFocus:JC(s,h),onBlur:JC(l,f),onMouseEnter:JC(c,h),onMouseLeave:JC(u,f),onTouchStart:JC(d,h)}]:[!1,p,{}]}(n,h),C=function(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:l,useTransitions:c}={}){let u=bC(),d=mC(),p=vC(e,{relative:o});return ne.useCallback(h=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(h,t)){h.preventDefault();let t=void 0!==n?n:yT(d)===yT(p),f=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:l});c?ne.startTransition(()=>f()):f()}},[d,u,p,n,r,i,t,e,a,o,s,l,c])}(c,{replace:a,mask:o,state:s,target:l,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:p,useTransitions:y}),E=!(v.isExternal||i),I=/* @__PURE__ */ne.createElement("a",{...h,...T,href:(E?w:void 0)||v.absoluteURL||x,onClick:E?function(t){e&&e(t),t.defaultPrevented||C(t)}:e,ref:XC(f,N),target:l,"data-discover":b||"render"!==t?void 0:"true"});return S&&!b?/* @__PURE__ */ne.createElement(ne.Fragment,null,I,/* @__PURE__ */ne.createElement(KC,{page:x})):I});tE.displayName="Link";var nE=ne.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:i,to:a,viewTransition:o,children:s,...l},c){let u=vC(a,{relative:l.relative}),d=mC(),p=ne.useContext(aC),{navigator:h,basename:f}=ne.useContext(cC),m=null!=p&&function(e,{relative:t}={}){let n=ne.useContext(lC);hT(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=iE("useViewTransitionState"),i=vC(e,{relative:t});if(!n.isTransitioning)return!1;let a=RT(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=RT(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=_T(i.pathname,o)||null!=_T(i.pathname,a)}(u)&&!0===o,g=h.encodeLocation?h.encodeLocation(u).pathname:u.pathname,y=d.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(y=y.toLowerCase(),b=b?b.toLowerCase():null,g=g.toLowerCase()),b&&f&&(b=RT(b,f)||b);const v="/"!==g&&g.endsWith("/")?g.length-1:g.length;let x,k=y===g||!r&&y.startsWith(g)&&"/"===y.charAt(v),w=null!=b&&(b===g||!r&&b.startsWith(g)&&"/"===b.charAt(g.length)),S={isActive:k,isPending:w,isTransitioning:m},N=k?e:void 0;x="function"==typeof n?n(S):[n,k?"active":null,w?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let T="function"==typeof i?i(S):i;/* @__PURE__ */
|
|
279
279
|
return ne.createElement(tE,{...l,"aria-current":N,className:x,ref:c,style:T,to:a,viewTransition:o},"function"==typeof s?s(S):s)});nE.displayName="NavLink";var rE=ne.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=DC,action:s,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:p,...h},f)=>{let{useTransitions:m}=ne.useContext(cC),g=function(){let{router:e}=iE("useSubmit"),{basename:t}=ne.useContext(cC),n=EC("useRouteId"),r=e.fetch,i=e.navigate;return ne.useCallback(async(e,a={})=>{let{action:o,method:s,encType:l,formData:c,body:u}=function(e,t){let n,r,i,a,o;if(RC(s=e)&&"form"===s.tagName.toLowerCase()){let o=e.getAttribute("action");r=o?RT(o,t):null,n=e.getAttribute("method")||DC,i=jC(e.getAttribute("enctype"))||PC,a=new FormData(e)}else if(function(e){return RC(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return RC(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let o=e.form;if(null==o)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||o.getAttribute("action");if(r=s?RT(s,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||DC,i=jC(e.getAttribute("formenctype"))||jC(o.getAttribute("enctype"))||PC,a=new FormData(o,e),!function(){if(null===MC)try{new FormData(document.createElement("form"),0),MC=!1}catch(tR){MC=!0}return MC}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";a.append(`${e}x`,"0"),a.append(`${e}y`,"0")}else t&&a.append(t,r)}}else{if(RC(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=DC,r=null,i=PC,o=e}var s;return a&&"text/plain"===i&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}(e,t);if(!1===a.navigate){let e=a.fetcherKey||oE();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:c,body:u,formMethod:a.method||s,formEncType:a.encType||l,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:c,body:u,formMethod:a.method||s,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}(),y=function(e,{relative:t}={}){let{basename:n}=ne.useContext(cC),r=ne.useContext(dC);hT(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...vC(e||".",{relative:t})},o=mC();if(null==e){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();a.search=n?`?${n}`:""}}return e&&"."!==e||!i.route.index||(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(a.pathname="/"===a.pathname?n:VT([n,a.pathname])),yT(a)}(s,{relative:c}),b="get"===o.toLowerCase()?"get":"post",v="string"==typeof s&&cT.test(s);/* @__PURE__ */
|
|
280
280
|
return ne.createElement("form",{ref:f,method:b,action:y,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute("formmethod")||o,h=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:c,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:p});m&&!1!==n?ne.startTransition(()=>h()):h()},...h,"data-discover":v||"render"!==e?void 0:"true"})});function iE(e){let t=ne.useContext(iC);return hT(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}rE.displayName="Form";var aE=0,oE=()=>`__${String(++aE)}__`;function sE({basename:e,children:t,location:n="/"}){"string"==typeof n&&(n=bT(n));let r={pathname:n.pathname||"/",search:n.search||"",hash:n.hash||"",state:null!=n.state?n.state:null,key:n.key||"default",mask:void 0},i={createHref:lE,encodeLocation:cE,push(e){throw new Error(`You cannot use navigator.push() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)})\` somewhere in your app.`)},replace(e){throw new Error(`You cannot use navigator.replace() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)}, { replace: true })\` somewhere in your app.`)},go(e){throw new Error(`You cannot use navigator.go() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${e})\` somewhere in your app.`)},back(){throw new Error("You cannot use navigator.back() on the server because it is a stateless environment.")},forward(){throw new Error("You cannot use navigator.forward() on the server because it is a stateless environment.")}};/* @__PURE__ */
|
|
281
|
-
return ne.createElement(_C,{basename:e,children:t,location:r,navigationType:"POP",navigator:i,static:!0,useTransitions:!1})}function lE(e){return"string"==typeof e?e:yT(e)}function cE(e){let t="string"==typeof e?e:yT(e);t=t.replace(/ $/,"%20");let n=cT.test(t)?new URL(t):new URL(t,"http://localhost");return{pathname:n.pathname,search:n.search,hash:n.hash}}var uE,dE=class extends Nl{constructor(e){super((t,n)=>{const{...r}=t;return Object.defineProperty(r,"client",{enumerable:!1,value:t.client}),new ji(i=>{let a=!1;return Promise.resolve(r).then(n=>e(t.getContext(),n)).then(t.setContext).then(()=>{a||n(t).subscribe(i)}).catch(i.error.bind(i)),()=>{a=!0}})})}},pE=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],hE=()=>{const e=new URLSearchParams(window.location.search),t={};for(const n of pE){const r=e.get(n);r&&(t[n.slice(4)]=r)}return Object.keys(t).length>0?t:void 0},fE=()=>"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,mE=e=>{uE=e},gE=(e,t)=>{uE?.track(e,t)},yE=({analytics:e})=>{const t=mC(),n=ke(!0===e?.firstViewCounted);return me(()=>{if(!e?.endpoint||!e.key)return;const t=((e,t=20,n=5e3)=>{const r=[],i=`${e.endpoint.replace(/\/+$/,"")}/batch?k=${encodeURIComponent(e.key)}`;let a;const o=()=>{0!==r.length&&(e=>{const t=JSON.stringify({events:e});"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(i,new Blob([t],{type:"application/json"}))||fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:t,keepalive:!0,mode:"no-cors"}).catch(()=>{})})(r.splice(0,r.length))},s=e=>{r.push(e),r.length>=t&&o()},l=()=>({path:window.location.pathname,title:document.title||void 0});return"undefined"!=typeof window&&(a=setInterval(o,n),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&o()}),window.addEventListener("pagehide",o)),{trackRender:()=>{s({id:fE(),type:"render",ts:Date.now(),page:l(),ref:{referrer:document.referrer||void 0,utm:hE()}})},track:(e,t)=>{s({id:fE(),type:"interaction",ts:Date.now(),page:l(),name:e,props:t})},flush:o,stop:()=>{a&&(clearInterval(a),a=void 0),o()}}})(e);return mE(t),()=>{mE(void 0),t.stop()}},[e]),me(()=>{n.current?n.current=!1:uE?.trackRender()},[t.pathname,t.search]),null},bE=se({});bE.displayName="AuthContext";var vE=({server:e,routerLocation:t})=>{let n=ve(()=>typeof window<"u"?window.location
|
|
282
|
-
/* @__PURE__ */Ee("b",{children
|
|
283
|
-
/* @__PURE__ */Ee("b",{children:d})," environment"]})),void b(!1);let n={};e.plugins.length>0&&(n=await SE(e.plugins.filter(e=>!k.current[e.type]))),h("render.overQuota",e.render?.overQuota??!1),
|
|
284
|
-
return Ie(Ce,{children:[/* @__PURE__ */Ee(QS,{children:("raw"===r||"widget"===r)&&y}),/* @__PURE__ */Ee(TE,{value:g,children:e})]})},EE=({children:e,schema:t})=>{const n=pe(ch),r=ve(()=>({...sh,...t||n.schema}),[t,n.schema]);p("schema",r);const i=ve(()=>mt(
|
|
281
|
+
return ne.createElement(_C,{basename:e,children:t,location:r,navigationType:"POP",navigator:i,static:!0,useTransitions:!1})}function lE(e){return"string"==typeof e?e:yT(e)}function cE(e){let t="string"==typeof e?e:yT(e);t=t.replace(/ $/,"%20");let n=cT.test(t)?new URL(t):new URL(t,"http://localhost");return{pathname:n.pathname,search:n.search,hash:n.hash}}var uE,dE=class extends Nl{constructor(e){super((t,n)=>{const{...r}=t;return Object.defineProperty(r,"client",{enumerable:!1,value:t.client}),new ji(i=>{let a=!1;return Promise.resolve(r).then(n=>e(t.getContext(),n)).then(t.setContext).then(()=>{a||n(t).subscribe(i)}).catch(i.error.bind(i)),()=>{a=!0}})})}},pE=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],hE=()=>{const e=new URLSearchParams(window.location.search),t={};for(const n of pE){const r=e.get(n);r&&(t[n.slice(4)]=r)}return Object.keys(t).length>0?t:void 0},fE=()=>"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,mE=e=>{uE=e},gE=(e,t)=>{uE?.track(e,t)},yE=({analytics:e})=>{const t=mC(),n=ke(!0===e?.firstViewCounted);return me(()=>{if(!e?.endpoint||!e.key)return;const t=((e,t=20,n=5e3)=>{const r=[],i=`${e.endpoint.replace(/\/+$/,"")}/batch?k=${encodeURIComponent(e.key)}`;let a;const o=()=>{0!==r.length&&(e=>{const t=JSON.stringify({events:e});"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(i,new Blob([t],{type:"application/json"}))||fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:t,keepalive:!0,mode:"no-cors"}).catch(()=>{})})(r.splice(0,r.length))},s=e=>{r.push(e),r.length>=t&&o()},l=()=>({path:window.location.pathname,title:document.title||void 0});return"undefined"!=typeof window&&(a=setInterval(o,n),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&o()}),window.addEventListener("pagehide",o)),{trackRender:()=>{s({id:fE(),type:"render",ts:Date.now(),page:l(),ref:{referrer:document.referrer||void 0,utm:hE()}})},track:(e,t)=>{s({id:fE(),type:"interaction",ts:Date.now(),page:l(),name:e,props:t})},flush:o,stop:()=>{a&&(clearInterval(a),a=void 0),o()}}})(e);return mE(t),()=>{mE(void 0),t.stop()}},[e]),me(()=>{n.current?n.current=!1:uE?.trackRender()},[t.pathname,t.search]),null},bE=se({});bE.displayName="AuthContext";var vE=({server:e,routerLocation:t})=>{let n=ve(()=>typeof window<"u"?window.location:s(e,"location",{pathname:"/"}),[e]),r=ve(()=>{if(!t)return n;let{origin:e,host:r,hostname:i,protocol:a,href:o}=n,{pathname:s,search:l}=t;return{origin:e,host:r,hostname:i,protocol:a,pathname:s,search:l,hash:"",href:e?`${e}${s}${l}`:o}},[n,t]),i=ve(()=>ee(r.search),[r.search]),a=ve(()=>r.hostname?r.hostname:"localhost",[r.hostname]),o=r.origin||"";return ve(()=>({queryParams:i,hostname:a,origin:o,location:r}),[i,a,o,r])},xE=({children:e,currentPageId:t})=>{const{server:n}=pe(lh),r=k(),{renderMode:i,previewMode:a,environment:o}=Pe(),[[l,c,u]]=F(["schema.pageFolders","pageDefinitions","schema.variables"]),d=n.ssr?.renderResult,h="widget"!==i?mC():void 0,{queryParams:f,hostname:m,origin:g,location:y}=vE({server:n,routerLocation:h}),b=ke(c);b.current=c;const{authenticated:v}=pe(bE),x="widget"!==i?bC():void 0,w=ve(()=>_h(c,l,v,n.basePath,a),[c,l,v,n.basePath,a]),{action:S,pageId:N="",pathMatch:T}=ve(()=>"widget"===i?{action:{type:"normal",path:""},pageId:t}:Dh(w,y.pathname,v),[w,y.pathname,v,i,t]),C=t||N;me(()=>{Gp.info("navigation",/* @__PURE__ */Ie("span",{children:["Navigated to page"," ",
|
|
282
|
+
/* @__PURE__ */Ee("b",{children:s(c,`${C}.attributes.name`,C||"Unknown")})]}),{status:S.type,elementId:C})},[S.type,C,c]);const E=he(e=>{const t=s(b,`current.${e}`,void 0);if(!t)return e;const{slug:n,default:r}=t.attributes;return"string"==typeof n?n.startsWith("/")?n:`/${n}`:r?"/":`/${e}`},[]),I=he((e,t=!1)=>{if(t&&"undefined"!=typeof window)return void(window.location.href=e);const n=E(e);if(!r.get("rsc.enabled"))return void x?.(n);const i=()=>x?.(n);Promise.race([Lh(r,void 0,void 0,n),new Promise(e=>setTimeout(e,1500))]).then(i,i)},[x,E,r]),O=ve(()=>{const e=w.find(e=>e.pageId===C&&!e.isRaw);return e?{...Ph(e.path).reduce((e,t)=>({...e,[t]:""}),{}),...s(T,"params",{})}:s(T,"params",{})},[w,T,C]),z=ve(()=>new URLSearchParams(y.search),[y.search]);if(p(["navigation.urlSearchParams","navigation.routeParams","navigation.queryParams","navigation.hostname","navigation.origin","navigation.currentPageId","navigation.navigate"],[z,O,f,m,g,C,I],{raw:!0}),"notFound"===S.type)return d&&(d.status=404),"Not Found";if("accessDenied"===S.type)return d&&(d.status=403),"Access Denied";if("redirect"===S.type){const e=Hp(u,{queryParams:f,routeParams:O,hostname:m,environment:o}),t=S.path?String($(S.path,{variables:e},!1,!0)):"";if(t&&Eh(t)){const e=new URL(t);return e.searchParams.has("redirect")||e.searchParams.set("redirect",(e=>e.href?e.href:`${e.protocol||"https:"}//${e.host||e.hostname}${e.pathname}${e.search}`)(y)),d?(d.redirect=e.toString(),null):(window.location.assign(e.toString()),null)}return d?(d.redirect=S.path??"",null):/* @__PURE__ */Ee(AC,{to:S.path??"",replace:!0})}return e},kE=(e,{src:t,type:n,isMain:r},i=!1)=>{let a,o=`${e}/${t}`,s=btoa(o);return a="style"===n&&o.endsWith(".css")?{type:"link",id:s,params:{href:o,rel:"stylesheet",type:"text/css"},isMain:r}:{type:"script",id:s,params:{src:o,type:"text/javascript"},isMain:r},i&&delete a.isMain,a},wE=(e,t)=>{try{let{resource:n,settings:r,type:i}=e,{definition:{name:a="Plitzi's Demo Plugin",owner:o="Plitzi",verified:l=!1,license:c="MIT",website:u="https://plitzi.com",backgroundColor:d="#4422ee",icon:p="https://cdn.plitzi.com/resources/img/favicon.svg"},assets:h,assetsSettings:f,pluginSchema:m}=t;return Object.values(s(t,"pluginSchema",{})).reduce((e,s)=>{let{definition:g,builder:y,defaultStyle:b,attributes:v}=s,x=[];return g.type===i&&(x=Object.keys(X(m,[i]))),{...e,[g.type]:{attributes:v,builder:y,defaultStyle:b,definition:g,market:{owner:o,verified:l,license:c,website:u,backgroundColor:d,icon:p,category:a},resource:n,isMain:g.type===i,manifest:t,type:i,settings:r,assetsSettings:Object.values(f).filter(({src:e})=>!!e&&[".css",".js",".mjs",".cjs"].some(t=>e.endsWith(t))).map(e=>kE(n,e,!0)),assets:Object.values(h).filter(({src:e})=>!!e&&[".css",".js",".mjs",".cjs"].some(t=>e.endsWith(t))).map(e=>kE(n,e)),subPlugins:x}}},{})}catch{return{}}},SE=async(e=[])=>{let t={};if(!Array.isArray(e))return t;let n=await(async e=>{if(!Array.isArray(e)||0===e.length)return{};let t=e.map(e=>(async e=>{let t;try{return t=await(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json(),t}catch{return t}})(e));return(await Promise.allSettled(t)).reduce((e,t)=>"fulfilled"===t.status&&t.value?{...e,[s(t.value,"root","")]:t.value}:e,{})})(e.filter(e=>e.resource).reduce((e,t)=>[...e,`${t.resource}/plugin-manifest.json`],[]));return e.forEach(e=>{let{type:r}=e,i=s(n,r);t={...t,...wE(e,i)}}),t},NE=({children:e,server:t,revision:n,webKey:r="",webId:i,userKey:a="",instanceId:o,offlineMode:l=!1,offlineData:c,offlineDataType:u="json"})=>{const{environment:d,debugMode:p}=Pe(),h=g(),f=l&&!!c&&!!c.schema,m=pe(qN()).client,[y,b]=we(!(l&&c)),[v,x]=we(void 0),{components:k}=pe(w),[N,T]=we(()=>f&&"json"===u?{...c,plugins:{},segments:{}}:{plugins:{},segments:{}}),C=he(async(e,t,n="network-only")=>{const r=dh[e];if(!r)throw x("Query Not Found"),new Error(`Query ${e} not found`);let i;try{i=await(m?.query({query:r,variables:{environment:d,...t},fetchPolicy:n}))}catch(tR){return{success:!1,result:void 0,error:tR}}return i||x("Network Not Available, Please try again"),{success:!0,result:i?.data}},[m,d]),E=he(async(e,t,n=!0,r={})=>{if(!uh[e])return{success:!1,result:void 0,error:"Mutation Not Found"};let i;try{i=await(m?.mutate({mutation:uh[e],variables:n?{environment:d,...t}:t,context:{fetchOptions:{customFetch:!1,...r}}}))}catch(tR){return{success:!1,result:void 0,error:tR}}return i?{success:!0,result:i.data}:{success:!1,result:void 0,error:"Network Not Available, Please try again"}},[m,d]);me(()=>{l&&c?f&&(async()=>{let e={};c?.plugins&&c.plugins.length>0&&(e=await SE(c.plugins.filter(e=>!k.current[e.type]))),T(t=>({...t,plugins:e})),b(!1)})():(b(e=>e||!0),(async()=>{let e=n;"number"==typeof n&&0!==n||(e=void 0);const t=await C("Init",{environment:d,revision:e},"network-only");if(t.error)return b(!1),void("string"==typeof t.error?x(t.error):"statusCode"in t.error&&401===t.error.statusCode?x("Access not authorized"):"networkError"in t.error&&t.error.networkError?x("Service not available"):x(t.error.message));if(t.success&&t.result){const{Space:e}=S(t.result);if(!e)return x(/* @__PURE__ */Ie("span",{children:["Space not found, publish to ",
|
|
283
|
+
/* @__PURE__ */Ee("b",{children:d})," environment"]})),void b(!1);let n={};e.plugins.length>0&&(n=await SE(e.plugins.filter(e=>!k.current[e.type]))),h("render.overQuota",e.render?.overQuota??!1),T({schema:{...sh,...e.schema,flat:e.schema.flat.reduce((e,t)=>({...e,[t.id]:t}),{})},plugins:n,style:e.style,segments:e.segments?.map(e=>({...e,schema:{...s(e,"schema"),flat:s(e,"schema.flat",[]).reduce((e,t)=>({...e,[t.id]:t}),{})}})).reduce((e,t)=>({...e,[t.identifier]:t}),{})??{}})}b(!1)})())},[f,l&&u,r,d,p]);const I=ve(()=>({query:C,mutate:E,webKey:r,webId:i,server:t,environment:d,instanceId:o,userKey:a}),[C,E,r,i,t,d,o,a]);return v?/* @__PURE__ */Ee("div",{children:v}):y?null:/* @__PURE__ */Ee(lh,{value:I,children:/* @__PURE__ */Ee(ch,{value:N,children:e})})},TE=se({assets:{}});TE.displayName="PluginsContext";var CE=({children:e,plugins:t,sdkStylePath:n="./plitzi-sdk.css"})=>{const{renderMode:r}=Pe(),[i,a]=we({}),o=pe(ch),l=ve(()=>t||o.plugins,[t,o]),{components:c}=pe(w),u=he((e,t,n="")=>t?s(l,`${e}.settings.${t}`,n):s(l,`${e}.settings`,{}),[l]),d=he((e=[])=>{const t=e.reduce((e,t)=>{let n="";return n="script"===t.type?t.params.src:t.params.href,n?(n=btoa(n),{...e,[n]:{...t,key:n}}):e},{});0!==Object.keys(t).length&&a(e=>({...e,...t}))},[]),p=he((e=[])=>{const t=e.filter(e=>!function(e){return null==e||"number"!=typeof e&&"boolean"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e&&("string"==typeof e||Array.isArray(e)?0===e.length:e instanceof Map||e instanceof Set?0===e.size:"object"==typeof e&&0===Object.keys(e).length)}(e)).map(e=>btoa(e));a(e=>X(e,t))},[]),h=ve(()=>(e=>Object.values(e).reduce((e,t)=>({...e,...s(t,"assets",[]).filter(e=>"link"===e.type).reduce((e,t)=>({...e,[btoa(t.id)]:t}),{})}),{}))(l),[l]),f=ve(()=>Object.keys(c.current).filter(e=>"local-custom"===c.current[e].origin).reduce((e,t)=>({...e,...s(c,`${t}.assets`,[]).reduce((e,n,r)=>({...e,[`${t}-${r}`]:{type:"link",id:`${t}-${r}`,params:n}}),{})}),{}),[c.current]),m=ve(()=>{const e={};return"iframe"!==r&&"shadow"!==r||(e["static-99"]={type:"link",id:"static-99",params:{type:"text/css",href:n,rel:"stylesheet"}}),{...e,...f,...h,...i}},[f,h,i,r,n]),g=ve(()=>({assets:m,getSettings:u,plugins:l,registerCustomAssets:d,unregisterCustomAssets:p}),[m,u,l,d,p]),y=ve(()=>Object.values({...h,...i}).map((e,t)=>/* @__PURE__ */Ee(e.type,{...e.params},t)),[h,i]);/* @__PURE__ */
|
|
284
|
+
return Ie(Ce,{children:[/* @__PURE__ */Ee(QS,{children:("raw"===r||"widget"===r)&&y}),/* @__PURE__ */Ee(TE,{value:g,children:e})]})},EE=({children:e,schema:t})=>{const n=pe(ch),r=ve(()=>({...sh,...t||n.schema}),[t,n.schema]);p("schema",r);const i=ve(()=>mt(s(r,"flat",{}),s(r,"pages",[])),[r.pages]);return p("pageDefinitions",i),e},IE=se({});IE.displayName="ContainerRootContext";var OE=({className:e="",children:t,...n})=>{let r=ke(null),i=he(()=>r.current instanceof HTMLElement?r.current.getRootNode():void 0,[r]),a=he(()=>i()instanceof ShadowRoot,[i]),o=ve(()=>({getHost:i,rootRef:r,isRootShadow:a}),[i,r,a]);/* @__PURE__ */
|
|
285
285
|
return Ee("div",{...n,ref:r,className:e,children:/* @__PURE__ */Ee(IE,{value:o,children:t})})},zE=se({});zE.displayName="InteractionsContext";var AE=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/,_E=/^rgba?\(\s*(\d{1,3}%?\s*,\s*){2,3}\d{1,3}%?\s*\)$/,DE=/^hsla?\(\s*\d{1,3}(deg|rad|turn)?\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%(\s*,\s*(0|0?\.\d+|1))?\s*\)$/,PE=/* @__PURE__ */new Set(["black","white","red","green","blue","yellow","cyan","magenta","orange","purple","brown","pink","gray","lime","teal","navy","silver","maroon","olive","aqua","fuchsia"]),RE=({children:e,contentDidMount:t,contentDidDismount:n})=>(me(()=>(t?.(),()=>{n?.()}),[]),e),ME=({ref:e,className:t="",ssrMode:n=!1,id:r="",css:i="",style:a,zoom:o=1,assets:s,viewport:l="width=device-width, initial-scale=1",children:c,contentDidMount:u,contentDidDismount:d,contentDidUpdate:p,onLoad:h})=>{t=Op("ContainerFrame",{className:t,componentKey:"root"});let f=ke(null);ye(e,()=>f.current,[f]);let[m,g]=we(!1),[y,b]=we(null),v=he((e,t,n)=>{let r=[...t.childNodes],i=n.getElementById("customStyle");Object.values(e).forEach(e=>{let a=n.createElement(e.type);e.id&&a.setAttribute("data-id",e.id),Object.keys(e.params).forEach(t=>{("link"===e.type||"script"===e.type)&&a.setAttribute(t,e.params[t])}),r.find(t=>"link"===e.type&&t.href===a.href||"script"===e.type&&t.src===a.src)||(t.insertBefore(a,i),r.push(a))})},[]),x=he((e,t)=>{let{head:n}=e,r=n.querySelectorAll('*:not([asset-static="true"])');Object.values(r).forEach(e=>{n.removeChild(e)}),t&&v(t,n,e)},[v]),[k]=we(()=>(e=>{if(!e)return"";let t=[];return Object.values(e).forEach(e=>{t.push(`<${e.type} ${Object.keys(e.params).map(t=>`${t}="${e.params[t]}"`).join(" ")}>`)}),t.join("")})(s)),w=he(()=>u?.(),[u]);me(()=>{m&&y&&x(y,s)},[m,s,y,x]);let S=he(()=>{let e=f.current&&y,t=f.current?.contentDocument===y;!e||t?m||(h?.(f.current),g(!0),b(f.current?.contentDocument)):b(f.current?.contentDocument)},[m,y,h]);return me(()=>{y&&(y.body.style.zoom=1===o?"":`${o}`)},[y,o]),/* @__PURE__ */Ie("iframe",{ref:f,className:t,title:"#",srcDoc:`<!DOCTYPE html><html><head>${k}</head><body></body></html>`,id:r,onLoad:S,style:a,children:[m&&y&&Oe(/* @__PURE__ */Ie(Ce,{children:[
|
|
286
286
|
/* @__PURE__ */Ee("meta",{name:"viewport",content:l,"asset-static":"true"}),!n&&i&&/* @__PURE__ */Ee("style",{id:"customStyle","asset-static":"true",children:i}),n&&i&&/* @__PURE__ */Ee("style",{id:"customStyle","asset-static":"true",dangerouslySetInnerHTML:{__html:i}})]}),y.head),m&&y&&c&&Oe(/* @__PURE__ */Ee(RE,{contentDidMount:w,contentDidDismount:d,contentDidUpdate:p,children:ie.only(c)}),y.body)]})},LE=se({addToast:()=>{}});LE.displayName="ToastContext";var jE=e=>"number"==typeof e&&!isNaN(e),FE=e=>"string"==typeof e,$E=e=>"function"==typeof e,VE=e=>FE(e)||$E(e)?e:null,qE=(e,t)=>!1===e||jE(e)&&e>0?e:t,BE=e=>ue(e)||FE(e)||$E(e)||jE(e);function UE({enter:e,exit:t,appendPosition:n=!1,collapse:r=!0,collapseDuration:i=300}){return function({children:a,position:o,preventExitTransition:s,done:l,nodeRef:c,isIn:u,playToast:d}){let p=n?`${e}--${o}`:e,h=n?`${t}--${o}`:t,f=ke(0);return be(()=>{let e=c.current,t=p.split(" "),n=r=>{r.target===c.current&&(d(),e.removeEventListener("animationend",n),e.removeEventListener("animationcancel",n),0===f.current&&"animationcancel"!==r.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",n),e.addEventListener("animationcancel",n)},[]),me(()=>{let e=c.current,t=()=>{e.removeEventListener("animationend",t),r?function(e,t,n=300){let{scrollHeight:r,style:i}=e;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(t,n)})})}(e,l,i):l()};u||(s?t():(f.current=1,e.className+=` ${h}`,e.addEventListener("animationend",t)))},[u]),re.createElement(re.Fragment,null,a)}}function HE(e,t){return{content:WE(e.content,e.props),containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,reason:e.removalReason,status:t}}function WE(e,t,n=!1){return ue(e)&&!FE(e.type)?oe(e,{closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):$E(e)?e({closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):e}function GE({delay:e,isRunning:t,closeToast:n,type:r="default",hide:i,className:a,controlledProgress:o,progress:s,rtl:l,isIn:c,theme:u}){let d=i||o&&0===s,p={animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};o&&(p.transform=`scaleX(${s})`);let h=vt("Toastify__progress-bar",o?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${u}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":l}),f=$E(a)?a({rtl:l,type:r,defaultClassName:h}):vt(h,a),m={[o&&s>=1?"onTransitionEnd":"onAnimationEnd"]:o&&s<1?null:()=>{c&&n()}};return re.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":d},re.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${u} Toastify__progress-bar--${r}`}),re.createElement("div",{role:"progressbar","aria-hidden":d?"true":"false","aria-label":"notification timer","aria-valuenow":o?Math.round(100*s):void 0,"aria-valuemin":0,"aria-valuemax":100,className:f,style:p,...m}))}var JE=1,KE=()=>""+JE++;var QE=/* @__PURE__ */new Map,YE=[],XE=/* @__PURE__ */new Set,ZE=e=>XE.forEach(t=>t(e)),eI=()=>QE.size>0;function tI(e,t){var n;if(t)return!(null==(n=QE.get(t))||!n.isToastActive(e));let r=!1;return QE.forEach(t=>{t.isToastActive(e)&&(r=!0)}),r}function nI(e,t){BE(e)&&(eI()||YE.push({content:e,options:t}),QE.forEach(n=>{n.buildToast(e,t)}))}function rI(e,t){QE.forEach(n=>{(null==t||null==t||!t.containerId||(null==t?void 0:t.containerId)===n.id)&&n.toggle(e,null==t?void 0:t.id)})}function iI(e){let t=e.containerId||1;return{subscribe(n){let r=function(e,t,n){let r=1,i=0,a=[],o=[],s=t,l=/* @__PURE__ */new Map,c=/* @__PURE__ */new Set,u=()=>{o=Array.from(l.values()),c.forEach(e=>e())},d=e=>{var t,r;e.isActive&&(null==(r=null==(t=e.props)?void 0:t.onClose)||r.call(t,e.removalReason),e.isActive=!1,n(HE(e,"removed")))},p=e=>{if(null==e)l.forEach(d);else{let t=l.get(e);t&&d(t)}u()},h=e=>{var t,r;let{toastId:i,updateId:a}=e.props,o=null==a;e.staleId&&l.delete(e.staleId),e.isActive=!0,l.set(i,e),u(),n(HE(e,o?"added":"updated")),o&&(null==(r=(t=e.props).onOpen)||r.call(t))};return{id:e,props:s,observe:e=>(c.add(e),()=>c.delete(e)),toggle:(e,t)=>{l.forEach(n=>{var r;(null==t||t===n.props.toastId)&&(null==(r=n.toggle)||r.call(n,e))})},removeToast:p,toasts:l,clearQueue:()=>{i-=a.length,a=[]},buildToast:(t,n)=>{if((({containerId:t,toastId:n,updateId:r})=>{let i=t?t!==e:1!==e,a=l.has(n)&&null==r;return i||a})(n))return;let{toastId:o,updateId:c,data:d,staleId:f,delay:m}=n,g=null==c;g&&i++;let y={...s,style:s.toastStyle,key:r++,...Object.fromEntries(Object.entries(n).filter(([e,t])=>null!=t)),toastId:o,updateId:c,data:d,isIn:!1,className:VE(n.className||s.toastClassName),progressClassName:VE(n.progressClassName||s.progressClassName),autoClose:!n.isLoading&&qE(n.autoClose,s.autoClose),closeToast(e){let t=l.get(o);t&&(t.removalReason=e,p(o))},deleteToast(){if(null!=l.get(o)){if(l.delete(o),i--,i<0&&(i=0),a.length>0)return void h(a.shift());u()}}};y.closeButton=s.closeButton,!1===n.closeButton||BE(n.closeButton)?y.closeButton=n.closeButton:!0===n.closeButton&&(y.closeButton=!BE(s.closeButton)||s.closeButton);let b={content:t,props:y,staleId:f};s.limit&&s.limit>0&&i>s.limit&&g?a.push(b):jE(m)?setTimeout(()=>{h(b)},m):h(b)},setProps(e){s=e},setToggle:(e,t)=>{let n=l.get(e);n&&(n.toggle=t)},isToastActive:e=>{var t;return null==(t=l.get(e))?void 0:t.isActive},getSnapshot:()=>o}}(t,e,ZE);QE.set(t,r);let i=r.observe(n);return YE.forEach(e=>nI(e.content,e.options)),YE=[],()=>{i(),QE.delete(t)}},setProps(e){var n;null==(n=QE.get(t))||n.setProps(e)},getSnapshot(){var e;return null==(e=QE.get(t))?void 0:e.getSnapshot()}}}function aI(e){return e&&(FE(e.toastId)||jE(e.toastId))?e.toastId:KE()}function oI(e,t){return nI(e,t),t.toastId}function sI(e,t){return{...t,type:t&&t.type||e,toastId:aI(t)}}function lI(e){return(t,n)=>oI(t,sI(e,n))}function cI(e,t){return oI(e,sI("default",t))}cI.loading=(e,t)=>oI(e,sI("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),cI.promise=function(e,{pending:t,error:n,success:r},i){let a;t&&(a=FE(t)?cI.loading(t,i):cI.loading(t.render,{...i,...t}));let o={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},s=(e,t,n)=>{if(null==t)return void cI.dismiss(a);let r={type:e,...o,...i,data:n},s=FE(t)?{render:t}:t;return a?cI.update(a,{...r,...s}):cI(s.render,{...r,...s}),n},l=$E(e)?e():e;return l.then(e=>s("success",r,e)).catch(e=>s("error",n,e)),l},cI.success=lI("success"),cI.info=lI("info"),cI.error=lI("error"),cI.warning=lI("warning"),cI.warn=cI.warning,cI.dark=(e,t)=>oI(e,sI("default",{theme:"dark",...t})),cI.dismiss=function(e){!function(e){if(eI()){if(null==e||(e=>FE(e)||jE(e))(e))QE.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=QE.get(e.containerId);t?t.removeToast(e.id):QE.forEach(t=>{t.removeToast(e.id)})}}else YE=YE.filter(t=>null!=e&&t.options.toastId!==e)}(e)},cI.clearWaitingQueue=(e={})=>{QE.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})},cI.isActive=tI,cI.update=(e,t={})=>{let n=((e,{containerId:t})=>{var n;return null==(n=QE.get(t||1))?void 0:n.toasts.get(e)})(e,t);if(n){let{props:r,content:i}=n,a={delay:100,...r,...t,toastId:t.toastId||e,updateId:KE()};a.toastId!==e&&(a.staleId=e);let o=a.render||i;delete a.render,oI(o,a)}},cI.done=e=>{cI.update(e,{progress:1})},cI.onChange=function(e){return XE.add(e),()=>{XE.delete(e)}},cI.play=e=>rI(!0,e),cI.pause=e=>rI(!1,e);var uI="undefined"!=typeof window?be:me,dI=({theme:e,type:t,isLoading:n,...r})=>re.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===e?"currentColor":`var(--toastify-icon-color-${t})`,...r}),pI={info:function(e){return re.createElement(dI,{...e},re.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return re.createElement(dI,{...e},re.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return re.createElement(dI,{...e},re.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return re.createElement(dI,{...e},re.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return re.createElement("div",{className:"Toastify__spinner"})}};var hI=e=>{let{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:i,playToast:a}=function(e){let[t,n]=we(!1),[r,i]=we(!1),a=ke(null),o=ke({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:s,pauseOnHover:l,closeToast:c,onClick:u,closeOnClick:d}=e;function p(){n(!0)}function h(){n(!1)}function f(n){let r=a.current;if(o.canDrag&&r){o.didMove=!0,t&&h(),"x"===e.draggableDirection?o.delta=n.clientX-o.start:o.delta=n.clientY-o.start,o.start!==n.clientX&&(o.canCloseOnClick=!1);let i="x"===e.draggableDirection?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`;r.style.transform=`translate3d(${i},0)`,r.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance))}}function m(){document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",m);let t=a.current;if(o.canDrag&&o.didMove&&t){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return i(!0),e.closeToast(!0),void e.collapseAll();t.style.transition="transform 0.2s, opacity 0.2s",t.style.removeProperty("transform"),t.style.removeProperty("opacity")}}(function(e){var t;null==(t=QE.get(e.containerId||1))||t.setToggle(e.id,e.fn)})({id:e.toastId,containerId:e.containerId,fn:n}),me(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||h(),window.addEventListener("focus",p),window.addEventListener("blur",h),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",h)}},[e.pauseOnFocusLoss]);let g={onPointerDown:function(t){if(!0===e.draggable||e.draggable===t.pointerType){o.didMove=!1,document.addEventListener("pointermove",f),document.addEventListener("pointerup",m);let n=a.current;o.canCloseOnClick=!0,o.canDrag=!0,n.style.transition="none","x"===e.draggableDirection?(o.start=t.clientX,o.removalDistance=n.offsetWidth*(e.draggablePercent/100)):(o.start=t.clientY,o.removalDistance=n.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(t){let{top:n,bottom:r,left:i,right:o}=a.current.getBoundingClientRect();"mouse"===t.pointerType&&e.pauseOnHover&&t.clientX>=i&&t.clientX<=o&&t.clientY>=n&&t.clientY<=r?h():p()}};return s&&l&&(g.onMouseEnter=h,e.stacked||(g.onMouseLeave=p)),d&&(g.onClick=e=>{u&&u(e),o.canCloseOnClick&&c(!0)}),{playToast:p,pauseToast:h,isRunning:t,preventExitTransition:r,toastRef:a,eventHandlers:g}}(e),{closeButton:o,children:s,autoClose:l,onClick:c,type:u,hideProgressBar:d,closeToast:p,transition:h,position:f,className:m,style:g,progressClassName:y,updateId:b,role:v,progress:x,rtl:k,toastId:w,deleteToast:S,isIn:N,isLoading:T,closeOnClick:C,theme:E,ariaLabel:I}=e,O=vt("Toastify__toast",`Toastify__toast-theme--${E}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":k},{"Toastify__toast--close-on-click":C}),z=$E(m)?m({rtl:k,position:f,type:u,defaultClassName:O}):vt(O,m),A=function({theme:e,type:t,isLoading:n,icon:r}){let i=null,a={theme:e,type:t};return!1===r||($E(r)?i=r({...a,isLoading:n}):ue(r)?i=oe(r,a):n?i=pI.spinner():(e=>e in pI)(t)&&(i=pI[t](a))),i}(e),_=!!x||!l,D={closeToast:p,type:u,theme:E},P=null;return!1===o||(P=$E(o)?o(D):ue(o)?oe(o,D):function({closeToast:e,theme:t,ariaLabel:n="close"}){return re.createElement("button",{className:`Toastify__close-button Toastify__close-button--${t}`,type:"button",onClick:t=>{t.stopPropagation(),e(!0)},"aria-label":n},re.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},re.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(D)),re.createElement(h,{isIn:N,done:S,position:f,preventExitTransition:n,nodeRef:r,playToast:a},re.createElement("div",{id:w,tabIndex:0,onClick:c,"data-in":N,className:z,...i,style:g,ref:r,...N&&{role:v,"aria-label":I}},null!=A&&re.createElement("div",{className:vt("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!T})},A),WE(s,e,!t),P,!e.customProgressBar&&re.createElement(GE,{...b&&!_?{key:`p-${b}`}:{},rtl:k,theme:E,delay:l,isRunning:t,isIn:N,closeToast:p,hide:d,type:u,className:y,controlledProgress:_,progress:x||0})))},fI=(e,t=!1)=>({enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}),mI=UE(fI("bounce",!0)),gI=(UE(fI("slide",!0)),UE(fI("zoom")),UE(fI("flip")),{position:"top-right",transition:mI,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:e=>e.altKey&&"KeyT"===e.code});function yI(e){let t={...gI,...e},n=e.stacked,[r,i]=we(!0),a=ke(null),{getToastToRender:o,isToastActive:s,count:l}=function(e){var t;let{subscribe:n,getSnapshot:r,setProps:i}=ke(iI(e)).current;i(e);let a=null==(t=Se(n,r,r))?void 0:t.slice();return{getToastToRender:function(t){if(!a)return[];let n=/* @__PURE__ */new Map;return e.newestOnTop&&a.reverse(),a.forEach(e=>{let{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)}),Array.from(n,e=>t(e[0],e[1]))},isToastActive:tI,count:null==a?void 0:a.length}}(t),{className:c,style:u,rtl:d,containerId:p,hotKeys:h}=t;function f(e){let t=vt("Toastify__toast-container",`Toastify__toast-container--${e}`,{"Toastify__toast-container--rtl":d});return $E(c)?c({position:e,rtl:d,defaultClassName:t}):vt(t,VE(c))}function m(){n&&(i(!0),cI.play())}return uI(()=>{var e;if(n){let n=a.current.querySelectorAll('[data-in="true"]'),i=12,o=null==(e=t.position)?void 0:e.includes("top"),s=0,l=0;Array.from(n).reverse().forEach((e,t)=>{let n=e;n.classList.add("Toastify__toast--stacked"),t>0&&(n.dataset.collapsed=`${r}`),n.dataset.pos||(n.dataset.pos=o?"top":"bot");let a=s*(r?.2:1)+(r?0:i*t),c=Math.max(.5,1-(r?l:0));n.style.setProperty("--y",`${o?a:-1*a}px`),n.style.setProperty("--g",`${i}`),n.style.setProperty("--s",`${c}`),s+=n.offsetHeight,l+=.025})}},[r,l,n]),me(()=>{function e(e){var t;let n=a.current;h(e)&&(null==(t=null==n?void 0:n.querySelector('[tabIndex="0"]'))||t.focus(),i(!1),cI.pause()),"Escape"===e.key&&(document.activeElement===n||null!=n&&n.contains(document.activeElement))&&(i(!0),cI.play())}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[h]),re.createElement("section",{ref:a,className:"Toastify",id:p,onMouseEnter:()=>{n&&(i(!1),cI.pause())},onMouseLeave:m,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":t["aria-label"]},o((e,t)=>{let r=t.length?{...u}:{...u,pointerEvents:"none"};return re.createElement("div",{tabIndex:-1,className:f(e),"data-stacked":n,style:r,key:`c-${e}`},t.map(({content:e,props:t})=>re.createElement(hI,{...t,stacked:n,collapseAll:m,isIn:s(t.toastId,t.containerId),key:`t-${t.key}`},e)))}))}var bI=/* @__PURE__ */new Map;function vI(e){return((e,t)=>{uI(()=>{if("undefined"==typeof document)return;let n=document,r=bI.get(n);if(r)return void(t&&r.setAttribute("nonce",t));let i=n.createElement("style");i.textContent=e,t&&i.setAttribute("nonce",t),n.head.appendChild(i),bI.set(n,i)},[t])})(":root {\n --toastify-color-light: #fff;\n --toastify-color-dark: #121212;\n --toastify-color-info: #3498db;\n --toastify-color-success: #07bc0c;\n --toastify-color-warning: #f1c40f;\n --toastify-color-error: hsl(6, 78%, 57%);\n --toastify-color-transparent: rgba(255, 255, 255, 0.7);\n\n --toastify-icon-color-info: var(--toastify-color-info);\n --toastify-icon-color-success: var(--toastify-color-success);\n --toastify-icon-color-warning: var(--toastify-color-warning);\n --toastify-icon-color-error: var(--toastify-color-error);\n\n --toastify-container-width: fit-content;\n --toastify-toast-width: 320px;\n --toastify-toast-offset: 16px;\n --toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));\n --toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));\n --toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));\n --toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));\n --toastify-toast-background: #fff;\n --toastify-toast-padding: 14px;\n --toastify-toast-min-height: 64px;\n --toastify-toast-max-height: 800px;\n --toastify-toast-bd-radius: 6px;\n --toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);\n --toastify-font-family: sans-serif;\n --toastify-z-index: 9999;\n --toastify-text-color-light: #757575;\n --toastify-text-color-dark: #fff;\n\n /* Used only for colored theme */\n --toastify-text-color-info: #fff;\n --toastify-text-color-success: #fff;\n --toastify-text-color-warning: #fff;\n --toastify-text-color-error: #fff;\n\n --toastify-spinner-color: #616161;\n --toastify-spinner-color-empty-area: #e0e0e0;\n --toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);\n --toastify-color-progress-dark: #bb86fc;\n --toastify-color-progress-info: var(--toastify-color-info);\n --toastify-color-progress-success: var(--toastify-color-success);\n --toastify-color-progress-warning: var(--toastify-color-warning);\n --toastify-color-progress-error: var(--toastify-color-error);\n /* used to control the opacity of the progress trail */\n --toastify-color-progress-bgo: 0.2;\n}\n\n.Toastify__toast-container {\n z-index: var(--toastify-z-index);\n -webkit-transform: translate3d(0, 0, var(--toastify-z-index));\n position: fixed;\n width: var(--toastify-container-width);\n box-sizing: border-box;\n color: #fff;\n display: flex;\n flex-direction: column;\n}\n\n.Toastify__toast-container--top-left {\n top: var(--toastify-toast-top);\n left: var(--toastify-toast-left);\n}\n.Toastify__toast-container--top-center {\n top: var(--toastify-toast-top);\n left: 50%;\n transform: translateX(-50%);\n align-items: center;\n}\n.Toastify__toast-container--top-right {\n top: var(--toastify-toast-top);\n right: var(--toastify-toast-right);\n align-items: end;\n}\n.Toastify__toast-container--bottom-left {\n bottom: var(--toastify-toast-bottom);\n left: var(--toastify-toast-left);\n}\n.Toastify__toast-container--bottom-center {\n bottom: var(--toastify-toast-bottom);\n left: 50%;\n transform: translateX(-50%);\n align-items: center;\n}\n.Toastify__toast-container--bottom-right {\n bottom: var(--toastify-toast-bottom);\n right: var(--toastify-toast-right);\n align-items: end;\n}\n\n.Toastify__toast {\n --y: 0px;\n position: relative;\n touch-action: none;\n width: var(--toastify-toast-width);\n min-height: var(--toastify-toast-min-height);\n box-sizing: border-box;\n margin-bottom: 1rem;\n padding: var(--toastify-toast-padding);\n border-radius: var(--toastify-toast-bd-radius);\n box-shadow: var(--toastify-toast-shadow);\n max-height: var(--toastify-toast-max-height);\n font-family: var(--toastify-font-family);\n /* webkit only issue #791 */\n z-index: 0;\n /* inner swag */\n display: flex;\n flex: 1 auto;\n align-items: center;\n word-break: break-word;\n}\n\n@media only screen and (max-width: 480px) {\n .Toastify__toast-container {\n width: 100vw;\n left: env(safe-area-inset-left);\n margin: 0;\n }\n .Toastify__toast-container--top-left,\n .Toastify__toast-container--top-center,\n .Toastify__toast-container--top-right {\n top: env(safe-area-inset-top);\n transform: translateX(0);\n }\n .Toastify__toast-container--bottom-left,\n .Toastify__toast-container--bottom-center,\n .Toastify__toast-container--bottom-right {\n bottom: env(safe-area-inset-bottom);\n transform: translateX(0);\n }\n .Toastify__toast-container--rtl {\n right: env(safe-area-inset-right);\n left: initial;\n }\n .Toastify__toast {\n --toastify-toast-width: 100%;\n margin-bottom: 0;\n border-radius: 0;\n }\n}\n\n.Toastify__toast-container[data-stacked='true'] {\n width: var(--toastify-toast-width);\n}\n\n@media only screen and (max-width: 480px) {\n .Toastify__toast-container[data-stacked='true'] {\n width: 100vw;\n }\n}\n\n.Toastify__toast--stacked {\n position: absolute;\n width: 100%;\n transform: translate3d(0, var(--y), 0) scale(var(--s));\n transition: transform 0.3s;\n}\n\n.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,\n.Toastify__toast--stacked[data-collapsed] .Toastify__close-button {\n transition: opacity 0.1s;\n}\n\n.Toastify__toast--stacked[data-collapsed='false'] {\n overflow: visible;\n}\n\n.Toastify__toast--stacked[data-collapsed='true']:not(:last-child) > * {\n opacity: 0;\n}\n\n.Toastify__toast--stacked:after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n height: calc(var(--g) * 1px);\n bottom: 100%;\n}\n\n.Toastify__toast--stacked[data-pos='top'] {\n top: 0;\n}\n\n.Toastify__toast--stacked[data-pos='bot'] {\n bottom: 0;\n}\n\n.Toastify__toast--stacked[data-pos='bot'].Toastify__toast--stacked:before {\n transform-origin: top;\n}\n\n.Toastify__toast--stacked[data-pos='top'].Toastify__toast--stacked:before {\n transform-origin: bottom;\n}\n\n.Toastify__toast--stacked:before {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n transform: scaleY(3);\n z-index: -1;\n}\n\n.Toastify__toast--rtl {\n direction: rtl;\n}\n\n.Toastify__toast--close-on-click {\n cursor: pointer;\n}\n\n.Toastify__toast-icon {\n margin-inline-end: 10px;\n width: 22px;\n flex-shrink: 0;\n display: flex;\n}\n\n.Toastify--animate {\n animation-fill-mode: both;\n animation-duration: 0.5s;\n}\n\n.Toastify--animate-icon {\n animation-fill-mode: both;\n animation-duration: 0.3s;\n}\n\n.Toastify__toast-theme--dark {\n background: var(--toastify-color-dark);\n color: var(--toastify-text-color-dark);\n}\n\n.Toastify__toast-theme--light {\n background: var(--toastify-color-light);\n color: var(--toastify-text-color-light);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--default {\n background: var(--toastify-color-light);\n color: var(--toastify-text-color-light);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--info {\n color: var(--toastify-text-color-info);\n background: var(--toastify-color-info);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--success {\n color: var(--toastify-text-color-success);\n background: var(--toastify-color-success);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--warning {\n color: var(--toastify-text-color-warning);\n background: var(--toastify-color-warning);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--error {\n color: var(--toastify-text-color-error);\n background: var(--toastify-color-error);\n}\n\n.Toastify__progress-bar-theme--light {\n background: var(--toastify-color-progress-light);\n}\n\n.Toastify__progress-bar-theme--dark {\n background: var(--toastify-color-progress-dark);\n}\n\n.Toastify__progress-bar--info {\n background: var(--toastify-color-progress-info);\n}\n\n.Toastify__progress-bar--success {\n background: var(--toastify-color-progress-success);\n}\n\n.Toastify__progress-bar--warning {\n background: var(--toastify-color-progress-warning);\n}\n\n.Toastify__progress-bar--error {\n background: var(--toastify-color-progress-error);\n}\n\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error {\n background: var(--toastify-color-transparent);\n}\n\n.Toastify__close-button {\n color: #fff;\n position: absolute;\n top: 6px;\n right: 6px;\n background: transparent;\n outline: none;\n border: none;\n padding: 0;\n cursor: pointer;\n opacity: 0.7;\n transition: 0.3s ease;\n z-index: 1;\n}\n\n.Toastify__toast--rtl .Toastify__close-button {\n left: 6px;\n right: unset;\n}\n\n.Toastify__close-button--light {\n color: #000;\n opacity: 0.3;\n}\n\n.Toastify__close-button > svg {\n fill: currentColor;\n height: 16px;\n width: 14px;\n}\n\n.Toastify__close-button:hover,\n.Toastify__close-button:focus {\n opacity: 1;\n}\n\n@keyframes Toastify__trackProgress {\n 0% {\n transform: scaleX(1);\n }\n 100% {\n transform: scaleX(0);\n }\n}\n\n.Toastify__progress-bar {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n opacity: 0.7;\n transform-origin: left;\n}\n\n.Toastify__progress-bar--animated {\n animation: Toastify__trackProgress linear 1 forwards;\n}\n\n.Toastify__progress-bar--controlled {\n transition: transform 0.2s;\n}\n\n.Toastify__progress-bar--rtl {\n right: 0;\n left: initial;\n transform-origin: right;\n border-bottom-left-radius: initial;\n}\n\n.Toastify__progress-bar--wrp {\n position: absolute;\n overflow: hidden;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 5px;\n border-bottom-left-radius: var(--toastify-toast-bd-radius);\n border-bottom-right-radius: var(--toastify-toast-bd-radius);\n}\n\n.Toastify__progress-bar--wrp[data-hidden='true'] {\n opacity: 0;\n}\n\n.Toastify__progress-bar--bg {\n opacity: var(--toastify-color-progress-bgo);\n width: 100%;\n height: 100%;\n}\n\n.Toastify__spinner {\n width: 20px;\n height: 20px;\n box-sizing: border-box;\n border: 2px solid;\n border-radius: 100%;\n border-color: var(--toastify-spinner-color-empty-area);\n border-right-color: var(--toastify-spinner-color);\n animation: Toastify__spin 0.65s linear infinite;\n}\n\n@keyframes Toastify__bounceInRight {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n from {\n opacity: 0;\n transform: translate3d(3000px, 0, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(-25px, 0, 0);\n }\n 75% {\n transform: translate3d(10px, 0, 0);\n }\n 90% {\n transform: translate3d(-5px, 0, 0);\n }\n to {\n transform: none;\n }\n}\n\n@keyframes Toastify__bounceOutRight {\n 20% {\n opacity: 1;\n transform: translate3d(-20px, var(--y), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(2000px, var(--y), 0);\n }\n}\n\n@keyframes Toastify__bounceInLeft {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n 0% {\n opacity: 0;\n transform: translate3d(-3000px, 0, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(25px, 0, 0);\n }\n 75% {\n transform: translate3d(-10px, 0, 0);\n }\n 90% {\n transform: translate3d(5px, 0, 0);\n }\n to {\n transform: none;\n }\n}\n\n@keyframes Toastify__bounceOutLeft {\n 20% {\n opacity: 1;\n transform: translate3d(20px, var(--y), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(-2000px, var(--y), 0);\n }\n}\n\n@keyframes Toastify__bounceInUp {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n from {\n opacity: 0;\n transform: translate3d(0, 3000px, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(0, -20px, 0);\n }\n 75% {\n transform: translate3d(0, 10px, 0);\n }\n 90% {\n transform: translate3d(0, -5px, 0);\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n\n@keyframes Toastify__bounceOutUp {\n 20% {\n transform: translate3d(0, calc(var(--y) - 10px), 0);\n }\n 40%,\n 45% {\n opacity: 1;\n transform: translate3d(0, calc(var(--y) + 20px), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(0, -2000px, 0);\n }\n}\n\n@keyframes Toastify__bounceInDown {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n 0% {\n opacity: 0;\n transform: translate3d(0, -3000px, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(0, 25px, 0);\n }\n 75% {\n transform: translate3d(0, -10px, 0);\n }\n 90% {\n transform: translate3d(0, 5px, 0);\n }\n to {\n transform: none;\n }\n}\n\n@keyframes Toastify__bounceOutDown {\n 20% {\n transform: translate3d(0, calc(var(--y) - 10px), 0);\n }\n 40%,\n 45% {\n opacity: 1;\n transform: translate3d(0, calc(var(--y) + 20px), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(0, 2000px, 0);\n }\n}\n\n.Toastify__bounce-enter--top-left,\n.Toastify__bounce-enter--bottom-left {\n animation-name: Toastify__bounceInLeft;\n}\n\n.Toastify__bounce-enter--top-right,\n.Toastify__bounce-enter--bottom-right {\n animation-name: Toastify__bounceInRight;\n}\n\n.Toastify__bounce-enter--top-center {\n animation-name: Toastify__bounceInDown;\n}\n\n.Toastify__bounce-enter--bottom-center {\n animation-name: Toastify__bounceInUp;\n}\n\n.Toastify__bounce-exit--top-left,\n.Toastify__bounce-exit--bottom-left {\n animation-name: Toastify__bounceOutLeft;\n}\n\n.Toastify__bounce-exit--top-right,\n.Toastify__bounce-exit--bottom-right {\n animation-name: Toastify__bounceOutRight;\n}\n\n.Toastify__bounce-exit--top-center {\n animation-name: Toastify__bounceOutUp;\n}\n\n.Toastify__bounce-exit--bottom-center {\n animation-name: Toastify__bounceOutDown;\n}\n\n@keyframes Toastify__zoomIn {\n from {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n 50% {\n opacity: 1;\n }\n}\n\n@keyframes Toastify__zoomOut {\n from {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n transform: translate3d(0, var(--y), 0) scale3d(0.3, 0.3, 0.3);\n }\n to {\n opacity: 0;\n }\n}\n\n.Toastify__zoom-enter {\n animation-name: Toastify__zoomIn;\n}\n\n.Toastify__zoom-exit {\n animation-name: Toastify__zoomOut;\n}\n\n@keyframes Toastify__flipIn {\n from {\n transform: perspective(400px) rotate3d(1, 0, 0, 90deg);\n animation-timing-function: ease-in;\n opacity: 0;\n }\n 40% {\n transform: perspective(400px) rotate3d(1, 0, 0, -20deg);\n animation-timing-function: ease-in;\n }\n 60% {\n transform: perspective(400px) rotate3d(1, 0, 0, 10deg);\n opacity: 1;\n }\n 80% {\n transform: perspective(400px) rotate3d(1, 0, 0, -5deg);\n }\n to {\n transform: perspective(400px);\n }\n}\n\n@keyframes Toastify__flipOut {\n from {\n transform: translate3d(0, var(--y), 0) perspective(400px);\n }\n 30% {\n transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, -20deg);\n opacity: 1;\n }\n to {\n transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, 90deg);\n opacity: 0;\n }\n}\n\n.Toastify__flip-enter {\n animation-name: Toastify__flipIn;\n}\n\n.Toastify__flip-exit {\n animation-name: Toastify__flipOut;\n}\n\n@keyframes Toastify__slideInRight {\n from {\n transform: translate3d(110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideInLeft {\n from {\n transform: translate3d(-110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideInUp {\n from {\n transform: translate3d(0, 110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideInDown {\n from {\n transform: translate3d(0, -110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideOutRight {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(110%, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideOutLeft {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(-110%, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideOutDown {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, 500px, 0);\n }\n}\n\n@keyframes Toastify__slideOutUp {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, -500px, 0);\n }\n}\n\n.Toastify__slide-enter--top-left,\n.Toastify__slide-enter--bottom-left {\n animation-name: Toastify__slideInLeft;\n}\n\n.Toastify__slide-enter--top-right,\n.Toastify__slide-enter--bottom-right {\n animation-name: Toastify__slideInRight;\n}\n\n.Toastify__slide-enter--top-center {\n animation-name: Toastify__slideInDown;\n}\n\n.Toastify__slide-enter--bottom-center {\n animation-name: Toastify__slideInUp;\n}\n\n.Toastify__slide-exit--top-left,\n.Toastify__slide-exit--bottom-left {\n animation-name: Toastify__slideOutLeft;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n.Toastify__slide-exit--top-right,\n.Toastify__slide-exit--bottom-right {\n animation-name: Toastify__slideOutRight;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n.Toastify__slide-exit--top-center {\n animation-name: Toastify__slideOutUp;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n.Toastify__slide-exit--bottom-center {\n animation-name: Toastify__slideOutDown;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n@keyframes Toastify__spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n",e.nonce),re.createElement(yI,{...e})}var xI=({children:e,classNameToast:t="",classNameContainer:n="",isFixed:r=!0,containerId:i})=>{let a=ve(()=>i??crypto.randomUUID(),[i]),o=he(async(e,n={})=>{let{appeareance:r="default",placement:i="top-right",autoDismiss:o=!0,autoDismissTimeout:s=5e3,theme:l="light",icon:c}=n,u=cI;r&&"default"!==r&&cI[r]&&(u=cI[r]),u(e,{className:t,position:i,autoClose:!!o&&s,hideProgressBar:!o,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:l,icon:c,containerId:a})},[t,a]),s=ve(()=>({addToast:o}),[o]);/* @__PURE__ */
|
|
287
287
|
return Ie(LE,{value:s,children:[/* @__PURE__ */Ee(vI,{containerId:a,pauseOnFocusLoss:!1,className:vt(n,{"toast-container--absolute":!r})}),e]})},kI={source:"space",title:"Add Notification",strictParams:!0,params:{content:{type:"textarea",description:"The notification text shown to the user — this is the message body. There is no separate title/message/type param.",default:"Content"},placement:{type:"select",description:"Where the toast appears on screen.",default:"top-right",options:["top-right","top-center","top-left","bottom-right","bottom-center","bottom-left"]},appeareance:{type:"select",description:'Visual style of the notification. NOTE: the key is spelled "appeareance".',default:"success",options:["success","danger","warning","info"]},autoDismiss:{type:"boolean",description:"Whether the notification dismisses itself after a timeout.",default:!0,canBind:!1},autoDismissTimeout:{type:"number",description:"Milliseconds before auto-dismiss. Only applies when autoDismiss is true.",default:5e3,when:e=>!0===e.autoDismiss}}},wI=({children:e})=>{const{addToast:t}=(()=>{let e=pe(LE);if(void 0===e)throw Error("ToastContext value is undefined. Make sure you use the ToastProvider before using the hook.");return e})(),{useInteractions:n}=pe(zE),r=he(e=>{const{placement:n,appeareance:r,autoDismiss:i,autoDismissTimeout:a}=e;let{content:o}=e;"string"!=typeof o&&(o=JSON.stringify(o)),t(/* @__PURE__ */Ee("div",{className:"whitespace-break-spaces",children:o}),{appeareance:r,autoDismiss:i,placement:n,autoDismissTimeout:a})},[t]);return n({id:"space",callbacks:ve(()=>({addNotification:Zh("addNotification",kI,r)}),[r])}),/* @__PURE__ */Ee(Ce,{children:e})},SI=({children:e})=>{const{webId:t}=pe(lh);/* @__PURE__ */
|
|
288
|
-
return Ee(xI,{containerId:`toast-container-${t}`,classNameContainer:"plitzi-sdk-toasts",children:/* @__PURE__ */Ee(wI,{children:e})})},NI=({pageId:e=""})=>/* @__PURE__ */Ee("a",{className:"made-in-plitzi",href:"https://plitzi.com","data-page-id":e,rel:"noreferrer noopener",target:"_blank",children:"Made in Plitzi"}),TI=()=>{const{overQuota:e}=Pe();return e?/* @__PURE__ */Ie("div",{className:"plitzi-over-quota",role:"status",children:[/* @__PURE__ */Ee("span",{className:"plitzi-over-quota__text",children:"This site is over its monthly plan limit."}),/* @__PURE__ */Ee("a",{className:"plitzi-over-quota__cta",href:"https://plitzi.com/pricing",rel:"noreferrer noopener",target:"_blank",children:"Upgrade"})]}):null},CI=de(({pageId:e="",style:t="",branding:n=!0,plitziContextValue:r,assets:i=
|
|
288
|
+
return Ee(xI,{containerId:`toast-container-${t}`,classNameContainer:"plitzi-sdk-toasts",children:/* @__PURE__ */Ee(wI,{children:e})})},NI=({pageId:e=""})=>/* @__PURE__ */Ee("a",{className:"made-in-plitzi",href:"https://plitzi.com","data-page-id":e,rel:"noreferrer noopener",target:"_blank",children:"Made in Plitzi"}),TI=()=>{const{overQuota:e}=Pe();return e?/* @__PURE__ */Ie("div",{className:"plitzi-over-quota",role:"status",children:[/* @__PURE__ */Ee("span",{className:"plitzi-over-quota__text",children:"This site is over its monthly plan limit."}),/* @__PURE__ */Ee("a",{className:"plitzi-over-quota__cta",href:"https://plitzi.com/pricing",rel:"noreferrer noopener",target:"_blank",children:"Upgrade"})]}):null},CI=de(({pageId:e="",style:t="",branding:n=!0,plitziContextValue:r,assets:i=Y,ref:a})=>{const o=ve(()=>({id:e,rootId:e}),[e]);/* @__PURE__ */
|
|
289
289
|
return Ee(ME,{ref:a,id:"i-sdk",css:t,assets:i,className:"w-full grow",children:/* @__PURE__ */Ie(SI,{children:[
|
|
290
290
|
/* @__PURE__ */Ee(A,{value:r,children:e&&/* @__PURE__ */Ee(XS,{internalProps:o})}),n&&/* @__PURE__ */Ee(NI,{pageId:e}),
|
|
291
|
-
/* @__PURE__ */Ee(TI,{})]})})}),EI=de(({pageId:e="",style:t="",branding:n=!0,plitziContextValue:r,renderMode:i="raw"})=>{const a=ve(()=>({id:e,rootId:e}),[e]),[o]=F("schema.flat"),
|
|
291
|
+
/* @__PURE__ */Ee(TI,{})]})})}),EI=de(({pageId:e="",style:t="",branding:n=!0,plitziContextValue:r,renderMode:i="raw"})=>{const a=ve(()=>({id:e,rootId:e}),[e]),[o]=F("schema.flat"),l=ve(()=>e&&"widget"===i?s(o,`${e}.definition.type`,"page"):"page",[e,i,o]);/* @__PURE__ */
|
|
292
292
|
return Ie(SI,{children:[
|
|
293
293
|
/* @__PURE__ */Ee("style",{type:"text/css",rel:"stylesheet","data-id":"plitzi-runtime-style",children:t}),
|
|
294
|
-
/* @__PURE__ */Ie(A,{value:r,children:[e&&"widget"!==i&&/* @__PURE__ */Ee(XS,{internalProps:a}),e&&"widget"===i&&/* @__PURE__ */Ee(wf,{type:
|
|
294
|
+
/* @__PURE__ */Ie(A,{value:r,children:[e&&"widget"!==i&&/* @__PURE__ */Ee(XS,{internalProps:a}),e&&"widget"===i&&/* @__PURE__ */Ee(wf,{type:l,internalProps:a},e)]}),n&&/* @__PURE__ */Ee(NI,{pageId:e}),
|
|
295
295
|
/* @__PURE__ */Ee(TI,{})]})}),II=({children:e,contentDidMount:t,contentDidDismount:n})=>(me(()=>(t?.(),()=>{n?.()}),[]),e),OI=se({shadowRoot:null});OI.displayName="ContainerShadowContext";var zI=({href:e,onLoad:t,onError:n,onRegister:r,onUnregister:i,...a})=>{let[o,s]=we(!1),l=ke(null);return me(()=>(r?.(l),s(!0),()=>{i?.(l)}),[]),/* @__PURE__ */Ee("link",o?{ref:l,href:e,onLoad:t,onError:n,rel:"stylesheet",...a}:{ref:l,rel:"stylesheet",...a})},AI=({children:e,...t})=>{let n=ke(null);/* @__PURE__ */
|
|
296
296
|
return Ee("style",{ref:n,...t,children:e})},_I=({ref:e,className:t="",children:n,mode:r="open",delegatesFocus:i=!1,stylesheets:a,fallback:o})=>{let s=ke(null);ye(e,()=>s.current,[s]);let[l,c]=we(null),[u,d]=we(!1),p=e=>{k(t=>{if(!e.current)return t;let n=[...t.pending,e.current];return{isLoading:n.length>0,pending:n}})},h=e=>{k(t=>{let n=t.pending.filter(t=>t!==e.current);return{isLoading:n.length>0,pending:n}})},f=e=>{k(t=>{let n=t.pending.filter(t=>t!==e.target);return{isLoading:n.length>0,pending:n}})},m=e=>{k(t=>{let n=t.pending.filter(t=>t!==e.target);return{isLoading:n.length>0,pending:n}})},g=()=>{},{content:y,links:b,styles:v}=ve(()=>{let e={content:/* @__PURE__ */Ee(II,{},"shadow-content"),links:[],styles:[]};return ie.forEach(n,(t,n)=>{ue(t)&&(t.type===II?e.content=oe(t,{...t.props,key:"shadow-content",contentDidMount:g}):t.type===zI?e.links.push(oe(t,{...t.props,key:n,onRegister:p,onUnregister:h,onLoad:f,onError:m})):t.type===AI&&(e.content=oe(t,{...t.props,key:n})))}),e},[n]),[x,k]=we({isLoading:0!==b.length,pending:[]});me(()=>{if(s.current){let e=s.current.attachShadow({mode:r,delegatesFocus:i});a&&(e.adoptedStyleSheets=a),c(e),d(!0)}},[]);let w=ve(()=>({shadowRoot:l}),[l]),{isLoading:S}=x;/* @__PURE__ */
|
|
297
297
|
return Ee("div",{ref:s,className:t,children:u&&l&&Oe(/* @__PURE__ */Ie(OI,{value:w,children:[b,v,!S&&y,S&&o]}),l)})};_I.Content=II,_I.Link=zI,_I.Style=AI;var DI=_I,PI=de(({pageId:e="",sdkStylePath:t="",style:n="",branding:r=!0,plitziContextValue:i,assets:a})=>{const o=ve(()=>({id:e,rootId:e}),[e]),s=ve(()=>Object.values(a),[a]);/* @__PURE__ */
|
|
@@ -300,9 +300,9 @@ return Ie(DI,{children:[s.map((e,t)=>/* @__PURE__ */Ee(DI.Link,{href:e.params.hr
|
|
|
300
300
|
/* @__PURE__ */Ee(DI.Content,{children:/* @__PURE__ */Ie(SI,{children:[
|
|
301
301
|
/* @__PURE__ */Ee("style",{dangerouslySetInnerHTML:{__html:n}}),
|
|
302
302
|
/* @__PURE__ */Ee(A,{value:i,children:e&&/* @__PURE__ */Ee(XS,{internalProps:o})}),r&&/* @__PURE__ */Ee(NI,{pageId:e}),
|
|
303
|
-
/* @__PURE__ */Ee(TI,{})]})})]})}),RI=e=>{},MI=({head:e})=>((e=>{me(()=>{if(typeof document>"u")return;let{head:t}=document,n=[];if(e.preconnect.forEach(e=>{if(t.querySelector(`link[rel="preconnect"][href="${CSS.escape(e.href)}"]`))return;let r=document.createElement("link");r.rel="preconnect",r.href=e.href,e.crossorigin&&(r.crossOrigin=""),t.appendChild(r),n.push(r)}),e.links.forEach(e=>{if(t.querySelector(`link[rel="${e.rel}"][href="${CSS.escape(e.href)}"]`))return;let r=document.createElement("link");r.rel=e.rel,r.href=e.href,e.as&&(r.as=e.as),e.type&&(r.type=e.type),e.crossorigin&&(r.crossOrigin=""),t.appendChild(r),n.push(r)}),e.faces&&!t.querySelector(`style[${Kp}]`)){let r=document.createElement("style");r.setAttribute(Kp,""),r.textContent=e.faces,t.appendChild(r),n.push(r)}return()=>n.forEach(e=>e.remove())},[e])})(e),null),LI=[],jI=({externalStyle:e="",branding:t=!0,sdkStylePath:n="./plitzi-sdk.css",server:r})=>{const{resolvedTheme:i}=Ch(),{assets:a}=pe(TE),o=ke(null),{rootRef:s}=pe(IE),[[l,u,d,p,h=
|
|
304
|
-
return Ie(Ce,{children:["iframe"!==m&&/* @__PURE__ */Ee(MI,{head:
|
|
305
|
-
return Ee(ph,{value:l,children:e})},BI=e=>{let[t,n]=e.split("."),r=Number(t);if(!Number.isFinite(r)||r<=0)return;let i=Number(n);return{expiresAt:r,refreshExpiresAt:Number.isFinite(i)&&i>0?i:void 0}},UI=e=>{if(e&&!(typeof document>"u"))for(let t of document.cookie.split(";")){let n=t.indexOf("=");if(-1!==n&&t.slice(0,n).trim()===e)return BI(decodeURIComponent(t.slice(n+1).trim()))}},HI=class{kind;key;constructor(e,t){this.kind=e,this.key=t}get area(){try{if("localStorage"===this.kind&&typeof localStorage<"u")return localStorage;if("sessionStorage"===this.kind&&typeof sessionStorage<"u")return sessionStorage}catch{}}read(){let e=this.area?.getItem(this.key);if(e)try{let t=JSON.parse(e);return(e=>"object"==typeof e&&!!e&&1===e.version)(t)?t:void 0}catch{return}}write(e){try{this.area?.setItem(this.key,JSON.stringify({version:1,...e}))}catch{}}clear(){try{this.area?.removeItem(this.key)}catch{}}subscribe(e){if("localStorage"!==this.kind||typeof window>"u")return()=>{};let t=t=>{(null===t.key||t.key===this.key)&&e(this.read())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}},WI=e=>{if(!e)return;let t=e.split(".");if(3!==t.length)return;let n=(e=>{try{let t=e.replaceAll("-","+").replaceAll("_","/"),n=t.padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return"object"==typeof r&&r?r:void 0}catch{return}})(t[1])?.exp;return"number"==typeof n&&Number.isFinite(n)?n:void 0},GI=()=>Math.floor(Date.now()/1e3),JI=e=>{if("number"==typeof e&&Number.isFinite(e)&&!(e<=0))return Math.floor(e>1e11?e/1e3:e)},KI=class{state="init";session={validatedAt:0};store;gate;hintCookie;revalidateSeconds;listeners=/* @__PURE__ */new Set;renewal;renewalTimer;detachListeners;offline=!1;spaceKey;constructor({spaceKey:e="",tokenStorage:t="localStorage",sessionHintCookie:n,sessionGate:r="optimistic",sessionRevalidateSeconds:i=300,storageKey:a="plitzi_auth_session"}={}){this.spaceKey=e,this.store=new HI(t,a),this.gate=r,this.hintCookie=n,this.revalidateSeconds=i}get endpoints(){return[]}requestExchange(){return Promise.resolve(void 0)}consumeRedirect(){return Promise.resolve(void 0)}get user(){return this.session.user}get token(){return this.session.token}getState(){return this.state}can(e){let t=this.session.user?.permissions;return Array.isArray(t)&&t.includes(e)}peekState(){return this.peek().state}peek(){let e=this.store.read(),t=UI(this.hintCookie);if(this.hintCookie&&!t)return{state:"guest"};let n=e?.token,r=JI(n?.expiresAt)??WI(n?.accessToken);return n?.accessToken&&(void 0===r||r-60>GI())&&e?.user?{state:"authenticated",user:e.user,token:e.token}:n?.accessToken||n?.refreshToken||t?{state:"init",user:e?.user,token:e?.token}:{state:"guest"}}async init(e={}){this.attach(),await this.decide(e),this.settle()}settle(){("init"===this.state||"initLoading"===this.state)&&this.setState(this.session.user||this.hasLiveToken()?"authenticated":"guest","settled")}async decide(e){if(e.skipAuth)return void this.setState("guest","skip-auth");let t=await this.consumeRedirect();if(t)return void(t.ok?(this.adopt(t),await this.handOffToServer(),this.emit({type:"login",token:this.session.token})):this.endSession(t.reason));if(e.user)return void this.adopt({ok:!0,user:e.user,token:e.accessToken?{accessToken:e.accessToken,expiresAt:e.expiresAt??null,refreshToken:null}:this.session.token},!0,"bootstrap");let n=this.store.read(),r=UI(this.hintCookie);if(this.session={user:n?.user,token:n?.token,validatedAt:n?.validatedAt??0},!this.hintCookie||r){if(this.hasLiveToken()&&this.session.user){this.setState("authenticated","restored"),this.scheduleRenewal();let e=this.isFresh()&&"strict"!==this.gate?void 0:this.revalidate(!0);return void("strict"===this.gate&&await e)}this.hasEvidence()?(this.setState("initLoading","no-evidence"),this.hasLiveToken()&&this.capabilities.identity?await this.loadIdentity():this.capabilities.renew?await this.renew():this.capabilities.identity?await this.loadIdentity():this.endSession()):this.endSession(void 0,"no-evidence")}else this.endSession(void 0,"hint-missing")}dispose(){clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.detachListeners?.(),this.detachListeners=void 0}async login(e){this.setState("authenticating","authenticating");let t=await this.requestLogin(e);if(!t.ok)return this.endSession(t.reason),{ok:!1,reason:t.reason};this.adopt(t);let n=await this.handOffToServer();return n?{ok:!1,reason:n}:(!this.session.user&&this.capabilities.identity&&await this.loadIdentity(),"authenticated"===this.state?(this.emit({type:"login",token:this.session.token}),{ok:!0,...this.session.token??{accessToken:"",expiresAt:null,refreshToken:null}}):{ok:!1,reason:"inactive"})}async handOffToServer(){let e=await this.requestExchange();if(e)return e.ok?void this.adopt(e):"network"===e.reason?void(this.offline=!0):(this.endSession(e.reason),e.reason)}async refresh(){return await this.renew(),this.session.token}async revalidate(e=!1){return this.hasEvidence()?!e&&this.isFresh()&&this.hasLiveToken()?"authenticated"===this.state:this.hasLiveToken()&&this.capabilities.identity?this.loadIdentity():this.capabilities.renew?this.renew():this.capabilities.identity?this.loadIdentity():(this.hasLiveToken()||this.endSession("expired"),"authenticated"===this.state):("guest"!==this.state&&this.endSession(),!1)}invalidate(e="expired"){"network"!==e?"expired"===e&&this.capabilities.renew?this.renew():this.endSession(e):this.offline=!0}async logout(){await this.requestLogout(),this.endSession(),this.emit({type:"logout"})}on(e){let t=Array.isArray(e)?e:[e];return t.forEach(e=>this.listeners.add(e)),()=>t.forEach(e=>this.listeners.delete(e))}emit(e){for(let t of this.listeners)t(e)}setState(e,t){this.state!==e&&(this.state=e,this.emit({type:"state",state:e,reason:t}))}async renew(){return this.renewal??=this.performRenewal().finally(()=>{this.renewal=void 0}),this.renewal}async performRenewal(){let e=await this.requestRenewal(this.session.token?.refreshToken??void 0);return e.ok?(this.adopt(e),!this.session.user&&this.capabilities.identity?this.loadIdentity():"authenticated"===this.state):(this.handleFailure(e.reason),!1)}async loadIdentity(){let e=await this.requestIdentity();return e.ok?(this.adopt(e),"authenticated"===this.state):"expired"===e.reason&&this.capabilities.renew&&!this.renewal?this.renew():(this.handleFailure(e.reason),!1)}handleFailure(e){"network"!==e?this.endSession(e):this.offline=!0}adopt(e,t=!0,n="granted"){this.session={user:e.user??this.session.user,token:e.token??this.session.token,validatedAt:GI()},this.offline=!1,t&&this.store.write(this.session),this.scheduleRenewal(),this.setState(this.session.user||this.hasLiveToken()?"authenticated":"guest",n)}endSession(e,t="signed-out"){clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.session={validatedAt:GI()},this.store.write(this.session),this.setState("guest",t),e&&this.emit({type:"expired",reason:e})}expiresAt(){return JI(this.session.token?.expiresAt)??WI(this.session.token?.accessToken)}hasLiveToken(){if(!this.session.token?.accessToken)return!1;let e=this.expiresAt();return void 0===e||e-60>GI()}isFresh(){return GI()-this.session.validatedAt<this.revalidateSeconds}hasEvidence(){if(this.session.token?.accessToken||this.session.token?.refreshToken)return!0;let e=UI(this.hintCookie);return!(void 0!==e?.refreshExpiresAt&&e.refreshExpiresAt<=GI()||!e)}scheduleRenewal(){clearTimeout(this.renewalTimer),this.renewalTimer=void 0;let e=this.expiresAt();if(void 0===e||typeof window>"u"||"guest"===this.state)return;let t=Math.min(1e3*(e-60-GI()),2147483647);t<=0?this.onRenewalDue():this.renewalTimer=setTimeout(()=>this.onRenewalDue(),t)}onRenewalDue(){this.capabilities.renew?this.renew():this.endSession("expired")}attach(){if(typeof window>"u"||this.detachListeners)return;let e=()=>{"visible"===document.visibilityState&&this.revalidate()},t=()=>{this.offline&&this.revalidate(!0)},n=this.store.subscribe(e=>this.adoptFromStorage(e)),r=(e=>(Tt.add(e),()=>Tt.delete(e)))(({reason:e,url:t})=>{let n=this.endpoints.filter(Boolean);(0===n.length||n.some(e=>((e,t)=>{if(!e||!t)return!1;try{let n=typeof window>"u"?void 0:window.location.href;return Ot(new URL(e,n).hostname)===Ot(new URL(t,n).hostname)}catch{return!1}})(e,t)))&&this.invalidate(e)});document.addEventListener("visibilitychange",e),window.addEventListener("online",t),this.detachListeners=()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("online",t),n(),r()}}adoptFromStorage(e){if(!e?.token&&!e?.user)return clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.session={validatedAt:GI()},this.setState("guest","another-tab"),void this.emit({type:"logout"});this.adopt({ok:!0,user:e.user,token:e.token},!1)}},QI=(e,t)=>$(e,t,void 0),YI=(e,t)=>{let n=QI(e,t);return"string"==typeof n&&""!==n?n:null},XI=(e,t)=>{let n=QI(e,t),r="string"==typeof n?Number(n):n;return"number"==typeof r&&Number.isFinite(r)?r:null},ZI=e=>"string"==typeof e?e:"number"==typeof e&&Number.isFinite(e)?String(e):"",eO=class extends KI{name="basic";options;constructor({loginUrl:e="",userUrl:t="",refreshUrl:n="",logoutUrl:r="",sessionExchangeUrl:i="",detailsPath:a="details",tokenPath:o="access_token",refreshTokenPath:s="refresh_token",expirationTimePath:l="expire_at",refreshExpirationTimePath:c="refresh_expire_at",...u}={}){super(u),this.options={loginUrl:e,userUrl:t,refreshUrl:n,logoutUrl:r,sessionExchangeUrl:i,detailsPath:a,tokenPath:o,refreshTokenPath:s,expirationTimePath:l,refreshExpirationTimePath:c}}get capabilities(){return{renew:!!this.options.refreshUrl,identity:!!this.options.userUrl}}get endpoints(){let{loginUrl:e,userUrl:t,refreshUrl:n,logoutUrl:r}=this.options;return[e,t,n,r]}async requestLogin(e){let t=ZI(e.token).trim();if("token"===e.mode)return t?this.adoptToken(t):{ok:!1,reason:"missing"};if(!this.options.loginUrl)return{ok:!1,reason:"missing"};let n=await this.request(this.options.loginUrl,{method:"POST",body:JSON.stringify({username:ZI(e.username),password:ZI(e.password)})});return this.toResult(n)}async adoptToken(e){if(!this.options.userUrl)return{ok:!1,reason:"missing"};let t=await this.request(this.options.userUrl,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}),n=this.toResult(t);return n.ok?{ok:!0,user:n.user,token:{accessToken:e,expiresAt:null,refreshToken:null}}:n}async requestRenewal(e){if(!this.options.refreshUrl)return{ok:!1,reason:"missing"};let t=await this.request(this.options.refreshUrl,{method:"POST",body:JSON.stringify(e?{[this.options.refreshTokenPath]:e}:{})});return this.toResult(t)}async requestExchange(){let e=this.token?.accessToken;if(!this.options.sessionExchangeUrl||!e)return;let t=await this.request(this.options.sessionExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",...this.spaceKey?{"x-access-token":this.spaceKey}:{}},body:JSON.stringify({provider:this.name,token:e})});return this.toResult(t)}async requestIdentity(){if(!this.options.userUrl)return{ok:!1,reason:"missing"};let e=await this.request(this.options.userUrl,{method:"GET"});return this.toResult(e)}async requestLogout(){this.options.logoutUrl&&await this.request(this.options.logoutUrl,{method:"POST"})}async request(e,t){let n,r;try{n=await fetch(e,{credentials:"include",headers:{"Content-Type":"application/json"},...t})}catch{return{status:0,reason:"network"}}try{r=await n.json()}catch{r=void 0}return{data:r,status:n.status,reason:n.ok?void 0:It(n.status,r)??"network"}}toResult(e){if(e.reason)return{ok:!1,reason:e.reason};let t=QI(e.data,this.options.detailsPath);return{ok:!0,user:"object"==typeof t&&t?t:void 0,token:this.tokenFrom(e.data)}}tokenFrom(e){let t=YI(e,this.options.tokenPath);if(!t)return;let n=QI(e,"errors");return{..."object"==typeof n&&n?{errors:n}:{},accessToken:t,expiresAt:XI(e,this.options.expirationTimePath),refreshToken:YI(e,this.options.refreshTokenPath),refreshExpiresAt:XI(e,this.options.refreshExpirationTimePath)}}},tO=/* @__PURE__ */new Map([["basic",e=>new eO(e)]]),nO=class{providerType;provider;settings;listeners;constructor(e,t,n){this.providerType=e,this.settings=n,this.listeners=Array.isArray(t)?t:[t];let r=tO.get(e);r&&(this.provider=r(n),this.provider.on(this.listeners))}getProviderType(){return this.providerType}getProvider(){return this.provider}getState(){return this.provider?.getState()??"guest"}peekState(){return this.peek().state}peek(){return(this.provider??new eO(this.settings)).peek()}can(e){return this.provider?.can(e)??!1}init(e){if(!this.provider){let t=this.peekState(),n=e?.user||"authenticated"===t?"authenticated":"guest";return this.listeners.forEach(e=>e({type:"state",state:n,reason:"no-provider"})),Promise.resolve()}return this.provider.init(e)}login(...e){return this.provider?.login(...e)??Promise.resolve({ok:!1,reason:"missing"})}refresh(){return this.provider?.refresh()??Promise.resolve(void 0)}revalidate(e){return this.provider?.revalidate(e)??Promise.resolve(!1)}invalidate(e){this.provider?.invalidate(e)}logout(){return this.provider?.logout()??Promise.resolve()}dispose(){this.provider?.dispose()}on(e){return this.provider?.on(e)}},rO=["loginUrl","userUrl","refreshUrl","logoutUrl","detailsPath","tokenPath","refreshTokenPath","expirationTimePath","refreshExpirationTimePath","sessionHintCookie","sessionExchangeUrl"],iO=({children:e,server:t})=>{let{previewMode:n,isHydrating:r,environment:i}=Pe(),{webKey:a}=pe(lh),[[o,s]]=c(["schema.settings","schema.variables"]),{queryParams:l,hostname:u}=vE({server:t}),d=ve(()=>({queryParams:l,hostname:u,environment:i}),[l,u,i]),p=ve(()=>Array.isArray(s)?s.reduce((e,t)=>{let{name:n,value:r,subValues:i}=t;if(!Array.isArray(i)||0===i.length)return{...e,[n]:r};let a=i.find(e=>V(e.when,d));return a?{...e,[n]:a.value}:{...e,[n]:r}},{}):{},[s,d]),h=ve(()=>{let e=Object.fromEntries(rO.map(e=>[e,o[e]]));try{return JSON.parse(q(JSON.stringify(e),p))}catch{return e}},[o,p]),f=ve(()=>({...h,spaceKey:a,tokenStorage:o.tokenStorage??"localStorage",sessionGate:o.sessionGate,sessionRevalidateSeconds:o.sessionRevalidateSeconds}),[h,o,a]),{manager:m,loading:g,authenticated:y,state:b,bootstrapUser:v,bootstrapToken:x,peekedUser:k,peekedToken:w}=(({server:e,isHydrating:t=!1,provider:n="",settings:r})=>{let i=e?.authenticated?e.user?.details:void 0,a="string"==typeof e?.user?.accessToken?e.user.accessToken:void 0,[o,s]=we("init"),l=he(e=>{"state"===e.type&&s(e.state)},[]),c=ve(()=>new nO(n,l,r),[n,l,r]),u=ve(()=>t||i?void 0:c.peek(),[c,t,i]),d="init"!==o&&"initLoading"!==o||!!i||t||"authenticated"===u?.state||"guest"===u?.state;return me(()=>(c.init({user:i,accessToken:a,expiresAt:e?.user?.expiresAt,skipAuth:e?.skipAuth}),()=>c.dispose()),[c,i,a,e?.user?.expiresAt,e?.skipAuth]),ve(()=>({manager:c,state:o,bootstrapUser:i,bootstrapToken:a,peekedUser:u?.user,peekedToken:u?.token?.accessToken,loading:"initLoading"===o||!d,authenticated:"authenticated"===o||"init"===o&&(!!i||"authenticated"===u?.state)}),[c,o,i,a,d,u])})({server:t,isHydrating:r,provider:o.userProvider??"",settings:f}),S=m.getProvider()?.user,N=S??v??k,T=S?m.getProvider()?.token?.accessToken:v?x:w,C=ke(void 0),E=ve(()=>{let e=N?{details:N,accessToken:T}:void 0,t=C.current;return t?.accessToken===e?.accessToken&&((e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=e,r=t;return[.../* @__PURE__ */new Set([...Object.keys(n),...Object.keys(r)])].every(e=>JSON.stringify(n[e])===JSON.stringify(r[e]))})(t?.details,e?.details)||(C.current=e),C.current},[N,T]),I=ve(()=>({login:m.login.bind(m),refresh:m.refresh.bind(m),revalidate:m.revalidate.bind(m),invalidate:m.invalidate.bind(m),can:m.can.bind(m),logout:m.logout.bind(m),state:b,authenticated:y||!n,user:E}),[m,b,y,n,E]);/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */Ee(TI,{})]})})]})}),RI=e=>{},MI=({head:e})=>((e=>{me(()=>{if(typeof document>"u")return;let{head:t}=document,n=[];if(e.preconnect.forEach(e=>{if(t.querySelector(`link[rel="preconnect"][href="${CSS.escape(e.href)}"]`))return;let r=document.createElement("link");r.rel="preconnect",r.href=e.href,e.crossorigin&&(r.crossOrigin=""),t.appendChild(r),n.push(r)}),e.links.forEach(e=>{if(t.querySelector(`link[rel="${e.rel}"][href="${CSS.escape(e.href)}"]`))return;let r=document.createElement("link");r.rel=e.rel,r.href=e.href,e.as&&(r.as=e.as),e.type&&(r.type=e.type),e.crossorigin&&(r.crossOrigin=""),t.appendChild(r),n.push(r)}),e.faces&&!t.querySelector(`style[${Kp}]`)){let r=document.createElement("style");r.setAttribute(Kp,""),r.textContent=e.faces,t.appendChild(r),n.push(r)}return()=>n.forEach(e=>e.remove())},[e])})(e),null),LI=[],jI=({externalStyle:e="",branding:t=!0,sdkStylePath:n="./plitzi-sdk.css",server:r})=>{const{resolvedTheme:i}=Ch(),{assets:a}=pe(TE),o=ke(null),{rootRef:s}=pe(IE),[[l,u,d,p,h=Y,f=LI]]=F(["schema.settings","style.cache","segments","navigation.currentPageId","runtime.sources.variables","style.fonts"]),{renderMode:m,previewMode:g,debugMode:y,environment:b,isHydrating:x,overQuota:S}=Pe(),N=t||S;(e=>{let t=k(),[n]=c("schema.rsc",{mode:"mount"}),[r]=c("runtime.sources.navigation"),{rscData:i,rscPath:a}=e??{},o=(n?.enabled??!1)&&!!a;v(["rsc.enabled","rsc.endpoint"],[o,a]),v(["rsc.data","rsc.loaded","rsc.location"],[i?.serverData??{},void 0!==i,Mh()],{mode:"mount"});let s=JSON.stringify(r??{}),l=ke(void 0===i?void 0:s);me(()=>{o&&s!==l.current&&(l.current=s,Lh(t))},[o,s,t])})(r?.ssr),(e=>{v(["actions.endpoint"],[e?.actionPath])})(r?.ssr);const T=ve(()=>((e,t)=>{let n=[],r=[],i=[],a=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set,s=(e,t)=>{e&&(o.add(e),a.set(e,(a.get(e)??!1)||t))},l=e.filter(e=>"google"===e.source);if(l.length>0){let e=(e=>{let t=[...e].sort((e,t)=>e.family.localeCompare(t.family)).map(e=>{let t=(e=>{let t=[...new Set(e.weights)].filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:[400]})(e);if(!e.styles.includes("italic"))return`family=${ah(e.family)}:wght@${t.join(";")}`;let n=[0,1].flatMap(e=>t.map(t=>`${e},${t}`));return`family=${ah(e.family)}:ital,wght@${n.join(";")}`}),n=[...new Set(e.map(e=>e.display??"swap"))],r=1===n.length?n[0]:"swap";return`${Xp}/css2?${t.join("&")}&display=${r}`})(l);s(Xp,!1),s("https://fonts.gstatic.com",!0),l.some(e=>e.preload)&&r.push({href:e,rel:"preload",as:"style"}),n.push({href:e,rel:"stylesheet"})}return e.forEach(e=>{if("remote"===e.source&&e.stylesheet&&eh(e.stylesheet))return s(th(e.stylesheet),!1),e.preload&&r.push({href:e.stylesheet,rel:"preload",as:"style"}),void n.push({href:e.stylesheet,rel:"stylesheet"});"remote"===e.source&&e.files?e.files.filter(e=>eh(e.url)).forEach(t=>{s(th(t.url),!0),i.push(oh(e,{...t,url:t.url})),e.preload&&r.push({href:t.url,rel:"preload",as:"font",type:Zp[t.format],crossorigin:!0})}):"hosted"===e.source&&e.files.forEach(n=>{let a=t(n.path);s(th(a),!0),i.push(oh(e,{...n,url:a})),e.preload&&r.push({href:a,rel:"preload",as:"font",type:Zp[n.format],crossorigin:!0})})}),{preconnect:[...a].map(([e,t])=>t?{href:e,crossorigin:t}:{href:e}),links:[...r,...n],faces:i.join(""),origins:[...o]}})(f,((e="/fonts")=>t=>`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`)(r?.fontsBaseUrl)),[f,r?.fontsBaseUrl]),C=ve(()=>{const t=Object.values(d).map(e=>e.style.cache);return`@layer plitzi-sdk-runtime{.plitzi-sdk{${(e=>e?Object.keys(e).filter(t=>"string"==typeof e[t]||"number"==typeof e[t]).map(t=>{let n=e[t];return(e=>{if(!e||"string"!=typeof e)return!1;let t=e.trim().toLowerCase();return AE.test(t)||_E.test(t)||DE.test(t)||PE.has(t)})(n)?`--${t}:${n};`:`--${t}:"${n}";`}).join("\n"):"")(h)}}\n${((e="",t={},n={missing:""})=>{let r=n.missing??"";return e.replace(/\{\{\s*([a-z0-9_\-.$]+)\s*\}\}/gi,(e,n)=>{let i=n.split("."),a=t;for(let t of i){if("object"!=typeof a||!a)return r;if(!(t in a))return r;a=a[t]}return"string"==typeof a||"number"==typeof a||"boolean"==typeof a?String(a):r})})(u,h)}${t.join("")}\n${l.customCss}\n${e}}`},[d,h,u,l.customCss,e]),E=ve(()=>({...a,...Yp(T)}),[a,T]),I=he(()=>o.current?o.current.contentWindow:"undefined"!=typeof window?window:{innerWidth:1440,innerHeight:900},[o]),O=ve(()=>({settings:{isHydrating:x,previewMode:g,debugMode:y,currentPageId:p,renderMode:m,environment:b,...l,theme:i},root:{baseElementId:p},utils:{displayBorderComponents:!1,getWindow:I,rootRef:s},customContexts:{},contexts:{ComponentContext:w,SegmentsContext:ph,NetworkContext:lh,PluginsContext:TE,EventBridgeContext:j,InteractionsContext:zE}}),[x,g,y,p,m,b,l,i,I,s]);/* @__PURE__ */
|
|
304
|
+
return Ie(Ce,{children:["iframe"!==m&&/* @__PURE__ */Ee(MI,{head:T}),("raw"===m||"widget"===m)&&/* @__PURE__ */Ee(EI,{renderMode:m,style:C,branding:N,plitziContextValue:O,pageId:p}),"shadow"===m&&/* @__PURE__ */Ee(PI,{sdkStylePath:n,style:C,branding:N,plitziContextValue:O,pageId:p,assets:a}),!["raw","widget","shadow"].includes(m)&&/* @__PURE__ */Ee(CI,{style:T.faces?`${T.faces}\n${C}`:C,branding:N,plitziContextValue:O,pageId:p,assets:E,ref:o})]})};jI.Plugin=RI;var FI,$I,VI=jI,qI=({children:e})=>{const{query:t}=pe(lh),n=pe(ch),r=ve(()=>n.segments,[n]),[i,a]=we(r);p("segments",i);const o=m("segments");me(()=>{a(r)},[r]);const l=he(async e=>{const n=o(e,void 0);if(n)return n;try{const r=await t("Segment",{identifier:e},"network-only"),i=r.result?.Segment;let l;return r.success&&i&&(l={...i,schema:{...s(i,"schema"),flat:s(i,"schema.flat",[]).reduce((e,t)=>({...e,[t.id]:t}),{})}},a({...o(),[l.id]:l})),n}catch{return}},[o,t]),c=ve(()=>({segmentGet:l}),[l]);/* @__PURE__ */
|
|
305
|
+
return Ee(ph,{value:c,children:e})},BI=e=>{let[t,n]=e.split("."),r=Number(t);if(!Number.isFinite(r)||r<=0)return;let i=Number(n);return{expiresAt:r,refreshExpiresAt:Number.isFinite(i)&&i>0?i:void 0}},UI=e=>{if(e&&!(typeof document>"u"))for(let t of document.cookie.split(";")){let n=t.indexOf("=");if(-1!==n&&t.slice(0,n).trim()===e)return BI(decodeURIComponent(t.slice(n+1).trim()))}},HI=class{kind;key;constructor(e,t){this.kind=e,this.key=t}get area(){try{if("localStorage"===this.kind&&typeof localStorage<"u")return localStorage;if("sessionStorage"===this.kind&&typeof sessionStorage<"u")return sessionStorage}catch{}}read(){let e=this.area?.getItem(this.key);if(e)try{let t=JSON.parse(e);return(e=>"object"==typeof e&&!!e&&1===e.version)(t)?t:void 0}catch{return}}write(e){try{this.area?.setItem(this.key,JSON.stringify({version:1,...e}))}catch{}}clear(){try{this.area?.removeItem(this.key)}catch{}}subscribe(e){if("localStorage"!==this.kind||typeof window>"u")return()=>{};let t=t=>{(null===t.key||t.key===this.key)&&e(this.read())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}},WI=e=>{if(!e)return;let t=e.split(".");if(3!==t.length)return;let n=(e=>{try{let t=e.replaceAll("-","+").replaceAll("_","/"),n=t.padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return"object"==typeof r&&r?r:void 0}catch{return}})(t[1])?.exp;return"number"==typeof n&&Number.isFinite(n)?n:void 0},GI=()=>Math.floor(Date.now()/1e3),JI=e=>{if("number"==typeof e&&Number.isFinite(e)&&!(e<=0))return Math.floor(e>1e11?e/1e3:e)},KI=class{state="init";session={validatedAt:0};store;gate;hintCookie;revalidateSeconds;listeners=/* @__PURE__ */new Set;renewal;renewalTimer;detachListeners;offline=!1;spaceKey;constructor({spaceKey:e="",tokenStorage:t="localStorage",sessionHintCookie:n,sessionGate:r="optimistic",sessionRevalidateSeconds:i=300,storageKey:a="plitzi_auth_session"}={}){this.spaceKey=e,this.store=new HI(t,a),this.gate=r,this.hintCookie=n,this.revalidateSeconds=i}get endpoints(){return[]}requestExchange(){return Promise.resolve(void 0)}consumeRedirect(){return Promise.resolve(void 0)}get user(){return this.session.user}get token(){return this.session.token}getState(){return this.state}can(e){let t=this.session.user?.permissions;return Array.isArray(t)&&t.includes(e)}peekState(){return this.peek().state}peek(){let e=this.store.read(),t=UI(this.hintCookie);if(this.hintCookie&&!t)return{state:"guest"};let n=e?.token,r=JI(n?.expiresAt)??WI(n?.accessToken);return n?.accessToken&&(void 0===r||r-60>GI())&&e?.user?{state:"authenticated",user:e.user,token:e.token}:n?.accessToken||n?.refreshToken||t?{state:"init",user:e?.user,token:e?.token}:{state:"guest"}}async init(e={}){this.attach(),await this.decide(e),this.settle()}settle(){("init"===this.state||"initLoading"===this.state)&&this.setState(this.session.user||this.hasLiveToken()?"authenticated":"guest","settled")}async decide(e){if(e.skipAuth)return void this.setState("guest","skip-auth");let t=await this.consumeRedirect();if(t)return void(t.ok?(this.adopt(t),await this.handOffToServer(),this.emit({type:"login",token:this.session.token})):this.endSession(t.reason));if(e.user)return void this.adopt({ok:!0,user:e.user,token:e.accessToken?{accessToken:e.accessToken,expiresAt:e.expiresAt??null,refreshToken:null}:this.session.token},!0,"bootstrap");let n=this.store.read(),r=UI(this.hintCookie);if(this.session={user:n?.user,token:n?.token,validatedAt:n?.validatedAt??0},!this.hintCookie||r){if(this.hasLiveToken()&&this.session.user){this.setState("authenticated","restored"),this.scheduleRenewal();let e=this.isFresh()&&"strict"!==this.gate?void 0:this.revalidate(!0);return void("strict"===this.gate&&await e)}this.hasEvidence()?(this.setState("initLoading","no-evidence"),this.hasLiveToken()&&this.capabilities.identity?await this.loadIdentity():this.capabilities.renew?await this.renew():this.capabilities.identity?await this.loadIdentity():this.endSession()):this.endSession(void 0,"no-evidence")}else this.endSession(void 0,"hint-missing")}dispose(){clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.detachListeners?.(),this.detachListeners=void 0}async login(e){this.setState("authenticating","authenticating");let t=await this.requestLogin(e);if(!t.ok)return this.endSession(t.reason),{ok:!1,reason:t.reason};this.adopt(t);let n=await this.handOffToServer();return n?{ok:!1,reason:n}:(!this.session.user&&this.capabilities.identity&&await this.loadIdentity(),"authenticated"===this.state?(this.emit({type:"login",token:this.session.token}),{ok:!0,...this.session.token??{accessToken:"",expiresAt:null,refreshToken:null}}):{ok:!1,reason:"inactive"})}async handOffToServer(){let e=await this.requestExchange();if(e)return e.ok?void this.adopt(e):"network"===e.reason?void(this.offline=!0):(this.endSession(e.reason),e.reason)}async refresh(){return await this.renew(),this.session.token}async revalidate(e=!1){return this.hasEvidence()?!e&&this.isFresh()&&this.hasLiveToken()?"authenticated"===this.state:this.hasLiveToken()&&this.capabilities.identity?this.loadIdentity():this.capabilities.renew?this.renew():this.capabilities.identity?this.loadIdentity():(this.hasLiveToken()||this.endSession("expired"),"authenticated"===this.state):("guest"!==this.state&&this.endSession(),!1)}invalidate(e="expired"){"network"!==e?"expired"===e&&this.capabilities.renew?this.renew():this.endSession(e):this.offline=!0}async logout(){await this.requestLogout(),this.endSession(),this.emit({type:"logout"})}on(e){let t=Array.isArray(e)?e:[e];return t.forEach(e=>this.listeners.add(e)),()=>t.forEach(e=>this.listeners.delete(e))}emit(e){for(let t of this.listeners)t(e)}setState(e,t){this.state!==e&&(this.state=e,this.emit({type:"state",state:e,reason:t}))}async renew(){return this.renewal??=this.performRenewal().finally(()=>{this.renewal=void 0}),this.renewal}async performRenewal(){let e=await this.requestRenewal(this.session.token?.refreshToken??void 0);return e.ok?(this.adopt(e),!this.session.user&&this.capabilities.identity?this.loadIdentity():"authenticated"===this.state):(this.handleFailure(e.reason),!1)}async loadIdentity(){let e=await this.requestIdentity();return e.ok?(this.adopt(e),"authenticated"===this.state):"expired"===e.reason&&this.capabilities.renew&&!this.renewal?this.renew():(this.handleFailure(e.reason),!1)}handleFailure(e){"network"!==e?this.endSession(e):this.offline=!0}adopt(e,t=!0,n="granted"){this.session={user:e.user??this.session.user,token:e.token??this.session.token,validatedAt:GI()},this.offline=!1,t&&this.store.write(this.session),this.scheduleRenewal(),this.setState(this.session.user||this.hasLiveToken()?"authenticated":"guest",n)}endSession(e,t="signed-out"){clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.session={validatedAt:GI()},this.store.write(this.session),this.setState("guest",t),e&&this.emit({type:"expired",reason:e})}expiresAt(){return JI(this.session.token?.expiresAt)??WI(this.session.token?.accessToken)}hasLiveToken(){if(!this.session.token?.accessToken)return!1;let e=this.expiresAt();return void 0===e||e-60>GI()}isFresh(){return GI()-this.session.validatedAt<this.revalidateSeconds}hasEvidence(){if(this.session.token?.accessToken||this.session.token?.refreshToken)return!0;let e=UI(this.hintCookie);return!(void 0!==e?.refreshExpiresAt&&e.refreshExpiresAt<=GI()||!e)}scheduleRenewal(){clearTimeout(this.renewalTimer),this.renewalTimer=void 0;let e=this.expiresAt();if(void 0===e||typeof window>"u"||"guest"===this.state)return;let t=Math.min(1e3*(e-60-GI()),2147483647);t<=0?this.onRenewalDue():this.renewalTimer=setTimeout(()=>this.onRenewalDue(),t)}onRenewalDue(){this.capabilities.renew?this.renew():this.endSession("expired")}attach(){if(typeof window>"u"||this.detachListeners)return;let e=()=>{"visible"===document.visibilityState&&this.revalidate()},t=()=>{this.offline&&this.revalidate(!0)},n=this.store.subscribe(e=>this.adoptFromStorage(e)),r=(e=>(Tt.add(e),()=>Tt.delete(e)))(({reason:e,url:t})=>{let n=this.endpoints.filter(Boolean);(0===n.length||n.some(e=>((e,t)=>{if(!e||!t)return!1;try{let n=typeof window>"u"?void 0:window.location.href;return Ot(new URL(e,n).hostname)===Ot(new URL(t,n).hostname)}catch{return!1}})(e,t)))&&this.invalidate(e)});document.addEventListener("visibilitychange",e),window.addEventListener("online",t),this.detachListeners=()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("online",t),n(),r()}}adoptFromStorage(e){if(!e?.token&&!e?.user)return clearTimeout(this.renewalTimer),this.renewalTimer=void 0,this.session={validatedAt:GI()},this.setState("guest","another-tab"),void this.emit({type:"logout"});this.adopt({ok:!0,user:e.user,token:e.token},!1)}},QI=(e,t)=>s(e,t,void 0),YI=(e,t)=>{let n=QI(e,t);return"string"==typeof n&&""!==n?n:null},XI=(e,t)=>{let n=QI(e,t),r="string"==typeof n?Number(n):n;return"number"==typeof r&&Number.isFinite(r)?r:null},ZI=e=>"string"==typeof e?e:"number"==typeof e&&Number.isFinite(e)?String(e):"",eO=class extends KI{name="basic";options;constructor({loginUrl:e="",userUrl:t="",refreshUrl:n="",logoutUrl:r="",sessionExchangeUrl:i="",detailsPath:a="details",tokenPath:o="access_token",refreshTokenPath:s="refresh_token",expirationTimePath:l="expire_at",refreshExpirationTimePath:c="refresh_expire_at",...u}={}){super(u),this.options={loginUrl:e,userUrl:t,refreshUrl:n,logoutUrl:r,sessionExchangeUrl:i,detailsPath:a,tokenPath:o,refreshTokenPath:s,expirationTimePath:l,refreshExpirationTimePath:c}}get capabilities(){return{renew:!!this.options.refreshUrl,identity:!!this.options.userUrl}}get endpoints(){let{loginUrl:e,userUrl:t,refreshUrl:n,logoutUrl:r}=this.options;return[e,t,n,r]}async requestLogin(e){let t=ZI(e.token).trim();if("token"===e.mode)return t?this.adoptToken(t):{ok:!1,reason:"missing"};if(!this.options.loginUrl)return{ok:!1,reason:"missing"};let n=await this.request(this.options.loginUrl,{method:"POST",body:JSON.stringify({username:ZI(e.username),password:ZI(e.password)})});return this.toResult(n)}async adoptToken(e){if(!this.options.userUrl)return{ok:!1,reason:"missing"};let t=await this.request(this.options.userUrl,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}),n=this.toResult(t);return n.ok?{ok:!0,user:n.user,token:{accessToken:e,expiresAt:null,refreshToken:null}}:n}async requestRenewal(e){if(!this.options.refreshUrl)return{ok:!1,reason:"missing"};let t=await this.request(this.options.refreshUrl,{method:"POST",body:JSON.stringify(e?{[this.options.refreshTokenPath]:e}:{})});return this.toResult(t)}async requestExchange(){let e=this.token?.accessToken;if(!this.options.sessionExchangeUrl||!e)return;let t=await this.request(this.options.sessionExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",...this.spaceKey?{"x-access-token":this.spaceKey}:{}},body:JSON.stringify({provider:this.name,token:e})});return this.toResult(t)}async requestIdentity(){if(!this.options.userUrl)return{ok:!1,reason:"missing"};let e=await this.request(this.options.userUrl,{method:"GET"});return this.toResult(e)}async requestLogout(){this.options.logoutUrl&&await this.request(this.options.logoutUrl,{method:"POST"})}async request(e,t){let n,r;try{n=await fetch(e,{credentials:"include",headers:{"Content-Type":"application/json"},...t})}catch{return{status:0,reason:"network"}}try{r=await n.json()}catch{r=void 0}return{data:r,status:n.status,reason:n.ok?void 0:It(n.status,r)??"network"}}toResult(e){if(e.reason)return{ok:!1,reason:e.reason};let t=QI(e.data,this.options.detailsPath);return{ok:!0,user:"object"==typeof t&&t?t:void 0,token:this.tokenFrom(e.data)}}tokenFrom(e){let t=YI(e,this.options.tokenPath);if(!t)return;let n=QI(e,"errors");return{..."object"==typeof n&&n?{errors:n}:{},accessToken:t,expiresAt:XI(e,this.options.expirationTimePath),refreshToken:YI(e,this.options.refreshTokenPath),refreshExpiresAt:XI(e,this.options.refreshExpirationTimePath)}}},tO=/* @__PURE__ */new Map([["basic",e=>new eO(e)]]),nO=class{providerType;provider;settings;listeners;constructor(e,t,n){this.providerType=e,this.settings=n,this.listeners=Array.isArray(t)?t:[t];let r=tO.get(e);r&&(this.provider=r(n),this.provider.on(this.listeners))}getProviderType(){return this.providerType}getProvider(){return this.provider}getState(){return this.provider?.getState()??"guest"}peekState(){return this.peek().state}peek(){return(this.provider??new eO(this.settings)).peek()}can(e){return this.provider?.can(e)??!1}init(e){if(!this.provider){let t=this.peekState(),n=e?.user||"authenticated"===t?"authenticated":"guest";return this.listeners.forEach(e=>e({type:"state",state:n,reason:"no-provider"})),Promise.resolve()}return this.provider.init(e)}login(...e){return this.provider?.login(...e)??Promise.resolve({ok:!1,reason:"missing"})}refresh(){return this.provider?.refresh()??Promise.resolve(void 0)}revalidate(e){return this.provider?.revalidate(e)??Promise.resolve(!1)}invalidate(e){this.provider?.invalidate(e)}logout(){return this.provider?.logout()??Promise.resolve()}dispose(){this.provider?.dispose()}on(e){return this.provider?.on(e)}},rO=["loginUrl","userUrl","refreshUrl","logoutUrl","detailsPath","tokenPath","refreshTokenPath","expirationTimePath","refreshExpirationTimePath","sessionHintCookie","sessionExchangeUrl"],iO=({children:e,server:t})=>{let{previewMode:n,isHydrating:r,environment:i}=Pe(),{webKey:a}=pe(lh),[[o,s]]=c(["schema.settings","schema.variables"]),{queryParams:l,hostname:u}=vE({server:t}),d=ve(()=>({queryParams:l,hostname:u,environment:i}),[l,u,i]),p=ve(()=>Array.isArray(s)?s.reduce((e,t)=>{let{name:n,value:r,subValues:i}=t;if(!Array.isArray(i)||0===i.length)return{...e,[n]:r};let a=i.find(e=>V(e.when,d));return a?{...e,[n]:a.value}:{...e,[n]:r}},{}):{},[s,d]),h=ve(()=>{let e=Object.fromEntries(rO.map(e=>[e,o[e]]));try{return JSON.parse($(JSON.stringify(e),p))}catch{return e}},[o,p]),f=ve(()=>({...h,spaceKey:a,tokenStorage:o.tokenStorage??"localStorage",sessionGate:o.sessionGate,sessionRevalidateSeconds:o.sessionRevalidateSeconds}),[h,o,a]),{manager:m,loading:g,authenticated:y,state:b,bootstrapUser:v,bootstrapToken:x,peekedUser:k,peekedToken:w}=(({server:e,isHydrating:t=!1,provider:n="",settings:r})=>{let i=e?.authenticated?e.user?.details:void 0,a="string"==typeof e?.user?.accessToken?e.user.accessToken:void 0,[o,s]=we("init"),l=he(e=>{"state"===e.type&&s(e.state)},[]),c=ve(()=>new nO(n,l,r),[n,l,r]),u=ve(()=>t||i?void 0:c.peek(),[c,t,i]),d="init"!==o&&"initLoading"!==o||!!i||t||"authenticated"===u?.state||"guest"===u?.state;return me(()=>(c.init({user:i,accessToken:a,expiresAt:e?.user?.expiresAt,skipAuth:e?.skipAuth}),()=>c.dispose()),[c,i,a,e?.user?.expiresAt,e?.skipAuth]),ve(()=>({manager:c,state:o,bootstrapUser:i,bootstrapToken:a,peekedUser:u?.user,peekedToken:u?.token?.accessToken,loading:"initLoading"===o||!d,authenticated:"authenticated"===o||"init"===o&&(!!i||"authenticated"===u?.state)}),[c,o,i,a,d,u])})({server:t,isHydrating:r,provider:o.userProvider??"",settings:f}),S=m.getProvider()?.user,N=S??v??k,T=S?m.getProvider()?.token?.accessToken:v?x:w,C=ke(void 0),E=ve(()=>{let e=N?{details:N,accessToken:T}:void 0,t=C.current;return t?.accessToken===e?.accessToken&&((e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=e,r=t;return[.../* @__PURE__ */new Set([...Object.keys(n),...Object.keys(r)])].every(e=>JSON.stringify(n[e])===JSON.stringify(r[e]))})(t?.details,e?.details)||(C.current=e),C.current},[N,T]),I=ve(()=>({login:m.login.bind(m),refresh:m.refresh.bind(m),revalidate:m.revalidate.bind(m),invalidate:m.invalidate.bind(m),can:m.can.bind(m),logout:m.logout.bind(m),state:b,authenticated:y||!n,user:E}),[m,b,y,n,E]);/* @__PURE__ */
|
|
306
306
|
return Ee(bE,{value:I,children:!g&&e})},aO=[],oO=/* @__PURE__ */new Set,sO=[],lO=()=>{sO=[...aO];for(let e of oO)e()},cO=e=>(oO.add(e),()=>{oO.delete(e)}),uO=()=>sO,dO=()=>FI,pO=({className:e,onOpen:t})=>{let{logs:n}=pe(Wp),{errors:r,warnings:i}=ve(()=>n.reduce((e,{logType:t})=>({errors:"danger"===t?e.errors+1:e.errors,warnings:"warning"===t?e.warnings+1:e.warnings}),{errors:0,warnings:0}),[n]),a=he(()=>{r>0?t("danger"):i>0?t("warning"):t()},[r,i,t]);/* @__PURE__ */
|
|
307
307
|
return Ee("div",{className:vt("absolute bottom-3 left-3 z-[1000000]",e),children:/* @__PURE__ */Ie("button",{className:vt("flex cursor-pointer items-center gap-2 rounded border border-zinc-200 bg-white px-2 py-1.5 text-[12px]/[16px]","font-bold text-zinc-600 shadow-md transition-colors select-none hover:bg-zinc-50","dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800"),title:"Plitzi dev tools",onClick:a,children:["Plitzi",r>0&&/* @__PURE__ */Ie("span",{className:"flex items-center gap-1 text-red-600 dark:text-red-400",children:[/* @__PURE__ */Ee("i",{className:"fa-regular fa-circle-xmark text-[11px]"}),r]}),i>0&&/* @__PURE__ */Ie("span",{className:"flex items-center gap-1 text-amber-600 dark:text-amber-400",children:[/* @__PURE__ */Ee("i",{className:"fa-solid fa-triangle-exclamation text-[11px]"}),i]}),0===r&&0===i&&/* @__PURE__ */Ee("i",{className:"fa-solid fa-terminal text-[11px] text-zinc-400"})]})})},hO={running:"text-blue-600 dark:text-blue-400",streaming:"text-blue-600 dark:text-blue-400",accepted:"text-blue-600 dark:text-blue-400",completed:"text-green-700 dark:text-green-400",failed:"text-red-600 dark:text-red-400",aborted:"text-amber-600 dark:text-amber-400",skipped:"text-zinc-500"},fO=e=>new Date(e).toLocaleTimeString(),mO=e=>e.endedAt?e.endedAt-e.startedAt+"ms":"…",gO=e=>void 0===e.endedAt,yO=()=>{let{runs:e,clear:t}={...Se(Ze.subscribe,Ze.getState,Ze.getState),clear:it},[n]=c("actions.endpoint"),[r,i]=we(),a=e.filter(gO),o=he(e=>()=>i(t=>t===e?void 0:e),[]),s=he(e=>()=>(e=>{nt.get(e)?.()})(e),[]);/* @__PURE__ */
|
|
308
308
|
return Ie("div",{className:"flex h-full w-full flex-col overflow-auto",children:[
|
|
@@ -315,13 +315,13 @@ return Ie("div",{className:"flex h-full w-full flex-col overflow-auto",children:
|
|
|
315
315
|
/* @__PURE__ */Ee("span",{className:vt("ml-auto",hO[e.status]??""),children:e.reason??e.status}),
|
|
316
316
|
/* @__PURE__ */Ee("span",{className:"text-zinc-400 dark:text-zinc-500",children:mO(e)})]}),gO(e)&&e.cancellable&&/* @__PURE__ */Ee(Rp,{size:"xs",intent:"secondary",onClick:s(e.id),children:"Cancel"})]}),r===e.id&&/* @__PURE__ */Ie("div",{className:"flex flex-col gap-2 bg-zinc-50 px-3 py-2 text-xs dark:bg-zinc-800/50",children:[e.runId&&/* @__PURE__ */Ie("div",{children:[/* @__PURE__ */Ee("span",{className:"text-zinc-500 dark:text-zinc-400",children:"Run id: "}),/* @__PURE__ */Ee("span",{className:"font-mono",children:e.runId})]}),e.error&&/* @__PURE__ */Ee("div",{className:"break-words text-red-600 dark:text-red-400",children:e.error}),
|
|
317
317
|
/* @__PURE__ */Ie("div",{children:[/* @__PURE__ */Ee("div",{className:"text-zinc-500 dark:text-zinc-400",children:"Input"}),/* @__PURE__ */Ee("pre",{className:"overflow-auto whitespace-pre-wrap",children:JSON.stringify(e.input??{},null,2)})]}),e.output&&/* @__PURE__ */Ie("div",{children:[/* @__PURE__ */Ee("div",{className:"text-zinc-500 dark:text-zinc-400",children:"Output"}),/* @__PURE__ */Ee("pre",{className:"overflow-auto whitespace-pre-wrap",children:JSON.stringify(e.output,null,2)})]}),e.progress.length>0&&/* @__PURE__ */Ie("div",{children:[/* @__PURE__ */Ie("div",{className:"text-zinc-500 dark:text-zinc-400",children:["Progress (",e.progress.length,")"]}),/* @__PURE__ */Ee("pre",{className:"overflow-auto whitespace-pre-wrap",children:JSON.stringify(e.progress,null,2)})]}),e.trace&&/* @__PURE__ */Ie("div",{className:"flex flex-col gap-1",children:[/* @__PURE__ */Ee("div",{className:"text-zinc-500 dark:text-zinc-400",children:"Server steps"}),e.trace.map((e,t)=>{let n=e.node,r="string"==typeof e.status?e.status:"";/* @__PURE__ */
|
|
318
|
-
return Ie("div",{className:"flex items-center justify-between rounded-sm border border-zinc-200 px-2 py-1 dark:border-zinc-700",children:[/* @__PURE__ */Ee("span",{children:n?.title??n?.action??"step"}),/* @__PURE__ */Ee("span",{className:vt(hO["success"===r?"completed":"failed"]),children:r})]},`${String(n?.action)}-${t}`)})]})]})]},e.id))})]})},bO=({attribute:e,value:t,isDefinition:n=!1,onSelectElement:r})=>{let[i]=c("schema.flat"),a=he(e=>()=>r?.(e),[r]),o=ve(()=>"items"===e&&n&&Array.isArray(t)?/* @__PURE__ */Ee("div",{className:"flex flex-col",children:t.map((e,t)=>/* @__PURE__ */Ee("div",{className:"cursor-pointer text-purple-400",onClick:a(e),children
|
|
318
|
+
return Ie("div",{className:"flex items-center justify-between rounded-sm border border-zinc-200 px-2 py-1 dark:border-zinc-700",children:[/* @__PURE__ */Ee("span",{children:n?.title??n?.action??"step"}),/* @__PURE__ */Ee("span",{className:vt(hO["success"===r?"completed":"failed"]),children:r})]},`${String(n?.action)}-${t}`)})]})]})]},e.id))})]})},bO=({attribute:e,value:t,isDefinition:n=!1,onSelectElement:r})=>{let[i]=c("schema.flat"),a=he(e=>()=>r?.(e),[r]),o=ve(()=>"items"===e&&n&&Array.isArray(t)?/* @__PURE__ */Ee("div",{className:"flex flex-col",children:t.map((e,t)=>/* @__PURE__ */Ee("div",{className:"cursor-pointer text-purple-400",onClick:a(e),children:s(i,`${e}.definition.label`,e)},t))}):e&&["rootId","parentId"].includes(e)&&n?/* @__PURE__ */Ee("div",{className:"cursor-pointer text-purple-400",onClick:a(t),children:s(i,`${t}.definition.label`,t)}):"styleSelectors"===e&&n&&t&&"object"==typeof t?Object.values(t).join(", "):"object"==typeof t&&t?JSON.stringify(t):"boolean"==typeof t?t?"True":"False":t,[e,n,t,a,i]);/* @__PURE__ */
|
|
319
319
|
return Ee("div",{className:"grow basis-0 truncate",children:o})},vO=({attributes:e})=>/* @__PURE__ */Ee("div",{className:"w-full text-sm",children:e&&Object.entries(e).map(([e,t],n)=>/* @__PURE__ */Ie("div",{className:"flex gap-4 border-gray-300 [&:not(:first-child)]:border-t",children:[/* @__PURE__ */Ee("div",{className:"grow basis-0",children:e}),/* @__PURE__ */Ee(bO,{isAttribute:!0,attribute:e,value:t})]},n))}),xO=({definition:e,onSelectElement:t})=>/* @__PURE__ */Ee("div",{className:"w-full text-sm",children:e&&Object.entries(e).map(([e,n],r)=>/* @__PURE__ */Ie("div",{className:"flex gap-4 border-gray-300 [&:not(:first-child)]:border-t",children:[/* @__PURE__ */Ee("div",{className:"grow basis-0",children:e}),/* @__PURE__ */Ee(bO,{isDefinition:!0,attribute:e,value:n,onSelectElement:t})]},r))}),kO=[{label:"Definition"},{label:"Attributes"}],wO=({definition:e,attributes:t,onSelectElement:n})=>/* @__PURE__ */Ie(aT,{className:"w-full grow gap-4 overflow-hidden p-4",children:[
|
|
320
320
|
/* @__PURE__ */Ee(aT.Tabs,{items:kO}),
|
|
321
321
|
/* @__PURE__ */Ee(aT.TabContent,{className:"flex-col",children:/* @__PURE__ */Ee(xO,{definition:e,onSelectElement:n})}),
|
|
322
322
|
/* @__PURE__ */Ee(aT.TabContent,{children:/* @__PURE__ */Ee(vO,{attributes:t})})]}),SO=({name:e,id:t,isSelected:n,isVisible:r=!0,onSelect:i})=>{let a=he(()=>i?.(t),[i,t]);/* @__PURE__ */
|
|
323
|
-
return Ie("div",{className:vt("flex w-full cursor-pointer items-center justify-between gap-2 border-l-2 px-2 py-1.5 transition-colors",{"border-l-violet-500 bg-violet-50 text-violet-700 dark:border-l-violet-500 dark:bg-violet-500/15 dark:text-violet-300":n,"border-l-transparent text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:border-l-transparent dark:text-zinc-300 dark:hover:bg-zinc-800 dark:hover:text-zinc-100":!n}),onClick:a,children:[/* @__PURE__ */Ee("div",{className:"truncate",title:e,children:e}),/* @__PURE__ */Ee("i",{className:vt("shrink-0 text-[10px]",{"fa-solid fa-eye text-zinc-400 dark:text-zinc-500":r,"fa-solid fa-eye-slash text-zinc-300 dark:text-zinc-700":!r})})]})},NO=({elements:e,elementSelected:t,onSelect:n})=>{let[r,i]=we(""),a=ve(()=>(e??[]).filter(e=>e.definition.label.toLowerCase().includes(r.toLowerCase())),[e,r]),o=ve(()=>a.slice(0,200),[a]),
|
|
324
|
-
return Ie("div",{className:"flex h-full w-[280px] shrink-0 flex-col gap-2 border-r border-zinc-200 dark:border-zinc-700",children:[/* @__PURE__ */Ee("div",{className:"px-2 pt-2",children:/* @__PURE__ */Ee(qp,{value:r,onChange:
|
|
323
|
+
return Ie("div",{className:vt("flex w-full cursor-pointer items-center justify-between gap-2 border-l-2 px-2 py-1.5 transition-colors",{"border-l-violet-500 bg-violet-50 text-violet-700 dark:border-l-violet-500 dark:bg-violet-500/15 dark:text-violet-300":n,"border-l-transparent text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:border-l-transparent dark:text-zinc-300 dark:hover:bg-zinc-800 dark:hover:text-zinc-100":!n}),onClick:a,children:[/* @__PURE__ */Ee("div",{className:"truncate",title:e,children:e}),/* @__PURE__ */Ee("i",{className:vt("shrink-0 text-[10px]",{"fa-solid fa-eye text-zinc-400 dark:text-zinc-500":r,"fa-solid fa-eye-slash text-zinc-300 dark:text-zinc-700":!r})})]})},NO=({elements:e,elementSelected:t,onSelect:n})=>{let[r,i]=we(""),a=ve(()=>(e??[]).filter(e=>e.definition.label.toLowerCase().includes(r.toLowerCase())),[e,r]),o=ve(()=>a.slice(0,200),[a]),l=a.length-o.length,c=he(e=>i(e),[]);/* @__PURE__ */
|
|
324
|
+
return Ie("div",{className:"flex h-full w-[280px] shrink-0 flex-col gap-2 border-r border-zinc-200 dark:border-zinc-700",children:[/* @__PURE__ */Ee("div",{className:"px-2 pt-2",children:/* @__PURE__ */Ee(qp,{value:r,onChange:c,placeholder:"Search elements...",size:"sm"})}),/* @__PURE__ */Ie("div",{className:"flex flex-col overflow-y-auto text-xs text-zinc-700 dark:text-zinc-300",children:[0===o.length&&/* @__PURE__ */Ee("div",{className:"p-4 text-center text-zinc-400 dark:text-zinc-600",children:"No elements"}),o.map(e=>/* @__PURE__ */Ee(SO,{name:e.definition.label,isSelected:t===e.id,isVisible:s(e,"definition.initialState.visibility",!0),id:e.id,onSelect:n},e.id)),l>0&&/* @__PURE__ */Ie("div",{className:"p-3 text-center text-[11px] text-zinc-400 dark:text-zinc-600",children:[l," more — narrow the search to reach them"]})]})]})},TO=({className:e,elementSelected:t,onSelectElement:n})=>{let[[r,i]]=c(["schema.flat","navigation.currentPageId"]),a=ve(()=>Object.values(r).filter(e=>e.definition.rootId===i),[r,i]),o=ve(()=>a.find(e=>e.id===t),[a,t]),s=he(e=>n(e),[n]);/* @__PURE__ */
|
|
325
325
|
return Ie("div",{className:vt("flex h-full w-full",e),children:[/* @__PURE__ */Ee(NO,{elements:a,elementSelected:t,onSelect:s}),t&&/* @__PURE__ */Ee(wO,{definition:o?.definition,attributes:o?.attributes,onSelectElement:n})]})},CO=e=>new Date(e).toLocaleTimeString(void 0,{hour12:!1})+"."+String(e%1e3).padStart(3,"0"),EO=e=>{if(void 0===e)return"";if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);let t,n=Array.isArray(e)?"[…]":"{…}";try{t=JSON.stringify(e)||n}catch{t=n}return t.length>120?t.slice(0,120)+"…":t},IO=({index:e,path:t,value:n,timestamp:r,isSelected:i,isFuture:a,onSelect:o})=>{let s=ke(null),l=he(()=>o(e),[o,e]);return me(()=>{i&&s.current?.scrollIntoView({block:"nearest"})},[i]),/* @__PURE__ */Ie("button",{ref:s,onClick:l,className:vt("flex w-full flex-col gap-0.5 border-b border-zinc-100 px-3 py-1.5 text-left font-mono text-xs dark:border-zinc-800",{"bg-violet-600 text-white dark:bg-violet-600":i,"text-zinc-600 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800/60":!i,"opacity-50":a}),children:[/* @__PURE__ */Ie("div",{className:"flex w-full items-center gap-2",children:[/* @__PURE__ */Ee("span",{className:"grow truncate",children:t??/* @__PURE__ */Ee("span",{className:"italic opacity-70",children:0===e?"initial state":"replace"})}),/* @__PURE__ */Ee("span",{className:"shrink-0 text-[10px] opacity-70",children:CO(r)})]}),void 0!==n&&/* @__PURE__ */Ee("span",{className:"w-full truncate text-[10px] opacity-70",children:EO(n)})]})},OO=({index:e,total:t,canUndo:n,canRedo:r,filter:i,onUndo:a,onRedo:o,onClear:s,onFilterChange:l})=>/* @__PURE__ */Ie("div",{className:"flex shrink-0 flex-col gap-1.5 border-b border-zinc-200 bg-zinc-50 px-2 py-1.5 dark:border-zinc-800 dark:bg-zinc-900",children:[/* @__PURE__ */Ie("div",{className:"flex items-center gap-1",children:[
|
|
326
326
|
/* @__PURE__ */Ie("button",{onClick:a,disabled:!n,className:"flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 enabled:hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-300 dark:enabled:hover:bg-zinc-700",children:[/* @__PURE__ */Ee("i",{className:"fa-solid fa-rotate-left"}),"Undo"]}),
|
|
327
327
|
/* @__PURE__ */Ie("button",{onClick:o,disabled:!r,className:"flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 enabled:hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-300 dark:enabled:hover:bg-zinc-700",children:[/* @__PURE__ */Ee("i",{className:"fa-solid fa-rotate-right"}),"Redo"]}),
|
|
@@ -331,7 +331,7 @@ return Ie("div",{className:vt("flex flex-col border-b border-gray-100 px-2 py-1
|
|
|
331
331
|
/* @__PURE__ */Ie("div",{className:"flex items-center gap-2",children:[t&&/* @__PURE__ */Ee("span",{className:"text-gray-400",children:t}),
|
|
332
332
|
/* @__PURE__ */Ee("span",{className:"grow",children:n??i}),a&&/* @__PURE__ */Ee("span",{className:"rounded-sm bg-gray-100 px-1 text-[10px] uppercase dark:bg-zinc-800",children:a}),
|
|
333
333
|
/* @__PURE__ */Ee("span",{className:vt(u?"text-red-600 dark:text-red-400":"text-gray-500 dark:text-zinc-400"),children:l??s??""})]}),o&&/* @__PURE__ */Ie("span",{className:"font-mono text-[10px] text-gray-400",children:["run ",o]}),c&&/* @__PURE__ */Ee("span",{className:"break-words text-red-600 dark:text-red-400",children:c})]})},_O=({title:e,action:t,duration:n,status:r,level:i,id:a,isSelected:o,onClick:s})=>{let l=he(()=>s(a),[a,s]);/* @__PURE__ */
|
|
334
|
-
return Ie("div",{className:vt("flex cursor-pointer items-center gap-2 border-l-2 px-2 py-1 transition-colors",1===i?"pl-5":"pl-2",{"border-l-violet-500 bg-violet-50 text-violet-700 dark:border-l-violet-500 dark:bg-violet-500/15 dark:text-violet-300":o,"border-l-transparent text-zinc-500 hover:bg-zinc-100 hover:text-zinc-800 dark:border-l-transparent dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-200":!o}),onClick:l,children:[/* @__PURE__ */Ee("div",{className:vt("h-2 w-2 shrink-0 rounded-full",{"bg-emerald-500":"success"===r,"bg-amber-500":"skipped"===r,"bg-zinc-300 dark:bg-zinc-600":"disabled"===r,"bg-zinc-400 dark:bg-zinc-500":"failed"===r}),title:r}),/* @__PURE__ */Ie("div",{className:"flex min-w-0 grow justify-between gap-2",children:[/* @__PURE__ */Ee("span",{className:"truncate",children:e}),/* @__PURE__ */Ie("div",{className:"flex shrink-0 items-center gap-1.5 text-zinc-400 dark:text-zinc-600",children:[/* @__PURE__ */Ee("span",{className:"font-mono",children:n}),t&&/* @__PURE__ */Ee("span",{className:"rounded bg-zinc-100 px-1 font-mono text-[10px] text-zinc-500 dark:bg-zinc-800 dark:text-zinc-500",children:t})]})]})]})},DO=({className:e,nodeId:t,nodes:n,selected:r,onSelect:i})=>{let a=ve(()=>{let e
|
|
334
|
+
return Ie("div",{className:vt("flex cursor-pointer items-center gap-2 border-l-2 px-2 py-1 transition-colors",1===i?"pl-5":"pl-2",{"border-l-violet-500 bg-violet-50 text-violet-700 dark:border-l-violet-500 dark:bg-violet-500/15 dark:text-violet-300":o,"border-l-transparent text-zinc-500 hover:bg-zinc-100 hover:text-zinc-800 dark:border-l-transparent dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-200":!o}),onClick:l,children:[/* @__PURE__ */Ee("div",{className:vt("h-2 w-2 shrink-0 rounded-full",{"bg-emerald-500":"success"===r,"bg-amber-500":"skipped"===r,"bg-zinc-300 dark:bg-zinc-600":"disabled"===r,"bg-zinc-400 dark:bg-zinc-500":"failed"===r}),title:r}),/* @__PURE__ */Ie("div",{className:"flex min-w-0 grow justify-between gap-2",children:[/* @__PURE__ */Ee("span",{className:"truncate",children:e}),/* @__PURE__ */Ie("div",{className:"flex shrink-0 items-center gap-1.5 text-zinc-400 dark:text-zinc-600",children:[/* @__PURE__ */Ee("span",{className:"font-mono",children:n}),t&&/* @__PURE__ */Ee("span",{className:"rounded bg-zinc-100 px-1 font-mono text-[10px] text-zinc-500 dark:bg-zinc-800 dark:text-zinc-500",children:t})]})]})]})},DO=({className:e,nodeId:t,nodes:n,selected:r,onSelect:i})=>{let a=ve(()=>{let e=s(n,t),r=[];for(;e;){let{node:i,startTime:a,endTime:o}=e,l=`${P(a,o)}ms`,c=i.id===t?0:1;r.push({id:i.id,action:i.action,title:i.title,status:e.status,level:c,duration:l}),e=s(n,i.afterNode)}return r},[t,n]),o=he(e=>i?.(e),[i]);/* @__PURE__ */
|
|
335
335
|
return Ie("div",{className:vt("flex flex-col gap-1.5",e),children:[/* @__PURE__ */Ie("div",{className:"flex items-center gap-1.5 px-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */Ee("i",{className:"fa-solid fa-code-merge"}),"Execution Tree"]}),/* @__PURE__ */Ee("div",{className:"flex flex-col",children:a.map((e,t)=>/* @__PURE__ */Ee(_O,{id:e.id,action:e.action,title:e.title,duration:e.duration,status:e.status,level:e.level,isSelected:e.id===r,onClick:o},t))})]})},PO=({duration:e,status:t,type:n,action:r})=>/* @__PURE__ */Ie("div",{className:"grid grid-cols-2 gap-x-3 gap-y-0.5 rounded bg-zinc-50 p-2 dark:bg-zinc-800/60",children:[
|
|
336
336
|
/* @__PURE__ */Ie("div",{className:"flex gap-1.5",children:[/* @__PURE__ */Ee("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Duration"}),/* @__PURE__ */Ee("span",{className:"font-mono text-zinc-700 dark:text-zinc-300",children:e})]}),
|
|
337
337
|
/* @__PURE__ */Ie("div",{className:"flex gap-1.5",children:[/* @__PURE__ */Ee("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Type"}),/* @__PURE__ */Ee("span",{className:"text-zinc-700 dark:text-zinc-300",children:n})]}),
|
|
@@ -341,25 +341,25 @@ return Ie("div",{className:"flex w-full flex-col gap-2 p-2 text-zinc-700 dark:te
|
|
|
341
341
|
/* @__PURE__ */Ee("div",{className:"truncate font-semibold text-zinc-800 dark:text-zinc-200",children:t}),
|
|
342
342
|
/* @__PURE__ */Ee(PO,{duration:l,status:i,type:o,action:s}),
|
|
343
343
|
/* @__PURE__ */Ee(MO,{when:a}),
|
|
344
|
-
/* @__PURE__ */Ee(RO,{when:a,whenParams:e})]})},jO=({className:e,node:t,nodes:n})=>{let[r,i]=we(t.id),a=ve(()
|
|
344
|
+
/* @__PURE__ */Ee(RO,{when:a,whenParams:e})]})},jO=({className:e,node:t,nodes:n})=>{let[r,i]=we(t.id),a=ve(()=>s(n,`${r}`),[r,n]),o=he(e=>i(e),[]);/* @__PURE__ */
|
|
345
345
|
return Ie("div",{className:vt("flex",e),children:[
|
|
346
346
|
/* @__PURE__ */Ee(DO,{className:"grow basis-0",nodeId:t.id,nodes:n,selected:r,onSelect:o}),
|
|
347
|
-
/* @__PURE__ */Ee("div",{className:"mx-1 w-px shrink-0 bg-zinc-200 dark:bg-zinc-800"}),r&&/* @__PURE__ */Ee("div",{className:"flex min-w-0 grow basis-0",children:/* @__PURE__ */Ee(LO,{whenParams:a.whenParams,status:a.status,name:a.node.title,startTime:a.startTime,endTime:a.endTime,when:a.node.when,type:a.node.type,action:a.node.action})})]})},FO=({triggerName:e,startTime:t,endTime:n,duration:r,elementId:i,hostElementId:a})=>{let[o]=c("schema.flat"),
|
|
347
|
+
/* @__PURE__ */Ee("div",{className:"mx-1 w-px shrink-0 bg-zinc-200 dark:bg-zinc-800"}),r&&/* @__PURE__ */Ee("div",{className:"flex min-w-0 grow basis-0",children:/* @__PURE__ */Ee(LO,{whenParams:a.whenParams,status:a.status,name:a.node.title,startTime:a.startTime,endTime:a.endTime,when:a.node.when,type:a.node.type,action:a.node.action})})]})},FO=({triggerName:e,startTime:t,endTime:n,duration:r,elementId:i,hostElementId:a})=>{let[o]=c("schema.flat"),l=ve(()=>i?s(o,i):void 0,[i,o]),u=ve(()=>R(t,"HH:mm:ss.SSS"),[t]),d=ve(()=>R(n,"HH:mm:ss.SSS"),[n]),p=ve(()=>{if(!(typeof document>"u"))return document.querySelector(`[data-id="${i}"]`)},[i]),h=he(()=>{p?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[p]),f=he(()=>{p?.classList.add("devtools-element-hovered")},[p]),m=he(()=>{p?.classList.remove("devtools-element-hovered")},[p]);/* @__PURE__ */
|
|
348
348
|
return Ie("div",{className:"flex justify-around gap-3",children:[
|
|
349
349
|
/* @__PURE__ */Ie("div",{className:"flex min-w-0 grow basis-0 flex-col",children:[/* @__PURE__ */Ie("div",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */Ee("i",{className:"fa-regular fa-clock"}),"Times"]}),/* @__PURE__ */Ie("div",{className:"flex flex-col gap-0.5 font-mono text-zinc-700 dark:text-zinc-300",children:[
|
|
350
|
-
/* @__PURE__ */Ie("div",{className:"flex gap-1",children:[/* @__PURE__ */Ee("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Start"}),
|
|
351
|
-
/* @__PURE__ */Ie("div",{className:"flex gap-1",children:[/* @__PURE__ */Ee("span",{className:"text-zinc-400 dark:text-zinc-500",children:"End"}),
|
|
350
|
+
/* @__PURE__ */Ie("div",{className:"flex gap-1",children:[/* @__PURE__ */Ee("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Start"}),u]}),
|
|
351
|
+
/* @__PURE__ */Ie("div",{className:"flex gap-1",children:[/* @__PURE__ */Ee("span",{className:"text-zinc-400 dark:text-zinc-500",children:"End"}),d]}),
|
|
352
352
|
/* @__PURE__ */Ie("div",{className:"flex gap-1",children:[/* @__PURE__ */Ee("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Duration"}),r]})]})]}),
|
|
353
353
|
/* @__PURE__ */Ee("div",{className:"w-px shrink-0 bg-zinc-200 dark:bg-zinc-800"}),
|
|
354
354
|
/* @__PURE__ */Ie("div",{className:"flex min-w-0 grow basis-0 flex-col",children:[/* @__PURE__ */Ie("div",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */Ee("i",{className:"fa-solid fa-circle-info"}),"Details"]}),/* @__PURE__ */Ie("div",{className:"flex flex-col gap-0.5 text-zinc-700 dark:text-zinc-300",children:[
|
|
355
355
|
/* @__PURE__ */Ie("div",{className:"flex gap-1",children:[/* @__PURE__ */Ee("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Type"}),/* @__PURE__ */Ee("span",{children:"Interaction"})]}),
|
|
356
356
|
/* @__PURE__ */Ie("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */Ee("span",{className:"shrink-0 text-zinc-400 dark:text-zinc-500",children:"Trigger"}),/* @__PURE__ */Ee("span",{className:"truncate",children:e})]}),a&&/* @__PURE__ */Ie("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */Ee("span",{className:"shrink-0 text-zinc-400 dark:text-zinc-500",children:"Fired on"}),/* @__PURE__ */Ee("span",{className:"truncate font-mono",children:a})]}),
|
|
357
|
-
/* @__PURE__ */Ie("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */Ee("span",{className:"shrink-0 text-zinc-400 dark:text-zinc-500",children:"Element"}),/* @__PURE__ */Ie("span",{className:"cursor-pointer truncate text-violet-600 hover:text-violet-500 dark:text-violet-400 dark:hover:text-violet-300",onClick:
|
|
357
|
+
/* @__PURE__ */Ie("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */Ee("span",{className:"shrink-0 text-zinc-400 dark:text-zinc-500",children:"Element"}),/* @__PURE__ */Ie("span",{className:"cursor-pointer truncate text-violet-600 hover:text-violet-500 dark:text-violet-400 dark:hover:text-violet-300",onClick:h,onMouseEnter:f,onMouseLeave:m,children:[l?.definition.label,i&&/* @__PURE__ */Ie("span",{className:"ml-1 font-mono text-[10px] text-zinc-400 dark:text-zinc-500",children:["[",i,"]"]})]})]})]})]})]})},$O=({node:e,nodes:t,startTime:n,endTime:r,duration:i,elementId:a,hostElementId:o})=>/* @__PURE__ */Ie("div",{className:"mx-2 my-1.5 flex flex-col gap-2 overflow-hidden rounded border border-zinc-200 text-xs dark:border-zinc-800",children:[/* @__PURE__ */Ee("div",{className:"bg-zinc-50 px-3 py-2 dark:bg-zinc-800/60",children:/* @__PURE__ */Ee(FO,{triggerName:e.title,startTime:n,endTime:r,duration:i,elementId:a,hostElementId:o})}),/* @__PURE__ */Ee("div",{className:"border-t border-zinc-200 dark:border-zinc-800",children:/* @__PURE__ */Ee(jO,{node:e,nodes:t,className:"gap-0"})})]}),VO={danger:"fa-regular fa-circle-xmark",warning:"fa-solid fa-triangle-exclamation",info:"fa-solid fa-circle-info",success:"fa-solid fa-check"},qO={danger:"Error",warning:"Warning",info:"Info",success:"Success"},BO=({className:e,logType:t="info",iconClassName:n,children:r})=>/* @__PURE__ */Ie("div",{className:vt("flex items-center gap-1 rounded px-1.5 py-0.5 font-medium",{"bg-red-50 text-red-600 dark:bg-red-500/15 dark:text-red-400":"danger"===t,"bg-amber-50 text-amber-700 dark:bg-amber-500/15 dark:text-amber-400":"warning"===t,"bg-violet-50 text-violet-700 dark:bg-violet-500/15 dark:text-violet-400":"info"===t,"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400":"success"===t,"bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300":!["danger","warning","info","success"].includes(t)},e),children:[/* @__PURE__ */Ee("i",{className:vt(n??VO[t],"text-[10px]")}),r??qO[t]]}),UO=({status:e,message:t,time:n})=>/* @__PURE__ */Ie("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
|
|
358
358
|
/* @__PURE__ */Ee("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:n}),"completed"===e&&/* @__PURE__ */Ee(BO,{logType:"success",children:"Completed"}),"failed"===e&&/* @__PURE__ */Ee(BO,{logType:"danger",children:"Failed"}),"skipped"===e&&/* @__PURE__ */Ee(BO,{logType:"custom",iconClassName:"fa-solid fa-forward-step",children:"Skipped"}),
|
|
359
359
|
/* @__PURE__ */Ee("div",{className:"grow basis-0 truncate text-zinc-700 dark:text-zinc-300",children:t})]}),HO=/* @__PURE__ */Ee("i",{className:"fa-solid fa-angle-right text-[10px]"}),WO=/* @__PURE__ */Ee("i",{className:"fa-solid fa-angle-down text-[10px]"}),GO=e=>"string"==typeof e?e:JSON.stringify(e),JO=({label:e,children:t})=>/* @__PURE__ */Ie("div",{className:"flex gap-2",children:[/* @__PURE__ */Ee("span",{className:"w-24 shrink-0 text-zinc-400 dark:text-zinc-500",children:e}),/* @__PURE__ */Ee("span",{className:"min-w-0 grow break-words text-zinc-700 dark:text-zinc-300",children:t})]}),KO=({time:e,message:t,params:n})=>{let{node:r,error:i,available:a,param:o,value:s}=n;/* @__PURE__ */
|
|
360
360
|
return Ie(QN,{className:"last:border-b-none w-full border-b border-l-2 border-b-zinc-200 border-l-amber-500 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",collapsed:!0,children:[/* @__PURE__ */Ee(QN.Header,{title:/* @__PURE__ */Ie("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[/* @__PURE__ */Ee("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:e}),/* @__PURE__ */Ee("div",{className:"grow basis-0 truncate text-zinc-700 dark:text-zinc-300",children:t})]}),placement:"left",className:{headerTitle:"overflow-hidden",header:"hover:bg-transparent dark:hover:bg-transparent"},iconCollapsed:HO,iconExpanded:WO}),/* @__PURE__ */Ee(QN.Content,{children:/* @__PURE__ */Ie("div",{className:"mx-2 my-1.5 flex flex-col gap-1 rounded border border-zinc-200 px-3 py-2 text-xs dark:border-zinc-800",children:[r?.title&&/* @__PURE__ */Ee(JO,{label:"Step",children:r.title}),r?.action&&/* @__PURE__ */Ee(JO,{label:"Action",children:r.action}),r?.elementId&&/* @__PURE__ */Ee(JO,{label:"Element",children:r.elementId}),o&&/* @__PURE__ */Ee(JO,{label:"Param",children:o}),void 0!==s&&/* @__PURE__ */Ee(JO,{label:"Value",children:GO(s)}),i&&/* @__PURE__ */Ee(JO,{label:"Error",children:i}),a&&/* @__PURE__ */Ee(JO,{label:"Registered",children:a.length>0?a.join(", "):"nothing on that element"})]})})]})},QO=({className:e,logType:t="info",iconClassName:n,title:r,children:i})=>{let a="danger"===t?"fa-regular fa-circle-xmark":"warning"===t?"fa-solid fa-triangle-exclamation":"info"===t?"fa-solid fa-circle-info":"success"===t?"fa-solid fa-check":"fa-solid fa-circle";/* @__PURE__ */
|
|
361
361
|
return Ie("div",{className:vt("flex items-center gap-1",e),title:r,children:[/* @__PURE__ */Ee("i",{className:vt(n??a,{"text-red-500 dark:text-red-400":"danger"===t,"text-amber-500 dark:text-amber-400":"warning"===t,"text-violet-500 dark:text-violet-400":"info"===t,"text-emerald-500 dark:text-emerald-400":"success"===t,"text-zinc-500 dark:text-zinc-400":!["danger","warning","info","success"].includes(t)},"text-xs")}),i]})},YO=/* @__PURE__ */Ee("i",{className:"fa-solid fa-angle-right text-[10px]"}),XO=/* @__PURE__ */Ee("i",{className:"fa-solid fa-angle-down text-[10px]"}),ZO=({time:e,message:t,params:{elementId:n,hostElementId:r,status:i,node:a,nodes:o,startTime:s=0,endTime:l=0}})=>{let c=ve(()=>`${P(s,l)}ms`,[s,l]),{failed:u,skipped:d,disabled:p}=ve(()=>{let e=Object.values(o).map(({status:e})=>e);return{failed:e.filter(e=>"failed"===e).length,skipped:e.filter(e=>"skipped"===e).length,disabled:e.filter(e=>"disabled"===e).length}},[o]);/* @__PURE__ */
|
|
362
|
-
return Ie(QN,{className:vt("last:border-b-none w-full border-b border-l-2 border-b-zinc-200 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",{"border-l-emerald-500":"completed"===i,"border-l-red-500":"failed"===i,"border-l-zinc-300 dark:border-l-zinc-600":"skipped"===i}),collapsed:!0,children:[/* @__PURE__ */Ee(QN.Header,{title:/* @__PURE__ */Ee(UO,{status:i,message:t,time:e}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:YO,iconExpanded:XO,children:/* @__PURE__ */Ie("div",{className:"flex gap-3 text-zinc-400 dark:text-zinc-500",children:[!!u&&/* @__PURE__ */Ee(QO,{logType:"danger",title:"Failed",children:u}),"skipped"!==i&&!!d&&/* @__PURE__ */Ee(QO,{logType:"warning",title:"Skipped",children:d}),"skipped"!==i&&!!p&&/* @__PURE__ */Ee(QO,{logType:"custom",iconClassName:"fa-solid fa-ban",title:"Disabled",children:p}),c]})}),/* @__PURE__ */Ee(QN.Content,{children:/* @__PURE__ */Ee($O,{elementId:n,hostElementId:r,node:a,nodes:o,startTime:s,endTime:l,duration:c})})]})},ez=({time:e,message:t,params:n})=>(e=>void 0!==e.nodes)(n)?/* @__PURE__ */Ee(ZO,{time:e,message:t,params:n}):/* @__PURE__ */Ee(KO,{time:e,message:t,params:n}),tz=({elementId:e,startTime:t,endTime:n,duration:r})=>{let[i]=c("schema.flat"),a=ve(()=>e
|
|
362
|
+
return Ie(QN,{className:vt("last:border-b-none w-full border-b border-l-2 border-b-zinc-200 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",{"border-l-emerald-500":"completed"===i,"border-l-red-500":"failed"===i,"border-l-zinc-300 dark:border-l-zinc-600":"skipped"===i}),collapsed:!0,children:[/* @__PURE__ */Ee(QN.Header,{title:/* @__PURE__ */Ee(UO,{status:i,message:t,time:e}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:YO,iconExpanded:XO,children:/* @__PURE__ */Ie("div",{className:"flex gap-3 text-zinc-400 dark:text-zinc-500",children:[!!u&&/* @__PURE__ */Ee(QO,{logType:"danger",title:"Failed",children:u}),"skipped"!==i&&!!d&&/* @__PURE__ */Ee(QO,{logType:"warning",title:"Skipped",children:d}),"skipped"!==i&&!!p&&/* @__PURE__ */Ee(QO,{logType:"custom",iconClassName:"fa-solid fa-ban",title:"Disabled",children:p}),c]})}),/* @__PURE__ */Ee(QN.Content,{children:/* @__PURE__ */Ee($O,{elementId:n,hostElementId:r,node:a,nodes:o,startTime:s,endTime:l,duration:c})})]})},ez=({time:e,message:t,params:n})=>(e=>void 0!==e.nodes)(n)?/* @__PURE__ */Ee(ZO,{time:e,message:t,params:n}):/* @__PURE__ */Ee(KO,{time:e,message:t,params:n}),tz=({elementId:e,startTime:t,endTime:n,duration:r})=>{let[i]=c("schema.flat"),a=ve(()=>e?s(i,e):void 0,[e,i]);/* @__PURE__ */
|
|
363
363
|
return Ie("div",{className:"m-2 flex justify-around gap-4",children:[
|
|
364
364
|
/* @__PURE__ */Ie("div",{className:"flex min-w-0 grow basis-0 flex-col gap-2",children:[/* @__PURE__ */Ie("div",{className:"flex items-center gap-1 font-bold",children:[/* @__PURE__ */Ee("i",{className:"fa-regular fa-clock"}),"Times"]}),/* @__PURE__ */Ie("div",{className:"flex flex-col",children:[
|
|
365
365
|
/* @__PURE__ */Ie("div",{className:"flex gap-1",children:[/* @__PURE__ */Ee("span",{children:"Started:"}),"string"==typeof t?t:R(t)]}),
|
|
@@ -399,8 +399,8 @@ return Ie("div",{className:"flex h-full grow basis-0 flex-col overflow-y-auto p-
|
|
|
399
399
|
/* @__PURE__ */Ie("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */Ee("span",{className:"text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Author"}),/* @__PURE__ */Ee("span",{className:"text-xs text-zinc-800 dark:text-zinc-200",children:i??"—"})]}),
|
|
400
400
|
/* @__PURE__ */Ie("div",{className:"flex flex-col gap-1",children:[/* @__PURE__ */Ee("span",{className:"text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Settings"}),o?/* @__PURE__ */Ee("pre",{className:"overflow-auto rounded bg-zinc-50 p-2 font-mono text-xs leading-5 dark:bg-zinc-800",dangerouslySetInnerHTML:{__html:o}}):/* @__PURE__ */Ee("span",{className:"text-xs text-zinc-400 italic dark:text-zinc-500",children:"No settings"})]})]})]})},kz=({name:e,label:t,id:n,isSelected:r,className:i,onSelect:a})=>{let o=he(()=>a?.(n),[a,n]);/* @__PURE__ */
|
|
401
401
|
return Ee("div",{className:vt("flex w-full cursor-pointer items-center gap-2 border-l-2 px-2 py-1.5 transition-colors",{"border-l-violet-500 bg-violet-50 text-violet-700 dark:border-l-violet-500 dark:bg-violet-500/15 dark:text-violet-300":r,"border-l-transparent text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:border-l-transparent dark:text-zinc-300 dark:hover:bg-zinc-800 dark:hover:text-zinc-100":!r},i),onClick:o,children:/* @__PURE__ */Ee("div",{className:"truncate",title:e,children:t??e})})},wz=({items:e=[],className:t,value:n,onSelect:r})=>{let[i,a]=we(""),o=ve(()=>e.filter(e=>(e.name??"").toLowerCase().includes(i.toLowerCase())),[e,i]),s=ve(()=>"string"==typeof n?e.find(e=>e.id===n):n,[n,e]),l=he(e=>a(e),[]),c=he(t=>r?.(e.find(e=>e.id===t)),[e,r]);/* @__PURE__ */
|
|
402
|
-
return Ie("div",{className:vt("flex h-full flex-col gap-2 border-r border-zinc-200 dark:border-zinc-700",t),children:[/* @__PURE__ */Ee("div",{className:"px-2 pt-2",children:/* @__PURE__ */Ee(qp,{value:i,onChange:l,placeholder:"Search...",size:"sm"})}),/* @__PURE__ */Ie("div",{className:"flex flex-col overflow-y-auto text-xs text-zinc-700 dark:text-zinc-300",children:[!o.length&&/* @__PURE__ */Ee("div",{className:"p-4 text-center text-zinc-400 dark:text-zinc-600",children:"No items"}),o.length>0&&o.map((e,t)=>/* @__PURE__ */Ee(kz,{label:e.label,name:e.name,isSelected:s?.id===e.id,id:e.id,onSelect:c},t))]})]})},Sz={"local-custom":"Shipped with this space",remote:"Installed"},Nz=({className:e})=>{let{plugins:t}=pe(TE),{components:n}=pe(
|
|
403
|
-
return Ie("div",{className:vt("flex h-full w-full",e),children:[/* @__PURE__ */Ee(wz,{className:"w-[240px]",items:r,value:i,onSelect:o}),i?/* @__PURE__ */Ee(xz,{entry:i}):/* @__PURE__ */Ie("div",{className:"flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-600",children:[/* @__PURE__ */Ee("i",{className:"fa-solid fa-puzzle-piece text-2xl opacity-30"}),/* @__PURE__ */Ee("span",{children:"Select a plugin"})]})]})},Tz="\0fn:",Cz=e=>{if("object"!=typeof e||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},Ez=e=>{if("function"==typeof e)return`${Tz}ƒ ${e.name||"anonymous"}()`;if((e=>Array.isArray(e))(e)){let t=e.map(Ez);return t.every((t,n)=>t===e[n])?e:t}if(!Cz(e))return e;let t={},n=!1;for(let[r,i]of Object.entries(e))t[r]=Ez(i),n||=t[r]!==i;return n?t:e},Iz=(e,{type:t,value:n})=>{if("value"!==t||"string"!=typeof n)return null;let r=(e=>e.startsWith(Tz)?e.slice(4):"")(n);return r?/* @__PURE__ */Ee("span",{className:"w-rjv-value text-violet-400 italic",children:r}):null},Oz=(e,t)=>{let{store:n,name:r,scopeId:i}=e;return r?n.scopePath?`${r} · ${n.scopePath}`:r:n.scopePath?n.scopePath:n.id?n.id:void 0===i?"root":((e,t)=>{if(!t)return;let n=Object.keys(e.getState()).filter(e=>!t.has(e));return n.length>0?`{ ${n.slice(0,4).join(", ")} }`:void 0})(n,t)??"scope"},zz=(e,t)=>t&&e.some(e=>e.uid===t)?t:(e.find(e=>void 0===e.scopeId)??e.at(0))?.uid,Az=/* @__PURE__ */new Set,_z=e=>(Az.add(e),()=>{Az.delete(e)}),Dz=()=>$I,Pz=()=>Se(_z,Dz,Dz),Rz=()=>Se(Ye,Xe,Xe),Mz=()=>{let e=Rz(),{instanceIds:t,selectedId:n}={instanceIds:Se(cO,uO,uO),selectedId:Se(cO,dO,dO)},r=Pz();return{options:ve(()=>((e,t,n)=>{let r=(e=>{let t=e.find(e=>void 0===e.scopeId);return t?new Set(Object.keys(t.store.getState())):void 0})(e);return t.map(t=>({label:t,options:e.filter(e=>e.scopeId===t||void 0===e.scopeId&&t===n).map(e=>({label:Oz(e,r),value:e.uid}))}))})(e,t,n),[e,t,n]),value:ve(()=>zz(e,r),[e,r]),onSelect:he(t=>{let n=e.find(e=>e.uid===t);n?.scopeId&&(e=>{FI!==e&&(FI=e,lO())})(n.scopeId),(e=>{$I!==e&&($I=e,(()=>{for(let e of Az)e()})())})(t)},[e])}},Lz={},jz=(e,t,n)=>{window.dispatchEvent(new CustomEvent("customstorage-changed",{detail:{key:e,oldValue:t,newValue:n}}))},Fz=()=>{let e={};if(typeof document>"u"||!document.cookie)return e;for(let t of document.cookie.split(";")){let n=t.indexOf("=");-1!==n&&(e[t.slice(0,n).trim()]=decodeURIComponent(t.slice(n+1).trim()))}return e},$z=e=>new Proxy(e,{get(e,t,n){if("setItem"===t)return(t,n)=>{let r=e.getItem(t);e.setItem.call(e,t,n),r!==n&&jz(t,r,n)};if("removeItem"===t)return t=>{let n=e.getItem(t);e.removeItem.call(e,t),null!==n&&jz(t,n,null)};let r=Reflect.get(e,t,n);return"function"==typeof r?r.bind(e):r}}),Vz=e=>"cookie"===e?typeof document<"u"?$z((()=>{let e={getItem(e){let t=Fz();return e in t?t[e]:null},setItem(e,t){typeof document>"u"||(document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=31536000; samesite=lax`)},removeItem(e){typeof document>"u"||(document.cookie=`${e}=; path=/; max-age=0; samesite=lax`)},clear(){for(let t of Object.keys(Fz()))e.removeItem(t)},key:e=>Object.keys(Fz())[e]??null,get length(){return Object.keys(Fz()).length}};return e})()):void 0:"sessionStorage"===e?typeof sessionStorage<"u"?$z(sessionStorage):void 0:typeof localStorage<"u"?$z(localStorage):void 0,qz=function(e,t,n="localStorage",r=!0){let[i,a]=ve(()=>{if(e.includes(".")){let t=e.split(".").filter(Boolean);return[t.shift(),t.join(".")]}return[e,""]},[e]),o=ke(Vz(n));Fp(()=>{o.current=Vz(n)},[n]);let[
|
|
402
|
+
return Ie("div",{className:vt("flex h-full flex-col gap-2 border-r border-zinc-200 dark:border-zinc-700",t),children:[/* @__PURE__ */Ee("div",{className:"px-2 pt-2",children:/* @__PURE__ */Ee(qp,{value:i,onChange:l,placeholder:"Search...",size:"sm"})}),/* @__PURE__ */Ie("div",{className:"flex flex-col overflow-y-auto text-xs text-zinc-700 dark:text-zinc-300",children:[!o.length&&/* @__PURE__ */Ee("div",{className:"p-4 text-center text-zinc-400 dark:text-zinc-600",children:"No items"}),o.length>0&&o.map((e,t)=>/* @__PURE__ */Ee(kz,{label:e.label,name:e.name,isSelected:s?.id===e.id,id:e.id,onSelect:c},t))]})]})},Sz={"local-custom":"Shipped with this space",remote:"Installed"},Nz=({className:e})=>{let{plugins:t}=pe(TE),{components:n}=pe(w),r=ve(()=>{let e=/* @__PURE__ */new Map;return Object.entries(n.current).forEach(([t,n])=>{let{origin:r}=n;("local-custom"===r||"remote"===r)&&e.set(t,{type:t,origin:r,version:n.version})}),Object.entries(t).forEach(([t,n])=>{let r=e.get(t),{manifest:i}=n;e.set(t,{type:t,origin:r?.origin??"remote",version:i.version||r?.version,author:i.author,settings:n.settings})}),[...e.values()].map(e=>({...e,id:e.type,name:e.type,label:/* @__PURE__ */Ie("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */Ee("span",{className:"capitalize",children:e.type}),/* @__PURE__ */Ee("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:e.version??Sz[e.origin]})]})}))},[t,n.current]),[i,a]=we(),o=he(e=>a(e),[]);/* @__PURE__ */
|
|
403
|
+
return Ie("div",{className:vt("flex h-full w-full",e),children:[/* @__PURE__ */Ee(wz,{className:"w-[240px]",items:r,value:i,onSelect:o}),i?/* @__PURE__ */Ee(xz,{entry:i}):/* @__PURE__ */Ie("div",{className:"flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-600",children:[/* @__PURE__ */Ee("i",{className:"fa-solid fa-puzzle-piece text-2xl opacity-30"}),/* @__PURE__ */Ee("span",{children:"Select a plugin"})]})]})},Tz="\0fn:",Cz=e=>{if("object"!=typeof e||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},Ez=e=>{if("function"==typeof e)return`${Tz}ƒ ${e.name||"anonymous"}()`;if((e=>Array.isArray(e))(e)){let t=e.map(Ez);return t.every((t,n)=>t===e[n])?e:t}if(!Cz(e))return e;let t={},n=!1;for(let[r,i]of Object.entries(e))t[r]=Ez(i),n||=t[r]!==i;return n?t:e},Iz=(e,{type:t,value:n})=>{if("value"!==t||"string"!=typeof n)return null;let r=(e=>e.startsWith(Tz)?e.slice(4):"")(n);return r?/* @__PURE__ */Ee("span",{className:"w-rjv-value text-violet-400 italic",children:r}):null},Oz=(e,t)=>{let{store:n,name:r,scopeId:i}=e;return r?n.scopePath?`${r} · ${n.scopePath}`:r:n.scopePath?n.scopePath:n.id?n.id:void 0===i?"root":((e,t)=>{if(!t)return;let n=Object.keys(e.getState()).filter(e=>!t.has(e));return n.length>0?`{ ${n.slice(0,4).join(", ")} }`:void 0})(n,t)??"scope"},zz=(e,t)=>t&&e.some(e=>e.uid===t)?t:(e.find(e=>void 0===e.scopeId)??e.at(0))?.uid,Az=/* @__PURE__ */new Set,_z=e=>(Az.add(e),()=>{Az.delete(e)}),Dz=()=>$I,Pz=()=>Se(_z,Dz,Dz),Rz=()=>Se(Ye,Xe,Xe),Mz=()=>{let e=Rz(),{instanceIds:t,selectedId:n}={instanceIds:Se(cO,uO,uO),selectedId:Se(cO,dO,dO)},r=Pz();return{options:ve(()=>((e,t,n)=>{let r=(e=>{let t=e.find(e=>void 0===e.scopeId);return t?new Set(Object.keys(t.store.getState())):void 0})(e);return t.map(t=>({label:t,options:e.filter(e=>e.scopeId===t||void 0===e.scopeId&&t===n).map(e=>({label:Oz(e,r),value:e.uid}))}))})(e,t,n),[e,t,n]),value:ve(()=>zz(e,r),[e,r]),onSelect:he(t=>{let n=e.find(e=>e.uid===t);n?.scopeId&&(e=>{FI!==e&&(FI=e,lO())})(n.scopeId),(e=>{$I!==e&&($I=e,(()=>{for(let e of Az)e()})())})(t)},[e])}},Lz={},jz=(e,t,n)=>{window.dispatchEvent(new CustomEvent("customstorage-changed",{detail:{key:e,oldValue:t,newValue:n}}))},Fz=()=>{let e={};if(typeof document>"u"||!document.cookie)return e;for(let t of document.cookie.split(";")){let n=t.indexOf("=");-1!==n&&(e[t.slice(0,n).trim()]=decodeURIComponent(t.slice(n+1).trim()))}return e},$z=e=>new Proxy(e,{get(e,t,n){if("setItem"===t)return(t,n)=>{let r=e.getItem(t);e.setItem.call(e,t,n),r!==n&&jz(t,r,n)};if("removeItem"===t)return t=>{let n=e.getItem(t);e.removeItem.call(e,t),null!==n&&jz(t,n,null)};let r=Reflect.get(e,t,n);return"function"==typeof r?r.bind(e):r}}),Vz=e=>"cookie"===e?typeof document<"u"?$z((()=>{let e={getItem(e){let t=Fz();return e in t?t[e]:null},setItem(e,t){typeof document>"u"||(document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=31536000; samesite=lax`)},removeItem(e){typeof document>"u"||(document.cookie=`${e}=; path=/; max-age=0; samesite=lax`)},clear(){for(let t of Object.keys(Fz()))e.removeItem(t)},key:e=>Object.keys(Fz())[e]??null,get length(){return Object.keys(Fz()).length}};return e})()):void 0:"sessionStorage"===e?typeof sessionStorage<"u"?$z(sessionStorage):void 0:typeof localStorage<"u"?$z(localStorage):void 0,qz=function(e,t,n="localStorage",r=!0){let[i,a]=ve(()=>{if(e.includes(".")){let t=e.split(".").filter(Boolean);return[t.shift(),t.join(".")]}return[e,""]},[e]),o=ke(Vz(n));Fp(()=>{o.current=Vz(n)},[n]);let[c,u]=we(()=>{try{if(!o.current)return t;let e=o.current.getItem(i);if(!e)return t;let n=JSON.parse(e);return a?s(n,a,t):n}catch{return t}});me(()=>{try{if(!o.current)return;let e=c;if(a){let t=o.current.getItem(i);e=J(t?JSON.parse(t):{},e=>{l(e,a,c)})}o.current.setItem(i,JSON.stringify(e))}catch(tR){}},[i,a,c]);let d=he(e=>{if(e.key===i)try{let n=e.newValue?JSON.parse(e.newValue):t;u(a?s(n,a,t):n)}catch{}},[i,a,t]),p=he(e=>{if(e.detail.key===i)try{let n=e.detail.newValue?JSON.parse(e.detail.newValue):t;u(a?s(n,a,t):n)}catch{}},[i,a,t]);return me(()=>{if(!(typeof window>"u")&&r)return window.addEventListener("storage",d),window.addEventListener("customstorage-changed",p),()=>{window.removeEventListener("storage",d),window.removeEventListener("customstorage-changed",p)}},[d,p,n,r]),[c,u]},Bz={},Uz=/*#__PURE__*/se(Bz),Hz=(e,t)=>bv({},e,t),Wz=/*#__PURE__*/se(()=>{});function Gz(){return fe(Wz)}Wz.displayName="JVR.DispatchShowTools";var Jz=e=>{var t=e.initial,n=e.dispatch,r=e.children;/*#__PURE__*/
|
|
404
404
|
return Ee(Uz.Provider,{value:t,children:/*#__PURE__*/Ee(Wz.Provider,{value:n,children:r})})};Jz.displayName="JVR.ShowTools";var Kz={},Qz=/*#__PURE__*/se(Kz),Yz=(e,t)=>bv({},e,t),Xz=()=>fe(Qz),Zz=/*#__PURE__*/se(()=>{});Zz.displayName="JVR.DispatchExpands";var eA=e=>{var t=e.initial,n=e.dispatch,r=e.children;/*#__PURE__*/
|
|
405
405
|
return Ee(Qz.Provider,{value:t,children:/*#__PURE__*/Ee(Zz.Provider,{value:n,children:r})})};eA.displayName="JVR.Expands";var tA={Str:{as:"span","data-type":"string",style:{color:"var(--w-rjv-type-string-color, #cb4b16)"},className:"w-rjv-type",children:"string"},Url:{as:"a",style:{color:"var(--w-rjv-type-url-color, #0969da)"},"data-type":"url",className:"w-rjv-type",children:"url"},Undefined:{style:{color:"var(--w-rjv-type-undefined-color, #586e75)"},as:"span","data-type":"undefined",className:"w-rjv-type",children:"undefined"},Null:{style:{color:"var(--w-rjv-type-null-color, #d33682)"},as:"span","data-type":"null",className:"w-rjv-type",children:"null"},Map:{style:{color:"var(--w-rjv-type-map-color, #268bd2)",marginRight:3},as:"span","data-type":"map",className:"w-rjv-type",children:"Map"},Nan:{style:{color:"var(--w-rjv-type-nan-color, #859900)"},as:"span","data-type":"nan",className:"w-rjv-type",children:"NaN"},Bigint:{style:{color:"var(--w-rjv-type-bigint-color, #268bd2)"},as:"span","data-type":"bigint",className:"w-rjv-type",children:"bigint"},Int:{style:{color:"var(--w-rjv-type-int-color, #268bd2)"},as:"span","data-type":"int",className:"w-rjv-type",children:"int"},Set:{style:{color:"var(--w-rjv-type-set-color, #268bd2)",marginRight:3},as:"span","data-type":"set",className:"w-rjv-type",children:"Set"},Float:{style:{color:"var(--w-rjv-type-float-color, #859900)"},as:"span","data-type":"float",className:"w-rjv-type",children:"float"},True:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},False:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},Date:{style:{color:"var(--w-rjv-type-date-color, #268bd2)"},as:"span","data-type":"date",className:"w-rjv-type",children:"date"}},nA=/*#__PURE__*/se(tA),rA=(e,t)=>bv({},e,t),iA=()=>fe(nA),aA=/*#__PURE__*/se(()=>{});function oA(e){var t=e.initial,n=e.dispatch,r=e.children;/*#__PURE__*/
|
|
406
406
|
return Ee(nA.Provider,{value:t,children:/*#__PURE__*/Ee(aA.Provider,{value:n,children:r})})}aA.displayName="JVR.DispatchTypes",oA.displayName="JVR.Types";var sA=["style"];function lA(e){var t=e.style,n=hv(e,sA),r=bv({cursor:"pointer",height:"1em",width:"1em",userSelect:"none",display:"inline-flex"},t);/*#__PURE__*/
|
|
@@ -451,7 +451,7 @@ return Ie(CA,{initialState:{value:a,objectSortKeys:N,indentWidth:d,shouldExpandN
|
|
|
451
451
|
return Ie("div",{className:"flex h-full w-full flex-col",children:[!e&&/* @__PURE__ */Ie("div",{className:"flex shrink-0 items-center gap-1 border-b border-zinc-200 px-2 py-1 text-[11px] dark:border-zinc-800",children:[
|
|
452
452
|
/* @__PURE__ */Ee("span",{className:"mr-1 text-zinc-400 dark:text-zinc-500",children:"View"}),
|
|
453
453
|
/* @__PURE__ */Ee("button",{className:xD("own"===i),onClick:s,title:"Only this scope's own layer",children:"Own"}),
|
|
454
|
-
/* @__PURE__ */Ee("button",{className:xD("merged"===i),onClick:l,title:"Own layer merged over the parent scope chain",children:"Merged"})]}),/* @__PURE__ */Ee(bD,{value:u??
|
|
454
|
+
/* @__PURE__ */Ee("button",{className:xD("merged"===i),onClick:l,title:"Own layer merged over the parent scope chain",children:"Merged"})]}),/* @__PURE__ */Ee(bD,{value:u??Y,style:"dark"===t?vD:void 0,enableClipboard:!1,indentWidth:15,collapsed:2,displayObjectSize:!1,displayDataTypes:!1,children:/* @__PURE__ */Ee(bD.String,{render:Iz})})]})},wD=(e,t,n)=>{if(0===e.commitId)return"ssr";let r=(e=>{let t=0,n=0;for(let r of e.elements)"mount"===r.phase?t+=1:n+=1;return t>0&&0===n?"mount":n>0&&0===t?"update":"mixed"})(e);return"mount"===r?t&&n?"hydration":"mount":r},SD={ssr:"SSR render (server)",hydration:"Hydration (SSR)",mount:"Mount",mixed:"Mount + update",update:"Update"},ND={ssr:"S",hydration:"H",mount:"M",mixed:"±",update:"·"},TD=[{origin:"ssr",label:"SSR"},{origin:"hydration",label:"Hydration"},{origin:"mount",label:"Mount"},{origin:"mixed",label:"Mount+update"},{origin:"update",label:"Update"}],CD=e=>e<.1?"<0.1ms":`${e.toFixed(1)}ms`,ED=e=>`${Math.round(100*e)}%`,ID=e=>e>=50?"bg-red-500":e>=16?"bg-amber-500":e>=8?"bg-emerald-500":"bg-sky-500",OD=[{color:"bg-sky-500",label:"<8ms"},{color:"bg-emerald-500",label:"8–16ms"},{color:"bg-amber-500",label:"16–50ms"},{color:"bg-red-500",label:"≥50ms"}],zD="bg-zinc-300 dark:bg-zinc-700",AD={backgroundImage:"repeating-linear-gradient(45deg, rgba(113,113,122,0.22) 0, rgba(113,113,122,0.22) 2px, transparent 2px, transparent 5px)"},_D=e=>"rendered"===e.state?ID(e.selfDuration):"bubbled"===e.state?zD:"bg-transparent",DD=e=>"bubbled"===e.state?"text-zinc-600 dark:text-zinc-300":"hatched"===e.state?"text-zinc-400 dark:text-zinc-600":"bg-amber-500"===ID(e.selfDuration)?"text-stone-900":"text-white",PD=(e,t)=>{let n=t?.[e];if(!n)return e;let{label:r,type:i}=n.definition;return r||i||e},RD=(e,t)=>t?.[e]?.definition.type??"unknown",MD=(e,t)=>{let n=s(t?.[e],"definition.initialState.visibility",!0);return!1!==n&&"false"!==n},LD=(e,t)=>"self"===t?e.selfDuration:e.actualDuration,jD=.01,FD=1e-6,$D=e=>{let t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map;for(let a of Object.keys(e))t.set(a,e[a].parentId),n.set(a,e[a].baseDuration),r.set(a,e[a].elementId);let i=/* @__PURE__ */new Map;for(let[a,o]of t)if(void 0!==o&&t.has(o)){let e=i.get(o);e?e.push(a):i.set(o,[a])}return{parent:t,base:n,children:i,elementOf:r}},VD=(e,t)=>{let{parent:n}=t,r=new Map(e.elements.map(e=>[e.id,e])),i=/* @__PURE__ */new Map;for(let o of e.elements)i.set(o.id,o.actualDuration);for(let o of e.elements){let e=n.get(o.id);for(;void 0!==e&&!r.has(e);)e=n.get(e);void 0!==e&&i.set(e,(i.get(e)??0)-o.actualDuration)}for(let[o,s]of i)s<0&&i.set(o,0);let a=/* @__PURE__ */new Set;for(let o of r.keys()){let e=o,t=n.get(o);for(;void 0!==t&&n.has(t);)e=t,t=n.get(t);a.add(e)}return{rendered:r,self:i,roots:[...a]}},qD=({commits:e,selectedIndex:t,hydrated:n,onSelect:r})=>{let i=ke(null),a=ve(()=>Math.max(1,...e.map(e=>e.duration)),[e]),o=ve(()=>e.find(e=>0!==e.commitId)?.commitId,[e]);me(()=>{i.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t]);let s=he(e=>()=>r(e),[r]),l=he(n=>{if("ArrowLeft"!==n.key&&"ArrowRight"!==n.key)return;n.preventDefault(),n.stopPropagation();let i=t+("ArrowLeft"===n.key?-1:1);i>=0&&i<e.length&&r(e[i].commitId)},[e,t,r]);/* @__PURE__ */
|
|
455
455
|
return Ie("div",{className:"flex shrink-0 flex-col border-b border-zinc-200 bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-900",children:[/* @__PURE__ */Ee("div",{role:"listbox","aria-label":"Commits, total render time","aria-orientation":"horizontal",tabIndex:0,onKeyDown:l,className:"flex h-20 items-end gap-1 overflow-x-auto px-2 pt-2 outline-none focus-visible:ring-1 focus-visible:ring-violet-400",children:e.map((e,r)=>{let l=r===t,c=0===e.commitId,u=c?100:Math.max(6,Math.round(e.duration/a*100)),d=wD(e,n,e.commitId===o),p=e.causes.slice(0,6).map(e=>e.path).join(", "),h=e.causes.length>6?" +"+(e.causes.length-6):"",f=e.causes.length>0?`\nCaused by ${p}${h}`:"";/* @__PURE__ */
|
|
456
456
|
return Ie("button",{ref:l?i:void 0,role:"option","aria-selected":l,onClick:s(e.commitId),title:c?`Commit #${e.commitId} · ${SD[d]} · no client timing · ${e.elementCount} elements`:`Commit #${e.commitId} · ${SD[d]} · ${CD(e.duration)} total · ${e.elementCount} elements${f}`,className:"flex h-full shrink-0 flex-col items-center justify-end gap-0.5 px-0.5",children:[/* @__PURE__ */Ee("div",{style:{height:`${u}%`},className:vt("w-3.5 rounded-sm transition-all",c?"bg-violet-400/40":ID(e.duration),{"border border-dashed border-violet-400/70":c,"opacity-100 ring-2 ring-violet-400":l,"opacity-40 hover:opacity-80":!l})}),/* @__PURE__ */Ee("span",{className:vt("text-[8px] leading-none font-semibold",{"text-violet-600 dark:text-violet-300":"ssr"===d||"hydration"===d,"text-zinc-500 dark:text-zinc-400":"mount"===d||"mixed"===d,"text-transparent":"update"===d}),children:ND[d]})]},e.commitId)})}),/* @__PURE__ */Ee("div",{className:"flex items-center gap-x-3 gap-y-0.5 overflow-x-auto px-2 pb-1 text-[9px] text-zinc-400 dark:text-zinc-500",children:TD.map(e=>/* @__PURE__ */Ie("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */Ee("span",{className:"font-semibold text-zinc-500 dark:text-zinc-300",children:ND[e.origin]}),e.label]},e.origin))})]})},BD=({commit:e,model:t,active:n,onSelectElement:r})=>{let i=t.nodes.filter(e=>e.trigger);if(0===i.length&&0===e.causes.length)return null;let a=i.slice(0,6),o=i.length-a.length,s=e.causes.slice(0,6),l=e.causes.length-s.length;/* @__PURE__ */
|
|
457
457
|
return Ie(Ce,{children:[i.length>0&&/* @__PURE__ */Ie("span",{className:"flex flex-wrap items-center gap-1",children:[
|
|
@@ -557,12 +557,12 @@ return Ie("button",{onClick:c(t.id),className:vt("flex cursor-pointer items-cent
|
|
|
557
557
|
/* @__PURE__ */Ee(fP,{iconClassName:"fa-solid fa-xmark",title:"Collapse to the indicator",onClick:r})]})]})},kP=({className:e,elementSelected:t,currentPageId:n,onSelectElement:r})=>{let[i,a]=we(!1),o=he(e=>{let{id:t}=e?.dataset??{};r(t)},[r]),s=ve(()=>yt(o,100),[o]),l=he(e=>{e.target.closest(".plitzi-sdk")&&s(e.target.closest("[data-id]"))},[s]),c=he(e=>{e.target.closest(".plitzi-sdk")&&(e.stopPropagation(),e.preventDefault(),a(!1))},[]),u=he(e=>{e.stopPropagation(),e.preventDefault(),a(!0)},[a]),d=he(()=>{a(!1),r(n)},[n,r]),p=he(()=>{a(!1),r("")},[r]);return me(()=>{if(typeof document>"u")return;let e=document.querySelectorAll(`[data-id="${t}"]`);return e.forEach(e=>e.classList.add("devtools-element-hovered")),()=>{e.forEach(e=>e.classList.remove("devtools-element-hovered"))}},[t]),me(()=>{if(!i||typeof document>"u")return;let e=document.getElementsByClassName("plitzi-sdk")[0];return e?(e.addEventListener("click",c),e.addEventListener("mousemove",l),()=>{e.removeEventListener("click",c),e.removeEventListener("mousemove",l)}):void 0},[c,l,i]),/* @__PURE__ */Ie("div",{className:vt("flex shrink-0 items-center justify-between gap-2 border-b border-zinc-200 bg-zinc-50 px-2 py-1 dark:border-zinc-700 dark:bg-zinc-800",e),children:[/* @__PURE__ */Ie("div",{className:"flex gap-1",children:[/* @__PURE__ */Ee(fP,{iconClassName:"fa-regular fa-hand-pointer",title:"Select an element in the page to inspect it",onClick:u,isSelected:i}),/* @__PURE__ */Ee(fP,{iconClassName:"fa-regular fa-file",title:"Current Page",onClick:d,isSelected:t===n})]}),/* @__PURE__ */Ee(fP,{iconClassName:"fa-solid fa-ban",onClick:p,title:"Clear",isSelected:!!t})]})},wP=({className:e,orientation:t="vertical",tabSelected:n,logTypeFilter:r,onCollapse:i,onTabSelect:a,onChangeOrientation:o})=>{let[s,l]=qz("plitzi-sdk.dev-tools.size",{width:500,height:200}),[u]=c("navigation.currentPageId"),[d,p]=we(),h=ve(()=>"vertical"===t?["w"]:["n"],[t]),f=ke(typeof document<"u"?document.querySelector(".plitzi-sdk"):null),m=he(e=>p(e),[p]),g=he((e,t)=>l(n=>({width:Number.isFinite(e)?e:n.width,height:Number.isFinite(t)?t:n.height})),[l]);/* @__PURE__ */
|
|
558
558
|
return Ee(ZN,{className:vt("component__container-resizable-sidebar relative z-[1000000] text-xs",e,{"h-full":"vertical"===t}),minConstraintsX:"vertical"===t?500:1/0,maxConstraintsX:"vertical"===t?1e3:1/0,minConstraintsY:"vertical"===t?1/0:34,maxConstraintsY:"vertical"===t?1/0:600,width:"vertical"===t?s.width:1/0,height:"vertical"===t?1/0:s.height,resizeHandles:h,parentRef:f,autoGrow:!1,onChange:g,children:/* @__PURE__ */Ie("div",{className:"flex h-full w-full flex-col bg-white text-zinc-800 dark:bg-zinc-900 dark:text-zinc-200",children:[
|
|
559
559
|
/* @__PURE__ */Ee(xP,{orientation:t,onChangeOrientation:o,onCollapse:i,onTabSelect:a,tabSelected:n}),["store","elements"].includes(n)&&/* @__PURE__ */Ee(kP,{elementSelected:d,onSelectElement:m,currentPageId:u}),
|
|
560
|
-
/* @__PURE__ */Ee(hP,{orientation:t,tabSelected:n,logTypeFilter:r,elementSelected:d,onSelectElement:m})]})})},SP=({className:e,collapsed:t,orientation:n,tabSelected:r,logTypeFilter:i,onOpen:a,onCollapse:o,onTabSelect:s,onChangeOrientation:l})=>/* @__PURE__ */Ie(Ce,{children:[t&&/* @__PURE__ */Ee(pO,{className:e,onOpen:a}),!t&&/* @__PURE__ */Ee(wP,{className:e,orientation:n,tabSelected:r,logTypeFilter:i,onCollapse:o,onTabSelect:s,onChangeOrientation:l})]}),NP=({children:e})=>{let[t,n]=we([]),[r,i]=we({}),a=ke(!1),o=he((e,t,r,i,a)=>{n(n=>[...n,{logType:e,category:t,message:r,time:a,params:i}])},[n]),s=he((e,t)=>i(n=>({...n,[e]:t})),[]),
|
|
561
|
-
return Ee(Wp,{value:
|
|
562
|
-
/* @__PURE__ */Ee("b",{children:t}),", leaving unresolved tokens"]}),{param:t,value:n}),n}return n>=5||"object"!=typeof e||!e?e:Array.isArray(e)?e.map(e=>o(e,t,n+1)):Object.fromEntries(Object.entries(e).map(([e,r])=>[e,o(r,t,n+1)]))};return Object.keys(t).reduce((n,r)=>{let i="trigger"===e?t[r]:o(t[r],r,0);return{...n,[r]:i}},{})},jP=async(e,t={},n={},r={},i={})=>{let a={},o=[],{id:
|
|
563
|
-
/* @__PURE__ */Ee("b",{children:
|
|
564
|
-
/* @__PURE__ */Ee("b",{children:`${
|
|
565
|
-
/* @__PURE__ */Ee("b",{children:`${e.title} [${e.action}]`}),i?/* @__PURE__ */Ie(Ce,{children:[" on ",/* @__PURE__ */Ee("b",{children:i})]}):null]}),l={status:r,node:e,elementId:e.elementId,hostElementId:i,nodes:{...n,[e.id]:{node:e,status:o,result:void 0,postCallbacks:[],startTime:t,endTime:a}},startTime:t,endTime:a};"failed"!==r?Gp.info("interactions",s,l):Gp.danger("interactions",s,l)},VP=zP,qP=class e{eventBridge;parentManager;childManagers;interactionsData;subscriptors;callbacksAvailables;interactionsRunning;lastUpdate;listeners=/* @__PURE__ */new Set;constructor(e="",t={},n={}){this.eventBridge=new VP,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
|
|
560
|
+
/* @__PURE__ */Ee(hP,{orientation:t,tabSelected:n,logTypeFilter:r,elementSelected:d,onSelectElement:m})]})})},SP=({className:e,collapsed:t,orientation:n,tabSelected:r,logTypeFilter:i,onOpen:a,onCollapse:o,onTabSelect:s,onChangeOrientation:l})=>/* @__PURE__ */Ie(Ce,{children:[t&&/* @__PURE__ */Ee(pO,{className:e,onOpen:a}),!t&&/* @__PURE__ */Ee(wP,{className:e,orientation:n,tabSelected:r,logTypeFilter:i,onCollapse:o,onTabSelect:s,onChangeOrientation:l})]}),NP=({children:e})=>{let[t,n]=we([]),[r,i]=we({}),a=ke(!1),o=he((e,t,r,i,a)=>{n(n=>[...n,{logType:e,category:t,message:r,time:a,params:i}])},[n]),s=he((e,t)=>i(n=>({...n,[e]:t})),[]),l=he(e=>i(t=>X(t,[e])),[]),c=he((e,...t)=>{if(e&&"function"==typeof r[e])return r[e](...t)},[r]),u=he(()=>n([]),[]);a.current||=(Gp.setCallback(o),Gp.setCallbackAddProvider(s),Gp.setCallbackRemoveProvider(l),!0),me(()=>(Gp.setCallback(o),Gp.setCallbackAddProvider(s),Gp.setCallbackRemoveProvider(l),Gp.processPendingLogs(),()=>{Gp.setCallback(void 0),Gp.setCallbackAddProvider(void 0),Gp.setCallbackRemoveProvider(void 0),Gp.flush()}),[o,s,l]);let d=ve(()=>({providers:r,logs:t,setLogs:n,clearLogs:u,getData:c}),[r,t,n,u,c]);/* @__PURE__ */
|
|
561
|
+
return Ee(Wp,{value:d,children:e})},TP=()=>()=>{},CP="horizontal",EP=0,IP=({children:e,className:t,innerClassName:n,enabled:r=!1,instanceId:i,renderMode:a="default",devToolsStyle:o="",devToolsStyleLink:s=""})=>{let{resolvedTheme:l}=Ch(),[c,d]=qz("plitzi-sdk.dev-tools.orientation",CP),[p,h]=qz("plitzi-sdk.dev-tools.collapsed",!0),[f,m]=qz("plitzi-sdk.dev-tools.tab","logs"),[g,y]=we(),b=ke(void 0);b.current||="sdk-instance-"+ ++EP;let v=i||b.current,x=Se(TP,()=>!0,()=>!1),k=x?c:CP,w=((e,t)=>{me(()=>{if(t)return(e=>(aO.push(e),void 0===FI&&(FI=e),lO(),()=>{let t=aO.indexOf(e);-1!==t&&aO.splice(t,1),FI===e&&(FI=aO[0]),lO()}))(e)},[t,e]);let n=Se(cO,dO,dO);return t&&n===e})(v,r);(e=>{let t=fe(u);me(()=>{if(e&&!W&&t)return Qe(t)},[e,t])})(r);let S=he(e=>d(e),[d]),N=he(e=>{e&&m("logs"),y(e),h(!1)},[h,m]),T=he(()=>h(!0),[h]),C=he(e=>{y(void 0),m(e)},[m]);return r?/* @__PURE__ */Ie("div",{className:vt("relative flex grow overflow-auto",{"flex-col":"horizontal"===k,"h-screen":"vertical"===k},t),children:[/* @__PURE__ */Ee(at,{value:v,children:/* @__PURE__ */Ee("div",{className:vt("grow basis-0 flex-col overflow-auto",n),children:e})}),w&&x&&/* @__PURE__ */Ie(NP,{children:["default"===a&&/* @__PURE__ */Ee(SP,{className:vt({dark:"dark"===l}),collapsed:p,orientation:k,tabSelected:f,logTypeFilter:g,onOpen:N,onCollapse:T,onTabSelect:C,onChangeOrientation:S}),"shadow"===a&&/* @__PURE__ */Ie(DI,{children:[s&&/* @__PURE__ */Ee(DI.Link,{href:s}),/* @__PURE__ */Ie(DI.Content,{children:[/* @__PURE__ */Ee("style",{dangerouslySetInnerHTML:{__html:o}}),/* @__PURE__ */Ee(SP,{className:vt({dark:"dark"===l}),collapsed:p,orientation:k,tabSelected:f,logTypeFilter:g,onOpen:N,onCollapse:T,onTabSelect:C,onChangeOrientation:S})]})]})]})]}):e},OP=({children:e})=>{let{environment:t}=Pe(),[[n,r,i,a,o,l]]=c(["schema.variables","navigation.routeParams","navigation.queryParams","navigation.hostname","navigation.origin","navigation.currentPageId"]),u=ve(()=>Hp(n,{routeParams:r,queryParams:i,hostname:a,environment:t}),[t,a,i,r,n]),d=he(()=>_(u).map(e=>({path:e,name:`variables.${e}`})),[u]);Up({id:"global",source:"variables",name:"Variables",fields:d}),v("runtime.sources.variables",u);let[p={}]=c("pageDefinitions"),h=ve(()=>Object.values(p).map(e=>({value:e.id,label:s(e,"attributes.name",e.id)})),[p]),f=ve(()=>({routeParams:r,queryParams:i,origin:o,currentPageId:l}),[r,i,o,l]),m=he(()=>[..._({routeParams:r,queryParams:i}).map(e=>({path:e,name:`navigation.${e}`})),{path:"origin",name:"Origin"},h.length>0?{path:"currentPageId",name:"Current Page",inputType:"select",values:h}:{path:"currentPageId",name:"Current Page"}],[r,i,h]);Up({id:"global",source:"navigation",name:"Navigation",fields:m}),v("runtime.sources.navigation",f);let{user:g,authenticated:y}=pe(bE),[b="basic"]=c("schema.settings.userProvider"),x=ve(()=>""===b?{}:{isAuthenticated:y,accessToken:g?.accessToken??"",details:{username:"",email:"",roles:"",permissions:"",verified:"",...g?.details??{}}},[b,g,y]),k=he(()=>_(x).map(e=>({path:e,name:`user.${e}`})),[x]);Up({id:"global",source:"auth",name:"Auth State",fields:k}),v("runtime.sources.auth",x);let[w]=c("runtime.state"),S=he(()=>_(w).map(e=>({path:e,name:`state.${e}`})),[w]);Up({id:"global",source:"state",name:"State",fields:S}),v("runtime.sources.state",w);let[N]=c("runtime.host"),T=he(()=>_(N).map(e=>({path:e,name:`host.${e}`})),[N]);Up({id:"global",source:"host",name:"Host",fields:T}),v("runtime.sources.host",N);let{theme:C,resolvedTheme:E}=Ch("canvas"),I=ve(()=>({mode:C,resolved:E}),[C,E]),O=he(()=>_(I).map(e=>({path:e,name:`theme.${e}`})),[I]);return Up({id:"global",source:"theme",name:"Theme",fields:O}),v("runtime.sources.theme",I),e},zP=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&&Gp.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)}}},AP=({children:e,debugMode:t,onInit:n})=>{let r=ve(()=>new zP({debugMode:t}),[t]);me(()=>()=>{r.clear()},[r]);let i=ve(()=>({eventBridge:r}),[r]);return me(()=>{n?.(i)},[n,i]),/* @__PURE__ */Ee(j,{value:i,children:e})},_P=({id:e,interactions:t,triggers:n,callbacks:r,getAdditionalParams:i})=>{let{interactionsManager:a}=pe(zE);me(()=>{if(e)return a.subscribe(e,t,n,r,i),()=>{a.unsubscribe(e)}},[e,t,n,r,i,a])},DP={action:"delayTime",title:"Delay Time",type:"utility",params:{time:{label:"Time (Milliseconds)",type:"text"}},preview:{},callback:({time:e})=>new Promise(t=>{setTimeout(t,e)})},PP={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($(t,e));if(n&&"object"==typeof n)return{template:"",content:_(n).reduce((e,t)=>({...e,[t]:""}),{})}}catch{}return{template:"",content:""}},callback:e=>{let{template:t,returnMode:n}=e,r="";try{r=$(t,e)}catch(tR){}if("jsonObject"===n)try{return{content:JSON.parse(r)}}catch(tR){}else if("json"===n)try{return JSON.parse(r),{content:r}}catch{return{content:""}}return{content:r}}},RP={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={"Content-Type":"application/json"};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={method:a,headers:e,credentials:i};if(a&&!["get","delete"].includes(a.toLowerCase()))if("application/json"===e["Content-Type"])s.body=JSON.stringify(r);else if("multipart/form-data"===e["Content-Type"]){let e=new FormData;Object.entries(r).forEach(([t,n])=>{e?.append(t,n)}),s.body=e}let l=await fetch(t,s),c="";try{c=await l.json()}catch{}o={status:l.status,data:c}}catch(e){}return{response:o}}},MP={delayTime:DP,twigTemplate:PP,webHook:RP},LP=(e,t,n,r,i)=>{if("utility"===e&&"twigTemplate"===i)return t;let a={...n,...r},o=(e,t,n)=>{if("string"==typeof e){let n=e,r=5;for(;"string"==typeof n&&b(n)&&r>0;)n=$(n,a,!1,!0),r--;return"string"==typeof n&&b(n)&&Gp.warning("interactions",/* @__PURE__ */Ie("span",{children:["Twig token resolution exceeded ",5," passes for ",
|
|
562
|
+
/* @__PURE__ */Ee("b",{children:t}),", leaving unresolved tokens"]}),{param:t,value:n}),n}return n>=5||"object"!=typeof e||!e?e:Array.isArray(e)?e.map(e=>o(e,t,n+1)):Object.fromEntries(Object.entries(e).map(([e,r])=>[e,o(r,t,n+1)]))};return Object.keys(t).reduce((n,r)=>{let i="trigger"===e?t[r]:o(t[r],r,0);return{...n,[r]:i}},{})},jP=async(e,t={},n={},r={},i={})=>{let a={},o=[],{id:l,action:c,enabled:u,params:d,elementId:p,type:h,when:f}=e;if(!c||!u)return{status:"disabled",result:a,postCallbacks:o};let m={...r,...n,[l]:d};if(f&&!V(f,m))return{status:"skipped",result:a,postCallbacks:o,whenParams:m};let g={...n,...r,...LP(h,d,n,r,c)};try{switch(h){case"callback":case"globalCallback":{if(!p)return Gp.warning("interactions",/* @__PURE__ */Ie("span",{children:["Step ",
|
|
563
|
+
/* @__PURE__ */Ee("b",{children:c})," names no element, so there is nothing to run it on"]}),{node:e}),{status:"failed",result:a,postCallbacks:o,whenParams:m};let n=s(t,`${p}.${c}`);if(!n)return Gp.warning("interactions",/* @__PURE__ */Ie("span",{children:["Nothing is registered as ",
|
|
564
|
+
/* @__PURE__ */Ee("b",{children:`${p}.${c}`}),", so this step did nothing"]}),{node:e,available:Object.keys(s(t,p,{}))}),{status:"failed",result:a,postCallbacks:o,whenParams:m};let{callback:r,postCallback:u}=n;r&&(a=await r(g,i)),u&&o.push({id:l,callback:u,params:{...g,[l]:a}});break}case"utility":{let{callback:e,postCallback:t}=s(MP,c,{});e&&(a=await e(g,i)),t&&o.push({id:l,callback:t,params:{...g,[l]:a}});break}}}catch(tR){return Gp.danger("interactions",/* @__PURE__ */Ie("span",{children:["Interaction node failed ",/* @__PURE__ */Ee("b",{children:c})]}),{error:tR instanceof Error?tR.message:String(tR),node:e}),{status:"failed",result:a,postCallbacks:o,whenParams:m}}return{status:"success",result:a,postCallbacks:o,whenParams:m}},FP=async(e,t={},n={},r={},i={},a=[],o={},l={})=>{if(!e)return o;let c=s(t,e.afterNode);if(!c&&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?.(X(r,[e]),r[e]))})),t})(a),!c)return o;let u=Gp.getTime().valueOf(),{status:d,result:p,postCallbacks:h,whenParams:f}=await jP(c,n,r,i,l);return o[c.id]={node:c,status:d,result:p,postCallbacks:h,whenParams:f,startTime:u,endTime:Gp.getTime().valueOf()},a.push(...h),FP(c,t,n,{...r,[c.id]:p},i,a,o,l)},$P=(e,t,n={},r,i)=>{let a=Gp.getTime().valueOf(),o="skipped"===r?"skipped":"success",s=/* @__PURE__ */Ie("span",{children:["Interaction triggered ",
|
|
565
|
+
/* @__PURE__ */Ee("b",{children:`${e.title} [${e.action}]`}),i?/* @__PURE__ */Ie(Ce,{children:[" on ",/* @__PURE__ */Ee("b",{children:i})]}):null]}),l={status:r,node:e,elementId:e.elementId,hostElementId:i,nodes:{...n,[e.id]:{node:e,status:o,result:void 0,postCallbacks:[],startTime:t,endTime:a}},startTime:t,endTime:a};"failed"!==r?Gp.info("interactions",s,l):Gp.danger("interactions",s,l)},VP=zP,qP=class e{eventBridge;parentManager;childManagers;interactionsData;subscriptors;callbacksAvailables;interactionsRunning;lastUpdate;listeners=/* @__PURE__ */new Set;constructor(e="",t={},n={}){this.eventBridge=new VP,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&&!s(this.interactionsRunning,`${t}.${n}`)){l(this.interactionsRunning,`${t}.${n}`,!0);try{let i,a=s(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(n=>(async(e,t={},n={},r={},i={},a,o=[])=>{let s=Gp.getTime().valueOf(),{action:l,enabled:c,when:u}=e;if(!l||!c||u&&!V(u,{...i,...r}))return void $P(e,s,{},"skipped",a);let d=await FP(e,t,n,r,i,o,{},{hostElementId:a});$P(e,s,d,(e=>Object.values(e).some(({status:e})=>"failed"===e)?"failed":"completed")(d),a)})(n,e,this.getCallbacksAvailables(),{[n.id]:r},{...this.interactionsData,...i},t)))}finally{l(this.interactionsRunning,`${t}.${n}`,!1)}}};subscribe(e,t={},n={},r={},i){if(!e||this.subscriptors[e])return!1;l(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=s(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)}},BP=({children:e,currentPageId:t,routeParams:n,queryParams:r})=>{let i=ve(()=>new qP(t,n,r),[]);i.interactionsData=ve(()=>({currentPageId:t,...n,...r}),[t,n,r]);let a=ve(()=>({interactionsManager:i,useInteractions:_P}),[i]);/* @__PURE__ */
|
|
566
566
|
return Ee(zE,{value:a,children:e})},UP={runServerAction:{source:"actions",title:"Run Server Action",strictParams:!0,params:{actionId:{type:"text",description:"Identifier of the server action to run, as the space publishes it.",default:"",required:!0,label:"Action"},input:{type:"text",description:"The values passed to the action, as a JSON object. The server drops every key the action did not declare. Authoring in code, pass a real object rather than a line of JSON text — an interpolated value containing a quote or a newline makes the text unparseable, and unparseable input posts nothing.",default:"{}",builderType:"codemirror-json",label:"Input"},mode:{type:"select",description:"await waits and puts the result in the flow scope; detached carries on immediately and leaves nothing to read; stream reports progress as it goes.",default:"await",options:["await","detached","stream"],optionLabels:{await:"Wait for the result",detached:"Send and continue",stream:"Stream progress"}},idempotencyKey:{type:"text",description:"Makes a repeat of the same intent answer with the first run instead of running again.",default:"",when:e=>"detached"!==e.mode}},preview:{runId:"",status:"",output:{}}},cancelServerAction:{source:"actions",title:"Cancel Server Action",strictParams:!0,params:{runId:{type:"text",description:"The run to cancel — normally `{{ <step>.output.runId }}` from the step that started it.",default:""}},preview:{cancelled:""}}},HP={status:"failed",reason:"failed",runId:"",output:{}},WP=(e,t)=>e.signal.aborted?{status:"aborted",error:"Cancelled"}:{status:"failed",error:t instanceof Error?t.message:String(t)},GP=(e,t,n)=>{if(401!==e)return;let r=It(e,t);r&&Ct({reason:r,url:n})},JP=({children:e})=>{let{useInteractions:t,interactionsManager:n}=pe(zE),[r]=c("actions.endpoint"),[[i,a]]=c(["actions.catalog","actions.available"]),o=he((e,t,r)=>{e&&n.interactionTrigger(e,t,r)},[n]),s=he(async(e,t)=>{let{actionId:n,mode:i="await",idempotencyKey:a}=e;if(!r)return Gp.warning("actions",/* @__PURE__ */Ie("span",{children:["Server action ",
|
|
567
567
|
/* @__PURE__ */Ee("b",{children:n})," was skipped: this page is served without a Plitzi server"]}),{actionId:n,status:"skipped"}),{status:"skipped",runId:"",output:{}};if(!n)return{status:"skipped",runId:"",output:{}};let s=(e=>{if(!e)return{};if("object"==typeof e)return e;try{let t=JSON.parse(e);return"object"==typeof t&&t?t:{}}catch{return{}}})(e.input),l=JSON.stringify({actionId:n,input:s,...a?{idempotencyKey:a}:{}}),c=(e=>{let t=`run-${et+=1}`;return tt([{...e,id:t,status:"running",startedAt:Date.now(),progress:[],cancellable:!0},...Ze.getState().runs].slice(0,100)),t})({actionId:n,mode:i,input:s}),u=new AbortController,d="";(e=>{nt.set(e,()=>{u.abort(),rt(c,{status:"aborted",endedAt:Date.now(),cancellable:!1}),d&&fetch(`${r}/run/${d}`,{method:"DELETE",credentials:"same-origin"}).catch(()=>{})})})(c);let p,h=e=>{(e=>{nt.delete(e)})(c),rt(c,{endedAt:Date.now(),cancellable:!1,...e})};if("detached"===i)return Gp.info("actions",/* @__PURE__ */Ie("span",{children:["Server action ",
|
|
568
568
|
/* @__PURE__ */Ee("b",{children:n})," sent"]}),{actionId:n,mode:i,status:"accepted"}),fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",keepalive:!0,signal:u.signal,body:l}).then(async e=>{let a=await e.json().catch(()=>({}));if(!e.ok)return GP(e.status,a,r),h({status:"failed",...a.runId?{runId:a.runId}:{},...a.reason?{reason:a.reason}:{},...a.error?{error:a.error}:{}}),void o(t?.hostElementId,"onFlowError",{actionId:n,runId:a.runId??"",error:a.error??"",reason:a.reason??"failed"});h({status:"completed"===a.status?"completed":"accepted",...a.runId?{runId:a.runId}:{},...a.output?{output:a.output}:{},...a.trace?{trace:a.trace}:{}}),Gp.success("actions",/* @__PURE__ */Ie("span",{children:["Server action ",
|
|
@@ -573,9 +573,9 @@ return Ee(zE,{value:a,children:e})},UP={runServerAction:{source:"actions",title:
|
|
|
573
573
|
/* @__PURE__ */Ee("b",{children:n})," stopped mid-stream"]}),{actionId:n,mode:i,runId:s,error:r}),o(t?.hostElementId,"onFlowError",{actionId:n,runId:s,error:r,reason:"failed"})}),{accepted:!0,status:"streaming",runId:s,output:{}}}try{p=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",signal:u.signal,body:l})}catch(e){return h(WP(u,e)),Gp.warning("interactions",/* @__PURE__ */Ie("span",{children:["Server action ",
|
|
574
574
|
/* @__PURE__ */Ee("b",{children:n})," could not be reached"]}),{actionId:n,error:e instanceof Error?e.message:String(e)}),o(t?.hostElementId,"onFlowError",{actionId:n,runId:"",error:"",reason:"failed"}),HP}let f=await p.json().catch(()=>({}));return p.ok?(h({status:"completed"===f.status?"completed":"failed",...f.runId?{runId:f.runId}:{},...f.output?{output:f.output}:{},...f.trace?{trace:f.trace}:{}}),{status:f.status??"completed",runId:f.runId??"",output:f.output??{}}):(GP(p.status,f,r),h({status:"failed",...f.runId?{runId:f.runId}:{},...f.reason?{reason:f.reason}:{},...f.error?{error:f.error}:{}}),Gp.warning("actions",/* @__PURE__ */Ie("span",{children:["Server action ",
|
|
575
575
|
/* @__PURE__ */Ee("b",{children:n})," was refused"]}),{actionId:n,mode:i,runId:f.runId,reason:f.reason,error:f.error,status:String(p.status)}),{status:"failed",reason:f.reason??"failed",runId:f.runId??"",output:{}})},[r,o]),l=he(async e=>{if(!r||!e.runId)return{cancelled:!1};try{let t=204===(await fetch(`${r}/run/${e.runId}`,{method:"DELETE",credentials:"same-origin"})).status;return Gp.info("actions",/* @__PURE__ */Ie("span",{children:["Server action run ",
|
|
576
|
-
/* @__PURE__ */Ee("b",{children:e.runId})," ",t?"cancelled":"was not cancelled"]}),{actionId:"",mode:"cancel",runId:e.runId,status:t?"aborted":"failed"}),{cancelled:t}}catch{return{cancelled:!1}}},[r]),u=ve(()=>(i??[]).map(e=>({label:`${e.name} (${e.identifier})`,value:e.identifier})),[i]);return t({id:"actions",callbacks:ve(()=>ef(UP,{cancelServerAction:l,runServerAction:s},{runServerAction:{params:e=>{let t=Xh(UP.runServerAction.params),n=(i??[]).find(t=>t.identifier===e.actionId),r=Object.entries(n?.input??{});return{...t,actionId:{...t.actionId,type:()=>u.length>0?"select":"text",canBind:!0,label:!1===a?"Action — this space has no server to run it":"Action",options:u},input:{...t.input,canBind:!0,label:r.length>0?`Input — ${r.map(([e,t])=>`${e}${t.required?"*":""}: ${t.type}`).join(", ")}`:"Input"}}}}}),[s,l,u,i,a])}),e},KP={login:{source:"auth",title:"Auth Login",strictParams:!0,params:{mode:{type:"select",description:"Credentials to sign in with: a username and password, or a token obtained elsewhere.",default:"normal",options:["normal","token"],optionLabels:{normal:"User and Password",token:"Token"},canBind:!1},username:{type:"text",description:"Username.",default:"",when:e=>"normal"===e.mode},password:{type:"text",description:"Password.",default:"",when:e=>"normal"===e.mode},token:{type:"text",description:"A token to exchange for a session.",default:"",when:e=>"token"===e.mode}},preview:{ok:"",reason:"",errors:{username:"",password:"",token:""},accessToken:"",expiresAt:"",refreshToken:""}},refreshDetails:{source:"auth",title:"Auth Refresh Details",strictParams:!0,params:{},preview:{errors:"",accessToken:"",expiresAt:"",refreshToken:""}},logout:{source:"auth",title:"Auth Logout",strictParams:!0,params:{}}},QP=({children:e,authProvider:t="basic"})=>{let{login:n,refresh:r,logout:i}=pe(bE),{useInteractions:a}=pe(zE),o=he(e=>n(e),[n]),s=he(e=>r(e),[r]),l=he(()=>i(),[i]);return a({id:"auth",callbacks:ve(()=>""===t?{}:ef(KP,{login:o,refreshDetails:s,logout:l}),[o,l,s,t])}),e},YP={hostAction:{source:"host",title:"Host Action",strictParams:!0,params:{action:{type:"text",description:"The name the host registered the handler under — `openSpace`, `signOut`, whatever it offers.",default:""},value:{type:"scalar",description:"What the action is about: the space to open, the workspace to switch to. Optional.",default:""}}}},XP=({children:e,actions:t})=>{let{useInteractions:n}=pe(zE),r=he(e=>{let{action:n,value:r}=e,i=n?t?.[n]:void 0;i&&i({...e,value:r})},[t]);return n({id:"host",callbacks:ve(()=>ef(YP,{hostAction:r}),[r])}),e},ZP={navigate:{source:"navigation",title:"Navigate",strictParams:!0,params:{urlType:{type:"select",description:"Target kind: a space page, an internal space path, or an external URL.",options:["page","internal","external"],optionLabels:{page:"Space Page",internal:"Inside Space",external:"Outside Space"}},url:{type:"text",description:'Destination — a page id when urlType is "page", otherwise a URL/path.',when:e=>!!e.urlType,builderType:e=>"page"===e.urlType?"select":"text"}}}},eR=({children:e,previewMode:t=!1})=>{let{useInteractions:n}=pe(zE),[[r,i,a]]=F(["schema.pages","pageDefinitions","navigation.navigate"]),o=ve(()=>{let e=mt(i,r);return Object.keys(e).reduce((t,n)=>{let r=e[n];return[...t,{key:n,label
|
|
576
|
+
/* @__PURE__ */Ee("b",{children:e.runId})," ",t?"cancelled":"was not cancelled"]}),{actionId:"",mode:"cancel",runId:e.runId,status:t?"aborted":"failed"}),{cancelled:t}}catch{return{cancelled:!1}}},[r]),u=ve(()=>(i??[]).map(e=>({label:`${e.name} (${e.identifier})`,value:e.identifier})),[i]);return t({id:"actions",callbacks:ve(()=>ef(UP,{cancelServerAction:l,runServerAction:s},{runServerAction:{params:e=>{let t=Xh(UP.runServerAction.params),n=(i??[]).find(t=>t.identifier===e.actionId),r=Object.entries(n?.input??{});return{...t,actionId:{...t.actionId,type:()=>u.length>0?"select":"text",canBind:!0,label:!1===a?"Action — this space has no server to run it":"Action",options:u},input:{...t.input,canBind:!0,label:r.length>0?`Input — ${r.map(([e,t])=>`${e}${t.required?"*":""}: ${t.type}`).join(", ")}`:"Input"}}}}}),[s,l,u,i,a])}),e},KP={login:{source:"auth",title:"Auth Login",strictParams:!0,params:{mode:{type:"select",description:"Credentials to sign in with: a username and password, or a token obtained elsewhere.",default:"normal",options:["normal","token"],optionLabels:{normal:"User and Password",token:"Token"},canBind:!1},username:{type:"text",description:"Username.",default:"",when:e=>"normal"===e.mode},password:{type:"text",description:"Password.",default:"",when:e=>"normal"===e.mode},token:{type:"text",description:"A token to exchange for a session.",default:"",when:e=>"token"===e.mode}},preview:{ok:"",reason:"",errors:{username:"",password:"",token:""},accessToken:"",expiresAt:"",refreshToken:""}},refreshDetails:{source:"auth",title:"Auth Refresh Details",strictParams:!0,params:{},preview:{errors:"",accessToken:"",expiresAt:"",refreshToken:""}},logout:{source:"auth",title:"Auth Logout",strictParams:!0,params:{}}},QP=({children:e,authProvider:t="basic"})=>{let{login:n,refresh:r,logout:i}=pe(bE),{useInteractions:a}=pe(zE),o=he(e=>n(e),[n]),s=he(e=>r(e),[r]),l=he(()=>i(),[i]);return a({id:"auth",callbacks:ve(()=>""===t?{}:ef(KP,{login:o,refreshDetails:s,logout:l}),[o,l,s,t])}),e},YP={hostAction:{source:"host",title:"Host Action",strictParams:!0,params:{action:{type:"text",description:"The name the host registered the handler under — `openSpace`, `signOut`, whatever it offers.",default:""},value:{type:"scalar",description:"What the action is about: the space to open, the workspace to switch to. Optional.",default:""}}}},XP=({children:e,actions:t})=>{let{useInteractions:n}=pe(zE),r=he(e=>{let{action:n,value:r}=e,i=n?t?.[n]:void 0;i&&i({...e,value:r})},[t]);return n({id:"host",callbacks:ve(()=>ef(YP,{hostAction:r}),[r])}),e},ZP={navigate:{source:"navigation",title:"Navigate",strictParams:!0,params:{urlType:{type:"select",description:"Target kind: a space page, an internal space path, or an external URL.",options:["page","internal","external"],optionLabels:{page:"Space Page",internal:"Inside Space",external:"Outside Space"}},url:{type:"text",description:'Destination — a page id when urlType is "page", otherwise a URL/path.',when:e=>!!e.urlType,builderType:e=>"page"===e.urlType?"select":"text"}}}},eR=({children:e,previewMode:t=!1})=>{let{useInteractions:n}=pe(zE),[[r,i,a]]=F(["schema.pages","pageDefinitions","navigation.navigate"]),o=ve(()=>{let e=mt(i,r);return Object.keys(e).reduce((t,n)=>{let r=e[n];return[...t,{key:n,label:s(r,"attributes.name",n),defaultPage:s(r,"attributes.default",!1)}]},[])},[i,r]),l=he(e=>{if(!t)return;let{url:n,urlType:r}=e;"page"===r||"internal"===r?a(n):a(n,!0)},[a,t]);return n({id:"navigation",callbacks:ve(()=>{let{urlType:e,url:t}=Xh(ZP.navigate.params);return ef(ZP,{navigate:l},{navigate:{params:{urlType:e,url:{...t,defaultValue:o.find(e=>e.defaultPage)?.key??"",options:o.map(e=>({value:e.key,label:e.label}))}}}})},[l,o])}),e},tR={setState:{source:"state",title:"Set State",strictParams:!0,params:{key:{type:"text",description:"The state key/path to set. Stored under `runtime.state.<key>`.",default:""},type:{type:"select",description:'The value type. What is stored is coerced to it — a boolean is a real boolean, not "true".',options:["boolean","number","text"],optionLabels:{boolean:"True / False",number:"Numeric",text:"Text"}},value:{type:"scalar",description:"The value to store — its type follows the `type` param (a real boolean/number, or text).",when:e=>!!e.type,builderType:e=>"boolean"===e.type?"select":"text",options:["true","false"]}}},toggleState:{source:"state",title:"Toggle State",strictParams:!0,params:{key:{type:"text",description:"The state key/path to flip, under `runtime.state.<key>`. Anything not already true is treated as false, so a key that has never been set toggles to true.",default:""}}},appendState:{source:"state",title:"Append To State",strictParams:!0,params:{key:{type:"text",description:"The state key/path holding the list, under `runtime.state.<key>`. Created if it is not there.",default:""},value:{type:"scalar",description:"What to add to the end of the list.",default:""},unique:{type:"boolean",description:"Skip the append when the list already holds this value. For a list whose entries are their own identity — anything referring to one refers to it by value, so a second copy is indistinguishable.",default:!1},withId:{type:"boolean",description:"Store the entry as `{ id, value }` with an id of its own, so two entries that read the same are still two entries. Anything reading one back names `.value`; anything referring to one names `.id`.",default:!1}}},removeState:{source:"state",title:"Remove From State",strictParams:!0,params:{key:{type:"text",description:"The state key/path holding the list, under `runtime.state.<key>`.",default:""},value:{type:"scalar",description:"The entry to drop, by value — every copy of it. Prefer this wherever the list can change under the person: a position is only true until something before it moves.",default:""},by:{type:"text",description:"The FIELD carrying the identity, for a list of records rather than of scalars — `id` for entries appended with `withId`. Without it the whole entry is compared, which never matches a record.",default:""},index:{type:"text",description:"Which entry to drop, by position, when there is no value to go on. Inside a controlled list, `{{ <listSource>.index }}` is the row own position. An index that resolves to nothing removes nothing.",default:""}}},moveState:{source:"state",title:"Move Between Lists",strictParams:!0,params:{from:{type:"text",description:"The list to take it out of, under `runtime.state.<key>`.",default:""},to:{type:"text",description:"The list to put it into. It is not added twice.",default:""},value:{type:"scalar",description:"The entry to move. Absent from `from` means nothing happens.",default:""}}},toggleInState:{source:"state",title:"Toggle In List",strictParams:!0,params:{key:{type:"text",description:"The list to add to or drop from, under `runtime.state.<key>`.",default:""},value:{type:"scalar",description:"The entry the box stands for.",default:""}}},clearState:{source:"state",title:"Clear State",strictParams:!0,params:{key:{type:"text",description:"The list to empty, under `runtime.state.<key>`. Left blank it empties EVERYTHING the space is keeping — which on a page that holds notes beside a list means losing the notes to clear the list.",default:""}}}},nR=0,rR=({children:e})=>{let{useInteractions:t}=pe(zE),n=y(),r=he(e=>{let{key:t,type:r}=e,{value:i}=e;"boolean"===r?i=!0===i||"true"===i:"number"===r&&(i=parseInt(i,10)),n(`runtime.state.${t}`,i)},[n]),i=he(e=>{let{key:t}=e;t&&n(`runtime.state.${t}`,e=>!0!==e&&"true"!==e)},[n]),a=e=>!0===e||"true"===e,o=he(e=>{let{key:t,value:r,unique:i,withId:o}=e;t&&n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return a(o)?[...t,{id:typeof crypto<"u"&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`e${++nR}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,value:r}]:a(i)&&t.includes(r)?t:[...t,r]})},[n]),s=he(e=>{let{key:t,index:r,value:i,by:a}=e;if(!t)return;if(void 0!==i&&""!==i)return void n(`runtime.state.${t}`,e=>Array.isArray(e)?e.filter(e=>a?e?.[a]!==i:e!==i):[]);let o="number"==typeof r?r:parseInt(r??"",10);Number.isNaN(o)||n(`runtime.state.${t}`,e=>Array.isArray(e)?e.filter((e,t)=>t!==o):[])},[n]),l=he(e=>{let{from:t,to:r,value:i}=e;if(!t||!r||void 0===i||""===i)return;let a={moved:!1};n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return a.moved=t.includes(i),a.moved?t.filter(e=>e!==i):t}),a.moved&&n(`runtime.state.${r}`,e=>{let t=Array.isArray(e)?e:[];return t.includes(i)?t:[...t,i]})},[n]),c=he(e=>{let{key:t,value:r}=e;t&&void 0!==r&&""!==r&&n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return t.includes(r)?t.filter(e=>e!==r):[...t,r]})},[n]),u=he(e=>{let{key:t}=e;n(t?`runtime.state.${t}`:"runtime.state",t?[]:{})},[n]);return t({id:"state",callbacks:ve(()=>ef(tR,{setState:r,toggleState:i,appendState:o,removeState:s,moveState:l,toggleInState:c,clearState:u}),[r,i,o,s,l,c,u])}),e},iR=({children:e,hostActions:t})=>{let[[n="basic",r,i,a]]=F(["schema.settings.userProvider","navigation.routeParams","navigation.queryParams","navigation.currentPageId"]),{previewMode:o}=Pe();/* @__PURE__ */
|
|
577
577
|
return Ee(BP,{currentPageId:a,routeParams:r,queryParams:i,children:/* @__PURE__ */Ee(QP,{authProvider:n,children:/* @__PURE__ */Ee(rR,{children:/* @__PURE__ */Ee(JP,{children:/* @__PURE__ */Ee(eR,{previewMode:o,children:/* @__PURE__ */Ee(XP,{actions:t,children:e})})})})})})},aR=se({});aR.displayName="StyleContext";var oR,sR,lR=({children:e,style:t})=>{let{style:n}=pe(ch),r=ve(()=>({}),[]);return i("style",t??(n||Qp)),/* @__PURE__ */Ee(aR,{value:r,children:e})},cR="/plitzi-sdk.css",uR=({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:d,renderMode:h=De.renderMode,sdkStylePath:f="./plitzi-sdk.css",sdkDevToolsStylePath:m,previewMode:g=!0,debugMode:y=!1,overQuota:b=!1,analytics:v,onInitEventBridge:x,hostData:k,hostActions:w,onInitStateManager:S,...N})=>{const T=pe(u),[C,E]=we(!o);me(()=>E(!0),[]),p(["render.previewMode","render.debugMode","render.renderMode","render.environment","render.isHydrating","render.hydrated","render.overQuota"],[g,y,h,r,o,C,b]),p(["runtime.host"],[k]);const I=ve(()=>T?.withBase("runtime.state"),[T]),O=ve(()=>({get state(){return I?.getState()??{}},setState:e=>I?.setState(void 0,e),setStateByKey:(e,t)=>I?.setState(e,t),clearState:()=>I?.setState(void 0,{})}),[I]);return me(()=>{S?.(O)},[S,O]),/* @__PURE__ */Ee(NE,{webKey:t,webId:n,instanceId:d,server:a,offlineMode:s,offlineData:l,offlineDataType:c,revision:e,children:/* @__PURE__ */Ee(EE,{children:/* @__PURE__ */Ee(CE,{sdkStylePath:cR,children:/* @__PURE__ */Ee(lR,{children:/* @__PURE__ */Ee(AP,{onInit:x,debugMode:y,children:/* @__PURE__ */Ee(qI,{children:/* @__PURE__ */Ee(iO,{server:a,children:/* @__PURE__ */Ie(xE,{currentPageId:i,children:[/* @__PURE__ */Ee(yE,{analytics:v}),/* @__PURE__ */Ee(OP,{children:/* @__PURE__ */Ee(iR,{hostActions:w,children:/* @__PURE__ */Ee(IP,{enabled:y,instanceId:d,devToolsStyleLink:m||"/plitzi-sdk-devtools.css",renderMode:"shadow",innerClassName:vt({flex:"iframe"===h}),children:/* @__PURE__ */Ee(VI,{sdkStylePath:cR,server:a,...N})})})})]})})})})})})})})},dR=({className:e,scoped:t=!1,children:n})=>{const{theme:r}=Ch();/* @__PURE__ */
|
|
578
|
-
return Ee(OE,{className:vt(e,t&&"system"!==r&&r),children:n})},pR=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}),hR={Button:Pp,ContentEditable:_f,Input:Vp,Heading:LN,ContainerResizable:YN,ContainerCollapsable:KN,Text:lT,Markdown:Nw,ContainerTabs:iT},fR=({className:e="min-h-screen",children:t,webKey:n="",server:r,renderMode:i=De.renderMode,routing:a="browser",debugMode:o=!1,themeScope:
|
|
579
|
-
return Ee(ct,{value:
|
|
578
|
+
return Ee(OE,{className:vt(e,t&&"system"!==r&&r),children:n})},pR=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}),hR={Button:Pp,ContentEditable:_f,Input:Vp,Heading:LN,ContainerResizable:YN,ContainerCollapsable:KN,Text:lT,Markdown:Nw,ContainerTabs:iT},fR=({className:e="min-h-screen",children:t,webKey:n="",server:r,renderMode:i=De.renderMode,routing:a="browser",debugMode:o=!1,themeScope:l="document",theme:c,state:u,...d})=>{const p=ve(()=>M(n,!0),[n]),h=ke(u).current,f=ve(()=>({segments:{},runtime:{sources:{},state:h??{}},render:De}),[h]),m=ve(()=>(e=>{let t=e?.split(":")[1];return t?`plitzi_debug_${t}`:"plitzi_debug"})("undefined"==typeof window?void 0:window.location.host),[]),[g,y]=we(()=>(e=>{if("undefined"==typeof document)return!0;for(const t of document.cookie.split(";")){const n=t.indexOf("=");if(-1!==n&&t.slice(0,n).trim()===e)return"false"!==decodeURIComponent(t.slice(n+1).trim())}return!0})(m)),b=o&&g,v=ve(()=>pR(r),[r]),x=ve(()=>((e,t)=>{const n=new zu({uri:e.serverUrl}),r=new Fc,i=new dE(e=>({headers:{...e.headers,"sdk-version":"0.35.2",authorization:t?`Bearer ${t}`:""}}));return new bu({link:i.concat($u(e.serverUrl),new Nl((e,t)=>new ji(n=>{let r=t(e).subscribe({next:e=>{n.next(e.data?{...e,data:rd(e.data)}:e)},error:e=>n.error(e),complete:()=>n.complete()});return()=>{r.unsubscribe()}})),n),cache:r})})(v,n),[v,n]);me(()=>{},[]);const k=he(()=>{const e=!g;((e,t)=>{"undefined"!=typeof document&&(document.cookie=`${e}=${JSON.stringify(t)}; path=/; max-age=31536000; samesite=lax`)})(m,e),y(e)},[m,g]);(({authorized:e,onToggle:t})=>{const n=he(e=>{var n;e.shiftKey&&"F12"===e.key?t():!e.shiftKey||!e.altKey||"KeyD"!==e.code||(n=e.target)instanceof HTMLElement&&(n.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(n.tagName))||(e.preventDefault(),t())},[t]);me(()=>{if(e)return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,n])})({authorized:o,onToggle:k}),me(()=>{},[o,g,m]),me(()=>{d.isHydrating&&B.setHydrated()},[d.isHydrating]);const w=ve(()=>{const e={};return ie.forEach(t,t=>{if(!ue(t))return;if(t.type!==RI)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&&v.requestUrl;const S="widget"===i?ae:"undefined"==typeof window?sE:"memory"===a?zC:eE,N="widget"===i?{}:{..."memory"===a&&"undefined"!=typeof window?{}:{basename:s(v,"basePath","/"),location:"undefined"==typeof window?v.requestUrl??"":void 0}};/* @__PURE__ */
|
|
579
|
+
return Ee(ct,{value:f,middlewares:[Ve(Jp("sdk")),Fh(p),...b?[()=>({onChange:e=>B.recordStoreChange(e)}),je({shouldRecord:e=>!e?.startsWith("runtime.elements")&&!e?.startsWith("rsc")&&!e?.startsWith("theme")})]:[]],children:/* @__PURE__ */Ee(Th,{defaultTheme:"system",scope:l,theme:c,children:/* @__PURE__ */Ee(sT,{components:hR,children:/* @__PURE__ */Ee(dR,{scoped:"container"===l,className:vt("plitzi-sdk flex",e,{"sdk-debug-mode":b}),children:/* @__PURE__ */Ee(GS,{children:/* @__PURE__ */Ee(S,{...N,children:/* @__PURE__ */Ee(BN,{client:x,children:/* @__PURE__ */Ee(FN,{localCustomComponents:w,localComponents:gR,children:/* @__PURE__ */Ee(uR,{server:v,webKey:n,renderMode:i,debugMode:b,webId:p,...d})})})})})})})})})},mR=K(({ref:e,className:t,spaceKey:n,environment:r="main"})=>{const{settings:{previewMode:i},contexts:{NetworkContext:a}}=U(),{server:o}=pe(a);/* @__PURE__ */
|
|
580
580
|
return Ee(cf,{ref:e,className:vt("plitzi-component__plitzi-sdk",t,{"with__plitzi-sdk":!i}),children:n&&/* @__PURE__ */Ee(fR,{webKey:n,environment:r,renderMode:"widget",server:o,className:"h-full w-full"})})}),gR={plitziSdk:Object.assign(mR,{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__ */Ee($N,{})},defaultStyle:{name:"Plitzi Sdk",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}})};function yR(e,t={},n={},r=!1,i=!1){const a=(e=>{if(e.analytics||e.offlineMode||!e.webKey)return e;const{apiServer:t}=pR(e.server);return t?{...e,analytics:{endpoint:`${t.replace(/\/+$/,"")}/v1/collect`,key:e.webKey}}:e})(t),o=a.debugMode??r,s=({isHydrating:e=!1})=>{const[t,r]=we(!e);me(()=>r(!0),[]);const i=Object.keys(n).filter(e=>t||!n[e].clientOnly);o||(()=>{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 s=he(e=>{oR=e},[]),l=he(e=>{sR=e},[]);/* @__PURE__ */
|
|
581
|
-
return Ee(fR,{...a,debugMode:o,isHydrating:e,onInitStateManager:s,onInitEventBridge:l,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */Ee(VI.Plugin,{renderType:e,component:n[e].component,...n[e].props},e))})},l="undefined"!=typeof document?document.getElementById(e):void 0;if(!l)return;const c=i?Te(l,/* @__PURE__ */Ee(s,{isHydrating:!0})):Ne(l);return i||c.render(/* @__PURE__ */Ee(s,{})),{unmount:()=>c.unmount()}}Promise.resolve({ });var bR=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a=De.renderMode,...o})=>/* @__PURE__ */Ee(fR,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});bR.Plugin=VI.Plugin;var vR=U,xR="0.
|
|
581
|
+
return Ee(fR,{...a,debugMode:o,isHydrating:e,onInitStateManager:s,onInitEventBridge:l,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */Ee(VI.Plugin,{renderType:e,component:n[e].component,...n[e].props},e))})},l="undefined"!=typeof document?document.getElementById(e):void 0;if(!l)return;const c=i?Te(l,/* @__PURE__ */Ee(s,{isHydrating:!0})):Ne(l);return i||c.render(/* @__PURE__ */Ee(s,{})),{unmount:()=>c.unmount()}}Promise.resolve({ });var bR=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a=De.renderMode,...o})=>/* @__PURE__ */Ee(fR,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});bR.Plugin=VI.Plugin;var vR=U,xR="0.35.2",kR=()=>oR,wR=()=>sR;export{w as ComponentContext,FN as ComponentProvider,hf as JsxManager,A as PlitziServiceProvider,wf as PluginManager,L as PluginRemote,gN as ReplicaProvider,cf as RootElement,bR as default,wR as getEventBridge,kR as getStateManager,$h as n,yR as render,gR as sdkComponents,uf as t,gE as track,Wh as useElement,vR as usePlitziServiceContext,Gh as useRscData,jh as useRscRefresh,F as useStore,xR as version,K as withElement};
|