@wayke-se/components-react 4.3.0 → 4.3.1

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/dist/index.mjs CHANGED
@@ -32,7 +32,7 @@ vulnerable to XSS attacks. Please remove it from \`allowedTags\`.
32
32
  Or, to disable this warning, add the \`allowVulnerableTags\` option
33
33
  and ensure you are accounting for this risk.
34
34
 
35
- `)});let s=t.nonTextTags||["script","style","textarea","option"],c,l;t.allowedAttributes&&(c={},l={},Wo(t.allowedAttributes,function(w,C){c[C]=[];let I=[];w.forEach(function(q){typeof q=="string"&&q.indexOf("*")>=0?I.push(Ik(q).replace(/\\\*/g,".*")):c[C].push(q)}),I.length&&(l[C]=new RegExp("^("+I.join("|")+")$"))}));let u={},p={},h={};Wo(t.allowedClasses,function(w,C){if(c&&(Or(c,C)||(c[C]=[]),c[C].push("class")),u[C]=w,Array.isArray(w)){let I=[];u[C]=[],h[C]=[],w.forEach(function(q){typeof q=="string"&&q.indexOf("*")>=0?I.push(Ik(q).replace(/\\\*/g,".*")):q instanceof RegExp?h[C].push(q):u[C].push(q)}),I.length&&(p[C]=new RegExp("^("+I.join("|")+")$"))}});let b={},v;Wo(t.transformTags,function(w,C){let I;typeof w=="function"?I=w:typeof w=="string"&&(I=Jo.simpleTransform(w)),C==="*"?v=I:b[C]=I});let y,m,f,g,x,T,B=!1;he();let ge=new XM.Parser({onopentag:function(w,C){if(t.enforceHtmlBoundary&&w==="html"&&he(),x){T++;return}let I=new o(w,C);m.push(I);let q=!1,Le=!!I.text,Ne;if(Or(b,w)&&(Ne=b[w](w,C),I.attribs=C=Ne.attribs,Ne.text!==void 0&&(I.innerText=Ne.text),w!==Ne.tagName&&(I.name=w=Ne.tagName,g[y]=Ne.tagName)),v&&(Ne=v(w,C),I.attribs=C=Ne.attribs,w!==Ne.tagName&&(I.name=w=Ne.tagName,g[y]=Ne.tagName)),(!a(w)||t.disallowedTagsMode==="recursiveEscape"&&!oN(f)||t.nestingLimit!=null&&y>=t.nestingLimit)&&(q=!0,f[y]=!0,t.disallowedTagsMode==="discard"&&s.indexOf(w)!==-1&&(x=!0,T=1),f[y]=!0),y++,q){if(t.disallowedTagsMode==="discard")return;n=i,i=""}i+="<"+w,w==="script"&&(t.allowedScriptHostnames||t.allowedScriptDomains)&&(I.innerText=""),(!c||Or(c,w)||c["*"])&&Wo(C,function(ce,re){if(!sN.test(re)){delete I.attribs[re];return}if(ce===""&&(t.nonBooleanAttributes.includes(re)||t.nonBooleanAttributes.includes("*"))){delete I.attribs[re];return}let Ht=!1;if(!c||Or(c,w)&&c[w].indexOf(re)!==-1||c["*"]&&c["*"].indexOf(re)!==-1||Or(l,w)&&l[w].test(re)||l["*"]&&l["*"].test(re))Ht=!0;else if(c&&c[w]){for(let Q of c[w])if(eN(Q)&&Q.name&&Q.name===re){Ht=!0;let oe="";if(Q.multiple===!0){let Kt=ce.split(" ");for(let It of Kt)Q.values.indexOf(It)!==-1&&(oe===""?oe=It:oe+=" "+It)}else Q.values.indexOf(ce)>=0&&(oe=ce);ce=oe}}if(Ht){if(t.allowedSchemesAppliedToAttributes.indexOf(re)!==-1&&$(w,ce)){delete I.attribs[re];return}if(w==="script"&&re==="src"){let Q=!0;try{let oe=O(ce);if(t.allowedScriptHostnames||t.allowedScriptDomains){let Kt=(t.allowedScriptHostnames||[]).find(function(dt){return dt===oe.url.hostname}),It=(t.allowedScriptDomains||[]).find(function(dt){return oe.url.hostname===dt||oe.url.hostname.endsWith(`.${dt}`)});Q=Kt||It}}catch{Q=!1}if(!Q){delete I.attribs[re];return}}if(w==="iframe"&&re==="src"){let Q=!0;try{let oe=O(ce);if(oe.isRelativeUrl)Q=Or(t,"allowIframeRelativeUrls")?t.allowIframeRelativeUrls:!t.allowedIframeHostnames&&!t.allowedIframeDomains;else if(t.allowedIframeHostnames||t.allowedIframeDomains){let Kt=(t.allowedIframeHostnames||[]).find(function(dt){return dt===oe.url.hostname}),It=(t.allowedIframeDomains||[]).find(function(dt){return oe.url.hostname===dt||oe.url.hostname.endsWith(`.${dt}`)});Q=Kt||It}}catch{Q=!1}if(!Q){delete I.attribs[re];return}}if(re==="srcset")try{let Q=tN(ce);if(Q.forEach(function(oe){$("srcset",oe.url)&&(oe.evil=!0)}),Q=Tk(Q,function(oe){return!oe.evil}),Q.length)ce=aN(Tk(Q,function(oe){return!oe.evil})),I.attribs[re]=ce;else{delete I.attribs[re];return}}catch{delete I.attribs[re];return}if(re==="class"){let Q=u[w],oe=u["*"],Kt=p[w],It=h[w],dt=p["*"],ra=[Kt,dt].concat(It).filter(function(si){return si});if(Q&&oe?ce=St(ce,Ck(Q,oe),ra):ce=St(ce,Q||oe,ra),!ce.length){delete I.attribs[re];return}}if(re==="style"){if(t.parseStyleAttributes)try{let Q=rN(w+" {"+ce+"}"),oe=R(Q,t.allowedStyles);if(ce=X(oe),ce.length===0){delete I.attribs[re];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+w+" {"+ce+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete I.attribs[re];return}else if(t.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}i+=" "+re,ce&&ce.length&&(i+='="'+ne(ce,!0)+'"')}else delete I.attribs[re]}),t.selfClosing.indexOf(w)!==-1?i+=" />":(i+=">",I.innerText&&!Le&&!t.textFilter&&(i+=ne(I.innerText),B=!0)),q&&(i=n+ne(i),n="")},ontext:function(w){if(x)return;let C=m[m.length-1],I;if(C&&(I=C.tag,w=C.innerText!==void 0?C.innerText:w),t.disallowedTagsMode==="discard"&&(I==="script"||I==="style"))i+=w;else{let q=ne(w,!1);t.textFilter&&!B?i+=t.textFilter(q,I):B||(i+=q)}if(m.length){let q=m[m.length-1];q.text+=w}},onclosetag:function(w,C){if(x)if(T--,!T)x=!1;else return;let I=m.pop();if(!I)return;if(I.tag!==w){m.push(I);return}x=t.enforceHtmlBoundary?w==="html":!1,y--;let q=f[y];if(q){if(delete f[y],t.disallowedTagsMode==="discard"){I.updateParentNodeText();return}n=i,i=""}if(g[y]&&(w=g[y],delete g[y]),t.exclusiveFilter&&t.exclusiveFilter(I)){i=i.substr(0,I.tagPosition);return}if(I.updateParentNodeMediaChildren(),I.updateParentNodeText(),t.selfClosing.indexOf(w)!==-1||C&&!a(w)&&["escape","recursiveEscape"].indexOf(t.disallowedTagsMode)>=0){q&&(i=n,n="");return}i+="</"+w+">",q&&(i=n+ne(i),n=""),B=!1}},t.parser);return ge.write(e),ge.end(),i;function he(){i="",y=0,m=[],f={},g={},x=!1,T=0}function ne(w,C){return typeof w!="string"&&(w=w+""),t.parser.decodeEntities&&(w=w.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),C&&(w=w.replace(/"/g,"&quot;"))),w=w.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),C&&(w=w.replace(/"/g,"&quot;")),w}function $(w,C){for(C=C.replace(/[\x00-\x20]+/g,"");;){let Le=C.indexOf("<!--");if(Le===-1)break;let Ne=C.indexOf("-->",Le+4);if(Ne===-1)break;C=C.substring(0,Le)+C.substring(Ne+3)}let I=C.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!I)return C.match(/^[/\\]{2}/)?!t.allowProtocolRelative:!1;let q=I[1].toLowerCase();return Or(t.allowedSchemesByTag,w)?t.allowedSchemesByTag[w].indexOf(q)===-1:!t.allowedSchemes||t.allowedSchemes.indexOf(q)===-1}function O(w){if(w=w.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),w.startsWith("relative:"))throw new Error("relative: exploit attempt");let C="relative://relative-site";for(let Le=0;Le<100;Le++)C+=`/${Le}`;let I=new URL(w,C);return{isRelativeUrl:I&&I.hostname==="relative-site"&&I.protocol==="relative:",url:I}}function R(w,C){if(!C)return w;let I=w.nodes[0],q;return C[I.selector]&&C["*"]?q=Ck(C[I.selector],C["*"]):q=C[I.selector]||C["*"],q&&(w.nodes[0].nodes=I.nodes.reduce(Me(q),[])),w}function X(w){return w.nodes[0].nodes.reduce(function(C,I){return C.push(`${I.prop}:${I.value}${I.important?" !important":""}`),C},[]).join(";")}function Me(w){return function(C,I){return Or(w,I.prop)&&w[I.prop].some(function(Le){return Le.test(I.value)})&&C.push(I),C}}function St(w,C,I){return C?(w=w.split(/\s+/),w.filter(function(q){return C.indexOf(q)!==-1||I.some(function(Le){return Le.test(q)})}).join(" ")):w}}var cN={decodeEntities:!0};Jo.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","main","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0};Jo.simpleTransform=function(e,t,r){return r=r===void 0?!0:r,t=t||{},function(i,n){let o;if(r)for(o in t)n[o]=t[o];else n=t;return{tagName:e,attribs:n}}}});var zx={};Tp(zx,{default:()=>A9});import{marked as yD}from"marked";var Xd,Zo,lN,Nk,dp,uN,Pw,dN,Mw,pN,Nw,Dw,Ow,mN,Lw,hN,Bw,fN,Fw,gN,Rw,yN,Hw,bN,_w,Kd,$w,vN,qw,kN,jw,AN,Gw,Ko,Uw,pp,zw,wN,Vw,xN,Qw,EN,Ww,Lr,Jw,SN,Yw,IN,Zw,Yo,Kw,CN,TN,Dk,Ok,Oi,Li,Hd,D,_d,PN,MN,NN,Xw,DN,ON,j,LN,mp,BN,ex,tx,FN,$d,Lk,RN,HN,_N,$N,qN,jN,Zt,GN,S,UN,Ve,zN,Pn,VN,Y,QN,Xo,WN,JN,rx,YN,ZN,KN,je,XN,oi,vc,eD,tD,ep,gc,rD,k,iD,Bk,Fk,nD,hp,oD,xc,aD,Hi,sD,cD,lD,uD,dD,fp,Mn,Et,pD,Ec,mD,kc,_i,hD,Rk,Hk,fD,gD,ix,_k,$k,qk,jk,bD,vD,kD,AD,wD,xD,nx,Gk,ED,Uk,zk,SD,ID,Vk,CD,Sc,TD,tp,Qk,Wk,PD,Ic,MD,Ri,ND,Se,ox,Jk,DD,Yk,OD,LD,Tn,ax,BD,xt,FD,RD,HD,_D,$D,sx,Ce,Zk,qD,Kk,jD,Xk,GD,Ac,UD,zD,VD,QD,gp,WD,JD,qd,Cc,YD,ZD,eA,tA,rp,KD,XD,eO,tO,rO,iO,nO,oO,aO,cx,rA,lx,iA,ux,nA,sO,cO,yp,bp,Bi,lO,uO,jd,dO,pO,dx,vp,mO,hO,fO,kp,gO,yO,oA,bO,px,aA,Gd,vO,mx,kO,Ap,ip,AO,wO,xO,EO,Tc,SO,sA,hx,cA,fx,lA,IO,CO,TO,uA,gx,dA,yx,pA,PO,MO,NO,bx,DO,mA,vx,hA,OO,LO,BO,FO,RO,HO,bc,np,fA,gA,_O,kx,$O,yA,op,Ud,qO,bA,jO,vA,Ax,kA,wx,AA,xx,wA,Ex,xA,Sx,EA,Ix,SA,GO,IA,Cx,zd,CA,TA,PA,Ge,UO,zO,VO,QO,WO,JO,YO,ZO,KO,MA,XO,eL,tL,rL,NA,DA,OA,LA,iL,nL,oL,aL,BA,sL,FA,cL,RA,lL,uL,HA,_A,Tx,$A,qA,dL,pL,mL,jA,hL,fL,Px,GA,gL,UA,yL,zA,bL,vL,kL,VA,AL,wL,xL,EL,Mx,SL,IL,CL,TL,Vd,QA,Qd,WA,JA,ap,PL,ML,NL,DL,OL,sp,LL,YA,Nx,ZA,Dx,KA,XA,BL,FL,Ox,ew,tw,wp,rw,iw,Lx,nw,RL,HL,ow,aw,sw,_L,$L,qL,jL,GL,UL,cp,zL,cw,VL,QL,WL,JL,YL,ZL,KL,XL,eB,Bx,lw,Fx,uw,Rx,dw,tB,pw,Hx,mw,rB,hw,lp,yc,_x,fw,Fi,iB,nB,oB,aB,$x,gw,qx,yw,up,Wd,sB,cB,jx,lB,uB,Gx,bw,dB,vw,pB,mB,hB,fB,gB,yB,bB,vB,kw,kB,AB,wB,Ux,Aw,ww,xB,xw,Ew,EB,SB,IB,CB,TB,PB,MB,Nn,NB,DB,OB,LB,BB,FB,RB,HB,_B,$B,qB,jB,Sw,GB,UB,zB,VB,QB,WB,JB,YB,ZB,KB,XB,e9,t9,r9,i9,n9,o9,a9,s9,c9,l9,Iw,u9,d9,Cw,Tw,p9,m9,Jd,h9,Yd,f9,Zd,wc,g9,y9,b9,v9,k9,A9,Vx=Br(()=>{te();Db();te();te();te();Xd=Pp(Lb(),1),Zo=Pp(Mk(),1);te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();lN={name:"@wayke-se/ecom-web",version:"1.5.1",description:"Wayke Ecom Web",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",homepage:"https://github.com/wayke-se/wayke-ecom-web",scripts:{start:"node ./esbuild/start.js",clip:"node ./esbuild/clip-ui.js && node ./clip-ui/start.js",build:"npm run clean && node ./esbuild/lib.js && node ./esbuild/cdn.js",clean:"rimraf build && rimraf dist && rimraf dist-cdn",test:"npm run lint && npm run typecheck",typecheck:"tsc -noEmit","typecheck:watch":"tsc -noEmit -watch",lint:"eslint --ext .ts,.js src","lint:fix":"eslint --ext .ts,.js 'src' --fix",stylelint:"stylelint '**/*.scss'",prepare:"husky install"},author:"Wayke",license:"ISC",devDependencies:{"@ourstudio/clip-ui":"^0.0.11","@types/marked":"^4.3.0","@types/node":"^17.0.18","@types/object-path":"^0.11.1","@types/sanitize-html":"^2.6.2","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0",esbuild:"^0.15.10","esbuild-sass-plugin":"2.3.3",eslint:"^8.9.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0",husky:"^8.0.1","npm-dts":"^1.3.11",prettier:"^2.5.1",rimraf:"^5.0.1",stylelint:"^15.2.0","stylelint-config-prettier-scss":"^1.0.0","stylelint-config-standard-scss":"^9.0.0",typescript:"^5.1.3"},dependencies:{"@wayke-se/ecom":"^4.4.0",marked:"^4.3.0","object-path":"^0.11.8",redux:"^4.1.2","sanitize-html":"^2.7.0"},files:["dist"]},Nk=(e,t)=>e!==void 0&&t!==void 0?JSON.stringify(e).localeCompare(JSON.stringify(t))===0:e===t,dp=e=>({costs:e.getCosts(),fees:e.getFees(),interests:e.getInterests(),durationSpec:e.getDurationSpec(),downPaymentSpec:e.getDownPaymentSpec(),residualValueSpec:e.getResidualValueSpec(),totalResidualValue:e.getTotalResidualValue(),publicURL:e.getPublicURL(),shouldUseCreditScoring:e.shouldUseCreditScoring(),financialProductCode:e.getFinancialProductCode(),price:e.getPrice(),creditAmount:e.getCreditAmount(),hasPrivacyPolicy:e.hasPrivacyPolicy(),privacyPolicyUrl:e.getPrivacyPolicyUrl()}),uN=e=>({status:e.getStatus(),hasPendingSigning:e.hasPendingSigning(),hintCode:e.getHintCode(),signingMessage:e.getSigningMessage(),shouldRenewSigning:e.shouldRenewSigning(),isSigned:e.isSigned(),address:void 0,pendingScoring:e.hasPendingScoring(),isScored:e.isScored(),hasScoringError:e.hasScoringError(),scoringId:e.getScoringId(),recommendation:e.getRecommendation(),decision:e.getDecision(),isAccepted:e.isAccepted()}),Pw=e=>({orderVehicle:e.getOrderVehicle(),accessories:e.getAccessories(),requiresDealerSelection:e.requiresDealerSelection(),dealerSites:e.getDealerSites(),paymentOptions:e.getPaymentOptions().map(t=>({...t,loanDetails:t.loanDetails?dp(t.loanDetails):void 0})),deliveryOptions:e.getDeliveryOptions(),insuranceOption:e.getInsuranceOption(),orderConditions:e.getOrderConditions(),orderReturnConditions:e.getOrderReturnConditions(),conditionsPdfUri:e.getConditionsPdfUri(),contactInformation:e.getContactInformation(),allowsTradeIn:e.allowsTradeIn(),isUnavailable:e.isUnavailable(),isPaymentRequired:e.isPaymentRequired()}),dN=e=>({vehicle:e.getVehicle()}),Mw="RESET",pN=e=>t=>t({type:Mw,id:e}),Nw="SET_ORDER",Dw=(e,t)=>r=>r({type:Nw,order:e,vehicle:t}),Ow="SET_ID",mN=e=>t=>t({type:Ow,id:e}),Lw="SET_CONTACT_EMAIL_AND_PHONE",hN=e=>t=>t({type:Lw,value:e}),Bw="SET_SOCIAL_ID_AND_ADDRESS",fN=(e,t,r)=>i=>i({type:Bw,socialId:e,address:t,lastStage:r}),Fw="SET_HOME_DELIVERY",gN=(e,t)=>r=>r({type:Fw,homeDelivery:e,lastStage:t}),Rw="SET_DEALER",yN=(e,t)=>r=>r({type:Rw,dealer:e,lastStage:t}),Hw="INIT_TRADE_IN",bN=e=>t=>t({type:Hw,lastStage:e}),_w="SET_TRADE_IN",Kd=(e,t,r)=>i=>i({type:_w,lastStage:e,tradeIn:t,tradeInVehicle:r}),$w="SET_FINANCIAL",vN=(e,t)=>r=>r({type:$w,paymentType:e,lastStage:t}),qw="SET_PAYMENT_LOOKUP_RESPONSE",kN=e=>t=>t({type:qw,paymentLookupResponse:dp(e)}),jw="SET_DRIVING_DISTANCE",AN=e=>t=>t({type:jw,drivingDistance:e}),Gw="COMPLETE_STAGE",Ko=e=>t=>t({type:Gw,lastStage:e}),Uw="SET_OR_REMOVE_INSURANCE",pp=e=>t=>t({type:Uw,insurance:e}),zw="SET_OR_REMOVE_INSURANCE_ADDONS",wN=(e,t)=>r=>r({type:zw,insurance:e,insuranceAddons:t}),Vw="SET_OR_REMOVE_FREE_INSURANCE",xN=e=>t=>t({type:Vw,freeInsurance:e}),Qw="SET_OR_REMOVE_ACCESSORY",EN=e=>t=>t({type:Qw,accessory:e}),Ww="GO_TO",Lr=(e,t,r)=>i=>i({type:Ww,view:e,index:t,subStage:r}),Jw="SET_STAGES",SN=e=>t=>t({type:Jw,stages:e}),Yw="SET_CREATED_ORDER_ID",IN=(e,t)=>r=>r({type:Yw,id:e,payment:t}),Zw="SET_CREDIT_ASSESSMENT_RESPONSE",Yo=(e,t)=>r=>r({type:Zw,caseId:e,creditAssessmentResponse:t}),Kw="SET_STATE",CN=e=>t=>t({type:Kw,state:e}),TN={},Dk={view:"preview",stage:1,subStage:1},Ok={id:"",topNavigation:{...Dk},navigation:{...Dk},customer:{email:"",phone:"",givenName:"",surname:"",socialId:""},homeDelivery:!1,accessories:[],drivingDistance:fe.Between0And1000,...TN},Oi=(e,t)=>t?{view:"summary",stage:1,subStage:1}:{view:"main",stage:e+1,subStage:1},Li=(e,t)=>t.view==="main"?e.stage<t.stage?t:D.topNavigation:{...e,stage:e.stage+1},Hd=e=>e&&e?.length===1&&e?.[0].type===G.Cash?G.Cash:void 0,PN=(e=Ok,t)=>{let r,i;switch(D={...e},t.type){case Mw:return{...Ok,id:t.id};case Jw:return{...D,stages:t.stages};case Ow:return{...D,id:t.id};case Nw:return{...e,order:t.order,paymentType:Hd(t.order?.paymentOptions),vehicle:{...t.order.orderVehicle,...t.vehicle||{}}};case Lw:let n={...D,customer:{...e.customer,email:t.value.email,phone:t.value.phone},navigation:{view:"main",stage:e.navigation.stage,subStage:2}};return delete n.wantTradeIn,delete n.tradeIn,delete n.tradeInVehicle,n.paymentType=Hd(e.order?.paymentOptions),delete n.paymentLookupResponse,delete n.insurance,delete n.insuranceAddOns,delete n.freeInsurance,delete n.dealer,n.accessories=[],n;case Bw:return r=Oi(D.navigation.stage,t.lastStage),i=Li(D.topNavigation,r),D={...e,navigation:r,topNavigation:i,address:t.address,customer:{...e.customer,socialId:t.socialId}},D;case Rw:return r=Oi(e.navigation.stage,t.lastStage),i={...r},D={...e,navigation:r,topNavigation:i,dealer:t.dealer},delete D.wantTradeIn,delete D.tradeIn,delete D.tradeInVehicle,D.paymentType=Hd(e.order?.paymentOptions),delete D.paymentLookupResponse,delete D.insurance,delete D.insuranceAddOns,delete D.freeInsurance,D.accessories=[],D;case Fw:return r=Oi(e.navigation.stage,t.lastStage),i=Li(D.topNavigation,r),D={...e,navigation:r,topNavigation:i,homeDelivery:t.homeDelivery},D;case Hw:return r={view:"main",stage:e.navigation.stage,subStage:1},i=Li(D.topNavigation,r),D={...e,navigation:r,wantTradeIn:!0,topNavigation:i,tradeIn:e.tradeIn||{registrationNumber:"",mileage:"",description:""}},D;case _w:return r=Oi(e.navigation.stage,t.lastStage),i=Li(D.topNavigation,r),D={...e,navigation:r,topNavigation:i,wantTradeIn:!!t.tradeIn,tradeIn:t.tradeIn,tradeInVehicle:t.tradeInVehicle},D;case $w:return r=Oi(e.navigation.stage,t.lastStage),i=Li(D.topNavigation,r),{...D,navigation:r,topNavigation:i,paymentType:t.paymentType};case qw:return{...D,paymentLookupResponse:t.paymentLookupResponse};case jw:return{...D,drivingDistance:t.drivingDistance};case Gw:return r=Oi(e.navigation.stage,t.lastStage),i=Li(D.topNavigation,r),D={...e,navigation:r,topNavigation:i},D;case zw:return D.insurance=t.insurance,D.insuranceAddOns={insurance:t.insurance.name,addOns:t.insuranceAddons},D;case Uw:return Nk(D.insurance,t.insurance)?D.insurance=void 0:D.insurance=t.insurance,D.insuranceAddOns?.insurance&&(D.insuranceAddOns=void 0),D;case Vw:return Nk(D.freeInsurance,t.freeInsurance)?D.freeInsurance=void 0:D.freeInsurance=t.freeInsurance,D;case Qw:return _d=D.accessories.findIndex(o=>o.id===t.accessory.id),D.accessories=[...D.accessories],_d>-1?D.accessories.splice(_d,1):D.accessories.push(t.accessory),{...D,accessories:[...D.accessories]};case Ww:return{...e,navigation:{view:t.view,stage:t.index||1,subStage:t.subStage||1}};case Yw:return t.payment?r={view:"main",stage:e.navigation.stage,subStage:2}:r=Oi(e.navigation.stage,!0),i=Li(D.topNavigation,r),D={...e,navigation:r,topNavigation:i,createdOrderId:t.id,payment:t.payment},D;case Zw:return{...D,caseId:t.caseId,creditAssessmentResponse:t.creditAssessmentResponse};case Kw:return{...t.state};default:return e}},MN=PN,NN=()=>qu(MN),Xw=(e,t)=>{if(!t)return e;let r=new URL(e);return`${t}${r.pathname}`},DN=e=>e.toString().replace(/\s/g,""),ON=(e,t)=>{if(!t)return e;let r=Math.pow(10,t);return(Math.round(e*r)/r).toFixed(t)},j=(e,t)=>{if(e===void 0)return"???";let r=ON(e,t?.decimals!==void 0?t.decimals:0);return`${t?.prefix?`${t.prefix}`:""}${DN(r).replace(/\B(?=(\d{3})+(?!\d))/g," ")}${t?.postfix?` ${t.postfix}`:""}`},LN=(e,t)=>{let r=e.split(" "),i=t.split(" ").map(n=>n.toLowerCase());return r.filter(n=>!i.includes(n.toLowerCase())).join(" ")},mp=e=>{if(e)return LN(e.shortDescription||"",e.title||"")},BN=({vehicle:e,order:t,meta:r,cdnMedia:i})=>{let n=e?.imageUrls,o=e?.title,a=j(e?.price||NaN),s=t?.contactInformation?.name;return`
35
+ `)});let s=t.nonTextTags||["script","style","textarea","option"],c,l;t.allowedAttributes&&(c={},l={},Wo(t.allowedAttributes,function(w,C){c[C]=[];let I=[];w.forEach(function(q){typeof q=="string"&&q.indexOf("*")>=0?I.push(Ik(q).replace(/\\\*/g,".*")):c[C].push(q)}),I.length&&(l[C]=new RegExp("^("+I.join("|")+")$"))}));let u={},p={},h={};Wo(t.allowedClasses,function(w,C){if(c&&(Or(c,C)||(c[C]=[]),c[C].push("class")),u[C]=w,Array.isArray(w)){let I=[];u[C]=[],h[C]=[],w.forEach(function(q){typeof q=="string"&&q.indexOf("*")>=0?I.push(Ik(q).replace(/\\\*/g,".*")):q instanceof RegExp?h[C].push(q):u[C].push(q)}),I.length&&(p[C]=new RegExp("^("+I.join("|")+")$"))}});let b={},v;Wo(t.transformTags,function(w,C){let I;typeof w=="function"?I=w:typeof w=="string"&&(I=Jo.simpleTransform(w)),C==="*"?v=I:b[C]=I});let y,m,f,g,x,T,B=!1;he();let ge=new XM.Parser({onopentag:function(w,C){if(t.enforceHtmlBoundary&&w==="html"&&he(),x){T++;return}let I=new o(w,C);m.push(I);let q=!1,Le=!!I.text,Ne;if(Or(b,w)&&(Ne=b[w](w,C),I.attribs=C=Ne.attribs,Ne.text!==void 0&&(I.innerText=Ne.text),w!==Ne.tagName&&(I.name=w=Ne.tagName,g[y]=Ne.tagName)),v&&(Ne=v(w,C),I.attribs=C=Ne.attribs,w!==Ne.tagName&&(I.name=w=Ne.tagName,g[y]=Ne.tagName)),(!a(w)||t.disallowedTagsMode==="recursiveEscape"&&!oN(f)||t.nestingLimit!=null&&y>=t.nestingLimit)&&(q=!0,f[y]=!0,t.disallowedTagsMode==="discard"&&s.indexOf(w)!==-1&&(x=!0,T=1),f[y]=!0),y++,q){if(t.disallowedTagsMode==="discard")return;n=i,i=""}i+="<"+w,w==="script"&&(t.allowedScriptHostnames||t.allowedScriptDomains)&&(I.innerText=""),(!c||Or(c,w)||c["*"])&&Wo(C,function(ce,re){if(!sN.test(re)){delete I.attribs[re];return}if(ce===""&&(t.nonBooleanAttributes.includes(re)||t.nonBooleanAttributes.includes("*"))){delete I.attribs[re];return}let Ht=!1;if(!c||Or(c,w)&&c[w].indexOf(re)!==-1||c["*"]&&c["*"].indexOf(re)!==-1||Or(l,w)&&l[w].test(re)||l["*"]&&l["*"].test(re))Ht=!0;else if(c&&c[w]){for(let Q of c[w])if(eN(Q)&&Q.name&&Q.name===re){Ht=!0;let oe="";if(Q.multiple===!0){let Kt=ce.split(" ");for(let It of Kt)Q.values.indexOf(It)!==-1&&(oe===""?oe=It:oe+=" "+It)}else Q.values.indexOf(ce)>=0&&(oe=ce);ce=oe}}if(Ht){if(t.allowedSchemesAppliedToAttributes.indexOf(re)!==-1&&$(w,ce)){delete I.attribs[re];return}if(w==="script"&&re==="src"){let Q=!0;try{let oe=O(ce);if(t.allowedScriptHostnames||t.allowedScriptDomains){let Kt=(t.allowedScriptHostnames||[]).find(function(dt){return dt===oe.url.hostname}),It=(t.allowedScriptDomains||[]).find(function(dt){return oe.url.hostname===dt||oe.url.hostname.endsWith(`.${dt}`)});Q=Kt||It}}catch{Q=!1}if(!Q){delete I.attribs[re];return}}if(w==="iframe"&&re==="src"){let Q=!0;try{let oe=O(ce);if(oe.isRelativeUrl)Q=Or(t,"allowIframeRelativeUrls")?t.allowIframeRelativeUrls:!t.allowedIframeHostnames&&!t.allowedIframeDomains;else if(t.allowedIframeHostnames||t.allowedIframeDomains){let Kt=(t.allowedIframeHostnames||[]).find(function(dt){return dt===oe.url.hostname}),It=(t.allowedIframeDomains||[]).find(function(dt){return oe.url.hostname===dt||oe.url.hostname.endsWith(`.${dt}`)});Q=Kt||It}}catch{Q=!1}if(!Q){delete I.attribs[re];return}}if(re==="srcset")try{let Q=tN(ce);if(Q.forEach(function(oe){$("srcset",oe.url)&&(oe.evil=!0)}),Q=Tk(Q,function(oe){return!oe.evil}),Q.length)ce=aN(Tk(Q,function(oe){return!oe.evil})),I.attribs[re]=ce;else{delete I.attribs[re];return}}catch{delete I.attribs[re];return}if(re==="class"){let Q=u[w],oe=u["*"],Kt=p[w],It=h[w],dt=p["*"],ra=[Kt,dt].concat(It).filter(function(si){return si});if(Q&&oe?ce=St(ce,Ck(Q,oe),ra):ce=St(ce,Q||oe,ra),!ce.length){delete I.attribs[re];return}}if(re==="style"){if(t.parseStyleAttributes)try{let Q=rN(w+" {"+ce+"}"),oe=R(Q,t.allowedStyles);if(ce=X(oe),ce.length===0){delete I.attribs[re];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+w+" {"+ce+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete I.attribs[re];return}else if(t.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}i+=" "+re,ce&&ce.length&&(i+='="'+ne(ce,!0)+'"')}else delete I.attribs[re]}),t.selfClosing.indexOf(w)!==-1?i+=" />":(i+=">",I.innerText&&!Le&&!t.textFilter&&(i+=ne(I.innerText),B=!0)),q&&(i=n+ne(i),n="")},ontext:function(w){if(x)return;let C=m[m.length-1],I;if(C&&(I=C.tag,w=C.innerText!==void 0?C.innerText:w),t.disallowedTagsMode==="discard"&&(I==="script"||I==="style"))i+=w;else{let q=ne(w,!1);t.textFilter&&!B?i+=t.textFilter(q,I):B||(i+=q)}if(m.length){let q=m[m.length-1];q.text+=w}},onclosetag:function(w,C){if(x)if(T--,!T)x=!1;else return;let I=m.pop();if(!I)return;if(I.tag!==w){m.push(I);return}x=t.enforceHtmlBoundary?w==="html":!1,y--;let q=f[y];if(q){if(delete f[y],t.disallowedTagsMode==="discard"){I.updateParentNodeText();return}n=i,i=""}if(g[y]&&(w=g[y],delete g[y]),t.exclusiveFilter&&t.exclusiveFilter(I)){i=i.substr(0,I.tagPosition);return}if(I.updateParentNodeMediaChildren(),I.updateParentNodeText(),t.selfClosing.indexOf(w)!==-1||C&&!a(w)&&["escape","recursiveEscape"].indexOf(t.disallowedTagsMode)>=0){q&&(i=n,n="");return}i+="</"+w+">",q&&(i=n+ne(i),n=""),B=!1}},t.parser);return ge.write(e),ge.end(),i;function he(){i="",y=0,m=[],f={},g={},x=!1,T=0}function ne(w,C){return typeof w!="string"&&(w=w+""),t.parser.decodeEntities&&(w=w.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),C&&(w=w.replace(/"/g,"&quot;"))),w=w.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),C&&(w=w.replace(/"/g,"&quot;")),w}function $(w,C){for(C=C.replace(/[\x00-\x20]+/g,"");;){let Le=C.indexOf("<!--");if(Le===-1)break;let Ne=C.indexOf("-->",Le+4);if(Ne===-1)break;C=C.substring(0,Le)+C.substring(Ne+3)}let I=C.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!I)return C.match(/^[/\\]{2}/)?!t.allowProtocolRelative:!1;let q=I[1].toLowerCase();return Or(t.allowedSchemesByTag,w)?t.allowedSchemesByTag[w].indexOf(q)===-1:!t.allowedSchemes||t.allowedSchemes.indexOf(q)===-1}function O(w){if(w=w.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),w.startsWith("relative:"))throw new Error("relative: exploit attempt");let C="relative://relative-site";for(let Le=0;Le<100;Le++)C+=`/${Le}`;let I=new URL(w,C);return{isRelativeUrl:I&&I.hostname==="relative-site"&&I.protocol==="relative:",url:I}}function R(w,C){if(!C)return w;let I=w.nodes[0],q;return C[I.selector]&&C["*"]?q=Ck(C[I.selector],C["*"]):q=C[I.selector]||C["*"],q&&(w.nodes[0].nodes=I.nodes.reduce(Me(q),[])),w}function X(w){return w.nodes[0].nodes.reduce(function(C,I){return C.push(`${I.prop}:${I.value}${I.important?" !important":""}`),C},[]).join(";")}function Me(w){return function(C,I){return Or(w,I.prop)&&w[I.prop].some(function(Le){return Le.test(I.value)})&&C.push(I),C}}function St(w,C,I){return C?(w=w.split(/\s+/),w.filter(function(q){return C.indexOf(q)!==-1||I.some(function(Le){return Le.test(q)})}).join(" ")):w}}var cN={decodeEntities:!0};Jo.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","main","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0};Jo.simpleTransform=function(e,t,r){return r=r===void 0?!0:r,t=t||{},function(i,n){let o;if(r)for(o in t)n[o]=t[o];else n=t;return{tagName:e,attribs:n}}}});var zx={};Tp(zx,{default:()=>A9});import{marked as yD}from"marked";var Xd,Zo,lN,Nk,dp,uN,Pw,dN,Mw,pN,Nw,Dw,Ow,mN,Lw,hN,Bw,fN,Fw,gN,Rw,yN,Hw,bN,_w,Kd,$w,vN,qw,kN,jw,AN,Gw,Ko,Uw,pp,zw,wN,Vw,xN,Qw,EN,Ww,Lr,Jw,SN,Yw,IN,Zw,Yo,Kw,CN,TN,Dk,Ok,Oi,Li,Hd,D,_d,PN,MN,NN,Xw,DN,ON,j,LN,mp,BN,ex,tx,FN,$d,Lk,RN,HN,_N,$N,qN,jN,Zt,GN,S,UN,Ve,zN,Pn,VN,Y,QN,Xo,WN,JN,rx,YN,ZN,KN,je,XN,oi,vc,eD,tD,ep,gc,rD,k,iD,Bk,Fk,nD,hp,oD,xc,aD,Hi,sD,cD,lD,uD,dD,fp,Mn,Et,pD,Ec,mD,kc,_i,hD,Rk,Hk,fD,gD,ix,_k,$k,qk,jk,bD,vD,kD,AD,wD,xD,nx,Gk,ED,Uk,zk,SD,ID,Vk,CD,Sc,TD,tp,Qk,Wk,PD,Ic,MD,Ri,ND,Se,ox,Jk,DD,Yk,OD,LD,Tn,ax,BD,xt,FD,RD,HD,_D,$D,sx,Ce,Zk,qD,Kk,jD,Xk,GD,Ac,UD,zD,VD,QD,gp,WD,JD,qd,Cc,YD,ZD,eA,tA,rp,KD,XD,eO,tO,rO,iO,nO,oO,aO,cx,rA,lx,iA,ux,nA,sO,cO,yp,bp,Bi,lO,uO,jd,dO,pO,dx,vp,mO,hO,fO,kp,gO,yO,oA,bO,px,aA,Gd,vO,mx,kO,Ap,ip,AO,wO,xO,EO,Tc,SO,sA,hx,cA,fx,lA,IO,CO,TO,uA,gx,dA,yx,pA,PO,MO,NO,bx,DO,mA,vx,hA,OO,LO,BO,FO,RO,HO,bc,np,fA,gA,_O,kx,$O,yA,op,Ud,qO,bA,jO,vA,Ax,kA,wx,AA,xx,wA,Ex,xA,Sx,EA,Ix,SA,GO,IA,Cx,zd,CA,TA,PA,Ge,UO,zO,VO,QO,WO,JO,YO,ZO,KO,MA,XO,eL,tL,rL,NA,DA,OA,LA,iL,nL,oL,aL,BA,sL,FA,cL,RA,lL,uL,HA,_A,Tx,$A,qA,dL,pL,mL,jA,hL,fL,Px,GA,gL,UA,yL,zA,bL,vL,kL,VA,AL,wL,xL,EL,Mx,SL,IL,CL,TL,Vd,QA,Qd,WA,JA,ap,PL,ML,NL,DL,OL,sp,LL,YA,Nx,ZA,Dx,KA,XA,BL,FL,Ox,ew,tw,wp,rw,iw,Lx,nw,RL,HL,ow,aw,sw,_L,$L,qL,jL,GL,UL,cp,zL,cw,VL,QL,WL,JL,YL,ZL,KL,XL,eB,Bx,lw,Fx,uw,Rx,dw,tB,pw,Hx,mw,rB,hw,lp,yc,_x,fw,Fi,iB,nB,oB,aB,$x,gw,qx,yw,up,Wd,sB,cB,jx,lB,uB,Gx,bw,dB,vw,pB,mB,hB,fB,gB,yB,bB,vB,kw,kB,AB,wB,Ux,Aw,ww,xB,xw,Ew,EB,SB,IB,CB,TB,PB,MB,Nn,NB,DB,OB,LB,BB,FB,RB,HB,_B,$B,qB,jB,Sw,GB,UB,zB,VB,QB,WB,JB,YB,ZB,KB,XB,e9,t9,r9,i9,n9,o9,a9,s9,c9,l9,Iw,u9,d9,Cw,Tw,p9,m9,Jd,h9,Yd,f9,Zd,wc,g9,y9,b9,v9,k9,A9,Vx=Br(()=>{te();Db();te();te();te();Xd=Pp(Lb(),1),Zo=Pp(Mk(),1);te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();te();lN={name:"@wayke-se/ecom-web",version:"1.5.2",description:"Wayke Ecom Web",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",homepage:"https://github.com/wayke-se/wayke-ecom-web",scripts:{start:"node ./esbuild/start.js",clip:"node ./esbuild/clip-ui.js && node ./clip-ui/start.js",build:"npm run clean && node ./esbuild/lib.js && node ./esbuild/cdn.js",clean:"rimraf build && rimraf dist && rimraf dist-cdn",test:"npm run lint && npm run typecheck",typecheck:"tsc -noEmit","typecheck:watch":"tsc -noEmit -watch",lint:"eslint --ext .ts,.js src","lint:fix":"eslint --ext .ts,.js 'src' --fix",stylelint:"stylelint '**/*.scss'",prepare:"husky install"},author:"Wayke",license:"ISC",devDependencies:{"@ourstudio/clip-ui":"^0.0.11","@types/marked":"^4.3.0","@types/node":"^17.0.18","@types/object-path":"^0.11.1","@types/sanitize-html":"^2.6.2","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0",esbuild:"^0.15.10","esbuild-sass-plugin":"2.3.3",eslint:"^8.9.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0",husky:"^8.0.1","npm-dts":"^1.3.11",prettier:"^2.5.1",rimraf:"^5.0.1",stylelint:"^15.2.0","stylelint-config-prettier-scss":"^1.0.0","stylelint-config-standard-scss":"^9.0.0",typescript:"^5.1.3"},dependencies:{"@wayke-se/ecom":"^4.4.0",marked:"^4.3.0","object-path":"^0.11.8",redux:"^4.1.2","sanitize-html":"^2.7.0"},files:["dist"]},Nk=(e,t)=>e!==void 0&&t!==void 0?JSON.stringify(e).localeCompare(JSON.stringify(t))===0:e===t,dp=e=>({costs:e.getCosts(),fees:e.getFees(),interests:e.getInterests(),durationSpec:e.getDurationSpec(),downPaymentSpec:e.getDownPaymentSpec(),residualValueSpec:e.getResidualValueSpec(),totalResidualValue:e.getTotalResidualValue(),publicURL:e.getPublicURL(),shouldUseCreditScoring:e.shouldUseCreditScoring(),financialProductCode:e.getFinancialProductCode(),price:e.getPrice(),creditAmount:e.getCreditAmount(),hasPrivacyPolicy:e.hasPrivacyPolicy(),privacyPolicyUrl:e.getPrivacyPolicyUrl()}),uN=e=>({status:e.getStatus(),hasPendingSigning:e.hasPendingSigning(),hintCode:e.getHintCode(),signingMessage:e.getSigningMessage(),shouldRenewSigning:e.shouldRenewSigning(),isSigned:e.isSigned(),address:void 0,pendingScoring:e.hasPendingScoring(),isScored:e.isScored(),hasScoringError:e.hasScoringError(),scoringId:e.getScoringId(),recommendation:e.getRecommendation(),decision:e.getDecision(),isAccepted:e.isAccepted()}),Pw=e=>({orderVehicle:e.getOrderVehicle(),accessories:e.getAccessories(),requiresDealerSelection:e.requiresDealerSelection(),dealerSites:e.getDealerSites(),paymentOptions:e.getPaymentOptions().map(t=>({...t,loanDetails:t.loanDetails?dp(t.loanDetails):void 0})),deliveryOptions:e.getDeliveryOptions(),insuranceOption:e.getInsuranceOption(),orderConditions:e.getOrderConditions(),orderReturnConditions:e.getOrderReturnConditions(),conditionsPdfUri:e.getConditionsPdfUri(),contactInformation:e.getContactInformation(),allowsTradeIn:e.allowsTradeIn(),isUnavailable:e.isUnavailable(),isPaymentRequired:e.isPaymentRequired()}),dN=e=>({vehicle:e.getVehicle()}),Mw="RESET",pN=e=>t=>t({type:Mw,id:e}),Nw="SET_ORDER",Dw=(e,t)=>r=>r({type:Nw,order:e,vehicle:t}),Ow="SET_ID",mN=e=>t=>t({type:Ow,id:e}),Lw="SET_CONTACT_EMAIL_AND_PHONE",hN=e=>t=>t({type:Lw,value:e}),Bw="SET_SOCIAL_ID_AND_ADDRESS",fN=(e,t,r)=>i=>i({type:Bw,socialId:e,address:t,lastStage:r}),Fw="SET_HOME_DELIVERY",gN=(e,t)=>r=>r({type:Fw,homeDelivery:e,lastStage:t}),Rw="SET_DEALER",yN=(e,t)=>r=>r({type:Rw,dealer:e,lastStage:t}),Hw="INIT_TRADE_IN",bN=e=>t=>t({type:Hw,lastStage:e}),_w="SET_TRADE_IN",Kd=(e,t,r)=>i=>i({type:_w,lastStage:e,tradeIn:t,tradeInVehicle:r}),$w="SET_FINANCIAL",vN=(e,t)=>r=>r({type:$w,paymentType:e,lastStage:t}),qw="SET_PAYMENT_LOOKUP_RESPONSE",kN=e=>t=>t({type:qw,paymentLookupResponse:dp(e)}),jw="SET_DRIVING_DISTANCE",AN=e=>t=>t({type:jw,drivingDistance:e}),Gw="COMPLETE_STAGE",Ko=e=>t=>t({type:Gw,lastStage:e}),Uw="SET_OR_REMOVE_INSURANCE",pp=e=>t=>t({type:Uw,insurance:e}),zw="SET_OR_REMOVE_INSURANCE_ADDONS",wN=(e,t)=>r=>r({type:zw,insurance:e,insuranceAddons:t}),Vw="SET_OR_REMOVE_FREE_INSURANCE",xN=e=>t=>t({type:Vw,freeInsurance:e}),Qw="SET_OR_REMOVE_ACCESSORY",EN=e=>t=>t({type:Qw,accessory:e}),Ww="GO_TO",Lr=(e,t,r)=>i=>i({type:Ww,view:e,index:t,subStage:r}),Jw="SET_STAGES",SN=e=>t=>t({type:Jw,stages:e}),Yw="SET_CREATED_ORDER_ID",IN=(e,t)=>r=>r({type:Yw,id:e,payment:t}),Zw="SET_CREDIT_ASSESSMENT_RESPONSE",Yo=(e,t)=>r=>r({type:Zw,caseId:e,creditAssessmentResponse:t}),Kw="SET_STATE",CN=e=>t=>t({type:Kw,state:e}),TN={},Dk={view:"preview",stage:1,subStage:1},Ok={id:"",topNavigation:{...Dk},navigation:{...Dk},customer:{email:"",phone:"",givenName:"",surname:"",socialId:""},homeDelivery:!1,accessories:[],drivingDistance:fe.Between0And1000,...TN},Oi=(e,t)=>t?{view:"summary",stage:1,subStage:1}:{view:"main",stage:e+1,subStage:1},Li=(e,t)=>t.view==="main"?e.stage<t.stage?t:D.topNavigation:{...e,stage:e.stage+1},Hd=e=>e&&e?.length===1&&e?.[0].type===G.Cash?G.Cash:void 0,PN=(e=Ok,t)=>{let r,i;switch(D={...e},t.type){case Mw:return{...Ok,id:t.id};case Jw:return{...D,stages:t.stages};case Ow:return{...D,id:t.id};case Nw:return{...e,order:t.order,paymentType:Hd(t.order?.paymentOptions),vehicle:{...t.order.orderVehicle,...t.vehicle||{}}};case Lw:let n={...D,customer:{...e.customer,email:t.value.email,phone:t.value.phone},navigation:{view:"main",stage:e.navigation.stage,subStage:2}};return delete n.wantTradeIn,delete n.tradeIn,delete n.tradeInVehicle,n.paymentType=Hd(e.order?.paymentOptions),delete n.paymentLookupResponse,delete n.insurance,delete n.insuranceAddOns,delete n.freeInsurance,delete n.dealer,n.accessories=[],n;case Bw:return r=Oi(D.navigation.stage,t.lastStage),i=Li(D.topNavigation,r),D={...e,navigation:r,topNavigation:i,address:t.address,customer:{...e.customer,socialId:t.socialId}},D;case Rw:return r=Oi(e.navigation.stage,t.lastStage),i={...r},D={...e,navigation:r,topNavigation:i,dealer:t.dealer},delete D.wantTradeIn,delete D.tradeIn,delete D.tradeInVehicle,D.paymentType=Hd(e.order?.paymentOptions),delete D.paymentLookupResponse,delete D.insurance,delete D.insuranceAddOns,delete D.freeInsurance,D.accessories=[],D;case Fw:return r=Oi(e.navigation.stage,t.lastStage),i=Li(D.topNavigation,r),D={...e,navigation:r,topNavigation:i,homeDelivery:t.homeDelivery},D;case Hw:return r={view:"main",stage:e.navigation.stage,subStage:1},i=Li(D.topNavigation,r),D={...e,navigation:r,wantTradeIn:!0,topNavigation:i,tradeIn:e.tradeIn||{registrationNumber:"",mileage:"",description:""}},D;case _w:return r=Oi(e.navigation.stage,t.lastStage),i=Li(D.topNavigation,r),D={...e,navigation:r,topNavigation:i,wantTradeIn:!!t.tradeIn,tradeIn:t.tradeIn,tradeInVehicle:t.tradeInVehicle},D;case $w:return r=Oi(e.navigation.stage,t.lastStage),i=Li(D.topNavigation,r),{...D,navigation:r,topNavigation:i,paymentType:t.paymentType};case qw:return{...D,paymentLookupResponse:t.paymentLookupResponse};case jw:return{...D,drivingDistance:t.drivingDistance};case Gw:return r=Oi(e.navigation.stage,t.lastStage),i=Li(D.topNavigation,r),D={...e,navigation:r,topNavigation:i},D;case zw:return D.insurance=t.insurance,D.insuranceAddOns={insurance:t.insurance.name,addOns:t.insuranceAddons},D;case Uw:return Nk(D.insurance,t.insurance)?D.insurance=void 0:D.insurance=t.insurance,D.insuranceAddOns?.insurance&&(D.insuranceAddOns=void 0),D;case Vw:return Nk(D.freeInsurance,t.freeInsurance)?D.freeInsurance=void 0:D.freeInsurance=t.freeInsurance,D;case Qw:return _d=D.accessories.findIndex(o=>o.id===t.accessory.id),D.accessories=[...D.accessories],_d>-1?D.accessories.splice(_d,1):D.accessories.push(t.accessory),{...D,accessories:[...D.accessories]};case Ww:return{...e,navigation:{view:t.view,stage:t.index||1,subStage:t.subStage||1}};case Yw:return t.payment?r={view:"main",stage:e.navigation.stage,subStage:2}:r=Oi(e.navigation.stage,!0),i=Li(D.topNavigation,r),D={...e,navigation:r,topNavigation:i,createdOrderId:t.id,payment:t.payment},D;case Zw:return{...D,caseId:t.caseId,creditAssessmentResponse:t.creditAssessmentResponse};case Kw:return{...t.state};default:return e}},MN=PN,NN=()=>qu(MN),Xw=(e,t)=>{if(!t)return e;let r=new URL(e);return`${t}${r.pathname}`},DN=e=>e.toString().replace(/\s/g,""),ON=(e,t)=>{if(!t)return e;let r=Math.pow(10,t);return(Math.round(e*r)/r).toFixed(t)},j=(e,t)=>{if(e===void 0)return"???";let r=ON(e,t?.decimals!==void 0?t.decimals:0);return`${t?.prefix?`${t.prefix}`:""}${DN(r).replace(/\B(?=(\d{3})+(?!\d))/g," ")}${t?.postfix?` ${t.postfix}`:""}`},LN=(e,t)=>{let r=e.split(" "),i=t.split(" ").map(n=>n.toLowerCase());return r.filter(n=>!i.includes(n.toLowerCase())).join(" ")},mp=e=>{if(e)return LN(e.shortDescription||"",e.title||"")},BN=({vehicle:e,order:t,meta:r,cdnMedia:i})=>{let n=e?.imageUrls,o=e?.title,a=j(e?.price||NaN),s=t?.contactInformation?.name;return`
36
36
  <div class="waykeecom-product-card">
37
37
  ${n?.length?`
38
38
  <div class="waykeecom-product-card__media">
@@ -939,7 +939,7 @@ and ensure you are accounting for this risk.
939
939
  <div class="waykeecom-hstack__item">Varf\xF6r m\xE5ste jag svara p\xE5 allt detta?</div>
940
940
  </div>`,description:`<div class="waykeecom-content">
941
941
  <p class="waykeecom-content__p">${a?.name} m\xE5ste ta in uppgifterna av kunden f\xF6r att uppfylla best\xE4mmelser i Konsumentkreditlagen (2010:1846) och Lag (2017:630) om \xE5tg\xE4rder mot penningtv\xE4tt och finansiering av terrorism.</p>
942
- <p class="waykeecom-content__p"><a href="#" title="" target="_blank" rel="noopener norefferer" class="waykeecom-link">L\xE4s mer om detta h\xE4r</a></p>
942
+ <p class="waykeecom-content__p"><a href="${a?.loanDetails?.privacyPolicyUrl}" title="" target="_blank" rel="noopener norefferer" class="waykeecom-link">L\xE4s mer om detta h\xE4r</a></p>
943
943
  </div>`,onClick:()=>{k("MAIN","FINANCIAL_LOAN_KYC_INFORMATION_TOGGLE","FINANCIAL")}}),(e||this.caseError||this.bankidError)&&this.node.querySelector(`#${zd}`)?.scrollIntoView()}}},WO=QO,JO=class extends S{constructor(e,t){super(e),this.props=t,this.render()}update(e){this.props=e,this.node.querySelector(".waykeecom-pie-chart__chart-data")?.setAttribute("stroke-dasharray",`calc(${this.props.percentage} * 31.4 / 100) 31.4`)}render(){let{percentage:e}=this.props;this.node.innerHTML=`
944
944
  <div class="waykeecom-pie-chart">
945
945
  <svg height="20" width="20" viewBox="0 0 20 20" class="waykeecom-pie-chart__chart">