From 4dc84a12b6eb240f5233a77cdb149ec7c57d2191 Mon Sep 17 00:00:00 2001 From: Mariia Lukianets Date: Tue, 23 Jul 2024 19:47:03 +0200 Subject: [PATCH] MWPW-153808: fix duplicate tax labels --- libs/deps/commerce.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/deps/commerce.js b/libs/deps/commerce.js index 2b9debee70..c3a2dc1903 100644 --- a/libs/deps/commerce.js +++ b/libs/deps/commerce.js @@ -1,4 +1,6 @@ +// branch: main commit: c9d55dcfbb025978f8378c6aad1a2d2a773bbdd3 Tue, 23 Jul 2024 17:39:22 GMT var kr=Object.defineProperty;var ui=(e,t,r)=>t in e?kr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var li=(e,t)=>{for(var r in t)kr(e,r,{get:t[r],enumerable:!0})};var ne=(e,t,r)=>(ui(e,typeof t!="symbol"?t+"":t,r),r),Gr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var Lt=(e,t,r)=>(Gr(e,t,"read from private field"),r?r.call(e):t.get(e)),Fr=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Nt=(e,t,r,n)=>(Gr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Ie;(function(e){e.ServerError="ServerError",e.ClientError="ClientError",e.UnexpectedError="UnexpectedError"})(Ie||(Ie={}));var Vr=(e,t,r)=>({type:(i=>i>=500?Ie.ServerError:i<400?Ie.UnexpectedError:Ie.ClientError)(e),message:t,originatingRequest:r,status:e});var fi=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},Be;(function(e){e.AUTHORIZATION="Authorization",e.X_API_KEY="X-Api-Key"})(Be||(Be={}));var Ct=class{constructor(t){this.fetchOptions=t}commonHeaders(){let t={};return this.fetchOptions.apiKey&&(t[Be.X_API_KEY]=this.fetchOptions.apiKey),this.fetchOptions.accessToken&&(t[Be.AUTHORIZATION]=`Bearer ${this.fetchOptions.accessToken}`),t}transformData(t,r){return r?t.map(n=>r(n)):t.map(n=>this.identifyTransform(n))}transformDatum(t,r){return r?r(t):this.identifyTransform(t)}identifyTransform(t){return t}failOnBadStatusOrParseBody(t,r){return fi(this,void 0,void 0,function*(){if(t.ok)return t.json().then(i=>({headers:t.headers,status:t.status,statusText:t.statusText,data:i}));let n=yield t.text();return Promise.reject(Vr(t.status,n,r))})}buildUrl(t,r,n,i,o){var s;let a=(s=this.fetchOptions.baseUrl)!==null&&s!==void 0?s:i(this.fetchOptions.env),c=o(r,n);return this.generateUrl(a,t,c)}generateUrl(t,r,n){let i=new URL(r,t);return n&&(i.search=this.convertToSearchParams(n).toString()),i.toString()}convertToSearchParams(t){return new URLSearchParams(t)}setParams(t,r,n){n!=null&&typeof n=="boolean"?t[r]=String(n):n&&(t[r]=n)}},It=Ct;var Y;(function(e){e.STAGE="STAGE",e.PRODUCTION="PRODUCTION",e.LOCAL="LOCAL"})(Y||(Y={}));var Re;(function(e){e.STAGE="STAGE",e.PRODUCTION="PROD",e.LOCAL="LOCAL"})(Re||(Re={}));var G;(function(e){e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED"})(G||(G={}));var fe;(function(e){e.V2="UCv2",e.V3="UCv3"})(fe||(fe={}));var $;(function(e){e.CHECKOUT="checkout",e.CHECKOUT_EMAIL="checkout/email",e.SEGMENTATION="segmentation",e.BUNDLE="bundle",e.COMMITMENT="commitment",e.RECOMMENDATION="recommendation",e.EMAIL="email",e.PAYMENT="payment",e.CHANGE_PLAN_TEAM_PLANS="change-plan/team-upgrade/plans",e.CHANGE_PLAN_TEAM_PAYMENT="change-plan/team-upgrade/payment"})($||($={}));var Rt=function(e){var t;return(t=pi.get(e))!==null&&t!==void 0?t:e},pi=new Map([["countrySpecific","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["offerType","ot"],["marketSegment","ms"]]);var jr=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o};function ve(e,t,r){var n,i;try{for(var o=jr(Object.entries(e)),s=o.next();!s.done;s=o.next()){var a=Wr(s.value,2),c=a[0],l=a[1],u=Rt(c);l!=null&&r.has(u)&&t.set(u,l)}}catch(p){n={error:p}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}function Ye(e){switch(e){case Y.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function $e(e,t){var r,n;for(var i in e){var o=e[i];try{for(var s=(r=void 0,jr(Object.entries(o))),a=s.next();!a.done;a=s.next()){var c=Wr(a.value,2),l=c[0],u=c[1];if(u!=null){var p=Rt(l);t.set("items["+i+"]["+p+"]",u)}}}catch(f){r={error:f}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}var mi=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Hr(e){gi(e);var t=e.env,r=e.items,n=e.workflowStep,i=mi(e,["env","items","workflowStep"]),o=new URL(Ye(t));return o.pathname=n+"/",$e(r,o.searchParams),ve(i,o.searchParams,di),o.toString()}var di=new Set(["cli","co","lang","ctx","cUrl","mv","nglwfdata","otac","promoid","rUrl","sdid","spint","trackingid","code","campaignid","appctxid"]),Ei=["env","workflowStep","clientId","country","items"];function gi(e){var t,r;try{for(var n=hi(Ei),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!0}var xi=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_i="p_draft_landscape",vi="/store/";function Dt(e){bi(e);var t=e.env,r=e.items,n=e.workflowStep,i=e.ms,o=e.marketSegment,s=e.ot,a=e.offerType,c=e.pa,l=e.productArrangementCode,u=e.landscape,p=xi(e,["env","items","workflowStep","ms","marketSegment","ot","offerType","pa","productArrangementCode","landscape"]),f={marketSegment:o??i,offerType:a??s,productArrangementCode:l??c},d=new URL(Ye(t));return d.pathname=""+vi+n,n!==$.SEGMENTATION&&n!==$.CHANGE_PLAN_TEAM_PLANS&&$e(r,d.searchParams),n===$.SEGMENTATION&&ve(f,d.searchParams,Ut),ve(p,d.searchParams,Ut),u===G.DRAFT&&ve({af:_i},d.searchParams,Ut),d.toString()}var Ut=new Set(["af","ai","apc","appctxid","cli","co","csm","ctx","ctxRtUrl","DCWATC","dp","fr","gsp","ijt","lang","lo","mal","ms","mv","mv2","nglwfdata","ot","otac","pa","pcid","promoid","q","rf","sc","scl","sdid","sid","spint","svar","th","thm","trackingid","usid","workflowid","context.guid","so.ca","so.su","so.tr","so.va"]),Ti=["env","workflowStep","clientId","country"];function bi(e){var t,r;try{for(var n=yi(Ti),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}if(e.workflowStep!==$.SEGMENTATION&&e.workflowStep!==$.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}function Mt(e,t){switch(e){case fe.V2:return Hr(t);case fe.V3:return Dt(t);default:return console.warn("Unsupported CheckoutType, will use UCv3 as default. Given type: "+e),Dt(t)}}var kt;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(kt||(kt={}));var I;(function(e){e.MONTH="MONTH",e.YEAR="YEAR",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.PERPETUAL="PERPETUAL",e.TERM_LICENSE="TERM_LICENSE",e.ACCESS_PASS="ACCESS_PASS",e.THREE_MONTHS="THREE_MONTHS",e.SIX_MONTHS="SIX_MONTHS"})(I||(I={}));var L;(function(e){e.ANNUAL="ANNUAL",e.MONTHLY="MONTHLY",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.P1D="P1D",e.P1Y="P1Y",e.P3Y="P3Y",e.P10Y="P10Y",e.P15Y="P15Y",e.P3D="P3D",e.P7D="P7D",e.P30D="P30D",e.HALF_YEARLY="HALF_YEARLY",e.QUARTERLY="QUARTERLY"})(L||(L={}));var Gt;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Gt||(Gt={}));var Ft;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(Ft||(Ft={}));var Vt;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Vt||(Vt={}));var jt;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(jt||(jt={}));var Wt=()=>{};Wt.createContext=Wt;var Si=G.PUBLISHED,Xr=e=>{switch(e){case Y.PRODUCTION:return"https://wcs.adobe.io";case Y.STAGE:return"https://wcs-stage.adobe.io";case Y.LOCAL:return"http://localhost:3002";default:return"https://wcs-stage.adobe.io"}},Br=(e,t)=>{var r;return e.api_key=t.apiKey,e.landscape=(r=t.landscape)!==null&&r!==void 0?r:Si,e};var Pi=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},Ht=class extends It{constructor(t){super(t),this.apiPaths={getWebCommerceArtifact:"web_commerce_artifact"},this.getWebCommerceArtifact=(r,n,i,o)=>Pi(this,void 0,void 0,function*(){let s=this.buildUrl(this.apiPaths.getWebCommerceArtifact,n,r,a=>Xr(a),(a,c)=>this.evaluateGetWebCommerceArtifactParams(a,c));return this.fetchOptions.fetch(s,{signal:o,headers:Object.assign({},this.commonHeaders()),mode:"cors"}).then(a=>this.failOnBadStatusOrParseBody(a,`GET ${s}`)).then(a=>{let l=a.data;return{data:this.transformDatum(l,i)}})})}evaluateGetWebCommerceArtifactParams(t,r){let n={};return this.setParams(n,"offer_selector_ids",r.offerSelectorIds.join(",")),this.setParams(n,"country",r.country),this.setParams(n,"language",r.language),this.setParams(n,"currency",r.currency),this.setParams(n,"locale",r.locale),this.setParams(n,"promotion_code",r.promotionCode),Br(n,t)}},Yr=Ht;var qe=e=>new Yr(e).getWebCommerceArtifact;var $r="tacocat.js";var ze=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),qr=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function w(e,t={},{metadata:r=!0,search:n=!0,storage:i=!0}={}){let o;if(n&&o==null){let s=new URLSearchParams(window.location.search),a=Te(n)?n:e;o=s.get(a)}if(i&&o==null){let s=Te(i)?i:e;o=window.sessionStorage.getItem(s)??window.localStorage.getItem(s)}if(r&&o==null){let s=Qr(Te(r)?r:e);o=document.documentElement.querySelector(`meta[name="${s}"]`)?.content}return o??t[e]}var be=()=>{};var zr=e=>typeof e=="boolean",ce=e=>typeof e=="function",Ze=e=>typeof e=="number",Zr=e=>e!=null&&typeof e=="object";var Te=e=>typeof e=="string",Xt=e=>Te(e)&&e,Se=e=>Ze(e)&&Number.isFinite(e)&&e>0;function Pe(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,n])=>{t(n)&&delete e[r]}),e}function v(e,t){if(zr(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function ie(e,t,r){let n=Object.values(t);return n.find(i=>ze(i,e))??r??n[0]}function Qr(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,n)=>`${r}-${n}`).replace(/\W+/gu,"-").toLowerCase()}function Ae(e,t=1){return Ze(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var Ai=Date.now(),Bt=()=>`(+${Date.now()-Ai}ms)`,Qe=new Set,wi=v(w("tacocat.debug",{},{metadata:!1}),typeof process<"u"&&process.env?.DEBUG);function Jr(e){let t=`[${$r}/${e}]`,r=(s,a,...c)=>s?!0:(i(a,...c),!1),n=wi?(s,...a)=>{console.debug(`${t} ${s}`,...a,Bt())}:()=>{},i=(s,...a)=>{let c=`${t} ${s}`;Qe.forEach(([l])=>l(c,...a))};return{assert:r,debug:n,error:i,warn:(s,...a)=>{let c=`${t} ${s}`;Qe.forEach(([,l])=>l(c,...a))}}}function Oi(e,t){let r=[e,t];return Qe.add(r),()=>{Qe.delete(r)}}Oi((e,...t)=>{console.error(e,...t,Bt())},(e,...t)=>{console.warn(e,...t,Bt())});var Li="no promo",Kr="promo-tag",Ni="yellow",Ci="neutral",Ii=(e,t,r)=>{let n=o=>o||Li,i=r?` (was "${n(t)}")`:"";return`${n(e)}${i}`},Ri="cancel-context",Ue=(e,t)=>{let r=e===Ri,n=!r&&e?.length>0,i=(n||r)&&(t&&t!=e||!t&&!r),o=i&&n||!i&&!!t,s=o?e||t:void 0;return{effectivePromoCode:s,overridenPromoCode:e,className:o?Kr:`${Kr} no-promo`,text:Ii(s,t,i),variant:o?Ni:Ci,isOverriden:i}};var Yt=function(e,t){return Yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Yt(e,t)};function De(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Yt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var T=function(){return T=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0}),r=[],n=0,i=t;n1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Mi,function(a,c,l,u,p,f){if(c)t.minimumIntegerDigits=l.length;else{if(u&&p)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(ln.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(on.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(on,function(a,c,l,u,p,f){return l==="*"?t.minimumFractionDigits=c.length:u&&u[0]==="#"?t.maximumFractionDigits=u.length:p&&f?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+f.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""}),i.options.length&&(t=T(T({},t),sn(i.options[0])));continue}if(un.test(i.stem)){t=T(T({},t),sn(i.stem));continue}var o=fn(i.stem);o&&(t=T(T({},t),o));var s=ki(i.stem);s&&(t=T(T({},t),s))}return t}var zt,Gi=new RegExp("^"+qt.source+"*"),Fi=new RegExp(qt.source+"*$");function x(e,t){return{start:e,end:t}}var Vi=!!String.prototype.startsWith,ji=!!String.fromCodePoint,Wi=!!Object.fromEntries,Hi=!!String.prototype.codePointAt,Xi=!!String.prototype.trimStart,Bi=!!String.prototype.trimEnd,Yi=!!Number.isSafeInteger,$i=Yi?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Qt=!0;try{mn=gn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Qt=((zt=mn.exec("a"))===null||zt===void 0?void 0:zt[0])==="a"}catch{Qt=!1}var mn,hn=Vi?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Jt=ji?String.fromCodePoint:function(){for(var t=[],r=0;ro;){if(s=t[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},dn=Wi?Object.fromEntries:function(t){for(var r={},n=0,i=t;n=n)){var i=t.charCodeAt(r),o;return i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},qi=Xi?function(t){return t.trimStart()}:function(t){return t.replace(Gi,"")},zi=Bi?function(t){return t.trimEnd()}:function(t){return t.replace(Fi,"")};function gn(e,t){return new RegExp(e,t)}var Kt;Qt?(Zt=gn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Kt=function(t,r){var n;Zt.lastIndex=r;var i=Zt.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}):Kt=function(t,r){for(var n=[];;){var i=En(t,r);if(i===void 0||yn(i)||Ji(i))break;n.push(i),r+=i>=65536?2:1}return Jt.apply(void 0,n)};var Zt,xn=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(r==="plural"||r==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:A.pound,location:x(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(g.UNMATCHED_CLOSING_TAG,x(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&er(this.peek()||0)){var s=this.parseTag(t,r);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,r);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:A.literal,value:"<"+i+"/>",location:x(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,r,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:A.tag,value:i,children:s,location:x(n,this.clonePosition())},err:null}:this.error(g.INVALID_TAG,x(a,this.clonePosition())))}else return this.error(g.UNCLOSED_TAG,x(n,this.clonePosition()))}else return this.error(g.INVALID_TAG,x(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Qi(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var o=this.tryParseQuote(r);if(o){i+=o;continue}var s=this.tryParseUnquoted(t,r);if(s){i+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){i+=a;continue}break}var c=x(n,this.clonePosition());return{val:{type:A.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Zi(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Jt.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Jt(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(g.EMPTY_ARGUMENT,x(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(g.MALFORMED_ARGUMENT,x(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:A.argument,value:i,location:x(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(g.MALFORMED_ARGUMENT,x(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Kt(this.message,r),i=r+n.length;this.bumpTo(i);var o=this.clonePosition(),s=x(t,o);return{value:n,location:s}},e.prototype.parseArgumentOptions=function(t,r,n,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(a){case"":return this.error(g.EXPECT_ARGUMENT_TYPE,x(s,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=zi(p.val);if(f.length===0)return this.error(g.EXPECT_ARGUMENT_STYLE,x(this.clonePosition(),this.clonePosition()));var d=x(u,this.clonePosition());l={style:f,styleLocation:d}}var h=this.tryParseArgumentClose(i);if(h.err)return h;var E=x(i,this.clonePosition());if(l&&hn(l?.style,"::",0)){var S=qi(l.style.slice(2));if(a==="number"){var p=this.parseNumberSkeletonFromString(S,l.styleLocation);return p.err?p:{val:{type:A.number,value:n,location:E,style:p.val},err:null}}else{if(S.length===0)return this.error(g.EXPECT_DATE_TIME_SKELETON,E);var f={type:pe.dateTime,pattern:S,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?rn(S):{}},N=a==="date"?A.date:A.time;return{val:{type:N,value:n,location:E,style:f},err:null}}}return{val:{type:a==="number"?A.number:a==="date"?A.date:A.time,value:n,location:E,style:(o=l?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var P=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS,x(P,T({},P)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),O=0;if(a!=="select"&&b.value==="offset"){if(!this.bumpIf(":"))return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,x(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,g.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),b=this.parseIdentifierIfPossible(),O=p.val}var y=this.tryParsePluralOrSelectOptions(t,a,r,b);if(y.err)return y;var h=this.tryParseArgumentClose(i);if(h.err)return h;var C=x(i,this.clonePosition());return a==="select"?{val:{type:A.select,value:n,options:dn(y.val),location:C},err:null}:{val:{type:A.plural,value:n,options:dn(y.val),offset:O,pluralType:a==="plural"?"cardinal":"ordinal",location:C},err:null}}default:return this.error(g.INVALID_ARGUMENT_TYPE,x(s,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(g.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,x(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=cn(t)}catch{return this.error(g.INVALID_NUMBER_SKELETON,r)}return{val:{type:pe.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?pn(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var o,s=!1,a=[],c=new Set,l=i.value,u=i.location;;){if(l.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_SELECTOR,g.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;u=x(p,this.clonePosition()),l=this.message.slice(p.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?g.DUPLICATE_SELECT_ARGUMENT_SELECTOR:g.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);l==="other"&&(s=!0),this.bumpSpace();var d=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?g.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:g.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,x(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(t+1,r,n);if(h.err)return h;var E=this.tryParseArgumentClose(d);if(E.err)return E;a.push([l,{value:h.val,location:x(d,this.clonePosition())}]),c.add(l),this.bumpSpace(),o=this.parseIdentifierIfPossible(),l=o.value,u=o.location}return a.length===0?this.error(r==="select"?g.EXPECT_SELECT_ARGUMENT_SELECTOR:g.EXPECT_PLURAL_ARGUMENT_SELECTOR,x(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(g.MISSING_OTHER_CLAUSE,x(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var c=x(i,this.clonePosition());return o?(s*=n,$i(s)?{val:s,err:null}:this.error(r,c)):this.error(t,c)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=En(this.message,t);if(r===void 0)throw Error("Offset "+t+" is at invalid UTF-16 code unit boundary");return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(hn(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset "+t+" must be greater than or equal to the current offset "+this.offset());for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset "+t+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&yn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function er(e){return e>=97&&e<=122||e>=65&&e<=90}function Zi(e){return er(e)||e===47}function Qi(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function yn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Ji(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function tr(e){e.forEach(function(t){if(delete t.location,rt(t)||nt(t))for(var r in t.options)delete t.options[r].location,tr(t.options[r].value);else Ke(t)&&ot(t.style)||(et(t)||tt(t))&&Me(t.style)?delete t.style.location:it(t)&&tr(t.children)})}function _n(e,t){t===void 0&&(t={}),t=T({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new xn(e,t).parse();if(r.err){var n=SyntaxError(g[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||tr(r.val),r.val}function ke(e,t){var r=t&&t.cache?t.cache:io,n=t&&t.serializer?t.serializer:no,i=t&&t.strategy?t.strategy:eo;return i(e,{cache:r,serializer:n})}function Ki(e){return e==null||typeof e=="number"||typeof e=="boolean"}function vn(e,t,r,n){var i=Ki(n)?n:r(n),o=t.get(i);return typeof o>"u"&&(o=e.call(this,n),t.set(i,o)),o}function Tn(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,n),t.set(i,o)),o}function rr(e,t,r,n,i){return r.bind(t,e,n,i)}function eo(e,t){var r=e.length===1?vn:Tn;return rr(e,this,r,t.cache.create(),t.serializer)}function to(e,t){return rr(e,this,Tn,t.cache.create(),t.serializer)}function ro(e,t){return rr(e,this,vn,t.cache.create(),t.serializer)}var no=function(){return JSON.stringify(arguments)};function nr(){this.cache=Object.create(null)}nr.prototype.get=function(e){return this.cache[e]};nr.prototype.set=function(e,t){this.cache[e]=t};var io={create:function(){return new nr}},st={variadic:to,monadic:ro};var me;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(me||(me={}));var Ge=function(e){De(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.code=n,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error);var ir=function(e){De(t,e);function t(r,n,i,o){return e.call(this,'Invalid values for "'+r+'": "'+n+'". Options are "'+Object.keys(i).join('", "')+'"',me.INVALID_VALUE,o)||this}return t}(Ge);var bn=function(e){De(t,e);function t(r,n,i){return e.call(this,'Value for "'+r+'" must be of type '+n,me.INVALID_VALUE,i)||this}return t}(Ge);var Sn=function(e){De(t,e);function t(r,n){return e.call(this,'The intl string context variable "'+r+'" was not provided to the string "'+n+'"',me.MISSING_VALUE,n)||this}return t}(Ge);var U;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(U||(U={}));function oo(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==U.literal||r.type!==U.literal?t.push(r):n.value+=r.value,t},[])}function so(e){return typeof e=="function"}function Fe(e,t,r,n,i,o,s){if(e.length===1&&$t(e[0]))return[{type:U.literal,value:e[0].value}];for(var a=[],c=0,l=e;c0?e.substring(0,n):"";let i=wn(e.split("").reverse().join("")),o=r-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,r):"",t.mask=e.substring(n,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(fo);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 mo(e,t,r){let n=!1,i={value:e};e<0&&(n=!0,i.value=-i.value),i.sign=n?"-":"",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,ho(i,t),(i.result==="0"||i.result==="")&&(n=!1,i.sign=""),!n&&t.maskHasPositiveSign?i.sign="+":n&&t.maskHasPositiveSign?i.sign="-":n&&(i.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function ho(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),i=n&&n.indexOf("0");if(i>-1)for(;e.integer.lengthMath.round(e*20)/20},sr=(e,t)=>({accept:e,round:t}),_o=[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={[I.YEAR]:{[L.MONTHLY]:Ve.MONTH,[L.ANNUAL]:Ve.YEAR},[I.MONTH]:{[L.MONTHLY]:Ve.MONTH}},vo=(e,t)=>e.indexOf(`'${t}'`)===0,To=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=Un(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+So(e)),r},bo=e=>{let t=Po(e),r=vo(e,t),n=e.replace(/'.*?'/,""),i=Cn.test(n)||In.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},Rn=e=>e.replace(Cn,Nn).replace(In,Nn),So=e=>e.match(/#(.?)#/)?.[1]===Ln?go:Ln,Po=e=>e.match(/'(.*?)'/)?.[1]??"",Un=e=>e.match(/0(.?)0/)?.[1]??"";function at({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:c}=bo(e),l=r?Un(e):"",u=To(e,r),p=r?2:0,f=o(t,{currencySymbol:s}),d=n?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):On(u,f),h=r?d.lastIndexOf(l):d.length,E=d.substring(0,h),S=d.substring(h+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,d).replace(/SYMBOL/,s),currencySymbol:s,decimals:S,decimalsDelimiter:l,hasCurrencySpace:c,integer:E,isCurrencyFirst:a,recurrenceTerm:i}}var Dn=e=>{let{commitment:t,term:r,usePrecision:n}=e,i=xo[r]??1;return at(e,i>1?Ve.MONTH:ar[t]?.[r],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:n},{round:c}=_o.find(({accept:u})=>u(a));if(!c)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(yo[s]??(u=>u))(c(a))})},Mn=({commitment:e,term:t,...r})=>at(r,ar[e]?.[t]),kn=e=>{let{commitment:t,term:r}=e;return t===I.YEAR&&r===L.MONTHLY?at(e,Ve.YEAR,n=>n*12):at(e,ar[t]?.[r])};var Ao={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}"},wo=Jr("ConsonantTemplates/price"),Oo=/<.+?>/g,W={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"},he={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},Lo="TAX_EXCLUSIVE",No=e=>Zr(e)?Object.entries(e).filter(([,t])=>Te(t)||Ze(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+qr(n)+'"'}`,""):"",z=(e,t,r,n=!1)=>`${n?Rn(t):t??""}`;function Co(e,{accessibleLabel:t,currencySymbol:r,decimals:n,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:c,perUnitLabel:l,taxInclusivityLabel:u},p={}){let f=z(W.currencySymbol,r),d=z(W.currencySpace,o?" ":""),h="";return a&&(h+=f+d),h+=z(W.integer,s),h+=z(W.decimalsDelimiter,i),h+=z(W.decimals,n),a||(h+=d+f),h+=z(W.recurrence,c,null,!0),h+=z(W.unitType,l,null,!0),h+=z(W.taxInclusivity,u,!0),z(e,h,{...p,"aria-label":t})}var de=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:r=!1}={})=>({country:n,displayFormatted:i=!0,displayRecurrence:o=!0,displayPerUnit:s=!1,displayTax:a=!1,language:c,literals:l={}}={},{commitment:u,formatString:p,price:f,priceWithoutDiscount:d,taxDisplay:h,taxTerm:E,term:S,usePrecision:N}={},P={})=>{Object.entries({country:n,formatString:p,language:c,price:f}).forEach(([re,wt])=>{if(wt==null)throw new Error(`Argument "${re}" is missing`)});let b={...Ao,...l},O=`${c.toLowerCase()}-${n.toUpperCase()}`;function y(re,wt){let Ot=b[re];if(Ot==null)return"";try{return new An(Ot.replace(Oo,""),O).format(wt)}catch{return wo.error("Failed to format literal:",Ot),""}}let C=t&&d?d:f,M=e?Dn:Mn;r&&(M=kn);let{accessiblePrice:X,recurrenceTerm:B,...R}=M({commitment:u,formatString:p,term:S,price:e?f:C,usePrecision:N,isIndianPrice:n==="IN"}),j=X,ae="";if(v(o)&&B){let re=y(he.recurrenceAriaLabel,{recurrenceTerm:B});re&&(j+=" "+re),ae=y(he.recurrenceLabel,{recurrenceTerm:B})}let le="";if(v(s)){le=y(he.perUnitLabel,{perUnit:"LICENSE"});let re=y(he.perUnitAriaLabel,{perUnit:"LICENSE"});re&&(j+=" "+re)}let te="";v(a)&&E&&(te=y(h===Lo?he.taxExclusiveLabel:he.taxInclusiveLabel,{taxTerm:E}),te&&(j+=" "+te)),t&&(j=y(he.strikethroughAriaLabel,{strikethroughPrice:j}));let q=W.container;if(e&&(q+=" "+W.containerOptical),t&&(q+=" "+W.containerStrikethrough),r&&(q+=" "+W.containerAnnual),v(i))return Co(q,{...R,accessibleLabel:j,recurrenceLabel:ae,perUnitLabel:le,taxInclusivityLabel:te},P);let{currencySymbol:ye,decimals:He,decimalsDelimiter:Xe,hasCurrencySpace:Ce,integer:At,isCurrencyFirst:ai}=R,_e=[At,Xe,He];ai?(_e.unshift(Ce?"\xA0":""),_e.unshift(ye)):(_e.push(Ce?"\xA0":""),_e.push(ye)),_e.push(ae,le,te);let ci=_e.join("");return z(q,ci,P)},Gn=()=>(e,t,r)=>{let i=(e.displayOldPrice===void 0||v(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${de()(e,t,r)}${i?" "+de({displayStrikethrough:!0})(e,t,r):""}`};var cr=de(),ur=Gn(),lr=de({displayOptical:!0}),fr=de({displayStrikethrough:!0}),pr=de({displayAnnual:!0});var Io=(e,t)=>{if(!(!Se(e)||!Se(t)))return Math.floor((t-e)/t*100)},Fn=()=>(e,t,r)=>{let{price:n,priceWithoutDiscount:i}=t,o=Io(n,i);return o===void 0?'':`${o}%`};var mr=Fn();var hr="ABM",dr="PUF",Er="M2M",gr="PERPETUAL",Vn="P3Y",Ro="TAX_INCLUSIVE_DETAILS",Uo="TAX_EXCLUSIVE",jn={ABM:hr,PUF:dr,M2M:Er,PERPETUAL:gr,P3Y:Vn},tc={[hr]:{commitment:I.YEAR,term:L.MONTHLY},[dr]:{commitment:I.YEAR,term:L.ANNUAL},[Er]:{commitment:I.MONTH,term:L.MONTHLY},[gr]:{commitment:I.PERPETUAL,term:void 0},[Vn]:{commitment:I.THREE_MONTHS,term:L.P3Y}},Wn="Value is not an offer",ct=e=>{if(typeof e!="object")return Wn;let{commitment:t,term:r}=e,n=Do(t,r);return{...e,planType:n}};var Do=(e,t)=>{if(e===void 0)return Wn;if(e===""&&t==="")return"";let r="";return e===I.YEAR?t===L.MONTHLY?r=hr:t===L.ANNUAL&&(r=dr):e===I.MONTH?t===L.MONTHLY&&(r=Er):e===I.PERPETUAL&&(r=gr),r};function xr(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==Ro)return e;let a={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:o??n,taxDisplay:Uo}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var{freeze:Ee}=Object,Z=Ee({...fe}),Q=Ee({...$}),H=Ee({...Y}),yr=Ee({...I}),we=Ee({...Re}),_r=Ee({...jn}),vr=Ee({...L});var Or={};li(Or,{CLASS_NAME_FAILED:()=>ut,CLASS_NAME_PENDING:()=>lt,CLASS_NAME_RESOLVED:()=>ft,ERROR_MESSAGE_BAD_REQUEST:()=>Tr,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>Sr,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>br,EVENT_TYPE_ERROR:()=>Mo,EVENT_TYPE_FAILED:()=>pt,EVENT_TYPE_PENDING:()=>mt,EVENT_TYPE_READY:()=>ge,EVENT_TYPE_RESOLVED:()=>ht,LOG_NAMESPACE:()=>Pr,PARAM_AOS_API_KEY:()=>ko,PARAM_ENV:()=>Ar,PARAM_LANDSCAPE:()=>wr,PARAM_WCS_API_KEY:()=>Go,STATE_FAILED:()=>J,STATE_PENDING:()=>K,STATE_RESOLVED:()=>ee,TAG_NAME_SERVICE:()=>oe});var ut="placeholder-failed",lt="placeholder-pending",ft="placeholder-resolved",Tr="Bad WCS request",br="Commerce offer not found",Sr="Literals URL not provided",Mo="wcms:commerce:error",pt="wcms:placeholder:failed",mt="wcms:placeholder:pending",ge="wcms:commerce:ready",ht="wcms:placeholder:resolved",Pr="wcms/commerce",Ar="commerce.env",wr="commerce.landscape",ko="commerce.aosKey",Go="commerce.wcsKey",J="failed",K="pending",ee="resolved",oe="wcms-commerce";var Lr={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Hn=new Set,Fo=e=>e instanceof Error||typeof e.originatingRequest=="string";function Xn(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:r}=e;return r?`${t} ${r}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:n,originatingRequest:i,status:o}=e;return[n,o,i].filter(s=>s).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!Lr.serializableTypes.includes(r))return r}return e}function Vo(e,t){if(!Lr.ignoredProperties.includes(e))return Xn(t)}var Nr={append(e){let{delimiter:t,sampleRate:r,tags:n,clientId:i}=Lr,{message:o,params:s}=e,a=[],c=o,l=[];s.forEach(f=>{f!=null&&(Fo(f)?a:l).push(f)}),a.length&&(c+=" ",c+=a.map(Xn).join(" "));let{pathname:u,search:p}=window.location;c+=`${t}page=`,c+=u+p,l.length&&(c+=`${t}facts=`,c+=JSON.stringify(l,Vo)),Hn.has(c)||(Hn.add(c),window.lana?.log(c,{sampleRate:r,tags:n,clientId:i}))}};var _=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:Z.V3,checkoutWorkflowStep:Q.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,domainSwitch:!1,env:H.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsEnv:we.PRODUCTION,landscape:G.PUBLISHED,wcsBufferLimit:1});function Bn(e,{once:t=!1}={}){let r=null;function n(){let i=document.querySelector(oe);i!==r&&(r=i,i&&e(i))}return document.addEventListener(ge,n,{once:t}),ue(n),()=>document.removeEventListener(ge,n)}function je(e,{country:t,forceTaxExclusive:r,perpetual:n}){let i;if(e.length<2)i=e;else{let o=t==="GB"||n?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return r&&(i=i.map(xr)),i}var ue=e=>window.setTimeout(e);function Oe(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(Ae).filter(Se);return r.length||(r=[t]),r}function dt(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Xt)}function F(){return window.customElements.get(oe)?.instance}var jo="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"},se=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function Yn({locale:e={}}={}){if(!e.prefix)return{country:_.country,language:_.language,locale:jo};let t=e.prefix.replace("/","")??"",[r=_.country,n=_.language]=(m[t]??t).split("_",2);return r=r.toUpperCase(),n=n.toLowerCase(),{country:r,language:n,locale:`${n}_${r}`}}function Cr(e={}){let{commerce:t={},locale:r=void 0}=e,i=(e.env?.name===se.PROD?se.PROD:ie(w(Ar,t,{metadata:!1}),se,se.PROD))===se.STAGE?H.STAGE:H.PRODUCTION,o=w("checkoutClientId",t)??_.checkoutClientId,s=ie(w("checkoutWorkflow",t),Z,_.checkoutWorkflow),a=Q.CHECKOUT;s===Z.V3&&(a=ie(w("checkoutWorkflowStep",t),Q,_.checkoutWorkflowStep));let c=v(w("displayOldPrice",t),_.displayOldPrice),l=v(w("displayPerUnit",t),_.displayPerUnit),u=v(w("displayRecurrence",t),_.displayRecurrence),p=v(w("displayTax",t),_.displayTax),f=v(w("entitlement",t),_.entitlement),d=v(w("modal",t),_.modal),h=v(w("forceTaxExclusive",t),_.forceTaxExclusive),E=w("promotionCode",t)??_.promotionCode,S=Oe(w("quantity",t)),N=w("wcsApiKey",t)??_.wcsApiKey,P=e.env?.name===se.PROD?G.PUBLISHED:ie(w(wr,t),G,_.landscape),b=Ae(w("wcsBufferDelay",t),_.wcsBufferDelay),O=Ae(w("wcsBufferLimit",t),_.wcsBufferLimit),y=v(w("domain.switch",t),!1);return{...Yn({locale:r}),displayOldPrice:c,checkoutClientId:o,checkoutWorkflow:s,checkoutWorkflowStep:a,displayPerUnit:l,displayRecurrence:u,displayTax:p,entitlement:f,extraOptions:_.extraOptions,modal:d,env:i,forceTaxExclusive:h,priceLiteralsURL:t.priceLiteralsURL,priceLiteralsPromise:t.priceLiteralsPromise,promotionCode:E,quantity:S,wcsApiKey:N,wcsBufferDelay:b,wcsBufferLimit:O,wcsEnv:i===H.STAGE?we.STAGE:we.PRODUCTION,landscape:P,domainSwitch:y}}var qn="debug",Wo="error",Ho="info",Xo="warn",Bo=Date.now(),Ir=new Set,Rr=new Set,$n=new Map,We=Object.freeze({DEBUG:qn,ERROR:Wo,INFO:Ho,WARN:Xo}),zn={append({level:e,message:t,params:r,timestamp:n,source:i}){console[e](`${n}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},Zn={filter:({level:e})=>e!==qn},Yo={filter:()=>!1};function $o(e,t,r,n,i){return{level:e,message:t,namespace:r,get params(){if(n.length===1){let[o]=n;ce(o)&&(n=o(),Array.isArray(n)||(n=[n]))}return n},source:i,timestamp:Date.now()-Bo}}function qo(e){[...Rr].every(t=>t(e))&&Ir.forEach(t=>t(e))}function Qn(e){let t=($n.get(e)??0)+1;$n.set(e,t);let r=`${e} #${t}`,n=o=>(s,...a)=>qo($o(o,s,e,a,r)),i=Object.seal({id:r,namespace:e,module(o){return Qn(`${i.namespace}/${o}`)},debug:n(We.DEBUG),error:n(We.ERROR),info:n(We.INFO),warn:n(We.WARN)});return i}function Et(...e){e.forEach(t=>{let{append:r,filter:n}=t;ce(n)?Rr.add(n):ce(r)&&Ir.add(r)})}function zo(e={}){let{name:t}=e,r=v(w("commerce.debug",{search:!0,storage:!0}),t===se.LOCAL);return Et(r?zn:Zn),t===se.PROD&&Et(Nr),D}function Zo(){Ir.clear(),Rr.clear()}var D={...Qn(Pr),Level:We,Plugins:{consoleAppender:zn,debugFilter:Zn,quietFilter:Yo,lanaAppender:Nr},init:zo,reset:Zo,use:Et};var Qo={CLASS_NAME_FAILED:ut,CLASS_NAME_PENDING:lt,CLASS_NAME_RESOLVED:ft,EVENT_TYPE_FAILED:pt,EVENT_TYPE_PENDING:mt,EVENT_TYPE_RESOLVED:ht,STATE_FAILED:J,STATE_PENDING:K,STATE_RESOLVED:ee},Jo={[J]:ut,[K]:lt,[ee]:ft},Ko={[J]:pt,[K]:mt,[ee]:ht},yt=new WeakMap;function V(e){if(!yt.has(e)){let t=D.module(e.constructor.is);yt.set(e,{changes:new Map,connected:!1,dispose:be,error:void 0,log:t,options:void 0,promises:[],state:K,timer:null,value:void 0,version:0})}return yt.get(e)}function gt(e){let t=V(e),{error:r,promises:n,state:i}=t;(i===ee||i===J)&&(t.promises=[],i===ee?n.forEach(({resolve:o})=>o(e)):i===J&&n.forEach(({reject:o})=>o(r))),e.dispatchEvent(new CustomEvent(Ko[i],{bubbles:!0}))}function xt(e){let t=yt.get(e);[J,K,ee].forEach(r=>{e.classList.toggle(Jo[r],r===t.state)})}var es={get error(){return V(this).error},get log(){return V(this).log},get options(){return V(this).options},get state(){return V(this).state},get value(){return V(this).value},attributeChangedCallback(e,t,r){V(this).changes.set(e,r),this.requestUpdate()},connectedCallback(){V(this).dispose=Bn(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=V(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=be},onceSettled(){let{error:e,promises:t,state:r}=V(this);return ee===r?Promise.resolve(this):J===r?Promise.reject(e):new Promise((n,i)=>{t.push({resolve:n,reject:i})})},toggleResolved(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.state=ee,n.value=t,xt(this),this.log.debug("Resolved:",{element:this,value:t}),ue(()=>gt(this)),!0)},toggleFailed(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.error=t,n.state=J,xt(this),n.log.error("Failed:",{element:this,error:t}),ue(()=>gt(this)),!0)},togglePending(e){let t=V(this);return t.version++,e&&(t.options=e),t.state=K,xt(this),ue(()=>gt(this)),t.version},requestUpdate(e=!1){if(!this.isConnected||!F())return;let t=V(this);if(t.timer)return;let{error:r,options:n,state:i,value:o,version:s}=t;t.state=K,t.timer=ue(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===K&&t.version===s&&(t.state=i,t.error=r,t.value=o,xt(this),gt(this))}catch(c){this.toggleFailed(t.version,c,n)}})}};function Jn(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function _t(e,t={}){let{tag:r,is:n}=e,i=document.createElement(r,{is:n});return i.setAttribute("is",n),Object.assign(i.dataset,Jn(t)),i}function vt(e){let{tag:t,is:r,prototype:n}=e,i=window.customElements.get(r);return i||(Object.defineProperties(n,Object.getOwnPropertyDescriptors(es)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(Qo)),window.customElements.define(r,i,{extends:t})),i}function Tt(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,Jn(t)),e):null}var ts="download",rs="upgrade",xe,Le=class Le extends HTMLAnchorElement{constructor(){super();Fr(this,xe,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(r={},n=""){let i=F();if(!i)return null;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E}=i.collectCheckoutOptions(r),S=_t(Le,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E});return n&&(S.innerHTML=`${n}`),S}static getCheckoutLinks(r){return Tt(Le,r)}get isCheckoutLink(){return!0}get placeholder(){return this}clickHandler(r){var n;(n=Lt(this,xe))==null||n.call(this,r)}async render(r={}){if(!this.isConnected)return!1;let n=F();if(!n)return!1;this.dataset.imsCountry||n.imsCountryPromise.then(u=>{u&&(this.dataset.imsCountry=u)},be);let i=n.collectCheckoutOptions(r,this.placeholder);if(!i.wcsOsi.length)return!1;let o;try{o=JSON.parse(i.extraOptions??"{}")}catch(u){this.placeholder.log.error("cannot parse exta checkout options",u)}let s=this.placeholder.togglePending(i);this.href="";let a=n.resolveOfferSelectors(i),c=await Promise.all(a);c=c.map(u=>je(u,i));let l=await n.buildCheckoutAction(c.flat(),{...o,...i});return this.renderOffers(c.flat(),i,{},l,s)}renderOffers(r,n,i={},o=void 0,s=void 0){if(!this.isConnected)return!1;let a=F();if(!a)return!1;if(n={...JSON.parse(this.placeholder.dataset.extraOptions??"null"),...n,...i},s??(s=this.placeholder.togglePending(n)),Lt(this,xe)&&Nt(this,xe,void 0),o){this.classList.remove(ts,rs),this.placeholder.toggleResolved(s,r,n);let{url:l,text:u,className:p,handler:f}=o;return l&&(this.href=l),u&&(this.firstElementChild.innerHTML=u),p&&this.classList.add(...p.split(" ")),f&&(this.setAttribute("href","#"),Nt(this,xe,f.bind(this))),!0}else if(r.length){if(this.placeholder.toggleResolved(s,r,n)){let l=a.buildCheckoutURL(r,n);return this.setAttribute("href",l),!0}}else{let l=new Error(`Not provided: ${n?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(s,l,n))return this.setAttribute("href","#"),!0}return!1}updateOptions(r={}){let n=F();if(!n)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}=n.collectCheckoutOptions(r);return bt(this,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}),!0}};xe=new WeakMap,ne(Le,"is","checkout-link"),ne(Le,"tag","a");var Ur=Le,St=vt(Ur);var Kn=[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],ns={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]},Ne=class Ne 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 r=F();if(!r)return null;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return _t(Ne,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f})}static getInlinePrices(t){return Tt(Ne,t)}get isInlinePrice(){return!0}get placeholder(){return this}resolveDisplayTaxForGeoAndSegment(t,r,n,i){let o=`${t}_${r}`;if(Kn.includes(t)||Kn.includes(o))return!0;let s=ns[`${n}_${i}`];return s?!!(s.includes(t)||s.includes(o)):!1}async resolveDisplayTax(t,r){let[n]=await t.resolveOfferSelectors(r),i=je(await n,r);if(i?.length){let{country:o,language:s}=r,a=i[0],[c=""]=a.marketSegments;return this.resolveDisplayTaxForGeoAndSegment(o,s,a.customerSegment,c)}}async render(t={}){if(!this.isConnected)return!1;let r=F();if(!r)return!1;let n=r.collectPriceOptions(t,this.placeholder);if(!n.wcsOsi.length)return!1;this.placeholder.dataset.displayTax||(n.displayTax=await this.resolveDisplayTax(r,n)||!1);let i=this.placeholder.togglePending(n);this.innerHTML="";let[o]=r.resolveOfferSelectors(n);return this.renderOffers(je(await o,n),n,i)}renderOffers(t,r={},n=void 0){if(!this.isConnected)return;let i=F();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...r});if(n??(n=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(n,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(n,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let r=F();if(!r)return!1;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return bt(this,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}),!0}};ne(Ne,"is","inline-price"),ne(Ne,"tag","span");var Dr=Ne,Pt=vt(Dr);function ei({providers:e,settings:t},r){let n=D.module("checkout");function i(l,u){let{checkoutClientId:p,checkoutWorkflow:f,checkoutWorkflowStep:d,country:h,language:E,promotionCode:S,quantity:N}=t,{checkoutMarketSegment:P,checkoutWorkflow:b=f,checkoutWorkflowStep:O=d,imsCountry:y,country:C=y??h,language:M=E,quantity:X=N,entitlement:B,upgrade:R,modal:j,perpetual:ae,promotionCode:le=S,wcsOsi:te,extraOptions:q,...ye}=Object.assign({},u?.dataset??{},l??{}),He=ie(b,Z,_.checkoutWorkflow),Xe=Q.CHECKOUT;He===Z.V3&&(Xe=ie(O,Q,_.checkoutWorkflowStep));let Ce=Pe({...ye,extraOptions:q,checkoutClientId:p,checkoutMarketSegment:P,country:C,quantity:Oe(X,_.quantity),checkoutWorkflow:He,checkoutWorkflowStep:Xe,language:M,entitlement:v(B),upgrade:v(R),modal:v(j),perpetual:v(ae),promotionCode:Ue(le).effectivePromoCode,wcsOsi:dt(te)});if(u)for(let At of e.checkout)At(u,Ce);return Ce}async function o(l,u){let p=F(),f=await r.getCheckoutAction?.(l,u,p.imsSignedInPromise);return f||null}function s(l,u){if(!Array.isArray(l)||!l.length||!u)return"";let{env:p,landscape:f}=t,{checkoutClientId:d,checkoutMarketSegment:h,checkoutWorkflow:E,checkoutWorkflowStep:S,country:N,promotionCode:P,quantity:b,...O}=i(u),y=window.frameElement?"if":"fp",C={checkoutPromoCode:P,clientId:d,context:y,country:N,env:p,items:[],marketSegment:h,workflowStep:S,landscape:f,...O};if(l.length===1){let[{offerId:M,offerType:X,productArrangementCode:B}]=l,{marketSegments:[R]}=l[0];Object.assign(C,{marketSegment:R,offerType:X,productArrangementCode:B}),C.items.push(b[0]===1?{id:M}:{id:M,quantity:b[0]})}else C.items.push(...l.map(({offerId:M},X)=>({id:M,quantity:b[X]??_.quantity})));return Mt(E,C)}let{createCheckoutLink:a,getCheckoutLinks:c}=St;return{CheckoutLink:St,CheckoutWorkflow:Z,CheckoutWorkflowStep:Q,buildCheckoutAction:o,buildCheckoutURL:s,collectCheckoutOptions:i,createCheckoutLink:a,getCheckoutLinks:c}}function is({interval:e=200,maxAttempts:t=25}={}){let r=D.module("ims");return new Promise(n=>{r.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?n():++i>t?(r.debug("Timeout"),n()):setTimeout(o,e)}o()})}function os(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function ss(e){let t=D.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:n})=>(t.debug("Got user country:",n),n),n=>{t.error("Unable to get user country:",n)}):null)}function ti({}){let e=is(),t=os(e),r=ss(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}function as(e){if(!e.priceLiteralsURL)throw new Error(Sr);return new Promise(t=>{window.fetch(e.priceLiteralsURL).then(r=>{r.json().then(({data:n})=>{t(n)})})})}async function ri(e){let r=await(e.priceLiteralsPromise||as(e));if(Array.isArray(r)){let n=o=>r.find(s=>ze(s.lang,o)),i=n(e.language)??n(_.language);if(i)return Object.freeze(i)}return{}}function ni({literals:e,providers:t,settings:r}){function n(a,c){let{country:l,displayOldPrice:u,displayPerUnit:p,displayRecurrence:f,displayTax:d,forceTaxExclusive:h,language:E,promotionCode:S,quantity:N}=r,{displayOldPrice:P=u,displayPerUnit:b=p,displayRecurrence:O=f,displayTax:y=d,forceTaxExclusive:C=h,country:M=l,language:X=E,perpetual:B,promotionCode:R=S,quantity:j=N,template:ae,wcsOsi:le,...te}=Object.assign({},c?.dataset??{},a??{}),q=Pe({...te,country:M,displayOldPrice:v(P),displayPerUnit:v(b),displayRecurrence:v(O),displayTax:v(y),forceTaxExclusive:v(C),language:X,perpetual:v(B),promotionCode:Ue(R).effectivePromoCode,quantity:Oe(j,_.quantity),template:ae,wcsOsi:dt(le)});if(c)for(let ye of t.price)ye(c,q);return q}function i(a,c){if(!Array.isArray(a)||!a.length||!c)return"";let{template:l}=c,u;switch(l){case"discount":u=mr;break;case"strikethrough":u=fr;break;case"optical":u=lr;break;case"annual":u=pr;break;default:u=c.promotionCode?ur:cr}let p=n(c);p.literals=Object.assign({},e.price,Pe(c.literals??{}));let[f]=a;return f={...f,...f.priceDetails},u(p,f)}let{createInlinePrice:o,getInlinePrices:s}=Pt;return{InlinePrice:Pt,buildPriceHTML:i,collectPriceOptions:n,createInlinePrice:o,getInlinePrices:s}}var Mr="_acom",ii={[H.PRODUCTION]:"https://wcs.adobe.com",[H.STAGE]:"https://wcs.stage.adobe.com",[H.PRODUCTION+Mr]:"https://www.adobe.com",[H.STAGE+Mr]:"https://www.stage.adobe.com"};function oi({settings:e}){let t=D.module("wcs"),{env:r,domainSwitch:n,wcsApiKey:i}=e,o=n?ii[r+Mr]:ii[r],s={apiKey:i,baseUrl:o,fetch:window.fetch.bind(window)},a=qe(s),c=new Map,l=new Map,u;async function p(h,E,S=!0){let N=br;try{t.debug("Fetching:",h),h.offerSelectorIds=h.offerSelectorIds.sort();let{data:P}=await a(h,{apiKey:i,environment:e.wcsEnv,landscape:r===H.STAGE?"ALL":e.landscape},({resolvedOffers:O})=>({offers:O.map(ct)}));t.debug("Fetched:",h,P);let{offers:b}=P??{};E.forEach(({resolve:O},y)=>{let C=b.filter(({offerSelectorIds:M})=>M.includes(y)).flat();C.length&&(E.delete(y),O(C))})}catch(P){P.status===404&&h.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(h.offerSelectorIds.map(b=>p({...h,offerSelectorIds:[b]},E,!1)))):(t.error("Failed:",h,P),N=Tr)}S&&E.size&&(t.debug("Missing:",{offerSelectorIds:[...E.keys()]}),E.forEach(P=>{P.reject(new Error(N))}))}function f(){clearTimeout(u);let h=[...l.values()];l.clear(),h.forEach(({options:E,promises:S})=>p(E,S))}function d({country:h,language:E,perpetual:S=!1,promotionCode:N="",wcsOsi:P=[]}){let b=`${E}_${h}`;h!=="GB"&&(E=S?"EN":"MULT");let O=[h,E,N].filter(y=>y).join("-").toLowerCase();return P.map(y=>{let C=`${y}-${O}`;if(!c.has(C)){let M=new Promise((X,B)=>{let R=l.get(O);if(!R){let j={country:h,locale:b,offerSelectorIds:[]};h!=="GB"&&(j.language=E),R={options:j,promises:new Map},l.set(O,R)}N&&(R.options.promotionCode=N),R.options.offerSelectorIds.push(y),R.promises.set(y,{resolve:X,reject:B}),R.options.offerSelectorIds.length>=e.wcsBufferLimit?f():(t.debug("Queued:",R.options),u||(u=setTimeout(f,e.wcsBufferDelay)))});c.set(C,M)}return c.get(C)})}return{WcsCommitment:yr,WcsPlanType:_r,WcsTerm:vr,resolveOfferSelectors:d}}var k=class extends HTMLElement{get isWcmsCommerce(){return!0}};ne(k,"instance"),ne(k,"promise",null);window.customElements.define(oe,k);async function cs(e,t){let r=D.init(e.env).module("service");r.debug("Activating:",e);let n={price:{}},i=Object.freeze(Cr(e));try{n.price=await ri(i)}catch(c){r.warn("Price literals were not fetched:",c)}let o={checkout:new Set,price:new Set},s=document.createElement(oe),a={literals:n,providers:o,settings:i};return k.instance=Object.defineProperties(s,Object.getOwnPropertyDescriptors({...ei(a,t),...ti(a),...ni(a),...oi(a),...Or,Log:D,get defaults(){return _},get literals(){return n},get log(){return D},get providers(){return{checkout(c){return o.checkout.add(c),()=>o.checkout.delete(c)},price(c){return o.price.add(c),()=>o.price.delete(c)}}},get settings(){return i}})),r.debug("Activated:",{literals:n,settings:i,element:s}),document.head.append(s),ue(()=>{let c=new CustomEvent(ge,{bubbles:!0,cancelable:!1,detail:k.instance});k.instance.dispatchEvent(c)}),k.instance}function si(){document.head.querySelector(oe)?.remove(),k.promise=null,D.reset()}function us(e,t){if(ce(e)){let r=ce(t)?t():{};return r.force&&si(),k.promise??(k.promise=cs(e(),r))}return k.promise?k.promise:new Promise(r=>{let n=i=>{r(i.detail)};document.head.addEventListener(ge,n,{once:!0})})}export{St as CheckoutLink,Z as CheckoutWorkflow,Q as CheckoutWorkflowStep,_ as Defaults,Pt as InlinePrice,G as Landscape,D as Log,oe as TAG_NAME_SERVICE,yr as WcsCommitment,we as WcsEnv,_r as WcsPlanType,vr as WcsTerm,ct as applyPlanType,Yn as getLocaleSettings,Cr as getSettings,us as init,si as reset}; -//# sourceMappingURL=commerce.js.map + Try polyfilling it using "@formatjs/intl-pluralrules" + `,me.MISSING_INTL_API,s);var O=r.getPluralRules(t,{type:u.pluralType}).select(f-(u.offset||0));b=u.options[O]||u.options.other}if(!b)throw new ir(u.value,f,Object.keys(u.options),s);a.push.apply(a,Fe(b.value,t,r,n,i,f-(u.offset||0)));continue}}return oo(a)}function ao(e,t){return t?T(T(T({},e||{}),t||{}),Object.keys(e).reduce(function(r,n){return r[n]=T(T({},e[n]),t[n]||{}),r},{})):e}function co(e,t){return t?Object.keys(e).reduce(function(r,n){return r[n]=ao(e[n],t[n]),r},T({},e)):e}function or(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function uo(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:ke(function(){for(var t,r=[],n=0;n0?e.substring(0,n):"";let i=wn(e.split("").reverse().join("")),o=r-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,r):"",t.mask=e.substring(n,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(fo);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 mo(e,t,r){let n=!1,i={value:e};e<0&&(n=!0,i.value=-i.value),i.sign=n?"-":"",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,ho(i,t),(i.result==="0"||i.result==="")&&(n=!1,i.sign=""),!n&&t.maskHasPositiveSign?i.sign="+":n&&t.maskHasPositiveSign?i.sign="-":n&&(i.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function ho(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),i=n&&n.indexOf("0");if(i>-1)for(;e.integer.lengthMath.round(e*20)/20},sr=(e,t)=>({accept:e,round:t}),_o=[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={[I.YEAR]:{[L.MONTHLY]:Ve.MONTH,[L.ANNUAL]:Ve.YEAR},[I.MONTH]:{[L.MONTHLY]:Ve.MONTH}},vo=(e,t)=>e.indexOf(`'${t}'`)===0,To=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=Un(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+So(e)),r},bo=e=>{let t=Po(e),r=vo(e,t),n=e.replace(/'.*?'/,""),i=Cn.test(n)||In.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},Rn=e=>e.replace(Cn,Nn).replace(In,Nn),So=e=>e.match(/#(.?)#/)?.[1]===Ln?go:Ln,Po=e=>e.match(/'(.*?)'/)?.[1]??"",Un=e=>e.match(/0(.?)0/)?.[1]??"";function at({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:c}=bo(e),l=r?Un(e):"",u=To(e,r),p=r?2:0,f=o(t,{currencySymbol:s}),d=n?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):On(u,f),h=r?d.lastIndexOf(l):d.length,E=d.substring(0,h),S=d.substring(h+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,d).replace(/SYMBOL/,s),currencySymbol:s,decimals:S,decimalsDelimiter:l,hasCurrencySpace:c,integer:E,isCurrencyFirst:a,recurrenceTerm:i}}var Dn=e=>{let{commitment:t,term:r,usePrecision:n}=e,i=xo[r]??1;return at(e,i>1?Ve.MONTH:ar[t]?.[r],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:n},{round:c}=_o.find(({accept:u})=>u(a));if(!c)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(yo[s]??(u=>u))(c(a))})},Mn=({commitment:e,term:t,...r})=>at(r,ar[e]?.[t]),kn=e=>{let{commitment:t,term:r}=e;return t===I.YEAR&&r===L.MONTHLY?at(e,Ve.YEAR,n=>n*12):at(e,ar[t]?.[r])};var Ao={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}"},wo=Jr("ConsonantTemplates/price"),Oo=/<.+?>/g,W={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"},he={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},Lo="TAX_EXCLUSIVE",No=e=>Zr(e)?Object.entries(e).filter(([,t])=>Te(t)||Ze(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+qr(n)+'"'}`,""):"",z=(e,t,r,n=!1)=>`${n?Rn(t):t??""}`;function Co(e,{accessibleLabel:t,currencySymbol:r,decimals:n,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:c,perUnitLabel:l,taxInclusivityLabel:u},p={}){let f=z(W.currencySymbol,r),d=z(W.currencySpace,o?" ":""),h="";return a&&(h+=f+d),h+=z(W.integer,s),h+=z(W.decimalsDelimiter,i),h+=z(W.decimals,n),a||(h+=d+f),h+=z(W.recurrence,c,null,!0),h+=z(W.unitType,l,null,!0),h+=z(W.taxInclusivity,u,!0),z(e,h,{...p,"aria-label":t})}var de=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:r=!1}={})=>({country:n,displayFormatted:i=!0,displayRecurrence:o=!0,displayPerUnit:s=!1,displayTax:a=!1,language:c,literals:l={}}={},{commitment:u,formatString:p,price:f,priceWithoutDiscount:d,taxDisplay:h,taxTerm:E,term:S,usePrecision:N}={},P={})=>{Object.entries({country:n,formatString:p,language:c,price:f}).forEach(([re,wt])=>{if(wt==null)throw new Error(`Argument "${re}" is missing`)});let b={...Ao,...l},O=`${c.toLowerCase()}-${n.toUpperCase()}`;function y(re,wt){let Ot=b[re];if(Ot==null)return"";try{return new An(Ot.replace(Oo,""),O).format(wt)}catch{return wo.error("Failed to format literal:",Ot),""}}let C=t&&d?d:f,M=e?Dn:Mn;r&&(M=kn);let{accessiblePrice:X,recurrenceTerm:B,...R}=M({commitment:u,formatString:p,term:S,price:e?f:C,usePrecision:N,isIndianPrice:n==="IN"}),j=X,ae="";if(v(o)&&B){let re=y(he.recurrenceAriaLabel,{recurrenceTerm:B});re&&(j+=" "+re),ae=y(he.recurrenceLabel,{recurrenceTerm:B})}let le="";if(v(s)){le=y(he.perUnitLabel,{perUnit:"LICENSE"});let re=y(he.perUnitAriaLabel,{perUnit:"LICENSE"});re&&(j+=" "+re)}let te="";v(a)&&E&&(te=y(h===Lo?he.taxExclusiveLabel:he.taxInclusiveLabel,{taxTerm:E}),te&&(j+=" "+te)),t&&(j=y(he.strikethroughAriaLabel,{strikethroughPrice:j}));let q=W.container;if(e&&(q+=" "+W.containerOptical),t&&(q+=" "+W.containerStrikethrough),r&&(q+=" "+W.containerAnnual),v(i))return Co(q,{...R,accessibleLabel:j,recurrenceLabel:ae,perUnitLabel:le,taxInclusivityLabel:te},P);let{currencySymbol:ye,decimals:He,decimalsDelimiter:Xe,hasCurrencySpace:Ce,integer:At,isCurrencyFirst:ai}=R,_e=[At,Xe,He];ai?(_e.unshift(Ce?"\xA0":""),_e.unshift(ye)):(_e.push(Ce?"\xA0":""),_e.push(ye)),_e.push(ae,le,te);let ci=_e.join("");return z(q,ci,P)},Gn=()=>(e,t,r)=>{let i=(e.displayOldPrice===void 0||v(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${de()(e,t,r)}${i?" "+de({displayStrikethrough:!0})(e,t,r):""}`};var cr=de(),ur=Gn(),lr=de({displayOptical:!0}),fr=de({displayStrikethrough:!0}),pr=de({displayAnnual:!0});var Io=(e,t)=>{if(!(!Se(e)||!Se(t)))return Math.floor((t-e)/t*100)},Fn=()=>(e,t,r)=>{let{price:n,priceWithoutDiscount:i}=t,o=Io(n,i);return o===void 0?'':`${o}%`};var mr=Fn();var hr="ABM",dr="PUF",Er="M2M",gr="PERPETUAL",Vn="P3Y",Ro="TAX_INCLUSIVE_DETAILS",Uo="TAX_EXCLUSIVE",jn={ABM:hr,PUF:dr,M2M:Er,PERPETUAL:gr,P3Y:Vn},tc={[hr]:{commitment:I.YEAR,term:L.MONTHLY},[dr]:{commitment:I.YEAR,term:L.ANNUAL},[Er]:{commitment:I.MONTH,term:L.MONTHLY},[gr]:{commitment:I.PERPETUAL,term:void 0},[Vn]:{commitment:I.THREE_MONTHS,term:L.P3Y}},Wn="Value is not an offer",ct=e=>{if(typeof e!="object")return Wn;let{commitment:t,term:r}=e,n=Do(t,r);return{...e,planType:n}};var Do=(e,t)=>{if(e===void 0)return Wn;if(e===""&&t==="")return"";let r="";return e===I.YEAR?t===L.MONTHLY?r=hr:t===L.ANNUAL&&(r=dr):e===I.MONTH?t===L.MONTHLY&&(r=Er):e===I.PERPETUAL&&(r=gr),r};function xr(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==Ro)return e;let a={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:o??n,taxDisplay:Uo}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var{freeze:Ee}=Object,Z=Ee({...fe}),Q=Ee({...$}),H=Ee({...Y}),yr=Ee({...I}),we=Ee({...Re}),_r=Ee({...jn}),vr=Ee({...L});var Or={};li(Or,{CLASS_NAME_FAILED:()=>ut,CLASS_NAME_PENDING:()=>lt,CLASS_NAME_RESOLVED:()=>ft,ERROR_MESSAGE_BAD_REQUEST:()=>Tr,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>Sr,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>br,EVENT_TYPE_ERROR:()=>Mo,EVENT_TYPE_FAILED:()=>pt,EVENT_TYPE_PENDING:()=>mt,EVENT_TYPE_READY:()=>ge,EVENT_TYPE_RESOLVED:()=>ht,LOG_NAMESPACE:()=>Pr,PARAM_AOS_API_KEY:()=>ko,PARAM_ENV:()=>Ar,PARAM_LANDSCAPE:()=>wr,PARAM_WCS_API_KEY:()=>Go,STATE_FAILED:()=>J,STATE_PENDING:()=>K,STATE_RESOLVED:()=>ee,TAG_NAME_SERVICE:()=>oe});var ut="placeholder-failed",lt="placeholder-pending",ft="placeholder-resolved",Tr="Bad WCS request",br="Commerce offer not found",Sr="Literals URL not provided",Mo="wcms:commerce:error",pt="wcms:placeholder:failed",mt="wcms:placeholder:pending",ge="wcms:commerce:ready",ht="wcms:placeholder:resolved",Pr="wcms/commerce",Ar="commerce.env",wr="commerce.landscape",ko="commerce.aosKey",Go="commerce.wcsKey",J="failed",K="pending",ee="resolved",oe="wcms-commerce";var Lr={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Hn=new Set,Fo=e=>e instanceof Error||typeof e.originatingRequest=="string";function Xn(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:r}=e;return r?`${t} ${r}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:n,originatingRequest:i,status:o}=e;return[n,o,i].filter(s=>s).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!Lr.serializableTypes.includes(r))return r}return e}function Vo(e,t){if(!Lr.ignoredProperties.includes(e))return Xn(t)}var Nr={append(e){let{delimiter:t,sampleRate:r,tags:n,clientId:i}=Lr,{message:o,params:s}=e,a=[],c=o,l=[];s.forEach(f=>{f!=null&&(Fo(f)?a:l).push(f)}),a.length&&(c+=" ",c+=a.map(Xn).join(" "));let{pathname:u,search:p}=window.location;c+=`${t}page=`,c+=u+p,l.length&&(c+=`${t}facts=`,c+=JSON.stringify(l,Vo)),Hn.has(c)||(Hn.add(c),window.lana?.log(c,{sampleRate:r,tags:n,clientId:i}))}};var _=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:Z.V3,checkoutWorkflowStep:Q.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,domainSwitch:!1,env:H.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsEnv:we.PRODUCTION,landscape:G.PUBLISHED,wcsBufferLimit:1});function Bn(e,{once:t=!1}={}){let r=null;function n(){let i=document.querySelector(oe);i!==r&&(r=i,i&&e(i))}return document.addEventListener(ge,n,{once:t}),ue(n),()=>document.removeEventListener(ge,n)}function je(e,{country:t,forceTaxExclusive:r,perpetual:n}){let i;if(e.length<2)i=e;else{let o=t==="GB"||n?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return r&&(i=i.map(xr)),i}var ue=e=>window.setTimeout(e);function Oe(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(Ae).filter(Se);return r.length||(r=[t]),r}function dt(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Xt)}function F(){return window.customElements.get(oe)?.instance}var jo="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"},se=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function Yn({locale:e={}}={}){if(!e.prefix)return{country:_.country,language:_.language,locale:jo};let t=e.prefix.replace("/","")??"",[r=_.country,n=_.language]=(m[t]??t).split("_",2);return r=r.toUpperCase(),n=n.toLowerCase(),{country:r,language:n,locale:`${n}_${r}`}}function Cr(e={}){let{commerce:t={},locale:r=void 0}=e,i=(e.env?.name===se.PROD?se.PROD:ie(w(Ar,t,{metadata:!1}),se,se.PROD))===se.STAGE?H.STAGE:H.PRODUCTION,o=w("checkoutClientId",t)??_.checkoutClientId,s=ie(w("checkoutWorkflow",t),Z,_.checkoutWorkflow),a=Q.CHECKOUT;s===Z.V3&&(a=ie(w("checkoutWorkflowStep",t),Q,_.checkoutWorkflowStep));let c=v(w("displayOldPrice",t),_.displayOldPrice),l=v(w("displayPerUnit",t),_.displayPerUnit),u=v(w("displayRecurrence",t),_.displayRecurrence),p=v(w("displayTax",t),_.displayTax),f=v(w("entitlement",t),_.entitlement),d=v(w("modal",t),_.modal),h=v(w("forceTaxExclusive",t),_.forceTaxExclusive),E=w("promotionCode",t)??_.promotionCode,S=Oe(w("quantity",t)),N=w("wcsApiKey",t)??_.wcsApiKey,P=e.env?.name===se.PROD?G.PUBLISHED:ie(w(wr,t),G,_.landscape),b=Ae(w("wcsBufferDelay",t),_.wcsBufferDelay),O=Ae(w("wcsBufferLimit",t),_.wcsBufferLimit),y=v(w("domain.switch",t),!1);return{...Yn({locale:r}),displayOldPrice:c,checkoutClientId:o,checkoutWorkflow:s,checkoutWorkflowStep:a,displayPerUnit:l,displayRecurrence:u,displayTax:p,entitlement:f,extraOptions:_.extraOptions,modal:d,env:i,forceTaxExclusive:h,priceLiteralsURL:t.priceLiteralsURL,priceLiteralsPromise:t.priceLiteralsPromise,promotionCode:E,quantity:S,wcsApiKey:N,wcsBufferDelay:b,wcsBufferLimit:O,wcsEnv:i===H.STAGE?we.STAGE:we.PRODUCTION,landscape:P,domainSwitch:y}}var qn="debug",Wo="error",Ho="info",Xo="warn",Bo=Date.now(),Ir=new Set,Rr=new Set,$n=new Map,We=Object.freeze({DEBUG:qn,ERROR:Wo,INFO:Ho,WARN:Xo}),zn={append({level:e,message:t,params:r,timestamp:n,source:i}){console[e](`${n}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},Zn={filter:({level:e})=>e!==qn},Yo={filter:()=>!1};function $o(e,t,r,n,i){return{level:e,message:t,namespace:r,get params(){if(n.length===1){let[o]=n;ce(o)&&(n=o(),Array.isArray(n)||(n=[n]))}return n},source:i,timestamp:Date.now()-Bo}}function qo(e){[...Rr].every(t=>t(e))&&Ir.forEach(t=>t(e))}function Qn(e){let t=($n.get(e)??0)+1;$n.set(e,t);let r=`${e} #${t}`,n=o=>(s,...a)=>qo($o(o,s,e,a,r)),i=Object.seal({id:r,namespace:e,module(o){return Qn(`${i.namespace}/${o}`)},debug:n(We.DEBUG),error:n(We.ERROR),info:n(We.INFO),warn:n(We.WARN)});return i}function Et(...e){e.forEach(t=>{let{append:r,filter:n}=t;ce(n)?Rr.add(n):ce(r)&&Ir.add(r)})}function zo(e={}){let{name:t}=e,r=v(w("commerce.debug",{search:!0,storage:!0}),t===se.LOCAL);return Et(r?zn:Zn),t===se.PROD&&Et(Nr),D}function Zo(){Ir.clear(),Rr.clear()}var D={...Qn(Pr),Level:We,Plugins:{consoleAppender:zn,debugFilter:Zn,quietFilter:Yo,lanaAppender:Nr},init:zo,reset:Zo,use:Et};var Qo={CLASS_NAME_FAILED:ut,CLASS_NAME_PENDING:lt,CLASS_NAME_RESOLVED:ft,EVENT_TYPE_FAILED:pt,EVENT_TYPE_PENDING:mt,EVENT_TYPE_RESOLVED:ht,STATE_FAILED:J,STATE_PENDING:K,STATE_RESOLVED:ee},Jo={[J]:ut,[K]:lt,[ee]:ft},Ko={[J]:pt,[K]:mt,[ee]:ht},yt=new WeakMap;function V(e){if(!yt.has(e)){let t=D.module(e.constructor.is);yt.set(e,{changes:new Map,connected:!1,dispose:be,error:void 0,log:t,options:void 0,promises:[],state:K,timer:null,value:void 0,version:0})}return yt.get(e)}function gt(e){let t=V(e),{error:r,promises:n,state:i}=t;(i===ee||i===J)&&(t.promises=[],i===ee?n.forEach(({resolve:o})=>o(e)):i===J&&n.forEach(({reject:o})=>o(r))),e.dispatchEvent(new CustomEvent(Ko[i],{bubbles:!0}))}function xt(e){let t=yt.get(e);[J,K,ee].forEach(r=>{e.classList.toggle(Jo[r],r===t.state)})}var es={get error(){return V(this).error},get log(){return V(this).log},get options(){return V(this).options},get state(){return V(this).state},get value(){return V(this).value},attributeChangedCallback(e,t,r){V(this).changes.set(e,r),this.requestUpdate()},connectedCallback(){V(this).dispose=Bn(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=V(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=be},onceSettled(){let{error:e,promises:t,state:r}=V(this);return ee===r?Promise.resolve(this):J===r?Promise.reject(e):new Promise((n,i)=>{t.push({resolve:n,reject:i})})},toggleResolved(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.state=ee,n.value=t,xt(this),this.log.debug("Resolved:",{element:this,value:t}),ue(()=>gt(this)),!0)},toggleFailed(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.error=t,n.state=J,xt(this),n.log.error("Failed:",{element:this,error:t}),ue(()=>gt(this)),!0)},togglePending(e){let t=V(this);return t.version++,e&&(t.options=e),t.state=K,xt(this),ue(()=>gt(this)),t.version},requestUpdate(e=!1){if(!this.isConnected||!F())return;let t=V(this);if(t.timer)return;let{error:r,options:n,state:i,value:o,version:s}=t;t.state=K,t.timer=ue(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===K&&t.version===s&&(t.state=i,t.error=r,t.value=o,xt(this),gt(this))}catch(c){this.toggleFailed(t.version,c,n)}})}};function Jn(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function _t(e,t={}){let{tag:r,is:n}=e,i=document.createElement(r,{is:n});return i.setAttribute("is",n),Object.assign(i.dataset,Jn(t)),i}function vt(e){let{tag:t,is:r,prototype:n}=e,i=window.customElements.get(r);return i||(Object.defineProperties(n,Object.getOwnPropertyDescriptors(es)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(Qo)),window.customElements.define(r,i,{extends:t})),i}function Tt(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,Jn(t)),e):null}var ts="download",rs="upgrade",xe,Le=class Le extends HTMLAnchorElement{constructor(){super();Fr(this,xe,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(r={},n=""){let i=F();if(!i)return null;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E}=i.collectCheckoutOptions(r),S=_t(Le,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E});return n&&(S.innerHTML=`${n}`),S}static getCheckoutLinks(r){return Tt(Le,r)}get isCheckoutLink(){return!0}get placeholder(){return this}clickHandler(r){var n;(n=Lt(this,xe))==null||n.call(this,r)}async render(r={}){if(!this.isConnected)return!1;let n=F();if(!n)return!1;this.dataset.imsCountry||n.imsCountryPromise.then(u=>{u&&(this.dataset.imsCountry=u)},be);let i=n.collectCheckoutOptions(r,this.placeholder);if(!i.wcsOsi.length)return!1;let o;try{o=JSON.parse(i.extraOptions??"{}")}catch(u){this.placeholder.log.error("cannot parse exta checkout options",u)}let s=this.placeholder.togglePending(i);this.href="";let a=n.resolveOfferSelectors(i),c=await Promise.all(a);c=c.map(u=>je(u,i));let l=await n.buildCheckoutAction(c.flat(),{...o,...i});return this.renderOffers(c.flat(),i,{},l,s)}renderOffers(r,n,i={},o=void 0,s=void 0){if(!this.isConnected)return!1;let a=F();if(!a)return!1;if(n={...JSON.parse(this.placeholder.dataset.extraOptions??"null"),...n,...i},s??(s=this.placeholder.togglePending(n)),Lt(this,xe)&&Nt(this,xe,void 0),o){this.classList.remove(ts,rs),this.placeholder.toggleResolved(s,r,n);let{url:l,text:u,className:p,handler:f}=o;return l&&(this.href=l),u&&(this.firstElementChild.innerHTML=u),p&&this.classList.add(...p.split(" ")),f&&(this.setAttribute("href","#"),Nt(this,xe,f.bind(this))),!0}else if(r.length){if(this.placeholder.toggleResolved(s,r,n)){let l=a.buildCheckoutURL(r,n);return this.setAttribute("href",l),!0}}else{let l=new Error(`Not provided: ${n?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(s,l,n))return this.setAttribute("href","#"),!0}return!1}updateOptions(r={}){let n=F();if(!n)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}=n.collectCheckoutOptions(r);return bt(this,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}),!0}};xe=new WeakMap,ne(Le,"is","checkout-link"),ne(Le,"tag","a");var Ur=Le,St=vt(Ur);var Kn=[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],ns={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]},Ne=class Ne 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 r=F();if(!r)return null;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return _t(Ne,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f})}static getInlinePrices(t){return Tt(Ne,t)}get isInlinePrice(){return!0}get placeholder(){return this}resolveDisplayTaxForGeoAndSegment(t,r,n,i){let o=`${t}_${r}`;if(Kn.includes(t)||Kn.includes(o))return!0;let s=ns[`${n}_${i}`];return s?!!(s.includes(t)||s.includes(o)):!1}async resolveDisplayTax(t,r){let[n]=await t.resolveOfferSelectors(r),i=je(await n,r);if(i?.length){let{country:o,language:s}=r,a=i[0],[c=""]=a.marketSegments;return this.resolveDisplayTaxForGeoAndSegment(o,s,a.customerSegment,c)}}async render(t={}){if(!this.isConnected)return!1;let r=F();if(!r)return!1;let n=r.collectPriceOptions(t,this.placeholder);if(!n.wcsOsi.length)return!1;let i=this.placeholder.togglePending(n);this.innerHTML="";let[o]=r.resolveOfferSelectors(n);return this.renderOffers(je(await o,n),n,i)}renderOffers(t,r={},n=void 0){if(!this.isConnected)return;let i=F();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...r});if(n??(n=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(n,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(n,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let r=F();if(!r)return!1;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return bt(this,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}),!0}};ne(Ne,"is","inline-price"),ne(Ne,"tag","span");var Dr=Ne,Pt=vt(Dr);function ei({providers:e,settings:t},r){let n=D.module("checkout");function i(l,u){let{checkoutClientId:p,checkoutWorkflow:f,checkoutWorkflowStep:d,country:h,language:E,promotionCode:S,quantity:N}=t,{checkoutMarketSegment:P,checkoutWorkflow:b=f,checkoutWorkflowStep:O=d,imsCountry:y,country:C=y??h,language:M=E,quantity:X=N,entitlement:B,upgrade:R,modal:j,perpetual:ae,promotionCode:le=S,wcsOsi:te,extraOptions:q,...ye}=Object.assign({},u?.dataset??{},l??{}),He=ie(b,Z,_.checkoutWorkflow),Xe=Q.CHECKOUT;He===Z.V3&&(Xe=ie(O,Q,_.checkoutWorkflowStep));let Ce=Pe({...ye,extraOptions:q,checkoutClientId:p,checkoutMarketSegment:P,country:C,quantity:Oe(X,_.quantity),checkoutWorkflow:He,checkoutWorkflowStep:Xe,language:M,entitlement:v(B),upgrade:v(R),modal:v(j),perpetual:v(ae),promotionCode:Ue(le).effectivePromoCode,wcsOsi:dt(te)});if(u)for(let At of e.checkout)At(u,Ce);return Ce}async function o(l,u){let p=F(),f=await r.getCheckoutAction?.(l,u,p.imsSignedInPromise);return f||null}function s(l,u){if(!Array.isArray(l)||!l.length||!u)return"";let{env:p,landscape:f}=t,{checkoutClientId:d,checkoutMarketSegment:h,checkoutWorkflow:E,checkoutWorkflowStep:S,country:N,promotionCode:P,quantity:b,...O}=i(u),y=window.frameElement?"if":"fp",C={checkoutPromoCode:P,clientId:d,context:y,country:N,env:p,items:[],marketSegment:h,workflowStep:S,landscape:f,...O};if(l.length===1){let[{offerId:M,offerType:X,productArrangementCode:B}]=l,{marketSegments:[R]}=l[0];Object.assign(C,{marketSegment:R,offerType:X,productArrangementCode:B}),C.items.push(b[0]===1?{id:M}:{id:M,quantity:b[0]})}else C.items.push(...l.map(({offerId:M},X)=>({id:M,quantity:b[X]??_.quantity})));return Mt(E,C)}let{createCheckoutLink:a,getCheckoutLinks:c}=St;return{CheckoutLink:St,CheckoutWorkflow:Z,CheckoutWorkflowStep:Q,buildCheckoutAction:o,buildCheckoutURL:s,collectCheckoutOptions:i,createCheckoutLink:a,getCheckoutLinks:c}}function is({interval:e=200,maxAttempts:t=25}={}){let r=D.module("ims");return new Promise(n=>{r.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?n():++i>t?(r.debug("Timeout"),n()):setTimeout(o,e)}o()})}function os(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function ss(e){let t=D.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:n})=>(t.debug("Got user country:",n),n),n=>{t.error("Unable to get user country:",n)}):null)}function ti({}){let e=is(),t=os(e),r=ss(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}function as(e){if(!e.priceLiteralsURL)throw new Error(Sr);return new Promise(t=>{window.fetch(e.priceLiteralsURL).then(r=>{r.json().then(({data:n})=>{t(n)})})})}async function ri(e){let r=await(e.priceLiteralsPromise||as(e));if(Array.isArray(r)){let n=o=>r.find(s=>ze(s.lang,o)),i=n(e.language)??n(_.language);if(i)return Object.freeze(i)}return{}}function ni({literals:e,providers:t,settings:r}){function n(a,c){let{country:l,displayOldPrice:u,displayPerUnit:p,displayRecurrence:f,displayTax:d,forceTaxExclusive:h,language:E,promotionCode:S,quantity:N}=r,{displayOldPrice:P=u,displayPerUnit:b=p,displayRecurrence:O=f,displayTax:y=d,forceTaxExclusive:C=h,country:M=l,language:X=E,perpetual:B,promotionCode:R=S,quantity:j=N,template:ae,wcsOsi:le,...te}=Object.assign({},c?.dataset??{},a??{}),q=Pe({...te,country:M,displayOldPrice:v(P),displayPerUnit:v(b),displayRecurrence:v(O),displayTax:v(y),forceTaxExclusive:v(C),language:X,perpetual:v(B),promotionCode:Ue(R).effectivePromoCode,quantity:Oe(j,_.quantity),template:ae,wcsOsi:dt(le)});if(c)for(let ye of t.price)ye(c,q);return q}function i(a,c){if(!Array.isArray(a)||!a.length||!c)return"";let{template:l}=c,u;switch(l){case"discount":u=mr;break;case"strikethrough":u=fr;break;case"optical":u=lr;break;case"annual":u=pr;break;default:u=c.promotionCode?ur:cr}let p=n(c);p.literals=Object.assign({},e.price,Pe(c.literals??{}));let[f]=a;return f={...f,...f.priceDetails},u(p,f)}let{createInlinePrice:o,getInlinePrices:s}=Pt;return{InlinePrice:Pt,buildPriceHTML:i,collectPriceOptions:n,createInlinePrice:o,getInlinePrices:s}}var Mr="_acom",ii={[H.PRODUCTION]:"https://wcs.adobe.com",[H.STAGE]:"https://wcs.stage.adobe.com",[H.PRODUCTION+Mr]:"https://www.adobe.com",[H.STAGE+Mr]:"https://www.stage.adobe.com"};function oi({settings:e}){let t=D.module("wcs"),{env:r,domainSwitch:n,wcsApiKey:i}=e,o=n?ii[r+Mr]:ii[r],s={apiKey:i,baseUrl:o,fetch:window.fetch.bind(window)},a=qe(s),c=new Map,l=new Map,u;async function p(h,E,S=!0){let N=br;try{t.debug("Fetching:",h),h.offerSelectorIds=h.offerSelectorIds.sort();let{data:P}=await a(h,{apiKey:i,environment:e.wcsEnv,landscape:r===H.STAGE?"ALL":e.landscape},({resolvedOffers:O})=>({offers:O.map(ct)}));t.debug("Fetched:",h,P);let{offers:b}=P??{};E.forEach(({resolve:O},y)=>{let C=b.filter(({offerSelectorIds:M})=>M.includes(y)).flat();C.length&&(E.delete(y),O(C))})}catch(P){P.status===404&&h.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(h.offerSelectorIds.map(b=>p({...h,offerSelectorIds:[b]},E,!1)))):(t.error("Failed:",h,P),N=Tr)}S&&E.size&&(t.debug("Missing:",{offerSelectorIds:[...E.keys()]}),E.forEach(P=>{P.reject(new Error(N))}))}function f(){clearTimeout(u);let h=[...l.values()];l.clear(),h.forEach(({options:E,promises:S})=>p(E,S))}function d({country:h,language:E,perpetual:S=!1,promotionCode:N="",wcsOsi:P=[]}){let b=`${E}_${h}`;h!=="GB"&&(E=S?"EN":"MULT");let O=[h,E,N].filter(y=>y).join("-").toLowerCase();return P.map(y=>{let C=`${y}-${O}`;if(!c.has(C)){let M=new Promise((X,B)=>{let R=l.get(O);if(!R){let j={country:h,locale:b,offerSelectorIds:[]};h!=="GB"&&(j.language=E),R={options:j,promises:new Map},l.set(O,R)}N&&(R.options.promotionCode=N),R.options.offerSelectorIds.push(y),R.promises.set(y,{resolve:X,reject:B}),R.options.offerSelectorIds.length>=e.wcsBufferLimit?f():(t.debug("Queued:",R.options),u||(u=setTimeout(f,e.wcsBufferDelay)))});c.set(C,M)}return c.get(C)})}return{WcsCommitment:yr,WcsPlanType:_r,WcsTerm:vr,resolveOfferSelectors:d}}var k=class extends HTMLElement{get isWcmsCommerce(){return!0}};ne(k,"instance"),ne(k,"promise",null);window.customElements.define(oe,k);async function cs(e,t){let r=D.init(e.env).module("service");r.debug("Activating:",e);let n={price:{}},i=Object.freeze(Cr(e));try{n.price=await ri(i)}catch(c){r.warn("Price literals were not fetched:",c)}let o={checkout:new Set,price:new Set},s=document.createElement(oe),a={literals:n,providers:o,settings:i};return k.instance=Object.defineProperties(s,Object.getOwnPropertyDescriptors({...ei(a,t),...ti(a),...ni(a),...oi(a),...Or,Log:D,get defaults(){return _},get literals(){return n},get log(){return D},get providers(){return{checkout(c){return o.checkout.add(c),()=>o.checkout.delete(c)},price(c){return o.price.add(c),()=>o.price.delete(c)}}},get settings(){return i}})),r.debug("Activated:",{literals:n,settings:i,element:s}),document.head.append(s),ue(()=>{let c=new CustomEvent(ge,{bubbles:!0,cancelable:!1,detail:k.instance});k.instance.dispatchEvent(c)}),k.instance}function si(){document.head.querySelector(oe)?.remove(),k.promise=null,D.reset()}function us(e,t){if(ce(e)){let r=ce(t)?t():{};return r.force&&si(),k.promise??(k.promise=cs(e(),r))}return k.promise?k.promise:new Promise(r=>{let n=i=>{r(i.detail)};document.head.addEventListener(ge,n,{once:!0})})}export{St as CheckoutLink,Z as CheckoutWorkflow,Q as CheckoutWorkflowStep,_ as Defaults,Pt as InlinePrice,G as Landscape,D as Log,oe as TAG_NAME_SERVICE,yr as WcsCommitment,we as WcsEnv,_r as WcsPlanType,vr as WcsTerm,ct as applyPlanType,Yn as getLocaleSettings,Cr as getSettings,us as init,si as reset}; + //# sourceMappingURL=commerce.js.map + \ No newline at end of file