PageSourceSearch

https://www.nespresso.com/_ui/generated/crema/vendor.intl-messageformat.ebb1cac529257660b474.js

js nespresso.com collected 2026-09-24 08:27:26 UTC 9,669 bytes, 1 lines download raw bytes

1(window.webpackJsonpCrema=window.webpackJsonpCrema||[]).push([[55],{164:function(module,exports,__webpack_require__){"use strict";exports.extend=function(obj){var i,len,source,key,sources=Array.prototype.slice.call(arguments,1);for(i=0,len=sources.length;i<len;i+=1)if(source=sources[i])for(key in source)hop.call(source,key)&&(obj[key]=source[key]);return obj};var hop=Object.prototype.hasOwnProperty;exports.hop=hop},270:function(module,exports,__webpack_require__){"use strict";var src$core$$=__webpack_require__(271),src$en$$=__webpack_require__(276);src$core$$.default.__addLocaleData(src$en$$.default),src$core$$.default.defaultLocale="en",exports.default=src$core$$.default},271:function(module,exports,__webpack_require__){"use strict";var src$utils$$=__webpack_require__(164),src$es5$$=__webpack_require__(272),src$compiler$$=__webpack_require__(273),intl$messageformat$parser$$=__webpack_require__(274);function MessageFormat(message,locales,formats){var ast="string"==typeof message?MessageFormat.__parse(message):message;if(!ast||"messageFormatPattern"!==ast.type)throw new TypeError("A message must be provided as a String or AST.");formats=this._mergeFormats(MessageFormat.formats,formats),src$es5$$.defineProperty(this,"_locale",{value:this._resolveLocale(locales)});var pluralFn=this._findPluralRuleFunction(this._locale),pattern=this._compilePattern(ast,locales,formats,pluralFn),messageFormat=this;this.format=function(values){try{return messageFormat._format(pattern,values)}catch(e){throw e.variableId?new Error("The intl string context variable '"+e.variableId+"' was not provided to the string '"+message+"'"):e}}}exports.default=MessageFormat,src$es5$$.defineProperty(MessageFormat,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),src$es5$$.defineProperty(MessageFormat,"__localeData__",{value:src$es5$$.objCreate(null)}),src$es5$$.defineProperty(MessageFormat,"__addLocaleData",{value:function(data){if(!data||!data.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");MessageFormat.__localeData__[data.locale.toLowerCase()]=data}}),src$es5$$.defineProperty(MessageFormat,"__parse",{value:intl$messageformat$parser$$.default.parse}),src$es5$$.defineProperty(MessageFormat,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),MessageFormat.prototype.resolvedOptions=function(){return{locale:this._locale}},MessageFormat.prototype._compilePattern=function(ast,locales,formats,pluralFn){return new src$compiler$$.default(locales,formats,pluralFn).compile(ast)},MessageFormat.prototype._findPluralRuleFunction=function(locale){for(var localeData=MessageFormat.__localeData__,data=localeData[locale.toLowerCase()];data;){if(data.pluralRuleFunction)return data.pluralRuleFunction;data=data.parentLocale&&localeData[data.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+locale)},MessageFormat.prototype._format=function(pattern,values){var i,len,part,id,value,err,result="";for(i=0,len=pattern.length;i<len;i+=1)if("string"!=typeof(part=pattern[i])){if(id=part.id,!values||!src$utils$$.hop.call(values,id))throw(err=new Error("A value must be provided for: "+id)).variableId=id,err;value=values[id],part.options?result+=this._format(part.getOption(value),values):result+=part.format(value)}else result+=part;return result},MessageFormat.prototype._mergeFormats=function(defaults,formats){var type,mergedType,mergedFormats={};for(type in defaults)src$utils$$.hop.call(defaults,type)&&(mergedFormats[type]=mergedType=src$es5$$.objCreate(defaults[type]),formats&&src$utils$$.hop.call(formats,type)&&src$utils$$.extend(mergedType,formats[type]));return mergedFormats},MessageFormat.prototype._resolveLocale=function(locales){"string"==typeof locales&&(locales=[locales]),locales=(locales||[]).concat(MessageFormat.defaultLocale);var i,len,localeParts,data,localeData=MessageFormat.__localeData__;for(i=0,len=locales.length;i<len;i+=1)for(localeParts=locales[i].toLowerCase().split("-");localeParts.length;){if(data=localeData[localeParts.join("-")])return data.locale;localeParts.pop()}var defaultLocale=locales.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+locales.join(", ")+", or the default locale: "+defaultLocale)}},272:function(module,exports,__webpack_require__){"use strict";var src$utils$$=__webpack_require__(164),realDefineProp=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),defineProperty=(!realDefineProp&&Object.prototype.__defineGetter__,realDefineProp?Object.defineProperty:function(obj,name,desc){"get"in desc&&obj.__defineGetter__?obj.__defineGetter__(name,desc.get):src$utils$$.hop.call(obj,name)&&!("value"in desc)||(obj[name]=desc.value)}),objCreate=Object.create||function(proto,props){var obj,k;function F(){}for(k in F.prototype=proto,obj=new F,props)src$utils$$.hop.call(props,k)&&defineProperty(obj,k,props[k]);return obj};exports.defineProperty=defineProperty,exports.objCreate=objCreate},273:function(module,exports,__webpack_require__){"use strict";function Compiler(locales,formats,pluralFn){this.locales=locales,this.formats=formats,this.pluralFn=pluralFn}function StringFormat(id){this.id=id}function PluralFormat(id,useOrdinal,offset,options,pluralFn){this.id=id,this.useOrdinal=useOrdinal,this.offset=offset,this.options=options,this.pluralFn=pluralFn}function PluralOffsetString(id,offset,numberFormat,string){this.id=id,this.offset=offset,this.numberFormat=numberFormat,this.string=string}function SelectFormat(id,options){this.id=id,this.options=options}exports.default=Compiler,Compiler.prototype.compile=function(ast){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(
vendor: 3,372 bytes, line 1
1ast)},Compiler.prototype.compileMessage=function(ast){if(!ast||"messageFormatPattern"!==ast.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var i,len,element,elements=ast.elements,pattern=[];for(i=0,len=elements.length;i<len;i+=1)switch((element=elements[i]).type){case"messageTextElement":pattern.push(this.compileMessageText(element));break;case"argumentElement":pattern.push(this.compileArgument(element));break;default:throw new Error("Message element does not have a valid type")}return pattern},Compiler.prototype.compileMessageText=function(element){return this.currentPlural&&/(^|[^\\])#/g.test(element.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new PluralOffsetString(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,element.value)):element.value.replace(/\\#/g,"#")},Compiler.prototype.compileArgument=function(element){var format=element.format;if(!format)return new StringFormat(element.id);var options,formats=this.formats,locales=this.locales,pluralFn=this.pluralFn;switch(format.type){case"numberFormat":return options=formats.number[format.style],{id:element.id,format:new Intl.NumberFormat(locales,options).format};case"dateFormat":return options=formats.date[format.style],{id:element.id,format:new Intl.DateTimeFormat(locales,options).format};case"timeFormat":return options=formats.time[format.style],{id:element.id,format:new Intl.DateTimeFormat(locales,options).format};case"pluralFormat":return options=this.compileOptions(element),new PluralFormat(element.id,format.ordinal,format.offset,options,pluralFn);case"selectFormat":return options=this.compileOptions(element),new SelectFormat(element.id,options);default:throw new Error("Message element does not have a valid format type")}},Compiler.prototype.compileOptions=function(element){var i,len,option,format=element.format,options=format.options,optionsHash={};for(this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===format.type?element:null,i=0,len=options.length;i<len;i+=1)optionsHash[(option=options[i]).selector]=this.compileMessage(option.value);return this.currentPlural=this.pluralStack.pop(),optionsHash},StringFormat.prototype.format=function(value){return value||"number"==typeof value?"string"==typeof value?value:String(value):""},PluralFormat.prototype.getOption=function(value){var options=this.options;return options["="+value]||options[this.pluralFn(value-this.offset,this.useOrdinal)]||options.other},PluralOffsetString.prototype.format=function(value){var number=this.numberFormat.format(value-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+number).replace(/\\#/g,"#")},SelectFormat.prototype.getOption=function(value){var options=this.options;return options[value]||options.other}},276:function(module,exports,__webpack_require__){"use strict";exports.default={locale:"en",pluralRuleFunction:function(n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);return ord?1==n10&&11!=n100?"one":2==n10&&12!=n100?"two":3==n10&&13!=n100?"few":"other":1==n&&v0?"one":"other"}}},41:function(module,exports,__webpack_require__){"use strict";var IntlMessageFormat=__webpack_require__(270).default;__webpack_require__(277),(exports=module.exports=IntlMessageFormat).default=exports}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.