xactsize-webcomponents 1.0.27 → 1.0.29
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.
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const g=globalThis,rA=g.ShadowRoot&&(g.ShadyCSS===void 0||g.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pA=Symbol(),sA=new WeakMap;let iA=class{constructor(A,t,l){if(this._$cssResult$=!0,l!==pA)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=A,this.t=t}get styleSheet(){let A=this.o;const t=this.t;if(rA&&A===void 0){const l=t!==void 0&&t.length===1;l&&(A=sA.get(t)),A===void 0&&((this.o=A=new CSSStyleSheet).replaceSync(this.cssText),l&&sA.set(t,A))}return A}toString(){return this.cssText}};const
|
|
5
|
+
*/const g=globalThis,rA=g.ShadowRoot&&(g.ShadyCSS===void 0||g.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pA=Symbol(),sA=new WeakMap;let iA=class{constructor(A,t,l){if(this._$cssResult$=!0,l!==pA)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=A,this.t=t}get styleSheet(){let A=this.o;const t=this.t;if(rA&&A===void 0){const l=t!==void 0&&t.length===1;l&&(A=sA.get(t)),A===void 0&&((this.o=A=new CSSStyleSheet).replaceSync(this.cssText),l&&sA.set(t,A))}return A}toString(){return this.cssText}};const YA=r=>new iA(typeof r=="string"?r:r+"",void 0,pA),m=(r,...A)=>{const t=r.length===1?r[0]:A.reduce((l,e,p)=>l+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(e)+r[p+1],r[0]);return new iA(t,r,pA)},CA=(r,A)=>{if(rA)r.adoptedStyleSheets=A.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of A){const l=document.createElement("style"),e=g.litNonce;e!==void 0&&l.setAttribute("nonce",e),l.textContent=t.cssText,r.appendChild(l)}},xA=rA?r=>r:r=>r instanceof CSSStyleSheet?(A=>{let t="";for(const l of A.cssRules)t+=l.cssText;return YA(t)})(r):r;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:DA,defineProperty:QA,getOwnPropertyDescriptor:gA,getOwnPropertyNames:BA,getOwnPropertySymbols:_A,getPrototypeOf:$A}=Object,x=globalThis,KA=x.trustedTypes,At=KA?KA.emptyScript:"",nA=x.reactiveElementPolyfillSupport,z=(r,A)=>r,B={toAttribute(r,A){switch(A){case Boolean:r=r?At:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,A){let t=r;switch(A){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},VA=(r,A)=>!DA(r,A),UA={attribute:!0,type:String,converter:B,reflect:!1,useDefault:!1,hasChanged:VA};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),x.litPropertyMetadata??(x.litPropertyMetadata=new WeakMap);let
|
|
9
|
+
*/const{is:DA,defineProperty:QA,getOwnPropertyDescriptor:gA,getOwnPropertyNames:BA,getOwnPropertySymbols:_A,getPrototypeOf:$A}=Object,x=globalThis,KA=x.trustedTypes,At=KA?KA.emptyScript:"",nA=x.reactiveElementPolyfillSupport,z=(r,A)=>r,B={toAttribute(r,A){switch(A){case Boolean:r=r?At:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,A){let t=r;switch(A){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},VA=(r,A)=>!DA(r,A),UA={attribute:!0,type:String,converter:B,reflect:!1,useDefault:!1,hasChanged:VA};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),x.litPropertyMetadata??(x.litPropertyMetadata=new WeakMap);let N=class extends HTMLElement{static addInitializer(A){this._$Ei(),(this.l??(this.l=[])).push(A)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(A,t=UA){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(A)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(A,t),!t.noAccessor){const l=Symbol(),e=this.getPropertyDescriptor(A,l,t);e!==void 0&&QA(this.prototype,A,e)}}static getPropertyDescriptor(A,t,l){const{get:e,set:p}=gA(this.prototype,A)??{get(){return this[t]},set(n){this[t]=n}};return{get:e,set(n){const S=e==null?void 0:e.call(this);p==null||p.call(this,n),this.requestUpdate(A,S,l)},configurable:!0,enumerable:!0}}static getPropertyOptions(A){return this.elementProperties.get(A)??UA}static _$Ei(){if(this.hasOwnProperty(z("elementProperties")))return;const A=$A(this);A.finalize(),A.l!==void 0&&(this.l=[...A.l]),this.elementProperties=new Map(A.elementProperties)}static finalize(){if(this.hasOwnProperty(z("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(z("properties"))){const t=this.properties,l=[...BA(t),..._A(t)];for(const e of l)this.createProperty(e,t[e])}const A=this[Symbol.metadata];if(A!==null){const t=litPropertyMetadata.get(A);if(t!==void 0)for(const[l,e]of t)this.elementProperties.set(l,e)}this._$Eh=new Map;for(const[t,l]of this.elementProperties){const e=this._$Eu(t,l);e!==void 0&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(A){const t=[];if(Array.isArray(A)){const l=new Set(A.flat(1/0).reverse());for(const e of l)t.unshift(xA(e))}else A!==void 0&&t.push(xA(A));return t}static _$Eu(A,t){const l=t.attribute;return l===!1?void 0:typeof l=="string"?l:typeof A=="string"?A.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var A;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(A=this.constructor.l)==null||A.forEach(t=>t(this))}addController(A){var t;(this._$EO??(this._$EO=new Set)).add(A),this.renderRoot!==void 0&&this.isConnected&&((t=A.hostConnected)==null||t.call(A))}removeController(A){var t;(t=this._$EO)==null||t.delete(A)}_$E_(){const A=new Map,t=this.constructor.elementProperties;for(const l of t.keys())this.hasOwnProperty(l)&&(A.set(l,this[l]),delete this[l]);A.size>0&&(this._$Ep=A)}createRenderRoot(){const A=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return CA(A,this.constructor.elementStyles),A}connectedCallback(){var A;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(A=this._$EO)==null||A.forEach(t=>{var l;return(l=t.hostConnected)==null?void 0:l.call(t)})}enableUpdating(A){}disconnectedCallback(){var A;(A=this._$EO)==null||A.forEach(t=>{var l;return(l=t.hostDisconnected)==null?void 0:l.call(t)})}attributeChangedCallback(A,t,l){this._$AK(A,l)}_$ET(A,t){var p;const l=this.constructor.elementProperties.get(A),e=this.constructor._$Eu(A,l);if(e!==void 0&&l.reflect===!0){const n=(((p=l.converter)==null?void 0:p.toAttribute)!==void 0?l.converter:B).toAttribute(t,l.type);this._$Em=A,n==null?this.removeAttribute(e):this.setAttribute(e,n),this._$Em=null}}_$AK(A,t){var p,n;const l=this.constructor,e=l._$Eh.get(A);if(e!==void 0&&this._$Em!==e){const S=l.getPropertyOptions(e),q=typeof S.converter=="function"?{fromAttribute:S.converter}:((p=S.converter)==null?void 0:p.fromAttribute)!==void 0?S.converter:B;this._$Em=e,this[e]=q.fromAttribute(t,S.type)??((n=this._$Ej)==null?void 0:n.get(e))??null,this._$Em=null}}requestUpdate(A,t,l){var e;if(A!==void 0){const p=this.constructor,n=this[A];if(l??(l=p.getPropertyOptions(A)),!((l.hasChanged??VA)(n,t)||l.useDefault&&l.reflect&&n===((e=this._$Ej)==null?void 0:e.get(A))&&!this.hasAttribute(p._$Eu(A,l))))return;this.C(A,t,l)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(A,t,{useDefault:l,reflect:e,wrapped:p},n){l&&!(this._$Ej??(this._$Ej=new Map)).has(A)&&(this._$Ej.set(A,n??t??this[A]),p!==!0||n!==void 0)||(this._$AL.has(A)||(this.hasUpdated||l||(t=void 0),this._$AL.set(A,t)),e===!0&&this._$Em!==A&&(this._$Eq??(this._$Eq=new Set)).add(A))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const A=this.scheduleUpdate();return A!=null&&await A,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var l;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[p,n]of this._$Ep)this[p]=n;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[p,n]of e){const{wrapped:S}=n,q=this[p];S!==!0||this._$AL.has(p)||q===void 0||this.C(p,void 0,n,q)}}let A=!1;const t=this._$AL;try{A=this.shouldUpdate(t),A?(this.willUpdate(t),(l=this._$EO)==null||l.forEach(e=>{var p;return(p=e.hostUpdate)==null?void 0:p.call(e)}),this.update(t)):this._$EM()}catch(e){throw A=!1,this._$EM(),e}A&&this._$AE(t)}willUpdate(A){}_$AE(A){var t;(t=this._$EO)==null||t.forEach(l=>{var e;return(e=l.hostUpdated)==null?void 0:e.call(l)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(A)),this.updated(A)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(A){return!0}update(A){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(A){}firstUpdated(A){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[z("elementProperties")]=new Map,N[z("finalized")]=new Map,nA==null||nA({ReactiveElement:N}),(x.reactiveElementVersions??(x.reactiveElementVersions=[])).push("2.1.0");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
13
|
*/const G=globalThis,_=G.trustedTypes,vA=_?_.createPolicy("lit-html",{createHTML:r=>r}):void 0,OA="$lit$",K=`lit$${Math.random().toFixed(9).slice(2)}$`,WA="?"+K,tt=`<${WA}>`,v=document,F=()=>v.createComment(""),M=r=>r===null||typeof r!="object"&&typeof r!="function",qA=Array.isArray,lt=r=>qA(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",SA=`[
|
|
14
|
-
\f\r]`,h=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,bA=/-->/g,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
14
|
+
\f\r]`,h=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,bA=/-->/g,LA=/>/g,O=RegExp(`>|${SA}(?:([^\\s"'>=/]+)(${SA}*=${SA}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),oA=/'/g,fA=/"/g,PA=/^(?:script|style|textarea|title)$/i,et=r=>(A,...t)=>({_$litType$:r,strings:A,values:t}),J=et(1),W=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),mA=new WeakMap,b=v.createTreeWalker(v,129);function NA(r,A){if(!qA(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return vA!==void 0?vA.createHTML(A):A}const rt=(r,A)=>{const t=r.length-1,l=[];let e,p=A===2?"<svg>":A===3?"<math>":"",n=h;for(let S=0;S<t;S++){const q=r[S];let y,T,d=-1,i=0;for(;i<q.length&&(n.lastIndex=i,T=n.exec(q),T!==null);)i=n.lastIndex,n===h?T[1]==="!--"?n=bA:T[1]!==void 0?n=LA:T[2]!==void 0?(PA.test(T[2])&&(e=RegExp("</"+T[2],"g")),n=O):T[3]!==void 0&&(n=O):n===O?T[0]===">"?(n=e??h,d=-1):T[1]===void 0?d=-2:(d=n.lastIndex-T[2].length,y=T[1],n=T[3]===void 0?O:T[3]==='"'?fA:oA):n===fA||n===oA?n=O:n===bA||n===LA?n=h:(n=O,e=void 0);const U=n===O&&r[S+1].startsWith("/>")?" ":"";p+=n===h?q+tt:d>=0?(l.push(y),q.slice(0,d)+OA+q.slice(d)+K+U):q+K+(d===-2?S:U)}return[NA(r,p+(r[t]||"<?>")+(A===2?"</svg>":A===3?"</math>":"")),l]};class E{constructor({strings:A,_$litType$:t},l){let e;this.parts=[];let p=0,n=0;const S=A.length-1,q=this.parts,[y,T]=rt(A,t);if(this.el=E.createElement(y,l),b.currentNode=this.el.content,t===2||t===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(e=b.nextNode())!==null&&q.length<S;){if(e.nodeType===1){if(e.hasAttributes())for(const d of e.getAttributeNames())if(d.endsWith(OA)){const i=T[n++],U=e.getAttribute(d).split(K),eA=/([.?@])?(.*)/.exec(i);q.push({type:1,index:p,name:eA[2],strings:U,ctor:eA[1]==="."?nt:eA[1]==="?"?Vt:eA[1]==="@"?qt:$}),e.removeAttribute(d)}else d.startsWith(K)&&(q.push({type:6,index:p}),e.removeAttribute(d));if(PA.test(e.tagName)){const d=e.textContent.split(K),i=d.length-1;if(i>0){e.textContent=_?_.emptyScript:"";for(let U=0;U<i;U++)e.append(d[U],F()),b.nextNode(),q.push({type:2,index:++p});e.append(d[i],F())}}}else if(e.nodeType===8)if(e.data===WA)q.push({type:2,index:p});else{let d=-1;for(;(d=e.data.indexOf(K,d+1))!==-1;)q.push({type:7,index:p}),d+=K.length-1}p++}}static createElement(A,t){const l=v.createElement("template");return l.innerHTML=A,l}}function Z(r,A,t=r,l){var n,S;if(A===W)return A;let e=l!==void 0?(n=t._$Co)==null?void 0:n[l]:t._$Cl;const p=M(A)?void 0:A._$litDirective$;return(e==null?void 0:e.constructor)!==p&&((S=e==null?void 0:e._$AO)==null||S.call(e,!1),p===void 0?e=void 0:(e=new p(r),e._$AT(r,t,l)),l!==void 0?(t._$Co??(t._$Co=[]))[l]=e:t._$Cl=e),e!==void 0&&(A=Z(r,e._$AS(r,A.values),e,l)),A}class pt{constructor(A,t){this._$AV=[],this._$AN=void 0,this._$AD=A,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(A){const{el:{content:t},parts:l}=this._$AD,e=((A==null?void 0:A.creationScope)??v).importNode(t,!0);b.currentNode=e;let p=b.nextNode(),n=0,S=0,q=l[0];for(;q!==void 0;){if(n===q.index){let y;q.type===2?y=new I(p,p.nextSibling,this,A):q.type===1?y=new q.ctor(p,q.name,q.strings,this,A):q.type===6&&(y=new St(p,this,A)),this._$AV.push(y),q=l[++S]}n!==(q==null?void 0:q.index)&&(p=b.nextNode(),n++)}return b.currentNode=v,e}p(A){let t=0;for(const l of this._$AV)l!==void 0&&(l.strings!==void 0?(l._$AI(A,l,t),t+=l.strings.length-2):l._$AI(A[t])),t++}}class I{get _$AU(){var A;return((A=this._$AM)==null?void 0:A._$AU)??this._$Cv}constructor(A,t,l,e){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=A,this._$AB=t,this._$AM=l,this.options=e,this._$Cv=(e==null?void 0:e.isConnected)??!0}get parentNode(){let A=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(A==null?void 0:A.nodeType)===11&&(A=t.parentNode),A}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(A,t=this){A=Z(this,A,t),M(A)?A===j||A==null||A===""?(this._$AH!==j&&this._$AR(),this._$AH=j):A!==this._$AH&&A!==W&&this._(A):A._$litType$!==void 0?this.$(A):A.nodeType!==void 0?this.T(A):lt(A)?this.k(A):this._(A)}O(A){return this._$AA.parentNode.insertBefore(A,this._$AB)}T(A){this._$AH!==A&&(this._$AR(),this._$AH=this.O(A))}_(A){this._$AH!==j&&M(this._$AH)?this._$AA.nextSibling.data=A:this.T(v.createTextNode(A)),this._$AH=A}$(A){var p;const{values:t,_$litType$:l}=A,e=typeof l=="number"?this._$AC(A):(l.el===void 0&&(l.el=E.createElement(NA(l.h,l.h[0]),this.options)),l);if(((p=this._$AH)==null?void 0:p._$AD)===e)this._$AH.p(t);else{const n=new pt(e,this),S=n.u(this.options);n.p(t),this.T(S),this._$AH=n}}_$AC(A){let t=mA.get(A.strings);return t===void 0&&mA.set(A.strings,t=new E(A)),t}k(A){qA(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let l,e=0;for(const p of A)e===t.length?t.push(l=new I(this.O(F()),this.O(F()),this,this.options)):l=t[e],l._$AI(p),e++;e<t.length&&(this._$AR(l&&l._$AB.nextSibling,e),t.length=e)}_$AR(A=this._$AA.nextSibling,t){var l;for((l=this._$AP)==null?void 0:l.call(this,!1,!0,t);A&&A!==this._$AB;){const e=A.nextSibling;A.remove(),A=e}}setConnected(A){var t;this._$AM===void 0&&(this._$Cv=A,(t=this._$AP)==null||t.call(this,A))}}class ${get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(A,t,l,e,p){this.type=1,this._$AH=j,this._$AN=void 0,this.element=A,this.name=t,this._$AM=e,this.options=p,l.length>2||l[0]!==""||l[1]!==""?(this._$AH=Array(l.length-1).fill(new String),this.strings=l):this._$AH=j}_$AI(A,t=this,l,e){const p=this.strings;let n=!1;if(p===void 0)A=Z(this,A,t,0),n=!M(A)||A!==this._$AH&&A!==W,n&&(this._$AH=A);else{const S=A;let q,y;for(A=p[0],q=0;q<p.length-1;q++)y=Z(this,S[l+q],t,q),y===W&&(y=this._$AH[q]),n||(n=!M(y)||y!==this._$AH[q]),y===j?A=j:A!==j&&(A+=(y??"")+p[q+1]),this._$AH[q]=y}n&&!e&&this.j(A)}j(A){A===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,A??"")}}class nt extends ${constructor(){super(...arguments),this.type=3}j(A){this.element[this.name]=A===j?void 0:A}}class Vt extends ${constructor(){super(...arguments),this.type=4}j(A){this.element.toggleAttribute(this.name,!!A&&A!==j)}}class qt extends ${constructor(A,t,l,e,p){super(A,t,l,e,p),this.type=5}_$AI(A,t=this){if((A=Z(this,A,t,0)??j)===W)return;const l=this._$AH,e=A===j&&l!==j||A.capture!==l.capture||A.once!==l.once||A.passive!==l.passive,p=A!==j&&(l===j||e);e&&this.element.removeEventListener(this.name,this,l),p&&this.element.addEventListener(this.name,this,A),this._$AH=A}handleEvent(A){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,A):this._$AH.handleEvent(A)}}class St{constructor(A,t,l){this.element=A,this.type=6,this._$AN=void 0,this._$AM=t,this.options=l}get _$AU(){return this._$AM._$AU}_$AI(A){Z(this,A)}}const aA=G.litHtmlPolyfillSupport;aA==null||aA(E,I),(G.litHtmlVersions??(G.litHtmlVersions=[])).push("3.3.0");const at=(r,A,t)=>{const l=(t==null?void 0:t.renderBefore)??A;let e=l._$litPart$;if(e===void 0){const p=(t==null?void 0:t.renderBefore)??null;l._$litPart$=e=new I(A.insertBefore(F(),p),p,void 0,t??{})}return e._$AI(r),e};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const
|
|
19
|
+
*/const L=globalThis;let X=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const A=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=A.firstChild),A}update(A){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(A),this._$Do=at(t,this.renderRoot,this.renderOptions)}connectedCallback(){var A;super.connectedCallback(),(A=this._$Do)==null||A.setConnected(!0)}disconnectedCallback(){var A;super.disconnectedCallback(),(A=this._$Do)==null||A.setConnected(!1)}render(){return W}};X._$litElement$=!0,X.finalized=!0,(wA=L.litElementHydrateSupport)==null||wA.call(L,{LitElement:X});const dA=L.litElementPolyfillSupport;dA==null||dA({LitElement:X}),(L.litElementVersions??(L.litElementVersions=[])).push("4.2.0");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2017 Google LLC
|
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
-
*/function
|
|
31
|
+
*/function k(r){return c({...r,state:!0,attribute:!1})}/**
|
|
32
32
|
* @license
|
|
33
33
|
* Copyright 2021 Google LLC
|
|
34
34
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2021 Google LLC
|
|
38
38
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
-
*/const yt=r=>typeof r!="string"&&"strTag"in r,
|
|
39
|
+
*/const yt=r=>typeof r!="string"&&"strTag"in r,ZA=(r,A,t)=>{let l=r[0];for(let e=1;e<r.length;e++)l+=A[t?t[e-1]:e-1],l+=r[e];return l};/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2021 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/const RA=r=>yt(r)?
|
|
43
|
+
*/const RA=r=>yt(r)?ZA(r.strings,r.values):r;let V=RA,HA=!1;function ct(r){if(HA)throw new Error("lit-localize can only be configured once");V=r,HA=!0}/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2021 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
-
*/class jt{constructor(A){this.__litLocalizeEventHandler=t=>{t.detail.status==="ready"&&this.host.requestUpdate()},this.host=A}hostConnected(){window.addEventListener(uA,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(uA,this.__litLocalizeEventHandler)}}const
|
|
47
|
+
*/class jt{constructor(A){this.__litLocalizeEventHandler=t=>{t.detail.status==="ready"&&this.host.requestUpdate()},this.host=A}hostConnected(){window.addEventListener(uA,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(uA,this.__litLocalizeEventHandler)}}const Tt=r=>r.addController(new jt(r));/**
|
|
48
48
|
* @license
|
|
49
49
|
* Copyright 2021 Google LLC
|
|
50
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
|
-
*/const w=()=>(r,A)=>(r.addInitializer(
|
|
51
|
+
*/const w=()=>(r,A)=>(r.addInitializer(Tt),r);/**
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright 2020 Google LLC
|
|
54
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -56,27 +56,27 @@
|
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2014 Travis Webb
|
|
58
58
|
* SPDX-License-Identifier: MIT
|
|
59
|
-
*/const s=[];for(let r=0;r<256;r++)s[r]=(r>>4&15).toString(16)+(r&15).toString(16);function
|
|
59
|
+
*/const s=[];for(let r=0;r<256;r++)s[r]=(r>>4&15).toString(16)+(r&15).toString(16);function kt(r){let A=0,t=8997,l=0,e=33826,p=0,n=40164,S=0,q=52210;for(let y=0;y<r.length;y++)t^=r.charCodeAt(y),A=t*435,l=e*435,p=n*435,S=q*435,p+=t<<8,S+=e<<8,l+=A>>>16,t=A&65535,p+=l>>>16,e=l&65535,q=S+(p>>>16)&65535,n=p&65535;return s[q>>8]+s[q&255]+s[n>>8]+s[n&255]+s[e>>8]+s[e&255]+s[t>>8]+s[t&255]}/**
|
|
60
60
|
* @license
|
|
61
61
|
* Copyright 2020 Google LLC
|
|
62
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/const Jt="",Xt="h",st="s";function it(r,A){return(A?Xt:st)+
|
|
63
|
+
*/const Jt="",Xt="h",st="s";function it(r,A){return(A?Xt:st)+kt(typeof r=="string"?r:r.join(Jt))}/**
|
|
64
64
|
* @license
|
|
65
65
|
* Copyright 2021 Google LLC
|
|
66
66
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
67
|
-
*/const GA=new WeakMap,FA=new Map;function xt(r,A,t){if(r){const l=(t==null?void 0:t.id)??Kt(A),e=r[l];if(e){if(typeof e=="string")return e;if("strTag"in e)return
|
|
67
|
+
*/const GA=new WeakMap,FA=new Map;function xt(r,A,t){if(r){const l=(t==null?void 0:t.id)??Kt(A),e=r[l];if(e){if(typeof e=="string")return e;if("strTag"in e)return ZA(e.strings,A.values,e.values);{let p=GA.get(e);return p===void 0&&(p=e.values,GA.set(e,p)),{...e,values:p.map(n=>A.values[n])}}}}return RA(A)}function Kt(r){const A=typeof r=="string"?r:r.strings;let t=FA.get(A);return t===void 0&&(t=it(A,typeof r!="string"&&!("strTag"in r)),FA.set(A,t)),t}/**
|
|
68
68
|
* @license
|
|
69
69
|
* Copyright 2021 Google LLC
|
|
70
70
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
71
|
-
*/function yA(r){window.dispatchEvent(new CustomEvent(uA,{detail:r}))}let AA="",cA,MA,tA,jA,hA,
|
|
71
|
+
*/function yA(r){window.dispatchEvent(new CustomEvent(uA,{detail:r}))}let AA="",cA,MA,tA,jA,hA,o=new zA;o.resolve();let lA=0;const Ut=r=>(ct((A,t)=>xt(hA,A,t)),AA=MA=r.sourceLocale,tA=new Set(r.targetLocales),tA.add(r.sourceLocale),jA=r.loadLocale,{getLocale:vt,setLocale:Ot}),vt=()=>AA,Ot=r=>{if(r===(cA??AA))return o.promise;if(!tA||!jA)throw new Error("Internal error");if(!tA.has(r))throw new Error("Invalid locale code");lA++;const A=lA;return cA=r,o.settled&&(o=new zA),yA({status:"loading",loadingLocale:r}),(r===MA?Promise.resolve({templates:void 0}):jA(r)).then(l=>{lA===A&&(AA=r,cA=void 0,hA=l.templates,yA({status:"ready",readyLocale:r}),o.resolve())},l=>{lA===A&&(yA({status:"error",errorLocale:r,errorMessage:l.toString()}),o.reject(l))}),o.promise},EA="en",Wt=["pt-BR"];/**
|
|
72
72
|
* @license
|
|
73
73
|
* Copyright 2017 Google LLC
|
|
74
74
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
75
|
-
*/const bt={ATTRIBUTE:1},
|
|
75
|
+
*/const bt={ATTRIBUTE:1},Lt=r=>(...A)=>({_$litDirective$:r,values:A});class ot{constructor(A){}get _$AU(){return this._$AM._$AU}_$AT(A,t,l){this._$Ct=A,this._$AM=t,this._$Ci=l}_$AS(A,t){return this.update(A,t)}update(A,t){return this.render(...t)}}/**
|
|
76
76
|
* @license
|
|
77
77
|
* Copyright 2018 Google LLC
|
|
78
78
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
79
|
-
*/const ft=
|
|
79
|
+
*/const ft=Lt(class extends ot{constructor(r){var A;if(super(r),r.type!==bt.ATTRIBUTE||r.name!=="class"||((A=r.strings)==null?void 0:A.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(A=>r[A]).join(" ")+" "}update(r,[A]){var l,e;if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(p=>p!=="")));for(const p in A)A[p]&&!((l=this.nt)!=null&&l.has(p))&&this.st.add(p);return this.render(A)}const t=r.element.classList;for(const p of this.st)p in A||(t.remove(p),this.st.delete(p));for(const p in A){const n=!!A[p];n===this.st.has(p)||(e=this.nt)!=null&&e.has(p)||(n?(t.add(p),this.st.add(p)):(t.remove(p),this.st.delete(p)))}return W}});var Pt=Object.defineProperty,mt=Object.getOwnPropertyDescriptor,Y=(r,A,t,l)=>{for(var e=l>1?void 0:l?mt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=(l?n(A,t,e):n(e))||e);return l&&e&&Pt(A,t,e),e};let f=class extends X{constructor(){super(...arguments),this.type="button",this.label="",this.disabled=!1,this.variant="contained"}render(){return J`
|
|
80
80
|
<div class="button-wrapper">
|
|
81
81
|
<button
|
|
82
82
|
class=${this.variant}
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
:host {
|
|
92
92
|
display: block;
|
|
93
93
|
width: 100%;
|
|
94
|
-
--brand-primary-fallback: #
|
|
94
|
+
--brand-primary-fallback: #000;
|
|
95
95
|
--text-inverse-fallback: #FFFFFF;
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
|
|
127
127
|
/* Contained (azul cheio) */
|
|
128
128
|
button.contained {
|
|
129
|
-
background-color: var(--brand-primary, var(--brand-primary-fallback, #
|
|
129
|
+
background-color: var(--brand-primary, var(--brand-primary-fallback, #0000));
|
|
130
130
|
color: var(--text-inverse, var(--text-inverse-fallback, #FFFFFF));
|
|
131
131
|
border: none;
|
|
132
132
|
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.15);
|
|
@@ -158,355 +158,217 @@
|
|
|
158
158
|
cursor: not-allowed;
|
|
159
159
|
box-shadow: none;
|
|
160
160
|
}
|
|
161
|
-
`,C([c({type:String})],f.prototype,"type",2),C([c({type:String})],f.prototype,"label",2),C([c({type:Boolean})],f.prototype,"disabled",2),C([c({type:String})],f.prototype,"variant",2),f=C([R("xact-button")],f);var Zt=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,kA=(r,A,t,l)=>{for(var e=l>1?void 0:l?Nt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=(l?n(A,t,e):n(e))||e);return l&&e&&Zt(A,t,e),e};let Y=class extends X{constructor(){super(...arguments),this.height=0}render(){return J`
|
|
162
|
-
<div class="component-content">
|
|
163
|
-
<div class="header-section">
|
|
164
|
-
<h2 class="header-text">${V("Before you begin")}</h2>
|
|
165
|
-
<p class="description-text">
|
|
166
|
-
${V("Maintain an upright posture with your arms away from your body.")}
|
|
167
|
-
</p>
|
|
168
|
-
</div>
|
|
169
|
-
|
|
170
|
-
<div class="main-section">
|
|
171
|
-
<div class="tips-section">
|
|
172
|
-
<h3>${V("Tips")}</h3>
|
|
173
|
-
<div class="tip-item">
|
|
174
|
-
<span class="tip-title">${V("Good Lighting")}</span>
|
|
175
|
-
<p class="tip-text">${V("Choose a well-lit area where you can see your image clearly.")}</p>
|
|
176
|
-
</div>
|
|
177
|
-
<div class="tip-item">
|
|
178
|
-
<span class="tip-title">${V("Clean Background")}</span>
|
|
179
|
-
<p class="tip-text">${V("Position yourself against a plain background.")}</p>
|
|
180
|
-
</div>
|
|
181
|
-
<div class="tip-item">
|
|
182
|
-
<span class="tip-title">${V("Clothes")}</span>
|
|
183
|
-
<p class="tip-text">${V("Wear clothes that you usually wear on a daily basis.")}</p>
|
|
184
|
-
</div>
|
|
185
|
-
<div class="tip-item">
|
|
186
|
-
<span class="tip-title">${V("Framing")}</span>
|
|
187
|
-
<p class="tip-text">${V("Make sure your entire body is visible. The app will guide you.")}</p>
|
|
188
|
-
</div>
|
|
189
|
-
|
|
190
|
-
<form>
|
|
191
|
-
<label for="height-input">
|
|
192
|
-
${V("To get started, please tell us your height.")}
|
|
193
|
-
</label>
|
|
194
|
-
<input id="height-input" type="number" min="50" max="300"
|
|
195
|
-
placeholder=${V("Height (cm)")} required tabindex="1"/>
|
|
196
|
-
</form>
|
|
197
|
-
</div>
|
|
198
|
-
|
|
199
|
-
<div class="images-section">
|
|
200
|
-
<svg width="300" height="245" viewBox="0 0 300 245" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
201
|
-
<path d="M162.404 20.4343H136.498V72.1681H162.404V20.4343Z" fill="#6D4A44"/>
|
|
202
|
-
<path d="M136.932 59.7042C137.111 56.7025 134.822 54.1243 131.82 53.9458C128.818 53.7673 126.24 56.0565 126.062 59.0582C126.055 59.1711 126.058 59.2815 126.058 59.3928L124.039 94.2659C123.861 97.2584 126.143 99.8282 129.136 100.007C132.128 100.184 134.698 97.9027 134.876 94.9102L136.896 60.0371C136.909 59.9267 136.926 59.8171 136.932 59.7042Z" fill="#F3A396"/>
|
|
203
|
-
<mask id="mask0_2344_2604" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="124" y="53" width="13" height="48">
|
|
204
|
-
<path d="M136.932 59.7042C137.111 56.7025 134.822 54.1243 131.82 53.9458C128.818 53.7673 126.24 56.0565 126.062 59.0582C126.055 59.1711 126.058 59.2815 126.058 59.3928L124.039 94.2659C123.861 97.2584 126.143 99.8282 129.136 100.007C132.128 100.184 134.698 97.9027 134.876 94.9102L136.896 60.0371C136.909 59.9267 136.926 59.8171 136.932 59.7042Z" fill="white"/>
|
|
205
|
-
</mask>
|
|
206
|
-
<g mask="url(#mask0_2344_2604)">
|
|
207
|
-
<path d="M138.204 70.4743C138.204 70.4743 128.75 69.6556 123.107 62.3022C123.107 62.3022 124.147 50.6029 133.085 52.4395C142.023 54.2771 138.204 70.4743 138.204 70.4743Z" fill="#F7E6D5"/>
|
|
208
|
-
</g>
|
|
209
|
-
<path d="M134.919 94.4893C135.097 91.4877 132.808 88.9095 129.806 88.731C126.805 88.5524 124.226 90.8417 124.048 93.8433C124.041 93.9562 124.045 94.0667 124.045 94.1771L123.549 131.903L129.384 131.406L134.882 94.8214C134.895 94.711 134.912 94.6022 134.919 94.4893Z" fill="#F3A396"/>
|
|
210
|
-
<path d="M127.448 128.38C125.338 127.785 124.524 128.711 123.862 129.98L123.867 129.981C123.865 129.984 123.863 129.987 123.861 129.99C120.107 136.961 119.557 140.72 118.696 143.533C117.789 146.491 118.801 151.911 120.051 151.807C121.3 151.702 121.169 149.335 120.874 147.594C120.579 145.852 122.125 143.274 123.483 140.942C124.839 138.615 125.307 139.49 125.307 139.49L125.488 141.923C125.556 142.824 126.291 143.466 127.063 143.259C127.658 143.106 127.975 142.544 128.028 141.932L129.389 131.219C129.387 131.218 129.7 129.014 127.448 128.38Z" fill="#F3A396"/>
|
|
211
|
-
<path d="M161.996 59.7042C161.818 56.7025 164.107 54.1243 167.108 53.9458C170.11 53.7673 172.688 56.0565 172.867 59.0582C172.873 59.1711 172.87 59.2815 172.87 59.3928L174.889 94.2659C175.067 97.2584 172.785 99.8282 169.793 100.007C166.8 100.184 164.23 97.9027 164.052 94.9102L162.033 60.0371C162.019 59.9267 162.003 59.8171 161.996 59.7042Z" fill="#F3A396"/>
|
|
212
|
-
<mask id="mask1_2344_2604" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="161" y="53" width="14" height="48">
|
|
213
|
-
<path d="M161.996 59.7042C161.818 56.7025 164.107 54.1243 167.108 53.9458C170.11 53.7673 172.688 56.0565 172.867 59.0582C172.873 59.1711 172.87 59.2815 172.87 59.3928L174.889 94.2659C175.067 97.2584 172.785 99.8282 169.793 100.007C166.8 100.184 164.23 97.9027 164.052 94.9102L162.033 60.0371C162.019 59.9267 162.003 59.8171 161.996 59.7042Z" fill="white"/>
|
|
214
|
-
</mask>
|
|
215
|
-
<g mask="url(#mask1_2344_2604)">
|
|
216
|
-
<path d="M160.725 70.4743C160.725 70.4743 170.178 69.6556 175.821 62.3022C175.821 62.3022 174.782 50.6029 165.844 52.4395C156.906 54.2771 160.725 70.4743 160.725 70.4743Z" fill="#F7E6D5"/>
|
|
217
|
-
</g>
|
|
218
|
-
<path d="M164.008 94.4893C163.829 91.4877 166.119 88.9095 169.12 88.731C172.122 88.5524 174.7 90.8417 174.879 93.8433C174.885 93.9562 174.882 94.0667 174.882 94.1771L175.378 131.903L169.543 131.406L164.045 94.8214C164.031 94.711 164.014 94.6022 164.008 94.4893Z" fill="#F3A396"/>
|
|
219
|
-
<path d="M180.234 143.533C179.372 140.72 178.822 136.962 175.069 129.99C175.067 129.987 175.065 129.984 175.062 129.981L175.067 129.98C174.405 128.711 173.591 127.786 171.481 128.38C169.229 129.014 169.542 131.218 169.542 131.218L170.902 141.931C170.956 142.543 171.273 143.105 171.868 143.258C172.64 143.466 173.375 142.823 173.442 141.923L173.624 139.489C173.624 139.489 174.092 138.615 175.447 140.941C176.807 143.273 178.352 145.852 178.056 147.593C177.761 149.334 177.63 151.702 178.879 151.806C180.129 151.912 181.141 146.492 180.234 143.533Z" fill="#F3A396"/>
|
|
220
|
-
<path d="M149.396 46.7827C138.982 46.7827 128.748 54.6318 128.748 54.6318L136 75.7339C137.155 79.0951 137.306 82.7203 136.435 86.1661L133.953 95.9807H165.719L162.7 86.4759C161.629 82.9661 161.669 79.2113 162.815 75.7256L170.54 54.9474C170.54 54.9474 160.432 46.7827 149.396 46.7827Z" fill="#F7E6D5"/>
|
|
221
|
-
<path d="M134.93 50.8313C134.93 50.8313 145.083 64.5683 165.278 51.4997C165.278 51.4997 158.77 47.0176 149.365 46.6605C142.83 46.4114 134.93 50.8313 134.93 50.8313Z" fill="#F3A396"/>
|
|
222
|
-
<path d="M133.868 69.5197L131.244 61.8865" stroke="#EFE3D8" stroke-width="1.04569" stroke-miterlimit="10"/>
|
|
223
|
-
<path d="M165.141 69.5288L167.767 61.8865" stroke="#EFE3D8" stroke-width="1.04569" stroke-miterlimit="10"/>
|
|
224
|
-
<path d="M165.721 95.9817H150.106H149.573H133.957C133.957 95.9817 127.833 105.494 129.387 122.399H149.573H150.106H170.291C171.352 104.097 165.721 95.9817 165.721 95.9817Z" fill="#242930"/>
|
|
225
|
-
<path d="M138.972 174.134C144.349 174.134 148.706 169.775 148.706 164.4V121.207C148.706 115.831 144.348 111.473 138.972 111.473C133.596 111.473 129.238 115.832 129.238 121.207V164.4C129.238 169.775 133.597 174.134 138.972 174.134Z" fill="#242930"/>
|
|
226
|
-
<path d="M134.605 216.849L135.36 228.943H144.237V216.849H134.605Z" fill="#F3A396"/>
|
|
227
|
-
<path d="M145.192 227.725L145.307 235.072H117.658V234.857C117.658 233.165 118.631 231.624 120.159 230.897L133.707 225.491C134.194 225.259 134.82 225.269 135.191 225.661C136.943 227.508 138.865 230.518 144.21 227.252C144.597 227.016 145.106 227.279 145.192 227.725Z" fill="#131321"/>
|
|
228
|
-
<path d="M117.661 237H145.311V235.072H117.661V237Z" fill="white"/>
|
|
229
|
-
<path d="M138.972 155.314C133.596 155.314 129.238 159.672 129.238 165.048V220.255H148.707V165.048C148.706 159.672 144.349 155.314 138.972 155.314Z" fill="#242930"/>
|
|
230
|
-
<path d="M148.71 211.719H128.131V220.255H148.71V211.719Z" fill="#21262D"/>
|
|
231
|
-
<path d="M160.554 174.134C165.931 174.134 170.288 169.775 170.288 164.4V121.207C170.288 115.831 165.93 111.473 160.554 111.473C155.178 111.473 150.82 115.832 150.82 121.207V164.4C150.82 169.775 155.179 174.134 160.554 174.134Z" fill="#242930"/>
|
|
232
|
-
<path d="M165.395 216.849L164.641 228.943H155.764V216.849H165.395Z" fill="#F3A396"/>
|
|
233
|
-
<path d="M154.807 227.725L154.691 235.072H182.341V234.857C182.341 233.165 181.367 231.624 179.84 230.897L166.292 225.491C165.805 225.259 165.178 225.269 164.807 225.661C163.056 227.508 161.134 230.518 155.789 227.252C155.401 227.016 154.893 227.279 154.807 227.725Z" fill="#131321"/>
|
|
234
|
-
<path d="M182.341 235.072H154.691V237H182.341V235.072Z" fill="white"/>
|
|
235
|
-
<path d="M160.554 155.314C155.178 155.314 150.82 159.672 150.82 165.048V220.255H170.289V165.048C170.289 159.672 165.931 155.314 160.554 155.314Z" fill="#242930"/>
|
|
236
|
-
<path d="M171.399 211.719H150.82V220.255H171.399V211.719Z" fill="#21262D"/>
|
|
237
|
-
<path d="M149.367 52.5674C146.712 52.5674 144.561 50.416 144.561 47.7615V38.436H154.172V47.7607C154.172 50.4152 152.02 52.5674 149.367 52.5674Z" fill="#F3A396"/>
|
|
238
|
-
<path d="M143.75 37.7584C143.75 37.7584 145.894 42.0529 148.861 42.9206C149.654 43.1523 150.5 43.0734 151.264 42.7604C152.381 42.3029 153.806 41.0466 154.171 39.8152V37.1133C154.171 37.1133 149.137 41.6236 143.75 37.7584Z" fill="#1A1A1A"/>
|
|
239
|
-
<path d="M149.425 34.7768C156.588 34.7768 162.396 28.7826 162.396 21.3885C162.396 13.9944 156.588 8.00024 149.425 8.00024C142.261 8.00024 136.453 13.9944 136.453 21.3885C136.453 28.7826 142.261 34.7768 149.425 34.7768Z" fill="#6D4A44"/>
|
|
240
|
-
<path d="M159.489 32.5309C161.678 34.1476 165.466 26.7942 163.332 25.0521C161.198 23.3109 160.028 26.4994 160.028 26.4994L159.469 28.6466L158.881 31.5744V32.2287L159.489 32.5309Z" fill="#F3A396"/>
|
|
241
|
-
<path d="M162.643 27.2678C162.643 27.2678 161.056 26.7381 159.93 29.0755" stroke="#D26665" stroke-width="0.514843" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
242
|
-
<path d="M160.701 27.9324C160.701 27.9324 162.428 28.8557 161.287 30.2448" stroke="#D26665" stroke-width="0.514843" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
243
|
-
<path d="M160.27 21.432C160.27 26.0395 159.629 30.0159 158.989 32.8374C158.362 35.5999 156.599 37.5313 154.108 39.0848L153.655 39.3679C151.019 41.012 147.613 41.051 144.937 39.4659C142.237 37.8675 140.347 35.761 139.765 32.7959C138.707 27.4037 138.592 21.4311 138.592 21.4311C138.592 21.4311 137.586 9.79986 149.277 10.0257C160.967 10.2524 160.27 21.432 160.27 21.432Z" fill="#F3A396"/>
|
|
244
|
-
<path d="M139.414 32.5307C137.224 34.1474 133.436 26.794 135.57 25.0519C137.704 23.3107 139.073 26.8388 139.073 26.8388L139.461 28.7618L139.962 31.5567V32.2351L139.414 32.5307Z" fill="#F3A396"/>
|
|
245
|
-
<path d="M136.262 27.2678C136.262 27.2678 137.848 26.7381 138.975 29.0755" stroke="#D26665" stroke-width="0.514843" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
246
|
-
<path d="M138.206 27.9324C138.206 27.9324 136.479 28.8557 137.62 30.2448" stroke="#D26665" stroke-width="0.514843" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
247
|
-
<path d="M148.387 28.2681V29.5468C148.387 29.6871 148.414 29.8216 148.463 29.9445C148.657 30.4286 149.214 30.6602 149.717 30.5257L150.318 30.2376" stroke="#D26665" stroke-width="0.514843" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
248
|
-
<path d="M145.084 25.7994C145.084 26.3266 144.656 26.7542 144.129 26.7542C143.601 26.7542 143.174 26.3266 143.174 25.7994C143.174 25.2721 143.601 24.8445 144.129 24.8445C144.656 24.8445 145.084 25.2721 145.084 25.7994Z" fill="#1A1A1A"/>
|
|
249
|
-
<path d="M154.888 25.7994C154.888 26.3266 154.461 26.7542 153.933 26.7542C153.406 26.7542 152.979 26.3266 152.979 25.7994C152.979 25.2721 153.406 24.8445 153.933 24.8445C154.461 24.8445 154.888 25.2721 154.888 25.7994Z" fill="#1A1A1A"/>
|
|
250
|
-
<path d="M145.533 32.0991C145.533 32.0991 147.097 33.0764 149.16 33.0764C151.223 33.0764 152.787 32.0991 152.787 32.0991" stroke="#D26665" stroke-width="0.514843" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
251
|
-
<path d="M140.502 24.0441C140.502 24.0441 143.455 23.1307 146.382 22.9763C146.382 22.9763 145.465 21.3928 143.628 21.8196C141.791 22.2472 140.502 24.0441 140.502 24.0441Z" fill="#6D4A44"/>
|
|
252
|
-
<path d="M157.516 24.0441C157.516 24.0441 154.563 23.1307 151.637 22.9763C151.637 22.9763 152.553 21.3928 154.39 21.8196C156.227 22.2472 157.516 24.0441 157.516 24.0441Z" fill="#6D4A44"/>
|
|
253
|
-
<path d="M161.634 21.4461C161.634 21.4461 160.281 10.861 151.087 9.6321C151.087 9.6321 143.751 9.07661 141.199 12.6852C140.1 13.5637 138.553 15.6669 137.967 18.5864C137.064 23.0926 138.204 22.895 138.204 22.895C138.204 22.895 141.851 21.3937 142.414 16.3719C144.587 18.5582 150.922 22.1792 161.634 21.4461Z" fill="#6D4A44"/>
|
|
254
|
-
</svg>
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
</div>
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
</div>
|
|
263
|
-
|
|
264
|
-
<xact-button class="xact-button buttons"
|
|
265
|
-
@click=${()=>{var A;const r=this.shadowRoot.querySelector("#height-input");if(r!=null&&r.value){const t=parseInt(r.value);this.height=t,(A=this.onStartMeasurement)==null||A.call(this,t)}}}
|
|
266
|
-
label="${V("Let's go!")}"
|
|
267
|
-
></xact-button>
|
|
268
|
-
|
|
269
|
-
`}};Y.styles=m`
|
|
270
|
-
:host {
|
|
271
|
-
display: flex;
|
|
272
|
-
flex-direction: column; /* Força coluna para evitar problemas de flex-start */
|
|
273
|
-
justify-content: flex-start;
|
|
274
|
-
align-items: stretch; /* Evita que filhos desapareçam no Safari */
|
|
275
|
-
font-family: "Lato", sans-serif;
|
|
276
|
-
box-sizing: border-box;
|
|
277
|
-
padding: 16px;
|
|
278
|
-
width: 100%;
|
|
279
|
-
min-height: 100vh; /* Garante que o conteúdo caiba */
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.component-content {
|
|
283
|
-
display: flex;
|
|
284
|
-
flex-direction: column;
|
|
285
|
-
gap: 12px;
|
|
286
|
-
width: 100%;
|
|
287
|
-
max-width: 960px;
|
|
288
|
-
margin: 0 auto;
|
|
289
|
-
}
|
|
290
161
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
font-size: 24px;
|
|
297
|
-
font-weight: 700;
|
|
298
|
-
color: #000;
|
|
299
|
-
margin-bottom: 8px;
|
|
300
|
-
line-height: 1.2;
|
|
301
|
-
}
|
|
162
|
+
@media (max-width: 380px) {
|
|
163
|
+
button {
|
|
164
|
+
padding: 10px 24px;
|
|
165
|
+
font-size: 8px;
|
|
166
|
+
min-height: 30px;
|
|
302
167
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
flex: 1 1 200px; /* flex-grow, flex-shrink, flex-basis */
|
|
320
|
-
display: flex;
|
|
321
|
-
justify-content: center;
|
|
322
|
-
align-items: center;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
.images-section svg {
|
|
326
|
-
width: 100%;
|
|
327
|
-
max-width: 400px;
|
|
328
|
-
height: auto;
|
|
329
|
-
flex-shrink: 0; /* Evita sumir no Safari */
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.tips-section {
|
|
333
|
-
flex: 1 1 200px;
|
|
334
|
-
display: flex;
|
|
335
|
-
flex-direction: column;
|
|
336
|
-
gap: 8px;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
.tips-section form {
|
|
340
|
-
display: flex;
|
|
341
|
-
flex-direction: column;
|
|
342
|
-
align-items: flex-start;
|
|
343
|
-
gap: 16px;
|
|
344
|
-
width: 100%;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.tips-section label {
|
|
348
|
-
font-size: 16px;
|
|
349
|
-
color: #333;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.tips-section input {
|
|
353
|
-
width: 100%;
|
|
354
|
-
max-width: 150px;
|
|
355
|
-
padding: 12px;
|
|
356
|
-
font-size: 16px;
|
|
357
|
-
border: 1px solid #ccc;
|
|
358
|
-
border-radius: 6px;
|
|
359
|
-
box-sizing: border-box;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.tips-section input:focus {
|
|
363
|
-
outline: 2px solid var(--brand-primary);
|
|
364
|
-
outline-offset: 2px;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
.xact-button {
|
|
368
|
-
width: 100%;
|
|
369
|
-
max-width: 150px;
|
|
370
|
-
display: flex;
|
|
371
|
-
justify-content: center;
|
|
372
|
-
align-items: center;
|
|
373
|
-
flex-shrink: 0; /* Evita sumir no Safari */
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.tip-item {
|
|
377
|
-
margin-bottom: 4px;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
.tip-title {
|
|
381
|
-
font-weight: bold;
|
|
382
|
-
display: inline-block;
|
|
383
|
-
margin-bottom: 4px;
|
|
384
|
-
font-size: 14px;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
.tip-text {
|
|
388
|
-
margin-top: 0;
|
|
389
|
-
font-size: 12px;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.buttons {
|
|
393
|
-
display: flex;
|
|
394
|
-
flex-direction: column;
|
|
395
|
-
gap: 12px;
|
|
396
|
-
align-items: center;
|
|
397
|
-
justify-content: center;
|
|
398
|
-
width: 100%;
|
|
399
|
-
max-width: 200px;
|
|
400
|
-
margin: 0 auto;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
/* Responsividade para mobile */
|
|
404
|
-
@media (max-width: 754px) {
|
|
405
|
-
.main-section {
|
|
406
|
-
flex-direction: column;
|
|
407
|
-
gap: 8px;
|
|
408
|
-
align-items: center;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.images-section {
|
|
412
|
-
order: -1;
|
|
413
|
-
width: 100%;
|
|
414
|
-
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
`,Y([c({type:String})],f.prototype,"type",2),Y([c({type:String})],f.prototype,"label",2),Y([c({type:Boolean})],f.prototype,"disabled",2),Y([c({type:String})],f.prototype,"variant",2),f=Y([R("xact-button")],f);var Nt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,TA=(r,A,t,l)=>{for(var e=l>1?void 0:l?Zt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=(l?n(A,t,e):n(e))||e);return l&&e&&Nt(A,t,e),e};let C=class extends X{constructor(){super(...arguments),this.height=0,this.handleStart=()=>{var A;const r=this.shadowRoot.querySelector("#height-input");if(r!=null&&r.value){const t=parseInt(r.value);this.height=t,(A=this.onStartMeasurement)==null||A.call(this,t)}}}render(){return J`
|
|
171
|
+
<div class="card">
|
|
172
|
+
<div class="pill">XactSize x Canada Goose</div>
|
|
173
|
+
<h2 class="title">${V("Let's find your perfect size")}</h2>
|
|
174
|
+
<p class="subtitle">${V("Curated luxury. Perfect fit.")}</p>
|
|
175
|
+
|
|
176
|
+
<div class="tips">
|
|
177
|
+
<h4>${V("Tips")}</h4>
|
|
178
|
+
|
|
179
|
+
${this.renderTip(V("Good Lighting"),V("Avoid backlighting"))}
|
|
180
|
+
${this.renderTip(V("Clean Background"),V("Use a plain wall"))}
|
|
181
|
+
${this.renderTip(V("Clothes"),V("Form-fitting gear"))}
|
|
182
|
+
${this.renderTip(V("Framing"),V("Full body shot"))}
|
|
183
|
+
</div>
|
|
415
184
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
185
|
+
<div class="input-group">
|
|
186
|
+
<input
|
|
187
|
+
id="height-input"
|
|
188
|
+
class="height-input"
|
|
189
|
+
type="number"
|
|
190
|
+
min="50"
|
|
191
|
+
max="300"
|
|
192
|
+
placeholder=${V("Enter your height (cm)")}
|
|
193
|
+
required
|
|
194
|
+
tabindex="1"
|
|
195
|
+
/>
|
|
196
|
+
</div>
|
|
420
197
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
198
|
+
<div class="cta">
|
|
199
|
+
<xact-button
|
|
200
|
+
label="${V("Let's get started! →")}"
|
|
201
|
+
style="--brand-primary: #000;"
|
|
202
|
+
@click=${this.handleStart}
|
|
203
|
+
></xact-button>
|
|
204
|
+
</div>
|
|
426
205
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
206
|
+
<p class="disclaimer">
|
|
207
|
+
${V("By using Xactsize, you agree to our Terms and Privacy Policy.")}
|
|
208
|
+
</p>
|
|
209
|
+
</div>
|
|
210
|
+
`}renderTip(r,A){return J`
|
|
211
|
+
<div class="tip">
|
|
212
|
+
<span class="check">
|
|
213
|
+
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
214
|
+
<path d="M5 13l4 4L19 7" />
|
|
215
|
+
</svg>
|
|
216
|
+
</span>
|
|
217
|
+
<div>
|
|
218
|
+
<strong>${r}</strong>
|
|
219
|
+
<span>${A}</span>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
`}};C.styles=m`
|
|
223
|
+
:host {
|
|
224
|
+
display: block;
|
|
225
|
+
font-family: 'Inter', 'Helvetica', Arial, sans-serif;
|
|
226
|
+
color: #111;
|
|
227
|
+
}
|
|
431
228
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
229
|
+
.card {
|
|
230
|
+
max-width: 560px;
|
|
231
|
+
margin: 0 auto;
|
|
232
|
+
padding: 28px 28px 32px;
|
|
233
|
+
background: #ffffff;
|
|
234
|
+
border-radius: 24px;
|
|
235
|
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
|
|
236
|
+
display: flex;
|
|
237
|
+
flex-direction: column;
|
|
238
|
+
gap: 20px;
|
|
239
|
+
box-sizing: border-box;
|
|
240
|
+
}
|
|
437
241
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
242
|
+
.pill {
|
|
243
|
+
align-self: center;
|
|
244
|
+
padding: 8px 16px;
|
|
245
|
+
border-radius: 999px;
|
|
246
|
+
background: #f1f2f3;
|
|
247
|
+
font-size: 11px;
|
|
248
|
+
font-weight: 700;
|
|
249
|
+
letter-spacing: 0.08em;
|
|
250
|
+
color: #555;
|
|
251
|
+
text-transform: uppercase;
|
|
252
|
+
}
|
|
441
253
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
254
|
+
.title {
|
|
255
|
+
text-align: center;
|
|
256
|
+
font-size: 26px;
|
|
257
|
+
font-weight: 700;
|
|
258
|
+
margin: 0;
|
|
259
|
+
line-height: 1.2;
|
|
260
|
+
}
|
|
445
261
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
262
|
+
.subtitle {
|
|
263
|
+
text-align: center;
|
|
264
|
+
color: #666;
|
|
265
|
+
margin: 0;
|
|
266
|
+
font-size: 14px;
|
|
267
|
+
line-height: 1.5;
|
|
268
|
+
}
|
|
450
269
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
270
|
+
.tips {
|
|
271
|
+
display: grid;
|
|
272
|
+
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
|
273
|
+
gap: 12px 16px;
|
|
274
|
+
}
|
|
455
275
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
276
|
+
.tips h4 {
|
|
277
|
+
grid-column: 1 / -1;
|
|
278
|
+
margin: 4px 0;
|
|
279
|
+
font-size: 12px;
|
|
280
|
+
letter-spacing: 0.08em;
|
|
281
|
+
text-transform: uppercase;
|
|
282
|
+
}
|
|
459
283
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
284
|
+
.tip {
|
|
285
|
+
display: flex;
|
|
286
|
+
gap: 10px;
|
|
287
|
+
align-items: flex-start;
|
|
288
|
+
}
|
|
464
289
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
290
|
+
|
|
291
|
+
.check {
|
|
292
|
+
width: 18px;
|
|
293
|
+
height: 18px;
|
|
294
|
+
border-radius: 50%;
|
|
295
|
+
background: #000;
|
|
296
|
+
display: inline-flex;
|
|
297
|
+
align-items: center;
|
|
298
|
+
justify-content: center;
|
|
299
|
+
flex-shrink: 0;
|
|
300
|
+
}
|
|
472
301
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
302
|
+
.check svg {
|
|
303
|
+
width: 10px;
|
|
304
|
+
height: 10px;
|
|
305
|
+
stroke: #fff;
|
|
306
|
+
stroke-width: 2.5;
|
|
307
|
+
fill: none;
|
|
308
|
+
stroke-linecap: round;
|
|
309
|
+
stroke-linejoin: round;
|
|
310
|
+
}
|
|
478
311
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
312
|
+
.tip strong {
|
|
313
|
+
display: block;
|
|
314
|
+
font-size: 14px;
|
|
315
|
+
margin-bottom: 2px;
|
|
316
|
+
}
|
|
482
317
|
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
318
|
+
.tip span {
|
|
319
|
+
display: block;
|
|
320
|
+
font-size: 12px;
|
|
321
|
+
color: #777;
|
|
322
|
+
line-height: 1.4;
|
|
323
|
+
}
|
|
486
324
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
325
|
+
.input-group {
|
|
326
|
+
margin-top: 4px;
|
|
327
|
+
}
|
|
490
328
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
329
|
+
.height-input {
|
|
330
|
+
width: 100%;
|
|
331
|
+
padding: 14px 16px;
|
|
332
|
+
border: 1px solid #e0e0e0;
|
|
333
|
+
border-radius: 12px;
|
|
334
|
+
background: #f7f7f7;
|
|
335
|
+
font-size: 14px;
|
|
336
|
+
color: #111;
|
|
337
|
+
box-sizing: border-box;
|
|
338
|
+
}
|
|
494
339
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
340
|
+
.height-input:focus {
|
|
341
|
+
outline: none;
|
|
342
|
+
border-color: #000;
|
|
343
|
+
box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
|
|
344
|
+
background: #fff;
|
|
345
|
+
}
|
|
498
346
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
347
|
+
.cta {
|
|
348
|
+
margin-top: 8px;
|
|
349
|
+
width: 100%;
|
|
350
|
+
}
|
|
502
351
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
352
|
+
.disclaimer {
|
|
353
|
+
margin: 0;
|
|
354
|
+
text-align: center;
|
|
355
|
+
color: #9a9a9a;
|
|
356
|
+
font-size: 11px;
|
|
357
|
+
line-height: 1.4;
|
|
358
|
+
}
|
|
507
359
|
|
|
508
|
-
|
|
509
|
-
|
|
360
|
+
@media (max-width: 600px) {
|
|
361
|
+
.card {
|
|
362
|
+
padding: 22px 18px 26px;
|
|
363
|
+
}
|
|
364
|
+
.title {
|
|
365
|
+
font-size: 22px;
|
|
366
|
+
}
|
|
367
|
+
.tips {
|
|
368
|
+
grid-template-columns: 1fr;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
`,TA([c({type:Number})],C.prototype,"height",2),TA([c({type:Function})],C.prototype,"onStartMeasurement",2),C=TA([R("xact-step-one"),w()],C);var Rt=Object.getOwnPropertyDescriptor,Ht=(r,A,t,l)=>{for(var e=l>1?void 0:l?Rt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=n(e)||e);return e};let kA=class extends X{render(){return J`
|
|
510
372
|
<footer class="modal-footer">
|
|
511
373
|
<span>
|
|
512
374
|
<span class="powered-by">${V("Powered by")}</span>
|
|
@@ -549,7 +411,7 @@ label="${V("Let's go!")}"
|
|
|
549
411
|
</a>
|
|
550
412
|
</span>
|
|
551
413
|
</footer>
|
|
552
|
-
`}};
|
|
414
|
+
`}};kA.styles=m`
|
|
553
415
|
.modal-footer {
|
|
554
416
|
text-align: center;
|
|
555
417
|
font-size: 12px;
|
|
@@ -585,7 +447,7 @@ label="${V("Let's go!")}"
|
|
|
585
447
|
outline: 2px solid var(--brand-primary);
|
|
586
448
|
outline-offset: 2px;
|
|
587
449
|
}
|
|
588
|
-
`,
|
|
450
|
+
`,kA=Ht([R("xact-footer"),w()],kA);var zt=Object.defineProperty,Gt=Object.getOwnPropertyDescriptor,D=(r,A,t,l)=>{for(var e=l>1?void 0:l?Gt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=(l?n(A,t,e):n(e))||e);return l&&e&&zt(A,t,e),e};let P=class extends X{constructor(){super(...arguments),this.productName="",this.recommendedSize=""}render(){return J`
|
|
589
451
|
<div class="image-container">
|
|
590
452
|
<!-- Imagem da roupa como SVG exportado -->
|
|
591
453
|
<svg class="product-image" width="180" height="240" viewBox="0 0 180 240" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -715,7 +577,7 @@ label="${V("Let's go!")}"
|
|
|
715
577
|
justify-content: center;
|
|
716
578
|
}
|
|
717
579
|
}
|
|
718
|
-
`,D([c({type:String})],P.prototype,"productName",2),D([c({type:String})],P.prototype,"recommendedSize",2),D([c({type:Function})],P.prototype,"onAccept",2),D([c({type:Function})],P.prototype,"onRetry",2),P=D([R("xact-step-result"),w()],P);var Ft=Object.defineProperty,Mt=Object.getOwnPropertyDescriptor,JA=(r,A,t,l)=>{for(var e=l>1?void 0:l?Mt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=(l?n(A,t,e):n(e))||e);return l&&e&&Ft(A,t,e),e};let Q=class extends X{constructor(){super(...arguments),this.height=0}render(){return J`
|
|
580
|
+
`,D([c({type:String})],P.prototype,"productName",2),D([c({type:String})],P.prototype,"recommendedSize",2),D([c({type:Function})],P.prototype,"onAccept",2),D([c({type:Function})],P.prototype,"onRetry",2),P=D([R("xact-step-result"),w()],P);var Ft=Object.defineProperty,Mt=Object.getOwnPropertyDescriptor,JA=(r,A,t,l)=>{for(var e=l>1?void 0:l?Mt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=(l?n(A,t,e):n(e))||e);return l&&e&&Ft(A,t,e),e};let Q=class extends X{constructor(){super(...arguments),this.height=0}render(){const r=Array.from({length:24},(A,t)=>t);return J`
|
|
719
581
|
<div class="component-content">
|
|
720
582
|
<div class="header-section">
|
|
721
583
|
<h2 class="header-text">${V("Before you begin")}</h2>
|
|
@@ -849,10 +711,16 @@ label="${V("Let's go!")}"
|
|
|
849
711
|
|
|
850
712
|
</div>
|
|
851
713
|
<xact-button class="buttons"
|
|
852
|
-
@click=${()=>{var
|
|
714
|
+
@click=${()=>{var A;(A=this.onStep2advancement)==null||A.call(this)}}
|
|
853
715
|
label="${V("To start")}"
|
|
854
716
|
></xact-button>
|
|
855
717
|
</div>
|
|
718
|
+
<div class="snow-layer">
|
|
719
|
+
${r.map(A=>{const t=A*37%100,l=A%6*.35,e=A%5*.4;return J`<span
|
|
720
|
+
class="snowflake"
|
|
721
|
+
style="left:${t}%; animation-delay:${l}s, ${e}s;"
|
|
722
|
+
></span>`})}
|
|
723
|
+
</div>
|
|
856
724
|
`}};Q.styles=m`
|
|
857
725
|
:host {
|
|
858
726
|
display: flex;
|
|
@@ -862,6 +730,8 @@ label="${V("Let's go!")}"
|
|
|
862
730
|
box-sizing: border-box;
|
|
863
731
|
padding: 16px;
|
|
864
732
|
width: 100%;
|
|
733
|
+
position: relative;
|
|
734
|
+
overflow: hidden;
|
|
865
735
|
}
|
|
866
736
|
|
|
867
737
|
.component-content {
|
|
@@ -870,6 +740,8 @@ label="${V("Let's go!")}"
|
|
|
870
740
|
gap: 12px;
|
|
871
741
|
width: 100%;
|
|
872
742
|
max-width: 960px;
|
|
743
|
+
position: relative;
|
|
744
|
+
z-index: 1;
|
|
873
745
|
}
|
|
874
746
|
|
|
875
747
|
.header-section {
|
|
@@ -993,8 +865,60 @@ label="${V("Let's go!")}"
|
|
|
993
865
|
}
|
|
994
866
|
}
|
|
995
867
|
|
|
996
|
-
`,JA([c({type:Number})],Q.prototype,"height",2),JA([c({type:Function})],Q.prototype,"onStep2advancement",2),Q=JA([R("xact-step-informs"),w()],Q);const IA="data:image/svg+xml,%3csvg%20width='22'%20height='40'%20viewBox='0%200%2022%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200L0%2013.3362V0H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.339L0%2026.6724V13.3362H21.517V13.339Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.6755L0%2040.0089V26.6726H21.517V26.6755Z'%20fill='%231C28BA'/%3e%3c/svg%3e",ht="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.00878906L0%2013.345V0.00878906H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.3478L0%2026.6812V13.345H21.517V13.3478Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2026.6843L0%2040.0176V26.6814H21.517V26.6843Z'%20fill='white'/%3e%3c/svg%3e",Et="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.0204381L0%2013.3538V0.0175781H21.517V0.0204381Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2013.3538L0%2026.69V13.3538H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.693L0%2040.0264V26.6902H21.517V26.693Z'%20fill='white'/%3e%3c/svg%3e";var It=Object.defineProperty,wt=Object.getOwnPropertyDescriptor,u=(r,A,t,l)=>{for(var e=l>1?void 0:l?wt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=(l?n(A,t,e):n(e))||e);return l&&e&&It(A,t,e),e};const{getLocale:Ct,setLocale:XA}=Ut({sourceLocale:EA,targetLocales:Wt,loadLocale:r=>H(Object.assign({"./generated/locales/pt-BR.ts":()=>Promise.resolve().then(()=>Yt)}),`./generated/locales/${r}.ts`,4)});a.BodyMeasurer=class extends X{constructor(){super(...arguments),this.spinnerFrame=0,this.apiKey="DB8mP9gStPfvdyeYbbuCV4Zf3SH745dI",this.tenantId="1",this.productSku="123456",this.apiUrl="https://xactsize-dotnet-api-923169850574.southamerica-east1.run.app/api/measurer/measure/body",this._culture="pt-BR",this.measurerKey="",this._isLocaleLoading=!1,this.showModal=!1,this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.errorMessage="",this.instructionMessage=V("Position yourself in front of the camera"),this.shouldStartMeasurement=!1,this.isLoading=!1,this.isFetching=!1,this.videoElement=null,this.stream=null,this.poolingTimeout=null,this.instructionMessageTimeout=null,this.cameras=[],this.currentCameraId=null}firstUpdated(){this.startSpinnerAnimation()}startSpinnerAnimation(){const A=[Et,ht,IA];this.spinnerInterval=setInterval(()=>{var l;const t=(l=this.shadowRoot)==null?void 0:l.querySelector(".spinner");t&&(t.src=A[this.spinnerFrame],this.spinnerFrame=(this.spinnerFrame+1)%A.length)},300)}get culture(){return this._culture}set culture(A){const t=this._culture;this._culture=A,this.requestUpdate("culture",t),this._applyLocale(A).catch(console.error)}async _applyLocale(A){try{this._isLocaleLoading=!0,this.requestUpdate(),await XA(A)}catch(t){console.error("Failed to load locale",A,t),await XA(EA)}finally{this._isLocaleLoading=!1,this.requestUpdate()}}get errorMap(){return{ERR_RIGHT_ARM_TOO_HIGH:V("Lower your right arm",{id:"ERR_RIGHT_ARM_TOO_HIGH"}),ERR_LEFT_ARM_TOO_HIGH:V("Lower your left arm",{id:"ERR_LEFT_ARM_TOO_HIGH"}),ERR_ARMS_NOT_RAISED:V("Raise both arms to a 45-degree angle",{id:"ERR_ARMS_NOT_RAISED"}),ERR_RIGHT_ARM_NOT_RAISED:V("Raise your right arm to a 45-degree angle",{id:"ERR_RIGHT_ARM_NOT_RAISED"}),ERR_LEFT_ARM_NOT_RAISED:V("Raise your left arm to a 45-degree angle",{id:"ERR_LEFT_ARM_NOT_RAISED"}),ERR_BODY_LANDMARKS_NOT_DETECTED:V("Ensure your full body is visible in the camera",{id:"ERR_BODY_LANDMARKS_NOT_DETECTED"}),ERR_HIPS_NOT_VISIBLE:V("Adjust your position to show your hips",{id:"ERR_HIPS_NOT_VISIBLE"}),ERR_TOO_CLOSE_TO_CAMERA:V("Step back from the camera",{id:"ERR_TOO_CLOSE_TO_CAMERA"}),ERR_NOT_SIDE_VIEW:V("Turn to show your side profile",{id:"ERR_NOT_SIDE_VIEW"}),ERR_INVALID_CLOTHING_TYPE:V("This clothing type is not supported; please contact support",{id:"ERR_INVALID_CLOTHING_TYPE"}),ERR_UPPER_BODY_NOT_VISIBLE:V("Adjust your position to show your upper body",{id:"ERR_UPPER_BODY_NOT_VISIBLE"}),ERR_HEAD_TOO_CLOSE_TO_EDGE:V("Move your head away from the edge of the frame",{id:"ERR_HEAD_TOO_CLOSE_TO_EDGE"}),ERR_LOWER_BODY_NOT_VISIBLE:V("Adjust your position to show your lower body",{id:"ERR_LOWER_BODY_NOT_VISIBLE"}),ERR_FEET_TOO_CLOSE_TO_EDGE:V("Move your feet away from the edge of the frame",{id:"ERR_FEET_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE:V("Move your body away from the edge of the frame",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:V("Move to the left to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:V("Move to the right to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT"}),ERR_SHOULDERS_NOT_VISIBLE:V("Adjust your position to show your shoulders",{id:"ERR_SHOULDERS_NOT_VISIBLE"}),ERR_HEIGHT_MEASUREMENT_FAILED:V("Stand straight and ensure your full body is visible",{id:"ERR_HEIGHT_MEASUREMENT_FAILED"}),ERR_HEAD_POINT_NOT_DETECTED:V("Ensure your head is fully visible in the frame",{id:"ERR_HEAD_POINT_NOT_DETECTED"}),ERR_INCORRECT_POSTURE:V("Stand straight with your shoulders back",{id:"ERR_INCORRECT_POSTURE"}),ERR_HEM_MEASUREMENT_FAILED:V("Ensure your clothing hem is visible and clear",{id:"ERR_HEM_MEASUREMENT_FAILED"}),ERR_SHOULDER_MEASUREMENT_FAILED:V("Keep your shoulders relaxed and visible",{id:"ERR_SHOULDER_MEASUREMENT_FAILED"}),ERR_ARM_NOT_STRETCHED:V("Stretch your arms fully",{id:"ERR_ARM_NOT_STRETCHED"}),ERR_LEGS_NOT_DETECTED:V("Ensure your legs are fully visible in the frame",{id:"ERR_LEGS_NOT_DETECTED"}),ERR_HIPS_MEASUREMENT_FAILED:V("Stand straight and ensure your hips are visible",{id:"ERR_HIPS_MEASUREMENT_FAILED"}),ERR_WAIST_MEASUREMENT_FAILED:V("Stand straight and ensure your waist is visible",{id:"ERR_WAIST_MEASUREMENT_FAILED"}),ERR_INVALID_MEASURE_SIDE_VIEW:V("Turn to show a clear side profile",{id:"ERR_INVALID_MEASURE_SIDE_VIEW"}),ERR_INVALID_BODY_HEIGHT_TYPE:V("Ensure your full body is visible for height measurement",{id:"ERR_INVALID_BODY_HEIGHT_TYPE"}),ERR_IMAGE_LOAD_FAILED:V("Try again later; the image could not be processed",{id:"ERR_IMAGE_LOAD_FAILED"}),ERR_HEIGHT_INVALID:V("Height must be between 50 and 300 cm",{id:"ERR_HEIGHT_INVALID"})}}getTranslatedMessage(A){const t=this.errorMap[A];return t||(console.info("Error code is missing",A),V("An unexpected error occurred"))}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleEscKey.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleEscKey.bind(this)),this.stopPolling(),clearInterval(this.spinnerInterval)}handleEscKey(A){A.key==="Escape"&&this.showModal&&this.closeModal()}openModal(){this.showModal=!0,this.step=1,this.height=0,this.instructionMessage=V("Position yourself in front of the camera")}closeModal(){this.showModal=!1,this.onMeasurementCanceled&&typeof this.onMeasurementCanceled=="function"&&this.onMeasurementCanceled(),this.stopPolling(),this.dispatchEvent(new CustomEvent("measurementCanceled",{detail:{}}))}async step2advancement(){if(this.height<50||this.height>300){this.errorMessage=this.getTranslatedMessage("ERR_HEIGHT_INVALID");return}this.step=3,this.errorMessage=""}async startMeasurement(){this.step=3,this.errorMessage="",this.shouldStartMeasurement=!0}updated(A){super.updated(A),A.has("step")&&this.step===3&&this.shouldStartMeasurement&&(this.initializeMeasurement(),this.shouldStartMeasurement=!1)}async initializeMeasurement(){this.videoElement=this.shadowRoot.querySelector("video");try{this.stream=await navigator.mediaDevices.getUserMedia({video:!0}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),await this.loadCameras(),this.startPolling())}catch{this.errorMessage=V("Error accessing webcam")}}async loadCameras(){try{const A=await navigator.mediaDevices.enumerateDevices();this.cameras=A.filter(t=>t.kind==="videoinput"),this.cameras.length>0&&(this.currentCameraId=this.cameras[0].deviceId)}catch(A){console.error("Error enumerating devices:",A)}}async flipCamera(){if(this.cameras.length<2)return;this.isLoading=!0,this.stopPolling();const t=(this.cameras.findIndex(l=>l.deviceId===this.currentCameraId)+1)%this.cameras.length;this.currentCameraId=this.cameras[t].deviceId;try{this.stream&&this.stream.getTracks().forEach(l=>l.stop()),this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:this.currentCameraId}}}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),this.startPolling())}catch{this.errorMessage=V("Error switching camera")}finally{this.isLoading=!1}}async startPolling(){const A=async()=>{if(!this.videoElement||!this.stream||this.isFetching)return;const t=document.createElement("canvas");t.width=this.videoElement.videoWidth,t.height=this.videoElement.videoHeight;const l=t.getContext("2d");l==null||l.drawImage(this.videoElement,0,0,t.width,t.height);const e=await new Promise(S=>t.toBlob(q=>S(q),"image/jpeg")),p=new File([e],"frame.jpg",{type:"image/jpeg"}),n=new FormData;n.append("image",p),n.append("height",this.height.toString()),n.append("productSku",this.productSku),this.measurerKey&&n.append("measurerKey",this.measurerKey);try{this.isFetching=!0,this.isLoading=!0,this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null);const q=await(await fetch(this.apiUrl,{method:"POST",body:n,headers:{Accept:"application/json","Cache-Control":"no-store",Pragma:"no-cache","X-Api-Key":this.apiKey}})).json();this.isFetching=!1,this.isLoading=!1,this.errorMessage=JSON.stringify(q),q.success?(this.measurements=q.measurements,this.recommendedSize=q.chosenSize,this.instructionMessage=V("Measurement successful!"),this.stopPolling(),this.step=4):(this.instructionMessage=this.getTranslatedMessage(q.message||"UNKNOWN_ERROR"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=V("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3))}catch{this.isFetching=!1,this.isLoading=!1,this.instructionMessage=V("Error processing measurement"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=V("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3)}};A()}stopPolling(){this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null),this.stream&&(this.stream.getTracks().forEach(A=>A.stop()),this.stream=null)}acceptMeasurement(){this.dispatchEvent(new CustomEvent("measurementAccepted",{detail:{size:this.recommendedSize}})),this.onMeasurementAccepted&&typeof this.onMeasurementAccepted=="function"&&this.onMeasurementAccepted(),this.showModal=!1,this.stopPolling()}resetMeasurement(){this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.stopPolling()}stopMeasurement(){this.resetMeasurement(),this.showModal=!1}render(){return this._isLocaleLoading?J`<div hidden></div>`:J`
|
|
997
|
-
|
|
868
|
+
.snow-layer {
|
|
869
|
+
position: absolute;
|
|
870
|
+
inset: 0;
|
|
871
|
+
pointer-events: none;
|
|
872
|
+
overflow: hidden;
|
|
873
|
+
z-index: 2;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
.snowflake {
|
|
877
|
+
position: absolute;
|
|
878
|
+
top: -8%;
|
|
879
|
+
width: 6px;
|
|
880
|
+
height: 6px;
|
|
881
|
+
background: #fff;
|
|
882
|
+
border-radius: 50%;
|
|
883
|
+
opacity: 0.85;
|
|
884
|
+
animation: fall 8s linear infinite, drift 5s ease-in-out infinite;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.snowflake:nth-child(odd) {
|
|
888
|
+
width: 4px;
|
|
889
|
+
height: 4px;
|
|
890
|
+
opacity: 0.7;
|
|
891
|
+
animation-duration: 9s, 6s;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.snowflake:nth-child(3n) {
|
|
895
|
+
width: 8px;
|
|
896
|
+
height: 8px;
|
|
897
|
+
opacity: 0.9;
|
|
898
|
+
animation-duration: 7s, 4.5s;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
.snowflake:nth-child(4n) {
|
|
902
|
+
animation-delay: 1s, 0.5s;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
@keyframes fall {
|
|
906
|
+
from { transform: translateY(-10%); }
|
|
907
|
+
to { transform: translateY(110%); }
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
@keyframes drift {
|
|
911
|
+
0%, 100% { transform: translateX(-14px); }
|
|
912
|
+
50% { transform: translateX(22px); }
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
`,JA([c({type:Number})],Q.prototype,"height",2),JA([c({type:Function})],Q.prototype,"onStep2advancement",2),Q=JA([R("xact-step-informs"),w()],Q);const IA="data:image/svg+xml,%3csvg%20width='22'%20height='40'%20viewBox='0%200%2022%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200L0%2013.3362V0H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.339L0%2026.6724V13.3362H21.517V13.339Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.6755L0%2040.0089V26.6726H21.517V26.6755Z'%20fill='%231C28BA'/%3e%3c/svg%3e",ht="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.00878906L0%2013.345V0.00878906H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.3478L0%2026.6812V13.345H21.517V13.3478Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2026.6843L0%2040.0176V26.6814H21.517V26.6843Z'%20fill='white'/%3e%3c/svg%3e",Et="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.0204381L0%2013.3538V0.0175781H21.517V0.0204381Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2013.3538L0%2026.69V13.3538H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.693L0%2040.0264V26.6902H21.517V26.693Z'%20fill='white'/%3e%3c/svg%3e";var It=Object.defineProperty,wt=Object.getOwnPropertyDescriptor,u=(r,A,t,l)=>{for(var e=l>1?void 0:l?wt(A,t):A,p=r.length-1,n;p>=0;p--)(n=r[p])&&(e=(l?n(A,t,e):n(e))||e);return l&&e&&It(A,t,e),e};const{getLocale:Yt,setLocale:XA}=Ut({sourceLocale:EA,targetLocales:Wt,loadLocale:r=>H(Object.assign({"./generated/locales/pt-BR.ts":()=>Promise.resolve().then(()=>Ct)}),`./generated/locales/${r}.ts`,4)});a.BodyMeasurer=class extends X{constructor(){super(...arguments),this.spinnerFrame=0,this.apiKey="DB8mP9gStPfvdyeYbbuCV4Zf3SH745dI",this.tenantId="1",this.productSku="123456",this.apiUrl="https://xactsize-dotnet-api-923169850574.southamerica-east1.run.app/api/measurer/measure/body",this._culture="pt-BR",this.measurerKey="",this._isLocaleLoading=!1,this.showModal=!1,this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.errorMessage="",this.instructionMessage=V("Position yourself in front of the camera"),this.shouldStartMeasurement=!1,this.isLoading=!1,this.isFetching=!1,this.videoElement=null,this.stream=null,this.poolingTimeout=null,this.instructionMessageTimeout=null,this.cameras=[],this.currentCameraId=null}firstUpdated(){this.startSpinnerAnimation()}startSpinnerAnimation(){const A=[Et,ht,IA];this.spinnerInterval=setInterval(()=>{var l;const t=(l=this.shadowRoot)==null?void 0:l.querySelector(".spinner");t&&(t.src=A[this.spinnerFrame],this.spinnerFrame=(this.spinnerFrame+1)%A.length)},300)}get culture(){return this._culture}set culture(A){const t=this._culture;this._culture=A,this.requestUpdate("culture",t),this._applyLocale(A).catch(console.error)}async _applyLocale(A){try{this._isLocaleLoading=!0,this.requestUpdate(),await XA(A)}catch(t){console.error("Failed to load locale",A,t),await XA(EA)}finally{this._isLocaleLoading=!1,this.requestUpdate()}}get errorMap(){return{ERR_RIGHT_ARM_TOO_HIGH:V("Lower your right arm",{id:"ERR_RIGHT_ARM_TOO_HIGH"}),ERR_LEFT_ARM_TOO_HIGH:V("Lower your left arm",{id:"ERR_LEFT_ARM_TOO_HIGH"}),ERR_ARMS_NOT_RAISED:V("Raise both arms to a 45-degree angle",{id:"ERR_ARMS_NOT_RAISED"}),ERR_RIGHT_ARM_NOT_RAISED:V("Raise your right arm to a 45-degree angle",{id:"ERR_RIGHT_ARM_NOT_RAISED"}),ERR_LEFT_ARM_NOT_RAISED:V("Raise your left arm to a 45-degree angle",{id:"ERR_LEFT_ARM_NOT_RAISED"}),ERR_BODY_LANDMARKS_NOT_DETECTED:V("Ensure your full body is visible in the camera",{id:"ERR_BODY_LANDMARKS_NOT_DETECTED"}),ERR_HIPS_NOT_VISIBLE:V("Adjust your position to show your hips",{id:"ERR_HIPS_NOT_VISIBLE"}),ERR_TOO_CLOSE_TO_CAMERA:V("Step back from the camera",{id:"ERR_TOO_CLOSE_TO_CAMERA"}),ERR_NOT_SIDE_VIEW:V("Turn to show your side profile",{id:"ERR_NOT_SIDE_VIEW"}),ERR_INVALID_CLOTHING_TYPE:V("This clothing type is not supported; please contact support",{id:"ERR_INVALID_CLOTHING_TYPE"}),ERR_UPPER_BODY_NOT_VISIBLE:V("Adjust your position to show your upper body",{id:"ERR_UPPER_BODY_NOT_VISIBLE"}),ERR_HEAD_TOO_CLOSE_TO_EDGE:V("Move your head away from the edge of the frame",{id:"ERR_HEAD_TOO_CLOSE_TO_EDGE"}),ERR_LOWER_BODY_NOT_VISIBLE:V("Adjust your position to show your lower body",{id:"ERR_LOWER_BODY_NOT_VISIBLE"}),ERR_FEET_TOO_CLOSE_TO_EDGE:V("Move your feet away from the edge of the frame",{id:"ERR_FEET_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE:V("Move your body away from the edge of the frame",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:V("Move to the left to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:V("Move to the right to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT"}),ERR_SHOULDERS_NOT_VISIBLE:V("Adjust your position to show your shoulders",{id:"ERR_SHOULDERS_NOT_VISIBLE"}),ERR_HEIGHT_MEASUREMENT_FAILED:V("Stand straight and ensure your full body is visible",{id:"ERR_HEIGHT_MEASUREMENT_FAILED"}),ERR_HEAD_POINT_NOT_DETECTED:V("Ensure your head is fully visible in the frame",{id:"ERR_HEAD_POINT_NOT_DETECTED"}),ERR_INCORRECT_POSTURE:V("Stand straight with your shoulders back",{id:"ERR_INCORRECT_POSTURE"}),ERR_HEM_MEASUREMENT_FAILED:V("Ensure your clothing hem is visible and clear",{id:"ERR_HEM_MEASUREMENT_FAILED"}),ERR_SHOULDER_MEASUREMENT_FAILED:V("Keep your shoulders relaxed and visible",{id:"ERR_SHOULDER_MEASUREMENT_FAILED"}),ERR_ARM_NOT_STRETCHED:V("Stretch your arms fully",{id:"ERR_ARM_NOT_STRETCHED"}),ERR_LEGS_NOT_DETECTED:V("Ensure your legs are fully visible in the frame",{id:"ERR_LEGS_NOT_DETECTED"}),ERR_HIPS_MEASUREMENT_FAILED:V("Stand straight and ensure your hips are visible",{id:"ERR_HIPS_MEASUREMENT_FAILED"}),ERR_WAIST_MEASUREMENT_FAILED:V("Stand straight and ensure your waist is visible",{id:"ERR_WAIST_MEASUREMENT_FAILED"}),ERR_INVALID_MEASURE_SIDE_VIEW:V("Turn to show a clear side profile",{id:"ERR_INVALID_MEASURE_SIDE_VIEW"}),ERR_INVALID_BODY_HEIGHT_TYPE:V("Ensure your full body is visible for height measurement",{id:"ERR_INVALID_BODY_HEIGHT_TYPE"}),ERR_IMAGE_LOAD_FAILED:V("Try again later; the image could not be processed",{id:"ERR_IMAGE_LOAD_FAILED"}),ERR_HEIGHT_INVALID:V("Height must be between 50 and 300 cm",{id:"ERR_HEIGHT_INVALID"})}}getTranslatedMessage(A){const t=this.errorMap[A];return t||(console.info("Error code is missing",A),V("An unexpected error occurred"))}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleEscKey.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleEscKey.bind(this)),this.stopPolling(),clearInterval(this.spinnerInterval)}handleEscKey(A){A.key==="Escape"&&this.showModal&&this.closeModal()}openModal(){this.showModal=!0,this.step=1,this.height=0,this.instructionMessage=V("Position yourself in front of the camera")}closeModal(){this.showModal=!1,this.onMeasurementCanceled&&typeof this.onMeasurementCanceled=="function"&&this.onMeasurementCanceled(),this.stopPolling(),this.dispatchEvent(new CustomEvent("measurementCanceled",{detail:{}}))}async step2advancement(){if(this.height<50||this.height>300){this.errorMessage=this.getTranslatedMessage("ERR_HEIGHT_INVALID");return}this.step=3,this.errorMessage=""}async startMeasurement(){this.step=3,this.errorMessage="",this.shouldStartMeasurement=!0}updated(A){super.updated(A),A.has("step")&&this.step===3&&this.shouldStartMeasurement&&(this.initializeMeasurement(),this.shouldStartMeasurement=!1)}async initializeMeasurement(){this.videoElement=this.shadowRoot.querySelector("video");try{this.stream=await navigator.mediaDevices.getUserMedia({video:!0}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),await this.loadCameras(),this.startPolling())}catch{this.errorMessage=V("Error accessing webcam")}}async loadCameras(){try{const A=await navigator.mediaDevices.enumerateDevices();this.cameras=A.filter(t=>t.kind==="videoinput"),this.cameras.length>0&&(this.currentCameraId=this.cameras[0].deviceId)}catch(A){console.error("Error enumerating devices:",A)}}async flipCamera(){if(this.cameras.length<2)return;this.isLoading=!0,this.stopPolling();const t=(this.cameras.findIndex(l=>l.deviceId===this.currentCameraId)+1)%this.cameras.length;this.currentCameraId=this.cameras[t].deviceId;try{this.stream&&this.stream.getTracks().forEach(l=>l.stop()),this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:this.currentCameraId}}}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),this.startPolling())}catch{this.errorMessage=V("Error switching camera")}finally{this.isLoading=!1}}async startPolling(){const A=async()=>{if(!this.videoElement||!this.stream||this.isFetching)return;const t=document.createElement("canvas");t.width=this.videoElement.videoWidth,t.height=this.videoElement.videoHeight;const l=t.getContext("2d");l==null||l.drawImage(this.videoElement,0,0,t.width,t.height);const e=await new Promise(S=>t.toBlob(q=>S(q),"image/jpeg")),p=new File([e],"frame.jpg",{type:"image/jpeg"}),n=new FormData;n.append("image",p),n.append("height",this.height.toString()),n.append("productSku",this.productSku),this.measurerKey&&n.append("measurerKey",this.measurerKey);try{this.isFetching=!0,this.isLoading=!0,this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null);const q=await(await fetch(this.apiUrl,{method:"POST",body:n,headers:{Accept:"application/json","Cache-Control":"no-store",Pragma:"no-cache","X-Api-Key":this.apiKey}})).json();this.isFetching=!1,this.isLoading=!1,this.errorMessage=JSON.stringify(q),q.success?(this.measurements=q.measurements,this.recommendedSize=q.chosenSize,this.instructionMessage=V("Measurement successful!"),this.stopPolling(),this.step=4):(this.instructionMessage=this.getTranslatedMessage(q.message||"UNKNOWN_ERROR"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=V("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3))}catch{this.isFetching=!1,this.isLoading=!1,this.instructionMessage=V("Error processing measurement"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=V("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3)}};A()}stopPolling(){this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null),this.stream&&(this.stream.getTracks().forEach(A=>A.stop()),this.stream=null)}acceptMeasurement(){this.dispatchEvent(new CustomEvent("measurementAccepted",{detail:{size:this.recommendedSize}})),this.onMeasurementAccepted&&typeof this.onMeasurementAccepted=="function"&&this.onMeasurementAccepted(),this.showModal=!1,this.stopPolling()}resetMeasurement(){this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.stopPolling()}stopMeasurement(){this.resetMeasurement(),this.showModal=!1}render(){return this._isLocaleLoading?J`<div hidden></div>`:J`
|
|
916
|
+
<xact-button
|
|
917
|
+
class="launch-btn"
|
|
918
|
+
style="--brand-primary: #000; --text-inverse: #fff; --brand-primary-hover: #111;"
|
|
919
|
+
@click=${this.openModal}
|
|
920
|
+
label="${V("Find your Xactsize")}"
|
|
921
|
+
></xact-button>
|
|
998
922
|
|
|
999
923
|
${this.showModal?J`
|
|
1000
924
|
<div class="modal">
|
|
@@ -1345,6 +1269,13 @@ label="${V("Let's go!")}"
|
|
|
1345
1269
|
width: 100%;
|
|
1346
1270
|
}
|
|
1347
1271
|
|
|
1272
|
+
xact-button.launch-btn {
|
|
1273
|
+
--brand-primary: #000;
|
|
1274
|
+
--brand-primary-hover: #111;
|
|
1275
|
+
--text-inverse: #fff;
|
|
1276
|
+
--xact-button-radius: 0px;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1348
1279
|
.video-overlay {
|
|
1349
1280
|
position: absolute;
|
|
1350
1281
|
inset: 4px 4px auto 4px;
|
|
@@ -1478,4 +1409,4 @@ label="${V("Let's go!")}"
|
|
|
1478
1409
|
}
|
|
1479
1410
|
|
|
1480
1411
|
|
|
1481
|
-
`,u([c({type:String,attribute:"api-key"})],a.BodyMeasurer.prototype,"apiKey",2),u([c({type:String,attribute:"tenant-id"})],a.BodyMeasurer.prototype,"tenantId",2),u([c({type:String,attribute:"product-sku"})],a.BodyMeasurer.prototype,"productSku",2),u([c({type:String,attribute:"api-url"})],a.BodyMeasurer.prototype,"apiUrl",2),u([c({type:Function,attribute:"onmeasurementaccepted"})],a.BodyMeasurer.prototype,"onMeasurementAccepted",2),u([c({type:Function,attribute:"onmeasurementcanceled"})],a.BodyMeasurer.prototype,"onMeasurementCanceled",2),u([c({type:String})],a.BodyMeasurer.prototype,"culture",1),u([
|
|
1412
|
+
`,u([c({type:String,attribute:"api-key"})],a.BodyMeasurer.prototype,"apiKey",2),u([c({type:String,attribute:"tenant-id"})],a.BodyMeasurer.prototype,"tenantId",2),u([c({type:String,attribute:"product-sku"})],a.BodyMeasurer.prototype,"productSku",2),u([c({type:String,attribute:"api-url"})],a.BodyMeasurer.prototype,"apiUrl",2),u([c({type:Function,attribute:"onmeasurementaccepted"})],a.BodyMeasurer.prototype,"onMeasurementAccepted",2),u([c({type:Function,attribute:"onmeasurementcanceled"})],a.BodyMeasurer.prototype,"onMeasurementCanceled",2),u([c({type:String})],a.BodyMeasurer.prototype,"culture",1),u([k()],a.BodyMeasurer.prototype,"errorMap",1),u([k()],a.BodyMeasurer.prototype,"measurerKey",2),u([k()],a.BodyMeasurer.prototype,"_isLocaleLoading",2),u([k()],a.BodyMeasurer.prototype,"showModal",2),u([k()],a.BodyMeasurer.prototype,"step",2),u([k()],a.BodyMeasurer.prototype,"height",2),u([k()],a.BodyMeasurer.prototype,"recommendedSize",2),u([k()],a.BodyMeasurer.prototype,"measurements",2),u([k()],a.BodyMeasurer.prototype,"errorMessage",2),u([k()],a.BodyMeasurer.prototype,"instructionMessage",2),u([k()],a.BodyMeasurer.prototype,"shouldStartMeasurement",2),u([k()],a.BodyMeasurer.prototype,"isLoading",2),u([k()],a.BodyMeasurer.prototype,"isFetching",2),u([k()],a.BodyMeasurer.prototype,"cameras",2),u([k()],a.BodyMeasurer.prototype,"currentCameraId",2),a.BodyMeasurer=u([R("body-measurer"),w()],a.BodyMeasurer);const Ct=Object.freeze(Object.defineProperty({__proto__:null,templates:{ERR_ARM_NOT_STRETCHED:"Estique seus braços completamente",ERR_ARMS_NOT_RAISED:"Levante ambos os braços em um ângulo de 45 graus",ERR_BODY_LANDMARKS_NOT_DETECTED:"Certifique-se de que seu corpo inteiro esteja visível na câmera",ERR_BODY_TOO_CLOSE_TO_EDGE:"Afaste seu corpo da borda do quadro",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:"Mova-se para a esquerda para centralizar seu corpo",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:"Mova-se para a direita para centralizar seu corpo",ERR_FEET_TOO_CLOSE_TO_EDGE:"Afaste seus pés da borda do quadro",ERR_HEAD_POINT_NOT_DETECTED:"Certifique-se de que sua cabeça esteja totalmente visível no quadro",ERR_HEAD_TOO_CLOSE_TO_EDGE:"Afaste sua cabeça da borda do quadro",ERR_HEIGHT_INVALID:"A altura deve ser entre 50 e 300cm",ERR_HEIGHT_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que seu corpo inteiro esteja visível",ERR_HEM_MEASUREMENT_FAILED:"Certifique-se de que a bainha da sua roupa esteja visível e clara",ERR_HIPS_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que seus quadris estejam visíveis",ERR_HIPS_NOT_VISIBLE:"Ajuste sua posição para mostrar seus quadris",ERR_IMAGE_LOAD_FAILED:"Tente novamente mais tarde; a imagem não pôde ser processada",ERR_INCORRECT_POSTURE:"Fique ereto com os ombros para trás",ERR_INVALID_BODY_HEIGHT_TYPE:"Certifique-se de que seu corpo inteiro esteja visível para a medição de altura",ERR_INVALID_CLOTHING_TYPE:"Este tipo de roupa não é suportado; entre em contato com o suporte",ERR_INVALID_MEASURE_SIDE_VIEW:"Gire para mostrar um perfil lateral claro",ERR_LEFT_ARM_NOT_RAISED:"Levante seu braço esquerdo em um ângulo de 45 graus",ERR_LEFT_ARM_TOO_HIGH:"Abaixe seu braço esquerdo",ERR_LEGS_NOT_DETECTED:"Certifique-se de que suas pernas estejam totalmente visíveis no quadro",ERR_LOWER_BODY_NOT_VISIBLE:"Ajuste sua posição para mostrar a parte inferior do corpo",ERR_NOT_SIDE_VIEW:"Gire para mostrar seu perfil lateral",ERR_RIGHT_ARM_NOT_RAISED:"Levante seu braço direito em um ângulo de 45 graus",ERR_RIGHT_ARM_TOO_HIGH:"Abaixe seu braço direito",ERR_SHOULDER_MEASUREMENT_FAILED:"Mantenha seus ombros relaxados e visíveis",ERR_SHOULDERS_NOT_VISIBLE:"Ajuste sua posição para mostrar seus ombros",ERR_TOO_CLOSE_TO_CAMERA:"Dê um passo para trás da câmera",ERR_UPPER_BODY_NOT_VISIBLE:"Ajuste sua posição para mostrar a parte superior do corpo",ERR_WAIST_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que sua cintura esteja visível",s08b0bc2feb4e0f1c:"Boa iluminação",s1dd794b3870bcae0:"Começar",s2f77566c78235d88:"Erro acessando a câmera",s322c72546e939809:"Escolha uma área bem iluminada onde você possa ver sua imagem claramente.",s34c58d3d12e5f890:"Erro ao mudar a câmera",s396efd2b23a16ac9:"Posicione-se contra um fundo simples.",s3d324b180f982d46:"Tenha certeza de que seu corpo está totalmente visível",s420e8053328b31c4:"Seu tamanho ideal",s48d094fb2ffff8fb:"Pontas",s5c91b5e06c363734:"Medição de processamento de erros",s625ff027ee7b497b:"Certifique-se de que todo o seu corpo esteja visível. O aplicativo guiará você.",s676cfe9f36657792:"Medição realizada com sucesso!",s6ad3b28b46803c43:"Aceitar sugestão",s81d43b9b25d0775b:"Roupas",s88a3f5e6a9d9945d:"Use roupas que você costuma usar no dia a dia.",s8fb9f388e75ffe11:"Enquadramento",s952ed559991cf0b4:"Desenvolvido por",sa4ad2b9cd4ea10ba:"Fundo limpo",scf8d43c4a5cb71fa:"Mantenha uma postura ereta, com os braços ligeiramente afastados do corpo",sd13d4c82d57859fc:"Posicione-se em frente a câmera",sdabfef8968aeb5fa:"Um erro inesperado aconteceu",sdf9f9c621b6316e7:"Medir novamente",se940dab2e0b7a710:"Antes de começar",sf315699feee25406:"Descubra o tamanho ideal para você",sf84b5644f7595ce5:"Com base em suas medidas e nas dimensões exatas da peça, a recomendação de tamanho fornecida é a mais precisa para um ajuste ideal.",seb66e000f03f21e0:"Let's find your perfect size",sd2259f35f330b63c:"Curated luxury. Perfect fit.",sca9b53eeb24a5865:"Avoid backlighting",s32d5e90d7ffec075:"Use a plain wall",se61735ca89853860:"Form-fitting gear",s3a09a6be4809cb50:"Full body shot",s7948656b643c5186:"Enter your height (cm)",sdde2fe5a591a828a:"Let's get started! →",s4a7b0f0c7b8b2125:"By using Xactsize, you agree to our Terms and Privacy Policy."}},Symbol.toStringTag,{value:"Module"}));a.getLocale=Yt,a.setLocale=XA,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|