import{p}from"./@tannin/plural-forms.js";var u={contextDelimiter:"",onMissingKey:null};function f(o){var n,r,t;for(n=o.split(";"),r=0;r<n.length;r++)if(t=n[r].trim(),t.indexOf("plural=")===0)return t.substr(7)}function a(o,n){var r;this.data=o,this.pluralForms={},this.options={};for(r in u)this.options[r]=n!==void 0&&r in n?n[r]:u[r]}a.prototype.getPluralForm=function(o,n){var r=this.pluralForms[o],t,s,i;return r||(t=this.data[o][""],i=t["Plural-Forms"]||t["plural-forms"]||t.plural_forms,typeof i!="function"&&(s=f(t["Plural-Forms"]||t["plural-forms"]||t.plural_forms),i=p(s)),r=this.pluralForms[o]=i),r(n)};a.prototype.dcnpgettext=function(o,n,r,t,s){var i,l,e;return s===void 0?i=0:i=this.getPluralForm(o,s),l=r,n&&(l=n+this.options.contextDelimiter+r),e=this.data[o][l],e&&e[i]?e[i]:(this.options.onMissingKey&&this.options.onMissingKey(r,o),i===0?r:t)};export{a as T};
