@neurodyn/spin-viewer 0.0.0-canary-20260901162651
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/README.md +48 -0
- package/dist/spin-viewer.embed.min.js +158 -0
- package/dist/spin-viewer.embed.min.js.LICENSE.txt +11 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# `@neurodyn/spin-viewer`
|
|
2
|
+
|
|
3
|
+
Framework-independent 360° product viewer distributed as a self-registering
|
|
4
|
+
CDN script.
|
|
5
|
+
|
|
6
|
+
## Embed
|
|
7
|
+
|
|
8
|
+
```html
|
|
9
|
+
<neurodyn-spin-viewer
|
|
10
|
+
api-key="pk_live_..."
|
|
11
|
+
public-id="product-public-id"
|
|
12
|
+
variation-id="optional-variation-uuid"
|
|
13
|
+
></neurodyn-spin-viewer>
|
|
14
|
+
|
|
15
|
+
<script src="https://cdn.neurodyn.ai/@neurodyn/spin-viewer/dist/spin-viewer.embed.min.js"></script>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The element has a 4:3 footprint and fills the available width. `api-key` and
|
|
19
|
+
`public-id` are required. Updating either attribute reloads the 360° View;
|
|
20
|
+
updating `variation-id` after the viewer becomes ready performs a Variation
|
|
21
|
+
swap.
|
|
22
|
+
|
|
23
|
+
## Zoom control
|
|
24
|
+
|
|
25
|
+
The built-in control is enabled by default. Hide it without disabling image
|
|
26
|
+
click/tap zoom:
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<neurodyn-spin-viewer controls=""></neurodyn-spin-viewer>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
An external control can call `zoomIn()` and `zoomStop()`. The built-in button
|
|
33
|
+
exposes `part="zoom-in"` or `part="zoom-out"`:
|
|
34
|
+
|
|
35
|
+
```css
|
|
36
|
+
neurodyn-spin-viewer::part(zoom-in),
|
|
37
|
+
neurodyn-spin-viewer::part(zoom-out) {
|
|
38
|
+
color: #111;
|
|
39
|
+
background: #fff;
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## State and events
|
|
44
|
+
|
|
45
|
+
`data-state` is `loading`, `ready`, or `error`. The element emits bubbling,
|
|
46
|
+
composed `ready`, `error`, `frame-change`, `spin-start`, `spin-end`, and
|
|
47
|
+
`zoom-change` events. Error details are deliberately normalized and never
|
|
48
|
+
include API keys, image URLs, backend messages, or stack traces.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/*! For license information please see spin-viewer.embed.min.js.LICENSE.txt */
|
|
2
|
+
(()=>{"use strict";let e,t,r,i;var n,o,s,a,l,u,c,h,d,p,f,m,g,y,b,v,w,_,E,S,A,$,O,R,C,x={};x.d=(e,t)=>{for(var r in t)x.o(t,r)&&!x.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},x.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),x.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var P={};x.r(P),x.d(P,{hasBrowserEnv:()=>tk,hasStandardBrowserEnv:()=>tF,hasStandardBrowserWebWorkerEnv:()=>tN,navigator:()=>tj,origin:()=>tL});let T=globalThis,U=T.ShadowRoot&&(void 0===T.ShadyCSS||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,z=Symbol(),k=new WeakMap;class j{constructor(e,t,r){if(this._$cssResult$=!0,r!==z)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(U&&void 0===e){let r=void 0!==t&&1===t.length;r&&(e=k.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&k.set(t,e))}return e}toString(){return this.cssText}}let F=(e,...t)=>new j(1===e.length?e[0]:t.reduce((t,r,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+e[i+1],e[0]),e,z),N=U?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t,r="";for(let t of e.cssRules)r+=t.cssText;return new j("string"==typeof(t=r)?t:t+"",void 0,z)})(e):e,{is:L,defineProperty:I,getOwnPropertyDescriptor:M,getOwnPropertyNames:B,getOwnPropertySymbols:D,getPrototypeOf:q}=Object,H=globalThis,W=H.trustedTypes,K=W?W.emptyScript:"",J=H.reactiveElementPolyfillSupport,V={toAttribute(e,t){switch(t){case Boolean:e=e?K:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},Z=(e,t)=>!L(e,t),X={attribute:!0,type:String,converter:V,reflect:!1,useDefault:!1,hasChanged:Z};Symbol.metadata??=Symbol("metadata"),H.litPropertyMetadata??=new WeakMap;class Y extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=X){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);void 0!==i&&I(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){let{get:i,set:n}=M(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){let o=i?.call(this);n?.call(this,t),this.requestUpdate(e,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??X}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let e=q(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...B(e),...D(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,r]of t)this.elementProperties.set(e,r)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let r of new Set(e.flat(1/0).reverse()))t.unshift(N(r));else void 0!==e&&t.push(N(e));return t}static _$Eu(e,t){let r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(U)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let r of t){let t=document.createElement("style"),i=T.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=r.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(void 0!==i&&!0===r.reflect){let n=(void 0!==r.converter?.toAttribute?r.converter:V).toAttribute(t,r.type);this._$Em=e,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){let r=this.constructor,i=r._$Eh.get(e);if(void 0!==i&&this._$Em!==i){let e=r.getPropertyOptions(i),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:V;this._$Em=i;let o=n.fromAttribute(t,e.type);this[i]=o??this._$Ej?.get(i)??o,this._$Em=null}}requestUpdate(e,t,r,i=!1,n){if(void 0!==e){let o=this.constructor;if(!1===i&&(n=this[e]),!(((r??=o.getPropertyOptions(e)).hasChanged??Z)(n,t)||r.useDefault&&r.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,r))))return;this.C(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:i,wrapped:n},o){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),!0!==n||void 0!==o)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,r]of e){let{wrapped:e}=r,i=this[t];!0!==e||this._$AL.has(t)||void 0===i||this.C(t,void 0,r,i)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}}Y.elementStyles=[],Y.shadowRootOptions={mode:"open"},Y.elementProperties=new Map,Y.finalized=new Map,J?.({ReactiveElement:Y}),(H.reactiveElementVersions??=[]).push("2.1.2");let G=globalThis,Q=e=>e,ee=G.trustedTypes,et=ee?ee.createPolicy("lit-html",{createHTML:e=>e}):void 0,er="$lit$",ei=`lit$${Math.random().toFixed(9).slice(2)}$`,en="?"+ei,eo=`<${en}>`,es=document,ea=()=>es.createComment(""),el=e=>null===e||"object"!=typeof e&&"function"!=typeof e,eu=Array.isArray,ec="[ \n\f\r]",eh=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ed=/-->/g,ep=/>/g,ef=RegExp(`>|${ec}(?:([^\\s"'>=/]+)(${ec}*=${ec}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),em=/'/g,eg=/"/g,ey=/^(?:script|style|textarea|title)$/i,eb=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),ev=eb(1),ew=(eb(2),eb(3),Symbol.for("lit-noChange")),e_=Symbol.for("lit-nothing"),eE=new WeakMap,eS=es.createTreeWalker(es,129);function eA(e,t){if(!eu(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==et?et.createHTML(t):t}class e${constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let n=0,o=0;const s=e.length-1,a=this.parts,[l,u]=((e,t)=>{let r=e.length-1,i=[],n,o=2===t?"<svg>":3===t?"<math>":"",s=eh;for(let t=0;t<r;t++){let r=e[t],a,l,u=-1,c=0;for(;c<r.length&&(s.lastIndex=c,null!==(l=s.exec(r)));)c=s.lastIndex,s===eh?"!--"===l[1]?s=ed:void 0!==l[1]?s=ep:void 0!==l[2]?(ey.test(l[2])&&(n=RegExp("</"+l[2],"g")),s=ef):void 0!==l[3]&&(s=ef):s===ef?">"===l[0]?(s=n??eh,u=-1):void 0===l[1]?u=-2:(u=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?ef:'"'===l[3]?eg:em):s===eg||s===em?s=ef:s===ed||s===ep?s=eh:(s=ef,n=void 0);let h=s===ef&&e[t+1].startsWith("/>")?" ":"";o+=s===eh?r+eo:u>=0?(i.push(a),r.slice(0,u)+er+r.slice(u)+ei+h):r+ei+(-2===u?t:h)}return[eA(e,o+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]})(e,t);if(this.el=e$.createElement(l,r),eS.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=eS.nextNode())&&a.length<s;){if(1===i.nodeType){if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(er)){const t=u[o++],r=i.getAttribute(e).split(ei),s=/([.?@])?(.*)/.exec(t);a.push({type:1,index:n,name:s[2],strings:r,ctor:"."===s[1]?eP:"?"===s[1]?eT:"@"===s[1]?eU:ex}),i.removeAttribute(e)}else e.startsWith(ei)&&(a.push({type:6,index:n}),i.removeAttribute(e));if(ey.test(i.tagName)){const e=i.textContent.split(ei),t=e.length-1;if(t>0){i.textContent=ee?ee.emptyScript:"";for(let r=0;r<t;r++)i.append(e[r],ea()),eS.nextNode(),a.push({type:2,index:++n});i.append(e[t],ea())}}}else if(8===i.nodeType)if(i.data===en)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=i.data.indexOf(ei,e+1));)a.push({type:7,index:n}),e+=ei.length-1}n++}}static createElement(e,t){let r=es.createElement("template");return r.innerHTML=e,r}}function eO(e,t,r=e,i){if(t===ew)return t;let n=void 0!==i?r._$Co?.[i]:r._$Cl,o=el(t)?void 0:t._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(e))._$AT(e,r,i),void 0!==i?(r._$Co??=[])[i]=n:r._$Cl=n),void 0!==n&&(t=eO(e,n._$AS(e,t.values),n,i)),t}class eR{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??es).importNode(t,!0);eS.currentNode=i;let n=eS.nextNode(),o=0,s=0,a=r[0];for(;void 0!==a;){if(o===a.index){let t;2===a.type?t=new eC(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new ez(n,this,e)),this._$AV.push(t),a=r[++s]}o!==a?.index&&(n=eS.nextNode(),o++)}return eS.currentNode=es,i}p(e){let t=0;for(let r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class eC{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=e_,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){let r;el(e=eO(this,e,t))?e===e_||null==e||""===e?(this._$AH!==e_&&this._$AR(),this._$AH=e_):e!==this._$AH&&e!==ew&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):eu(r=e)||"function"==typeof r?.[Symbol.iterator]?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==e_&&el(this._$AH)?this._$AA.nextSibling.data=e:this.T(es.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,i="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=e$.createElement(eA(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{let e=new eR(i,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=eE.get(e.strings);return void 0===t&&eE.set(e.strings,t=new e$(e)),t}k(e){eu(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let n of e)i===t.length?t.push(r=new eC(this.O(ea()),this.O(ea()),this,this.options)):r=t[i],r._$AI(n),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=Q(e).nextSibling;Q(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ex{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,n){this.type=1,this._$AH=e_,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=n,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=e_}_$AI(e,t=this,r,i){let n=this.strings,o=!1;if(void 0===n)(o=!el(e=eO(this,e,t,0))||e!==this._$AH&&e!==ew)&&(this._$AH=e);else{let i,s,a=e;for(e=n[0],i=0;i<n.length-1;i++)(s=eO(this,a[r+i],t,i))===ew&&(s=this._$AH[i]),o||=!el(s)||s!==this._$AH[i],s===e_?e=e_:e!==e_&&(e+=(s??"")+n[i+1]),this._$AH[i]=s}o&&!i&&this.j(e)}j(e){e===e_?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class eP extends ex{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===e_?void 0:e}}class eT extends ex{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==e_)}}class eU extends ex{constructor(e,t,r,i,n){super(e,t,r,i,n),this.type=5}_$AI(e,t=this){if((e=eO(this,e,t,0)??e_)===ew)return;let r=this._$AH,i=e===e_&&r!==e_||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==e_&&(r===e_||i);i&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ez{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){eO(this,e)}}let ek=G.litHtmlPolyfillSupport;ek?.(e$,eC),(G.litHtmlVersions??=[]).push("3.3.2");let ej=globalThis;class eF extends Y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,r)=>{let i=r?.renderBefore??t,n=i._$litPart$;if(void 0===n){let e=r?.renderBefore??null;i._$litPart$=n=new eC(t.insertBefore(ea(),e),e,void 0,r??{})}return n._$AI(e),n})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ew}}eF._$litElement$=!0,eF.finalized=!0,ej.litElementHydrateSupport?.({LitElement:eF});let eN=ej.litElementPolyfillSupport;eN?.({LitElement:eF}),(ej.litElementVersions??=[]).push("4.2.2");let eL={attribute:!0,type:String,converter:V,reflect:!1,hasChanged:Z};function eI(e){return(t,r)=>{let i;return"object"==typeof r?((e=eL,t,r)=>{let{kind:i,metadata:n}=r,o=globalThis.litPropertyMetadata.get(n);if(void 0===o&&globalThis.litPropertyMetadata.set(n,o=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),o.set(r.name,e),"accessor"===i){let{name:i}=r;return{set(r){let n=t.get.call(this);t.set.call(this,r),this.requestUpdate(i,n,e,!0,r)},init(t){return void 0!==t&&this.C(i,void 0,e,t),t}}}if("setter"===i){let{name:i}=r;return function(r){let n=this[i];t.call(this,r),this.requestUpdate(i,n,e,!0,r)}}throw Error("Unsupported decorator location: "+i)})(e,t,r):(i=t.hasOwnProperty(r),t.constructor.createProperty(r,e),i?Object.getOwnPropertyDescriptor(t,r):void 0)}}function eM(e){return eI({...e,state:!0,attribute:!1})}function eB(e,t){return function(){return e.apply(t,arguments)}}let{toString:eD}=Object.prototype,{getPrototypeOf:eq}=Object,{iterator:eH,toStringTag:eW}=Symbol,eK=(e=Object.create(null),t=>{let r=eD.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}),eJ=e=>(e=e.toLowerCase(),t=>eK(t)===e),eV=e=>t=>typeof t===e,{isArray:eZ}=Array,eX=eV("undefined");function eY(e){return null!==e&&!eX(e)&&null!==e.constructor&&!eX(e.constructor)&&e0(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let eG=eJ("ArrayBuffer"),eQ=eV("string"),e0=eV("function"),e1=eV("number"),e2=e=>null!==e&&"object"==typeof e,e5=e=>{if("object"!==eK(e))return!1;let t=eq(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(eW in e)&&!(eH in e)},e4=eJ("Date"),e3=eJ("File"),e6=eJ("Blob"),e8=eJ("FileList"),e7=eJ("URLSearchParams"),[e9,te,tt,tr]=["ReadableStream","Request","Response","Headers"].map(eJ);function ti(e,t,{allOwnKeys:r=!1}={}){let i,n;if(null!=e)if("object"!=typeof e&&(e=[e]),eZ(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{let n;if(eY(e))return;let o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;for(i=0;i<s;i++)n=o[i],t.call(null,e[n],n,e)}}function tn(e,t){let r;if(eY(e))return null;t=t.toLowerCase();let i=Object.keys(e),n=i.length;for(;n-- >0;)if(t===(r=i[n]).toLowerCase())return r;return null}let to="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,ts=e=>!eX(e)&&e!==to,ta=(t="u">typeof Uint8Array&&eq(Uint8Array),e=>t&&e instanceof t),tl=eJ("HTMLFormElement"),tu=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),tc=eJ("RegExp"),th=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};ti(r,(r,n)=>{let o;!1!==(o=t(r,n,e))&&(i[n]=o||r)}),Object.defineProperties(e,i)},td=eJ("AsyncFunction"),tp=(n="function"==typeof setImmediate,o=e0(to.postMessage),n?setImmediate:o?(s=`axios@${Math.random()}`,a=[],to.addEventListener("message",({source:e,data:t})=>{e===to&&t===s&&a.length&&a.shift()()},!1),e=>{a.push(e),to.postMessage(s,"*")}):e=>setTimeout(e)),tf="u">typeof queueMicrotask?queueMicrotask.bind(to):"u">typeof process&&process.nextTick||tp,tm={isArray:eZ,isArrayBuffer:eG,isBuffer:eY,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||e0(e.append)&&("formdata"===(t=eK(e))||"object"===t&&e0(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&eG(e.buffer)},isString:eQ,isNumber:e1,isBoolean:e=>!0===e||!1===e,isObject:e2,isPlainObject:e5,isEmptyObject:e=>{if(!e2(e)||eY(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:e9,isRequest:te,isResponse:tt,isHeaders:tr,isUndefined:eX,isDate:e4,isFile:e3,isBlob:e6,isRegExp:tc,isFunction:e0,isStream:e=>e2(e)&&e0(e.pipe),isURLSearchParams:e7,isTypedArray:ta,isFileList:e8,forEach:ti,merge:function e(){let{caseless:t,skipUndefined:r}=ts(this)&&this||{},i={},n=(n,o)=>{let s=t&&tn(i,o)||o;e5(i[s])&&e5(n)?i[s]=e(i[s],n):e5(n)?i[s]=e({},n):eZ(n)?i[s]=n.slice():r&&eX(n)||(i[s]=n)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ti(arguments[e],n);return i},extend:(e,t,r,{allOwnKeys:i}={})=>(ti(t,(t,i)=>{r&&e0(t)?e[i]=eB(t,r):e[i]=t},{allOwnKeys:i}),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,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,i)=>{let n,o,s,a={};if(t=t||{},null==e)return t;do{for(o=(n=Object.getOwnPropertyNames(e)).length;o-- >0;)s=n[o],(!i||i(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=!1!==r&&eq(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:eK,kindOfTest:eJ,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;let i=e.indexOf(t,r);return -1!==i&&i===r},toArray:e=>{if(!e)return null;if(eZ(e))return e;let t=e.length;if(!e1(t))return null;let r=Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{let r,i=(e&&e[eH]).call(e);for(;(r=i.next())&&!r.done;){let i=r.value;t.call(e,i[0],i[1])}},matchAll:(e,t)=>{let r,i=[];for(;null!==(r=e.exec(t));)i.push(r);return i},isHTMLForm:tl,hasOwnProperty:tu,hasOwnProp:tu,reduceDescriptors:th,freezeMethods:e=>{th(e,(t,r)=>{if(e0(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;if(e0(e[r])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet:(e,t)=>{let r={};return(eZ(e)?e:String(e).split(t)).forEach(e=>{r[e]=!0}),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*=1)?e:t,findKey:tn,global:to,isContextDefined:ts,isSpecCompliantForm:function(e){return!!(e&&e0(e.append)&&"FormData"===e[eW]&&e[eH])},toJSONObject:e=>{let t=Array(10),r=(e,i)=>{if(e2(e)){if(t.indexOf(e)>=0)return;if(eY(e))return e;if(!("toJSON"in e)){t[i]=e;let n=eZ(e)?[]:{};return ti(e,(e,t)=>{let o=r(e,i+1);eX(o)||(n[t]=o)}),t[i]=void 0,n}}return e};return r(e,0)},isAsyncFn:td,isThenable:e=>e&&(e2(e)||e0(e))&&e0(e.then)&&e0(e.catch),setImmediate:tp,asap:tf,isIterable:e=>null!=e&&e0(e[eH])};function tg(e,t,r,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}tm.inherits(tg,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:tm.toJSONObject(this.config),code:this.code,status:this.status}}});let ty=tg.prototype,tb={};function tv(e){return tm.isPlainObject(e)||tm.isArray(e)}function tw(e){return tm.endsWith(e,"[]")?e.slice(0,-2):e}function t_(e,t,r){return e?e.concat(t).map(function(e,t){return e=tw(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=>{tb[e]={value:e}}),Object.defineProperties(tg,tb),Object.defineProperty(ty,"isAxiosError",{value:!0}),tg.from=(e,t,r,i,n,o)=>{let s=Object.create(ty);tm.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);let a=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return tg.call(s,a,l,r,i,n),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",o&&Object.assign(s,o),s};let tE=tm.toFlatObject(tm,{},null,function(e){return/^is[A-Z]/.test(e)}),tS=function(e,t,r){if(!tm.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let i=(r=tm.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!tm.isUndefined(t[e])})).metaTokens,n=r.visitor||u,o=r.dots,s=r.indexes,a=(r.Blob||"u">typeof Blob&&Blob)&&tm.isSpecCompliantForm(t);if(!tm.isFunction(n))throw TypeError("visitor must be a function");function l(e){if(null===e)return"";if(tm.isDate(e))return e.toISOString();if(tm.isBoolean(e))return e.toString();if(!a&&tm.isBlob(e))throw new tg("Blob is not supported. Use a Buffer instead.");return tm.isArrayBuffer(e)||tm.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,r,n){let a=e;if(e&&!n&&"object"==typeof e)if(tm.endsWith(r,"{}"))r=i?r:r.slice(0,-2),e=JSON.stringify(e);else{var u;if(tm.isArray(e)&&(u=e,tm.isArray(u)&&!u.some(tv))||(tm.isFileList(e)||tm.endsWith(r,"[]"))&&(a=tm.toArray(e)))return r=tw(r),a.forEach(function(e,i){tm.isUndefined(e)||null===e||t.append(!0===s?t_([r],i,o):null===s?r:r+"[]",l(e))}),!1}return!!tv(e)||(t.append(t_(n,r,o),l(e)),!1)}let c=[],h=Object.assign(tE,{defaultVisitor:u,convertValue:l,isVisitable:tv});if(!tm.isObject(e))throw TypeError("data must be an object");return!function e(r,i){if(!tm.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+i.join("."));c.push(r),tm.forEach(r,function(r,o){!0===(!(tm.isUndefined(r)||null===r)&&n.call(t,r,tm.isString(o)?o.trim():o,i,h))&&e(r,i?i.concat(o):[o])}),c.pop()}}(e),t};function tA(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function t$(e,t){this._pairs=[],e&&tS(e,this,t)}let tO=t$.prototype;function tR(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function tC(e,t,r){let i;if(!t)return e;let n=r&&r.encode||tR;tm.isFunction(r)&&(r={serialize:r});let o=r&&r.serialize;if(i=o?o(t,r):tm.isURLSearchParams(t)?t.toString():new t$(t,r).toString(n)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}tO.append=function(e,t){this._pairs.push([e,t])},tO.toString=function(e){let t=e?function(t){return e.call(this,t,tA)}:tA;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let tx=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){tm.forEach(this.handlers,function(t){null!==t&&e(t)})}},tP={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},tT="u">typeof URLSearchParams?URLSearchParams:t$,tU="u">typeof FormData?FormData:null,tz="u">typeof Blob?Blob:null,tk="u">typeof window&&"u">typeof document,tj="object"==typeof navigator&&navigator||void 0,tF=tk&&(!tj||0>["ReactNative","NativeScript","NS"].indexOf(tj.product)),tN="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,tL=tk&&window.location.href||"http://localhost",tI={...P,isBrowser:!0,classes:{URLSearchParams:tT,FormData:tU,Blob:tz},protocols:["http","https","file","blob","url","data"]},tM=function(e){if(tm.isFormData(e)&&tm.isFunction(e.entries)){let t={};return tm.forEachEntry(e,(e,r)=>{!function e(t,r,i,n){let o=t[n++];if("__proto__"===o)return!0;let s=Number.isFinite(+o),a=n>=t.length;return(o=!o&&tm.isArray(i)?i.length:o,a)?tm.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r:(i[o]&&tm.isObject(i[o])||(i[o]=[]),e(t,r,i[o],n)&&tm.isArray(i[o])&&(i[o]=function(e){let t,r,i={},n=Object.keys(e),o=n.length;for(t=0;t<o;t++)i[r=n[t]]=e[r];return i}(i[o]))),!s}(tm.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),r,t,0)}),t}return null},tB={transitional:tP,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r,i=t.getContentType()||"",n=i.indexOf("application/json")>-1,o=tm.isObject(e);if(o&&tm.isHTMLForm(e)&&(e=new FormData(e)),tm.isFormData(e))return n?JSON.stringify(tM(e)):e;if(tm.isArrayBuffer(e)||tm.isBuffer(e)||tm.isStream(e)||tm.isFile(e)||tm.isBlob(e)||tm.isReadableStream(e))return e;if(tm.isArrayBufferView(e))return e.buffer;if(tm.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1){var s,a;return(s=e,a=this.formSerializer,tS(s,new tI.classes.URLSearchParams,{visitor:function(e,t,r,i){return tI.isNode&&tm.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...a})).toString()}if((r=tm.isFileList(e))||i.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return tS(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(o||n){t.setContentType("application/json",!1);var l=e;if(tm.isString(l))try{return(0,JSON.parse)(l),tm.trim(l)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(l)}return e}],transformResponse:[function(e){let t=this.transitional||tB.transitional,r=t&&t.forcedJSONParsing,i="json"===this.responseType;if(tm.isResponse(e)||tm.isReadableStream(e))return e;if(e&&tm.isString(e)&&(r&&!this.responseType||i)){let r=t&&t.silentJSONParsing;try{return JSON.parse(e,this.parseReviver)}catch(e){if(!r&&i){if("SyntaxError"===e.name)throw tg.from(e,tg.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:tI.classes.FormData,Blob:tI.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};tm.forEach(["delete","get","head","post","put","patch"],e=>{tB.headers[e]={}});let tD=tm.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"]),tq=Symbol("internals");function tH(e){return e&&String(e).trim().toLowerCase()}function tW(e){return!1===e||null==e?e:tm.isArray(e)?e.map(tW):String(e)}function tK(e,t,r,i,n){if(tm.isFunction(i))return i.call(this,t,r);if(n&&(t=r),tm.isString(t)){if(tm.isString(i))return -1!==t.indexOf(i);if(tm.isRegExp(i))return i.test(t)}}class tJ{constructor(e){e&&this.set(e)}set(e,t,r){let i=this;function n(e,t,r){let n=tH(t);if(!n)throw Error("header name must be a non-empty string");let o=tm.findKey(i,n);o&&void 0!==i[o]&&!0!==r&&(void 0!==r||!1===i[o])||(i[o||t]=tW(e))}let o=(e,t)=>tm.forEach(e,(e,r)=>n(e,r,t));if(tm.isPlainObject(e)||e instanceof this.constructor)o(e,t);else{let i;if(tm.isString(e)&&(e=e.trim())&&(i=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim()))){var s;let r,i,n,a;o((a={},(s=e)&&s.split("\n").forEach(function(e){n=e.indexOf(":"),r=e.substring(0,n).trim().toLowerCase(),i=e.substring(n+1).trim(),!r||a[r]&&tD[r]||("set-cookie"===r?a[r]?a[r].push(i):a[r]=[i]:a[r]=a[r]?a[r]+", "+i:i)}),a),t)}else if(tm.isObject(e)&&tm.isIterable(e)){let r={},i,n;for(let t of e){if(!tm.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[n=t[0]]=(i=r[n])?tm.isArray(i)?[...i,t[1]]:[i,t[1]]:t[1]}o(r,t)}else null!=e&&n(t,e,r)}return this}get(e,t){if(e=tH(e)){let r=tm.findKey(this,e);if(r){let e=this[r];if(!t)return e;if(!0===t){let t,r=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=i.exec(e);)r[t[1]]=t[2];return r}if(tm.isFunction(t))return t.call(this,e,r);if(tm.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=tH(e)){let r=tm.findKey(this,e);return!!(r&&void 0!==this[r]&&(!t||tK(this,this[r],r,t)))}return!1}delete(e,t){let r=this,i=!1;function n(e){if(e=tH(e)){let n=tm.findKey(r,e);n&&(!t||tK(r,r[n],n,t))&&(delete r[n],i=!0)}}return tm.isArray(e)?e.forEach(n):n(e),i}clear(e){let t=Object.keys(this),r=t.length,i=!1;for(;r--;){let n=t[r];(!e||tK(this,this[n],n,e,!0))&&(delete this[n],i=!0)}return i}normalize(e){let t=this,r={};return tm.forEach(this,(i,n)=>{let o=tm.findKey(r,n);if(o){t[o]=tW(i),delete t[n];return}let s=e?n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r):String(n).trim();s!==n&&delete t[n],t[s]=tW(i),r[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return tm.forEach(this,(r,i)=>{null!=r&&!1!==r&&(t[i]=e&&tm.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){let r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){let t=(this[tq]=this[tq]={accessors:{}}).accessors,r=this.prototype;function i(e){let i=tH(e);if(!t[i]){let n;n=tm.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(r,t+n,{value:function(r,i,n){return this[t].call(this,e,r,i,n)},configurable:!0})}),t[i]=!0}}return tm.isArray(e)?e.forEach(i):i(e),this}}function tV(e,t){let r=this||tB,i=t||r,n=tJ.from(i.headers),o=i.data;return tm.forEach(e,function(e){o=e.call(r,o,n.normalize(),t?t.status:void 0)}),n.normalize(),o}function tZ(e){return!!(e&&e.__CANCEL__)}function tX(e,t,r){tg.call(this,null==e?"canceled":e,tg.ERR_CANCELED,t,r),this.name="CanceledError"}function tY(e,t,r){let i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new tg("Request failed with status code "+r.status,[tg.ERR_BAD_REQUEST,tg.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}tJ.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),tm.reduceDescriptors(tJ.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),tm.freezeMethods(tJ),tm.inherits(tX,tg,{__CANCEL__:!0});let tG=function(e,t){let r,i=Array(e=e||10),n=Array(e),o=0,s=0;return t=void 0!==t?t:1e3,function(a){let l=Date.now(),u=n[s];r||(r=l),i[o]=a,n[o]=l;let c=s,h=0;for(;c!==o;)h+=i[c++],c%=e;if((o=(o+1)%e)===s&&(s=(s+1)%e),l-r<t)return;let d=u&&l-u;return d?Math.round(1e3*h/d):void 0}},tQ=function(e,t){let r,i,n=0,o=1e3/t,s=(t,o=Date.now())=>{n=o,r=null,i&&(clearTimeout(i),i=null),e(...t)};return[(...e)=>{let t=Date.now(),a=t-n;a>=o?s(e,t):(r=e,i||(i=setTimeout(()=>{i=null,s(r)},o-a)))},()=>r&&s(r)]},t0=(e,t,r=3)=>{let i=0,n=tG(50,250);return tQ(r=>{let o=r.loaded,s=r.lengthComputable?r.total:void 0,a=o-i,l=n(a);i=o,e({loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&o<=s?(s-o)/l:void 0,event:r,lengthComputable:null!=s,[t?"download":"upload"]:!0})},r)},t1=(e,t)=>{let r=null!=e;return[i=>t[0]({lengthComputable:r,total:e,loaded:i}),t[1]]},t2=e=>(...t)=>tm.asap(()=>e(...t)),t5=tI.hasStandardBrowserEnv?(r=new URL(tI.origin),i=tI.navigator&&/(msie|trident)/i.test(tI.navigator.userAgent),e=>(e=new URL(e,tI.origin),r.protocol===e.protocol&&r.host===e.host&&(i||r.port===e.port))):()=>!0,t4=tI.hasStandardBrowserEnv?{write(e,t,r,i,n,o,s){if("u"<typeof document)return;let a=[`${e}=${encodeURIComponent(t)}`];tm.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),tm.isString(i)&&a.push(`path=${i}`),tm.isString(n)&&a.push(`domain=${n}`),!0===o&&a.push("secure"),tm.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.match(RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function t3(e,t,r){let i=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(i||!1==r)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let t6=e=>e instanceof tJ?{...e}:e;function t8(e,t){t=t||{};let r={};function i(e,t,r,i){return tm.isPlainObject(e)&&tm.isPlainObject(t)?tm.merge.call({caseless:i},e,t):tm.isPlainObject(t)?tm.merge({},t):tm.isArray(t)?t.slice():t}function n(e,t,r,n){return tm.isUndefined(t)?tm.isUndefined(e)?void 0:i(void 0,e,r,n):i(e,t,r,n)}function o(e,t){if(!tm.isUndefined(t))return i(void 0,t)}function s(e,t){return tm.isUndefined(t)?tm.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function a(r,n,o){return o in t?i(r,n):o in e?i(void 0,r):void 0}let l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,r)=>n(t6(e),t6(t),r,!0)};return tm.forEach(Object.keys({...e,...t}),function(i){let o=l[i]||n,s=o(e[i],t[i],i);tm.isUndefined(s)&&o!==a||(r[i]=s)}),r}let t7=e=>{let t=t8({},e),{data:r,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:o,headers:s,auth:a}=t;if(t.headers=s=tJ.from(s),t.url=tC(t3(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),tm.isFormData(r)){if(tI.hasStandardBrowserEnv||tI.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(tm.isFunction(r.getHeaders)){let e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&s.set(e,r)})}}if(tI.hasStandardBrowserEnv&&(i&&tm.isFunction(i)&&(i=i(t)),i||!1!==i&&t5(t.url))){let e=n&&o&&t4.read(o);e&&s.set(n,e)}return t},t9="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){var i;let n,o,s,a,l,u,c=t7(e),h=c.data,d=tJ.from(c.headers).normalize(),{responseType:p,onUploadProgress:f,onDownloadProgress:m}=c;function g(){a&&a(),l&&l(),c.cancelToken&&c.cancelToken.unsubscribe(n),c.signal&&c.signal.removeEventListener("abort",n)}let y=new XMLHttpRequest;function b(){if(!y)return;let i=tJ.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());tY(function(e){t(e),g()},function(e){r(e),g()},{data:p&&"text"!==p&&"json"!==p?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:i,config:e,request:y}),y=null}y.open(c.method.toUpperCase(),c.url,!0),y.timeout=c.timeout,"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||4!==y.readyState||(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(b)},y.onabort=function(){y&&(r(new tg("Request aborted",tg.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){let i=new tg(t&&t.message?t.message:"Network Error",tg.ERR_NETWORK,e,y);i.event=t||null,r(i),y=null},y.ontimeout=function(){let t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",i=c.transitional||tP;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),r(new tg(t,i.clarifyTimeoutError?tg.ETIMEDOUT:tg.ECONNABORTED,e,y)),y=null},void 0===h&&d.setContentType(null),"setRequestHeader"in y&&tm.forEach(d.toJSON(),function(e,t){y.setRequestHeader(t,e)}),tm.isUndefined(c.withCredentials)||(y.withCredentials=!!c.withCredentials),p&&"json"!==p&&(y.responseType=c.responseType),m&&([s,l]=t0(m,!0),y.addEventListener("progress",s)),f&&y.upload&&([o,a]=t0(f),y.upload.addEventListener("progress",o),y.upload.addEventListener("loadend",a)),(c.cancelToken||c.signal)&&(n=t=>{y&&(r(!t||t.type?new tX(null,e,y):t),y.abort(),y=null)},c.cancelToken&&c.cancelToken.subscribe(n),c.signal&&(c.signal.aborted?n():c.signal.addEventListener("abort",n)));let v=(i=c.url,(u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i))&&u[1]||"");v&&-1===tI.protocols.indexOf(v)?r(new tg("Unsupported protocol "+v+":",tg.ERR_BAD_REQUEST,e)):y.send(h||null)})},re=function*(e,t){let r,i=e.byteLength;if(!t||i<t)return void(yield e);let n=0;for(;n<i;)r=n+t,yield e.slice(n,r),n=r},rt=async function*(e,t){for await(let r of rr(e))yield*re(r,t)},rr=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},ri=(e,t,r,i)=>{let n,o=rt(e,t),s=0,a=e=>{!n&&(n=!0,i&&i(e))};return new ReadableStream({async pull(e){try{let{done:t,value:i}=await o.next();if(t){a(),e.close();return}let n=i.byteLength;if(r){let e=s+=n;r(e)}e.enqueue(new Uint8Array(i))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:rn}=tm,ro=(({Request:e,Response:t})=>({Request:e,Response:t}))(tm.global),{ReadableStream:rs,TextEncoder:ra}=tm.global,rl=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ru=e=>{let t,{fetch:r,Request:i,Response:n}=e=tm.merge.call({skipUndefined:!0},ro,e),o=r?rn(r):"function"==typeof fetch,s=rn(i),a=rn(n);if(!o)return!1;let l=o&&rn(rs),u=o&&("function"==typeof ra?(t=new ra,e=>t.encode(e)):async e=>new Uint8Array(await new i(e).arrayBuffer())),c=s&&l&&rl(()=>{let e=!1,t=new i(tI.origin,{body:new rs,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=a&&l&&rl(()=>tm.isReadableStream(new n("").body)),d={stream:h&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{d[e]||(d[e]=(t,r)=>{let i=t&&t[e];if(i)return i.call(t);throw new tg(`Response type '${e}' is not supported`,tg.ERR_NOT_SUPPORT,r)})});let p=async e=>{if(null==e)return 0;if(tm.isBlob(e))return e.size;if(tm.isSpecCompliantForm(e)){let t=new i(tI.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return tm.isArrayBufferView(e)||tm.isArrayBuffer(e)?e.byteLength:(tm.isURLSearchParams(e)&&(e+=""),tm.isString(e))?(await u(e)).byteLength:void 0},f=async(e,t)=>{let r=tm.toFiniteNumber(e.getContentLength());return null==r?p(t):r};return async e=>{let t,{url:o,method:a,data:l,signal:u,cancelToken:p,timeout:m,onDownloadProgress:g,onUploadProgress:y,responseType:b,headers:v,withCredentials:w="same-origin",fetchOptions:_}=t7(e),E=r||fetch;b=b?(b+"").toLowerCase():"text";let S=((e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,i=new AbortController,n=function(e){if(!r){r=!0,s();let t=e instanceof Error?e:this.reason;i.abort(t instanceof tg?t:new tX(t instanceof Error?t.message:t))}},o=t&&setTimeout(()=>{o=null,n(new tg(`timeout ${t} of ms exceeded`,tg.ETIMEDOUT))},t),s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(n):e.removeEventListener("abort",n)}),e=null)};e.forEach(e=>e.addEventListener("abort",n));let{signal:a}=i;return a.unsubscribe=()=>tm.asap(s),a}})([u,p&&p.toAbortSignal()],m),A=null,$=S&&S.unsubscribe&&(()=>{S.unsubscribe()});try{if(y&&c&&"get"!==a&&"head"!==a&&0!==(t=await f(v,l))){let e,r=new i(o,{method:"POST",body:l,duplex:"half"});if(tm.isFormData(l)&&(e=r.headers.get("content-type"))&&v.setContentType(e),r.body){let[e,i]=t1(t,t0(t2(y)));l=ri(r.body,65536,e,i)}}tm.isString(w)||(w=w?"include":"omit");let r=s&&"credentials"in i.prototype,u={..._,signal:S,method:a.toUpperCase(),headers:v.normalize().toJSON(),body:l,duplex:"half",credentials:r?w:void 0};A=s&&new i(o,u);let p=await (s?E(A,_):E(o,u)),m=h&&("stream"===b||"response"===b);if(h&&(g||m&&$)){let e={};["status","statusText","headers"].forEach(t=>{e[t]=p[t]});let t=tm.toFiniteNumber(p.headers.get("content-length")),[r,i]=g&&t1(t,t0(t2(g),!0))||[];p=new n(ri(p.body,65536,r,()=>{i&&i(),$&&$()}),e)}b=b||"text";let O=await d[tm.findKey(d,b)||"text"](p,e);return!m&&$&&$(),await new Promise((t,r)=>{tY(t,r,{data:O,headers:tJ.from(p.headers),status:p.status,statusText:p.statusText,config:e,request:A})})}catch(t){if($&&$(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new tg("Network Error",tg.ERR_NETWORK,e,A),{cause:t.cause||t});throw tg.from(t,t&&t.code,e,A)}}},rc=new Map,rh=e=>{let t=e&&e.env||{},{fetch:r,Request:i,Response:n}=t,o=[i,n,r],s=o.length,a,l,u=rc;for(;s--;)a=o[s],void 0===(l=u.get(a))&&u.set(a,l=s?new Map:ru(t)),u=l;return l};rh();let rd={http:null,xhr:t9,fetch:{get:rh}};tm.forEach(rd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let rp=e=>`- ${e}`,rf=e=>tm.isFunction(e)||null===e||!1===e,rm=function(e,t){let r,i,{length:n}=e=tm.isArray(e)?e:[e],o={};for(let s=0;s<n;s++){let n;if(i=r=e[s],!rf(r)&&void 0===(i=rd[(n=String(r)).toLowerCase()]))throw new tg(`Unknown adapter '${n}'`);if(i&&(tm.isFunction(i)||(i=i.get(t))))break;o[n||"#"+s]=i}if(!i){let e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new tg("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(rp).join("\n"):" "+rp(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return i};function rg(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tX(null,e)}function ry(e){return rg(e),e.headers=tJ.from(e.headers),e.data=tV.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),rm(e.adapter||tB.adapter,e)(e).then(function(t){return rg(e),t.data=tV.call(e,e.transformResponse,t),t.headers=tJ.from(t.headers),t},function(t){return!tZ(t)&&(rg(e),t&&t.response&&(t.response.data=tV.call(e,e.transformResponse,t.response),t.response.headers=tJ.from(t.response.headers))),Promise.reject(t)})}let rb={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{rb[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});let rv={};rb.transitional=function(e,t,r){function i(e,t){return"[Axios v1.13.2] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,n,o)=>{if(!1===e)throw new tg(i(n," has been removed"+(t?" in "+t:"")),tg.ERR_DEPRECATED);return t&&!rv[n]&&(rv[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,o)}},rb.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};let rw=function(e,t,r){if("object"!=typeof e)throw new tg("options must be an object",tg.ERR_BAD_OPTION_VALUE);let i=Object.keys(e),n=i.length;for(;n-- >0;){let o=i[n],s=t[o];if(s){let t=e[o],r=void 0===t||s(t,o,e);if(!0!==r)throw new tg("option "+o+" must be "+r,tg.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new tg("Unknown option "+o,tg.ERR_BAD_OPTION)}};class r_{constructor(e){this.defaults=e||{},this.interceptors={request:new tx,response:new tx}}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=Error();let 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){let r,i;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:n,paramsSerializer:o,headers:s}=t=t8(this.defaults,t);void 0!==n&&rw(n,{silentJSONParsing:rb.transitional(rb.boolean),forcedJSONParsing:rb.transitional(rb.boolean),clarifyTimeoutError:rb.transitional(rb.boolean)},!1),null!=o&&(tm.isFunction(o)?t.paramsSerializer={serialize:o}:rw(o,{encode:rb.function,serialize:rb.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rw(t,{baseUrl:rb.spelling("baseURL"),withXsrfToken:rb.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&tm.merge(s.common,s[t.method]);s&&tm.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=tJ.concat(a,s);let l=[],u=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(u=u&&e.synchronous,l.unshift(e.fulfilled,e.rejected))});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let h=0;if(!u){let e=[ry.bind(this),void 0];for(e.unshift(...l),e.push(...c),i=e.length,r=Promise.resolve(t);h<i;)r=r.then(e[h++],e[h++]);return r}i=l.length;let d=t;for(;h<i;){let e=l[h++],t=l[h++];try{d=e(d)}catch(e){t.call(this,e);break}}try{r=ry.call(this,d)}catch(e){return Promise.reject(e)}for(h=0,i=c.length;h<i;)r=r.then(c[h++],c[h++]);return r}getUri(e){return tC(t3((e=t8(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}tm.forEach(["delete","get","head","options"],function(e){r_.prototype[e]=function(t,r){return this.request(t8(r||{},{method:e,url:t,data:(r||{}).data}))}}),tm.forEach(["post","put","patch"],function(e){function t(t){return function(r,i,n){return this.request(t8(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}r_.prototype[e]=t(),r_.prototype[e+"Form"]=t(!0)});class rE{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");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,i=new Promise(e=>{r.subscribe(e),t=e}).then(e);return i.cancel=function(){r.unsubscribe(t)},i},e(function(e,i,n){r.reason||(r.reason=new tX(e,i,n),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;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let 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 rE(function(t){e=t}),cancel:e}}}let rS={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(rS).forEach(([e,t])=>{rS[t]=e});let rA=function e(t){let r=new r_(t),i=eB(r_.prototype.request,r);return tm.extend(i,r_.prototype,r,{allOwnKeys:!0}),tm.extend(i,r,null,{allOwnKeys:!0}),i.create=function(r){return e(t8(t,r))},i}(tB);rA.Axios=r_,rA.CanceledError=tX,rA.CancelToken=rE,rA.isCancel=tZ,rA.VERSION="1.13.2",rA.toFormData=tS,rA.AxiosError=tg,rA.Cancel=rA.CanceledError,rA.all=function(e){return Promise.all(e)},rA.spread=function(e){return function(t){return e.apply(null,t)}},rA.isAxiosError=function(e){return tm.isObject(e)&&!0===e.isAxiosError},rA.mergeConfig=t8,rA.AxiosHeaders=tJ,rA.formToJSON=e=>tM(tm.isHTMLForm(e)?new FormData(e):e),rA.getAdapter=rm,rA.HttpStatusCode=rS,rA.default=rA;let{Axios:r$,AxiosError:rO,CanceledError:rR,isCancel:rC,CancelToken:rx,VERSION:rP,all:rT,Cancel:rU,isAxiosError:rz,spread:rk,toFormData:rj,AxiosHeaders:rF,HttpStatusCode:rN,formToJSON:rL,getAdapter:rI,mergeConfig:rM}=rA;function rB(e){return rA.create({baseURL:e,timeout:3e4})}let rD=new Set(["common","delete","get","head","post","put","patch","options","purge","link","unlink"]);function rq(){return globalThis.process?.env?.NODE_ENV}function rH(e){if(void 0===e)return[];let t="function"==typeof e.toJSON?e.toJSON():e,r=[];return!function e(t,r){if(null!==t&&"object"==typeof t)for(let[i,n]of Object.entries(t)){if(null==n)continue;let t=i.toLowerCase();if("common"===t){e(n,r);continue}rD.has(t)||r.push([i,String(n)])}}(t,r),r}function rW(e){return!!("u">typeof FormData&&e instanceof FormData)||null!==e&&"object"==typeof e&&(e.constructor?.name==="FormData"||"function"==typeof e.getBoundary)}let rK=new Set(["authorization","cookie","set-cookie","x-xsrf-token"]);function rJ(e){if(null==e)return;let t="function"==typeof e.toJSON?e.toJSON():e;if(null===t||"object"!=typeof t)return;let r={};for(let[e,i]of Object.entries(t))null!=i&&(r[e]=rK.has(e.toLowerCase())?"[redacted]":String(i));return r}function rV(e){if(null!=e){if("string"==typeof e)try{return JSON.parse(e)}catch{return e.length>2e3?`${e.slice(0,2e3)}… (${e.length} chars)`:e}return rW(e)?"[FormData]":e}}function rZ(e){let t=(e.requestConfig.method??"GET").toUpperCase(),r=e.requestConfig.url??"",i=`[api:server] ${t} ${r} → ${e.status} (${e.durationMs}ms)`,n={requestId:e.requestId,...e.error?{error:e.error}:{},params:e.requestConfig.params,requestBody:rV(e.requestConfig.data),requestHeaders:rJ(e.requestConfig.headers),responseHeaders:rJ(e.responseHeaders),responseBody:rV(e.responseBody)};(e.status>=500||void 0!==e.error&&0===e.status?console.error:e.status>=400?console.warn:console.log)(i,n)}let rX=function({clientName:e,configureFunctionName:t,defaultBaseURL:r}){let i=rB(r),n=rB(r),o=null,s=null,a=null,l=null,u=null,c=null;async function h(e,t){let r=function(e,t){let r;if(void 0===t.data||rW(t.data))return t;let i=rF.from(t.headers);return i.has("Content-Type")||void 0!==(r=e.defaults.headers.common)&&rF.from(r).has("Content-Type")||i.set("Content-Type","application/json"),t.headers=i,t}(e,function(e){let t=rF.from(e.headers);if(null!==a){let e=a()?.trim();e&&!t.has("Authorization")&&t.set("Authorization",`Bearer ${e}`)}if(null!==c)for(let[r,i]of Object.entries(c({url:e.url,method:e.method})))i&&!t.has(r)&&t.set(r,i);return e.headers=t,e}({...t})),i=function(e){let t,r=rF.from(e.headers),i=r.get("x-request-id");if("string"==typeof i&&i.length>0)return i;let n=(t=globalThis.crypto,"function"==typeof t?.randomUUID?t.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`);return r.set("x-request-id",n),e.headers=r,n}(r),n=function(){if("u">typeof window)return!1;let e=rq(),t=globalThis.process;return t?.env?.DEBUG_API==="true"||"production"!==e&&"test"!==e&&"testing"!==e}(),o=n?Date.now():0;try{let t=await e.request(r);return n&&rZ({requestConfig:r,requestId:i,status:t.status,durationMs:Date.now()-o,responseHeaders:t.headers,responseBody:t.data}),t}catch(e){throw n&&rZ({requestConfig:r,requestId:i,status:e.response?.status??0,durationMs:Date.now()-o,responseHeaders:e.response?.headers,responseBody:e.response?.data,error:e.message}),e}}async function d(e){return h(e.skipUnauthorizedRecovery?n:i,function(e){let{skipUnauthorizedRecovery:t,...r}=e;return r}(e))}let p=async e=>d({...e,skipUnauthorizedRecovery:!0});function f(){return null!==o}return{configureClientRuntime:function(t){let r,s=(r=function(e){let t=rH(e);if(0===t.length)return;let r=new Map;for(let[e,i]of t)r.set(e.toLowerCase(),i);return Object.fromEntries(Array.from(r.entries()).sort(([e],[t])=>e.localeCompare(t)))}(t.headers),JSON.stringify({...void 0!==t.baseURL?{baseURL:t.baseURL}:{},...void 0!==t.timeout?{timeout:t.timeout}:{},...void 0!==r?{headers:r}:{}}));if("{}"!==s){if(null!==o){if(o===s)return;let t=`${e} already configured. Existing: ${o}. New: ${s}.`;if("production"===rq())return void console.warn(t);throw Error(t)}for(let e of[i,n])void 0!==t.baseURL&&(e.defaults.baseURL=t.baseURL),void 0!==t.timeout&&(e.defaults.timeout=t.timeout),void 0!==t.headers&&function(e,t){let r=e.defaults.headers,i=r.common,n=rF.from(i);for(let[e,r]of rH(t))n.set(e,r);r.common=n.toJSON(),e.defaults.headers=r}(e,t.headers);o=s}},configureAccessTokenResolverRuntime:function(e){a=e},configureUnauthorizedHandlerRuntime:function(e){if(l=e,null===e){null!==s&&(i.interceptors.response.eject(s),s=null),u=null;return}null===s&&(s=i.interceptors.response.use(e=>e,async e=>{let t=e.config;if(e.response?.status!==401||null===l||void 0===t||t._apiRetried)return Promise.reject(e);if(null===u){let t=l;if(null===t)return Promise.reject(e);u=Promise.resolve().then(()=>t(e,{requestWithoutUnauthorizedRecovery:p})).finally(()=>{u=null})}try{if(!await u)return Promise.reject(e);t._apiRetried=!0;let r=rF.from(t.headers);return r.delete("Authorization"),t.headers=r,h(i,t)}catch{return Promise.reject(e)}}))},configureHeadersResolverRuntime:function(e){c=e},isClientConfiguredRuntime:f,assertClientConfiguredRuntime:function(){if(!f())throw Error(`${e} is not configured. Call ${t}(...) before making requests.`)},resetClientForTestsRuntime:function(){let e;if("test"!==(e=rq())&&"testing"!==e)throw Error("resetApiClientForTests() can only be called in test environment.");i=rB(r),n=rB(r),o=null,s=null,a=null,l=null,u=null,c=null},requestRuntime:d,requestWithoutUnauthorizedRecovery:p,addResponseInterceptorRuntime:function(e,t){return i.interceptors.response.use(e,t)}}}({clientName:"API node client",configureFunctionName:"configureNodeApiClient",defaultBaseURL:"https://api-dev.vizbl.com"});rX.configureClientRuntime,rX.configureAccessTokenResolverRuntime,rX.configureHeadersResolverRuntime,rX.configureUnauthorizedHandlerRuntime,rX.isClientConfiguredRuntime,rX.assertClientConfiguredRuntime,rX.resetClientForTestsRuntime;let rY=rX.requestRuntime;async function rG(e){return rY(e)}async function rQ({publicId:e},t,r={}){let{client:i=rG,...n}=r;return(await i({method:"GET",url:`/public/obj360views/by-public-id/${e}`,params:t,...n})).data}function r0(e){if(!e||"object"!=typeof e)return null;let t=e.get;var r="function"==typeof t?Reflect.apply(t,e,["x-request-id"]):e["x-request-id"];if("string"!=typeof r)return null;let i=r.trim();return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(i)?i:null}async function r1(e){let t,r=async e=>{let r=await rG(e);return t={requestId:r0(r.headers),status:r.status},r},i=await rQ({publicId:e.publicId},{loadType:e.loadType,quality:"all",...e.variationId?{variationId:e.variationId}:{}},{baseURL:e.baseURL,client:r,headers:{"x-api-key":e.apiKey},signal:e.signal});if(!t)throw Error("API client returned no response metadata");return{data:i,...t}}function r2(){return new DOMException("The operation was aborted","AbortError")}function r5(e){return e instanceof DOMException&&"AbortError"===e.name}rX.requestWithoutUnauthorizedRecovery,rX.addResponseInterceptorRuntime;class r4{decodedByUrl=new Map;inFlightByUrl=new Map;async decode(e,t){let r=this.decodedByUrl.get(e.url);if(r)return r;let i=this.inFlightByUrl.get(e.url);if(i?.signal===t)return await i.promise;let n={promise:this.tryDecode(e,t,2),signal:t};this.inFlightByUrl.set(e.url,n);try{let t=await n.promise;return this.decodedByUrl.set(e.url,t),t}finally{this.inFlightByUrl.get(e.url)===n&&this.inFlightByUrl.delete(e.url)}}async tryDecode(e,t,r){let i;for(let n=0;n<r;n+=1)try{return await this.decodeImage(e,t)}catch(e){if(r5(e))throw e;i=e}throw i}decodeImage(e,t){return new Promise((r,i)=>{if(t.aborted)return void i(r2());let n=new Image;function o(){n.onload=null,n.onerror=null,t.removeEventListener("abort",s)}function s(){o(),n.src="",i(r2())}n.onload=()=>{n.decode().then(()=>{o(),r({...e,height:n.naturalHeight,image:n,width:n.naturalWidth})},e=>{o(),i(e)})},n.onerror=()=>{o(),i(Error("Image decode failed"))},t.addEventListener("abort",s,{once:!0}),n.src=e.url})}}function r3(e){return!!e&&"object"==typeof e&&Number.isInteger(e.index)&&e.index>=0&&"string"==typeof e.url&&/^https?:\/\//.test(e.url)}function r6(e){if(!e||"object"!=typeof e)return[];let t=e.frames;return Array.isArray(t)&&t.every(r3)?[...t].sort((e,t)=>e.index-t.index):[]}function r8(e,t,r,i){return(r8=function(){function e(e,t){return function(i){(function(e,t){if(e.v)throw Error("attempted to call "+t+" after decoration was finished")})(t,"addInitializer"),r(i,"An initializer"),e.push(i)}}function t(t,r,i,n,o,s,a,l,u){switch(o){case 1:c="accessor";break;case 2:c="method";break;case 3:c="getter";break;case 4:c="setter";break;default:c="field"}var c,h,d,p={kind:c,name:a?"#"+r:r,static:s,private:a,metadata:l},f={v:!1};p.addInitializer=e(n,f),0===o?a?(h=i.get,d=i.set):(h=function(){return this[r]},d=function(e){this[r]=e}):2===o?h=function(){return i.value}:((1===o||3===o)&&(h=function(){return i.get.call(this)}),(1===o||4===o)&&(d=function(e){i.set.call(this,e)})),p.access=h&&d?{get:h,set:d}:h?{get:h}:{set:d};try{return t(u,p)}finally{f.v=!0}}function r(e,t){if("function"!=typeof e)throw TypeError(t+" must be a function")}function i(e,t){var i=typeof t;if(1===e){if("object"!==i||null===t)throw TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==t.get&&r(t.get,"accessor.get"),void 0!==t.set&&r(t.set,"accessor.set"),void 0!==t.init&&r(t.init,"accessor.init")}else if("function"!==i)throw TypeError((0===e?"field":10===e?"class":"method")+" decorators must return a function or void 0")}function n(e,t){t&&e.push(function(e){for(var r=0;r<t.length;r++)t[r].call(e);return e})}function o(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:t})}return function(r,s,a,l){if(void 0!==l)var u=l[Symbol.metadata||Symbol.for("Symbol.metadata")];var c=Object.create(void 0===u?null:u),h=function(e,r,o){for(var s=[],a=new Map,l=new Map,u=0;u<r.length;u++){var c,h,d,p,f=r[u];if(Array.isArray(f)){var m=f[1],g=f[2],y=f.length>3,b=m>=5;if(b?(d=e,m-=5,p=h=h||[]):(d=e.prototype,p=c=c||[]),0!==m&&!y){var v=b?l:a,w=v.get(g)||0;if(!0===w||3===w&&4!==m||4===w&&3!==m)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+g);!w&&m>2?v.set(g,m):v.set(g,!0)}!function(e,r,n,o,s,a,l,u,c){var h,d,p,f,m,g,y=n[0];if(l?h=0===s||1===s?{get:n[3],set:n[4]}:3===s?{get:n[3]}:4===s?{set:n[3]}:{value:n[3]}:0!==s&&(h=Object.getOwnPropertyDescriptor(r,o)),1===s?p={get:h.get,set:h.set}:2===s?p=h.value:3===s?p=h.get:4===s&&(p=h.set),"function"==typeof y)void 0!==(f=t(y,o,h,u,s,a,l,c,p))&&(i(s,f),0===s?d=f:1===s?(d=f.init,p={get:m=f.get||p.get,set:f.set||p.set}):p=f);else for(var b=y.length-1;b>=0;b--)void 0!==(f=t(y[b],o,h,u,s,a,l,c,p))&&(i(s,f),0===s?g=f:1===s?(g=f.init,p={get:m=f.get||p.get,set:f.set||p.set}):p=f,void 0!==g&&(void 0===d?d=g:"function"==typeof d?d=[d,g]:d.push(g)));if(0===s||1===s){if(void 0===d)d=function(e,t){return t};else if("function"!=typeof d){var v=d;d=function(e,t){for(var r=t,i=0;i<v.length;i++)r=v[i].call(e,r);return r}}else{var w=d;d=function(e,t){return w.call(e,t)}}e.push(d)}0!==s&&(1===s?(h.get=p.get,h.set=p.set):2===s?h.value=p:3===s?h.get=p:4===s&&(h.set=p),l?1===s?(e.push(function(e,t){return p.get.call(e,t)}),e.push(function(e,t){return p.set.call(e,t)})):2===s?e.push(p):e.push(function(e,t){return p.call(e,t)}):Object.defineProperty(r,o,h))}(s,d,f,g,m,b,y,p,o)}}return n(s,c),n(s,h),s}(r,s,c);return a.length||o(r,c),{e:h,get c(){return function(t,r,n){if(r.length>0){for(var s=[],a=t,l=t.name,u=r.length-1;u>=0;u--){var c={v:!1};try{var h=r[u](a,{kind:"class",name:l,addInitializer:e(s,c),metadata:n})}finally{c.v=!0}void 0!==h&&(i(10,h),a=h)}return[o(a,n),function(){for(var e=0;e<s.length;e++)s[e].call(a)}]}}(r,a,c)}}}}())(e,t,r,i)}let r7="neurodyn-spin-viewer",r9="https://api-dev.neurodyn.ai/".replace(/\/+$/,""),ie=new Set(["apiKey","publicId","variationId"]);l=eI({attribute:"api-key"}),u=eI(),c=eI({attribute:"public-id"}),h=eI({attribute:"variation-id"}),d=eM(),p=eM(),f=eM(),m=eM(),g=eM(),y=eM();class it extends eF{static{({e:[b,v,w,_,E,S,A,$,O,R,C]}=r8(this,[[l,1,"apiKey"],[u,1,"controls"],[c,1,"publicId"],[h,1,"variationId"],[d,1,"currentFrame"],[p,1,"viewerState"],[f,1,"activePointer"],[m,1,"zoomed"],[g,1,"zoomOrigin"],[y,1,"zoomScale"]],[]))}static styles=F`
|
|
4
|
+
:host {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: block;
|
|
7
|
+
width: 100%;
|
|
8
|
+
aspect-ratio: 4 / 3;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
-webkit-tap-highlight-color: transparent;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.viewport {
|
|
14
|
+
position: absolute;
|
|
15
|
+
inset: 0;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
outline: none;
|
|
18
|
+
touch-action: pan-y;
|
|
19
|
+
user-select: none;
|
|
20
|
+
-webkit-user-select: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.viewport[data-ready] {
|
|
24
|
+
cursor: zoom-in;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.viewport[data-spinning] {
|
|
28
|
+
cursor: grabbing;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.viewport[data-zoomed] {
|
|
32
|
+
cursor: zoom-out;
|
|
33
|
+
touch-action: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.viewport:focus-visible {
|
|
37
|
+
outline: 3px solid color-mix(in srgb, #315efb 72%, white);
|
|
38
|
+
outline-offset: -3px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
img {
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
|
+
display: block;
|
|
45
|
+
object-fit: contain;
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
transform: scale(var(--spin-viewer-zoom-scale, 1));
|
|
48
|
+
transform-origin: var(--spin-viewer-zoom-x, 50%) var(--spin-viewer-zoom-y, 50%);
|
|
49
|
+
transition: transform 180ms cubic-bezier(.2, .7, .2, 1);
|
|
50
|
+
-webkit-user-drag: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.zoom-control {
|
|
54
|
+
position: absolute;
|
|
55
|
+
right: 16px;
|
|
56
|
+
bottom: 16px;
|
|
57
|
+
width: 44px;
|
|
58
|
+
height: 44px;
|
|
59
|
+
display: grid;
|
|
60
|
+
place-items: center;
|
|
61
|
+
margin: 0;
|
|
62
|
+
border: 1px solid rgb(25 31 40 / 12%);
|
|
63
|
+
border-radius: 999px;
|
|
64
|
+
padding: 0;
|
|
65
|
+
color: var(--spin-viewer-control-color, #20252c);
|
|
66
|
+
background: var(--spin-viewer-control-background, rgb(255 255 255 / 82%));
|
|
67
|
+
box-shadow: 0 8px 24px rgb(21 27 38 / 14%), inset 0 1px 0 rgb(255 255 255 / 75%);
|
|
68
|
+
backdrop-filter: blur(12px) saturate(1.12);
|
|
69
|
+
-webkit-backdrop-filter: blur(12px) saturate(1.12);
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.zoom-control:hover:not(:disabled) {
|
|
75
|
+
background: var(--spin-viewer-control-background-hover, rgb(255 255 255 / 94%));
|
|
76
|
+
box-shadow: 0 10px 28px rgb(21 27 38 / 18%), inset 0 1px 0 rgb(255 255 255 / 85%);
|
|
77
|
+
transform: translateY(-1px);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.zoom-control:active:not(:disabled) {
|
|
81
|
+
box-shadow: 0 4px 14px rgb(21 27 38 / 16%), inset 0 1px 0 rgb(255 255 255 / 70%);
|
|
82
|
+
transform: translateY(0) scale(.96);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.zoom-control:focus-visible {
|
|
86
|
+
outline: 3px solid color-mix(in srgb, #315efb 72%, white);
|
|
87
|
+
outline-offset: 3px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.zoom-control:disabled {
|
|
91
|
+
cursor: wait;
|
|
92
|
+
opacity: .5;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.zoom-control svg {
|
|
96
|
+
width: 22px;
|
|
97
|
+
height: 22px;
|
|
98
|
+
overflow: visible;
|
|
99
|
+
fill: none;
|
|
100
|
+
stroke: currentColor;
|
|
101
|
+
stroke-linecap: round;
|
|
102
|
+
stroke-linejoin: round;
|
|
103
|
+
stroke-width: 1.8;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@media (prefers-reduced-motion: reduce) {
|
|
107
|
+
img,
|
|
108
|
+
.zoom-control {
|
|
109
|
+
transition: none;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
`;#e=(C(this),b(this,""));get apiKey(){return this.#e}set apiKey(e){this.#e=e}#t=v(this,"zoom");get controls(){return this.#t}set controls(e){this.#t=e}#r=w(this,"");get publicId(){return this.#r}set publicId(e){this.#r=e}#i=_(this,"");get variationId(){return this.#i}set variationId(e){this.#i=e}baseTier="medium";baseFrames=[];#n=E(this,void 0);get currentFrame(){return this.#n}set currentFrame(e){this.#n=e}currentPosition=0;imageSets;#o=S(this,"loading");get viewerState(){return this.#o}set viewerState(e){this.#o=e}abortController;imageLoader=new r4;loadedConfig;loadQueued=!1;loadRevision=0;#s=A(this,void 0);get activePointer(){return this.#s}set activePointer(e){this.#s=e}baseUpgradePending=!1;resizeObserver;#a=$(this,!1);get zoomed(){return this.#a}set zoomed(e){this.#a=e}#l=O(this,{x:50,y:50});get zoomOrigin(){return this.#l}set zoomOrigin(e){this.#l=e}#u=R(this,1);get zoomScale(){return this.#u}set zoomScale(e){this.#u=e}connectedCallback(){super.connectedCallback(),this.setViewerState("loading"),this.queueLoad(),this.updateComplete.then(()=>{this.isConnected&&this.observeResize()})}disconnectedCallback(){super.disconnectedCallback(),this.loadRevision+=1,this.abortController?.abort(),this.abortController=void 0,this.loadedConfig=void 0,this.loadQueued=!1,this.activePointer=void 0,this.baseUpgradePending=!1,this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.zoomed=!1,this.zoomOrigin={x:50,y:50},this.zoomScale=1}updated(e){[...e.keys()].some(e=>ie.has(String(e)))&&this.queueLoad()}render(){let e="ready"===this.viewerState;return ev`
|
|
113
|
+
<div
|
|
114
|
+
class="viewport"
|
|
115
|
+
?data-ready=${e}
|
|
116
|
+
?data-spinning=${!!this.activePointer?.spinning}
|
|
117
|
+
?data-zoomed=${this.zoomed}
|
|
118
|
+
role="group"
|
|
119
|
+
aria-label="360° product view"
|
|
120
|
+
aria-busy=${String("loading"===this.viewerState)}
|
|
121
|
+
aria-disabled=${String(!e)}
|
|
122
|
+
tabindex=${e?0:-1}
|
|
123
|
+
@keydown=${this.handleKeyDown}
|
|
124
|
+
@pointerdown=${this.handlePointerDown}
|
|
125
|
+
@pointermove=${this.handlePointerMove}
|
|
126
|
+
@pointerup=${this.handlePointerEnd}
|
|
127
|
+
@pointercancel=${this.handlePointerEnd}
|
|
128
|
+
>
|
|
129
|
+
${this.currentFrame?ev`
|
|
130
|
+
<img
|
|
131
|
+
alt=""
|
|
132
|
+
draggable="false"
|
|
133
|
+
fetchpriority="high"
|
|
134
|
+
height=${this.currentFrame.height}
|
|
135
|
+
src=${this.currentFrame.url}
|
|
136
|
+
width=${this.currentFrame.width}
|
|
137
|
+
style=${`--spin-viewer-zoom-scale:${this.zoomScale};--spin-viewer-zoom-x:${this.zoomOrigin.x}%;--spin-viewer-zoom-y:${this.zoomOrigin.y}%`}
|
|
138
|
+
>
|
|
139
|
+
`:e_}
|
|
140
|
+
${this.hasZoomControl()?ev`
|
|
141
|
+
<button
|
|
142
|
+
class="zoom-control"
|
|
143
|
+
type="button"
|
|
144
|
+
part=${this.zoomed?"zoom-out":"zoom-in"}
|
|
145
|
+
aria-label=${this.zoomed?"Zoom out":"Zoom in"}
|
|
146
|
+
?disabled=${!e}
|
|
147
|
+
@click=${this.handleZoomButtonClick}
|
|
148
|
+
>
|
|
149
|
+
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
150
|
+
<circle cx="10.5" cy="10.5" r="6.5"></circle>
|
|
151
|
+
<path d="m15.4 15.4 4.1 4.1"></path>
|
|
152
|
+
<path d="M7.8 10.5h5.4"></path>
|
|
153
|
+
${this.zoomed?e_:ev`<path d="M10.5 7.8v5.4"></path>`}
|
|
154
|
+
</svg>
|
|
155
|
+
</button>
|
|
156
|
+
`:e_}
|
|
157
|
+
</div>
|
|
158
|
+
`}zoomIn(){this.startZoom(50,50)}zoomStop(){if(!this.zoomed)return;this.zoomed=!1,this.zoomOrigin={x:50,y:50},this.zoomScale=1;let e=this.baseFrames[this.currentPosition];e&&this.setCurrentFrame(e),this.dispatchWidgetEvent("zoom-change",{active:!1})}queueLoad(){!this.loadQueued&&this.isConnected&&(this.loadQueued=!0,queueMicrotask(()=>{this.loadQueued=!1,this.isConnected&&this.load()}))}async load(){let e={apiKey:(this.apiKey??"").trim(),publicId:(this.publicId??"").trim(),variationId:(this.variationId??"").trim()},t=this.loadedConfig?.apiKey===e.apiKey&&this.loadedConfig.publicId===e.publicId&&this.loadedConfig.variationId!==e.variationId;this.cancelActivePointer(),this.zoomStop(),t||(this.baseFrames=[],this.currentFrame=void 0,this.currentPosition=0,this.imageSets=void 0,this.loadedConfig=void 0),this.abortController?.abort();let r=new AbortController;this.abortController=r;let i=++this.loadRevision;if(this.baseUpgradePending=!1,this.setViewerState("loading"),!e.apiKey)return void this.fail({category:"auth",code:"missing-api-key",requestId:null,status:null},i);if(!e.publicId)return void this.fail({category:"unknown",code:"missing-public-id",requestId:null,status:null},i);try{var n,o;let s;try{s=await r1({apiKey:e.apiKey,baseURL:r9,loadType:t?"variant_swap":"model_load",publicId:e.publicId,signal:r.signal,variationId:e.variationId})}catch(t){if(r.signal.aborted||!this.isCurrent(i))return;let e=function(e){if(!e||"object"!=typeof e)return null;let t=e.response;if(!t||"object"!=typeof t)return null;let r=t.status;return"number"!=typeof r?null:{requestId:r0(t.headers),status:r}}(t);this.fail({category:e?(n=e.status,401===n||403===n?"auth":404===n?"not-found":n>=500?"server":"unknown"):"network",code:"api-error",requestId:e?.requestId??null,status:e?.status??null},i);return}let a=function(e){if(!e||"object"!=typeof e||"all"!==e.quality)return;let t=e.qualities;if(!t||"object"!=typeof t)return;let r=r6(t.medium);if(0!==r.length)return{high:r6(t.high),medium:r}}(s.data);if(!a)return void this.fail({category:"unknown",code:"invalid-response",requestId:s.requestId,status:s.status},i);let l=await this.imageLoader.decode(a.medium[0],r.signal);if(!this.isCurrent(i))return;this.currentPosition=0,this.setCurrentFrame(l),await this.updateComplete,await (o=r.signal,new Promise((e,t)=>{if(o.aborted)return void t(r2());let r=0,i=()=>{cancelAnimationFrame(r),t(r2())};r=requestAnimationFrame(()=>{o.removeEventListener("abort",i),e()}),o.addEventListener("abort",i,{once:!0})}));let u=this.requiresHigh(l)&&a.high.length>0,c=await this.decodeBaseFrames(a,u,r.signal);if(!this.isCurrent(i)||(this.baseTier=u?"high":"medium",this.baseFrames=c,this.imageSets=a,this.currentPosition=0,this.setCurrentFrame(c[0]),this.loadedConfig=e,this.setViewerState("ready"),await this.updateComplete,!this.isCurrent(i)))return;this.dispatchWidgetEvent("ready",{index:c[0].index,quality:this.baseTier,variationId:e.variationId||null})}catch(e){if(r5(e)||!this.isCurrent(i))return;this.fail({category:"unknown",code:"image-load-failed",requestId:null,status:null},i)}}async decodeBaseFrames(e,t,r){let i=new Map(e.high.map(e=>[e.index,e]));return await Promise.all(e.medium.map(async e=>{if(!t)return await this.imageLoader.decode(e,r);let n=i.get(e.index);if(!n)return await this.imageLoader.decode(e,r);try{return await this.imageLoader.decode(n,r)}catch(t){if(r5(t))throw t;return await this.imageLoader.decode(e,r)}}))}requiresHigh(e){let t,r=this.renderRoot.querySelector(".viewport");return!!r&&!!(t=function(e,t){if(t.width<=0||t.height<=0)return;let r=e.width/e.height,i=t.width/t.height;return{height:i>r?t.height:t.width/r,pixelRatio:window.devicePixelRatio||1,width:i>r?t.height*r:t.width}}(e,r.getBoundingClientRect()))&&(e.width<t.width*t.pixelRatio||e.height<t.height*t.pixelRatio)}observeResize(){!this.resizeObserver&&"u">typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>{this.upgradeBaseAfterResize()}),this.resizeObserver.observe(this))}async upgradeBaseAfterResize(){let e=this.imageSets,t=this.abortController?.signal;if("ready"!==this.viewerState||"medium"!==this.baseTier||this.baseUpgradePending||!e?.high.length||!t||!this.baseFrames[0]||!this.requiresHigh(this.baseFrames[0]))return;this.baseUpgradePending=!0;let r=this.loadRevision;try{let i=await this.decodeBaseFrames(e,!0,t);if(!this.isCurrent(r)||"ready"!==this.viewerState)return;this.baseFrames=i,this.baseTier="high",this.zoomed||this.setCurrentFrame(i[this.currentPosition])}catch(e){r5(e)}finally{this.isCurrent(r)&&(this.baseUpgradePending=!1)}}handleKeyDown=e=>{if(!("ready"!==this.viewerState||0===this.baseFrames.length||e.target instanceof Element&&e.target.closest("button"))){if("Escape"===e.key&&this.zoomed){e.preventDefault(),this.zoomStop();return}if("Enter"===e.key||" "===e.key){e.preventDefault(),this.zoomed?this.zoomStop():this.zoomIn();return}this.zoomed||("ArrowLeft"===e.key?(e.preventDefault(),this.showPosition(this.currentPosition-1)):"ArrowRight"===e.key&&(e.preventDefault(),this.showPosition(this.currentPosition+1)))}};handlePointerDown=e=>{"ready"!==this.viewerState||!e.isPrimary||"mouse"===e.pointerType&&0!==e.button||e.target instanceof Element&&e.target.closest("button")||(this.activePointer={id:e.pointerId,moved:!1,pointerType:e.pointerType,spinning:!1,startPosition:this.currentPosition,startX:e.clientX,startY:e.clientY,zoomedAtStart:this.zoomed})};handlePointerMove=e=>{let t=this.activePointer;if(this.zoomed&&!t&&"mouse"===e.pointerType)return void this.updateZoomOrigin(e);if(!t||t.id!==e.pointerId||0===this.baseFrames.length)return;if("mouse"===t.pointerType&&(1&e.buttons)==0){this.activePointer=void 0,t.spinning&&(this.dispatchWidgetEvent("spin-end",{index:this.baseFrames[this.currentPosition].index}),this.requestUpdate());return}let r=e.clientX-t.startX,i=e.clientY-t.startY;if(t.zoomedAtStart){(Math.abs(r)>=6||Math.abs(i)>=6)&&(t.moved=!0),t.moved&&(e.preventDefault(),this.updateZoomOrigin(e));return}if(!t.spinning){if(6>Math.abs(r)&&6>Math.abs(i))return;if(t.moved=!0,Math.abs(i)>Math.abs(r)){"touch"===t.pointerType&&(this.activePointer=void 0);return}t.spinning=!0;let n=e.currentTarget;try{n.setPointerCapture?.(e.pointerId)}catch{}this.dispatchWidgetEvent("spin-start",{index:this.baseFrames[this.currentPosition].index}),this.requestUpdate()}e.preventDefault();let n=Math.round(r/Math.max(e.currentTarget.getBoundingClientRect().width,1)*this.baseFrames.length);this.showPosition(t.startPosition+n)};handlePointerEnd=e=>{let t=this.activePointer;if(t&&t.id===e.pointerId){if(this.activePointer=void 0,t.zoomedAtStart){t.moved||this.zoomStop(),this.requestUpdate();return}if(t.spinning)this.dispatchWidgetEvent("spin-end",{index:this.baseFrames[this.currentPosition].index});else if(!t.moved){let t=e.currentTarget.getBoundingClientRect();this.startZoom((e.clientX-t.left)/Math.max(t.width,1)*100,(e.clientY-t.top)/Math.max(t.height,1)*100)}this.requestUpdate()}};cancelActivePointer(){let e=this.activePointer;if(!e)return;this.activePointer=void 0;let t=this.renderRoot.querySelector(".viewport");try{t?.hasPointerCapture?.(e.id)&&t.releasePointerCapture(e.id)}catch{}let r=this.baseFrames[this.currentPosition];e.spinning&&r&&this.dispatchWidgetEvent("spin-end",{index:r.index}),this.requestUpdate()}handleZoomButtonClick=e=>{e.stopPropagation(),this.zoomed?this.zoomStop():this.zoomIn()};hasZoomControl(){return(this.controls??"zoom").split(/\s+/).includes("zoom")}startZoom(e,t){if("ready"!==this.viewerState||0===this.baseFrames.length||this.zoomed)return;this.zoomed=!0,this.zoomOrigin={x:Math.min(100,Math.max(0,e)),y:Math.min(100,Math.max(0,t))};let r=this.baseFrames[this.currentPosition];this.zoomScale=2.8,this.setCurrentFrame(r),this.dispatchWidgetEvent("zoom-change",{active:!0}),this.upgradeZoomFrame(this.currentPosition,this.loadRevision)}async upgradeZoomFrame(e,t){let r=this.abortController?.signal,i=this.baseFrames[e],n=this.imageSets?.high.find(e=>e.index===i?.index);if(r&&i&&n&&n.url!==i.url)try{let i=await this.imageLoader.decode(n,r);this.isCurrent(t)&&this.zoomed&&this.currentPosition===e&&this.setCurrentFrame(i)}catch{}}updateZoomOrigin(e){let t=e.currentTarget.getBoundingClientRect();this.zoomOrigin={x:Math.min(100,Math.max(0,(e.clientX-t.left)/Math.max(t.width,1)*100)),y:Math.min(100,Math.max(0,(e.clientY-t.top)/Math.max(t.height,1)*100))}}showPosition(e){let t=this.baseFrames.length;if(0===t)return;let r=(e%t+t)%t;if(r===this.currentPosition)return;this.currentPosition=r;let i=this.baseFrames[r];this.setCurrentFrame(i),this.dispatchWidgetEvent("frame-change",{index:i.index})}isCurrent(e){return this.isConnected&&e===this.loadRevision}fail(e,t){this.isCurrent(t)&&(this.setViewerState("error"),this.dispatchWidgetEvent("error",e))}setViewerState(e){this.viewerState=e,this.dataset.state=e}setCurrentFrame(e){this.currentFrame=e}dispatchWidgetEvent(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}}"u"<typeof customElements||"u"<typeof ShadowRoot||"u"<typeof PointerEvent||"u"<typeof ResizeObserver||customElements.get(r7)||customElements.define(r7,it)})();
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@neurodyn/spin-viewer",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.0-canary-20260901162651",
|
|
5
|
+
"sideEffects": true,
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/spin-viewer.embed.min.js",
|
|
10
|
+
"unpkg": "./dist/spin-viewer.embed.min.js",
|
|
11
|
+
"jsdelivr": "./dist/spin-viewer.embed.min.js",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"lit": "^3.3.2"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@rsbuild/core": "1.7.1",
|
|
20
|
+
"@rsdoctor/rspack-plugin": "^1.5.16",
|
|
21
|
+
"@rslib/core": "^0.18.6",
|
|
22
|
+
"eslint": "9.39.1",
|
|
23
|
+
"typescript": "^5.9.3"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "rslib build",
|
|
27
|
+
"test": "playwright test e2e && pnpm run test:bundle",
|
|
28
|
+
"test:bundle": "node scripts/inspect-bundle.mjs",
|
|
29
|
+
"test:e2e": "playwright test e2e",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"lint": "eslint .",
|
|
32
|
+
"lint:fix": "eslint . --fix",
|
|
33
|
+
"rsdoctor": "RSDOCTOR=true rslib build"
|
|
34
|
+
}
|
|
35
|
+
}
|