Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWPW-156357 Price-literals - fail gracefully #2815

Merged
merged 18 commits into from
Sep 10, 2024

Conversation

bozojovicic
Copy link
Contributor

@bozojovicic bozojovicic commented Sep 2, 2024

commerce.js and price-literals.json are called always together and always at the same time. This PR injects price literals into commerce.js so there will be no need for some fallback service if price-literals.json fails.
This change increases commerce.js for 5KB but eliminates the call for price-literals.json and hence eliminates the possibility of its failure.

  • old size of commerce.js is 26.6 KB
  • new size of commerce.js 32.2 KB

It also removes the possibility for authors to change this file in sharepoint now when we have it in source code /libs/features/mas/commerce/price-literals.json but this content is changed only once during the last year.
I removed tons of code that we had only for loading of price literals.

Test page

Resolves: MWPW-156357

Test URLs:

@bozojovicic bozojovicic requested review from a team as code owners September 2, 2024 12:35
Copy link
Contributor

aem-code-sync bot commented Sep 2, 2024

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.09%. Comparing base (510f7a6) to head (b5a62d8).
Report is 10 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage    #2815      +/-   ##
==========================================
+ Coverage   95.87%   96.09%   +0.21%     
==========================================
  Files         173      215      +42     
  Lines       46333    53934    +7601     
==========================================
+ Hits        44421    51826    +7405     
- Misses       1912     2108     +196     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

libs/blocks/merch/merch.js Outdated Show resolved Hide resolved
Copy link
Contributor

@mokimo mokimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think it's very rare to run into the catch block within a fetch and wouldn't rely on the fetch to fail to begin with, but it's not a blocker to me.

libs/blocks/merch/merch.js Outdated Show resolved Hide resolved
@yesil yesil added run-nala Run Nala Test Automation against PR commerce labels Sep 3, 2024
yesil
yesil previously approved these changes Sep 4, 2024
Try polyfilling it using "@formatjs/intl-pluralrules"
`,le.MISSING_INTL_API,s);var C=n.getPluralRules(t,{type:c.pluralType}).select(f-(c.offset||0));T=c.options[C]||c.options.other}if(!T)throw new ir(c.value,f,Object.keys(c.options),s);a.push.apply(a,De(T.value,t,n,r,i,f-(c.offset||0)));continue}}return qi(a)}function Zi(e,t){return t?y(y(y({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=y(y({},e[r]),t[r]||{}),n},{})):e}function Ji(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=Zi(e[r],t[r]),n},y({},e)):e}function or(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function Qi(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Ie(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,qe([void 0],n)))},{cache:or(e.number),strategy:rt.variadic}),getDateTimeFormat:Ie(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,qe([void 0],n)))},{cache:or(e.dateTime),strategy:rt.variadic}),getPluralRules:Ie(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,qe([void 0],n)))},{cache:or(e.pluralRules),strategy:rt.variadic})}}var gn=function(){function e(t,n,r,i){var o=this;if(n===void 0&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(s){var a=o.formatToParts(s);if(a.length===1)return a[0].value;var l=a.reduce(function(u,c){return!u.length||c.type!==I.literal||typeof u[u.length-1]!="string"?u.push(c.value):u[u.length-1]+=c.value,u},[]);return l.length<=1?l[0]||"":l},this.formatToParts=function(s){return De(o.ast,o.locales,o.formatters,o.formats,s,void 0,o.message)},this.resolvedOptions=function(){return{locale:Intl.NumberFormat.supportedLocalesOf(o.locales)[0]}},this.getAst=function(){return o.ast},typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:i?.ignoreTag})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Ji(e.formats,r),this.locales=n,this.formatters=i&&i.formatters||Qi(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.__parse=pn,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();var xn=gn;var Ki=/[0-9\-+#]/,eo=/[^\d\-+#]/g;function yn(e){return e.search(Ki)}function to(e="#.##"){let t={},n=e.length,r=yn(e);t.prefix=r>0?e.substring(0,r):"";let i=yn(e.split("").reverse().join("")),o=n-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,n):"",t.mask=e.substring(r,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let l=t.mask.match(eo);return t.decimal=l&&l[l.length-1]||".",t.separator=l&&l[1]&&l[0]||",",l=t.mask.split(t.decimal),t.integer=l[0],t.fraction=l[1],t}function ro(e,t,n){let r=!1,i={value:e};e<0&&(r=!0,i.value=-i.value),i.sign=r?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let o=t.fraction&&t.fraction.lastIndexOf("0"),[s="0",a=""]=i.value.split(".");return(!a||a&&a.length<=o)&&(a=o<0?"":(+("0."+a)).toFixed(o+1).replace("0.","")),i.integer=s,i.fraction=a,no(i,t),(i.result==="0"||i.result==="")&&(r=!1,i.sign=""),!r&&t.maskHasPositiveSign?i.sign="+":r&&t.maskHasPositiveSign?i.sign="-":r&&(i.sign=n&&n.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function no(e,t){e.result="";let n=t.integer.split(t.separator),r=n.join(""),i=r&&r.indexOf("0");if(i>-1)for(;e.integer.length<r.length-i;)e.integer="0"+e.integer;else Number(e.integer)===0&&(e.integer="");let o=n[1]&&n[n.length-1].length;if(o){let s=e.integer.length,a=s%o;for(let l=0;l<s;l++)e.result+=e.integer.charAt(l),!((l-a+1)%o)&&l<s-o&&(e.result+=t.separator)}else e.result=e.integer;return e.result+=t.fraction&&e.fraction?t.decimal+e.fraction:"",e}function io(e,t,n={}){if(!e||isNaN(Number(t)))return t;let r=to(e),i=ro(t,r,n);return r.prefix+i.sign+i.result+r.suffix}var _n=io;var Sn=".",oo=",",Tn=/^\s+/,Pn=/\s+$/,vn="&nbsp;",Ue={MONTH:"MONTH",YEAR:"YEAR"},so={[O.ANNUAL]:12,[O.MONTHLY]:1,[O.THREE_YEARS]:36,[O.TWO_YEARS]:24},ao={CHF:e=>Math.round(e*20)/20},sr=(e,t)=>({accept:e,round:t}),co=[sr(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),sr(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.ceil(Math.floor(t*1e4/e)/100)/100),sr(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],ar={[R.YEAR]:{[O.MONTHLY]:Ue.MONTH,[O.ANNUAL]:Ue.YEAR},[R.MONTH]:{[O.MONTHLY]:Ue.MONTH}},lo=(e,t)=>e.indexOf(`'${t}'`)===0,uo=(e,t=!0)=>{let n=e.replace(/'.*?'/,"").trim(),r=An(n);return!!r?t||(n=n.replace(/[,\.]0+/,r)):n=n.replace(/\s?(#.*0)(?!\s)?/,"$&"+po(e)),n},fo=e=>{let t=mo(e),n=lo(e,t),r=e.replace(/'.*?'/,""),i=Tn.test(r)||Pn.test(r);return{currencySymbol:t,isCurrencyFirst:n,hasCurrencySpace:i}},bn=e=>e.replace(Tn,vn).replace(Pn,vn),po=e=>e.match(/#(.?)#/)?.[1]===Sn?oo:Sn,mo=e=>e.match(/'(.*?)'/)?.[1]??"",An=e=>e.match(/0(.?)0/)?.[1]??"";function nt({formatString:e,price:t,usePrecision:n,isIndianPrice:r=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:l}=fo(e),u=n?An(e):"",c=uo(e,n),p=n?2:0,f=o(t,{currencySymbol:s}),h=r?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):_n(c,f),d=n?h.lastIndexOf(u):h.length,_=h.substring(0,d),S=h.substring(d+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,h).replace(/SYMBOL/,s),currencySymbol:s,decimals:S,decimalsDelimiter:u,hasCurrencySpace:l,integer:_,isCurrencyFirst:a,recurrenceTerm:i}}var wn=e=>{let{commitment:t,term:n,usePrecision:r}=e,i=so[n]??1;return nt(e,i>1?Ue.MONTH:ar[t]?.[n],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:r},{round:l}=co.find(({accept:c})=>c(a));if(!l)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(ao[s]??(c=>c))(l(a))})},Ln=({commitment:e,term:t,...n})=>nt(n,ar[e]?.[t]),On=e=>{let{commitment:t,term:n}=e;return t===R.YEAR&&n===O.MONTHLY?nt(e,Ue.YEAR,r=>r*12):nt(e,ar[t]?.[n])};var ho={recurrenceLabel:"{recurrenceTerm, select, MONTH {/mo} YEAR {/yr} other {}}",recurrenceAriaLabel:"{recurrenceTerm, select, MONTH {per month} YEAR {per year} other {}}",perUnitLabel:"{perUnit, select, LICENSE {per license} other {}}",perUnitAriaLabel:"{perUnit, select, LICENSE {per license} other {}}",freeLabel:"Free",freeAriaLabel:"Free",taxExclusiveLabel:"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}",taxInclusiveLabel:"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}",alternativePriceAriaLabel:"Alternatively at {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},Eo=Hr("ConsonantTemplates/price"),go=/<.+?>/g,F={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerAnnual:"price-annual",disabled:"disabled",currencySpace:"price-currency-space",currencySymbol:"price-currency-symbol",decimals:"price-decimals",decimalsDelimiter:"price-decimals-delimiter",integer:"price-integer",recurrence:"price-recurrence",taxInclusivity:"price-tax-inclusivity",unitType:"price-unit-type"},ue={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},xo="TAX_EXCLUSIVE",yo=e=>jr(e)?Object.entries(e).filter(([,t])=>ye(t)||Ye(t)||t===!0).reduce((t,[n,r])=>t+` ${n}${r===!0?"":'="'+Fr(r)+'"'}`,""):"",X=(e,t,n,r=!1)=>`<span class="${e}${t?"":" "+F.disabled}"${yo(n)}>${r?bn(t):t??""}</span>`;function _o(e,{accessibleLabel:t,currencySymbol:n,decimals:r,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:l,perUnitLabel:u,taxInclusivityLabel:c},p={}){let f=X(F.currencySymbol,n),h=X(F.currencySpace,o?"&nbsp;":""),d="";return a&&(d+=f+h),d+=X(F.integer,s),d+=X(F.decimalsDelimiter,i),d+=X(F.decimals,r),a||(d+=h+f),d+=X(F.recurrence,l,null,!0),d+=X(F.unitType,u,null,!0),d+=X(F.taxInclusivity,c,!0),X(e,d,{...p,"aria-label":t})}var fe=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:n=!1}={})=>({country:r,displayFormatted:i=!0,displayRecurrence:o=!0,displayPerUnit:s=!1,displayTax:a=!1,language:l,literals:u={}}={},{commitment:c,formatString:p,price:f,priceWithoutDiscount:h,taxDisplay:d,taxTerm:_,term:S,usePrecision:A}={},w={})=>{Object.entries({country:r,formatString:p,language:l,price:f}).forEach(([Q,Pt])=>{if(Pt==null)throw new Error(`Argument "${Q}" is missing`)});let T={...ho,...u},C=`${l.toLowerCase()}-${r.toUpperCase()}`;function P(Q,Pt){let bt=T[Q];if(bt==null)return"";try{return new xn(bt.replace(go,""),C).format(Pt)}catch{return Eo.error("Failed to format literal:",bt),""}}let L=t&&h?h:f,U=e?wn:Ln;n&&(U=On);let{accessiblePrice:j,recurrenceTerm:Z,...te}=U({commitment:c,formatString:p,term:S,price:e?f:L,usePrecision:A,isIndianPrice:r==="IN"}),H=j,oe="";if(v(o)&&Z){let Q=P(ue.recurrenceAriaLabel,{recurrenceTerm:Z});Q&&(H+=" "+Q),oe=P(ue.recurrenceLabel,{recurrenceTerm:Z})}let se="";if(v(s)){se=P(ue.perUnitLabel,{perUnit:"LICENSE"});let Q=P(ue.perUnitAriaLabel,{perUnit:"LICENSE"});Q&&(H+=" "+Q)}let J="";v(a)&&_&&(J=P(d===xo?ue.taxExclusiveLabel:ue.taxInclusiveLabel,{taxTerm:_}),J&&(H+=" "+J)),t&&(H=P(ue.strikethroughAriaLabel,{strikethroughPrice:H}));let W=F.container;if(e&&(W+=" "+F.containerOptical),t&&(W+=" "+F.containerStrikethrough),n&&(W+=" "+F.containerAnnual),v(i))return _o(W,{...te,accessibleLabel:H,recurrenceLabel:oe,perUnitLabel:se,taxInclusivityLabel:J},w);let{currencySymbol:Ee,decimals:Ve,decimalsDelimiter:je,hasCurrencySpace:we,integer:Tt,isCurrencyFirst:zn}=te,ge=[Tt,je,Ve];zn?(ge.unshift(we?"\xA0":""),ge.unshift(Ee)):(ge.push(we?"\xA0":""),ge.push(Ee)),ge.push(oe,se,J);let Zn=ge.join("");return X(W,Zn,w)},Nn=()=>(e,t,n)=>{let i=(e.displayOldPrice===void 0||v(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${fe()(e,t,n)}${i?"&nbsp;"+fe({displayStrikethrough:!0})(e,t,n):""}`};var cr=fe(),lr=Nn(),ur=fe({displayOptical:!0}),fr=fe({displayStrikethrough:!0}),pr=fe({displayAnnual:!0});var So=(e,t)=>{if(!(!Se(e)||!Se(t)))return Math.floor((t-e)/t*100)},Cn=()=>(e,t,n)=>{let{price:r,priceWithoutDiscount:i}=t,o=So(r,i);return o===void 0?'<span class="no-discount"></span>':`<span class="discount">${o}%</span>`};var mr=Cn();var{freeze:ke}=Object,Y=ke({...ae}),B=ke({...V}),pe={STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"},hr=ke({...R}),dr=ke({...Xr}),Er=ke({...O});var Pr={};Qn(Pr,{CLASS_NAME_FAILED:()=>it,CLASS_NAME_PENDING:()=>ot,CLASS_NAME_RESOLVED:()=>st,ERROR_MESSAGE_BAD_REQUEST:()=>at,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>xr,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>gr,EVENT_TYPE_ERROR:()=>vo,EVENT_TYPE_FAILED:()=>ct,EVENT_TYPE_PENDING:()=>lt,EVENT_TYPE_READY:()=>me,EVENT_TYPE_RESOLVED:()=>ut,LOG_NAMESPACE:()=>yr,Landscape:()=>he,PARAM_AOS_API_KEY:()=>To,PARAM_ENV:()=>_r,PARAM_LANDSCAPE:()=>Sr,PARAM_WCS_API_KEY:()=>Po,STATE_FAILED:()=>$,STATE_PENDING:()=>q,STATE_RESOLVED:()=>z,TAG_NAME_SERVICE:()=>ee,WCS_PROD_URL:()=>vr,WCS_STAGE_URL:()=>Tr});var it="placeholder-failed",ot="placeholder-pending",st="placeholder-resolved",at="Bad WCS request",gr="Commerce offer not found",xr="Literals URL not provided",vo="wcms:commerce:error",ct="wcms:placeholder:failed",lt="wcms:placeholder:pending",me="wcms:commerce:ready",ut="wcms:placeholder:resolved",yr="wcms/commerce",_r="commerce.env",Sr="commerce.landscape",To="commerce.aosKey",Po="commerce.wcsKey",vr="https://www.adobe.com/web_commerce_artifact",Tr="https://www.stage.adobe.com/web_commerce_artifact_stage",$="failed",q="pending",z="resolved",ee="wcms-commerce",he={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"};var br={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Rn=new Set,bo=e=>e instanceof Error||typeof e.originatingRequest=="string";function In(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:n}=e;return n?`${t} ${n}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:r,originatingRequest:i,status:o}=e;return[r,o,i].filter(s=>s).join(" ")}let n=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!br.serializableTypes.includes(n))return n}return e}function Ao(e,t){if(!br.ignoredProperties.includes(e))return In(t)}var Ar={append(e){let{delimiter:t,sampleRate:n,tags:r,clientId:i}=br,{message:o,params:s}=e,a=[],l=o,u=[];s.forEach(f=>{f!=null&&(bo(f)?a:u).push(f)}),a.length&&(l+=" ",l+=a.map(In).join(" "));let{pathname:c,search:p}=window.location;l+=`${t}page=`,l+=c+p,u.length&&(l+=`${t}facts=`,l+=JSON.stringify(u,Ao)),Rn.has(l)||(Rn.add(l),window.lana?.log(l,{sampleRate:n,tags:r,clientId:i}))}};var x=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:Y.V3,checkoutWorkflowStep:B.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,env:pe.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsURL:"https://www.adobe.com/web_commerce_artifact",landscape:he.PUBLISHED,wcsBufferLimit:1});function Mn(e,{once:t=!1}={}){let n=null;function r(){let i=document.querySelector(ee);i!==n&&(n=i,i&&e(i))}return document.addEventListener(me,r,{once:t}),ie(r),()=>document.removeEventListener(me,r)}function Ge(e,{country:t,forceTaxExclusive:n,perpetual:r}){let i;if(e.length<2)i=e;else{let o=t==="GB"||r?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return n&&(i=i.map(Yt)),i}var ie=e=>window.setTimeout(e);function Pe(e,t=1){if(e==null)return[t];let n=(Array.isArray(e)?e:String(e).split(",")).map(Te).filter(Se);return n.length||(n=[t]),n}function ft(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Gt)}function k(){return window.customElements.get(ee)?.instance}var wo="en_US",m={ar:"AR_es",be_en:"BE_en",be_fr:"BE_fr",be_nl:"BE_nl",br:"BR_pt",ca:"CA_en",ch_de:"CH_de",ch_fr:"CH_fr",ch_it:"CH_it",cl:"CL_es",co:"CO_es",la:"DO_es",mx:"MX_es",pe:"PE_es",africa:"MU_en",dk:"DK_da",de:"DE_de",ee:"EE_et",eg_ar:"EG_ar",eg_en:"EG_en",es:"ES_es",fr:"FR_fr",gr_el:"GR_el",gr_en:"GR_en",ie:"IE_en",il_he:"IL_iw",it:"IT_it",lv:"LV_lv",lt:"LT_lt",lu_de:"LU_de",lu_en:"LU_en",lu_fr:"LU_fr",my_en:"MY_en",my_ms:"MY_ms",hu:"HU_hu",mt:"MT_en",mena_en:"DZ_en",mena_ar:"DZ_ar",nl:"NL_nl",no:"NO_nb",pl:"PL_pl",pt:"PT_pt",ro:"RO_ro",si:"SI_sl",sk:"SK_sk",fi:"FI_fi",se:"SE_sv",tr:"TR_tr",uk:"GB_en",at:"AT_de",cz:"CZ_cs",bg:"BG_bg",ru:"RU_ru",ua:"UA_uk",au:"AU_en",in_en:"IN_en",in_hi:"IN_hi",id_en:"ID_en",id_id:"ID_in",nz:"NZ_en",sa_ar:"SA_ar",sa_en:"SA_en",sg:"SG_en",cn:"CN_zh-Hans",tw:"TW_zh-Hant",hk_zh:"HK_zh-hant",jp:"JP_ja",kr:"KR_ko",za:"ZA_en",ng:"NG_en",cr:"CR_es",ec:"EC_es",pr:"US_es",gt:"GT_es",cis_en:"AZ_en",cis_ru:"AZ_ru",sea:"SG_en",th_en:"TH_en",th_th:"TH_th"},pt=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function Dn({locale:e={}}={}){if(!e.prefix)return{country:x.country,language:x.language,locale:wo};let t=e.prefix.replace("/","")??"",[n=x.country,r=x.language]=(m[t]??t).split("_",2);return n=n.toUpperCase(),r=r.toLowerCase(),{country:n,language:r,locale:`${r}_${n}`}}function wr(e={}){let{commerce:t={},locale:n=void 0}=e,r=pe.PRODUCTION,i=vr,o=["local","stage"].includes(e.env?.name),s=N(_r,t,{metadata:!1})?.toLowerCase()==="stage";o&&s&&(r=pe.STAGE,i=Tr);let a=N("checkoutClientId",t)??x.checkoutClientId,l=ne(N("checkoutWorkflow",t),Y,x.checkoutWorkflow),u=B.CHECKOUT;l===Y.V3&&(u=ne(N("checkoutWorkflowStep",t),B,x.checkoutWorkflowStep));let c=v(N("displayOldPrice",t),x.displayOldPrice),p=v(N("displayPerUnit",t),x.displayPerUnit),f=v(N("displayRecurrence",t),x.displayRecurrence),h=v(N("displayTax",t),x.displayTax),d=v(N("entitlement",t),x.entitlement),_=v(N("modal",t),x.modal),S=v(N("forceTaxExclusive",t),x.forceTaxExclusive),A=N("promotionCode",t)??x.promotionCode,w=Pe(N("quantity",t)),T=N("wcsApiKey",t)??x.wcsApiKey,C=e.env?.name===pt.PROD?he.PUBLISHED:ne(N(Sr,t),he,x.landscape),P=Te(N("wcsBufferDelay",t),x.wcsBufferDelay),L=Te(N("wcsBufferLimit",t),x.wcsBufferLimit);return{...Dn({locale:n}),displayOldPrice:c,checkoutClientId:a,checkoutWorkflow:l,checkoutWorkflowStep:u,displayPerUnit:p,displayRecurrence:f,displayTax:h,entitlement:d,extraOptions:x.extraOptions,modal:_,env:r,forceTaxExclusive:S,priceLiteralsURL:t.priceLiteralsURL,priceLiteralsPromise:t.priceLiteralsPromise,promotionCode:A,quantity:w,wcsApiKey:T,wcsBufferDelay:P,wcsBufferLimit:L,wcsURL:i,landscape:C}}var kn="debug",Lo="error",Oo="info",No="warn",Co=Date.now(),Lr=new Set,Or=new Set,Un=new Map,Fe=Object.freeze({DEBUG:kn,ERROR:Lo,INFO:Oo,WARN:No}),Gn={append({level:e,message:t,params:n,timestamp:r,source:i}){console[e](`${r}ms [${i}] %c${t}`,"font-weight: bold;",...n)}},Fn={filter:({level:e})=>e!==kn},Ro={filter:()=>!1};function Io(e,t,n,r,i){return{level:e,message:t,namespace:n,get params(){if(r.length===1){let[o]=r;re(o)&&(r=o(),Array.isArray(r)||(r=[r]))}return r},source:i,timestamp:Date.now()-Co}}function Mo(e){[...Or].every(t=>t(e))&&Lr.forEach(t=>t(e))}function Vn(e){let t=(Un.get(e)??0)+1;Un.set(e,t);let n=`${e} #${t}`,r=o=>(s,...a)=>Mo(Io(o,s,e,a,n)),i=Object.seal({id:n,namespace:e,module(o){return Vn(`${i.namespace}/${o}`)},debug:r(Fe.DEBUG),error:r(Fe.ERROR),info:r(Fe.INFO),warn:r(Fe.WARN)});return i}function mt(...e){e.forEach(t=>{let{append:n,filter:r}=t;re(r)?Or.add(r):re(n)&&Lr.add(n)})}function Do(e={}){let{name:t}=e,n=v(N("commerce.debug",{search:!0,storage:!0}),t===pt.LOCAL);return mt(n?Gn:Fn),t===pt.PROD&&mt(Ar),M}function Uo(){Lr.clear(),Or.clear()}var M={...Vn(yr),Level:Fe,Plugins:{consoleAppender:Gn,debugFilter:Fn,quietFilter:Ro,lanaAppender:Ar},init:Do,reset:Uo,use:mt};var ko={CLASS_NAME_FAILED:it,CLASS_NAME_PENDING:ot,CLASS_NAME_RESOLVED:st,EVENT_TYPE_FAILED:ct,EVENT_TYPE_PENDING:lt,EVENT_TYPE_RESOLVED:ut,STATE_FAILED:$,STATE_PENDING:q,STATE_RESOLVED:z},Go={[$]:it,[q]:ot,[z]:st},Fo={[$]:ct,[q]:lt,[z]:ut},Et=new WeakMap;function G(e){if(!Et.has(e)){let t=M.module(e.constructor.is);Et.set(e,{changes:new Map,connected:!1,dispose:_e,error:void 0,log:t,options:void 0,promises:[],state:q,timer:null,value:void 0,version:0})}return Et.get(e)}function ht(e){let t=G(e),{error:n,promises:r,state:i}=t;(i===z||i===$)&&(t.promises=[],i===z?r.forEach(({resolve:o})=>o(e)):i===$&&r.forEach(({reject:o})=>o(n))),e.dispatchEvent(new CustomEvent(Fo[i],{bubbles:!0}))}function dt(e){let t=Et.get(e);[$,q,z].forEach(n=>{e.classList.toggle(Go[n],n===t.state)})}var Vo={get error(){return G(this).error},get log(){return G(this).log},get options(){return G(this).options},get state(){return G(this).state},get value(){return G(this).value},attributeChangedCallback(e,t,n){G(this).changes.set(e,n),this.requestUpdate()},connectedCallback(){G(this).dispose=Mn(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=G(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=_e},onceSettled(){let{error:e,promises:t,state:n}=G(this);return z===n?Promise.resolve(this):$===n?Promise.reject(e):new Promise((r,i)=>{t.push({resolve:r,reject:i})})},toggleResolved(e,t,n){let r=G(this);return e!==r.version?!1:(n!==void 0&&(r.options=n),r.state=z,r.value=t,dt(this),this.log.debug("Resolved:",{element:this,value:t}),ie(()=>ht(this)),!0)},toggleFailed(e,t,n){let r=G(this);return e!==r.version?!1:(n!==void 0&&(r.options=n),r.error=t,r.state=$,dt(this),r.log.error("Failed:",{element:this,error:t}),ie(()=>ht(this)),!0)},togglePending(e){let t=G(this);return t.version++,e&&(t.options=e),t.state=q,dt(this),ie(()=>ht(this)),t.version},requestUpdate(e=!1){if(!this.isConnected||!k())return;let t=G(this);if(t.timer)return;let{error:n,options:r,state:i,value:o,version:s}=t;t.state=q,t.timer=ie(async()=>{t.timer=null;let a=null;if(t.changes.size&&(a=Object.fromEntries(t.changes.entries()),t.changes.clear()),t.connected?t.log.debug("Updated:",{element:this,changes:a}):(t.connected=!0,t.log.debug("Connected:",{element:this,changes:a})),a||e)try{await this.render?.()===!1&&t.state===q&&t.version===s&&(t.state=i,t.error=n,t.value=o,dt(this),ht(this))}catch(l){this.toggleFailed(t.version,l,r)}})}};function jn(e={}){return Object.entries(e).forEach(([t,n])=>{(n==null||n===""||n?.length===0)&&delete e[t]}),e}function gt(e,t={}){let{tag:n,is:r}=e,i=document.createElement(n,{is:r});return i.setAttribute("is",r),Object.assign(i.dataset,jn(t)),i}function xt(e){let{tag:t,is:n,prototype:r}=e,i=window.customElements.get(n);return i||(Object.defineProperties(r,Object.getOwnPropertyDescriptors(Vo)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(ko)),window.customElements.define(n,i,{extends:t})),i}function yt(e,t=document.body){return Array.from(t?.querySelectorAll(`${e.tag}[is="${e.is}"]`)??[])}function _t(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,jn(t)),e):null}var jo="download",Ho="upgrade",de,be=class be extends HTMLAnchorElement{constructor(){super();Mr(this,de,void 0);this.addEventListener("click",this.clickHandler)}static get observedAttributes(){return["data-checkout-workflow","data-checkout-workflow-step","data-extra-options","data-ims-country","data-perpetual","data-promotion-code","data-quantity","data-template","data-wcs-osi","data-entitlement","data-upgrade","data-modal"]}static createCheckoutLink(n={},r=""){let i=k();if(!i)return null;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:l,upgrade:u,modal:c,perpetual:p,promotionCode:f,quantity:h,wcsOsi:d,extraOptions:_}=i.collectCheckoutOptions(n),S=gt(be,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:l,upgrade:u,modal:c,perpetual:p,promotionCode:f,quantity:h,wcsOsi:d,extraOptions:_});return r&&(S.innerHTML=`<span>${r}</span>`),S}static getCheckoutLinks(n){return yt(be,n)}get isCheckoutLink(){return!0}get placeholder(){return this}clickHandler(n){var r;(r=At(this,de))==null||r.call(this,n)}async render(n={}){if(!this.isConnected)return!1;let r=k();if(!r)return!1;this.dataset.imsCountry||r.imsCountryPromise.then(c=>{c&&(this.dataset.imsCountry=c)},_e);let i=r.collectCheckoutOptions(n,this.placeholder);if(!i.wcsOsi.length)return!1;let o;try{o=JSON.parse(i.extraOptions??"{}")}catch(c){this.placeholder.log.error("cannot parse exta checkout options",c)}let s=this.placeholder.togglePending(i);this.href="";let a=r.resolveOfferSelectors(i),l=await Promise.all(a);l=l.map(c=>Ge(c,i));let u=await r.buildCheckoutAction(l.flat(),{...o,...i});return this.renderOffers(l.flat(),i,{},u,s)}renderOffers(n,r,i={},o=void 0,s=void 0){if(!this.isConnected)return!1;let a=k();if(!a)return!1;if(r={...JSON.parse(this.placeholder.dataset.extraOptions??"null"),...r,...i},s??(s=this.placeholder.togglePending(r)),At(this,de)&&wt(this,de,void 0),o){this.classList.remove(jo,Ho),this.placeholder.toggleResolved(s,n,r);let{url:u,text:c,className:p,handler:f}=o;return u&&(this.href=u),c&&(this.firstElementChild.innerHTML=c),p&&this.classList.add(...p.split(" ")),f&&(this.setAttribute("href","#"),wt(this,de,f.bind(this))),!0}else if(n.length){if(this.placeholder.toggleResolved(s,n,r)){let u=a.buildCheckoutURL(n,r);return this.setAttribute("href",u),!0}}else{let u=new Error(`Not provided: ${r?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(s,u,r))return this.setAttribute("href","#"),!0}return!1}updateOptions(n={}){let r=k();if(!r)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:l,modal:u,perpetual:c,promotionCode:p,quantity:f,wcsOsi:h}=r.collectCheckoutOptions(n);return _t(this,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:l,modal:u,perpetual:c,promotionCode:p,quantity:f,wcsOsi:h}),!0}};de=new WeakMap,K(be,"is","checkout-link"),K(be,"tag","a");var Nr=be,St=xt(Nr);var Hn=[m.uk,m.au,m.fr,m.at,m.be_en,m.be_fr,m.be_nl,m.bg,m.ch_de,m.ch_fr,m.ch_it,m.cz,m.de,m.dk,m.ee,m.eg_ar,m.eg_en,m.es,m.fi,m.fr,m.gr_el,m.gr_en,m.hu,m.ie,m.it,m.lu_de,m.lu_en,m.lu_fr,m.nl,m.no,m.pl,m.pt,m.ro,m.se,m.si,m.sk,m.tr,m.ua,m.id_en,m.id_id,m.in_en,m.in_hi,m.jp,m.my_en,m.my_ms,m.nz,m.th_en,m.th_th],Wo={INDIVIDUAL_COM:[m.za,m.lt,m.lv,m.ng,m.sa_ar,m.sa_en,m.za,m.sg,m.kr],TEAM_COM:[m.za,m.lt,m.lv,m.ng,m.za,m.co,m.kr],INDIVIDUAL_EDU:[m.lt,m.lv,m.sa_en,m.sea],TEAM_EDU:[m.sea,m.kr]},Ae=class Ae extends HTMLSpanElement{static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-perpetual","data-promotion-code","data-tax-exclusive","data-template","data-wcs-osi"]}static createInlinePrice(t){let n=k();if(!n)return null;let{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f}=n.collectPriceOptions(t);return gt(Ae,{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f})}static getInlinePrices(t){return yt(Ae,t)}get isInlinePrice(){return!0}get placeholder(){return this}resolveDisplayTaxForGeoAndSegment(t,n,r,i){let o=`${t}_${n}`;if(Hn.includes(t)||Hn.includes(o))return!0;let s=Wo[`${r}_${i}`];return s?!!(s.includes(t)||s.includes(o)):!1}async resolveDisplayTax(t,n){let[r]=await t.resolveOfferSelectors(n),i=Ge(await r,n);if(i?.length){let{country:o,language:s}=n,a=i[0],[l=""]=a.marketSegments;return this.resolveDisplayTaxForGeoAndSegment(o,s,a.customerSegment,l)}}async render(t={}){if(!this.isConnected)return!1;let n=k();if(!n)return!1;let r=n.collectPriceOptions(t,this.placeholder);if(!r.wcsOsi.length)return!1;let i=this.placeholder.togglePending(r);this.innerHTML="";let[o]=n.resolveOfferSelectors(r);return this.renderOffers(Ge(await o,r),r,i)}renderOffers(t,n={},r=void 0){if(!this.isConnected)return;let i=k();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...n});if(r??(r=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(r,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(r,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let n=k();if(!n)return!1;let{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f}=n.collectPriceOptions(t);return _t(this,{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f}),!0}};K(Ae,"is","inline-price"),K(Ae,"tag","span");var Cr=Ae,vt=xt(Cr);function Wn({providers:e,settings:t},n){let r=M.module("checkout");function i(u,c){let{checkoutClientId:p,checkoutWorkflow:f,checkoutWorkflowStep:h,country:d,language:_,promotionCode:S,quantity:A}=t,{checkoutMarketSegment:w,checkoutWorkflow:T=f,checkoutWorkflowStep:C=h,imsCountry:P,country:L=P??d,language:U=_,quantity:j=A,entitlement:Z,upgrade:te,modal:H,perpetual:oe,promotionCode:se=S,wcsOsi:J,extraOptions:W,...Ee}=Object.assign({},c?.dataset??{},u??{}),Ve=ne(T,Y,x.checkoutWorkflow),je=B.CHECKOUT;Ve===Y.V3&&(je=ne(C,B,x.checkoutWorkflowStep));let we=ve({...Ee,extraOptions:W,checkoutClientId:p,checkoutMarketSegment:w,country:L,quantity:Pe(j,x.quantity),checkoutWorkflow:Ve,checkoutWorkflowStep:je,language:U,entitlement:v(Z),upgrade:v(te),modal:v(H),perpetual:v(oe),promotionCode:Ne(se).effectivePromoCode,wcsOsi:ft(J)});if(c)for(let Tt of e.checkout)Tt(c,we);return we}async function o(u,c){let p=k(),f=await n.getCheckoutAction?.(u,c,p.imsSignedInPromise);return f||null}function s(u,c){if(!Array.isArray(u)||!u.length||!c)return"";let{env:p,landscape:f}=t,{checkoutClientId:h,checkoutMarketSegment:d,checkoutWorkflow:_,checkoutWorkflowStep:S,country:A,promotionCode:w,quantity:T,...C}=i(c),P=window.frameElement?"if":"fp",L={checkoutPromoCode:w,clientId:h,context:P,country:A,env:p,items:[],marketSegment:d,workflowStep:S,landscape:f,...C};if(u.length===1){let[{offerId:U,offerType:j,productArrangementCode:Z}]=u,{marketSegments:[te]}=u[0];Object.assign(L,{marketSegment:te,offerType:j,productArrangementCode:Z}),L.items.push(T[0]===1?{id:U}:{id:U,quantity:T[0]})}else L.items.push(...u.map(({offerId:U},j)=>({id:U,quantity:T[j]??x.quantity})));return Rt(_,L)}let{createCheckoutLink:a,getCheckoutLinks:l}=St;return{CheckoutLink:St,CheckoutWorkflow:Y,CheckoutWorkflowStep:B,buildCheckoutAction:o,buildCheckoutURL:s,collectCheckoutOptions:i,createCheckoutLink:a,getCheckoutLinks:l}}function Xo({interval:e=200,maxAttempts:t=25}={}){let n=M.module("ims");return new Promise(r=>{n.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?r():++i>t?(n.debug("Timeout"),r()):setTimeout(o,e)}o()})}function Yo(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function Bo(e){let t=M.module("ims");return e.then(n=>n?window.adobeIMS.getProfile().then(({countryCode:r})=>(t.debug("Got user country:",r),r),r=>{t.error("Unable to get user country:",r)}):null)}function Xn({}){let e=Xo(),t=Yo(e),n=Bo(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:n}}function $o(e){if(!e.priceLiteralsURL)throw new Error(xr);return new Promise(t=>{window.fetch(e.priceLiteralsURL).then(n=>{n.json().then(({data:r})=>{t(r)})})})}async function Yn(e){let n=await(e.priceLiteralsPromise||$o(e));if(Array.isArray(n)){let r=o=>n.find(s=>Xe(s.lang,o)),i=r(e.language)??r(x.language);if(i)return Object.freeze(i)}return{}}function Bn({literals:e,providers:t,settings:n}){function r(a,l){let{country:u,displayOldPrice:c,displayPerUnit:p,displayRecurrence:f,displayTax:h,forceTaxExclusive:d,language:_,promotionCode:S,quantity:A}=n,{displayOldPrice:w=c,displayPerUnit:T=p,displayRecurrence:C=f,displayTax:P=h,forceTaxExclusive:L=d,country:U=u,language:j=_,perpetual:Z,promotionCode:te=S,quantity:H=A,template:oe,wcsOsi:se,...J}=Object.assign({},l?.dataset??{},a??{}),W=ve({...J,country:U,displayOldPrice:v(w),displayPerUnit:v(T),displayRecurrence:v(C),displayTax:v(P),forceTaxExclusive:v(L),language:j,perpetual:v(Z),promotionCode:Ne(te).effectivePromoCode,quantity:Pe(H,x.quantity),template:oe,wcsOsi:ft(se)});if(l)for(let Ee of t.price)Ee(l,W);return W}function i(a,l){if(!Array.isArray(a)||!a.length||!l)return"";let{template:u}=l,c;switch(u){case"discount":c=mr;break;case"strikethrough":c=fr;break;case"optical":c=ur;break;case"annual":c=pr;break;default:c=l.promotionCode?lr:cr}let p=r(l);p.literals=Object.assign({},e.price,ve(l.literals??{}));let[f]=a;return f={...f,...f.priceDetails},c(p,f)}let{createInlinePrice:o,getInlinePrices:s}=vt;return{InlinePrice:vt,buildPriceHTML:i,collectPriceOptions:r,createInlinePrice:o,getInlinePrices:s}}function $n({settings:e}){let t=M.module("wcs"),{env:n,wcsApiKey:r}=e,i=new Map,o=new Map,s;async function a(c,p,f=!0){let h=gr;t.debug("Fetching:",c);try{c.offerSelectorIds=c.offerSelectorIds.sort();let d=new URL(e.wcsURL);d.searchParams.set("offer_selector_ids",c.offerSelectorIds.join(",")),d.searchParams.set("country",c.country),d.searchParams.set("locale",c.locale),d.searchParams.set("landscape",n===pe.STAGE?"ALL":e.landscape),d.searchParams.set("api_key",r),c.language&&d.searchParams.set("language",c.language),c.promotionCode&&d.searchParams.set("promotion_code",c.promotionCode),c.currency&&d.searchParams.set("currency",c.currency);let _=await fetch(d.toString(),{credentials:"omit"});if(_.ok){let S=await _.json();t.debug("Fetched:",c,S);let A=S.resolvedOffers??[];A=A.map($e),p.forEach(({resolve:w},T)=>{let C=A.filter(({offerSelectorIds:P})=>P.includes(T)).flat();C.length&&(p.delete(T),w(C))})}else _.status===404&&c.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(c.offerSelectorIds.map(S=>a({...c,offerSelectorIds:[S]},p,!1)))):(h=at,t.error(h,c))}catch(d){h=at,t.error(h,c,d)}f&&p.size&&(t.debug("Missing:",{offerSelectorIds:[...p.keys()]}),p.forEach(d=>{d.reject(new Error(h))}))}function l(){clearTimeout(s);let c=[...o.values()];o.clear(),c.forEach(({options:p,promises:f})=>a(p,f))}function u({country:c,language:p,perpetual:f=!1,promotionCode:h="",wcsOsi:d=[]}){let _=`${p}_${c}`;c!=="GB"&&(p=f?"EN":"MULT");let S=[c,p,h].filter(A=>A).join("-").toLowerCase();return d.map(A=>{let w=`${A}-${S}`;if(!i.has(w)){let T=new Promise((C,P)=>{let L=o.get(S);if(!L){let U={country:c,locale:_,offerSelectorIds:[]};c!=="GB"&&(U.language=p),L={options:U,promises:new Map},o.set(S,L)}h&&(L.options.promotionCode=h),L.options.offerSelectorIds.push(A),L.promises.set(A,{resolve:C,reject:P}),L.options.offerSelectorIds.length>=e.wcsBufferLimit?l():(t.debug("Queued:",L.options),s||(s=setTimeout(l,e.wcsBufferDelay)))});i.set(w,T)}return i.get(w)})}return{WcsCommitment:hr,WcsPlanType:dr,WcsTerm:Er,resolveOfferSelectors:u}}var D=class extends HTMLElement{get isWcmsCommerce(){return!0}};K(D,"instance"),K(D,"promise",null);window.customElements.define(ee,D);async function qo(e,t){let n=M.init(e.env).module("service");n.debug("Activating:",e);let r={price:{}},i=Object.freeze(wr(e));try{r.price=await Yn(i)}catch(l){n.warn("Price literals were not fetched:",l)}let o={checkout:new Set,price:new Set},s=document.createElement(ee),a={literals:r,providers:o,settings:i};return D.instance=Object.defineProperties(s,Object.getOwnPropertyDescriptors({...Wn(a,t),...Xn(a),...Bn(a),...$n(a),...Pr,Log:M,get defaults(){return x},get literals(){return r},get log(){return M},get providers(){return{checkout(l){return o.checkout.add(l),()=>o.checkout.delete(l)},price(l){return o.price.add(l),()=>o.price.delete(l)}}},get settings(){return i}})),n.debug("Activated:",{literals:r,settings:i,element:s}),document.head.append(s),ie(()=>{let l=new CustomEvent(me,{bubbles:!0,cancelable:!1,detail:D.instance});D.instance.dispatchEvent(l)}),D.instance}function qn(){document.head.querySelector(ee)?.remove(),D.promise=null,M.reset()}function zo(e,t){if(re(e)){let n=re(t)?t():{};return n.force&&qn(),D.promise??(D.promise=qo(e(),n))}return D.promise?D.promise:new Promise(n=>{let r=i=>{n(i.detail)};document.head.addEventListener(me,r,{once:!0})})}export{St as CheckoutLink,Y as CheckoutWorkflow,B as CheckoutWorkflowStep,x as Defaults,vt as InlinePrice,he as Landscape,M as Log,ee as TAG_NAME_SERVICE,hr as WcsCommitment,dr as WcsPlanType,Er as WcsTerm,$e as applyPlanType,Dn as getLocaleSettings,wr as getSettings,zo as init,qn as reset};
`,ce.MISSING_INTL_API,o);var O=n.getPluralRules(t,{type:l.pluralType}).select(f-(l.offset||0));L=l.options[O]||l.options.other}if(!L)throw new ar(l.value,f,Object.keys(l.options),o);s.push.apply(s,Re(L.value,t,n,r,i,f-(l.offset||0)));continue}}return ra(s)}function ia(e,t){return t?E(E(E({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=E(E({},e[r]),t[r]||{}),n},{})):e}function aa(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=ia(e[r],t[r]),n},E({},e)):e}function or(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function oa(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:we(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,$e([void 0],n)))},{cache:or(e.number),strategy:nt.variadic}),getDateTimeFormat:we(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,$e([void 0],n)))},{cache:or(e.dateTime),strategy:nt.variadic}),getPluralRules:we(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,$e([void 0],n)))},{cache:or(e.pluralRules),strategy:nt.variadic})}}var An=function(){function e(t,n,r,i){var a=this;if(n===void 0&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(o){var s=a.formatToParts(o);if(s.length===1)return s[0].value;var c=s.reduce(function(u,l){return!u.length||l.type!==w.literal||typeof u[u.length-1]!="string"?u.push(l.value):u[u.length-1]+=l.value,u},[]);return c.length<=1?c[0]||"":c},this.formatToParts=function(o){return Re(a.ast,a.locales,a.formatters,a.formats,o,void 0,a.message)},this.resolvedOptions=function(){return{locale:Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:i?.ignoreTag})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=aa(e.formats,r),this.locales=n,this.formatters=i&&i.formatters||oa(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.__parse=fn,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();var dn=An;var sa=/[0-9\-+#]/,la=/[^\d\-+#]/g;function Sn(e){return e.search(sa)}function ca(e="#.##"){let t={},n=e.length,r=Sn(e);t.prefix=r>0?e.substring(0,r):"";let i=Sn(e.split("").reverse().join("")),a=n-i,o=e.substring(a,a+1),s=a+(o==="."||o===","?1:0);t.suffix=i>0?e.substring(s,n):"",t.mask=e.substring(r,s),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(la);return t.decimal=c&&c[c.length-1]||".",t.separator=c&&c[1]&&c[0]||",",c=t.mask.split(t.decimal),t.integer=c[0],t.fraction=c[1],t}function ua(e,t,n){let r=!1,i={value:e};e<0&&(r=!0,i.value=-i.value),i.sign=r?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let a=t.fraction&&t.fraction.lastIndexOf("0"),[o="0",s=""]=i.value.split(".");return(!s||s&&s.length<=a)&&(s=a<0?"":(+("0."+s)).toFixed(a+1).replace("0.","")),i.integer=o,i.fraction=s,fa(i,t),(i.result==="0"||i.result==="")&&(r=!1,i.sign=""),!r&&t.maskHasPositiveSign?i.sign="+":r&&t.maskHasPositiveSign?i.sign="-":r&&(i.sign=n&&n.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function fa(e,t){e.result="";let n=t.integer.split(t.separator),r=n.join(""),i=r&&r.indexOf("0");if(i>-1)for(;e.integer.length<r.length-i;)e.integer="0"+e.integer;else Number(e.integer)===0&&(e.integer="");let a=n[1]&&n[n.length-1].length;if(a){let o=e.integer.length,s=o%a;for(let c=0;c<o;c++)e.result+=e.integer.charAt(c),!((c-s+1)%a)&&c<o-a&&(e.result+=t.separator)}else e.result=e.integer;return e.result+=t.fraction&&e.fraction?t.decimal+e.fraction:"",e}function pa(e,t,n={}){if(!e||isNaN(Number(t)))return t;let r=ca(e),i=ua(t,r,n);return r.prefix+i.sign+i.result+r.suffix}var En=pa;var xn=".",ha=",",gn=/^\s+/,Ln=/\s+$/,bn="&nbsp;",De={MONTH:"MONTH",YEAR:"YEAR"},ma={[N.ANNUAL]:12,[N.MONTHLY]:1,[N.THREE_YEARS]:36,[N.TWO_YEARS]:24},Ta={CHF:e=>Math.round(e*20)/20},sr=(e,t)=>({accept:e,round:t}),Aa=[sr(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),sr(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.ceil(Math.floor(t*1e4/e)/100)/100),sr(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],lr={[C.YEAR]:{[N.MONTHLY]:De.MONTH,[N.ANNUAL]:De.YEAR},[C.MONTH]:{[N.MONTHLY]:De.MONTH}},da=(e,t)=>e.indexOf(`'${t}'`)===0,Sa=(e,t=!0)=>{let n=e.replace(/'.*?'/,"").trim(),r=yn(n);return!!r?t||(n=n.replace(/[,\.]0+/,r)):n=n.replace(/\s?(#.*0)(?!\s)?/,"$&"+xa(e)),n},Ea=e=>{let t=ba(e),n=da(e,t),r=e.replace(/'.*?'/,""),i=gn.test(r)||Ln.test(r);return{currencySymbol:t,isCurrencyFirst:n,hasCurrencySpace:i}},vn=e=>e.replace(gn,bn).replace(Ln,bn),xa=e=>e.match(/#(.?)#/)?.[1]===xn?ha:xn,ba=e=>e.match(/'(.*?)'/)?.[1]??"",yn=e=>e.match(/0(.?)0/)?.[1]??"";function it({formatString:e,price:t,usePrecision:n,isIndianPrice:r=!1},i,a=o=>o){let{currencySymbol:o,isCurrencyFirst:s,hasCurrencySpace:c}=Ea(e),u=n?yn(e):"",l=Sa(e,n),p=n?2:0,f=a(t,{currencySymbol:o}),m=r?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):En(l,f),T=n?m.lastIndexOf(u):m.length,x=m.substring(0,T),b=m.substring(T+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,m).replace(/SYMBOL/,o),currencySymbol:o,decimals:b,decimalsDelimiter:u,hasCurrencySpace:c,integer:x,isCurrencyFirst:s,recurrenceTerm:i}}var Pn=e=>{let{commitment:t,term:n,usePrecision:r}=e,i=ma[n]??1;return it(e,i>1?De.MONTH:lr[t]?.[n],(a,{currencySymbol:o})=>{let s={divisor:i,price:a,usePrecision:r},{round:c}=Aa.find(({accept:l})=>l(s));if(!c)throw new Error(`Missing rounding rule for: ${JSON.stringify(s)}`);return(Ta[o]??(l=>l))(c(s))})},_n=({commitment:e,term:t,...n})=>it(n,lr[e]?.[t]),In=e=>{let{commitment:t,term:n}=e;return t===C.YEAR&&n===N.MONTHLY?it(e,De.YEAR,r=>r*12):it(e,lr[t]?.[n])};var ga={recurrenceLabel:"{recurrenceTerm, select, MONTH {/mo} YEAR {/yr} other {}}",recurrenceAriaLabel:"{recurrenceTerm, select, MONTH {per month} YEAR {per year} other {}}",perUnitLabel:"{perUnit, select, LICENSE {per license} other {}}",perUnitAriaLabel:"{perUnit, select, LICENSE {per license} other {}}",freeLabel:"Free",freeAriaLabel:"Free",taxExclusiveLabel:"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}",taxInclusiveLabel:"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}",alternativePriceAriaLabel:"Alternatively at {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},La=Fr("ConsonantTemplates/price"),va=/<.+?>/g,G={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerAnnual:"price-annual",disabled:"disabled",currencySpace:"price-currency-space",currencySymbol:"price-currency-symbol",decimals:"price-decimals",decimalsDelimiter:"price-decimals-delimiter",integer:"price-integer",recurrence:"price-recurrence",taxInclusivity:"price-tax-inclusivity",unitType:"price-unit-type"},ue={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},ya="TAX_EXCLUSIVE",Pa=e=>Hr(e)?Object.entries(e).filter(([,t])=>Ee(t)||je(t)||t===!0).reduce((t,[n,r])=>t+` ${n}${r===!0?"":'="'+Mr(r)+'"'}`,""):"",K=(e,t,n,r=!1)=>`<span class="${e}${t?"":" "+G.disabled}"${Pa(n)}>${r?vn(t):t??""}</span>`;function _a(e,{accessibleLabel:t,currencySymbol:n,decimals:r,decimalsDelimiter:i,hasCurrencySpace:a,integer:o,isCurrencyFirst:s,recurrenceLabel:c,perUnitLabel:u,taxInclusivityLabel:l},p={}){let f=K(G.currencySymbol,n),m=K(G.currencySpace,a?"&nbsp;":""),T="";return s&&(T+=f+m),T+=K(G.integer,o),T+=K(G.decimalsDelimiter,i),T+=K(G.decimals,r),s||(T+=m+f),T+=K(G.recurrence,c,null,!0),T+=K(G.unitType,u,null,!0),T+=K(G.taxInclusivity,l,!0),K(e,T,{...p,"aria-label":t})}var fe=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:n=!1}={})=>({country:r,displayFormatted:i=!0,displayRecurrence:a=!0,displayPerUnit:o=!1,displayTax:s=!1,language:c,literals:u={}}={},{commitment:l,formatString:p,price:f,priceWithoutDiscount:m,taxDisplay:T,taxTerm:x,term:b,usePrecision:P}={},_={})=>{Object.entries({country:r,formatString:p,language:c,price:f}).forEach(([J,yt])=>{if(yt==null)throw new Error(`Argument "${J}" is missing`)});let L={...ga,...u},O=`${c.toLowerCase()}-${r.toUpperCase()}`;function v(J,yt){let Pt=L[J];if(Pt==null)return"";try{return new dn(Pt.replace(va,""),O).format(yt)}catch{return La.error("Failed to format literal:",Pt),""}}let I=t&&m?m:f,D=e?Pn:_n;n&&(D=In);let{accessiblePrice:F,recurrenceTerm:q,...te}=D({commitment:l,formatString:p,term:b,price:e?f:I,usePrecision:P,isIndianPrice:r==="IN"}),X=F,ae="";if(g(a)&&q){let J=v(ue.recurrenceAriaLabel,{recurrenceTerm:q});J&&(X+=" "+J),ae=v(ue.recurrenceLabel,{recurrenceTerm:q})}let oe="";if(g(o)){oe=v(ue.perUnitLabel,{perUnit:"LICENSE"});let J=v(ue.perUnitAriaLabel,{perUnit:"LICENSE"});J&&(X+=" "+J)}let Z="";g(s)&&x&&(Z=v(T===ya?ue.taxExclusiveLabel:ue.taxInclusiveLabel,{taxTerm:x}),Z&&(X+=" "+Z)),t&&(X=v(ue.strikethroughAriaLabel,{strikethroughPrice:X}));let Y=G.container;if(e&&(Y+=" "+G.containerOptical),t&&(Y+=" "+G.containerStrikethrough),n&&(Y+=" "+G.containerAnnual),g(i))return _a(Y,{...te,accessibleLabel:X,recurrenceLabel:ae,perUnitLabel:oe,taxInclusivityLabel:Z},_);let{currencySymbol:Ae,decimals:He,decimalsDelimiter:Fe,hasCurrencySpace:_e,integer:vt,isCurrencyFirst:$n}=te,de=[vt,Fe,He];$n?(de.unshift(_e?"\xA0":""),de.unshift(Ae)):(de.push(_e?"\xA0":""),de.push(Ae)),de.push(ae,oe,Z);let qn=de.join("");return K(Y,qn,_)},Nn=()=>(e,t,n)=>{let i=(e.displayOldPrice===void 0||g(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${fe()(e,t,n)}${i?"&nbsp;"+fe({displayStrikethrough:!0})(e,t,n):""}`};var cr=fe(),ur=Nn(),fr=fe({displayOptical:!0}),pr=fe({displayStrikethrough:!0}),hr=fe({displayAnnual:!0});var Ia=(e,t)=>{if(!(!be(e)||!be(t)))return Math.floor((t-e)/t*100)},Vn=()=>(e,t,n)=>{let{price:r,priceWithoutDiscount:i}=t,a=Ia(r,i);return a===void 0?'<span class="no-discount"></span>':`<span class="discount">${a}%</span>`};var mr=Vn();var{freeze:Ue}=Object,z=Ue({...se}),j=Ue({...H}),pe={STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"},Tr=Ue({...C}),Ar=Ue({...Yr}),dr=Ue({...N});var vr={};ii(vr,{CLASS_NAME_FAILED:()=>at,CLASS_NAME_PENDING:()=>ot,CLASS_NAME_RESOLVED:()=>st,ERROR_MESSAGE_BAD_REQUEST:()=>lt,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>Na,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>Sr,EVENT_TYPE_ERROR:()=>Va,EVENT_TYPE_FAILED:()=>ct,EVENT_TYPE_PENDING:()=>ut,EVENT_TYPE_READY:()=>he,EVENT_TYPE_RESOLVED:()=>ft,LOG_NAMESPACE:()=>Er,Landscape:()=>me,PARAM_AOS_API_KEY:()=>Oa,PARAM_ENV:()=>xr,PARAM_LANDSCAPE:()=>br,PARAM_WCS_API_KEY:()=>Ca,STATE_FAILED:()=>W,STATE_PENDING:()=>B,STATE_RESOLVED:()=>$,TAG_NAME_SERVICE:()=>ee,WCS_PROD_URL:()=>gr,WCS_STAGE_URL:()=>Lr});var at="placeholder-failed",ot="placeholder-pending",st="placeholder-resolved",lt="Bad WCS request",Sr="Commerce offer not found",Na="Literals URL not provided",Va="wcms:commerce:error",ct="wcms:placeholder:failed",ut="wcms:placeholder:pending",he="wcms:commerce:ready",ft="wcms:placeholder:resolved",Er="wcms/commerce",xr="commerce.env",br="commerce.landscape",Oa="commerce.aosKey",Ca="commerce.wcsKey",gr="https://www.adobe.com/web_commerce_artifact",Lr="https://www.stage.adobe.com/web_commerce_artifact_stage",W="failed",B="pending",$="resolved",ee="wcms-commerce",me={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"};var yr={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},On=new Set,wa=e=>e instanceof Error||typeof e.originatingRequest=="string";function Cn(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:n}=e;return n?`${t} ${n}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:r,originatingRequest:i,status:a}=e;return[r,a,i].filter(o=>o).join(" ")}let n=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!yr.serializableTypes.includes(n))return n}return e}function ka(e,t){if(!yr.ignoredProperties.includes(e))return Cn(t)}var Pr={append(e){let{delimiter:t,sampleRate:n,tags:r,clientId:i}=yr,{message:a,params:o}=e,s=[],c=a,u=[];o.forEach(f=>{f!=null&&(wa(f)?s:u).push(f)}),s.length&&(c+=" ",c+=s.map(Cn).join(" "));let{pathname:l,search:p}=window.location;c+=`${t}page=`,c+=l+p,u.length&&(c+=`${t}facts=`,c+=JSON.stringify(u,ka)),On.has(c)||(On.add(c),window.lana?.log(c,{sampleRate:n,tags:r,clientId:i}))}};var S=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:z.V3,checkoutWorkflowStep:j.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,env:pe.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsURL:"https://www.adobe.com/web_commerce_artifact",landscape:me.PUBLISHED,wcsBufferLimit:1});function wn(e,{once:t=!1}={}){let n=null;function r(){let i=document.querySelector(ee);i!==n&&(n=i,i&&e(i))}return document.addEventListener(he,r,{once:t}),ie(r),()=>document.removeEventListener(he,r)}function Me(e,{country:t,forceTaxExclusive:n,perpetual:r}){let i;if(e.length<2)i=e;else{let a=t==="GB"||r?"EN":"MULT",[o,s]=e;i=[o.language===a?o:s]}return n&&(i=i.map(jt)),i}var ie=e=>window.setTimeout(e);function ve(e,t=1){if(e==null)return[t];let n=(Array.isArray(e)?e:String(e).split(",")).map(Le).filter(be);return n.length||(n=[t]),n}function pt(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Gt)}function U(){return window.customElements.get(ee)?.instance}var Ra="en_US",h={ar:"AR_es",be_en:"BE_en",be_fr:"BE_fr",be_nl:"BE_nl",br:"BR_pt",ca:"CA_en",ch_de:"CH_de",ch_fr:"CH_fr",ch_it:"CH_it",cl:"CL_es",co:"CO_es",la:"DO_es",mx:"MX_es",pe:"PE_es",africa:"MU_en",dk:"DK_da",de:"DE_de",ee:"EE_et",eg_ar:"EG_ar",eg_en:"EG_en",es:"ES_es",fr:"FR_fr",gr_el:"GR_el",gr_en:"GR_en",ie:"IE_en",il_he:"IL_iw",it:"IT_it",lv:"LV_lv",lt:"LT_lt",lu_de:"LU_de",lu_en:"LU_en",lu_fr:"LU_fr",my_en:"MY_en",my_ms:"MY_ms",hu:"HU_hu",mt:"MT_en",mena_en:"DZ_en",mena_ar:"DZ_ar",nl:"NL_nl",no:"NO_nb",pl:"PL_pl",pt:"PT_pt",ro:"RO_ro",si:"SI_sl",sk:"SK_sk",fi:"FI_fi",se:"SE_sv",tr:"TR_tr",uk:"GB_en",at:"AT_de",cz:"CZ_cs",bg:"BG_bg",ru:"RU_ru",ua:"UA_uk",au:"AU_en",in_en:"IN_en",in_hi:"IN_hi",id_en:"ID_en",id_id:"ID_in",nz:"NZ_en",sa_ar:"SA_ar",sa_en:"SA_en",sg:"SG_en",cn:"CN_zh-Hans",tw:"TW_zh-Hant",hk_zh:"HK_zh-hant",jp:"JP_ja",kr:"KR_ko",za:"ZA_en",ng:"NG_en",cr:"CR_es",ec:"EC_es",pr:"US_es",gt:"GT_es",cis_en:"AZ_en",cis_ru:"AZ_ru",sea:"SG_en",th_en:"TH_en",th_th:"TH_th"},ht=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function kn({locale:e={}}={}){if(!e.prefix)return{country:S.country,language:S.language,locale:Ra};let t=e.prefix.replace("/","")??"",[n=S.country,r=S.language]=(h[t]??t).split("_",2);return n=n.toUpperCase(),r=r.toLowerCase(),{country:n,language:r,locale:`${r}_${n}`}}function _r(e={}){let{commerce:t={},locale:n=void 0}=e,r=pe.PRODUCTION,i=gr,a=["local","stage"].includes(e.env?.name),o=V(xr,t,{metadata:!1})?.toLowerCase()==="stage";a&&o&&(r=pe.STAGE,i=Lr);let s=V("checkoutClientId",t)??S.checkoutClientId,c=ne(V("checkoutWorkflow",t),z,S.checkoutWorkflow),u=j.CHECKOUT;c===z.V3&&(u=ne(V("checkoutWorkflowStep",t),j,S.checkoutWorkflowStep));let l=g(V("displayOldPrice",t),S.displayOldPrice),p=g(V("displayPerUnit",t),S.displayPerUnit),f=g(V("displayRecurrence",t),S.displayRecurrence),m=g(V("displayTax",t),S.displayTax),T=g(V("entitlement",t),S.entitlement),x=g(V("modal",t),S.modal),b=g(V("forceTaxExclusive",t),S.forceTaxExclusive),P=V("promotionCode",t)??S.promotionCode,_=ve(V("quantity",t)),L=V("wcsApiKey",t)??S.wcsApiKey,O=e.env?.name===ht.PROD?me.PUBLISHED:ne(V(br,t),me,S.landscape),v=Le(V("wcsBufferDelay",t),S.wcsBufferDelay),I=Le(V("wcsBufferLimit",t),S.wcsBufferLimit);return{...kn({locale:n}),displayOldPrice:l,checkoutClientId:s,checkoutWorkflow:c,checkoutWorkflowStep:u,displayPerUnit:p,displayRecurrence:f,displayTax:m,entitlement:T,extraOptions:S.extraOptions,modal:x,env:r,forceTaxExclusive:b,promotionCode:P,quantity:_,wcsApiKey:L,wcsBufferDelay:v,wcsBufferLimit:I,wcsURL:i,landscape:O}}var Dn="debug",Da="error",Ua="info",Ma="warn",Ga=Date.now(),Ir=new Set,Nr=new Set,Rn=new Map,Ge=Object.freeze({DEBUG:Dn,ERROR:Da,INFO:Ua,WARN:Ma}),Un={append({level:e,message:t,params:n,timestamp:r,source:i}){console[e](`${r}ms [${i}] %c${t}`,"font-weight: bold;",...n)}},Mn={filter:({level:e})=>e!==Dn},Ha={filter:()=>!1};function Fa(e,t,n,r,i){return{level:e,message:t,namespace:n,get params(){if(r.length===1){let[a]=r;re(a)&&(r=a(),Array.isArray(r)||(r=[r]))}return r},source:i,timestamp:Date.now()-Ga}}function Xa(e){[...Nr].every(t=>t(e))&&Ir.forEach(t=>t(e))}function Gn(e){let t=(Rn.get(e)??0)+1;Rn.set(e,t);let n=`${e} #${t}`,r=a=>(o,...s)=>Xa(Fa(a,o,e,s,n)),i=Object.seal({id:n,namespace:e,module(a){return Gn(`${i.namespace}/${a}`)},debug:r(Ge.DEBUG),error:r(Ge.ERROR),info:r(Ge.INFO),warn:r(Ge.WARN)});return i}function mt(...e){e.forEach(t=>{let{append:n,filter:r}=t;re(r)?Nr.add(r):re(n)&&Ir.add(n)})}function Ya(e={}){let{name:t}=e,n=g(V("commerce.debug",{search:!0,storage:!0}),t===ht.LOCAL);return mt(n?Un:Mn),t===ht.PROD&&mt(Pr),k}function Ka(){Ir.clear(),Nr.clear()}var k={...Gn(Er),Level:Ge,Plugins:{consoleAppender:Un,debugFilter:Mn,quietFilter:Ha,lanaAppender:Pr},init:Ya,reset:Ka,use:mt};var za={CLASS_NAME_FAILED:at,CLASS_NAME_PENDING:ot,CLASS_NAME_RESOLVED:st,EVENT_TYPE_FAILED:ct,EVENT_TYPE_PENDING:ut,EVENT_TYPE_RESOLVED:ft,STATE_FAILED:W,STATE_PENDING:B,STATE_RESOLVED:$},ja={[W]:at,[B]:ot,[$]:st},Wa={[W]:ct,[B]:ut,[$]:ft},dt=new WeakMap;function M(e){if(!dt.has(e)){let t=k.module(e.constructor.is);dt.set(e,{changes:new Map,connected:!1,dispose:xe,error:void 0,log:t,options:void 0,promises:[],state:B,timer:null,value:void 0,version:0})}return dt.get(e)}function Tt(e){let t=M(e),{error:n,promises:r,state:i}=t;(i===$||i===W)&&(t.promises=[],i===$?r.forEach(({resolve:a})=>a(e)):i===W&&r.forEach(({reject:a})=>a(n))),e.dispatchEvent(new CustomEvent(Wa[i],{bubbles:!0}))}function At(e){let t=dt.get(e);[W,B,$].forEach(n=>{e.classList.toggle(ja[n],n===t.state)})}var Ba={get error(){return M(this).error},get log(){return M(this).log},get options(){return M(this).options},get state(){return M(this).state},get value(){return M(this).value},attributeChangedCallback(e,t,n){M(this).changes.set(e,n),this.requestUpdate()},connectedCallback(){M(this).dispose=wn(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=M(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=xe},onceSettled(){let{error:e,promises:t,state:n}=M(this);return $===n?Promise.resolve(this):W===n?Promise.reject(e):new Promise((r,i)=>{t.push({resolve:r,reject:i})})},toggleResolved(e,t,n){let r=M(this);return e!==r.version?!1:(n!==void 0&&(r.options=n),r.state=$,r.value=t,At(this),this.log.debug("Resolved:",{element:this,value:t}),ie(()=>Tt(this)),!0)},toggleFailed(e,t,n){let r=M(this);return e!==r.version?!1:(n!==void 0&&(r.options=n),r.error=t,r.state=W,At(this),r.log.error("Failed:",{element:this,error:t}),ie(()=>Tt(this)),!0)},togglePending(e){let t=M(this);return t.version++,e&&(t.options=e),t.state=B,At(this),ie(()=>Tt(this)),t.version},requestUpdate(e=!1){if(!this.isConnected||!U())return;let t=M(this);if(t.timer)return;let{error:n,options:r,state:i,value:a,version:o}=t;t.state=B,t.timer=ie(async()=>{t.timer=null;let s=null;if(t.changes.size&&(s=Object.fromEntries(t.changes.entries()),t.changes.clear()),t.connected?t.log.debug("Updated:",{element:this,changes:s}):(t.connected=!0,t.log.debug("Connected:",{element:this,changes:s})),s||e)try{await this.render?.()===!1&&t.state===B&&t.version===o&&(t.state=i,t.error=n,t.value=a,At(this),Tt(this))}catch(c){this.toggleFailed(t.version,c,r)}})}};function Hn(e={}){return Object.entries(e).forEach(([t,n])=>{(n==null||n===""||n?.length===0)&&delete e[t]}),e}function St(e,t={}){let{tag:n,is:r}=e,i=document.createElement(n,{is:r});return i.setAttribute("is",r),Object.assign(i.dataset,Hn(t)),i}function Et(e){let{tag:t,is:n,prototype:r}=e,i=window.customElements.get(n);return i||(Object.defineProperties(r,Object.getOwnPropertyDescriptors(Ba)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(za)),window.customElements.define(n,i,{extends:t})),i}function xt(e,t=document.body){return Array.from(t?.querySelectorAll(`${e.tag}[is="${e.is}"]`)??[])}function bt(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,Hn(t)),e):null}var $a="download",qa="upgrade",Te,ye=class ye extends HTMLAnchorElement{constructor(){super();wr(this,Te,void 0);this.addEventListener("click",this.clickHandler)}static get observedAttributes(){return["data-checkout-workflow","data-checkout-workflow-step","data-extra-options","data-ims-country","data-perpetual","data-promotion-code","data-quantity","data-template","data-wcs-osi","data-entitlement","data-upgrade","data-modal"]}static createCheckoutLink(n={},r=""){let i=U();if(!i)return null;let{checkoutMarketSegment:a,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:c,upgrade:u,modal:l,perpetual:p,promotionCode:f,quantity:m,wcsOsi:T,extraOptions:x}=i.collectCheckoutOptions(n),b=St(ye,{checkoutMarketSegment:a,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:c,upgrade:u,modal:l,perpetual:p,promotionCode:f,quantity:m,wcsOsi:T,extraOptions:x});return r&&(b.innerHTML=`<span>${r}</span>`),b}static getCheckoutLinks(n){return xt(ye,n)}get isCheckoutLink(){return!0}get placeholder(){return this}clickHandler(n){var r;(r=_t(this,Te))==null||r.call(this,n)}async render(n={}){if(!this.isConnected)return!1;let r=U();if(!r)return!1;this.dataset.imsCountry||r.imsCountryPromise.then(l=>{l&&(this.dataset.imsCountry=l)},xe);let i=r.collectCheckoutOptions(n,this.placeholder);if(!i.wcsOsi.length)return!1;let a;try{a=JSON.parse(i.extraOptions??"{}")}catch(l){this.placeholder.log.error("cannot parse exta checkout options",l)}let o=this.placeholder.togglePending(i);this.href="";let s=r.resolveOfferSelectors(i),c=await Promise.all(s);c=c.map(l=>Me(l,i));let u=await r.buildCheckoutAction(c.flat(),{...a,...i});return this.renderOffers(c.flat(),i,{},u,o)}renderOffers(n,r,i={},a=void 0,o=void 0){if(!this.isConnected)return!1;let s=U();if(!s)return!1;if(r={...JSON.parse(this.placeholder.dataset.extraOptions??"null"),...r,...i},o??(o=this.placeholder.togglePending(r)),_t(this,Te)&&It(this,Te,void 0),a){this.classList.remove($a,qa),this.placeholder.toggleResolved(o,n,r);let{url:u,text:l,className:p,handler:f}=a;return u&&(this.href=u),l&&(this.firstElementChild.innerHTML=l),p&&this.classList.add(...p.split(" ")),f&&(this.setAttribute("href","#"),It(this,Te,f.bind(this))),!0}else if(n.length){if(this.placeholder.toggleResolved(o,n,r)){let u=s.buildCheckoutURL(n,r);return this.setAttribute("href",u),!0}}else{let u=new Error(`Not provided: ${r?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(o,u,r))return this.setAttribute("href","#"),!0}return!1}updateOptions(n={}){let r=U();if(!r)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:a,checkoutWorkflowStep:o,entitlement:s,upgrade:c,modal:u,perpetual:l,promotionCode:p,quantity:f,wcsOsi:m}=r.collectCheckoutOptions(n);return bt(this,{checkoutMarketSegment:i,checkoutWorkflow:a,checkoutWorkflowStep:o,entitlement:s,upgrade:c,modal:u,perpetual:l,promotionCode:p,quantity:f,wcsOsi:m}),!0}};Te=new WeakMap,Q(ye,"is","checkout-link"),Q(ye,"tag","a");var Vr=ye,gt=Et(Vr);var Fn=[h.uk,h.au,h.fr,h.at,h.be_en,h.be_fr,h.be_nl,h.bg,h.ch_de,h.ch_fr,h.ch_it,h.cz,h.de,h.dk,h.ee,h.eg_ar,h.eg_en,h.es,h.fi,h.fr,h.gr_el,h.gr_en,h.hu,h.ie,h.it,h.lu_de,h.lu_en,h.lu_fr,h.nl,h.no,h.pl,h.pt,h.ro,h.se,h.si,h.sk,h.tr,h.ua,h.id_en,h.id_id,h.in_en,h.in_hi,h.jp,h.my_en,h.my_ms,h.nz,h.th_en,h.th_th],Za={INDIVIDUAL_COM:[h.za,h.lt,h.lv,h.ng,h.sa_ar,h.sa_en,h.za,h.sg,h.kr],TEAM_COM:[h.za,h.lt,h.lv,h.ng,h.za,h.co,h.kr],INDIVIDUAL_EDU:[h.lt,h.lv,h.sa_en,h.sea],TEAM_EDU:[h.sea,h.kr]},Pe=class Pe extends HTMLSpanElement{static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-perpetual","data-promotion-code","data-tax-exclusive","data-template","data-wcs-osi"]}static createInlinePrice(t){let n=U();if(!n)return null;let{displayOldPrice:r,displayPerUnit:i,displayRecurrence:a,displayTax:o,forceTaxExclusive:s,perpetual:c,promotionCode:u,quantity:l,template:p,wcsOsi:f}=n.collectPriceOptions(t);return St(Pe,{displayOldPrice:r,displayPerUnit:i,displayRecurrence:a,displayTax:o,forceTaxExclusive:s,perpetual:c,promotionCode:u,quantity:l,template:p,wcsOsi:f})}static getInlinePrices(t){return xt(Pe,t)}get isInlinePrice(){return!0}get placeholder(){return this}resolveDisplayTaxForGeoAndSegment(t,n,r,i){let a=`${t}_${n}`;if(Fn.includes(t)||Fn.includes(a))return!0;let o=Za[`${r}_${i}`];return o?!!(o.includes(t)||o.includes(a)):!1}async resolveDisplayTax(t,n){let[r]=await t.resolveOfferSelectors(n),i=Me(await r,n);if(i?.length){let{country:a,language:o}=n,s=i[0],[c=""]=s.marketSegments;return this.resolveDisplayTaxForGeoAndSegment(a,o,s.customerSegment,c)}}async render(t={}){if(!this.isConnected)return!1;let n=U();if(!n)return!1;let r=n.collectPriceOptions(t,this.placeholder);if(!r.wcsOsi.length)return!1;let i=this.placeholder.togglePending(r);this.innerHTML="";let[a]=n.resolveOfferSelectors(r);return this.renderOffers(Me(await a,r),r,i)}renderOffers(t,n={},r=void 0){if(!this.isConnected)return;let i=U();if(!i)return!1;let a=i.collectPriceOptions({...this.dataset,...n});if(r??(r=this.placeholder.togglePending(a)),t.length){if(this.placeholder.toggleResolved(r,t,a))return this.innerHTML=i.buildPriceHTML(t,a),!0}else{let o=new Error(`Not provided: ${a?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(r,o,a))return this.innerHTML="",!0}return!1}updateOptions(t){let n=U();if(!n)return!1;let{displayOldPrice:r,displayPerUnit:i,displayRecurrence:a,displayTax:o,forceTaxExclusive:s,perpetual:c,promotionCode:u,quantity:l,template:p,wcsOsi:f}=n.collectPriceOptions(t);return bt(this,{displayOldPrice:r,displayPerUnit:i,displayRecurrence:a,displayTax:o,forceTaxExclusive:s,perpetual:c,promotionCode:u,quantity:l,template:p,wcsOsi:f}),!0}};Q(Pe,"is","inline-price"),Q(Pe,"tag","span");var Or=Pe,Lt=Et(Or);function Xn({providers:e,settings:t},n){let r=k.module("checkout");function i(u,l){let{checkoutClientId:p,checkoutWorkflow:f,checkoutWorkflowStep:m,country:T,language:x,promotionCode:b,quantity:P}=t,{checkoutMarketSegment:_,checkoutWorkflow:L=f,checkoutWorkflowStep:O=m,imsCountry:v,country:I=v??T,language:D=x,quantity:F=P,entitlement:q,upgrade:te,modal:X,perpetual:ae,promotionCode:oe=b,wcsOsi:Z,extraOptions:Y,...Ae}=Object.assign({},l?.dataset??{},u??{}),He=ne(L,z,S.checkoutWorkflow),Fe=j.CHECKOUT;He===z.V3&&(Fe=ne(O,j,S.checkoutWorkflowStep));let _e=ge({...Ae,extraOptions:Y,checkoutClientId:p,checkoutMarketSegment:_,country:I,quantity:ve(F,S.quantity),checkoutWorkflow:He,checkoutWorkflowStep:Fe,language:D,entitlement:g(q),upgrade:g(te),modal:g(X),perpetual:g(ae),promotionCode:Ve(oe).effectivePromoCode,wcsOsi:pt(Z)});if(l)for(let vt of e.checkout)vt(l,_e);return _e}async function a(u,l){let p=U(),f=await n.getCheckoutAction?.(u,l,p.imsSignedInPromise);return f||null}function o(u,l){if(!Array.isArray(u)||!u.length||!l)return"";let{env:p,landscape:f}=t,{checkoutClientId:m,checkoutMarketSegment:T,checkoutWorkflow:x,checkoutWorkflowStep:b,country:P,promotionCode:_,quantity:L,...O}=i(l),v=window.frameElement?"if":"fp",I={checkoutPromoCode:_,clientId:m,context:v,country:P,env:p,items:[],marketSegment:T,workflowStep:b,landscape:f,...O};if(u.length===1){let[{offerId:D,offerType:F,productArrangementCode:q}]=u,{marketSegments:[te]}=u[0];Object.assign(I,{marketSegment:te,offerType:F,productArrangementCode:q}),I.items.push(L[0]===1?{id:D}:{id:D,quantity:L[0]})}else I.items.push(...u.map(({offerId:D},F)=>({id:D,quantity:L[F]??S.quantity})));return wt(x,I)}let{createCheckoutLink:s,getCheckoutLinks:c}=gt;return{CheckoutLink:gt,CheckoutWorkflow:z,CheckoutWorkflowStep:j,buildCheckoutAction:a,buildCheckoutURL:o,collectCheckoutOptions:i,createCheckoutLink:s,getCheckoutLinks:c}}function Ja({interval:e=200,maxAttempts:t=25}={}){let n=k.module("ims");return new Promise(r=>{n.debug("Waing for IMS to be ready");let i=0;function a(){window.adobeIMS?.initialized?r():++i>t?(n.debug("Timeout"),r()):setTimeout(a,e)}a()})}function Qa(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function eo(e){let t=k.module("ims");return e.then(n=>n?window.adobeIMS.getProfile().then(({countryCode:r})=>(t.debug("Got user country:",r),r),r=>{t.error("Unable to get user country:",r)}):null)}function Yn({}){let e=Ja(),t=Qa(e),n=eo(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:n}}async function zn(e,t){let{data:n}=t||await Promise.resolve().then(()=>oi(Kn(),1));if(Array.isArray(n)){let r=a=>n.find(o=>ze(o.lang,a)),i=r(e.language)??r(S.language);if(i)return Object.freeze(i)}return{}}function jn({literals:e,providers:t,settings:n}){function r(s,c){let{country:u,displayOldPrice:l,displayPerUnit:p,displayRecurrence:f,displayTax:m,forceTaxExclusive:T,language:x,promotionCode:b,quantity:P}=n,{displayOldPrice:_=l,displayPerUnit:L=p,displayRecurrence:O=f,displayTax:v=m,forceTaxExclusive:I=T,country:D=u,language:F=x,perpetual:q,promotionCode:te=b,quantity:X=P,template:ae,wcsOsi:oe,...Z}=Object.assign({},c?.dataset??{},s??{}),Y=ge({...Z,country:D,displayOldPrice:g(_),displayPerUnit:g(L),displayRecurrence:g(O),displayTax:g(v),forceTaxExclusive:g(I),language:F,perpetual:g(q),promotionCode:Ve(te).effectivePromoCode,quantity:ve(X,S.quantity),template:ae,wcsOsi:pt(oe)});if(c)for(let Ae of t.price)Ae(c,Y);return Y}function i(s,c){if(!Array.isArray(s)||!s.length||!c)return"";let{template:u}=c,l;switch(u){case"discount":l=mr;break;case"strikethrough":l=pr;break;case"optical":l=fr;break;case"annual":l=hr;break;default:l=c.promotionCode?ur:cr}let p=r(c);p.literals=Object.assign({},e.price,ge(c.literals??{}));let[f]=s;return f={...f,...f.priceDetails},l(p,f)}let{createInlinePrice:a,getInlinePrices:o}=Lt;return{InlinePrice:Lt,buildPriceHTML:i,collectPriceOptions:r,createInlinePrice:a,getInlinePrices:o}}function Wn({settings:e}){let t=k.module("wcs"),{env:n,wcsApiKey:r}=e,i=new Map,a=new Map,o;async function s(l,p,f=!0){let m=Sr;t.debug("Fetching:",l);try{l.offerSelectorIds=l.offerSelectorIds.sort();let T=new URL(e.wcsURL);T.searchParams.set("offer_selector_ids",l.offerSelectorIds.join(",")),T.searchParams.set("country",l.country),T.searchParams.set("locale",l.locale),T.searchParams.set("landscape",n===pe.STAGE?"ALL":e.landscape),T.searchParams.set("api_key",r),l.language&&T.searchParams.set("language",l.language),l.promotionCode&&T.searchParams.set("promotion_code",l.promotionCode),l.currency&&T.searchParams.set("currency",l.currency);let x=await fetch(T.toString(),{credentials:"omit"});if(x.ok){let b=await x.json();t.debug("Fetched:",l,b);let P=b.resolvedOffers??[];P=P.map(Be),p.forEach(({resolve:_},L)=>{let O=P.filter(({offerSelectorIds:v})=>v.includes(L)).flat();O.length&&(p.delete(L),_(O))})}else x.status===404&&l.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(l.offerSelectorIds.map(b=>s({...l,offerSelectorIds:[b]},p,!1)))):(m=lt,t.error(m,l))}catch(T){m=lt,t.error(m,l,T)}f&&p.size&&(t.debug("Missing:",{offerSelectorIds:[...p.keys()]}),p.forEach(T=>{T.reject(new Error(m))}))}function c(){clearTimeout(o);let l=[...a.values()];a.clear(),l.forEach(({options:p,promises:f})=>s(p,f))}function u({country:l,language:p,perpetual:f=!1,promotionCode:m="",wcsOsi:T=[]}){let x=`${p}_${l}`;l!=="GB"&&(p=f?"EN":"MULT");let b=[l,p,m].filter(P=>P).join("-").toLowerCase();return T.map(P=>{let _=`${P}-${b}`;if(!i.has(_)){let L=new Promise((O,v)=>{let I=a.get(b);if(!I){let D={country:l,locale:x,offerSelectorIds:[]};l!=="GB"&&(D.language=p),I={options:D,promises:new Map},a.set(b,I)}m&&(I.options.promotionCode=m),I.options.offerSelectorIds.push(P),I.promises.set(P,{resolve:O,reject:v}),I.options.offerSelectorIds.length>=e.wcsBufferLimit?c():(t.debug("Queued:",I.options),o||(o=setTimeout(c,e.wcsBufferDelay)))});i.set(_,L)}return i.get(_)})}return{WcsCommitment:Tr,WcsPlanType:Ar,WcsTerm:dr,resolveOfferSelectors:u}}var R=class extends HTMLElement{get isWcmsCommerce(){return!0}};Q(R,"instance"),Q(R,"promise",null);window.customElements.define(ee,R);async function ro(e,t){let n=k.init(e.env).module("service");n.debug("Activating:",e);let r={price:{}},i=Object.freeze(_r(e));try{r.price=await zn(i,e.commerce.priceLiterals)}catch(c){n.warn("Price literals were not fetched:",c)}let a={checkout:new Set,price:new Set},o=document.createElement(ee),s={literals:r,providers:a,settings:i};return R.instance=Object.defineProperties(o,Object.getOwnPropertyDescriptors({...Xn(s,t),...Yn(s),...jn(s),...Wn(s),...vr,Log:k,get defaults(){return S},get literals(){return r},get log(){return k},get providers(){return{checkout(c){return a.checkout.add(c),()=>a.checkout.delete(c)},price(c){return a.price.add(c),()=>a.price.delete(c)}}},get settings(){return i}})),n.debug("Activated:",{literals:r,settings:i,element:o}),document.head.append(o),ie(()=>{let c=new CustomEvent(he,{bubbles:!0,cancelable:!1,detail:R.instance});R.instance.dispatchEvent(c)}),R.instance}function Bn(){document.head.querySelector(ee)?.remove(),R.promise=null,k.reset()}function no(e,t){if(re(e)){let n=re(t)?t():{};return n.force&&Bn(),R.promise??(R.promise=ro(e(),n))}return R.promise?R.promise:new Promise(n=>{let r=i=>{n(i.detail)};document.head.addEventListener(he,r,{once:!0})})}export{gt as CheckoutLink,z as CheckoutWorkflow,j as CheckoutWorkflowStep,S as Defaults,Lt as InlinePrice,me as Landscape,k as Log,ee as TAG_NAME_SERVICE,Tr as WcsCommitment,Ar as WcsPlanType,dr as WcsTerm,Be as applyPlanType,kn as getLocaleSettings,_r as getSettings,no as init,Bn as reset};
//# sourceMappingURL=commerce.js.map
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know there's a ticket to handle this already, but sourcemaps references have to go (if the sourcemap is not available).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with #2798 this should be fixed.

//we are expecting an array of objects with lang and literals
const data = await priceLiteralsPromise;
const { data } = priceLiterals ? priceLiterals : await import('../price-literals.json');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit confused here; the description says:

This change increases commerce.js for 5KB but eliminates the call for price-literals.json and hence eliminates the possibility of its failure.

If we're still calling price-literals, why aren't we taking it from content?

Copy link
Contributor Author

@bozojovicic bozojovicic Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@narcis-radu We don't fetch price-literals.json any more, this is import, not fetch. There is no call price-literals.json any more.
We are injecting it from source code into commerce.js with import('../price-literals.json') if it's not already provided with priceLiterals argument, which will be the case only for unit tests. In unit tests we cannot use import so I had to read it from source with readFile and then send it as an argument to getPriceLiterals().

@@ -0,0 +1 @@
{"total":38,"offset":0,"limit":38,"data":[{"lang":"ar","recurrenceLabel":"{recurrenceTerm, select, MONTH {/الشهر} YEAR {/العام} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {كل شهر} YEAR {كل عام} other {}}","perUnitLabel":"{perUnit, select, LICENSE {لكل ترخيص} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {لكل ترخيص} other {}}","freeLabel":"مجانًا","freeAriaLabel":"مجانًا","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"أو بدلاً من ذلك بقيمة {alternativePrice}","strikethroughAriaLabel":"بشكل منتظم بقيمة {strikethroughPrice}"},{"lang":"bg","recurrenceLabel":"{recurrenceTerm, select, MONTH {/мес.} YEAR {/год.} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {на месец} YEAR {на година} other {}}","perUnitLabel":"{perUnit, select, LICENSE {на лиценз} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {на лиценз} other {}}","freeLabel":"Безплатно","freeAriaLabel":"Безплатно","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"Алтернативно на {alternativePrice}","strikethroughAriaLabel":"Редовно на {strikethroughPrice}"},{"lang":"cs","recurrenceLabel":"{recurrenceTerm, select, MONTH {/měsíc} YEAR {/rok} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {za měsíc} YEAR {za rok} other {}}","perUnitLabel":"{perUnit, select, LICENSE {za licenci} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {za licenci} other {}}","freeLabel":"Zdarma","freeAriaLabel":"Zdarma","taxExclusiveLabel":"{taxTerm, select, GST {bez daně ze zboží a služeb} VAT {bez DPH} TAX {bez daně} IVA {bez IVA} SST {bez SST} KDV {bez KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {včetně daně ze zboží a služeb} VAT {včetně DPH} TAX {včetně daně} IVA {včetně IVA} SST {včetně SST} KDV {včetně KDV} other {}}","alternativePriceAriaLabel":"Případně za {alternativePrice}","strikethroughAriaLabel":"Pravidelně za {strikethroughPrice}"},{"lang":"da","recurrenceLabel":"{recurrenceTerm, select, MONTH {/md} YEAR {/år} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {pr. måned} YEAR {pr. år} other {}}","perUnitLabel":"{perUnit, select, LICENSE {pr. licens} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {pr. licens} other {}}","freeLabel":"Gratis","freeAriaLabel":"Gratis","taxExclusiveLabel":"{taxTerm, select, GST {ekskl. GST} VAT {ekskl. moms} TAX {ekskl. skat} IVA {ekskl. IVA} SST {ekskl. SST} KDV {ekskl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {inkl. GST} VAT {inkl. moms} TAX {inkl. skat} IVA {inkl. IVA} SST {inkl. SST} KDV {inkl. KDV} other {}}","alternativePriceAriaLabel":"Alternativt til {alternativePrice}","strikethroughAriaLabel":"Normalpris {strikethroughPrice}"},{"lang":"de","recurrenceLabel":"{recurrenceTerm, select, MONTH {/Monat} YEAR {/Jahr} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {pro Monat} YEAR {pro Jahr} other {}}","perUnitLabel":"{perUnit, select, LICENSE {pro Lizenz} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {pro Lizenz} other {}}","freeLabel":"Kostenlos","freeAriaLabel":"Kostenlos","taxExclusiveLabel":"{taxTerm, select, GST {zzgl. GST} VAT {zzgl. MwSt.} TAX {zzgl. Steuern} IVA {zzgl. IVA} SST {zzgl. SST} KDV {zzgl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {inkl. GST} VAT {inkl. MwSt.} TAX {inkl. Steuern} IVA {inkl. IVA} SST {inkl. SST} KDV {inkl. KDV} other {}}","alternativePriceAriaLabel":"Alternativ: {alternativePrice}","strikethroughAriaLabel":"Regulär: {strikethroughPrice}"},{"lang":"en","recurrenceLabel":"{recurrenceTerm, select, MONTH {/mo} YEAR {/yr} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {per month} YEAR {per year} other {}}","perUnitLabel":"{perUnit, select, LICENSE {per license} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {per license} other {}}","freeLabel":"Free","freeAriaLabel":"Free","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"Alternatively at {alternativePrice}","strikethroughAriaLabel":"Regularly at {strikethroughPrice}"},{"lang":"et","recurrenceLabel":"{recurrenceTerm, select, MONTH {kuus} YEAR {aastas} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {kuus} YEAR {aastas} other {}}","perUnitLabel":"{perUnit, select, LICENSE {litsentsi kohta} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {litsentsi kohta} other {}}","freeLabel":"Tasuta","freeAriaLabel":"Tasuta","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"Teise võimalusena hinnaga {alternativePrice}","strikethroughAriaLabel":"Tavahind {strikethroughPrice}"},{"lang":"fi","recurrenceLabel":"{recurrenceTerm, select, MONTH {/kk} YEAR {/v} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {kuukausittain} YEAR {vuosittain} other {}}","perUnitLabel":"{perUnit, select, LICENSE {käyttöoikeutta kohti} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {käyttöoikeutta kohti} other {}}","freeLabel":"Maksuton","freeAriaLabel":"Maksuton","taxExclusiveLabel":"{taxTerm, select, GST {ilman GST:tä} VAT {ilman ALV:tä} TAX {ilman veroja} IVA {ilman IVA:ta} SST {ilman SST:tä} KDV {ilman KDV:tä} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {sis. GST:n} VAT {sis. ALV:n} TAX {sis. verot} IVA {sis. IVA:n} SST {sis. SST:n} KDV {sis. KDV:n} other {}}","alternativePriceAriaLabel":"Vaihtoehtoisesti hintaan {alternativePrice}","strikethroughAriaLabel":"Säännöllisesti hintaan {strikethroughPrice}"},{"lang":"fr","recurrenceLabel":"{recurrenceTerm, select, MONTH {/mois} YEAR {/an} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {par mois} YEAR {par an} other {}}","perUnitLabel":"{perUnit, select, LICENSE {par licence} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {par licence} other {}}","freeLabel":"Gratuit","freeAriaLabel":"Gratuit","taxExclusiveLabel":"{taxTerm, select, GST {hors TPS} VAT {hors TVA} TAX {hors taxes} IVA {hors IVA} SST {hors SST} KDV {hors KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {TPS comprise} VAT {TVA comprise} TAX {taxes comprises} IVA {IVA comprise} SST {SST comprise} KDV {KDV comprise} other {}}","alternativePriceAriaLabel":"Autre prix {alternativePrice}","strikethroughAriaLabel":"Prix habituel {strikethroughPrice}"},{"lang":"he","recurrenceLabel":"{recurrenceTerm, select, MONTH {/חודש} YEAR {/שנה} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {לחודש} YEAR {לשנה} other {}}","perUnitLabel":"{perUnit, select, LICENSE {לרישיון} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {לרישיון} other {}}","freeLabel":"חינם","freeAriaLabel":"חינם","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"לחלופין ב-{alternativePrice}","strikethroughAriaLabel":"באופן קבוע ב-{strikethroughPrice}"},{"lang":"hu","recurrenceLabel":"{recurrenceTerm, select, MONTH {/hó} YEAR {/év} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {havonta} YEAR {évente} other {}}","perUnitLabel":"{perUnit, select, LICENSE {licencenként} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {licencenként} other {}}","freeLabel":"Ingyenes","freeAriaLabel":"Ingyenes","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"Másik lehetőség: {alternativePrice}","strikethroughAriaLabel":"Általában {strikethroughPrice} áron"},{"lang":"it","recurrenceLabel":"{recurrenceTerm, select, MONTH {/mese} YEAR {/anno} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {al mese} YEAR {all'anno} other {}}","perUnitLabel":"{perUnit, select, LICENSE {per licenza} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {per licenza} other {}}","freeLabel":"Gratuito","freeAriaLabel":"Gratuito","taxExclusiveLabel":"{taxTerm, select, GST {escl. GST} VAT {escl. IVA.} TAX {escl. imposte} IVA {escl. IVA} SST {escl. SST} KDV {escl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. IVA} TAX {incl. imposte} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"In alternativa a {alternativePrice}","strikethroughAriaLabel":"Regolarmente a {strikethroughPrice}"},{"lang":"ja","recurrenceLabel":"{recurrenceTerm, select, MONTH {/月} YEAR {/年} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {毎月} YEAR {毎年} other {}}","perUnitLabel":"{perUnit, select, LICENSE {ライセンスごと} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {ライセンスごと} other {}}","freeLabel":"無料","freeAriaLabel":"無料","taxExclusiveLabel":"{taxTerm, select, GST {GST 別} VAT {VAT 別} TAX {税別} IVA {IVA 別} SST {SST 別} KDV {KDV 別} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {GST 込} VAT {VAT 込} TAX {税込} IVA {IVA 込} SST {SST 込} KDV {KDV 込} other {}}","alternativePriceAriaLabel":"特別価格 : {alternativePrice}","strikethroughAriaLabel":"通常価格 : {strikethroughPrice}"},{"lang":"ko","recurrenceLabel":"{recurrenceTerm, select, MONTH {/월} YEAR {/년} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {월간} YEAR {연간} other {}}","perUnitLabel":"{perUnit, select, LICENSE {라이선스당} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {라이선스당} other {}}","freeLabel":"무료","freeAriaLabel":"무료","taxExclusiveLabel":"{taxTerm, select, GST {GST 제외} VAT {VAT 제외} TAX {세금 제외} IVA {IVA 제외} SST {SST 제외} KDV {KDV 제외} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {GST 포함} VAT {VAT 포함} TAX {세금 포함} IVA {IVA 포함} SST {SST 포함} KDV {KDV 포함} other {}}","alternativePriceAriaLabel":"또는 {alternativePrice}에","strikethroughAriaLabel":"또는 {alternativePrice}에"},{"lang":"lt","recurrenceLabel":"{recurrenceTerm, select, MONTH { per mėn.} YEAR { per metus} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {per mėn.} YEAR {per metus} other {}}","perUnitLabel":"{perUnit, select, LICENSE {už licenciją} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {už licenciją} other {}}","freeLabel":"Nemokamai","freeAriaLabel":"Nemokamai","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"Arba už {alternativePrice}","strikethroughAriaLabel":"Normaliai už {strikethroughPrice}"},{"lang":"lv","recurrenceLabel":"{recurrenceTerm, select, MONTH {mēnesī} YEAR {gadā} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {mēnesī} YEAR {gadā} other {}}","perUnitLabel":"{perUnit, select, LICENSE {vienai licencei} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {vienai licencei} other {}}","freeLabel":"Bezmaksas","freeAriaLabel":"Bezmaksas","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"Alternatīvi par {alternativePrice}","strikethroughAriaLabel":"Regulāri par {strikethroughPrice}"},{"lang":"nb","recurrenceLabel":"{recurrenceTerm, select, MONTH {/mnd.} YEAR {/år} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {per måned} YEAR {per år} other {}}","perUnitLabel":"{perUnit, select, LICENSE {per lisens} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {per lisens} other {}}","freeLabel":"Fri","freeAriaLabel":"Fri","taxExclusiveLabel":"{taxTerm, select, GST {ekskl. GST} VAT {ekskl. moms} TAX {ekskl. avgift} IVA {ekskl. IVA} SST {ekskl. SST} KDV {ekskl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {inkl. GST} VAT {inkl. moms} TAX {inkl. avgift} IVA {inkl. IVA} SST {inkl. SST} KDV {inkl. KDV} other {}}","alternativePriceAriaLabel":"Alternativt til {alternativePrice}","strikethroughAriaLabel":"Regelmessig til {strikethroughPrice}"},{"lang":"nl","recurrenceLabel":"{recurrenceTerm, select, MONTH {/mnd} YEAR {/jr} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {per maand} YEAR {per jaar} other {}}","perUnitLabel":"{perUnit, select, LICENSE {per licentie} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {per licentie} other {}}","freeLabel":"Gratis","freeAriaLabel":"Gratis","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. btw} TAX {excl. belasting} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. btw} TAX {incl. belasting} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"Nu {alternativePrice}","strikethroughAriaLabel":"Normaal {strikethroughPrice}"},{"lang":"pl","recurrenceLabel":"{recurrenceTerm, select, MONTH { / mies.} YEAR { / rok} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH { / miesiąc} YEAR { / rok} other {}}","perUnitLabel":"{perUnit, select, LICENSE {za licencję} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {za licencję} other {}}","freeLabel":"Bezpłatne","freeAriaLabel":"Bezpłatne","taxExclusiveLabel":"{taxTerm, select, GST {bez GST} VAT {bez VAT} TAX {netto} IVA {bez IVA} SST {bez SST} KDV {bez KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {z GST} VAT {z VAT} TAX {brutto} IVA {z IVA} SST {z SST} KDV {z KDV} other {}}","alternativePriceAriaLabel":"Lub za {alternativePrice}","strikethroughAriaLabel":"Cena zwykła: {strikethroughPrice}"},{"lang":"pt","recurrenceLabel":"{recurrenceTerm, select, MONTH {/mês} YEAR {/ano} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {por mês} YEAR {por ano} other {}}","perUnitLabel":"{perUnit, select, LICENSE {por licença} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {por licença} other {}}","freeLabel":"Gratuito","freeAriaLabel":"Gratuito","taxExclusiveLabel":"{taxTerm, select, GST {ICMS não incluso} VAT {IVA não incluso} TAX {impostos não inclusos} IVA {IVA não incluso} SST { SST não incluso} KDV {KDV não incluso} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {ICMS incluso} VAT {IVA incluso} TAX {impostos inclusos} IVA {IVA incluso} SST {SST incluso} KDV {KDV incluso} other {}}","alternativePriceAriaLabel":"Ou a {alternativePrice}","strikethroughAriaLabel":"Preço normal: {strikethroughPrice}"},{"lang":"ro","recurrenceLabel":"{recurrenceTerm, select, MONTH {/lună} YEAR {/an} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {pe lună} YEAR {pe an} other {}}","perUnitLabel":"{perUnit, select, LICENSE {pe licență} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {pe licență} other {}}","freeLabel":"Gratuit","freeAriaLabel":"Gratuit","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"Alternativ, la {alternativePrice}","strikethroughAriaLabel":"În mod normal, la {strikethroughPrice}"},{"lang":"ru","recurrenceLabel":"{recurrenceTerm, select, MONTH {/мес.} YEAR {/г.} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {в месяц} YEAR {в год} other {}}","perUnitLabel":"{perUnit, select, LICENSE {за лицензию} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {за лицензию} other {}}","freeLabel":"Бесплатно","freeAriaLabel":"Бесплатно","taxExclusiveLabel":"{taxTerm, select, GST {искл. налог на товары и услуги} VAT {искл. НДС} TAX {искл. налог} IVA {искл. ИВА} SST {искл. SST} KDV {искл. КДВ} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {вкл. налог на товары и услуги} VAT {вкл. НДС} TAX {вкл. налог} IVA {вкл. ИВА} SST {вкл. SST} KDV {вкл. КДВ} other {}}","alternativePriceAriaLabel":"Альтернативный вариант за {alternativePrice}","strikethroughAriaLabel":"Регулярно по цене {strikethroughPrice}"},{"lang":"sk","recurrenceLabel":"{recurrenceTerm, select, MONTH {/mesiac} YEAR {/rok} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {za mesiac} YEAR {za rok} other {}}","perUnitLabel":"{perUnit, select, LICENSE {za licenciu} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {za licenciu} other {}}","freeLabel":"Zadarmo","freeAriaLabel":"Zadarmo","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"Prípadne za {alternativePrice}","strikethroughAriaLabel":"Pravidelne za {strikethroughPrice}"},{"lang":"sl","recurrenceLabel":"{recurrenceTerm, select, MONTH {/mesec} YEAR {/leto} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {na mesec} YEAR {na leto} other {}}","perUnitLabel":"{perUnit, select, LICENSE {na licenco} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {na licenco} other {}}","freeLabel":"Brezplačno","freeAriaLabel":"Brezplačno","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"Druga možnost je: {alternativePrice}","strikethroughAriaLabel":"Redno po {strikethroughPrice}"},{"lang":"sv","recurrenceLabel":"{recurrenceTerm, select, MONTH {/mån} YEAR {/år} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {per månad} YEAR {per år} other {}}","perUnitLabel":"{perUnit, select, LICENSE {per licens} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {per licens} other {}}","freeLabel":"Kostnadsfritt","freeAriaLabel":"Kostnadsfritt","taxExclusiveLabel":"{taxTerm, select, GST {exkl. GST} VAT {exkl. moms} TAX {exkl. skatt} IVA {exkl. IVA} SST {exkl. SST} KDV {exkl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {inkl. GST} VAT {inkl. moms} TAX {inkl. skatt} IVA {inkl. IVA} SST {inkl. SST} KDV {inkl. KDV} other {}}","alternativePriceAriaLabel":"Alternativt för {alternativePrice}","strikethroughAriaLabel":"Normalpris {strikethroughPrice}"},{"lang":"tr","recurrenceLabel":"{recurrenceTerm, select, MONTH {/ay} YEAR {/yıl} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {(aylık)} YEAR {(yıllık)} other {}}","perUnitLabel":"{perUnit, select, LICENSE {(lisans başına)} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {(lisans başına)} other {}}","freeLabel":"Ücretsiz","freeAriaLabel":"Ücretsiz","taxExclusiveLabel":"{taxTerm, select, GST {GST hariç} VAT {KDV hariç} TAX {vergi hariç} IVA {IVA hariç} SST {SST hariç} KDV {KDV hariç} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {GST dahil} VAT {KDV dahil} TAX {vergi dahil} IVA {IVA dahil} SST {SST dahil} KDV {KDV dahil} other {}}","alternativePriceAriaLabel":"Ya da {alternativePrice}","strikethroughAriaLabel":"Standart fiyat: {strikethroughPrice}"},{"lang":"uk","recurrenceLabel":"{recurrenceTerm, select, MONTH {/міс.} YEAR {/рік} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {на місяць} YEAR {на рік} other {}}","perUnitLabel":"{perUnit, select, LICENSE {за ліцензію} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {за ліцензію} other {}}","freeLabel":"Безкоштовно","freeAriaLabel":"Безкоштовно","taxExclusiveLabel":"{taxTerm, select, GST {без GST} VAT {без ПДВ} TAX {без податку} IVA {без IVA} SST {без SST} KDV {без KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {разом із GST} VAT {разом із ПДВ} TAX {разом із податком} IVA {разом з IVA} SST {разом із SST} KDV {разом із KDV} other {}}","alternativePriceAriaLabel":"Або за {alternativePrice}","strikethroughAriaLabel":"Звичайна ціна {strikethroughPrice}"},{"lang":"zh-hans","recurrenceLabel":"{recurrenceTerm, select, MONTH {/月} YEAR {/年} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {每月} YEAR {每年} other {}}","perUnitLabel":"{perUnit, select, LICENSE {每个许可证} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {每个许可证} other {}}","freeLabel":"免费","freeAriaLabel":"免费","taxExclusiveLabel":"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}","alternativePriceAriaLabel":"或定价 {alternativePrice}","strikethroughAriaLabel":"正常价 {strikethroughPrice}"},{"lang":"zh-hant","recurrenceLabel":"{recurrenceTerm, select, MONTH {/月} YEAR {/年} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {每月} YEAR {每年} other {}}","perUnitLabel":"{perUnit, select, LICENSE {每個授權} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {每個授權} other {}}","freeLabel":"免費","freeAriaLabel":"免費","taxExclusiveLabel":"{taxTerm, select, GST {不含 GST} VAT {不含 VAT} TAX {不含稅} IVA {不含 IVA} SST {不含 SST} KDV {不含 KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {含 GST} VAT {含 VAT} TAX {含稅} IVA {含 IVA} SST {含 SST} KDV {含 KDV} other {}}","alternativePriceAriaLabel":"或者在 {alternativePrice}","strikethroughAriaLabel":"標準價格為 {strikethroughPrice}"},{"lang":"es","recurrenceLabel":"{recurrenceTerm, select, MONTH {/mes} YEAR {/año} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {al mes} YEAR {al año} other {}}","perUnitLabel":"{perUnit, select, LICENSE {por licencia} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {por licencia} other {}}","freeLabel":"Gratuito","freeAriaLabel":"Gratuito","taxExclusiveLabel":"{taxTerm, select, GST {GST no incluido} VAT {IVA no incluido} TAX {Impuestos no incluidos} IVA {IVA no incluido} SST {SST no incluido} KDV {KDV no incluido} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {GST incluido} VAT {IVA incluido} TAX {Impuestos incluidos} IVA {IVA incluido} SST {SST incluido} KDV {KDV incluido} other {}}","alternativePriceAriaLabel":"Alternativamente por {alternativePrice}","strikethroughAriaLabel":"Normalmente a {strikethroughPrice}"},{"lang":"in","recurrenceLabel":"{recurrenceTerm, select, MONTH {/bulan} YEAR {/tahun} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {per bulan} YEAR {per tahun} other {}}","perUnitLabel":"{perUnit, select, LICENSE {per lisensi} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {per lisensi} other {}}","freeLabel":"Gratis","freeAriaLabel":"Gratis","taxExclusiveLabel":"{taxTerm, select, GST {tidak termasuk PBJ} VAT {tidak termasuk PPN} TAX {tidak termasuk pajak} IVA {tidak termasuk IVA} SST {tidak termasuk SST} KDV {tidak termasuk KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {termasuk PBJ} VAT {termasuk PPN} TAX {termasuk pajak} IVA {termasuk IVA} SST {termasuk SST} KDV {termasuk KDV} other {}}","alternativePriceAriaLabel":"Atau seharga {alternativePrice}","strikethroughAriaLabel":"Normalnya seharga {strikethroughPrice}"},{"lang":"vi","recurrenceLabel":"{recurrenceTerm, select, MONTH {/tháng} YEAR {/năm} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {mỗi tháng} YEAR {mỗi năm} other {}}","perUnitLabel":"{perUnit, select, LICENSE {mỗi giấy phép} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {mỗi giấy phép} other {}}","freeLabel":"Miễn phí","freeAriaLabel":"Miễn phí","taxExclusiveLabel":"{taxTerm, select, GST {chưa bao gồm thuế hàng hóa và dịch vụ} VAT {chưa bao gồm thuế GTGT} TAX {chưa bao gồm thuế} IVA {chưa bao gồm IVA} SST {chưa bao gồm SST} KDV {chưa bao gồm KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {(đã bao gồm thuế hàng hóa và dịch vụ)} VAT {(đã bao gồm thuế GTGT)} TAX {(đã bao gồm thuế)} IVA {(đã bao gồm IVA)} SST {(đã bao gồm SST)} KDV {(đã bao gồm KDV)} other {}}","alternativePriceAriaLabel":"Giá ưu đãi {alternativePrice}","strikethroughAriaLabel":"Giá thông thường {strikethroughPrice}"},{"lang":"th","recurrenceLabel":"{recurrenceTerm, select, MONTH {/เดือน} YEAR {/ปี} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {ต่อเดือน} YEAR {ต่อปี} other {}}","perUnitLabel":"{perUnit, select, LICENSE {ต่อสิทธิ์การใช้งาน} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {ต่อสิทธิ์การใช้งาน} other {}}","freeLabel":"ฟรี","freeAriaLabel":"ฟรี","taxExclusiveLabel":"{taxTerm, select, GST {ไม่รวมภาษี GST} VAT {ไม่รวม VAT} TAX {ไม่รวมภาษี} IVA {ไม่รวม IVA} SST {ไม่รวม SST} KDV {ไม่รวม KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {รวมภาษี GST} VAT {รวม VAT} TAX {รวมภาษี} IVA {รวม IVA} SST {รวม SST} KDV {รวม KDV} other {}}","alternativePriceAriaLabel":"ราคาพิเศษ {alternativePrice}","strikethroughAriaLabel":"ราคาปกติ {strikethroughPrice}"},{"lang":"el","recurrenceLabel":"{recurrenceTerm, select, MONTH {/μήνα} YEAR {/έτος} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {κάθε μήνα} YEAR {ανά έτος} other {}}","perUnitLabel":"{perUnit, select, LICENSE {ανά άδεια χρήσης} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {ανά άδεια χρήσης} other {}}","freeLabel":"Δωρεάν","freeAriaLabel":"Δωρεάν","taxExclusiveLabel":"{taxTerm, select, GST {(μη συμπεριλαμβανομένου GST)} VAT {(μη συμπεριλαμβανομένου ΦΠΑ)} TAX {(μη συμπεριλαμβανομένου φόρο)} IVA {(μη συμπεριλαμβανομένου IVA)} SST {(μη συμπεριλαμβανομένου SST)} KDV {(μη συμπεριλαμβανομένου KDV)} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {(συμπεριλαμβανομένου του GST)} VAT {(συμπεριλαμβανομένου ΦΠΑ)} TAX {(συμπεριλαμβανομένου του φόρου)} IVA {(συμπεριλαμβανομένου του IVA)} SST {(συμπεριλαμβανομένου του SST)} KDV {(συμπεριλαμβανομένου του KDV)} other {}}","alternativePriceAriaLabel":"Διαφορετικά, {alternativePrice}","strikethroughAriaLabel":"Κανονική τιμή {strikethroughPrice}"},{"lang":"fil","recurrenceLabel":"{recurrenceTerm, select, MONTH {/buwan} YEAR {/taon} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {per buwan} YEAR {per taon} other {}}","perUnitLabel":"{perUnit, select, LICENSE {kada lisensya} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {kada lisensya} other {}}","freeLabel":"Libre","freeAriaLabel":"Libre","taxExclusiveLabel":"{taxTerm, select, GST {hindi kasama ang GST} VAT {hindi kasama ang VAT} TAX {hindi kasama ang Buwis} IVA {hindi kasama ang IVA} SST {hindi kasama ang SST} KDV {hindi kasama ang KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {kasama ang GST} VAT {kasama ang VAT} TAX {kasama ang Buwis} IVA {kasama ang IVA} SST {kasama ang SST} KDV {kasama ang KDV} other {}}","alternativePriceAriaLabel":"Alternatibong nasa halagang {alternativePrice}","strikethroughAriaLabel":"Regular na nasa halagang {strikethroughPrice}"},{"lang":"ms","recurrenceLabel":"{recurrenceTerm, select, MONTH {/bulan} YEAR {/tahun} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {per bulan} YEAR {per tahun} other {}}","perUnitLabel":"{perUnit, select, LICENSE {setiap lesen} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {setiap lesen} other {}}","freeLabel":"Percuma","freeAriaLabel":"Percuma","taxExclusiveLabel":"{taxTerm, select, GST {kecuali GST} VAT {kecuali VAT} TAX {kecuali Cukai} IVA {kecuali IVA} SST {kecuali SST} KDV {kecuali KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {termasuk GST} VAT {termasuk VAT} TAX {termasuk Cukai} IVA {termasuk IVA} SST {termasuk SST} KDV {termasuk KDV} other {}}","alternativePriceAriaLabel":"Secara alternatif pada {alternativePrice}","strikethroughAriaLabel":"Biasanya pada {strikethroughPrice}"},{"lang":"hi","recurrenceLabel":"{recurrenceTerm, select, MONTH {/माह} YEAR {/वर्ष} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {per माह} YEAR {per वर्ष} other {}}","perUnitLabel":"{perUnit, select, LICENSE {प्रति लाइसेंस} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {प्रति लाइसेंस} other {}}","freeLabel":"फ़्री","freeAriaLabel":"फ़्री","taxExclusiveLabel":"{taxTerm, select, GST {GST अतिरिक्त} VAT {VAT अतिरिक्त} TAX {कर अतिरिक्त} IVA {IVA अतिरिक्त} SST {SST अतिरिक्त} KDV {KDV अतिरिक्त} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {GST सहित} VAT {VAT सहित} TAX {कर सहित} IVA {IVA सहित} SST {SST सहित} KDV {KDV सहित} other {}}","alternativePriceAriaLabel":"वैकल्पिक रूप से इस पर {alternativePrice}","strikethroughAriaLabel":"नियमित रूप से इस पर {strikethroughPrice}"},{"lang":"iw","recurrenceLabel":"{recurrenceTerm, select, MONTH {/חודש} YEAR {/שנה} other {}}","recurrenceAriaLabel":"{recurrenceTerm, select, MONTH {לחודש} YEAR {לשנה} other {}}","perUnitLabel":"{perUnit, select, LICENSE {לרישיון} other {}}","perUnitAriaLabel":"{perUnit, select, LICENSE {לרישיון} other {}}","freeLabel":"חינם","freeAriaLabel":"חינם","taxExclusiveLabel":"{taxTerm, select, GST {ללא GST} VAT {ללא מע\"מ} TAX {ללא מס} IVA {ללא IVA} SST {ללא SST} KDV {ללא KDV} other {}}","taxInclusiveLabel":"{taxTerm, select, GST {כולל GST} VAT {כולל מע\"מ} TAX {כולל מס} IVA {כולל IVA} SST {כולל SST} KDV {כולל KDV} other {}}","alternativePriceAriaLabel":"לחלופין ב-{alternativePrice}","strikethroughAriaLabel":"באופן קבוע ב-{strikethroughPrice}"}],":type":"sheet"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also removes the possibility for authors to change this file in sharepoint now when we have it in source code /libs/features/mas/commerce/price-literals.json but this content is changed only once during the last year.
I removed tons of code that we had only for loading of price literals.

We should also consider geo expansion use-cases and also the speed of making a change when needed (e.g. changing "gratuit" to "gratis" for Romanian). I am a bit worried about this, I don't think we should keep content in the repository, but I do understand the point that things don't change that often.
@npeltier , @3ch023 , @yesil - what's your take on this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently literals are language based only, and we support the same literals as the checkout page.
We already discussed supporting locales in price-literals.json instead of just languages, but AFAIK it is not a formal requirement yet.(@3ch023 keep me honest?)

For updating the wrong literals, it would be good to drop a message to milo-commerce with the description of the issue. Then we can follow-up with GWP.

For context: with MAS v1, engineering took over of price literals and on Milo GWP wasn't meant to update the price-literals file on sharepoint.(it happened a few times under eng supervision).

Since literals do not change often, and are very critical, we want to prevent any issue caused by authoring and also reduce the impact of literal on the page performance, hence this PR.

Copy link
Contributor

@3ch023 3ch023 Sep 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but AFAIK it is not a formal requirement yet.

correct, no need for that as of now.

Just supporting the Ilyases statement above, price literals for commerce were decided to be managed by Eng, not GWP. We clarified it yesterday in the Warriors demo call.
And getting rid of an additional fetch request is just a nice bonus.

Copy link
Contributor

github-actions bot commented Sep 5, 2024

Reminder to set the Ready for Stage label - to queue this to get merged to stage & production.

@yesil yesil dismissed their stale review September 6, 2024 09:44

unit tests are failing

Copy link
Contributor

github-actions bot commented Sep 7, 2024

This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR.

@skumar09 skumar09 added run-nala Run Nala Test Automation against PR and removed run-nala Run Nala Test Automation against PR labels Sep 7, 2024
@afmicka afmicka added verified PR has been E2E tested by a reviewer Ready for Stage labels Sep 10, 2024
@milo-pr-merge milo-pr-merge bot merged commit 3fd877c into adobecom:stage Sep 10, 2024
25 of 26 checks passed
@milo-pr-merge milo-pr-merge bot mentioned this pull request Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commerce Ready for Stage run-nala Run Nala Test Automation against PR verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants