@selfcommunity/react-core 0.7.0-mui7.25 → 0.7.0-mui7.27

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/lib/umd/18.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 18.js.LICENSE.txt */
2
- (self.webpackChunkSelfCommunityReactCore=self.webpackChunkSelfCommunityReactCore||[]).push([[18],{4246:function(e,t,r){!function(e,t,r,n){"use strict";const o="1.6.1";function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function i(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,s)}c((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const s={NOT_LOADED:"NOT_LOADED",LOADING:"LOADING",LOADED:"LOADED",FAILED:"FAILED",AUTH_FAILURE:"AUTH_FAILURE"};class c{static load(e,t){return i(this,void 0,void 0,function*(){var r,n;const o=e.libraries?e.libraries.split(","):[],a=this.serializeParams(e);this.listeners.push(t),(null===(n=null===(r=window.google)||void 0===r?void 0:r.maps)||void 0===n?void 0:n.importLibrary)?(this.serializedApiParams||(this.loadingStatus=s.LOADED),this.notifyLoadingStatusListeners()):(this.serializedApiParams=a,this.initImportLibrary(e)),this.serializedApiParams&&this.serializedApiParams!==a&&console.warn("[google-maps-api-loader] The maps API has already been loaded with different parameters and will not be loaded again. Refresh the page for new values to have effect.");const i=["maps",...o];yield Promise.all(i.map(e=>google.maps.importLibrary(e)))})}static serializeParams(e){return[e.v,e.key,e.language,e.region,e.authReferrerPolicy,e.solutionChannel].join("/")}static initImportLibrary(e){if(window.google||(window.google={}),window.google.maps||(window.google.maps={}),window.google.maps.importLibrary)return void console.error("[google-maps-api-loader-internal]: initImportLibrary must only be called once");let t=null;const r=()=>t||(t=new Promise((t,r)=>{var n;const o=document.createElement("script"),a=new URLSearchParams;for(const[t,r]of Object.entries(e)){const e=t.replace(/[A-Z]/g,e=>"_"+e[0].toLowerCase());a.set(e,String(r))}a.set("loading","async"),a.set("callback","__googleMapsCallback__"),o.async=!0,o.src="https://maps.googleapis.com/maps/api/js?"+a.toString(),o.nonce=(null===(n=document.querySelector("script[nonce]"))||void 0===n?void 0:n.nonce)||"",o.onerror=()=>{this.loadingStatus=s.FAILED,this.notifyLoadingStatusListeners(),r(new Error("The Google Maps JavaScript API could not load."))},window.__googleMapsCallback__=()=>{this.loadingStatus=s.LOADED,this.notifyLoadingStatusListeners(),t()},window.gm_authFailure=()=>{this.loadingStatus=s.AUTH_FAILURE,this.notifyLoadingStatusListeners()},this.loadingStatus=s.LOADING,this.notifyLoadingStatusListeners(),document.head.append(o)}),t);google.maps.importLibrary=e=>r().then(()=>google.maps.importLibrary(e))}static notifyLoadingStatusListeners(){for(const e of this.listeners)e(this.loadingStatus)}}c.loadingStatus=s.NOT_LOADED,c.listeners=[];const l=[`gmp_visgl_reactgooglemaps_v${o}`],u=t.createContext(null);function d(e,t,r){var n;const o={type:e,map:t,detail:{},stoppable:!1,stop:()=>{}};if(f.includes(e)){const e=o,r=t.getCenter(),n=t.getZoom(),a=t.getHeading()||0,i=t.getTilt()||0,s=t.getBounds();return r&&s&&Number.isFinite(n)||console.warn("[createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),e.detail={center:(null==r?void 0:r.toJSON())||{lat:0,lng:0},zoom:n||0,heading:a,tilt:i,bounds:(null==s?void 0:s.toJSON())||{north:90,east:180,south:-90,west:-180}},e}if(h.includes(e)){if(!r)throw new Error("[createEvent] mouse events must provide a srcEvent");const e=o;return e.domEvent=r.domEvent,e.stoppable=!0,e.stop=()=>r.stop(),e.detail={latLng:(null===(n=r.latLng)||void 0===n?void 0:n.toJSON())||null,placeId:r.placeId},e}return o}const p={onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onContextmenu:"contextmenu",onDblclick:"dblclick",onDrag:"drag",onDragend:"dragend",onDragstart:"dragstart",onHeadingChanged:"heading_changed",onIdle:"idle",onIsFractionalZoomEnabledChanged:"isfractionalzoomenabled_changed",onMapCapabilitiesChanged:"mapcapabilities_changed",onMapTypeIdChanged:"maptypeid_changed",onMousemove:"mousemove",onMouseout:"mouseout",onMouseover:"mouseover",onProjectionChanged:"projection_changed",onRenderingTypeChanged:"renderingtype_changed",onTilesLoaded:"tilesloaded",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed",onCameraChanged:"bounds_changed"},f=["bounds_changed","center_changed","heading_changed","tilt_changed","zoom_changed"],h=["click","contextmenu","dblclick","mousemove","mouseout","mouseover"],y=Object.keys(p);function m(e,r){const n=function(e){const r=t.useRef(void 0);return t.useEffect(()=>{r.current=e}),r.current}(e);return t.useMemo(()=>n&&r(n,e)?n:e,[e,n,r])}function g(e,r){!function(e,r,n){t.useEffect(e,[m(r,n)])}(e,r,n)}const w=new Set(["backgroundColor","clickableIcons","controlSize","disableDefaultUI","disableDoubleClickZoom","draggable","draggableCursor","draggingCursor","fullscreenControl","fullscreenControlOptions","gestureHandling","headingInteractionEnabled","isFractionalZoomEnabled","keyboardShortcuts","mapTypeControl","mapTypeControlOptions","mapTypeId","maxZoom","minZoom","noClear","panControl","panControlOptions","restriction","rotateControl","rotateControlOptions","scaleControl","scaleControlOptions","scrollwheel","streetView","streetViewControl","streetViewControlOptions","styles","tiltInteractionEnabled","zoomControl","zoomControlOptions"]);function b(){var e;return(null===(e=t.useContext(u))||void 0===e?void 0:e.status)||s.NOT_LOADED}function E(e){return!(!e||"object"!=typeof e)&&"lat"in e&&"lng"in e&&Number.isFinite(e.lat)&&Number.isFinite(e.lng)}function v(e){return E(e)?e:e.toJSON()}const S=()=>t.createElement("div",{style:{position:"absolute",top:0,left:0,bottom:0,right:0,zIndex:999,display:"flex",flexFlow:"column nowrap",textAlign:"center",justifyContent:"center",fontSize:".8rem",color:"rgba(0,0,0,0.6)",background:"#dddddd",padding:"1rem 1.5rem"}},t.createElement("h2",null,"Error: AuthFailure"),t.createElement("p",null,"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the ",t.createElement("code",null,"APIProvider.apiKey")," prop is correct. Check the error-message in the console for further details."));function A(){return b()===s.LOADED}function _(e){const r=function(){const[,e]=t.useReducer(e=>e+1,0);return e}(),n=t.useRef({center:{lat:0,lng:0},heading:0,tilt:0,zoom:0});return t.useEffect(()=>{if(!e)return;const t=google.maps.event.addListener(e,"bounds_changed",()=>{(function(e,t){const r=e.getCenter(),n=e.getZoom(),o=e.getHeading()||0,a=e.getTilt()||0,i=e.getBounds();r&&i&&Number.isFinite(n)||console.warn("[useTrackedCameraState] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),Object.assign(t.current,{center:(null==r?void 0:r.toJSON())||{lat:0,lng:0},zoom:n||0,heading:o,tilt:a})})(e,n),r()});return()=>t.remove()},[e,r]),n}class O{static has(e){return this.entries[e]&&this.entries[e].length>0}static pop(e){return this.entries[e]&&this.entries[e].pop()||null}static push(e,t){this.entries[e]||(this.entries[e]=[]),this.entries[e].push(t)}}function C(e,r){const n=A(),[o,i]=t.useState(null),[s,c]=function(){const[e,r]=t.useState(null);return[e,t.useCallback(e=>r(e),[r])]}(),l=_(o),{id:u,defaultBounds:d,defaultCenter:p,defaultZoom:f,defaultHeading:h,defaultTilt:y,reuseMaps:m,renderingType:g,colorScheme:w}=e,b=a(e,["id","defaultBounds","defaultCenter","defaultZoom","defaultHeading","defaultTilt","reuseMaps","renderingType","colorScheme"]),E=void 0!==e.zoom||void 0!==e.defaultZoom,v=void 0!==e.center||void 0!==e.defaultCenter;d||E&&v||console.warn("<Map> component is missing configuration. You have to provide zoom and center (via the `zoom`/`defaultZoom` and `center`/`defaultCenter` props) or specify the region to show using `defaultBounds`. See https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required"),!b.center&&p&&(b.center=p),!b.zoom&&Number.isFinite(f)&&(b.zoom=f),!b.heading&&Number.isFinite(h)&&(b.heading=h),!b.tilt&&Number.isFinite(y)&&(b.tilt=y);const S=b.internalUsageAttributionIds;b.internalUsageAttributionIds=null==S?r.internalUsageAttributionIds:[...r.internalUsageAttributionIds||[],...S];for(const e of Object.keys(b))void 0===b[e]&&delete b[e];const C=t.useRef(void 0);return t.useEffect(()=>{if(!s||!n)return;const{addMapInstance:t,removeMapInstance:o}=r,{mapId:c}=e,p=`${c||"default"}:${g||"default"}:${w||"LIGHT"}`;let f,h;if(m&&O.has(p)?(h=O.pop(p),f=h.getDiv(),s.appendChild(f),h.setOptions(b),setTimeout(()=>h.setCenter(h.getCenter()),0)):(f=document.createElement("div"),f.style.height="100%",s.appendChild(f),h=new google.maps.Map(f,Object.assign(Object.assign(Object.assign({},b),g?{renderingType:g}:{}),w?{colorScheme:w}:{}))),i(h),t(h,u),d){const{padding:e}=d,t=a(d,["padding"]);h.fitBounds(t,e)}else E&&v||h.fitBounds({east:180,west:-180,south:-90,north:90});if(C.current){const{mapId:e,cameraState:t}=C.current;e!==c&&h.setOptions(t)}return()=>{C.current={mapId:c,cameraState:l.current},f.remove(),m?O.push(p,h):google.maps.event.clearInstanceListeners(h),i(null),o(u)}},[s,n,u,e.mapId,e.renderingType,e.colorScheme]),[o,c,l]}O.entries={};const P=t.createContext(null),T=e=>{const{children:r,id:n,className:o,style:a}=e,i=t.useContext(u),c=b();if(!i)throw new Error("<Map> can only be used inside an <ApiProvider> component.");const[l,f,h]=C(e,i);(function(e,r,n){const o=n.center?v(n.center):null;let a=null,i=null;o&&Number.isFinite(o.lat)&&Number.isFinite(o.lng)&&(a=o.lat,i=o.lng);const s=Number.isFinite(n.zoom)?n.zoom:null,c=Number.isFinite(n.heading)?n.heading:null,l=Number.isFinite(n.tilt)?n.tilt:null;t.useLayoutEffect(()=>{if(!e)return;const t={};let n=!1;null===a||null===i||r.current.center.lat===a&&r.current.center.lng===i||(t.center={lat:a,lng:i},n=!0),null!==s&&r.current.zoom!==s&&(t.zoom=s,n=!0),null!==c&&r.current.heading!==c&&(t.heading=c,n=!0),null!==l&&r.current.tilt!==l&&(t.tilt=l,n=!0),n&&e.moveCamera(t)})})(l,h,e),function(e,r){for(const n of y){const o=r[n],a=p[n];t.useEffect(()=>{if(!e)return;if(!o)return;const t=google.maps.event.addListener(e,a,t=>{o(d(a,e,t))});return()=>t.remove()},[e,a,o])}}(l,e),function(e,t){const r={},n=Object.keys(t);for(const e of n)w.has(e)&&(r[e]=t[e]);g(()=>{e&&e.setOptions(r)},[r])}(l,e);const m=function(e,r){const{viewport:n,viewState:o}=r,a=!!n;return t.useLayoutEffect(()=>{if(!e||!o)return;const{latitude:t,longitude:r,bearing:n,pitch:a,zoom:i}=o;e.moveCamera({center:{lat:t,lng:r},heading:n,tilt:a,zoom:i+1})},[e,o]),a}(l,e),E=!!e.controlled;t.useEffect(()=>{if(l)return m&&l.setOptions({disableDefaultUI:!0}),(m||E)&&l.setOptions({gestureHandling:"none",keyboardShortcuts:!1}),()=>{l.setOptions({gestureHandling:e.gestureHandling,keyboardShortcuts:e.keyboardShortcuts})}},[l,m,E,e.gestureHandling,e.keyboardShortcuts]);const A=e.center?v(e.center):null;let _=null,O=null;A&&Number.isFinite(A.lat)&&Number.isFinite(A.lng)&&(_=A.lat,O=A.lng);const T=t.useMemo(()=>{var t,r,n;return{center:{lat:null!=_?_:0,lng:null!=O?O:0},zoom:null!==(t=e.zoom)&&void 0!==t?t:0,heading:null!==(r=e.heading)&&void 0!==r?r:0,tilt:null!==(n=e.tilt)&&void 0!==n?n:0}},[_,O,e.zoom,e.heading,e.tilt]);t.useLayoutEffect(()=>{if(!l||!E)return;l.moveCamera(T);const e=l.addListener("bounds_changed",()=>{l.moveCamera(T)});return()=>e.remove()},[l,E,T]);const R=t.useMemo(()=>Object.assign({width:"100%",height:"100%",position:"relative",zIndex:m?-1:0},a),[a,m]),k=t.useMemo(()=>({map:l}),[l]);return c===s.AUTH_FAILURE?t.createElement("div",{style:Object.assign({position:"relative"},o?{}:R),className:o},t.createElement(S,null)):t.createElement("div",Object.assign({ref:f,"data-testid":"map",style:o?void 0:R,className:o},n?{id:n}:{}),l?t.createElement(P.Provider,{value:k},r):null)};T.deckGLViewProps=!0;const R=new Set;function k(...e){const t=JSON.stringify(e);R.has(t)||(R.add(t),console.error(...e))}const H=(e=null)=>{const r=t.useContext(u),{map:n}=t.useContext(P)||{};if(null===r)return k("useMap(): failed to retrieve APIProviderContext. Make sure that the <APIProvider> component exists and that the component you are calling `useMap()` from is a sibling of the <APIProvider>."),null;const{mapInstances:o}=r;return null!==e?o[e]||null:n||o.default||null};function I(e){const r=A(),n=t.useContext(u);return t.useEffect(()=>{r&&n&&n.importLibrary(e)},[r,n,e]),(null==n?void 0:n.loadedLibraries[e])||null}function x(e,r,n){t.useEffect(()=>{if(!e||!r||!n)return;const t=google.maps.event.addListener(e,r,n);return()=>t.remove()},[e,r,n])}function D(e,r,n){t.useEffect(()=>{e&&(e[r]=n)},[e,r,n])}function L(e,r,n){t.useEffect(()=>{if(e&&r&&n)return e.addEventListener(r,n),()=>e.removeEventListener(r,n)},[e,r,n])}const K=new class{constructor(){this.renderedStyles=new Set,this.styleElement=null}getStyleElement(){return this.styleElement||(this.styleElement=document.createElement("style"),this.styleElement.setAttribute("data-rgm-anchor-styles",""),document.head.appendChild(this.styleElement)),this.styleElement}addAdvancedMarkerPointerEventsOverwrite(){this.renderedStyles.has("marker-pointer-events")||(this.getStyleElement().textContent+="\n gmp-advanced-marker[data-origin='rgm'] {\n pointer-events: none !important;\n }\n ",this.renderedStyles.add("marker-pointer-events"))}cleanup(){this.styleElement&&(this.styleElement.remove(),this.styleElement=null,this.renderedStyles.clear())}};const j=t.createContext(null),N={TOP_LEFT:["0%","0%"],TOP_CENTER:["50%","0%"],TOP:["50%","0%"],TOP_RIGHT:["100%","0%"],LEFT_CENTER:["0%","50%"],LEFT_TOP:["0%","0%"],LEFT:["0%","50%"],LEFT_BOTTOM:["0%","100%"],RIGHT_TOP:["100%","0%"],RIGHT:["100%","50%"],RIGHT_CENTER:["100%","50%"],RIGHT_BOTTOM:["100%","100%"],BOTTOM_LEFT:["0%","100%"],BOTTOM_CENTER:["50%","100%"],BOTTOM:["50%","100%"],BOTTOM_RIGHT:["100%","100%"],CENTER:["50%","50%"]},M=t.forwardRef((e,n)=>{const{children:o,style:a,className:i,anchorPoint:s}=e,[c,l]=function(e){const[r,n]=t.useState(null),[o,a]=t.useState(null),i=H(),s=I("marker"),{children:c,onClick:l,className:u,onMouseEnter:d,onMouseLeave:p,onDrag:f,onDragStart:h,onDragEnd:y,collisionBehavior:m,clickable:g,draggable:w,position:b,title:E,zIndex:v,anchorPoint:S,anchorLeft:A,anchorTop:_}=e,O=t.Children.count(c);return t.useEffect(()=>{if(!i||!s)return;const e=new s.AdvancedMarkerElement;e.map=i,n(e);let t=null;return O>0&&(t=document.createElement("div"),e.content=t,a(t)),()=>{e.map=null,null==t||t.remove(),n(null),a(null)}},[i,s,O]),t.useEffect(()=>{!(null==r?void 0:r.content)||!U(r.content)||O>0||(r.content.className=null!=u?u:"")},[r,u,O]),function(e,r,n,o,a){t.useEffect(()=>{if(!e||!a)return;const t=function(e,t){var r;if(!(null===(r=null===google||void 0===google?void 0:google.maps)||void 0===r?void 0:r.version))return;const n=google.maps.version.split("."),o=parseInt(n[0],10),a=parseInt(n[1],10);return o>e||o===e&&a>=t}(3,62),i=e.content;if(i&&U(i)){if(void 0!==n||void 0!==o)return t||console.warn(`AdvancedMarker: The anchorLeft and anchorTop props are only supported in Google Maps API version 3.62 and above. The current version is ${google.maps.version}.`),e.anchorLeft=n,e.anchorTop=o,void(void 0!==r&&console.warn("AdvancedMarker: the anchorPoint prop is ignored when anchorLeft and/or anchorTop are set."));if(void 0!==r){const[n,o]=null!=r?r:N.BOTTOM,a=`calc(-1 * ${n})`,s=`calc(-1 * ${o})`;t?(e.anchorLeft=a,e.anchorTop=s,i.style.transform=""):(i.style.transform=`translate(50%, 100%) translate(${a}, ${s})`,e.dataset.origin="rgm",K.addAdvancedMarkerPointerEventsOverwrite())}}},[e,r,n,o,a])}(r,S,A,_,O>0),D(r,"position",b),D(r,"title",null!=E?E:""),D(r,"zIndex",v),D(r,"collisionBehavior",m),t.useEffect(()=>{r&&(r.gmpDraggable=void 0!==w?w:!!(f||h||y))},[r,w,f,y,h]),t.useEffect(()=>{if(!r)return;const e=void 0!==g||Boolean(l)||Boolean(d)||Boolean(p);r.gmpClickable=e,e&&(null==r?void 0:r.content)&&U(r.content)&&(r.content.style.pointerEvents="all",l&&(r.content.style.cursor="pointer"))},[r,g,l,d,p]),x(r,"click",l),x(r,"drag",f),x(r,"dragstart",h),x(r,"dragend",y),L(null==r?void 0:r.element,"mouseenter",d),L(null==r?void 0:r.element,"mouseleave",p),[r,o]}(e),u=t.useMemo(()=>c?{marker:c}:null,[c]);return t.useImperativeHandle(n,()=>c,[c]),l?t.createElement(j.Provider,{value:u},r.createPortal(t.createElement(J,{anchorPoint:s,styles:a,className:i},o),l)):null});function W(e){return void 0!==e.content}function U(e){return e.nodeType===Node.ELEMENT_NODE}M.displayName="AdvancedMarker";const J=({children:e,styles:r,className:n})=>t.createElement("div",{className:n,style:r},e);function B(e,t,r){const n=0===t.indexOf("--");var o;null==r||"boolean"==typeof r||""===r?n?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":n?e.setProperty(t,r):"number"!=typeof r||0===r||(o=t,F.has(o))?"float"===t?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}const F=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function $(e){return"string"==typeof e?e:`${e.lat},${e.lng}`}function G(e){return e.slice(1)}const z=["color","weight","fillcolor","geodesic"];function V(e=[]){return e.map(e=>{return G(function(e){let t="";return z.forEach(r=>{void 0!==e[r]&&(t+=`|${r}:${e[r]}`)}),t}(e)+("string"==typeof(t=e.coordinates)?`|${decodeURIComponent(t)}`:t.map(e=>`|${$(e)}`).join("")));var t})}const q=t.forwardRef((e,r)=>{const n=function(e){const[r,n]=t.useState(null),o=H(),{onClick:i,onDrag:s,onDragStart:c,onDragEnd:l,onMouseOver:u,onMouseOut:d}=e,p=a(e,["onClick","onDrag","onDragStart","onDragEnd","onMouseOver","onMouseOut"]),{position:f,draggable:h}=p;return t.useEffect(()=>{if(!o)return void(void 0===o&&console.error("<Marker> has to be inside a Map component."));const e=new google.maps.Marker(p);return e.setMap(o),n(e),()=>{e.setMap(null),n(null)}},[o]),t.useEffect(()=>{if(!r)return;const e=r,t=google.maps.event;return i&&t.addListener(e,"click",i),s&&t.addListener(e,"drag",s),c&&t.addListener(e,"dragstart",c),l&&t.addListener(e,"dragend",l),u&&t.addListener(e,"mouseover",u),d&&t.addListener(e,"mouseout",d),r.setDraggable(Boolean(h)),()=>{t.clearInstanceListeners(e)}},[r,h,i,s,c,l,u,d]),t.useEffect(()=>{r&&p&&r.setOptions(p)},[r,p]),t.useEffect(()=>{!h&&f&&r&&r.setPosition(f)},[h,f,r]),r}(e);return t.useImperativeHandle(r,()=>n,[n]),t.createElement(t.Fragment,null)});q.displayName="Marker";const X=(e,t,r,n,o)=>n+(e-t)*(o-n)/(r-t);e.APILoadingStatus=s,e.APIProvider=e=>{const{children:r}=e,n=a(e,["children"]),{mapInstances:o,addMapInstance:s,removeMapInstance:d,clearMapInstances:p}=function(){const[e,r]=t.useState({});return{mapInstances:e,addMapInstance:(e,t="default")=>{r(r=>Object.assign(Object.assign({},r),{[t]:e}))},removeMapInstance:(e="default")=>{r(t=>{var r=e;return t[r],a(t,["symbol"==typeof r?r:r+""])})},clearMapInstances:()=>{r({})}}}(),{status:f,loadedLibraries:h,importLibrary:y}=function(e){const{onLoad:r,onError:n,apiKey:o,version:s,libraries:l=[]}=e,u=a(e,["onLoad","onError","apiKey","version","libraries"]),[d,p]=t.useState(c.loadingStatus),[f,h]=t.useReducer((e,t)=>e[t.name]?e:Object.assign(Object.assign({},e),{[t.name]:t.value}),{}),y=t.useMemo(()=>null==l?void 0:l.join(","),[l]),m=t.useMemo(()=>JSON.stringify(Object.assign({apiKey:o,version:s},u)),[o,s,u]),g=t.useCallback(e=>i(this,void 0,void 0,function*(){var t;if(f[e])return f[e];if(!(null===(t=null===google||void 0===google?void 0:google.maps)||void 0===t?void 0:t.importLibrary))throw new Error("[api-provider-internal] importLibrary was called before google.maps.importLibrary was defined.");const r=yield window.google.maps.importLibrary(e);return h({name:e,value:r}),r}),[f]);return t.useEffect(()=>{(()=>{i(this,void 0,void 0,function*(){try{const e=Object.assign({key:o},u);s&&(e.v=s),(null==y?void 0:y.length)>0&&(e.libraries=y),(void 0===e.channel||e.channel<0||e.channel>999)&&delete e.channel,void 0===e.solutionChannel?e.solutionChannel="GMP_visgl_rgmlibrary_v1_default":""===e.solutionChannel&&delete e.solutionChannel,yield c.load(e,e=>p(e));for(const e of["core","maps",...l])yield g(e);r&&r()}catch(e){n?n(e):console.error("<ApiProvider> failed to load the Google Maps JavaScript API",e)}})})()},[o,y,m]),{status:d,loadedLibraries:f,importLibrary:g}}(n),m=function(e){return t.useMemo(()=>e.disableUsageAttribution?null:l,[e.disableUsageAttribution])}(n),g=t.useMemo(()=>({mapInstances:o,addMapInstance:s,removeMapInstance:d,clearMapInstances:p,status:f,loadedLibraries:h,importLibrary:y,internalUsageAttributionIds:m}),[o,s,d,p,f,h,y,m]);return t.createElement(u.Provider,{value:g},r)},e.APIProviderContext=u,e.AdvancedMarker=M,e.AdvancedMarkerAnchorPoint=N,e.AdvancedMarkerContext=j,e.CollisionBehavior={REQUIRED:"REQUIRED",REQUIRED_AND_HIDES_OPTIONAL:"REQUIRED_AND_HIDES_OPTIONAL",OPTIONAL_AND_HIDES_LOWER_PRIORITY:"OPTIONAL_AND_HIDES_LOWER_PRIORITY"},e.ColorScheme={DARK:"DARK",LIGHT:"LIGHT",FOLLOW_SYSTEM:"FOLLOW_SYSTEM"},e.ControlPosition={TOP_LEFT:1,TOP_CENTER:2,TOP:2,TOP_RIGHT:3,LEFT_CENTER:4,LEFT_TOP:5,LEFT:5,LEFT_BOTTOM:6,RIGHT_TOP:7,RIGHT:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM:11,BOTTOM_RIGHT:12,CENTER:13,BLOCK_START_INLINE_START:14,BLOCK_START_INLINE_CENTER:15,BLOCK_START_INLINE_END:16,INLINE_START_BLOCK_CENTER:17,INLINE_START_BLOCK_START:18,INLINE_START_BLOCK_END:19,INLINE_END_BLOCK_START:20,INLINE_END_BLOCK_CENTER:21,INLINE_END_BLOCK_END:22,BLOCK_END_INLINE_START:23,BLOCK_END_INLINE_CENTER:24,BLOCK_END_INLINE_END:25},e.GoogleMapsContext=P,e.InfoWindow=e=>{const{children:o,headerContent:i,style:s,className:c,pixelOffset:l,anchor:u,shouldFocus:d,onClose:p,onCloseClick:f}=e,h=a(e,["children","headerContent","style","className","pixelOffset","anchor","shouldFocus","onClose","onCloseClick"]),y=I("maps"),[g,w]=t.useState(null),b=t.useRef(null),E=t.useRef(null),v=m(h,n);t.useEffect(()=>{if(!y)return;b.current=document.createElement("div"),E.current=document.createElement("div");const e=v;l&&(e.pixelOffset=new google.maps.Size(l[0],l[1])),i&&(e.headerContent="string"==typeof i?i:E.current);const t=new google.maps.InfoWindow(v);return t.setContent(b.current),w(t),()=>{var e,r;t.setContent(null),null===(e=b.current)||void 0===e||e.remove(),null===(r=E.current)||void 0===r||r.remove(),b.current=null,E.current=null,w(null)}},[y]);const S=t.useRef(null);t.useEffect(()=>{g&&b.current&&(function(e,t,r){if(null!=t&&"object"!=typeof t)throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");const n=e.style;if(null!=r){for(const e in r)!r.hasOwnProperty(e)||null!=t&&t.hasOwnProperty(e)||(0===e.indexOf("--")?n.setProperty(e,""):"float"===e?n.cssFloat="":n[e]="");if(null!=t)for(const e in t){const o=t[e];t.hasOwnProperty(e)&&r[e]!==o&&B(n,e,o)}}else{if(null==t)return;for(const e in t)t.hasOwnProperty(e)&&B(n,e,t[e])}}(b.current,s||null,S.current),S.current=s||null,c!==b.current.className&&(b.current.className=c||""))},[g,c,s]),t.useEffect(()=>{if(!g)return;const e=v;e.pixelOffset=l?new google.maps.Size(l[0],l[1]):null,e.headerContent=i?"string"==typeof i?i:E.current:null,g.setOptions(v)},[v,l,i]),x(g,"close",p),x(g,"closeclick",f);const A=H();return t.useEffect(()=>{var e;if(!A||!g||null===u)return;const t=!!u,r={map:A};if(u&&(r.anchor=u,W(u)&&u.content instanceof Element)){const t=null==u?void 0:u.getBoundingClientRect();if(t&&"rgm"===u.dataset.origin){const r=null===(e=u.content.firstElementChild)||void 0===e?void 0:e.firstElementChild,n=null==r?void 0:r.getBoundingClientRect(),o=n.x-t.x+(n.width-t.width)/2,a=n.y-t.y,i=v;i.pixelOffset=new google.maps.Size(l?l[0]+o:o,l?l[1]+a:a),g.setOptions(i)}}return void 0!==d&&(r.shouldFocus=d),g.open(r),()=>{t&&g.set("anchor",null),g.close()}},[g,u,A,d,v,l]),t.createElement(t.Fragment,null,b.current&&r.createPortal(o,b.current),null!==E.current&&r.createPortal(i,E.current))},e.Map=T,e.MapControl=({children:e,position:n})=>{const o=t.useMemo(()=>document.createElement("div"),[]),a=H();return t.useEffect(()=>{if(!a)return;const e=a.controls[n];return e.push(o),()=>{const t=e.getArray();if(!t)return;const r=t.indexOf(o);e.removeAt(r)}},[o,a,n]),r.createPortal(e,o)},e.Marker=q,e.Pin=e=>{var n;const o=null===(n=t.useContext(j))||void 0===n?void 0:n.marker,a=t.useMemo(()=>document.createElement("div"),[]);return t.useEffect(()=>{var r;if(!o)return void(void 0===o&&console.error("The <Pin> component can only be used inside <AdvancedMarker>."));e.glyph&&e.children&&k("The <Pin> component only uses children to render the glyph if both the glyph property and children are present."),t.Children.count(e.children)>1&&k("Passing multiple children to the <Pin> component might lead to unexpected results.");const n=Object.assign({},e),i=new google.maps.marker.PinElement(n);e.children&&(i.glyph=a);const s=null===(r=o.content)||void 0===r?void 0:r.firstChild;for(;null==s?void 0:s.firstChild;)s.removeChild(s.firstChild);s&&s.appendChild(i.element)},[o,a,e]),r.createPortal(e.children,a)},e.RenderingType={VECTOR:"VECTOR",RASTER:"RASTER",UNINITIALIZED:"UNINITIALIZED"},e.StaticMap=e=>{const{url:r,className:n}=e;if(!r)throw new Error("URL is required");return t.createElement("img",{className:n,src:r,width:"100%"})},e.VERSION=o,e.createStaticMapsUrl=function({apiKey:e,width:t,height:r,center:n,zoom:o,scale:a,format:i,mapType:s,language:c,region:l,mapId:u,markers:d=[],paths:p=[],visible:f=[],style:h=[]}){e||console.warn("API key is required"),t&&r||console.warn("Width and height are required");const y=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({key:e,size:`${t}x${r}`},n&&{center:$(n)}),o&&{zoom:o}),a&&{scale:a}),i&&{format:i}),s&&{maptype:s}),c&&{language:c}),l&&{region:l}),u&&{map_id:u}),m=new URL("https://maps.googleapis.com/maps/api/staticmap");Object.entries(y).forEach(([e,t])=>{m.searchParams.append(e,String(t))});for(const e of function(e=[]){const t=[],r=null==e?void 0:e.reduce((e,t)=>{const{color:r="red",label:n,size:o,scale:a,icon:i,anchor:s}=t,c=(i?[i,s,a]:[r,n,o]).filter(Boolean).join("-");return e[c]=e[c]||[],e[c].push(t),e},{});return Object.values(null!=r?r:{}).forEach(e=>{let r="";const{icon:n}=e[0];Object.entries(e[0]).forEach(([e,t])=>{(n?["icon","anchor","scale"]:["color","label","size"]).includes(e)&&(r+=`|${e}:${t}`)});for(const t of e){const e="string"==typeof t.location?t.location:`${t.location.lat},${t.location.lng}`;r+=`|${e}`}t.push(r)}),t.map(G)}(d))m.searchParams.append("markers",e);for(const e of V(p))m.searchParams.append("path",e);f.length&&m.searchParams.append("visible",f.map(e=>$(e)).join("|"));for(const e of h.map(e=>{const{featureType:t,elementType:r,stylers:n=[]}=e;let o="";t&&(o+=`|feature:${t}`),r&&(o+=`|element:${r}`);for(const e of n)Object.entries(e).forEach(([e,t])=>{o+=`|${e}:${String(t).replace("#","0x")}`});return o}).map(G))m.searchParams.append("style",e);return m.toString()},e.isAdvancedMarker=W,e.isLatLngLiteral=E,e.latLngEquals=function(e,t){if(!e||!t)return!1;const r=v(e),n=v(t);return r.lat===n.lat&&r.lng===n.lng},e.limitTiltRange=({viewState:e})=>{const t=e.pitch,r=e.zoom+1,n=(o=r)<=10?30:o>=15.5?67.5:o<=14?X(o,10,14,30,45):X(o,14,15.5,45,67.5);var o;return Object.assign(Object.assign({},e),{fovy:25,pitch:Math.min(n,t)})},e.toLatLngLiteral=v,e.useAdvancedMarkerRef=function(){const[e,r]=t.useState(null);return[t.useCallback(e=>{r(e)},[]),e]},e.useApiIsLoaded=A,e.useApiLoadingStatus=b,e.useMap=H,e.useMapsLibrary=I,e.useMarkerRef=function(){const[e,r]=t.useState(null);return[t.useCallback(e=>{r(e)},[]),e]}}(t,r(9155),r(9514),r(8792))},5199:function(e,t,r){e=r.nmd(e),function(r){"use strict";var n={};r.PubSub?(n=r.PubSub,console.warn("PubSub already loaded, using existing version")):(r.PubSub=n,function(e){var t={},r=-1;function n(e,t,r){try{e(t,r)}catch(e){setTimeout(function(e){return function(){throw e}}(e),0)}}function o(e,t,r){e(t,r)}function a(e,r,a,i){var s,c=t[r],l=i?o:n;if(Object.prototype.hasOwnProperty.call(t,r))for(s in c)Object.prototype.hasOwnProperty.call(c,s)&&l(c[s],e,a)}function i(e){var r=String(e);return Boolean(Object.prototype.hasOwnProperty.call(t,r)&&function(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}(t[r]))}function s(e,t,r,n){var o=function(e,t,r){return function(){var n=String(e),o=n.lastIndexOf(".");for(a(e,e,t,r);-1!==o;)o=(n=n.substr(0,o)).lastIndexOf("."),a(e,n,t,r);a(e,"*",t,r)}}(e="symbol"==typeof e?e.toString():e,t,n);return!!function(e){for(var t=String(e),r=i(t)||i("*"),n=t.lastIndexOf(".");!r&&-1!==n;)n=(t=t.substr(0,n)).lastIndexOf("."),r=i(t);return r}(e)&&(!0===r?o():setTimeout(o,0),!0)}e.publish=function(t,r){return s(t,r,!1,e.immediateExceptions)},e.publishSync=function(t,r){return s(t,r,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(t,e)||(t[e]={});var o="uid_"+String(++r);return t[e][o]=n,o},e.subscribeAll=function(t){return e.subscribe("*",t)},e.subscribeOnce=function(t,r){var n=e.subscribe(t,function(){e.unsubscribe(n),r.apply(this,arguments)});return e},e.clearAllSubscriptions=function(){t={}},e.clearSubscriptions=function(e){var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&delete t[r]},e.countSubscriptions=function(e){var r,n,o=0;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)){for(n in t[r])o++;break}return o},e.getSubscriptions=function(e){var r,n=[];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&n.push(r);return n},e.unsubscribe=function(r){var n,o,a,i="string"==typeof r&&(Object.prototype.hasOwnProperty.call(t,r)||function(e){var r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e))return!0;return!1}(r)),s=!i&&"string"==typeof r,c="function"==typeof r,l=!1;if(!i){for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(o=t[n],s&&o[r]){delete o[r],l=r;break}if(c)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===r&&(delete o[a],l=!0)}return l}e.clearSubscriptions(r)}}(n)),void 0!==e&&e.exports&&(t=e.exports=n),t.PubSub=n,e.exports=t=n}("object"==typeof window&&window||this||r.g)},5478:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CompactEncrypt:()=>st,CompactSign:()=>lt,EmbeddedJWK:()=>wt,EncryptJWT:()=>ht,FlattenedEncrypt:()=>$e,FlattenedSign:()=>ct,GeneralEncrypt:()=>ze,GeneralSign:()=>dt,SignJWT:()=>ft,UnsecuredJWT:()=>Ct,base64url:()=>o,calculateJwkThumbprint:()=>mt,calculateJwkThumbprintUri:()=>gt,compactDecrypt:()=>je,compactVerify:()=>Ze,createLocalJWKSet:()=>At,createRemoteJWKSet:()=>Ot,cryptoRuntime:()=>Dt,decodeJwt:()=>kt,decodeProtectedHeader:()=>Rt,errors:()=>n,exportJWK:()=>Je,exportPKCS8:()=>Ue,exportSPKI:()=>We,flattenedDecrypt:()=>Ke,flattenedVerify:()=>Ye,generalDecrypt:()=>Ne,generalVerify:()=>Qe,generateKeyPair:()=>It,generateSecret:()=>xt,importJWK:()=>ke,importPKCS8:()=>Re,importSPKI:()=>Pe,importX509:()=>Te,jwtDecrypt:()=>it,jwtVerify:()=>at});var n={};r.r(n),r.d(n,{JOSEAlgNotAllowed:()=>A,JOSEError:()=>E,JOSENotSupported:()=>_,JWEDecompressionFailed:()=>C,JWEDecryptionFailed:()=>O,JWEInvalid:()=>P,JWKInvalid:()=>k,JWKSInvalid:()=>H,JWKSMultipleMatchingKeys:()=>x,JWKSNoMatchingKey:()=>I,JWKSTimeout:()=>D,JWSInvalid:()=>T,JWSSignatureVerificationFailed:()=>L,JWTClaimValidationFailed:()=>v,JWTExpired:()=>S,JWTInvalid:()=>R});var o={};r.r(o),r.d(o,{decode:()=>Tt,encode:()=>Pt});const a=crypto,i=e=>e instanceof CryptoKey,s=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await a.subtle.digest(r,t))},c=new TextEncoder,l=new TextDecoder,u=2**32;function d(...e){const t=e.reduce((e,{length:t})=>e+t,0),r=new Uint8Array(t);let n=0;return e.forEach(e=>{r.set(e,n),n+=e.length}),r}function p(e,t,r){if(t<0||t>=u)throw new RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function f(e){const t=Math.floor(e/u),r=e%u,n=new Uint8Array(8);return p(n,t,0),p(n,r,4),n}function h(e){const t=new Uint8Array(4);return p(t,e),t}function y(e){return d(h(e.length),e)}const m=e=>{let t=e;"string"==typeof t&&(t=c.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(""))},g=e=>m(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),w=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},b=e=>{let t=e;t instanceof Uint8Array&&(t=l.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return w(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}};class E extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class v extends E{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 S extends E{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 A extends E{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class _ extends E{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class O extends E{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}}class C extends E{constructor(){super(...arguments),this.code="ERR_JWE_DECOMPRESSION_FAILED",this.message="decompression operation failed"}static get code(){return"ERR_JWE_DECOMPRESSION_FAILED"}}class P extends E{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}}class T extends E{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class R extends E{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class k extends E{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}}class H extends E{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class I extends E{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 x extends E{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"}}Symbol.asyncIterator;class D extends E{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class L extends E{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}const K=a.getRandomValues.bind(a);function j(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 _(`Unsupported JWE Algorithm: ${e}`)}}const N=e=>K(new Uint8Array(j(e)>>3)),M=(e,t)=>{if(t.length<<3!==j(e))throw new P("Invalid Initialization Vector length")},W=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new P(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function U(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function J(e,t){return e.name===t}function B(e){return parseInt(e.name.slice(4),10)}function F(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 $(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!J(e.algorithm,"AES-GCM"))throw U("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw U(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!J(e.algorithm,"AES-KW"))throw U("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw U(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw U("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!J(e.algorithm,"PBKDF2"))throw U("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!J(e.algorithm,"RSA-OAEP"))throw U("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(B(e.algorithm.hash)!==r)throw U(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}F(e,r)}function G(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&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const z=(e,...t)=>G("Key must be ",e,...t);function V(e,t,...r){return G(`Key for the ${e} algorithm must be `,t,...r)}const q=e=>i(e),X=["CryptoKey"],Y=async(e,t,r,n,o,s)=>{if(!(i(t)||t instanceof Uint8Array))throw new TypeError(z(t,...X,"Uint8Array"));switch(M(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&W(t,parseInt(e.slice(-3),10)),async function(e,t,r,n,o,i){if(!(t instanceof Uint8Array))throw new TypeError(z(t,"Uint8Array"));const s=parseInt(e.slice(1,4),10),c=await a.subtle.importKey("raw",t.subarray(s>>3),"AES-CBC",!1,["decrypt"]),l=await a.subtle.importKey("raw",t.subarray(0,s>>3),{hash:"SHA-"+(s<<1),name:"HMAC"},!1,["sign"]),u=d(i,n,r,f(i.length<<3)),p=new Uint8Array((await a.subtle.sign("HMAC",l,u)).slice(0,s>>3));let h,y;try{h=((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,p)}catch(e){}if(!h)throw new O;try{y=new Uint8Array(await a.subtle.decrypt({iv:n,name:"AES-CBC"},c,r))}catch(e){}if(!y)throw new O;return y}(e,t,r,n,o,s);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&W(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,o,i){let s;t instanceof Uint8Array?s=await a.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):($(t,e,"decrypt"),s=t);try{return new Uint8Array(await a.subtle.decrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},s,d(r,o)))}catch(e){throw new O}}(e,t,r,n,o,s);default:throw new _("Unsupported JWE Content Encryption Algorithm")}},Z=async()=>{throw new _('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Q=async()=>{throw new _('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},ee=(...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 te(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const re=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function ne(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function oe(e,t,r){if(i(e))return $(e,t,r),e;if(e instanceof Uint8Array)return a.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(z(e,...X,"Uint8Array"))}const ae=async(e,t,r)=>{const n=await oe(t,e,"wrapKey");ne(n,e);const o=await a.subtle.importKey("raw",r,...re);return new Uint8Array(await a.subtle.wrapKey("raw",o,n,"AES-KW"))},ie=async(e,t,r)=>{const n=await oe(t,e,"unwrapKey");ne(n,e);const o=await a.subtle.unwrapKey("raw",r,n,"AES-KW",...re);return new Uint8Array(await a.subtle.exportKey("raw",o))};async function se(e,t,r,n,o=new Uint8Array(0),l=new Uint8Array(0)){if(!i(e))throw new TypeError(z(e,...X));if($(e,"ECDH"),!i(t))throw new TypeError(z(t,...X));$(t,"ECDH","deriveBits");const u=d(y(c.encode(r)),y(o),y(l),h(n));let p;return p="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3,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(h(t+1)),n.set(e,4),n.set(r,4+e.length),o.set(await s("sha256",n),32*t)}return o.slice(0,t>>3)}(new Uint8Array(await a.subtle.deriveBits({name:e.algorithm.name,public:e},t,p)),n,u)}function ce(e){if(!i(e))throw new TypeError(z(e,...X));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function le(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new P("PBES2 Salt Input must be 8 or more octets")}(e);const o=function(e,t){return d(c.encode(e),new Uint8Array([0]),t)}(t,e),s=parseInt(t.slice(13,16),10),l={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:o},u={length:s,name:"AES-KW"},p=await function(e,t){if(e instanceof Uint8Array)return a.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(i(e))return $(e,t,"deriveBits","deriveKey"),e;throw new TypeError(z(e,...X,"Uint8Array"))}(n,t);if(p.usages.includes("deriveBits"))return new Uint8Array(await a.subtle.deriveBits(l,p,s));if(p.usages.includes("deriveKey"))return a.subtle.deriveKey(l,p,u,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}function ue(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new _(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}const de=(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`)}};function pe(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 _(`Unsupported JWE Algorithm: ${e}`)}}const fe=e=>K(new Uint8Array(pe(e)>>3)),he=(e,t)=>`-----BEGIN ${t}-----\n${(e.match(/.{1,64}/g)||[]).join("\n")}\n-----END ${t}-----`,ye=async(e,t,r)=>{if(!i(r))throw new TypeError(z(r,...X));if(!r.extractable)throw new TypeError("CryptoKey is not extractable");if(r.type!==e)throw new TypeError(`key is not a ${e} key`);return he(m(new Uint8Array(await a.subtle.exportKey(t,r))),`${e.toUpperCase()} KEY`)},me=e=>ye("public","spki",e),ge=e=>ye("private","pkcs8",e),we=(e,t,r=0)=>{0===r&&(t.unshift(t.length),t.unshift(6));let 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])||we(e,t,n+1))},be=e=>{switch(!0){case we(e,[42,134,72,206,61,3,1,7]):return"P-256";case we(e,[43,129,4,0,34]):return"P-384";case we(e,[43,129,4,0,35]):return"P-521";case we(e,[43,101,110]):return"X25519";case we(e,[43,101,111]):return"X448";case we(e,[43,101,112]):return"Ed25519";case we(e,[43,101,113]):return"Ed448";default:throw new _("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},Ee=async(e,t,r,n,o)=>{var i;let s,c;const l=new Uint8Array(atob(r.replace(e,"")).split("").map(e=>e.charCodeAt(0))),u="spki"===t;switch(n){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},c=u?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},c=u?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},c=u?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},c=u?["verify"]:["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},c=u?["verify"]:["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},c=u?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const e=be(l);s=e.startsWith("P-")?{name:"ECDH",namedCurve:e}:{name:e},c=u?[]:["deriveBits"];break}case"EdDSA":s={name:be(l)},c=u?["verify"]:["sign"];break;default:throw new _('Invalid or unsupported "alg" (Algorithm) value')}return a.subtle.importKey(t,l,s,null!==(i=null==o?void 0:o.extractable)&&void 0!==i&&i,c)},ve=(e,t,r)=>Ee(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",e,t,r),Se=(e,t,r)=>Ee(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,r);function Ae(e){let t=[],r=0;for(;r<e.length;){let n=_e(e.subarray(r));t.push(n),r+=n.byteLength}return t}function _e(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)}}{let 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)}}const Oe=(e,t,r)=>{let n;try{n=function(e){const t=e.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),r=w(t);return he(function(e){const t=Ae(Ae(_e(e).contents)[0].contents);return m(t[160===t[0].raw[0]?6:5].raw)}(r),"PUBLIC KEY")}(e)}catch(e){throw new TypeError("Failed to parse the X.509 certificate",{cause:e})}return Se(n,t,r)},Ce=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:o}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new _(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;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 _('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 _('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 _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new _('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),i=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:o];if("PBKDF2"===n.name)return a.subtle.importKey("raw",b(e.k),...i);const s={...e};return delete s.alg,delete s.use,a.subtle.importKey("jwk",s,...i)};async function Pe(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return Se(e,t,r)}async function Te(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw new TypeError('"x509" must be X.509 formatted string');return Oe(e,t,r)}async function Re(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return ve(e,t,r)}async function ke(e,t,r){var n;if(!te(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 null!=r||(r=!0!==e.ext),r?Ce({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):b(e.k);case"RSA":if(void 0!==e.oth)throw new _('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return Ce({...e,alg:t});default:throw new _('Unsupported "kty" (Key Type) Parameter value')}}const He=(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(!q(t))throw new TypeError(V(e,t,...X,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${X.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!q(t))throw new TypeError(V(e,t,...X));if("secret"===t.type)throw new TypeError(`${X.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${X.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${X.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${X.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${X.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)},Ie=async(e,t,r,n,o)=>{if(!(i(r)||r instanceof Uint8Array))throw new TypeError(z(r,...X,"Uint8Array"));switch(M(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&W(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,o){if(!(r instanceof Uint8Array))throw new TypeError(z(r,"Uint8Array"));const i=parseInt(e.slice(1,4),10),s=await a.subtle.importKey("raw",r.subarray(i>>3),"AES-CBC",!1,["encrypt"]),c=await a.subtle.importKey("raw",r.subarray(0,i>>3),{hash:"SHA-"+(i<<1),name:"HMAC"},!1,["sign"]),l=new Uint8Array(await a.subtle.encrypt({iv:n,name:"AES-CBC"},s,t)),u=d(o,n,l,f(o.length<<3));return{ciphertext:l,tag:new Uint8Array((await a.subtle.sign("HMAC",c,u)).slice(0,i>>3))}}(e,t,r,n,o);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&W(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,o){let i;r instanceof Uint8Array?i=await a.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):($(r,e,"encrypt"),i=r);const s=new Uint8Array(await a.subtle.encrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},i,t)),c=s.slice(-16);return{ciphertext:s.slice(0,-16),tag:c}}(e,t,r,n,o);default:throw new _("Unsupported JWE Content Encryption Algorithm")}},xe=async function(e,t,r,n,o){switch(He(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new P("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new P("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!te(n.epk))throw new P('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ce(t))throw new _("ECDH with the provided key is not allowed or not supported by your javascript runtime");const o=await ke(n.epk,e);let a,i;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new P('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{a=b(n.apu)}catch(e){throw new P("Failed to base64url decode the apu")}}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new P('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{i=b(n.apv)}catch(e){throw new P("Failed to base64url decode the apv")}}const s=await se(o,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?pe(n.enc):parseInt(e.slice(-5,-2),10),a,i);if("ECDH-ES"===e)return s;if(void 0===r)throw new P("JWE Encrypted Key missing");return ie(e.slice(-6),s,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 P("JWE Encrypted Key missing");return(async(e,t,r)=>{if(!i(t))throw new TypeError(z(t,...X));if($(t,e,"decrypt","unwrapKey"),de(e,t),t.usages.includes("decrypt"))return new Uint8Array(await a.subtle.decrypt(ue(e),t,r));if(t.usages.includes("unwrapKey")){const n=await a.subtle.unwrapKey("raw",r,t,ue(e),...re);return new Uint8Array(await a.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')})(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new P("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new P('JOSE Header "p2c" (PBES2 Count) missing or invalid');const a=(null==o?void 0:o.maxPBES2Count)||1e4;if(n.p2c>a)throw new P('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new P('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let i;try{i=b(n.p2s)}catch(e){throw new P("Failed to base64url decode the p2s")}return(async(e,t,r,n,o)=>{const a=await le(o,e,n,t);return ie(e.slice(-6),a,r)})(e,t,r,n.p2c,i)}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new P("JWE Encrypted Key missing");return ie(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{if(void 0===r)throw new P("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new P('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new P('JOSE Header "tag" (Authentication Tag) missing or invalid');let o,a;try{o=b(n.iv)}catch(e){throw new P("Failed to base64url decode the iv")}try{a=b(n.tag)}catch(e){throw new P("Failed to base64url decode the tag")}return async function(e,t,r,n,o){const a=e.slice(0,7);return Y(a,t,r,n,o,new Uint8Array(0))}(e,t,r,o,a)}default:throw new _('Invalid or unsupported "alg" (JWE Algorithm) header value')}},De=function(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 a;a=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!a.has(t))throw new _(`Extension Header Parameter "${t}" is not recognized`);if(void 0===o[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)},Le=(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 Ke(e,t,r){var n;if(!te(e))throw new P("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new P("JOSE Header missing");if("string"!=typeof e.iv)throw new P("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new P("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new P("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new P("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new P("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new P("JWE AAD incorrect type");if(void 0!==e.header&&!te(e.header))throw new P("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!te(e.unprotected))throw new P("JWE Per-Recipient Unprotected Header incorrect type");let o;if(e.protected)try{const t=b(e.protected);o=JSON.parse(l.decode(t))}catch(e){throw new P("JWE Protected Header is invalid")}if(!ee(o,e.header,e.unprotected))throw new P("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const a={...o,...e.header,...e.unprotected};if(De(P,new Map,null==r?void 0:r.crit,o,a),void 0!==a.zip){if(!o||!o.zip)throw new P('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==a.zip)throw new _('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:i,enc:s}=a;if("string"!=typeof i||!i)throw new P("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new P("missing JWE Encryption Algorithm (enc) in JWE Header");const u=r&&Le("keyManagementAlgorithms",r.keyManagementAlgorithms),p=r&&Le("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(u&&!u.has(i))throw new A('"alg" (Algorithm) Header Parameter not allowed');if(p&&!p.has(s))throw new A('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;if(void 0!==e.encrypted_key)try{f=b(e.encrypted_key)}catch(e){throw new P("Failed to base64url decode the encrypted_key")}let h,y,m,g=!1;"function"==typeof t&&(t=await t(o,e),g=!0);try{h=await xe(i,t,f,a,r)}catch(e){if(e instanceof TypeError||e instanceof P||e instanceof _)throw e;h=fe(s)}try{y=b(e.iv)}catch(e){throw new P("Failed to base64url decode the iv")}try{m=b(e.tag)}catch(e){throw new P("Failed to base64url decode the tag")}const w=c.encode(null!==(n=e.protected)&&void 0!==n?n:"");let E,v;E=void 0!==e.aad?d(w,c.encode("."),c.encode(e.aad)):w;try{v=b(e.ciphertext)}catch(e){throw new P("Failed to base64url decode the ciphertext")}let S=await Y(s,h,v,y,m,E);"DEF"===a.zip&&(S=await((null==r?void 0:r.inflateRaw)||Z)(S));const O={plaintext:S};if(void 0!==e.protected&&(O.protectedHeader=o),void 0!==e.aad)try{O.additionalAuthenticatedData=b(e.aad)}catch(e){throw new P("Failed to base64url decode the aad")}return void 0!==e.unprotected&&(O.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(O.unprotectedHeader=e.header),g?{...O,key:t}:O}async function je(e,t,r){if(e instanceof Uint8Array&&(e=l.decode(e)),"string"!=typeof e)throw new P("Compact JWE must be a string or Uint8Array");const{0:n,1:o,2:a,3:i,4:s,length:c}=e.split(".");if(5!==c)throw new P("Invalid Compact JWE");const u=await Ke({ciphertext:i,iv:a||void 0,protected:n||void 0,tag:s||void 0,encrypted_key:o||void 0},t,r),d={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof t?{...d,key:u.key}:d}async function Ne(e,t,r){if(!te(e))throw new P("General JWE must be an object");if(!Array.isArray(e.recipients)||!e.recipients.every(te))throw new P("JWE Recipients missing or incorrect type");if(!e.recipients.length)throw new P("JWE Recipients has no members");for(const n of e.recipients)try{return await Ke({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(e){}throw new O}const Me=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:g(e)};if(!i(e))throw new TypeError(z(e,...X,"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,...s}=await a.subtle.exportKey("jwk",e);return s};async function We(e){return me(e)}async function Ue(e){return ge(e)}async function Je(e){return Me(e)}const Be=async function(e,t,r,n,o={}){let s,c,l;switch(He(e,r,"encrypt"),e){case"dir":l=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ce(r))throw new _("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:u,apv:d}=o;let{epk:p}=o;p||(p=(await async function(e){if(!i(e))throw new TypeError(z(e,...X));return a.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:f,y:h,crv:y,kty:m}=await Je(p),w=await se(r,p,"ECDH-ES"===e?t:e,"ECDH-ES"===e?pe(t):parseInt(e.slice(-5,-2),10),u,d);if(c={epk:{x:f,crv:y,kty:m}},"EC"===m&&(c.epk.y=h),u&&(c.apu=g(u)),d&&(c.apv=g(d)),"ECDH-ES"===e){l=w;break}l=n||fe(t);const b=e.slice(-6);s=await ae(b,w,l);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":l=n||fe(t),s=await(async(e,t,r)=>{if(!i(t))throw new TypeError(z(t,...X));if($(t,e,"encrypt","wrapKey"),de(e,t),t.usages.includes("encrypt"))return new Uint8Array(await a.subtle.encrypt(ue(e),t,r));if(t.usages.includes("wrapKey")){const n=await a.subtle.importKey("raw",r,...re);return new Uint8Array(await a.subtle.wrapKey("raw",n,t,ue(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,r,l);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{l=n||fe(t);const{p2c:a,p2s:i}=o;({encryptedKey:s,...c}=await(async(e,t,r,n=2048,o=K(new Uint8Array(16)))=>{const a=await le(o,e,n,t);return{encryptedKey:await ae(e.slice(-6),a,r),p2c:n,p2s:g(o)}})(e,r,l,a,i));break}case"A128KW":case"A192KW":case"A256KW":l=n||fe(t),s=await ae(e,r,l);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{l=n||fe(t);const{iv:a}=o;({encryptedKey:s,...c}=await async function(e,t,r,n){const o=e.slice(0,7);n||(n=N(o));const{ciphertext:a,tag:i}=await Ie(o,r,t,n,new Uint8Array(0));return{encryptedKey:a,iv:g(n),tag:g(i)}}(e,r,l,a));break}default:throw new _('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:l,encryptedKey:s,parameters:c}},Fe=Symbol();class $e{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 P("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!ee(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new P("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(De(P,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new P('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new _('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:o}=r;if("string"!=typeof n||!n)throw new P('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof o||!o)throw new P('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let a,i,s,u,p,f,h;if("dir"===n){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===n&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let r;({cek:i,encryptedKey:a,parameters:r}=await Be(n,o,e,this._cek,this._keyManagementParameters)),r&&(t&&Fe in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...r}:this.setUnprotectedHeader(r):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...r}:this.setProtectedHeader(r))}if(this._iv||(this._iv=N(o)),u=this._protectedHeader?c.encode(g(JSON.stringify(this._protectedHeader))):c.encode(""),this._aad?(p=g(this._aad),s=d(u,c.encode("."),c.encode(p))):s=u,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Q)(this._plaintext);({ciphertext:f,tag:h}=await Ie(o,e,i,this._iv,s))}else({ciphertext:f,tag:h}=await Ie(o,this._plaintext,i,this._iv,s));const y={ciphertext:g(f),iv:g(this._iv),tag:g(h)};return a&&(y.encrypted_key=g(a)),p&&(y.aad=p),this._protectedHeader&&(y.protected=l.decode(u)),this._sharedUnprotectedHeader&&(y.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(y.header=this._unprotectedHeader),y}}class Ge{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}}class ze{constructor(e){this._recipients=[],this._plaintext=e}addRecipient(e,t){const r=new Ge(this,e,{crit:null==t?void 0: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(e){var t,r,n;if(!this._recipients.length)throw new P("at least one recipient must be added");if(e={deflateRaw:null==e?void 0:e.deflateRaw},1===this._recipients.length){const[t]=this._recipients,r=await new $e(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(t.unprotectedHeader).encrypt(t.key,{...t.options,...e});let n={ciphertext:r.ciphertext,iv:r.iv,recipients:[{}],tag:r.tag};return r.aad&&(n.aad=r.aad),r.protected&&(n.protected=r.protected),r.unprotected&&(n.unprotected=r.unprotected),r.encrypted_key&&(n.recipients[0].encrypted_key=r.encrypted_key),r.header&&(n.recipients[0].header=r.header),n}let o;for(let e=0;e<this._recipients.length;e++){const t=this._recipients[e];if(!ee(this._protectedHeader,this._unprotectedHeader,t.unprotectedHeader))throw new P("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...t.unprotectedHeader},{alg:n}=r;if("string"!=typeof n||!n)throw new P('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("dir"===n||"ECDH-ES"===n)throw new P('"dir" and "ECDH-ES" alg may only be used with a single recipient');if("string"!=typeof r.enc||!r.enc)throw new P('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(o){if(o!==r.enc)throw new P('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else o=r.enc;if(De(P,new Map,t.options.crit,this._protectedHeader,r),!(void 0===r.zip||this._protectedHeader&&this._protectedHeader.zip))throw new P('JWE "zip" (Compression Algorithm) Header MUST be integrity protected')}const a=fe(o);let i={ciphertext:"",iv:"",recipients:[],tag:""};for(let s=0;s<this._recipients.length;s++){const c=this._recipients[s],l={};i.recipients.push(l);const u={...this._protectedHeader,...this._unprotectedHeader,...c.unprotectedHeader}.alg.startsWith("PBES2")?2048+s:void 0;if(0===s){const t=await new $e(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(a).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(c.unprotectedHeader).setKeyManagementParameters({p2c:u}).encrypt(c.key,{...c.options,...e,[Fe]:!0});i.ciphertext=t.ciphertext,i.iv=t.iv,i.tag=t.tag,t.aad&&(i.aad=t.aad),t.protected&&(i.protected=t.protected),t.unprotected&&(i.unprotected=t.unprotected),l.encrypted_key=t.encrypted_key,t.header&&(l.header=t.header);continue}const{encryptedKey:d,parameters:p}=await Be((null===(t=c.unprotectedHeader)||void 0===t?void 0:t.alg)||(null===(r=this._protectedHeader)||void 0===r?void 0:r.alg)||(null===(n=this._unprotectedHeader)||void 0===n?void 0:n.alg),o,c.key,a,{p2c:u});l.encrypted_key=g(d),(c.unprotectedHeader||p)&&(l.header={...c.unprotectedHeader,...p})}return i}}function Ve(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 _(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function qe(e,t,r){if(i(t))return function(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!J(e.algorithm,"HMAC"))throw U("HMAC");const r=parseInt(t.slice(2),10);if(B(e.algorithm.hash)!==r)throw U(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!J(e.algorithm,"RSASSA-PKCS1-v1_5"))throw U("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(B(e.algorithm.hash)!==r)throw U(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!J(e.algorithm,"RSA-PSS"))throw U("RSA-PSS");const r=parseInt(t.slice(2),10);if(B(e.algorithm.hash)!==r)throw U(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw U("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!J(e.algorithm,"ECDSA"))throw U("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 U(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}F(e,r)}(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(z(t,...X));return a.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(z(t,...X,"Uint8Array"))}const Xe=async(e,t,r,n)=>{const o=await qe(e,t,"verify");de(e,o);const i=Ve(e,o.algorithm);try{return await a.subtle.verify(i,o,r,n)}catch(e){return!1}};async function Ye(e,t,r){var n;if(!te(e))throw new T("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new T('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new T("JWS Protected Header incorrect type");if(void 0===e.payload)throw new T("JWS Payload missing");if("string"!=typeof e.signature)throw new T("JWS Signature missing or incorrect type");if(void 0!==e.header&&!te(e.header))throw new T("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{const t=b(e.protected);o=JSON.parse(l.decode(t))}catch(e){throw new T("JWS Protected Header is invalid")}if(!ee(o,e.header))throw new T("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a={...o,...e.header};let i=!0;if(De(T,new Map([["b64",!0]]),null==r?void 0:r.crit,o,a).has("b64")&&(i=o.b64,"boolean"!=typeof i))throw new T('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=a;if("string"!=typeof s||!s)throw new T('JWS "alg" (Algorithm) Header Parameter missing or invalid');const u=r&&Le("algorithms",r.algorithms);if(u&&!u.has(s))throw new A('"alg" (Algorithm) Header Parameter not allowed');if(i){if("string"!=typeof e.payload)throw new T("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new T("JWS Payload must be a string or an Uint8Array instance");let p=!1;"function"==typeof t&&(t=await t(o,e),p=!0),He(s,t,"verify");const f=d(c.encode(null!==(n=e.protected)&&void 0!==n?n:""),c.encode("."),"string"==typeof e.payload?c.encode(e.payload):e.payload);let h,y;try{h=b(e.signature)}catch(e){throw new T("Failed to base64url decode the signature")}if(!await Xe(s,t,h,f))throw new L;if(i)try{y=b(e.payload)}catch(e){throw new T("Failed to base64url decode the payload")}else y="string"==typeof e.payload?c.encode(e.payload):e.payload;const m={payload:y};return void 0!==e.protected&&(m.protectedHeader=o),void 0!==e.header&&(m.unprotectedHeader=e.header),p?{...m,key:t}:m}async function Ze(e,t,r){if(e instanceof Uint8Array&&(e=l.decode(e)),"string"!=typeof e)throw new T("Compact JWS must be a string or Uint8Array");const{0:n,1:o,2:a,length:i}=e.split(".");if(3!==i)throw new T("Invalid Compact JWS");const s=await Ye({payload:o,protected:n,signature:a},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}async function Qe(e,t,r){if(!te(e))throw new T("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(te))throw new T("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await Ye({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new L}const et=e=>Math.floor(e.getTime()/1e3),tt=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,rt=e=>{const t=tt.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(86400*r);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}},nt=e=>e.toLowerCase().replace(/^application\//,""),ot=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||nt(e.typ)!==nt(n)))throw new v('unexpected "typ" JWT header value',"typ","check_failed");let o;try{o=JSON.parse(l.decode(t))}catch(e){}if(!te(o))throw new R("JWT Claims Set must be a top-level JSON object");const{requiredClaims:a=[],issuer:i,subject:s,audience:c,maxTokenAge:u}=r;void 0!==u&&a.push("iat"),void 0!==c&&a.push("aud"),void 0!==s&&a.push("sub"),void 0!==i&&a.push("iss");for(const e of new Set(a.reverse()))if(!(e in o))throw new v(`missing required "${e}" claim`,e,"missing");if(i&&!(Array.isArray(i)?i:[i]).includes(o.iss))throw new v('unexpected "iss" claim value',"iss","check_failed");if(s&&o.sub!==s)throw new v('unexpected "sub" claim value',"sub","check_failed");if(c&&(p="string"==typeof c?[c]:c,!("string"==typeof(d=o.aud)?p.includes(d):Array.isArray(d)&&p.some(Set.prototype.has.bind(new Set(d))))))throw new v('unexpected "aud" claim value',"aud","check_failed");var d,p;let f;switch(typeof r.clockTolerance){case"string":f=rt(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=et(h||new Date);if((void 0!==o.iat||u)&&"number"!=typeof o.iat)throw new v('"iat" claim must be a number',"iat","invalid");if(void 0!==o.nbf){if("number"!=typeof o.nbf)throw new v('"nbf" claim must be a number',"nbf","invalid");if(o.nbf>y+f)throw new v('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==o.exp){if("number"!=typeof o.exp)throw new v('"exp" claim must be a number',"exp","invalid");if(o.exp<=y-f)throw new S('"exp" claim timestamp check failed',"exp","check_failed")}if(u){const e=y-o.iat;if(e-f>("number"==typeof u?u:rt(u)))throw new S('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)throw new v('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return o};async function at(e,t,r){var n;const o=await Ze(e,t,r);if((null===(n=o.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===o.protectedHeader.b64)throw new R("JWTs MUST NOT use unencoded payload");const a={payload:ot(o.protectedHeader,o.payload,r),protectedHeader:o.protectedHeader};return"function"==typeof t?{...a,key:o.key}:a}async function it(e,t,r){const n=await je(e,t,r),o=ot(n.protectedHeader,n.plaintext,r),{protectedHeader:a}=n;if(void 0!==a.iss&&a.iss!==o.iss)throw new v('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==a.sub&&a.sub!==o.sub)throw new v('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==a.aud&&JSON.stringify(a.aud)!==JSON.stringify(o.aud))throw new v('replicated "aud" claim header parameter mismatch',"aud","mismatch");const i={payload:o,protectedHeader:a};return"function"==typeof t?{...i,key:n.key}:i}class st{constructor(e){this._flattened=new $e(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 ct{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 T("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!ee(this._protectedHeader,this._unprotectedHeader))throw new T("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(De(T,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new T('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:o}=r;if("string"!=typeof o||!o)throw new T('JWS "alg" (Algorithm) Header Parameter missing or invalid');He(o,e,"sign");let i,s=this._payload;n&&(s=c.encode(g(s))),i=this._protectedHeader?c.encode(g(JSON.stringify(this._protectedHeader))):c.encode("");const u=d(i,c.encode("."),s),p=await(async(e,t,r)=>{const n=await qe(e,t,"sign");de(e,n);const o=await a.subtle.sign(Ve(e,n.algorithm),n,r);return new Uint8Array(o)})(o,e,u),f={signature:g(p),payload:""};return n&&(f.payload=l.decode(s)),this._unprotectedHeader&&(f.header=this._unprotectedHeader),this._protectedHeader&&(f.protected=l.decode(i)),f}}class lt{constructor(e){this._flattened=new ct(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 ut{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}}class dt{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new ut(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new T("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 ct(this._payload);n.setProtectedHeader(r.protectedHeader),n.setUnprotectedHeader(r.unprotectedHeader);const{payload:o,...a}=await n.sign(r.key,r.options);if(0===t)e.payload=o;else if(e.payload!==o)throw new T("inconsistent use of JWS Unencoded Payload (RFC7797)");e.signatures.push(a)}return e}}class pt{constructor(e){if(!te(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 this._payload="number"==typeof e?{...this._payload,nbf:e}:{...this._payload,nbf:et(new Date)+rt(e)},this}setExpirationTime(e){return this._payload="number"==typeof e?{...this._payload,exp:e}:{...this._payload,exp:et(new Date)+rt(e)},this}setIssuedAt(e){return this._payload=void 0===e?{...this._payload,iat:et(new Date)}:{...this._payload,iat:e},this}}class ft extends pt{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){var r;const n=new lt(c.encode(JSON.stringify(this._payload)));if(n.setProtectedHeader(this._protectedHeader),Array.isArray(null===(r=this._protectedHeader)||void 0===r?void 0:r.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new R("JWTs MUST NOT use unencoded payload");return n.sign(e,t)}}class ht extends pt{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 st(c.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)}}const yt=(e,t)=>{if("string"!=typeof e||!e)throw new k(`${t} missing or invalid`)};async function mt(e,t){if(!te(e))throw new TypeError("JWK must be an object");if(null!=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":yt(e.crv,'"crv" (Curve) Parameter'),yt(e.x,'"x" (X Coordinate) Parameter'),yt(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":yt(e.crv,'"crv" (Subtype of Key Pair) Parameter'),yt(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":yt(e.e,'"e" (Exponent) Parameter'),yt(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":yt(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new _('"kty" (Key Type) Parameter missing or unsupported')}const n=c.encode(JSON.stringify(r));return g(await s(t,n))}async function gt(e,t){null!=t||(t="sha256");const r=await mt(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${r}`}async function wt(e,t){const r={...e,...null==t?void 0:t.header};if(!te(r.jwk))throw new T('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const n=await ke({...r.jwk,ext:!0},r.alg,!0);if(n instanceof Uint8Array||"public"!==n.type)throw new T('"jwk" (JSON Web Key) Header Parameter must be a public key');return n}function bt(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(Et)}function Et(e){return te(e)}class vt{constructor(e){if(this._cached=new WeakMap,!bt(e))throw new H("JSON Web Key Set malformed");var t;this._jwks=(t=e,"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)))}async getKey(e,t){const{alg:r,kid:n}={...e,...null==t?void 0: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 _('Unsupported "alg" value for a JSON Web Key Set')}}(r),a=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:i,length:s}=a;if(0===s)throw new I;if(1!==s){const e=new x,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of a)try{yield await St(t,e,r)}catch(e){continue}},e}return St(this._cached,i,r)}}async function St(e,t,r){const n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){const e=await ke({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new H("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}function At(e){const t=new vt(e);return async function(e,r){return t.getKey(e,r)}}class _t extends vt{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0: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._jwks&&this.fresh()||await this.reload();try{return await super.getKey(e,t)}catch(r){if(r instanceof I&&!1===this.coolingDown())return await this.reload(),super.getKey(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),this._pendingFetch||(this._pendingFetch=(async(e,t,r)=>{let n,o,a=!1;"function"==typeof AbortController&&(n=new AbortController,o=setTimeout(()=>{a=!0,n.abort()},t));const i=await fetch(e.href,{signal:n?n.signal:void 0,redirect:"manual",headers:r.headers}).catch(e=>{if(a)throw new D;throw e});if(void 0!==o&&clearTimeout(o),200!==i.status)throw new E("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch(e){throw new E("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then(e=>{if(!bt(e))throw new H("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(e=>{throw this._pendingFetch=void 0,e})),await this._pendingFetch}}function Ot(e,t){const r=new _t(e,t);return async function(e,t){return r.getKey(e,t)}}class Ct extends pt{encode(){return`${g(JSON.stringify({alg:"none"}))}.${g(JSON.stringify(this._payload))}.`}static decode(e,t){if("string"!=typeof e)throw new R("Unsecured JWT must be a string");const{0:r,1:n,2:o,length:a}=e.split(".");if(3!==a||""!==o)throw new R("Invalid Unsecured JWT");let i;try{if(i=JSON.parse(l.decode(b(r))),"none"!==i.alg)throw new Error}catch(e){throw new R("Invalid Unsecured JWT")}return{payload:ot(i,b(n),t),header:i}}}const Pt=g,Tt=b;function Rt(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(l.decode(Tt(t)));if(!te(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}function kt(e){if("string"!=typeof e)throw new R("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:r}=e.split(".");if(5===r)throw new R("Only JWTs using Compact JWS serialization can be decoded");if(3!==r)throw new R("Invalid JWT");if(!t)throw new R("JWTs must contain a payload");let n,o;try{n=Tt(t)}catch(e){throw new R("Failed to base64url decode the payload")}try{o=JSON.parse(l.decode(n))}catch(e){throw new R("Failed to parse the decoded payload as JSON")}if(!te(o))throw new R("Invalid JWT Claims Set");return o}function Ht(e){var t;const r=null!==(t=null==e?void 0:e.modulusLength)&&void 0!==t?t:2048;if("number"!=typeof r||r<2048)throw new _("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return r}async function It(e,t){return async function(e,t){var r,n,o;let i,s;switch(e){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Ht(t)},s=["sign","verify"];break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Ht(t)},s=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:`SHA-${parseInt(e.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Ht(t)},s=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":i={name:"ECDSA",namedCurve:"P-256"},s=["sign","verify"];break;case"ES384":i={name:"ECDSA",namedCurve:"P-384"},s=["sign","verify"];break;case"ES512":i={name:"ECDSA",namedCurve:"P-521"},s=["sign","verify"];break;case"EdDSA":s=["sign","verify"];const o=null!==(r=null==t?void 0:t.crv)&&void 0!==r?r:"Ed25519";switch(o){case"Ed25519":case"Ed448":i={name:o};break;default:throw new _("Invalid or unsupported crv option provided")}break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{s=["deriveKey","deriveBits"];const e=null!==(n=null==t?void 0:t.crv)&&void 0!==n?n:"P-256";switch(e){case"P-256":case"P-384":case"P-521":i={name:"ECDH",namedCurve:e};break;case"X25519":case"X448":i={name:e};break;default:throw new _("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return a.subtle.generateKey(i,null!==(o=null==t?void 0:t.extractable)&&void 0!==o&&o,s)}(e,t)}async function xt(e,t){return async function(e,t){var r;let n,o,i;switch(e){case"HS256":case"HS384":case"HS512":n=parseInt(e.slice(-3),10),o={name:"HMAC",hash:`SHA-${n}`,length:n},i=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n=parseInt(e.slice(-3),10),K(new Uint8Array(n>>3));case"A128KW":case"A192KW":case"A256KW":n=parseInt(e.slice(1,4),10),o={name:"AES-KW",length:n},i=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(e.slice(1,4),10),o={name:"AES-GCM",length:n},i=["encrypt","decrypt"];break;default:throw new _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return a.subtle.generateKey(o,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,i)}(e,t)}const Dt="WebCryptoAPI"},5608:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__addDisposableResource:()=>L,__assign:()=>a,__asyncDelegator:()=>O,__asyncGenerator:()=>_,__asyncValues:()=>C,__await:()=>A,__awaiter:()=>h,__classPrivateFieldGet:()=>I,__classPrivateFieldIn:()=>D,__classPrivateFieldSet:()=>x,__createBinding:()=>m,__decorate:()=>s,__disposeResources:()=>j,__esDecorate:()=>l,__exportStar:()=>g,__extends:()=>o,__generator:()=>y,__importDefault:()=>H,__importStar:()=>k,__makeTemplateObject:()=>P,__metadata:()=>f,__param:()=>c,__propKey:()=>d,__read:()=>b,__rest:()=>i,__rewriteRelativeImportExtension:()=>N,__runInitializers:()=>u,__setFunctionName:()=>p,__spread:()=>E,__spreadArray:()=>S,__spreadArrays:()=>v,__values:()=>w,default:()=>M});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function i(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function s(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}function c(e,t){return function(r,n){t(r,n,e)}}function l(e,t,r,n,o,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=n.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,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");a.push(i(e||null))};var m=(0,r[f])("accessor"===c?{get:d.get,set:d.set}:d[l],h);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=i(m.get))&&(d.get=s),(s=i(m.set))&&(d.set=s),(s=i(m.init))&&o.unshift(s)}else(s=i(m))&&("field"===c?o.unshift(s):d[l]=s)}u&&Object.defineProperty(u,n.name,d),p=!0}function u(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}function d(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,s)}c((n=n.apply(e,t||[])).next())})}function y(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var m=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]};function g(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||m(t,e,r)}function w(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function E(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function v(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,o++)n[o]=a[i];return n}function S(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function A(e){return this instanceof A?(this.v=e,this):new A(e)}function _(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),i("next"),i("throw"),i("return",function(e){return function(t){return Promise.resolve(t).then(e,l)}}),n[Symbol.asyncIterator]=function(){return this},n;function i(e,t){o[e]&&(n[e]=function(t){return new Promise(function(r,n){a.push([e,t,r,n])>1||s(e,t)})},t&&(n[e]=t(n[e])))}function s(e,t){try{(r=o[e](t)).value instanceof A?Promise.resolve(r.value.v).then(c,l):u(a[0][2],r)}catch(e){u(a[0][3],e)}var r}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function O(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:A(e[n](t)),done:!1}:o?o(t):t}:o}}function C(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=w(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,o,(t=e[r](t)).done,t.value)})}}}function P(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var T=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},R=function(e){return R=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},R(e)};function k(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=R(e),n=0;n<r.length;n++)"default"!==r[n]&&m(t,e,r[n]);return T(t,e),t}function H(e){return e&&e.__esModule?e:{default:e}}function I(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)}function x(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}function D(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function L(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}var K="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function j(e){function t(t){e.error=e.hasError?new K(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function o(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(a).then(o,function(e){return t(e),o()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function N(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,r,n,o,a){return r?t?".jsx":".js":!n||o&&a?n+o+"."+a.toLowerCase()+"js":e}):e}const M={__extends:o,__assign:a,__rest:i,__decorate:s,__param:c,__esDecorate:l,__runInitializers:u,__propKey:d,__setFunctionName:p,__metadata:f,__awaiter:h,__generator:y,__createBinding:m,__exportStar:g,__values:w,__read:b,__spread:E,__spreadArrays:v,__spreadArray:S,__await:A,__asyncGenerator:_,__asyncDelegator:O,__asyncValues:C,__makeTemplateObject:P,__importStar:k,__importDefault:H,__classPrivateFieldGet:I,__classPrivateFieldSet:x,__classPrivateFieldIn:D,__addDisposableResource:L,__disposeResources:j,__rewriteRelativeImportExtension:N}},6634:function(e){e.exports=function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}return function t(r,n){function o(t,o,a){if("undefined"!=typeof document){"number"==typeof(a=e({},n,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var s in a)a[s]&&(i+="; "+s,!0!==a[s]&&(i+="="+a[s].split(";")[0]));return document.cookie=t+"="+r.write(o,t)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],n={},o=0;o<t.length;o++){var a=t[o].split("="),i=a.slice(1).join("=");try{var s=decodeURIComponent(a[0]);if(n[s]=r.read(i,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(t,r){o(t,"",e({},r,{expires:-1}))},withAttributes:function(r){return t(this.converter,e({},this.attributes,r))},withConverter:function(r){return t(e({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(r)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()},7764:(e,t,r)=>{"use strict";function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:i,toStringTag:s}=Symbol,c=(l=Object.create(null),e=>{const t=o.call(e);return l[t]||(l[t]=t.slice(8,-1).toLowerCase())});var l;const u=e=>(e=e.toLowerCase(),t=>c(t)===e),d=e=>t=>typeof t===e,{isArray:p}=Array,f=d("undefined");function h(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y=u("ArrayBuffer"),m=d("string"),g=d("function"),w=d("number"),b=e=>null!==e&&"object"==typeof e,E=e=>{if("object"!==c(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||s in e||i in e)},v=u("Date"),S=u("File"),A=u("Blob"),_=u("FileList"),O=u("URLSearchParams"),[C,P,T,R]=["ReadableStream","Request","Response","Headers"].map(u);function k(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),p(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(h(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(n=0;n<a;n++)i=o[n],t.call(null,e[i],i,e)}}function H(e,t){if(h(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,x=e=>!f(e)&&e!==I,D=(L="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>L&&e instanceof L);var L;const K=u("HTMLFormElement"),j=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),N=u("RegExp"),M=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};k(r,(r,o)=>{let a;!1!==(a=t(r,o,e))&&(n[o]=a||r)}),Object.defineProperties(e,n)},W=u("AsyncFunction"),U=(J="function"==typeof setImmediate,B=g(I.postMessage),J?setImmediate:B?(F=`axios@${Math.random()}`,$=[],I.addEventListener("message",({source:e,data:t})=>{e===I&&t===F&&$.length&&$.shift()()},!1),e=>{$.push(e),I.postMessage(F,"*")}):e=>setTimeout(e));var J,B,F,$;const G="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):"undefined"!=typeof process&&process.nextTick||U;var z={isArray:p,isArrayBuffer:y,isBuffer:h,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=c(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:m,isNumber:w,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:E,isEmptyObject:e=>{if(!b(e)||h(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:C,isRequest:P,isResponse:T,isHeaders:R,isUndefined:f,isDate:v,isFile:S,isBlob:A,isRegExp:N,isFunction:g,isStream:e=>b(e)&&g(e.pipe),isURLSearchParams:O,isTypedArray:D,isFileList:_,forEach:k,merge:function e(){const{caseless:t,skipUndefined:r}=x(this)&&this||{},n={},o=(o,a)=>{const i=t&&H(n,a)||a;E(n[i])&&E(o)?n[i]=e(n[i],o):E(o)?n[i]=e({},o):p(o)?n[i]=o.slice():r&&f(o)||(n[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&k(arguments[e],o);return n},extend:(e,t,r,{allOwnKeys:o}={})=>(k(t,(t,o)=>{r&&g(t)?e[o]=n(t,r):e[o]=t},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,s;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&a(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:u,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!w(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[i]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:K,hasOwnProperty:j,hasOwnProp:j,reduceDescriptors:M,freezeMethods:e=>{M(e,(t,r)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];g(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return p(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:H,global:I,isContextDefined:x,isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[s]&&e[i])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(b(e)){if(t.indexOf(e)>=0)return;if(h(e))return e;if(!("toJSON"in e)){t[n]=e;const o=p(e)?[]:{};return k(e,(e,t)=>{const a=r(e,n+1);!f(a)&&(o[t]=a)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:W,isThenable:e=>e&&(b(e)||g(e))&&g(e.then)&&g(e.catch),setImmediate:U,asap:G,isIterable:e=>null!=e&&g(e[i])};function V(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}z.inherits(V,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.status}}});const q=V.prototype,X={};function Y(e){return z.isPlainObject(e)||z.isArray(e)}function Z(e){return z.endsWith(e,"[]")?e.slice(0,-2):e}function Q(e,t,r){return e?e.concat(t).map(function(e,t){return e=Z(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{X[e]={value:e}}),Object.defineProperties(V,X),Object.defineProperty(q,"isAxiosError",{value:!0}),V.from=(e,t,r,n,o,a)=>{const i=Object.create(q);z.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return V.call(i,s,c,r,n,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",a&&Object.assign(i,a),i};const ee=z.toFlatObject(z,{},null,function(e){return/^is[A-Z]/.test(e)});function te(e,t,r){if(!z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!z.isUndefined(t[e])})).metaTokens,o=r.visitor||l,a=r.dots,i=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&z.isSpecCompliantForm(t);if(!z.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(z.isDate(e))return e.toISOString();if(z.isBoolean(e))return e.toString();if(!s&&z.isBlob(e))throw new V("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(e)||z.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,o){let s=e;if(e&&!o&&"object"==typeof e)if(z.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(z.isArray(e)&&function(e){return z.isArray(e)&&!e.some(Y)}(e)||(z.isFileList(e)||z.endsWith(r,"[]"))&&(s=z.toArray(e)))return r=Z(r),s.forEach(function(e,n){!z.isUndefined(e)&&null!==e&&t.append(!0===i?Q([r],n,a):null===i?r:r+"[]",c(e))}),!1;return!!Y(e)||(t.append(Q(o,r,a),c(e)),!1)}const u=[],d=Object.assign(ee,{defaultVisitor:l,convertValue:c,isVisitable:Y});if(!z.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!z.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),z.forEach(r,function(r,a){!0===(!(z.isUndefined(r)||null===r)&&o.call(t,r,z.isString(a)?a.trim():a,n,d))&&e(r,n?n.concat(a):[a])}),u.pop()}}(e),t}function re(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ne(e,t){this._pairs=[],e&&te(e,this,t)}const oe=ne.prototype;function ae(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ie(e,t,r){if(!t)return e;const n=r&&r.encode||ae;z.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let a;if(a=o?o(t,r):z.isURLSearchParams(t)?t.toString():new ne(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,re)}:re;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var se=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){z.forEach(this.handlers,function(t){null!==t&&e(t)})}},ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},le={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ne,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ue="undefined"!=typeof window&&"undefined"!=typeof document,de="object"==typeof navigator&&navigator||void 0,pe=ue&&(!de||["ReactNative","NativeScript","NS"].indexOf(de.product)<0),fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,he=ue&&window.location.href||"http://localhost";var ye={...Object.freeze({__proto__:null,hasBrowserEnv:ue,hasStandardBrowserWebWorkerEnv:fe,hasStandardBrowserEnv:pe,navigator:de,origin:he}),...le};function me(e){function t(e,r,n,o){let a=e[o++];if("__proto__"===a)return!0;const i=Number.isFinite(+a),s=o>=e.length;return a=!a&&z.isArray(n)?n.length:a,s?(z.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!i):(n[a]&&z.isObject(n[a])||(n[a]=[]),t(e,r,n[a],o)&&z.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let a;for(n=0;n<o;n++)a=r[n],t[a]=e[a];return t}(n[a])),!i)}if(z.isFormData(e)&&z.isFunction(e.entries)){const r={};return z.forEachEntry(e,(e,n)=>{t(function(e){return z.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const ge={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=z.isObject(e);if(o&&z.isHTMLForm(e)&&(e=new FormData(e)),z.isFormData(e))return n?JSON.stringify(me(e)):e;if(z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)||z.isReadableStream(e))return e;if(z.isArrayBufferView(e))return e.buffer;if(z.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new ye.classes.URLSearchParams,{visitor:function(e,t,r,n){return ye.isNode&&z.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((a=z.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e){if(z.isString(e))try{return(0,JSON.parse)(e),z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ge.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(z.isResponse(e)||z.isReadableStream(e))return e;if(e&&z.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw V.from(e,V.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],e=>{ge.headers[e]={}});var we=ge;const be=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ee=Symbol("internals");function ve(e){return e&&String(e).trim().toLowerCase()}function Se(e){return!1===e||null==e?e:z.isArray(e)?e.map(Se):String(e)}function Ae(e,t,r,n,o){return z.isFunction(n)?n.call(this,t,r):(o&&(t=r),z.isString(t)?z.isString(n)?-1!==t.indexOf(n):z.isRegExp(n)?n.test(t):void 0:void 0)}class _e{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=ve(t);if(!o)throw new Error("header name must be a non-empty string");const a=z.findKey(n,o);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=Se(e))}const a=(e,t)=>z.forEach(e,(e,r)=>o(e,r,t));if(z.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(z.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&be[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(z.isObject(e)&&z.isIterable(e)){let r,n,o={};for(const t of e){if(!z.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?z.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=ve(e)){const r=z.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(z.isFunction(t))return t.call(this,e,r);if(z.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ve(e)){const r=z.findKey(this,e);return!(!r||void 0===this[r]||t&&!Ae(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=ve(e)){const o=z.findKey(r,e);!o||t&&!Ae(0,r[o],o,t)||(delete r[o],n=!0)}}return z.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!Ae(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return z.forEach(this,(n,o)=>{const a=z.findKey(r,o);if(a)return t[a]=Se(n),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(o):String(o).trim();i!==o&&delete t[o],t[i]=Se(n),r[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return z.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&z.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Ee]=this[Ee]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ve(e);t[n]||(function(e,t){const r=z.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})})}(r,e),t[n]=!0)}return z.isArray(e)?e.forEach(n):n(e),this}}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),z.reduceDescriptors(_e.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),z.freezeMethods(_e);var Oe=_e;function Ce(e,t){const r=this||we,n=t||r,o=Oe.from(n.headers);let a=n.data;return z.forEach(e,function(e){a=e.call(r,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function Pe(e){return!(!e||!e.__CANCEL__)}function Te(e,t,r){V.call(this,null==e?"canceled":e,V.ERR_CANCELED,t,r),this.name="CanceledError"}function Re(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new V("Request failed with status code "+r.status,[V.ERR_BAD_REQUEST,V.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}z.inherits(Te,V,{__CANCEL__:!0});const ke=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,a=0,i=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),l=n[i];o||(o=c),r[a]=s,n[a]=c;let u=i,d=0;for(;u!==a;)d+=r[u++],u%=e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(r,a){let i,s,c=0,l=1e3/a;const u=(r,a=Date.now())=>{c=a,i=null,s&&(clearTimeout(s),s=null),(r=>{const a=r.loaded,i=r.lengthComputable?r.total:void 0,s=a-n,c=o(s);n=a,e({loaded:a,total:i,progress:i?a/i:void 0,bytes:s,rate:c||void 0,estimated:c&&i&&a<=i?(i-a)/c:void 0,event:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})})(...r)};return[(...e)=>{const t=Date.now(),r=t-c;r>=l?u(e,t):(i=e,s||(s=setTimeout(()=>{s=null,u(i)},l-r)))},()=>i&&u(i)]}(0,r)},He=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ie=e=>(...t)=>z.asap(()=>e(...t));var xe=ye.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ye.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,De=ye.hasStandardBrowserEnv?{write(e,t,r,n,o,a){const i=[e+"="+encodeURIComponent(t)];z.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),z.isString(n)&&i.push("path="+n),z.isString(o)&&i.push("domain="+o),!0===a&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Le(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ke=e=>e instanceof Oe?{...e}:e;function je(e,t){t=t||{};const r={};function n(e,t,r,n){return z.isPlainObject(e)&&z.isPlainObject(t)?z.merge.call({caseless:n},e,t):z.isPlainObject(t)?z.merge({},t):z.isArray(t)?t.slice():t}function o(e,t,r,o){return z.isUndefined(t)?z.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function a(e,t){if(!z.isUndefined(t))return n(void 0,t)}function i(e,t){return z.isUndefined(t)?z.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,a){return a in t?n(r,o):a in e?n(void 0,r):void 0}const c={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(e,t,r)=>o(Ke(e),Ke(t),0,!0)};return z.forEach(Object.keys({...e,...t}),function(n){const a=c[n]||o,i=a(e[n],t[n],n);z.isUndefined(i)&&a!==s||(r[n]=i)}),r}var Ne=e=>{const t=je({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:a,headers:i,auth:s}=t;if(t.headers=i=Oe.from(i),t.url=ie(Le(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&i.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),z.isFormData(r))if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(z.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&i.set(e,r)})}if(ye.hasStandardBrowserEnv&&(n&&z.isFunction(n)&&(n=n(t)),n||!1!==n&&xe(t.url))){const e=o&&a&&De.read(a);e&&i.set(o,e)}return t},Me="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=Ne(e);let o=n.data;const a=Oe.from(n.headers).normalize();let i,s,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=n;function h(){l&&l(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let y=new XMLHttpRequest;function m(){if(!y)return;const n=Oe.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Re(function(e){t(e),h()},function(e){r(e),h()},{data:d&&"text"!==d&&"json"!==d?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:e,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(r(new V("Request aborted",V.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const n=new V(t&&t.message?t.message:"Network Error",V.ERR_NETWORK,e,y);n.event=t||null,r(n),y=null},y.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||ce;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new V(t,o.clarifyTimeoutError?V.ETIMEDOUT:V.ECONNABORTED,e,y)),y=null},void 0===o&&a.setContentType(null),"setRequestHeader"in y&&z.forEach(a.toJSON(),function(e,t){y.setRequestHeader(t,e)}),z.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),d&&"json"!==d&&(y.responseType=n.responseType),f&&([c,u]=ke(f,!0),y.addEventListener("progress",c)),p&&y.upload&&([s,l]=ke(p),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(i=t=>{y&&(r(!t||t.type?new Te(null,e,y):t),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===ye.protocols.indexOf(g)?r(new V("Unsupported protocol "+g+":",V.ERR_BAD_REQUEST,e)):y.send(o||null)})},We=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof V?t:new Te(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,o(new V(`timeout ${t} of ms exceeded`,V.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=n;return s.unsubscribe=()=>z.asap(i),s}};const Ue=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},Je=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*Ue(r,t)}(e,t);let a,i=0,s=e=>{a||(a=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return s(),void e.close();let a=n.byteLength;if(r){let e=i+=a;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:Be}=z,Fe=(({Request:e,Response:t})=>({Request:e,Response:t}))(z.global),{ReadableStream:$e,TextEncoder:Ge}=z.global,ze=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ve=e=>{e=z.merge.call({skipUndefined:!0},Fe,e);const{fetch:t,Request:r,Response:n}=e,o=t?Be(t):"function"==typeof fetch,a=Be(r),i=Be(n);if(!o)return!1;const s=o&&Be($e),c=o&&("function"==typeof Ge?(l=new Ge,e=>l.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var l;const u=a&&s&&ze(()=>{let e=!1;const t=new r(ye.origin,{body:new $e,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=i&&s&&ze(()=>z.isReadableStream(new n("").body)),p={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new V(`Response type '${e}' is not supported`,V.ERR_NOT_SUPPORT,r)})});return async e=>{let{url:o,method:i,data:s,signal:l,cancelToken:f,timeout:h,onDownloadProgress:y,onUploadProgress:m,responseType:g,headers:w,withCredentials:b="same-origin",fetchOptions:E}=Ne(e),v=t||fetch;g=g?(g+"").toLowerCase():"text";let S=We([l,f&&f.toAbortSignal()],h),A=null;const _=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let O;try{if(m&&u&&"get"!==i&&"head"!==i&&0!==(O=await(async(e,t)=>{const n=z.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(z.isBlob(e))return e.size;if(z.isSpecCompliantForm(e)){const t=new r(ye.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return z.isArrayBufferView(e)||z.isArrayBuffer(e)?e.byteLength:(z.isURLSearchParams(e)&&(e+=""),z.isString(e)?(await c(e)).byteLength:void 0)})(t):n})(w,s))){let e,t=new r(o,{method:"POST",body:s,duplex:"half"});if(z.isFormData(s)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,r]=He(O,ke(Ie(m)));s=Je(t.body,65536,e,r)}}z.isString(b)||(b=b?"include":"omit");const t=a&&"credentials"in r.prototype,l={...E,signal:S,method:i.toUpperCase(),headers:w.normalize().toJSON(),body:s,duplex:"half",credentials:t?b:void 0};A=a&&new r(o,l);let f=await(a?v(A,E):v(o,l));const h=d&&("stream"===g||"response"===g);if(d&&(y||h&&_)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=f[t]});const t=z.toFiniteNumber(f.headers.get("content-length")),[r,o]=y&&He(t,ke(Ie(y),!0))||[];f=new n(Je(f.body,65536,r,()=>{o&&o(),_&&_()}),e)}g=g||"text";let C=await p[z.findKey(p,g)||"text"](f,e);return!h&&_&&_(),await new Promise((t,r)=>{Re(t,r,{data:C,headers:Oe.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:A})})}catch(t){if(_&&_(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new V("Network Error",V.ERR_NETWORK,e,A),{cause:t.cause||t});throw V.from(t,t&&t.code,e,A)}}},qe=new Map,Xe=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:o}=t,a=[n,o,r];let i,s,c=a.length,l=qe;for(;c--;)i=a[c],s=l.get(i),void 0===s&&l.set(i,s=c?new Map:Ve(t)),l=s;return s};Xe();const Ye={http:null,xhr:Me,fetch:{get:Xe}};z.forEach(Ye,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Ze=e=>`- ${e}`,Qe=e=>z.isFunction(e)||null===e||!1===e;var et=(e,t)=>{e=z.isArray(e)?e:[e];const{length:r}=e;let n,o;const a={};for(let i=0;i<r;i++){let r;if(n=e[i],o=n,!Qe(n)&&(o=Ye[(r=String(n)).toLowerCase()],void 0===o))throw new V(`Unknown adapter '${r}'`);if(o&&(z.isFunction(o)||(o=o.get(t))))break;a[r||"#"+i]=o}if(!o){const e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new V("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(Ze).join("\n"):" "+Ze(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function tt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Te(null,e)}function rt(e){return tt(e),e.headers=Oe.from(e.headers),e.data=Ce.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),et(e.adapter||we.adapter,e)(e).then(function(t){return tt(e),t.data=Ce.call(e,e.transformResponse,t),t.headers=Oe.from(t.headers),t},function(t){return Pe(t)||(tt(e),t&&t.response&&(t.response.data=Ce.call(e,e.transformResponse,t.response),t.response.headers=Oe.from(t.response.headers))),Promise.reject(t)})}const nt="1.12.2",ot={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ot[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const at={};ot.transitional=function(e,t,r){function n(e,t){return"[Axios v"+nt+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,a)=>{if(!1===e)throw new V(n(o," has been removed"+(t?" in "+t:"")),V.ERR_DEPRECATED);return t&&!at[o]&&(at[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,a)}},ot.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var it={assertOptions:function(e,t,r){if("object"!=typeof e)throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const a=n[o],i=t[a];if(i){const t=e[a],r=void 0===t||i(t,a,e);if(!0!==r)throw new V("option "+a+" must be "+r,V.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new V("Unknown option "+a,V.ERR_BAD_OPTION)}},validators:ot};const st=it.validators;class ct{constructor(e){this.defaults=e||{},this.interceptors={request:new se,response:new se}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=je(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&it.assertOptions(r,{silentJSONParsing:st.transitional(st.boolean),forcedJSONParsing:st.transitional(st.boolean),clarifyTimeoutError:st.transitional(st.boolean)},!1),null!=n&&(z.isFunction(n)?t.paramsSerializer={serialize:n}:it.assertOptions(n,{encode:st.function,serialize:st.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),it.assertOptions(t,{baseUrl:st.spelling("baseURL"),withXsrfToken:st.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&z.merge(o.common,o[t.method]);o&&z.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Oe.concat(a,o);const i=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!s){const e=[rt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let p=t;for(;d<u;){const e=i[d++],t=i[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=rt.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return ie(Le((e=je(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}z.forEach(["delete","get","head","options"],function(e){ct.prototype[e]=function(t,r){return this.request(je(r||{},{method:e,url:t,data:(r||{}).data}))}}),z.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,o){return this.request(je(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ct.prototype[e]=t(),ct.prototype[e+"Form"]=t(!0)});var lt=ct;class ut{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new Te(e,n,o),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ut(function(t){e=t}),cancel:e}}}var dt=ut;const pt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pt).forEach(([e,t])=>{pt[t]=e});var ft=pt;const ht=function e(t){const r=new lt(t),o=n(lt.prototype.request,r);return z.extend(o,lt.prototype,r,{allOwnKeys:!0}),z.extend(o,r,null,{allOwnKeys:!0}),o.create=function(r){return e(je(t,r))},o}(we);ht.Axios=lt,ht.CanceledError=Te,ht.CancelToken=dt,ht.isCancel=Pe,ht.VERSION=nt,ht.toFormData=te,ht.AxiosError=V,ht.Cancel=ht.CanceledError,ht.all=function(e){return Promise.all(e)},ht.spread=function(e){return function(t){return e.apply(null,t)}},ht.isAxiosError=function(e){return z.isObject(e)&&!0===e.isAxiosError},ht.mergeConfig=je,ht.AxiosHeaders=Oe,ht.formToJSON=e=>me(z.isHTMLForm(e)?new FormData(e):e),ht.getAdapter=et,ht.HttpStatusCode=ft,ht.default=ht,e.exports=ht},7792:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c,useDeepCompareEffectNoCheck:()=>l,useDeepCompareMemoize:()=>s});var n=r(9155),o=Object.prototype.hasOwnProperty;function a(e,t,r){for(r of e.keys())if(i(r,t))return r}function i(e,t){var r,n,s;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&i(e[n],t[n]););return-1===n}if(r===Set){if(e.size!==t.size)return!1;for(n of e){if((s=n)&&"object"==typeof s&&!(s=a(t,s)))return!1;if(!t.has(s))return!1}return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e){if((s=n[0])&&"object"==typeof s&&!(s=a(t,s)))return!1;if(!i(n[1],t.get(s)))return!1}return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return-1===n}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}if(!r||"object"==typeof e){for(r in n=0,e){if(o.call(e,r)&&++n&&!o.call(t,r))return!1;if(!(r in t)||!i(e[r],t[r]))return!1}return Object.keys(t).length===n}}return e!=e&&t!=t}function s(e){var t=n.useRef(e),r=n.useRef(0);return i(e,t.current)||(t.current=e,r.current+=1),n.useMemo(function(){return t.current},[r.current])}function c(e,t){return n.useEffect(e,s(t))}function l(e,t){return n.useEffect(e,s(t))}},8792:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!==o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!==o--;){var i=a[o];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r}},9358:e=>{e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t),r.d(t,"validateHTMLColorName",function(){return i}),r.d(t,"validateHTMLColorSpecialName",function(){return s}),r.d(t,"validateHTMLColorHex",function(){return c}),r.d(t,"validateHTMLColorRgb",function(){return y}),r.d(t,"validateHTMLColorHsl",function(){return m}),r.d(t,"validateHTMLColorHwb",function(){return g}),r.d(t,"validateHTMLColorLab",function(){return w}),r.d(t,"validateHTMLColorLch",function(){return b}),r.d(t,"validateHTMLColor",function(){return E});const n=e=>e&&"string"==typeof e,o=["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenrod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","Goldenrod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenrodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquamarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenrod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],a=["currentColor","inherit","transparent"],i=e=>{let t=!1;return n(e)&&o.map(r=>(e.toLowerCase()===r.toLowerCase()&&(t=!0),null)),t},s=e=>{let t=!1;return n(e)&&a.map(r=>(e.toLowerCase()===r.toLowerCase()&&(t=!0),null)),t},c=e=>!!n(e)&&(e&&/^#([\da-f]{3}){1,2}$|^#([\da-f]{4}){1,2}$/i.test(e)),l="(([\\d]{0,5})((\\.([\\d]{1,5}))?))",u=`(${l}%)`,d="(([0-9]|[1-9][0-9]|100)%)",p=`(${d}|(0?((\\.([\\d]{1,5}))?))|1)`,f=`([\\s]{0,5})\\)?)(([\\s]{0,5})(\\/?)([\\s]{1,5})(((${d}))|(0?((\\.([\\d]{1,5}))?))|1))?([\\s]{0,5})\\)`,h="(-?(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9])((\\.([\\d]{1,5}))?)|360)(deg)?)",y=e=>{if(n(e)){const t="([\\s]{0,5})([\\d]{1,5})%?([\\s]{0,5}),?",r="((([\\s]{0,5}),?([\\s]{0,5}))|(([\\s]{1,5})))",n=new RegExp(`^(rgb)a?\\(${t}${r}${t}${r}${t}${r}((\\/?([\\s]{0,5})(0?\\.?([\\d]{1,5})%?([\\s]{0,5}))?|1|0))?\\)$`);return e&&n.test(e)}return!1},m=e=>{if(n(e)){const t=new RegExp(`^(hsl)a?\\((([\\s]{0,5})(${h}|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-9][0-9]|400)grad)|((([0-5])?\\.([\\d]{1,5})|6\\.([0-9]|1[0-9]|2[0-8])|[0-6])rad)|((0?((\\.([\\d]{1,5}))?)|1)turn))((([\\s]{0,5}),([\\s]{0,5}))|(([\\s]{1,5}))))(([\\s]{0,5})(0|${d})((([\\s]{0,5}),([\\s]{0,5}))|(([\\s]{1,5}))))(([\\s]{0,5})(0|${d})([\\s]{0,5})\\)?)(([\\s]{0,5})(\\/?|,?)([\\s]{0,5})(((${d}))|(0?((\\.([\\d]{1,5}))?))|1))?\\)$`);return e&&t.test(e)}return!1},g=e=>{if(n(e)){const t=new RegExp(`^(hwb\\(([\\s]{0,5})${h}([\\s]{1,5}))((0|${d})([\\s]{1,5}))((0|${d})${f}$`);return e&&t.test(e)}return!1},w=e=>{if(n(e)){const t="(-?(([0-9]|[1-9][0-9]|1[0-5][0-9])((\\.([\\d]{1,5}))?)?|160))",r=new RegExp(`^(lab\\(([\\s]{0,5})${u}([\\s]{1,5})${t}([\\s]{1,5})${t}${f}$`);return e&&r.test(e)}return!1},b=e=>{if(n(e)){const t=new RegExp(`^lch\\((([\\s]{0,5})((([0-9]|[1-9][0-9])?((\\.([\\d]{1,5}))?)|100)(%)?)([\\s]{1,5})${""+l}([\\s]{1,5})((${h})|(0|${p})|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9])((\\.([\\d]{1,5}))?)|360))([\\s]{0,5})((\\/([\\s]{0,5})${p}))?)\\)$`);return e&&t.test(e)}return!1},E=e=>!!(e&&c(e)||y(e)||m(e)||g(e)||w(e)||b(e));t.default=e=>!!(e&&c(e)||i(e)||s(e)||y(e)||m(e)||g(e)||w(e)||b(e))}])}}]);
2
+ (self.webpackChunkSelfCommunityReactCore=self.webpackChunkSelfCommunityReactCore||[]).push([[18],{4246:function(e,t,r){!function(e,t,r,n){"use strict";const o="1.6.1";function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function i(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,s)}c((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const s={NOT_LOADED:"NOT_LOADED",LOADING:"LOADING",LOADED:"LOADED",FAILED:"FAILED",AUTH_FAILURE:"AUTH_FAILURE"};class c{static load(e,t){return i(this,void 0,void 0,function*(){var r,n;const o=e.libraries?e.libraries.split(","):[],a=this.serializeParams(e);this.listeners.push(t),(null===(n=null===(r=window.google)||void 0===r?void 0:r.maps)||void 0===n?void 0:n.importLibrary)?(this.serializedApiParams||(this.loadingStatus=s.LOADED),this.notifyLoadingStatusListeners()):(this.serializedApiParams=a,this.initImportLibrary(e)),this.serializedApiParams&&this.serializedApiParams!==a&&console.warn("[google-maps-api-loader] The maps API has already been loaded with different parameters and will not be loaded again. Refresh the page for new values to have effect.");const i=["maps",...o];yield Promise.all(i.map(e=>google.maps.importLibrary(e)))})}static serializeParams(e){return[e.v,e.key,e.language,e.region,e.authReferrerPolicy,e.solutionChannel].join("/")}static initImportLibrary(e){if(window.google||(window.google={}),window.google.maps||(window.google.maps={}),window.google.maps.importLibrary)return void console.error("[google-maps-api-loader-internal]: initImportLibrary must only be called once");let t=null;const r=()=>t||(t=new Promise((t,r)=>{var n;const o=document.createElement("script"),a=new URLSearchParams;for(const[t,r]of Object.entries(e)){const e=t.replace(/[A-Z]/g,e=>"_"+e[0].toLowerCase());a.set(e,String(r))}a.set("loading","async"),a.set("callback","__googleMapsCallback__"),o.async=!0,o.src="https://maps.googleapis.com/maps/api/js?"+a.toString(),o.nonce=(null===(n=document.querySelector("script[nonce]"))||void 0===n?void 0:n.nonce)||"",o.onerror=()=>{this.loadingStatus=s.FAILED,this.notifyLoadingStatusListeners(),r(new Error("The Google Maps JavaScript API could not load."))},window.__googleMapsCallback__=()=>{this.loadingStatus=s.LOADED,this.notifyLoadingStatusListeners(),t()},window.gm_authFailure=()=>{this.loadingStatus=s.AUTH_FAILURE,this.notifyLoadingStatusListeners()},this.loadingStatus=s.LOADING,this.notifyLoadingStatusListeners(),document.head.append(o)}),t);google.maps.importLibrary=e=>r().then(()=>google.maps.importLibrary(e))}static notifyLoadingStatusListeners(){for(const e of this.listeners)e(this.loadingStatus)}}c.loadingStatus=s.NOT_LOADED,c.listeners=[];const l=[`gmp_visgl_reactgooglemaps_v${o}`],u=t.createContext(null);function d(e,t,r){var n;const o={type:e,map:t,detail:{},stoppable:!1,stop:()=>{}};if(f.includes(e)){const e=o,r=t.getCenter(),n=t.getZoom(),a=t.getHeading()||0,i=t.getTilt()||0,s=t.getBounds();return r&&s&&Number.isFinite(n)||console.warn("[createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),e.detail={center:(null==r?void 0:r.toJSON())||{lat:0,lng:0},zoom:n||0,heading:a,tilt:i,bounds:(null==s?void 0:s.toJSON())||{north:90,east:180,south:-90,west:-180}},e}if(h.includes(e)){if(!r)throw new Error("[createEvent] mouse events must provide a srcEvent");const e=o;return e.domEvent=r.domEvent,e.stoppable=!0,e.stop=()=>r.stop(),e.detail={latLng:(null===(n=r.latLng)||void 0===n?void 0:n.toJSON())||null,placeId:r.placeId},e}return o}const p={onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onContextmenu:"contextmenu",onDblclick:"dblclick",onDrag:"drag",onDragend:"dragend",onDragstart:"dragstart",onHeadingChanged:"heading_changed",onIdle:"idle",onIsFractionalZoomEnabledChanged:"isfractionalzoomenabled_changed",onMapCapabilitiesChanged:"mapcapabilities_changed",onMapTypeIdChanged:"maptypeid_changed",onMousemove:"mousemove",onMouseout:"mouseout",onMouseover:"mouseover",onProjectionChanged:"projection_changed",onRenderingTypeChanged:"renderingtype_changed",onTilesLoaded:"tilesloaded",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed",onCameraChanged:"bounds_changed"},f=["bounds_changed","center_changed","heading_changed","tilt_changed","zoom_changed"],h=["click","contextmenu","dblclick","mousemove","mouseout","mouseover"],y=Object.keys(p);function m(e,r){const n=function(e){const r=t.useRef(void 0);return t.useEffect(()=>{r.current=e}),r.current}(e);return t.useMemo(()=>n&&r(n,e)?n:e,[e,n,r])}function g(e,r){!function(e,r,n){t.useEffect(e,[m(r,n)])}(e,r,n)}const w=new Set(["backgroundColor","clickableIcons","controlSize","disableDefaultUI","disableDoubleClickZoom","draggable","draggableCursor","draggingCursor","fullscreenControl","fullscreenControlOptions","gestureHandling","headingInteractionEnabled","isFractionalZoomEnabled","keyboardShortcuts","mapTypeControl","mapTypeControlOptions","mapTypeId","maxZoom","minZoom","noClear","panControl","panControlOptions","restriction","rotateControl","rotateControlOptions","scaleControl","scaleControlOptions","scrollwheel","streetView","streetViewControl","streetViewControlOptions","styles","tiltInteractionEnabled","zoomControl","zoomControlOptions"]);function b(){var e;return(null===(e=t.useContext(u))||void 0===e?void 0:e.status)||s.NOT_LOADED}function E(e){return!(!e||"object"!=typeof e)&&"lat"in e&&"lng"in e&&Number.isFinite(e.lat)&&Number.isFinite(e.lng)}function v(e){return E(e)?e:e.toJSON()}const S=()=>t.createElement("div",{style:{position:"absolute",top:0,left:0,bottom:0,right:0,zIndex:999,display:"flex",flexFlow:"column nowrap",textAlign:"center",justifyContent:"center",fontSize:".8rem",color:"rgba(0,0,0,0.6)",background:"#dddddd",padding:"1rem 1.5rem"}},t.createElement("h2",null,"Error: AuthFailure"),t.createElement("p",null,"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the ",t.createElement("code",null,"APIProvider.apiKey")," prop is correct. Check the error-message in the console for further details."));function A(){return b()===s.LOADED}function _(e){const r=function(){const[,e]=t.useReducer(e=>e+1,0);return e}(),n=t.useRef({center:{lat:0,lng:0},heading:0,tilt:0,zoom:0});return t.useEffect(()=>{if(!e)return;const t=google.maps.event.addListener(e,"bounds_changed",()=>{(function(e,t){const r=e.getCenter(),n=e.getZoom(),o=e.getHeading()||0,a=e.getTilt()||0,i=e.getBounds();r&&i&&Number.isFinite(n)||console.warn("[useTrackedCameraState] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),Object.assign(t.current,{center:(null==r?void 0:r.toJSON())||{lat:0,lng:0},zoom:n||0,heading:o,tilt:a})})(e,n),r()});return()=>t.remove()},[e,r]),n}class O{static has(e){return this.entries[e]&&this.entries[e].length>0}static pop(e){return this.entries[e]&&this.entries[e].pop()||null}static push(e,t){this.entries[e]||(this.entries[e]=[]),this.entries[e].push(t)}}function C(e,r){const n=A(),[o,i]=t.useState(null),[s,c]=function(){const[e,r]=t.useState(null);return[e,t.useCallback(e=>r(e),[r])]}(),l=_(o),{id:u,defaultBounds:d,defaultCenter:p,defaultZoom:f,defaultHeading:h,defaultTilt:y,reuseMaps:m,renderingType:g,colorScheme:w}=e,b=a(e,["id","defaultBounds","defaultCenter","defaultZoom","defaultHeading","defaultTilt","reuseMaps","renderingType","colorScheme"]),E=void 0!==e.zoom||void 0!==e.defaultZoom,v=void 0!==e.center||void 0!==e.defaultCenter;d||E&&v||console.warn("<Map> component is missing configuration. You have to provide zoom and center (via the `zoom`/`defaultZoom` and `center`/`defaultCenter` props) or specify the region to show using `defaultBounds`. See https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required"),!b.center&&p&&(b.center=p),!b.zoom&&Number.isFinite(f)&&(b.zoom=f),!b.heading&&Number.isFinite(h)&&(b.heading=h),!b.tilt&&Number.isFinite(y)&&(b.tilt=y);const S=b.internalUsageAttributionIds;b.internalUsageAttributionIds=null==S?r.internalUsageAttributionIds:[...r.internalUsageAttributionIds||[],...S];for(const e of Object.keys(b))void 0===b[e]&&delete b[e];const C=t.useRef(void 0);return t.useEffect(()=>{if(!s||!n)return;const{addMapInstance:t,removeMapInstance:o}=r,{mapId:c}=e,p=`${c||"default"}:${g||"default"}:${w||"LIGHT"}`;let f,h;if(m&&O.has(p)?(h=O.pop(p),f=h.getDiv(),s.appendChild(f),h.setOptions(b),setTimeout(()=>h.setCenter(h.getCenter()),0)):(f=document.createElement("div"),f.style.height="100%",s.appendChild(f),h=new google.maps.Map(f,Object.assign(Object.assign(Object.assign({},b),g?{renderingType:g}:{}),w?{colorScheme:w}:{}))),i(h),t(h,u),d){const{padding:e}=d,t=a(d,["padding"]);h.fitBounds(t,e)}else E&&v||h.fitBounds({east:180,west:-180,south:-90,north:90});if(C.current){const{mapId:e,cameraState:t}=C.current;e!==c&&h.setOptions(t)}return()=>{C.current={mapId:c,cameraState:l.current},f.remove(),m?O.push(p,h):google.maps.event.clearInstanceListeners(h),i(null),o(u)}},[s,n,u,e.mapId,e.renderingType,e.colorScheme]),[o,c,l]}O.entries={};const P=t.createContext(null),T=e=>{const{children:r,id:n,className:o,style:a}=e,i=t.useContext(u),c=b();if(!i)throw new Error("<Map> can only be used inside an <ApiProvider> component.");const[l,f,h]=C(e,i);(function(e,r,n){const o=n.center?v(n.center):null;let a=null,i=null;o&&Number.isFinite(o.lat)&&Number.isFinite(o.lng)&&(a=o.lat,i=o.lng);const s=Number.isFinite(n.zoom)?n.zoom:null,c=Number.isFinite(n.heading)?n.heading:null,l=Number.isFinite(n.tilt)?n.tilt:null;t.useLayoutEffect(()=>{if(!e)return;const t={};let n=!1;null===a||null===i||r.current.center.lat===a&&r.current.center.lng===i||(t.center={lat:a,lng:i},n=!0),null!==s&&r.current.zoom!==s&&(t.zoom=s,n=!0),null!==c&&r.current.heading!==c&&(t.heading=c,n=!0),null!==l&&r.current.tilt!==l&&(t.tilt=l,n=!0),n&&e.moveCamera(t)})})(l,h,e),function(e,r){for(const n of y){const o=r[n],a=p[n];t.useEffect(()=>{if(!e)return;if(!o)return;const t=google.maps.event.addListener(e,a,t=>{o(d(a,e,t))});return()=>t.remove()},[e,a,o])}}(l,e),function(e,t){const r={},n=Object.keys(t);for(const e of n)w.has(e)&&(r[e]=t[e]);g(()=>{e&&e.setOptions(r)},[r])}(l,e);const m=function(e,r){const{viewport:n,viewState:o}=r,a=!!n;return t.useLayoutEffect(()=>{if(!e||!o)return;const{latitude:t,longitude:r,bearing:n,pitch:a,zoom:i}=o;e.moveCamera({center:{lat:t,lng:r},heading:n,tilt:a,zoom:i+1})},[e,o]),a}(l,e),E=!!e.controlled;t.useEffect(()=>{if(l)return m&&l.setOptions({disableDefaultUI:!0}),(m||E)&&l.setOptions({gestureHandling:"none",keyboardShortcuts:!1}),()=>{l.setOptions({gestureHandling:e.gestureHandling,keyboardShortcuts:e.keyboardShortcuts})}},[l,m,E,e.gestureHandling,e.keyboardShortcuts]);const A=e.center?v(e.center):null;let _=null,O=null;A&&Number.isFinite(A.lat)&&Number.isFinite(A.lng)&&(_=A.lat,O=A.lng);const T=t.useMemo(()=>{var t,r,n;return{center:{lat:null!=_?_:0,lng:null!=O?O:0},zoom:null!==(t=e.zoom)&&void 0!==t?t:0,heading:null!==(r=e.heading)&&void 0!==r?r:0,tilt:null!==(n=e.tilt)&&void 0!==n?n:0}},[_,O,e.zoom,e.heading,e.tilt]);t.useLayoutEffect(()=>{if(!l||!E)return;l.moveCamera(T);const e=l.addListener("bounds_changed",()=>{l.moveCamera(T)});return()=>e.remove()},[l,E,T]);const R=t.useMemo(()=>Object.assign({width:"100%",height:"100%",position:"relative",zIndex:m?-1:0},a),[a,m]),k=t.useMemo(()=>({map:l}),[l]);return c===s.AUTH_FAILURE?t.createElement("div",{style:Object.assign({position:"relative"},o?{}:R),className:o},t.createElement(S,null)):t.createElement("div",Object.assign({ref:f,"data-testid":"map",style:o?void 0:R,className:o},n?{id:n}:{}),l?t.createElement(P.Provider,{value:k},r):null)};T.deckGLViewProps=!0;const R=new Set;function k(...e){const t=JSON.stringify(e);R.has(t)||(R.add(t),console.error(...e))}const H=(e=null)=>{const r=t.useContext(u),{map:n}=t.useContext(P)||{};if(null===r)return k("useMap(): failed to retrieve APIProviderContext. Make sure that the <APIProvider> component exists and that the component you are calling `useMap()` from is a sibling of the <APIProvider>."),null;const{mapInstances:o}=r;return null!==e?o[e]||null:n||o.default||null};function I(e){const r=A(),n=t.useContext(u);return t.useEffect(()=>{r&&n&&n.importLibrary(e)},[r,n,e]),(null==n?void 0:n.loadedLibraries[e])||null}function x(e,r,n){t.useEffect(()=>{if(!e||!r||!n)return;const t=google.maps.event.addListener(e,r,n);return()=>t.remove()},[e,r,n])}function D(e,r,n){t.useEffect(()=>{e&&(e[r]=n)},[e,r,n])}function L(e,r,n){t.useEffect(()=>{if(e&&r&&n)return e.addEventListener(r,n),()=>e.removeEventListener(r,n)},[e,r,n])}const K=new class{constructor(){this.renderedStyles=new Set,this.styleElement=null}getStyleElement(){return this.styleElement||(this.styleElement=document.createElement("style"),this.styleElement.setAttribute("data-rgm-anchor-styles",""),document.head.appendChild(this.styleElement)),this.styleElement}addAdvancedMarkerPointerEventsOverwrite(){this.renderedStyles.has("marker-pointer-events")||(this.getStyleElement().textContent+="\n gmp-advanced-marker[data-origin='rgm'] {\n pointer-events: none !important;\n }\n ",this.renderedStyles.add("marker-pointer-events"))}cleanup(){this.styleElement&&(this.styleElement.remove(),this.styleElement=null,this.renderedStyles.clear())}};const j=t.createContext(null),N={TOP_LEFT:["0%","0%"],TOP_CENTER:["50%","0%"],TOP:["50%","0%"],TOP_RIGHT:["100%","0%"],LEFT_CENTER:["0%","50%"],LEFT_TOP:["0%","0%"],LEFT:["0%","50%"],LEFT_BOTTOM:["0%","100%"],RIGHT_TOP:["100%","0%"],RIGHT:["100%","50%"],RIGHT_CENTER:["100%","50%"],RIGHT_BOTTOM:["100%","100%"],BOTTOM_LEFT:["0%","100%"],BOTTOM_CENTER:["50%","100%"],BOTTOM:["50%","100%"],BOTTOM_RIGHT:["100%","100%"],CENTER:["50%","50%"]},M=t.forwardRef((e,n)=>{const{children:o,style:a,className:i,anchorPoint:s}=e,[c,l]=function(e){const[r,n]=t.useState(null),[o,a]=t.useState(null),i=H(),s=I("marker"),{children:c,onClick:l,className:u,onMouseEnter:d,onMouseLeave:p,onDrag:f,onDragStart:h,onDragEnd:y,collisionBehavior:m,clickable:g,draggable:w,position:b,title:E,zIndex:v,anchorPoint:S,anchorLeft:A,anchorTop:_}=e,O=t.Children.count(c);return t.useEffect(()=>{if(!i||!s)return;const e=new s.AdvancedMarkerElement;e.map=i,n(e);let t=null;return O>0&&(t=document.createElement("div"),e.content=t,a(t)),()=>{e.map=null,null==t||t.remove(),n(null),a(null)}},[i,s,O]),t.useEffect(()=>{!(null==r?void 0:r.content)||!W(r.content)||O>0||(r.content.className=null!=u?u:"")},[r,u,O]),function(e,r,n,o,a){t.useEffect(()=>{if(!e||!a)return;const t=function(e,t){var r;if(!(null===(r=null===google||void 0===google?void 0:google.maps)||void 0===r?void 0:r.version))return;const n=google.maps.version.split("."),o=parseInt(n[0],10),a=parseInt(n[1],10);return o>e||o===e&&a>=t}(3,62),i=e.content;if(i&&W(i)){if(void 0!==n||void 0!==o)return t||console.warn(`AdvancedMarker: The anchorLeft and anchorTop props are only supported in Google Maps API version 3.62 and above. The current version is ${google.maps.version}.`),e.anchorLeft=n,e.anchorTop=o,void(void 0!==r&&console.warn("AdvancedMarker: the anchorPoint prop is ignored when anchorLeft and/or anchorTop are set."));if(void 0!==r){const[n,o]=null!=r?r:N.BOTTOM,a=`calc(-1 * ${n})`,s=`calc(-1 * ${o})`;t?(e.anchorLeft=a,e.anchorTop=s,i.style.transform=""):(i.style.transform=`translate(50%, 100%) translate(${a}, ${s})`,e.dataset.origin="rgm",K.addAdvancedMarkerPointerEventsOverwrite())}}},[e,r,n,o,a])}(r,S,A,_,O>0),D(r,"position",b),D(r,"title",null!=E?E:""),D(r,"zIndex",v),D(r,"collisionBehavior",m),t.useEffect(()=>{r&&(r.gmpDraggable=void 0!==w?w:!!(f||h||y))},[r,w,f,y,h]),t.useEffect(()=>{if(!r)return;const e=void 0!==g||Boolean(l)||Boolean(d)||Boolean(p);r.gmpClickable=e,e&&(null==r?void 0:r.content)&&W(r.content)&&(r.content.style.pointerEvents="all",l&&(r.content.style.cursor="pointer"))},[r,g,l,d,p]),x(r,"click",l),x(r,"drag",f),x(r,"dragstart",h),x(r,"dragend",y),L(null==r?void 0:r.element,"mouseenter",d),L(null==r?void 0:r.element,"mouseleave",p),[r,o]}(e),u=t.useMemo(()=>c?{marker:c}:null,[c]);return t.useImperativeHandle(n,()=>c,[c]),l?t.createElement(j.Provider,{value:u},r.createPortal(t.createElement(J,{anchorPoint:s,styles:a,className:i},o),l)):null});function U(e){return void 0!==e.content}function W(e){return e.nodeType===Node.ELEMENT_NODE}M.displayName="AdvancedMarker";const J=({children:e,styles:r,className:n})=>t.createElement("div",{className:n,style:r},e);function B(e,t,r){const n=0===t.indexOf("--");var o;null==r||"boolean"==typeof r||""===r?n?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":n?e.setProperty(t,r):"number"!=typeof r||0===r||(o=t,F.has(o))?"float"===t?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}const F=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function $(e){return"string"==typeof e?e:`${e.lat},${e.lng}`}function G(e){return e.slice(1)}const z=["color","weight","fillcolor","geodesic"];function V(e=[]){return e.map(e=>{return G(function(e){let t="";return z.forEach(r=>{void 0!==e[r]&&(t+=`|${r}:${e[r]}`)}),t}(e)+("string"==typeof(t=e.coordinates)?`|${decodeURIComponent(t)}`:t.map(e=>`|${$(e)}`).join("")));var t})}const q=t.forwardRef((e,r)=>{const n=function(e){const[r,n]=t.useState(null),o=H(),{onClick:i,onDrag:s,onDragStart:c,onDragEnd:l,onMouseOver:u,onMouseOut:d}=e,p=a(e,["onClick","onDrag","onDragStart","onDragEnd","onMouseOver","onMouseOut"]),{position:f,draggable:h}=p;return t.useEffect(()=>{if(!o)return void(void 0===o&&console.error("<Marker> has to be inside a Map component."));const e=new google.maps.Marker(p);return e.setMap(o),n(e),()=>{e.setMap(null),n(null)}},[o]),t.useEffect(()=>{if(!r)return;const e=r,t=google.maps.event;return i&&t.addListener(e,"click",i),s&&t.addListener(e,"drag",s),c&&t.addListener(e,"dragstart",c),l&&t.addListener(e,"dragend",l),u&&t.addListener(e,"mouseover",u),d&&t.addListener(e,"mouseout",d),r.setDraggable(Boolean(h)),()=>{t.clearInstanceListeners(e)}},[r,h,i,s,c,l,u,d]),t.useEffect(()=>{r&&p&&r.setOptions(p)},[r,p]),t.useEffect(()=>{!h&&f&&r&&r.setPosition(f)},[h,f,r]),r}(e);return t.useImperativeHandle(r,()=>n,[n]),t.createElement(t.Fragment,null)});q.displayName="Marker";const X=(e,t,r,n,o)=>n+(e-t)*(o-n)/(r-t);e.APILoadingStatus=s,e.APIProvider=e=>{const{children:r}=e,n=a(e,["children"]),{mapInstances:o,addMapInstance:s,removeMapInstance:d,clearMapInstances:p}=function(){const[e,r]=t.useState({});return{mapInstances:e,addMapInstance:(e,t="default")=>{r(r=>Object.assign(Object.assign({},r),{[t]:e}))},removeMapInstance:(e="default")=>{r(t=>{var r=e;return t[r],a(t,["symbol"==typeof r?r:r+""])})},clearMapInstances:()=>{r({})}}}(),{status:f,loadedLibraries:h,importLibrary:y}=function(e){const{onLoad:r,onError:n,apiKey:o,version:s,libraries:l=[]}=e,u=a(e,["onLoad","onError","apiKey","version","libraries"]),[d,p]=t.useState(c.loadingStatus),[f,h]=t.useReducer((e,t)=>e[t.name]?e:Object.assign(Object.assign({},e),{[t.name]:t.value}),{}),y=t.useMemo(()=>null==l?void 0:l.join(","),[l]),m=t.useMemo(()=>JSON.stringify(Object.assign({apiKey:o,version:s},u)),[o,s,u]),g=t.useCallback(e=>i(this,void 0,void 0,function*(){var t;if(f[e])return f[e];if(!(null===(t=null===google||void 0===google?void 0:google.maps)||void 0===t?void 0:t.importLibrary))throw new Error("[api-provider-internal] importLibrary was called before google.maps.importLibrary was defined.");const r=yield window.google.maps.importLibrary(e);return h({name:e,value:r}),r}),[f]);return t.useEffect(()=>{(()=>{i(this,void 0,void 0,function*(){try{const e=Object.assign({key:o},u);s&&(e.v=s),(null==y?void 0:y.length)>0&&(e.libraries=y),(void 0===e.channel||e.channel<0||e.channel>999)&&delete e.channel,void 0===e.solutionChannel?e.solutionChannel="GMP_visgl_rgmlibrary_v1_default":""===e.solutionChannel&&delete e.solutionChannel,yield c.load(e,e=>p(e));for(const e of["core","maps",...l])yield g(e);r&&r()}catch(e){n?n(e):console.error("<ApiProvider> failed to load the Google Maps JavaScript API",e)}})})()},[o,y,m]),{status:d,loadedLibraries:f,importLibrary:g}}(n),m=function(e){return t.useMemo(()=>e.disableUsageAttribution?null:l,[e.disableUsageAttribution])}(n),g=t.useMemo(()=>({mapInstances:o,addMapInstance:s,removeMapInstance:d,clearMapInstances:p,status:f,loadedLibraries:h,importLibrary:y,internalUsageAttributionIds:m}),[o,s,d,p,f,h,y,m]);return t.createElement(u.Provider,{value:g},r)},e.APIProviderContext=u,e.AdvancedMarker=M,e.AdvancedMarkerAnchorPoint=N,e.AdvancedMarkerContext=j,e.CollisionBehavior={REQUIRED:"REQUIRED",REQUIRED_AND_HIDES_OPTIONAL:"REQUIRED_AND_HIDES_OPTIONAL",OPTIONAL_AND_HIDES_LOWER_PRIORITY:"OPTIONAL_AND_HIDES_LOWER_PRIORITY"},e.ColorScheme={DARK:"DARK",LIGHT:"LIGHT",FOLLOW_SYSTEM:"FOLLOW_SYSTEM"},e.ControlPosition={TOP_LEFT:1,TOP_CENTER:2,TOP:2,TOP_RIGHT:3,LEFT_CENTER:4,LEFT_TOP:5,LEFT:5,LEFT_BOTTOM:6,RIGHT_TOP:7,RIGHT:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM:11,BOTTOM_RIGHT:12,CENTER:13,BLOCK_START_INLINE_START:14,BLOCK_START_INLINE_CENTER:15,BLOCK_START_INLINE_END:16,INLINE_START_BLOCK_CENTER:17,INLINE_START_BLOCK_START:18,INLINE_START_BLOCK_END:19,INLINE_END_BLOCK_START:20,INLINE_END_BLOCK_CENTER:21,INLINE_END_BLOCK_END:22,BLOCK_END_INLINE_START:23,BLOCK_END_INLINE_CENTER:24,BLOCK_END_INLINE_END:25},e.GoogleMapsContext=P,e.InfoWindow=e=>{const{children:o,headerContent:i,style:s,className:c,pixelOffset:l,anchor:u,shouldFocus:d,onClose:p,onCloseClick:f}=e,h=a(e,["children","headerContent","style","className","pixelOffset","anchor","shouldFocus","onClose","onCloseClick"]),y=I("maps"),[g,w]=t.useState(null),b=t.useRef(null),E=t.useRef(null),v=m(h,n);t.useEffect(()=>{if(!y)return;b.current=document.createElement("div"),E.current=document.createElement("div");const e=v;l&&(e.pixelOffset=new google.maps.Size(l[0],l[1])),i&&(e.headerContent="string"==typeof i?i:E.current);const t=new google.maps.InfoWindow(v);return t.setContent(b.current),w(t),()=>{var e,r;t.setContent(null),null===(e=b.current)||void 0===e||e.remove(),null===(r=E.current)||void 0===r||r.remove(),b.current=null,E.current=null,w(null)}},[y]);const S=t.useRef(null);t.useEffect(()=>{g&&b.current&&(function(e,t,r){if(null!=t&&"object"!=typeof t)throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");const n=e.style;if(null!=r){for(const e in r)!r.hasOwnProperty(e)||null!=t&&t.hasOwnProperty(e)||(0===e.indexOf("--")?n.setProperty(e,""):"float"===e?n.cssFloat="":n[e]="");if(null!=t)for(const e in t){const o=t[e];t.hasOwnProperty(e)&&r[e]!==o&&B(n,e,o)}}else{if(null==t)return;for(const e in t)t.hasOwnProperty(e)&&B(n,e,t[e])}}(b.current,s||null,S.current),S.current=s||null,c!==b.current.className&&(b.current.className=c||""))},[g,c,s]),t.useEffect(()=>{if(!g)return;const e=v;e.pixelOffset=l?new google.maps.Size(l[0],l[1]):null,e.headerContent=i?"string"==typeof i?i:E.current:null,g.setOptions(v)},[v,l,i]),x(g,"close",p),x(g,"closeclick",f);const A=H();return t.useEffect(()=>{var e;if(!A||!g||null===u)return;const t=!!u,r={map:A};if(u&&(r.anchor=u,U(u)&&u.content instanceof Element)){const t=null==u?void 0:u.getBoundingClientRect();if(t&&"rgm"===u.dataset.origin){const r=null===(e=u.content.firstElementChild)||void 0===e?void 0:e.firstElementChild,n=null==r?void 0:r.getBoundingClientRect(),o=n.x-t.x+(n.width-t.width)/2,a=n.y-t.y,i=v;i.pixelOffset=new google.maps.Size(l?l[0]+o:o,l?l[1]+a:a),g.setOptions(i)}}return void 0!==d&&(r.shouldFocus=d),g.open(r),()=>{t&&g.set("anchor",null),g.close()}},[g,u,A,d,v,l]),t.createElement(t.Fragment,null,b.current&&r.createPortal(o,b.current),null!==E.current&&r.createPortal(i,E.current))},e.Map=T,e.MapControl=({children:e,position:n})=>{const o=t.useMemo(()=>document.createElement("div"),[]),a=H();return t.useEffect(()=>{if(!a)return;const e=a.controls[n];return e.push(o),()=>{const t=e.getArray();if(!t)return;const r=t.indexOf(o);e.removeAt(r)}},[o,a,n]),r.createPortal(e,o)},e.Marker=q,e.Pin=e=>{var n;const o=null===(n=t.useContext(j))||void 0===n?void 0:n.marker,a=t.useMemo(()=>document.createElement("div"),[]);return t.useEffect(()=>{var r;if(!o)return void(void 0===o&&console.error("The <Pin> component can only be used inside <AdvancedMarker>."));e.glyph&&e.children&&k("The <Pin> component only uses children to render the glyph if both the glyph property and children are present."),t.Children.count(e.children)>1&&k("Passing multiple children to the <Pin> component might lead to unexpected results.");const n=Object.assign({},e),i=new google.maps.marker.PinElement(n);e.children&&(i.glyph=a);const s=null===(r=o.content)||void 0===r?void 0:r.firstChild;for(;null==s?void 0:s.firstChild;)s.removeChild(s.firstChild);s&&s.appendChild(i.element)},[o,a,e]),r.createPortal(e.children,a)},e.RenderingType={VECTOR:"VECTOR",RASTER:"RASTER",UNINITIALIZED:"UNINITIALIZED"},e.StaticMap=e=>{const{url:r,className:n}=e;if(!r)throw new Error("URL is required");return t.createElement("img",{className:n,src:r,width:"100%"})},e.VERSION=o,e.createStaticMapsUrl=function({apiKey:e,width:t,height:r,center:n,zoom:o,scale:a,format:i,mapType:s,language:c,region:l,mapId:u,markers:d=[],paths:p=[],visible:f=[],style:h=[]}){e||console.warn("API key is required"),t&&r||console.warn("Width and height are required");const y=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({key:e,size:`${t}x${r}`},n&&{center:$(n)}),o&&{zoom:o}),a&&{scale:a}),i&&{format:i}),s&&{maptype:s}),c&&{language:c}),l&&{region:l}),u&&{map_id:u}),m=new URL("https://maps.googleapis.com/maps/api/staticmap");Object.entries(y).forEach(([e,t])=>{m.searchParams.append(e,String(t))});for(const e of function(e=[]){const t=[],r=null==e?void 0:e.reduce((e,t)=>{const{color:r="red",label:n,size:o,scale:a,icon:i,anchor:s}=t,c=(i?[i,s,a]:[r,n,o]).filter(Boolean).join("-");return e[c]=e[c]||[],e[c].push(t),e},{});return Object.values(null!=r?r:{}).forEach(e=>{let r="";const{icon:n}=e[0];Object.entries(e[0]).forEach(([e,t])=>{(n?["icon","anchor","scale"]:["color","label","size"]).includes(e)&&(r+=`|${e}:${t}`)});for(const t of e){const e="string"==typeof t.location?t.location:`${t.location.lat},${t.location.lng}`;r+=`|${e}`}t.push(r)}),t.map(G)}(d))m.searchParams.append("markers",e);for(const e of V(p))m.searchParams.append("path",e);f.length&&m.searchParams.append("visible",f.map(e=>$(e)).join("|"));for(const e of h.map(e=>{const{featureType:t,elementType:r,stylers:n=[]}=e;let o="";t&&(o+=`|feature:${t}`),r&&(o+=`|element:${r}`);for(const e of n)Object.entries(e).forEach(([e,t])=>{o+=`|${e}:${String(t).replace("#","0x")}`});return o}).map(G))m.searchParams.append("style",e);return m.toString()},e.isAdvancedMarker=U,e.isLatLngLiteral=E,e.latLngEquals=function(e,t){if(!e||!t)return!1;const r=v(e),n=v(t);return r.lat===n.lat&&r.lng===n.lng},e.limitTiltRange=({viewState:e})=>{const t=e.pitch,r=e.zoom+1,n=(o=r)<=10?30:o>=15.5?67.5:o<=14?X(o,10,14,30,45):X(o,14,15.5,45,67.5);var o;return Object.assign(Object.assign({},e),{fovy:25,pitch:Math.min(n,t)})},e.toLatLngLiteral=v,e.useAdvancedMarkerRef=function(){const[e,r]=t.useState(null);return[t.useCallback(e=>{r(e)},[]),e]},e.useApiIsLoaded=A,e.useApiLoadingStatus=b,e.useMap=H,e.useMapsLibrary=I,e.useMarkerRef=function(){const[e,r]=t.useState(null);return[t.useCallback(e=>{r(e)},[]),e]}}(t,r(9155),r(9514),r(8792))},5199:function(e,t,r){e=r.nmd(e),function(r){"use strict";var n={};r.PubSub?(n=r.PubSub,console.warn("PubSub already loaded, using existing version")):(r.PubSub=n,function(e){var t={},r=-1;function n(e,t,r){try{e(t,r)}catch(e){setTimeout(function(e){return function(){throw e}}(e),0)}}function o(e,t,r){e(t,r)}function a(e,r,a,i){var s,c=t[r],l=i?o:n;if(Object.prototype.hasOwnProperty.call(t,r))for(s in c)Object.prototype.hasOwnProperty.call(c,s)&&l(c[s],e,a)}function i(e){var r=String(e);return Boolean(Object.prototype.hasOwnProperty.call(t,r)&&function(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}(t[r]))}function s(e,t,r,n){var o=function(e,t,r){return function(){var n=String(e),o=n.lastIndexOf(".");for(a(e,e,t,r);-1!==o;)o=(n=n.substr(0,o)).lastIndexOf("."),a(e,n,t,r);a(e,"*",t,r)}}(e="symbol"==typeof e?e.toString():e,t,n);return!!function(e){for(var t=String(e),r=i(t)||i("*"),n=t.lastIndexOf(".");!r&&-1!==n;)n=(t=t.substr(0,n)).lastIndexOf("."),r=i(t);return r}(e)&&(!0===r?o():setTimeout(o,0),!0)}e.publish=function(t,r){return s(t,r,!1,e.immediateExceptions)},e.publishSync=function(t,r){return s(t,r,!0,e.immediateExceptions)},e.subscribe=function(e,n){if("function"!=typeof n)return!1;e="symbol"==typeof e?e.toString():e,Object.prototype.hasOwnProperty.call(t,e)||(t[e]={});var o="uid_"+String(++r);return t[e][o]=n,o},e.subscribeAll=function(t){return e.subscribe("*",t)},e.subscribeOnce=function(t,r){var n=e.subscribe(t,function(){e.unsubscribe(n),r.apply(this,arguments)});return e},e.clearAllSubscriptions=function(){t={}},e.clearSubscriptions=function(e){var r;for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&delete t[r]},e.countSubscriptions=function(e){var r,n,o=0;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)){for(n in t[r])o++;break}return o},e.getSubscriptions=function(e){var r,n=[];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e)&&n.push(r);return n},e.unsubscribe=function(r){var n,o,a,i="string"==typeof r&&(Object.prototype.hasOwnProperty.call(t,r)||function(e){var r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&0===r.indexOf(e))return!0;return!1}(r)),s=!i&&"string"==typeof r,c="function"==typeof r,l=!1;if(!i){for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(o=t[n],s&&o[r]){delete o[r],l=r;break}if(c)for(a in o)Object.prototype.hasOwnProperty.call(o,a)&&o[a]===r&&(delete o[a],l=!0)}return l}e.clearSubscriptions(r)}}(n)),void 0!==e&&e.exports&&(t=e.exports=n),t.PubSub=n,e.exports=t=n}("object"==typeof window&&window||this||r.g)},5478:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CompactEncrypt:()=>st,CompactSign:()=>lt,EmbeddedJWK:()=>wt,EncryptJWT:()=>ht,FlattenedEncrypt:()=>$e,FlattenedSign:()=>ct,GeneralEncrypt:()=>ze,GeneralSign:()=>dt,SignJWT:()=>ft,UnsecuredJWT:()=>Ct,base64url:()=>o,calculateJwkThumbprint:()=>mt,calculateJwkThumbprintUri:()=>gt,compactDecrypt:()=>je,compactVerify:()=>Ze,createLocalJWKSet:()=>At,createRemoteJWKSet:()=>Ot,cryptoRuntime:()=>Dt,decodeJwt:()=>kt,decodeProtectedHeader:()=>Rt,errors:()=>n,exportJWK:()=>Je,exportPKCS8:()=>We,exportSPKI:()=>Ue,flattenedDecrypt:()=>Ke,flattenedVerify:()=>Ye,generalDecrypt:()=>Ne,generalVerify:()=>Qe,generateKeyPair:()=>It,generateSecret:()=>xt,importJWK:()=>ke,importPKCS8:()=>Re,importSPKI:()=>Pe,importX509:()=>Te,jwtDecrypt:()=>it,jwtVerify:()=>at});var n={};r.r(n),r.d(n,{JOSEAlgNotAllowed:()=>A,JOSEError:()=>E,JOSENotSupported:()=>_,JWEDecompressionFailed:()=>C,JWEDecryptionFailed:()=>O,JWEInvalid:()=>P,JWKInvalid:()=>k,JWKSInvalid:()=>H,JWKSMultipleMatchingKeys:()=>x,JWKSNoMatchingKey:()=>I,JWKSTimeout:()=>D,JWSInvalid:()=>T,JWSSignatureVerificationFailed:()=>L,JWTClaimValidationFailed:()=>v,JWTExpired:()=>S,JWTInvalid:()=>R});var o={};r.r(o),r.d(o,{decode:()=>Tt,encode:()=>Pt});const a=crypto,i=e=>e instanceof CryptoKey,s=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await a.subtle.digest(r,t))},c=new TextEncoder,l=new TextDecoder,u=2**32;function d(...e){const t=e.reduce((e,{length:t})=>e+t,0),r=new Uint8Array(t);let n=0;return e.forEach(e=>{r.set(e,n),n+=e.length}),r}function p(e,t,r){if(t<0||t>=u)throw new RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function f(e){const t=Math.floor(e/u),r=e%u,n=new Uint8Array(8);return p(n,t,0),p(n,r,4),n}function h(e){const t=new Uint8Array(4);return p(t,e),t}function y(e){return d(h(e.length),e)}const m=e=>{let t=e;"string"==typeof t&&(t=c.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(""))},g=e=>m(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),w=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},b=e=>{let t=e;t instanceof Uint8Array&&(t=l.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return w(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}};class E extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class v extends E{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 S extends E{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 A extends E{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class _ extends E{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class O extends E{constructor(){super(...arguments),this.code="ERR_JWE_DECRYPTION_FAILED",this.message="decryption operation failed"}static get code(){return"ERR_JWE_DECRYPTION_FAILED"}}class C extends E{constructor(){super(...arguments),this.code="ERR_JWE_DECOMPRESSION_FAILED",this.message="decompression operation failed"}static get code(){return"ERR_JWE_DECOMPRESSION_FAILED"}}class P extends E{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}static get code(){return"ERR_JWE_INVALID"}}class T extends E{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class R extends E{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class k extends E{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}static get code(){return"ERR_JWK_INVALID"}}class H extends E{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class I extends E{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 x extends E{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"}}Symbol.asyncIterator;class D extends E{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class L extends E{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}const K=a.getRandomValues.bind(a);function j(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 _(`Unsupported JWE Algorithm: ${e}`)}}const N=e=>K(new Uint8Array(j(e)>>3)),M=(e,t)=>{if(t.length<<3!==j(e))throw new P("Invalid Initialization Vector length")},U=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new P(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function W(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function J(e,t){return e.name===t}function B(e){return parseInt(e.name.slice(4),10)}function F(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 $(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!J(e.algorithm,"AES-GCM"))throw W("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw W(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!J(e.algorithm,"AES-KW"))throw W("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw W(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw W("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!J(e.algorithm,"PBKDF2"))throw W("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!J(e.algorithm,"RSA-OAEP"))throw W("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(B(e.algorithm.hash)!==r)throw W(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}F(e,r)}function G(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&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const z=(e,...t)=>G("Key must be ",e,...t);function V(e,t,...r){return G(`Key for the ${e} algorithm must be `,t,...r)}const q=e=>i(e),X=["CryptoKey"],Y=async(e,t,r,n,o,s)=>{if(!(i(t)||t instanceof Uint8Array))throw new TypeError(z(t,...X,"Uint8Array"));switch(M(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&U(t,parseInt(e.slice(-3),10)),async function(e,t,r,n,o,i){if(!(t instanceof Uint8Array))throw new TypeError(z(t,"Uint8Array"));const s=parseInt(e.slice(1,4),10),c=await a.subtle.importKey("raw",t.subarray(s>>3),"AES-CBC",!1,["decrypt"]),l=await a.subtle.importKey("raw",t.subarray(0,s>>3),{hash:"SHA-"+(s<<1),name:"HMAC"},!1,["sign"]),u=d(i,n,r,f(i.length<<3)),p=new Uint8Array((await a.subtle.sign("HMAC",l,u)).slice(0,s>>3));let h,y;try{h=((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,p)}catch(e){}if(!h)throw new O;try{y=new Uint8Array(await a.subtle.decrypt({iv:n,name:"AES-CBC"},c,r))}catch(e){}if(!y)throw new O;return y}(e,t,r,n,o,s);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&U(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,o,i){let s;t instanceof Uint8Array?s=await a.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):($(t,e,"decrypt"),s=t);try{return new Uint8Array(await a.subtle.decrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},s,d(r,o)))}catch(e){throw new O}}(e,t,r,n,o,s);default:throw new _("Unsupported JWE Content Encryption Algorithm")}},Z=async()=>{throw new _('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Q=async()=>{throw new _('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},ee=(...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 te(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const re=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function ne(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function oe(e,t,r){if(i(e))return $(e,t,r),e;if(e instanceof Uint8Array)return a.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(z(e,...X,"Uint8Array"))}const ae=async(e,t,r)=>{const n=await oe(t,e,"wrapKey");ne(n,e);const o=await a.subtle.importKey("raw",r,...re);return new Uint8Array(await a.subtle.wrapKey("raw",o,n,"AES-KW"))},ie=async(e,t,r)=>{const n=await oe(t,e,"unwrapKey");ne(n,e);const o=await a.subtle.unwrapKey("raw",r,n,"AES-KW",...re);return new Uint8Array(await a.subtle.exportKey("raw",o))};async function se(e,t,r,n,o=new Uint8Array(0),l=new Uint8Array(0)){if(!i(e))throw new TypeError(z(e,...X));if($(e,"ECDH"),!i(t))throw new TypeError(z(t,...X));$(t,"ECDH","deriveBits");const u=d(y(c.encode(r)),y(o),y(l),h(n));let p;return p="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3,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(h(t+1)),n.set(e,4),n.set(r,4+e.length),o.set(await s("sha256",n),32*t)}return o.slice(0,t>>3)}(new Uint8Array(await a.subtle.deriveBits({name:e.algorithm.name,public:e},t,p)),n,u)}function ce(e){if(!i(e))throw new TypeError(z(e,...X));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function le(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new P("PBES2 Salt Input must be 8 or more octets")}(e);const o=function(e,t){return d(c.encode(e),new Uint8Array([0]),t)}(t,e),s=parseInt(t.slice(13,16),10),l={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:o},u={length:s,name:"AES-KW"},p=await function(e,t){if(e instanceof Uint8Array)return a.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(i(e))return $(e,t,"deriveBits","deriveKey"),e;throw new TypeError(z(e,...X,"Uint8Array"))}(n,t);if(p.usages.includes("deriveBits"))return new Uint8Array(await a.subtle.deriveBits(l,p,s));if(p.usages.includes("deriveKey"))return a.subtle.deriveKey(l,p,u,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}function ue(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new _(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}const de=(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`)}};function pe(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 _(`Unsupported JWE Algorithm: ${e}`)}}const fe=e=>K(new Uint8Array(pe(e)>>3)),he=(e,t)=>`-----BEGIN ${t}-----\n${(e.match(/.{1,64}/g)||[]).join("\n")}\n-----END ${t}-----`,ye=async(e,t,r)=>{if(!i(r))throw new TypeError(z(r,...X));if(!r.extractable)throw new TypeError("CryptoKey is not extractable");if(r.type!==e)throw new TypeError(`key is not a ${e} key`);return he(m(new Uint8Array(await a.subtle.exportKey(t,r))),`${e.toUpperCase()} KEY`)},me=e=>ye("public","spki",e),ge=e=>ye("private","pkcs8",e),we=(e,t,r=0)=>{0===r&&(t.unshift(t.length),t.unshift(6));let 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])||we(e,t,n+1))},be=e=>{switch(!0){case we(e,[42,134,72,206,61,3,1,7]):return"P-256";case we(e,[43,129,4,0,34]):return"P-384";case we(e,[43,129,4,0,35]):return"P-521";case we(e,[43,101,110]):return"X25519";case we(e,[43,101,111]):return"X448";case we(e,[43,101,112]):return"Ed25519";case we(e,[43,101,113]):return"Ed448";default:throw new _("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},Ee=async(e,t,r,n,o)=>{var i;let s,c;const l=new Uint8Array(atob(r.replace(e,"")).split("").map(e=>e.charCodeAt(0))),u="spki"===t;switch(n){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:`SHA-${n.slice(-3)}`},c=u?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${n.slice(-3)}`},c=u?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:`SHA-${parseInt(n.slice(-3),10)||1}`},c=u?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":s={name:"ECDSA",namedCurve:"P-256"},c=u?["verify"]:["sign"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},c=u?["verify"]:["sign"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},c=u?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const e=be(l);s=e.startsWith("P-")?{name:"ECDH",namedCurve:e}:{name:e},c=u?[]:["deriveBits"];break}case"EdDSA":s={name:be(l)},c=u?["verify"]:["sign"];break;default:throw new _('Invalid or unsupported "alg" (Algorithm) value')}return a.subtle.importKey(t,l,s,null!==(i=null==o?void 0:o.extractable)&&void 0!==i&&i,c)},ve=(e,t,r)=>Ee(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"pkcs8",e,t,r),Se=(e,t,r)=>Ee(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,r);function Ae(e){let t=[],r=0;for(;r<e.length;){let n=_e(e.subarray(r));t.push(n),r+=n.byteLength}return t}function _e(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)}}{let 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)}}const Oe=(e,t,r)=>{let n;try{n=function(e){const t=e.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g,""),r=w(t);return he(function(e){const t=Ae(Ae(_e(e).contents)[0].contents);return m(t[160===t[0].raw[0]?6:5].raw)}(r),"PUBLIC KEY")}(e)}catch(e){throw new TypeError("Failed to parse the X.509 certificate",{cause:e})}return Se(n,t,r)},Ce=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:o}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new _(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;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 _('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 _('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 _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new _('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),i=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:o];if("PBKDF2"===n.name)return a.subtle.importKey("raw",b(e.k),...i);const s={...e};return delete s.alg,delete s.use,a.subtle.importKey("jwk",s,...i)};async function Pe(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PUBLIC KEY-----"))throw new TypeError('"spki" must be SPKI formatted string');return Se(e,t,r)}async function Te(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN CERTIFICATE-----"))throw new TypeError('"x509" must be X.509 formatted string');return Oe(e,t,r)}async function Re(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return ve(e,t,r)}async function ke(e,t,r){var n;if(!te(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 null!=r||(r=!0!==e.ext),r?Ce({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):b(e.k);case"RSA":if(void 0!==e.oth)throw new _('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return Ce({...e,alg:t});default:throw new _('Unsupported "kty" (Key Type) Parameter value')}}const He=(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(!q(t))throw new TypeError(V(e,t,...X,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${X.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!q(t))throw new TypeError(V(e,t,...X));if("secret"===t.type)throw new TypeError(`${X.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${X.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${X.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${X.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${X.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)},Ie=async(e,t,r,n,o)=>{if(!(i(r)||r instanceof Uint8Array))throw new TypeError(z(r,...X,"Uint8Array"));switch(M(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&U(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,o){if(!(r instanceof Uint8Array))throw new TypeError(z(r,"Uint8Array"));const i=parseInt(e.slice(1,4),10),s=await a.subtle.importKey("raw",r.subarray(i>>3),"AES-CBC",!1,["encrypt"]),c=await a.subtle.importKey("raw",r.subarray(0,i>>3),{hash:"SHA-"+(i<<1),name:"HMAC"},!1,["sign"]),l=new Uint8Array(await a.subtle.encrypt({iv:n,name:"AES-CBC"},s,t)),u=d(o,n,l,f(o.length<<3));return{ciphertext:l,tag:new Uint8Array((await a.subtle.sign("HMAC",c,u)).slice(0,i>>3))}}(e,t,r,n,o);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&U(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,o){let i;r instanceof Uint8Array?i=await a.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):($(r,e,"encrypt"),i=r);const s=new Uint8Array(await a.subtle.encrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},i,t)),c=s.slice(-16);return{ciphertext:s.slice(0,-16),tag:c}}(e,t,r,n,o);default:throw new _("Unsupported JWE Content Encryption Algorithm")}},xe=async function(e,t,r,n,o){switch(He(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new P("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new P("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!te(n.epk))throw new P('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ce(t))throw new _("ECDH with the provided key is not allowed or not supported by your javascript runtime");const o=await ke(n.epk,e);let a,i;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new P('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{a=b(n.apu)}catch(e){throw new P("Failed to base64url decode the apu")}}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new P('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{i=b(n.apv)}catch(e){throw new P("Failed to base64url decode the apv")}}const s=await se(o,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?pe(n.enc):parseInt(e.slice(-5,-2),10),a,i);if("ECDH-ES"===e)return s;if(void 0===r)throw new P("JWE Encrypted Key missing");return ie(e.slice(-6),s,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 P("JWE Encrypted Key missing");return(async(e,t,r)=>{if(!i(t))throw new TypeError(z(t,...X));if($(t,e,"decrypt","unwrapKey"),de(e,t),t.usages.includes("decrypt"))return new Uint8Array(await a.subtle.decrypt(ue(e),t,r));if(t.usages.includes("unwrapKey")){const n=await a.subtle.unwrapKey("raw",r,t,ue(e),...re);return new Uint8Array(await a.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')})(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new P("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new P('JOSE Header "p2c" (PBES2 Count) missing or invalid');const a=(null==o?void 0:o.maxPBES2Count)||1e4;if(n.p2c>a)throw new P('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new P('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let i;try{i=b(n.p2s)}catch(e){throw new P("Failed to base64url decode the p2s")}return(async(e,t,r,n,o)=>{const a=await le(o,e,n,t);return ie(e.slice(-6),a,r)})(e,t,r,n.p2c,i)}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new P("JWE Encrypted Key missing");return ie(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{if(void 0===r)throw new P("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new P('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new P('JOSE Header "tag" (Authentication Tag) missing or invalid');let o,a;try{o=b(n.iv)}catch(e){throw new P("Failed to base64url decode the iv")}try{a=b(n.tag)}catch(e){throw new P("Failed to base64url decode the tag")}return async function(e,t,r,n,o){const a=e.slice(0,7);return Y(a,t,r,n,o,new Uint8Array(0))}(e,t,r,o,a)}default:throw new _('Invalid or unsupported "alg" (JWE Algorithm) header value')}},De=function(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 a;a=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!a.has(t))throw new _(`Extension Header Parameter "${t}" is not recognized`);if(void 0===o[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)},Le=(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 Ke(e,t,r){var n;if(!te(e))throw new P("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new P("JOSE Header missing");if("string"!=typeof e.iv)throw new P("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new P("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new P("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new P("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new P("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new P("JWE AAD incorrect type");if(void 0!==e.header&&!te(e.header))throw new P("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!te(e.unprotected))throw new P("JWE Per-Recipient Unprotected Header incorrect type");let o;if(e.protected)try{const t=b(e.protected);o=JSON.parse(l.decode(t))}catch(e){throw new P("JWE Protected Header is invalid")}if(!ee(o,e.header,e.unprotected))throw new P("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const a={...o,...e.header,...e.unprotected};if(De(P,new Map,null==r?void 0:r.crit,o,a),void 0!==a.zip){if(!o||!o.zip)throw new P('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==a.zip)throw new _('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:i,enc:s}=a;if("string"!=typeof i||!i)throw new P("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new P("missing JWE Encryption Algorithm (enc) in JWE Header");const u=r&&Le("keyManagementAlgorithms",r.keyManagementAlgorithms),p=r&&Le("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(u&&!u.has(i))throw new A('"alg" (Algorithm) Header Parameter not allowed');if(p&&!p.has(s))throw new A('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;if(void 0!==e.encrypted_key)try{f=b(e.encrypted_key)}catch(e){throw new P("Failed to base64url decode the encrypted_key")}let h,y,m,g=!1;"function"==typeof t&&(t=await t(o,e),g=!0);try{h=await xe(i,t,f,a,r)}catch(e){if(e instanceof TypeError||e instanceof P||e instanceof _)throw e;h=fe(s)}try{y=b(e.iv)}catch(e){throw new P("Failed to base64url decode the iv")}try{m=b(e.tag)}catch(e){throw new P("Failed to base64url decode the tag")}const w=c.encode(null!==(n=e.protected)&&void 0!==n?n:"");let E,v;E=void 0!==e.aad?d(w,c.encode("."),c.encode(e.aad)):w;try{v=b(e.ciphertext)}catch(e){throw new P("Failed to base64url decode the ciphertext")}let S=await Y(s,h,v,y,m,E);"DEF"===a.zip&&(S=await((null==r?void 0:r.inflateRaw)||Z)(S));const O={plaintext:S};if(void 0!==e.protected&&(O.protectedHeader=o),void 0!==e.aad)try{O.additionalAuthenticatedData=b(e.aad)}catch(e){throw new P("Failed to base64url decode the aad")}return void 0!==e.unprotected&&(O.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(O.unprotectedHeader=e.header),g?{...O,key:t}:O}async function je(e,t,r){if(e instanceof Uint8Array&&(e=l.decode(e)),"string"!=typeof e)throw new P("Compact JWE must be a string or Uint8Array");const{0:n,1:o,2:a,3:i,4:s,length:c}=e.split(".");if(5!==c)throw new P("Invalid Compact JWE");const u=await Ke({ciphertext:i,iv:a||void 0,protected:n||void 0,tag:s||void 0,encrypted_key:o||void 0},t,r),d={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof t?{...d,key:u.key}:d}async function Ne(e,t,r){if(!te(e))throw new P("General JWE must be an object");if(!Array.isArray(e.recipients)||!e.recipients.every(te))throw new P("JWE Recipients missing or incorrect type");if(!e.recipients.length)throw new P("JWE Recipients has no members");for(const n of e.recipients)try{return await Ke({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(e){}throw new O}const Me=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:g(e)};if(!i(e))throw new TypeError(z(e,...X,"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,...s}=await a.subtle.exportKey("jwk",e);return s};async function Ue(e){return me(e)}async function We(e){return ge(e)}async function Je(e){return Me(e)}const Be=async function(e,t,r,n,o={}){let s,c,l;switch(He(e,r,"encrypt"),e){case"dir":l=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ce(r))throw new _("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:u,apv:d}=o;let{epk:p}=o;p||(p=(await async function(e){if(!i(e))throw new TypeError(z(e,...X));return a.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:f,y:h,crv:y,kty:m}=await Je(p),w=await se(r,p,"ECDH-ES"===e?t:e,"ECDH-ES"===e?pe(t):parseInt(e.slice(-5,-2),10),u,d);if(c={epk:{x:f,crv:y,kty:m}},"EC"===m&&(c.epk.y=h),u&&(c.apu=g(u)),d&&(c.apv=g(d)),"ECDH-ES"===e){l=w;break}l=n||fe(t);const b=e.slice(-6);s=await ae(b,w,l);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":l=n||fe(t),s=await(async(e,t,r)=>{if(!i(t))throw new TypeError(z(t,...X));if($(t,e,"encrypt","wrapKey"),de(e,t),t.usages.includes("encrypt"))return new Uint8Array(await a.subtle.encrypt(ue(e),t,r));if(t.usages.includes("wrapKey")){const n=await a.subtle.importKey("raw",r,...re);return new Uint8Array(await a.subtle.wrapKey("raw",n,t,ue(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,r,l);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{l=n||fe(t);const{p2c:a,p2s:i}=o;({encryptedKey:s,...c}=await(async(e,t,r,n=2048,o=K(new Uint8Array(16)))=>{const a=await le(o,e,n,t);return{encryptedKey:await ae(e.slice(-6),a,r),p2c:n,p2s:g(o)}})(e,r,l,a,i));break}case"A128KW":case"A192KW":case"A256KW":l=n||fe(t),s=await ae(e,r,l);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{l=n||fe(t);const{iv:a}=o;({encryptedKey:s,...c}=await async function(e,t,r,n){const o=e.slice(0,7);n||(n=N(o));const{ciphertext:a,tag:i}=await Ie(o,r,t,n,new Uint8Array(0));return{encryptedKey:a,iv:g(n),tag:g(i)}}(e,r,l,a));break}default:throw new _('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:l,encryptedKey:s,parameters:c}},Fe=Symbol();class $e{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 P("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!ee(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new P("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(De(P,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new P('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new _('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:o}=r;if("string"!=typeof n||!n)throw new P('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof o||!o)throw new P('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let a,i,s,u,p,f,h;if("dir"===n){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===n&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let r;({cek:i,encryptedKey:a,parameters:r}=await Be(n,o,e,this._cek,this._keyManagementParameters)),r&&(t&&Fe in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...r}:this.setUnprotectedHeader(r):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...r}:this.setProtectedHeader(r))}if(this._iv||(this._iv=N(o)),u=this._protectedHeader?c.encode(g(JSON.stringify(this._protectedHeader))):c.encode(""),this._aad?(p=g(this._aad),s=d(u,c.encode("."),c.encode(p))):s=u,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Q)(this._plaintext);({ciphertext:f,tag:h}=await Ie(o,e,i,this._iv,s))}else({ciphertext:f,tag:h}=await Ie(o,this._plaintext,i,this._iv,s));const y={ciphertext:g(f),iv:g(this._iv),tag:g(h)};return a&&(y.encrypted_key=g(a)),p&&(y.aad=p),this._protectedHeader&&(y.protected=l.decode(u)),this._sharedUnprotectedHeader&&(y.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(y.header=this._unprotectedHeader),y}}class Ge{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}}class ze{constructor(e){this._recipients=[],this._plaintext=e}addRecipient(e,t){const r=new Ge(this,e,{crit:null==t?void 0: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(e){var t,r,n;if(!this._recipients.length)throw new P("at least one recipient must be added");if(e={deflateRaw:null==e?void 0:e.deflateRaw},1===this._recipients.length){const[t]=this._recipients,r=await new $e(this._plaintext).setAdditionalAuthenticatedData(this._aad).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(t.unprotectedHeader).encrypt(t.key,{...t.options,...e});let n={ciphertext:r.ciphertext,iv:r.iv,recipients:[{}],tag:r.tag};return r.aad&&(n.aad=r.aad),r.protected&&(n.protected=r.protected),r.unprotected&&(n.unprotected=r.unprotected),r.encrypted_key&&(n.recipients[0].encrypted_key=r.encrypted_key),r.header&&(n.recipients[0].header=r.header),n}let o;for(let e=0;e<this._recipients.length;e++){const t=this._recipients[e];if(!ee(this._protectedHeader,this._unprotectedHeader,t.unprotectedHeader))throw new P("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...t.unprotectedHeader},{alg:n}=r;if("string"!=typeof n||!n)throw new P('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("dir"===n||"ECDH-ES"===n)throw new P('"dir" and "ECDH-ES" alg may only be used with a single recipient');if("string"!=typeof r.enc||!r.enc)throw new P('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(o){if(o!==r.enc)throw new P('JWE "enc" (Encryption Algorithm) Header Parameter must be the same for all recipients')}else o=r.enc;if(De(P,new Map,t.options.crit,this._protectedHeader,r),!(void 0===r.zip||this._protectedHeader&&this._protectedHeader.zip))throw new P('JWE "zip" (Compression Algorithm) Header MUST be integrity protected')}const a=fe(o);let i={ciphertext:"",iv:"",recipients:[],tag:""};for(let s=0;s<this._recipients.length;s++){const c=this._recipients[s],l={};i.recipients.push(l);const u={...this._protectedHeader,...this._unprotectedHeader,...c.unprotectedHeader}.alg.startsWith("PBES2")?2048+s:void 0;if(0===s){const t=await new $e(this._plaintext).setAdditionalAuthenticatedData(this._aad).setContentEncryptionKey(a).setProtectedHeader(this._protectedHeader).setSharedUnprotectedHeader(this._unprotectedHeader).setUnprotectedHeader(c.unprotectedHeader).setKeyManagementParameters({p2c:u}).encrypt(c.key,{...c.options,...e,[Fe]:!0});i.ciphertext=t.ciphertext,i.iv=t.iv,i.tag=t.tag,t.aad&&(i.aad=t.aad),t.protected&&(i.protected=t.protected),t.unprotected&&(i.unprotected=t.unprotected),l.encrypted_key=t.encrypted_key,t.header&&(l.header=t.header);continue}const{encryptedKey:d,parameters:p}=await Be((null===(t=c.unprotectedHeader)||void 0===t?void 0:t.alg)||(null===(r=this._protectedHeader)||void 0===r?void 0:r.alg)||(null===(n=this._unprotectedHeader)||void 0===n?void 0:n.alg),o,c.key,a,{p2c:u});l.encrypted_key=g(d),(c.unprotectedHeader||p)&&(l.header={...c.unprotectedHeader,...p})}return i}}function Ve(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 _(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function qe(e,t,r){if(i(t))return function(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!J(e.algorithm,"HMAC"))throw W("HMAC");const r=parseInt(t.slice(2),10);if(B(e.algorithm.hash)!==r)throw W(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!J(e.algorithm,"RSASSA-PKCS1-v1_5"))throw W("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(B(e.algorithm.hash)!==r)throw W(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!J(e.algorithm,"RSA-PSS"))throw W("RSA-PSS");const r=parseInt(t.slice(2),10);if(B(e.algorithm.hash)!==r)throw W(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw W("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!J(e.algorithm,"ECDSA"))throw W("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 W(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}F(e,r)}(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(z(t,...X));return a.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(z(t,...X,"Uint8Array"))}const Xe=async(e,t,r,n)=>{const o=await qe(e,t,"verify");de(e,o);const i=Ve(e,o.algorithm);try{return await a.subtle.verify(i,o,r,n)}catch(e){return!1}};async function Ye(e,t,r){var n;if(!te(e))throw new T("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new T('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new T("JWS Protected Header incorrect type");if(void 0===e.payload)throw new T("JWS Payload missing");if("string"!=typeof e.signature)throw new T("JWS Signature missing or incorrect type");if(void 0!==e.header&&!te(e.header))throw new T("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{const t=b(e.protected);o=JSON.parse(l.decode(t))}catch(e){throw new T("JWS Protected Header is invalid")}if(!ee(o,e.header))throw new T("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a={...o,...e.header};let i=!0;if(De(T,new Map([["b64",!0]]),null==r?void 0:r.crit,o,a).has("b64")&&(i=o.b64,"boolean"!=typeof i))throw new T('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=a;if("string"!=typeof s||!s)throw new T('JWS "alg" (Algorithm) Header Parameter missing or invalid');const u=r&&Le("algorithms",r.algorithms);if(u&&!u.has(s))throw new A('"alg" (Algorithm) Header Parameter not allowed');if(i){if("string"!=typeof e.payload)throw new T("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new T("JWS Payload must be a string or an Uint8Array instance");let p=!1;"function"==typeof t&&(t=await t(o,e),p=!0),He(s,t,"verify");const f=d(c.encode(null!==(n=e.protected)&&void 0!==n?n:""),c.encode("."),"string"==typeof e.payload?c.encode(e.payload):e.payload);let h,y;try{h=b(e.signature)}catch(e){throw new T("Failed to base64url decode the signature")}if(!await Xe(s,t,h,f))throw new L;if(i)try{y=b(e.payload)}catch(e){throw new T("Failed to base64url decode the payload")}else y="string"==typeof e.payload?c.encode(e.payload):e.payload;const m={payload:y};return void 0!==e.protected&&(m.protectedHeader=o),void 0!==e.header&&(m.unprotectedHeader=e.header),p?{...m,key:t}:m}async function Ze(e,t,r){if(e instanceof Uint8Array&&(e=l.decode(e)),"string"!=typeof e)throw new T("Compact JWS must be a string or Uint8Array");const{0:n,1:o,2:a,length:i}=e.split(".");if(3!==i)throw new T("Invalid Compact JWS");const s=await Ye({payload:o,protected:n,signature:a},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}async function Qe(e,t,r){if(!te(e))throw new T("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(te))throw new T("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await Ye({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new L}const et=e=>Math.floor(e.getTime()/1e3),tt=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,rt=e=>{const t=tt.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(86400*r);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}},nt=e=>e.toLowerCase().replace(/^application\//,""),ot=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||nt(e.typ)!==nt(n)))throw new v('unexpected "typ" JWT header value',"typ","check_failed");let o;try{o=JSON.parse(l.decode(t))}catch(e){}if(!te(o))throw new R("JWT Claims Set must be a top-level JSON object");const{requiredClaims:a=[],issuer:i,subject:s,audience:c,maxTokenAge:u}=r;void 0!==u&&a.push("iat"),void 0!==c&&a.push("aud"),void 0!==s&&a.push("sub"),void 0!==i&&a.push("iss");for(const e of new Set(a.reverse()))if(!(e in o))throw new v(`missing required "${e}" claim`,e,"missing");if(i&&!(Array.isArray(i)?i:[i]).includes(o.iss))throw new v('unexpected "iss" claim value',"iss","check_failed");if(s&&o.sub!==s)throw new v('unexpected "sub" claim value',"sub","check_failed");if(c&&(p="string"==typeof c?[c]:c,!("string"==typeof(d=o.aud)?p.includes(d):Array.isArray(d)&&p.some(Set.prototype.has.bind(new Set(d))))))throw new v('unexpected "aud" claim value',"aud","check_failed");var d,p;let f;switch(typeof r.clockTolerance){case"string":f=rt(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=et(h||new Date);if((void 0!==o.iat||u)&&"number"!=typeof o.iat)throw new v('"iat" claim must be a number',"iat","invalid");if(void 0!==o.nbf){if("number"!=typeof o.nbf)throw new v('"nbf" claim must be a number',"nbf","invalid");if(o.nbf>y+f)throw new v('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==o.exp){if("number"!=typeof o.exp)throw new v('"exp" claim must be a number',"exp","invalid");if(o.exp<=y-f)throw new S('"exp" claim timestamp check failed',"exp","check_failed")}if(u){const e=y-o.iat;if(e-f>("number"==typeof u?u:rt(u)))throw new S('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)throw new v('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return o};async function at(e,t,r){var n;const o=await Ze(e,t,r);if((null===(n=o.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===o.protectedHeader.b64)throw new R("JWTs MUST NOT use unencoded payload");const a={payload:ot(o.protectedHeader,o.payload,r),protectedHeader:o.protectedHeader};return"function"==typeof t?{...a,key:o.key}:a}async function it(e,t,r){const n=await je(e,t,r),o=ot(n.protectedHeader,n.plaintext,r),{protectedHeader:a}=n;if(void 0!==a.iss&&a.iss!==o.iss)throw new v('replicated "iss" claim header parameter mismatch',"iss","mismatch");if(void 0!==a.sub&&a.sub!==o.sub)throw new v('replicated "sub" claim header parameter mismatch',"sub","mismatch");if(void 0!==a.aud&&JSON.stringify(a.aud)!==JSON.stringify(o.aud))throw new v('replicated "aud" claim header parameter mismatch',"aud","mismatch");const i={payload:o,protectedHeader:a};return"function"==typeof t?{...i,key:n.key}:i}class st{constructor(e){this._flattened=new $e(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 ct{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 T("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!ee(this._protectedHeader,this._unprotectedHeader))throw new T("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(De(T,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new T('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:o}=r;if("string"!=typeof o||!o)throw new T('JWS "alg" (Algorithm) Header Parameter missing or invalid');He(o,e,"sign");let i,s=this._payload;n&&(s=c.encode(g(s))),i=this._protectedHeader?c.encode(g(JSON.stringify(this._protectedHeader))):c.encode("");const u=d(i,c.encode("."),s),p=await(async(e,t,r)=>{const n=await qe(e,t,"sign");de(e,n);const o=await a.subtle.sign(Ve(e,n.algorithm),n,r);return new Uint8Array(o)})(o,e,u),f={signature:g(p),payload:""};return n&&(f.payload=l.decode(s)),this._unprotectedHeader&&(f.header=this._unprotectedHeader),this._protectedHeader&&(f.protected=l.decode(i)),f}}class lt{constructor(e){this._flattened=new ct(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 ut{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}}class dt{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new ut(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new T("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 ct(this._payload);n.setProtectedHeader(r.protectedHeader),n.setUnprotectedHeader(r.unprotectedHeader);const{payload:o,...a}=await n.sign(r.key,r.options);if(0===t)e.payload=o;else if(e.payload!==o)throw new T("inconsistent use of JWS Unencoded Payload (RFC7797)");e.signatures.push(a)}return e}}class pt{constructor(e){if(!te(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 this._payload="number"==typeof e?{...this._payload,nbf:e}:{...this._payload,nbf:et(new Date)+rt(e)},this}setExpirationTime(e){return this._payload="number"==typeof e?{...this._payload,exp:e}:{...this._payload,exp:et(new Date)+rt(e)},this}setIssuedAt(e){return this._payload=void 0===e?{...this._payload,iat:et(new Date)}:{...this._payload,iat:e},this}}class ft extends pt{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){var r;const n=new lt(c.encode(JSON.stringify(this._payload)));if(n.setProtectedHeader(this._protectedHeader),Array.isArray(null===(r=this._protectedHeader)||void 0===r?void 0:r.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new R("JWTs MUST NOT use unencoded payload");return n.sign(e,t)}}class ht extends pt{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 st(c.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)}}const yt=(e,t)=>{if("string"!=typeof e||!e)throw new k(`${t} missing or invalid`)};async function mt(e,t){if(!te(e))throw new TypeError("JWK must be an object");if(null!=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":yt(e.crv,'"crv" (Curve) Parameter'),yt(e.x,'"x" (X Coordinate) Parameter'),yt(e.y,'"y" (Y Coordinate) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":yt(e.crv,'"crv" (Subtype of Key Pair) Parameter'),yt(e.x,'"x" (Public Key) Parameter'),r={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":yt(e.e,'"e" (Exponent) Parameter'),yt(e.n,'"n" (Modulus) Parameter'),r={e:e.e,kty:e.kty,n:e.n};break;case"oct":yt(e.k,'"k" (Key Value) Parameter'),r={k:e.k,kty:e.kty};break;default:throw new _('"kty" (Key Type) Parameter missing or unsupported')}const n=c.encode(JSON.stringify(r));return g(await s(t,n))}async function gt(e,t){null!=t||(t="sha256");const r=await mt(e,t);return`urn:ietf:params:oauth:jwk-thumbprint:sha-${t.slice(-3)}:${r}`}async function wt(e,t){const r={...e,...null==t?void 0:t.header};if(!te(r.jwk))throw new T('"jwk" (JSON Web Key) Header Parameter must be a JSON object');const n=await ke({...r.jwk,ext:!0},r.alg,!0);if(n instanceof Uint8Array||"public"!==n.type)throw new T('"jwk" (JSON Web Key) Header Parameter must be a public key');return n}function bt(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(Et)}function Et(e){return te(e)}class vt{constructor(e){if(this._cached=new WeakMap,!bt(e))throw new H("JSON Web Key Set malformed");var t;this._jwks=(t=e,"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)))}async getKey(e,t){const{alg:r,kid:n}={...e,...null==t?void 0: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 _('Unsupported "alg" value for a JSON Web Key Set')}}(r),a=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:i,length:s}=a;if(0===s)throw new I;if(1!==s){const e=new x,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of a)try{yield await St(t,e,r)}catch(e){continue}},e}return St(this._cached,i,r)}}async function St(e,t,r){const n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){const e=await ke({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new H("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}function At(e){const t=new vt(e);return async function(e,r){return t.getKey(e,r)}}class _t extends vt{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0: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._jwks&&this.fresh()||await this.reload();try{return await super.getKey(e,t)}catch(r){if(r instanceof I&&!1===this.coolingDown())return await this.reload(),super.getKey(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),this._pendingFetch||(this._pendingFetch=(async(e,t,r)=>{let n,o,a=!1;"function"==typeof AbortController&&(n=new AbortController,o=setTimeout(()=>{a=!0,n.abort()},t));const i=await fetch(e.href,{signal:n?n.signal:void 0,redirect:"manual",headers:r.headers}).catch(e=>{if(a)throw new D;throw e});if(void 0!==o&&clearTimeout(o),200!==i.status)throw new E("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch(e){throw new E("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then(e=>{if(!bt(e))throw new H("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(e=>{throw this._pendingFetch=void 0,e})),await this._pendingFetch}}function Ot(e,t){const r=new _t(e,t);return async function(e,t){return r.getKey(e,t)}}class Ct extends pt{encode(){return`${g(JSON.stringify({alg:"none"}))}.${g(JSON.stringify(this._payload))}.`}static decode(e,t){if("string"!=typeof e)throw new R("Unsecured JWT must be a string");const{0:r,1:n,2:o,length:a}=e.split(".");if(3!==a||""!==o)throw new R("Invalid Unsecured JWT");let i;try{if(i=JSON.parse(l.decode(b(r))),"none"!==i.alg)throw new Error}catch(e){throw new R("Invalid Unsecured JWT")}return{payload:ot(i,b(n),t),header:i}}}const Pt=g,Tt=b;function Rt(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(l.decode(Tt(t)));if(!te(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}function kt(e){if("string"!=typeof e)throw new R("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:r}=e.split(".");if(5===r)throw new R("Only JWTs using Compact JWS serialization can be decoded");if(3!==r)throw new R("Invalid JWT");if(!t)throw new R("JWTs must contain a payload");let n,o;try{n=Tt(t)}catch(e){throw new R("Failed to base64url decode the payload")}try{o=JSON.parse(l.decode(n))}catch(e){throw new R("Failed to parse the decoded payload as JSON")}if(!te(o))throw new R("Invalid JWT Claims Set");return o}function Ht(e){var t;const r=null!==(t=null==e?void 0:e.modulusLength)&&void 0!==t?t:2048;if("number"!=typeof r||r<2048)throw new _("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return r}async function It(e,t){return async function(e,t){var r,n,o;let i,s;switch(e){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Ht(t)},s=["sign","verify"];break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Ht(t)},s=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:`SHA-${parseInt(e.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Ht(t)},s=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":i={name:"ECDSA",namedCurve:"P-256"},s=["sign","verify"];break;case"ES384":i={name:"ECDSA",namedCurve:"P-384"},s=["sign","verify"];break;case"ES512":i={name:"ECDSA",namedCurve:"P-521"},s=["sign","verify"];break;case"EdDSA":s=["sign","verify"];const o=null!==(r=null==t?void 0:t.crv)&&void 0!==r?r:"Ed25519";switch(o){case"Ed25519":case"Ed448":i={name:o};break;default:throw new _("Invalid or unsupported crv option provided")}break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{s=["deriveKey","deriveBits"];const e=null!==(n=null==t?void 0:t.crv)&&void 0!==n?n:"P-256";switch(e){case"P-256":case"P-384":case"P-521":i={name:"ECDH",namedCurve:e};break;case"X25519":case"X448":i={name:e};break;default:throw new _("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return a.subtle.generateKey(i,null!==(o=null==t?void 0:t.extractable)&&void 0!==o&&o,s)}(e,t)}async function xt(e,t){return async function(e,t){var r;let n,o,i;switch(e){case"HS256":case"HS384":case"HS512":n=parseInt(e.slice(-3),10),o={name:"HMAC",hash:`SHA-${n}`,length:n},i=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n=parseInt(e.slice(-3),10),K(new Uint8Array(n>>3));case"A128KW":case"A192KW":case"A256KW":n=parseInt(e.slice(1,4),10),o={name:"AES-KW",length:n},i=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(e.slice(1,4),10),o={name:"AES-GCM",length:n},i=["encrypt","decrypt"];break;default:throw new _('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return a.subtle.generateKey(o,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,i)}(e,t)}const Dt="WebCryptoAPI"},5608:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__addDisposableResource:()=>L,__assign:()=>a,__asyncDelegator:()=>O,__asyncGenerator:()=>_,__asyncValues:()=>C,__await:()=>A,__awaiter:()=>h,__classPrivateFieldGet:()=>I,__classPrivateFieldIn:()=>D,__classPrivateFieldSet:()=>x,__createBinding:()=>m,__decorate:()=>s,__disposeResources:()=>j,__esDecorate:()=>l,__exportStar:()=>g,__extends:()=>o,__generator:()=>y,__importDefault:()=>H,__importStar:()=>k,__makeTemplateObject:()=>P,__metadata:()=>f,__param:()=>c,__propKey:()=>d,__read:()=>b,__rest:()=>i,__rewriteRelativeImportExtension:()=>N,__runInitializers:()=>u,__setFunctionName:()=>p,__spread:()=>E,__spreadArray:()=>S,__spreadArrays:()=>v,__values:()=>w,default:()=>M});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function i(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function s(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}function c(e,t){return function(r,n){t(r,n,e)}}function l(e,t,r,n,o,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=n.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,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");a.push(i(e||null))};var m=(0,r[f])("accessor"===c?{get:d.get,set:d.set}:d[l],h);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=i(m.get))&&(d.get=s),(s=i(m.set))&&(d.set=s),(s=i(m.init))&&o.unshift(s)}else(s=i(m))&&("field"===c?o.unshift(s):d[l]=s)}u&&Object.defineProperty(u,n.name,d),p=!0}function u(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}function d(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,s)}c((n=n.apply(e,t||[])).next())})}function y(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var m=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]};function g(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||m(t,e,r)}function w(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function E(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function v(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,o++)n[o]=a[i];return n}function S(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function A(e){return this instanceof A?(this.v=e,this):new A(e)}function _(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),i("next"),i("throw"),i("return",function(e){return function(t){return Promise.resolve(t).then(e,l)}}),n[Symbol.asyncIterator]=function(){return this},n;function i(e,t){o[e]&&(n[e]=function(t){return new Promise(function(r,n){a.push([e,t,r,n])>1||s(e,t)})},t&&(n[e]=t(n[e])))}function s(e,t){try{(r=o[e](t)).value instanceof A?Promise.resolve(r.value.v).then(c,l):u(a[0][2],r)}catch(e){u(a[0][3],e)}var r}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function O(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:A(e[n](t)),done:!1}:o?o(t):t}:o}}function C(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=w(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,o,(t=e[r](t)).done,t.value)})}}}function P(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var T=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},R=function(e){return R=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},R(e)};function k(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=R(e),n=0;n<r.length;n++)"default"!==r[n]&&m(t,e,r[n]);return T(t,e),t}function H(e){return e&&e.__esModule?e:{default:e}}function I(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)}function x(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}function D(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function L(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}var K="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function j(e){function t(t){e.error=e.hasError?new K(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function o(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(a).then(o,function(e){return t(e),o()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function N(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,r,n,o,a){return r?t?".jsx":".js":!n||o&&a?n+o+"."+a.toLowerCase()+"js":e}):e}const M={__extends:o,__assign:a,__rest:i,__decorate:s,__param:c,__esDecorate:l,__runInitializers:u,__propKey:d,__setFunctionName:p,__metadata:f,__awaiter:h,__generator:y,__createBinding:m,__exportStar:g,__values:w,__read:b,__spread:E,__spreadArrays:v,__spreadArray:S,__await:A,__asyncGenerator:_,__asyncDelegator:O,__asyncValues:C,__makeTemplateObject:P,__importStar:k,__importDefault:H,__classPrivateFieldGet:I,__classPrivateFieldSet:x,__classPrivateFieldIn:D,__addDisposableResource:L,__disposeResources:j,__rewriteRelativeImportExtension:N}},6634:function(e){e.exports=function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}return function t(r,n){function o(t,o,a){if("undefined"!=typeof document){"number"==typeof(a=e({},n,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var s in a)a[s]&&(i+="; "+s,!0!==a[s]&&(i+="="+a[s].split(";")[0]));return document.cookie=t+"="+r.write(o,t)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],n={},o=0;o<t.length;o++){var a=t[o].split("="),i=a.slice(1).join("=");try{var s=decodeURIComponent(a[0]);if(n[s]=r.read(i,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(t,r){o(t,"",e({},r,{expires:-1}))},withAttributes:function(r){return t(this.converter,e({},this.attributes,r))},withConverter:function(r){return t(e({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(r)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()},7764:(e,t,r)=>{"use strict";function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:i,toStringTag:s}=Symbol,c=(l=Object.create(null),e=>{const t=o.call(e);return l[t]||(l[t]=t.slice(8,-1).toLowerCase())});var l;const u=e=>(e=e.toLowerCase(),t=>c(t)===e),d=e=>t=>typeof t===e,{isArray:p}=Array,f=d("undefined");function h(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y=u("ArrayBuffer"),m=d("string"),g=d("function"),w=d("number"),b=e=>null!==e&&"object"==typeof e,E=e=>{if("object"!==c(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||s in e||i in e)},v=u("Date"),S=u("File"),A=u("Blob"),_=u("FileList"),O=u("URLSearchParams"),[C,P,T,R]=["ReadableStream","Request","Response","Headers"].map(u);function k(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),p(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(h(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(n=0;n<a;n++)i=o[n],t.call(null,e[i],i,e)}}function H(e,t){if(h(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,x=e=>!f(e)&&e!==I,D=(L="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>L&&e instanceof L);var L;const K=u("HTMLFormElement"),j=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),N=u("RegExp"),M=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};k(r,(r,o)=>{let a;!1!==(a=t(r,o,e))&&(n[o]=a||r)}),Object.defineProperties(e,n)},U=u("AsyncFunction"),W=(J="function"==typeof setImmediate,B=g(I.postMessage),J?setImmediate:B?(F=`axios@${Math.random()}`,$=[],I.addEventListener("message",({source:e,data:t})=>{e===I&&t===F&&$.length&&$.shift()()},!1),e=>{$.push(e),I.postMessage(F,"*")}):e=>setTimeout(e));var J,B,F,$;const G="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):"undefined"!=typeof process&&process.nextTick||W;var z={isArray:p,isArrayBuffer:y,isBuffer:h,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=c(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:m,isNumber:w,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:E,isEmptyObject:e=>{if(!b(e)||h(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:C,isRequest:P,isResponse:T,isHeaders:R,isUndefined:f,isDate:v,isFile:S,isBlob:A,isRegExp:N,isFunction:g,isStream:e=>b(e)&&g(e.pipe),isURLSearchParams:O,isTypedArray:D,isFileList:_,forEach:k,merge:function e(){const{caseless:t,skipUndefined:r}=x(this)&&this||{},n={},o=(o,a)=>{const i=t&&H(n,a)||a;E(n[i])&&E(o)?n[i]=e(n[i],o):E(o)?n[i]=e({},o):p(o)?n[i]=o.slice():r&&f(o)||(n[i]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&k(arguments[e],o);return n},extend:(e,t,r,{allOwnKeys:o}={})=>(k(t,(t,o)=>{r&&g(t)?e[o]=n(t,r):e[o]=t},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,s;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&a(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:u,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!w(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[i]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:K,hasOwnProperty:j,hasOwnProp:j,reduceDescriptors:M,freezeMethods:e=>{M(e,(t,r)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];g(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return p(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:H,global:I,isContextDefined:x,isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[s]&&e[i])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(b(e)){if(t.indexOf(e)>=0)return;if(h(e))return e;if(!("toJSON"in e)){t[n]=e;const o=p(e)?[]:{};return k(e,(e,t)=>{const a=r(e,n+1);!f(a)&&(o[t]=a)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:U,isThenable:e=>e&&(b(e)||g(e))&&g(e.then)&&g(e.catch),setImmediate:W,asap:G,isIterable:e=>null!=e&&g(e[i])};function V(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}z.inherits(V,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.status}}});const q=V.prototype,X={};function Y(e){return z.isPlainObject(e)||z.isArray(e)}function Z(e){return z.endsWith(e,"[]")?e.slice(0,-2):e}function Q(e,t,r){return e?e.concat(t).map(function(e,t){return e=Z(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{X[e]={value:e}}),Object.defineProperties(V,X),Object.defineProperty(q,"isAxiosError",{value:!0}),V.from=(e,t,r,n,o,a)=>{const i=Object.create(q);z.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return V.call(i,s,c,r,n,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",a&&Object.assign(i,a),i};const ee=z.toFlatObject(z,{},null,function(e){return/^is[A-Z]/.test(e)});function te(e,t,r){if(!z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!z.isUndefined(t[e])})).metaTokens,o=r.visitor||l,a=r.dots,i=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&z.isSpecCompliantForm(t);if(!z.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(z.isDate(e))return e.toISOString();if(z.isBoolean(e))return e.toString();if(!s&&z.isBlob(e))throw new V("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(e)||z.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,o){let s=e;if(e&&!o&&"object"==typeof e)if(z.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(z.isArray(e)&&function(e){return z.isArray(e)&&!e.some(Y)}(e)||(z.isFileList(e)||z.endsWith(r,"[]"))&&(s=z.toArray(e)))return r=Z(r),s.forEach(function(e,n){!z.isUndefined(e)&&null!==e&&t.append(!0===i?Q([r],n,a):null===i?r:r+"[]",c(e))}),!1;return!!Y(e)||(t.append(Q(o,r,a),c(e)),!1)}const u=[],d=Object.assign(ee,{defaultVisitor:l,convertValue:c,isVisitable:Y});if(!z.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!z.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),z.forEach(r,function(r,a){!0===(!(z.isUndefined(r)||null===r)&&o.call(t,r,z.isString(a)?a.trim():a,n,d))&&e(r,n?n.concat(a):[a])}),u.pop()}}(e),t}function re(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ne(e,t){this._pairs=[],e&&te(e,this,t)}const oe=ne.prototype;function ae(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ie(e,t,r){if(!t)return e;const n=r&&r.encode||ae;z.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let a;if(a=o?o(t,r):z.isURLSearchParams(t)?t.toString():new ne(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,re)}:re;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var se=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){z.forEach(this.handlers,function(t){null!==t&&e(t)})}},ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},le={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ne,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ue="undefined"!=typeof window&&"undefined"!=typeof document,de="object"==typeof navigator&&navigator||void 0,pe=ue&&(!de||["ReactNative","NativeScript","NS"].indexOf(de.product)<0),fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,he=ue&&window.location.href||"http://localhost";var ye={...Object.freeze({__proto__:null,hasBrowserEnv:ue,hasStandardBrowserWebWorkerEnv:fe,hasStandardBrowserEnv:pe,navigator:de,origin:he}),...le};function me(e){function t(e,r,n,o){let a=e[o++];if("__proto__"===a)return!0;const i=Number.isFinite(+a),s=o>=e.length;return a=!a&&z.isArray(n)?n.length:a,s?(z.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!i):(n[a]&&z.isObject(n[a])||(n[a]=[]),t(e,r,n[a],o)&&z.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let a;for(n=0;n<o;n++)a=r[n],t[a]=e[a];return t}(n[a])),!i)}if(z.isFormData(e)&&z.isFunction(e.entries)){const r={};return z.forEachEntry(e,(e,n)=>{t(function(e){return z.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const ge={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=z.isObject(e);if(o&&z.isHTMLForm(e)&&(e=new FormData(e)),z.isFormData(e))return n?JSON.stringify(me(e)):e;if(z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)||z.isReadableStream(e))return e;if(z.isArrayBufferView(e))return e.buffer;if(z.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new ye.classes.URLSearchParams,{visitor:function(e,t,r,n){return ye.isNode&&z.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((a=z.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e){if(z.isString(e))try{return(0,JSON.parse)(e),z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ge.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(z.isResponse(e)||z.isReadableStream(e))return e;if(e&&z.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw V.from(e,V.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],e=>{ge.headers[e]={}});var we=ge;const be=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ee=Symbol("internals");function ve(e){return e&&String(e).trim().toLowerCase()}function Se(e){return!1===e||null==e?e:z.isArray(e)?e.map(Se):String(e)}function Ae(e,t,r,n,o){return z.isFunction(n)?n.call(this,t,r):(o&&(t=r),z.isString(t)?z.isString(n)?-1!==t.indexOf(n):z.isRegExp(n)?n.test(t):void 0:void 0)}class _e{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=ve(t);if(!o)throw new Error("header name must be a non-empty string");const a=z.findKey(n,o);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=Se(e))}const a=(e,t)=>z.forEach(e,(e,r)=>o(e,r,t));if(z.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(z.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&be[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(z.isObject(e)&&z.isIterable(e)){let r,n,o={};for(const t of e){if(!z.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?z.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=ve(e)){const r=z.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(z.isFunction(t))return t.call(this,e,r);if(z.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ve(e)){const r=z.findKey(this,e);return!(!r||void 0===this[r]||t&&!Ae(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=ve(e)){const o=z.findKey(r,e);!o||t&&!Ae(0,r[o],o,t)||(delete r[o],n=!0)}}return z.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!Ae(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return z.forEach(this,(n,o)=>{const a=z.findKey(r,o);if(a)return t[a]=Se(n),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(o):String(o).trim();i!==o&&delete t[o],t[i]=Se(n),r[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return z.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&z.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Ee]=this[Ee]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ve(e);t[n]||(function(e,t){const r=z.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})})}(r,e),t[n]=!0)}return z.isArray(e)?e.forEach(n):n(e),this}}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),z.reduceDescriptors(_e.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),z.freezeMethods(_e);var Oe=_e;function Ce(e,t){const r=this||we,n=t||r,o=Oe.from(n.headers);let a=n.data;return z.forEach(e,function(e){a=e.call(r,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function Pe(e){return!(!e||!e.__CANCEL__)}function Te(e,t,r){V.call(this,null==e?"canceled":e,V.ERR_CANCELED,t,r),this.name="CanceledError"}function Re(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new V("Request failed with status code "+r.status,[V.ERR_BAD_REQUEST,V.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}z.inherits(Te,V,{__CANCEL__:!0});const ke=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,a=0,i=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),l=n[i];o||(o=c),r[a]=s,n[a]=c;let u=i,d=0;for(;u!==a;)d+=r[u++],u%=e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(r,a){let i,s,c=0,l=1e3/a;const u=(r,a=Date.now())=>{c=a,i=null,s&&(clearTimeout(s),s=null),(r=>{const a=r.loaded,i=r.lengthComputable?r.total:void 0,s=a-n,c=o(s);n=a,e({loaded:a,total:i,progress:i?a/i:void 0,bytes:s,rate:c||void 0,estimated:c&&i&&a<=i?(i-a)/c:void 0,event:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})})(...r)};return[(...e)=>{const t=Date.now(),r=t-c;r>=l?u(e,t):(i=e,s||(s=setTimeout(()=>{s=null,u(i)},l-r)))},()=>i&&u(i)]}(0,r)},He=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ie=e=>(...t)=>z.asap(()=>e(...t));var xe=ye.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ye.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,De=ye.hasStandardBrowserEnv?{write(e,t,r,n,o,a,i){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];z.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),z.isString(n)&&s.push(`path=${n}`),z.isString(o)&&s.push(`domain=${o}`),!0===a&&s.push("secure"),z.isString(i)&&s.push(`SameSite=${i}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Le(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ke=e=>e instanceof Oe?{...e}:e;function je(e,t){t=t||{};const r={};function n(e,t,r,n){return z.isPlainObject(e)&&z.isPlainObject(t)?z.merge.call({caseless:n},e,t):z.isPlainObject(t)?z.merge({},t):z.isArray(t)?t.slice():t}function o(e,t,r,o){return z.isUndefined(t)?z.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function a(e,t){if(!z.isUndefined(t))return n(void 0,t)}function i(e,t){return z.isUndefined(t)?z.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,a){return a in t?n(r,o):a in e?n(void 0,r):void 0}const c={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(e,t,r)=>o(Ke(e),Ke(t),0,!0)};return z.forEach(Object.keys({...e,...t}),function(n){const a=c[n]||o,i=a(e[n],t[n],n);z.isUndefined(i)&&a!==s||(r[n]=i)}),r}var Ne=e=>{const t=je({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:a,headers:i,auth:s}=t;if(t.headers=i=Oe.from(i),t.url=ie(Le(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&i.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),z.isFormData(r))if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(z.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&i.set(e,r)})}if(ye.hasStandardBrowserEnv&&(n&&z.isFunction(n)&&(n=n(t)),n||!1!==n&&xe(t.url))){const e=o&&a&&De.read(a);e&&i.set(o,e)}return t},Me="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=Ne(e);let o=n.data;const a=Oe.from(n.headers).normalize();let i,s,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=n;function h(){l&&l(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let y=new XMLHttpRequest;function m(){if(!y)return;const n=Oe.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Re(function(e){t(e),h()},function(e){r(e),h()},{data:d&&"text"!==d&&"json"!==d?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:e,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(r(new V("Request aborted",V.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const n=new V(t&&t.message?t.message:"Network Error",V.ERR_NETWORK,e,y);n.event=t||null,r(n),y=null},y.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||ce;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new V(t,o.clarifyTimeoutError?V.ETIMEDOUT:V.ECONNABORTED,e,y)),y=null},void 0===o&&a.setContentType(null),"setRequestHeader"in y&&z.forEach(a.toJSON(),function(e,t){y.setRequestHeader(t,e)}),z.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),d&&"json"!==d&&(y.responseType=n.responseType),f&&([c,u]=ke(f,!0),y.addEventListener("progress",c)),p&&y.upload&&([s,l]=ke(p),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(i=t=>{y&&(r(!t||t.type?new Te(null,e,y):t),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===ye.protocols.indexOf(g)?r(new V("Unsupported protocol "+g+":",V.ERR_BAD_REQUEST,e)):y.send(o||null)})},Ue=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof V?t:new Te(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,o(new V(`timeout ${t} of ms exceeded`,V.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=n;return s.unsubscribe=()=>z.asap(i),s}};const We=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},Je=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*We(r,t)}(e,t);let a,i=0,s=e=>{a||(a=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return s(),void e.close();let a=n.byteLength;if(r){let e=i+=a;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:Be}=z,Fe=(({Request:e,Response:t})=>({Request:e,Response:t}))(z.global),{ReadableStream:$e,TextEncoder:Ge}=z.global,ze=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ve=e=>{e=z.merge.call({skipUndefined:!0},Fe,e);const{fetch:t,Request:r,Response:n}=e,o=t?Be(t):"function"==typeof fetch,a=Be(r),i=Be(n);if(!o)return!1;const s=o&&Be($e),c=o&&("function"==typeof Ge?(l=new Ge,e=>l.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var l;const u=a&&s&&ze(()=>{let e=!1;const t=new r(ye.origin,{body:new $e,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=i&&s&&ze(()=>z.isReadableStream(new n("").body)),p={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new V(`Response type '${e}' is not supported`,V.ERR_NOT_SUPPORT,r)})});return async e=>{let{url:o,method:i,data:s,signal:l,cancelToken:f,timeout:h,onDownloadProgress:y,onUploadProgress:m,responseType:g,headers:w,withCredentials:b="same-origin",fetchOptions:E}=Ne(e),v=t||fetch;g=g?(g+"").toLowerCase():"text";let S=Ue([l,f&&f.toAbortSignal()],h),A=null;const _=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let O;try{if(m&&u&&"get"!==i&&"head"!==i&&0!==(O=await(async(e,t)=>{const n=z.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(z.isBlob(e))return e.size;if(z.isSpecCompliantForm(e)){const t=new r(ye.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return z.isArrayBufferView(e)||z.isArrayBuffer(e)?e.byteLength:(z.isURLSearchParams(e)&&(e+=""),z.isString(e)?(await c(e)).byteLength:void 0)})(t):n})(w,s))){let e,t=new r(o,{method:"POST",body:s,duplex:"half"});if(z.isFormData(s)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,r]=He(O,ke(Ie(m)));s=Je(t.body,65536,e,r)}}z.isString(b)||(b=b?"include":"omit");const t=a&&"credentials"in r.prototype,l={...E,signal:S,method:i.toUpperCase(),headers:w.normalize().toJSON(),body:s,duplex:"half",credentials:t?b:void 0};A=a&&new r(o,l);let f=await(a?v(A,E):v(o,l));const h=d&&("stream"===g||"response"===g);if(d&&(y||h&&_)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=f[t]});const t=z.toFiniteNumber(f.headers.get("content-length")),[r,o]=y&&He(t,ke(Ie(y),!0))||[];f=new n(Je(f.body,65536,r,()=>{o&&o(),_&&_()}),e)}g=g||"text";let C=await p[z.findKey(p,g)||"text"](f,e);return!h&&_&&_(),await new Promise((t,r)=>{Re(t,r,{data:C,headers:Oe.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:A})})}catch(t){if(_&&_(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new V("Network Error",V.ERR_NETWORK,e,A),{cause:t.cause||t});throw V.from(t,t&&t.code,e,A)}}},qe=new Map,Xe=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,a=[n,o,r];let i,s,c=a.length,l=qe;for(;c--;)i=a[c],s=l.get(i),void 0===s&&l.set(i,s=c?new Map:Ve(t)),l=s;return s};Xe();const Ye={http:null,xhr:Me,fetch:{get:Xe}};z.forEach(Ye,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Ze=e=>`- ${e}`,Qe=e=>z.isFunction(e)||null===e||!1===e;var et=function(e,t){e=z.isArray(e)?e:[e];const{length:r}=e;let n,o;const a={};for(let i=0;i<r;i++){let r;if(n=e[i],o=n,!Qe(n)&&(o=Ye[(r=String(n)).toLowerCase()],void 0===o))throw new V(`Unknown adapter '${r}'`);if(o&&(z.isFunction(o)||(o=o.get(t))))break;a[r||"#"+i]=o}if(!o){const e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new V("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(Ze).join("\n"):" "+Ze(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function tt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Te(null,e)}function rt(e){return tt(e),e.headers=Oe.from(e.headers),e.data=Ce.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),et(e.adapter||we.adapter,e)(e).then(function(t){return tt(e),t.data=Ce.call(e,e.transformResponse,t),t.headers=Oe.from(t.headers),t},function(t){return Pe(t)||(tt(e),t&&t.response&&(t.response.data=Ce.call(e,e.transformResponse,t.response),t.response.headers=Oe.from(t.response.headers))),Promise.reject(t)})}const nt="1.13.0",ot={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ot[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const at={};ot.transitional=function(e,t,r){function n(e,t){return"[Axios v"+nt+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,a)=>{if(!1===e)throw new V(n(o," has been removed"+(t?" in "+t:"")),V.ERR_DEPRECATED);return t&&!at[o]&&(at[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,a)}},ot.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var it={assertOptions:function(e,t,r){if("object"!=typeof e)throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const a=n[o],i=t[a];if(i){const t=e[a],r=void 0===t||i(t,a,e);if(!0!==r)throw new V("option "+a+" must be "+r,V.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new V("Unknown option "+a,V.ERR_BAD_OPTION)}},validators:ot};const st=it.validators;class ct{constructor(e){this.defaults=e||{},this.interceptors={request:new se,response:new se}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=je(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&it.assertOptions(r,{silentJSONParsing:st.transitional(st.boolean),forcedJSONParsing:st.transitional(st.boolean),clarifyTimeoutError:st.transitional(st.boolean)},!1),null!=n&&(z.isFunction(n)?t.paramsSerializer={serialize:n}:it.assertOptions(n,{encode:st.function,serialize:st.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),it.assertOptions(t,{baseUrl:st.spelling("baseURL"),withXsrfToken:st.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&z.merge(o.common,o[t.method]);o&&z.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Oe.concat(a,o);const i=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!s){const e=[rt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let p=t;for(;d<u;){const e=i[d++],t=i[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=rt.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return ie(Le((e=je(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}z.forEach(["delete","get","head","options"],function(e){ct.prototype[e]=function(t,r){return this.request(je(r||{},{method:e,url:t,data:(r||{}).data}))}}),z.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,o){return this.request(je(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ct.prototype[e]=t(),ct.prototype[e+"Form"]=t(!0)});var lt=ct;class ut{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new Te(e,n,o),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ut(function(t){e=t}),cancel:e}}}var dt=ut;const pt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pt).forEach(([e,t])=>{pt[t]=e});var ft=pt;const ht=function e(t){const r=new lt(t),o=n(lt.prototype.request,r);return z.extend(o,lt.prototype,r,{allOwnKeys:!0}),z.extend(o,r,null,{allOwnKeys:!0}),o.create=function(r){return e(je(t,r))},o}(we);ht.Axios=lt,ht.CanceledError=Te,ht.CancelToken=dt,ht.isCancel=Pe,ht.VERSION=nt,ht.toFormData=te,ht.AxiosError=V,ht.Cancel=ht.CanceledError,ht.all=function(e){return Promise.all(e)},ht.spread=function(e){return function(t){return e.apply(null,t)}},ht.isAxiosError=function(e){return z.isObject(e)&&!0===e.isAxiosError},ht.mergeConfig=je,ht.AxiosHeaders=Oe,ht.formToJSON=e=>me(z.isHTMLForm(e)?new FormData(e):e),ht.getAdapter=et,ht.HttpStatusCode=ft,ht.default=ht,e.exports=ht},7792:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c,useDeepCompareEffectNoCheck:()=>l,useDeepCompareMemoize:()=>s});var n=r(9155),o=Object.prototype.hasOwnProperty;function a(e,t,r){for(r of e.keys())if(i(r,t))return r}function i(e,t){var r,n,s;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&i(e[n],t[n]););return-1===n}if(r===Set){if(e.size!==t.size)return!1;for(n of e){if((s=n)&&"object"==typeof s&&!(s=a(t,s)))return!1;if(!t.has(s))return!1}return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e){if((s=n[0])&&"object"==typeof s&&!(s=a(t,s)))return!1;if(!i(n[1],t.get(s)))return!1}return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return-1===n}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}if(!r||"object"==typeof e){for(r in n=0,e){if(o.call(e,r)&&++n&&!o.call(t,r))return!1;if(!(r in t)||!i(e[r],t[r]))return!1}return Object.keys(t).length===n}}return e!=e&&t!=t}function s(e){var t=n.useRef(e),r=n.useRef(0);return i(e,t.current)||(t.current=e,r.current+=1),n.useMemo(function(){return t.current},[r.current])}function c(e,t){return n.useEffect(e,s(t))}function l(e,t){return n.useEffect(e,s(t))}},8792:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!==o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!==o--;){var i=a[o];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r}},9358:e=>{e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t),r.d(t,"validateHTMLColorName",function(){return i}),r.d(t,"validateHTMLColorSpecialName",function(){return s}),r.d(t,"validateHTMLColorHex",function(){return c}),r.d(t,"validateHTMLColorRgb",function(){return y}),r.d(t,"validateHTMLColorHsl",function(){return m}),r.d(t,"validateHTMLColorHwb",function(){return g}),r.d(t,"validateHTMLColorLab",function(){return w}),r.d(t,"validateHTMLColorLch",function(){return b}),r.d(t,"validateHTMLColor",function(){return E});const n=e=>e&&"string"==typeof e,o=["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenrod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","Goldenrod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenrodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquamarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenrod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],a=["currentColor","inherit","transparent"],i=e=>{let t=!1;return n(e)&&o.map(r=>(e.toLowerCase()===r.toLowerCase()&&(t=!0),null)),t},s=e=>{let t=!1;return n(e)&&a.map(r=>(e.toLowerCase()===r.toLowerCase()&&(t=!0),null)),t},c=e=>!!n(e)&&(e&&/^#([\da-f]{3}){1,2}$|^#([\da-f]{4}){1,2}$/i.test(e)),l="(([\\d]{0,5})((\\.([\\d]{1,5}))?))",u=`(${l}%)`,d="(([0-9]|[1-9][0-9]|100)%)",p=`(${d}|(0?((\\.([\\d]{1,5}))?))|1)`,f=`([\\s]{0,5})\\)?)(([\\s]{0,5})(\\/?)([\\s]{1,5})(((${d}))|(0?((\\.([\\d]{1,5}))?))|1))?([\\s]{0,5})\\)`,h="(-?(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9])((\\.([\\d]{1,5}))?)|360)(deg)?)",y=e=>{if(n(e)){const t="([\\s]{0,5})([\\d]{1,5})%?([\\s]{0,5}),?",r="((([\\s]{0,5}),?([\\s]{0,5}))|(([\\s]{1,5})))",n=new RegExp(`^(rgb)a?\\(${t}${r}${t}${r}${t}${r}((\\/?([\\s]{0,5})(0?\\.?([\\d]{1,5})%?([\\s]{0,5}))?|1|0))?\\)$`);return e&&n.test(e)}return!1},m=e=>{if(n(e)){const t=new RegExp(`^(hsl)a?\\((([\\s]{0,5})(${h}|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-9][0-9]|400)grad)|((([0-5])?\\.([\\d]{1,5})|6\\.([0-9]|1[0-9]|2[0-8])|[0-6])rad)|((0?((\\.([\\d]{1,5}))?)|1)turn))((([\\s]{0,5}),([\\s]{0,5}))|(([\\s]{1,5}))))(([\\s]{0,5})(0|${d})((([\\s]{0,5}),([\\s]{0,5}))|(([\\s]{1,5}))))(([\\s]{0,5})(0|${d})([\\s]{0,5})\\)?)(([\\s]{0,5})(\\/?|,?)([\\s]{0,5})(((${d}))|(0?((\\.([\\d]{1,5}))?))|1))?\\)$`);return e&&t.test(e)}return!1},g=e=>{if(n(e)){const t=new RegExp(`^(hwb\\(([\\s]{0,5})${h}([\\s]{1,5}))((0|${d})([\\s]{1,5}))((0|${d})${f}$`);return e&&t.test(e)}return!1},w=e=>{if(n(e)){const t="(-?(([0-9]|[1-9][0-9]|1[0-5][0-9])((\\.([\\d]{1,5}))?)?|160))",r=new RegExp(`^(lab\\(([\\s]{0,5})${u}([\\s]{1,5})${t}([\\s]{1,5})${t}${f}$`);return e&&r.test(e)}return!1},b=e=>{if(n(e)){const t=new RegExp(`^lch\\((([\\s]{0,5})((([0-9]|[1-9][0-9])?((\\.([\\d]{1,5}))?)|100)(%)?)([\\s]{1,5})${""+l}([\\s]{1,5})((${h})|(0|${p})|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9])((\\.([\\d]{1,5}))?)|360))([\\s]{0,5})((\\/([\\s]{0,5})${p}))?)\\)$`);return e&&t.test(e)}return!1},E=e=>!!(e&&c(e)||y(e)||m(e)||g(e)||w(e)||b(e));t.default=e=>!!(e&&c(e)||i(e)||s(e)||y(e)||m(e)||g(e)||w(e)||b(e))}])}}]);
@@ -1,3 +1,3 @@
1
1
  /*! (c) 2023 - present: Quentral Srl | https://github.com/selfcommunity/community-js/blob/master/LICENSE.md */
2
2
 
3
- /*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors */
3
+ /*! Axios v1.13.0 Copyright (c) 2025 Matt Zabriskie and contributors */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selfcommunity/react-core",
3
- "version": "0.7.0-mui7.25+35748e884",
3
+ "version": "0.7.0-mui7.27+042d19046",
4
4
  "description": "React Core Components useful for integrating UI Community components (react-ui).",
5
5
  "author": "SelfCommunity <https://www.selfcommunity.com>",
6
6
  "homepage": "https://www.selfcommunity.com",
@@ -65,13 +65,13 @@
65
65
  "notistack": "^3.0.1",
66
66
  "react": "^19.2.0",
67
67
  "react-dom": "^19.2.0",
68
- "react-intl": "^6.4.7"
68
+ "react-intl": "^6.8.9"
69
69
  },
70
70
  "dependencies": {
71
- "@selfcommunity/api-services": "0.7.0-mui7.25+35748e884",
72
- "@selfcommunity/react-i18n": "0.8.0-mui7.48+35748e884",
73
- "@selfcommunity/types": "0.8.0-mui7.25+35748e884",
74
- "@selfcommunity/utils": "0.2.64-mui7.125+35748e884",
71
+ "@selfcommunity/api-services": "0.7.0-mui7.27+042d19046",
72
+ "@selfcommunity/react-i18n": "0.8.0-mui7.50+042d19046",
73
+ "@selfcommunity/types": "0.8.0-mui7.27+042d19046",
74
+ "@selfcommunity/utils": "0.2.64-mui7.127+042d19046",
75
75
  "js-cookie": "^3.0.5",
76
76
  "pubsub-js": "^1.9.5",
77
77
  "use-deep-compare-effect": "^1.8.1",
@@ -130,5 +130,5 @@
130
130
  "bugs": {
131
131
  "url": "https://github.com/selfcommunity/community-js/issues"
132
132
  },
133
- "gitHead": "35748e884a09edc780a7a8f8f7e2bdf5bbadbc32"
133
+ "gitHead": "042d19046d13fc49489408504670834814b6d1d0"
134
134
  }