bible-ref-parse 3.2.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/am-bcv-parser.js +191 -32
- package/dist/am-bcv-parser.min.js +1 -1
- package/dist/ar-bcv-parser.js +191 -32
- package/dist/ar-bcv-parser.min.js +2 -2
- package/dist/bb-bcv-parser.js +191 -32
- package/dist/bb-bcv-parser.min.js +2 -2
- package/dist/bg-bcv-parser.js +191 -32
- package/dist/bg-bcv-parser.min.js +2 -2
- package/dist/bn-bcv-parser.js +191 -32
- package/dist/bn-bcv-parser.min.js +2 -2
- package/dist/ceb-bcv-parser.js +191 -32
- package/dist/ceb-bcv-parser.min.js +2 -2
- package/dist/cs-bcv-parser.js +191 -32
- package/dist/cs-bcv-parser.min.js +2 -2
- package/dist/da-bcv-parser.js +191 -32
- package/dist/da-bcv-parser.min.js +2 -2
- package/dist/de-bcv-parser.js +191 -32
- package/dist/de-bcv-parser.min.js +2 -2
- package/dist/ee-bcv-parser.js +191 -32
- package/dist/ee-bcv-parser.min.js +3 -3
- package/dist/el-bcv-parser.js +191 -32
- package/dist/el-bcv-parser.min.js +1 -1
- package/dist/en-bcv-parser.js +122 -11
- package/dist/en-bcv-parser.min.js +2 -2
- package/dist/es-bcv-parser.js +191 -32
- package/dist/es-bcv-parser.min.js +2 -2
- package/dist/fa-bcv-parser.js +191 -32
- package/dist/fa-bcv-parser.min.js +3 -3
- package/dist/fi-bcv-parser.js +191 -32
- package/dist/fi-bcv-parser.min.js +2 -2
- package/dist/fr-bcv-parser.js +191 -32
- package/dist/fr-bcv-parser.min.js +3 -3
- package/dist/he-bcv-parser.js +191 -32
- package/dist/he-bcv-parser.min.js +1 -1
- package/dist/hi-bcv-parser.js +191 -32
- package/dist/hi-bcv-parser.min.js +2 -2
- package/dist/hl-bcv-parser.js +191 -32
- package/dist/hl-bcv-parser.min.js +2 -2
- package/dist/hr-bcv-parser.js +191 -32
- package/dist/hr-bcv-parser.min.js +2 -2
- package/dist/ht-bcv-parser.js +191 -32
- package/dist/ht-bcv-parser.min.js +2 -2
- package/dist/hu-bcv-parser.js +191 -32
- package/dist/hu-bcv-parser.min.js +2 -2
- package/dist/id-bcv-parser.js +191 -32
- package/dist/id-bcv-parser.min.js +2 -2
- package/dist/il-bcv-parser.js +189 -30
- package/dist/il-bcv-parser.min.js +2 -2
- package/dist/is-bcv-parser.js +191 -32
- package/dist/is-bcv-parser.min.js +2 -2
- package/dist/it-bcv-parser.js +191 -32
- package/dist/it-bcv-parser.min.js +3 -3
- package/dist/ja-bcv-parser.js +191 -32
- package/dist/ja-bcv-parser.min.js +3 -3
- package/dist/jv-bcv-parser.js +191 -32
- package/dist/jv-bcv-parser.min.js +2 -2
- package/dist/ko-bcv-parser.js +191 -32
- package/dist/ko-bcv-parser.min.js +2 -2
- package/dist/la-bcv-parser.js +191 -32
- package/dist/la-bcv-parser.min.js +2 -2
- package/dist/lu-bcv-parser.js +191 -32
- package/dist/lu-bcv-parser.min.js +2 -2
- package/dist/mg-bcv-parser.js +191 -32
- package/dist/mg-bcv-parser.min.js +3 -3
- package/dist/mk-bcv-parser.js +191 -32
- package/dist/mk-bcv-parser.min.js +2 -2
- package/dist/mq-bcv-parser.js +191 -32
- package/dist/mq-bcv-parser.min.js +2 -2
- package/dist/mr-bcv-parser.js +191 -32
- package/dist/mr-bcv-parser.min.js +2 -2
- package/dist/nd-bcv-parser.js +191 -32
- package/dist/nd-bcv-parser.min.js +2 -2
- package/dist/ne-bcv-parser.js +191 -32
- package/dist/ne-bcv-parser.min.js +2 -2
- package/dist/nl-bcv-parser.js +191 -32
- package/dist/nl-bcv-parser.min.js +3 -3
- package/dist/no-bcv-parser.js +191 -32
- package/dist/no-bcv-parser.min.js +2 -2
- package/dist/ny-bcv-parser.js +191 -32
- package/dist/ny-bcv-parser.min.js +2 -2
- package/dist/or-bcv-parser.js +191 -32
- package/dist/or-bcv-parser.min.js +2 -2
- package/dist/pa-bcv-parser.js +191 -32
- package/dist/pa-bcv-parser.min.js +2 -2
- package/dist/pl-bcv-parser.js +191 -32
- package/dist/pl-bcv-parser.min.js +2 -2
- package/dist/pt-bcv-parser.js +191 -32
- package/dist/pt-bcv-parser.min.js +3 -3
- package/dist/ro-bcv-parser.js +191 -32
- package/dist/ro-bcv-parser.min.js +2 -2
- package/dist/ru-bcv-parser.js +191 -32
- package/dist/ru-bcv-parser.min.js +2 -2
- package/dist/rw-bcv-parser.js +191 -32
- package/dist/rw-bcv-parser.min.js +3 -3
- package/dist/si-bcv-parser.js +191 -32
- package/dist/si-bcv-parser.min.js +2 -2
- package/dist/sk-bcv-parser.js +191 -32
- package/dist/sk-bcv-parser.min.js +3 -3
- package/dist/so-bcv-parser.js +191 -32
- package/dist/so-bcv-parser.min.js +2 -2
- package/dist/sq-bcv-parser.js +191 -32
- package/dist/sq-bcv-parser.min.js +2 -2
- package/dist/sr-bcv-parser.js +191 -32
- package/dist/sr-bcv-parser.min.js +2 -2
- package/dist/sv-bcv-parser.js +191 -32
- package/dist/sv-bcv-parser.min.js +2 -2
- package/dist/sw-bcv-parser.js +191 -32
- package/dist/sw-bcv-parser.min.js +2 -2
- package/dist/ta-bcv-parser.js +191 -32
- package/dist/ta-bcv-parser.min.js +2 -2
- package/dist/test/en.spec.js +7 -0
- package/dist/th-bcv-parser.js +191 -32
- package/dist/th-bcv-parser.min.js +2 -2
- package/dist/tl-bcv-parser.js +191 -32
- package/dist/tl-bcv-parser.min.js +2 -2
- package/dist/tr-bcv-parser.js +191 -32
- package/dist/tr-bcv-parser.min.js +2 -2
- package/dist/uk-bcv-parser.js +191 -32
- package/dist/uk-bcv-parser.min.js +2 -2
- package/dist/ur-bcv-parser.js +191 -32
- package/dist/ur-bcv-parser.min.js +2 -2
- package/dist/vi-bcv-parser.js +191 -32
- package/dist/vi-bcv-parser.min.js +1 -1
- package/dist/zh-bcv-parser.js +191 -32
- package/dist/zh-bcv-parser.min.js +3 -3
- package/dist/zu-bcv-parser.js +191 -32
- package/dist/zu-bcv-parser.min.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const root=this;class bcv_parser{static initClass(){this.prototype.s="",this.prototype.entities=[],this.prototype.passage=null,this.prototype.regexps={},this.prototype.options={consecutive_combination_strategy:"combine",osis_compaction_strategy:"b",book_sequence_strategy:"ignore",invalid_sequence_strategy:"ignore",sequence_combination_strategy:"combine",punctuation_strategy:"us",invalid_passage_strategy:"ignore",non_latin_digits_strategy:"ignore",passage_existence_strategy:"bcv",zero_chapter_strategy:"error",zero_verse_strategy:"error",single_chapter_1_strategy:"chapter",book_alone_strategy:"ignore",book_range_strategy:"ignore",captive_end_digits_strategy:"delete",end_range_digits_strategy:"verse",include_apocrypha:!1,ps151_strategy:"c",versification_system:"default",case_sensitive:"none"}}constructor(){for(var e of(this.options={},Object.keys(bcv_parser.prototype.options||{}))){var s=bcv_parser.prototype.options[e];this.options[e]=s}this.versification_system(this.options.versification_system)}parse(e){return this.reset(),this.s=e,e=this.replace_control_characters(e),[e,this.passage.books]=Array.from(this.match_books(e)),[this.entities]=Array.from(this.match_passages(e)),this}parse_with_context(e,s){let a;return this.reset(),[s,this.passage.books]=Array.from(this.match_books(this.replace_control_characters(s))),[a,s]=Array.from(this.match_passages(s)),this.reset(),this.s=e,e=this.replace_control_characters(e),[e,this.passage.books]=Array.from(this.match_books(e)),this.passage.books.push({value:"",parsed:[],start_index:0,type:"context",context:s}),e=""+(this.passage.books.length-1)+"/9"+e,[this.entities]=Array.from(this.match_passages(e)),this}reset(){return this.s="",this.entities=[],this.passage?(this.passage.books=[],this.passage.indices={}):(this.passage=new bcv_passage,this.passage.options=this.options,this.passage.translations=this.translations)}set_options(e){for(var s of Object.keys(e||{})){var a=e[s];"include_apocrypha"===s||"versification_system"===s||"case_sensitive"===s?this[s](a):this.options[s]=a}return this}include_apocrypha(e){if(null==e||!0!==e&&!1!==e)return this;for(var s of(this.options.include_apocrypha=e,this.regexps.books=this.regexps.get_books(e,this.options.case_sensitive),Object.keys(this.translations||{}))){var a;if("aliases"!==s&&"alternates"!==s)if(null==this.translations[s].chapters&&(this.translations[s].chapters={}),null==this.translations[s].chapters.Ps&&(this.translations[s].chapters.Ps=bcv_utils.shallow_clone_array(this.translations.default.chapters.Ps)),!0===e)a=null!=this.translations[s].chapters.Ps151?this.translations[s].chapters.Ps151[0]:this.translations.default.chapters.Ps151[0],this.translations[s].chapters.Ps[150]=a;else 151===this.translations[s].chapters.Ps.length&&this.translations[s].chapters.Ps.pop()}return this}versification_system(e){let s,a;if(null==e||null==this.translations[e])return this;if(null!=this.translations.alternates.default)if("default"===e)for(s of(null!=this.translations.alternates.default.order&&(this.translations.default.order=bcv_utils.shallow_clone(this.translations.alternates.default.order)),Object.keys(this.translations.alternates.default.chapters||{})))a=this.translations.alternates.default.chapters[s],this.translations.default.chapters[s]=bcv_utils.shallow_clone_array(a);else this.versification_system("default");if(null==this.translations.alternates.default&&(this.translations.alternates.default={order:null,chapters:{}}),"default"!==e&&null!=this.translations[e].order&&(null==this.translations.alternates.default.order&&(this.translations.alternates.default.order=bcv_utils.shallow_clone(this.translations.default.order)),this.translations.default.order=bcv_utils.shallow_clone(this.translations[e].order)),"default"!==e&&null!=this.translations[e].chapters)for(s of Object.keys(this.translations[e].chapters||{}))a=this.translations[e].chapters[s],null==this.translations.alternates.default.chapters[s]&&(this.translations.alternates.default.chapters[s]=bcv_utils.shallow_clone_array(this.translations.default.chapters[s])),this.translations.default.chapters[s]=bcv_utils.shallow_clone_array(a);return this.options.versification_system=e,this.include_apocrypha(this.options.include_apocrypha),this}case_sensitive(e){return null==e||"none"!==e&&"books"!==e||e===this.options.case_sensitive||(this.options.case_sensitive=e,this.regexps.books=this.regexps.get_books(this.options.include_apocrypha,e)),this}translation_info(e){let s;null==e&&(e="default"),null!=e&&null!=(null!=this.translations.aliases[e]?this.translations.aliases[e].alias:void 0)&&(e=this.translations.aliases[e].alias),null!=e&&null!=this.translations[e]||(e="default");const a=this.options.versification_system;e!==a&&this.versification_system(e);const t={alias:e,books:[],chapters:{},order:bcv_utils.shallow_clone(this.translations.default.order)};for(s of Object.keys(this.translations.default.chapters||{})){var r=this.translations.default.chapters[s];t.chapters[s]=bcv_utils.shallow_clone_array(r)}for(s of Object.keys(t.order||{})){var n=t.order[s];t.books[n-1]=s}return e!==a&&this.versification_system(a),t}replace_control_characters(e){return e=(e=(e=e.replace(this.regexps.control," ")).replace(/\uFF1A/g,":")).replace(/\uFF1B/g,";"),"replace"===this.options.non_latin_digits_strategy&&(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/[٠۰߀०০੦૦୦0౦೦൦๐໐༠၀႐០᠐᥆᧐᪀᪐᭐᮰᱀᱐꘠꣐꤀꧐꩐꯰0]/g,"0")).replace(/[١۱߁१১੧૧୧௧౧೧൧๑໑༡၁႑១᠑᥇᧑᪁᪑᭑᮱᱁᱑꘡꣑꤁꧑꩑꯱1]/g,"1")).replace(/[٢۲߂२২੨૨୨௨౨೨൨๒໒༢၂႒២᠒᥈᧒᪂᪒᭒᮲᱂᱒꘢꣒꤂꧒꩒꯲2]/g,"2")).replace(/[٣۳߃३৩੩૩୩௩౩೩൩๓໓༣၃႓៣᠓᥉᧓᪃᪓᭓᮳᱃᱓꘣꣓꤃꧓꩓꯳3]/g,"3")).replace(/[٤۴߄४৪੪૪୪௪౪೪൪๔໔༤၄႔៤᠔᥊᧔᪄᪔᭔᮴᱄᱔꘤꣔꤄꧔꩔꯴4]/g,"4")).replace(/[٥۵߅५৫੫૫୫௫౫೫൫๕໕༥၅႕៥᠕᥋᧕᪅᪕᭕᮵᱅᱕꘥꣕꤅꧕꩕꯵5]/g,"5")).replace(/[٦۶߆६৬੬૬୬௬౬೬൬๖໖༦၆႖៦᠖᥌᧖᪆᪖᭖᮶᱆᱖꘦꣖꤆꧖꩖꯶6]/g,"6")).replace(/[٧۷߇७৭੭૭୭௭౭೭൭๗໗༧၇႗៧᠗᥍᧗᪇᪗᭗᮷᱇᱗꘧꣗꤇꧗꩗꯷7]/g,"7")).replace(/[٨۸߈८৮੮૮୮௮౮೮൮๘໘༨၈႘៨᠘᥎᧘᪈᪘᭘᮸᱈᱘꘨꣘꤈꧘꩘꯸8]/g,"8")).replace(/[٩۹߉९৯੯૯୯௯౯೯൯๙໙༩၉႙៩᠙᥏᧙᪉᪙᭙᮹᱉᱙꘩꣙꤉꧙꩙꯹9]/g,"9")),e}match_books(e){const s=[];for(var a of Array.from(this.regexps.books)){var t=!1;if(e=e.replace(a.regexp,(function(e,r,n){t=!0,s.push({value:n,parsed:a.osis,type:"book"});const i=null!=a.extra?`/${a.extra}`:"";return`${r}${s.length-1}${i}`})),!0===t&&/^[\s\x1f\d:.,;\-\u2013\u2014]+$/.test(e))break}return[e=e.replace(this.regexps.translations,(function(e){return s.push({value:e,parsed:e.toLowerCase(),type:"translation"}),`${s.length-1}`})),this.get_book_indices(s,e)]}get_book_indices(e,s){let a,t=0;const r=new RegExp("([\\x1f\\x1e])(\\d+)(?:/\\d+)?\\1","g");for(;a=r.exec(s);)e[a[2]].start_index=a.index+t,t+=e[a[2]].value.length-a[0].length;return e}match_passages(e){let s,a=[],t={};for(;s=this.regexps.escaped_passage.exec(e);){let x;var[r,n,i]=Array.from(s),o=n.length;if(s.index+=r.length-o,/\s[2-9]\d\d\s*$|\s\d{4,}\s*$/.test(n)&&(n=n.replace(/\s+\d+\s*$/,"")),/[\d\x1f\x1e)]$/.test(n)||(n=this.replace_match_end(n)),"delete"===this.options.captive_end_digits_strategy){var l=s.index+n.length;e.length>l&&/^\w/.test(e.substr(l,1))&&(n=n.replace(/[\s*]+\d+$/,"")),n=n.replace(/(\x1e[)\]]?)[\s*]*\d+$/,"$1")}var u=""===(n=n.replace(/[A-Z]+/g,(e=>e.toLowerCase()))).substr(0,1)?0:n.split("")[0].length,c={value:grammar.parse(n,{punctuation_strategy:this.options.punctuation_strategy}),type:"base",start_index:this.passage.books[i].start_index-u,match:n};"full"===this.options.book_alone_strategy&&"include"===this.options.book_range_strategy&&"b"===c.value[0].type&&(1===c.value.length||c.value.length>1&&"translation_sequence"===c.value[1].type)&&0===u&&(1===this.passage.books[i].parsed.length||this.passage.books[i].parsed.length>1&&"translation"===this.passage.books[i].parsed[1].type)&&/^[234]/.test(this.passage.books[i].parsed[0])&&this.create_book_range(e,c,i),[x,t]=Array.from(this.passage.handle_obj(c)),a=a.concat(x);var p=this.adjust_regexp_end(x,o,n.length);p>0&&(this.regexps.escaped_passage.lastIndex-=p)}return[a,t]}adjust_regexp_end(e,s,a){let t=0;return e.length>0?t=s-e[e.length-1].indices[1]-1:s!==a&&(t=s-a),t}replace_match_end(e){let s,a=e.length;for(;s=this.regexps.match_end_split.exec(e);)a=s.index+s[0].length;return a<e.length&&(e=e.substr(0,a)),e}create_book_range(e,s,a){const t=[bcv_parser.prototype.regexps.first,bcv_parser.prototype.regexps.second,bcv_parser.prototype.regexps.third],r=parseInt(this.passage.books[a].parsed[0].substr(0,1),10);for(let o=1,l=r,u=1<=l;u?o<l:o>l;u?o++:o--){var n=o===r-1?bcv_parser.prototype.regexps.range_and:bcv_parser.prototype.regexps.range_only,i=e.match(new RegExp(`(?:^|\\W)(${t[o-1]}\\s*${n}\\s*)\\x1f${a}\\x1f`,"i"));if(null!=i)return this.add_book_range_object(s,i,o)}return!1}add_book_range_object(e,s,a){const{length:t}=s[1];if(e.value[0]={type:"b_range_pre",value:[{type:"b_pre",value:a.toString(),indices:[s.index,s.index+t]},e.value[0]],indices:[0,e.value[0].indices[1]+t]},e.value[0].value[1].indices[0]+=t,e.value[0].value[1].indices[1]+=t,e.start_index-=t,e.match=s[1]+e.match,1!==e.value.length)return(()=>{const s=[];for(let a=1,r=e.value.length,n=1<=r;n?a<r:a>r;n?a++:a--)null!=e.value[a].value&&(null!=(null!=e.value[a].value[0]?e.value[a].value[0].indices:void 0)&&(e.value[a].value[0].indices[0]+=t,e.value[a].value[0].indices[1]+=t),e.value[a].indices[0]+=t,s.push(e.value[a].indices[1]+=t));return s})()}osis(){const e=[];for(var s of Array.from(this.parsed_entities()))s.osis.length>0&&e.push(s.osis);return e.join(",")}osis_and_translations(){const e=[];for(var s of Array.from(this.parsed_entities()))s.osis.length>0&&e.push([s.osis,s.translations.join(",")]);return e}osis_and_indices(){const e=[];for(var s of Array.from(this.parsed_entities()))s.osis.length>0&&e.push({osis:s.osis,translations:s.translations,indices:s.indices});return e}parsed_entities(){let e=[];for(let E=0,A=this.entities.length,S=0<=A;S?E<A:E>A;S?E++:E--){var s=this.entities[E];if(s.type&&"translation_sequence"===s.type&&e.length>0&&E===e[e.length-1].entity_id+1&&(e[e.length-1].indices[1]=s.absolute_indices[1]),null!=s.passages&&!("b"===s.type&&"ignore"===this.options.book_alone_strategy||"b_range"===s.type&&"ignore"===this.options.book_range_strategy||"context"===s.type)){var a=[],t=null;if(null!=s.passages[0].translations)for(var r of Array.from(s.passages[0].translations)){var n=(null!=r.osis?r.osis.length:void 0)>0?r.osis:"";null==t&&(t=r.alias),a.push(n)}else a=[""],t="default";for(var i=[],o=[],{length:l}=s.passages,u=0,c=u,p=l,x=0<=p;x?u<p:u>p;x?u++:u--,c=u){var g,h,_=s.passages[c];if(null==_.type&&(_.type=s.type),!1!==_.valid.valid||("ignore"===this.options.invalid_sequence_strategy&&"sequence"===s.type&&this.snap_sequence("ignore",s,i,c,l),"ignore"!==this.options.invalid_passage_strategy))if("b"!==_.type&&"b_range"!==_.type||"ignore"!==this.options.book_sequence_strategy||"sequence"!==s.type)if("b_range_start"!==_.type&&"range_end_b"!==_.type||"ignore"!==this.options.book_range_strategy||this.snap_range(s,c),null==_.absolute_indices&&(_.absolute_indices=s.absolute_indices),"separate-chapters"===this.options.consecutive_combination_strategy&&_.start.c!==_.end.c)for(c=_.start.c,h=_.end.c,g=_.start.c<=h;g?c<=h:c>=h;g?c++:c--){var v=c===_.start.c?_.start.v:1,f=c===_.end.c?_.end.v:this.translations[t].chapters[_.start.b][c-1],d={b:_.start.b,c:c,v:"bcv"===_.start.type?v:null,type:_.start.type},b={b:_.end.b,c:c,v:"bcv"===_.start.type?f:null,type:_.start.type};o.push({osis:_.valid.valid?this.to_osis(d,b,t):"",type:_.type,indices:_.absolute_indices,translations:a,start:d,end:b,enclosed_indices:_.enclosed_absolute_indices,entity_id:E,entities:[_]})}else i.push({osis:_.valid.valid?this.to_osis(_.start,_.end,t):"",type:_.type,indices:_.absolute_indices,translations:a,start:_.start,end:_.end,enclosed_indices:_.enclosed_absolute_indices,entity_id:E,entities:[_]});else this.snap_sequence("book",s,i,c,l)}if(0!==i.length||0!==o.length)if("combine"!==this.options.consecutive_combination_strategy&&"separate-chapters"!==this.options.consecutive_combination_strategy||(i.length>1&&(i=this.combine_consecutive_passages(i,t)),i=i.concat(o).sort(((e,s)=>e.indices[0]-s.indices[0]))),"separate"===this.options.sequence_combination_strategy)e=e.concat(i);else{var y,k=[],m=i.length-1;for(y of(null!=i[m].enclosed_indices&&i[m].enclosed_indices[1]>=0&&(s.absolute_indices[1]=i[m].enclosed_indices[1]),Array.from(i)))y.osis.length>0&&k.push(y.osis);e.push({osis:k.join(","),indices:s.absolute_indices,translations:a,entity_id:E,entities:i})}}}return e}to_osis(e,s,a){let t;null==s.c&&null==s.v&&e.b===s.b&&null==e.c&&null==e.v&&"first_chapter"===this.options.book_alone_strategy&&(s.c=1);const r={start:"",end:""};return null==e.c&&(e.c=1),null==e.v&&(e.v=1),null==s.c&&(this.options.passage_existence_strategy.indexOf("c")>=0||null!=this.passage.translations[a].chapters[s.b]&&1===this.passage.translations[a].chapters[s.b].length?s.c=this.passage.translations[a].chapters[s.b].length:s.c=999),null==s.v&&(null!=this.passage.translations[a].chapters[s.b][s.c-1]&&this.options.passage_existence_strategy.indexOf("v")>=0?s.v=this.passage.translations[a].chapters[s.b][s.c-1]:s.v=999),this.options.include_apocrypha&&"b"===this.options.ps151_strategy&&(151===e.c&&"Ps"===e.b||151===s.c&&"Ps"===s.b)&&this.fix_ps151(e,s,a),"b"===this.options.osis_compaction_strategy&&1===e.c&&1===e.v&&(999===s.c&&999===s.v||s.c===this.passage.translations[a].chapters[s.b].length&&this.options.passage_existence_strategy.indexOf("c")>=0&&(999===s.v||s.v===this.passage.translations[a].chapters[s.b][s.c-1]&&this.options.passage_existence_strategy.indexOf("v")>=0))?(r.start=e.b,r.end=s.b):this.options.osis_compaction_strategy.length<=2&&1===e.v&&(999===s.v||s.v===this.passage.translations[a].chapters[s.b][s.c-1]&&this.options.passage_existence_strategy.indexOf("v")>=0)?(r.start=e.b+"."+e.c.toString(),r.end=s.b+"."+s.c.toString()):(r.start=e.b+"."+e.c.toString()+"."+e.v.toString(),r.end=s.b+"."+s.c.toString()+"."+s.v.toString()),t=r.start===r.end?r.start:r.start+"-"+r.end,null!=e.extra&&(t=e.extra+","+t),null!=s.extra&&(t+=","+s.extra),t}fix_ps151(e,s,a){return"default"!==a&&null==(null!=this.translations[a]?this.translations[a].chapters.Ps151:void 0)&&this.passage.promote_book_to_translation("Ps151",a),151===e.c&&"Ps"===e.b?151===s.c&&"Ps"===s.b?(e.b="Ps151",e.c=1,s.b="Ps151",s.c=1):(e.extra=this.to_osis({b:"Ps151",c:1,v:e.v},{b:"Ps151",c:1,v:this.passage.translations[a].chapters.Ps151[0]},a),e.b="Prov",e.c=1,e.v=1):(s.extra=this.to_osis({b:"Ps151",c:1,v:1},{b:"Ps151",c:1,v:s.v},a),s.c=150,s.v=this.passage.translations[a].chapters.Ps[149])}combine_consecutive_passages(e,s){const a=[];let t={};const r=e.length-1;let n=-1,i=!1;for(let c=0,p=r,x=0<=p;x?c<=p:c>=p;x?c++:c--){var o=e[c];if(o.osis.length>0){var l=a.length-1,u=!1;o.enclosed_indices[0]!==n&&(n=o.enclosed_indices[0]),n>=0&&(c===r||e[c+1].enclosed_indices[0]!==o.enclosed_indices[0])&&(u=!0,i=!0),this.is_verse_consecutive(t,o.start,s)?(a[l].end=o.end,a[l].is_enclosed_last=u,a[l].indices[1]=o.indices[1],a[l].enclosed_indices[1]=o.enclosed_indices[1],a[l].osis=this.to_osis(a[l].start,o.end,s)):a.push(o),t={b:o.end.b,c:o.end.c,v:o.end.v}}else a.push(o),t={}}return i&&this.snap_enclosed_indices(a),a}snap_enclosed_indices(e){for(var s of Array.from(e))null!=s.is_enclosed_last&&(s.enclosed_indices[0]<0&&s.is_enclosed_last&&(s.indices[1]=s.enclosed_indices[1]),delete s.is_enclosed_last);return e}is_verse_consecutive(e,s,a){if(null==e.b)return!1;const t=null!=this.passage.translations[a].order?this.passage.translations[a].order:this.passage.translations.default.order;if(e.b===s.b){if(e.c===s.c){if(e.v===s.v-1)return!0}else if(1===s.v&&e.c===s.c-1&&e.v===this.passage.translations[a].chapters[e.b][e.c-1])return!0}else if(1===s.c&&1===s.v&&t[e.b]===t[s.b]-1&&e.c===this.passage.translations[a].chapters[e.b].length&&e.v===this.passage.translations[a].chapters[e.b][e.c-1])return!0;return!1}snap_range(e,s){let a,t,r;"b_range_start"===e.type||"sequence"===e.type&&"b_range_start"===e.passages[s].type?(a=1,t="end",r="b_range_start"):(a=0,t="start",r="range_end_b");const n="end"===t?"start":"end";for(var i of Object.keys(e.passages[s][n]||{}))e.passages[s][n][i]=e.passages[s][t][i];if("sequence"===e.type){s>=e.value.length&&(s=e.value.length-1);const a=this.passage.pluck(r,e.value[s]);if(null!=a){const t=this.snap_range(a,0);0===s?e.absolute_indices[0]=t.absolute_indices[0]:e.absolute_indices[1]=t.absolute_indices[1]}}else e.original_type=e.type,e.type=e.value[a].type,e.absolute_indices=[e.value[a].absolute_indices[0],e.value[a].absolute_indices[1]];return e}snap_sequence(e,s,a,t,r){const n=s.passages[t];return n.absolute_indices[0]===s.absolute_indices[0]&&t<r-1&&this.get_snap_sequence_i(s.passages,t,r)!==t?(s.absolute_indices[0]=s.passages[t+1].absolute_indices[0],this.remove_absolute_indices(s.passages,t+1)):n.absolute_indices[1]===s.absolute_indices[1]&&t>0?s.absolute_indices[1]=a.length>0?a[a.length-1].indices[1]:s.passages[t-1].absolute_indices[1]:"book"===e&&t<r-1&&!this.starts_with_book(s.passages[t+1])&&(s.passages[t+1].absolute_indices[0]=n.absolute_indices[0]),s}get_snap_sequence_i(e,s,a){for(let t=s+1,r=t,n=a,i=t<=n;i?r<n:r>n;i?r++:r--){if(this.starts_with_book(e[r]))return r;if(e[r].valid.valid)return s}return s}starts_with_book(e){return"b"===e.type.substr(0,1)||("range"===e.type||"ff"===e.type)&&"b"===e.start.type.substr(0,1)}remove_absolute_indices(e,s){if(e[s].enclosed_absolute_indices[0]<0)return!1;const[a,t]=Array.from(e[s].enclosed_absolute_indices);for(var r of Array.from(e.slice(s))){if(r.enclosed_absolute_indices[0]!==a||r.enclosed_absolute_indices[1]!==t)break;r.enclosed_absolute_indices=[-1,-1]}return!0}}bcv_parser.initClass(),this.bcv_parser=bcv_parser;class bcv_passage{static initClass(){this.prototype.books=[],this.prototype.indices={},this.prototype.options={},this.prototype.translations={}}handle_array(e,s,a){for(var t of(null==s&&(s=[]),null==a&&(a={}),Array.from(e)))if(null!=t){if("stop"===t.type)break;[s,a]=Array.from(this.handle_obj(t,s,a))}return[s,a]}handle_obj(e,s,a){return null!=e.type&&null!=this[e.type]?this[e.type](e,s,a):[s,a]}b(e,s,a){let t;e.start_context=bcv_utils.shallow_clone(a),e.passages=[];const r=[];for(t of Array.from(this.books[e.value].parsed)){var n=this.validate_ref(e.start_context.translations,{b:t}),i={start:{b:t},end:{b:t},valid:n};0===e.passages.length&&n.valid?e.passages.push(i):r.push(i)}return 0===e.passages.length&&e.passages.push(r.shift()),r.length>0&&(e.passages[0].alternates=r),null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),s.push(e),a={b:e.passages[0].start.b},null!=e.start_context.translations&&(a.translations=e.start_context.translations),[s,a]}b_range(e,s,a){return this.range(e,s,a)}b_range_pre(e,s,a){let t,r;e.start_context=bcv_utils.shallow_clone(a),e.passages=[];const n=this.pluck("b",e.value);t=this.b(n,[],a),[r]=Array.from(t[0]),a=t[1],null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices));const i={b:e.value[0].value+r.passages[0].start.b.substr(1),type:"b"};return e.passages=[{start:i,end:r.passages[0].end,valid:r.passages[0].valid}],null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),s.push(e),[s,a]}b_range_start(e,s,a){return this.range(e,s,a)}base(e,s,a){return this.indices=this.calculate_indices(e.match,e.start_index),this.handle_array(e.value,s,a)}bc(e,s,a){e.start_context=bcv_utils.shallow_clone(a),e.passages=[],this.reset_context(a,["b","c","v"]);const t=this.pluck("c",e.value).value,r=[];for(var n of Array.from(this.books[this.pluck("b",e.value).value].parsed)){var i="c",o=this.validate_ref(e.start_context.translations,{b:n,c:t}),l={start:{b:n},end:{b:n},valid:o};(o.messages.start_chapter_not_exist_in_single_chapter_book||o.messages.start_chapter_1)&&(l.valid=this.validate_ref(e.start_context.translations,{b:n,v:t}),o.messages.start_chapter_not_exist_in_single_chapter_book&&(l.valid.messages.start_chapter_not_exist_in_single_chapter_book=1),l.start.c=1,l.end.c=1,i="v"),l.start[i]=t,[l.start.c,l.start.v]=Array.from(this.fix_start_zeroes(l.valid,l.start.c,l.start.v)),null==l.start.v&&delete l.start.v,l.end[i]=l.start[i],0===e.passages.length&&l.valid.valid?e.passages.push(l):r.push(l)}return 0===e.passages.length&&e.passages.push(r.shift()),r.length>0&&(e.passages[0].alternates=r),null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),this.set_context_from_object(a,["b","c","v"],e.passages[0].start),s.push(e),[s,a]}bc_title(e,s,a){let t,r;if(e.start_context=bcv_utils.shallow_clone(a),t=this.bc(this.pluck("bc",e.value),[],a),[r]=Array.from(t[0]),a=t[1],"Ps"!==r.passages[0].start.b.substr(0,2)&&null!=r.passages[0].alternates)for(let e=0,s=r.passages[0].alternates.length,a=0<=s;a?e<s:e>s;a?e++:e--)if("Ps"===r.passages[0].alternates[e].start.b.substr(0,2)){r.passages[0]=r.passages[0].alternates[e];break}if("Ps"!==r.passages[0].start.b.substr(0,2))return s.push(r),[s,a];this.books[this.pluck("b",r.value).value].parsed=["Ps"];let n=this.pluck("title",e.value);return null==n&&(n=this.pluck("v",e.value)),e.value[1]={type:"v",value:[{type:"integer",value:1,indices:n.indices}],indices:n.indices},e.type="bcv",this.bcv(e,s,e.start_context)}bcv(e,s,a){e.start_context=bcv_utils.shallow_clone(a),e.passages=[],this.reset_context(a,["b","c","v"]);const t=this.pluck("bc",e.value);let r=this.pluck("c",t.value).value,n=this.pluck("v",e.value).value;const i=[];for(var o of Array.from(this.books[this.pluck("b",t.value).value].parsed)){var l=this.validate_ref(e.start_context.translations,{b:o,c:r,v:n});[r,n]=Array.from(this.fix_start_zeroes(l,r,n));var u={start:{b:o,c:r,v:n},end:{b:o,c:r,v:n},valid:l};0===e.passages.length&&l.valid?e.passages.push(u):i.push(u)}return 0===e.passages.length&&e.passages.push(i.shift()),i.length>0&&(e.passages[0].alternates=i),null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),this.set_context_from_object(a,["b","c","v"],e.passages[0].start),s.push(e),[s,a]}bv(e,s,a){let t;e.start_context=bcv_utils.shallow_clone(a);const[r,n]=Array.from(e.value);let i={indices:e.indices,value:[{type:"bc",value:[r,{type:"c",value:[{type:"integer",value:1}]}]},n]};return t=this.bcv(i,[],a),[i]=Array.from(t[0]),a=t[1],e.passages=i.passages,null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),s.push(e),[s,a]}c(e,s,a){e.start_context=bcv_utils.shallow_clone(a);let t="integer"===e.type?e.value:this.pluck("integer",e.value).value;const r=this.validate_ref(e.start_context.translations,{b:a.b,c:t});return!r.valid&&r.messages.start_chapter_not_exist_in_single_chapter_book?this.v(e,s,a):([t]=Array.from(this.fix_start_zeroes(r,t)),e.passages=[{start:{b:a.b,c:t},end:{b:a.b,c:t},valid:r}],null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),s.push(e),a.c=t,this.reset_context(a,["v"]),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),[s,a])}c_psalm(e,s,a){e.type="bc";const t=parseInt(this.books[e.value].value.match(/^\d+/)[0],10);return e.value=[{type:"b",value:e.value,indices:e.indices},{type:"c",value:[{type:"integer",value:t,indices:e.indices}],indices:e.indices}],this.bc(e,s,a)}c_title(e,s,a){if(e.start_context=bcv_utils.shallow_clone(a),"Ps"!==a.b)return this.c(e.value[0],s,a);const t=this.pluck("title",e.value);return e.value[1]={type:"v",value:[{type:"integer",value:1,indices:t.indices}],indices:t.indices},e.type="cv",this.cv(e,s,e.start_context)}cv(e,s,a){e.start_context=bcv_utils.shallow_clone(a);let t=this.pluck("c",e.value).value,r=this.pluck("v",e.value).value;const n=this.validate_ref(e.start_context.translations,{b:a.b,c:t,v:r});return[t,r]=Array.from(this.fix_start_zeroes(n,t,r)),e.passages=[{start:{b:a.b,c:t,v:r},end:{b:a.b,c:t,v:r},valid:n}],null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),s.push(e),a.c=t,a.v=r,null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),[s,a]}cb_range(e,s,a){e.type="range";const[t,r,n]=Array.from(e.value);return e.value=[{type:"bc",value:[t,r],indices:e.indices},n],n.indices[1]=e.indices[1],this.range(e,s,a)}context(e,s,a){for(var t of(e.start_context=bcv_utils.shallow_clone(a),e.passages=[],Object.keys(this.books[e.value].context||{})))a[t]=this.books[e.value].context[t];return s.push(e),[s,a]}cv_psalm(e,s,a){e.start_context=bcv_utils.shallow_clone(a),e.type="bcv";const[t,r]=Array.from(e.value),n=this.c_psalm(t,[],e.start_context),[i]=Array.from(n[0]);return e.value=[i,r],this.bcv(e,s,a)}ff(e,s,a){let t;return e.start_context=bcv_utils.shallow_clone(a),e.value.push({type:"integer",indices:e.indices,value:999}),t=this.range(e,[],e.start_context),[e]=Array.from(t[0]),a=t[1],e.value[0].indices=e.value[1].indices,e.value[0].absolute_indices=e.value[1].absolute_indices,e.value.pop(),null!=e.passages[0].valid.messages.end_verse_not_exist&&delete e.passages[0].valid.messages.end_verse_not_exist,null!=e.passages[0].valid.messages.end_chapter_not_exist&&delete e.passages[0].valid.messages.end_chapter_not_exist,null!=e.passages[0].end.original_c&&delete e.passages[0].end.original_c,s.push(e),[s,a]}integer_title(e,s,a){return e.start_context=bcv_utils.shallow_clone(a),"Ps"!==a.b?this.integer(e.value[0],s,a):(e.value[0]={type:"c",value:[e.value[0]],indices:[e.value[0].indices[0],e.value[0].indices[1]]},e.value[1].type="v",e.value[1].original_type="title",e.value[1].value=[{type:"integer",value:1,indices:e.value[1].value.indices}],e.type="cv",this.cv(e,s,e.start_context))}integer(e,s,a){return null!=a.v?this.v(e,s,a):this.c(e,s,a)}next_v(e,s,a){let t,r;e.start_context=bcv_utils.shallow_clone(a);let n=this.pluck_last_recursively("integer",e.value);if(null==n&&(n={value:1}),e.value.push({type:"integer",indices:e.indices,value:n.value+1}),t=this.range(e,[],e.start_context),[r]=Array.from(t[0]),a=t[1],null!=r.passages[0].valid.messages.end_verse_not_exist&&null==r.passages[0].valid.messages.start_verse_not_exist&&null==r.passages[0].valid.messages.start_chapter_not_exist&&null!=a.c){let s;e.value.pop(),e.value.push({type:"cv",indices:e.indices,value:[{type:"c",value:[{type:"integer",value:a.c+1,indices:e.indices}],indices:e.indices},{type:"v",value:[{type:"integer",value:1,indices:e.indices}],indices:e.indices}]}),s=this.range(e,[],e.start_context),[r]=Array.from(s[0]),a=s[1]}return r.value[0].indices=r.value[1].indices,r.value[0].absolute_indices=r.value[1].absolute_indices,r.value.pop(),null!=r.passages[0].valid.messages.end_verse_not_exist&&delete r.passages[0].valid.messages.end_verse_not_exist,null!=r.passages[0].valid.messages.end_chapter_not_exist&&delete r.passages[0].valid.messages.end_chapter_not_exist,null!=r.passages[0].end.original_c&&delete r.passages[0].end.original_c,s.push(r),[s,a]}sequence(e,s,a){for(var t of(e.start_context=bcv_utils.shallow_clone(a),e.passages=[],Array.from(e.value))){var r,n;for(var i of(r=this.handle_array(t,[],a),[n]=Array.from(r[0]),a=r[1],Array.from(n.passages)))null==i.type&&(i.type=n.type),null==i.absolute_indices&&(i.absolute_indices=n.absolute_indices),null!=n.start_context.translations&&(i.translations=n.start_context.translations),i.enclosed_absolute_indices="sequence_post_enclosed"===n.type?n.absolute_indices:[-1,-1],e.passages.push(i)}return null==e.absolute_indices&&(e.passages.length>0&&"sequence"===e.type?e.absolute_indices=[e.passages[0].absolute_indices[0],e.passages[e.passages.length-1].absolute_indices[1]]:e.absolute_indices=this.get_absolute_indices(e.indices)),s.push(e),[s,a]}sequence_post_enclosed(e,s,a){return this.sequence(e,s,a)}v(e,s,a){let t,r="integer"===e.type?e.value:this.pluck("integer",e.value).value;e.start_context=bcv_utils.shallow_clone(a);const n=null!=a.c?a.c:1,i=this.validate_ref(e.start_context.translations,{b:a.b,c:n,v:r});return[t,r]=Array.from(this.fix_start_zeroes(i,0,r)),e.passages=[{start:{b:a.b,c:n,v:r},end:{b:a.b,c:n,v:r},valid:i}],null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),s.push(e),a.v=r,[s,a]}range(e,s,a){let t,r;e.start_context=bcv_utils.shallow_clone(a);let[n,i]=Array.from(e.value);if(t=this.handle_obj(n,[],a),[n]=Array.from(t[0]),a=t[1],"v"===i.type&&("bc"===n.type&&!__guard__(__guard__(__guard__(null!=n.passages?n.passages[0]:void 0,(e=>e.valid)),(e=>e.messages)),(e=>e.start_chapter_not_exist_in_single_chapter_book))||"c"===n.type)&&"verse"===this.options.end_range_digits_strategy)return e.value[0]=n,this.range_change_integer_end(e,s);r=this.handle_obj(i,[],a),[i]=Array.from(r[0]),a=r[1],e.value=[n,i],e.indices=[n.indices[0],i.indices[1]],delete e.absolute_indices;const o={b:n.passages[0].start.b,c:n.passages[0].start.c,v:n.passages[0].start.v,type:n.type},l={b:i.passages[0].end.b,c:i.passages[0].end.c,v:i.passages[0].end.v,type:i.type};i.passages[0].valid.messages.start_chapter_is_zero&&(l.c=0),i.passages[0].valid.messages.start_verse_is_zero&&(l.v=0);const u=this.validate_ref(e.start_context.translations,o,l);if(!u.valid)return this.range_handle_invalid(u,e,n,o,i,l,s);{const[a,t]=Array.from(this.range_handle_valid(u,e,n,o,i,l,s));if(a)return t}return null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),e.passages=[{start:o,end:l,valid:u}],null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),"b"===o.type?"b"===l.type?e.type="b_range":e.type="b_range_start":"b"===l.type&&(e.type="range_end_b"),s.push(e),[s,a]}range_change_end(e,s,a){let t;const[r,n]=Array.from(e.value);return"integer"===n.type?(n.original_value=n.value,n.value=a):"v"===n.type?(t=this.pluck("integer",n.value),t.original_value=t.value,t.value=a):"cv"===n.type&&(t=this.pluck("c",n.value),t.original_value=t.value,t.value=a),this.handle_obj(e,s,e.start_context)}range_change_integer_end(e,s){const[a,t]=Array.from(e.value);return null==e.original_type&&(e.original_type=e.type),null==e.original_value&&(e.original_value=[a,t]),e.type="integer"===a.type?"cv":a.type+"v","integer"===a.type&&(e.value[0]={type:"c",value:[a],indices:a.indices}),"integer"===t.type&&(e.value[1]={type:"v",value:[t],indices:t.indices}),this.handle_obj(e,s,e.start_context)}range_check_new_end(e,s,a,t){let r=0,n=null;if(t.messages.end_chapter_before_start?n="c":t.messages.end_verse_before_start&&(n="v"),null!=n&&(r=this.range_get_new_end_value(s,a,t,n)),r>0){const s={b:a.b,c:a.c,v:a.v};s[n]=r;this.validate_ref(e,s).valid||(r=0)}return r}range_end_b(e,s,a){return this.range(e,s,a)}range_get_new_end_value(e,s,a,t){let r=0;return"c"===t&&a.messages.end_chapter_is_zero||"v"===t&&a.messages.end_verse_is_zero||(e[t]>=10&&s[t]<10&&e[t]-10*Math.floor(e[t]/10)<s[t]?r=s[t]+10*Math.floor(e[t]/10):e[t]>=100&&s[t]<100&&e[t]-100<s[t]&&(r=s[t]+100)),r}range_handle_invalid(e,s,a,t,r,n,i){if(!1===e.valid&&(e.messages.end_chapter_before_start||e.messages.end_verse_before_start)&&("integer"===r.type||"v"===r.type)||!1===e.valid&&e.messages.end_chapter_before_start&&"cv"===r.type){const a=this.range_check_new_end(s.start_context.translations,t,n,e);if(a>0)return this.range_change_end(s,i,a)}if("verse"===this.options.end_range_digits_strategy&&null==t.v&&("integer"===r.type||"v"===r.type)){const e="v"===r.type?this.pluck("integer",r.value):r.value;if(this.validate_ref(s.start_context.translations,{b:t.b,c:t.c,v:e}).valid)return this.range_change_integer_end(s,i)}return null==s.original_type&&(s.original_type=s.type),s.type="sequence",[s.original_value,s.value]=Array.from([[a,r],[[a],[r]]]),this.sequence(s,i,s.start_context)}range_handle_valid(e,s,a,t,r,n,i){if(e.messages.end_chapter_not_exist&&"verse"===this.options.end_range_digits_strategy&&null==t.v&&("integer"===r.type||"v"===r.type)&&this.options.passage_existence_strategy.indexOf("v")>=0){const e="v"===r.type?this.pluck("integer",r.value):r.value;if(this.validate_ref(s.start_context.translations,{b:t.b,c:t.c,v:e}).valid)return[!0,this.range_change_integer_end(s,i)]}return this.range_validate(e,t,n,s),[!1,null]}range_validate(e,s,a,t){return e.messages.end_chapter_not_exist||e.messages.end_chapter_not_exist_in_single_chapter_book?(a.original_c=a.c,a.c=e.messages.end_chapter_not_exist?e.messages.end_chapter_not_exist:e.messages.end_chapter_not_exist_in_single_chapter_book,null!=a.v&&(a.v=this.validate_ref(t.start_context.translations,{b:a.b,c:a.c,v:999}).messages.end_verse_not_exist,delete e.messages.end_verse_is_zero)):e.messages.end_verse_not_exist&&(a.original_v=a.v,a.v=e.messages.end_verse_not_exist),e.messages.end_verse_is_zero&&"allow"!==this.options.zero_verse_strategy&&(a.v=e.messages.end_verse_is_zero),e.messages.end_chapter_is_zero&&(a.c=e.messages.end_chapter_is_zero),[s.c,s.v]=Array.from(this.fix_start_zeroes(e,s.c,s.v)),!0}translation_sequence(e,s,a){e.start_context=bcv_utils.shallow_clone(a);const t=[];for(var r of(t.push({translation:this.books[e.value[0].value].parsed}),Array.from(e.value[1])))null!=(r=this.books[this.pluck("translation",r).value].parsed)&&t.push({translation:r});for(var n of Array.from(t))null!=this.translations.aliases[n.translation]?(n.alias=this.translations.aliases[n.translation].alias,n.osis=this.translations.aliases[n.translation].osis||n.translation.toUpperCase()):(n.alias="default",n.osis=n.translation.toUpperCase());return s.length>0&&(a=this.translation_sequence_apply(s,t)),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),s.push(e),this.reset_context(a,["translations"]),[s,a]}translation_sequence_apply(e,s){let a,t=0;for(let s=e.length-1,a=s,r=s<=0;r?a<=0:a>=0;r?a++:a--)if(null!=e[a].original_type&&(e[a].type=e[a].original_type),null!=e[a].original_value&&(e[a].value=e[a].original_value),"translation_sequence"===e[a].type){t=a+1;break}if(t<e.length){let r;e[t].start_context.translations=s,[r,a]=Array.from(this.handle_array(e.slice(t),[],e[t].start_context))}else a=bcv_utils.shallow_clone(e[e.length-1].start_context);return a}pluck(e,s){for(var a of Array.from(s))if(null!=a&&null!=a.type&&a.type===e)return"c"===e||"v"===e?this.pluck("integer",a.value):a;return null}pluck_last_recursively(e,s){for(let r=s.length-1;r>=0;r--){var a=s[r];if(null!=a&&null!=a.type){if(a.type===e)return this.pluck(e,[a]);var t=this.pluck_last_recursively(e,a.value);if(null!=t)return t}}return null}set_context_from_object(e,s,a){return(()=>{const t=[];for(var r of Array.from(s))null!=a[r]&&t.push(e[r]=a[r]);return t})()}reset_context(e,s){return Array.from(s).map((s=>delete e[s]))}fix_start_zeroes(e,s,a){return e.messages.start_chapter_is_zero&&"upgrade"===this.options.zero_chapter_strategy&&(s=e.messages.start_chapter_is_zero),e.messages.start_verse_is_zero&&"upgrade"===this.options.zero_verse_strategy&&(a=e.messages.start_verse_is_zero),[s,a]}calculate_indices(e,s){let a,t="book";const r=[];let n=0;s=parseInt(s,10);let i=[e];for(var o of["",""]){var l=[];for(a of Array.from(i))l=l.concat(a.split(o));i=l}for(a of Array.from(i)){var u;t="book"===t?"rest":"book";var c=a.length;0!==c&&("book"===t?(a=a.replace(/\/\d+$/,""),u=n+c,r.length>0&&r[r.length-1].index===s?r[r.length-1].end=u:r.push({start:n,end:u,index:s}),n+=c+2,s=this.books[a].start_index+this.books[a].value.length-n,r.push({start:u+1,end:u+1,index:s})):(u=n+c-1,r.length>0&&r[r.length-1].index===s?r[r.length-1].end=u:r.push({start:n,end:u,index:s}),n+=c))}return r}get_absolute_indices(...e){const[s,a]=Array.from(e[0]);let t=null,r=null;for(var n of Array.from(this.indices))if(null===t&&n.start<=s&&s<=n.end&&(t=s+n.index),n.start<=a&&a<=n.end){r=a+n.index+1;break}return[t,r]}validate_ref(e,s,a){null!=e&&e.length>0||(e=[{translation:"default",osis:"",alias:"default"}]);let t=!1;const r={};for(var n of Array.from(e))if(null==n.alias&&(n.alias="default"),null!=n.alias){null==this.translations.aliases[n.alias]&&(n.alias="default",null==r.translation_unknown&&(r.translation_unknown=[]),r.translation_unknown.push(n));var[i]=Array.from(this.validate_start_ref(n.alias,s,r));a&&([i]=Array.from(this.validate_end_ref(n.alias,s,a,i,r))),!0===i&&(t=!0)}else null==r.translation_invalid&&(r.translation_invalid=[]),r.translation_invalid.push(n);return{valid:t,messages:r}}validate_start_ref(e,s,a){let t=!0;"default"!==e&&null==(null!=this.translations[e]?this.translations[e].chapters[s.b]:void 0)&&this.promote_book_to_translation(s.b,e);const r=null!=(null!=this.translations[e]?this.translations[e].order:void 0)?e:"default";if(null!=s.v&&(s.v=parseInt(s.v,10)),null!=this.translations[r].order[s.b]){if(null==s.c&&(s.c=1),s.c=parseInt(s.c,10),isNaN(s.c))return t=!1,a.start_chapter_not_numeric=!0,[t,a];0===s.c&&(a.start_chapter_is_zero=1,"error"===this.options.zero_chapter_strategy?t=!1:s.c=1),null!=s.v&&0===s.v&&(a.start_verse_is_zero=1,"error"===this.options.zero_verse_strategy?t=!1:"upgrade"===this.options.zero_verse_strategy&&(s.v=1)),s.c>0&&null!=this.translations[e].chapters[s.b][s.c-1]?null!=s.v?isNaN(s.v)?(t=!1,a.start_verse_not_numeric=!0):s.v>this.translations[e].chapters[s.b][s.c-1]&&this.options.passage_existence_strategy.indexOf("v")>=0&&(t=!1,a.start_verse_not_exist=this.translations[e].chapters[s.b][s.c-1]):1===s.c&&"verse"===this.options.single_chapter_1_strategy&&1===this.translations[e].chapters[s.b].length&&(a.start_chapter_1=1):1!==s.c&&1===this.translations[e].chapters[s.b].length?(t=!1,a.start_chapter_not_exist_in_single_chapter_book=1):s.c>0&&this.options.passage_existence_strategy.indexOf("c")>=0&&(t=!1,a.start_chapter_not_exist=this.translations[e].chapters[s.b].length)}else null==s.b?(t=!1,a.start_book_not_defined=!0):(this.options.passage_existence_strategy.indexOf("b")>=0&&(t=!1),a.start_book_not_exist=!0);return[t,a]}validate_end_ref(e,s,a,t,r){const n=null!=(null!=this.translations[e]?this.translations[e].order:void 0)?e:"default";return null!=a.c&&(a.c=parseInt(a.c,10),isNaN(a.c)?(t=!1,r.end_chapter_not_numeric=!0):0===a.c&&(r.end_chapter_is_zero=1,"error"===this.options.zero_chapter_strategy?t=!1:a.c=1)),null!=a.v&&(a.v=parseInt(a.v,10),isNaN(a.v)?(t=!1,r.end_verse_not_numeric=!0):0===a.v&&(r.end_verse_is_zero=1,"error"===this.options.zero_verse_strategy?t=!1:"upgrade"===this.options.zero_verse_strategy&&(a.v=1))),null!=this.translations[n].order[a.b]?(null==a.c&&1===this.translations[e].chapters[a.b].length&&(a.c=1),null!=this.translations[n].order[s.b]&&this.translations[n].order[s.b]>this.translations[n].order[a.b]&&(this.options.passage_existence_strategy.indexOf("b")>=0&&(t=!1),r.end_book_before_start=!0),s.b!==a.b||null==a.c||isNaN(a.c)||(null==s.c&&(s.c=1),!isNaN(parseInt(s.c,10))&&s.c>a.c?(t=!1,r.end_chapter_before_start=!0):s.c!==a.c||null==a.v||isNaN(a.v)||(null==s.v&&(s.v=1),!isNaN(parseInt(s.v,10))&&s.v>a.v&&(t=!1,r.end_verse_before_start=!0))),null==a.c||isNaN(a.c)||null==this.translations[e].chapters[a.b][a.c-1]&&(1===this.translations[e].chapters[a.b].length?r.end_chapter_not_exist_in_single_chapter_book=1:a.c>0&&this.options.passage_existence_strategy.indexOf("c")>=0&&(r.end_chapter_not_exist=this.translations[e].chapters[a.b].length)),null==a.v||isNaN(a.v)||(null==a.c&&(a.c=this.translations[e].chapters[a.b].length),a.v>this.translations[e].chapters[a.b][a.c-1]&&this.options.passage_existence_strategy.indexOf("v")>=0&&(r.end_verse_not_exist=this.translations[e].chapters[a.b][a.c-1]))):(t=!1,r.end_book_not_exist=!0),[t,r]}promote_book_to_translation(e,s){if(null==this.translations[s]&&(this.translations[s]={}),null==this.translations[s].chapters&&(this.translations[s].chapters={}),null==this.translations[s].chapters[e])return this.translations[s].chapters[e]=bcv_utils.shallow_clone_array(this.translations.default.chapters[e])}}function __guard__(e,s){return null!=e?s(e):void 0}bcv_passage.initClass();const bcv_utils={shallow_clone(e){if(null==e)return e;const s={};for(const a of Object.keys(e||{})){const t=e[a];s[a]=t}return s},shallow_clone_array(e){if(null==e)return e;const s=[];for(let a=0,t=e.length,r=0<=t;r?a<=t:a>=t;r?a++:a--)void 0!==e[a]&&(s[a]=e[a]);return s}};bcv_parser.prototype.regexps.translations=RegExp("(?:(?:SEB))\\b","gi"),bcv_parser.prototype.translations={aliases:{default:{osis:"",alias:"default"}},alternates:{},default:{order:{Gen:1,Exod:2,Lev:3,Num:4,Deut:5,Josh:6,Judg:7,Ruth:8,"1Sam":9,"2Sam":10,"1Kgs":11,"2Kgs":12,"1Chr":13,"2Chr":14,Ezra:15,Neh:16,Esth:17,Job:18,Ps:19,Prov:20,Eccl:21,Song:22,Isa:23,Jer:24,Lam:25,Ezek:26,Dan:27,Hos:28,Joel:29,Amos:30,Obad:31,Jonah:32,Mic:33,Nah:34,Hab:35,Zeph:36,Hag:37,Zech:38,Mal:39,Matt:40,Mark:41,Luke:42,John:43,Acts:44,Rom:45,"1Cor":46,"2Cor":47,Gal:48,Eph:49,Phil:50,Col:51,"1Thess":52,"2Thess":53,"1Tim":54,"2Tim":55,Titus:56,Phlm:57,Heb:58,Jas:59,"1Pet":60,"2Pet":61,"1John":62,"2John":63,"3John":64,Jude:65,Rev:66,Tob:67,Jdt:68,GkEsth:69,Wis:70,Sir:71,Bar:72,PrAzar:73,Sus:74,Bel:75,SgThree:76,EpJer:77,"1Macc":78,"2Macc":79,"3Macc":80,"4Macc":81,"1Esd":82,"2Esd":83,PrMan:84},chapters:{Gen:[31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,55,32,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26],Exod:[22,25,22,31,23,30,25,32,35,29,10,51,22,31,27,36,16,27,25,26,36,31,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38],Lev:[17,16,17,35,19,30,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34],Num:[54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,50,13,32,22,29,35,41,30,25,18,65,23,31,40,16,54,42,56,29,34,13],Deut:[46,37,29,49,33,25,26,20,29,22,32,32,18,29,23,22,20,22,21,20,23,30,25,22,19,19,26,68,29,20,30,52,29,12],Josh:[18,24,17,24,15,27,26,35,27,43,23,24,33,15,63,10,18,28,51,9,45,34,16,33],Judg:[36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25],Ruth:[22,23,18,22],"1Sam":[28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,15,23,29,22,44,25,12,25,11,31,13],"2Sam":[27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,33,43,26,22,51,39,25],"1Kgs":[53,46,28,34,18,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,53],"2Kgs":[18,25,27,44,27,33,20,29,37,36,21,21,25,29,38,20,41,37,37,21,26,20,37,20,30],"1Chr":[54,55,24,43,26,81,40,40,44,14,47,40,14,17,29,43,27,17,19,8,30,19,32,31,31,32,34,21,30],"2Chr":[17,18,17,22,14,42,22,18,31,19,23,16,22,15,19,14,19,34,11,37,20,12,21,27,28,23,9,27,36,27,21,33,25,33,27,23],Ezra:[11,70,13,24,17,22,28,36,15,44],Neh:[11,20,32,23,19,19,73,18,38,39,36,47,31],Esth:[22,23,15,17,14,14,10,17,32,3],Job:[22,13,26,21,27,30,21,22,35,22,20,25,28,22,35,22,16,21,29,29,34,30,17,25,6,14,23,28,25,31,40,22,33,37,16,33,24,41,30,24,34,17],Ps:[6,12,8,8,12,10,17,9,20,18,7,8,6,7,5,11,15,50,14,9,13,31,6,10,22,12,14,9,11,12,24,11,22,22,28,12,40,22,13,17,13,11,5,26,17,11,9,14,20,23,19,9,6,7,23,13,11,11,17,12,8,12,11,10,13,20,7,35,36,5,24,20,28,23,10,12,20,72,13,19,16,8,18,12,13,17,7,18,52,17,16,15,5,23,11,13,12,9,9,5,8,28,22,35,45,48,43,13,31,7,10,10,9,8,18,19,2,29,176,7,8,9,4,8,5,6,5,6,8,8,3,18,3,3,21,26,9,8,24,13,10,7,12,15,21,10,20,14,9,6],Prov:[33,22,35,27,23,35,27,36,18,32,31,28,25,35,33,33,28,24,29,30,31,29,35,34,28,28,27,28,27,33,31],Eccl:[18,26,22,16,20,12,29,17,18,20,10,14],Song:[17,17,11,16,16,13,13,14],Isa:[31,22,26,6,30,13,25,22,21,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,12,25,24],Jer:[19,37,25,31,31,30,34,22,26,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34],Lam:[22,22,66,22,22],Ezek:[28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,49,32,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35],Dan:[21,49,30,37,31,28,28,27,27,21,45,13],Hos:[11,23,5,19,15,11,16,14,17,15,12,14,16,9],Joel:[20,32,21],Amos:[15,16,15,13,27,14,17,14,15],Obad:[21],Jonah:[17,10,10,11],Mic:[16,13,12,13,15,16,20],Nah:[15,13,19],Hab:[17,20,19],Zeph:[18,15,20],Hag:[15,23],Zech:[21,13,10,14,11,15,14,23,17,12,17,14,9,21],Mal:[14,17,18,6],Matt:[25,23,17,25,48,34,29,34,38,42,30,50,58,36,39,28,27,35,30,34,46,46,39,51,46,75,66,20],Mark:[45,28,35,41,43,56,37,38,50,52,33,44,37,72,47,20],Luke:[80,52,38,44,39,49,50,56,62,42,54,59,35,35,32,31,37,43,48,47,38,71,56,53],John:[51,25,36,54,47,71,53,59,41,42,57,50,38,31,27,33,26,40,42,31,25],Acts:[26,47,26,37,42,15,60,40,43,48,30,25,52,28,41,40,34,28,41,38,40,30,35,27,27,32,44,31],Rom:[32,29,31,25,21,23,25,39,33,21,36,21,14,23,33,27],"1Cor":[31,16,23,21,13,20,40,13,27,33,34,31,13,40,58,24],"2Cor":[24,17,18,18,21,18,16,24,15,18,33,21,14],Gal:[24,21,29,31,26,18],Eph:[23,22,21,32,33,24],Phil:[30,30,21,23],Col:[29,23,25,18],"1Thess":[10,20,13,18,28],"2Thess":[12,17,18],"1Tim":[20,15,16,16,25,21],"2Tim":[18,26,17,22],Titus:[16,15,15],Phlm:[25],Heb:[14,18,19,16,14,20,28,13,28,39,40,29,25],Jas:[27,26,18,17,20],"1Pet":[25,25,22,19,14],"2Pet":[21,22,18],"1John":[10,29,24,21,21],"2John":[13],"3John":[15],Jude:[25],Rev:[20,29,22,11,14,17,17,13,21,11,19,17,18,20,8,21,18,24,21,15,27,21],Tob:[22,14,17,21,22,18,16,21,6,13,18,22,17,15],Jdt:[16,28,10,15,24,21,32,36,14,23,23,20,20,19,14,25],GkEsth:[22,23,15,17,14,14,10,17,32,13,12,6,18,19,16,24],Wis:[16,24,19,20,23,25,30,21,18,21,26,27,19,31,19,29,21,25,22],Sir:[30,18,31,31,15,37,36,19,18,31,34,18,26,27,20,30,32,33,30,31,28,27,27,34,26,29,30,26,28,25,31,24,33,31,26,31,31,34,35,30,22,25,33,23,26,20,25,25,16,29,30],Bar:[22,35,37,37,9],PrAzar:[68],Sus:[64],Bel:[42],SgThree:[39],EpJer:[73],"1Macc":[64,70,60,61,68,63,50,32,73,89,74,53,53,49,41,24],"2Macc":[36,32,40,50,27,31,42,36,29,38,38,45,26,46,39],"3Macc":[29,33,30,21,51,41,23],"4Macc":[35,24,21,26,38,35,23,29,32,21,27,19,27,20,32,25,24,24],"1Esd":[58,30,24,63,73,34,15,96,55],"2Esd":[40,48,36,52,56,59,70,63,47,59,46,51,58,48,63,78],PrMan:[15],Ps151:[7]}},vulgate:{chapters:{Gen:[31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,55,32,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,32,25],Exod:[22,25,22,31,23,30,25,32,35,29,10,51,22,31,27,36,16,27,25,26,36,31,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,36],Lev:[17,16,17,35,19,30,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,45,34],Num:[54,34,51,49,31,27,89,26,23,36,34,15,34,45,41,50,13,32,22,30,35,41,30,25,18,65,23,31,39,17,54,42,56,29,34,13],Josh:[18,24,17,25,16,27,26,35,27,44,23,24,33,15,63,10,18,28,51,9,43,34,16,33],Judg:[36,23,31,24,32,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,24],"1Sam":[28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,43,15,23,28,23,44,25,12,25,11,31,13],"1Kgs":[53,46,28,34,18,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,54],"1Chr":[54,55,24,43,26,81,40,40,44,14,46,40,14,17,29,43,27,17,19,7,30,19,32,31,31,32,34,21,30],Neh:[11,20,31,23,19,19,73,18,38,39,36,46,31],Job:[22,13,26,21,27,30,21,22,35,22,20,25,28,22,35,23,16,21,29,29,34,30,17,25,6,14,23,28,25,31,40,22,33,37,16,33,24,41,35,28,25,16],Ps:[6,13,9,10,13,11,18,10,39,8,9,6,7,5,10,15,51,15,10,14,32,6,10,22,12,14,9,11,13,25,11,22,23,28,13,40,23,14,18,14,12,5,26,18,12,10,15,21,23,21,11,7,9,24,13,12,12,18,14,9,13,12,11,14,20,8,36,37,6,24,20,28,23,11,13,21,72,13,20,17,8,19,13,14,17,7,19,53,17,16,16,5,23,11,13,12,9,9,5,8,29,22,35,45,48,43,14,31,7,10,10,9,26,9,10,2,29,176,7,8,9,4,8,5,6,5,6,8,8,3,18,3,3,21,26,9,8,24,14,10,8,12,15,21,10,11,9,14,9,6],Eccl:[18,26,22,17,19,11,30,17,18,20,10,14],Song:[16,17,11,16,17,12,13,14],Jer:[19,37,25,31,31,30,34,22,26,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,20,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34],Ezek:[28,9,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,49,32,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35],Dan:[21,49,100,34,31,28,28,27,27,21,45,13,65,42],Hos:[11,24,5,19,15,11,16,14,17,15,12,14,15,10],Amos:[15,16,15,13,27,15,17,14,14],Jonah:[16,11,10,11],Mic:[16,13,12,13,14,16,20],Hag:[14,24],Matt:[25,23,17,25,48,34,29,34,38,42,30,50,58,36,39,28,26,35,30,34,46,46,39,51,46,75,66,20],Mark:[45,28,35,40,43,56,37,39,49,52,33,44,37,72,47,20],John:[51,25,36,54,47,72,53,59,41,42,57,50,38,31,27,33,26,40,42,31,25],Acts:[26,47,26,37,42,15,59,40,43,48,30,25,52,27,41,40,34,28,40,38,40,30,35,27,27,32,44,31],"2Cor":[24,17,18,18,21,18,16,24,15,18,33,21,13],Rev:[20,29,22,11,14,17,17,13,21,11,19,18,18,20,8,21,18,24,21,15,27,21],Tob:[25,23,25,23,28,22,20,24,12,13,21,22,23,17],Jdt:[12,18,15,17,29,21,25,34,19,20,21,20,31,18,15,31],Wis:[16,25,19,20,24,27,30,21,19,21,27,27,19,31,19,29,20,25,20],Sir:[40,23,34,36,18,37,40,22,25,34,36,19,32,27,22,31,31,33,28,33,31,33,38,47,36,28,33,30,35,27,42,28,33,31,26,28,34,39,41,32,28,26,37,27,31,23,31,28,19,31,38,13],Bar:[22,35,38,37,9,72],"1Macc":[67,70,60,61,68,63,50,32,73,89,74,54,54,49,41,24],"2Macc":[36,33,40,50,27,31,42,36,29,38,38,46,26,46,40]}},ceb:{chapters:{"2Cor":[24,17,18,18,21,18,16,24,15,18,33,21,13],Rev:[20,29,22,11,14,17,17,13,21,11,19,18,18,20,8,21,18,24,21,15,27,21],Tob:[22,14,17,21,22,18,16,21,6,13,18,22,18,15],PrAzar:[67],EpJer:[72],"1Esd":[55,26,24,63,71,33,15,92,55]}},kjv:{chapters:{"3John":[14]}},nab:{order:{Gen:1,Exod:2,Lev:3,Num:4,Deut:5,Josh:6,Judg:7,Ruth:8,"1Sam":9,"2Sam":10,"1Kgs":11,"2Kgs":12,"1Chr":13,"2Chr":14,PrMan:15,Ezra:16,Neh:17,"1Esd":18,"2Esd":19,Tob:20,Jdt:21,Esth:22,GkEsth:23,"1Macc":24,"2Macc":25,"3Macc":26,"4Macc":27,Job:28,Ps:29,Prov:30,Eccl:31,Song:32,Wis:33,Sir:34,Isa:35,Jer:36,Lam:37,Bar:38,EpJer:39,Ezek:40,Dan:41,PrAzar:42,Sus:43,Bel:44,SgThree:45,Hos:46,Joel:47,Amos:48,Obad:49,Jonah:50,Mic:51,Nah:52,Hab:53,Zeph:54,Hag:55,Zech:56,Mal:57,Matt:58,Mark:59,Luke:60,John:61,Acts:62,Rom:63,"1Cor":64,"2Cor":65,Gal:66,Eph:67,Phil:68,Col:69,"1Thess":70,"2Thess":71,"1Tim":72,"2Tim":73,Titus:74,Phlm:75,Heb:76,Jas:77,"1Pet":78,"2Pet":79,"1John":80,"2John":81,"3John":82,Jude:83,Rev:84},chapters:{Gen:[31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,54,33,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26],Exod:[22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,26,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38],Lev:[17,16,17,35,26,23,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34],Num:[54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,35,28,32,22,29,35,41,30,25,19,65,23,31,39,17,54,42,56,29,34,13],Deut:[46,37,29,49,33,25,26,20,29,22,32,31,19,29,23,22,20,22,21,20,23,29,26,22,19,19,26,69,28,20,30,52,29,12],"1Sam":[28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,16,23,28,23,44,25,12,25,11,31,13],"2Sam":[27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,32,44,26,22,51,39,25],"1Kgs":[53,46,28,20,32,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,54],"2Kgs":[18,25,27,44,27,33,20,29,37,36,20,22,25,29,38,20,41,37,37,21,26,20,37,20,30],"1Chr":[54,55,24,43,41,66,40,40,44,14,47,41,14,17,29,43,27,17,19,8,30,19,32,31,31,32,34,21,30],"2Chr":[18,17,17,22,14,42,22,18,31,19,23,16,23,14,19,14,19,34,11,37,20,12,21,27,28,23,9,27,36,27,21,33,25,33,27,23],Neh:[11,20,38,17,19,19,72,18,37,40,36,47,31],Job:[22,13,26,21,27,30,21,22,35,22,20,25,28,22,35,22,16,21,29,29,34,30,17,25,6,14,23,28,25,31,40,22,33,37,16,33,24,41,30,32,26,17],Ps:[6,11,9,9,13,11,18,10,21,18,7,9,6,7,5,11,15,51,15,10,14,32,6,10,22,12,14,9,11,13,25,11,22,23,28,13,40,23,14,18,14,12,5,27,18,12,10,15,21,23,21,11,7,9,24,14,12,12,18,14,9,13,12,11,14,20,8,36,37,6,24,20,28,23,11,13,21,72,13,20,17,8,19,13,14,17,7,19,53,17,16,16,5,23,11,13,12,9,9,5,8,29,22,35,45,48,43,14,31,7,10,10,9,8,18,19,2,29,176,7,8,9,4,8,5,6,5,6,8,8,3,18,3,3,21,26,9,8,24,14,10,8,12,15,21,10,20,14,9,6],Eccl:[18,26,22,17,19,12,29,17,18,20,10,14],Song:[17,17,11,16,16,12,14,14],Isa:[31,22,26,6,30,13,25,23,20,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,11,25,24],Jer:[19,37,25,31,31,30,34,23,25,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34],Ezek:[28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,44,37,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35],Dan:[21,49,100,34,30,29,28,27,27,21,45,13,64,42],Hos:[9,25,5,19,15,11,16,14,17,15,11,15,15,10],Joel:[20,27,5,21],Jonah:[16,11,10,11],Mic:[16,13,12,14,14,16,20],Nah:[14,14,19],Zech:[17,17,10,14,11,15,14,23,17,12,17,14,9,21],Mal:[14,17,24],Acts:[26,47,26,37,42,15,60,40,43,49,30,25,52,28,41,40,34,28,40,38,40,30,35,27,27,32,44,31],"2Cor":[24,17,18,18,21,18,16,24,15,18,33,21,13],Rev:[20,29,22,11,14,17,17,13,21,11,19,18,18,20,8,21,18,24,21,15,27,21],Tob:[22,14,17,21,22,18,17,21,6,13,18,22,18,15],Sir:[30,18,31,31,15,37,36,19,18,31,34,18,26,27,20,30,32,33,30,31,28,27,27,33,26,29,30,26,28,25,31,24,33,31,26,31,31,34,35,30,22,25,33,23,26,20,25,25,16,29,30],Bar:[22,35,38,37,9,72],"2Macc":[36,32,40,50,27,31,42,36,29,38,38,46,26,46,39]}},nlt:{chapters:{Rev:[20,29,22,11,14,17,17,13,21,11,19,18,18,20,8,21,18,24,21,15,27,21]}},nrsv:{chapters:{"2Cor":[24,17,18,18,21,18,16,24,15,18,33,21,13],Rev:[20,29,22,11,14,17,17,13,21,11,19,18,18,20,8,21,18,24,21,15,27,21]}}},bcv_parser.prototype.languages=["sk"];const heregex=e=>{let s="",a=!1,t=!1;for(let r=0;r<e.length;r++){const n=e[r];if(t)s+=n,t=!1;else if("\\"!==n)if(a||"["!==n)if(a&&"]"===n)a=!1,s+=n;else if(a||"#"!==n)!a&&/\s/.test(n)||(s+=n);else for(;r<e.length&&"\n"!==e[r];)r+=1;else a=!0,s+=n;else s+=n,t=!0}return s};var grammar;bcv_parser.prototype.regexps.space="[\\s\\xa0]",bcv_parser.prototype.regexps.escaped_passage=RegExp(heregex(String.raw`
|
|
1
|
+
const root=this;class bcv_parser{static initClass(){this.prototype.s="",this.prototype.entities=[],this.prototype.passage=null,this.prototype.regexps={},this.prototype.options={consecutive_combination_strategy:"combine",osis_compaction_strategy:"b",book_sequence_strategy:"ignore",invalid_sequence_strategy:"ignore",sequence_combination_strategy:"combine",punctuation_strategy:"us",invalid_passage_strategy:"ignore",non_latin_digits_strategy:"ignore",passage_existence_strategy:"bcv",zero_chapter_strategy:"error",zero_verse_strategy:"error",single_chapter_1_strategy:"chapter",book_alone_strategy:"ignore",book_range_strategy:"ignore",captive_end_digits_strategy:"delete",end_range_digits_strategy:"verse",include_apocrypha:!1,ps151_strategy:"c",versification_system:"default",case_sensitive:"none"}}constructor(){for(var e of(this.options={},Object.keys(bcv_parser.prototype.options||{}))){var s=bcv_parser.prototype.options[e];this.options[e]=s}this.versification_system(this.options.versification_system)}parse(e){return this.reset(),this.s=e,e=this.replace_control_characters(e),[e,this.passage.books]=Array.from(this.match_books(e)),[this.entities]=Array.from(this.match_passages(e)),this}parse_with_context(e,s){let t;return this.reset(),[s,this.passage.books]=Array.from(this.match_books(this.replace_control_characters(s))),[t,s]=Array.from(this.match_passages(s)),this.reset(),this.s=e,e=this.replace_control_characters(e),[e,this.passage.books]=Array.from(this.match_books(e)),this.passage.books.push({value:"",parsed:[],start_index:0,type:"context",context:s}),e=""+(this.passage.books.length-1)+"/9"+e,[this.entities]=Array.from(this.match_passages(e)),this}reset(){return this.s="",this.entities=[],this.passage?(this.passage.books=[],this.passage.indices={}):(this.passage=new bcv_passage,this.passage.options=this.options,this.passage.translations=this.translations)}set_options(e){for(var s of Object.keys(e||{})){var t=e[s];"include_apocrypha"===s||"versification_system"===s||"case_sensitive"===s?this[s](t):this.options[s]=t}return this}include_apocrypha(e){if(null==e||!0!==e&&!1!==e)return this;for(var s of(this.options.include_apocrypha=e,this.regexps.books=this.regexps.get_books(e,this.options.case_sensitive),Object.keys(this.translations||{}))){var t;if("aliases"!==s&&"alternates"!==s)if(null==this.translations[s].chapters&&(this.translations[s].chapters={}),null==this.translations[s].chapters.Ps&&(this.translations[s].chapters.Ps=bcv_utils.shallow_clone_array(this.translations.default.chapters.Ps)),!0===e)t=null!=this.translations[s].chapters.Ps151?this.translations[s].chapters.Ps151[0]:this.translations.default.chapters.Ps151[0],this.translations[s].chapters.Ps[150]=t;else 151===this.translations[s].chapters.Ps.length&&this.translations[s].chapters.Ps.pop()}return this}versification_system(e){let s,t;if(null==e||null==this.translations[e])return this;if(null!=this.translations.alternates.default)if("default"===e)for(s of(null!=this.translations.alternates.default.order&&(this.translations.default.order=bcv_utils.shallow_clone(this.translations.alternates.default.order)),Object.keys(this.translations.alternates.default.chapters||{})))t=this.translations.alternates.default.chapters[s],this.translations.default.chapters[s]=bcv_utils.shallow_clone_array(t);else this.versification_system("default");if(null==this.translations.alternates.default&&(this.translations.alternates.default={order:null,chapters:{}}),"default"!==e&&null!=this.translations[e].order&&(null==this.translations.alternates.default.order&&(this.translations.alternates.default.order=bcv_utils.shallow_clone(this.translations.default.order)),this.translations.default.order=bcv_utils.shallow_clone(this.translations[e].order)),"default"!==e&&null!=this.translations[e].chapters)for(s of Object.keys(this.translations[e].chapters||{}))t=this.translations[e].chapters[s],null==this.translations.alternates.default.chapters[s]&&(this.translations.alternates.default.chapters[s]=bcv_utils.shallow_clone_array(this.translations.default.chapters[s])),this.translations.default.chapters[s]=bcv_utils.shallow_clone_array(t);return this.options.versification_system=e,this.include_apocrypha(this.options.include_apocrypha),this}case_sensitive(e){return null==e||"none"!==e&&"books"!==e||e===this.options.case_sensitive||(this.options.case_sensitive=e,this.regexps.books=this.regexps.get_books(this.options.include_apocrypha,e)),this}translation_info(e){let s;null==e&&(e="default"),null!=e&&null!=(null!=this.translations.aliases[e]?this.translations.aliases[e].alias:void 0)&&(e=this.translations.aliases[e].alias),null!=e&&null!=this.translations[e]||(e="default");const t=this.options.versification_system;e!==t&&this.versification_system(e);const a={alias:e,books:[],chapters:{},order:bcv_utils.shallow_clone(this.translations.default.order)};for(s of Object.keys(this.translations.default.chapters||{})){var r=this.translations.default.chapters[s];a.chapters[s]=bcv_utils.shallow_clone_array(r)}for(s of Object.keys(a.order||{})){var n=a.order[s];a.books[n-1]=s}return e!==t&&this.versification_system(t),a}replace_control_characters(e){return e=(e=(e=e.replace(this.regexps.control," ")).replace(/\uFF1A/g,":")).replace(/\uFF1B/g,";"),"replace"===this.options.non_latin_digits_strategy&&(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/[٠۰߀०০੦૦୦0౦೦൦๐໐༠၀႐០᠐᥆᧐᪀᪐᭐᮰᱀᱐꘠꣐꤀꧐꩐꯰0]/g,"0")).replace(/[١۱߁१১੧૧୧௧౧೧൧๑໑༡၁႑១᠑᥇᧑᪁᪑᭑᮱᱁᱑꘡꣑꤁꧑꩑꯱1]/g,"1")).replace(/[٢۲߂२২੨૨୨௨౨೨൨๒໒༢၂႒២᠒᥈᧒᪂᪒᭒᮲᱂᱒꘢꣒꤂꧒꩒꯲2]/g,"2")).replace(/[٣۳߃३৩੩૩୩௩౩೩൩๓໓༣၃႓៣᠓᥉᧓᪃᪓᭓᮳᱃᱓꘣꣓꤃꧓꩓꯳3]/g,"3")).replace(/[٤۴߄४৪੪૪୪௪౪೪൪๔໔༤၄႔៤᠔᥊᧔᪄᪔᭔᮴᱄᱔꘤꣔꤄꧔꩔꯴4]/g,"4")).replace(/[٥۵߅५৫੫૫୫௫౫೫൫๕໕༥၅႕៥᠕᥋᧕᪅᪕᭕᮵᱅᱕꘥꣕꤅꧕꩕꯵5]/g,"5")).replace(/[٦۶߆६৬੬૬୬௬౬೬൬๖໖༦၆႖៦᠖᥌᧖᪆᪖᭖᮶᱆᱖꘦꣖꤆꧖꩖꯶6]/g,"6")).replace(/[٧۷߇७৭੭૭୭௭౭೭൭๗໗༧၇႗៧᠗᥍᧗᪇᪗᭗᮷᱇᱗꘧꣗꤇꧗꩗꯷7]/g,"7")).replace(/[٨۸߈८৮੮૮୮௮౮೮൮๘໘༨၈႘៨᠘᥎᧘᪈᪘᭘᮸᱈᱘꘨꣘꤈꧘꩘꯸8]/g,"8")).replace(/[٩۹߉९৯੯૯୯௯౯೯൯๙໙༩၉႙៩᠙᥏᧙᪉᪙᭙᮹᱉᱙꘩꣙꤉꧙꩙꯹9]/g,"9")),e}match_books(e){const s=[];for(var t of Array.from(this.regexps.books)){var a=!1;if(e=e.replace(t.regexp,(function(e,r,n){a=!0,s.push({value:n,parsed:t.osis,type:"book"});const i=null!=t.extra?`/${t.extra}`:"";return`${r}${s.length-1}${i}`})),!0===a&&/^[\s\x1f\d:.,;\-\u2013\u2014]+$/.test(e))break}return[e=e.replace(this.regexps.translations,(function(e){return s.push({value:e,parsed:e.toLowerCase(),type:"translation"}),`${s.length-1}`})),this.get_book_indices(s,e)]}get_book_indices(e,s){let t,a=0;const r=new RegExp("([\\x1f\\x1e])(\\d+)(?:/\\d+)?\\1","g");for(;t=r.exec(s);)e[t[2]].start_index=t.index+a,a+=e[t[2]].value.length-t[0].length;return e}match_passages(e){let s,t=[],a={};for(;s=this.regexps.escaped_passage.exec(e);){let x;var[r,n,i]=Array.from(s),o=n.length;if(s.index+=r.length-o,/\s[2-9]\d\d\s*$|\s\d{4,}\s*$/.test(n)&&(n=n.replace(/\s+\d+\s*$/,"")),/[\d\x1f\x1e)]$/.test(n)||(n=this.replace_match_end(n)),"delete"===this.options.captive_end_digits_strategy){var l=s.index+n.length;e.length>l&&/^\w/.test(e.substr(l,1))&&(n=n.replace(/[\s*]+\d+$/,"")),n=n.replace(/(\x1e[)\]]?)[\s*]*\d+$/,"$1")}var u=""===(n=n.replace(/[A-Z]+/g,(e=>e.toLowerCase()))).substr(0,1)?0:n.split("")[0].length,c={value:grammar.parse(n,{punctuation_strategy:this.options.punctuation_strategy}),type:"base",start_index:this.passage.books[i].start_index-u,match:n};"full"===this.options.book_alone_strategy&&"include"===this.options.book_range_strategy&&"b"===c.value[0].type&&(1===c.value.length||c.value.length>1&&"translation_sequence"===c.value[1].type)&&0===u&&(1===this.passage.books[i].parsed.length||this.passage.books[i].parsed.length>1&&"translation"===this.passage.books[i].parsed[1].type)&&/^[234]/.test(this.passage.books[i].parsed[0])&&this.create_book_range(e,c,i),[x,a]=Array.from(this.passage.handle_obj(c)),t=t.concat(x);var p=this.adjust_regexp_end(x,o,n.length);p>0&&(this.regexps.escaped_passage.lastIndex-=p)}return[t,a]}adjust_regexp_end(e,s,t){let a=0;return e.length>0?a=s-e[e.length-1].indices[1]-1:s!==t&&(a=s-t),a}replace_match_end(e){let s,t=e.length;for(;s=this.regexps.match_end_split.exec(e);)t=s.index+s[0].length;return t<e.length&&(e=e.substr(0,t)),e}create_book_range(e,s,t){const a=[bcv_parser.prototype.regexps.first,bcv_parser.prototype.regexps.second,bcv_parser.prototype.regexps.third],r=parseInt(this.passage.books[t].parsed[0].substr(0,1),10);for(let o=1,l=r,u=1<=l;u?o<l:o>l;u?o++:o--){var n=o===r-1?bcv_parser.prototype.regexps.range_and:bcv_parser.prototype.regexps.range_only,i=e.match(new RegExp(`(?:^|\\W)(${a[o-1]}\\s*${n}\\s*)\\x1f${t}\\x1f`,"i"));if(null!=i)return this.add_book_range_object(s,i,o)}return!1}add_book_range_object(e,s,t){const{length:a}=s[1];if(e.value[0]={type:"b_range_pre",value:[{type:"b_pre",value:t.toString(),indices:[s.index,s.index+a]},e.value[0]],indices:[0,e.value[0].indices[1]+a]},e.value[0].value[1].indices[0]+=a,e.value[0].value[1].indices[1]+=a,e.start_index-=a,e.match=s[1]+e.match,1!==e.value.length)return(()=>{const s=[];for(let t=1,r=e.value.length,n=1<=r;n?t<r:t>r;n?t++:t--)null!=e.value[t].value&&(null!=(null!=e.value[t].value[0]?e.value[t].value[0].indices:void 0)&&(e.value[t].value[0].indices[0]+=a,e.value[t].value[0].indices[1]+=a),e.value[t].indices[0]+=a,s.push(e.value[t].indices[1]+=a));return s})()}osis(){const e=[];for(var s of Array.from(this.parsed_entities()))s.osis.length>0&&e.push(s.osis);return e.join(",")}osis_and_translations(){const e=[];for(var s of Array.from(this.parsed_entities()))s.osis.length>0&&e.push([s.osis,s.translations.join(",")]);return e}osis_and_indices(){const e=[];for(var s of Array.from(this.parsed_entities()))if(s.osis.length>0){const t={osis:s.osis,translations:s.translations,indices:s.indices};null!=s.osises&&(t.osises=s.osises),e.push(t)}return e}parsed_entities(){let e=[];for(let v=0,d=this.entities.length,b=0<=d;b?v<d:v>d;b?v++:v--){var s=this.entities[v];if(s.type&&"translation_sequence"===s.type&&e.length>0&&v===e[e.length-1].entity_id+1&&(e[e.length-1].indices[1]=s.absolute_indices[1]),null!=s.passages){if("separate-chapters"===this.options.consecutive_combination_strategy){const t=this.split_text_by_semicolon(s.absolute_indices);if(t.length>1){for(const s of Array.from(t)){const t=new bcv_parser;t.set_options({...this.options}),t.parse(s.text);for(const a of Array.from(t.parsed_entities())){if(0===a.osis.length)continue;const t=[a.indices[0]+s.offset,a.indices[1]+s.offset],r={osis:a.osis,translations:a.translations,indices:t,entity_id:v};null!=a.osises&&(r.osises=a.osises),e.push(r)}}continue}}if(!("b"===s.type&&"ignore"===this.options.book_alone_strategy||"b_range"===s.type&&"ignore"===this.options.book_range_strategy||"context"===s.type)){var t=[],a=null;if(null!=s.passages[0].translations)for(var r of Array.from(s.passages[0].translations)){var n=(null!=r.osis?r.osis.length:void 0)>0?r.osis:"";null==a&&(a=r.alias),t.push(n)}else t=[""],a="default";for(var i=[],o=[],{length:l}=s.passages,u=0,c=u,p=l,x=0<=p;x?u<p:u>p;x?u++:u--,c=u){var h=s.passages[c];null==h.type&&(h.type=s.type),!1===h.valid.valid&&("ignore"===this.options.invalid_sequence_strategy&&"sequence"===s.type&&this.snap_sequence("ignore",s,i,c,l),"ignore"===this.options.invalid_passage_strategy)||("b"!==h.type&&"b_range"!==h.type||"ignore"!==this.options.book_sequence_strategy||"sequence"!==s.type?("b_range_start"!==h.type&&"range_end_b"!==h.type||"ignore"!==this.options.book_range_strategy||this.snap_range(s,c),null==h.absolute_indices&&(h.absolute_indices=s.absolute_indices),"separate-chapters"===this.options.consecutive_combination_strategy&&h.start.c!==h.end.c?i.push({osis:h.valid.valid?this.to_osis(h.start,h.end,a):"",osises:this.get_osises_by_chapter({osis:"",start:h.start,end:h.end},a),type:h.type,indices:h.absolute_indices,translations:t,start:h.start,end:h.end,enclosed_indices:h.enclosed_absolute_indices,entity_id:v,entities:[h]}):i.push({osis:h.valid.valid?this.to_osis(h.start,h.end,a):"",type:h.type,indices:h.absolute_indices,translations:t,start:h.start,end:h.end,enclosed_indices:h.enclosed_absolute_indices,entity_id:v,entities:[h]})):this.snap_sequence("book",s,i,c,l))}if(0!==i.length||0!==o.length){if("combine"!==this.options.consecutive_combination_strategy&&"separate-chapters"!==this.options.consecutive_combination_strategy||(i.length>1&&(i=this.combine_consecutive_passages(i,a)),i=i.concat(o).sort(((e,s)=>e.indices[0]-s.indices[0]))),"separate-chapters"===this.options.consecutive_combination_strategy)for(g of Array.from(i)){if(0===g.osis.length)continue;const e=this.get_osises_by_chapter(g,a);e.length>1&&(g.osises=e)}if("separate"===this.options.sequence_combination_strategy)e=e.concat(i);else{if("separate-chapters"===this.options.consecutive_combination_strategy&&"sequence"===s.type){const s=this.group_osises_by_semicolon(i);if(s.length>1){for(const a of Array.from(s)){if(0===a.length)continue;const s=a.length-1,r=[a[0].indices[0],a[s].indices[1]];null!=a[s].enclosed_indices&&a[s].enclosed_indices[1]>=0&&(r[1]=a[s].enclosed_indices[1]);const n=[];let i=[];for(g of Array.from(a))g.osis.length>0&&n.push(g.osis),null!=g.osises&&(i=i.concat(g.osises));const o={osis:n.join(","),indices:r,translations:t,entity_id:v,entities:a};i.length>0&&(o.osises=i),e.push(o)}continue}}var g,_=[],f=i.length-1;for(g of(null!=i[f].enclosed_indices&&i[f].enclosed_indices[1]>=0&&(s.absolute_indices[1]=i[f].enclosed_indices[1]),Array.from(i)))g.osis.length>0&&_.push(g.osis);let a=[];if("separate-chapters"===this.options.consecutive_combination_strategy)for(g of Array.from(i))null!=g.osises&&(a=a.concat(g.osises));const r={osis:_.join(","),indices:s.absolute_indices,translations:t,entity_id:v,entities:i};a.length>0&&(r.osises=a),e.push(r)}}}}}return e}to_osis(e,s,t){let a;null==s.c&&null==s.v&&e.b===s.b&&null==e.c&&null==e.v&&"first_chapter"===this.options.book_alone_strategy&&(s.c=1);const r={start:"",end:""};return null==e.c&&(e.c=1),null==e.v&&(e.v=1),null==s.c&&(this.options.passage_existence_strategy.indexOf("c")>=0||null!=this.passage.translations[t].chapters[s.b]&&1===this.passage.translations[t].chapters[s.b].length?s.c=this.passage.translations[t].chapters[s.b].length:s.c=999),null==s.v&&(null!=this.passage.translations[t].chapters[s.b][s.c-1]&&this.options.passage_existence_strategy.indexOf("v")>=0?s.v=this.passage.translations[t].chapters[s.b][s.c-1]:s.v=999),this.options.include_apocrypha&&"b"===this.options.ps151_strategy&&(151===e.c&&"Ps"===e.b||151===s.c&&"Ps"===s.b)&&this.fix_ps151(e,s,t),"b"===this.options.osis_compaction_strategy&&1===e.c&&1===e.v&&(999===s.c&&999===s.v||s.c===this.passage.translations[t].chapters[s.b].length&&this.options.passage_existence_strategy.indexOf("c")>=0&&(999===s.v||s.v===this.passage.translations[t].chapters[s.b][s.c-1]&&this.options.passage_existence_strategy.indexOf("v")>=0))?(r.start=e.b,r.end=s.b):this.options.osis_compaction_strategy.length<=2&&1===e.v&&(999===s.v||s.v===this.passage.translations[t].chapters[s.b][s.c-1]&&this.options.passage_existence_strategy.indexOf("v")>=0)?(r.start=e.b+"."+e.c.toString(),r.end=s.b+"."+s.c.toString()):(r.start=e.b+"."+e.c.toString()+"."+e.v.toString(),r.end=s.b+"."+s.c.toString()+"."+s.v.toString()),a=r.start===r.end?r.start:r.start+"-"+r.end,null!=e.extra&&(a=e.extra+","+a),null!=s.extra&&(a+=","+s.extra),a}get_osises_by_chapter(e,s){if(null==e||null==e.start||null==e.end)return[];if(null==e.start.b||null==e.end.b||null==e.start.c||null==e.end.c)return null!=e.osis&&e.osis.length>0?[e.osis]:[];if(e.start.b!==e.end.b||e.start.c===e.end.c)return null!=e.osis&&e.osis.length>0?[e.osis]:[];const t=[];for(let a=e.start.c,r=e.end.c,n=e.start.c<=r;n?a<=r:a>=r;n?a++:a--){const r=a===e.start.c?e.start.v:1,n=a===e.end.c?e.end.v:this.translations[s].chapters[e.start.b][a-1],i={b:e.start.b,c:a,v:"bcv"===e.start.type?r:null,type:e.start.type},o={b:e.end.b,c:a,v:"bcv"===e.start.type?n:null,type:e.start.type};t.push(this.to_osis(i,o,s))}return t}get_separator_between(e,s){if(null==this.s||null==e||null==s)return"";const t=e[1]+1,a=s[0];return a<=t?"":this.s.slice(t,a)}has_semicolon_separator(e,s){const t=this.get_separator_between(e.indices,s.indices);return/[;;]/.test(t)}group_osises_by_semicolon(e){const s=[];let t=[];for(const a of Array.from(e))0!==t.length&&this.has_semicolon_separator(t[t.length-1],a)?(s.push(t),t=[a]):t.push(a);return t.length>0&&s.push(t),s}split_text_by_semicolon(e){if(null==this.s||null==e||null==e[0]||null==e[1])return[];const s=this.s.slice(e[0],e[1]);if(!/[;;]/.test(s))return[{text:s,offset:e[0]}];const t=[];let a=0;for(let r=0,n=s.length;r<n;r++){const n=s[r];";"!==n&&";"!==n||(r>a&&t.push({text:s.slice(a,r),offset:e[0]+a}),a=r+1)}return a<s.length&&t.push({text:s.slice(a),offset:e[0]+a}),t}fix_ps151(e,s,t){return"default"!==t&&null==(null!=this.translations[t]?this.translations[t].chapters.Ps151:void 0)&&this.passage.promote_book_to_translation("Ps151",t),151===e.c&&"Ps"===e.b?151===s.c&&"Ps"===s.b?(e.b="Ps151",e.c=1,s.b="Ps151",s.c=1):(e.extra=this.to_osis({b:"Ps151",c:1,v:e.v},{b:"Ps151",c:1,v:this.passage.translations[t].chapters.Ps151[0]},t),e.b="Prov",e.c=1,e.v=1):(s.extra=this.to_osis({b:"Ps151",c:1,v:1},{b:"Ps151",c:1,v:s.v},t),s.c=150,s.v=this.passage.translations[t].chapters.Ps[149])}combine_consecutive_passages(e,s){const t=[];let a={};const r=e.length-1;let n=-1,i=!1;for(let c=0,p=r,x=0<=p;x?c<=p:c>=p;x?c++:c--){var o=e[c];if(o.osis.length>0){var l=t.length-1,u=!1;if(l>=0&&this.has_semicolon_separator(t[l],o)){t.push(o),a={b:o.end.b,c:o.end.c,v:o.end.v};continue}o.enclosed_indices[0]!==n&&(n=o.enclosed_indices[0]),n>=0&&(c===r||e[c+1].enclosed_indices[0]!==o.enclosed_indices[0])&&(u=!0,i=!0),this.is_verse_consecutive(a,o.start,s)?(t[l].end=o.end,t[l].is_enclosed_last=u,t[l].indices[1]=o.indices[1],t[l].enclosed_indices[1]=o.enclosed_indices[1],t[l].osis=this.to_osis(t[l].start,o.end,s)):t.push(o),a={b:o.end.b,c:o.end.c,v:o.end.v}}else t.push(o),a={}}return i&&this.snap_enclosed_indices(t),t}snap_enclosed_indices(e){for(var s of Array.from(e))null!=s.is_enclosed_last&&(s.enclosed_indices[0]<0&&s.is_enclosed_last&&(s.indices[1]=s.enclosed_indices[1]),delete s.is_enclosed_last);return e}is_verse_consecutive(e,s,t){if(null==e.b)return!1;const a=null!=this.passage.translations[t].order?this.passage.translations[t].order:this.passage.translations.default.order;if(e.b===s.b){if(e.c===s.c){if(e.v===s.v-1)return!0}else if(1===s.v&&e.c===s.c-1&&e.v===this.passage.translations[t].chapters[e.b][e.c-1])return!0}else if(1===s.c&&1===s.v&&a[e.b]===a[s.b]-1&&e.c===this.passage.translations[t].chapters[e.b].length&&e.v===this.passage.translations[t].chapters[e.b][e.c-1])return!0;return!1}snap_range(e,s){let t,a,r;"b_range_start"===e.type||"sequence"===e.type&&"b_range_start"===e.passages[s].type?(t=1,a="end",r="b_range_start"):(t=0,a="start",r="range_end_b");const n="end"===a?"start":"end";for(var i of Object.keys(e.passages[s][n]||{}))e.passages[s][n][i]=e.passages[s][a][i];if("sequence"===e.type){s>=e.value.length&&(s=e.value.length-1);const t=this.passage.pluck(r,e.value[s]);if(null!=t){const a=this.snap_range(t,0);0===s?e.absolute_indices[0]=a.absolute_indices[0]:e.absolute_indices[1]=a.absolute_indices[1]}}else e.original_type=e.type,e.type=e.value[t].type,e.absolute_indices=[e.value[t].absolute_indices[0],e.value[t].absolute_indices[1]];return e}snap_sequence(e,s,t,a,r){const n=s.passages[a];return n.absolute_indices[0]===s.absolute_indices[0]&&a<r-1&&this.get_snap_sequence_i(s.passages,a,r)!==a?(s.absolute_indices[0]=s.passages[a+1].absolute_indices[0],this.remove_absolute_indices(s.passages,a+1)):n.absolute_indices[1]===s.absolute_indices[1]&&a>0?s.absolute_indices[1]=t.length>0?t[t.length-1].indices[1]:s.passages[a-1].absolute_indices[1]:"book"===e&&a<r-1&&!this.starts_with_book(s.passages[a+1])&&(s.passages[a+1].absolute_indices[0]=n.absolute_indices[0]),s}get_snap_sequence_i(e,s,t){for(let a=s+1,r=a,n=t,i=a<=n;i?r<n:r>n;i?r++:r--){if(this.starts_with_book(e[r]))return r;if(e[r].valid.valid)return s}return s}starts_with_book(e){return"b"===e.type.substr(0,1)||("range"===e.type||"ff"===e.type)&&"b"===e.start.type.substr(0,1)}remove_absolute_indices(e,s){if(e[s].enclosed_absolute_indices[0]<0)return!1;const[t,a]=Array.from(e[s].enclosed_absolute_indices);for(var r of Array.from(e.slice(s))){if(r.enclosed_absolute_indices[0]!==t||r.enclosed_absolute_indices[1]!==a)break;r.enclosed_absolute_indices=[-1,-1]}return!0}}bcv_parser.initClass(),this.bcv_parser=bcv_parser;class bcv_passage{static initClass(){this.prototype.books=[],this.prototype.indices={},this.prototype.options={},this.prototype.translations={}}handle_array(e,s,t){for(var a of(null==s&&(s=[]),null==t&&(t={}),Array.from(e)))if(null!=a){if("stop"===a.type)break;[s,t]=Array.from(this.handle_obj(a,s,t))}return[s,t]}handle_obj(e,s,t){return null!=e.type&&null!=this[e.type]?this[e.type](e,s,t):[s,t]}b(e,s,t){let a;e.start_context=bcv_utils.shallow_clone(t),e.passages=[];const r=[];for(a of Array.from(this.books[e.value].parsed)){var n=this.validate_ref(e.start_context.translations,{b:a}),i={start:{b:a},end:{b:a},valid:n};0===e.passages.length&&n.valid?e.passages.push(i):r.push(i)}return 0===e.passages.length&&e.passages.push(r.shift()),r.length>0&&(e.passages[0].alternates=r),null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),s.push(e),t={b:e.passages[0].start.b},null!=e.start_context.translations&&(t.translations=e.start_context.translations),[s,t]}b_range(e,s,t){return this.range(e,s,t)}b_range_pre(e,s,t){let a,r;e.start_context=bcv_utils.shallow_clone(t),e.passages=[];const n=this.pluck("b",e.value);a=this.b(n,[],t),[r]=Array.from(a[0]),t=a[1],null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices));const i={b:e.value[0].value+r.passages[0].start.b.substr(1),type:"b"};return e.passages=[{start:i,end:r.passages[0].end,valid:r.passages[0].valid}],null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),s.push(e),[s,t]}b_range_start(e,s,t){return this.range(e,s,t)}base(e,s,t){return this.indices=this.calculate_indices(e.match,e.start_index),this.handle_array(e.value,s,t)}bc(e,s,t){e.start_context=bcv_utils.shallow_clone(t),e.passages=[],this.reset_context(t,["b","c","v"]);const a=this.pluck("c",e.value).value,r=[];for(var n of Array.from(this.books[this.pluck("b",e.value).value].parsed)){var i="c",o=this.validate_ref(e.start_context.translations,{b:n,c:a}),l={start:{b:n},end:{b:n},valid:o};(o.messages.start_chapter_not_exist_in_single_chapter_book||o.messages.start_chapter_1)&&(l.valid=this.validate_ref(e.start_context.translations,{b:n,v:a}),o.messages.start_chapter_not_exist_in_single_chapter_book&&(l.valid.messages.start_chapter_not_exist_in_single_chapter_book=1),l.start.c=1,l.end.c=1,i="v"),l.start[i]=a,[l.start.c,l.start.v]=Array.from(this.fix_start_zeroes(l.valid,l.start.c,l.start.v)),null==l.start.v&&delete l.start.v,l.end[i]=l.start[i],0===e.passages.length&&l.valid.valid?e.passages.push(l):r.push(l)}return 0===e.passages.length&&e.passages.push(r.shift()),r.length>0&&(e.passages[0].alternates=r),null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),this.set_context_from_object(t,["b","c","v"],e.passages[0].start),s.push(e),[s,t]}bc_title(e,s,t){let a,r;if(e.start_context=bcv_utils.shallow_clone(t),a=this.bc(this.pluck("bc",e.value),[],t),[r]=Array.from(a[0]),t=a[1],"Ps"!==r.passages[0].start.b.substr(0,2)&&null!=r.passages[0].alternates)for(let e=0,s=r.passages[0].alternates.length,t=0<=s;t?e<s:e>s;t?e++:e--)if("Ps"===r.passages[0].alternates[e].start.b.substr(0,2)){r.passages[0]=r.passages[0].alternates[e];break}if("Ps"!==r.passages[0].start.b.substr(0,2))return s.push(r),[s,t];this.books[this.pluck("b",r.value).value].parsed=["Ps"];let n=this.pluck("title",e.value);return null==n&&(n=this.pluck("v",e.value)),e.value[1]={type:"v",value:[{type:"integer",value:1,indices:n.indices}],indices:n.indices},e.type="bcv",this.bcv(e,s,e.start_context)}bcv(e,s,t){e.start_context=bcv_utils.shallow_clone(t),e.passages=[],this.reset_context(t,["b","c","v"]);const a=this.pluck("bc",e.value);let r=this.pluck("c",a.value).value,n=this.pluck("v",e.value).value;const i=[];for(var o of Array.from(this.books[this.pluck("b",a.value).value].parsed)){var l=this.validate_ref(e.start_context.translations,{b:o,c:r,v:n});[r,n]=Array.from(this.fix_start_zeroes(l,r,n));var u={start:{b:o,c:r,v:n},end:{b:o,c:r,v:n},valid:l};0===e.passages.length&&l.valid?e.passages.push(u):i.push(u)}return 0===e.passages.length&&e.passages.push(i.shift()),i.length>0&&(e.passages[0].alternates=i),null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),this.set_context_from_object(t,["b","c","v"],e.passages[0].start),s.push(e),[s,t]}bv(e,s,t){let a;e.start_context=bcv_utils.shallow_clone(t);const[r,n]=Array.from(e.value);let i={indices:e.indices,value:[{type:"bc",value:[r,{type:"c",value:[{type:"integer",value:1}]}]},n]};return a=this.bcv(i,[],t),[i]=Array.from(a[0]),t=a[1],e.passages=i.passages,null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),s.push(e),[s,t]}c(e,s,t){e.start_context=bcv_utils.shallow_clone(t);let a="integer"===e.type?e.value:this.pluck("integer",e.value).value;const r=this.validate_ref(e.start_context.translations,{b:t.b,c:a});return!r.valid&&r.messages.start_chapter_not_exist_in_single_chapter_book?this.v(e,s,t):([a]=Array.from(this.fix_start_zeroes(r,a)),e.passages=[{start:{b:t.b,c:a},end:{b:t.b,c:a},valid:r}],null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),s.push(e),t.c=a,this.reset_context(t,["v"]),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),[s,t])}c_psalm(e,s,t){e.type="bc";const a=parseInt(this.books[e.value].value.match(/^\d+/)[0],10);return e.value=[{type:"b",value:e.value,indices:e.indices},{type:"c",value:[{type:"integer",value:a,indices:e.indices}],indices:e.indices}],this.bc(e,s,t)}c_title(e,s,t){if(e.start_context=bcv_utils.shallow_clone(t),"Ps"!==t.b)return this.c(e.value[0],s,t);const a=this.pluck("title",e.value);return e.value[1]={type:"v",value:[{type:"integer",value:1,indices:a.indices}],indices:a.indices},e.type="cv",this.cv(e,s,e.start_context)}cv(e,s,t){e.start_context=bcv_utils.shallow_clone(t);let a=this.pluck("c",e.value).value,r=this.pluck("v",e.value).value;const n=this.validate_ref(e.start_context.translations,{b:t.b,c:a,v:r});return[a,r]=Array.from(this.fix_start_zeroes(n,a,r)),e.passages=[{start:{b:t.b,c:a,v:r},end:{b:t.b,c:a,v:r},valid:n}],null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),s.push(e),t.c=a,t.v=r,null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),[s,t]}cb_range(e,s,t){e.type="range";const[a,r,n]=Array.from(e.value);return e.value=[{type:"bc",value:[a,r],indices:e.indices},n],n.indices[1]=e.indices[1],this.range(e,s,t)}context(e,s,t){for(var a of(e.start_context=bcv_utils.shallow_clone(t),e.passages=[],Object.keys(this.books[e.value].context||{})))t[a]=this.books[e.value].context[a];return s.push(e),[s,t]}cv_psalm(e,s,t){e.start_context=bcv_utils.shallow_clone(t),e.type="bcv";const[a,r]=Array.from(e.value),n=this.c_psalm(a,[],e.start_context),[i]=Array.from(n[0]);return e.value=[i,r],this.bcv(e,s,t)}ff(e,s,t){let a;return e.start_context=bcv_utils.shallow_clone(t),e.value.push({type:"integer",indices:e.indices,value:999}),a=this.range(e,[],e.start_context),[e]=Array.from(a[0]),t=a[1],e.value[0].indices=e.value[1].indices,e.value[0].absolute_indices=e.value[1].absolute_indices,e.value.pop(),null!=e.passages[0].valid.messages.end_verse_not_exist&&delete e.passages[0].valid.messages.end_verse_not_exist,null!=e.passages[0].valid.messages.end_chapter_not_exist&&delete e.passages[0].valid.messages.end_chapter_not_exist,null!=e.passages[0].end.original_c&&delete e.passages[0].end.original_c,s.push(e),[s,t]}integer_title(e,s,t){return e.start_context=bcv_utils.shallow_clone(t),"Ps"!==t.b?this.integer(e.value[0],s,t):(e.value[0]={type:"c",value:[e.value[0]],indices:[e.value[0].indices[0],e.value[0].indices[1]]},e.value[1].type="v",e.value[1].original_type="title",e.value[1].value=[{type:"integer",value:1,indices:e.value[1].value.indices}],e.type="cv",this.cv(e,s,e.start_context))}integer(e,s,t){return null!=t.v?this.v(e,s,t):this.c(e,s,t)}next_v(e,s,t){let a,r;e.start_context=bcv_utils.shallow_clone(t);let n=this.pluck_last_recursively("integer",e.value);if(null==n&&(n={value:1}),e.value.push({type:"integer",indices:e.indices,value:n.value+1}),a=this.range(e,[],e.start_context),[r]=Array.from(a[0]),t=a[1],null!=r.passages[0].valid.messages.end_verse_not_exist&&null==r.passages[0].valid.messages.start_verse_not_exist&&null==r.passages[0].valid.messages.start_chapter_not_exist&&null!=t.c){let s;e.value.pop(),e.value.push({type:"cv",indices:e.indices,value:[{type:"c",value:[{type:"integer",value:t.c+1,indices:e.indices}],indices:e.indices},{type:"v",value:[{type:"integer",value:1,indices:e.indices}],indices:e.indices}]}),s=this.range(e,[],e.start_context),[r]=Array.from(s[0]),t=s[1]}return r.value[0].indices=r.value[1].indices,r.value[0].absolute_indices=r.value[1].absolute_indices,r.value.pop(),null!=r.passages[0].valid.messages.end_verse_not_exist&&delete r.passages[0].valid.messages.end_verse_not_exist,null!=r.passages[0].valid.messages.end_chapter_not_exist&&delete r.passages[0].valid.messages.end_chapter_not_exist,null!=r.passages[0].end.original_c&&delete r.passages[0].end.original_c,s.push(r),[s,t]}sequence(e,s,t){for(var a of(e.start_context=bcv_utils.shallow_clone(t),e.passages=[],Array.from(e.value))){var r,n;for(var i of(r=this.handle_array(a,[],t),[n]=Array.from(r[0]),t=r[1],Array.from(n.passages)))null==i.type&&(i.type=n.type),null==i.absolute_indices&&(i.absolute_indices=n.absolute_indices),null!=n.start_context.translations&&(i.translations=n.start_context.translations),i.enclosed_absolute_indices="sequence_post_enclosed"===n.type?n.absolute_indices:[-1,-1],e.passages.push(i)}return null==e.absolute_indices&&(e.passages.length>0&&"sequence"===e.type?e.absolute_indices=[e.passages[0].absolute_indices[0],e.passages[e.passages.length-1].absolute_indices[1]]:e.absolute_indices=this.get_absolute_indices(e.indices)),s.push(e),[s,t]}sequence_post_enclosed(e,s,t){return this.sequence(e,s,t)}v(e,s,t){let a,r="integer"===e.type?e.value:this.pluck("integer",e.value).value;e.start_context=bcv_utils.shallow_clone(t);const n=null!=t.c?t.c:1,i=this.validate_ref(e.start_context.translations,{b:t.b,c:n,v:r});return[a,r]=Array.from(this.fix_start_zeroes(i,0,r)),e.passages=[{start:{b:t.b,c:n,v:r},end:{b:t.b,c:n,v:r},valid:i}],null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),s.push(e),t.v=r,[s,t]}range(e,s,t){let a,r;e.start_context=bcv_utils.shallow_clone(t);let[n,i]=Array.from(e.value);if(a=this.handle_obj(n,[],t),[n]=Array.from(a[0]),t=a[1],"v"===i.type&&("bc"===n.type&&!__guard__(__guard__(__guard__(null!=n.passages?n.passages[0]:void 0,(e=>e.valid)),(e=>e.messages)),(e=>e.start_chapter_not_exist_in_single_chapter_book))||"c"===n.type)&&"verse"===this.options.end_range_digits_strategy)return e.value[0]=n,this.range_change_integer_end(e,s);r=this.handle_obj(i,[],t),[i]=Array.from(r[0]),t=r[1],e.value=[n,i],e.indices=[n.indices[0],i.indices[1]],delete e.absolute_indices;const o={b:n.passages[0].start.b,c:n.passages[0].start.c,v:n.passages[0].start.v,type:n.type},l={b:i.passages[0].end.b,c:i.passages[0].end.c,v:i.passages[0].end.v,type:i.type};i.passages[0].valid.messages.start_chapter_is_zero&&(l.c=0),i.passages[0].valid.messages.start_verse_is_zero&&(l.v=0);const u=this.validate_ref(e.start_context.translations,o,l);if(!u.valid)return this.range_handle_invalid(u,e,n,o,i,l,s);{const[t,a]=Array.from(this.range_handle_valid(u,e,n,o,i,l,s));if(t)return a}return null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),e.passages=[{start:o,end:l,valid:u}],null!=e.start_context.translations&&(e.passages[0].translations=e.start_context.translations),"b"===o.type?"b"===l.type?e.type="b_range":e.type="b_range_start":"b"===l.type&&(e.type="range_end_b"),s.push(e),[s,t]}range_change_end(e,s,t){let a;const[r,n]=Array.from(e.value);return"integer"===n.type?(n.original_value=n.value,n.value=t):"v"===n.type?(a=this.pluck("integer",n.value),a.original_value=a.value,a.value=t):"cv"===n.type&&(a=this.pluck("c",n.value),a.original_value=a.value,a.value=t),this.handle_obj(e,s,e.start_context)}range_change_integer_end(e,s){const[t,a]=Array.from(e.value);return null==e.original_type&&(e.original_type=e.type),null==e.original_value&&(e.original_value=[t,a]),e.type="integer"===t.type?"cv":t.type+"v","integer"===t.type&&(e.value[0]={type:"c",value:[t],indices:t.indices}),"integer"===a.type&&(e.value[1]={type:"v",value:[a],indices:a.indices}),this.handle_obj(e,s,e.start_context)}range_check_new_end(e,s,t,a){let r=0,n=null;if(a.messages.end_chapter_before_start?n="c":a.messages.end_verse_before_start&&(n="v"),null!=n&&(r=this.range_get_new_end_value(s,t,a,n)),r>0){const s={b:t.b,c:t.c,v:t.v};s[n]=r;this.validate_ref(e,s).valid||(r=0)}return r}range_end_b(e,s,t){return this.range(e,s,t)}range_get_new_end_value(e,s,t,a){let r=0;return"c"===a&&t.messages.end_chapter_is_zero||"v"===a&&t.messages.end_verse_is_zero||(e[a]>=10&&s[a]<10&&e[a]-10*Math.floor(e[a]/10)<s[a]?r=s[a]+10*Math.floor(e[a]/10):e[a]>=100&&s[a]<100&&e[a]-100<s[a]&&(r=s[a]+100)),r}range_handle_invalid(e,s,t,a,r,n,i){if(!1===e.valid&&(e.messages.end_chapter_before_start||e.messages.end_verse_before_start)&&("integer"===r.type||"v"===r.type)||!1===e.valid&&e.messages.end_chapter_before_start&&"cv"===r.type){const t=this.range_check_new_end(s.start_context.translations,a,n,e);if(t>0)return this.range_change_end(s,i,t)}if("verse"===this.options.end_range_digits_strategy&&null==a.v&&("integer"===r.type||"v"===r.type)){const e="v"===r.type?this.pluck("integer",r.value):r.value;if(this.validate_ref(s.start_context.translations,{b:a.b,c:a.c,v:e}).valid)return this.range_change_integer_end(s,i)}return null==s.original_type&&(s.original_type=s.type),s.type="sequence",[s.original_value,s.value]=Array.from([[t,r],[[t],[r]]]),this.sequence(s,i,s.start_context)}range_handle_valid(e,s,t,a,r,n,i){if(e.messages.end_chapter_not_exist&&"verse"===this.options.end_range_digits_strategy&&null==a.v&&("integer"===r.type||"v"===r.type)&&this.options.passage_existence_strategy.indexOf("v")>=0){const e="v"===r.type?this.pluck("integer",r.value):r.value;if(this.validate_ref(s.start_context.translations,{b:a.b,c:a.c,v:e}).valid)return[!0,this.range_change_integer_end(s,i)]}return this.range_validate(e,a,n,s),[!1,null]}range_validate(e,s,t,a){return e.messages.end_chapter_not_exist||e.messages.end_chapter_not_exist_in_single_chapter_book?(t.original_c=t.c,t.c=e.messages.end_chapter_not_exist?e.messages.end_chapter_not_exist:e.messages.end_chapter_not_exist_in_single_chapter_book,null!=t.v&&(t.v=this.validate_ref(a.start_context.translations,{b:t.b,c:t.c,v:999}).messages.end_verse_not_exist,delete e.messages.end_verse_is_zero)):e.messages.end_verse_not_exist&&(t.original_v=t.v,t.v=e.messages.end_verse_not_exist),e.messages.end_verse_is_zero&&"allow"!==this.options.zero_verse_strategy&&(t.v=e.messages.end_verse_is_zero),e.messages.end_chapter_is_zero&&(t.c=e.messages.end_chapter_is_zero),[s.c,s.v]=Array.from(this.fix_start_zeroes(e,s.c,s.v)),!0}translation_sequence(e,s,t){e.start_context=bcv_utils.shallow_clone(t);const a=[];for(var r of(a.push({translation:this.books[e.value[0].value].parsed}),Array.from(e.value[1])))null!=(r=this.books[this.pluck("translation",r).value].parsed)&&a.push({translation:r});for(var n of Array.from(a))null!=this.translations.aliases[n.translation]?(n.alias=this.translations.aliases[n.translation].alias,n.osis=this.translations.aliases[n.translation].osis||n.translation.toUpperCase()):(n.alias="default",n.osis=n.translation.toUpperCase());return s.length>0&&(t=this.translation_sequence_apply(s,a)),null==e.absolute_indices&&(e.absolute_indices=this.get_absolute_indices(e.indices)),s.push(e),this.reset_context(t,["translations"]),[s,t]}translation_sequence_apply(e,s){let t,a=0;for(let s=e.length-1,t=s,r=s<=0;r?t<=0:t>=0;r?t++:t--)if(null!=e[t].original_type&&(e[t].type=e[t].original_type),null!=e[t].original_value&&(e[t].value=e[t].original_value),"translation_sequence"===e[t].type){a=t+1;break}if(a<e.length){let r;e[a].start_context.translations=s,[r,t]=Array.from(this.handle_array(e.slice(a),[],e[a].start_context))}else t=bcv_utils.shallow_clone(e[e.length-1].start_context);return t}pluck(e,s){for(var t of Array.from(s))if(null!=t&&null!=t.type&&t.type===e)return"c"===e||"v"===e?this.pluck("integer",t.value):t;return null}pluck_last_recursively(e,s){for(let r=s.length-1;r>=0;r--){var t=s[r];if(null!=t&&null!=t.type){if(t.type===e)return this.pluck(e,[t]);var a=this.pluck_last_recursively(e,t.value);if(null!=a)return a}}return null}set_context_from_object(e,s,t){return(()=>{const a=[];for(var r of Array.from(s))null!=t[r]&&a.push(e[r]=t[r]);return a})()}reset_context(e,s){return Array.from(s).map((s=>delete e[s]))}fix_start_zeroes(e,s,t){return e.messages.start_chapter_is_zero&&"upgrade"===this.options.zero_chapter_strategy&&(s=e.messages.start_chapter_is_zero),e.messages.start_verse_is_zero&&"upgrade"===this.options.zero_verse_strategy&&(t=e.messages.start_verse_is_zero),[s,t]}calculate_indices(e,s){let t,a="book";const r=[];let n=0;s=parseInt(s,10);let i=[e];for(var o of["",""]){var l=[];for(t of Array.from(i))l=l.concat(t.split(o));i=l}for(t of Array.from(i)){var u;a="book"===a?"rest":"book";var c=t.length;0!==c&&("book"===a?(t=t.replace(/\/\d+$/,""),u=n+c,r.length>0&&r[r.length-1].index===s?r[r.length-1].end=u:r.push({start:n,end:u,index:s}),n+=c+2,s=this.books[t].start_index+this.books[t].value.length-n,r.push({start:u+1,end:u+1,index:s})):(u=n+c-1,r.length>0&&r[r.length-1].index===s?r[r.length-1].end=u:r.push({start:n,end:u,index:s}),n+=c))}return r}get_absolute_indices(...e){const[s,t]=Array.from(e[0]);let a=null,r=null;for(var n of Array.from(this.indices))if(null===a&&n.start<=s&&s<=n.end&&(a=s+n.index),n.start<=t&&t<=n.end){r=t+n.index+1;break}return[a,r]}validate_ref(e,s,t){null!=e&&e.length>0||(e=[{translation:"default",osis:"",alias:"default"}]);let a=!1;const r={};for(var n of Array.from(e))if(null==n.alias&&(n.alias="default"),null!=n.alias){null==this.translations.aliases[n.alias]&&(n.alias="default",null==r.translation_unknown&&(r.translation_unknown=[]),r.translation_unknown.push(n));var[i]=Array.from(this.validate_start_ref(n.alias,s,r));t&&([i]=Array.from(this.validate_end_ref(n.alias,s,t,i,r))),!0===i&&(a=!0)}else null==r.translation_invalid&&(r.translation_invalid=[]),r.translation_invalid.push(n);return{valid:a,messages:r}}validate_start_ref(e,s,t){let a=!0;"default"!==e&&null==(null!=this.translations[e]?this.translations[e].chapters[s.b]:void 0)&&this.promote_book_to_translation(s.b,e);const r=null!=(null!=this.translations[e]?this.translations[e].order:void 0)?e:"default";if(null!=s.v&&(s.v=parseInt(s.v,10)),null!=this.translations[r].order[s.b]){if(null==s.c&&(s.c=1),s.c=parseInt(s.c,10),isNaN(s.c))return a=!1,t.start_chapter_not_numeric=!0,[a,t];0===s.c&&(t.start_chapter_is_zero=1,"error"===this.options.zero_chapter_strategy?a=!1:s.c=1),null!=s.v&&0===s.v&&(t.start_verse_is_zero=1,"error"===this.options.zero_verse_strategy?a=!1:"upgrade"===this.options.zero_verse_strategy&&(s.v=1)),s.c>0&&null!=this.translations[e].chapters[s.b][s.c-1]?null!=s.v?isNaN(s.v)?(a=!1,t.start_verse_not_numeric=!0):s.v>this.translations[e].chapters[s.b][s.c-1]&&this.options.passage_existence_strategy.indexOf("v")>=0&&(a=!1,t.start_verse_not_exist=this.translations[e].chapters[s.b][s.c-1]):1===s.c&&"verse"===this.options.single_chapter_1_strategy&&1===this.translations[e].chapters[s.b].length&&(t.start_chapter_1=1):1!==s.c&&1===this.translations[e].chapters[s.b].length?(a=!1,t.start_chapter_not_exist_in_single_chapter_book=1):s.c>0&&this.options.passage_existence_strategy.indexOf("c")>=0&&(a=!1,t.start_chapter_not_exist=this.translations[e].chapters[s.b].length)}else null==s.b?(a=!1,t.start_book_not_defined=!0):(this.options.passage_existence_strategy.indexOf("b")>=0&&(a=!1),t.start_book_not_exist=!0);return[a,t]}validate_end_ref(e,s,t,a,r){const n=null!=(null!=this.translations[e]?this.translations[e].order:void 0)?e:"default";return null!=t.c&&(t.c=parseInt(t.c,10),isNaN(t.c)?(a=!1,r.end_chapter_not_numeric=!0):0===t.c&&(r.end_chapter_is_zero=1,"error"===this.options.zero_chapter_strategy?a=!1:t.c=1)),null!=t.v&&(t.v=parseInt(t.v,10),isNaN(t.v)?(a=!1,r.end_verse_not_numeric=!0):0===t.v&&(r.end_verse_is_zero=1,"error"===this.options.zero_verse_strategy?a=!1:"upgrade"===this.options.zero_verse_strategy&&(t.v=1))),null!=this.translations[n].order[t.b]?(null==t.c&&1===this.translations[e].chapters[t.b].length&&(t.c=1),null!=this.translations[n].order[s.b]&&this.translations[n].order[s.b]>this.translations[n].order[t.b]&&(this.options.passage_existence_strategy.indexOf("b")>=0&&(a=!1),r.end_book_before_start=!0),s.b!==t.b||null==t.c||isNaN(t.c)||(null==s.c&&(s.c=1),!isNaN(parseInt(s.c,10))&&s.c>t.c?(a=!1,r.end_chapter_before_start=!0):s.c!==t.c||null==t.v||isNaN(t.v)||(null==s.v&&(s.v=1),!isNaN(parseInt(s.v,10))&&s.v>t.v&&(a=!1,r.end_verse_before_start=!0))),null==t.c||isNaN(t.c)||null==this.translations[e].chapters[t.b][t.c-1]&&(1===this.translations[e].chapters[t.b].length?r.end_chapter_not_exist_in_single_chapter_book=1:t.c>0&&this.options.passage_existence_strategy.indexOf("c")>=0&&(r.end_chapter_not_exist=this.translations[e].chapters[t.b].length)),null==t.v||isNaN(t.v)||(null==t.c&&(t.c=this.translations[e].chapters[t.b].length),t.v>this.translations[e].chapters[t.b][t.c-1]&&this.options.passage_existence_strategy.indexOf("v")>=0&&(r.end_verse_not_exist=this.translations[e].chapters[t.b][t.c-1]))):(a=!1,r.end_book_not_exist=!0),[a,r]}promote_book_to_translation(e,s){if(null==this.translations[s]&&(this.translations[s]={}),null==this.translations[s].chapters&&(this.translations[s].chapters={}),null==this.translations[s].chapters[e])return this.translations[s].chapters[e]=bcv_utils.shallow_clone_array(this.translations.default.chapters[e])}}function __guard__(e,s){return null!=e?s(e):void 0}bcv_passage.initClass();const bcv_utils={shallow_clone(e){if(null==e)return e;const s={};for(const t of Object.keys(e||{})){const a=e[t];s[t]=a}return s},shallow_clone_array(e){if(null==e)return e;const s=[];for(let t=0,a=e.length,r=0<=a;r?t<=a:t>=a;r?t++:t--)void 0!==e[t]&&(s[t]=e[t]);return s}};bcv_parser.prototype.regexps.translations=RegExp("(?:(?:SEB))\\b","gi"),bcv_parser.prototype.translations={aliases:{default:{osis:"",alias:"default"}},alternates:{},default:{order:{Gen:1,Exod:2,Lev:3,Num:4,Deut:5,Josh:6,Judg:7,Ruth:8,"1Sam":9,"2Sam":10,"1Kgs":11,"2Kgs":12,"1Chr":13,"2Chr":14,Ezra:15,Neh:16,Esth:17,Job:18,Ps:19,Prov:20,Eccl:21,Song:22,Isa:23,Jer:24,Lam:25,Ezek:26,Dan:27,Hos:28,Joel:29,Amos:30,Obad:31,Jonah:32,Mic:33,Nah:34,Hab:35,Zeph:36,Hag:37,Zech:38,Mal:39,Matt:40,Mark:41,Luke:42,John:43,Acts:44,Rom:45,"1Cor":46,"2Cor":47,Gal:48,Eph:49,Phil:50,Col:51,"1Thess":52,"2Thess":53,"1Tim":54,"2Tim":55,Titus:56,Phlm:57,Heb:58,Jas:59,"1Pet":60,"2Pet":61,"1John":62,"2John":63,"3John":64,Jude:65,Rev:66,Tob:67,Jdt:68,GkEsth:69,Wis:70,Sir:71,Bar:72,PrAzar:73,Sus:74,Bel:75,SgThree:76,EpJer:77,"1Macc":78,"2Macc":79,"3Macc":80,"4Macc":81,"1Esd":82,"2Esd":83,PrMan:84},chapters:{Gen:[31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,55,32,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26],Exod:[22,25,22,31,23,30,25,32,35,29,10,51,22,31,27,36,16,27,25,26,36,31,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38],Lev:[17,16,17,35,19,30,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34],Num:[54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,50,13,32,22,29,35,41,30,25,18,65,23,31,40,16,54,42,56,29,34,13],Deut:[46,37,29,49,33,25,26,20,29,22,32,32,18,29,23,22,20,22,21,20,23,30,25,22,19,19,26,68,29,20,30,52,29,12],Josh:[18,24,17,24,15,27,26,35,27,43,23,24,33,15,63,10,18,28,51,9,45,34,16,33],Judg:[36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25],Ruth:[22,23,18,22],"1Sam":[28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,15,23,29,22,44,25,12,25,11,31,13],"2Sam":[27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,33,43,26,22,51,39,25],"1Kgs":[53,46,28,34,18,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,53],"2Kgs":[18,25,27,44,27,33,20,29,37,36,21,21,25,29,38,20,41,37,37,21,26,20,37,20,30],"1Chr":[54,55,24,43,26,81,40,40,44,14,47,40,14,17,29,43,27,17,19,8,30,19,32,31,31,32,34,21,30],"2Chr":[17,18,17,22,14,42,22,18,31,19,23,16,22,15,19,14,19,34,11,37,20,12,21,27,28,23,9,27,36,27,21,33,25,33,27,23],Ezra:[11,70,13,24,17,22,28,36,15,44],Neh:[11,20,32,23,19,19,73,18,38,39,36,47,31],Esth:[22,23,15,17,14,14,10,17,32,3],Job:[22,13,26,21,27,30,21,22,35,22,20,25,28,22,35,22,16,21,29,29,34,30,17,25,6,14,23,28,25,31,40,22,33,37,16,33,24,41,30,24,34,17],Ps:[6,12,8,8,12,10,17,9,20,18,7,8,6,7,5,11,15,50,14,9,13,31,6,10,22,12,14,9,11,12,24,11,22,22,28,12,40,22,13,17,13,11,5,26,17,11,9,14,20,23,19,9,6,7,23,13,11,11,17,12,8,12,11,10,13,20,7,35,36,5,24,20,28,23,10,12,20,72,13,19,16,8,18,12,13,17,7,18,52,17,16,15,5,23,11,13,12,9,9,5,8,28,22,35,45,48,43,13,31,7,10,10,9,8,18,19,2,29,176,7,8,9,4,8,5,6,5,6,8,8,3,18,3,3,21,26,9,8,24,13,10,7,12,15,21,10,20,14,9,6],Prov:[33,22,35,27,23,35,27,36,18,32,31,28,25,35,33,33,28,24,29,30,31,29,35,34,28,28,27,28,27,33,31],Eccl:[18,26,22,16,20,12,29,17,18,20,10,14],Song:[17,17,11,16,16,13,13,14],Isa:[31,22,26,6,30,13,25,22,21,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,12,25,24],Jer:[19,37,25,31,31,30,34,22,26,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34],Lam:[22,22,66,22,22],Ezek:[28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,49,32,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35],Dan:[21,49,30,37,31,28,28,27,27,21,45,13],Hos:[11,23,5,19,15,11,16,14,17,15,12,14,16,9],Joel:[20,32,21],Amos:[15,16,15,13,27,14,17,14,15],Obad:[21],Jonah:[17,10,10,11],Mic:[16,13,12,13,15,16,20],Nah:[15,13,19],Hab:[17,20,19],Zeph:[18,15,20],Hag:[15,23],Zech:[21,13,10,14,11,15,14,23,17,12,17,14,9,21],Mal:[14,17,18,6],Matt:[25,23,17,25,48,34,29,34,38,42,30,50,58,36,39,28,27,35,30,34,46,46,39,51,46,75,66,20],Mark:[45,28,35,41,43,56,37,38,50,52,33,44,37,72,47,20],Luke:[80,52,38,44,39,49,50,56,62,42,54,59,35,35,32,31,37,43,48,47,38,71,56,53],John:[51,25,36,54,47,71,53,59,41,42,57,50,38,31,27,33,26,40,42,31,25],Acts:[26,47,26,37,42,15,60,40,43,48,30,25,52,28,41,40,34,28,41,38,40,30,35,27,27,32,44,31],Rom:[32,29,31,25,21,23,25,39,33,21,36,21,14,23,33,27],"1Cor":[31,16,23,21,13,20,40,13,27,33,34,31,13,40,58,24],"2Cor":[24,17,18,18,21,18,16,24,15,18,33,21,14],Gal:[24,21,29,31,26,18],Eph:[23,22,21,32,33,24],Phil:[30,30,21,23],Col:[29,23,25,18],"1Thess":[10,20,13,18,28],"2Thess":[12,17,18],"1Tim":[20,15,16,16,25,21],"2Tim":[18,26,17,22],Titus:[16,15,15],Phlm:[25],Heb:[14,18,19,16,14,20,28,13,28,39,40,29,25],Jas:[27,26,18,17,20],"1Pet":[25,25,22,19,14],"2Pet":[21,22,18],"1John":[10,29,24,21,21],"2John":[13],"3John":[15],Jude:[25],Rev:[20,29,22,11,14,17,17,13,21,11,19,17,18,20,8,21,18,24,21,15,27,21],Tob:[22,14,17,21,22,18,16,21,6,13,18,22,17,15],Jdt:[16,28,10,15,24,21,32,36,14,23,23,20,20,19,14,25],GkEsth:[22,23,15,17,14,14,10,17,32,13,12,6,18,19,16,24],Wis:[16,24,19,20,23,25,30,21,18,21,26,27,19,31,19,29,21,25,22],Sir:[30,18,31,31,15,37,36,19,18,31,34,18,26,27,20,30,32,33,30,31,28,27,27,34,26,29,30,26,28,25,31,24,33,31,26,31,31,34,35,30,22,25,33,23,26,20,25,25,16,29,30],Bar:[22,35,37,37,9],PrAzar:[68],Sus:[64],Bel:[42],SgThree:[39],EpJer:[73],"1Macc":[64,70,60,61,68,63,50,32,73,89,74,53,53,49,41,24],"2Macc":[36,32,40,50,27,31,42,36,29,38,38,45,26,46,39],"3Macc":[29,33,30,21,51,41,23],"4Macc":[35,24,21,26,38,35,23,29,32,21,27,19,27,20,32,25,24,24],"1Esd":[58,30,24,63,73,34,15,96,55],"2Esd":[40,48,36,52,56,59,70,63,47,59,46,51,58,48,63,78],PrMan:[15],Ps151:[7]}},vulgate:{chapters:{Gen:[31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,55,32,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,32,25],Exod:[22,25,22,31,23,30,25,32,35,29,10,51,22,31,27,36,16,27,25,26,36,31,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,36],Lev:[17,16,17,35,19,30,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,45,34],Num:[54,34,51,49,31,27,89,26,23,36,34,15,34,45,41,50,13,32,22,30,35,41,30,25,18,65,23,31,39,17,54,42,56,29,34,13],Josh:[18,24,17,25,16,27,26,35,27,44,23,24,33,15,63,10,18,28,51,9,43,34,16,33],Judg:[36,23,31,24,32,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,24],"1Sam":[28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,43,15,23,28,23,44,25,12,25,11,31,13],"1Kgs":[53,46,28,34,18,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,54],"1Chr":[54,55,24,43,26,81,40,40,44,14,46,40,14,17,29,43,27,17,19,7,30,19,32,31,31,32,34,21,30],Neh:[11,20,31,23,19,19,73,18,38,39,36,46,31],Job:[22,13,26,21,27,30,21,22,35,22,20,25,28,22,35,23,16,21,29,29,34,30,17,25,6,14,23,28,25,31,40,22,33,37,16,33,24,41,35,28,25,16],Ps:[6,13,9,10,13,11,18,10,39,8,9,6,7,5,10,15,51,15,10,14,32,6,10,22,12,14,9,11,13,25,11,22,23,28,13,40,23,14,18,14,12,5,26,18,12,10,15,21,23,21,11,7,9,24,13,12,12,18,14,9,13,12,11,14,20,8,36,37,6,24,20,28,23,11,13,21,72,13,20,17,8,19,13,14,17,7,19,53,17,16,16,5,23,11,13,12,9,9,5,8,29,22,35,45,48,43,14,31,7,10,10,9,26,9,10,2,29,176,7,8,9,4,8,5,6,5,6,8,8,3,18,3,3,21,26,9,8,24,14,10,8,12,15,21,10,11,9,14,9,6],Eccl:[18,26,22,17,19,11,30,17,18,20,10,14],Song:[16,17,11,16,17,12,13,14],Jer:[19,37,25,31,31,30,34,22,26,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,20,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34],Ezek:[28,9,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,49,32,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35],Dan:[21,49,100,34,31,28,28,27,27,21,45,13,65,42],Hos:[11,24,5,19,15,11,16,14,17,15,12,14,15,10],Amos:[15,16,15,13,27,15,17,14,14],Jonah:[16,11,10,11],Mic:[16,13,12,13,14,16,20],Hag:[14,24],Matt:[25,23,17,25,48,34,29,34,38,42,30,50,58,36,39,28,26,35,30,34,46,46,39,51,46,75,66,20],Mark:[45,28,35,40,43,56,37,39,49,52,33,44,37,72,47,20],John:[51,25,36,54,47,72,53,59,41,42,57,50,38,31,27,33,26,40,42,31,25],Acts:[26,47,26,37,42,15,59,40,43,48,30,25,52,27,41,40,34,28,40,38,40,30,35,27,27,32,44,31],"2Cor":[24,17,18,18,21,18,16,24,15,18,33,21,13],Rev:[20,29,22,11,14,17,17,13,21,11,19,18,18,20,8,21,18,24,21,15,27,21],Tob:[25,23,25,23,28,22,20,24,12,13,21,22,23,17],Jdt:[12,18,15,17,29,21,25,34,19,20,21,20,31,18,15,31],Wis:[16,25,19,20,24,27,30,21,19,21,27,27,19,31,19,29,20,25,20],Sir:[40,23,34,36,18,37,40,22,25,34,36,19,32,27,22,31,31,33,28,33,31,33,38,47,36,28,33,30,35,27,42,28,33,31,26,28,34,39,41,32,28,26,37,27,31,23,31,28,19,31,38,13],Bar:[22,35,38,37,9,72],"1Macc":[67,70,60,61,68,63,50,32,73,89,74,54,54,49,41,24],"2Macc":[36,33,40,50,27,31,42,36,29,38,38,46,26,46,40]}},ceb:{chapters:{"2Cor":[24,17,18,18,21,18,16,24,15,18,33,21,13],Rev:[20,29,22,11,14,17,17,13,21,11,19,18,18,20,8,21,18,24,21,15,27,21],Tob:[22,14,17,21,22,18,16,21,6,13,18,22,18,15],PrAzar:[67],EpJer:[72],"1Esd":[55,26,24,63,71,33,15,92,55]}},kjv:{chapters:{"3John":[14]}},nab:{order:{Gen:1,Exod:2,Lev:3,Num:4,Deut:5,Josh:6,Judg:7,Ruth:8,"1Sam":9,"2Sam":10,"1Kgs":11,"2Kgs":12,"1Chr":13,"2Chr":14,PrMan:15,Ezra:16,Neh:17,"1Esd":18,"2Esd":19,Tob:20,Jdt:21,Esth:22,GkEsth:23,"1Macc":24,"2Macc":25,"3Macc":26,"4Macc":27,Job:28,Ps:29,Prov:30,Eccl:31,Song:32,Wis:33,Sir:34,Isa:35,Jer:36,Lam:37,Bar:38,EpJer:39,Ezek:40,Dan:41,PrAzar:42,Sus:43,Bel:44,SgThree:45,Hos:46,Joel:47,Amos:48,Obad:49,Jonah:50,Mic:51,Nah:52,Hab:53,Zeph:54,Hag:55,Zech:56,Mal:57,Matt:58,Mark:59,Luke:60,John:61,Acts:62,Rom:63,"1Cor":64,"2Cor":65,Gal:66,Eph:67,Phil:68,Col:69,"1Thess":70,"2Thess":71,"1Tim":72,"2Tim":73,Titus:74,Phlm:75,Heb:76,Jas:77,"1Pet":78,"2Pet":79,"1John":80,"2John":81,"3John":82,Jude:83,Rev:84},chapters:{Gen:[31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,54,33,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26],Exod:[22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,26,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38],Lev:[17,16,17,35,26,23,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34],Num:[54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,35,28,32,22,29,35,41,30,25,19,65,23,31,39,17,54,42,56,29,34,13],Deut:[46,37,29,49,33,25,26,20,29,22,32,31,19,29,23,22,20,22,21,20,23,29,26,22,19,19,26,69,28,20,30,52,29,12],"1Sam":[28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,16,23,28,23,44,25,12,25,11,31,13],"2Sam":[27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,32,44,26,22,51,39,25],"1Kgs":[53,46,28,20,32,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,54],"2Kgs":[18,25,27,44,27,33,20,29,37,36,20,22,25,29,38,20,41,37,37,21,26,20,37,20,30],"1Chr":[54,55,24,43,41,66,40,40,44,14,47,41,14,17,29,43,27,17,19,8,30,19,32,31,31,32,34,21,30],"2Chr":[18,17,17,22,14,42,22,18,31,19,23,16,23,14,19,14,19,34,11,37,20,12,21,27,28,23,9,27,36,27,21,33,25,33,27,23],Neh:[11,20,38,17,19,19,72,18,37,40,36,47,31],Job:[22,13,26,21,27,30,21,22,35,22,20,25,28,22,35,22,16,21,29,29,34,30,17,25,6,14,23,28,25,31,40,22,33,37,16,33,24,41,30,32,26,17],Ps:[6,11,9,9,13,11,18,10,21,18,7,9,6,7,5,11,15,51,15,10,14,32,6,10,22,12,14,9,11,13,25,11,22,23,28,13,40,23,14,18,14,12,5,27,18,12,10,15,21,23,21,11,7,9,24,14,12,12,18,14,9,13,12,11,14,20,8,36,37,6,24,20,28,23,11,13,21,72,13,20,17,8,19,13,14,17,7,19,53,17,16,16,5,23,11,13,12,9,9,5,8,29,22,35,45,48,43,14,31,7,10,10,9,8,18,19,2,29,176,7,8,9,4,8,5,6,5,6,8,8,3,18,3,3,21,26,9,8,24,14,10,8,12,15,21,10,20,14,9,6],Eccl:[18,26,22,17,19,12,29,17,18,20,10,14],Song:[17,17,11,16,16,12,14,14],Isa:[31,22,26,6,30,13,25,23,20,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,11,25,24],Jer:[19,37,25,31,31,30,34,23,25,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,24,40,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34],Ezek:[28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,44,37,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35],Dan:[21,49,100,34,30,29,28,27,27,21,45,13,64,42],Hos:[9,25,5,19,15,11,16,14,17,15,11,15,15,10],Joel:[20,27,5,21],Jonah:[16,11,10,11],Mic:[16,13,12,14,14,16,20],Nah:[14,14,19],Zech:[17,17,10,14,11,15,14,23,17,12,17,14,9,21],Mal:[14,17,24],Acts:[26,47,26,37,42,15,60,40,43,49,30,25,52,28,41,40,34,28,40,38,40,30,35,27,27,32,44,31],"2Cor":[24,17,18,18,21,18,16,24,15,18,33,21,13],Rev:[20,29,22,11,14,17,17,13,21,11,19,18,18,20,8,21,18,24,21,15,27,21],Tob:[22,14,17,21,22,18,17,21,6,13,18,22,18,15],Sir:[30,18,31,31,15,37,36,19,18,31,34,18,26,27,20,30,32,33,30,31,28,27,27,33,26,29,30,26,28,25,31,24,33,31,26,31,31,34,35,30,22,25,33,23,26,20,25,25,16,29,30],Bar:[22,35,38,37,9,72],"2Macc":[36,32,40,50,27,31,42,36,29,38,38,46,26,46,39]}},nlt:{chapters:{Rev:[20,29,22,11,14,17,17,13,21,11,19,18,18,20,8,21,18,24,21,15,27,21]}},nrsv:{chapters:{"2Cor":[24,17,18,18,21,18,16,24,15,18,33,21,13],Rev:[20,29,22,11,14,17,17,13,21,11,19,18,18,20,8,21,18,24,21,15,27,21]}}},bcv_parser.prototype.languages=["sk"];const heregex=e=>{let s="",t=!1,a=!1;for(let r=0;r<e.length;r++){const n=e[r];if(a)s+=n,a=!1;else if("\\"!==n)if(t||"["!==n)if(t&&"]"===n)t=!1,s+=n;else if(t||"#"!==n)!t&&/\s/.test(n)||(s+=n);else for(;r<e.length&&"\n"!==e[r];)r+=1;else t=!0,s+=n;else s+=n,a=!0}return s};var grammar;bcv_parser.prototype.regexps.space="[\\s\\xa0]",bcv_parser.prototype.regexps.escaped_passage=RegExp(heregex(String.raw`
|
|
2
2
|
(?:^ | [^\x1f\x1e\dA-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ] ) # Beginning of string or not in the middle of a word or immediately following another book. Only count a book if it's part of a sequence: \`Matt5John3\` is OK, but not \`1Matt5John3\`
|
|
3
3
|
(
|
|
4
4
|
# Start inverted book/chapter (cb)
|
|
@@ -29,7 +29,7 @@ const root=this;class bcv_parser{static initClass(){this.prototype.s="",this.pro
|
|
|
29
29
|
| \d [\s\xa0*]* [b-e] (?! \w )
|
|
30
30
|
| \x1e (?: [\s\xa0*]* [)\]\uff09] )? #ff09 is a full-width closing parenthesis
|
|
31
31
|
| [\d\x1f]
|
|
32
|
-
`),"gi"),bcv_parser.prototype.regexps.control=/[\x1e\x1f]/g,bcv_parser.prototype.regexps.pre_book="[^A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ]",bcv_parser.prototype.regexps.first=`(?:Prv[áa]${bcv_parser.prototype.regexps.space}+kniha|Prv[ýy]${bcv_parser.prototype.regexps.space}+list|Prv[áa]|Prv[ýy]|1${bcv_parser.prototype.regexps.space}+k|I|1)\\.?${bcv_parser.prototype.regexps.space}*`,bcv_parser.prototype.regexps.second=`(?:Druh[áa]${bcv_parser.prototype.regexps.space}+kniha|Druh[ýy]${bcv_parser.prototype.regexps.space}+list|Druh[áa]|Druh[ýy]|2${bcv_parser.prototype.regexps.space}+k|II|2)\\.?${bcv_parser.prototype.regexps.space}*`,bcv_parser.prototype.regexps.third=`(?:Tretia${bcv_parser.prototype.regexps.space}+kniha|Tretia|Tret[íi]|3${bcv_parser.prototype.regexps.space}+k|III|3)\\.?${bcv_parser.prototype.regexps.space}*`,bcv_parser.prototype.regexps.range_and="(?:[&\\u2013\\u2014-]|(?:porov|pozri|alebo|a)|(?:a[žz]|-))",bcv_parser.prototype.regexps.range_only="(?:[\\u2013\\u2014-]|(?:a[žz]|-))",bcv_parser.prototype.regexps.get_books=function(e,s){const
|
|
32
|
+
`),"gi"),bcv_parser.prototype.regexps.control=/[\x1e\x1f]/g,bcv_parser.prototype.regexps.pre_book="[^A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ]",bcv_parser.prototype.regexps.first=`(?:Prv[áa]${bcv_parser.prototype.regexps.space}+kniha|Prv[ýy]${bcv_parser.prototype.regexps.space}+list|Prv[áa]|Prv[ýy]|1${bcv_parser.prototype.regexps.space}+k|I|1)\\.?${bcv_parser.prototype.regexps.space}*`,bcv_parser.prototype.regexps.second=`(?:Druh[áa]${bcv_parser.prototype.regexps.space}+kniha|Druh[ýy]${bcv_parser.prototype.regexps.space}+list|Druh[áa]|Druh[ýy]|2${bcv_parser.prototype.regexps.space}+k|II|2)\\.?${bcv_parser.prototype.regexps.space}*`,bcv_parser.prototype.regexps.third=`(?:Tretia${bcv_parser.prototype.regexps.space}+kniha|Tretia|Tret[íi]|3${bcv_parser.prototype.regexps.space}+k|III|3)\\.?${bcv_parser.prototype.regexps.space}*`,bcv_parser.prototype.regexps.range_and="(?:[&\\u2013\\u2014-]|(?:porov|pozri|alebo|a)|(?:a[žz]|-))",bcv_parser.prototype.regexps.range_only="(?:[\\u2013\\u2014-]|(?:a[žz]|-))",bcv_parser.prototype.regexps.get_books=function(e,s){const t=[{osis:["Ps"],apocrypha:!0,extra:"2",regexp:RegExp("(\\b)(Ps151)(?=\\.1)","g")},{osis:["Gen"],regexp:RegExp(heregex(String.raw`(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
|
|
33
33
|
(?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])|[y\xFD][\s\xa0]*list[\s\xa0]*Moj[zž]i[sš]|[y\xFD][\s\xa0]*Moj[zž]i[sš])ova|K(?:niha|\.)?[\s\xa0]*stvorenia|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Moj[zž]i[sš]ova|(?:1[\s\xa0]*k|I)[\s\xa0]*Moj[zž]i[sš]ova|K(?:niha[\s\xa0]*p[o\xF4]|\.[\s\xa0]*p[o\xF4]|[\s\xa0]*p[o\xF4])vodu|1[\s\xa0]*Moj[zž]i[sš]ova|G(?:enezis|n)|Gen|1[\s\xa0]*M)
|
|
34
34
|
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)`),"gi")},{osis:["Exod"],regexp:RegExp(heregex(String.raw`(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
|
|
35
35
|
(?:Druh(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Moj[zž]i[sš]|Moj[zž]i[sš])|[y\xFD][\s\xa0]*list[\s\xa0]*Moj[zž]i[sš]|[y\xFD][\s\xa0]*Moj[zž]i[sš])ova|(?:2(?:[\s\xa0]*k)?|II)\.[\s\xa0]*Moj[zž]i[sš]ova|(?:2[\s\xa0]*k|II)[\s\xa0]*Moj[zž]i[sš]ova|2[\s\xa0]*Moj[zž]i[sš]ova|Exodus|Ex(?:od)?|2[\s\xa0]*M)
|
|
@@ -197,4 +197,4 @@ const root=this;class bcv_parser{static initClass(){this.prototype.s="",this.pro
|
|
|
197
197
|
(?:[SŠ]tvrt[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*)?Machabejcov|(?:4(?:[\s\xa0]*k)?|IV)\.[\s\xa0]*Machabejcov|(?:4[\s\xa0]*k|IV)[\s\xa0]*Machabejcov|4(?:[\s\xa0]*Machabejcov|[\s\xa0]*Mach|Macc|[\s\xa0]*Mak))
|
|
198
198
|
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)`),"gi")},{osis:["1Macc"],apocrypha:!0,regexp:RegExp(heregex(String.raw`(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])(
|
|
199
199
|
(?:Prv(?:[a\xE1][\s\xa0]*(?:kniha[\s\xa0]*Mach|Ma(?:ch|k))|(?:[y\xFD][\s\xa0]*list|[y\xFD])[\s\xa0]*Mach)abejcov|(?:1(?:[\s\xa0]*k)?|I)\.[\s\xa0]*Machabejcov|(?:1[\s\xa0]*k|I)[\s\xa0]*Machabejcov|1(?:[\s\xa0]*Machabejcov|[\s\xa0]*Mach|Macc|[\s\xa0]*Mak))
|
|
200
|
-
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)`),"gi")}];if(!0===e&&"none"===s)return a;const t=[];for(const r of a)!1===e&&null!=r.apocrypha&&!0===r.apocrypha||("books"===s&&(r.regexp=new RegExp(r.regexp.source,"g")),t.push(r));return t},bcv_parser.prototype.regexps.books=bcv_parser.prototype.regexps.get_books(!1,"none"),function(){"use strict";function e(s,a,t,r){var n=Error.call(this,s);return Object.setPrototypeOf&&Object.setPrototypeOf(n,e.prototype),n.expected=a,n.found=t,n.location=r,n.name="SyntaxError",n}function s(e,s,a){return a=a||" ",e.length>s?e:(s-=e.length,e+(a+=a.repeat(s)).slice(0,s))}!function(e,s){function a(){this.constructor=e}a.prototype=s.prototype,e.prototype=new a}(e,Error),e.prototype.format=function(e){var a="Error: "+this.message;if(this.location){var t,r=null;for(t=0;t<e.length;t++)if(e[t].source===this.location.source){r=e[t].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(n):n,o=this.location.source+":"+i.line+":"+i.column;if(r){var l=this.location.end,u=s("",i.line.toString().length," "),c=r[n.line-1],p=(n.line===l.line?l.column:c.length+1)-n.column||1;a+="\n --\x3e "+o+"\n"+u+" |\n"+i.line+" | "+c+"\n"+u+" | "+s("",n.column-1," ")+s("",p,"^")}else a+="\n at "+o}return a},e.buildMessage=function(e,s){var a={literal:function(e){return'"'+r(e.text)+'"'},class:function(e){var s=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+s.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}function r(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+t(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+t(e)}))}function n(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+t(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+t(e)}))}function i(e){return a[e.type](e)}return"Expected "+function(e){var s,a,t=e.map(i);if(t.sort(),t.length>0){for(s=1,a=1;s<t.length;s++)t[s-1]!==t[s]&&(t[a]=t[s],a++);t.length=a}switch(t.length){case 1:return t[0];case 2:return t[0]+" or "+t[1];default:return t.slice(0,-1).join(", ")+", or "+t[t.length-1]}}(e)+" but "+function(e){return e?'"'+r(e)+'"':"end of input"}(s)+" found."},grammar={StartRules:["start"],SyntaxError:e,parse:function(s,a){var t,r={},n=(a=void 0!==a?a:{}).grammarSource,i={start:Gs},o=Gs,l="(",u=")",c="",p="/",x=",",g=".",h="-",_="th",v="nd",f="st",d="/1",b="ff",y="/9",k="/2",m=".1",E="kapitoly",A="kapitole",S="kapitolu",$="kapitol",z="hlavy",F="kap",D="ver",w="ov",P="porov",M="pozri",J="alebo",I="a",R="title",j="from",C="of",K="in",T="the",Z="book",N="",O=/^[1-8]/,q=/^[a-z]/,L=/^[0-9]/,H=/^[b-e]/,G=/^[\u0161s]/i,B=/^["']/,V=/^[,;\/:&\-\u2013\u2014~]/,W=/^[\-\u2013\u2014]/,U=/^[\u017Ez]/i,Q=/^[([]/,X=/^[)\]]/,Y=/^[^\x1F\x1E([]/,ee=Zs("(",!1),se=Zs(")",!1),ae=Zs("",!1),te=Zs("/",!1),re=Ns([["1","8"]],!1,!1),ne=Zs(",",!1),ie=Zs(".",!1),oe=Zs("-",!1),le=Zs("th",!1),ue=Zs("nd",!1),ce=Zs("st",!1),pe=Zs("/1",!1),xe=Zs("ff",!1),ge=Ns([["a","z"]],!1,!1),he=Zs("/9",!1),_e=Zs("/2",!1),ve=Zs(".1",!1),fe=Ns([["0","9"]],!1,!1),de=Ns([["b","e"]],!1,!1),be=Zs("kapitoly",!1),ye=Zs("kapitole",!1),ke=Zs("kapitolu",!1),me=Zs("kapitol",!1),Ee=Zs("hlavy",!1),Ae=Zs("kap",!1),Se=Zs("ver",!1),$e=Ns(["š","s"],!1,!0),ze=Zs("ov",!1),Fe=Zs(":",!1),De=Ns(['"',"'"],!1,!1),we=Ns([",",";","/",":","&","-","–","—","~"],!1,!1),Pe=Zs("porov",!1),Me=Zs("pozri",!1),Je=Zs("alebo",!1),Ie=Zs("a",!1),Re=Ns(["-","–","—"],!1,!1),je=Ns(["ž","z"],!1,!0),Ce=Zs("title",!1),Ke=Zs("from",!1),Te=Zs("of",!1),Ze=Zs("in",!1),Ne=Zs("the",!1),Oe=Zs("book",!1),qe=Ns(["(","["],!1,!1),Le=Ns([")","]"],!1,!1),He=Zs("",!1),Ge=(Zs(",000",!1),Ns(["","","(","["],!0,!1)),Be=(Ns([" ","\t","\r","\n"," ","*"],!1,!1),function(e,s){return s.unshift([e]),{type:"sequence",value:s,indices:[Rs,Is-1]}}),Ve=function(e,s){return void 0===s&&(s=[]),s.unshift([e]),{type:"sequence_post_enclosed",value:s,indices:[Rs,Is-1]}},We=function(e,s){return e.length&&2===e.length&&(e=e[0]),{type:"range",value:[e,s],indices:[Rs,Is-1]}},Ue=function(e){return{type:"b",value:e.value,indices:[Rs,Is-1]}},Qe=function(e,s){return{type:"bc",value:[e,s],indices:[Rs,Is-1]}},Xe=function(e,s){return{type:"bc",value:[e,s],indices:[Rs,Is-1]}},Ye=function(e,s){return{type:"bc_title",value:[e,s],indices:[Rs,Is-1]}},es=function(e,s){return{type:"bcv",value:[e,s],indices:[Rs,Is-1]}},ss=function(e,s){return{type:"bcv",value:[e,s],indices:[Rs,Is-1]}},as=function(e,s){return{type:"bcv",value:[e,s],indices:[Rs,Is-1]}},ts=function(e,s,a,t){return{type:"range",value:[{type:"bcv",value:[{type:"bc",value:[e,s],indices:[e.indices[0],s.indices[1]]},a],indices:[e.indices[0],a.indices[1]]},t],indices:[Rs,Is-1]}},rs=function(e,s){return{type:"bv",value:[e,s],indices:[Rs,Is-1]}},ns=function(e,s){return{type:"bc",value:[s,e],indices:[Rs,Is-1]}},is=function(e,s,a){return{type:"cb_range",value:[a,e,s],indices:[Rs,Is-1]}},os=function(e,s){return{type:"bcv",value:[e,s],indices:[Rs,Is-1]}},ls=function(e,s){return{type:"bc",value:[s,e],indices:[Rs,Is-1]}},us=function(e,s){return{type:"bcv",value:[e,s],indices:[Rs,Is-1]}},cs=function(e){return{type:"c_psalm",value:e.value,indices:[Rs,Is-1]}},ps=function(e,s){return{type:"cv_psalm",value:[e,s],indices:[Rs,Is-1]}},xs=function(e,s){return{type:"c_title",value:[e,s],indices:[Rs,Is-1]}},gs=function(e,s){return{type:"cv",value:[e,s],indices:[Rs,Is-1]}},hs=function(e,s){return{type:"cv",value:[e,s],indices:[Rs,Is-1]}},_s=function(e){return{type:"c",value:[e],indices:[Rs,Is-1]}},vs=function(e){return{type:"ff",value:[e],indices:[Rs,Is-1]}},fs=function(e,s){return{type:"integer_title",value:[e,s],indices:[Rs,Is-1]}},ds=function(e){return{type:"context",value:e.value,indices:[Rs,Is-1]}},bs=function(e){return{type:"b",value:e.value,indices:[Rs,Is-1]}},ys=function(e){return{type:"bc",value:[e,{type:"c",value:[{type:"integer",value:151,indices:[Is-2,Is-1]}],indices:[Is-2,Is-1]}],indices:[Rs,Is-1]}},ks=function(e,s){return{type:"bcv",value:[e,{type:"v",value:[s],indices:[s.indices[0],s.indices[1]]}],indices:[Rs,Is-1]}},ms=function(e){return{type:"v",value:[e],indices:[Rs,Is-1]}},Es=function(e){return{type:"v",value:[e],indices:[Rs,Is-1]}},As=function(){return{type:"c_explicit"}},Ss=function(){return{type:"v_explicit"}},$s=function(){return""},zs=function(e){return{type:"title",value:[e],indices:[Rs,Is-1]}},Fs=function(e){return{type:"translation_sequence",value:e,indices:[Rs,Is-1]}},Ds=function(e){return{type:"translation_sequence",value:e,indices:[Rs,Is-1]}},ws=function(e){return{type:"translation",value:e.value,indices:[Rs,Is-1]}},Ps=function(e){return{type:"integer",value:parseInt(e.join(""),10),indices:[Rs,Is-1]}},Ms=function(e){return{type:"word",value:e.join(""),indices:[Rs,Is-1]}},Js=function(e){return{type:"stop",value:e,indices:[Rs,Is-1]}},Is=0|a.peg$currPos,Rs=Is,js=[{line:1,column:1}],Cs=Is,Ks=a.peg$maxFailExpected||[],Ts=0|a.peg$silentFails;if(a.startRule){if(!(a.startRule in i))throw new Error("Can't start parsing from rule \""+a.startRule+'".');o=i[a.startRule]}function Zs(e,s){return{type:"literal",text:e,ignoreCase:s}}function Ns(e,s,a){return{type:"class",parts:e,inverted:s,ignoreCase:a}}function Os(e){var a,t=js[e];if(t)return t;if(e>=js.length)a=js.length-1;else for(a=e;!js[--a];);for(t={line:(t=js[a]).line,column:t.column};a<e;)10===s.charCodeAt(a)?(t.line++,t.column=1):t.column++,a++;return js[e]=t,t}function qs(e,s,a){var t=Os(e),r=Os(s),i={source:n,start:{offset:e,line:t.line,column:t.column},end:{offset:s,line:r.line,column:r.column}};return a&&n&&"function"==typeof n.offset&&(i.start=n.offset(i.start),i.end=n.offset(i.end)),i}function Ls(e){Is<Cs||(Is>Cs&&(Cs=Is,Ks=[]),Ks.push(e))}function Hs(s,a,t){return new e(e.buildMessage(s,a),s,a,t)}function Gs(){var e,s;if(e=[],(s=aa())===r&&(s=Bs())===r&&(s=na())===r&&(s=Ws())===r&&(s=_a())===r&&(s=sa())===r&&(s=Xs())===r&&(s=ba())===r&&(s=Ys())===r&&(s=ea())===r&&(s=da())===r&&(s=Qs())===r&&(s=ca())===r&&(s=ta())===r&&(s=ua())===r&&(s=Us())===r&&(s=ia())===r&&(s=la())===r&&(s=ra())===r&&(s=oa())===r&&(s=Pa())===r&&(s=Ma())===r&&(s=$a())===r&&(s=pa())===r&&(s=va())===r&&(s=xa())===r&&(s=ga())===r&&(s=ya())===r&&(s=Ia())===r&&(s=ha())===r&&(s=ka())===r&&(s=ja())===r&&(s=Ca())===r&&(s=fa()),s!==r)for(;s!==r;)e.push(s),(s=aa())===r&&(s=Bs())===r&&(s=na())===r&&(s=Ws())===r&&(s=_a())===r&&(s=sa())===r&&(s=Xs())===r&&(s=ba())===r&&(s=Ys())===r&&(s=ea())===r&&(s=da())===r&&(s=Qs())===r&&(s=ca())===r&&(s=ta())===r&&(s=ua())===r&&(s=Us())===r&&(s=ia())===r&&(s=la())===r&&(s=ra())===r&&(s=oa())===r&&(s=Pa())===r&&(s=Ma())===r&&(s=$a())===r&&(s=pa())===r&&(s=va())===r&&(s=xa())===r&&(s=ga())===r&&(s=ya())===r&&(s=Ia())===r&&(s=ha())===r&&(s=ka())===r&&(s=ja())===r&&(s=Ca())===r&&(s=fa());else e=r;return e}function Bs(){var e,s,a,t,n,i;if(e=Is,(s=na())===r&&(s=aa())===r&&(s=Ws())===r&&(s=_a())===r&&(s=sa())===r&&(s=Xs())===r&&(s=ba())===r&&(s=Ys())===r&&(s=ea())===r&&(s=da())===r&&(s=Qs())===r&&(s=ca())===r&&(s=ta())===r&&(s=ua())===r&&(s=Us())===r&&(s=ia())===r&&(s=la())===r&&(s=ra())===r&&(s=oa())===r&&(s=fa()),s!==r){if(a=[],t=Is,(n=$a())===r&&(n=null),(i=Vs())!==r?t=n=[n,i]:(Is=t,t=r),t!==r)for(;t!==r;)a.push(t),t=Is,(n=$a())===r&&(n=null),(i=Vs())!==r?t=n=[n,i]:(Is=t,t=r);else a=r;a!==r?(Rs=e,e=Be(s,a)):(Is=e,e=r)}else Is=e,e=r;return e}function Vs(){var e;return(e=function(){var e,a,t,n,i,o,c;if(e=Is,40===s.charCodeAt(Is)?(a=l,Is++):(a=r,0===Ts&&Ls(ee)),a!==r)if(Ka(),$a(),(t=Vs())!==r){for(n=[],i=Is,(o=$a())===r&&(o=null),(c=Vs())!==r?i=o=[o,c]:(Is=i,i=r);i!==r;)n.push(i),i=Is,(o=$a())===r&&(o=null),(c=Vs())!==r?i=o=[o,c]:(Is=i,i=r);i=Ka(),41===s.charCodeAt(Is)?(o=u,Is++):(o=r,0===Ts&&Ls(se)),o!==r?(Rs=e,e=Ve(t,n)):(Is=e,e=r)}else Is=e,e=r;else Is=e,e=r;return e}())===r&&(e=na())===r&&(e=aa())===r&&(e=Ws())===r&&(e=_a())===r&&(e=sa())===r&&(e=Xs())===r&&(e=ba())===r&&(e=Ys())===r&&(e=ea())===r&&(e=da())===r&&(e=Qs())===r&&(e=ca())===r&&(e=ta())===r&&(e=ua())===r&&(e=Us())===r&&(e=ia())===r&&(e=la())===r&&(e=ra())===r&&(e=oa())===r&&(e=pa())===r&&(e=va())===r&&(e=xa())===r&&(e=ga())===r&&(e=ya())===r&&(e=Ia())===r&&(e=ha())===r&&(e=ka()),e}function Ws(){var e,s,a,t,n,i,o;return e=Is,(s=sa())===r&&(s=Xs())===r&&(s=ba())===r&&(s=Ys())===r&&(s=ea())===r&&(s=da())===r&&(s=Qs())===r&&(s=ca())===r&&(s=ta())===r&&(s=Is,(a=Us())!==r?(t=Is,Ts++,n=Is,(i=za())!==r?((o=sa())===r&&(o=Xs())===r&&(o=ba())===r&&(o=Ys())===r&&(o=ea())===r&&(o=da())===r&&(o=Qs())===r&&(o=ta())===r&&(o=Us()),o!==r?n=i=[i,o]:(Is=n,n=r)):(Is=n,n=r),Ts--,n!==r?(Is=t,t=void 0):t=r,t!==r?s=a=[a,t]:(Is=s,s=r)):(Is=s,s=r),s===r&&(s=ia())===r&&(s=la())===r&&(s=ua())===r&&(s=ra())===r&&(s=oa())===r&&(s=pa())===r&&(s=va())===r&&(s=xa())===r&&(s=ga())===r&&(s=ya())===r&&(s=Ia())===r&&(s=ha())===r&&(s=ka())),s!==r&&(a=za())!==r?((t=_a())===r&&(t=sa())===r&&(t=Xs())===r&&(t=ba())===r&&(t=Ys())===r&&(t=ea())===r&&(t=da())===r&&(t=Qs())===r&&(t=ca())===r&&(t=ta())===r&&(t=Us())===r&&(t=ia())===r&&(t=la())===r&&(t=ua())===r&&(t=ra())===r&&(t=oa())===r&&(t=pa())===r&&(t=va())===r&&(t=xa())===r&&(t=ya())===r&&(t=Ia())===r&&(t=ga())===r&&(t=ha())===r&&(t=ka()),t!==r?(Rs=e,e=We(s,t)):(Is=e,e=r)):(Is=e,e=r),e}function Us(){var e,a,t,n,i,o;return e=Is,31===s.charCodeAt(Is)?(a=c,Is++):(a=r,0===Ts&&Ls(ae)),a!==r&&(t=Ra())!==r?(n=Is,47===s.charCodeAt(Is)?(i=p,Is++):(i=r,0===Ts&&Ls(te)),i!==r?(o=s.charAt(Is),O.test(o)?Is++:(o=r,0===Ts&&Ls(re)),o!==r?n=i=[i,o]:(Is=n,n=r)):(Is=n,n=r),n===r&&(n=null),31===s.charCodeAt(Is)?(i=c,Is++):(i=r,0===Ts&&Ls(ae)),i!==r?(Rs=e,e=Ue(t)):(Is=e,e=r)):(Is=e,e=r),e}function Qs(){var e,s,a,t,n,i,o,l,u;if(e=Is,(s=Us())!==r){if(a=Is,(t=Ea())!==r?(n=Is,Ts++,i=Is,(o=ha())!==r&&(l=Aa())!==r&&(u=ka())!==r?i=o=[o,l,u]:(Is=i,i=r),Ts--,i!==r?(Is=n,n=void 0):n=r,n!==r?a=t=[t,n]:(Is=a,a=r)):(Is=a,a=r),a===r){if(a=[],(t=Aa())!==r)for(;t!==r;)a.push(t),t=Aa();else a=r;if(a===r){if(a=[],(t=Sa())!==r)for(;t!==r;)a.push(t),t=Sa();else a=r;if(a===r){if(a=[],(t=za())!==r)for(;t!==r;)a.push(t),t=za();else a=r;a===r&&(a=Ka())}}}a!==r&&(t=ha())!==r?(Rs=e,e=Qe(s,t)):(Is=e,e=r)}else Is=e,e=r;return e}function Xs(){var e,s,a;return e=Is,(s=da())===r&&(s=Qs()),s!==r&&(a=Fa())!==r?(Rs=e,e=Ye(s,a)):(Is=e,e=r),e}function Ys(){var e,a,t,n,i,o,l;return e=Is,(a=da())===r&&(a=Qs()),a!==r?(t=Is,Ts++,n=Is,46===s.charCodeAt(Is)?(i=g,Is++):(i=r,0===Ts&&Ls(ie)),i!==r&&(o=Ea())!==r&&(l=ka())!==r?n=i=[i,o,l]:(Is=n,n=r),n===r&&(n=Is,(i=$a())===r&&(i=null),(o=Ea())!==r&&(l=xa())!==r?n=i=[i,o,l]:(Is=n,n=r)),Ts--,n===r?t=void 0:(Is=t,t=r),t!==r?(n=Is,(i=Aa())===r&&(i=$a()),i===r&&(i=null),(o=Ea())!==r?n=i=[i,o]:(Is=n,n=r),n===r&&(n=Aa()),n!==r?((i=ya())===r&&(i=ka()),i!==r?(Rs=e,e=es(a,i)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function ea(){var e,s,a,t,n,i,o;return e=Is,(s=da())===r&&(s=Qs()),s!==r&&Sa()!==r?((a=ya())===r&&(a=ka()),a!==r?(t=Is,Ts++,n=Is,(i=Aa())!==r&&(o=ka())!==r?n=i=[i,o]:(Is=n,n=r),Ts--,n===r?t=void 0:(Is=t,t=r),t!==r?(Rs=e,e=ss(s,a)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function sa(){var e,a,t,n,i,o,l,u;return e=Is,a=function(){var e,a,t,n;return e=Is,(a=Us())!==r?(Ka(),44===s.charCodeAt(Is)?(t=x,Is++):(t=r,0===Ts&&Ls(ne)),t!==r?(Ka(),(n=ha())!==r?(Rs=e,e=Xe(a,n)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}(),a!==r?(Ka(),44===s.charCodeAt(Is)?(t=x,Is++):(t=r,0===Ts&&Ls(ne)),t!==r?(Ka(),(n=ya())===r&&(n=ka()),n!==r?(i=Is,Ts++,o=Is,(l=Aa())!==r&&(u=ka())!==r?o=l=[l,u]:(Is=o,o=r),Ts--,o===r?i=void 0:(Is=i,i=r),i!==r?(Rs=e,e=as(a,n)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function aa(){var e,a,t,n,i,o,l,u;return e=Is,(a=Us())!==r?(45===s.charCodeAt(Is)?(t=h,Is++):(t=r,0===Ts&&Ls(oe)),t===r&&(t=Ta()),t===r&&(t=null),(n=ha())!==r?(45===s.charCodeAt(Is)?(i=h,Is++):(i=r,0===Ts&&Ls(oe)),i!==r&&(o=ka())!==r?(45===s.charCodeAt(Is)?(l=h,Is++):(l=r,0===Ts&&Ls(oe)),l!==r&&(u=ka())!==r?(Rs=e,e=ts(a,n,o,u)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function ta(){var e,s,a,t,n,i;if(e=Is,(s=Us())!==r){if(a=[],(t=Aa())!==r)for(;t!==r;)a.push(t),t=Aa();else a=r;if(a===r){if(a=[],(t=Sa())!==r)for(;t!==r;)a.push(t),t=Sa();else a=r;if(a===r){if(a=[],(t=za())!==r)for(;t!==r;)a.push(t),t=za();else a=r;if(a===r){if(a=Is,t=[],(n=$a())!==r)for(;n!==r;)t.push(n),n=$a();else t=r;t!==r?(n=Is,Ts++,i=Ea(),Ts--,i!==r?(Is=n,n=void 0):n=r,n!==r?a=t=[t,n]:(Is=a,a=r)):(Is=a,a=r),a===r&&(a=Ka())}}}a!==r?((t=ya())===r&&(t=ka()),t!==r?(Rs=e,e=rs(s,t)):(Is=e,e=r)):(Is=e,e=r)}else Is=e,e=r;return e}function ra(){var e,s,a;return e=Is,ma()!==r&&(s=ha())!==r?(Da()===r&&null,(a=Us())!==r?(Rs=e,e=ns(s,a)):(Is=e,e=r)):(Is=e,e=r),e}function na(){var e,s,a,t;return e=Is,ma()!==r&&(s=ha())!==r&&za()!==r&&(a=ha())!==r?(Da()===r&&null,(t=Us())!==r?(Rs=e,e=is(s,a,t)):(Is=e,e=r)):(Is=e,e=r),e}function ia(){var e,s,a;return e=Is,(s=ra())!==r?($a()===r&&null,Ea()!==r&&(a=ka())!==r?(Rs=e,e=os(s,a)):(Is=e,e=r)):(Is=e,e=r),e}function oa(){var e,a,t,n;return e=Is,(a=ha())!==r?(s.substr(Is,2)===_?(t=_,Is+=2):(t=r,0===Ts&&Ls(le)),t===r&&(s.substr(Is,2)===v?(t=v,Is+=2):(t=r,0===Ts&&Ls(ue)),t===r&&(s.substr(Is,2)===f?(t=f,Is+=2):(t=r,0===Ts&&Ls(ce)))),t!==r&&ma()!==r?(Da()===r&&null,(n=Us())!==r?(Rs=e,e=ls(a,n)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function la(){var e,s,a;return e=Is,(s=oa())!==r?($a()===r&&null,Ea()!==r&&(a=ka())!==r?(Rs=e,e=us(s,a)):(Is=e,e=r)):(Is=e,e=r),e}function ua(){var e,a,t,n;return e=Is,31===s.charCodeAt(Is)?(a=c,Is++):(a=r,0===Ts&&Ls(ae)),a!==r&&(t=Ra())!==r?(s.substr(Is,3)===d?(n=d,Is+=3):(n=r,0===Ts&&Ls(pe)),n!==r?(Rs=e,e=cs(t)):(Is=e,e=r)):(Is=e,e=r),e}function ca(){var e,s,a;return e=Is,(s=ua())!==r?($a()===r&&null,Ea()!==r&&(a=ka())!==r?(Rs=e,e=ps(s,a)):(Is=e,e=r)):(Is=e,e=r),e}function pa(){var e,s,a;return e=Is,ma()!==r&&(s=ha())!==r&&(a=Fa())!==r?(Rs=e,e=xs(s,a)):(Is=e,e=r),e}function xa(){var e,a,t,n,i,o,l;return e=Is,Ea()===r&&null,(a=ha())!==r?(t=Is,Ts++,n=Is,46===s.charCodeAt(Is)?(i=g,Is++):(i=r,0===Ts&&Ls(ie)),i!==r&&(o=Ea())!==r&&(l=ka())!==r?n=i=[i,o,l]:(Is=n,n=r),Ts--,n===r?t=void 0:(Is=t,t=r),t!==r?(n=Is,(i=Aa())===r&&(i=null),(o=Ea())!==r?n=i=[i,o]:(Is=n,n=r),n===r&&(n=Aa()),n!==r?((i=ya())===r&&(i=ka()),i!==r?(Rs=e,e=gs(a,i)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function ga(){var e,s,a,t,n,i,o;return e=Is,(s=ha())!==r&&Sa()!==r?((a=ya())===r&&(a=ka()),a!==r?(t=Is,Ts++,n=Is,(i=Aa())!==r&&(o=ka())!==r?n=i=[i,o]:(Is=n,n=r),Ts--,n===r?t=void 0:(Is=t,t=r),t!==r?(Rs=e,e=hs(s,a)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function ha(){var e,s;return e=Is,ma()===r&&null,(s=Ia())!==r?(Rs=e,e=_s(s)):(Is=e,e=r),e}function _a(){var e,a,t,n,i;return e=Is,(a=Ys())===r&&(a=ea())===r&&(a=Qs())===r&&(a=ta())===r&&(a=xa())===r&&(a=ga())===r&&(a=Ia())===r&&(a=ha())===r&&(a=ka()),a!==r?(Ka(),s.substr(Is,2)===b?(t=b,Is+=2):(t=r,0===Ts&&Ls(xe)),t!==r?(wa()===r&&null,n=Is,Ts++,i=s.charAt(Is),q.test(i)?Is++:(i=r,0===Ts&&Ls(ge)),Ts--,i===r?n=void 0:(Is=n,n=r),n!==r?(Rs=e,e=vs(a)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function va(){var e,s,a;return e=Is,(s=Ia())!==r&&(a=Fa())!==r?(Rs=e,e=fs(s,a)):(Is=e,e=r),e}function fa(){var e,a,t,n;return e=Is,31===s.charCodeAt(Is)?(a=c,Is++):(a=r,0===Ts&&Ls(ae)),a!==r&&(t=Ra())!==r?(s.substr(Is,3)===y?(n=y,Is+=3):(n=r,0===Ts&&Ls(he)),n!==r?(Rs=e,e=ds(t)):(Is=e,e=r)):(Is=e,e=r),e}function da(){var e,a,t,n,i;return e=Is,a=function(){var e,a,t,n;return e=Is,31===s.charCodeAt(Is)?(a=c,Is++):(a=r,0===Ts&&Ls(ae)),a!==r&&(t=Ra())!==r?(s.substr(Is,3)===k?(n=k,Is+=3):(n=r,0===Ts&&Ls(_e)),n!==r?(Rs=e,e=bs(t)):(Is=e,e=r)):(Is=e,e=r),e}(),a!==r?(s.substr(Is,2)===m?(t=m,Is+=2):(t=r,0===Ts&&Ls(ve)),t!==r?(n=Is,Ts++,i=s.charAt(Is),L.test(i)?Is++:(i=r,0===Ts&&Ls(fe)),Ts--,i===r?n=void 0:(Is=n,n=r),n!==r?(Rs=e,e=ys(a)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function ba(){var e,a,t,n;return e=Is,(a=da())!==r?(46===s.charCodeAt(Is)?(t=g,Is++):(t=r,0===Ts&&Ls(ie)),t!==r&&(n=Ia())!==r?(Rs=e,e=ks(a,n)):(Is=e,e=r)):(Is=e,e=r),e}function ya(){var e,a,t,n,i,o;return e=Is,Ea()===r&&null,(a=Ia())!==r?(Ka(),t=Is,Ts++,s.substr(Is,2)===b?(n=b,Is+=2):(n=r,0===Ts&&Ls(xe)),Ts--,n===r?t=void 0:(Is=t,t=r),t!==r?(n=s.charAt(Is),H.test(n)?Is++:(n=r,0===Ts&&Ls(de)),n!==r?(i=Is,Ts++,o=s.charAt(Is),q.test(o)?Is++:(o=r,0===Ts&&Ls(ge)),Ts--,o===r?i=void 0:(Is=i,i=r),i!==r?(Rs=e,e=ms(a)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function ka(){var e,s;return e=Is,Ea()===r&&null,(s=Ia())!==r?(Rs=e,e=Es(s)):(Is=e,e=r),e}function ma(){var e,a,t,n;return e=Is,Ka(),s.substr(Is,8)===E?(a=E,Is+=8):(a=r,0===Ts&&Ls(be)),a===r&&(s.substr(Is,8)===A?(a=A,Is+=8):(a=r,0===Ts&&Ls(ye)),a===r&&(s.substr(Is,8)===S?(a=S,Is+=8):(a=r,0===Ts&&Ls(ke)),a===r&&(s.substr(Is,7)===$?(a=$,Is+=7):(a=r,0===Ts&&Ls(me)),a===r&&(s.substr(Is,5)===z?(a=z,Is+=5):(a=r,0===Ts&&Ls(Ee)),a===r&&(a=Is,s.substr(Is,3)===F?(t=F,Is+=3):(t=r,0===Ts&&Ls(Ae)),t!==r?((n=wa())===r&&(n=null),a=t=[t,n]):(Is=a,a=r)))))),a!==r?(t=Ka(),Rs=e,e=As()):(Is=e,e=r),e}function Ea(){var e,a,t,n,i;return e=Is,Ka(),a=Is,s.substr(Is,3)===D?(t=D,Is+=3):(t=r,0===Ts&&Ls(Se)),t!==r?(n=s.charAt(Is),G.test(n)?Is++:(n=r,0===Ts&&Ls($e)),n!==r?(s.substr(Is,2)===w?(i=w,Is+=2):(i=r,0===Ts&&Ls(ze)),i!==r?a=t=[t,n,i]:(Is=a,a=r)):(Is=a,a=r)):(Is=a,a=r),a!==r?(t=Is,Ts++,n=s.charAt(Is),q.test(n)?Is++:(n=r,0===Ts&&Ls(ge)),Ts--,n===r?t=void 0:(Is=t,t=r),t!==r?(n=Ka(),Rs=e,e=Ss()):(Is=e,e=r)):(Is=e,e=r),e}function Aa(){var e,a,t,n,i,o,l,u,c,p;if(e=Is,a=Ka(),t=[],58===s.charCodeAt(Is)?(n=":",Is++):(n=r,0===Ts&&Ls(Fe)),n!==r)for(;n!==r;)t.push(n),58===s.charCodeAt(Is)?(n=":",Is++):(n=r,0===Ts&&Ls(Fe));else t=r;return t===r&&(t=Is,46===s.charCodeAt(Is)?(n=g,Is++):(n=r,0===Ts&&Ls(ie)),n!==r?(i=Is,Ts++,o=Is,l=Ka(),46===s.charCodeAt(Is)?(u=g,Is++):(u=r,0===Ts&&Ls(ie)),u!==r?(c=Ka(),46===s.charCodeAt(Is)?(p=g,Is++):(p=r,0===Ts&&Ls(ie)),p!==r?o=l=[l,u,c,p]:(Is=o,o=r)):(Is=o,o=r),Ts--,o===r?i=void 0:(Is=i,i=r),i!==r?t=n=[n,i]:(Is=t,t=r)):(Is=t,t=r)),t!==r?e=a=[a,t,n=Ka()]:(Is=e,e=r),e}function Sa(){var e,a,t;return e=Is,a=Ka(),t=s.charAt(Is),B.test(t)?Is++:(t=r,0===Ts&&Ls(De)),t!==r?e=a=[a,t,Ka()]:(Is=e,e=r),e===r&&(e=Ta()),e}function $a(){var e,a,t,n,i,o,l,u,c,p;if(e=Is,a=[],t=s.charAt(Is),V.test(t)?Is++:(t=r,0===Ts&&Ls(we)),t===r&&(t=Is,46===s.charCodeAt(Is)?(n=g,Is++):(n=r,0===Ts&&Ls(ie)),n!==r?(i=Is,Ts++,o=Is,l=Ka(),46===s.charCodeAt(Is)?(u=g,Is++):(u=r,0===Ts&&Ls(ie)),u!==r?(c=Ka(),46===s.charCodeAt(Is)?(p=g,Is++):(p=r,0===Ts&&Ls(ie)),p!==r?o=l=[l,u,c,p]:(Is=o,o=r)):(Is=o,o=r),Ts--,o===r?i=void 0:(Is=i,i=r),i!==r?t=n=[n,i]:(Is=t,t=r)):(Is=t,t=r),t===r&&(s.substr(Is,5)===P?(t=P,Is+=5):(t=r,0===Ts&&Ls(Pe)),t===r&&(s.substr(Is,5)===M?(t=M,Is+=5):(t=r,0===Ts&&Ls(Me)),t===r&&(s.substr(Is,5)===J?(t=J,Is+=5):(t=r,0===Ts&&Ls(Je)),t===r&&(97===s.charCodeAt(Is)?(t=I,Is++):(t=r,0===Ts&&Ls(Ie)),t===r&&(t=Ta())))))),t!==r)for(;t!==r;)a.push(t),t=s.charAt(Is),V.test(t)?Is++:(t=r,0===Ts&&Ls(we)),t===r&&(t=Is,46===s.charCodeAt(Is)?(n=g,Is++):(n=r,0===Ts&&Ls(ie)),n!==r?(i=Is,Ts++,o=Is,l=Ka(),46===s.charCodeAt(Is)?(u=g,Is++):(u=r,0===Ts&&Ls(ie)),u!==r?(c=Ka(),46===s.charCodeAt(Is)?(p=g,Is++):(p=r,0===Ts&&Ls(ie)),p!==r?o=l=[l,u,c,p]:(Is=o,o=r)):(Is=o,o=r),Ts--,o===r?i=void 0:(Is=i,i=r),i!==r?t=n=[n,i]:(Is=t,t=r)):(Is=t,t=r),t===r&&(s.substr(Is,5)===P?(t=P,Is+=5):(t=r,0===Ts&&Ls(Pe)),t===r&&(s.substr(Is,5)===M?(t=M,Is+=5):(t=r,0===Ts&&Ls(Me)),t===r&&(s.substr(Is,5)===J?(t=J,Is+=5):(t=r,0===Ts&&Ls(Je)),t===r&&(97===s.charCodeAt(Is)?(t=I,Is++):(t=r,0===Ts&&Ls(Ie)),t===r&&(t=Ta()))))));else a=r;return a!==r&&(Rs=e,a=$s()),e=a}function za(){var e,a,t,n,i,o;if(e=Is,a=Ka(),t=[],n=Is,i=s.charAt(Is),W.test(i)?Is++:(i=r,0===Ts&&Ls(Re)),i!==r?n=i=[i,o=Ka()]:(Is=n,n=r),n===r&&(n=Is,97===s.charCodeAt(Is)?(i=I,Is++):(i=r,0===Ts&&Ls(Ie)),i!==r?(o=s.charAt(Is),U.test(o)?Is++:(o=r,0===Ts&&Ls(je)),o!==r?n=i=[i,o,Ka()]:(Is=n,n=r)):(Is=n,n=r),n===r&&(n=Is,45===s.charCodeAt(Is)?(i=h,Is++):(i=r,0===Ts&&Ls(oe)),i!==r?n=i=[i,o=Ka()]:(Is=n,n=r))),n!==r)for(;n!==r;)t.push(n),n=Is,i=s.charAt(Is),W.test(i)?Is++:(i=r,0===Ts&&Ls(Re)),i!==r?n=i=[i,o=Ka()]:(Is=n,n=r),n===r&&(n=Is,97===s.charCodeAt(Is)?(i=I,Is++):(i=r,0===Ts&&Ls(Ie)),i!==r?(o=s.charAt(Is),U.test(o)?Is++:(o=r,0===Ts&&Ls(je)),o!==r?n=i=[i,o,Ka()]:(Is=n,n=r)):(Is=n,n=r),n===r&&(n=Is,45===s.charCodeAt(Is)?(i=h,Is++):(i=r,0===Ts&&Ls(oe)),i!==r?n=i=[i,o=Ka()]:(Is=n,n=r)));else t=r;return t!==r?e=a=[a,t]:(Is=e,e=r),e}function Fa(){var e,a,t;return e=Is,(a=Aa())===r&&(a=$a()),a===r&&(a=null),s.substr(Is,5)===R?(t=R,Is+=5):(t=r,0===Ts&&Ls(Ce)),t!==r?(Rs=e,e=zs(t)):(Is=e,e=r),e}function Da(){var e,a,t,n,i,o,l,u,c,p;return e=Is,a=Ka(),s.substr(Is,4)===j?(t=j,Is+=4):(t=r,0===Ts&&Ls(Ke)),t===r&&(s.substr(Is,2)===C?(t=C,Is+=2):(t=r,0===Ts&&Ls(Te)),t===r&&(s.substr(Is,2)===K?(t=K,Is+=2):(t=r,0===Ts&&Ls(Ze)))),t!==r?(n=Ka(),i=Is,s.substr(Is,3)===T?(o=T,Is+=3):(o=r,0===Ts&&Ls(Ne)),o!==r?(l=Ka(),s.substr(Is,4)===Z?(u=Z,Is+=4):(u=r,0===Ts&&Ls(Oe)),u!==r?(c=Ka(),s.substr(Is,2)===C?(p=C,Is+=2):(p=r,0===Ts&&Ls(Te)),p!==r?i=o=[o,l,u,c,p,Ka()]:(Is=i,i=r)):(Is=i,i=r)):(Is=i,i=r),i===r&&(i=null),e=a=[a,t,n,i]):(Is=e,e=r),e}function wa(){var e,a,t,n,i,o,l,u,c;return e=Is,a=Ka(),46===s.charCodeAt(Is)?(t=g,Is++):(t=r,0===Ts&&Ls(ie)),t!==r?(n=Is,Ts++,i=Is,o=Ka(),46===s.charCodeAt(Is)?(l=g,Is++):(l=r,0===Ts&&Ls(ie)),l!==r?(u=Ka(),46===s.charCodeAt(Is)?(c=g,Is++):(c=r,0===Ts&&Ls(ie)),c!==r?i=o=[o,l,u,c]:(Is=i,i=r)):(Is=i,i=r),Ts--,i===r?n=void 0:(Is=n,n=r),n!==r?e=a=[a,t,n]:(Is=e,e=r)):(Is=e,e=r),e}function Pa(){var e,a,t,n,i,o,l,u;if(e=Is,Ka(),a=s.charAt(Is),Q.test(a)?Is++:(a=r,0===Ts&&Ls(qe)),a!==r){if(Ka(),t=Is,(n=Ja())!==r){for(i=[],o=Is,(l=$a())!==r&&(u=Ja())!==r?o=l=[l,u]:(Is=o,o=r);o!==r;)i.push(o),o=Is,(l=$a())!==r&&(u=Ja())!==r?o=l=[l,u]:(Is=o,o=r);t=n=[n,i]}else Is=t,t=r;t!==r?(n=Ka(),i=s.charAt(Is),X.test(i)?Is++:(i=r,0===Ts&&Ls(Le)),i!==r?(Rs=e,e=Fs(t)):(Is=e,e=r)):(Is=e,e=r)}else Is=e,e=r;return e}function Ma(){var e,a,t,n,i,o,l,u;if(e=Is,Ka(),a=Is,44===s.charCodeAt(Is)?(t=x,Is++):(t=r,0===Ts&&Ls(ne)),t!==r?a=t=[t,n=Ka()]:(Is=a,a=r),a===r&&(a=null),t=Is,(n=Ja())!==r){for(i=[],o=Is,(l=$a())!==r&&(u=Ja())!==r?o=l=[l,u]:(Is=o,o=r);o!==r;)i.push(o),o=Is,(l=$a())!==r&&(u=Ja())!==r?o=l=[l,u]:(Is=o,o=r);t=n=[n,i]}else Is=t,t=r;return t!==r?(Rs=e,e=Ds(t)):(Is=e,e=r),e}function Ja(){var e,a,t,n;return e=Is,30===s.charCodeAt(Is)?(a=N,Is++):(a=r,0===Ts&&Ls(He)),a!==r&&(t=Ra())!==r?(30===s.charCodeAt(Is)?(n=N,Is++):(n=r,0===Ts&&Ls(He)),n!==r?(Rs=e,e=ws(t)):(Is=e,e=r)):(Is=e,e=r),e}function Ia(){var e;return(e=/^[0-9]{1,3}(?!\d|,000)/.exec(s.substr(Is)))?(Rs=Is,Is+=e[0].length,{type:"integer",value:parseInt(e[0],10),indices:[Rs,Is-1]}):r}function Ra(){var e,a,t;if(e=Is,a=[],t=s.charAt(Is),L.test(t)?Is++:(t=r,0===Ts&&Ls(fe)),t!==r)for(;t!==r;)a.push(t),t=s.charAt(Is),L.test(t)?Is++:(t=r,0===Ts&&Ls(fe));else a=r;return a!==r&&(Rs=e,a=Ps(a)),e=a}function ja(){var e,a,t;if(e=Is,a=[],t=s.charAt(Is),Y.test(t)?Is++:(t=r,0===Ts&&Ls(Ge)),t!==r)for(;t!==r;)a.push(t),t=s.charAt(Is),Y.test(t)?Is++:(t=r,0===Ts&&Ls(Ge));else a=r;return a!==r&&(Rs=e,a=Ms(a)),e=a}function Ca(){var e,a;return e=Is,a=s.charAt(Is),Q.test(a)?Is++:(a=r,0===Ts&&Ls(qe)),a!==r&&(Rs=e,a=Js(a)),e=a}function Ka(){var e;return(e=Ta())===r&&(e=null),e}function Ta(){var e;return(e=/^[\s\xa0*]+/.exec(s.substr(Is)))?(Is+=e[0].length,[]):r}if("punctuation_strategy"in a&&"eu"===a.punctuation_strategy&&(Aa=function(){var e,a,t;e=Is,a=Ka(),44===s.charCodeAt(Is)?(t=x,Is++):(t=r,0===Ts&&Ls(ne));t!==r?e=a=[a,t,Ka()]:(Is=e,e=r);return e},V=/^[;\/:&\-\u2013\u2014~]/),t=o(),a.peg$library)return{peg$result:t,peg$currPos:Is,peg$FAILED:r,peg$maxFailExpected:Ks,peg$maxFailPos:Cs};if(t!==r&&Is===s.length)return t;throw t!==r&&Is<s.length&&Ls({type:"end"}),Hs(Ks,Cs<s.length?s.charAt(Cs):null,Cs<s.length?qs(Cs,Cs+1):qs(Cs,Cs))}}}();
|
|
200
|
+
)(?:(?=[\d\s\xa0.:,;\x1e\x1f&\(\)\uff08\uff09\[\]/"'\*=~\-\u2013\u2014])|$)`),"gi")}];if(!0===e&&"none"===s)return t;const a=[];for(const r of t)!1===e&&null!=r.apocrypha&&!0===r.apocrypha||("books"===s&&(r.regexp=new RegExp(r.regexp.source,"g")),a.push(r));return a},bcv_parser.prototype.regexps.books=bcv_parser.prototype.regexps.get_books(!1,"none"),function(){"use strict";function e(s,t,a,r){var n=Error.call(this,s);return Object.setPrototypeOf&&Object.setPrototypeOf(n,e.prototype),n.expected=t,n.found=a,n.location=r,n.name="SyntaxError",n}function s(e,s,t){return t=t||" ",e.length>s?e:(s-=e.length,e+(t+=t.repeat(s)).slice(0,s))}!function(e,s){function t(){this.constructor=e}t.prototype=s.prototype,e.prototype=new t}(e,Error),e.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var a,r=null;for(a=0;a<e.length;a++)if(e[a].source===this.location.source){r=e[a].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,i=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(n):n,o=this.location.source+":"+i.line+":"+i.column;if(r){var l=this.location.end,u=s("",i.line.toString().length," "),c=r[n.line-1],p=(n.line===l.line?l.column:c.length+1)-n.column||1;t+="\n --\x3e "+o+"\n"+u+" |\n"+i.line+" | "+c+"\n"+u+" | "+s("",n.column-1," ")+s("",p,"^")}else t+="\n at "+o}return t},e.buildMessage=function(e,s){var t={literal:function(e){return'"'+r(e.text)+'"'},class:function(e){var s=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+s.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function a(e){return e.charCodeAt(0).toString(16).toUpperCase()}function r(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+a(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+a(e)}))}function n(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+a(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+a(e)}))}function i(e){return t[e.type](e)}return"Expected "+function(e){var s,t,a=e.map(i);if(a.sort(),a.length>0){for(s=1,t=1;s<a.length;s++)a[s-1]!==a[s]&&(a[t]=a[s],t++);a.length=t}switch(a.length){case 1:return a[0];case 2:return a[0]+" or "+a[1];default:return a.slice(0,-1).join(", ")+", or "+a[a.length-1]}}(e)+" but "+function(e){return e?'"'+r(e)+'"':"end of input"}(s)+" found."},grammar={StartRules:["start"],SyntaxError:e,parse:function(s,t){var a,r={},n=(t=void 0!==t?t:{}).grammarSource,i={start:Gs},o=Gs,l="(",u=")",c="",p="/",x=",",h=".",g="-",_="th",f="nd",v="st",d="/1",b="ff",y="/9",k="/2",m=".1",E="kapitoly",A="kapitole",S="kapitolu",$="kapitol",z="hlavy",F="kap",w="ver",D="ov",P="porov",M="pozri",J="alebo",I="a",R="title",j="from",C="of",K="in",T="the",Z="book",N="",q=/^[1-8]/,O=/^[a-z]/,L=/^[0-9]/,H=/^[b-e]/,G=/^[\u0161s]/i,B=/^["']/,V=/^[,;\/:&\-\u2013\u2014~]/,W=/^[\-\u2013\u2014]/,U=/^[\u017Ez]/i,Q=/^[([]/,X=/^[)\]]/,Y=/^[^\x1F\x1E([]/,ee=Zs("(",!1),se=Zs(")",!1),te=Zs("",!1),ae=Zs("/",!1),re=Ns([["1","8"]],!1,!1),ne=Zs(",",!1),ie=Zs(".",!1),oe=Zs("-",!1),le=Zs("th",!1),ue=Zs("nd",!1),ce=Zs("st",!1),pe=Zs("/1",!1),xe=Zs("ff",!1),he=Ns([["a","z"]],!1,!1),ge=Zs("/9",!1),_e=Zs("/2",!1),fe=Zs(".1",!1),ve=Ns([["0","9"]],!1,!1),de=Ns([["b","e"]],!1,!1),be=Zs("kapitoly",!1),ye=Zs("kapitole",!1),ke=Zs("kapitolu",!1),me=Zs("kapitol",!1),Ee=Zs("hlavy",!1),Ae=Zs("kap",!1),Se=Zs("ver",!1),$e=Ns(["š","s"],!1,!0),ze=Zs("ov",!1),Fe=Zs(":",!1),we=Ns(['"',"'"],!1,!1),De=Ns([",",";","/",":","&","-","–","—","~"],!1,!1),Pe=Zs("porov",!1),Me=Zs("pozri",!1),Je=Zs("alebo",!1),Ie=Zs("a",!1),Re=Ns(["-","–","—"],!1,!1),je=Ns(["ž","z"],!1,!0),Ce=Zs("title",!1),Ke=Zs("from",!1),Te=Zs("of",!1),Ze=Zs("in",!1),Ne=Zs("the",!1),qe=Zs("book",!1),Oe=Ns(["(","["],!1,!1),Le=Ns([")","]"],!1,!1),He=Zs("",!1),Ge=(Zs(",000",!1),Ns(["","","(","["],!0,!1)),Be=(Ns([" ","\t","\r","\n"," ","*"],!1,!1),function(e,s){return s.unshift([e]),{type:"sequence",value:s,indices:[Rs,Is-1]}}),Ve=function(e,s){return void 0===s&&(s=[]),s.unshift([e]),{type:"sequence_post_enclosed",value:s,indices:[Rs,Is-1]}},We=function(e,s){return e.length&&2===e.length&&(e=e[0]),{type:"range",value:[e,s],indices:[Rs,Is-1]}},Ue=function(e){return{type:"b",value:e.value,indices:[Rs,Is-1]}},Qe=function(e,s){return{type:"bc",value:[e,s],indices:[Rs,Is-1]}},Xe=function(e,s){return{type:"bc",value:[e,s],indices:[Rs,Is-1]}},Ye=function(e,s){return{type:"bc_title",value:[e,s],indices:[Rs,Is-1]}},es=function(e,s){return{type:"bcv",value:[e,s],indices:[Rs,Is-1]}},ss=function(e,s){return{type:"bcv",value:[e,s],indices:[Rs,Is-1]}},ts=function(e,s){return{type:"bcv",value:[e,s],indices:[Rs,Is-1]}},as=function(e,s,t,a){return{type:"range",value:[{type:"bcv",value:[{type:"bc",value:[e,s],indices:[e.indices[0],s.indices[1]]},t],indices:[e.indices[0],t.indices[1]]},a],indices:[Rs,Is-1]}},rs=function(e,s){return{type:"bv",value:[e,s],indices:[Rs,Is-1]}},ns=function(e,s){return{type:"bc",value:[s,e],indices:[Rs,Is-1]}},is=function(e,s,t){return{type:"cb_range",value:[t,e,s],indices:[Rs,Is-1]}},os=function(e,s){return{type:"bcv",value:[e,s],indices:[Rs,Is-1]}},ls=function(e,s){return{type:"bc",value:[s,e],indices:[Rs,Is-1]}},us=function(e,s){return{type:"bcv",value:[e,s],indices:[Rs,Is-1]}},cs=function(e){return{type:"c_psalm",value:e.value,indices:[Rs,Is-1]}},ps=function(e,s){return{type:"cv_psalm",value:[e,s],indices:[Rs,Is-1]}},xs=function(e,s){return{type:"c_title",value:[e,s],indices:[Rs,Is-1]}},hs=function(e,s){return{type:"cv",value:[e,s],indices:[Rs,Is-1]}},gs=function(e,s){return{type:"cv",value:[e,s],indices:[Rs,Is-1]}},_s=function(e){return{type:"c",value:[e],indices:[Rs,Is-1]}},fs=function(e){return{type:"ff",value:[e],indices:[Rs,Is-1]}},vs=function(e,s){return{type:"integer_title",value:[e,s],indices:[Rs,Is-1]}},ds=function(e){return{type:"context",value:e.value,indices:[Rs,Is-1]}},bs=function(e){return{type:"b",value:e.value,indices:[Rs,Is-1]}},ys=function(e){return{type:"bc",value:[e,{type:"c",value:[{type:"integer",value:151,indices:[Is-2,Is-1]}],indices:[Is-2,Is-1]}],indices:[Rs,Is-1]}},ks=function(e,s){return{type:"bcv",value:[e,{type:"v",value:[s],indices:[s.indices[0],s.indices[1]]}],indices:[Rs,Is-1]}},ms=function(e){return{type:"v",value:[e],indices:[Rs,Is-1]}},Es=function(e){return{type:"v",value:[e],indices:[Rs,Is-1]}},As=function(){return{type:"c_explicit"}},Ss=function(){return{type:"v_explicit"}},$s=function(){return""},zs=function(e){return{type:"title",value:[e],indices:[Rs,Is-1]}},Fs=function(e){return{type:"translation_sequence",value:e,indices:[Rs,Is-1]}},ws=function(e){return{type:"translation_sequence",value:e,indices:[Rs,Is-1]}},Ds=function(e){return{type:"translation",value:e.value,indices:[Rs,Is-1]}},Ps=function(e){return{type:"integer",value:parseInt(e.join(""),10),indices:[Rs,Is-1]}},Ms=function(e){return{type:"word",value:e.join(""),indices:[Rs,Is-1]}},Js=function(e){return{type:"stop",value:e,indices:[Rs,Is-1]}},Is=0|t.peg$currPos,Rs=Is,js=[{line:1,column:1}],Cs=Is,Ks=t.peg$maxFailExpected||[],Ts=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in i))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=i[t.startRule]}function Zs(e,s){return{type:"literal",text:e,ignoreCase:s}}function Ns(e,s,t){return{type:"class",parts:e,inverted:s,ignoreCase:t}}function qs(e){var t,a=js[e];if(a)return a;if(e>=js.length)t=js.length-1;else for(t=e;!js[--t];);for(a={line:(a=js[t]).line,column:a.column};t<e;)10===s.charCodeAt(t)?(a.line++,a.column=1):a.column++,t++;return js[e]=a,a}function Os(e,s,t){var a=qs(e),r=qs(s),i={source:n,start:{offset:e,line:a.line,column:a.column},end:{offset:s,line:r.line,column:r.column}};return t&&n&&"function"==typeof n.offset&&(i.start=n.offset(i.start),i.end=n.offset(i.end)),i}function Ls(e){Is<Cs||(Is>Cs&&(Cs=Is,Ks=[]),Ks.push(e))}function Hs(s,t,a){return new e(e.buildMessage(s,t),s,t,a)}function Gs(){var e,s;if(e=[],(s=tt())===r&&(s=Bs())===r&&(s=nt())===r&&(s=Ws())===r&&(s=_t())===r&&(s=st())===r&&(s=Xs())===r&&(s=bt())===r&&(s=Ys())===r&&(s=et())===r&&(s=dt())===r&&(s=Qs())===r&&(s=ct())===r&&(s=at())===r&&(s=ut())===r&&(s=Us())===r&&(s=it())===r&&(s=lt())===r&&(s=rt())===r&&(s=ot())===r&&(s=Pt())===r&&(s=Mt())===r&&(s=$t())===r&&(s=pt())===r&&(s=ft())===r&&(s=xt())===r&&(s=ht())===r&&(s=yt())===r&&(s=It())===r&&(s=gt())===r&&(s=kt())===r&&(s=jt())===r&&(s=Ct())===r&&(s=vt()),s!==r)for(;s!==r;)e.push(s),(s=tt())===r&&(s=Bs())===r&&(s=nt())===r&&(s=Ws())===r&&(s=_t())===r&&(s=st())===r&&(s=Xs())===r&&(s=bt())===r&&(s=Ys())===r&&(s=et())===r&&(s=dt())===r&&(s=Qs())===r&&(s=ct())===r&&(s=at())===r&&(s=ut())===r&&(s=Us())===r&&(s=it())===r&&(s=lt())===r&&(s=rt())===r&&(s=ot())===r&&(s=Pt())===r&&(s=Mt())===r&&(s=$t())===r&&(s=pt())===r&&(s=ft())===r&&(s=xt())===r&&(s=ht())===r&&(s=yt())===r&&(s=It())===r&&(s=gt())===r&&(s=kt())===r&&(s=jt())===r&&(s=Ct())===r&&(s=vt());else e=r;return e}function Bs(){var e,s,t,a,n,i;if(e=Is,(s=nt())===r&&(s=tt())===r&&(s=Ws())===r&&(s=_t())===r&&(s=st())===r&&(s=Xs())===r&&(s=bt())===r&&(s=Ys())===r&&(s=et())===r&&(s=dt())===r&&(s=Qs())===r&&(s=ct())===r&&(s=at())===r&&(s=ut())===r&&(s=Us())===r&&(s=it())===r&&(s=lt())===r&&(s=rt())===r&&(s=ot())===r&&(s=vt()),s!==r){if(t=[],a=Is,(n=$t())===r&&(n=null),(i=Vs())!==r?a=n=[n,i]:(Is=a,a=r),a!==r)for(;a!==r;)t.push(a),a=Is,(n=$t())===r&&(n=null),(i=Vs())!==r?a=n=[n,i]:(Is=a,a=r);else t=r;t!==r?(Rs=e,e=Be(s,t)):(Is=e,e=r)}else Is=e,e=r;return e}function Vs(){var e;return(e=function(){var e,t,a,n,i,o,c;if(e=Is,40===s.charCodeAt(Is)?(t=l,Is++):(t=r,0===Ts&&Ls(ee)),t!==r)if(Kt(),$t(),(a=Vs())!==r){for(n=[],i=Is,(o=$t())===r&&(o=null),(c=Vs())!==r?i=o=[o,c]:(Is=i,i=r);i!==r;)n.push(i),i=Is,(o=$t())===r&&(o=null),(c=Vs())!==r?i=o=[o,c]:(Is=i,i=r);i=Kt(),41===s.charCodeAt(Is)?(o=u,Is++):(o=r,0===Ts&&Ls(se)),o!==r?(Rs=e,e=Ve(a,n)):(Is=e,e=r)}else Is=e,e=r;else Is=e,e=r;return e}())===r&&(e=nt())===r&&(e=tt())===r&&(e=Ws())===r&&(e=_t())===r&&(e=st())===r&&(e=Xs())===r&&(e=bt())===r&&(e=Ys())===r&&(e=et())===r&&(e=dt())===r&&(e=Qs())===r&&(e=ct())===r&&(e=at())===r&&(e=ut())===r&&(e=Us())===r&&(e=it())===r&&(e=lt())===r&&(e=rt())===r&&(e=ot())===r&&(e=pt())===r&&(e=ft())===r&&(e=xt())===r&&(e=ht())===r&&(e=yt())===r&&(e=It())===r&&(e=gt())===r&&(e=kt()),e}function Ws(){var e,s,t,a,n,i,o;return e=Is,(s=st())===r&&(s=Xs())===r&&(s=bt())===r&&(s=Ys())===r&&(s=et())===r&&(s=dt())===r&&(s=Qs())===r&&(s=ct())===r&&(s=at())===r&&(s=Is,(t=Us())!==r?(a=Is,Ts++,n=Is,(i=zt())!==r?((o=st())===r&&(o=Xs())===r&&(o=bt())===r&&(o=Ys())===r&&(o=et())===r&&(o=dt())===r&&(o=Qs())===r&&(o=at())===r&&(o=Us()),o!==r?n=i=[i,o]:(Is=n,n=r)):(Is=n,n=r),Ts--,n!==r?(Is=a,a=void 0):a=r,a!==r?s=t=[t,a]:(Is=s,s=r)):(Is=s,s=r),s===r&&(s=it())===r&&(s=lt())===r&&(s=ut())===r&&(s=rt())===r&&(s=ot())===r&&(s=pt())===r&&(s=ft())===r&&(s=xt())===r&&(s=ht())===r&&(s=yt())===r&&(s=It())===r&&(s=gt())===r&&(s=kt())),s!==r&&(t=zt())!==r?((a=_t())===r&&(a=st())===r&&(a=Xs())===r&&(a=bt())===r&&(a=Ys())===r&&(a=et())===r&&(a=dt())===r&&(a=Qs())===r&&(a=ct())===r&&(a=at())===r&&(a=Us())===r&&(a=it())===r&&(a=lt())===r&&(a=ut())===r&&(a=rt())===r&&(a=ot())===r&&(a=pt())===r&&(a=ft())===r&&(a=xt())===r&&(a=yt())===r&&(a=It())===r&&(a=ht())===r&&(a=gt())===r&&(a=kt()),a!==r?(Rs=e,e=We(s,a)):(Is=e,e=r)):(Is=e,e=r),e}function Us(){var e,t,a,n,i,o;return e=Is,31===s.charCodeAt(Is)?(t=c,Is++):(t=r,0===Ts&&Ls(te)),t!==r&&(a=Rt())!==r?(n=Is,47===s.charCodeAt(Is)?(i=p,Is++):(i=r,0===Ts&&Ls(ae)),i!==r?(o=s.charAt(Is),q.test(o)?Is++:(o=r,0===Ts&&Ls(re)),o!==r?n=i=[i,o]:(Is=n,n=r)):(Is=n,n=r),n===r&&(n=null),31===s.charCodeAt(Is)?(i=c,Is++):(i=r,0===Ts&&Ls(te)),i!==r?(Rs=e,e=Ue(a)):(Is=e,e=r)):(Is=e,e=r),e}function Qs(){var e,s,t,a,n,i,o,l,u;if(e=Is,(s=Us())!==r){if(t=Is,(a=Et())!==r?(n=Is,Ts++,i=Is,(o=gt())!==r&&(l=At())!==r&&(u=kt())!==r?i=o=[o,l,u]:(Is=i,i=r),Ts--,i!==r?(Is=n,n=void 0):n=r,n!==r?t=a=[a,n]:(Is=t,t=r)):(Is=t,t=r),t===r){if(t=[],(a=At())!==r)for(;a!==r;)t.push(a),a=At();else t=r;if(t===r){if(t=[],(a=St())!==r)for(;a!==r;)t.push(a),a=St();else t=r;if(t===r){if(t=[],(a=zt())!==r)for(;a!==r;)t.push(a),a=zt();else t=r;t===r&&(t=Kt())}}}t!==r&&(a=gt())!==r?(Rs=e,e=Qe(s,a)):(Is=e,e=r)}else Is=e,e=r;return e}function Xs(){var e,s,t;return e=Is,(s=dt())===r&&(s=Qs()),s!==r&&(t=Ft())!==r?(Rs=e,e=Ye(s,t)):(Is=e,e=r),e}function Ys(){var e,t,a,n,i,o,l;return e=Is,(t=dt())===r&&(t=Qs()),t!==r?(a=Is,Ts++,n=Is,46===s.charCodeAt(Is)?(i=h,Is++):(i=r,0===Ts&&Ls(ie)),i!==r&&(o=Et())!==r&&(l=kt())!==r?n=i=[i,o,l]:(Is=n,n=r),n===r&&(n=Is,(i=$t())===r&&(i=null),(o=Et())!==r&&(l=xt())!==r?n=i=[i,o,l]:(Is=n,n=r)),Ts--,n===r?a=void 0:(Is=a,a=r),a!==r?(n=Is,(i=At())===r&&(i=$t()),i===r&&(i=null),(o=Et())!==r?n=i=[i,o]:(Is=n,n=r),n===r&&(n=At()),n!==r?((i=yt())===r&&(i=kt()),i!==r?(Rs=e,e=es(t,i)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function et(){var e,s,t,a,n,i,o;return e=Is,(s=dt())===r&&(s=Qs()),s!==r&&St()!==r?((t=yt())===r&&(t=kt()),t!==r?(a=Is,Ts++,n=Is,(i=At())!==r&&(o=kt())!==r?n=i=[i,o]:(Is=n,n=r),Ts--,n===r?a=void 0:(Is=a,a=r),a!==r?(Rs=e,e=ss(s,t)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function st(){var e,t,a,n,i,o,l,u;return e=Is,t=function(){var e,t,a,n;return e=Is,(t=Us())!==r?(Kt(),44===s.charCodeAt(Is)?(a=x,Is++):(a=r,0===Ts&&Ls(ne)),a!==r?(Kt(),(n=gt())!==r?(Rs=e,e=Xe(t,n)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}(),t!==r?(Kt(),44===s.charCodeAt(Is)?(a=x,Is++):(a=r,0===Ts&&Ls(ne)),a!==r?(Kt(),(n=yt())===r&&(n=kt()),n!==r?(i=Is,Ts++,o=Is,(l=At())!==r&&(u=kt())!==r?o=l=[l,u]:(Is=o,o=r),Ts--,o===r?i=void 0:(Is=i,i=r),i!==r?(Rs=e,e=ts(t,n)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function tt(){var e,t,a,n,i,o,l,u;return e=Is,(t=Us())!==r?(45===s.charCodeAt(Is)?(a=g,Is++):(a=r,0===Ts&&Ls(oe)),a===r&&(a=Tt()),a===r&&(a=null),(n=gt())!==r?(45===s.charCodeAt(Is)?(i=g,Is++):(i=r,0===Ts&&Ls(oe)),i!==r&&(o=kt())!==r?(45===s.charCodeAt(Is)?(l=g,Is++):(l=r,0===Ts&&Ls(oe)),l!==r&&(u=kt())!==r?(Rs=e,e=as(t,n,o,u)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function at(){var e,s,t,a,n,i;if(e=Is,(s=Us())!==r){if(t=[],(a=At())!==r)for(;a!==r;)t.push(a),a=At();else t=r;if(t===r){if(t=[],(a=St())!==r)for(;a!==r;)t.push(a),a=St();else t=r;if(t===r){if(t=[],(a=zt())!==r)for(;a!==r;)t.push(a),a=zt();else t=r;if(t===r){if(t=Is,a=[],(n=$t())!==r)for(;n!==r;)a.push(n),n=$t();else a=r;a!==r?(n=Is,Ts++,i=Et(),Ts--,i!==r?(Is=n,n=void 0):n=r,n!==r?t=a=[a,n]:(Is=t,t=r)):(Is=t,t=r),t===r&&(t=Kt())}}}t!==r?((a=yt())===r&&(a=kt()),a!==r?(Rs=e,e=rs(s,a)):(Is=e,e=r)):(Is=e,e=r)}else Is=e,e=r;return e}function rt(){var e,s,t;return e=Is,mt()!==r&&(s=gt())!==r?(wt()===r&&null,(t=Us())!==r?(Rs=e,e=ns(s,t)):(Is=e,e=r)):(Is=e,e=r),e}function nt(){var e,s,t,a;return e=Is,mt()!==r&&(s=gt())!==r&&zt()!==r&&(t=gt())!==r?(wt()===r&&null,(a=Us())!==r?(Rs=e,e=is(s,t,a)):(Is=e,e=r)):(Is=e,e=r),e}function it(){var e,s,t;return e=Is,(s=rt())!==r?($t()===r&&null,Et()!==r&&(t=kt())!==r?(Rs=e,e=os(s,t)):(Is=e,e=r)):(Is=e,e=r),e}function ot(){var e,t,a,n;return e=Is,(t=gt())!==r?(s.substr(Is,2)===_?(a=_,Is+=2):(a=r,0===Ts&&Ls(le)),a===r&&(s.substr(Is,2)===f?(a=f,Is+=2):(a=r,0===Ts&&Ls(ue)),a===r&&(s.substr(Is,2)===v?(a=v,Is+=2):(a=r,0===Ts&&Ls(ce)))),a!==r&&mt()!==r?(wt()===r&&null,(n=Us())!==r?(Rs=e,e=ls(t,n)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function lt(){var e,s,t;return e=Is,(s=ot())!==r?($t()===r&&null,Et()!==r&&(t=kt())!==r?(Rs=e,e=us(s,t)):(Is=e,e=r)):(Is=e,e=r),e}function ut(){var e,t,a,n;return e=Is,31===s.charCodeAt(Is)?(t=c,Is++):(t=r,0===Ts&&Ls(te)),t!==r&&(a=Rt())!==r?(s.substr(Is,3)===d?(n=d,Is+=3):(n=r,0===Ts&&Ls(pe)),n!==r?(Rs=e,e=cs(a)):(Is=e,e=r)):(Is=e,e=r),e}function ct(){var e,s,t;return e=Is,(s=ut())!==r?($t()===r&&null,Et()!==r&&(t=kt())!==r?(Rs=e,e=ps(s,t)):(Is=e,e=r)):(Is=e,e=r),e}function pt(){var e,s,t;return e=Is,mt()!==r&&(s=gt())!==r&&(t=Ft())!==r?(Rs=e,e=xs(s,t)):(Is=e,e=r),e}function xt(){var e,t,a,n,i,o,l;return e=Is,Et()===r&&null,(t=gt())!==r?(a=Is,Ts++,n=Is,46===s.charCodeAt(Is)?(i=h,Is++):(i=r,0===Ts&&Ls(ie)),i!==r&&(o=Et())!==r&&(l=kt())!==r?n=i=[i,o,l]:(Is=n,n=r),Ts--,n===r?a=void 0:(Is=a,a=r),a!==r?(n=Is,(i=At())===r&&(i=null),(o=Et())!==r?n=i=[i,o]:(Is=n,n=r),n===r&&(n=At()),n!==r?((i=yt())===r&&(i=kt()),i!==r?(Rs=e,e=hs(t,i)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function ht(){var e,s,t,a,n,i,o;return e=Is,(s=gt())!==r&&St()!==r?((t=yt())===r&&(t=kt()),t!==r?(a=Is,Ts++,n=Is,(i=At())!==r&&(o=kt())!==r?n=i=[i,o]:(Is=n,n=r),Ts--,n===r?a=void 0:(Is=a,a=r),a!==r?(Rs=e,e=gs(s,t)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function gt(){var e,s;return e=Is,mt()===r&&null,(s=It())!==r?(Rs=e,e=_s(s)):(Is=e,e=r),e}function _t(){var e,t,a,n,i;return e=Is,(t=Ys())===r&&(t=et())===r&&(t=Qs())===r&&(t=at())===r&&(t=xt())===r&&(t=ht())===r&&(t=It())===r&&(t=gt())===r&&(t=kt()),t!==r?(Kt(),s.substr(Is,2)===b?(a=b,Is+=2):(a=r,0===Ts&&Ls(xe)),a!==r?(Dt()===r&&null,n=Is,Ts++,i=s.charAt(Is),O.test(i)?Is++:(i=r,0===Ts&&Ls(he)),Ts--,i===r?n=void 0:(Is=n,n=r),n!==r?(Rs=e,e=fs(t)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function ft(){var e,s,t;return e=Is,(s=It())!==r&&(t=Ft())!==r?(Rs=e,e=vs(s,t)):(Is=e,e=r),e}function vt(){var e,t,a,n;return e=Is,31===s.charCodeAt(Is)?(t=c,Is++):(t=r,0===Ts&&Ls(te)),t!==r&&(a=Rt())!==r?(s.substr(Is,3)===y?(n=y,Is+=3):(n=r,0===Ts&&Ls(ge)),n!==r?(Rs=e,e=ds(a)):(Is=e,e=r)):(Is=e,e=r),e}function dt(){var e,t,a,n,i;return e=Is,t=function(){var e,t,a,n;return e=Is,31===s.charCodeAt(Is)?(t=c,Is++):(t=r,0===Ts&&Ls(te)),t!==r&&(a=Rt())!==r?(s.substr(Is,3)===k?(n=k,Is+=3):(n=r,0===Ts&&Ls(_e)),n!==r?(Rs=e,e=bs(a)):(Is=e,e=r)):(Is=e,e=r),e}(),t!==r?(s.substr(Is,2)===m?(a=m,Is+=2):(a=r,0===Ts&&Ls(fe)),a!==r?(n=Is,Ts++,i=s.charAt(Is),L.test(i)?Is++:(i=r,0===Ts&&Ls(ve)),Ts--,i===r?n=void 0:(Is=n,n=r),n!==r?(Rs=e,e=ys(t)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function bt(){var e,t,a,n;return e=Is,(t=dt())!==r?(46===s.charCodeAt(Is)?(a=h,Is++):(a=r,0===Ts&&Ls(ie)),a!==r&&(n=It())!==r?(Rs=e,e=ks(t,n)):(Is=e,e=r)):(Is=e,e=r),e}function yt(){var e,t,a,n,i,o;return e=Is,Et()===r&&null,(t=It())!==r?(Kt(),a=Is,Ts++,s.substr(Is,2)===b?(n=b,Is+=2):(n=r,0===Ts&&Ls(xe)),Ts--,n===r?a=void 0:(Is=a,a=r),a!==r?(n=s.charAt(Is),H.test(n)?Is++:(n=r,0===Ts&&Ls(de)),n!==r?(i=Is,Ts++,o=s.charAt(Is),O.test(o)?Is++:(o=r,0===Ts&&Ls(he)),Ts--,o===r?i=void 0:(Is=i,i=r),i!==r?(Rs=e,e=ms(t)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r)):(Is=e,e=r),e}function kt(){var e,s;return e=Is,Et()===r&&null,(s=It())!==r?(Rs=e,e=Es(s)):(Is=e,e=r),e}function mt(){var e,t,a,n;return e=Is,Kt(),s.substr(Is,8)===E?(t=E,Is+=8):(t=r,0===Ts&&Ls(be)),t===r&&(s.substr(Is,8)===A?(t=A,Is+=8):(t=r,0===Ts&&Ls(ye)),t===r&&(s.substr(Is,8)===S?(t=S,Is+=8):(t=r,0===Ts&&Ls(ke)),t===r&&(s.substr(Is,7)===$?(t=$,Is+=7):(t=r,0===Ts&&Ls(me)),t===r&&(s.substr(Is,5)===z?(t=z,Is+=5):(t=r,0===Ts&&Ls(Ee)),t===r&&(t=Is,s.substr(Is,3)===F?(a=F,Is+=3):(a=r,0===Ts&&Ls(Ae)),a!==r?((n=Dt())===r&&(n=null),t=a=[a,n]):(Is=t,t=r)))))),t!==r?(a=Kt(),Rs=e,e=As()):(Is=e,e=r),e}function Et(){var e,t,a,n,i;return e=Is,Kt(),t=Is,s.substr(Is,3)===w?(a=w,Is+=3):(a=r,0===Ts&&Ls(Se)),a!==r?(n=s.charAt(Is),G.test(n)?Is++:(n=r,0===Ts&&Ls($e)),n!==r?(s.substr(Is,2)===D?(i=D,Is+=2):(i=r,0===Ts&&Ls(ze)),i!==r?t=a=[a,n,i]:(Is=t,t=r)):(Is=t,t=r)):(Is=t,t=r),t!==r?(a=Is,Ts++,n=s.charAt(Is),O.test(n)?Is++:(n=r,0===Ts&&Ls(he)),Ts--,n===r?a=void 0:(Is=a,a=r),a!==r?(n=Kt(),Rs=e,e=Ss()):(Is=e,e=r)):(Is=e,e=r),e}function At(){var e,t,a,n,i,o,l,u,c,p;if(e=Is,t=Kt(),a=[],58===s.charCodeAt(Is)?(n=":",Is++):(n=r,0===Ts&&Ls(Fe)),n!==r)for(;n!==r;)a.push(n),58===s.charCodeAt(Is)?(n=":",Is++):(n=r,0===Ts&&Ls(Fe));else a=r;return a===r&&(a=Is,46===s.charCodeAt(Is)?(n=h,Is++):(n=r,0===Ts&&Ls(ie)),n!==r?(i=Is,Ts++,o=Is,l=Kt(),46===s.charCodeAt(Is)?(u=h,Is++):(u=r,0===Ts&&Ls(ie)),u!==r?(c=Kt(),46===s.charCodeAt(Is)?(p=h,Is++):(p=r,0===Ts&&Ls(ie)),p!==r?o=l=[l,u,c,p]:(Is=o,o=r)):(Is=o,o=r),Ts--,o===r?i=void 0:(Is=i,i=r),i!==r?a=n=[n,i]:(Is=a,a=r)):(Is=a,a=r)),a!==r?e=t=[t,a,n=Kt()]:(Is=e,e=r),e}function St(){var e,t,a;return e=Is,t=Kt(),a=s.charAt(Is),B.test(a)?Is++:(a=r,0===Ts&&Ls(we)),a!==r?e=t=[t,a,Kt()]:(Is=e,e=r),e===r&&(e=Tt()),e}function $t(){var e,t,a,n,i,o,l,u,c,p;if(e=Is,t=[],a=s.charAt(Is),V.test(a)?Is++:(a=r,0===Ts&&Ls(De)),a===r&&(a=Is,46===s.charCodeAt(Is)?(n=h,Is++):(n=r,0===Ts&&Ls(ie)),n!==r?(i=Is,Ts++,o=Is,l=Kt(),46===s.charCodeAt(Is)?(u=h,Is++):(u=r,0===Ts&&Ls(ie)),u!==r?(c=Kt(),46===s.charCodeAt(Is)?(p=h,Is++):(p=r,0===Ts&&Ls(ie)),p!==r?o=l=[l,u,c,p]:(Is=o,o=r)):(Is=o,o=r),Ts--,o===r?i=void 0:(Is=i,i=r),i!==r?a=n=[n,i]:(Is=a,a=r)):(Is=a,a=r),a===r&&(s.substr(Is,5)===P?(a=P,Is+=5):(a=r,0===Ts&&Ls(Pe)),a===r&&(s.substr(Is,5)===M?(a=M,Is+=5):(a=r,0===Ts&&Ls(Me)),a===r&&(s.substr(Is,5)===J?(a=J,Is+=5):(a=r,0===Ts&&Ls(Je)),a===r&&(97===s.charCodeAt(Is)?(a=I,Is++):(a=r,0===Ts&&Ls(Ie)),a===r&&(a=Tt())))))),a!==r)for(;a!==r;)t.push(a),a=s.charAt(Is),V.test(a)?Is++:(a=r,0===Ts&&Ls(De)),a===r&&(a=Is,46===s.charCodeAt(Is)?(n=h,Is++):(n=r,0===Ts&&Ls(ie)),n!==r?(i=Is,Ts++,o=Is,l=Kt(),46===s.charCodeAt(Is)?(u=h,Is++):(u=r,0===Ts&&Ls(ie)),u!==r?(c=Kt(),46===s.charCodeAt(Is)?(p=h,Is++):(p=r,0===Ts&&Ls(ie)),p!==r?o=l=[l,u,c,p]:(Is=o,o=r)):(Is=o,o=r),Ts--,o===r?i=void 0:(Is=i,i=r),i!==r?a=n=[n,i]:(Is=a,a=r)):(Is=a,a=r),a===r&&(s.substr(Is,5)===P?(a=P,Is+=5):(a=r,0===Ts&&Ls(Pe)),a===r&&(s.substr(Is,5)===M?(a=M,Is+=5):(a=r,0===Ts&&Ls(Me)),a===r&&(s.substr(Is,5)===J?(a=J,Is+=5):(a=r,0===Ts&&Ls(Je)),a===r&&(97===s.charCodeAt(Is)?(a=I,Is++):(a=r,0===Ts&&Ls(Ie)),a===r&&(a=Tt()))))));else t=r;return t!==r&&(Rs=e,t=$s()),e=t}function zt(){var e,t,a,n,i,o;if(e=Is,t=Kt(),a=[],n=Is,i=s.charAt(Is),W.test(i)?Is++:(i=r,0===Ts&&Ls(Re)),i!==r?n=i=[i,o=Kt()]:(Is=n,n=r),n===r&&(n=Is,97===s.charCodeAt(Is)?(i=I,Is++):(i=r,0===Ts&&Ls(Ie)),i!==r?(o=s.charAt(Is),U.test(o)?Is++:(o=r,0===Ts&&Ls(je)),o!==r?n=i=[i,o,Kt()]:(Is=n,n=r)):(Is=n,n=r),n===r&&(n=Is,45===s.charCodeAt(Is)?(i=g,Is++):(i=r,0===Ts&&Ls(oe)),i!==r?n=i=[i,o=Kt()]:(Is=n,n=r))),n!==r)for(;n!==r;)a.push(n),n=Is,i=s.charAt(Is),W.test(i)?Is++:(i=r,0===Ts&&Ls(Re)),i!==r?n=i=[i,o=Kt()]:(Is=n,n=r),n===r&&(n=Is,97===s.charCodeAt(Is)?(i=I,Is++):(i=r,0===Ts&&Ls(Ie)),i!==r?(o=s.charAt(Is),U.test(o)?Is++:(o=r,0===Ts&&Ls(je)),o!==r?n=i=[i,o,Kt()]:(Is=n,n=r)):(Is=n,n=r),n===r&&(n=Is,45===s.charCodeAt(Is)?(i=g,Is++):(i=r,0===Ts&&Ls(oe)),i!==r?n=i=[i,o=Kt()]:(Is=n,n=r)));else a=r;return a!==r?e=t=[t,a]:(Is=e,e=r),e}function Ft(){var e,t,a;return e=Is,(t=At())===r&&(t=$t()),t===r&&(t=null),s.substr(Is,5)===R?(a=R,Is+=5):(a=r,0===Ts&&Ls(Ce)),a!==r?(Rs=e,e=zs(a)):(Is=e,e=r),e}function wt(){var e,t,a,n,i,o,l,u,c,p;return e=Is,t=Kt(),s.substr(Is,4)===j?(a=j,Is+=4):(a=r,0===Ts&&Ls(Ke)),a===r&&(s.substr(Is,2)===C?(a=C,Is+=2):(a=r,0===Ts&&Ls(Te)),a===r&&(s.substr(Is,2)===K?(a=K,Is+=2):(a=r,0===Ts&&Ls(Ze)))),a!==r?(n=Kt(),i=Is,s.substr(Is,3)===T?(o=T,Is+=3):(o=r,0===Ts&&Ls(Ne)),o!==r?(l=Kt(),s.substr(Is,4)===Z?(u=Z,Is+=4):(u=r,0===Ts&&Ls(qe)),u!==r?(c=Kt(),s.substr(Is,2)===C?(p=C,Is+=2):(p=r,0===Ts&&Ls(Te)),p!==r?i=o=[o,l,u,c,p,Kt()]:(Is=i,i=r)):(Is=i,i=r)):(Is=i,i=r),i===r&&(i=null),e=t=[t,a,n,i]):(Is=e,e=r),e}function Dt(){var e,t,a,n,i,o,l,u,c;return e=Is,t=Kt(),46===s.charCodeAt(Is)?(a=h,Is++):(a=r,0===Ts&&Ls(ie)),a!==r?(n=Is,Ts++,i=Is,o=Kt(),46===s.charCodeAt(Is)?(l=h,Is++):(l=r,0===Ts&&Ls(ie)),l!==r?(u=Kt(),46===s.charCodeAt(Is)?(c=h,Is++):(c=r,0===Ts&&Ls(ie)),c!==r?i=o=[o,l,u,c]:(Is=i,i=r)):(Is=i,i=r),Ts--,i===r?n=void 0:(Is=n,n=r),n!==r?e=t=[t,a,n]:(Is=e,e=r)):(Is=e,e=r),e}function Pt(){var e,t,a,n,i,o,l,u;if(e=Is,Kt(),t=s.charAt(Is),Q.test(t)?Is++:(t=r,0===Ts&&Ls(Oe)),t!==r){if(Kt(),a=Is,(n=Jt())!==r){for(i=[],o=Is,(l=$t())!==r&&(u=Jt())!==r?o=l=[l,u]:(Is=o,o=r);o!==r;)i.push(o),o=Is,(l=$t())!==r&&(u=Jt())!==r?o=l=[l,u]:(Is=o,o=r);a=n=[n,i]}else Is=a,a=r;a!==r?(n=Kt(),i=s.charAt(Is),X.test(i)?Is++:(i=r,0===Ts&&Ls(Le)),i!==r?(Rs=e,e=Fs(a)):(Is=e,e=r)):(Is=e,e=r)}else Is=e,e=r;return e}function Mt(){var e,t,a,n,i,o,l,u;if(e=Is,Kt(),t=Is,44===s.charCodeAt(Is)?(a=x,Is++):(a=r,0===Ts&&Ls(ne)),a!==r?t=a=[a,n=Kt()]:(Is=t,t=r),t===r&&(t=null),a=Is,(n=Jt())!==r){for(i=[],o=Is,(l=$t())!==r&&(u=Jt())!==r?o=l=[l,u]:(Is=o,o=r);o!==r;)i.push(o),o=Is,(l=$t())!==r&&(u=Jt())!==r?o=l=[l,u]:(Is=o,o=r);a=n=[n,i]}else Is=a,a=r;return a!==r?(Rs=e,e=ws(a)):(Is=e,e=r),e}function Jt(){var e,t,a,n;return e=Is,30===s.charCodeAt(Is)?(t=N,Is++):(t=r,0===Ts&&Ls(He)),t!==r&&(a=Rt())!==r?(30===s.charCodeAt(Is)?(n=N,Is++):(n=r,0===Ts&&Ls(He)),n!==r?(Rs=e,e=Ds(a)):(Is=e,e=r)):(Is=e,e=r),e}function It(){var e;return(e=/^[0-9]{1,3}(?!\d|,000)/.exec(s.substr(Is)))?(Rs=Is,Is+=e[0].length,{type:"integer",value:parseInt(e[0],10),indices:[Rs,Is-1]}):r}function Rt(){var e,t,a;if(e=Is,t=[],a=s.charAt(Is),L.test(a)?Is++:(a=r,0===Ts&&Ls(ve)),a!==r)for(;a!==r;)t.push(a),a=s.charAt(Is),L.test(a)?Is++:(a=r,0===Ts&&Ls(ve));else t=r;return t!==r&&(Rs=e,t=Ps(t)),e=t}function jt(){var e,t,a;if(e=Is,t=[],a=s.charAt(Is),Y.test(a)?Is++:(a=r,0===Ts&&Ls(Ge)),a!==r)for(;a!==r;)t.push(a),a=s.charAt(Is),Y.test(a)?Is++:(a=r,0===Ts&&Ls(Ge));else t=r;return t!==r&&(Rs=e,t=Ms(t)),e=t}function Ct(){var e,t;return e=Is,t=s.charAt(Is),Q.test(t)?Is++:(t=r,0===Ts&&Ls(Oe)),t!==r&&(Rs=e,t=Js(t)),e=t}function Kt(){var e;return(e=Tt())===r&&(e=null),e}function Tt(){var e;return(e=/^[\s\xa0*]+/.exec(s.substr(Is)))?(Is+=e[0].length,[]):r}if("punctuation_strategy"in t&&"eu"===t.punctuation_strategy&&(At=function(){var e,t,a;e=Is,t=Kt(),44===s.charCodeAt(Is)?(a=x,Is++):(a=r,0===Ts&&Ls(ne));a!==r?e=t=[t,a,Kt()]:(Is=e,e=r);return e},V=/^[;\/:&\-\u2013\u2014~]/),a=o(),t.peg$library)return{peg$result:a,peg$currPos:Is,peg$FAILED:r,peg$maxFailExpected:Ks,peg$maxFailPos:Cs};if(a!==r&&Is===s.length)return a;throw a!==r&&Is<s.length&&Ls({type:"end"}),Hs(Ks,Cs<s.length?s.charAt(Cs):null,Cs<s.length?Os(Cs,Cs+1):Os(Cs,Cs))}}}();
|