@shiftengineering/folio 0.0.79 → 0.0.80

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.
@@ -1,4 +1,4 @@
1
- (function(F,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],j):(F=typeof globalThis<"u"?globalThis:F||self,j(F.FolioEmbedComponent={},F.React))})(this,function(F,j){"use strict";var ut,ct,lt,ft,dt,mt;function Vt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const $t=Vt(j);var le={exports:{}},Y={};/**
1
+ (function(F,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],C):(F=typeof globalThis<"u"?globalThis:F||self,C(F.FolioEmbedComponent={},F.React))})(this,function(F,C){"use strict";var ct,lt,ft,dt,mt,pt;function $t(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const zt=$t(C);var le={exports:{}},Y={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var je;function zt(){if(je)return Y;je=1;var e=j,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(l,a,f){var m,p={},h=null,w=null;f!==void 0&&(h=""+f),a.key!==void 0&&(h=""+a.key),a.ref!==void 0&&(w=a.ref);for(m in a)n.call(a,m)&&!s.hasOwnProperty(m)&&(p[m]=a[m]);if(l&&l.defaultProps)for(m in a=l.defaultProps,a)p[m]===void 0&&(p[m]=a[m]);return{$$typeof:t,type:l,key:h,ref:w,props:p,_owner:i.current}}return Y.Fragment=r,Y.jsx=u,Y.jsxs=u,Y}var H={};/**
9
+ */var Ce;function Mt(){if(Ce)return Y;Ce=1;var e=C,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(l,a,f){var m,p={},h=null,w=null;f!==void 0&&(h=""+f),a.key!==void 0&&(h=""+a.key),a.ref!==void 0&&(w=a.ref);for(m in a)n.call(a,m)&&!s.hasOwnProperty(m)&&(p[m]=a[m]);if(l&&l.defaultProps)for(m in a=l.defaultProps,a)p[m]===void 0&&(p[m]=a[m]);return{$$typeof:t,type:l,key:h,ref:w,props:p,_owner:i.current}}return Y.Fragment=r,Y.jsx=u,Y.jsxs=u,Y}var H={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,21 +14,21 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Ce;function Mt(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var e=j,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),x=Symbol.iterator,P="@@iterator";function W(o){if(o===null||typeof o!="object")return null;var c=x&&o[x]||o[P];return typeof c=="function"?c:null}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(o){{for(var c=arguments.length,d=new Array(c>1?c-1:0),y=1;y<c;y++)d[y-1]=arguments[y];yn("error",o,d)}}function yn(o,c,d){{var y=A.ReactDebugCurrentFrame,E=y.getStackAddendum();E!==""&&(c+="%s",d=d.concat([E]));var R=d.map(function(v){return String(v)});R.unshift("Warning: "+c),Function.prototype.apply.call(console[o],console,R)}}var hn=!1,gn=!1,bn=!1,wn=!1,vn=!1,pt;pt=Symbol.for("react.module.reference");function En(o){return!!(typeof o=="string"||typeof o=="function"||o===n||o===s||vn||o===i||o===f||o===m||wn||o===w||hn||gn||bn||typeof o=="object"&&o!==null&&(o.$$typeof===h||o.$$typeof===p||o.$$typeof===u||o.$$typeof===l||o.$$typeof===a||o.$$typeof===pt||o.getModuleId!==void 0))}function Pn(o,c,d){var y=o.displayName;if(y)return y;var E=c.displayName||c.name||"";return E!==""?d+"("+E+")":d}function yt(o){return o.displayName||"Context"}function U(o){if(o==null)return null;if(typeof o.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case m:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case l:var c=o;return yt(c)+".Consumer";case u:var d=o;return yt(d._context)+".Provider";case a:return Pn(o,o.render,"ForwardRef");case p:var y=o.displayName||null;return y!==null?y:U(o.type)||"Memo";case h:{var E=o,R=E._payload,v=E._init;try{return U(v(R))}catch{return null}}}return null}var V=Object.assign,ee=0,ht,gt,bt,wt,vt,Et,Pt;function Rt(){}Rt.__reactDisabledLog=!0;function Rn(){{if(ee===0){ht=console.log,gt=console.info,bt=console.warn,wt=console.error,vt=console.group,Et=console.groupCollapsed,Pt=console.groupEnd;var o={configurable:!0,enumerable:!0,value:Rt,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}ee++}}function Tn(){{if(ee--,ee===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},o,{value:ht}),info:V({},o,{value:gt}),warn:V({},o,{value:bt}),error:V({},o,{value:wt}),group:V({},o,{value:vt}),groupCollapsed:V({},o,{value:Et}),groupEnd:V({},o,{value:Pt})})}ee<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Pe=A.ReactCurrentDispatcher,Re;function se(o,c,d){{if(Re===void 0)try{throw Error()}catch(E){var y=E.stack.trim().match(/\n( *(at )?)/);Re=y&&y[1]||""}return`
18
- `+Re+o}}var Te=!1,ae;{var On=typeof WeakMap=="function"?WeakMap:Map;ae=new On}function Tt(o,c){if(!o||Te)return"";{var d=ae.get(o);if(d!==void 0)return d}var y;Te=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var R;R=Pe.current,Pe.current=null,Rn();try{if(c){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(k){y=k}Reflect.construct(o,[],v)}else{try{v.call()}catch(k){y=k}o.call(v.prototype)}}else{try{throw Error()}catch(k){y=k}o()}}catch(k){if(k&&y&&typeof k.stack=="string"){for(var g=k.stack.split(`
19
- `),_=y.stack.split(`
20
- `),T=g.length-1,O=_.length-1;T>=1&&O>=0&&g[T]!==_[O];)O--;for(;T>=1&&O>=0;T--,O--)if(g[T]!==_[O]){if(T!==1||O!==1)do if(T--,O--,O<0||g[T]!==_[O]){var C=`
21
- `+g[T].replace(" at new "," at ");return o.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",o.displayName)),typeof o=="function"&&ae.set(o,C),C}while(T>=1&&O>=0);break}}}finally{Te=!1,Pe.current=R,Tn(),Error.prepareStackTrace=E}var K=o?o.displayName||o.name:"",$=K?se(K):"";return typeof o=="function"&&ae.set(o,$),$}function Sn(o,c,d){return Tt(o,!1)}function xn(o){var c=o.prototype;return!!(c&&c.isReactComponent)}function ue(o,c,d){if(o==null)return"";if(typeof o=="function")return Tt(o,xn(o));if(typeof o=="string")return se(o);switch(o){case f:return se("Suspense");case m:return se("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case a:return Sn(o.render);case p:return ue(o.type,c,d);case h:{var y=o,E=y._payload,R=y._init;try{return ue(R(E),c,d)}catch{}}}return""}var te=Object.prototype.hasOwnProperty,Ot={},St=A.ReactDebugCurrentFrame;function ce(o){if(o){var c=o._owner,d=ue(o.type,o._source,c?c.type:null);St.setExtraStackFrame(d)}else St.setExtraStackFrame(null)}function _n(o,c,d,y,E){{var R=Function.call.bind(te);for(var v in o)if(R(o,v)){var g=void 0;try{if(typeof o[v]!="function"){var _=Error((y||"React class")+": "+d+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw _.name="Invariant Violation",_}g=o[v](c,v,y,d,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(T){g=T}g&&!(g instanceof Error)&&(ce(E),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",y||"React class",d,v,typeof g),ce(null)),g instanceof Error&&!(g.message in Ot)&&(Ot[g.message]=!0,ce(E),S("Failed %s type: %s",d,g.message),ce(null))}}}var kn=Array.isArray;function Oe(o){return kn(o)}function jn(o){{var c=typeof Symbol=="function"&&Symbol.toStringTag,d=c&&o[Symbol.toStringTag]||o.constructor.name||"Object";return d}}function Cn(o){try{return xt(o),!1}catch{return!0}}function xt(o){return""+o}function _t(o){if(Cn(o))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jn(o)),xt(o)}var kt=A.ReactCurrentOwner,An={key:!0,ref:!0,__self:!0,__source:!0},jt,Ct;function In(o){if(te.call(o,"ref")){var c=Object.getOwnPropertyDescriptor(o,"ref").get;if(c&&c.isReactWarning)return!1}return o.ref!==void 0}function Fn(o){if(te.call(o,"key")){var c=Object.getOwnPropertyDescriptor(o,"key").get;if(c&&c.isReactWarning)return!1}return o.key!==void 0}function Dn(o,c){typeof o.ref=="string"&&kt.current}function Nn(o,c){{var d=function(){jt||(jt=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",c))};d.isReactWarning=!0,Object.defineProperty(o,"key",{get:d,configurable:!0})}}function Un(o,c){{var d=function(){Ct||(Ct=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",c))};d.isReactWarning=!0,Object.defineProperty(o,"ref",{get:d,configurable:!0})}}var Ln=function(o,c,d,y,E,R,v){var g={$$typeof:t,type:o,key:c,ref:d,props:v,_owner:R};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:y}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function Vn(o,c,d,y,E){{var R,v={},g=null,_=null;d!==void 0&&(_t(d),g=""+d),Fn(c)&&(_t(c.key),g=""+c.key),In(c)&&(_=c.ref,Dn(c,E));for(R in c)te.call(c,R)&&!An.hasOwnProperty(R)&&(v[R]=c[R]);if(o&&o.defaultProps){var T=o.defaultProps;for(R in T)v[R]===void 0&&(v[R]=T[R])}if(g||_){var O=typeof o=="function"?o.displayName||o.name||"Unknown":o;g&&Nn(v,O),_&&Un(v,O)}return Ln(o,g,_,E,y,kt.current,v)}}var Se=A.ReactCurrentOwner,At=A.ReactDebugCurrentFrame;function B(o){if(o){var c=o._owner,d=ue(o.type,o._source,c?c.type:null);At.setExtraStackFrame(d)}else At.setExtraStackFrame(null)}var xe;xe=!1;function _e(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function It(){{if(Se.current){var o=U(Se.current.type);if(o)return`
17
+ */var je;function qt(){return je||(je=1,process.env.NODE_ENV!=="production"&&function(){var e=C,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),_=Symbol.iterator,P="@@iterator";function W(o){if(o===null||typeof o!="object")return null;var c=_&&o[_]||o[P];return typeof c=="function"?c:null}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(o){{for(var c=arguments.length,d=new Array(c>1?c-1:0),y=1;y<c;y++)d[y-1]=arguments[y];hn("error",o,d)}}function hn(o,c,d){{var y=A.ReactDebugCurrentFrame,E=y.getStackAddendum();E!==""&&(c+="%s",d=d.concat([E]));var R=d.map(function(v){return String(v)});R.unshift("Warning: "+c),Function.prototype.apply.call(console[o],console,R)}}var gn=!1,bn=!1,wn=!1,vn=!1,En=!1,yt;yt=Symbol.for("react.module.reference");function Pn(o){return!!(typeof o=="string"||typeof o=="function"||o===n||o===s||En||o===i||o===f||o===m||vn||o===w||gn||bn||wn||typeof o=="object"&&o!==null&&(o.$$typeof===h||o.$$typeof===p||o.$$typeof===u||o.$$typeof===l||o.$$typeof===a||o.$$typeof===yt||o.getModuleId!==void 0))}function Rn(o,c,d){var y=o.displayName;if(y)return y;var E=c.displayName||c.name||"";return E!==""?d+"("+E+")":d}function ht(o){return o.displayName||"Context"}function U(o){if(o==null)return null;if(typeof o.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case m:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case l:var c=o;return ht(c)+".Consumer";case u:var d=o;return ht(d._context)+".Provider";case a:return Rn(o,o.render,"ForwardRef");case p:var y=o.displayName||null;return y!==null?y:U(o.type)||"Memo";case h:{var E=o,R=E._payload,v=E._init;try{return U(v(R))}catch{return null}}}return null}var V=Object.assign,ee=0,gt,bt,wt,vt,Et,Pt,Rt;function Ot(){}Ot.__reactDisabledLog=!0;function On(){{if(ee===0){gt=console.log,bt=console.info,wt=console.warn,vt=console.error,Et=console.group,Pt=console.groupCollapsed,Rt=console.groupEnd;var o={configurable:!0,enumerable:!0,value:Ot,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}ee++}}function Tn(){{if(ee--,ee===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},o,{value:gt}),info:V({},o,{value:bt}),warn:V({},o,{value:wt}),error:V({},o,{value:vt}),group:V({},o,{value:Et}),groupCollapsed:V({},o,{value:Pt}),groupEnd:V({},o,{value:Rt})})}ee<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Pe=A.ReactCurrentDispatcher,Re;function se(o,c,d){{if(Re===void 0)try{throw Error()}catch(E){var y=E.stack.trim().match(/\n( *(at )?)/);Re=y&&y[1]||""}return`
18
+ `+Re+o}}var Oe=!1,ae;{var Sn=typeof WeakMap=="function"?WeakMap:Map;ae=new Sn}function Tt(o,c){if(!o||Oe)return"";{var d=ae.get(o);if(d!==void 0)return d}var y;Oe=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var R;R=Pe.current,Pe.current=null,On();try{if(c){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(k){y=k}Reflect.construct(o,[],v)}else{try{v.call()}catch(k){y=k}o.call(v.prototype)}}else{try{throw Error()}catch(k){y=k}o()}}catch(k){if(k&&y&&typeof k.stack=="string"){for(var g=k.stack.split(`
19
+ `),x=y.stack.split(`
20
+ `),O=g.length-1,T=x.length-1;O>=1&&T>=0&&g[O]!==x[T];)T--;for(;O>=1&&T>=0;O--,T--)if(g[O]!==x[T]){if(O!==1||T!==1)do if(O--,T--,T<0||g[O]!==x[T]){var j=`
21
+ `+g[O].replace(" at new "," at ");return o.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",o.displayName)),typeof o=="function"&&ae.set(o,j),j}while(O>=1&&T>=0);break}}}finally{Oe=!1,Pe.current=R,Tn(),Error.prepareStackTrace=E}var B=o?o.displayName||o.name:"",$=B?se(B):"";return typeof o=="function"&&ae.set(o,$),$}function _n(o,c,d){return Tt(o,!1)}function xn(o){var c=o.prototype;return!!(c&&c.isReactComponent)}function ue(o,c,d){if(o==null)return"";if(typeof o=="function")return Tt(o,xn(o));if(typeof o=="string")return se(o);switch(o){case f:return se("Suspense");case m:return se("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case a:return _n(o.render);case p:return ue(o.type,c,d);case h:{var y=o,E=y._payload,R=y._init;try{return ue(R(E),c,d)}catch{}}}return""}var te=Object.prototype.hasOwnProperty,St={},_t=A.ReactDebugCurrentFrame;function ce(o){if(o){var c=o._owner,d=ue(o.type,o._source,c?c.type:null);_t.setExtraStackFrame(d)}else _t.setExtraStackFrame(null)}function kn(o,c,d,y,E){{var R=Function.call.bind(te);for(var v in o)if(R(o,v)){var g=void 0;try{if(typeof o[v]!="function"){var x=Error((y||"React class")+": "+d+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}g=o[v](c,v,y,d,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(O){g=O}g&&!(g instanceof Error)&&(ce(E),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",y||"React class",d,v,typeof g),ce(null)),g instanceof Error&&!(g.message in St)&&(St[g.message]=!0,ce(E),S("Failed %s type: %s",d,g.message),ce(null))}}}var Cn=Array.isArray;function Te(o){return Cn(o)}function jn(o){{var c=typeof Symbol=="function"&&Symbol.toStringTag,d=c&&o[Symbol.toStringTag]||o.constructor.name||"Object";return d}}function An(o){try{return xt(o),!1}catch{return!0}}function xt(o){return""+o}function kt(o){if(An(o))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jn(o)),xt(o)}var Ct=A.ReactCurrentOwner,In={key:!0,ref:!0,__self:!0,__source:!0},jt,At;function Fn(o){if(te.call(o,"ref")){var c=Object.getOwnPropertyDescriptor(o,"ref").get;if(c&&c.isReactWarning)return!1}return o.ref!==void 0}function Dn(o){if(te.call(o,"key")){var c=Object.getOwnPropertyDescriptor(o,"key").get;if(c&&c.isReactWarning)return!1}return o.key!==void 0}function Nn(o,c){typeof o.ref=="string"&&Ct.current}function Un(o,c){{var d=function(){jt||(jt=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",c))};d.isReactWarning=!0,Object.defineProperty(o,"key",{get:d,configurable:!0})}}function Ln(o,c){{var d=function(){At||(At=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",c))};d.isReactWarning=!0,Object.defineProperty(o,"ref",{get:d,configurable:!0})}}var Vn=function(o,c,d,y,E,R,v){var g={$$typeof:t,type:o,key:c,ref:d,props:v,_owner:R};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:y}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function $n(o,c,d,y,E){{var R,v={},g=null,x=null;d!==void 0&&(kt(d),g=""+d),Dn(c)&&(kt(c.key),g=""+c.key),Fn(c)&&(x=c.ref,Nn(c,E));for(R in c)te.call(c,R)&&!In.hasOwnProperty(R)&&(v[R]=c[R]);if(o&&o.defaultProps){var O=o.defaultProps;for(R in O)v[R]===void 0&&(v[R]=O[R])}if(g||x){var T=typeof o=="function"?o.displayName||o.name||"Unknown":o;g&&Un(v,T),x&&Ln(v,T)}return Vn(o,g,x,E,y,Ct.current,v)}}var Se=A.ReactCurrentOwner,It=A.ReactDebugCurrentFrame;function K(o){if(o){var c=o._owner,d=ue(o.type,o._source,c?c.type:null);It.setExtraStackFrame(d)}else It.setExtraStackFrame(null)}var _e;_e=!1;function xe(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function Ft(){{if(Se.current){var o=U(Se.current.type);if(o)return`
22
22
 
23
- Check the render method of \``+o+"`."}return""}}function $n(o){return""}var Ft={};function zn(o){{var c=It();if(!c){var d=typeof o=="string"?o:o.displayName||o.name;d&&(c=`
23
+ Check the render method of \``+o+"`."}return""}}function zn(o){return""}var Dt={};function Mn(o){{var c=Ft();if(!c){var d=typeof o=="string"?o:o.displayName||o.name;d&&(c=`
24
24
 
25
- Check the top-level render call using <`+d+">.")}return c}}function Dt(o,c){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var d=zn(c);if(Ft[d])return;Ft[d]=!0;var y="";o&&o._owner&&o._owner!==Se.current&&(y=" It was passed a child from "+U(o._owner.type)+"."),B(o),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',d,y),B(null)}}function Nt(o,c){{if(typeof o!="object")return;if(Oe(o))for(var d=0;d<o.length;d++){var y=o[d];_e(y)&&Dt(y,c)}else if(_e(o))o._store&&(o._store.validated=!0);else if(o){var E=W(o);if(typeof E=="function"&&E!==o.entries)for(var R=E.call(o),v;!(v=R.next()).done;)_e(v.value)&&Dt(v.value,c)}}}function Mn(o){{var c=o.type;if(c==null||typeof c=="string")return;var d;if(typeof c=="function")d=c.propTypes;else if(typeof c=="object"&&(c.$$typeof===a||c.$$typeof===p))d=c.propTypes;else return;if(d){var y=U(c);_n(d,o.props,"prop",y,o)}else if(c.PropTypes!==void 0&&!xe){xe=!0;var E=U(c);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof c.getDefaultProps=="function"&&!c.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function qn(o){{for(var c=Object.keys(o.props),d=0;d<c.length;d++){var y=c[d];if(y!=="children"&&y!=="key"){B(o),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",y),B(null);break}}o.ref!==null&&(B(o),S("Invalid attribute `ref` supplied to `React.Fragment`."),B(null))}}var Ut={};function Lt(o,c,d,y,E,R){{var v=En(o);if(!v){var g="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(g+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var _=$n();_?g+=_:g+=It();var T;o===null?T="null":Oe(o)?T="array":o!==void 0&&o.$$typeof===t?(T="<"+(U(o.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):T=typeof o,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",T,g)}var O=Vn(o,c,d,E,R);if(O==null)return O;if(v){var C=c.children;if(C!==void 0)if(y)if(Oe(C)){for(var K=0;K<C.length;K++)Nt(C[K],o);Object.freeze&&Object.freeze(C)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Nt(C,o)}if(te.call(c,"key")){var $=U(o),k=Object.keys(c).filter(function(Gn){return Gn!=="key"}),ke=k.length>0?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}";if(!Ut[$+ke]){var Hn=k.length>0?"{"+k.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+d+">.")}return c}}function Nt(o,c){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var d=Mn(c);if(Dt[d])return;Dt[d]=!0;var y="";o&&o._owner&&o._owner!==Se.current&&(y=" It was passed a child from "+U(o._owner.type)+"."),K(o),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',d,y),K(null)}}function Ut(o,c){{if(typeof o!="object")return;if(Te(o))for(var d=0;d<o.length;d++){var y=o[d];xe(y)&&Nt(y,c)}else if(xe(o))o._store&&(o._store.validated=!0);else if(o){var E=W(o);if(typeof E=="function"&&E!==o.entries)for(var R=E.call(o),v;!(v=R.next()).done;)xe(v.value)&&Nt(v.value,c)}}}function qn(o){{var c=o.type;if(c==null||typeof c=="string")return;var d;if(typeof c=="function")d=c.propTypes;else if(typeof c=="object"&&(c.$$typeof===a||c.$$typeof===p))d=c.propTypes;else return;if(d){var y=U(c);kn(d,o.props,"prop",y,o)}else if(c.PropTypes!==void 0&&!_e){_e=!0;var E=U(c);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof c.getDefaultProps=="function"&&!c.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Wn(o){{for(var c=Object.keys(o.props),d=0;d<c.length;d++){var y=c[d];if(y!=="children"&&y!=="key"){K(o),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",y),K(null);break}}o.ref!==null&&(K(o),S("Invalid attribute `ref` supplied to `React.Fragment`."),K(null))}}var Lt={};function Vt(o,c,d,y,E,R){{var v=Pn(o);if(!v){var g="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(g+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var x=zn();x?g+=x:g+=Ft();var O;o===null?O="null":Te(o)?O="array":o!==void 0&&o.$$typeof===t?(O="<"+(U(o.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):O=typeof o,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,g)}var T=$n(o,c,d,E,R);if(T==null)return T;if(v){var j=c.children;if(j!==void 0)if(y)if(Te(j)){for(var B=0;B<j.length;B++)Ut(j[B],o);Object.freeze&&Object.freeze(j)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ut(j,o)}if(te.call(c,"key")){var $=U(o),k=Object.keys(c).filter(function(Xn){return Xn!=="key"}),ke=k.length>0?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}";if(!Lt[$+ke]){var Gn=k.length>0?"{"+k.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,ke,$,Hn,$),Ut[$+ke]=!0}}return o===n?qn(O):Mn(O),O}}function Wn(o,c,d){return Lt(o,c,d,!0)}function Bn(o,c,d){return Lt(o,c,d,!1)}var Kn=Bn,Yn=Wn;H.Fragment=n,H.jsx=Kn,H.jsxs=Yn}()),H}process.env.NODE_ENV==="production"?le.exports=zt():le.exports=Mt();var fe=le.exports,de=(e=>(e.PDF="application/pdf",e.TXT="text/plain",e.CSV="text/csv",e))(de||{});const me=4e3*1024*1024;Object.entries({"application/pdf":{extensions:[".pdf"],maxSize:me},"text/plain":{extensions:[".txt",".json",".py",".ts",".tsx"],maxSize:me},"text/csv":{extensions:[".csv"],maxSize:me}}).reduce((e,[t,r])=>({...e,[t]:r.extensions}),{}),new Set(Object.values(de));function z(e){const t={subscribe(r){let n=null,i=!1,s=!1,u=!1;function l(){if(n===null){u=!0;return}s||(s=!0,typeof n=="function"?n():n&&n.unsubscribe())}return n=e({next(a){var f;i||(f=r.next)==null||f.call(r,a)},error(a){var f;i||(i=!0,(f=r.error)==null||f.call(r,a),l())},complete(){var a;i||(i=!0,(a=r.complete)==null||a.call(r),l())}}),u&&l(),{unsubscribe:l}},pipe(...r){return r.reduce(qt,t)}};return t}function qt(e,t){return t(e)}function Wt(e){const t=new AbortController;return new Promise((n,i)=>{let s=!1;function u(){s||(s=!0,l.unsubscribe())}t.signal.addEventListener("abort",()=>{i(t.signal.reason)});const l=e.subscribe({next(a){s=!0,n(a),u()},error(a){i(a)},complete(){t.abort(),u()}})})}function Bt(e){return t=>{let r=0,n=null;const i=[];function s(){n||(n=t.subscribe({next(l){var a;for(const f of i)(a=f.next)==null||a.call(f,l)},error(l){var a;for(const f of i)(a=f.error)==null||a.call(f,l)},complete(){var l;for(const a of i)(l=a.complete)==null||l.call(a)}}))}function u(){if(r===0&&n){const l=n;n=null,l.unsubscribe()}}return z(l=>(r++,i.push(l),s(),{unsubscribe(){r--,u();const a=i.findIndex(f=>f===l);a>-1&&i.splice(a,1)}}))}}function Kt(e){return t=>z(r=>t.subscribe({next(n){var i;(i=e.next)==null||i.call(e,n),r.next(n)},error(n){var i;(i=e.error)==null||i.call(e,n),r.error(n)},complete(){var n;(n=e.complete)==null||n.call(e),r.complete()}}))}function Yt(e){let t=e;const r=[],n=u=>{t!==void 0&&u.next(t),r.push(u)},i=u=>{r.splice(r.indexOf(u),1)},s=z(u=>(n(u),()=>{i(u)}));return s.next=u=>{if(t!==u){t=u;for(const l of r)l.next(u)}},s.get=()=>t,s}function Ht(e){return z(t=>{function r(i=0,s=e.op){const u=e.links[i];if(!u)throw new Error("No more links to execute - did you forget to add an ending link?");return u({op:s,next(a){return r(i+1,a)}})}return r().subscribe(t)})}const Ae=()=>{},Ie=e=>{Object.freeze&&Object.freeze(e)};function Fe(e,t,r){var n,i;const s=t.join(".");return(n=r)[i=s]??(n[i]=new Proxy(Ae,{get(u,l){if(!(typeof l!="string"||l==="then"))return Fe(e,[...t,l],r)},apply(u,l,a){const f=t[t.length-1];let m={args:a,path:t};return f==="call"?m={args:a.length>=2?[a[1]]:[],path:t.slice(0,-1)}:f==="apply"&&(m={args:a.length>=2?a[1]:[],path:t.slice(0,-1)}),Ie(m.args),Ie(m.path),e(m)}})),r[s]}const Gt=e=>Fe(e,[],Object.create(null)),Xt=e=>new Proxy(Ae,{get(t,r){if(r!=="then")return e(r)}});function G(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Jt(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:{...e,error:n}}}return{ok:!0,result:{...e.result,...(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)}}}}class pe extends Error{constructor(){super("Unable to transform response from server")}}function Zt(e,t){let r;try{r=Jt(e,t)}catch{throw new pe}if(!r.ok&&(!G(r.error.error)||typeof r.error.error.code!="number"))throw new pe;if(r.ok&&!G(r.result))throw new pe;return r}var De,Ne;(De=Symbol).dispose??(De.dispose=Symbol()),(Ne=Symbol).asyncDispose??(Ne.asyncDispose=Symbol()),typeof window>"u"||"Deno"in window||((ct=(ut=globalThis.process)==null?void 0:ut.env)==null?void 0:ct.NODE_ENV)==="test"||(ft=(lt=globalThis.process)==null?void 0:lt.env)!=null&&ft.JEST_WORKER_ID||(mt=(dt=globalThis.process)==null?void 0:dt.env)!=null&&mt.VITEST_WORKER_ID;function re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qt(e){return e instanceof D||e instanceof Error&&e.name==="TRPCClientError"}function er(e){return G(e)&&G(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function tr(e,t){return typeof e=="string"?e:G(e)&&typeof e.message=="string"?e.message:t}class D extends Error{static from(t,r={}){const n=t;return Qt(n)?(r.meta&&(n.meta={...n.meta,...r.meta}),n):er(n)?new D(n.error.message,{...r,result:n}):new D(tr(n,"Unknown error"),{...r,cause:n})}constructor(t,r){var i,s;const n=r==null?void 0:r.cause;super(t,{cause:n}),re(this,"cause",void 0),re(this,"shape",void 0),re(this,"data",void 0),re(this,"meta",void 0),this.meta=r==null?void 0:r.meta,this.cause=n,this.shape=(i=r==null?void 0:r.result)==null?void 0:i.error,this.data=(s=r==null?void 0:r.result)==null?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,D.prototype)}}function ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class rr{$request(t){return Ht({links:this.links,op:{...t,context:t.context??{},id:++this.requestId}}).pipe(Bt())}async requestAsPromise(t){try{const r=this.$request(t);return(await Wt(r)).result.data}catch(r){throw D.from(r)}}query(t,r,n){return this.requestAsPromise({type:"query",path:t,input:r,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(t,r,n){return this.requestAsPromise({type:"mutation",path:t,input:r,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(t,r,n){return this.$request({type:"subscription",path:t,input:r,context:n.context,signal:n.signal}).subscribe({next(s){var u,l,a,f;switch(s.result.type){case"state":{(u=n.onConnectionStateChange)==null||u.call(n,s.result);break}case"started":{(l=n.onStarted)==null||l.call(n,{context:s.context});break}case"stopped":{(a=n.onStopped)==null||a.call(n);break}case"data":case void 0:{(f=n.onData)==null||f.call(n,s.result.data);break}}},error(s){var u;(u=n.onError)==null||u.call(n,s)},complete(){var s;(s=n.onComplete)==null||s.call(n)}})}constructor(t){ye(this,"links",void 0),ye(this,"runtime",void 0),ye(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(r=>r(this.runtime))}}const nr=Symbol.for("trpc_untypedClient"),or={query:"query",mutate:"mutation",subscribe:"subscription"},ir=e=>or[e];function sr(e){const t=Gt(({path:r,args:n})=>{const i=[...r],s=ir(i.pop()),u=i.join(".");return e[s](u,...n)});return Xt(r=>r===nr?e:t[r])}function ar(e){const t=new rr(e);return sr(t)}const Ue=e=>typeof e=="function";function ur(e){if(e)return e;if(typeof window<"u"&&Ue(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Ue(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const Le=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Ve(e){let t=null,r=null;const n=()=>{clearTimeout(r),r=null,t=null};function i(l){var m,p;const a=[[]];let f=0;for(;;){const h=l[f];if(!h)break;const w=a[a.length-1];if(h.aborted){(m=h.reject)==null||m.call(h,new Error("Aborted")),f++;continue}if(e.validate(w.concat(h).map(P=>P.key))){w.push(h),f++;continue}if(w.length===0){(p=h.reject)==null||p.call(h,new Error("Input is too big for a single dispatch")),f++;continue}a.push([])}return a}function s(){const l=i(t);n();for(const a of l){if(!a.length)continue;const f={items:a};for(const p of a)p.batch=f;e.fetch(f.items.map(p=>p.key)).then(async p=>{var h;await Promise.all(p.map(async(w,x)=>{var W,A;const P=f.items[x];try{const S=await Promise.resolve(w);(W=P.resolve)==null||W.call(P,S)}catch(S){(A=P.reject)==null||A.call(P,S)}P.batch=null,P.reject=null,P.resolve=null}));for(const w of f.items)(h=w.reject)==null||h.call(w,new Error("Missing result")),w.batch=null}).catch(p=>{var h;for(const w of f.items)(h=w.reject)==null||h.call(w,p),w.batch=null})}}function u(l){const a={aborted:!1,key:l,batch:null,resolve:Le,reject:Le},f=new Promise((m,p)=>{a.reject=p,a.resolve=m,t||(t=[]),t.push(a)});return r||(r=setTimeout(s)),f}return{load:u}}function cr(...e){const t=new AbortController,r=e.length;let n=0;const i=()=>{++n===r&&t.abort()};for(const s of e)s!=null&&s.aborted?i():s==null||s.addEventListener("abort",i,{once:!0});return t.signal}function lr(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:r=>r,deserialize:r=>r},output:{serialize:r=>r,deserialize:r=>r}}}function fr(e){return{url:e.url.toString(),fetch:e.fetch,transformer:lr(e.transformer),methodOverride:e.methodOverride}}function dr(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[r]=n}return t}const mr={query:"GET",mutation:"POST",subscription:"PATCH"};function $e(e){return"input"in e?e.transformer.input.serialize(e.input):dr(e.inputs.map(t=>e.transformer.input.serialize(t)))}const ze=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const i=[];if(t[1]&&i.push(t[1]),"inputs"in e&&i.push("batch=1"),e.type==="query"||e.type==="subscription"){const s=$e(e);s!==void 0&&e.methodOverride!=="POST"&&i.push(`input=${encodeURIComponent(JSON.stringify(s))}`)}return i.length&&(n+="?"+i.join("&")),n},pr=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=$e(e);return t!==void 0?JSON.stringify(t):void 0},yr=e=>wr({...e,contentTypeHeader:"application/json",getUrl:ze,getBody:pr});class hr extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}}const gr=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new hr};async function br(e){gr(e.signal);const t=e.getUrl(e),r=e.getBody(e),{type:n}=e,i=await(async()=>{const u=await e.headers();return Symbol.iterator in u?Object.fromEntries(u):u})(),s={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...i};return ur(e.fetch)(t,{method:e.methodOverride??mr[n],signal:e.signal,body:r,headers:s})}async function wr(e){const t={},r=await br(e);t.response=r;const n=await r.json();return t.responseJSON=n,{json:n,meta:t}}function vr(e){const t=fr(e),r=e.maxURLLength??1/0;return()=>{const n=l=>({validate(a){if(r===1/0)return!0;const f=a.map(h=>h.path).join(","),m=a.map(h=>h.input);return ze({...t,type:l,path:f,inputs:m,signal:null}).length<=r},async fetch(a){const f=a.map(P=>P.path).join(","),m=a.map(P=>P.input),p=cr(...a.map(P=>P.signal)),h=await yr({...t,path:f,inputs:m,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:a}):e.headers:{}},signal:p});return(Array.isArray(h.json)?h.json:a.map(()=>h.json)).map(P=>({meta:h.meta,json:P}))}}),i=Ve(n("query")),s=Ve(n("mutation")),u={query:i,mutation:s};return({op:l})=>z(a=>{/* istanbul ignore if -- @preserve */if(l.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const m=u[l.type].load(l);let p;return m.then(h=>{p=h;const w=Zt(h.json,t.transformer.output);if(!w.ok){a.error(D.from(w.error,{meta:h.meta}));return}a.next({context:h.meta,result:w.result}),a.complete()}).catch(h=>{a.error(D.from(h,{meta:p==null?void 0:p.meta}))}),()=>{}})}}function Er(e){return typeof FormData>"u"?!1:e instanceof FormData}const he={css:{query:["72e3ff","3fb0d8"],mutation:["c5a3fc","904dfc"],subscription:["ff49e1","d83fbe"]},ansi:{regular:{query:["\x1B[30;46m","\x1B[97;46m"],mutation:["\x1B[30;45m","\x1B[97;45m"],subscription:["\x1B[30;42m","\x1B[97;42m"]},bold:{query:["\x1B[1;30;46m","\x1B[1;97;46m"],mutation:["\x1B[1;30;45m","\x1B[1;97;45m"],subscription:["\x1B[1;30;42m","\x1B[1;97;42m"]}}};function Pr(e){const{direction:t,type:r,withContext:n,path:i,id:s,input:u}=e,l=[],a=[];if(e.colorMode==="none")l.push(t==="up"?">>":"<<",r,`#${s}`,i);else if(e.colorMode==="ansi"){const[f,m]=he.ansi.regular[r],[p,h]=he.ansi.bold[r];l.push(t==="up"?f:m,t==="up"?">>":"<<",r,t==="up"?p:h,`#${s}`,i,"\x1B[0m")}else{const[f,m]=he.css[r],p=`
30
+ <%s key={someKey} {...props} />`,ke,$,Gn,$),Lt[$+ke]=!0}}return o===n?Wn(T):qn(T),T}}function Kn(o,c,d){return Vt(o,c,d,!0)}function Bn(o,c,d){return Vt(o,c,d,!1)}var Yn=Bn,Hn=Kn;H.Fragment=n,H.jsx=Yn,H.jsxs=Hn}()),H}process.env.NODE_ENV==="production"?le.exports=Mt():le.exports=qt();var fe=le.exports,Ae=(e=>(e.NOT_CHUNKED="NOT_CHUNKED",e.CHUNKED="CHUNKED",e.ERROR_CHUNKING="ERROR_CHUNKING",e))(Ae||{}),de=(e=>(e.PDF="application/pdf",e.TXT="text/plain",e.CSV="text/csv",e))(de||{});const me=4e3*1024*1024;Object.entries({"application/pdf":{extensions:[".pdf"],maxSize:me},"text/plain":{extensions:[".txt",".json",".py",".ts",".tsx"],maxSize:me},"text/csv":{extensions:[".csv"],maxSize:me}}).reduce((e,[t,r])=>({...e,[t]:r.extensions}),{}),new Set(Object.values(de));function z(e){const t={subscribe(r){let n=null,i=!1,s=!1,u=!1;function l(){if(n===null){u=!0;return}s||(s=!0,typeof n=="function"?n():n&&n.unsubscribe())}return n=e({next(a){var f;i||(f=r.next)==null||f.call(r,a)},error(a){var f;i||(i=!0,(f=r.error)==null||f.call(r,a),l())},complete(){var a;i||(i=!0,(a=r.complete)==null||a.call(r),l())}}),u&&l(),{unsubscribe:l}},pipe(...r){return r.reduce(Wt,t)}};return t}function Wt(e,t){return t(e)}function Kt(e){const t=new AbortController;return new Promise((n,i)=>{let s=!1;function u(){s||(s=!0,l.unsubscribe())}t.signal.addEventListener("abort",()=>{i(t.signal.reason)});const l=e.subscribe({next(a){s=!0,n(a),u()},error(a){i(a)},complete(){t.abort(),u()}})})}function Bt(e){return t=>{let r=0,n=null;const i=[];function s(){n||(n=t.subscribe({next(l){var a;for(const f of i)(a=f.next)==null||a.call(f,l)},error(l){var a;for(const f of i)(a=f.error)==null||a.call(f,l)},complete(){var l;for(const a of i)(l=a.complete)==null||l.call(a)}}))}function u(){if(r===0&&n){const l=n;n=null,l.unsubscribe()}}return z(l=>(r++,i.push(l),s(),{unsubscribe(){r--,u();const a=i.findIndex(f=>f===l);a>-1&&i.splice(a,1)}}))}}function Yt(e){return t=>z(r=>t.subscribe({next(n){var i;(i=e.next)==null||i.call(e,n),r.next(n)},error(n){var i;(i=e.error)==null||i.call(e,n),r.error(n)},complete(){var n;(n=e.complete)==null||n.call(e),r.complete()}}))}function Ht(e){let t=e;const r=[],n=u=>{t!==void 0&&u.next(t),r.push(u)},i=u=>{r.splice(r.indexOf(u),1)},s=z(u=>(n(u),()=>{i(u)}));return s.next=u=>{if(t!==u){t=u;for(const l of r)l.next(u)}},s.get=()=>t,s}function Gt(e){return z(t=>{function r(i=0,s=e.op){const u=e.links[i];if(!u)throw new Error("No more links to execute - did you forget to add an ending link?");return u({op:s,next(a){return r(i+1,a)}})}return r().subscribe(t)})}const Ie=()=>{},Fe=e=>{Object.freeze&&Object.freeze(e)};function De(e,t,r){var n,i;const s=t.join(".");return(n=r)[i=s]??(n[i]=new Proxy(Ie,{get(u,l){if(!(typeof l!="string"||l==="then"))return De(e,[...t,l],r)},apply(u,l,a){const f=t[t.length-1];let m={args:a,path:t};return f==="call"?m={args:a.length>=2?[a[1]]:[],path:t.slice(0,-1)}:f==="apply"&&(m={args:a.length>=2?a[1]:[],path:t.slice(0,-1)}),Fe(m.args),Fe(m.path),e(m)}})),r[s]}const Xt=e=>De(e,[],Object.create(null)),Jt=e=>new Proxy(Ie,{get(t,r){if(r!=="then")return e(r)}});function G(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Zt(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:{...e,error:n}}}return{ok:!0,result:{...e.result,...(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)}}}}class pe extends Error{constructor(){super("Unable to transform response from server")}}function Qt(e,t){let r;try{r=Zt(e,t)}catch{throw new pe}if(!r.ok&&(!G(r.error.error)||typeof r.error.error.code!="number"))throw new pe;if(r.ok&&!G(r.result))throw new pe;return r}var Ne,Ue;(Ne=Symbol).dispose??(Ne.dispose=Symbol()),(Ue=Symbol).asyncDispose??(Ue.asyncDispose=Symbol()),typeof window>"u"||"Deno"in window||((lt=(ct=globalThis.process)==null?void 0:ct.env)==null?void 0:lt.NODE_ENV)==="test"||(dt=(ft=globalThis.process)==null?void 0:ft.env)!=null&&dt.JEST_WORKER_ID||(pt=(mt=globalThis.process)==null?void 0:mt.env)!=null&&pt.VITEST_WORKER_ID;function re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function er(e){return e instanceof D||e instanceof Error&&e.name==="TRPCClientError"}function tr(e){return G(e)&&G(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function rr(e,t){return typeof e=="string"?e:G(e)&&typeof e.message=="string"?e.message:t}class D extends Error{static from(t,r={}){const n=t;return er(n)?(r.meta&&(n.meta={...n.meta,...r.meta}),n):tr(n)?new D(n.error.message,{...r,result:n}):new D(rr(n,"Unknown error"),{...r,cause:n})}constructor(t,r){var i,s;const n=r==null?void 0:r.cause;super(t,{cause:n}),re(this,"cause",void 0),re(this,"shape",void 0),re(this,"data",void 0),re(this,"meta",void 0),this.meta=r==null?void 0:r.meta,this.cause=n,this.shape=(i=r==null?void 0:r.result)==null?void 0:i.error,this.data=(s=r==null?void 0:r.result)==null?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,D.prototype)}}function ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class nr{$request(t){return Gt({links:this.links,op:{...t,context:t.context??{},id:++this.requestId}}).pipe(Bt())}async requestAsPromise(t){try{const r=this.$request(t);return(await Kt(r)).result.data}catch(r){throw D.from(r)}}query(t,r,n){return this.requestAsPromise({type:"query",path:t,input:r,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(t,r,n){return this.requestAsPromise({type:"mutation",path:t,input:r,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(t,r,n){return this.$request({type:"subscription",path:t,input:r,context:n.context,signal:n.signal}).subscribe({next(s){var u,l,a,f;switch(s.result.type){case"state":{(u=n.onConnectionStateChange)==null||u.call(n,s.result);break}case"started":{(l=n.onStarted)==null||l.call(n,{context:s.context});break}case"stopped":{(a=n.onStopped)==null||a.call(n);break}case"data":case void 0:{(f=n.onData)==null||f.call(n,s.result.data);break}}},error(s){var u;(u=n.onError)==null||u.call(n,s)},complete(){var s;(s=n.onComplete)==null||s.call(n)}})}constructor(t){ye(this,"links",void 0),ye(this,"runtime",void 0),ye(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(r=>r(this.runtime))}}const or=Symbol.for("trpc_untypedClient"),ir={query:"query",mutate:"mutation",subscribe:"subscription"},sr=e=>ir[e];function ar(e){const t=Xt(({path:r,args:n})=>{const i=[...r],s=sr(i.pop()),u=i.join(".");return e[s](u,...n)});return Jt(r=>r===or?e:t[r])}function ur(e){const t=new nr(e);return ar(t)}const Le=e=>typeof e=="function";function cr(e){if(e)return e;if(typeof window<"u"&&Le(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Le(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const Ve=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function $e(e){let t=null,r=null;const n=()=>{clearTimeout(r),r=null,t=null};function i(l){var m,p;const a=[[]];let f=0;for(;;){const h=l[f];if(!h)break;const w=a[a.length-1];if(h.aborted){(m=h.reject)==null||m.call(h,new Error("Aborted")),f++;continue}if(e.validate(w.concat(h).map(P=>P.key))){w.push(h),f++;continue}if(w.length===0){(p=h.reject)==null||p.call(h,new Error("Input is too big for a single dispatch")),f++;continue}a.push([])}return a}function s(){const l=i(t);n();for(const a of l){if(!a.length)continue;const f={items:a};for(const p of a)p.batch=f;e.fetch(f.items.map(p=>p.key)).then(async p=>{var h;await Promise.all(p.map(async(w,_)=>{var W,A;const P=f.items[_];try{const S=await Promise.resolve(w);(W=P.resolve)==null||W.call(P,S)}catch(S){(A=P.reject)==null||A.call(P,S)}P.batch=null,P.reject=null,P.resolve=null}));for(const w of f.items)(h=w.reject)==null||h.call(w,new Error("Missing result")),w.batch=null}).catch(p=>{var h;for(const w of f.items)(h=w.reject)==null||h.call(w,p),w.batch=null})}}function u(l){const a={aborted:!1,key:l,batch:null,resolve:Ve,reject:Ve},f=new Promise((m,p)=>{a.reject=p,a.resolve=m,t||(t=[]),t.push(a)});return r||(r=setTimeout(s)),f}return{load:u}}function lr(...e){const t=new AbortController,r=e.length;let n=0;const i=()=>{++n===r&&t.abort()};for(const s of e)s!=null&&s.aborted?i():s==null||s.addEventListener("abort",i,{once:!0});return t.signal}function fr(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:r=>r,deserialize:r=>r},output:{serialize:r=>r,deserialize:r=>r}}}function dr(e){return{url:e.url.toString(),fetch:e.fetch,transformer:fr(e.transformer),methodOverride:e.methodOverride}}function mr(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[r]=n}return t}const pr={query:"GET",mutation:"POST",subscription:"PATCH"};function ze(e){return"input"in e?e.transformer.input.serialize(e.input):mr(e.inputs.map(t=>e.transformer.input.serialize(t)))}const Me=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const i=[];if(t[1]&&i.push(t[1]),"inputs"in e&&i.push("batch=1"),e.type==="query"||e.type==="subscription"){const s=ze(e);s!==void 0&&e.methodOverride!=="POST"&&i.push(`input=${encodeURIComponent(JSON.stringify(s))}`)}return i.length&&(n+="?"+i.join("&")),n},yr=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=ze(e);return t!==void 0?JSON.stringify(t):void 0},hr=e=>vr({...e,contentTypeHeader:"application/json",getUrl:Me,getBody:yr});class gr extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}}const br=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new gr};async function wr(e){br(e.signal);const t=e.getUrl(e),r=e.getBody(e),{type:n}=e,i=await(async()=>{const u=await e.headers();return Symbol.iterator in u?Object.fromEntries(u):u})(),s={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...i};return cr(e.fetch)(t,{method:e.methodOverride??pr[n],signal:e.signal,body:r,headers:s})}async function vr(e){const t={},r=await wr(e);t.response=r;const n=await r.json();return t.responseJSON=n,{json:n,meta:t}}function Er(e){const t=dr(e),r=e.maxURLLength??1/0;return()=>{const n=l=>({validate(a){if(r===1/0)return!0;const f=a.map(h=>h.path).join(","),m=a.map(h=>h.input);return Me({...t,type:l,path:f,inputs:m,signal:null}).length<=r},async fetch(a){const f=a.map(P=>P.path).join(","),m=a.map(P=>P.input),p=lr(...a.map(P=>P.signal)),h=await hr({...t,path:f,inputs:m,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:a}):e.headers:{}},signal:p});return(Array.isArray(h.json)?h.json:a.map(()=>h.json)).map(P=>({meta:h.meta,json:P}))}}),i=$e(n("query")),s=$e(n("mutation")),u={query:i,mutation:s};return({op:l})=>z(a=>{/* istanbul ignore if -- @preserve */if(l.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const m=u[l.type].load(l);let p;return m.then(h=>{p=h;const w=Qt(h.json,t.transformer.output);if(!w.ok){a.error(D.from(w.error,{meta:h.meta}));return}a.next({context:h.meta,result:w.result}),a.complete()}).catch(h=>{a.error(D.from(h,{meta:p==null?void 0:p.meta}))}),()=>{}})}}function Pr(e){return typeof FormData>"u"?!1:e instanceof FormData}const he={css:{query:["72e3ff","3fb0d8"],mutation:["c5a3fc","904dfc"],subscription:["ff49e1","d83fbe"]},ansi:{regular:{query:["\x1B[30;46m","\x1B[97;46m"],mutation:["\x1B[30;45m","\x1B[97;45m"],subscription:["\x1B[30;42m","\x1B[97;42m"]},bold:{query:["\x1B[1;30;46m","\x1B[1;97;46m"],mutation:["\x1B[1;30;45m","\x1B[1;97;45m"],subscription:["\x1B[1;30;42m","\x1B[1;97;42m"]}}};function Rr(e){const{direction:t,type:r,withContext:n,path:i,id:s,input:u}=e,l=[],a=[];if(e.colorMode==="none")l.push(t==="up"?">>":"<<",r,`#${s}`,i);else if(e.colorMode==="ansi"){const[f,m]=he.ansi.regular[r],[p,h]=he.ansi.bold[r];l.push(t==="up"?f:m,t==="up"?">>":"<<",r,t==="up"?p:h,`#${s}`,i,"\x1B[0m")}else{const[f,m]=he.css[r],p=`
31
31
  background-color: #${t==="up"?f:m};
32
32
  color: ${t==="up"?"black":"white"};
33
33
  padding: 2px;
34
- `;l.push("%c",t==="up"?">>":"<<",r,`#${s}`,`%c${i}%c`,"%O"),a.push(p,`${p}; font-weight: bold;`,`${p}; font-weight: normal;`)}return t==="up"?a.push(n?{input:u,context:e.context}:{input:u}):a.push({input:u,result:e.result,elapsedMs:e.elapsedMs,...n&&{context:e.context}}),{parts:l,args:a}}const Rr=({c:e=console,colorMode:t="css",withContext:r})=>n=>{const i=n.input,s=Er(i)?Object.fromEntries(i):i,{parts:u,args:l}=Pr({...n,colorMode:t,input:s,withContext:r}),a=n.direction==="down"&&n.result&&(n.result instanceof Error||"error"in n.result.result&&n.result.result.error)?"error":"log";e[a].apply(null,[u.join(" ")].concat(l))};function Tr(e={}){const{enabled:t=()=>!0}=e,r=e.colorMode??(typeof window>"u"?"ansi":"css"),n=e.withContext??r==="css",{logger:i=Rr({c:e.console,colorMode:r,withContext:n})}=e;return()=>({op:s,next:u})=>z(l=>{t({...s,direction:"up"})&&i({...s,direction:"up"});const a=Date.now();function f(m){const p=Date.now()-a;t({...s,direction:"down",result:m})&&i({...s,direction:"down",elapsedMs:p,result:m})}return u(s).pipe(Kt({next(m){f(m)},error(m){f(m)}})).subscribe(l)})}const Or=(e,...t)=>typeof e=="function"?e(...t):e;function Sr(){let e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}}async function xr(e){const t=await Or(e.url);if(!e.connectionParams)return t;const n=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+n}function L(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _r(e){const{promise:t,resolve:r,reject:n}=Sr();return e.addEventListener("open",()=>{e.removeEventListener("error",n),r()}),e.addEventListener("error",n),t}function kr(e,{intervalMs:t,pongTimeoutMs:r}){let n,i;function s(){n=setTimeout(()=>{e.send("PING"),i=setTimeout(()=>{e.close()},r)},t)}function u(){clearTimeout(n),s()}function l(){clearTimeout(i),u()}e.addEventListener("open",s),e.addEventListener("message",({data:a})=>{clearTimeout(n),s(),a==="PONG"&&l()}),e.addEventListener("close",()=>{clearTimeout(n),clearTimeout(i)})}class ne{get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++ne.connectCount;const t=xr(this.urlOptions).then(r=>new this.WebSocketPonyfill(r));this.openPromise=t.then(_r),this.ws=await t,this.ws.addEventListener("message",function({data:r}){r==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&kr(this.ws,this.keepAliveOpts),this.ws.addEventListener("close",()=>{this.ws=null});try{await this.openPromise}finally{this.openPromise=null}}async close(){var t;try{await this.openPromise}finally{(t=this.ws)==null||t.close()}}constructor(t){if(L(this,"id",++ne.connectCount),L(this,"WebSocketPonyfill",void 0),L(this,"urlOptions",void 0),L(this,"keepAliveOpts",void 0),L(this,"wsObservable",Yt(null)),L(this,"openPromise",null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}}L(ne,"connectCount",0);class jr{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(t,r){this.keyToValue.set(t,r),this.valueToKey.set(r,t)}getByKey(t){return this.keyToValue.get(t)}getByValue(t){return this.valueToKey.get(t)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class Me{constructor(t){this.generateIdentifier=t,this.kv=new jr}register(t,r){this.kv.getByValue(t)||(r||(r=this.generateIdentifier(t)),this.kv.set(r,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}}class Cr extends Me{constructor(){super(t=>t.name),this.classToAllowedProps=new Map}register(t,r){typeof r=="object"?(r.allowProps&&this.classToAllowedProps.set(t,r.allowProps),super.register(t,r.identifier)):super.register(t,r)}getAllowedProps(t){return this.classToAllowedProps.get(t)}}function Ar(e){if("values"in Object)return Object.values(e);const t=[];for(const r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}function Ir(e,t){const r=Ar(e);if("find"in r)return r.find(t);const n=r;for(let i=0;i<n.length;i++){const s=n[i];if(t(s))return s}}function M(e,t){Object.entries(e).forEach(([r,n])=>t(n,r))}function oe(e,t){return e.indexOf(t)!==-1}function qe(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(t(n))return n}}class Fr{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return Ir(this.transfomers,r=>r.isApplicable(t))}findByName(t){return this.transfomers[t]}}const Dr=e=>Object.prototype.toString.call(e).slice(8,-1),We=e=>typeof e>"u",Nr=e=>e===null,X=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,ge=e=>X(e)&&Object.keys(e).length===0,N=e=>Array.isArray(e),Ur=e=>typeof e=="string",Lr=e=>typeof e=="number"&&!isNaN(e),Vr=e=>typeof e=="boolean",$r=e=>e instanceof RegExp,J=e=>e instanceof Map,Z=e=>e instanceof Set,Be=e=>Dr(e)==="Symbol",zr=e=>e instanceof Date&&!isNaN(e.valueOf()),Mr=e=>e instanceof Error,Ke=e=>typeof e=="number"&&isNaN(e),qr=e=>Vr(e)||Nr(e)||We(e)||Lr(e)||Ur(e)||Be(e),Wr=e=>typeof e=="bigint",Br=e=>e===1/0||e===-1/0,Kr=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Yr=e=>e instanceof URL,Ye=e=>e.replace(/\./g,"\\."),be=e=>e.map(String).map(Ye).join("."),Q=e=>{const t=[];let r="";for(let i=0;i<e.length;i++){let s=e.charAt(i);if(s==="\\"&&e.charAt(i+1)==="."){r+=".",i++;continue}if(s==="."){t.push(r),r="";continue}r+=s}const n=r;return t.push(n),t};function I(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}const He=[I(We,"undefined",()=>null,()=>{}),I(Wr,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),I(zr,"Date",e=>e.toISOString(),e=>new Date(e)),I(Mr,"Error",(e,t)=>{const r={name:e.name,message:e.message};return t.allowedErrorProps.forEach(n=>{r[n]=e[n]}),r},(e,t)=>{const r=new Error(e.message);return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach(n=>{r[n]=e[n]}),r}),I($r,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),r=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,r)}),I(Z,"set",e=>[...e.values()],e=>new Set(e)),I(J,"map",e=>[...e.entries()],e=>new Map(e)),I(e=>Ke(e)||Br(e),"number",e=>Ke(e)?"NaN":e>0?"Infinity":"-Infinity",Number),I(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),I(Yr,"URL",e=>e.toString(),e=>new URL(e))];function ie(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}const Ge=ie((e,t)=>Be(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,r)=>{const n=r.symbolRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown symbol");return n}),Hr=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),Xe=ie(Kr,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const r=Hr[t[1]];if(!r)throw new Error("Trying to deserialize unknown typed array");return new r(e)});function Je(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}const Ze=ie(Je,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return{...e};const n={};return r.forEach(i=>{n[i]=e[i]}),n},(e,t,r)=>{const n=r.classRegistry.getValue(t[1]);if(!n)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(n.prototype),e)}),Qe=ie((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,r)=>{const n=r.customTransformerRegistry.findByName(t[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(e)}),Gr=[Ze,Ge,Qe,Xe],et=(e,t)=>{const r=qe(Gr,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};const n=qe(He,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation}},tt={};He.forEach(e=>{tt[e.annotation]=e});const Xr=(e,t,r)=>{if(N(t))switch(t[0]){case"symbol":return Ge.untransform(e,t,r);case"class":return Ze.untransform(e,t,r);case"custom":return Qe.untransform(e,t,r);case"typed-array":return Xe.untransform(e,t,r);default:throw new Error("Unknown transformation: "+t)}else{const n=tt[t];if(!n)throw new Error("Unknown transformation: "+t);return n.untransform(e,r)}},q=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const r=e.keys();for(;t>0;)r.next(),t--;return r.next().value};function rt(e){if(oe(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(oe(e,"prototype"))throw new Error("prototype is not allowed as a property");if(oe(e,"constructor"))throw new Error("constructor is not allowed as a property")}const Jr=(e,t)=>{rt(t);for(let r=0;r<t.length;r++){const n=t[r];if(Z(e))e=q(e,+n);else if(J(e)){const i=+n,s=+t[++r]==0?"key":"value",u=q(e,i);switch(s){case"key":e=u;break;case"value":e=e.get(u);break}}else e=e[n]}return e},we=(e,t,r)=>{if(rt(t),t.length===0)return r(e);let n=e;for(let s=0;s<t.length-1;s++){const u=t[s];if(N(n)){const l=+u;n=n[l]}else if(X(n))n=n[u];else if(Z(n)){const l=+u;n=q(n,l)}else if(J(n)){if(s===t.length-2)break;const a=+u,f=+t[++s]==0?"key":"value",m=q(n,a);switch(f){case"key":n=m;break;case"value":n=n.get(m);break}}}const i=t[t.length-1];if(N(n)?n[+i]=r(n[+i]):X(n)&&(n[i]=r(n[i])),Z(n)){const s=q(n,+i),u=r(s);s!==u&&(n.delete(s),n.add(u))}if(J(n)){const s=+t[t.length-2],u=q(n,s);switch(+i==0?"key":"value"){case"key":{const a=r(u);n.set(a,n.get(u)),a!==u&&n.delete(u);break}case"value":{n.set(u,r(n.get(u)));break}}}return e};function ve(e,t,r=[]){if(!e)return;if(!N(e)){M(e,(s,u)=>ve(s,t,[...r,...Q(u)]));return}const[n,i]=e;i&&M(i,(s,u)=>{ve(s,t,[...r,...Q(u)])}),t(n,r)}function Zr(e,t,r){return ve(t,(n,i)=>{e=we(e,i,s=>Xr(s,n,r))}),e}function Qr(e,t){function r(n,i){const s=Jr(e,Q(i));n.map(Q).forEach(u=>{e=we(e,u,()=>s)})}if(N(t)){const[n,i]=t;n.forEach(s=>{e=we(e,Q(s),()=>e)}),i&&M(i,r)}else M(t,r);return e}const en=(e,t)=>X(e)||N(e)||J(e)||Z(e)||Je(e,t);function tn(e,t,r){const n=r.get(e);n?n.push(t):r.set(e,[t])}function rn(e,t){const r={};let n;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(l=>l.map(String)).sort((l,a)=>l.length-a.length));const[s,...u]=i;s.length===0?n=u.map(be):r[be(s)]=u.map(be)}),n?ge(r)?[n]:[n,r]:ge(r)?void 0:r}const nt=(e,t,r,n,i=[],s=[],u=new Map)=>{const l=qr(e);if(!l){tn(e,i,t);const w=u.get(e);if(w)return n?{transformedValue:null}:w}if(!en(e,r)){const w=et(e,r),x=w?{transformedValue:w.value,annotations:[w.type]}:{transformedValue:e};return l||u.set(e,x),x}if(oe(s,e))return{transformedValue:null};const a=et(e,r),f=(a==null?void 0:a.value)??e,m=N(f)?[]:{},p={};M(f,(w,x)=>{if(x==="__proto__"||x==="constructor"||x==="prototype")throw new Error(`Detected property ${x}. This is a prototype pollution risk, please remove it from your object.`);const P=nt(w,t,r,n,[...i,x],[...s,e],u);m[x]=P.transformedValue,N(P.annotations)?p[x]=P.annotations:X(P.annotations)&&M(P.annotations,(W,A)=>{p[Ye(x)+"."+A]=W})});const h=ge(p)?{transformedValue:m,annotations:a?[a.type]:void 0}:{transformedValue:m,annotations:a?[a.type,p]:p};return l||u.set(e,h),h};function ot(e){return Object.prototype.toString.call(e).slice(8,-1)}function it(e){return ot(e)==="Array"}function nn(e){if(ot(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function on(e,t,r,n,i){const s={}.propertyIsEnumerable.call(n,t)?"enumerable":"nonenumerable";s==="enumerable"&&(e[t]=r),i&&s==="nonenumerable"&&Object.defineProperty(e,t,{value:r,enumerable:!1,writable:!0,configurable:!0})}function Ee(e,t={}){if(it(e))return e.map(i=>Ee(i,t));if(!nn(e))return e;const r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols(e);return[...r,...n].reduce((i,s)=>{if(it(t.props)&&!t.props.includes(s))return i;const u=e[s],l=Ee(u,t);return on(i,s,l,e,t.nonenumerable),i},{})}class b{constructor({dedupe:t=!1}={}){this.classRegistry=new Cr,this.symbolRegistry=new Me(r=>r.description??""),this.customTransformerRegistry=new Fr,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const r=new Map,n=nt(t,r,this,this.dedupe),i={json:n.transformedValue};n.annotations&&(i.meta={...i.meta,values:n.annotations});const s=rn(r,this.dedupe);return s&&(i.meta={...i.meta,referentialEqualities:s}),i}deserialize(t){const{json:r,meta:n}=t;let i=Ee(r);return n!=null&&n.values&&(i=Zr(i,n.values,this)),n!=null&&n.referentialEqualities&&(i=Qr(i,n.referentialEqualities)),i}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t))}registerClass(t,r){this.classRegistry.register(t,r)}registerSymbol(t,r){this.symbolRegistry.register(t,r)}registerCustom(t,r){this.customTransformerRegistry.register({name:r,...t})}allowErrorProps(...t){this.allowedErrorProps.push(...t)}}b.defaultInstance=new b,b.serialize=b.defaultInstance.serialize.bind(b.defaultInstance),b.deserialize=b.defaultInstance.deserialize.bind(b.defaultInstance),b.stringify=b.defaultInstance.stringify.bind(b.defaultInstance),b.parse=b.defaultInstance.parse.bind(b.defaultInstance),b.registerClass=b.defaultInstance.registerClass.bind(b.defaultInstance),b.registerSymbol=b.defaultInstance.registerSymbol.bind(b.defaultInstance),b.registerCustom=b.defaultInstance.registerCustom.bind(b.defaultInstance),b.allowErrorProps=b.defaultInstance.allowErrorProps.bind(b.defaultInstance),b.serialize,b.deserialize,b.stringify,b.parse,b.registerClass,b.registerCustom,b.registerSymbol,b.allowErrorProps;const sn="dev-jwt-token-for-testing",an=async()=>sn,st=j.createContext(null);function un(e,t){const r=ar({links:[Tr({enabled:n=>process.env.NODE_ENV==="development"&&typeof window<"u"||n.direction==="down"&&n.result instanceof Error}),vr({url:`${e}/trpc`,headers:async()=>({Authorization:`Bearer ${await t()}`}),transformer:b})]});return{getProjectsForUser:async()=>(await r.projectRouter.getAllProjects.query()).map(i=>({name:i.name,id:i.id})),addProjectForUser:async n=>{const i=await r.projectRouter.createProject.mutate({name:n});return{name:i.name,id:i.id}},addFilesToProject:async(n,i)=>{const s=[];for(const u of i){const l=await r.fileRouter.createFile.mutate({file:{projectId:n,mimeType:de.PDF,path:u.blobUrl,name:u.name,size:0,metadata:null,isArtifact:!1,summary:null}});s.push({blobUrl:l.path,name:l.name,id:l.id})}return s},getFilesForProject:async n=>(await r.fileRouter.getFilesByProject.query({projectId:n})).map(s=>({blobUrl:s.path,name:s.name,id:s.id}))}}function cn({children:e,host:t="http://localhost",port:r=5174,getToken:n=an}){const[i,s]=j.useState(null);return j.useEffect(()=>{const u=`${t}:${r}`,l=un(u,n);s(l)},[t,r,n]),fe.jsx(st.Provider,{value:{host:t,port:r,client:i},children:e})}function at(){const e=j.useContext(st);if(!e)throw new Error("useFolioContext must be used within a FolioProvider");return e}const{useEffect:ln,useRef:fn,useState:dn}=$t;function mn({width:e="100%",height:t="100vh",allow:r="camera; microphone; clipboard-read; clipboard-write; fullscreen",style:n,className:i="",iframeProps:s={}}){const{host:u,port:l}=at(),a=fn(null),[f,m]=dn();return ln(()=>{m(`${u}:${l}`)},[u,l]),f?fe.jsx("div",{className:`folio-embed-container ${i}`,style:{width:e,height:t,overflow:"hidden",...n},children:fe.jsx("iframe",{ref:a,src:f,width:"100%",height:"100%",style:{border:"none",width:"100%",height:"100%",overflow:"auto"},allow:r,allowFullScreen:!0,...s})}):null}function pn(){const{client:e}=at(),[t,r]=j.useState(!1),[n,i]=j.useState(null);return{isLoading:t,error:n,getProjectsForUser:async()=>{for(;!e;)await new Promise(f=>setTimeout(f,100));r(!0),i(null);try{return await e.getProjectsForUser()}catch(f){return i(f instanceof Error?f:new Error(String(f))),[]}finally{r(!1)}},addProjectForUser:async f=>{for(;!e;)await new Promise(m=>setTimeout(m,100));r(!0),i(null);try{return await e.addProjectForUser(f)}catch(m){return i(m instanceof Error?m:new Error(String(m))),null}finally{r(!1)}},addFilesToProject:async(f,m)=>{for(;!e;)await new Promise(p=>setTimeout(p,100));r(!0),i(null);try{return await e.addFilesToProject(f,m)}catch(p){return i(p instanceof Error?p:new Error(String(p))),null}finally{r(!1)}},getFilesForProject:async f=>{for(;!e;)await new Promise(m=>setTimeout(m,100));r(!0),i(null);try{return await e.getFilesForProject(f)}catch(m){return i(m instanceof Error?m:new Error(String(m))),[]}finally{r(!1)}}}}F.FolioEmbed=mn,F.FolioProvider=cn,F.useFolio=pn,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
34
+ `;l.push("%c",t==="up"?">>":"<<",r,`#${s}`,`%c${i}%c`,"%O"),a.push(p,`${p}; font-weight: bold;`,`${p}; font-weight: normal;`)}return t==="up"?a.push(n?{input:u,context:e.context}:{input:u}):a.push({input:u,result:e.result,elapsedMs:e.elapsedMs,...n&&{context:e.context}}),{parts:l,args:a}}const Or=({c:e=console,colorMode:t="css",withContext:r})=>n=>{const i=n.input,s=Pr(i)?Object.fromEntries(i):i,{parts:u,args:l}=Rr({...n,colorMode:t,input:s,withContext:r}),a=n.direction==="down"&&n.result&&(n.result instanceof Error||"error"in n.result.result&&n.result.result.error)?"error":"log";e[a].apply(null,[u.join(" ")].concat(l))};function Tr(e={}){const{enabled:t=()=>!0}=e,r=e.colorMode??(typeof window>"u"?"ansi":"css"),n=e.withContext??r==="css",{logger:i=Or({c:e.console,colorMode:r,withContext:n})}=e;return()=>({op:s,next:u})=>z(l=>{t({...s,direction:"up"})&&i({...s,direction:"up"});const a=Date.now();function f(m){const p=Date.now()-a;t({...s,direction:"down",result:m})&&i({...s,direction:"down",elapsedMs:p,result:m})}return u(s).pipe(Yt({next(m){f(m)},error(m){f(m)}})).subscribe(l)})}const Sr=(e,...t)=>typeof e=="function"?e(...t):e;function _r(){let e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}}async function xr(e){const t=await Sr(e.url);if(!e.connectionParams)return t;const n=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+n}function L(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kr(e){const{promise:t,resolve:r,reject:n}=_r();return e.addEventListener("open",()=>{e.removeEventListener("error",n),r()}),e.addEventListener("error",n),t}function Cr(e,{intervalMs:t,pongTimeoutMs:r}){let n,i;function s(){n=setTimeout(()=>{e.send("PING"),i=setTimeout(()=>{e.close()},r)},t)}function u(){clearTimeout(n),s()}function l(){clearTimeout(i),u()}e.addEventListener("open",s),e.addEventListener("message",({data:a})=>{clearTimeout(n),s(),a==="PONG"&&l()}),e.addEventListener("close",()=>{clearTimeout(n),clearTimeout(i)})}class ne{get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++ne.connectCount;const t=xr(this.urlOptions).then(r=>new this.WebSocketPonyfill(r));this.openPromise=t.then(kr),this.ws=await t,this.ws.addEventListener("message",function({data:r}){r==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&Cr(this.ws,this.keepAliveOpts),this.ws.addEventListener("close",()=>{this.ws=null});try{await this.openPromise}finally{this.openPromise=null}}async close(){var t;try{await this.openPromise}finally{(t=this.ws)==null||t.close()}}constructor(t){if(L(this,"id",++ne.connectCount),L(this,"WebSocketPonyfill",void 0),L(this,"urlOptions",void 0),L(this,"keepAliveOpts",void 0),L(this,"wsObservable",Ht(null)),L(this,"openPromise",null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}}L(ne,"connectCount",0);class jr{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(t,r){this.keyToValue.set(t,r),this.valueToKey.set(r,t)}getByKey(t){return this.keyToValue.get(t)}getByValue(t){return this.valueToKey.get(t)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class qe{constructor(t){this.generateIdentifier=t,this.kv=new jr}register(t,r){this.kv.getByValue(t)||(r||(r=this.generateIdentifier(t)),this.kv.set(r,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}}class Ar extends qe{constructor(){super(t=>t.name),this.classToAllowedProps=new Map}register(t,r){typeof r=="object"?(r.allowProps&&this.classToAllowedProps.set(t,r.allowProps),super.register(t,r.identifier)):super.register(t,r)}getAllowedProps(t){return this.classToAllowedProps.get(t)}}function Ir(e){if("values"in Object)return Object.values(e);const t=[];for(const r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}function Fr(e,t){const r=Ir(e);if("find"in r)return r.find(t);const n=r;for(let i=0;i<n.length;i++){const s=n[i];if(t(s))return s}}function M(e,t){Object.entries(e).forEach(([r,n])=>t(n,r))}function oe(e,t){return e.indexOf(t)!==-1}function We(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(t(n))return n}}class Dr{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return Fr(this.transfomers,r=>r.isApplicable(t))}findByName(t){return this.transfomers[t]}}const Nr=e=>Object.prototype.toString.call(e).slice(8,-1),Ke=e=>typeof e>"u",Ur=e=>e===null,X=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,ge=e=>X(e)&&Object.keys(e).length===0,N=e=>Array.isArray(e),Lr=e=>typeof e=="string",Vr=e=>typeof e=="number"&&!isNaN(e),$r=e=>typeof e=="boolean",zr=e=>e instanceof RegExp,J=e=>e instanceof Map,Z=e=>e instanceof Set,Be=e=>Nr(e)==="Symbol",Mr=e=>e instanceof Date&&!isNaN(e.valueOf()),qr=e=>e instanceof Error,Ye=e=>typeof e=="number"&&isNaN(e),Wr=e=>$r(e)||Ur(e)||Ke(e)||Vr(e)||Lr(e)||Be(e),Kr=e=>typeof e=="bigint",Br=e=>e===1/0||e===-1/0,Yr=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Hr=e=>e instanceof URL,He=e=>e.replace(/\./g,"\\."),be=e=>e.map(String).map(He).join("."),Q=e=>{const t=[];let r="";for(let i=0;i<e.length;i++){let s=e.charAt(i);if(s==="\\"&&e.charAt(i+1)==="."){r+=".",i++;continue}if(s==="."){t.push(r),r="";continue}r+=s}const n=r;return t.push(n),t};function I(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}const Ge=[I(Ke,"undefined",()=>null,()=>{}),I(Kr,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),I(Mr,"Date",e=>e.toISOString(),e=>new Date(e)),I(qr,"Error",(e,t)=>{const r={name:e.name,message:e.message};return t.allowedErrorProps.forEach(n=>{r[n]=e[n]}),r},(e,t)=>{const r=new Error(e.message);return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach(n=>{r[n]=e[n]}),r}),I(zr,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),r=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,r)}),I(Z,"set",e=>[...e.values()],e=>new Set(e)),I(J,"map",e=>[...e.entries()],e=>new Map(e)),I(e=>Ye(e)||Br(e),"number",e=>Ye(e)?"NaN":e>0?"Infinity":"-Infinity",Number),I(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),I(Hr,"URL",e=>e.toString(),e=>new URL(e))];function ie(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}const Xe=ie((e,t)=>Be(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,r)=>{const n=r.symbolRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown symbol");return n}),Gr=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),Je=ie(Yr,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const r=Gr[t[1]];if(!r)throw new Error("Trying to deserialize unknown typed array");return new r(e)});function Ze(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}const Qe=ie(Ze,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return{...e};const n={};return r.forEach(i=>{n[i]=e[i]}),n},(e,t,r)=>{const n=r.classRegistry.getValue(t[1]);if(!n)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(n.prototype),e)}),et=ie((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,r)=>{const n=r.customTransformerRegistry.findByName(t[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(e)}),Xr=[Qe,Xe,et,Je],tt=(e,t)=>{const r=We(Xr,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};const n=We(Ge,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation}},rt={};Ge.forEach(e=>{rt[e.annotation]=e});const Jr=(e,t,r)=>{if(N(t))switch(t[0]){case"symbol":return Xe.untransform(e,t,r);case"class":return Qe.untransform(e,t,r);case"custom":return et.untransform(e,t,r);case"typed-array":return Je.untransform(e,t,r);default:throw new Error("Unknown transformation: "+t)}else{const n=rt[t];if(!n)throw new Error("Unknown transformation: "+t);return n.untransform(e,r)}},q=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const r=e.keys();for(;t>0;)r.next(),t--;return r.next().value};function nt(e){if(oe(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(oe(e,"prototype"))throw new Error("prototype is not allowed as a property");if(oe(e,"constructor"))throw new Error("constructor is not allowed as a property")}const Zr=(e,t)=>{nt(t);for(let r=0;r<t.length;r++){const n=t[r];if(Z(e))e=q(e,+n);else if(J(e)){const i=+n,s=+t[++r]==0?"key":"value",u=q(e,i);switch(s){case"key":e=u;break;case"value":e=e.get(u);break}}else e=e[n]}return e},we=(e,t,r)=>{if(nt(t),t.length===0)return r(e);let n=e;for(let s=0;s<t.length-1;s++){const u=t[s];if(N(n)){const l=+u;n=n[l]}else if(X(n))n=n[u];else if(Z(n)){const l=+u;n=q(n,l)}else if(J(n)){if(s===t.length-2)break;const a=+u,f=+t[++s]==0?"key":"value",m=q(n,a);switch(f){case"key":n=m;break;case"value":n=n.get(m);break}}}const i=t[t.length-1];if(N(n)?n[+i]=r(n[+i]):X(n)&&(n[i]=r(n[i])),Z(n)){const s=q(n,+i),u=r(s);s!==u&&(n.delete(s),n.add(u))}if(J(n)){const s=+t[t.length-2],u=q(n,s);switch(+i==0?"key":"value"){case"key":{const a=r(u);n.set(a,n.get(u)),a!==u&&n.delete(u);break}case"value":{n.set(u,r(n.get(u)));break}}}return e};function ve(e,t,r=[]){if(!e)return;if(!N(e)){M(e,(s,u)=>ve(s,t,[...r,...Q(u)]));return}const[n,i]=e;i&&M(i,(s,u)=>{ve(s,t,[...r,...Q(u)])}),t(n,r)}function Qr(e,t,r){return ve(t,(n,i)=>{e=we(e,i,s=>Jr(s,n,r))}),e}function en(e,t){function r(n,i){const s=Zr(e,Q(i));n.map(Q).forEach(u=>{e=we(e,u,()=>s)})}if(N(t)){const[n,i]=t;n.forEach(s=>{e=we(e,Q(s),()=>e)}),i&&M(i,r)}else M(t,r);return e}const tn=(e,t)=>X(e)||N(e)||J(e)||Z(e)||Ze(e,t);function rn(e,t,r){const n=r.get(e);n?n.push(t):r.set(e,[t])}function nn(e,t){const r={};let n;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(l=>l.map(String)).sort((l,a)=>l.length-a.length));const[s,...u]=i;s.length===0?n=u.map(be):r[be(s)]=u.map(be)}),n?ge(r)?[n]:[n,r]:ge(r)?void 0:r}const ot=(e,t,r,n,i=[],s=[],u=new Map)=>{const l=Wr(e);if(!l){rn(e,i,t);const w=u.get(e);if(w)return n?{transformedValue:null}:w}if(!tn(e,r)){const w=tt(e,r),_=w?{transformedValue:w.value,annotations:[w.type]}:{transformedValue:e};return l||u.set(e,_),_}if(oe(s,e))return{transformedValue:null};const a=tt(e,r),f=(a==null?void 0:a.value)??e,m=N(f)?[]:{},p={};M(f,(w,_)=>{if(_==="__proto__"||_==="constructor"||_==="prototype")throw new Error(`Detected property ${_}. This is a prototype pollution risk, please remove it from your object.`);const P=ot(w,t,r,n,[...i,_],[...s,e],u);m[_]=P.transformedValue,N(P.annotations)?p[_]=P.annotations:X(P.annotations)&&M(P.annotations,(W,A)=>{p[He(_)+"."+A]=W})});const h=ge(p)?{transformedValue:m,annotations:a?[a.type]:void 0}:{transformedValue:m,annotations:a?[a.type,p]:p};return l||u.set(e,h),h};function it(e){return Object.prototype.toString.call(e).slice(8,-1)}function st(e){return it(e)==="Array"}function on(e){if(it(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function sn(e,t,r,n,i){const s={}.propertyIsEnumerable.call(n,t)?"enumerable":"nonenumerable";s==="enumerable"&&(e[t]=r),i&&s==="nonenumerable"&&Object.defineProperty(e,t,{value:r,enumerable:!1,writable:!0,configurable:!0})}function Ee(e,t={}){if(st(e))return e.map(i=>Ee(i,t));if(!on(e))return e;const r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols(e);return[...r,...n].reduce((i,s)=>{if(st(t.props)&&!t.props.includes(s))return i;const u=e[s],l=Ee(u,t);return sn(i,s,l,e,t.nonenumerable),i},{})}class b{constructor({dedupe:t=!1}={}){this.classRegistry=new Ar,this.symbolRegistry=new qe(r=>r.description??""),this.customTransformerRegistry=new Dr,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const r=new Map,n=ot(t,r,this,this.dedupe),i={json:n.transformedValue};n.annotations&&(i.meta={...i.meta,values:n.annotations});const s=nn(r,this.dedupe);return s&&(i.meta={...i.meta,referentialEqualities:s}),i}deserialize(t){const{json:r,meta:n}=t;let i=Ee(r);return n!=null&&n.values&&(i=Qr(i,n.values,this)),n!=null&&n.referentialEqualities&&(i=en(i,n.referentialEqualities)),i}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t))}registerClass(t,r){this.classRegistry.register(t,r)}registerSymbol(t,r){this.symbolRegistry.register(t,r)}registerCustom(t,r){this.customTransformerRegistry.register({name:r,...t})}allowErrorProps(...t){this.allowedErrorProps.push(...t)}}b.defaultInstance=new b,b.serialize=b.defaultInstance.serialize.bind(b.defaultInstance),b.deserialize=b.defaultInstance.deserialize.bind(b.defaultInstance),b.stringify=b.defaultInstance.stringify.bind(b.defaultInstance),b.parse=b.defaultInstance.parse.bind(b.defaultInstance),b.registerClass=b.defaultInstance.registerClass.bind(b.defaultInstance),b.registerSymbol=b.defaultInstance.registerSymbol.bind(b.defaultInstance),b.registerCustom=b.defaultInstance.registerCustom.bind(b.defaultInstance),b.allowErrorProps=b.defaultInstance.allowErrorProps.bind(b.defaultInstance),b.serialize,b.deserialize,b.stringify,b.parse,b.registerClass,b.registerCustom,b.registerSymbol,b.allowErrorProps;const an="dev-jwt-token-for-testing",un=async()=>an,at=C.createContext(null);function cn(e,t){const r=ur({links:[Tr({enabled:n=>process.env.NODE_ENV==="development"&&typeof window<"u"||n.direction==="down"&&n.result instanceof Error}),Er({url:`${e}/trpc`,headers:async()=>({Authorization:`Bearer ${await t()}`}),transformer:b})]});return{getProjectsForUser:async()=>(await r.projectRouter.getAllProjects.query()).map(i=>({name:i.name,id:i.id})),addProjectForUser:async n=>{const i=await r.projectRouter.createProject.mutate({name:n});return{name:i.name,id:i.id}},addFilesToProject:async(n,i)=>{const s=[];for(const u of i){const l=await r.fileRouter.createFile.mutate({file:{projectId:n,mimeType:de.PDF,path:u.blobUrl,name:u.name,size:0,metadata:null,isArtifact:!1,summary:null,chunkingStatus:Ae.NOT_CHUNKED}});s.push({blobUrl:l.path,name:l.name,id:l.id})}return s},getFilesForProject:async n=>(await r.fileRouter.getFilesByProject.query({projectId:n})).map(s=>({blobUrl:s.path,name:s.name,id:s.id}))}}function ln({children:e,host:t="http://localhost",port:r=5174,getToken:n=un}){const[i,s]=C.useState(null);return C.useEffect(()=>{const u=`${t}:${r}`,l=cn(u,n);s(l)},[t,r,n]),fe.jsx(at.Provider,{value:{host:t,port:r,client:i},children:e})}function ut(){const e=C.useContext(at);if(!e)throw new Error("useFolioContext must be used within a FolioProvider");return e}const{useEffect:fn,useRef:dn,useState:mn}=zt;function pn({width:e="100%",height:t="100vh",allow:r="camera; microphone; clipboard-read; clipboard-write; fullscreen",style:n,className:i="",iframeProps:s={}}){const{host:u,port:l}=ut(),a=dn(null),[f,m]=mn();return fn(()=>{m(`${u}:${l}`)},[u,l]),f?fe.jsx("div",{className:`folio-embed-container ${i}`,style:{width:e,height:t,overflow:"hidden",...n},children:fe.jsx("iframe",{ref:a,src:f,width:"100%",height:"100%",style:{border:"none",width:"100%",height:"100%",overflow:"auto"},allow:r,allowFullScreen:!0,...s})}):null}function yn(){const{client:e}=ut(),[t,r]=C.useState(!1),[n,i]=C.useState(null);return{isLoading:t,error:n,getProjectsForUser:async()=>{for(;!e;)await new Promise(f=>setTimeout(f,100));r(!0),i(null);try{return await e.getProjectsForUser()}catch(f){return i(f instanceof Error?f:new Error(String(f))),[]}finally{r(!1)}},addProjectForUser:async f=>{for(;!e;)await new Promise(m=>setTimeout(m,100));r(!0),i(null);try{return await e.addProjectForUser(f)}catch(m){return i(m instanceof Error?m:new Error(String(m))),null}finally{r(!1)}},addFilesToProject:async(f,m)=>{for(;!e;)await new Promise(p=>setTimeout(p,100));r(!0),i(null);try{return await e.addFilesToProject(f,m)}catch(p){return i(p instanceof Error?p:new Error(String(p))),null}finally{r(!1)}},getFilesForProject:async f=>{for(;!e;)await new Promise(m=>setTimeout(m,100));r(!0),i(null);try{return await e.getFilesForProject(f)}catch(m){return i(m instanceof Error?m:new Error(String(m))),[]}finally{r(!1)}}}}F.FolioEmbed=pn,F.FolioProvider=ln,F.useFolio=yn,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shiftengineering/folio",
3
3
  "private": false,
4
- "version": "0.0.79",
4
+ "version": "0.0.80",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ShiftEngineering/folio.git"