WordPress/wp-includes/js/dist/i18n.min.js

5 lines
19 KiB
JavaScript
Raw Normal View History

this.wp=this.wp||{},this.wp.i18n=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=351)}({351:function(t,e,r){"use strict";r.r(e),r.d(e,"setLocaleData",function(){return c}),r.d(e,"__",function(){return h}),r.d(e,"_x",function(){return p}),r.d(e,"_n",function(){return f}),r.d(e,"_nx",function(){return d}),r.d(e,"sprintf",function(){return g});var n,i=r(92),s=r.n(i),o=r(44),l=r.n(o),a=l()(console.error);function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{"":{}},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";n||(n=new s.a({domain:"default",locale_data:{default:{"":{}}}})),n.options.locale_data[e]=Object.assign({},n.options.locale_data[e],t)}var u=l()(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;try{return(n||c(),n).dcnpgettext(t,e,r,i,s)}catch(t){return a("Jed localization error: \n\n"+t.toString()),r}});function h(t,e){return u(e,void 0,t)}function p(t,e,r){return u(r,e,t)}function f(t,e,r,n){return u(n,void 0,t,e,r)}function d(t,e,r,n,i){return u(i,n,t,e,r)}function g(t){try{for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return s.a.sprintf.apply(s.a,[t].concat(r))}catch(e){return a("Jed sprintf error: \n\n"+e.toString()),t}}},44:function(t,e,r){t.exports=function(t,e){var r,n,i,s=0;function o(){var e,o,l=n,a=arguments.length;t:for(;l;){if(l.args.length===arguments.length){for(o=0;o<a;o++)if(l.args[o]!==arguments[o]){l=l.next;continue t}return l!==n&&(l===i&&(i=l.prev),l.prev.next=l.next,l.next&&(l.next.prev=l.prev),l.next=n,l.prev=null,n.prev=l,n=l),l.val}l=l.next}for(e=new Array(a),o=0;o<a;o++)e[o]=arguments[o];return l={args:e,val:t.apply(null,e)},n?(n.prev=l,l.next=n):i=l,s===r?(i=i.prev).next=null:s++,n=l,l.val}return e&&e.maxSize&&(r=e.maxSize),o.clear=function(){n=null,i=null,s=0},o}},92:function(t,e,r){
/**
* @preserve jed.js https://github.com/SlexAxton/Jed
*/
!function(r,n){var i=Array.prototype,s=Object.prototype,o=i.slice,l=s.hasOwnProperty,a=i.forEach,c={},u={forEach:function(t,e,r){var n,i,s;if(null!==t)if(a&&t.forEach===a)t.forEach(e,r);else if(t.length===+t.length){for(n=0,i=t.length;n<i;n++)if(n in t&&e.call(r,t[n],n,t)===c)return}else for(s in t)if(l.call(t,s)&&e.call(r,t[s],s,t)===c)return},extend:function(t){return this.forEach(o.call(arguments,1),function(e){for(var r in e)t[r]=e[r]}),t}},h=function(t){if(this.defaults={locale_data:{messages:{"":{domain:"messages",lang:"en",plural_forms:"nplurals=2; plural=(n != 1);"}}},domain:"messages",debug:!1},this.options=u.extend({},this.defaults,t),this.textdomain(this.options.domain),t.domain&&!this.options.locale_data[this.options.domain])throw new Error("Text domain set to non-existent domain: `"+t.domain+"`")};function p(t){return h.PF.compile(t||"nplurals=2; plural=(n != 1);")}function f(t,e){this._key=t,this._i18n=e}h.context_delimiter=String.fromCharCode(4),u.extend(f.prototype,{onDomain:function(t){return this._domain=t,this},withContext:function(t){return this._context=t,this},ifPlural:function(t,e){return this._val=t,this._pkey=e,this},fetch:function(t){return"[object Array]"!={}.toString.call(t)&&(t=[].slice.call(arguments,0)),(t&&t.length?h.sprintf:function(t){return t})(this._i18n.dcnpgettext(this._domain,this._context,this._key,this._pkey,this._val),t)}}),u.extend(h.prototype,{translate:function(t){return new f(t,this)},textdomain:function(t){if(!t)return this._textdomain;this._textdomain=t},gettext:function(t){return this.dcnpgettext.call(this,void 0,void 0,t)},dgettext:function(t,e){return this.dcnpgettext.call(this,t,void 0,e)},dcgettext:function(t,e){return this.dcnpgettext.call(this,t,void 0,e)},ngettext:function(t,e,r){return this.dcnpgettext.call(this,void 0,void 0,t,e,r)},dngettext:function(t,e,r,n){return this.dcnpgettext.call(this,t,void 0,e,r,n)},dcngettext:function(t,e,r,n){return this.dcnpgettext.call(this,t,void 0,e,r,n)},pgettext:function(t,e){return this.dcnpgettext.call(this,void 0,t,e)},dpgettext:function(t,e,r){return this.dcnpgettext.call(this,t,e,r)},dcpgettext:function(t,e,r){return this.dcnpgettext.call(this,t,e,r)},npgettext:function(t,e,r,n){return this.dcnpgettext.call(this,void 0,t,e,r,n)},dnpgettext:function(t,e,r,n,i){return this.dcnpgettext.call(this,t,e,r,n,i)},dcnpgettext:function(t,e,r,n,i){var s;if(n=n||r,t=t||this._textdomain,!this.options)return(s=new h).dcnpgettext.call(s,void 0,void 0,r,n,i);if(!this.options.locale_data)throw new Error("No locale data provided.");if(!this.options.locale_data[t])throw new Error("Domain `"+t+"` was not found.");if(!this.options.locale_data[t][""])throw new Error("No locale meta information provided.");if(!r)throw new Error("No translation key found.");var o,l,a,c=e?e+h.context_delimiter+r:r,u=this.options.locale_data,f=u[t],d=(u.messages||this.defaults.locale_data.messages)[""],g=f[""].plural_forms||f[""]["Plural-Forms"]||f[""]["plural-forms"]||d.plural_forms||d["Plural-Forms"]||d["plural-forms"];if(void 0===i)a=0;else{if("number"!=typeof i&&(i=parseInt(i,10),isNaN(i)))throw new Error("The number that was passed in is not a number.");a=p(g)(i)}if(!f)throw new Error("No domain named `"+t+"` could be found.");return!(o=f[c])||a>o.length?(this.options.missing_key_callback&&this.options.missing_key_callback(c,t),l=[r,n],!0===this.options.debug&&console.log(l[p(g)(i)]),l[p()(i)]):(l=o[a])||(l=[r,n])[p()(i)]}});var d=function(){function t(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function e(t,e){for(var r=[];e>0;r[--e]=t);return r.join("")}var r=function(){return r.cache.hasOwnProperty(arguments[0])||(r.cache[arguments[0]]=r.parse(arguments[0])),r.format.call(null,r.cache[arguments[0]],arguments)};return r.format=function(r,n){var i,s,o,l,a,c,u,h=1,p=r.length,f="",g=[];for(s=0;s<p;s++)if("string"===(f=t(r[s])))g.push(r[s]);else if("array"===f){if((l=r[s])[2])for(i=n[h],o=0;o<l[2].length;o++){if(!i.hasOwnProperty(l[2][o]))throw d('[sprintf] property "%s" does not exist',l[2][o]);i=i[l[2][o]]}else i=l[1]?n[l[1]]:n[h++];if