@atproto/oauth-client-browser-example 0.0.0
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/LICENSE.txt +7 -0
- package/dist/files.json +31 -0
- package/dist/index.html +15 -0
- package/dist/main.css +676 -0
- package/dist/main.js +11 -0
- package/dist/main.js.map +1 -0
- package/package.json +60 -0
package/dist/main.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
!function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var n,o={exports:{}},i={},s={exports:{}},a={};s.exports=function(){if(n)return a;n=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.iterator,h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,m={};function b(e,t,r){this.props=e,this.context=t,this.refs=m,this.updater=r||h}function g(){}function v(e,t,r){this.props=e,this.context=t,this.refs=m,this.updater=r||h}b.prototype.isReactComponent={},b.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},b.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=b.prototype;var E=v.prototype=new g;E.constructor=v,y(E,b.prototype),E.isPureReactComponent=!0;var w=Array.isArray,R=Object.prototype.hasOwnProperty,A={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function S(t,r,n){var o,i={},s=null,a=null;if(null!=r)for(o in void 0!==r.ref&&(a=r.ref),void 0!==r.key&&(s=""+r.key),r)R.call(r,o)&&!_.hasOwnProperty(o)&&(i[o]=r[o]);var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){for(var l=Array(c),d=0;d<c;d++)l[d]=arguments[d+2];i.children=l}if(t&&t.defaultProps)for(o in c=t.defaultProps)void 0===i[o]&&(i[o]=c[o]);return{$$typeof:e,type:t,key:s,ref:a,props:i,_owner:A.current}}function k(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var T=/\/+/g;function C(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function L(r,n,o,i,s){var a=typeof r;"undefined"!==a&&"boolean"!==a||(r=null);var c=!1;if(null===r)c=!0;else switch(a){case"string":case"number":c=!0;break;case"object":switch(r.$$typeof){case e:case t:c=!0}}if(c)return s=s(c=r),r=""===i?"."+C(c,0):i,w(s)?(o="",null!=r&&(o=r.replace(T,"$&/")+"/"),L(s,n,o,"",(function(e){return e}))):null!=s&&(k(s)&&(s=function(t,r){return{$$typeof:e,type:t.type,key:r,ref:t.ref,props:t.props,_owner:t._owner}}(s,o+(!s.key||c&&c.key===s.key?"":(""+s.key).replace(T,"$&/")+"/")+r)),n.push(s)),1;if(c=0,i=""===i?".":i+":",w(r))for(var l=0;l<r.length;l++){var d=i+C(a=r[l],l);c+=L(a,n,o,d,s)}else if(d=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(r),"function"==typeof d)for(r=d.call(r),l=0;!(a=r.next()).done;)c+=L(a=a.value,n,o,d=i+C(a,l++),s);else if("object"===a)throw n=String(r),Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(r).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.");return c}function P(e,t,r){if(null==e)return e;var n=[],o=0;return L(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function x(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var B={current:null},j={transition:null},D={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:j,ReactCurrentOwner:A};function O(){throw Error("act(...) is not supported in production builds of React.")}return a.Children={map:P,forEach:function(e,t,r){P(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},a.Component=b,a.Fragment=r,a.Profiler=i,a.PureComponent=v,a.StrictMode=o,a.Suspense=d,a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,a.act=O,a.cloneElement=function(t,r,n){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=y({},t.props),i=t.key,s=t.ref,a=t._owner;if(null!=r){if(void 0!==r.ref&&(s=r.ref,a=A.current),void 0!==r.key&&(i=""+r.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(l in r)R.call(r,l)&&!_.hasOwnProperty(l)&&(o[l]=void 0===r[l]&&void 0!==c?c[l]:r[l])}var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){c=Array(l);for(var d=0;d<l;d++)c[d]=arguments[d+2];o.children=c}return{$$typeof:e,type:t.type,key:i,ref:s,props:o,_owner:a}},a.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},a.createElement=S,a.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},a.createRef=function(){return{current:null}},a.forwardRef=function(e){return{$$typeof:l,render:e}},a.isValidElement=k,a.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:x}},a.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},a.startTransition=function(e){var t=j.transition;j.transition={};try{e()}finally{j.transition=t}},a.unstable_act=O,a.useCallback=function(e,t){return B.current.useCallback(e,t)},a.useContext=function(e){return B.current.useContext(e)},a.useDebugValue=function(){},a.useDeferredValue=function(e){return B.current.useDeferredValue(e)},a.useEffect=function(e,t){return B.current.useEffect(e,t)},a.useId=function(){return B.current.useId()},a.useImperativeHandle=function(e,t,r){return B.current.useImperativeHandle(e,t,r)},a.useInsertionEffect=function(e,t){return B.current.useInsertionEffect(e,t)},a.useLayoutEffect=function(e,t){return B.current.useLayoutEffect(e,t)},a.useMemo=function(e,t){return B.current.useMemo(e,t)},a.useReducer=function(e,t,r){return B.current.useReducer(e,t,r)},a.useRef=function(e){return B.current.useRef(e)},a.useState=function(e){return B.current.useState(e)},a.useSyncExternalStore=function(e,t,r){return B.current.useSyncExternalStore(e,t,r)},a.useTransition=function(){return B.current.useTransition()},a.version="18.3.1",a}();var c,l=s.exports,d=t(l);o.exports=function(){if(c)return i;c=1;var e=l,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(e,r,i){var a,c={},l=null,d=null;for(a in void 0!==i&&(l=""+i),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(d=r.ref),r)n.call(r,a)&&!s.hasOwnProperty(a)&&(c[a]=r[a]);if(e&&e.defaultProps)for(a in r=e.defaultProps)void 0===c[a]&&(c[a]=r[a]);return{$$typeof:t,type:e,key:l,ref:d,props:c,_owner:o.current}}return i.Fragment=r,i.jsx=a,i.jsxs=a,i}();var u,p,f,h=o.exports,y={},m={exports:{}},b={},g={exports:{}},v={};function E(){return p||(p=1,g.exports=(u||(u=1,function(e){function t(e,t){var r=e.length;e.push(t);e:for(;0<r;){var n=r-1>>>1,i=e[n];if(!(0<o(i,t)))break e;e[n]=t,e[r]=i,r=n}}function r(e){return 0===e.length?null:e[0]}function n(e){if(0===e.length)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,i=e.length,s=i>>>1;n<s;){var a=2*(n+1)-1,c=e[a],l=a+1,d=e[l];if(0>o(c,r))l<i&&0>o(d,c)?(e[n]=d,e[l]=r,n=l):(e[n]=c,e[a]=r,n=a);else{if(!(l<i&&0>o(d,r)))break e;e[n]=d,e[l]=r,n=l}}}return t}function o(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var c=[],l=[],d=1,u=null,p=3,f=!1,h=!1,y=!1,m="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,g="undefined"!=typeof setImmediate?setImmediate:null;function v(e){for(var o=r(l);null!==o;){if(null===o.callback)n(l);else{if(!(o.startTime<=e))break;n(l),o.sortIndex=o.expirationTime,t(c,o)}o=r(l)}}function E(e){if(y=!1,v(e),!h)if(null!==r(c))h=!0,B(w);else{var t=r(l);null!==t&&j(E,t.startTime-e)}}function w(t,o){h=!1,y&&(y=!1,b(S),S=-1),f=!0;var i=p;try{for(v(o),u=r(c);null!==u&&(!(u.expirationTime>o)||t&&!C());){var s=u.callback;if("function"==typeof s){u.callback=null,p=u.priorityLevel;var a=s(u.expirationTime<=o);o=e.unstable_now(),"function"==typeof a?u.callback=a:u===r(c)&&n(c),v(o)}else n(c);u=r(c)}if(null!==u)var d=!0;else{var m=r(l);null!==m&&j(E,m.startTime-o),d=!1}return d}finally{u=null,p=i,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var R,A=!1,_=null,S=-1,k=5,T=-1;function C(){return!(e.unstable_now()-T<k)}function L(){if(null!==_){var t=e.unstable_now();T=t;var r=!0;try{r=_(!0,t)}finally{r?R():(A=!1,_=null)}}else A=!1}if("function"==typeof g)R=function(){g(L)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,x=P.port2;P.port1.onmessage=L,R=function(){x.postMessage(null)}}else R=function(){m(L,0)};function B(e){_=e,A||(A=!0,R())}function j(t,r){S=m((function(){t(e.unstable_now())}),r)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){h||f||(h=!0,B(w))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var r=p;p=t;try{return e()}finally{p=r}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=p;p=e;try{return t()}finally{p=r}},e.unstable_scheduleCallback=function(n,o,i){var s=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?s+i:s,n){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return n={id:d++,callback:o,priorityLevel:n,startTime:i,expirationTime:a=i+a,sortIndex:-1},i>s?(n.sortIndex=i,t(l,n),null===r(c)&&n===r(l)&&(y?(b(S),S=-1):y=!0,j(E,i-s))):(n.sortIndex=a,t(c,n),h||f||(h=!0,B(w))),n},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(e){var t=p;return function(){var r=p;p=t;try{return e.apply(this,arguments)}finally{p=r}}}}(v)),v)),g.exports}
|
|
2
|
+
/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-dom.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),m.exports=function(){if(f)return b;f=1;var e=l,t=E();function r(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,o={};function i(e,t){s(e,t),s(e+"Capture",t)}function s(e,t){for(o[e]=t,e=0;e<t.length;e++)n.add(t[e])}var a=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),c=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,u={},p={};function h(e,t,r,n,o,i,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){y[e]=new h(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];y[t]=new h(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){y[e]=new h(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){y[e]=new h(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){y[e]=new h(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){y[e]=new h(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){y[e]=new h(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){y[e]=new h(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){y[e]=new h(e,5,!1,e.toLowerCase(),null,!1,!1)}));var m=/[\-:]([a-z])/g;function g(e){return e[1].toUpperCase()}function v(e,t,r,n){var o=y.hasOwnProperty(t)?y[t]:null;(null!==o?0!==o.type:n||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,r,n){if(null==t||function(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,r,o,n)&&(r=null),n||null===o?function(e){return!!c.call(p,e)||!c.call(u,e)&&(d.test(e)?p[e]=!0:(u[e]=!0,!1))}(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):o.mustUseProperty?e[o.propertyName]=null===r?3!==o.type&&"":r:(t=o.attributeName,n=o.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(o=o.type)||4===o&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(m,g);y[t]=new h(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(m,g);y[t]=new h(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(m,g);y[t]=new h(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){y[e]=new h(e,1,!1,e.toLowerCase(),null,!1,!1)})),y.xlinkHref=new h("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){y[e]=new h(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),A=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),C=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),O=Symbol.iterator;function U(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var I,K=Object.assign;function M(e){if(void 0===I)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||""}return"\n"+I+e}var V=!1;function N(e,t){if(!e||V)return"";V=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var n=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){n=e}e.call(t.prototype)}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var o=t.stack.split("\n"),i=n.stack.split("\n"),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(1!==s||1!==a)do{if(s--,0>--a||o[s]!==i[a]){var c="\n"+o[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}}while(1<=s&&0<=a);break}}}finally{V=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?M(e):""}function z(e){switch(e.tag){case 5:return M(e.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return N(e.type,!1);case 11:return N(e.type.render,!1);case 1:return N(e.type,!0);default:return""}}function F(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case _:return"Fragment";case A:return"Portal";case k:return"Profiler";case S:return"StrictMode";case P:return"Suspense";case x:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case T:return(e._context.displayName||"Context")+".Provider";case L:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case B:return null!==(t=e.displayName||null)?t:F(e.type)||"Memo";case j:t=e._payload,e=e._init;try{return F(e(t))}catch(e){}}return null}function q(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return F(t);case 8:return t===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function $(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function G(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function H(e){e._valueTracker||(e._valueTracker=function(e){var t=G(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){n=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function X(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=G(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function W(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var r=t.checked;return K({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function J(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=$(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Q(e,t){null!=(t=t.checked)&&v(e,"checked",t,!1)}function Y(e,t){Q(e,t);var r=$(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?te(e,t.type,r):t.hasOwnProperty("defaultValue")&&te(e,t.type,$(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ee(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function te(e,t,r){"number"===t&&W(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var re=Array.isArray;function ne(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o<r.length;o++)t["$"+r[o]]=!0;for(r=0;r<e.length;r++)o=t.hasOwnProperty("$"+e[r].value),e[r].selected!==o&&(e[r].selected=o),o&&n&&(e[r].defaultSelected=!0)}else{for(r=""+$(r),t=null,o=0;o<e.length;o++){if(e[o].value===r)return e[o].selected=!0,void(n&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function oe(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(r(91));return K({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(r(92));if(re(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:$(n)}}function se(e,t){var r=$(t.value),n=$(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function ae(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function ce(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ce(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var de,ue,pe=(ue=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((de=de||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=de.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return ue(e,t)}))}:ue);function fe(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var he={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ye=["Webkit","ms","Moz","O"];function me(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||he.hasOwnProperty(e)&&he[e]?(""+t).trim():t+"px"}function be(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),o=me(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}Object.keys(he).forEach((function(e){ye.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),he[t]=he[e]}))}));var ge=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ve(e,t){if(t){if(ge[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(r(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(r(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(r(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(r(62))}}function Ee(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we=null;function Re(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ae=null,_e=null,Se=null;function ke(e){if(e=go(e)){if("function"!=typeof Ae)throw Error(r(280));var t=e.stateNode;t&&(t=Eo(t),Ae(e.stateNode,e.type,t))}}function Te(e){_e?Se?Se.push(e):Se=[e]:_e=e}function Ce(){if(_e){var e=_e,t=Se;if(Se=_e=null,ke(e),t)for(e=0;e<t.length;e++)ke(t[e])}}function Le(e,t){return e(t)}function Pe(){}var xe=!1;function Be(e,t,r){if(xe)return e(t,r);xe=!0;try{return Le(e,t,r)}finally{xe=!1,(null!==_e||null!==Se)&&(Pe(),Ce())}}function je(e,t){var n=e.stateNode;if(null===n)return null;var o=Eo(n);if(null===o)return null;n=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(o=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(r(231,t,typeof n));return n}var De=!1;if(a)try{var Oe={};Object.defineProperty(Oe,"passive",{get:function(){De=!0}}),window.addEventListener("test",Oe,Oe),window.removeEventListener("test",Oe,Oe)}catch(ue){De=!1}function Ue(e,t,r,n,o,i,s,a,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(r,l)}catch(e){this.onError(e)}}var Ie=!1,Ke=null,Me=!1,Ve=null,Ne={onError:function(e){Ie=!0,Ke=e}};function ze(e,t,r,n,o,i,s,a,c){Ie=!1,Ke=null,Ue.apply(Ne,arguments)}function Fe(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function qe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function $e(e){if(Fe(e)!==e)throw Error(r(188))}function Ge(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Fe(e)))throw Error(r(188));return t!==e?null:e}for(var n=e,o=t;;){var i=n.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(o=i.return)){n=o;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return $e(i),e;if(s===o)return $e(i),t;s=s.sibling}throw Error(r(188))}if(n.return!==o.return)n=i,o=s;else{for(var a=!1,c=i.child;c;){if(c===n){a=!0,n=i,o=s;break}if(c===o){a=!0,o=i,n=s;break}c=c.sibling}if(!a){for(c=s.child;c;){if(c===n){a=!0,n=s,o=i;break}if(c===o){a=!0,o=s,n=i;break}c=c.sibling}if(!a)throw Error(r(189))}}if(n.alternate!==o)throw Error(r(190))}if(3!==n.tag)throw Error(r(188));return n.stateNode.current===n?e:t}(e))?He(e):null}function He(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=He(e);if(null!==t)return t;e=e.sibling}return null}var Xe=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,Ze=t.unstable_shouldYield,Je=t.unstable_requestPaint,Qe=t.unstable_now,Ye=t.unstable_getCurrentPriorityLevel,et=t.unstable_ImmediatePriority,tt=t.unstable_UserBlockingPriority,rt=t.unstable_NormalPriority,nt=t.unstable_LowPriority,ot=t.unstable_IdlePriority,it=null,st=null,at=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(ct(e)/lt|0)|0},ct=Math.log,lt=Math.LN2,dt=64,ut=4194304;function pt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ft(e,t){var r=e.pendingLanes;if(0===r)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,s=268435455&r;if(0!==s){var a=s&~o;0!==a?n=pt(a):0!=(i&=s)&&(n=pt(i))}else 0!=(s=r&~o)?n=pt(s):0!==i&&(n=pt(i));if(0===n)return 0;if(0!==t&&t!==n&&!(t&o)&&((o=n&-n)>=(i=t&-t)||16===o&&4194240&i))return t;if(4&n&&(n|=16&r),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0<t;)o=1<<(r=31-at(t)),n|=e[r],t&=~o;return n}function ht(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function yt(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function mt(){var e=dt;return!(4194240&(dt<<=1))&&(dt=64),e}function bt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function gt(e,t,r){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-at(t)]=r}function vt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-at(r),o=1<<n;o&t|e[n]&t&&(e[n]|=t),r&=~o}}var Et=0;function wt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var Rt,At,_t,St,kt,Tt=!1,Ct=[],Lt=null,Pt=null,xt=null,Bt=new Map,jt=new Map,Dt=[],Ot="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ut(e,t){switch(e){case"focusin":case"focusout":Lt=null;break;case"dragenter":case"dragleave":Pt=null;break;case"mouseover":case"mouseout":xt=null;break;case"pointerover":case"pointerout":Bt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jt.delete(t.pointerId)}}function It(e,t,r,n,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[o]},null!==t&&null!==(t=go(t))&&At(t),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Kt(e){var t=bo(e.target);if(null!==t){var r=Fe(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=qe(r)))return e.blockedOn=t,void kt(e.priority,(function(){_t(r)}))}else if(3===t&&r.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function Mt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var r=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r)return null!==(t=go(r))&&At(t),e.blockedOn=r,!1;var n=new(r=e.nativeEvent).constructor(r.type,r);we=n,r.target.dispatchEvent(n),we=null,t.shift()}return!0}function Vt(e,t,r){Mt(e)&&r.delete(t)}function Nt(){Tt=!1,null!==Lt&&Mt(Lt)&&(Lt=null),null!==Pt&&Mt(Pt)&&(Pt=null),null!==xt&&Mt(xt)&&(xt=null),Bt.forEach(Vt),jt.forEach(Vt)}function zt(e,r){e.blockedOn===r&&(e.blockedOn=null,Tt||(Tt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Nt)))}function Ft(e){function t(t){return zt(t,e)}if(0<Ct.length){zt(Ct[0],e);for(var r=1;r<Ct.length;r++){var n=Ct[r];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==Lt&&zt(Lt,e),null!==Pt&&zt(Pt,e),null!==xt&&zt(xt,e),Bt.forEach(t),jt.forEach(t),r=0;r<Dt.length;r++)(n=Dt[r]).blockedOn===e&&(n.blockedOn=null);for(;0<Dt.length&&null===(r=Dt[0]).blockedOn;)Kt(r),null===r.blockedOn&&Dt.shift()}var qt=w.ReactCurrentBatchConfig,$t=!0;function Gt(e,t,r,n){var o=Et,i=qt.transition;qt.transition=null;try{Et=1,Xt(e,t,r,n)}finally{Et=o,qt.transition=i}}function Ht(e,t,r,n){var o=Et,i=qt.transition;qt.transition=null;try{Et=4,Xt(e,t,r,n)}finally{Et=o,qt.transition=i}}function Xt(e,t,r,n){if($t){var o=Zt(e,t,r,n);if(null===o)zn(e,t,n,Wt,r),Ut(e,n);else if(function(e,t,r,n,o){switch(t){case"focusin":return Lt=It(Lt,e,t,r,n,o),!0;case"dragenter":return Pt=It(Pt,e,t,r,n,o),!0;case"mouseover":return xt=It(xt,e,t,r,n,o),!0;case"pointerover":var i=o.pointerId;return Bt.set(i,It(Bt.get(i)||null,e,t,r,n,o)),!0;case"gotpointercapture":return i=o.pointerId,jt.set(i,It(jt.get(i)||null,e,t,r,n,o)),!0}return!1}(o,e,t,r,n))n.stopPropagation();else if(Ut(e,n),4&t&&-1<Ot.indexOf(e)){for(;null!==o;){var i=go(o);if(null!==i&&Rt(i),null===(i=Zt(e,t,r,n))&&zn(e,t,n,Wt,r),i===o)break;o=i}null!==o&&n.stopPropagation()}else zn(e,t,n,null,r)}}var Wt=null;function Zt(e,t,r,n){if(Wt=null,null!==(e=bo(e=Re(n))))if(null===(t=Fe(e)))e=null;else if(13===(r=t.tag)){if(null!==(e=qe(t)))return e;e=null}else if(3===r){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Wt=e,null}function Jt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ye()){case et:return 1;case tt:return 4;case rt:case nt:return 16;case ot:return 536870912;default:return 16}default:return 16}}var Qt=null,Yt=null,er=null;function tr(){if(er)return er;var e,t,r=Yt,n=r.length,o="value"in Qt?Qt.value:Qt.textContent,i=o.length;for(e=0;e<n&&r[e]===o[e];e++);var s=n-e;for(t=1;t<=s&&r[n-t]===o[i-t];t++);return er=o.slice(e,1<t?1-t:void 0)}function rr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nr(){return!0}function or(){return!1}function ir(e){function t(t,r,n,o,i){for(var s in this._reactName=t,this._targetInst=n,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(o):o[s]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?nr:or,this.isPropagationStopped=or,this}return K(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nr)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nr)},persist:function(){},isPersistent:nr}),t}var sr,ar,cr,lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dr=ir(lr),ur=K({},lr,{view:0,detail:0}),pr=ir(ur),fr=K({},ur,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_r,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==cr&&(cr&&"mousemove"===e.type?(sr=e.screenX-cr.screenX,ar=e.screenY-cr.screenY):ar=sr=0,cr=e),sr)},movementY:function(e){return"movementY"in e?e.movementY:ar}}),hr=ir(fr),yr=ir(K({},fr,{dataTransfer:0})),mr=ir(K({},ur,{relatedTarget:0})),br=ir(K({},lr,{animationName:0,elapsedTime:0,pseudoElement:0})),gr=ir(K({},lr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),vr=ir(K({},lr,{data:0})),Er={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Rr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ar(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Rr[e])&&!!t[e]}function _r(){return Ar}var Sr=ir(K({},ur,{key:function(e){if(e.key){var t=Er[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=rr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?wr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_r,charCode:function(e){return"keypress"===e.type?rr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?rr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),kr=ir(K({},fr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Tr=ir(K({},ur,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_r})),Cr=ir(K({},lr,{propertyName:0,elapsedTime:0,pseudoElement:0})),Lr=ir(K({},fr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Pr=[9,13,27,32],xr=a&&"CompositionEvent"in window,Br=null;a&&"documentMode"in document&&(Br=document.documentMode);var jr=a&&"TextEvent"in window&&!Br,Dr=a&&(!xr||Br&&8<Br&&11>=Br),Or=String.fromCharCode(32),Ur=!1;function Ir(e,t){switch(e){case"keyup":return-1!==Pr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kr(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Mr=!1,Vr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Nr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Vr[e.type]:"textarea"===t}function zr(e,t,r,n){Te(n),0<(t=qn(t,"onChange")).length&&(r=new dr("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Fr=null,qr=null;function $r(e){Un(e,0)}function Gr(e){if(X(vo(e)))return e}function Hr(e,t){if("change"===e)return t}var Xr=!1;if(a){var Wr;if(a){var Zr="oninput"in document;if(!Zr){var Jr=document.createElement("div");Jr.setAttribute("oninput","return;"),Zr="function"==typeof Jr.oninput}Wr=Zr}else Wr=!1;Xr=Wr&&(!document.documentMode||9<document.documentMode)}function Qr(){Fr&&(Fr.detachEvent("onpropertychange",Yr),qr=Fr=null)}function Yr(e){if("value"===e.propertyName&&Gr(qr)){var t=[];zr(t,qr,e,Re(e)),Be($r,t)}}function en(e,t,r){"focusin"===e?(Qr(),qr=r,(Fr=t).attachEvent("onpropertychange",Yr)):"focusout"===e&&Qr()}function tn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Gr(qr)}function rn(e,t){if("click"===e)return Gr(t)}function nn(e,t){if("input"===e||"change"===e)return Gr(t)}var on="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function sn(e,t){if(on(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var o=r[n];if(!c.call(t,o)||!on(e[o],t[o]))return!1}return!0}function an(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cn(e,t){var r,n=an(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=an(n)}}function ln(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ln(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function dn(){for(var e=window,t=W();t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=W((e=t.contentWindow).document)}return t}function un(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function pn(e){var t=dn(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&ln(r.ownerDocument.documentElement,r)){if(null!==n&&un(r))if(t=n.start,void 0===(e=n.end)&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if((e=(t=r.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=void 0===n.end?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=cn(r,i);var s=cn(r,n);o&&s&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}for(t=[],e=r;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof r.focus&&r.focus(),r=0;r<t.length;r++)(e=t[r]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var fn=a&&"documentMode"in document&&11>=document.documentMode,hn=null,yn=null,mn=null,bn=!1;function gn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;bn||null==hn||hn!==W(n)||(n="selectionStart"in(n=hn)&&un(n)?{start:n.selectionStart,end:n.selectionEnd}:{anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},mn&&sn(mn,n)||(mn=n,0<(n=qn(yn,"onSelect")).length&&(t=new dr("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=hn)))}function vn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var En={animationend:vn("Animation","AnimationEnd"),animationiteration:vn("Animation","AnimationIteration"),animationstart:vn("Animation","AnimationStart"),transitionend:vn("Transition","TransitionEnd")},wn={},Rn={};function An(e){if(wn[e])return wn[e];if(!En[e])return e;var t,r=En[e];for(t in r)if(r.hasOwnProperty(t)&&t in Rn)return wn[e]=r[t];return e}a&&(Rn=document.createElement("div").style,"AnimationEvent"in window||(delete En.animationend.animation,delete En.animationiteration.animation,delete En.animationstart.animation),"TransitionEvent"in window||delete En.transitionend.transition);var _n=An("animationend"),Sn=An("animationiteration"),kn=An("animationstart"),Tn=An("transitionend"),Cn=new Map,Ln="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Pn(e,t){Cn.set(e,t),i(t,[e])}for(var xn=0;xn<Ln.length;xn++){var Bn=Ln[xn];Pn(Bn.toLowerCase(),"on"+(Bn[0].toUpperCase()+Bn.slice(1)))}Pn(_n,"onAnimationEnd"),Pn(Sn,"onAnimationIteration"),Pn(kn,"onAnimationStart"),Pn("dblclick","onDoubleClick"),Pn("focusin","onFocus"),Pn("focusout","onBlur"),Pn(Tn,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Dn=new Set("cancel close invalid load scroll toggle".split(" ").concat(jn));function On(e,t,n){var o=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,o,i,s,a,c,l){if(ze.apply(this,arguments),Ie){if(!Ie)throw Error(r(198));var d=Ke;Ie=!1,Ke=null,Me||(Me=!0,Ve=d)}}(o,t,void 0,e),e.currentTarget=null}function Un(e,t){t=!!(4&t);for(var r=0;r<e.length;r++){var n=e[r],o=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var s=n.length-1;0<=s;s--){var a=n[s],c=a.instance,l=a.currentTarget;if(a=a.listener,c!==i&&o.isPropagationStopped())break e;On(o,a,l),i=c}else for(s=0;s<n.length;s++){if(c=(a=n[s]).instance,l=a.currentTarget,a=a.listener,c!==i&&o.isPropagationStopped())break e;On(o,a,l),i=c}}}if(Me)throw e=Ve,Me=!1,Ve=null,e}function In(e,t){var r=t[ho];void 0===r&&(r=t[ho]=new Set);var n=e+"__bubble";r.has(n)||(Nn(t,e,2,!1),r.add(n))}function Kn(e,t,r){var n=0;t&&(n|=4),Nn(r,e,n,t)}var Mn="_reactListening"+Math.random().toString(36).slice(2);function Vn(e){if(!e[Mn]){e[Mn]=!0,n.forEach((function(t){"selectionchange"!==t&&(Dn.has(t)||Kn(t,!1,e),Kn(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Mn]||(t[Mn]=!0,Kn("selectionchange",!1,t))}}function Nn(e,t,r,n){switch(Jt(t)){case 1:var o=Gt;break;case 4:o=Ht;break;default:o=Xt}r=o.bind(null,t,r,e),o=void 0,!De||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),n?void 0!==o?e.addEventListener(t,r,{capture:!0,passive:o}):e.addEventListener(t,r,!0):void 0!==o?e.addEventListener(t,r,{passive:o}):e.addEventListener(t,r,!1)}function zn(e,t,r,n,o){var i=n;if(!(1&t||2&t||null===n))e:for(;;){if(null===n)return;var s=n.tag;if(3===s||4===s){var a=n.stateNode.containerInfo;if(a===o||8===a.nodeType&&a.parentNode===o)break;if(4===s)for(s=n.return;null!==s;){var c=s.tag;if((3===c||4===c)&&((c=s.stateNode.containerInfo)===o||8===c.nodeType&&c.parentNode===o))return;s=s.return}for(;null!==a;){if(null===(s=bo(a)))return;if(5===(c=s.tag)||6===c){n=i=s;continue e}a=a.parentNode}}n=n.return}Be((function(){var n=i,o=Re(r),s=[];e:{var a=Cn.get(e);if(void 0!==a){var c=dr,l=e;switch(e){case"keypress":if(0===rr(r))break e;case"keydown":case"keyup":c=Sr;break;case"focusin":l="focus",c=mr;break;case"focusout":l="blur",c=mr;break;case"beforeblur":case"afterblur":c=mr;break;case"click":if(2===r.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=hr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=yr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=Tr;break;case _n:case Sn:case kn:c=br;break;case Tn:c=Cr;break;case"scroll":c=pr;break;case"wheel":c=Lr;break;case"copy":case"cut":case"paste":c=gr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=kr}var d=!!(4&t),u=!d&&"scroll"===e,p=d?null!==a?a+"Capture":null:a;d=[];for(var f,h=n;null!==h;){var y=(f=h).stateNode;if(5===f.tag&&null!==y&&(f=y,null!==p&&null!=(y=je(h,p))&&d.push(Fn(h,y,f))),u)break;h=h.return}0<d.length&&(a=new c(a,l,null,r,o),s.push({event:a,listeners:d}))}}if(!(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||r===we||!(l=r.relatedTarget||r.fromElement)||!bo(l)&&!l[fo])&&(c||a)&&(a=o.window===o?o:(a=o.ownerDocument)?a.defaultView||a.parentWindow:window,c?(c=n,null!==(l=(l=r.relatedTarget||r.toElement)?bo(l):null)&&(l!==(u=Fe(l))||5!==l.tag&&6!==l.tag)&&(l=null)):(c=null,l=n),c!==l)){if(d=hr,y="onMouseLeave",p="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(d=kr,y="onPointerLeave",p="onPointerEnter",h="pointer"),u=null==c?a:vo(c),f=null==l?a:vo(l),(a=new d(y,h+"leave",c,r,o)).target=u,a.relatedTarget=f,y=null,bo(o)===n&&((d=new d(p,h+"enter",l,r,o)).target=f,d.relatedTarget=u,y=d),u=y,c&&l)e:{for(p=l,h=0,f=d=c;f;f=$n(f))h++;for(f=0,y=p;y;y=$n(y))f++;for(;0<h-f;)d=$n(d),h--;for(;0<f-h;)p=$n(p),f--;for(;h--;){if(d===p||null!==p&&d===p.alternate)break e;d=$n(d),p=$n(p)}d=null}else d=null;null!==c&&Gn(s,a,c,d,!1),null!==l&&null!==u&&Gn(s,u,l,d,!0)}if("select"===(c=(a=n?vo(n):window).nodeName&&a.nodeName.toLowerCase())||"input"===c&&"file"===a.type)var m=Hr;else if(Nr(a))if(Xr)m=nn;else{m=tn;var b=en}else(c=a.nodeName)&&"input"===c.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(m=rn);switch(m&&(m=m(e,n))?zr(s,m,r,o):(b&&b(e,a,n),"focusout"===e&&(b=a._wrapperState)&&b.controlled&&"number"===a.type&&te(a,"number",a.value)),b=n?vo(n):window,e){case"focusin":(Nr(b)||"true"===b.contentEditable)&&(hn=b,yn=n,mn=null);break;case"focusout":mn=yn=hn=null;break;case"mousedown":bn=!0;break;case"contextmenu":case"mouseup":case"dragend":bn=!1,gn(s,r,o);break;case"selectionchange":if(fn)break;case"keydown":case"keyup":gn(s,r,o)}var g;if(xr)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else Mr?Ir(e,r)&&(v="onCompositionEnd"):"keydown"===e&&229===r.keyCode&&(v="onCompositionStart");v&&(Dr&&"ko"!==r.locale&&(Mr||"onCompositionStart"!==v?"onCompositionEnd"===v&&Mr&&(g=tr()):(Yt="value"in(Qt=o)?Qt.value:Qt.textContent,Mr=!0)),0<(b=qn(n,v)).length&&(v=new vr(v,e,null,r,o),s.push({event:v,listeners:b}),(g||null!==(g=Kr(r)))&&(v.data=g))),(g=jr?function(e,t){switch(e){case"compositionend":return Kr(t);case"keypress":return 32!==t.which?null:(Ur=!0,Or);case"textInput":return(e=t.data)===Or&&Ur?null:e;default:return null}}(e,r):function(e,t){if(Mr)return"compositionend"===e||!xr&&Ir(e,t)?(e=tr(),er=Yt=Qt=null,Mr=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dr&&"ko"!==t.locale?null:t.data}}(e,r))&&0<(n=qn(n,"onBeforeInput")).length&&(o=new vr("onBeforeInput","beforeinput",null,r,o),s.push({event:o,listeners:n}),o.data=g)}Un(s,t)}))}function Fn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function qn(e,t){for(var r=t+"Capture",n=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=je(e,r))&&n.unshift(Fn(e,i,o)),null!=(i=je(e,t))&&n.push(Fn(e,i,o))),e=e.return}return n}function $n(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Gn(e,t,r,n,o){for(var i=t._reactName,s=[];null!==r&&r!==n;){var a=r,c=a.alternate,l=a.stateNode;if(null!==c&&c===n)break;5===a.tag&&null!==l&&(a=l,o?null!=(c=je(r,i))&&s.unshift(Fn(r,c,a)):o||null!=(c=je(r,i))&&s.push(Fn(r,c,a))),r=r.return}0!==s.length&&e.push({event:t,listeners:s})}var Hn=/\r\n?/g,Xn=/\u0000|\uFFFD/g;function Wn(e){return("string"==typeof e?e:""+e).replace(Hn,"\n").replace(Xn,"")}function Zn(e,t,n){if(t=Wn(t),Wn(e)!==t&&n)throw Error(r(425))}function Jn(){}var Qn=null,Yn=null;function eo(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var to="function"==typeof setTimeout?setTimeout:void 0,ro="function"==typeof clearTimeout?clearTimeout:void 0,no="function"==typeof Promise?Promise:void 0,oo="function"==typeof queueMicrotask?queueMicrotask:void 0!==no?function(e){return no.resolve(null).then(e).catch(io)}:to;function io(e){setTimeout((function(){throw e}))}function so(e,t){var r=t,n=0;do{var o=r.nextSibling;if(e.removeChild(r),o&&8===o.nodeType)if("/$"===(r=o.data)){if(0===n)return e.removeChild(o),void Ft(t);n--}else"$"!==r&&"$?"!==r&&"$!"!==r||n++;r=o}while(r);Ft(t)}function ao(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function co(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||"$!"===r||"$?"===r){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}var lo=Math.random().toString(36).slice(2),uo="__reactFiber$"+lo,po="__reactProps$"+lo,fo="__reactContainer$"+lo,ho="__reactEvents$"+lo,yo="__reactListeners$"+lo,mo="__reactHandles$"+lo;function bo(e){var t=e[uo];if(t)return t;for(var r=e.parentNode;r;){if(t=r[fo]||r[uo]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=co(e);null!==e;){if(r=e[uo])return r;e=co(e)}return t}r=(e=r).parentNode}return null}function go(e){return!(e=e[uo]||e[fo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function vo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(r(33))}function Eo(e){return e[po]||null}var wo=[],Ro=-1;function Ao(e){return{current:e}}function _o(e){0>Ro||(e.current=wo[Ro],wo[Ro]=null,Ro--)}function So(e,t){Ro++,wo[Ro]=e.current,e.current=t}var ko={},To=Ao(ko),Co=Ao(!1),Lo=ko;function Po(e,t){var r=e.type.contextTypes;if(!r)return ko;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in r)i[o]=t[o];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xo(e){return null!=e.childContextTypes}function Bo(){_o(Co),_o(To)}function jo(e,t,n){if(To.current!==ko)throw Error(r(168));So(To,t),So(Co,n)}function Do(e,t,n){var o=e.stateNode;if(t=t.childContextTypes,"function"!=typeof o.getChildContext)return n;for(var i in o=o.getChildContext())if(!(i in t))throw Error(r(108,q(e)||"Unknown",i));return K({},n,o)}function Oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ko,Lo=To.current,So(To,e),So(Co,Co.current),!0}function Uo(e,t,n){var o=e.stateNode;if(!o)throw Error(r(169));n?(e=Do(e,t,Lo),o.__reactInternalMemoizedMergedChildContext=e,_o(Co),_o(To),So(To,e)):_o(Co),So(Co,n)}var Io=null,Ko=!1,Mo=!1;function Vo(e){null===Io?Io=[e]:Io.push(e)}function No(){if(!Mo&&null!==Io){Mo=!0;var e=0,t=Et;try{var r=Io;for(Et=1;e<r.length;e++){var n=r[e];do{n=n(!0)}while(null!==n)}Io=null,Ko=!1}catch(t){throw null!==Io&&(Io=Io.slice(e+1)),Xe(et,No),t}finally{Et=t,Mo=!1}}return null}var zo=[],Fo=0,qo=null,$o=0,Go=[],Ho=0,Xo=null,Wo=1,Zo="";function Jo(e,t){zo[Fo++]=$o,zo[Fo++]=qo,qo=e,$o=t}function Qo(e,t,r){Go[Ho++]=Wo,Go[Ho++]=Zo,Go[Ho++]=Xo,Xo=e;var n=Wo;e=Zo;var o=32-at(n)-1;n&=~(1<<o),r+=1;var i=32-at(t)+o;if(30<i){var s=o-o%5;i=(n&(1<<s)-1).toString(32),n>>=s,o-=s,Wo=1<<32-at(t)+o|r<<o|n,Zo=i+e}else Wo=1<<i|r<<o|n,Zo=e}function Yo(e){null!==e.return&&(Jo(e,1),Qo(e,1,0))}function ei(e){for(;e===qo;)qo=zo[--Fo],zo[Fo]=null,$o=zo[--Fo],zo[Fo]=null;for(;e===Xo;)Xo=Go[--Ho],Go[Ho]=null,Zo=Go[--Ho],Go[Ho]=null,Wo=Go[--Ho],Go[Ho]=null}var ti=null,ri=null,ni=!1,oi=null;function ii(e,t){var r=Ll(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,null===(t=e.deletions)?(e.deletions=[r],e.flags|=16):t.push(r)}function si(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ti=e,ri=ao(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ti=e,ri=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(r=null!==Xo?{id:Wo,overflow:Zo}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},(r=Ll(18,null,null,0)).stateNode=t,r.return=e,e.child=r,ti=e,ri=null,!0);default:return!1}}function ai(e){return!(!(1&e.mode)||128&e.flags)}function ci(e){if(ni){var t=ri;if(t){var n=t;if(!si(e,t)){if(ai(e))throw Error(r(418));t=ao(n.nextSibling);var o=ti;t&&si(e,t)?ii(o,n):(e.flags=-4097&e.flags|2,ni=!1,ti=e)}}else{if(ai(e))throw Error(r(418));e.flags=-4097&e.flags|2,ni=!1,ti=e}}}function li(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ti=e}function di(e){if(e!==ti)return!1;if(!ni)return li(e),ni=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!eo(e.type,e.memoizedProps)),t&&(t=ri)){if(ai(e))throw ui(),Error(r(418));for(;t;)ii(e,t),t=ao(t.nextSibling)}if(li(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){ri=ao(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}ri=null}}else ri=ti?ao(e.stateNode.nextSibling):null;return!0}function ui(){for(var e=ri;e;)e=ao(e.nextSibling)}function pi(){ri=ti=null,ni=!1}function fi(e){null===oi?oi=[e]:oi.push(e)}var hi=w.ReactCurrentBatchConfig;function yi(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(r(309));var o=n.stateNode}if(!o)throw Error(r(147,e));var i=o,s=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===s?t.ref:(t=function(e){var t=i.refs;null===e?delete t[s]:t[s]=e},t._stringRef=s,t)}if("string"!=typeof e)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function mi(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function bi(e){return(0,e._init)(e._payload)}function gi(e){function t(t,r){if(e){var n=t.deletions;null===n?(t.deletions=[r],t.flags|=16):n.push(r)}}function n(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function o(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=xl(e,t)).index=0,e.sibling=null,e}function s(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags|=2,r):n:(t.flags|=2,r):(t.flags|=1048576,r)}function a(t){return e&&null===t.alternate&&(t.flags|=2),t}function c(e,t,r,n){return null===t||6!==t.tag?((t=Ol(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function l(e,t,r,n){var o=r.type;return o===_?u(e,t,r.props.children,n,r.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===j&&bi(o)===t.type)?((n=i(t,r.props)).ref=yi(e,t,r),n.return=e,n):((n=Bl(r.type,r.key,r.props,null,e.mode,n)).ref=yi(e,t,r),n.return=e,n)}function d(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=Ul(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function u(e,t,r,n,o){return null===t||7!==t.tag?((t=jl(r,e.mode,n,o)).return=e,t):((t=i(t,r)).return=e,t)}function p(e,t,r){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Ol(""+t,e.mode,r)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case R:return(r=Bl(t.type,t.key,t.props,null,e.mode,r)).ref=yi(e,null,t),r.return=e,r;case A:return(t=Ul(t,e.mode,r)).return=e,t;case j:return p(e,(0,t._init)(t._payload),r)}if(re(t)||U(t))return(t=jl(t,e.mode,r,null)).return=e,t;mi(e,t)}return null}function f(e,t,r,n){var o=null!==t?t.key:null;if("string"==typeof r&&""!==r||"number"==typeof r)return null!==o?null:c(e,t,""+r,n);if("object"==typeof r&&null!==r){switch(r.$$typeof){case R:return r.key===o?l(e,t,r,n):null;case A:return r.key===o?d(e,t,r,n):null;case j:return f(e,t,(o=r._init)(r._payload),n)}if(re(r)||U(r))return null!==o?null:u(e,t,r,n,null);mi(e,r)}return null}function h(e,t,r,n,o){if("string"==typeof n&&""!==n||"number"==typeof n)return c(t,e=e.get(r)||null,""+n,o);if("object"==typeof n&&null!==n){switch(n.$$typeof){case R:return l(t,e=e.get(null===n.key?r:n.key)||null,n,o);case A:return d(t,e=e.get(null===n.key?r:n.key)||null,n,o);case j:return h(e,t,r,(0,n._init)(n._payload),o)}if(re(n)||U(n))return u(t,e=e.get(r)||null,n,o,null);mi(t,n)}return null}function y(r,i,a,c){for(var l=null,d=null,u=i,y=i=0,m=null;null!==u&&y<a.length;y++){u.index>y?(m=u,u=null):m=u.sibling;var b=f(r,u,a[y],c);if(null===b){null===u&&(u=m);break}e&&u&&null===b.alternate&&t(r,u),i=s(b,i,y),null===d?l=b:d.sibling=b,d=b,u=m}if(y===a.length)return n(r,u),ni&&Jo(r,y),l;if(null===u){for(;y<a.length;y++)null!==(u=p(r,a[y],c))&&(i=s(u,i,y),null===d?l=u:d.sibling=u,d=u);return ni&&Jo(r,y),l}for(u=o(r,u);y<a.length;y++)null!==(m=h(u,r,y,a[y],c))&&(e&&null!==m.alternate&&u.delete(null===m.key?y:m.key),i=s(m,i,y),null===d?l=m:d.sibling=m,d=m);return e&&u.forEach((function(e){return t(r,e)})),ni&&Jo(r,y),l}function m(i,a,c,l){var d=U(c);if("function"!=typeof d)throw Error(r(150));if(null==(c=d.call(c)))throw Error(r(151));for(var u=d=null,y=a,m=a=0,b=null,g=c.next();null!==y&&!g.done;m++,g=c.next()){y.index>m?(b=y,y=null):b=y.sibling;var v=f(i,y,g.value,l);if(null===v){null===y&&(y=b);break}e&&y&&null===v.alternate&&t(i,y),a=s(v,a,m),null===u?d=v:u.sibling=v,u=v,y=b}if(g.done)return n(i,y),ni&&Jo(i,m),d;if(null===y){for(;!g.done;m++,g=c.next())null!==(g=p(i,g.value,l))&&(a=s(g,a,m),null===u?d=g:u.sibling=g,u=g);return ni&&Jo(i,m),d}for(y=o(i,y);!g.done;m++,g=c.next())null!==(g=h(y,i,m,g.value,l))&&(e&&null!==g.alternate&&y.delete(null===g.key?m:g.key),a=s(g,a,m),null===u?d=g:u.sibling=g,u=g);return e&&y.forEach((function(e){return t(i,e)})),ni&&Jo(i,m),d}return function e(r,o,s,c){if("object"==typeof s&&null!==s&&s.type===_&&null===s.key&&(s=s.props.children),"object"==typeof s&&null!==s){switch(s.$$typeof){case R:e:{for(var l=s.key,d=o;null!==d;){if(d.key===l){if((l=s.type)===_){if(7===d.tag){n(r,d.sibling),(o=i(d,s.props.children)).return=r,r=o;break e}}else if(d.elementType===l||"object"==typeof l&&null!==l&&l.$$typeof===j&&bi(l)===d.type){n(r,d.sibling),(o=i(d,s.props)).ref=yi(r,d,s),o.return=r,r=o;break e}n(r,d);break}t(r,d),d=d.sibling}s.type===_?((o=jl(s.props.children,r.mode,c,s.key)).return=r,r=o):((c=Bl(s.type,s.key,s.props,null,r.mode,c)).ref=yi(r,o,s),c.return=r,r=c)}return a(r);case A:e:{for(d=s.key;null!==o;){if(o.key===d){if(4===o.tag&&o.stateNode.containerInfo===s.containerInfo&&o.stateNode.implementation===s.implementation){n(r,o.sibling),(o=i(o,s.children||[])).return=r,r=o;break e}n(r,o);break}t(r,o),o=o.sibling}(o=Ul(s,r.mode,c)).return=r,r=o}return a(r);case j:return e(r,o,(d=s._init)(s._payload),c)}if(re(s))return y(r,o,s,c);if(U(s))return m(r,o,s,c);mi(r,s)}return"string"==typeof s&&""!==s||"number"==typeof s?(s=""+s,null!==o&&6===o.tag?(n(r,o.sibling),(o=i(o,s)).return=r,r=o):(n(r,o),(o=Ol(s,r.mode,c)).return=r,r=o),a(r)):n(r,o)}}var vi=gi(!0),Ei=gi(!1),wi=Ao(null),Ri=null,Ai=null,_i=null;function Si(){_i=Ai=Ri=null}function ki(e){var t=wi.current;_o(wi),e._currentValue=t}function Ti(e,t,r){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Ci(e,t){Ri=e,_i=Ai=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(!!(e.lanes&t)&&(ba=!0),e.firstContext=null)}function Li(e){var t=e._currentValue;if(_i!==e)if(e={context:e,memoizedValue:t,next:null},null===Ai){if(null===Ri)throw Error(r(308));Ai=e,Ri.dependencies={lanes:0,firstContext:e}}else Ai=Ai.next=e;return t}var Pi=null;function xi(e){null===Pi?Pi=[e]:Pi.push(e)}function Bi(e,t,r,n){var o=t.interleaved;return null===o?(r.next=r,xi(t)):(r.next=o.next,o.next=r),t.interleaved=r,ji(e,n)}function ji(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}var Di=!1;function Oi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ui(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ii(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ki(e,t,r){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,2&kc){var o=n.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),n.pending=t,ji(e,r)}return null===(o=n.interleaved)?(t.next=t,xi(n)):(t.next=o.next,o.next=t),n.interleaved=t,ji(e,r)}function Mi(e,t,r){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&r)){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,vt(e,r)}}function Vi(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var o=null,i=null;if(null!==(r=r.firstBaseUpdate)){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===i?o=i=s:i=i.next=s,r=r.next}while(null!==r);null===i?o=i=t:i=i.next=t}else o=i=t;return r={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ni(e,t,r,n){var o=e.updateQueue;Di=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(null!==a){o.shared.pending=null;var c=a,l=c.next;c.next=null,null===s?i=l:s.next=l,s=c;var d=e.alternate;null!==d&&(a=(d=d.updateQueue).lastBaseUpdate)!==s&&(null===a?d.firstBaseUpdate=l:a.next=l,d.lastBaseUpdate=c)}if(null!==i){var u=o.baseState;for(s=0,d=l=c=null,a=i;;){var p=a.lane,f=a.eventTime;if((n&p)===p){null!==d&&(d=d.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,y=a;switch(p=t,f=r,y.tag){case 1:if("function"==typeof(h=y.payload)){u=h.call(f,u,p);break e}u=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(p="function"==typeof(h=y.payload)?h.call(f,u,p):h))break e;u=K({},u,p);break e;case 2:Di=!0}}null!==a.callback&&0!==a.lane&&(e.flags|=64,null===(p=o.effects)?o.effects=[a]:p.push(a))}else f={eventTime:f,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===d?(l=d=f,c=u):d=d.next=f,s|=p;if(null===(a=a.next)){if(null===(a=o.shared.pending))break;a=(p=a).next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}if(null===d&&(c=u),o.baseState=c,o.firstBaseUpdate=l,o.lastBaseUpdate=d,null!==(t=o.shared.interleaved)){o=t;do{s|=o.lane,o=o.next}while(o!==t)}else null===i&&(o.shared.lanes=0);Dc|=s,e.lanes=s,e.memoizedState=u}}function zi(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var o=e[t],i=o.callback;if(null!==i){if(o.callback=null,o=n,"function"!=typeof i)throw Error(r(191,i));i.call(o)}}}var Fi={},qi=Ao(Fi),$i=Ao(Fi),Gi=Ao(Fi);function Hi(e){if(e===Fi)throw Error(r(174));return e}function Xi(e,t){switch(So(Gi,t),So($i,e),So(qi,Fi),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}_o(qi),So(qi,t)}function Wi(){_o(qi),_o($i),_o(Gi)}function Zi(e){Hi(Gi.current);var t=Hi(qi.current),r=le(t,e.type);t!==r&&(So($i,e),So(qi,r))}function Ji(e){$i.current===e&&(_o(qi),_o($i))}var Qi=Ao(0);function Yi(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var es=[];function ts(){for(var e=0;e<es.length;e++)es[e]._workInProgressVersionPrimary=null;es.length=0}var rs=w.ReactCurrentDispatcher,ns=w.ReactCurrentBatchConfig,os=0,is=null,ss=null,as=null,cs=!1,ls=!1,ds=0,us=0;function ps(){throw Error(r(321))}function fs(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!on(e[r],t[r]))return!1;return!0}function hs(e,t,n,o,i,s){if(os=s,is=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rs.current=null===e||null===e.memoizedState?Js:Qs,e=n(o,i),ls){s=0;do{if(ls=!1,ds=0,25<=s)throw Error(r(301));s+=1,as=ss=null,t.updateQueue=null,rs.current=Ys,e=n(o,i)}while(ls)}if(rs.current=Zs,t=null!==ss&&null!==ss.next,os=0,as=ss=is=null,cs=!1,t)throw Error(r(300));return e}function ys(){var e=0!==ds;return ds=0,e}function ms(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===as?is.memoizedState=as=e:as=as.next=e,as}function bs(){if(null===ss){var e=is.alternate;e=null!==e?e.memoizedState:null}else e=ss.next;var t=null===as?is.memoizedState:as.next;if(null!==t)as=t,ss=e;else{if(null===e)throw Error(r(310));e={memoizedState:(ss=e).memoizedState,baseState:ss.baseState,baseQueue:ss.baseQueue,queue:ss.queue,next:null},null===as?is.memoizedState=as=e:as=as.next=e}return as}function gs(e,t){return"function"==typeof t?t(e):t}function vs(e){var t=bs(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var o=ss,i=o.baseQueue,s=n.pending;if(null!==s){if(null!==i){var a=i.next;i.next=s.next,s.next=a}o.baseQueue=i=s,n.pending=null}if(null!==i){s=i.next,o=o.baseState;var c=a=null,l=null,d=s;do{var u=d.lane;if((os&u)===u)null!==l&&(l=l.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),o=d.hasEagerState?d.eagerState:e(o,d.action);else{var p={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};null===l?(c=l=p,a=o):l=l.next=p,is.lanes|=u,Dc|=u}d=d.next}while(null!==d&&d!==s);null===l?a=o:l.next=c,on(o,t.memoizedState)||(ba=!0),t.memoizedState=o,t.baseState=a,t.baseQueue=l,n.lastRenderedState=o}if(null!==(e=n.interleaved)){i=e;do{s=i.lane,is.lanes|=s,Dc|=s,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Es(e){var t=bs(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var o=n.dispatch,i=n.pending,s=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{s=e(s,a.action),a=a.next}while(a!==i);on(s,t.memoizedState)||(ba=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,o]}function ws(){}function Rs(e,t){var n=is,o=bs(),i=t(),s=!on(o.memoizedState,i);if(s&&(o.memoizedState=i,ba=!0),o=o.queue,Ds(Ss.bind(null,n,o,e),[e]),o.getSnapshot!==t||s||null!==as&&1&as.memoizedState.tag){if(n.flags|=2048,Ls(9,_s.bind(null,n,o,i,t),void 0,null),null===Tc)throw Error(r(349));30&os||As(n,t,i)}return i}function As(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},null===(t=is.updateQueue)?(t={lastEffect:null,stores:null},is.updateQueue=t,t.stores=[e]):null===(r=t.stores)?t.stores=[e]:r.push(e)}function _s(e,t,r,n){t.value=r,t.getSnapshot=n,ks(t)&&Ts(e)}function Ss(e,t,r){return r((function(){ks(t)&&Ts(e)}))}function ks(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!on(e,r)}catch(e){return!0}}function Ts(e){var t=ji(e,1);null!==t&&el(t,e,1,-1)}function Cs(e){var t=ms();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gs,lastRenderedState:e},t.queue=e,e=e.dispatch=Gs.bind(null,is,e),[t.memoizedState,e]}function Ls(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=is.updateQueue)?(t={lastEffect:null,stores:null},is.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function Ps(){return bs().memoizedState}function xs(e,t,r,n){var o=ms();is.flags|=e,o.memoizedState=Ls(1|t,r,void 0,void 0===n?null:n)}function Bs(e,t,r,n){var o=bs();n=void 0===n?null:n;var i=void 0;if(null!==ss){var s=ss.memoizedState;if(i=s.destroy,null!==n&&fs(n,s.deps))return void(o.memoizedState=Ls(t,r,i,n))}is.flags|=e,o.memoizedState=Ls(1|t,r,i,n)}function js(e,t){return xs(8390656,8,e,t)}function Ds(e,t){return Bs(2048,8,e,t)}function Os(e,t){return Bs(4,2,e,t)}function Us(e,t){return Bs(4,4,e,t)}function Is(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ks(e,t,r){return r=null!=r?r.concat([e]):null,Bs(4,4,Is.bind(null,t,e),r)}function Ms(){}function Vs(e,t){var r=bs();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&fs(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Ns(e,t){var r=bs();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&fs(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function zs(e,t,r){return 21&os?(on(r,t)||(r=mt(),is.lanes|=r,Dc|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ba=!0),e.memoizedState=r)}function Fs(e,t){var r=Et;Et=0!==r&&4>r?r:4,e(!0);var n=ns.transition;ns.transition={};try{e(!1),t()}finally{Et=r,ns.transition=n}}function qs(){return bs().memoizedState}function $s(e,t,r){var n=Yc(e);r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Hs(e)?Xs(t,r):null!==(r=Bi(e,t,r,n))&&(el(r,e,n,Qc()),Ws(r,t,n))}function Gs(e,t,r){var n=Yc(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Hs(e))Xs(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var s=t.lastRenderedState,a=i(s,r);if(o.hasEagerState=!0,o.eagerState=a,on(a,s)){var c=t.interleaved;return null===c?(o.next=o,xi(t)):(o.next=c.next,c.next=o),void(t.interleaved=o)}}catch(e){}null!==(r=Bi(e,t,o,n))&&(el(r,e,n,o=Qc()),Ws(r,t,n))}}function Hs(e){var t=e.alternate;return e===is||null!==t&&t===is}function Xs(e,t){ls=cs=!0;var r=e.pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Ws(e,t,r){if(4194240&r){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,vt(e,r)}}var Zs={readContext:Li,useCallback:ps,useContext:ps,useEffect:ps,useImperativeHandle:ps,useInsertionEffect:ps,useLayoutEffect:ps,useMemo:ps,useReducer:ps,useRef:ps,useState:ps,useDebugValue:ps,useDeferredValue:ps,useTransition:ps,useMutableSource:ps,useSyncExternalStore:ps,useId:ps,unstable_isNewReconciler:!1},Js={readContext:Li,useCallback:function(e,t){return ms().memoizedState=[e,void 0===t?null:t],e},useContext:Li,useEffect:js,useImperativeHandle:function(e,t,r){return r=null!=r?r.concat([e]):null,xs(4194308,4,Is.bind(null,t,e),r)},useLayoutEffect:function(e,t){return xs(4194308,4,e,t)},useInsertionEffect:function(e,t){return xs(4,2,e,t)},useMemo:function(e,t){var r=ms();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ms();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=$s.bind(null,is,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},ms().memoizedState=e},useState:Cs,useDebugValue:Ms,useDeferredValue:function(e){return ms().memoizedState=e},useTransition:function(){var e=Cs(!1),t=e[0];return e=Fs.bind(null,e[1]),ms().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var o=is,i=ms();if(ni){if(void 0===n)throw Error(r(407));n=n()}else{if(n=t(),null===Tc)throw Error(r(349));30&os||As(o,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,js(Ss.bind(null,o,s,e),[e]),o.flags|=2048,Ls(9,_s.bind(null,o,s,n,t),void 0,null),n},useId:function(){var e=ms(),t=Tc.identifierPrefix;if(ni){var r=Zo;t=":"+t+"R"+(r=(Wo&~(1<<32-at(Wo)-1)).toString(32)+r),0<(r=ds++)&&(t+="H"+r.toString(32)),t+=":"}else t=":"+t+"r"+(r=us++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Qs={readContext:Li,useCallback:Vs,useContext:Li,useEffect:Ds,useImperativeHandle:Ks,useInsertionEffect:Os,useLayoutEffect:Us,useMemo:Ns,useReducer:vs,useRef:Ps,useState:function(){return vs(gs)},useDebugValue:Ms,useDeferredValue:function(e){return zs(bs(),ss.memoizedState,e)},useTransition:function(){return[vs(gs)[0],bs().memoizedState]},useMutableSource:ws,useSyncExternalStore:Rs,useId:qs,unstable_isNewReconciler:!1},Ys={readContext:Li,useCallback:Vs,useContext:Li,useEffect:Ds,useImperativeHandle:Ks,useInsertionEffect:Os,useLayoutEffect:Us,useMemo:Ns,useReducer:Es,useRef:Ps,useState:function(){return Es(gs)},useDebugValue:Ms,useDeferredValue:function(e){var t=bs();return null===ss?t.memoizedState=e:zs(t,ss.memoizedState,e)},useTransition:function(){return[Es(gs)[0],bs().memoizedState]},useMutableSource:ws,useSyncExternalStore:Rs,useId:qs,unstable_isNewReconciler:!1};function ea(e,t){if(e&&e.defaultProps){for(var r in t=K({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}function ta(e,t,r,n){r=null==(r=r(n,t=e.memoizedState))?t:K({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var ra={isMounted:function(e){return!!(e=e._reactInternals)&&Fe(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Qc(),o=Yc(e),i=Ii(n,o);i.payload=t,null!=r&&(i.callback=r),null!==(t=Ki(e,i,o))&&(el(t,e,o,n),Mi(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Qc(),o=Yc(e),i=Ii(n,o);i.tag=1,i.payload=t,null!=r&&(i.callback=r),null!==(t=Ki(e,i,o))&&(el(t,e,o,n),Mi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Qc(),n=Yc(e),o=Ii(r,n);o.tag=2,null!=t&&(o.callback=t),null!==(t=Ki(e,o,n))&&(el(t,e,n,r),Mi(t,e,n))}};function na(e,t,r,n,o,i,s){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,i,s):!(t.prototype&&t.prototype.isPureReactComponent&&sn(r,n)&&sn(o,i))}function oa(e,t,r){var n=!1,o=ko,i=t.contextType;return"object"==typeof i&&null!==i?i=Li(i):(o=xo(t)?Lo:To.current,i=(n=null!=(n=t.contextTypes))?Po(e,o):ko),t=new t(r,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ra,e.stateNode=t,t._reactInternals=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ia(e,t,r,n){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&ra.enqueueReplaceState(t,t.state,null)}function sa(e,t,r,n){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs={},Oi(e);var i=t.contextType;"object"==typeof i&&null!==i?o.context=Li(i):(i=xo(t)?Lo:To.current,o.context=Po(e,i)),o.state=e.memoizedState,"function"==typeof(i=t.getDerivedStateFromProps)&&(ta(e,t,i,r),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&ra.enqueueReplaceState(o,o.state,null),Ni(e,r,o,n),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function aa(e,t){try{var r="",n=t;do{r+=z(n),n=n.return}while(n);var o=r}catch(e){o="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:o,digest:null}}function ca(e,t,r){return{value:e,source:null,stack:null!=r?r:null,digest:null!=t?t:null}}function la(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var da="function"==typeof WeakMap?WeakMap:Map;function ua(e,t,r){(r=Ii(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){zc||(zc=!0,Fc=n),la(0,t)},r}function pa(e,t,r){(r=Ii(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"==typeof n){var o=t.value;r.payload=function(){return n(o)},r.callback=function(){la(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(r.callback=function(){la(0,t),"function"!=typeof n&&(null===qc?qc=new Set([this]):qc.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}function fa(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new da;var o=new Set;n.set(t,o)}else void 0===(o=n.get(t))&&(o=new Set,n.set(t,o));o.has(r)||(o.add(r),e=Al.bind(null,e,t,r),t.then(e,e))}function ha(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ya(e,t,r,n,o){return 1&e.mode?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,1===r.tag&&(null===r.alternate?r.tag=17:((t=Ii(-1,1)).tag=2,Ki(r,t,1))),r.lanes|=1),e)}var ma=w.ReactCurrentOwner,ba=!1;function ga(e,t,r,n){t.child=null===e?Ei(t,null,r,n):vi(t,e.child,r,n)}function va(e,t,r,n,o){r=r.render;var i=t.ref;return Ci(t,o),n=hs(e,t,r,n,i,o),r=ys(),null===e||ba?(ni&&r&&Yo(t),t.flags|=1,ga(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,za(e,t,o))}function Ea(e,t,r,n,o){if(null===e){var i=r.type;return"function"!=typeof i||Pl(i)||void 0!==i.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=Bl(r.type,null,n,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,wa(e,t,i,n,o))}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if((r=null!==(r=r.compare)?r:sn)(s,n)&&e.ref===t.ref)return za(e,t,o)}return t.flags|=1,(e=xl(i,n)).ref=t.ref,e.return=t,t.child=e}function wa(e,t,r,n,o){if(null!==e){var i=e.memoizedProps;if(sn(i,n)&&e.ref===t.ref){if(ba=!1,t.pendingProps=n=i,!(e.lanes&o))return t.lanes=e.lanes,za(e,t,o);131072&e.flags&&(ba=!0)}}return _a(e,t,r,n,o)}function Ra(e,t,r){var n=t.pendingProps,o=n.children,i=null!==e?e.memoizedState:null;if("hidden"===n.mode)if(1&t.mode){if(!(1073741824&r))return e=null!==i?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,So(xc,Pc),Pc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=null!==i?i.baseLanes:r,So(xc,Pc),Pc|=n}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},So(xc,Pc),Pc|=r;else null!==i?(n=i.baseLanes|r,t.memoizedState=null):n=r,So(xc,Pc),Pc|=n;return ga(e,t,o,r),t.child}function Aa(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function _a(e,t,r,n,o){var i=xo(r)?Lo:To.current;return i=Po(t,i),Ci(t,o),r=hs(e,t,r,n,i,o),n=ys(),null===e||ba?(ni&&n&&Yo(t),t.flags|=1,ga(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,za(e,t,o))}function Sa(e,t,r,n,o){if(xo(r)){var i=!0;Oo(t)}else i=!1;if(Ci(t,o),null===t.stateNode)Na(e,t),oa(t,r,n),sa(t,r,n,o),n=!0;else if(null===e){var s=t.stateNode,a=t.memoizedProps;s.props=a;var c=s.context,l=r.contextType;l="object"==typeof l&&null!==l?Li(l):Po(t,l=xo(r)?Lo:To.current);var d=r.getDerivedStateFromProps,u="function"==typeof d||"function"==typeof s.getSnapshotBeforeUpdate;u||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(a!==n||c!==l)&&ia(t,s,n,l),Di=!1;var p=t.memoizedState;s.state=p,Ni(t,n,s,o),c=t.memoizedState,a!==n||p!==c||Co.current||Di?("function"==typeof d&&(ta(t,r,d,n),c=t.memoizedState),(a=Di||na(t,r,a,n,p,c,l))?(u||"function"!=typeof s.UNSAFE_componentWillMount&&"function"!=typeof s.componentWillMount||("function"==typeof s.componentWillMount&&s.componentWillMount(),"function"==typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"==typeof s.componentDidMount&&(t.flags|=4194308)):("function"==typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),s.props=n,s.state=c,s.context=l,n=a):("function"==typeof s.componentDidMount&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,Ui(e,t),a=t.memoizedProps,l=t.type===t.elementType?a:ea(t.type,a),s.props=l,u=t.pendingProps,p=s.context,c="object"==typeof(c=r.contextType)&&null!==c?Li(c):Po(t,c=xo(r)?Lo:To.current);var f=r.getDerivedStateFromProps;(d="function"==typeof f||"function"==typeof s.getSnapshotBeforeUpdate)||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(a!==u||p!==c)&&ia(t,s,n,c),Di=!1,p=t.memoizedState,s.state=p,Ni(t,n,s,o);var h=t.memoizedState;a!==u||p!==h||Co.current||Di?("function"==typeof f&&(ta(t,r,f,n),h=t.memoizedState),(l=Di||na(t,r,l,n,p,h,c)||!1)?(d||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(n,h,c),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(n,h,c)),"function"==typeof s.componentDidUpdate&&(t.flags|=4),"function"==typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof s.componentDidUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=h),s.props=n,s.state=h,s.context=c,n=l):("function"!=typeof s.componentDidUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),n=!1)}return ka(e,t,r,n,i,o)}function ka(e,t,r,n,o,i){Aa(e,t);var s=!!(128&t.flags);if(!n&&!s)return o&&Uo(t,r,!1),za(e,t,i);n=t.stateNode,ma.current=t;var a=s&&"function"!=typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&s?(t.child=vi(t,e.child,null,i),t.child=vi(t,null,a,i)):ga(e,t,a,i),t.memoizedState=n.state,o&&Uo(t,r,!0),t.child}function Ta(e){var t=e.stateNode;t.pendingContext?jo(0,t.pendingContext,t.pendingContext!==t.context):t.context&&jo(0,t.context,!1),Xi(e,t.containerInfo)}function Ca(e,t,r,n,o){return pi(),fi(o),t.flags|=256,ga(e,t,r,n),t.child}var La,Pa,xa,Ba,ja={dehydrated:null,treeContext:null,retryLane:0};function Da(e){return{baseLanes:e,cachePool:null,transitions:null}}function Oa(e,t,n){var o,i=t.pendingProps,s=Qi.current,a=!1,c=!!(128&t.flags);if((o=c)||(o=(null===e||null!==e.memoizedState)&&!!(2&s)),o?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(s|=1),So(Qi,1&s),null===e)return ci(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(c=i.children,e=i.fallback,a?(i=t.mode,a=t.child,c={mode:"hidden",children:c},1&i||null===a?a=Dl(c,i,0,null):(a.childLanes=0,a.pendingProps=c),e=jl(e,i,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Da(n),t.memoizedState=ja,e):Ua(t,c));if(null!==(s=e.memoizedState)&&null!==(o=s.dehydrated))return function(e,t,n,o,i,s,a){if(n)return 256&t.flags?(t.flags&=-257,Ia(e,t,a,o=ca(Error(r(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(s=o.fallback,i=t.mode,o=Dl({mode:"visible",children:o.children},i,0,null),(s=jl(s,i,a,null)).flags|=2,o.return=t,s.return=t,o.sibling=s,t.child=o,1&t.mode&&vi(t,e.child,null,a),t.child.memoizedState=Da(a),t.memoizedState=ja,s);if(!(1&t.mode))return Ia(e,t,a,null);if("$!"===i.data){if(o=i.nextSibling&&i.nextSibling.dataset)var c=o.dgst;return o=c,Ia(e,t,a,o=ca(s=Error(r(419)),o,void 0))}if(c=!!(a&e.childLanes),ba||c){if(null!==(o=Tc)){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=i&(o.suspendedLanes|a)?0:i)&&i!==s.retryLane&&(s.retryLane=i,ji(e,i),el(o,e,i,-1))}return fl(),Ia(e,t,a,o=ca(Error(r(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Sl.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,ri=ao(i.nextSibling),ti=t,ni=!0,oi=null,null!==e&&(Go[Ho++]=Wo,Go[Ho++]=Zo,Go[Ho++]=Xo,Wo=e.id,Zo=e.overflow,Xo=t),(t=Ua(t,o.children)).flags|=4096,t)}(e,t,c,i,o,s,n);if(a){a=i.fallback,c=t.mode,o=(s=e.child).sibling;var l={mode:"hidden",children:i.children};return 1&c||t.child===s?(i=xl(s,l)).subtreeFlags=14680064&s.subtreeFlags:((i=t.child).childLanes=0,i.pendingProps=l,t.deletions=null),null!==o?a=xl(o,a):(a=jl(a,c,n,null)).flags|=2,a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,c=null===(c=e.child.memoizedState)?Da(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},a.memoizedState=c,a.childLanes=e.childLanes&~n,t.memoizedState=ja,i}return e=(a=e.child).sibling,i=xl(a,{mode:"visible",children:i.children}),!(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Ua(e,t){return(t=Dl({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Ia(e,t,r,n){return null!==n&&fi(n),vi(t,e.child,null,r),(e=Ua(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ka(e,t,r){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),Ti(e.return,t,r)}function Ma(e,t,r,n,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=o)}function Va(e,t,r){var n=t.pendingProps,o=n.revealOrder,i=n.tail;if(ga(e,t,n.children,r),2&(n=Qi.current))n=1&n|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ka(e,r,t);else if(19===e.tag)Ka(e,r,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(So(Qi,n),1&t.mode)switch(o){case"forwards":for(r=t.child,o=null;null!==r;)null!==(e=r.alternate)&&null===Yi(e)&&(o=r),r=r.sibling;null===(r=o)?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),Ma(t,!1,o,r,i);break;case"backwards":for(r=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Yi(e)){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}Ma(t,!0,r,null,i);break;case"together":Ma(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Na(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function za(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Dc|=t.lanes,!(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(r(153));if(null!==t.child){for(n=xl(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=xl(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Fa(e,t){if(!ni)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function qa(e){var t=null!==e.alternate&&e.alternate.child===e.child,r=0,n=0;if(t)for(var o=e.child;null!==o;)r|=o.lanes|o.childLanes,n|=14680064&o.subtreeFlags,n|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)r|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function $a(e,t,n){var i=t.pendingProps;switch(ei(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qa(t),null;case 1:case 17:return xo(t.type)&&Bo(),qa(t),null;case 3:return i=t.stateNode,Wi(),_o(Co),_o(To),ts(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),null!==e&&null!==e.child||(di(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==oi&&(ol(oi),oi=null))),Pa(e,t),qa(t),null;case 5:Ji(t);var s=Hi(Gi.current);if(n=t.type,null!==e&&null!=t.stateNode)xa(e,t,n,i,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(null===t.stateNode)throw Error(r(166));return qa(t),null}if(e=Hi(qi.current),di(t)){i=t.stateNode,n=t.type;var a=t.memoizedProps;switch(i[uo]=t,i[po]=a,e=!!(1&t.mode),n){case"dialog":In("cancel",i),In("close",i);break;case"iframe":case"object":case"embed":In("load",i);break;case"video":case"audio":for(s=0;s<jn.length;s++)In(jn[s],i);break;case"source":In("error",i);break;case"img":case"image":case"link":In("error",i),In("load",i);break;case"details":In("toggle",i);break;case"input":J(i,a),In("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!a.multiple},In("invalid",i);break;case"textarea":ie(i,a),In("invalid",i)}for(var c in ve(n,a),s=null,a)if(a.hasOwnProperty(c)){var l=a[c];"children"===c?"string"==typeof l?i.textContent!==l&&(!0!==a.suppressHydrationWarning&&Zn(i.textContent,l,e),s=["children",l]):"number"==typeof l&&i.textContent!==""+l&&(!0!==a.suppressHydrationWarning&&Zn(i.textContent,l,e),s=["children",""+l]):o.hasOwnProperty(c)&&null!=l&&"onScroll"===c&&In("scroll",i)}switch(n){case"input":H(i),ee(i,a,!0);break;case"textarea":H(i),ae(i);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(i.onclick=Jn)}i=s,t.updateQueue=i,null!==i&&(t.flags|=4)}else{c=9===s.nodeType?s:s.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=ce(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof i.is?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),"select"===n&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[uo]=t,e[po]=i,La(e,t,!1,!1),t.stateNode=e;e:{switch(c=Ee(n,i),n){case"dialog":In("cancel",e),In("close",e),s=i;break;case"iframe":case"object":case"embed":In("load",e),s=i;break;case"video":case"audio":for(s=0;s<jn.length;s++)In(jn[s],e);s=i;break;case"source":In("error",e),s=i;break;case"img":case"image":case"link":In("error",e),In("load",e),s=i;break;case"details":In("toggle",e),s=i;break;case"input":J(e,i),s=Z(e,i),In("invalid",e);break;case"option":default:s=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},s=K({},i,{value:void 0}),In("invalid",e);break;case"textarea":ie(e,i),s=oe(e,i),In("invalid",e)}for(a in ve(n,s),l=s)if(l.hasOwnProperty(a)){var d=l[a];"style"===a?be(e,d):"dangerouslySetInnerHTML"===a?null!=(d=d?d.__html:void 0)&&pe(e,d):"children"===a?"string"==typeof d?("textarea"!==n||""!==d)&&fe(e,d):"number"==typeof d&&fe(e,""+d):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(o.hasOwnProperty(a)?null!=d&&"onScroll"===a&&In("scroll",e):null!=d&&v(e,a,d,c))}switch(n){case"input":H(e),ee(e,i,!1);break;case"textarea":H(e),ae(e);break;case"option":null!=i.value&&e.setAttribute("value",""+$(i.value));break;case"select":e.multiple=!!i.multiple,null!=(a=i.value)?ne(e,!!i.multiple,a,!1):null!=i.defaultValue&&ne(e,!!i.multiple,i.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=Jn)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return qa(t),null;case 6:if(e&&null!=t.stateNode)Ba(e,t,e.memoizedProps,i);else{if("string"!=typeof i&&null===t.stateNode)throw Error(r(166));if(n=Hi(Gi.current),Hi(qi.current),di(t)){if(i=t.stateNode,n=t.memoizedProps,i[uo]=t,(a=i.nodeValue!==n)&&null!==(e=ti))switch(e.tag){case 3:Zn(i.nodeValue,n,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Zn(i.nodeValue,n,!!(1&e.mode))}a&&(t.flags|=4)}else(i=(9===n.nodeType?n:n.ownerDocument).createTextNode(i))[uo]=t,t.stateNode=i}return qa(t),null;case 13:if(_o(Qi),i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ni&&null!==ri&&1&t.mode&&!(128&t.flags))ui(),pi(),t.flags|=98560,a=!1;else if(a=di(t),null!==i&&null!==i.dehydrated){if(null===e){if(!a)throw Error(r(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(r(317));a[uo]=t}else pi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;qa(t),a=!1}else null!==oi&&(ol(oi),oi=null),a=!0;if(!a)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=n,t):((i=null!==i)!=(null!==e&&null!==e.memoizedState)&&i&&(t.child.flags|=8192,1&t.mode&&(null===e||1&Qi.current?0===Bc&&(Bc=3):fl())),null!==t.updateQueue&&(t.flags|=4),qa(t),null);case 4:return Wi(),Pa(e,t),null===e&&Vn(t.stateNode.containerInfo),qa(t),null;case 10:return ki(t.type._context),qa(t),null;case 19:if(_o(Qi),null===(a=t.memoizedState))return qa(t),null;if(i=!!(128&t.flags),null===(c=a.rendering))if(i)Fa(a,!1);else{if(0!==Bc||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(c=Yi(e))){for(t.flags|=128,Fa(a,!1),null!==(i=c.updateQueue)&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;null!==n;)e=i,(a=n).flags&=14680066,null===(c=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,e=c.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return So(Qi,1&Qi.current|2),t.child}e=e.sibling}null!==a.tail&&Qe()>Vc&&(t.flags|=128,i=!0,Fa(a,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=Yi(c))){if(t.flags|=128,i=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Fa(a,!0),null===a.tail&&"hidden"===a.tailMode&&!c.alternate&&!ni)return qa(t),null}else 2*Qe()-a.renderingStartTime>Vc&&1073741824!==n&&(t.flags|=128,i=!0,Fa(a,!1),t.lanes=4194304);a.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=a.last)?n.sibling=c:t.child=c,a.last=c)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Qe(),t.sibling=null,n=Qi.current,So(Qi,i?1&n|2:1&n),t):(qa(t),null);case 22:case 23:return ll(),i=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==i&&(t.flags|=8192),i&&1&t.mode?!!(1073741824&Pc)&&(qa(t),6&t.subtreeFlags&&(t.flags|=8192)):qa(t),null;case 24:case 25:return null}throw Error(r(156,t.tag))}function Ga(e,t){switch(ei(t),t.tag){case 1:return xo(t.type)&&Bo(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Wi(),_o(Co),_o(To),ts(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Ji(t),null;case 13:if(_o(Qi),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(r(340));pi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return _o(Qi),null;case 4:return Wi(),null;case 10:return ki(t.type._context),null;case 22:case 23:return ll(),null;default:return null}}La=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Pa=function(){},xa=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Hi(qi.current);var s,a=null;switch(r){case"input":i=Z(e,i),n=Z(e,n),a=[];break;case"select":i=K({},i,{value:void 0}),n=K({},n,{value:void 0}),a=[];break;case"textarea":i=oe(e,i),n=oe(e,n),a=[];break;default:"function"!=typeof i.onClick&&"function"==typeof n.onClick&&(e.onclick=Jn)}for(d in ve(r,n),r=null,i)if(!n.hasOwnProperty(d)&&i.hasOwnProperty(d)&&null!=i[d])if("style"===d){var c=i[d];for(s in c)c.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(o.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in n){var l=n[d];if(c=null!=i?i[d]:void 0,n.hasOwnProperty(d)&&l!==c&&(null!=l||null!=c))if("style"===d)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(r||(r={}),r[s]=l[s])}else r||(a||(a=[]),a.push(d,r)),r=l;else"dangerouslySetInnerHTML"===d?(l=l?l.__html:void 0,c=c?c.__html:void 0,null!=l&&c!==l&&(a=a||[]).push(d,l)):"children"===d?"string"!=typeof l&&"number"!=typeof l||(a=a||[]).push(d,""+l):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(o.hasOwnProperty(d)?(null!=l&&"onScroll"===d&&In("scroll",e),a||c===l||(a=[])):(a=a||[]).push(d,l))}r&&(a=a||[]).push("style",r);var d=a;(t.updateQueue=d)&&(t.flags|=4)}},Ba=function(e,t,r,n){r!==n&&(t.flags|=4)};var Ha=!1,Xa=!1,Wa="function"==typeof WeakSet?WeakSet:Set,Za=null;function Ja(e,t){var r=e.ref;if(null!==r)if("function"==typeof r)try{r(null)}catch(r){Rl(e,t,r)}else r.current=null}function Qa(e,t,r){try{r()}catch(r){Rl(e,t,r)}}var Ya=!1;function ec(e,t,r){var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&Qa(t,r,i)}o=o.next}while(o!==n)}}function tc(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function rc(e){var t=e.ref;if(null!==t){var r=e.stateNode;e.tag,e=r,"function"==typeof t?t(e):t.current=e}}function nc(e){var t=e.alternate;null!==t&&(e.alternate=null,nc(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&(delete t[uo],delete t[po],delete t[ho],delete t[yo],delete t[mo]),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function oc(e){return 5===e.tag||3===e.tag||4===e.tag}function ic(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||oc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function sc(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!=(r=r._reactRootContainer)||null!==t.onclick||(t.onclick=Jn));else if(4!==n&&null!==(e=e.child))for(sc(e,t,r),e=e.sibling;null!==e;)sc(e,t,r),e=e.sibling}function ac(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(ac(e,t,r),e=e.sibling;null!==e;)ac(e,t,r),e=e.sibling}var cc=null,lc=!1;function dc(e,t,r){for(r=r.child;null!==r;)uc(e,t,r),r=r.sibling}function uc(e,t,r){if(st&&"function"==typeof st.onCommitFiberUnmount)try{st.onCommitFiberUnmount(it,r)}catch(e){}switch(r.tag){case 5:Xa||Ja(r,t);case 6:var n=cc,o=lc;cc=null,dc(e,t,r),lc=o,null!==(cc=n)&&(lc?(e=cc,r=r.stateNode,8===e.nodeType?e.parentNode.removeChild(r):e.removeChild(r)):cc.removeChild(r.stateNode));break;case 18:null!==cc&&(lc?(e=cc,r=r.stateNode,8===e.nodeType?so(e.parentNode,r):1===e.nodeType&&so(e,r),Ft(e)):so(cc,r.stateNode));break;case 4:n=cc,o=lc,cc=r.stateNode.containerInfo,lc=!0,dc(e,t,r),cc=n,lc=o;break;case 0:case 11:case 14:case 15:if(!Xa&&null!==(n=r.updateQueue)&&null!==(n=n.lastEffect)){o=n=n.next;do{var i=o,s=i.destroy;i=i.tag,void 0!==s&&(2&i||4&i)&&Qa(r,t,s),o=o.next}while(o!==n)}dc(e,t,r);break;case 1:if(!Xa&&(Ja(r,t),"function"==typeof(n=r.stateNode).componentWillUnmount))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(e){Rl(r,t,e)}dc(e,t,r);break;case 21:dc(e,t,r);break;case 22:1&r.mode?(Xa=(n=Xa)||null!==r.memoizedState,dc(e,t,r),Xa=n):dc(e,t,r);break;default:dc(e,t,r)}}function pc(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new Wa),t.forEach((function(t){var n=kl.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}function fc(e,t){var n=t.deletions;if(null!==n)for(var o=0;o<n.length;o++){var i=n[o];try{var s=e,a=t,c=a;e:for(;null!==c;){switch(c.tag){case 5:cc=c.stateNode,lc=!1;break e;case 3:case 4:cc=c.stateNode.containerInfo,lc=!0;break e}c=c.return}if(null===cc)throw Error(r(160));uc(s,a,i),cc=null,lc=!1;var l=i.alternate;null!==l&&(l.return=null),i.return=null}catch(e){Rl(i,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)hc(t,e),t=t.sibling}function hc(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(fc(t,e),yc(e),4&o){try{ec(3,e,e.return),tc(3,e)}catch(t){Rl(e,e.return,t)}try{ec(5,e,e.return)}catch(t){Rl(e,e.return,t)}}break;case 1:fc(t,e),yc(e),512&o&&null!==n&&Ja(n,n.return);break;case 5:if(fc(t,e),yc(e),512&o&&null!==n&&Ja(n,n.return),32&e.flags){var i=e.stateNode;try{fe(i,"")}catch(t){Rl(e,e.return,t)}}if(4&o&&null!=(i=e.stateNode)){var s=e.memoizedProps,a=null!==n?n.memoizedProps:s,c=e.type,l=e.updateQueue;if(e.updateQueue=null,null!==l)try{"input"===c&&"radio"===s.type&&null!=s.name&&Q(i,s),Ee(c,a);var d=Ee(c,s);for(a=0;a<l.length;a+=2){var u=l[a],p=l[a+1];"style"===u?be(i,p):"dangerouslySetInnerHTML"===u?pe(i,p):"children"===u?fe(i,p):v(i,u,p,d)}switch(c){case"input":Y(i,s);break;case"textarea":se(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;null!=h?ne(i,!!s.multiple,h,!1):f!==!!s.multiple&&(null!=s.defaultValue?ne(i,!!s.multiple,s.defaultValue,!0):ne(i,!!s.multiple,s.multiple?[]:"",!1))}i[po]=s}catch(t){Rl(e,e.return,t)}}break;case 6:if(fc(t,e),yc(e),4&o){if(null===e.stateNode)throw Error(r(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(t){Rl(e,e.return,t)}}break;case 3:if(fc(t,e),yc(e),4&o&&null!==n&&n.memoizedState.isDehydrated)try{Ft(t.containerInfo)}catch(t){Rl(e,e.return,t)}break;case 4:default:fc(t,e),yc(e);break;case 13:fc(t,e),yc(e),8192&(i=e.child).flags&&(s=null!==i.memoizedState,i.stateNode.isHidden=s,!s||null!==i.alternate&&null!==i.alternate.memoizedState||(Mc=Qe())),4&o&&pc(e);break;case 22:if(u=null!==n&&null!==n.memoizedState,1&e.mode?(Xa=(d=Xa)||u,fc(t,e),Xa=d):fc(t,e),yc(e),8192&o){if(d=null!==e.memoizedState,(e.stateNode.isHidden=d)&&!u&&1&e.mode)for(Za=e,u=e.child;null!==u;){for(p=Za=u;null!==Za;){switch(h=(f=Za).child,f.tag){case 0:case 11:case 14:case 15:ec(4,f,f.return);break;case 1:Ja(f,f.return);var y=f.stateNode;if("function"==typeof y.componentWillUnmount){o=f,n=f.return;try{t=o,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(e){Rl(o,n,e)}}break;case 5:Ja(f,f.return);break;case 22:if(null!==f.memoizedState){vc(p);continue}}null!==h?(h.return=f,Za=h):vc(p)}u=u.sibling}e:for(u=null,p=e;;){if(5===p.tag){if(null===u){u=p;try{i=p.stateNode,d?"function"==typeof(s=i.style).setProperty?s.setProperty("display","none","important"):s.display="none":(c=p.stateNode,a=null!=(l=p.memoizedProps.style)&&l.hasOwnProperty("display")?l.display:null,c.style.display=me("display",a))}catch(t){Rl(e,e.return,t)}}}else if(6===p.tag){if(null===u)try{p.stateNode.nodeValue=d?"":p.memoizedProps}catch(t){Rl(e,e.return,t)}}else if((22!==p.tag&&23!==p.tag||null===p.memoizedState||p===e)&&null!==p.child){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;null===p.sibling;){if(null===p.return||p.return===e)break e;u===p&&(u=null),p=p.return}u===p&&(u=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:fc(t,e),yc(e),4&o&&pc(e);case 21:}}function yc(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(oc(n)){var o=n;break e}n=n.return}throw Error(r(160))}switch(o.tag){case 5:var i=o.stateNode;32&o.flags&&(fe(i,""),o.flags&=-33),ac(e,ic(e),i);break;case 3:case 4:var s=o.stateNode.containerInfo;sc(e,ic(e),s);break;default:throw Error(r(161))}}catch(t){Rl(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function mc(e,t,r){Za=e,bc(e)}function bc(e,t,r){for(var n=!!(1&e.mode);null!==Za;){var o=Za,i=o.child;if(22===o.tag&&n){var s=null!==o.memoizedState||Ha;if(!s){var a=o.alternate,c=null!==a&&null!==a.memoizedState||Xa;a=Ha;var l=Xa;if(Ha=s,(Xa=c)&&!l)for(Za=o;null!==Za;)c=(s=Za).child,22===s.tag&&null!==s.memoizedState?Ec(o):null!==c?(c.return=s,Za=c):Ec(o);for(;null!==i;)Za=i,bc(i),i=i.sibling;Za=o,Ha=a,Xa=l}gc(e)}else 8772&o.subtreeFlags&&null!==i?(i.return=o,Za=i):gc(e)}}function gc(e){for(;null!==Za;){var t=Za;if(8772&t.flags){var n=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:Xa||tc(5,t);break;case 1:var o=t.stateNode;if(4&t.flags&&!Xa)if(null===n)o.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ea(t.type,n.memoizedProps);o.componentDidUpdate(i,n.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;null!==s&&zi(t,s,o);break;case 3:var a=t.updateQueue;if(null!==a){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}zi(t,a,n)}break;case 5:var c=t.stateNode;if(null===n&&4&t.flags){n=c;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var d=t.alternate;if(null!==d){var u=d.memoizedState;if(null!==u){var p=u.dehydrated;null!==p&&Ft(p)}}}break;default:throw Error(r(163))}Xa||512&t.flags&&rc(t)}catch(e){Rl(t,t.return,e)}}if(t===e){Za=null;break}if(null!==(n=t.sibling)){n.return=t.return,Za=n;break}Za=t.return}}function vc(e){for(;null!==Za;){var t=Za;if(t===e){Za=null;break}var r=t.sibling;if(null!==r){r.return=t.return,Za=r;break}Za=t.return}}function Ec(e){for(;null!==Za;){var t=Za;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{tc(4,t)}catch(e){Rl(t,r,e)}break;case 1:var n=t.stateNode;if("function"==typeof n.componentDidMount){var o=t.return;try{n.componentDidMount()}catch(e){Rl(t,o,e)}}var i=t.return;try{rc(t)}catch(e){Rl(t,i,e)}break;case 5:var s=t.return;try{rc(t)}catch(e){Rl(t,s,e)}}}catch(e){Rl(t,t.return,e)}if(t===e){Za=null;break}var a=t.sibling;if(null!==a){a.return=t.return,Za=a;break}Za=t.return}}var wc,Rc=Math.ceil,Ac=w.ReactCurrentDispatcher,_c=w.ReactCurrentOwner,Sc=w.ReactCurrentBatchConfig,kc=0,Tc=null,Cc=null,Lc=0,Pc=0,xc=Ao(0),Bc=0,jc=null,Dc=0,Oc=0,Uc=0,Ic=null,Kc=null,Mc=0,Vc=1/0,Nc=null,zc=!1,Fc=null,qc=null,$c=!1,Gc=null,Hc=0,Xc=0,Wc=null,Zc=-1,Jc=0;function Qc(){return 6&kc?Qe():-1!==Zc?Zc:Zc=Qe()}function Yc(e){return 1&e.mode?2&kc&&0!==Lc?Lc&-Lc:null!==hi.transition?(0===Jc&&(Jc=mt()),Jc):0!==(e=Et)?e:e=void 0===(e=window.event)?16:Jt(e.type):1}function el(e,t,n,o){if(50<Xc)throw Xc=0,Wc=null,Error(r(185));gt(e,n,o),2&kc&&e===Tc||(e===Tc&&(!(2&kc)&&(Oc|=n),4===Bc&&il(e,Lc)),tl(e,o),1===n&&0===kc&&!(1&t.mode)&&(Vc=Qe()+500,Ko&&No()))}function tl(e,t){var r=e.callbackNode;!function(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-at(i),a=1<<s,c=o[s];-1===c?a&r&&!(a&n)||(o[s]=ht(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}(e,t);var n=ft(e,e===Tc?Lc:0);if(0===n)null!==r&&We(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(null!=r&&We(r),1===t)0===e.tag?function(e){Ko=!0,Vo(e)}(sl.bind(null,e)):Vo(sl.bind(null,e)),oo((function(){!(6&kc)&&No()})),r=null;else{switch(wt(n)){case 1:r=et;break;case 4:r=tt;break;case 16:default:r=rt;break;case 536870912:r=ot}r=Tl(r,rl.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function rl(e,t){if(Zc=-1,Jc=0,6&kc)throw Error(r(327));var n=e.callbackNode;if(El()&&e.callbackNode!==n)return null;var o=ft(e,e===Tc?Lc:0);if(0===o)return null;if(30&o||o&e.expiredLanes||t)t=hl(e,o);else{t=o;var i=kc;kc|=2;var s=pl();for(Tc===e&&Lc===t||(Nc=null,Vc=Qe()+500,dl(e,t));;)try{ml();break}catch(t){ul(e,t)}Si(),Ac.current=s,kc=i,null!==Cc?t=0:(Tc=null,Lc=0,t=Bc)}if(0!==t){if(2===t&&0!==(i=yt(e))&&(o=i,t=nl(e,i)),1===t)throw n=jc,dl(e,0),il(e,o),tl(e,Qe()),n;if(6===t)il(e,o);else{if(i=e.current.alternate,!(30&o||function(e){for(var t=e;;){if(16384&t.flags){var r=t.updateQueue;if(null!==r&&null!==(r=r.stores))for(var n=0;n<r.length;n++){var o=r[n],i=o.getSnapshot;o=o.value;try{if(!on(i(),o))return!1}catch(e){return!1}}}if(r=t.child,16384&t.subtreeFlags&&null!==r)r.return=t,t=r;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)||(t=hl(e,o),2===t&&(s=yt(e),0!==s&&(o=s,t=nl(e,s))),1!==t)))throw n=jc,dl(e,0),il(e,o),tl(e,Qe()),n;switch(e.finishedWork=i,e.finishedLanes=o,t){case 0:case 1:throw Error(r(345));case 2:case 5:vl(e,Kc,Nc);break;case 3:if(il(e,o),(130023424&o)===o&&10<(t=Mc+500-Qe())){if(0!==ft(e,0))break;if(((i=e.suspendedLanes)&o)!==o){Qc(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=to(vl.bind(null,e,Kc,Nc),t);break}vl(e,Kc,Nc);break;case 4:if(il(e,o),(4194240&o)===o)break;for(t=e.eventTimes,i=-1;0<o;){var a=31-at(o);s=1<<a,(a=t[a])>i&&(i=a),o&=~s}if(o=i,10<(o=(120>(o=Qe()-o)?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Rc(o/1960))-o)){e.timeoutHandle=to(vl.bind(null,e,Kc,Nc),o);break}vl(e,Kc,Nc);break;default:throw Error(r(329))}}}return tl(e,Qe()),e.callbackNode===n?rl.bind(null,e):null}function nl(e,t){var r=Ic;return e.current.memoizedState.isDehydrated&&(dl(e,t).flags|=256),2!==(e=hl(e,t))&&(t=Kc,Kc=r,null!==t&&ol(t)),e}function ol(e){null===Kc?Kc=e:Kc.push.apply(Kc,e)}function il(e,t){for(t&=~Uc,t&=~Oc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-at(t),n=1<<r;e[r]=-1,t&=~n}}function sl(e){if(6&kc)throw Error(r(327));El();var t=ft(e,0);if(!(1&t))return tl(e,Qe()),null;var n=hl(e,t);if(0!==e.tag&&2===n){var o=yt(e);0!==o&&(t=o,n=nl(e,o))}if(1===n)throw n=jc,dl(e,0),il(e,t),tl(e,Qe()),n;if(6===n)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,vl(e,Kc,Nc),tl(e,Qe()),null}function al(e,t){var r=kc;kc|=1;try{return e(t)}finally{0===(kc=r)&&(Vc=Qe()+500,Ko&&No())}}function cl(e){null!==Gc&&0===Gc.tag&&!(6&kc)&&El();var t=kc;kc|=1;var r=Sc.transition,n=Et;try{if(Sc.transition=null,Et=1,e)return e()}finally{Et=n,Sc.transition=r,!(6&(kc=t))&&No()}}function ll(){Pc=xc.current,_o(xc)}function dl(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,ro(r)),null!==Cc)for(r=Cc.return;null!==r;){var n=r;switch(ei(n),n.tag){case 1:null!=(n=n.type.childContextTypes)&&Bo();break;case 3:Wi(),_o(Co),_o(To),ts();break;case 5:Ji(n);break;case 4:Wi();break;case 13:case 19:_o(Qi);break;case 10:ki(n.type._context);break;case 22:case 23:ll()}r=r.return}if(Tc=e,Cc=e=xl(e.current,null),Lc=Pc=t,Bc=0,jc=null,Uc=Oc=Dc=0,Kc=Ic=null,null!==Pi){for(t=0;t<Pi.length;t++)if(null!==(n=(r=Pi[t]).interleaved)){r.interleaved=null;var o=n.next,i=r.pending;if(null!==i){var s=i.next;i.next=o,n.next=s}r.pending=n}Pi=null}return e}function ul(e,t){for(;;){var n=Cc;try{if(Si(),rs.current=Zs,cs){for(var o=is.memoizedState;null!==o;){var i=o.queue;null!==i&&(i.pending=null),o=o.next}cs=!1}if(os=0,as=ss=is=null,ls=!1,ds=0,_c.current=null,null===n||null===n.return){Bc=1,jc=t,Cc=null;break}e:{var s=e,a=n.return,c=n,l=t;if(t=Lc,c.flags|=32768,null!==l&&"object"==typeof l&&"function"==typeof l.then){var d=l,u=c,p=u.tag;if(!(1&u.mode||0!==p&&11!==p&&15!==p)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=ha(a);if(null!==h){h.flags&=-257,ya(h,a,c,0,t),1&h.mode&&fa(s,d,t),l=d;var y=(t=h).updateQueue;if(null===y){var m=new Set;m.add(l),t.updateQueue=m}else y.add(l);break e}if(!(1&t)){fa(s,d,t),fl();break e}l=Error(r(426))}else if(ni&&1&c.mode){var b=ha(a);if(null!==b){!(65536&b.flags)&&(b.flags|=256),ya(b,a,c,0,t),fi(aa(l,c));break e}}s=l=aa(l,c),4!==Bc&&(Bc=2),null===Ic?Ic=[s]:Ic.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t,Vi(s,ua(0,l,t));break e;case 1:c=l;var g=s.type,v=s.stateNode;if(!(128&s.flags||"function"!=typeof g.getDerivedStateFromError&&(null===v||"function"!=typeof v.componentDidCatch||null!==qc&&qc.has(v)))){s.flags|=65536,t&=-t,s.lanes|=t,Vi(s,pa(s,c,t));break e}}s=s.return}while(null!==s)}gl(n)}catch(e){t=e,Cc===n&&null!==n&&(Cc=n=n.return);continue}break}}function pl(){var e=Ac.current;return Ac.current=Zs,null===e?Zs:e}function fl(){0!==Bc&&3!==Bc&&2!==Bc||(Bc=4),null===Tc||!(268435455&Dc)&&!(268435455&Oc)||il(Tc,Lc)}function hl(e,t){var n=kc;kc|=2;var o=pl();for(Tc===e&&Lc===t||(Nc=null,dl(e,t));;)try{yl();break}catch(t){ul(e,t)}if(Si(),kc=n,Ac.current=o,null!==Cc)throw Error(r(261));return Tc=null,Lc=0,Bc}function yl(){for(;null!==Cc;)bl(Cc)}function ml(){for(;null!==Cc&&!Ze();)bl(Cc)}function bl(e){var t=wc(e.alternate,e,Pc);e.memoizedProps=e.pendingProps,null===t?gl(e):Cc=t,_c.current=null}function gl(e){var t=e;do{var r=t.alternate;if(e=t.return,32768&t.flags){if(null!==(r=Ga(r,t)))return r.flags&=32767,void(Cc=r);if(null===e)return Bc=6,void(Cc=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(r=$a(r,t,Pc)))return void(Cc=r);if(null!==(t=t.sibling))return void(Cc=t);Cc=t=e}while(null!==t);0===Bc&&(Bc=5)}function vl(e,t,n){var o=Et,i=Sc.transition;try{Sc.transition=null,Et=1,function(e,t,n,o){do{El()}while(null!==Gc);if(6&kc)throw Error(r(327));n=e.finishedWork;var i=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(function(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var o=31-at(r),i=1<<o;t[o]=0,n[o]=-1,e[o]=-1,r&=~i}}(e,s),e===Tc&&(Cc=Tc=null,Lc=0),!(2064&n.subtreeFlags)&&!(2064&n.flags)||$c||($c=!0,Tl(rt,(function(){return El(),null}))),s=!!(15990&n.flags),15990&n.subtreeFlags||s){s=Sc.transition,Sc.transition=null;var a=Et;Et=1;var c=kc;kc|=4,_c.current=null,function(e,t){if(Qn=$t,un(e=dn())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var o=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(o&&0!==o.rangeCount){n=o.anchorNode;var i=o.anchorOffset,s=o.focusNode;o=o.focusOffset;try{n.nodeType,s.nodeType}catch(e){n=null;break e}var a=0,c=-1,l=-1,d=0,u=0,p=e,f=null;t:for(;;){for(var h;p!==n||0!==i&&3!==p.nodeType||(c=a+i),p!==s||0!==o&&3!==p.nodeType||(l=a+o),3===p.nodeType&&(a+=p.nodeValue.length),null!==(h=p.firstChild);)f=p,p=h;for(;;){if(p===e)break t;if(f===n&&++d===i&&(c=a),f===s&&++u===o&&(l=a),null!==(h=p.nextSibling))break;f=(p=f).parentNode}p=h}n=-1===c||-1===l?null:{start:c,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yn={focusedElem:e,selectionRange:n},$t=!1,Za=t;null!==Za;)if(e=(t=Za).child,1028&t.subtreeFlags&&null!==e)e.return=t,Za=e;else for(;null!==Za;){t=Za;try{var y=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==y){var m=y.memoizedProps,b=y.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:ea(t.type,m),b);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var E=t.stateNode.containerInfo;1===E.nodeType?E.textContent="":9===E.nodeType&&E.documentElement&&E.removeChild(E.documentElement);break;default:throw Error(r(163))}}catch(e){Rl(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Za=e;break}Za=t.return}y=Ya,Ya=!1}(e,n),hc(n,e),pn(Yn),$t=!!Qn,Yn=Qn=null,e.current=n,mc(n),Je(),kc=c,Et=a,Sc.transition=s}else e.current=n;if($c&&($c=!1,Gc=e,Hc=i),0===(s=e.pendingLanes)&&(qc=null),function(e){if(st&&"function"==typeof st.onCommitFiberRoot)try{st.onCommitFiberRoot(it,e,void 0,!(128&~e.current.flags))}catch(e){}}(n.stateNode),tl(e,Qe()),null!==t)for(o=e.onRecoverableError,n=0;n<t.length;n++)o((i=t[n]).value,{componentStack:i.stack,digest:i.digest});if(zc)throw zc=!1,e=Fc,Fc=null,e;!!(1&Hc)&&0!==e.tag&&El(),1&(s=e.pendingLanes)?e===Wc?Xc++:(Xc=0,Wc=e):Xc=0,No()}(e,t,n,o)}finally{Sc.transition=i,Et=o}return null}function El(){if(null!==Gc){var e=wt(Hc),t=Sc.transition,n=Et;try{if(Sc.transition=null,Et=16>e?16:e,null===Gc)var o=!1;else{if(e=Gc,Gc=null,Hc=0,6&kc)throw Error(r(331));var i=kc;for(kc|=4,Za=e.current;null!==Za;){var s=Za,a=s.child;if(16&Za.flags){var c=s.deletions;if(null!==c){for(var l=0;l<c.length;l++){var d=c[l];for(Za=d;null!==Za;){var u=Za;switch(u.tag){case 0:case 11:case 15:ec(8,u,s)}var p=u.child;if(null!==p)p.return=u,Za=p;else for(;null!==Za;){var f=(u=Za).sibling,h=u.return;if(nc(u),u===d){Za=null;break}if(null!==f){f.return=h,Za=f;break}Za=h}}}var y=s.alternate;if(null!==y){var m=y.child;if(null!==m){y.child=null;do{var b=m.sibling;m.sibling=null,m=b}while(null!==m)}}Za=s}}if(2064&s.subtreeFlags&&null!==a)a.return=s,Za=a;else e:for(;null!==Za;){if(2048&(s=Za).flags)switch(s.tag){case 0:case 11:case 15:ec(9,s,s.return)}var g=s.sibling;if(null!==g){g.return=s.return,Za=g;break e}Za=s.return}}var v=e.current;for(Za=v;null!==Za;){var E=(a=Za).child;if(2064&a.subtreeFlags&&null!==E)E.return=a,Za=E;else e:for(a=v;null!==Za;){if(2048&(c=Za).flags)try{switch(c.tag){case 0:case 11:case 15:tc(9,c)}}catch(e){Rl(c,c.return,e)}if(c===a){Za=null;break e}var w=c.sibling;if(null!==w){w.return=c.return,Za=w;break e}Za=c.return}}if(kc=i,No(),st&&"function"==typeof st.onPostCommitFiberRoot)try{st.onPostCommitFiberRoot(it,e)}catch(e){}o=!0}return o}finally{Et=n,Sc.transition=t}}return!1}function wl(e,t,r){e=Ki(e,t=ua(0,t=aa(r,t),1),1),t=Qc(),null!==e&&(gt(e,1,t),tl(e,t))}function Rl(e,t,r){if(3===e.tag)wl(e,e,r);else for(;null!==t;){if(3===t.tag){wl(t,e,r);break}if(1===t.tag){var n=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof n.componentDidCatch&&(null===qc||!qc.has(n))){t=Ki(t,e=pa(t,e=aa(r,e),1),1),e=Qc(),null!==t&&(gt(t,1,e),tl(t,e));break}}t=t.return}}function Al(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),t=Qc(),e.pingedLanes|=e.suspendedLanes&r,Tc===e&&(Lc&r)===r&&(4===Bc||3===Bc&&(130023424&Lc)===Lc&&500>Qe()-Mc?dl(e,0):Uc|=r),tl(e,t)}function _l(e,t){0===t&&(1&e.mode?(t=ut,!(130023424&(ut<<=1))&&(ut=4194304)):t=1);var r=Qc();null!==(e=ji(e,t))&&(gt(e,t,r),tl(e,r))}function Sl(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),_l(e,r)}function kl(e,t){var n=0;switch(e.tag){case 13:var o=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(r(314))}null!==o&&o.delete(t),_l(e,n)}function Tl(e,t){return Xe(e,t)}function Cl(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ll(e,t,r,n){return new Cl(e,t,r,n)}function Pl(e){return!(!(e=e.prototype)||!e.isReactComponent)}function xl(e,t){var r=e.alternate;return null===r?((r=Ll(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=14680064&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Bl(e,t,n,o,i,s){var a=2;if(o=e,"function"==typeof e)Pl(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case _:return jl(n.children,i,s,t);case S:a=8,i|=8;break;case k:return(e=Ll(12,n,t,2|i)).elementType=k,e.lanes=s,e;case P:return(e=Ll(13,n,t,i)).elementType=P,e.lanes=s,e;case x:return(e=Ll(19,n,t,i)).elementType=x,e.lanes=s,e;case D:return Dl(n,i,s,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case T:a=10;break e;case C:a=9;break e;case L:a=11;break e;case B:a=14;break e;case j:a=16,o=null;break e}throw Error(r(130,null==e?e:typeof e,""))}return(t=Ll(a,n,t,i)).elementType=e,t.type=o,t.lanes=s,t}function jl(e,t,r,n){return(e=Ll(7,e,n,t)).lanes=r,e}function Dl(e,t,r,n){return(e=Ll(22,e,n,t)).elementType=D,e.lanes=r,e.stateNode={isHidden:!1},e}function Ol(e,t,r){return(e=Ll(6,e,null,t)).lanes=r,e}function Ul(e,t,r){return(t=Ll(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Il(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bt(0),this.expirationTimes=bt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bt(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Kl(e,t,r,n,o,i,s,a,c){return e=new Il(e,t,r,a,c),1===t?(t=1,!0===i&&(t|=8)):t=0,i=Ll(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Oi(i),e}function Ml(e){if(!e)return ko;e:{if(Fe(e=e._reactInternals)!==e||1!==e.tag)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(xo(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(r(171))}if(1===e.tag){var n=e.type;if(xo(n))return Do(e,n,t)}return t}function Vl(e,t,r,n,o,i,s,a,c){return(e=Kl(r,n,!0,e,0,i,0,a,c)).context=Ml(null),r=e.current,(i=Ii(n=Qc(),o=Yc(r))).callback=null!=t?t:null,Ki(r,i,o),e.current.lanes=o,gt(e,o,n),tl(e,n),e}function Nl(e,t,r,n){var o=t.current,i=Qc(),s=Yc(o);return r=Ml(r),null===t.context?t.context=r:t.pendingContext=r,(t=Ii(i,s)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),null!==(e=Ki(o,t,s))&&(el(e,o,s,i),Mi(e,o,s)),s}function zl(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Fl(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function ql(e,t){Fl(e,t),(e=e.alternate)&&Fl(e,t)}wc=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Co.current)ba=!0;else{if(!(e.lanes&n||128&t.flags))return ba=!1,function(e,t,r){switch(t.tag){case 3:Ta(t),pi();break;case 5:Zi(t);break;case 1:xo(t.type)&&Oo(t);break;case 4:Xi(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,o=t.memoizedProps.value;So(wi,n._currentValue),n._currentValue=o;break;case 13:if(null!==(n=t.memoizedState))return null!==n.dehydrated?(So(Qi,1&Qi.current),t.flags|=128,null):r&t.child.childLanes?Oa(e,t,r):(So(Qi,1&Qi.current),null!==(e=za(e,t,r))?e.sibling:null);So(Qi,1&Qi.current);break;case 19:if(n=!!(r&t.childLanes),128&e.flags){if(n)return Va(e,t,r);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),So(Qi,Qi.current),n)break;return null;case 22:case 23:return t.lanes=0,Ra(e,t,r)}return za(e,t,r)}(e,t,n);ba=!!(131072&e.flags)}else ba=!1,ni&&1048576&t.flags&&Qo(t,$o,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Na(e,t),e=t.pendingProps;var i=Po(t,To.current);Ci(t,n),i=hs(null,t,o,e,i,n);var s=ys();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xo(o)?(s=!0,Oo(t)):s=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Oi(t),i.updater=ra,t.stateNode=i,i._reactInternals=t,sa(t,o,e,n),t=ka(null,t,o,!0,s,n)):(t.tag=0,ni&&s&&Yo(t),ga(null,t,i,n),t=t.child),t;case 16:o=t.elementType;e:{switch(Na(e,t),e=t.pendingProps,o=(i=o._init)(o._payload),t.type=o,i=t.tag=function(e){if("function"==typeof e)return Pl(e)?1:0;if(null!=e){if((e=e.$$typeof)===L)return 11;if(e===B)return 14}return 2}(o),e=ea(o,e),i){case 0:t=_a(null,t,o,e,n);break e;case 1:t=Sa(null,t,o,e,n);break e;case 11:t=va(null,t,o,e,n);break e;case 14:t=Ea(null,t,o,ea(o.type,e),n);break e}throw Error(r(306,o,""))}return t;case 0:return o=t.type,i=t.pendingProps,_a(e,t,o,i=t.elementType===o?i:ea(o,i),n);case 1:return o=t.type,i=t.pendingProps,Sa(e,t,o,i=t.elementType===o?i:ea(o,i),n);case 3:e:{if(Ta(t),null===e)throw Error(r(387));o=t.pendingProps,i=(s=t.memoizedState).element,Ui(e,t),Ni(t,o,null,n);var a=t.memoizedState;if(o=a.element,s.isDehydrated){if(s={element:o,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,256&t.flags){t=Ca(e,t,o,n,i=aa(Error(r(423)),t));break e}if(o!==i){t=Ca(e,t,o,n,i=aa(Error(r(424)),t));break e}for(ri=ao(t.stateNode.containerInfo.firstChild),ti=t,ni=!0,oi=null,n=Ei(t,null,o,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(pi(),o===i){t=za(e,t,n);break e}ga(e,t,o,n)}t=t.child}return t;case 5:return Zi(t),null===e&&ci(t),o=t.type,i=t.pendingProps,s=null!==e?e.memoizedProps:null,a=i.children,eo(o,i)?a=null:null!==s&&eo(o,s)&&(t.flags|=32),Aa(e,t),ga(e,t,a,n),t.child;case 6:return null===e&&ci(t),null;case 13:return Oa(e,t,n);case 4:return Xi(t,t.stateNode.containerInfo),o=t.pendingProps,null===e?t.child=vi(t,null,o,n):ga(e,t,o,n),t.child;case 11:return o=t.type,i=t.pendingProps,va(e,t,o,i=t.elementType===o?i:ea(o,i),n);case 7:return ga(e,t,t.pendingProps,n),t.child;case 8:case 12:return ga(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(o=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,So(wi,o._currentValue),o._currentValue=a,null!==s)if(on(s.value,a)){if(s.children===i.children&&!Co.current){t=za(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var c=s.dependencies;if(null!==c){a=s.child;for(var l=c.firstContext;null!==l;){if(l.context===o){if(1===s.tag){(l=Ii(-1,n&-n)).tag=2;var d=s.updateQueue;if(null!==d){var u=(d=d.shared).pending;null===u?l.next=l:(l.next=u.next,u.next=l),d.pending=l}}s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),Ti(s.return,n,t),c.lanes|=n;break}l=l.next}}else if(10===s.tag)a=s.type===t.type?null:s.child;else if(18===s.tag){if(null===(a=s.return))throw Error(r(341));a.lanes|=n,null!==(c=a.alternate)&&(c.lanes|=n),Ti(a,n,t),a=s.sibling}else a=s.child;if(null!==a)a.return=s;else for(a=s;null!==a;){if(a===t){a=null;break}if(null!==(s=a.sibling)){s.return=a.return,a=s;break}a=a.return}s=a}ga(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,o=t.pendingProps.children,Ci(t,n),o=o(i=Li(i)),t.flags|=1,ga(e,t,o,n),t.child;case 14:return i=ea(o=t.type,t.pendingProps),Ea(e,t,o,i=ea(o.type,i),n);case 15:return wa(e,t,t.type,t.pendingProps,n);case 17:return o=t.type,i=t.pendingProps,i=t.elementType===o?i:ea(o,i),Na(e,t),t.tag=1,xo(o)?(e=!0,Oo(t)):e=!1,Ci(t,n),oa(t,o,i),sa(t,o,i,n),ka(null,t,o,!0,e,n);case 19:return Va(e,t,n);case 22:return Ra(e,t,n)}throw Error(r(156,t.tag))};var $l="function"==typeof reportError?reportError:function(e){console.error(e)};function Gl(e){this._internalRoot=e}function Hl(e){this._internalRoot=e}function Xl(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Wl(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Zl(){}function Jl(e,t,r,n,o){var i=r._reactRootContainer;if(i){var s=i;if("function"==typeof o){var a=o;o=function(){var e=zl(s);a.call(e)}}Nl(t,s,e,o)}else s=function(e,t,r,n,o){if(o){if("function"==typeof n){var i=n;n=function(){var e=zl(s);i.call(e)}}var s=Vl(t,n,e,0,null,!1,0,"",Zl);return e._reactRootContainer=s,e[fo]=s.current,Vn(8===e.nodeType?e.parentNode:e),cl(),s}for(;o=e.lastChild;)e.removeChild(o);if("function"==typeof n){var a=n;n=function(){var e=zl(c);a.call(e)}}var c=Kl(e,0,!1,null,0,!1,0,"",Zl);return e._reactRootContainer=c,e[fo]=c.current,Vn(8===e.nodeType?e.parentNode:e),cl((function(){Nl(t,c,r,n)})),c}(r,t,e,o,n);return zl(s)}Hl.prototype.render=Gl.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(r(409));Nl(e,t,null,null)},Hl.prototype.unmount=Gl.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;cl((function(){Nl(null,e,null,null)})),t[fo]=null}},Hl.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Dt.length&&0!==t&&t<Dt[r].priority;r++);Dt.splice(r,0,e),0===r&&Kt(e)}},Rt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=pt(t.pendingLanes);0!==r&&(vt(t,1|r),tl(t,Qe()),!(6&kc)&&(Vc=Qe()+500,No()))}break;case 13:cl((function(){var t=ji(e,1);if(null!==t){var r=Qc();el(t,e,1,r)}})),ql(e,1)}},At=function(e){if(13===e.tag){var t=ji(e,134217728);null!==t&&el(t,e,134217728,Qc()),ql(e,134217728)}},_t=function(e){if(13===e.tag){var t=Yc(e),r=ji(e,t);null!==r&&el(r,e,t,Qc()),ql(e,t)}},St=function(){return Et},kt=function(e,t){var r=Et;try{return Et=e,t()}finally{Et=r}},Ae=function(e,t,n){switch(t){case"input":if(Y(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var o=n[t];if(o!==e&&o.form===e.form){var i=Eo(o);if(!i)throw Error(r(90));X(o),Y(o,i)}}}break;case"textarea":se(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Le=al,Pe=cl;var Ql={usingClientEntryPoint:!1,Events:[go,vo,Eo,Te,Ce,al]},Yl={findFiberByHostInstance:bo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ed={bundleType:Yl.bundleType,version:Yl.version,rendererPackageName:Yl.rendererPackageName,rendererConfig:Yl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ge(e))?null:e.stateNode},findFiberByHostInstance:Yl.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var td=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!td.isDisabled&&td.supportsFiber)try{it=td.inject(ed),st=td}catch(ue){}}return b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ql,b.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Xl(t))throw Error(r(200));return function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:A,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}(e,t,null,n)},b.createRoot=function(e,t){if(!Xl(e))throw Error(r(299));var n=!1,o="",i=$l;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(o=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Kl(e,1,!1,null,0,n,0,o,i),e[fo]=t.current,Vn(8===e.nodeType?e.parentNode:e),new Gl(t)},b.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(r(188));throw e=Object.keys(e).join(","),Error(r(268,e))}return null===(e=Ge(t))?null:e.stateNode},b.flushSync=function(e){return cl(e)},b.hydrate=function(e,t,n){if(!Wl(t))throw Error(r(200));return Jl(null,e,t,!0,n)},b.hydrateRoot=function(e,t,n){if(!Xl(e))throw Error(r(405));var o=null!=n&&n.hydratedSources||null,i=!1,s="",a=$l;if(null!=n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(s=n.identifierPrefix),void 0!==n.onRecoverableError&&(a=n.onRecoverableError)),t=Vl(t,null,e,1,null!=n?n:null,i,0,s,a),e[fo]=t.current,Vn(e),o)for(e=0;e<o.length;e++)i=(i=(n=o[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Hl(t)},b.render=function(e,t,n){if(!Wl(t))throw Error(r(200));return Jl(null,e,t,!1,n)},b.unmountComponentAtNode=function(e){if(!Wl(e))throw Error(r(40));return!!e._reactRootContainer&&(cl((function(){Jl(null,null,e,!1,(function(){e._reactRootContainer=null,e[fo]=null}))})),!0)},b.unstable_batchedUpdates=al,b.unstable_renderSubtreeIntoContainer=function(e,t,n,o){if(!Wl(n))throw Error(r(200));if(null==e||void 0===e._reactInternals)throw Error(r(38));return Jl(e,t,n,!1,o)},b.version="18.3.1-next-f1338f8080-20240426",b}();var w=m.exports;y.createRoot=w.createRoot,y.hydrateRoot=w.hydrateRoot;var R={},A={},_={},S={},k={},T={},C={},L={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0,function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(t=e.util||(e.util={})),(e.objectUtil||(e.objectUtil={})).mergeShapes=(e,t)=>({...e,...t}),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);e.getParsedType=t=>{switch(typeof t){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return isNaN(t)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(t)?e.ZodParsedType.array:null===t?e.ZodParsedType.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?e.ZodParsedType.promise:"undefined"!=typeof Map&&t instanceof Map?e.ZodParsedType.map:"undefined"!=typeof Set&&t instanceof Set?e.ZodParsedType.set:"undefined"!=typeof Date&&t instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}}}(L);var P={};Object.defineProperty(P,"__esModule",{value:!0}),P.ZodError=P.quotelessJson=P.ZodIssueCode=void 0;const x=L;P.ZodIssueCode=x.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);P.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class B extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(n);else if("invalid_return_type"===o.code)n(o.returnTypeError);else if("invalid_arguments"===o.code)n(o.argumentsError);else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;n<o.path.length;){const r=o.path[n];n===o.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(o))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof B))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}P.ZodError=B,B.create=e=>new B(e),Object.defineProperty(C,"__esModule",{value:!0});const j=L,D=P;C.default=(e,t)=>{let r;switch(e.code){case D.ZodIssueCode.invalid_type:r=e.received===j.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case D.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,j.util.jsonStringifyReplacer)}`;break;case D.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${j.util.joinValues(e.keys,", ")}`;break;case D.ZodIssueCode.invalid_union:r="Invalid input";break;case D.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${j.util.joinValues(e.options)}`;break;case D.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${j.util.joinValues(e.options)}, received '${e.received}'`;break;case D.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case D.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case D.ZodIssueCode.invalid_date:r="Invalid date";break;case D.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:j.util.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case D.ZodIssueCode.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case D.ZodIssueCode.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case D.ZodIssueCode.custom:r="Invalid input";break;case D.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case D.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case D.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,j.util.assertNever(e)}return{message:r}};var O=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(T,"__esModule",{value:!0}),T.getErrorMap=T.setErrorMap=T.defaultErrorMap=void 0;const U=O(C);T.defaultErrorMap=U.default;let I=U.default;T.setErrorMap=function(e){I=e},T.getErrorMap=function(){return I};var K={};!function(t){var r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;const n=T,o=r(C);t.makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(void 0!==o.message)return{...o,path:i,message:o.message};let a="";const c=n.filter((e=>!!e)).slice().reverse();for(const e of c)a=e(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},t.EMPTY_PATH=[],t.addIssueToContext=function(e,r){const i=(0,n.getErrorMap)(),s=(0,t.makeIssue)({issueData:r,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i,i===o.default?void 0:o.default].filter((e=>!!e))});e.common.issues.push(s)};class i{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const o of r){if("aborted"===o.status)return t.INVALID;"dirty"===o.status&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return i.mergeObjectSync(e,r)}static mergeObjectSync(e,r){const n={};for(const o of r){const{key:r,value:i}=o;if("aborted"===r.status)return t.INVALID;if("aborted"===i.status)return t.INVALID;"dirty"===r.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"===r.value||void 0===i.value&&!o.alwaysSet||(n[r.value]=i.value)}return{status:e.value,value:n}}}t.ParseStatus=i,t.INVALID=Object.freeze({status:"aborted"});t.DIRTY=e=>({status:"dirty",value:e});t.OK=e=>({status:"valid",value:e});t.isAborted=e=>"aborted"===e.status;t.isDirty=e=>"dirty"===e.status;t.isValid=e=>"valid"===e.status;t.isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise}(K);var M={};Object.defineProperty(M,"__esModule",{value:!0});var V,N={},z={};V=z,Object.defineProperty(V,"__esModule",{value:!0}),V.errorUtil=void 0,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(V.errorUtil||(V.errorUtil={})),function(t){var r,n,o=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},i=e&&e.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r};Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.datetimeRegex=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=t.date=void 0;const s=T,a=z,c=K,l=L,d=P;class u{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const p=(e,t)=>{if((0,c.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new d.ZodError(e.common.issues);return this._error=t,this._error}}};function f(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:o};return{errorMap:(t,o)=>{var i,s;const{message:a}=e;return"invalid_enum_value"===t.code?{message:null!=a?a:o.defaultError}:void 0===o.data?{message:null!==(i=null!=a?a:n)&&void 0!==i?i:o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:null!==(s=null!=a?a:r)&&void 0!==s?s:o.defaultError}},description:o}}class h{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return(0,l.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,l.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new c.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,l.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,c.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,l.getParsedType)(e)},o=this._parseSync({data:e,path:n.path,parent:n});return p(n,o)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,l.getParsedType)(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await((0,c.isAsync)(n)?n:Promise.resolve(n));return p(r,o)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const o=e(t),i=()=>n.addIssue({code:d.ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&o instanceof Promise?o.then((e=>!!e||(i(),!1))):!!o||(i(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new he({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ye.create(this,this._def)}nullable(){return me.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this,this._def)}promise(){return fe.create(this,this._def)}or(e){return Q.create([this,e],this._def)}and(e){return re.create(this,e,this._def)}transform(e){return new he({...f(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new be({...f(this._def),innerType:this,defaultValue:t,typeName:_e.ZodDefault})}brand(){return new Ee({typeName:_e.ZodBranded,type:this,...f(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ge({...f(this._def),innerType:this,catchValue:t,typeName:_e.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return we.create(this,e)}readonly(){return Re.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=h,t.Schema=h,t.ZodSchema=h;const y=/^c[^\s-]{8,}$/i,m=/^[0-9a-z]+$/,b=/^[0-9A-HJKMNP-TV-Z]{26}$/,g=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,v=/^[a-z0-9_-]{21}$/i,E=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,w=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let R;const A=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,S=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,k="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",C=new RegExp(`^${k}$`);function x(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function B(e){let t=`${k}T${x(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function j(e,t){return!("v4"!==t&&t||!A.test(e))||!("v6"!==t&&t||!_.test(e))}t.datetimeRegex=B;class D extends h{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==l.ZodParsedType.string){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.string,received:t.parsedType}),c.INVALID}const t=new c.ParseStatus;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const o=e.data.length>n.value,i=e.data.length<n.value;(o||i)&&(r=this._getOrReturnCtx(e,r),o?(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)w.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"email",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)R||(R=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),R.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"emoji",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)g.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"uuid",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)v.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"nanoid",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)y.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"cuid",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)m.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"cuid2",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)b.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"ulid",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch(o){r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"url",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"regex",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty())}else if("trim"===n.kind)e.data=e.data.trim();else if("includes"===n.kind)e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty());else if("toLowerCase"===n.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===n.kind)e.data=e.data.toUpperCase();else if("startsWith"===n.kind)e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty());else if("endsWith"===n.kind)e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty());else if("datetime"===n.kind){B(n).test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_string,validation:"datetime",message:n.message}),t.dirty())}else if("date"===n.kind){C.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_string,validation:"date",message:n.message}),t.dirty())}else if("time"===n.kind){new RegExp(`^${x(n)}$`).test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_string,validation:"time",message:n.message}),t.dirty())}else"duration"===n.kind?E.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"duration",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?j(e.data,n.version)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"ip",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?S.test(e.data)||(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{validation:"base64",code:d.ZodIssueCode.invalid_string,message:n.message}),t.dirty()):l.util.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:d.ZodIssueCode.invalid_string,...a.errorUtil.errToObj(r)})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...a.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...a.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...a.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...a.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...a.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...a.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...a.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...a.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...a.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...a.errorUtil.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...a.errorUtil.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...a.errorUtil.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...a.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...a.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...a.errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...a.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...a.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...a.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...a.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...a.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,a.errorUtil.errToObj(e))}trim(){return new D({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new D({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function O(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n;return parseInt(e.toFixed(o).replace(".",""))%parseInt(t.toFixed(o).replace(".",""))/Math.pow(10,o)}t.ZodString=D,D.create=e=>{var t;return new D({checks:[],typeName:_e.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...f(e)})};class U extends h{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==l.ZodParsedType.number){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.number,received:t.parsedType}),c.INVALID}let t;const r=new c.ParseStatus;for(const n of this._def.checks)if("int"===n.kind)l.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else"multipleOf"===n.kind?0!==O(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.not_finite,message:n.message}),r.dirty()):l.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,a.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.errorUtil.toString(t))}setLimit(e,t,r,n){return new U({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a.errorUtil.toString(n)}]})}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:a.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:a.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:a.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:a.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:a.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:a.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:a.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:a.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&l.util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}t.ZodNumber=U,U.create=e=>new U({checks:[],typeName:_e.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...f(e)});class I extends h{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==l.ZodParsedType.bigint){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.bigint,received:t.parsedType}),c.INVALID}let t;const r=new c.ParseStatus;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):l.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,a.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a.errorUtil.toString(t))}setLimit(e,t,r,n){return new I({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a.errorUtil.toString(n)}]})}_addCheck(e){return new I({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:a.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:a.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:a.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:a.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}t.ZodBigInt=I,I.create=e=>{var t;return new I({checks:[],typeName:_e.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...f(e)})};class M extends h{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==l.ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.boolean,received:t.parsedType}),c.INVALID}return(0,c.OK)(e.data)}}t.ZodBoolean=M,M.create=e=>new M({typeName:_e.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...f(e)});class V extends h{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==l.ZodParsedType.date){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.date,received:t.parsedType}),c.INVALID}if(isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_date}),c.INVALID}const t=new c.ParseStatus;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):l.util.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:a.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:a.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}t.ZodDate=V,V.create=e=>new V({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:_e.ZodDate,...f(e)});class N extends h{_parse(e){if(this._getType(e)!==l.ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.symbol,received:t.parsedType}),c.INVALID}return(0,c.OK)(e.data)}}t.ZodSymbol=N,N.create=e=>new N({typeName:_e.ZodSymbol,...f(e)});class F extends h{_parse(e){if(this._getType(e)!==l.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.undefined,received:t.parsedType}),c.INVALID}return(0,c.OK)(e.data)}}t.ZodUndefined=F,F.create=e=>new F({typeName:_e.ZodUndefined,...f(e)});class q extends h{_parse(e){if(this._getType(e)!==l.ZodParsedType.null){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.null,received:t.parsedType}),c.INVALID}return(0,c.OK)(e.data)}}t.ZodNull=q,q.create=e=>new q({typeName:_e.ZodNull,...f(e)});class $ extends h{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,c.OK)(e.data)}}t.ZodAny=$,$.create=e=>new $({typeName:_e.ZodAny,...f(e)});class G extends h{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,c.OK)(e.data)}}t.ZodUnknown=G,G.create=e=>new G({typeName:_e.ZodUnknown,...f(e)});class H extends h{_parse(e){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.never,received:t.parsedType}),c.INVALID}}t.ZodNever=H,H.create=e=>new H({typeName:_e.ZodNever,...f(e)});class X extends h{_parse(e){if(this._getType(e)!==l.ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.void,received:t.parsedType}),c.INVALID}return(0,c.OK)(e.data)}}t.ZodVoid=X,X.create=e=>new X({typeName:_e.ZodVoid,...f(e)});class W extends h{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==l.ZodParsedType.array)return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.array,received:t.parsedType}),c.INVALID;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(e||o)&&((0,c.addIssueToContext)(t,{code:e?d.ZodIssueCode.too_big:d.ZodIssueCode.too_small,minimum:o?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&((0,c.addIssueToContext)(t,{code:d.ZodIssueCode.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&((0,c.addIssueToContext)(t,{code:d.ZodIssueCode.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new u(t,e,t.path,r))))).then((e=>c.ParseStatus.mergeArray(r,e)));const o=[...t.data].map(((e,r)=>n.type._parseSync(new u(t,e,t.path,r))));return c.ParseStatus.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new W({...this._def,minLength:{value:e,message:a.errorUtil.toString(t)}})}max(e,t){return new W({...this._def,maxLength:{value:e,message:a.errorUtil.toString(t)}})}length(e,t){return new W({...this._def,exactLength:{value:e,message:a.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function Z(e){if(e instanceof J){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ye.create(Z(n))}return new J({...e._def,shape:()=>t})}return e instanceof W?new W({...e._def,type:Z(e.element)}):e instanceof ye?ye.create(Z(e.unwrap())):e instanceof me?me.create(Z(e.unwrap())):e instanceof ne?ne.create(e.items.map((e=>Z(e)))):e}t.ZodArray=W,W.create=(e,t)=>new W({type:e,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...f(t)});class J extends h{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=l.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==l.ZodParsedType.object){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.object,received:t.parsedType}),c.INVALID}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof H&&"strip"===this._def.unknownKeys))for(const e in r.data)o.includes(e)||i.push(e);const s=[];for(const e of o){const t=n[e],o=r.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new u(r,o,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof H){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)s.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)i.length>0&&((0,c.addIssueToContext)(r,{code:d.ZodIssueCode.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const n=r.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new u(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of s){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>c.ParseStatus.mergeObjectSync(t,e))):c.ParseStatus.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return a.errorUtil.errToObj,new J({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,o,i,s;const c=null!==(i=null===(o=(n=this._def).errorMap)||void 0===o?void 0:o.call(n,t,r).message)&&void 0!==i?i:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(s=a.errorUtil.errToObj(e).message)&&void 0!==s?s:c}:{message:c}}}:{}})}strip(){return new J({...this._def,unknownKeys:"strip"})}passthrough(){return new J({...this._def,unknownKeys:"passthrough"})}extend(e){return new J({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new J({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new J({...this._def,catchall:e})}pick(e){const t={};return l.util.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new J({...this._def,shape:()=>t})}omit(e){const t={};return l.util.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new J({...this._def,shape:()=>t})}deepPartial(){return Z(this)}partial(e){const t={};return l.util.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new J({...this._def,shape:()=>t})}required(e){const t={};return l.util.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ye;)e=e._def.innerType;t[r]=e}})),new J({...this._def,shape:()=>t})}keyof(){return de(l.util.objectKeys(this.shape))}}t.ZodObject=J,J.create=(e,t)=>new J({shape:()=>e,unknownKeys:"strip",catchall:H.create(),typeName:_e.ZodObject,...f(t)}),J.strictCreate=(e,t)=>new J({shape:()=>e,unknownKeys:"strict",catchall:H.create(),typeName:_e.ZodObject,...f(t)}),J.lazycreate=(e,t)=>new J({shape:e,unknownKeys:"strip",catchall:H.create(),typeName:_e.ZodObject,...f(t)});class Q extends h{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new d.ZodError(e.ctx.common.issues)));return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_union,unionErrors:r}),c.INVALID}));{let e;const n=[];for(const o of r){const r={...t,common:{...t.common,issues:[]},parent:null},i=o._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=n.map((e=>new d.ZodError(e)));return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_union,unionErrors:o}),c.INVALID}}get options(){return this._def.options}}t.ZodUnion=Q,Q.create=(e,t)=>new Q({options:e,typeName:_e.ZodUnion,...f(t)});const Y=e=>e instanceof ce?Y(e.schema):e instanceof he?Y(e.innerType()):e instanceof le?[e.value]:e instanceof ue?e.options:e instanceof pe?l.util.objectValues(e.enum):e instanceof be?Y(e._def.innerType):e instanceof F?[void 0]:e instanceof q?[null]:e instanceof ye?[void 0,...Y(e.unwrap())]:e instanceof me?[null,...Y(e.unwrap())]:e instanceof Ee||e instanceof Re?Y(e.unwrap()):e instanceof ge?Y(e._def.innerType):[];class ee extends h{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.ZodParsedType.object)return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.object,received:t.parsedType}),c.INVALID;const r=this.discriminator,n=t.data[r],o=this.optionsMap.get(n);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):((0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),c.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=Y(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of t){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,r)}}return new ee({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...f(r)})}}function te(e,t){const r=(0,l.getParsedType)(e),n=(0,l.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(r===l.ZodParsedType.object&&n===l.ZodParsedType.object){const r=l.util.objectKeys(t),n=l.util.objectKeys(e).filter((e=>-1!==r.indexOf(e))),o={...e,...t};for(const r of n){const n=te(e[r],t[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===l.ZodParsedType.array&&n===l.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const o=te(e[n],t[n]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}return r===l.ZodParsedType.date&&n===l.ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}t.ZodDiscriminatedUnion=ee;class re extends h{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if((0,c.isAborted)(e)||(0,c.isAborted)(n))return c.INVALID;const o=te(e.value,n.value);return o.valid?(((0,c.isDirty)(e)||(0,c.isDirty)(n))&&t.dirty(),{status:t.value,value:o.data}):((0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_intersection_types}),c.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}t.ZodIntersection=re,re.create=(e,t,r)=>new re({left:e,right:t,typeName:_e.ZodIntersection,...f(r)});class ne extends h{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.ZodParsedType.array)return(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.array,received:r.parsedType}),c.INVALID;if(r.data.length<this._def.items.length)return(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c.INVALID;!this._def.rest&&r.data.length>this._def.items.length&&((0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new u(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>c.ParseStatus.mergeArray(t,e))):c.ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ne({...this._def,rest:e})}}t.ZodTuple=ne,ne.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ne({items:e,typeName:_e.ZodTuple,rest:null,...f(t)})};class oe extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.ZodParsedType.object)return(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.object,received:r.parsedType}),c.INVALID;const n=[],o=this._def.keyType,i=this._def.valueType;for(const e in r.data)n.push({key:o._parse(new u(r,e,r.path,e)),value:i._parse(new u(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?c.ParseStatus.mergeObjectAsync(t,n):c.ParseStatus.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new oe(t instanceof h?{keyType:e,valueType:t,typeName:_e.ZodRecord,...f(r)}:{keyType:D.create(),valueType:e,typeName:_e.ZodRecord,...f(t)})}}t.ZodRecord=oe;class ie extends h{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.ZodParsedType.map)return(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.map,received:r.parsedType}),c.INVALID;const n=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map((([e,t],i)=>({key:n._parse(new u(r,e,r.path,[i,"key"])),value:o._parse(new u(r,t,r.path,[i,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of i){const n=await r.key,o=await r.value;if("aborted"===n.status||"aborted"===o.status)return c.INVALID;"dirty"!==n.status&&"dirty"!==o.status||t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of i){const n=r.key,o=r.value;if("aborted"===n.status||"aborted"===o.status)return c.INVALID;"dirty"!==n.status&&"dirty"!==o.status||t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}}}t.ZodMap=ie,ie.create=(e,t,r)=>new ie({valueType:t,keyType:e,typeName:_e.ZodMap,...f(r)});class se extends h{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.ZodParsedType.set)return(0,c.addIssueToContext)(r,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.set,received:r.parsedType}),c.INVALID;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&((0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&((0,c.addIssueToContext)(r,{code:d.ZodIssueCode.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const o=this._def.valueType;function i(e){const r=new Set;for(const n of e){if("aborted"===n.status)return c.INVALID;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const s=[...r.data.values()].map(((e,t)=>o._parse(new u(r,e,r.path,t))));return r.common.async?Promise.all(s).then((e=>i(e))):i(s)}min(e,t){return new se({...this._def,minSize:{value:e,message:a.errorUtil.toString(t)}})}max(e,t){return new se({...this._def,maxSize:{value:e,message:a.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t.ZodSet=se,se.create=(e,t)=>new se({valueType:e,minSize:null,maxSize:null,typeName:_e.ZodSet,...f(t)});class ae extends h{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.ZodParsedType.function)return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.function,received:t.parsedType}),c.INVALID;function r(e,r){return(0,c.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.getErrorMap)(),s.defaultErrorMap].filter((e=>!!e)),issueData:{code:d.ZodIssueCode.invalid_arguments,argumentsError:r}})}function n(e,r){return(0,c.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,s.getErrorMap)(),s.defaultErrorMap].filter((e=>!!e)),issueData:{code:d.ZodIssueCode.invalid_return_type,returnTypeError:r}})}const o={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof fe){const e=this;return(0,c.OK)((async function(...t){const s=new d.ZodError([]),a=await e._def.args.parseAsync(t,o).catch((e=>{throw s.addIssue(r(t,e)),s})),c=await Reflect.apply(i,this,a);return await e._def.returns._def.type.parseAsync(c,o).catch((e=>{throw s.addIssue(n(c,e)),s}))}))}{const e=this;return(0,c.OK)((function(...t){const s=e._def.args.safeParse(t,o);if(!s.success)throw new d.ZodError([r(t,s.error)]);const a=Reflect.apply(i,this,s.data),c=e._def.returns.safeParse(a,o);if(!c.success)throw new d.ZodError([n(a,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ae({...this._def,args:ne.create(e).rest(G.create())})}returns(e){return new ae({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ae({args:e||ne.create([]).rest(G.create()),returns:t||G.create(),typeName:_e.ZodFunction,...f(r)})}}t.ZodFunction=ae;class ce extends h{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}t.ZodLazy=ce,ce.create=(e,t)=>new ce({getter:e,typeName:_e.ZodLazy,...f(t)});class le extends h{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{received:t.data,code:d.ZodIssueCode.invalid_literal,expected:this._def.value}),c.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function de(e,t){return new ue({values:e,typeName:_e.ZodEnum,...f(t)})}t.ZodLiteral=le,le.create=(e,t)=>new le({value:e,typeName:_e.ZodLiteral,...f(t)});class ue extends h{constructor(){super(...arguments),r.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,c.addIssueToContext)(t,{expected:l.util.joinValues(r),received:t.parsedType,code:d.ZodIssueCode.invalid_type}),c.INVALID}if(o(this,r,"f")||i(this,r,new Set(this._def.values),"f"),!o(this,r,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,c.addIssueToContext)(t,{received:t.data,code:d.ZodIssueCode.invalid_enum_value,options:r}),c.INVALID}return(0,c.OK)(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ue.create(e,{...this._def,...t})}exclude(e,t=this._def){return ue.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}t.ZodEnum=ue,r=new WeakMap,ue.create=de;class pe extends h{constructor(){super(...arguments),n.set(this,void 0)}_parse(e){const t=l.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==l.ZodParsedType.string&&r.parsedType!==l.ZodParsedType.number){const e=l.util.objectValues(t);return(0,c.addIssueToContext)(r,{expected:l.util.joinValues(e),received:r.parsedType,code:d.ZodIssueCode.invalid_type}),c.INVALID}if(o(this,n,"f")||i(this,n,new Set(l.util.getValidEnumValues(this._def.values)),"f"),!o(this,n,"f").has(e.data)){const e=l.util.objectValues(t);return(0,c.addIssueToContext)(r,{received:r.data,code:d.ZodIssueCode.invalid_enum_value,options:e}),c.INVALID}return(0,c.OK)(e.data)}get enum(){return this._def.values}}t.ZodNativeEnum=pe,n=new WeakMap,pe.create=(e,t)=>new pe({values:e,typeName:_e.ZodNativeEnum,...f(t)});class fe extends h{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.ZodParsedType.promise&&!1===t.common.async)return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.promise,received:t.parsedType}),c.INVALID;const r=t.parsedType===l.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,c.OK)(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}t.ZodPromise=fe,fe.create=(e,t)=>new fe({type:e,typeName:_e.ZodPromise,...f(t)});class he extends h{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:e=>{(0,c.addIssueToContext)(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===n.type){const e=n.transform(r.data,o);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return c.INVALID;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?c.INVALID:"dirty"===n.status||"dirty"===t.value?(0,c.DIRTY)(n.value):n}));{if("aborted"===t.value)return c.INVALID;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?c.INVALID:"dirty"===n.status||"dirty"===t.value?(0,c.DIRTY)(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,o);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?c.INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?c.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!(0,c.isValid)(e))return e;const i=n.transform(e.value,o);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>(0,c.isValid)(e)?Promise.resolve(n.transform(e.value,o)).then((e=>({status:t.value,value:e}))):e))}l.util.assertNever(n)}}t.ZodEffects=he,t.ZodTransformer=he,he.create=(e,t,r)=>new he({schema:e,typeName:_e.ZodEffects,effect:t,...f(r)}),he.createWithPreprocess=(e,t,r)=>new he({schema:t,effect:{type:"preprocess",transform:e},typeName:_e.ZodEffects,...f(r)});class ye extends h{_parse(e){return this._getType(e)===l.ZodParsedType.undefined?(0,c.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodOptional=ye,ye.create=(e,t)=>new ye({innerType:e,typeName:_e.ZodOptional,...f(t)});class me extends h{_parse(e){return this._getType(e)===l.ZodParsedType.null?(0,c.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodNullable=me,me.create=(e,t)=>new me({innerType:e,typeName:_e.ZodNullable,...f(t)});class be extends h{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===l.ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}t.ZodDefault=be,be.create=(e,t)=>new be({innerType:e,typeName:_e.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...f(t)});class ge extends h{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,c.isAsync)(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new d.ZodError(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new d.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=ge,ge.create=(e,t)=>new ge({innerType:e,typeName:_e.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...f(t)});class ve extends h{_parse(e){if(this._getType(e)!==l.ZodParsedType.nan){const t=this._getOrReturnCtx(e);return(0,c.addIssueToContext)(t,{code:d.ZodIssueCode.invalid_type,expected:l.ZodParsedType.nan,received:t.parsedType}),c.INVALID}return{status:"valid",value:e.data}}}t.ZodNaN=ve,ve.create=e=>new ve({typeName:_e.ZodNaN,...f(e)}),t.BRAND=Symbol("zod_brand");class Ee extends h{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}t.ZodBranded=Ee;class we extends h{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?c.INVALID:"dirty"===e.status?(t.dirty(),(0,c.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?c.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new we({in:e,out:t,typeName:_e.ZodPipeline})}}t.ZodPipeline=we;class Re extends h{_parse(e){const t=this._def.innerType._parse(e),r=e=>((0,c.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,c.isAsync)(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function Ae(e,t={},r){return e?$.create().superRefine(((n,o)=>{var i,s;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,a=null===(s=null!==(i=e.fatal)&&void 0!==i?i:r)||void 0===s||s,c="string"==typeof e?{message:e}:e;o.addIssue({code:"custom",...c,fatal:a})}})):$.create()}var _e;t.ZodReadonly=Re,Re.create=(e,t)=>new Re({innerType:e,typeName:_e.ZodReadonly,...f(t)}),t.custom=Ae,t.late={object:J.lazycreate},function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(_e=t.ZodFirstPartyTypeKind||(t.ZodFirstPartyTypeKind={}));t.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>Ae((t=>t instanceof e),t);const Se=D.create;t.string=Se;const ke=U.create;t.number=ke;const Te=ve.create;t.nan=Te;const Ce=I.create;t.bigint=Ce;const Le=M.create;t.boolean=Le;const Pe=V.create;t.date=Pe;const xe=N.create;t.symbol=xe;const Be=F.create;t.undefined=Be;const je=q.create;t.null=je;const De=$.create;t.any=De;const Oe=G.create;t.unknown=Oe;const Ue=H.create;t.never=Ue;const Ie=X.create;t.void=Ie;const Ke=W.create;t.array=Ke;const Me=J.create;t.object=Me;const Ve=J.strictCreate;t.strictObject=Ve;const Ne=Q.create;t.union=Ne;const ze=ee.create;t.discriminatedUnion=ze;const Fe=re.create;t.intersection=Fe;const qe=ne.create;t.tuple=qe;const $e=oe.create;t.record=$e;const Ge=ie.create;t.map=Ge;const He=se.create;t.set=He;const Xe=ae.create;t.function=Xe;const We=ce.create;t.lazy=We;const Ze=le.create;t.literal=Ze;const Je=ue.create;t.enum=Je;const Qe=pe.create;t.nativeEnum=Qe;const Ye=fe.create;t.promise=Ye;const et=he.create;t.effect=et,t.transformer=et;const tt=ye.create;t.optional=tt;const rt=me.create;t.nullable=rt;const nt=he.createWithPreprocess;t.preprocess=nt;const ot=we.create;t.pipeline=ot;t.ostring=()=>Se().optional();t.onumber=()=>ke().optional();t.oboolean=()=>Le().optional(),t.coerce={string:e=>D.create({...e,coerce:!0}),number:e=>U.create({...e,coerce:!0}),boolean:e=>M.create({...e,coerce:!0}),bigint:e=>I.create({...e,coerce:!0}),date:e=>V.create({...e,coerce:!0})},t.NEVER=c.INVALID}(N),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(T,t),n(K,t),n(M,t),n(L,t),n(N,t),n(P,t)}(k),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t},i=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const s=o(k);t.z=s,i(k,t),t.default=s}(S);var F={},q={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DisallowedDomainError=e.UnsupportedDomainError=e.ReservedHandleError=e.InvalidHandleError=e.isValidTld=e.isValidHandle=e.normalizeAndEnsureValidHandle=e.normalizeHandle=e.ensureValidHandleRegex=e.ensureValidHandle=e.DISALLOWED_TLDS=e.INVALID_HANDLE=void 0,e.INVALID_HANDLE="handle.invalid",e.DISALLOWED_TLDS=[".local",".arpa",".invalid",".localhost",".internal",".example",".alt",".onion"];e.ensureValidHandle=e=>{if(!/^[a-zA-Z0-9.-]*$/.test(e))throw new t("Disallowed characters in handle (ASCII letters, digits, dashes, periods only)");if(e.length>253)throw new t("Handle is too long (253 chars max)");const r=e.split(".");if(r.length<2)throw new t("Handle domain needs at least two parts");for(let e=0;e<r.length;e++){const n=r[e];if(n.length<1)throw new t("Handle parts can not be empty");if(n.length>63)throw new t("Handle part too long (max 63 chars)");if(n.endsWith("-")||n.startsWith("-"))throw new t("Handle parts can not start or end with hyphens");if(e+1===r.length&&!/^[a-zA-Z]/.test(n))throw new t("Handle final component (TLD) must start with ASCII letter")}};e.ensureValidHandleRegex=e=>{if(!/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/.test(e))throw new t("Handle didn't validate via regex");if(e.length>253)throw new t("Handle is too long (253 chars max)")};e.normalizeHandle=e=>e.toLowerCase();e.normalizeAndEnsureValidHandle=t=>{const r=(0,e.normalizeHandle)(t);return(0,e.ensureValidHandle)(r),r};e.isValidHandle=r=>{try{(0,e.ensureValidHandle)(r)}catch(e){if(e instanceof t)return!1;throw e}return!0};e.isValidTld=t=>!e.DISALLOWED_TLDS.some((e=>t.endsWith(e)));class t extends Error{}e.InvalidHandleError=t;class r extends Error{}e.ReservedHandleError=r;class n extends Error{}e.UnsupportedDomainError=n;class o extends Error{}e.DisallowedDomainError=o}(q);var $={};Object.defineProperty($,"__esModule",{value:!0}),$.InvalidDidError=$.ensureValidDidRegex=$.ensureValidDid=void 0;$.ensureValidDid=e=>{if(!/^[a-zA-Z0-9._:%-]*$/.test(e))throw new G("Disallowed characters in DID (ASCII letters, digits, and a couple other characters only)");const t=e.split(":");if(t.length<3)throw new G("DID requires prefix, method, and method-specific content");if("did"!==t[0])throw new G('DID requires "did:" prefix');if(!/^[a-z]+$/.test(t[1]))throw new G("DID method must be lower-case letters");if(e.endsWith(":")||e.endsWith("%"))throw new G('DID can not end with ":" or "%"');if(e.length>2048)throw new G("DID is too long (2048 chars max)")};$.ensureValidDidRegex=e=>{if(!/^did:[a-z]+:[a-zA-Z0-9._:%-]*[a-zA-Z0-9._-]$/.test(e))throw new G("DID didn't validate via regex");if(e.length>2048)throw new G("DID is too long (2048 chars max)")};let G=class extends Error{};$.InvalidDidError=G;var H={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidNsidError=e.ensureValidNsidRegex=e.ensureValidNsid=e.NSID=void 0;class t{static parse(e){return new t(e)}static create(e,r){const n=[...e.split(".").reverse(),r].join(".");return new t(n)}static isValid(e){try{return t.parse(e),!0}catch(e){return!1}}constructor(t){Object.defineProperty(this,"segments",{enumerable:!0,configurable:!0,writable:!0,value:[]}),(0,e.ensureValidNsid)(t),this.segments=t.split(".")}get authority(){return this.segments.slice(0,this.segments.length-1).reverse().join(".")}get name(){return this.segments.at(this.segments.length-1)}toString(){return this.segments.join(".")}}e.NSID=t;e.ensureValidNsid=e=>{const t=e;if(!/^[a-zA-Z0-9.-]*$/.test(t))throw new r("Disallowed characters in NSID (ASCII letters, digits, dashes, periods only)");if(t.length>317)throw new r("NSID is too long (317 chars max)");const n=t.split(".");if(n.length<3)throw new r("NSID needs at least three parts");for(let e=0;e<n.length;e++){const t=n[e];if(t.length<1)throw new r("NSID parts can not be empty");if(t.length>63)throw new r("NSID part too long (max 63 chars)");if(t.endsWith("-")||t.startsWith("-"))throw new r("NSID parts can not start or end with hyphen");if(/^[0-9]/.test(t)&&0===e)throw new r("NSID first part may not start with a digit");if(!/^[a-zA-Z]+$/.test(t)&&e+1===n.length)throw new r("NSID name part must be only letters")}};e.ensureValidNsidRegex=e=>{if(!/^[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(\.[a-zA-Z]([a-zA-Z]{0,61}[a-zA-Z])?)$/.test(e))throw new r("NSID didn't validate via regex");if(e.length>317)throw new r("NSID is too long (317 chars max)")};class r extends Error{}e.InvalidNsidError=r}(H);var X={},W={};Object.defineProperty(W,"__esModule",{value:!0}),W.ensureValidAtUriRegex=W.ensureValidAtUri=void 0;const Z=q,J=$,Q=H;W.ensureValidAtUri=e=>{const t=e.split("#");if(t.length>2)throw new Error('ATURI can have at most one "#", separating fragment out');const r=t[1]||null;if(e=t[0],!/^[a-zA-Z0-9._~:@!$&')(*+,;=%/-]*$/.test(e))throw new Error("Disallowed characters in ATURI (ASCII)");const n=e.split("/");if(n.length>=3&&("at:"!==n[0]||0!==n[1].length))throw new Error('ATURI must start with "at://"');if(n.length<3)throw new Error("ATURI requires at least method and authority sections");try{n[2].startsWith("did:")?(0,J.ensureValidDid)(n[2]):(0,Z.ensureValidHandle)(n[2])}catch{throw new Error("ATURI authority must be a valid handle or DID")}if(n.length>=4){if(0===n[3].length)throw new Error("ATURI can not have a slash after authority without a path segment");try{(0,Q.ensureValidNsid)(n[3])}catch{throw new Error("ATURI requires first path segment (if supplied) to be valid NSID")}}if(n.length>=5&&0===n[4].length)throw new Error("ATURI can not have a slash after collection, unless record key is provided");if(n.length>=6)throw new Error("ATURI path can have at most two parts, and no trailing slash");if(t.length>=2&&null==r)throw new Error("ATURI fragment must be non-empty and start with slash");if(null!=r){if(0===r.length||"/"!==r[0])throw new Error("ATURI fragment must be non-empty and start with slash");if(!/^\/[a-zA-Z0-9._~:@!$&')(*+,;=%[\]/-]*$/.test(r))throw new Error("Disallowed characters in ATURI fragment (ASCII)")}if(e.length>8192)throw new Error("ATURI is far too long")};W.ensureValidAtUriRegex=e=>{const t=e.match(/^at:\/\/(?<authority>[a-zA-Z0-9._:%-]+)(\/(?<collection>[a-zA-Z0-9-.]+)(\/(?<rkey>[a-zA-Z0-9._~:@!$&%')(*+,;=-]+))?)?(#(?<fragment>\/[a-zA-Z0-9._~:@!$&%')(*+,;=\-[\]/\\]*))?$/);if(!t||!t.groups)throw new Error("ATURI didn't validate via regex");const r=t.groups;try{(0,Z.ensureValidHandleRegex)(r.authority)}catch{try{(0,J.ensureValidDidRegex)(r.authority)}catch{throw new Error("ATURI authority must be a valid handle or DID")}}if(r.collection)try{(0,Q.ensureValidNsidRegex)(r.collection)}catch{throw new Error("ATURI collection path segment must be a valid NSID")}if(e.length>8192)throw new Error("ATURI is far too long")},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.AtUri=t.ATP_URI_REGEX=void 0,n(W,t),t.ATP_URI_REGEX=/^(at:\/\/)?((?:did:[a-z0-9:%-]+)|(?:[a-z0-9][a-z0-9.:-]*))(\/[^?#\s]*)?(\?[^#\s]+)?(#[^\s]+)?$/i;const o=/^(\/[^?#\s]*)?(\?[^#\s]+)?(#[^\s]+)?$/i;class i{constructor(e,t){let r;if(Object.defineProperty(this,"hash",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"host",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathname",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"searchParams",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t){if(r=s(t),!r)throw new Error(`Invalid at uri: ${t}`);const n=function(e){const t=o.exec(e);if(t)return{hash:t[3]||"",pathname:t[1]||"",searchParams:new URLSearchParams(t[2]||"")};return}(e);if(!n)throw new Error(`Invalid path: ${e}`);Object.assign(r,n)}else if(r=s(e),!r)throw new Error(`Invalid at uri: ${e}`);this.hash=r.hash,this.host=r.host,this.pathname=r.pathname,this.searchParams=r.searchParams}static make(e,t,r){let n=e;return t&&(n+="/"+t),r&&(n+="/"+r),new i(n)}get protocol(){return"at:"}get origin(){return`at://${this.host}`}get hostname(){return this.host}set hostname(e){this.host=e}get search(){return this.searchParams.toString()}set search(e){this.searchParams=new URLSearchParams(e)}get collection(){return this.pathname.split("/").filter(Boolean)[0]||""}set collection(e){const t=this.pathname.split("/").filter(Boolean);t[0]=e,this.pathname=t.join("/")}get rkey(){return this.pathname.split("/").filter(Boolean)[1]||""}set rkey(e){const t=this.pathname.split("/").filter(Boolean);t[0]||(t[0]="undefined"),t[1]=e,this.pathname=t.join("/")}get href(){return this.toString()}toString(){let e=this.pathname||"/";e.startsWith("/")||(e=`/${e}`);let t=this.searchParams.toString();t&&!t.startsWith("?")&&(t=`?${t}`);let r=this.hash;return r&&!r.startsWith("#")&&(r=`#${r}`),`at://${this.host}${e}${t}${r}`}}function s(e){const r=t.ATP_URI_REGEX.exec(e);if(r)return{hash:r[5]||"",host:r[2]||"",pathname:r[3]||"",searchParams:new URLSearchParams(r[4]||"")}}t.AtUri=i}(X);var Y={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidTidError=e.isValidTid=e.ensureValidTid=void 0;e.ensureValidTid=e=>{if(13!==e.length)throw new t("TID must be 13 characters");if(!/^[234567abcdefghij][234567abcdefghijklmnopqrstuvwxyz]{12}$/.test(e))throw new t("TID syntax not valid (regex)")};e.isValidTid=r=>{try{(0,e.ensureValidTid)(r)}catch(e){if(e instanceof t)return!1;throw e}return!0};class t extends Error{}e.InvalidTidError=t}(Y);var ee={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidRecordKeyError=e.isValidRecordKey=e.ensureValidRecordKey=void 0;e.ensureValidRecordKey=e=>{if(e.length>512||e.length<1)throw new t("record key must be 1 to 512 characters");if(!/^[a-zA-Z0-9_~.:-]{1,512}$/.test(e))throw new t("record key syntax not valid (regex)");if("."===e||".."===e)throw new t('record key can not be "." or ".."')};e.isValidRecordKey=r=>{try{(0,e.ensureValidRecordKey)(r)}catch(e){if(e instanceof t)return!1;throw e}return!0};class t extends Error{}e.InvalidRecordKeyError=t}(ee);var te={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidDatetimeError=e.normalizeDatetimeAlways=e.normalizeDatetime=e.isValidDatetime=e.ensureValidDatetime=void 0;e.ensureValidDatetime=e=>{const r=new Date(e);if(isNaN(r.getTime()))throw new t("datetime did not parse as ISO 8601");if(r.toISOString().startsWith("-"))throw new t("datetime normalized to a negative time");if(!/^[0-9]{4}-[01][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9](.[0-9]{1,20})?(Z|([+-][0-2][0-9]:[0-5][0-9]))$/.test(e))throw new t("datetime didn't validate via regex");if(e.length>64)throw new t("datetime is too long (64 chars max)");if(e.endsWith("-00:00"))throw new t('datetime can not use "-00:00" for UTC timezone');if(e.startsWith("000"))throw new t("datetime so close to year zero not allowed")};e.isValidDatetime=r=>{try{(0,e.ensureValidDatetime)(r)}catch(e){if(e instanceof t)return!1;throw e}return!0};e.normalizeDatetime=r=>{if((0,e.isValidDatetime)(r)){const t=new Date(r).toISOString();if((0,e.isValidDatetime)(t))return t}if(!/.*(([+-]\d\d:?\d\d)|[a-zA-Z])$/.test(r)){const t=new Date(r+"Z");if(!isNaN(t.getTime())){const r=t.toISOString();if((0,e.isValidDatetime)(r))return r}}const n=new Date(r);if(isNaN(n.getTime()))throw new t("datetime did not parse as any timestamp format");const o=n.toISOString();if((0,e.isValidDatetime)(o))return o;throw new t("datetime normalized to invalid timestamp string")};e.normalizeDatetimeAlways=r=>{try{return(0,e.normalizeDatetime)(r)}catch(e){if(e instanceof t)return new Date(0).toISOString();throw e}};class t extends Error{}e.InvalidDatetimeError=t}(te),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(q,t),n($,t),n(H,t),n(X,t),n(Y,t),n(ee,t),n(te,t)}(F);var re={};Object.defineProperty(re,"__esModule",{value:!0}),re.toLexUri=function(e,t){if(e.split("#").length>2)throw new Error("Uri can only have one hash segment");if(e.startsWith("lex:"))return e;if(e.startsWith("#")){if(!t)throw new Error(`Unable to resolve uri without anchor: ${e}`);return`${t}${e}`}return`lex:${e}`},re.toConcreteTypes=function(e,t){return"ref"===t.type?[e.getDefOrThrow(t.ref)]:"union"===t.type?t.refs.map((t=>e.getDefOrThrow(t))).flat():[t]},re.requiredPropertiesRefinement=function(e,t){if(void 0===e.required)return;if(!Array.isArray(e.required))return void t.addIssue({code:ne.z.ZodIssueCode.invalid_type,received:typeof e.required,expected:"array"});if(void 0===e.properties)return void(e.required.length>0&&t.addIssue({code:ne.z.ZodIssueCode.custom,message:"Required fields defined but no properties defined"}));for(const r of e.required)void 0===e.properties[r]&&t.addIssue({code:ne.z.ZodIssueCode.custom,message:`Required field "${r}" not defined`})};const ne=S;!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LexiconDefNotFoundError=e.InvalidLexiconError=e.ValidationError=e.discriminatedObject=e.lexiconDoc=e.lexUserType=e.lexRecord=e.lexXrpcSubscription=e.lexXrpcProcedure=e.lexXrpcQuery=e.lexXrpcError=e.lexXrpcSubscriptionMessage=e.lexXrpcBody=e.lexXrpcParameters=e.lexObject=e.lexToken=e.lexPrimitiveArray=e.lexArray=e.lexBlob=e.lexRefVariant=e.lexRefUnion=e.lexRef=e.lexIpldType=e.lexCidLink=e.lexBytes=e.lexPrimitive=e.lexUnknown=e.lexString=e.lexStringFormat=e.lexInteger=e.lexBoolean=void 0,e.isValidLexiconDoc=function(t){return e.lexiconDoc.safeParse(t).success},e.isObj=function(e){return null!==e&&"object"==typeof e},e.hasProp=function(e,t){return t in e},e.isDiscriminatedObject=function(t){return e.discriminatedObject.safeParse(t).success},e.parseLexiconDoc=function(t){return e.lexiconDoc.parse(t),t};const t=S,r=F,n=re;e.lexBoolean=t.z.object({type:t.z.literal("boolean"),description:t.z.string().optional(),default:t.z.boolean().optional(),const:t.z.boolean().optional()}).strict(),e.lexInteger=t.z.object({type:t.z.literal("integer"),description:t.z.string().optional(),default:t.z.number().int().optional(),minimum:t.z.number().int().optional(),maximum:t.z.number().int().optional(),enum:t.z.number().int().array().optional(),const:t.z.number().int().optional()}).strict(),e.lexStringFormat=t.z.enum(["datetime","uri","at-uri","did","handle","at-identifier","nsid","cid","language","tid","record-key"]),e.lexString=t.z.object({type:t.z.literal("string"),format:e.lexStringFormat.optional(),description:t.z.string().optional(),default:t.z.string().optional(),minLength:t.z.number().int().optional(),maxLength:t.z.number().int().optional(),minGraphemes:t.z.number().int().optional(),maxGraphemes:t.z.number().int().optional(),enum:t.z.string().array().optional(),const:t.z.string().optional(),knownValues:t.z.string().array().optional()}).strict(),e.lexUnknown=t.z.object({type:t.z.literal("unknown"),description:t.z.string().optional()}).strict(),e.lexPrimitive=t.z.discriminatedUnion("type",[e.lexBoolean,e.lexInteger,e.lexString,e.lexUnknown]),e.lexBytes=t.z.object({type:t.z.literal("bytes"),description:t.z.string().optional(),maxLength:t.z.number().optional(),minLength:t.z.number().optional()}).strict(),e.lexCidLink=t.z.object({type:t.z.literal("cid-link"),description:t.z.string().optional()}).strict(),e.lexIpldType=t.z.discriminatedUnion("type",[e.lexBytes,e.lexCidLink]),e.lexRef=t.z.object({type:t.z.literal("ref"),description:t.z.string().optional(),ref:t.z.string()}).strict(),e.lexRefUnion=t.z.object({type:t.z.literal("union"),description:t.z.string().optional(),refs:t.z.string().array(),closed:t.z.boolean().optional()}).strict(),e.lexRefVariant=t.z.discriminatedUnion("type",[e.lexRef,e.lexRefUnion]),e.lexBlob=t.z.object({type:t.z.literal("blob"),description:t.z.string().optional(),accept:t.z.string().array().optional(),maxSize:t.z.number().optional()}).strict(),e.lexArray=t.z.object({type:t.z.literal("array"),description:t.z.string().optional(),items:t.z.union([e.lexPrimitive,e.lexIpldType,e.lexBlob,e.lexRefVariant]),minLength:t.z.number().int().optional(),maxLength:t.z.number().int().optional()}).strict(),e.lexPrimitiveArray=e.lexArray.merge(t.z.object({items:e.lexPrimitive}).strict()),e.lexToken=t.z.object({type:t.z.literal("token"),description:t.z.string().optional()}).strict(),e.lexObject=t.z.object({type:t.z.literal("object"),description:t.z.string().optional(),required:t.z.string().array().optional(),nullable:t.z.string().array().optional(),properties:t.z.record(t.z.union([e.lexRefVariant,e.lexIpldType,e.lexArray,e.lexBlob,e.lexPrimitive]))}).strict().superRefine(n.requiredPropertiesRefinement),e.lexXrpcParameters=t.z.object({type:t.z.literal("params"),description:t.z.string().optional(),required:t.z.string().array().optional(),properties:t.z.record(t.z.union([e.lexPrimitive,e.lexPrimitiveArray]))}).strict().superRefine(n.requiredPropertiesRefinement),e.lexXrpcBody=t.z.object({description:t.z.string().optional(),encoding:t.z.string(),schema:t.z.union([e.lexRefVariant,e.lexObject]).optional()}).strict(),e.lexXrpcSubscriptionMessage=t.z.object({description:t.z.string().optional(),schema:t.z.union([e.lexRefVariant,e.lexObject]).optional()}).strict(),e.lexXrpcError=t.z.object({name:t.z.string(),description:t.z.string().optional()}).strict(),e.lexXrpcQuery=t.z.object({type:t.z.literal("query"),description:t.z.string().optional(),parameters:e.lexXrpcParameters.optional(),output:e.lexXrpcBody.optional(),errors:e.lexXrpcError.array().optional()}).strict(),e.lexXrpcProcedure=t.z.object({type:t.z.literal("procedure"),description:t.z.string().optional(),parameters:e.lexXrpcParameters.optional(),input:e.lexXrpcBody.optional(),output:e.lexXrpcBody.optional(),errors:e.lexXrpcError.array().optional()}).strict(),e.lexXrpcSubscription=t.z.object({type:t.z.literal("subscription"),description:t.z.string().optional(),parameters:e.lexXrpcParameters.optional(),message:e.lexXrpcSubscriptionMessage.optional(),errors:e.lexXrpcError.array().optional()}).strict(),e.lexRecord=t.z.object({type:t.z.literal("record"),description:t.z.string().optional(),key:t.z.string().optional(),record:e.lexObject}).strict(),e.lexUserType=t.z.custom((t=>{if(t&&"object"==typeof t&&void 0!==t.type)switch(t.type){case"record":return e.lexRecord.parse(t);case"query":return e.lexXrpcQuery.parse(t);case"procedure":return e.lexXrpcProcedure.parse(t);case"subscription":return e.lexXrpcSubscription.parse(t);case"blob":return e.lexBlob.parse(t);case"array":return e.lexArray.parse(t);case"token":return e.lexToken.parse(t);case"object":return e.lexObject.parse(t);case"boolean":return e.lexBoolean.parse(t);case"integer":return e.lexInteger.parse(t);case"string":return e.lexString.parse(t);case"bytes":return e.lexBytes.parse(t);case"cid-link":return e.lexCidLink.parse(t);case"unknown":return e.lexUnknown.parse(t)}}),(e=>e&&"object"==typeof e?void 0===e.type?{message:"Must have a type",fatal:!0}:{message:`Invalid type: ${e.type} must be one of: record, query, procedure, subscription, blob, array, token, object, boolean, integer, string, bytes, cid-link, unknown`,fatal:!0}:{message:"Must be an object",fatal:!0})),e.lexiconDoc=t.z.object({lexicon:t.z.literal(1),id:t.z.string().refine((e=>r.NSID.isValid(e)),{message:"Must be a valid NSID"}),revision:t.z.number().optional(),description:t.z.string().optional(),defs:t.z.record(e.lexUserType)}).strict().superRefine(((e,r)=>{for(const n in e.defs){const o=e.defs[n];"main"===n||"record"!==o.type&&"procedure"!==o.type&&"query"!==o.type&&"subscription"!==o.type||r.addIssue({code:t.z.ZodIssueCode.custom,message:"Records, procedures, queries, and subscriptions must be the main definition."})}})),e.discriminatedObject=t.z.object({$type:t.z.string()});class o extends Error{}e.ValidationError=o;class i extends Error{}e.InvalidLexiconError=i;class s extends Error{}e.LexiconDefNotFoundError=s}(_);var oe={},ie={},se={},ae={},ce={},le={},de={};Object.defineProperty(de,"__esModule",{value:!0}),de.isObject=de.assure=de.create=de.is=void 0;de.is=(e,t)=>t.safeParse(e).success;de.create=e=>t=>e.safeParse(t).success;de.assure=(e,t)=>e.parse(t);de.isObject=e=>"object"==typeof e&&null!==e;var ue={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseIntWithFallback=e.dedupeStrs=e.range=e.chunkArray=e.errHasMsg=e.isErrnoException=e.asyncFilter=e.s32decode=e.s32encode=e.streamToBuffer=e.flattenUint8Arrays=e.bailableWait=e.wait=e.jitter=e.noUndefinedVals=void 0,e.omit=function(e,t){if(!e)return e;const r={},n=Object.keys(e);for(let o=0;o<n.length;o++){const i=n[o];t.includes(i)||(r[i]=e[i])}return r};e.noUndefinedVals=e=>(Object.keys(e).forEach((t=>{void 0===e[t]&&delete e[t]})),e);e.jitter=e=>Math.round((Math.random()-.5)*e*2);e.wait=e=>new Promise((t=>setTimeout(t,e)));e.bailableWait=e=>{let t;const r=new Promise((r=>{const n=setTimeout(r,e);t=()=>{clearTimeout(n),r()}}));return{bail:t,wait:()=>r}};e.flattenUint8Arrays=e=>{const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r};e.streamToBuffer=async t=>{const r=[];for await(const e of t)r.push(e);return(0,e.flattenUint8Arrays)(r)};const t="234567abcdefghijklmnopqrstuvwxyz";e.s32encode=e=>{let r="";for(;e;){const n=e%32;e=Math.floor(e/32),r=t.charAt(n)+r}return r};e.s32decode=e=>{let r=0;for(const n of e)r=32*r+t.indexOf(n);return r};e.asyncFilter=async(e,t)=>{const r=await Promise.all(e.map((e=>t(e))));return e.filter(((e,t)=>r[t]))};e.isErrnoException=e=>!!e&&e.code;e.errHasMsg=(e,t)=>!!e&&"object"==typeof e&&e.message===t;e.chunkArray=(e,t)=>e.reduce(((e,r,n)=>{const o=Math.floor(n/t);return e[o]||(e[o]=[]),e[o].push(r),e}),[]);e.range=e=>{const t=[];for(let r=0;r<e;r++)t.push(r);return t};e.dedupeStrs=e=>[...new Set(e)];e.parseIntWithFallback=(e,t)=>{const r=parseInt(e||"",10);return isNaN(r)?t:r}}(ue);var pe={};Object.defineProperty(pe,"__esModule",{value:!0}),pe.mapDefined=pe.keyBy=void 0;pe.keyBy=(e,t)=>e.reduce(((e,r)=>(e[r[t]]=r,e)),{});pe.mapDefined=(e,t)=>{const r=[];for(const n of e){const e=t(n);void 0!==e&&r.push(e)}return r};var fe={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleAllSettledErrors=e.AsyncBufferFullError=e.AsyncBuffer=e.allComplete=e.createDeferrables=e.createDeferrable=e.readFromGenerator=void 0;const t=ue;e.readFromGenerator=async(e,r,n=Promise.resolve(),o=Number.MAX_SAFE_INTEGER)=>{const i=[];let s,a=!1;const c=async()=>{if(await r(i.at(-1)))return!0;const e=(0,t.bailableWait)(20);return await e.wait(),s=e.bail,!a&&await c()},l=new Promise((e=>{n.then((()=>{c().then((()=>e()))}))}));try{for(;i.length<o;){const t=await Promise.race([e.next(),l]);if(!t)break;const r=t;if(r.done)break;i.push(r.value)}}finally{a=!0,s&&s()}return i};e.createDeferrable=()=>{let e;const t=new Promise((t=>{e=()=>t()}));return{resolve:e,complete:t}};e.createDeferrables=t=>{const r=[];for(let n=0;n<t;n++)r.push((0,e.createDeferrable)());return r};e.allComplete=async e=>{await Promise.all(e.map((e=>e.complete)))};e.AsyncBuffer=class{constructor(e){Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"buffer",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"closed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"toThrow",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.promise=Promise.resolve(),this.resolve=()=>null,this.resetPromise()}get curr(){return this.buffer}get size(){return this.buffer.length}get isClosed(){return this.closed}resetPromise(){this.promise=new Promise((e=>this.resolve=e))}push(e){this.buffer.push(e),this.resolve()}pushMany(e){e.forEach((e=>this.buffer.push(e))),this.resolve()}async*events(){for(;;){if(this.closed&&0===this.buffer.length){if(this.toThrow)throw this.toThrow;return}if(await this.promise,this.toThrow)throw this.toThrow;if(this.maxSize&&this.size>this.maxSize)throw new r(this.maxSize);const[e,...t]=this.buffer;e?(this.buffer=t,yield e):this.resetPromise()}}throw(e){this.toThrow=e,this.closed=!0,this.resolve()}close(){this.closed=!0,this.resolve()}};class r extends Error{constructor(e){super(`ReachedMaxBufferSize: ${e}`)}}e.AsyncBufferFullError=r;e.handleAllSettledErrors=e=>{const t=e.filter(n).map((e=>e.reason));if(0!==t.length){if(1===t.length)throw t[0];throw new AggregateError(t,"Multiple errors: "+t.map((e=>e?.message)).join("\n"))}};const n=e=>"rejected"===e.status}(fe);var he={};Object.defineProperty(he,"__esModule",{value:!0}),he.TID=void 0;const ye=ue;let me=0,be=0,ge=null;function ve(e){return e.replaceAll("-","")}class Ee{constructor(e){Object.defineProperty(this,"str",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const t=ve(e);if(13!==t.length)throw new Error(`Poorly formatted TID: ${t.length} length`);this.str=t}static next(e){const t=Math.max(Date.now(),me);t===me&&be++,me=t;const r=1e3*t+be;null===ge&&(ge=Math.floor(32*Math.random()));const n=Ee.fromTime(r,ge);return!e||n.newerThan(e)?n:Ee.fromTime(e.timestamp()+1,ge)}static nextStr(e){return Ee.next(e?new Ee(e):void 0).toString()}static fromTime(e,t){const r=`${(0,ye.s32encode)(e)}${(0,ye.s32encode)(t).padStart(2,"2")}`;return new Ee(r)}static fromStr(e){return new Ee(e)}static oldestFirst(e,t){return e.compareTo(t)}static newestFirst(e,t){return t.compareTo(e)}static is(e){return 13===ve(e).length}timestamp(){return(0,ye.s32decode)(this.str.slice(0,11))}clockid(){return(0,ye.s32decode)(this.str.slice(11,13))}formatted(){const e=this.toString();return`${e.slice(0,4)}-${e.slice(4,7)}-${e.slice(7,11)}-${e.slice(11,13)}`}toString(){return this.str}compareTo(e){return this.str>e.str?1:this.str<e.str?-1:0}equals(e){return this.str===e.str}newerThan(e){return this.compareTo(e)>0}olderThan(e){return this.compareTo(e)<0}}he.TID=Ee,he.default=Ee;var we={},Re=function e(t,r,n){r=r||[];var o=n=n||0;for(;t>=Se;)r[n++]=255&t|Ae,t/=128;for(;t&_e;)r[n++]=255&t|Ae,t>>>=7;return r[n]=0|t,e.bytes=n-o+1,r},Ae=128,_e=-128,Se=Math.pow(2,31);var ke=function e(t,r){var n,o=0,i=0,s=r=r||0,a=t.length;do{if(s>=a)throw e.bytes=0,new RangeError("Could not decode varint");n=t[s++],o+=i<28?(n&Ce)<<i:(n&Ce)*Math.pow(2,i),i+=7}while(n>=Te);return e.bytes=s-r,o},Te=128,Ce=127;var Le=Math.pow(2,7),Pe=Math.pow(2,14),xe=Math.pow(2,21),Be=Math.pow(2,28),je=Math.pow(2,35),De=Math.pow(2,42),Oe=Math.pow(2,49),Ue=Math.pow(2,56),Ie=Math.pow(2,63),Ke={encode:Re,decode:ke,encodingLength:function(e){return e<Le?1:e<Pe?2:e<xe?3:e<Be?4:e<je?5:e<De?6:e<Oe?7:e<Ue?8:e<Ie?9:10}},Me=Ke;const Ve=(e,t=0)=>[Me.decode(e,t),Me.decode.bytes],Ne=(e,t,r=0)=>(Me.encode(e,t,r),t),ze=e=>Me.encodingLength(e),Fe=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class qe{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}var $e=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),s=i.charCodeAt(0);if(255!==r[s])throw new TypeError(i+" is ambiguous");r[s]=o}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function u(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,o=0;e[t]===c;)n++,t++;for(var i=(e.length-t)*l+1>>>0,s=new Uint8Array(i);e[t];){var d=r[e.charCodeAt(t)];if(255===d)return;for(var u=0,p=i-1;(0!==d||u<o)&&-1!==p;p--,u++)d+=a*s[p]>>>0,s[p]=d%256>>>0,d=d/256>>>0;if(0!==d)throw new Error("Non-zero carry");o=u,t++}if(" "!==e[t]){for(var f=i-o;f!==i&&0===s[f];)f++;for(var h=new Uint8Array(n+(i-f)),y=n;f!==i;)h[y++]=s[f++];return h}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,o=0,i=t.length;o!==i&&0===t[o];)o++,r++;for(var s=(i-o)*d+1>>>0,l=new Uint8Array(s);o!==i;){for(var u=t[o],p=0,f=s-1;(0!==u||p<n)&&-1!==f;f--,p++)u+=256*l[f]>>>0,l[f]=u%a>>>0,u=u/a>>>0;if(0!==u)throw new Error("Non-zero carry");n=p,o++}for(var h=s-n;h!==s&&0===l[h];)h++;for(var y=c.repeat(r);h<s;++h)y+=e.charAt(l[h]);return y},decodeUnsafe:u,decode:function(e){var r=u(e);if(r)return r;throw new Error(`Non-${t} character`)}}},Ge=$e;class He{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class Xe{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return Ze(this,e)}}class We{constructor(e){this.decoders=e}or(e){return Ze(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Ze=(e,t)=>new We({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Je{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new He(e,t,r),this.decoder=new Xe(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Qe=({name:e,prefix:t,encode:r,decode:n})=>new Je(e,t,r,n),Ye=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=Ge(r,t);return Qe({prefix:e,name:t,encode:n,decode:e=>Fe(o(e))})},et=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Qe({prefix:t,name:e,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],o=(1<<r)-1;let i="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,i+=t[o&a>>s];if(s&&(i+=t[o&a<<r-s]),n)for(;i.length*r&7;)i+="=";return i})(e,n,r),decode:t=>((e,t,r,n)=>{const o={};for(let e=0;e<t.length;++e)o[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;const s=new Uint8Array(i*r/8|0);let a=0,c=0,l=0;for(let t=0;t<i;++t){const i=o[e[t]];if(void 0===i)throw new SyntaxError(`Non-${n} character`);c=c<<r|i,a+=r,a>=8&&(a-=8,s[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s})(t,n,r,e)}),tt=Ye({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),rt=Ye({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var nt=Object.freeze({__proto__:null,base58btc:tt,base58flickr:rt});const ot=et({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),it=et({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),st=et({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),at=et({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ct=et({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),lt=et({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),dt=et({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ut=et({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),pt=et({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ft=Object.freeze({__proto__:null,base32:ot,base32hex:ct,base32hexpad:dt,base32hexpadupper:ut,base32hexupper:lt,base32pad:st,base32padupper:at,base32upper:it,base32z:pt});class ht{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:At,byteLength:At,code:Rt,version:Rt,multihash:Rt,bytes:Rt,_baseCache:At,asCID:At})}toV0(){if(0===this.version)return this;{const{code:e,multihash:t}=this;if(e!==gt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==vt)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return ht.createV0(t)}}toV1(){switch(this.version){case 0:{const{code:e,digest:t}=this.multihash,r=((e,t)=>{const r=t.byteLength,n=ze(e),o=n+ze(r),i=new Uint8Array(o+r);return Ne(e,i,0),Ne(r,i,n),i.set(t,o),new qe(e,r,t,i)})(e,t);return ht.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&(t=this.multihash,r=e.multihash,t===r||t.code===r.code&&t.size===r.size&&((e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0})(t.bytes,r.bytes));var t,r}toString(e){const{bytes:t,version:r,_baseCache:n}=this;return 0===r?mt(t,n,e||tt.encoder):bt(t,n,e||ot.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return _t(/^0\.0/,St),!(!e||!e[wt]&&e.asCID!==e)}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof ht)return e;if(null!=e&&e.asCID===e){const{version:t,code:r,multihash:n,bytes:o}=e;return new ht(t,r,n,o||Et(t,r,n.bytes))}if(null!=e&&!0===e[wt]){const{version:t,multihash:r,code:n}=e,o=(e=>{const t=Fe(e),[r,n]=Ve(t),[o,i]=Ve(t.subarray(n)),s=t.subarray(n+i);if(s.byteLength!==o)throw new Error("Incorrect length");return new qe(r,o,s,t)})(r);return ht.create(t,n,o)}return null}static create(e,t,r){if("number"!=typeof t)throw new Error("String codecs are no longer supported");switch(e){case 0:if(t!==gt)throw new Error(`Version 0 CID must use dag-pb (code: ${gt}) block encoding`);return new ht(e,t,r,r.bytes);case 1:{const n=Et(e,t,r.bytes);return new ht(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return ht.create(0,gt,e)}static createV1(e,t){return ht.create(1,e,t)}static decode(e){const[t,r]=ht.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){const t=ht.inspectBytes(e),r=t.size-t.multihashSize,n=Fe(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");const o=n.subarray(t.multihashSize-t.digestSize),i=new qe(t.multihashCode,t.digestSize,o,n);return[0===t.version?ht.createV0(i):ht.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0;const r=()=>{const[r,n]=Ve(e.subarray(t));return t+=n,r};let n=r(),o=gt;if(18===n?(n=0,t=0):1===n&&(o=r()),0!==n&&1!==n)throw new RangeError(`Invalid CID version ${n}`);const i=t,s=r(),a=r(),c=t+a;return{version:n,codec:o,multihashCode:s,digestSize:a,multihashSize:c-i,size:c}}static parse(e,t){const[r,n]=yt(e,t),o=ht.decode(n);return o._baseCache.set(r,e),o}}const yt=(e,t)=>{switch(e[0]){case"Q":{const r=t||tt;return[tt.prefix,r.decode(`${tt.prefix}${e}`)]}case tt.prefix:{const r=t||tt;return[tt.prefix,r.decode(e)]}case ot.prefix:{const r=t||ot;return[ot.prefix,r.decode(e)]}default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},mt=(e,t,r)=>{const{prefix:n}=r;if(n!==tt.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);const o=t.get(n);if(null==o){const o=r.encode(e).slice(1);return t.set(n,o),o}return o},bt=(e,t,r)=>{const{prefix:n}=r,o=t.get(n);if(null==o){const o=r.encode(e);return t.set(n,o),o}return o},gt=112,vt=18,Et=(e,t,r)=>{const n=ze(e),o=n+ze(t),i=new Uint8Array(o+r.byteLength);return Ne(e,i,0),Ne(t,i,n),i.set(r,o),i},wt=Symbol.for("@ipld/js-cid/CID"),Rt={writable:!1,configurable:!1,enumerable:!0},At={writable:!1,enumerable:!1,configurable:!1},_t=(e,t)=>{if(!e.test("0.0.0-dev"))throw new Error(t);console.warn(t)},St="CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n";var kt=r(Object.freeze({__proto__:null,CID:ht}));const Tt=Qe({prefix:"\0",name:"identity",encode:e=>{return t=e,(new TextDecoder).decode(t);var t},decode:e=>(e=>(new TextEncoder).encode(e))(e)});var Ct=Object.freeze({__proto__:null,identity:Tt});const Lt=et({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Pt=Object.freeze({__proto__:null,base2:Lt});const xt=et({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Bt=Object.freeze({__proto__:null,base8:xt});const jt=Ye({prefix:"9",name:"base10",alphabet:"0123456789"});var Dt=Object.freeze({__proto__:null,base10:jt});const Ot=et({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ut=et({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var It=Object.freeze({__proto__:null,base16:Ot,base16upper:Ut});const Kt=Ye({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Mt=Ye({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Vt=Object.freeze({__proto__:null,base36:Kt,base36upper:Mt});const Nt=et({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),zt=et({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ft=et({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),qt=et({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var $t=Object.freeze({__proto__:null,base64:Nt,base64pad:zt,base64url:Ft,base64urlpad:qt});const Gt=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Ht=Gt.reduce(((e,t,r)=>(e[r]=t,e)),[]),Xt=Gt.reduce(((e,t,r)=>(e[t.codePointAt(0)]=r,e)),[]);const Wt=Qe({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce(((e,t)=>e+=Ht[t]),"")},decode:function(e){const t=[];for(const r of e){const e=Xt[r.codePointAt(0)];if(void 0===e)throw new Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var Zt=Object.freeze({__proto__:null,base256emoji:Wt});new TextEncoder,new TextDecoder;const Jt={...Ct,...Pt,...Bt,...Dt,...It,...ft,...Vt,...nt,...$t,...Zt};function Qt(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Yt=Qt("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),er=Qt("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),tr={utf8:Yt,"utf-8":Yt,hex:Jt.base16,latin1:er,ascii:er,binary:er,...Jt};var rr=Object.freeze({__proto__:null,compare:function(e,t){for(let r=0;r<e.byteLength;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return e.byteLength>t.byteLength?1:e.byteLength<t.byteLength?-1:0},concat:function(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r},equals:function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},fromString:function(e,t="utf8"){const r=tr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return r.decoder.decode(`${r.prefix}${e}`)},toString:function(e,t="utf8"){const r=tr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return r.encoder.encode(e).substring(1)},xor:function(e,t){if(e.length!==t.length)throw new Error("Inputs should have the same length");const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}}),nr=r(rr);!function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ipldEquals=t.ipldToJson=t.jsonToIpld=void 0;const i=kt,s=o(nr);t.jsonToIpld=e=>{if(Array.isArray(e))return e.map((e=>(0,t.jsonToIpld)(e)));if(e&&"object"==typeof e){if("string"==typeof e.$link&&1===Object.keys(e).length)return i.CID.parse(e.$link);if("string"==typeof e.$bytes&&1===Object.keys(e).length)return s.fromString(e.$bytes,"base64");const r={};for(const n of Object.keys(e))r[n]=(0,t.jsonToIpld)(e[n]);return r}return e};t.ipldToJson=e=>{if(Array.isArray(e))return e.map((e=>(0,t.ipldToJson)(e)));if(e&&"object"==typeof e){if(e instanceof Uint8Array)return{$bytes:s.toString(e,"base64")};if(i.CID.asCID(e))return{$link:e.toString()};const r={};for(const n of Object.keys(e))r[n]=(0,t.ipldToJson)(e[n]);return r}return e};t.ipldEquals=(e,r)=>{if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(!(0,t.ipldEquals)(e[n],r[n]))return!1;return!0}if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e instanceof Uint8Array&&r instanceof Uint8Array)return s.equals(e,r);if(i.CID.asCID(e)&&i.CID.asCID(r))return i.CID.asCID(e)?.equals(i.CID.asCID(r));if(Object.keys(e).length!==Object.keys(r).length)return!1;for(const n of Object.keys(e))if(!(0,t.ipldEquals)(e[n],r[n]))return!1;return!0}return e===r}}(we);var or={};Object.defineProperty(or,"__esModule",{value:!0}),or.retry=async function(e,t={}){const{maxRetries:r=3,retryable:n=(()=>!0),getWaitMs:o=sr}=t;let i,s=0;for(;!i;)try{return await e()}catch(e){const t=o(s);s<r&&null!==t&&n(e)?(s+=1,0!==t&&await(0,ir.wait)(t)):i=e}throw i},or.backoffMs=sr;const ir=ue;function sr(e,t=100,r=1e3){const n=Math.pow(2,e)*t;return function(e){const t=.15*e;return e+function(e,t){const r=Math.random()*(t-e);return r+e}(-t,t)}(Math.min(n,r))}var ar={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.def=e.schema=void 0;const t=kt,r=S,n=r.z.any().refine((e=>null!==t.CID.asCID(e)),{message:"Not a CID"}).transform((e=>t.CID.asCID(e)));e.schema={cid:n,bytes:r.z.instanceof(Uint8Array),string:r.z.string(),array:r.z.array(r.z.unknown()),map:r.z.record(r.z.string(),r.z.unknown()),unknown:r.z.unknown()},e.def={cid:{name:"cid",schema:e.schema.cid},bytes:{name:"bytes",schema:e.schema.bytes},string:{name:"string",schema:e.schema.string},map:{name:"map",schema:e.schema.map},unknown:{name:"unknown",schema:e.schema.unknown}}}(ar);var cr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.addHoursToDate=e.lessThanAgoMs=e.DAY=e.HOUR=e.MINUTE=e.SECOND=void 0,e.SECOND=1e3,e.MINUTE=60*e.SECOND,e.HOUR=60*e.MINUTE,e.DAY=24*e.HOUR;e.lessThanAgoMs=(e,t)=>Date.now()<e.getTime()+t;e.addHoursToDate=(e,t)=>{const r=t?new Date(t):new Date;return r.setHours(r.getHours()+e),r}}(cr);var lr={},dr={},ur={},pr={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.EXTENDED_PICTOGRAPHIC=e.CLUSTER_BREAK=void 0,(t=e.CLUSTER_BREAK||(e.CLUSTER_BREAK={}))[t.CR=0]="CR",t[t.LF=1]="LF",t[t.CONTROL=2]="CONTROL",t[t.EXTEND=3]="EXTEND",t[t.REGIONAL_INDICATOR=4]="REGIONAL_INDICATOR",t[t.SPACINGMARK=5]="SPACINGMARK",t[t.L=6]="L",t[t.V=7]="V",t[t.T=8]="T",t[t.LV=9]="LV",t[t.LVT=10]="LVT",t[t.OTHER=11]="OTHER",t[t.PREPEND=12]="PREPEND",t[t.E_BASE=13]="E_BASE",t[t.E_MODIFIER=14]="E_MODIFIER",t[t.ZWJ=15]="ZWJ",t[t.GLUE_AFTER_ZWJ=16]="GLUE_AFTER_ZWJ",t[t.E_BASE_GAZ=17]="E_BASE_GAZ",e.EXTENDED_PICTOGRAPHIC=101}(pr);var fr={};Object.defineProperty(fr,"__esModule",{value:!0});const hr=pr;fr.default=class{static isSurrogate(e,t){return 55296<=e.charCodeAt(t)&&e.charCodeAt(t)<=56319&&56320<=e.charCodeAt(t+1)&&e.charCodeAt(t+1)<=57343}static codePointAt(e,t){void 0===t&&(t=0);const r=e.charCodeAt(t);if(55296<=r&&r<=56319&&t<e.length-1){const n=r,o=e.charCodeAt(t+1);return 56320<=o&&o<=57343?1024*(n-55296)+(o-56320)+65536:n}if(56320<=r&&r<=57343&&t>=1){const n=e.charCodeAt(t-1);return 55296<=n&&n<=56319?1024*(n-55296)+(r-56320)+65536:r}return r}static shouldBreak(e,t,r,n,o,i){const s=[e].concat(t).concat([r]),a=[n].concat(o).concat([i]),c=s[s.length-2],l=r,d=i,u=s.lastIndexOf(hr.CLUSTER_BREAK.REGIONAL_INDICATOR);if(u>0&&s.slice(1,u).every((function(e){return e===hr.CLUSTER_BREAK.REGIONAL_INDICATOR}))&&-1===[hr.CLUSTER_BREAK.PREPEND,hr.CLUSTER_BREAK.REGIONAL_INDICATOR].indexOf(c))return s.filter((function(e){return e===hr.CLUSTER_BREAK.REGIONAL_INDICATOR})).length%2==1?3:4;if(c===hr.CLUSTER_BREAK.CR&&l===hr.CLUSTER_BREAK.LF)return 0;if(c===hr.CLUSTER_BREAK.CONTROL||c===hr.CLUSTER_BREAK.CR||c===hr.CLUSTER_BREAK.LF)return 1;if(l===hr.CLUSTER_BREAK.CONTROL||l===hr.CLUSTER_BREAK.CR||l===hr.CLUSTER_BREAK.LF)return 1;if(c===hr.CLUSTER_BREAK.L&&(l===hr.CLUSTER_BREAK.L||l===hr.CLUSTER_BREAK.V||l===hr.CLUSTER_BREAK.LV||l===hr.CLUSTER_BREAK.LVT))return 0;if(!(c!==hr.CLUSTER_BREAK.LV&&c!==hr.CLUSTER_BREAK.V||l!==hr.CLUSTER_BREAK.V&&l!==hr.CLUSTER_BREAK.T))return 0;if((c===hr.CLUSTER_BREAK.LVT||c===hr.CLUSTER_BREAK.T)&&l===hr.CLUSTER_BREAK.T)return 0;if(l===hr.CLUSTER_BREAK.EXTEND||l===hr.CLUSTER_BREAK.ZWJ)return 0;if(l===hr.CLUSTER_BREAK.SPACINGMARK)return 0;if(c===hr.CLUSTER_BREAK.PREPEND)return 0;const p=a.slice(0,-1).lastIndexOf(hr.EXTENDED_PICTOGRAPHIC);return-1!==p&&a[p]===hr.EXTENDED_PICTOGRAPHIC&&s.slice(p+1,-2).every((function(e){return e===hr.CLUSTER_BREAK.EXTEND}))&&c===hr.CLUSTER_BREAK.ZWJ&&d===hr.EXTENDED_PICTOGRAPHIC?0:-1!==t.indexOf(hr.CLUSTER_BREAK.REGIONAL_INDICATOR)?2:c===hr.CLUSTER_BREAK.REGIONAL_INDICATOR&&l===hr.CLUSTER_BREAK.REGIONAL_INDICATOR?0:1}};var yr={};Object.defineProperty(yr,"__esModule",{value:!0});class mr{constructor(e,t){this._index=0,this._str=e,this._nextBreak=t}[Symbol.iterator](){return this}next(){let e;if((e=this._nextBreak(this._str,this._index))<this._str.length){const t=this._str.slice(this._index,e);return this._index=e,{value:t,done:!1}}if(this._index<this._str.length){const e=this._str.slice(this._index);return this._index=this._str.length,{value:e,done:!1}}return{value:void 0,done:!0}}}yr.default=mr;var br=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ur,"__esModule",{value:!0});const gr=pr,vr=br(fr),Er=br(yr);class wr{static nextBreak(e,t){if(void 0===t&&(t=0),t<0)return 0;if(t>=e.length-1)return e.length;const r=vr.default.codePointAt(e,t),n=wr.getGraphemeBreakProperty(r),o=wr.getEmojiProperty(r),i=[],s=[];for(let r=t+1;r<e.length;r++){if(vr.default.isSurrogate(e,r-1))continue;const t=vr.default.codePointAt(e,r),a=wr.getGraphemeBreakProperty(t),c=wr.getEmojiProperty(t);if(vr.default.shouldBreak(n,i,a,o,s,c))return r;i.push(a),s.push(c)}return e.length}splitGraphemes(e){const t=[];let r,n=0;for(;(r=wr.nextBreak(e,n))<e.length;)t.push(e.slice(n,r)),n=r;return n<e.length&&t.push(e.slice(n)),t}iterateGraphemes(e){return new Er.default(e,wr.nextBreak)}countGraphemes(e){let t,r=0,n=0;for(;(t=wr.nextBreak(e,n))<e.length;)n=t,r++;return n<e.length&&r++,r}static getGraphemeBreakProperty(e){if(e<48905){if(e<44116){if(e<4141){if(e<2818){if(e<2363)if(e<1759){if(e<1471){if(e<127){if(e<11){if(e<10){if(0<=e&&e<=9)return gr.CLUSTER_BREAK.CONTROL}else if(10===e)return gr.CLUSTER_BREAK.LF}else if(e<13){if(11<=e&&e<=12)return gr.CLUSTER_BREAK.CONTROL}else if(e<14){if(13===e)return gr.CLUSTER_BREAK.CR}else if(14<=e&&e<=31)return gr.CLUSTER_BREAK.CONTROL}else if(e<768){if(e<173){if(127<=e&&e<=159)return gr.CLUSTER_BREAK.CONTROL}else if(173===e)return gr.CLUSTER_BREAK.CONTROL}else if(e<1155){if(768<=e&&e<=879)return gr.CLUSTER_BREAK.EXTEND}else if(e<1425){if(1155<=e&&e<=1161)return gr.CLUSTER_BREAK.EXTEND}else if(1425<=e&&e<=1469)return gr.CLUSTER_BREAK.EXTEND}else if(e<1552){if(e<1476){if(e<1473){if(1471===e)return gr.CLUSTER_BREAK.EXTEND}else if(1473<=e&&e<=1474)return gr.CLUSTER_BREAK.EXTEND}else if(e<1479){if(1476<=e&&e<=1477)return gr.CLUSTER_BREAK.EXTEND}else if(e<1536){if(1479===e)return gr.CLUSTER_BREAK.EXTEND}else if(1536<=e&&e<=1541)return gr.CLUSTER_BREAK.PREPEND}else if(e<1648){if(e<1564){if(1552<=e&&e<=1562)return gr.CLUSTER_BREAK.EXTEND}else if(e<1611){if(1564===e)return gr.CLUSTER_BREAK.CONTROL}else if(1611<=e&&e<=1631)return gr.CLUSTER_BREAK.EXTEND}else if(e<1750){if(1648===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<1757){if(1750<=e&&e<=1756)return gr.CLUSTER_BREAK.EXTEND}else if(1757===e)return gr.CLUSTER_BREAK.PREPEND}else if(e<2075){if(e<1840)if(e<1770){if(e<1767){if(1759<=e&&e<=1764)return gr.CLUSTER_BREAK.EXTEND}else if(1767<=e&&e<=1768)return gr.CLUSTER_BREAK.EXTEND}else if(e<1807){if(1770<=e&&e<=1773)return gr.CLUSTER_BREAK.EXTEND}else{if(1807===e)return gr.CLUSTER_BREAK.PREPEND;if(1809===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2027){if(e<1958){if(1840<=e&&e<=1866)return gr.CLUSTER_BREAK.EXTEND}else if(1958<=e&&e<=1968)return gr.CLUSTER_BREAK.EXTEND}else if(e<2045){if(2027<=e&&e<=2035)return gr.CLUSTER_BREAK.EXTEND}else if(e<2070){if(2045===e)return gr.CLUSTER_BREAK.EXTEND}else if(2070<=e&&e<=2073)return gr.CLUSTER_BREAK.EXTEND}else if(e<2200){if(e<2089){if(e<2085){if(2075<=e&&e<=2083)return gr.CLUSTER_BREAK.EXTEND}else if(2085<=e&&e<=2087)return gr.CLUSTER_BREAK.EXTEND}else if(e<2137){if(2089<=e&&e<=2093)return gr.CLUSTER_BREAK.EXTEND}else if(e<2192){if(2137<=e&&e<=2139)return gr.CLUSTER_BREAK.EXTEND}else if(2192<=e&&e<=2193)return gr.CLUSTER_BREAK.PREPEND}else if(e<2275){if(e<2250){if(2200<=e&&e<=2207)return gr.CLUSTER_BREAK.EXTEND}else if(e<2274){if(2250<=e&&e<=2273)return gr.CLUSTER_BREAK.EXTEND}else if(2274===e)return gr.CLUSTER_BREAK.PREPEND}else if(e<2307){if(2275<=e&&e<=2306)return gr.CLUSTER_BREAK.EXTEND}else{if(2307===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(2362===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2561){if(e<2434){if(e<2381){if(e<2366){if(2363===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(2364===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2369){if(2366<=e&&e<=2368)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<2377){if(2369<=e&&e<=2376)return gr.CLUSTER_BREAK.EXTEND}else if(2377<=e&&e<=2380)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<2385){if(e<2382){if(2381===e)return gr.CLUSTER_BREAK.EXTEND}else if(2382<=e&&e<=2383)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<2402){if(2385<=e&&e<=2391)return gr.CLUSTER_BREAK.EXTEND}else if(e<2433){if(2402<=e&&e<=2403)return gr.CLUSTER_BREAK.EXTEND}else if(2433===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2503){if(e<2494){if(e<2492){if(2434<=e&&e<=2435)return gr.CLUSTER_BREAK.SPACINGMARK}else if(2492===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2495){if(2494===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2497){if(2495<=e&&e<=2496)return gr.CLUSTER_BREAK.SPACINGMARK}else if(2497<=e&&e<=2500)return gr.CLUSTER_BREAK.EXTEND}else if(e<2519){if(e<2507){if(2503<=e&&e<=2504)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<2509){if(2507<=e&&e<=2508)return gr.CLUSTER_BREAK.SPACINGMARK}else if(2509===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2530){if(2519===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2558){if(2530<=e&&e<=2531)return gr.CLUSTER_BREAK.EXTEND}else if(2558===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2691){if(e<2631){if(e<2620){if(e<2563){if(2561<=e&&e<=2562)return gr.CLUSTER_BREAK.EXTEND}else if(2563===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<2622){if(2620===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2625){if(2622<=e&&e<=2624)return gr.CLUSTER_BREAK.SPACINGMARK}else if(2625<=e&&e<=2626)return gr.CLUSTER_BREAK.EXTEND}else if(e<2672){if(e<2635){if(2631<=e&&e<=2632)return gr.CLUSTER_BREAK.EXTEND}else if(e<2641){if(2635<=e&&e<=2637)return gr.CLUSTER_BREAK.EXTEND}else if(2641===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2677){if(2672<=e&&e<=2673)return gr.CLUSTER_BREAK.EXTEND}else if(e<2689){if(2677===e)return gr.CLUSTER_BREAK.EXTEND}else if(2689<=e&&e<=2690)return gr.CLUSTER_BREAK.EXTEND}else if(e<2761){if(e<2750){if(2691===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(2748===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2753){if(2750<=e&&e<=2752)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<2759){if(2753<=e&&e<=2757)return gr.CLUSTER_BREAK.EXTEND}else if(2759<=e&&e<=2760)return gr.CLUSTER_BREAK.EXTEND}else if(e<2786){if(e<2763){if(2761===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<2765){if(2763<=e&&e<=2764)return gr.CLUSTER_BREAK.SPACINGMARK}else if(2765===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2810){if(2786<=e&&e<=2787)return gr.CLUSTER_BREAK.EXTEND}else if(e<2817){if(2810<=e&&e<=2815)return gr.CLUSTER_BREAK.EXTEND}else if(2817===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3315){if(e<3076){if(e<2946){if(e<2887){if(e<2878){if(e<2876){if(2818<=e&&e<=2819)return gr.CLUSTER_BREAK.SPACINGMARK}else if(2876===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2880){if(2878<=e&&e<=2879)return gr.CLUSTER_BREAK.EXTEND}else if(e<2881){if(2880===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(2881<=e&&e<=2884)return gr.CLUSTER_BREAK.EXTEND}else if(e<2893){if(e<2891){if(2887<=e&&e<=2888)return gr.CLUSTER_BREAK.SPACINGMARK}else if(2891<=e&&e<=2892)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<2901){if(2893===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<2914){if(2901<=e&&e<=2903)return gr.CLUSTER_BREAK.EXTEND}else if(2914<=e&&e<=2915)return gr.CLUSTER_BREAK.EXTEND}else if(e<3014){if(e<3007){if(2946===e)return gr.CLUSTER_BREAK.EXTEND;if(3006===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3008){if(3007===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3009){if(3008===e)return gr.CLUSTER_BREAK.EXTEND}else if(3009<=e&&e<=3010)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3031){if(e<3018){if(3014<=e&&e<=3016)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3021){if(3018<=e&&e<=3020)return gr.CLUSTER_BREAK.SPACINGMARK}else if(3021===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3072){if(3031===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3073){if(3072===e)return gr.CLUSTER_BREAK.EXTEND}else if(3073<=e&&e<=3075)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3262){if(e<3146){if(e<3134){if(3076===e)return gr.CLUSTER_BREAK.EXTEND;if(3132===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3137){if(3134<=e&&e<=3136)return gr.CLUSTER_BREAK.EXTEND}else if(e<3142){if(3137<=e&&e<=3140)return gr.CLUSTER_BREAK.SPACINGMARK}else if(3142<=e&&e<=3144)return gr.CLUSTER_BREAK.EXTEND}else if(e<3201){if(e<3157){if(3146<=e&&e<=3149)return gr.CLUSTER_BREAK.EXTEND}else if(e<3170){if(3157<=e&&e<=3158)return gr.CLUSTER_BREAK.EXTEND}else if(3170<=e&&e<=3171)return gr.CLUSTER_BREAK.EXTEND}else if(e<3202){if(3201===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3260){if(3202<=e&&e<=3203)return gr.CLUSTER_BREAK.SPACINGMARK}else if(3260===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3270){if(e<3264){if(3262===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(3263===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3266){if(3264<=e&&e<=3265)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3267){if(3266===e)return gr.CLUSTER_BREAK.EXTEND}else if(3267<=e&&e<=3268)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3276){if(e<3271){if(3270===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3274){if(3271<=e&&e<=3272)return gr.CLUSTER_BREAK.SPACINGMARK}else if(3274<=e&&e<=3275)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3285){if(3276<=e&&e<=3277)return gr.CLUSTER_BREAK.EXTEND}else if(e<3298){if(3285<=e&&e<=3286)return gr.CLUSTER_BREAK.EXTEND}else if(3298<=e&&e<=3299)return gr.CLUSTER_BREAK.EXTEND}else if(e<3551){if(e<3406){if(e<3391){if(e<3330){if(e<3328){if(3315===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(3328<=e&&e<=3329)return gr.CLUSTER_BREAK.EXTEND}else if(e<3387){if(3330<=e&&e<=3331)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3390){if(3387<=e&&e<=3388)return gr.CLUSTER_BREAK.EXTEND}else if(3390===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3398){if(e<3393){if(3391<=e&&e<=3392)return gr.CLUSTER_BREAK.SPACINGMARK}else if(3393<=e&&e<=3396)return gr.CLUSTER_BREAK.EXTEND}else if(e<3402){if(3398<=e&&e<=3400)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3405){if(3402<=e&&e<=3404)return gr.CLUSTER_BREAK.SPACINGMARK}else if(3405===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3530){if(e<3426){if(3406===e)return gr.CLUSTER_BREAK.PREPEND;if(3415===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3457){if(3426<=e&&e<=3427)return gr.CLUSTER_BREAK.EXTEND}else if(e<3458){if(3457===e)return gr.CLUSTER_BREAK.EXTEND}else if(3458<=e&&e<=3459)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3538){if(e<3535){if(3530===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3536){if(3535===e)return gr.CLUSTER_BREAK.EXTEND}else if(3536<=e&&e<=3537)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3542){if(3538<=e&&e<=3540)return gr.CLUSTER_BREAK.EXTEND}else if(e<3544){if(3542===e)return gr.CLUSTER_BREAK.EXTEND}else if(3544<=e&&e<=3550)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3893){if(e<3655){if(e<3633){if(e<3570){if(3551===e)return gr.CLUSTER_BREAK.EXTEND}else if(3570<=e&&e<=3571)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3635){if(3633===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3636){if(3635===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(3636<=e&&e<=3642)return gr.CLUSTER_BREAK.EXTEND}else if(e<3764)if(e<3761){if(3655<=e&&e<=3662)return gr.CLUSTER_BREAK.EXTEND}else{if(3761===e)return gr.CLUSTER_BREAK.EXTEND;if(3763===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3784){if(3764<=e&&e<=3772)return gr.CLUSTER_BREAK.EXTEND}else if(e<3864){if(3784<=e&&e<=3790)return gr.CLUSTER_BREAK.EXTEND}else if(3864<=e&&e<=3865)return gr.CLUSTER_BREAK.EXTEND}else if(e<3967){if(e<3897){if(3893===e)return gr.CLUSTER_BREAK.EXTEND;if(3895===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3902){if(3897===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<3953){if(3902<=e&&e<=3903)return gr.CLUSTER_BREAK.SPACINGMARK}else if(3953<=e&&e<=3966)return gr.CLUSTER_BREAK.EXTEND}else if(e<3981){if(e<3968){if(3967===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<3974){if(3968<=e&&e<=3972)return gr.CLUSTER_BREAK.EXTEND}else if(3974<=e&&e<=3975)return gr.CLUSTER_BREAK.EXTEND}else if(e<3993){if(3981<=e&&e<=3991)return gr.CLUSTER_BREAK.EXTEND}else if(e<4038){if(3993<=e&&e<=4028)return gr.CLUSTER_BREAK.EXTEND}else if(4038===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<7204){if(e<6448){if(e<5938){if(e<4226){if(e<4157){if(e<4146){if(e<4145){if(4141<=e&&e<=4144)return gr.CLUSTER_BREAK.EXTEND}else if(4145===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<4153){if(4146<=e&&e<=4151)return gr.CLUSTER_BREAK.EXTEND}else if(e<4155){if(4153<=e&&e<=4154)return gr.CLUSTER_BREAK.EXTEND}else if(4155<=e&&e<=4156)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<4184){if(e<4182){if(4157<=e&&e<=4158)return gr.CLUSTER_BREAK.EXTEND}else if(4182<=e&&e<=4183)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<4190){if(4184<=e&&e<=4185)return gr.CLUSTER_BREAK.EXTEND}else if(e<4209){if(4190<=e&&e<=4192)return gr.CLUSTER_BREAK.EXTEND}else if(4209<=e&&e<=4212)return gr.CLUSTER_BREAK.EXTEND}else if(e<4352)if(e<4229){if(4226===e)return gr.CLUSTER_BREAK.EXTEND;if(4228===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<4237){if(4229<=e&&e<=4230)return gr.CLUSTER_BREAK.EXTEND}else{if(4237===e)return gr.CLUSTER_BREAK.EXTEND;if(4253===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<4957){if(e<4448){if(4352<=e&&e<=4447)return gr.CLUSTER_BREAK.L}else if(e<4520){if(4448<=e&&e<=4519)return gr.CLUSTER_BREAK.V}else if(4520<=e&&e<=4607)return gr.CLUSTER_BREAK.T}else if(e<5906){if(4957<=e&&e<=4959)return gr.CLUSTER_BREAK.EXTEND}else if(e<5909){if(5906<=e&&e<=5908)return gr.CLUSTER_BREAK.EXTEND}else if(5909===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<6089){if(e<6070){if(e<5970){if(e<5940){if(5938<=e&&e<=5939)return gr.CLUSTER_BREAK.EXTEND}else if(5940===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<6002){if(5970<=e&&e<=5971)return gr.CLUSTER_BREAK.EXTEND}else if(e<6068){if(6002<=e&&e<=6003)return gr.CLUSTER_BREAK.EXTEND}else if(6068<=e&&e<=6069)return gr.CLUSTER_BREAK.EXTEND}else if(e<6078){if(e<6071){if(6070===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(6071<=e&&e<=6077)return gr.CLUSTER_BREAK.EXTEND}else if(e<6086){if(6078<=e&&e<=6085)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<6087){if(6086===e)return gr.CLUSTER_BREAK.EXTEND}else if(6087<=e&&e<=6088)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<6277)if(e<6155){if(e<6109){if(6089<=e&&e<=6099)return gr.CLUSTER_BREAK.EXTEND}else if(6109===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<6158){if(6155<=e&&e<=6157)return gr.CLUSTER_BREAK.EXTEND}else{if(6158===e)return gr.CLUSTER_BREAK.CONTROL;if(6159===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<6435){if(e<6313){if(6277<=e&&e<=6278)return gr.CLUSTER_BREAK.EXTEND}else if(e<6432){if(6313===e)return gr.CLUSTER_BREAK.EXTEND}else if(6432<=e&&e<=6434)return gr.CLUSTER_BREAK.EXTEND}else if(e<6439){if(6435<=e&&e<=6438)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<6441){if(6439<=e&&e<=6440)return gr.CLUSTER_BREAK.EXTEND}else if(6441<=e&&e<=6443)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<6971){if(e<6744)if(e<6681){if(e<6451){if(e<6450){if(6448<=e&&e<=6449)return gr.CLUSTER_BREAK.SPACINGMARK}else if(6450===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<6457){if(6451<=e&&e<=6456)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<6679){if(6457<=e&&e<=6459)return gr.CLUSTER_BREAK.EXTEND}else if(6679<=e&&e<=6680)return gr.CLUSTER_BREAK.EXTEND}else if(e<6741){if(e<6683){if(6681<=e&&e<=6682)return gr.CLUSTER_BREAK.SPACINGMARK}else if(6683===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<6742){if(6741===e)return gr.CLUSTER_BREAK.SPACINGMARK}else{if(6742===e)return gr.CLUSTER_BREAK.EXTEND;if(6743===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<6771){if(e<6754){if(e<6752){if(6744<=e&&e<=6750)return gr.CLUSTER_BREAK.EXTEND}else if(6752===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<6757){if(6754===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<6765){if(6757<=e&&e<=6764)return gr.CLUSTER_BREAK.EXTEND}else if(6765<=e&&e<=6770)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<6912){if(e<6783){if(6771<=e&&e<=6780)return gr.CLUSTER_BREAK.EXTEND}else if(e<6832){if(6783===e)return gr.CLUSTER_BREAK.EXTEND}else if(6832<=e&&e<=6862)return gr.CLUSTER_BREAK.EXTEND}else if(e<6916){if(6912<=e&&e<=6915)return gr.CLUSTER_BREAK.EXTEND}else if(e<6964){if(6916===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(6964<=e&&e<=6970)return gr.CLUSTER_BREAK.EXTEND}else if(e<7080){if(e<7019){if(e<6973){if(6971===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(6972===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<6978){if(6973<=e&&e<=6977)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<6979){if(6978===e)return gr.CLUSTER_BREAK.EXTEND}else if(6979<=e&&e<=6980)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<7073){if(e<7040){if(7019<=e&&e<=7027)return gr.CLUSTER_BREAK.EXTEND}else if(e<7042){if(7040<=e&&e<=7041)return gr.CLUSTER_BREAK.EXTEND}else if(7042===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<7074){if(7073===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<7078){if(7074<=e&&e<=7077)return gr.CLUSTER_BREAK.EXTEND}else if(7078<=e&&e<=7079)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<7144)if(e<7083){if(e<7082){if(7080<=e&&e<=7081)return gr.CLUSTER_BREAK.EXTEND}else if(7082===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<7142){if(7083<=e&&e<=7085)return gr.CLUSTER_BREAK.EXTEND}else{if(7142===e)return gr.CLUSTER_BREAK.EXTEND;if(7143===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<7150){if(e<7146){if(7144<=e&&e<=7145)return gr.CLUSTER_BREAK.EXTEND}else if(e<7149){if(7146<=e&&e<=7148)return gr.CLUSTER_BREAK.SPACINGMARK}else if(7149===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<7151){if(7150===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<7154){if(7151<=e&&e<=7153)return gr.CLUSTER_BREAK.EXTEND}else if(7154<=e&&e<=7155)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<43346){if(e<11647){if(e<7415)if(e<7380){if(e<7220){if(e<7212){if(7204<=e&&e<=7211)return gr.CLUSTER_BREAK.SPACINGMARK}else if(7212<=e&&e<=7219)return gr.CLUSTER_BREAK.EXTEND}else if(e<7222){if(7220<=e&&e<=7221)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<7376){if(7222<=e&&e<=7223)return gr.CLUSTER_BREAK.EXTEND}else if(7376<=e&&e<=7378)return gr.CLUSTER_BREAK.EXTEND}else if(e<7394){if(e<7393){if(7380<=e&&e<=7392)return gr.CLUSTER_BREAK.EXTEND}else if(7393===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<7405){if(7394<=e&&e<=7400)return gr.CLUSTER_BREAK.EXTEND}else{if(7405===e)return gr.CLUSTER_BREAK.EXTEND;if(7412===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<8205)if(e<7616){if(e<7416){if(7415===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(7416<=e&&e<=7417)return gr.CLUSTER_BREAK.EXTEND}else if(e<8203){if(7616<=e&&e<=7679)return gr.CLUSTER_BREAK.EXTEND}else{if(8203===e)return gr.CLUSTER_BREAK.CONTROL;if(8204===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<8288){if(e<8206){if(8205===e)return gr.CLUSTER_BREAK.ZWJ}else if(e<8232){if(8206<=e&&e<=8207)return gr.CLUSTER_BREAK.CONTROL}else if(8232<=e&&e<=8238)return gr.CLUSTER_BREAK.CONTROL}else if(e<8400){if(8288<=e&&e<=8303)return gr.CLUSTER_BREAK.CONTROL}else if(e<11503){if(8400<=e&&e<=8432)return gr.CLUSTER_BREAK.EXTEND}else if(11503<=e&&e<=11505)return gr.CLUSTER_BREAK.EXTEND}else if(e<43043)if(e<42612){if(e<12330){if(e<11744){if(11647===e)return gr.CLUSTER_BREAK.EXTEND}else if(11744<=e&&e<=11775)return gr.CLUSTER_BREAK.EXTEND}else if(e<12441){if(12330<=e&&e<=12335)return gr.CLUSTER_BREAK.EXTEND}else if(e<42607){if(12441<=e&&e<=12442)return gr.CLUSTER_BREAK.EXTEND}else if(42607<=e&&e<=42610)return gr.CLUSTER_BREAK.EXTEND}else if(e<43010){if(e<42654){if(42612<=e&&e<=42621)return gr.CLUSTER_BREAK.EXTEND}else if(e<42736){if(42654<=e&&e<=42655)return gr.CLUSTER_BREAK.EXTEND}else if(42736<=e&&e<=42737)return gr.CLUSTER_BREAK.EXTEND}else if(e<43014){if(43010===e)return gr.CLUSTER_BREAK.EXTEND}else{if(43014===e)return gr.CLUSTER_BREAK.EXTEND;if(43019===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<43188){if(e<43047){if(e<43045){if(43043<=e&&e<=43044)return gr.CLUSTER_BREAK.SPACINGMARK}else if(43045<=e&&e<=43046)return gr.CLUSTER_BREAK.EXTEND}else if(e<43052){if(43047===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<43136){if(43052===e)return gr.CLUSTER_BREAK.EXTEND}else if(43136<=e&&e<=43137)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<43263){if(e<43204){if(43188<=e&&e<=43203)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<43232){if(43204<=e&&e<=43205)return gr.CLUSTER_BREAK.EXTEND}else if(43232<=e&&e<=43249)return gr.CLUSTER_BREAK.EXTEND}else if(e<43302){if(43263===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<43335){if(43302<=e&&e<=43309)return gr.CLUSTER_BREAK.EXTEND}else if(43335<=e&&e<=43345)return gr.CLUSTER_BREAK.EXTEND}else if(e<43698)if(e<43493){if(e<43444)if(e<43392){if(e<43360){if(43346<=e&&e<=43347)return gr.CLUSTER_BREAK.SPACINGMARK}else if(43360<=e&&e<=43388)return gr.CLUSTER_BREAK.L}else if(e<43395){if(43392<=e&&e<=43394)return gr.CLUSTER_BREAK.EXTEND}else{if(43395===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(43443===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<43450){if(e<43446){if(43444<=e&&e<=43445)return gr.CLUSTER_BREAK.SPACINGMARK}else if(43446<=e&&e<=43449)return gr.CLUSTER_BREAK.EXTEND}else if(e<43452){if(43450<=e&&e<=43451)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<43454){if(43452<=e&&e<=43453)return gr.CLUSTER_BREAK.EXTEND}else if(43454<=e&&e<=43456)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<43573){if(e<43567){if(e<43561){if(43493===e)return gr.CLUSTER_BREAK.EXTEND}else if(43561<=e&&e<=43566)return gr.CLUSTER_BREAK.EXTEND}else if(e<43569){if(43567<=e&&e<=43568)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<43571){if(43569<=e&&e<=43570)return gr.CLUSTER_BREAK.EXTEND}else if(43571<=e&&e<=43572)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<43597)if(e<43587){if(43573<=e&&e<=43574)return gr.CLUSTER_BREAK.EXTEND}else{if(43587===e)return gr.CLUSTER_BREAK.EXTEND;if(43596===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<43644){if(43597===e)return gr.CLUSTER_BREAK.SPACINGMARK}else{if(43644===e)return gr.CLUSTER_BREAK.EXTEND;if(43696===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<44006){if(e<43756)if(e<43710){if(e<43703){if(43698<=e&&e<=43700)return gr.CLUSTER_BREAK.EXTEND}else if(43703<=e&&e<=43704)return gr.CLUSTER_BREAK.EXTEND}else if(e<43713){if(43710<=e&&e<=43711)return gr.CLUSTER_BREAK.EXTEND}else{if(43713===e)return gr.CLUSTER_BREAK.EXTEND;if(43755===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<43766){if(e<43758){if(43756<=e&&e<=43757)return gr.CLUSTER_BREAK.EXTEND}else if(e<43765){if(43758<=e&&e<=43759)return gr.CLUSTER_BREAK.SPACINGMARK}else if(43765===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<44003){if(43766===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<44005){if(44003<=e&&e<=44004)return gr.CLUSTER_BREAK.SPACINGMARK}else if(44005===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<44032)if(e<44009){if(e<44008){if(44006<=e&&e<=44007)return gr.CLUSTER_BREAK.SPACINGMARK}else if(44008===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<44012){if(44009<=e&&e<=44010)return gr.CLUSTER_BREAK.SPACINGMARK}else{if(44012===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(44013===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<44061){if(e<44033){if(44032===e)return gr.CLUSTER_BREAK.LV}else if(e<44060){if(44033<=e&&e<=44059)return gr.CLUSTER_BREAK.LVT}else if(44060===e)return gr.CLUSTER_BREAK.LV}else if(e<44088){if(44061<=e&&e<=44087)return gr.CLUSTER_BREAK.LVT}else if(e<44089){if(44088===e)return gr.CLUSTER_BREAK.LV}else if(44089<=e&&e<=44115)return gr.CLUSTER_BREAK.LVT}else if(e<46497){if(e<45293){if(e<44704){if(e<44397){if(e<44256){if(e<44173){if(e<44144){if(e<44117){if(44116===e)return gr.CLUSTER_BREAK.LV}else if(44117<=e&&e<=44143)return gr.CLUSTER_BREAK.LVT}else if(e<44145){if(44144===e)return gr.CLUSTER_BREAK.LV}else if(e<44172){if(44145<=e&&e<=44171)return gr.CLUSTER_BREAK.LVT}else if(44172===e)return gr.CLUSTER_BREAK.LV}else if(e<44201){if(e<44200){if(44173<=e&&e<=44199)return gr.CLUSTER_BREAK.LVT}else if(44200===e)return gr.CLUSTER_BREAK.LV}else if(e<44228){if(44201<=e&&e<=44227)return gr.CLUSTER_BREAK.LVT}else if(e<44229){if(44228===e)return gr.CLUSTER_BREAK.LV}else if(44229<=e&&e<=44255)return gr.CLUSTER_BREAK.LVT}else if(e<44313){if(e<44284){if(e<44257){if(44256===e)return gr.CLUSTER_BREAK.LV}else if(44257<=e&&e<=44283)return gr.CLUSTER_BREAK.LVT}else if(e<44285){if(44284===e)return gr.CLUSTER_BREAK.LV}else if(e<44312){if(44285<=e&&e<=44311)return gr.CLUSTER_BREAK.LVT}else if(44312===e)return gr.CLUSTER_BREAK.LV}else if(e<44368){if(e<44340){if(44313<=e&&e<=44339)return gr.CLUSTER_BREAK.LVT}else if(e<44341){if(44340===e)return gr.CLUSTER_BREAK.LV}else if(44341<=e&&e<=44367)return gr.CLUSTER_BREAK.LVT}else if(e<44369){if(44368===e)return gr.CLUSTER_BREAK.LV}else if(e<44396){if(44369<=e&&e<=44395)return gr.CLUSTER_BREAK.LVT}else if(44396===e)return gr.CLUSTER_BREAK.LV}else if(e<44537){if(e<44480){if(e<44425){if(e<44424){if(44397<=e&&e<=44423)return gr.CLUSTER_BREAK.LVT}else if(44424===e)return gr.CLUSTER_BREAK.LV}else if(e<44452){if(44425<=e&&e<=44451)return gr.CLUSTER_BREAK.LVT}else if(e<44453){if(44452===e)return gr.CLUSTER_BREAK.LV}else if(44453<=e&&e<=44479)return gr.CLUSTER_BREAK.LVT}else if(e<44508){if(e<44481){if(44480===e)return gr.CLUSTER_BREAK.LV}else if(44481<=e&&e<=44507)return gr.CLUSTER_BREAK.LVT}else if(e<44509){if(44508===e)return gr.CLUSTER_BREAK.LV}else if(e<44536){if(44509<=e&&e<=44535)return gr.CLUSTER_BREAK.LVT}else if(44536===e)return gr.CLUSTER_BREAK.LV}else if(e<44620){if(e<44565){if(e<44564){if(44537<=e&&e<=44563)return gr.CLUSTER_BREAK.LVT}else if(44564===e)return gr.CLUSTER_BREAK.LV}else if(e<44592){if(44565<=e&&e<=44591)return gr.CLUSTER_BREAK.LVT}else if(e<44593){if(44592===e)return gr.CLUSTER_BREAK.LV}else if(44593<=e&&e<=44619)return gr.CLUSTER_BREAK.LVT}else if(e<44649){if(e<44621){if(44620===e)return gr.CLUSTER_BREAK.LV}else if(e<44648){if(44621<=e&&e<=44647)return gr.CLUSTER_BREAK.LVT}else if(44648===e)return gr.CLUSTER_BREAK.LV}else if(e<44676){if(44649<=e&&e<=44675)return gr.CLUSTER_BREAK.LVT}else if(e<44677){if(44676===e)return gr.CLUSTER_BREAK.LV}else if(44677<=e&&e<=44703)return gr.CLUSTER_BREAK.LVT}else if(e<44985){if(e<44844){if(e<44761){if(e<44732){if(e<44705){if(44704===e)return gr.CLUSTER_BREAK.LV}else if(44705<=e&&e<=44731)return gr.CLUSTER_BREAK.LVT}else if(e<44733){if(44732===e)return gr.CLUSTER_BREAK.LV}else if(e<44760){if(44733<=e&&e<=44759)return gr.CLUSTER_BREAK.LVT}else if(44760===e)return gr.CLUSTER_BREAK.LV}else if(e<44789){if(e<44788){if(44761<=e&&e<=44787)return gr.CLUSTER_BREAK.LVT}else if(44788===e)return gr.CLUSTER_BREAK.LV}else if(e<44816){if(44789<=e&&e<=44815)return gr.CLUSTER_BREAK.LVT}else if(e<44817){if(44816===e)return gr.CLUSTER_BREAK.LV}else if(44817<=e&&e<=44843)return gr.CLUSTER_BREAK.LVT}else if(e<44901){if(e<44872){if(e<44845){if(44844===e)return gr.CLUSTER_BREAK.LV}else if(44845<=e&&e<=44871)return gr.CLUSTER_BREAK.LVT}else if(e<44873){if(44872===e)return gr.CLUSTER_BREAK.LV}else if(e<44900){if(44873<=e&&e<=44899)return gr.CLUSTER_BREAK.LVT}else if(44900===e)return gr.CLUSTER_BREAK.LV}else if(e<44956){if(e<44928){if(44901<=e&&e<=44927)return gr.CLUSTER_BREAK.LVT}else if(e<44929){if(44928===e)return gr.CLUSTER_BREAK.LV}else if(44929<=e&&e<=44955)return gr.CLUSTER_BREAK.LVT}else if(e<44957){if(44956===e)return gr.CLUSTER_BREAK.LV}else if(e<44984){if(44957<=e&&e<=44983)return gr.CLUSTER_BREAK.LVT}else if(44984===e)return gr.CLUSTER_BREAK.LV}else if(e<45152){if(e<45068){if(e<45013){if(e<45012){if(44985<=e&&e<=45011)return gr.CLUSTER_BREAK.LVT}else if(45012===e)return gr.CLUSTER_BREAK.LV}else if(e<45040){if(45013<=e&&e<=45039)return gr.CLUSTER_BREAK.LVT}else if(e<45041){if(45040===e)return gr.CLUSTER_BREAK.LV}else if(45041<=e&&e<=45067)return gr.CLUSTER_BREAK.LVT}else if(e<45097){if(e<45069){if(45068===e)return gr.CLUSTER_BREAK.LV}else if(e<45096){if(45069<=e&&e<=45095)return gr.CLUSTER_BREAK.LVT}else if(45096===e)return gr.CLUSTER_BREAK.LV}else if(e<45124){if(45097<=e&&e<=45123)return gr.CLUSTER_BREAK.LVT}else if(e<45125){if(45124===e)return gr.CLUSTER_BREAK.LV}else if(45125<=e&&e<=45151)return gr.CLUSTER_BREAK.LVT}else if(e<45209){if(e<45180){if(e<45153){if(45152===e)return gr.CLUSTER_BREAK.LV}else if(45153<=e&&e<=45179)return gr.CLUSTER_BREAK.LVT}else if(e<45181){if(45180===e)return gr.CLUSTER_BREAK.LV}else if(e<45208){if(45181<=e&&e<=45207)return gr.CLUSTER_BREAK.LVT}else if(45208===e)return gr.CLUSTER_BREAK.LV}else if(e<45264){if(e<45236){if(45209<=e&&e<=45235)return gr.CLUSTER_BREAK.LVT}else if(e<45237){if(45236===e)return gr.CLUSTER_BREAK.LV}else if(45237<=e&&e<=45263)return gr.CLUSTER_BREAK.LVT}else if(e<45265){if(45264===e)return gr.CLUSTER_BREAK.LV}else if(e<45292){if(45265<=e&&e<=45291)return gr.CLUSTER_BREAK.LVT}else if(45292===e)return gr.CLUSTER_BREAK.LV}else if(e<45908){if(e<45600){if(e<45433){if(e<45376){if(e<45321){if(e<45320){if(45293<=e&&e<=45319)return gr.CLUSTER_BREAK.LVT}else if(45320===e)return gr.CLUSTER_BREAK.LV}else if(e<45348){if(45321<=e&&e<=45347)return gr.CLUSTER_BREAK.LVT}else if(e<45349){if(45348===e)return gr.CLUSTER_BREAK.LV}else if(45349<=e&&e<=45375)return gr.CLUSTER_BREAK.LVT}else if(e<45404){if(e<45377){if(45376===e)return gr.CLUSTER_BREAK.LV}else if(45377<=e&&e<=45403)return gr.CLUSTER_BREAK.LVT}else if(e<45405){if(45404===e)return gr.CLUSTER_BREAK.LV}else if(e<45432){if(45405<=e&&e<=45431)return gr.CLUSTER_BREAK.LVT}else if(45432===e)return gr.CLUSTER_BREAK.LV}else if(e<45516){if(e<45461){if(e<45460){if(45433<=e&&e<=45459)return gr.CLUSTER_BREAK.LVT}else if(45460===e)return gr.CLUSTER_BREAK.LV}else if(e<45488){if(45461<=e&&e<=45487)return gr.CLUSTER_BREAK.LVT}else if(e<45489){if(45488===e)return gr.CLUSTER_BREAK.LV}else if(45489<=e&&e<=45515)return gr.CLUSTER_BREAK.LVT}else if(e<45545){if(e<45517){if(45516===e)return gr.CLUSTER_BREAK.LV}else if(e<45544){if(45517<=e&&e<=45543)return gr.CLUSTER_BREAK.LVT}else if(45544===e)return gr.CLUSTER_BREAK.LV}else if(e<45572){if(45545<=e&&e<=45571)return gr.CLUSTER_BREAK.LVT}else if(e<45573){if(45572===e)return gr.CLUSTER_BREAK.LV}else if(45573<=e&&e<=45599)return gr.CLUSTER_BREAK.LVT}else if(e<45741){if(e<45657){if(e<45628){if(e<45601){if(45600===e)return gr.CLUSTER_BREAK.LV}else if(45601<=e&&e<=45627)return gr.CLUSTER_BREAK.LVT}else if(e<45629){if(45628===e)return gr.CLUSTER_BREAK.LV}else if(e<45656){if(45629<=e&&e<=45655)return gr.CLUSTER_BREAK.LVT}else if(45656===e)return gr.CLUSTER_BREAK.LV}else if(e<45712){if(e<45684){if(45657<=e&&e<=45683)return gr.CLUSTER_BREAK.LVT}else if(e<45685){if(45684===e)return gr.CLUSTER_BREAK.LV}else if(45685<=e&&e<=45711)return gr.CLUSTER_BREAK.LVT}else if(e<45713){if(45712===e)return gr.CLUSTER_BREAK.LV}else if(e<45740){if(45713<=e&&e<=45739)return gr.CLUSTER_BREAK.LVT}else if(45740===e)return gr.CLUSTER_BREAK.LV}else if(e<45824){if(e<45769){if(e<45768){if(45741<=e&&e<=45767)return gr.CLUSTER_BREAK.LVT}else if(45768===e)return gr.CLUSTER_BREAK.LV}else if(e<45796){if(45769<=e&&e<=45795)return gr.CLUSTER_BREAK.LVT}else if(e<45797){if(45796===e)return gr.CLUSTER_BREAK.LV}else if(45797<=e&&e<=45823)return gr.CLUSTER_BREAK.LVT}else if(e<45853){if(e<45825){if(45824===e)return gr.CLUSTER_BREAK.LV}else if(e<45852){if(45825<=e&&e<=45851)return gr.CLUSTER_BREAK.LVT}else if(45852===e)return gr.CLUSTER_BREAK.LV}else if(e<45880){if(45853<=e&&e<=45879)return gr.CLUSTER_BREAK.LVT}else if(e<45881){if(45880===e)return gr.CLUSTER_BREAK.LV}else if(45881<=e&&e<=45907)return gr.CLUSTER_BREAK.LVT}else if(e<46189){if(e<46048){if(e<45965){if(e<45936){if(e<45909){if(45908===e)return gr.CLUSTER_BREAK.LV}else if(45909<=e&&e<=45935)return gr.CLUSTER_BREAK.LVT}else if(e<45937){if(45936===e)return gr.CLUSTER_BREAK.LV}else if(e<45964){if(45937<=e&&e<=45963)return gr.CLUSTER_BREAK.LVT}else if(45964===e)return gr.CLUSTER_BREAK.LV}else if(e<45993){if(e<45992){if(45965<=e&&e<=45991)return gr.CLUSTER_BREAK.LVT}else if(45992===e)return gr.CLUSTER_BREAK.LV}else if(e<46020){if(45993<=e&&e<=46019)return gr.CLUSTER_BREAK.LVT}else if(e<46021){if(46020===e)return gr.CLUSTER_BREAK.LV}else if(46021<=e&&e<=46047)return gr.CLUSTER_BREAK.LVT}else if(e<46105){if(e<46076){if(e<46049){if(46048===e)return gr.CLUSTER_BREAK.LV}else if(46049<=e&&e<=46075)return gr.CLUSTER_BREAK.LVT}else if(e<46077){if(46076===e)return gr.CLUSTER_BREAK.LV}else if(e<46104){if(46077<=e&&e<=46103)return gr.CLUSTER_BREAK.LVT}else if(46104===e)return gr.CLUSTER_BREAK.LV}else if(e<46160){if(e<46132){if(46105<=e&&e<=46131)return gr.CLUSTER_BREAK.LVT}else if(e<46133){if(46132===e)return gr.CLUSTER_BREAK.LV}else if(46133<=e&&e<=46159)return gr.CLUSTER_BREAK.LVT}else if(e<46161){if(46160===e)return gr.CLUSTER_BREAK.LV}else if(e<46188){if(46161<=e&&e<=46187)return gr.CLUSTER_BREAK.LVT}else if(46188===e)return gr.CLUSTER_BREAK.LV}else if(e<46356){if(e<46272){if(e<46217){if(e<46216){if(46189<=e&&e<=46215)return gr.CLUSTER_BREAK.LVT}else if(46216===e)return gr.CLUSTER_BREAK.LV}else if(e<46244){if(46217<=e&&e<=46243)return gr.CLUSTER_BREAK.LVT}else if(e<46245){if(46244===e)return gr.CLUSTER_BREAK.LV}else if(46245<=e&&e<=46271)return gr.CLUSTER_BREAK.LVT}else if(e<46301){if(e<46273){if(46272===e)return gr.CLUSTER_BREAK.LV}else if(e<46300){if(46273<=e&&e<=46299)return gr.CLUSTER_BREAK.LVT}else if(46300===e)return gr.CLUSTER_BREAK.LV}else if(e<46328){if(46301<=e&&e<=46327)return gr.CLUSTER_BREAK.LVT}else if(e<46329){if(46328===e)return gr.CLUSTER_BREAK.LV}else if(46329<=e&&e<=46355)return gr.CLUSTER_BREAK.LVT}else if(e<46413){if(e<46384){if(e<46357){if(46356===e)return gr.CLUSTER_BREAK.LV}else if(46357<=e&&e<=46383)return gr.CLUSTER_BREAK.LVT}else if(e<46385){if(46384===e)return gr.CLUSTER_BREAK.LV}else if(e<46412){if(46385<=e&&e<=46411)return gr.CLUSTER_BREAK.LVT}else if(46412===e)return gr.CLUSTER_BREAK.LV}else if(e<46468){if(e<46440){if(46413<=e&&e<=46439)return gr.CLUSTER_BREAK.LVT}else if(e<46441){if(46440===e)return gr.CLUSTER_BREAK.LV}else if(46441<=e&&e<=46467)return gr.CLUSTER_BREAK.LVT}else if(e<46469){if(46468===e)return gr.CLUSTER_BREAK.LV}else if(e<46496){if(46469<=e&&e<=46495)return gr.CLUSTER_BREAK.LVT}else if(46496===e)return gr.CLUSTER_BREAK.LV}else if(e<47701){if(e<47112){if(e<46804){if(e<46637){if(e<46580){if(e<46525){if(e<46524){if(46497<=e&&e<=46523)return gr.CLUSTER_BREAK.LVT}else if(46524===e)return gr.CLUSTER_BREAK.LV}else if(e<46552){if(46525<=e&&e<=46551)return gr.CLUSTER_BREAK.LVT}else if(e<46553){if(46552===e)return gr.CLUSTER_BREAK.LV}else if(46553<=e&&e<=46579)return gr.CLUSTER_BREAK.LVT}else if(e<46608){if(e<46581){if(46580===e)return gr.CLUSTER_BREAK.LV}else if(46581<=e&&e<=46607)return gr.CLUSTER_BREAK.LVT}else if(e<46609){if(46608===e)return gr.CLUSTER_BREAK.LV}else if(e<46636){if(46609<=e&&e<=46635)return gr.CLUSTER_BREAK.LVT}else if(46636===e)return gr.CLUSTER_BREAK.LV}else if(e<46720){if(e<46665){if(e<46664){if(46637<=e&&e<=46663)return gr.CLUSTER_BREAK.LVT}else if(46664===e)return gr.CLUSTER_BREAK.LV}else if(e<46692){if(46665<=e&&e<=46691)return gr.CLUSTER_BREAK.LVT}else if(e<46693){if(46692===e)return gr.CLUSTER_BREAK.LV}else if(46693<=e&&e<=46719)return gr.CLUSTER_BREAK.LVT}else if(e<46749){if(e<46721){if(46720===e)return gr.CLUSTER_BREAK.LV}else if(e<46748){if(46721<=e&&e<=46747)return gr.CLUSTER_BREAK.LVT}else if(46748===e)return gr.CLUSTER_BREAK.LV}else if(e<46776){if(46749<=e&&e<=46775)return gr.CLUSTER_BREAK.LVT}else if(e<46777){if(46776===e)return gr.CLUSTER_BREAK.LV}else if(46777<=e&&e<=46803)return gr.CLUSTER_BREAK.LVT}else if(e<46945){if(e<46861){if(e<46832){if(e<46805){if(46804===e)return gr.CLUSTER_BREAK.LV}else if(46805<=e&&e<=46831)return gr.CLUSTER_BREAK.LVT}else if(e<46833){if(46832===e)return gr.CLUSTER_BREAK.LV}else if(e<46860){if(46833<=e&&e<=46859)return gr.CLUSTER_BREAK.LVT}else if(46860===e)return gr.CLUSTER_BREAK.LV}else if(e<46916){if(e<46888){if(46861<=e&&e<=46887)return gr.CLUSTER_BREAK.LVT}else if(e<46889){if(46888===e)return gr.CLUSTER_BREAK.LV}else if(46889<=e&&e<=46915)return gr.CLUSTER_BREAK.LVT}else if(e<46917){if(46916===e)return gr.CLUSTER_BREAK.LV}else if(e<46944){if(46917<=e&&e<=46943)return gr.CLUSTER_BREAK.LVT}else if(46944===e)return gr.CLUSTER_BREAK.LV}else if(e<47028){if(e<46973){if(e<46972){if(46945<=e&&e<=46971)return gr.CLUSTER_BREAK.LVT}else if(46972===e)return gr.CLUSTER_BREAK.LV}else if(e<47e3){if(46973<=e&&e<=46999)return gr.CLUSTER_BREAK.LVT}else if(e<47001){if(47e3===e)return gr.CLUSTER_BREAK.LV}else if(47001<=e&&e<=47027)return gr.CLUSTER_BREAK.LVT}else if(e<47057){if(e<47029){if(47028===e)return gr.CLUSTER_BREAK.LV}else if(e<47056){if(47029<=e&&e<=47055)return gr.CLUSTER_BREAK.LVT}else if(47056===e)return gr.CLUSTER_BREAK.LV}else if(e<47084){if(47057<=e&&e<=47083)return gr.CLUSTER_BREAK.LVT}else if(e<47085){if(47084===e)return gr.CLUSTER_BREAK.LV}else if(47085<=e&&e<=47111)return gr.CLUSTER_BREAK.LVT}else if(e<47393){if(e<47252){if(e<47169){if(e<47140){if(e<47113){if(47112===e)return gr.CLUSTER_BREAK.LV}else if(47113<=e&&e<=47139)return gr.CLUSTER_BREAK.LVT}else if(e<47141){if(47140===e)return gr.CLUSTER_BREAK.LV}else if(e<47168){if(47141<=e&&e<=47167)return gr.CLUSTER_BREAK.LVT}else if(47168===e)return gr.CLUSTER_BREAK.LV}else if(e<47197){if(e<47196){if(47169<=e&&e<=47195)return gr.CLUSTER_BREAK.LVT}else if(47196===e)return gr.CLUSTER_BREAK.LV}else if(e<47224){if(47197<=e&&e<=47223)return gr.CLUSTER_BREAK.LVT}else if(e<47225){if(47224===e)return gr.CLUSTER_BREAK.LV}else if(47225<=e&&e<=47251)return gr.CLUSTER_BREAK.LVT}else if(e<47309){if(e<47280){if(e<47253){if(47252===e)return gr.CLUSTER_BREAK.LV}else if(47253<=e&&e<=47279)return gr.CLUSTER_BREAK.LVT}else if(e<47281){if(47280===e)return gr.CLUSTER_BREAK.LV}else if(e<47308){if(47281<=e&&e<=47307)return gr.CLUSTER_BREAK.LVT}else if(47308===e)return gr.CLUSTER_BREAK.LV}else if(e<47364){if(e<47336){if(47309<=e&&e<=47335)return gr.CLUSTER_BREAK.LVT}else if(e<47337){if(47336===e)return gr.CLUSTER_BREAK.LV}else if(47337<=e&&e<=47363)return gr.CLUSTER_BREAK.LVT}else if(e<47365){if(47364===e)return gr.CLUSTER_BREAK.LV}else if(e<47392){if(47365<=e&&e<=47391)return gr.CLUSTER_BREAK.LVT}else if(47392===e)return gr.CLUSTER_BREAK.LV}else if(e<47560){if(e<47476){if(e<47421){if(e<47420){if(47393<=e&&e<=47419)return gr.CLUSTER_BREAK.LVT}else if(47420===e)return gr.CLUSTER_BREAK.LV}else if(e<47448){if(47421<=e&&e<=47447)return gr.CLUSTER_BREAK.LVT}else if(e<47449){if(47448===e)return gr.CLUSTER_BREAK.LV}else if(47449<=e&&e<=47475)return gr.CLUSTER_BREAK.LVT}else if(e<47505){if(e<47477){if(47476===e)return gr.CLUSTER_BREAK.LV}else if(e<47504){if(47477<=e&&e<=47503)return gr.CLUSTER_BREAK.LVT}else if(47504===e)return gr.CLUSTER_BREAK.LV}else if(e<47532){if(47505<=e&&e<=47531)return gr.CLUSTER_BREAK.LVT}else if(e<47533){if(47532===e)return gr.CLUSTER_BREAK.LV}else if(47533<=e&&e<=47559)return gr.CLUSTER_BREAK.LVT}else if(e<47617){if(e<47588){if(e<47561){if(47560===e)return gr.CLUSTER_BREAK.LV}else if(47561<=e&&e<=47587)return gr.CLUSTER_BREAK.LVT}else if(e<47589){if(47588===e)return gr.CLUSTER_BREAK.LV}else if(e<47616){if(47589<=e&&e<=47615)return gr.CLUSTER_BREAK.LVT}else if(47616===e)return gr.CLUSTER_BREAK.LV}else if(e<47672){if(e<47644){if(47617<=e&&e<=47643)return gr.CLUSTER_BREAK.LVT}else if(e<47645){if(47644===e)return gr.CLUSTER_BREAK.LV}else if(47645<=e&&e<=47671)return gr.CLUSTER_BREAK.LVT}else if(e<47673){if(47672===e)return gr.CLUSTER_BREAK.LV}else if(e<47700){if(47673<=e&&e<=47699)return gr.CLUSTER_BREAK.LVT}else if(47700===e)return gr.CLUSTER_BREAK.LV}else if(e<48316){if(e<48008){if(e<47841){if(e<47784){if(e<47729){if(e<47728){if(47701<=e&&e<=47727)return gr.CLUSTER_BREAK.LVT}else if(47728===e)return gr.CLUSTER_BREAK.LV}else if(e<47756){if(47729<=e&&e<=47755)return gr.CLUSTER_BREAK.LVT}else if(e<47757){if(47756===e)return gr.CLUSTER_BREAK.LV}else if(47757<=e&&e<=47783)return gr.CLUSTER_BREAK.LVT}else if(e<47812){if(e<47785){if(47784===e)return gr.CLUSTER_BREAK.LV}else if(47785<=e&&e<=47811)return gr.CLUSTER_BREAK.LVT}else if(e<47813){if(47812===e)return gr.CLUSTER_BREAK.LV}else if(e<47840){if(47813<=e&&e<=47839)return gr.CLUSTER_BREAK.LVT}else if(47840===e)return gr.CLUSTER_BREAK.LV}else if(e<47924){if(e<47869){if(e<47868){if(47841<=e&&e<=47867)return gr.CLUSTER_BREAK.LVT}else if(47868===e)return gr.CLUSTER_BREAK.LV}else if(e<47896){if(47869<=e&&e<=47895)return gr.CLUSTER_BREAK.LVT}else if(e<47897){if(47896===e)return gr.CLUSTER_BREAK.LV}else if(47897<=e&&e<=47923)return gr.CLUSTER_BREAK.LVT}else if(e<47953){if(e<47925){if(47924===e)return gr.CLUSTER_BREAK.LV}else if(e<47952){if(47925<=e&&e<=47951)return gr.CLUSTER_BREAK.LVT}else if(47952===e)return gr.CLUSTER_BREAK.LV}else if(e<47980){if(47953<=e&&e<=47979)return gr.CLUSTER_BREAK.LVT}else if(e<47981){if(47980===e)return gr.CLUSTER_BREAK.LV}else if(47981<=e&&e<=48007)return gr.CLUSTER_BREAK.LVT}else if(e<48149){if(e<48065){if(e<48036){if(e<48009){if(48008===e)return gr.CLUSTER_BREAK.LV}else if(48009<=e&&e<=48035)return gr.CLUSTER_BREAK.LVT}else if(e<48037){if(48036===e)return gr.CLUSTER_BREAK.LV}else if(e<48064){if(48037<=e&&e<=48063)return gr.CLUSTER_BREAK.LVT}else if(48064===e)return gr.CLUSTER_BREAK.LV}else if(e<48120){if(e<48092){if(48065<=e&&e<=48091)return gr.CLUSTER_BREAK.LVT}else if(e<48093){if(48092===e)return gr.CLUSTER_BREAK.LV}else if(48093<=e&&e<=48119)return gr.CLUSTER_BREAK.LVT}else if(e<48121){if(48120===e)return gr.CLUSTER_BREAK.LV}else if(e<48148){if(48121<=e&&e<=48147)return gr.CLUSTER_BREAK.LVT}else if(48148===e)return gr.CLUSTER_BREAK.LV}else if(e<48232){if(e<48177){if(e<48176){if(48149<=e&&e<=48175)return gr.CLUSTER_BREAK.LVT}else if(48176===e)return gr.CLUSTER_BREAK.LV}else if(e<48204){if(48177<=e&&e<=48203)return gr.CLUSTER_BREAK.LVT}else if(e<48205){if(48204===e)return gr.CLUSTER_BREAK.LV}else if(48205<=e&&e<=48231)return gr.CLUSTER_BREAK.LVT}else if(e<48261){if(e<48233){if(48232===e)return gr.CLUSTER_BREAK.LV}else if(e<48260){if(48233<=e&&e<=48259)return gr.CLUSTER_BREAK.LVT}else if(48260===e)return gr.CLUSTER_BREAK.LV}else if(e<48288){if(48261<=e&&e<=48287)return gr.CLUSTER_BREAK.LVT}else if(e<48289){if(48288===e)return gr.CLUSTER_BREAK.LV}else if(48289<=e&&e<=48315)return gr.CLUSTER_BREAK.LVT}else if(e<48597){if(e<48456){if(e<48373){if(e<48344){if(e<48317){if(48316===e)return gr.CLUSTER_BREAK.LV}else if(48317<=e&&e<=48343)return gr.CLUSTER_BREAK.LVT}else if(e<48345){if(48344===e)return gr.CLUSTER_BREAK.LV}else if(e<48372){if(48345<=e&&e<=48371)return gr.CLUSTER_BREAK.LVT}else if(48372===e)return gr.CLUSTER_BREAK.LV}else if(e<48401){if(e<48400){if(48373<=e&&e<=48399)return gr.CLUSTER_BREAK.LVT}else if(48400===e)return gr.CLUSTER_BREAK.LV}else if(e<48428){if(48401<=e&&e<=48427)return gr.CLUSTER_BREAK.LVT}else if(e<48429){if(48428===e)return gr.CLUSTER_BREAK.LV}else if(48429<=e&&e<=48455)return gr.CLUSTER_BREAK.LVT}else if(e<48513){if(e<48484){if(e<48457){if(48456===e)return gr.CLUSTER_BREAK.LV}else if(48457<=e&&e<=48483)return gr.CLUSTER_BREAK.LVT}else if(e<48485){if(48484===e)return gr.CLUSTER_BREAK.LV}else if(e<48512){if(48485<=e&&e<=48511)return gr.CLUSTER_BREAK.LVT}else if(48512===e)return gr.CLUSTER_BREAK.LV}else if(e<48568){if(e<48540){if(48513<=e&&e<=48539)return gr.CLUSTER_BREAK.LVT}else if(e<48541){if(48540===e)return gr.CLUSTER_BREAK.LV}else if(48541<=e&&e<=48567)return gr.CLUSTER_BREAK.LVT}else if(e<48569){if(48568===e)return gr.CLUSTER_BREAK.LV}else if(e<48596){if(48569<=e&&e<=48595)return gr.CLUSTER_BREAK.LVT}else if(48596===e)return gr.CLUSTER_BREAK.LV}else if(e<48764){if(e<48680){if(e<48625){if(e<48624){if(48597<=e&&e<=48623)return gr.CLUSTER_BREAK.LVT}else if(48624===e)return gr.CLUSTER_BREAK.LV}else if(e<48652){if(48625<=e&&e<=48651)return gr.CLUSTER_BREAK.LVT}else if(e<48653){if(48652===e)return gr.CLUSTER_BREAK.LV}else if(48653<=e&&e<=48679)return gr.CLUSTER_BREAK.LVT}else if(e<48709){if(e<48681){if(48680===e)return gr.CLUSTER_BREAK.LV}else if(e<48708){if(48681<=e&&e<=48707)return gr.CLUSTER_BREAK.LVT}else if(48708===e)return gr.CLUSTER_BREAK.LV}else if(e<48736){if(48709<=e&&e<=48735)return gr.CLUSTER_BREAK.LVT}else if(e<48737){if(48736===e)return gr.CLUSTER_BREAK.LV}else if(48737<=e&&e<=48763)return gr.CLUSTER_BREAK.LVT}else if(e<48821){if(e<48792){if(e<48765){if(48764===e)return gr.CLUSTER_BREAK.LV}else if(48765<=e&&e<=48791)return gr.CLUSTER_BREAK.LVT}else if(e<48793){if(48792===e)return gr.CLUSTER_BREAK.LV}else if(e<48820){if(48793<=e&&e<=48819)return gr.CLUSTER_BREAK.LVT}else if(48820===e)return gr.CLUSTER_BREAK.LV}else if(e<48876){if(e<48848){if(48821<=e&&e<=48847)return gr.CLUSTER_BREAK.LVT}else if(e<48849){if(48848===e)return gr.CLUSTER_BREAK.LV}else if(48849<=e&&e<=48875)return gr.CLUSTER_BREAK.LVT}else if(e<48877){if(48876===e)return gr.CLUSTER_BREAK.LV}else if(e<48904){if(48877<=e&&e<=48903)return gr.CLUSTER_BREAK.LVT}else if(48904===e)return gr.CLUSTER_BREAK.LV}else if(e<53720){if(e<51312){if(e<50108){if(e<49493){if(e<49212){if(e<49045){if(e<48988){if(e<48933){if(e<48932){if(48905<=e&&e<=48931)return gr.CLUSTER_BREAK.LVT}else if(48932===e)return gr.CLUSTER_BREAK.LV}else if(e<48960){if(48933<=e&&e<=48959)return gr.CLUSTER_BREAK.LVT}else if(e<48961){if(48960===e)return gr.CLUSTER_BREAK.LV}else if(48961<=e&&e<=48987)return gr.CLUSTER_BREAK.LVT}else if(e<49016){if(e<48989){if(48988===e)return gr.CLUSTER_BREAK.LV}else if(48989<=e&&e<=49015)return gr.CLUSTER_BREAK.LVT}else if(e<49017){if(49016===e)return gr.CLUSTER_BREAK.LV}else if(e<49044){if(49017<=e&&e<=49043)return gr.CLUSTER_BREAK.LVT}else if(49044===e)return gr.CLUSTER_BREAK.LV}else if(e<49128){if(e<49073){if(e<49072){if(49045<=e&&e<=49071)return gr.CLUSTER_BREAK.LVT}else if(49072===e)return gr.CLUSTER_BREAK.LV}else if(e<49100){if(49073<=e&&e<=49099)return gr.CLUSTER_BREAK.LVT}else if(e<49101){if(49100===e)return gr.CLUSTER_BREAK.LV}else if(49101<=e&&e<=49127)return gr.CLUSTER_BREAK.LVT}else if(e<49157){if(e<49129){if(49128===e)return gr.CLUSTER_BREAK.LV}else if(e<49156){if(49129<=e&&e<=49155)return gr.CLUSTER_BREAK.LVT}else if(49156===e)return gr.CLUSTER_BREAK.LV}else if(e<49184){if(49157<=e&&e<=49183)return gr.CLUSTER_BREAK.LVT}else if(e<49185){if(49184===e)return gr.CLUSTER_BREAK.LV}else if(49185<=e&&e<=49211)return gr.CLUSTER_BREAK.LVT}else if(e<49352){if(e<49269){if(e<49240){if(e<49213){if(49212===e)return gr.CLUSTER_BREAK.LV}else if(49213<=e&&e<=49239)return gr.CLUSTER_BREAK.LVT}else if(e<49241){if(49240===e)return gr.CLUSTER_BREAK.LV}else if(e<49268){if(49241<=e&&e<=49267)return gr.CLUSTER_BREAK.LVT}else if(49268===e)return gr.CLUSTER_BREAK.LV}else if(e<49297){if(e<49296){if(49269<=e&&e<=49295)return gr.CLUSTER_BREAK.LVT}else if(49296===e)return gr.CLUSTER_BREAK.LV}else if(e<49324){if(49297<=e&&e<=49323)return gr.CLUSTER_BREAK.LVT}else if(e<49325){if(49324===e)return gr.CLUSTER_BREAK.LV}else if(49325<=e&&e<=49351)return gr.CLUSTER_BREAK.LVT}else if(e<49409){if(e<49380){if(e<49353){if(49352===e)return gr.CLUSTER_BREAK.LV}else if(49353<=e&&e<=49379)return gr.CLUSTER_BREAK.LVT}else if(e<49381){if(49380===e)return gr.CLUSTER_BREAK.LV}else if(e<49408){if(49381<=e&&e<=49407)return gr.CLUSTER_BREAK.LVT}else if(49408===e)return gr.CLUSTER_BREAK.LV}else if(e<49464){if(e<49436){if(49409<=e&&e<=49435)return gr.CLUSTER_BREAK.LVT}else if(e<49437){if(49436===e)return gr.CLUSTER_BREAK.LV}else if(49437<=e&&e<=49463)return gr.CLUSTER_BREAK.LVT}else if(e<49465){if(49464===e)return gr.CLUSTER_BREAK.LV}else if(e<49492){if(49465<=e&&e<=49491)return gr.CLUSTER_BREAK.LVT}else if(49492===e)return gr.CLUSTER_BREAK.LV}else if(e<49800){if(e<49633){if(e<49576){if(e<49521){if(e<49520){if(49493<=e&&e<=49519)return gr.CLUSTER_BREAK.LVT}else if(49520===e)return gr.CLUSTER_BREAK.LV}else if(e<49548){if(49521<=e&&e<=49547)return gr.CLUSTER_BREAK.LVT}else if(e<49549){if(49548===e)return gr.CLUSTER_BREAK.LV}else if(49549<=e&&e<=49575)return gr.CLUSTER_BREAK.LVT}else if(e<49604){if(e<49577){if(49576===e)return gr.CLUSTER_BREAK.LV}else if(49577<=e&&e<=49603)return gr.CLUSTER_BREAK.LVT}else if(e<49605){if(49604===e)return gr.CLUSTER_BREAK.LV}else if(e<49632){if(49605<=e&&e<=49631)return gr.CLUSTER_BREAK.LVT}else if(49632===e)return gr.CLUSTER_BREAK.LV}else if(e<49716){if(e<49661){if(e<49660){if(49633<=e&&e<=49659)return gr.CLUSTER_BREAK.LVT}else if(49660===e)return gr.CLUSTER_BREAK.LV}else if(e<49688){if(49661<=e&&e<=49687)return gr.CLUSTER_BREAK.LVT}else if(e<49689){if(49688===e)return gr.CLUSTER_BREAK.LV}else if(49689<=e&&e<=49715)return gr.CLUSTER_BREAK.LVT}else if(e<49745){if(e<49717){if(49716===e)return gr.CLUSTER_BREAK.LV}else if(e<49744){if(49717<=e&&e<=49743)return gr.CLUSTER_BREAK.LVT}else if(49744===e)return gr.CLUSTER_BREAK.LV}else if(e<49772){if(49745<=e&&e<=49771)return gr.CLUSTER_BREAK.LVT}else if(e<49773){if(49772===e)return gr.CLUSTER_BREAK.LV}else if(49773<=e&&e<=49799)return gr.CLUSTER_BREAK.LVT}else if(e<49941){if(e<49857){if(e<49828){if(e<49801){if(49800===e)return gr.CLUSTER_BREAK.LV}else if(49801<=e&&e<=49827)return gr.CLUSTER_BREAK.LVT}else if(e<49829){if(49828===e)return gr.CLUSTER_BREAK.LV}else if(e<49856){if(49829<=e&&e<=49855)return gr.CLUSTER_BREAK.LVT}else if(49856===e)return gr.CLUSTER_BREAK.LV}else if(e<49912){if(e<49884){if(49857<=e&&e<=49883)return gr.CLUSTER_BREAK.LVT}else if(e<49885){if(49884===e)return gr.CLUSTER_BREAK.LV}else if(49885<=e&&e<=49911)return gr.CLUSTER_BREAK.LVT}else if(e<49913){if(49912===e)return gr.CLUSTER_BREAK.LV}else if(e<49940){if(49913<=e&&e<=49939)return gr.CLUSTER_BREAK.LVT}else if(49940===e)return gr.CLUSTER_BREAK.LV}else if(e<50024){if(e<49969){if(e<49968){if(49941<=e&&e<=49967)return gr.CLUSTER_BREAK.LVT}else if(49968===e)return gr.CLUSTER_BREAK.LV}else if(e<49996){if(49969<=e&&e<=49995)return gr.CLUSTER_BREAK.LVT}else if(e<49997){if(49996===e)return gr.CLUSTER_BREAK.LV}else if(49997<=e&&e<=50023)return gr.CLUSTER_BREAK.LVT}else if(e<50053){if(e<50025){if(50024===e)return gr.CLUSTER_BREAK.LV}else if(e<50052){if(50025<=e&&e<=50051)return gr.CLUSTER_BREAK.LVT}else if(50052===e)return gr.CLUSTER_BREAK.LV}else if(e<50080){if(50053<=e&&e<=50079)return gr.CLUSTER_BREAK.LVT}else if(e<50081){if(50080===e)return gr.CLUSTER_BREAK.LV}else if(50081<=e&&e<=50107)return gr.CLUSTER_BREAK.LVT}else if(e<50697){if(e<50389){if(e<50248){if(e<50165){if(e<50136){if(e<50109){if(50108===e)return gr.CLUSTER_BREAK.LV}else if(50109<=e&&e<=50135)return gr.CLUSTER_BREAK.LVT}else if(e<50137){if(50136===e)return gr.CLUSTER_BREAK.LV}else if(e<50164){if(50137<=e&&e<=50163)return gr.CLUSTER_BREAK.LVT}else if(50164===e)return gr.CLUSTER_BREAK.LV}else if(e<50193){if(e<50192){if(50165<=e&&e<=50191)return gr.CLUSTER_BREAK.LVT}else if(50192===e)return gr.CLUSTER_BREAK.LV}else if(e<50220){if(50193<=e&&e<=50219)return gr.CLUSTER_BREAK.LVT}else if(e<50221){if(50220===e)return gr.CLUSTER_BREAK.LV}else if(50221<=e&&e<=50247)return gr.CLUSTER_BREAK.LVT}else if(e<50305){if(e<50276){if(e<50249){if(50248===e)return gr.CLUSTER_BREAK.LV}else if(50249<=e&&e<=50275)return gr.CLUSTER_BREAK.LVT}else if(e<50277){if(50276===e)return gr.CLUSTER_BREAK.LV}else if(e<50304){if(50277<=e&&e<=50303)return gr.CLUSTER_BREAK.LVT}else if(50304===e)return gr.CLUSTER_BREAK.LV}else if(e<50360){if(e<50332){if(50305<=e&&e<=50331)return gr.CLUSTER_BREAK.LVT}else if(e<50333){if(50332===e)return gr.CLUSTER_BREAK.LV}else if(50333<=e&&e<=50359)return gr.CLUSTER_BREAK.LVT}else if(e<50361){if(50360===e)return gr.CLUSTER_BREAK.LV}else if(e<50388){if(50361<=e&&e<=50387)return gr.CLUSTER_BREAK.LVT}else if(50388===e)return gr.CLUSTER_BREAK.LV}else if(e<50556){if(e<50472){if(e<50417){if(e<50416){if(50389<=e&&e<=50415)return gr.CLUSTER_BREAK.LVT}else if(50416===e)return gr.CLUSTER_BREAK.LV}else if(e<50444){if(50417<=e&&e<=50443)return gr.CLUSTER_BREAK.LVT}else if(e<50445){if(50444===e)return gr.CLUSTER_BREAK.LV}else if(50445<=e&&e<=50471)return gr.CLUSTER_BREAK.LVT}else if(e<50501){if(e<50473){if(50472===e)return gr.CLUSTER_BREAK.LV}else if(e<50500){if(50473<=e&&e<=50499)return gr.CLUSTER_BREAK.LVT}else if(50500===e)return gr.CLUSTER_BREAK.LV}else if(e<50528){if(50501<=e&&e<=50527)return gr.CLUSTER_BREAK.LVT}else if(e<50529){if(50528===e)return gr.CLUSTER_BREAK.LV}else if(50529<=e&&e<=50555)return gr.CLUSTER_BREAK.LVT}else if(e<50613){if(e<50584){if(e<50557){if(50556===e)return gr.CLUSTER_BREAK.LV}else if(50557<=e&&e<=50583)return gr.CLUSTER_BREAK.LVT}else if(e<50585){if(50584===e)return gr.CLUSTER_BREAK.LV}else if(e<50612){if(50585<=e&&e<=50611)return gr.CLUSTER_BREAK.LVT}else if(50612===e)return gr.CLUSTER_BREAK.LV}else if(e<50668){if(e<50640){if(50613<=e&&e<=50639)return gr.CLUSTER_BREAK.LVT}else if(e<50641){if(50640===e)return gr.CLUSTER_BREAK.LV}else if(50641<=e&&e<=50667)return gr.CLUSTER_BREAK.LVT}else if(e<50669){if(50668===e)return gr.CLUSTER_BREAK.LV}else if(e<50696){if(50669<=e&&e<=50695)return gr.CLUSTER_BREAK.LVT}else if(50696===e)return gr.CLUSTER_BREAK.LV}else if(e<51004){if(e<50837){if(e<50780){if(e<50725){if(e<50724){if(50697<=e&&e<=50723)return gr.CLUSTER_BREAK.LVT}else if(50724===e)return gr.CLUSTER_BREAK.LV}else if(e<50752){if(50725<=e&&e<=50751)return gr.CLUSTER_BREAK.LVT}else if(e<50753){if(50752===e)return gr.CLUSTER_BREAK.LV}else if(50753<=e&&e<=50779)return gr.CLUSTER_BREAK.LVT}else if(e<50808){if(e<50781){if(50780===e)return gr.CLUSTER_BREAK.LV}else if(50781<=e&&e<=50807)return gr.CLUSTER_BREAK.LVT}else if(e<50809){if(50808===e)return gr.CLUSTER_BREAK.LV}else if(e<50836){if(50809<=e&&e<=50835)return gr.CLUSTER_BREAK.LVT}else if(50836===e)return gr.CLUSTER_BREAK.LV}else if(e<50920){if(e<50865){if(e<50864){if(50837<=e&&e<=50863)return gr.CLUSTER_BREAK.LVT}else if(50864===e)return gr.CLUSTER_BREAK.LV}else if(e<50892){if(50865<=e&&e<=50891)return gr.CLUSTER_BREAK.LVT}else if(e<50893){if(50892===e)return gr.CLUSTER_BREAK.LV}else if(50893<=e&&e<=50919)return gr.CLUSTER_BREAK.LVT}else if(e<50949){if(e<50921){if(50920===e)return gr.CLUSTER_BREAK.LV}else if(e<50948){if(50921<=e&&e<=50947)return gr.CLUSTER_BREAK.LVT}else if(50948===e)return gr.CLUSTER_BREAK.LV}else if(e<50976){if(50949<=e&&e<=50975)return gr.CLUSTER_BREAK.LVT}else if(e<50977){if(50976===e)return gr.CLUSTER_BREAK.LV}else if(50977<=e&&e<=51003)return gr.CLUSTER_BREAK.LVT}else if(e<51145){if(e<51061){if(e<51032){if(e<51005){if(51004===e)return gr.CLUSTER_BREAK.LV}else if(51005<=e&&e<=51031)return gr.CLUSTER_BREAK.LVT}else if(e<51033){if(51032===e)return gr.CLUSTER_BREAK.LV}else if(e<51060){if(51033<=e&&e<=51059)return gr.CLUSTER_BREAK.LVT}else if(51060===e)return gr.CLUSTER_BREAK.LV}else if(e<51116){if(e<51088){if(51061<=e&&e<=51087)return gr.CLUSTER_BREAK.LVT}else if(e<51089){if(51088===e)return gr.CLUSTER_BREAK.LV}else if(51089<=e&&e<=51115)return gr.CLUSTER_BREAK.LVT}else if(e<51117){if(51116===e)return gr.CLUSTER_BREAK.LV}else if(e<51144){if(51117<=e&&e<=51143)return gr.CLUSTER_BREAK.LVT}else if(51144===e)return gr.CLUSTER_BREAK.LV}else if(e<51228){if(e<51173){if(e<51172){if(51145<=e&&e<=51171)return gr.CLUSTER_BREAK.LVT}else if(51172===e)return gr.CLUSTER_BREAK.LV}else if(e<51200){if(51173<=e&&e<=51199)return gr.CLUSTER_BREAK.LVT}else if(e<51201){if(51200===e)return gr.CLUSTER_BREAK.LV}else if(51201<=e&&e<=51227)return gr.CLUSTER_BREAK.LVT}else if(e<51257){if(e<51229){if(51228===e)return gr.CLUSTER_BREAK.LV}else if(e<51256){if(51229<=e&&e<=51255)return gr.CLUSTER_BREAK.LVT}else if(51256===e)return gr.CLUSTER_BREAK.LV}else if(e<51284){if(51257<=e&&e<=51283)return gr.CLUSTER_BREAK.LVT}else if(e<51285){if(51284===e)return gr.CLUSTER_BREAK.LV}else if(51285<=e&&e<=51311)return gr.CLUSTER_BREAK.LVT}else if(e<52516){if(e<51901){if(e<51593){if(e<51452){if(e<51369){if(e<51340){if(e<51313){if(51312===e)return gr.CLUSTER_BREAK.LV}else if(51313<=e&&e<=51339)return gr.CLUSTER_BREAK.LVT}else if(e<51341){if(51340===e)return gr.CLUSTER_BREAK.LV}else if(e<51368){if(51341<=e&&e<=51367)return gr.CLUSTER_BREAK.LVT}else if(51368===e)return gr.CLUSTER_BREAK.LV}else if(e<51397){if(e<51396){if(51369<=e&&e<=51395)return gr.CLUSTER_BREAK.LVT}else if(51396===e)return gr.CLUSTER_BREAK.LV}else if(e<51424){if(51397<=e&&e<=51423)return gr.CLUSTER_BREAK.LVT}else if(e<51425){if(51424===e)return gr.CLUSTER_BREAK.LV}else if(51425<=e&&e<=51451)return gr.CLUSTER_BREAK.LVT}else if(e<51509){if(e<51480){if(e<51453){if(51452===e)return gr.CLUSTER_BREAK.LV}else if(51453<=e&&e<=51479)return gr.CLUSTER_BREAK.LVT}else if(e<51481){if(51480===e)return gr.CLUSTER_BREAK.LV}else if(e<51508){if(51481<=e&&e<=51507)return gr.CLUSTER_BREAK.LVT}else if(51508===e)return gr.CLUSTER_BREAK.LV}else if(e<51564){if(e<51536){if(51509<=e&&e<=51535)return gr.CLUSTER_BREAK.LVT}else if(e<51537){if(51536===e)return gr.CLUSTER_BREAK.LV}else if(51537<=e&&e<=51563)return gr.CLUSTER_BREAK.LVT}else if(e<51565){if(51564===e)return gr.CLUSTER_BREAK.LV}else if(e<51592){if(51565<=e&&e<=51591)return gr.CLUSTER_BREAK.LVT}else if(51592===e)return gr.CLUSTER_BREAK.LV}else if(e<51760){if(e<51676){if(e<51621){if(e<51620){if(51593<=e&&e<=51619)return gr.CLUSTER_BREAK.LVT}else if(51620===e)return gr.CLUSTER_BREAK.LV}else if(e<51648){if(51621<=e&&e<=51647)return gr.CLUSTER_BREAK.LVT}else if(e<51649){if(51648===e)return gr.CLUSTER_BREAK.LV}else if(51649<=e&&e<=51675)return gr.CLUSTER_BREAK.LVT}else if(e<51705){if(e<51677){if(51676===e)return gr.CLUSTER_BREAK.LV}else if(e<51704){if(51677<=e&&e<=51703)return gr.CLUSTER_BREAK.LVT}else if(51704===e)return gr.CLUSTER_BREAK.LV}else if(e<51732){if(51705<=e&&e<=51731)return gr.CLUSTER_BREAK.LVT}else if(e<51733){if(51732===e)return gr.CLUSTER_BREAK.LV}else if(51733<=e&&e<=51759)return gr.CLUSTER_BREAK.LVT}else if(e<51817){if(e<51788){if(e<51761){if(51760===e)return gr.CLUSTER_BREAK.LV}else if(51761<=e&&e<=51787)return gr.CLUSTER_BREAK.LVT}else if(e<51789){if(51788===e)return gr.CLUSTER_BREAK.LV}else if(e<51816){if(51789<=e&&e<=51815)return gr.CLUSTER_BREAK.LVT}else if(51816===e)return gr.CLUSTER_BREAK.LV}else if(e<51872){if(e<51844){if(51817<=e&&e<=51843)return gr.CLUSTER_BREAK.LVT}else if(e<51845){if(51844===e)return gr.CLUSTER_BREAK.LV}else if(51845<=e&&e<=51871)return gr.CLUSTER_BREAK.LVT}else if(e<51873){if(51872===e)return gr.CLUSTER_BREAK.LV}else if(e<51900){if(51873<=e&&e<=51899)return gr.CLUSTER_BREAK.LVT}else if(51900===e)return gr.CLUSTER_BREAK.LV}else if(e<52208){if(e<52041){if(e<51984){if(e<51929){if(e<51928){if(51901<=e&&e<=51927)return gr.CLUSTER_BREAK.LVT}else if(51928===e)return gr.CLUSTER_BREAK.LV}else if(e<51956){if(51929<=e&&e<=51955)return gr.CLUSTER_BREAK.LVT}else if(e<51957){if(51956===e)return gr.CLUSTER_BREAK.LV}else if(51957<=e&&e<=51983)return gr.CLUSTER_BREAK.LVT}else if(e<52012){if(e<51985){if(51984===e)return gr.CLUSTER_BREAK.LV}else if(51985<=e&&e<=52011)return gr.CLUSTER_BREAK.LVT}else if(e<52013){if(52012===e)return gr.CLUSTER_BREAK.LV}else if(e<52040){if(52013<=e&&e<=52039)return gr.CLUSTER_BREAK.LVT}else if(52040===e)return gr.CLUSTER_BREAK.LV}else if(e<52124){if(e<52069){if(e<52068){if(52041<=e&&e<=52067)return gr.CLUSTER_BREAK.LVT}else if(52068===e)return gr.CLUSTER_BREAK.LV}else if(e<52096){if(52069<=e&&e<=52095)return gr.CLUSTER_BREAK.LVT}else if(e<52097){if(52096===e)return gr.CLUSTER_BREAK.LV}else if(52097<=e&&e<=52123)return gr.CLUSTER_BREAK.LVT}else if(e<52153){if(e<52125){if(52124===e)return gr.CLUSTER_BREAK.LV}else if(e<52152){if(52125<=e&&e<=52151)return gr.CLUSTER_BREAK.LVT}else if(52152===e)return gr.CLUSTER_BREAK.LV}else if(e<52180){if(52153<=e&&e<=52179)return gr.CLUSTER_BREAK.LVT}else if(e<52181){if(52180===e)return gr.CLUSTER_BREAK.LV}else if(52181<=e&&e<=52207)return gr.CLUSTER_BREAK.LVT}else if(e<52349){if(e<52265){if(e<52236){if(e<52209){if(52208===e)return gr.CLUSTER_BREAK.LV}else if(52209<=e&&e<=52235)return gr.CLUSTER_BREAK.LVT}else if(e<52237){if(52236===e)return gr.CLUSTER_BREAK.LV}else if(e<52264){if(52237<=e&&e<=52263)return gr.CLUSTER_BREAK.LVT}else if(52264===e)return gr.CLUSTER_BREAK.LV}else if(e<52320){if(e<52292){if(52265<=e&&e<=52291)return gr.CLUSTER_BREAK.LVT}else if(e<52293){if(52292===e)return gr.CLUSTER_BREAK.LV}else if(52293<=e&&e<=52319)return gr.CLUSTER_BREAK.LVT}else if(e<52321){if(52320===e)return gr.CLUSTER_BREAK.LV}else if(e<52348){if(52321<=e&&e<=52347)return gr.CLUSTER_BREAK.LVT}else if(52348===e)return gr.CLUSTER_BREAK.LV}else if(e<52432){if(e<52377){if(e<52376){if(52349<=e&&e<=52375)return gr.CLUSTER_BREAK.LVT}else if(52376===e)return gr.CLUSTER_BREAK.LV}else if(e<52404){if(52377<=e&&e<=52403)return gr.CLUSTER_BREAK.LVT}else if(e<52405){if(52404===e)return gr.CLUSTER_BREAK.LV}else if(52405<=e&&e<=52431)return gr.CLUSTER_BREAK.LVT}else if(e<52461){if(e<52433){if(52432===e)return gr.CLUSTER_BREAK.LV}else if(e<52460){if(52433<=e&&e<=52459)return gr.CLUSTER_BREAK.LVT}else if(52460===e)return gr.CLUSTER_BREAK.LV}else if(e<52488){if(52461<=e&&e<=52487)return gr.CLUSTER_BREAK.LVT}else if(e<52489){if(52488===e)return gr.CLUSTER_BREAK.LV}else if(52489<=e&&e<=52515)return gr.CLUSTER_BREAK.LVT}else if(e<53105){if(e<52797){if(e<52656){if(e<52573){if(e<52544){if(e<52517){if(52516===e)return gr.CLUSTER_BREAK.LV}else if(52517<=e&&e<=52543)return gr.CLUSTER_BREAK.LVT}else if(e<52545){if(52544===e)return gr.CLUSTER_BREAK.LV}else if(e<52572){if(52545<=e&&e<=52571)return gr.CLUSTER_BREAK.LVT}else if(52572===e)return gr.CLUSTER_BREAK.LV}else if(e<52601){if(e<52600){if(52573<=e&&e<=52599)return gr.CLUSTER_BREAK.LVT}else if(52600===e)return gr.CLUSTER_BREAK.LV}else if(e<52628){if(52601<=e&&e<=52627)return gr.CLUSTER_BREAK.LVT}else if(e<52629){if(52628===e)return gr.CLUSTER_BREAK.LV}else if(52629<=e&&e<=52655)return gr.CLUSTER_BREAK.LVT}else if(e<52713){if(e<52684){if(e<52657){if(52656===e)return gr.CLUSTER_BREAK.LV}else if(52657<=e&&e<=52683)return gr.CLUSTER_BREAK.LVT}else if(e<52685){if(52684===e)return gr.CLUSTER_BREAK.LV}else if(e<52712){if(52685<=e&&e<=52711)return gr.CLUSTER_BREAK.LVT}else if(52712===e)return gr.CLUSTER_BREAK.LV}else if(e<52768){if(e<52740){if(52713<=e&&e<=52739)return gr.CLUSTER_BREAK.LVT}else if(e<52741){if(52740===e)return gr.CLUSTER_BREAK.LV}else if(52741<=e&&e<=52767)return gr.CLUSTER_BREAK.LVT}else if(e<52769){if(52768===e)return gr.CLUSTER_BREAK.LV}else if(e<52796){if(52769<=e&&e<=52795)return gr.CLUSTER_BREAK.LVT}else if(52796===e)return gr.CLUSTER_BREAK.LV}else if(e<52964){if(e<52880){if(e<52825){if(e<52824){if(52797<=e&&e<=52823)return gr.CLUSTER_BREAK.LVT}else if(52824===e)return gr.CLUSTER_BREAK.LV}else if(e<52852){if(52825<=e&&e<=52851)return gr.CLUSTER_BREAK.LVT}else if(e<52853){if(52852===e)return gr.CLUSTER_BREAK.LV}else if(52853<=e&&e<=52879)return gr.CLUSTER_BREAK.LVT}else if(e<52909){if(e<52881){if(52880===e)return gr.CLUSTER_BREAK.LV}else if(e<52908){if(52881<=e&&e<=52907)return gr.CLUSTER_BREAK.LVT}else if(52908===e)return gr.CLUSTER_BREAK.LV}else if(e<52936){if(52909<=e&&e<=52935)return gr.CLUSTER_BREAK.LVT}else if(e<52937){if(52936===e)return gr.CLUSTER_BREAK.LV}else if(52937<=e&&e<=52963)return gr.CLUSTER_BREAK.LVT}else if(e<53021){if(e<52992){if(e<52965){if(52964===e)return gr.CLUSTER_BREAK.LV}else if(52965<=e&&e<=52991)return gr.CLUSTER_BREAK.LVT}else if(e<52993){if(52992===e)return gr.CLUSTER_BREAK.LV}else if(e<53020){if(52993<=e&&e<=53019)return gr.CLUSTER_BREAK.LVT}else if(53020===e)return gr.CLUSTER_BREAK.LV}else if(e<53076){if(e<53048){if(53021<=e&&e<=53047)return gr.CLUSTER_BREAK.LVT}else if(e<53049){if(53048===e)return gr.CLUSTER_BREAK.LV}else if(53049<=e&&e<=53075)return gr.CLUSTER_BREAK.LVT}else if(e<53077){if(53076===e)return gr.CLUSTER_BREAK.LV}else if(e<53104){if(53077<=e&&e<=53103)return gr.CLUSTER_BREAK.LVT}else if(53104===e)return gr.CLUSTER_BREAK.LV}else if(e<53412){if(e<53245){if(e<53188){if(e<53133){if(e<53132){if(53105<=e&&e<=53131)return gr.CLUSTER_BREAK.LVT}else if(53132===e)return gr.CLUSTER_BREAK.LV}else if(e<53160){if(53133<=e&&e<=53159)return gr.CLUSTER_BREAK.LVT}else if(e<53161){if(53160===e)return gr.CLUSTER_BREAK.LV}else if(53161<=e&&e<=53187)return gr.CLUSTER_BREAK.LVT}else if(e<53216){if(e<53189){if(53188===e)return gr.CLUSTER_BREAK.LV}else if(53189<=e&&e<=53215)return gr.CLUSTER_BREAK.LVT}else if(e<53217){if(53216===e)return gr.CLUSTER_BREAK.LV}else if(e<53244){if(53217<=e&&e<=53243)return gr.CLUSTER_BREAK.LVT}else if(53244===e)return gr.CLUSTER_BREAK.LV}else if(e<53328){if(e<53273){if(e<53272){if(53245<=e&&e<=53271)return gr.CLUSTER_BREAK.LVT}else if(53272===e)return gr.CLUSTER_BREAK.LV}else if(e<53300){if(53273<=e&&e<=53299)return gr.CLUSTER_BREAK.LVT}else if(e<53301){if(53300===e)return gr.CLUSTER_BREAK.LV}else if(53301<=e&&e<=53327)return gr.CLUSTER_BREAK.LVT}else if(e<53357){if(e<53329){if(53328===e)return gr.CLUSTER_BREAK.LV}else if(e<53356){if(53329<=e&&e<=53355)return gr.CLUSTER_BREAK.LVT}else if(53356===e)return gr.CLUSTER_BREAK.LV}else if(e<53384){if(53357<=e&&e<=53383)return gr.CLUSTER_BREAK.LVT}else if(e<53385){if(53384===e)return gr.CLUSTER_BREAK.LV}else if(53385<=e&&e<=53411)return gr.CLUSTER_BREAK.LVT}else if(e<53553){if(e<53469){if(e<53440){if(e<53413){if(53412===e)return gr.CLUSTER_BREAK.LV}else if(53413<=e&&e<=53439)return gr.CLUSTER_BREAK.LVT}else if(e<53441){if(53440===e)return gr.CLUSTER_BREAK.LV}else if(e<53468){if(53441<=e&&e<=53467)return gr.CLUSTER_BREAK.LVT}else if(53468===e)return gr.CLUSTER_BREAK.LV}else if(e<53524){if(e<53496){if(53469<=e&&e<=53495)return gr.CLUSTER_BREAK.LVT}else if(e<53497){if(53496===e)return gr.CLUSTER_BREAK.LV}else if(53497<=e&&e<=53523)return gr.CLUSTER_BREAK.LVT}else if(e<53525){if(53524===e)return gr.CLUSTER_BREAK.LV}else if(e<53552){if(53525<=e&&e<=53551)return gr.CLUSTER_BREAK.LVT}else if(53552===e)return gr.CLUSTER_BREAK.LV}else if(e<53636){if(e<53581){if(e<53580){if(53553<=e&&e<=53579)return gr.CLUSTER_BREAK.LVT}else if(53580===e)return gr.CLUSTER_BREAK.LV}else if(e<53608){if(53581<=e&&e<=53607)return gr.CLUSTER_BREAK.LVT}else if(e<53609){if(53608===e)return gr.CLUSTER_BREAK.LV}else if(53609<=e&&e<=53635)return gr.CLUSTER_BREAK.LVT}else if(e<53665){if(e<53637){if(53636===e)return gr.CLUSTER_BREAK.LV}else if(e<53664){if(53637<=e&&e<=53663)return gr.CLUSTER_BREAK.LVT}else if(53664===e)return gr.CLUSTER_BREAK.LV}else if(e<53692){if(53665<=e&&e<=53691)return gr.CLUSTER_BREAK.LVT}else if(e<53693){if(53692===e)return gr.CLUSTER_BREAK.LV}else if(53693<=e&&e<=53719)return gr.CLUSTER_BREAK.LVT}else if(e<70459){if(e<54897){if(e<54308){if(e<54001){if(e<53860){if(e<53777){if(e<53748){if(e<53721){if(53720===e)return gr.CLUSTER_BREAK.LV}else if(53721<=e&&e<=53747)return gr.CLUSTER_BREAK.LVT}else if(e<53749){if(53748===e)return gr.CLUSTER_BREAK.LV}else if(e<53776){if(53749<=e&&e<=53775)return gr.CLUSTER_BREAK.LVT}else if(53776===e)return gr.CLUSTER_BREAK.LV}else if(e<53805){if(e<53804){if(53777<=e&&e<=53803)return gr.CLUSTER_BREAK.LVT}else if(53804===e)return gr.CLUSTER_BREAK.LV}else if(e<53832){if(53805<=e&&e<=53831)return gr.CLUSTER_BREAK.LVT}else if(e<53833){if(53832===e)return gr.CLUSTER_BREAK.LV}else if(53833<=e&&e<=53859)return gr.CLUSTER_BREAK.LVT}else if(e<53917){if(e<53888){if(e<53861){if(53860===e)return gr.CLUSTER_BREAK.LV}else if(53861<=e&&e<=53887)return gr.CLUSTER_BREAK.LVT}else if(e<53889){if(53888===e)return gr.CLUSTER_BREAK.LV}else if(e<53916){if(53889<=e&&e<=53915)return gr.CLUSTER_BREAK.LVT}else if(53916===e)return gr.CLUSTER_BREAK.LV}else if(e<53972){if(e<53944){if(53917<=e&&e<=53943)return gr.CLUSTER_BREAK.LVT}else if(e<53945){if(53944===e)return gr.CLUSTER_BREAK.LV}else if(53945<=e&&e<=53971)return gr.CLUSTER_BREAK.LVT}else if(e<53973){if(53972===e)return gr.CLUSTER_BREAK.LV}else if(e<54e3){if(53973<=e&&e<=53999)return gr.CLUSTER_BREAK.LVT}else if(54e3===e)return gr.CLUSTER_BREAK.LV}else if(e<54141){if(e<54084){if(e<54029){if(e<54028){if(54001<=e&&e<=54027)return gr.CLUSTER_BREAK.LVT}else if(54028===e)return gr.CLUSTER_BREAK.LV}else if(e<54056){if(54029<=e&&e<=54055)return gr.CLUSTER_BREAK.LVT}else if(e<54057){if(54056===e)return gr.CLUSTER_BREAK.LV}else if(54057<=e&&e<=54083)return gr.CLUSTER_BREAK.LVT}else if(e<54112){if(e<54085){if(54084===e)return gr.CLUSTER_BREAK.LV}else if(54085<=e&&e<=54111)return gr.CLUSTER_BREAK.LVT}else if(e<54113){if(54112===e)return gr.CLUSTER_BREAK.LV}else if(e<54140){if(54113<=e&&e<=54139)return gr.CLUSTER_BREAK.LVT}else if(54140===e)return gr.CLUSTER_BREAK.LV}else if(e<54224){if(e<54169){if(e<54168){if(54141<=e&&e<=54167)return gr.CLUSTER_BREAK.LVT}else if(54168===e)return gr.CLUSTER_BREAK.LV}else if(e<54196){if(54169<=e&&e<=54195)return gr.CLUSTER_BREAK.LVT}else if(e<54197){if(54196===e)return gr.CLUSTER_BREAK.LV}else if(54197<=e&&e<=54223)return gr.CLUSTER_BREAK.LVT}else if(e<54253){if(e<54225){if(54224===e)return gr.CLUSTER_BREAK.LV}else if(e<54252){if(54225<=e&&e<=54251)return gr.CLUSTER_BREAK.LVT}else if(54252===e)return gr.CLUSTER_BREAK.LV}else if(e<54280){if(54253<=e&&e<=54279)return gr.CLUSTER_BREAK.LVT}else if(e<54281){if(54280===e)return gr.CLUSTER_BREAK.LV}else if(54281<=e&&e<=54307)return gr.CLUSTER_BREAK.LVT}else if(e<54589){if(e<54448){if(e<54365){if(e<54336){if(e<54309){if(54308===e)return gr.CLUSTER_BREAK.LV}else if(54309<=e&&e<=54335)return gr.CLUSTER_BREAK.LVT}else if(e<54337){if(54336===e)return gr.CLUSTER_BREAK.LV}else if(e<54364){if(54337<=e&&e<=54363)return gr.CLUSTER_BREAK.LVT}else if(54364===e)return gr.CLUSTER_BREAK.LV}else if(e<54393){if(e<54392){if(54365<=e&&e<=54391)return gr.CLUSTER_BREAK.LVT}else if(54392===e)return gr.CLUSTER_BREAK.LV}else if(e<54420){if(54393<=e&&e<=54419)return gr.CLUSTER_BREAK.LVT}else if(e<54421){if(54420===e)return gr.CLUSTER_BREAK.LV}else if(54421<=e&&e<=54447)return gr.CLUSTER_BREAK.LVT}else if(e<54505){if(e<54476){if(e<54449){if(54448===e)return gr.CLUSTER_BREAK.LV}else if(54449<=e&&e<=54475)return gr.CLUSTER_BREAK.LVT}else if(e<54477){if(54476===e)return gr.CLUSTER_BREAK.LV}else if(e<54504){if(54477<=e&&e<=54503)return gr.CLUSTER_BREAK.LVT}else if(54504===e)return gr.CLUSTER_BREAK.LV}else if(e<54560){if(e<54532){if(54505<=e&&e<=54531)return gr.CLUSTER_BREAK.LVT}else if(e<54533){if(54532===e)return gr.CLUSTER_BREAK.LV}else if(54533<=e&&e<=54559)return gr.CLUSTER_BREAK.LVT}else if(e<54561){if(54560===e)return gr.CLUSTER_BREAK.LV}else if(e<54588){if(54561<=e&&e<=54587)return gr.CLUSTER_BREAK.LVT}else if(54588===e)return gr.CLUSTER_BREAK.LV}else if(e<54756){if(e<54672){if(e<54617){if(e<54616){if(54589<=e&&e<=54615)return gr.CLUSTER_BREAK.LVT}else if(54616===e)return gr.CLUSTER_BREAK.LV}else if(e<54644){if(54617<=e&&e<=54643)return gr.CLUSTER_BREAK.LVT}else if(e<54645){if(54644===e)return gr.CLUSTER_BREAK.LV}else if(54645<=e&&e<=54671)return gr.CLUSTER_BREAK.LVT}else if(e<54701){if(e<54673){if(54672===e)return gr.CLUSTER_BREAK.LV}else if(e<54700){if(54673<=e&&e<=54699)return gr.CLUSTER_BREAK.LVT}else if(54700===e)return gr.CLUSTER_BREAK.LV}else if(e<54728){if(54701<=e&&e<=54727)return gr.CLUSTER_BREAK.LVT}else if(e<54729){if(54728===e)return gr.CLUSTER_BREAK.LV}else if(54729<=e&&e<=54755)return gr.CLUSTER_BREAK.LVT}else if(e<54813){if(e<54784){if(e<54757){if(54756===e)return gr.CLUSTER_BREAK.LV}else if(54757<=e&&e<=54783)return gr.CLUSTER_BREAK.LVT}else if(e<54785){if(54784===e)return gr.CLUSTER_BREAK.LV}else if(e<54812){if(54785<=e&&e<=54811)return gr.CLUSTER_BREAK.LVT}else if(54812===e)return gr.CLUSTER_BREAK.LV}else if(e<54868){if(e<54840){if(54813<=e&&e<=54839)return gr.CLUSTER_BREAK.LVT}else if(e<54841){if(54840===e)return gr.CLUSTER_BREAK.LV}else if(54841<=e&&e<=54867)return gr.CLUSTER_BREAK.LVT}else if(e<54869){if(54868===e)return gr.CLUSTER_BREAK.LV}else if(e<54896){if(54869<=e&&e<=54895)return gr.CLUSTER_BREAK.LVT}else if(54896===e)return gr.CLUSTER_BREAK.LV}else if(e<69632){if(e<55216){if(e<55037){if(e<54980){if(e<54925){if(e<54924){if(54897<=e&&e<=54923)return gr.CLUSTER_BREAK.LVT}else if(54924===e)return gr.CLUSTER_BREAK.LV}else if(e<54952){if(54925<=e&&e<=54951)return gr.CLUSTER_BREAK.LVT}else if(e<54953){if(54952===e)return gr.CLUSTER_BREAK.LV}else if(54953<=e&&e<=54979)return gr.CLUSTER_BREAK.LVT}else if(e<55008){if(e<54981){if(54980===e)return gr.CLUSTER_BREAK.LV}else if(54981<=e&&e<=55007)return gr.CLUSTER_BREAK.LVT}else if(e<55009){if(55008===e)return gr.CLUSTER_BREAK.LV}else if(e<55036){if(55009<=e&&e<=55035)return gr.CLUSTER_BREAK.LVT}else if(55036===e)return gr.CLUSTER_BREAK.LV}else if(e<55120){if(e<55065){if(e<55064){if(55037<=e&&e<=55063)return gr.CLUSTER_BREAK.LVT}else if(55064===e)return gr.CLUSTER_BREAK.LV}else if(e<55092){if(55065<=e&&e<=55091)return gr.CLUSTER_BREAK.LVT}else if(e<55093){if(55092===e)return gr.CLUSTER_BREAK.LV}else if(55093<=e&&e<=55119)return gr.CLUSTER_BREAK.LVT}else if(e<55149){if(e<55121){if(55120===e)return gr.CLUSTER_BREAK.LV}else if(e<55148){if(55121<=e&&e<=55147)return gr.CLUSTER_BREAK.LVT}else if(55148===e)return gr.CLUSTER_BREAK.LV}else if(e<55176){if(55149<=e&&e<=55175)return gr.CLUSTER_BREAK.LVT}else if(e<55177){if(55176===e)return gr.CLUSTER_BREAK.LV}else if(55177<=e&&e<=55203)return gr.CLUSTER_BREAK.LVT}else if(e<68097){if(e<65279){if(e<64286){if(e<55243){if(55216<=e&&e<=55238)return gr.CLUSTER_BREAK.V}else if(55243<=e&&e<=55291)return gr.CLUSTER_BREAK.T}else if(e<65024){if(64286===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<65056){if(65024<=e&&e<=65039)return gr.CLUSTER_BREAK.EXTEND}else if(65056<=e&&e<=65071)return gr.CLUSTER_BREAK.EXTEND}else if(e<66045){if(e<65438){if(65279===e)return gr.CLUSTER_BREAK.CONTROL}else if(e<65520){if(65438<=e&&e<=65439)return gr.CLUSTER_BREAK.EXTEND}else if(65520<=e&&e<=65531)return gr.CLUSTER_BREAK.CONTROL}else if(e<66272){if(66045===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<66422){if(66272===e)return gr.CLUSTER_BREAK.EXTEND}else if(66422<=e&&e<=66426)return gr.CLUSTER_BREAK.EXTEND}else if(e<68325){if(e<68108){if(e<68101){if(68097<=e&&e<=68099)return gr.CLUSTER_BREAK.EXTEND}else if(68101<=e&&e<=68102)return gr.CLUSTER_BREAK.EXTEND}else if(e<68152){if(68108<=e&&e<=68111)return gr.CLUSTER_BREAK.EXTEND}else if(e<68159){if(68152<=e&&e<=68154)return gr.CLUSTER_BREAK.EXTEND}else if(68159===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<69373){if(e<68900){if(68325<=e&&e<=68326)return gr.CLUSTER_BREAK.EXTEND}else if(e<69291){if(68900<=e&&e<=68903)return gr.CLUSTER_BREAK.EXTEND}else if(69291<=e&&e<=69292)return gr.CLUSTER_BREAK.EXTEND}else if(e<69446){if(69373<=e&&e<=69375)return gr.CLUSTER_BREAK.EXTEND}else if(e<69506){if(69446<=e&&e<=69456)return gr.CLUSTER_BREAK.EXTEND}else if(69506<=e&&e<=69509)return gr.CLUSTER_BREAK.EXTEND}else if(e<70016){if(e<69815){if(e<69747){if(e<69634){if(69632===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(69633===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<69688){if(69634===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<69744){if(69688<=e&&e<=69702)return gr.CLUSTER_BREAK.EXTEND}else if(69744===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<69762){if(e<69759){if(69747<=e&&e<=69748)return gr.CLUSTER_BREAK.EXTEND}else if(69759<=e&&e<=69761)return gr.CLUSTER_BREAK.EXTEND}else if(e<69808){if(69762===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<69811){if(69808<=e&&e<=69810)return gr.CLUSTER_BREAK.SPACINGMARK}else if(69811<=e&&e<=69814)return gr.CLUSTER_BREAK.EXTEND}else if(e<69888)if(e<69821){if(e<69817){if(69815<=e&&e<=69816)return gr.CLUSTER_BREAK.SPACINGMARK}else if(69817<=e&&e<=69818)return gr.CLUSTER_BREAK.EXTEND}else if(e<69826){if(69821===e)return gr.CLUSTER_BREAK.PREPEND}else{if(69826===e)return gr.CLUSTER_BREAK.EXTEND;if(69837===e)return gr.CLUSTER_BREAK.PREPEND}else if(e<69933){if(e<69927){if(69888<=e&&e<=69890)return gr.CLUSTER_BREAK.EXTEND}else if(e<69932){if(69927<=e&&e<=69931)return gr.CLUSTER_BREAK.EXTEND}else if(69932===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<69957){if(69933<=e&&e<=69940)return gr.CLUSTER_BREAK.EXTEND}else if(e<70003){if(69957<=e&&e<=69958)return gr.CLUSTER_BREAK.SPACINGMARK}else if(70003===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<70194){if(e<70082){if(e<70067){if(e<70018){if(70016<=e&&e<=70017)return gr.CLUSTER_BREAK.EXTEND}else if(70018===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<70070){if(70067<=e&&e<=70069)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<70079){if(70070<=e&&e<=70078)return gr.CLUSTER_BREAK.EXTEND}else if(70079<=e&&e<=70080)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<70095){if(e<70089){if(70082<=e&&e<=70083)return gr.CLUSTER_BREAK.PREPEND}else if(e<70094){if(70089<=e&&e<=70092)return gr.CLUSTER_BREAK.EXTEND}else if(70094===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<70188){if(70095===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<70191){if(70188<=e&&e<=70190)return gr.CLUSTER_BREAK.SPACINGMARK}else if(70191<=e&&e<=70193)return gr.CLUSTER_BREAK.EXTEND}else if(e<70209){if(e<70197){if(e<70196){if(70194<=e&&e<=70195)return gr.CLUSTER_BREAK.SPACINGMARK}else if(70196===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<70198){if(70197===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<70206){if(70198<=e&&e<=70199)return gr.CLUSTER_BREAK.EXTEND}else if(70206===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<70371){if(e<70367){if(70209===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<70368){if(70367===e)return gr.CLUSTER_BREAK.EXTEND}else if(70368<=e&&e<=70370)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<70400){if(70371<=e&&e<=70378)return gr.CLUSTER_BREAK.EXTEND}else if(e<70402){if(70400<=e&&e<=70401)return gr.CLUSTER_BREAK.EXTEND}else if(70402<=e&&e<=70403)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<72343){if(e<71339){if(e<70841){if(e<70512){if(e<70471){if(e<70463){if(e<70462){if(70459<=e&&e<=70460)return gr.CLUSTER_BREAK.EXTEND}else if(70462===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<70464){if(70463===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<70465){if(70464===e)return gr.CLUSTER_BREAK.EXTEND}else if(70465<=e&&e<=70468)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<70487){if(e<70475){if(70471<=e&&e<=70472)return gr.CLUSTER_BREAK.SPACINGMARK}else if(70475<=e&&e<=70477)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<70498){if(70487===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<70502){if(70498<=e&&e<=70499)return gr.CLUSTER_BREAK.SPACINGMARK}else if(70502<=e&&e<=70508)return gr.CLUSTER_BREAK.EXTEND}else if(e<70725){if(e<70712){if(e<70709){if(70512<=e&&e<=70516)return gr.CLUSTER_BREAK.EXTEND}else if(70709<=e&&e<=70711)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<70720){if(70712<=e&&e<=70719)return gr.CLUSTER_BREAK.EXTEND}else if(e<70722){if(70720<=e&&e<=70721)return gr.CLUSTER_BREAK.SPACINGMARK}else if(70722<=e&&e<=70724)return gr.CLUSTER_BREAK.EXTEND}else if(e<70832)if(e<70726){if(70725===e)return gr.CLUSTER_BREAK.SPACINGMARK}else{if(70726===e)return gr.CLUSTER_BREAK.EXTEND;if(70750===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<70833){if(70832===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<70835){if(70833<=e&&e<=70834)return gr.CLUSTER_BREAK.SPACINGMARK}else if(70835<=e&&e<=70840)return gr.CLUSTER_BREAK.EXTEND}else if(e<71096){if(e<70847)if(e<70843){if(70841===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(70842===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<70845){if(70843<=e&&e<=70844)return gr.CLUSTER_BREAK.SPACINGMARK}else{if(70845===e)return gr.CLUSTER_BREAK.EXTEND;if(70846===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<71087){if(e<70849){if(70847<=e&&e<=70848)return gr.CLUSTER_BREAK.EXTEND}else if(e<70850){if(70849===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(70850<=e&&e<=70851)return gr.CLUSTER_BREAK.EXTEND}else if(e<71088){if(71087===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<71090){if(71088<=e&&e<=71089)return gr.CLUSTER_BREAK.SPACINGMARK}else if(71090<=e&&e<=71093)return gr.CLUSTER_BREAK.EXTEND}else if(e<71216){if(e<71102){if(e<71100){if(71096<=e&&e<=71099)return gr.CLUSTER_BREAK.SPACINGMARK}else if(71100<=e&&e<=71101)return gr.CLUSTER_BREAK.EXTEND}else if(e<71103){if(71102===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<71132){if(71103<=e&&e<=71104)return gr.CLUSTER_BREAK.EXTEND}else if(71132<=e&&e<=71133)return gr.CLUSTER_BREAK.EXTEND}else if(e<71229){if(e<71219){if(71216<=e&&e<=71218)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<71227){if(71219<=e&&e<=71226)return gr.CLUSTER_BREAK.EXTEND}else if(71227<=e&&e<=71228)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<71230){if(71229===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<71231){if(71230===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(71231<=e&&e<=71232)return gr.CLUSTER_BREAK.EXTEND}else if(e<71999)if(e<71463){if(e<71350){if(e<71341){if(71339===e)return gr.CLUSTER_BREAK.EXTEND;if(71340===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<71342){if(71341===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<71344){if(71342<=e&&e<=71343)return gr.CLUSTER_BREAK.SPACINGMARK}else if(71344<=e&&e<=71349)return gr.CLUSTER_BREAK.EXTEND}else if(e<71453){if(71350===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(71351===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<71458){if(71453<=e&&e<=71455)return gr.CLUSTER_BREAK.EXTEND}else if(e<71462){if(71458<=e&&e<=71461)return gr.CLUSTER_BREAK.EXTEND}else if(71462===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<71984){if(e<71727){if(e<71724){if(71463<=e&&e<=71467)return gr.CLUSTER_BREAK.EXTEND}else if(71724<=e&&e<=71726)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<71736){if(71727<=e&&e<=71735)return gr.CLUSTER_BREAK.EXTEND}else if(e<71737){if(71736===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(71737<=e&&e<=71738)return gr.CLUSTER_BREAK.EXTEND}else if(e<71995){if(e<71985){if(71984===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<71991){if(71985<=e&&e<=71989)return gr.CLUSTER_BREAK.SPACINGMARK}else if(71991<=e&&e<=71992)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<71997){if(71995<=e&&e<=71996)return gr.CLUSTER_BREAK.EXTEND}else{if(71997===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(71998===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<72193)if(e<72145)if(e<72001){if(71999===e)return gr.CLUSTER_BREAK.PREPEND;if(72e3===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<72002){if(72001===e)return gr.CLUSTER_BREAK.PREPEND}else{if(72002===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(72003===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<72156){if(e<72148){if(72145<=e&&e<=72147)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<72154){if(72148<=e&&e<=72151)return gr.CLUSTER_BREAK.EXTEND}else if(72154<=e&&e<=72155)return gr.CLUSTER_BREAK.EXTEND}else if(e<72160){if(72156<=e&&e<=72159)return gr.CLUSTER_BREAK.SPACINGMARK}else{if(72160===e)return gr.CLUSTER_BREAK.EXTEND;if(72164===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<72263){if(e<72249){if(e<72243){if(72193<=e&&e<=72202)return gr.CLUSTER_BREAK.EXTEND}else if(72243<=e&&e<=72248)return gr.CLUSTER_BREAK.EXTEND}else if(e<72250){if(72249===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<72251){if(72250===e)return gr.CLUSTER_BREAK.PREPEND}else if(72251<=e&&e<=72254)return gr.CLUSTER_BREAK.EXTEND}else if(e<72281){if(e<72273){if(72263===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<72279){if(72273<=e&&e<=72278)return gr.CLUSTER_BREAK.EXTEND}else if(72279<=e&&e<=72280)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<72324){if(72281<=e&&e<=72283)return gr.CLUSTER_BREAK.EXTEND}else if(e<72330){if(72324<=e&&e<=72329)return gr.CLUSTER_BREAK.PREPEND}else if(72330<=e&&e<=72342)return gr.CLUSTER_BREAK.EXTEND}else if(e<94033){if(e<73104){if(e<72881){if(e<72766){if(e<72751){if(e<72344){if(72343===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(72344<=e&&e<=72345)return gr.CLUSTER_BREAK.EXTEND}else if(e<72752){if(72751===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<72760){if(72752<=e&&e<=72758)return gr.CLUSTER_BREAK.EXTEND}else if(72760<=e&&e<=72765)return gr.CLUSTER_BREAK.EXTEND}else if(e<72850){if(72766===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(72767===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<72873){if(72850<=e&&e<=72871)return gr.CLUSTER_BREAK.EXTEND}else if(e<72874){if(72873===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(72874<=e&&e<=72880)return gr.CLUSTER_BREAK.EXTEND}else if(e<73018){if(e<72884){if(e<72882){if(72881===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(72882<=e&&e<=72883)return gr.CLUSTER_BREAK.EXTEND}else if(e<72885){if(72884===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<73009){if(72885<=e&&e<=72886)return gr.CLUSTER_BREAK.EXTEND}else if(73009<=e&&e<=73014)return gr.CLUSTER_BREAK.EXTEND}else if(e<73030){if(e<73020){if(73018===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<73023){if(73020<=e&&e<=73021)return gr.CLUSTER_BREAK.EXTEND}else if(73023<=e&&e<=73029)return gr.CLUSTER_BREAK.EXTEND}else if(e<73031){if(73030===e)return gr.CLUSTER_BREAK.PREPEND}else if(e<73098){if(73031===e)return gr.CLUSTER_BREAK.EXTEND}else if(73098<=e&&e<=73102)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<73526){if(e<73459)if(e<73109){if(e<73107){if(73104<=e&&e<=73105)return gr.CLUSTER_BREAK.EXTEND}else if(73107<=e&&e<=73108)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<73110){if(73109===e)return gr.CLUSTER_BREAK.EXTEND}else{if(73110===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(73111===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<73474){if(e<73461){if(73459<=e&&e<=73460)return gr.CLUSTER_BREAK.EXTEND}else if(e<73472){if(73461<=e&&e<=73462)return gr.CLUSTER_BREAK.SPACINGMARK}else if(73472<=e&&e<=73473)return gr.CLUSTER_BREAK.EXTEND}else if(e<73475){if(73474===e)return gr.CLUSTER_BREAK.PREPEND}else if(e<73524){if(73475===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(73524<=e&&e<=73525)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<78896)if(e<73536){if(e<73534){if(73526<=e&&e<=73530)return gr.CLUSTER_BREAK.EXTEND}else if(73534<=e&&e<=73535)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<73537){if(73536===e)return gr.CLUSTER_BREAK.EXTEND}else{if(73537===e)return gr.CLUSTER_BREAK.SPACINGMARK;if(73538===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<92912){if(e<78912){if(78896<=e&&e<=78911)return gr.CLUSTER_BREAK.CONTROL}else if(e<78919){if(78912===e)return gr.CLUSTER_BREAK.EXTEND}else if(78919<=e&&e<=78933)return gr.CLUSTER_BREAK.EXTEND}else if(e<92976){if(92912<=e&&e<=92916)return gr.CLUSTER_BREAK.EXTEND}else if(e<94031){if(92976<=e&&e<=92982)return gr.CLUSTER_BREAK.EXTEND}else if(94031===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<121476){if(e<119143)if(e<113824){if(e<94180){if(e<94095){if(94033<=e&&e<=94087)return gr.CLUSTER_BREAK.SPACINGMARK}else if(94095<=e&&e<=94098)return gr.CLUSTER_BREAK.EXTEND}else if(e<94192){if(94180===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<113821){if(94192<=e&&e<=94193)return gr.CLUSTER_BREAK.SPACINGMARK}else if(113821<=e&&e<=113822)return gr.CLUSTER_BREAK.EXTEND}else if(e<118576){if(e<118528){if(113824<=e&&e<=113827)return gr.CLUSTER_BREAK.CONTROL}else if(118528<=e&&e<=118573)return gr.CLUSTER_BREAK.EXTEND}else if(e<119141){if(118576<=e&&e<=118598)return gr.CLUSTER_BREAK.EXTEND}else{if(119141===e)return gr.CLUSTER_BREAK.EXTEND;if(119142===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<119173){if(e<119150){if(e<119149){if(119143<=e&&e<=119145)return gr.CLUSTER_BREAK.EXTEND}else if(119149===e)return gr.CLUSTER_BREAK.SPACINGMARK}else if(e<119155){if(119150<=e&&e<=119154)return gr.CLUSTER_BREAK.EXTEND}else if(e<119163){if(119155<=e&&e<=119162)return gr.CLUSTER_BREAK.CONTROL}else if(119163<=e&&e<=119170)return gr.CLUSTER_BREAK.EXTEND}else if(e<121344){if(e<119210){if(119173<=e&&e<=119179)return gr.CLUSTER_BREAK.EXTEND}else if(e<119362){if(119210<=e&&e<=119213)return gr.CLUSTER_BREAK.EXTEND}else if(119362<=e&&e<=119364)return gr.CLUSTER_BREAK.EXTEND}else if(e<121403){if(121344<=e&&e<=121398)return gr.CLUSTER_BREAK.EXTEND}else if(e<121461){if(121403<=e&&e<=121452)return gr.CLUSTER_BREAK.EXTEND}else if(121461===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<123628){if(e<122907){if(e<121505){if(e<121499){if(121476===e)return gr.CLUSTER_BREAK.EXTEND}else if(121499<=e&&e<=121503)return gr.CLUSTER_BREAK.EXTEND}else if(e<122880){if(121505<=e&&e<=121519)return gr.CLUSTER_BREAK.EXTEND}else if(e<122888){if(122880<=e&&e<=122886)return gr.CLUSTER_BREAK.EXTEND}else if(122888<=e&&e<=122904)return gr.CLUSTER_BREAK.EXTEND}else if(e<123023){if(e<122915){if(122907<=e&&e<=122913)return gr.CLUSTER_BREAK.EXTEND}else if(e<122918){if(122915<=e&&e<=122916)return gr.CLUSTER_BREAK.EXTEND}else if(122918<=e&&e<=122922)return gr.CLUSTER_BREAK.EXTEND}else if(e<123184){if(123023===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<123566){if(123184<=e&&e<=123190)return gr.CLUSTER_BREAK.EXTEND}else if(123566===e)return gr.CLUSTER_BREAK.EXTEND}else if(e<127995){if(e<125136){if(e<124140){if(123628<=e&&e<=123631)return gr.CLUSTER_BREAK.EXTEND}else if(124140<=e&&e<=124143)return gr.CLUSTER_BREAK.EXTEND}else if(e<125252){if(125136<=e&&e<=125142)return gr.CLUSTER_BREAK.EXTEND}else if(e<127462){if(125252<=e&&e<=125258)return gr.CLUSTER_BREAK.EXTEND}else if(127462<=e&&e<=127487)return gr.CLUSTER_BREAK.REGIONAL_INDICATOR}else if(e<917632){if(e<917504){if(127995<=e&&e<=127999)return gr.CLUSTER_BREAK.EXTEND}else if(e<917536){if(917504<=e&&e<=917535)return gr.CLUSTER_BREAK.CONTROL}else if(917536<=e&&e<=917631)return gr.CLUSTER_BREAK.EXTEND}else if(e<917760){if(917632<=e&&e<=917759)return gr.CLUSTER_BREAK.CONTROL}else if(e<918e3){if(917760<=e&&e<=917999)return gr.CLUSTER_BREAK.EXTEND}else if(918e3<=e&&e<=921599)return gr.CLUSTER_BREAK.CONTROL;return gr.CLUSTER_BREAK.OTHER}static getEmojiProperty(e){if(e<10160){if(e<9728){if(e<9e3){if(e<8482)if(e<8252){if(169===e)return gr.EXTENDED_PICTOGRAPHIC;if(174===e)return gr.EXTENDED_PICTOGRAPHIC}else{if(8252===e)return gr.EXTENDED_PICTOGRAPHIC;if(8265===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<8596){if(8482===e)return gr.EXTENDED_PICTOGRAPHIC;if(8505===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<8617){if(8596<=e&&e<=8601)return gr.EXTENDED_PICTOGRAPHIC}else if(e<8986){if(8617<=e&&e<=8618)return gr.EXTENDED_PICTOGRAPHIC}else if(8986<=e&&e<=8987)return gr.EXTENDED_PICTOGRAPHIC}else if(e<9410){if(e<9167){if(9e3===e)return gr.EXTENDED_PICTOGRAPHIC;if(9096===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<9193){if(9167===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<9208){if(9193<=e&&e<=9203)return gr.EXTENDED_PICTOGRAPHIC}else if(9208<=e&&e<=9210)return gr.EXTENDED_PICTOGRAPHIC}else if(e<9654){if(e<9642){if(9410===e)return gr.EXTENDED_PICTOGRAPHIC}else if(9642<=e&&e<=9643)return gr.EXTENDED_PICTOGRAPHIC}else if(e<9664){if(9654===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<9723){if(9664===e)return gr.EXTENDED_PICTOGRAPHIC}else if(9723<=e&&e<=9726)return gr.EXTENDED_PICTOGRAPHIC}else if(e<10035)if(e<10004){if(e<9748){if(e<9735){if(9728<=e&&e<=9733)return gr.EXTENDED_PICTOGRAPHIC}else if(9735<=e&&e<=9746)return gr.EXTENDED_PICTOGRAPHIC}else if(e<9872){if(9748<=e&&e<=9861)return gr.EXTENDED_PICTOGRAPHIC}else if(e<9992){if(9872<=e&&e<=9989)return gr.EXTENDED_PICTOGRAPHIC}else if(9992<=e&&e<=10002)return gr.EXTENDED_PICTOGRAPHIC}else if(e<10013){if(10004===e)return gr.EXTENDED_PICTOGRAPHIC;if(10006===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<10017){if(10013===e)return gr.EXTENDED_PICTOGRAPHIC}else{if(10017===e)return gr.EXTENDED_PICTOGRAPHIC;if(10024===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<10067)if(e<10055){if(e<10052){if(10035<=e&&e<=10036)return gr.EXTENDED_PICTOGRAPHIC}else if(10052===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<10060){if(10055===e)return gr.EXTENDED_PICTOGRAPHIC}else{if(10060===e)return gr.EXTENDED_PICTOGRAPHIC;if(10062===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<10083){if(e<10071){if(10067<=e&&e<=10069)return gr.EXTENDED_PICTOGRAPHIC}else if(10071===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<10133){if(10083<=e&&e<=10087)return gr.EXTENDED_PICTOGRAPHIC}else if(e<10145){if(10133<=e&&e<=10135)return gr.EXTENDED_PICTOGRAPHIC}else if(10145===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<127489){if(e<12951)if(e<11035){if(e<10548){if(10160===e)return gr.EXTENDED_PICTOGRAPHIC;if(10175===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<11013){if(10548<=e&&e<=10549)return gr.EXTENDED_PICTOGRAPHIC}else if(11013<=e&&e<=11015)return gr.EXTENDED_PICTOGRAPHIC}else if(e<11093){if(e<11088){if(11035<=e&&e<=11036)return gr.EXTENDED_PICTOGRAPHIC}else if(11088===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<12336){if(11093===e)return gr.EXTENDED_PICTOGRAPHIC}else{if(12336===e)return gr.EXTENDED_PICTOGRAPHIC;if(12349===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<127340){if(e<126976){if(12951===e)return gr.EXTENDED_PICTOGRAPHIC;if(12953===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<127245){if(126976<=e&&e<=127231)return gr.EXTENDED_PICTOGRAPHIC}else if(e<127279){if(127245<=e&&e<=127247)return gr.EXTENDED_PICTOGRAPHIC}else if(127279===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<127374){if(e<127358){if(127340<=e&&e<=127345)return gr.EXTENDED_PICTOGRAPHIC}else if(127358<=e&&e<=127359)return gr.EXTENDED_PICTOGRAPHIC}else if(e<127377){if(127374===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<127405){if(127377<=e&&e<=127386)return gr.EXTENDED_PICTOGRAPHIC}else if(127405<=e&&e<=127461)return gr.EXTENDED_PICTOGRAPHIC}else if(e<128981){if(e<127561){if(e<127535){if(e<127514){if(127489<=e&&e<=127503)return gr.EXTENDED_PICTOGRAPHIC}else if(127514===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<127538){if(127535===e)return gr.EXTENDED_PICTOGRAPHIC}else if(e<127548){if(127538<=e&&e<=127546)return gr.EXTENDED_PICTOGRAPHIC}else if(127548<=e&&e<=127551)return gr.EXTENDED_PICTOGRAPHIC}else if(e<128326){if(e<128e3){if(127561<=e&&e<=127994)return gr.EXTENDED_PICTOGRAPHIC}else if(128e3<=e&&e<=128317)return gr.EXTENDED_PICTOGRAPHIC}else if(e<128640){if(128326<=e&&e<=128591)return gr.EXTENDED_PICTOGRAPHIC}else if(e<128884){if(128640<=e&&e<=128767)return gr.EXTENDED_PICTOGRAPHIC}else if(128884<=e&&e<=128895)return gr.EXTENDED_PICTOGRAPHIC}else if(e<129198){if(e<129096){if(e<129036){if(128981<=e&&e<=129023)return gr.EXTENDED_PICTOGRAPHIC}else if(129036<=e&&e<=129039)return gr.EXTENDED_PICTOGRAPHIC}else if(e<129114){if(129096<=e&&e<=129103)return gr.EXTENDED_PICTOGRAPHIC}else if(e<129160){if(129114<=e&&e<=129119)return gr.EXTENDED_PICTOGRAPHIC}else if(129160<=e&&e<=129167)return gr.EXTENDED_PICTOGRAPHIC}else if(e<129340){if(e<129292){if(129198<=e&&e<=129279)return gr.EXTENDED_PICTOGRAPHIC}else if(129292<=e&&e<=129338)return gr.EXTENDED_PICTOGRAPHIC}else if(e<129351){if(129340<=e&&e<=129349)return gr.EXTENDED_PICTOGRAPHIC}else if(e<130048){if(129351<=e&&e<=129791)return gr.EXTENDED_PICTOGRAPHIC}else if(130048<=e&&e<=131069)return gr.EXTENDED_PICTOGRAPHIC;return gr.CLUSTER_BREAK.OTHER}}ur.default=wr;var Rr=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dr,"__esModule",{value:!0});const Ar=Rr(ur);dr.default=Ar.default;var _r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),Sr=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),kr=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&_r(t,e,r);return Sr(t,e),t},Tr=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lr,"__esModule",{value:!0}),lr.validateLanguage=lr.parseLanguage=lr.b64UrlToUtf8=lr.utf8ToB64Url=lr.graphemeLen=lr.utf8Len=void 0;const Cr=Tr(dr),Lr=kr(nr);lr.utf8Len=e=>(new TextEncoder).encode(e).byteLength;lr.graphemeLen=e=>(new Cr.default).countGraphemes(e);lr.utf8ToB64Url=e=>Lr.toString(Lr.fromString(e,"utf8"),"base64url");lr.b64UrlToUtf8=e=>Lr.toString(Lr.fromString(e,"base64url"),"utf8");lr.parseLanguage=e=>{const t=e.match(Pr);if(!t?.groups)return null;const r=t.groups;return{grandfathered:r.grandfathered,language:r.language,extlang:r.extlang,script:r.script,region:r.region,variant:r.variant,extension:r.extension,privateUse:r.privateUseA||r.privateUseB}};lr.validateLanguage=e=>Pr.test(e);const Pr=/^((?<grandfathered>(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?<language>([A-Za-z]{2,3}(-(?<extlang>[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?<script>[A-Za-z]{4}))?(-(?<region>[A-Za-z]{2}|[0-9]{3}))?(-(?<variant>[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?<extension>[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?<privateUseA>x(-[A-Za-z0-9]{1,8})+))?)|(?<privateUseB>x(-[A-Za-z0-9]{1,8})+))$/;var xr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.didDocument=e.getServiceEndpoint=e.getNotifEndpoint=e.getFeedGenEndpoint=e.getPdsEndpoint=e.getSigningDidKey=e.getVerificationMaterial=e.getSigningKey=e.getHandle=e.getDid=e.isValidDidDoc=void 0;const t=S;e.isValidDidDoc=t=>e.didDocument.safeParse(t).success;e.getDid=e=>{const t=e.id;if("string"!=typeof t)throw new Error("No `id` on document");return t};e.getHandle=e=>{const t=e.alsoKnownAs;if(t)for(let e=0;e<t.length;e++){const r=t[e];if(r.startsWith("at://"))return r.slice(5)}};e.getSigningKey=t=>(0,e.getVerificationMaterial)(t,"atproto");e.getVerificationMaterial=(e,t)=>{const n=r(e,"verificationMethod",`#${t}`);if(n&&n.publicKeyMultibase)return{type:n.type,publicKeyMultibase:n.publicKeyMultibase}};e.getSigningDidKey=t=>{const r=(0,e.getSigningKey)(t);if(r)return`did:key:${r.publicKeyMultibase}`};e.getPdsEndpoint=t=>(0,e.getServiceEndpoint)(t,{id:"#atproto_pds",type:"AtprotoPersonalDataServer"});e.getFeedGenEndpoint=t=>(0,e.getServiceEndpoint)(t,{id:"#bsky_fg",type:"BskyFeedGenerator"});e.getNotifEndpoint=t=>(0,e.getServiceEndpoint)(t,{id:"#bsky_notif",type:"BskyNotificationService"});function r(e,t,r){const n=e[t];if(n)for(let t=0;t<n.length;t++){const o=n[t],i=o.id;if("#"===i[0]?i===r:i.length===e.id.length+r.length&&"#"===i[e.id.length]&&i.endsWith(r)&&i.startsWith(e.id))return o}}e.getServiceEndpoint=(e,t)=>{const o=r(e,"service",t.id);if(o&&(!t.type||o.type===t.type)&&"string"==typeof o.serviceEndpoint)return n(o.serviceEndpoint)};const n=e=>{if((e.startsWith("http://")||e.startsWith("https://"))&&o(e))return e},o=URL.canParse??(e=>{try{return new URL(e),!0}catch{return!1}}),i=t.z.object({id:t.z.string(),type:t.z.string(),controller:t.z.string(),publicKeyMultibase:t.z.string().optional()}),s=t.z.object({id:t.z.string(),type:t.z.string(),serviceEndpoint:t.z.union([t.z.string(),t.z.record(t.z.unknown())])});e.didDocument=t.z.object({id:t.z.string(),alsoKnownAs:t.z.array(t.z.string()).optional(),verificationMethod:t.z.array(i).optional(),service:t.z.array(s).optional()})}(xr),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t},i=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.util=t.check=void 0,t.check=o(de),t.util=o(ue),i(pe,t),i(fe,t),i(ue,t),i(he,t),i(we,t),i(or,t),i(ar,t),i(cr,t),i(lr,t),i(xr,t)}(le),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BlobRef=e.jsonBlobRef=e.untypedJsonBlobRef=e.typedJsonBlobRef=void 0;const t=le,r=kt,n=S;e.typedJsonBlobRef=n.z.object({$type:n.z.literal("blob"),ref:t.schema.cid,mimeType:n.z.string(),size:n.z.number()}).strict(),e.untypedJsonBlobRef=n.z.object({cid:n.z.string(),mimeType:n.z.string()}).strict(),e.jsonBlobRef=n.z.union([e.typedJsonBlobRef,e.untypedJsonBlobRef]);class o{constructor(e,t,r,n){Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"mimeType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"original",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.original=n??{$type:"blob",ref:e,mimeType:t,size:r}}static asBlobRef(r){return t.check.is(r,e.jsonBlobRef)?o.fromJsonRef(r):null}static fromJsonRef(n){return t.check.is(n,e.typedJsonBlobRef)?new o(n.ref,n.mimeType,n.size):new o(r.CID.parse(n.cid),n.mimeType,-1,n)}ipld(){return{$type:"blob",ref:this.ref,mimeType:this.mimeType,size:this.size}}toJSON(){return(0,t.ipldToJson)(this.ipld())}}e.BlobRef=o}(ce),Object.defineProperty(ae,"__esModule",{value:!0}),ae.blob=function(e,t,r,n){if(!(n&&n instanceof Br.BlobRef))return{success:!1,error:new jr.ValidationError(`${t} should be a blob ref`)};return{success:!0,value:n}};const Br=ce,jr=_;var Dr={},Or={},Ur={};!function(e){(()=>{var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};function n(e,t){return void 0===t&&(t="-"),new RegExp("^(?!0{4}"+t+"0{2}"+t+"0{2})((?=[0-9]{4}"+t+"(((0[^2])|1[0-2])|02(?="+t+"(([0-1][0-9])|2[0-8])))"+t+"[0-9]{2})|(?=((([13579][26])|([2468][048])|(0[48]))0{2})|([0-9]{2}((((0|[2468])[48])|[2468][048])|([13579][26])))"+t+"02"+t+"29))([0-9]{4})"+t+"(?!((0[469])|11)"+t+"31)((0[1,3-9]|1[0-2])|(02(?!"+t+"3)))"+t+"(0[1-9]|[1-2][0-9]|3[0-1])$").test(e)}function o(e){var t=/\D/.exec(e);return t?t[0]:""}function i(e,t,r){void 0===t&&(t=":"),void 0===r&&(r=!1);var n=new RegExp("^([0-1]|2(?=([0-3])|4"+t+"00))[0-9]"+t+"[0-5][0-9]("+t+"([0-5]|6(?=0))[0-9])?(.[0-9]{1,9})?$");if(!r||!/[Z+\-]/.test(e))return n.test(e);if(/Z$/.test(e))return n.test(e.replace("Z",""));var i=e.includes("+"),s=e.split(/[+-]/),a=s[0],c=s[1];return n.test(a)&&function(e,t,r){return void 0===r&&(r=":"),new RegExp(t?"^(0(?!(2"+r+"4)|0"+r+"3)|1(?=([0-1]|2(?="+r+"[04])|[34](?="+r+"0))))([03469](?="+r+"[03])|[17](?="+r+"0)|2(?="+r+"[04])|5(?="+r+"[034])|8(?="+r+"[04]))"+r+"([03](?=0)|4(?=5))[05]$":"^(0(?=[^0])|1(?=[0-2]))([39](?="+r+"[03])|[0-24-8](?="+r+"00))"+r+"[03]0$").test(e)}(c,i,o(c))}function s(e){var t=e.split("T"),r=t[0],s=t[1],a=n(r,o(r));if(!s)return!1;var c,l=(c=s.match(/([^Z+\-\d])(?=\d+\1)/),Array.isArray(c)?c[0]:"");return a&&i(s,l,!0)}function a(e,t){return void 0===t&&(t="-"),new RegExp("^[0-9]{4}"+t+"(0(?=[^0])|1(?=[0-2]))[0-9]$").test(e)}t.r(r),t.d(r,{isValidDate:()=>n,isValidISODateString:()=>s,isValidTime:()=>i,isValidYearMonth:()=>a});var c=e;for(var l in r)c[l]=r[l];r.__esModule&&Object.defineProperty(c,"__esModule",{value:!0})})()}(Ur),Object.defineProperty(Or,"__esModule",{value:!0}),Or.datetime=function(e,t){try{if(!(0,Ir.isValidISODateString)(t))throw new Error}catch{return{success:!1,error:new Mr.ValidationError(`${e} must be an valid atproto datetime (both RFC-3339 and ISO-8601)`)}}return{success:!0,value:t}},Or.uri=function(e,t){const r=null!==t.match(/^\w+:(?:\/\/)?[^\s/][^\s]*$/);if(!r)return{success:!1,error:new Mr.ValidationError(`${e} must be a uri`)};return{success:!0,value:t}},Or.atUri=function(e,t){try{(0,Vr.ensureValidAtUri)(t)}catch{return{success:!1,error:new Mr.ValidationError(`${e} must be a valid at-uri`)}}return{success:!0,value:t}},Or.did=zr,Or.handle=Fr,Or.atIdentifier=function(e,t){const r=zr(e,t);if(!r.success){if(!Fr(e,t).success)return{success:!1,error:new Mr.ValidationError(`${e} must be a valid did or a handle`)}}return{success:!0,value:t}},Or.nsid=function(e,t){try{(0,Vr.ensureValidNsid)(t)}catch{return{success:!1,error:new Mr.ValidationError(`${e} must be a valid nsid`)}}return{success:!0,value:t}},Or.cid=function(e,t){try{Kr.CID.parse(t)}catch{return{success:!1,error:new Mr.ValidationError(`${e} must be a cid string`)}}return{success:!0,value:t}},Or.language=function(e,t){if((0,Nr.validateLanguage)(t))return{success:!0,value:t};return{success:!1,error:new Mr.ValidationError(`${e} must be a well-formed BCP 47 language tag`)}},Or.tid=function(e,t){try{(0,Vr.ensureValidTid)(t)}catch{return{success:!1,error:new Mr.ValidationError(`${e} must be a valid TID (timestamp identifier)`)}}return{success:!0,value:t}},Or.recordKey=function(e,t){try{(0,Vr.ensureValidRecordKey)(t)}catch{return{success:!1,error:new Mr.ValidationError(`${e} must be a valid Record Key`)}}return{success:!0,value:t}};const Ir=Ur,Kr=kt,Mr=_,Vr=F,Nr=le;function zr(e,t){try{(0,Vr.ensureValidDid)(t)}catch{return{success:!1,error:new Mr.ValidationError(`${e} must be a valid did`)}}return{success:!0,value:t}}function Fr(e,t){try{(0,Vr.ensureValidHandle)(t)}catch{return{success:!1,error:new Mr.ValidationError(`${e} must be a valid handle`)}}return{success:!0,value:t}}var qr=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),$r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Gr=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&qr(t,e,r);return $r(t,e),t};Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.validate=function(e,t,r,n){switch(r.type){case"boolean":return Jr(e,t,r,n);case"integer":return Qr(e,t,r,n);case"string":return Yr(e,t,r,n);case"bytes":return en(e,t,r,n);case"cid-link":return tn(e,t,r,n);case"unknown":return rn(e,t,r,n);default:return{success:!1,error:new Zr.ValidationError(`Unexpected lexicon type: ${r.type}`)}}},Dr.boolean=Jr,Dr.integer=Qr,Dr.string=Yr,Dr.bytes=en,Dr.cidLink=tn,Dr.unknown=rn;const Hr=le,Xr=kt,Wr=Gr(Or),Zr=_;function Jr(e,t,r,n){const o=typeof n;return"undefined"===o?"boolean"==typeof r.default?{success:!0,value:r.default}:{success:!1,error:new Zr.ValidationError(`${t} must be a boolean`)}:"boolean"!==o?{success:!1,error:new Zr.ValidationError(`${t} must be a boolean`)}:"boolean"==typeof r.const&&n!==r.const?{success:!1,error:new Zr.ValidationError(`${t} must be ${r.const}`)}:{success:!0,value:n}}function Qr(e,t,r,n){return"undefined"===typeof n?"number"==typeof r.default?{success:!0,value:r.default}:{success:!1,error:new Zr.ValidationError(`${t} must be an integer`)}:Number.isInteger(n)?"number"==typeof r.const&&n!==r.const?{success:!1,error:new Zr.ValidationError(`${t} must be ${r.const}`)}:Array.isArray(r.enum)&&!r.enum.includes(n)?{success:!1,error:new Zr.ValidationError(`${t} must be one of (${r.enum.join("|")})`)}:"number"==typeof r.maximum&&n>r.maximum?{success:!1,error:new Zr.ValidationError(`${t} can not be greater than ${r.maximum}`)}:"number"==typeof r.minimum&&n<r.minimum?{success:!1,error:new Zr.ValidationError(`${t} can not be less than ${r.minimum}`)}:{success:!0,value:n}:{success:!1,error:new Zr.ValidationError(`${t} must be an integer`)}}function Yr(e,t,r,n){if(void 0===n)return"string"==typeof r.default?{success:!0,value:r.default}:{success:!1,error:new Zr.ValidationError(`${t} must be a string`)};if("string"!=typeof n)return{success:!1,error:new Zr.ValidationError(`${t} must be a string`)};if("string"==typeof r.const&&n!==r.const)return{success:!1,error:new Zr.ValidationError(`${t} must be ${r.const}`)};if(Array.isArray(r.enum)&&!r.enum.includes(n))return{success:!1,error:new Zr.ValidationError(`${t} must be one of (${r.enum.join("|")})`)};if("number"==typeof r.maxLength||"number"==typeof r.minLength){const e=(0,Hr.utf8Len)(n);if("number"==typeof r.maxLength&&e>r.maxLength)return{success:!1,error:new Zr.ValidationError(`${t} must not be longer than ${r.maxLength} characters`)};if("number"==typeof r.minLength&&e<r.minLength)return{success:!1,error:new Zr.ValidationError(`${t} must not be shorter than ${r.minLength} characters`)}}if("number"==typeof r.maxGraphemes||"number"==typeof r.minGraphemes){let e=!1,o=!1;if("number"==typeof r.maxGraphemes&&(e=!(n.length<=r.maxGraphemes)),"number"==typeof r.minGraphemes){if(n.length<r.minGraphemes)return{success:!1,error:new Zr.ValidationError(`${t} must not be shorter than ${r.minGraphemes} graphemes`)};o=!0}if(e||o){const e=(0,Hr.graphemeLen)(n);if("number"==typeof r.maxGraphemes&&e>r.maxGraphemes)return{success:!1,error:new Zr.ValidationError(`${t} must not be longer than ${r.maxGraphemes} graphemes`)};if("number"==typeof r.minGraphemes&&e<r.minGraphemes)return{success:!1,error:new Zr.ValidationError(`${t} must not be shorter than ${r.minGraphemes} graphemes`)}}}if("string"==typeof r.format)switch(r.format){case"datetime":return Wr.datetime(t,n);case"uri":return Wr.uri(t,n);case"at-uri":return Wr.atUri(t,n);case"did":return Wr.did(t,n);case"handle":return Wr.handle(t,n);case"at-identifier":return Wr.atIdentifier(t,n);case"nsid":return Wr.nsid(t,n);case"cid":return Wr.cid(t,n);case"language":return Wr.language(t,n);case"tid":return Wr.tid(t,n);case"record-key":return Wr.recordKey(t,n)}return{success:!0,value:n}}function en(e,t,r,n){return n&&n instanceof Uint8Array?"number"==typeof r.maxLength&&n.byteLength>r.maxLength?{success:!1,error:new Zr.ValidationError(`${t} must not be larger than ${r.maxLength} bytes`)}:"number"==typeof r.minLength&&n.byteLength<r.minLength?{success:!1,error:new Zr.ValidationError(`${t} must not be smaller than ${r.minLength} bytes`)}:{success:!0,value:n}:{success:!1,error:new Zr.ValidationError(`${t} must be a byte array`)}}function tn(e,t,r,n){return null===Xr.CID.asCID(n)?{success:!1,error:new Zr.ValidationError(`${t} must be a CID`)}:{success:!0,value:n}}function rn(e,t,r,n){return n&&"object"==typeof n?{success:!0,value:n}:{success:!1,error:new Zr.ValidationError(`${t} must be an object`)}}Object.defineProperty(se,"__esModule",{value:!0}),se.validate=cn,se.array=ln,se.object=dn,se.validateOneOf=un;const nn=_,on=re,sn=ae,an=Dr;function cn(e,t,r,n){switch(r.type){case"boolean":return(0,an.boolean)(e,t,r,n);case"integer":return(0,an.integer)(e,t,r,n);case"string":return(0,an.string)(e,t,r,n);case"bytes":return(0,an.bytes)(e,t,r,n);case"cid-link":return(0,an.cidLink)(e,t,r,n);case"unknown":return(0,an.unknown)(e,t,r,n);case"object":return dn(e,t,r,n);case"array":return ln(e,t,r,n);case"blob":return(0,sn.blob)(e,t,r,n);default:return{success:!1,error:new nn.ValidationError(`Unexpected lexicon type: ${r.type}`)}}}function ln(e,t,r,n){if(!Array.isArray(n))return{success:!1,error:new nn.ValidationError(`${t} must be an array`)};if("number"==typeof r.maxLength&&n.length>r.maxLength)return{success:!1,error:new nn.ValidationError(`${t} must not have more than ${r.maxLength} elements`)};if("number"==typeof r.minLength&&n.length<r.minLength)return{success:!1,error:new nn.ValidationError(`${t} must not have fewer than ${r.minLength} elements`)};const o=r.items;for(let r=0;r<n.length;r++){const i=un(e,`${t}/${r}`,o,n[r]);if(!i.success)return i}return{success:!0,value:n}}function dn(e,t,r,n){if(!n||"object"!=typeof n)return{success:!1,error:new nn.ValidationError(`${t} must be an object`)};const o=new Set(r.required),i=new Set(r.nullable);let s=n;if("object"==typeof r.properties)for(const a in r.properties){if(null===n[a]&&i.has(a))continue;const c=r.properties[a];if(void 0===n[a]&&!o.has(a)){if("integer"!==c.type&&"boolean"!==c.type&&"string"!==c.type)continue;if(void 0===c.default)continue}const l=un(e,`${t}/${a}`,c,n[a]),d=l.success?l.value:n[a],u=void 0===d;if(u&&o.has(a))return{success:!1,error:new nn.ValidationError(`${t} must have the property "${a}"`)};if(!u&&!l.success)return l;d!==n[a]&&(s===n&&(s={...n}),s[a]=d)}return{success:!0,value:s}}function un(e,t,r,n,o=!1){let i,s;if("union"===r.type){if(!(0,nn.isDiscriminatedObject)(n))return{success:!1,error:new nn.ValidationError(`${t} must be an object which includes the "$type" property`)};if(!pn(r.refs,n.$type))return r.closed?{success:!1,error:new nn.ValidationError(`${t} $type must be one of ${r.refs.join(", ")}`)}:{success:!0,value:n};s=(0,on.toConcreteTypes)(e,{type:"ref",ref:n.$type})}else s=(0,on.toConcreteTypes)(e,r);for(const r of s){const s=o?dn(e,t,r,n):cn(e,t,r,n);if(s.success)return s;i??(i=s.error)}return s.length>1?{success:!1,error:new nn.ValidationError(`${t} did not match any of the expected definitions`)}:{success:!1,error:i}}const pn=(e,t)=>{const r=(0,on.toLexUri)(t);return!!e.includes(r)||(r.endsWith("#main")?e.includes(r.replace("#main","")):e.includes(r+"#main"))};var fn={},hn=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),yn=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mn=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&hn(t,e,r);return yn(t,e),t};Object.defineProperty(fn,"__esModule",{value:!0}),fn.params=function(e,t,r,n){const o=n&&"object"==typeof n?n:{},i=new Set(r.required??[]);let s=o;if("object"==typeof r.properties)for(const n in r.properties){const a=r.properties[n],c="array"===a.type?(0,vn.array)(e,n,a,o[n]):gn.validate(e,n,a,o[n]),l=c.success?c.value:o[n],d=void 0===l;if(d&&i.has(n))return{success:!1,error:new bn.ValidationError(`${t} must have the property "${n}"`)};if(!d&&!c.success)return c;l!==o[n]&&(s===o&&(s={...o}),s[n]=l)}return{success:!0,value:s}};const bn=_,gn=mn(Dr),vn=se;Object.defineProperty(ie,"__esModule",{value:!0}),ie.assertValidRecord=function(e,t,r){const n=(0,En.object)(e,"Record",t.record,r);if(!n.success)throw n.error;return n.value},ie.assertValidXrpcParams=function(e,t,r){if(t.parameters){const n=(0,wn.params)(e,"Params",t.parameters,r);if(!n.success)throw n.error;return n.value}},ie.assertValidXrpcInput=function(e,t,r){if(t.input?.schema)return Rn(e,"Input",t.input.schema,r,!0)},ie.assertValidXrpcOutput=function(e,t,r){if(t.output?.schema)return Rn(e,"Output",t.output.schema,r,!0)},ie.assertValidXrpcMessage=function(e,t,r){if(t.message?.schema)return Rn(e,"Message",t.message.schema,r,!0)};const En=se,wn=fn;function Rn(e,t,r,n,o=!1){const i=(0,En.validateOneOf)(e,t,r,n,o);if(!i.success)throw i.error;return i.value}var An=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),_n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Sn=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&An(t,e,r);return _n(t,e),t};Object.defineProperty(oe,"__esModule",{value:!0}),oe.Lexicons=void 0;const kn=_,Tn=ie,Cn=re,Ln=Sn(se);class Pn{constructor(e){if(Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"defs",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),e)for(const t of e)this.add(t)}[Symbol.iterator](){return this.docs.values()}add(e){const t=(0,Cn.toLexUri)(e.id);if(this.docs.has(t))throw new Error(`${t} has already been registered`);Bn(e,t),this.docs.set(t,e);for(const[t,r]of xn(e))this.defs.set(t,r)}remove(e){e=(0,Cn.toLexUri)(e);const t=this.docs.get(e);if(!t)throw new Error(`Unable to remove "${e}": does not exist`);for(const[e,r]of xn(t))this.defs.delete(e);this.docs.delete(e)}get(e){return e=(0,Cn.toLexUri)(e),this.docs.get(e)}getDef(e){return e=(0,Cn.toLexUri)(e),this.defs.get(e)}getDefOrThrow(e,t){const r=this.getDef(e);if(!r)throw new kn.LexiconDefNotFoundError(`Lexicon not found: ${e}`);if(t&&!t.includes(r.type))throw new kn.InvalidLexiconError(`Not a ${t.join(" or ")} lexicon: ${e}`);return r}validate(e,t){e=(0,Cn.toLexUri)(e);const r=this.getDefOrThrow(e,["record","object"]);if(!(0,kn.isObj)(t))throw new kn.ValidationError("Value must be an object");if("record"===r.type)return Ln.object(this,"Record",r.record,t);if("object"===r.type)return Ln.object(this,"Object",r,t);throw new kn.InvalidLexiconError("Definition must be a record or object")}assertValidRecord(e,t){e=(0,Cn.toLexUri)(e);const r=this.getDefOrThrow(e,["record"]);if(!(0,kn.isObj)(t))throw new kn.ValidationError("Record must be an object");if(!(0,kn.hasProp)(t,"$type")||"string"!=typeof t.$type)throw new kn.ValidationError("Record/$type must be a string");const n=t.$type||"";if((0,Cn.toLexUri)(n)!==e)throw new kn.ValidationError(`Invalid $type: must be ${e}, got ${n}`);return(0,Tn.assertValidRecord)(this,r,t)}assertValidXrpcParams(e,t){e=(0,Cn.toLexUri)(e);const r=this.getDefOrThrow(e,["query","procedure","subscription"]);return(0,Tn.assertValidXrpcParams)(this,r,t)}assertValidXrpcInput(e,t){e=(0,Cn.toLexUri)(e);const r=this.getDefOrThrow(e,["procedure"]);return(0,Tn.assertValidXrpcInput)(this,r,t)}assertValidXrpcOutput(e,t){e=(0,Cn.toLexUri)(e);const r=this.getDefOrThrow(e,["query","procedure"]);return(0,Tn.assertValidXrpcOutput)(this,r,t)}assertValidXrpcMessage(e,t){e=(0,Cn.toLexUri)(e);const r=this.getDefOrThrow(e,["subscription"]);return(0,Tn.assertValidXrpcMessage)(this,r,t)}resolveLexUri(e,t){return e=(0,Cn.toLexUri)(e),(0,Cn.toLexUri)(t,e)}}function*xn(e){for(const t in e.defs)yield[`lex:${e.id}#${t}`,e.defs[t]],"main"===t&&(yield[`lex:${e.id}`,e.defs[t]])}function Bn(e,t){for(const r in e)"ref"===e.type?e.ref=(0,Cn.toLexUri)(e.ref,t):"union"===e.type?e.refs=e.refs.map((e=>(0,Cn.toLexUri)(e,t))):Array.isArray(e[r])?e[r]=e[r].map((e=>"string"==typeof e?e.startsWith("#")?(0,Cn.toLexUri)(e,t):e:e&&"object"==typeof e?Bn(e,t):e)):e[r]&&"object"==typeof e[r]&&(e[r]=Bn(e[r],t));return e}oe.Lexicons=Pn;var jn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.jsonStringToLex=e.jsonToLex=e.stringifyLex=e.lexToJson=e.ipldToLex=e.lexToIpld=void 0;const t=le,r=kt,n=ce;e.lexToIpld=t=>{if(Array.isArray(t))return t.map((t=>(0,e.lexToIpld)(t)));if(t&&"object"==typeof t){if(t instanceof n.BlobRef)return t.original;if(r.CID.asCID(t)||t instanceof Uint8Array)return t;const o={};for(const r of Object.keys(t))o[r]=(0,e.lexToIpld)(t[r]);return o}return t};e.ipldToLex=o=>{if(Array.isArray(o))return o.map((t=>(0,e.ipldToLex)(t)));if(o&&"object"==typeof o){if(("blob"===o.$type||"string"==typeof o.cid&&"string"==typeof o.mimeType)&&t.check.is(o,n.jsonBlobRef))return n.BlobRef.fromJsonRef(o);if(r.CID.asCID(o)||o instanceof Uint8Array)return o;const i={};for(const t of Object.keys(o))i[t]=(0,e.ipldToLex)(o[t]);return i}return o};e.lexToJson=r=>(0,t.ipldToJson)((0,e.lexToIpld)(r));e.stringifyLex=t=>JSON.stringify((0,e.lexToJson)(t));e.jsonToLex=r=>(0,e.ipldToLex)((0,t.jsonToIpld)(r));e.jsonStringToLex=t=>(0,e.jsonToLex)(JSON.parse(t))}(jn),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(_,t),n(oe,t),n(ce,t),n(jn,t)}(A);var Dn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ids=e.lexicons=e.schemas=e.schemaDict=void 0;const t=A;e.schemaDict={ComAtprotoAdminDefs:{lexicon:1,id:"com.atproto.admin.defs",defs:{statusAttr:{type:"object",required:["applied"],properties:{applied:{type:"boolean"},ref:{type:"string"}}},accountView:{type:"object",required:["did","handle","indexedAt"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},email:{type:"string"},relatedRecords:{type:"array",items:{type:"unknown"}},indexedAt:{type:"string",format:"datetime"},invitedBy:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"},invites:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"}},invitesDisabled:{type:"boolean"},emailConfirmedAt:{type:"string",format:"datetime"},inviteNote:{type:"string"},deactivatedAt:{type:"string",format:"datetime"}}},repoRef:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}},repoBlobRef:{type:"object",required:["did","cid"],properties:{did:{type:"string",format:"did"},cid:{type:"string",format:"cid"},recordUri:{type:"string",format:"at-uri"}}}}},ComAtprotoAdminDeleteAccount:{lexicon:1,id:"com.atproto.admin.deleteAccount",defs:{main:{type:"procedure",description:"Delete a user account as an administrator.",input:{encoding:"application/json",schema:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}}}}}},ComAtprotoAdminDisableAccountInvites:{lexicon:1,id:"com.atproto.admin.disableAccountInvites",defs:{main:{type:"procedure",description:"Disable an account from receiving new invite codes, but does not invalidate existing codes.",input:{encoding:"application/json",schema:{type:"object",required:["account"],properties:{account:{type:"string",format:"did"},note:{type:"string",description:"Optional reason for disabled invites."}}}}}}},ComAtprotoAdminDisableInviteCodes:{lexicon:1,id:"com.atproto.admin.disableInviteCodes",defs:{main:{type:"procedure",description:"Disable some set of codes and/or all codes associated with a set of users.",input:{encoding:"application/json",schema:{type:"object",properties:{codes:{type:"array",items:{type:"string"}},accounts:{type:"array",items:{type:"string"}}}}}}}},ComAtprotoAdminEnableAccountInvites:{lexicon:1,id:"com.atproto.admin.enableAccountInvites",defs:{main:{type:"procedure",description:"Re-enable an account's ability to receive invite codes.",input:{encoding:"application/json",schema:{type:"object",required:["account"],properties:{account:{type:"string",format:"did"},note:{type:"string",description:"Optional reason for enabled invites."}}}}}}},ComAtprotoAdminGetAccountInfo:{lexicon:1,id:"com.atproto.admin.getAccountInfo",defs:{main:{type:"query",description:"Get details about an account.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did"}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:com.atproto.admin.defs#accountView"}}}}},ComAtprotoAdminGetAccountInfos:{lexicon:1,id:"com.atproto.admin.getAccountInfos",defs:{main:{type:"query",description:"Get details about some accounts.",parameters:{type:"params",required:["dids"],properties:{dids:{type:"array",items:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["infos"],properties:{infos:{type:"array",items:{type:"ref",ref:"lex:com.atproto.admin.defs#accountView"}}}}}}}},ComAtprotoAdminGetInviteCodes:{lexicon:1,id:"com.atproto.admin.getInviteCodes",defs:{main:{type:"query",description:"Get an admin view of invite codes.",parameters:{type:"params",properties:{sort:{type:"string",knownValues:["recent","usage"],default:"recent"},limit:{type:"integer",minimum:1,maximum:500,default:100},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["codes"],properties:{cursor:{type:"string"},codes:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"}}}}}}}},ComAtprotoAdminGetSubjectStatus:{lexicon:1,id:"com.atproto.admin.getSubjectStatus",defs:{main:{type:"query",description:"Get the service-specific admin status of a subject (account, record, or blob).",parameters:{type:"params",properties:{did:{type:"string",format:"did"},uri:{type:"string",format:"at-uri"},blob:{type:"string",format:"cid"}}},output:{encoding:"application/json",schema:{type:"object",required:["subject"],properties:{subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef","lex:com.atproto.admin.defs#repoBlobRef"]},takedown:{type:"ref",ref:"lex:com.atproto.admin.defs#statusAttr"},deactivated:{type:"ref",ref:"lex:com.atproto.admin.defs#statusAttr"}}}}}}},ComAtprotoAdminSearchAccounts:{lexicon:1,id:"com.atproto.admin.searchAccounts",defs:{main:{type:"query",description:"Get list of accounts that matches your search query.",parameters:{type:"params",properties:{email:{type:"string"},cursor:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50}}},output:{encoding:"application/json",schema:{type:"object",required:["accounts"],properties:{cursor:{type:"string"},accounts:{type:"array",items:{type:"ref",ref:"lex:com.atproto.admin.defs#accountView"}}}}}}}},ComAtprotoAdminSendEmail:{lexicon:1,id:"com.atproto.admin.sendEmail",defs:{main:{type:"procedure",description:"Send email to a user's account email address.",input:{encoding:"application/json",schema:{type:"object",required:["recipientDid","content","senderDid"],properties:{recipientDid:{type:"string",format:"did"},content:{type:"string"},subject:{type:"string"},senderDid:{type:"string",format:"did"},comment:{type:"string",description:"Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers"}}}},output:{encoding:"application/json",schema:{type:"object",required:["sent"],properties:{sent:{type:"boolean"}}}}}}},ComAtprotoAdminUpdateAccountEmail:{lexicon:1,id:"com.atproto.admin.updateAccountEmail",defs:{main:{type:"procedure",description:"Administrative action to update an account's email.",input:{encoding:"application/json",schema:{type:"object",required:["account","email"],properties:{account:{type:"string",format:"at-identifier",description:"The handle or DID of the repo."},email:{type:"string"}}}}}}},ComAtprotoAdminUpdateAccountHandle:{lexicon:1,id:"com.atproto.admin.updateAccountHandle",defs:{main:{type:"procedure",description:"Administrative action to update an account's handle.",input:{encoding:"application/json",schema:{type:"object",required:["did","handle"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"}}}}}}},ComAtprotoAdminUpdateAccountPassword:{lexicon:1,id:"com.atproto.admin.updateAccountPassword",defs:{main:{type:"procedure",description:"Update the password for a user account as an administrator.",input:{encoding:"application/json",schema:{type:"object",required:["did","password"],properties:{did:{type:"string",format:"did"},password:{type:"string"}}}}}}},ComAtprotoAdminUpdateSubjectStatus:{lexicon:1,id:"com.atproto.admin.updateSubjectStatus",defs:{main:{type:"procedure",description:"Update the service-specific admin status of a subject (account, record, or blob).",input:{encoding:"application/json",schema:{type:"object",required:["subject"],properties:{subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef","lex:com.atproto.admin.defs#repoBlobRef"]},takedown:{type:"ref",ref:"lex:com.atproto.admin.defs#statusAttr"},deactivated:{type:"ref",ref:"lex:com.atproto.admin.defs#statusAttr"}}}},output:{encoding:"application/json",schema:{type:"object",required:["subject"],properties:{subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef","lex:com.atproto.admin.defs#repoBlobRef"]},takedown:{type:"ref",ref:"lex:com.atproto.admin.defs#statusAttr"}}}}}}},ComAtprotoIdentityGetRecommendedDidCredentials:{lexicon:1,id:"com.atproto.identity.getRecommendedDidCredentials",defs:{main:{type:"query",description:"Describe the credentials that should be included in the DID doc of an account that is migrating to this service.",output:{encoding:"application/json",schema:{type:"object",properties:{rotationKeys:{description:"Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs.",type:"array",items:{type:"string"}},alsoKnownAs:{type:"array",items:{type:"string"}},verificationMethods:{type:"unknown"},services:{type:"unknown"}}}}}}},ComAtprotoIdentityRequestPlcOperationSignature:{lexicon:1,id:"com.atproto.identity.requestPlcOperationSignature",defs:{main:{type:"procedure",description:"Request an email with a code to in order to request a signed PLC operation. Requires Auth."}}},ComAtprotoIdentityResolveHandle:{lexicon:1,id:"com.atproto.identity.resolveHandle",defs:{main:{type:"query",description:"Resolves a handle (domain name) to a DID.",parameters:{type:"params",required:["handle"],properties:{handle:{type:"string",format:"handle",description:"The handle to resolve."}}},output:{encoding:"application/json",schema:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}}}}}},ComAtprotoIdentitySignPlcOperation:{lexicon:1,id:"com.atproto.identity.signPlcOperation",defs:{main:{type:"procedure",description:"Signs a PLC operation to update some value(s) in the requesting DID's document.",input:{encoding:"application/json",schema:{type:"object",properties:{token:{description:"A token received through com.atproto.identity.requestPlcOperationSignature",type:"string"},rotationKeys:{type:"array",items:{type:"string"}},alsoKnownAs:{type:"array",items:{type:"string"}},verificationMethods:{type:"unknown"},services:{type:"unknown"}}}},output:{encoding:"application/json",schema:{type:"object",required:["operation"],properties:{operation:{type:"unknown",description:"A signed DID PLC operation."}}}}}}},ComAtprotoIdentitySubmitPlcOperation:{lexicon:1,id:"com.atproto.identity.submitPlcOperation",defs:{main:{type:"procedure",description:"Validates a PLC operation to ensure that it doesn't violate a service's constraints or get the identity into a bad state, then submits it to the PLC registry",input:{encoding:"application/json",schema:{type:"object",required:["operation"],properties:{operation:{type:"unknown"}}}}}}},ComAtprotoIdentityUpdateHandle:{lexicon:1,id:"com.atproto.identity.updateHandle",defs:{main:{type:"procedure",description:"Updates the current account's handle. Verifies handle validity, and updates did:plc document if necessary. Implemented by PDS, and requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["handle"],properties:{handle:{type:"string",format:"handle",description:"The new handle."}}}}}}},ComAtprotoLabelDefs:{lexicon:1,id:"com.atproto.label.defs",defs:{label:{type:"object",description:"Metadata tag on an atproto resource (eg, repo or record).",required:["src","uri","val","cts"],properties:{ver:{type:"integer",description:"The AT Protocol version of the label object."},src:{type:"string",format:"did",description:"DID of the actor who created this label."},uri:{type:"string",format:"uri",description:"AT URI of the record, repository (account), or other resource that this label applies to."},cid:{type:"string",format:"cid",description:"Optionally, CID specifying the specific version of 'uri' resource this label applies to."},val:{type:"string",maxLength:128,description:"The short string name of the value or type of this label."},neg:{type:"boolean",description:"If true, this is a negation label, overwriting a previous label."},cts:{type:"string",format:"datetime",description:"Timestamp when this label was created."},exp:{type:"string",format:"datetime",description:"Timestamp at which this label expires (no longer applies)."},sig:{type:"bytes",description:"Signature of dag-cbor encoded label."}}},selfLabels:{type:"object",description:"Metadata tags on an atproto record, published by the author within the record.",required:["values"],properties:{values:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#selfLabel"},maxLength:10}}},selfLabel:{type:"object",description:"Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.",required:["val"],properties:{val:{type:"string",maxLength:128,description:"The short string name of the value or type of this label."}}},labelValueDefinition:{type:"object",description:"Declares a label value and its expected interpretations and behaviors.",required:["identifier","severity","blurs","locales"],properties:{identifier:{type:"string",description:"The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",maxLength:100,maxGraphemes:100},severity:{type:"string",description:"How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",knownValues:["inform","alert","none"]},blurs:{type:"string",description:"What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.",knownValues:["content","media","none"]},defaultSetting:{type:"string",description:"The default setting for this label.",knownValues:["ignore","warn","hide"],default:"warn"},adultOnly:{type:"boolean",description:"Does the user need to have adult content enabled in order to configure this label?"},locales:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#labelValueDefinitionStrings"}}}},labelValueDefinitionStrings:{type:"object",description:"Strings which describe the label in the UI, localized into a specific language.",required:["lang","name","description"],properties:{lang:{type:"string",description:"The code of the language these strings are written in.",format:"language"},name:{type:"string",description:"A short human-readable name for the label.",maxGraphemes:64,maxLength:640},description:{type:"string",description:"A longer description of what the label means and why it might be applied.",maxGraphemes:1e4,maxLength:1e5}}},labelValue:{type:"string",knownValues:["!hide","!no-promote","!warn","!no-unauthenticated","dmca-violation","doxxing","porn","sexual","nudity","nsfl","gore"]}}},ComAtprotoLabelQueryLabels:{lexicon:1,id:"com.atproto.label.queryLabels",defs:{main:{type:"query",description:"Find labels relevant to the provided AT-URI patterns. Public endpoint for moderation services, though may return different or additional results with auth.",parameters:{type:"params",required:["uriPatterns"],properties:{uriPatterns:{type:"array",items:{type:"string"},description:"List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI."},sources:{type:"array",items:{type:"string",format:"did"},description:"Optional list of label sources (DIDs) to filter on."},limit:{type:"integer",minimum:1,maximum:250,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["labels"],properties:{cursor:{type:"string"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}}}}}},ComAtprotoLabelSubscribeLabels:{lexicon:1,id:"com.atproto.label.subscribeLabels",defs:{main:{type:"subscription",description:"Subscribe to stream of labels (and negations). Public endpoint implemented by mod services. Uses same sequencing scheme as repo event stream.",parameters:{type:"params",properties:{cursor:{type:"integer",description:"The last known event seq number to backfill from."}}},message:{schema:{type:"union",refs:["lex:com.atproto.label.subscribeLabels#labels","lex:com.atproto.label.subscribeLabels#info"]}},errors:[{name:"FutureCursor"}]},labels:{type:"object",required:["seq","labels"],properties:{seq:{type:"integer"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}},info:{type:"object",required:["name"],properties:{name:{type:"string",knownValues:["OutdatedCursor"]},message:{type:"string"}}}}},ComAtprotoModerationCreateReport:{lexicon:1,id:"com.atproto.moderation.createReport",defs:{main:{type:"procedure",description:"Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["reasonType","subject"],properties:{reasonType:{type:"ref",description:"Indicates the broad category of violation the report is for.",ref:"lex:com.atproto.moderation.defs#reasonType"},reason:{type:"string",maxGraphemes:2e3,maxLength:2e4,description:"Additional context about the content and violation."},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef"]}}}},output:{encoding:"application/json",schema:{type:"object",required:["id","reasonType","subject","reportedBy","createdAt"],properties:{id:{type:"integer"},reasonType:{type:"ref",ref:"lex:com.atproto.moderation.defs#reasonType"},reason:{type:"string",maxGraphemes:2e3,maxLength:2e4},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef"]},reportedBy:{type:"string",format:"did"},createdAt:{type:"string",format:"datetime"}}}}}}},ComAtprotoModerationDefs:{lexicon:1,id:"com.atproto.moderation.defs",defs:{reasonType:{type:"string",knownValues:["com.atproto.moderation.defs#reasonSpam","com.atproto.moderation.defs#reasonViolation","com.atproto.moderation.defs#reasonMisleading","com.atproto.moderation.defs#reasonSexual","com.atproto.moderation.defs#reasonRude","com.atproto.moderation.defs#reasonOther","com.atproto.moderation.defs#reasonAppeal"]},reasonSpam:{type:"token",description:"Spam: frequent unwanted promotion, replies, mentions"},reasonViolation:{type:"token",description:"Direct violation of server rules, laws, terms of service"},reasonMisleading:{type:"token",description:"Misleading identity, affiliation, or content"},reasonSexual:{type:"token",description:"Unwanted or mislabeled sexual content"},reasonRude:{type:"token",description:"Rude, harassing, explicit, or otherwise unwelcoming behavior"},reasonOther:{type:"token",description:"Other: reports not falling under another report category"},reasonAppeal:{type:"token",description:"Appeal: appeal a previously taken moderation action"}}},ComAtprotoRepoApplyWrites:{lexicon:1,id:"com.atproto.repo.applyWrites",defs:{main:{type:"procedure",description:"Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.",input:{encoding:"application/json",schema:{type:"object",required:["repo","writes"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo (aka, current account)."},validate:{type:"boolean",description:"Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons."},writes:{type:"array",items:{type:"union",refs:["lex:com.atproto.repo.applyWrites#create","lex:com.atproto.repo.applyWrites#update","lex:com.atproto.repo.applyWrites#delete"],closed:!0}},swapCommit:{type:"string",description:"If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.",format:"cid"}}}},output:{encoding:"application/json",schema:{type:"object",required:[],properties:{commit:{type:"ref",ref:"lex:com.atproto.repo.defs#commitMeta"},results:{type:"array",items:{type:"union",refs:["lex:com.atproto.repo.applyWrites#createResult","lex:com.atproto.repo.applyWrites#updateResult","lex:com.atproto.repo.applyWrites#deleteResult"],closed:!0}}}}},errors:[{name:"InvalidSwap",description:"Indicates that the 'swapCommit' parameter did not match current commit."}]},create:{type:"object",description:"Operation which creates a new record.",required:["collection","value"],properties:{collection:{type:"string",format:"nsid"},rkey:{type:"string",maxLength:15},value:{type:"unknown"}}},update:{type:"object",description:"Operation which updates an existing record.",required:["collection","rkey","value"],properties:{collection:{type:"string",format:"nsid"},rkey:{type:"string"},value:{type:"unknown"}}},delete:{type:"object",description:"Operation which deletes an existing record.",required:["collection","rkey"],properties:{collection:{type:"string",format:"nsid"},rkey:{type:"string"}}},createResult:{type:"object",required:["uri","cid"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},validationStatus:{type:"string",knownValues:["valid","unknown"]}}},updateResult:{type:"object",required:["uri","cid"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},validationStatus:{type:"string",knownValues:["valid","unknown"]}}},deleteResult:{type:"object",required:[],properties:{}}}},ComAtprotoRepoCreateRecord:{lexicon:1,id:"com.atproto.repo.createRecord",defs:{main:{type:"procedure",description:"Create a single new repository record. Requires auth, implemented by PDS.",input:{encoding:"application/json",schema:{type:"object",required:["repo","collection","record"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo (aka, current account)."},collection:{type:"string",format:"nsid",description:"The NSID of the record collection."},rkey:{type:"string",description:"The Record Key.",maxLength:15},validate:{type:"boolean",description:"Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons."},record:{type:"unknown",description:"The record itself. Must contain a $type field."},swapCommit:{type:"string",format:"cid",description:"Compare and swap with the previous commit by CID."}}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","cid"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},commit:{type:"ref",ref:"lex:com.atproto.repo.defs#commitMeta"},validationStatus:{type:"string",knownValues:["valid","unknown"]}}}},errors:[{name:"InvalidSwap",description:"Indicates that 'swapCommit' didn't match current repo commit."}]}}},ComAtprotoRepoDefs:{lexicon:1,id:"com.atproto.repo.defs",defs:{commitMeta:{type:"object",required:["cid","rev"],properties:{cid:{type:"string",format:"cid"},rev:{type:"string"}}}}},ComAtprotoRepoDeleteRecord:{lexicon:1,id:"com.atproto.repo.deleteRecord",defs:{main:{type:"procedure",description:"Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.",input:{encoding:"application/json",schema:{type:"object",required:["repo","collection","rkey"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo (aka, current account)."},collection:{type:"string",format:"nsid",description:"The NSID of the record collection."},rkey:{type:"string",description:"The Record Key."},swapRecord:{type:"string",format:"cid",description:"Compare and swap with the previous record by CID."},swapCommit:{type:"string",format:"cid",description:"Compare and swap with the previous commit by CID."}}}},output:{encoding:"application/json",schema:{type:"object",properties:{commit:{type:"ref",ref:"lex:com.atproto.repo.defs#commitMeta"}}}},errors:[{name:"InvalidSwap"}]}}},ComAtprotoRepoDescribeRepo:{lexicon:1,id:"com.atproto.repo.describeRepo",defs:{main:{type:"query",description:"Get information about an account and repository, including the list of collections. Does not require auth.",parameters:{type:"params",required:["repo"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo."}}},output:{encoding:"application/json",schema:{type:"object",required:["handle","did","didDoc","collections","handleIsCorrect"],properties:{handle:{type:"string",format:"handle"},did:{type:"string",format:"did"},didDoc:{type:"unknown",description:"The complete DID document for this account."},collections:{type:"array",description:"List of all the collections (NSIDs) for which this repo contains at least one record.",items:{type:"string",format:"nsid"}},handleIsCorrect:{type:"boolean",description:"Indicates if handle is currently valid (resolves bi-directionally)"}}}}}}},ComAtprotoRepoGetRecord:{lexicon:1,id:"com.atproto.repo.getRecord",defs:{main:{type:"query",description:"Get a single record from a repository. Does not require auth.",parameters:{type:"params",required:["repo","collection","rkey"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo."},collection:{type:"string",format:"nsid",description:"The NSID of the record collection."},rkey:{type:"string",description:"The Record Key."},cid:{type:"string",format:"cid",description:"The CID of the version of the record. If not specified, then return the most recent version."}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","value"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},value:{type:"unknown"}}}},errors:[{name:"RecordNotFound"}]}}},ComAtprotoRepoImportRepo:{lexicon:1,id:"com.atproto.repo.importRepo",defs:{main:{type:"procedure",description:"Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set.",input:{encoding:"application/vnd.ipld.car"}}}},ComAtprotoRepoListMissingBlobs:{lexicon:1,id:"com.atproto.repo.listMissingBlobs",defs:{main:{type:"query",description:"Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:1e3,default:500},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["blobs"],properties:{cursor:{type:"string"},blobs:{type:"array",items:{type:"ref",ref:"lex:com.atproto.repo.listMissingBlobs#recordBlob"}}}}}},recordBlob:{type:"object",required:["cid","recordUri"],properties:{cid:{type:"string",format:"cid"},recordUri:{type:"string",format:"at-uri"}}}}},ComAtprotoRepoListRecords:{lexicon:1,id:"com.atproto.repo.listRecords",defs:{main:{type:"query",description:"List a range of records in a repository, matching a specific collection. Does not require auth.",parameters:{type:"params",required:["repo","collection"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo."},collection:{type:"string",format:"nsid",description:"The NSID of the record type."},limit:{type:"integer",minimum:1,maximum:100,default:50,description:"The number of records to return."},cursor:{type:"string"},rkeyStart:{type:"string",description:"DEPRECATED: The lowest sort-ordered rkey to start from (exclusive)"},rkeyEnd:{type:"string",description:"DEPRECATED: The highest sort-ordered rkey to stop at (exclusive)"},reverse:{type:"boolean",description:"Flag to reverse the order of the returned records."}}},output:{encoding:"application/json",schema:{type:"object",required:["records"],properties:{cursor:{type:"string"},records:{type:"array",items:{type:"ref",ref:"lex:com.atproto.repo.listRecords#record"}}}}}},record:{type:"object",required:["uri","cid","value"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},value:{type:"unknown"}}}}},ComAtprotoRepoPutRecord:{lexicon:1,id:"com.atproto.repo.putRecord",defs:{main:{type:"procedure",description:"Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.",input:{encoding:"application/json",schema:{type:"object",required:["repo","collection","rkey","record"],nullable:["swapRecord"],properties:{repo:{type:"string",format:"at-identifier",description:"The handle or DID of the repo (aka, current account)."},collection:{type:"string",format:"nsid",description:"The NSID of the record collection."},rkey:{type:"string",description:"The Record Key.",maxLength:15},validate:{type:"boolean",description:"Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons."},record:{type:"unknown",description:"The record to write."},swapRecord:{type:"string",format:"cid",description:"Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation"},swapCommit:{type:"string",format:"cid",description:"Compare and swap with the previous commit by CID."}}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","cid"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},commit:{type:"ref",ref:"lex:com.atproto.repo.defs#commitMeta"},validationStatus:{type:"string",knownValues:["valid","unknown"]}}}},errors:[{name:"InvalidSwap"}]}}},ComAtprotoRepoStrongRef:{lexicon:1,id:"com.atproto.repo.strongRef",description:"A URI with a content-hash fingerprint.",defs:{main:{type:"object",required:["uri","cid"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"}}}}},ComAtprotoRepoUploadBlob:{lexicon:1,id:"com.atproto.repo.uploadBlob",defs:{main:{type:"procedure",description:"Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS.",input:{encoding:"*/*"},output:{encoding:"application/json",schema:{type:"object",required:["blob"],properties:{blob:{type:"blob"}}}}}}},ComAtprotoServerActivateAccount:{lexicon:1,id:"com.atproto.server.activateAccount",defs:{main:{type:"procedure",description:"Activates a currently deactivated account. Used to finalize account migration after the account's repo is imported and identity is setup."}}},ComAtprotoServerCheckAccountStatus:{lexicon:1,id:"com.atproto.server.checkAccountStatus",defs:{main:{type:"query",description:"Returns the status of an account, especially as pertaining to import or recovery. Can be called many times over the course of an account migration. Requires auth and can only be called pertaining to oneself.",output:{encoding:"application/json",schema:{type:"object",required:["activated","validDid","repoCommit","repoRev","repoBlocks","indexedRecords","privateStateValues","expectedBlobs","importedBlobs"],properties:{activated:{type:"boolean"},validDid:{type:"boolean"},repoCommit:{type:"string",format:"cid"},repoRev:{type:"string"},repoBlocks:{type:"integer"},indexedRecords:{type:"integer"},privateStateValues:{type:"integer"},expectedBlobs:{type:"integer"},importedBlobs:{type:"integer"}}}}}}},ComAtprotoServerConfirmEmail:{lexicon:1,id:"com.atproto.server.confirmEmail",defs:{main:{type:"procedure",description:"Confirm an email using a token from com.atproto.server.requestEmailConfirmation.",input:{encoding:"application/json",schema:{type:"object",required:["email","token"],properties:{email:{type:"string"},token:{type:"string"}}}},errors:[{name:"AccountNotFound"},{name:"ExpiredToken"},{name:"InvalidToken"},{name:"InvalidEmail"}]}}},ComAtprotoServerCreateAccount:{lexicon:1,id:"com.atproto.server.createAccount",defs:{main:{type:"procedure",description:"Create an account. Implemented by PDS.",input:{encoding:"application/json",schema:{type:"object",required:["handle"],properties:{email:{type:"string"},handle:{type:"string",format:"handle",description:"Requested handle for the account."},did:{type:"string",format:"did",description:"Pre-existing atproto DID, being imported to a new account."},inviteCode:{type:"string"},verificationCode:{type:"string"},verificationPhone:{type:"string"},password:{type:"string",description:"Initial account password. May need to meet instance-specific password strength requirements."},recoveryKey:{type:"string",description:"DID PLC rotation key (aka, recovery key) to be included in PLC creation operation."},plcOp:{type:"unknown",description:"A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented."}}}},output:{encoding:"application/json",schema:{type:"object",description:"Account login session returned on successful account creation.",required:["accessJwt","refreshJwt","handle","did"],properties:{accessJwt:{type:"string"},refreshJwt:{type:"string"},handle:{type:"string",format:"handle"},did:{type:"string",format:"did",description:"The DID of the new account."},didDoc:{type:"unknown",description:"Complete DID document."}}}},errors:[{name:"InvalidHandle"},{name:"InvalidPassword"},{name:"InvalidInviteCode"},{name:"HandleNotAvailable"},{name:"UnsupportedDomain"},{name:"UnresolvableDid"},{name:"IncompatibleDidDoc"}]}}},ComAtprotoServerCreateAppPassword:{lexicon:1,id:"com.atproto.server.createAppPassword",defs:{main:{type:"procedure",description:"Create an App Password.",input:{encoding:"application/json",schema:{type:"object",required:["name"],properties:{name:{type:"string",description:"A short name for the App Password, to help distinguish them."},privileged:{type:"boolean",description:"If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:com.atproto.server.createAppPassword#appPassword"}},errors:[{name:"AccountTakedown"}]},appPassword:{type:"object",required:["name","password","createdAt"],properties:{name:{type:"string"},password:{type:"string"},createdAt:{type:"string",format:"datetime"},privileged:{type:"boolean"}}}}},ComAtprotoServerCreateInviteCode:{lexicon:1,id:"com.atproto.server.createInviteCode",defs:{main:{type:"procedure",description:"Create an invite code.",input:{encoding:"application/json",schema:{type:"object",required:["useCount"],properties:{useCount:{type:"integer"},forAccount:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["code"],properties:{code:{type:"string"}}}}}}},ComAtprotoServerCreateInviteCodes:{lexicon:1,id:"com.atproto.server.createInviteCodes",defs:{main:{type:"procedure",description:"Create invite codes.",input:{encoding:"application/json",schema:{type:"object",required:["codeCount","useCount"],properties:{codeCount:{type:"integer",default:1},useCount:{type:"integer"},forAccounts:{type:"array",items:{type:"string",format:"did"}}}}},output:{encoding:"application/json",schema:{type:"object",required:["codes"],properties:{codes:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.createInviteCodes#accountCodes"}}}}}},accountCodes:{type:"object",required:["account","codes"],properties:{account:{type:"string"},codes:{type:"array",items:{type:"string"}}}}}},ComAtprotoServerCreateSession:{lexicon:1,id:"com.atproto.server.createSession",defs:{main:{type:"procedure",description:"Create an authentication session.",input:{encoding:"application/json",schema:{type:"object",required:["identifier","password"],properties:{identifier:{type:"string",description:"Handle or other identifier supported by the server for the authenticating user."},password:{type:"string"},authFactorToken:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["accessJwt","refreshJwt","handle","did"],properties:{accessJwt:{type:"string"},refreshJwt:{type:"string"},handle:{type:"string",format:"handle"},did:{type:"string",format:"did"},didDoc:{type:"unknown"},email:{type:"string"},emailConfirmed:{type:"boolean"},emailAuthFactor:{type:"boolean"},active:{type:"boolean"},status:{type:"string",description:"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",knownValues:["takendown","suspended","deactivated"]}}}},errors:[{name:"AccountTakedown"},{name:"AuthFactorTokenRequired"}]}}},ComAtprotoServerDeactivateAccount:{lexicon:1,id:"com.atproto.server.deactivateAccount",defs:{main:{type:"procedure",description:"Deactivates a currently active account. Stops serving of repo, and future writes to repo until reactivated. Used to finalize account migration with the old host after the account has been activated on the new host.",input:{encoding:"application/json",schema:{type:"object",properties:{deleteAfter:{type:"string",format:"datetime",description:"A recommendation to server as to how long they should hold onto the deactivated account before deleting."}}}}}}},ComAtprotoServerDefs:{lexicon:1,id:"com.atproto.server.defs",defs:{inviteCode:{type:"object",required:["code","available","disabled","forAccount","createdBy","createdAt","uses"],properties:{code:{type:"string"},available:{type:"integer"},disabled:{type:"boolean"},forAccount:{type:"string"},createdBy:{type:"string"},createdAt:{type:"string",format:"datetime"},uses:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCodeUse"}}}},inviteCodeUse:{type:"object",required:["usedBy","usedAt"],properties:{usedBy:{type:"string",format:"did"},usedAt:{type:"string",format:"datetime"}}}}},ComAtprotoServerDeleteAccount:{lexicon:1,id:"com.atproto.server.deleteAccount",defs:{main:{type:"procedure",description:"Delete an actor's account with a token and password. Can only be called after requesting a deletion token. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["did","password","token"],properties:{did:{type:"string",format:"did"},password:{type:"string"},token:{type:"string"}}}},errors:[{name:"ExpiredToken"},{name:"InvalidToken"}]}}},ComAtprotoServerDeleteSession:{lexicon:1,id:"com.atproto.server.deleteSession",defs:{main:{type:"procedure",description:"Delete the current session. Requires auth."}}},ComAtprotoServerDescribeServer:{lexicon:1,id:"com.atproto.server.describeServer",defs:{main:{type:"query",description:"Describes the server's account creation requirements and capabilities. Implemented by PDS.",output:{encoding:"application/json",schema:{type:"object",required:["did","availableUserDomains"],properties:{inviteCodeRequired:{type:"boolean",description:"If true, an invite code must be supplied to create an account on this instance."},phoneVerificationRequired:{type:"boolean",description:"If true, a phone verification token must be supplied to create an account on this instance."},availableUserDomains:{type:"array",description:"List of domain suffixes that can be used in account handles.",items:{type:"string"}},links:{type:"ref",description:"URLs of service policy documents.",ref:"lex:com.atproto.server.describeServer#links"},contact:{type:"ref",description:"Contact information",ref:"lex:com.atproto.server.describeServer#contact"},did:{type:"string",format:"did"}}}}},links:{type:"object",properties:{privacyPolicy:{type:"string",format:"uri"},termsOfService:{type:"string",format:"uri"}}},contact:{type:"object",properties:{email:{type:"string"}}}}},ComAtprotoServerGetAccountInviteCodes:{lexicon:1,id:"com.atproto.server.getAccountInviteCodes",defs:{main:{type:"query",description:"Get all invite codes for the current account. Requires auth.",parameters:{type:"params",properties:{includeUsed:{type:"boolean",default:!0},createAvailable:{type:"boolean",default:!0,description:"Controls whether any new 'earned' but not 'created' invites should be created."}}},output:{encoding:"application/json",schema:{type:"object",required:["codes"],properties:{codes:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"}}}}},errors:[{name:"DuplicateCreate"}]}}},ComAtprotoServerGetServiceAuth:{lexicon:1,id:"com.atproto.server.getServiceAuth",defs:{main:{type:"query",description:"Get a signed token on behalf of the requesting DID for the requested service.",parameters:{type:"params",required:["aud"],properties:{aud:{type:"string",format:"did",description:"The DID of the service that the token will be used to authenticate with"},exp:{type:"integer",description:"The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope."},lxm:{type:"string",format:"nsid",description:"Lexicon (XRPC) method to bind the requested token to"}}},output:{encoding:"application/json",schema:{type:"object",required:["token"],properties:{token:{type:"string"}}}},errors:[{name:"BadExpiration",description:"Indicates that the requested expiration date is not a valid. May be in the past or may be reliant on the requested scopes."}]}}},ComAtprotoServerGetSession:{lexicon:1,id:"com.atproto.server.getSession",defs:{main:{type:"query",description:"Get information about the current auth session. Requires auth.",output:{encoding:"application/json",schema:{type:"object",required:["handle","did"],properties:{handle:{type:"string",format:"handle"},did:{type:"string",format:"did"},email:{type:"string"},emailConfirmed:{type:"boolean"},emailAuthFactor:{type:"boolean"},didDoc:{type:"unknown"},active:{type:"boolean"},status:{type:"string",description:"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",knownValues:["takendown","suspended","deactivated"]}}}}}}},ComAtprotoServerListAppPasswords:{lexicon:1,id:"com.atproto.server.listAppPasswords",defs:{main:{type:"query",description:"List all App Passwords.",output:{encoding:"application/json",schema:{type:"object",required:["passwords"],properties:{passwords:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.listAppPasswords#appPassword"}}}}},errors:[{name:"AccountTakedown"}]},appPassword:{type:"object",required:["name","createdAt"],properties:{name:{type:"string"},createdAt:{type:"string",format:"datetime"},privileged:{type:"boolean"}}}}},ComAtprotoServerRefreshSession:{lexicon:1,id:"com.atproto.server.refreshSession",defs:{main:{type:"procedure",description:"Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt').",output:{encoding:"application/json",schema:{type:"object",required:["accessJwt","refreshJwt","handle","did"],properties:{accessJwt:{type:"string"},refreshJwt:{type:"string"},handle:{type:"string",format:"handle"},did:{type:"string",format:"did"},didDoc:{type:"unknown"},active:{type:"boolean"},status:{type:"string",description:"Hosting status of the account. If not specified, then assume 'active'.",knownValues:["takendown","suspended","deactivated"]}}}},errors:[{name:"AccountTakedown"}]}}},ComAtprotoServerRequestAccountDelete:{lexicon:1,id:"com.atproto.server.requestAccountDelete",defs:{main:{type:"procedure",description:"Initiate a user account deletion via email."}}},ComAtprotoServerRequestEmailConfirmation:{lexicon:1,id:"com.atproto.server.requestEmailConfirmation",defs:{main:{type:"procedure",description:"Request an email with a code to confirm ownership of email."}}},ComAtprotoServerRequestEmailUpdate:{lexicon:1,id:"com.atproto.server.requestEmailUpdate",defs:{main:{type:"procedure",description:"Request a token in order to update email.",output:{encoding:"application/json",schema:{type:"object",required:["tokenRequired"],properties:{tokenRequired:{type:"boolean"}}}}}}},ComAtprotoServerRequestPasswordReset:{lexicon:1,id:"com.atproto.server.requestPasswordReset",defs:{main:{type:"procedure",description:"Initiate a user account password reset via email.",input:{encoding:"application/json",schema:{type:"object",required:["email"],properties:{email:{type:"string"}}}}}}},ComAtprotoServerReserveSigningKey:{lexicon:1,id:"com.atproto.server.reserveSigningKey",defs:{main:{type:"procedure",description:"Reserve a repo signing key, for use with account creation. Necessary so that a DID PLC update operation can be constructed during an account migraiton. Public and does not require auth; implemented by PDS. NOTE: this endpoint may change when full account migration is implemented.",input:{encoding:"application/json",schema:{type:"object",properties:{did:{type:"string",format:"did",description:"The DID to reserve a key for."}}}},output:{encoding:"application/json",schema:{type:"object",required:["signingKey"],properties:{signingKey:{type:"string",description:"The public key for the reserved signing key, in did:key serialization."}}}}}}},ComAtprotoServerResetPassword:{lexicon:1,id:"com.atproto.server.resetPassword",defs:{main:{type:"procedure",description:"Reset a user account password using a token.",input:{encoding:"application/json",schema:{type:"object",required:["token","password"],properties:{token:{type:"string"},password:{type:"string"}}}},errors:[{name:"ExpiredToken"},{name:"InvalidToken"}]}}},ComAtprotoServerRevokeAppPassword:{lexicon:1,id:"com.atproto.server.revokeAppPassword",defs:{main:{type:"procedure",description:"Revoke an App Password by name.",input:{encoding:"application/json",schema:{type:"object",required:["name"],properties:{name:{type:"string"}}}}}}},ComAtprotoServerUpdateEmail:{lexicon:1,id:"com.atproto.server.updateEmail",defs:{main:{type:"procedure",description:"Update an account's email.",input:{encoding:"application/json",schema:{type:"object",required:["email"],properties:{email:{type:"string"},emailAuthFactor:{type:"boolean"},token:{type:"string",description:"Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed."}}}},errors:[{name:"ExpiredToken"},{name:"InvalidToken"},{name:"TokenRequired"}]}}},ComAtprotoSyncGetBlob:{lexicon:1,id:"com.atproto.sync.getBlob",defs:{main:{type:"query",description:"Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS.",parameters:{type:"params",required:["did","cid"],properties:{did:{type:"string",format:"did",description:"The DID of the account."},cid:{type:"string",format:"cid",description:"The CID of the blob to fetch"}}},output:{encoding:"*/*"},errors:[{name:"BlobNotFound"},{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncGetBlocks:{lexicon:1,id:"com.atproto.sync.getBlocks",defs:{main:{type:"query",description:"Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS.",parameters:{type:"params",required:["did","cids"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."},cids:{type:"array",items:{type:"string",format:"cid"}}}},output:{encoding:"application/vnd.ipld.car"},errors:[{name:"BlockNotFound"},{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncGetCheckout:{lexicon:1,id:"com.atproto.sync.getCheckout",defs:{main:{type:"query",description:"DEPRECATED - please use com.atproto.sync.getRepo instead",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."}}},output:{encoding:"application/vnd.ipld.car"}}}},ComAtprotoSyncGetHead:{lexicon:1,id:"com.atproto.sync.getHead",defs:{main:{type:"query",description:"DEPRECATED - please use com.atproto.sync.getLatestCommit instead",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."}}},output:{encoding:"application/json",schema:{type:"object",required:["root"],properties:{root:{type:"string",format:"cid"}}}},errors:[{name:"HeadNotFound"}]}}},ComAtprotoSyncGetLatestCommit:{lexicon:1,id:"com.atproto.sync.getLatestCommit",defs:{main:{type:"query",description:"Get the current commit CID & revision of the specified repo. Does not require auth.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."}}},output:{encoding:"application/json",schema:{type:"object",required:["cid","rev"],properties:{cid:{type:"string",format:"cid"},rev:{type:"string"}}}},errors:[{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncGetRecord:{lexicon:1,id:"com.atproto.sync.getRecord",defs:{main:{type:"query",description:"Get data blocks needed to prove the existence or non-existence of record in the current version of repo. Does not require auth.",parameters:{type:"params",required:["did","collection","rkey"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."},collection:{type:"string",format:"nsid"},rkey:{type:"string",description:"Record Key"},commit:{type:"string",format:"cid",description:"DEPRECATED: referenced a repo commit by CID, and retrieved record as of that commit"}}},output:{encoding:"application/vnd.ipld.car"},errors:[{name:"RecordNotFound"},{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncGetRepo:{lexicon:1,id:"com.atproto.sync.getRepo",defs:{main:{type:"query",description:"Download a repository export as CAR file. Optionally only a 'diff' since a previous revision. Does not require auth; implemented by PDS.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."},since:{type:"string",description:"The revision ('rev') of the repo to create a diff from."}}},output:{encoding:"application/vnd.ipld.car"},errors:[{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncGetRepoStatus:{lexicon:1,id:"com.atproto.sync.getRepoStatus",defs:{main:{type:"query",description:"Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."}}},output:{encoding:"application/json",schema:{type:"object",required:["did","active"],properties:{did:{type:"string",format:"did"},active:{type:"boolean"},status:{type:"string",description:"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",knownValues:["takendown","suspended","deactivated"]},rev:{type:"string",description:"Optional field, the current rev of the repo, if active=true"}}}},errors:[{name:"RepoNotFound"}]}}},ComAtprotoSyncListBlobs:{lexicon:1,id:"com.atproto.sync.listBlobs",defs:{main:{type:"query",description:"List blob CIDs for an account, since some repo revision. Does not require auth; implemented by PDS.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did",description:"The DID of the repo."},since:{type:"string",description:"Optional revision of the repo to list blobs since."},limit:{type:"integer",minimum:1,maximum:1e3,default:500},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["cids"],properties:{cursor:{type:"string"},cids:{type:"array",items:{type:"string",format:"cid"}}}}},errors:[{name:"RepoNotFound"},{name:"RepoTakendown"},{name:"RepoSuspended"},{name:"RepoDeactivated"}]}}},ComAtprotoSyncListRepos:{lexicon:1,id:"com.atproto.sync.listRepos",defs:{main:{type:"query",description:"Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:1e3,default:500},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["repos"],properties:{cursor:{type:"string"},repos:{type:"array",items:{type:"ref",ref:"lex:com.atproto.sync.listRepos#repo"}}}}}},repo:{type:"object",required:["did","head","rev"],properties:{did:{type:"string",format:"did"},head:{type:"string",format:"cid",description:"Current repo commit CID"},rev:{type:"string"},active:{type:"boolean"},status:{type:"string",description:"If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.",knownValues:["takendown","suspended","deactivated"]}}}}},ComAtprotoSyncNotifyOfUpdate:{lexicon:1,id:"com.atproto.sync.notifyOfUpdate",defs:{main:{type:"procedure",description:"Notify a crawling service of a recent update, and that crawling should resume. Intended use is after a gap between repo stream events caused the crawling service to disconnect. Does not require auth; implemented by Relay.",input:{encoding:"application/json",schema:{type:"object",required:["hostname"],properties:{hostname:{type:"string",description:"Hostname of the current service (usually a PDS) that is notifying of update."}}}}}}},ComAtprotoSyncRequestCrawl:{lexicon:1,id:"com.atproto.sync.requestCrawl",defs:{main:{type:"procedure",description:"Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth.",input:{encoding:"application/json",schema:{type:"object",required:["hostname"],properties:{hostname:{type:"string",description:"Hostname of the current service (eg, PDS) that is requesting to be crawled."}}}}}}},ComAtprotoSyncSubscribeRepos:{lexicon:1,id:"com.atproto.sync.subscribeRepos",defs:{main:{type:"subscription",description:"Repository event stream, aka Firehose endpoint. Outputs repo commits with diff data, and identity update events, for all repositories on the current server. See the atproto specifications for details around stream sequencing, repo versioning, CAR diff format, and more. Public and does not require auth; implemented by PDS and Relay.",parameters:{type:"params",properties:{cursor:{type:"integer",description:"The last known event seq number to backfill from."}}},message:{schema:{type:"union",refs:["lex:com.atproto.sync.subscribeRepos#commit","lex:com.atproto.sync.subscribeRepos#identity","lex:com.atproto.sync.subscribeRepos#account","lex:com.atproto.sync.subscribeRepos#handle","lex:com.atproto.sync.subscribeRepos#migrate","lex:com.atproto.sync.subscribeRepos#tombstone","lex:com.atproto.sync.subscribeRepos#info"]}},errors:[{name:"FutureCursor"},{name:"ConsumerTooSlow",description:"If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection."}]},commit:{type:"object",description:"Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature.",required:["seq","rebase","tooBig","repo","commit","rev","since","blocks","ops","blobs","time"],nullable:["prev","since"],properties:{seq:{type:"integer",description:"The stream sequence number of this message."},rebase:{type:"boolean",description:"DEPRECATED -- unused"},tooBig:{type:"boolean",description:"Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data."},repo:{type:"string",format:"did",description:"The repo this event comes from."},commit:{type:"cid-link",description:"Repo commit object CID."},prev:{type:"cid-link",description:"DEPRECATED -- unused. WARNING -- nullable and optional; stick with optional to ensure golang interoperability."},rev:{type:"string",description:"The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event."},since:{type:"string",description:"The rev of the last emitted commit from this repo (if any)."},blocks:{type:"bytes",description:"CAR file containing relevant blocks, as a diff since the previous repo state.",maxLength:1e6},ops:{type:"array",items:{type:"ref",ref:"lex:com.atproto.sync.subscribeRepos#repoOp",description:"List of repo mutation operations in this commit (eg, records created, updated, or deleted)."},maxLength:200},blobs:{type:"array",items:{type:"cid-link",description:"List of new blobs (by CID) referenced by records in this commit."}},time:{type:"string",format:"datetime",description:"Timestamp of when this message was originally broadcast."}}},identity:{type:"object",description:"Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache.",required:["seq","did","time"],properties:{seq:{type:"integer"},did:{type:"string",format:"did"},time:{type:"string",format:"datetime"},handle:{type:"string",format:"handle",description:"The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details."}}},account:{type:"object",description:"Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active.",required:["seq","did","time","active"],properties:{seq:{type:"integer"},did:{type:"string",format:"did"},time:{type:"string",format:"datetime"},active:{type:"boolean",description:"Indicates that the account has a repository which can be fetched from the host that emitted this event."},status:{type:"string",description:"If active=false, this optional field indicates a reason for why the account is not active.",knownValues:["takendown","suspended","deleted","deactivated"]}}},handle:{type:"object",description:"DEPRECATED -- Use #identity event instead",required:["seq","did","handle","time"],properties:{seq:{type:"integer"},did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},time:{type:"string",format:"datetime"}}},migrate:{type:"object",description:"DEPRECATED -- Use #account event instead",required:["seq","did","migrateTo","time"],nullable:["migrateTo"],properties:{seq:{type:"integer"},did:{type:"string",format:"did"},migrateTo:{type:"string"},time:{type:"string",format:"datetime"}}},tombstone:{type:"object",description:"DEPRECATED -- Use #account event instead",required:["seq","did","time"],properties:{seq:{type:"integer"},did:{type:"string",format:"did"},time:{type:"string",format:"datetime"}}},info:{type:"object",required:["name"],properties:{name:{type:"string",knownValues:["OutdatedCursor"]},message:{type:"string"}}},repoOp:{type:"object",description:"A repo operation, ie a mutation of a single record.",required:["action","path","cid"],nullable:["cid"],properties:{action:{type:"string",knownValues:["create","update","delete"]},path:{type:"string"},cid:{type:"cid-link",description:"For creates and updates, the new record CID. For deletions, null."}}}}},ComAtprotoTempCheckSignupQueue:{lexicon:1,id:"com.atproto.temp.checkSignupQueue",defs:{main:{type:"query",description:"Check accounts location in signup queue.",output:{encoding:"application/json",schema:{type:"object",required:["activated"],properties:{activated:{type:"boolean"},placeInQueue:{type:"integer"},estimatedTimeMs:{type:"integer"}}}}}}},ComAtprotoTempFetchLabels:{lexicon:1,id:"com.atproto.temp.fetchLabels",defs:{main:{type:"query",description:"DEPRECATED: use queryLabels or subscribeLabels instead -- Fetch all labels from a labeler created after a certain date.",parameters:{type:"params",properties:{since:{type:"integer"},limit:{type:"integer",minimum:1,maximum:250,default:50}}},output:{encoding:"application/json",schema:{type:"object",required:["labels"],properties:{labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}}}}}},ComAtprotoTempRequestPhoneVerification:{lexicon:1,id:"com.atproto.temp.requestPhoneVerification",defs:{main:{type:"procedure",description:"Request a verification code to be sent to the supplied phone number",input:{encoding:"application/json",schema:{type:"object",required:["phoneNumber"],properties:{phoneNumber:{type:"string"}}}}}}},AppBskyActorDefs:{lexicon:1,id:"app.bsky.actor.defs",defs:{profileViewBasic:{type:"object",required:["did","handle"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},displayName:{type:"string",maxGraphemes:64,maxLength:640},avatar:{type:"string",format:"uri"},associated:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociated"},viewer:{type:"ref",ref:"lex:app.bsky.actor.defs#viewerState"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},createdAt:{type:"string",format:"datetime"}}},profileView:{type:"object",required:["did","handle"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},displayName:{type:"string",maxGraphemes:64,maxLength:640},description:{type:"string",maxGraphemes:256,maxLength:2560},avatar:{type:"string",format:"uri"},associated:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociated"},indexedAt:{type:"string",format:"datetime"},createdAt:{type:"string",format:"datetime"},viewer:{type:"ref",ref:"lex:app.bsky.actor.defs#viewerState"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}},profileViewDetailed:{type:"object",required:["did","handle"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},displayName:{type:"string",maxGraphemes:64,maxLength:640},description:{type:"string",maxGraphemes:256,maxLength:2560},avatar:{type:"string",format:"uri"},banner:{type:"string",format:"uri"},followersCount:{type:"integer"},followsCount:{type:"integer"},postsCount:{type:"integer"},associated:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociated"},joinedViaStarterPack:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackViewBasic"},indexedAt:{type:"string",format:"datetime"},createdAt:{type:"string",format:"datetime"},viewer:{type:"ref",ref:"lex:app.bsky.actor.defs#viewerState"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},pinnedPost:{type:"ref",ref:"lex:com.atproto.repo.strongRef"}}},profileAssociated:{type:"object",properties:{lists:{type:"integer"},feedgens:{type:"integer"},starterPacks:{type:"integer"},labeler:{type:"boolean"},chat:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociatedChat"}}},profileAssociatedChat:{type:"object",required:["allowIncoming"],properties:{allowIncoming:{type:"string",knownValues:["all","none","following"]}}},viewerState:{type:"object",description:"Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.",properties:{muted:{type:"boolean"},mutedByList:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewBasic"},blockedBy:{type:"boolean"},blocking:{type:"string",format:"at-uri"},blockingByList:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewBasic"},following:{type:"string",format:"at-uri"},followedBy:{type:"string",format:"at-uri"},knownFollowers:{type:"ref",ref:"lex:app.bsky.actor.defs#knownFollowers"}}},knownFollowers:{type:"object",description:"The subject's followers whom you also follow",required:["count","followers"],properties:{count:{type:"integer"},followers:{type:"array",minLength:0,maxLength:5,items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"}}}},preferences:{type:"array",items:{type:"union",refs:["lex:app.bsky.actor.defs#adultContentPref","lex:app.bsky.actor.defs#contentLabelPref","lex:app.bsky.actor.defs#savedFeedsPref","lex:app.bsky.actor.defs#savedFeedsPrefV2","lex:app.bsky.actor.defs#personalDetailsPref","lex:app.bsky.actor.defs#feedViewPref","lex:app.bsky.actor.defs#threadViewPref","lex:app.bsky.actor.defs#interestsPref","lex:app.bsky.actor.defs#mutedWordsPref","lex:app.bsky.actor.defs#hiddenPostsPref","lex:app.bsky.actor.defs#bskyAppStatePref","lex:app.bsky.actor.defs#labelersPref"]}},adultContentPref:{type:"object",required:["enabled"],properties:{enabled:{type:"boolean",default:!1}}},contentLabelPref:{type:"object",required:["label","visibility"],properties:{labelerDid:{type:"string",description:"Which labeler does this preference apply to? If undefined, applies globally.",format:"did"},label:{type:"string"},visibility:{type:"string",knownValues:["ignore","show","warn","hide"]}}},savedFeed:{type:"object",required:["id","type","value","pinned"],properties:{id:{type:"string"},type:{type:"string",knownValues:["feed","list","timeline"]},value:{type:"string"},pinned:{type:"boolean"}}},savedFeedsPrefV2:{type:"object",required:["items"],properties:{items:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#savedFeed"}}}},savedFeedsPref:{type:"object",required:["pinned","saved"],properties:{pinned:{type:"array",items:{type:"string",format:"at-uri"}},saved:{type:"array",items:{type:"string",format:"at-uri"}},timelineIndex:{type:"integer"}}},personalDetailsPref:{type:"object",properties:{birthDate:{type:"string",format:"datetime",description:"The birth date of account owner."}}},feedViewPref:{type:"object",required:["feed"],properties:{feed:{type:"string",description:"The URI of the feed, or an identifier which describes the feed."},hideReplies:{type:"boolean",description:"Hide replies in the feed."},hideRepliesByUnfollowed:{type:"boolean",description:"Hide replies in the feed if they are not by followed users.",default:!0},hideRepliesByLikeCount:{type:"integer",description:"Hide replies in the feed if they do not have this number of likes."},hideReposts:{type:"boolean",description:"Hide reposts in the feed."},hideQuotePosts:{type:"boolean",description:"Hide quote posts in the feed."}}},threadViewPref:{type:"object",properties:{sort:{type:"string",description:"Sorting mode for threads.",knownValues:["oldest","newest","most-likes","random"]},prioritizeFollowedUsers:{type:"boolean",description:"Show followed users at the top of all replies."}}},interestsPref:{type:"object",required:["tags"],properties:{tags:{type:"array",maxLength:100,items:{type:"string",maxLength:640,maxGraphemes:64},description:"A list of tags which describe the account owner's interests gathered during onboarding."}}},mutedWordTarget:{type:"string",knownValues:["content","tag"],maxLength:640,maxGraphemes:64},mutedWord:{type:"object",description:"A word that the account owner has muted.",required:["value","targets"],properties:{id:{type:"string"},value:{type:"string",description:"The muted word itself.",maxLength:1e4,maxGraphemes:1e3},targets:{type:"array",description:"The intended targets of the muted word.",items:{type:"ref",ref:"lex:app.bsky.actor.defs#mutedWordTarget"}},actorTarget:{type:"string",description:"Groups of users to apply the muted word to. If undefined, applies to all users.",knownValues:["all","exclude-following"],default:"all"},expiresAt:{type:"string",format:"datetime",description:"The date and time at which the muted word will expire and no longer be applied."}}},mutedWordsPref:{type:"object",required:["items"],properties:{items:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#mutedWord"},description:"A list of words the account owner has muted."}}},hiddenPostsPref:{type:"object",required:["items"],properties:{items:{type:"array",items:{type:"string",format:"at-uri"},description:"A list of URIs of posts the account owner has hidden."}}},labelersPref:{type:"object",required:["labelers"],properties:{labelers:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#labelerPrefItem"}}}},labelerPrefItem:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}},bskyAppStatePref:{description:"A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.",type:"object",properties:{activeProgressGuide:{type:"ref",ref:"lex:app.bsky.actor.defs#bskyAppProgressGuide"},queuedNudges:{description:"An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.",type:"array",maxLength:1e3,items:{type:"string",maxLength:100}},nuxs:{description:"Storage for NUXs the user has encountered.",type:"array",maxLength:100,items:{type:"ref",ref:"lex:app.bsky.actor.defs#nux"}}}},bskyAppProgressGuide:{description:"If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.",type:"object",required:["guide"],properties:{guide:{type:"string",maxLength:100}}},nux:{type:"object",description:"A new user experiences (NUX) storage object",required:["id","completed"],properties:{id:{type:"string",maxLength:100},completed:{type:"boolean",default:!1},data:{description:"Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.",type:"string",maxLength:3e3,maxGraphemes:300},expiresAt:{type:"string",format:"datetime",description:"The date and time at which the NUX will expire and should be considered completed."}}}}},AppBskyActorGetPreferences:{lexicon:1,id:"app.bsky.actor.getPreferences",defs:{main:{type:"query",description:"Get private preferences attached to the current account. Expected use is synchronization between multiple devices, and import/export during account migration. Requires auth.",parameters:{type:"params",properties:{}},output:{encoding:"application/json",schema:{type:"object",required:["preferences"],properties:{preferences:{type:"ref",ref:"lex:app.bsky.actor.defs#preferences"}}}}}}},AppBskyActorGetProfile:{lexicon:1,id:"app.bsky.actor.getProfile",defs:{main:{type:"query",description:"Get detailed profile view of an actor. Does not require auth, but contains relevant metadata with auth.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier",description:"Handle or DID of account to fetch profile of."}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewDetailed"}}}}},AppBskyActorGetProfiles:{lexicon:1,id:"app.bsky.actor.getProfiles",defs:{main:{type:"query",description:"Get detailed profile views of multiple actors.",parameters:{type:"params",required:["actors"],properties:{actors:{type:"array",items:{type:"string",format:"at-identifier"},maxLength:25}}},output:{encoding:"application/json",schema:{type:"object",required:["profiles"],properties:{profiles:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewDetailed"}}}}}}}},AppBskyActorGetSuggestions:{lexicon:1,id:"app.bsky.actor.getSuggestions",defs:{main:{type:"query",description:"Get a list of suggested actors. Expected use is discovery of accounts to follow during new account onboarding.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{cursor:{type:"string"},actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyActorProfile:{lexicon:1,id:"app.bsky.actor.profile",defs:{main:{type:"record",description:"A declaration of a Bluesky account profile.",key:"literal:self",record:{type:"object",properties:{displayName:{type:"string",maxGraphemes:64,maxLength:640},description:{type:"string",description:"Free-form profile description text.",maxGraphemes:256,maxLength:2560},avatar:{type:"blob",description:"Small image to be displayed next to posts from account. AKA, 'profile picture'",accept:["image/png","image/jpeg"],maxSize:1e6},banner:{type:"blob",description:"Larger horizontal image to display behind profile view.",accept:["image/png","image/jpeg"],maxSize:1e6},labels:{type:"union",description:"Self-label values, specific to the Bluesky application, on the overall account.",refs:["lex:com.atproto.label.defs#selfLabels"]},joinedViaStarterPack:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},pinnedPost:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyActorPutPreferences:{lexicon:1,id:"app.bsky.actor.putPreferences",defs:{main:{type:"procedure",description:"Set the private preferences attached to the account.",input:{encoding:"application/json",schema:{type:"object",required:["preferences"],properties:{preferences:{type:"ref",ref:"lex:app.bsky.actor.defs#preferences"}}}}}}},AppBskyActorSearchActors:{lexicon:1,id:"app.bsky.actor.searchActors",defs:{main:{type:"query",description:"Find actors (profiles) matching search criteria. Does not require auth.",parameters:{type:"params",properties:{term:{type:"string",description:"DEPRECATED: use 'q' instead."},q:{type:"string",description:"Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."},limit:{type:"integer",minimum:1,maximum:100,default:25},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{cursor:{type:"string"},actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyActorSearchActorsTypeahead:{lexicon:1,id:"app.bsky.actor.searchActorsTypeahead",defs:{main:{type:"query",description:"Find actor suggestions for a prefix search term. Expected use is for auto-completion during text field entry. Does not require auth.",parameters:{type:"params",properties:{term:{type:"string",description:"DEPRECATED: use 'q' instead."},q:{type:"string",description:"Search query prefix; not a full query string."},limit:{type:"integer",minimum:1,maximum:100,default:10}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"}}}}}}}},AppBskyEmbedDefs:{lexicon:1,id:"app.bsky.embed.defs",defs:{aspectRatio:{type:"object",description:"width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.",required:["width","height"],properties:{width:{type:"integer",minimum:1},height:{type:"integer",minimum:1}}}}},AppBskyEmbedExternal:{lexicon:1,id:"app.bsky.embed.external",defs:{main:{type:"object",description:"A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).",required:["external"],properties:{external:{type:"ref",ref:"lex:app.bsky.embed.external#external"}}},external:{type:"object",required:["uri","title","description"],properties:{uri:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},thumb:{type:"blob",accept:["image/*"],maxSize:1e6}}},view:{type:"object",required:["external"],properties:{external:{type:"ref",ref:"lex:app.bsky.embed.external#viewExternal"}}},viewExternal:{type:"object",required:["uri","title","description"],properties:{uri:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},thumb:{type:"string",format:"uri"}}}}},AppBskyEmbedImages:{lexicon:1,id:"app.bsky.embed.images",description:"A set of images embedded in a Bluesky record (eg, a post).",defs:{main:{type:"object",required:["images"],properties:{images:{type:"array",items:{type:"ref",ref:"lex:app.bsky.embed.images#image"},maxLength:4}}},image:{type:"object",required:["image","alt"],properties:{image:{type:"blob",accept:["image/*"],maxSize:1e6},alt:{type:"string",description:"Alt text description of the image, for accessibility."},aspectRatio:{type:"ref",ref:"lex:app.bsky.embed.defs#aspectRatio"}}},view:{type:"object",required:["images"],properties:{images:{type:"array",items:{type:"ref",ref:"lex:app.bsky.embed.images#viewImage"},maxLength:4}}},viewImage:{type:"object",required:["thumb","fullsize","alt"],properties:{thumb:{type:"string",format:"uri",description:"Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View."},fullsize:{type:"string",format:"uri",description:"Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View."},alt:{type:"string",description:"Alt text description of the image, for accessibility."},aspectRatio:{type:"ref",ref:"lex:app.bsky.embed.defs#aspectRatio"}}}}},AppBskyEmbedRecord:{lexicon:1,id:"app.bsky.embed.record",description:"A representation of a record embedded in a Bluesky record (eg, a post). For example, a quote-post, or sharing a feed generator record.",defs:{main:{type:"object",required:["record"],properties:{record:{type:"ref",ref:"lex:com.atproto.repo.strongRef"}}},view:{type:"object",required:["record"],properties:{record:{type:"union",refs:["lex:app.bsky.embed.record#viewRecord","lex:app.bsky.embed.record#viewNotFound","lex:app.bsky.embed.record#viewBlocked","lex:app.bsky.embed.record#viewDetached","lex:app.bsky.feed.defs#generatorView","lex:app.bsky.graph.defs#listView","lex:app.bsky.labeler.defs#labelerView","lex:app.bsky.graph.defs#starterPackViewBasic"]}}},viewRecord:{type:"object",required:["uri","cid","author","value","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},author:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"},value:{type:"unknown",description:"The record data itself."},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},replyCount:{type:"integer"},repostCount:{type:"integer"},likeCount:{type:"integer"},quoteCount:{type:"integer"},embeds:{type:"array",items:{type:"union",refs:["lex:app.bsky.embed.images#view","lex:app.bsky.embed.video#view","lex:app.bsky.embed.external#view","lex:app.bsky.embed.record#view","lex:app.bsky.embed.recordWithMedia#view"]}},indexedAt:{type:"string",format:"datetime"}}},viewNotFound:{type:"object",required:["uri","notFound"],properties:{uri:{type:"string",format:"at-uri"},notFound:{type:"boolean",const:!0}}},viewBlocked:{type:"object",required:["uri","blocked","author"],properties:{uri:{type:"string",format:"at-uri"},blocked:{type:"boolean",const:!0},author:{type:"ref",ref:"lex:app.bsky.feed.defs#blockedAuthor"}}},viewDetached:{type:"object",required:["uri","detached"],properties:{uri:{type:"string",format:"at-uri"},detached:{type:"boolean",const:!0}}}}},AppBskyEmbedRecordWithMedia:{lexicon:1,id:"app.bsky.embed.recordWithMedia",description:"A representation of a record embedded in a Bluesky record (eg, a post), alongside other compatible embeds. For example, a quote post and image, or a quote post and external URL card.",defs:{main:{type:"object",required:["record","media"],properties:{record:{type:"ref",ref:"lex:app.bsky.embed.record"},media:{type:"union",refs:["lex:app.bsky.embed.images","lex:app.bsky.embed.video","lex:app.bsky.embed.external"]}}},view:{type:"object",required:["record","media"],properties:{record:{type:"ref",ref:"lex:app.bsky.embed.record#view"},media:{type:"union",refs:["lex:app.bsky.embed.images#view","lex:app.bsky.embed.video#view","lex:app.bsky.embed.external#view"]}}}}},AppBskyEmbedVideo:{lexicon:1,id:"app.bsky.embed.video",description:"A video embedded in a Bluesky record (eg, a post).",defs:{main:{type:"object",required:["video"],properties:{video:{type:"blob",accept:["video/mp4"],maxSize:5e7},captions:{type:"array",items:{type:"ref",ref:"lex:app.bsky.embed.video#caption"},maxLength:20},alt:{type:"string",description:"Alt text description of the video, for accessibility.",maxGraphemes:1e3,maxLength:1e4},aspectRatio:{type:"ref",ref:"lex:app.bsky.embed.defs#aspectRatio"}}},caption:{type:"object",required:["lang","file"],properties:{lang:{type:"string",format:"language"},file:{type:"blob",accept:["text/vtt"],maxSize:2e4}}},view:{type:"object",required:["cid","playlist"],properties:{cid:{type:"string",format:"cid"},playlist:{type:"string",format:"uri"},thumbnail:{type:"string",format:"uri"},alt:{type:"string",maxGraphemes:1e3,maxLength:1e4},aspectRatio:{type:"ref",ref:"lex:app.bsky.embed.defs#aspectRatio"}}}}},AppBskyFeedDefs:{lexicon:1,id:"app.bsky.feed.defs",defs:{postView:{type:"object",required:["uri","cid","author","record","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},author:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"},record:{type:"unknown"},embed:{type:"union",refs:["lex:app.bsky.embed.images#view","lex:app.bsky.embed.video#view","lex:app.bsky.embed.external#view","lex:app.bsky.embed.record#view","lex:app.bsky.embed.recordWithMedia#view"]},replyCount:{type:"integer"},repostCount:{type:"integer"},likeCount:{type:"integer"},quoteCount:{type:"integer"},indexedAt:{type:"string",format:"datetime"},viewer:{type:"ref",ref:"lex:app.bsky.feed.defs#viewerState"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},threadgate:{type:"ref",ref:"lex:app.bsky.feed.defs#threadgateView"}}},viewerState:{type:"object",description:"Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.",properties:{repost:{type:"string",format:"at-uri"},like:{type:"string",format:"at-uri"},threadMuted:{type:"boolean"},replyDisabled:{type:"boolean"},embeddingDisabled:{type:"boolean"},pinned:{type:"boolean"}}},feedViewPost:{type:"object",required:["post"],properties:{post:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"},reply:{type:"ref",ref:"lex:app.bsky.feed.defs#replyRef"},reason:{type:"union",refs:["lex:app.bsky.feed.defs#reasonRepost","lex:app.bsky.feed.defs#reasonPin"]},feedContext:{type:"string",description:"Context provided by feed generator that may be passed back alongside interactions.",maxLength:2e3}}},replyRef:{type:"object",required:["root","parent"],properties:{root:{type:"union",refs:["lex:app.bsky.feed.defs#postView","lex:app.bsky.feed.defs#notFoundPost","lex:app.bsky.feed.defs#blockedPost"]},parent:{type:"union",refs:["lex:app.bsky.feed.defs#postView","lex:app.bsky.feed.defs#notFoundPost","lex:app.bsky.feed.defs#blockedPost"]},grandparentAuthor:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic",description:"When parent is a reply to another post, this is the author of that post."}}},reasonRepost:{type:"object",required:["by","indexedAt"],properties:{by:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"},indexedAt:{type:"string",format:"datetime"}}},reasonPin:{type:"object",properties:{}},threadViewPost:{type:"object",required:["post"],properties:{post:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"},parent:{type:"union",refs:["lex:app.bsky.feed.defs#threadViewPost","lex:app.bsky.feed.defs#notFoundPost","lex:app.bsky.feed.defs#blockedPost"]},replies:{type:"array",items:{type:"union",refs:["lex:app.bsky.feed.defs#threadViewPost","lex:app.bsky.feed.defs#notFoundPost","lex:app.bsky.feed.defs#blockedPost"]}}}},notFoundPost:{type:"object",required:["uri","notFound"],properties:{uri:{type:"string",format:"at-uri"},notFound:{type:"boolean",const:!0}}},blockedPost:{type:"object",required:["uri","blocked","author"],properties:{uri:{type:"string",format:"at-uri"},blocked:{type:"boolean",const:!0},author:{type:"ref",ref:"lex:app.bsky.feed.defs#blockedAuthor"}}},blockedAuthor:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"},viewer:{type:"ref",ref:"lex:app.bsky.actor.defs#viewerState"}}},generatorView:{type:"object",required:["uri","cid","did","creator","displayName","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},did:{type:"string",format:"did"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},displayName:{type:"string"},description:{type:"string",maxGraphemes:300,maxLength:3e3},descriptionFacets:{type:"array",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},avatar:{type:"string",format:"uri"},likeCount:{type:"integer",minimum:0},acceptsInteractions:{type:"boolean"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},viewer:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorViewerState"},indexedAt:{type:"string",format:"datetime"}}},generatorViewerState:{type:"object",properties:{like:{type:"string",format:"at-uri"}}},skeletonFeedPost:{type:"object",required:["post"],properties:{post:{type:"string",format:"at-uri"},reason:{type:"union",refs:["lex:app.bsky.feed.defs#skeletonReasonRepost","lex:app.bsky.feed.defs#skeletonReasonPin"]},feedContext:{type:"string",description:"Context that will be passed through to client and may be passed to feed generator back alongside interactions.",maxLength:2e3}}},skeletonReasonRepost:{type:"object",required:["repost"],properties:{repost:{type:"string",format:"at-uri"}}},skeletonReasonPin:{type:"object",properties:{}},threadgateView:{type:"object",properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},record:{type:"unknown"},lists:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewBasic"}}}},interaction:{type:"object",properties:{item:{type:"string",format:"at-uri"},event:{type:"string",knownValues:["app.bsky.feed.defs#requestLess","app.bsky.feed.defs#requestMore","app.bsky.feed.defs#clickthroughItem","app.bsky.feed.defs#clickthroughAuthor","app.bsky.feed.defs#clickthroughReposter","app.bsky.feed.defs#clickthroughEmbed","app.bsky.feed.defs#interactionSeen","app.bsky.feed.defs#interactionLike","app.bsky.feed.defs#interactionRepost","app.bsky.feed.defs#interactionReply","app.bsky.feed.defs#interactionQuote","app.bsky.feed.defs#interactionShare"]},feedContext:{type:"string",description:"Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.",maxLength:2e3}}},requestLess:{type:"token",description:"Request that less content like the given feed item be shown in the feed"},requestMore:{type:"token",description:"Request that more content like the given feed item be shown in the feed"},clickthroughItem:{type:"token",description:"User clicked through to the feed item"},clickthroughAuthor:{type:"token",description:"User clicked through to the author of the feed item"},clickthroughReposter:{type:"token",description:"User clicked through to the reposter of the feed item"},clickthroughEmbed:{type:"token",description:"User clicked through to the embedded content of the feed item"},interactionSeen:{type:"token",description:"Feed item was seen by user"},interactionLike:{type:"token",description:"User liked the feed item"},interactionRepost:{type:"token",description:"User reposted the feed item"},interactionReply:{type:"token",description:"User replied to the feed item"},interactionQuote:{type:"token",description:"User quoted the feed item"},interactionShare:{type:"token",description:"User shared the feed item"}}},AppBskyFeedDescribeFeedGenerator:{lexicon:1,id:"app.bsky.feed.describeFeedGenerator",defs:{main:{type:"query",description:"Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View).",output:{encoding:"application/json",schema:{type:"object",required:["did","feeds"],properties:{did:{type:"string",format:"did"},feeds:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.describeFeedGenerator#feed"}},links:{type:"ref",ref:"lex:app.bsky.feed.describeFeedGenerator#links"}}}}},feed:{type:"object",required:["uri"],properties:{uri:{type:"string",format:"at-uri"}}},links:{type:"object",properties:{privacyPolicy:{type:"string"},termsOfService:{type:"string"}}}}},AppBskyFeedGenerator:{lexicon:1,id:"app.bsky.feed.generator",defs:{main:{type:"record",description:"Record declaring of the existence of a feed generator, and containing metadata about it. The record can exist in any repository.",key:"any",record:{type:"object",required:["did","displayName","createdAt"],properties:{did:{type:"string",format:"did"},displayName:{type:"string",maxGraphemes:24,maxLength:240},description:{type:"string",maxGraphemes:300,maxLength:3e3},descriptionFacets:{type:"array",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},avatar:{type:"blob",accept:["image/png","image/jpeg"],maxSize:1e6},acceptsInteractions:{type:"boolean",description:"Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions"},labels:{type:"union",description:"Self-label values",refs:["lex:com.atproto.label.defs#selfLabels"]},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyFeedGetActorFeeds:{lexicon:1,id:"app.bsky.feed.getActorFeeds",defs:{main:{type:"query",description:"Get a list of feeds (feed generator records) created by the actor (in the actor's repo).",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feeds"],properties:{cursor:{type:"string"},feeds:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"}}}}}}}},AppBskyFeedGetActorLikes:{lexicon:1,id:"app.bsky.feed.getActorLikes",defs:{main:{type:"query",description:"Get a list of posts liked by an actor. Requires auth, actor must be the requesting account.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#feedViewPost"}}}}},errors:[{name:"BlockedActor"},{name:"BlockedByActor"}]}}},AppBskyFeedGetAuthorFeed:{lexicon:1,id:"app.bsky.feed.getAuthorFeed",defs:{main:{type:"query",description:"Get a view of an actor's 'author feed' (post and reposts by the author). Does not require auth.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},filter:{type:"string",description:"Combinations of post/repost types to include in response.",knownValues:["posts_with_replies","posts_no_replies","posts_with_media","posts_and_author_threads"],default:"posts_with_replies"},includePins:{type:"boolean",default:!1}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#feedViewPost"}}}}},errors:[{name:"BlockedActor"},{name:"BlockedByActor"}]}}},AppBskyFeedGetFeed:{lexicon:1,id:"app.bsky.feed.getFeed",defs:{main:{type:"query",description:"Get a hydrated feed from an actor's selected feed generator. Implemented by App View.",parameters:{type:"params",required:["feed"],properties:{feed:{type:"string",format:"at-uri"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#feedViewPost"}}}}},errors:[{name:"UnknownFeed"}]}}},AppBskyFeedGetFeedGenerator:{lexicon:1,id:"app.bsky.feed.getFeedGenerator",defs:{main:{type:"query",description:"Get information about a feed generator. Implemented by AppView.",parameters:{type:"params",required:["feed"],properties:{feed:{type:"string",format:"at-uri",description:"AT-URI of the feed generator record."}}},output:{encoding:"application/json",schema:{type:"object",required:["view","isOnline","isValid"],properties:{view:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"},isOnline:{type:"boolean",description:"Indicates whether the feed generator service has been online recently, or else seems to be inactive."},isValid:{type:"boolean",description:"Indicates whether the feed generator service is compatible with the record declaration."}}}}}}},AppBskyFeedGetFeedGenerators:{lexicon:1,id:"app.bsky.feed.getFeedGenerators",defs:{main:{type:"query",description:"Get information about a list of feed generators.",parameters:{type:"params",required:["feeds"],properties:{feeds:{type:"array",items:{type:"string",format:"at-uri"}}}},output:{encoding:"application/json",schema:{type:"object",required:["feeds"],properties:{feeds:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"}}}}}}}},AppBskyFeedGetFeedSkeleton:{lexicon:1,id:"app.bsky.feed.getFeedSkeleton",defs:{main:{type:"query",description:"Get a skeleton of a feed provided by a feed generator. Auth is optional, depending on provider requirements, and provides the DID of the requester. Implemented by Feed Generator Service.",parameters:{type:"params",required:["feed"],properties:{feed:{type:"string",format:"at-uri",description:"Reference to feed generator record describing the specific feed being requested."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#skeletonFeedPost"}}}}},errors:[{name:"UnknownFeed"}]}}},AppBskyFeedGetLikes:{lexicon:1,id:"app.bsky.feed.getLikes",defs:{main:{type:"query",description:"Get like records which reference a subject (by AT-URI and CID).",parameters:{type:"params",required:["uri"],properties:{uri:{type:"string",format:"at-uri",description:"AT-URI of the subject (eg, a post record)."},cid:{type:"string",format:"cid",description:"CID of the subject record (aka, specific version of record), to filter likes."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","likes"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},cursor:{type:"string"},likes:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.getLikes#like"}}}}}},like:{type:"object",required:["indexedAt","createdAt","actor"],properties:{indexedAt:{type:"string",format:"datetime"},createdAt:{type:"string",format:"datetime"},actor:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}},AppBskyFeedGetListFeed:{lexicon:1,id:"app.bsky.feed.getListFeed",defs:{main:{type:"query",description:"Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth.",parameters:{type:"params",required:["list"],properties:{list:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the list record."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#feedViewPost"}}}}},errors:[{name:"UnknownList"}]}}},AppBskyFeedGetPostThread:{lexicon:1,id:"app.bsky.feed.getPostThread",defs:{main:{type:"query",description:"Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests.",parameters:{type:"params",required:["uri"],properties:{uri:{type:"string",format:"at-uri",description:"Reference (AT-URI) to post record."},depth:{type:"integer",description:"How many levels of reply depth should be included in response.",default:6,minimum:0,maximum:1e3},parentHeight:{type:"integer",description:"How many levels of parent (and grandparent, etc) post to include.",default:80,minimum:0,maximum:1e3}}},output:{encoding:"application/json",schema:{type:"object",required:["thread"],properties:{thread:{type:"union",refs:["lex:app.bsky.feed.defs#threadViewPost","lex:app.bsky.feed.defs#notFoundPost","lex:app.bsky.feed.defs#blockedPost"]},threadgate:{type:"ref",ref:"lex:app.bsky.feed.defs#threadgateView"}}}},errors:[{name:"NotFound"}]}}},AppBskyFeedGetPosts:{lexicon:1,id:"app.bsky.feed.getPosts",defs:{main:{type:"query",description:"Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.",parameters:{type:"params",required:["uris"],properties:{uris:{type:"array",description:"List of post AT-URIs to return hydrated views for.",items:{type:"string",format:"at-uri"},maxLength:25}}},output:{encoding:"application/json",schema:{type:"object",required:["posts"],properties:{posts:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"}}}}}}}},AppBskyFeedGetQuotes:{lexicon:1,id:"app.bsky.feed.getQuotes",defs:{main:{type:"query",description:"Get a list of quotes for a given post.",parameters:{type:"params",required:["uri"],properties:{uri:{type:"string",format:"at-uri",description:"Reference (AT-URI) of post record"},cid:{type:"string",format:"cid",description:"If supplied, filters to quotes of specific version (by CID) of the post record."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","posts"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},cursor:{type:"string"},posts:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"}}}}}}}},AppBskyFeedGetRepostedBy:{lexicon:1,id:"app.bsky.feed.getRepostedBy",defs:{main:{type:"query",description:"Get a list of reposts for a given post.",parameters:{type:"params",required:["uri"],properties:{uri:{type:"string",format:"at-uri",description:"Reference (AT-URI) of post record"},cid:{type:"string",format:"cid",description:"If supplied, filters to reposts of specific version (by CID) of the post record."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["uri","repostedBy"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},cursor:{type:"string"},repostedBy:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyFeedGetSuggestedFeeds:{lexicon:1,id:"app.bsky.feed.getSuggestedFeeds",defs:{main:{type:"query",description:"Get a list of suggested feeds (feed generators) for the requesting account.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feeds"],properties:{cursor:{type:"string"},feeds:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"}}}}}}}},AppBskyFeedGetTimeline:{lexicon:1,id:"app.bsky.feed.getTimeline",defs:{main:{type:"query",description:"Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed.",parameters:{type:"params",properties:{algorithm:{type:"string",description:"Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feed"],properties:{cursor:{type:"string"},feed:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#feedViewPost"}}}}}}}},AppBskyFeedLike:{lexicon:1,id:"app.bsky.feed.like",defs:{main:{type:"record",description:"Record declaring a 'like' of a piece of subject content.",key:"tid",record:{type:"object",required:["subject","createdAt"],properties:{subject:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyFeedPost:{lexicon:1,id:"app.bsky.feed.post",defs:{main:{type:"record",description:"Record containing a Bluesky post.",key:"tid",record:{type:"object",required:["text","createdAt"],properties:{text:{type:"string",maxLength:3e3,maxGraphemes:300,description:"The primary post content. May be an empty string, if there are embeds."},entities:{type:"array",description:"DEPRECATED: replaced by app.bsky.richtext.facet.",items:{type:"ref",ref:"lex:app.bsky.feed.post#entity"}},facets:{type:"array",description:"Annotations of text (mentions, URLs, hashtags, etc)",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},reply:{type:"ref",ref:"lex:app.bsky.feed.post#replyRef"},embed:{type:"union",refs:["lex:app.bsky.embed.images","lex:app.bsky.embed.video","lex:app.bsky.embed.external","lex:app.bsky.embed.record","lex:app.bsky.embed.recordWithMedia"]},langs:{type:"array",description:"Indicates human language of post primary text content.",maxLength:3,items:{type:"string",format:"language"}},labels:{type:"union",description:"Self-label values for this post. Effectively content warnings.",refs:["lex:com.atproto.label.defs#selfLabels"]},tags:{type:"array",description:"Additional hashtags, in addition to any included in post text and facets.",maxLength:8,items:{type:"string",maxLength:640,maxGraphemes:64}},createdAt:{type:"string",format:"datetime",description:"Client-declared timestamp when this post was originally created."}}}},replyRef:{type:"object",required:["root","parent"],properties:{root:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},parent:{type:"ref",ref:"lex:com.atproto.repo.strongRef"}}},entity:{type:"object",description:"Deprecated: use facets instead.",required:["index","type","value"],properties:{index:{type:"ref",ref:"lex:app.bsky.feed.post#textSlice"},type:{type:"string",description:"Expected values are 'mention' and 'link'."},value:{type:"string"}}},textSlice:{type:"object",description:"Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings.",required:["start","end"],properties:{start:{type:"integer",minimum:0},end:{type:"integer",minimum:0}}}}},AppBskyFeedPostgate:{lexicon:1,id:"app.bsky.feed.postgate",defs:{main:{type:"record",key:"tid",description:"Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository.",record:{type:"object",required:["post","createdAt"],properties:{createdAt:{type:"string",format:"datetime"},post:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the post record."},detachedEmbeddingUris:{type:"array",maxLength:50,items:{type:"string",format:"at-uri"},description:"List of AT-URIs embedding this post that the author has detached from."},embeddingRules:{type:"array",maxLength:5,items:{type:"union",refs:["lex:app.bsky.feed.postgate#disableRule"]}}}}},disableRule:{type:"object",description:"Disables embedding of this post.",properties:{}}}},AppBskyFeedRepost:{lexicon:1,id:"app.bsky.feed.repost",defs:{main:{description:"Record representing a 'repost' of an existing Bluesky post.",type:"record",key:"tid",record:{type:"object",required:["subject","createdAt"],properties:{subject:{type:"ref",ref:"lex:com.atproto.repo.strongRef"},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyFeedSearchPosts:{lexicon:1,id:"app.bsky.feed.searchPosts",defs:{main:{type:"query",description:"Find posts matching search criteria, returning views of those posts.",parameters:{type:"params",required:["q"],properties:{q:{type:"string",description:"Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."},sort:{type:"string",knownValues:["top","latest"],default:"latest",description:"Specifies the ranking order of results."},since:{type:"string",description:"Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD)."},until:{type:"string",description:"Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD)."},mentions:{type:"string",format:"at-identifier",description:"Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions."},author:{type:"string",format:"at-identifier",description:"Filter to posts by the given account. Handles are resolved to DID before query-time."},lang:{type:"string",format:"language",description:"Filter to posts in the given language. Expected to be based on post language field, though server may override language detection."},domain:{type:"string",description:"Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization."},url:{type:"string",format:"uri",description:"Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching."},tag:{type:"array",items:{type:"string",maxLength:640,maxGraphemes:64},description:"Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching."},limit:{type:"integer",minimum:1,maximum:100,default:25},cursor:{type:"string",description:"Optional pagination mechanism; may not necessarily allow scrolling through entire result set."}}},output:{encoding:"application/json",schema:{type:"object",required:["posts"],properties:{cursor:{type:"string"},hitsTotal:{type:"integer",description:"Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits."},posts:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#postView"}}}}},errors:[{name:"BadQueryString"}]}}},AppBskyFeedSendInteractions:{lexicon:1,id:"app.bsky.feed.sendInteractions",defs:{main:{type:"procedure",description:"Send information about interactions with feed items back to the feed generator that served them.",input:{encoding:"application/json",schema:{type:"object",required:["interactions"],properties:{interactions:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#interaction"}}}}},output:{encoding:"application/json",schema:{type:"object",properties:{}}}}}},AppBskyFeedThreadgate:{lexicon:1,id:"app.bsky.feed.threadgate",defs:{main:{type:"record",key:"tid",description:"Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.",record:{type:"object",required:["post","createdAt"],properties:{post:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the post record."},allow:{type:"array",maxLength:5,items:{type:"union",refs:["lex:app.bsky.feed.threadgate#mentionRule","lex:app.bsky.feed.threadgate#followingRule","lex:app.bsky.feed.threadgate#listRule"]}},createdAt:{type:"string",format:"datetime"},hiddenReplies:{type:"array",maxLength:50,items:{type:"string",format:"at-uri"},description:"List of hidden reply URIs."}}}},mentionRule:{type:"object",description:"Allow replies from actors mentioned in your post.",properties:{}},followingRule:{type:"object",description:"Allow replies from actors you follow.",properties:{}},listRule:{type:"object",description:"Allow replies from actors on a list.",required:["list"],properties:{list:{type:"string",format:"at-uri"}}}}},AppBskyGraphBlock:{lexicon:1,id:"app.bsky.graph.block",defs:{main:{type:"record",description:"Record declaring a 'block' relationship against another account. NOTE: blocks are public in Bluesky; see blog posts for details.",key:"tid",record:{type:"object",required:["subject","createdAt"],properties:{subject:{type:"string",format:"did",description:"DID of the account to be blocked."},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyGraphDefs:{lexicon:1,id:"app.bsky.graph.defs",defs:{listViewBasic:{type:"object",required:["uri","cid","name","purpose"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},name:{type:"string",maxLength:64,minLength:1},purpose:{type:"ref",ref:"lex:app.bsky.graph.defs#listPurpose"},avatar:{type:"string",format:"uri"},listItemCount:{type:"integer",minimum:0},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},viewer:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewerState"},indexedAt:{type:"string",format:"datetime"}}},listView:{type:"object",required:["uri","cid","creator","name","purpose","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},name:{type:"string",maxLength:64,minLength:1},purpose:{type:"ref",ref:"lex:app.bsky.graph.defs#listPurpose"},description:{type:"string",maxGraphemes:300,maxLength:3e3},descriptionFacets:{type:"array",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},avatar:{type:"string",format:"uri"},listItemCount:{type:"integer",minimum:0},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},viewer:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewerState"},indexedAt:{type:"string",format:"datetime"}}},listItemView:{type:"object",required:["uri","subject"],properties:{uri:{type:"string",format:"at-uri"},subject:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}},starterPackView:{type:"object",required:["uri","cid","record","creator","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},record:{type:"unknown"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"},list:{type:"ref",ref:"lex:app.bsky.graph.defs#listViewBasic"},listItemsSample:{type:"array",maxLength:12,items:{type:"ref",ref:"lex:app.bsky.graph.defs#listItemView"}},feeds:{type:"array",maxLength:3,items:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"}},joinedWeekCount:{type:"integer",minimum:0},joinedAllTimeCount:{type:"integer",minimum:0},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},indexedAt:{type:"string",format:"datetime"}}},starterPackViewBasic:{type:"object",required:["uri","cid","record","creator","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},record:{type:"unknown"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewBasic"},listItemCount:{type:"integer",minimum:0},joinedWeekCount:{type:"integer",minimum:0},joinedAllTimeCount:{type:"integer",minimum:0},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},indexedAt:{type:"string",format:"datetime"}}},listPurpose:{type:"string",knownValues:["app.bsky.graph.defs#modlist","app.bsky.graph.defs#curatelist","app.bsky.graph.defs#referencelist"]},modlist:{type:"token",description:"A list of actors to apply an aggregate moderation action (mute/block) on."},curatelist:{type:"token",description:"A list of actors used for curation purposes such as list feeds or interaction gating."},referencelist:{type:"token",description:"A list of actors used for only for reference purposes such as within a starter pack."},listViewerState:{type:"object",properties:{muted:{type:"boolean"},blocked:{type:"string",format:"at-uri"}}},notFoundActor:{type:"object",description:"indicates that a handle or DID could not be resolved",required:["actor","notFound"],properties:{actor:{type:"string",format:"at-identifier"},notFound:{type:"boolean",const:!0}}},relationship:{type:"object",description:"lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)",required:["did"],properties:{did:{type:"string",format:"did"},following:{type:"string",format:"at-uri",description:"if the actor follows this DID, this is the AT-URI of the follow record"},followedBy:{type:"string",format:"at-uri",description:"if the actor is followed by this DID, contains the AT-URI of the follow record"}}}}},AppBskyGraphFollow:{lexicon:1,id:"app.bsky.graph.follow",defs:{main:{type:"record",description:"Record declaring a social 'follow' relationship of another account. Duplicate follows will be ignored by the AppView.",key:"tid",record:{type:"object",required:["subject","createdAt"],properties:{subject:{type:"string",format:"did"},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyGraphGetActorStarterPacks:{lexicon:1,id:"app.bsky.graph.getActorStarterPacks",defs:{main:{type:"query",description:"Get a list of starter packs created by the actor.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacks"],properties:{cursor:{type:"string"},starterPacks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackViewBasic"}}}}}}}},AppBskyGraphGetBlocks:{lexicon:1,id:"app.bsky.graph.getBlocks",defs:{main:{type:"query",description:"Enumerates which accounts the requesting account is currently blocking. Requires auth.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["blocks"],properties:{cursor:{type:"string"},blocks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyGraphGetFollowers:{lexicon:1,id:"app.bsky.graph.getFollowers",defs:{main:{type:"query",description:"Enumerates accounts which follow a specified account (actor).",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["subject","followers"],properties:{subject:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},cursor:{type:"string"},followers:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyGraphGetFollows:{lexicon:1,id:"app.bsky.graph.getFollows",defs:{main:{type:"query",description:"Enumerates accounts which a specified account (actor) follows.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["subject","follows"],properties:{subject:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},cursor:{type:"string"},follows:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyGraphGetKnownFollowers:{lexicon:1,id:"app.bsky.graph.getKnownFollowers",defs:{main:{type:"query",description:"Enumerates accounts which follow a specified account (actor) and are followed by the viewer.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["subject","followers"],properties:{subject:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},cursor:{type:"string"},followers:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyGraphGetList:{lexicon:1,id:"app.bsky.graph.getList",defs:{main:{type:"query",description:"Gets a 'view' (with additional context) of a specified list.",parameters:{type:"params",required:["list"],properties:{list:{type:"string",format:"at-uri",description:"Reference (AT-URI) of the list record to hydrate."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["list","items"],properties:{cursor:{type:"string"},list:{type:"ref",ref:"lex:app.bsky.graph.defs#listView"},items:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#listItemView"}}}}}}}},AppBskyGraphGetListBlocks:{lexicon:1,id:"app.bsky.graph.getListBlocks",defs:{main:{type:"query",description:"Get mod lists that the requesting account (actor) is blocking. Requires auth.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["lists"],properties:{cursor:{type:"string"},lists:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#listView"}}}}}}}},AppBskyGraphGetListMutes:{lexicon:1,id:"app.bsky.graph.getListMutes",defs:{main:{type:"query",description:"Enumerates mod lists that the requesting account (actor) currently has muted. Requires auth.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["lists"],properties:{cursor:{type:"string"},lists:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#listView"}}}}}}}},AppBskyGraphGetLists:{lexicon:1,id:"app.bsky.graph.getLists",defs:{main:{type:"query",description:"Enumerates the lists created by a specified account (actor).",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier",description:"The account (actor) to enumerate lists from."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["lists"],properties:{cursor:{type:"string"},lists:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#listView"}}}}}}}},AppBskyGraphGetMutes:{lexicon:1,id:"app.bsky.graph.getMutes",defs:{main:{type:"query",description:"Enumerates accounts that the requesting account (actor) currently has muted. Requires auth.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["mutes"],properties:{cursor:{type:"string"},mutes:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}}}}}}}},AppBskyGraphGetRelationships:{lexicon:1,id:"app.bsky.graph.getRelationships",defs:{main:{type:"query",description:"Enumerates public relationships between one account, and a list of other accounts. Does not require auth.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier",description:"Primary account requesting relationships for."},others:{type:"array",description:"List of 'other' accounts to be related back to the primary.",maxLength:30,items:{type:"string",format:"at-identifier"}}}},output:{encoding:"application/json",schema:{type:"object",required:["relationships"],properties:{actor:{type:"string",format:"did"},relationships:{type:"array",items:{type:"union",refs:["lex:app.bsky.graph.defs#relationship","lex:app.bsky.graph.defs#notFoundActor"]}}}}},errors:[{name:"ActorNotFound",description:"the primary actor at-identifier could not be resolved"}]}}},AppBskyGraphGetStarterPack:{lexicon:1,id:"app.bsky.graph.getStarterPack",defs:{main:{type:"query",description:"Gets a view of a starter pack.",parameters:{type:"params",required:["starterPack"],properties:{starterPack:{type:"string",format:"at-uri",description:"Reference (AT-URI) of the starter pack record."}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPack"],properties:{starterPack:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackView"}}}}}}},AppBskyGraphGetStarterPacks:{lexicon:1,id:"app.bsky.graph.getStarterPacks",defs:{main:{type:"query",description:"Get views for a list of starter packs.",parameters:{type:"params",required:["uris"],properties:{uris:{type:"array",items:{type:"string",format:"at-uri"},maxLength:25}}},output:{encoding:"application/json",schema:{type:"object",required:["starterPacks"],properties:{starterPacks:{type:"array",items:{type:"ref",ref:"lex:app.bsky.graph.defs#starterPackViewBasic"}}}}}}}},AppBskyGraphGetSuggestedFollowsByActor:{lexicon:1,id:"app.bsky.graph.getSuggestedFollowsByActor",defs:{main:{type:"query",description:"Enumerates follows similar to a given account (actor). Expected use is to recommend additional accounts immediately after following one account.",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"}}},output:{encoding:"application/json",schema:{type:"object",required:["suggestions"],properties:{suggestions:{type:"array",items:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"}},isFallback:{type:"boolean",description:"If true, response has fallen-back to generic results, and is not scoped using relativeToDid",default:!1}}}}}}},AppBskyGraphList:{lexicon:1,id:"app.bsky.graph.list",defs:{main:{type:"record",description:"Record representing a list of accounts (actors). Scope includes both moderation-oriented lists and curration-oriented lists.",key:"tid",record:{type:"object",required:["name","purpose","createdAt"],properties:{purpose:{type:"ref",description:"Defines the purpose of the list (aka, moderation-oriented or curration-oriented)",ref:"lex:app.bsky.graph.defs#listPurpose"},name:{type:"string",maxLength:64,minLength:1,description:"Display name for list; can not be empty."},description:{type:"string",maxGraphemes:300,maxLength:3e3},descriptionFacets:{type:"array",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},avatar:{type:"blob",accept:["image/png","image/jpeg"],maxSize:1e6},labels:{type:"union",refs:["lex:com.atproto.label.defs#selfLabels"]},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyGraphListblock:{lexicon:1,id:"app.bsky.graph.listblock",defs:{main:{type:"record",description:"Record representing a block relationship against an entire an entire list of accounts (actors).",key:"tid",record:{type:"object",required:["subject","createdAt"],properties:{subject:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the mod list record."},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyGraphListitem:{lexicon:1,id:"app.bsky.graph.listitem",defs:{main:{type:"record",description:"Record representing an account's inclusion on a specific list. The AppView will ignore duplicate listitem records.",key:"tid",record:{type:"object",required:["subject","list","createdAt"],properties:{subject:{type:"string",format:"did",description:"The account which is included on the list."},list:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the list record (app.bsky.graph.list)."},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyGraphMuteActor:{lexicon:1,id:"app.bsky.graph.muteActor",defs:{main:{type:"procedure",description:"Creates a mute relationship for the specified account. Mutes are private in Bluesky. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"}}}}}}},AppBskyGraphMuteActorList:{lexicon:1,id:"app.bsky.graph.muteActorList",defs:{main:{type:"procedure",description:"Creates a mute relationship for the specified list of accounts. Mutes are private in Bluesky. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["list"],properties:{list:{type:"string",format:"at-uri"}}}}}}},AppBskyGraphMuteThread:{lexicon:1,id:"app.bsky.graph.muteThread",defs:{main:{type:"procedure",description:"Mutes a thread preventing notifications from the thread and any of its children. Mutes are private in Bluesky. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["root"],properties:{root:{type:"string",format:"at-uri"}}}}}}},AppBskyGraphStarterpack:{lexicon:1,id:"app.bsky.graph.starterpack",defs:{main:{type:"record",description:"Record defining a starter pack of actors and feeds for new users.",key:"tid",record:{type:"object",required:["name","list","createdAt"],properties:{name:{type:"string",maxGraphemes:50,maxLength:500,minLength:1,description:"Display name for starter pack; can not be empty."},description:{type:"string",maxGraphemes:300,maxLength:3e3},descriptionFacets:{type:"array",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},list:{type:"string",format:"at-uri",description:"Reference (AT-URI) to the list record."},feeds:{type:"array",maxLength:3,items:{type:"ref",ref:"lex:app.bsky.graph.starterpack#feedItem"}},createdAt:{type:"string",format:"datetime"}}}},feedItem:{type:"object",required:["uri"],properties:{uri:{type:"string",format:"at-uri"}}}}},AppBskyGraphUnmuteActor:{lexicon:1,id:"app.bsky.graph.unmuteActor",defs:{main:{type:"procedure",description:"Unmutes the specified account. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["actor"],properties:{actor:{type:"string",format:"at-identifier"}}}}}}},AppBskyGraphUnmuteActorList:{lexicon:1,id:"app.bsky.graph.unmuteActorList",defs:{main:{type:"procedure",description:"Unmutes the specified list of accounts. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["list"],properties:{list:{type:"string",format:"at-uri"}}}}}}},AppBskyGraphUnmuteThread:{lexicon:1,id:"app.bsky.graph.unmuteThread",defs:{main:{type:"procedure",description:"Unmutes the specified thread. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["root"],properties:{root:{type:"string",format:"at-uri"}}}}}}},AppBskyLabelerDefs:{lexicon:1,id:"app.bsky.labeler.defs",defs:{labelerView:{type:"object",required:["uri","cid","creator","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},likeCount:{type:"integer",minimum:0},viewer:{type:"ref",ref:"lex:app.bsky.labeler.defs#labelerViewerState"},indexedAt:{type:"string",format:"datetime"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}},labelerViewDetailed:{type:"object",required:["uri","cid","creator","policies","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},creator:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},policies:{type:"ref",ref:"lex:app.bsky.labeler.defs#labelerPolicies"},likeCount:{type:"integer",minimum:0},viewer:{type:"ref",ref:"lex:app.bsky.labeler.defs#labelerViewerState"},indexedAt:{type:"string",format:"datetime"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}},labelerViewerState:{type:"object",properties:{like:{type:"string",format:"at-uri"}}},labelerPolicies:{type:"object",required:["labelValues"],properties:{labelValues:{type:"array",description:"The label values which this labeler publishes. May include global or custom labels.",items:{type:"ref",ref:"lex:com.atproto.label.defs#labelValue"}},labelValueDefinitions:{type:"array",description:"Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.",items:{type:"ref",ref:"lex:com.atproto.label.defs#labelValueDefinition"}}}}}},AppBskyLabelerGetServices:{lexicon:1,id:"app.bsky.labeler.getServices",defs:{main:{type:"query",description:"Get information about a list of labeler services.",parameters:{type:"params",required:["dids"],properties:{dids:{type:"array",items:{type:"string",format:"did"}},detailed:{type:"boolean",default:!1}}},output:{encoding:"application/json",schema:{type:"object",required:["views"],properties:{views:{type:"array",items:{type:"union",refs:["lex:app.bsky.labeler.defs#labelerView","lex:app.bsky.labeler.defs#labelerViewDetailed"]}}}}}}}},AppBskyLabelerService:{lexicon:1,id:"app.bsky.labeler.service",defs:{main:{type:"record",description:"A declaration of the existence of labeler service.",key:"literal:self",record:{type:"object",required:["policies","createdAt"],properties:{policies:{type:"ref",ref:"lex:app.bsky.labeler.defs#labelerPolicies"},labels:{type:"union",refs:["lex:com.atproto.label.defs#selfLabels"]},createdAt:{type:"string",format:"datetime"}}}}}},AppBskyNotificationGetUnreadCount:{lexicon:1,id:"app.bsky.notification.getUnreadCount",defs:{main:{type:"query",description:"Count the number of unread notifications for the requesting account. Requires auth.",parameters:{type:"params",properties:{priority:{type:"boolean"},seenAt:{type:"string",format:"datetime"}}},output:{encoding:"application/json",schema:{type:"object",required:["count"],properties:{count:{type:"integer"}}}}}}},AppBskyNotificationListNotifications:{lexicon:1,id:"app.bsky.notification.listNotifications",defs:{main:{type:"query",description:"Enumerate notifications for the requesting account. Requires auth.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},priority:{type:"boolean"},cursor:{type:"string"},seenAt:{type:"string",format:"datetime"}}},output:{encoding:"application/json",schema:{type:"object",required:["notifications"],properties:{cursor:{type:"string"},notifications:{type:"array",items:{type:"ref",ref:"lex:app.bsky.notification.listNotifications#notification"}},priority:{type:"boolean"},seenAt:{type:"string",format:"datetime"}}}}},notification:{type:"object",required:["uri","cid","author","reason","record","isRead","indexedAt"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},author:{type:"ref",ref:"lex:app.bsky.actor.defs#profileView"},reason:{type:"string",description:"Expected values are 'like', 'repost', 'follow', 'mention', 'reply', 'quote', and 'starterpack-joined'.",knownValues:["like","repost","follow","mention","reply","quote","starterpack-joined"]},reasonSubject:{type:"string",format:"at-uri"},record:{type:"unknown"},isRead:{type:"boolean"},indexedAt:{type:"string",format:"datetime"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}}}}}},AppBskyNotificationPutPreferences:{lexicon:1,id:"app.bsky.notification.putPreferences",defs:{main:{type:"procedure",description:"Set notification-related preferences for an account. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["priority"],properties:{priority:{type:"boolean"}}}}}}},AppBskyNotificationRegisterPush:{lexicon:1,id:"app.bsky.notification.registerPush",defs:{main:{type:"procedure",description:"Register to receive push notifications, via a specified service, for the requesting account. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["serviceDid","token","platform","appId"],properties:{serviceDid:{type:"string",format:"did"},token:{type:"string"},platform:{type:"string",knownValues:["ios","android","web"]},appId:{type:"string"}}}}}}},AppBskyNotificationUpdateSeen:{lexicon:1,id:"app.bsky.notification.updateSeen",defs:{main:{type:"procedure",description:"Notify server that the requesting account has seen notifications. Requires auth.",input:{encoding:"application/json",schema:{type:"object",required:["seenAt"],properties:{seenAt:{type:"string",format:"datetime"}}}}}}},AppBskyRichtextFacet:{lexicon:1,id:"app.bsky.richtext.facet",defs:{main:{type:"object",description:"Annotation of a sub-string within rich text.",required:["index","features"],properties:{index:{type:"ref",ref:"lex:app.bsky.richtext.facet#byteSlice"},features:{type:"array",items:{type:"union",refs:["lex:app.bsky.richtext.facet#mention","lex:app.bsky.richtext.facet#link","lex:app.bsky.richtext.facet#tag"]}}}},mention:{type:"object",description:"Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.",required:["did"],properties:{did:{type:"string",format:"did"}}},link:{type:"object",description:"Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.",required:["uri"],properties:{uri:{type:"string",format:"uri"}}},tag:{type:"object",description:"Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').",required:["tag"],properties:{tag:{type:"string",maxLength:640,maxGraphemes:64}}},byteSlice:{type:"object",description:"Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.",required:["byteStart","byteEnd"],properties:{byteStart:{type:"integer",minimum:0},byteEnd:{type:"integer",minimum:0}}}}},AppBskyUnspeccedDefs:{lexicon:1,id:"app.bsky.unspecced.defs",defs:{skeletonSearchPost:{type:"object",required:["uri"],properties:{uri:{type:"string",format:"at-uri"}}},skeletonSearchActor:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}}}},AppBskyUnspeccedGetPopularFeedGenerators:{lexicon:1,id:"app.bsky.unspecced.getPopularFeedGenerators",defs:{main:{type:"query",description:"An unspecced view of globally popular feed generators.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},query:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["feeds"],properties:{cursor:{type:"string"},feeds:{type:"array",items:{type:"ref",ref:"lex:app.bsky.feed.defs#generatorView"}}}}}}}},AppBskyUnspeccedGetSuggestionsSkeleton:{lexicon:1,id:"app.bsky.unspecced.getSuggestionsSkeleton",defs:{main:{type:"query",description:"Get a skeleton of suggested actors. Intended to be called and then hydrated through app.bsky.actor.getSuggestions",parameters:{type:"params",properties:{viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking."},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},relativeToDid:{type:"string",format:"did",description:"DID of the account to get suggestions relative to. If not provided, suggestions will be based on the viewer."}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{cursor:{type:"string"},actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.defs#skeletonSearchActor"}},relativeToDid:{type:"string",format:"did",description:"DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer."}}}}}}},AppBskyUnspeccedGetTaggedSuggestions:{lexicon:1,id:"app.bsky.unspecced.getTaggedSuggestions",defs:{main:{type:"query",description:"Get a list of suggestions (feeds and users) tagged with categories",parameters:{type:"params",properties:{}},output:{encoding:"application/json",schema:{type:"object",required:["suggestions"],properties:{suggestions:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.getTaggedSuggestions#suggestion"}}}}}},suggestion:{type:"object",required:["tag","subjectType","subject"],properties:{tag:{type:"string"},subjectType:{type:"string",knownValues:["actor","feed"]},subject:{type:"string",format:"uri"}}}}},AppBskyUnspeccedSearchActorsSkeleton:{lexicon:1,id:"app.bsky.unspecced.searchActorsSkeleton",defs:{main:{type:"query",description:"Backend Actors (profile) search, returns only skeleton.",parameters:{type:"params",required:["q"],properties:{q:{type:"string",description:"Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax."},viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking."},typeahead:{type:"boolean",description:"If true, acts as fast/simple 'typeahead' query."},limit:{type:"integer",minimum:1,maximum:100,default:25},cursor:{type:"string",description:"Optional pagination mechanism; may not necessarily allow scrolling through entire result set."}}},output:{encoding:"application/json",schema:{type:"object",required:["actors"],properties:{cursor:{type:"string"},hitsTotal:{type:"integer",description:"Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits."},actors:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.defs#skeletonSearchActor"}}}}},errors:[{name:"BadQueryString"}]}}},AppBskyUnspeccedSearchPostsSkeleton:{lexicon:1,id:"app.bsky.unspecced.searchPostsSkeleton",defs:{main:{type:"query",description:"Backend Posts search, returns only skeleton",parameters:{type:"params",required:["q"],properties:{q:{type:"string",description:"Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."},sort:{type:"string",knownValues:["top","latest"],default:"latest",description:"Specifies the ranking order of results."},since:{type:"string",description:"Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD)."},until:{type:"string",description:"Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD)."},mentions:{type:"string",format:"at-identifier",description:"Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions."},author:{type:"string",format:"at-identifier",description:"Filter to posts by the given account. Handles are resolved to DID before query-time."},lang:{type:"string",format:"language",description:"Filter to posts in the given language. Expected to be based on post language field, though server may override language detection."},domain:{type:"string",description:"Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization."},url:{type:"string",format:"uri",description:"Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching."},tag:{type:"array",items:{type:"string",maxLength:640,maxGraphemes:64},description:"Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching."},viewer:{type:"string",format:"did",description:"DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries."},limit:{type:"integer",minimum:1,maximum:100,default:25},cursor:{type:"string",description:"Optional pagination mechanism; may not necessarily allow scrolling through entire result set."}}},output:{encoding:"application/json",schema:{type:"object",required:["posts"],properties:{cursor:{type:"string"},hitsTotal:{type:"integer",description:"Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits."},posts:{type:"array",items:{type:"ref",ref:"lex:app.bsky.unspecced.defs#skeletonSearchPost"}}}}},errors:[{name:"BadQueryString"}]}}},AppBskyVideoDefs:{lexicon:1,id:"app.bsky.video.defs",defs:{jobStatus:{type:"object",required:["jobId","did","state"],properties:{jobId:{type:"string"},did:{type:"string",format:"did"},state:{type:"string",description:"The state of the video processing job. All values not listed as a known value indicate that the job is in process.",knownValues:["JOB_STATE_COMPLETED","JOB_STATE_FAILED"]},progress:{type:"integer",minimum:0,maximum:100,description:"Progress within the current processing state."},blob:{type:"blob"},error:{type:"string"},message:{type:"string"}}}}},AppBskyVideoGetJobStatus:{lexicon:1,id:"app.bsky.video.getJobStatus",defs:{main:{type:"query",description:"Get status details for a video processing job.",parameters:{type:"params",required:["jobId"],properties:{jobId:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["jobStatus"],properties:{jobStatus:{type:"ref",ref:"lex:app.bsky.video.defs#jobStatus"}}}}}}},AppBskyVideoGetUploadLimits:{lexicon:1,id:"app.bsky.video.getUploadLimits",defs:{main:{type:"query",description:"Get video upload limits for the authenticated user.",output:{encoding:"application/json",schema:{type:"object",required:["canUpload"],properties:{canUpload:{type:"boolean"},remainingDailyVideos:{type:"integer"},remainingDailyBytes:{type:"integer"},message:{type:"string"},error:{type:"string"}}}}}}},AppBskyVideoUploadVideo:{lexicon:1,id:"app.bsky.video.uploadVideo",defs:{main:{type:"procedure",description:"Upload a video to be processed then stored on the PDS.",input:{encoding:"video/mp4"},output:{encoding:"application/json",schema:{type:"object",required:["jobStatus"],properties:{jobStatus:{type:"ref",ref:"lex:app.bsky.video.defs#jobStatus"}}}}}}},ChatBskyActorDeclaration:{lexicon:1,id:"chat.bsky.actor.declaration",defs:{main:{type:"record",description:"A declaration of a Bluesky chat account.",key:"literal:self",record:{type:"object",required:["allowIncoming"],properties:{allowIncoming:{type:"string",knownValues:["all","none","following"]}}}}}},ChatBskyActorDefs:{lexicon:1,id:"chat.bsky.actor.defs",defs:{profileViewBasic:{type:"object",required:["did","handle"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},displayName:{type:"string",maxGraphemes:64,maxLength:640},avatar:{type:"string",format:"uri"},associated:{type:"ref",ref:"lex:app.bsky.actor.defs#profileAssociated"},viewer:{type:"ref",ref:"lex:app.bsky.actor.defs#viewerState"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},chatDisabled:{type:"boolean",description:"Set to true when the actor cannot actively participate in converations"}}}}},ChatBskyActorDeleteAccount:{lexicon:1,id:"chat.bsky.actor.deleteAccount",defs:{main:{type:"procedure",output:{encoding:"application/json",schema:{type:"object",properties:{}}}}}},ChatBskyActorExportAccountData:{lexicon:1,id:"chat.bsky.actor.exportAccountData",defs:{main:{type:"query",output:{encoding:"application/jsonl"}}}},ChatBskyConvoDefs:{lexicon:1,id:"chat.bsky.convo.defs",defs:{messageRef:{type:"object",required:["did","messageId","convoId"],properties:{did:{type:"string",format:"did"},convoId:{type:"string"},messageId:{type:"string"}}},messageInput:{type:"object",required:["text"],properties:{text:{type:"string",maxLength:1e4,maxGraphemes:1e3},facets:{type:"array",description:"Annotations of text (mentions, URLs, hashtags, etc)",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},embed:{type:"union",refs:["lex:app.bsky.embed.record"]}}},messageView:{type:"object",required:["id","rev","text","sender","sentAt"],properties:{id:{type:"string"},rev:{type:"string"},text:{type:"string",maxLength:1e4,maxGraphemes:1e3},facets:{type:"array",description:"Annotations of text (mentions, URLs, hashtags, etc)",items:{type:"ref",ref:"lex:app.bsky.richtext.facet"}},embed:{type:"union",refs:["lex:app.bsky.embed.record#view"]},sender:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageViewSender"},sentAt:{type:"string",format:"datetime"}}},deletedMessageView:{type:"object",required:["id","rev","sender","sentAt"],properties:{id:{type:"string"},rev:{type:"string"},sender:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageViewSender"},sentAt:{type:"string",format:"datetime"}}},messageViewSender:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}},convoView:{type:"object",required:["id","rev","members","muted","unreadCount"],properties:{id:{type:"string"},rev:{type:"string"},members:{type:"array",items:{type:"ref",ref:"lex:chat.bsky.actor.defs#profileViewBasic"}},lastMessage:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView"]},muted:{type:"boolean"},unreadCount:{type:"integer"}}},logBeginConvo:{type:"object",required:["rev","convoId"],properties:{rev:{type:"string"},convoId:{type:"string"}}},logLeaveConvo:{type:"object",required:["rev","convoId"],properties:{rev:{type:"string"},convoId:{type:"string"}}},logCreateMessage:{type:"object",required:["rev","convoId","message"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView"]}}},logDeleteMessage:{type:"object",required:["rev","convoId","message"],properties:{rev:{type:"string"},convoId:{type:"string"},message:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView"]}}}}},ChatBskyConvoDeleteMessageForSelf:{lexicon:1,id:"chat.bsky.convo.deleteMessageForSelf",defs:{main:{type:"procedure",input:{encoding:"application/json",schema:{type:"object",required:["convoId","messageId"],properties:{convoId:{type:"string"},messageId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:chat.bsky.convo.defs#deletedMessageView"}}}}},ChatBskyConvoGetConvo:{lexicon:1,id:"chat.bsky.convo.getConvo",defs:{main:{type:"query",parameters:{type:"params",required:["convoId"],properties:{convoId:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyConvoGetConvoForMembers:{lexicon:1,id:"chat.bsky.convo.getConvoForMembers",defs:{main:{type:"query",parameters:{type:"params",required:["members"],properties:{members:{type:"array",minLength:1,maxLength:10,items:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyConvoGetLog:{lexicon:1,id:"chat.bsky.convo.getLog",defs:{main:{type:"query",parameters:{type:"params",required:[],properties:{cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["logs"],properties:{cursor:{type:"string"},logs:{type:"array",items:{type:"union",refs:["lex:chat.bsky.convo.defs#logBeginConvo","lex:chat.bsky.convo.defs#logLeaveConvo","lex:chat.bsky.convo.defs#logCreateMessage","lex:chat.bsky.convo.defs#logDeleteMessage"]}}}}}}}},ChatBskyConvoGetMessages:{lexicon:1,id:"chat.bsky.convo.getMessages",defs:{main:{type:"query",parameters:{type:"params",required:["convoId"],properties:{convoId:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["messages"],properties:{cursor:{type:"string"},messages:{type:"array",items:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView"]}}}}}}}},ChatBskyConvoLeaveConvo:{lexicon:1,id:"chat.bsky.convo.leaveConvo",defs:{main:{type:"procedure",input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convoId","rev"],properties:{convoId:{type:"string"},rev:{type:"string"}}}}}}},ChatBskyConvoListConvos:{lexicon:1,id:"chat.bsky.convo.listConvos",defs:{main:{type:"query",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["convos"],properties:{cursor:{type:"string"},convos:{type:"array",items:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}}},ChatBskyConvoMuteConvo:{lexicon:1,id:"chat.bsky.convo.muteConvo",defs:{main:{type:"procedure",input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyConvoSendMessage:{lexicon:1,id:"chat.bsky.convo.sendMessage",defs:{main:{type:"procedure",input:{encoding:"application/json",schema:{type:"object",required:["convoId","message"],properties:{convoId:{type:"string"},message:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageInput"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageView"}}}}},ChatBskyConvoSendMessageBatch:{lexicon:1,id:"chat.bsky.convo.sendMessageBatch",defs:{main:{type:"procedure",input:{encoding:"application/json",schema:{type:"object",required:["items"],properties:{items:{type:"array",maxLength:100,items:{type:"ref",ref:"lex:chat.bsky.convo.sendMessageBatch#batchItem"}}}}},output:{encoding:"application/json",schema:{type:"object",required:["items"],properties:{items:{type:"array",items:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageView"}}}}}},batchItem:{type:"object",required:["convoId","message"],properties:{convoId:{type:"string"},message:{type:"ref",ref:"lex:chat.bsky.convo.defs#messageInput"}}}}},ChatBskyConvoUnmuteConvo:{lexicon:1,id:"chat.bsky.convo.unmuteConvo",defs:{main:{type:"procedure",input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyConvoUpdateRead:{lexicon:1,id:"chat.bsky.convo.updateRead",defs:{main:{type:"procedure",input:{encoding:"application/json",schema:{type:"object",required:["convoId"],properties:{convoId:{type:"string"},messageId:{type:"string"}}}},output:{encoding:"application/json",schema:{type:"object",required:["convo"],properties:{convo:{type:"ref",ref:"lex:chat.bsky.convo.defs#convoView"}}}}}}},ChatBskyModerationGetActorMetadata:{lexicon:1,id:"chat.bsky.moderation.getActorMetadata",defs:{main:{type:"query",parameters:{type:"params",required:["actor"],properties:{actor:{type:"string",format:"did"}}},output:{encoding:"application/json",schema:{type:"object",required:["day","month","all"],properties:{day:{type:"ref",ref:"lex:chat.bsky.moderation.getActorMetadata#metadata"},month:{type:"ref",ref:"lex:chat.bsky.moderation.getActorMetadata#metadata"},all:{type:"ref",ref:"lex:chat.bsky.moderation.getActorMetadata#metadata"}}}}},metadata:{type:"object",required:["messagesSent","messagesReceived","convos","convosStarted"],properties:{messagesSent:{type:"integer"},messagesReceived:{type:"integer"},convos:{type:"integer"},convosStarted:{type:"integer"}}}}},ChatBskyModerationGetMessageContext:{lexicon:1,id:"chat.bsky.moderation.getMessageContext",defs:{main:{type:"query",parameters:{type:"params",required:["messageId"],properties:{convoId:{type:"string",description:"Conversation that the message is from. NOTE: this field will eventually be required."},messageId:{type:"string"},before:{type:"integer",default:5},after:{type:"integer",default:5}}},output:{encoding:"application/json",schema:{type:"object",required:["messages"],properties:{messages:{type:"array",items:{type:"union",refs:["lex:chat.bsky.convo.defs#messageView","lex:chat.bsky.convo.defs#deletedMessageView"]}}}}}}}},ChatBskyModerationUpdateActorAccess:{lexicon:1,id:"chat.bsky.moderation.updateActorAccess",defs:{main:{type:"procedure",input:{encoding:"application/json",schema:{type:"object",required:["actor","allowAccess"],properties:{actor:{type:"string",format:"did"},allowAccess:{type:"boolean"},ref:{type:"string"}}}}}}},ToolsOzoneCommunicationCreateTemplate:{lexicon:1,id:"tools.ozone.communication.createTemplate",defs:{main:{type:"procedure",description:"Administrative action to create a new, re-usable communication (email for now) template.",input:{encoding:"application/json",schema:{type:"object",required:["subject","contentMarkdown","name"],properties:{name:{type:"string",description:"Name of the template."},contentMarkdown:{type:"string",description:"Content of the template, markdown supported, can contain variable placeholders."},subject:{type:"string",description:"Subject of the message, used in emails."},lang:{type:"string",format:"language",description:"Message language."},createdBy:{type:"string",format:"did",description:"DID of the user who is creating the template."}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.communication.defs#templateView"}},errors:[{name:"DuplicateTemplateName"}]}}},ToolsOzoneCommunicationDefs:{lexicon:1,id:"tools.ozone.communication.defs",defs:{templateView:{type:"object",required:["id","name","contentMarkdown","disabled","lastUpdatedBy","createdAt","updatedAt"],properties:{id:{type:"string"},name:{type:"string",description:"Name of the template."},subject:{type:"string",description:"Content of the template, can contain markdown and variable placeholders."},contentMarkdown:{type:"string",description:"Subject of the message, used in emails."},disabled:{type:"boolean"},lang:{type:"string",format:"language",description:"Message language."},lastUpdatedBy:{type:"string",format:"did",description:"DID of the user who last updated the template."},createdAt:{type:"string",format:"datetime"},updatedAt:{type:"string",format:"datetime"}}}}},ToolsOzoneCommunicationDeleteTemplate:{lexicon:1,id:"tools.ozone.communication.deleteTemplate",defs:{main:{type:"procedure",description:"Delete a communication template.",input:{encoding:"application/json",schema:{type:"object",required:["id"],properties:{id:{type:"string"}}}}}}},ToolsOzoneCommunicationListTemplates:{lexicon:1,id:"tools.ozone.communication.listTemplates",defs:{main:{type:"query",description:"Get list of all communication templates.",output:{encoding:"application/json",schema:{type:"object",required:["communicationTemplates"],properties:{communicationTemplates:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.communication.defs#templateView"}}}}}}}},ToolsOzoneCommunicationUpdateTemplate:{lexicon:1,id:"tools.ozone.communication.updateTemplate",defs:{main:{type:"procedure",description:"Administrative action to update an existing communication template. Allows passing partial fields to patch specific fields only.",input:{encoding:"application/json",schema:{type:"object",required:["id"],properties:{id:{type:"string",description:"ID of the template to be updated."},name:{type:"string",description:"Name of the template."},lang:{type:"string",format:"language",description:"Message language."},contentMarkdown:{type:"string",description:"Content of the template, markdown supported, can contain variable placeholders."},subject:{type:"string",description:"Subject of the message, used in emails."},updatedBy:{type:"string",format:"did",description:"DID of the user who is updating the template."},disabled:{type:"boolean"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.communication.defs#templateView"}},errors:[{name:"DuplicateTemplateName"}]}}},ToolsOzoneModerationDefs:{lexicon:1,id:"tools.ozone.moderation.defs",defs:{modEventView:{type:"object",required:["id","event","subject","subjectBlobCids","createdBy","createdAt"],properties:{id:{type:"integer"},event:{type:"union",refs:["lex:tools.ozone.moderation.defs#modEventTakedown","lex:tools.ozone.moderation.defs#modEventReverseTakedown","lex:tools.ozone.moderation.defs#modEventComment","lex:tools.ozone.moderation.defs#modEventReport","lex:tools.ozone.moderation.defs#modEventLabel","lex:tools.ozone.moderation.defs#modEventAcknowledge","lex:tools.ozone.moderation.defs#modEventEscalate","lex:tools.ozone.moderation.defs#modEventMute","lex:tools.ozone.moderation.defs#modEventUnmute","lex:tools.ozone.moderation.defs#modEventMuteReporter","lex:tools.ozone.moderation.defs#modEventUnmuteReporter","lex:tools.ozone.moderation.defs#modEventEmail","lex:tools.ozone.moderation.defs#modEventResolveAppeal","lex:tools.ozone.moderation.defs#modEventDivert","lex:tools.ozone.moderation.defs#modEventTag"]},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef","lex:chat.bsky.convo.defs#messageRef"]},subjectBlobCids:{type:"array",items:{type:"string"}},createdBy:{type:"string",format:"did"},createdAt:{type:"string",format:"datetime"},creatorHandle:{type:"string"},subjectHandle:{type:"string"}}},modEventViewDetail:{type:"object",required:["id","event","subject","subjectBlobs","createdBy","createdAt"],properties:{id:{type:"integer"},event:{type:"union",refs:["lex:tools.ozone.moderation.defs#modEventTakedown","lex:tools.ozone.moderation.defs#modEventReverseTakedown","lex:tools.ozone.moderation.defs#modEventComment","lex:tools.ozone.moderation.defs#modEventReport","lex:tools.ozone.moderation.defs#modEventLabel","lex:tools.ozone.moderation.defs#modEventAcknowledge","lex:tools.ozone.moderation.defs#modEventEscalate","lex:tools.ozone.moderation.defs#modEventMute","lex:tools.ozone.moderation.defs#modEventUnmute","lex:tools.ozone.moderation.defs#modEventMuteReporter","lex:tools.ozone.moderation.defs#modEventUnmuteReporter","lex:tools.ozone.moderation.defs#modEventEmail","lex:tools.ozone.moderation.defs#modEventResolveAppeal","lex:tools.ozone.moderation.defs#modEventDivert","lex:tools.ozone.moderation.defs#modEventTag"]},subject:{type:"union",refs:["lex:tools.ozone.moderation.defs#repoView","lex:tools.ozone.moderation.defs#repoViewNotFound","lex:tools.ozone.moderation.defs#recordView","lex:tools.ozone.moderation.defs#recordViewNotFound"]},subjectBlobs:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#blobView"}},createdBy:{type:"string",format:"did"},createdAt:{type:"string",format:"datetime"}}},subjectStatusView:{type:"object",required:["id","subject","createdAt","updatedAt","reviewState"],properties:{id:{type:"integer"},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef"]},subjectBlobCids:{type:"array",items:{type:"string",format:"cid"}},subjectRepoHandle:{type:"string"},updatedAt:{type:"string",format:"datetime",description:"Timestamp referencing when the last update was made to the moderation status of the subject"},createdAt:{type:"string",format:"datetime",description:"Timestamp referencing the first moderation status impacting event was emitted on the subject"},reviewState:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectReviewState"},comment:{type:"string",description:"Sticky comment on the subject."},muteUntil:{type:"string",format:"datetime"},muteReportingUntil:{type:"string",format:"datetime"},lastReviewedBy:{type:"string",format:"did"},lastReviewedAt:{type:"string",format:"datetime"},lastReportedAt:{type:"string",format:"datetime"},lastAppealedAt:{type:"string",format:"datetime",description:"Timestamp referencing when the author of the subject appealed a moderation action"},takendown:{type:"boolean"},appealed:{type:"boolean",description:"True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators."},suspendUntil:{type:"string",format:"datetime"},tags:{type:"array",items:{type:"string"}}}},subjectReviewState:{type:"string",knownValues:["lex:tools.ozone.moderation.defs#reviewOpen","lex:tools.ozone.moderation.defs#reviewEscalated","lex:tools.ozone.moderation.defs#reviewClosed","lex:tools.ozone.moderation.defs#reviewNone"]},reviewOpen:{type:"token",description:"Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator"},reviewEscalated:{type:"token",description:"Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator"},reviewClosed:{type:"token",description:"Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator"},reviewNone:{type:"token",description:"Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it"},modEventTakedown:{type:"object",description:"Take down a subject permanently or temporarily",properties:{comment:{type:"string"},durationInHours:{type:"integer",description:"Indicates how long the takedown should be in effect before automatically expiring."},acknowledgeAccountSubjects:{type:"boolean",description:"If true, all other reports on content authored by this account will be resolved (acknowledged)."}}},modEventReverseTakedown:{type:"object",description:"Revert take down action on a subject",properties:{comment:{type:"string",description:"Describe reasoning behind the reversal."}}},modEventResolveAppeal:{type:"object",description:"Resolve appeal on a subject",properties:{comment:{type:"string",description:"Describe resolution."}}},modEventComment:{type:"object",description:"Add a comment to a subject",required:["comment"],properties:{comment:{type:"string"},sticky:{type:"boolean",description:"Make the comment persistent on the subject"}}},modEventReport:{type:"object",description:"Report a subject",required:["reportType"],properties:{comment:{type:"string"},isReporterMuted:{type:"boolean",description:"Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject."},reportType:{type:"ref",ref:"lex:com.atproto.moderation.defs#reasonType"}}},modEventLabel:{type:"object",description:"Apply/Negate labels on a subject",required:["createLabelVals","negateLabelVals"],properties:{comment:{type:"string"},createLabelVals:{type:"array",items:{type:"string"}},negateLabelVals:{type:"array",items:{type:"string"}}}},modEventAcknowledge:{type:"object",properties:{comment:{type:"string"}}},modEventEscalate:{type:"object",properties:{comment:{type:"string"}}},modEventMute:{type:"object",description:"Mute incoming reports on a subject",required:["durationInHours"],properties:{comment:{type:"string"},durationInHours:{type:"integer",description:"Indicates how long the subject should remain muted."}}},modEventUnmute:{type:"object",description:"Unmute action on a subject",properties:{comment:{type:"string",description:"Describe reasoning behind the reversal."}}},modEventMuteReporter:{type:"object",description:"Mute incoming reports from an account",required:["durationInHours"],properties:{comment:{type:"string"},durationInHours:{type:"integer",description:"Indicates how long the account should remain muted."}}},modEventUnmuteReporter:{type:"object",description:"Unmute incoming reports from an account",properties:{comment:{type:"string",description:"Describe reasoning behind the reversal."}}},modEventEmail:{type:"object",description:"Keep a log of outgoing email to a user",required:["subjectLine"],properties:{subjectLine:{type:"string",description:"The subject line of the email sent to the user."},content:{type:"string",description:"The content of the email sent to the user."},comment:{type:"string",description:"Additional comment about the outgoing comm."}}},modEventDivert:{type:"object",description:"Divert a record's blobs to a 3rd party service for further scanning/tagging",properties:{comment:{type:"string"}}},modEventTag:{type:"object",description:"Add/Remove a tag on a subject",required:["add","remove"],properties:{add:{type:"array",items:{type:"string"},description:"Tags to be added to the subject. If already exists, won't be duplicated."},remove:{type:"array",items:{type:"string"},description:"Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated."},comment:{type:"string",description:"Additional comment about added/removed tags."}}},repoView:{type:"object",required:["did","handle","relatedRecords","indexedAt","moderation"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},email:{type:"string"},relatedRecords:{type:"array",items:{type:"unknown"}},indexedAt:{type:"string",format:"datetime"},moderation:{type:"ref",ref:"lex:tools.ozone.moderation.defs#moderation"},invitedBy:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"},invitesDisabled:{type:"boolean"},inviteNote:{type:"string"},deactivatedAt:{type:"string",format:"datetime"}}},repoViewDetail:{type:"object",required:["did","handle","relatedRecords","indexedAt","moderation"],properties:{did:{type:"string",format:"did"},handle:{type:"string",format:"handle"},email:{type:"string"},relatedRecords:{type:"array",items:{type:"unknown"}},indexedAt:{type:"string",format:"datetime"},moderation:{type:"ref",ref:"lex:tools.ozone.moderation.defs#moderationDetail"},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},invitedBy:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"},invites:{type:"array",items:{type:"ref",ref:"lex:com.atproto.server.defs#inviteCode"}},invitesDisabled:{type:"boolean"},inviteNote:{type:"string"},emailConfirmedAt:{type:"string",format:"datetime"},deactivatedAt:{type:"string",format:"datetime"}}},repoViewNotFound:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}},recordView:{type:"object",required:["uri","cid","value","blobCids","indexedAt","moderation","repo"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},value:{type:"unknown"},blobCids:{type:"array",items:{type:"string",format:"cid"}},indexedAt:{type:"string",format:"datetime"},moderation:{type:"ref",ref:"lex:tools.ozone.moderation.defs#moderation"},repo:{type:"ref",ref:"lex:tools.ozone.moderation.defs#repoView"}}},recordViewDetail:{type:"object",required:["uri","cid","value","blobs","indexedAt","moderation","repo"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"},value:{type:"unknown"},blobs:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#blobView"}},labels:{type:"array",items:{type:"ref",ref:"lex:com.atproto.label.defs#label"}},indexedAt:{type:"string",format:"datetime"},moderation:{type:"ref",ref:"lex:tools.ozone.moderation.defs#moderationDetail"},repo:{type:"ref",ref:"lex:tools.ozone.moderation.defs#repoView"}}},recordViewNotFound:{type:"object",required:["uri"],properties:{uri:{type:"string",format:"at-uri"}}},moderation:{type:"object",properties:{subjectStatus:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectStatusView"}}},moderationDetail:{type:"object",properties:{subjectStatus:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectStatusView"}}},blobView:{type:"object",required:["cid","mimeType","size","createdAt"],properties:{cid:{type:"string",format:"cid"},mimeType:{type:"string"},size:{type:"integer"},createdAt:{type:"string",format:"datetime"},details:{type:"union",refs:["lex:tools.ozone.moderation.defs#imageDetails","lex:tools.ozone.moderation.defs#videoDetails"]},moderation:{type:"ref",ref:"lex:tools.ozone.moderation.defs#moderation"}}},imageDetails:{type:"object",required:["width","height"],properties:{width:{type:"integer"},height:{type:"integer"}}},videoDetails:{type:"object",required:["width","height","length"],properties:{width:{type:"integer"},height:{type:"integer"},length:{type:"integer"}}}}},ToolsOzoneModerationEmitEvent:{lexicon:1,id:"tools.ozone.moderation.emitEvent",defs:{main:{type:"procedure",description:"Take a moderation action on an actor.",input:{encoding:"application/json",schema:{type:"object",required:["event","subject","createdBy"],properties:{event:{type:"union",refs:["lex:tools.ozone.moderation.defs#modEventTakedown","lex:tools.ozone.moderation.defs#modEventAcknowledge","lex:tools.ozone.moderation.defs#modEventEscalate","lex:tools.ozone.moderation.defs#modEventComment","lex:tools.ozone.moderation.defs#modEventLabel","lex:tools.ozone.moderation.defs#modEventReport","lex:tools.ozone.moderation.defs#modEventMute","lex:tools.ozone.moderation.defs#modEventUnmute","lex:tools.ozone.moderation.defs#modEventMuteReporter","lex:tools.ozone.moderation.defs#modEventUnmuteReporter","lex:tools.ozone.moderation.defs#modEventReverseTakedown","lex:tools.ozone.moderation.defs#modEventResolveAppeal","lex:tools.ozone.moderation.defs#modEventEmail","lex:tools.ozone.moderation.defs#modEventTag"]},subject:{type:"union",refs:["lex:com.atproto.admin.defs#repoRef","lex:com.atproto.repo.strongRef"]},subjectBlobCids:{type:"array",items:{type:"string",format:"cid"}},createdBy:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.moderation.defs#modEventView"}},errors:[{name:"SubjectHasAction"}]}}},ToolsOzoneModerationGetEvent:{lexicon:1,id:"tools.ozone.moderation.getEvent",defs:{main:{type:"query",description:"Get details about a moderation event.",parameters:{type:"params",required:["id"],properties:{id:{type:"integer"}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.moderation.defs#modEventViewDetail"}}}}},ToolsOzoneModerationGetRecord:{lexicon:1,id:"tools.ozone.moderation.getRecord",defs:{main:{type:"query",description:"Get details about a record.",parameters:{type:"params",required:["uri"],properties:{uri:{type:"string",format:"at-uri"},cid:{type:"string",format:"cid"}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.moderation.defs#recordViewDetail"}},errors:[{name:"RecordNotFound"}]}}},ToolsOzoneModerationGetRecords:{lexicon:1,id:"tools.ozone.moderation.getRecords",defs:{main:{type:"query",description:"Get details about some records.",parameters:{type:"params",required:["uris"],properties:{uris:{type:"array",maxLength:100,items:{type:"string",format:"at-uri"}}}},output:{encoding:"application/json",schema:{type:"object",required:["records"],properties:{records:{type:"array",items:{type:"union",refs:["lex:tools.ozone.moderation.defs#recordViewDetail","lex:tools.ozone.moderation.defs#recordViewNotFound"]}}}}}}}},ToolsOzoneModerationGetRepo:{lexicon:1,id:"tools.ozone.moderation.getRepo",defs:{main:{type:"query",description:"Get details about a repository.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did"}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.moderation.defs#repoViewDetail"}},errors:[{name:"RepoNotFound"}]}}},ToolsOzoneModerationGetRepos:{lexicon:1,id:"tools.ozone.moderation.getRepos",defs:{main:{type:"query",description:"Get details about some repositories.",parameters:{type:"params",required:["dids"],properties:{dids:{type:"array",maxLength:100,items:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["repos"],properties:{repos:{type:"array",items:{type:"union",refs:["lex:tools.ozone.moderation.defs#repoViewDetail","lex:tools.ozone.moderation.defs#repoViewNotFound"]}}}}}}}},ToolsOzoneModerationQueryEvents:{lexicon:1,id:"tools.ozone.moderation.queryEvents",defs:{main:{type:"query",description:"List moderation events related to a subject.",parameters:{type:"params",properties:{types:{type:"array",items:{type:"string"},description:"The types of events (fully qualified string in the format of tools.ozone.moderation.defs#modEvent<name>) to filter by. If not specified, all events are returned."},createdBy:{type:"string",format:"did"},sortDirection:{type:"string",default:"desc",enum:["asc","desc"],description:"Sort direction for the events. Defaults to descending order of created at timestamp."},createdAfter:{type:"string",format:"datetime",description:"Retrieve events created after a given timestamp"},createdBefore:{type:"string",format:"datetime",description:"Retrieve events created before a given timestamp"},subject:{type:"string",format:"uri"},includeAllUserRecords:{type:"boolean",default:!1,description:"If true, events on all record types (posts, lists, profile etc.) owned by the did are returned"},limit:{type:"integer",minimum:1,maximum:100,default:50},hasComment:{type:"boolean",description:"If true, only events with comments are returned"},comment:{type:"string",description:"If specified, only events with comments containing the keyword are returned"},addedLabels:{type:"array",items:{type:"string"},description:"If specified, only events where all of these labels were added are returned"},removedLabels:{type:"array",items:{type:"string"},description:"If specified, only events where all of these labels were removed are returned"},addedTags:{type:"array",items:{type:"string"},description:"If specified, only events where all of these tags were added are returned"},removedTags:{type:"array",items:{type:"string"},description:"If specified, only events where all of these tags were removed are returned"},reportTypes:{type:"array",items:{type:"string"}},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["events"],properties:{cursor:{type:"string"},events:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#modEventView"}}}}}}}},ToolsOzoneModerationQueryStatuses:{lexicon:1,id:"tools.ozone.moderation.queryStatuses",defs:{main:{type:"query",description:"View moderation statuses of subjects (record or repo).",parameters:{type:"params",properties:{includeAllUserRecords:{type:"boolean",description:"All subjects belonging to the account specified in the 'subject' param will be returned."},subject:{type:"string",format:"uri",description:"The subject to get the status for."},comment:{type:"string",description:"Search subjects by keyword from comments"},reportedAfter:{type:"string",format:"datetime",description:"Search subjects reported after a given timestamp"},reportedBefore:{type:"string",format:"datetime",description:"Search subjects reported before a given timestamp"},reviewedAfter:{type:"string",format:"datetime",description:"Search subjects reviewed after a given timestamp"},reviewedBefore:{type:"string",format:"datetime",description:"Search subjects reviewed before a given timestamp"},includeMuted:{type:"boolean",description:"By default, we don't include muted subjects in the results. Set this to true to include them."},onlyMuted:{type:"boolean",description:"When set to true, only muted subjects and reporters will be returned."},reviewState:{type:"string",description:"Specify when fetching subjects in a certain state"},ignoreSubjects:{type:"array",items:{type:"string",format:"uri"}},lastReviewedBy:{type:"string",format:"did",description:"Get all subject statuses that were reviewed by a specific moderator"},sortField:{type:"string",default:"lastReportedAt",enum:["lastReviewedAt","lastReportedAt"]},sortDirection:{type:"string",default:"desc",enum:["asc","desc"]},takendown:{type:"boolean",description:"Get subjects that were taken down"},appealed:{type:"boolean",description:"Get subjects in unresolved appealed status"},limit:{type:"integer",minimum:1,maximum:100,default:50},tags:{type:"array",items:{type:"string"}},excludeTags:{type:"array",items:{type:"string"}},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["subjectStatuses"],properties:{cursor:{type:"string"},subjectStatuses:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#subjectStatusView"}}}}}}}},ToolsOzoneModerationSearchRepos:{lexicon:1,id:"tools.ozone.moderation.searchRepos",defs:{main:{type:"query",description:"Find repositories based on a search term.",parameters:{type:"params",properties:{term:{type:"string",description:"DEPRECATED: use 'q' instead"},q:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["repos"],properties:{cursor:{type:"string"},repos:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.moderation.defs#repoView"}}}}}}}},ToolsOzoneServerGetConfig:{lexicon:1,id:"tools.ozone.server.getConfig",defs:{main:{type:"query",description:"Get details about ozone's server configuration.",output:{encoding:"application/json",schema:{type:"object",properties:{appview:{type:"ref",ref:"lex:tools.ozone.server.getConfig#serviceConfig"},pds:{type:"ref",ref:"lex:tools.ozone.server.getConfig#serviceConfig"},blobDivert:{type:"ref",ref:"lex:tools.ozone.server.getConfig#serviceConfig"},chat:{type:"ref",ref:"lex:tools.ozone.server.getConfig#serviceConfig"},viewer:{type:"ref",ref:"lex:tools.ozone.server.getConfig#viewerConfig"}}}}},serviceConfig:{type:"object",properties:{url:{type:"string",format:"uri"}}},viewerConfig:{type:"object",properties:{role:{type:"string",knownValues:["tools.ozone.team.defs#roleAdmin","tools.ozone.team.defs#roleModerator","tools.ozone.team.defs#roleTriage"]}}}}},ToolsOzoneSetAddValues:{lexicon:1,id:"tools.ozone.set.addValues",defs:{main:{type:"procedure",description:"Add values to a specific set. Attempting to add values to a set that does not exist will result in an error.",input:{encoding:"application/json",schema:{type:"object",required:["name","values"],properties:{name:{type:"string",description:"Name of the set to add values to"},values:{type:"array",minLength:1,maxLength:1e3,items:{type:"string"},description:"Array of string values to add to the set"}}}}}}},ToolsOzoneSetDefs:{lexicon:1,id:"tools.ozone.set.defs",defs:{set:{type:"object",required:["name"],properties:{name:{type:"string",minLength:3,maxLength:128},description:{type:"string",maxGraphemes:1024,maxLength:10240}}},setView:{type:"object",required:["name","setSize","createdAt","updatedAt"],properties:{name:{type:"string",minLength:3,maxLength:128},description:{type:"string",maxGraphemes:1024,maxLength:10240},setSize:{type:"integer"},createdAt:{type:"string",format:"datetime"},updatedAt:{type:"string",format:"datetime"}}}}},ToolsOzoneSetDeleteSet:{lexicon:1,id:"tools.ozone.set.deleteSet",defs:{main:{type:"procedure",description:"Delete an entire set. Attempting to delete a set that does not exist will result in an error.",input:{encoding:"application/json",schema:{type:"object",required:["name"],properties:{name:{type:"string",description:"Name of the set to delete"}}}},output:{encoding:"application/json",schema:{type:"object",properties:{}}},errors:[{name:"SetNotFound",description:"set with the given name does not exist"}]}}},ToolsOzoneSetDeleteValues:{lexicon:1,id:"tools.ozone.set.deleteValues",defs:{main:{type:"procedure",description:"Delete values from a specific set. Attempting to delete values that are not in the set will not result in an error",input:{encoding:"application/json",schema:{type:"object",required:["name","values"],properties:{name:{type:"string",description:"Name of the set to delete values from"},values:{type:"array",minLength:1,items:{type:"string"},description:"Array of string values to delete from the set"}}}},errors:[{name:"SetNotFound",description:"set with the given name does not exist"}]}}},ToolsOzoneSetGetValues:{lexicon:1,id:"tools.ozone.set.getValues",defs:{main:{type:"query",description:"Get a specific set and its values",parameters:{type:"params",required:["name"],properties:{name:{type:"string"},limit:{type:"integer",minimum:1,maximum:1e3,default:100},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["set","values"],properties:{set:{type:"ref",ref:"lex:tools.ozone.set.defs#setView"},values:{type:"array",items:{type:"string"}},cursor:{type:"string"}}}},errors:[{name:"SetNotFound",description:"set with the given name does not exist"}]}}},ToolsOzoneSetQuerySets:{lexicon:1,id:"tools.ozone.set.querySets",defs:{main:{type:"query",description:"Query available sets",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"},namePrefix:{type:"string"},sortBy:{type:"string",enum:["name","createdAt","updatedAt"],default:"name"},sortDirection:{type:"string",default:"asc",enum:["asc","desc"],description:"Defaults to ascending order of name field."}}},output:{encoding:"application/json",schema:{type:"object",required:["sets"],properties:{sets:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.set.defs#setView"}},cursor:{type:"string"}}}}}}},ToolsOzoneSetUpsertSet:{lexicon:1,id:"tools.ozone.set.upsertSet",defs:{main:{type:"procedure",description:"Create or update set metadata",input:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.set.defs#set"}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.set.defs#setView"}}}}},ToolsOzoneSignatureDefs:{lexicon:1,id:"tools.ozone.signature.defs",defs:{sigDetail:{type:"object",required:["property","value"],properties:{property:{type:"string"},value:{type:"string"}}}}},ToolsOzoneSignatureFindCorrelation:{lexicon:1,id:"tools.ozone.signature.findCorrelation",defs:{main:{type:"query",description:"Find all correlated threat signatures between 2 or more accounts.",parameters:{type:"params",required:["dids"],properties:{dids:{type:"array",items:{type:"string",format:"did"}}}},output:{encoding:"application/json",schema:{type:"object",required:["details"],properties:{details:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.signature.defs#sigDetail"}}}}}}}},ToolsOzoneSignatureFindRelatedAccounts:{lexicon:1,id:"tools.ozone.signature.findRelatedAccounts",defs:{main:{type:"query",description:"Get accounts that share some matching threat signatures with the root account.",parameters:{type:"params",required:["did"],properties:{did:{type:"string",format:"did"},cursor:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50}}},output:{encoding:"application/json",schema:{type:"object",required:["accounts"],properties:{cursor:{type:"string"},accounts:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.signature.findRelatedAccounts#relatedAccount"}}}}}},relatedAccount:{type:"object",required:["account"],properties:{account:{type:"ref",ref:"lex:com.atproto.admin.defs#accountView"},similarities:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.signature.defs#sigDetail"}}}}}},ToolsOzoneSignatureSearchAccounts:{lexicon:1,id:"tools.ozone.signature.searchAccounts",defs:{main:{type:"query",description:"Search for accounts that match one or more threat signature values.",parameters:{type:"params",required:["values"],properties:{values:{type:"array",items:{type:"string"}},cursor:{type:"string"},limit:{type:"integer",minimum:1,maximum:100,default:50}}},output:{encoding:"application/json",schema:{type:"object",required:["accounts"],properties:{cursor:{type:"string"},accounts:{type:"array",items:{type:"ref",ref:"lex:com.atproto.admin.defs#accountView"}}}}}}}},ToolsOzoneTeamAddMember:{lexicon:1,id:"tools.ozone.team.addMember",defs:{main:{type:"procedure",description:"Add a member to the ozone team. Requires admin role.",input:{encoding:"application/json",schema:{type:"object",required:["did","role"],properties:{did:{type:"string",format:"did"},role:{type:"string",knownValues:["tools.ozone.team.defs#roleAdmin","tools.ozone.team.defs#roleModerator","tools.ozone.team.defs#roleTriage"]}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.team.defs#member"}},errors:[{name:"MemberAlreadyExists",description:"Member already exists in the team."}]}}},ToolsOzoneTeamDefs:{lexicon:1,id:"tools.ozone.team.defs",defs:{member:{type:"object",required:["did","role"],properties:{did:{type:"string",format:"did"},disabled:{type:"boolean"},profile:{type:"ref",ref:"lex:app.bsky.actor.defs#profileViewDetailed"},createdAt:{type:"string",format:"datetime"},updatedAt:{type:"string",format:"datetime"},lastUpdatedBy:{type:"string"},role:{type:"string",knownValues:["lex:tools.ozone.team.defs#roleAdmin","lex:tools.ozone.team.defs#roleModerator","lex:tools.ozone.team.defs#roleTriage"]}}},roleAdmin:{type:"token",description:"Admin role. Highest level of access, can perform all actions."},roleModerator:{type:"token",description:"Moderator role. Can perform most actions."},roleTriage:{type:"token",description:"Triage role. Mostly intended for monitoring and escalating issues."}}},ToolsOzoneTeamDeleteMember:{lexicon:1,id:"tools.ozone.team.deleteMember",defs:{main:{type:"procedure",description:"Delete a member from ozone team. Requires admin role.",input:{encoding:"application/json",schema:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"}}}},errors:[{name:"MemberNotFound",description:"The member being deleted does not exist"},{name:"CannotDeleteSelf",description:"You can not delete yourself from the team"}]}}},ToolsOzoneTeamListMembers:{lexicon:1,id:"tools.ozone.team.listMembers",defs:{main:{type:"query",description:"List all members with access to the ozone service.",parameters:{type:"params",properties:{limit:{type:"integer",minimum:1,maximum:100,default:50},cursor:{type:"string"}}},output:{encoding:"application/json",schema:{type:"object",required:["members"],properties:{cursor:{type:"string"},members:{type:"array",items:{type:"ref",ref:"lex:tools.ozone.team.defs#member"}}}}}}}},ToolsOzoneTeamUpdateMember:{lexicon:1,id:"tools.ozone.team.updateMember",defs:{main:{type:"procedure",description:"Update a member in the ozone service. Requires admin role.",input:{encoding:"application/json",schema:{type:"object",required:["did"],properties:{did:{type:"string",format:"did"},disabled:{type:"boolean"},role:{type:"string",knownValues:["tools.ozone.team.defs#roleAdmin","tools.ozone.team.defs#roleModerator","tools.ozone.team.defs#roleTriage"]}}}},output:{encoding:"application/json",schema:{type:"ref",ref:"lex:tools.ozone.team.defs#member"}},errors:[{name:"MemberNotFound",description:"The member being updated does not exist in the team"}]}}}},e.schemas=Object.values(e.schemaDict),e.lexicons=new t.Lexicons(e.schemas),e.ids={ComAtprotoAdminDefs:"com.atproto.admin.defs",ComAtprotoAdminDeleteAccount:"com.atproto.admin.deleteAccount",ComAtprotoAdminDisableAccountInvites:"com.atproto.admin.disableAccountInvites",ComAtprotoAdminDisableInviteCodes:"com.atproto.admin.disableInviteCodes",ComAtprotoAdminEnableAccountInvites:"com.atproto.admin.enableAccountInvites",ComAtprotoAdminGetAccountInfo:"com.atproto.admin.getAccountInfo",ComAtprotoAdminGetAccountInfos:"com.atproto.admin.getAccountInfos",ComAtprotoAdminGetInviteCodes:"com.atproto.admin.getInviteCodes",ComAtprotoAdminGetSubjectStatus:"com.atproto.admin.getSubjectStatus",ComAtprotoAdminSearchAccounts:"com.atproto.admin.searchAccounts",ComAtprotoAdminSendEmail:"com.atproto.admin.sendEmail",ComAtprotoAdminUpdateAccountEmail:"com.atproto.admin.updateAccountEmail",ComAtprotoAdminUpdateAccountHandle:"com.atproto.admin.updateAccountHandle",ComAtprotoAdminUpdateAccountPassword:"com.atproto.admin.updateAccountPassword",ComAtprotoAdminUpdateSubjectStatus:"com.atproto.admin.updateSubjectStatus",ComAtprotoIdentityGetRecommendedDidCredentials:"com.atproto.identity.getRecommendedDidCredentials",ComAtprotoIdentityRequestPlcOperationSignature:"com.atproto.identity.requestPlcOperationSignature",ComAtprotoIdentityResolveHandle:"com.atproto.identity.resolveHandle",ComAtprotoIdentitySignPlcOperation:"com.atproto.identity.signPlcOperation",ComAtprotoIdentitySubmitPlcOperation:"com.atproto.identity.submitPlcOperation",ComAtprotoIdentityUpdateHandle:"com.atproto.identity.updateHandle",ComAtprotoLabelDefs:"com.atproto.label.defs",ComAtprotoLabelQueryLabels:"com.atproto.label.queryLabels",ComAtprotoLabelSubscribeLabels:"com.atproto.label.subscribeLabels",ComAtprotoModerationCreateReport:"com.atproto.moderation.createReport",ComAtprotoModerationDefs:"com.atproto.moderation.defs",ComAtprotoRepoApplyWrites:"com.atproto.repo.applyWrites",ComAtprotoRepoCreateRecord:"com.atproto.repo.createRecord",ComAtprotoRepoDefs:"com.atproto.repo.defs",ComAtprotoRepoDeleteRecord:"com.atproto.repo.deleteRecord",ComAtprotoRepoDescribeRepo:"com.atproto.repo.describeRepo",ComAtprotoRepoGetRecord:"com.atproto.repo.getRecord",ComAtprotoRepoImportRepo:"com.atproto.repo.importRepo",ComAtprotoRepoListMissingBlobs:"com.atproto.repo.listMissingBlobs",ComAtprotoRepoListRecords:"com.atproto.repo.listRecords",ComAtprotoRepoPutRecord:"com.atproto.repo.putRecord",ComAtprotoRepoStrongRef:"com.atproto.repo.strongRef",ComAtprotoRepoUploadBlob:"com.atproto.repo.uploadBlob",ComAtprotoServerActivateAccount:"com.atproto.server.activateAccount",ComAtprotoServerCheckAccountStatus:"com.atproto.server.checkAccountStatus",ComAtprotoServerConfirmEmail:"com.atproto.server.confirmEmail",ComAtprotoServerCreateAccount:"com.atproto.server.createAccount",ComAtprotoServerCreateAppPassword:"com.atproto.server.createAppPassword",ComAtprotoServerCreateInviteCode:"com.atproto.server.createInviteCode",ComAtprotoServerCreateInviteCodes:"com.atproto.server.createInviteCodes",ComAtprotoServerCreateSession:"com.atproto.server.createSession",ComAtprotoServerDeactivateAccount:"com.atproto.server.deactivateAccount",ComAtprotoServerDefs:"com.atproto.server.defs",ComAtprotoServerDeleteAccount:"com.atproto.server.deleteAccount",ComAtprotoServerDeleteSession:"com.atproto.server.deleteSession",ComAtprotoServerDescribeServer:"com.atproto.server.describeServer",ComAtprotoServerGetAccountInviteCodes:"com.atproto.server.getAccountInviteCodes",ComAtprotoServerGetServiceAuth:"com.atproto.server.getServiceAuth",ComAtprotoServerGetSession:"com.atproto.server.getSession",ComAtprotoServerListAppPasswords:"com.atproto.server.listAppPasswords",ComAtprotoServerRefreshSession:"com.atproto.server.refreshSession",ComAtprotoServerRequestAccountDelete:"com.atproto.server.requestAccountDelete",ComAtprotoServerRequestEmailConfirmation:"com.atproto.server.requestEmailConfirmation",ComAtprotoServerRequestEmailUpdate:"com.atproto.server.requestEmailUpdate",ComAtprotoServerRequestPasswordReset:"com.atproto.server.requestPasswordReset",ComAtprotoServerReserveSigningKey:"com.atproto.server.reserveSigningKey",ComAtprotoServerResetPassword:"com.atproto.server.resetPassword",ComAtprotoServerRevokeAppPassword:"com.atproto.server.revokeAppPassword",ComAtprotoServerUpdateEmail:"com.atproto.server.updateEmail",ComAtprotoSyncGetBlob:"com.atproto.sync.getBlob",ComAtprotoSyncGetBlocks:"com.atproto.sync.getBlocks",ComAtprotoSyncGetCheckout:"com.atproto.sync.getCheckout",ComAtprotoSyncGetHead:"com.atproto.sync.getHead",ComAtprotoSyncGetLatestCommit:"com.atproto.sync.getLatestCommit",ComAtprotoSyncGetRecord:"com.atproto.sync.getRecord",ComAtprotoSyncGetRepo:"com.atproto.sync.getRepo",ComAtprotoSyncGetRepoStatus:"com.atproto.sync.getRepoStatus",ComAtprotoSyncListBlobs:"com.atproto.sync.listBlobs",ComAtprotoSyncListRepos:"com.atproto.sync.listRepos",ComAtprotoSyncNotifyOfUpdate:"com.atproto.sync.notifyOfUpdate",ComAtprotoSyncRequestCrawl:"com.atproto.sync.requestCrawl",ComAtprotoSyncSubscribeRepos:"com.atproto.sync.subscribeRepos",ComAtprotoTempCheckSignupQueue:"com.atproto.temp.checkSignupQueue",ComAtprotoTempFetchLabels:"com.atproto.temp.fetchLabels",ComAtprotoTempRequestPhoneVerification:"com.atproto.temp.requestPhoneVerification",AppBskyActorDefs:"app.bsky.actor.defs",AppBskyActorGetPreferences:"app.bsky.actor.getPreferences",AppBskyActorGetProfile:"app.bsky.actor.getProfile",AppBskyActorGetProfiles:"app.bsky.actor.getProfiles",AppBskyActorGetSuggestions:"app.bsky.actor.getSuggestions",AppBskyActorProfile:"app.bsky.actor.profile",AppBskyActorPutPreferences:"app.bsky.actor.putPreferences",AppBskyActorSearchActors:"app.bsky.actor.searchActors",AppBskyActorSearchActorsTypeahead:"app.bsky.actor.searchActorsTypeahead",AppBskyEmbedDefs:"app.bsky.embed.defs",AppBskyEmbedExternal:"app.bsky.embed.external",AppBskyEmbedImages:"app.bsky.embed.images",AppBskyEmbedRecord:"app.bsky.embed.record",AppBskyEmbedRecordWithMedia:"app.bsky.embed.recordWithMedia",AppBskyEmbedVideo:"app.bsky.embed.video",AppBskyFeedDefs:"app.bsky.feed.defs",AppBskyFeedDescribeFeedGenerator:"app.bsky.feed.describeFeedGenerator",AppBskyFeedGenerator:"app.bsky.feed.generator",AppBskyFeedGetActorFeeds:"app.bsky.feed.getActorFeeds",AppBskyFeedGetActorLikes:"app.bsky.feed.getActorLikes",AppBskyFeedGetAuthorFeed:"app.bsky.feed.getAuthorFeed",AppBskyFeedGetFeed:"app.bsky.feed.getFeed",AppBskyFeedGetFeedGenerator:"app.bsky.feed.getFeedGenerator",AppBskyFeedGetFeedGenerators:"app.bsky.feed.getFeedGenerators",AppBskyFeedGetFeedSkeleton:"app.bsky.feed.getFeedSkeleton",AppBskyFeedGetLikes:"app.bsky.feed.getLikes",AppBskyFeedGetListFeed:"app.bsky.feed.getListFeed",AppBskyFeedGetPostThread:"app.bsky.feed.getPostThread",AppBskyFeedGetPosts:"app.bsky.feed.getPosts",AppBskyFeedGetQuotes:"app.bsky.feed.getQuotes",AppBskyFeedGetRepostedBy:"app.bsky.feed.getRepostedBy",AppBskyFeedGetSuggestedFeeds:"app.bsky.feed.getSuggestedFeeds",AppBskyFeedGetTimeline:"app.bsky.feed.getTimeline",AppBskyFeedLike:"app.bsky.feed.like",AppBskyFeedPost:"app.bsky.feed.post",AppBskyFeedPostgate:"app.bsky.feed.postgate",AppBskyFeedRepost:"app.bsky.feed.repost",AppBskyFeedSearchPosts:"app.bsky.feed.searchPosts",AppBskyFeedSendInteractions:"app.bsky.feed.sendInteractions",AppBskyFeedThreadgate:"app.bsky.feed.threadgate",AppBskyGraphBlock:"app.bsky.graph.block",AppBskyGraphDefs:"app.bsky.graph.defs",AppBskyGraphFollow:"app.bsky.graph.follow",AppBskyGraphGetActorStarterPacks:"app.bsky.graph.getActorStarterPacks",AppBskyGraphGetBlocks:"app.bsky.graph.getBlocks",AppBskyGraphGetFollowers:"app.bsky.graph.getFollowers",AppBskyGraphGetFollows:"app.bsky.graph.getFollows",AppBskyGraphGetKnownFollowers:"app.bsky.graph.getKnownFollowers",AppBskyGraphGetList:"app.bsky.graph.getList",AppBskyGraphGetListBlocks:"app.bsky.graph.getListBlocks",AppBskyGraphGetListMutes:"app.bsky.graph.getListMutes",AppBskyGraphGetLists:"app.bsky.graph.getLists",AppBskyGraphGetMutes:"app.bsky.graph.getMutes",AppBskyGraphGetRelationships:"app.bsky.graph.getRelationships",AppBskyGraphGetStarterPack:"app.bsky.graph.getStarterPack",AppBskyGraphGetStarterPacks:"app.bsky.graph.getStarterPacks",AppBskyGraphGetSuggestedFollowsByActor:"app.bsky.graph.getSuggestedFollowsByActor",AppBskyGraphList:"app.bsky.graph.list",AppBskyGraphListblock:"app.bsky.graph.listblock",AppBskyGraphListitem:"app.bsky.graph.listitem",AppBskyGraphMuteActor:"app.bsky.graph.muteActor",AppBskyGraphMuteActorList:"app.bsky.graph.muteActorList",AppBskyGraphMuteThread:"app.bsky.graph.muteThread",AppBskyGraphStarterpack:"app.bsky.graph.starterpack",AppBskyGraphUnmuteActor:"app.bsky.graph.unmuteActor",AppBskyGraphUnmuteActorList:"app.bsky.graph.unmuteActorList",AppBskyGraphUnmuteThread:"app.bsky.graph.unmuteThread",AppBskyLabelerDefs:"app.bsky.labeler.defs",AppBskyLabelerGetServices:"app.bsky.labeler.getServices",AppBskyLabelerService:"app.bsky.labeler.service",AppBskyNotificationGetUnreadCount:"app.bsky.notification.getUnreadCount",AppBskyNotificationListNotifications:"app.bsky.notification.listNotifications",AppBskyNotificationPutPreferences:"app.bsky.notification.putPreferences",AppBskyNotificationRegisterPush:"app.bsky.notification.registerPush",AppBskyNotificationUpdateSeen:"app.bsky.notification.updateSeen",AppBskyRichtextFacet:"app.bsky.richtext.facet",AppBskyUnspeccedDefs:"app.bsky.unspecced.defs",AppBskyUnspeccedGetPopularFeedGenerators:"app.bsky.unspecced.getPopularFeedGenerators",AppBskyUnspeccedGetSuggestionsSkeleton:"app.bsky.unspecced.getSuggestionsSkeleton",AppBskyUnspeccedGetTaggedSuggestions:"app.bsky.unspecced.getTaggedSuggestions",AppBskyUnspeccedSearchActorsSkeleton:"app.bsky.unspecced.searchActorsSkeleton",AppBskyUnspeccedSearchPostsSkeleton:"app.bsky.unspecced.searchPostsSkeleton",AppBskyVideoDefs:"app.bsky.video.defs",AppBskyVideoGetJobStatus:"app.bsky.video.getJobStatus",AppBskyVideoGetUploadLimits:"app.bsky.video.getUploadLimits",AppBskyVideoUploadVideo:"app.bsky.video.uploadVideo",ChatBskyActorDeclaration:"chat.bsky.actor.declaration",ChatBskyActorDefs:"chat.bsky.actor.defs",ChatBskyActorDeleteAccount:"chat.bsky.actor.deleteAccount",ChatBskyActorExportAccountData:"chat.bsky.actor.exportAccountData",ChatBskyConvoDefs:"chat.bsky.convo.defs",ChatBskyConvoDeleteMessageForSelf:"chat.bsky.convo.deleteMessageForSelf",ChatBskyConvoGetConvo:"chat.bsky.convo.getConvo",ChatBskyConvoGetConvoForMembers:"chat.bsky.convo.getConvoForMembers",ChatBskyConvoGetLog:"chat.bsky.convo.getLog",ChatBskyConvoGetMessages:"chat.bsky.convo.getMessages",ChatBskyConvoLeaveConvo:"chat.bsky.convo.leaveConvo",ChatBskyConvoListConvos:"chat.bsky.convo.listConvos",ChatBskyConvoMuteConvo:"chat.bsky.convo.muteConvo",ChatBskyConvoSendMessage:"chat.bsky.convo.sendMessage",ChatBskyConvoSendMessageBatch:"chat.bsky.convo.sendMessageBatch",ChatBskyConvoUnmuteConvo:"chat.bsky.convo.unmuteConvo",ChatBskyConvoUpdateRead:"chat.bsky.convo.updateRead",ChatBskyModerationGetActorMetadata:"chat.bsky.moderation.getActorMetadata",ChatBskyModerationGetMessageContext:"chat.bsky.moderation.getMessageContext",ChatBskyModerationUpdateActorAccess:"chat.bsky.moderation.updateActorAccess",ToolsOzoneCommunicationCreateTemplate:"tools.ozone.communication.createTemplate",ToolsOzoneCommunicationDefs:"tools.ozone.communication.defs",ToolsOzoneCommunicationDeleteTemplate:"tools.ozone.communication.deleteTemplate",ToolsOzoneCommunicationListTemplates:"tools.ozone.communication.listTemplates",ToolsOzoneCommunicationUpdateTemplate:"tools.ozone.communication.updateTemplate",ToolsOzoneModerationDefs:"tools.ozone.moderation.defs",ToolsOzoneModerationEmitEvent:"tools.ozone.moderation.emitEvent",ToolsOzoneModerationGetEvent:"tools.ozone.moderation.getEvent",ToolsOzoneModerationGetRecord:"tools.ozone.moderation.getRecord",ToolsOzoneModerationGetRecords:"tools.ozone.moderation.getRecords",ToolsOzoneModerationGetRepo:"tools.ozone.moderation.getRepo",ToolsOzoneModerationGetRepos:"tools.ozone.moderation.getRepos",ToolsOzoneModerationQueryEvents:"tools.ozone.moderation.queryEvents",ToolsOzoneModerationQueryStatuses:"tools.ozone.moderation.queryStatuses",ToolsOzoneModerationSearchRepos:"tools.ozone.moderation.searchRepos",ToolsOzoneServerGetConfig:"tools.ozone.server.getConfig",ToolsOzoneSetAddValues:"tools.ozone.set.addValues",ToolsOzoneSetDefs:"tools.ozone.set.defs",ToolsOzoneSetDeleteSet:"tools.ozone.set.deleteSet",ToolsOzoneSetDeleteValues:"tools.ozone.set.deleteValues",ToolsOzoneSetGetValues:"tools.ozone.set.getValues",ToolsOzoneSetQuerySets:"tools.ozone.set.querySets",ToolsOzoneSetUpsertSet:"tools.ozone.set.upsertSet",ToolsOzoneSignatureDefs:"tools.ozone.signature.defs",ToolsOzoneSignatureFindCorrelation:"tools.ozone.signature.findCorrelation",ToolsOzoneSignatureFindRelatedAccounts:"tools.ozone.signature.findRelatedAccounts",ToolsOzoneSignatureSearchAccounts:"tools.ozone.signature.searchAccounts",ToolsOzoneTeamAddMember:"tools.ozone.team.addMember",ToolsOzoneTeamDefs:"tools.ozone.team.defs",ToolsOzoneTeamDeleteMember:"tools.ozone.team.deleteMember",ToolsOzoneTeamListMembers:"tools.ozone.team.listMembers",ToolsOzoneTeamUpdateMember:"tools.ozone.team.updateMember"}}(Dn);var On={};Object.defineProperty(On,"__esModule",{value:!0});var Un={};Object.defineProperty(Un,"__esModule",{value:!0}),Un.BSKY_LABELER_DID=void 0,Un.BSKY_LABELER_DID="did:plc:ar7c4by46qjdydhdevvrndac";var In={};!function(t){var r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.nuxSchema=t.asDid=t.isDid=void 0,t.sanitizeMutedWordValue=function(e){return e.trim().replace(/^#(?!\ufe0f)/,"").replace(/[\r\n\u00AD\u2060\u200D\u200C\u200B]+/,"")},t.savedFeedsToUriArrays=function(e){const t=[],r=[];for(const n of e)n.pinned?(t.push(n.value),r.push(n.value)):r.push(n.value);return{pinned:t,saved:r}},t.getSavedFeedType=function(e){switch(new n.AtUri(e).collection){case"app.bsky.feed.generator":return"feed";case"app.bsky.graph.list":return"list";default:return"unknown"}},t.validateSavedFeed=function(e){if(new o.TID(e.id),["feed","list"].includes(e.type)){const t=new n.AtUri(e.value),r="app.bsky.feed.generator"===t.collection,o="app.bsky.graph.list"===t.collection;if("feed"===e.type&&!r)throw new Error(`Saved feed of type 'feed' must be a feed, got ${t.collection}`);if("list"===e.type&&!o)throw new Error(`Saved feed of type 'list' must be a list, got ${t.collection}`)}},t.validateNux=function(e){t.nuxSchema.parse(e)};const n=F,o=le,i=r(S);t.isDid=e=>"string"==typeof e&&e.startsWith("did:")&&e.includes(":",4)&&e.length>8&&e.length<=2048;t.asDid=e=>{if((0,t.isDid)(e))return e;throw new TypeError(`Invalid DID: ${e}`)},t.nuxSchema=i.default.object({id:i.default.string().max(64),completed:i.default.boolean(),data:i.default.string().max(300).optional(),expiresAt:i.default.string().datetime().optional()}).strict()}(In);var Kn={},Mn={},Vn={},Nn={},zn={},Fn={},qn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.XRPCInvalidResponseError=e.XRPCError=e.XRPCResponse=e.ResponseTypeStrings=e.ResponseTypeNames=e.ResponseType=e.errorResponseBody=void 0,e.httpResponseCodeToEnum=n,e.httpResponseCodeToName=o,e.httpResponseCodeToString=i;const t=S;var r;function n(e){return e in r?e:e>=100&&e<200?r.XRPCNotSupported:e>=200&&e<300?r.Success:e>=300&&e<400?r.XRPCNotSupported:e>=400&&e<500?r.InvalidRequest:r.InternalServerError}function o(t){return e.ResponseTypeNames[n(t)]}function i(t){return e.ResponseTypeStrings[n(t)]}e.errorResponseBody=t.z.object({error:t.z.string().optional(),message:t.z.string().optional()}),function(e){e[e.Unknown=1]="Unknown",e[e.InvalidResponse=2]="InvalidResponse",e[e.Success=200]="Success",e[e.InvalidRequest=400]="InvalidRequest",e[e.AuthRequired=401]="AuthRequired",e[e.Forbidden=403]="Forbidden",e[e.XRPCNotSupported=404]="XRPCNotSupported",e[e.NotAcceptable=406]="NotAcceptable",e[e.PayloadTooLarge=413]="PayloadTooLarge",e[e.UnsupportedMediaType=415]="UnsupportedMediaType",e[e.RateLimitExceeded=429]="RateLimitExceeded",e[e.InternalServerError=500]="InternalServerError",e[e.MethodNotImplemented=501]="MethodNotImplemented",e[e.UpstreamFailure=502]="UpstreamFailure",e[e.NotEnoughResources=503]="NotEnoughResources",e[e.UpstreamTimeout=504]="UpstreamTimeout"}(r||(e.ResponseType=r={})),e.ResponseTypeNames={[r.Unknown]:"Unknown",[r.InvalidResponse]:"InvalidResponse",[r.Success]:"Success",[r.InvalidRequest]:"InvalidRequest",[r.AuthRequired]:"AuthenticationRequired",[r.Forbidden]:"Forbidden",[r.XRPCNotSupported]:"XRPCNotSupported",[r.PayloadTooLarge]:"PayloadTooLarge",[r.UnsupportedMediaType]:"UnsupportedMediaType",[r.RateLimitExceeded]:"RateLimitExceeded",[r.InternalServerError]:"InternalServerError",[r.MethodNotImplemented]:"MethodNotImplemented",[r.UpstreamFailure]:"UpstreamFailure",[r.NotEnoughResources]:"NotEnoughResources",[r.UpstreamTimeout]:"UpstreamTimeout"},e.ResponseTypeStrings={[r.Unknown]:"Unknown",[r.InvalidResponse]:"Invalid Response",[r.Success]:"Success",[r.InvalidRequest]:"Invalid Request",[r.AuthRequired]:"Authentication Required",[r.Forbidden]:"Forbidden",[r.XRPCNotSupported]:"XRPC Not Supported",[r.PayloadTooLarge]:"Payload Too Large",[r.UnsupportedMediaType]:"Unsupported Media Type",[r.RateLimitExceeded]:"Rate Limit Exceeded",[r.InternalServerError]:"Internal Server Error",[r.MethodNotImplemented]:"Method Not Implemented",[r.UpstreamFailure]:"Upstream Failure",[r.NotEnoughResources]:"Not Enough Resources",[r.UpstreamTimeout]:"Upstream Timeout"};e.XRPCResponse=class{constructor(e,t){Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"success",{enumerable:!0,configurable:!0,writable:!0,value:!0})}};class s extends Error{constructor(e,t=o(e),r,s,a){super(r||t||i(e),a),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"success",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.status=n(e);const c=a?.cause;void 0===this.cause&&void 0!==c&&(this.cause=c)}static from(e,t){if(e instanceof s)return e;const o=e instanceof Error?e:void 0,i=e instanceof Response?e:e?.response instanceof Response?e.response:void 0,a=o?.statusCode??o?.status??i?.status,c="number"==typeof a?n(a):t??r.Unknown,l=o?.message??String(e),d=i?Object.fromEntries(i.headers.entries()):void 0;return new s(c,void 0,l,d,{cause:e})}}e.XRPCError=s;e.XRPCInvalidResponseError=class extends s{constructor(t,n,o){super(r.InvalidResponse,e.ResponseTypeStrings[r.InvalidResponse],"The server gave an invalid response and may be out of date.",void 0,{cause:n}),Object.defineProperty(this,"lexiconNsid",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"validationError",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"responseBody",{enumerable:!0,configurable:!0,writable:!0,value:o})}}}(qn),Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.isErrorResponseBody=function(e){return Gn.errorResponseBody.safeParse(e).success},Fn.getMethodSchemaHTTPMethod=function(e){if("procedure"===e.type)return"post";return"get"},Fn.constructMethodCallUri=function(e,t,r,n){const o=new URL(Xn(e,t,n),r);return o.toString()},Fn.constructMethodCallUrl=Xn,Fn.encodeQueryParam=Wn,Fn.constructMethodCallHeaders=function(e,t,r){const n=new Headers;if(r?.headers)for(const e in r.headers){if(n.has(e))throw new TypeError(`Duplicate header: ${e}`);const t=r.headers[e];null!=t&&n.set(e,t)}if("procedure"===e.type)if(r?.encoding)n.set("content-type",r.encoding);else if(!n.has("content-type")&&void 0!==t)if(t instanceof ArrayBuffer||t instanceof Hn||ArrayBuffer.isView(t))n.set("content-type","application/octet-stream");else if(t instanceof FormData)n.set("content-type","multipart/form-data");else if(t instanceof URLSearchParams)n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8");else if(Zn(t))n.set("content-type",t.type||"application/octet-stream");else if("string"==typeof t)n.set("content-type","text/plain;charset=UTF-8");else if(Qn(t))n.set("content-type","application/octet-stream");else{if("boolean"!=typeof t&&"number"!=typeof t&&"string"!=typeof t&&"object"!=typeof t)throw new Gn.XRPCError(Gn.ResponseType.InvalidRequest,"Unsupported data type: "+typeof t);n.set("content-type","application/json")}return n},Fn.combineHeaders=function(e,t){if(!t)return e;let r;for(const[n,o]of t){if(void 0===o)continue;if(r??(r=new Headers(e)),r.has(n))continue;const t="function"==typeof o?o():o;if("string"==typeof t)r.set(n,t);else{if(null!==t)throw new TypeError(`Invalid "${n}" header value: ${typeof t}`);r.delete(n)}}return r??e},Fn.isBodyInit=Jn,Fn.isIterable=Qn,Fn.encodeMethodCallBody=function(e,t){const r=e.get("content-type");if(!r)return;if(void 0===t)throw new Gn.XRPCError(Gn.ResponseType.InvalidRequest,"A request body is expected but none was provided");if(Jn(t))return t instanceof FormData&&"multipart/form-data"===r&&e.delete("content-type"),t;if(Qn(t))return function(e){if("from"in Hn&&"function"==typeof Hn.from)return Hn.from(e);throw new TypeError("ReadableStream.from() is not supported in this environment. It is required to support using iterables as the request body. Consider using a polyfill or re-write your code to use a different body type.")}(t);if(r.startsWith("text/"))return(new TextEncoder).encode(String(t));if(r.startsWith("application/json")){const e=(0,$n.stringifyLex)(t);if(void 0===e)throw new Gn.XRPCError(Gn.ResponseType.InvalidRequest,"Failed to encode request body as JSON");return(new TextEncoder).encode(e)}const n=t&&"object"==typeof t?t.constructor!==Object&&"function"==typeof t.constructor&&"string"==typeof t.constructor?.name?t.constructor.name:"object":typeof t;throw new Gn.XRPCError(Gn.ResponseType.InvalidRequest,`Unable to encode ${n} as ${r} data`)},Fn.httpResponseBodyParse=function(e,t){try{if(e){if(e.includes("application/json")){const e=(new TextDecoder).decode(t);return(0,$n.jsonStringToLex)(e)}if(e.startsWith("text/"))return(new TextDecoder).decode(t)}return t instanceof ArrayBuffer?new Uint8Array(t):t}catch(e){throw new Gn.XRPCError(Gn.ResponseType.InvalidResponse,void 0,`Failed to parse response body: ${String(e)}`,void 0,{cause:e})}};const $n=A,Gn=qn,Hn=globalThis.ReadableStream||class{constructor(){throw new Error("ReadableStream is not supported in this environment")}};function Xn(e,t,r){const n=`/xrpc/${encodeURIComponent(e)}`;if(!r)return n;const o=[];for(const[e,n]of Object.entries(r)){const r=t.parameters?.properties?.[e];if(!r)throw new Error(`Invalid query parameter: ${e}`);if(void 0!==n)if("array"===r.type){const t=Array.isArray(n)?n:[n];for(const n of t)o.push([e,Wn(r.items.type,n)])}else o.push([e,Wn(r.type,n)])}return o.length?`${n}?${new URLSearchParams(o).toString()}`:n}function Wn(e,t){if("string"===e||"unknown"===e)return String(t);if("float"===e)return String(Number(t));if("integer"===e)return String(0|Number(t));if("boolean"===e)return t?"true":"false";if("datetime"===e)return t instanceof Date?t.toISOString():String(t);throw new Error(`Unsupported query param type: ${e}`)}function Zn(e){if(null==e)return!1;if("object"!=typeof e)return!1;if("function"==typeof Blob&&e instanceof Blob)return!0;const t=e[Symbol.toStringTag];return("Blob"===t||"File"===t)&&("stream"in e&&"function"==typeof e.stream)}function Jn(e){switch(typeof e){case"string":return!0;case"object":return e instanceof ArrayBuffer||e instanceof FormData||e instanceof URLSearchParams||e instanceof Hn||ArrayBuffer.isView(e)||Zn(e);default:return!1}}function Qn(e){return null!=e&&"object"==typeof e&&(Symbol.iterator in e||Symbol.asyncIterator in e)}Object.defineProperty(zn,"__esModule",{value:!0}),zn.buildFetchHandler=function(e){if("function"==typeof e)return e;if("object"==typeof e&&"fetchHandler"in e)return e.fetchHandler.bind(e);const{service:t,headers:r,fetch:n=globalThis.fetch}="string"==typeof e||e instanceof URL?{service:e}:e;if("function"!=typeof n)throw new TypeError("XrpcDispatcher requires fetch() to be available in your environment.");const o=null!=r?Object.entries(r):void 0;return async function(e,r){const i="function"==typeof t?t():t,s=new URL(e,i),a=(0,Yn.combineHeaders)(r.headers,o);return n(s,{...r,headers:a})}};const Yn=Fn;Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.XrpcClient=void 0;const eo=A,to=zn,ro=qn,no=Fn;Nn.XrpcClient=class{constructor(e,t){Object.defineProperty(this,"fetchHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"lex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fetchHandler=(0,to.buildFetchHandler)(e),this.lex=t instanceof eo.Lexicons?t:new eo.Lexicons(t)}setHeader(e,t){this.headers.set(e.toLowerCase(),t)}unsetHeader(e){this.headers.delete(e.toLowerCase())}clearHeaders(){this.headers.clear()}async call(e,t,r,n){const o=this.lex.getDefOrThrow(e);if(!o||"query"!==o.type&&"procedure"!==o.type)throw new TypeError(`Invalid lexicon: ${e}. Must be a query or procedure.`);const i=(0,no.constructMethodCallUrl)(e,o,t),s=(0,no.getMethodSchemaHTTPMethod)(o),a=(0,no.constructMethodCallHeaders)(o,r,n),c=(0,no.encodeMethodCallBody)(a,r),l={method:s,headers:(0,no.combineHeaders)(a,this.headers),body:c,duplex:"half",signal:n?.signal};try{const t=await this.fetchHandler.call(void 0,i,l),r=t.status,n=Object.fromEntries(t.headers.entries()),o=await t.arrayBuffer(),s=(0,no.httpResponseBodyParse)(t.headers.get("content-type"),o),a=(0,ro.httpResponseCodeToEnum)(r);if(a!==ro.ResponseType.Success){const{error:e,message:t}=s&&(0,no.isErrorResponseBody)(s)?s:{};throw new ro.XRPCError(a,e,t,n)}try{this.lex.assertValidXrpcOutput(e,s)}catch(t){if(t instanceof eo.ValidationError)throw new ro.XRPCInvalidResponseError(e,t,s);throw t}return new ro.XRPCResponse(s,n)}catch(e){throw ro.XRPCError.from(e)}}},Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.ServiceClient=Vn.Client=void 0;const oo=A,io=Nn,so=Fn;Vn.Client=class{constructor(){Object.defineProperty(this,"lex",{enumerable:!0,configurable:!0,writable:!0,value:new oo.Lexicons})}get fetch(){throw new Error("Client.fetch is no longer supported. Use an XrpcClient instead.")}set fetch(e){throw new Error("Client.fetch is no longer supported. Use an XrpcClient instead.")}async call(e,t,r,n,o){return this.service(e).call(t,r,n,o)}service(e){return new ao(this,e)}addLexicon(e){this.lex.add(e)}addLexicons(e){for(const t of e)this.addLexicon(t)}removeLexicon(e){this.lex.remove(e)}};class ao extends io.XrpcClient{constructor(e,t){super((async(e,t)=>{const r=(0,so.combineHeaders)(t.headers,Object.entries(this.headers));return fetch(new URL(e,this.uri),{...t,headers:r})}),e.lex),Object.defineProperty(this,"baseClient",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"uri",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.uri="string"==typeof t?new URL(t):t}}Vn.ServiceClient=ao,function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(Vn,t),n(zn,t),n(qn,t),n(Fn,t),n(Nn,t);const o=new Vn.Client;t.default=o}(Mn);var co={},lo={};Object.defineProperty(lo,"__esModule",{value:!0}),lo.isObj=function(e){return"object"==typeof e&&null!==e},lo.hasProp=function(e,t){return t in e},Object.defineProperty(co,"__esModule",{value:!0}),co.InvalidSwapError=void 0,co.toKnownErr=function(e){if(e instanceof uo.XRPCError&&"InvalidSwap"===e.error)return new ho(e);return e},co.isCreate=function(e){return(0,po.isObj)(e)&&(0,po.hasProp)(e,"$type")&&"com.atproto.repo.applyWrites#create"===e.$type},co.validateCreate=function(e){return fo.lexicons.validate("com.atproto.repo.applyWrites#create",e)},co.isUpdate=function(e){return(0,po.isObj)(e)&&(0,po.hasProp)(e,"$type")&&"com.atproto.repo.applyWrites#update"===e.$type},co.validateUpdate=function(e){return fo.lexicons.validate("com.atproto.repo.applyWrites#update",e)},co.isDelete=function(e){return(0,po.isObj)(e)&&(0,po.hasProp)(e,"$type")&&"com.atproto.repo.applyWrites#delete"===e.$type},co.validateDelete=function(e){return fo.lexicons.validate("com.atproto.repo.applyWrites#delete",e)},co.isCreateResult=function(e){return(0,po.isObj)(e)&&(0,po.hasProp)(e,"$type")&&"com.atproto.repo.applyWrites#createResult"===e.$type},co.validateCreateResult=function(e){return fo.lexicons.validate("com.atproto.repo.applyWrites#createResult",e)},co.isUpdateResult=function(e){return(0,po.isObj)(e)&&(0,po.hasProp)(e,"$type")&&"com.atproto.repo.applyWrites#updateResult"===e.$type},co.validateUpdateResult=function(e){return fo.lexicons.validate("com.atproto.repo.applyWrites#updateResult",e)},co.isDeleteResult=function(e){return(0,po.isObj)(e)&&(0,po.hasProp)(e,"$type")&&"com.atproto.repo.applyWrites#deleteResult"===e.$type},co.validateDeleteResult=function(e){return fo.lexicons.validate("com.atproto.repo.applyWrites#deleteResult",e)};const uo=Mn,po=lo,fo=Dn;let ho=class extends uo.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};co.InvalidSwapError=ho;var yo={};Object.defineProperty(yo,"__esModule",{value:!0}),yo.InvalidSwapError=void 0,yo.toKnownErr=function(e){if(e instanceof mo.XRPCError&&"InvalidSwap"===e.error)return new bo(e);return e};const mo=Mn;let bo=class extends mo.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};yo.InvalidSwapError=bo;var go={};Object.defineProperty(go,"__esModule",{value:!0}),go.InvalidSwapError=void 0,go.toKnownErr=function(e){if(e instanceof vo.XRPCError&&"InvalidSwap"===e.error)return new Eo(e);return e};const vo=Mn;let Eo=class extends vo.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};go.InvalidSwapError=Eo;var wo={};Object.defineProperty(wo,"__esModule",{value:!0}),wo.RecordNotFoundError=void 0,wo.toKnownErr=function(e){if(e instanceof Ro.XRPCError&&"RecordNotFound"===e.error)return new Ao(e);return e};const Ro=Mn;let Ao=class extends Ro.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};wo.RecordNotFoundError=Ao;var _o={};Object.defineProperty(_o,"__esModule",{value:!0}),_o.InvalidSwapError=void 0,_o.toKnownErr=function(e){if(e instanceof So.XRPCError&&"InvalidSwap"===e.error)return new ko(e);return e};const So=Mn;class ko extends So.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}_o.InvalidSwapError=ko;var To={};Object.defineProperty(To,"__esModule",{value:!0}),To.InvalidEmailError=To.InvalidTokenError=To.ExpiredTokenError=To.AccountNotFoundError=void 0,To.toKnownErr=function(e){if(e instanceof Co.XRPCError){if("AccountNotFound"===e.error)return new Lo(e);if("ExpiredToken"===e.error)return new Po(e);if("InvalidToken"===e.error)return new xo(e);if("InvalidEmail"===e.error)return new Bo(e)}return e};const Co=Mn;class Lo extends Co.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}To.AccountNotFoundError=Lo;let Po=class extends Co.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};To.ExpiredTokenError=Po;let xo=class extends Co.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};To.InvalidTokenError=xo;class Bo extends Co.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}To.InvalidEmailError=Bo;var jo={};Object.defineProperty(jo,"__esModule",{value:!0}),jo.IncompatibleDidDocError=jo.UnresolvableDidError=jo.UnsupportedDomainError=jo.HandleNotAvailableError=jo.InvalidInviteCodeError=jo.InvalidPasswordError=jo.InvalidHandleError=void 0,jo.toKnownErr=function(e){if(e instanceof Do.XRPCError){if("InvalidHandle"===e.error)return new Oo(e);if("InvalidPassword"===e.error)return new Uo(e);if("InvalidInviteCode"===e.error)return new Io(e);if("HandleNotAvailable"===e.error)return new Ko(e);if("UnsupportedDomain"===e.error)return new Mo(e);if("UnresolvableDid"===e.error)return new Vo(e);if("IncompatibleDidDoc"===e.error)return new No(e)}return e};const Do=Mn;class Oo extends Do.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}jo.InvalidHandleError=Oo;class Uo extends Do.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}jo.InvalidPasswordError=Uo;class Io extends Do.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}jo.InvalidInviteCodeError=Io;class Ko extends Do.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}jo.HandleNotAvailableError=Ko;class Mo extends Do.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}jo.UnsupportedDomainError=Mo;class Vo extends Do.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}jo.UnresolvableDidError=Vo;class No extends Do.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}jo.IncompatibleDidDocError=No;var zo={};Object.defineProperty(zo,"__esModule",{value:!0}),zo.AccountTakedownError=void 0,zo.toKnownErr=function(e){if(e instanceof Fo.XRPCError&&"AccountTakedown"===e.error)return new Go(e);return e},zo.isAppPassword=function(e){return(0,qo.isObj)(e)&&(0,qo.hasProp)(e,"$type")&&"com.atproto.server.createAppPassword#appPassword"===e.$type},zo.validateAppPassword=function(e){return $o.lexicons.validate("com.atproto.server.createAppPassword#appPassword",e)};const Fo=Mn,qo=lo,$o=Dn;let Go=class extends Fo.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};zo.AccountTakedownError=Go;var Ho={};Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.AuthFactorTokenRequiredError=Ho.AccountTakedownError=void 0,Ho.toKnownErr=function(e){if(e instanceof Xo.XRPCError){if("AccountTakedown"===e.error)return new Wo(e);if("AuthFactorTokenRequired"===e.error)return new Zo(e)}return e};const Xo=Mn;let Wo=class extends Xo.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Ho.AccountTakedownError=Wo;class Zo extends Xo.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}Ho.AuthFactorTokenRequiredError=Zo;var Jo={};Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.InvalidTokenError=Jo.ExpiredTokenError=void 0,Jo.toKnownErr=function(e){if(e instanceof Qo.XRPCError){if("ExpiredToken"===e.error)return new Yo(e);if("InvalidToken"===e.error)return new ei(e)}return e};const Qo=Mn;let Yo=class extends Qo.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Jo.ExpiredTokenError=Yo;let ei=class extends Qo.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Jo.InvalidTokenError=ei;var ti={};Object.defineProperty(ti,"__esModule",{value:!0}),ti.DuplicateCreateError=void 0,ti.toKnownErr=function(e){if(e instanceof ri.XRPCError&&"DuplicateCreate"===e.error)return new ni(e);return e};const ri=Mn;class ni extends ri.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}ti.DuplicateCreateError=ni;var oi={};Object.defineProperty(oi,"__esModule",{value:!0}),oi.BadExpirationError=void 0,oi.toKnownErr=function(e){if(e instanceof ii.XRPCError&&"BadExpiration"===e.error)return new si(e);return e};const ii=Mn;class si extends ii.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}oi.BadExpirationError=si;var ai={};Object.defineProperty(ai,"__esModule",{value:!0}),ai.AccountTakedownError=void 0,ai.toKnownErr=function(e){if(e instanceof ci.XRPCError&&"AccountTakedown"===e.error)return new ui(e);return e},ai.isAppPassword=function(e){return(0,li.isObj)(e)&&(0,li.hasProp)(e,"$type")&&"com.atproto.server.listAppPasswords#appPassword"===e.$type},ai.validateAppPassword=function(e){return di.lexicons.validate("com.atproto.server.listAppPasswords#appPassword",e)};const ci=Mn,li=lo,di=Dn;let ui=class extends ci.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};ai.AccountTakedownError=ui;var pi={};Object.defineProperty(pi,"__esModule",{value:!0}),pi.AccountTakedownError=void 0,pi.toKnownErr=function(e){if(e instanceof fi.XRPCError&&"AccountTakedown"===e.error)return new hi(e);return e};const fi=Mn;class hi extends fi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}pi.AccountTakedownError=hi;var yi={};Object.defineProperty(yi,"__esModule",{value:!0}),yi.InvalidTokenError=yi.ExpiredTokenError=void 0,yi.toKnownErr=function(e){if(e instanceof mi.XRPCError){if("ExpiredToken"===e.error)return new bi(e);if("InvalidToken"===e.error)return new gi(e)}return e};const mi=Mn;let bi=class extends mi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};yi.ExpiredTokenError=bi;let gi=class extends mi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};yi.InvalidTokenError=gi;var vi={};Object.defineProperty(vi,"__esModule",{value:!0}),vi.TokenRequiredError=vi.InvalidTokenError=vi.ExpiredTokenError=void 0,vi.toKnownErr=function(e){if(e instanceof Ei.XRPCError){if("ExpiredToken"===e.error)return new wi(e);if("InvalidToken"===e.error)return new Ri(e);if("TokenRequired"===e.error)return new Ai(e)}return e};const Ei=Mn;class wi extends Ei.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}vi.ExpiredTokenError=wi;class Ri extends Ei.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}vi.InvalidTokenError=Ri;class Ai extends Ei.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}vi.TokenRequiredError=Ai;var _i={};Object.defineProperty(_i,"__esModule",{value:!0}),_i.RepoDeactivatedError=_i.RepoSuspendedError=_i.RepoTakendownError=_i.RepoNotFoundError=_i.BlobNotFoundError=void 0,_i.toKnownErr=function(e){if(e instanceof Si.XRPCError){if("BlobNotFound"===e.error)return new ki(e);if("RepoNotFound"===e.error)return new Ti(e);if("RepoTakendown"===e.error)return new Ci(e);if("RepoSuspended"===e.error)return new Li(e);if("RepoDeactivated"===e.error)return new Pi(e)}return e};const Si=Mn;class ki extends Si.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}_i.BlobNotFoundError=ki;let Ti=class extends Si.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};_i.RepoNotFoundError=Ti;let Ci=class extends Si.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};_i.RepoTakendownError=Ci;let Li=class extends Si.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};_i.RepoSuspendedError=Li;let Pi=class extends Si.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};_i.RepoDeactivatedError=Pi;var xi={};Object.defineProperty(xi,"__esModule",{value:!0}),xi.RepoDeactivatedError=xi.RepoSuspendedError=xi.RepoTakendownError=xi.RepoNotFoundError=xi.BlockNotFoundError=void 0,xi.toKnownErr=function(e){if(e instanceof Bi.XRPCError){if("BlockNotFound"===e.error)return new ji(e);if("RepoNotFound"===e.error)return new Di(e);if("RepoTakendown"===e.error)return new Oi(e);if("RepoSuspended"===e.error)return new Ui(e);if("RepoDeactivated"===e.error)return new Ii(e)}return e};const Bi=Mn;class ji extends Bi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}xi.BlockNotFoundError=ji;let Di=class extends Bi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};xi.RepoNotFoundError=Di;let Oi=class extends Bi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};xi.RepoTakendownError=Oi;let Ui=class extends Bi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};xi.RepoSuspendedError=Ui;let Ii=class extends Bi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};xi.RepoDeactivatedError=Ii;var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.HeadNotFoundError=void 0,Ki.toKnownErr=function(e){if(e instanceof Mi.XRPCError&&"HeadNotFound"===e.error)return new Vi(e);return e};const Mi=Mn;class Vi extends Mi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}Ki.HeadNotFoundError=Vi;var Ni={};Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.RepoDeactivatedError=Ni.RepoSuspendedError=Ni.RepoTakendownError=Ni.RepoNotFoundError=void 0,Ni.toKnownErr=function(e){if(e instanceof zi.XRPCError){if("RepoNotFound"===e.error)return new Fi(e);if("RepoTakendown"===e.error)return new qi(e);if("RepoSuspended"===e.error)return new $i(e);if("RepoDeactivated"===e.error)return new Gi(e)}return e};const zi=Mn;let Fi=class extends zi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Ni.RepoNotFoundError=Fi;let qi=class extends zi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Ni.RepoTakendownError=qi;let $i=class extends zi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Ni.RepoSuspendedError=$i;let Gi=class extends zi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Ni.RepoDeactivatedError=Gi;var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.RepoDeactivatedError=Hi.RepoSuspendedError=Hi.RepoTakendownError=Hi.RepoNotFoundError=Hi.RecordNotFoundError=void 0,Hi.toKnownErr=function(e){if(e instanceof Xi.XRPCError){if("RecordNotFound"===e.error)return new Wi(e);if("RepoNotFound"===e.error)return new Zi(e);if("RepoTakendown"===e.error)return new Ji(e);if("RepoSuspended"===e.error)return new Qi(e);if("RepoDeactivated"===e.error)return new Yi(e)}return e};const Xi=Mn;let Wi=class extends Xi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Hi.RecordNotFoundError=Wi;let Zi=class extends Xi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Hi.RepoNotFoundError=Zi;let Ji=class extends Xi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Hi.RepoTakendownError=Ji;let Qi=class extends Xi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Hi.RepoSuspendedError=Qi;let Yi=class extends Xi.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Hi.RepoDeactivatedError=Yi;var es={};Object.defineProperty(es,"__esModule",{value:!0}),es.RepoDeactivatedError=es.RepoSuspendedError=es.RepoTakendownError=es.RepoNotFoundError=void 0,es.toKnownErr=function(e){if(e instanceof ts.XRPCError){if("RepoNotFound"===e.error)return new rs(e);if("RepoTakendown"===e.error)return new ns(e);if("RepoSuspended"===e.error)return new os(e);if("RepoDeactivated"===e.error)return new is(e)}return e};const ts=Mn;let rs=class extends ts.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};es.RepoNotFoundError=rs;let ns=class extends ts.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};es.RepoTakendownError=ns;let os=class extends ts.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};es.RepoSuspendedError=os;let is=class extends ts.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};es.RepoDeactivatedError=is;var ss={};Object.defineProperty(ss,"__esModule",{value:!0}),ss.RepoNotFoundError=void 0,ss.toKnownErr=function(e){if(e instanceof as.XRPCError&&"RepoNotFound"===e.error)return new cs(e);return e};const as=Mn;let cs=class extends as.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};ss.RepoNotFoundError=cs;var ls={};Object.defineProperty(ls,"__esModule",{value:!0}),ls.RepoDeactivatedError=ls.RepoSuspendedError=ls.RepoTakendownError=ls.RepoNotFoundError=void 0,ls.toKnownErr=function(e){if(e instanceof ds.XRPCError){if("RepoNotFound"===e.error)return new us(e);if("RepoTakendown"===e.error)return new ps(e);if("RepoSuspended"===e.error)return new fs(e);if("RepoDeactivated"===e.error)return new hs(e)}return e};const ds=Mn;let us=class extends ds.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};ls.RepoNotFoundError=us;class ps extends ds.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}ls.RepoTakendownError=ps;class fs extends ds.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}ls.RepoSuspendedError=fs;class hs extends ds.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}ls.RepoDeactivatedError=hs;var ys={};Object.defineProperty(ys,"__esModule",{value:!0}),ys.BlockedByActorError=ys.BlockedActorError=void 0,ys.toKnownErr=function(e){if(e instanceof ms.XRPCError){if("BlockedActor"===e.error)return new bs(e);if("BlockedByActor"===e.error)return new gs(e)}return e};const ms=Mn;let bs=class extends ms.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};ys.BlockedActorError=bs;let gs=class extends ms.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};ys.BlockedByActorError=gs;var vs={};Object.defineProperty(vs,"__esModule",{value:!0}),vs.BlockedByActorError=vs.BlockedActorError=void 0,vs.toKnownErr=function(e){if(e instanceof Es.XRPCError){if("BlockedActor"===e.error)return new ws(e);if("BlockedByActor"===e.error)return new Rs(e)}return e};const Es=Mn;class ws extends Es.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}vs.BlockedActorError=ws;class Rs extends Es.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}vs.BlockedByActorError=Rs;var As={};Object.defineProperty(As,"__esModule",{value:!0}),As.UnknownFeedError=void 0,As.toKnownErr=function(e){if(e instanceof _s.XRPCError&&"UnknownFeed"===e.error)return new Ss(e);return e};const _s=Mn;let Ss=class extends _s.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};As.UnknownFeedError=Ss;var ks={};Object.defineProperty(ks,"__esModule",{value:!0}),ks.UnknownFeedError=void 0,ks.toKnownErr=function(e){if(e instanceof Ts.XRPCError&&"UnknownFeed"===e.error)return new Cs(e);return e};const Ts=Mn;class Cs extends Ts.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}ks.UnknownFeedError=Cs;var Ls={};Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.UnknownListError=void 0,Ls.toKnownErr=function(e){if(e instanceof Ps.XRPCError&&"UnknownList"===e.error)return new xs(e);return e};const Ps=Mn;class xs extends Ps.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}Ls.UnknownListError=xs;var Bs={};Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.NotFoundError=void 0,Bs.toKnownErr=function(e){if(e instanceof js.XRPCError&&"NotFound"===e.error)return new Ds(e);return e};const js=Mn;class Ds extends js.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}Bs.NotFoundError=Ds;var Os={};Object.defineProperty(Os,"__esModule",{value:!0}),Os.BadQueryStringError=void 0,Os.toKnownErr=function(e){if(e instanceof Us.XRPCError&&"BadQueryString"===e.error)return new Is(e);return e};const Us=Mn;let Is=class extends Us.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Os.BadQueryStringError=Is;var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.ActorNotFoundError=void 0,Ks.toKnownErr=function(e){if(e instanceof Ms.XRPCError&&"ActorNotFound"===e.error)return new Vs(e);return e};const Ms=Mn;class Vs extends Ms.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}Ks.ActorNotFoundError=Vs;var Ns={};Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.BadQueryStringError=void 0,Ns.toKnownErr=function(e){if(e instanceof zs.XRPCError&&"BadQueryString"===e.error)return new Fs(e);return e};const zs=Mn;let Fs=class extends zs.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Ns.BadQueryStringError=Fs;var qs={};Object.defineProperty(qs,"__esModule",{value:!0}),qs.BadQueryStringError=void 0,qs.toKnownErr=function(e){if(e instanceof $s.XRPCError&&"BadQueryString"===e.error)return new Gs(e);return e};const $s=Mn;class Gs extends $s.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}qs.BadQueryStringError=Gs;var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.DuplicateTemplateNameError=void 0,Hs.toKnownErr=function(e){if(e instanceof Xs.XRPCError&&"DuplicateTemplateName"===e.error)return new Ws(e);return e};const Xs=Mn;let Ws=class extends Xs.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Hs.DuplicateTemplateNameError=Ws;var Zs={};Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.DuplicateTemplateNameError=void 0,Zs.toKnownErr=function(e){if(e instanceof Js.XRPCError&&"DuplicateTemplateName"===e.error)return new Qs(e);return e};const Js=Mn;class Qs extends Js.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}Zs.DuplicateTemplateNameError=Qs;var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.SubjectHasActionError=void 0,Ys.toKnownErr=function(e){if(e instanceof ea.XRPCError&&"SubjectHasAction"===e.error)return new ta(e);return e};const ea=Mn;class ta extends ea.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}Ys.SubjectHasActionError=ta;var ra={};Object.defineProperty(ra,"__esModule",{value:!0}),ra.RecordNotFoundError=void 0,ra.toKnownErr=function(e){if(e instanceof na.XRPCError&&"RecordNotFound"===e.error)return new oa(e);return e};const na=Mn;class oa extends na.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}ra.RecordNotFoundError=oa;var ia={};Object.defineProperty(ia,"__esModule",{value:!0}),ia.RepoNotFoundError=void 0,ia.toKnownErr=function(e){if(e instanceof sa.XRPCError&&"RepoNotFound"===e.error)return new aa(e);return e};const sa=Mn;class aa extends sa.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}ia.RepoNotFoundError=aa;var ca={};Object.defineProperty(ca,"__esModule",{value:!0}),ca.SetNotFoundError=void 0,ca.toKnownErr=function(e){if(e instanceof la.XRPCError&&"SetNotFound"===e.error)return new da(e);return e};const la=Mn;let da=class extends la.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};ca.SetNotFoundError=da;var ua={};Object.defineProperty(ua,"__esModule",{value:!0}),ua.SetNotFoundError=void 0,ua.toKnownErr=function(e){if(e instanceof pa.XRPCError&&"SetNotFound"===e.error)return new fa(e);return e};const pa=Mn;let fa=class extends pa.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};ua.SetNotFoundError=fa;var ha={};Object.defineProperty(ha,"__esModule",{value:!0}),ha.SetNotFoundError=void 0,ha.toKnownErr=function(e){if(e instanceof ya.XRPCError&&"SetNotFound"===e.error)return new ma(e);return e};const ya=Mn;class ma extends ya.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}ha.SetNotFoundError=ma;var ba={};Object.defineProperty(ba,"__esModule",{value:!0}),ba.MemberAlreadyExistsError=void 0,ba.toKnownErr=function(e){if(e instanceof ga.XRPCError&&"MemberAlreadyExists"===e.error)return new va(e);return e};const ga=Mn;class va extends ga.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}ba.MemberAlreadyExistsError=va;var Ea={};Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.CannotDeleteSelfError=Ea.MemberNotFoundError=void 0,Ea.toKnownErr=function(e){if(e instanceof wa.XRPCError){if("MemberNotFound"===e.error)return new Ra(e);if("CannotDeleteSelf"===e.error)return new Aa(e)}return e};const wa=Mn;let Ra=class extends wa.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}};Ea.MemberNotFoundError=Ra;class Aa extends wa.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}Ea.CannotDeleteSelfError=Aa;var _a={};Object.defineProperty(_a,"__esModule",{value:!0}),_a.MemberNotFoundError=void 0,_a.toKnownErr=function(e){if(e instanceof Sa.XRPCError&&"MemberNotFound"===e.error)return new ka(e);return e};const Sa=Mn;class ka extends Sa.XRPCError{constructor(e){super(e.status,e.error,e.message,e.headers,{cause:e})}}_a.MemberNotFoundError=ka;var Ta={};Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.isStatusAttr=function(e){return(0,Ca.isObj)(e)&&(0,Ca.hasProp)(e,"$type")&&"com.atproto.admin.defs#statusAttr"===e.$type},Ta.validateStatusAttr=function(e){return La.lexicons.validate("com.atproto.admin.defs#statusAttr",e)},Ta.isAccountView=function(e){return(0,Ca.isObj)(e)&&(0,Ca.hasProp)(e,"$type")&&"com.atproto.admin.defs#accountView"===e.$type},Ta.validateAccountView=function(e){return La.lexicons.validate("com.atproto.admin.defs#accountView",e)},Ta.isRepoRef=function(e){return(0,Ca.isObj)(e)&&(0,Ca.hasProp)(e,"$type")&&"com.atproto.admin.defs#repoRef"===e.$type},Ta.validateRepoRef=function(e){return La.lexicons.validate("com.atproto.admin.defs#repoRef",e)},Ta.isRepoBlobRef=function(e){return(0,Ca.isObj)(e)&&(0,Ca.hasProp)(e,"$type")&&"com.atproto.admin.defs#repoBlobRef"===e.$type},Ta.validateRepoBlobRef=function(e){return La.lexicons.validate("com.atproto.admin.defs#repoBlobRef",e)};const Ca=lo,La=Dn;var Pa={};Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.toKnownErr=function(e){return e};var xa={};Object.defineProperty(xa,"__esModule",{value:!0}),xa.toKnownErr=function(e){return e};var Ba={};Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.toKnownErr=function(e){return e};var ja={};Object.defineProperty(ja,"__esModule",{value:!0}),ja.toKnownErr=function(e){return e};var Da={};Object.defineProperty(Da,"__esModule",{value:!0}),Da.toKnownErr=function(e){return e};var Oa={};Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.toKnownErr=function(e){return e};var Ua={};Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.toKnownErr=function(e){return e};var Ia={};Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.toKnownErr=function(e){return e};var Ka={};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.toKnownErr=function(e){return e};var Ma={};Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.toKnownErr=function(e){return e};var Va={};Object.defineProperty(Va,"__esModule",{value:!0}),Va.toKnownErr=function(e){return e};var Na={};Object.defineProperty(Na,"__esModule",{value:!0}),Na.toKnownErr=function(e){return e};var za={};Object.defineProperty(za,"__esModule",{value:!0}),za.toKnownErr=function(e){return e};var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.toKnownErr=function(e){return e};var qa={};Object.defineProperty(qa,"__esModule",{value:!0}),qa.toKnownErr=function(e){return e};var $a={};Object.defineProperty($a,"__esModule",{value:!0}),$a.toKnownErr=function(e){return e};var Ga={};Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.toKnownErr=function(e){return e};var Ha={};Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.toKnownErr=function(e){return e};var Xa={};Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.toKnownErr=function(e){return e};var Wa={};Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.toKnownErr=function(e){return e};var Za={};Object.defineProperty(Za,"__esModule",{value:!0}),Za.isLabel=function(e){return(0,Ja.isObj)(e)&&(0,Ja.hasProp)(e,"$type")&&"com.atproto.label.defs#label"===e.$type},Za.validateLabel=function(e){return Qa.lexicons.validate("com.atproto.label.defs#label",e)},Za.isSelfLabels=function(e){return(0,Ja.isObj)(e)&&(0,Ja.hasProp)(e,"$type")&&"com.atproto.label.defs#selfLabels"===e.$type},Za.validateSelfLabels=function(e){return Qa.lexicons.validate("com.atproto.label.defs#selfLabels",e)},Za.isSelfLabel=function(e){return(0,Ja.isObj)(e)&&(0,Ja.hasProp)(e,"$type")&&"com.atproto.label.defs#selfLabel"===e.$type},Za.validateSelfLabel=function(e){return Qa.lexicons.validate("com.atproto.label.defs#selfLabel",e)},Za.isLabelValueDefinition=function(e){return(0,Ja.isObj)(e)&&(0,Ja.hasProp)(e,"$type")&&"com.atproto.label.defs#labelValueDefinition"===e.$type},Za.validateLabelValueDefinition=function(e){return Qa.lexicons.validate("com.atproto.label.defs#labelValueDefinition",e)},Za.isLabelValueDefinitionStrings=function(e){return(0,Ja.isObj)(e)&&(0,Ja.hasProp)(e,"$type")&&"com.atproto.label.defs#labelValueDefinitionStrings"===e.$type},Za.validateLabelValueDefinitionStrings=function(e){return Qa.lexicons.validate("com.atproto.label.defs#labelValueDefinitionStrings",e)};const Ja=lo,Qa=Dn;var Ya={};Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.toKnownErr=function(e){return e};var ec={};Object.defineProperty(ec,"__esModule",{value:!0}),ec.isLabels=function(e){return(0,tc.isObj)(e)&&(0,tc.hasProp)(e,"$type")&&"com.atproto.label.subscribeLabels#labels"===e.$type},ec.validateLabels=function(e){return rc.lexicons.validate("com.atproto.label.subscribeLabels#labels",e)},ec.isInfo=function(e){return(0,tc.isObj)(e)&&(0,tc.hasProp)(e,"$type")&&"com.atproto.label.subscribeLabels#info"===e.$type},ec.validateInfo=function(e){return rc.lexicons.validate("com.atproto.label.subscribeLabels#info",e)};const tc=lo,rc=Dn;var nc={};Object.defineProperty(nc,"__esModule",{value:!0}),nc.toKnownErr=function(e){return e};var oc={};Object.defineProperty(oc,"__esModule",{value:!0}),oc.REASONAPPEAL=oc.REASONOTHER=oc.REASONRUDE=oc.REASONSEXUAL=oc.REASONMISLEADING=oc.REASONVIOLATION=oc.REASONSPAM=void 0,oc.REASONSPAM="com.atproto.moderation.defs#reasonSpam",oc.REASONVIOLATION="com.atproto.moderation.defs#reasonViolation",oc.REASONMISLEADING="com.atproto.moderation.defs#reasonMisleading",oc.REASONSEXUAL="com.atproto.moderation.defs#reasonSexual",oc.REASONRUDE="com.atproto.moderation.defs#reasonRude",oc.REASONOTHER="com.atproto.moderation.defs#reasonOther",oc.REASONAPPEAL="com.atproto.moderation.defs#reasonAppeal";var ic={};Object.defineProperty(ic,"__esModule",{value:!0}),ic.isCommitMeta=function(e){return(0,sc.isObj)(e)&&(0,sc.hasProp)(e,"$type")&&"com.atproto.repo.defs#commitMeta"===e.$type},ic.validateCommitMeta=function(e){return ac.lexicons.validate("com.atproto.repo.defs#commitMeta",e)};const sc=lo,ac=Dn;var cc={};Object.defineProperty(cc,"__esModule",{value:!0}),cc.toKnownErr=function(e){return e};var lc={};Object.defineProperty(lc,"__esModule",{value:!0}),lc.toKnownErr=function(e){return e};var dc={};Object.defineProperty(dc,"__esModule",{value:!0}),dc.toKnownErr=function(e){return e},dc.isRecordBlob=function(e){return(0,uc.isObj)(e)&&(0,uc.hasProp)(e,"$type")&&"com.atproto.repo.listMissingBlobs#recordBlob"===e.$type},dc.validateRecordBlob=function(e){return pc.lexicons.validate("com.atproto.repo.listMissingBlobs#recordBlob",e)};const uc=lo,pc=Dn;var fc={};Object.defineProperty(fc,"__esModule",{value:!0}),fc.toKnownErr=function(e){return e},fc.isRecord=function(e){return(0,hc.isObj)(e)&&(0,hc.hasProp)(e,"$type")&&"com.atproto.repo.listRecords#record"===e.$type},fc.validateRecord=function(e){return yc.lexicons.validate("com.atproto.repo.listRecords#record",e)};const hc=lo,yc=Dn;var mc={};Object.defineProperty(mc,"__esModule",{value:!0}),mc.isMain=function(e){return(0,bc.isObj)(e)&&(0,bc.hasProp)(e,"$type")&&("com.atproto.repo.strongRef#main"===e.$type||"com.atproto.repo.strongRef"===e.$type)},mc.validateMain=function(e){return gc.lexicons.validate("com.atproto.repo.strongRef#main",e)};const bc=lo,gc=Dn;var vc={};Object.defineProperty(vc,"__esModule",{value:!0}),vc.toKnownErr=function(e){return e};var Ec={};Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.toKnownErr=function(e){return e};var wc={};Object.defineProperty(wc,"__esModule",{value:!0}),wc.toKnownErr=function(e){return e};var Rc={};Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.toKnownErr=function(e){return e};var Ac={};Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.toKnownErr=function(e){return e},Ac.isAccountCodes=function(e){return(0,_c.isObj)(e)&&(0,_c.hasProp)(e,"$type")&&"com.atproto.server.createInviteCodes#accountCodes"===e.$type},Ac.validateAccountCodes=function(e){return Sc.lexicons.validate("com.atproto.server.createInviteCodes#accountCodes",e)};const _c=lo,Sc=Dn;var kc={};Object.defineProperty(kc,"__esModule",{value:!0}),kc.toKnownErr=function(e){return e};var Tc={};Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.isInviteCode=function(e){return(0,Cc.isObj)(e)&&(0,Cc.hasProp)(e,"$type")&&"com.atproto.server.defs#inviteCode"===e.$type},Tc.validateInviteCode=function(e){return Lc.lexicons.validate("com.atproto.server.defs#inviteCode",e)},Tc.isInviteCodeUse=function(e){return(0,Cc.isObj)(e)&&(0,Cc.hasProp)(e,"$type")&&"com.atproto.server.defs#inviteCodeUse"===e.$type},Tc.validateInviteCodeUse=function(e){return Lc.lexicons.validate("com.atproto.server.defs#inviteCodeUse",e)};const Cc=lo,Lc=Dn;var Pc={};Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.toKnownErr=function(e){return e};var xc={};Object.defineProperty(xc,"__esModule",{value:!0}),xc.toKnownErr=function(e){return e},xc.isLinks=function(e){return(0,Bc.isObj)(e)&&(0,Bc.hasProp)(e,"$type")&&"com.atproto.server.describeServer#links"===e.$type},xc.validateLinks=function(e){return jc.lexicons.validate("com.atproto.server.describeServer#links",e)},xc.isContact=function(e){return(0,Bc.isObj)(e)&&(0,Bc.hasProp)(e,"$type")&&"com.atproto.server.describeServer#contact"===e.$type},xc.validateContact=function(e){return jc.lexicons.validate("com.atproto.server.describeServer#contact",e)};const Bc=lo,jc=Dn;var Dc={};Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.toKnownErr=function(e){return e};var Oc={};Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.toKnownErr=function(e){return e};var Uc={};Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.toKnownErr=function(e){return e};var Ic={};Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.toKnownErr=function(e){return e};var Kc={};Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.toKnownErr=function(e){return e};var Mc={};Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.toKnownErr=function(e){return e};var Vc={};Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.toKnownErr=function(e){return e};var Nc={};Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.toKnownErr=function(e){return e};var zc={};Object.defineProperty(zc,"__esModule",{value:!0}),zc.toKnownErr=function(e){return e},zc.isRepo=function(e){return(0,Fc.isObj)(e)&&(0,Fc.hasProp)(e,"$type")&&"com.atproto.sync.listRepos#repo"===e.$type},zc.validateRepo=function(e){return qc.lexicons.validate("com.atproto.sync.listRepos#repo",e)};const Fc=lo,qc=Dn;var $c={};Object.defineProperty($c,"__esModule",{value:!0}),$c.toKnownErr=function(e){return e};var Gc={};Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.toKnownErr=function(e){return e};var Hc={};Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.isCommit=function(e){return(0,Xc.isObj)(e)&&(0,Xc.hasProp)(e,"$type")&&"com.atproto.sync.subscribeRepos#commit"===e.$type},Hc.validateCommit=function(e){return Wc.lexicons.validate("com.atproto.sync.subscribeRepos#commit",e)},Hc.isIdentity=function(e){return(0,Xc.isObj)(e)&&(0,Xc.hasProp)(e,"$type")&&"com.atproto.sync.subscribeRepos#identity"===e.$type},Hc.validateIdentity=function(e){return Wc.lexicons.validate("com.atproto.sync.subscribeRepos#identity",e)},Hc.isAccount=function(e){return(0,Xc.isObj)(e)&&(0,Xc.hasProp)(e,"$type")&&"com.atproto.sync.subscribeRepos#account"===e.$type},Hc.validateAccount=function(e){return Wc.lexicons.validate("com.atproto.sync.subscribeRepos#account",e)},Hc.isHandle=function(e){return(0,Xc.isObj)(e)&&(0,Xc.hasProp)(e,"$type")&&"com.atproto.sync.subscribeRepos#handle"===e.$type},Hc.validateHandle=function(e){return Wc.lexicons.validate("com.atproto.sync.subscribeRepos#handle",e)},Hc.isMigrate=function(e){return(0,Xc.isObj)(e)&&(0,Xc.hasProp)(e,"$type")&&"com.atproto.sync.subscribeRepos#migrate"===e.$type},Hc.validateMigrate=function(e){return Wc.lexicons.validate("com.atproto.sync.subscribeRepos#migrate",e)},Hc.isTombstone=function(e){return(0,Xc.isObj)(e)&&(0,Xc.hasProp)(e,"$type")&&"com.atproto.sync.subscribeRepos#tombstone"===e.$type},Hc.validateTombstone=function(e){return Wc.lexicons.validate("com.atproto.sync.subscribeRepos#tombstone",e)},Hc.isInfo=function(e){return(0,Xc.isObj)(e)&&(0,Xc.hasProp)(e,"$type")&&"com.atproto.sync.subscribeRepos#info"===e.$type},Hc.validateInfo=function(e){return Wc.lexicons.validate("com.atproto.sync.subscribeRepos#info",e)},Hc.isRepoOp=function(e){return(0,Xc.isObj)(e)&&(0,Xc.hasProp)(e,"$type")&&"com.atproto.sync.subscribeRepos#repoOp"===e.$type},Hc.validateRepoOp=function(e){return Wc.lexicons.validate("com.atproto.sync.subscribeRepos#repoOp",e)};const Xc=lo,Wc=Dn;var Zc={};Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.toKnownErr=function(e){return e};var Jc={};Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.toKnownErr=function(e){return e};var Qc={};Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.toKnownErr=function(e){return e};var Yc={};Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.isProfileViewBasic=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#profileViewBasic"===e.$type},Yc.validateProfileViewBasic=function(e){return tl.lexicons.validate("app.bsky.actor.defs#profileViewBasic",e)},Yc.isProfileView=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#profileView"===e.$type},Yc.validateProfileView=function(e){return tl.lexicons.validate("app.bsky.actor.defs#profileView",e)},Yc.isProfileViewDetailed=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#profileViewDetailed"===e.$type},Yc.validateProfileViewDetailed=function(e){return tl.lexicons.validate("app.bsky.actor.defs#profileViewDetailed",e)},Yc.isProfileAssociated=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#profileAssociated"===e.$type},Yc.validateProfileAssociated=function(e){return tl.lexicons.validate("app.bsky.actor.defs#profileAssociated",e)},Yc.isProfileAssociatedChat=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#profileAssociatedChat"===e.$type},Yc.validateProfileAssociatedChat=function(e){return tl.lexicons.validate("app.bsky.actor.defs#profileAssociatedChat",e)},Yc.isViewerState=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#viewerState"===e.$type},Yc.validateViewerState=function(e){return tl.lexicons.validate("app.bsky.actor.defs#viewerState",e)},Yc.isKnownFollowers=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#knownFollowers"===e.$type},Yc.validateKnownFollowers=function(e){return tl.lexicons.validate("app.bsky.actor.defs#knownFollowers",e)},Yc.isAdultContentPref=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#adultContentPref"===e.$type},Yc.validateAdultContentPref=function(e){return tl.lexicons.validate("app.bsky.actor.defs#adultContentPref",e)},Yc.isContentLabelPref=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#contentLabelPref"===e.$type},Yc.validateContentLabelPref=function(e){return tl.lexicons.validate("app.bsky.actor.defs#contentLabelPref",e)},Yc.isSavedFeed=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#savedFeed"===e.$type},Yc.validateSavedFeed=function(e){return tl.lexicons.validate("app.bsky.actor.defs#savedFeed",e)},Yc.isSavedFeedsPrefV2=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#savedFeedsPrefV2"===e.$type},Yc.validateSavedFeedsPrefV2=function(e){return tl.lexicons.validate("app.bsky.actor.defs#savedFeedsPrefV2",e)},Yc.isSavedFeedsPref=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#savedFeedsPref"===e.$type},Yc.validateSavedFeedsPref=function(e){return tl.lexicons.validate("app.bsky.actor.defs#savedFeedsPref",e)},Yc.isPersonalDetailsPref=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#personalDetailsPref"===e.$type},Yc.validatePersonalDetailsPref=function(e){return tl.lexicons.validate("app.bsky.actor.defs#personalDetailsPref",e)},Yc.isFeedViewPref=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#feedViewPref"===e.$type},Yc.validateFeedViewPref=function(e){return tl.lexicons.validate("app.bsky.actor.defs#feedViewPref",e)},Yc.isThreadViewPref=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#threadViewPref"===e.$type},Yc.validateThreadViewPref=function(e){return tl.lexicons.validate("app.bsky.actor.defs#threadViewPref",e)},Yc.isInterestsPref=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#interestsPref"===e.$type},Yc.validateInterestsPref=function(e){return tl.lexicons.validate("app.bsky.actor.defs#interestsPref",e)},Yc.isMutedWord=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#mutedWord"===e.$type},Yc.validateMutedWord=function(e){return tl.lexicons.validate("app.bsky.actor.defs#mutedWord",e)},Yc.isMutedWordsPref=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#mutedWordsPref"===e.$type},Yc.validateMutedWordsPref=function(e){return tl.lexicons.validate("app.bsky.actor.defs#mutedWordsPref",e)},Yc.isHiddenPostsPref=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#hiddenPostsPref"===e.$type},Yc.validateHiddenPostsPref=function(e){return tl.lexicons.validate("app.bsky.actor.defs#hiddenPostsPref",e)},Yc.isLabelersPref=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#labelersPref"===e.$type},Yc.validateLabelersPref=function(e){return tl.lexicons.validate("app.bsky.actor.defs#labelersPref",e)},Yc.isLabelerPrefItem=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#labelerPrefItem"===e.$type},Yc.validateLabelerPrefItem=function(e){return tl.lexicons.validate("app.bsky.actor.defs#labelerPrefItem",e)},Yc.isBskyAppStatePref=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#bskyAppStatePref"===e.$type},Yc.validateBskyAppStatePref=function(e){return tl.lexicons.validate("app.bsky.actor.defs#bskyAppStatePref",e)},Yc.isBskyAppProgressGuide=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#bskyAppProgressGuide"===e.$type},Yc.validateBskyAppProgressGuide=function(e){return tl.lexicons.validate("app.bsky.actor.defs#bskyAppProgressGuide",e)},Yc.isNux=function(e){return(0,el.isObj)(e)&&(0,el.hasProp)(e,"$type")&&"app.bsky.actor.defs#nux"===e.$type},Yc.validateNux=function(e){return tl.lexicons.validate("app.bsky.actor.defs#nux",e)};const el=lo,tl=Dn;var rl={};Object.defineProperty(rl,"__esModule",{value:!0}),rl.toKnownErr=function(e){return e};var nl={};Object.defineProperty(nl,"__esModule",{value:!0}),nl.toKnownErr=function(e){return e};var ol={};Object.defineProperty(ol,"__esModule",{value:!0}),ol.toKnownErr=function(e){return e};var il={};Object.defineProperty(il,"__esModule",{value:!0}),il.toKnownErr=function(e){return e};var sl={};Object.defineProperty(sl,"__esModule",{value:!0}),sl.isRecord=function(e){return(0,al.isObj)(e)&&(0,al.hasProp)(e,"$type")&&("app.bsky.actor.profile#main"===e.$type||"app.bsky.actor.profile"===e.$type)},sl.validateRecord=function(e){return cl.lexicons.validate("app.bsky.actor.profile#main",e)};const al=lo,cl=Dn;var ll={};Object.defineProperty(ll,"__esModule",{value:!0}),ll.toKnownErr=function(e){return e};var dl={};Object.defineProperty(dl,"__esModule",{value:!0}),dl.toKnownErr=function(e){return e};var ul={};Object.defineProperty(ul,"__esModule",{value:!0}),ul.toKnownErr=function(e){return e};var pl={};Object.defineProperty(pl,"__esModule",{value:!0}),pl.isAspectRatio=function(e){return(0,fl.isObj)(e)&&(0,fl.hasProp)(e,"$type")&&"app.bsky.embed.defs#aspectRatio"===e.$type},pl.validateAspectRatio=function(e){return hl.lexicons.validate("app.bsky.embed.defs#aspectRatio",e)};const fl=lo,hl=Dn;var yl={};Object.defineProperty(yl,"__esModule",{value:!0}),yl.isMain=function(e){return(0,ml.isObj)(e)&&(0,ml.hasProp)(e,"$type")&&("app.bsky.embed.external#main"===e.$type||"app.bsky.embed.external"===e.$type)},yl.validateMain=function(e){return bl.lexicons.validate("app.bsky.embed.external#main",e)},yl.isExternal=function(e){return(0,ml.isObj)(e)&&(0,ml.hasProp)(e,"$type")&&"app.bsky.embed.external#external"===e.$type},yl.validateExternal=function(e){return bl.lexicons.validate("app.bsky.embed.external#external",e)},yl.isView=function(e){return(0,ml.isObj)(e)&&(0,ml.hasProp)(e,"$type")&&"app.bsky.embed.external#view"===e.$type},yl.validateView=function(e){return bl.lexicons.validate("app.bsky.embed.external#view",e)},yl.isViewExternal=function(e){return(0,ml.isObj)(e)&&(0,ml.hasProp)(e,"$type")&&"app.bsky.embed.external#viewExternal"===e.$type},yl.validateViewExternal=function(e){return bl.lexicons.validate("app.bsky.embed.external#viewExternal",e)};const ml=lo,bl=Dn;var gl={};Object.defineProperty(gl,"__esModule",{value:!0}),gl.isMain=function(e){return(0,vl.isObj)(e)&&(0,vl.hasProp)(e,"$type")&&("app.bsky.embed.images#main"===e.$type||"app.bsky.embed.images"===e.$type)},gl.validateMain=function(e){return El.lexicons.validate("app.bsky.embed.images#main",e)},gl.isImage=function(e){return(0,vl.isObj)(e)&&(0,vl.hasProp)(e,"$type")&&"app.bsky.embed.images#image"===e.$type},gl.validateImage=function(e){return El.lexicons.validate("app.bsky.embed.images#image",e)},gl.isView=function(e){return(0,vl.isObj)(e)&&(0,vl.hasProp)(e,"$type")&&"app.bsky.embed.images#view"===e.$type},gl.validateView=function(e){return El.lexicons.validate("app.bsky.embed.images#view",e)},gl.isViewImage=function(e){return(0,vl.isObj)(e)&&(0,vl.hasProp)(e,"$type")&&"app.bsky.embed.images#viewImage"===e.$type},gl.validateViewImage=function(e){return El.lexicons.validate("app.bsky.embed.images#viewImage",e)};const vl=lo,El=Dn;var wl={};Object.defineProperty(wl,"__esModule",{value:!0}),wl.isMain=function(e){return(0,Rl.isObj)(e)&&(0,Rl.hasProp)(e,"$type")&&("app.bsky.embed.record#main"===e.$type||"app.bsky.embed.record"===e.$type)},wl.validateMain=function(e){return Al.lexicons.validate("app.bsky.embed.record#main",e)},wl.isView=function(e){return(0,Rl.isObj)(e)&&(0,Rl.hasProp)(e,"$type")&&"app.bsky.embed.record#view"===e.$type},wl.validateView=function(e){return Al.lexicons.validate("app.bsky.embed.record#view",e)},wl.isViewRecord=function(e){return(0,Rl.isObj)(e)&&(0,Rl.hasProp)(e,"$type")&&"app.bsky.embed.record#viewRecord"===e.$type},wl.validateViewRecord=function(e){return Al.lexicons.validate("app.bsky.embed.record#viewRecord",e)},wl.isViewNotFound=function(e){return(0,Rl.isObj)(e)&&(0,Rl.hasProp)(e,"$type")&&"app.bsky.embed.record#viewNotFound"===e.$type},wl.validateViewNotFound=function(e){return Al.lexicons.validate("app.bsky.embed.record#viewNotFound",e)},wl.isViewBlocked=function(e){return(0,Rl.isObj)(e)&&(0,Rl.hasProp)(e,"$type")&&"app.bsky.embed.record#viewBlocked"===e.$type},wl.validateViewBlocked=function(e){return Al.lexicons.validate("app.bsky.embed.record#viewBlocked",e)},wl.isViewDetached=function(e){return(0,Rl.isObj)(e)&&(0,Rl.hasProp)(e,"$type")&&"app.bsky.embed.record#viewDetached"===e.$type},wl.validateViewDetached=function(e){return Al.lexicons.validate("app.bsky.embed.record#viewDetached",e)};const Rl=lo,Al=Dn;var _l={};Object.defineProperty(_l,"__esModule",{value:!0}),_l.isMain=function(e){return(0,Sl.isObj)(e)&&(0,Sl.hasProp)(e,"$type")&&("app.bsky.embed.recordWithMedia#main"===e.$type||"app.bsky.embed.recordWithMedia"===e.$type)},_l.validateMain=function(e){return kl.lexicons.validate("app.bsky.embed.recordWithMedia#main",e)},_l.isView=function(e){return(0,Sl.isObj)(e)&&(0,Sl.hasProp)(e,"$type")&&"app.bsky.embed.recordWithMedia#view"===e.$type},_l.validateView=function(e){return kl.lexicons.validate("app.bsky.embed.recordWithMedia#view",e)};const Sl=lo,kl=Dn;var Tl={};Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.isMain=function(e){return(0,Cl.isObj)(e)&&(0,Cl.hasProp)(e,"$type")&&("app.bsky.embed.video#main"===e.$type||"app.bsky.embed.video"===e.$type)},Tl.validateMain=function(e){return Ll.lexicons.validate("app.bsky.embed.video#main",e)},Tl.isCaption=function(e){return(0,Cl.isObj)(e)&&(0,Cl.hasProp)(e,"$type")&&"app.bsky.embed.video#caption"===e.$type},Tl.validateCaption=function(e){return Ll.lexicons.validate("app.bsky.embed.video#caption",e)},Tl.isView=function(e){return(0,Cl.isObj)(e)&&(0,Cl.hasProp)(e,"$type")&&"app.bsky.embed.video#view"===e.$type},Tl.validateView=function(e){return Ll.lexicons.validate("app.bsky.embed.video#view",e)};const Cl=lo,Ll=Dn;var Pl={};Object.defineProperty(Pl,"__esModule",{value:!0}),Pl.INTERACTIONSHARE=Pl.INTERACTIONQUOTE=Pl.INTERACTIONREPLY=Pl.INTERACTIONREPOST=Pl.INTERACTIONLIKE=Pl.INTERACTIONSEEN=Pl.CLICKTHROUGHEMBED=Pl.CLICKTHROUGHREPOSTER=Pl.CLICKTHROUGHAUTHOR=Pl.CLICKTHROUGHITEM=Pl.REQUESTMORE=Pl.REQUESTLESS=void 0,Pl.isPostView=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#postView"===e.$type},Pl.validatePostView=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#postView",e)},Pl.isViewerState=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#viewerState"===e.$type},Pl.validateViewerState=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#viewerState",e)},Pl.isFeedViewPost=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#feedViewPost"===e.$type},Pl.validateFeedViewPost=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#feedViewPost",e)},Pl.isReplyRef=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#replyRef"===e.$type},Pl.validateReplyRef=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#replyRef",e)},Pl.isReasonRepost=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#reasonRepost"===e.$type},Pl.validateReasonRepost=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#reasonRepost",e)},Pl.isReasonPin=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#reasonPin"===e.$type},Pl.validateReasonPin=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#reasonPin",e)},Pl.isThreadViewPost=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#threadViewPost"===e.$type},Pl.validateThreadViewPost=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#threadViewPost",e)},Pl.isNotFoundPost=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#notFoundPost"===e.$type},Pl.validateNotFoundPost=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#notFoundPost",e)},Pl.isBlockedPost=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#blockedPost"===e.$type},Pl.validateBlockedPost=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#blockedPost",e)},Pl.isBlockedAuthor=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#blockedAuthor"===e.$type},Pl.validateBlockedAuthor=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#blockedAuthor",e)},Pl.isGeneratorView=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#generatorView"===e.$type},Pl.validateGeneratorView=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#generatorView",e)},Pl.isGeneratorViewerState=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#generatorViewerState"===e.$type},Pl.validateGeneratorViewerState=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#generatorViewerState",e)},Pl.isSkeletonFeedPost=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#skeletonFeedPost"===e.$type},Pl.validateSkeletonFeedPost=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#skeletonFeedPost",e)},Pl.isSkeletonReasonRepost=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#skeletonReasonRepost"===e.$type},Pl.validateSkeletonReasonRepost=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#skeletonReasonRepost",e)},Pl.isSkeletonReasonPin=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#skeletonReasonPin"===e.$type},Pl.validateSkeletonReasonPin=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#skeletonReasonPin",e)},Pl.isThreadgateView=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#threadgateView"===e.$type},Pl.validateThreadgateView=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#threadgateView",e)},Pl.isInteraction=function(e){return(0,xl.isObj)(e)&&(0,xl.hasProp)(e,"$type")&&"app.bsky.feed.defs#interaction"===e.$type},Pl.validateInteraction=function(e){return Bl.lexicons.validate("app.bsky.feed.defs#interaction",e)};const xl=lo,Bl=Dn;Pl.REQUESTLESS="app.bsky.feed.defs#requestLess",Pl.REQUESTMORE="app.bsky.feed.defs#requestMore",Pl.CLICKTHROUGHITEM="app.bsky.feed.defs#clickthroughItem",Pl.CLICKTHROUGHAUTHOR="app.bsky.feed.defs#clickthroughAuthor",Pl.CLICKTHROUGHREPOSTER="app.bsky.feed.defs#clickthroughReposter",Pl.CLICKTHROUGHEMBED="app.bsky.feed.defs#clickthroughEmbed",Pl.INTERACTIONSEEN="app.bsky.feed.defs#interactionSeen",Pl.INTERACTIONLIKE="app.bsky.feed.defs#interactionLike",Pl.INTERACTIONREPOST="app.bsky.feed.defs#interactionRepost",Pl.INTERACTIONREPLY="app.bsky.feed.defs#interactionReply",Pl.INTERACTIONQUOTE="app.bsky.feed.defs#interactionQuote",Pl.INTERACTIONSHARE="app.bsky.feed.defs#interactionShare";var jl={};Object.defineProperty(jl,"__esModule",{value:!0}),jl.toKnownErr=function(e){return e},jl.isFeed=function(e){return(0,Dl.isObj)(e)&&(0,Dl.hasProp)(e,"$type")&&"app.bsky.feed.describeFeedGenerator#feed"===e.$type},jl.validateFeed=function(e){return Ol.lexicons.validate("app.bsky.feed.describeFeedGenerator#feed",e)},jl.isLinks=function(e){return(0,Dl.isObj)(e)&&(0,Dl.hasProp)(e,"$type")&&"app.bsky.feed.describeFeedGenerator#links"===e.$type},jl.validateLinks=function(e){return Ol.lexicons.validate("app.bsky.feed.describeFeedGenerator#links",e)};const Dl=lo,Ol=Dn;var Ul={};Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.isRecord=function(e){return(0,Il.isObj)(e)&&(0,Il.hasProp)(e,"$type")&&("app.bsky.feed.generator#main"===e.$type||"app.bsky.feed.generator"===e.$type)},Ul.validateRecord=function(e){return Kl.lexicons.validate("app.bsky.feed.generator#main",e)};const Il=lo,Kl=Dn;var Ml={};Object.defineProperty(Ml,"__esModule",{value:!0}),Ml.toKnownErr=function(e){return e};var Vl={};Object.defineProperty(Vl,"__esModule",{value:!0}),Vl.toKnownErr=function(e){return e};var Nl={};Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.toKnownErr=function(e){return e};var zl={};Object.defineProperty(zl,"__esModule",{value:!0}),zl.toKnownErr=function(e){return e},zl.isLike=function(e){return(0,Fl.isObj)(e)&&(0,Fl.hasProp)(e,"$type")&&"app.bsky.feed.getLikes#like"===e.$type},zl.validateLike=function(e){return ql.lexicons.validate("app.bsky.feed.getLikes#like",e)};const Fl=lo,ql=Dn;var $l={};Object.defineProperty($l,"__esModule",{value:!0}),$l.toKnownErr=function(e){return e};var Gl={};Object.defineProperty(Gl,"__esModule",{value:!0}),Gl.toKnownErr=function(e){return e};var Hl={};Object.defineProperty(Hl,"__esModule",{value:!0}),Hl.toKnownErr=function(e){return e};var Xl={};Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.toKnownErr=function(e){return e};var Wl={};Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.toKnownErr=function(e){return e};var Zl={};Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.isRecord=function(e){return(0,Jl.isObj)(e)&&(0,Jl.hasProp)(e,"$type")&&("app.bsky.feed.like#main"===e.$type||"app.bsky.feed.like"===e.$type)},Zl.validateRecord=function(e){return Ql.lexicons.validate("app.bsky.feed.like#main",e)};const Jl=lo,Ql=Dn;var Yl={};Object.defineProperty(Yl,"__esModule",{value:!0}),Yl.isRecord=function(e){return(0,ed.isObj)(e)&&(0,ed.hasProp)(e,"$type")&&("app.bsky.feed.post#main"===e.$type||"app.bsky.feed.post"===e.$type)},Yl.validateRecord=function(e){return td.lexicons.validate("app.bsky.feed.post#main",e)},Yl.isReplyRef=function(e){return(0,ed.isObj)(e)&&(0,ed.hasProp)(e,"$type")&&"app.bsky.feed.post#replyRef"===e.$type},Yl.validateReplyRef=function(e){return td.lexicons.validate("app.bsky.feed.post#replyRef",e)},Yl.isEntity=function(e){return(0,ed.isObj)(e)&&(0,ed.hasProp)(e,"$type")&&"app.bsky.feed.post#entity"===e.$type},Yl.validateEntity=function(e){return td.lexicons.validate("app.bsky.feed.post#entity",e)},Yl.isTextSlice=function(e){return(0,ed.isObj)(e)&&(0,ed.hasProp)(e,"$type")&&"app.bsky.feed.post#textSlice"===e.$type},Yl.validateTextSlice=function(e){return td.lexicons.validate("app.bsky.feed.post#textSlice",e)};const ed=lo,td=Dn;var rd={};Object.defineProperty(rd,"__esModule",{value:!0}),rd.isRecord=function(e){return(0,nd.isObj)(e)&&(0,nd.hasProp)(e,"$type")&&("app.bsky.feed.postgate#main"===e.$type||"app.bsky.feed.postgate"===e.$type)},rd.validateRecord=function(e){return od.lexicons.validate("app.bsky.feed.postgate#main",e)},rd.isDisableRule=function(e){return(0,nd.isObj)(e)&&(0,nd.hasProp)(e,"$type")&&"app.bsky.feed.postgate#disableRule"===e.$type},rd.validateDisableRule=function(e){return od.lexicons.validate("app.bsky.feed.postgate#disableRule",e)};const nd=lo,od=Dn;var id={};Object.defineProperty(id,"__esModule",{value:!0}),id.isRecord=function(e){return(0,sd.isObj)(e)&&(0,sd.hasProp)(e,"$type")&&("app.bsky.feed.repost#main"===e.$type||"app.bsky.feed.repost"===e.$type)},id.validateRecord=function(e){return ad.lexicons.validate("app.bsky.feed.repost#main",e)};const sd=lo,ad=Dn;var cd={};Object.defineProperty(cd,"__esModule",{value:!0}),cd.toKnownErr=function(e){return e};var ld={};Object.defineProperty(ld,"__esModule",{value:!0}),ld.isRecord=function(e){return(0,dd.isObj)(e)&&(0,dd.hasProp)(e,"$type")&&("app.bsky.feed.threadgate#main"===e.$type||"app.bsky.feed.threadgate"===e.$type)},ld.validateRecord=function(e){return ud.lexicons.validate("app.bsky.feed.threadgate#main",e)},ld.isMentionRule=function(e){return(0,dd.isObj)(e)&&(0,dd.hasProp)(e,"$type")&&"app.bsky.feed.threadgate#mentionRule"===e.$type},ld.validateMentionRule=function(e){return ud.lexicons.validate("app.bsky.feed.threadgate#mentionRule",e)},ld.isFollowingRule=function(e){return(0,dd.isObj)(e)&&(0,dd.hasProp)(e,"$type")&&"app.bsky.feed.threadgate#followingRule"===e.$type},ld.validateFollowingRule=function(e){return ud.lexicons.validate("app.bsky.feed.threadgate#followingRule",e)},ld.isListRule=function(e){return(0,dd.isObj)(e)&&(0,dd.hasProp)(e,"$type")&&"app.bsky.feed.threadgate#listRule"===e.$type},ld.validateListRule=function(e){return ud.lexicons.validate("app.bsky.feed.threadgate#listRule",e)};const dd=lo,ud=Dn;var pd={};Object.defineProperty(pd,"__esModule",{value:!0}),pd.isRecord=function(e){return(0,fd.isObj)(e)&&(0,fd.hasProp)(e,"$type")&&("app.bsky.graph.block#main"===e.$type||"app.bsky.graph.block"===e.$type)},pd.validateRecord=function(e){return hd.lexicons.validate("app.bsky.graph.block#main",e)};const fd=lo,hd=Dn;var yd={};Object.defineProperty(yd,"__esModule",{value:!0}),yd.REFERENCELIST=yd.CURATELIST=yd.MODLIST=void 0,yd.isListViewBasic=function(e){return(0,md.isObj)(e)&&(0,md.hasProp)(e,"$type")&&"app.bsky.graph.defs#listViewBasic"===e.$type},yd.validateListViewBasic=function(e){return bd.lexicons.validate("app.bsky.graph.defs#listViewBasic",e)},yd.isListView=function(e){return(0,md.isObj)(e)&&(0,md.hasProp)(e,"$type")&&"app.bsky.graph.defs#listView"===e.$type},yd.validateListView=function(e){return bd.lexicons.validate("app.bsky.graph.defs#listView",e)},yd.isListItemView=function(e){return(0,md.isObj)(e)&&(0,md.hasProp)(e,"$type")&&"app.bsky.graph.defs#listItemView"===e.$type},yd.validateListItemView=function(e){return bd.lexicons.validate("app.bsky.graph.defs#listItemView",e)},yd.isStarterPackView=function(e){return(0,md.isObj)(e)&&(0,md.hasProp)(e,"$type")&&"app.bsky.graph.defs#starterPackView"===e.$type},yd.validateStarterPackView=function(e){return bd.lexicons.validate("app.bsky.graph.defs#starterPackView",e)},yd.isStarterPackViewBasic=function(e){return(0,md.isObj)(e)&&(0,md.hasProp)(e,"$type")&&"app.bsky.graph.defs#starterPackViewBasic"===e.$type},yd.validateStarterPackViewBasic=function(e){return bd.lexicons.validate("app.bsky.graph.defs#starterPackViewBasic",e)},yd.isListViewerState=function(e){return(0,md.isObj)(e)&&(0,md.hasProp)(e,"$type")&&"app.bsky.graph.defs#listViewerState"===e.$type},yd.validateListViewerState=function(e){return bd.lexicons.validate("app.bsky.graph.defs#listViewerState",e)},yd.isNotFoundActor=function(e){return(0,md.isObj)(e)&&(0,md.hasProp)(e,"$type")&&"app.bsky.graph.defs#notFoundActor"===e.$type},yd.validateNotFoundActor=function(e){return bd.lexicons.validate("app.bsky.graph.defs#notFoundActor",e)},yd.isRelationship=function(e){return(0,md.isObj)(e)&&(0,md.hasProp)(e,"$type")&&"app.bsky.graph.defs#relationship"===e.$type},yd.validateRelationship=function(e){return bd.lexicons.validate("app.bsky.graph.defs#relationship",e)};const md=lo,bd=Dn;yd.MODLIST="app.bsky.graph.defs#modlist",yd.CURATELIST="app.bsky.graph.defs#curatelist",yd.REFERENCELIST="app.bsky.graph.defs#referencelist";var gd={};Object.defineProperty(gd,"__esModule",{value:!0}),gd.isRecord=function(e){return(0,vd.isObj)(e)&&(0,vd.hasProp)(e,"$type")&&("app.bsky.graph.follow#main"===e.$type||"app.bsky.graph.follow"===e.$type)},gd.validateRecord=function(e){return Ed.lexicons.validate("app.bsky.graph.follow#main",e)};const vd=lo,Ed=Dn;var wd={};Object.defineProperty(wd,"__esModule",{value:!0}),wd.toKnownErr=function(e){return e};var Rd={};Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.toKnownErr=function(e){return e};var Ad={};Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.toKnownErr=function(e){return e};var _d={};Object.defineProperty(_d,"__esModule",{value:!0}),_d.toKnownErr=function(e){return e};var Sd={};Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.toKnownErr=function(e){return e};var kd={};Object.defineProperty(kd,"__esModule",{value:!0}),kd.toKnownErr=function(e){return e};var Td={};Object.defineProperty(Td,"__esModule",{value:!0}),Td.toKnownErr=function(e){return e};var Cd={};Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.toKnownErr=function(e){return e};var Ld={};Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.toKnownErr=function(e){return e};var Pd={};Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.toKnownErr=function(e){return e};var xd={};Object.defineProperty(xd,"__esModule",{value:!0}),xd.toKnownErr=function(e){return e};var Bd={};Object.defineProperty(Bd,"__esModule",{value:!0}),Bd.toKnownErr=function(e){return e};var jd={};Object.defineProperty(jd,"__esModule",{value:!0}),jd.toKnownErr=function(e){return e};var Dd={};Object.defineProperty(Dd,"__esModule",{value:!0}),Dd.isRecord=function(e){return(0,Od.isObj)(e)&&(0,Od.hasProp)(e,"$type")&&("app.bsky.graph.list#main"===e.$type||"app.bsky.graph.list"===e.$type)},Dd.validateRecord=function(e){return Ud.lexicons.validate("app.bsky.graph.list#main",e)};const Od=lo,Ud=Dn;var Id={};Object.defineProperty(Id,"__esModule",{value:!0}),Id.isRecord=function(e){return(0,Kd.isObj)(e)&&(0,Kd.hasProp)(e,"$type")&&("app.bsky.graph.listblock#main"===e.$type||"app.bsky.graph.listblock"===e.$type)},Id.validateRecord=function(e){return Md.lexicons.validate("app.bsky.graph.listblock#main",e)};const Kd=lo,Md=Dn;var Vd={};Object.defineProperty(Vd,"__esModule",{value:!0}),Vd.isRecord=function(e){return(0,Nd.isObj)(e)&&(0,Nd.hasProp)(e,"$type")&&("app.bsky.graph.listitem#main"===e.$type||"app.bsky.graph.listitem"===e.$type)},Vd.validateRecord=function(e){return zd.lexicons.validate("app.bsky.graph.listitem#main",e)};const Nd=lo,zd=Dn;var Fd={};Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.toKnownErr=function(e){return e};var qd={};Object.defineProperty(qd,"__esModule",{value:!0}),qd.toKnownErr=function(e){return e};var $d={};Object.defineProperty($d,"__esModule",{value:!0}),$d.toKnownErr=function(e){return e};var Gd={};Object.defineProperty(Gd,"__esModule",{value:!0}),Gd.isRecord=function(e){return(0,Hd.isObj)(e)&&(0,Hd.hasProp)(e,"$type")&&("app.bsky.graph.starterpack#main"===e.$type||"app.bsky.graph.starterpack"===e.$type)},Gd.validateRecord=function(e){return Xd.lexicons.validate("app.bsky.graph.starterpack#main",e)},Gd.isFeedItem=function(e){return(0,Hd.isObj)(e)&&(0,Hd.hasProp)(e,"$type")&&"app.bsky.graph.starterpack#feedItem"===e.$type},Gd.validateFeedItem=function(e){return Xd.lexicons.validate("app.bsky.graph.starterpack#feedItem",e)};const Hd=lo,Xd=Dn;var Wd={};Object.defineProperty(Wd,"__esModule",{value:!0}),Wd.toKnownErr=function(e){return e};var Zd={};Object.defineProperty(Zd,"__esModule",{value:!0}),Zd.toKnownErr=function(e){return e};var Jd={};Object.defineProperty(Jd,"__esModule",{value:!0}),Jd.toKnownErr=function(e){return e};var Qd={};Object.defineProperty(Qd,"__esModule",{value:!0}),Qd.isLabelerView=function(e){return(0,Yd.isObj)(e)&&(0,Yd.hasProp)(e,"$type")&&"app.bsky.labeler.defs#labelerView"===e.$type},Qd.validateLabelerView=function(e){return eu.lexicons.validate("app.bsky.labeler.defs#labelerView",e)},Qd.isLabelerViewDetailed=function(e){return(0,Yd.isObj)(e)&&(0,Yd.hasProp)(e,"$type")&&"app.bsky.labeler.defs#labelerViewDetailed"===e.$type},Qd.validateLabelerViewDetailed=function(e){return eu.lexicons.validate("app.bsky.labeler.defs#labelerViewDetailed",e)},Qd.isLabelerViewerState=function(e){return(0,Yd.isObj)(e)&&(0,Yd.hasProp)(e,"$type")&&"app.bsky.labeler.defs#labelerViewerState"===e.$type},Qd.validateLabelerViewerState=function(e){return eu.lexicons.validate("app.bsky.labeler.defs#labelerViewerState",e)},Qd.isLabelerPolicies=function(e){return(0,Yd.isObj)(e)&&(0,Yd.hasProp)(e,"$type")&&"app.bsky.labeler.defs#labelerPolicies"===e.$type},Qd.validateLabelerPolicies=function(e){return eu.lexicons.validate("app.bsky.labeler.defs#labelerPolicies",e)};const Yd=lo,eu=Dn;var tu={};Object.defineProperty(tu,"__esModule",{value:!0}),tu.toKnownErr=function(e){return e};var ru={};Object.defineProperty(ru,"__esModule",{value:!0}),ru.isRecord=function(e){return(0,nu.isObj)(e)&&(0,nu.hasProp)(e,"$type")&&("app.bsky.labeler.service#main"===e.$type||"app.bsky.labeler.service"===e.$type)},ru.validateRecord=function(e){return ou.lexicons.validate("app.bsky.labeler.service#main",e)};const nu=lo,ou=Dn;var iu={};Object.defineProperty(iu,"__esModule",{value:!0}),iu.toKnownErr=function(e){return e};var su={};Object.defineProperty(su,"__esModule",{value:!0}),su.toKnownErr=function(e){return e},su.isNotification=function(e){return(0,au.isObj)(e)&&(0,au.hasProp)(e,"$type")&&"app.bsky.notification.listNotifications#notification"===e.$type},su.validateNotification=function(e){return cu.lexicons.validate("app.bsky.notification.listNotifications#notification",e)};const au=lo,cu=Dn;var lu={};Object.defineProperty(lu,"__esModule",{value:!0}),lu.toKnownErr=function(e){return e};var du={};Object.defineProperty(du,"__esModule",{value:!0}),du.toKnownErr=function(e){return e};var uu={};Object.defineProperty(uu,"__esModule",{value:!0}),uu.toKnownErr=function(e){return e};var pu={};Object.defineProperty(pu,"__esModule",{value:!0}),pu.isMain=function(e){return(0,fu.isObj)(e)&&(0,fu.hasProp)(e,"$type")&&("app.bsky.richtext.facet#main"===e.$type||"app.bsky.richtext.facet"===e.$type)},pu.validateMain=function(e){return hu.lexicons.validate("app.bsky.richtext.facet#main",e)},pu.isMention=function(e){return(0,fu.isObj)(e)&&(0,fu.hasProp)(e,"$type")&&"app.bsky.richtext.facet#mention"===e.$type},pu.validateMention=function(e){return hu.lexicons.validate("app.bsky.richtext.facet#mention",e)},pu.isLink=function(e){return(0,fu.isObj)(e)&&(0,fu.hasProp)(e,"$type")&&"app.bsky.richtext.facet#link"===e.$type},pu.validateLink=function(e){return hu.lexicons.validate("app.bsky.richtext.facet#link",e)},pu.isTag=function(e){return(0,fu.isObj)(e)&&(0,fu.hasProp)(e,"$type")&&"app.bsky.richtext.facet#tag"===e.$type},pu.validateTag=function(e){return hu.lexicons.validate("app.bsky.richtext.facet#tag",e)},pu.isByteSlice=function(e){return(0,fu.isObj)(e)&&(0,fu.hasProp)(e,"$type")&&"app.bsky.richtext.facet#byteSlice"===e.$type},pu.validateByteSlice=function(e){return hu.lexicons.validate("app.bsky.richtext.facet#byteSlice",e)};const fu=lo,hu=Dn;var yu={};Object.defineProperty(yu,"__esModule",{value:!0}),yu.isSkeletonSearchPost=function(e){return(0,mu.isObj)(e)&&(0,mu.hasProp)(e,"$type")&&"app.bsky.unspecced.defs#skeletonSearchPost"===e.$type},yu.validateSkeletonSearchPost=function(e){return bu.lexicons.validate("app.bsky.unspecced.defs#skeletonSearchPost",e)},yu.isSkeletonSearchActor=function(e){return(0,mu.isObj)(e)&&(0,mu.hasProp)(e,"$type")&&"app.bsky.unspecced.defs#skeletonSearchActor"===e.$type},yu.validateSkeletonSearchActor=function(e){return bu.lexicons.validate("app.bsky.unspecced.defs#skeletonSearchActor",e)};const mu=lo,bu=Dn;var gu={};Object.defineProperty(gu,"__esModule",{value:!0}),gu.toKnownErr=function(e){return e};var vu={};Object.defineProperty(vu,"__esModule",{value:!0}),vu.toKnownErr=function(e){return e};var Eu={};Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.toKnownErr=function(e){return e},Eu.isSuggestion=function(e){return(0,wu.isObj)(e)&&(0,wu.hasProp)(e,"$type")&&"app.bsky.unspecced.getTaggedSuggestions#suggestion"===e.$type},Eu.validateSuggestion=function(e){return Ru.lexicons.validate("app.bsky.unspecced.getTaggedSuggestions#suggestion",e)};const wu=lo,Ru=Dn;var Au={};Object.defineProperty(Au,"__esModule",{value:!0}),Au.isJobStatus=function(e){return(0,_u.isObj)(e)&&(0,_u.hasProp)(e,"$type")&&"app.bsky.video.defs#jobStatus"===e.$type},Au.validateJobStatus=function(e){return Su.lexicons.validate("app.bsky.video.defs#jobStatus",e)};const _u=lo,Su=Dn;var ku={};Object.defineProperty(ku,"__esModule",{value:!0}),ku.toKnownErr=function(e){return e};var Tu={};Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.toKnownErr=function(e){return e};var Cu={};Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.toKnownErr=function(e){return e};var Lu={};Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.isRecord=function(e){return(0,Pu.isObj)(e)&&(0,Pu.hasProp)(e,"$type")&&("chat.bsky.actor.declaration#main"===e.$type||"chat.bsky.actor.declaration"===e.$type)},Lu.validateRecord=function(e){return xu.lexicons.validate("chat.bsky.actor.declaration#main",e)};const Pu=lo,xu=Dn;var Bu={};Object.defineProperty(Bu,"__esModule",{value:!0}),Bu.isProfileViewBasic=function(e){return(0,ju.isObj)(e)&&(0,ju.hasProp)(e,"$type")&&"chat.bsky.actor.defs#profileViewBasic"===e.$type},Bu.validateProfileViewBasic=function(e){return Du.lexicons.validate("chat.bsky.actor.defs#profileViewBasic",e)};const ju=lo,Du=Dn;var Ou={};Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.toKnownErr=function(e){return e};var Uu={};Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.toKnownErr=function(e){return e};var Iu={};Object.defineProperty(Iu,"__esModule",{value:!0}),Iu.isMessageRef=function(e){return(0,Ku.isObj)(e)&&(0,Ku.hasProp)(e,"$type")&&"chat.bsky.convo.defs#messageRef"===e.$type},Iu.validateMessageRef=function(e){return Mu.lexicons.validate("chat.bsky.convo.defs#messageRef",e)},Iu.isMessageInput=function(e){return(0,Ku.isObj)(e)&&(0,Ku.hasProp)(e,"$type")&&"chat.bsky.convo.defs#messageInput"===e.$type},Iu.validateMessageInput=function(e){return Mu.lexicons.validate("chat.bsky.convo.defs#messageInput",e)},Iu.isMessageView=function(e){return(0,Ku.isObj)(e)&&(0,Ku.hasProp)(e,"$type")&&"chat.bsky.convo.defs#messageView"===e.$type},Iu.validateMessageView=function(e){return Mu.lexicons.validate("chat.bsky.convo.defs#messageView",e)},Iu.isDeletedMessageView=function(e){return(0,Ku.isObj)(e)&&(0,Ku.hasProp)(e,"$type")&&"chat.bsky.convo.defs#deletedMessageView"===e.$type},Iu.validateDeletedMessageView=function(e){return Mu.lexicons.validate("chat.bsky.convo.defs#deletedMessageView",e)},Iu.isMessageViewSender=function(e){return(0,Ku.isObj)(e)&&(0,Ku.hasProp)(e,"$type")&&"chat.bsky.convo.defs#messageViewSender"===e.$type},Iu.validateMessageViewSender=function(e){return Mu.lexicons.validate("chat.bsky.convo.defs#messageViewSender",e)},Iu.isConvoView=function(e){return(0,Ku.isObj)(e)&&(0,Ku.hasProp)(e,"$type")&&"chat.bsky.convo.defs#convoView"===e.$type},Iu.validateConvoView=function(e){return Mu.lexicons.validate("chat.bsky.convo.defs#convoView",e)},Iu.isLogBeginConvo=function(e){return(0,Ku.isObj)(e)&&(0,Ku.hasProp)(e,"$type")&&"chat.bsky.convo.defs#logBeginConvo"===e.$type},Iu.validateLogBeginConvo=function(e){return Mu.lexicons.validate("chat.bsky.convo.defs#logBeginConvo",e)},Iu.isLogLeaveConvo=function(e){return(0,Ku.isObj)(e)&&(0,Ku.hasProp)(e,"$type")&&"chat.bsky.convo.defs#logLeaveConvo"===e.$type},Iu.validateLogLeaveConvo=function(e){return Mu.lexicons.validate("chat.bsky.convo.defs#logLeaveConvo",e)},Iu.isLogCreateMessage=function(e){return(0,Ku.isObj)(e)&&(0,Ku.hasProp)(e,"$type")&&"chat.bsky.convo.defs#logCreateMessage"===e.$type},Iu.validateLogCreateMessage=function(e){return Mu.lexicons.validate("chat.bsky.convo.defs#logCreateMessage",e)},Iu.isLogDeleteMessage=function(e){return(0,Ku.isObj)(e)&&(0,Ku.hasProp)(e,"$type")&&"chat.bsky.convo.defs#logDeleteMessage"===e.$type},Iu.validateLogDeleteMessage=function(e){return Mu.lexicons.validate("chat.bsky.convo.defs#logDeleteMessage",e)};const Ku=lo,Mu=Dn;var Vu={};Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.toKnownErr=function(e){return e};var Nu={};Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.toKnownErr=function(e){return e};var zu={};Object.defineProperty(zu,"__esModule",{value:!0}),zu.toKnownErr=function(e){return e};var Fu={};Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.toKnownErr=function(e){return e};var qu={};Object.defineProperty(qu,"__esModule",{value:!0}),qu.toKnownErr=function(e){return e};var $u={};Object.defineProperty($u,"__esModule",{value:!0}),$u.toKnownErr=function(e){return e};var Gu={};Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.toKnownErr=function(e){return e};var Hu={};Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.toKnownErr=function(e){return e};var Xu={};Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.toKnownErr=function(e){return e};var Wu={};Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.toKnownErr=function(e){return e},Wu.isBatchItem=function(e){return(0,Zu.isObj)(e)&&(0,Zu.hasProp)(e,"$type")&&"chat.bsky.convo.sendMessageBatch#batchItem"===e.$type},Wu.validateBatchItem=function(e){return Ju.lexicons.validate("chat.bsky.convo.sendMessageBatch#batchItem",e)};const Zu=lo,Ju=Dn;var Qu={};Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.toKnownErr=function(e){return e};var Yu={};Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.toKnownErr=function(e){return e};var ep={};Object.defineProperty(ep,"__esModule",{value:!0}),ep.toKnownErr=function(e){return e},ep.isMetadata=function(e){return(0,tp.isObj)(e)&&(0,tp.hasProp)(e,"$type")&&"chat.bsky.moderation.getActorMetadata#metadata"===e.$type},ep.validateMetadata=function(e){return rp.lexicons.validate("chat.bsky.moderation.getActorMetadata#metadata",e)};const tp=lo,rp=Dn;var np={};Object.defineProperty(np,"__esModule",{value:!0}),np.toKnownErr=function(e){return e};var op={};Object.defineProperty(op,"__esModule",{value:!0}),op.toKnownErr=function(e){return e};var ip={};Object.defineProperty(ip,"__esModule",{value:!0}),ip.isTemplateView=function(e){return(0,sp.isObj)(e)&&(0,sp.hasProp)(e,"$type")&&"tools.ozone.communication.defs#templateView"===e.$type},ip.validateTemplateView=function(e){return ap.lexicons.validate("tools.ozone.communication.defs#templateView",e)};const sp=lo,ap=Dn;var cp={};Object.defineProperty(cp,"__esModule",{value:!0}),cp.toKnownErr=function(e){return e};var lp={};Object.defineProperty(lp,"__esModule",{value:!0}),lp.toKnownErr=function(e){return e};var dp={};Object.defineProperty(dp,"__esModule",{value:!0}),dp.REVIEWNONE=dp.REVIEWCLOSED=dp.REVIEWESCALATED=dp.REVIEWOPEN=void 0,dp.isModEventView=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventView"===e.$type},dp.validateModEventView=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventView",e)},dp.isModEventViewDetail=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventViewDetail"===e.$type},dp.validateModEventViewDetail=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventViewDetail",e)},dp.isSubjectStatusView=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#subjectStatusView"===e.$type},dp.validateSubjectStatusView=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#subjectStatusView",e)},dp.isModEventTakedown=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventTakedown"===e.$type},dp.validateModEventTakedown=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventTakedown",e)},dp.isModEventReverseTakedown=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventReverseTakedown"===e.$type},dp.validateModEventReverseTakedown=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventReverseTakedown",e)},dp.isModEventResolveAppeal=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventResolveAppeal"===e.$type},dp.validateModEventResolveAppeal=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventResolveAppeal",e)},dp.isModEventComment=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventComment"===e.$type},dp.validateModEventComment=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventComment",e)},dp.isModEventReport=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventReport"===e.$type},dp.validateModEventReport=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventReport",e)},dp.isModEventLabel=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventLabel"===e.$type},dp.validateModEventLabel=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventLabel",e)},dp.isModEventAcknowledge=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventAcknowledge"===e.$type},dp.validateModEventAcknowledge=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventAcknowledge",e)},dp.isModEventEscalate=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventEscalate"===e.$type},dp.validateModEventEscalate=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventEscalate",e)},dp.isModEventMute=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventMute"===e.$type},dp.validateModEventMute=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventMute",e)},dp.isModEventUnmute=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventUnmute"===e.$type},dp.validateModEventUnmute=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventUnmute",e)},dp.isModEventMuteReporter=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventMuteReporter"===e.$type},dp.validateModEventMuteReporter=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventMuteReporter",e)},dp.isModEventUnmuteReporter=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventUnmuteReporter"===e.$type},dp.validateModEventUnmuteReporter=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventUnmuteReporter",e)},dp.isModEventEmail=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventEmail"===e.$type},dp.validateModEventEmail=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventEmail",e)},dp.isModEventDivert=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventDivert"===e.$type},dp.validateModEventDivert=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventDivert",e)},dp.isModEventTag=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#modEventTag"===e.$type},dp.validateModEventTag=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#modEventTag",e)},dp.isRepoView=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#repoView"===e.$type},dp.validateRepoView=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#repoView",e)},dp.isRepoViewDetail=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#repoViewDetail"===e.$type},dp.validateRepoViewDetail=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#repoViewDetail",e)},dp.isRepoViewNotFound=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#repoViewNotFound"===e.$type},dp.validateRepoViewNotFound=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#repoViewNotFound",e)},dp.isRecordView=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#recordView"===e.$type},dp.validateRecordView=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#recordView",e)},dp.isRecordViewDetail=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#recordViewDetail"===e.$type},dp.validateRecordViewDetail=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#recordViewDetail",e)},dp.isRecordViewNotFound=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#recordViewNotFound"===e.$type},dp.validateRecordViewNotFound=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#recordViewNotFound",e)},dp.isModeration=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#moderation"===e.$type},dp.validateModeration=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#moderation",e)},dp.isModerationDetail=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#moderationDetail"===e.$type},dp.validateModerationDetail=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#moderationDetail",e)},dp.isBlobView=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#blobView"===e.$type},dp.validateBlobView=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#blobView",e)},dp.isImageDetails=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#imageDetails"===e.$type},dp.validateImageDetails=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#imageDetails",e)},dp.isVideoDetails=function(e){return(0,up.isObj)(e)&&(0,up.hasProp)(e,"$type")&&"tools.ozone.moderation.defs#videoDetails"===e.$type},dp.validateVideoDetails=function(e){return pp.lexicons.validate("tools.ozone.moderation.defs#videoDetails",e)};const up=lo,pp=Dn;dp.REVIEWOPEN="tools.ozone.moderation.defs#reviewOpen",dp.REVIEWESCALATED="tools.ozone.moderation.defs#reviewEscalated",dp.REVIEWCLOSED="tools.ozone.moderation.defs#reviewClosed",dp.REVIEWNONE="tools.ozone.moderation.defs#reviewNone";var fp={};Object.defineProperty(fp,"__esModule",{value:!0}),fp.toKnownErr=function(e){return e};var hp={};Object.defineProperty(hp,"__esModule",{value:!0}),hp.toKnownErr=function(e){return e};var yp={};Object.defineProperty(yp,"__esModule",{value:!0}),yp.toKnownErr=function(e){return e};var mp={};Object.defineProperty(mp,"__esModule",{value:!0}),mp.toKnownErr=function(e){return e};var bp={};Object.defineProperty(bp,"__esModule",{value:!0}),bp.toKnownErr=function(e){return e};var gp={};Object.defineProperty(gp,"__esModule",{value:!0}),gp.toKnownErr=function(e){return e};var vp={};Object.defineProperty(vp,"__esModule",{value:!0}),vp.toKnownErr=function(e){return e},vp.isServiceConfig=function(e){return(0,Ep.isObj)(e)&&(0,Ep.hasProp)(e,"$type")&&"tools.ozone.server.getConfig#serviceConfig"===e.$type},vp.validateServiceConfig=function(e){return wp.lexicons.validate("tools.ozone.server.getConfig#serviceConfig",e)},vp.isViewerConfig=function(e){return(0,Ep.isObj)(e)&&(0,Ep.hasProp)(e,"$type")&&"tools.ozone.server.getConfig#viewerConfig"===e.$type},vp.validateViewerConfig=function(e){return wp.lexicons.validate("tools.ozone.server.getConfig#viewerConfig",e)};const Ep=lo,wp=Dn;var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0}),Rp.toKnownErr=function(e){return e};var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.isSet=function(e){return(0,_p.isObj)(e)&&(0,_p.hasProp)(e,"$type")&&"tools.ozone.set.defs#set"===e.$type},Ap.validateSet=function(e){return Sp.lexicons.validate("tools.ozone.set.defs#set",e)},Ap.isSetView=function(e){return(0,_p.isObj)(e)&&(0,_p.hasProp)(e,"$type")&&"tools.ozone.set.defs#setView"===e.$type},Ap.validateSetView=function(e){return Sp.lexicons.validate("tools.ozone.set.defs#setView",e)};const _p=lo,Sp=Dn;var kp={};Object.defineProperty(kp,"__esModule",{value:!0}),kp.toKnownErr=function(e){return e};var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0}),Tp.toKnownErr=function(e){return e};var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0}),Cp.isSigDetail=function(e){return(0,Lp.isObj)(e)&&(0,Lp.hasProp)(e,"$type")&&"tools.ozone.signature.defs#sigDetail"===e.$type},Cp.validateSigDetail=function(e){return Pp.lexicons.validate("tools.ozone.signature.defs#sigDetail",e)};const Lp=lo,Pp=Dn;var xp={};Object.defineProperty(xp,"__esModule",{value:!0}),xp.toKnownErr=function(e){return e};var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0}),Bp.toKnownErr=function(e){return e},Bp.isRelatedAccount=function(e){return(0,jp.isObj)(e)&&(0,jp.hasProp)(e,"$type")&&"tools.ozone.signature.findRelatedAccounts#relatedAccount"===e.$type},Bp.validateRelatedAccount=function(e){return Dp.lexicons.validate("tools.ozone.signature.findRelatedAccounts#relatedAccount",e)};const jp=lo,Dp=Dn;var Op={};Object.defineProperty(Op,"__esModule",{value:!0}),Op.toKnownErr=function(e){return e};var Up={};Object.defineProperty(Up,"__esModule",{value:!0}),Up.ROLETRIAGE=Up.ROLEMODERATOR=Up.ROLEADMIN=void 0,Up.isMember=function(e){return(0,Ip.isObj)(e)&&(0,Ip.hasProp)(e,"$type")&&"tools.ozone.team.defs#member"===e.$type},Up.validateMember=function(e){return Kp.lexicons.validate("tools.ozone.team.defs#member",e)};const Ip=lo,Kp=Dn;Up.ROLEADMIN="tools.ozone.team.defs#roleAdmin",Up.ROLEMODERATOR="tools.ozone.team.defs#roleModerator",Up.ROLETRIAGE="tools.ozone.team.defs#roleTriage";var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0}),Mp.toKnownErr=function(e){return e};var Vp=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),Np=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),zp=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Vp(t,e,r);return Np(t,e),t};Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.ComAtprotoServerDeleteSession=Kn.ComAtprotoServerDeleteAccount=Kn.ComAtprotoServerDefs=Kn.ComAtprotoServerDeactivateAccount=Kn.ComAtprotoServerCreateSession=Kn.ComAtprotoServerCreateInviteCodes=Kn.ComAtprotoServerCreateInviteCode=Kn.ComAtprotoServerCreateAppPassword=Kn.ComAtprotoServerCreateAccount=Kn.ComAtprotoServerConfirmEmail=Kn.ComAtprotoServerCheckAccountStatus=Kn.ComAtprotoServerActivateAccount=Kn.ComAtprotoRepoUploadBlob=Kn.ComAtprotoRepoStrongRef=Kn.ComAtprotoRepoPutRecord=Kn.ComAtprotoRepoListRecords=Kn.ComAtprotoRepoListMissingBlobs=Kn.ComAtprotoRepoImportRepo=Kn.ComAtprotoRepoGetRecord=Kn.ComAtprotoRepoDescribeRepo=Kn.ComAtprotoRepoDeleteRecord=Kn.ComAtprotoRepoDefs=Kn.ComAtprotoRepoCreateRecord=Kn.ComAtprotoRepoApplyWrites=Kn.ComAtprotoModerationDefs=Kn.ComAtprotoModerationCreateReport=Kn.ComAtprotoLabelSubscribeLabels=Kn.ComAtprotoLabelQueryLabels=Kn.ComAtprotoLabelDefs=Kn.ComAtprotoIdentityUpdateHandle=Kn.ComAtprotoIdentitySubmitPlcOperation=Kn.ComAtprotoIdentitySignPlcOperation=Kn.ComAtprotoIdentityResolveHandle=Kn.ComAtprotoIdentityRequestPlcOperationSignature=Kn.ComAtprotoIdentityGetRecommendedDidCredentials=Kn.ComAtprotoAdminUpdateSubjectStatus=Kn.ComAtprotoAdminUpdateAccountPassword=Kn.ComAtprotoAdminUpdateAccountHandle=Kn.ComAtprotoAdminUpdateAccountEmail=Kn.ComAtprotoAdminSendEmail=Kn.ComAtprotoAdminSearchAccounts=Kn.ComAtprotoAdminGetSubjectStatus=Kn.ComAtprotoAdminGetInviteCodes=Kn.ComAtprotoAdminGetAccountInfos=Kn.ComAtprotoAdminGetAccountInfo=Kn.ComAtprotoAdminEnableAccountInvites=Kn.ComAtprotoAdminDisableInviteCodes=Kn.ComAtprotoAdminDisableAccountInvites=Kn.ComAtprotoAdminDeleteAccount=Kn.ComAtprotoAdminDefs=void 0,Kn.AppBskyFeedGetActorLikes=Kn.AppBskyFeedGetActorFeeds=Kn.AppBskyFeedGenerator=Kn.AppBskyFeedDescribeFeedGenerator=Kn.AppBskyFeedDefs=Kn.AppBskyEmbedVideo=Kn.AppBskyEmbedRecordWithMedia=Kn.AppBskyEmbedRecord=Kn.AppBskyEmbedImages=Kn.AppBskyEmbedExternal=Kn.AppBskyEmbedDefs=Kn.AppBskyActorSearchActorsTypeahead=Kn.AppBskyActorSearchActors=Kn.AppBskyActorPutPreferences=Kn.AppBskyActorProfile=Kn.AppBskyActorGetSuggestions=Kn.AppBskyActorGetProfiles=Kn.AppBskyActorGetProfile=Kn.AppBskyActorGetPreferences=Kn.AppBskyActorDefs=Kn.ComAtprotoTempRequestPhoneVerification=Kn.ComAtprotoTempFetchLabels=Kn.ComAtprotoTempCheckSignupQueue=Kn.ComAtprotoSyncSubscribeRepos=Kn.ComAtprotoSyncRequestCrawl=Kn.ComAtprotoSyncNotifyOfUpdate=Kn.ComAtprotoSyncListRepos=Kn.ComAtprotoSyncListBlobs=Kn.ComAtprotoSyncGetRepoStatus=Kn.ComAtprotoSyncGetRepo=Kn.ComAtprotoSyncGetRecord=Kn.ComAtprotoSyncGetLatestCommit=Kn.ComAtprotoSyncGetHead=Kn.ComAtprotoSyncGetCheckout=Kn.ComAtprotoSyncGetBlocks=Kn.ComAtprotoSyncGetBlob=Kn.ComAtprotoServerUpdateEmail=Kn.ComAtprotoServerRevokeAppPassword=Kn.ComAtprotoServerResetPassword=Kn.ComAtprotoServerReserveSigningKey=Kn.ComAtprotoServerRequestPasswordReset=Kn.ComAtprotoServerRequestEmailUpdate=Kn.ComAtprotoServerRequestEmailConfirmation=Kn.ComAtprotoServerRequestAccountDelete=Kn.ComAtprotoServerRefreshSession=Kn.ComAtprotoServerListAppPasswords=Kn.ComAtprotoServerGetSession=Kn.ComAtprotoServerGetServiceAuth=Kn.ComAtprotoServerGetAccountInviteCodes=Kn.ComAtprotoServerDescribeServer=void 0,Kn.AppBskyLabelerService=Kn.AppBskyLabelerGetServices=Kn.AppBskyLabelerDefs=Kn.AppBskyGraphUnmuteThread=Kn.AppBskyGraphUnmuteActorList=Kn.AppBskyGraphUnmuteActor=Kn.AppBskyGraphStarterpack=Kn.AppBskyGraphMuteThread=Kn.AppBskyGraphMuteActorList=Kn.AppBskyGraphMuteActor=Kn.AppBskyGraphListitem=Kn.AppBskyGraphListblock=Kn.AppBskyGraphList=Kn.AppBskyGraphGetSuggestedFollowsByActor=Kn.AppBskyGraphGetStarterPacks=Kn.AppBskyGraphGetStarterPack=Kn.AppBskyGraphGetRelationships=Kn.AppBskyGraphGetMutes=Kn.AppBskyGraphGetLists=Kn.AppBskyGraphGetListMutes=Kn.AppBskyGraphGetListBlocks=Kn.AppBskyGraphGetList=Kn.AppBskyGraphGetKnownFollowers=Kn.AppBskyGraphGetFollows=Kn.AppBskyGraphGetFollowers=Kn.AppBskyGraphGetBlocks=Kn.AppBskyGraphGetActorStarterPacks=Kn.AppBskyGraphFollow=Kn.AppBskyGraphDefs=Kn.AppBskyGraphBlock=Kn.AppBskyFeedThreadgate=Kn.AppBskyFeedSendInteractions=Kn.AppBskyFeedSearchPosts=Kn.AppBskyFeedRepost=Kn.AppBskyFeedPostgate=Kn.AppBskyFeedPost=Kn.AppBskyFeedLike=Kn.AppBskyFeedGetTimeline=Kn.AppBskyFeedGetSuggestedFeeds=Kn.AppBskyFeedGetRepostedBy=Kn.AppBskyFeedGetQuotes=Kn.AppBskyFeedGetPosts=Kn.AppBskyFeedGetPostThread=Kn.AppBskyFeedGetListFeed=Kn.AppBskyFeedGetLikes=Kn.AppBskyFeedGetFeedSkeleton=Kn.AppBskyFeedGetFeedGenerators=Kn.AppBskyFeedGetFeedGenerator=Kn.AppBskyFeedGetFeed=Kn.AppBskyFeedGetAuthorFeed=void 0,Kn.ToolsOzoneModerationQueryStatuses=Kn.ToolsOzoneModerationQueryEvents=Kn.ToolsOzoneModerationGetRepos=Kn.ToolsOzoneModerationGetRepo=Kn.ToolsOzoneModerationGetRecords=Kn.ToolsOzoneModerationGetRecord=Kn.ToolsOzoneModerationGetEvent=Kn.ToolsOzoneModerationEmitEvent=Kn.ToolsOzoneModerationDefs=Kn.ToolsOzoneCommunicationUpdateTemplate=Kn.ToolsOzoneCommunicationListTemplates=Kn.ToolsOzoneCommunicationDeleteTemplate=Kn.ToolsOzoneCommunicationDefs=Kn.ToolsOzoneCommunicationCreateTemplate=Kn.ChatBskyModerationUpdateActorAccess=Kn.ChatBskyModerationGetMessageContext=Kn.ChatBskyModerationGetActorMetadata=Kn.ChatBskyConvoUpdateRead=Kn.ChatBskyConvoUnmuteConvo=Kn.ChatBskyConvoSendMessageBatch=Kn.ChatBskyConvoSendMessage=Kn.ChatBskyConvoMuteConvo=Kn.ChatBskyConvoListConvos=Kn.ChatBskyConvoLeaveConvo=Kn.ChatBskyConvoGetMessages=Kn.ChatBskyConvoGetLog=Kn.ChatBskyConvoGetConvoForMembers=Kn.ChatBskyConvoGetConvo=Kn.ChatBskyConvoDeleteMessageForSelf=Kn.ChatBskyConvoDefs=Kn.ChatBskyActorExportAccountData=Kn.ChatBskyActorDeleteAccount=Kn.ChatBskyActorDefs=Kn.ChatBskyActorDeclaration=Kn.AppBskyVideoUploadVideo=Kn.AppBskyVideoGetUploadLimits=Kn.AppBskyVideoGetJobStatus=Kn.AppBskyVideoDefs=Kn.AppBskyUnspeccedSearchPostsSkeleton=Kn.AppBskyUnspeccedSearchActorsSkeleton=Kn.AppBskyUnspeccedGetTaggedSuggestions=Kn.AppBskyUnspeccedGetSuggestionsSkeleton=Kn.AppBskyUnspeccedGetPopularFeedGenerators=Kn.AppBskyUnspeccedDefs=Kn.AppBskyRichtextFacet=Kn.AppBskyNotificationUpdateSeen=Kn.AppBskyNotificationRegisterPush=Kn.AppBskyNotificationPutPreferences=Kn.AppBskyNotificationListNotifications=Kn.AppBskyNotificationGetUnreadCount=void 0,Kn.ListRecord=Kn.FollowRecord=Kn.BlockRecord=Kn.AppBskyGraphNS=Kn.ThreadgateRecord=Kn.RepostRecord=Kn.PostgateRecord=Kn.PostRecord=Kn.LikeRecord=Kn.GeneratorRecord=Kn.AppBskyFeedNS=Kn.AppBskyEmbedNS=Kn.ProfileRecord=Kn.AppBskyActorNS=Kn.AppBskyNS=Kn.AppNS=Kn.ComAtprotoTempNS=Kn.ComAtprotoSyncNS=Kn.ComAtprotoServerNS=Kn.ComAtprotoRepoNS=Kn.ComAtprotoModerationNS=Kn.ComAtprotoLabelNS=Kn.ComAtprotoIdentityNS=Kn.ComAtprotoAdminNS=Kn.ComAtprotoNS=Kn.ComNS=Kn.AtpBaseClient=Kn.TOOLS_OZONE_TEAM=Kn.TOOLS_OZONE_MODERATION=Kn.APP_BSKY_GRAPH=Kn.APP_BSKY_FEED=Kn.COM_ATPROTO_MODERATION=Kn.ToolsOzoneTeamUpdateMember=Kn.ToolsOzoneTeamListMembers=Kn.ToolsOzoneTeamDeleteMember=Kn.ToolsOzoneTeamDefs=Kn.ToolsOzoneTeamAddMember=Kn.ToolsOzoneSignatureSearchAccounts=Kn.ToolsOzoneSignatureFindRelatedAccounts=Kn.ToolsOzoneSignatureFindCorrelation=Kn.ToolsOzoneSignatureDefs=Kn.ToolsOzoneSetUpsertSet=Kn.ToolsOzoneSetQuerySets=Kn.ToolsOzoneSetGetValues=Kn.ToolsOzoneSetDeleteValues=Kn.ToolsOzoneSetDeleteSet=Kn.ToolsOzoneSetDefs=Kn.ToolsOzoneSetAddValues=Kn.ToolsOzoneServerGetConfig=Kn.ToolsOzoneModerationSearchRepos=void 0,Kn.ToolsOzoneTeamNS=Kn.ToolsOzoneSignatureNS=Kn.ToolsOzoneSetNS=Kn.ToolsOzoneServerNS=Kn.ToolsOzoneModerationNS=Kn.ToolsOzoneCommunicationNS=Kn.ToolsOzoneNS=Kn.ToolsNS=Kn.ChatBskyModerationNS=Kn.ChatBskyConvoNS=Kn.DeclarationRecord=Kn.ChatBskyActorNS=Kn.ChatBskyNS=Kn.ChatNS=Kn.AppBskyVideoNS=Kn.AppBskyUnspeccedNS=Kn.AppBskyRichtextNS=Kn.AppBskyNotificationNS=Kn.ServiceRecord=Kn.AppBskyLabelerNS=Kn.StarterpackRecord=Kn.ListitemRecord=Kn.ListblockRecord=void 0;const Fp=Mn,qp=Dn,$p=zp(co),Gp=zp(yo),Hp=zp(go),Xp=zp(wo),Wp=zp(_o),Zp=zp(To),Jp=zp(jo),Qp=zp(zo),Yp=zp(Ho),ef=zp(Jo),tf=zp(ti),rf=zp(oi),nf=zp(ai),of=zp(pi),sf=zp(yi),af=zp(vi),cf=zp(_i),lf=zp(xi),df=zp(Ki),uf=zp(Ni),pf=zp(Hi),ff=zp(es),hf=zp(ss),yf=zp(ls),mf=zp(ys),bf=zp(vs),gf=zp(As),vf=zp(ks),Ef=zp(Ls),wf=zp(Bs),Rf=zp(Os),Af=zp(Ks),_f=zp(Ns),Sf=zp(qs),kf=zp(Hs),Tf=zp(Zs),Cf=zp(Ys),Lf=zp(ra),Pf=zp(ia),xf=zp(ca),Bf=zp(ua),jf=zp(ha),Df=zp(ba),Of=zp(Ea),Uf=zp(_a);Kn.ComAtprotoAdminDefs=zp(Ta),Kn.ComAtprotoAdminDeleteAccount=zp(Pa),Kn.ComAtprotoAdminDisableAccountInvites=zp(xa),Kn.ComAtprotoAdminDisableInviteCodes=zp(Ba),Kn.ComAtprotoAdminEnableAccountInvites=zp(ja),Kn.ComAtprotoAdminGetAccountInfo=zp(Da),Kn.ComAtprotoAdminGetAccountInfos=zp(Oa),Kn.ComAtprotoAdminGetInviteCodes=zp(Ua),Kn.ComAtprotoAdminGetSubjectStatus=zp(Ia),Kn.ComAtprotoAdminSearchAccounts=zp(Ka),Kn.ComAtprotoAdminSendEmail=zp(Ma),Kn.ComAtprotoAdminUpdateAccountEmail=zp(Va),Kn.ComAtprotoAdminUpdateAccountHandle=zp(Na),Kn.ComAtprotoAdminUpdateAccountPassword=zp(za),Kn.ComAtprotoAdminUpdateSubjectStatus=zp(Fa),Kn.ComAtprotoIdentityGetRecommendedDidCredentials=zp(qa),Kn.ComAtprotoIdentityRequestPlcOperationSignature=zp($a),Kn.ComAtprotoIdentityResolveHandle=zp(Ga),Kn.ComAtprotoIdentitySignPlcOperation=zp(Ha),Kn.ComAtprotoIdentitySubmitPlcOperation=zp(Xa),Kn.ComAtprotoIdentityUpdateHandle=zp(Wa),Kn.ComAtprotoLabelDefs=zp(Za),Kn.ComAtprotoLabelQueryLabels=zp(Ya),Kn.ComAtprotoLabelSubscribeLabels=zp(ec),Kn.ComAtprotoModerationCreateReport=zp(nc),Kn.ComAtprotoModerationDefs=zp(oc),Kn.ComAtprotoRepoApplyWrites=zp(co),Kn.ComAtprotoRepoCreateRecord=zp(yo),Kn.ComAtprotoRepoDefs=zp(ic),Kn.ComAtprotoRepoDeleteRecord=zp(go),Kn.ComAtprotoRepoDescribeRepo=zp(cc),Kn.ComAtprotoRepoGetRecord=zp(wo),Kn.ComAtprotoRepoImportRepo=zp(lc),Kn.ComAtprotoRepoListMissingBlobs=zp(dc),Kn.ComAtprotoRepoListRecords=zp(fc),Kn.ComAtprotoRepoPutRecord=zp(_o),Kn.ComAtprotoRepoStrongRef=zp(mc),Kn.ComAtprotoRepoUploadBlob=zp(vc),Kn.ComAtprotoServerActivateAccount=zp(Ec),Kn.ComAtprotoServerCheckAccountStatus=zp(wc),Kn.ComAtprotoServerConfirmEmail=zp(To),Kn.ComAtprotoServerCreateAccount=zp(jo),Kn.ComAtprotoServerCreateAppPassword=zp(zo),Kn.ComAtprotoServerCreateInviteCode=zp(Rc),Kn.ComAtprotoServerCreateInviteCodes=zp(Ac),Kn.ComAtprotoServerCreateSession=zp(Ho),Kn.ComAtprotoServerDeactivateAccount=zp(kc),Kn.ComAtprotoServerDefs=zp(Tc),Kn.ComAtprotoServerDeleteAccount=zp(Jo),Kn.ComAtprotoServerDeleteSession=zp(Pc),Kn.ComAtprotoServerDescribeServer=zp(xc),Kn.ComAtprotoServerGetAccountInviteCodes=zp(ti),Kn.ComAtprotoServerGetServiceAuth=zp(oi),Kn.ComAtprotoServerGetSession=zp(Dc),Kn.ComAtprotoServerListAppPasswords=zp(ai),Kn.ComAtprotoServerRefreshSession=zp(pi),Kn.ComAtprotoServerRequestAccountDelete=zp(Oc),Kn.ComAtprotoServerRequestEmailConfirmation=zp(Uc),Kn.ComAtprotoServerRequestEmailUpdate=zp(Ic),Kn.ComAtprotoServerRequestPasswordReset=zp(Kc),Kn.ComAtprotoServerReserveSigningKey=zp(Mc),Kn.ComAtprotoServerResetPassword=zp(yi),Kn.ComAtprotoServerRevokeAppPassword=zp(Vc),Kn.ComAtprotoServerUpdateEmail=zp(vi),Kn.ComAtprotoSyncGetBlob=zp(_i),Kn.ComAtprotoSyncGetBlocks=zp(xi),Kn.ComAtprotoSyncGetCheckout=zp(Nc),Kn.ComAtprotoSyncGetHead=zp(Ki),Kn.ComAtprotoSyncGetLatestCommit=zp(Ni),Kn.ComAtprotoSyncGetRecord=zp(Hi),Kn.ComAtprotoSyncGetRepo=zp(es),Kn.ComAtprotoSyncGetRepoStatus=zp(ss),Kn.ComAtprotoSyncListBlobs=zp(ls),Kn.ComAtprotoSyncListRepos=zp(zc),Kn.ComAtprotoSyncNotifyOfUpdate=zp($c),Kn.ComAtprotoSyncRequestCrawl=zp(Gc),Kn.ComAtprotoSyncSubscribeRepos=zp(Hc),Kn.ComAtprotoTempCheckSignupQueue=zp(Zc),Kn.ComAtprotoTempFetchLabels=zp(Jc),Kn.ComAtprotoTempRequestPhoneVerification=zp(Qc),Kn.AppBskyActorDefs=zp(Yc),Kn.AppBskyActorGetPreferences=zp(rl),Kn.AppBskyActorGetProfile=zp(nl),Kn.AppBskyActorGetProfiles=zp(ol),Kn.AppBskyActorGetSuggestions=zp(il),Kn.AppBskyActorProfile=zp(sl),Kn.AppBskyActorPutPreferences=zp(ll),Kn.AppBskyActorSearchActors=zp(dl),Kn.AppBskyActorSearchActorsTypeahead=zp(ul),Kn.AppBskyEmbedDefs=zp(pl),Kn.AppBskyEmbedExternal=zp(yl),Kn.AppBskyEmbedImages=zp(gl),Kn.AppBskyEmbedRecord=zp(wl),Kn.AppBskyEmbedRecordWithMedia=zp(_l),Kn.AppBskyEmbedVideo=zp(Tl),Kn.AppBskyFeedDefs=zp(Pl),Kn.AppBskyFeedDescribeFeedGenerator=zp(jl),Kn.AppBskyFeedGenerator=zp(Ul),Kn.AppBskyFeedGetActorFeeds=zp(Ml),Kn.AppBskyFeedGetActorLikes=zp(ys),Kn.AppBskyFeedGetAuthorFeed=zp(vs),Kn.AppBskyFeedGetFeed=zp(As),Kn.AppBskyFeedGetFeedGenerator=zp(Vl),Kn.AppBskyFeedGetFeedGenerators=zp(Nl),Kn.AppBskyFeedGetFeedSkeleton=zp(ks),Kn.AppBskyFeedGetLikes=zp(zl),Kn.AppBskyFeedGetListFeed=zp(Ls),Kn.AppBskyFeedGetPostThread=zp(Bs),Kn.AppBskyFeedGetPosts=zp($l),Kn.AppBskyFeedGetQuotes=zp(Gl),Kn.AppBskyFeedGetRepostedBy=zp(Hl),Kn.AppBskyFeedGetSuggestedFeeds=zp(Xl),Kn.AppBskyFeedGetTimeline=zp(Wl),Kn.AppBskyFeedLike=zp(Zl),Kn.AppBskyFeedPost=zp(Yl),Kn.AppBskyFeedPostgate=zp(rd),Kn.AppBskyFeedRepost=zp(id),Kn.AppBskyFeedSearchPosts=zp(Os),Kn.AppBskyFeedSendInteractions=zp(cd),Kn.AppBskyFeedThreadgate=zp(ld),Kn.AppBskyGraphBlock=zp(pd),Kn.AppBskyGraphDefs=zp(yd),Kn.AppBskyGraphFollow=zp(gd),Kn.AppBskyGraphGetActorStarterPacks=zp(wd),Kn.AppBskyGraphGetBlocks=zp(Rd),Kn.AppBskyGraphGetFollowers=zp(Ad),Kn.AppBskyGraphGetFollows=zp(_d),Kn.AppBskyGraphGetKnownFollowers=zp(Sd),Kn.AppBskyGraphGetList=zp(kd),Kn.AppBskyGraphGetListBlocks=zp(Td),Kn.AppBskyGraphGetListMutes=zp(Cd),Kn.AppBskyGraphGetLists=zp(Ld),Kn.AppBskyGraphGetMutes=zp(Pd),Kn.AppBskyGraphGetRelationships=zp(Ks),Kn.AppBskyGraphGetStarterPack=zp(xd),Kn.AppBskyGraphGetStarterPacks=zp(Bd),Kn.AppBskyGraphGetSuggestedFollowsByActor=zp(jd),Kn.AppBskyGraphList=zp(Dd),Kn.AppBskyGraphListblock=zp(Id),Kn.AppBskyGraphListitem=zp(Vd),Kn.AppBskyGraphMuteActor=zp(Fd),Kn.AppBskyGraphMuteActorList=zp(qd),Kn.AppBskyGraphMuteThread=zp($d),Kn.AppBskyGraphStarterpack=zp(Gd),Kn.AppBskyGraphUnmuteActor=zp(Wd),Kn.AppBskyGraphUnmuteActorList=zp(Zd),Kn.AppBskyGraphUnmuteThread=zp(Jd),Kn.AppBskyLabelerDefs=zp(Qd),Kn.AppBskyLabelerGetServices=zp(tu),Kn.AppBskyLabelerService=zp(ru),Kn.AppBskyNotificationGetUnreadCount=zp(iu),Kn.AppBskyNotificationListNotifications=zp(su),Kn.AppBskyNotificationPutPreferences=zp(lu),Kn.AppBskyNotificationRegisterPush=zp(du),Kn.AppBskyNotificationUpdateSeen=zp(uu),Kn.AppBskyRichtextFacet=zp(pu),Kn.AppBskyUnspeccedDefs=zp(yu),Kn.AppBskyUnspeccedGetPopularFeedGenerators=zp(gu),Kn.AppBskyUnspeccedGetSuggestionsSkeleton=zp(vu),Kn.AppBskyUnspeccedGetTaggedSuggestions=zp(Eu),Kn.AppBskyUnspeccedSearchActorsSkeleton=zp(Ns),Kn.AppBskyUnspeccedSearchPostsSkeleton=zp(qs),Kn.AppBskyVideoDefs=zp(Au),Kn.AppBskyVideoGetJobStatus=zp(ku),Kn.AppBskyVideoGetUploadLimits=zp(Tu),Kn.AppBskyVideoUploadVideo=zp(Cu),Kn.ChatBskyActorDeclaration=zp(Lu),Kn.ChatBskyActorDefs=zp(Bu),Kn.ChatBskyActorDeleteAccount=zp(Ou),Kn.ChatBskyActorExportAccountData=zp(Uu),Kn.ChatBskyConvoDefs=zp(Iu),Kn.ChatBskyConvoDeleteMessageForSelf=zp(Vu),Kn.ChatBskyConvoGetConvo=zp(Nu),Kn.ChatBskyConvoGetConvoForMembers=zp(zu),Kn.ChatBskyConvoGetLog=zp(Fu),Kn.ChatBskyConvoGetMessages=zp(qu),Kn.ChatBskyConvoLeaveConvo=zp($u),Kn.ChatBskyConvoListConvos=zp(Gu),Kn.ChatBskyConvoMuteConvo=zp(Hu),Kn.ChatBskyConvoSendMessage=zp(Xu),Kn.ChatBskyConvoSendMessageBatch=zp(Wu),Kn.ChatBskyConvoUnmuteConvo=zp(Qu),Kn.ChatBskyConvoUpdateRead=zp(Yu),Kn.ChatBskyModerationGetActorMetadata=zp(ep),Kn.ChatBskyModerationGetMessageContext=zp(np),Kn.ChatBskyModerationUpdateActorAccess=zp(op),Kn.ToolsOzoneCommunicationCreateTemplate=zp(Hs),Kn.ToolsOzoneCommunicationDefs=zp(ip),Kn.ToolsOzoneCommunicationDeleteTemplate=zp(cp),Kn.ToolsOzoneCommunicationListTemplates=zp(lp),Kn.ToolsOzoneCommunicationUpdateTemplate=zp(Zs),Kn.ToolsOzoneModerationDefs=zp(dp),Kn.ToolsOzoneModerationEmitEvent=zp(Ys),Kn.ToolsOzoneModerationGetEvent=zp(fp),Kn.ToolsOzoneModerationGetRecord=zp(ra),Kn.ToolsOzoneModerationGetRecords=zp(hp),Kn.ToolsOzoneModerationGetRepo=zp(ia),Kn.ToolsOzoneModerationGetRepos=zp(yp),Kn.ToolsOzoneModerationQueryEvents=zp(mp),Kn.ToolsOzoneModerationQueryStatuses=zp(bp),Kn.ToolsOzoneModerationSearchRepos=zp(gp),Kn.ToolsOzoneServerGetConfig=zp(vp),Kn.ToolsOzoneSetAddValues=zp(Rp),Kn.ToolsOzoneSetDefs=zp(Ap),Kn.ToolsOzoneSetDeleteSet=zp(ca),Kn.ToolsOzoneSetDeleteValues=zp(ua),Kn.ToolsOzoneSetGetValues=zp(ha),Kn.ToolsOzoneSetQuerySets=zp(kp),Kn.ToolsOzoneSetUpsertSet=zp(Tp),Kn.ToolsOzoneSignatureDefs=zp(Cp),Kn.ToolsOzoneSignatureFindCorrelation=zp(xp),Kn.ToolsOzoneSignatureFindRelatedAccounts=zp(Bp),Kn.ToolsOzoneSignatureSearchAccounts=zp(Op),Kn.ToolsOzoneTeamAddMember=zp(ba),Kn.ToolsOzoneTeamDefs=zp(Up),Kn.ToolsOzoneTeamDeleteMember=zp(Ea),Kn.ToolsOzoneTeamListMembers=zp(Mp),Kn.ToolsOzoneTeamUpdateMember=zp(_a),Kn.COM_ATPROTO_MODERATION={DefsReasonSpam:"com.atproto.moderation.defs#reasonSpam",DefsReasonViolation:"com.atproto.moderation.defs#reasonViolation",DefsReasonMisleading:"com.atproto.moderation.defs#reasonMisleading",DefsReasonSexual:"com.atproto.moderation.defs#reasonSexual",DefsReasonRude:"com.atproto.moderation.defs#reasonRude",DefsReasonOther:"com.atproto.moderation.defs#reasonOther",DefsReasonAppeal:"com.atproto.moderation.defs#reasonAppeal"},Kn.APP_BSKY_FEED={DefsRequestLess:"app.bsky.feed.defs#requestLess",DefsRequestMore:"app.bsky.feed.defs#requestMore",DefsClickthroughItem:"app.bsky.feed.defs#clickthroughItem",DefsClickthroughAuthor:"app.bsky.feed.defs#clickthroughAuthor",DefsClickthroughReposter:"app.bsky.feed.defs#clickthroughReposter",DefsClickthroughEmbed:"app.bsky.feed.defs#clickthroughEmbed",DefsInteractionSeen:"app.bsky.feed.defs#interactionSeen",DefsInteractionLike:"app.bsky.feed.defs#interactionLike",DefsInteractionRepost:"app.bsky.feed.defs#interactionRepost",DefsInteractionReply:"app.bsky.feed.defs#interactionReply",DefsInteractionQuote:"app.bsky.feed.defs#interactionQuote",DefsInteractionShare:"app.bsky.feed.defs#interactionShare"},Kn.APP_BSKY_GRAPH={DefsModlist:"app.bsky.graph.defs#modlist",DefsCuratelist:"app.bsky.graph.defs#curatelist",DefsReferencelist:"app.bsky.graph.defs#referencelist"},Kn.TOOLS_OZONE_MODERATION={DefsReviewOpen:"tools.ozone.moderation.defs#reviewOpen",DefsReviewEscalated:"tools.ozone.moderation.defs#reviewEscalated",DefsReviewClosed:"tools.ozone.moderation.defs#reviewClosed",DefsReviewNone:"tools.ozone.moderation.defs#reviewNone"},Kn.TOOLS_OZONE_TEAM={DefsRoleAdmin:"tools.ozone.team.defs#roleAdmin",DefsRoleModerator:"tools.ozone.team.defs#roleModerator",DefsRoleTriage:"tools.ozone.team.defs#roleTriage"};Kn.AtpBaseClient=class extends Fp.XrpcClient{constructor(e){super(e,qp.schemas),Object.defineProperty(this,"com",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tools",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.com=new If(this),this.app=new Hf(this),this.chat=new gh(this),this.tools=new _h(this)}get xrpc(){return this}};class If{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"atproto",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.atproto=new Kf(e)}}Kn.ComNS=If;class Kf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"admin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"identity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"moderation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"repo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"server",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sync",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"temp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.admin=new Mf(e),this.identity=new Vf(e),this.label=new Nf(e),this.moderation=new zf(e),this.repo=new Ff(e),this.server=new qf(e),this.sync=new $f(e),this.temp=new Gf(e)}}Kn.ComAtprotoNS=Kf;class Mf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}deleteAccount(e,t){return this._client.call("com.atproto.admin.deleteAccount",t?.qp,e,t)}disableAccountInvites(e,t){return this._client.call("com.atproto.admin.disableAccountInvites",t?.qp,e,t)}disableInviteCodes(e,t){return this._client.call("com.atproto.admin.disableInviteCodes",t?.qp,e,t)}enableAccountInvites(e,t){return this._client.call("com.atproto.admin.enableAccountInvites",t?.qp,e,t)}getAccountInfo(e,t){return this._client.call("com.atproto.admin.getAccountInfo",e,void 0,t)}getAccountInfos(e,t){return this._client.call("com.atproto.admin.getAccountInfos",e,void 0,t)}getInviteCodes(e,t){return this._client.call("com.atproto.admin.getInviteCodes",e,void 0,t)}getSubjectStatus(e,t){return this._client.call("com.atproto.admin.getSubjectStatus",e,void 0,t)}searchAccounts(e,t){return this._client.call("com.atproto.admin.searchAccounts",e,void 0,t)}sendEmail(e,t){return this._client.call("com.atproto.admin.sendEmail",t?.qp,e,t)}updateAccountEmail(e,t){return this._client.call("com.atproto.admin.updateAccountEmail",t?.qp,e,t)}updateAccountHandle(e,t){return this._client.call("com.atproto.admin.updateAccountHandle",t?.qp,e,t)}updateAccountPassword(e,t){return this._client.call("com.atproto.admin.updateAccountPassword",t?.qp,e,t)}updateSubjectStatus(e,t){return this._client.call("com.atproto.admin.updateSubjectStatus",t?.qp,e,t)}}Kn.ComAtprotoAdminNS=Mf;class Vf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}getRecommendedDidCredentials(e,t){return this._client.call("com.atproto.identity.getRecommendedDidCredentials",e,void 0,t)}requestPlcOperationSignature(e,t){return this._client.call("com.atproto.identity.requestPlcOperationSignature",t?.qp,e,t)}resolveHandle(e,t){return this._client.call("com.atproto.identity.resolveHandle",e,void 0,t)}signPlcOperation(e,t){return this._client.call("com.atproto.identity.signPlcOperation",t?.qp,e,t)}submitPlcOperation(e,t){return this._client.call("com.atproto.identity.submitPlcOperation",t?.qp,e,t)}updateHandle(e,t){return this._client.call("com.atproto.identity.updateHandle",t?.qp,e,t)}}Kn.ComAtprotoIdentityNS=Vf;class Nf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}queryLabels(e,t){return this._client.call("com.atproto.label.queryLabels",e,void 0,t)}}Kn.ComAtprotoLabelNS=Nf;class zf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}createReport(e,t){return this._client.call("com.atproto.moderation.createReport",t?.qp,e,t)}}Kn.ComAtprotoModerationNS=zf;class Ff{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}applyWrites(e,t){return this._client.call("com.atproto.repo.applyWrites",t?.qp,e,t).catch((e=>{throw $p.toKnownErr(e)}))}createRecord(e,t){return this._client.call("com.atproto.repo.createRecord",t?.qp,e,t).catch((e=>{throw Gp.toKnownErr(e)}))}deleteRecord(e,t){return this._client.call("com.atproto.repo.deleteRecord",t?.qp,e,t).catch((e=>{throw Hp.toKnownErr(e)}))}describeRepo(e,t){return this._client.call("com.atproto.repo.describeRepo",e,void 0,t)}getRecord(e,t){return this._client.call("com.atproto.repo.getRecord",e,void 0,t).catch((e=>{throw Xp.toKnownErr(e)}))}importRepo(e,t){return this._client.call("com.atproto.repo.importRepo",t?.qp,e,t)}listMissingBlobs(e,t){return this._client.call("com.atproto.repo.listMissingBlobs",e,void 0,t)}listRecords(e,t){return this._client.call("com.atproto.repo.listRecords",e,void 0,t)}putRecord(e,t){return this._client.call("com.atproto.repo.putRecord",t?.qp,e,t).catch((e=>{throw Wp.toKnownErr(e)}))}uploadBlob(e,t){return this._client.call("com.atproto.repo.uploadBlob",t?.qp,e,t)}}Kn.ComAtprotoRepoNS=Ff;class qf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}activateAccount(e,t){return this._client.call("com.atproto.server.activateAccount",t?.qp,e,t)}checkAccountStatus(e,t){return this._client.call("com.atproto.server.checkAccountStatus",e,void 0,t)}confirmEmail(e,t){return this._client.call("com.atproto.server.confirmEmail",t?.qp,e,t).catch((e=>{throw Zp.toKnownErr(e)}))}createAccount(e,t){return this._client.call("com.atproto.server.createAccount",t?.qp,e,t).catch((e=>{throw Jp.toKnownErr(e)}))}createAppPassword(e,t){return this._client.call("com.atproto.server.createAppPassword",t?.qp,e,t).catch((e=>{throw Qp.toKnownErr(e)}))}createInviteCode(e,t){return this._client.call("com.atproto.server.createInviteCode",t?.qp,e,t)}createInviteCodes(e,t){return this._client.call("com.atproto.server.createInviteCodes",t?.qp,e,t)}createSession(e,t){return this._client.call("com.atproto.server.createSession",t?.qp,e,t).catch((e=>{throw Yp.toKnownErr(e)}))}deactivateAccount(e,t){return this._client.call("com.atproto.server.deactivateAccount",t?.qp,e,t)}deleteAccount(e,t){return this._client.call("com.atproto.server.deleteAccount",t?.qp,e,t).catch((e=>{throw ef.toKnownErr(e)}))}deleteSession(e,t){return this._client.call("com.atproto.server.deleteSession",t?.qp,e,t)}describeServer(e,t){return this._client.call("com.atproto.server.describeServer",e,void 0,t)}getAccountInviteCodes(e,t){return this._client.call("com.atproto.server.getAccountInviteCodes",e,void 0,t).catch((e=>{throw tf.toKnownErr(e)}))}getServiceAuth(e,t){return this._client.call("com.atproto.server.getServiceAuth",e,void 0,t).catch((e=>{throw rf.toKnownErr(e)}))}getSession(e,t){return this._client.call("com.atproto.server.getSession",e,void 0,t)}listAppPasswords(e,t){return this._client.call("com.atproto.server.listAppPasswords",e,void 0,t).catch((e=>{throw nf.toKnownErr(e)}))}refreshSession(e,t){return this._client.call("com.atproto.server.refreshSession",t?.qp,e,t).catch((e=>{throw of.toKnownErr(e)}))}requestAccountDelete(e,t){return this._client.call("com.atproto.server.requestAccountDelete",t?.qp,e,t)}requestEmailConfirmation(e,t){return this._client.call("com.atproto.server.requestEmailConfirmation",t?.qp,e,t)}requestEmailUpdate(e,t){return this._client.call("com.atproto.server.requestEmailUpdate",t?.qp,e,t)}requestPasswordReset(e,t){return this._client.call("com.atproto.server.requestPasswordReset",t?.qp,e,t)}reserveSigningKey(e,t){return this._client.call("com.atproto.server.reserveSigningKey",t?.qp,e,t)}resetPassword(e,t){return this._client.call("com.atproto.server.resetPassword",t?.qp,e,t).catch((e=>{throw sf.toKnownErr(e)}))}revokeAppPassword(e,t){return this._client.call("com.atproto.server.revokeAppPassword",t?.qp,e,t)}updateEmail(e,t){return this._client.call("com.atproto.server.updateEmail",t?.qp,e,t).catch((e=>{throw af.toKnownErr(e)}))}}Kn.ComAtprotoServerNS=qf;class $f{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}getBlob(e,t){return this._client.call("com.atproto.sync.getBlob",e,void 0,t).catch((e=>{throw cf.toKnownErr(e)}))}getBlocks(e,t){return this._client.call("com.atproto.sync.getBlocks",e,void 0,t).catch((e=>{throw lf.toKnownErr(e)}))}getCheckout(e,t){return this._client.call("com.atproto.sync.getCheckout",e,void 0,t)}getHead(e,t){return this._client.call("com.atproto.sync.getHead",e,void 0,t).catch((e=>{throw df.toKnownErr(e)}))}getLatestCommit(e,t){return this._client.call("com.atproto.sync.getLatestCommit",e,void 0,t).catch((e=>{throw uf.toKnownErr(e)}))}getRecord(e,t){return this._client.call("com.atproto.sync.getRecord",e,void 0,t).catch((e=>{throw pf.toKnownErr(e)}))}getRepo(e,t){return this._client.call("com.atproto.sync.getRepo",e,void 0,t).catch((e=>{throw ff.toKnownErr(e)}))}getRepoStatus(e,t){return this._client.call("com.atproto.sync.getRepoStatus",e,void 0,t).catch((e=>{throw hf.toKnownErr(e)}))}listBlobs(e,t){return this._client.call("com.atproto.sync.listBlobs",e,void 0,t).catch((e=>{throw yf.toKnownErr(e)}))}listRepos(e,t){return this._client.call("com.atproto.sync.listRepos",e,void 0,t)}notifyOfUpdate(e,t){return this._client.call("com.atproto.sync.notifyOfUpdate",t?.qp,e,t)}requestCrawl(e,t){return this._client.call("com.atproto.sync.requestCrawl",t?.qp,e,t)}}Kn.ComAtprotoSyncNS=$f;class Gf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}checkSignupQueue(e,t){return this._client.call("com.atproto.temp.checkSignupQueue",e,void 0,t)}fetchLabels(e,t){return this._client.call("com.atproto.temp.fetchLabels",e,void 0,t)}requestPhoneVerification(e,t){return this._client.call("com.atproto.temp.requestPhoneVerification",t?.qp,e,t)}}Kn.ComAtprotoTempNS=Gf;class Hf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bsky",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.bsky=new Xf(e)}}Kn.AppNS=Hf;class Xf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"actor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"embed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"feed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"labeler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"notification",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"richtext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unspecced",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"video",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.actor=new Wf(e),this.embed=new Jf(e),this.feed=new Qf(e),this.graph=new ih(e),this.labeler=new ph(e),this.notification=new hh(e),this.richtext=new yh(e),this.unspecced=new mh(e),this.video=new bh(e)}}Kn.AppBskyNS=Xf;class Wf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"profile",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.profile=new Zf(e)}getPreferences(e,t){return this._client.call("app.bsky.actor.getPreferences",e,void 0,t)}getProfile(e,t){return this._client.call("app.bsky.actor.getProfile",e,void 0,t)}getProfiles(e,t){return this._client.call("app.bsky.actor.getProfiles",e,void 0,t)}getSuggestions(e,t){return this._client.call("app.bsky.actor.getSuggestions",e,void 0,t)}putPreferences(e,t){return this._client.call("app.bsky.actor.putPreferences",t?.qp,e,t)}searchActors(e,t){return this._client.call("app.bsky.actor.searchActors",e,void 0,t)}searchActorsTypeahead(e,t){return this._client.call("app.bsky.actor.searchActorsTypeahead",e,void 0,t)}}Kn.AppBskyActorNS=Wf;class Zf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.actor.profile",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.actor.profile",...e})).data}async create(e,t,r){t.$type="app.bsky.actor.profile";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.actor.profile",rkey:"self",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.actor.profile",...e},{headers:t})}}Kn.ProfileRecord=Zf;class Jf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}}Kn.AppBskyEmbedNS=Jf;class Qf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"generator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"like",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"post",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"postgate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"repost",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"threadgate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.generator=new Yf(e),this.like=new eh(e),this.post=new th(e),this.postgate=new rh(e),this.repost=new nh(e),this.threadgate=new oh(e)}describeFeedGenerator(e,t){return this._client.call("app.bsky.feed.describeFeedGenerator",e,void 0,t)}getActorFeeds(e,t){return this._client.call("app.bsky.feed.getActorFeeds",e,void 0,t)}getActorLikes(e,t){return this._client.call("app.bsky.feed.getActorLikes",e,void 0,t).catch((e=>{throw mf.toKnownErr(e)}))}getAuthorFeed(e,t){return this._client.call("app.bsky.feed.getAuthorFeed",e,void 0,t).catch((e=>{throw bf.toKnownErr(e)}))}getFeed(e,t){return this._client.call("app.bsky.feed.getFeed",e,void 0,t).catch((e=>{throw gf.toKnownErr(e)}))}getFeedGenerator(e,t){return this._client.call("app.bsky.feed.getFeedGenerator",e,void 0,t)}getFeedGenerators(e,t){return this._client.call("app.bsky.feed.getFeedGenerators",e,void 0,t)}getFeedSkeleton(e,t){return this._client.call("app.bsky.feed.getFeedSkeleton",e,void 0,t).catch((e=>{throw vf.toKnownErr(e)}))}getLikes(e,t){return this._client.call("app.bsky.feed.getLikes",e,void 0,t)}getListFeed(e,t){return this._client.call("app.bsky.feed.getListFeed",e,void 0,t).catch((e=>{throw Ef.toKnownErr(e)}))}getPostThread(e,t){return this._client.call("app.bsky.feed.getPostThread",e,void 0,t).catch((e=>{throw wf.toKnownErr(e)}))}getPosts(e,t){return this._client.call("app.bsky.feed.getPosts",e,void 0,t)}getQuotes(e,t){return this._client.call("app.bsky.feed.getQuotes",e,void 0,t)}getRepostedBy(e,t){return this._client.call("app.bsky.feed.getRepostedBy",e,void 0,t)}getSuggestedFeeds(e,t){return this._client.call("app.bsky.feed.getSuggestedFeeds",e,void 0,t)}getTimeline(e,t){return this._client.call("app.bsky.feed.getTimeline",e,void 0,t)}searchPosts(e,t){return this._client.call("app.bsky.feed.searchPosts",e,void 0,t).catch((e=>{throw Rf.toKnownErr(e)}))}sendInteractions(e,t){return this._client.call("app.bsky.feed.sendInteractions",t?.qp,e,t)}}Kn.AppBskyFeedNS=Qf;class Yf{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.generator",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.generator",...e})).data}async create(e,t,r){t.$type="app.bsky.feed.generator";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.feed.generator",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.generator",...e},{headers:t})}}Kn.GeneratorRecord=Yf;class eh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.like",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.like",...e})).data}async create(e,t,r){t.$type="app.bsky.feed.like";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.feed.like",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.like",...e},{headers:t})}}Kn.LikeRecord=eh;class th{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.post",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.post",...e})).data}async create(e,t,r){t.$type="app.bsky.feed.post";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.feed.post",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.post",...e},{headers:t})}}Kn.PostRecord=th;class rh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.postgate",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.postgate",...e})).data}async create(e,t,r){t.$type="app.bsky.feed.postgate";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.feed.postgate",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.postgate",...e},{headers:t})}}Kn.PostgateRecord=rh;class nh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.repost",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.repost",...e})).data}async create(e,t,r){t.$type="app.bsky.feed.repost";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.feed.repost",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.repost",...e},{headers:t})}}Kn.RepostRecord=nh;class oh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.feed.threadgate",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.feed.threadgate",...e})).data}async create(e,t,r){t.$type="app.bsky.feed.threadgate";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.feed.threadgate",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.feed.threadgate",...e},{headers:t})}}Kn.ThreadgateRecord=oh;class ih{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"block",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"follow",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"list",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"listblock",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"listitem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"starterpack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.block=new sh(e),this.follow=new ah(e),this.list=new ch(e),this.listblock=new lh(e),this.listitem=new dh(e),this.starterpack=new uh(e)}getActorStarterPacks(e,t){return this._client.call("app.bsky.graph.getActorStarterPacks",e,void 0,t)}getBlocks(e,t){return this._client.call("app.bsky.graph.getBlocks",e,void 0,t)}getFollowers(e,t){return this._client.call("app.bsky.graph.getFollowers",e,void 0,t)}getFollows(e,t){return this._client.call("app.bsky.graph.getFollows",e,void 0,t)}getKnownFollowers(e,t){return this._client.call("app.bsky.graph.getKnownFollowers",e,void 0,t)}getList(e,t){return this._client.call("app.bsky.graph.getList",e,void 0,t)}getListBlocks(e,t){return this._client.call("app.bsky.graph.getListBlocks",e,void 0,t)}getListMutes(e,t){return this._client.call("app.bsky.graph.getListMutes",e,void 0,t)}getLists(e,t){return this._client.call("app.bsky.graph.getLists",e,void 0,t)}getMutes(e,t){return this._client.call("app.bsky.graph.getMutes",e,void 0,t)}getRelationships(e,t){return this._client.call("app.bsky.graph.getRelationships",e,void 0,t).catch((e=>{throw Af.toKnownErr(e)}))}getStarterPack(e,t){return this._client.call("app.bsky.graph.getStarterPack",e,void 0,t)}getStarterPacks(e,t){return this._client.call("app.bsky.graph.getStarterPacks",e,void 0,t)}getSuggestedFollowsByActor(e,t){return this._client.call("app.bsky.graph.getSuggestedFollowsByActor",e,void 0,t)}muteActor(e,t){return this._client.call("app.bsky.graph.muteActor",t?.qp,e,t)}muteActorList(e,t){return this._client.call("app.bsky.graph.muteActorList",t?.qp,e,t)}muteThread(e,t){return this._client.call("app.bsky.graph.muteThread",t?.qp,e,t)}unmuteActor(e,t){return this._client.call("app.bsky.graph.unmuteActor",t?.qp,e,t)}unmuteActorList(e,t){return this._client.call("app.bsky.graph.unmuteActorList",t?.qp,e,t)}unmuteThread(e,t){return this._client.call("app.bsky.graph.unmuteThread",t?.qp,e,t)}}Kn.AppBskyGraphNS=ih;class sh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.block",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.block",...e})).data}async create(e,t,r){t.$type="app.bsky.graph.block";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.graph.block",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.block",...e},{headers:t})}}Kn.BlockRecord=sh;class ah{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.follow",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.follow",...e})).data}async create(e,t,r){t.$type="app.bsky.graph.follow";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.graph.follow",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.follow",...e},{headers:t})}}Kn.FollowRecord=ah;class ch{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.list",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.list",...e})).data}async create(e,t,r){t.$type="app.bsky.graph.list";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.graph.list",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.list",...e},{headers:t})}}Kn.ListRecord=ch;class lh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.listblock",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.listblock",...e})).data}async create(e,t,r){t.$type="app.bsky.graph.listblock";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.graph.listblock",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.listblock",...e},{headers:t})}}Kn.ListblockRecord=lh;class dh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.listitem",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.listitem",...e})).data}async create(e,t,r){t.$type="app.bsky.graph.listitem";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.graph.listitem",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.listitem",...e},{headers:t})}}Kn.ListitemRecord=dh;class uh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.graph.starterpack",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.graph.starterpack",...e})).data}async create(e,t,r){t.$type="app.bsky.graph.starterpack";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.graph.starterpack",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.graph.starterpack",...e},{headers:t})}}Kn.StarterpackRecord=uh;class ph{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"service",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.service=new fh(e)}getServices(e,t){return this._client.call("app.bsky.labeler.getServices",e,void 0,t)}}Kn.AppBskyLabelerNS=ph;class fh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"app.bsky.labeler.service",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"app.bsky.labeler.service",...e})).data}async create(e,t,r){t.$type="app.bsky.labeler.service";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"app.bsky.labeler.service",rkey:"self",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"app.bsky.labeler.service",...e},{headers:t})}}Kn.ServiceRecord=fh;class hh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}getUnreadCount(e,t){return this._client.call("app.bsky.notification.getUnreadCount",e,void 0,t)}listNotifications(e,t){return this._client.call("app.bsky.notification.listNotifications",e,void 0,t)}putPreferences(e,t){return this._client.call("app.bsky.notification.putPreferences",t?.qp,e,t)}registerPush(e,t){return this._client.call("app.bsky.notification.registerPush",t?.qp,e,t)}updateSeen(e,t){return this._client.call("app.bsky.notification.updateSeen",t?.qp,e,t)}}Kn.AppBskyNotificationNS=hh;class yh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}}Kn.AppBskyRichtextNS=yh;class mh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}getPopularFeedGenerators(e,t){return this._client.call("app.bsky.unspecced.getPopularFeedGenerators",e,void 0,t)}getSuggestionsSkeleton(e,t){return this._client.call("app.bsky.unspecced.getSuggestionsSkeleton",e,void 0,t)}getTaggedSuggestions(e,t){return this._client.call("app.bsky.unspecced.getTaggedSuggestions",e,void 0,t)}searchActorsSkeleton(e,t){return this._client.call("app.bsky.unspecced.searchActorsSkeleton",e,void 0,t).catch((e=>{throw _f.toKnownErr(e)}))}searchPostsSkeleton(e,t){return this._client.call("app.bsky.unspecced.searchPostsSkeleton",e,void 0,t).catch((e=>{throw Sf.toKnownErr(e)}))}}Kn.AppBskyUnspeccedNS=mh;class bh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}getJobStatus(e,t){return this._client.call("app.bsky.video.getJobStatus",e,void 0,t)}getUploadLimits(e,t){return this._client.call("app.bsky.video.getUploadLimits",e,void 0,t)}uploadVideo(e,t){return this._client.call("app.bsky.video.uploadVideo",t?.qp,e,t)}}Kn.AppBskyVideoNS=bh;class gh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bsky",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.bsky=new vh(e)}}Kn.ChatNS=gh;class vh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"actor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"convo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"moderation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.actor=new Eh(e),this.convo=new Rh(e),this.moderation=new Ah(e)}}Kn.ChatBskyNS=vh;class Eh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"declaration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.declaration=new wh(e)}deleteAccount(e,t){return this._client.call("chat.bsky.actor.deleteAccount",t?.qp,e,t)}exportAccountData(e,t){return this._client.call("chat.bsky.actor.exportAccountData",e,void 0,t)}}Kn.ChatBskyActorNS=Eh;class wh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}async list(e){return(await this._client.call("com.atproto.repo.listRecords",{collection:"chat.bsky.actor.declaration",...e})).data}async get(e){return(await this._client.call("com.atproto.repo.getRecord",{collection:"chat.bsky.actor.declaration",...e})).data}async create(e,t,r){t.$type="chat.bsky.actor.declaration";return(await this._client.call("com.atproto.repo.createRecord",void 0,{collection:"chat.bsky.actor.declaration",rkey:"self",...e,record:t},{encoding:"application/json",headers:r})).data}async delete(e,t){await this._client.call("com.atproto.repo.deleteRecord",void 0,{collection:"chat.bsky.actor.declaration",...e},{headers:t})}}Kn.DeclarationRecord=wh;class Rh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}deleteMessageForSelf(e,t){return this._client.call("chat.bsky.convo.deleteMessageForSelf",t?.qp,e,t)}getConvo(e,t){return this._client.call("chat.bsky.convo.getConvo",e,void 0,t)}getConvoForMembers(e,t){return this._client.call("chat.bsky.convo.getConvoForMembers",e,void 0,t)}getLog(e,t){return this._client.call("chat.bsky.convo.getLog",e,void 0,t)}getMessages(e,t){return this._client.call("chat.bsky.convo.getMessages",e,void 0,t)}leaveConvo(e,t){return this._client.call("chat.bsky.convo.leaveConvo",t?.qp,e,t)}listConvos(e,t){return this._client.call("chat.bsky.convo.listConvos",e,void 0,t)}muteConvo(e,t){return this._client.call("chat.bsky.convo.muteConvo",t?.qp,e,t)}sendMessage(e,t){return this._client.call("chat.bsky.convo.sendMessage",t?.qp,e,t)}sendMessageBatch(e,t){return this._client.call("chat.bsky.convo.sendMessageBatch",t?.qp,e,t)}unmuteConvo(e,t){return this._client.call("chat.bsky.convo.unmuteConvo",t?.qp,e,t)}updateRead(e,t){return this._client.call("chat.bsky.convo.updateRead",t?.qp,e,t)}}Kn.ChatBskyConvoNS=Rh;class Ah{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}getActorMetadata(e,t){return this._client.call("chat.bsky.moderation.getActorMetadata",e,void 0,t)}getMessageContext(e,t){return this._client.call("chat.bsky.moderation.getMessageContext",e,void 0,t)}updateActorAccess(e,t){return this._client.call("chat.bsky.moderation.updateActorAccess",t?.qp,e,t)}}Kn.ChatBskyModerationNS=Ah;class _h{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ozone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.ozone=new Sh(e)}}Kn.ToolsNS=_h;class Sh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"communication",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"moderation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"server",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"set",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"team",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e,this.communication=new kh(e),this.moderation=new Th(e),this.server=new Ch(e),this.set=new Lh(e),this.signature=new Ph(e),this.team=new xh(e)}}Kn.ToolsOzoneNS=Sh;class kh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}createTemplate(e,t){return this._client.call("tools.ozone.communication.createTemplate",t?.qp,e,t).catch((e=>{throw kf.toKnownErr(e)}))}deleteTemplate(e,t){return this._client.call("tools.ozone.communication.deleteTemplate",t?.qp,e,t)}listTemplates(e,t){return this._client.call("tools.ozone.communication.listTemplates",e,void 0,t)}updateTemplate(e,t){return this._client.call("tools.ozone.communication.updateTemplate",t?.qp,e,t).catch((e=>{throw Tf.toKnownErr(e)}))}}Kn.ToolsOzoneCommunicationNS=kh;class Th{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}emitEvent(e,t){return this._client.call("tools.ozone.moderation.emitEvent",t?.qp,e,t).catch((e=>{throw Cf.toKnownErr(e)}))}getEvent(e,t){return this._client.call("tools.ozone.moderation.getEvent",e,void 0,t)}getRecord(e,t){return this._client.call("tools.ozone.moderation.getRecord",e,void 0,t).catch((e=>{throw Lf.toKnownErr(e)}))}getRecords(e,t){return this._client.call("tools.ozone.moderation.getRecords",e,void 0,t)}getRepo(e,t){return this._client.call("tools.ozone.moderation.getRepo",e,void 0,t).catch((e=>{throw Pf.toKnownErr(e)}))}getRepos(e,t){return this._client.call("tools.ozone.moderation.getRepos",e,void 0,t)}queryEvents(e,t){return this._client.call("tools.ozone.moderation.queryEvents",e,void 0,t)}queryStatuses(e,t){return this._client.call("tools.ozone.moderation.queryStatuses",e,void 0,t)}searchRepos(e,t){return this._client.call("tools.ozone.moderation.searchRepos",e,void 0,t)}}Kn.ToolsOzoneModerationNS=Th;class Ch{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}getConfig(e,t){return this._client.call("tools.ozone.server.getConfig",e,void 0,t)}}Kn.ToolsOzoneServerNS=Ch;class Lh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}addValues(e,t){return this._client.call("tools.ozone.set.addValues",t?.qp,e,t)}deleteSet(e,t){return this._client.call("tools.ozone.set.deleteSet",t?.qp,e,t).catch((e=>{throw xf.toKnownErr(e)}))}deleteValues(e,t){return this._client.call("tools.ozone.set.deleteValues",t?.qp,e,t).catch((e=>{throw Bf.toKnownErr(e)}))}getValues(e,t){return this._client.call("tools.ozone.set.getValues",e,void 0,t).catch((e=>{throw jf.toKnownErr(e)}))}querySets(e,t){return this._client.call("tools.ozone.set.querySets",e,void 0,t)}upsertSet(e,t){return this._client.call("tools.ozone.set.upsertSet",t?.qp,e,t)}}Kn.ToolsOzoneSetNS=Lh;class Ph{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}findCorrelation(e,t){return this._client.call("tools.ozone.signature.findCorrelation",e,void 0,t)}findRelatedAccounts(e,t){return this._client.call("tools.ozone.signature.findRelatedAccounts",e,void 0,t)}searchAccounts(e,t){return this._client.call("tools.ozone.signature.searchAccounts",e,void 0,t)}}Kn.ToolsOzoneSignatureNS=Ph;class xh{constructor(e){Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._client=e}addMember(e,t){return this._client.call("tools.ozone.team.addMember",t?.qp,e,t).catch((e=>{throw Df.toKnownErr(e)}))}deleteMember(e,t){return this._client.call("tools.ozone.team.deleteMember",t?.qp,e,t).catch((e=>{throw Of.toKnownErr(e)}))}listMembers(e,t){return this._client.call("tools.ozone.team.listMembers",e,void 0,t)}updateMember(e,t){return this._client.call("tools.ozone.team.updateMember",t?.qp,e,t).catch((e=>{throw Uf.toKnownErr(e)}))}}Kn.ToolsOzoneTeamNS=xh;var Bh={},jh={};Object.defineProperty(jh,"__esModule",{value:!0}),jh.UnicodeString=void 0;const Dh=le,Oh=new TextEncoder,Uh=new TextDecoder;jh.UnicodeString=class{constructor(e){Object.defineProperty(this,"utf16",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"utf8",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_graphemeLen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.utf16=e,this.utf8=Oh.encode(e)}get length(){return this.utf8.byteLength}get graphemeLength(){return this._graphemeLen||(this._graphemeLen=(0,Dh.graphemeLen)(this.utf16)),this._graphemeLen}slice(e,t){return Uh.decode(this.utf8.slice(e,t))}utf16IndexToUtf8Index(e){return Oh.encode(this.utf16.slice(0,e)).byteLength}toString(){return this.utf16}};var Ih={};Object.defineProperty(Ih,"__esModule",{value:!0}),Ih.sanitizeRichText=function(e,t){t.cleanNewlines&&(e=function(e,t,r){e=e.clone();let n=e.unicodeText.utf16.match(t);for(;n&&void 0!==n.index;){const o=e.unicodeText,i=e.unicodeText.utf16IndexToUtf8Index(n.index),s=i+new Kh.UnicodeString(n[0]).length;if(e.delete(i,s),e.unicodeText.utf16===o.utf16)break;e.insert(i,r),n=e.unicodeText.utf16.match(t)}return e}(e,Mh,Vh));return e};const Kh=jh,Mh=/[\r\n]([\u00AD\u2060\u200D\u200C\u200B\s]*[\r\n]){2,}/,Vh="\n\n";var Nh={},zh={};Object.defineProperty(zh,"__esModule",{value:!0}),zh.TAG_REGEX=zh.TRAILING_PUNCTUATION_REGEX=zh.URL_REGEX=zh.MENTION_REGEX=void 0,zh.MENTION_REGEX=/(^|\s|\()(@)([a-zA-Z0-9.-]+)(\b)/g,zh.URL_REGEX=/(^|\s|\()((https?:\/\/[\S]+)|((?<domain>[a-z][a-z0-9]*(\.[a-z0-9]+)+)[\S]*))/gim,zh.TRAILING_PUNCTUATION_REGEX=/\p{P}+$/gu,zh.TAG_REGEX=/(^|\s)[##]((?!\ufe0f)[^\s\u00AD\u2060\u200A\u200B\u200C\u200D\u20e2]*[^\d\s\p{P}\u00AD\u2060\u200A\u200B\u200C\u200D\u20e2]+[^\s\u00AD\u2060\u200A\u200B\u200C\u200D\u20e2]*)?/gu;var Fh=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nh,"__esModule",{value:!0}),Nh.detectFacets=function(e){let t;const r=[];{const n=$h.MENTION_REGEX;for(;t=n.exec(e.utf16);){if(!Gh(t[3])&&!t[3].endsWith(".test"))continue;const n=e.utf16.indexOf(t[3],t.index)-1;r.push({$type:"app.bsky.richtext.facet",index:{byteStart:e.utf16IndexToUtf8Index(n),byteEnd:e.utf16IndexToUtf8Index(n+t[3].length+1)},features:[{$type:"app.bsky.richtext.facet#mention",did:t[3]}]})}}{const n=$h.URL_REGEX;for(;t=n.exec(e.utf16);){let n=t[2];if(!n.startsWith("http")){const e=t.groups?.domain;if(!e||!Gh(e))continue;n=`https://${n}`}const o=e.utf16.indexOf(t[2],t.index),i={start:o,end:o+t[2].length};/[.,;:!?]$/.test(n)&&(n=n.slice(0,-1),i.end--),/[)]$/.test(n)&&!n.includes("(")&&(n=n.slice(0,-1),i.end--),r.push({index:{byteStart:e.utf16IndexToUtf8Index(i.start),byteEnd:e.utf16IndexToUtf8Index(i.end)},features:[{$type:"app.bsky.richtext.facet#link",uri:n}]})}}{const n=$h.TAG_REGEX;for(;t=n.exec(e.utf16);){const n=t[1];let o=t[2];if(!o)continue;if(o=o.trim().replace($h.TRAILING_PUNCTUATION_REGEX,""),0===o.length||o.length>64)continue;const i=t.index+n.length;r.push({index:{byteStart:e.utf16IndexToUtf8Index(i),byteEnd:e.utf16IndexToUtf8Index(i+1+o.length)},features:[{$type:"app.bsky.richtext.facet#tag",tag:o}]})}}return r.length>0?r:void 0};const qh=Fh(["aaa","aarp","abarth","abb","abbott","abbvie","abc","able","abogado","abudhabi","ac","academy","accenture","accountant","accountants","aco","actor","ad","ads","adult","ae","aeg","aero","aetna","af","afl","africa","ag","agakhan","agency","ai","aig","airbus","airforce","airtel","akdn","al","alfaromeo","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","am","amazon","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","ao","aol","apartments","app","apple","aq","aquarelle","ar","arab","aramco","archi","army","arpa","art","arte","as","asda","asia","associates","at","athleta","attorney","au","auction","audi","audible","audio","auspost","author","auto","autos","avianca","aw","aws","ax","axa","az","azure","ba","baby","baidu","banamex","bananarepublic","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bb","bbc","bbt","bbva","bcg","bcn","bd","be","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bf","bg","bh","bharti","bi","bible","bid","bike","bing","bingo","bio","biz","bj","black","blackfriday","blockbuster","blog","bloomberg","blue","bm","bms","bmw","bn","bnpparibas","bo","boats","boehringer","bofa","bom","bond","boo","book","booking","bosch","bostik","boston","bot","boutique","box","br","bradesco","bridgestone","broadway","broker","brother","brussels","bs","bt","build","builders","business","buy","buzz","bv","bw","by","bz","bzh","ca","cab","cafe","cal","call","calvinklein","cam","camera","camp","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","casa","case","cash","casino","cat","catering","catholic","cba","cbn","cbre","cbs","cc","cd","center","ceo","cern","cf","cfa","cfd","cg","ch","chanel","channel","charity","chase","chat","cheap","chintai","christmas","chrome","church","ci","cipriani","circle","cisco","citadel","citi","citic","city","cityeats","ck","cl","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","comcast","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cookingchannel","cool","coop","corsica","country","coupon","coupons","courses","cpa","cr","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","cu","cuisinella","cv","cw","cx","cy","cymru","cyou","cz","dabur","dad","dance","data","date","dating","datsun","day","dclk","dds","de","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dj","dk","dm","dnp","do","docs","doctor","dog","domains","dot","download","drive","dtv","dubai","dunlop","dupont","durban","dvag","dvr","dz","earth","eat","ec","eco","edeka","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","epson","equipment","er","ericsson","erni","es","esq","estate","et","etisalat","eu","eurovision","eus","events","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fi","fiat","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","fj","fk","flickr","flights","flir","florist","flowers","fly","fm","fo","foo","food","foodnetwork","football","ford","forex","forsale","forum","foundation","fox","fr","free","fresenius","frl","frogans","frontdoor","frontier","ftr","fujitsu","fun","fund","furniture","futbol","fyi","ga","gal","gallery","gallo","gallup","game","games","gap","garden","gay","gb","gbiz","gd","gdn","ge","gea","gent","genting","george","gf","gg","ggee","gh","gi","gift","gifts","gives","giving","gl","glass","gle","global","globo","gm","gmail","gmbh","gmo","gmx","gn","godaddy","gold","goldpoint","golf","goo","goodyear","goog","google","gop","got","gov","gp","gq","gr","grainger","graphics","gratis","green","gripe","grocery","group","gs","gt","gu","guardian","gucci","guge","guide","guitars","guru","gw","gy","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hgtv","hiphop","hisamitsu","hitachi","hiv","hk","hkt","hm","hn","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","horse","hospital","host","hosting","hot","hoteles","hotels","hotmail","house","how","hr","hsbc","ht","hu","hughes","hyatt","hyundai","ibm","icbc","ice","icu","id","ie","ieee","ifm","ikano","il","im","imamat","imdb","immo","immobilien","in","inc","industries","infiniti","info","ing","ink","institute","insurance","insure","int","international","intuit","investments","io","ipiranga","iq","ir","irish","is","ismaili","ist","istanbul","it","itau","itv","jaguar","java","jcb","je","jeep","jetzt","jewelry","jio","jll","jm","jmp","jnj","jo","jobs","joburg","jot","joy","jp","jpmorgan","jprs","juegos","juniper","kaufen","kddi","ke","kerryhotels","kerrylogistics","kerryproperties","kfh","kg","kh","ki","kia","kids","kim","kinder","kindle","kitchen","kiwi","km","kn","koeln","komatsu","kosher","kp","kpmg","kpn","kr","krd","kred","kuokgroup","kw","ky","kyoto","kz","la","lacaixa","lamborghini","lamer","lancaster","lancia","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lb","lc","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","li","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","linde","link","lipsy","live","living","lk","llc","llp","loan","loans","locker","locus","loft","lol","london","lotte","lotto","love","lpl","lplfinancial","lr","ls","lt","ltd","ltda","lu","lundbeck","luxe","luxury","lv","ly","ma","macys","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","maserati","mattel","mba","mc","mckinsey","md","me","med","media","meet","melbourne","meme","memorial","men","menu","merckmsd","mg","mh","miami","microsoft","mil","mini","mint","mit","mitsubishi","mk","ml","mlb","mls","mm","mma","mn","mo","mobi","mobile","moda","moe","moi","mom","monash","money","monster","mormon","mortgage","moscow","moto","motorcycles","mov","movie","mp","mq","mr","ms","msd","mt","mtn","mtr","mu","museum","music","mutual","mv","mw","mx","my","mz","na","nab","nagoya","name","natura","navy","nba","nc","ne","nec","net","netbank","netflix","network","neustar","new","news","next","nextdirect","nexus","nf","nfl","ng","ngo","nhk","ni","nico","nike","nikon","ninja","nissan","nissay","nl","no","nokia","northwesternmutual","norton","now","nowruz","nowtv","np","nr","nra","nrw","ntt","nu","nyc","nz","obi","observer","office","okinawa","olayan","olayangroup","oldnavy","ollo","om","omega","one","ong","onl","online","ooo","open","oracle","orange","org","organic","origins","osaka","otsuka","ott","ovh","pa","page","panasonic","paris","pars","partners","parts","party","passagens","pay","pccw","pe","pet","pf","pfizer","pg","ph","pharmacy","phd","philips","phone","photo","photography","photos","physio","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","pk","pl","place","play","playstation","plumbing","plus","pm","pn","pnc","pohl","poker","politie","porn","post","pr","pramerica","praxi","press","prime","pro","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","ps","pt","pub","pw","pwc","py","qa","qpon","quebec","quest","racing","radio","re","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","ril","rio","rip","ro","rocher","rocks","rodeo","rogers","room","rs","rsvp","ru","rugby","ruhr","run","rw","rwe","ryukyu","sa","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sarl","sas","save","saxo","sb","sbi","sbs","sc","sca","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scot","sd","se","search","seat","secure","security","seek","select","sener","services","ses","seven","sew","sex","sexy","sfr","sg","sh","shangrila","sharp","shaw","shell","shia","shiksha","shoes","shop","shopping","shouji","show","showtime","si","silk","sina","singles","site","sj","sk","ski","skin","sky","skype","sl","sling","sm","smart","smile","sn","sncf","so","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","spa","space","sport","spot","sr","srl","ss","st","stada","staples","star","statebank","statefarm","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","su","sucks","supplies","supply","support","surf","surgery","suzuki","sv","swatch","swiss","sx","sy","sydney","systems","sz","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tc","tci","td","tdk","team","tech","technology","tel","temasek","tennis","teva","tf","tg","th","thd","theater","theatre","tiaa","tickets","tienda","tiffany","tips","tires","tirol","tj","tjmaxx","tjx","tk","tkmaxx","tl","tm","tmall","tn","to","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","tr","trade","trading","training","travel","travelchannel","travelers","travelersinsurance","trust","trv","tt","tube","tui","tunes","tushu","tv","tvs","tw","tz","ua","ubank","ubs","ug","uk","unicom","university","uno","uol","ups","us","uy","uz","va","vacations","vana","vanguard","vc","ve","vegas","ventures","verisign","vermögensberater","vermögensberatung","versicherung","vet","vg","vi","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","viva","vivo","vlaanderen","vn","vodka","volkswagen","volvo","vote","voting","voto","voyage","vu","vuelos","wales","walmart","walter","wang","wanggou","watch","watches","weather","weatherchannel","webcam","weber","website","wed","wedding","weibo","weir","wf","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","ws","wtc","wtf","xbox","xerox","xfinity","xihuan","xin","xxx","xyz","yachts","yahoo","yamaxun","yandex","ye","yodobashi","yoga","yokohama","you","youtube","yt","yun","za","zappos","zara","zero","zip","zm","zone","zuerich","zw","ελ","ευ","бг","бел","дети","ею","католик","ком","мкд","мон","москва","онлайн","орг","рус","рф","сайт","срб","укр","қаз","հայ","ישראל","קום","ابوظبي","اتصالات","ارامكو","الاردن","البحرين","الجزائر","السعودية","العليان","المغرب","امارات","ایران","بارت","بازار","بيتك","بھارت","تونس","سودان","سورية","شبكة","عراق","عرب","عمان","فلسطين","قطر","كاثوليك","كوم","مصر","مليسيا","موريتانيا","موقع","همراه","پاکستان","ڀارت","कॉम","नेट","भारत","भारतम्","भारोत","संगठन","বাংলা","ভারত","ভাৰত","ਭਾਰਤ","ભારત","ଭାରତ","இந்தியா","இலங்கை","சிங்கப்பூர்","భారత్","ಭಾರತ","ഭാരതം","ලංකා","คอม","ไทย","ລາວ","გე","みんな","アマゾン","クラウド","グーグル","コム","ストア","セール","ファッション","ポイント","世界","中信","中国","中國","中文网","亚马逊","企业","佛山","信息","健康","八卦","公司","公益","台湾","台灣","商城","商店","商标","嘉里","嘉里大酒店","在线","大拿","天主教","娱乐","家電","广东","微博","慈善","我爱你","手机","招聘","政务","政府","新加坡","新闻","时尚","書籍","机构","淡马锡","游戏","澳門","点看","移动","组织机构","网址","网店","网站","网络","联通","诺基亚","谷歌","购物","通販","集团","電訊盈科","飞利浦","食品","餐厅","香格里拉","香港","닷넷","닷컴","삼성","한국"]),$h=zh;function Gh(e){return!!qh.default.find((t=>{const r=e.lastIndexOf(t);return-1!==r&&("."===e.charAt(r-1)&&r===e.length-t.length)}))}Object.defineProperty(Bh,"__esModule",{value:!0}),Bh.RichText=Bh.RichTextSegment=void 0;const Hh=Kn,Xh=jh,Wh=Ih,Zh=Nh;class Jh{constructor(e,t){Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"facet",{enumerable:!0,configurable:!0,writable:!0,value:t})}get link(){const e=this.facet?.features.find(Hh.AppBskyRichtextFacet.isLink);if(Hh.AppBskyRichtextFacet.isLink(e))return e}isLink(){return!!this.link}get mention(){const e=this.facet?.features.find(Hh.AppBskyRichtextFacet.isMention);if(Hh.AppBskyRichtextFacet.isMention(e))return e}isMention(){return!!this.mention}get tag(){const e=this.facet?.features.find(Hh.AppBskyRichtextFacet.isTag);if(Hh.AppBskyRichtextFacet.isTag(e))return e}isTag(){return!!this.tag}}Bh.RichTextSegment=Jh;class Qh{constructor(e,t){Object.defineProperty(this,"unicodeText",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"facets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.unicodeText=new Xh.UnicodeString(e.text),this.facets=e.facets,!this.facets?.length&&e.entities?.length&&(this.facets=function(e,t){const r=[];for(const n of t)"link"===n.type?r.push({$type:"app.bsky.richtext.facet",index:{byteStart:e.utf16IndexToUtf8Index(n.index.start),byteEnd:e.utf16IndexToUtf8Index(n.index.end)},features:[{$type:"app.bsky.richtext.facet#link",uri:n.value}]}):"mention"===n.type&&r.push({$type:"app.bsky.richtext.facet",index:{byteStart:e.utf16IndexToUtf8Index(n.index.start),byteEnd:e.utf16IndexToUtf8Index(n.index.end)},features:[{$type:"app.bsky.richtext.facet#mention",did:n.value}]});return r}(this.unicodeText,e.entities)),this.facets&&this.facets.sort(Yh),t?.cleanNewlines&&(0,Wh.sanitizeRichText)(this,{cleanNewlines:!0}).copyInto(this)}get text(){return this.unicodeText.toString()}get length(){return this.unicodeText.length}get graphemeLength(){return this.unicodeText.graphemeLength}clone(){return new Qh({text:this.unicodeText.utf16,facets:ey(this.facets)})}copyInto(e){e.unicodeText=this.unicodeText,e.facets=ey(this.facets)}*segments(){const e=this.facets||[];if(!e.length)return void(yield new Jh(this.unicodeText.utf16));let t=0,r=0;do{const n=e[r];if(t<n.index.byteStart)yield new Jh(this.unicodeText.slice(t,n.index.byteStart));else if(t>n.index.byteStart){r++;continue}if(n.index.byteStart<n.index.byteEnd){const e=this.unicodeText.slice(n.index.byteStart,n.index.byteEnd);e.trim()?yield new Jh(e,n):yield new Jh(e)}t=n.index.byteEnd,r++}while(r<e.length);t<this.unicodeText.length&&(yield new Jh(this.unicodeText.slice(t,this.unicodeText.length)))}insert(e,t){if(this.unicodeText=new Xh.UnicodeString(this.unicodeText.slice(0,e)+t+this.unicodeText.slice(e)),!this.facets?.length)return this;const r=t.length;for(const t of this.facets)e<=t.index.byteStart?(t.index.byteStart+=r,t.index.byteEnd+=r):e>=t.index.byteStart&&e<t.index.byteEnd&&(t.index.byteEnd+=r);return this}delete(e,t){if(this.unicodeText=new Xh.UnicodeString(this.unicodeText.slice(0,e)+this.unicodeText.slice(t)),!this.facets?.length)return this;const r=t-e;for(const n of this.facets)e<=n.index.byteStart&&t>=n.index.byteEnd?(n.index.byteStart=0,n.index.byteEnd=0):e>n.index.byteEnd||(e>n.index.byteStart&&e<=n.index.byteEnd&&t>n.index.byteEnd?n.index.byteEnd=e:e>=n.index.byteStart&&t<=n.index.byteEnd?n.index.byteEnd-=r:e<n.index.byteStart&&t>=n.index.byteStart&&t<=n.index.byteEnd?(n.index.byteStart=e,n.index.byteEnd-=r):t<n.index.byteStart&&(n.index.byteStart-=r,n.index.byteEnd-=r));return this.facets=this.facets.filter((e=>e.index.byteStart<e.index.byteEnd)),this}async detectFacets(e){if(this.facets=(0,Zh.detectFacets)(this.unicodeText),this.facets){for(const t of this.facets)for(const r of t.features)if(Hh.AppBskyRichtextFacet.isMention(r)){const t=await e.com.atproto.identity.resolveHandle({handle:r.did}).catch((e=>{})).then((e=>e?.data.did));r.did=t||""}this.facets.sort(Yh)}}detectFacetsWithoutResolution(){this.facets=(0,Zh.detectFacets)(this.unicodeText),this.facets&&this.facets.sort(Yh)}}Bh.RichText=Qh;const Yh=(e,t)=>e.index.byteStart-t.index.byteStart;function ey(e){return void 0===e?e:JSON.parse(JSON.stringify(e))}var ty={},ry={},ny={},oy={};Object.defineProperty(oy,"__esModule",{value:!0}),oy.NOOP_BEHAVIOR=oy.HIDE_BEHAVIOR=oy.MUTEWORD_BEHAVIOR=oy.MUTE_BEHAVIOR=oy.BLOCK_BEHAVIOR=oy.CUSTOM_LABEL_VALUE_RE=void 0,oy.CUSTOM_LABEL_VALUE_RE=/^[a-z-]+$/,oy.BLOCK_BEHAVIOR={profileList:"blur",profileView:"alert",avatar:"blur",banner:"blur",contentList:"blur",contentView:"blur"},oy.MUTE_BEHAVIOR={profileList:"inform",profileView:"alert",contentList:"blur",contentView:"inform"},oy.MUTEWORD_BEHAVIOR={contentList:"blur",contentView:"blur"},oy.HIDE_BEHAVIOR={contentList:"blur",contentView:"blur"},oy.NOOP_BEHAVIOR={};var iy={};Object.defineProperty(iy,"__esModule",{value:!0}),iy.ModerationUI=void 0;iy.ModerationUI=class{constructor(){Object.defineProperty(this,"noOverride",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"filters",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blurs",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"alerts",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"informs",{enumerable:!0,configurable:!0,writable:!0,value:[]})}get filter(){return 0!==this.filters.length}get blur(){return 0!==this.blurs.length}get alert(){return 0!==this.alerts.length}get inform(){return 0!==this.informs.length}};var sy={};Object.defineProperty(sy,"__esModule",{value:!0}),sy.LABELS=sy.DEFAULT_LABEL_SETTINGS=void 0,sy.DEFAULT_LABEL_SETTINGS={porn:"hide",sexual:"warn",nudity:"ignore","graphic-media":"warn"},sy.LABELS={"!hide":{identifier:"!hide",configurable:!1,defaultSetting:"hide",flags:["no-override","no-self"],severity:"alert",blurs:"content",behaviors:{account:{profileList:"blur",profileView:"blur",avatar:"blur",banner:"blur",displayName:"blur",contentList:"blur",contentView:"blur"},profile:{avatar:"blur",banner:"blur",displayName:"blur"},content:{contentList:"blur",contentView:"blur"}},locales:[]},"!warn":{identifier:"!warn",configurable:!1,defaultSetting:"warn",flags:["no-self"],severity:"none",blurs:"content",behaviors:{account:{profileList:"blur",profileView:"blur",avatar:"blur",banner:"blur",contentList:"blur",contentView:"blur"},profile:{avatar:"blur",banner:"blur",displayName:"blur"},content:{contentList:"blur",contentView:"blur"}},locales:[]},"!no-unauthenticated":{identifier:"!no-unauthenticated",configurable:!1,defaultSetting:"hide",flags:["no-override","unauthed"],severity:"none",blurs:"content",behaviors:{account:{profileList:"blur",profileView:"blur",avatar:"blur",banner:"blur",displayName:"blur",contentList:"blur",contentView:"blur"},profile:{avatar:"blur",banner:"blur",displayName:"blur"},content:{contentList:"blur",contentView:"blur"}},locales:[]},porn:{identifier:"porn",configurable:!0,defaultSetting:"hide",flags:["adult"],severity:"none",blurs:"media",behaviors:{account:{avatar:"blur",banner:"blur"},profile:{avatar:"blur",banner:"blur"},content:{contentMedia:"blur"}},locales:[]},sexual:{identifier:"sexual",configurable:!0,defaultSetting:"warn",flags:["adult"],severity:"none",blurs:"media",behaviors:{account:{avatar:"blur",banner:"blur"},profile:{avatar:"blur",banner:"blur"},content:{contentMedia:"blur"}},locales:[]},nudity:{identifier:"nudity",configurable:!0,defaultSetting:"ignore",flags:[],severity:"none",blurs:"media",behaviors:{account:{avatar:"blur",banner:"blur"},profile:{avatar:"blur",banner:"blur"},content:{contentMedia:"blur"}},locales:[]},"graphic-media":{identifier:"graphic-media",flags:["adult"],configurable:!0,defaultSetting:"warn",severity:"none",blurs:"media",behaviors:{account:{avatar:"blur",banner:"blur"},profile:{avatar:"blur",banner:"blur"},content:{contentMedia:"blur"}},locales:[]}},Object.defineProperty(ny,"__esModule",{value:!0}),ny.ModerationDecision=void 0;const ay=oy,cy=iy,ly=sy;var dy;!function(e){e[e.High=0]="High",e[e.Medium=1]="Medium",e[e.Low=2]="Low"}(dy||(dy={}));class uy{constructor(){Object.defineProperty(this,"did",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"isMe",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"causes",{enumerable:!0,configurable:!0,writable:!0,value:[]})}static merge(...e){const t=e.filter((e=>!!e)),r=new uy;return t[0]&&(r.did=t[0].did,r.isMe=t[0].isMe),r.causes=t.flatMap((e=>e.causes)),r}downgrade(){for(const e of this.causes)e.downgraded=!0;return this}get blocked(){return!!this.blockCause}get muted(){return!!this.muteCause}get blockCause(){return this.causes.find((e=>"blocking"===e.type||"blocked-by"===e.type||"block-other"===e.type))}get muteCause(){return this.causes.find((e=>"muted"===e.type))}get labelCauses(){return this.causes.filter((e=>"label"===e.type))}ui(e){const t=new cy.ModerationUI;for(const r of this.causes)if("blocking"===r.type||"blocked-by"===r.type||"block-other"===r.type){if(this.isMe)continue;"profileList"!==e&&"contentList"!==e||t.filters.push(r),r.downgraded||("blur"===ay.BLOCK_BEHAVIOR[e]?(t.noOverride=!0,t.blurs.push(r)):"alert"===ay.BLOCK_BEHAVIOR[e]?t.alerts.push(r):"inform"===ay.BLOCK_BEHAVIOR[e]&&t.informs.push(r))}else if("muted"===r.type){if(this.isMe)continue;"profileList"!==e&&"contentList"!==e||t.filters.push(r),r.downgraded||("blur"===ay.MUTE_BEHAVIOR[e]?t.blurs.push(r):"alert"===ay.MUTE_BEHAVIOR[e]?t.alerts.push(r):"inform"===ay.MUTE_BEHAVIOR[e]&&t.informs.push(r))}else if("mute-word"===r.type){if(this.isMe)continue;"contentList"===e&&t.filters.push(r),r.downgraded||("blur"===ay.MUTEWORD_BEHAVIOR[e]?t.blurs.push(r):"alert"===ay.MUTEWORD_BEHAVIOR[e]?t.alerts.push(r):"inform"===ay.MUTEWORD_BEHAVIOR[e]&&t.informs.push(r))}else"hidden"===r.type?("profileList"!==e&&"contentList"!==e||t.filters.push(r),r.downgraded||("blur"===ay.HIDE_BEHAVIOR[e]?t.blurs.push(r):"alert"===ay.HIDE_BEHAVIOR[e]?t.alerts.push(r):"inform"===ay.HIDE_BEHAVIOR[e]&&t.informs.push(r))):"label"===r.type&&("profileList"===e&&"account"===r.target?"hide"!==r.setting||this.isMe||t.filters.push(r):"contentList"!==e||"account"!==r.target&&"content"!==r.target||"hide"!==r.setting||this.isMe||t.filters.push(r),r.downgraded||("blur"===r.behavior[e]?(t.blurs.push(r),r.noOverride&&!this.isMe&&(t.noOverride=!0)):"alert"===r.behavior[e]?t.alerts.push(r):"inform"===r.behavior[e]&&t.informs.push(r)));return t.filters.sort(py),t.blurs.sort(py),t}setDid(e){this.did=e}setIsMe(e){this.isMe=e}addHidden(e){e&&this.causes.push({type:"hidden",source:{type:"user"},priority:6})}addMutedWord(e){e&&this.causes.push({type:"mute-word",source:{type:"user"},priority:6})}addBlocking(e){e&&this.causes.push({type:"blocking",source:{type:"user"},priority:3})}addBlockingByList(e){e&&this.causes.push({type:"blocking",source:{type:"list",list:e},priority:3})}addBlockedBy(e){e&&this.causes.push({type:"blocked-by",source:{type:"user"},priority:4})}addBlockOther(e){e&&this.causes.push({type:"block-other",source:{type:"user"},priority:4})}addLabel(e,t,r){const n=ay.CUSTOM_LABEL_VALUE_RE.test(t.val)&&r.labelDefs?.[t.src]?.find((e=>e.identifier===t.val))||ly.LABELS[t.val];if(!n)return;const o=t.src===this.did,i=o?void 0:r.prefs.labelers.find((e=>e.did===t.src));if(!o&&!i)return;if(o&&n.flags.includes("no-self"))return;let s,a=n.defaultSetting||"ignore";if(n.configurable?n.flags.includes("adult")&&!r.prefs.adultContentEnabled?a="hide":i?.labels[n.identifier]?a=i?.labels[n.identifier]:r.prefs.labels[n.identifier]&&(a=r.prefs.labels[n.identifier]):a=n.defaultSetting||"hide","ignore"===a)return;if(n.flags.includes("unauthed")&&r.userDid)return;const c=function(e){if(!e)return dy.Low;if("blur"===e.profileView||"blur"===e.contentView)return dy.High;if("blur"===e.contentList||"blur"===e.contentMedia)return dy.Medium;return dy.Low}(n.behaviors[e]);s=n.flags.includes("no-override")||n.flags.includes("adult")&&!r.prefs.adultContentEnabled?1:"hide"===a?2:c===dy.High?5:c===dy.Medium?7:8;let l=!1;(n.flags.includes("no-override")||n.flags.includes("adult")&&!r.prefs.adultContentEnabled)&&(l=!0),this.causes.push({type:"label",source:o||!i?{type:"user"}:{type:"labeler",did:i.did},label:t,labelDef:n,target:e,setting:a,behavior:n.behaviors[e]||ay.NOOP_BEHAVIOR,noOverride:l,priority:s})}addMuted(e){e&&this.causes.push({type:"muted",source:{type:"user"},priority:6})}addMutedByList(e){e&&this.causes.push({type:"muted",source:{type:"list",list:e},priority:6})}}function py(e,t){return e.priority-t.priority}ny.ModerationDecision=uy,Object.defineProperty(ry,"__esModule",{value:!0}),ry.decideAccount=function(e,t){const r=new fy.ModerationDecision;r.setDid(e.did),r.setIsMe(e.did===t.userDid),e.viewer?.muted&&(e.viewer?.mutedByList?r.addMutedByList(e.viewer?.mutedByList):r.addMuted(e.viewer?.muted));e.viewer?.blocking&&(e.viewer?.blockingByList?r.addBlockingByList(e.viewer?.blockingByList):r.addBlocking(e.viewer?.blocking));r.addBlockedBy(e.viewer?.blockedBy);for(const n of hy(e.labels))r.addLabel("account",n,t);return r},ry.filterAccountLabels=hy;const fy=ny;function hy(e){return e?e.filter((e=>!e.uri.endsWith("/app.bsky.actor.profile/self")||"!no-unauthenticated"===e.val)):[]}var yy={};Object.defineProperty(yy,"__esModule",{value:!0}),yy.decideProfile=function(e,t){const r=new my.ModerationDecision;r.setDid(e.did),r.setIsMe(e.did===t.userDid);for(const n of by(e.labels))r.addLabel("profile",n,t);return r},yy.filterProfileLabels=by;const my=ny;function by(e){return e?e.filter((e=>e.uri.endsWith("/app.bsky.actor.profile/self"))):[]}var gy={};Object.defineProperty(gy,"__esModule",{value:!0}),gy.decideNotification=function(e,t){const r=new vy.ModerationDecision;if(r.setDid(e.author.did),r.setIsMe(e.author.did===t.userDid),e.labels?.length)for(const n of e.labels)r.addLabel("content",n,t);return vy.ModerationDecision.merge(r,(0,Ey.decideAccount)(e.author,t),(0,wy.decideProfile)(e.author,t))};const vy=ny,Ey=ry,wy=yy;var Ry={},Ay={};Object.defineProperty(Ay,"__esModule",{value:!0}),Ay.hasMutedWord=function({mutedWords:e,text:t,facets:r,outlineTags:n,languages:o,actor:i}){const s=ky.includes(o?.[0]||""),a=[].concat(n||[]).concat((r||[]).flatMap((e=>e.features.filter(_y.AppBskyRichtextFacet.isTag).map((e=>e.tag))))).map((e=>e.toLowerCase()));for(const r of e){const e=r.value.toLowerCase(),n=t.toLowerCase();if(r.expiresAt&&r.expiresAt<(new Date).toISOString())continue;if("exclude-following"===r.actorTarget&&Boolean(i?.viewer?.following))continue;if(a.includes(e))return!0;if(!r.targets.includes("content"))continue;if((1===e.length||s)&&n.includes(e))return!0;if(e.length>n.length)continue;if(e===n)return!0;if(/(?:\s|\p{P})+?/u.test(e)&&n.includes(e))return!0;const o=n.split(Sy.WORD_BOUNDARY);for(const t of o){if(t===e)return!0;const r=t.replace(Sy.LEADING_TRAILING_PUNCTUATION,"");if(e===r)return!0;if(!(e.length>r.length)&&/\p{P}+/u.test(r)){const t=r.replace(/\p{P}+/gu," ");if(t===e)return!0;if(t.replace(/\s/gu,"")===e)return!0;const n=r.split(/\p{P}+/u);for(const t of n)if(t===e)return!0}}}return!1};const _y=Kn,Sy={LEADING_TRAILING_PUNCTUATION:/(?:^\p{P}+|\p{P}+$)/gu,ESCAPE:/[[\]{}()*+?.\\^$|\s]/g,SEPARATORS:/[/\-–—()[\]_]+/g,WORD_BOUNDARY:/[\s\n\t\r\f\v]+?/g},ky=["ja","zh","ko","th","vi"];Object.defineProperty(Ry,"__esModule",{value:!0}),Ry.decidePost=function(e,t){const r=new Ty.ModerationDecision;if(r.setDid(e.author.did),r.setIsMe(e.author.did===t.userDid),e.labels?.length)for(const n of e.labels)r.addLabel("content",n,t);r.addHidden(function(e,t){if(!t?.length)return!1;if(t.includes(e.uri))return!0;if(e.embed){if(Cy.AppBskyEmbedRecord.isViewRecord(e.embed.record)&&t.includes(e.embed.record.uri))return!0;if(Cy.AppBskyEmbedRecordWithMedia.isView(e.embed)&&Cy.AppBskyEmbedRecord.isViewRecord(e.embed.record.record)&&t.includes(e.embed.record.record.uri))return!0}return!1}(e,t.prefs.hiddenPosts)),r.isMe||r.addMutedWord(function(e,t){if(!t?.length)return!1;const r=e.author;if(Cy.AppBskyFeedPost.isRecord(e.record)){if((0,Ly.hasMutedWord)({mutedWords:t,text:e.record.text,facets:e.record.facets,outlineTags:e.record.tags,languages:e.record.langs,actor:r}))return!0;if(e.record.embed&&Cy.AppBskyEmbedImages.isMain(e.record.embed))for(const n of e.record.embed.images)if((0,Ly.hasMutedWord)({mutedWords:t,text:n.alt,languages:e.record.langs,actor:r}))return!0}if(e.embed)if(Cy.AppBskyEmbedRecord.isViewRecord(e.embed.record)){if(Cy.AppBskyFeedPost.isRecord(e.embed.record.value)){const r=e.embed.record.value,n=e.embed.record.author;if((0,Ly.hasMutedWord)({mutedWords:t,text:r.text,facets:r.facets,outlineTags:r.tags,languages:r.langs,actor:n}))return!0;if(Cy.AppBskyEmbedImages.isMain(r.embed))for(const e of r.embed.images)if((0,Ly.hasMutedWord)({mutedWords:t,text:e.alt,languages:r.langs,actor:n}))return!0;if(Cy.AppBskyEmbedExternal.isMain(r.embed)){const{external:e}=r.embed;if((0,Ly.hasMutedWord)({mutedWords:t,text:e.title+" "+e.description,languages:[],actor:n}))return!0}if(Cy.AppBskyEmbedRecordWithMedia.isMain(r.embed)){if(Cy.AppBskyEmbedExternal.isMain(r.embed.media)){const{external:e}=r.embed.media;if((0,Ly.hasMutedWord)({mutedWords:t,text:e.title+" "+e.description,languages:[],actor:n}))return!0}if(Cy.AppBskyEmbedImages.isMain(r.embed.media))for(const e of r.embed.media.images)if((0,Ly.hasMutedWord)({mutedWords:t,text:e.alt,languages:Cy.AppBskyFeedPost.isRecord(r.record)?r.langs:[],actor:n}))return!0}}}else if(Cy.AppBskyEmbedExternal.isView(e.embed)){const{external:n}=e.embed;if((0,Ly.hasMutedWord)({mutedWords:t,text:n.title+" "+n.description,languages:[],actor:r}))return!0}else if(Cy.AppBskyEmbedRecordWithMedia.isView(e.embed)&&Cy.AppBskyEmbedRecord.isViewRecord(e.embed.record.record)){const r=e.embed.record.record.author;if(Cy.AppBskyFeedPost.isRecord(e.embed.record.record.value)){const n=e.embed.record.record.value;if((0,Ly.hasMutedWord)({mutedWords:t,text:n.text,facets:n.facets,outlineTags:n.tags,languages:n.langs,actor:r}))return!0}if(Cy.AppBskyEmbedImages.isView(e.embed.media))for(const n of e.embed.media.images)if((0,Ly.hasMutedWord)({mutedWords:t,text:n.alt,languages:Cy.AppBskyFeedPost.isRecord(e.record)?e.record.langs:[],actor:r}))return!0;if(Cy.AppBskyEmbedExternal.isView(e.embed.media)){const{external:n}=e.embed.media;if((0,Ly.hasMutedWord)({mutedWords:t,text:n.title+" "+n.description,languages:[],actor:r}))return!0}}return!1}(e,t.prefs.mutedWords));let n;e.embed&&(Cy.AppBskyEmbedRecord.isViewRecord(e.embed.record)?n=By(e.embed.record,t):Cy.AppBskyEmbedRecordWithMedia.isView(e.embed)&&Cy.AppBskyEmbedRecord.isViewRecord(e.embed.record.record)?n=By(e.embed.record.record,t):Cy.AppBskyEmbedRecord.isViewBlocked(e.embed.record)?n=jy(e.embed.record,t):Cy.AppBskyEmbedRecordWithMedia.isView(e.embed)&&Cy.AppBskyEmbedRecord.isViewBlocked(e.embed.record.record)&&(n=jy(e.embed.record.record,t)));return Ty.ModerationDecision.merge(r,n?.downgrade(),(0,Py.decideAccount)(e.author,t),(0,xy.decideProfile)(e.author,t))};const Ty=ny,Cy=Kn,Ly=Ay,Py=ry,xy=yy;function By(e,t){const r=new Ty.ModerationDecision;if(r.setDid(e.author.did),r.setIsMe(e.author.did===t.userDid),e.labels?.length)for(const n of e.labels)r.addLabel("content",n,t);return Ty.ModerationDecision.merge(r,(0,Py.decideAccount)(e.author,t),(0,xy.decideProfile)(e.author,t))}function jy(e,t){const r=new Ty.ModerationDecision;return r.setDid(e.author.did),r.setIsMe(e.author.did===t.userDid),e.author.viewer?.muted&&(e.author.viewer?.mutedByList?r.addMutedByList(e.author.viewer?.mutedByList):r.addMuted(e.author.viewer?.muted)),e.author.viewer?.blocking&&(e.author.viewer?.blockingByList?r.addBlockingByList(e.author.viewer?.blockingByList):r.addBlocking(e.author.viewer?.blocking)),r.addBlockedBy(e.author.viewer?.blockedBy),r}var Dy={};Object.defineProperty(Dy,"__esModule",{value:!0}),Dy.decideFeedGenerator=function(e,t){const r=new Oy.ModerationDecision;if(r.setDid(e.creator.did),r.setIsMe(e.creator.did===t.userDid),e.labels?.length)for(const n of e.labels)r.addLabel("content",n,t);return Oy.ModerationDecision.merge(r,(0,Uy.decideAccount)(e.creator,t),(0,Iy.decideProfile)(e.creator,t))};const Oy=ny,Uy=ry,Iy=yy;var Ky={};Object.defineProperty(Ky,"__esModule",{value:!0}),Ky.decideUserList=function(e,t){const r=new Vy.ModerationDecision,n=(o=e.creator,o&&"object"==typeof o&&"did"in o?e.creator:void 0);var o;if(n){if(r.setDid(n.did),r.setIsMe(n.did===t.userDid),e.labels?.length)for(const n of e.labels)r.addLabel("content",n,t);return Vy.ModerationDecision.merge(r,(0,Ny.decideAccount)(n,t),(0,zy.decideProfile)(n,t))}const i=new My.AtUri(e.uri).hostname;if(r.setDid(i),r.setIsMe(i===t.userDid),e.labels?.length)for(const n of e.labels)r.addLabel("content",n,t);return r};const My=F,Vy=ny,Ny=ry,zy=yy;var Fy={};Object.defineProperty(Fy,"__esModule",{value:!0}),Fy.isQuotedPost=function(e){return Boolean(e&&qy.AppBskyEmbedRecord.isView(e))},Fy.isQuotedPostWithMedia=function(e){return Boolean(e&&qy.AppBskyEmbedRecordWithMedia.isView(e))},Fy.interpretLabelValueDefinition=$y,Fy.interpretLabelValueDefinitions=function(e){return(e.policies?.labelValueDefinitions||[]).filter((e=>qy.ComAtprotoLabelDefs.validateLabelValueDefinition(e).success)).map((t=>$y(t,e.creator.did)))};const qy=Kn;function $y(e,t){const r={account:{},profile:{},content:{}},n="alert"===e.severity?"alert":"inform"===e.severity?"inform":void 0;"content"===e.blurs?(r.account.profileList=n,r.account.profileView=n,r.account.contentList="blur",r.account.contentView=e.adultOnly?"blur":n,r.profile.profileList=n,r.profile.profileView=n,r.content.contentList="blur",r.content.contentView=e.adultOnly?"blur":n):"media"===e.blurs?(r.account.profileList=n,r.account.profileView=n,r.account.avatar="blur",r.account.banner="blur",r.profile.profileList=n,r.profile.profileView=n,r.profile.avatar="blur",r.profile.banner="blur",r.content.contentMedia="blur"):"none"===e.blurs&&(r.account.profileList=n,r.account.profileView=n,r.account.contentList=n,r.account.contentView=n,r.profile.profileList=n,r.profile.profileView=n,r.content.contentList=n,r.content.contentView=n);let o="warn";"hide"!==e.defaultSetting&&"ignore"!==e.defaultSetting||(o=e.defaultSetting);const i=["no-self"];return e.adultOnly&&i.push("adult"),{...e,definedBy:t,configurable:!0,defaultSetting:o,flags:i,behaviors:r}}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.interpretLabelValueDefinitions=e.interpretLabelValueDefinition=e.hasMutedWord=e.ModerationDecision=e.ModerationUI=void 0,e.moderateProfile=function(e,n){return a.ModerationDecision.merge((0,t.decideAccount)(e,n),(0,r.decideProfile)(e,n))},e.moderatePost=function(e,t){return(0,o.decidePost)(e,t)},e.moderateNotification=function(e,t){return(0,n.decideNotification)(e,t)},e.moderateFeedGenerator=function(e,t){return(0,i.decideFeedGenerator)(e,t)},e.moderateUserList=function(e,t){return(0,s.decideUserList)(e,t)};const t=ry,r=yy,n=gy,o=Ry,i=Dy,s=Ky,a=ny;var c=iy;Object.defineProperty(e,"ModerationUI",{enumerable:!0,get:function(){return c.ModerationUI}});var l=ny;Object.defineProperty(e,"ModerationDecision",{enumerable:!0,get:function(){return l.ModerationDecision}});var d=Ay;Object.defineProperty(e,"hasMutedWord",{enumerable:!0,get:function(){return d.hasMutedWord}});var u=Fy;Object.defineProperty(e,"interpretLabelValueDefinition",{enumerable:!0,get:function(){return u.interpretLabelValueDefinition}}),Object.defineProperty(e,"interpretLabelValueDefinitions",{enumerable:!0,get:function(){return u.interpretLabelValueDefinitions}})}(ty);var Gy={};Object.defineProperty(Gy,"__esModule",{value:!0}),Gy.mock=void 0;const Hy="bafyreiclp443lavogvhj3d2ob2cxbfuscni2k5jk7bebjzg7khl3esabwq";Gy.mock={post:({text:e,facets:t,reply:r,embed:n})=>({$type:"app.bsky.feed.post",text:e,facets:t,reply:r,embed:n,langs:["en"],createdAt:(new Date).toISOString()}),postView:({record:e,author:t,embed:r,replyCount:n,repostCount:o,likeCount:i,viewer:s,labels:a})=>({$type:"app.bsky.feed.defs#postView",uri:`at://${t.did}/app.bsky.feed.post/fake`,cid:Hy,author:t,record:e,embed:r,replyCount:n,repostCount:o,likeCount:i,indexedAt:(new Date).toISOString(),viewer:s,labels:a}),embedRecordView:({record:e,author:t,labels:r})=>({$type:"app.bsky.embed.record#view",record:{$type:"app.bsky.embed.record#viewRecord",uri:`at://${t.did}/app.bsky.feed.post/fake`,cid:Hy,author:t,value:e,labels:r,indexedAt:(new Date).toISOString()}}),profileViewBasic:({handle:e,displayName:t,description:r,viewer:n,labels:o})=>({did:`did:web:${e}`,handle:e,displayName:t,description:r,viewer:n,labels:o}),actorViewerState:({muted:e,mutedByList:t,blockedBy:r,blocking:n,blockingByList:o,following:i,followedBy:s})=>({muted:e,mutedByList:t,blockedBy:r,blocking:n,blockingByList:o,following:i,followedBy:s}),listViewBasic:({name:e})=>({uri:"at://did:plc:fake/app.bsky.graph.list/fake",cid:Hy,name:e,purpose:"app.bsky.graph.defs#modlist",indexedAt:(new Date).toISOString()}),replyNotification:({author:e,record:t,labels:r})=>({uri:`at://${e.did}/app.bsky.feed.post/fake`,cid:Hy,author:e,reason:"reply",reasonSubject:`at://${e.did}/app.bsky.feed.post/fake-parent`,record:t,isRead:!1,indexedAt:(new Date).toISOString(),labels:r}),followNotification:({author:e,subjectDid:t,labels:r})=>({uri:`at://${e.did}/app.bsky.graph.follow/fake`,cid:Hy,author:e,reason:"follow",record:{$type:"app.bsky.graph.follow",createdAt:(new Date).toISOString(),subject:t},isRead:!1,indexedAt:(new Date).toISOString(),labels:r}),label:({val:e,uri:t,src:r})=>({src:r||"did:plc:fake-labeler",uri:t,val:e,cts:(new Date).toISOString()})};var Xy,Wy,Zy={},Jy={},Qy=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},Yy=e&&e.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r};Object.defineProperty(Jy,"__esModule",{value:!0});Jy.default=class{constructor(){Xy.set(this,!1),Wy.set(this,new Set)}get acquired(){return Qy(this,Xy,"f")}acquireAsync({timeout:e}={}){if(!Qy(this,Xy,"f"))return Yy(this,Xy,!0,"f"),Promise.resolve();if(null==e)return new Promise((e=>{Qy(this,Wy,"f").add(e)}));let t,r;return Promise.race([new Promise((e=>{t=()=>{clearTimeout(r),e()},Qy(this,Wy,"f").add(t)})),new Promise(((n,o)=>{r=setTimeout((()=>{Qy(this,Wy,"f").delete(t),o(new Error("Timed out waiting for lock"))}),e)}))])}tryAcquire(){return!Qy(this,Xy,"f")&&(Yy(this,Xy,!0,"f"),!0)}release(){if(!Qy(this,Xy,"f"))throw new Error("Cannot release an unacquired lock");if(Qy(this,Wy,"f").size>0){const[e]=Qy(this,Wy,"f");Qy(this,Wy,"f").delete(e),e()}else Yy(this,Xy,!1,"f")}},Xy=new WeakMap,Wy=new WeakMap;var em,tm=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},rm=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zy,"__esModule",{value:!0}),Zy.Agent=void 0;const nm=le,om=F,im=Mn,sm=rm(Jy),am=Kn,cm=Dn,lm=Un,dm=ty,um=sy,pm=In,fm={hideReplies:!1,hideRepliesByUnfollowed:!0,hideRepliesByLikeCount:0,hideReposts:!1,hideQuotePosts:!1},hm={sort:"oldest",prioritizeFollowedUsers:!0};class ym extends im.XrpcClient{static configure(e){e.appLabelers&&(this.appLabelers=e.appLabelers.map(pm.asDid))}get xrpc(){return this}constructor(e){const t=(0,im.buildFetchHandler)(e);super(((e,r)=>{const n=new Headers(r?.headers);return this.proxy&&!n.has("atproto-proxy")&&n.set("atproto-proxy",this.proxy),n.set("atproto-accept-labelers",[...this.appLabelers.map((e=>`${e};redact`)),...this.labelers,n.get("atproto-accept-labelers")?.trim()].filter(Boolean).join(", ")),t(e,{...r,headers:n})}),cm.schemas),Object.defineProperty(this,"sessionManager",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"com",{enumerable:!0,configurable:!0,writable:!0,value:new am.ComNS(this)}),Object.defineProperty(this,"app",{enumerable:!0,configurable:!0,writable:!0,value:new am.AppNS(this)}),Object.defineProperty(this,"chat",{enumerable:!0,configurable:!0,writable:!0,value:new am.ChatNS(this)}),Object.defineProperty(this,"tools",{enumerable:!0,configurable:!0,writable:!0,value:new am.ToolsNS(this)}),Object.defineProperty(this,"labelers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"proxy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"uploadBlob",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.com.atproto.repo.uploadBlob(e,t)}),Object.defineProperty(this,"resolveHandle",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.com.atproto.identity.resolveHandle(e,t)}),Object.defineProperty(this,"updateHandle",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.com.atproto.identity.updateHandle(e,t)}),Object.defineProperty(this,"createModerationReport",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.com.atproto.moderation.createReport(e,t)}),Object.defineProperty(this,"getTimeline",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.feed.getTimeline(e,t)}),Object.defineProperty(this,"getAuthorFeed",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.feed.getAuthorFeed(e,t)}),Object.defineProperty(this,"getActorLikes",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.feed.getActorLikes(e,t)}),Object.defineProperty(this,"getPostThread",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.feed.getPostThread(e,t)}),Object.defineProperty(this,"getPost",{enumerable:!0,configurable:!0,writable:!0,value:e=>this.app.bsky.feed.post.get(e)}),Object.defineProperty(this,"getPosts",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.feed.getPosts(e,t)}),Object.defineProperty(this,"getLikes",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.feed.getLikes(e,t)}),Object.defineProperty(this,"getRepostedBy",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.feed.getRepostedBy(e,t)}),Object.defineProperty(this,"getFollows",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.graph.getFollows(e,t)}),Object.defineProperty(this,"getFollowers",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.graph.getFollowers(e,t)}),Object.defineProperty(this,"getProfile",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.actor.getProfile(e,t)}),Object.defineProperty(this,"getProfiles",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.actor.getProfiles(e,t)}),Object.defineProperty(this,"getSuggestions",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.actor.getSuggestions(e,t)}),Object.defineProperty(this,"searchActors",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.actor.searchActors(e,t)}),Object.defineProperty(this,"searchActorsTypeahead",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.actor.searchActorsTypeahead(e,t)}),Object.defineProperty(this,"listNotifications",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.notification.listNotifications(e,t)}),Object.defineProperty(this,"countUnreadNotifications",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.notification.getUnreadCount(e,t)}),Object.defineProperty(this,"getLabelers",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>this.app.bsky.labeler.getServices(e,t)}),em.set(this,new sm.default)}clone(){return this.copyInto(new ym(this.sessionManager))}copyInto(e){e.configureLabelers(this.labelers),e.configureProxy(this.proxy??null),e.clearHeaders();for(const[t,r]of this.headers)e.setHeader(t,r);return e}withProxy(e,t){const r=this.clone();return r.configureProxy(`${(0,pm.asDid)(t)}#${e}`),r}get appLabelers(){return this.constructor.appLabelers}configureLabelers(e){this.labelers=e.map(pm.asDid)}configureLabelersHeader(e){this.configureLabelers(e.filter(pm.isDid))}configureProxy(e){if(null===e)this.proxy=void 0;else{if(!(0,pm.isDid)(e))throw new TypeError("Invalid proxy DID");this.proxy=e}}configureProxyHeader(e,t){(0,pm.isDid)(t)&&this.configureProxy(`${t}#${e}`)}get did(){return this.sessionManager.did}get accountDid(){return this.assertDid}get assertDid(){return this.assertAuthenticated(),this.did}assertAuthenticated(){if(!this.did)throw new Error("Not logged in")}get api(){return this}async getLabelDefinitions(e){const t=[...this.appLabelers];var r;(r=e)&&"object"==typeof r&&"moderationPrefs"in r&&gm(r.moderationPrefs)?t.push(...e.moderationPrefs.labelers.map((e=>e.did))):gm(e)?t.push(...e.labelers.map((e=>e.did))):t.push(...e);const n=await this.getLabelers({dids:t,detailed:!0}),o={};if(n.data)for(const e of n.data.views)o[e.creator.did]=(0,dm.interpretLabelValueDefinitions)(e);return o}async post(e){return e.createdAt||(e.createdAt=(new Date).toISOString()),this.app.bsky.feed.post.create({repo:this.accountDid},e)}async deletePost(e){this.assertAuthenticated();const t=new om.AtUri(e);return this.app.bsky.feed.post.delete({repo:t.hostname,rkey:t.rkey})}async like(e,t){return this.app.bsky.feed.like.create({repo:this.accountDid},{subject:{uri:e,cid:t},createdAt:(new Date).toISOString()})}async deleteLike(e){this.assertAuthenticated();const t=new om.AtUri(e);return this.app.bsky.feed.like.delete({repo:t.hostname,rkey:t.rkey})}async repost(e,t){return this.app.bsky.feed.repost.create({repo:this.accountDid},{subject:{uri:e,cid:t},createdAt:(new Date).toISOString()})}async deleteRepost(e){this.assertAuthenticated();const t=new om.AtUri(e);return this.app.bsky.feed.repost.delete({repo:t.hostname,rkey:t.rkey})}async follow(e){return this.app.bsky.graph.follow.create({repo:this.accountDid},{subject:e,createdAt:(new Date).toISOString()})}async deleteFollow(e){this.assertAuthenticated();const t=new om.AtUri(e);return this.app.bsky.graph.follow.delete({repo:t.hostname,rkey:t.rkey})}async upsertProfile(e){const t=this.accountDid;let r=5;for(;r>=0;){const n=await this.com.atproto.repo.getRecord({repo:t,collection:"app.bsky.actor.profile",rkey:"self"}).catch((e=>{})),o=await e(n?.data.value);o&&(o.$type="app.bsky.actor.profile");const i=am.AppBskyActorProfile.validateRecord(o);if(!i.success)throw i.error;try{await this.com.atproto.repo.putRecord({repo:t,collection:"app.bsky.actor.profile",rkey:"self",record:o,swapRecord:n?.data.cid||null})}catch(e){if(r>0&&e instanceof am.ComAtprotoRepoPutRecord.InvalidSwapError){r--;continue}throw e}break}}async mute(e){return this.app.bsky.graph.muteActor({actor:e})}async unmute(e){return this.app.bsky.graph.unmuteActor({actor:e})}async muteModList(e){return this.app.bsky.graph.muteActorList({list:e})}async unmuteModList(e){return this.app.bsky.graph.unmuteActorList({list:e})}async blockModList(e){return this.app.bsky.graph.listblock.create({repo:this.accountDid},{subject:e,createdAt:(new Date).toISOString()})}async unblockModList(e){const t=this.accountDid,r=await this.app.bsky.graph.getList({list:e,limit:1}),n=r.data.list.viewer?.blocked;if(n){const{rkey:e}=new om.AtUri(n);return this.app.bsky.graph.listblock.delete({repo:t,rkey:e})}}async updateSeenNotifications(e=(new Date).toISOString()){return this.app.bsky.notification.updateSeen({seenAt:e})}async getPreferences(){const e={feeds:{saved:void 0,pinned:void 0},savedFeeds:void 0,feedViewPrefs:{home:{...fm}},threadViewPrefs:{...hm},moderationPrefs:{adultContentEnabled:!1,labels:{...um.DEFAULT_LABEL_SETTINGS},labelers:this.appLabelers.map((e=>({did:e,labels:{}}))),mutedWords:[],hiddenPosts:[]},birthDate:void 0,interests:{tags:[]},bskyAppState:{queuedNudges:[],activeProgressGuide:void 0,nuxs:[]}},t=await this.app.bsky.actor.getPreferences({}),r=[];for(const n of t.data.preferences)if(am.AppBskyActorDefs.isAdultContentPref(n)&&am.AppBskyActorDefs.validateAdultContentPref(n).success)e.moderationPrefs.adultContentEnabled=n.enabled;else if(am.AppBskyActorDefs.isContentLabelPref(n)&&am.AppBskyActorDefs.validateContentLabelPref(n).success){const e=mm(n);r.push(e)}else if(am.AppBskyActorDefs.isLabelersPref(n)&&am.AppBskyActorDefs.validateLabelersPref(n).success)e.moderationPrefs.labelers=this.appLabelers.map((e=>({did:e,labels:{}}))).concat(n.labelers.map((e=>({...e,labels:{}}))));else if(am.AppBskyActorDefs.isSavedFeedsPrefV2(n)&&am.AppBskyActorDefs.validateSavedFeedsPrefV2(n).success)e.savedFeeds=n.items;else if(am.AppBskyActorDefs.isSavedFeedsPref(n)&&am.AppBskyActorDefs.validateSavedFeedsPref(n).success)e.feeds.saved=n.saved,e.feeds.pinned=n.pinned;else if(am.AppBskyActorDefs.isPersonalDetailsPref(n)&&am.AppBskyActorDefs.validatePersonalDetailsPref(n).success)n.birthDate&&(e.birthDate=new Date(n.birthDate));else if(am.AppBskyActorDefs.isFeedViewPref(n)&&am.AppBskyActorDefs.validateFeedViewPref(n).success){const{$type:t,feed:r,...o}=n;e.feedViewPrefs[n.feed]={...fm,...o}}else if(am.AppBskyActorDefs.isThreadViewPref(n)&&am.AppBskyActorDefs.validateThreadViewPref(n).success){const{$type:t,...r}=n;e.threadViewPrefs={...e.threadViewPrefs,...r}}else if(am.AppBskyActorDefs.isInterestsPref(n)&&am.AppBskyActorDefs.validateInterestsPref(n).success){const{$type:t,...r}=n;e.interests={...e.interests,...r}}else if(am.AppBskyActorDefs.isMutedWordsPref(n)&&am.AppBskyActorDefs.validateMutedWordsPref(n).success){const{$type:t,...r}=n;e.moderationPrefs.mutedWords=r.items,e.moderationPrefs.mutedWords.length&&(e.moderationPrefs.mutedWords=e.moderationPrefs.mutedWords.map((e=>(e.actorTarget=e.actorTarget||"all",e))))}else if(am.AppBskyActorDefs.isHiddenPostsPref(n)&&am.AppBskyActorDefs.validateHiddenPostsPref(n).success){const{$type:t,...r}=n;e.moderationPrefs.hiddenPosts=r.items}else if(am.AppBskyActorDefs.isBskyAppStatePref(n)&&am.AppBskyActorDefs.validateBskyAppStatePref(n).success){const{$type:t,...r}=n;e.bskyAppState.queuedNudges=r.queuedNudges||[],e.bskyAppState.activeProgressGuide=r.activeProgressGuide,e.bskyAppState.nuxs=r.nuxs||[]}if(null==e.savedFeeds){const{saved:t,pinned:r}=e.feeds;if(t&&r){const n=new Map;n.set("timeline",{id:nm.TID.nextStr(),type:"timeline",value:"following",pinned:!0});for(const e of r){const t=(0,pm.getSavedFeedType)(e);"unknown"!==t&&n.set(e,{id:nm.TID.nextStr(),type:t,value:e,pinned:!0})}for(const e of t)if(!n.has(e)){const t=(0,pm.getSavedFeedType)(e);if("unknown"===t)continue;n.set(e,{id:nm.TID.nextStr(),type:t,value:e,pinned:!1})}e.savedFeeds=Array.from(n.values())}else e.savedFeeds=[{id:nm.TID.nextStr(),type:"timeline",value:"following",pinned:!0}];await this.overwriteSavedFeeds(e.savedFeeds)}for(const t of r)if(t.labelerDid){const r=e.moderationPrefs.labelers.find((e=>e.did===t.labelerDid));if(!r)continue;r.labels[t.label]=t.visibility}else e.moderationPrefs.labels[t.label]=t.visibility;return e.moderationPrefs.labels=function(e){const t={...e},r={gore:"graphic-media",nsfw:"porn",suggestive:"sexual"};for(const e in t){const n=r[e];n&&(t[n]=t[e])}return t}(e.moderationPrefs.labels),this.configureLabelers(bm(t.data.preferences)),e}async overwriteSavedFeeds(e){e.forEach(pm.validateSavedFeed);const t=new Map;return e.forEach((e=>{t.has(e.id)&&t.delete(e.id),t.set(e.id,e)})),this.updateSavedFeedsV2Preferences((()=>Array.from(t.values())))}async updateSavedFeeds(e){return e.map(pm.validateSavedFeed),this.updateSavedFeedsV2Preferences((t=>t.map((t=>{const r=e.find((e=>t.id===e.id));return r?{...t,pinned:r.pinned}:t}))))}async addSavedFeeds(e){const t=e.map((e=>({...e,id:nm.TID.nextStr()})));return t.forEach(pm.validateSavedFeed),this.updateSavedFeedsV2Preferences((e=>[...e,...t]))}async removeSavedFeeds(e){return this.updateSavedFeedsV2Preferences((t=>[...t.filter((t=>!e.find((e=>t.id===e))))]))}async setSavedFeeds(e,t){return this.updateFeedPreferences((()=>({saved:e,pinned:t})))}async addSavedFeed(e){return this.updateFeedPreferences(((t,r)=>({saved:[...t.filter((t=>t!==e)),e],pinned:r})))}async removeSavedFeed(e){return this.updateFeedPreferences(((t,r)=>({saved:t.filter((t=>t!==e)),pinned:r.filter((t=>t!==e))})))}async addPinnedFeed(e){return this.updateFeedPreferences(((t,r)=>({saved:[...t.filter((t=>t!==e)),e],pinned:[...r.filter((t=>t!==e)),e]})))}async removePinnedFeed(e){return this.updateFeedPreferences(((t,r)=>({saved:t,pinned:r.filter((t=>t!==e))})))}async setAdultContentEnabled(e){await this.updatePreferences((t=>{let r=t.findLast((e=>am.AppBskyActorDefs.isAdultContentPref(e)&&am.AppBskyActorDefs.validateAdultContentPref(e).success));return r?r.enabled=e:r={$type:"app.bsky.actor.defs#adultContentPref",enabled:e},t.filter((e=>!am.AppBskyActorDefs.isAdultContentPref(e))).concat([r])}))}async setContentLabelPref(e,t,r){r&&(0,om.ensureValidDid)(r),await this.updatePreferences((n=>{let o,i=n.findLast((t=>am.AppBskyActorDefs.isContentLabelPref(t)&&am.AppBskyActorDefs.validateContentLabelPref(t).success&&t.label===e&&t.labelerDid===r));if(i?i.visibility=t:i={$type:"app.bsky.actor.defs#contentLabelPref",label:e,labelerDid:r,visibility:t},am.AppBskyActorDefs.isContentLabelPref(i)&&!i.labelerDid){const e={"graphic-media":"gore",porn:"nsfw",sexual:"suggestive"}[i.label];e&&(o=n.findLast((t=>am.AppBskyActorDefs.isContentLabelPref(t)&&am.AppBskyActorDefs.validateContentLabelPref(t).success&&t.label===e&&void 0===t.labelerDid)),o?o.visibility=t:o={$type:"app.bsky.actor.defs#contentLabelPref",label:e,labelerDid:void 0,visibility:t})}return n.filter((t=>!am.AppBskyActorDefs.isContentLabelPref(t)||!(t.label===e&&t.labelerDid===r))).concat([i]).filter((e=>!o||(!am.AppBskyActorDefs.isContentLabelPref(e)||!(e.label===o.label&&void 0===e.labelerDid)))).concat(o?[o]:[])}))}async addLabeler(e){const t=await this.updatePreferences((t=>{let r=t.findLast((e=>am.AppBskyActorDefs.isLabelersPref(e)&&am.AppBskyActorDefs.validateLabelersPref(e).success));if(r||(r={$type:"app.bsky.actor.defs#labelersPref",labelers:[]}),am.AppBskyActorDefs.isLabelersPref(r)){let t=r.labelers.find((t=>t.did===e));t||(t={did:e},r.labelers.push(t))}return t.filter((e=>!am.AppBskyActorDefs.isLabelersPref(e))).concat([r])}));this.configureLabelers(bm(t))}async removeLabeler(e){const t=await this.updatePreferences((t=>{let r=t.findLast((e=>am.AppBskyActorDefs.isLabelersPref(e)&&am.AppBskyActorDefs.validateLabelersPref(e).success));return r||(r={$type:"app.bsky.actor.defs#labelersPref",labelers:[]}),am.AppBskyActorDefs.isLabelersPref(r)&&(r.labelers=r.labelers.filter((t=>t.did!==e))),t.filter((e=>!am.AppBskyActorDefs.isLabelersPref(e))).concat([r])}));this.configureLabelers(bm(t))}async setPersonalDetails({birthDate:e}){e=e instanceof Date?e.toISOString():e,await this.updatePreferences((t=>{let r=t.findLast((e=>am.AppBskyActorDefs.isPersonalDetailsPref(e)&&am.AppBskyActorDefs.validatePersonalDetailsPref(e).success));return r?r.birthDate=e:r={$type:"app.bsky.actor.defs#personalDetailsPref",birthDate:e},t.filter((e=>!am.AppBskyActorDefs.isPersonalDetailsPref(e))).concat([r])}))}async setFeedViewPrefs(e,t){await this.updatePreferences((r=>{const n=r.findLast((t=>am.AppBskyActorDefs.isFeedViewPref(t)&&am.AppBskyActorDefs.validateFeedViewPref(t).success&&t.feed===e));return n&&(t={...n,...t}),r.filter((r=>!am.AppBskyActorDefs.isFeedViewPref(t)||r.feed!==e)).concat([{...t,$type:"app.bsky.actor.defs#feedViewPref",feed:e}])}))}async setThreadViewPrefs(e){await this.updatePreferences((t=>{const r=t.findLast((e=>am.AppBskyActorDefs.isThreadViewPref(e)&&am.AppBskyActorDefs.validateThreadViewPref(e).success));return r&&(e={...r,...e}),t.filter((e=>!am.AppBskyActorDefs.isThreadViewPref(e))).concat([{...e,$type:"app.bsky.actor.defs#threadViewPref"}])}))}async setInterestsPref(e){await this.updatePreferences((t=>{const r=t.findLast((e=>am.AppBskyActorDefs.isInterestsPref(e)&&am.AppBskyActorDefs.validateInterestsPref(e).success));return r&&(e={...r,...e}),t.filter((e=>!am.AppBskyActorDefs.isInterestsPref(e))).concat([{...e,$type:"app.bsky.actor.defs#interestsPref"}])}))}async addMutedWord(e){const t=(0,pm.sanitizeMutedWordValue)(e.value);t&&await this.updatePreferences((r=>{let n=r.findLast((e=>am.AppBskyActorDefs.isMutedWordsPref(e)&&am.AppBskyActorDefs.validateMutedWordsPref(e).success));const o={id:nm.TID.nextStr(),value:t,targets:e.targets||[],actorTarget:e.actorTarget||"all",expiresAt:e.expiresAt||void 0};return n&&am.AppBskyActorDefs.isMutedWordsPref(n)?(n.items.push(o),n.items=vm(n.items)):n={items:[o]},r.filter((e=>!am.AppBskyActorDefs.isMutedWordsPref(e))).concat([{...n,$type:"app.bsky.actor.defs#mutedWordsPref"}])}))}async addMutedWords(e){await Promise.all(e.map((e=>this.addMutedWord(e))))}async upsertMutedWords(e){await this.addMutedWords(e)}async updateMutedWord(e){await this.updatePreferences((t=>{const r=t.findLast((e=>am.AppBskyActorDefs.isMutedWordsPref(e)&&am.AppBskyActorDefs.validateMutedWordsPref(e).success));return r&&am.AppBskyActorDefs.isMutedWordsPref(r)?(r.items=r.items.map((t=>{if(Em(t,e)){const r={...t,...e};return{id:t.id||nm.TID.nextStr(),value:(0,pm.sanitizeMutedWordValue)(r.value)||t.value,targets:r.targets||[],actorTarget:r.actorTarget||"all",expiresAt:r.expiresAt||void 0}}return t})),r.items=vm(r.items),t.filter((e=>!am.AppBskyActorDefs.isMutedWordsPref(e))).concat([{...r,$type:"app.bsky.actor.defs#mutedWordsPref"}])):t}))}async removeMutedWord(e){await this.updatePreferences((t=>{const r=t.findLast((e=>am.AppBskyActorDefs.isMutedWordsPref(e)&&am.AppBskyActorDefs.validateMutedWordsPref(e).success));if(r&&am.AppBskyActorDefs.isMutedWordsPref(r)){for(let t=0;t<r.items.length;t++){if(Em(r.items[t],e)){r.items.splice(t,1);break}}return r.items=vm(r.items),t.filter((e=>!am.AppBskyActorDefs.isMutedWordsPref(e))).concat([{...r,$type:"app.bsky.actor.defs#mutedWordsPref"}])}return t}))}async removeMutedWords(e){await Promise.all(e.map((e=>this.removeMutedWord(e))))}async hidePost(e){await this.updateHiddenPost(e,"hide")}async unhidePost(e){await this.updateHiddenPost(e,"unhide")}async bskyAppQueueNudges(e){await this.updatePreferences((t=>{let r=t.findLast((e=>am.AppBskyActorDefs.isBskyAppStatePref(e)&&am.AppBskyActorDefs.validateBskyAppStatePref(e).success));return r=r||{},e=Array.isArray(e)?e:[e],r.queuedNudges=(r.queuedNudges||[]).concat(e),t.filter((e=>!am.AppBskyActorDefs.isBskyAppStatePref(e))).concat([{...r,$type:"app.bsky.actor.defs#bskyAppStatePref"}])}))}async bskyAppDismissNudges(e){await this.updatePreferences((t=>{let r=t.findLast((e=>am.AppBskyActorDefs.isBskyAppStatePref(e)&&am.AppBskyActorDefs.validateBskyAppStatePref(e).success));return r=r||{},e=Array.isArray(e)?e:[e],r.queuedNudges=(r.queuedNudges||[]).filter((t=>!e.includes(t))),t.filter((e=>!am.AppBskyActorDefs.isBskyAppStatePref(e))).concat([{...r,$type:"app.bsky.actor.defs#bskyAppStatePref"}])}))}async bskyAppSetActiveProgressGuide(e){if(e&&!am.AppBskyActorDefs.validateBskyAppProgressGuide(e).success)throw new Error("Invalid progress guide");await this.updatePreferences((t=>{let r=t.findLast((e=>am.AppBskyActorDefs.isBskyAppStatePref(e)&&am.AppBskyActorDefs.validateBskyAppStatePref(e).success));return r=r||{},r.activeProgressGuide=e,t.filter((e=>!am.AppBskyActorDefs.isBskyAppStatePref(e))).concat([{...r,$type:"app.bsky.actor.defs#bskyAppStatePref"}])}))}async bskyAppUpsertNux(e){(0,pm.validateNux)(e),await this.updatePreferences((t=>{let r=t.findLast((e=>am.AppBskyActorDefs.isBskyAppStatePref(e)&&am.AppBskyActorDefs.validateBskyAppStatePref(e).success));r=r||{},r.nuxs=r.nuxs||[];const n=r.nuxs?.find((t=>t.id===e.id));let o;return o=n?{id:n.id,completed:e.completed,data:e.data,expiresAt:e.expiresAt}:e,r.nuxs=r.nuxs.filter((t=>t.id!==e.id)).concat(o),t.filter((e=>!am.AppBskyActorDefs.isBskyAppStatePref(e))).concat([{...r,$type:"app.bsky.actor.defs#bskyAppStatePref"}])}))}async bskyAppRemoveNuxs(e){await this.updatePreferences((t=>{let r=t.findLast((e=>am.AppBskyActorDefs.isBskyAppStatePref(e)&&am.AppBskyActorDefs.validateBskyAppStatePref(e).success));return r=r||{},r.nuxs=(r.nuxs||[]).filter((t=>!e.includes(t.id))),t.filter((e=>!am.AppBskyActorDefs.isBskyAppStatePref(e))).concat([{...r,$type:"app.bsky.actor.defs#bskyAppStatePref"}])}))}async updatePreferences(e){try{await tm(this,em,"f").acquireAsync();const t=await this.app.bsky.actor.getPreferences({}),r=e(t.data.preferences);return!1===r?t.data.preferences:(await this.app.bsky.actor.putPreferences({preferences:r}),r)}finally{tm(this,em,"f").release()}}async updateHiddenPost(e,t){await this.updatePreferences((r=>{let n=r.findLast((e=>am.AppBskyActorDefs.isHiddenPostsPref(e)&&am.AppBskyActorDefs.validateHiddenPostsPref(e).success));return n&&am.AppBskyActorDefs.isHiddenPostsPref(n)?n.items="hide"===t?Array.from(new Set([...n.items,e])):n.items.filter((t=>t!==e)):"hide"===t&&(n={$type:"app.bsky.actor.defs#hiddenPostsPref",items:[e]}),r.filter((e=>!am.AppBskyActorDefs.isInterestsPref(e))).concat([{...n,$type:"app.bsky.actor.defs#hiddenPostsPref"}])}))}async updateFeedPreferences(e){let t;return await this.updatePreferences((r=>{let n=r.findLast((e=>am.AppBskyActorDefs.isSavedFeedsPref(e)&&am.AppBskyActorDefs.validateSavedFeedsPref(e).success));return n?(t=e(n.saved,n.pinned),n.saved=t.saved,n.pinned=t.pinned):(t=e([],[]),n={$type:"app.bsky.actor.defs#savedFeedsPref",saved:t.saved,pinned:t.pinned}),r.filter((e=>!am.AppBskyActorDefs.isSavedFeedsPref(e))).concat([n])})),t}async updateSavedFeedsV2Preferences(e){let t=[];return await this.updatePreferences((r=>{let n=r.findLast((e=>am.AppBskyActorDefs.isSavedFeedsPrefV2(e)&&am.AppBskyActorDefs.validateSavedFeedsPrefV2(e).success)),o=r.findLast((e=>am.AppBskyActorDefs.isSavedFeedsPref(e)&&am.AppBskyActorDefs.validateSavedFeedsPref(e).success));n?(t=e(n.items),n={...n,items:t}):(t=e([]),n={$type:"app.bsky.actor.defs#savedFeedsPrefV2",items:t});const i=n.items.filter((e=>e.pinned)),s=n.items.filter((e=>!e.pinned));n.items=i.concat(s);let a=r.filter((e=>!am.AppBskyActorDefs.isSavedFeedsPrefV2(e))).concat(n);if(o){const{saved:e,pinned:t}=o,r=(0,pm.savedFeedsToUriArrays)(n.items.filter((e=>["feed","list"].includes(e.type))));o={...o,saved:Array.from(new Set([...e,...r.saved])),pinned:Array.from(new Set([...t,...r.pinned]))},a=a.filter((e=>!am.AppBskyActorDefs.isSavedFeedsPref(e))).concat(o)}return a})),t}}function mm(e){let t=e.visibility;return"show"===t&&(t="ignore"),{...e,visibility:t}}function bm(e){const t=e.findLast((e=>am.AppBskyActorDefs.isLabelersPref(e)&&am.AppBskyActorDefs.validateLabelersPref(e).success));let r=[];return t&&(r=t.labelers.map((e=>e.did))),r}function gm(e){return e&&"object"==typeof e&&"labelers"in e}function vm(e){return e.map((e=>({...e,id:e.id||nm.TID.nextStr()})))}function Em(e,t){const r=e.id,n=r&&r===t.id,o=!r&&e.value===t.value;return n||o}Zy.Agent=ym,em=new WeakMap,Object.defineProperty(ym,"appLabelers",{enumerable:!0,configurable:!0,writable:!0,value:[lm.BSKY_LABELER_DID]});var wm={};Object.defineProperty(wm,"__esModule",{value:!0}),wm.CredentialSession=wm.AtpAgent=void 0;const Rm=le,Am=Mn,_m=Zy,Sm=Kn,km=Dn,Tm=globalThis.ReadableStream;class Cm extends _m.Agent{constructor(e){const t=e instanceof Lm?e:new Lm(new URL(e.service),e.fetch,e.persistSession);if(super(t),Object.defineProperty(this,"sessionManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.sessionManager=t,!(e instanceof Lm)&&e.headers)for(const[t,r]of e.headers)this.setHeader(t,r)}clone(){return this.copyInto(new Cm(this.sessionManager))}get session(){return this.sessionManager.session}get hasSession(){return this.sessionManager.hasSession}get did(){return this.sessionManager.did}get serviceUrl(){return this.sessionManager.serviceUrl}get pdsUrl(){return this.sessionManager.pdsUrl}get dispatchUrl(){return this.sessionManager.dispatchUrl}get service(){return this.serviceUrl}get persistSession(){throw new Error('Cannot set persistSession directly. "persistSession" is defined through the constructor and will be invoked automatically when session data changes.')}set persistSession(e){throw new Error('Cannot set persistSession directly. "persistSession" must be defined in the constructor and can no longer be changed.')}getServiceUrl(){return this.serviceUrl}async resumeSession(e){return this.sessionManager.resumeSession(e)}async createAccount(e,t){return this.sessionManager.createAccount(e,t)}async login(e){return this.sessionManager.login(e)}async logout(){return this.sessionManager.logout()}}wm.AtpAgent=Cm;class Lm{constructor(e,t=globalThis.fetch,r){Object.defineProperty(this,"serviceUrl",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"fetch",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"persistSession",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"pdsUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"session",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"refreshSessionPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"server",{enumerable:!0,configurable:!0,writable:!0,value:new Sm.ComAtprotoServerNS(new Am.XrpcClient(((e,t)=>(0,this.fetch)(new URL(e,this.serviceUrl),t)),km.schemas))})}get did(){return this.session?.did}get dispatchUrl(){return this.pdsUrl||this.serviceUrl}get hasSession(){return!!this.session}setFetch(e=globalThis.fetch){this.fetch=e}async fetchHandler(e,t){await this.refreshSessionPromise;const r=new URL(e,this.dispatchUrl),n=new Request(r,t),o=this.session?.accessJwt;if(!o||n.headers.has("authorization"))return(0,this.fetch)(n);n.headers.set("authorization",`Bearer ${o}`);const i=await(0,this.fetch)(n);if(!this.session?.refreshJwt)return i;if(!await async function(e,t,r){if(!t.includes(e.status))return!1;try{const t=await async function(e,t=1/0){if("application/json"!==function({headers:e}){return e.get("Content-Type")?.split(";")[0]?.trim()}(e))throw new Error("Not JSON");if(function({headers:e}){return e.get("Content-Length")?Number(e.get("Content-Length")):NaN}(e)>t)throw new Error("Response too large");return e.clone().json()}(e,10240);return n=t,Am.errorResponseBody.safeParse(n).success&&r.includes(t.error)}catch(e){return!1}var n}(i,[400],["ExpiredToken"]))return i;try{await this.refreshSession()}catch{return i}if(t?.signal?.aborted)return i;if(Tm&&t?.body instanceof Tm)return i;const s=this.session?.accessJwt;if(!s||s===o)return i;await(i.body?.cancel());const a=new URL(e,this.dispatchUrl),c=new Request(a,t);return c.headers.set("authorization",`Bearer ${s}`),await(0,this.fetch)(c)}async createAccount(e,t){try{const r=await this.server.createAccount(e,t);return this.session={accessJwt:r.data.accessJwt,refreshJwt:r.data.refreshJwt,handle:r.data.handle,did:r.data.did,email:e.email,emailConfirmed:!1,emailAuthFactor:!1,active:!0},this.persistSession?.("create",this.session),this._updateApiEndpoint(r.data.didDoc),r}catch(e){throw this.session=void 0,this.persistSession?.("create-failed",void 0),e}}async login(e){try{const t=await this.server.createSession({identifier:e.identifier,password:e.password,authFactorToken:e.authFactorToken});return this.session={accessJwt:t.data.accessJwt,refreshJwt:t.data.refreshJwt,handle:t.data.handle,did:t.data.did,email:t.data.email,emailConfirmed:t.data.emailConfirmed,emailAuthFactor:t.data.emailAuthFactor,active:t.data.active??!0,status:t.data.status},this._updateApiEndpoint(t.data.didDoc),this.persistSession?.("create",this.session),t}catch(e){throw this.session=void 0,this.persistSession?.("create-failed",void 0),e}}async logout(){if(this.session)try{await this.server.deleteSession(void 0,{headers:{authorization:`Bearer ${this.session.accessJwt}`}})}catch{}finally{this.session=void 0,this.persistSession?.("expired",void 0)}}async resumeSession(e){this.session=e;try{const t=await this.server.getSession(void 0,{headers:{authorization:`Bearer ${e.accessJwt}`}}).catch((async t=>{if(t instanceof Am.XRPCError&&["ExpiredToken","InvalidToken"].includes(t.error)&&e.refreshJwt)try{const t=await this.server.refreshSession(void 0,{headers:{authorization:`Bearer ${e.refreshJwt}`}});return e.accessJwt=t.data.accessJwt,e.refreshJwt=t.data.refreshJwt,this.server.getSession(void 0,{headers:{authorization:`Bearer ${e.accessJwt}`}})}catch{}throw t}));if(t.data.did!==e.did)throw new Am.XRPCError(Am.ResponseType.InvalidRequest,"Invalid session","InvalidDID");return e.email=t.data.email,e.handle=t.data.handle,e.emailConfirmed=t.data.emailConfirmed,e.emailAuthFactor=t.data.emailAuthFactor,e.active=t.data.active??!0,e.status=t.data.status,this.session===e&&(this._updateApiEndpoint(t.data.didDoc),this.persistSession?.("update",e)),t}catch(t){throw this.session===e&&(this.session=void 0,this.persistSession?.(t instanceof Am.XRPCError&&["ExpiredToken","InvalidToken"].includes(t.error)?"expired":"network-error",void 0)),t}}async refreshSession(){return this.refreshSessionPromise||(this.refreshSessionPromise=this._refreshSessionInner().finally((()=>{this.refreshSessionPromise=void 0})))}async _refreshSessionInner(){if(this.session?.refreshJwt)try{const e=await this.server.refreshSession(void 0,{headers:{authorization:`Bearer ${this.session.refreshJwt}`}});this.session={...this.session,accessJwt:e.data.accessJwt,refreshJwt:e.data.refreshJwt,handle:e.data.handle,did:e.data.did},this._updateApiEndpoint(e.data.didDoc),this.persistSession?.("update",this.session)}catch(e){e instanceof Am.XRPCError&&e.error&&["ExpiredToken","InvalidToken"].includes(e.error)&&(this.session=void 0,this.persistSession?.("expired",void 0))}}_updateApiEndpoint(e){if((0,Rm.isValidDidDoc)(e)){const t=(0,Rm.getPdsEndpoint)(e);this.pdsUrl=t?new URL(t):void 0}else this.pdsUrl=void 0}}wm.CredentialSession=Lm;var Pm={};Object.defineProperty(Pm,"__esModule",{value:!0}),Pm.BskyAgent=void 0;const xm=wm;class Bm extends xm.AtpAgent{clone(){if(this.constructor===Bm){const e=new Bm(this.sessionManager);return this.copyInto(e)}throw new TypeError("Cannot clone a subclass of BskyAgent")}}function jm(){const e=l.useCallback((e=>{const t=new R.AtpAgent({service:e,persistSession:(n,o)=>{o?function(e){localStorage.setItem(Dm,JSON.stringify(e))}({...o,service:e}):(r((e=>e===t?null:e)),localStorage.removeItem(Dm))}});return t}),[]),[t,r]=l.useState((()=>{const t=function(){try{const e=localStorage.getItem(Dm),t=e?JSON.parse(e):void 0;return t&&t.service&&t.refreshJwt&&t.accessJwt&&t.handle&&t.did?t:void 0}catch(e){return}}();if(!t)return null;const r=e(t.service);return r.resumeSession(t),r})),n=l.useCallback((async({identifier:t,password:n,authFactorToken:o,service:i})=>{const s=e(i);await s.login({identifier:t,password:n,authFactorToken:o}),r(s)}),[e]);return l.useMemo((()=>({agent:t,signIn:n,signOut:()=>t?.logout(),refresh:()=>t?.sessionManager.refreshSession()})),[n,t])}Pm.BskyAgent=Bm,function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.lexicons=t.default=t.BskyAgent=t.CredentialSession=t.AtpAgent=t.Agent=t.DEFAULT_LABEL_SETTINGS=t.LABELS=t.parseLanguage=t.jsonStringToLex=t.jsonToLex=t.stringifyLex=t.lexToJson=t.BlobRef=t.AtUri=void 0;const o=A,i=Dn;var s=F;Object.defineProperty(t,"AtUri",{enumerable:!0,get:function(){return s.AtUri}});var a=A;Object.defineProperty(t,"BlobRef",{enumerable:!0,get:function(){return a.BlobRef}}),Object.defineProperty(t,"lexToJson",{enumerable:!0,get:function(){return a.lexToJson}}),Object.defineProperty(t,"stringifyLex",{enumerable:!0,get:function(){return a.stringifyLex}}),Object.defineProperty(t,"jsonToLex",{enumerable:!0,get:function(){return a.jsonToLex}}),Object.defineProperty(t,"jsonStringToLex",{enumerable:!0,get:function(){return a.jsonStringToLex}});var c=le;Object.defineProperty(t,"parseLanguage",{enumerable:!0,get:function(){return c.parseLanguage}}),n(On,t),n(Un,t),n(In,t),n(Kn,t),n(Bh,t),n(Ih,t),n(jh,t),n(zh,t),n(ty,t),n(oy,t),n(Gy,t);var l=sy;Object.defineProperty(t,"LABELS",{enumerable:!0,get:function(){return l.LABELS}}),Object.defineProperty(t,"DEFAULT_LABEL_SETTINGS",{enumerable:!0,get:function(){return l.DEFAULT_LABEL_SETTINGS}});var d=Zy;Object.defineProperty(t,"Agent",{enumerable:!0,get:function(){return d.Agent}});var u=wm;Object.defineProperty(t,"AtpAgent",{enumerable:!0,get:function(){return u.AtpAgent}});var p=wm;Object.defineProperty(t,"CredentialSession",{enumerable:!0,get:function(){return p.CredentialSession}});var f=Pm;Object.defineProperty(t,"BskyAgent",{enumerable:!0,get:function(){return f.BskyAgent}});var h=wm;Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h.AtpAgent}}),t.lexicons=new o.Lexicons(i.lexicons)}(R);const Dm="@@ATPROTO/SESSION";function Om({signIn:e,...t}){const[r,n]=l.useState(null),[o,i]=l.useState(!1),[s,a]=l.useState(""),[c,d]=l.useState(""),[u,p]=l.useState("http://localhost:2583"),f=l.useCallback((async t=>{if(t.preventDefault(),!o){i(!0);try{await e({identifier:s,password:c,service:u})}catch(e){n(e?.message||String(e))}finally{i(!1)}}}),[o,s,c,u,e]);return h.jsxs("form",{...t,className:"max-w-lg w-full",onSubmit:f,children:[h.jsx("fieldset",{className:"rounded-md border border-solid border-slate-200 dark:border-slate-700 text-neutral-700 dark:text-neutral-100",children:h.jsxs("div",{className:"relative p-1 flex flex-col flex-wrap items-center justify-stretch",children:[h.jsx("input",{id:"identifier",name:"identifier",type:"text",className:"relative m-0 block w-full flex-auto px-3 py-[0.25rem] leading-[1.6] bg-transparent bg-clip-padding text-base text-inherit outline-none dark:placeholder:text-neutral-100",placeholder:"@handle or email","aria-label":"@handle or email",required:!0,value:s,disabled:o,onChange:e=>a(e.target.value)}),h.jsx("input",{id:"password",name:"password",type:"password",className:"relative m-0 block w-full flex-auto px-3 py-[0.25rem] leading-[1.6] bg-transparent bg-clip-padding text-base text-inherit outline-none dark:placeholder:text-neutral-100",placeholder:"Password","aria-label":"Password",required:!0,value:c,disabled:o,onChange:e=>d(e.target.value)}),h.jsx("input",{id:"service",name:"service",type:"text",className:"relative m-0 block w-full flex-auto px-3 py-[0.25rem] leading-[1.6] bg-transparent bg-clip-padding text-base text-inherit outline-none dark:placeholder:text-neutral-100",placeholder:"Service","aria-label":"Service",required:!0,value:u,disabled:o,onChange:e=>p(e.target.value)}),h.jsx("button",{type:"submit",disabled:o,className:"bg-transparent text-blue-600 rounded-md py-1 px-3 hover:bg-blue-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 focus:ring-inset",children:"Login"}),o&&h.jsx("span",{children:"Loading..."})]})}),r?h.jsx("div",{className:"alert alert-error",children:r}):null]})}function Um({signIn:e,...t}){const[r,n]=l.useState(""),[o,i]=l.useState(null),[s,a]=l.useState(!1),c=l.useCallback((async t=>{if(t.preventDefault(),!s){i(null),a(!0);try{if(r.startsWith("did:"))r.length>5?await e(r):i("DID must be at least 6 characters");else if(r.startsWith("https://")||r.startsWith("http://")){const t=new URL(r);if(r!==t.origin)throw new Error("PDS URL must be a origin");await e(r)}else if(r.includes(".")&&r.length>3){const t=r.startsWith("@")?r.slice(1):r;t.length>3?await e(t):i("Handle must be at least 4 characters")}throw new Error("Please provide a valid handle, DID or PDS URL")}catch(e){i(e?.message||String(e))}finally{a(!1)}}}),[s,r,e]);return h.jsxs("form",{...t,className:"max-w-lg w-full",onSubmit:c,children:[h.jsx("fieldset",{className:"rounded-md border border-solid border-slate-200 dark:border-slate-700 text-neutral-700 dark:text-neutral-100",children:h.jsxs("div",{className:"relative p-1 flex flex-wrap items-center justify-stretch",children:[h.jsx("input",{name:"value",type:"text",className:"relative m-0 block w-[1px] min-w-0 flex-auto px-3 py-[0.25rem] leading-[1.6] bg-transparent bg-clip-padding text-base text-inherit outline-none dark:placeholder:text-neutral-100",placeholder:"@handle, DID or PDS url","aria-label":"@handle, DID or PDS url",required:!0,value:r,disabled:s,onChange:e=>n(e.target.value)}),h.jsx("button",{type:"submit",disabled:s,className:"bg-transparent text-blue-600 rounded-md py-1 px-3 hover:bg-blue-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 focus:ring-inset",children:"Login"}),s&&h.jsx("span",{children:"Loading..."})]})}),o?h.jsx("div",{className:"alert alert-error",children:o}):null]})}function Im({atpSignIn:e,oauthSignIn:t}){const r=t?"oauth":e?"credential":void 0,[n,o]=l.useState(r);return l.useEffect((()=>{("oauth"!==n||t)&&("credential"!==n||e)&&n||o(r)}),[e,t,r,n]),h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"flex my-4",children:[h.jsx("button",{className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-4 rounded "+("oauth"===n?"bg-blue-700":""),onClick:()=>t&&o("oauth"),disabled:!t,children:"OAuth"}),h.jsx("button",{className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-4 rounded "+("credential"===n?"bg-blue-700":""),onClick:()=>e&&o("credential"),disabled:!e,children:"Credentials"})]}),"oauth"===n&&h.jsx(Um,{signIn:t}),"credential"===n&&h.jsx(Om,{signIn:e}),null==n&&h.jsx("div",{children:"No auth method available"})]})}var Km={};Symbol.dispose??(Symbol.dispose=Symbol("@@dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("@@asyncDispose"));var Mm={},Vm={},Nm={},zm={},Fm={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.JwtVerifyError=e.JwtCreateError=e.JwkError=e.ERR_JWT_VERIFY=e.ERR_JWT_CREATE=e.ERR_JWT_INVALID=e.ERR_JWK_NOT_FOUND=e.ERR_JWK_INVALID=e.ERR_JWKS_NO_MATCHING_KEY=void 0,e.ERR_JWKS_NO_MATCHING_KEY="ERR_JWKS_NO_MATCHING_KEY",e.ERR_JWK_INVALID="ERR_JWK_INVALID",e.ERR_JWK_NOT_FOUND="ERR_JWK_NOT_FOUND",e.ERR_JWT_INVALID="ERR_JWT_INVALID",e.ERR_JWT_CREATE="ERR_JWT_CREATE",e.ERR_JWT_VERIFY="ERR_JWT_VERIFY";class t extends TypeError{constructor(t="JWK error",r=e.ERR_JWK_INVALID,n){super(t,n),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:r})}}e.JwkError=t;class r extends Error{constructor(t="Unable to create JWT",r=e.ERR_JWT_CREATE,n){super(t,n),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:r})}static from(e,n,o){return e instanceof r?e:new r(o,e instanceof t?e.code:n,{cause:e})}}e.JwtCreateError=r;class n extends Error{constructor(t="Invalid JWT",r=e.ERR_JWT_VERIFY,n){super(t,n),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:r})}static from(e,r,o){return e instanceof n?e:new n(o,e instanceof t?e.code:r,{cause:e})}}e.JwtVerifyError=n}(Fm),Object.defineProperty(zm,"__esModule",{value:!0}),zm.jwkAlgorithms=function*(e){if(e.alg)return void(yield e.alg);switch(e.kty){case"EC":if("enc"!==e.use&&void 0!==e.use||(yield"ECDH-ES",yield"ECDH-ES+A128KW",yield"ECDH-ES+A192KW",yield"ECDH-ES+A256KW"),"sig"===e.use||void 0===e.use){const t="crv"in e?e.crv:void 0;switch(t){case"P-256":case"P-384":yield`ES${t.slice(-3)}`;break;case"P-521":yield"ES512";break;case"secp256k1":Gm&&(yield"ES256K");break;default:throw new qm.JwkError(`Unsupported crv "${t}"`)}}return;case"OKP":if(!e.use)throw new qm.JwkError('Missing "use" Parameter value');return yield"ECDH-ES",yield"ECDH-ES+A128KW",yield"ECDH-ES+A192KW",void(yield"ECDH-ES+A256KW");case"RSA":return"enc"!==e.use&&void 0!==e.use||(yield"RSA-OAEP",yield"RSA-OAEP-256",yield"RSA-OAEP-384",yield"RSA-OAEP-512",Gm&&(yield"RSA1_5")),void("sig"!==e.use&&void 0!==e.use||(yield"PS256",yield"PS384",yield"PS512",yield"RS256",yield"RS384",yield"RS512"));case"oct":return"enc"!==e.use&&void 0!==e.use||(yield"A128GCMKW",yield"A192GCMKW",yield"A256GCMKW",yield"A128KW",yield"A192KW",yield"A256KW"),void("sig"!==e.use&&void 0!==e.use||(yield"HS256",yield"HS384",yield"HS512"));default:throw new qm.JwkError(`Unsupported kty "${e.kty}"`)}};const qm=Fm,{process:$m}=globalThis,Gm=void 0!==$m&&"string"==typeof $m?.versions?.node;var Hm={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.jwkPubSchema=e.jwkValidator=e.jwkSchema=e.jwkUnknownKeySchema=e.jwkSymKeySchema=e.jwkOkpKeySchema=e.jwkEcSecp256k1KeySchema=e.jwkEcKeySchema=e.jwkRsaKeySchema=e.jwkBaseSchema=e.keyUsageSchema=void 0;const t=S;e.keyUsageSchema=t.z.enum(["sign","verify","encrypt","decrypt","wrapKey","unwrapKey","deriveKey","deriveBits"]),e.jwkBaseSchema=t.z.object({kty:t.z.string().min(1),alg:t.z.string().min(1).optional(),kid:t.z.string().min(1).optional(),ext:t.z.boolean().optional(),use:t.z.enum(["sig","enc"]).optional(),key_ops:t.z.array(e.keyUsageSchema).optional(),x5c:t.z.array(t.z.string()).optional(),x5t:t.z.string().min(1).optional(),"x5t#S256":t.z.string().min(1).optional(),x5u:t.z.string().url().optional()}),e.jwkRsaKeySchema=e.jwkBaseSchema.extend({kty:t.z.literal("RSA"),alg:t.z.enum(["RS256","RS384","RS512","PS256","PS384","PS512"]).optional(),n:t.z.string().min(1),e:t.z.string().min(1),d:t.z.string().min(1).optional(),p:t.z.string().min(1).optional(),q:t.z.string().min(1).optional(),dp:t.z.string().min(1).optional(),dq:t.z.string().min(1).optional(),qi:t.z.string().min(1).optional(),oth:t.z.array(t.z.object({r:t.z.string().optional(),d:t.z.string().optional(),t:t.z.string().optional()})).nonempty().optional()}),e.jwkEcKeySchema=e.jwkBaseSchema.extend({kty:t.z.literal("EC"),alg:t.z.enum(["ES256","ES384","ES512"]).optional(),crv:t.z.enum(["P-256","P-384","P-521"]),x:t.z.string().min(1),y:t.z.string().min(1),d:t.z.string().min(1).optional()}),e.jwkEcSecp256k1KeySchema=e.jwkBaseSchema.extend({kty:t.z.literal("EC"),alg:t.z.enum(["ES256K"]).optional(),crv:t.z.enum(["secp256k1"]),x:t.z.string().min(1),y:t.z.string().min(1),d:t.z.string().min(1).optional()}),e.jwkOkpKeySchema=e.jwkBaseSchema.extend({kty:t.z.literal("OKP"),alg:t.z.enum(["EdDSA"]).optional(),crv:t.z.enum(["Ed25519","Ed448"]),x:t.z.string().min(1),d:t.z.string().min(1).optional()}),e.jwkSymKeySchema=e.jwkBaseSchema.extend({kty:t.z.literal("oct"),alg:t.z.enum(["HS256","HS384","HS512"]).optional(),k:t.z.string()}),e.jwkUnknownKeySchema=e.jwkBaseSchema.extend({kty:t.z.string().refine((e=>"RSA"!==e&&"EC"!==e&&"OKP"!==e&&"oct"!==e))}),e.jwkSchema=t.z.union([e.jwkUnknownKeySchema,e.jwkRsaKeySchema,e.jwkEcKeySchema,e.jwkEcSecp256k1KeySchema,e.jwkOkpKeySchema,e.jwkSymKeySchema]),e.jwkValidator=e.jwkSchema.refine((e=>null!=e.use||null!=e.key_ops),"use or key_ops required").refine((e=>!e.use||!e.key_ops||e.key_ops.every((t=>"sig"===e.use?"sign"===t||"verify"===t:"encrypt"===t||"decrypt"===t))),"use and key_ops must be consistent"),e.jwkPubSchema=e.jwkValidator.refine((e=>null!=e.kid),"kid is required").refine((e=>!("k"in e)&&!("d"in e)),"private key not allowed")}(Hm);var Xm={};Object.defineProperty(Xm,"__esModule",{value:!0}),Xm.jwksPubSchema=Xm.jwksSchema=void 0;const Wm=S,Zm=Hm;Xm.jwksSchema=Wm.z.object({keys:Wm.z.array(Zm.jwkSchema)}),Xm.jwksPubSchema=Wm.z.object({keys:Wm.z.array(Zm.jwkPubSchema)});var Jm={},Qm={},Ym={},eb=r($t);Object.defineProperty(Ym,"__esModule",{value:!0}),Ym.segmentedStringRefinementFactory=Ym.jwtCharsRefinement=Ym.cachedGetter=Ym.preferredOrderCmp=Ym.isDefined=void 0,Ym.matchesAny=function(e){return null==e?e=>!0:Array.isArray(e)?t=>e.includes(t):t=>t===e},Ym.parseB64uJson=function(e){const t=tb.base64url.baseDecode(e),r=nb.decode(t);return JSON.parse(r)};const tb=eb,rb=S;Ym.isDefined=e=>void 0!==e;Ym.preferredOrderCmp=e=>(t,r)=>{const n=e.indexOf(t),o=e.indexOf(r);return n===o?0:-1===n?1:-1===o?-1:n-o};Ym.cachedGetter=(e,t)=>function(){const t=e.call(this);return Object.defineProperty(this,e.name,{get:()=>t,enumerable:!0,configurable:!0}),t};const nb=new TextDecoder;Ym.jwtCharsRefinement=(e,t)=>{let r;for(let n=0;n<e.length;n++)if(r=e.charCodeAt(n),!(65<=r&&r<=90||97<=r&&r<=122||48<=r&&r<=57||45===r||95===r||46===r)){const r=String.fromCodePoint(e.codePointAt(n));return t.addIssue({code:rb.ZodIssueCode.custom,message:`Invalid character "${r}" in JWT at position ${n}`})}};Ym.segmentedStringRefinementFactory=(e,t=2)=>{if(!Number.isFinite(e)||e<1||(0|e)!==e)throw new TypeError(`Count must be a natural number (got ${e})`);const r=e*t+(e-1),n="Invalid JWT format";return(o,i)=>{if(o.length<r)return i.addIssue({code:rb.ZodIssueCode.custom,message:`${n}: too short`}),!1;let s=0;for(let r=0;r<e-1;r++){const a=o.indexOf(".",s);if(-1===a)return i.addIssue({code:rb.ZodIssueCode.custom,message:`${n}: expected ${e} segments, got ${r+1}`}),!1;if(a-s<t)return i.addIssue({code:rb.ZodIssueCode.custom,message:`${n}: segment ${r+1} is too short`}),!1;s=a+1}return-1!==o.indexOf(".",s)?(i.addIssue({code:rb.ZodIssueCode.custom,message:`${n}: too many segments`}),!1):!(o.length-s<t)||(i.addIssue({code:rb.ZodIssueCode.custom,message:`${n}: last segment is too short`}),!1)}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.jwtPayloadSchema=e.jwtHeaderSchema=e.isUnsignedJwt=e.unsignedJwtSchema=e.isSignedJwt=e.signedJwtSchema=void 0;const t=S,r=Hm,n=Ym;e.signedJwtSchema=t.z.string().superRefine(n.jwtCharsRefinement).superRefine((0,n.segmentedStringRefinementFactory)(3));e.isSignedJwt=t=>e.signedJwtSchema.safeParse(t).success,e.unsignedJwtSchema=t.z.string().superRefine(n.jwtCharsRefinement).superRefine((0,n.segmentedStringRefinementFactory)(2));e.isUnsignedJwt=t=>e.unsignedJwtSchema.safeParse(t).success,e.jwtHeaderSchema=t.z.object({alg:t.z.string(),jku:t.z.string().url().optional(),jwk:t.z.object({kty:t.z.string(),crv:t.z.string().optional(),x:t.z.string().optional(),y:t.z.string().optional(),e:t.z.string().optional(),n:t.z.string().optional()}).optional(),kid:t.z.string().optional(),x5u:t.z.string().optional(),x5c:t.z.array(t.z.string()).optional(),x5t:t.z.string().optional(),"x5t#S256":t.z.string().optional(),typ:t.z.string().optional(),cty:t.z.string().optional(),crit:t.z.array(t.z.string()).optional()}),e.jwtPayloadSchema=t.z.object({iss:t.z.string().optional(),aud:t.z.union([t.z.string(),t.z.array(t.z.string()).nonempty()]).optional(),sub:t.z.string().optional(),exp:t.z.number().int().optional(),nbf:t.z.number().int().optional(),iat:t.z.number().int().optional(),jti:t.z.string().optional(),htm:t.z.string().optional(),htu:t.z.string().optional(),ath:t.z.string().optional(),acr:t.z.string().optional(),azp:t.z.string().optional(),amr:t.z.array(t.z.string()).optional(),cnf:t.z.object({kid:t.z.string().optional(),jwk:r.jwkPubSchema.optional(),jwe:t.z.string().optional(),jku:t.z.string().url().optional(),jkt:t.z.string().optional(),"x5t#S256":t.z.string().optional(),osc:t.z.string().optional()}).optional(),client_id:t.z.string().optional(),scope:t.z.string().optional(),nonce:t.z.string().optional(),at_hash:t.z.string().optional(),c_hash:t.z.string().optional(),s_hash:t.z.string().optional(),auth_time:t.z.number().int().optional(),name:t.z.string().optional(),family_name:t.z.string().optional(),given_name:t.z.string().optional(),middle_name:t.z.string().optional(),nickname:t.z.string().optional(),preferred_username:t.z.string().optional(),gender:t.z.string().optional(),picture:t.z.string().url().optional(),profile:t.z.string().url().optional(),website:t.z.string().url().optional(),birthdate:t.z.string().regex(/\d{4}-\d{2}-\d{2}/).optional(),zoneinfo:t.z.string().regex(/^[A-Za-z0-9_/]+$/).optional(),locale:t.z.string().regex(/^[a-z]{2}(-[A-Z]{2})?$/).optional(),updated_at:t.z.number().int().optional(),email:t.z.string().optional(),email_verified:t.z.boolean().optional(),phone_number:t.z.string().optional(),phone_number_verified:t.z.boolean().optional(),address:t.z.object({formatted:t.z.string().optional(),street_address:t.z.string().optional(),locality:t.z.string().optional(),region:t.z.string().optional(),postal_code:t.z.string().optional(),country:t.z.string().optional()}).optional(),authorization_details:t.z.array(t.z.object({type:t.z.string(),locations:t.z.array(t.z.string()).optional(),actions:t.z.array(t.z.string()).optional(),datatypes:t.z.array(t.z.string()).optional(),identifier:t.z.string().optional(),privileges:t.z.array(t.z.string()).optional()}).passthrough()).optional()})}(Qm),Object.defineProperty(Jm,"__esModule",{value:!0}),Jm.unsafeDecodeJwt=function(e){const{0:t,1:r,length:n}=e.split(".");if(n>3||n<2)throw new ob.JwtVerifyError(void 0,ob.ERR_JWT_INVALID);const o=ib.jwtHeaderSchema.parse((0,sb.parseB64uJson)(t));if(2===n&&"none"!==o?.alg)throw new ob.JwtVerifyError(void 0,ob.ERR_JWT_INVALID);const i=ib.jwtPayloadSchema.parse((0,sb.parseB64uJson)(r));return{header:o,payload:i}};const ob=Fm,ib=Qm,sb=Ym;var ab={};Object.defineProperty(ab,"__esModule",{value:!0});var cb={},lb=e&&e.__runInitializers||function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0},db=e&&e.__esDecorate||function(e,t,r,n,o,i){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,c=n.kind,l="getter"===c?"get":"setter"===c?"set":"value",d=!t&&e?n.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),p=!1,f=r.length-1;f>=0;f--){var h={};for(var y in n)h[y]="access"===y?{}:n[y];for(var y in n.access)h.access[y]=n.access[y];h.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(e||null))};var m=(0,r[f])("accessor"===c?{get:u.get,set:u.set}:u[l],h);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(u.get=a),(a=s(m.set))&&(u.set=a),(a=s(m.init))&&o.unshift(a)}else(a=s(m))&&("field"===c?o.unshift(a):u[l]=a)}d&&Object.defineProperty(d,n.name,u),p=!0};Object.defineProperty(cb,"__esModule",{value:!0}),cb.Key=void 0;const ub=zm,pb=Fm,fb=Hm,hb=Ym;let yb=(()=>{var e;let t,r,n,o=[];return e=class{constructor(e){if(Object.defineProperty(this,"jwk",{enumerable:!0,configurable:!0,writable:!0,value:(lb(this,o),e)}),!e.use)throw new pb.JwkError('Missing "use" Parameter value')}get isPrivate(){const{jwk:e}=this;return"d"in e&&void 0!==e.d||"k"in e&&void 0!==e.k}get isSymetric(){const{jwk:e}=this;return"k"in e&&void 0!==e.k}get privateJwk(){return this.isPrivate?this.jwk:void 0}get publicJwk(){if(!this.isSymetric){if(this.isPrivate){const{d:e,...t}=this.jwk;return t}return this.jwk}}get bareJwk(){if(this.isSymetric)return;const{kty:e,crv:t,e:r,n:n,x:o,y:i}=this.jwk;return fb.jwkSchema.parse({crv:t,e:r,kty:e,n:n,x:o,y:i})}get use(){return this.jwk.use}get alg(){return this.jwk.alg}get kid(){return this.jwk.kid}get crv(){return this.jwk.crv}get algorithms(){return Array.from((0,ub.jwkAlgorithms)(this.jwk))}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[hb.cachedGetter],r=[hb.cachedGetter],n=[hb.cachedGetter],db(e,null,t,{kind:"getter",name:"publicJwk",static:!1,private:!1,access:{has:e=>"publicJwk"in e,get:e=>e.publicJwk},metadata:i},null,o),db(e,null,r,{kind:"getter",name:"bareJwk",static:!1,private:!1,access:{has:e=>"bareJwk"in e,get:e=>e.bareJwk},metadata:i},null,o),db(e,null,n,{kind:"getter",name:"algorithms",static:!1,private:!1,access:{has:e=>"algorithms"in e,get:e=>e.algorithms},metadata:i},null,o),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),e})();cb.Key=yb;var mb={},bb=e&&e.__runInitializers||function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0},gb=e&&e.__esDecorate||function(e,t,r,n,o,i){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,c=n.kind,l="getter"===c?"get":"setter"===c?"set":"value",d=!t&&e?n.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),p=!1,f=r.length-1;f>=0;f--){var h={};for(var y in n)h[y]="access"===y?{}:n[y];for(var y in n.access)h.access[y]=n.access[y];h.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(e||null))};var m=(0,r[f])("accessor"===c?{get:u.get,set:u.set}:u[l],h);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(u.get=a),(a=s(m.set))&&(u.set=a),(a=s(m.init))&&o.unshift(a)}else(a=s(m))&&("field"===c?o.unshift(a):u[l]=a)}d&&Object.defineProperty(d,n.name,u),p=!0};Object.defineProperty(mb,"__esModule",{value:!0}),mb.Keyset=void 0;const vb=Fm,Eb=Jm,wb=Ym,Rb=e=>e.privateJwk,Ab=e=>e.publicJwk;let _b=(()=>{var e;let t,r,n,o=[];return e=class{constructor(t,r=(t instanceof e?[...t.preferredSigningAlgorithms]:["EdDSA","ES256K","ES256","PS256","PS384","PS512","HS256","HS384","HS512"])){Object.defineProperty(this,"preferredSigningAlgorithms",{enumerable:!0,configurable:!0,writable:!0,value:(bb(this,o),r)}),Object.defineProperty(this,"keys",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const n=[],i=new Set;for(const e of t)if(e&&(n.push(e),e.kid)){if(i.has(e.kid))throw new vb.JwkError(`Duplicate key: ${e.kid}`);i.add(e.kid)}this.keys=Object.freeze(n)}get size(){return this.keys.length}get signAlgorithms(){const e=new Set;for(const t of this)if("sig"===t.use)for(const r of t.algorithms)e.add(r);return Object.freeze([...e].sort((0,wb.preferredOrderCmp)(this.preferredSigningAlgorithms)))}get publicJwks(){return{keys:Array.from(this,Ab).filter(wb.isDefined)}}get privateJwks(){return{keys:Array.from(this,Rb).filter(wb.isDefined)}}has(e){return this.keys.some((t=>t.kid===e))}get(e){for(const t of this.list(e))return t;throw new vb.JwkError(`Key not found ${e.kid||e.alg||"<unknown>"}`,vb.ERR_JWK_NOT_FOUND)}*list(e){if(0!==e.kid?.length&&0!==e.alg?.length)for(const t of this)if(!e.use||t.use===e.use){if(Array.isArray(e.kid)){if(!t.kid||!e.kid.includes(t.kid))continue}else if(e.kid&&t.kid!==e.kid)continue;if(Array.isArray(e.alg)){if(!e.alg.some((e=>t.algorithms.includes(e))))continue}else if("string"==typeof e.alg&&!t.algorithms.includes(e.alg))continue;yield t}}findKey({kid:e,alg:t,use:r}){const n=[];for(const o of this.list({kid:e,alg:t,use:r}))if(o.isPrivate){if("string"==typeof t)return[o,t];n.push(o)}const o=(0,wb.matchesAny)(t),i=n.map((e=>[e,e.algorithms.filter(o)]));for(const e of this.preferredSigningAlgorithms)for(const[t,r]of i)if(r.includes(e))return[t,e];for(const[e,t]of i)for(const r of t)return[e,r];throw new vb.JwkError(`No singing key found for ${e||t||r||"<unknown>"}`,vb.ERR_JWK_NOT_FOUND)}[(t=[wb.cachedGetter],r=[wb.cachedGetter],n=[wb.cachedGetter],Symbol.iterator)](){return this.keys.values()}async createJwt({alg:e,kid:t,...r},n){try{const[o,i]=this.findKey({alg:e,kid:t,use:"sig"}),s={...r,alg:i,kid:o.kid};return"function"==typeof n&&(n=await n(s,o)),await o.createJwt(s,n)}catch(e){throw vb.JwtCreateError.from(e)}}async verifyJwt(e,t){const{header:r}=(0,Eb.unsafeDecodeJwt)(e),{kid:n,alg:o}=r,i=[];for(const r of this.list({kid:n,alg:o}))try{return{...await r.verifyJwt(e,t),key:r}}catch(e){i.push(e)}switch(i.length){case 0:throw new vb.JwtVerifyError("No key matched",vb.ERR_JWKS_NO_MATCHING_KEY);case 1:throw vb.JwtVerifyError.from(i[0],vb.ERR_JWT_INVALID);default:throw vb.JwtVerifyError.from(i,vb.ERR_JWT_INVALID)}}toJSON(){return structuredClone(this.publicJwks)}},(()=>{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;gb(e,null,t,{kind:"getter",name:"signAlgorithms",static:!1,private:!1,access:{has:e=>"signAlgorithms"in e,get:e=>e.signAlgorithms},metadata:i},null,o),gb(e,null,r,{kind:"getter",name:"publicJwks",static:!1,private:!1,access:{has:e=>"publicJwks"in e,get:e=>e.publicJwks},metadata:i},null,o),gb(e,null,n,{kind:"getter",name:"privateJwks",static:!1,private:!1,access:{has:e=>"privateJwks"in e,get:e=>e.privateJwks},metadata:i},null,o),i&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})})(),e})();mb.Keyset=_b,function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(zm,t),n(Fm,t),n(Hm,t),n(Xm,t),n(Jm,t),n(ab,t),n(Qm,t),n(cb,t),n(mb,t),n(Ym,t)}(Nm);var Sb={},kb={},Tb=crypto;const Cb=e=>e instanceof CryptoKey,Lb=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await Tb.subtle.digest(r,t))},Pb=new TextEncoder,xb=new TextDecoder,Bb=2**32;function jb(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}function Db(e,t,r){if(t<0||t>=Bb)throw new RangeError(`value must be >= 0 and <= ${Bb-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function Ob(e){const t=Math.floor(e/Bb),r=e%Bb,n=new Uint8Array(8);return Db(n,t,0),Db(n,r,4),n}function Ub(e){const t=new Uint8Array(4);return Db(t,e),t}function Ib(e){return jb(Ub(e.length),e)}const Kb=e=>{let t=e;"string"==typeof t&&(t=Pb.encode(t));const r=[];for(let e=0;e<t.length;e+=32768)r.push(String.fromCharCode.apply(null,t.subarray(e,e+32768)));return btoa(r.join(""))},Mb=e=>Kb(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),Vb=e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r},Nb=e=>{let t=e;t instanceof Uint8Array&&(t=xb.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return Vb(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};let zb=class extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};class Fb extends zb{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=r}}class qb extends zb{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=r}}class $b extends zb{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class Gb extends zb{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class Hb extends zb{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}}class Xb extends zb{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}}class Wb extends zb{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class Zb extends zb{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class Jb extends zb{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}}class Qb extends zb{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class Yb extends zb{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}}class eg extends zb{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}class tg extends zb{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class rg extends zb{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}var ng=Object.freeze({__proto__:null,JOSEAlgNotAllowed:$b,JOSEError:zb,JOSENotSupported:Gb,JWEDecryptionFailed:Hb,JWEInvalid:Xb,JWKInvalid:Jb,JWKSInvalid:Qb,JWKSMultipleMatchingKeys:eg,JWKSNoMatchingKey:Yb,JWKSTimeout:tg,JWSInvalid:Wb,JWSSignatureVerificationFailed:rg,JWTClaimValidationFailed:Fb,JWTExpired:qb,JWTInvalid:Zb}),og=Tb.getRandomValues.bind(Tb);function ig(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new Gb(`Unsupported JWE Algorithm: ${e}`)}}const sg=(e,t)=>{if(t.length<<3!==ig(e))throw new Xb("Invalid Initialization Vector length")},ag=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new Xb(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function cg(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function lg(e,t){return e.name===t}function dg(e){return parseInt(e.name.slice(4),10)}function ug(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}function pg(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!lg(e.algorithm,"HMAC"))throw cg("HMAC");const r=parseInt(t.slice(2),10);if(dg(e.algorithm.hash)!==r)throw cg(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!lg(e.algorithm,"RSASSA-PKCS1-v1_5"))throw cg("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(dg(e.algorithm.hash)!==r)throw cg(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!lg(e.algorithm,"RSA-PSS"))throw cg("RSA-PSS");const r=parseInt(t.slice(2),10);if(dg(e.algorithm.hash)!==r)throw cg(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw cg("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!lg(e.algorithm,"ECDSA"))throw cg("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw cg(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}ug(e,r)}function fg(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!lg(e.algorithm,"AES-GCM"))throw cg("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw cg(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!lg(e.algorithm,"AES-KW"))throw cg("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw cg(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw cg("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!lg(e.algorithm,"PBKDF2"))throw cg("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!lg(e.algorithm,"RSA-OAEP"))throw cg("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(dg(e.algorithm.hash)!==r)throw cg(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}ug(e,r)}function hg(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var yg=(e,...t)=>hg("Key must be ",e,...t);function mg(e,t,...r){return hg(`Key for the ${e} algorithm must be `,t,...r)}var bg=e=>Cb(e);const gg=["CryptoKey"];async function vg(e,t,r,n,o,i){if(!(t instanceof Uint8Array))throw new TypeError(yg(t,"Uint8Array"));const s=parseInt(e.slice(1,4),10),a=await Tb.subtle.importKey("raw",t.subarray(s>>3),"AES-CBC",!1,["decrypt"]),c=await Tb.subtle.importKey("raw",t.subarray(0,s>>3),{hash:"SHA-"+(s<<1),name:"HMAC"},!1,["sign"]),l=jb(i,n,r,Ob(i.length<<3)),d=new Uint8Array((await Tb.subtle.sign("HMAC",c,l)).slice(0,s>>3));let u,p;try{u=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const r=e.length;let n=0,o=-1;for(;++o<r;)n|=e[o]^t[o];return 0===n})(o,d)}catch{}if(!u)throw new Hb;try{p=new Uint8Array(await Tb.subtle.decrypt({iv:n,name:"AES-CBC"},a,r))}catch{}if(!p)throw new Hb;return p}const Eg=async(e,t,r,n,o,i)=>{if(!(Cb(t)||t instanceof Uint8Array))throw new TypeError(yg(t,...gg,"Uint8Array"));if(!n)throw new Xb("JWE Initialization Vector missing");if(!o)throw new Xb("JWE Authentication Tag missing");switch(sg(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&ag(t,parseInt(e.slice(-3),10)),vg(e,t,r,n,o,i);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&ag(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,o,i){let s;t instanceof Uint8Array?s=await Tb.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(fg(t,e,"decrypt"),s=t);try{return new Uint8Array(await Tb.subtle.decrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},s,jb(r,o)))}catch{throw new Hb}}(e,t,r,n,o,i);default:throw new Gb("Unsupported JWE Content Encryption Algorithm")}},wg=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function Rg(e){if(!function(e){return"object"==typeof e&&null!==e}(e)||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}const Ag=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function _g(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function Sg(e,t,r){if(Cb(e))return fg(e,t,r),e;if(e instanceof Uint8Array)return Tb.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(yg(e,...gg,"Uint8Array"))}const kg=async(e,t,r)=>{const n=await Sg(t,e,"wrapKey");_g(n,e);const o=await Tb.subtle.importKey("raw",r,...Ag);return new Uint8Array(await Tb.subtle.wrapKey("raw",o,n,"AES-KW"))},Tg=async(e,t,r)=>{const n=await Sg(t,e,"unwrapKey");_g(n,e);const o=await Tb.subtle.unwrapKey("raw",r,n,"AES-KW",...Ag);return new Uint8Array(await Tb.subtle.exportKey("raw",o))};async function Cg(e,t,r,n,o=new Uint8Array(0),i=new Uint8Array(0)){if(!Cb(e))throw new TypeError(yg(e,...gg));if(fg(e,"ECDH"),!Cb(t))throw new TypeError(yg(t,...gg));fg(t,"ECDH","deriveBits");const s=jb(Ib(Pb.encode(r)),Ib(o),Ib(i),Ub(n));let a;a="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3;return async function(e,t,r){const n=Math.ceil((t>>3)/32),o=new Uint8Array(32*n);for(let t=0;t<n;t++){const n=new Uint8Array(4+e.length+r.length);n.set(Ub(t+1)),n.set(e,4),n.set(r,4+e.length),o.set(await Lb("sha256",n),32*t)}return o.slice(0,t>>3)}(new Uint8Array(await Tb.subtle.deriveBits({name:e.algorithm.name,public:e},t,a)),n,s)}function Lg(e){if(!Cb(e))throw new TypeError(yg(e,...gg));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function Pg(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new Xb("PBES2 Salt Input must be 8 or more octets")}(e);const o=function(e,t){return jb(Pb.encode(e),new Uint8Array([0]),t)}(t,e),i=parseInt(t.slice(13,16),10),s={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:o},a={length:i,name:"AES-KW"},c=await function(e,t){if(e instanceof Uint8Array)return Tb.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(Cb(e))return fg(e,t,"deriveBits","deriveKey"),e;throw new TypeError(yg(e,...gg,"Uint8Array"))}(n,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await Tb.subtle.deriveBits(s,c,i));if(c.usages.includes("deriveKey"))return Tb.subtle.deriveKey(s,c,a,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const xg=async(e,t,r,n,o)=>{const i=await Pg(o,e,n,t);return Tg(e.slice(-6),i,r)};function Bg(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new Gb(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var jg=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};const Dg=async(e,t,r)=>{if(!Cb(t))throw new TypeError(yg(t,...gg));if(fg(t,e,"decrypt","unwrapKey"),jg(e,t),t.usages.includes("decrypt"))return new Uint8Array(await Tb.subtle.decrypt(Bg(e),t,r));if(t.usages.includes("unwrapKey")){const n=await Tb.subtle.unwrapKey("raw",r,t,Bg(e),...Ag);return new Uint8Array(await Tb.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function Og(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new Gb(`Unsupported JWE Algorithm: ${e}`)}}var Ug=e=>og(new Uint8Array(Og(e)>>3)),Ig=(e,t)=>`-----BEGIN ${t}-----\n${(e.match(/.{1,64}/g)||[]).join("\n")}\n-----END ${t}-----`;const Kg=async(e,t,r)=>{if(!Cb(r))throw new TypeError(yg(r,...gg));if(!r.extractable)throw new TypeError("CryptoKey is not extractable");if(r.type!==e)throw new TypeError(`key is not a ${e} key`);return Ig(Kb(new Uint8Array(await Tb.subtle.exportKey(t,r))),`${e.toUpperCase()} KEY`)},Mg=(e,t,r=0)=>{0===r&&(t.unshift(t.length),t.unshift(6));const n=e.indexOf(t[0],r);if(-1===n)return!1;const o=e.subarray(n,n+t.length);return o.length===t.length&&(o.every(((e,r)=>e===t[r]))||Mg(e,t,n+1))},Vg=e=>{switch(!0){case Mg(e,[42,134,72,206,61,3,1,7]):return"P-256";case Mg(e,[43,129,4,0,34]):return"P-384";case Mg(e,[43,129,4,0,35]):return"P-521";case Mg(e,[43,101,110]):return"X25519";case Mg(e,[43,101,111]):return"X448";case Mg(e,[43,101,112]):return"Ed25519";case Mg(e,[43,101,113]):return"Ed448";default:throw new Gb("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},Ng=async(e,t,r,n,o)=>{let i,s;const a=new Uint8Array(atob(r.replace(e,"")).split("").map((e=>e.charCodeAt(0)))),c="spki"===t;switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},s=c?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},s=c?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},s=c?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":i={name:"ECDSA",namedCurve:"P-256"},s=c?["verify"]:["sign"];break;case"ES384":i={name:"ECDSA",namedCurve:"P-384"},s=c?["verify"]:["sign"];break;case"ES512":i={name:"ECDSA",namedCurve:"P-521"},s=c?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const e=Vg(a);i=e.startsWith("P-")?{name:"ECDH",namedCurve:e}:{name:e},s=c?[]:["deriveBits"];break}case"EdDSA":i={name:Vg(a)},s=c?["verify"]:["sign"];break;default:throw new Gb('Invalid or unsupported "alg" (Algorithm) value')}return Tb.subtle.importKey(t,a,i,o?.extractable??!1,s)},zg=(e,t,r)=>Ng(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,r);function Fg(e){const t=[];let r=0;for(;r<e.length;){const n=qg(e.subarray(r));t.push(n),r+=n.byteLength}return t}function qg(e){let t=0,r=31&e[0];if(t++,31===r){for(r=0;e[t]>=128;)r=128*r+e[t]-128,t++;r=128*r+e[t]-128,t++}let n=0;if(e[t]<128)n=e[t],t++;else{if(128===n){for(n=0;0!==e[t+n]||0!==e[t+n+1];){if(n>e.byteLength)throw new TypeError("invalid indefinite form length");n++}const r=t+n+2;return{byteLength:r,contents:e.subarray(t,t+n),raw:e.subarray(0,r)}}{const r=127&e[t];t++,n=0;for(let o=0;o<r;o++)n=256*n+e[t],t++}}const o=t+n;return{byteLength:o,contents:e.subarray(t,o),raw:e.subarray(0,o)}}function $g(e){const t=e.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),r=Vb(t);return Ig(function(e){const t=Fg(Fg(qg(e).contents)[0].contents);return Kb(t[160===t[0].raw[0]?6:5].raw)}(r),"PUBLIC KEY")}var Gg=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:t,keyUsages:r}=function(e){let t,r;switch(e.kty){case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Gb('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Gb('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Gb('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Gb('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),n=[t,e.ext??!1,e.key_ops??r],o={...e};return delete o.alg,delete o.use,Tb.subtle.importKey("jwk",o,...n)};async function Hg(e,t){if(!Rg(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Nb(e.k);case"RSA":if(void 0!==e.oth)throw new Gb('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return Gg({...e,alg:t});default:throw new Gb('Unsupported "kty" (Key Type) Parameter value')}}const Xg=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!bg(t))throw new TypeError(mg(e,t,...gg,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${gg.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!bg(t))throw new TypeError(mg(e,t,...gg));if("secret"===t.type)throw new TypeError(`${gg.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${gg.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${gg.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${gg.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${gg.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};const Wg=async(e,t,r,n,o)=>{if(!(Cb(r)||r instanceof Uint8Array))throw new TypeError(yg(r,...gg,"Uint8Array"));switch(n?sg(e,n):n=(e=>og(new Uint8Array(ig(e)>>3)))(e),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&ag(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,o){if(!(r instanceof Uint8Array))throw new TypeError(yg(r,"Uint8Array"));const i=parseInt(e.slice(1,4),10),s=await Tb.subtle.importKey("raw",r.subarray(i>>3),"AES-CBC",!1,["encrypt"]),a=await Tb.subtle.importKey("raw",r.subarray(0,i>>3),{hash:"SHA-"+(i<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await Tb.subtle.encrypt({iv:n,name:"AES-CBC"},s,t)),l=jb(o,n,c,Ob(o.length<<3));return{ciphertext:c,tag:new Uint8Array((await Tb.subtle.sign("HMAC",a,l)).slice(0,i>>3)),iv:n}}(e,t,r,n,o);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&ag(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,o){let i;r instanceof Uint8Array?i=await Tb.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(fg(r,e,"encrypt"),i=r);const s=new Uint8Array(await Tb.subtle.encrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},i,t)),a=s.slice(-16);return{ciphertext:s.slice(0,-16),tag:a,iv:n}}(e,t,r,n,o);default:throw new Gb("Unsupported JWE Content Encryption Algorithm")}};async function Zg(e,t,r,n,o){switch(Xg(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new Xb("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new Xb("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Rg(n.epk))throw new Xb('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!Lg(t))throw new Gb("ECDH with the provided key is not allowed or not supported by your javascript runtime");const o=await Hg(n.epk,e);let i,s;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new Xb('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{i=Nb(n.apu)}catch{throw new Xb("Failed to base64url decode the apu")}}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new Xb('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{s=Nb(n.apv)}catch{throw new Xb("Failed to base64url decode the apv")}}const a=await Cg(o,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?Og(n.enc):parseInt(e.slice(-5,-2),10),i,s);if("ECDH-ES"===e)return a;if(void 0===r)throw new Xb("JWE Encrypted Key missing");return Tg(e.slice(-6),a,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new Xb("JWE Encrypted Key missing");return Dg(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new Xb("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new Xb('JOSE Header "p2c" (PBES2 Count) missing or invalid');const i=o?.maxPBES2Count||1e4;if(n.p2c>i)throw new Xb('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new Xb('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let s;try{s=Nb(n.p2s)}catch{throw new Xb("Failed to base64url decode the p2s")}return xg(e,t,r,n.p2c,s)}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new Xb("JWE Encrypted Key missing");return Tg(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{if(void 0===r)throw new Xb("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new Xb('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new Xb('JOSE Header "tag" (Authentication Tag) missing or invalid');let o,i;try{o=Nb(n.iv)}catch{throw new Xb("Failed to base64url decode the iv")}try{i=Nb(n.tag)}catch{throw new Xb("Failed to base64url decode the tag")}return async function(e,t,r,n,o){const i=e.slice(0,7);return Eg(i,t,r,n,o,new Uint8Array(0))}(e,t,r,o,i)}default:throw new Gb('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function Jg(e,t,r,n,o){if(void 0!==o.crit&&void 0===n?.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;i=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!i.has(t))throw new Gb(`Extension Header Parameter "${t}" is not recognized`);if(void 0===o[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(i.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}const Qg=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function Yg(e,t,r){if(!Rg(e))throw new Xb("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new Xb("JOSE Header missing");if(void 0!==e.iv&&"string"!=typeof e.iv)throw new Xb("JWE Initialization Vector incorrect type");if("string"!=typeof e.ciphertext)throw new Xb("JWE Ciphertext missing or incorrect type");if(void 0!==e.tag&&"string"!=typeof e.tag)throw new Xb("JWE Authentication Tag incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Xb("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new Xb("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new Xb("JWE AAD incorrect type");if(void 0!==e.header&&!Rg(e.header))throw new Xb("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!Rg(e.unprotected))throw new Xb("JWE Per-Recipient Unprotected Header incorrect type");let n;if(e.protected)try{const t=Nb(e.protected);n=JSON.parse(xb.decode(t))}catch{throw new Xb("JWE Protected Header is invalid")}if(!wg(n,e.header,e.unprotected))throw new Xb("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...n,...e.header,...e.unprotected};if(Jg(Xb,new Map,r?.crit,n,o),void 0!==o.zip)throw new Gb('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');const{alg:i,enc:s}=o;if("string"!=typeof i||!i)throw new Xb("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new Xb("missing JWE Encryption Algorithm (enc) in JWE Header");const a=r&&Qg("keyManagementAlgorithms",r.keyManagementAlgorithms),c=r&&Qg("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(a&&!a.has(i)||!a&&i.startsWith("PBES2"))throw new $b('"alg" (Algorithm) Header Parameter value not allowed');if(c&&!c.has(s))throw new $b('"enc" (Encryption Algorithm) Header Parameter value not allowed');let l;if(void 0!==e.encrypted_key)try{l=Nb(e.encrypted_key)}catch{throw new Xb("Failed to base64url decode the encrypted_key")}let d,u,p,f=!1;"function"==typeof t&&(t=await t(n,e),f=!0);try{d=await Zg(i,t,l,o,r)}catch(e){if(e instanceof TypeError||e instanceof Xb||e instanceof Gb)throw e;d=Ug(s)}if(void 0!==e.iv)try{u=Nb(e.iv)}catch{throw new Xb("Failed to base64url decode the iv")}if(void 0!==e.tag)try{p=Nb(e.tag)}catch{throw new Xb("Failed to base64url decode the tag")}const h=Pb.encode(e.protected??"");let y,m;y=void 0!==e.aad?jb(h,Pb.encode("."),Pb.encode(e.aad)):h;try{m=Nb(e.ciphertext)}catch{throw new Xb("Failed to base64url decode the ciphertext")}const b={plaintext:await Eg(s,d,m,u,p,y)};if(void 0!==e.protected&&(b.protectedHeader=n),void 0!==e.aad)try{b.additionalAuthenticatedData=Nb(e.aad)}catch{throw new Xb("Failed to base64url decode the aad")}return void 0!==e.unprotected&&(b.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(b.unprotectedHeader=e.header),f?{...b,key:t}:b}async function ev(e,t,r){if(e instanceof Uint8Array&&(e=xb.decode(e)),"string"!=typeof e)throw new Xb("Compact JWE must be a string or Uint8Array");const{0:n,1:o,2:i,3:s,4:a,length:c}=e.split(".");if(5!==c)throw new Xb("Invalid Compact JWE");const l=await Yg({ciphertext:s,iv:i||void 0,protected:n,tag:a||void 0,encrypted_key:o||void 0},t,r),d={plaintext:l.plaintext,protectedHeader:l.protectedHeader};return"function"==typeof t?{...d,key:l.key}:d}var tv=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:Mb(e)};if(!Cb(e))throw new TypeError(yg(e,...gg,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:r,alg:n,use:o,...i}=await Tb.subtle.exportKey("jwk",e);return i};async function rv(e){return tv(e)}async function nv(e,t,r,n,o={}){let i,s,a;switch(Xg(e,r,"encrypt"),e){case"dir":a=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Lg(r))throw new Gb("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:c,apv:l}=o;let{epk:d}=o;d||(d=(await async function(e){if(!Cb(e))throw new TypeError(yg(e,...gg));return Tb.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:u,y:p,crv:f,kty:h}=await rv(d),y=await Cg(r,d,"ECDH-ES"===e?t:e,"ECDH-ES"===e?Og(t):parseInt(e.slice(-5,-2),10),c,l);if(s={epk:{x:u,crv:f,kty:h}},"EC"===h&&(s.epk.y=p),c&&(s.apu=Mb(c)),l&&(s.apv=Mb(l)),"ECDH-ES"===e){a=y;break}a=n||Ug(t);const m=e.slice(-6);i=await kg(m,y,a);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":a=n||Ug(t),i=await(async(e,t,r)=>{if(!Cb(t))throw new TypeError(yg(t,...gg));if(fg(t,e,"encrypt","wrapKey"),jg(e,t),t.usages.includes("encrypt"))return new Uint8Array(await Tb.subtle.encrypt(Bg(e),t,r));if(t.usages.includes("wrapKey")){const n=await Tb.subtle.importKey("raw",r,...Ag);return new Uint8Array(await Tb.subtle.wrapKey("raw",n,t,Bg(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,r,a);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{a=n||Ug(t);const{p2c:c,p2s:l}=o;({encryptedKey:i,...s}=await(async(e,t,r,n=2048,o=og(new Uint8Array(16)))=>{const i=await Pg(o,e,n,t);return{encryptedKey:await kg(e.slice(-6),i,r),p2c:n,p2s:Mb(o)}})(e,r,a,c,l));break}case"A128KW":case"A192KW":case"A256KW":a=n||Ug(t),i=await kg(e,r,a);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{a=n||Ug(t);const{iv:c}=o;({encryptedKey:i,...s}=await async function(e,t,r,n){const o=e.slice(0,7),i=await Wg(o,r,t,n,new Uint8Array(0));return{encryptedKey:i.ciphertext,iv:Mb(i.iv),tag:Mb(i.tag)}}(e,r,a,c));break}default:throw new Gb('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:a,encryptedKey:i,parameters:s}}const ov=Symbol();class iv{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new Xb("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!wg(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new Xb("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(Jg(Xb,new Map,t?.crit,this._protectedHeader,r),void 0!==r.zip)throw new Gb('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');const{alg:n,enc:o}=r;if("string"!=typeof n||!n)throw new Xb('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof o||!o)throw new Xb('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let i,s,a,c,l;if(this._cek&&("dir"===n||"ECDH-ES"===n))throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${n}`);{let r;({cek:s,encryptedKey:i,parameters:r}=await nv(n,o,e,this._cek,this._keyManagementParameters)),r&&(t&&ov in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...r}:this.setUnprotectedHeader(r):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...r}:this.setProtectedHeader(r))}c=this._protectedHeader?Pb.encode(Mb(JSON.stringify(this._protectedHeader))):Pb.encode(""),this._aad?(l=Mb(this._aad),a=jb(c,Pb.encode("."),Pb.encode(l))):a=c;const{ciphertext:d,tag:u,iv:p}=await Wg(o,this._plaintext,s,this._iv,a),f={ciphertext:Mb(d)};return p&&(f.iv=Mb(p)),u&&(f.tag=Mb(u)),i&&(f.encrypted_key=Mb(i)),l&&(f.aad=l),this._protectedHeader&&(f.protected=xb.decode(c)),this._sharedUnprotectedHeader&&(f.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(f.header=this._unprotectedHeader),f}}class sv{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addRecipient(...e){return this.parent.addRecipient(...e)}encrypt(...e){return this.parent.encrypt(...e)}done(){return this.parent}}function av(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new Gb(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function cv(e,t,r){if(Cb(t))return pg(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(yg(t,...gg));return Tb.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(yg(t,...gg,"Uint8Array"))}const lv=async(e,t,r,n)=>{const o=await cv(e,t,"verify");jg(e,o);const i=av(e,o.algorithm);try{return await Tb.subtle.verify(i,o,r,n)}catch{return!1}};async function dv(e,t,r){if(!Rg(e))throw new Wb("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Wb('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Wb("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Wb("JWS Payload missing");if("string"!=typeof e.signature)throw new Wb("JWS Signature missing or incorrect type");if(void 0!==e.header&&!Rg(e.header))throw new Wb("JWS Unprotected Header incorrect type");let n={};if(e.protected)try{const t=Nb(e.protected);n=JSON.parse(xb.decode(t))}catch{throw new Wb("JWS Protected Header is invalid")}if(!wg(n,e.header))throw new Wb("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...n,...e.header};let i=!0;if(Jg(Wb,new Map([["b64",!0]]),r?.crit,n,o).has("b64")&&(i=n.b64,"boolean"!=typeof i))throw new Wb('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Wb('JWS "alg" (Algorithm) Header Parameter missing or invalid');const a=r&&Qg("algorithms",r.algorithms);if(a&&!a.has(s))throw new $b('"alg" (Algorithm) Header Parameter value not allowed');if(i){if("string"!=typeof e.payload)throw new Wb("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Wb("JWS Payload must be a string or an Uint8Array instance");let c=!1;"function"==typeof t&&(t=await t(n,e),c=!0),Xg(s,t,"verify");const l=jb(Pb.encode(e.protected??""),Pb.encode("."),"string"==typeof e.payload?Pb.encode(e.payload):e.payload);let d;try{d=Nb(e.signature)}catch{throw new Wb("Failed to base64url decode the signature")}if(!await lv(s,t,d,l))throw new rg;let u;if(i)try{u=Nb(e.payload)}catch{throw new Wb("Failed to base64url decode the payload")}else u="string"==typeof e.payload?Pb.encode(e.payload):e.payload;const p={payload:u};return void 0!==e.protected&&(p.protectedHeader=n),void 0!==e.header&&(p.unprotectedHeader=e.header),c?{...p,key:t}:p}async function uv(e,t,r){if(e instanceof Uint8Array&&(e=xb.decode(e)),"string"!=typeof e)throw new Wb("Compact JWS must be a string or Uint8Array");const{0:n,1:o,2:i,length:s}=e.split(".");if(3!==s)throw new Wb("Invalid Compact JWS");const a=await dv({payload:o,protected:n,signature:i},t,r),c={payload:a.payload,protectedHeader:a.protectedHeader};return"function"==typeof t?{...c,key:a.key}:c}var pv=e=>Math.floor(e.getTime()/1e3);const fv=86400,hv=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;var yv=e=>{const t=hv.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const r=parseFloat(t[2]);let n;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":n=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":n=Math.round(60*r);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(3600*r);break;case"day":case"days":case"d":n=Math.round(r*fv);break;case"week":case"weeks":case"w":n=Math.round(604800*r);break;default:n=Math.round(31557600*r)}return"-"===t[1]||"ago"===t[4]?-n:n};const mv=e=>e.toLowerCase().replace(/^application\//,"");var bv=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||mv(e.typ)!==mv(n)))throw new Fb('unexpected "typ" JWT header value',"typ","check_failed");let o;try{o=JSON.parse(xb.decode(t))}catch{}if(!Rg(o))throw new Zb("JWT Claims Set must be a top-level JSON object");const{requiredClaims:i=[],issuer:s,subject:a,audience:c,maxTokenAge:l}=r,d=[...i];void 0!==l&&d.push("iat"),void 0!==c&&d.push("aud"),void 0!==a&&d.push("sub"),void 0!==s&&d.push("iss");for(const e of new Set(d.reverse()))if(!(e in o))throw new Fb(`missing required "${e}" claim`,e,"missing");if(s&&!(Array.isArray(s)?s:[s]).includes(o.iss))throw new Fb('unexpected "iss" claim value',"iss","check_failed");if(a&&o.sub!==a)throw new Fb('unexpected "sub" claim value',"sub","check_failed");if(c&&(u=o.aud,p="string"==typeof c?[c]:c,!("string"==typeof u?p.includes(u):Array.isArray(u)&&p.some(Set.prototype.has.bind(new Set(u))))))throw new Fb('unexpected "aud" claim value',"aud","check_failed");var u,p;let f;switch(typeof r.clockTolerance){case"string":f=yv(r.clockTolerance);break;case"number":f=r.clockTolerance;break;case"undefined":f=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:h}=r,y=pv(h||new Date);if((void 0!==o.iat||l)&&"number"!=typeof o.iat)throw new Fb('"iat" claim must be a number',"iat","invalid");if(void 0!==o.nbf){if("number"!=typeof o.nbf)throw new Fb('"nbf" claim must be a number',"nbf","invalid");if(o.nbf>y+f)throw new Fb('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==o.exp){if("number"!=typeof o.exp)throw new Fb('"exp" claim must be a number',"exp","invalid");if(o.exp<=y-f)throw new qb('"exp" claim timestamp check failed',"exp","check_failed")}if(l){const e=y-o.iat;if(e-f>("number"==typeof l?l:yv(l)))throw new qb('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)throw new Fb('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return o};class gv{constructor(e){this._flattened=new iv(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}class vv{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new Wb("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!wg(this._protectedHeader,this._unprotectedHeader))throw new Wb("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(Jg(Wb,new Map([["b64",!0]]),t?.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new Wb('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:o}=r;if("string"!=typeof o||!o)throw new Wb('JWS "alg" (Algorithm) Header Parameter missing or invalid');Xg(o,e,"sign");let i,s=this._payload;n&&(s=Pb.encode(Mb(s))),i=this._protectedHeader?Pb.encode(Mb(JSON.stringify(this._protectedHeader))):Pb.encode("");const a=jb(i,Pb.encode("."),s),c=await(async(e,t,r)=>{const n=await cv(e,t,"sign");jg(e,n);const o=await Tb.subtle.sign(av(e,n.algorithm),n,r);return new Uint8Array(o)})(o,e,a),l={signature:Mb(c),payload:""};return n&&(l.payload=xb.decode(s)),this._unprotectedHeader&&(l.header=this._unprotectedHeader),this._protectedHeader&&(l.protected=xb.decode(i)),l}}class Ev{constructor(e){this._flattened=new vv(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}class wv{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}function Rv(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}class Av{constructor(e={}){if(!Rg(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return"number"==typeof e?this._payload={...this._payload,nbf:Rv("setNotBefore",e)}:e instanceof Date?this._payload={...this._payload,nbf:Rv("setNotBefore",pv(e))}:this._payload={...this._payload,nbf:pv(new Date)+yv(e)},this}setExpirationTime(e){return"number"==typeof e?this._payload={...this._payload,exp:Rv("setExpirationTime",e)}:e instanceof Date?this._payload={...this._payload,exp:Rv("setExpirationTime",pv(e))}:this._payload={...this._payload,exp:pv(new Date)+yv(e)},this}setIssuedAt(e){return void 0===e?this._payload={...this._payload,iat:pv(new Date)}:e instanceof Date?this._payload={...this._payload,iat:Rv("setIssuedAt",pv(e))}:this._payload="string"==typeof e?{...this._payload,iat:Rv("setIssuedAt",pv(new Date)+yv(e))}:{...this._payload,iat:Rv("setIssuedAt",e)},this}}const _v=(e,t)=>{if("string"!=typeof e||!e)throw new Jb(`${t} missing or invalid`)};async function Sv(e,t){if(!Rg(e))throw new TypeError("JWK must be an object");if(t??(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');let r;switch(e.kty){case"EC":_v(e.crv,'"crv" (Curve) Parameter'),_v(e.x,'"x" (X Coordinate) Parameter'),_v(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":_v(e.crv,'"crv" (Subtype of Key Pair) Parameter'),_v(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":_v(e.e,'"e" (Exponent) Parameter'),_v(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":_v(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new Gb('"kty" (Key Type) Parameter missing or unsupported')}const n=Pb.encode(JSON.stringify(r));return Mb(await Lb(t,n))}function kv(e){return Rg(e)}function Tv(e){return"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e))}class Cv{constructor(e){if(this._cached=new WeakMap,!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(kv)}(e))throw new Qb("JSON Web Key Set malformed");this._jwks=Tv(e)}async getKey(e,t){const{alg:r,kid:n}={...e,...t?.header},o=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new Gb('Unsupported "alg" value for a JSON Web Key Set')}}(r),i=this._jwks.keys.filter((e=>{let t=o===e.kty;if(t&&"string"==typeof n&&(t=n===e.kid),t&&"string"==typeof e.alg&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t&&"EdDSA"===r&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t})),{0:s,length:a}=i;if(0===a)throw new Yb;if(1!==a){const e=new eg,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of i)try{yield await Lv(t,e,r)}catch{}},e}return Lv(this._cached,s,r)}}async function Lv(e,t,r){const n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){const e=await Hg({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new Qb("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}function Pv(e){const t=new Cv(e),r=async(e,r)=>t.getKey(e,r);return Object.defineProperties(r,{jwks:{value:()=>Tv(t._jwks),enumerable:!0,configurable:!1,writable:!1}}),r}let xv;if("undefined"==typeof navigator||!navigator.userAgent?.startsWith?.("Mozilla/5.0 ")){xv=`${"jose"}/${"v5.3.0"}`}class Bv{constructor(e,t){if(!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:t?.agent,headers:t?.headers},this._timeoutDuration="number"==typeof t?.timeoutDuration?t?.timeoutDuration:5e3,this._cooldownDuration="number"==typeof t?.cooldownDuration?t?.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof t?.cacheMaxAge?t?.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){this._local&&this.fresh()||await this.reload();try{return await this._local(e,t)}catch(r){if(r instanceof Yb&&!1===this.coolingDown())return await this.reload(),this._local(e,t);throw r}}async reload(){this._pendingFetch&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this._pendingFetch=void 0);const e=new Headers(this._options.headers);xv&&!e.has("User-Agent")&&(e.set("User-Agent",xv),this._options.headers=Object.fromEntries(e.entries())),this._pendingFetch||(this._pendingFetch=(async(e,t,r)=>{let n,o,i=!1;"function"==typeof AbortController&&(n=new AbortController,o=setTimeout((()=>{i=!0,n.abort()}),t));const s=await fetch(e.href,{signal:n?n.signal:void 0,redirect:"manual",headers:r.headers}).catch((e=>{if(i)throw new tg;throw e}));if(void 0!==o&&clearTimeout(o),200!==s.status)throw new zb("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await s.json()}catch{throw new zb("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then((e=>{this._local=Pv(e),this._jwksTimestamp=Date.now(),this._pendingFetch=void 0})).catch((e=>{throw this._pendingFetch=void 0,e}))),await this._pendingFetch}}const jv=Mb,Dv=Nb;var Ov=Object.freeze({__proto__:null,decode:Dv,encode:jv});function Uv(e){const t=e?.modulusLength??2048;if("number"!=typeof t||t<2048)throw new Gb("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return t}var Iv=Object.freeze({__proto__:null,CompactEncrypt:gv,CompactSign:Ev,EmbeddedJWK:async function(e,t){const r={...e,...t?.header};if(!Rg(r.jwk))throw new Wb('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const n=await Hg({...r.jwk,ext:!0},r.alg);if(n instanceof Uint8Array||"public"!==n.type)throw new Wb('"jwk" (JSON Web Key) Header Parameter must be a public key');return n},EncryptJWT:class extends Av{setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(e,t){const r=new gv(Pb.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),r.setProtectedHeader(this._protectedHeader),this._iv&&r.setInitializationVector(this._iv),this._cek&&r.setContentEncryptionKey(this._cek),this._keyManagementParameters&&r.setKeyManagementParameters(this._keyManagementParameters),r.encrypt(e,t)}},FlattenedEncrypt:iv,FlattenedSign:vv,GeneralEncrypt:class{constructor(e){this._recipients=[],this._plaintext=e}addRecipient(e,t){const r=new sv(this,e,{crit:t?.crit});return this._recipients.push(r),r}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}async encrypt(){if(!this._recipients.length)throw new Xb("at least one recipient must be added");if(1===this._recipients.length){const[e]=this._recipients,t=await new iv(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(e.unprotectedHeader).encrypt(e.key,{...e.options}),r={ciphertext:t.ciphertext,iv:t.iv,recipients:[{}],tag:t.tag};return t.aad&&(r.aad=t.aad),t.protected&&(r.protected=t.protected),t.unprotected&&(r.unprotected=t.unprotected),t.encrypted_key&&(r.recipients[0].encrypted_key=t.encrypted_key),t.header&&(r.recipients[0].header=t.header),r}let e;for(let t=0;t<this._recipients.length;t++){const r=this._recipients[t];if(!wg(this._protectedHeader,this._unprotectedHeader,r.unprotectedHeader))throw new Xb("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const n={...this._protectedHeader,...this._unprotectedHeader,...r.unprotectedHeader},{alg:o}=n;if("string"!=typeof o||!o)throw new Xb('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("dir"===o||"ECDH-ES"===o)throw new Xb('"dir" and "ECDH-ES" alg may only be used with a single recipient');if("string"!=typeof n.enc||!n.enc)throw new Xb('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(e){if(e!==n.enc)throw new Xb('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else e=n.enc;if(Jg(Xb,new Map,r.options.crit,this._protectedHeader,n),void 0!==n.zip)throw new Gb('JWE "zip" (Compression Algorithm) Header Parameter is not supported.')}const t=Ug(e),r={ciphertext:"",iv:"",recipients:[],tag:""};for(let n=0;n<this._recipients.length;n++){const o=this._recipients[n],i={};r.recipients.push(i);const s={...this._protectedHeader,...this._unprotectedHeader,...o.unprotectedHeader}.alg.startsWith("PBES2")?2048+n:void 0;if(0===n){const e=await new iv(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(t).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(o.unprotectedHeader).setKeyManagementParameters({p2c:s}).encrypt(o.key,{...o.options,[ov]:!0});r.ciphertext=e.ciphertext,r.iv=e.iv,r.tag=e.tag,e.aad&&(r.aad=e.aad),e.protected&&(r.protected=e.protected),e.unprotected&&(r.unprotected=e.unprotected),i.encrypted_key=e.encrypted_key,e.header&&(i.header=e.header);continue}const{encryptedKey:a,parameters:c}=await nv(o.unprotectedHeader?.alg||this._protectedHeader?.alg||this._unprotectedHeader?.alg,e,o.key,t,{p2c:s});i.encrypted_key=Mb(a),(o.unprotectedHeader||c)&&(i.header={...o.unprotectedHeader,...c})}return r}},GeneralSign:class{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new wv(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new Wb("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t<this._signatures.length;t++){const r=this._signatures[t],n=new vv(this._payload);n.setProtectedHeader(r.protectedHeader),n.setUnprotectedHeader(r.unprotectedHeader);const{payload:o,...i}=await n.sign(r.key,r.options);if(0===t)e.payload=o;else if(e.payload!==o)throw new Wb("inconsistent use of JWS Unencoded Payload (RFC7797)");e.signatures.push(i)}return e}},SignJWT:class extends Av{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){const r=new Ev(Pb.encode(JSON.stringify(this._payload)));if(r.setProtectedHeader(this._protectedHeader),Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new Zb("JWTs MUST NOT use unencoded payload");return r.sign(e,t)}},UnsecuredJWT:class extends Av{encode(){return`${Mb(JSON.stringify({alg:"none"}))}.${Mb(JSON.stringify(this._payload))}.`}static decode(e,t){if("string"!=typeof e)throw new Zb("Unsecured JWT must be a string");const{0:r,1:n,2:o,length:i}=e.split(".");if(3!==i||""!==o)throw new Zb("Invalid Unsecured JWT");let s;try{if(s=JSON.parse(xb.decode(Nb(r))),"none"!==s.alg)throw new Error}catch{throw new Zb("Invalid Unsecured JWT")}return{payload:bv(s,Nb(n),t),header:s}}},base64url:Ov,calculateJwkThumbprint:Sv,calculateJwkThumbprintUri:async function(e,t){t??(t="sha256");const r=await Sv(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${r}`},compactDecrypt:ev,compactVerify:uv,createLocalJWKSet:Pv,createRemoteJWKSet:function(e,t){const r=new Bv(e,t),n=async(e,t)=>r.getKey(e,t);return Object.defineProperties(n,{coolingDown:{get:()=>r.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>r.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>r.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>!!r._pendingFetch,enumerable:!0,configurable:!1},jwks:{value:()=>r._local?.jwks(),enumerable:!0,configurable:!1,writable:!1}}),n},cryptoRuntime:"WebCryptoAPI",decodeJwt:function(e){if("string"!=typeof e)throw new Zb("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:r}=e.split(".");if(5===r)throw new Zb("Only JWTs using Compact JWS serialization can be decoded");if(3!==r)throw new Zb("Invalid JWT");if(!t)throw new Zb("JWTs must contain a payload");let n,o;try{n=Dv(t)}catch{throw new Zb("Failed to base64url decode the payload")}try{o=JSON.parse(xb.decode(n))}catch{throw new Zb("Failed to parse the decoded payload as JSON")}if(!Rg(o))throw new Zb("Invalid JWT Claims Set");return o},decodeProtectedHeader:function(e){let t;if("string"==typeof e){const r=e.split(".");3!==r.length&&5!==r.length||([t]=r)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(xb.decode(Dv(t)));if(!Rg(e))throw new Error;return e}catch{throw new TypeError("Invalid Token or Protected Header formatting")}},errors:ng,exportJWK:rv,exportPKCS8:async function(e){return(e=>Kg("private","pkcs8",e))(e)},exportSPKI:async function(e){return(e=>Kg("public","spki",e))(e)},flattenedDecrypt:Yg,flattenedVerify:dv,generalDecrypt:async function(e,t,r){if(!Rg(e))throw new Xb("General JWE must be an object");if(!Array.isArray(e.recipients)||!e.recipients.every(Rg))throw new Xb("JWE Recipients missing or incorrect type");if(!e.recipients.length)throw new Xb("JWE Recipients has no members");for(const n of e.recipients)try{return await Yg({aad:e.aad,ciphertext:e.ciphertext,encrypted_key:n.encrypted_key,header:n.header,iv:e.iv,protected:e.protected,tag:e.tag,unprotected:e.unprotected},t,r)}catch{}throw new Hb},generalVerify:async function(e,t,r){if(!Rg(e))throw new Wb("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(Rg))throw new Wb("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await dv({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch{}throw new rg},generateKeyPair:async function(e,t){return async function(e,t){let r,n;switch(e){case"PS256":case"PS384":case"PS512":r={name:"RSA-PSS",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Uv(t)},n=["sign","verify"];break;case"RS256":case"RS384":case"RS512":r={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Uv(t)},n=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":r={name:"RSA-OAEP",hash:`SHA-${parseInt(e.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Uv(t)},n=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":r={name:"ECDSA",namedCurve:"P-256"},n=["sign","verify"];break;case"ES384":r={name:"ECDSA",namedCurve:"P-384"},n=["sign","verify"];break;case"ES512":r={name:"ECDSA",namedCurve:"P-521"},n=["sign","verify"];break;case"EdDSA":{n=["sign","verify"];const e=t?.crv??"Ed25519";switch(e){case"Ed25519":case"Ed448":r={name:e};break;default:throw new Gb("Invalid or unsupported crv option provided")}break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{n=["deriveKey","deriveBits"];const e=t?.crv??"P-256";switch(e){case"P-256":case"P-384":case"P-521":r={name:"ECDH",namedCurve:e};break;case"X25519":case"X448":r={name:e};break;default:throw new Gb("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new Gb('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return Tb.subtle.generateKey(r,t?.extractable??!1,n)}(e,t)},generateSecret:async function(e,t){return async function(e,t){let r,n,o;switch(e){case"HS256":case"HS384":case"HS512":r=parseInt(e.slice(-3),10),n={name:"HMAC",hash:`SHA-${r}`,length:r},o=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r=parseInt(e.slice(-3),10),og(new Uint8Array(r>>3));case"A128KW":case"A192KW":case"A256KW":r=parseInt(e.slice(1,4),10),n={name:"AES-KW",length:r},o=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":r=parseInt(e.slice(1,4),10),n={name:"AES-GCM",length:r},o=["encrypt","decrypt"];break;default:throw new Gb('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return Tb.subtle.generateKey(n,t?.extractable??!1,o)}(e,t)},importJWK:Hg,importPKCS8:async function(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return((e,t,r)=>Ng(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",e,t,r))(e,t,r)},importSPKI:async function(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return zg(e,t,r)},importX509:async function(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw new TypeError('"x509" must be X.509 formatted string');return((e,t,r)=>{let n;try{n=$g(e)}catch(e){throw new TypeError("Failed to parse the X.509 certificate",{cause:e})}return zg(n,t,r)})(e,t,r)},jwtDecrypt:async function(e,t,r){const n=await ev(e,t,r),o=bv(n.protectedHeader,n.plaintext,r),{protectedHeader:i}=n;if(void 0!==i.iss&&i.iss!==o.iss)throw new Fb('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==i.sub&&i.sub!==o.sub)throw new Fb('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==i.aud&&JSON.stringify(i.aud)!==JSON.stringify(o.aud))throw new Fb('replicated "aud" claim header parameter mismatch',"aud","mismatch");const s={payload:o,protectedHeader:i};return"function"==typeof t?{...s,key:n.key}:s},jwtVerify:async function(e,t,r){const n=await uv(e,t,r);if(n.protectedHeader.crit?.includes("b64")&&!1===n.protectedHeader.b64)throw new Zb("JWTs MUST NOT use unencoded payload");const o={payload:bv(n.protectedHeader,n.payload,r),protectedHeader:n.protectedHeader};return"function"==typeof t?{...o,key:n.key}:o}}),Kv=r(Iv),Mv={};Object.defineProperty(Mv,"__esModule",{value:!0}),Mv.either=function(e,t){if(null!=e&&null!=t&&e!==t)throw new TypeError(`Expected "${t}", got "${e}"`);return e??t??void 0},Object.defineProperty(kb,"__esModule",{value:!0}),kb.JoseKey=void 0;const Vv=Nm,Nv=Kv,zv=Nm,Fv=Mv,{JOSEError:qv}=Nv.errors;class $v extends zv.Key{#e;async getKey(){try{return this.#e||=await(0,Nv.importJWK)(this.jwk)}catch(e){throw new zv.JwkError("Failed to import JWK",void 0,{cause:e})}}async createJwt(e,t){if(e.kid&&e.kid!==this.kid)throw new zv.JwtCreateError(`Invalid "kid" (${e.kid}) used to sign with key "${this.kid}"`);if(!e.alg||!this.algorithms.includes(e.alg))throw new zv.JwtCreateError(`Invalid "alg" (${e.alg}) used to sign with key "${this.kid}"`);const r=await this.getKey();return new Nv.SignJWT(t).setProtectedHeader({...e,kid:this.kid}).sign(r)}async verifyJwt(e,t){try{const r=await this.getKey();return await(0,Nv.jwtVerify)(e,r,{...t,algorithms:this.algorithms})}catch(e){throw e instanceof qv?new Vv.JwtVerifyError(e.message,e.code,{cause:e}):Vv.JwtVerifyError.from(e)}}static async generateKeyPair(e=["ES256"],t){if(!e.length)throw new zv.JwkError("No algorithms provided for key generation");const r=[];for(const n of e)try{return await(0,Nv.generateKeyPair)(n,t)}catch(e){r.push(e)}throw new zv.JwkError("Failed to generate key pair",void 0,{cause:new AggregateError(r,"None of the algorithms worked")})}static async generate(e=["ES256"],t,r){const n=await this.generateKeyPair(e,{...r,extractable:!0});return this.fromImportable(n.privateKey,t)}static async fromImportable(e,t){if("string"==typeof e){if(e.startsWith("-----"))return this.fromPKCS8(e,"",t);if(e.startsWith("{"))return this.fromJWK(e,t);throw new zv.JwkError("Invalid input")}if("object"==typeof e)return"kty"in e||"alg"in e?this.fromJWK(e,t):this.fromKeyLike(e,t);throw new zv.JwkError("Invalid input")}static async fromKeyLike(e,t,r){const n=await(0,Nv.exportJWK)(e);if(r)if(n.alg){if(n.alg!==r)throw new zv.JwkError('Invalid "alg" in JWK')}else n.alg=r;return this.fromJWK(n,t)}static async fromPKCS8(e,t,r){const n=await(0,Nv.importPKCS8)(e,t,{extractable:!0});return this.fromKeyLike(n,r)}static async fromJWK(e,t){const r="string"==typeof e?JSON.parse(e):e;if(!r||"object"!=typeof r)throw new zv.JwkError("Invalid JWK");const n=(0,Fv.either)(r.kid,t),o=r.use||"sig";return new $v(zv.jwkValidator.parse({...r,kid:n,use:o}))}}kb.JoseKey=$v,function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(kb,t)}(Sb);var Gv={};Object.defineProperty(Gv,"__esModule",{value:!0}),Gv.toSubtleAlgorithm=function(e,t,r){switch(e){case"PS256":case"PS384":case"PS512":return{name:"RSA-PSS",hash:`SHA-${e.slice(-3)}`,modulusLength:r?.modulusLength??2048,publicExponent:new Uint8Array([1,0,1])};case"RS256":case"RS384":case"RS512":return{name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.slice(-3)}`,modulusLength:r?.modulusLength??2048,publicExponent:new Uint8Array([1,0,1])};case"ES256":case"ES384":return{name:"ECDSA",namedCurve:`P-${e.slice(-3)}`};case"ES512":return{name:"ECDSA",namedCurve:"P-521"};default:throw new TypeError(`Unsupported alg "${e}"`)}},Gv.fromSubtleAlgorithm=function(e){switch(e.name){case"RSA-PSS":case"RSASSA-PKCS1-v1_5":{const t=e.hash.name;switch(t){case"SHA-256":case"SHA-384":case"SHA-512":return`${"RSA-PSS"===e.name?"PS":"RS"}${t.slice(-3)}`;default:throw new TypeError("unsupported RsaHashedKeyAlgorithm hash")}}case"ECDSA":{const t=e.namedCurve;switch(t){case"P-256":case"P-384":case"P-512":return`ES${t.slice(-3)}`;case"P-521":return"ES512";default:throw new TypeError("unsupported EcKeyAlgorithm namedCurve")}}case"Ed448":case"Ed25519":return"EdDSA";default:throw new TypeError(`Unexpected algorithm "${e.name}"`)}},Gv.isCryptoKeyPair=function(e,t){return"object"==typeof e&&null!==e&&"privateKey"in e&&e.privateKey instanceof CryptoKey&&"private"===e.privateKey.type&&(null==t||e.privateKey.extractable===t)&&e.privateKey.usages.includes("sign")&&"publicKey"in e&&e.publicKey instanceof CryptoKey&&"public"===e.publicKey.type&&!0===e.publicKey.extractable&&e.publicKey.usages.includes("verify")},Object.defineProperty(Vm,"__esModule",{value:!0}),Vm.WebcryptoKey=void 0;const Hv=Nm,Xv=Sb,Wv=Gv;class Zv extends Xv.JoseKey{static async generate(e=["ES256"],t=crypto.randomUUID(),r){const n=await this.generateKeyPair(e,r);if(!(0,Wv.isCryptoKeyPair)(n))throw new TypeError("Invalid CryptoKeyPair");return this.fromKeypair(n,t)}static async fromKeypair(e,t){const{key_ops:r,...n}=await crypto.subtle.exportKey("jwk",e.privateKey.extractable?e.privateKey:e.publicKey),o=n.use??"sig",i=n.alg??(0,Wv.fromSubtleAlgorithm)(e.privateKey.algorithm);if("sig"!==o)throw new TypeError("Unsupported JWK use");return new Zv(Hv.jwkSchema.parse({...n,use:o,kid:t,alg:i}),e)}constructor(e,t){super(e),Object.defineProperty(this,"cryptoKeyPair",{enumerable:!0,configurable:!0,writable:!0,value:t})}get isPrivate(){return!0}get privateJwk(){if(super.isPrivate)return this.jwk;throw new Error("Private Webcrypto Key not exportable")}async getKey(){return this.cryptoKeyPair.privateKey}}Vm.WebcryptoKey=Zv,function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(Vm,t)}(Mm);var Jv={},Qv={},Yv={},eE={},tE={};Object.defineProperty(tE,"__esModule",{value:!0}),tE.InvalidDidError=tE.DidError=void 0;class rE extends Error{constructor(e,t,r,n=400,o){super(t,{cause:o}),Object.defineProperty(this,"did",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:n})}get statusCode(){return this.status}toString(){return`${this.constructor.name} ${this.code} (${this.did}): ${this.message}`}static from(e,t){if(e instanceof rE)return e;const r=e instanceof Error?e.message:"string"==typeof e?e:"An unknown error occurred",n=("number"==typeof e?.statusCode?e.statusCode:void 0)??("number"==typeof e?.status?e.status:void 0);return new rE(t,r,"did-unknown-error",n,e)}}tE.DidError=rE;tE.InvalidDidError=class extends rE{constructor(e,t,r){super(e,t,"did-invalid",400,r)}};var nE={},oE={};Object.defineProperty(oE,"__esModule",{value:!0}),oE.DID_PLC_PREFIX=void 0,oE.isDidPlc=function(e){if("string"!=typeof e)return!1;if(e.length!==cE)return!1;if(!e.startsWith(sE))return!1;for(let t=aE;t<cE;t++)if(!dE(e.charCodeAt(t)))return!1;return!0},oE.asDidPlc=function(e){return lE(e),e},oE.assertDidPlc=lE;const iE=tE,sE="did:plc:";oE.DID_PLC_PREFIX=sE;const aE=sE.length,cE=32;function lE(e){if("string"!=typeof e)throw new iE.InvalidDidError(typeof e,"DID must be a string");if(e.length!==cE)throw new iE.InvalidDidError(e,`did:plc must be ${cE} characters long`);if(!e.startsWith(sE))throw new iE.InvalidDidError(e,"Invalid did:plc prefix");for(let t=aE;t<cE;t++)if(!dE(e.charCodeAt(t)))throw new iE.InvalidDidError(e,`Invalid character at position ${t}`)}const dE=e=>e>=97&&e<=122||e>=50&&e<=55;var uE={},pE={};Object.defineProperty(pE,"__esModule",{value:!0}),pE.didSchema=pE.DID_PREFIX=void 0,pE.assertDidMethod=bE,pE.extractDidMethod=function(e){const t=e.indexOf(":",mE),r=e.slice(mE,t);return r},pE.assertDidMsid=gE,pE.assertDid=vE,pE.isDid=function(e){try{return vE(e),!0}catch(e){if(e instanceof hE.DidError)return!1;throw e}},pE.asDid=function(e){return vE(e),e};const fE=S,hE=tE,yE="did:";pE.DID_PREFIX=yE;const mE=yE.length;function bE(e,t=0,r=e.length){if(!Number.isFinite(r)||!Number.isFinite(t)||r<t||r>e.length)throw new TypeError("Invalid start or end position");if(r===t)throw new hE.InvalidDidError(e,"Empty method name");let n;for(let o=t;o<r;o++)if(n=e.charCodeAt(o),(n<97||n>122)&&(n<48||n>57))throw new hE.InvalidDidError(e,`Invalid character at position ${o} in DID method name`)}function gE(e,t=0,r=e.length){if(!Number.isFinite(r)||!Number.isFinite(t)||r<t||r>e.length)throw new TypeError("Invalid start or end position");if(r===t)throw new hE.InvalidDidError(e,"DID method-specific id must not be empty");let n;for(let o=t;o<r;o++)if(n=e.charCodeAt(o),(n<97||n>122)&&(n<65||n>90)&&(n<48||n>57)&&46!==n&&45!==n&&95!==n){if(58===n){if(o===r-1)throw new hE.InvalidDidError(e,'DID cannot end with ":"');continue}if(37===n){if(n=e.charCodeAt(++o),(n<48||n>57)&&(n<65||n>70))throw new hE.InvalidDidError(e,`Invalid pct-encoded character at position ${o}`);if(n=e.charCodeAt(++o),(n<48||n>57)&&(n<65||n>70))throw new hE.InvalidDidError(e,`Invalid pct-encoded character at position ${o}`);if(o>=r)throw new hE.InvalidDidError(e,"Incomplete pct-encoded character at position "+(o-2));continue}throw new hE.InvalidDidError(e,`Disallowed character in DID at position ${o}`)}}function vE(e){if("string"!=typeof e)throw new hE.InvalidDidError(typeof e,"DID must be a string");const{length:t}=e;if(t>2048)throw new hE.InvalidDidError(e,"DID is too long (2048 chars max)");if(!e.startsWith(yE))throw new hE.InvalidDidError(e,`DID requires "${yE}" prefix`);const r=e.indexOf(":",mE);if(-1===r)throw new hE.InvalidDidError(e,"Missing colon after method name");bE(e,mE,r),gE(e,r+1,t)}pE.didSchema=fE.z.string().superRefine(((e,t)=>{try{return vE(e),!0}catch(e){return t.addIssue({code:fE.z.ZodIssueCode.custom,message:e instanceof Error?e.message:"Unexpected error"}),!1}})),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DID_WEB_PREFIX=void 0,e.isDidWeb=function(e){if("string"!=typeof e)return!1;try{return n(e),!0}catch{return!1}},e.asDidWeb=function(e){return n(e),e},e.assertDidWeb=n,e.didWebToUrl=o,e.urlToDidWeb=function(e){const t="/"===e.pathname?"":e.pathname.slice(1).split("/").map(encodeURIComponent).join(":");return`did:web:${encodeURIComponent(e.host)}${t?`:${t}`:""}`};const t=tE,r=pE;function n(e){if("string"!=typeof e)throw new t.InvalidDidError(typeof e,"DID must be a string");o(e)}function o(n){if(!n.startsWith(e.DID_WEB_PREFIX))throw new t.InvalidDidError(n,`did:web must start with ${e.DID_WEB_PREFIX}`);if(":"===n.charAt(e.DID_WEB_PREFIX.length))throw new t.InvalidDidError(n,"did:web MSID must not start with a colon");(0,r.assertDidMsid)(n,e.DID_WEB_PREFIX.length);try{const t=n.slice(e.DID_WEB_PREFIX.length).split(":").map(decodeURIComponent),r=new URL(`https://${t.join("/")}`);return"localhost"===r.hostname&&(r.protocol="http:"),r}catch(e){throw new t.InvalidDidError(n,"Invalid Web DID",e)}}e.DID_WEB_PREFIX="did:web:"}(uE),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(oE,t),n(uE,t)}(nE),Object.defineProperty(eE,"__esModule",{value:!0}),eE.atprotoDidSchema=void 0,eE.isAtprotoDid=AE,eE.asAtprotoDid=function(e){return _E(e),e},eE.assertAtprotoDid=_E,eE.assertAtprotoDidWeb=SE,eE.isAtprotoDidWeb=kE;const EE=S,wE=tE,RE=nE;function AE(e){return"string"==typeof e&&(e.startsWith(RE.DID_PLC_PREFIX)?(0,RE.isDidPlc)(e):!!e.startsWith(RE.DID_WEB_PREFIX)&&kE(e))}function _E(e){if("string"!=typeof e)throw new wE.InvalidDidError(typeof e,"DID must be a string");if(e.startsWith(RE.DID_PLC_PREFIX))(0,RE.assertDidPlc)(e);else{if(!e.startsWith(RE.DID_WEB_PREFIX))throw new wE.InvalidDidError(e,'Atproto only allows "plc" and "web" DID methods');SE(e)}}function SE(e){if((0,RE.assertDidWeb)(e),e.includes(":",RE.DID_WEB_PREFIX.length))throw new wE.InvalidDidError(e,"Atproto does not allow path components in Web DIDs");if(e.includes("%3A",RE.DID_WEB_PREFIX.length)&&!e.startsWith("did:web:localhost%3A"))throw new wE.InvalidDidError(e,"Atproto does not allow port numbers in Web DIDs, except for localhost")}function kE(e){try{return SE(e),!0}catch{return!1}}eE.atprotoDidSchema=EE.z.string().refine(AE,'Atproto only allows "plc" and "web" DID methods');var TE={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.didDocumentValidator=e.didDocumentSchema=void 0;const t=S,r=pE,n=t.z.string().refine((e=>{try{return new URL(e),!0}catch{return!1}}),"RFC3968 compliant URI"),o=t.z.union([r.didSchema,t.z.array(r.didSchema)]),i=t.z.union([n,t.z.string().regex(/^#[^#]+$/)]),s=t.z.object({id:i,type:t.z.string().min(1),controller:o,publicKeyJwk:t.z.record(t.z.string(),t.z.unknown()).optional(),publicKeyMultibase:t.z.string().optional()}),a=i,c=t.z.union([t.z.string(),t.z.array(t.z.string())]),l=t.z.union([n,t.z.record(t.z.string(),n),t.z.array(t.z.union([n,t.z.record(t.z.string(),n)])).nonempty()]),d=t.z.object({id:a,type:c,serviceEndpoint:l}),u=t.z.union([i,s]);e.didDocumentSchema=t.z.object({"@context":t.z.union([t.z.literal("https://www.w3.org/ns/did/v1"),t.z.array(t.z.string().url()).nonempty().refine((e=>"https://www.w3.org/ns/did/v1"===e[0]),{message:"First @context must be https://www.w3.org/ns/did/v1"})]),id:r.didSchema,controller:o.optional(),alsoKnownAs:t.z.array(n).optional(),service:t.z.array(d).optional(),authentication:t.z.array(u).optional(),verificationMethod:t.z.array(t.z.union([s,i])).optional()}),e.didDocumentValidator=e.didDocumentSchema.superRefine((({id:e,service:r},n)=>{if(r){const o=new Set;for(let i=0;i<r.length;i++){const s=r[i],a=s.id.startsWith("#")?`${e}${s.id}`:s.id;o.has(a)?n.addIssue({code:t.z.ZodIssueCode.custom,message:`Duplicate service id (${s.id}) found in the document`,path:["service",i,"id"]}):o.add(a)}}}))}(TE),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(eE,t),n(TE,t),n(tE,t),n(pE,t),n(nE,t)}(Yv);var CE={},LE={},PE={};Object.defineProperty(PE,"__esModule",{value:!0}),PE.LRUCache=void 0;const xE="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,BE=new Set,jE="object"==typeof process&&process?process:{},DE=(e,t,r,n)=>{"function"==typeof jE.emitWarning?jE.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)};let OE=globalThis.AbortController,UE=globalThis.AbortSignal;if(void 0===OE){UE=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},OE=class{constructor(){t()}signal=new UE;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==jE.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,DE("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const IE=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),KE=e=>IE(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?ME:null:null;class ME extends Array{constructor(e){super(e),this.fill(0)}}class VE{heap;length;static#t=!1;static create(e){const t=KE(e);if(!t)return[];VE.#t=!0;const r=new VE(e,t);return VE.#t=!1,r}constructor(e,t){if(!VE.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class NE{#r;#n;#o;#i;#s;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#c;#l;#d;#u;#p;#f;#h;#y;#m;#b;#g;#v;#E;#w;#R;#A;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#E,sizes:e.#g,keyMap:e.#l,keyList:e.#d,valList:e.#u,next:e.#p,prev:e.#f,get head(){return e.#h},get tail(){return e.#y},free:e.#m,isBackgroundFetch:t=>e.#_(t),backgroundFetch:(t,r,n,o)=>e.#S(t,r,n,o),moveToTail:t=>e.#k(t),indexes:t=>e.#T(t),rindexes:t=>e.#C(t),isStale:t=>e.#L(t)}}get max(){return this.#r}get maxSize(){return this.#n}get calculatedSize(){return this.#c}get size(){return this.#a}get fetchMethod(){return this.#s}get dispose(){return this.#o}get disposeAfter(){return this.#i}constructor(e){const{max:t=0,ttl:r,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:i,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:l,noDisposeOnSet:d,noUpdateTTL:u,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:h,fetchMethod:y,noDeleteOnFetchRejection:m,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:v,ignoreFetchAbort:E}=e;if(0!==t&&!IE(t))throw new TypeError("max option must be a nonnegative integer");const w=t?KE(t):Array;if(!w)throw new Error("invalid max value: "+t);if(this.#r=t,this.#n=p,this.maxEntrySize=f||this.#n,this.sizeCalculation=h,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==y&&"function"!=typeof y)throw new TypeError("fetchMethod must be a function if specified");if(this.#s=y,this.#R=!!y,this.#l=new Map,this.#d=new Array(t).fill(void 0),this.#u=new Array(t).fill(void 0),this.#p=new w(t),this.#f=new w(t),this.#h=0,this.#y=0,this.#m=VE.create(t),this.#a=0,this.#c=0,"function"==typeof c&&(this.#o=c),"function"==typeof l?(this.#i=l,this.#b=[]):(this.#i=void 0,this.#b=void 0),this.#w=!!this.#o,this.#A=!!this.#i,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!m,this.allowStaleOnFetchRejection=!!g,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!E,0!==this.maxEntrySize){if(0!==this.#n&&!IE(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!IE(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!i,this.updateAgeOnHas=!!s,this.ttlResolution=IE(n)||0===n?n:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!IE(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x()}if(0===this.#r&&0===this.ttl&&0===this.#n)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#r&&!this.#n){const e="LRU_CACHE_UNBOUNDED";if((e=>!BE.has(e))(e)){BE.add(e);DE("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,NE)}}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#x(){const e=new ME(this.#r),t=new ME(this.#r);this.#E=e,this.#v=t,this.#B=(r,n,o=xE.now())=>{if(t[r]=0!==n?o:0,e[r]=n,0!==n&&this.ttlAutopurge){const e=setTimeout((()=>{this.#L(r)&&this.delete(this.#d[r])}),n+1);e.unref&&e.unref()}},this.#j=r=>{t[r]=0!==e[r]?xE.now():0},this.#D=(o,i)=>{if(e[i]){const s=e[i],a=t[i];if(!s||!a)return;o.ttl=s,o.start=a,o.now=r||n();const c=o.now-a;o.remainingTTL=s-c}};let r=0;const n=()=>{const e=xE.now();if(this.ttlResolution>0){r=e;const t=setTimeout((()=>r=0),this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=o=>{const i=this.#l.get(o);if(void 0===i)return 0;const s=e[i],a=t[i];if(!s||!a)return 1/0;return s-((r||n())-a)},this.#L=o=>{const i=t[o],s=e[o];return!!s&&!!i&&(r||n())-i>s}}#j=()=>{};#D=()=>{};#B=()=>{};#L=()=>!1;#P(){const e=new ME(this.#r);this.#c=0,this.#g=e,this.#O=t=>{this.#c-=e[t],e[t]=0},this.#U=(e,t,r,n)=>{if(this.#_(t))return 0;if(!IE(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(t,e),!IE(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#I=(t,r,n)=>{if(e[t]=r,this.#n){const r=this.#n-e[t];for(;this.#c>r;)this.#K(!0)}this.#c+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#c)}}#O=e=>{};#I=(e,t,r)=>{};#U=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#y;this.#M(t)&&(!e&&this.#L(t)||(yield t),t!==this.#h);)t=this.#f[t]}*#C({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#h;this.#M(t)&&(!e&&this.#L(t)||(yield t),t!==this.#y);)t=this.#p[t]}#M(e){return void 0!==e&&this.#l.get(this.#d[e])===e}*entries(){for(const e of this.#T())void 0===this.#u[e]||void 0===this.#d[e]||this.#_(this.#u[e])||(yield[this.#d[e],this.#u[e]])}*rentries(){for(const e of this.#C())void 0===this.#u[e]||void 0===this.#d[e]||this.#_(this.#u[e])||(yield[this.#d[e],this.#u[e]])}*keys(){for(const e of this.#T()){const t=this.#d[e];void 0===t||this.#_(this.#u[e])||(yield t)}}*rkeys(){for(const e of this.#C()){const t=this.#d[e];void 0===t||this.#_(this.#u[e])||(yield t)}}*values(){for(const e of this.#T()){void 0===this.#u[e]||this.#_(this.#u[e])||(yield this.#u[e])}}*rvalues(){for(const e of this.#C()){void 0===this.#u[e]||this.#_(this.#u[e])||(yield this.#u[e])}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#T()){const n=this.#u[r],o=this.#_(n)?n.__staleWhileFetching:n;if(void 0!==o&&e(o,this.#d[r],this))return this.get(this.#d[r],t)}}forEach(e,t=this){for(const r of this.#T()){const n=this.#u[r],o=this.#_(n)?n.__staleWhileFetching:n;void 0!==o&&e.call(t,o,this.#d[r],this)}}rforEach(e,t=this){for(const r of this.#C()){const n=this.#u[r],o=this.#_(n)?n.__staleWhileFetching:n;void 0!==o&&e.call(t,o,this.#d[r],this)}}purgeStale(){let e=!1;for(const t of this.#C({allowStale:!0}))this.#L(t)&&(this.delete(this.#d[t]),e=!0);return e}info(e){const t=this.#l.get(e);if(void 0===t)return;const r=this.#u[t],n=this.#_(r)?r.__staleWhileFetching:r;if(void 0===n)return;const o={value:n};if(this.#E&&this.#v){const e=this.#E[t],r=this.#v[t];if(e&&r){const t=e-(xE.now()-r);o.ttl=t,o.start=Date.now()}}return this.#g&&(o.size=this.#g[t]),o}dump(){const e=[];for(const t of this.#T({allowStale:!0})){const r=this.#d[t],n=this.#u[t],o=this.#_(n)?n.__staleWhileFetching:n;if(void 0===o||void 0===r)continue;const i={value:o};if(this.#E&&this.#v){i.ttl=this.#E[t];const e=xE.now()-this.#v[t];i.start=Math.floor(Date.now()-e)}this.#g&&(i.size=this.#g[t]),e.unshift([r,i])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const e=Date.now()-r.start;r.start=xE.now()-e}this.set(t,r.value,r)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;const{ttl:n=this.ttl,start:o,noDisposeOnSet:i=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const l=this.#U(e,t,r.size||0,s);if(this.maxEntrySize&&l>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.delete(e),this;let d=0===this.#a?void 0:this.#l.get(e);if(void 0===d)d=0===this.#a?this.#y:0!==this.#m.length?this.#m.pop():this.#a===this.#r?this.#K(!1):this.#a,this.#d[d]=e,this.#u[d]=t,this.#l.set(e,d),this.#p[this.#y]=d,this.#f[d]=this.#y,this.#y=d,this.#a++,this.#I(d,l,a),a&&(a.set="add"),c=!1;else{this.#k(d);const r=this.#u[d];if(t!==r){if(this.#R&&this.#_(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;void 0===t||i||(this.#w&&this.#o?.(t,e,"set"),this.#A&&this.#b?.push([t,e,"set"]))}else i||(this.#w&&this.#o?.(r,e,"set"),this.#A&&this.#b?.push([r,e,"set"]));if(this.#O(d),this.#I(d,l,a),this.#u[d]=t,a){a.set="replace";const e=r&&this.#_(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===n||this.#E||this.#x(),this.#E&&(c||this.#B(d,n,o),a&&this.#D(a,d)),!i&&this.#A&&this.#b){const e=this.#b;let t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#a;){const e=this.#u[this.#h];if(this.#K(!0),this.#_(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#A&&this.#b){const e=this.#b;let t;for(;t=e?.shift();)this.#i?.(...t)}}}#K(e){const t=this.#h,r=this.#d[t],n=this.#u[t];return this.#R&&this.#_(n)?n.__abortController.abort(new Error("evicted")):(this.#w||this.#A)&&(this.#w&&this.#o?.(n,r,"evict"),this.#A&&this.#b?.push([n,r,"evict"])),this.#O(t),e&&(this.#d[t]=void 0,this.#u[t]=void 0,this.#m.push(t)),1===this.#a?(this.#h=this.#y=0,this.#m.length=0):this.#h=this.#p[t],this.#l.delete(r),this.#a--,t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,o=this.#l.get(e);if(void 0!==o){const e=this.#u[o];if(this.#_(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#L(o))return r&&this.#j(o),n&&(n.has="hit",this.#D(n,o)),!0;n&&(n.has="stale",this.#D(n,o))}else n&&(n.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,n=this.#l.get(e);if(void 0===n||!r&&this.#L(n))return;const o=this.#u[n];return this.#_(o)?o.__staleWhileFetching:o}#S(e,t,r,n){const o=void 0===t?void 0:this.#u[t];if(this.#_(o))return o;const i=new OE,{signal:s}=r;s?.addEventListener("abort",(()=>i.abort(s.reason)),{signal:i.signal});const a={signal:i.signal,options:r,context:n},c=(n,o=!1)=>{const{aborted:s}=i.signal,c=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!o?(r.status.fetchAborted=!0,r.status.fetchError=i.signal.reason,c&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!c&&!o)return l(i.signal.reason);const u=d;return this.#u[t]===d&&(void 0===n?u.__staleWhileFetching?this.#u[t]=u.__staleWhileFetching:this.delete(e):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,a.options))),n},l=n=>{const{aborted:o}=i.signal,s=o&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,c=a||r.noDeleteOnFetchRejection,l=d;if(this.#u[t]===d){!c||void 0===l.__staleWhileFetching?this.delete(e):s||(this.#u[t]=l.__staleWhileFetching)}if(a)return r.status&&void 0!==l.__staleWhileFetching&&(r.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw n};r.status&&(r.status.fetchDispatched=!0);const d=new Promise(((t,n)=>{const s=this.#s?.(e,o,a);s&&s instanceof Promise&&s.then((e=>t(void 0===e?void 0:e)),n),i.signal.addEventListener("abort",(()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))}))})).then(c,(e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),l(e)))),u=Object.assign(d,{__abortController:i,__staleWhileFetching:o,__returned:void 0});return void 0===t?(this.set(e,u,{...a.options,status:void 0}),t=this.#l.get(e)):this.#u[t]=u,u}#_(e){if(!this.#R)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof OE}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:h,forceRefresh:y=!1,status:m,signal:b}=t;if(!this.#R)return m&&(m.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:m});const g={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:i,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:f,ignoreFetchAbort:p,status:m,signal:b};let v=this.#l.get(e);if(void 0===v){m&&(m.fetch="miss");const t=this.#S(e,v,g,h);return t.__returned=t}{const t=this.#u[v];if(this.#_(t)){const e=r&&void 0!==t.__staleWhileFetching;return m&&(m.fetch="inflight",e&&(m.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const o=this.#L(v);if(!y&&!o)return m&&(m.fetch="hit"),this.#k(v),n&&this.#j(v),m&&this.#D(m,v),t;const i=this.#S(e,v,g,h),s=void 0!==i.__staleWhileFetching&&r;return m&&(m.fetch=o?"stale":"refresh",s&&o&&(m.returnedStale=!0)),s?i.__staleWhileFetching:i.__returned=i}}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:i}=t,s=this.#l.get(e);if(void 0!==s){const t=this.#u[s],a=this.#_(t);return i&&this.#D(i,s),this.#L(s)?(i&&(i.get="stale"),a?(i&&r&&void 0!==t.__staleWhileFetching&&(i.returnedStale=!0),r?t.__staleWhileFetching:void 0):(o||this.delete(e),i&&r&&(i.returnedStale=!0),r?t:void 0)):(i&&(i.get="hit"),a?t.__staleWhileFetching:(this.#k(s),n&&this.#j(s),t))}i&&(i.get="miss")}#V(e,t){this.#f[t]=e,this.#p[e]=t}#k(e){e!==this.#y&&(e===this.#h?this.#h=this.#p[e]:this.#V(this.#f[e],this.#p[e]),this.#V(this.#y,e),this.#y=e)}delete(e){let t=!1;if(0!==this.#a){const r=this.#l.get(e);if(void 0!==r)if(t=!0,1===this.#a)this.clear();else{this.#O(r);const t=this.#u[r];if(this.#_(t)?t.__abortController.abort(new Error("deleted")):(this.#w||this.#A)&&(this.#w&&this.#o?.(t,e,"delete"),this.#A&&this.#b?.push([t,e,"delete"])),this.#l.delete(e),this.#d[r]=void 0,this.#u[r]=void 0,r===this.#y)this.#y=this.#f[r];else if(r===this.#h)this.#h=this.#p[r];else{const e=this.#f[r];this.#p[e]=this.#p[r];const t=this.#p[r];this.#f[t]=this.#f[r]}this.#a--,this.#m.push(r)}}if(this.#A&&this.#b?.length){const e=this.#b;let t;for(;t=e?.shift();)this.#i?.(...t)}return t}clear(){for(const e of this.#C({allowStale:!0})){const t=this.#u[e];if(this.#_(t))t.__abortController.abort(new Error("deleted"));else{const r=this.#d[e];this.#w&&this.#o?.(t,r,"delete"),this.#A&&this.#b?.push([t,r,"delete"])}}if(this.#l.clear(),this.#u.fill(void 0),this.#d.fill(void 0),this.#E&&this.#v&&(this.#E.fill(0),this.#v.fill(0)),this.#g&&this.#g.fill(0),this.#h=0,this.#y=0,this.#m.length=0,this.#c=0,this.#a=0,this.#A&&this.#b){const e=this.#b;let t;for(;t=e?.shift();)this.#i?.(...t)}}}PE.LRUCache=NE;var zE={};Object.defineProperty(zE,"__esModule",{value:!0}),zE.roughSizeOfObject=function(e){const t=new Set,r=[e];let n=0;for(;r.length;){const e=r.pop();switch(typeof e){case"string":n+=12+4*Math.ceil(e.length/4);break;case"number":n+=12;break;case"boolean":n+=4;break;case"object":if(n+=4,null===e)break;if(FE.has(e)){n+=FE.get(e);break}if(t.has(e))continue;if(t.add(e),Array.isArray(e))n+=4,r.push(...e);else{n+=8;const t=Object.getOwnPropertyNames(e);for(let o=0;o<t.length;o++){n+=4;const i=t[o],s=e[i];void 0!==s&&r.push(s),r.push(i)}}break;case"function":case"symbol":n+=8;break;case"bigint":n+=16}}"object"==typeof e&&null!==e&&FE.set(e,n);return n};const FE=new WeakMap;var qE,$E=e&&e.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},GE=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(LE,"__esModule",{value:!0}),LE.SimpleStoreMemory=void 0;const HE=PE,XE=zE,WE=Symbol("nullItem"),ZE=e=>e===WE?null:e;LE.SimpleStoreMemory=class{constructor({sizeCalculation:e,...t}){qE.set(this,void 0),$E(this,qE,new HE.LRUCache({...t,allowStale:!1,updateAgeOnGet:!1,updateAgeOnHas:!1,sizeCalculation:e?(t,r)=>e(ZE(t),r):null!=t.maxEntrySize||null!=t.maxSize?XE.roughSizeOfObject:void 0}),"f")}get(e){const t=GE(this,qE,"f").get(e);if(void 0!==t)return ZE(t)}set(e,t){GE(this,qE,"f").set(e,(e=>null===e?WE:e)(t))}del(e){GE(this,qE,"f").delete(e)}clear(){GE(this,qE,"f").clear()}},qE=new WeakMap,Object.defineProperty(CE,"__esModule",{value:!0}),CE.DidCacheMemory=void 0;const JE=LE,QE=36e5;class YE extends JE.SimpleStoreMemory{constructor(e){super(null==e?.max?{ttl:QE,maxSize:52428800,...e}:{ttl:QE,...e})}}CE.DidCacheMemory=YE;var ew={},tw={},rw={};Object.defineProperty(rw,"__esModule",{value:!0}),rw.CachedGetter=void 0;const nw=()=>!0,ow=()=>!1;rw.CachedGetter=class{constructor(e,t,r){Object.defineProperty(this,"getter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"pending",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}async get(e,t){t?.signal?.throwIfAborted();const r=this.options?.isStale,n=t?.noCache?ow:t?.allowStale||null==r?nw:async t=>!await r(e,t);let o;for(;o=this.pending.get(e);){try{const{isFresh:e,value:t}=await o;if(e)return t;if(await n(t))return t}catch{}t?.signal?.throwIfAborted()}const i=Promise.resolve().then((async()=>{const r=await this.getStored(e,t);return void 0!==r&&await n(r)?{isFresh:!1,value:r}:Promise.resolve().then((async()=>(0,this.getter)(e,t,r))).catch((async t=>{if(void 0!==r)try{const n=this.options?.deleteOnError;await(n?.(t,e,r))&&await this.delStored(e,t)}catch(e){throw new AggregateError([t,e],"Error while deleting stored value")}throw t})).then((async t=>(await this.setStored(e,t),{isFresh:!0,value:t})))})).finally((()=>{this.pending.delete(e)}));if(this.pending.has(e))throw new Error("Concurrent request for the same key");this.pending.set(e,i);const{value:s}=await i;return s}bind(e){return async t=>this.get(e,t)}async getStored(e,t){try{return await this.store.get(e,t)}catch(e){return}}async setStored(e,t){try{await this.store.set(e,t)}catch(r){const n=this.options?.onStoreError;await(n?.(r,e,t))}}async delStored(e,t){await this.store.del(e)}};var iw={};Object.defineProperty(iw,"__esModule",{value:!0}),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(rw,t),n(iw,t)}(tw),Object.defineProperty(ew,"__esModule",{value:!0}),ew.DidResolverCached=void 0;const sw=tw,aw=CE;ew.DidResolverCached=class{constructor(e,t=new aw.DidCacheMemory){Object.defineProperty(this,"getter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.getter=new sw.CachedGetter(((t,r)=>e.resolve(t,r)),t)}async resolve(e,t){return this.getter.get(e,t)}};var cw={};Object.defineProperty(cw,"__esModule",{value:!0});var lw={},dw={},uw={},pw={};Object.defineProperty(pw,"__esModule",{value:!0}),pw.FetchError=void 0;class fw extends Error{constructor(e,t,r){if(null==e||!t){const n=function(e){if("string"==typeof e&&e.length>0)return[500,e];if(!(e instanceof Error))return[500,"Failed to fetch"];const t=e.code;if("string"==typeof t)switch(!0){case"ENOTFOUND"===t:return[400,"Invalid hostname"];case"ECONNREFUSED"===t:return[502,"Connection refused"];case"DEPTH_ZERO_SELF_SIGNED_CERT"===t:return[502,"Self-signed certificate"];case t.startsWith("ERR_TLS"):return[502,"TLS error"];case t.startsWith("ECONN"):return[502,"Connection error"];default:return[500,`${t} error`]}return[500,e.message]}(function(e){if(e instanceof TypeError&&"fetch failed"===e.message&&void 0!==e.cause)return e.cause;return e}(r?.cause));e=e??n[0],t=t||n[1]}super(t,r),Object.defineProperty(this,"statusCode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.statusCode=e}}pw.FetchError=fw;var hw={},yw={};function mw(e,t){return!t&&e instanceof Request?e:new Request(e,t)}Object.defineProperty(yw,"__esModule",{value:!0}),yw.toRequestTransformer=function(e){return function(t,r){return e.call(this,mw(t,r))}},yw.asRequest=mw;var bw={};Object.defineProperty(bw,"__esModule",{value:!0}),bw.extractUrl=bw.MaxBytesTransformStream=bw.ifString=bw.ifObject=void 0,bw.isIp=function(e){return!!e.match(/^\d+\.\d+\.\d+\.\d+$/)||!(!e.startsWith("[")||!e.endsWith("]"))},bw.padLines=function(e,t){return e?t+e.replace(Ew,`$&${t}`):e},bw.cancelBody=ww,bw.logCancellationError=Rw,bw.stringifyMessage=async function(e){try{const t=function(e){return Array.from(e).map((([e,t])=>`${e}: ${t}`)).join("\n")}(e.headers),r=await async function(e){try{const t=await e.blob();if(t.type?.startsWith("text/")){const e=await t.text();return JSON.stringify(e)}if(/application\/(?:\w+\+)?json/.test(t.type)){const e=await t.text();return e.includes("\n")?JSON.stringify(JSON.parse(e)):e}return`[Body size: ${t.size}, type: ${JSON.stringify(t.type)} ]`}catch{return"[Body could not be read]"}}(e);return t&&r?`${t}\n${r}`:t||r}finally{ww(e,"log")}};const gw=Object.prototype;bw.ifObject=e=>{if("object"==typeof e&&null!=e&&!Array.isArray(e)){const t=Object.getPrototypeOf(e);if(null===t||t===gw)return e}};bw.ifString=e=>"string"==typeof e?e:void 0;class vw extends TransformStream{constructor(e){if(!(e>=0))throw new TypeError("maxBytes must be a non-negative number");let t=0;super({transform:(r,n)=>{(t+=r.length)<=e?n.enqueue(r):n.error(new Error("Response too large"))}})}}bw.MaxBytesTransformStream=vw;const Ew=/\r?\n/g;async function ww(e,t){!e.body||e.bodyUsed||e.body.locked||"function"!=typeof e.body.cancel||("function"==typeof t?e.body.cancel().catch(t):"log"===t?e.body.cancel().catch(Rw):await e.body.cancel())}function Rw(e){console.warn("Failed to cancel response body",e)}bw.extractUrl=e=>"string"==typeof e?new URL(e):e instanceof URL?e:new URL(e.url),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_FORBIDDEN_DOMAIN_NAMES=e.FetchRequestError=void 0,e.protocolCheckRequestTransform=function(e){return(t,i)=>{const{protocol:s,port:a}=(0,n.extractUrl)(t),c=(0,r.asRequest)(t,i),l=Object.hasOwn(e,s)?e[s]:void 0;if(!l)throw new o(c,400,`Forbidden protocol "${s}"`);if(!0===l);else if(!l.allowCustomPort&&""!==a)throw new o(c,400,`Custom ${s} ports not allowed`);return c}},e.redirectCheckRequestTransform=function(){return(e,t)=>{const n=(0,r.asRequest)(e,t);if("follow"===n.redirect)throw new o(n,500,'Request redirect must be "error" or "manual"');return n}},e.requireHostHeaderTransform=function(){return(e,t)=>{const{protocol:i,hostname:s}=(0,n.extractUrl)(e),a=(0,r.asRequest)(e,t);if("http:"!==i&&"https:"!==i)throw new o(a,400,`"${i}" requests are not allowed`);if(!s||(0,n.isIp)(s))throw new o(a,400,"Invalid hostname");return a}},e.forbiddenDomainNameRequestTransform=function(t=e.DEFAULT_FORBIDDEN_DOMAIN_NAMES){const i=new Set(t);if(0===i.size)return r.asRequest;return async(e,t)=>{const{hostname:s}=(0,n.extractUrl)(e),a=(0,r.asRequest)(e,t);if(i.has(s))throw new o(a,403,"Forbidden hostname");let c=s.indexOf(".");for(;-1!==c;){const e=s.slice(c+1);if(i.has(`*.${e}`))throw new o(a,403,"Forbidden hostname");c=s.indexOf(".",c+1)}return a}};const t=pw,r=yw,n=bw;class o extends t.FetchError{constructor(e,t,r,n){super(t,r,n),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:e})}static from(e,t){return t instanceof o?t:new o(e,void 0,void 0,{cause:t})}}e.FetchRequestError=o,e.DEFAULT_FORBIDDEN_DOMAIN_NAMES=["example.com","*.example.com","example.org","*.example.org","example.net","*.example.net","googleusercontent.com","*.googleusercontent.com"]}(hw);var Aw={},_w={},Sw={};function kw(e,t){return async r=>t(await e(r))}Object.defineProperty(Sw,"__esModule",{value:!0}),Sw.pipe=function(...e){return e.reduce(kw)},Sw.pipeTwo=kw,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pipeTwo=e.pipe=void 0;var t=Sw;Object.defineProperty(e,"pipe",{enumerable:!0,get:function(){return t.pipe}}),Object.defineProperty(e,"pipeTwo",{enumerable:!0,get:function(){return t.pipeTwo}})}(_w);var Tw,Cw={},Lw=e&&e.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},Pw=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(Cw,"__esModule",{value:!0}),Cw.TransformedResponse=void 0;class xw extends Response{constructor(e,t){if(!e.body)throw new TypeError("Response body is not available");if(e.bodyUsed)throw new TypeError("Response body is already used");super(e.body.pipeThrough(t),{status:e.status,statusText:e.statusText,headers:e.headers}),Tw.set(this,void 0),Lw(this,Tw,e,"f")}get url(){return Pw(this,Tw,"f").url}get redirected(){return Pw(this,Tw,"f").redirected}get type(){return Pw(this,Tw,"f").type}get statusText(){return Pw(this,Tw,"f").statusText}}Cw.TransformedResponse=xw,Tw=new WeakMap,Object.defineProperty(Aw,"__esModule",{value:!0}),Aw.FetchResponseError=void 0,Aw.peekJson=async function(e,t=1/0){if("application/json"!==Vw(e))return;Kw(e,t);const r=e.clone();return(e.body&&t<1/0?new Dw.TransformedResponse(r,new Ow.MaxBytesTransformStream(t)):r).json()},Aw.checkLength=Kw,Aw.extractLength=Mw,Aw.extractMime=Vw,Aw.cancelBodyOnError=Nw,Aw.fetchOkProcessor=function(e){return Nw((t=>zw(t,e)))},Aw.fetchOkTransformer=zw,Aw.fetchMaxSizeProcessor=function(e){if(e===1/0)return e=>e;if(!Number.isFinite(e)||e<0)throw new TypeError("maxBytes must be a 0, Infinity or a positive number");return Nw((t=>Fw(t,e)))},Aw.fetchResponseMaxSizeChecker=Fw,Aw.fetchTypeProcessor=qw,Aw.fetchResponseTypeChecker=$w,Aw.fetchResponseJsonTranformer=Gw,Aw.fetchJsonProcessor=function(e=/^application\/(?:[^+]+\+)?json$/,t=!0){return(0,Bw.pipe)(qw(e,t),Nw(Gw))},Aw.fetchJsonZodProcessor=function(e,t){return async r=>e.parseAsync(r.json,t)};const Bw=_w,jw=pw,Dw=Cw,Ow=bw;class Uw extends jw.FetchError{constructor(e,t=e.status,r=e.statusText,n){super(t,r,n),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:e})}static async from(e,t=Iw,r=e.status,n){const o="string"==typeof t?t:"function"==typeof t?await t(e):void 0;return new Uw(e,r,o,n)}}Aw.FetchResponseError=Uw;const Iw=async e=>{const t=Vw(e);if(t)try{if("text/plain"===t)return await e.text();if(/^application\/(?:[^+]+\+)?json$/i.test(t)){const t=await e.json();if("string"==typeof t)return t;const r=(0,Ow.ifString)((0,Ow.ifObject)(t)?.error_description);if(r)return r;const n=(0,Ow.ifString)((0,Ow.ifObject)(t)?.error);if(n)return n;const o=(0,Ow.ifString)((0,Ow.ifObject)(t)?.message);if(o)return o}}catch{}};function Kw(e,t){if(!(t>=0))throw new TypeError("maxBytes must be a non-negative number");const r=Mw(e);if(null!=r&&r>t)throw new Uw(e,502,"Response too large");return r}function Mw(e){const t=e.headers.get("Content-Length");if(null==t)return;if(!/^\d+$/.test(t))throw new Uw(e,502,"Invalid Content-Length");const r=Number(t);if(!Number.isSafeInteger(r))throw new Uw(e,502,"Content-Length too large");return r}function Vw(e){const t=e.headers.get("Content-Type");if(null!=t)return t.split(";",1)[0].trim()}function Nw(e,t=Ow.logCancellationError){return async r=>{try{return await e(r)}catch(e){throw await(0,Ow.cancelBody)(r,t??void 0),e}}}async function zw(e,t){if(e.ok)return e;throw await Uw.from(e,t)}function Fw(e,t){if(t===1/0)return e;if(Kw(e,t),!e.body)return e;const r=new Ow.MaxBytesTransformStream(t);return new Dw.TransformedResponse(e,r)}function qw(e,t=!0){const r="string"==typeof e?t=>t===e:e instanceof RegExp?t=>e.test(t):e;return Nw((e=>$w(e,r,t)))}async function $w(e,t,r=!0){const n=Vw(e);if(n){if(!t(n))throw await Uw.from(e,`Unexpected response Content-Type (${n})`,502)}else if(r)throw await Uw.from(e,"Missing response Content-Type header",502);return e}async function Gw(e){try{const t=await e.json();return{response:e,json:t}}catch(t){throw new Uw(e,502,"Unable to parse response as JSON",{cause:t})}}var Hw={};Object.defineProperty(Hw,"__esModule",{value:!0}),Hw.timedFetch=void 0,Hw.loggedFetch=function({fetch:e=globalThis.fetch,logRequest:t=!0,logResponse:r=!0,logError:n=!0}){const o=!0===t?async e=>{const t=await(0,Jw.stringifyMessage)(e);console.info(`> ${e.method} ${e.url}\n${(0,Jw.padLines)(t," ")}`)}:t||void 0,i=!0===r?async e=>{const t=await(0,Jw.stringifyMessage)(e.clone());console.info(`< HTTP/1.1 ${e.status} ${e.statusText}\n${(0,Jw.padLines)(t," ")}`)}:r||void 0,s=!0===n?async e=>{console.error("< Error:",e)}:n||void 0;return o||i||s?(0,Ww.toRequestTransformer)((async function(t){o&&await o(t);try{const r=await e.call(this,t);return i&&await i(r,t),r}catch(e){throw s&&await s(e,t),e}})):e},Hw.bindFetch=function(e=globalThis.fetch,t=globalThis){return(0,Ww.toRequestTransformer)((async r=>{try{return await e.call(t,r)}catch(e){throw Xw.FetchRequestError.from(r,e)}}))};const Xw=hw,Ww=yw,Zw=Cw,Jw=bw;Hw.timedFetch=(e=6e4,t=globalThis.fetch)=>{if(e===1/0)return t;if(!Number.isFinite(e)||e<=0)throw new TypeError("Timeout must be positive");return(0,Ww.toRequestTransformer)((async function(r){const n=new AbortController,o=n.signal,i=()=>{n.abort()},s=()=>{clearTimeout(a),r.signal?.removeEventListener("abort",i)},a=setTimeout(i,e);"object"==typeof a&&a.unref?.(),r.signal?.addEventListener("abort",i),o.addEventListener("abort",s);const c=await t.call(this,r,{signal:o});if(c.body){const e=new TransformStream({flush:s});return new Zw.TransformedResponse(c,e)}return s(),c}))},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(pw,t),n(hw,t),n(Aw,t),n(Hw,t),n(yw,t),n(bw,t)}(uw),Object.defineProperty(dw,"__esModule",{value:!0}),dw.DidResolverBase=void 0;const Qw=uw,Yw=Yv,eR=S;dw.DidResolverBase=class{constructor(e){Object.defineProperty(this,"methods",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.methods=new Map(Object.entries(e))}async resolve(e,t){t?.signal?.throwIfAborted();const r=(0,Yw.extractDidMethod)(e),n=this.methods.get(r);if(!n)throw new Yw.DidError(e,"Unsupported DID method","did-method-invalid",400);try{const r=await n.resolve(e,t);if(r.id!==e)throw new Yw.DidError(e,`DID document id (${r.id}) does not match DID`,"did-document-id-mismatch",400);return r}catch(t){if(t instanceof Qw.FetchRequestError)throw new Yw.DidError(e,t.message,"did-fetch-error",400,t);if(t instanceof eR.ZodError)throw new Yw.DidError(e,t.message,"did-document-format-error",503,t);throw Yw.DidError.from(t,e)}}};var tR={};Object.defineProperty(tR,"__esModule",{value:!0}),tR.DidPlcMethod=void 0;const rR=uw,nR=Yv,oR=(0,_w.pipe)((0,rR.fetchOkProcessor)(),(0,rR.fetchJsonProcessor)(/^application\/(did\+ld\+)?json$/),(0,rR.fetchJsonZodProcessor)(nR.didDocumentValidator));tR.DidPlcMethod=class{constructor(e){Object.defineProperty(this,"fetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"plcDirectoryUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.plcDirectoryUrl=new URL(e?.plcDirectoryUrl||"https://plc.directory/"),this.fetch=(0,rR.bindFetch)(e?.fetch)}async resolve(e,t){(0,nR.assertDidPlc)(e);const r=new URL(`/${e}`,this.plcDirectoryUrl);return this.fetch(r,{redirect:"error",headers:{accept:"application/did+ld+json,application/json"},signal:t?.signal}).then(oR)}};var iR={};Object.defineProperty(iR,"__esModule",{value:!0}),iR.DidWebMethod=void 0,iR.buildDidWebDocumentUrl=lR;const sR=uw,aR=Yv,cR=(0,_w.pipe)((0,sR.fetchOkProcessor)(),(0,sR.fetchJsonProcessor)(/^application\/(did\+ld\+)?json$/),(0,sR.fetchJsonZodProcessor)(aR.didDocumentValidator));function lR(e){const t=(0,aR.didWebToUrl)(e);return"/"===t.pathname?new URL("/.well-known/did.json",t):new URL(`${t.pathname}/did.json`,t)}iR.DidWebMethod=class{constructor({fetch:e=globalThis.fetch,allowHttp:t=!0}={}){Object.defineProperty(this,"fetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allowHttp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fetch=(0,sR.bindFetch)(e),this.allowHttp=t}async resolve(e,t){const r=lR(e);if(!this.allowHttp&&"http:"===r.protocol)throw new Error(`Cannot resolve DID document for localhost: ${r}`);return this.fetch(r,{redirect:"error",headers:{accept:"application/did+ld+json,application/json"},signal:t?.signal}).then(cR)}},Object.defineProperty(lw,"__esModule",{value:!0}),lw.DidResolverCommon=void 0;const dR=dw,uR=tR,pR=iR;class fR extends dR.DidResolverBase{constructor(e){super({plc:new uR.DidPlcMethod(e),web:new pR.DidWebMethod(e)})}}lw.DidResolverCommon=fR;var hR={};Object.defineProperty(hR,"__esModule",{value:!0});var yR={};!function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(tR,t),n(iR,t)}(yR);var mR={};Object.defineProperty(mR,"__esModule",{value:!0}),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(Yv,t),n(CE,t),n(ew,t),n(cw,t),n(lw,t),n(hR,t),n(yR,t),n(mR,t)}(Qv);var bR={},gR={};Object.defineProperty(gR,"__esModule",{value:!0}),gR.isResolvedHandle=function(e){return null===e||(0,vR.isAtprotoDid)(e)};const vR=Yv;var ER={};!function(t){var r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AppViewHandleResolver=t.xrpcErrorSchema=void 0;const n=r(S),o=gR;t.xrpcErrorSchema=n.default.object({error:n.default.string(),message:n.default.string().optional()});class i{static from(e,t){return"string"==typeof e||e instanceof URL?new i(e,t):e}constructor(e,t){Object.defineProperty(this,"serviceUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serviceUrl=new URL(e),this.fetch=t?.fetch??globalThis.fetch}async resolve(e,r){const n=new URL("/xrpc/com.atproto.identity.resolveHandle",this.serviceUrl);n.searchParams.set("handle",e);const i=await this.fetch.call(null,n,{cache:r?.noCache?"no-cache":void 0,signal:r?.signal,redirect:"error"}),s=await i.json();if(400===i.status){const e=t.xrpcErrorSchema.parse(s);if("InvalidRequest"===e.error&&"Unable to resolve handle"===e.message)return null}if(!i.ok)throw new TypeError("Invalid response from resolveHandle method");const a=s?.did;if(!(0,o.isResolvedHandle)(a))throw new TypeError("Invalid DID returned from resolveHandle method");return a}}t.AppViewHandleResolver=i}(ER);var wR={},RR={},AR={};Object.defineProperty(AR,"__esModule",{value:!0}),AR.DnsHandleResolver=void 0;const _R=gR,SR="did=";AR.DnsHandleResolver=class{constructor(e){Object.defineProperty(this,"resolveTxt",{enumerable:!0,configurable:!0,writable:!0,value:e})}async resolve(e){const t=await this.resolveTxt.call(null,`_atproto.${e}`);if(!t)return null;for(let e=0;e<t.length;e++){if(!t[e].startsWith(SR))continue;for(let r=e+1;r<t.length;r++)if(t[r].startsWith(SR))return null;const r=t[e].slice(4);return(0,_R.isResolvedHandle)(r)?r:null}return null}};var kR={};Object.defineProperty(kR,"__esModule",{value:!0}),kR.WellKnownHandleResolver=void 0;const TR=gR;kR.WellKnownHandleResolver=class{constructor(e){Object.defineProperty(this,"fetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fetch=e?.fetch??globalThis.fetch}async resolve(e,t){const r=new URL("/.well-known/atproto-did",`https://${e}`);try{const e=await this.fetch.call(null,r,{cache:t?.noCache?"no-cache":void 0,signal:t?.signal,redirect:"error"}),n=(await e.text()).split("\n")[0].trim();return(0,TR.isResolvedHandle)(n)?n:null}catch(e){return t?.signal?.throwIfAborted(),null}}},Object.defineProperty(RR,"__esModule",{value:!0}),RR.AtprotoHandleResolver=void 0;const CR=AR,LR=kR,PR=()=>{};RR.AtprotoHandleResolver=class{constructor(e){Object.defineProperty(this,"httpResolver",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dnsResolver",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dnsResolverFallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.httpResolver=new LR.WellKnownHandleResolver(e),this.dnsResolver=new CR.DnsHandleResolver(e.resolveTxt),this.dnsResolverFallback=e.resolveTxtFallback?new CR.DnsHandleResolver(e.resolveTxtFallback):void 0}async resolve(e,t){t?.signal?.throwIfAborted();const r=new AbortController,{signal:n}=r;t?.signal?.addEventListener("abort",(()=>r.abort()),{signal:n});const o={...t,signal:n};try{const t=this.dnsResolver.resolve(e,o),r=this.httpResolver.resolve(e,o);r.catch(PR);const i=await t;if(i)return i;n.throwIfAborted();const s=await r;return s||(n.throwIfAborted(),this.dnsResolverFallback?.resolve(e,o)??null)}finally{r.abort()}}},Object.defineProperty(wR,"__esModule",{value:!0}),wR.AtprotoDohHandleResolver=void 0;const xR=RR;class BR extends xR.AtprotoHandleResolver{constructor(e){super({...e,resolveTxt:jR(e),resolveTxtFallback:void 0})}}function jR({dohEndpoint:e,fetch:t=globalThis.fetch}){return async r=>{const n=new URL(e);n.searchParams.set("type","TXT"),n.searchParams.set("name",r);const o=await t(n,{method:"GET",headers:{accept:"application/dns-json"},redirect:"follow"});try{const e=o.headers.get("content-type")?.trim();if(!o.ok){const t=e?.startsWith("text/plain")?await o.text():`Failed to resolve ${r}`;throw new TypeError(t)}if("application/dns-json"!==e)throw new TypeError("Unexpected response from DoH server");const t=function(e){if(function(e){return"object"==typeof e&&null!==e&&("Status"in e&&"number"==typeof e.Status&&!("Answer"in e&&!function(e,t){return Array.isArray(e)&&e.every(t)}(e.Answer,OR)))}(e))return e;throw new TypeError("Invalid DoH response")}(await o.json());return t.Answer?.filter(UR).map(IR)??null}finally{!1===o.bodyUsed&&o.body?.cancel().catch(DR)}}}function DR(e){e instanceof DOMException&&"AbortError"===e.name||console.error("An error occurred while cancelling the response body:",e)}function OR(e){return"object"==typeof e&&null!==e&&"name"in e&&"string"==typeof e.name&&"type"in e&&"number"==typeof e.type&&"data"in e&&"string"==typeof e.data&&"TTL"in e&&"number"==typeof e.TTL}function UR(e){return 16===e.type}function IR(e){return e.data.replace(/^"|"$/g,"").replace(/\\"/g,'"')}wR.AtprotoDohHandleResolver=BR;var KR={};Object.defineProperty(KR,"__esModule",{value:!0}),KR.CachedHandleResolver=void 0;const MR=tw,VR=LE;KR.CachedHandleResolver=class{constructor(e,t=new VR.SimpleStoreMemory({max:1e3,ttl:6e5})){Object.defineProperty(this,"getter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.getter=new MR.CachedGetter(((t,r)=>e.resolve(t,r)),t)}async resolve(e,t){return this.getter.get(e,t)}},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(gR,t),n(ER,t),n(wR,t),n(RR,t),n(KR,t)}(bR);var NR={},zR={};Object.defineProperty(zR,"__esModule",{value:!0}),zR.CLIENT_ASSERTION_TYPE_JWT_BEARER=void 0,zR.CLIENT_ASSERTION_TYPE_JWT_BEARER="urn:ietf:params:oauth:client-assertion-type:jwt-bearer";var FR={};function qR(e){return"localhost"===e||"127.0.0.1"===e||"[::1]"===e}Object.defineProperty(FR,"__esModule",{value:!0}),FR.isHostnameIP=function(e){return!!e.match(/^\d+\.\d+\.\d+\.\d+$/)||!(!e.startsWith("[")||!e.endsWith("]"))},FR.isLoopbackHost=qR,FR.isLoopbackUrl=function(e){return qR(("string"==typeof e?new URL(e):e).hostname)},FR.safeUrl=function(e){try{return new URL(e)}catch{return null}},FR.extractUrlPath=function(e){const t=e.startsWith("https://")?8:e.startsWith("http://")?7:-1;if(-1===t)throw new TypeError('URL must use the "https:" or "http:" protocol');const r=e.indexOf("#",t),n=e.indexOf("?",t),o=-1!==n&&(-1===r||n<r)?n:-1,i=-1===r?-1===o?e.length:o:-1===o?r:Math.min(r,o),s=e.indexOf("/",t),a=-1===s||s>i?i:s;if(t===a)throw new TypeError("URL must contain a host");return e.substring(a,i)};var $R={},GR={},HR={};Object.defineProperty(HR,"__esModule",{value:!0}),HR.oauthScopeSchema=void 0;const XR=S;HR.oauthScopeSchema=XR.z.string().regex(/^[\x21\x23-\x5B\x5D-\x7E]+(?: [\x21\x23-\x5B\x5D-\x7E]+)*$/),Object.defineProperty(GR,"__esModule",{value:!0}),GR.isOAuthClientIdLoopback=function(e){try{return QR(e),!0}catch{return!1}},GR.assertOAuthLoopbackClientId=function(e){QR(e)},GR.parseOAuthLoopbackClientId=QR;const WR=HR,ZR=FR,JR="http://localhost";function QR(e){if(!e.startsWith(JR))throw new TypeError(`Loopback ClientID must start with "${JR}"`);if(e.includes("#",JR.length))throw new TypeError("Loopback ClientID must not contain a hash component");const t=e.length>JR.length&&"/"===e[JR.length]?JR.length+1:JR.length;if(e.length===t)return{};if("?"!==e[t])throw new TypeError("Loopback ClientID must not contain a path component");const r=new URLSearchParams(e.slice(t+1));for(const e of r.keys())if("redirect_uri"!==e&&"scope"!==e)throw new TypeError(`Invalid query parameter "${e}" in client ID`);const n=r.get("scope")??void 0;if(null!=n){if(r.getAll("scope").length>1)throw new TypeError("Loopback ClientID must contain at most one scope query parameter");if(!WR.oauthScopeSchema.safeParse(n).success)throw new TypeError("Invalid scope query parameter in client ID")}const o=r.has("redirect_uri")?r.getAll("redirect_uri"):void 0;if(o)for(const e of o){const t=(0,ZR.safeUrl)(e);if(!t)throw new TypeError(`Invalid redirect_uri in client ID: ${e}`);if("http:"!==t.protocol)throw new TypeError(`Loopback ClientID must use "http:" redirect_uri's (got ${e})`);if("localhost"===t.hostname)throw new TypeError(`Loopback ClientID must not use "localhost" as redirect_uri hostname (got ${e})`);if(!(0,ZR.isLoopbackHost)(t.hostname))throw new TypeError(`Loopback ClientID must use loopback addresses as redirect_uri's (got ${e})`)}return{scope:n,redirect_uris:o}}Object.defineProperty($R,"__esModule",{value:!0}),$R.atprotoLoopbackClientMetadata=function(e){const{scope:t="atproto",redirect_uris:r=["http://127.0.0.1/","http://[::1]/"]}=(0,YR.parseOAuthLoopbackClientId)(e);return{client_id:e,scope:t,redirect_uris:r,client_name:"Loopback client",response_types:["code"],grant_types:["authorization_code","refresh_token"],token_endpoint_auth_method:"none",application_type:"native",dpop_bound_access_tokens:!0}};const YR=GR;var eA={};Object.defineProperty(eA,"__esModule",{value:!0}),eA.oauthAccessTokenSchema=void 0;const tA=S;eA.oauthAccessTokenSchema=tA.z.string().min(1);var rA={};Object.defineProperty(rA,"__esModule",{value:!0}),rA.oauthAuthorizationCodeGrantTokenRequestSchema=void 0;const nA=S;rA.oauthAuthorizationCodeGrantTokenRequestSchema=nA.z.object({grant_type:nA.z.literal("authorization_code"),code:nA.z.string().min(1),redirect_uri:nA.z.string().url(),code_verifier:nA.z.string().min(43).max(128).regex(/^[a-zA-Z0-9-._~]+$/).optional()});var oA={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.oauthAuthorizationDetailsSchema=e.oauthAuthorizationDetailSchema=void 0;const t=S;e.oauthAuthorizationDetailSchema=t.z.object({type:t.z.string(),locations:t.z.array(t.z.string().url()).optional(),actions:t.z.array(t.z.string()).optional(),datatypes:t.z.array(t.z.string()).optional(),identifier:t.z.string().optional(),privileges:t.z.array(t.z.string()).optional()}),e.oauthAuthorizationDetailsSchema=t.z.array(e.oauthAuthorizationDetailSchema)}(oA);var iA={};Object.defineProperty(iA,"__esModule",{value:!0}),iA.oauthAuthorizationRequestJarSchema=void 0;const sA=Nm,aA=S;iA.oauthAuthorizationRequestJarSchema=aA.z.object({request:aA.z.union([sA.signedJwtSchema,sA.unsignedJwtSchema])});var cA={},lA={},dA={};Object.defineProperty(dA,"__esModule",{value:!0}),dA.oauthClientIdSchema=void 0;const uA=S;dA.oauthClientIdSchema=uA.z.string().min(1);var pA={};Object.defineProperty(pA,"__esModule",{value:!0}),pA.oauthCodeChallengeMethodSchema=void 0;const fA=S;pA.oauthCodeChallengeMethodSchema=fA.z.enum(["S256","plain"]);var hA={};Object.defineProperty(hA,"__esModule",{value:!0}),hA.oauthResponseTypeSchema=void 0;const yA=S;hA.oauthResponseTypeSchema=yA.z.enum(["code","token","none","code id_token token","code id_token","code token","id_token token","id_token"]);var mA={};Object.defineProperty(mA,"__esModule",{value:!0}),mA.oidcClaimsParameterSchema=void 0;const bA=S;mA.oidcClaimsParameterSchema=bA.z.enum(["auth_time","nonce","acr","name","family_name","given_name","middle_name","nickname","preferred_username","gender","picture","profile","website","birthdate","zoneinfo","locale","updated_at","email","email_verified","phone_number","phone_number_verified","address"]);var gA={};Object.defineProperty(gA,"__esModule",{value:!0}),gA.oidcClaimsPropertiesSchema=void 0;const vA=S,EA=vA.z.union([vA.z.string(),vA.z.number(),vA.z.boolean()]);gA.oidcClaimsPropertiesSchema=vA.z.object({essential:vA.z.boolean().optional(),value:EA.optional(),values:vA.z.array(EA).optional()});var wA={};Object.defineProperty(wA,"__esModule",{value:!0}),wA.oidcEntityTypeSchema=void 0;const RA=S;wA.oidcEntityTypeSchema=RA.z.enum(["userinfo","id_token"]),Object.defineProperty(lA,"__esModule",{value:!0}),lA.oauthAuthorizationRequestParametersSchema=void 0;const AA=Nm,_A=S,SA=oA,kA=dA,TA=pA,CA=hA,LA=HR,PA=mA,xA=gA,BA=wA;lA.oauthAuthorizationRequestParametersSchema=_A.z.object({client_id:kA.oauthClientIdSchema,state:_A.z.string().optional(),redirect_uri:_A.z.string().url().optional(),scope:LA.oauthScopeSchema.optional(),response_type:CA.oauthResponseTypeSchema,code_challenge:_A.z.string().optional(),code_challenge_method:TA.oauthCodeChallengeMethodSchema.default("S256").optional(),dpop_jkt:_A.z.string().optional(),response_mode:_A.z.enum(["query","fragment","form_post"]).optional(),nonce:_A.z.string().optional(),max_age:_A.z.number().int().min(0).optional(),claims:_A.z.record(BA.oidcEntityTypeSchema,_A.z.record(PA.oidcClaimsParameterSchema,_A.z.union([_A.z.literal(null),xA.oidcClaimsPropertiesSchema]))).optional(),login_hint:_A.z.string().min(1).optional(),ui_locales:_A.z.string().regex(/^[a-z]{2}(-[A-Z]{2})?( [a-z]{2}(-[A-Z]{2})?)*$/).optional(),id_token_hint:AA.signedJwtSchema.optional(),display:_A.z.enum(["page","popup","touch","wap"]).optional(),prompt:_A.z.enum(["none","login","consent","select_account"]).optional(),authorization_details:SA.oauthAuthorizationDetailsSchema.optional()}),Object.defineProperty(cA,"__esModule",{value:!0}),cA.oauthAuthorizationRequestParSchema=void 0;const jA=S,DA=iA,OA=lA;cA.oauthAuthorizationRequestParSchema=jA.z.union([OA.oauthAuthorizationRequestParametersSchema,DA.oauthAuthorizationRequestJarSchema]);var UA={},IA={},KA={};Object.defineProperty(KA,"__esModule",{value:!0}),KA.oauthRequestUriSchema=void 0;const MA=S;KA.oauthRequestUriSchema=MA.z.string(),Object.defineProperty(IA,"__esModule",{value:!0}),IA.oauthAuthorizationRequestUriSchema=void 0;const VA=S,NA=KA;IA.oauthAuthorizationRequestUriSchema=VA.z.object({request_uri:NA.oauthRequestUriSchema}),Object.defineProperty(UA,"__esModule",{value:!0}),UA.oauthAuthorizationRequestQuerySchema=void 0;const zA=S,FA=iA,qA=lA,$A=IA;UA.oauthAuthorizationRequestQuerySchema=zA.z.union([qA.oauthAuthorizationRequestParametersSchema,FA.oauthAuthorizationRequestJarSchema,$A.oauthAuthorizationRequestUriSchema]);var GA={},HA={};Object.defineProperty(HA,"__esModule",{value:!0}),HA.oauthIssuerIdentifierSchema=void 0;const XA=S,WA=FR;HA.oauthIssuerIdentifierSchema=XA.z.string().superRefine(((e,t)=>{if(e.endsWith("/"))return t.addIssue({code:XA.z.ZodIssueCode.custom,message:"Issuer URL must not end with a slash"}),!1;const r=(0,WA.safeUrl)(e);if(!r)return t.addIssue({code:XA.z.ZodIssueCode.custom,message:"Invalid url"}),!1;if("https:"!==r.protocol&&"http:"!==r.protocol)return t.addIssue({code:XA.z.ZodIssueCode.custom,message:`Invalid issuer URL protocol "${r.protocol}"`}),!1;if(r.username||r.password)return t.addIssue({code:XA.z.ZodIssueCode.custom,message:"Issuer URL must not contain a username or password"}),!1;if(r.hash||r.search)return t.addIssue({code:XA.z.ZodIssueCode.custom,message:"Issuer URL must not contain a query or fragment"}),!1;return e===("/"===r.pathname?r.origin:r.href)||(t.addIssue({code:XA.z.ZodIssueCode.custom,message:"Issuer URL must be in the canonical form"}),!1)})),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.oauthAuthorizationServerMetadataValidator=e.oauthAuthorizationServerMetadataSchema=void 0;const t=S,r=pA,n=HA;e.oauthAuthorizationServerMetadataSchema=t.z.object({issuer:n.oauthIssuerIdentifierSchema,claims_supported:t.z.array(t.z.string()).optional(),claims_locales_supported:t.z.array(t.z.string()).optional(),claims_parameter_supported:t.z.boolean().optional(),request_parameter_supported:t.z.boolean().optional(),request_uri_parameter_supported:t.z.boolean().optional(),require_request_uri_registration:t.z.boolean().optional(),scopes_supported:t.z.array(t.z.string()).optional(),subject_types_supported:t.z.array(t.z.string()).optional(),response_types_supported:t.z.array(t.z.string()).optional(),response_modes_supported:t.z.array(t.z.string()).optional(),grant_types_supported:t.z.array(t.z.string()).optional(),code_challenge_methods_supported:t.z.array(r.oauthCodeChallengeMethodSchema).min(1).optional(),ui_locales_supported:t.z.array(t.z.string()).optional(),id_token_signing_alg_values_supported:t.z.array(t.z.string()).optional(),display_values_supported:t.z.array(t.z.string()).optional(),request_object_signing_alg_values_supported:t.z.array(t.z.string()).optional(),authorization_response_iss_parameter_supported:t.z.boolean().optional(),authorization_details_types_supported:t.z.array(t.z.string()).optional(),request_object_encryption_alg_values_supported:t.z.array(t.z.string()).optional(),request_object_encryption_enc_values_supported:t.z.array(t.z.string()).optional(),jwks_uri:t.z.string().url().optional(),authorization_endpoint:t.z.string().url(),token_endpoint:t.z.string().url(),token_endpoint_auth_methods_supported:t.z.array(t.z.string()).optional(),token_endpoint_auth_signing_alg_values_supported:t.z.array(t.z.string()).optional(),revocation_endpoint:t.z.string().url().optional(),introspection_endpoint:t.z.string().url().optional(),pushed_authorization_request_endpoint:t.z.string().url().optional(),require_pushed_authorization_requests:t.z.boolean().optional(),userinfo_endpoint:t.z.string().url().optional(),end_session_endpoint:t.z.string().url().optional(),registration_endpoint:t.z.string().url().optional(),dpop_signing_alg_values_supported:t.z.array(t.z.string()).optional(),protected_resources:t.z.array(t.z.string().url()).optional(),client_id_metadata_document_supported:t.z.boolean().optional()}),e.oauthAuthorizationServerMetadataValidator=e.oauthAuthorizationServerMetadataSchema.superRefine(((e,r)=>{e.require_pushed_authorization_requests&&!e.pushed_authorization_request_endpoint&&r.addIssue({code:t.z.ZodIssueCode.custom,message:'"pushed_authorization_request_endpoint" required when "require_pushed_authorization_requests" is true'})})).superRefine(((e,r)=>{e.response_types_supported&&(e.response_types_supported.includes("code")||r.addIssue({code:t.z.ZodIssueCode.custom,message:'Response type "code" is required'}))}))}(GA);var ZA={};Object.defineProperty(ZA,"__esModule",{value:!0}),ZA.oauthClientCredentialsGrantTokenRequestSchema=void 0;const JA=S;ZA.oauthClientCredentialsGrantTokenRequestSchema=JA.z.object({grant_type:JA.z.literal("client_credentials")});var QA={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.oauthClientCredentialsSchema=e.oauthClientCredentialsNoneSchema=e.oauthClientCredentialsSecretPostSchema=e.oauthClientCredentialsJwtBearerSchema=void 0;const t=S,r=Nm,n=dA,o=zR;e.oauthClientCredentialsJwtBearerSchema=t.z.object({client_id:n.oauthClientIdSchema,client_assertion_type:t.z.literal(o.CLIENT_ASSERTION_TYPE_JWT_BEARER),client_assertion:r.signedJwtSchema}),e.oauthClientCredentialsSecretPostSchema=t.z.object({client_id:n.oauthClientIdSchema,client_secret:t.z.string()}),e.oauthClientCredentialsNoneSchema=t.z.object({client_id:n.oauthClientIdSchema}),e.oauthClientCredentialsSchema=t.z.union([e.oauthClientCredentialsJwtBearerSchema,e.oauthClientCredentialsSecretPostSchema,e.oauthClientCredentialsNoneSchema])}(QA);var YA={};Object.defineProperty(YA,"__esModule",{value:!0}),YA.isOAuthClientIdDiscoverable=function(e){try{return t_(e),!0}catch{return!1}},YA.assertOAuthDiscoverableClientId=function(e){t_(e)},YA.parseOAuthDiscoverableClientId=t_;const e_=FR;function t_(e){const t=new URL(e);if("https:"!==t.protocol)throw new TypeError('ClientID must use the "https:" protocol');if(t.username||t.password)throw new TypeError("ClientID must not contain credentials");if(t.hash)throw new TypeError("ClientID must not contain a fragment");if("localhost"===t.hostname)throw new TypeError('ClientID hostname must not be "localhost"');if("/"===t.pathname)throw new TypeError('ClientID must contain a path component (e.g. "/client-metadata.json")');if(t.pathname.endsWith("/"))throw new TypeError("ClientID path must not end with a trailing slash");if((0,e_.isHostnameIP)(t.hostname))throw new TypeError("ClientID hostname must not be an IP address");if((0,e_.extractUrlPath)(e)!==t.pathname)throw new TypeError(`ClientID must be in canonical form ("${t.href}", got "${e}")`);return t}var r_={},n_={};Object.defineProperty(n_,"__esModule",{value:!0}),n_.oauthEndpointAuthMethod=void 0;const o_=S;n_.oauthEndpointAuthMethod=o_.z.enum(["client_secret_basic","client_secret_jwt","client_secret_post","none","private_key_jwt","self_signed_tls_client_auth","tls_client_auth"]);var i_={};Object.defineProperty(i_,"__esModule",{value:!0}),i_.oauthGrantTypeSchema=void 0;const s_=S;i_.oauthGrantTypeSchema=s_.z.enum(["authorization_code","implicit","refresh_token","password","client_credentials","urn:ietf:params:oauth:grant-type:jwt-bearer","urn:ietf:params:oauth:grant-type:saml2-bearer"]),Object.defineProperty(r_,"__esModule",{value:!0}),r_.oauthClientMetadataSchema=void 0;const a_=Nm,c_=S,l_=dA,d_=n_,u_=i_,p_=hA,f_=HR;r_.oauthClientMetadataSchema=c_.z.object({redirect_uris:c_.z.array(c_.z.string().url()).nonempty(),response_types:c_.z.array(p_.oauthResponseTypeSchema).nonempty().default(["code"]),grant_types:c_.z.array(u_.oauthGrantTypeSchema).nonempty().default(["authorization_code"]),scope:f_.oauthScopeSchema.optional(),token_endpoint_auth_method:d_.oauthEndpointAuthMethod.default("none").optional(),token_endpoint_auth_signing_alg:c_.z.string().optional(),userinfo_signed_response_alg:c_.z.string().optional(),userinfo_encrypted_response_alg:c_.z.string().optional(),jwks_uri:c_.z.string().url().optional(),jwks:a_.jwksPubSchema.optional(),application_type:c_.z.enum(["web","native"]).default("web").optional(),subject_type:c_.z.enum(["public","pairwise"]).default("public").optional(),request_object_signing_alg:c_.z.string().optional(),id_token_signed_response_alg:c_.z.string().optional(),authorization_signed_response_alg:c_.z.string().default("RS256").optional(),authorization_encrypted_response_enc:c_.z.enum(["A128CBC-HS256"]).optional(),authorization_encrypted_response_alg:c_.z.string().optional(),client_id:l_.oauthClientIdSchema.optional(),client_name:c_.z.string().optional(),client_uri:c_.z.string().url().optional(),policy_uri:c_.z.string().url().optional(),tos_uri:c_.z.string().url().optional(),logo_uri:c_.z.string().url().optional(),default_max_age:c_.z.number().optional(),require_auth_time:c_.z.boolean().optional(),contacts:c_.z.array(c_.z.string().email()).optional(),tls_client_certificate_bound_access_tokens:c_.z.boolean().optional(),dpop_bound_access_tokens:c_.z.boolean().optional(),authorization_details_types:c_.z.array(c_.z.string()).optional()});var h_={};Object.defineProperty(h_,"__esModule",{value:!0}),h_.OAUTH_ENDPOINT_NAMES=void 0,h_.OAUTH_ENDPOINT_NAMES=["token","revocation","introspection","pushed_authorization_request"];var y_={};Object.defineProperty(y_,"__esModule",{value:!0});var m_={};Object.defineProperty(m_,"__esModule",{value:!0}),m_.oauthParResponseSchema=void 0;const b_=S;m_.oauthParResponseSchema=b_.z.object({request_uri:b_.z.string(),expires_in:b_.z.number().int().positive()});var g_={};Object.defineProperty(g_,"__esModule",{value:!0}),g_.oauthPasswordGrantTokenRequestSchema=void 0;const v_=S;g_.oauthPasswordGrantTokenRequestSchema=v_.z.object({grant_type:v_.z.literal("password"),username:v_.z.string(),password:v_.z.string()});var E_={};Object.defineProperty(E_,"__esModule",{value:!0}),E_.oauthProtectedResourceMetadataSchema=void 0;const w_=S,R_=HA;E_.oauthProtectedResourceMetadataSchema=w_.z.object({resource:w_.z.string().url(),authorization_servers:w_.z.array(R_.oauthIssuerIdentifierSchema).optional(),jwks_uri:w_.z.string().url().optional(),scopes_supported:w_.z.array(w_.z.string()).optional(),bearer_methods_supported:w_.z.array(w_.z.enum(["header","body","query"])).optional(),resource_signing_alg_values_supported:w_.z.array(w_.z.string()).optional(),resource_documentation:w_.z.string().url().optional(),resource_policy_uri:w_.z.string().url().optional(),resource_tos_uri:w_.z.string().url().optional()});var A_={},__={};Object.defineProperty(__,"__esModule",{value:!0}),__.oauthRefreshTokenSchema=void 0;const S_=S;__.oauthRefreshTokenSchema=S_.z.string().min(1),Object.defineProperty(A_,"__esModule",{value:!0}),A_.oauthRefreshTokenGrantTokenRequestSchema=void 0;const k_=S,T_=__;A_.oauthRefreshTokenGrantTokenRequestSchema=k_.z.object({grant_type:k_.z.literal("refresh_token"),refresh_token:T_.oauthRefreshTokenSchema});var C_={};Object.defineProperty(C_,"__esModule",{value:!0}),C_.oauthResponseModeSchema=void 0;const L_=S;C_.oauthResponseModeSchema=L_.z.enum(["query","fragment","form_post"]);var P_={};Object.defineProperty(P_,"__esModule",{value:!0}),P_.oauthTokenIdentificationSchema=void 0;const x_=S,B_=eA,j_=__;P_.oauthTokenIdentificationSchema=x_.z.object({token:x_.z.union([B_.oauthAccessTokenSchema,j_.oauthRefreshTokenSchema]),token_type_hint:x_.z.enum(["access_token","refresh_token"]).optional()});var D_={};Object.defineProperty(D_,"__esModule",{value:!0}),D_.oauthTokenRequestSchema=void 0;const O_=S,U_=rA,I_=ZA,K_=g_,M_=A_;D_.oauthTokenRequestSchema=O_.z.discriminatedUnion("grant_type",[U_.oauthAuthorizationCodeGrantTokenRequestSchema,M_.oauthRefreshTokenGrantTokenRequestSchema,K_.oauthPasswordGrantTokenRequestSchema,I_.oauthClientCredentialsGrantTokenRequestSchema]);var V_={},N_={};Object.defineProperty(N_,"__esModule",{value:!0}),N_.oauthTokenTypeSchema=void 0;const z_=S;N_.oauthTokenTypeSchema=z_.z.union([z_.z.string().regex(/^DPoP$/i).transform((()=>"DPoP")),z_.z.string().regex(/^Bearer$/i).transform((()=>"Bearer"))]),Object.defineProperty(V_,"__esModule",{value:!0}),V_.oauthTokenResponseSchema=void 0;const F_=Nm,q_=S,$_=oA,G_=N_;V_.oauthTokenResponseSchema=q_.z.object({access_token:q_.z.string(),token_type:G_.oauthTokenTypeSchema,scope:q_.z.string().optional(),refresh_token:q_.z.string().optional(),expires_in:q_.z.number().optional(),id_token:F_.signedJwtSchema.optional(),authorization_details:$_.oauthAuthorizationDetailsSchema.optional()}).passthrough(),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(zR,t),n(FR,t),n($R,t),n(eA,t),n(rA,t),n(oA,t),n(iA,t),n(cA,t),n(lA,t),n(UA,t),n(IA,t),n(GA,t),n(ZA,t),n(QA,t),n(YA,t),n(GR,t),n(dA,t),n(r_,t),n(n_,t),n(h_,t),n(i_,t),n(y_,t),n(HA,t),n(m_,t),n(g_,t),n(E_,t),n(A_,t),n(__,t),n(KA,t),n(C_,t),n(hA,t),n(HR,t),n(P_,t),n(D_,t),n(V_,t),n(N_,t),n(mA,t),n(gA,t),n(wA,t)}(NR);var H_={},X_={};!function(t){var r=e&&e.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},n=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.includesSpaceSeparatedValue=t.CustomEventTarget=t.CustomEvent=t.timeoutSignal=void 0,t.contentMime=function(e){return e.get("content-type")?.split(";")[0].trim()},t.combineSignals=function(e){const t=new AbortController,r=function(e){const r=new Error("This operation was aborted",{cause:this.reason});t.abort(r)};for(const n of e)if(n){if(n.aborted)throw t.abort(),new Error("One of the signals is already aborted",{cause:n.reason});n.addEventListener("abort",r,{signal:t.signal})}return t[Symbol.dispose]=()=>{const e=new Error("AbortController was disposed");t.abort(e)},t},Symbol.dispose??(Symbol.dispose=Symbol("@@dispose"));t.timeoutSignal=(e,t)=>{if(!Number.isInteger(e)||e<0)throw new TypeError("Expected a positive integer");t?.signal?.throwIfAborted();const r=new AbortController,{signal:n}=r;t?.signal?.addEventListener("abort",(e=>r.abort(e)),{once:!0,signal:n});const o=setTimeout((e=>r.abort(e)),e,new Error("Timeout"));return o?.unref?.(),n.addEventListener("abort",(()=>clearTimeout(o)),{once:!0,signal:n}),Object.defineProperty(n,Symbol.dispose,{value:()=>r.abort()}),n},t.CustomEvent=globalThis.CustomEvent??(()=>{var e;class t extends Event{constructor(t,n){if(!arguments.length)throw new TypeError("type argument is required");super(t,n),e.set(this,void 0),r(this,e,n?.detail??null,"f")}get detail(){return n(this,e,"f")}}return e=new WeakMap,Object.defineProperties(t.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:"CustomEvent"},detail:{enumerable:!0}}),t})();t.CustomEventTarget=class{constructor(){Object.defineProperty(this,"eventTarget",{enumerable:!0,configurable:!0,writable:!0,value:new EventTarget})}addEventListener(e,t,r){this.eventTarget.addEventListener(e,t,r)}removeEventListener(e,t,r){this.eventTarget.removeEventListener(e,t,r)}dispatchCustomEvent(e,r,n){return this.eventTarget.dispatchEvent(new t.CustomEvent(e,{...n,detail:r}))}};t.includesSpaceSeparatedValue=(e,t)=>{if(0===t.length)throw new TypeError("Value cannot be empty");if(t.includes(" "))throw new TypeError("Value cannot contain spaces");const r=e.length,n=t.length;if(r<n)return!1;let o,i=e.indexOf(t);for(;-1!==i;){if(o=i+n,!(0!==i&&" "!==e[i-1]||o!==r&&" "!==e[o]))return!0;i=e.indexOf(t,o+1)}return!1}}(X_),Object.defineProperty(H_,"__esModule",{value:!0}),H_.OAuthAuthorizationServerMetadataResolver=void 0;const W_=uw,Z_=tw,J_=NR,Q_=X_;H_.OAuthAuthorizationServerMetadataResolver=class extends Z_.CachedGetter{constructor(e,t,r){super((async(e,t)=>this.fetchMetadata(e,t)),e),Object.defineProperty(this,"fetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allowHttpIssuer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fetch=(0,W_.bindFetch)(t),this.allowHttpIssuer=!0===r?.allowHttpIssuer}async get(e,t){const r=J_.oauthIssuerIdentifierSchema.parse(e);if(!this.allowHttpIssuer&&r.startsWith("http:"))throw new TypeError("Unsecure issuer URL protocol only allowed in development and test environments");return super.get(r,t)}async fetchMetadata(e,t){const r=new URL("/.well-known/oauth-authorization-server",e),n=new Request(r,{headers:{accept:"application/json"},cache:t?.noCache?"no-cache":void 0,signal:t?.signal,redirect:"manual"}),o=await this.fetch(n);if(200!==o.status)throw await(0,W_.cancelBody)(o,"log"),await W_.FetchResponseError.from(o,`Unexpected status code ${o.status} for "${r}"`,void 0,{cause:n});if("application/json"!==(0,Q_.contentMime)(o.headers))throw await(0,W_.cancelBody)(o,"log"),await W_.FetchResponseError.from(o,`Unexpected content type for "${r}"`,void 0,{cause:n});const i=J_.oauthAuthorizationServerMetadataValidator.parse(await o.json());if(i.issuer!==e)throw new TypeError(`Invalid issuer ${i.issuer}`);if(!0!==i.client_id_metadata_document_supported)throw new TypeError(`Authorization server "${e}" does not support client_id_metadata_document`);return i}};var Y_={};Object.defineProperty(Y_,"__esModule",{value:!0}),Y_.OAuthCallbackError=void 0;class eS extends Error{static from(e,t,r){if(e instanceof eS)return e;const n=e instanceof Error?e.message:void 0;return new eS(t,n,r,e)}constructor(e,t=e.get("error_description")||"OAuth callback error",r,n){super(t,{cause:n}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:r})}}Y_.OAuthCallbackError=eS;var tS={},rS={},nS={};Object.defineProperty(nS,"__esModule",{value:!0}),nS.IdentityResolver=void 0;const oS=bR,iS=F;function sS(e){return"string"==typeof e.serviceEndpoint&&"AtprotoPersonalDataServer"===e.type&&(e.id.startsWith("#")?"#atproto_pds"===e.id:e.id===`${this.id}#atproto_pds`)}nS.IdentityResolver=class{constructor(e,t){Object.defineProperty(this,"didResolver",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"handleResolver",{enumerable:!0,configurable:!0,writable:!0,value:t})}async resolve(e,t){const r=(0,oS.isResolvedHandle)(e)?await this.getDocumentFromDid(e,t):await this.getDocumentFromHandle(e,t),n=r.service?.find(sS,r);if(!n)throw new TypeError(`No valid "AtprotoPersonalDataServer" service found in "${r.id}" DID document`);return{did:r.id,pds:new URL(n.serviceEndpoint)}}async getDocumentFromDid(e,t){return this.didResolver.resolve(e,t)}async getDocumentFromHandle(e,t){const r=(0,iS.normalizeAndEnsureValidHandle)(e),n=await this.handleResolver.resolve(r,t);if(!n)throw new TypeError(`Handle "${r}" does not resolve to a DID`);t?.signal?.throwIfAborted();const o=await this.didResolver.resolve(n,t);if(!o.alsoKnownAs?.includes(`at://${r}`))throw new TypeError(`Did document for "${n}" does not include the handle "${r}"`);return o}},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(nS,t)}(rS);var aS={};Object.defineProperty(aS,"__esModule",{value:!0}),aS.FALLBACK_ALG=void 0,aS.FALLBACK_ALG="ES256";var cS={};Object.defineProperty(cS,"__esModule",{value:!0}),cS.TokenRevokedError=void 0;class lS extends Error{constructor(e,t=`The session for "${e}" was successfully revoked`,r){super(t,r),Object.defineProperty(this,"sub",{enumerable:!0,configurable:!0,writable:!0,value:e})}}cS.TokenRevokedError=lS;var dS={};Object.defineProperty(dS,"__esModule",{value:!0}),dS.OAuthProtectedResourceMetadataResolver=void 0;const uS=uw,pS=tw,fS=NR,hS=X_;dS.OAuthProtectedResourceMetadataResolver=class extends pS.CachedGetter{constructor(e,t=globalThis.fetch,r){super((async(e,t)=>this.fetchMetadata(e,t)),e),Object.defineProperty(this,"fetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allowHttpResource",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fetch=(0,uS.bindFetch)(t),this.allowHttpResource=!0===r?.allowHttpResource}async get(e,t){const{protocol:r,origin:n}=new URL(e);if("https:"!==r&&"http:"!==r)throw new TypeError(`Invalid protected resource metadata URL protocol: ${r}`);if("http:"===r&&!this.allowHttpResource)throw new TypeError(`Unsecure resource metadata URL (${r}) only allowed in development and test environments`);return super.get(n,t)}async fetchMetadata(e,t){const r=new URL("/.well-known/oauth-protected-resource",e),n=new Request(r,{signal:t?.signal,headers:{accept:"application/json"},cache:t?.noCache?"no-cache":void 0,redirect:"manual"}),o=await this.fetch(n);if(200!==o.status)throw await(0,uS.cancelBody)(o,"log"),await uS.FetchResponseError.from(o,`Unexpected status code ${o.status} for "${r}"`,void 0,{cause:n});if("application/json"!==(0,hS.contentMime)(o.headers))throw await(0,uS.cancelBody)(o,"log"),await uS.FetchResponseError.from(o,`Unexpected content type for "${r}"`,void 0,{cause:n});const i=fS.oauthProtectedResourceMetadataSchema.parse(await o.json());if(i.resource!==e)throw new TypeError(`Invalid issuer ${i.resource}`);return i}};var yS={},mS={};Object.defineProperty(mS,"__esModule",{value:!0}),mS.OAuthResolverError=void 0;class bS extends Error{constructor(e,t){super(e,t)}static from(e,t){return e instanceof bS?e:new bS(t??"Unable to resolve identity",{cause:e})}}mS.OAuthResolverError=bS,Object.defineProperty(yS,"__esModule",{value:!0}),yS.OAuthResolver=void 0;const gS=NR,vS=mS;yS.OAuthResolver=class{constructor(e,t,r){Object.defineProperty(this,"identityResolver",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"protectedResourceMetadataResolver",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"authorizationServerMetadataResolver",{enumerable:!0,configurable:!0,writable:!0,value:r})}async resolve(e,t){return/^https?:\/\//.test(e)?this.resolveFromService(e,t):this.resolveFromIdentity(e,t)}async resolveFromService(e,t){try{return{metadata:await this.getResourceServerMetadata(e,t)}}catch(r){if(!t?.signal?.aborted&&r instanceof vS.OAuthResolverError)try{const r=gS.oauthIssuerIdentifierSchema.safeParse(e);if(r.success){return{metadata:await this.getAuthorizationServerMetadata(r.data,t)}}}catch{}throw r}}async resolveFromIdentity(e,t){const r=await this.resolveIdentity(e,t);t?.signal?.throwIfAborted();return{identity:r,metadata:await this.getResourceServerMetadata(r.pds,t)}}async resolveIdentity(e,t){try{return await this.identityResolver.resolve(e,t)}catch(t){throw vS.OAuthResolverError.from(t,`Failed to resolve identity: ${e}`)}}async getAuthorizationServerMetadata(e,t){try{return await this.authorizationServerMetadataResolver.get(e,t)}catch(t){throw vS.OAuthResolverError.from(t,`Failed to resolve OAuth server metadata for issuer: ${e}`)}}async getResourceServerMetadata(e,t){try{const r=await this.protectedResourceMetadataResolver.get(e,t);if(1!==r.authorization_servers?.length)throw new vS.OAuthResolverError(r.authorization_servers?.length?`Unable to determine authorization server for PDS: ${e}`:`No authorization servers found for PDS: ${e}`);const n=r.authorization_servers[0];t?.signal?.throwIfAborted();const o=await this.getAuthorizationServerMetadata(n,t);if(o.protected_resources&&!o.protected_resources.includes(r.resource))throw new vS.OAuthResolverError(`PDS "${e}" not protected by issuer "${n}"`);return o}catch(t){throw vS.OAuthResolverError.from(t,`Failed to resolve OAuth server metadata for resource: ${e}`)}}};var ES={},wS={},RS={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.atprotoTokenResponseSchema=e.atprotoScopeSchema=e.isAtprotoScope=void 0;const t=Yv,r=NR,n=S,o=X_;e.isAtprotoScope=e=>(0,o.includesSpaceSeparatedValue)(e,"atproto"),e.atprotoScopeSchema=n.z.string().refine(e.isAtprotoScope,'The "atproto" scope is required'),e.atprotoTokenResponseSchema=r.oauthTokenResponseSchema.extend({token_type:n.z.literal("DPoP"),sub:t.atprotoDidSchema,scope:e.atprotoScopeSchema,id_token:n.z.never().optional()})}(RS);var AS={};Object.defineProperty(AS,"__esModule",{value:!0}),AS.TokenRefreshError=void 0;class _S extends Error{constructor(e,t,r){super(t,r),Object.defineProperty(this,"sub",{enumerable:!0,configurable:!0,writable:!0,value:e})}}AS.TokenRefreshError=_S;var SS={};Object.defineProperty(SS,"__esModule",{value:!0}),SS.dpopFetchWrapper=function({key:e,iss:t,supportedAlgs:r,nonces:n,sha256:o=(void 0!==CS?xS:void 0),isAuthServer:i,fetch:s=globalThis.fetch}){if(!o)throw new TypeError("crypto.subtle is not available in this environment. Please provide a sha256 function.");const a=function(e,t){if(t){const r=t.find((t=>e.algorithms.includes(t)));if(r)return r}else{const[t]=e.algorithms;if(t)return t}throw new Error("Key does not match any alg supported by the server")}(e,r);return async function(r,c){if(!e.algorithms.includes(a))throw new TypeError(`Key does not support the algorithm ${a}`);const l=null==c&&r instanceof Request?r:new Request(r,c),d=l.headers.get("Authorization"),u=d?.startsWith("DPoP ")?await o(d.slice(5)):void 0,{method:p,url:f}=l,{origin:h}=new URL(f);let y;try{y=await n.get(h)}catch{}const m=await PS(e,a,t,p,f,y,u);l.headers.set("DPoP",m);const b=await s.call(this,l),g=b.headers.get("DPoP-Nonce");if(!g||g===y)return b;try{await n.set(h,g)}catch{}const v=await async function(e,t){if((void 0===t||!1===t)&&401===e.status){const t=e.headers.get("WWW-Authenticate");if(t?.startsWith("DPoP"))return t.includes('error="use_dpop_nonce"')}if((void 0===t||!0===t)&&400===e.status)try{const t=await(0,kS.peekJson)(e,10240);return"object"==typeof t&&"use_dpop_nonce"===t?.error}catch{return!1}return!1}(b,i);if(!v)return b;if(r===l)return b;if(LS&&c?.body instanceof LS)return b;await(0,kS.cancelBody)(b,"log");const E=await PS(e,a,t,p,f,g,u),w=new Request(r,c);return w.headers.set("DPoP",E),s.call(this,w)}};const kS=uw,TS=eb,CS=globalThis.crypto?.subtle,LS=globalThis.ReadableStream;async function PS(e,t,r,n,o,i,s){if(!e.bareJwk)throw new Error("Only asymmetric keys can be used as DPoP proofs");const a=Math.floor(Date.now()/1e3);return e.createJwt({alg:t,typ:"dpop+jwt",jwk:e.bareJwk},{iss:r,iat:a,jti:Math.random().toString(36).slice(2),htm:n,htu:o,nonce:i,ath:s})}async function xS(e){if(null==CS)throw new Error("crypto.subtle is not available in this environment. Please provide a sha256 function.");const t=(new TextEncoder).encode(e),r=await CS.digest("SHA-256",t),n=new Uint8Array(r);return TS.base64url.baseEncode(n)}var BS={};Object.defineProperty(BS,"__esModule",{value:!0}),BS.OAuthResponseError=void 0;const jS=uw;class DS extends Error{constructor(e,t){const r=(0,jS.ifString)((0,jS.ifObject)(t)?.error),n=(0,jS.ifString)((0,jS.ifObject)(t)?.error_description);super(`OAuth ${r?`"${r}"`:"unknown"} error${n?`: ${n}`:""}`),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"payload",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"errorDescription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.error=r,this.errorDescription=n}get status(){return this.response.status}get headers(){return this.response.headers}}BS.OAuthResponseError=DS;var OS=e&&e.__addDisposableResource||function(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t},US=e&&e.__disposeResources||function(e){return function(t){function r(r){t.error=t.hasError?new e(r,t.error,"An error was suppressed during disposal."):r,t.hasError=!0}var n,o=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===o)return o=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var i=n.dispose.call(n.value);if(n.async)return o|=2,Promise.resolve(i).then(e,(function(t){return r(t),e()}))}else o|=1}catch(e){r(e)}if(1===o)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});Object.defineProperty(wS,"__esModule",{value:!0}),wS.OAuthServerAgent=void 0;const IS=uw,KS=NR,MS=RS,VS=aS,NS=AS,zS=SS,FS=BS,qS=X_;wS.OAuthServerAgent=class{constructor(e,t,r,n,o,i,s,a){Object.defineProperty(this,"dpopKey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"serverMetadata",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"clientMetadata",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"dpopNonces",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"oauthResolver",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"runtime",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"keyset",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"dpopFetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dpopFetch=(0,zS.dpopFetchWrapper)({fetch:(0,IS.bindFetch)(a),iss:r.client_id,key:e,supportedAlgs:t.dpop_signing_alg_values_supported,sha256:async e=>i.sha256(e),nonces:n,isAuthServer:!0})}get issuer(){return this.serverMetadata.issuer}async revoke(e){try{await this.request("revocation",{token:e})}catch{}}async exchangeCode(e,t){const r=Date.now(),n=await this.request("token",{grant_type:"authorization_code",redirect_uri:this.clientMetadata.redirect_uris[0],code:e,code_verifier:t});try{return{aud:await this.verifyIssuer(n.sub),sub:n.sub,iss:this.issuer,scope:n.scope,refresh_token:n.refresh_token,access_token:n.access_token,token_type:n.token_type,expires_at:"number"==typeof n.expires_in?new Date(r+1e3*n.expires_in).toISOString():void 0}}catch(e){throw await this.revoke(n.access_token),e}}async refresh(e){if(!e.refresh_token)throw new NS.TokenRefreshError(e.sub,"No refresh token available");const t=await this.verifyIssuer(e.sub),r=Date.now(),n=await this.request("token",{grant_type:"refresh_token",refresh_token:e.refresh_token});return{aud:t,sub:e.sub,iss:this.issuer,scope:n.scope,refresh_token:n.refresh_token,access_token:n.access_token,token_type:n.token_type,expires_at:"number"==typeof n.expires_in?new Date(r+1e3*n.expires_in).toISOString():void 0}}async verifyIssuer(e){const t={stack:[],error:void 0,hasError:!1};try{const r=OS(t,(0,qS.timeoutSignal)(1e4),!1),n=await this.oauthResolver.resolveFromIdentity(e,{noCache:!0,allowStale:!1,signal:r});if(this.issuer!==n.metadata.issuer)throw new TypeError("Issuer mismatch");return n.identity.pds.href}catch(e){t.error=e,t.hasError=!0}finally{US(t)}}async request(e,t){const r=this.serverMetadata[`${e}_endpoint`];if(!r)throw new Error(`No ${e} endpoint available`);const n=await this.buildClientAuth(e),{response:o,json:i}=await this.dpopFetch(r,{method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify({...t,...n.payload})}).then((0,IS.fetchJsonProcessor)());if(!o.ok)throw new FS.OAuthResponseError(o,i);switch(e){case"token":return MS.atprotoTokenResponseSchema.parse(i);case"pushed_authorization_request":return KS.oauthParResponseSchema.parse(i);default:return i}}async buildClientAuth(e){const t=this.serverMetadata.token_endpoint_auth_methods_supported,r=this.clientMetadata.token_endpoint_auth_method;if("private_key_jwt"===r||this.keyset&&!r&&t?.includes("private_key_jwt")){if(!this.keyset)throw new Error("No keyset available");try{const e=this.serverMetadata.token_endpoint_auth_signing_alg_values_supported??VS.FALLBACK_ALG,t=this.clientMetadata.jwks?.keys.map((({kid:e})=>e)).filter((e=>"string"==typeof e));return{payload:{client_id:this.clientMetadata.client_id,client_assertion_type:KS.CLIENT_ASSERTION_TYPE_JWT_BEARER,client_assertion:await this.keyset.createJwt({alg:e,kid:t},{iss:this.clientMetadata.client_id,sub:this.clientMetadata.client_id,aud:this.serverMetadata.issuer,jti:await this.runtime.generateNonce(),iat:Math.floor(Date.now()/1e3)})}}}catch(e){if("private_key_jwt"===r)throw e}}if("none"===r||!r&&(t?.includes("none")??1))return{payload:{client_id:this.clientMetadata.client_id}};throw new Error(`Unsupported ${e} authentication method`)}},Object.defineProperty(ES,"__esModule",{value:!0}),ES.OAuthServerFactory=void 0;const $S=wS;ES.OAuthServerFactory=class{constructor(e,t,r,n,o,i){Object.defineProperty(this,"clientMetadata",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"runtime",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"resolver",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"fetch",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"keyset",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"dpopNonceCache",{enumerable:!0,configurable:!0,writable:!0,value:i})}async fromIssuer(e,t,r){const n=await this.resolver.getAuthorizationServerMetadata(e,r);return this.fromMetadata(n,t)}async fromMetadata(e,t){return new $S.OAuthServerAgent(t,e,this.clientMetadata,this.dpopNonceCache,this.resolver,this.runtime,this.keyset,this.fetch)}};var GS={},HS={};Object.defineProperty(HS,"__esModule",{value:!0}),HS.TokenInvalidError=void 0;class XS extends Error{constructor(e,t=`The session for "${e}" is invalid`,r){super(t,r),Object.defineProperty(this,"sub",{enumerable:!0,configurable:!0,writable:!0,value:e})}}HS.TokenInvalidError=XS,Object.defineProperty(GS,"__esModule",{value:!0}),GS.OAuthSession=void 0;const WS=uw,ZS=HS,JS=cS,QS=SS,YS=globalThis.ReadableStream;function ek(e){if(401!==e.status)return!1;const t=e.headers.get("WWW-Authenticate");return null!=t&&(t.startsWith("Bearer ")||t.startsWith("DPoP "))&&t.includes('error="invalid_token"')}GS.OAuthSession=class{constructor(e,t,r,n=globalThis.fetch){Object.defineProperty(this,"server",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"sub",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"sessionGetter",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"dpopFetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dpopFetch=(0,QS.dpopFetchWrapper)({fetch:(0,WS.bindFetch)(n),iss:e.clientMetadata.client_id,key:e.dpopKey,supportedAlgs:e.serverMetadata.dpop_signing_alg_values_supported,sha256:async t=>e.runtime.sha256(t),nonces:e.dpopNonces,isAuthServer:!1})}get did(){return this.sub}get serverMetadata(){return this.server.serverMetadata}async getTokenSet(e){const{tokenSet:t}=await this.sessionGetter.get(this.sub,{noCache:!0===e,allowStale:!1===e});return t}async getTokenInfo(e="auto"){const t=await this.getTokenSet(e),r=null==t.expires_at?void 0:new Date(t.expires_at);return{expiresAt:r,get expired(){return null==r?void 0:r.getTime()<Date.now()-5e3},scope:t.scope,iss:t.iss,aud:t.aud,sub:t.sub}}async signOut(){try{const e=await this.getTokenSet(!1);await this.server.revoke(e.access_token)}finally{await this.sessionGetter.delStored(this.sub,new JS.TokenRevokedError(this.sub))}}async fetchHandler(e,t){const r=await this.getTokenSet("auto"),n=new URL(e,r.aud),o=`${r.token_type} ${r.access_token}`,i=new Headers(t?.headers);i.set("Authorization",o);const s=await this.dpopFetch(n,{...t,headers:i});if(!ek(s))return s;let a;try{a=await this.getTokenSet(!0)}catch(e){return s}if(YS&&t?.body instanceof YS)return s;const c=`${a.token_type} ${a.access_token}`,l=new URL(e,a.aud);i.set("Authorization",c);const d=await this.dpopFetch(l,{...t,headers:i});return ek(d)&&await this.sessionGetter.delStored(this.sub,new ZS.TokenInvalidError(this.sub)),d}};var tk={},rk={};Object.defineProperty(rk,"__esModule",{value:!0}),rk.requestLocalLock=void 0;const nk=new Map;rk.requestLocalLock=(e,t)=>function(e){return new Promise((t=>{const r=(nk.get(e)??Promise.resolve()).then((()=>new Promise((n=>{t((()=>{nk.get(e)===r&&nk.delete(e),n()}))}))));nk.set(e,r)}))}(e).then((async e=>{try{return await t()}finally{e()}})),Object.defineProperty(tk,"__esModule",{value:!0}),tk.Runtime=void 0;const ok=eb,ik=rk;function sk(e,t){if("ES256K"===e)return-1;if("ES256K"===t)return 1;for(const r of["ES","PS","RS"]){if(e.startsWith(r)){if(t.startsWith(r)){return parseInt(e.slice(2,5))-parseInt(t.slice(2,5))}return-1}if(t.startsWith(r))return 1}return 0}tk.Runtime=class{constructor(e){Object.defineProperty(this,"implementation",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"hasImplementationLock",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"usingLock",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const{requestLock:t}=e;this.hasImplementationLock=null!=t,this.usingLock=t?.bind(e)||ik.requestLocalLock}async generateKey(e){const t=Array.from(e).sort(sk);return this.implementation.createKey(t)}async sha256(e){const t=(new TextEncoder).encode(e),r=await this.implementation.digest(t,{name:"sha256"});return ok.base64url.baseEncode(r)}async generateNonce(e=16){const t=await this.implementation.getRandomValues(e);return ok.base64url.baseEncode(t)}async generatePKCE(e){const t=await this.generateVerifier(e);return{verifier:t,challenge:await this.sha256(t),method:"S256"}}async calculateJwkThumbprint(e){const t=function(e){const t=t=>{const r=e[t];if("string"!=typeof r||!r)throw new TypeError(`"${t}" Parameter missing or invalid`);return r};switch(e.kty){case"EC":return{crv:t("crv"),kty:t("kty"),x:t("x"),y:t("y")};case"OKP":return{crv:t("crv"),kty:t("kty"),x:t("x")};case"RSA":return{e:t("e"),kty:t("kty"),n:t("n")};case"oct":return{k:t("k"),kty:t("kty")};default:throw new TypeError('"kty" (Key Type) Parameter missing or unsupported')}}(e),r=JSON.stringify(t);return this.sha256(r)}async generateVerifier(e=32){if(e<32||e>96)throw new TypeError("Invalid code_verifier length");const t=await this.implementation.getRandomValues(e);return ok.base64url.baseEncode(t)}};var ak={},ck=e&&e.__addDisposableResource||function(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t},lk=e&&e.__disposeResources||function(e){return function(t){function r(r){t.error=t.hasError?new e(r,t.error,"An error was suppressed during disposal."):r,t.hasError=!0}var n,o=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===o)return o=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var i=n.dispose.call(n.value);if(n.async)return o|=2,Promise.resolve(i).then(e,(function(t){return r(t),e()}))}else o|=1}catch(e){r(e)}if(1===o)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});Object.defineProperty(ak,"__esModule",{value:!0}),ak.SessionGetter=void 0;const dk=tw,uk=HS,pk=AS,fk=cS,hk=BS,yk=X_;ak.SessionGetter=class extends dk.CachedGetter{constructor(e,t,r){super((async(e,n,o)=>{if(void 0===o){const t="The session was deleted by another process",r=new pk.TokenRefreshError(e,t);throw this.dispatchEvent("deleted",{sub:e,cause:r}),r}const{dpopKey:i,tokenSet:s}=o;if(e!==s.sub)throw new pk.TokenRefreshError(e,"Stored session sub mismatch");if(!s.refresh_token)throw new pk.TokenRefreshError(e,"No refresh token available");const a=await t.fromIssuer(s.iss,i);n?.signal?.throwIfAborted();try{const t=await a.refresh(s);if(e!==t.sub)throw new pk.TokenRefreshError(e,"Token set sub mismatch");return{dpopKey:i,tokenSet:t}}catch(t){if(t instanceof hk.OAuthResponseError&&400===t.status&&"invalid_grant"===t.error){if(!r.hasImplementationLock){await new Promise((e=>setTimeout(e,1e3)));const r=await this.getStored(e);if(void 0===r){const r="The session was deleted by another process";throw new pk.TokenRefreshError(e,r,{cause:t})}if(r.tokenSet.access_token!==s.access_token||r.tokenSet.refresh_token!==s.refresh_token)return r}const n=t.errorDescription??"The session was revoked";throw new pk.TokenRefreshError(e,n,{cause:t})}throw t}}),e,{isStale:(e,{tokenSet:t})=>null!=t.expires_at&&new Date(t.expires_at).getTime()<Date.now()+1e4+3e4*Math.random(),onStoreError:async(e,r,{tokenSet:n,dpopKey:o})=>{const i=await t.fromIssuer(n.iss,o);throw await i.revoke(n.refresh_token??n.access_token),e},deleteOnError:async e=>e instanceof pk.TokenRefreshError||e instanceof fk.TokenRevokedError||e instanceof uk.TokenInvalidError}),Object.defineProperty(this,"runtime",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"eventTarget",{enumerable:!0,configurable:!0,writable:!0,value:new yk.CustomEventTarget})}addEventListener(e,t,r){this.eventTarget.addEventListener(e,t,r)}removeEventListener(e,t,r){this.eventTarget.removeEventListener(e,t,r)}dispatchEvent(e,t){return this.eventTarget.dispatchCustomEvent(e,t)}async setStored(e,t){if(e!==t.tokenSet.sub)throw new TypeError("Token set does not match the expected sub");await super.setStored(e,t),this.dispatchEvent("updated",{sub:e,...t})}async delStored(e,t){await super.delStored(e,t),this.dispatchEvent("deleted",{sub:e,cause:t})}async getSession(e,t){return this.get(e,{noCache:!0===t,allowStale:!1===t})}async get(e,t){const r=await this.runtime.usingLock(`@atproto-oauth-client-${e}`,(async()=>{const r={stack:[],error:void 0,hasError:!1};try{const n=ck(r,(0,yk.timeoutSignal)(3e4,t),!1),o=ck(r,(0,yk.combineSignals)([t?.signal,n]),!1);return await super.get(e,{...t,signal:o.signal})}catch(e){r.error=e,r.hasError=!0}finally{lk(r)}}));if(e!==r.tokenSet.sub)throw new Error("Token set does not match the expected sub");return r}};var mk={},bk={};Object.defineProperty(bk,"__esModule",{value:!0}),bk.clientMetadataSchema=void 0;const gk=NR;bk.clientMetadataSchema=gk.oauthClientMetadataSchema.extend({client_id:gk.oauthClientIdSchema.url()}),Object.defineProperty(mk,"__esModule",{value:!0}),mk.validateClientMetadata=function(e,t){if(e.jwks){if(!t)throw new TypeError("Keyset must not be provided when jwks is provided");for(const r of e.jwks.keys){if(!r.kid)throw new TypeError('Key must have a "kid" property');if(!t.has(r.kid))throw new TypeError(`Key with kid "${r.kid}" not found in keyset`)}}e.jwks||e.jwks_uri||!t?.size||(e={...e,jwks:t.toJSON()});const r=Ek.clientMetadataSchema.parse(e);r.client_id.startsWith("http:")?(0,vk.assertOAuthLoopbackClientId)(r.client_id):(0,vk.assertOAuthDiscoverableClientId)(r.client_id);const n=r.scope?.split(" ");if(!n?.includes("atproto"))throw new TypeError('Client metadata must include the "atproto" scope');if(!r.response_types.includes("code"))throw new TypeError('"response_types" must include "code"');if(!r.grant_types.includes("authorization_code"))throw new TypeError('"grant_types" must include "authorization_code"');const o=r[wk];switch(o){case void 0:throw new TypeError(`${wk} must be provided`);case"none":if(r[Rk])throw new TypeError(`${Rk} must not be provided when ${wk} is "${o}"`);break;case"private_key_jwt":if(!t?.size)throw new TypeError(`A non-empty keyset must be provided when ${wk} is "${o}"`);if(!r[Rk])throw new TypeError(`${Rk} must be provided when ${wk} is "${o}"`);break;default:throw new TypeError(`Invalid "token_endpoint_auth_method" value: ${o}`)}return r};const vk=NR,Ek=bk,wk="token_endpoint_auth_method",Rk="token_endpoint_auth_signing_alg";Object.defineProperty(tS,"__esModule",{value:!0}),tS.OAuthClient=void 0;const Ak=Qv,_k=bR,Sk=rS,kk=LE,Tk=Nm,Ck=NR,Lk=aS,Pk=cS,xk=H_,Bk=Y_,jk=dS,Dk=yS,Ok=ES,Uk=GS,Ik=tk,Kk=ak,Mk=X_,Vk=mk;tS.OAuthClient=class extends Mk.CustomEventTarget{static async fetchMetadata({clientId:e,fetch:t=globalThis.fetch,signal:r}){r?.throwIfAborted();const n=new Request(e,{redirect:"error",signal:r}),o=await t(n);if(200!==o.status)throw o.body?.cancel?.(),new TypeError(`Failed to fetch client metadata: ${o.status}`);const i=o.headers.get("content-type")?.split(";")[0].trim();if("application/json"!==i)throw o.body?.cancel?.(),new TypeError(`Invalid client metadata content type: ${i}`);const s=await o.json();return r?.throwIfAborted(),Ck.oauthClientMetadataSchema.parse(s)}constructor({fetch:e=globalThis.fetch,allowHttp:t=!1,stateStore:r,sessionStore:n,didCache:o,dpopNonceCache:i=new kk.SimpleStoreMemory({ttl:6e4,max:100}),handleCache:s,authorizationServerMetadataCache:a=new kk.SimpleStoreMemory({ttl:6e4,max:100}),protectedResourceMetadataCache:c=new kk.SimpleStoreMemory({ttl:6e4,max:100}),responseMode:l,clientMetadata:d,handleResolver:u,plcDirectoryUrl:p,runtimeImplementation:f,keyset:h}){super(),Object.defineProperty(this,"clientMetadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responseMode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"runtime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oauthResolver",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"serverFactory",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sessionGetter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stateStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.keyset=h?h instanceof Tk.Keyset?h:new Tk.Keyset(h):void 0,this.clientMetadata=(0,Vk.validateClientMetadata)(d,this.keyset),this.responseMode=l,this.runtime=new Ik.Runtime(f),this.fetch=e,this.oauthResolver=new Dk.OAuthResolver(new Sk.IdentityResolver(new Ak.DidResolverCached(new Ak.DidResolverCommon({fetch:e,plcDirectoryUrl:p,allowHttp:t}),o),new _k.CachedHandleResolver(_k.AppViewHandleResolver.from(u,{fetch:e}),s)),new jk.OAuthProtectedResourceMetadataResolver(c,e,{allowHttpResource:t}),new xk.OAuthAuthorizationServerMetadataResolver(a,e,{allowHttpIssuer:t})),this.serverFactory=new Ok.OAuthServerFactory(this.clientMetadata,this.runtime,this.oauthResolver,this.fetch,this.keyset,i),this.sessionGetter=new Kk.SessionGetter(n,this.serverFactory,this.runtime),this.stateStore=r;for(const e of["deleted","updated"])this.sessionGetter.addEventListener(e,(t=>{this.dispatchCustomEvent(e,t.detail)||t.preventDefault()}))}get identityResolver(){return this.oauthResolver.identityResolver}get didResolver(){return this.identityResolver.didResolver}get handleResolver(){return this.identityResolver.handleResolver}get jwks(){return this.keyset?.publicJwks??{keys:[]}}async authorize(e,{signal:t,...r}={}){const n=r?.redirect_uri??this.clientMetadata.redirect_uris[0];if(!this.clientMetadata.redirect_uris.includes(n))throw new TypeError("Invalid redirect_uri");const{identity:o,metadata:i}=await this.oauthResolver.resolve(e,{signal:t}),s=await this.runtime.generatePKCE(),a=await this.runtime.generateKey(i.dpop_signing_alg_values_supported||[Lk.FALLBACK_ALG]),c=await this.runtime.generateNonce();await this.stateStore.set(c,{iss:i.issuer,dpopKey:a,verifier:s.verifier,appState:r?.state});const l={...r,client_id:this.clientMetadata.client_id,redirect_uri:n,code_challenge:s.challenge,code_challenge_method:s.method,state:c,login_hint:o?e:void 0,response_mode:this.responseMode,response_type:"code",scope:r?.scope??this.clientMetadata.scope};if(i.pushed_authorization_request_endpoint){const e=await this.serverFactory.fromMetadata(i,a),t=await e.request("pushed_authorization_request",l),r=new URL(i.authorization_endpoint);return r.searchParams.set("client_id",this.clientMetadata.client_id),r.searchParams.set("request_uri",t.request_uri),r}if(i.require_pushed_authorization_requests)throw new Error("Server requires pushed authorization requests (PAR) but no PAR endpoint is available");{const e=new URL(i.authorization_endpoint);for(const[t,r]of Object.entries(l))r&&e.searchParams.set(t,String(r));if(e.pathname.length+e.search.length<2048)return e;if(!i.pushed_authorization_request_endpoint)throw new Error("Login URL too long")}throw new Error("Server does not support pushed authorization requests (PAR)")}async abortRequest(e){e.searchParams.get("request_uri")}async callback(e){if(null!=e.get("response"))throw new Bk.OAuthCallbackError(e,"JARM not supported");const t=e.get("iss"),r=e.get("state"),n=e.get("error"),o=e.get("code");if(!r)throw new Bk.OAuthCallbackError(e,'Missing "state" parameter');const i=await this.stateStore.get(r);if(!i)throw new Bk.OAuthCallbackError(e,`Unknown authorization session "${r}"`);await this.stateStore.del(r);try{if(null!=n)throw new Bk.OAuthCallbackError(e,void 0,i.appState);if(!o)throw new Bk.OAuthCallbackError(e,'Missing "code" query param',i.appState);const r=await this.serverFactory.fromIssuer(i.iss,i.dpopKey);if(null!=t){if(!r.issuer)throw new Bk.OAuthCallbackError(e,"Issuer not found in metadata",i.appState);if(r.issuer!==t)throw new Bk.OAuthCallbackError(e,"Issuer mismatch",i.appState)}else if(r.serverMetadata.authorization_response_iss_parameter_supported)throw new Bk.OAuthCallbackError(e,"iss missing from the response",i.appState);const s=await r.exchangeCode(o,i.verifier);try{await this.sessionGetter.setStored(s.sub,{dpopKey:i.dpopKey,tokenSet:s});return{session:this.createSession(r,s.sub),state:i.appState??null}}catch(e){throw await r.revoke(s.refresh_token||s.access_token),e}}catch(t){throw Bk.OAuthCallbackError.from(t,e,i.appState)}}async restore(e,t="auto"){(0,Ak.assertAtprotoDid)(e);const{dpopKey:r,tokenSet:n}=await this.sessionGetter.get(e,{noCache:!0===t,allowStale:!1===t}),o=await this.serverFactory.fromIssuer(n.iss,r,{noCache:!0===t,allowStale:!1===t});return this.createSession(o,e)}async revoke(e){(0,Ak.assertAtprotoDid)(e);const{dpopKey:t,tokenSet:r}=await this.sessionGetter.get(e,{allowStale:!0});try{const e=await this.serverFactory.fromIssuer(r.iss,t);await e.revoke(r.access_token)}finally{await this.sessionGetter.delStored(e,new Pk.TokenRevokedError(e))}}createSession(e,t){return new Uk.OAuthSession(e,t,this.sessionGetter,this.fetch)}};var Nk={};Object.defineProperty(Nk,"__esModule",{value:!0});var zk={};Object.defineProperty(zk,"__esModule",{value:!0}),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.FetchResponseError=t.FetchRequestError=t.FetchError=void 0,n(Qv,t);var o=uw;Object.defineProperty(t,"FetchError",{enumerable:!0,get:function(){return o.FetchError}}),Object.defineProperty(t,"FetchRequestError",{enumerable:!0,get:function(){return o.FetchRequestError}}),Object.defineProperty(t,"FetchResponseError",{enumerable:!0,get:function(){return o.FetchResponseError}}),n(bR,t),n(Yv,t),n(NR,t),n(H_,t),n(Y_,t),n(tS,t),n(dS,t),n(mS,t),n(BS,t),n(wS,t),n(ES,t),n(GS,t),n(Nk,t),n(ak,t),n(zk,t),n(bk,t),n(HS,t),n(AS,t),n(cS,t)}(Jv);var Fk={},qk={},$k={},Gk={},Hk={},Xk={},Wk={},Zk={};function Jk(e,t,r){const n=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{t(e.result),n()},i=()=>{r(e.error||new Error("Unknown error")),n()};e.addEventListener("success",o),e.addEventListener("error",i)}Object.defineProperty(Zk,"__esModule",{value:!0}),Zk.handleRequest=Jk,Zk.promisify=function(e){return new Promise(((t,r)=>{Jk(e,t,r)}))},Object.defineProperty(Wk,"__esModule",{value:!0}),Wk.DBIndex=void 0;const Qk=Zk;Wk.DBIndex=class{constructor(e){Object.defineProperty(this,"idbIndex",{enumerable:!0,configurable:!0,writable:!0,value:e})}count(e){return(0,Qk.promisify)(this.idbIndex.count(e))}get(e){return(0,Qk.promisify)(this.idbIndex.get(e))}getKey(e){return(0,Qk.promisify)(this.idbIndex.getKey(e))}getAll(e,t){return(0,Qk.promisify)(this.idbIndex.getAll(e,t))}getAllKeys(e,t){return(0,Qk.promisify)(this.idbIndex.getAllKeys(e,t))}deleteAll(e){return new Promise(((t,r)=>{const n=this.idbIndex.openCursor(e);n.onsuccess=function(e){const r=e.target.result;r?(r.delete(),r.continue()):t()},n.onerror=function(e){r(e.target?.error||new Error("Unexpected error"))}}))}},Object.defineProperty(Xk,"__esModule",{value:!0}),Xk.DBObjectStore=void 0;const Yk=Wk,eT=Zk;Xk.DBObjectStore=class{constructor(e){Object.defineProperty(this,"idbObjStore",{enumerable:!0,configurable:!0,writable:!0,value:e})}get name(){return this.idbObjStore.name}index(e){return new Yk.DBIndex(this.idbObjStore.index(e))}get(e){return(0,eT.promisify)(this.idbObjStore.get(e))}getKey(e){return(0,eT.promisify)(this.idbObjStore.getKey(e))}getAll(e,t){return(0,eT.promisify)(this.idbObjStore.getAll(e,t))}getAllKeys(e,t){return(0,eT.promisify)(this.idbObjStore.getAllKeys(e,t))}add(e,t){return(0,eT.promisify)(this.idbObjStore.add(e,t))}put(e,t){return(0,eT.promisify)(this.idbObjStore.put(e,t))}delete(e){return(0,eT.promisify)(this.idbObjStore.delete(e))}clear(){return(0,eT.promisify)(this.idbObjStore.clear())}};var tT,rT=e&&e.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},nT=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(Hk,"__esModule",{value:!0}),Hk.DBTransaction=void 0;const oT=Xk;class iT{constructor(e){tT.set(this,void 0),rT(this,tT,e,"f");const t=()=>{n()},r=()=>{n()},n=()=>{rT(this,tT,null,"f"),e.removeEventListener("abort",t),e.removeEventListener("complete",r)};e.addEventListener("abort",t),e.addEventListener("complete",r)}get tx(){if(!nT(this,tT,"f"))throw new Error("Transaction already ended");return nT(this,tT,"f")}async abort(){const{tx:e}=this;rT(this,tT,null,"f"),e.abort()}async commit(){const{tx:e}=this;rT(this,tT,null,"f"),e.commit?.()}objectStore(e){const t=this.tx.objectStore(e);return new oT.DBObjectStore(t)}[(tT=new WeakMap,Symbol.dispose)](){nT(this,tT,"f")&&this.commit()}}Hk.DBTransaction=iT;var sT,aT=e&&e.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},cT=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(Gk,"__esModule",{value:!0}),Gk.DB=void 0;const lT=Hk;class dT{static async open(e,t,r){const n=await new Promise(((r,n)=>{const o=indexedDB.open(e,t.length);o.onerror=()=>n(o.error),o.onsuccess=()=>r(o.result),o.onupgradeneeded=({oldVersion:e,newVersion:r})=>{const i=o.result;try{for(let n=e;n<(r??t.length);++n){const e=t[n];if(!e)throw new Error(`Missing migration for version ${n}`);e(i)}}catch(e){i.close(),n(e)}}}));return new dT(n,r)}constructor(e,t){Object.defineProperty(this,"txOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),sT.set(this,void 0),aT(this,sT,e,"f");const r=()=>{aT(this,sT,null,"f"),e.removeEventListener("versionchange",r),e.removeEventListener("close",r),e.close()};e.addEventListener("versionchange",r),e.addEventListener("close",r)}get db(){if(!cT(this,sT,"f"))throw new Error("Database closed");return cT(this,sT,"f")}get name(){return this.db.name}get objectStoreNames(){return this.db.objectStoreNames}get version(){return this.db.version}async transaction(e,t,r){return new Promise((async(n,o)=>{try{const i=this.db.transaction(e,t,this.txOptions);let s={done:!1};i.oncomplete=()=>{s.done?n(s.value):o(new Error("Transaction completed without result"))},i.onerror=()=>o(i.error),i.onabort=()=>o(i.error||new Error("Transaction aborted"));try{const e=await r(new lT.DBTransaction(i));s={done:!0,value:e},i.commit()}catch(e){throw i.abort(),e}}catch(e){o(e)}}))}close(){const{db:e}=this;aT(this,sT,null,"f"),e.close()}[(sT=new WeakMap,Symbol.dispose)](){if(cT(this,sT,"f"))return this.close()}}Gk.DB=dT,function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(Gk,t),n(Wk,t),n(Xk,t),n(Hk,t)}($k);var uT,pT,fT=e&&e.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},hT=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(qk,"__esModule",{value:!0}),qk.BrowserOAuthDatabase=void 0;const yT=Mm,mT=$k;function bT(e){if(!(e instanceof yT.WebcryptoKey&&e.kid))throw new Error("Invalid key object");return{keyId:e.kid,keyPair:e.cryptoKeyPair}}async function gT(e){return yT.WebcryptoKey.fromKeypair(e.keyPair,e.keyId)}const vT=["state","session","didCache","dpopNonceCache","handleCache","authorizationServerMetadataCache","protectedResourceMetadataCache"];class ET{constructor(e){uT.set(this,void 0),pT.set(this,void 0),fT(this,uT,mT.DB.open(e?.name??"@atproto-oauth-client",[e=>{for(const t of vT){e.createObjectStore(t,{autoIncrement:!0}).createIndex("expiresAt","expiresAt",{unique:!1})}}],{durability:e?.durability??"strict"}),"f"),fT(this,pT,setInterval((()=>{this.cleanup()}),e?.cleanupInterval??3e4),"f")}async run(e,t,r){const n=await hT(this,uT,"f");return await n.transaction([e],t,(t=>r(t.objectStore(e))))}createStore(e,{encode:t,decode:r,expiresAt:n}){return{get:async t=>{const n=await this.run(e,"readonly",(e=>e.get(t)));if(void 0!==n){if(!(null!=n.expiresAt&&new Date(n.expiresAt)<new Date))return r(n.value);await this.run(e,"readwrite",(e=>e.delete(t)))}},set:async(r,o)=>{const i={value:await t(o),expiresAt:n(o)?.toISOString()};await this.run(e,"readwrite",(e=>e.put(i,r)))},del:async t=>{await this.run(e,"readwrite",(e=>e.delete(t)))}}}getSessionStore(){return this.createStore("session",{expiresAt:({tokenSet:e})=>e.refresh_token||null==e.expires_at?null:new Date(e.expires_at),encode:({dpopKey:e,...t})=>({...t,dpopKey:bT(e)}),decode:async({dpopKey:e,...t})=>({...t,dpopKey:await gT(e)})})}getStateStore(){return this.createStore("state",{expiresAt:e=>new Date(Date.now()+6e5),encode:({dpopKey:e,...t})=>({...t,dpopKey:bT(e)}),decode:async({dpopKey:e,...t})=>({...t,dpopKey:await gT(e)})})}getDpopNonceCache(){return this.createStore("dpopNonceCache",{expiresAt:e=>new Date(Date.now()+6e5),encode:e=>e,decode:e=>e})}getDidCache(){return this.createStore("didCache",{expiresAt:e=>new Date(Date.now()+6e4),encode:e=>e,decode:e=>e})}getHandleCache(){return this.createStore("handleCache",{expiresAt:e=>new Date(Date.now()+6e4),encode:e=>e,decode:e=>e})}getAuthorizationServerMetadataCache(){return this.createStore("authorizationServerMetadataCache",{expiresAt:e=>new Date(Date.now()+6e4),encode:e=>e,decode:e=>e})}getProtectedResourceMetadataCache(){return this.createStore("protectedResourceMetadataCache",{expiresAt:e=>new Date(Date.now()+6e4),encode:e=>e,decode:e=>e})}async cleanup(){const e=await hT(this,uT,"f");for(const t of vT)await e.transaction([t],"readwrite",(e=>e.objectStore(t).index("expiresAt").deleteAll(IDBKeyRange.upperBound(Date.now()))))}async[(uT=new WeakMap,pT=new WeakMap,Symbol.asyncDispose)](){clearInterval(hT(this,pT,"f")),fT(this,pT,void 0,"f");const e=hT(this,uT,"f");fT(this,uT,Promise.reject(new Error("Database has been disposed")),"f"),hT(this,uT,"f").catch((()=>null));const t=await e.catch((()=>null));t&&await(t[Symbol.asyncDispose]||t[Symbol.dispose]).call(t)}}qk.BrowserOAuthDatabase=ET;var wT={};Object.defineProperty(wT,"__esModule",{value:!0}),wT.BrowserRuntimeImplementation=void 0;const RT=Mm,AT=navigator.locks?.request?(e,t)=>navigator.locks.request(e,{mode:"exclusive"},(async()=>t())):void 0;wT.BrowserRuntimeImplementation=class{constructor(){if(Object.defineProperty(this,"requestLock",{enumerable:!0,configurable:!0,writable:!0,value:AT}),"object"!=typeof crypto||!crypto?.subtle)throw new Error("Crypto with CryptoSubtle is required. If running in a browser, make sure the current page is loaded over HTTPS.");this.requestLock||console.warn("Locks API not available. You should consider using a more recent browser.")}async createKey(e){return RT.WebcryptoKey.generate(e)}getRandomValues(e){return crypto.getRandomValues(new Uint8Array(e))}async digest(e,{name:t}){switch(t){case"sha256":case"sha384":case"sha512":{const r=await crypto.subtle.digest(`SHA-${t.slice(3)}`,e);return new Uint8Array(r)}default:throw new Error(`Unsupported digest algorithm: ${t}`)}}};var _T={};Object.defineProperty(_T,"__esModule",{value:!0}),_T.LoginContinuedInParentWindowError=void 0;class ST extends Error{constructor(){super("Login complete, please close the popup window."),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:"LOGIN_CONTINUED_IN_PARENT_WINDOW"})}}_T.LoginContinuedInParentWindowError=ST;var kT={};Object.defineProperty(kT,"__esModule",{value:!0}),kT.buildLoopbackClientId=function(e,t="127.0.0.1"){if(!(0,TT.isLoopbackHost)(e.hostname))throw new TypeError(`Expected a loopback host, got ${e.hostname}`);const r=`http://${"localhost"===e.hostname?t:e.hostname}${e.port&&!e.port.startsWith(":")?`:${e.port}`:e.port}${e.pathname}`;return`http://localhost${"/"===e.pathname?"":e.pathname}?redirect_uri=${encodeURIComponent(r)}`};const TT=NR;var CT;Object.defineProperty(Fk,"__esModule",{value:!0}),Fk.BrowserOAuthClient=void 0;const LT=Jv,PT=NR,xT=qk,BT=wT,jT=_T,DT=kT,OT="@@atproto/oauth-client-browser",UT=`${OT}(popup-channel)`,IT=`${OT}(popup-state):`,KT=new BroadcastChannel(`${OT}(synchronization-channel)`);class MT extends LT.OAuthClient{static async load({clientId:e,...t}){if(e.startsWith("http:")){const r=(0,PT.atprotoLoopbackClientMetadata)(e);return new MT({clientMetadata:r,...t})}if(e.startsWith("https:")){(0,PT.assertOAuthDiscoverableClientId)(e);const r=await LT.OAuthClient.fetchMetadata({clientId:e,...t});return new MT({clientMetadata:r,...t})}throw new TypeError(`Invalid client id: ${e}`)}constructor({clientMetadata:e=(0,PT.atprotoLoopbackClientMetadata)((0,DT.buildLoopbackClientId)(window.location)),responseMode:t="fragment",...r}){if(!globalThis.crypto?.subtle)throw new Error("WebCrypto API is required");if(!["query","fragment"].includes(t))throw new TypeError(`Invalid response mode: ${t}`);const n=new xT.BrowserOAuthDatabase;super({...r,clientMetadata:e,responseMode:t,keyset:void 0,runtimeImplementation:new BT.BrowserRuntimeImplementation,sessionStore:n.getSessionStore(),stateStore:n.getStateStore(),didCache:n.getDidCache(),handleCache:n.getHandleCache(),dpopNonceCache:n.getDpopNonceCache(),authorizationServerMetadataCache:n.getAuthorizationServerMetadataCache(),protectedResourceMetadataCache:n.getProtectedResourceMetadataCache()}),Object.defineProperty(this,CT,{enumerable:!0,configurable:!0,writable:!0,value:void 0});const o=new AbortController,{signal:i}=o;this[Symbol.dispose]=()=>o.abort(),i.addEventListener("abort",(()=>n[Symbol.asyncDispose]()),{once:!0}),this.addEventListener("deleted",(({detail:{sub:e}})=>{localStorage.getItem(`${OT}(sub)`)===e&&localStorage.removeItem(`${OT}(sub)`)}));for(const e of["deleted","updated"])this.sessionGetter.addEventListener(e,(({detail:t})=>{KT.postMessage([e,t])}));KT.addEventListener("message",(e=>{if(e.source!==window){const[t,r]=e.data;this.dispatchCustomEvent(t,r)}}),{signal:i})}async init(e){await function(e){if(!(0,PT.isOAuthClientIdLoopback)(e.client_id))return;if("localhost"!==window.location.hostname)return;const t=new URL(window.location.href);for(const r of e.redirect_uris){const e=new URL(r);if(!("127.0.0.1"!==e.hostname&&"[::1]"!==e.hostname||e.port&&e.port!==t.port||e.protocol!==t.protocol||e.pathname!==t.pathname))throw e.port=t.port,window.location.href=e.href,new Error("Redirecting to loopback IP...")}throw new Error(`Please use the loopback IP address instead of ${t}`)}(this.clientMetadata);const t=await this.signInCallback();if(t)return localStorage.setItem(`${OT}(sub)`,t.session.sub),t;const r=localStorage.getItem(`${OT}(sub)`);if(r)try{return{session:await this.restore(r,e)}}catch(e){throw localStorage.removeItem(`${OT}(sub)`),e}}async restore(e,t){const r=await super.restore(e,t);return localStorage.setItem(`${OT}(sub)`,r.sub),r}async revoke(e){return localStorage.removeItem(`${OT}(sub)`),super.revoke(e)}async signIn(e,t){return"popup"===t?.display?this.signInPopup(e,t):this.signInRedirect(e,t)}async signInRedirect(e,t){const r=await this.authorize(e,t);return window.location.href=r.href,new Promise(((e,t)=>{setTimeout((e=>{this.abortRequest(r).then((()=>t(e)),(r=>t(new AggregateError([e,r]))))}),5e3,new Error("User navigated back"))}))}async signInPopup(e,t){const r="width=600,height=600,menubar=no,toolbar=no";let n=window.open("about:blank","_blank",r);const o=`${Math.random().toString(36).slice(2)}`,i=await this.authorize(e,{...t,state:`${IT}${o}`,display:t?.display??"popup"});return t?.signal?.throwIfAborted(),n?n.window.location.href=i.href:n=window.open(i.href,"_blank",r),n?.focus(),new Promise(((e,r)=>{const i=new BroadcastChannel(UT),s=()=>{clearTimeout(c),i.removeEventListener("message",l),i.close(),t?.signal?.removeEventListener("abort",a),n?.close()},a=()=>{r(new Error(t?.signal?.aborted?"Aborted":"Timeout")),s()};t?.signal?.addEventListener("abort",a);const c=setTimeout(a,3e5),l=async({data:n})=>{if(n.key!==o)return;if(!("result"in n))return;i.postMessage({key:o,ack:!0}),s();const{result:a}=n;if("fulfilled"===a.status){const n=a.value;try{t?.signal?.throwIfAborted(),e(await this.restore(n,!1))}catch(e){r(e),this.revoke(n)}}else{const{message:e,params:t}=a.reason;r(new LT.OAuthCallbackError(new URLSearchParams(t),e))}};i.addEventListener("message",l)}))}readCallbackParams(){const e="fragment"===this.responseMode?new URLSearchParams(location.hash.slice(1)):new URLSearchParams(location.search);if(!e.has("state")||!e.has("code")&&!e.has("error"))return null;const t=this.clientMetadata.redirect_uris.map((e=>new URL(e)));return t.some((e=>location.origin===e.origin&&location.pathname===e.pathname))?e:null}async signInCallback(){const e=this.readCallbackParams();if(!e)return null;"fragment"===this.responseMode?history.replaceState(null,"",location.pathname+location.search):"query"===this.responseMode&&history.replaceState(null,"",location.pathname);const t=e=>{const t=new BroadcastChannel(UT);return new Promise((r=>{const n=e=>{clearTimeout(i),t.removeEventListener("message",o),t.close(),r(e)},o=({data:t})=>{"ack"in t&&e.key===t.key&&n(!0)};t.addEventListener("message",o),t.postMessage(e);const i=setTimeout(n,500,!1)}))};return this.callback(e).then((async e=>{if(e.state?.startsWith(IT)){throw await t({key:e.state.slice(IT.length),result:{status:"fulfilled",value:e.session.sub}})||await e.session.signOut(),new jT.LoginContinuedInParentWindowError}return e})).catch((async e=>{if(e instanceof LT.OAuthCallbackError&&e.state?.startsWith(IT))throw await t({key:e.state.slice(IT.length),result:{status:"rejected",reason:{message:e.message,params:Array.from(e.params.entries())}}}),new jT.LoginContinuedInParentWindowError;throw e})).catch((e=>{throw e instanceof jT.LoginContinuedInParentWindowError&&window.close(),e}))}dispose(){this[Symbol.dispose]()}}function VT(e){const t=l.useRef(e);return l.useEffect((()=>{t.current=e}),[e]),t}function NT(e){const t=VT(e);return l.useCallback((function(...e){const{current:r}=t;if(r)return r.call(this,...e)}),[])}function zT(e){const t=NT(e.onRestored),r=NT(e.onSignedIn),n=NT(e.onSignedOut),o=function(e){const{client:t,clientId:r,handleResolver:n,responseMode:o,plcDirectoryUrl:i,allowHttp:s}=e,[a,c]=l.useState(t||null),d=NT(e.fetch||globalThis.fetch);return l.useEffect((()=>{if(t)c(t);else{if(r&&n){const e=new AbortController,{signal:t}=e;return c(null),Km.BrowserOAuthClient.load({clientId:r,handleResolver:n,responseMode:o,plcDirectoryUrl:i,fetch:d,allowHttp:s,signal:t}).then((e=>{t.aborted?e.dispose():(t.addEventListener("abort",(()=>e.dispose()),{once:!0}),c(e))}),(e=>{if(!t.aborted)throw e})),()=>e.abort()}c(null)}}),[t,r,n,o,i,d]),a}(e),i=VT(e.scope),s=VT(e.state),[a,c]=l.useState(null),[d,u]=l.useState(null),[p,f]=l.useState(!0),[h,y]=l.useState(!1),m=l.useRef();l.useEffect((()=>{m.current!==o&&(m.current=o,c(null),u(null),y(!1),f(null!=o),o?.init().then((async e=>{m.current===o&&(u(o),e?(c(e.session),"state"in e?await r(e.session,e.state):await t(e.session)):await t(null))}),(async e=>{m.current===o&&(e instanceof Km.LoginContinuedInParentWindowError?y(!0):(u(o),await t(null),console.error("Failed to init:",e)))})).finally((()=>{m.current===o&&f(!1)})))}),[o,r,t]),l.useEffect((()=>{if(!d)return;const e=new AbortController,{signal:t}=e;return d.addEventListener("updated",(({detail:{sub:e}})=>{a&&a.sub===e||(c(null),d.restore(e,!1).then((e=>{t.aborted||c(e)})))}),{signal:t}),a&&d.addEventListener("deleted",(({detail:{sub:e}})=>{a.sub===e&&(c(null),n())}),{signal:t}),()=>{e.abort()}}),[d,a,n]);const b=l.useCallback((async e=>{if(!d)throw new Error("Client not initialized");const t=s.current,n=i.current,o=await d.signIn(e,{scope:n,state:t});c(o),await r(o,t??null)}),[d,r]);return l.useMemo((()=>({isInitializing:p,isInitialized:null!=d,isLoginPopup:h,signIn:b,signOut:()=>a?.signOut(),refresh:()=>a?.getTokenInfo(!0),client:d,agent:a?new R.Agent(a):null})),[p,h,a,d,b])}Fk.BrowserOAuthClient=MT,CT=Symbol.dispose,function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.buildLoopbackClientId=void 0,n(Mm,t),n(Jv,t),n(Fk,t),n(_T,t);var o=kT;Object.defineProperty(t,"buildLoopbackClientId",{enumerable:!0,get:function(){return o.buildLoopbackClientId}})}(Km);const FT=l.createContext(null);const{searchParams:qT}=new URL(window.location.href),$T=qT.get("env")??"production",GT=qT.get("plc_directory_url")??("development"===$T?"http://localhost:2582":void 0),HT=qT.get("handle_resolver")??("development"===$T?"http://localhost:2584":"https://bsky.social"),XT=`http://localhost?${new URLSearchParams({scope:"atproto transition:generic",redirect_uri:Object.assign(new URL(window.location.origin),{hostname:"127.0.0.1",search:new URLSearchParams({env:$T,handle_resolver:HT,...GT&&{plc_directory_url:GT}}).toString()}).href})}`;y.createRoot(document.getElementById("root")).render(h.jsx(d.StrictMode,{children:h.jsx((({children:e,...t})=>{const{isLoginPopup:r,isInitializing:n,client:o,agent:i,signIn:s,signOut:a,refresh:c}=zT(t),{agent:d,signIn:u,signOut:p,refresh:f}=jm(),y=l.useMemo((()=>i?{pdsAgent:i,signOut:a,refresh:c}:d?{pdsAgent:d,signOut:p,refresh:f}:null),[i,a,d,p,c,f]);return r?h.jsx("div",{children:"This window can be closed"}):n?h.jsx("div",{children:"Initializing..."}):y?h.jsx(FT.Provider,{value:y,children:e}):h.jsx(Im,{atpSignIn:u,oauthSignIn:o?s:void 0})}),{clientId:XT,plcDirectoryUrl:GT,handleResolver:HT,allowHttp:"development"===$T||"test"===$T,children:h.jsx((function(){const{pdsAgent:e,signOut:t,refresh:r}=function(){const e=l.useContext(FT);if(e)return e;throw new Error("useAuthContext() must be used within an <AuthProvider />")}(),n=e.sessionManager instanceof Jv.OAuthSession,[o,i]=l.useState(void 0),s=l.useCallback((async()=>{e.sessionManager instanceof Jv.OAuthSession&&i(await e.sessionManager.getTokenInfo())}),[e]),[a,c]=l.useState(void 0),d=l.useCallback((async()=>{const t=await e.com.atproto.server.getServiceAuth({aud:e.accountDid});console.log("serviceAuth",t),c(t.data)}),[e]),[u,p]=l.useState(void 0),f=l.useCallback((async()=>{const t=await e.com.atproto.repo.getRecord({repo:e.accountDid,collection:"app.bsky.actor.profile",rkey:"self"});console.log(t),p(t.data)}),[e]);return h.jsxs("div",{children:[h.jsx("p",{children:"Logged in!"}),n&&h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:s,children:"Load token info"}),h.jsx("code",{children:h.jsx("pre",{children:void 0!==o?JSON.stringify(o,void 0,2):null})})]}),h.jsx("button",{onClick:f,children:"Load profile"}),h.jsx("code",{children:h.jsx("pre",{children:void 0!==u?JSON.stringify(u,void 0,2):null})}),h.jsx("button",{onClick:d,children:"Load service auth"}),h.jsx("code",{children:h.jsx("pre",{children:void 0!==a?JSON.stringify(a,void 0,2):null})}),h.jsx("button",{onClick:r,children:"Refresh tokens"}),h.jsx("br",{}),h.jsx("button",{onClick:t,children:"Sign-out"})]})}),{})})}))}();
|
|
11
|
+
//# sourceMappingURL=main.js.map
|