@gmb/bitmark-parser-generator 1.4.5 → 1.4.7

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.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bitmarkParserGenerator=t():e.bitmarkParserGenerator=t()}(this,(()=>(()=>{"use strict";var e={6688:(e,t,r)=>{function o(e,t){var r;const o=Object.freeze,i=Object.defineProperty,n=Object.assign,s={enumerable:!1},a=new Map,l=new Map,u=new Map,c=new Map,p=new Map,g=(null!==(r=null==t?void 0:t.iterationKeys)&&void 0!==r?r:Object.keys(e)).map((e=>`${e}`));for(const[t,r]of Object.entries(e))a.set(t,r),u.set(t.toLowerCase(),r);for(const[e,t]of a){const r="string"==typeof t?t.toLowerCase():t;l.set(t,e),c.set(r,e)}const d=g.map((e=>a.get(e))),y=g.map((e=>[e,a.get(e)]));return(t=>{let r=e;function f(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?a.get(c.get(e.toLowerCase())):!e||l.has(e)?e:void 0}Object.isExtensible(e)||(r=n({},e)),i(r,"fromKey",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?u.get(e.toLowerCase()):a.get(`${e}`)}},s)),i(r,"fromValue",n({value:f},s)),i(r,"keyFromValue",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):l.get(e)}},s)),i(r,"setMetadata",n({value:function(e,t,r){const o=f(e);o&&p.set(o,t)}},s)),i(r,"getMetadata",n({value:function(e,t){return p.get(e)}},s)),i(r,Symbol.iterator,n({value:function(){let e=0;return{next:()=>e<g.length?{value:a.get(`${g[e++]}`),done:!1}:{done:!0}}}},s)),i(r,"values",n({value:()=>d},s)),i(r,"keys",n({value:()=>g},s)),i(r,"entries",n({value:()=>y},s));let h=r;return(null==t?void 0:t.noFreeze)||(h=o(r),o(g),o(d),o(y)),h})(t)}r.r(t),r.d(t,{superenum:()=>i});const i=o;i.fromObject=o,i.fromArray=function(e,t){Array.isArray(e)||(e=[]);const r=e.reduce(((e,t)=>(e[`${t}`]=t,e)),{});return(!t||t&&!t.iterationKeys)&&((t=Object.assign({},t)).iterationKeys=e),o(r,t)}},390:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,i)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=(this&&this.__importStar,this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))});this&&this.__importDefault;Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.BitmarkParserGenerator=void 0;const s=r(6688),a=r(8256),l=r(8582),u=r(4275),c=r(6958),p=r(9556),g=r(2434),d=r(671),y=(0,s.superenum)({bitmark:"bitmark",json:"json",ast:"ast"});t.Output=y;t.BitmarkParserGenerator=class{constructor(){this.ast=new a.Ast,this.jsonParser=new g.JsonParser,this.bitmarkParser=new p.BitmarkParser,this.textParser=new TextParser_1.TextParser,this.textGenerator=new TextGenerator_1.TextGenerator,this.jsonStringifyPrettify=(e,t,r)=>{const o=!0===t.prettify?2:t.prettify||void 0;return r||!0===t.stringify||void 0!==o?JSON.stringify(e,null,o):e}}version(){return d.env.appVersion.full}info(e){const t=Object.assign({},e),r=new InfoBuilder_1.InfoBuilder;let o;const i=!t.outputFormat||t.outputFormat===InfoFormat_1.InfoFormat.text,n=t.outputFormat===InfoFormat_1.InfoFormat.json,s=t.type===InfoType_1.InfoType.all,a=t.type===InfoType_1.InfoType.deprecated,l=s||!a,u=s||a;if(t.type===InfoType_1.InfoType.bit){const e=r.getSupportedBitConfigs().filter((e=>{if(!t.bit)return!0;return Config_1.Config.getBitType(t.bit).root===e.rootBitType}));o=i?e.map((e=>e.toString({includeChains:!0,includeConfigs:!0}))).join("\n\n--------------\n\n"):e}else{const e=r.getSupportedBits({includeNonDeprecated:l,includeDeprecated:u}).filter((e=>{var r;if(!t.bit)return!0;const o=Config_1.Config.getBitType(t.bit);if(e.name===o.root)return!0;return!!(null===(r=e.aliases)||void 0===r?void 0:r.find((e=>e.name===o.alias)))}));o=i?this.supportedBitsAsString(e):e}if(n){const e=!0===t.prettify?2:t.prettify||void 0;o=JSON.stringify(o,null,e)}return o}convert(e,t){return n(this,void 0,void 0,(function*(){let r;const o=Object.assign({},t),i=Object.assign({},o.jsonOptions),s=o.outputFormat,a=s===y.bitmark,p=s===y.json,g=s===y.ast,f=c.BitmarkParserType.peggy;let h=e;if(d.env.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(h)&&(h=fs.readFileSync(h,{encoding:"utf8"}));let m=this.ast.preprocessAst(h);const T=!!m;T||(m=this.jsonParser.toAst(h));const b=!!(null==m?void 0:m.bits),v=e=>n(this,void 0,void 0,(function*(){yield C(e),yield A(r)})),C=e=>n(this,void 0,void 0,(function*(){r=this.bitmarkParser.toAst(e,{parserType:f})})),x=e=>n(this,void 0,void 0,(function*(){if(f===c.BitmarkParserType.peggy)if(m=this.bitmarkParser.toAst(e,{parserType:f}),o.outputFile){const e=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield e.generate(m)}else{const e=new u.JsonObjectGenerator(o),t=yield e.generate(m);r=this.jsonStringifyPrettify(t,i)}})),A=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(o);r=yield t.generate(e)}})),w=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,i)})),k=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(o),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,i)}})),B=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(o);r=yield t.generate(e)}})),P=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,i)})),K=e=>n(this,void 0,void 0,(function*(){yield k(e)}));return!b&&!T?a?yield v(h):g?yield C(h):yield x(h):T?g?yield w(m):p?yield k(m):yield A(m):p?yield K(m):g?yield P(m):yield B(m),r}))}upgrade(e,t){return n(this,void 0,void 0,(function*(){let r;const o=Object.assign({},t),i=Object.assign({},o.jsonOptions),s=o.bitmarkParserType;let a=e;if(d.env.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(a)&&(a=fs.readFileSync(a,{encoding:"utf8"}));let c=this.jsonParser.toAst(a);const p=e=>n(this,void 0,void 0,(function*(){const t=this.bitmarkParser.toAst(e,{parserType:s});if(o.outputFile){const e=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield e.generate(t)}else{const e=new l.BitmarkStringGenerator(o);r=yield e.generate(t)}})),g=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(o),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,i)}}));return!!!(null==c?void 0:c.bits)?yield p(a):yield g(c),r}))}createAst(e){let t,r=e;d.env.isNode&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let o=this.ast.preprocessAst(r);const i=!!o;i||(o=this.jsonParser.toAst(r));return t=!!!(null==o?void 0:o.bits)&&!i?this.bitmarkParser.toAst(r):o,t}convertText(e,t){var r;return n(this,void 0,void 0,(function*(){let o,i;const n=Object.assign({},t),s=Object.assign({},n.fileOptions),a=Object.assign({},n.jsonOptions),l=null!==(r=n.textFormat)&&void 0!==r?r:TextFormat_1.TextFormat.bitmarkMinusMinus;let u=e;if(d.env.isBrowser&&n.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(u)&&(u=fs.readFileSync(u,{encoding:"utf8"}));const c=this.textParser.preprocessAst(u),p=!!c;if(i=p?yield this.textGenerator.generate(c,l):this.textParser.toAst(u,{textFormat:l}),n.outputFile){const e=n.outputFile.toString();let t=i;p||(t=this.jsonStringifyPrettify(i,a,!0));const r=s.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,t,{flag:r})}else o=p?i:this.jsonStringifyPrettify(i,a);return o}))}breakscapeText(e){return e?e.replace(TextGenerator_1.BREAKSCAPE_REGEX,TextGenerator_1.BREAKSCAPE_REGEX_REPLACER):e}unbreakscapeText(e){return e?(0,text_peggy_parser_1.unbreakscape)(e):e}supportedBitsAsString(e){let t="";for(const r of e)if(t+=`${r.name} (since: ${r.since}`,r.deprecated&&(t+=`, deprecated: ${r.deprecated}`),t+=")\n",r.aliases&&r.aliases.length>0)for(const e of r.aliases)t+=`|__ ${e.name} (since: ${e.since}`,e.deprecated&&(t+=`, deprecated: ${e.deprecated}`),t+=")\n";return t}}},8256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ast=void 0;const o=r(7087),i=r(549),n=r(3633);t.Ast=class{constructor(){(0,o.init)()}walk(e,t,r,o){this.walkRecursive(e,void 0,r,[{index:0,key:t,value:e}],o)}getRouteKey(e){return e.reduce(((t,r,o)=>(+r.key!==r.index&&(t+=`${r.key}`,o<e.length-1&&(t+="_")),t)),"")}printTree(e,t=i.NodeType.bitmarkAst){this.walkRecursive(e,void 0,{enter:(e,t,r)=>{console.log("Enter: "+this.getRouteKey(r))},between:(e,t,r,o,i)=>{console.log("Between: "+this.getRouteKey(i))},exit:(e,t,r)=>{console.log("Exit: "+this.getRouteKey(r))},leaf:(e,t,r)=>{console.log("Leaf: "+this.getRouteKey(r))}},[{index:0,key:t,value:e}],void 0)}preprocessAst(e){if(n.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){return!(!Object.prototype.hasOwnProperty.call(e,"bits")||!Array.isArray(e.bits))}walkRecursive(e,t,r,o,i){const{enter:n,between:s,exit:a,leaf:l}=r,u=o[o.length-1].key,c=!this.isValue(e),p=o[o.length-1];if(c){if(n){if(!1===n(p,t,o,i))return}}else l&&l(p,t,o,i);if(c){const n=this.isArray(e),a=Object.keys(e);for(let l=0,c=a.length;l<c;l++){const g=a[l],d=l===c-1,y=e,f=y[g];if(null!=f){const e={key:this.getAstKey(g,u,n),index:l,value:f},c=o.slice();if(c.push(e),this.walkRecursive(f,p,r,c,i),!d){const r=a[l+1],c=y[r],g={key:this.getAstKey(r,u,n),index:l+1,value:c};if(s){if(!1===s(p,e,g,t,o,i))break}}}}}c&&a&&a(p,t,o,i)}getAstKey(e,t,r){let o=e;return r&&t&&(o=`${t}Value`),i.NodeType.fromKey(o)||`unknown(${o})`}isArray(e){return Array.isArray(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}}},1:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBuilder=void 0;const o=r(2606),i=r(5486),n=r(7646),s=r(672),a=r(994),l=r(3633);t.BaseBuilder=class{toExample(e,t){return null!=t?(!0===t&&(t="true"),!1===t&&(t="false"),{isDefaultExample:!1,isExample:!0,example:t}):e?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}}toExampleBoolean(e,t){const r=null!=t&&!s.BooleanUtils.isBooleanString(t);return null==t||r?e||r?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}:{isDefaultExample:!1,isExample:!0,example:s.BooleanUtils.toBoolean(t)}}toAstProperty(e,t){if(null==t)return;const r=o.Config.getRawPropertiesConfig()[e],u=e=>{if(null!=e){switch(r.format){case i.PropertyFormat.string:return l.StringUtils.isString(e)?l.StringUtils.string(e):void 0;case i.PropertyFormat.trimmedString:return l.StringUtils.isString(e)?l.StringUtils.trimmedString(e):void 0;case i.PropertyFormat.number:return a.NumberUtils.asNumber(e);case i.PropertyFormat.boolean:return s.BooleanUtils.toBoolean(e,!0);case i.PropertyFormat.invertedBoolean:return!s.BooleanUtils.toBoolean(e,!0)}return e}};if(Array.isArray(t)){const e=t;for(let t=0,r=e.length;t<r;t++)e[t]=u(e[t])}else t=u(t);return n.ArrayUtils.asArray(t)}}},9046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;const o=r(3518),i=r(208),n=r(1060),s=r(9779),a=r(1353),l=r(7646),u=r(4598),c=r(994),p=r(3589),g=r(671),d=r(1),y=r(2377);class f extends d.BaseBuilder{bitmark(e){const{bits:t,errors:r}=e,o={bits:t,errors:r};return p.ObjectUtils.removeUnwantedProperties(o),o}bit(e){var t;const{bitType:r,textFormat:n,resourceType:u,id:g,externalId:d,spaceId:f,padletId:h,jupyterId:m,jupyterExecutionCount:T,aiGenerated:b,releaseVersion:v,ageRange:C,lang:x,language:A,computerLanguage:w,target:k,tag:B,icon:P,iconTag:K,colorTag:S,flashcardSet:_,subtype:R,bookAlias:I,coverImage:O,publisher:E,publications:L,author:j,subject:V,date:F,location:G,theme:N,kind:D,action:U,thumbImage:M,focusX:$,focusY:J,duration:q,referenceProperty:H,deeplink:z,externalLink:W,externalLinkText:Y,videoCallLink:X,bot:Z,list:Q,textReference:ee,isTracked:te,isInfoOnly:re,labelTrue:oe,labelFalse:ie,content2Buy:ne,book:se,quotedPerson:ae,partialAnswer:le,reasonableNumOfChars:ue,maxCreatedBits:ce,title:pe,subtitle:ge,level:de,toc:ye,progress:fe,anchor:he,reference:me,referenceEnd:Te,item:be,lead:ve,hint:Ce,instruction:xe,isDefaultExample:Ae,example:we,imageSource:ke,partner:Be,markConfig:Pe,extraProperties:Ke,resources:Se,body:_e,sampleSolution:Re,footer:Ie,markup:Oe,parser:Ee}=e,Le=l.ArrayUtils.asArray(Se),je=this.cardNode(e),Ve=r.root===i.RootBitType.essay?this.toAstProperty(o.PropertyConfigKey.reasonableNumOfChars,ue):void 0,Fe=Object.assign(Object.assign({bitType:r,textFormat:null!==(t=a.TextFormat.fromValue(n))&&void 0!==t?t:a.TextFormat.bitmarkMinusMinus,resourceType:s.ResourceTag.fromValue(u),id:this.toAstProperty(o.PropertyConfigKey.id,g),externalId:this.toAstProperty(o.PropertyConfigKey.externalId,d),spaceId:this.toAstProperty(o.PropertyConfigKey.spaceId,f),padletId:this.toAstProperty(o.PropertyConfigKey.padletId,h),jupyterId:this.toAstProperty(o.PropertyConfigKey.jupyterId,m),jupyterExecutionCount:this.toAstProperty(o.PropertyConfigKey.jupyterExecutionCount,T),aiGenerated:this.toAstProperty(o.PropertyConfigKey.aiGenerated,b),releaseVersion:this.toAstProperty(o.PropertyConfigKey.releaseVersion,v),book:se,ageRange:this.toAstProperty(o.PropertyConfigKey.ageRange,C),lang:this.toAstProperty(o.PropertyConfigKey.lang,x),language:this.toAstProperty(o.PropertyConfigKey.language,A),computerLanguage:this.toAstProperty(o.PropertyConfigKey.computerLanguage,w),target:this.toAstProperty(o.PropertyConfigKey.target,k),tag:this.toAstProperty(o.PropertyConfigKey.tag,B),icon:this.toAstProperty(o.PropertyConfigKey.icon,P),iconTag:this.toAstProperty(o.PropertyConfigKey.iconTag,K),colorTag:this.toAstProperty(o.PropertyConfigKey.colorTag,S),flashcardSet:this.toAstProperty(o.PropertyConfigKey.flashcardSet,_),subtype:this.toAstProperty(o.PropertyConfigKey.subtype,R),bookAlias:this.toAstProperty(o.PropertyConfigKey.bookAlias,I),coverImage:this.toAstProperty(o.PropertyConfigKey.coverImage,O),publisher:this.toAstProperty(o.PropertyConfigKey.publisher,E),publications:this.toAstProperty(o.PropertyConfigKey.publications,L),author:this.toAstProperty(o.PropertyConfigKey.author,j),subject:this.toAstProperty(o.PropertyConfigKey.subject,V),date:this.toAstProperty(o.PropertyConfigKey.date,F),location:this.toAstProperty(o.PropertyConfigKey.location,G),theme:this.toAstProperty(o.PropertyConfigKey.theme,N),kind:this.toAstProperty(o.PropertyConfigKey.kind,D),action:this.toAstProperty(o.PropertyConfigKey.action,U),thumbImage:this.toAstProperty(o.PropertyConfigKey.thumbImage,M),focusX:this.toAstProperty(o.PropertyConfigKey.focusX,$),focusY:this.toAstProperty(o.PropertyConfigKey.focusY,J),deeplink:this.toAstProperty(o.PropertyConfigKey.deeplink,z),externalLink:this.toAstProperty(o.PropertyConfigKey.externalLink,W),externalLinkText:this.toAstProperty(o.PropertyConfigKey.externalLinkText,Y),videoCallLink:this.toAstProperty(o.PropertyConfigKey.videoCallLink,X),bot:this.toAstProperty(o.PropertyConfigKey.bot,Z),duration:this.toAstProperty(o.PropertyConfigKey.duration,q),referenceProperty:this.toAstProperty(o.PropertyConfigKey.property_reference,H),list:this.toAstProperty(o.PropertyConfigKey.list,Q),textReference:this.toAstProperty(o.PropertyConfigKey.textReference,ee),isTracked:this.toAstProperty(o.PropertyConfigKey.isTracked,te),isInfoOnly:this.toAstProperty(o.PropertyConfigKey.isInfoOnly,re),labelTrue:this.toAstProperty(o.PropertyConfigKey.labelTrue,oe),labelFalse:this.toAstProperty(o.PropertyConfigKey.labelFalse,ie),content2Buy:this.toAstProperty(o.PropertyConfigKey.content2Buy,ne),quotedPerson:this.toAstProperty(o.PropertyConfigKey.quotedPerson,ae),partialAnswer:this.toAstProperty(o.PropertyConfigKey.partialAnswer,le),reasonableNumOfChars:Ve,maxCreatedBits:this.toAstProperty(o.PropertyConfigKey.maxCreatedBits,ce),title:pe,subtitle:ge,level:c.NumberUtils.asNumber(de),toc:this.toAstProperty(o.PropertyConfigKey.toc,ye),progress:this.toAstProperty(o.PropertyConfigKey.progress,fe),anchor:he,reference:me,referenceEnd:Te,markConfig:Pe,itemLead:this.itemLead(be,ve),hint:Ce,instruction:xe},this.toExample(Ae,we)),{imageSource:ke,partner:Be,resources:Le,body:_e,sampleSolution:l.ArrayUtils.asSingle(Re),cardNode:je,footer:Ie,markup:Oe,parser:Ee,extraProperties:this.parseExtraProperties(Ke)});return r.root===i.RootBitType.interview&&this.pushDownTree(void 0,void 0,je,"questions",o.PropertyConfigKey.reasonableNumOfChars,ue),this.pushExampleDownTree(_e,je,Ae,we),this.setDefaultBitValues(Fe),this.setIsExampleFlags(Fe),this.addVersionToParserInfo(Fe),p.ObjectUtils.removeUnwantedProperties(Fe,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),y.NodeValidator.validateBit(Fe)}choice(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:s},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}response(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:s},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}botResponse(e){const{response:t,reaction:r,feedback:o,item:i,lead:n,hint:s}=e,a={response:t,reaction:r,feedback:o,itemLead:this.itemLead(i,n),hint:s};return p.ObjectUtils.removeUnwantedProperties(a,{ignoreEmptyString:["response","reaction","feedback"]}),a}quiz(e){const{choices:t,responses:r,item:o,lead:i,hint:n,instruction:s,isDefaultExample:a,example:l}=e;this.pushExampleDownTreeBoolean(a,l,!0,t),this.pushExampleDownTreeBoolean(a,l,!1,r);const u={itemLead:this.itemLead(o,i),hint:n,instruction:s,isExample:a||null!=l,choices:t,responses:r};return p.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}heading(e){var t;const{forKeys:r,forValues:o}=e;if(null==r)return;const i={forKeys:r||"",forValues:null!==(t=l.ArrayUtils.asArray(o))&&void 0!==t?t:[]};return p.ObjectUtils.removeUnwantedProperties(i),i}pair(e){const{key:t,keyAudio:r,keyImage:o,values:i,item:n,lead:s,hint:a,instruction:l,isCaseSensitive:u,isShortAnswer:c,isDefaultExample:g,example:d}=e,y=Object.assign(Object.assign({key:t,keyAudio:r,keyImage:o,itemLead:this.itemLead(n,s),hint:a,instruction:l},this.toExample(g,d)),{isCaseSensitive:u,isShortAnswer:c,values:i});return p.ObjectUtils.removeUnwantedProperties(y,{ignoreAllFalse:!0}),y}matrix(e){const{key:t,cells:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isShortAnswer:l,isDefaultExample:u}=e;let c=!1;for(const e of null!=r?r:[])u&&!e.isExample&&(e.isDefaultExample=!0,e.isExample=!0),c=!!e.isExample||c;const g={key:t,itemLead:this.itemLead(o,i),hint:n,instruction:s,isCaseSensitive:a,isShortAnswer:l,isExample:c,cells:r};return p.ObjectUtils.removeUnwantedProperties(g,{ignoreAllFalse:!0}),g}matrixCell(e){const{values:t,item:r,lead:o,hint:i,instruction:n,isDefaultExample:s,example:a}=e,l=Object.assign({values:t,itemLead:this.itemLead(r,o),hint:i,instruction:n},this.toExample(s,a));return p.ObjectUtils.removeUnwantedProperties(l,{ignoreAllFalse:!0}),l}question(e){const{question:t,partialAnswer:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isShortAnswer:l,reasonableNumOfChars:u,sampleSolution:c,isDefaultExample:g,example:d}=e,y=Object.assign(Object.assign({itemLead:this.itemLead(o,i),question:t,partialAnswer:r,hint:n,instruction:s},this.toExample(g,d)),{isCaseSensitive:a,isShortAnswer:l,reasonableNumOfChars:u,sampleSolution:c});return p.ObjectUtils.removeUnwantedProperties(y,{ignoreEmptyString:["question"],ignoreAllFalse:!0}),y}body(e){const{bodyParts:t}=e;return{bodyParts:t}}bodyText(e){const{text:t}=e;return{type:n.BodyBitType.text,data:{bodyText:t}}}footerText(e){const{text:t}=e;return{footerText:t}}gap(e){const{solutions:t,item:r,lead:o,hint:i,instruction:s,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c={type:n.BodyBitType.gap,data:Object.assign(Object.assign({solutions:t,itemLead:this.itemLead(r,o),hint:i,instruction:s},this.toExample(l,u)),{isCaseSensitive:a})};return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}markConfig(e){const{mark:t,color:r,emphasis:o}=e,i={mark:t,color:r,emphasis:o};return p.ObjectUtils.removeUnwantedProperties(i),i}mark(e){const{solution:t,mark:r,item:o,lead:i,hint:s,instruction:a,isDefaultExample:l,example:u}=e,c={type:n.BodyBitType.mark,data:Object.assign({solution:t,mark:r,itemLead:this.itemLead(o,i),hint:s,instruction:a},this.toExample(l,u))};return p.ObjectUtils.removeUnwantedProperties(c),c}select(e){const{options:t,prefix:r,postfix:o,item:i,lead:s,hint:a,instruction:l,isCaseSensitive:u}=e,c={type:n.BodyBitType.select,data:{prefix:r,options:t,postfix:o,itemLead:this.itemLead(i,s),hint:a,instruction:l,isCaseSensitive:u}};return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}selectOption(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:s},this.toExample(l,u)),{isCaseSensitive:a});return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}highlight(e){const{texts:t,prefix:r,postfix:o,item:i,lead:s,hint:a,instruction:l,isCaseSensitive:u}=e,c={type:n.BodyBitType.highlight,data:{prefix:r,texts:t,postfix:o,itemLead:this.itemLead(i,s),hint:a,instruction:l,isCaseSensitive:u}};return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}highlightText(e){const{text:t,isCorrect:r,isHighlighted:o,item:i,lead:n,hint:s,instruction:a,isCaseSensitive:l,isDefaultExample:u,example:c}=e,g=Object.assign(Object.assign({text:t,isCorrect:!!r,isHighlighted:!!o,itemLead:this.itemLead(i,n),hint:s,instruction:a},this.toExample(u,c)),{isCaseSensitive:l});return p.ObjectUtils.removeUnwantedProperties(g,{ignoreAllFalse:!0}),g}flashcard(e){const{question:t,answer:r,alternativeAnswers:o,item:i,lead:n,hint:s,instruction:a,isDefaultExample:l,example:u}=e,c=Object.assign({question:t,answer:r,alternativeAnswers:o,itemLead:this.itemLead(i,n),hint:s,instruction:a},this.toExampleBoolean(l,u));return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}statement(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:s},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}imageSource(e){const{url:t,mockupId:r,size:o,format:i,trim:n}=e,s={url:t,mockupId:r,size:o,format:i,trim:n};return p.ObjectUtils.removeUnwantedProperties(s,{ignoreFalse:["trim"]}),s}partner(e){const{name:t,avatarImage:r}=e,o={name:t,avatarImage:r};return p.ObjectUtils.removeUnwantedProperties(o),o}comment(e){const{text:t,location:r}=e,o={text:t,location:r};return p.ObjectUtils.removeUnwantedProperties(o),o}itemLead(e,t){let r;return(e||t)&&(r={item:e,lead:t}),r}cardNode(e){let t;const{questions:r,elements:o,flashcards:i,statement:n,statements:s,choices:a,responses:l,quizzes:u,heading:c,pairs:g,matrix:d,botResponses:y}=e;return(r||o||i||n||s||a||l||u||c||g||d||y)&&(t={questions:r,elements:o,flashcards:i,statement:n,statements:s,choices:a,responses:l,quizzes:u,heading:c,pairs:g,matrix:d,botResponses:y},p.ObjectUtils.removeUnwantedProperties(t)),t}pushExampleDownTree(e,t,r,o){if(r||o){if(t){if(this.pushExampleDownTreeString(r,o,t.pairs),this.pushExampleDownTreeBoolean(r,o,!1,t.flashcards),this.pushExampleDownTreeBoolean(r,o,!0,t.choices),this.pushExampleDownTreeBoolean(r,o,!1,t.responses,t.statements,t.statement),t.quizzes)for(const e of t.quizzes)this.pushExampleDownTreeBoolean(r,o,!0,e.choices),this.pushExampleDownTreeBoolean(r,o,!1,e.responses);if(t.matrix)for(const e of t.matrix)this.pushExampleDownTreeString(r,o,e.cells)}e&&this.pushExampleDownTreeBodyBits(r,o,e)}}pushExampleDownTreeBoolean(e,t,r,...o){if((e||t)&&Array.isArray(o))for(const i of o)if(i){const o=Array.isArray(i)?i:[i];u.BitUtils.fillBooleanExample(o,e,t,r)}}pushExampleDownTreeString(e,t,...r){if((e||t)&&Array.isArray(r))for(const o of r)if(o){const r=Array.isArray(o)?o:[o];u.BitUtils.fillStringExample(r,e,t,!1)}}pushExampleDownTreeBodyBits(e,t,r){if((e||t)&&r&&r.bodyParts&&0!==r.bodyParts.length)for(const o of r.bodyParts)if(o)switch(o.type){case n.BodyBitType.gap:{const r=o;u.BitUtils.fillStringExample([r.data],e,t,!1);break}case n.BodyBitType.mark:{const r=o;u.BitUtils.fillBooleanExample([r.data],e,t,!1);break}case n.BodyBitType.select:{const r=o;u.BitUtils.fillBooleanExample(r.data.options,e,t,!0);break}case n.BodyBitType.highlight:{const r=o;u.BitUtils.fillBooleanExample(r.data.texts,e,t,!0);break}}}pushDownTree(e,t,r,o,i,n){if(void 0!==n){if(r&&o){const e=r[o];if(Array.isArray(e))for(const t of e)null==t[i]&&(t[i]=n)}if(t&&e&&e.bodyParts&&e.bodyParts.length>0)for(const r of e.bodyParts)if(r&&-1!==t.indexOf(r.type)){r.data[i]=n}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const r={};for(const[e,o]of t)r[e]=l.ArrayUtils.asArray(o)||[o];return r}setIsExampleFlags(e){var t,r,o,i,s,a,l,u,c,p,g,d,y;e.isExample=!1;const f=t=>!!t&&(t.isDefaultExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:h,cardNode:m}=e;if(h&&h.bodyParts)for(const e of h.bodyParts)switch(e.type){case n.BodyBitType.gap:case n.BodyBitType.mark:f(e.data);break;case n.BodyBitType.select:{const t=e;let r=!1;for(const e of t.data.options)r=!!f(e)||r;t.data.isExample=r;break}case n.BodyBitType.highlight:{const t=e;let r=!1;for(const e of t.data.texts)r=!!f(e)||r;t.data.isExample=r;break}}if(m){for(const e of null!==(t=m.flashcards)&&void 0!==t?t:[])f(e);for(const e of null!==(r=m.pairs)&&void 0!==r?r:[])f(e);for(const e of null!==(o=m.matrix)&&void 0!==o?o:[]){let t=!1;for(const r of null!==(i=e.cells)&&void 0!==i?i:[])t=!!f(r)||t;e.isExample=t}for(const e of null!==(s=m.quizzes)&&void 0!==s?s:[]){let t=!1;for(const r of null!==(a=e.responses)&&void 0!==a?a:[])t=!!f(r)||t;for(const r of null!==(l=e.choices)&&void 0!==l?l:[])t=!!f(r)||t;e.isExample=t}for(const e of null!==(u=m.responses)&&void 0!==u?u:[])f(e);for(const e of null!==(c=m.choices)&&void 0!==c?c:[])f(e);for(const e of null!==(p=m.statements)&&void 0!==p?p:[])f(e);f(m.statement);for(const e of null!==(g=m.questions)&&void 0!==g?g:[])f(e)}f(e.statement);for(const t of null!==(d=e.responses)&&void 0!==d?d:[])f(t);for(const t of null!==(y=e.choices)&&void 0!==y?y:[])f(t);f(e)}setDefaultBitValues(e){switch(e.bitType.alias){case i.AliasBitType.articleAi:case i.AliasBitType.noteAi:case i.AliasBitType.summaryAi:e.aiGenerated=this.toAstProperty(o.PropertyConfigKey.aiGenerated,!0)}}addVersionToParserInfo(e){var t;const r=null!==(t=e.parser)&&void 0!==t?t:{};r.version=g.env.appVersion.full,e.parser=r}}t.Builder=f},8703:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceBuilder=void 0;const i=r(9779),n=r(3589),s=r(169),a=r(1),l=r(2377);class u extends a.BaseBuilder{resource(e){var t;let r;const{type:n,value:s,format:a}=e,l=o(e,["type","value","format"]),u=Object.assign({type:n,value:null!=s?s:"",format:null!=a?a:""},l);switch(n){case i.ResourceTag.video:case i.ResourceTag.videoEmbed:case i.ResourceTag.videoLink:case i.ResourceTag.stillImageFilmEmbed:case i.ResourceTag.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],o=[];for(const t of r){const r=e[t];if(r){const e=this.resource({type:i.ResourceTag.image,value:r});e&&o.push(e)}}u.thumbnails=[...null!==(t=u.thumbnails)&&void 0!==t?t:[],...o]}}switch(n){case i.ResourceTag.image:case i.ResourceTag.imagePortrait:case i.ResourceTag.imageLandscape:r=this.imageResource(u,n);break;case i.ResourceTag.imageLink:r=this.imageLinkResource(u);break;case i.ResourceTag.audio:r=this.audioResource(u);break;case i.ResourceTag.audioEmbed:r=this.audioEmbedResource(u);break;case i.ResourceTag.audioLink:r=this.audioLinkResource(u);break;case i.ResourceTag.video:r=this.videoResource(u);break;case i.ResourceTag.videoEmbed:r=this.videoEmbedResource(u);break;case i.ResourceTag.videoLink:r=this.videoLinkResource(u);break;case i.ResourceTag.stillImageFilmEmbed:r=this.stillImageFilmEmbedResource(u);break;case i.ResourceTag.stillImageFilmLink:r=this.stillImageFilmLinkResource(u);break;case i.ResourceTag.article:r=this.articleResource(u);break;case i.ResourceTag.document:r=this.documentResource(u);break;case i.ResourceTag.documentEmbed:r=this.documentEmbedResource(u);break;case i.ResourceTag.documentLink:r=this.documentLinkResource(u);break;case i.ResourceTag.documentDownload:r=this.documentDownloadResource(u);break;case i.ResourceTag.appLink:r=this.appLinkResource(u);break;case i.ResourceTag.websiteLink:r=this.websiteLinkResource(u)}return r}imageResource(e,t){const{value:r,src1x:o,src2x:a,src3x:u,src4x:c,width:p,height:g,alt:d,license:y,copyright:f,showInIndex:h,caption:m}=e,T={type:i.ResourceTag.image,typeAlias:null!=t?t:i.ResourceTag.image,format:s.UrlUtils.fileExtensionFromUrl(r),provider:s.UrlUtils.domainFromUrl(r),value:r,src1x:o,src2x:a,src3x:u,src4x:c,width:p,height:g,alt:d,license:y,copyright:f,showInIndex:h,caption:m};return n.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}imageLinkResource(e){const{value:t,src1x:r,src2x:o,src3x:a,src4x:u,width:c,height:p,alt:g,license:d,copyright:y,showInIndex:f,caption:h}=e,m={type:i.ResourceTag.imageLink,typeAlias:i.ResourceTag.imageLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:o,src3x:a,src4x:u,width:c,height:p,alt:g,license:d,copyright:y,showInIndex:f,caption:h};return n.ObjectUtils.removeUnwantedProperties(m),l.NodeValidator.validateResource(m)}audioResource(e){const{value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g}=e,d={type:i.ResourceTag.audio,typeAlias:i.ResourceTag.audio,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g};return n.ObjectUtils.removeUnwantedProperties(d),l.NodeValidator.validateResource(d)}audioEmbedResource(e){const{value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g}=e,d={type:i.ResourceTag.audioEmbed,typeAlias:i.ResourceTag.audioEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g};return n.ObjectUtils.removeUnwantedProperties(d),l.NodeValidator.validateResource(d)}audioLinkResource(e){const{value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g}=e,d={type:i.ResourceTag.audioLink,typeAlias:i.ResourceTag.audioLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g};return n.ObjectUtils.removeUnwantedProperties(d),l.NodeValidator.validateResource(d)}videoResource(e){const{value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:i.ResourceTag.video,typeAlias:i.ResourceTag.video,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return n.ObjectUtils.removeUnwantedProperties(v),l.NodeValidator.validateResource(v)}videoEmbedResource(e){const{value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:i.ResourceTag.videoEmbed,typeAlias:i.ResourceTag.videoEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return n.ObjectUtils.removeUnwantedProperties(v),l.NodeValidator.validateResource(v)}videoLinkResource(e){const{value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:i.ResourceTag.videoLink,typeAlias:i.ResourceTag.videoLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return n.ObjectUtils.removeUnwantedProperties(v),l.NodeValidator.validateResource(v)}stillImageFilmEmbedResource(e){const{value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:i.ResourceTag.stillImageFilmEmbed,typeAlias:i.ResourceTag.stillImageFilmEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return n.ObjectUtils.removeUnwantedProperties(v),l.NodeValidator.validateResource(v)}stillImageFilmLinkResource(e){const{value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:i.ResourceTag.stillImageFilmLink,typeAlias:i.ResourceTag.stillImageFilmLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return n.ObjectUtils.removeUnwantedProperties(v),l.NodeValidator.validateResource(v)}articleResource(e){const{value:t,license:r,copyright:o,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.article,typeAlias:i.ResourceTag.article,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentResource(e){const{value:t,license:r,copyright:o,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.document,typeAlias:i.ResourceTag.document,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentEmbedResource(e){const{value:t,license:r,copyright:o,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.documentEmbed,typeAlias:i.ResourceTag.documentEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentLinkResource(e){const{value:t,license:r,copyright:o,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.documentLink,typeAlias:i.ResourceTag.documentLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentDownloadResource(e){const{value:t,license:r,copyright:o,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.documentDownload,typeAlias:i.ResourceTag.documentDownload,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}appLinkResource(e){const{value:t,license:r,copyright:o,showInIndex:s,caption:a}=e,u={type:i.ResourceTag.appLink,typeAlias:i.ResourceTag.appLink,value:t,license:r,copyright:o,showInIndex:s,caption:a};return n.ObjectUtils.removeUnwantedProperties(u),l.NodeValidator.validateResource(u)}websiteLinkResource(e){const{value:t,siteName:r,license:o,copyright:s,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.websiteLink,typeAlias:i.ResourceTag.websiteLink,value:t,siteName:r,license:o,copyright:s,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}}t.ResourceBuilder=u},2377:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValidator=void 0;const o=r(208),i=r(3633);const n=new class{validateBit(e){if(!e)return e;let t=e;if(e.bitType.root===o.RootBitType.interview)t=this.validateInterviewBit(e);return t}validateResource(e){if(!e)return;let t=e,r=!1;return e.type,r=!!e.value,r||e.type&&(t={type:e.type,typeAlias:e.type}),t}isRequired(e,t){if(!e)throw new Error(`${t} is required but is not set`)}isOneOfRequired(e,t){if(Array.isArray(e))for(const t of e)if(t)return;throw new Error(`One of '${t.join(", ")}' is required but none is set`)}isString(e,t){if(!i.StringUtils.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!i.StringUtils.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!i.StringUtils.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!i.StringUtils.isString(e)||""===e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a non-empty string or a boolean`)}isArray(e,t){if(!Array.isArray(e))throw new Error(`${t} is required to be a array`)}isNonEmptyArray(e,t){if(!(Array.isArray(e)&&e.length>0))throw new Error(`${t} is required to be a non-empty array`)}isNumber(e,t){if(!Number.isFinite(e))throw new Error(`${t} is required to be a number`)}isBoolean(e,t){if(!0!==e&&!1!==e)throw new Error(`${t} is required to be a boolean`)}isStringOrNumberOrBooleanOrNullOrUndefined(e,t){if(!i.StringUtils.isString(e)&&!Number.isFinite(e)&&!0!==e&&!1!==e&&null!=e)throw new Error(`${t} is required to be a string or a number or a boolean or null or undefined`)}validateInterviewBit(e){return e.cardNode||(e.cardNode={}),e.cardNode.questions||(e.cardNode.questions=[]),e}};t.NodeValidator=n},227:function(e,t){var r=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;t.StringWriter=class{constructor(){this._string="",this.endOfLineString="\n"}get isSync(){return!0}getString(){return this._string}open(){return r(this,void 0,void 0,(function*(){this.openSync(),Promise.resolve()}))}close(){return r(this,void 0,void 0,(function*(){try{this.closeSync()}catch(e){return Promise.reject(e)}Promise.resolve()}))}openSync(){this._buffer=[],this._string=""}closeSync(){if(!this._buffer)throw new Error("open() or openSync() never called");this._string=this._buffer.join(""),this._buffer=[]}writeLine(e){return this._buffer?(null!=e?this._buffer.push(e+this.endOfLineString):this._buffer.push(this.endOfLineString),this):this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;for(let r=0,o=e.length;r<o;r++){const i=e[r];this._buffer.push(i),t&&r<o-1&&this._buffer.push(t),this._buffer.push(this.endOfLineString)}return this}write(e){return this._buffer?(null==e||this._buffer.push(e),this):this}writeWhiteSpace(){return this.write(" "),this}}},2606:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Config=void 0;const o=r(429),i=r(7585),n=r(3059),s=r(5428),a=r(742),l=r(8360),u=r(3141),c=r(9036),p=r(6260),g=r(208);const d=new class{constructor(){this.bitTypeAliasMap=new Map,this.bitCache=new Map,this.comboResourcesCache=new Map,this.buildBitTypeAliasMap()}getBitType(e){const t=this.getAliasedBitType(e);return{alias:t,root:this.getRootBitType(t)}}getBitConfig(e){var t;let r=this.bitCache.get(e.alias);if(!r){const i=()=>{throw new Error(`No config found for bit: ALIAS:${e.alias}, ROOT:${e.root}`)},n=u.BITS[e.root];n||i();const s=e.root!==e.alias;let a;s&&n.aliases&&(a=n.aliases[e.alias]),s&&!a&&i();const{since:c,deprecated:p}=a||n,d=n.aliases?Object.keys(n.aliases).map((e=>g.AliasBitType.fromValue(e))):[],{tags:y,cardSet:f,bodyAllowed:h,bodyRequired:m,footerAllowed:T,footerRequired:b,resourceAttachmentAllowed:v,rootExampleType:C}=n,x=this.getAllResourcesTagsWithZeroCounts(),A=l.ConfigHydrator.hydrateTagsConfig(y),w=l.ConfigHydrator.hydrateCardSetConfig(f),k=null===(t=A.info)||void 0===t?void 0:t.comboResourceType,B=Object.assign({},A.tags);for(const[e,t]of Object.entries(x))B[e]||(B[e]=t);r=new o.BitConfig(c,e,d,B,w,p,h,m,T,b,v,C,k),this.bitCache.set(e.root,r)}return r}getRawPropertiesConfig(){return p.PROPERTIES}getTagConfigForTag(e,t){if(e)for(const[,r]of Object.entries(e))if(r.tag===t)return r}getTagsConfigForCardSet(e,t,r){const o=this.getBitConfig(e);if(!o)return;const i=o.cardSet;if(!i)return;t=Math.min(t,i.variants.length-1);const n=i.variants[t];return n[r=Math.min(r,n.length-1)].tags}getBitResourcesConfig(e,t){var r;let o={};const s=new Map,l=this.getBitConfig(e),u={};for(const[e,t]of Object.entries(l.tags))t.type===a.BitTagType.resource&&(u[e]=t);const c=null!==(r=l.comboResourceType)&&void 0!==r?r:l.resourceAttachmentAllowed&&t;if(c){const e=new Map,r=this.getComboResource(c);if(r){const t=Object.values(r).filter((e=>e.type===a.BitTagType.resource));t.map((e=>e.tag)).forEach((r=>{const o=t.find((e=>e.tag===r));o&&e.set(r,o)}));const o=this.getComboResourceTagTypes(c);o&&o.length>0&&s.set(c,o)}if(t)for(const[t,r]of Object.entries(u)){const n=c===r.tag,s=!!e&&e.has(r.tag);if(n){const e=new i.ResourceTagConfig(r.configKey,r.tag,1,1,r.chain,r.jsonKey,r.deprecated);o[t]=e}else if(s){if(e){const i=e.get(r.tag);i&&(o[t]=i)}}else o[t]=r}else o=u}else o=u;return new n.ResourcesConfig(o,l.resourceAttachmentAllowed,t,s)}getComboResourceTagTypes(e){const t=this.getComboResource(e);if(t){return Object.values(t).filter((e=>e.type===a.BitTagType.resource)).map((e=>e.tag))}}getComboResource(e){if(!e)return;let t=this.comboResourcesCache.get(e);return t||(t={},Object.values(c.GROUPS).filter((t=>t.type===s.GroupConfigType.comboResource&&t.comboResourceType===e)).forEach((e=>{t=Object.assign(Object.assign({},t),l.ConfigHydrator.hydrateTagsConfig(e.tags).tags)})),0===Object.keys(t).length&&(t=void 0),this.comboResourcesCache.set(e,t)),t}getAllResourcesTagsWithZeroCounts(){let e=this.allResourcesCache;if(!e){e={},Object.values(c.GROUPS).filter((e=>e.type===s.GroupConfigType.resource)).forEach((t=>{e=Object.assign(Object.assign({},e),l.ConfigHydrator.hydrateTagsConfig(t.tags).tags)}));for(const t of Object.values(e)){const e=t;e.maxCount=0,e.minCount=0}this.allResourcesCache=e}return e}buildBitTypeAliasMap(){for(const e of g.RootBitType.values())this.bitTypeAliasMap.set(e,e);for(const[e,t]of Object.entries(u.BITS))if(t.aliases)for(const r of Object.keys(t.aliases))this.bitTypeAliasMap.set(r,e)}getRootBitType(e){var t;return e&&null!==(t=this.bitTypeAliasMap.get(e))&&void 0!==t?t:g.RootBitType._error}getAliasedBitType(e){var t,r;return null!==(r=null!==(t=g.AliasBitType.fromValue(e))&&void 0!==t?t:g.RootBitType.fromValue(e))&&void 0!==r?r:g.RootBitType._error}};t.Config=d},8360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigHydrator=void 0;const o=r(2005),i=r(3585),n=r(6620),s=r(6956),a=r(7585),l=r(8620),u=r(177),c=r(3518),p=r(6194),g=r(1595),d=r(742),y=r(4182),f=r(9036),h=r(6260),m=r(5100),T=r(3622);const b=new class{hydrateTagsConfig(e){var t;const r={tags:{}};for(const o of e){let e;switch(o.type){case d.BitTagType.tag:e=this.hydrateTagConfig(o);break;case d.BitTagType.property:e=this.hydratePropertyTagConfig(o);break;case d.BitTagType.resource:e=this.hydrateResourceTagConfig(o);break;case d.BitTagType.group:e=this.hydrateTagGroupConfig(o)}e&&(r.tags=Object.assign(Object.assign({},r.tags),e.tags),r.info=Object.assign(null!==(t=r.info)&&void 0!==t?t:{},e.info))}return r}hydrateCardSetConfig(e){if(!e)return;const t=y.CARDS[e];if(!t)throw new Error(`No config found for card set config key '${e}'`);const r=[];for(const e of t.variants){const t=[];for(const r of e){const e=this.hydrateCardVariantConfig(r);t.push(e)}r.push(t)}return new o.CardSetConfig(e,r)}hydrateTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,s=g.TagConfigKey.fromKey(t)||l.ConfigKey._unknown,a=T.TAGS[s];if(!a)throw new Error(`No config found for tag config key '${t}'`);const{tag:u,deprecated:c}=a;let p;i&&(p=this.hydrateTagsConfig(i).tags);return{tags:{[s]:new n.MarkupTagConfig(s,u,null!=r?r:1,null!=o?o:0,p,c)}}}hydratePropertyTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,n=c.PropertyConfigKey.fromKey(t)||l.ConfigKey._unknown,a=h.PROPERTIES[n];if(!a)throw new Error(`No config found for property config key '${t}'`);const{tag:u,deprecated:p,single:g,format:d,defaultValue:y,jsonKey:f,astKey:m}=a;let T;i&&(T=this.hydrateTagsConfig(i).tags);return{tags:{[n]:new s.PropertyTagConfig(n,u,null!=r?r:1,null!=o?o:0,T,f,m,g,d,y,p)}}}hydrateResourceTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,n=p.ResourceConfigKey.fromKey(t)||l.ConfigKey._unknown,s=m.RESOURCES[n];if(!s)throw new Error(`No config found for resource config key '${t}'`);const{tag:u,deprecated:c,jsonKey:g}=s;let d;i&&(d=this.hydrateTagsConfig(i).tags);return{tags:{[n]:new a.ResourceTagConfig(n,u,null!=r?r:1,null!=o?o:0,d,g,c)}}}hydrateTagGroupConfig(e){var t,r;const{configKey:o}=e,i=u.GroupConfigKey.fromKey(o)||l.ConfigKey._unknown,n=f.GROUPS[i];if(!n)throw new Error(`No config found for group config key '${o}'`);const{tags:s}=n,a=this.hydrateTagsConfig(s).tags,c=Object.values(a);if(c.length>0){const o=c[0],i=o;i.maxCount=null!==(t=e.maxCount)&&void 0!==t?t:o.maxCount,i.minCount=null!==(r=e.minCount)&&void 0!==r?r:o.minCount}return{tags:a,info:{comboResourceType:n.comboResourceType}}}hydrateCardVariantConfig(e){const{tags:t,bodyAllowed:r,bodyRequired:o,repeatCount:n}=e,s=this.hydrateTagsConfig(t);return new i.CardVariantConfig(s.tags,r,o,n)}};t.ConfigHydrator=b},3141:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BITS=void 0;const o=r(2574),i=r(177),n=r(3518),s=r(1595),a=r(742),l=r(208),u=r(1035),c=r(7028),p={[l.RootBitType._error]:{since:"1.3.0",tags:[],bodyAllowed:!0,aliases:{}},[l.RootBitType.appFlashcards]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.title},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.flashcardSet,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.appFlashcardsQuiz]:{since:"1.3.0"},[l.AliasBitType.appFlashcardsLearn]:{since:"1.3.0"}}},[l.RootBitType.appLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAppLink,minCount:1}],bodyAllowed:!1},[l.RootBitType.article]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.statement]:{since:"1.3.0"},[l.AliasBitType.buttonCopyText]:{since:"1.4.3"}}},[l.RootBitType.appBitmarkFromJavascript]:{since:"1.4.5",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.maxCreatedBits}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.appBitmarkFromEditor]:{since:"1.4.5"}}},[l.RootBitType.articleEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceArticleEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.articleLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceArticleLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.audio]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudio,minCount:1}],bodyAllowed:!0},[l.RootBitType.audioEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.audioLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.bitAlias]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.tag_reference},{type:a.BitTagType.tag,configKey:s.TagConfigKey.anchor}],bodyAllowed:!0},[l.RootBitType.book]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_bookCommon}],bodyAllowed:!0,aliases:{[l.AliasBitType.bookAcknowledgments]:{since:"1.3.0"},[l.AliasBitType.bookAddendum]:{since:"1.3.0"},[l.AliasBitType.bookAfterword]:{since:"1.3.0"},[l.AliasBitType.bookAppendix]:{since:"1.3.0"},[l.AliasBitType.bookArticle]:{since:"1.3.0"},[l.AliasBitType.bookAutherBio]:{since:"1.3.0"},[l.AliasBitType.bookBibliography]:{since:"1.3.0"},[l.AliasBitType.bookComingSoon]:{since:"1.3.0"},[l.AliasBitType.bookConclusion]:{since:"1.3.0"},[l.AliasBitType.bookCopyright]:{since:"1.3.0"},[l.AliasBitType.bookCopyrightPermissions]:{since:"1.3.0"},[l.AliasBitType.bookDedication]:{since:"1.3.0"},[l.AliasBitType.bookEndnotes]:{since:"1.3.0"},[l.AliasBitType.bookEpigraph]:{since:"1.3.0"},[l.AliasBitType.bookEpilogue]:{since:"1.3.0"},[l.AliasBitType.bookForword]:{since:"1.3.0"},[l.AliasBitType.bookFrontispiece]:{since:"1.3.0"},[l.AliasBitType.bookImprint]:{since:"1.3.0"},[l.AliasBitType.bookIncitingIncident]:{since:"1.3.0"},[l.AliasBitType.bookIntroduction]:{since:"1.3.0"},[l.AliasBitType.bookListOfContributors]:{since:"1.3.0"},[l.AliasBitType.bookNotes]:{since:"1.3.0"},[l.AliasBitType.bookPostscript]:{since:"1.3.0"},[l.AliasBitType.bookPreface]:{since:"1.3.0"},[l.AliasBitType.bookPrologue]:{since:"1.3.0"},[l.AliasBitType.bookReadMore]:{since:"1.3.0"},[l.AliasBitType.bookReferenceList]:{since:"1.3.0"},[l.AliasBitType.bookRequestForABookReview]:{since:"1.3.0"},[l.AliasBitType.bookSummary]:{since:"1.3.0"},[l.AliasBitType.bookTeaser]:{since:"1.3.0"},[l.AliasBitType.bookTitle]:{since:"1.3.0"}}},[l.RootBitType.bookAlias]:{since:"1.4.3",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_bookCommon},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.bookAlias,maxCount:u.Count.infinity}],bodyAllowed:!0},[l.RootBitType.botActionResponse]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._botActionResponses,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.botActionSend]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.date}],bodyAllowed:!0},[l.RootBitType.browserImage]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.focusY}],bodyAllowed:!0},[l.RootBitType.card1]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.question1]:{since:"1.3.0"},[l.AliasBitType.survey1]:{since:"1.3.0"},[l.AliasBitType.surveyAnonymous1]:{since:"1.3.0"}}},[l.RootBitType.chapter]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.anchor},{type:a.BitTagType.tag,configKey:s.TagConfigKey.title},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.toc},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.progress}],bodyAllowed:!0},[l.RootBitType.clozeAndMultipleChoiceText]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_gap},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachCallToActionClozeAndMultipleChoiceText]:{since:"1.3.0"}}},[l.RootBitType.cloze]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_gap}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.clozeInstructionGrouped]:{since:"1.3.0"},[l.AliasBitType.clozeSolutionGrouped]:{since:"1.3.0"},[l.AliasBitType.coachSelfReflectionCloze]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionCloze]:{since:"1.3.0"}}},[l.RootBitType.code]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.computerLanguage}],bodyAllowed:!0,aliases:{[l.AliasBitType.appCodeCell]:{since:"1.4.3"},[l.AliasBitType.appCodeEditor]:{since:"1.4.3"},[l.AliasBitType.appCodeIde]:{since:"1.4.3"},[l.AliasBitType.codeRuntime]:{since:"1.4.3"},[l.AliasBitType.consoleLog]:{since:"1.4.3"},[l.AliasBitType.output]:{since:"1.4.3"},[l.AliasBitType.stdout]:{since:"1.4.3"}}},[l.RootBitType.conversationLeft1]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_partner}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.conversationLeft1Scream]:{since:"1.3.0"},[l.AliasBitType.conversationLeft1Thought]:{since:"1.3.0"},[l.AliasBitType.conversationRight1]:{since:"1.3.0"},[l.AliasBitType.conversationRight1Scream]:{since:"1.3.0"},[l.AliasBitType.conversationRight1Thought]:{since:"1.3.0"}}},[l.RootBitType.document]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocument,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentDownload]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentDownload,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.essay]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.partialAnswer},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.property_reference,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.coachSelfReflectionEssay]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionEssay]:{since:"1.3.0"}}},[l.RootBitType.example]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.appAiPrompt]:{since:"1.3.0"},[l.AliasBitType.aiPrompt]:{since:"1.3.0"},[l.AliasBitType.articleAi]:{since:"1.3.0"},[l.AliasBitType.articleAttachment]:{since:"1.3.0"},[l.AliasBitType.assignment]:{since:"1.3.0"},[l.AliasBitType.audioTranscript]:{since:"1.3.0"},[l.AliasBitType.bitmarkExample]:{since:"1.3.0"},[l.AliasBitType.blogArticle]:{since:"1.3.0"},[l.AliasBitType.bug]:{since:"1.3.0"},[l.AliasBitType.checklist]:{since:"1.3.0"},[l.AliasBitType.coachAudioTranscript]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionChecklist]:{since:"1.3.0"},[l.AliasBitType.coachHomeRules]:{since:"1.3.0"},[l.AliasBitType.coachVideoTranscript]:{since:"1.3.0"},[l.AliasBitType.correction]:{since:"1.3.0"},[l.AliasBitType.cookPreparation]:{since:"1.3.0"},[l.AliasBitType.cookStep]:{since:"1.3.0"},[l.AliasBitType.cookIngredients]:{since:"1.3.0"},[l.AliasBitType.cookRemark]:{since:"1.3.0"},[l.AliasBitType.cookVariation]:{since:"1.3.0"},[l.AliasBitType.cookInsert]:{since:"1.3.0"},[l.AliasBitType.cookArrangement]:{since:"1.3.0"},[l.AliasBitType.cookPracticeAdvise]:{since:"1.3.0"},[l.AliasBitType.cookPlate]:{since:"1.3.0"},[l.AliasBitType.cookRecommendation]:{since:"1.3.0"},[l.AliasBitType.cookPersonalRecommendation]:{since:"1.3.0"},[l.AliasBitType.cookSideDrink]:{since:"1.3.0"},[l.AliasBitType.cookSideDish]:{since:"1.3.0"},[l.AliasBitType.cookTimer]:{since:"1.3.0"},[l.AliasBitType.danger]:{since:"1.3.0"},[l.AliasBitType.details1]:{since:"1.3.0"},[l.AliasBitType.details]:{since:"1.3.0"},[l.AliasBitType.editorial]:{since:"1.3.0"},[l.AliasBitType.editorNote]:{since:"1.3.0"},[l.AliasBitType.featured]:{since:"1.3.0"},[l.AliasBitType.help]:{since:"1.3.0"},[l.AliasBitType.hint]:{since:"1.3.0"},[l.AliasBitType.info]:{since:"1.3.0"},[l.AliasBitType.langLearningOutcomes]:{since:"1.3.0"},[l.AliasBitType.langEnablingLanguageSkills]:{since:"1.3.0"},[l.AliasBitType.langLifeSkills]:{since:"1.3.0"},[l.AliasBitType.langEnglishAroundWorld]:{since:"1.3.0"},[l.AliasBitType.langGoodToKnow]:{since:"1.3.0"},[l.AliasBitType.langLearningGoal]:{since:"1.3.0"},[l.AliasBitType.langLearningStrategy]:{since:"1.3.0"},[l.AliasBitType.langLikeALocal]:{since:"1.3.0"},[l.AliasBitType.langMaterial]:{since:"1.3.0"},[l.AliasBitType.langUsefulPhrases]:{since:"1.3.0"},[l.AliasBitType.langLevelDown]:{since:"1.3.0"},[l.AliasBitType.langLevelUp]:{since:"1.3.0"},[l.AliasBitType.langExtraActivity]:{since:"1.3.0"},[l.AliasBitType.langVideoScript]:{since:"1.3.0"},[l.AliasBitType.langAudioScript]:{since:"1.3.0"},[l.AliasBitType.langVocabulary]:{since:"1.3.0"},[l.AliasBitType.langHomework]:{since:"1.3.0"},[l.AliasBitType.langTeacherNote]:{since:"1.3.0"},[l.AliasBitType.langTeacherPronunciation]:{since:"1.3.0"},[l.AliasBitType.message]:{since:"1.3.0"},[l.AliasBitType.newspaperArticle]:{since:"1.3.0"},[l.AliasBitType.note]:{since:"1.3.0"},[l.AliasBitType.noteAi]:{since:"1.3.0"},[l.AliasBitType.notebookArticle]:{since:"1.3.0"},[l.AliasBitType.preparationNote]:{since:"1.3.0"},[l.AliasBitType.releaseNotesSummary]:{since:"1.3.0"},[l.AliasBitType.remark]:{since:"1.3.0"},[l.AliasBitType.reviewNote]:{since:"1.3.0"},[l.AliasBitType.reviewAuthorNote]:{since:"1.3.0"},[l.AliasBitType.reviewReviewerNote]:{since:"1.3.0"},[l.AliasBitType.reviewRequestForReviewNote]:{since:"1.3.0"},[l.AliasBitType.reviewApprovedNote]:{since:"1.3.0"},[l.AliasBitType.selfAssessment]:{since:"1.3.0"},[l.AliasBitType.sideNote]:{since:"1.3.0"},[l.AliasBitType.summary]:{since:"1.3.0"},[l.AliasBitType.summaryAi]:{since:"1.3.0"},[l.AliasBitType.videoTranscript]:{since:"1.3.0"},[l.AliasBitType.warning]:{since:"1.3.0"},[l.AliasBitType.workbookArticle]:{since:"1.3.0"}}},[l.RootBitType.flashcard]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._flashcards,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.flashcard1]:{since:"1.3.0"}}},[l.RootBitType.focusImage]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.focusY}],bodyAllowed:!0},[l.RootBitType.highlightText]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.image]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.appCreateBitsFromImage]:{since:"1.3.0"},[l.AliasBitType.appGetScreenshot]:{since:"1.3.0"},[l.AliasBitType.detailsImage]:{since:"1.3.0"},[l.AliasBitType.figure]:{since:"1.3.0",deprecated:"1.4.0"},[l.AliasBitType.imageBanner]:{since:"1.3.0"},[l.AliasBitType.imageFigure]:{since:"1.3.0"},[l.AliasBitType.imageLandscape]:{since:"1.3.0"},[l.AliasBitType.imageMood]:{since:"1.3.0"},[l.AliasBitType.imagePortrait]:{since:"1.3.0"},[l.AliasBitType.imagePrototype]:{since:"1.3.0"},[l.AliasBitType.imageScreenshot]:{since:"1.3.0"},[l.AliasBitType.imageStyled]:{since:"1.3.0"},[l.AliasBitType.imageSuperWide]:{since:"1.3.0"},[l.AliasBitType.imageZoom]:{since:"1.3.0"},[l.AliasBitType.langLifeSkillIcon]:{since:"1.3.0"},[l.AliasBitType.lifeSkillSticker]:{since:"1.3.0"},[l.AliasBitType.pageBanner]:{since:"1.4.3"},[l.AliasBitType.screenshot]:{since:"1.3.0",deprecated:"1.4.0"}}},[l.RootBitType.imageLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.imageOnDevice]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_imageSource}],bodyAllowed:!0},[l.RootBitType.imageResponsive]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageResponsive}],bodyAllowed:!0},[l.RootBitType.internalLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.tag_reference}],bodyAllowed:!0},[l.RootBitType.interview]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars}],cardSet:o.CardSetConfigKey._questions,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.interviewInstructionGrouped]:{since:"1.3.0"},[l.AliasBitType.botInterview]:{since:"1.3.0"}}},[l.RootBitType.learningPathBook]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.bookLink]:{since:"1.3.0"},[l.AliasBitType.bookLinkNext]:{since:"1.3.0"},[l.AliasBitType.bookLinkPrev]:{since:"1.3.0"},[l.AliasBitType.learningPathClassroomEvent]:{since:"1.3.0"},[l.AliasBitType.learningPathClassroomTraining]:{since:"1.3.0"},[l.AliasBitType.learningPathClosing]:{since:"1.3.0"},[l.AliasBitType.learningPathFeedback]:{since:"1.3.0"},[l.AliasBitType.learningPathLearningGoal]:{since:"1.3.0"},[l.AliasBitType.learningPathLti]:{since:"1.3.0"},[l.AliasBitType.learningPathSign]:{since:"1.3.0"},[l.AliasBitType.learningPathStep]:{since:"1.3.0"}}},[l.RootBitType.learningPathBotTraining]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.bot}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.learningPathExternalLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.externalLink},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.externalLinkText}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.learningPathVideoCall]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.videoCallLink}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.mark]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_markConfig},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_mark}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.match]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchPairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.matchAll]:{since:"1.3.0"},[l.AliasBitType.matchReverse]:{since:"1.3.0"},[l.AliasBitType.matchAllReverse]:{since:"1.3.0"},[l.AliasBitType.matchSolutionGrouped]:{since:"1.3.0"}}},[l.RootBitType.matchMatrix]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchMatrix,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.matchAudio]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchAudioPairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.matchPicture]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchImagePairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.multipleChoice1]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleChoice1]:{since:"1.3.0"}}},[l.RootBitType.multipleChoice]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],cardSet:o.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleChoice]:{since:"1.3.0"}}},[l.RootBitType.multipleChoiceText]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachCallToActionMultipleChoiceText]:{since:"1.3.0"},[l.AliasBitType.coachSelfReflectionMultipleChoiceText]:{since:"1.3.0"}}},[l.RootBitType.multipleResponse1]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleResponse1]:{since:"1.3.0"}}},[l.RootBitType.multipleResponse]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],cardSet:o.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleResponse]:{since:"1.3.0"}}},[l.RootBitType.page]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.title},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.thumbImage}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.pageBuyButton]:{since:"1.4.3",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.content2Buy}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.photo]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1}],bodyAllowed:!0},[l.RootBitType.quote]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.quotedPerson}],bodyAllowed:!0},[l.RootBitType.rating]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionRating]:{since:"1.3.0"}}},[l.RootBitType.releaseNote]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.releaseVersion}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.sampleSolution]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.anchor},{type:a.BitTagType.tag,configKey:s.TagConfigKey.tag_reference}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.sequence]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._elements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,rootExampleType:c.ExampleType.boolean},[l.RootBitType.stillImageFilm]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilm}],bodyAllowed:!0},[l.RootBitType.stillImageFilmEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilmEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.stillImageFilmLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilmLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.surveyAnonymous]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.survey]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.toc]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],bodyAllowed:!0,aliases:{[l.AliasBitType.anchor]:{since:"1.3.0"},[l.AliasBitType.bitBookEnding]:{since:"1.3.0"},[l.AliasBitType.bitBookSummary]:{since:"1.3.0"},[l.AliasBitType.botActionAnnounce]:{since:"1.3.0"},[l.AliasBitType.botActionRatingNumber]:{since:"1.3.0"},[l.AliasBitType.botActionRemind]:{since:"1.3.0"},[l.AliasBitType.botActionSave]:{since:"1.3.0"},[l.AliasBitType.botActionTrueFalse]:{since:"1.3.0"},[l.AliasBitType.chapterSubjectMatter]:{since:"1.3.0"},[l.AliasBitType.chat]:{since:"1.3.0"},[l.AliasBitType.conclusion]:{since:"1.3.0"},[l.AliasBitType.documentUpload]:{since:"1.3.0"},[l.AliasBitType.footNote]:{since:"1.3.0"},[l.AliasBitType.groupBorn]:{since:"1.3.0"},[l.AliasBitType.groupDied]:{since:"1.3.0"},[l.AliasBitType.recordAudio]:{since:"1.3.0"},[l.AliasBitType.stickyNote]:{since:"1.3.0"},[l.AliasBitType.takePicture]:{since:"1.3.0"}}},[l.RootBitType.trueFalse1]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse},{type:a.BitTagType.tag,configKey:s.TagConfigKey.true},{type:a.BitTagType.tag,configKey:s.TagConfigKey.false}],resourceAttachmentAllowed:!0,bodyAllowed:!1,rootExampleType:c.ExampleType.boolean},[l.RootBitType.trueFalse]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse}],cardSet:o.CardSetConfigKey._statements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.vendorPadletEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.padletId}],bodyAllowed:!0},[l.RootBitType.vendorJupyterOutput]:{since:"1.4.3",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.jupyterId},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.jupyterExecutionCount},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.computerLanguage}],bodyAllowed:!0,aliases:{[l.AliasBitType.vendorJupyterCellCode]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterCellMarkdown]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterCellRaw]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterIpynb]:{since:"1.4.3"}}},[l.RootBitType.video]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideo,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoLandscape]:{since:"1.3.0"},[l.AliasBitType.videoPortrait]:{since:"1.3.0"}}},[l.RootBitType.videoEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoEmbed,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoEmbedLandscape]:{since:"1.3.0"},[l.AliasBitType.videoEmbedPortrait]:{since:"1.3.0"}}},[l.RootBitType.videoLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoLink,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoLinkLandscape]:{since:"1.3.0"},[l.AliasBitType.videoLinkPortrait]:{since:"1.3.0"}}},[l.RootBitType.websiteLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceWebsiteLink,minCount:1}],bodyAllowed:!0}};t.BITS=p},4182:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARDS=void 0;const o=r(2574),i=r(177),n=r(3518),s=r(6194),a=r(1595),l=r(742),u=r(1035),c={[o.CardSetConfigKey._flashcards]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._elements]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._statements]:{variants:[[{tags:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.true,maxCount:1},{type:l.BitTagType.tag,configKey:a.TagConfigKey.false,maxCount:1},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]]},[o.CardSetConfigKey._quiz]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]]},[o.CardSetConfigKey._questions]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:l.BitTagType.tag,configKey:a.TagConfigKey.sampleSolution},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.shortAnswer},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.longAnswer},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:a.TagConfigKey.title}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchAudioPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:a.TagConfigKey.title},{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.audio}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchImagePairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:a.TagConfigKey.title},{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.image}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchMatrix]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:a.TagConfigKey.title}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._botActionResponses]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reaction},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0}]]}};t.CARDS=c},9036:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GROUPS=void 0;const o=r(177),i=r(5428),n=r(3518),s=r(6194),a=r(1595),l=r(742),u=r(1035),c=r(9779),p={[o.GroupConfigKey.group_standardAllBits]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.id,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.externalId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.aiGenerated},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.ageRange,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.lang},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.target,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.tag,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.icon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.iconTag},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.colorTag,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:a.TagConfigKey.anchor}]},[o.GroupConfigKey.group_standardItemLeadInstructionHint]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.itemLead,maxCount:2},{type:l.BitTagType.tag,configKey:a.TagConfigKey.instruction},{type:l.BitTagType.tag,configKey:a.TagConfigKey.hint}]},[o.GroupConfigKey.group_standardExample]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.example}]},[o.GroupConfigKey.group_standardTags]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardAllBits},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]},[o.GroupConfigKey.group_imageSource]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.imageSource,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mockupId},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.size},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.format},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.trim}]}]},[o.GroupConfigKey.group_partner]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.partner,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage}]}]},[o.GroupConfigKey.group_gap]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.gap,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.gap,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_trueFalse]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.true,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:a.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]},{type:l.BitTagType.tag,configKey:a.TagConfigKey.false,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:a.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_markConfig]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.markConfig,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.color},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.emphasis}]}]},[o.GroupConfigKey.group_mark]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.tag_mark,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_mark},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_bookCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.language,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.spaceId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.kind},{type:l.BitTagType.tag,configKey:a.TagConfigKey.title,maxCount:2},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subtype,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.coverImage,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publisher,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subject,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.author,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.theme,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publications,maxCount:u.Count.infinity}]},[o.GroupConfigKey.group_learningPathCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.action},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.date},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.location},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.list,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.textReference},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isTracked},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isInfoOnly},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.deeplink},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.book,chain:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.tag_reference,maxCount:2}]}]},[o.GroupConfigKey.group_resourceCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.license},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.copyright},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.caption},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showInIndex}]},[o.GroupConfigKey.group_resourceImageCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt}]},[o.GroupConfigKey.group_resourceAudioCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay}]},[o.GroupConfigKey.group_resourceVideoCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.allowSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.posterImage},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x}]},[o.GroupConfigKey.group_resourceImage]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.image,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImagePortrait]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.imagePortrait,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageLandscape]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.imageLandscape,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.imageEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.imageLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceAudio]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.audio,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceAudioEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.audioEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceAudioLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.audioLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceVideo]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.video,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceVideoEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.videoEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceVideoLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.videoLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilmEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.stillImageFilmEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilmLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.stillImageFilmLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceArticle]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.article,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceArticleEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.articleEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceArticleLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.articleLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocument]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.document,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.documentEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.documentLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentDownload]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.documentDownload,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceAppLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.appLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceWebsiteLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.websiteLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilm]:{type:i.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.stillImageFilm,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudio,maxCount:1,minCount:1}]},[o.GroupConfigKey.group_resourceImageResponsive]:{type:i.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.imageResponsive,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImagePortrait,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageLandscape,maxCount:1,minCount:1}]}};t.GROUPS=p},6260:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PROPERTIES=void 0;const o=r(3518),i=r(7204),n=r(5486),s=r(7572),a=r(7953),l={[o.PropertyConfigKey.id]:{tag:a.PropertyTag.id,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalId]:{tag:a.PropertyTag.externalId,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.spaceId]:{tag:a.PropertyTag.spaceId,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.padletId]:{tag:a.PropertyTag.padletId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.jupyterId]:{tag:a.PropertyTag.jupyterId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.jupyterExecutionCount]:{tag:a.PropertyTag.jupyterExecutionCount,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.aiGenerated]:{tag:a.PropertyTag.aiGenerated,single:!0,format:n.PropertyFormat.boolean,astKey:i.PropertyAstKey.aiGenerated},[o.PropertyConfigKey.releaseVersion]:{tag:a.PropertyTag.releaseVersion,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.ageRange]:{tag:a.PropertyTag.ageRange,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.lang]:{tag:a.PropertyTag.lang,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.language]:{tag:a.PropertyTag.language,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.computerLanguage]:{tag:a.PropertyTag.computerLanguage,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.target]:{tag:a.PropertyTag.target,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.tag]:{tag:a.PropertyTag.tag,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.icon]:{tag:a.PropertyTag.icon,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.iconTag]:{tag:a.PropertyTag.iconTag,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.colorTag]:{tag:a.PropertyTag.colorTag,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.flashcardSet]:{tag:a.PropertyTag.flashcardSet,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.subtype]:{tag:a.PropertyTag.subtype,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.bookAlias]:{tag:a.PropertyTag.bookAlias,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.coverImage]:{tag:a.PropertyTag.coverImage,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.publisher]:{tag:a.PropertyTag.publisher,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.publications]:{tag:a.PropertyTag.publications,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.author]:{tag:a.PropertyTag.author,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.subject]:{tag:a.PropertyTag.subject,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.date]:{tag:a.PropertyTag.date,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.location]:{tag:a.PropertyTag.location,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.theme]:{tag:a.PropertyTag.theme,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.kind]:{tag:a.PropertyTag.kind,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.action]:{tag:a.PropertyTag.action,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.thumbImage]:{tag:a.PropertyTag.thumbImage,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.focusX]:{tag:a.PropertyTag.focusX,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.focusY]:{tag:a.PropertyTag.focusY,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.deeplink]:{tag:a.PropertyTag.deeplink,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalLink]:{tag:a.PropertyTag.externalLink,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalLinkText]:{tag:a.PropertyTag.externalLinkText,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.videoCallLink]:{tag:a.PropertyTag.videoCallLink,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.bot]:{tag:a.PropertyTag.bot,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.duration]:{tag:a.PropertyTag.duration,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.property_reference]:{tag:a.PropertyTag.reference,format:n.PropertyFormat.trimmedString,astKey:i.PropertyAstKey.referenceProperty},[o.PropertyConfigKey.list]:{tag:a.PropertyTag.list,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.textReference]:{tag:a.PropertyTag.textReference,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.isTracked]:{tag:a.PropertyTag.isTracked,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.isInfoOnly]:{tag:a.PropertyTag.isInfoOnly,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.labelTrue]:{tag:a.PropertyTag.labelTrue,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.labelFalse]:{tag:a.PropertyTag.labelFalse,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.content2Buy]:{tag:a.PropertyTag.content2Buy,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.quotedPerson]:{tag:a.PropertyTag.quotedPerson,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.partialAnswer]:{tag:a.PropertyTag.partialAnswer,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.reasonableNumOfChars]:{tag:a.PropertyTag.reasonableNumOfChars,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.maxCreatedBits]:{tag:a.PropertyTag.maxCreatedBits,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.example]:{tag:a.PropertyTag.example,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.toc]:{tag:a.PropertyTag.toc,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[o.PropertyConfigKey.progress]:{tag:a.PropertyTag.progress,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[o.PropertyConfigKey.book]:{tag:a.PropertyTag.book,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.partner]:{tag:a.PropertyTag.partner,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.property_sampleSolution]:{tag:a.PropertyTag.sampleSolution,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.markConfig]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString,astKey:i.PropertyAstKey.markConfig},[o.PropertyConfigKey.property_mark]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.color]:{tag:a.PropertyTag.color,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.emphasis]:{tag:a.PropertyTag.emphasis,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.shortAnswer]:{tag:a.PropertyTag.shortAnswer,single:!0,format:n.PropertyFormat.boolean,astKey:i.PropertyAstKey.isShortAnswer,jsonKey:s.PropertyJsonKey.shortAnswer},[o.PropertyConfigKey.longAnswer]:{tag:a.PropertyTag.longAnswer,single:!0,format:n.PropertyFormat.invertedBoolean,astKey:i.PropertyAstKey.isShortAnswer,jsonKey:s.PropertyJsonKey.shortAnswer},[o.PropertyConfigKey.caseSensitive]:{tag:a.PropertyTag.caseSensitive,single:!0,format:n.PropertyFormat.boolean,astKey:i.PropertyAstKey.isCaseSensitive,jsonKey:s.PropertyJsonKey.caseSensitive},[o.PropertyConfigKey.reaction]:{tag:a.PropertyTag.reaction,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.imageSource]:{tag:a.PropertyTag.imageSource,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.mockupId]:{tag:a.PropertyTag.mockupId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.size]:{tag:a.PropertyTag.size,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.format]:{tag:a.PropertyTag.format,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.trim]:{tag:a.PropertyTag.trim,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.width]:{tag:a.PropertyTag.width,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.height]:{tag:a.PropertyTag.height,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.license]:{tag:a.PropertyTag.license,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.copyright]:{tag:a.PropertyTag.copyright,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.caption]:{tag:a.PropertyTag.caption,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.showInIndex]:{tag:a.PropertyTag.showInIndex,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.alt]:{tag:a.PropertyTag.alt,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src1x]:{tag:a.PropertyTag.src1x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src2x]:{tag:a.PropertyTag.src2x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src3x]:{tag:a.PropertyTag.src3x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src4x]:{tag:a.PropertyTag.src4x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.mute]:{tag:a.PropertyTag.mute,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.autoplay]:{tag:a.PropertyTag.autoplay,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.allowSubtitles]:{tag:a.PropertyTag.allowSubtitles,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.showSubtitles]:{tag:a.PropertyTag.showSubtitles,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.siteName]:{tag:a.PropertyTag.siteName,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.posterImage]:{tag:a.PropertyTag.posterImage,single:!0,format:n.PropertyFormat.trimmedString}};t.PROPERTIES=l},5100:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RESOURCES=void 0;const o=r(6194),i=r(9431),n=r(9779),s={[o.ResourceConfigKey.image]:{tag:n.ResourceTag.image},[o.ResourceConfigKey.imagePortrait]:{tag:n.ResourceTag.imagePortrait,jsonKey:i.ResourceJsonKey.imagePortrait},[o.ResourceConfigKey.imageLandscape]:{tag:n.ResourceTag.imageLandscape,jsonKey:i.ResourceJsonKey.imageLandscape},[o.ResourceConfigKey.imageEmbed]:{tag:n.ResourceTag.imageEmbed,jsonKey:i.ResourceJsonKey.imageEmbed},[o.ResourceConfigKey.imageLink]:{tag:n.ResourceTag.imageLink,jsonKey:i.ResourceJsonKey.imageLink},[o.ResourceConfigKey.audio]:{tag:n.ResourceTag.audio},[o.ResourceConfigKey.audioEmbed]:{tag:n.ResourceTag.audioEmbed,jsonKey:i.ResourceJsonKey.audioEmbed},[o.ResourceConfigKey.audioLink]:{tag:n.ResourceTag.audioLink,jsonKey:i.ResourceJsonKey.audioLink},[o.ResourceConfigKey.video]:{tag:n.ResourceTag.video},[o.ResourceConfigKey.videoEmbed]:{tag:n.ResourceTag.videoEmbed,jsonKey:i.ResourceJsonKey.videoEmbed},[o.ResourceConfigKey.videoLink]:{tag:n.ResourceTag.videoLink,jsonKey:i.ResourceJsonKey.videoLink},[o.ResourceConfigKey.stillImageFilmEmbed]:{tag:n.ResourceTag.stillImageFilmEmbed,jsonKey:i.ResourceJsonKey.stillImageFilmEmbed},[o.ResourceConfigKey.stillImageFilmLink]:{tag:n.ResourceTag.stillImageFilmLink,jsonKey:i.ResourceJsonKey.stillImageFilmLink},[o.ResourceConfigKey.article]:{tag:n.ResourceTag.article},[o.ResourceConfigKey.articleEmbed]:{tag:n.ResourceTag.articleEmbed,jsonKey:i.ResourceJsonKey.articleEmbed},[o.ResourceConfigKey.articleLink]:{tag:n.ResourceTag.articleLink,jsonKey:i.ResourceJsonKey.articleLink},[o.ResourceConfigKey.document]:{tag:n.ResourceTag.document},[o.ResourceConfigKey.documentEmbed]:{tag:n.ResourceTag.documentEmbed,jsonKey:i.ResourceJsonKey.documentEmbed},[o.ResourceConfigKey.documentLink]:{tag:n.ResourceTag.documentLink,jsonKey:i.ResourceJsonKey.documentLink},[o.ResourceConfigKey.documentDownload]:{tag:n.ResourceTag.documentDownload,jsonKey:i.ResourceJsonKey.documentDownload},[o.ResourceConfigKey.appLink]:{tag:n.ResourceTag.appLink,jsonKey:i.ResourceJsonKey.appLink},[o.ResourceConfigKey.websiteLink]:{tag:n.ResourceTag.websiteLink,jsonKey:i.ResourceJsonKey.websiteLink}};t.RESOURCES=s},3622:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS=void 0;const o=r(1595),i=r(8739),n={[o.TagConfigKey.title]:{tag:i.Tag.title},[o.TagConfigKey.anchor]:{tag:i.Tag.anchor},[o.TagConfigKey.tag_reference]:{tag:i.Tag.reference},[o.TagConfigKey.property]:{tag:i.Tag.property},[o.TagConfigKey.itemLead]:{tag:i.Tag.itemLead},[o.TagConfigKey.instruction]:{tag:i.Tag.instruction},[o.TagConfigKey.hint]:{tag:i.Tag.hint},[o.TagConfigKey.true]:{tag:i.Tag.true},[o.TagConfigKey.false]:{tag:i.Tag.false},[o.TagConfigKey.sampleSolution]:{tag:i.Tag.sampleSolution},[o.TagConfigKey.gap]:{tag:i.Tag.gap},[o.TagConfigKey.tag_mark]:{tag:i.Tag.mark},[o.TagConfigKey.resource]:{tag:i.Tag.resource},[o.TagConfigKey.remark]:{tag:i.Tag.remark},[o.TagConfigKey.comment]:{tag:i.Tag.comment}};t.TAGS=n},1022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildInfo=void 0,t.buildInfo={name:"@gmb/bitmark-parser-generator",version:"1.4.5",author:"Get More Brain Ltd",license:"ISC",description:"A bitmark parser and generator using Peggy.js"}},4369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const o=r(6831),i=r(2892),n=r(7448);function s(e,t,r,o){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,s.prototype),i.expected=t,i.found=r,i.location=o,i.name="SyntaxError",i}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}t.SyntaxError=s,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(s,Error),s.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,o=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){o=e[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,s=this.location.source+":"+n.line+":"+n.column;if(o){var l=this.location.end,u=a("",n.line.toString().length," "),c=o[i.line-1],p=(i.line===l.line?l.column:c.length+1)-i.column||1;t+="\n --\x3e "+s+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+a("",i.column-1," ")+a("",p,"^")}else t+="\n at "+s}return t},s.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function o(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function s(e){return r[e.type](e)}return"Expected "+function(e){var t,r,o=e.map(s);if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},t.parse=function e(t,r){var a,l={},u=(r=void 0!==r?r:{}).grammarSource,c={bitmark:nr,bit:function(){var e,t,r,o,i;e=Jt,t=[],r=Sr();for(;r!==l;)t.push(r),r=Sr();if((r=lr())!==l){for(o=[],i=Sr();i!==l;)o.push(i),i=Sr();qt=e,e=We(r)}else Jt=e,e=l;return e},cardContent:function(){var e,t,r;e=Jt,t=[],(r=gr())===l&&(r=vr());for(;r!==l;)t.push(r),(r=gr())===l&&(r=vr());return qt=e,t=bt(t),e=t}},p=nr,g="[.",d="]",y=":",f="&",h="====",m="~~~~",T="--",b="++",v="===",C="==",x="[@id",A="[",w="#",k="[▼",B="[►",P="[@",K="[%",S="[!",_="[?",R="[+",I="[-",O="[$",E="[_",L="[=",j="[&",V="::",F="||",G="id:",N="\n",D="\r\n",U="\r",M="\u2028",$="\u2029",J=/^[^\]]/,q=/^[^:\]]/,H=/^[^&:\]]/,z=/^[ \t]/,W=/^[^\n\r\u2028\u2029]/,Y=/^[ \t\n\r\u2028\u2029]/,X=Zt("[.",!1),Z=Qt(["]"],!0,!1),Q=Zt("]",!1),ee=Zt(":",!1),te=Zt("&",!1),re={type:"any"},oe=Zt("====",!1),ie=Zt("~~~~",!1),ne=Zt("--",!1),se=Zt("++",!1),ae=Zt("===",!1),le=Zt("==",!1),ue=Zt("[@id",!1),ce=Zt("[",!1),pe=Zt("#",!1),ge=Zt("[▼",!1),de=Zt("[►",!1),ye=Zt("[@",!1),fe=Zt("[%",!1),he=Zt("[!",!1),me=Zt("[?",!1),Te=Zt("[+",!1),be=Zt("[-",!1),ve=Zt("[$",!1),Ce=Zt("[_",!1),xe=Zt("[=",!1),Ae=Zt("[&",!1),we=Zt("::",!1),ke=Zt("||",!1),Be=Zt("id:",!1),Pe=Qt([":","]"],!0,!1),Ke=Qt(["&",":","]"],!0,!1),Se=(er("Empty"),Qt([" ","\t"],!1,!1)),_e=er("Anything"),Re=er("Character"),Ie=Qt(["\n","\r","\u2028","\u2029"],!0,!1),Oe=er("Line"),Ee=(er("whitespace in line"),er("Blank Line")),Le=er("Line Terminator"),je=Zt("\n",!1),Ve=Zt("\r\n",!1),Fe=Zt("\r",!1),Ge=Zt("\u2028",!1),Ne=Zt("\u2029",!1),De=er("Whitespace, then Line Terminator"),Ue=er("whitespace"),Me=Qt([" ","\t","\n","\r","\u2028","\u2029"],!1,!1),$e=function(e,t){return jr.buildBits([e,...t])},Je=function(e){return Lr.handleRawBit(e)},qe=function(e){return e},He=function(e){return Lr.handleRawBit(e)},ze=function(e){return e},We=function(e){return e},Ye=function(e,t){return jr.buildBit(e,t)},Xe=function(e){return jr.invalidBit(e)},Ze=function(e,t){return jr.buildBitHeader(e,t)},Qe=function(e,t){return jr.buildTextAndResourceType(e,t)},et=function(e){return Lr.handleTextFormat(e)},tt=function(e){return Lr.handleResourceType(e)},rt=function(e){return Lr.handleBitContent(e)},ot=function(e){return Lr.handleTagChain(e)},it=function(e){return e},nt=function(e){return Lr.handleBitTag(e)},st=function(e){return{type:o.TypeKey.BodyChar,value:e}},at=function(e){return Lr.handleCardSet(e[1].flat())},lt=function(){Lr.handleCardSetStart()},ut=function(){Lr.handleCardSetEnd()},ct=function(e){return Lr.handleCards(e)},pt=function(e){return Lr.handleCardLineOrDivider(e,2)},gt=function(e){return Lr.handleCardLine(e)},dt=function(e){return Lr.handleCardSet(e[1].flat())},yt=function(){Lr.handleCardSetStart()},ft=function(){Lr.handleCardSetEnd()},ht=function(e){return Lr.handleCards(e)},mt=function(e){return Lr.handleCardLineOrDivider(e,1)},Tt=function(e){return Lr.handleCardLine(e)},bt=function(e){return Lr.handleCardContent(e)},vt=function(e){return{type:o.TypeKey.CardChar,value:e}},Ct=function(e){return Lr.handlePropertyTag("id",e)},xt=function(e,t){return Lr.handleTag(o.TypeKey.Title,{level:e,title:t})},At=function(e){return Lr.handleTag(o.TypeKey.Anchor,e)},wt=function(e){return Lr.handleTag(o.TypeKey.Reference,e)},kt=function(e,t){return Lr.handlePropertyTag(e,t)},Bt=function(e){return Lr.handleTag(o.TypeKey.ItemLead,e)},Pt=function(e){return Lr.handleTag(o.TypeKey.Instruction,e)},Kt=function(e){return Lr.handleTag(o.TypeKey.Hint,e)},St=function(e){return Lr.handleTag(o.TypeKey.True,e)},_t=function(e){return Lr.handleTag(o.TypeKey.False,e)},Rt=function(e){return Lr.handleTag(o.TypeKey.SampleSolution,e)},It=function(e){return Lr.handleTag(o.TypeKey.Gap,e)},Ot=function(e){return Lr.handleTag(o.TypeKey.Mark,e)},Et=function(e,t){return Lr.handleResourceTag(e,t)},Lt=function(e){return Lr.handleTag(o.TypeKey.BodyText,e)},jt=function(e){return Lr.handleTag(o.TypeKey.Comment,e)},Vt=function(e){return e},Ft=function(e){return e?e.trim():""},Gt=function(e){return e?e.trim():null},Nt=function(e){return e?e.trim():""},Dt=function(){return!0},Ut=function(e){return e},Mt=function(e){return e},$t=function(e){return e},Jt=0,qt=0,Ht=[{line:1,column:1}],zt=0,Wt=[],Yt=0;if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');p=c[r.startRule]}function Xt(){return t.substring(qt,Jt)}function Zt(e,t){return{type:"literal",text:e,ignoreCase:t}}function Qt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function er(e){return{type:"other",description:e}}function tr(e){var r,o=Ht[e];if(o)return o;for(r=e-1;!Ht[r];)r--;for(o={line:(o=Ht[r]).line,column:o.column};r<e;)10===t.charCodeAt(r)?(o.line++,o.column=1):o.column++,r++;return Ht[e]=o,o}function rr(e,t,r){var o=tr(e),i=tr(t),n={source:u,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return r&&u&&"function"==typeof u.offset&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}function or(e){Jt<zt||(Jt>zt&&(zt=Jt,Wt=[]),Wt.push(e))}function ir(e,t,r){return new s(s.buildMessage(e,t),e,t,r)}function nr(){return function(){var e,r,o,i;e=Jt,r=[],(o=Ir())===l&&(o=Cr());for(;o!==l;)r.push(o),(o=Ir())===l&&(o=Cr());return o=function(){var e,r,o,i;e=Jt,r=Jt,o=[],i=ar();for(;i!==l;)o.push(i),i=ar();return r=t.substring(r,Jt),qt=e,r=Je(r),e=r,e}(),i=function(){var e,t;e=[],t=sr();for(;t!==l;)e.push(t),t=sr();return e}(),qt=e,e=$e(o,i),e}()}function sr(){var e,r,o,i;for(e=Jt,r=[],o=Sr();o!==l;)r.push(o),o=Sr();return(o=_r())===l&&(o=null),i=function(){var e,r,o,i,n,s;if(e=Jt,r=Jt,o=Jt,i=function(){var e,r,o,i;e=Jt,t.substr(Jt,2)===g?(r=g,Jt+=2):(r=l,0===Yt&&or(X));if(r!==l){for(o=[],J.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Z));i!==l;)o.push(i),J.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Z));93===t.charCodeAt(Jt)?(i=d,Jt++):(i=l,0===Yt&&or(Q)),i!==l?(qt=e,e=ze(r)):(Jt=e,e=l)}else Jt=e,e=l;return e}(),i!==l){for(n=[],s=ar();s!==l;)n.push(s),s=ar();o=i=[i,n]}else Jt=o,o=l;r=o!==l?t.substring(r,Jt):o;r!==l&&(qt=e,r=He(r));return e=r,e}(),i!==l?(qt=e,e=qe(i)):(Jt=e,e=l),e}function ar(){var e,t,r,o;if(e=Jt,(t=_r())!==l?(r=Jt,Yt++,o=ur(),Yt--,o===l?r=void 0:(Jt=r,r=l),r!==l?e=t=[t,r]:(Jt=e,e=l)):(Jt=e,e=l),e===l)if(e=[],(t=Pr())!==l)for(;t!==l;)e.push(t),t=Pr();else e=l;return e}function lr(){var e,r,o;return e=Jt,(r=ur())!==l?(o=function(){var e,t,r;e=Jt,t=[],r=hr(),r===l&&(r=Tr())===l&&(r=gr())===l&&(r=fr());for(;r!==l;)t.push(r),(r=hr())===l&&(r=Tr())===l&&(r=gr())===l&&(r=fr());return qt=e,t=rt(t),e=t,e}(),qt=e,e=Ye(r,o)):(Jt=e,e=l),e===l&&(e=Jt,r=Jt,o=function(){var e,r;Yt++,e=[],t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re));for(;r!==l;)e.push(r),t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re));Yt--,r=l,0===Yt&&or(_e);return e}(),r=t.substring(r,Jt),qt=e,e=r=Xe(r)),e}function ur(){var e,r,o,i,n;return e=Jt,t.substr(Jt,2)===g?(r=g,Jt+=2):(r=l,0===Yt&&or(X)),r!==l?(o=kr(),i=function(){var e,t,r;e=Jt,t=cr(),t===l&&(t=pr());t===l&&(t=null);r=cr(),r===l&&(r=pr());r===l&&(r=null);return qt=e,e=Qe(t,r),e}(),93===t.charCodeAt(Jt)?(n=d,Jt++):(n=l,0===Yt&&or(Q)),n!==l?(qt=e,e=Ze(o,i)):(Jt=e,e=l)):(Jt=e,e=l),e}function cr(){var e,r,o;return e=Jt,58===t.charCodeAt(Jt)?(r=y,Jt++):(r=l,0===Yt&&or(ee)),r!==l?(o=kr(),qt=e,e=et(o)):(Jt=e,e=l),e}function pr(){var e,r,o;return e=Jt,38===t.charCodeAt(Jt)?(r=f,Jt++):(r=l,0===Yt&&or(te)),r!==l?(o=kr(),qt=e,e=tt(o)):(Jt=e,e=l),e}function gr(){var e,t,r,o,i;if(e=Jt,t=Jt,(r=yr())!==l){for(o=[],i=dr();i!==l;)o.push(i),i=dr();t=r=[r,o]}else Jt=t,t=l;return t!==l&&(qt=e,t=ot(t)),e=t}function dr(){var e,t;return e=Jt,(t=yr())!==l&&(qt=e,t=it(t)),e=t}function yr(){var e,r;return e=Jt,(r=Cr())===l&&(r=function(){var e,r,o,i,n,s,a,u;e=Jt,r=Jt,o=Jt,t.substr(Jt,2)===V?(i=V,Jt+=2):(i=l,0===Yt&&or(we));i!==l?(n=function(){var e,r,o,i,n,s;e=Jt,r=Jt,o=[],i=Jt,n=Jt,Yt++,t.substr(Jt,2)===V?(s=V,Jt+=2):(s=l,0===Yt&&or(we));Yt--,s===l?n=void 0:(Jt=n,n=l);n!==l&&(s=Pr())!==l?i=n=[n,s]:(Jt=i,i=l);for(;i!==l;)o.push(i),i=Jt,n=Jt,Yt++,t.substr(Jt,2)===V?(s=V,Jt+=2):(s=l,0===Yt&&or(we)),Yt--,s===l?n=void 0:(Jt=n,n=l),n!==l&&(s=Pr())!==l?i=n=[n,s]:(Jt=i,i=l);return r=t.substring(r,Jt),qt=e,r=Ut(r),e=r,e}(),t.substr(Jt,2)===V?(s=V,Jt+=2):(s=l,0===Yt&&or(we)),s!==l?(a=function(){var e,r,o,i,n,s;e=Jt,r=Jt,o=[],i=Jt,n=Jt,Yt++,t.substr(Jt,2)===V?(s=V,Jt+=2):(s=l,0===Yt&&or(we));Yt--,s===l?n=void 0:(Jt=n,n=l);n!==l?(t.length>Jt?(s=t.charAt(Jt),Jt++):(s=l,0===Yt&&or(re)),s!==l?i=n=[n,s]:(Jt=i,i=l)):(Jt=i,i=l);for(;i!==l;)o.push(i),i=Jt,n=Jt,Yt++,t.substr(Jt,2)===V?(s=V,Jt+=2):(s=l,0===Yt&&or(we)),Yt--,s===l?n=void 0:(Jt=n,n=l),n!==l?(t.length>Jt?(s=t.charAt(Jt),Jt++):(s=l,0===Yt&&or(re)),s!==l?i=n=[n,s]:(Jt=i,i=l)):(Jt=i,i=l);return r=t.substring(r,Jt),qt=e,r=Mt(r),e=r,e}(),u=function(){var e,r,o;t.substr(Jt,2)===V?(e=V,Jt+=2):(e=l,0===Yt&&or(we));if(e===l){for(e=Jt,r=[],o=Ir();o!==l;)r.push(o),o=Ir();(o=Er())!==l?e=r=[r,o]:(Jt=e,e=l)}return e}(),u!==l?o=i=[i,n,s,a,u]:(Jt=o,o=l)):(Jt=o,o=l)):(Jt=o,o=l);r=o!==l?t.substring(r,Jt):o;r!==l&&(qt=e,r=Lt(r));return e=r,e}(),r===l&&(r=function(){var e,r,o,i;e=Jt,t.substr(Jt,4)===x?(r=x,Jt+=4):(r=l,0===Yt&&or(ue));r!==l&&(o=Br())!==l?(i=function(){var e;93===t.charCodeAt(Jt)?(e=d,Jt++):(e=l,0===Yt&&or(Q));return e}(),i!==l?(qt=e,e=Ct(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Jt,t.substr(Jt,2)===P?(r=P,Jt+=2):(r=l,0===Yt&&or(ye));r!==l&&(o=Ar())!==l&&(i=Br())!==l&&wr()!==l?(qt=e,e=kt(o,i)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Jt,91===t.charCodeAt(Jt)?(r=A,Jt++):(r=l,0===Yt&&or(ce));if(r!==l){if(o=[],35===t.charCodeAt(Jt)?(i=w,Jt++):(i=l,0===Yt&&or(pe)),i!==l)for(;i!==l;)o.push(i),35===t.charCodeAt(Jt)?(i=w,Jt++):(i=l,0===Yt&&or(pe));else o=l;o!==l?(i=xr(),wr()!==l?(qt=e,e=xt(o,i)):(Jt=e,e=l)):(Jt=e,e=l)}else Jt=e,e=l;return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===k?(r=k,Jt+=2):(r=l,0===Yt&&or(ge));r!==l?(o=xr(),wr()!==l?(qt=e,e=At(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===B?(r=B,Jt+=2):(r=l,0===Yt&&or(de));r!==l?(o=xr(),wr()!==l?(qt=e,e=wt(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===K?(r=K,Jt+=2):(r=l,0===Yt&&or(fe));r!==l?(o=xr(),wr()!==l?(qt=e,e=Bt(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===S?(r=S,Jt+=2):(r=l,0===Yt&&or(he));r!==l?(o=xr(),wr()!==l?(qt=e,e=Pt(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===_?(r=_,Jt+=2):(r=l,0===Yt&&or(me));r!==l?(o=xr(),wr()!==l?(qt=e,e=Kt(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===E?(r=E,Jt+=2):(r=l,0===Yt&&or(Ce));r!==l?(o=xr(),wr()!==l?(qt=e,e=It(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===L?(r=L,Jt+=2):(r=l,0===Yt&&or(xe));r!==l?(o=xr(),wr()!==l?(qt=e,e=Ot(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===O?(r=O,Jt+=2):(r=l,0===Yt&&or(ve));r!==l?(o=xr(),wr()!==l?(qt=e,e=Rt(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===R?(r=R,Jt+=2):(r=l,0===Yt&&or(Te));r!==l?(o=xr(),wr()!==l?(qt=e,e=St(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===I?(r=I,Jt+=2):(r=l,0===Yt&&or(be));r!==l?(o=xr(),wr()!==l?(qt=e,e=_t(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Jt,t.substr(Jt,2)===j?(r=j,Jt+=2):(r=l,0===Yt&&or(Ae));r!==l&&(o=Ar())!==l&&(i=Br())!==l&&wr()!==l?(qt=e,e=Et(o,i)):(Jt=e,e=l);return e}()))))))))))))))),r!==l&&(qt=e,r=nt(r)),e=r}function fr(){var e,r;return e=Jt,t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re)),r!==l&&(qt=e,r=st(r)),e=r}function hr(){var e,r,o,i,n;if(e=Jt,r=Jt,o=function(){var e,r,o,i,n,s;e=Jt,r=_r(),r!==l?(o=Jt,Yt++,i=Jt,t.substr(Jt,4)===h?(n=h,Jt+=4):(n=l,0===Yt&&or(oe)),n!==l&&(s=Rr())!==l?i=n=[n,s]:(Jt=i,i=l),Yt--,i!==l?(Jt=o,o=void 0):o=l,o!==l?(qt=e,e=lt()):(Jt=e,e=l)):(Jt=e,e=l);return e}(),o!==l){for(i=[],n=mr();n!==l;)i.push(n),n=mr();n=function(){var e,r,o,i,n;e=Jt,r=Jt,t.substr(Jt,4)===m?(o=m,Jt+=4):(o=l,0===Yt&&or(ie));o===l&&(o=null);i=Jt,Yt++,n=Or(),Yt--,n!==l?(Jt=i,i=void 0):i=l;i!==l?r=o=[o,i]:(Jt=r,r=l);r!==l&&(qt=e,r=ut());return e=r,e}(),n!==l?r=o=[o,i,n]:(Jt=r,r=l)}else Jt=r,r=l;return r!==l&&(qt=e,r=at(r)),e=r}function mr(){var e,r;return e=Jt,r=function(){var e,r,o,i;e=Jt,r=Jt,t.substr(Jt,4)===h?(o=h,Jt+=4):(o=l,0===Yt&&or(oe));o!==l?((i=Rr())===l&&(i=Or()),i!==l?r=o=[o,i]:(Jt=r,r=l)):(Jt=r,r=l);r===l&&(r=Jt,t.substr(Jt,2)===T?(o=T,Jt+=2):(o=l,0===Yt&&or(ne)),o!==l?((i=Rr())===l&&(i=Or()),i!==l?r=o=[o,i]:(Jt=r,r=l)):(Jt=r,r=l),r===l&&(r=Jt,t.substr(Jt,2)===b?(o=b,Jt+=2):(o=l,0===Yt&&or(se)),o!==l?((i=Rr())===l&&(i=Or()),i!==l?r=o=[o,i]:(Jt=r,r=l)):(Jt=r,r=l),r===l&&(r=function(){var e,r,o,i,n,s;e=Jt,r=Jt,Yt++,o=Jt,t.substr(Jt,4)===m?(i=m,Jt+=4):(i=l,0===Yt&&or(ie));i!==l&&(n=Or())!==l?o=i=[i,n]:(Jt=o,o=l);Yt--,o===l?r=void 0:(Jt=r,r=l);if(r!==l){if(o=Jt,i=Jt,n=Kr(),(s=_r())!==l?i=n=[n,s]:(Jt=i,i=l),i===l){if(i=Jt,n=[],(s=Pr())!==l)for(;s!==l;)n.push(s),s=Pr();else n=l;n!==l?(s=function(){var e,r;e=_r(),e===l&&(e=Jt,Yt++,t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re)),Yt--,r===l?e=void 0:(Jt=e,e=l));return e}(),s!==l?i=n=[n,s]:(Jt=i,i=l)):(Jt=i,i=l)}(o=i!==l?t.substring(o,Jt):i)!==l?(qt=e,e=gt(o)):(Jt=e,e=l)}else Jt=e,e=l;return e}())));r!==l&&(qt=e,r=pt(r));return e=r,e}(),r!==l&&(qt=e,r=ct(r)),e=r}function Tr(){var e,r,o,i,n;if(e=Jt,r=Jt,o=function(){var e,r,o,i,n,s;e=Jt,r=_r(),r!==l?(o=Jt,Yt++,i=Jt,t.substr(Jt,3)===v?(n=v,Jt+=3):(n=l,0===Yt&&or(ae)),n!==l&&(s=Rr())!==l?i=n=[n,s]:(Jt=i,i=l),Yt--,i!==l?(Jt=o,o=void 0):o=l,o!==l?(qt=e,e=yt()):(Jt=e,e=l)):(Jt=e,e=l);return e}(),o!==l){for(i=[],n=br();n!==l;)i.push(n),n=br();n=function(){var e,r,o,i,n;e=Jt,r=Jt,t.substr(Jt,3)===v?(o=v,Jt+=3):(o=l,0===Yt&&or(ae));o!==l?(i=Jt,Yt++,n=Or(),Yt--,n!==l?(Jt=i,i=void 0):i=l,i!==l?r=o=[o,i]:(Jt=r,r=l)):(Jt=r,r=l);r!==l&&(qt=e,r=ft());return e=r,e}(),n!==l?r=o=[o,i,n]:(Jt=r,r=l)}else Jt=r,r=l;return r!==l&&(qt=e,r=dt(r)),e=r}function br(){var e,r,o,i,n,s,a,u,c,p,g;if(e=Jt,r=Jt,Yt++,o=Jt,t.substr(Jt,3)===v?(i=v,Jt+=3):(i=l,0===Yt&&or(ae)),i!==l){for(n=[],s=Ir();s!==l;)n.push(s),s=Ir();for(s=[],a=Jt,u=Jt,Yt++,c=Jt,(p=_r())!==l?(t.substr(Jt,3)===v?(g=v,Jt+=3):(g=l,0===Yt&&or(ae)),g!==l?c=p=[p,g]:(Jt=c,c=l)):(Jt=c,c=l),Yt--,c===l?u=void 0:(Jt=u,u=l),u!==l?(t.length>Jt?(c=t.charAt(Jt),Jt++):(c=l,0===Yt&&or(re)),c!==l?a=u=[u,c]:(Jt=a,a=l)):(Jt=a,a=l);a!==l;)s.push(a),a=Jt,u=Jt,Yt++,c=Jt,(p=_r())!==l?(t.substr(Jt,3)===v?(g=v,Jt+=3):(g=l,0===Yt&&or(ae)),g!==l?c=p=[p,g]:(Jt=c,c=l)):(Jt=c,c=l),Yt--,c===l?u=void 0:(Jt=u,u=l),u!==l?(t.length>Jt?(c=t.charAt(Jt),Jt++):(c=l,0===Yt&&or(re)),c!==l?a=u=[u,c]:(Jt=a,a=l)):(Jt=a,a=l);(a=Er())!==l?o=i=[i,n,s,a]:(Jt=o,o=l)}else Jt=o,o=l;return Yt--,o===l?r=void 0:(Jt=r,r=l),r!==l?(o=function(){var e,r,o,i;e=Jt,r=Jt,t.substr(Jt,3)===v?(o=v,Jt+=3):(o=l,0===Yt&&or(ae));o!==l&&(i=Rr())!==l?r=o=[o,i]:(Jt=r,r=l);r===l&&(r=Jt,t.substr(Jt,2)===C?(o=C,Jt+=2):(o=l,0===Yt&&or(le)),o!==l&&(i=Rr())!==l?r=o=[o,i]:(Jt=r,r=l),r===l&&(r=Jt,t.substr(Jt,2)===T?(o=T,Jt+=2):(o=l,0===Yt&&or(ne)),o!==l&&(i=Rr())!==l?r=o=[o,i]:(Jt=r,r=l),r===l&&(r=function(){var e,r,o,i,n;e=Jt,r=Jt,o=Jt,i=Kr(),n=_r(),n!==l?o=i=[i,n]:(Jt=o,o=l);r=o!==l?t.substring(r,Jt):o;r!==l&&(qt=e,r=Tt(r));return e=r,e}())));r!==l&&(qt=e,r=mt(r));return e=r,e}(),o!==l?(qt=e,e=ht(o)):(Jt=e,e=l)):(Jt=e,e=l),e}function vr(){var e,r;return e=Jt,t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re)),r!==l&&(qt=e,r=vt(r)),e=r}function Cr(){var e,r,o,i;return e=Jt,t.substr(Jt,2)===F?(r=F,Jt+=2):(r=l,0===Yt&&or(ke)),r!==l?(o=function(){var e,r,o,i,n,s;e=Jt,r=Jt,o=[],i=Jt,n=Jt,Yt++,t.substr(Jt,2)===F?(s=F,Jt+=2):(s=l,0===Yt&&or(ke));Yt--,s===l?n=void 0:(Jt=n,n=l);n!==l?(t.length>Jt?(s=t.charAt(Jt),Jt++):(s=l,0===Yt&&or(re)),s!==l?i=n=[n,s]:(Jt=i,i=l)):(Jt=i,i=l);for(;i!==l;)o.push(i),i=Jt,n=Jt,Yt++,t.substr(Jt,2)===F?(s=F,Jt+=2):(s=l,0===Yt&&or(ke)),Yt--,s===l?n=void 0:(Jt=n,n=l),n!==l?(t.length>Jt?(s=t.charAt(Jt),Jt++):(s=l,0===Yt&&or(re)),s!==l?i=n=[n,s]:(Jt=i,i=l)):(Jt=i,i=l);return r=t.substring(r,Jt),qt=e,r=$t(r),e=r,e}(),i=function(){var e,r,o;t.substr(Jt,2)===F?(e=F,Jt+=2):(e=l,0===Yt&&or(ke));if(e===l){for(e=Jt,r=[],o=Ir();o!==l;)r.push(o),o=Ir();(o=Er())!==l?e=r=[r,o]:(Jt=e,e=l)}return e}(),i!==l?(qt=e,e=jt(o)):(Jt=e,e=l)):(Jt=e,e=l),e}function xr(){var e,r,o,i;for(e=Jt,r=Jt,o=[],J.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Z));i!==l;)o.push(i),J.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Z));return r=t.substring(r,Jt),qt=e,e=r=Vt(r)}function Ar(){var e,r,o,i,n;if(e=Jt,r=Jt,Yt++,t.substr(Jt,3)===G?(o=G,Jt+=3):(o=l,0===Yt&&or(Be)),Yt--,o===l?r=void 0:(Jt=r,r=l),r!==l){for(o=Jt,i=[],q.test(t.charAt(Jt))?(n=t.charAt(Jt),Jt++):(n=l,0===Yt&&or(Pe));n!==l;)i.push(n),q.test(t.charAt(Jt))?(n=t.charAt(Jt),Jt++):(n=l,0===Yt&&or(Pe));o=t.substring(o,Jt),qt=e,e=Ft(o)}else Jt=e,e=l;return e}function wr(){var e,r,o;if(93===t.charCodeAt(Jt)?(e=d,Jt++):(e=l,0===Yt&&or(Q)),e===l){for(e=Jt,r=[],o=Ir();o!==l;)r.push(o),o=Ir();(o=Er())!==l?e=r=[r,o]:(Jt=e,e=l)}return e}function kr(){var e,r,o,i;for(e=Jt,r=Jt,o=[],H.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Ke));i!==l;)o.push(i),H.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Ke));return r=t.substring(r,Jt),qt=e,e=r=Gt(r)}function Br(){var e,r,o;return e=Jt,58===t.charCodeAt(Jt)?(r=y,Jt++):(r=l,0===Yt&&or(ee)),r!==l?(o=xr(),qt=e,e=Nt(o)):(Jt=e,e=l),e===l&&(r="",qt=e=Jt,e=r=Dt()),e}function Pr(){var e;return Yt++,W.test(t.charAt(Jt))?(e=t.charAt(Jt),Jt++):(e=l,0===Yt&&or(Ie)),Yt--,e===l&&(l,0===Yt&&or(Re)),e}function Kr(){var e,t;for(Yt++,e=[],t=Pr();t!==l;)e.push(t),t=Pr();return Yt--,t=l,0===Yt&&or(Oe),e}function Sr(){var e,r,o;for(Yt++,e=Jt,r=[],z.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=l,0===Yt&&or(Se));o!==l;)r.push(o),z.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=l,0===Yt&&or(Se));return(o=_r())!==l?e=r=[r,o]:(Jt=e,e=l),Yt--,e===l&&(r=l,0===Yt&&or(Ee)),e}function _r(){var e;return Yt++,10===t.charCodeAt(Jt)?(e=N,Jt++):(e=l,0===Yt&&or(je)),e===l&&(t.substr(Jt,2)===D?(e=D,Jt+=2):(e=l,0===Yt&&or(Ve)),e===l&&(13===t.charCodeAt(Jt)?(e=U,Jt++):(e=l,0===Yt&&or(Fe)),e===l&&(8232===t.charCodeAt(Jt)?(e=M,Jt++):(e=l,0===Yt&&or(Ge)),e===l&&(8233===t.charCodeAt(Jt)?(e=$,Jt++):(e=l,0===Yt&&or(Ne)))))),Yt--,e===l&&(l,0===Yt&&or(Le)),e}function Rr(){var e,r,o;for(Yt++,e=Jt,r=[],z.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=l,0===Yt&&or(Se));o!==l;)r.push(o),z.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=l,0===Yt&&or(Se));return(o=_r())!==l?e=r=[r,o]:(Jt=e,e=l),Yt--,e===l&&(r=l,0===Yt&&or(De)),e}function Ir(){var e;return Yt++,Y.test(t.charAt(Jt))?(e=t.charAt(Jt),Jt++):(e=l,0===Yt&&or(Me)),Yt--,e===l&&(l,0===Yt&&or(Ue)),e}function Or(){var e,r;return(e=Rr())===l&&(e=Jt,Yt++,t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re)),Yt--,r===l?e=void 0:(Jt=e,e=l)),e}function Er(){var e,r;return e=Jt,Yt++,t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re)),Yt--,r===l?e=void 0:(Jt=e,e=l),e}const Lr=new i.BitmarkPegParserHelper({parse:e,parserText:Xt,parserLocation:Vr}),jr=new n.BitmarkPegParserProcessor({parse:e,parserText:Xt,parserLocation:Vr});function Vr(){const e=rr(qt,Jt);return e?(delete e.source,e):e}function rr(e,t,r){var o=tr(e),i=tr(t),n={source:u,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return u&&"function"==typeof u.offset&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}if((a=p())!==l&&Jt===t.length)return a;throw a!==l&&Jt<t.length&&or({type:"end"}),ir(Wt,zt<t.length?t.charAt(zt):null,zt<t.length?rr(zt,zt+1):rr(zt,zt))}},4764:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=t.unbreakscape=void 0;const r=new RegExp(/=\^(\^*)(?==)|\*\^(\^*)(?=\*)|_\^(\^*)(?=_)|`\^(\^*)(?=`)|!\^(\^*)(?=!)|\[\^(\^*)|•\^(\^*)|#\^(\^*)|\|\^(\^*)|\|\^(\^*)/,"g");function o(e){let t=e||"";let o=r;return t=t.replace(o,(function(e,t,r,o,i){return e.replace("^","")})),t}function i(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):l(e,{startRule:"bitmarkPlusString"})}function n(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkMinusMinusString"}):l(e,{startRule:"bitmarkMinusMinusString"})}function s(e,t,r,o){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,s.prototype),i.expected=t,i.found=r,i.location=o,i.name="SyntaxError",i}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}function l(e,t){var r,a={},l=(t=void 0!==t?t:{}).grammarSource,u={bitmarkPlusPlus:Vo,bitmarkPlus:function(){var e,t;So++,e=ko,t=ni(),e,t=Yr(t),e=t,So--,t=a,0===So&&Lo(je);return e},bitmarkMinusMinus:function(){var e,t;So++,e=ko,t=di(),e,t=ho(t),e=t,So--,t=a,0===So&&Lo($t);return e},bitmarkPlusString:function(){var e;So++,e=ni(),So--,a,0===So&&Lo(st);return e},bitmarkMinusMinusString:di},c=Vo,p="|",g=":",d="### ",y="## ",f="# ",h="code",m="bitmark++",T="bitmark--",b="JavaScript",v="• ",C="•1 ",x="•+ ",A="•- ",w="\t",k="image",B=" ",P="#",K="@",S="width",_="height",R="=",I="𝑓",O="link:",E="var:",L="code:",j="color:",V="bold",F="italic",G="light",N="highlight",D="strike",U="sub",M="super",$="ins",J="del",q="aqua",H="black",z="blue",W="pink",Y="fuchsia",X="lightgrey",Z="gray",Q="darkgray",ee="green",te="lime",re="magenta",oe="maroon",ie="navy",ne="olive",se="orange",ae="purple",le="red",ue="silver",ce="teal",pe="violet",ge="white",de="yellow",ye="*",fe="_",he="`",me="!",Te="[!",be="]",ve="\n",Ce="\r\n",xe="\r",Ae="\u2028",we="\u2029",ke="http",Be="s",Pe="://",Ke="mailto:",Se="~",_e="^",Re="'",Ie=/^[ \t]/,Oe=/^[0-9]/,Ee=/^[^\n\r\u2028\u2029]/,Le=/^[a-zA-Z0-9!*'()=+-\/._?#@[\]$&(),;%:{}]/,je=Io("StyledText"),Ve=_o("|",!1),Fe=_o(":",!1),Ge=_o("### ",!1),Ne=_o("## ",!1),De=_o("# ",!1),Ue=_o("code",!1),Me=Ro([" ","\t"],!1,!1),$e=_o("bitmark++",!1),Je=_o("bitmark--",!1),qe=_o("JavaScript",!1),He=_o("• ",!1),ze=_o("•1 ",!1),We=_o("•+ ",!1),Ye=_o("•- ",!1),Xe={type:"any"},Ze=_o("\t",!1),Qe=_o("image",!1),et=_o(" ",!1),tt=_o("#",!1),rt=_o("@",!1),ot=Ro([["0","9"]],!1,!1),it=_o("width",!1),nt=_o("height",!1),st=Io("StyledString"),at=_o("=",!1),lt=_o("𝑓",!1),ut=_o("link:",!1),ct=_o("var:",!1),pt=_o("code:",!1),gt=_o("color:",!1),dt=_o("bold",!1),yt=_o("italic",!1),ft=_o("light",!1),ht=_o("highlight",!1),mt=_o("strike",!1),Tt=_o("sub",!1),bt=_o("super",!1),vt=_o("ins",!1),Ct=_o("del",!1),xt=_o("aqua",!1),At=_o("black",!1),wt=_o("blue",!1),kt=_o("pink",!1),Bt=_o("fuchsia",!1),Pt=_o("lightgrey",!1),Kt=_o("gray",!1),St=_o("darkgray",!1),_t=_o("green",!1),Rt=_o("lime",!1),It=_o("magenta",!1),Ot=_o("maroon",!1),Et=_o("navy",!1),Lt=_o("olive",!1),jt=_o("orange",!1),Vt=_o("purple",!1),Ft=_o("red",!1),Gt=_o("silver",!1),Nt=_o("teal",!1),Dt=_o("violet",!1),Ut=_o("white",!1),Mt=_o("yellow",!1),$t=Io("MinimalStyledText"),Jt=Io("MinimalStyledString"),qt=_o("*",!1),Ht=_o("_",!1),zt=_o("`",!1),Wt=_o("!",!1),Yt=_o("[!",!1),Xt=_o("]",!1),Zt=Io("Line Terminator"),Qt=_o("\n",!1),er=_o("\r\n",!1),tr=_o("\r",!1),rr=_o("\u2028",!1),or=_o("\u2029",!1),ir=(Io("whitespace in line"),Io("space"),Io("language tag separator"),Io("white space, separator"),Ro(["\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!1,!1),Ro(["\n","\r","\u2028","\u2029"],!1,!1),Ro(["\n","\r","\u2028","\u2029"],!0,!1)),nr=(Ro(["\n","\r","\u2028","\u2029","\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!0,!1),_o("http",!1)),sr=_o("s",!1),ar=_o("://",!1),lr=_o("mailto:",!1),ur=Ro([["a","z"],["A","Z"],["0","9"],"!","*","'","(",")","=",["+","/"],".","_","?","#","@","[","]","$","&","(",")",",",";","%",":","{","}"],!1,!1),cr=_o("~",!1),pr=_o("^",!1),gr=_o("'",!1),dr=function(e){return Object.assign({},e)},yr=function(e){return Object.assign({},e)},fr=function(e){return Object.assign({},e)},hr=function(e){return Object.assign({},e)},mr=function(e){return Object.assign({},e)},Tr=function(){return[]},br=function(e,t){return{type:"heading",content:n(t),attrs:{level:e.length-1}}},vr=function(e){return e},Cr=function(e,t){return Object.assign(Object.assign({},e),{content:t})},xr=function(){return{type:"codeBlock",language:""}},Ar=function(e){return{type:"codeBlock",attrs:{language:e.trim().toLowerCase()}}},wr=function(e){return[{type:"text",text:o(e.trim())}]},kr=function(e){return e},Br=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Pr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Kr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Sr=function(){return{type:"bulletList"}},_r=function(){return{type:"orderedList"}},Rr=function(){return{type:"taskList"}},Ir=function(e,t,r,o){return o},Or=function(e,t,r,o){let n="bulletList";"•1 "==e&&(n="orderedList"),"•+ "!=e&&"•- "!=e||(n="taskList");let s=[{type:"paragraph",attrs:{},content:i((t+r.join("")).trim())}];if(o&&o[0]&&o[0].parent){let e={type:o[0].parent,attrs:{start:1},content:o,parent:""};"orderedList"==e.parent&&(e.attrs.start=1),s.push(e)}let a="listItem",l={};if("taskList"==n){a="taskItem";let t=!1;"•+ "==e&&(t=!0),l={checked:t}}return{type:a,content:s,parent:n,attrs:l}},Er=function(e){return e},Lr=function(e){return e.join("")===Ii},jr=function(e){return e.length>Ii.length},Vr=function(e){Ri.push(Ii),Ii=e.join("")},Fr=function(){return Ii=Ri.pop(),!0},Gr=function(e){return{type:"paragraph",content:i(e.trim()),attrs:{}}},Nr=function(e){return{type:"paragraph",content:i(e.trim()),attrs:{}}},Dr=function(e){return{type:"paragraph",content:i(e.trim()),attrs:{}}},Ur=function(e){return e},Mr=function(e,t,r){const o=Object.assign({},...r);let i=o.captionAlign||"left";delete o.captionAlign;let n=o.alt||null;delete o.alt;let s=o.caption||null;delete o.caption;let a=o.align||"center";return delete o.align,{type:e,attrs:Object.assign({textAlign:i,src:t,alt:n,title:s,class:a},o)}},$r=function(e){return e},Jr=function(e){return{comment:e}},qr=function(e,t){return{[e]:parseInt(t)}},Hr=function(e,t){return{type:"error",msg:e+" must be an positive integer.",found:t}},zr=function(e,t){return{[e]:t}},Wr=function(e){return{[e]:!0}},Yr=function(e){return[{type:"paragraph",content:e,attrs:{}}]},Xr=function(e,t){return e?[e,...t.flat()]:t.flat()},Zr=function(){return{type:"hardBreak"}},Qr=function(e){return{text:o(e),type:"text"}},eo=function(e){return{index:+e,type:"bit"}},to=function(e,t){return t||(t=[]),{marks:t,text:o(e),type:"text"}},ro=function(e){return{marks:[{type:"bold"}],text:o(e),type:"text"}},oo=function(e){return{marks:[{type:"italic"}],text:o(e),type:"text"}},io=function(e){return{marks:[{type:"light"}],text:o(e),type:"text"}},no=function(e){return{marks:[{type:"highlight"}],text:o(e),type:"text"}},so=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}},ao=function(e){return e},lo=function(e){return{type:"link",attrs:{href:e.trim(),target:"_blank"}}},uo=function(e){return{type:"var",attrs:{name:e.trim()}}},co=function(){return{type:"code",attrs:{language:"plain text"}}},po=function(e){return{type:"code",attrs:{language:e.trim().toLowerCase()}}},go=function(e){return{type:"color",attrs:{color:e}}},yo=function(e){return{type:e}},fo=function(e){return{type:"comment",comment:e}},ho=function(e){return[{type:"paragraph",content:e,attrs:{}}]},mo=function(e,t){return e?[e,...t.flat()]:t.flat()},To=function(e){return{text:o(e),type:"text"}},bo=function(e){return{index:+e,type:"bit"}},vo=function(e){return{marks:[{type:"bold"}],text:o(e),type:"text"}},Co=function(e){return{marks:[{type:"italic"}],text:o(e),type:"text"}},xo=function(e){return{marks:[{type:"light"}],text:o(e),type:"text"}},Ao=function(e){return{marks:[{type:"highlight"}],text:o(e),type:"text"}},wo=function(e,t){return{pr:e,t}},ko=0,Bo=[{line:1,column:1}],Po=0,Ko=[],So=0;if("startRule"in t){if(!(t.startRule in u))throw new Error("Can't start parsing from rule \""+t.startRule+'".');c=u[t.startRule]}function _o(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ro(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Io(e){return{type:"other",description:e}}function Oo(t){var r,o=Bo[t];if(o)return o;for(r=t-1;!Bo[r];)r--;for(o={line:(o=Bo[r]).line,column:o.column};r<t;)10===e.charCodeAt(r)?(o.line++,o.column=1):o.column++,r++;return Bo[t]=o,o}function Eo(e,t,r){var o=Oo(e),i=Oo(t),n={source:l,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return r&&l&&"function"==typeof l.offset&&(n.start=l.offset(n.start),n.end=l.offset(n.end)),n}function Lo(e){ko<Po||(ko>Po&&(Po=ko,Ko=[]),Ko.push(e))}function jo(e,t,r){return new s(s.buildMessage(e,t),e,t,r)}function Vo(){var e,t;if(So++,e=[],(t=Fo())!==a)for(;t!==a;)e.push(t),t=Fo();else e=a;return e===a&&(e=function(){var e,t;return e=ko,t="",e,t=Tr(),e=t,e}()),So--,e===a&&(t=a,0===So&&Lo(je)),e}function Fo(){var t,r;return t=ko,r=function(){var t,r,o,i,n;if(t=ko,r=Do(),r!==a){for(o=ko,i=[],n=Ki();n!==a;)i.push(n),n=Ki();o=e.substring(o,ko),(i=Si())!==a?((n=Pi())===a&&(n=null),t,t=br(r,o)):(ko=t,t=a)}else ko=t,t=a;return t}(),r!==a&&(t,r=dr(r)),(t=r)===a&&(t=ko,r=function(){var e,t,r,o;if(e=ko,t=function(){var e,t,r;e=ko,t=ko,So++,r=Jo(),So--,r!==a?(ko=t,t=void 0):t=a;t!==a&&(e,t=Sr());return e=t,e}(),t!==a){if(r=[],(o=Wo())!==a)for(;o!==a;)r.push(o),o=Wo();else r=a;r!==a?((o=Pi())===a&&(o=null),e,e=Br(t,r)):(ko=e,e=a)}else ko=e,e=a;if(e===a){if(e=ko,t=function(){var e,t,r;e=ko,t=ko,So++,r=qo(),So--,r!==a?(ko=t,t=void 0):t=a;t!==a&&(e,t=_r());return e=t,e}(),t!==a){if(r=[],(o=Wo())!==a)for(;o!==a;)r.push(o),o=Wo();else r=a;r!==a?((o=Pi())===a&&(o=null),e,e=Pr(t,r)):(ko=e,e=a)}else ko=e,e=a;if(e===a)if(e=ko,t=function(){var e,t,r;e=ko,t=ko,So++,r=Ho(),So--,r!==a?(ko=t,t=void 0):t=a;t!==a&&(e,t=Rr());return e=t,e}(),t!==a){if(r=[],(o=Wo())!==a)for(;o!==a;)r.push(o),o=Wo();else r=a;r!==a?((o=Pi())===a&&(o=null),e,e=Kr(t,r)):(ko=e,e=a)}else ko=e,e=a}return e}(),r!==a&&(t,r=yr(r)),(t=r)===a&&(t=ko,(r=ri())!==a&&(t,r=fr(r)),(t=r)===a&&(t=ko,r=function(){var t,r,o;t=ko,r=Mo(),r!==a?(o=function(){var t,r,o,i;t=ko,r=ko,o=[],i=$o();for(;i!==a;)o.push(i),i=$o();return r=e.substring(r,ko),t,r=wr(r),t=r,t}(),t,t=Cr(r,o)):(ko=t,t=a);return t}(),r!==a&&(t,r=hr(r)),(t=r)===a&&(t=ko,r=function(){var e,t,r;e=ko,t=ko,So++,r=Go(),So--,r===a?t=void 0:(ko=t,t=a);t!==a&&(r=Zo())!==a?(e,e=Gr(r)):(ko=e,e=a);e===a&&(e=ko,(t=ei())!==a&&(r=Zo())!==a?(e,e=Nr(r)):(ko=e,e=a),e===a&&(e=ko,(t=ei())!==a?(e,e=Dr(r="")):(ko=e,e=a)));return e}(),r!==a&&(t,r=mr(r)),t=r)))),t}function Go(){var e;return(e=Do())===a&&(e=zo())===a&&(e=ri())===a&&(e=Mo())===a&&(e=ei()),e}function No(){var t;return 124===e.charCodeAt(ko)?(t=p,ko++):(t=a,0===So&&Lo(Ve)),t}function Do(){var t;return e.substr(ko,4)===d?(t=d,ko+=4):(t=a,0===So&&Lo(Ge)),t===a&&(e.substr(ko,3)===y?(t=y,ko+=3):(t=a,0===So&&Lo(Ne)),t===a&&(e.substr(ko,2)===f?(t=f,ko+=2):(t=a,0===So&&Lo(De)))),t}function Uo(){var t,r;return t=ko,No()!==a?(r=function(){var t;return e.substr(ko,4)===h?(t=h,ko+=4):(t=a,0===So&&Lo(Ue)),t}(),r!==a?(t,t=vr(r)):(ko=t,t=a)):(ko=t,t=a),t}function Mo(){var t,r,o,i,n,s,l;if(t=ko,Uo()!==a){for(r=ko,o=ko,i=[],Ie.test(e.charAt(ko))?(n=e.charAt(ko),ko++):(n=a,0===So&&Lo(Me));n!==a;)i.push(n),Ie.test(e.charAt(ko))?(n=e.charAt(ko),ko++):(n=a,0===So&&Lo(Me));(n=Si())!==a?o=i=[i,n]:(ko=o,o=a),(r=o!==a?e.substring(r,ko):o)!==a?(t,t=xr()):(ko=t,t=a)}else ko=t,t=a;if(t===a)if(t=ko,Uo()!==a)if(58===e.charCodeAt(ko)?(r=g,ko++):(r=a,0===So&&Lo(Fe)),r!==a)if(o=function(){var t,r,o;e.substr(ko,9)===m?(t=m,ko+=9):(t=a,0===So&&Lo($e));if(t===a&&(e.substr(ko,9)===T?(t=T,ko+=9):(t=a,0===So&&Lo(Je)),t===a&&(e.substr(ko,10)===b?(t=b,ko+=10):(t=a,0===So&&Lo(qe)),t===a))){if(t=ko,r=[],(o=Ki())!==a)for(;o!==a;)r.push(o),o=Ki();else r=a;(t=r!==a?e.substring(t,ko):r)===a&&(t="")}return t}(),o!==a){for(i=ko,n=ko,s=[],Ie.test(e.charAt(ko))?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Me));l!==a;)s.push(l),Ie.test(e.charAt(ko))?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Me));(l=Si())!==a?n=s=[s,l]:(ko=n,n=a),(i=n!==a?e.substring(i,ko):n)!==a?(t,t=Ar(o)):(ko=t,t=a)}else ko=t,t=a;else ko=t,t=a;else ko=t,t=a;return t}function $o(){var t,r,o,i,n,s;if(t=ko,r=ko,So++,o=Go(),So--,o===a?r=void 0:(ko=r,r=a),r!==a){if(o=ko,i=ko,n=[],(s=Ki())!==a)for(;s!==a;)n.push(s),s=Ki();else n=a;n!==a&&(s=Si())!==a?i=n=[n,s]:(ko=i,i=a),(o=i!==a?e.substring(o,ko):i)!==a?(t,t=kr(o)):(ko=t,t=a)}else ko=t,t=a;return t===a&&(t=Pi()),t}function Jo(){var t;return e.substr(ko,2)===v?(t=v,ko+=2):(t=a,0===So&&Lo(He)),t}function qo(){var t;return e.substr(ko,3)===C?(t=C,ko+=3):(t=a,0===So&&Lo(ze)),t}function Ho(){var t;return e.substr(ko,3)===x?(t=x,ko+=3):(t=a,0===So&&Lo(We)),t===a&&(e.substr(ko,3)===A?(t=A,ko+=3):(t=a,0===So&&Lo(Ye))),t}function zo(){var e;return(e=Jo())===a&&(e=qo())===a&&(e=Ho()),e}function Wo(){var t,r,o,i,n,s,l,u;if(t=ko,Xo()!==a)if((r=zo())!==a){for(o=ko,i=ko,n=[],s=ko,l=ko,So++,u=Pi(),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);s!==a;)n.push(s),s=ko,l=ko,So++,u=Pi(),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);for((s=Pi())===a&&(s=null),i=n=[n,s],o=e.substring(o,ko),i=[],n=Yo();n!==a;)i.push(n),n=Yo();if(n=ko,s=function(){var t,r,o,i;t=ko,So++,r=ko,o=[],9===e.charCodeAt(ko)?(i=w,ko++):(i=a,0===So&&Lo(Ze));if(i!==a)for(;i!==a;)o.push(i),9===e.charCodeAt(ko)?(i=w,ko++):(i=a,0===So&&Lo(Ze));else o=a;o!==a?(ko,(i=(i=jr(o))?void 0:a)!==a?(r,r=Vr(o)):(ko=r,r=a)):(ko=r,r=a);So--,r!==a?(ko=t,t=void 0):t=a;return t}(),s!==a){for(l=[],u=Wo();u!==a;)l.push(u),u=Wo();u=function(){var e;ko,e=Fr(),e=e?void 0:a;return e}(),u!==a?(n,n=Ir(r,o,i,l)):(ko=n,n=a)}else ko=n,n=a;n===a&&(n=null),t,t=Or(r,o,i,n)}else ko=t,t=a;else ko=t,t=a;return t}function Yo(){var t,r,o,i,n,s,l,u,c,p;if(t=ko,r=ko,So++,o=function(){var t,r,o;t=ko,r=[],Ie.test(e.charAt(ko))?(o=e.charAt(ko),ko++):(o=a,0===So&&Lo(Me));for(;o!==a;)r.push(o),Ie.test(e.charAt(ko))?(o=e.charAt(ko),ko++):(o=a,0===So&&Lo(Me));o=Pi(),o!==a?t=r=[r,o]:(ko=t,t=a);return t}(),So--,o===a?r=void 0:(ko=r,r=a),r!==a)if((o=Xo())!==a)if(i=ko,So++,n=zo(),So--,n===a?i=void 0:(ko=i,i=a),i!==a){if(n=ko,s=ko,l=[],u=ko,c=ko,So++,p=Pi(),So--,p===a?c=void 0:(ko=c,c=a),c!==a?(e.length>ko?(p=e.charAt(ko),ko++):(p=a,0===So&&Lo(Xe)),p!==a?u=c=[c,p]:(ko=u,u=a)):(ko=u,u=a),u!==a)for(;u!==a;)l.push(u),u=ko,c=ko,So++,p=Pi(),So--,p===a?c=void 0:(ko=c,c=a),c!==a?(e.length>ko?(p=e.charAt(ko),ko++):(p=a,0===So&&Lo(Xe)),p!==a?u=c=[c,p]:(ko=u,u=a)):(ko=u,u=a);else l=a;l!==a&&(u=Si())!==a?s=l=[l,u]:(ko=s,s=a),(n=s!==a?e.substring(n,ko):s)!==a?(t,t=Er(n)):(ko=t,t=a)}else ko=t,t=a;else ko=t,t=a;else ko=t,t=a;return t}function Xo(){var t,r,o;for(t=ko,r=[],9===e.charCodeAt(ko)?(o=w,ko++):(o=a,0===So&&Lo(Ze));o!==a;)r.push(o),9===e.charCodeAt(ko)?(o=w,ko++):(o=a,0===So&&Lo(Ze));return ko,(o=(o=Lr(r))?void 0:a)!==a?t=r=[r,o]:(ko=t,t=a),t}function Zo(){var t,r,o;if(t=ko,r=[],(o=Qo())!==a)for(;o!==a;)r.push(o),o=Qo();else r=a;return t=r!==a?e.substring(t,ko):r}function Qo(){var t,r,o,i,n,s;if(t=ko,r=ko,So++,o=Go(),So--,o===a?r=void 0:(ko=r,r=a),r!==a){if(o=ko,i=ko,n=[],(s=Ki())!==a)for(;s!==a;)n.push(s),s=Ki();else n=a;n!==a&&(s=Si())!==a?i=n=[n,s]:(ko=i,i=a),(o=i!==a?e.substring(o,ko):i)!==a?t=r=[r,o]:(ko=t,t=a)}else ko=t,t=a;return t===a&&(t=Pi()),t}function ei(){var t,r,o,i,n,s;if(t=ko,(r=No())!==a){for(o=ko,i=ko,n=[],Ie.test(e.charAt(ko))?(s=e.charAt(ko),ko++):(s=a,0===So&&Lo(Me));s!==a;)n.push(s),Ie.test(e.charAt(ko))?(s=e.charAt(ko),ko++):(s=a,0===So&&Lo(Me));(s=Si())!==a?i=n=[n,s]:(ko=i,i=a),(o=i!==a?e.substring(o,ko):i)!==a?((i=Pi())===a&&(i=null),t=r=[r,o,i]):(ko=t,t=a)}else ko=t,t=a;return t}function ti(){var t,r;return t=ko,No()!==a?(r=function(){var t;return e.substr(ko,5)===k?(t=k,ko+=5):(t=a,0===So&&Lo(Qe)),t}(),r!==a?(t,t=Ur(r)):(ko=t,t=a)):(ko=t,t=a),t}function ri(){var t,r,o,i,n,s,l,u,c,p;if(t=ko,(r=ti())!==a)if(58===e.charCodeAt(ko)?(o=g,ko++):(o=a,0===So&&Lo(Fe)),o!==a)if(32===e.charCodeAt(ko)?(i=B,ko++):(i=a,0===So&&Lo(et)),i===a&&(i=null),n=function(){var t,r,o,i,n,s,l,u,c;t=ko,r=ko,e.substr(ko,4)===ke?(o=ke,ko+=4):(o=a,0===So&&Lo(nr));if(o!==a)if(115===e.charCodeAt(ko)?(i=Be,ko++):(i=a,0===So&&Lo(sr)),i===a&&(i=null),e.substr(ko,3)===Pe?(n=Pe,ko+=3):(n=a,0===So&&Lo(ar)),n!==a){for(s=[],l=ko,u=ko,So++,c=No(),So--,c===a?u=void 0:(ko=u,u=a),u!==a&&(c=_i())!==a?l=u=[u,c]:(ko=l,l=a);l!==a;)s.push(l),l=ko,u=ko,So++,c=No(),So--,c===a?u=void 0:(ko=u,u=a),u!==a&&(c=_i())!==a?l=u=[u,c]:(ko=l,l=a);r=o=[o,i,n,s]}else ko=r,r=a;else ko=r,r=a;t=r!==a?e.substring(t,ko):r;return t}(),n!==a)if(No()!==a){for(s=function(){var e,t,r;e=ko,t=[],r=oi();for(;r!==a;)t.push(r),r=oi();return e,t=$r(t),e=t,e}(),l=ko,u=ko,c=[],Ie.test(e.charAt(ko))?(p=e.charAt(ko),ko++):(p=a,0===So&&Lo(Me));p!==a;)c.push(p),Ie.test(e.charAt(ko))?(p=e.charAt(ko),ko++):(p=a,0===So&&Lo(Me));(p=Si())!==a?u=c=[c,p]:(ko=u,u=a),(l=u!==a?e.substring(l,ko):u)!==a?((u=Pi())===a&&(u=null),t,t=Mr(r,n,s)):(ko=t,t=a)}else ko=t,t=a;else ko=t,t=a;else ko=t,t=a;else ko=t,t=a;return t}function oi(){var t,r,o,i,n,s,l,u,c,p;if(t=ko,35===e.charCodeAt(ko)?(r=P,ko++):(r=a,0===So&&Lo(tt)),r!==a){for(o=ko,i=[],n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);o=e.substring(o,ko),(i=No())!==a?(t,t=Jr(o)):(ko=t,t=a)}else ko=t,t=a;if(t===a){if(t=ko,64===e.charCodeAt(ko)?(r=K,ko++):(r=a,0===So&&Lo(rt)),r===a&&(r=null),(o=ii())!==a)if(58===e.charCodeAt(ko)?(i=g,ko++):(i=a,0===So&&Lo(Fe)),i!==a){for(n=[],32===e.charCodeAt(ko)?(s=B,ko++):(s=a,0===So&&Lo(et));s!==a;)n.push(s),32===e.charCodeAt(ko)?(s=B,ko++):(s=a,0===So&&Lo(et));if(s=ko,l=[],u=ko,c=ko,So++,p=No(),So--,p===a?c=void 0:(ko=c,c=a),c!==a?(Oe.test(e.charAt(ko))?(p=e.charAt(ko),ko++):(p=a,0===So&&Lo(ot)),p!==a?u=c=[c,p]:(ko=u,u=a)):(ko=u,u=a),u!==a)for(;u!==a;)l.push(u),u=ko,c=ko,So++,p=No(),So--,p===a?c=void 0:(ko=c,c=a),c!==a?(Oe.test(e.charAt(ko))?(p=e.charAt(ko),ko++):(p=a,0===So&&Lo(ot)),p!==a?u=c=[c,p]:(ko=u,u=a)):(ko=u,u=a);else l=a;(s=l!==a?e.substring(s,ko):l)!==a&&(l=No())!==a?(t,t=qr(o,s)):(ko=t,t=a)}else ko=t,t=a;else ko=t,t=a;if(t===a){if(t=ko,64===e.charCodeAt(ko)?(r=K,ko++):(r=a,0===So&&Lo(rt)),r===a&&(r=null),(o=ii())!==a)if(58===e.charCodeAt(ko)?(i=g,ko++):(i=a,0===So&&Lo(Fe)),i!==a){for(n=[],32===e.charCodeAt(ko)?(s=B,ko++):(s=a,0===So&&Lo(et));s!==a;)n.push(s),32===e.charCodeAt(ko)?(s=B,ko++):(s=a,0===So&&Lo(et));for(s=ko,l=[],u=ko,c=ko,So++,p=No(),So--,p===a?c=void 0:(ko=c,c=a),c!==a&&(p=Ki())!==a?u=c=[c,p]:(ko=u,u=a);u!==a;)l.push(u),u=ko,c=ko,So++,p=No(),So--,p===a?c=void 0:(ko=c,c=a),c!==a&&(p=Ki())!==a?u=c=[c,p]:(ko=u,u=a);s=e.substring(s,ko),(l=No())!==a?(t,t=Hr(o,s)):(ko=t,t=a)}else ko=t,t=a;else ko=t,t=a;if(t===a){for(t=ko,64===e.charCodeAt(ko)?(r=K,ko++):(r=a,0===So&&Lo(rt)),r===a&&(r=null),o=ko,i=[],n=ko,s=ko,So++,(l=No())===a&&(58===e.charCodeAt(ko)?(l=g,ko++):(l=a,0===So&&Lo(Fe))),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,(l=No())===a&&(58===e.charCodeAt(ko)?(l=g,ko++):(l=a,0===So&&Lo(Fe))),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);if(o=e.substring(o,ko),58===e.charCodeAt(ko)?(i=g,ko++):(i=a,0===So&&Lo(Fe)),i!==a){for(32===e.charCodeAt(ko)?(n=B,ko++):(n=a,0===So&&Lo(et)),n===a&&(n=null),s=ko,l=[],u=ko,c=ko,So++,p=No(),So--,p===a?c=void 0:(ko=c,c=a),c!==a&&(p=Ki())!==a?u=c=[c,p]:(ko=u,u=a);u!==a;)l.push(u),u=ko,c=ko,So++,p=No(),So--,p===a?c=void 0:(ko=c,c=a),c!==a&&(p=Ki())!==a?u=c=[c,p]:(ko=u,u=a);s=e.substring(s,ko),(l=No())!==a?(t,t=zr(o,s)):(ko=t,t=a)}else ko=t,t=a;if(t===a){for(t=ko,64===e.charCodeAt(ko)?(r=K,ko++):(r=a,0===So&&Lo(rt)),r===a&&(r=null),o=ko,i=[],n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);o=e.substring(o,ko),(i=No())!==a?(t,t=Wr(o)):(ko=t,t=a)}}}}return t}function ii(){var t;return e.substr(ko,5)===S?(t=S,ko+=5):(t=a,0===So&&Lo(it)),t===a&&(e.substr(ko,6)===_?(t=_,ko+=6):(t=a,0===So&&Lo(nt))),t}function ni(){var e,t,r,o;for(e=ko,(t=si())===a&&(t=null),r=[],(o=ci())===a&&(o=si());o!==a;)r.push(o),(o=ci())===a&&(o=si());return e,e=Xr(t,r)}function si(){var t,r,o,i,n,s,l;if(t=ko,(r=Pi())!==a&&(t,r=Zr()),(t=r)===a){if(t=ko,r=ko,o=[],i=ko,(n=pi())===a&&(n=null),s=ko,So++,l=ci(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?i=n=[n,s,l]:(ko=i,i=a),i===a&&(i=ko,(n=pi())!==a?(s=ko,So++,l=ci(),So--,l===a?s=void 0:(ko=s,s=a),s!==a?i=n=[n,s]:(ko=i,i=a)):(ko=i,i=a)),i!==a)for(;i!==a;)o.push(i),i=ko,(n=pi())===a&&(n=null),s=ko,So++,l=ci(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?i=n=[n,s,l]:(ko=i,i=a),i===a&&(i=ko,(n=pi())!==a?(s=ko,So++,l=ci(),So--,l===a?s=void 0:(ko=s,s=a),s!==a?i=n=[n,s]:(ko=i,i=a)):(ko=i,i=a));else o=a;(r=o!==a?e.substring(r,ko):o)!==a&&(t,r=Qr(r)),t=r}return t}function ai(){var t;return 61===e.charCodeAt(ko)?(t=R,ko++):(t=a,0===So&&Lo(at)),t}function li(){var t;return e.substr(ko,2)===I?(t=I,ko+=2):(t=a,0===So&&Lo(lt)),t}function ui(){var e,t,r;return e=ko,(t=ai())!==a&&(r=ai())!==a?e=t=[t,r]:(ko=e,e=a),e}function ci(){var t,r,o,i,n,s,l,u,c,g;if(t=ko,(r=Ai())!==a){if(o=ko,i=[],Oe.test(e.charAt(ko))?(n=e.charAt(ko),ko++):(n=a,0===So&&Lo(ot)),n!==a)for(;n!==a;)i.push(n),Oe.test(e.charAt(ko))?(n=e.charAt(ko),ko++):(n=a,0===So&&Lo(ot));else i=a;(o=i!==a?e.substring(o,ko):i)!==a&&(i=wi())!==a?(t,t=eo(o)):(ko=t,t=a)}else ko=t,t=a;if(t===a){if(t=ko,(r=ui())!==a){for(32===e.charCodeAt(ko)?(o=B,ko++):(o=a,0===So&&Lo(et)),o===a&&(o=null),i=ko,n=[],s=ko,l=ko,So++,u=ko,32===e.charCodeAt(ko)?(c=B,ko++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=ui())!==a?u=c=[c,g]:(ko=u,u=a),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);s!==a;)n.push(s),s=ko,l=ko,So++,u=ko,32===e.charCodeAt(ko)?(c=B,ko++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=ui())!==a?u=c=[c,g]:(ko=u,u=a),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);i=e.substring(i,ko),32===e.charCodeAt(ko)?(n=B,ko++):(n=a,0===So&&Lo(et)),n===a&&(n=null),(s=ui())!==a?(l=function(){var t,r,o,i;t=ko,124===e.charCodeAt(ko)?(r=p,ko++):(r=a,0===So&&Lo(Ve));if(r!==a){for(o=[],i=gi();i!==a;)o.push(i),i=gi();t,t=ao(o)}else ko=t,t=a;return t}(),l===a&&(l=null),t,t=to(i,l)):(ko=t,t=a)}else ko=t,t=a;if(t===a){if(t=ko,(r=bi())!==a){for(32===e.charCodeAt(ko)?(o=B,ko++):(o=a,0===So&&Lo(et)),o===a&&(o=null),i=ko,n=[],s=ko,l=ko,So++,u=ko,32===e.charCodeAt(ko)?(c=B,ko++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=bi())!==a?u=c=[c,g]:(ko=u,u=a),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);s!==a;)n.push(s),s=ko,l=ko,So++,u=ko,32===e.charCodeAt(ko)?(c=B,ko++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=bi())!==a?u=c=[c,g]:(ko=u,u=a),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);i=e.substring(i,ko),32===e.charCodeAt(ko)?(n=B,ko++):(n=a,0===So&&Lo(et)),n===a&&(n=null),(s=bi())!==a?(t,t=ro(i)):(ko=t,t=a)}else ko=t,t=a;if(t===a){if(t=ko,(r=vi())!==a){for(32===e.charCodeAt(ko)?(o=B,ko++):(o=a,0===So&&Lo(et)),o===a&&(o=null),i=ko,n=[],s=ko,l=ko,So++,u=ko,32===e.charCodeAt(ko)?(c=B,ko++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=vi())!==a?u=c=[c,g]:(ko=u,u=a),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);s!==a;)n.push(s),s=ko,l=ko,So++,u=ko,32===e.charCodeAt(ko)?(c=B,ko++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=vi())!==a?u=c=[c,g]:(ko=u,u=a),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);i=e.substring(i,ko),32===e.charCodeAt(ko)?(n=B,ko++):(n=a,0===So&&Lo(et)),n===a&&(n=null),(s=vi())!==a?(t,t=oo(i)):(ko=t,t=a)}else ko=t,t=a;if(t===a){if(t=ko,(r=Ci())!==a){for(32===e.charCodeAt(ko)?(o=B,ko++):(o=a,0===So&&Lo(et)),o===a&&(o=null),i=ko,n=[],s=ko,l=ko,So++,u=ko,32===e.charCodeAt(ko)?(c=B,ko++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=Ci())!==a?u=c=[c,g]:(ko=u,u=a),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);s!==a;)n.push(s),s=ko,l=ko,So++,u=ko,32===e.charCodeAt(ko)?(c=B,ko++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=Ci())!==a?u=c=[c,g]:(ko=u,u=a),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);i=e.substring(i,ko),32===e.charCodeAt(ko)?(n=B,ko++):(n=a,0===So&&Lo(et)),n===a&&(n=null),(s=Ci())!==a?(t,t=io(i)):(ko=t,t=a)}else ko=t,t=a;if(t===a){if(t=ko,(r=xi())!==a){for(32===e.charCodeAt(ko)?(o=B,ko++):(o=a,0===So&&Lo(et)),o===a&&(o=null),i=ko,n=[],s=ko,l=ko,So++,u=ko,32===e.charCodeAt(ko)?(c=B,ko++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=xi())!==a?u=c=[c,g]:(ko=u,u=a),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);s!==a;)n.push(s),s=ko,l=ko,So++,u=ko,32===e.charCodeAt(ko)?(c=B,ko++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=xi())!==a?u=c=[c,g]:(ko=u,u=a),So--,u===a?l=void 0:(ko=l,l=a),l!==a?(e.length>ko?(u=e.charAt(ko),ko++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(ko=s,s=a)):(ko=s,s=a);i=e.substring(i,ko),32===e.charCodeAt(ko)?(n=B,ko++):(n=a,0===So&&Lo(et)),n===a&&(n=null),(s=xi())!==a?(t,t=no(i)):(ko=t,t=a)}else ko=t,t=a;t===a&&(t=ko,r=function(){var t,r,o,i,n,s,l;t=ko,r=ko,o=ko,e.substr(ko,4)===ke?(i=ke,ko+=4):(i=a,0===So&&Lo(nr));i!==a?(115===e.charCodeAt(ko)?(n=Be,ko++):(n=a,0===So&&Lo(sr)),n===a&&(n=null),e.substr(ko,3)===Pe?(s=Pe,ko+=3):(s=a,0===So&&Lo(ar)),s!==a?o=i=[i,n,s]:(ko=o,o=a)):(ko=o,o=a);o===a&&(e.substr(ko,7)===Ke?(o=Ke,ko+=7):(o=a,0===So&&Lo(lr)));r=o!==a?e.substring(r,ko):o;if(r!==a){for(o=ko,i=[],n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=_i())!==a?n=s=[s,l]:(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=_i())!==a?n=s=[s,l]:(ko=n,n=a);o=e.substring(o,ko),t,t=wo(r,o)}else ko=t,t=a;return t}(),r!==a&&(t,r=so(r)),t=r)}}}}}return t}function pi(){var t,r,o,i,n;if(t=ko,r=ko,(o=ui())!==a){if(i=[],(n=ai())!==a)for(;n!==a;)i.push(n),n=ai();else i=a;i!==a?r=o=[o,i]:(ko=r,r=a)}else ko=r,r=a;if((t=r!==a?e.substring(t,ko):r)===a){if(t=ko,r=ko,o=function(){var e,t,r;return e=ko,(t=li())!==a&&(r=li())!==a?e=t=[t,r]:(ko=e,e=a),e}(),o!==a){if(i=[],(n=li())!==a)for(;n!==a;)i.push(n),n=li();else i=a;i!==a?r=o=[o,i]:(ko=r,r=a)}else ko=r,r=a;if((t=r!==a?e.substring(t,ko):r)===a){if(t=ko,r=ko,(o=Ci())!==a){if(i=[],(n=mi())!==a)for(;n!==a;)i.push(n),n=mi();else i=a;i!==a?r=o=[o,i]:(ko=r,r=a)}else ko=r,r=a;if((t=r!==a?e.substring(t,ko):r)===a){if(t=ko,r=ko,(o=xi())!==a){if(i=[],(n=Ti())!==a)for(;n!==a;)i.push(n),n=Ti();else i=a;i!==a?r=o=[o,i]:(ko=r,r=a)}else ko=r,r=a;t=r!==a?e.substring(t,ko):r}}}return t}function gi(){var t,r,o,i,n,s,l;if(t=ko,e.substr(ko,5)===O?(r=O,ko+=5):(r=a,0===So&&Lo(ut)),r!==a){for(o=ko,i=[],n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);o=e.substring(o,ko),(i=No())!==a?(t,t=lo(o)):(ko=t,t=a)}else ko=t,t=a;if(t===a){if(t=ko,e.substr(ko,4)===E?(r=E,ko+=4):(r=a,0===So&&Lo(ct)),r!==a){for(o=ko,i=[],n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);o=e.substring(o,ko),(i=No())!==a?(t,t=uo(o)):(ko=t,t=a)}else ko=t,t=a;if(t===a&&(t=ko,e.substr(ko,4)===h?(r=h,ko+=4):(r=a,0===So&&Lo(Ue)),r!==a&&(o=No())!==a?(t,t=co()):(ko=t,t=a),t===a)){if(t=ko,e.substr(ko,5)===L?(r=L,ko+=5):(r=a,0===So&&Lo(pt)),r!==a){for(o=ko,i=[],n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);o=e.substring(o,ko),(i=No())!==a?(t,t=po(o)):(ko=t,t=a)}else ko=t,t=a;if(t===a&&(t=ko,e.substr(ko,6)===j?(r=j,ko+=6):(r=a,0===So&&Lo(gt)),r!==a?(o=function(){var t;e.substr(ko,4)===q?(t=q,ko+=4):(t=a,0===So&&Lo(xt));t===a&&(e.substr(ko,5)===H?(t=H,ko+=5):(t=a,0===So&&Lo(At)),t===a&&(e.substr(ko,4)===z?(t=z,ko+=4):(t=a,0===So&&Lo(wt)),t===a&&(e.substr(ko,4)===W?(t=W,ko+=4):(t=a,0===So&&Lo(kt)),t===a&&(e.substr(ko,7)===Y?(t=Y,ko+=7):(t=a,0===So&&Lo(Bt)),t===a&&(e.substr(ko,9)===X?(t=X,ko+=9):(t=a,0===So&&Lo(Pt)),t===a&&(e.substr(ko,4)===Z?(t=Z,ko+=4):(t=a,0===So&&Lo(Kt)),t===a&&(e.substr(ko,8)===Q?(t=Q,ko+=8):(t=a,0===So&&Lo(St)),t===a&&(e.substr(ko,5)===ee?(t=ee,ko+=5):(t=a,0===So&&Lo(_t)),t===a&&(e.substr(ko,4)===te?(t=te,ko+=4):(t=a,0===So&&Lo(Rt)),t===a&&(e.substr(ko,7)===re?(t=re,ko+=7):(t=a,0===So&&Lo(It)),t===a&&(e.substr(ko,6)===oe?(t=oe,ko+=6):(t=a,0===So&&Lo(Ot)),t===a&&(e.substr(ko,4)===ie?(t=ie,ko+=4):(t=a,0===So&&Lo(Et)),t===a&&(e.substr(ko,5)===ne?(t=ne,ko+=5):(t=a,0===So&&Lo(Lt)),t===a&&(e.substr(ko,6)===se?(t=se,ko+=6):(t=a,0===So&&Lo(jt)),t===a&&(e.substr(ko,6)===ae?(t=ae,ko+=6):(t=a,0===So&&Lo(Vt)),t===a&&(e.substr(ko,3)===le?(t=le,ko+=3):(t=a,0===So&&Lo(Ft)),t===a&&(e.substr(ko,6)===ue?(t=ue,ko+=6):(t=a,0===So&&Lo(Gt)),t===a&&(e.substr(ko,4)===ce?(t=ce,ko+=4):(t=a,0===So&&Lo(Nt)),t===a&&(e.substr(ko,6)===pe?(t=pe,ko+=6):(t=a,0===So&&Lo(Dt)),t===a&&(e.substr(ko,5)===ge?(t=ge,ko+=5):(t=a,0===So&&Lo(Ut)),t===a&&(e.substr(ko,6)===de?(t=de,ko+=6):(t=a,0===So&&Lo(Mt)))))))))))))))))))))));return t}(),o!==a&&(i=No())!==a?(t,t=go(o)):(ko=t,t=a)):(ko=t,t=a),t===a&&(t=ko,r=function(){var t;e.substr(ko,4)===V?(t=V,ko+=4):(t=a,0===So&&Lo(dt));t===a&&(e.substr(ko,6)===F?(t=F,ko+=6):(t=a,0===So&&Lo(yt)),t===a&&(e.substr(ko,5)===G?(t=G,ko+=5):(t=a,0===So&&Lo(ft)),t===a&&(e.substr(ko,9)===N?(t=N,ko+=9):(t=a,0===So&&Lo(ht)),t===a&&(e.substr(ko,6)===D?(t=D,ko+=6):(t=a,0===So&&Lo(mt)),t===a&&(e.substr(ko,3)===U?(t=U,ko+=3):(t=a,0===So&&Lo(Tt)),t===a&&(e.substr(ko,5)===M?(t=M,ko+=5):(t=a,0===So&&Lo(bt)),t===a&&(e.substr(ko,3)===$?(t=$,ko+=3):(t=a,0===So&&Lo(vt)),t===a&&(e.substr(ko,3)===J?(t=J,ko+=3):(t=a,0===So&&Lo(Ct))))))))));return t}(),r!==a&&(o=No())!==a?(t,t=yo(r)):(ko=t,t=a),t===a)))if(t=ko,35===e.charCodeAt(ko)?(r=P,ko++):(r=a,0===So&&Lo(tt)),r!==a){for(o=ko,i=[],n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,l=No(),So--,l===a?s=void 0:(ko=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(ko=n,n=a);o=e.substring(o,ko),(i=No())!==a?(t,t=fo(o)):(ko=t,t=a)}else ko=t,t=a}}return t}function di(){var e,t,r,o;for(So++,e=ko,(t=yi())===a&&(t=null),r=[],(o=ki())===a&&(o=yi());o!==a;)r.push(o),(o=ki())===a&&(o=yi());return e,e=mo(t,r),So--,t=a,0===So&&Lo(Jt),e}function yi(){var t,r,o,i,n,s,l;if(t=ko,r=ko,o=[],i=ko,(n=Bi())===a&&(n=null),s=ko,So++,l=ki(),So--,l===a?s=void 0:(ko=s,s=a),s!==a?(e.length>ko?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Xe)),l!==a?i=n=[n,s,l]:(ko=i,i=a)):(ko=i,i=a),i!==a)for(;i!==a;)o.push(i),i=ko,(n=Bi())===a&&(n=null),s=ko,So++,l=ki(),So--,l===a?s=void 0:(ko=s,s=a),s!==a?(e.length>ko?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Xe)),l!==a?i=n=[n,s,l]:(ko=i,i=a)):(ko=i,i=a);else o=a;return(r=o!==a?e.substring(r,ko):o)!==a&&(t,r=To(r)),(t=r)===a&&(t=Pi()),t}function fi(){var t;return 42===e.charCodeAt(ko)?(t=ye,ko++):(t=a,0===So&&Lo(qt)),t}function hi(){var t;return 95===e.charCodeAt(ko)?(t=fe,ko++):(t=a,0===So&&Lo(Ht)),t}function mi(){var t;return 96===e.charCodeAt(ko)?(t=he,ko++):(t=a,0===So&&Lo(zt)),t}function Ti(){var t;return 33===e.charCodeAt(ko)?(t=me,ko++):(t=a,0===So&&Lo(Wt)),t}function bi(){var e,t,r;return e=ko,(t=fi())!==a&&(r=fi())!==a?e=t=[t,r]:(ko=e,e=a),e}function vi(){var e,t,r;return e=ko,(t=hi())!==a&&(r=hi())!==a?e=t=[t,r]:(ko=e,e=a),e}function Ci(){var e,t,r;return e=ko,(t=mi())!==a&&(r=mi())!==a?e=t=[t,r]:(ko=e,e=a),e}function xi(){var e,t,r;return e=ko,(t=Ti())!==a&&(r=Ti())!==a?e=t=[t,r]:(ko=e,e=a),e}function Ai(){var t;return e.substr(ko,2)===Te?(t=Te,ko+=2):(t=a,0===So&&Lo(Yt)),t}function wi(){var t;return 93===e.charCodeAt(ko)?(t=be,ko++):(t=a,0===So&&Lo(Xt)),t}function ki(){var t,r,o,i,n,s,l,u,c;if(t=ko,Ai()!==a){if(r=ko,o=[],Oe.test(e.charAt(ko))?(i=e.charAt(ko),ko++):(i=a,0===So&&Lo(ot)),i!==a)for(;i!==a;)o.push(i),Oe.test(e.charAt(ko))?(i=e.charAt(ko),ko++):(i=a,0===So&&Lo(ot));else o=a;(r=o!==a?e.substring(r,ko):o)!==a&&(o=wi())!==a?(t,t=bo(r)):(ko=t,t=a)}else ko=t,t=a;if(t===a){if(t=ko,bi()!==a){for(32===e.charCodeAt(ko)?(r=B,ko++):(r=a,0===So&&Lo(et)),r===a&&(r=null),o=ko,i=[],n=ko,s=ko,So++,l=ko,32===e.charCodeAt(ko)?(u=B,ko++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=bi())!==a?l=u=[u,c]:(ko=l,l=a),So--,l===a?s=void 0:(ko=s,s=a),s!==a?(e.length>ko?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(ko=n,n=a)):(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,l=ko,32===e.charCodeAt(ko)?(u=B,ko++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=bi())!==a?l=u=[u,c]:(ko=l,l=a),So--,l===a?s=void 0:(ko=s,s=a),s!==a?(e.length>ko?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(ko=n,n=a)):(ko=n,n=a);o=e.substring(o,ko),32===e.charCodeAt(ko)?(i=B,ko++):(i=a,0===So&&Lo(et)),i===a&&(i=null),(n=bi())!==a?(t,t=vo(o)):(ko=t,t=a)}else ko=t,t=a;if(t===a){if(t=ko,vi()!==a){for(32===e.charCodeAt(ko)?(r=B,ko++):(r=a,0===So&&Lo(et)),r===a&&(r=null),o=ko,i=[],n=ko,s=ko,So++,l=ko,32===e.charCodeAt(ko)?(u=B,ko++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=vi())!==a?l=u=[u,c]:(ko=l,l=a),So--,l===a?s=void 0:(ko=s,s=a),s!==a?(e.length>ko?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(ko=n,n=a)):(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,l=ko,32===e.charCodeAt(ko)?(u=B,ko++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=vi())!==a?l=u=[u,c]:(ko=l,l=a),So--,l===a?s=void 0:(ko=s,s=a),s!==a?(e.length>ko?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(ko=n,n=a)):(ko=n,n=a);o=e.substring(o,ko),32===e.charCodeAt(ko)?(i=B,ko++):(i=a,0===So&&Lo(et)),i===a&&(i=null),(n=vi())!==a?(t,t=Co(o)):(ko=t,t=a)}else ko=t,t=a;if(t===a){if(t=ko,Ci()!==a){for(32===e.charCodeAt(ko)?(r=B,ko++):(r=a,0===So&&Lo(et)),r===a&&(r=null),o=ko,i=[],n=ko,s=ko,So++,l=ko,32===e.charCodeAt(ko)?(u=B,ko++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=Ci())!==a?l=u=[u,c]:(ko=l,l=a),So--,l===a?s=void 0:(ko=s,s=a),s!==a?(e.length>ko?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(ko=n,n=a)):(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,l=ko,32===e.charCodeAt(ko)?(u=B,ko++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=Ci())!==a?l=u=[u,c]:(ko=l,l=a),So--,l===a?s=void 0:(ko=s,s=a),s!==a?(e.length>ko?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(ko=n,n=a)):(ko=n,n=a);o=e.substring(o,ko),32===e.charCodeAt(ko)?(i=B,ko++):(i=a,0===So&&Lo(et)),i===a&&(i=null),(n=Ci())!==a?(t,t=xo(o)):(ko=t,t=a)}else ko=t,t=a;if(t===a)if(t=ko,xi()!==a){for(32===e.charCodeAt(ko)?(r=B,ko++):(r=a,0===So&&Lo(et)),r===a&&(r=null),o=ko,i=[],n=ko,s=ko,So++,l=ko,32===e.charCodeAt(ko)?(u=B,ko++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=xi())!==a?l=u=[u,c]:(ko=l,l=a),So--,l===a?s=void 0:(ko=s,s=a),s!==a?(e.length>ko?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(ko=n,n=a)):(ko=n,n=a);n!==a;)i.push(n),n=ko,s=ko,So++,l=ko,32===e.charCodeAt(ko)?(u=B,ko++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=xi())!==a?l=u=[u,c]:(ko=l,l=a),So--,l===a?s=void 0:(ko=s,s=a),s!==a?(e.length>ko?(l=e.charAt(ko),ko++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(ko=n,n=a)):(ko=n,n=a);o=e.substring(o,ko),32===e.charCodeAt(ko)?(i=B,ko++):(i=a,0===So&&Lo(et)),i===a&&(i=null),(n=xi())!==a?(t,t=Ao(o)):(ko=t,t=a)}else ko=t,t=a}}}return t}function Bi(){var t,r,o,i,n;if(t=ko,r=ko,(o=bi())!==a){if(i=[],(n=fi())!==a)for(;n!==a;)i.push(n),n=fi();else i=a;i!==a?r=o=[o,i]:(ko=r,r=a)}else ko=r,r=a;if((t=r!==a?e.substring(t,ko):r)===a){if(t=ko,r=ko,(o=vi())!==a){if(i=[],(n=hi())!==a)for(;n!==a;)i.push(n),n=hi();else i=a;i!==a?r=o=[o,i]:(ko=r,r=a)}else ko=r,r=a;if((t=r!==a?e.substring(t,ko):r)===a){if(t=ko,r=ko,(o=Ci())!==a){if(i=[],(n=mi())!==a)for(;n!==a;)i.push(n),n=mi();else i=a;i!==a?r=o=[o,i]:(ko=r,r=a)}else ko=r,r=a;if((t=r!==a?e.substring(t,ko):r)===a){if(t=ko,r=ko,(o=xi())!==a){if(i=[],(n=Ti())!==a)for(;n!==a;)i.push(n),n=Ti();else i=a;i!==a?r=o=[o,i]:(ko=r,r=a)}else ko=r,r=a;t=r!==a?e.substring(t,ko):r}}}return t}function Pi(){var t;return So++,10===e.charCodeAt(ko)?(t=ve,ko++):(t=a,0===So&&Lo(Qt)),t===a&&(e.substr(ko,2)===Ce?(t=Ce,ko+=2):(t=a,0===So&&Lo(er)),t===a&&(13===e.charCodeAt(ko)?(t=xe,ko++):(t=a,0===So&&Lo(tr)),t===a&&(8232===e.charCodeAt(ko)?(t=Ae,ko++):(t=a,0===So&&Lo(rr)),t===a&&(8233===e.charCodeAt(ko)?(t=we,ko++):(t=a,0===So&&Lo(or)))))),So--,t===a&&(a,0===So&&Lo(Zt)),t}function Ki(){var t;return Ee.test(e.charAt(ko))?(t=e.charAt(ko),ko++):(t=a,0===So&&Lo(ir)),t}function Si(){var t,r;return(t=Pi())===a&&(t=ko,So++,e.length>ko?(r=e.charAt(ko),ko++):(r=a,0===So&&Lo(Xe)),So--,r===a?t=void 0:(ko=t,t=a)),t}function _i(){var t;return Le.test(e.charAt(ko))?(t=e.charAt(ko),ko++):(t=a,0===So&&Lo(ur)),t===a&&(126===e.charCodeAt(ko)?(t=Se,ko++):(t=a,0===So&&Lo(cr)),t===a&&(94===e.charCodeAt(ko)?(t=_e,ko++):(t=a,0===So&&Lo(pr)),t===a&&(39===e.charCodeAt(ko)?(t=Re,ko++):(t=a,0===So&&Lo(gr))))),t}var Ri=[],Ii="";if(e=e.trimStart(),(r=c())!==a&&ko===e.length)return r;throw r!==a&&ko<e.length&&Lo({type:"end"}),jo(Ko,Po<e.length?e.charAt(Po):null,Po<e.length?Eo(Po,Po+1):Eo(Po,Po))}t.unbreakscape=o,t.SyntaxError=s,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(s,Error),s.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,o=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){o=e[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,s=this.location.source+":"+n.line+":"+n.column;if(o){var l=this.location.end,u=a("",n.line.toString().length," "),c=o[i.line-1],p=(i.line===l.line?l.column:c.length+1)-i.column||1;t+="\n --\x3e "+s+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+a("",i.column-1," ")+a("",p,"^")}else t+="\n at "+s}return t},s.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function o(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function s(e){return r[e.type](e)}return"Expected "+function(e){var t,r,o=e.map(s);if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},t.parse=l},297:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkGenerator=void 0;const i=r(8256),n=r(2606),s=r(549),a=r(208),l=r(8791),u=r(1060),c=r(8565),p=r(7204),g=r(7953),d=r(9779),y=r(1353),f=r(672),h={debugGenerationInline:!1};t.BitmarkGenerator=class{constructor(e,t){var r;this.ast=new i.Ast,this.skipNLBetweenBitsValue=!1,this.printed=!1,this.bitmarkVersion=null!==(r=l.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:l.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},h),null==t?void 0:t.bitmarkOptions),this.bitmarkVersion===l.BitmarkVersion.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.CardSetVersion.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.CardSetVersion.v2),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return o(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.writeLine(),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.skipNLBetweenBitsValue=!1,this.printed=!1}walkAndWrite(e){this.ast.walk(e,s.NodeType.bitmarkAst,this,void 0),this.writeLine()}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const s=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof s[a]&&(n=s[a](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}between_bits(e,t,r,o,i){this.writeNL(),this.writeNL(),this.writeNL()}enter_bitsValue(e,t,r){const o=e.value,i=n.Config.getBitConfig(o.bitType),s=n.Config.getBitResourcesConfig(o.bitType,o.resourceType);if(this.writeOPD(),this.writeString(o.bitType.alias),o.textFormat){this.isWriteTextFormat(o.textFormat)&&(this.writeColon(),this.writeString(o.textFormat))}let a;if(i.resourceAttachmentAllowed&&o.resources&&o.resources.length>0){const e=s.comboResourceTagTypesMap;if(s.comboResourceTagTypesMap.size>0)for(const t of e.keys())a=t;else a=o.resources[0].type}a&&(this.writeAmpersand(),this.writeString(a)),this.writeCL(),this.writeNL()}between_bitsValue(e,t,r,o,i){const n=[s.NodeType.bitType,s.NodeType.textFormat,s.NodeType.level,s.NodeType.progress,s.NodeType.toc,s.NodeType.referenceEnd,s.NodeType.labelFalse];e.value.book&&n.push(s.NodeType.reference);(()=>{if(this.skipNLBetweenBitsValue)return this.skipNLBetweenBitsValue=!1,!0;for(const e of n)if(t.key===e)return!0;return!1})()||this.writeNL()}enter_labelTrue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const i=null==t?void 0:t.value;i&&(""!=o&&this.writeProperty(g.PropertyTag.labelTrue,o,!0),i.labelFalse&&""!=i.labelFalse[0]&&this.writeProperty(g.PropertyTag.labelFalse,i.labelFalse,!0))}enter_imageSource(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const{url:i,mockupId:n,size:a,format:l,trim:u}=o;this.writeProperty("imageSource",i,!0),i&&(n&&this.writeProperty("mockupId",n,!0),a&&this.writeProperty("size",a,!0),l&&this.writeProperty("format",l,!0),f.BooleanUtils.isBoolean(u)&&this.writeProperty("trim",u,!0))}enter_partner(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const{name:i,avatarImage:n}=o;this.writeProperty("partner",i,!0),n&&this.writeResource(n)}enter_markConfigValue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==s.NodeType.markConfig)return;const{mark:i,color:n,emphasis:a}=o;i&&(this.writeProperty("mark",i,!0),n&&this.writeProperty("color",n,!0),a&&this.writeProperty("emphasis",a,!0),this.writeNL())}leaf_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}leaf_reasonableNumOfChars(e,t,r){this.writeProperty("reasonableNumOfChars",e.value)}enter_itemLead(e,t,r){const o=e.value;o&&(o.item||o.lead)&&(this.writeOPC(),this.writeString(o.item||""),this.writeCL(),o.lead&&(this.writeOPC(),this.writeString(o.lead),this.writeCL()))}enter_body(e,t,r){e.value.bodyParts.length>0&&this.writeNL()}enter_solutions(e,t,r){const o=e.value;o&&0===o.length&&(this.writeOPU(),this.writeCL())}leaf_solution(e,t,r){var o;const i=e.value,n=null===(o=this.getParentNode(r,2))||void 0===o?void 0:o.value;(null==n?void 0:n.type)===u.BodyBitType.mark&&i&&(this.writeOPE(),this.writeString(i),this.writeCL())}leaf_mark(e,t,r){var o;const i=e.value,n=null===(o=this.getParentNode(r,2))||void 0===o?void 0:o.value;(null==n?void 0:n.type)===u.BodyBitType.mark&&i&&this.writeProperty("mark",i,!0)}enter_optionsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_textsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeCardSetStart(),this.writeNL())}between_cardNode(e,t,r,o,i){this.isRootBitType1(i)||(this.writeNL(),this.writeCardSetCardDivider(),this.writeNL())}exit_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeNL(),this.writeCardSetEnd())}enter_elements(e,t,r){}between_elements(e,t,r,o,i){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}exit_elements(e,t,r){}between_flashcards(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}between_flashcardsValue(e,t,r,o,i){r.key===s.NodeType.answer?(this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()):r.key===s.NodeType.alternativeAnswers&&(this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL())}leaf_answer(e,t,r){(null==t?void 0:t.key)===s.NodeType.flashcardsValue&&e.value&&this.writeString(e.value)}between_alternativeAnswers(e,t,r){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}leaf_alternativeAnswersValue(e,t,r){(null==t?void 0:t.key)===s.NodeType.alternativeAnswers&&e.value&&this.writeString(e.value)}enter_statements(e,t,r){}between_statements(e,t,r,o,i){this.isRootBitType(i,a.RootBitType.trueFalse1)||(this.writeNL(),this.writeCardSetCardDivider()),this.writeNL()}exit_statements(e,t,r){}enter_statementsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}between_choices(e,t,r,o,i){this.writeNL()}exit_choices(e,t,r){this.writeNL()}enter_choicesValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}between_responses(e,t,r,o,i){this.writeNL()}exit_responses(e,t,r){this.writeNL()}enter_responsesValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_quizzes(e,t,r){}between_quizzes(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_quizzes(e,t,r){}between_quizzesValue(e,t,r,o,i){r.key!==s.NodeType.choices&&r.key!==s.NodeType.responses||this.writeNL()}enter_heading(e,t,r){}between_heading(e,t,r,o,i){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_heading(e,t,r){}enter_forValues(e,t,r){}between_forValues(e,t,r,o,i){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_forValues(e,t,r){}enter_pairs(e,t,r){}between_pairs(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_pairs(e,t,r){}between_pairsValue(e,t,r,o,i){}enter_keyAudio(e,t,r){const o=e.value;this.writeResource(o)}enter_keyImage(e,t,r){const o=e.value;this.writeResource(o)}enter_matrix(e,t,r){}between_matrix(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_matrix(e,t,r){}between_matrixValue(e,t,r,o,i){}enter_values(e,t,r){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}between_values(e,t,r,o,i){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}enter_questions(e,t,r){}between_questions(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_questions(e,t,r){}between_questionsValue(e,t,r,o,i){r.key===s.NodeType.sampleSolution&&this.writeNL()}exit_questionsValue(e,t,r){this.writeNL()}enter_botResponses(e,t,r){}between_botResponses(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_botResponses(e,t,r){}between_botResponsesValue(e,t,r,o,i){this.writeNL()}exit_botResponsesValue(e,t,r){this.writeNL()}leaf_response(e,t,r){this.writeOPB(),this.writeString(e.value),this.writeCL()}leaf_reaction(e,t,r){this.writeProperty("reaction",e.value,!0)}leaf_feedback(e,t,r){const o=e.value;o&&this.write(o)}between_resources(e,t,r,o,i){this.writeNL()}enter_resourcesValue(e,t,r){const o=e.value;this.writeResource(o)}enter_posterImage(e,t,r){const o=e.value;o&&o.value&&this.writeProperty("posterImage",o.value)}enter_thumbnails(e,t,r){const o=e.value;if(Array.isArray(o)){const e=["src1x","src2x","src3x","src4x"];for(let t=0;t<o.length&&t!==e.length;t++){const r=o[t],i=e[t];this.writeProperty(i,r.value,!0)}}}leaf_title(e,t,r){const o=e.value,i=(null==t?void 0:t.value).level||1;if(i&&o){this.writeOP();for(let e=0;e<+i;e++)this.writeHash();this.writeString(o),this.writeCL()}}leaf_subtitle(e,t,r){const o=e.value;if(o){this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeString(o),this.writeCL()}}leaf_book(e,t,r){const o=null==t?void 0:t.value;o&&e.value&&(this.writeProperty("book",e.value),o.reference&&(this.writeOPRANGLE(),this.writeString(o.reference),this.writeCL(),o.referenceEnd&&(this.writeOPRANGLE(),this.writeString(o.referenceEnd),this.writeCL())))}leaf_anchor(e,t,r){e.value&&(this.writeOPDANGLE(),this.writeString(e.value),this.writeCL())}leaf_reference(e,t,r){const o=null==t?void 0:t.value;o&&e.value&&(o.book||(this.writeOPRANGLE(),this.writeString(e.value),this.writeCL()))}leaf_hint(e,t,r){const o=e.value;o&&(this.writeOPQ(),this.writeString(o),this.writeCL())}leaf_instruction(e,t,r){const o=e.value;o&&(this.writeOPB(),this.writeString(o),this.writeCL())}leaf_example(e,t,r){var o,i;const n=e.value,s=null!==(o=null==t?void 0:t.value.isExample)&&void 0!==o&&o,a=null!==(i=null==t?void 0:t.value.isDefaultExample)&&void 0!==i&&i;s&&(a?(this.writeOPA(),this.writeString("example"),this.writeCL()):null!=n&&(this.writeOPA(),this.writeString("example"),this.writeColon(),!0===n?this.writeString("true"):!1===n?this.writeString("false"):this.writeString(n),this.writeCL()))}leaf_bodyText(e,t,r){const o=e.value;o&&this.writeString(o)}leaf_footerText(e,t,r){const o=e.value;o&&this.writeString(o)}leaf_elementsValue(e,t,r){e.value&&this.writeString(e.value)}leaf_solutionsValue(e,t,r){e.value&&(this.writeOPU(),this.writeString(e.value),this.writeCL())}leaf_prefix(e,t,r){e.value&&(this.writeOPPRE(),this.writeString(e.value),this.writeCL())}leaf_postfix(e,t,r){e.value&&(this.writeOPPOST(),this.writeString(e.value),this.writeCL())}leaf_forKeys(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_forValuesValue(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_key(e,t,r){e.value&&this.writeString(e.value)}leaf_valuesValue(e,t,r){e.value&&this.writeString(e.value)}leaf_question(e,t,r){(null==t?void 0:t.key)!==s.NodeType.questionsValue&&(null==t?void 0:t.key)!==s.NodeType.flashcardsValue||e.value&&this.writeString(e.value)}leaf_isShortAnswer(e,t,r){!1===e.value&&(this.writeOPA(),this.writeString("longAnswer"),this.writeCL())}leaf_src1x(e,t,r){this.writeProperty("src1x",e.value)}leaf_src2x(e,t,r){this.writeProperty("src2x",e.value)}leaf_src3x(e,t,r){this.writeProperty("src3x",e.value)}leaf_src4x(e,t,r){this.writeProperty("src4x",e.value)}leaf_width(e,t,r){this.writeProperty("width",e.value)}leaf_height(e,t,r){this.writeProperty("height",e.value)}leaf_alt(e,t,r){this.writeProperty("alt",e.value)}leaf_license(e,t,r){this.writeProperty("license",e.value)}leaf_copyright(e,t,r){this.writeProperty("copyright",e.value)}leaf_provider(e,t,r){}leaf_showInIndex(e,t,r){this.writeProperty("showInIndex",e.value)}leaf_caption(e,t,r){const o=e.value;this.writeProperty("caption",o)}leaf_duration(e,t,r){(null==t?void 0:t.key)!==s.NodeType.bitsValue&&this.writeProperty("duration",e.value)}leaf_mute(e,t,r){this.writeProperty("mute",e.value)}leaf_autoplay(e,t,r){this.writeProperty("autoplay",e.value)}leaf_allowSubtitles(e,t,r){this.writeProperty("allowSubtitles",e.value)}leaf_showSubtitles(e,t,r){this.writeProperty("showSubtitles",e.value)}generatePropertyHandlers(){var e;const t=n.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===g.PropertyTag.example)continue;if(t===g.PropertyTag.labelTrue)continue;if(t===g.PropertyTag.labelFalse)continue;if(t===g.PropertyTag.posterImage)continue;if(t===g.PropertyTag.imageSource)continue;if(t===g.PropertyTag.partner)continue;if(t===p.PropertyAstKey.markConfig)continue;const o=`enter_${t}`;this[o]=(e,t,o)=>{null!=e.value&&(null==t?void 0:t.key)===s.NodeType.bitsValue&&this.writeProperty(r.tag,e.value,r.single,"false"===r.defaultValue,"true"===r.defaultValue)},this[o]=this[o].bind(this)}}writeString(e){null!=e&&this.write(`${e}`)}writeOPBUL(){this.write("[•")}writeOPESC(){this.write("[^")}writeOPRANGLE(){this.write("[►")}writeOPDANGLE(){this.write("[▼")}writeOPD(){this.write("[.")}writeOPU(){this.write("[_")}writeOPE(){this.write("[=")}writeOPB(){this.write("[!")}writeOPQ(){this.write("[?")}writeOPA(){this.write("[@")}writeOPP(){this.write("[+")}writeOPM(){this.write("[-")}writeOPS(){this.write("[\\")}writeOPR(){this.write("[*")}writeOPC(){this.write("[%")}writeOPAMP(){this.write("[&")}writeOPDOLLAR(){this.write("[$")}writeOPHASH(){this.write("[#")}writeOPPRE(){this.write("['")}writeOPPOST(){this.write("[")}writeOP(){this.write("[")}writeCL(){this.write("]")}writeAmpersand(){this.write("&")}writeColon(){this.write(":")}writeHash(){this.write("#")}writeCardSetStart(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("~~~~")}writeCardSetCardDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("--"):this.write("++")}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeResource(e){var t;const r=e;e&&(this.writeOPAMP(),this.writeString(null!==(t=e.typeAlias)&&void 0!==t?t:e.type),e.type===d.ResourceTag.article&&r.value?(this.writeColon(),this.writeString(r.value),this.writeNL()):e.value&&(this.writeColon(),this.writeString(e.value)),this.writeCL())}writeProperty(e,t,r,o,i){let n,s=!1;if(void 0!==t&&(n=Array.isArray(t)?t:[t],n.length>0)){r&&(n=n.slice(n.length-1));for(const t of n)if(void 0!==t){if(o&&!1===t)continue;if(i&&!0===t)continue;this.writeOPA(),this.writeString(e),this.writeColon(),this.writeString(`${t}`),this.writeCL(),s=!0}}s||(this.skipNLBetweenBitsValue=!0)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}isWriteTextFormat(e){return!!(!(y.TextFormat.fromValue(e)===y.TextFormat.bitmarkMinusMinus)||this.options.explicitTextFormat)}isRootBitType1(e){return this.isRootBitType(e,a.RootBitType.trueFalse1)||this.isRootBitType(e,a.RootBitType.multipleChoice1)||this.isRootBitType(e,a.RootBitType.multipleResponse1)}isRootBitType(e,t){const r=this.getBitType(e);return(null==r?void 0:r.root)===t}getBitType(e){for(const t of e)if(t.key===s.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getParentNode(e,t=1){if(e.length>t+1)return e[e.length-t-1]}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},8582:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkStringGenerator=void 0;const i=r(227),n=r(297);t.BitmarkStringGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.BitmarkGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},3857:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonGenerator=void 0;const n=r(8256),s=r(2606),a=r(549),l=r(208),u=r(8791),c=r(1060),p=r(7028),g=r(7204),d=r(7953),y=r(9779),f=r(1353),h=r(406),m=r(7646),T=r(672),b=r(3633),v=r(169),C={};t.JsonGenerator=class{constructor(e,t){var r;this.ast=new n.Ast,this.textParser=new h.TextParser,this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault="",this.bodyDefault="",this.printed=!1,this.bitmarkVersion=null!==(r=u.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:u.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},C),null==t?void 0:t.jsonOptions),this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===u.BitmarkVersion.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return o(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=this.options.textAsPlainText?"":[],this.bodyDefault=this.options.textAsPlainText?"":[],this.printed=!1}walkAndWrite(e){this.ast.walk(e,a.NodeType.bitmarkAst,this,void 0)}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const s=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof s[a]&&(n=s[a](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_bitmarkAst(e,t,r){this.json=[]}enter_bitsValue(e,t,r){var o,i,n;const a=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(a),this.bitWrapperJson.bit=this.bitJson;const u=s.Config.getBitConfig(a.bitType),c=!!u.rootExampleType,g=u.rootExampleType===p.ExampleType.boolean;if(c){let e;g?(e=!0,a.bitType.root===l.RootBitType.trueFalse1&&void 0!==(null===(i=null===(o=a.cardNode)||void 0===o?void 0:o.statement)||void 0===i?void 0:i.isCorrect)&&(e=a.cardNode.statement.isCorrect)):e=null!==(n=a.sampleSolution)&&void 0!==n?n:"";const t=this.toExample(a,{defaultExample:e,isBoolean:g});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else a.isExample&&(this.bitJson.isExample=!0)}exit_bitsValue(e,t,r){this.cleanAndSetDefaultsForBitJson(this.bitJson)}enter_imageSource(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const{url:i,mockupId:n,size:s,format:l,trim:u}=o,c={};this.addProperty(c,"url",null!=i?i:"",!0),this.addProperty(c,"mockupId",null!=n?n:"",!0),this.addProperty(c,"size",null!=s?s:null,!0),this.addProperty(c,"format",null!=l?l:null,!0),this.addProperty(c,"trim",T.BooleanUtils.isBoolean(u)?u:null,!0),this.bitJson.imageSource=c}enter_partner(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const{name:i,avatarImage:n}=o,s={};if(this.addProperty(s,"name",null!=i?i:"",!0),n){const e=this.parseResourceToJson(n);e&&e.type===y.ResourceTag.image&&(s.avatarImage=e.image)}this.bitJson.partner=s}enter_markConfigValue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.markConfig)return;const{mark:i,color:n,emphasis:s}=o,l={};this.addProperty(l,"mark",null!=i?i:"unknown",!0),n&&this.addProperty(l,"color",null!=n?n:"",!0),s&&this.addProperty(l,"emphasis",null!=s?s:"",!0),this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(l)}leaf_sampleSolution(e,t,r){(null==t?void 0:t.key)===a.NodeType.bitsValue&&null!=e.value&&this.addProperty(this.bitJson,"sampleSolution",e.value,!0)}enter_itemLead(e,t,r){const o=e.value,{item:i,lead:n}=o;(null==t?void 0:t.key)===a.NodeType.bitsValue&&(null!=i&&(this.bitJson.item=this.toTextAstOrString(i)),null!=n&&(this.bitJson.lead=this.toTextAstOrString(n)))}enter_extraProperties(e,t,r){const o=e.value;if(!this.options.excludeUnknownProperties&&o)for(const[e,t]of Object.entries(o)){let r=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(r=`_${e}`),this.addProperty(this.bitJson,r,t)}}enter_bodyParts(e,t,r){const o=e.value,i=this.options.textAsPlainText,n=this.getTextFormat(r);let s="",a=0;null==this.bitJson.body&&(this.bitJson.body=this.bodyDefault);const l=e=>({legacyPlaceholderKey:`{${e}}`,placeholderKey:`[!${e}]`});for(let e=0;e<o.length;e++){const t=o[e];if(t.type===c.BodyBitType.text){s+=t.data.bodyText}else{const{legacyPlaceholderKey:e,placeholderKey:t}=l(a);s+=i?e:t,a++}}this.bitJson.body=this.toTextAstOrString(s,n);const u=this.bitJson.body;a=0;for(let e=0;e<o.length;e++){const t=o[e];if(t.type===c.BodyBitType.text)continue;const r=t;let n;const{legacyPlaceholderKey:s}=l(a);switch(t.type){case c.BodyBitType.gap:{const e=r;n=this.createGapJson(e);break}case c.BodyBitType.mark:{const e=r;n=this.createMarkJson(e);break}case c.BodyBitType.select:{const e=r;n=this.createSelectJson(e);break}case c.BodyBitType.highlight:{const e=r;n=this.createHighlightJson(e);break}}n&&(i?(this.bitJson.placeholders||(this.bitJson.placeholders={}),this.bitJson.placeholders[s]=n):this.replacePlaceholderWithBodyBit(u,n,a)),a++}return!1}enter_elements(e,t,r){const o=e.value;o&&o.length>0&&(this.bitJson.elements=o)}enter_flashcards(e,t,r){var o,i,n,s;const l=e.value;if((null==t?void 0:t.key)!==a.NodeType.cardNode)return;const u=[];if(l)for(const e of l){const t=Object.assign(Object.assign({question:null!==(o=e.question)&&void 0!==o?o:"",answer:null!==(i=e.answer)&&void 0!==i?i:"",alternativeAnswers:null!==(n=e.alternativeAnswers)&&void 0!==n?n:[]},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:e.isDefaultExample,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.cards=u)}enter_statement(e,t,r){var o,i;const n=e.value;(null==t?void 0:t.key)===a.NodeType.cardNode&&n&&(this.bitJson.statement=null!==(o=n.text)&&void 0!==o?o:"",this.bitJson.isCorrect=null!==(i=n.isCorrect)&&void 0!==i&&i)}enter_statements(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==a.NodeType.cardNode)return;const l=[];if(s)for(const e of s){const t=Object.assign(Object.assign({statement:null!==(o=e.text)&&void 0!==o?o:"",isCorrect:!!e.isCorrect},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(i=e.itemLead)||void 0===i?void 0:i.item)&&delete t.item,null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,null==(null==e?void 0:e.hint)&&delete t.hint,null==(null==e?void 0:e.instruction)&&delete t.instruction,l.push(t)}l.length>0&&(this.bitJson.statements=l)}enter_choices(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==a.NodeType.cardNode)return;const l=[];if(s)for(const e of s){const t=Object.assign(Object.assign({choice:null!==(o=e.text)&&void 0!==o?o:"",isCorrect:null!==(i=e.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.choices=l)}enter_responses(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==a.NodeType.cardNode)return;const l=[];if(s)for(const e of s){const t=Object.assign(Object.assign({response:null!==(o=e.text)&&void 0!==o?o:"",isCorrect:null!==(i=e.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.responses=l)}enter_quizzes(e,t,r){var o,i,n,s,a,l,u,c;const p=e.value,g=[];if(p)for(const e of p){const t=[];if(e.choices)for(const r of e.choices){const s=Object.assign(Object.assign({choice:null!==(o=r.text)&&void 0!==o?o:"",isCorrect:null!==(i=r.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:!!r.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete s.lead,t.push(s)}const r=[];if(e.responses)for(const t of e.responses){const o=Object.assign(Object.assign({response:null!==(s=t.text)&&void 0!==s?s:"",isCorrect:null!==(a=t.isCorrect)&&void 0!==a&&a},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!!t.isCorrect,isBoolean:!0}));null==(null===(l=e.itemLead)||void 0===l?void 0:l.lead)&&delete o.lead,r.push(o)}const p=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e)),{isExample:null!==(u=e.isExample)&&void 0!==u&&u,choices:e.choices?t:void 0,responses:e.responses?r:void 0});null==(null===(c=e.itemLead)||void 0===c?void 0:c.lead)&&delete p.lead,g.push(p)}g.length>0&&(this.bitJson.quizzes=g)}enter_heading(e,t,r){var o,i;const n=e.value;let s=!1;if(n&&n.forKeys&&(s=!0),!s)return!1;const a={forKeys:null!==(o=n.forKeys)&&void 0!==o?o:""};Array.isArray(n.forValues)?n.forValues.length>1?a.forValues=n.forValues:1===n.forValues.length?a.forValues=n.forValues[0]:a.forValues=n.forValues:a.forValues=null!==(i=n.forValues)&&void 0!==i?i:"",this.bitJson.heading=a}enter_pairs(e,t,r){var o,i,n,s,a;const l=e.value,u=[];if(l)for(const e of l){const t=Array.isArray(e.values)&&e.values.length>0&&e.values[0],r=Object.assign(Object.assign(Object.assign({key:null!==(o=e.key)&&void 0!==o?o:"",keyAudio:e.keyAudio?this.addAudioResource(e.keyAudio):void 0,keyImage:e.keyImage?this.addImageResource(e.keyImage):void 0,values:null!==(i=e.values)&&void 0!==i?i:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(n=e.isCaseSensitive)||void 0===n||n,isLongAnswer:null!==(s=!e.isShortAnswer)&&void 0!==s&&s}),this.toExample(e,{defaultExample:t,isBoolean:!1}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete r.lead,r.key&&(delete r.keyAudio,delete r.keyImage),null!=r.keyAudio&&(delete r.key,delete r.keyImage),null!=r.keyImage&&(delete r.key,delete r.keyAudio),u.push(r)}u.length>0&&(this.bitJson.pairs=u)}enter_matrix(e,t,r){var o,i,n,s,a,l,u;const c=e.value,p=[];if(c)for(const e of c){const t=[];if(e.cells)for(const r of e.cells){const e=Array.isArray(r.values)&&r.values.length>0&&r.values[0],n=Object.assign(Object.assign({values:null!==(o=r.values)&&void 0!==o?o:[]},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:e,isBoolean:!1}));null==(null===(i=r.itemLead)||void 0===i?void 0:i.lead)&&delete n.lead,null==r.hint&&delete n.hint,t.push(n)}const r=Object.assign(Object.assign({key:null!==(n=e.key)&&void 0!==n?n:"",cells:null!=t?t:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(s=e.isCaseSensitive)||void 0===s||s,isLongAnswer:null!==(a=!e.isShortAnswer)&&void 0!==a&&a,isExample:null!==(l=e.isExample)&&void 0!==l&&l});null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete r.lead,null==e.instruction&&delete r.instruction,p.push(r)}p.length>0&&(this.bitJson.matrix=p)}enter_questions(e,t,r){var o,i,n,s,a;const l=e.value,u=[];if(l)for(const e of l){const t=Object.assign(Object.assign(Object.assign({question:null!==(o=e.question)&&void 0!==o?o:"",partialAnswer:null!==(i=m.ArrayUtils.asSingle(e.partialAnswer))&&void 0!==i?i:"",sampleSolution:null!==(n=e.sampleSolution)&&void 0!==n?n:""},this.toItemLeadHintInstruction(e)),{isShortAnswer:null===(s=e.isShortAnswer)||void 0===s||s,reasonableNumOfChars:e.reasonableNumOfChars}),this.toExample(e,{defaultExample:e.sampleSolution||"",isBoolean:!1}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.questions=u)}enter_botResponses(e,t,r){var o,i,n,s;const l=e.value;if((null==t?void 0:t.key)!==a.NodeType.cardNode)return;const u=[];if(l)for(const e of l){const t=Object.assign({response:null!==(o=e.response)&&void 0!==o?o:"",reaction:null!==(i=e.reaction)&&void 0!==i?i:"",feedback:null!==(n=e.feedback)&&void 0!==n?n:""},this.toItemLeadHintInstruction(e));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,null==e.hint&&delete t.hint,delete t.instruction,u.push(t)}u.length>0&&(this.bitJson.responses=u)}enter_resources(e,t,r){var o;const i=e.value,n=this.getBitType(r),a=this.getResourceType(r);if(!i||!n)return;let l;const u=s.Config.getBitConfig(n),c=s.Config.getBitResourcesConfig(n,a),p=c.comboResourceTagTypesMap;if(c.comboResourceTagTypesMap.size>0)for(const[e,t]of p.entries()){const r={type:e};for(const e of t){const t=i.find((t=>t.typeAlias===e));if(t){const e=s.Config.getTagConfigForTag(u.tags,t.typeAlias),i=null!==(o=null==e?void 0:e.jsonKey)&&void 0!==o?o:t.typeAlias,n=this.parseResourceToJson(t);if(n)for(const[e,t]of Object.entries(n))"type"!==e&&(r[i]=t)}}l=r}else i.length>=1&&(l=this.parseResourceToJson(i[0]));this.bitJson.resource=l}leaf_title(e,t,r){this.bitJson.title=this.toTextAstOrString(e.value)}leaf_subtitle(e,t,r){this.bitJson.subtitle=this.toTextAstOrString(e.value)}leaf_level(e,t,r){var o;null!=e.value&&this.addProperty(this.bitJson,"level",null!==(o=e.value)&&void 0!==o?o:1,!0)}leaf_book(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"book",e.value,!0)}leaf_anchor(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"anchor",e.value,!0)}leaf_reference(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"reference",e.value,!0)}leaf_referenceEnd(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"referenceEnd",e.value,!0)}leaf_hint(e,t,r){const o=e.value;(null==t?void 0:t.key)===a.NodeType.bitsValue&&(this.bitJson.hint=this.toTextAstOrString(o))}leaf_instruction(e,t,r){const o=e.value;(null==t?void 0:t.key)===a.NodeType.bitsValue&&(this.bitJson.instruction=this.toTextAstOrString(o))}leaf_footerText(e,t,r){const o=e.value;this.bitJson.footer=this.toTextAstOrString(o)}leaf_markup(e,t,r){const o=e.value;o&&(this.bitWrapperJson.bitmark=o)}enter_parser(e,t,r){const o=e.value;if(o){const{version:e,excessResources:r,warnings:n,errors:s}=o,l=i(o,["version","excessResources","warnings","errors"]),u=`${this.bitmarkVersion}`;let c;if(Array.isArray(r)&&r.length>0){c=[];for(const e of r){const t=this.parseResourceToJson(e);t&&c.push(t)}}(null==t?void 0:t.key)===a.NodeType.bitsValue&&(this.bitWrapperJson.parser=Object.assign(Object.assign({version:e,bitmarkVersion:u},l),{warnings:n,errors:s,excessResources:c}),this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){var e;const t=s.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===d.PropertyTag.example)continue;if(t===d.PropertyTag.imageSource)continue;if(t===d.PropertyTag.partner)continue;if(t===g.PropertyAstKey.markConfig)continue;const o=`enter_${t}`;this[o]=(e,t,o)=>{var i;const n=e.value;if(null==n)return;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const s=null!==(i=r.jsonKey)&&void 0!==i?i:r.tag;this.addProperty(this.bitJson,s,n,r.single)},this[o]=this[o].bind(this)}}createGapJson(e){var t;const r=e.data,o=r.solutions&&r.solutions.length>0?r.solutions[0]:"",i=Object.assign(Object.assign(Object.assign(Object.assign({type:"gap"},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(t=r.isCaseSensitive)||void 0===t||t}),this.toExample(r,{defaultExample:o,isBoolean:!1})),{solutions:r.solutions});return i.lead||delete i.lead,i}createMarkJson(e){const t=e.data,r=Object.assign(Object.assign({type:"mark",solution:t.solution,mark:t.mark},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!0,isBoolean:!0}));return r.lead||delete r.lead,r}createSelectJson(e){var t,r,o,i;const n=e.data,s=[];for(const e of n.options){const r=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));r.item||delete r.item,r.lead||delete r.lead,r.instruction||delete r.instruction,r.isCaseSensitive||delete r.isCaseSensitive,s.push(r)}const a=Object.assign(Object.assign({type:"select",prefix:null!==(r=n.prefix)&&void 0!==r?r:"",postfix:null!==(o=n.postfix)&&void 0!==o?o:""},this.toItemLeadHintInstruction(n)),{isExample:null!==(i=n.isExample)&&void 0!==i&&i,options:s});return a.lead||delete a.lead,a}createHighlightJson(e){var t,r,o,i,n;const s=e.data,a=[];for(const e of s.texts){const o=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t,isHighlighted:null!==(r=e.isHighlighted)&&void 0!==r&&r},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));o.item||delete o.item,o.lead||delete o.lead,o.hint||delete o.hint,o.isCaseSensitive||delete o.isCaseSensitive,a.push(o)}const l=Object.assign(Object.assign({type:"highlight",prefix:null!==(o=s.prefix)&&void 0!==o?o:"",postfix:null!==(i=s.postfix)&&void 0!==i?i:""},this.toItemLeadHintInstruction(s)),{isExample:null!==(n=s.isExample)&&void 0!==n&&n,texts:a});return l.lead||delete l.lead,l}parseResourceToJson(e){if(!e)return;let t;switch(e.type){case y.ResourceTag.image:t={type:y.ResourceTag.image,image:this.addImageResource(e)};break;case y.ResourceTag.imageLink:t={type:y.ResourceTag.imageLink,imageLink:this.addImageLinkResource(e)};break;case y.ResourceTag.audio:t={type:y.ResourceTag.audio,audio:this.addAudioResource(e)};break;case y.ResourceTag.audioEmbed:t={type:y.ResourceTag.audioEmbed,audioEmbed:this.addAudioEmbedResource(e)};break;case y.ResourceTag.audioLink:t={type:y.ResourceTag.audioLink,audioLink:this.addAudioLinkResource(e)};break;case y.ResourceTag.video:t={type:y.ResourceTag.video,video:this.addVideoResource(e)};break;case y.ResourceTag.videoEmbed:t={type:y.ResourceTag.videoEmbed,videoEmbed:this.addVideoEmbedResource(e)},t.videoEmbed=this.addVideoLinkResource(e);break;case y.ResourceTag.videoLink:t={type:y.ResourceTag.videoLink,videoLink:this.addVideoLinkResource(e)};break;case y.ResourceTag.stillImageFilmEmbed:t={type:y.ResourceTag.stillImageFilmEmbed,stillImageFilmEmbed:this.addStillImageFilmEmbedResource(e)};break;case y.ResourceTag.stillImageFilmLink:t={type:y.ResourceTag.stillImageFilmLink,stillImageFilmLink:this.addStillImageFilmLinkResource(e)};break;case y.ResourceTag.article:t={type:y.ResourceTag.article,article:this.addArticleResource(e)};break;case y.ResourceTag.document:t={type:y.ResourceTag.document,document:this.addDocumentResource(e)};break;case y.ResourceTag.documentEmbed:t={type:y.ResourceTag.documentEmbed,documentEmbed:this.addDocumentEmbedResource(e)};break;case y.ResourceTag.documentLink:t={type:y.ResourceTag.documentLink,documentLink:this.addDocumentLinkResource(e)};break;case y.ResourceTag.documentDownload:t={type:y.ResourceTag.documentDownload,documentDownload:this.addDocumentDownloadResource(e)};break;case y.ResourceTag.appLink:t={type:y.ResourceTag.appLink,appLink:this.addAppLinkResource(e)};break;case y.ResourceTag.websiteLink:t={type:y.ResourceTag.websiteLink,websiteLink:this.addWebsiteLinkResource(e)}}return t}addImageResource(e){var t,r,o;const i={};if(b.StringUtils.isString(e)){const t=e;e={type:y.ResourceTag.image,typeAlias:y.ResourceTag.image,value:t,format:v.UrlUtils.fileExtensionFromUrl(t),provider:v.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.src=e.value),null!=e.src1x&&(i.src1x=e.src1x),null!=e.src2x&&(i.src2x=e.src2x),null!=e.src3x&&(i.src3x=e.src3x),null!=e.src4x&&(i.src4x=e.src4x),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,i.alt=null!==(o=e.alt)&&void 0!==o?o:"",this.addGenericResourceProperties(e,i),i}addImageLinkResource(e){var t,r,o;const i={};if(b.StringUtils.isString(e)){const t=e;e={type:y.ResourceTag.imageLink,typeAlias:y.ResourceTag.imageLink,value:t,format:v.UrlUtils.fileExtensionFromUrl(t),provider:v.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),null!=e.src1x&&(i.src1x=e.src1x),null!=e.src2x&&(i.src2x=e.src2x),null!=e.src3x&&(i.src3x=e.src3x),null!=e.src4x&&(i.src4x=e.src4x),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,i.alt=null!==(o=e.alt)&&void 0!==o?o:"",this.addGenericResourceProperties(e,i),i}addAudioResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t,!0),t}addVideoResource(e){var t,r;const o={};if(null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.src=e.value),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=e.alt),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addVideoEmbedResource(e){var t,r;const o={};if(null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.src=e.value),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=e.alt),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addVideoLinkResource(e){var t,r;const o={};if(null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.url=e.value),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=e.alt),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addStillImageFilmEmbedResource(e){var t,r;const o={};if(null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.url=e.value),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=e.alt),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addStillImageFilmLinkResource(e){var t,r;const o={};if(null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.url=e.value),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=e.alt),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addArticleResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.body=e.value),this.addGenericResourceProperties(e,t),t}addDocumentResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentDownloadResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addAppLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addWebsiteLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),null!=e.siteName&&(t.siteName=e.siteName),this.addGenericResourceProperties(e,t),t}addGenericResourceProperties(e,t,r){var o,i,n,s,a,l,u,c;return r?(null!=e.license&&(t.license=null!==(o=e.license)&&void 0!==o?o:""),null!=e.copyright&&(t.copyright=null!==(i=e.copyright)&&void 0!==i?i:""),null!=e.provider&&(t.provider=e.provider),null!=e.showInIndex&&(t.showInIndex=null!==(n=e.showInIndex)&&void 0!==n&&n),null!=e.caption&&(t.caption=this.toTextAstOrString(null!==(s=e.caption)&&void 0!==s?s:""))):(t.license=null!==(a=e.license)&&void 0!==a?a:"",t.copyright=null!==(l=e.copyright)&&void 0!==l?l:"",null!=e.provider&&(t.provider=e.provider),t.showInIndex=null!==(u=e.showInIndex)&&void 0!==u&&u,t.caption=this.toTextAstOrString(null!==(c=e.caption)&&void 0!==c?c:"")),t}toItemLeadHintInstruction(e){var t,r,o,i,n,s;return{item:this.toTextAstOrString(null!==(r=null===(t=e.itemLead)||void 0===t?void 0:t.item)&&void 0!==r?r:""),lead:this.toTextAstOrString(null!==(i=null===(o=e.itemLead)||void 0===o?void 0:o.lead)&&void 0!==i?i:""),hint:this.toTextAstOrString(null!==(n=e.hint)&&void 0!==n?n:""),instruction:this.toTextAstOrString(null!==(s=e.instruction)&&void 0!==s?s:"")}}toExample(e,t){const{isExample:r,example:o,isDefaultExample:i}=e,{defaultExample:n,isBoolean:s}=t;if(!r)return{isExample:!1,example:null};let a;return a=i?s?T.BooleanUtils.toBoolean(n):this.toTextAstOrString(n):s?T.BooleanUtils.toBoolean(o):this.toTextAstOrString(o),{isExample:!0,example:a}}addProperty(e,t,r,o){void 0!==r&&(Array.isArray(r)||(r=[r]),Array.isArray(r)&&r.length>0&&(o&&r.length>=1?e[t]=r[r.length-1]:e[t]=r))}getBitType(e){for(const t of e)if(t.key===a.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getTextFormat(e){for(const t of e)if(t.key===a.NodeType.bitsValue){const e=t.value;return f.TextFormat.fromValue(null==e?void 0:e.textFormat)}}getResourceType(e){for(const t of e)if(t.key===a.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.resourceType}}toTextAstOrString(e,t=f.TextFormat.bitmarkMinusMinus){if(this.options.textAsPlainText)return e;return this.textParser.toAst(e,{textFormat:t})}replacePlaceholderWithBodyBit(e,t,r){const o=(e,i,n)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const r=e[t];if(o(r,e,t))return!0}else{if("bit"===e.type&&e.index===r)return i[n]=t,!0;if(e.content){if(o(e.content,e,"content"))return!0}}return!1};o(e,null,null)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){return{type:e.bitType.alias,format:e.textFormat,id:void 0,externalId:void 0,spaceId:void 0,padletId:void 0,jupyterId:void 0,jupyterExecutionCount:void 0,AIGenerated:void 0,releaseVersion:void 0,book:void 0,ageRange:void 0,lang:void 0,language:void 0,computerLanguage:void 0,target:void 0,tag:void 0,icon:void 0,iconTag:void 0,colorTag:void 0,flashcardSet:void 0,subtype:void 0,bookAlias:void 0,coverImage:void 0,publisher:void 0,publications:void 0,author:void 0,subject:void 0,date:void 0,location:void 0,theme:void 0,kind:void 0,action:void 0,thumbImage:void 0,focusX:void 0,focusY:void 0,deeplink:void 0,externalLink:void 0,externalLinkText:void 0,videoCallLink:void 0,duration:void 0,list:void 0,textReference:void 0,isTracked:void 0,isInfoOnly:void 0,labelTrue:void 0,labelFalse:void 0,content2Buy:void 0,quotedPerson:void 0,reasonableNumOfChars:void 0,title:void 0,subtitle:void 0,level:void 0,toc:void 0,progress:void 0,anchor:void 0,reference:void 0,referenceEnd:void 0,item:void 0,lead:void 0,hint:void 0,instruction:void 0,isExample:void 0,example:void 0,partner:void 0,marks:void 0,extraProperties:void 0,body:void 0,resource:void 0,statement:void 0,isCorrect:void 0,sampleSolution:void 0,partialAnswer:void 0,elements:void 0,statements:void 0,responses:void 0,quizzes:void 0,heading:void 0,pairs:void 0,matrix:void 0,choices:void 0,questions:void 0,placeholders:void 0,footer:void 0}}cleanAndSetDefaultsForBitJson(e){const t=s.Config.getBitType(e.type),r=this.options.textAsPlainText;switch(e.item||(e.item=void 0),t.root){case l.RootBitType._error:break;case l.RootBitType.article:case l.RootBitType.sampleSolution:case l.RootBitType.page:null==e.body&&(e.body=this.bodyDefault);break;default:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),t.alias!==l.AliasBitType.articleAi&&t.alias!==l.AliasBitType.noteAi&&t.alias!==l.AliasBitType.summaryAi||null==e.AIGenerated&&(e.AIGenerated=!0);break;case l.RootBitType.cloze:case l.RootBitType.multipleChoice1:case l.RootBitType.multipleResponse1:case l.RootBitType.multipleChoiceText:case l.RootBitType.highlightText:case l.RootBitType.clozeAndMultipleChoiceText:case l.RootBitType.sequence:case l.RootBitType.mark:case l.RootBitType.flashcard:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.multipleChoice:case l.RootBitType.multipleResponse:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault);break;case l.RootBitType.essay:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="");break;case l.RootBitType.trueFalse1:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.trueFalse:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.chapter:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.toc&&(e.toc=!0),null==e.progress&&(e.progress=!0),null==e.level&&(e.level=1),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.interview:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[]);break;case l.RootBitType.match:null==e.item&&(e.item=this.textDefault),null==e.heading&&(e.heading={}),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.matchMatrix:null==e.item&&(e.item=this.textDefault),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.learningPathBook:case l.RootBitType.learningPathExternalLink:case l.RootBitType.learningPathVideoCall:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.pageBuyButton:null==e.content2Buy&&(e.content2Buy=""),null==e.body&&(e.body=this.bodyDefault)}return null==e.id&&delete e.id,null==e.externalId&&delete e.externalId,null==e.spaceId&&delete e.spaceId,null==e.padletId&&delete e.padletId,null==e.jupyterId&&delete e.jupyterId,null==e.jupyterExecutionCount&&delete e.jupyterExecutionCount,null==e.AIGenerated&&delete e.AIGenerated,null==e.releaseVersion&&delete e.releaseVersion,null==e.book&&delete e.book,null==e.ageRange&&delete e.ageRange,null==e.lang&&delete e.lang,null==e.language&&delete e.language,null==e.computerLanguage&&delete e.computerLanguage,null==e.target&&delete e.target,null==e.tag&&delete e.tag,null==e.icon&&delete e.icon,null==e.iconTag&&delete e.iconTag,null==e.colorTag&&delete e.colorTag,null==e.flashcardSet&&delete e.flashcardSet,null==e.subtype&&delete e.subtype,null==e.bookAlias&&delete e.bookAlias,null==e.coverImage&&delete e.coverImage,null==e.publisher&&delete e.publisher,null==e.publications&&delete e.publications,null==e.author&&delete e.author,null==e.subject&&delete e.subject,null==e.date&&delete e.date,null==e.location&&delete e.location,null==e.theme&&delete e.theme,null==e.kind&&delete e.kind,null==e.action&&delete e.action,null==e.thumbImage&&delete e.thumbImage,null==e.deeplink&&delete e.deeplink,null==e.externalLink&&delete e.externalLink,null==e.externalLinkText&&delete e.externalLinkText,null==e.videoCallLink&&delete e.videoCallLink,null==e.duration&&delete e.duration,null==e.list&&delete e.list,null==e.textReference&&delete e.textReference,null==e.isTracked&&delete e.isTracked,null==e.isInfoOnly&&delete e.isInfoOnly,null==e.labelTrue&&delete e.labelTrue,null==e.labelFalse&&delete e.labelFalse,null==e.content2Buy&&delete e.content2Buy,null==e.quotedPerson&&delete e.quotedPerson,null==e.title&&delete e.title,null==e.subtitle&&delete e.subtitle,null==e.level&&delete e.level,null==e.toc&&delete e.toc,null==e.progress&&delete e.progress,null==e.anchor&&delete e.anchor,null==e.reference&&delete e.reference,null==e.referenceEnd&&delete e.referenceEnd,null==e.item&&delete e.item,null==e.lead&&delete e.lead,null==e.hint&&delete e.hint,null==e.instruction&&delete e.instruction,void 0===e.example&&delete e.example,null==e.isExample&&delete e.isExample,null==e.marks&&delete e.marks,null==e.extraProperties&&delete e.extraProperties,null==e.body&&delete e.body,null!=e.placeholders&&0!==Object.keys(e.placeholders).length||delete e.placeholders,null==e.resource&&delete e.resource,null==e.statement&&delete e.statement,null==e.isCorrect&&delete e.isCorrect,null==e.sampleSolution&&delete e.sampleSolution,null==e.partialAnswer&&delete e.partialAnswer,null==e.elements&&delete e.elements,null==e.statements&&delete e.statements,null==e.responses&&delete e.responses,null==e.quizzes&&delete e.quizzes,null==e.heading&&delete e.heading,null==e.pairs&&delete e.pairs,null==e.matrix&&delete e.matrix,null==e.choices&&delete e.choices,null==e.questions&&delete e.questions,r&&null!=e.placeholders||delete e.placeholders,null==e.footer&&delete e.footer,e}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},4275:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonObjectGenerator=void 0;const i=r(227),n=r(3857);t.JsonObjectGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.JsonGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),JSON.parse(this.writer.getString())}))}generateSync(e){return this.generator.generateSync(e),JSON.parse(this.writer.getString())}}},5132:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonStringGenerator=void 0;const i=r(227),n=r(3857);t.JsonStringGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.JsonGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},6300:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKSCAPE_REGEX_REPLACER=t.BREAKSCAPE_REGEX=t.TextGenerator=void 0;const i=r(8256),n=r(549),s=r(8791),a=r(1353),l=r(1888),u=r(2610),c={debugGenerationInline:!1},p={[l.TextMarkType.bold]:"**",[l.TextMarkType.light]:"``",[l.TextMarkType.italic]:"__",[l.TextMarkType.highlight]:"!!"},g=new RegExp("([=*_`!])([\\^]*)\\1|([\\|\\[])","g");t.BREAKSCAPE_REGEX=g;const d="$1$3^$2$1";t.BREAKSCAPE_REGEX_REPLACER=d;const y=new RegExp("^(\\||•|#)","gm"),f=new RegExp(/(\n|\r\n)/,"g"),h=new RegExp(/https?:\/\/|mailto:(.*)/,"g");t.TextGenerator=class{constructor(e,t){var r;this.ast=new i.Ast,this.textFormat=a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={},this.printed=!1,this.bitmarkVersion=null!==(r=s.BitmarkVersion.fromValue(e))&&void 0!==r?r:s.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},c),t),this.bitmarkVersion,s.BitmarkVersion.v2,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this)}generate(e,t){return o(this,void 0,void 0,(function*(){return this.resetState(t),this.walkAndWrite(e),this.writerText}))}generateSync(e,t){return this.resetState(t),this.walkAndWrite(e),this.writerText}getPlaceholders(){return this.placeholders}resetState(e){this.printed=!1,this.textFormat=null!=e?e:a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={}}walkAndWrite(e){this.ast.walk(e,n.NodeType.textAst,this,void 0)}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const s=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof s[a]&&(n=s[a](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_textAstValue(e,t,r){this.handleEnterNode(e.value)}between_textAstValue(e,t,r,o,i){this.handleBetweenNode(e.value)}exit_textAstValue(e,t,r){this.handleExitNode(e.value)}enter_contentValueValue(e,t,r){this.handleEnterNode(e.value)}between_contentValueValue(e,t,r,o,i){this.handleBetweenNode(e.value)}exit_contentValueValue(e,t,r){this.handleExitNode(e.value)}handleEnterNode(e){switch(this.handleIndent(e),e.type){case u.TextNodeType.paragraph:this.writeParagraph(e);break;case u.TextNodeType.hardBreak:this.writeHardBreak(e);break;case u.TextNodeType.text:this.writeMarks(e,!0),this.writeText(e);break;case u.TextNodeType.heading:this.writeHeading(e);break;case u.TextNodeType.section:this.writeSection(e);break;case u.TextNodeType.listItem:case u.TextNodeType.taskItem:this.writeBullet(e);break;case u.TextNodeType.image:this.writeImage(e);break;case u.TextNodeType.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case u.TextNodeType.gap:case u.TextNodeType.select:case u.TextNodeType.highlight:this.writeBodyBit(e)}this.exitedCodeBlock=!1}handleBetweenNode(e){e.type}handleExitNode(e){switch(e.type){case u.TextNodeType.text:this.writeMarks(e,!1);break;case u.TextNodeType.paragraph:this.textFormat!==a.TextFormat.bitmarkMinusMinus&&this.writeNL();break;case u.TextNodeType.heading:case u.TextNodeType.section:case u.TextNodeType.image:this.writeNL(),this.writeNL();break;case u.TextNodeType.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent<=1&&this.writeNL()}this.handleDedent(e)}handleIndent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent--}}getLinkHref(e){if(e.type===u.TextNodeType.text&&e.marks){const t=e.marks.reduce(((e,t)=>{var r;if(t.type===l.TextMarkType.link){const e=null===(r=t.attrs)||void 0===r?void 0:r.href;if(e)return e}return e}),"");if(t)return t}return!1}getIndentationString(){if(this.currentIndent===this.prevIndent)return this.indentationStringCache;let e="";for(let t=1;t<this.currentIndent;t++)e+="\t";return this.indentationStringCache=e,this.prevIndent=this.currentIndent,e}writeBodyBit(e){const t=`[!${this.placeholderIndex}]`;this.writerText+=t,this.placeholders[t]=e,this.placeholderIndex++}writeText(e){if(null==e.text)return;if(this.writeLink(e))return;const t=this.inCodeBlock;let r=e.text;if(r=t?r.replace(y,"$1^"):r.replace(g,d),this.currentIndent>1){const e=this.getIndentationString();r=r.replace(f,`$1${e}`)}this.write(r)}writeLink(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r=e.text.replace(g,d);if(this.currentIndent>1){const e=this.getIndentationString();r=r.replace(f,`$1${e}`)}return t.replace(h,"$1")===r?this.write(t):(r=`==${r}==|link:${t}|`,this.write(r)),!0}return!1}writeMarks(e,t){if(e.marks){const r=1===e.marks.length,o=e.marks.reduce(((e,t)=>{if(e)return e;switch(t.type){case l.TextMarkType.bold:case l.TextMarkType.light:case l.TextMarkType.italic:case l.TextMarkType.highlight:return r?p[t.type]:"==";case l.TextMarkType.strike:case l.TextMarkType.sub:case l.TextMarkType.super:case l.TextMarkType.ins:case l.TextMarkType.del:case l.TextMarkType.var:case l.TextMarkType.code:case l.TextMarkType.color:case l.TextMarkType.comment:return"==";case l.TextMarkType.link:}return e}),void 0);if(null!=o&&(this.writeMarkTextWrapper(o),!t)){let t=!1;for(const o of e.marks)switch(o.type){case l.TextMarkType.bold:case l.TextMarkType.light:case l.TextMarkType.italic:case l.TextMarkType.highlight:r||(this.writeInlineMarkStartEnd(),this.writeInlineMark(o),t=!0);break;case l.TextMarkType.strike:case l.TextMarkType.sub:case l.TextMarkType.super:case l.TextMarkType.ins:case l.TextMarkType.del:case l.TextMarkType.var:case l.TextMarkType.code:case l.TextMarkType.color:this.writeInlineMarkStartEnd(),this.writeInlineMark(o),t=!0;break;case l.TextMarkType.comment:this.writeInlineMarkStartEnd(),this.writeCommentMark(o),t=!0;case l.TextMarkType.link:}t&&this.writeInlineMarkStartEnd()}}}writeParagraph(e){this.exitedCodeBlock&&(this.write("|"),this.writeNL(),this.writeNL())}writeHardBreak(e){if(this.writeNL(),this.currentIndent>1){const e=this.getIndentationString();this.write(e)}}writeHeading(e){var t,r;let o="";const i=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.level)&&void 0!==r?r:1;for(let e=0;e<+i;e++)o+="#";o+=" ",this.write(o)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e){var t,r;let o=this.getIndentationString();if(e.parent===u.TextNodeType.bulletList)o+="• ";else if(e.parent===u.TextNodeType.orderedList)o+="•1 ";else if(e.parent===u.TextNodeType.taskList){o+=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.checked)&&void 0!==r&&r?"•+ ":"•- "}o&&this.write(o)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs;let r=`|image:${t.src}|`;for(const[e,o]of Object.entries(t))switch(e){case"textAlign":"left"!==o&&(r+=`@captionAlign:${o}|`);break;case"title":o&&(r+=`@caption:${o}|`);break;case"class":"center"!==o&&o&&(r+=`@align:${o}|`);break;case"comment":o&&(r+=`#${o}|`);break;case"alt":case"width":case"height":default:o&&(r+=`@${e}:${o}|`);case"src":}this.write(r)}writeCodeBlock(e){if(null==e.attrs||!e.attrs.language)return;const t=`|code:${e.attrs.language}\n`;this.write(t)}writeMarkTextWrapper(e){e&&this.write(e)}writeInlineMark(e){let t=`${e.type}`;if(e.attrs)for(const[r,o]of Object.entries(e.attrs))("language"===r&&"plain text"!==o||"color"===r)&&(t=`${t}:${o}`);this.write(t)}writeCommentMark(e){if(e.comment){const t=`#${e.comment}`;this.write(t)}}writeInlineMarkStartEnd(){this.write("|")}writeString(e){null!=e&&this.write(`${e}`)}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}getBitType(e){for(const t of e)if(t.key===n.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}write(e){return this.writerText+=e,this}writeLine(e){return this.write(`${e}\n`),this}writeLines(e,t){for(const r of e)this.write(`${r}${null!=t?t:""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}}},7087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const o=r(1022),i=r(671);r(2606);let n=!1;t.init=function(){n||((0,i.initEnv)(o.buildInfo.name,o.buildInfo.version),n=!0)}},549:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeType=void 0;const o=(0,r(6688).superenum)({unknown:"unknown",bitType:"bitType",alias:"alias",root:"root",textFormat:"textFormat",bitmarkAst:"bitmarkAst",bits:"bits",bitsValue:"bitsValue",properties:"properties",property:"property",propertyValues:"propertyValues",itemLead:"itemLead",body:"body",bodyParts:"bodyParts",bodyPartsValue:"bodyPartsValue",bodyPartText:"bodyPartText",data:"data",bodyText:"bodyText",footer:"footer",footerText:"footerText",gap:"gap",select:"select",highlight:"highlight",cardNode:"cardNode",elements:"elements",solutions:"solutions",options:"options",optionsValue:"optionsValue",texts:"texts",textsValue:"textsValue",statement:"statement",statements:"statements",statementsValue:"statementsValue",choices:"choices",choicesValue:"choicesValue",responses:"responses",responsesValue:"responsesValue",quizzes:"quizzes",quizzesValue:"quizzesValue",heading:"heading",forValues:"forValues",pairs:"pairs",pairsValue:"pairsValue",values:"values",matrix:"matrix",matrixValue:"matrixValue",cells:"cells",cellsValue:"cellsValue",questions:"questions",questionsValue:"questionsValue",botResponses:"botResponses",botResponsesValue:"botResponsesValue",id:"id",idValue:"idValue",externalId:"externalId",externalIdValue:"externalIdValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",padletId:"padletId",padletIdValue:"padletIdValue",jupyterId:"jupyterId",jupyterIdValue:"jupyterIdValue",jupyterExecutionCount:"jupyterExecutionCount",jupyterExecutionCountValue:"jupyterExecutionCountValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",lang:"lang",langValue:"langValue",language:"language",languageValue:"languageValue",computerLanguage:"computerLanguage",computerLanguageValue:"computerLanguageValue",target:"target",targetValue:"targetValue",tag:"tag",tagValue:"tagValue",icon:"icon",iconValue:"iconValue",iconTag:"iconTag",iconTagValue:"iconTagValue",colorTag:"colorTag",colorTagValue:"colorTagValue",flashcardSet:"flashcardSet",flashcardSetValue:"flashcardSetValue",subtype:"subtype",subtypeValue:"subtypeValue",bookAlias:"bookAlias",bookAliasValue:"bookAliasValue",coverImage:"coverImage",coverImageValue:"coverImageValue",publisher:"publisher",publisherValue:"publisherValue",publications:"publications",publicationsValue:"publicationsValue",author:"author",authorValue:"authorValue",subject:"subject",subjectValue:"subjectValue",date:"date",dateValue:"dateValue",location:"location",locationValue:"locationValue",theme:"theme",themeValue:"themeValue",kind:"kind",kindValue:"kindValue",action:"action",actionValue:"actionValue",thumbImage:"thumbImage",thumbImageValue:"thumbImageValue",focusX:"focusX",focusXValue:"focusXValue",focusY:"focusY",focusYValue:"focusYValue",duration:"duration",durationValue:"durationValue",deeplink:"deeplink",deeplinkValue:"deeplinkValue",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",videoCallLinkValue:"videoCallLinkValue",bot:"bot",botValue:"botValue",referenceProperty:"referenceProperty",referencePropertyValue:"referencePropertyValue",list:"list",listValue:"listValue",textReference:"textReference",textReferenceValue:"textReferenceValue",isTracked:"isTracked",isTrackedValue:"isTrackedValue",isInfoOnly:"isInfoOnly",isInfoOnlyValue:"isInfoOnlyValue",labelTrue:"labelTrue",labelFalse:"labelFalse",content2Buy:"content2Buy",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",reasonableNumOfChars:"reasonableNumOfChars",reasonableNumOfCharsValue:"reasonableNumOfCharsValue",maxCreatedBits:"maxCreatedBits",maxCreatedBitsValue:"maxCreatedBitsValue",book:"book",item:"item",lead:"lead",hint:"hint",instruction:"instruction",isDefaultExample:"isDefaultExample",isExample:"isExample",example:"example",exampleValue:"exampleValue",extraProperties:"extraProperties",title:"title",subtitle:"subtitle",level:"level",toc:"toc",tocValue:"tocValue",progress:"progress",progressValue:"progressValue",anchor:"anchor",reference:"reference",referenceEnd:"referenceEnd",elementsValue:"elementsValue",solutionsValue:"solutionsValue",prefix:"prefix",postfix:"postfix",isCaseSensitive:"isCaseSensitive",isShortAnswer:"isShortAnswer",isCorrect:"isCorrect",forKeys:"forKeys",forValuesValue:"forValuesValue",key:"key",valuesValue:"valuesValue",question:"question",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",statementText:"statementText",text:"text",propertyKey:"propertyKey",propertyValue:"propertyValue",keyAudio:"keyAudio",keyImage:"keyImage",response:"response",reaction:"reaction",feedback:"feedback",imageSource:"imageSource",mockupId:"mockupId",size:"size",trim:"trim",partner:"partner",name:"name",avatarImage:"avatarImage",markConfig:"markConfig",markConfigValue:"markConfigValue",solution:"solution",mark:"mark",color:"color",emphasis:"emphasis",flashcards:"flashcards",flashcardsValue:"flashcardsValue",answer:"answer",alternativeAnswers:"alternativeAnswers",alternativeAnswersValue:"alternativeAnswersValue",resourceType:"resourceType",resources:"resources",resourcesValue:"resourcesValue",image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",audio:"audio",type:"type",typeAlias:"typeAlias",format:"format",value:"value",url:"url",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",width:"width",height:"height",alt:"alt",license:"license",copyright:"copyright",provider:"provider",showInIndex:"showInIndex",caption:"caption",posterImage:"posterImage",thumbnails:"thumbnails",thumbnailsValue:"thumbnailsValue",textAst:"textAst",textAstValue:"textAstValue",content:"contentValue",contentValue:"contentValue",contentValueValue:"contentValueValue",attrs:"attrs",section:"section",parent:"parent",marks:"marks",marksValue:"marksValue",comment:"comment",parser:"parser",version:"version",bitmarkVersion:"bitmarkVersion",warnings:"warnings",warningsValue:"warningsValue",errors:"errors",errorsValue:"errorsValue",message:"message",start:"start",end:"end",offset:"offset",line:"line",column:"column",markup:"markup"});t.NodeType=o},7200:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTagConfig=void 0;t.AbstractTagConfig=class{constructor(e,t,r,o,i,n,s,a,l){this.type=e,this.configKey=t,this.tag=r,this.maxCount=o,this.minCount=i,this.chain=n,this.jsonKey=s,this.astKey=a,this.deprecated=l}}},429:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitConfig=void 0;const o=r(1035);t.BitConfig=class{constructor(e,t,r,o,i,n,s,a,l,u,c,p,g){this.tags={},this.since=e,this.rootBitType=t.root,this.aliases=r,this.tags=o,this.cardSet=i,this.deprecated=n,this.bodyAllowed=s,this.bodyRequired=a,this.footerAllowed=l,this.footerRequired=u,this.resourceAttachmentAllowed=c,this.rootExampleType=p,this.comboResourceType=g}toString(e){const t=Object.assign({},e);let r=`[Bit]\n${this.rootBitType}`;this.aliases.length>0&&(r+="\n\n[Aliases]",r+=`\n${this.aliases.join(", ")}`);const i=[];null!=this.since&&i.push(`since=${this.since}`),null!=this.deprecated&&i.push(`deprecated=${this.deprecated}`),this.bodyAllowed&&i.push("bodyAllowed"),this.bodyRequired&&i.push("bodyRequired"),this.footerAllowed&&i.push("footerAllowed"),this.footerRequired&&i.push("footerRequired"),this.resourceAttachmentAllowed&&i.push("resourceAttachmentAllowed"),null!=this.rootExampleType&&i.push(`rootExampleType=${this.rootExampleType}`),null!=this.comboResourceType&&i.push(`comboResourceType=${this.comboResourceType}`),r+=`\n\n[Flags]\n${i.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))(e.maxCount===o.Count.infinity||e.maxCount>0)&&(r+=`\n${e.toString(t)}`);return this.cardSet&&(r+=`\n\n${this.cardSet.toString(t)}`),r}}},2005:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfig=void 0;t.CardSetConfig=class{constructor(e,t){this.configKey=e,this.variants=t}toString(e){const t=Object.assign({},e);let r="",o=0,i=0;for(const e of this.variants){for(const n of e)r+=`[Card - Side ${o}, Variant ${i}]`,r+=`\n${n.toString(t)}`,i++;o++}return r}}},3585:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardVariantConfig=void 0;t.CardVariantConfig=class{constructor(e,t,r,o){this.tags=e,this.bodyAllowed=t,this.bodyRequired=r,this.repeatCount=o}toString(e){const t=Object.assign({},e);let r="";const o=[];this.bodyAllowed&&o.push("bodyAllowed"),this.bodyRequired&&o.push("bodyRequired"),null!=this.repeatCount&&o.push(`repeatCount=${this.repeatCount}`),r+=`[Flags]\n${o.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))r+=`\n${e.toString(t)}`;return r}}},6620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MarkupTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,s){super(o.BitTagType.tag,e,t,r,i,n,void 0,void 0,s),this.type=o.BitTagType.tag}toString(e){const t=Object.assign({},e);let r=`TAG[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.MarkupTagConfig=n},6956:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,s,a,l,u,c,p){super(o.BitTagType.property,e,t,r,i,n,s,a,p),this.type=o.BitTagType.property,this.single=l,this.format=u,this.defaultValue=c}toString(e){const t=Object.assign({},e);let r=`PTY[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.single&&(r+=`, sgl=${this.single}`),null!=this.format&&(r+=`, fmt=${this.format}`),null!=this.defaultValue&&(r+=`, def=${this.defaultValue}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`),null!=this.astKey&&(r+=`, ast=${this.astKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.PropertyTagConfig=n},7585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,s,a){super(o.BitTagType.resource,e,t,r,i,n,s,void 0,a),this.type=o.BitTagType.resource}toString(e){const t=Object.assign({},e);let r=`RES[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.ResourceTagConfig=n},3059:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcesConfig=void 0;t.ResourcesConfig=class{constructor(e,t,r,o){this.tags=e,this.resourceAttachmentAllowed=null!=t&&t,this.resourceTypeAttachment=r,this.comboResourceTagTypesMap=o}getCountsMin(){const e=new Map;for(const t of Object.values(this.tags))null!=t.minCount&&e.set(t.tag,t.minCount);return e}getCountsMax(){const e=new Map;for(const t of Object.values(this.tags))null!=t.maxCount&&e.set(t.tag,t.maxCount);return e}}},2574:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfigKey=void 0;const o=(0,r(6688).superenum)({_flashcards:"_flashcards",_elements:"_elements",_statements:"_statements",_quiz:"_quiz",_questions:"_questions",_matchPairs:"_matchPairs",_matchAudioPairs:"_matchAudioPairs",_matchImagePairs:"_matchImagePairs",_matchMatrix:"_matchMatrix",_botActionResponses:"_botActionResponses"});t.CardSetConfigKey=o},8620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigKey=void 0;const o=r(6688),i=r(177),n=r(3518),s=r(6194),a=r(1595),l=(0,o.superenum)(Object.assign(Object.assign(Object.assign(Object.assign({_unknown:"_unknown"},a.tagConfigKeys),n.propertyConfigKeys),s.resourceConfigKeys),i.groupConfigKeys));t.ConfigKey=l,function(){const e=new Set,t=[a.tagConfigKeys,n.propertyConfigKeys,s.resourceConfigKeys,i.groupConfigKeys];for(const r of t)for(const t in r){if(e.has(t))throw new Error(`Duplicate ConfigKey: ${t}`);e.add(t)}}()},177:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.groupConfigKeys=t.GroupConfigKey=void 0;const o=r(6688),i={group_standardAllBits:"group_standardAllBits",group_standardItemLeadInstructionHint:"group_standardItemLeadInstructionHint",group_standardExample:"group_standardExample",group_standardTags:"group_standardTags",group_imageSource:"group_imageSource",group_partner:"group_partner",group_gap:"group_gap",group_trueFalse:"group_trueFalse",group_markConfig:"group_markConfig",group_mark:"group_mark",group_bookCommon:"group_bookCommon",group_learningPathCommon:"group_learningPathCommon",group_resourceCommon:"group_resourceCommon",group_resourceImageCommon:"group_resourceImageCommon",group_resourceAudioCommon:"group_resourceAudioCommon",group_resourceVideoCommon:"group_resourceVideoCommon",group_resourceImage:"group_resourceImage",group_resourceImageEmbed:"group_resourceImageEmbed",group_resourceImageLink:"group_resourceImageLink",group_resourceImageResponsive:"group_resourceImageResponsive",group_resourceImagePortrait:"group_resourceImagePortrait",group_resourceImageLandscape:"group_resourceImageLandscape",group_resourceAudio:"group_resourceAudio",group_resourceAudioEmbed:"group_resourceAudioEmbed",group_resourceAudioLink:"group_resourceAudioLink",group_resourceVideo:"group_resourceVideo",group_resourceVideoEmbed:"group_resourceVideoEmbed",group_resourceVideoLink:"group_resourceVideoLink",group_resourceStillImageFilm:"group_resourceStillImageFilm",group_resourceStillImageFilmEmbed:"group_resourceStillImageFilmEmbed",group_resourceStillImageFilmLink:"group_resourceStillImageFilmLink",group_resourceArticle:"group_resourceArticle",group_resourceArticleEmbed:"group_resourceArticleEmbed",group_resourceArticleLink:"group_resourceArticleLink",group_resourceDocument:"group_resourceDocument",group_resourceDocumentEmbed:"group_resourceDocumentEmbed",group_resourceDocumentLink:"group_resourceDocumentLink",group_resourceDocumentDownload:"group_resourceDocumentDownload",group_resourceAppLink:"group_resourceAppLink",group_resourceWebsiteLink:"group_resourceWebsiteLink"};t.groupConfigKeys=i;const n=(0,o.superenum)(i);t.GroupConfigKey=n},5428:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GroupConfigType=void 0;const o=(0,r(6688).superenum)({standard:"standard",resource:"resource",comboResource:"comboResource"});t.GroupConfigType=o},3518:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyConfigKeys=t.PropertyConfigKey=void 0;const o=r(6688),i={action:"action",ageRange:"ageRange",aiGenerated:"aiGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",caseSensitive:"caseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",longAnswer:"longAnswer",markConfig:"markConfig",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",posterImage:"posterImage",progress:"progress",property_mark:"property_mark",property_reference:"property_reference",property_sampleSolution:"property_sampleSolution",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",releaseVersion:"releaseVersion",shortAnswer:"shortAnswer",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width"};t.propertyConfigKeys=i;const n=(0,o.superenum)(i);t.PropertyConfigKey=n},6194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceConfigKeys=t.ResourceConfigKey=void 0;const o=r(6688),i={image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audio:"audio",audioEmbed:"audioEmbed",audioLink:"audioLink",video:"video",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",article:"article",articleEmbed:"articleEmbed",articleLink:"articleLink",document:"document",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"};t.resourceConfigKeys=i;const n=(0,o.superenum)(i);t.ResourceConfigKey=n},1595:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tagConfigKeys=t.TagConfigKey=void 0;const o=r(6688),i={title:"title",anchor:"anchor",tag_reference:"tag_reference",property:"property",itemLead:"itemLead",instruction:"instruction",hint:"hint",true:"true",false:"false",sampleSolution:"sampleSolution",gap:"gap",tag_mark:"tag_mark",resource:"resource",remark:"remark",comment:"comment"};t.tagConfigKeys=i;const n=(0,o.superenum)(i);t.TagConfigKey=n},742:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitTagType=void 0;const o=(0,r(6688).superenum)({tag:"tag",property:"property",resource:"resource",group:"group"});t.BitTagType=o},208:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AliasBitType=t.RootBitType=void 0;const o=r(6688),i=(0,o.superenum)({_error:"_error",appBitmarkFromJavascript:"app-bitmark-from-javascript",appFlashcards:"app-flashcards",appLink:"app-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",bitAlias:"bit-alias",book:"book",bookAlias:"book-alias",botActionResponse:"bot-action-response",botActionSend:"bot-action-send",browserImage:"browser-image",card1:"card-1",chapter:"chapter",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",code:"code",conversationLeft1:"conversation-left-1",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",essay:"essay",example:"example",flashcard:"flashcard",focusImage:"focus-image",highlightText:"highlight-text",image:"image",imageLink:"image-link",imageOnDevice:"image-on-device",imageResponsive:"image-responsive",internalLink:"internal-link",interview:"interview",learningPathBook:"learning-path-book",learningPathBotTraining:"learning-path-bot-training",learningPathExternalLink:"learning-path-external-link",learningPathVideoCall:"learning-path-video-call",mark:"mark",match:"match",matchAudio:"match-audio",matchMatrix:"match-matrix",matchPicture:"match-picture",multipleChoice:"multiple-choice",multipleChoice1:"multiple-choice-1",multipleChoiceText:"multiple-choice-text",multipleResponse:"multiple-response",multipleResponse1:"multiple-response-1",page:"page",pageBuyButton:"page-buy-button",photo:"photo",quote:"quote",rating:"rating",releaseNote:"release-note",sampleSolution:"sample-solution",sequence:"sequence",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",survey:"survey",surveyAnonymous:"survey-anonymous",toc:"toc",trueFalse:"true-false",trueFalse1:"true-false-1",vendorPadletEmbed:"vendor-padlet-embed",vendorJupyterOutput:"vendor-jupyter-output",video:"video",videoEmbed:"video-embed",videoLink:"video-link",websiteLink:"website-link"});t.RootBitType=i;const n=(0,o.superenum)({aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",appBitmarkFromEditor:"app-bitmark-from-editor",appCodeCell:"app-code-cell",appCodeEditor:"app-code-editor",appCodeIde:"app-code-ide",appCreateBitsFromImage:"app-create-bits-from-image",appFlashcardsLearn:"app-flashcards-learn",appFlashcardsQuiz:"app-flashcards-quiz",appGetScreenshot:"app-get-screenshot",articleAi:"article-ai",articleAttachment:"article-attachment",assignment:"assignment",audioTranscript:"audio-transcript",bitBookEnding:"bit-book-ending",bitBookSummary:"bit-book-summary",bitmarkExample:"bitmark-example",blogArticle:"blog-article",bookAcknowledgments:"book-acknowledgments",bookAddendum:"book-addendum",bookAfterword:"book-afterword",bookAppendix:"book-appendix",bookArticle:"book-article",bookAutherBio:"book-author-bio",bookBibliography:"book-bibliography",bookComingSoon:"book-coming-soon",bookConclusion:"book-conclusion",bookCopyright:"book-copyright",bookCopyrightPermissions:"book-copyright-permissions",bookDedication:"book-dedication",bookEndnotes:"book-endnotes",bookEpigraph:"book-epigraph",bookEpilogue:"book-epilogue",bookForword:"book-foreword",bookFrontispiece:"book-frontispiece",bookImprint:"book-imprint",bookIncitingIncident:"book-inciting-incident",bookIntroduction:"book-introduction",bookLink:"book-link",bookLinkNext:"book-link-next",bookLinkPrev:"book-link-prev",bookListOfContributors:"book-list-of-contributors",bookNotes:"book-notes",bookPostscript:"book-postscript",bookPreface:"book-preface",bookPrologue:"book-prologue",bookReadMore:"book-read-more",bookReferenceList:"book-reference-list",bookRequestForABookReview:"book-request-for-a-book-review",bookSummary:"book-summary",bookTeaser:"book-teaser",bookTitle:"book-title",botActionAnnounce:"bot-action-announce",botActionRatingNumber:"bot-action-rating-number",botActionRemind:"bot-action-remind",botActionSave:"bot-action-save",botActionTrueFalse:"bot-action-true-false",botInterview:"bot-interview",bug:"bug",buttonCopyText:"button-copy-text",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",clozeInstructionGrouped:"cloze-instruction-grouped",clozeSolutionGrouped:"cloze-solution-grouped",coachAudioTranscript:"coach-audio-transcript",coachCallToActionChecklist:"coach-call-to-action-checklist",coachCallToActionCloze:"coach-call-to-action-cloze",coachCallToActionClozeAndMultipleChoiceText:"coach-call-to-action-cloze-and-multiple-choice-text",coachCallToActionEssay:"coach-call-to-action-essay",coachCallToActionMultipleChoiceText:"coach-call-to-action-multiple-choice-text",coachHomeRules:"coach-home-rules",coachSelfReflectionCloze:"coach-self-reflection-cloze",coachSelfReflectionEssay:"coach-self-reflection-essay",coachSelfReflectionMultipleChoice:"coach-self-reflection-multiple-choice",coachSelfReflectionMultipleChoice1:"coach-self-reflection-multiple-choice-1",coachSelfReflectionMultipleChoiceText:"coach-self-reflection-multiple-choice-text",coachSelfReflectionMultipleResponse:"coach-self-reflection-multiple-response",coachSelfReflectionMultipleResponse1:"coach-self-reflection-multiple-response-1",coachSelfReflectionRating:"coach-self-reflection-rating",coachVideoTranscript:"coach-video-transcript",codeRuntime:"code-runtime",conclusion:"conclusion",consoleLog:"console-log",conversationLeft1Scream:"conversation-left-1-scream",conversationLeft1Thought:"conversation-left-1-thought",conversationRight1:"conversation-right-1",conversationRight1Scream:"conversation-right-1-scream",conversationRight1Thought:"conversation-right-1-thought",cookArrangement:"cook-arrangement",cookIngredients:"cook-ingredients",cookInsert:"cook-insert",cookPersonalRecommendation:"cook-personal-recommendation",cookPlate:"cook-plate",cookPracticeAdvise:"cook-practice-advise",cookPreparation:"cook-preparation",cookRecommendation:"cook-recommendation",cookRemark:"cook-remark",cookSideDish:"cook-side-dish",cookSideDrink:"cook-side-drink",cookStep:"cook-step",cookTimer:"cook-timer",cookVariation:"cook-variation",correction:"correction",danger:"danger",details:"details",details1:"details-1",detailsImage:"details-image",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",featured:"featured",figure:"figure",flashcard1:"flashcard-1",footNote:"foot-note",groupBorn:"group-born",groupDied:"group-died",help:"help",hint:"hint",imageBanner:"image-banner",imageFigure:"image-figure",imageLandscape:"image-landscape",imageMood:"image-mood",imagePortrait:"image-portrait",imagePrototype:"image-prototype",imageScreenshot:"image-screenshot",imageStyled:"image-styled",imageSuperWide:"image-super-wide",imageZoom:"image-zoom",info:"info",interviewInstructionGrouped:"interview-instruction-grouped",langAudioScript:"lang-audio-script",langEnablingLanguageSkills:"lang-enabling-language-skills",langEnglishAroundWorld:"lang-english-around-world",langExtraActivity:"lang-extra-activity",langGoodToKnow:"lang-good-to-know",langHomework:"lang-homework",langLearningGoal:"lang-learning-goal",langLearningOutcomes:"lang-learning-outcomes",langLearningStrategy:"lang-learning-strategy",langLevelDown:"lang-level-down",langLevelUp:"lang-level-up",langLifeSkillIcon:"lang-life-skill-icon",langLifeSkills:"lang-life-skills",langLikeALocal:"lang-like-a-local",langMaterial:"lang-material",langTeacherNote:"lang-teacher-note",langTeacherPronunciation:"lang-teacher-pronunciation",langUsefulPhrases:"lang-useful-phrases",langVideoScript:"lang-video-script",langVocabulary:"lang-vocabulary",learningPathClassroomEvent:"learning-path-classroom-event",learningPathClassroomTraining:"learning-path-classroom-training",learningPathClosing:"learning-path-closing",learningPathExternalLink:"learning-path-external-link",learningPathFeedback:"learning-path-feedback",learningPathLearningGoal:"learning-path-learning-goal",learningPathLti:"learning-path-lti",learningPathSign:"learning-path-sign",learningPathStep:"learning-path-step",learningPathVideoCall:"learning-path-video-call",lifeSkillSticker:"life-skill-sticker",matchAll:"match-all",matchAllReverse:"match-all-reverse",matchReverse:"match-reverse",matchSolutionGrouped:"match-solution-grouped",message:"message",newspaperArticle:"newspaper-article",note:"note",noteAi:"note-ai",notebookArticle:"notebook-article",output:"output",pageBanner:"page-banner",preparationNote:"preparation-note",question1:"question-1",recordAudio:"record-audio",releaseNotesSummary:"release-notes-summary",remark:"remark",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewNote:"review-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",screenshot:"screenshot",selfAssessment:"self-assessment",sideNote:"side-note",statement:"statement",stdout:"stdout",stickyNote:"sticky-note",summary:"summary",summaryAi:"summary-ai",survey1:"survey-1",surveyAnonymous1:"survey-anonymous-1",takePicture:"take-picture",vendorJupyterCellCode:"vendor-jupyter-cell-code",vendorJupyterCellMarkdown:"vendor-jupyter-cell-markdown",vendorJupyterCellRaw:"vendor-jupyter-cell-raw",vendorJupyterIpynb:"vendor-jupyter-ipynb",videoLandscape:"video-landscape",videoPortrait:"video-portrait",videoEmbedLandscape:"video-embed-landscape",videoEmbedPortrait:"video-embed-portrait",videoLinkLandscape:"video-link-landscape",videoLinkPortrait:"video-link-portrait",videoTranscript:"video-transcript",warning:"warning",workbookArticle:"workbook-article"});t.AliasBitType=n},6958:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParserType=void 0;const o=(0,r(6688).superenum)({peggy:"peggy"});t.BitmarkParserType=o},8791:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BITMARK_VERSION=t.BitmarkVersion=void 0;const o=(0,r(6688).superenum)({v2:2,v3:3});t.BitmarkVersion=o;const i=o.v3;t.DEFAULT_BITMARK_VERSION=i},1060:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BodyBitType=void 0;const o=(0,r(6688).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"});t.BodyBitType=o},8565:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetVersion=void 0;const o=(0,r(6688).superenum)({v1:1,v2:2});t.CardSetVersion=o},1035:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Count=void 0;const o=(0,r(6688).superenum)({infinity:"infinity"});t.Count=o},7028:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExampleType=void 0;const o=(0,r(6688).superenum)({none:"none",string:"string",boolean:"boolean"});t.ExampleType=o},7204:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyAstKey=void 0;const o=(0,r(6688).superenum)({aiGenerated:"aiGenerated",isCaseSensitive:"isCaseSensitive",referenceProperty:"referenceProperty",isShortAnswer:"isShortAnswer",markConfig:"markConfig"});t.PropertyAstKey=o},5486:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyFormat=void 0;const o=(0,r(6688).superenum)({none:"none",string:"string",trimmedString:"trimmedString",number:"number",boolean:"boolean",invertedBoolean:"invertedBoolean"});t.PropertyFormat=o},7572:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyJsonKey=void 0;const o=(0,r(6688).superenum)({caseSensitive:"isCaseSensitive",shortAnswer:"isShortAnswer"});t.PropertyJsonKey=o},7953:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTag=void 0;const o=(0,r(6688).superenum)({action:"action",ageRange:"ageRange",aiGenerated:"AIGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",caseSensitive:"caseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",longAnswer:"longAnswer",mark:"mark",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",posterImage:"posterImage",progress:"progress",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",reference:"reference",releaseVersion:"releaseVersion",sampleSolution:"sampleSolution",shortAnswer:"shortAnswer",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width"});t.PropertyTag=o},9431:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceJsonKey=void 0;const o=(0,r(6688).superenum)({imageResponsive:"imageResponsive",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audioEmbed:"audioEmbed",audioLink:"audioLink",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilm:"stillImageFilm",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",articleEmbed:"articleEmbed",articleLink:"articleLink",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"});t.ResourceJsonKey=o},9779:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTag=void 0;const o=(0,r(6688).superenum)({unknown:"unknown",image:"image",imageResponsive:"image-responsive",imagePortrait:"image-portrait",imageLandscape:"image-landscape",imageEmbed:"image-embed",imageLink:"image-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",video:"video",videoEmbed:"video-embed",videoLink:"video-link",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",document:"document",documentEmbed:"document-embed",documentLink:"document-link",documentDownload:"document-download",appLink:"app-link",websiteLink:"website-link"});t.ResourceTag=o},8739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const o=(0,r(6688).superenum)({title:"#",anchor:"▼",reference:"►",property:"@",itemLead:"%",instruction:"!",hint:"?",true:"+",false:"-",sampleSolution:"$",gap:"_",mark:"=",resource:"&",remark:"::",comment:"||"});t.Tag=o},1353:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFormat=void 0;const o=(0,r(6688).superenum)({text:"text",bitmarkMinusMinus:"bitmark--",bitmarkPlusPlus:"bitmark++"});t.TextFormat=o},1888:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextMarkType=void 0;const o=(0,r(6688).superenum)({bold:"bold",light:"light",italic:"italic",highlight:"highlight",strike:"strike",sub:"sub",super:"super",ins:"ins",del:"del",link:"link",var:"var",code:"code",color:"color",hash:"#",comment:"comment"});t.TextMarkType=o},2610:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextNodeType=void 0;const o=(0,r(6688).superenum)({text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",bulletList:"bulletList",orderedList:"orderedList",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",codeBlock:"codeBlock",gap:"gap",select:"select",highlight:"highlight"});t.TextNodeType=o},8681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoFormat=void 0;const o=(0,r(6688).superenum)({text:"text",json:"json",pojo:"pojo"});t.InfoFormat=o},7347:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoType=void 0;const o=(0,r(6688).superenum)({list:"list",deprecated:"deprecated",all:"all",bit:"bit"});t.InfoType=o},9556:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParser=void 0;const o=r(2434),i=r(8030);t.BitmarkParser=class{constructor(){this.jsonParser=new o.JsonParser}toAst(e,t){return(0,i.parse)(e)}}},8030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const o=r(4369).parse;t.parse=o},2892:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserHelper=void 0;const o=r(8565),i=r(3633),n=r(7542),s=r(6831);r(2606);t.BitmarkPegParserHelper=class{constructor(e){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0,this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation}handleRawBit(e){var t,r;const o=e.trim();if(this.debugPrint("RAW BIT",o),!o)return;const i=null!==(r=null===(t=this.parserLocation())||void 0===t?void 0:t.start)&&void 0!==r?r:{line:1,column:1,offset:0},s=this.parse(e,{startRule:"bit",grammarSource:new n.PeggyGrammarLocation("bit",i)});return s.value&&(s.value.markup=o),s}handleTextFormat(e){return{type:s.TypeKey.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:s.TypeKey.ResourceType,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleBitContent(e){let t=this.reduceToArrayOfTypes(e);return t=this.mergeCharToText(t),t}handleBitTag(e){return e}handleTag(e,t){return{type:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:s.TypeKey.Property,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){return{type:s.TypeKey.Resource,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let r=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),r=[e]}return r}handleCardSet(e){const t=e,r={cards:[]},o={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:o,parser:i}=e;if(!t||t!==s.TypeKey.Card)continue;const{cardIndex:n,cardSideIndex:a,cardVariantIndex:l,value:u}=o;let c=r.cards[n];c||(c={sides:[]},r.cards[n]=c);let p=c.sides[a];p||(p={variants:[]},c.sides[a]=p);p.variants[l]?p.variants[l].value+=u:p.variants[l]={value:u,parser:i}}r.cards=r.cards.filter((e=>e.sides.some((e=>e.variants.some((e=>0!==i.StringUtils.trimmedString(e.value).length))))));for(const t of r.cards){const r={sides:[]};o.cards.push(r);for(const o of t.sides){const t={variants:[]};r.sides.push(t);for(const r of o.variants){let o={line:1,column:1,offset:0};if(r.parser.location){o=r.parser.location.start;const e=r.parser.text,t=e?e.length:0,i=1;o.offset+=t,o.line+=i}let i=this.parse(r.value,{startRule:"cardContent",grammarSource:new n.PeggyGrammarLocation("card-content",o)});i=this.reduceToArrayOfTypes(i),this.debugPrint("parsedCardContent",i),t.variants.push({parser:e,content:i})}}}}return{type:s.TypeKey.CardSet,value:o,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSetStart(){this.cardIndex=-1,this.cardSideIndex=0,this.cardVariantIndex=0}handleCardSetEnd(){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0}handleCards(e){return e}handleCardLineOrDivider(e,t){let r=!1,i=!1,n=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===o.CardSetVersion.v1?(r=e===s.CARD_DIVIDER_V1,i=e===s.CARD_SIDE_DIVIDER_V1,n=e===s.CARD_VARIANT_DIVIDER_V1):(r=e===s.CARD_DIVIDER_V2,i=e===s.CARD_SIDE_DIVIDER_V2,n=e===s.CARD_VARIANT_DIVIDER_V2)),r?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):i?(this.cardSideIndex++,this.cardVariantIndex=0):n&&this.cardVariantIndex++,this.isType(e,s.TypeKey.Card)?e:{type:s.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:s.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:e},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardContent(e){return this.mergeCharToText(e)}handleCardTags(e){return e}mergeCharToText(e){var t,r,o,i,n,a;const l=[];let u,c;for(const p of e)switch(p.type){case s.TypeKey.BodyChar:if(u){const e=`${null!==(t=u.value)&&void 0!==t?t:""}${null!==(r=p.value)&&void 0!==r?r:""}`;u.value=e}else u={type:s.TypeKey.BodyText,value:null!==(o=p.value)&&void 0!==o?o:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case s.TypeKey.CardChar:if(c){const e=`${null!==(i=c.value)&&void 0!==i?i:""}${null!==(n=p.value)&&void 0!==n?n:""}`;c.value=e}else c={type:s.TypeKey.CardText,value:null!==(a=p.value)&&void 0!==a?a:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:u&&(l.push(u),u=void 0),c&&(l.push(c),c=void 0),l.push(p)}return u&&l.push(u),c&&l.push(c),l}isType(e,t){if(!e)return!1;const{type:r}=e;return t?Array.isArray(t)?t.indexOf(r)>=0:t===r:!!s.TypeKey.fromValue(r)}reduceToArrayOfTypes(e,t,r){if(!Array.isArray(e))return[];return e.reduce(((e,o,i)=>{if(null==o)return e;const{type:n,value:s}=o;if(Array.isArray(o)){const r=this.reduceToArrayOfTypes(o,t);e.push(...r)}else{if(!this.isType(o,t))return e;if(r&&Array.isArray(s)){const r=this.reduceToArrayOfTypes(s,t);e.push(...r)}else n&&e.push(o)}return e}),[])}debugPrint(e,t){}}},7448:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserProcessor=void 0;const i=r(9046),n=r(2606),s=r(208),a=r(1060),l=r(9779),u=r(1353),c=r(8386),p=r(1182),g=r(6934),d=r(8081),y=r(9577),f=r(2786),h=r(857),m=r(3287),T=r(3130),b=r(5516),v=r(1838),C=r(4177),x=r(6831),A=new i.Builder;t.BitmarkPegParserProcessor=class{constructor(e){this.nonFatalWarnings=[],this.nonFatalErrors=[],this.parser={},this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation,this.context={DEBUG_BIT_RAW:true,DEBUG_BIT_CONTENT_RAW:false,DEBUG_BIT_CONTENT:true,DEBUG_BIT_TAGS:true,DEBUG_BODY:true,DEBUG_FOOTER:true,DEBUG_CHAIN_CONTENT:true,DEBUG_CHAIN_TAGS:true,DEBUG_CARD_SET_CONTENT:true,DEBUG_CARD_SET:true,DEBUG_CARD_TAGS:true,parser:this.parser,parse:this.parse,bitContentProcessor:this.bitContentProcessor.bind(this),splitBitContent:this.splitBitContent.bind(this),addWarning:this.addWarning.bind(this),addError:this.addError.bind(this),debugPrint:this.debugPrint.bind(this),state:{}}}buildBits(e){var t;const r=[];let o=[];for(const i of e){if(!i)continue;const e=i.value;e?r.push(e):o=o.concat(null!==(t=i.errors)&&void 0!==t?t:[])}return A.bitmark({bits:r,errors:o.length>0?o:void 0})}buildBit(e,t){const{bitType:r,textFormat:i,resourceType:a}=e;if(!r||r.root===s.RootBitType._error)return this.invalidBit();const l=r.root===s.RootBitType.trueFalse1,u=r.root===s.RootBitType.multipleChoice1,g=r.root===s.RootBitType.multipleResponse1;this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=c.BitmarkPegParserValidator.validateBitTags(this.context,r,a,t);const d=n.Config.getBitConfig(r),y=this.bitContentProcessor(r,x.BitContentLevel.Bit,d.tags,t),{body:f,footer:h,cardSet:m,title:T,statement:C,statements:w,choices:k,responses:B,resources:P,comments:K}=y,S=o(y,["body","footer","cardSet","title","statement","statements","choices","responses","resources","comments"]);this.debugPrint("BIT TAGS",S),this.debugPrint("BIT BODY",f),this.debugPrint("BIT FOOTER",h);const _=(0,v.buildTitles)(this.context,r,T),R=(0,p.buildCards)(this.context,r,m,C,w,k,B),I=(0,b.buildResources)(this.context,r,a,P);(K||R.comments)&&(this.parser.comments=[],K&&this.parser.comments.push(...K),R.comments&&this.parser.comments.push(...R.comments));const O=this.buildBitLevelWarnings(),E=this.buildBitLevelErrors();O&&(this.parser.warnings=O),E&&(this.parser.errors=E);return{value:A.bit(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bitType:r,textFormat:i,resourceType:a},_),{statement:l?C:void 0,choices:u?k:void 0,responses:g?B:void 0}),S),{resources:I}),R),{body:f,footer:h,parser:this.parser}))}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:A.bit({bitType:n.Config.getBitType(s.RootBitType._error),parser:this.parser})}}buildBitHeader(e,t){var r;const o=n.Config.getBitType(e);return o.root===s.RootBitType._error&&this.addError(`Invalid bit type: '${e}'`),{bitType:o,textFormat:null!==(r=t.textFormat)&&void 0!==r?r:u.TextFormat.bitmarkMinusMinus,resourceType:t.resourceType}}buildTextAndResourceType(e,t){const r={textFormat:u.TextFormat.bitmarkMinusMinus},o=e=>{var t;e&&(e.type===x.TypeKey.TextFormat?(r.textFormat=u.TextFormat.fromValue(e.value),e.value&&!r.textFormat&&this.addWarning(`Invalid text format '${e.value}', defaulting to '${u.TextFormat.bitmarkMinusMinus}'`),r.textFormat=null!==(t=r.textFormat)&&void 0!==t?t:u.TextFormat.bitmarkMinusMinus):(r.resourceType=l.ResourceTag.fromValue(e.value),e.value&&!r.resourceType&&this.addWarning(`Invalid resource type '${e.value}', it will be ignored`)))};return o(e),o(t),r}resetParserState(){this.context.state={}}bitContentProcessor(e,t,r,o){const i={};if(!o)return i;i.title=[],i.solutions=[],i.statements=[],i.choices=[],i.responses=[],i.resources=[],i.trueFalse=[],i.markConfig=[],i.extraProperties={},i.comments=[];let n=!1,s=!1,a=!1;const l=[];let u="",p="",w="";const k=t===x.BitContentLevel.Chain,B=()=>{if(u){u=c.BitmarkPegParserValidator.checkBodyPart(this.context,e,t,u);const r=A.bodyText({text:u});l.push(r)}u=""};return o.forEach(((o,c)=>{const{type:A,value:P}=o;switch(A){case x.TypeKey.Comment:(0,g.commentTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.ItemLead:(0,f.itemLeadTagContentProcessor)(this.context,e,t,r,o,i,n),n=!0;break;case x.TypeKey.Instruction:case x.TypeKey.Hint:case x.TypeKey.Anchor:case x.TypeKey.SampleSolution:(0,d.defaultTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Reference:(0,T.referenceTagContentProcessor)(this.context,e,t,r,o,i,s),s=!0;break;case x.TypeKey.Title:(0,v.titleTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Property:(0,m.propertyContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Gap:k||B(),(0,y.gapChainContentProcessor)(this.context,e,t,r,o,i,l);break;case x.TypeKey.Mark:k||B(),(0,h.markChainContentProcessor)(this.context,e,t,r,o,i,l);break;case x.TypeKey.True:case x.TypeKey.False:k||B(),(0,C.trueFalseChainContentProcessor)(this.context,e,t,r,o,i,l);break;case x.TypeKey.Resource:(0,b.resourceContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.CardSet:i.cardSet=P,a=!0;break;case x.TypeKey.BodyText:a?p+=P:u+=P;break;case x.TypeKey.CardText:w+=P}})),B(),i.body=l.length>0?A.body({bodyParts:this.trimBodyParts(l)}):void 0,c.BitmarkPegParserValidator.checkBody(this.context,e,t,i.body),p=p.trim(),p&&(p=c.BitmarkPegParserValidator.checkFooter(this.context,e,t,p),p&&(i.footer=A.footerText({text:p}))),w=w.trim(),w&&(i.cardBody=w),0===Object.keys(i.extraProperties).length&&delete i.extraProperties,0===i.title.length&&delete i.title,0===i.solutions.length&&delete i.solutions,0===i.statements.length&&delete i.statements,0===i.choices.length&&delete i.choices,0===i.responses.length&&delete i.responses,0===i.trueFalse.length&&delete i.trueFalse,0===i.markConfig.length&&delete i.markConfig,0===i.resources.length&&delete i.resources,0===i.comments.length&&delete i.comments,i}buildBitLevelWarnings(){let e;return this.nonFatalWarnings.length>0&&(e=this.nonFatalWarnings,this.nonFatalWarnings=[]),e}buildBitLevelErrors(){let e;return this.nonFatalErrors.length>0&&(e=this.nonFatalErrors,this.nonFatalErrors=[]),e}splitBitContent(e,t){const r=[];let o=[];for(const i of e)t.includes(i.type)&&(o.length>0&&r.push(o),o=[]),o.push(i);return o.length>0&&r.push(o),r}trimBodyParts(e){let t=!1,r=e.reduce(((e,r)=>{const o=r;if(t||o.type!==a.BodyBitType.text)t=!0,e.push(r);else{const r=o.data.bodyText.trimStart();r&&(t=!0,o.data.bodyText=r,e.push(o))}return e}),[]);return t=!1,r=r.reduceRight(((e,r)=>{const o=r;if(t||o.type!==a.BodyBitType.text)t=!0,e.unshift(r);else{const r=o.data.bodyText.trimEnd();r&&(t=!0,o.data.bodyText=r,e.unshift(o))}return e}),[]),r}addWarning(e,t,r){var o,i,n;const s={message:e,text:null!==(o=null==t?void 0:t.parser.text)&&void 0!==o?o:this.parserText(),location:null!==(i=null==t?void 0:t.parser.location)&&void 0!==i?i:this.parserLocation(),original:null!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};s.original||delete s.original,this.nonFatalWarnings.push(s)}addError(e,t,r){var o,i,n;const s={message:e,text:null!==(o=null==t?void 0:t.parser.text)&&void 0!==o?o:this.parserText(),location:null!==(i=null==t?void 0:t.parser.location)&&void 0!==i?i:this.parserLocation(),original:null!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};s.original||delete s.original,this.nonFatalErrors.push(s)}debugPrint(e,t){}}},6831:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_VARIANT_DIVIDER_V1=t.CARD_SIDE_DIVIDER_V1=t.CARD_DIVIDER_V1=t.CARD_VARIANT_DIVIDER_V2=t.CARD_SIDE_DIVIDER_V2=t.CARD_DIVIDER_V2=t.BitContentLevel=t.TypeKey=void 0;const o=r(6688),i=r(8739);t.CARD_DIVIDER_V2="====";t.CARD_SIDE_DIVIDER_V2="--";t.CARD_VARIANT_DIVIDER_V2="++";t.CARD_DIVIDER_V1="===";t.CARD_SIDE_DIVIDER_V1="==";t.CARD_VARIANT_DIVIDER_V1="--";const n=(0,o.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:i.Tag.title,Anchor:i.Tag.anchor,Reference:i.Tag.reference,ItemLead:i.Tag.itemLead,Instruction:i.Tag.instruction,Hint:i.Tag.hint,True:i.Tag.true,False:i.Tag.false,Gap:i.Tag.gap,Mark:i.Tag.mark,SampleSolution:i.Tag.sampleSolution,Comment:i.Tag.comment,Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain"});t.TypeKey=n;const s=(0,o.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"});t.BitContentLevel=s},8386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserValidator=void 0;const o=r(2606),i=r(742),n=r(1035),s=r(6831),a=["====","----","\n==\n","\n---\n","\n--\n",":::","::::","|||","||||"],l=["==\n","---\n","--\n"],u=["\n==","\n---","\n--"];const c=new class{validateBitTags(e,t,r,i){if(!i)return[];const n=o.Config.getBitConfig(t),{tags:a,cardSet:l}=n,u=o.Config.getBitResourcesConfig(t,r),c=Object.assign(Object.assign({},a),u.tags);return this.validateTagChainsRecursive(e,t,s.BitContentLevel.Bit,i,c,l)}checkBody(e,t,r,i){if(!i)return i;const n=o.Config.getBitConfig(t),{bodyAllowed:s}=n;return i.bodyParts.length>0&&!s&&e.addWarning(`Bit '${t.alias}' should not have a body.`),i}checkBodyPart(e,t,r,o){return o?(this.checkBodyForCommonPotentialMistakes(e,r,t,o),o):o}checkFooter(e,t,r,i){if(!i)return i;const n=o.Config.getBitConfig(t),{footerAllowed:s}=n;return this.checkBodyForCommonPotentialMistakes(e,r,t,i),s||e.addWarning(`Bit '${t.alias}' should not have a footer.`),i}checkCardBody(e,t,r,i,n,s,a){if(!i)return i;const l=o.Config.getBitConfig(t);if(!l.cardSet)return i;const u=this.getVariantConfig(l.cardSet.variants,s,a);if(!u)return i;const{bodyAllowed:c}=u;return this.checkBodyForCommonPotentialMistakes(e,r,t,i),c||e.addWarning(`Bit '${t.alias}' should not have a card body at card:${n+1}, side:${s+1}, variant:${a+1}.`),i}validateTagChainsRecursive(e,t,r,o,i,a){if(!o)return[];const l=[...o],u=this.convertTagsToTypeKeyMap(e,r,t,i),c=(e,t,r)=>{u.set(e,{maxCount:t,minCount:r,_type:e,_tag:e,_seenCount:0})};c(s.TypeKey.Comment,n.Count.infinity,0),r===s.BitContentLevel.Bit?(a&&c(s.TypeKey.CardSet,1,0),c(s.TypeKey.TextFormat,1,0),c(s.TypeKey.BodyText,n.Count.infinity,0)):r===s.BitContentLevel.Card&&c(s.TypeKey.CardText,n.Count.infinity,0);for(let o=0;o<l.length;o++){const i=l[o];if(!i)continue;const{type:n,key:c}=i,p=s.TypeKey.fromValue(n);if(!p)continue;let g=p;p!==s.TypeKey.Property&&p!==s.TypeKey.Resource||(g=`${p}:${c}`);const d=u.get(g),y=this.validateSingleTag(e,t,r,i,p,d,a);if(y||l.splice(o,1,null),y&&Array.isArray(y.chain)&&y.chain.length>0)if(d&&d.chain){const r=this.validateTagChainsRecursive(e,t,s.BitContentLevel.Chain,y.chain,d.chain);r&&r.length>0?y.chain=r:y.chain=void 0}else y.type!==s.TypeKey.Resource&&(l.splice(o+1,0,...y.chain),y.chain=void 0)}for(const t of u.values()){const{minCount:r,_seenCount:o}=t;if(null!=r&&o<r){const o=`${this.getTagSignature(t)} is required at least ${r} time(s)`;e.addWarning(o)}}return l.filter((e=>null!=e))}validateSingleTag(e,t,r,o,i,n,a){const{type:l,key:u}=o,c=n?this.getTagSignature(n):this.getUnknownTagSignature(l,u),p=" It will be ignored";let g,d,y="";if(n)switch(n._seenCount++,i){case s.TypeKey.Property:{const{content:i,warning:s}=this.validatePropertyTag(e,r,t,n,o);g=i,d=s;break}case s.TypeKey.Resource:{const{content:i,warning:s}=this.validateResourceTag(e,r,t,n,o);g=i,d=s;break}case s.TypeKey.CardSet:{const{content:r,warning:i}=this.validateCardSet(e,t,n,o,a);g=r,d=i;break}default:{const{content:i,warning:s}=this.validateStandardTag(e,r,t,n,o);g=i,d=s}}else switch(i){case s.TypeKey.Property:d={extraProperty:!0},g=o;break;case s.TypeKey.Resource:d={excessResource:!0},g=o;break;default:d={invalid:!0}}if(d){const t=null==n?void 0:n._previous;d.invalid||d.excessResource?y=`${c} is not valid here.${p}`:null!=d.tooMany?(y=`${c} is included more than ${d.tooMany} time(s).`,d.tooMany>0&&(y+=" The earlier ones will be ignored")):d.extraProperty?y=`${c} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:d.unexpectedCardSet?y=`${c} is not expected here.${p}`:d.unexpectedCardSideVariant&&(y=`${c} has a card / side / variant that is not expected here.${p}`),e.addWarning(y,o,t)}return n&&(n._previous=o),g}validateStandardTag(e,t,r,o,i){const s=null==o.maxCount?1:o.maxCount;return s!==n.Count.infinity&&o._seenCount>s?{warning:{tooMany:s},content:i}:{content:i}}validatePropertyTag(e,t,r,o,i){const s=null==o.maxCount?1:o.maxCount;return s!==n.Count.infinity&&o._seenCount>s?{warning:{tooMany:s},content:i}:{content:i}}validateResourceTag(e,t,r,o,i){const s=null==o.maxCount?1:o.maxCount;return s!==n.Count.infinity&&o._seenCount>s?{warning:{tooMany:s},content:i}:{content:i}}validateCardSet(e,t,r,o,i){if(!i||!i.variants||0===i.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:n}=o,a=n;let l,u=0,c=0;for(const r of a.cards){u=0;for(const o of r.sides){c=0;for(const r of o.variants){const n=r.content;let a;const p=this.getVariantConfig(i.variants,u,c);p?a=this.validateTagChainsRecursive(e,t,s.BitContentLevel.Card,n,p.tags):l={unexpectedCardSideVariant:!0},a&&a.length>0?o.variants[c]={parser:r.parser,content:a}:o.variants[c]={parser:r.parser,content:[]},c++}u++}}return{content:o,warning:l}}checkBodyForCommonPotentialMistakes(e,t,r,o){if(o){for(const t of a)o.includes(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of l)o.startsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of u)o.endsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`)}}convertTagsToTypeKeyMap(e,t,r,o){const n=new Map;for(const e of Object.values(o)){const t={minCount:e.minCount,maxCount:e.maxCount,isTag:e.type===i.BitTagType.tag,isProperty:e.type===i.BitTagType.property,isResource:e.type===i.BitTagType.resource,chain:e.chain,_configKey:e.configKey,_type:e.type,_tag:e.tag,_seenCount:0,_previous:void 0};if(t.isProperty)n.set(`${s.TypeKey.Property}:${e.tag}`,t);else if(t.isResource)n.set(`${s.TypeKey.Resource}:${e.tag}`,t);else{const r=s.TypeKey.fromValue(e.tag);r&&n.set(r,t)}}return n}getVariantConfig(e,t,r){let o;if(0===e.length)return;const i=e[Math.min(t,e.length-1)],s=i.length-1;if(r>s){if(o=i[s],o.repeatCount!==n.Count.infinity)return}else o=i[r];return o}getTagSignature(e){switch(e._type){case i.BitTagType.tag:return`[${e._tag}]`;case i.BitTagType.property:return`[@${e._tag}]`;case i.BitTagType.resource:return`[&${e._tag}]`;default:return`'${e._type}' tag '${e._tag}'`}}getUnknownTagSignature(e,t){switch(e){case s.TypeKey.Property:return`[@${t}]`;case s.TypeKey.Resource:return`[&${t}]`;default:return`'${e}' tag '${t}'`}}};t.BitmarkPegParserValidator=c},7542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PeggyGrammarLocation=void 0;t.PeggyGrammarLocation=class{constructor(e,t){this.source=e,this.start=t}toString(){return String(this.source)}offset(e){return{line:e.line+this.start.line-1,column:1===e.line?e.column+this.start.column-1:e.column,offset:e.offset+this.start.offset}}static offsetStart(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.start):e.start}static offsetEnd(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.end):e.end}}},4185:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bookChainContentProcessor=void 0;const o=r(3633),i=r(6831);t.bookChainContentProcessor=function(e,t,r,n,s,a){if(r===i.BitContentLevel.Chain);else{const r=function(e,t,r,n,s){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",s);const a=e.bitContentProcessor(t,i.BitContentLevel.Chain,n,s.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",a);const{reference:l,referenceEnd:u}=a,c=o.StringUtils.trimmedString(s.value);return{book:c,reference:l,referenceEnd:u}}(e,t,0,n,s);a.book=r.book,a.reference=r.reference,a.referenceEnd=r.referenceEnd}}},1182:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.buildCards=void 0;const i=r(9046),n=r(2606),s=r(2574),a=r(208),l=r(9779),u=r(8386),c=r(6831),p=new i.Builder;t.buildCards=function(e,t,r,i,g,d,y){var f;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let h={};const m=function(e,t,r){const o={cards:[],comments:[]};if(!r)return o;let i=0,s=0,a=0;for(const l of r.cards){const r={no:i++,sides:[]};o.cards.push(r);for(const i of l.sides){const l={no:s++,variants:[]};r.sides.push(l);for(const p of i.variants){const{parser:i,content:g}=p,d={parser:i,no:a++};l.variants.push(d);const y=n.Config.getTagsConfigForCardSet(t,s,a),f=e.bitContentProcessor(t,c.BitContentLevel.Card,y,g);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",f),f.cardBody=u.BitmarkPegParserValidator.checkCardBody(e,t,c.BitContentLevel.Card,f.cardBody,r.no,l.no,d.no),d.data=f,f.comments&&o.comments.push(...f.comments)}a=0}s=0}return o}(e,t,r);switch(null===(f=n.Config.getBitConfig(t).cardSet)||void 0===f?void 0:f.configKey){case s.CardSetConfigKey._flashcards:h=function(e,t,r){const i=[];let n,s,l="",u=[],c=0,g=0,d={};const y=t.alias===a.AliasBitType.flashcard1;for(const a of r.cards){l="",n=void 0,u=[],g=0,d={};for(const e of a.sides)for(const t of e.variants){const e=t.data,{cardBody:r}=e,i=o(e,["cardBody"]);d=Object.assign(Object.assign({},d),i),0===g?(s=t,l=null!=r?r:""):1===g?n=null!=r?r:"":u.push(null!=r?r:""),g++}if(0!==c&&y){e.addWarning(`Bit '${t.alias}' should only contain one card. Ignore subsequent card: '${l}'`,s);break}i.push(p.flashcard(Object.assign({question:l,answer:n,alternativeAnswers:u.length>0?u:void 0},d))),c++}return{flashcards:i.length>0?i:void 0}}(e,t,m);break;case s.CardSetConfigKey._elements:h=function(e,t,r){var o;const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;i.push(null!==(o=t.cardBody)&&void 0!==o?o:"")}return{elements:i.length>0?i:void 0}}(0,0,m);break;case s.CardSetConfigKey._statements:h=function(e,t,r,i,n){const s=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{statements:r}=t,i=o(t,["statements"]);if(Array.isArray(r))for(const e of r){const t=p.statement(Object.assign(Object.assign(Object.assign({},e),e.itemLead),i));s.push(t)}}i&&s.push(i);Array.isArray(n)&&n.length>0&&s.push(...n);return{statements:s.length>0?s:void 0}}(0,0,m,i,g);break;case s.CardSetConfigKey._quiz:h=function(e,t,r,i,n){const s=[],l=t.root===a.RootBitType.multipleChoice,u=t.root===a.RootBitType.multipleResponse;if(!l&&!u)return{};let c,g=!1;for(const e of r.cards){g=!1,c="";for(const t of e.sides)for(const e of t.variants){const t=e.data,{isDefaultExample:r,example:i}=t,n=o(t,["isDefaultExample","example"]);if(g=!0===r||g,c=i||c,n.trueFalse&&n.trueFalse.length>0){const e=[],t=u?p.response:p.choice;for(const r of n.trueFalse){const{isDefaultExample:i,example:n}=r,s=o(r,["isDefaultExample","example"]),a=i||g,l=n||c,u=t(Object.assign(Object.assign({},s),{isDefaultExample:a,example:l}));e.push(u)}u?n.responses=e:n.choices=e}const a=p.quiz(Object.assign(Object.assign({},n),{isDefaultExample:g,example:c}));s.push(a)}}if(l&&Array.isArray(i)&&i.length>0){const e=p.quiz({choices:i});s.push(e)}if(u&&Array.isArray(n)&&n.length>0){const e=p.quiz({responses:n});s.push(e)}return{quizzes:s.length>0?s:void 0}}(0,t,m,d,y);break;case s.CardSetConfigKey._questions:h=function(e,t,r){var o;const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=p.question(Object.assign({question:null!==(o=t.cardBody)&&void 0!==o?o:""},t));i.push(r)}return{questions:i.length>0?i:void 0}}(0,0,m);break;case s.CardSetConfigKey._matchPairs:h=function(e,t,r){let i,n=0;const s=[];let a;const u=[];let c,g,d,y,f,h=[],m={},T=!1,b=!1;for(const e of r.cards){a=void 0,c=void 0,h=[],g=void 0,d=void 0,n=0,m={},b=!1,f="";for(const t of e.sides){for(const e of t.variants){const t=e.data,{cardBody:r,title:i,resources:s,isDefaultExample:p,example:v}=t,C=o(t,["cardBody","title","resources","isDefaultExample","example"]);b=!0===p||b,f=v||f;const x=i&&i[1];if(0===n)if(null!=x)a=x,T=!0===p||T,y=v||y;else if(Array.isArray(s)&&s.length>0){const e=s[0];e.type===l.ResourceTag.audio?g=e:e.type===l.ResourceTag.image&&(d=e)}else c=r;else if(null!=x)u.push(x),T=!0===p||T,y=v||y;else if(null==i){const e=null!=r?r:"";h.push(e),!T&&!b||f||(f=e)}m=Object.assign(Object.assign(Object.assign({},m),C),{isCaseSensitive:!0})}n++}if(null!=a)i=p.heading({forKeys:a,forValues:u});else{b&&(y=void 0);const e=b||T,t=f||y,r=p.pair(Object.assign(Object.assign({key:null!=c?c:"",keyAudio:g,keyImage:d,values:h,isShortAnswer:!0},m),{isDefaultExample:e,example:t}));s.push(r)}}return{heading:i,pairs:s.length>0?s:void 0}}(0,0,m);break;case s.CardSetConfigKey._matchMatrix:h=function(e,t,r){let i,n,s=0;const a=[];let l;const u=[];let c,g,d,y=[],f=[],h={},m=!1,T=!1,b=!1;for(const e of r.cards){n=void 0,l=void 0,y=[],f=[],s=0,T=!1,g="";for(const t of e.sides){f=[],h={},b=!1,d="";for(const e of t.variants){const t=e.data,{title:r,cardBody:i,isDefaultExample:u,example:p}=t,y=o(t,["title","cardBody","isDefaultExample","example"]);b=!0===u||b,d=p||d,Object.assign(h,y);const v=r&&r[1];if(0===s)null!=v?(n=v,m=!0===u||m,c=p||c):(l=i,T=!0===u||T,g=p||g);else if(null!=v)a.push(v),m=!0===u||m,c=p||c;else if(null==t.title){const e=null!=i?i:"";f.push(e),!m&&!b||d||(d=e)}}if(s>0){b&&(g=c=void 0),T&&(c=void 0);const e=b||T||m,t=d||g||c,r=p.matrixCell(Object.assign(Object.assign({values:f},h),{isDefaultExample:e,example:t}));y.push(r)}s++}if(null!=n)i=p.heading({forKeys:n,forValues:a});else{const e=p.matrix({key:null!=l?l:"",cells:y,isShortAnswer:!0,isCaseSensitive:!0});u.push(e)}}return{heading:i,matrix:u.length>0?u:void 0}}(0,0,m);break;case s.CardSetConfigKey._botActionResponses:h=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{instruction:r,reaction:n,cardBody:s}=t,a=o(t,["instruction","reaction","cardBody"]),l=p.botResponse(Object.assign({response:null!=r?r:"",reaction:null!=n?n:"",feedback:null!=s?s:""},a));i.push(l)}return{botResponses:i.length>0?i:void 0}}(0,0,m)}return h.comments=m.comments.length>0?m.comments:void 0,h}},4471:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clozeTagContentProcessor=void 0;const o=r(3633);t.clozeTagContentProcessor=function(e,t,r,i,n,s){const{value:a}=n,l=s.solutions;if(l&&o.StringUtils.isString(a)){const e=o.StringUtils.trimmedString(a);l.push(e)}}},6934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commentTagContentProcessor=void 0;const o=r(9046),i=r(3633),n=new o.Builder;t.commentTagContentProcessor=function(e,t,r,o,s,a){if(!a.comments)return;const{value:l}=s,u=i.StringUtils.isString(l)?l:"",c=n.comment({text:u,location:s.parser.location});a.comments.push(c)}},8081:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTagContentProcessor=void 0;const o=r(3633),i=r(6831);t.defaultTagContentProcessor=function(e,t,r,n,s,a){const{type:l,value:u}=s,c=o.StringUtils.trimmedString(u);switch(l){case i.TypeKey.Instruction:a.instruction=c;break;case i.TypeKey.Hint:a.hint=c;break;case i.TypeKey.Anchor:a.anchor=c;break;case i.TypeKey.Reference:a.reference=c;break;case i.TypeKey.SampleSolution:a.sampleSolution=c,e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",s)}}},4787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.exampleTagContentProcessor=void 0;const o=r(208),i=r(672);function n(e,t,r,o,i){!0===o?(i.isDefaultExample=!0,i.example=void 0):i.example=o}t.exampleTagContentProcessor=function(e,t,r,s,a){const{value:l}=s,u=l;switch(t.root){case o.RootBitType.cloze:case o.RootBitType.clozeAndMultipleChoiceText:case o.RootBitType.multipleChoiceText:case o.RootBitType.highlightText:case o.RootBitType.trueFalse:case o.RootBitType.trueFalse1:case o.RootBitType.multipleResponse:case o.RootBitType.multipleResponse1:case o.RootBitType.multipleChoice:case o.RootBitType.multipleChoice1:!function(e,t,r,s,a){var l,u;let c;Array.isArray(a.trueFalse)&&a.trueFalse.length>0&&(c=null!==(l=a.trueFalse[a.trueFalse.length-1])&&void 0!==l?l:void 0);if(c)!0===s?(c.isDefaultExample=!0,c.example=void 0):i.BooleanUtils.isBooleanString(s)?c.example=s:(c.isDefaultExample=!0,c.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r));else if(Array.isArray(a.solutions)&&a.solutions.length>0)a.example=!0===s?null!==(u=a.solutions[a.solutions.length-1])&&void 0!==u?u:void 0:s;else switch(t.root){default:case o.RootBitType.cloze:n(e,t,r,s,a);break;case o.RootBitType.multipleChoiceText:case o.RootBitType.highlightText:case o.RootBitType.trueFalse:case o.RootBitType.trueFalse1:case o.RootBitType.multipleResponse:case o.RootBitType.multipleResponse1:!function(e,t,r,o,n){!0===o?(n.isDefaultExample=!0,n.example=void 0):i.BooleanUtils.isBooleanString(o)?n.example=o:(n.isDefaultExample=!0,n.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r))}(e,0,r,s,a);break;case o.RootBitType.clozeAndMultipleChoiceText:case o.RootBitType.multipleChoice:case o.RootBitType.multipleChoice1:a.isDefaultExample=!0,a.example=void 0,!0!==s&&e.addWarning("At this level, only default [@example] is allowed, using default",r)}}(e,t,s,u,a);break;case o.RootBitType.mark:!function(e,t,r,o,i){i.isDefaultExample=!0,i.example=void 0,!0!==o&&e.addWarning("Only default [@example] is allowed, using default",r)}(e,0,s,u,a);break;default:n(e,t,s,u,a)}}},9577:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.gapChainContentProcessor=void 0;const i=r(9046),n=r(2606),s=r(4471),a=r(6831),l=new i.Builder;t.gapChainContentProcessor=function(e,t,r,i,u,c,p){if(r===a.BitContentLevel.Chain)(0,s.clozeTagContentProcessor)(e,t,r,i,u,c);else{const r=function(e,t,r,i,s){var u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",s);const c=n.Config.getTagConfigForTag(i,s.type),p=[s,...null!==(u=s.chain)&&void 0!==u?u:[]],g=e.bitContentProcessor(t,a.BitContentLevel.Chain,null==c?void 0:c.chain,p);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",g);const{solutions:d}=g,y=o(g,["solutions"]),f=l.gap(Object.assign(Object.assign({solutions:null!=d?d:[]},y),{isCaseSensitive:!0}));return f}(e,t,0,i,u);r&&p.push(r)}}},8664:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.imageSourceChainContentProcessor=void 0;const i=r(9046),n=r(2606),s=r(3633),a=r(6831),l=new i.Builder;t.imageSourceChainContentProcessor=function(e,t,r,i,u,c){r===a.BitContentLevel.Chain?function(e,t,r,o,i,n){const{value:a}=i,l=s.StringUtils.trimmedString(a);n.imageSourceUrl=l}(0,0,0,0,u,c):function(e,t,r,i,s,u){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",s);const{key:c}=s,p=n.Config.getTagConfigForTag(i,c),g=e.bitContentProcessor(t,a.BitContentLevel.Chain,i,[s]),d=e.bitContentProcessor(t,a.BitContentLevel.Chain,null==p?void 0:p.chain,s.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",d);const{imageSourceUrl:y}=g,{mockupId:f}=d,h=o(d,["mockupId"]);y||e.addWarning("[@imageSource] is missing the image url",s);f||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",s);const m=l.imageSource(Object.assign({url:null!=y?y:"",mockupId:null!=f?f:""},h));u.imageSource=m}(e,t,0,i,u,c)}},2786:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemLeadTagContentProcessor=void 0;const o=r(3633);t.itemLeadTagContentProcessor=function(e,t,r,i,n,s,a){const{value:l}=n,u=o.StringUtils.trimmedString(l);a?s.lead=u:s.item=u}},857:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markChainContentProcessor=void 0;const i=r(9046),n=r(2606),s=r(7646),a=r(3298),l=r(6831),u=new i.Builder;t.markChainContentProcessor=function(e,t,r,i,c,p,g){if(r===l.BitContentLevel.Chain)(0,a.markTagContentProcessor)(e,l.BitContentLevel.Chain,t,c,p);else{const r=function(e,t,r,i,a){var c;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",a);const p=n.Config.getTagConfigForTag(i,a.type),g=e.bitContentProcessor(t,l.BitContentLevel.Chain,i,[a]),d=e.bitContentProcessor(t,l.BitContentLevel.Chain,null==p?void 0:p.chain,a.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",d);const{solution:y}=g,{mark:f}=d,h=o(d,["mark"]),m=u.mark(Object.assign({solution:null!=y?y:"",mark:null!==(c=s.ArrayUtils.asSingle(f))&&void 0!==c?c:""},h));return m}(e,t,0,i,c);r&&g.push(r)}}},2595:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markConfigChainContentProcessor=void 0;const i=r(9046),n=r(2606),s=r(3633),a=r(6831),l=new i.Builder;t.markConfigChainContentProcessor=function(e,t,r,i,u,c){var p;const{key:g}=u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",u);const d=c.markConfig;if(!d)return;const y=n.Config.getTagConfigForTag(i,g),f=e.bitContentProcessor(t,a.BitContentLevel.Chain,null==y?void 0:y.chain,u.chain),{mark:h}=f,m=o(f,["mark"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",m);const T=null!==(p=s.StringUtils.trimmedString(u.value))&&void 0!==p?p:"unknown",b=l.markConfig(Object.assign({mark:T,emphasis:"underline"},m));d.push(b)}},3298:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.markTagContentProcessor=void 0;const o=r(3633);t.markTagContentProcessor=function(e,t,r,i,n){const{value:s}=i;o.StringUtils.isString(s)&&(n.solution=s)}},8326:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.partnerChainContentProcessor=void 0;const o=r(9046),i=r(9779),n=r(3633),s=r(6831),a=new o.Builder;t.partnerChainContentProcessor=function(e,t,r,o,l,u){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("partner content",l);const c=e.bitContentProcessor(t,s.BitContentLevel.Chain,o,l.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("partner TAGS",c);const{resources:p}=c,g=n.StringUtils.trimmedString(l.value),d=function(e,t){let r;const o=[];if(t)for(const e of t.reverse())r||i.ResourceTag.image!==e.type?o.push(e):r=e;o.length>0&&(e.parser.excessResources=o,e.addWarning(`${o.length} excess resource(s) present in the [@parter] chain.`));return r}(e,p),y=a.partner({name:g,avatarImage:d});u.partner=y}},3287:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyContentProcessor=void 0;const o=r(2606),i=r(3518),n=r(5486),s=r(672),a=r(994),l=r(3633),u=r(4185),c=r(4787),p=r(8664),g=r(2595),d=r(8326),y=r(6831);t.propertyContentProcessor=function(e,t,r,f,h,m){const{key:T,value:b}=h,v=r===y.BitContentLevel.Chain,C=o.Config.getTagConfigForTag(f,T),x=C?C.configKey:void 0;if(C){if(x===i.PropertyConfigKey.example)return void(0,c.exampleTagContentProcessor)(e,t,r,h,m);if(x===i.PropertyConfigKey.partner)return void(0,d.partnerChainContentProcessor)(e,t,r,C.chain,h,m);if(x===i.PropertyConfigKey.imageSource)return void(0,p.imageSourceChainContentProcessor)(e,t,r,f,h,m);if(x===i.PropertyConfigKey.book)return void(0,u.bookChainContentProcessor)(e,t,r,C.chain,h,m);if(x===i.PropertyConfigKey.markConfig&&!v)return void(0,g.markConfigChainContentProcessor)(e,t,r,f,h,m)}const A=(e,t,r,o)=>{if(r=(e=>{if(null!=e){if(o)switch(o.format){case n.PropertyFormat.string:return l.StringUtils.isString(e)?l.StringUtils.string(e):void 0;case n.PropertyFormat.trimmedString:return l.StringUtils.isString(e)?l.StringUtils.trimmedString(e):void 0;case n.PropertyFormat.number:return a.NumberUtils.asNumber(e);case n.PropertyFormat.boolean:return s.BooleanUtils.toBoolean(e,!0);case n.PropertyFormat.invertedBoolean:return!s.BooleanUtils.toBoolean(e,!0)}return e}})(r),(null==o?void 0:o.astKey)&&(t=o.astKey),null==o?void 0:o.single)e[t]=r;else if(Object.prototype.hasOwnProperty.call(e,t)){const o=e[t];e[t]=[...o,r]}else e[t]=[r]};A(C?m:m.extraProperties,T,b,C)}},3130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.referenceTagContentProcessor=void 0;const o=r(3633);t.referenceTagContentProcessor=function(e,t,r,i,n,s,a){const{value:l}=n,u=o.StringUtils.trimmedString(l);a?s.referenceEnd=u:s.reference=u}},5516:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceContentProcessor=t.buildResources=void 0;const o=r(8703),i=r(2606),n=r(1035),s=r(9779),a=r(6831),l=new o.ResourceBuilder;t.buildResources=function(e,t,r,o){var a,l;const u=[],c=[],p=s.ResourceTag.fromValue(r),g=i.Config.getBitResourcesConfig(t,p),d=g.resourceAttachmentAllowed,y=g.getCountsMin(),f=g.getCountsMax();if(o)for(const e of o.reverse()){let t=null!==(a=y.get(e.typeAlias))&&void 0!==a?a:0,r=null!==(l=f.get(e.typeAlias))&&void 0!==l?l:0;t=Math.max(0,t-1),r===n.Count.infinity?u.unshift(e):r>0?(u.unshift(e),r--):c.unshift(e),y.set(e.typeAlias,t),f.set(e.typeAlias,r)}if(!d&&r){const t=`Resource type [&${r}] is specified in the bit header, but no extra resource is allowed for this bit.`;e.addWarning(t)}else 0===u.length&&r&&e.addWarning(`Resource type [&${r}] is specified in the bit header, but no such a resource is present`);return c.length>0&&(e.parser.excessResources=c),u},t.resourceContentProcessor=function(e,t,r,o,n,u){const{type:c,key:p,value:g,chain:d}=n,y=u.resources;if(!y)return;const f=s.ResourceTag.fromValue(p);if(f){const r=i.Config.getTagConfigForTag(o,p),n=e.bitContentProcessor(t,a.BitContentLevel.Chain,null==r?void 0:r.chain,d),s=l.resource(Object.assign({type:f,value:g},n));s&&y.push(s)}}},1838:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildTitles=t.titleTagContentProcessor=void 0;const o=r(208),i=r(3633);t.titleTagContentProcessor=function(e,t,r,o,n,s){const{value:a}=n,l=s.title;if(!l)return;const u=a,c=i.StringUtils.trimmedString(u.title);l[u.level.length]=c},t.buildTitles=function(e,t,r){var i,n;switch(r=null!=r?r:[],t.root){case o.RootBitType.chapter:{let e;return r.length>0&&(e=r[r.length-1]),{title:e,level:r.length>0?r.length-1:void 0}}case o.RootBitType.book:default:return{title:null!==(i=r[1])&&void 0!==i?i:void 0,subtitle:null!==(n=r[2])&&void 0!==n?n:void 0}}}},4177:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseChainContentProcessor=void 0;const i=r(9046),n=r(208),s=r(8660),a=r(6831),l=new i.Builder;t.trueFalseChainContentProcessor=function(e,t,r,i,u,c,p){r===a.BitContentLevel.Chain?(0,s.trueFalseTagContentProcessor)(e,a.BitContentLevel.Chain,t,u,c):function(e,t,r,i,s,u,c){var p;const g=[s,...null!==(p=s.chain)&&void 0!==p?p:[]],d=u.statements,y=u.choices,f=u.responses;if(!(d&&y&&f&&c))return;if(t.root===n.RootBitType.trueFalse1)u.statement=function(e,t,r,i){if(t.root!==n.RootBitType.trueFalse1)return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",i);const s=e.bitContentProcessor(t,a.BitContentLevel.Chain,r,i),{trueFalse:u}=s,c=o(s,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",c);let p;u&&u.length>0&&(p=l.statement(Object.assign(Object.assign({},u[0]),c)));return p}(e,t,i,g);else if(t.root===n.RootBitType.trueFalse||t.root===n.RootBitType.multipleChoice||t.root===n.RootBitType.multipleChoice1||t.root===n.RootBitType.multipleResponse||t.root===n.RootBitType.multipleResponse1){const r=function(e,t,r,i){const s=t.root===n.RootBitType.trueFalse,u=t.root===n.RootBitType.multipleChoice||t.root===n.RootBitType.multipleChoice1,c=t.root===n.RootBitType.multipleResponse||t.root===n.RootBitType.multipleResponse1;if(!s&&!u&&!c)return{};const p=[],g=[],d=[],y=e.splitBitContent(i,[a.TypeKey.True,a.TypeKey.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",y);for(const i of y){const n=e.bitContentProcessor(t,a.BitContentLevel.Chain,r,i),{trueFalse:y}=n,f=o(n,["trueFalse"]);if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",f),s){if(y&&y.length>0){const e=l.statement(Object.assign(Object.assign({},y[0]),f));p.push(e)}}else if(u){if(y&&y.length>0){const e=l.choice(Object.assign(Object.assign({},y[0]),f));g.push(e)}}else if(c&&y&&y.length>0){const e=l.response(Object.assign(Object.assign({},y[0]),f));d.push(e)}}const f={};s?f.statements=p:u?f.choices=g:c&&(f.responses=d);return f}(e,t,i,g);r.statements&&d.push(...r.statements),r.choices&&y.push(...r.choices),r.responses&&f.push(...r.responses)}else if(t.root===n.RootBitType.highlightText){const r=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",i);const n=e.bitContentProcessor(t,a.BitContentLevel.Chain,r,i),{trueFalse:s}=n,u=o(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",Object.assign({trueFalse:s},u));const c=[];if(s)for(const e of s)c.push(l.highlightText(Object.assign(Object.assign({},e),{isHighlighted:!1})));const p=l.highlight(Object.assign({texts:c},u));return p}(e,t,i,g);r&&c.push(r)}else{const r=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",i);const n=e.bitContentProcessor(t,a.BitContentLevel.Chain,r,i),{trueFalse:s}=n,u=o(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",Object.assign({trueFalse:s},u));const c=[];if(s)for(const e of s)c.push(l.selectOption(e));const p=l.select(Object.assign({options:c},u));return p}(e,t,i,g);r&&c.push(r)}}(e,t,0,i,u,c,p)}},8660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseTagContentProcessor=void 0;const o=r(3633),i=r(6831);t.trueFalseTagContentProcessor=function(e,t,r,n,s){const{type:a,value:l}=n,u=s.trueFalse;if(!u)return;const c=o.StringUtils.trimmedString(l);u.push({text:c,isCorrect:a===i.TypeKey.True,isDefaultExample:!1})}},2434:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonParser=void 0;const o=r(9046),i=r(8703),n=r(2606),s=r(6300),a=r(208),l=r(1060),u=r(9779),c=r(1353),p=r(3633),g=new o.Builder,d=new i.ResourceBuilder;t.JsonParser=class{constructor(){this.textGenerator=new s.TextGenerator}toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t}=e,o=this.bitToAst(t);o&&r.push(o)}const o=r.length>0?{bits:r}:{};return g.bitmark(o)}preprocessJson(e){const t=[];if(p.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const r=e=>{if(this.isBitWrapper(e)){const r=e;t.push(r)}else if(this.isBit(e)){const r=e;t.push(this.bitToBitWrapper(r))}};if(Array.isArray(e))for(const t of e)r(t);else r(e);return t}isBitWrapper(e){if(Object.prototype.hasOwnProperty.call(e,"bit")){const t=e;return this.isBit(t.bit)}return!1}isBit(e){if(Object.prototype.hasOwnProperty.call(e,"type")){const t=e;return n.Config.getBitType(t.type).root!==a.RootBitType._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e){var t;const{type:r,format:o,id:i,externalId:s,spaceId:a,padletId:l,jupyterId:u,jupyterExecutionCount:p,AIGenerated:d,releaseVersion:y,ageRange:f,lang:h,language:m,computerLanguage:T,target:b,tag:v,icon:C,iconTag:x,colorTag:A,flashcardSet:w,subtype:k,bookAlias:B,coverImage:P,publisher:K,publications:S,author:_,date:R,location:I,theme:O,kind:E,action:L,thumbImage:j,focusX:V,focusY:F,duration:G,deeplink:N,externalLink:D,externalLinkText:U,videoCallLink:M,bot:$,list:J,textReference:q,isTracked:H,isInfoOnly:z,labelTrue:W,labelFalse:Y,content2Buy:X,quotedPerson:Z,reasonableNumOfChars:Q,maxCreatedBits:ee,book:te,title:re,subtitle:oe,level:ie,toc:ne,progress:se,anchor:ae,reference:le,referenceEnd:ue,item:ce,lead:pe,hint:ge,instruction:de,example:ye,imageSource:fe,partner:he,marks:me,resource:Te,body:be,sampleSolution:ve,elements:Ce,statement:xe,isCorrect:Ae,cards:we,statements:ke,responses:Be,quizzes:Pe,heading:Ke,pairs:Se,matrix:_e,choices:Re,questions:Ie,footer:Oe,placeholders:Ee}=e,Le=n.Config.getBitType(r),je=null!==(t=c.TextFormat.fromValue(o))&&void 0!==t?t:c.TextFormat.bitmarkMinusMinus,Ve=this.getResourceType(Te),Fe=this.resourceBitToAst(Te),Ge=this.bodyToAst(be,je,Ee),Ne=this.imageSourceBitToAst(fe),De=this.partnerBitToAst(he),Ue=this.markConfigBitToAst(me),Me=this.flashcardBitsToAst(we),$e=this.statementBitsToAst(xe,Ae,ke,ye),Je=this.responseBitsToAst(Le,Be),qe=this.quizBitsToAst(Le,Pe),He=this.headingBitToAst(Ke),ze=this.pairBitsToAst(Se),We=this.matrixBitsToAst(_e),Ye=this.choiceBitsToAst(Re),Xe=this.questionBitsToAst(Ie),Ze=this.botResponseBitsToAst(Le,Be),Qe=this.footerToAst(Oe,je),{reference:et,referenceProperty:tt}=this.referenceToAst(le);return g.bit(Object.assign(Object.assign(Object.assign({bitType:Le,textFormat:o,resourceType:Ve,id:i,externalId:s,spaceId:a,padletId:l,jupyterId:u,jupyterExecutionCount:p,aiGenerated:d,releaseVersion:y,ageRange:f,lang:h,language:m,computerLanguage:T,target:b,tag:v,icon:C,iconTag:x,colorTag:A,flashcardSet:w,subtype:k,bookAlias:B,coverImage:P,publisher:K,publications:S,author:_,date:R,location:I,theme:O,kind:E,action:L,duration:G,referenceProperty:tt,thumbImage:j,focusX:V,focusY:F,deeplink:N,externalLink:D,externalLinkText:U,videoCallLink:M,bot:$,list:J,textReference:q,isTracked:H,isInfoOnly:z,labelTrue:W,labelFalse:Y,content2Buy:X,quotedPerson:Z,reasonableNumOfChars:Q,maxCreatedBits:ee,book:te,title:this.parseText(re),subtitle:this.parseText(oe),level:ie,toc:ne,progress:se,anchor:ae,reference:et,referenceEnd:ue},this.parseItemLeadHintInstruction(ce,pe,ge,de)),this.parseExample(ye)),{imageSource:Ne,partner:De,markConfig:Ue,resources:Fe,body:Ge,sampleSolution:ve,elements:Ce,flashcards:Me,statements:$e,responses:Je,quizzes:qe,heading:He,pairs:ze,matrix:We,choices:Ye,questions:Xe,botResponses:Ze,footer:Qe}))}imageSourceBitToAst(e){let t;if(e){const{url:r,mockupId:o,format:i,size:n,trim:s}=e;t=g.imageSource({url:r,mockupId:o,format:i,size:n,trim:s})}return t}partnerBitToAst(e){let t;if(e){const r=this.resourceDataToAst(u.ResourceTag.image,e.avatarImage);t=g.partner({name:e.name,avatarImage:r})}return t}markConfigBitToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{mark:e,color:o,emphasis:i}=r,n=g.markConfig({mark:e,color:o,emphasis:i});t.push(n)}if(0!==t.length)return t}flashcardBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{question:e,answer:o,alternativeAnswers:i,item:n,lead:s,hint:a,instruction:l,example:u}=r,c=g.flashcard(Object.assign(Object.assign({question:e,answer:o,alternativeAnswers:i},this.parseItemLeadHintInstruction(n,s,a,l)),this.parseExample(u)));t.push(c)}if(0!==t.length)return t}statementBitsToAst(e,t,r,o){const i=[];if(e){const r=g.statement(Object.assign({text:e,isCorrect:null!=t&&t},this.parseExample(o)));i.push(r)}if(Array.isArray(r))for(const e of r){const{statement:t,isCorrect:r,item:o,lead:n,hint:s,instruction:a,example:l,isCaseSensitive:u}=e,c=g.statement(Object.assign(Object.assign(Object.assign({text:t,isCorrect:r},this.parseItemLeadHintInstruction(o,n,s,a)),this.parseExample(l)),{isCaseSensitive:u}));i.push(c)}if(0!==i.length)return i}choiceBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{choice:e,isCorrect:o,item:i,lead:n,hint:s,instruction:a,example:l,isCaseSensitive:u}=r,c=g.choice(Object.assign(Object.assign(Object.assign({text:e,isCorrect:o},this.parseItemLeadHintInstruction(i,n,s,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}if(0!==t.length)return t}responseBitsToAst(e,t){const r=[];if(e.root!==a.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,isCorrect:o,item:i,lead:n,hint:s,instruction:a,example:l,isCaseSensitive:u}=e,c=g.response(Object.assign(Object.assign(Object.assign({text:t,isCorrect:o},this.parseItemLeadHintInstruction(i,n,s,a)),this.parseExample(l)),{isCaseSensitive:u}));r.push(c)}if(0!==r.length)return r}}selectOptionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:o,item:i,lead:n,hint:s,instruction:a,example:l,isCaseSensitive:u}=r,c=g.selectOption(Object.assign(Object.assign(Object.assign({text:e,isCorrect:o},this.parseItemLeadHintInstruction(i,n,s,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}return t}highlightTextBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:o,isHighlighted:i,item:n,lead:s,hint:a,instruction:l,example:u,isCaseSensitive:c}=r,p=g.highlightText(Object.assign(Object.assign(Object.assign({text:e,isCorrect:o,isHighlighted:i},this.parseItemLeadHintInstruction(n,s,a,l)),this.parseExample(u)),{isCaseSensitive:c}));t.push(p)}return t}quizBitsToAst(e,t){const r=[];if(Array.isArray(t))for(const o of t){const{item:t,lead:i,hint:n,instruction:s,choices:a,responses:l}=o,u=this.choiceBitsToAst(a),c=this.responseBitsToAst(e,l),p=g.quiz(Object.assign(Object.assign({},this.parseItemLeadHintInstruction(t,i,n,s)),{choices:u,responses:c}));r.push(p)}if(0!==r.length)return r}headingBitToAst(e){let t;return e&&(t=g.heading({forKeys:e.forKeys,forValues:e.forValues})),t}pairBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{key:e,keyAudio:o,keyImage:i,values:n,item:s,lead:a,hint:l,instruction:c,example:p,isCaseSensitive:d,isLongAnswer:y}=r,f=this.resourceDataToAst(u.ResourceTag.audio,o),h=this.resourceDataToAst(u.ResourceTag.image,i),m=g.pair(Object.assign(Object.assign(Object.assign({key:e,keyAudio:f,keyImage:h,values:n},this.parseItemLeadHintInstruction(s,a,l,c)),this.parseExample(p)),{isCaseSensitive:d,isShortAnswer:!y}));t.push(m)}if(0!==t.length)return t}matrixBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{key:e,cells:i,item:n,lead:s,hint:a,instruction:l,example:u,isCaseSensitive:c,isLongAnswer:p}=o,d=g.matrix(Object.assign(Object.assign(Object.assign({key:e,cells:null!==(t=this.matrixCellsToAst(i))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(n,s,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:!p}));r.push(d)}if(0!==r.length)return r}matrixCellsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{values:e,item:o,lead:i,hint:n,instruction:s,example:a}=r,l=g.matrixCell(Object.assign(Object.assign({values:e},this.parseItemLeadHintInstruction(o,i,n,s)),this.parseExample(a)));t.push(l)}if(0!==t.length)return t}questionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{question:e,partialAnswer:o,sampleSolution:i,item:n,lead:s,hint:a,instruction:l,example:u,isCaseSensitive:c,isShortAnswer:p,reasonableNumOfChars:d}=r,y=g.question(Object.assign(Object.assign(Object.assign({question:e,partialAnswer:o,sampleSolution:i},this.parseItemLeadHintInstruction(n,s,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:p,reasonableNumOfChars:d}));t.push(y)}if(0!==t.length)return t}botResponseBitsToAst(e,t){const r=[];if(e.root===a.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,reaction:o,feedback:i,item:n,lead:s,hint:a}=e,l=g.botResponse({response:t,reaction:o,feedback:i,item:this.parseText(n),lead:this.parseText(s),hint:this.parseText(a)});r.push(l)}if(0!==r.length)return r}}getResourceType(e){if(e){return u.ResourceTag.fromValue(e.type)}}resourceBitToAst(e){var t;const r=[];if(e){const o=null!==(t=u.ResourceTag.keyFromValue(e.type))&&void 0!==t?t:u.ResourceTag.unknown;let i;if(e.type===u.ResourceTag.imageResponsive){const t=e,o=this.resourceDataToAst(u.ResourceTag.imagePortrait,t.imagePortrait),i=this.resourceDataToAst(u.ResourceTag.imageLandscape,t.imageLandscape);o&&r.push(o),i&&r.push(i)}else if(e.type===u.ResourceTag.stillImageFilm){const t=e,o=this.resourceDataToAst(u.ResourceTag.image,t.image),i=this.resourceDataToAst(u.ResourceTag.audio,t.audio);o&&r.push(o),i&&r.push(i)}else{if(i=e[o],!i)return;const t=this.resourceDataToAst(e.type,i);t&&r.push(t)}}return r}resourceDataToAst(e,t){var r,o;let i;if(t){if(!t)return;const n=p.StringUtils.isString(t)?t:void 0,s=t.url||t.src||t.href||t.app||t.body||n,a=this.resourceDataToAst(u.ResourceTag.image,t.posterImage),l=t.thumbnails?t.thumbnails.map((e=>this.resourceDataToAst(u.ResourceTag.image,e))):void 0;i=d.resource({type:e,value:s,format:t.format,src1x:t.src1x,src2x:t.src2x,src3x:t.src3x,src4x:t.src4x,caption:this.parseText(t.caption),width:null!==(r=t.width)&&void 0!==r?r:void 0,height:null!==(o=t.height)&&void 0!==o?o:void 0,alt:t.alt,duration:t.duration,mute:t.mute,autoplay:t.autoplay,allowSubtitles:t.allowSubtitles,showSubtitles:t.showSubtitles,posterImage:a,thumbnails:l,siteName:t.siteName,license:t.license,copyright:t.copyright,showInIndex:t.showInIndex})}return i}bodyToAst(e,t,r){let o,i;const n={};if(Array.isArray(e)?(i=this.parseText(e,t),r=this.textGenerator.getPlaceholders()):i=e,r)for(const[e,t]of Object.entries(r)){const r=this.bodyBitToAst(t);n[e]=r}if(i){const e=[],t=p.StringUtils.splitPlaceholders(i,Object.keys(n));for(let r=0,o=t.length;r<o;r++){const o=t[r];if(n[o])e.push(n[o]);else{const t=this.bodyTextToAst(o);e.push(t)}}o=g.body({bodyParts:e})}return o}bodyTextToAst(e){return g.bodyText({text:e})}bodyBitToAst(e){switch(e.type){case l.BodyBitType.gap:return this.gapBitToAst(e);case l.BodyBitType.mark:return this.markBitToAst(e);case l.BodyBitType.select:return this.selectBitToAst(e);case l.BodyBitType.highlight:return this.highlightBitToAst(e)}return this.bodyTextToAst("")}footerToAst(e,t){const r=this.parseText(e,t);if(r)return g.footerText({text:r})}referenceToAst(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}gapBitToAst(e){const{item:t,lead:r,hint:o,instruction:i,example:n,isCaseSensitive:s,solutions:a}=e;return g.gap(Object.assign(Object.assign(Object.assign({solutions:a},this.parseItemLeadHintInstruction(t,r,o,i)),this.parseExample(n)),{isCaseSensitive:s}))}markBitToAst(e){const{solution:t,mark:r,item:o,lead:i,hint:n,instruction:s,example:a}=e;return g.mark(Object.assign(Object.assign({solution:t,mark:r},this.parseItemLeadHintInstruction(o,i,n,s)),this.parseExample(a)))}selectBitToAst(e){const{options:t,prefix:r,postfix:o,item:i,lead:n,hint:s,instruction:a,example:l}=e,u=this.selectOptionBitsToAst(t);return g.select(Object.assign(Object.assign(Object.assign({options:u,prefix:r,postfix:o},this.parseItemLeadHintInstruction(i,n,s,a)),this.parseExample(l)),{isCaseSensitive:!0}))}highlightBitToAst(e){const{texts:t,prefix:r,postfix:o,item:i,lead:n,hint:s,instruction:a,example:l}=e,u=this.highlightTextBitsToAst(t);return g.highlight(Object.assign(Object.assign(Object.assign({texts:u,prefix:r,postfix:o},this.parseItemLeadHintInstruction(i,n,s,a)),this.parseExample(l)),{isCaseSensitive:!0}))}parseItemLeadHintInstruction(e,t,r,o){return{item:this.parseText(e),lead:this.parseText(t),hint:this.parseText(r),instruction:this.parseText(o)}}parseExample(e){if(null==e)return;const t=this.parseText(e);return t?{example:t}:{example:!!e}}parseText(e,t){if(null!=e){if(Array.isArray(e)){return this.textGenerator.generateSync(e,t)}return e}}}},406:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextParser=void 0;const o=r(1353),i=r(3633),n=r(8436);t.TextParser=class{preprocessAst(e){if(i.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){if(Array.isArray(e)){if(0===e.length)return!0;if(Object.prototype.hasOwnProperty.call(e[0],"type"))return!0}return!1}toAst(e,t){if(Array.isArray(e))return e;const r=e,i=Object.assign({},t);i.textFormat||(i.textFormat=o.TextFormat.bitmarkMinusMinus);const s=i.textFormat===o.TextFormat.bitmarkPlusPlus?"bitmarkPlusPlus":"bitmarkMinusMinus";return(0,n.parse)(null!=r?r:"",{startRule:s})}}},8436:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const o=r(4764).parse;t.parse=o},7646:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayUtils=void 0;const r=new class{asArray(e){if(null!=e)return Array.isArray(e)?e:[e]}asSingle(e,t){if(null!=e)return Array.isArray(e)?e.length>0?t?e[e.length-1]:e[0]:void 0:e}};t.ArrayUtils=r},4598:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitUtils=void 0;const o=r(672);const i=new class{fillStringExample(e,t,r,o){if(e){Array.isArray(e)||(e=[e]);for(const i of e)if(!i.isExample&&(t?(i.isDefaultExample=!0,i.isExample=!0):(i.isDefaultExample=!1,i.example=r),o))break}}fillBooleanExample(e,t,r,i){if(e){Array.isArray(e)||(e=[e]);for(const n of e)if(!n.isExample&&(!i||n.isCorrect)&&(t?(n.isDefaultExample=!0,n.isExample=!0):(n.isDefaultExample=!1,n.example=o.BooleanUtils.toBoolean(r)),i))break}}};t.BitUtils=i},672:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanUtils=void 0;const r=new class{isBoolean(e){return!0===e||!1===e}isBooleanString(e){return!!this.isBoolean(e)||("true"===e||"false"===e)}toBoolean(e,t){return t?!1!==e&&"false"!==e:!0===e||"true"===e}};t.BooleanUtils=r},994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NumberUtils=void 0;const r=new class{asNumber(e,t){if(null==e)return null!=t?t:void 0;const r=+e;return Number.isNaN(r)?null!=t?t:void 0:r}};t.NumberUtils=r},3589:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUtils=void 0;const r=new class{isFunction(e){return"[object Function]"===Object.prototype.toString.call(e)}isArray(e){return Array.isArray(e)}isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}orderProperties(e,t){const r=e,o=Object.assign({},r);for(const e of Object.keys(r))delete r[e];for(const e of t)Object.prototype.hasOwnProperty.call(o,e)&&(r[e]=o[e])}removeUndefinedProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||null==o&&delete r[e]}removeFalseProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||!1===o&&delete r[e]}removeEmptyStringProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||""===o&&delete r[e]}removeEmptyArrayProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||Array.isArray(o)&&0===o.length&&delete r[e]}removeEmptyObjectProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||this.isObject(o)&&0===Object.keys(o).length&&delete r[e]}removeUnwantedProperties(e,t){(t=Object.assign({},t)).ignoreAllUndefined||this.removeUndefinedProperties(e,t.ignoreUndefined),t.ignoreAllFalse||this.removeFalseProperties(e,t.ignoreFalse),t.ignoreAllEmptyString||this.removeEmptyStringProperties(e,t.ignoreEmptyString),t.ignoreAllEmptyArrays||this.removeEmptyArrayProperties(e,t.ignoreEmptyArrays),t.ignoreAllEmptyObjects||this.removeEmptyObjectProperties(e,t.ignoreEmptyObjects)}extractSingleValue(e,t){if(!e)return;const r=e;if(null==r[t])return;let o=r[t];if(Array.isArray(o)){if(0===o.length)return;o=o[o.length-1]}return o}};t.ObjectUtils=r},3633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtils=void 0;const r=new class{isString(e){return"string"==typeof e||e instanceof String}string(e){return e?`${e}`:""}trimmedString(e){return this.string(e).trim()}splitPlaceholders(e,t){let r=[e];const o=(e,t)=>{const r=[];for(const o of e){const e=o.split(t);for(let o=0,i=e.length;o<i;o++){const n=e[o],s=o===i-1;r.push(n),s||r.push(t)}}return r};for(const e of t)r=o(r,e);return r}firstLine(e,t){const r=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return r;const o=e.split("\n");return o.length>0?o[0].substring(0,t):r}wordWrap(e,t){const r=[];if(t<1||null==e||e.length<=t)return r;const o=e.length,i=o-t;let n,s=0;for(;s<i;){let o;const i=s+t,a=e.indexOf("\n",s);if(a>-1&&a>s&&a<i){o=a-s,n=e.substr(s,o),s=s+o+1,r.push(n);continue}const l=e.lastIndexOf(" ",i);let u=0;l>-1&&l!=s-1?(o=l-s,o>0&&(u=s+o+1)):(o=t,u=s+t),n=e.substr(s,o),s=u,r.push(n.trim())}return s<o&&(n=e.substr(s),r.push(n)),r}};t.StringUtils=r},169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtils=void 0;const r=new class{fileExtensionFromUrl(e){let t;if(e)try{const r=new URL(e).pathname.split(".");r.length>1&&(t=r[r.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}};t.UrlUtils=r},671:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initEnv=t.env=void 0;const o=r(2164),i=r(7619),n=r(306),s=r(9870);const a=new class{constructor(){Object.defineProperty(this,"userAgentInfo",{value:(0,s.parseUserAgent)(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=n.EMPTY_VERSION,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===o.Environment.node,this.isCI=this.getIsCI(),this.NODE_ENV=this.getNodeEnv(),this.os=this.getOs(),this.osVersion=this.getOsVersion()}init(e,t){this.app=e,this.appVersion=this.parseMMBVersion(t)}get upTimestamp(){return Date.now()-this.bootTimestamp}getEnvironment(){return this.userAgentInfo?this.userAgentInfo.browser:"undefined"!=typeof process&&void 0!==process.versions&&process.versions.node?o.Environment.node:o.Environment.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):n.EMPTY_VERSION}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,i.Os.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):n.EMPTY_VERSION}getIsBrowser(){return!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof navigator||!navigator.userAgent)}getIsCI(){return!("undefined"==typeof process||!process.env||!process.env.CI)}getNodeEnv(){return"undefined"!=typeof process&&process.env?"production":""}parseMMBVersion(e){if(!e)return n.EMPTY_VERSION;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",o="",i="",s="";for(let e=0,n=t.length;e<n;e++){const n=t[e];0===e?r=n:1===e?o=n:2===e?s=n:3===e&&(i=n)}return{full:e,major:r,minor:o,patch:s,build:i}}};t.env=a;const l=a.init.bind(a);t.initEnv=l},2164:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;const o=(0,r(6688).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"});t.Environment=o},7619:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Os=void 0;const o=(0,r(6688).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});t.Os=o},306:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_VERSION=void 0;t.EMPTY_VERSION={full:"",major:"",minor:"",patch:"",build:""}},9870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUserAgent=void 0;const o=r(2164),i=r(7619);t.parseUserAgent=function(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:o.Environment.unknown,os:i.Os.unknown},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce(((e,t)=>(t&&e.push(t),e)),[]),r={keys:new Set,versions:{}};let o="";for(let e=0,i=t.length;e<i;e++){const i=t[e];let n=!1;for(let e=0;e<=9;e++)if(i.startsWith(`${e}`)){n=!0;break}n?r.versions[o]=i.replace("_","."):r.keys.add(i),o=i}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),n=t.keys.has("chrome"),s=t.keys.has("chromium"),a=t.keys.has("safari"),l=n,u=r,c=t.keys.has("macintosh");return a&&!n&&!s?(e.browser=o.Environment.safari,e.browserVersion=t.versions.version):l?(e.browser=o.Environment.chrome,e.browserVersion=t.versions.chrome):u&&(e.browser=o.Environment.firefox,e.browserVersion=t.versions.firefox),c&&(e.os=i.Os.macos,e.osVersion=t.versions.x),e}}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o].call(n.exports,n,n.exports,r),n.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.StreamWriter=e.FileWriter=e.BitmarkFileGenerator=e.JsonFileGenerator=e.InfoFormat=e.InfoType=e.CardSetVersion=e.BitmarkVersion=e.BitmarkParserType=e.NodeType=e.ResourceTag=e.TextFormat=e.AliasBitType=e.RootBitType=e.StringWriter=e.BitmarkStringGenerator=e.BitmarkGenerator=e.BitmarkParser=e.JsonStringGenerator=e.JsonGenerator=e.JsonParser=e.Ast=e.ResourceBuilder=e.Builder=e.Output=e.BitmarkParserGenerator=void 0;const t=r(7087);var i=r(390);Object.defineProperty(e,"BitmarkParserGenerator",{enumerable:!0,get:function(){return i.BitmarkParserGenerator}}),Object.defineProperty(e,"Output",{enumerable:!0,get:function(){return i.Output}});var n=r(9046);Object.defineProperty(e,"Builder",{enumerable:!0,get:function(){return n.Builder}});var s=r(8703);Object.defineProperty(e,"ResourceBuilder",{enumerable:!0,get:function(){return s.ResourceBuilder}});var a=r(8256);Object.defineProperty(e,"Ast",{enumerable:!0,get:function(){return a.Ast}});var l=r(2434);Object.defineProperty(e,"JsonParser",{enumerable:!0,get:function(){return l.JsonParser}});var u=r(3857);Object.defineProperty(e,"JsonGenerator",{enumerable:!0,get:function(){return u.JsonGenerator}});var c=r(5132);Object.defineProperty(e,"JsonStringGenerator",{enumerable:!0,get:function(){return c.JsonStringGenerator}});var p=r(9556);Object.defineProperty(e,"BitmarkParser",{enumerable:!0,get:function(){return p.BitmarkParser}});var g=r(297);Object.defineProperty(e,"BitmarkGenerator",{enumerable:!0,get:function(){return g.BitmarkGenerator}});var d=r(8582);Object.defineProperty(e,"BitmarkStringGenerator",{enumerable:!0,get:function(){return d.BitmarkStringGenerator}});var y=r(227);Object.defineProperty(e,"StringWriter",{enumerable:!0,get:function(){return y.StringWriter}});var f=r(208);Object.defineProperty(e,"RootBitType",{enumerable:!0,get:function(){return f.RootBitType}}),Object.defineProperty(e,"AliasBitType",{enumerable:!0,get:function(){return f.AliasBitType}});var h=r(1353);Object.defineProperty(e,"TextFormat",{enumerable:!0,get:function(){return h.TextFormat}});var m=r(9779);Object.defineProperty(e,"ResourceTag",{enumerable:!0,get:function(){return m.ResourceTag}});var T=r(549);Object.defineProperty(e,"NodeType",{enumerable:!0,get:function(){return T.NodeType}});var b=r(6958);Object.defineProperty(e,"BitmarkParserType",{enumerable:!0,get:function(){return b.BitmarkParserType}});var v=r(8791);Object.defineProperty(e,"BitmarkVersion",{enumerable:!0,get:function(){return v.BitmarkVersion}});var C=r(8565);Object.defineProperty(e,"CardSetVersion",{enumerable:!0,get:function(){return C.CardSetVersion}});var x=r(7347);Object.defineProperty(e,"InfoType",{enumerable:!0,get:function(){return x.InfoType}});var A=r(8681);Object.defineProperty(e,"InfoFormat",{enumerable:!0,get:function(){return A.InfoFormat}});(0,t.init)()})(),o})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bitmarkParserGenerator=t():e.bitmarkParserGenerator=t()}(this,(()=>(()=>{"use strict";var e={6688:(e,t,r)=>{function o(e,t){var r;const o=Object.freeze,i=Object.defineProperty,n=Object.assign,s={enumerable:!1},a=new Map,l=new Map,u=new Map,c=new Map,p=new Map,g=(null!==(r=null==t?void 0:t.iterationKeys)&&void 0!==r?r:Object.keys(e)).map((e=>`${e}`));for(const[t,r]of Object.entries(e))a.set(t,r),u.set(t.toLowerCase(),r);for(const[e,t]of a){const r="string"==typeof t?t.toLowerCase():t;l.set(t,e),c.set(r,e)}const d=g.map((e=>a.get(e))),y=g.map((e=>[e,a.get(e)]));return(t=>{let r=e;function f(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?a.get(c.get(e.toLowerCase())):!e||l.has(e)?e:void 0}Object.isExtensible(e)||(r=n({},e)),i(r,"fromKey",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?u.get(e.toLowerCase()):a.get(`${e}`)}},s)),i(r,"fromValue",n({value:f},s)),i(r,"keyFromValue",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):l.get(e)}},s)),i(r,"setMetadata",n({value:function(e,t,r){const o=f(e);o&&p.set(o,t)}},s)),i(r,"getMetadata",n({value:function(e,t){return p.get(e)}},s)),i(r,Symbol.iterator,n({value:function(){let e=0;return{next:()=>e<g.length?{value:a.get(`${g[e++]}`),done:!1}:{done:!0}}}},s)),i(r,"values",n({value:()=>d},s)),i(r,"keys",n({value:()=>g},s)),i(r,"entries",n({value:()=>y},s));let h=r;return(null==t?void 0:t.noFreeze)||(h=o(r),o(g),o(d),o(y)),h})(t)}r.r(t),r.d(t,{superenum:()=>i});const i=o;i.fromObject=o,i.fromArray=function(e,t){Array.isArray(e)||(e=[]);const r=e.reduce(((e,t)=>(e[`${t}`]=t,e)),{});return(!t||t&&!t.iterationKeys)&&((t=Object.assign({},t)).iterationKeys=e),o(r,t)}},390:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,i)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=(this&&this.__importStar,this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))});this&&this.__importDefault;Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.BitmarkParserGenerator=void 0;const s=r(6688),a=r(8256),l=r(8582),u=r(4275),c=r(6958),p=r(9556),g=r(2434),d=r(671),y=r(9677),f=r(7347),h=r(8681),m=r(2606),T=r(1353),b=r(6300),v=r(406),C=r(4764),x=(0,s.superenum)({bitmark:"bitmark",json:"json",ast:"ast"});t.Output=x;t.BitmarkParserGenerator=class{constructor(){this.ast=new a.Ast,this.jsonParser=new g.JsonParser,this.bitmarkParser=new p.BitmarkParser,this.textParser=new v.TextParser,this.textGenerator=new b.TextGenerator,this.jsonStringifyPrettify=(e,t,r)=>{const o=!0===t.prettify?2:t.prettify||void 0;return r||!0===t.stringify||void 0!==o?JSON.stringify(e,null,o):e}}version(){return d.env.appVersion.full}info(e){const t=Object.assign({},e),r=new y.InfoBuilder;let o;const i=!t.outputFormat||t.outputFormat===h.InfoFormat.text,n=t.outputFormat===h.InfoFormat.json,s=t.type===f.InfoType.all,a=t.type===f.InfoType.deprecated,l=s||!a,u=s||a;if(t.type===f.InfoType.bit){const e=r.getSupportedBitConfigs().filter((e=>{if(!t.bit)return!0;return m.Config.getBitType(t.bit).root===e.rootBitType}));o=i?e.map((e=>e.toString({includeChains:!0,includeConfigs:!0}))).join("\n\n--------------\n\n"):e}else{const e=r.getSupportedBits({includeNonDeprecated:l,includeDeprecated:u}).filter((e=>{var r;if(!t.bit)return!0;const o=m.Config.getBitType(t.bit);if(e.name===o.root)return!0;return!!(null===(r=e.aliases)||void 0===r?void 0:r.find((e=>e.name===o.alias)))}));o=i?this.supportedBitsAsString(e):e}if(n){const e=!0===t.prettify?2:t.prettify||void 0;o=JSON.stringify(o,null,e)}return o}convert(e,t){return n(this,void 0,void 0,(function*(){let r;const o=Object.assign({},t),i=Object.assign({},o.jsonOptions),s=o.outputFormat,a=s===x.bitmark,p=s===x.json,g=s===x.ast,y=c.BitmarkParserType.peggy;let f=e;if(d.env.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(f)&&(f=fs.readFileSync(f,{encoding:"utf8"}));let h=this.ast.preprocessAst(f);const m=!!h;m||(h=this.jsonParser.toAst(f));const T=!!(null==h?void 0:h.bits),b=e=>n(this,void 0,void 0,(function*(){yield v(e),yield A(r)})),v=e=>n(this,void 0,void 0,(function*(){r=this.bitmarkParser.toAst(e,{parserType:y})})),C=e=>n(this,void 0,void 0,(function*(){if(y===c.BitmarkParserType.peggy)if(h=this.bitmarkParser.toAst(e,{parserType:y}),o.outputFile){const e=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield e.generate(h)}else{const e=new u.JsonObjectGenerator(o),t=yield e.generate(h);r=this.jsonStringifyPrettify(t,i)}})),A=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(o);r=yield t.generate(e)}})),w=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,i)})),B=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(o),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,i)}})),k=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(o);r=yield t.generate(e)}})),P=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,i)})),K=e=>n(this,void 0,void 0,(function*(){yield B(e)}));return!T&&!m?a?yield b(f):g?yield v(f):yield C(f):m?g?yield w(h):p?yield B(h):yield A(h):p?yield K(h):g?yield P(h):yield k(h),r}))}upgrade(e,t){return n(this,void 0,void 0,(function*(){let r;const o=Object.assign({},t),i=Object.assign({},o.jsonOptions),s=o.bitmarkParserType;let a=e;if(d.env.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(a)&&(a=fs.readFileSync(a,{encoding:"utf8"}));let c=this.jsonParser.toAst(a);const p=e=>n(this,void 0,void 0,(function*(){const t=this.bitmarkParser.toAst(e,{parserType:s});if(o.outputFile){const e=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield e.generate(t)}else{const e=new l.BitmarkStringGenerator(o);r=yield e.generate(t)}})),g=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(o),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,i)}}));return!!!(null==c?void 0:c.bits)?yield p(a):yield g(c),r}))}createAst(e){let t,r=e;d.env.isNode&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let o=this.ast.preprocessAst(r);const i=!!o;i||(o=this.jsonParser.toAst(r));return t=!!!(null==o?void 0:o.bits)&&!i?this.bitmarkParser.toAst(r):o,t}convertText(e,t){var r;return n(this,void 0,void 0,(function*(){let o,i;const n=Object.assign({},t),s=Object.assign({},n.fileOptions),a=Object.assign({},n.jsonOptions),l=null!==(r=n.textFormat)&&void 0!==r?r:T.TextFormat.bitmarkMinusMinus;let u=e;if(d.env.isBrowser&&n.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(u)&&(u=fs.readFileSync(u,{encoding:"utf8"}));const c=this.textParser.preprocessAst(u),p=!!c;if(i=p?yield this.textGenerator.generate(c,l):this.textParser.toAst(u,{textFormat:l}),n.outputFile){const e=n.outputFile.toString();let t=i;p||(t=this.jsonStringifyPrettify(i,a,!0));const r=s.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,t,{flag:r})}else o=p?i:this.jsonStringifyPrettify(i,a);return o}))}breakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),o=Object.assign({},r.fileOptions);let i=e;if(d.env.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(i)&&(i=fs.readFileSync(i,{encoding:"utf8"}));const n=i.replace(b.BREAKSCAPE_REGEX,b.BREAKSCAPE_REGEX_REPLACER);if(!r.outputFile)return n;{const e=r.outputFile.toString(),t=o.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,n,{flag:t})}}unbreakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),o=Object.assign({},r.fileOptions);let i=e;if(d.env.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(i)&&(i=fs.readFileSync(i,{encoding:"utf8"}));const n=(0,C.unbreakscape)(i);if(!r.outputFile)return n;{const e=r.outputFile.toString(),t=o.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,n,{flag:t})}}supportedBitsAsString(e){let t="";for(const r of e)if(t+=`${r.name} (since: ${r.since}`,r.deprecated&&(t+=`, deprecated: ${r.deprecated}`),t+=")\n",r.aliases&&r.aliases.length>0)for(const e of r.aliases)t+=`|__ ${e.name} (since: ${e.since}`,e.deprecated&&(t+=`, deprecated: ${e.deprecated}`),t+=")\n";return t}}},8256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ast=void 0;const o=r(7087),i=r(549),n=r(3633);t.Ast=class{constructor(){(0,o.init)()}walk(e,t,r,o){this.walkRecursive(e,void 0,r,[{index:0,key:t,value:e}],o)}getRouteKey(e){return e.reduce(((t,r,o)=>(+r.key!==r.index&&(t+=`${r.key}`,o<e.length-1&&(t+="_")),t)),"")}printTree(e,t=i.NodeType.bitmarkAst){this.walkRecursive(e,void 0,{enter:(e,t,r)=>{console.log("Enter: "+this.getRouteKey(r))},between:(e,t,r,o,i)=>{console.log("Between: "+this.getRouteKey(i))},exit:(e,t,r)=>{console.log("Exit: "+this.getRouteKey(r))},leaf:(e,t,r)=>{console.log("Leaf: "+this.getRouteKey(r))}},[{index:0,key:t,value:e}],void 0)}preprocessAst(e){if(n.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){return!(!Object.prototype.hasOwnProperty.call(e,"bits")||!Array.isArray(e.bits))}walkRecursive(e,t,r,o,i){const{enter:n,between:s,exit:a,leaf:l}=r,u=o[o.length-1].key,c=!this.isValue(e),p=o[o.length-1];if(c){if(n){if(!1===n(p,t,o,i))return}}else l&&l(p,t,o,i);if(c){const n=this.isArray(e),a=Object.keys(e);for(let l=0,c=a.length;l<c;l++){const g=a[l],d=l===c-1,y=e,f=y[g];if(null!=f){const e={key:this.getAstKey(g,u,n),index:l,value:f},c=o.slice();if(c.push(e),this.walkRecursive(f,p,r,c,i),!d){const r=a[l+1],c=y[r],g={key:this.getAstKey(r,u,n),index:l+1,value:c};if(s){if(!1===s(p,e,g,t,o,i))break}}}}}c&&a&&a(p,t,o,i)}getAstKey(e,t,r){let o=e;return r&&t&&(o=`${t}Value`),i.NodeType.fromKey(o)||`unknown(${o})`}isArray(e){return Array.isArray(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}}},1:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBuilder=void 0;const o=r(2606),i=r(5486),n=r(7646),s=r(672),a=r(994),l=r(3633);t.BaseBuilder=class{toExample(e,t){return null!=t?(!0===t&&(t="true"),!1===t&&(t="false"),{isDefaultExample:!1,isExample:!0,example:t}):e?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}}toExampleBoolean(e,t){const r=null!=t&&!s.BooleanUtils.isBooleanString(t);return null==t||r?e||r?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}:{isDefaultExample:!1,isExample:!0,example:s.BooleanUtils.toBoolean(t)}}toAstProperty(e,t){if(null==t)return;const r=o.Config.getRawPropertiesConfig()[e],u=e=>{if(null!=e){switch(r.format){case i.PropertyFormat.string:return l.StringUtils.isString(e)?l.StringUtils.string(e):void 0;case i.PropertyFormat.trimmedString:return l.StringUtils.isString(e)?l.StringUtils.trimmedString(e):void 0;case i.PropertyFormat.number:return a.NumberUtils.asNumber(e);case i.PropertyFormat.boolean:return s.BooleanUtils.toBoolean(e,!0);case i.PropertyFormat.invertedBoolean:return!s.BooleanUtils.toBoolean(e,!0)}return e}};if(Array.isArray(t)){const e=t;for(let t=0,r=e.length;t<r;t++)e[t]=u(e[t])}else t=u(t);return n.ArrayUtils.asArray(t)}}},9046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;const o=r(3518),i=r(208),n=r(1060),s=r(9779),a=r(1353),l=r(7646),u=r(4598),c=r(994),p=r(3589),g=r(671),d=r(1),y=r(2377);class f extends d.BaseBuilder{bitmark(e){const{bits:t,errors:r}=e,o={bits:t,errors:r};return p.ObjectUtils.removeUnwantedProperties(o),o}bit(e){var t;const{bitType:r,textFormat:n,resourceType:u,id:g,externalId:d,spaceId:f,padletId:h,jupyterId:m,jupyterExecutionCount:T,aiGenerated:b,releaseVersion:v,ageRange:C,lang:x,language:A,computerLanguage:w,target:B,tag:k,icon:P,iconTag:K,colorTag:S,flashcardSet:_,subtype:R,bookAlias:I,coverImage:O,publisher:E,publications:L,author:j,subject:V,date:F,location:G,theme:N,kind:D,action:U,thumbImage:M,focusX:$,focusY:J,duration:q,referenceProperty:H,deeplink:z,externalLink:W,externalLinkText:Y,videoCallLink:X,bot:Z,list:Q,textReference:ee,isTracked:te,isInfoOnly:re,labelTrue:oe,labelFalse:ie,content2Buy:ne,book:se,quotedPerson:ae,partialAnswer:le,reasonableNumOfChars:ue,maxCreatedBits:ce,title:pe,subtitle:ge,level:de,toc:ye,progress:fe,anchor:he,reference:me,referenceEnd:Te,item:be,lead:ve,hint:Ce,instruction:xe,isDefaultExample:Ae,example:we,imageSource:Be,partner:ke,markConfig:Pe,extraProperties:Ke,resources:Se,body:_e,sampleSolution:Re,footer:Ie,markup:Oe,parser:Ee}=e,Le=l.ArrayUtils.asArray(Se),je=this.cardNode(e),Ve=r.root===i.RootBitType.essay?this.toAstProperty(o.PropertyConfigKey.reasonableNumOfChars,ue):void 0,Fe=Object.assign(Object.assign({bitType:r,textFormat:null!==(t=a.TextFormat.fromValue(n))&&void 0!==t?t:a.TextFormat.bitmarkMinusMinus,resourceType:s.ResourceTag.fromValue(u),id:this.toAstProperty(o.PropertyConfigKey.id,g),externalId:this.toAstProperty(o.PropertyConfigKey.externalId,d),spaceId:this.toAstProperty(o.PropertyConfigKey.spaceId,f),padletId:this.toAstProperty(o.PropertyConfigKey.padletId,h),jupyterId:this.toAstProperty(o.PropertyConfigKey.jupyterId,m),jupyterExecutionCount:this.toAstProperty(o.PropertyConfigKey.jupyterExecutionCount,T),aiGenerated:this.toAstProperty(o.PropertyConfigKey.aiGenerated,b),releaseVersion:this.toAstProperty(o.PropertyConfigKey.releaseVersion,v),book:se,ageRange:this.toAstProperty(o.PropertyConfigKey.ageRange,C),lang:this.toAstProperty(o.PropertyConfigKey.lang,x),language:this.toAstProperty(o.PropertyConfigKey.language,A),computerLanguage:this.toAstProperty(o.PropertyConfigKey.computerLanguage,w),target:this.toAstProperty(o.PropertyConfigKey.target,B),tag:this.toAstProperty(o.PropertyConfigKey.tag,k),icon:this.toAstProperty(o.PropertyConfigKey.icon,P),iconTag:this.toAstProperty(o.PropertyConfigKey.iconTag,K),colorTag:this.toAstProperty(o.PropertyConfigKey.colorTag,S),flashcardSet:this.toAstProperty(o.PropertyConfigKey.flashcardSet,_),subtype:this.toAstProperty(o.PropertyConfigKey.subtype,R),bookAlias:this.toAstProperty(o.PropertyConfigKey.bookAlias,I),coverImage:this.toAstProperty(o.PropertyConfigKey.coverImage,O),publisher:this.toAstProperty(o.PropertyConfigKey.publisher,E),publications:this.toAstProperty(o.PropertyConfigKey.publications,L),author:this.toAstProperty(o.PropertyConfigKey.author,j),subject:this.toAstProperty(o.PropertyConfigKey.subject,V),date:this.toAstProperty(o.PropertyConfigKey.date,F),location:this.toAstProperty(o.PropertyConfigKey.location,G),theme:this.toAstProperty(o.PropertyConfigKey.theme,N),kind:this.toAstProperty(o.PropertyConfigKey.kind,D),action:this.toAstProperty(o.PropertyConfigKey.action,U),thumbImage:this.toAstProperty(o.PropertyConfigKey.thumbImage,M),focusX:this.toAstProperty(o.PropertyConfigKey.focusX,$),focusY:this.toAstProperty(o.PropertyConfigKey.focusY,J),deeplink:this.toAstProperty(o.PropertyConfigKey.deeplink,z),externalLink:this.toAstProperty(o.PropertyConfigKey.externalLink,W),externalLinkText:this.toAstProperty(o.PropertyConfigKey.externalLinkText,Y),videoCallLink:this.toAstProperty(o.PropertyConfigKey.videoCallLink,X),bot:this.toAstProperty(o.PropertyConfigKey.bot,Z),duration:this.toAstProperty(o.PropertyConfigKey.duration,q),referenceProperty:this.toAstProperty(o.PropertyConfigKey.property_reference,H),list:this.toAstProperty(o.PropertyConfigKey.list,Q),textReference:this.toAstProperty(o.PropertyConfigKey.textReference,ee),isTracked:this.toAstProperty(o.PropertyConfigKey.isTracked,te),isInfoOnly:this.toAstProperty(o.PropertyConfigKey.isInfoOnly,re),labelTrue:this.toAstProperty(o.PropertyConfigKey.labelTrue,oe),labelFalse:this.toAstProperty(o.PropertyConfigKey.labelFalse,ie),content2Buy:this.toAstProperty(o.PropertyConfigKey.content2Buy,ne),quotedPerson:this.toAstProperty(o.PropertyConfigKey.quotedPerson,ae),partialAnswer:this.toAstProperty(o.PropertyConfigKey.partialAnswer,le),reasonableNumOfChars:Ve,maxCreatedBits:this.toAstProperty(o.PropertyConfigKey.maxCreatedBits,ce),title:pe,subtitle:ge,level:c.NumberUtils.asNumber(de),toc:this.toAstProperty(o.PropertyConfigKey.toc,ye),progress:this.toAstProperty(o.PropertyConfigKey.progress,fe),anchor:he,reference:me,referenceEnd:Te,markConfig:Pe,itemLead:this.itemLead(be,ve),hint:Ce,instruction:xe},this.toExample(Ae,we)),{imageSource:Be,partner:ke,resources:Le,body:_e,sampleSolution:l.ArrayUtils.asSingle(Re),cardNode:je,footer:Ie,markup:Oe,parser:Ee,extraProperties:this.parseExtraProperties(Ke)});return r.root===i.RootBitType.interview&&this.pushDownTree(void 0,void 0,je,"questions",o.PropertyConfigKey.reasonableNumOfChars,ue),this.pushExampleDownTree(_e,je,Ae,we),this.setDefaultBitValues(Fe),this.setIsExampleFlags(Fe),this.addVersionToParserInfo(Fe),p.ObjectUtils.removeUnwantedProperties(Fe,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),y.NodeValidator.validateBit(Fe)}choice(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:s},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}response(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:s},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}botResponse(e){const{response:t,reaction:r,feedback:o,item:i,lead:n,hint:s}=e,a={response:t,reaction:r,feedback:o,itemLead:this.itemLead(i,n),hint:s};return p.ObjectUtils.removeUnwantedProperties(a,{ignoreEmptyString:["response","reaction","feedback"]}),a}quiz(e){const{choices:t,responses:r,item:o,lead:i,hint:n,instruction:s,isDefaultExample:a,example:l}=e;this.pushExampleDownTreeBoolean(a,l,!0,t),this.pushExampleDownTreeBoolean(a,l,!1,r);const u={itemLead:this.itemLead(o,i),hint:n,instruction:s,isExample:a||null!=l,choices:t,responses:r};return p.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}heading(e){var t;const{forKeys:r,forValues:o}=e;if(null==r)return;const i={forKeys:r||"",forValues:null!==(t=l.ArrayUtils.asArray(o))&&void 0!==t?t:[]};return p.ObjectUtils.removeUnwantedProperties(i),i}pair(e){const{key:t,keyAudio:r,keyImage:o,values:i,item:n,lead:s,hint:a,instruction:l,isCaseSensitive:u,isShortAnswer:c,isDefaultExample:g,example:d}=e,y=Object.assign(Object.assign({key:t,keyAudio:r,keyImage:o,itemLead:this.itemLead(n,s),hint:a,instruction:l},this.toExample(g,d)),{isCaseSensitive:u,isShortAnswer:c,values:i});return p.ObjectUtils.removeUnwantedProperties(y,{ignoreAllFalse:!0}),y}matrix(e){const{key:t,cells:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isShortAnswer:l,isDefaultExample:u}=e;let c=!1;for(const e of null!=r?r:[])u&&!e.isExample&&(e.isDefaultExample=!0,e.isExample=!0),c=!!e.isExample||c;const g={key:t,itemLead:this.itemLead(o,i),hint:n,instruction:s,isCaseSensitive:a,isShortAnswer:l,isExample:c,cells:r};return p.ObjectUtils.removeUnwantedProperties(g,{ignoreAllFalse:!0}),g}matrixCell(e){const{values:t,item:r,lead:o,hint:i,instruction:n,isDefaultExample:s,example:a}=e,l=Object.assign({values:t,itemLead:this.itemLead(r,o),hint:i,instruction:n},this.toExample(s,a));return p.ObjectUtils.removeUnwantedProperties(l,{ignoreAllFalse:!0}),l}question(e){const{question:t,partialAnswer:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isShortAnswer:l,reasonableNumOfChars:u,sampleSolution:c,isDefaultExample:g,example:d}=e,y=Object.assign(Object.assign({itemLead:this.itemLead(o,i),question:t,partialAnswer:r,hint:n,instruction:s},this.toExample(g,d)),{isCaseSensitive:a,isShortAnswer:l,reasonableNumOfChars:u,sampleSolution:c});return p.ObjectUtils.removeUnwantedProperties(y,{ignoreEmptyString:["question"],ignoreAllFalse:!0}),y}body(e){const{bodyParts:t}=e;return{bodyParts:t}}bodyText(e){const{text:t}=e;return{type:n.BodyBitType.text,data:{bodyText:t}}}footerText(e){const{text:t}=e;return{footerText:t}}gap(e){const{solutions:t,item:r,lead:o,hint:i,instruction:s,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c={type:n.BodyBitType.gap,data:Object.assign(Object.assign({solutions:t,itemLead:this.itemLead(r,o),hint:i,instruction:s},this.toExample(l,u)),{isCaseSensitive:a})};return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}markConfig(e){const{mark:t,color:r,emphasis:o}=e,i={mark:t,color:r,emphasis:o};return p.ObjectUtils.removeUnwantedProperties(i),i}mark(e){const{solution:t,mark:r,item:o,lead:i,hint:s,instruction:a,isDefaultExample:l,example:u}=e,c={type:n.BodyBitType.mark,data:Object.assign({solution:t,mark:r,itemLead:this.itemLead(o,i),hint:s,instruction:a},this.toExample(l,u))};return p.ObjectUtils.removeUnwantedProperties(c),c}select(e){const{options:t,prefix:r,postfix:o,item:i,lead:s,hint:a,instruction:l,isCaseSensitive:u}=e,c={type:n.BodyBitType.select,data:{prefix:r,options:t,postfix:o,itemLead:this.itemLead(i,s),hint:a,instruction:l,isCaseSensitive:u}};return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}selectOption(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:s},this.toExample(l,u)),{isCaseSensitive:a});return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}highlight(e){const{texts:t,prefix:r,postfix:o,item:i,lead:s,hint:a,instruction:l,isCaseSensitive:u}=e,c={type:n.BodyBitType.highlight,data:{prefix:r,texts:t,postfix:o,itemLead:this.itemLead(i,s),hint:a,instruction:l,isCaseSensitive:u}};return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}highlightText(e){const{text:t,isCorrect:r,isHighlighted:o,item:i,lead:n,hint:s,instruction:a,isCaseSensitive:l,isDefaultExample:u,example:c}=e,g=Object.assign(Object.assign({text:t,isCorrect:!!r,isHighlighted:!!o,itemLead:this.itemLead(i,n),hint:s,instruction:a},this.toExample(u,c)),{isCaseSensitive:l});return p.ObjectUtils.removeUnwantedProperties(g,{ignoreAllFalse:!0}),g}flashcard(e){const{question:t,answer:r,alternativeAnswers:o,item:i,lead:n,hint:s,instruction:a,isDefaultExample:l,example:u}=e,c=Object.assign({question:t,answer:r,alternativeAnswers:o,itemLead:this.itemLead(i,n),hint:s,instruction:a},this.toExampleBoolean(l,u));return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}statement(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:s,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:s},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return p.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}imageSource(e){const{url:t,mockupId:r,size:o,format:i,trim:n}=e,s={url:t,mockupId:r,size:o,format:i,trim:n};return p.ObjectUtils.removeUnwantedProperties(s,{ignoreFalse:["trim"]}),s}partner(e){const{name:t,avatarImage:r}=e,o={name:t,avatarImage:r};return p.ObjectUtils.removeUnwantedProperties(o),o}comment(e){const{text:t,location:r}=e,o={text:t,location:r};return p.ObjectUtils.removeUnwantedProperties(o),o}itemLead(e,t){let r;return(e||t)&&(r={item:e,lead:t}),r}cardNode(e){let t;const{questions:r,elements:o,flashcards:i,statement:n,statements:s,choices:a,responses:l,quizzes:u,heading:c,pairs:g,matrix:d,botResponses:y}=e;return(r||o||i||n||s||a||l||u||c||g||d||y)&&(t={questions:r,elements:o,flashcards:i,statement:n,statements:s,choices:a,responses:l,quizzes:u,heading:c,pairs:g,matrix:d,botResponses:y},p.ObjectUtils.removeUnwantedProperties(t)),t}pushExampleDownTree(e,t,r,o){if(r||o){if(t){if(this.pushExampleDownTreeString(r,o,t.pairs),this.pushExampleDownTreeBoolean(r,o,!1,t.flashcards),this.pushExampleDownTreeBoolean(r,o,!0,t.choices),this.pushExampleDownTreeBoolean(r,o,!1,t.responses,t.statements,t.statement),t.quizzes)for(const e of t.quizzes)this.pushExampleDownTreeBoolean(r,o,!0,e.choices),this.pushExampleDownTreeBoolean(r,o,!1,e.responses);if(t.matrix)for(const e of t.matrix)this.pushExampleDownTreeString(r,o,e.cells)}e&&this.pushExampleDownTreeBodyBits(r,o,e)}}pushExampleDownTreeBoolean(e,t,r,...o){if((e||t)&&Array.isArray(o))for(const i of o)if(i){const o=Array.isArray(i)?i:[i];u.BitUtils.fillBooleanExample(o,e,t,r)}}pushExampleDownTreeString(e,t,...r){if((e||t)&&Array.isArray(r))for(const o of r)if(o){const r=Array.isArray(o)?o:[o];u.BitUtils.fillStringExample(r,e,t,!1)}}pushExampleDownTreeBodyBits(e,t,r){if((e||t)&&r&&r.bodyParts&&0!==r.bodyParts.length)for(const o of r.bodyParts)if(o)switch(o.type){case n.BodyBitType.gap:{const r=o;u.BitUtils.fillStringExample([r.data],e,t,!1);break}case n.BodyBitType.mark:{const r=o;u.BitUtils.fillBooleanExample([r.data],e,t,!1);break}case n.BodyBitType.select:{const r=o;u.BitUtils.fillBooleanExample(r.data.options,e,t,!0);break}case n.BodyBitType.highlight:{const r=o;u.BitUtils.fillBooleanExample(r.data.texts,e,t,!0);break}}}pushDownTree(e,t,r,o,i,n){if(void 0!==n){if(r&&o){const e=r[o];if(Array.isArray(e))for(const t of e)null==t[i]&&(t[i]=n)}if(t&&e&&e.bodyParts&&e.bodyParts.length>0)for(const r of e.bodyParts)if(r&&-1!==t.indexOf(r.type)){r.data[i]=n}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const r={};for(const[e,o]of t)r[e]=l.ArrayUtils.asArray(o)||[o];return r}setIsExampleFlags(e){var t,r,o,i,s,a,l,u,c,p,g,d,y;e.isExample=!1;const f=t=>!!t&&(t.isDefaultExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:h,cardNode:m}=e;if(h&&h.bodyParts)for(const e of h.bodyParts)switch(e.type){case n.BodyBitType.gap:case n.BodyBitType.mark:f(e.data);break;case n.BodyBitType.select:{const t=e;let r=!1;for(const e of t.data.options)r=!!f(e)||r;t.data.isExample=r;break}case n.BodyBitType.highlight:{const t=e;let r=!1;for(const e of t.data.texts)r=!!f(e)||r;t.data.isExample=r;break}}if(m){for(const e of null!==(t=m.flashcards)&&void 0!==t?t:[])f(e);for(const e of null!==(r=m.pairs)&&void 0!==r?r:[])f(e);for(const e of null!==(o=m.matrix)&&void 0!==o?o:[]){let t=!1;for(const r of null!==(i=e.cells)&&void 0!==i?i:[])t=!!f(r)||t;e.isExample=t}for(const e of null!==(s=m.quizzes)&&void 0!==s?s:[]){let t=!1;for(const r of null!==(a=e.responses)&&void 0!==a?a:[])t=!!f(r)||t;for(const r of null!==(l=e.choices)&&void 0!==l?l:[])t=!!f(r)||t;e.isExample=t}for(const e of null!==(u=m.responses)&&void 0!==u?u:[])f(e);for(const e of null!==(c=m.choices)&&void 0!==c?c:[])f(e);for(const e of null!==(p=m.statements)&&void 0!==p?p:[])f(e);f(m.statement);for(const e of null!==(g=m.questions)&&void 0!==g?g:[])f(e)}f(e.statement);for(const t of null!==(d=e.responses)&&void 0!==d?d:[])f(t);for(const t of null!==(y=e.choices)&&void 0!==y?y:[])f(t);f(e)}setDefaultBitValues(e){switch(e.bitType.alias){case i.AliasBitType.articleAi:case i.AliasBitType.noteAi:case i.AliasBitType.summaryAi:e.aiGenerated=this.toAstProperty(o.PropertyConfigKey.aiGenerated,!0)}}addVersionToParserInfo(e){var t;const r=null!==(t=e.parser)&&void 0!==t?t:{};r.version=g.env.appVersion.full,e.parser=r}}t.Builder=f},8703:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceBuilder=void 0;const i=r(9779),n=r(3589),s=r(169),a=r(1),l=r(2377);class u extends a.BaseBuilder{resource(e){var t;let r;const{type:n,value:s,format:a}=e,l=o(e,["type","value","format"]),u=Object.assign({type:n,value:null!=s?s:"",format:null!=a?a:""},l);switch(n){case i.ResourceTag.video:case i.ResourceTag.videoEmbed:case i.ResourceTag.videoLink:case i.ResourceTag.stillImageFilmEmbed:case i.ResourceTag.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],o=[];for(const t of r){const r=e[t];if(r){const e=this.resource({type:i.ResourceTag.image,value:r});e&&o.push(e)}}u.thumbnails=[...null!==(t=u.thumbnails)&&void 0!==t?t:[],...o]}}switch(n){case i.ResourceTag.image:case i.ResourceTag.imagePortrait:case i.ResourceTag.imageLandscape:r=this.imageResource(u,n);break;case i.ResourceTag.imageLink:r=this.imageLinkResource(u);break;case i.ResourceTag.audio:r=this.audioResource(u);break;case i.ResourceTag.audioEmbed:r=this.audioEmbedResource(u);break;case i.ResourceTag.audioLink:r=this.audioLinkResource(u);break;case i.ResourceTag.video:r=this.videoResource(u);break;case i.ResourceTag.videoEmbed:r=this.videoEmbedResource(u);break;case i.ResourceTag.videoLink:r=this.videoLinkResource(u);break;case i.ResourceTag.stillImageFilmEmbed:r=this.stillImageFilmEmbedResource(u);break;case i.ResourceTag.stillImageFilmLink:r=this.stillImageFilmLinkResource(u);break;case i.ResourceTag.article:r=this.articleResource(u);break;case i.ResourceTag.document:r=this.documentResource(u);break;case i.ResourceTag.documentEmbed:r=this.documentEmbedResource(u);break;case i.ResourceTag.documentLink:r=this.documentLinkResource(u);break;case i.ResourceTag.documentDownload:r=this.documentDownloadResource(u);break;case i.ResourceTag.appLink:r=this.appLinkResource(u);break;case i.ResourceTag.websiteLink:r=this.websiteLinkResource(u)}return r}imageResource(e,t){const{value:r,src1x:o,src2x:a,src3x:u,src4x:c,width:p,height:g,alt:d,license:y,copyright:f,showInIndex:h,caption:m}=e,T={type:i.ResourceTag.image,typeAlias:null!=t?t:i.ResourceTag.image,format:s.UrlUtils.fileExtensionFromUrl(r),provider:s.UrlUtils.domainFromUrl(r),value:r,src1x:o,src2x:a,src3x:u,src4x:c,width:p,height:g,alt:d,license:y,copyright:f,showInIndex:h,caption:m};return n.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}imageLinkResource(e){const{value:t,src1x:r,src2x:o,src3x:a,src4x:u,width:c,height:p,alt:g,license:d,copyright:y,showInIndex:f,caption:h}=e,m={type:i.ResourceTag.imageLink,typeAlias:i.ResourceTag.imageLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:o,src3x:a,src4x:u,width:c,height:p,alt:g,license:d,copyright:y,showInIndex:f,caption:h};return n.ObjectUtils.removeUnwantedProperties(m),l.NodeValidator.validateResource(m)}audioResource(e){const{value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g}=e,d={type:i.ResourceTag.audio,typeAlias:i.ResourceTag.audio,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g};return n.ObjectUtils.removeUnwantedProperties(d),l.NodeValidator.validateResource(d)}audioEmbedResource(e){const{value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g}=e,d={type:i.ResourceTag.audioEmbed,typeAlias:i.ResourceTag.audioEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g};return n.ObjectUtils.removeUnwantedProperties(d),l.NodeValidator.validateResource(d)}audioLinkResource(e){const{value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g}=e,d={type:i.ResourceTag.audioLink,typeAlias:i.ResourceTag.audioLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:a,license:u,copyright:c,showInIndex:p,caption:g};return n.ObjectUtils.removeUnwantedProperties(d),l.NodeValidator.validateResource(d)}videoResource(e){const{value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:i.ResourceTag.video,typeAlias:i.ResourceTag.video,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return n.ObjectUtils.removeUnwantedProperties(v),l.NodeValidator.validateResource(v)}videoEmbedResource(e){const{value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:i.ResourceTag.videoEmbed,typeAlias:i.ResourceTag.videoEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return n.ObjectUtils.removeUnwantedProperties(v),l.NodeValidator.validateResource(v)}videoLinkResource(e){const{value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:i.ResourceTag.videoLink,typeAlias:i.ResourceTag.videoLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return n.ObjectUtils.removeUnwantedProperties(v),l.NodeValidator.validateResource(v)}stillImageFilmEmbedResource(e){const{value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:i.ResourceTag.stillImageFilmEmbed,typeAlias:i.ResourceTag.stillImageFilmEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return n.ObjectUtils.removeUnwantedProperties(v),l.NodeValidator.validateResource(v)}stillImageFilmLinkResource(e){const{value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:i.ResourceTag.stillImageFilmLink,typeAlias:i.ResourceTag.stillImageFilmLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:a,mute:u,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return n.ObjectUtils.removeUnwantedProperties(v),l.NodeValidator.validateResource(v)}articleResource(e){const{value:t,license:r,copyright:o,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.article,typeAlias:i.ResourceTag.article,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentResource(e){const{value:t,license:r,copyright:o,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.document,typeAlias:i.ResourceTag.document,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentEmbedResource(e){const{value:t,license:r,copyright:o,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.documentEmbed,typeAlias:i.ResourceTag.documentEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentLinkResource(e){const{value:t,license:r,copyright:o,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.documentLink,typeAlias:i.ResourceTag.documentLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentDownloadResource(e){const{value:t,license:r,copyright:o,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.documentDownload,typeAlias:i.ResourceTag.documentDownload,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}appLinkResource(e){const{value:t,license:r,copyright:o,showInIndex:s,caption:a}=e,u={type:i.ResourceTag.appLink,typeAlias:i.ResourceTag.appLink,value:t,license:r,copyright:o,showInIndex:s,caption:a};return n.ObjectUtils.removeUnwantedProperties(u),l.NodeValidator.validateResource(u)}websiteLinkResource(e){const{value:t,siteName:r,license:o,copyright:s,showInIndex:a,caption:u}=e,c={type:i.ResourceTag.websiteLink,typeAlias:i.ResourceTag.websiteLink,value:t,siteName:r,license:o,copyright:s,showInIndex:a,caption:u};return n.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}}t.ResourceBuilder=u},2377:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValidator=void 0;const o=r(208),i=r(3633);const n=new class{validateBit(e){if(!e)return e;let t=e;if(e.bitType.root===o.RootBitType.interview)t=this.validateInterviewBit(e);return t}validateResource(e){if(!e)return;let t=e,r=!1;return e.type,r=!!e.value,r||e.type&&(t={type:e.type,typeAlias:e.type}),t}isRequired(e,t){if(!e)throw new Error(`${t} is required but is not set`)}isOneOfRequired(e,t){if(Array.isArray(e))for(const t of e)if(t)return;throw new Error(`One of '${t.join(", ")}' is required but none is set`)}isString(e,t){if(!i.StringUtils.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!i.StringUtils.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!i.StringUtils.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!i.StringUtils.isString(e)||""===e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a non-empty string or a boolean`)}isArray(e,t){if(!Array.isArray(e))throw new Error(`${t} is required to be a array`)}isNonEmptyArray(e,t){if(!(Array.isArray(e)&&e.length>0))throw new Error(`${t} is required to be a non-empty array`)}isNumber(e,t){if(!Number.isFinite(e))throw new Error(`${t} is required to be a number`)}isBoolean(e,t){if(!0!==e&&!1!==e)throw new Error(`${t} is required to be a boolean`)}isStringOrNumberOrBooleanOrNullOrUndefined(e,t){if(!i.StringUtils.isString(e)&&!Number.isFinite(e)&&!0!==e&&!1!==e&&null!=e)throw new Error(`${t} is required to be a string or a number or a boolean or null or undefined`)}validateInterviewBit(e){return e.cardNode||(e.cardNode={}),e.cardNode.questions||(e.cardNode.questions=[]),e}};t.NodeValidator=n},227:function(e,t){var r=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;t.StringWriter=class{constructor(){this._string="",this.endOfLineString="\n"}get isSync(){return!0}getString(){return this._string}open(){return r(this,void 0,void 0,(function*(){this.openSync(),Promise.resolve()}))}close(){return r(this,void 0,void 0,(function*(){try{this.closeSync()}catch(e){return Promise.reject(e)}Promise.resolve()}))}openSync(){this._buffer=[],this._string=""}closeSync(){if(!this._buffer)throw new Error("open() or openSync() never called");this._string=this._buffer.join(""),this._buffer=[]}writeLine(e){return this._buffer?(null!=e?this._buffer.push(e+this.endOfLineString):this._buffer.push(this.endOfLineString),this):this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;for(let r=0,o=e.length;r<o;r++){const i=e[r];this._buffer.push(i),t&&r<o-1&&this._buffer.push(t),this._buffer.push(this.endOfLineString)}return this}write(e){return this._buffer?(null==e||this._buffer.push(e),this):this}writeWhiteSpace(){return this.write(" "),this}}},2606:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Config=void 0;const o=r(429),i=r(7585),n=r(3059),s=r(5428),a=r(742),l=r(8360),u=r(3141),c=r(9036),p=r(6260),g=r(208);const d=new class{constructor(){this.bitTypeAliasMap=new Map,this.bitCache=new Map,this.comboResourcesCache=new Map,this.buildBitTypeAliasMap()}getBitType(e){const t=this.getAliasedBitType(e);return{alias:t,root:this.getRootBitType(t)}}getBitConfig(e){var t;let r=this.bitCache.get(e.alias);if(!r){const i=()=>{throw new Error(`No config found for bit: ALIAS:${e.alias}, ROOT:${e.root}`)},n=u.BITS[e.root];n||i();const s=e.root!==e.alias;let a;s&&n.aliases&&(a=n.aliases[e.alias]),s&&!a&&i();const{since:c,deprecated:p}=a||n,d=n.aliases?Object.keys(n.aliases).map((e=>g.AliasBitType.fromValue(e))):[],{tags:y,cardSet:f,bodyAllowed:h,bodyRequired:m,footerAllowed:T,footerRequired:b,resourceAttachmentAllowed:v,rootExampleType:C}=n,x=this.getAllResourcesTagsWithZeroCounts(),A=l.ConfigHydrator.hydrateTagsConfig(y),w=l.ConfigHydrator.hydrateCardSetConfig(f),B=null===(t=A.info)||void 0===t?void 0:t.comboResourceType,k=Object.assign({},A.tags);for(const[e,t]of Object.entries(x))k[e]||(k[e]=t);r=new o.BitConfig(c,e,d,k,w,p,h,m,T,b,v,C,B),this.bitCache.set(e.root,r)}return r}getRawPropertiesConfig(){return p.PROPERTIES}getTagConfigForTag(e,t){if(e)for(const[,r]of Object.entries(e))if(r.tag===t)return r}getTagsConfigForCardSet(e,t,r){const o=this.getBitConfig(e);if(!o)return;const i=o.cardSet;if(!i)return;t=Math.min(t,i.variants.length-1);const n=i.variants[t];return n[r=Math.min(r,n.length-1)].tags}getBitResourcesConfig(e,t){var r;let o={};const s=new Map,l=this.getBitConfig(e),u={};for(const[e,t]of Object.entries(l.tags))t.type===a.BitTagType.resource&&(u[e]=t);const c=null!==(r=l.comboResourceType)&&void 0!==r?r:l.resourceAttachmentAllowed&&t;if(c){const e=new Map,r=this.getComboResource(c);if(r){const t=Object.values(r).filter((e=>e.type===a.BitTagType.resource));t.map((e=>e.tag)).forEach((r=>{const o=t.find((e=>e.tag===r));o&&e.set(r,o)}));const o=this.getComboResourceTagTypes(c);o&&o.length>0&&s.set(c,o)}if(t)for(const[t,r]of Object.entries(u)){const n=c===r.tag,s=!!e&&e.has(r.tag);if(n){const e=new i.ResourceTagConfig(r.configKey,r.tag,1,1,r.chain,r.jsonKey,r.deprecated);o[t]=e}else if(s){if(e){const i=e.get(r.tag);i&&(o[t]=i)}}else o[t]=r}else o=u}else o=u;return new n.ResourcesConfig(o,l.resourceAttachmentAllowed,t,s)}getComboResourceTagTypes(e){const t=this.getComboResource(e);if(t){return Object.values(t).filter((e=>e.type===a.BitTagType.resource)).map((e=>e.tag))}}getComboResource(e){if(!e)return;let t=this.comboResourcesCache.get(e);return t||(t={},Object.values(c.GROUPS).filter((t=>t.type===s.GroupConfigType.comboResource&&t.comboResourceType===e)).forEach((e=>{t=Object.assign(Object.assign({},t),l.ConfigHydrator.hydrateTagsConfig(e.tags).tags)})),0===Object.keys(t).length&&(t=void 0),this.comboResourcesCache.set(e,t)),t}getAllResourcesTagsWithZeroCounts(){let e=this.allResourcesCache;if(!e){e={},Object.values(c.GROUPS).filter((e=>e.type===s.GroupConfigType.resource)).forEach((t=>{e=Object.assign(Object.assign({},e),l.ConfigHydrator.hydrateTagsConfig(t.tags).tags)}));for(const t of Object.values(e)){const e=t;e.maxCount=0,e.minCount=0}this.allResourcesCache=e}return e}buildBitTypeAliasMap(){for(const e of g.RootBitType.values())this.bitTypeAliasMap.set(e,e);for(const[e,t]of Object.entries(u.BITS))if(t.aliases)for(const r of Object.keys(t.aliases))this.bitTypeAliasMap.set(r,e)}getRootBitType(e){var t;return e&&null!==(t=this.bitTypeAliasMap.get(e))&&void 0!==t?t:g.RootBitType._error}getAliasedBitType(e){var t,r;return null!==(r=null!==(t=g.AliasBitType.fromValue(e))&&void 0!==t?t:g.RootBitType.fromValue(e))&&void 0!==r?r:g.RootBitType._error}};t.Config=d},8360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigHydrator=void 0;const o=r(2005),i=r(3585),n=r(6620),s=r(6956),a=r(7585),l=r(8620),u=r(177),c=r(3518),p=r(6194),g=r(1595),d=r(742),y=r(4182),f=r(9036),h=r(6260),m=r(5100),T=r(3622);const b=new class{hydrateTagsConfig(e){var t;const r={tags:{}};for(const o of e){let e;switch(o.type){case d.BitTagType.tag:e=this.hydrateTagConfig(o);break;case d.BitTagType.property:e=this.hydratePropertyTagConfig(o);break;case d.BitTagType.resource:e=this.hydrateResourceTagConfig(o);break;case d.BitTagType.group:e=this.hydrateTagGroupConfig(o)}e&&(r.tags=Object.assign(Object.assign({},r.tags),e.tags),r.info=Object.assign(null!==(t=r.info)&&void 0!==t?t:{},e.info))}return r}hydrateCardSetConfig(e){if(!e)return;const t=y.CARDS[e];if(!t)throw new Error(`No config found for card set config key '${e}'`);const r=[];for(const e of t.variants){const t=[];for(const r of e){const e=this.hydrateCardVariantConfig(r);t.push(e)}r.push(t)}return new o.CardSetConfig(e,r)}hydrateTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,s=g.TagConfigKey.fromKey(t)||l.ConfigKey._unknown,a=T.TAGS[s];if(!a)throw new Error(`No config found for tag config key '${t}'`);const{tag:u,deprecated:c}=a;let p;i&&(p=this.hydrateTagsConfig(i).tags);return{tags:{[s]:new n.MarkupTagConfig(s,u,null!=r?r:1,null!=o?o:0,p,c)}}}hydratePropertyTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,n=c.PropertyConfigKey.fromKey(t)||l.ConfigKey._unknown,a=h.PROPERTIES[n];if(!a)throw new Error(`No config found for property config key '${t}'`);const{tag:u,deprecated:p,single:g,format:d,defaultValue:y,jsonKey:f,astKey:m}=a;let T;i&&(T=this.hydrateTagsConfig(i).tags);return{tags:{[n]:new s.PropertyTagConfig(n,u,null!=r?r:1,null!=o?o:0,T,f,m,g,d,y,p)}}}hydrateResourceTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,n=p.ResourceConfigKey.fromKey(t)||l.ConfigKey._unknown,s=m.RESOURCES[n];if(!s)throw new Error(`No config found for resource config key '${t}'`);const{tag:u,deprecated:c,jsonKey:g}=s;let d;i&&(d=this.hydrateTagsConfig(i).tags);return{tags:{[n]:new a.ResourceTagConfig(n,u,null!=r?r:1,null!=o?o:0,d,g,c)}}}hydrateTagGroupConfig(e){var t,r;const{configKey:o}=e,i=u.GroupConfigKey.fromKey(o)||l.ConfigKey._unknown,n=f.GROUPS[i];if(!n)throw new Error(`No config found for group config key '${o}'`);const{tags:s}=n,a=this.hydrateTagsConfig(s).tags,c=Object.values(a);if(c.length>0){const o=c[0],i=o;i.maxCount=null!==(t=e.maxCount)&&void 0!==t?t:o.maxCount,i.minCount=null!==(r=e.minCount)&&void 0!==r?r:o.minCount}return{tags:a,info:{comboResourceType:n.comboResourceType}}}hydrateCardVariantConfig(e){const{tags:t,bodyAllowed:r,bodyRequired:o,repeatCount:n}=e,s=this.hydrateTagsConfig(t);return new i.CardVariantConfig(s.tags,r,o,n)}};t.ConfigHydrator=b},3141:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BITS=void 0;const o=r(2574),i=r(177),n=r(3518),s=r(1595),a=r(742),l=r(208),u=r(1035),c=r(7028),p={[l.RootBitType._error]:{since:"1.3.0",tags:[],bodyAllowed:!0,aliases:{}},[l.RootBitType.appFlashcards]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.title},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.flashcardSet,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.appFlashcardsQuiz]:{since:"1.3.0"},[l.AliasBitType.appFlashcardsLearn]:{since:"1.3.0"}}},[l.RootBitType.appLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAppLink,minCount:1}],bodyAllowed:!1},[l.RootBitType.article]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.statement]:{since:"1.3.0"},[l.AliasBitType.buttonCopyText]:{since:"1.4.3"}}},[l.RootBitType.appBitmarkFromJavascript]:{since:"1.4.5",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.maxCreatedBits}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.appBitmarkFromEditor]:{since:"1.4.5"}}},[l.RootBitType.articleEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceArticleEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.articleLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceArticleLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.audio]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudio,minCount:1}],bodyAllowed:!0},[l.RootBitType.audioEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.audioLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.bitAlias]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.tag_reference},{type:a.BitTagType.tag,configKey:s.TagConfigKey.anchor}],bodyAllowed:!0},[l.RootBitType.book]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_bookCommon}],bodyAllowed:!0,aliases:{[l.AliasBitType.bookAcknowledgments]:{since:"1.3.0"},[l.AliasBitType.bookAddendum]:{since:"1.3.0"},[l.AliasBitType.bookAfterword]:{since:"1.3.0"},[l.AliasBitType.bookAppendix]:{since:"1.3.0"},[l.AliasBitType.bookArticle]:{since:"1.3.0"},[l.AliasBitType.bookAutherBio]:{since:"1.3.0"},[l.AliasBitType.bookBibliography]:{since:"1.3.0"},[l.AliasBitType.bookComingSoon]:{since:"1.3.0"},[l.AliasBitType.bookConclusion]:{since:"1.3.0"},[l.AliasBitType.bookCopyright]:{since:"1.3.0"},[l.AliasBitType.bookCopyrightPermissions]:{since:"1.3.0"},[l.AliasBitType.bookDedication]:{since:"1.3.0"},[l.AliasBitType.bookEndnotes]:{since:"1.3.0"},[l.AliasBitType.bookEpigraph]:{since:"1.3.0"},[l.AliasBitType.bookEpilogue]:{since:"1.3.0"},[l.AliasBitType.bookForword]:{since:"1.3.0"},[l.AliasBitType.bookFrontispiece]:{since:"1.3.0"},[l.AliasBitType.bookImprint]:{since:"1.3.0"},[l.AliasBitType.bookIncitingIncident]:{since:"1.3.0"},[l.AliasBitType.bookIntroduction]:{since:"1.3.0"},[l.AliasBitType.bookListOfContributors]:{since:"1.3.0"},[l.AliasBitType.bookNotes]:{since:"1.3.0"},[l.AliasBitType.bookPostscript]:{since:"1.3.0"},[l.AliasBitType.bookPreface]:{since:"1.3.0"},[l.AliasBitType.bookPrologue]:{since:"1.3.0"},[l.AliasBitType.bookReadMore]:{since:"1.3.0"},[l.AliasBitType.bookReferenceList]:{since:"1.3.0"},[l.AliasBitType.bookRequestForABookReview]:{since:"1.3.0"},[l.AliasBitType.bookSummary]:{since:"1.3.0"},[l.AliasBitType.bookTeaser]:{since:"1.3.0"},[l.AliasBitType.bookTitle]:{since:"1.3.0"}}},[l.RootBitType.bookAlias]:{since:"1.4.3",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_bookCommon},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.bookAlias,maxCount:u.Count.infinity}],bodyAllowed:!0},[l.RootBitType.botActionResponse]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._botActionResponses,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.botActionSend]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.date}],bodyAllowed:!0},[l.RootBitType.browserImage]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.focusY}],bodyAllowed:!0},[l.RootBitType.card1]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.question1]:{since:"1.3.0"},[l.AliasBitType.survey1]:{since:"1.3.0"},[l.AliasBitType.surveyAnonymous1]:{since:"1.3.0"}}},[l.RootBitType.chapter]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.anchor},{type:a.BitTagType.tag,configKey:s.TagConfigKey.title},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.toc},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.progress}],bodyAllowed:!0},[l.RootBitType.clozeAndMultipleChoiceText]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_gap},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachCallToActionClozeAndMultipleChoiceText]:{since:"1.3.0"}}},[l.RootBitType.cloze]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_gap}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.clozeInstructionGrouped]:{since:"1.3.0"},[l.AliasBitType.clozeSolutionGrouped]:{since:"1.3.0"},[l.AliasBitType.coachSelfReflectionCloze]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionCloze]:{since:"1.3.0"}}},[l.RootBitType.code]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.computerLanguage}],bodyAllowed:!0,aliases:{[l.AliasBitType.appCodeCell]:{since:"1.4.3"},[l.AliasBitType.appCodeEditor]:{since:"1.4.3"},[l.AliasBitType.appCodeIde]:{since:"1.4.3"},[l.AliasBitType.codeRuntime]:{since:"1.4.3"},[l.AliasBitType.consoleLog]:{since:"1.4.3"},[l.AliasBitType.output]:{since:"1.4.3"},[l.AliasBitType.stdout]:{since:"1.4.3"}}},[l.RootBitType.conversationLeft1]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_partner}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.conversationLeft1Scream]:{since:"1.3.0"},[l.AliasBitType.conversationLeft1Thought]:{since:"1.3.0"},[l.AliasBitType.conversationRight1]:{since:"1.3.0"},[l.AliasBitType.conversationRight1Scream]:{since:"1.3.0"},[l.AliasBitType.conversationRight1Thought]:{since:"1.3.0"}}},[l.RootBitType.document]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocument,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentDownload]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentDownload,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.essay]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.partialAnswer},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.property_reference,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.coachSelfReflectionEssay]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionEssay]:{since:"1.3.0"}}},[l.RootBitType.example]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.appAiPrompt]:{since:"1.3.0"},[l.AliasBitType.aiPrompt]:{since:"1.3.0"},[l.AliasBitType.articleAi]:{since:"1.3.0"},[l.AliasBitType.articleAttachment]:{since:"1.3.0"},[l.AliasBitType.assignment]:{since:"1.3.0"},[l.AliasBitType.audioTranscript]:{since:"1.3.0"},[l.AliasBitType.bitmarkExample]:{since:"1.3.0"},[l.AliasBitType.blogArticle]:{since:"1.3.0"},[l.AliasBitType.bug]:{since:"1.3.0"},[l.AliasBitType.checklist]:{since:"1.3.0"},[l.AliasBitType.coachAudioTranscript]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionChecklist]:{since:"1.3.0"},[l.AliasBitType.coachHomeRules]:{since:"1.3.0"},[l.AliasBitType.coachVideoTranscript]:{since:"1.3.0"},[l.AliasBitType.correction]:{since:"1.3.0"},[l.AliasBitType.cookPreparation]:{since:"1.3.0"},[l.AliasBitType.cookStep]:{since:"1.3.0"},[l.AliasBitType.cookIngredients]:{since:"1.3.0"},[l.AliasBitType.cookRemark]:{since:"1.3.0"},[l.AliasBitType.cookVariation]:{since:"1.3.0"},[l.AliasBitType.cookInsert]:{since:"1.3.0"},[l.AliasBitType.cookArrangement]:{since:"1.3.0"},[l.AliasBitType.cookPracticeAdvise]:{since:"1.3.0"},[l.AliasBitType.cookPlate]:{since:"1.3.0"},[l.AliasBitType.cookRecommendation]:{since:"1.3.0"},[l.AliasBitType.cookPersonalRecommendation]:{since:"1.3.0"},[l.AliasBitType.cookSideDrink]:{since:"1.3.0"},[l.AliasBitType.cookSideDish]:{since:"1.3.0"},[l.AliasBitType.cookTimer]:{since:"1.3.0"},[l.AliasBitType.danger]:{since:"1.3.0"},[l.AliasBitType.details1]:{since:"1.3.0"},[l.AliasBitType.details]:{since:"1.3.0"},[l.AliasBitType.editorial]:{since:"1.3.0"},[l.AliasBitType.editorNote]:{since:"1.3.0"},[l.AliasBitType.featured]:{since:"1.3.0"},[l.AliasBitType.help]:{since:"1.3.0"},[l.AliasBitType.hint]:{since:"1.3.0"},[l.AliasBitType.info]:{since:"1.3.0"},[l.AliasBitType.langLearningOutcomes]:{since:"1.3.0"},[l.AliasBitType.langEnablingLanguageSkills]:{since:"1.3.0"},[l.AliasBitType.langLifeSkills]:{since:"1.3.0"},[l.AliasBitType.langEnglishAroundWorld]:{since:"1.3.0"},[l.AliasBitType.langGoodToKnow]:{since:"1.3.0"},[l.AliasBitType.langLearningGoal]:{since:"1.3.0"},[l.AliasBitType.langLearningStrategy]:{since:"1.3.0"},[l.AliasBitType.langLikeALocal]:{since:"1.3.0"},[l.AliasBitType.langMaterial]:{since:"1.3.0"},[l.AliasBitType.langUsefulPhrases]:{since:"1.3.0"},[l.AliasBitType.langLevelDown]:{since:"1.3.0"},[l.AliasBitType.langLevelUp]:{since:"1.3.0"},[l.AliasBitType.langExtraActivity]:{since:"1.3.0"},[l.AliasBitType.langVideoScript]:{since:"1.3.0"},[l.AliasBitType.langAudioScript]:{since:"1.3.0"},[l.AliasBitType.langVocabulary]:{since:"1.3.0"},[l.AliasBitType.langHomework]:{since:"1.3.0"},[l.AliasBitType.langTeacherNote]:{since:"1.3.0"},[l.AliasBitType.langTeacherPronunciation]:{since:"1.3.0"},[l.AliasBitType.message]:{since:"1.3.0"},[l.AliasBitType.newspaperArticle]:{since:"1.3.0"},[l.AliasBitType.note]:{since:"1.3.0"},[l.AliasBitType.noteAi]:{since:"1.3.0"},[l.AliasBitType.notebookArticle]:{since:"1.3.0"},[l.AliasBitType.preparationNote]:{since:"1.3.0"},[l.AliasBitType.releaseNotesSummary]:{since:"1.3.0"},[l.AliasBitType.remark]:{since:"1.3.0"},[l.AliasBitType.reviewNote]:{since:"1.3.0"},[l.AliasBitType.reviewAuthorNote]:{since:"1.3.0"},[l.AliasBitType.reviewReviewerNote]:{since:"1.3.0"},[l.AliasBitType.reviewRequestForReviewNote]:{since:"1.3.0"},[l.AliasBitType.reviewApprovedNote]:{since:"1.3.0"},[l.AliasBitType.selfAssessment]:{since:"1.3.0"},[l.AliasBitType.sideNote]:{since:"1.3.0"},[l.AliasBitType.summary]:{since:"1.3.0"},[l.AliasBitType.summaryAi]:{since:"1.3.0"},[l.AliasBitType.videoTranscript]:{since:"1.3.0"},[l.AliasBitType.warning]:{since:"1.3.0"},[l.AliasBitType.workbookArticle]:{since:"1.3.0"}}},[l.RootBitType.flashcard]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._flashcards,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.flashcard1]:{since:"1.3.0"}}},[l.RootBitType.focusImage]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.focusY}],bodyAllowed:!0},[l.RootBitType.highlightText]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.image]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.appCreateBitsFromImage]:{since:"1.3.0"},[l.AliasBitType.appGetScreenshot]:{since:"1.3.0"},[l.AliasBitType.detailsImage]:{since:"1.3.0"},[l.AliasBitType.figure]:{since:"1.3.0",deprecated:"1.4.0"},[l.AliasBitType.imageBanner]:{since:"1.3.0"},[l.AliasBitType.imageFigure]:{since:"1.3.0"},[l.AliasBitType.imageLandscape]:{since:"1.3.0"},[l.AliasBitType.imageMood]:{since:"1.3.0"},[l.AliasBitType.imagePortrait]:{since:"1.3.0"},[l.AliasBitType.imagePrototype]:{since:"1.3.0"},[l.AliasBitType.imageScreenshot]:{since:"1.3.0"},[l.AliasBitType.imageStyled]:{since:"1.3.0"},[l.AliasBitType.imageSuperWide]:{since:"1.3.0"},[l.AliasBitType.imageZoom]:{since:"1.3.0"},[l.AliasBitType.langLifeSkillIcon]:{since:"1.3.0"},[l.AliasBitType.lifeSkillSticker]:{since:"1.3.0"},[l.AliasBitType.pageBanner]:{since:"1.4.3"},[l.AliasBitType.screenshot]:{since:"1.3.0",deprecated:"1.4.0"}}},[l.RootBitType.imageLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.imageOnDevice]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_imageSource}],bodyAllowed:!0},[l.RootBitType.imageResponsive]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageResponsive}],bodyAllowed:!0},[l.RootBitType.internalLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.tag_reference}],bodyAllowed:!0},[l.RootBitType.interview]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars}],cardSet:o.CardSetConfigKey._questions,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.interviewInstructionGrouped]:{since:"1.3.0"},[l.AliasBitType.botInterview]:{since:"1.3.0"}}},[l.RootBitType.learningPathBook]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.bookLink]:{since:"1.3.0"},[l.AliasBitType.bookLinkNext]:{since:"1.3.0"},[l.AliasBitType.bookLinkPrev]:{since:"1.3.0"},[l.AliasBitType.learningPathClassroomEvent]:{since:"1.3.0"},[l.AliasBitType.learningPathClassroomTraining]:{since:"1.3.0"},[l.AliasBitType.learningPathClosing]:{since:"1.3.0"},[l.AliasBitType.learningPathFeedback]:{since:"1.3.0"},[l.AliasBitType.learningPathLearningGoal]:{since:"1.3.0"},[l.AliasBitType.learningPathLti]:{since:"1.3.0"},[l.AliasBitType.learningPathSign]:{since:"1.3.0"},[l.AliasBitType.learningPathStep]:{since:"1.3.0"}}},[l.RootBitType.learningPathBotTraining]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.bot}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.learningPathExternalLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.externalLink},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.externalLinkText}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.learningPathVideoCall]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.videoCallLink}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.mark]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_markConfig},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_mark}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.match]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchPairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.matchAll]:{since:"1.3.0"},[l.AliasBitType.matchReverse]:{since:"1.3.0"},[l.AliasBitType.matchAllReverse]:{since:"1.3.0"},[l.AliasBitType.matchSolutionGrouped]:{since:"1.3.0"}}},[l.RootBitType.matchMatrix]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchMatrix,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.matchAudio]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchAudioPairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.matchPicture]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchImagePairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.multipleChoice1]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleChoice1]:{since:"1.3.0"}}},[l.RootBitType.multipleChoice]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],cardSet:o.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleChoice]:{since:"1.3.0"}}},[l.RootBitType.multipleChoiceText]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachCallToActionMultipleChoiceText]:{since:"1.3.0"},[l.AliasBitType.coachSelfReflectionMultipleChoiceText]:{since:"1.3.0"}}},[l.RootBitType.multipleResponse1]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleResponse1]:{since:"1.3.0"}}},[l.RootBitType.multipleResponse]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],cardSet:o.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleResponse]:{since:"1.3.0"}}},[l.RootBitType.page]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.title},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.thumbImage}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.pageBuyButton]:{since:"1.4.3",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.content2Buy}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.photo]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1}],bodyAllowed:!0},[l.RootBitType.quote]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.quotedPerson}],bodyAllowed:!0},[l.RootBitType.rating]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionRating]:{since:"1.3.0"}}},[l.RootBitType.releaseNote]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.releaseVersion}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.sampleSolution]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.tag,configKey:s.TagConfigKey.anchor},{type:a.BitTagType.tag,configKey:s.TagConfigKey.tag_reference}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.sequence]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._elements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,rootExampleType:c.ExampleType.boolean},[l.RootBitType.stillImageFilm]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilm}],bodyAllowed:!0},[l.RootBitType.stillImageFilmEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilmEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.stillImageFilmLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilmLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.surveyAnonymous]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.survey]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.toc]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],bodyAllowed:!0,aliases:{[l.AliasBitType.anchor]:{since:"1.3.0"},[l.AliasBitType.bitBookEnding]:{since:"1.3.0"},[l.AliasBitType.bitBookSummary]:{since:"1.3.0"},[l.AliasBitType.botActionAnnounce]:{since:"1.3.0"},[l.AliasBitType.botActionRatingNumber]:{since:"1.3.0"},[l.AliasBitType.botActionRemind]:{since:"1.3.0"},[l.AliasBitType.botActionSave]:{since:"1.3.0"},[l.AliasBitType.botActionTrueFalse]:{since:"1.3.0"},[l.AliasBitType.chapterSubjectMatter]:{since:"1.3.0"},[l.AliasBitType.chat]:{since:"1.3.0"},[l.AliasBitType.conclusion]:{since:"1.3.0"},[l.AliasBitType.documentUpload]:{since:"1.3.0"},[l.AliasBitType.footNote]:{since:"1.3.0"},[l.AliasBitType.groupBorn]:{since:"1.3.0"},[l.AliasBitType.groupDied]:{since:"1.3.0"},[l.AliasBitType.recordAudio]:{since:"1.3.0"},[l.AliasBitType.stickyNote]:{since:"1.3.0"},[l.AliasBitType.takePicture]:{since:"1.3.0"}}},[l.RootBitType.trueFalse1]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse},{type:a.BitTagType.tag,configKey:s.TagConfigKey.true},{type:a.BitTagType.tag,configKey:s.TagConfigKey.false}],resourceAttachmentAllowed:!0,bodyAllowed:!1,rootExampleType:c.ExampleType.boolean},[l.RootBitType.trueFalse]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse}],cardSet:o.CardSetConfigKey._statements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.vendorPadletEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.padletId}],bodyAllowed:!0},[l.RootBitType.vendorJupyterOutput]:{since:"1.4.3",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.jupyterId},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.jupyterExecutionCount},{type:a.BitTagType.property,configKey:n.PropertyConfigKey.computerLanguage}],bodyAllowed:!0,aliases:{[l.AliasBitType.vendorJupyterCellCode]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterCellMarkdown]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterCellRaw]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterIpynb]:{since:"1.4.3"}}},[l.RootBitType.video]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideo,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoLandscape]:{since:"1.3.0"},[l.AliasBitType.videoPortrait]:{since:"1.3.0"}}},[l.RootBitType.videoEmbed]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoEmbed,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoEmbedLandscape]:{since:"1.3.0"},[l.AliasBitType.videoEmbedPortrait]:{since:"1.3.0"}}},[l.RootBitType.videoLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoLink,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoLinkLandscape]:{since:"1.3.0"},[l.AliasBitType.videoLinkPortrait]:{since:"1.3.0"}}},[l.RootBitType.websiteLink]:{since:"1.3.0",tags:[{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:a.BitTagType.group,configKey:i.GroupConfigKey.group_resourceWebsiteLink,minCount:1}],bodyAllowed:!0}};t.BITS=p},4182:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARDS=void 0;const o=r(2574),i=r(177),n=r(3518),s=r(6194),a=r(1595),l=r(742),u=r(1035),c={[o.CardSetConfigKey._flashcards]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._elements]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._statements]:{variants:[[{tags:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.true,maxCount:1},{type:l.BitTagType.tag,configKey:a.TagConfigKey.false,maxCount:1},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]]},[o.CardSetConfigKey._quiz]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]]},[o.CardSetConfigKey._questions]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:l.BitTagType.tag,configKey:a.TagConfigKey.sampleSolution},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.shortAnswer},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.longAnswer},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:a.TagConfigKey.title}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchAudioPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:a.TagConfigKey.title},{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.audio}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchImagePairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:a.TagConfigKey.title},{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.image}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchMatrix]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:a.TagConfigKey.title}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._botActionResponses]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reaction},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0}]]}};t.CARDS=c},9036:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GROUPS=void 0;const o=r(177),i=r(5428),n=r(3518),s=r(6194),a=r(1595),l=r(742),u=r(1035),c=r(9779),p={[o.GroupConfigKey.group_standardAllBits]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.id,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.externalId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.aiGenerated},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.ageRange,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.lang},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.target,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.tag,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.icon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.iconTag},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.colorTag,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:a.TagConfigKey.anchor}]},[o.GroupConfigKey.group_standardItemLeadInstructionHint]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.itemLead,maxCount:2},{type:l.BitTagType.tag,configKey:a.TagConfigKey.instruction},{type:l.BitTagType.tag,configKey:a.TagConfigKey.hint}]},[o.GroupConfigKey.group_standardExample]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.example}]},[o.GroupConfigKey.group_standardTags]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardAllBits},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]},[o.GroupConfigKey.group_imageSource]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.imageSource,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mockupId},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.size},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.format},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.trim}]}]},[o.GroupConfigKey.group_partner]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.partner,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage}]}]},[o.GroupConfigKey.group_gap]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.gap,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.gap,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_trueFalse]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.true,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:a.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]},{type:l.BitTagType.tag,configKey:a.TagConfigKey.false,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:a.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_markConfig]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.markConfig,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.color},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.emphasis}]}]},[o.GroupConfigKey.group_mark]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.tag_mark,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_mark},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_bookCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.language,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.spaceId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.kind},{type:l.BitTagType.tag,configKey:a.TagConfigKey.title,maxCount:2},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subtype,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.coverImage,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publisher,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subject,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.author,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.theme,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publications,maxCount:u.Count.infinity}]},[o.GroupConfigKey.group_learningPathCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.action},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.date},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.location},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.list,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.textReference},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isTracked},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isInfoOnly},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.deeplink},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.book,chain:[{type:l.BitTagType.tag,configKey:a.TagConfigKey.tag_reference,maxCount:2}]}]},[o.GroupConfigKey.group_resourceCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.license},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.copyright},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.caption},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showInIndex}]},[o.GroupConfigKey.group_resourceImageCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt}]},[o.GroupConfigKey.group_resourceAudioCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay}]},[o.GroupConfigKey.group_resourceVideoCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.allowSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.posterImage},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x}]},[o.GroupConfigKey.group_resourceImage]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.image,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImagePortrait]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.imagePortrait,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageLandscape]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.imageLandscape,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.imageEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.imageLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceAudio]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.audio,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceAudioEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.audioEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceAudioLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.audioLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceVideo]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.video,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceVideoEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.videoEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceVideoLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.videoLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilmEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.stillImageFilmEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilmLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.stillImageFilmLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceArticle]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.article,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceArticleEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.articleEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceArticleLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.articleLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocument]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.document,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.documentEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.documentLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentDownload]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.documentDownload,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceAppLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.appLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceWebsiteLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:s.ResourceConfigKey.websiteLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilm]:{type:i.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.stillImageFilm,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudio,maxCount:1,minCount:1}]},[o.GroupConfigKey.group_resourceImageResponsive]:{type:i.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.imageResponsive,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImagePortrait,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageLandscape,maxCount:1,minCount:1}]}};t.GROUPS=p},6260:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PROPERTIES=void 0;const o=r(3518),i=r(7204),n=r(5486),s=r(7572),a=r(7953),l={[o.PropertyConfigKey.id]:{tag:a.PropertyTag.id,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalId]:{tag:a.PropertyTag.externalId,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.spaceId]:{tag:a.PropertyTag.spaceId,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.padletId]:{tag:a.PropertyTag.padletId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.jupyterId]:{tag:a.PropertyTag.jupyterId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.jupyterExecutionCount]:{tag:a.PropertyTag.jupyterExecutionCount,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.aiGenerated]:{tag:a.PropertyTag.aiGenerated,single:!0,format:n.PropertyFormat.boolean,astKey:i.PropertyAstKey.aiGenerated},[o.PropertyConfigKey.releaseVersion]:{tag:a.PropertyTag.releaseVersion,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.ageRange]:{tag:a.PropertyTag.ageRange,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.lang]:{tag:a.PropertyTag.lang,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.language]:{tag:a.PropertyTag.language,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.computerLanguage]:{tag:a.PropertyTag.computerLanguage,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.target]:{tag:a.PropertyTag.target,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.tag]:{tag:a.PropertyTag.tag,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.icon]:{tag:a.PropertyTag.icon,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.iconTag]:{tag:a.PropertyTag.iconTag,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.colorTag]:{tag:a.PropertyTag.colorTag,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.flashcardSet]:{tag:a.PropertyTag.flashcardSet,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.subtype]:{tag:a.PropertyTag.subtype,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.bookAlias]:{tag:a.PropertyTag.bookAlias,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.coverImage]:{tag:a.PropertyTag.coverImage,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.publisher]:{tag:a.PropertyTag.publisher,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.publications]:{tag:a.PropertyTag.publications,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.author]:{tag:a.PropertyTag.author,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.subject]:{tag:a.PropertyTag.subject,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.date]:{tag:a.PropertyTag.date,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.location]:{tag:a.PropertyTag.location,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.theme]:{tag:a.PropertyTag.theme,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.kind]:{tag:a.PropertyTag.kind,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.action]:{tag:a.PropertyTag.action,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.thumbImage]:{tag:a.PropertyTag.thumbImage,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.focusX]:{tag:a.PropertyTag.focusX,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.focusY]:{tag:a.PropertyTag.focusY,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.deeplink]:{tag:a.PropertyTag.deeplink,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalLink]:{tag:a.PropertyTag.externalLink,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalLinkText]:{tag:a.PropertyTag.externalLinkText,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.videoCallLink]:{tag:a.PropertyTag.videoCallLink,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.bot]:{tag:a.PropertyTag.bot,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.duration]:{tag:a.PropertyTag.duration,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.property_reference]:{tag:a.PropertyTag.reference,format:n.PropertyFormat.trimmedString,astKey:i.PropertyAstKey.referenceProperty},[o.PropertyConfigKey.list]:{tag:a.PropertyTag.list,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.textReference]:{tag:a.PropertyTag.textReference,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.isTracked]:{tag:a.PropertyTag.isTracked,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.isInfoOnly]:{tag:a.PropertyTag.isInfoOnly,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.labelTrue]:{tag:a.PropertyTag.labelTrue,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.labelFalse]:{tag:a.PropertyTag.labelFalse,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.content2Buy]:{tag:a.PropertyTag.content2Buy,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.quotedPerson]:{tag:a.PropertyTag.quotedPerson,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.partialAnswer]:{tag:a.PropertyTag.partialAnswer,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.reasonableNumOfChars]:{tag:a.PropertyTag.reasonableNumOfChars,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.maxCreatedBits]:{tag:a.PropertyTag.maxCreatedBits,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.example]:{tag:a.PropertyTag.example,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.toc]:{tag:a.PropertyTag.toc,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[o.PropertyConfigKey.progress]:{tag:a.PropertyTag.progress,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[o.PropertyConfigKey.book]:{tag:a.PropertyTag.book,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.partner]:{tag:a.PropertyTag.partner,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.property_sampleSolution]:{tag:a.PropertyTag.sampleSolution,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.markConfig]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString,astKey:i.PropertyAstKey.markConfig},[o.PropertyConfigKey.property_mark]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.color]:{tag:a.PropertyTag.color,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.emphasis]:{tag:a.PropertyTag.emphasis,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.shortAnswer]:{tag:a.PropertyTag.shortAnswer,single:!0,format:n.PropertyFormat.boolean,astKey:i.PropertyAstKey.isShortAnswer,jsonKey:s.PropertyJsonKey.shortAnswer},[o.PropertyConfigKey.longAnswer]:{tag:a.PropertyTag.longAnswer,single:!0,format:n.PropertyFormat.invertedBoolean,astKey:i.PropertyAstKey.isShortAnswer,jsonKey:s.PropertyJsonKey.shortAnswer},[o.PropertyConfigKey.caseSensitive]:{tag:a.PropertyTag.caseSensitive,single:!0,format:n.PropertyFormat.boolean,astKey:i.PropertyAstKey.isCaseSensitive,jsonKey:s.PropertyJsonKey.caseSensitive},[o.PropertyConfigKey.reaction]:{tag:a.PropertyTag.reaction,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.imageSource]:{tag:a.PropertyTag.imageSource,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.mockupId]:{tag:a.PropertyTag.mockupId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.size]:{tag:a.PropertyTag.size,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.format]:{tag:a.PropertyTag.format,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.trim]:{tag:a.PropertyTag.trim,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.width]:{tag:a.PropertyTag.width,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.height]:{tag:a.PropertyTag.height,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.license]:{tag:a.PropertyTag.license,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.copyright]:{tag:a.PropertyTag.copyright,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.caption]:{tag:a.PropertyTag.caption,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.showInIndex]:{tag:a.PropertyTag.showInIndex,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.alt]:{tag:a.PropertyTag.alt,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src1x]:{tag:a.PropertyTag.src1x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src2x]:{tag:a.PropertyTag.src2x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src3x]:{tag:a.PropertyTag.src3x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src4x]:{tag:a.PropertyTag.src4x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.mute]:{tag:a.PropertyTag.mute,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.autoplay]:{tag:a.PropertyTag.autoplay,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.allowSubtitles]:{tag:a.PropertyTag.allowSubtitles,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.showSubtitles]:{tag:a.PropertyTag.showSubtitles,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.siteName]:{tag:a.PropertyTag.siteName,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.posterImage]:{tag:a.PropertyTag.posterImage,single:!0,format:n.PropertyFormat.trimmedString}};t.PROPERTIES=l},5100:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RESOURCES=void 0;const o=r(6194),i=r(9431),n=r(9779),s={[o.ResourceConfigKey.image]:{tag:n.ResourceTag.image},[o.ResourceConfigKey.imagePortrait]:{tag:n.ResourceTag.imagePortrait,jsonKey:i.ResourceJsonKey.imagePortrait},[o.ResourceConfigKey.imageLandscape]:{tag:n.ResourceTag.imageLandscape,jsonKey:i.ResourceJsonKey.imageLandscape},[o.ResourceConfigKey.imageEmbed]:{tag:n.ResourceTag.imageEmbed,jsonKey:i.ResourceJsonKey.imageEmbed},[o.ResourceConfigKey.imageLink]:{tag:n.ResourceTag.imageLink,jsonKey:i.ResourceJsonKey.imageLink},[o.ResourceConfigKey.audio]:{tag:n.ResourceTag.audio},[o.ResourceConfigKey.audioEmbed]:{tag:n.ResourceTag.audioEmbed,jsonKey:i.ResourceJsonKey.audioEmbed},[o.ResourceConfigKey.audioLink]:{tag:n.ResourceTag.audioLink,jsonKey:i.ResourceJsonKey.audioLink},[o.ResourceConfigKey.video]:{tag:n.ResourceTag.video},[o.ResourceConfigKey.videoEmbed]:{tag:n.ResourceTag.videoEmbed,jsonKey:i.ResourceJsonKey.videoEmbed},[o.ResourceConfigKey.videoLink]:{tag:n.ResourceTag.videoLink,jsonKey:i.ResourceJsonKey.videoLink},[o.ResourceConfigKey.stillImageFilmEmbed]:{tag:n.ResourceTag.stillImageFilmEmbed,jsonKey:i.ResourceJsonKey.stillImageFilmEmbed},[o.ResourceConfigKey.stillImageFilmLink]:{tag:n.ResourceTag.stillImageFilmLink,jsonKey:i.ResourceJsonKey.stillImageFilmLink},[o.ResourceConfigKey.article]:{tag:n.ResourceTag.article},[o.ResourceConfigKey.articleEmbed]:{tag:n.ResourceTag.articleEmbed,jsonKey:i.ResourceJsonKey.articleEmbed},[o.ResourceConfigKey.articleLink]:{tag:n.ResourceTag.articleLink,jsonKey:i.ResourceJsonKey.articleLink},[o.ResourceConfigKey.document]:{tag:n.ResourceTag.document},[o.ResourceConfigKey.documentEmbed]:{tag:n.ResourceTag.documentEmbed,jsonKey:i.ResourceJsonKey.documentEmbed},[o.ResourceConfigKey.documentLink]:{tag:n.ResourceTag.documentLink,jsonKey:i.ResourceJsonKey.documentLink},[o.ResourceConfigKey.documentDownload]:{tag:n.ResourceTag.documentDownload,jsonKey:i.ResourceJsonKey.documentDownload},[o.ResourceConfigKey.appLink]:{tag:n.ResourceTag.appLink,jsonKey:i.ResourceJsonKey.appLink},[o.ResourceConfigKey.websiteLink]:{tag:n.ResourceTag.websiteLink,jsonKey:i.ResourceJsonKey.websiteLink}};t.RESOURCES=s},3622:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS=void 0;const o=r(1595),i=r(8739),n={[o.TagConfigKey.title]:{tag:i.Tag.title},[o.TagConfigKey.anchor]:{tag:i.Tag.anchor},[o.TagConfigKey.tag_reference]:{tag:i.Tag.reference},[o.TagConfigKey.property]:{tag:i.Tag.property},[o.TagConfigKey.itemLead]:{tag:i.Tag.itemLead},[o.TagConfigKey.instruction]:{tag:i.Tag.instruction},[o.TagConfigKey.hint]:{tag:i.Tag.hint},[o.TagConfigKey.true]:{tag:i.Tag.true},[o.TagConfigKey.false]:{tag:i.Tag.false},[o.TagConfigKey.sampleSolution]:{tag:i.Tag.sampleSolution},[o.TagConfigKey.gap]:{tag:i.Tag.gap},[o.TagConfigKey.tag_mark]:{tag:i.Tag.mark},[o.TagConfigKey.resource]:{tag:i.Tag.resource},[o.TagConfigKey.remark]:{tag:i.Tag.remark},[o.TagConfigKey.comment]:{tag:i.Tag.comment}};t.TAGS=n},1022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildInfo=void 0,t.buildInfo={name:"@gmb/bitmark-parser-generator",version:"1.4.7",author:"Get More Brain Ltd",license:"ISC",description:"A bitmark parser and generator using Peggy.js"}},4369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const o=r(6831),i=r(2892),n=r(7448);function s(e,t,r,o){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,s.prototype),i.expected=t,i.found=r,i.location=o,i.name="SyntaxError",i}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}t.SyntaxError=s,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(s,Error),s.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,o=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){o=e[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,s=this.location.source+":"+n.line+":"+n.column;if(o){var l=this.location.end,u=a("",n.line.toString().length," "),c=o[i.line-1],p=(i.line===l.line?l.column:c.length+1)-i.column||1;t+="\n --\x3e "+s+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+a("",i.column-1," ")+a("",p,"^")}else t+="\n at "+s}return t},s.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function o(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function s(e){return r[e.type](e)}return"Expected "+function(e){var t,r,o=e.map(s);if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},t.parse=function e(t,r){var a,l={},u=(r=void 0!==r?r:{}).grammarSource,c={bitmark:nr,bit:function(){var e,t,r,o,i;e=Jt,t=[],r=Sr();for(;r!==l;)t.push(r),r=Sr();if((r=lr())!==l){for(o=[],i=Sr();i!==l;)o.push(i),i=Sr();qt=e,e=We(r)}else Jt=e,e=l;return e},cardContent:function(){var e,t,r;e=Jt,t=[],(r=gr())===l&&(r=vr());for(;r!==l;)t.push(r),(r=gr())===l&&(r=vr());return qt=e,t=bt(t),e=t}},p=nr,g="[.",d="]",y=":",f="&",h="====",m="~~~~",T="--",b="++",v="===",C="==",x="[@id",A="[",w="#",B="[▼",k="[►",P="[@",K="[%",S="[!",_="[?",R="[+",I="[-",O="[$",E="[_",L="[=",j="[&",V="::",F="||",G="id:",N="\n",D="\r\n",U="\r",M="\u2028",$="\u2029",J=/^[^\]]/,q=/^[^:\]]/,H=/^[^&:\]]/,z=/^[ \t]/,W=/^[^\n\r\u2028\u2029]/,Y=/^[ \t\n\r\u2028\u2029]/,X=Zt("[.",!1),Z=Qt(["]"],!0,!1),Q=Zt("]",!1),ee=Zt(":",!1),te=Zt("&",!1),re={type:"any"},oe=Zt("====",!1),ie=Zt("~~~~",!1),ne=Zt("--",!1),se=Zt("++",!1),ae=Zt("===",!1),le=Zt("==",!1),ue=Zt("[@id",!1),ce=Zt("[",!1),pe=Zt("#",!1),ge=Zt("[▼",!1),de=Zt("[►",!1),ye=Zt("[@",!1),fe=Zt("[%",!1),he=Zt("[!",!1),me=Zt("[?",!1),Te=Zt("[+",!1),be=Zt("[-",!1),ve=Zt("[$",!1),Ce=Zt("[_",!1),xe=Zt("[=",!1),Ae=Zt("[&",!1),we=Zt("::",!1),Be=Zt("||",!1),ke=Zt("id:",!1),Pe=Qt([":","]"],!0,!1),Ke=Qt(["&",":","]"],!0,!1),Se=(er("Empty"),Qt([" ","\t"],!1,!1)),_e=er("Anything"),Re=er("Character"),Ie=Qt(["\n","\r","\u2028","\u2029"],!0,!1),Oe=er("Line"),Ee=(er("whitespace in line"),er("Blank Line")),Le=er("Line Terminator"),je=Zt("\n",!1),Ve=Zt("\r\n",!1),Fe=Zt("\r",!1),Ge=Zt("\u2028",!1),Ne=Zt("\u2029",!1),De=er("Whitespace, then Line Terminator"),Ue=er("whitespace"),Me=Qt([" ","\t","\n","\r","\u2028","\u2029"],!1,!1),$e=function(e,t){return jr.buildBits([e,...t])},Je=function(e){return Lr.handleRawBit(e)},qe=function(e){return e},He=function(e){return Lr.handleRawBit(e)},ze=function(e){return e},We=function(e){return e},Ye=function(e,t){return jr.buildBit(e,t)},Xe=function(e){return jr.invalidBit(e)},Ze=function(e,t){return jr.buildBitHeader(e,t)},Qe=function(e,t){return jr.buildTextAndResourceType(e,t)},et=function(e){return Lr.handleTextFormat(e)},tt=function(e){return Lr.handleResourceType(e)},rt=function(e){return Lr.handleBitContent(e)},ot=function(e){return Lr.handleTagChain(e)},it=function(e){return e},nt=function(e){return Lr.handleBitTag(e)},st=function(e){return{type:o.TypeKey.BodyChar,value:e}},at=function(e){return Lr.handleCardSet(e[1].flat())},lt=function(){Lr.handleCardSetStart()},ut=function(){Lr.handleCardSetEnd()},ct=function(e){return Lr.handleCards(e)},pt=function(e){return Lr.handleCardLineOrDivider(e,2)},gt=function(e){return Lr.handleCardLine(e)},dt=function(e){return Lr.handleCardSet(e[1].flat())},yt=function(){Lr.handleCardSetStart()},ft=function(){Lr.handleCardSetEnd()},ht=function(e){return Lr.handleCards(e)},mt=function(e){return Lr.handleCardLineOrDivider(e,1)},Tt=function(e){return Lr.handleCardLine(e)},bt=function(e){return Lr.handleCardContent(e)},vt=function(e){return{type:o.TypeKey.CardChar,value:e}},Ct=function(e){return Lr.handlePropertyTag("id",e)},xt=function(e,t){return Lr.handleTag(o.TypeKey.Title,{level:e,title:t})},At=function(e){return Lr.handleTag(o.TypeKey.Anchor,e)},wt=function(e){return Lr.handleTag(o.TypeKey.Reference,e)},Bt=function(e,t){return Lr.handlePropertyTag(e,t)},kt=function(e){return Lr.handleTag(o.TypeKey.ItemLead,e)},Pt=function(e){return Lr.handleTag(o.TypeKey.Instruction,e)},Kt=function(e){return Lr.handleTag(o.TypeKey.Hint,e)},St=function(e){return Lr.handleTag(o.TypeKey.True,e)},_t=function(e){return Lr.handleTag(o.TypeKey.False,e)},Rt=function(e){return Lr.handleTag(o.TypeKey.SampleSolution,e)},It=function(e){return Lr.handleTag(o.TypeKey.Gap,e)},Ot=function(e){return Lr.handleTag(o.TypeKey.Mark,e)},Et=function(e,t){return Lr.handleResourceTag(e,t)},Lt=function(e){return Lr.handleTag(o.TypeKey.BodyText,e)},jt=function(e){return Lr.handleTag(o.TypeKey.Comment,e)},Vt=function(e){return e},Ft=function(e){return e?e.trim():""},Gt=function(e){return e?e.trim():null},Nt=function(e){return e?e.trim():""},Dt=function(){return!0},Ut=function(e){return e},Mt=function(e){return e},$t=function(e){return e},Jt=0,qt=0,Ht=[{line:1,column:1}],zt=0,Wt=[],Yt=0;if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');p=c[r.startRule]}function Xt(){return t.substring(qt,Jt)}function Zt(e,t){return{type:"literal",text:e,ignoreCase:t}}function Qt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function er(e){return{type:"other",description:e}}function tr(e){var r,o=Ht[e];if(o)return o;for(r=e-1;!Ht[r];)r--;for(o={line:(o=Ht[r]).line,column:o.column};r<e;)10===t.charCodeAt(r)?(o.line++,o.column=1):o.column++,r++;return Ht[e]=o,o}function rr(e,t,r){var o=tr(e),i=tr(t),n={source:u,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return r&&u&&"function"==typeof u.offset&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}function or(e){Jt<zt||(Jt>zt&&(zt=Jt,Wt=[]),Wt.push(e))}function ir(e,t,r){return new s(s.buildMessage(e,t),e,t,r)}function nr(){return function(){var e,r,o,i;e=Jt,r=[],(o=Ir())===l&&(o=Cr());for(;o!==l;)r.push(o),(o=Ir())===l&&(o=Cr());return o=function(){var e,r,o,i;e=Jt,r=Jt,o=[],i=ar();for(;i!==l;)o.push(i),i=ar();return r=t.substring(r,Jt),qt=e,r=Je(r),e=r,e}(),i=function(){var e,t;e=[],t=sr();for(;t!==l;)e.push(t),t=sr();return e}(),qt=e,e=$e(o,i),e}()}function sr(){var e,r,o,i;for(e=Jt,r=[],o=Sr();o!==l;)r.push(o),o=Sr();return(o=_r())===l&&(o=null),i=function(){var e,r,o,i,n,s;if(e=Jt,r=Jt,o=Jt,i=function(){var e,r,o,i;e=Jt,t.substr(Jt,2)===g?(r=g,Jt+=2):(r=l,0===Yt&&or(X));if(r!==l){for(o=[],J.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Z));i!==l;)o.push(i),J.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Z));93===t.charCodeAt(Jt)?(i=d,Jt++):(i=l,0===Yt&&or(Q)),i!==l?(qt=e,e=ze(r)):(Jt=e,e=l)}else Jt=e,e=l;return e}(),i!==l){for(n=[],s=ar();s!==l;)n.push(s),s=ar();o=i=[i,n]}else Jt=o,o=l;r=o!==l?t.substring(r,Jt):o;r!==l&&(qt=e,r=He(r));return e=r,e}(),i!==l?(qt=e,e=qe(i)):(Jt=e,e=l),e}function ar(){var e,t,r,o;if(e=Jt,(t=_r())!==l?(r=Jt,Yt++,o=ur(),Yt--,o===l?r=void 0:(Jt=r,r=l),r!==l?e=t=[t,r]:(Jt=e,e=l)):(Jt=e,e=l),e===l)if(e=[],(t=Pr())!==l)for(;t!==l;)e.push(t),t=Pr();else e=l;return e}function lr(){var e,r,o;return e=Jt,(r=ur())!==l?(o=function(){var e,t,r;e=Jt,t=[],r=hr(),r===l&&(r=Tr())===l&&(r=gr())===l&&(r=fr());for(;r!==l;)t.push(r),(r=hr())===l&&(r=Tr())===l&&(r=gr())===l&&(r=fr());return qt=e,t=rt(t),e=t,e}(),qt=e,e=Ye(r,o)):(Jt=e,e=l),e===l&&(e=Jt,r=Jt,o=function(){var e,r;Yt++,e=[],t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re));for(;r!==l;)e.push(r),t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re));Yt--,r=l,0===Yt&&or(_e);return e}(),r=t.substring(r,Jt),qt=e,e=r=Xe(r)),e}function ur(){var e,r,o,i,n;return e=Jt,t.substr(Jt,2)===g?(r=g,Jt+=2):(r=l,0===Yt&&or(X)),r!==l?(o=Br(),i=function(){var e,t,r;e=Jt,t=cr(),t===l&&(t=pr());t===l&&(t=null);r=cr(),r===l&&(r=pr());r===l&&(r=null);return qt=e,e=Qe(t,r),e}(),93===t.charCodeAt(Jt)?(n=d,Jt++):(n=l,0===Yt&&or(Q)),n!==l?(qt=e,e=Ze(o,i)):(Jt=e,e=l)):(Jt=e,e=l),e}function cr(){var e,r,o;return e=Jt,58===t.charCodeAt(Jt)?(r=y,Jt++):(r=l,0===Yt&&or(ee)),r!==l?(o=Br(),qt=e,e=et(o)):(Jt=e,e=l),e}function pr(){var e,r,o;return e=Jt,38===t.charCodeAt(Jt)?(r=f,Jt++):(r=l,0===Yt&&or(te)),r!==l?(o=Br(),qt=e,e=tt(o)):(Jt=e,e=l),e}function gr(){var e,t,r,o,i;if(e=Jt,t=Jt,(r=yr())!==l){for(o=[],i=dr();i!==l;)o.push(i),i=dr();t=r=[r,o]}else Jt=t,t=l;return t!==l&&(qt=e,t=ot(t)),e=t}function dr(){var e,t;return e=Jt,(t=yr())!==l&&(qt=e,t=it(t)),e=t}function yr(){var e,r;return e=Jt,(r=Cr())===l&&(r=function(){var e,r,o,i,n,s,a,u;e=Jt,r=Jt,o=Jt,t.substr(Jt,2)===V?(i=V,Jt+=2):(i=l,0===Yt&&or(we));i!==l?(n=function(){var e,r,o,i,n,s;e=Jt,r=Jt,o=[],i=Jt,n=Jt,Yt++,t.substr(Jt,2)===V?(s=V,Jt+=2):(s=l,0===Yt&&or(we));Yt--,s===l?n=void 0:(Jt=n,n=l);n!==l&&(s=Pr())!==l?i=n=[n,s]:(Jt=i,i=l);for(;i!==l;)o.push(i),i=Jt,n=Jt,Yt++,t.substr(Jt,2)===V?(s=V,Jt+=2):(s=l,0===Yt&&or(we)),Yt--,s===l?n=void 0:(Jt=n,n=l),n!==l&&(s=Pr())!==l?i=n=[n,s]:(Jt=i,i=l);return r=t.substring(r,Jt),qt=e,r=Ut(r),e=r,e}(),t.substr(Jt,2)===V?(s=V,Jt+=2):(s=l,0===Yt&&or(we)),s!==l?(a=function(){var e,r,o,i,n,s;e=Jt,r=Jt,o=[],i=Jt,n=Jt,Yt++,t.substr(Jt,2)===V?(s=V,Jt+=2):(s=l,0===Yt&&or(we));Yt--,s===l?n=void 0:(Jt=n,n=l);n!==l?(t.length>Jt?(s=t.charAt(Jt),Jt++):(s=l,0===Yt&&or(re)),s!==l?i=n=[n,s]:(Jt=i,i=l)):(Jt=i,i=l);for(;i!==l;)o.push(i),i=Jt,n=Jt,Yt++,t.substr(Jt,2)===V?(s=V,Jt+=2):(s=l,0===Yt&&or(we)),Yt--,s===l?n=void 0:(Jt=n,n=l),n!==l?(t.length>Jt?(s=t.charAt(Jt),Jt++):(s=l,0===Yt&&or(re)),s!==l?i=n=[n,s]:(Jt=i,i=l)):(Jt=i,i=l);return r=t.substring(r,Jt),qt=e,r=Mt(r),e=r,e}(),u=function(){var e,r,o;t.substr(Jt,2)===V?(e=V,Jt+=2):(e=l,0===Yt&&or(we));if(e===l){for(e=Jt,r=[],o=Ir();o!==l;)r.push(o),o=Ir();(o=Er())!==l?e=r=[r,o]:(Jt=e,e=l)}return e}(),u!==l?o=i=[i,n,s,a,u]:(Jt=o,o=l)):(Jt=o,o=l)):(Jt=o,o=l);r=o!==l?t.substring(r,Jt):o;r!==l&&(qt=e,r=Lt(r));return e=r,e}(),r===l&&(r=function(){var e,r,o,i;e=Jt,t.substr(Jt,4)===x?(r=x,Jt+=4):(r=l,0===Yt&&or(ue));r!==l&&(o=kr())!==l?(i=function(){var e;93===t.charCodeAt(Jt)?(e=d,Jt++):(e=l,0===Yt&&or(Q));return e}(),i!==l?(qt=e,e=Ct(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Jt,t.substr(Jt,2)===P?(r=P,Jt+=2):(r=l,0===Yt&&or(ye));r!==l&&(o=Ar())!==l&&(i=kr())!==l&&wr()!==l?(qt=e,e=Bt(o,i)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Jt,91===t.charCodeAt(Jt)?(r=A,Jt++):(r=l,0===Yt&&or(ce));if(r!==l){if(o=[],35===t.charCodeAt(Jt)?(i=w,Jt++):(i=l,0===Yt&&or(pe)),i!==l)for(;i!==l;)o.push(i),35===t.charCodeAt(Jt)?(i=w,Jt++):(i=l,0===Yt&&or(pe));else o=l;o!==l?(i=xr(),wr()!==l?(qt=e,e=xt(o,i)):(Jt=e,e=l)):(Jt=e,e=l)}else Jt=e,e=l;return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===B?(r=B,Jt+=2):(r=l,0===Yt&&or(ge));r!==l?(o=xr(),wr()!==l?(qt=e,e=At(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===k?(r=k,Jt+=2):(r=l,0===Yt&&or(de));r!==l?(o=xr(),wr()!==l?(qt=e,e=wt(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===K?(r=K,Jt+=2):(r=l,0===Yt&&or(fe));r!==l?(o=xr(),wr()!==l?(qt=e,e=kt(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===S?(r=S,Jt+=2):(r=l,0===Yt&&or(he));r!==l?(o=xr(),wr()!==l?(qt=e,e=Pt(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===_?(r=_,Jt+=2):(r=l,0===Yt&&or(me));r!==l?(o=xr(),wr()!==l?(qt=e,e=Kt(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===E?(r=E,Jt+=2):(r=l,0===Yt&&or(Ce));r!==l?(o=xr(),wr()!==l?(qt=e,e=It(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===L?(r=L,Jt+=2):(r=l,0===Yt&&or(xe));r!==l?(o=xr(),wr()!==l?(qt=e,e=Ot(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===O?(r=O,Jt+=2):(r=l,0===Yt&&or(ve));r!==l?(o=xr(),wr()!==l?(qt=e,e=Rt(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===R?(r=R,Jt+=2):(r=l,0===Yt&&or(Te));r!==l?(o=xr(),wr()!==l?(qt=e,e=St(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Jt,t.substr(Jt,2)===I?(r=I,Jt+=2):(r=l,0===Yt&&or(be));r!==l?(o=xr(),wr()!==l?(qt=e,e=_t(o)):(Jt=e,e=l)):(Jt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Jt,t.substr(Jt,2)===j?(r=j,Jt+=2):(r=l,0===Yt&&or(Ae));r!==l&&(o=Ar())!==l&&(i=kr())!==l&&wr()!==l?(qt=e,e=Et(o,i)):(Jt=e,e=l);return e}()))))))))))))))),r!==l&&(qt=e,r=nt(r)),e=r}function fr(){var e,r;return e=Jt,t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re)),r!==l&&(qt=e,r=st(r)),e=r}function hr(){var e,r,o,i,n;if(e=Jt,r=Jt,o=function(){var e,r,o,i,n,s;e=Jt,r=_r(),r!==l?(o=Jt,Yt++,i=Jt,t.substr(Jt,4)===h?(n=h,Jt+=4):(n=l,0===Yt&&or(oe)),n!==l&&(s=Rr())!==l?i=n=[n,s]:(Jt=i,i=l),Yt--,i!==l?(Jt=o,o=void 0):o=l,o!==l?(qt=e,e=lt()):(Jt=e,e=l)):(Jt=e,e=l);return e}(),o!==l){for(i=[],n=mr();n!==l;)i.push(n),n=mr();n=function(){var e,r,o,i,n;e=Jt,r=Jt,t.substr(Jt,4)===m?(o=m,Jt+=4):(o=l,0===Yt&&or(ie));o===l&&(o=null);i=Jt,Yt++,n=Or(),Yt--,n!==l?(Jt=i,i=void 0):i=l;i!==l?r=o=[o,i]:(Jt=r,r=l);r!==l&&(qt=e,r=ut());return e=r,e}(),n!==l?r=o=[o,i,n]:(Jt=r,r=l)}else Jt=r,r=l;return r!==l&&(qt=e,r=at(r)),e=r}function mr(){var e,r;return e=Jt,r=function(){var e,r,o,i;e=Jt,r=Jt,t.substr(Jt,4)===h?(o=h,Jt+=4):(o=l,0===Yt&&or(oe));o!==l?((i=Rr())===l&&(i=Or()),i!==l?r=o=[o,i]:(Jt=r,r=l)):(Jt=r,r=l);r===l&&(r=Jt,t.substr(Jt,2)===T?(o=T,Jt+=2):(o=l,0===Yt&&or(ne)),o!==l?((i=Rr())===l&&(i=Or()),i!==l?r=o=[o,i]:(Jt=r,r=l)):(Jt=r,r=l),r===l&&(r=Jt,t.substr(Jt,2)===b?(o=b,Jt+=2):(o=l,0===Yt&&or(se)),o!==l?((i=Rr())===l&&(i=Or()),i!==l?r=o=[o,i]:(Jt=r,r=l)):(Jt=r,r=l),r===l&&(r=function(){var e,r,o,i,n,s;e=Jt,r=Jt,Yt++,o=Jt,t.substr(Jt,4)===m?(i=m,Jt+=4):(i=l,0===Yt&&or(ie));i!==l&&(n=Or())!==l?o=i=[i,n]:(Jt=o,o=l);Yt--,o===l?r=void 0:(Jt=r,r=l);if(r!==l){if(o=Jt,i=Jt,n=Kr(),(s=_r())!==l?i=n=[n,s]:(Jt=i,i=l),i===l){if(i=Jt,n=[],(s=Pr())!==l)for(;s!==l;)n.push(s),s=Pr();else n=l;n!==l?(s=function(){var e,r;e=_r(),e===l&&(e=Jt,Yt++,t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re)),Yt--,r===l?e=void 0:(Jt=e,e=l));return e}(),s!==l?i=n=[n,s]:(Jt=i,i=l)):(Jt=i,i=l)}(o=i!==l?t.substring(o,Jt):i)!==l?(qt=e,e=gt(o)):(Jt=e,e=l)}else Jt=e,e=l;return e}())));r!==l&&(qt=e,r=pt(r));return e=r,e}(),r!==l&&(qt=e,r=ct(r)),e=r}function Tr(){var e,r,o,i,n;if(e=Jt,r=Jt,o=function(){var e,r,o,i,n,s;e=Jt,r=_r(),r!==l?(o=Jt,Yt++,i=Jt,t.substr(Jt,3)===v?(n=v,Jt+=3):(n=l,0===Yt&&or(ae)),n!==l&&(s=Rr())!==l?i=n=[n,s]:(Jt=i,i=l),Yt--,i!==l?(Jt=o,o=void 0):o=l,o!==l?(qt=e,e=yt()):(Jt=e,e=l)):(Jt=e,e=l);return e}(),o!==l){for(i=[],n=br();n!==l;)i.push(n),n=br();n=function(){var e,r,o,i,n;e=Jt,r=Jt,t.substr(Jt,3)===v?(o=v,Jt+=3):(o=l,0===Yt&&or(ae));o!==l?(i=Jt,Yt++,n=Or(),Yt--,n!==l?(Jt=i,i=void 0):i=l,i!==l?r=o=[o,i]:(Jt=r,r=l)):(Jt=r,r=l);r!==l&&(qt=e,r=ft());return e=r,e}(),n!==l?r=o=[o,i,n]:(Jt=r,r=l)}else Jt=r,r=l;return r!==l&&(qt=e,r=dt(r)),e=r}function br(){var e,r,o,i,n,s,a,u,c,p,g;if(e=Jt,r=Jt,Yt++,o=Jt,t.substr(Jt,3)===v?(i=v,Jt+=3):(i=l,0===Yt&&or(ae)),i!==l){for(n=[],s=Ir();s!==l;)n.push(s),s=Ir();for(s=[],a=Jt,u=Jt,Yt++,c=Jt,(p=_r())!==l?(t.substr(Jt,3)===v?(g=v,Jt+=3):(g=l,0===Yt&&or(ae)),g!==l?c=p=[p,g]:(Jt=c,c=l)):(Jt=c,c=l),Yt--,c===l?u=void 0:(Jt=u,u=l),u!==l?(t.length>Jt?(c=t.charAt(Jt),Jt++):(c=l,0===Yt&&or(re)),c!==l?a=u=[u,c]:(Jt=a,a=l)):(Jt=a,a=l);a!==l;)s.push(a),a=Jt,u=Jt,Yt++,c=Jt,(p=_r())!==l?(t.substr(Jt,3)===v?(g=v,Jt+=3):(g=l,0===Yt&&or(ae)),g!==l?c=p=[p,g]:(Jt=c,c=l)):(Jt=c,c=l),Yt--,c===l?u=void 0:(Jt=u,u=l),u!==l?(t.length>Jt?(c=t.charAt(Jt),Jt++):(c=l,0===Yt&&or(re)),c!==l?a=u=[u,c]:(Jt=a,a=l)):(Jt=a,a=l);(a=Er())!==l?o=i=[i,n,s,a]:(Jt=o,o=l)}else Jt=o,o=l;return Yt--,o===l?r=void 0:(Jt=r,r=l),r!==l?(o=function(){var e,r,o,i;e=Jt,r=Jt,t.substr(Jt,3)===v?(o=v,Jt+=3):(o=l,0===Yt&&or(ae));o!==l&&(i=Rr())!==l?r=o=[o,i]:(Jt=r,r=l);r===l&&(r=Jt,t.substr(Jt,2)===C?(o=C,Jt+=2):(o=l,0===Yt&&or(le)),o!==l&&(i=Rr())!==l?r=o=[o,i]:(Jt=r,r=l),r===l&&(r=Jt,t.substr(Jt,2)===T?(o=T,Jt+=2):(o=l,0===Yt&&or(ne)),o!==l&&(i=Rr())!==l?r=o=[o,i]:(Jt=r,r=l),r===l&&(r=function(){var e,r,o,i,n;e=Jt,r=Jt,o=Jt,i=Kr(),n=_r(),n!==l?o=i=[i,n]:(Jt=o,o=l);r=o!==l?t.substring(r,Jt):o;r!==l&&(qt=e,r=Tt(r));return e=r,e}())));r!==l&&(qt=e,r=mt(r));return e=r,e}(),o!==l?(qt=e,e=ht(o)):(Jt=e,e=l)):(Jt=e,e=l),e}function vr(){var e,r;return e=Jt,t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re)),r!==l&&(qt=e,r=vt(r)),e=r}function Cr(){var e,r,o,i;return e=Jt,t.substr(Jt,2)===F?(r=F,Jt+=2):(r=l,0===Yt&&or(Be)),r!==l?(o=function(){var e,r,o,i,n,s;e=Jt,r=Jt,o=[],i=Jt,n=Jt,Yt++,t.substr(Jt,2)===F?(s=F,Jt+=2):(s=l,0===Yt&&or(Be));Yt--,s===l?n=void 0:(Jt=n,n=l);n!==l?(t.length>Jt?(s=t.charAt(Jt),Jt++):(s=l,0===Yt&&or(re)),s!==l?i=n=[n,s]:(Jt=i,i=l)):(Jt=i,i=l);for(;i!==l;)o.push(i),i=Jt,n=Jt,Yt++,t.substr(Jt,2)===F?(s=F,Jt+=2):(s=l,0===Yt&&or(Be)),Yt--,s===l?n=void 0:(Jt=n,n=l),n!==l?(t.length>Jt?(s=t.charAt(Jt),Jt++):(s=l,0===Yt&&or(re)),s!==l?i=n=[n,s]:(Jt=i,i=l)):(Jt=i,i=l);return r=t.substring(r,Jt),qt=e,r=$t(r),e=r,e}(),i=function(){var e,r,o;t.substr(Jt,2)===F?(e=F,Jt+=2):(e=l,0===Yt&&or(Be));if(e===l){for(e=Jt,r=[],o=Ir();o!==l;)r.push(o),o=Ir();(o=Er())!==l?e=r=[r,o]:(Jt=e,e=l)}return e}(),i!==l?(qt=e,e=jt(o)):(Jt=e,e=l)):(Jt=e,e=l),e}function xr(){var e,r,o,i;for(e=Jt,r=Jt,o=[],J.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Z));i!==l;)o.push(i),J.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Z));return r=t.substring(r,Jt),qt=e,e=r=Vt(r)}function Ar(){var e,r,o,i,n;if(e=Jt,r=Jt,Yt++,t.substr(Jt,3)===G?(o=G,Jt+=3):(o=l,0===Yt&&or(ke)),Yt--,o===l?r=void 0:(Jt=r,r=l),r!==l){for(o=Jt,i=[],q.test(t.charAt(Jt))?(n=t.charAt(Jt),Jt++):(n=l,0===Yt&&or(Pe));n!==l;)i.push(n),q.test(t.charAt(Jt))?(n=t.charAt(Jt),Jt++):(n=l,0===Yt&&or(Pe));o=t.substring(o,Jt),qt=e,e=Ft(o)}else Jt=e,e=l;return e}function wr(){var e,r,o;if(93===t.charCodeAt(Jt)?(e=d,Jt++):(e=l,0===Yt&&or(Q)),e===l){for(e=Jt,r=[],o=Ir();o!==l;)r.push(o),o=Ir();(o=Er())!==l?e=r=[r,o]:(Jt=e,e=l)}return e}function Br(){var e,r,o,i;for(e=Jt,r=Jt,o=[],H.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Ke));i!==l;)o.push(i),H.test(t.charAt(Jt))?(i=t.charAt(Jt),Jt++):(i=l,0===Yt&&or(Ke));return r=t.substring(r,Jt),qt=e,e=r=Gt(r)}function kr(){var e,r,o;return e=Jt,58===t.charCodeAt(Jt)?(r=y,Jt++):(r=l,0===Yt&&or(ee)),r!==l?(o=xr(),qt=e,e=Nt(o)):(Jt=e,e=l),e===l&&(r="",qt=e=Jt,e=r=Dt()),e}function Pr(){var e;return Yt++,W.test(t.charAt(Jt))?(e=t.charAt(Jt),Jt++):(e=l,0===Yt&&or(Ie)),Yt--,e===l&&(l,0===Yt&&or(Re)),e}function Kr(){var e,t;for(Yt++,e=[],t=Pr();t!==l;)e.push(t),t=Pr();return Yt--,t=l,0===Yt&&or(Oe),e}function Sr(){var e,r,o;for(Yt++,e=Jt,r=[],z.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=l,0===Yt&&or(Se));o!==l;)r.push(o),z.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=l,0===Yt&&or(Se));return(o=_r())!==l?e=r=[r,o]:(Jt=e,e=l),Yt--,e===l&&(r=l,0===Yt&&or(Ee)),e}function _r(){var e;return Yt++,10===t.charCodeAt(Jt)?(e=N,Jt++):(e=l,0===Yt&&or(je)),e===l&&(t.substr(Jt,2)===D?(e=D,Jt+=2):(e=l,0===Yt&&or(Ve)),e===l&&(13===t.charCodeAt(Jt)?(e=U,Jt++):(e=l,0===Yt&&or(Fe)),e===l&&(8232===t.charCodeAt(Jt)?(e=M,Jt++):(e=l,0===Yt&&or(Ge)),e===l&&(8233===t.charCodeAt(Jt)?(e=$,Jt++):(e=l,0===Yt&&or(Ne)))))),Yt--,e===l&&(l,0===Yt&&or(Le)),e}function Rr(){var e,r,o;for(Yt++,e=Jt,r=[],z.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=l,0===Yt&&or(Se));o!==l;)r.push(o),z.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=l,0===Yt&&or(Se));return(o=_r())!==l?e=r=[r,o]:(Jt=e,e=l),Yt--,e===l&&(r=l,0===Yt&&or(De)),e}function Ir(){var e;return Yt++,Y.test(t.charAt(Jt))?(e=t.charAt(Jt),Jt++):(e=l,0===Yt&&or(Me)),Yt--,e===l&&(l,0===Yt&&or(Ue)),e}function Or(){var e,r;return(e=Rr())===l&&(e=Jt,Yt++,t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re)),Yt--,r===l?e=void 0:(Jt=e,e=l)),e}function Er(){var e,r;return e=Jt,Yt++,t.length>Jt?(r=t.charAt(Jt),Jt++):(r=l,0===Yt&&or(re)),Yt--,r===l?e=void 0:(Jt=e,e=l),e}const Lr=new i.BitmarkPegParserHelper({parse:e,parserText:Xt,parserLocation:Vr}),jr=new n.BitmarkPegParserProcessor({parse:e,parserText:Xt,parserLocation:Vr});function Vr(){const e=rr(qt,Jt);return e?(delete e.source,e):e}function rr(e,t,r){var o=tr(e),i=tr(t),n={source:u,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return u&&"function"==typeof u.offset&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}if((a=p())!==l&&Jt===t.length)return a;throw a!==l&&Jt<t.length&&or({type:"end"}),ir(Wt,zt<t.length?t.charAt(zt):null,zt<t.length?rr(zt,zt+1):rr(zt,zt))}},4764:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=t.unbreakscape=void 0;const r=new RegExp(/=\^(\^*)(?==)|\*\^(\^*)(?=\*)|_\^(\^*)(?=_)|`\^(\^*)(?=`)|!\^(\^*)(?=!)|\[\^(\^*)|•\^(\^*)|#\^(\^*)|\|\^(\^*)|\|\^(\^*)/,"g");function o(e){let t=e||"";let o=r;return t=t.replace(o,(function(e,t,r,o,i){return e.replace("^","")})),t}function i(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):l(e,{startRule:"bitmarkPlusString"})}function n(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkMinusMinusString"}):l(e,{startRule:"bitmarkMinusMinusString"})}function s(e,t,r,o){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,s.prototype),i.expected=t,i.found=r,i.location=o,i.name="SyntaxError",i}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}function l(e,t){var r,a={},l=(t=void 0!==t?t:{}).grammarSource,u={bitmarkPlusPlus:Vo,bitmarkPlus:function(){var e,t;So++,e=Bo,t=ni(),e,t=Yr(t),e=t,So--,t=a,0===So&&Lo(je);return e},bitmarkMinusMinus:function(){var e,t;So++,e=Bo,t=di(),e,t=ho(t),e=t,So--,t=a,0===So&&Lo($t);return e},bitmarkPlusString:function(){var e;So++,e=ni(),So--,a,0===So&&Lo(st);return e},bitmarkMinusMinusString:di},c=Vo,p="|",g=":",d="### ",y="## ",f="# ",h="code",m="bitmark++",T="bitmark--",b="JavaScript",v="• ",C="•1 ",x="•+ ",A="•- ",w="\t",B="image",k=" ",P="#",K="@",S="width",_="height",R="=",I="𝑓",O="link:",E="var:",L="code:",j="color:",V="bold",F="italic",G="light",N="highlight",D="strike",U="sub",M="super",$="ins",J="del",q="aqua",H="black",z="blue",W="pink",Y="fuchsia",X="lightgrey",Z="gray",Q="darkgray",ee="green",te="lime",re="magenta",oe="maroon",ie="navy",ne="olive",se="orange",ae="purple",le="red",ue="silver",ce="teal",pe="violet",ge="white",de="yellow",ye="*",fe="_",he="`",me="!",Te="[!",be="]",ve="\n",Ce="\r\n",xe="\r",Ae="\u2028",we="\u2029",Be="http",ke="s",Pe="://",Ke="mailto:",Se="~",_e="^",Re="'",Ie=/^[ \t]/,Oe=/^[0-9]/,Ee=/^[^\n\r\u2028\u2029]/,Le=/^[a-zA-Z0-9!*'()=+-\/._?#@[\]$&(),;%:{}]/,je=Io("StyledText"),Ve=_o("|",!1),Fe=_o(":",!1),Ge=_o("### ",!1),Ne=_o("## ",!1),De=_o("# ",!1),Ue=_o("code",!1),Me=Ro([" ","\t"],!1,!1),$e=_o("bitmark++",!1),Je=_o("bitmark--",!1),qe=_o("JavaScript",!1),He=_o("• ",!1),ze=_o("•1 ",!1),We=_o("•+ ",!1),Ye=_o("•- ",!1),Xe={type:"any"},Ze=_o("\t",!1),Qe=_o("image",!1),et=_o(" ",!1),tt=_o("#",!1),rt=_o("@",!1),ot=Ro([["0","9"]],!1,!1),it=_o("width",!1),nt=_o("height",!1),st=Io("StyledString"),at=_o("=",!1),lt=_o("𝑓",!1),ut=_o("link:",!1),ct=_o("var:",!1),pt=_o("code:",!1),gt=_o("color:",!1),dt=_o("bold",!1),yt=_o("italic",!1),ft=_o("light",!1),ht=_o("highlight",!1),mt=_o("strike",!1),Tt=_o("sub",!1),bt=_o("super",!1),vt=_o("ins",!1),Ct=_o("del",!1),xt=_o("aqua",!1),At=_o("black",!1),wt=_o("blue",!1),Bt=_o("pink",!1),kt=_o("fuchsia",!1),Pt=_o("lightgrey",!1),Kt=_o("gray",!1),St=_o("darkgray",!1),_t=_o("green",!1),Rt=_o("lime",!1),It=_o("magenta",!1),Ot=_o("maroon",!1),Et=_o("navy",!1),Lt=_o("olive",!1),jt=_o("orange",!1),Vt=_o("purple",!1),Ft=_o("red",!1),Gt=_o("silver",!1),Nt=_o("teal",!1),Dt=_o("violet",!1),Ut=_o("white",!1),Mt=_o("yellow",!1),$t=Io("MinimalStyledText"),Jt=Io("MinimalStyledString"),qt=_o("*",!1),Ht=_o("_",!1),zt=_o("`",!1),Wt=_o("!",!1),Yt=_o("[!",!1),Xt=_o("]",!1),Zt=Io("Line Terminator"),Qt=_o("\n",!1),er=_o("\r\n",!1),tr=_o("\r",!1),rr=_o("\u2028",!1),or=_o("\u2029",!1),ir=(Io("whitespace in line"),Io("space"),Io("language tag separator"),Io("white space, separator"),Ro(["\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!1,!1),Ro(["\n","\r","\u2028","\u2029"],!1,!1),Ro(["\n","\r","\u2028","\u2029"],!0,!1)),nr=(Ro(["\n","\r","\u2028","\u2029","\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!0,!1),_o("http",!1)),sr=_o("s",!1),ar=_o("://",!1),lr=_o("mailto:",!1),ur=Ro([["a","z"],["A","Z"],["0","9"],"!","*","'","(",")","=",["+","/"],".","_","?","#","@","[","]","$","&","(",")",",",";","%",":","{","}"],!1,!1),cr=_o("~",!1),pr=_o("^",!1),gr=_o("'",!1),dr=function(e){return Object.assign({},e)},yr=function(e){return Object.assign({},e)},fr=function(e){return Object.assign({},e)},hr=function(e){return Object.assign({},e)},mr=function(e){return Object.assign({},e)},Tr=function(){return[]},br=function(e,t){return{type:"heading",content:n(t),attrs:{level:e.length-1}}},vr=function(e){return e},Cr=function(e,t){return Object.assign(Object.assign({},e),{content:t})},xr=function(){return{type:"codeBlock",language:""}},Ar=function(e){return{type:"codeBlock",attrs:{language:e.trim().toLowerCase()}}},wr=function(e){return[{type:"text",text:o(e.trim())}]},Br=function(e){return e},kr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Pr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Kr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Sr=function(){return{type:"bulletList"}},_r=function(){return{type:"orderedList"}},Rr=function(){return{type:"taskList"}},Ir=function(e,t,r,o){return o},Or=function(e,t,r,o){let n="bulletList";"•1 "==e&&(n="orderedList"),"•+ "!=e&&"•- "!=e||(n="taskList");let s=[{type:"paragraph",attrs:{},content:i((t+r.join("")).trim())}];if(o&&o[0]&&o[0].parent){let e={type:o[0].parent,attrs:{start:1},content:o,parent:""};"orderedList"==e.parent&&(e.attrs.start=1),s.push(e)}let a="listItem",l={};if("taskList"==n){a="taskItem";let t=!1;"•+ "==e&&(t=!0),l={checked:t}}return{type:a,content:s,parent:n,attrs:l}},Er=function(e){return e},Lr=function(e){return e.join("")===Ii},jr=function(e){return e.length>Ii.length},Vr=function(e){Ri.push(Ii),Ii=e.join("")},Fr=function(){return Ii=Ri.pop(),!0},Gr=function(e){return{type:"paragraph",content:i(e.trim()),attrs:{}}},Nr=function(e){return{type:"paragraph",content:i(e.trim()),attrs:{}}},Dr=function(e){return{type:"paragraph",content:i(e.trim()),attrs:{}}},Ur=function(e){return e},Mr=function(e,t,r){const o=Object.assign({},...r);let i=o.captionAlign||"left";delete o.captionAlign;let n=o.alt||null;delete o.alt;let s=o.caption||null;delete o.caption;let a=o.align||"center";return delete o.align,{type:e,attrs:Object.assign({textAlign:i,src:t,alt:n,title:s,class:a},o)}},$r=function(e){return e},Jr=function(e){return{comment:e}},qr=function(e,t){return{[e]:parseInt(t)}},Hr=function(e,t){return{type:"error",msg:e+" must be an positive integer.",found:t}},zr=function(e,t){return{[e]:t}},Wr=function(e){return{[e]:!0}},Yr=function(e){return[{type:"paragraph",content:e,attrs:{}}]},Xr=function(e,t){return e?[e,...t.flat()]:t.flat()},Zr=function(){return{type:"hardBreak"}},Qr=function(e){return{text:o(e),type:"text"}},eo=function(e){return{index:+e,type:"bit"}},to=function(e,t){return t||(t=[]),{marks:t,text:o(e),type:"text"}},ro=function(e){return{marks:[{type:"bold"}],text:o(e),type:"text"}},oo=function(e){return{marks:[{type:"italic"}],text:o(e),type:"text"}},io=function(e){return{marks:[{type:"light"}],text:o(e),type:"text"}},no=function(e){return{marks:[{type:"highlight"}],text:o(e),type:"text"}},so=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}},ao=function(e){return e},lo=function(e){return{type:"link",attrs:{href:e.trim(),target:"_blank"}}},uo=function(e){return{type:"var",attrs:{name:e.trim()}}},co=function(){return{type:"code",attrs:{language:"plain text"}}},po=function(e){return{type:"code",attrs:{language:e.trim().toLowerCase()}}},go=function(e){return{type:"color",attrs:{color:e}}},yo=function(e){return{type:e}},fo=function(e){return{type:"comment",comment:e}},ho=function(e){return[{type:"paragraph",content:e,attrs:{}}]},mo=function(e,t){return e?[e,...t.flat()]:t.flat()},To=function(e){return{text:o(e),type:"text"}},bo=function(e){return{index:+e,type:"bit"}},vo=function(e){return{marks:[{type:"bold"}],text:o(e),type:"text"}},Co=function(e){return{marks:[{type:"italic"}],text:o(e),type:"text"}},xo=function(e){return{marks:[{type:"light"}],text:o(e),type:"text"}},Ao=function(e){return{marks:[{type:"highlight"}],text:o(e),type:"text"}},wo=function(e,t){return{pr:e,t}},Bo=0,ko=[{line:1,column:1}],Po=0,Ko=[],So=0;if("startRule"in t){if(!(t.startRule in u))throw new Error("Can't start parsing from rule \""+t.startRule+'".');c=u[t.startRule]}function _o(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ro(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Io(e){return{type:"other",description:e}}function Oo(t){var r,o=ko[t];if(o)return o;for(r=t-1;!ko[r];)r--;for(o={line:(o=ko[r]).line,column:o.column};r<t;)10===e.charCodeAt(r)?(o.line++,o.column=1):o.column++,r++;return ko[t]=o,o}function Eo(e,t,r){var o=Oo(e),i=Oo(t),n={source:l,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return r&&l&&"function"==typeof l.offset&&(n.start=l.offset(n.start),n.end=l.offset(n.end)),n}function Lo(e){Bo<Po||(Bo>Po&&(Po=Bo,Ko=[]),Ko.push(e))}function jo(e,t,r){return new s(s.buildMessage(e,t),e,t,r)}function Vo(){var e,t;if(So++,e=[],(t=Fo())!==a)for(;t!==a;)e.push(t),t=Fo();else e=a;return e===a&&(e=function(){var e,t;return e=Bo,t="",e,t=Tr(),e=t,e}()),So--,e===a&&(t=a,0===So&&Lo(je)),e}function Fo(){var t,r;return t=Bo,r=function(){var t,r,o,i,n;if(t=Bo,r=Do(),r!==a){for(o=Bo,i=[],n=Ki();n!==a;)i.push(n),n=Ki();o=e.substring(o,Bo),(i=Si())!==a?((n=Pi())===a&&(n=null),t,t=br(r,o)):(Bo=t,t=a)}else Bo=t,t=a;return t}(),r!==a&&(t,r=dr(r)),(t=r)===a&&(t=Bo,r=function(){var e,t,r,o;if(e=Bo,t=function(){var e,t,r;e=Bo,t=Bo,So++,r=Jo(),So--,r!==a?(Bo=t,t=void 0):t=a;t!==a&&(e,t=Sr());return e=t,e}(),t!==a){if(r=[],(o=Wo())!==a)for(;o!==a;)r.push(o),o=Wo();else r=a;r!==a?((o=Pi())===a&&(o=null),e,e=kr(t,r)):(Bo=e,e=a)}else Bo=e,e=a;if(e===a){if(e=Bo,t=function(){var e,t,r;e=Bo,t=Bo,So++,r=qo(),So--,r!==a?(Bo=t,t=void 0):t=a;t!==a&&(e,t=_r());return e=t,e}(),t!==a){if(r=[],(o=Wo())!==a)for(;o!==a;)r.push(o),o=Wo();else r=a;r!==a?((o=Pi())===a&&(o=null),e,e=Pr(t,r)):(Bo=e,e=a)}else Bo=e,e=a;if(e===a)if(e=Bo,t=function(){var e,t,r;e=Bo,t=Bo,So++,r=Ho(),So--,r!==a?(Bo=t,t=void 0):t=a;t!==a&&(e,t=Rr());return e=t,e}(),t!==a){if(r=[],(o=Wo())!==a)for(;o!==a;)r.push(o),o=Wo();else r=a;r!==a?((o=Pi())===a&&(o=null),e,e=Kr(t,r)):(Bo=e,e=a)}else Bo=e,e=a}return e}(),r!==a&&(t,r=yr(r)),(t=r)===a&&(t=Bo,(r=ri())!==a&&(t,r=fr(r)),(t=r)===a&&(t=Bo,r=function(){var t,r,o;t=Bo,r=Mo(),r!==a?(o=function(){var t,r,o,i;t=Bo,r=Bo,o=[],i=$o();for(;i!==a;)o.push(i),i=$o();return r=e.substring(r,Bo),t,r=wr(r),t=r,t}(),t,t=Cr(r,o)):(Bo=t,t=a);return t}(),r!==a&&(t,r=hr(r)),(t=r)===a&&(t=Bo,r=function(){var e,t,r;e=Bo,t=Bo,So++,r=Go(),So--,r===a?t=void 0:(Bo=t,t=a);t!==a&&(r=Zo())!==a?(e,e=Gr(r)):(Bo=e,e=a);e===a&&(e=Bo,(t=ei())!==a&&(r=Zo())!==a?(e,e=Nr(r)):(Bo=e,e=a),e===a&&(e=Bo,(t=ei())!==a?(e,e=Dr(r="")):(Bo=e,e=a)));return e}(),r!==a&&(t,r=mr(r)),t=r)))),t}function Go(){var e;return(e=Do())===a&&(e=zo())===a&&(e=ri())===a&&(e=Mo())===a&&(e=ei()),e}function No(){var t;return 124===e.charCodeAt(Bo)?(t=p,Bo++):(t=a,0===So&&Lo(Ve)),t}function Do(){var t;return e.substr(Bo,4)===d?(t=d,Bo+=4):(t=a,0===So&&Lo(Ge)),t===a&&(e.substr(Bo,3)===y?(t=y,Bo+=3):(t=a,0===So&&Lo(Ne)),t===a&&(e.substr(Bo,2)===f?(t=f,Bo+=2):(t=a,0===So&&Lo(De)))),t}function Uo(){var t,r;return t=Bo,No()!==a?(r=function(){var t;return e.substr(Bo,4)===h?(t=h,Bo+=4):(t=a,0===So&&Lo(Ue)),t}(),r!==a?(t,t=vr(r)):(Bo=t,t=a)):(Bo=t,t=a),t}function Mo(){var t,r,o,i,n,s,l;if(t=Bo,Uo()!==a){for(r=Bo,o=Bo,i=[],Ie.test(e.charAt(Bo))?(n=e.charAt(Bo),Bo++):(n=a,0===So&&Lo(Me));n!==a;)i.push(n),Ie.test(e.charAt(Bo))?(n=e.charAt(Bo),Bo++):(n=a,0===So&&Lo(Me));(n=Si())!==a?o=i=[i,n]:(Bo=o,o=a),(r=o!==a?e.substring(r,Bo):o)!==a?(t,t=xr()):(Bo=t,t=a)}else Bo=t,t=a;if(t===a)if(t=Bo,Uo()!==a)if(58===e.charCodeAt(Bo)?(r=g,Bo++):(r=a,0===So&&Lo(Fe)),r!==a)if(o=function(){var t,r,o;e.substr(Bo,9)===m?(t=m,Bo+=9):(t=a,0===So&&Lo($e));if(t===a&&(e.substr(Bo,9)===T?(t=T,Bo+=9):(t=a,0===So&&Lo(Je)),t===a&&(e.substr(Bo,10)===b?(t=b,Bo+=10):(t=a,0===So&&Lo(qe)),t===a))){if(t=Bo,r=[],(o=Ki())!==a)for(;o!==a;)r.push(o),o=Ki();else r=a;(t=r!==a?e.substring(t,Bo):r)===a&&(t="")}return t}(),o!==a){for(i=Bo,n=Bo,s=[],Ie.test(e.charAt(Bo))?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Me));l!==a;)s.push(l),Ie.test(e.charAt(Bo))?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Me));(l=Si())!==a?n=s=[s,l]:(Bo=n,n=a),(i=n!==a?e.substring(i,Bo):n)!==a?(t,t=Ar(o)):(Bo=t,t=a)}else Bo=t,t=a;else Bo=t,t=a;else Bo=t,t=a;return t}function $o(){var t,r,o,i,n,s;if(t=Bo,r=Bo,So++,o=Go(),So--,o===a?r=void 0:(Bo=r,r=a),r!==a){if(o=Bo,i=Bo,n=[],(s=Ki())!==a)for(;s!==a;)n.push(s),s=Ki();else n=a;n!==a&&(s=Si())!==a?i=n=[n,s]:(Bo=i,i=a),(o=i!==a?e.substring(o,Bo):i)!==a?(t,t=Br(o)):(Bo=t,t=a)}else Bo=t,t=a;return t===a&&(t=Pi()),t}function Jo(){var t;return e.substr(Bo,2)===v?(t=v,Bo+=2):(t=a,0===So&&Lo(He)),t}function qo(){var t;return e.substr(Bo,3)===C?(t=C,Bo+=3):(t=a,0===So&&Lo(ze)),t}function Ho(){var t;return e.substr(Bo,3)===x?(t=x,Bo+=3):(t=a,0===So&&Lo(We)),t===a&&(e.substr(Bo,3)===A?(t=A,Bo+=3):(t=a,0===So&&Lo(Ye))),t}function zo(){var e;return(e=Jo())===a&&(e=qo())===a&&(e=Ho()),e}function Wo(){var t,r,o,i,n,s,l,u;if(t=Bo,Xo()!==a)if((r=zo())!==a){for(o=Bo,i=Bo,n=[],s=Bo,l=Bo,So++,u=Pi(),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);s!==a;)n.push(s),s=Bo,l=Bo,So++,u=Pi(),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);for((s=Pi())===a&&(s=null),i=n=[n,s],o=e.substring(o,Bo),i=[],n=Yo();n!==a;)i.push(n),n=Yo();if(n=Bo,s=function(){var t,r,o,i;t=Bo,So++,r=Bo,o=[],9===e.charCodeAt(Bo)?(i=w,Bo++):(i=a,0===So&&Lo(Ze));if(i!==a)for(;i!==a;)o.push(i),9===e.charCodeAt(Bo)?(i=w,Bo++):(i=a,0===So&&Lo(Ze));else o=a;o!==a?(Bo,(i=(i=jr(o))?void 0:a)!==a?(r,r=Vr(o)):(Bo=r,r=a)):(Bo=r,r=a);So--,r!==a?(Bo=t,t=void 0):t=a;return t}(),s!==a){for(l=[],u=Wo();u!==a;)l.push(u),u=Wo();u=function(){var e;Bo,e=Fr(),e=e?void 0:a;return e}(),u!==a?(n,n=Ir(r,o,i,l)):(Bo=n,n=a)}else Bo=n,n=a;n===a&&(n=null),t,t=Or(r,o,i,n)}else Bo=t,t=a;else Bo=t,t=a;return t}function Yo(){var t,r,o,i,n,s,l,u,c,p;if(t=Bo,r=Bo,So++,o=function(){var t,r,o;t=Bo,r=[],Ie.test(e.charAt(Bo))?(o=e.charAt(Bo),Bo++):(o=a,0===So&&Lo(Me));for(;o!==a;)r.push(o),Ie.test(e.charAt(Bo))?(o=e.charAt(Bo),Bo++):(o=a,0===So&&Lo(Me));o=Pi(),o!==a?t=r=[r,o]:(Bo=t,t=a);return t}(),So--,o===a?r=void 0:(Bo=r,r=a),r!==a)if((o=Xo())!==a)if(i=Bo,So++,n=zo(),So--,n===a?i=void 0:(Bo=i,i=a),i!==a){if(n=Bo,s=Bo,l=[],u=Bo,c=Bo,So++,p=Pi(),So--,p===a?c=void 0:(Bo=c,c=a),c!==a?(e.length>Bo?(p=e.charAt(Bo),Bo++):(p=a,0===So&&Lo(Xe)),p!==a?u=c=[c,p]:(Bo=u,u=a)):(Bo=u,u=a),u!==a)for(;u!==a;)l.push(u),u=Bo,c=Bo,So++,p=Pi(),So--,p===a?c=void 0:(Bo=c,c=a),c!==a?(e.length>Bo?(p=e.charAt(Bo),Bo++):(p=a,0===So&&Lo(Xe)),p!==a?u=c=[c,p]:(Bo=u,u=a)):(Bo=u,u=a);else l=a;l!==a&&(u=Si())!==a?s=l=[l,u]:(Bo=s,s=a),(n=s!==a?e.substring(n,Bo):s)!==a?(t,t=Er(n)):(Bo=t,t=a)}else Bo=t,t=a;else Bo=t,t=a;else Bo=t,t=a;return t}function Xo(){var t,r,o;for(t=Bo,r=[],9===e.charCodeAt(Bo)?(o=w,Bo++):(o=a,0===So&&Lo(Ze));o!==a;)r.push(o),9===e.charCodeAt(Bo)?(o=w,Bo++):(o=a,0===So&&Lo(Ze));return Bo,(o=(o=Lr(r))?void 0:a)!==a?t=r=[r,o]:(Bo=t,t=a),t}function Zo(){var t,r,o;if(t=Bo,r=[],(o=Qo())!==a)for(;o!==a;)r.push(o),o=Qo();else r=a;return t=r!==a?e.substring(t,Bo):r}function Qo(){var t,r,o,i,n,s;if(t=Bo,r=Bo,So++,o=Go(),So--,o===a?r=void 0:(Bo=r,r=a),r!==a){if(o=Bo,i=Bo,n=[],(s=Ki())!==a)for(;s!==a;)n.push(s),s=Ki();else n=a;n!==a&&(s=Si())!==a?i=n=[n,s]:(Bo=i,i=a),(o=i!==a?e.substring(o,Bo):i)!==a?t=r=[r,o]:(Bo=t,t=a)}else Bo=t,t=a;return t===a&&(t=Pi()),t}function ei(){var t,r,o,i,n,s;if(t=Bo,(r=No())!==a){for(o=Bo,i=Bo,n=[],Ie.test(e.charAt(Bo))?(s=e.charAt(Bo),Bo++):(s=a,0===So&&Lo(Me));s!==a;)n.push(s),Ie.test(e.charAt(Bo))?(s=e.charAt(Bo),Bo++):(s=a,0===So&&Lo(Me));(s=Si())!==a?i=n=[n,s]:(Bo=i,i=a),(o=i!==a?e.substring(o,Bo):i)!==a?((i=Pi())===a&&(i=null),t=r=[r,o,i]):(Bo=t,t=a)}else Bo=t,t=a;return t}function ti(){var t,r;return t=Bo,No()!==a?(r=function(){var t;return e.substr(Bo,5)===B?(t=B,Bo+=5):(t=a,0===So&&Lo(Qe)),t}(),r!==a?(t,t=Ur(r)):(Bo=t,t=a)):(Bo=t,t=a),t}function ri(){var t,r,o,i,n,s,l,u,c,p;if(t=Bo,(r=ti())!==a)if(58===e.charCodeAt(Bo)?(o=g,Bo++):(o=a,0===So&&Lo(Fe)),o!==a)if(32===e.charCodeAt(Bo)?(i=k,Bo++):(i=a,0===So&&Lo(et)),i===a&&(i=null),n=function(){var t,r,o,i,n,s,l,u,c;t=Bo,r=Bo,e.substr(Bo,4)===Be?(o=Be,Bo+=4):(o=a,0===So&&Lo(nr));if(o!==a)if(115===e.charCodeAt(Bo)?(i=ke,Bo++):(i=a,0===So&&Lo(sr)),i===a&&(i=null),e.substr(Bo,3)===Pe?(n=Pe,Bo+=3):(n=a,0===So&&Lo(ar)),n!==a){for(s=[],l=Bo,u=Bo,So++,c=No(),So--,c===a?u=void 0:(Bo=u,u=a),u!==a&&(c=_i())!==a?l=u=[u,c]:(Bo=l,l=a);l!==a;)s.push(l),l=Bo,u=Bo,So++,c=No(),So--,c===a?u=void 0:(Bo=u,u=a),u!==a&&(c=_i())!==a?l=u=[u,c]:(Bo=l,l=a);r=o=[o,i,n,s]}else Bo=r,r=a;else Bo=r,r=a;t=r!==a?e.substring(t,Bo):r;return t}(),n!==a)if(No()!==a){for(s=function(){var e,t,r;e=Bo,t=[],r=oi();for(;r!==a;)t.push(r),r=oi();return e,t=$r(t),e=t,e}(),l=Bo,u=Bo,c=[],Ie.test(e.charAt(Bo))?(p=e.charAt(Bo),Bo++):(p=a,0===So&&Lo(Me));p!==a;)c.push(p),Ie.test(e.charAt(Bo))?(p=e.charAt(Bo),Bo++):(p=a,0===So&&Lo(Me));(p=Si())!==a?u=c=[c,p]:(Bo=u,u=a),(l=u!==a?e.substring(l,Bo):u)!==a?((u=Pi())===a&&(u=null),t,t=Mr(r,n,s)):(Bo=t,t=a)}else Bo=t,t=a;else Bo=t,t=a;else Bo=t,t=a;else Bo=t,t=a;return t}function oi(){var t,r,o,i,n,s,l,u,c,p;if(t=Bo,35===e.charCodeAt(Bo)?(r=P,Bo++):(r=a,0===So&&Lo(tt)),r!==a){for(o=Bo,i=[],n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);o=e.substring(o,Bo),(i=No())!==a?(t,t=Jr(o)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a){if(t=Bo,64===e.charCodeAt(Bo)?(r=K,Bo++):(r=a,0===So&&Lo(rt)),r===a&&(r=null),(o=ii())!==a)if(58===e.charCodeAt(Bo)?(i=g,Bo++):(i=a,0===So&&Lo(Fe)),i!==a){for(n=[],32===e.charCodeAt(Bo)?(s=k,Bo++):(s=a,0===So&&Lo(et));s!==a;)n.push(s),32===e.charCodeAt(Bo)?(s=k,Bo++):(s=a,0===So&&Lo(et));if(s=Bo,l=[],u=Bo,c=Bo,So++,p=No(),So--,p===a?c=void 0:(Bo=c,c=a),c!==a?(Oe.test(e.charAt(Bo))?(p=e.charAt(Bo),Bo++):(p=a,0===So&&Lo(ot)),p!==a?u=c=[c,p]:(Bo=u,u=a)):(Bo=u,u=a),u!==a)for(;u!==a;)l.push(u),u=Bo,c=Bo,So++,p=No(),So--,p===a?c=void 0:(Bo=c,c=a),c!==a?(Oe.test(e.charAt(Bo))?(p=e.charAt(Bo),Bo++):(p=a,0===So&&Lo(ot)),p!==a?u=c=[c,p]:(Bo=u,u=a)):(Bo=u,u=a);else l=a;(s=l!==a?e.substring(s,Bo):l)!==a&&(l=No())!==a?(t,t=qr(o,s)):(Bo=t,t=a)}else Bo=t,t=a;else Bo=t,t=a;if(t===a){if(t=Bo,64===e.charCodeAt(Bo)?(r=K,Bo++):(r=a,0===So&&Lo(rt)),r===a&&(r=null),(o=ii())!==a)if(58===e.charCodeAt(Bo)?(i=g,Bo++):(i=a,0===So&&Lo(Fe)),i!==a){for(n=[],32===e.charCodeAt(Bo)?(s=k,Bo++):(s=a,0===So&&Lo(et));s!==a;)n.push(s),32===e.charCodeAt(Bo)?(s=k,Bo++):(s=a,0===So&&Lo(et));for(s=Bo,l=[],u=Bo,c=Bo,So++,p=No(),So--,p===a?c=void 0:(Bo=c,c=a),c!==a&&(p=Ki())!==a?u=c=[c,p]:(Bo=u,u=a);u!==a;)l.push(u),u=Bo,c=Bo,So++,p=No(),So--,p===a?c=void 0:(Bo=c,c=a),c!==a&&(p=Ki())!==a?u=c=[c,p]:(Bo=u,u=a);s=e.substring(s,Bo),(l=No())!==a?(t,t=Hr(o,s)):(Bo=t,t=a)}else Bo=t,t=a;else Bo=t,t=a;if(t===a){for(t=Bo,64===e.charCodeAt(Bo)?(r=K,Bo++):(r=a,0===So&&Lo(rt)),r===a&&(r=null),o=Bo,i=[],n=Bo,s=Bo,So++,(l=No())===a&&(58===e.charCodeAt(Bo)?(l=g,Bo++):(l=a,0===So&&Lo(Fe))),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,(l=No())===a&&(58===e.charCodeAt(Bo)?(l=g,Bo++):(l=a,0===So&&Lo(Fe))),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);if(o=e.substring(o,Bo),58===e.charCodeAt(Bo)?(i=g,Bo++):(i=a,0===So&&Lo(Fe)),i!==a){for(32===e.charCodeAt(Bo)?(n=k,Bo++):(n=a,0===So&&Lo(et)),n===a&&(n=null),s=Bo,l=[],u=Bo,c=Bo,So++,p=No(),So--,p===a?c=void 0:(Bo=c,c=a),c!==a&&(p=Ki())!==a?u=c=[c,p]:(Bo=u,u=a);u!==a;)l.push(u),u=Bo,c=Bo,So++,p=No(),So--,p===a?c=void 0:(Bo=c,c=a),c!==a&&(p=Ki())!==a?u=c=[c,p]:(Bo=u,u=a);s=e.substring(s,Bo),(l=No())!==a?(t,t=zr(o,s)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a){for(t=Bo,64===e.charCodeAt(Bo)?(r=K,Bo++):(r=a,0===So&&Lo(rt)),r===a&&(r=null),o=Bo,i=[],n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);o=e.substring(o,Bo),(i=No())!==a?(t,t=Wr(o)):(Bo=t,t=a)}}}}return t}function ii(){var t;return e.substr(Bo,5)===S?(t=S,Bo+=5):(t=a,0===So&&Lo(it)),t===a&&(e.substr(Bo,6)===_?(t=_,Bo+=6):(t=a,0===So&&Lo(nt))),t}function ni(){var e,t,r,o;for(e=Bo,(t=si())===a&&(t=null),r=[],(o=ci())===a&&(o=si());o!==a;)r.push(o),(o=ci())===a&&(o=si());return e,e=Xr(t,r)}function si(){var t,r,o,i,n,s,l;if(t=Bo,(r=Pi())!==a&&(t,r=Zr()),(t=r)===a){if(t=Bo,r=Bo,o=[],i=Bo,(n=pi())===a&&(n=null),s=Bo,So++,l=ci(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?i=n=[n,s,l]:(Bo=i,i=a),i===a&&(i=Bo,(n=pi())!==a?(s=Bo,So++,l=ci(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?i=n=[n,s]:(Bo=i,i=a)):(Bo=i,i=a)),i!==a)for(;i!==a;)o.push(i),i=Bo,(n=pi())===a&&(n=null),s=Bo,So++,l=ci(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?i=n=[n,s,l]:(Bo=i,i=a),i===a&&(i=Bo,(n=pi())!==a?(s=Bo,So++,l=ci(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?i=n=[n,s]:(Bo=i,i=a)):(Bo=i,i=a));else o=a;(r=o!==a?e.substring(r,Bo):o)!==a&&(t,r=Qr(r)),t=r}return t}function ai(){var t;return 61===e.charCodeAt(Bo)?(t=R,Bo++):(t=a,0===So&&Lo(at)),t}function li(){var t;return e.substr(Bo,2)===I?(t=I,Bo+=2):(t=a,0===So&&Lo(lt)),t}function ui(){var e,t,r;return e=Bo,(t=ai())!==a&&(r=ai())!==a?e=t=[t,r]:(Bo=e,e=a),e}function ci(){var t,r,o,i,n,s,l,u,c,g;if(t=Bo,(r=Ai())!==a){if(o=Bo,i=[],Oe.test(e.charAt(Bo))?(n=e.charAt(Bo),Bo++):(n=a,0===So&&Lo(ot)),n!==a)for(;n!==a;)i.push(n),Oe.test(e.charAt(Bo))?(n=e.charAt(Bo),Bo++):(n=a,0===So&&Lo(ot));else i=a;(o=i!==a?e.substring(o,Bo):i)!==a&&(i=wi())!==a?(t,t=eo(o)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a){if(t=Bo,(r=ui())!==a){for(32===e.charCodeAt(Bo)?(o=k,Bo++):(o=a,0===So&&Lo(et)),o===a&&(o=null),i=Bo,n=[],s=Bo,l=Bo,So++,u=Bo,32===e.charCodeAt(Bo)?(c=k,Bo++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=ui())!==a?u=c=[c,g]:(Bo=u,u=a),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);s!==a;)n.push(s),s=Bo,l=Bo,So++,u=Bo,32===e.charCodeAt(Bo)?(c=k,Bo++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=ui())!==a?u=c=[c,g]:(Bo=u,u=a),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);i=e.substring(i,Bo),32===e.charCodeAt(Bo)?(n=k,Bo++):(n=a,0===So&&Lo(et)),n===a&&(n=null),(s=ui())!==a?(l=function(){var t,r,o,i;t=Bo,124===e.charCodeAt(Bo)?(r=p,Bo++):(r=a,0===So&&Lo(Ve));if(r!==a){for(o=[],i=gi();i!==a;)o.push(i),i=gi();t,t=ao(o)}else Bo=t,t=a;return t}(),l===a&&(l=null),t,t=to(i,l)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a){if(t=Bo,(r=bi())!==a){for(32===e.charCodeAt(Bo)?(o=k,Bo++):(o=a,0===So&&Lo(et)),o===a&&(o=null),i=Bo,n=[],s=Bo,l=Bo,So++,u=Bo,32===e.charCodeAt(Bo)?(c=k,Bo++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=bi())!==a?u=c=[c,g]:(Bo=u,u=a),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);s!==a;)n.push(s),s=Bo,l=Bo,So++,u=Bo,32===e.charCodeAt(Bo)?(c=k,Bo++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=bi())!==a?u=c=[c,g]:(Bo=u,u=a),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);i=e.substring(i,Bo),32===e.charCodeAt(Bo)?(n=k,Bo++):(n=a,0===So&&Lo(et)),n===a&&(n=null),(s=bi())!==a?(t,t=ro(i)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a){if(t=Bo,(r=vi())!==a){for(32===e.charCodeAt(Bo)?(o=k,Bo++):(o=a,0===So&&Lo(et)),o===a&&(o=null),i=Bo,n=[],s=Bo,l=Bo,So++,u=Bo,32===e.charCodeAt(Bo)?(c=k,Bo++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=vi())!==a?u=c=[c,g]:(Bo=u,u=a),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);s!==a;)n.push(s),s=Bo,l=Bo,So++,u=Bo,32===e.charCodeAt(Bo)?(c=k,Bo++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=vi())!==a?u=c=[c,g]:(Bo=u,u=a),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);i=e.substring(i,Bo),32===e.charCodeAt(Bo)?(n=k,Bo++):(n=a,0===So&&Lo(et)),n===a&&(n=null),(s=vi())!==a?(t,t=oo(i)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a){if(t=Bo,(r=Ci())!==a){for(32===e.charCodeAt(Bo)?(o=k,Bo++):(o=a,0===So&&Lo(et)),o===a&&(o=null),i=Bo,n=[],s=Bo,l=Bo,So++,u=Bo,32===e.charCodeAt(Bo)?(c=k,Bo++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=Ci())!==a?u=c=[c,g]:(Bo=u,u=a),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);s!==a;)n.push(s),s=Bo,l=Bo,So++,u=Bo,32===e.charCodeAt(Bo)?(c=k,Bo++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=Ci())!==a?u=c=[c,g]:(Bo=u,u=a),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);i=e.substring(i,Bo),32===e.charCodeAt(Bo)?(n=k,Bo++):(n=a,0===So&&Lo(et)),n===a&&(n=null),(s=Ci())!==a?(t,t=io(i)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a){if(t=Bo,(r=xi())!==a){for(32===e.charCodeAt(Bo)?(o=k,Bo++):(o=a,0===So&&Lo(et)),o===a&&(o=null),i=Bo,n=[],s=Bo,l=Bo,So++,u=Bo,32===e.charCodeAt(Bo)?(c=k,Bo++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=xi())!==a?u=c=[c,g]:(Bo=u,u=a),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);s!==a;)n.push(s),s=Bo,l=Bo,So++,u=Bo,32===e.charCodeAt(Bo)?(c=k,Bo++):(c=a,0===So&&Lo(et)),c===a&&(c=null),(g=xi())!==a?u=c=[c,g]:(Bo=u,u=a),So--,u===a?l=void 0:(Bo=l,l=a),l!==a?(e.length>Bo?(u=e.charAt(Bo),Bo++):(u=a,0===So&&Lo(Xe)),u!==a?s=l=[l,u]:(Bo=s,s=a)):(Bo=s,s=a);i=e.substring(i,Bo),32===e.charCodeAt(Bo)?(n=k,Bo++):(n=a,0===So&&Lo(et)),n===a&&(n=null),(s=xi())!==a?(t,t=no(i)):(Bo=t,t=a)}else Bo=t,t=a;t===a&&(t=Bo,r=function(){var t,r,o,i,n,s,l;t=Bo,r=Bo,o=Bo,e.substr(Bo,4)===Be?(i=Be,Bo+=4):(i=a,0===So&&Lo(nr));i!==a?(115===e.charCodeAt(Bo)?(n=ke,Bo++):(n=a,0===So&&Lo(sr)),n===a&&(n=null),e.substr(Bo,3)===Pe?(s=Pe,Bo+=3):(s=a,0===So&&Lo(ar)),s!==a?o=i=[i,n,s]:(Bo=o,o=a)):(Bo=o,o=a);o===a&&(e.substr(Bo,7)===Ke?(o=Ke,Bo+=7):(o=a,0===So&&Lo(lr)));r=o!==a?e.substring(r,Bo):o;if(r!==a){for(o=Bo,i=[],n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=_i())!==a?n=s=[s,l]:(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=_i())!==a?n=s=[s,l]:(Bo=n,n=a);o=e.substring(o,Bo),t,t=wo(r,o)}else Bo=t,t=a;return t}(),r!==a&&(t,r=so(r)),t=r)}}}}}return t}function pi(){var t,r,o,i,n;if(t=Bo,r=Bo,(o=ui())!==a){if(i=[],(n=ai())!==a)for(;n!==a;)i.push(n),n=ai();else i=a;i!==a?r=o=[o,i]:(Bo=r,r=a)}else Bo=r,r=a;if((t=r!==a?e.substring(t,Bo):r)===a){if(t=Bo,r=Bo,o=function(){var e,t,r;return e=Bo,(t=li())!==a&&(r=li())!==a?e=t=[t,r]:(Bo=e,e=a),e}(),o!==a){if(i=[],(n=li())!==a)for(;n!==a;)i.push(n),n=li();else i=a;i!==a?r=o=[o,i]:(Bo=r,r=a)}else Bo=r,r=a;if((t=r!==a?e.substring(t,Bo):r)===a){if(t=Bo,r=Bo,(o=Ci())!==a){if(i=[],(n=mi())!==a)for(;n!==a;)i.push(n),n=mi();else i=a;i!==a?r=o=[o,i]:(Bo=r,r=a)}else Bo=r,r=a;if((t=r!==a?e.substring(t,Bo):r)===a){if(t=Bo,r=Bo,(o=xi())!==a){if(i=[],(n=Ti())!==a)for(;n!==a;)i.push(n),n=Ti();else i=a;i!==a?r=o=[o,i]:(Bo=r,r=a)}else Bo=r,r=a;t=r!==a?e.substring(t,Bo):r}}}return t}function gi(){var t,r,o,i,n,s,l;if(t=Bo,e.substr(Bo,5)===O?(r=O,Bo+=5):(r=a,0===So&&Lo(ut)),r!==a){for(o=Bo,i=[],n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);o=e.substring(o,Bo),(i=No())!==a?(t,t=lo(o)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a){if(t=Bo,e.substr(Bo,4)===E?(r=E,Bo+=4):(r=a,0===So&&Lo(ct)),r!==a){for(o=Bo,i=[],n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);o=e.substring(o,Bo),(i=No())!==a?(t,t=uo(o)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a&&(t=Bo,e.substr(Bo,4)===h?(r=h,Bo+=4):(r=a,0===So&&Lo(Ue)),r!==a&&(o=No())!==a?(t,t=co()):(Bo=t,t=a),t===a)){if(t=Bo,e.substr(Bo,5)===L?(r=L,Bo+=5):(r=a,0===So&&Lo(pt)),r!==a){for(o=Bo,i=[],n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);o=e.substring(o,Bo),(i=No())!==a?(t,t=po(o)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a&&(t=Bo,e.substr(Bo,6)===j?(r=j,Bo+=6):(r=a,0===So&&Lo(gt)),r!==a?(o=function(){var t;e.substr(Bo,4)===q?(t=q,Bo+=4):(t=a,0===So&&Lo(xt));t===a&&(e.substr(Bo,5)===H?(t=H,Bo+=5):(t=a,0===So&&Lo(At)),t===a&&(e.substr(Bo,4)===z?(t=z,Bo+=4):(t=a,0===So&&Lo(wt)),t===a&&(e.substr(Bo,4)===W?(t=W,Bo+=4):(t=a,0===So&&Lo(Bt)),t===a&&(e.substr(Bo,7)===Y?(t=Y,Bo+=7):(t=a,0===So&&Lo(kt)),t===a&&(e.substr(Bo,9)===X?(t=X,Bo+=9):(t=a,0===So&&Lo(Pt)),t===a&&(e.substr(Bo,4)===Z?(t=Z,Bo+=4):(t=a,0===So&&Lo(Kt)),t===a&&(e.substr(Bo,8)===Q?(t=Q,Bo+=8):(t=a,0===So&&Lo(St)),t===a&&(e.substr(Bo,5)===ee?(t=ee,Bo+=5):(t=a,0===So&&Lo(_t)),t===a&&(e.substr(Bo,4)===te?(t=te,Bo+=4):(t=a,0===So&&Lo(Rt)),t===a&&(e.substr(Bo,7)===re?(t=re,Bo+=7):(t=a,0===So&&Lo(It)),t===a&&(e.substr(Bo,6)===oe?(t=oe,Bo+=6):(t=a,0===So&&Lo(Ot)),t===a&&(e.substr(Bo,4)===ie?(t=ie,Bo+=4):(t=a,0===So&&Lo(Et)),t===a&&(e.substr(Bo,5)===ne?(t=ne,Bo+=5):(t=a,0===So&&Lo(Lt)),t===a&&(e.substr(Bo,6)===se?(t=se,Bo+=6):(t=a,0===So&&Lo(jt)),t===a&&(e.substr(Bo,6)===ae?(t=ae,Bo+=6):(t=a,0===So&&Lo(Vt)),t===a&&(e.substr(Bo,3)===le?(t=le,Bo+=3):(t=a,0===So&&Lo(Ft)),t===a&&(e.substr(Bo,6)===ue?(t=ue,Bo+=6):(t=a,0===So&&Lo(Gt)),t===a&&(e.substr(Bo,4)===ce?(t=ce,Bo+=4):(t=a,0===So&&Lo(Nt)),t===a&&(e.substr(Bo,6)===pe?(t=pe,Bo+=6):(t=a,0===So&&Lo(Dt)),t===a&&(e.substr(Bo,5)===ge?(t=ge,Bo+=5):(t=a,0===So&&Lo(Ut)),t===a&&(e.substr(Bo,6)===de?(t=de,Bo+=6):(t=a,0===So&&Lo(Mt)))))))))))))))))))))));return t}(),o!==a&&(i=No())!==a?(t,t=go(o)):(Bo=t,t=a)):(Bo=t,t=a),t===a&&(t=Bo,r=function(){var t;e.substr(Bo,4)===V?(t=V,Bo+=4):(t=a,0===So&&Lo(dt));t===a&&(e.substr(Bo,6)===F?(t=F,Bo+=6):(t=a,0===So&&Lo(yt)),t===a&&(e.substr(Bo,5)===G?(t=G,Bo+=5):(t=a,0===So&&Lo(ft)),t===a&&(e.substr(Bo,9)===N?(t=N,Bo+=9):(t=a,0===So&&Lo(ht)),t===a&&(e.substr(Bo,6)===D?(t=D,Bo+=6):(t=a,0===So&&Lo(mt)),t===a&&(e.substr(Bo,3)===U?(t=U,Bo+=3):(t=a,0===So&&Lo(Tt)),t===a&&(e.substr(Bo,5)===M?(t=M,Bo+=5):(t=a,0===So&&Lo(bt)),t===a&&(e.substr(Bo,3)===$?(t=$,Bo+=3):(t=a,0===So&&Lo(vt)),t===a&&(e.substr(Bo,3)===J?(t=J,Bo+=3):(t=a,0===So&&Lo(Ct))))))))));return t}(),r!==a&&(o=No())!==a?(t,t=yo(r)):(Bo=t,t=a),t===a)))if(t=Bo,35===e.charCodeAt(Bo)?(r=P,Bo++):(r=a,0===So&&Lo(tt)),r!==a){for(o=Bo,i=[],n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,l=No(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a&&(l=Ki())!==a?n=s=[s,l]:(Bo=n,n=a);o=e.substring(o,Bo),(i=No())!==a?(t,t=fo(o)):(Bo=t,t=a)}else Bo=t,t=a}}return t}function di(){var e,t,r,o;for(So++,e=Bo,(t=yi())===a&&(t=null),r=[],(o=Bi())===a&&(o=yi());o!==a;)r.push(o),(o=Bi())===a&&(o=yi());return e,e=mo(t,r),So--,t=a,0===So&&Lo(Jt),e}function yi(){var t,r,o,i,n,s,l;if(t=Bo,r=Bo,o=[],i=Bo,(n=ki())===a&&(n=null),s=Bo,So++,l=Bi(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?(e.length>Bo?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Xe)),l!==a?i=n=[n,s,l]:(Bo=i,i=a)):(Bo=i,i=a),i!==a)for(;i!==a;)o.push(i),i=Bo,(n=ki())===a&&(n=null),s=Bo,So++,l=Bi(),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?(e.length>Bo?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Xe)),l!==a?i=n=[n,s,l]:(Bo=i,i=a)):(Bo=i,i=a);else o=a;return(r=o!==a?e.substring(r,Bo):o)!==a&&(t,r=To(r)),(t=r)===a&&(t=Pi()),t}function fi(){var t;return 42===e.charCodeAt(Bo)?(t=ye,Bo++):(t=a,0===So&&Lo(qt)),t}function hi(){var t;return 95===e.charCodeAt(Bo)?(t=fe,Bo++):(t=a,0===So&&Lo(Ht)),t}function mi(){var t;return 96===e.charCodeAt(Bo)?(t=he,Bo++):(t=a,0===So&&Lo(zt)),t}function Ti(){var t;return 33===e.charCodeAt(Bo)?(t=me,Bo++):(t=a,0===So&&Lo(Wt)),t}function bi(){var e,t,r;return e=Bo,(t=fi())!==a&&(r=fi())!==a?e=t=[t,r]:(Bo=e,e=a),e}function vi(){var e,t,r;return e=Bo,(t=hi())!==a&&(r=hi())!==a?e=t=[t,r]:(Bo=e,e=a),e}function Ci(){var e,t,r;return e=Bo,(t=mi())!==a&&(r=mi())!==a?e=t=[t,r]:(Bo=e,e=a),e}function xi(){var e,t,r;return e=Bo,(t=Ti())!==a&&(r=Ti())!==a?e=t=[t,r]:(Bo=e,e=a),e}function Ai(){var t;return e.substr(Bo,2)===Te?(t=Te,Bo+=2):(t=a,0===So&&Lo(Yt)),t}function wi(){var t;return 93===e.charCodeAt(Bo)?(t=be,Bo++):(t=a,0===So&&Lo(Xt)),t}function Bi(){var t,r,o,i,n,s,l,u,c;if(t=Bo,Ai()!==a){if(r=Bo,o=[],Oe.test(e.charAt(Bo))?(i=e.charAt(Bo),Bo++):(i=a,0===So&&Lo(ot)),i!==a)for(;i!==a;)o.push(i),Oe.test(e.charAt(Bo))?(i=e.charAt(Bo),Bo++):(i=a,0===So&&Lo(ot));else o=a;(r=o!==a?e.substring(r,Bo):o)!==a&&(o=wi())!==a?(t,t=bo(r)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a){if(t=Bo,bi()!==a){for(32===e.charCodeAt(Bo)?(r=k,Bo++):(r=a,0===So&&Lo(et)),r===a&&(r=null),o=Bo,i=[],n=Bo,s=Bo,So++,l=Bo,32===e.charCodeAt(Bo)?(u=k,Bo++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=bi())!==a?l=u=[u,c]:(Bo=l,l=a),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?(e.length>Bo?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(Bo=n,n=a)):(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,l=Bo,32===e.charCodeAt(Bo)?(u=k,Bo++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=bi())!==a?l=u=[u,c]:(Bo=l,l=a),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?(e.length>Bo?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(Bo=n,n=a)):(Bo=n,n=a);o=e.substring(o,Bo),32===e.charCodeAt(Bo)?(i=k,Bo++):(i=a,0===So&&Lo(et)),i===a&&(i=null),(n=bi())!==a?(t,t=vo(o)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a){if(t=Bo,vi()!==a){for(32===e.charCodeAt(Bo)?(r=k,Bo++):(r=a,0===So&&Lo(et)),r===a&&(r=null),o=Bo,i=[],n=Bo,s=Bo,So++,l=Bo,32===e.charCodeAt(Bo)?(u=k,Bo++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=vi())!==a?l=u=[u,c]:(Bo=l,l=a),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?(e.length>Bo?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(Bo=n,n=a)):(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,l=Bo,32===e.charCodeAt(Bo)?(u=k,Bo++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=vi())!==a?l=u=[u,c]:(Bo=l,l=a),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?(e.length>Bo?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(Bo=n,n=a)):(Bo=n,n=a);o=e.substring(o,Bo),32===e.charCodeAt(Bo)?(i=k,Bo++):(i=a,0===So&&Lo(et)),i===a&&(i=null),(n=vi())!==a?(t,t=Co(o)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a){if(t=Bo,Ci()!==a){for(32===e.charCodeAt(Bo)?(r=k,Bo++):(r=a,0===So&&Lo(et)),r===a&&(r=null),o=Bo,i=[],n=Bo,s=Bo,So++,l=Bo,32===e.charCodeAt(Bo)?(u=k,Bo++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=Ci())!==a?l=u=[u,c]:(Bo=l,l=a),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?(e.length>Bo?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(Bo=n,n=a)):(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,l=Bo,32===e.charCodeAt(Bo)?(u=k,Bo++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=Ci())!==a?l=u=[u,c]:(Bo=l,l=a),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?(e.length>Bo?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(Bo=n,n=a)):(Bo=n,n=a);o=e.substring(o,Bo),32===e.charCodeAt(Bo)?(i=k,Bo++):(i=a,0===So&&Lo(et)),i===a&&(i=null),(n=Ci())!==a?(t,t=xo(o)):(Bo=t,t=a)}else Bo=t,t=a;if(t===a)if(t=Bo,xi()!==a){for(32===e.charCodeAt(Bo)?(r=k,Bo++):(r=a,0===So&&Lo(et)),r===a&&(r=null),o=Bo,i=[],n=Bo,s=Bo,So++,l=Bo,32===e.charCodeAt(Bo)?(u=k,Bo++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=xi())!==a?l=u=[u,c]:(Bo=l,l=a),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?(e.length>Bo?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(Bo=n,n=a)):(Bo=n,n=a);n!==a;)i.push(n),n=Bo,s=Bo,So++,l=Bo,32===e.charCodeAt(Bo)?(u=k,Bo++):(u=a,0===So&&Lo(et)),u===a&&(u=null),(c=xi())!==a?l=u=[u,c]:(Bo=l,l=a),So--,l===a?s=void 0:(Bo=s,s=a),s!==a?(e.length>Bo?(l=e.charAt(Bo),Bo++):(l=a,0===So&&Lo(Xe)),l!==a?n=s=[s,l]:(Bo=n,n=a)):(Bo=n,n=a);o=e.substring(o,Bo),32===e.charCodeAt(Bo)?(i=k,Bo++):(i=a,0===So&&Lo(et)),i===a&&(i=null),(n=xi())!==a?(t,t=Ao(o)):(Bo=t,t=a)}else Bo=t,t=a}}}return t}function ki(){var t,r,o,i,n;if(t=Bo,r=Bo,(o=bi())!==a){if(i=[],(n=fi())!==a)for(;n!==a;)i.push(n),n=fi();else i=a;i!==a?r=o=[o,i]:(Bo=r,r=a)}else Bo=r,r=a;if((t=r!==a?e.substring(t,Bo):r)===a){if(t=Bo,r=Bo,(o=vi())!==a){if(i=[],(n=hi())!==a)for(;n!==a;)i.push(n),n=hi();else i=a;i!==a?r=o=[o,i]:(Bo=r,r=a)}else Bo=r,r=a;if((t=r!==a?e.substring(t,Bo):r)===a){if(t=Bo,r=Bo,(o=Ci())!==a){if(i=[],(n=mi())!==a)for(;n!==a;)i.push(n),n=mi();else i=a;i!==a?r=o=[o,i]:(Bo=r,r=a)}else Bo=r,r=a;if((t=r!==a?e.substring(t,Bo):r)===a){if(t=Bo,r=Bo,(o=xi())!==a){if(i=[],(n=Ti())!==a)for(;n!==a;)i.push(n),n=Ti();else i=a;i!==a?r=o=[o,i]:(Bo=r,r=a)}else Bo=r,r=a;t=r!==a?e.substring(t,Bo):r}}}return t}function Pi(){var t;return So++,10===e.charCodeAt(Bo)?(t=ve,Bo++):(t=a,0===So&&Lo(Qt)),t===a&&(e.substr(Bo,2)===Ce?(t=Ce,Bo+=2):(t=a,0===So&&Lo(er)),t===a&&(13===e.charCodeAt(Bo)?(t=xe,Bo++):(t=a,0===So&&Lo(tr)),t===a&&(8232===e.charCodeAt(Bo)?(t=Ae,Bo++):(t=a,0===So&&Lo(rr)),t===a&&(8233===e.charCodeAt(Bo)?(t=we,Bo++):(t=a,0===So&&Lo(or)))))),So--,t===a&&(a,0===So&&Lo(Zt)),t}function Ki(){var t;return Ee.test(e.charAt(Bo))?(t=e.charAt(Bo),Bo++):(t=a,0===So&&Lo(ir)),t}function Si(){var t,r;return(t=Pi())===a&&(t=Bo,So++,e.length>Bo?(r=e.charAt(Bo),Bo++):(r=a,0===So&&Lo(Xe)),So--,r===a?t=void 0:(Bo=t,t=a)),t}function _i(){var t;return Le.test(e.charAt(Bo))?(t=e.charAt(Bo),Bo++):(t=a,0===So&&Lo(ur)),t===a&&(126===e.charCodeAt(Bo)?(t=Se,Bo++):(t=a,0===So&&Lo(cr)),t===a&&(94===e.charCodeAt(Bo)?(t=_e,Bo++):(t=a,0===So&&Lo(pr)),t===a&&(39===e.charCodeAt(Bo)?(t=Re,Bo++):(t=a,0===So&&Lo(gr))))),t}var Ri=[],Ii="";if(e=e.trimStart(),(r=c())!==a&&Bo===e.length)return r;throw r!==a&&Bo<e.length&&Lo({type:"end"}),jo(Ko,Po<e.length?e.charAt(Po):null,Po<e.length?Eo(Po,Po+1):Eo(Po,Po))}t.unbreakscape=o,t.SyntaxError=s,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(s,Error),s.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,o=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){o=e[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,s=this.location.source+":"+n.line+":"+n.column;if(o){var l=this.location.end,u=a("",n.line.toString().length," "),c=o[i.line-1],p=(i.line===l.line?l.column:c.length+1)-i.column||1;t+="\n --\x3e "+s+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+a("",i.column-1," ")+a("",p,"^")}else t+="\n at "+s}return t},s.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function o(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function s(e){return r[e.type](e)}return"Expected "+function(e){var t,r,o=e.map(s);if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},t.parse=l},297:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkGenerator=void 0;const i=r(8256),n=r(2606),s=r(549),a=r(208),l=r(8791),u=r(1060),c=r(8565),p=r(7204),g=r(7953),d=r(9779),y=r(1353),f=r(672),h={debugGenerationInline:!1};t.BitmarkGenerator=class{constructor(e,t){var r;this.ast=new i.Ast,this.skipNLBetweenBitsValue=!1,this.printed=!1,this.bitmarkVersion=null!==(r=l.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:l.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},h),null==t?void 0:t.bitmarkOptions),this.bitmarkVersion===l.BitmarkVersion.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.CardSetVersion.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.CardSetVersion.v2),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return o(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.writeLine(),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.skipNLBetweenBitsValue=!1,this.printed=!1}walkAndWrite(e){this.ast.walk(e,s.NodeType.bitmarkAst,this,void 0),this.writeLine()}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const s=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof s[a]&&(n=s[a](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}between_bits(e,t,r,o,i){this.writeNL(),this.writeNL(),this.writeNL()}enter_bitsValue(e,t,r){const o=e.value,i=n.Config.getBitConfig(o.bitType),s=n.Config.getBitResourcesConfig(o.bitType,o.resourceType);if(this.writeOPD(),this.writeString(o.bitType.alias),o.textFormat){this.isWriteTextFormat(o.textFormat)&&(this.writeColon(),this.writeString(o.textFormat))}let a;if(i.resourceAttachmentAllowed&&o.resources&&o.resources.length>0){const e=s.comboResourceTagTypesMap;if(s.comboResourceTagTypesMap.size>0)for(const t of e.keys())a=t;else a=o.resources[0].type}a&&(this.writeAmpersand(),this.writeString(a)),this.writeCL(),this.writeNL()}between_bitsValue(e,t,r,o,i){const n=[s.NodeType.bitType,s.NodeType.textFormat,s.NodeType.level,s.NodeType.progress,s.NodeType.toc,s.NodeType.referenceEnd,s.NodeType.labelFalse];e.value.book&&n.push(s.NodeType.reference);(()=>{if(this.skipNLBetweenBitsValue)return this.skipNLBetweenBitsValue=!1,!0;for(const e of n)if(t.key===e)return!0;return!1})()||this.writeNL()}enter_labelTrue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const i=null==t?void 0:t.value;i&&(""!=o&&this.writeProperty(g.PropertyTag.labelTrue,o,!0),i.labelFalse&&""!=i.labelFalse[0]&&this.writeProperty(g.PropertyTag.labelFalse,i.labelFalse,!0))}enter_imageSource(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const{url:i,mockupId:n,size:a,format:l,trim:u}=o;this.writeProperty("imageSource",i,!0),i&&(n&&this.writeProperty("mockupId",n,!0),a&&this.writeProperty("size",a,!0),l&&this.writeProperty("format",l,!0),f.BooleanUtils.isBoolean(u)&&this.writeProperty("trim",u,!0))}enter_partner(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const{name:i,avatarImage:n}=o;this.writeProperty("partner",i,!0),n&&this.writeResource(n)}enter_markConfigValue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==s.NodeType.markConfig)return;const{mark:i,color:n,emphasis:a}=o;i&&(this.writeProperty("mark",i,!0),n&&this.writeProperty("color",n,!0),a&&this.writeProperty("emphasis",a,!0),this.writeNL())}leaf_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}leaf_reasonableNumOfChars(e,t,r){this.writeProperty("reasonableNumOfChars",e.value)}enter_itemLead(e,t,r){const o=e.value;o&&(o.item||o.lead)&&(this.writeOPC(),this.writeString(o.item||""),this.writeCL(),o.lead&&(this.writeOPC(),this.writeString(o.lead),this.writeCL()))}enter_body(e,t,r){e.value.bodyParts.length>0&&this.writeNL()}enter_solutions(e,t,r){const o=e.value;o&&0===o.length&&(this.writeOPU(),this.writeCL())}leaf_solution(e,t,r){var o;const i=e.value,n=null===(o=this.getParentNode(r,2))||void 0===o?void 0:o.value;(null==n?void 0:n.type)===u.BodyBitType.mark&&i&&(this.writeOPE(),this.writeString(i),this.writeCL())}leaf_mark(e,t,r){var o;const i=e.value,n=null===(o=this.getParentNode(r,2))||void 0===o?void 0:o.value;(null==n?void 0:n.type)===u.BodyBitType.mark&&i&&this.writeProperty("mark",i,!0)}enter_optionsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_textsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeCardSetStart(),this.writeNL())}between_cardNode(e,t,r,o,i){this.isRootBitType1(i)||(this.writeNL(),this.writeCardSetCardDivider(),this.writeNL())}exit_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeNL(),this.writeCardSetEnd())}enter_elements(e,t,r){}between_elements(e,t,r,o,i){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}exit_elements(e,t,r){}between_flashcards(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}between_flashcardsValue(e,t,r,o,i){r.key===s.NodeType.answer?(this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()):r.key===s.NodeType.alternativeAnswers&&(this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL())}leaf_answer(e,t,r){(null==t?void 0:t.key)===s.NodeType.flashcardsValue&&e.value&&this.writeString(e.value)}between_alternativeAnswers(e,t,r){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}leaf_alternativeAnswersValue(e,t,r){(null==t?void 0:t.key)===s.NodeType.alternativeAnswers&&e.value&&this.writeString(e.value)}enter_statements(e,t,r){}between_statements(e,t,r,o,i){this.isRootBitType(i,a.RootBitType.trueFalse1)||(this.writeNL(),this.writeCardSetCardDivider()),this.writeNL()}exit_statements(e,t,r){}enter_statementsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}between_choices(e,t,r,o,i){this.writeNL()}exit_choices(e,t,r){this.writeNL()}enter_choicesValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}between_responses(e,t,r,o,i){this.writeNL()}exit_responses(e,t,r){this.writeNL()}enter_responsesValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_quizzes(e,t,r){}between_quizzes(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_quizzes(e,t,r){}between_quizzesValue(e,t,r,o,i){r.key!==s.NodeType.choices&&r.key!==s.NodeType.responses||this.writeNL()}enter_heading(e,t,r){}between_heading(e,t,r,o,i){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_heading(e,t,r){}enter_forValues(e,t,r){}between_forValues(e,t,r,o,i){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_forValues(e,t,r){}enter_pairs(e,t,r){}between_pairs(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_pairs(e,t,r){}between_pairsValue(e,t,r,o,i){}enter_keyAudio(e,t,r){const o=e.value;this.writeResource(o)}enter_keyImage(e,t,r){const o=e.value;this.writeResource(o)}enter_matrix(e,t,r){}between_matrix(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_matrix(e,t,r){}between_matrixValue(e,t,r,o,i){}enter_values(e,t,r){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}between_values(e,t,r,o,i){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}enter_questions(e,t,r){}between_questions(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_questions(e,t,r){}between_questionsValue(e,t,r,o,i){r.key===s.NodeType.sampleSolution&&this.writeNL()}exit_questionsValue(e,t,r){this.writeNL()}enter_botResponses(e,t,r){}between_botResponses(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_botResponses(e,t,r){}between_botResponsesValue(e,t,r,o,i){this.writeNL()}exit_botResponsesValue(e,t,r){this.writeNL()}leaf_response(e,t,r){this.writeOPB(),this.writeString(e.value),this.writeCL()}leaf_reaction(e,t,r){this.writeProperty("reaction",e.value,!0)}leaf_feedback(e,t,r){const o=e.value;o&&this.write(o)}between_resources(e,t,r,o,i){this.writeNL()}enter_resourcesValue(e,t,r){const o=e.value;this.writeResource(o)}enter_posterImage(e,t,r){const o=e.value;o&&o.value&&this.writeProperty("posterImage",o.value)}enter_thumbnails(e,t,r){const o=e.value;if(Array.isArray(o)){const e=["src1x","src2x","src3x","src4x"];for(let t=0;t<o.length&&t!==e.length;t++){const r=o[t],i=e[t];this.writeProperty(i,r.value,!0)}}}leaf_title(e,t,r){const o=e.value,i=(null==t?void 0:t.value).level||1;if(i&&o){this.writeOP();for(let e=0;e<+i;e++)this.writeHash();this.writeString(o),this.writeCL()}}leaf_subtitle(e,t,r){const o=e.value;if(o){this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeString(o),this.writeCL()}}leaf_book(e,t,r){const o=null==t?void 0:t.value;o&&e.value&&(this.writeProperty("book",e.value),o.reference&&(this.writeOPRANGLE(),this.writeString(o.reference),this.writeCL(),o.referenceEnd&&(this.writeOPRANGLE(),this.writeString(o.referenceEnd),this.writeCL())))}leaf_anchor(e,t,r){e.value&&(this.writeOPDANGLE(),this.writeString(e.value),this.writeCL())}leaf_reference(e,t,r){const o=null==t?void 0:t.value;o&&e.value&&(o.book||(this.writeOPRANGLE(),this.writeString(e.value),this.writeCL()))}leaf_hint(e,t,r){const o=e.value;o&&(this.writeOPQ(),this.writeString(o),this.writeCL())}leaf_instruction(e,t,r){const o=e.value;o&&(this.writeOPB(),this.writeString(o),this.writeCL())}leaf_example(e,t,r){var o,i;const n=e.value,s=null!==(o=null==t?void 0:t.value.isExample)&&void 0!==o&&o,a=null!==(i=null==t?void 0:t.value.isDefaultExample)&&void 0!==i&&i;s&&(a?(this.writeOPA(),this.writeString("example"),this.writeCL()):null!=n&&(this.writeOPA(),this.writeString("example"),this.writeColon(),!0===n?this.writeString("true"):!1===n?this.writeString("false"):this.writeString(n),this.writeCL()))}leaf_bodyText(e,t,r){const o=e.value;o&&this.writeString(o)}leaf_footerText(e,t,r){const o=e.value;o&&this.writeString(o)}leaf_elementsValue(e,t,r){e.value&&this.writeString(e.value)}leaf_solutionsValue(e,t,r){e.value&&(this.writeOPU(),this.writeString(e.value),this.writeCL())}leaf_prefix(e,t,r){e.value&&(this.writeOPPRE(),this.writeString(e.value),this.writeCL())}leaf_postfix(e,t,r){e.value&&(this.writeOPPOST(),this.writeString(e.value),this.writeCL())}leaf_forKeys(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_forValuesValue(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_key(e,t,r){e.value&&this.writeString(e.value)}leaf_valuesValue(e,t,r){e.value&&this.writeString(e.value)}leaf_question(e,t,r){(null==t?void 0:t.key)!==s.NodeType.questionsValue&&(null==t?void 0:t.key)!==s.NodeType.flashcardsValue||e.value&&this.writeString(e.value)}leaf_isShortAnswer(e,t,r){!1===e.value&&(this.writeOPA(),this.writeString("longAnswer"),this.writeCL())}leaf_src1x(e,t,r){this.writeProperty("src1x",e.value)}leaf_src2x(e,t,r){this.writeProperty("src2x",e.value)}leaf_src3x(e,t,r){this.writeProperty("src3x",e.value)}leaf_src4x(e,t,r){this.writeProperty("src4x",e.value)}leaf_width(e,t,r){this.writeProperty("width",e.value)}leaf_height(e,t,r){this.writeProperty("height",e.value)}leaf_alt(e,t,r){this.writeProperty("alt",e.value)}leaf_license(e,t,r){this.writeProperty("license",e.value)}leaf_copyright(e,t,r){this.writeProperty("copyright",e.value)}leaf_provider(e,t,r){}leaf_showInIndex(e,t,r){this.writeProperty("showInIndex",e.value)}leaf_caption(e,t,r){const o=e.value;this.writeProperty("caption",o)}leaf_duration(e,t,r){(null==t?void 0:t.key)!==s.NodeType.bitsValue&&this.writeProperty("duration",e.value)}leaf_mute(e,t,r){this.writeProperty("mute",e.value)}leaf_autoplay(e,t,r){this.writeProperty("autoplay",e.value)}leaf_allowSubtitles(e,t,r){this.writeProperty("allowSubtitles",e.value)}leaf_showSubtitles(e,t,r){this.writeProperty("showSubtitles",e.value)}generatePropertyHandlers(){var e;const t=n.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===g.PropertyTag.example)continue;if(t===g.PropertyTag.labelTrue)continue;if(t===g.PropertyTag.labelFalse)continue;if(t===g.PropertyTag.posterImage)continue;if(t===g.PropertyTag.imageSource)continue;if(t===g.PropertyTag.partner)continue;if(t===p.PropertyAstKey.markConfig)continue;const o=`enter_${t}`;this[o]=(e,t,o)=>{null!=e.value&&(null==t?void 0:t.key)===s.NodeType.bitsValue&&this.writeProperty(r.tag,e.value,r.single,"false"===r.defaultValue,"true"===r.defaultValue)},this[o]=this[o].bind(this)}}writeString(e){null!=e&&this.write(`${e}`)}writeOPBUL(){this.write("[•")}writeOPESC(){this.write("[^")}writeOPRANGLE(){this.write("[►")}writeOPDANGLE(){this.write("[▼")}writeOPD(){this.write("[.")}writeOPU(){this.write("[_")}writeOPE(){this.write("[=")}writeOPB(){this.write("[!")}writeOPQ(){this.write("[?")}writeOPA(){this.write("[@")}writeOPP(){this.write("[+")}writeOPM(){this.write("[-")}writeOPS(){this.write("[\\")}writeOPR(){this.write("[*")}writeOPC(){this.write("[%")}writeOPAMP(){this.write("[&")}writeOPDOLLAR(){this.write("[$")}writeOPHASH(){this.write("[#")}writeOPPRE(){this.write("['")}writeOPPOST(){this.write("[")}writeOP(){this.write("[")}writeCL(){this.write("]")}writeAmpersand(){this.write("&")}writeColon(){this.write(":")}writeHash(){this.write("#")}writeCardSetStart(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("~~~~")}writeCardSetCardDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("--"):this.write("++")}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeResource(e){var t;const r=e;e&&(this.writeOPAMP(),this.writeString(null!==(t=e.typeAlias)&&void 0!==t?t:e.type),e.type===d.ResourceTag.article&&r.value?(this.writeColon(),this.writeString(r.value),this.writeNL()):e.value&&(this.writeColon(),this.writeString(e.value)),this.writeCL())}writeProperty(e,t,r,o,i){let n,s=!1;if(void 0!==t&&(n=Array.isArray(t)?t:[t],n.length>0)){r&&(n=n.slice(n.length-1));for(const t of n)if(void 0!==t){if(o&&!1===t)continue;if(i&&!0===t)continue;this.writeOPA(),this.writeString(e),this.writeColon(),this.writeString(`${t}`),this.writeCL(),s=!0}}s||(this.skipNLBetweenBitsValue=!0)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}isWriteTextFormat(e){return!!(!(y.TextFormat.fromValue(e)===y.TextFormat.bitmarkMinusMinus)||this.options.explicitTextFormat)}isRootBitType1(e){return this.isRootBitType(e,a.RootBitType.trueFalse1)||this.isRootBitType(e,a.RootBitType.multipleChoice1)||this.isRootBitType(e,a.RootBitType.multipleResponse1)}isRootBitType(e,t){const r=this.getBitType(e);return(null==r?void 0:r.root)===t}getBitType(e){for(const t of e)if(t.key===s.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getParentNode(e,t=1){if(e.length>t+1)return e[e.length-t-1]}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},8582:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkStringGenerator=void 0;const i=r(227),n=r(297);t.BitmarkStringGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.BitmarkGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},3857:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonGenerator=void 0;const n=r(8256),s=r(2606),a=r(549),l=r(208),u=r(8791),c=r(1060),p=r(7028),g=r(7204),d=r(7953),y=r(9779),f=r(1353),h=r(406),m=r(7646),T=r(672),b=r(3633),v=r(169),C={};t.JsonGenerator=class{constructor(e,t){var r;this.ast=new n.Ast,this.textParser=new h.TextParser,this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault="",this.bodyDefault="",this.printed=!1,this.bitmarkVersion=null!==(r=u.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:u.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},C),null==t?void 0:t.jsonOptions),this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===u.BitmarkVersion.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return o(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=this.options.textAsPlainText?"":[],this.bodyDefault=this.options.textAsPlainText?"":[],this.printed=!1}walkAndWrite(e){this.ast.walk(e,a.NodeType.bitmarkAst,this,void 0)}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const s=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof s[a]&&(n=s[a](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_bitmarkAst(e,t,r){this.json=[]}enter_bitsValue(e,t,r){var o,i,n;const a=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(a),this.bitWrapperJson.bit=this.bitJson;const u=s.Config.getBitConfig(a.bitType),c=!!u.rootExampleType,g=u.rootExampleType===p.ExampleType.boolean;if(c){let e;g?(e=!0,a.bitType.root===l.RootBitType.trueFalse1&&void 0!==(null===(i=null===(o=a.cardNode)||void 0===o?void 0:o.statement)||void 0===i?void 0:i.isCorrect)&&(e=a.cardNode.statement.isCorrect)):e=null!==(n=a.sampleSolution)&&void 0!==n?n:"";const t=this.toExample(a,{defaultExample:e,isBoolean:g});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else a.isExample&&(this.bitJson.isExample=!0)}exit_bitsValue(e,t,r){this.cleanAndSetDefaultsForBitJson(this.bitJson)}enter_imageSource(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const{url:i,mockupId:n,size:s,format:l,trim:u}=o,c={};this.addProperty(c,"url",null!=i?i:"",!0),this.addProperty(c,"mockupId",null!=n?n:"",!0),this.addProperty(c,"size",null!=s?s:null,!0),this.addProperty(c,"format",null!=l?l:null,!0),this.addProperty(c,"trim",T.BooleanUtils.isBoolean(u)?u:null,!0),this.bitJson.imageSource=c}enter_partner(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const{name:i,avatarImage:n}=o,s={};if(this.addProperty(s,"name",null!=i?i:"",!0),n){const e=this.parseResourceToJson(n);e&&e.type===y.ResourceTag.image&&(s.avatarImage=e.image)}this.bitJson.partner=s}enter_markConfigValue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.markConfig)return;const{mark:i,color:n,emphasis:s}=o,l={};this.addProperty(l,"mark",null!=i?i:"unknown",!0),n&&this.addProperty(l,"color",null!=n?n:"",!0),s&&this.addProperty(l,"emphasis",null!=s?s:"",!0),this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(l)}leaf_sampleSolution(e,t,r){(null==t?void 0:t.key)===a.NodeType.bitsValue&&null!=e.value&&this.addProperty(this.bitJson,"sampleSolution",e.value,!0)}enter_itemLead(e,t,r){const o=e.value,{item:i,lead:n}=o;(null==t?void 0:t.key)===a.NodeType.bitsValue&&(null!=i&&(this.bitJson.item=this.toTextAstOrString(i)),null!=n&&(this.bitJson.lead=this.toTextAstOrString(n)))}enter_extraProperties(e,t,r){const o=e.value;if(!this.options.excludeUnknownProperties&&o)for(const[e,t]of Object.entries(o)){let r=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(r=`_${e}`),this.addProperty(this.bitJson,r,t)}}enter_bodyParts(e,t,r){const o=e.value,i=this.options.textAsPlainText,n=this.getTextFormat(r);let s="",a=0;null==this.bitJson.body&&(this.bitJson.body=this.bodyDefault);const l=e=>({legacyPlaceholderKey:`{${e}}`,placeholderKey:`[!${e}]`});for(let e=0;e<o.length;e++){const t=o[e];if(t.type===c.BodyBitType.text){s+=t.data.bodyText}else{const{legacyPlaceholderKey:e,placeholderKey:t}=l(a);s+=i?e:t,a++}}this.bitJson.body=this.toTextAstOrString(s,n);const u=this.bitJson.body;a=0;for(let e=0;e<o.length;e++){const t=o[e];if(t.type===c.BodyBitType.text)continue;const r=t;let n;const{legacyPlaceholderKey:s}=l(a);switch(t.type){case c.BodyBitType.gap:{const e=r;n=this.createGapJson(e);break}case c.BodyBitType.mark:{const e=r;n=this.createMarkJson(e);break}case c.BodyBitType.select:{const e=r;n=this.createSelectJson(e);break}case c.BodyBitType.highlight:{const e=r;n=this.createHighlightJson(e);break}}n&&(i?(this.bitJson.placeholders||(this.bitJson.placeholders={}),this.bitJson.placeholders[s]=n):this.replacePlaceholderWithBodyBit(u,n,a)),a++}return!1}enter_elements(e,t,r){const o=e.value;o&&o.length>0&&(this.bitJson.elements=o)}enter_flashcards(e,t,r){var o,i,n,s;const l=e.value;if((null==t?void 0:t.key)!==a.NodeType.cardNode)return;const u=[];if(l)for(const e of l){const t=Object.assign(Object.assign({question:null!==(o=e.question)&&void 0!==o?o:"",answer:null!==(i=e.answer)&&void 0!==i?i:"",alternativeAnswers:null!==(n=e.alternativeAnswers)&&void 0!==n?n:[]},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:e.isDefaultExample,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.cards=u)}enter_statement(e,t,r){var o,i;const n=e.value;(null==t?void 0:t.key)===a.NodeType.cardNode&&n&&(this.bitJson.statement=null!==(o=n.text)&&void 0!==o?o:"",this.bitJson.isCorrect=null!==(i=n.isCorrect)&&void 0!==i&&i)}enter_statements(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==a.NodeType.cardNode)return;const l=[];if(s)for(const e of s){const t=Object.assign(Object.assign({statement:null!==(o=e.text)&&void 0!==o?o:"",isCorrect:!!e.isCorrect},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(i=e.itemLead)||void 0===i?void 0:i.item)&&delete t.item,null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,null==(null==e?void 0:e.hint)&&delete t.hint,null==(null==e?void 0:e.instruction)&&delete t.instruction,l.push(t)}l.length>0&&(this.bitJson.statements=l)}enter_choices(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==a.NodeType.cardNode)return;const l=[];if(s)for(const e of s){const t=Object.assign(Object.assign({choice:null!==(o=e.text)&&void 0!==o?o:"",isCorrect:null!==(i=e.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.choices=l)}enter_responses(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==a.NodeType.cardNode)return;const l=[];if(s)for(const e of s){const t=Object.assign(Object.assign({response:null!==(o=e.text)&&void 0!==o?o:"",isCorrect:null!==(i=e.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.responses=l)}enter_quizzes(e,t,r){var o,i,n,s,a,l,u,c;const p=e.value,g=[];if(p)for(const e of p){const t=[];if(e.choices)for(const r of e.choices){const s=Object.assign(Object.assign({choice:null!==(o=r.text)&&void 0!==o?o:"",isCorrect:null!==(i=r.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:!!r.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete s.lead,t.push(s)}const r=[];if(e.responses)for(const t of e.responses){const o=Object.assign(Object.assign({response:null!==(s=t.text)&&void 0!==s?s:"",isCorrect:null!==(a=t.isCorrect)&&void 0!==a&&a},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!!t.isCorrect,isBoolean:!0}));null==(null===(l=e.itemLead)||void 0===l?void 0:l.lead)&&delete o.lead,r.push(o)}const p=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e)),{isExample:null!==(u=e.isExample)&&void 0!==u&&u,choices:e.choices?t:void 0,responses:e.responses?r:void 0});null==(null===(c=e.itemLead)||void 0===c?void 0:c.lead)&&delete p.lead,g.push(p)}g.length>0&&(this.bitJson.quizzes=g)}enter_heading(e,t,r){var o,i;const n=e.value;let s=!1;if(n&&n.forKeys&&(s=!0),!s)return!1;const a={forKeys:null!==(o=n.forKeys)&&void 0!==o?o:""};Array.isArray(n.forValues)?n.forValues.length>1?a.forValues=n.forValues:1===n.forValues.length?a.forValues=n.forValues[0]:a.forValues=n.forValues:a.forValues=null!==(i=n.forValues)&&void 0!==i?i:"",this.bitJson.heading=a}enter_pairs(e,t,r){var o,i,n,s,a;const l=e.value,u=[];if(l)for(const e of l){const t=Array.isArray(e.values)&&e.values.length>0&&e.values[0],r=Object.assign(Object.assign(Object.assign({key:null!==(o=e.key)&&void 0!==o?o:"",keyAudio:e.keyAudio?this.addAudioResource(e.keyAudio):void 0,keyImage:e.keyImage?this.addImageResource(e.keyImage):void 0,values:null!==(i=e.values)&&void 0!==i?i:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(n=e.isCaseSensitive)||void 0===n||n,isLongAnswer:null!==(s=!e.isShortAnswer)&&void 0!==s&&s}),this.toExample(e,{defaultExample:t,isBoolean:!1}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete r.lead,r.key&&(delete r.keyAudio,delete r.keyImage),null!=r.keyAudio&&(delete r.key,delete r.keyImage),null!=r.keyImage&&(delete r.key,delete r.keyAudio),u.push(r)}u.length>0&&(this.bitJson.pairs=u)}enter_matrix(e,t,r){var o,i,n,s,a,l,u;const c=e.value,p=[];if(c)for(const e of c){const t=[];if(e.cells)for(const r of e.cells){const e=Array.isArray(r.values)&&r.values.length>0&&r.values[0],n=Object.assign(Object.assign({values:null!==(o=r.values)&&void 0!==o?o:[]},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:e,isBoolean:!1}));null==(null===(i=r.itemLead)||void 0===i?void 0:i.lead)&&delete n.lead,null==r.hint&&delete n.hint,t.push(n)}const r=Object.assign(Object.assign({key:null!==(n=e.key)&&void 0!==n?n:"",cells:null!=t?t:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(s=e.isCaseSensitive)||void 0===s||s,isLongAnswer:null!==(a=!e.isShortAnswer)&&void 0!==a&&a,isExample:null!==(l=e.isExample)&&void 0!==l&&l});null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete r.lead,null==e.instruction&&delete r.instruction,p.push(r)}p.length>0&&(this.bitJson.matrix=p)}enter_questions(e,t,r){var o,i,n,s,a;const l=e.value,u=[];if(l)for(const e of l){const t=Object.assign(Object.assign(Object.assign({question:null!==(o=e.question)&&void 0!==o?o:"",partialAnswer:null!==(i=m.ArrayUtils.asSingle(e.partialAnswer))&&void 0!==i?i:"",sampleSolution:null!==(n=e.sampleSolution)&&void 0!==n?n:""},this.toItemLeadHintInstruction(e)),{isShortAnswer:null===(s=e.isShortAnswer)||void 0===s||s,reasonableNumOfChars:e.reasonableNumOfChars}),this.toExample(e,{defaultExample:e.sampleSolution||"",isBoolean:!1}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.questions=u)}enter_botResponses(e,t,r){var o,i,n,s;const l=e.value;if((null==t?void 0:t.key)!==a.NodeType.cardNode)return;const u=[];if(l)for(const e of l){const t=Object.assign({response:null!==(o=e.response)&&void 0!==o?o:"",reaction:null!==(i=e.reaction)&&void 0!==i?i:"",feedback:null!==(n=e.feedback)&&void 0!==n?n:""},this.toItemLeadHintInstruction(e));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,null==e.hint&&delete t.hint,delete t.instruction,u.push(t)}u.length>0&&(this.bitJson.responses=u)}enter_resources(e,t,r){var o;const i=e.value,n=this.getBitType(r),a=this.getResourceType(r);if(!i||!n)return;let l;const u=s.Config.getBitConfig(n),c=s.Config.getBitResourcesConfig(n,a),p=c.comboResourceTagTypesMap;if(c.comboResourceTagTypesMap.size>0)for(const[e,t]of p.entries()){const r={type:e};for(const e of t){const t=i.find((t=>t.typeAlias===e));if(t){const e=s.Config.getTagConfigForTag(u.tags,t.typeAlias),i=null!==(o=null==e?void 0:e.jsonKey)&&void 0!==o?o:t.typeAlias,n=this.parseResourceToJson(t);if(n)for(const[e,t]of Object.entries(n))"type"!==e&&(r[i]=t)}}l=r}else i.length>=1&&(l=this.parseResourceToJson(i[0]));this.bitJson.resource=l}leaf_title(e,t,r){this.bitJson.title=this.toTextAstOrString(e.value)}leaf_subtitle(e,t,r){this.bitJson.subtitle=this.toTextAstOrString(e.value)}leaf_level(e,t,r){var o;null!=e.value&&this.addProperty(this.bitJson,"level",null!==(o=e.value)&&void 0!==o?o:1,!0)}leaf_book(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"book",e.value,!0)}leaf_anchor(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"anchor",e.value,!0)}leaf_reference(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"reference",e.value,!0)}leaf_referenceEnd(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"referenceEnd",e.value,!0)}leaf_hint(e,t,r){const o=e.value;(null==t?void 0:t.key)===a.NodeType.bitsValue&&(this.bitJson.hint=this.toTextAstOrString(o))}leaf_instruction(e,t,r){const o=e.value;(null==t?void 0:t.key)===a.NodeType.bitsValue&&(this.bitJson.instruction=this.toTextAstOrString(o))}leaf_footerText(e,t,r){const o=e.value;this.bitJson.footer=this.toTextAstOrString(o)}leaf_markup(e,t,r){const o=e.value;o&&(this.bitWrapperJson.bitmark=o)}enter_parser(e,t,r){const o=e.value;if(o){const{version:e,excessResources:r,warnings:n,errors:s}=o,l=i(o,["version","excessResources","warnings","errors"]),u=`${this.bitmarkVersion}`;let c;if(Array.isArray(r)&&r.length>0){c=[];for(const e of r){const t=this.parseResourceToJson(e);t&&c.push(t)}}(null==t?void 0:t.key)===a.NodeType.bitsValue&&(this.bitWrapperJson.parser=Object.assign(Object.assign({version:e,bitmarkVersion:u},l),{warnings:n,errors:s,excessResources:c}),this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){var e;const t=s.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===d.PropertyTag.example)continue;if(t===d.PropertyTag.imageSource)continue;if(t===d.PropertyTag.partner)continue;if(t===g.PropertyAstKey.markConfig)continue;const o=`enter_${t}`;this[o]=(e,t,o)=>{var i;const n=e.value;if(null==n)return;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const s=null!==(i=r.jsonKey)&&void 0!==i?i:r.tag;this.addProperty(this.bitJson,s,n,r.single)},this[o]=this[o].bind(this)}}createGapJson(e){var t;const r=e.data,o=r.solutions&&r.solutions.length>0?r.solutions[0]:"",i=Object.assign(Object.assign(Object.assign(Object.assign({type:"gap"},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(t=r.isCaseSensitive)||void 0===t||t}),this.toExample(r,{defaultExample:o,isBoolean:!1})),{solutions:r.solutions});return i.lead||delete i.lead,i}createMarkJson(e){const t=e.data,r=Object.assign(Object.assign({type:"mark",solution:t.solution,mark:t.mark},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!0,isBoolean:!0}));return r.lead||delete r.lead,r}createSelectJson(e){var t,r,o,i;const n=e.data,s=[];for(const e of n.options){const r=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));r.item||delete r.item,r.lead||delete r.lead,r.instruction||delete r.instruction,r.isCaseSensitive||delete r.isCaseSensitive,s.push(r)}const a=Object.assign(Object.assign({type:"select",prefix:null!==(r=n.prefix)&&void 0!==r?r:"",postfix:null!==(o=n.postfix)&&void 0!==o?o:""},this.toItemLeadHintInstruction(n)),{isExample:null!==(i=n.isExample)&&void 0!==i&&i,options:s});return a.lead||delete a.lead,a}createHighlightJson(e){var t,r,o,i,n;const s=e.data,a=[];for(const e of s.texts){const o=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t,isHighlighted:null!==(r=e.isHighlighted)&&void 0!==r&&r},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));o.item||delete o.item,o.lead||delete o.lead,o.hint||delete o.hint,o.isCaseSensitive||delete o.isCaseSensitive,a.push(o)}const l=Object.assign(Object.assign({type:"highlight",prefix:null!==(o=s.prefix)&&void 0!==o?o:"",postfix:null!==(i=s.postfix)&&void 0!==i?i:""},this.toItemLeadHintInstruction(s)),{isExample:null!==(n=s.isExample)&&void 0!==n&&n,texts:a});return l.lead||delete l.lead,l}parseResourceToJson(e){if(!e)return;let t;switch(e.type){case y.ResourceTag.image:t={type:y.ResourceTag.image,image:this.addImageResource(e)};break;case y.ResourceTag.imageLink:t={type:y.ResourceTag.imageLink,imageLink:this.addImageLinkResource(e)};break;case y.ResourceTag.audio:t={type:y.ResourceTag.audio,audio:this.addAudioResource(e)};break;case y.ResourceTag.audioEmbed:t={type:y.ResourceTag.audioEmbed,audioEmbed:this.addAudioEmbedResource(e)};break;case y.ResourceTag.audioLink:t={type:y.ResourceTag.audioLink,audioLink:this.addAudioLinkResource(e)};break;case y.ResourceTag.video:t={type:y.ResourceTag.video,video:this.addVideoResource(e)};break;case y.ResourceTag.videoEmbed:t={type:y.ResourceTag.videoEmbed,videoEmbed:this.addVideoEmbedResource(e)},t.videoEmbed=this.addVideoLinkResource(e);break;case y.ResourceTag.videoLink:t={type:y.ResourceTag.videoLink,videoLink:this.addVideoLinkResource(e)};break;case y.ResourceTag.stillImageFilmEmbed:t={type:y.ResourceTag.stillImageFilmEmbed,stillImageFilmEmbed:this.addStillImageFilmEmbedResource(e)};break;case y.ResourceTag.stillImageFilmLink:t={type:y.ResourceTag.stillImageFilmLink,stillImageFilmLink:this.addStillImageFilmLinkResource(e)};break;case y.ResourceTag.article:t={type:y.ResourceTag.article,article:this.addArticleResource(e)};break;case y.ResourceTag.document:t={type:y.ResourceTag.document,document:this.addDocumentResource(e)};break;case y.ResourceTag.documentEmbed:t={type:y.ResourceTag.documentEmbed,documentEmbed:this.addDocumentEmbedResource(e)};break;case y.ResourceTag.documentLink:t={type:y.ResourceTag.documentLink,documentLink:this.addDocumentLinkResource(e)};break;case y.ResourceTag.documentDownload:t={type:y.ResourceTag.documentDownload,documentDownload:this.addDocumentDownloadResource(e)};break;case y.ResourceTag.appLink:t={type:y.ResourceTag.appLink,appLink:this.addAppLinkResource(e)};break;case y.ResourceTag.websiteLink:t={type:y.ResourceTag.websiteLink,websiteLink:this.addWebsiteLinkResource(e)}}return t}addImageResource(e){var t,r,o;const i={};if(b.StringUtils.isString(e)){const t=e;e={type:y.ResourceTag.image,typeAlias:y.ResourceTag.image,value:t,format:v.UrlUtils.fileExtensionFromUrl(t),provider:v.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.src=e.value),null!=e.src1x&&(i.src1x=e.src1x),null!=e.src2x&&(i.src2x=e.src2x),null!=e.src3x&&(i.src3x=e.src3x),null!=e.src4x&&(i.src4x=e.src4x),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,i.alt=null!==(o=e.alt)&&void 0!==o?o:"",this.addGenericResourceProperties(e,i),i}addImageLinkResource(e){var t,r,o;const i={};if(b.StringUtils.isString(e)){const t=e;e={type:y.ResourceTag.imageLink,typeAlias:y.ResourceTag.imageLink,value:t,format:v.UrlUtils.fileExtensionFromUrl(t),provider:v.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),null!=e.src1x&&(i.src1x=e.src1x),null!=e.src2x&&(i.src2x=e.src2x),null!=e.src3x&&(i.src3x=e.src3x),null!=e.src4x&&(i.src4x=e.src4x),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,i.alt=null!==(o=e.alt)&&void 0!==o?o:"",this.addGenericResourceProperties(e,i),i}addAudioResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t,!0),t}addVideoResource(e){var t,r;const o={};if(null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.src=e.value),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=e.alt),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addVideoEmbedResource(e){var t,r;const o={};if(null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.src=e.value),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=e.alt),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addVideoLinkResource(e){var t,r;const o={};if(null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.url=e.value),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=e.alt),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addStillImageFilmEmbedResource(e){var t,r;const o={};if(null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.url=e.value),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=e.alt),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addStillImageFilmLinkResource(e){var t,r;const o={};if(null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.url=e.value),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(o.duration=e.duration),null!=e.mute&&(o.mute=e.mute),null!=e.autoplay&&(o.autoplay=e.autoplay),null!=e.allowSubtitles&&(o.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(o.showSubtitles=e.showSubtitles),null!=e.alt&&(o.alt=e.alt),null!=e.posterImage&&(o.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){o.thumbnails=[];for(const t of e.thumbnails)o.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,o),o}addArticleResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.body=e.value),this.addGenericResourceProperties(e,t),t}addDocumentResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentDownloadResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addAppLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addWebsiteLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),null!=e.siteName&&(t.siteName=e.siteName),this.addGenericResourceProperties(e,t),t}addGenericResourceProperties(e,t,r){var o,i,n,s,a,l,u,c;return r?(null!=e.license&&(t.license=null!==(o=e.license)&&void 0!==o?o:""),null!=e.copyright&&(t.copyright=null!==(i=e.copyright)&&void 0!==i?i:""),null!=e.provider&&(t.provider=e.provider),null!=e.showInIndex&&(t.showInIndex=null!==(n=e.showInIndex)&&void 0!==n&&n),null!=e.caption&&(t.caption=this.toTextAstOrString(null!==(s=e.caption)&&void 0!==s?s:""))):(t.license=null!==(a=e.license)&&void 0!==a?a:"",t.copyright=null!==(l=e.copyright)&&void 0!==l?l:"",null!=e.provider&&(t.provider=e.provider),t.showInIndex=null!==(u=e.showInIndex)&&void 0!==u&&u,t.caption=this.toTextAstOrString(null!==(c=e.caption)&&void 0!==c?c:"")),t}toItemLeadHintInstruction(e){var t,r,o,i,n,s;return{item:this.toTextAstOrString(null!==(r=null===(t=e.itemLead)||void 0===t?void 0:t.item)&&void 0!==r?r:""),lead:this.toTextAstOrString(null!==(i=null===(o=e.itemLead)||void 0===o?void 0:o.lead)&&void 0!==i?i:""),hint:this.toTextAstOrString(null!==(n=e.hint)&&void 0!==n?n:""),instruction:this.toTextAstOrString(null!==(s=e.instruction)&&void 0!==s?s:"")}}toExample(e,t){const{isExample:r,example:o,isDefaultExample:i}=e,{defaultExample:n,isBoolean:s}=t;if(!r)return{isExample:!1,example:null};let a;return a=i?s?T.BooleanUtils.toBoolean(n):this.toTextAstOrString(n):s?T.BooleanUtils.toBoolean(o):this.toTextAstOrString(o),{isExample:!0,example:a}}addProperty(e,t,r,o){void 0!==r&&(Array.isArray(r)||(r=[r]),Array.isArray(r)&&r.length>0&&(o&&r.length>=1?e[t]=r[r.length-1]:e[t]=r))}getBitType(e){for(const t of e)if(t.key===a.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getTextFormat(e){for(const t of e)if(t.key===a.NodeType.bitsValue){const e=t.value;return f.TextFormat.fromValue(null==e?void 0:e.textFormat)}}getResourceType(e){for(const t of e)if(t.key===a.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.resourceType}}toTextAstOrString(e,t=f.TextFormat.bitmarkMinusMinus){if(this.options.textAsPlainText)return e;return this.textParser.toAst(e,{textFormat:t})}replacePlaceholderWithBodyBit(e,t,r){const o=(e,i,n)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const r=e[t];if(o(r,e,t))return!0}else{if("bit"===e.type&&e.index===r)return i[n]=t,!0;if(e.content){if(o(e.content,e,"content"))return!0}}return!1};o(e,null,null)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){return{type:e.bitType.alias,format:e.textFormat,id:void 0,externalId:void 0,spaceId:void 0,padletId:void 0,jupyterId:void 0,jupyterExecutionCount:void 0,AIGenerated:void 0,releaseVersion:void 0,book:void 0,ageRange:void 0,lang:void 0,language:void 0,computerLanguage:void 0,target:void 0,tag:void 0,icon:void 0,iconTag:void 0,colorTag:void 0,flashcardSet:void 0,subtype:void 0,bookAlias:void 0,coverImage:void 0,publisher:void 0,publications:void 0,author:void 0,subject:void 0,date:void 0,location:void 0,theme:void 0,kind:void 0,action:void 0,thumbImage:void 0,focusX:void 0,focusY:void 0,deeplink:void 0,externalLink:void 0,externalLinkText:void 0,videoCallLink:void 0,duration:void 0,list:void 0,textReference:void 0,isTracked:void 0,isInfoOnly:void 0,labelTrue:void 0,labelFalse:void 0,content2Buy:void 0,quotedPerson:void 0,reasonableNumOfChars:void 0,title:void 0,subtitle:void 0,level:void 0,toc:void 0,progress:void 0,anchor:void 0,reference:void 0,referenceEnd:void 0,item:void 0,lead:void 0,hint:void 0,instruction:void 0,isExample:void 0,example:void 0,partner:void 0,marks:void 0,extraProperties:void 0,body:void 0,resource:void 0,statement:void 0,isCorrect:void 0,sampleSolution:void 0,partialAnswer:void 0,elements:void 0,statements:void 0,responses:void 0,quizzes:void 0,heading:void 0,pairs:void 0,matrix:void 0,choices:void 0,questions:void 0,placeholders:void 0,footer:void 0}}cleanAndSetDefaultsForBitJson(e){const t=s.Config.getBitType(e.type),r=this.options.textAsPlainText;switch(e.item||(e.item=void 0),t.root){case l.RootBitType._error:break;case l.RootBitType.article:case l.RootBitType.sampleSolution:case l.RootBitType.page:null==e.body&&(e.body=this.bodyDefault);break;default:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),t.alias!==l.AliasBitType.articleAi&&t.alias!==l.AliasBitType.noteAi&&t.alias!==l.AliasBitType.summaryAi||null==e.AIGenerated&&(e.AIGenerated=!0);break;case l.RootBitType.cloze:case l.RootBitType.multipleChoice1:case l.RootBitType.multipleResponse1:case l.RootBitType.multipleChoiceText:case l.RootBitType.highlightText:case l.RootBitType.clozeAndMultipleChoiceText:case l.RootBitType.sequence:case l.RootBitType.mark:case l.RootBitType.flashcard:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.multipleChoice:case l.RootBitType.multipleResponse:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault);break;case l.RootBitType.essay:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="");break;case l.RootBitType.trueFalse1:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.trueFalse:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.chapter:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.toc&&(e.toc=!0),null==e.progress&&(e.progress=!0),null==e.level&&(e.level=1),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.interview:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[]);break;case l.RootBitType.match:null==e.item&&(e.item=this.textDefault),null==e.heading&&(e.heading={}),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.matchMatrix:null==e.item&&(e.item=this.textDefault),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.learningPathBook:case l.RootBitType.learningPathExternalLink:case l.RootBitType.learningPathVideoCall:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1),null==e.body&&(e.body=this.bodyDefault);break;case l.RootBitType.pageBuyButton:null==e.content2Buy&&(e.content2Buy=""),null==e.body&&(e.body=this.bodyDefault)}return null==e.id&&delete e.id,null==e.externalId&&delete e.externalId,null==e.spaceId&&delete e.spaceId,null==e.padletId&&delete e.padletId,null==e.jupyterId&&delete e.jupyterId,null==e.jupyterExecutionCount&&delete e.jupyterExecutionCount,null==e.AIGenerated&&delete e.AIGenerated,null==e.releaseVersion&&delete e.releaseVersion,null==e.book&&delete e.book,null==e.ageRange&&delete e.ageRange,null==e.lang&&delete e.lang,null==e.language&&delete e.language,null==e.computerLanguage&&delete e.computerLanguage,null==e.target&&delete e.target,null==e.tag&&delete e.tag,null==e.icon&&delete e.icon,null==e.iconTag&&delete e.iconTag,null==e.colorTag&&delete e.colorTag,null==e.flashcardSet&&delete e.flashcardSet,null==e.subtype&&delete e.subtype,null==e.bookAlias&&delete e.bookAlias,null==e.coverImage&&delete e.coverImage,null==e.publisher&&delete e.publisher,null==e.publications&&delete e.publications,null==e.author&&delete e.author,null==e.subject&&delete e.subject,null==e.date&&delete e.date,null==e.location&&delete e.location,null==e.theme&&delete e.theme,null==e.kind&&delete e.kind,null==e.action&&delete e.action,null==e.thumbImage&&delete e.thumbImage,null==e.deeplink&&delete e.deeplink,null==e.externalLink&&delete e.externalLink,null==e.externalLinkText&&delete e.externalLinkText,null==e.videoCallLink&&delete e.videoCallLink,null==e.duration&&delete e.duration,null==e.list&&delete e.list,null==e.textReference&&delete e.textReference,null==e.isTracked&&delete e.isTracked,null==e.isInfoOnly&&delete e.isInfoOnly,null==e.labelTrue&&delete e.labelTrue,null==e.labelFalse&&delete e.labelFalse,null==e.content2Buy&&delete e.content2Buy,null==e.quotedPerson&&delete e.quotedPerson,null==e.title&&delete e.title,null==e.subtitle&&delete e.subtitle,null==e.level&&delete e.level,null==e.toc&&delete e.toc,null==e.progress&&delete e.progress,null==e.anchor&&delete e.anchor,null==e.reference&&delete e.reference,null==e.referenceEnd&&delete e.referenceEnd,null==e.item&&delete e.item,null==e.lead&&delete e.lead,null==e.hint&&delete e.hint,null==e.instruction&&delete e.instruction,void 0===e.example&&delete e.example,null==e.isExample&&delete e.isExample,null==e.marks&&delete e.marks,null==e.extraProperties&&delete e.extraProperties,null==e.body&&delete e.body,null!=e.placeholders&&0!==Object.keys(e.placeholders).length||delete e.placeholders,null==e.resource&&delete e.resource,null==e.statement&&delete e.statement,null==e.isCorrect&&delete e.isCorrect,null==e.sampleSolution&&delete e.sampleSolution,null==e.partialAnswer&&delete e.partialAnswer,null==e.elements&&delete e.elements,null==e.statements&&delete e.statements,null==e.responses&&delete e.responses,null==e.quizzes&&delete e.quizzes,null==e.heading&&delete e.heading,null==e.pairs&&delete e.pairs,null==e.matrix&&delete e.matrix,null==e.choices&&delete e.choices,null==e.questions&&delete e.questions,r&&null!=e.placeholders||delete e.placeholders,null==e.footer&&delete e.footer,e}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},4275:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonObjectGenerator=void 0;const i=r(227),n=r(3857);t.JsonObjectGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.JsonGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),JSON.parse(this.writer.getString())}))}generateSync(e){return this.generator.generateSync(e),JSON.parse(this.writer.getString())}}},5132:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonStringGenerator=void 0;const i=r(227),n=r(3857);t.JsonStringGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.JsonGenerator(this.writer,e)}generate(e){return o(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},6300:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function s(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKSCAPE_REGEX_REPLACER=t.BREAKSCAPE_REGEX=t.TextGenerator=void 0;const i=r(8256),n=r(549),s=r(8791),a=r(1353),l=r(1888),u=r(2610),c={debugGenerationInline:!1},p={[l.TextMarkType.bold]:"**",[l.TextMarkType.light]:"``",[l.TextMarkType.italic]:"__",[l.TextMarkType.highlight]:"!!"},g=new RegExp("([=*_`!])([\\^]*)\\1|([\\|\\[])","g");t.BREAKSCAPE_REGEX=g;const d="$1$3^$2$1";t.BREAKSCAPE_REGEX_REPLACER=d;const y=new RegExp("^(\\||•|#)","gm"),f=new RegExp(/(\n|\r\n)/,"g"),h=new RegExp(/https?:\/\/|mailto:(.*)/,"g");t.TextGenerator=class{constructor(e,t){var r;this.ast=new i.Ast,this.textFormat=a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={},this.printed=!1,this.bitmarkVersion=null!==(r=s.BitmarkVersion.fromValue(e))&&void 0!==r?r:s.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},c),t),this.bitmarkVersion,s.BitmarkVersion.v2,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this)}generate(e,t){return o(this,void 0,void 0,(function*(){return this.resetState(t),this.walkAndWrite(e),this.writerText}))}generateSync(e,t){return this.resetState(t),this.walkAndWrite(e),this.writerText}getPlaceholders(){return this.placeholders}resetState(e){this.printed=!1,this.textFormat=null!=e?e:a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={}}walkAndWrite(e){this.ast.walk(e,n.NodeType.textAst,this,void 0)}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const s=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof s[a]&&(n=s[a](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_textAstValue(e,t,r){this.handleEnterNode(e.value)}between_textAstValue(e,t,r,o,i){this.handleBetweenNode(e.value)}exit_textAstValue(e,t,r){this.handleExitNode(e.value)}enter_contentValueValue(e,t,r){this.handleEnterNode(e.value)}between_contentValueValue(e,t,r,o,i){this.handleBetweenNode(e.value)}exit_contentValueValue(e,t,r){this.handleExitNode(e.value)}handleEnterNode(e){switch(this.handleIndent(e),e.type){case u.TextNodeType.paragraph:this.writeParagraph(e);break;case u.TextNodeType.hardBreak:this.writeHardBreak(e);break;case u.TextNodeType.text:this.writeMarks(e,!0),this.writeText(e);break;case u.TextNodeType.heading:this.writeHeading(e);break;case u.TextNodeType.section:this.writeSection(e);break;case u.TextNodeType.listItem:case u.TextNodeType.taskItem:this.writeBullet(e);break;case u.TextNodeType.image:this.writeImage(e);break;case u.TextNodeType.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case u.TextNodeType.gap:case u.TextNodeType.select:case u.TextNodeType.highlight:this.writeBodyBit(e)}this.exitedCodeBlock=!1}handleBetweenNode(e){e.type}handleExitNode(e){switch(e.type){case u.TextNodeType.text:this.writeMarks(e,!1);break;case u.TextNodeType.paragraph:this.textFormat!==a.TextFormat.bitmarkMinusMinus&&this.writeNL();break;case u.TextNodeType.heading:case u.TextNodeType.section:case u.TextNodeType.image:this.writeNL(),this.writeNL();break;case u.TextNodeType.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent<=1&&this.writeNL()}this.handleDedent(e)}handleIndent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent--}}getLinkHref(e){if(e.type===u.TextNodeType.text&&e.marks){const t=e.marks.reduce(((e,t)=>{var r;if(t.type===l.TextMarkType.link){const e=null===(r=t.attrs)||void 0===r?void 0:r.href;if(e)return e}return e}),"");if(t)return t}return!1}getIndentationString(){if(this.currentIndent===this.prevIndent)return this.indentationStringCache;let e="";for(let t=1;t<this.currentIndent;t++)e+="\t";return this.indentationStringCache=e,this.prevIndent=this.currentIndent,e}writeBodyBit(e){const t=`[!${this.placeholderIndex}]`;this.writerText+=t,this.placeholders[t]=e,this.placeholderIndex++}writeText(e){if(null==e.text)return;if(this.writeLink(e))return;const t=this.inCodeBlock;let r=e.text;if(r=t?r.replace(y,"$1^"):r.replace(g,d),this.currentIndent>1){const e=this.getIndentationString();r=r.replace(f,`$1${e}`)}this.write(r)}writeLink(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r=e.text.replace(g,d);if(this.currentIndent>1){const e=this.getIndentationString();r=r.replace(f,`$1${e}`)}return t.replace(h,"$1")===r?this.write(t):(r=`==${r}==|link:${t}|`,this.write(r)),!0}return!1}writeMarks(e,t){if(e.marks){const r=1===e.marks.length,o=e.marks.reduce(((e,t)=>{if(e)return e;switch(t.type){case l.TextMarkType.bold:case l.TextMarkType.light:case l.TextMarkType.italic:case l.TextMarkType.highlight:return r?p[t.type]:"==";case l.TextMarkType.strike:case l.TextMarkType.sub:case l.TextMarkType.super:case l.TextMarkType.ins:case l.TextMarkType.del:case l.TextMarkType.var:case l.TextMarkType.code:case l.TextMarkType.color:case l.TextMarkType.comment:return"==";case l.TextMarkType.link:}return e}),void 0);if(null!=o&&(this.writeMarkTextWrapper(o),!t)){let t=!1;for(const o of e.marks)switch(o.type){case l.TextMarkType.bold:case l.TextMarkType.light:case l.TextMarkType.italic:case l.TextMarkType.highlight:r||(this.writeInlineMarkStartEnd(),this.writeInlineMark(o),t=!0);break;case l.TextMarkType.strike:case l.TextMarkType.sub:case l.TextMarkType.super:case l.TextMarkType.ins:case l.TextMarkType.del:case l.TextMarkType.var:case l.TextMarkType.code:case l.TextMarkType.color:this.writeInlineMarkStartEnd(),this.writeInlineMark(o),t=!0;break;case l.TextMarkType.comment:this.writeInlineMarkStartEnd(),this.writeCommentMark(o),t=!0;case l.TextMarkType.link:}t&&this.writeInlineMarkStartEnd()}}}writeParagraph(e){this.exitedCodeBlock&&(this.write("|"),this.writeNL(),this.writeNL())}writeHardBreak(e){if(this.writeNL(),this.currentIndent>1){const e=this.getIndentationString();this.write(e)}}writeHeading(e){var t,r;let o="";const i=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.level)&&void 0!==r?r:1;for(let e=0;e<+i;e++)o+="#";o+=" ",this.write(o)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e){var t,r;let o=this.getIndentationString();if(e.parent===u.TextNodeType.bulletList)o+="• ";else if(e.parent===u.TextNodeType.orderedList)o+="•1 ";else if(e.parent===u.TextNodeType.taskList){o+=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.checked)&&void 0!==r&&r?"•+ ":"•- "}o&&this.write(o)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs;let r=`|image:${t.src}|`;for(const[e,o]of Object.entries(t))switch(e){case"textAlign":"left"!==o&&(r+=`@captionAlign:${o}|`);break;case"title":o&&(r+=`@caption:${o}|`);break;case"class":"center"!==o&&o&&(r+=`@align:${o}|`);break;case"comment":o&&(r+=`#${o}|`);break;case"alt":case"width":case"height":default:o&&(r+=`@${e}:${o}|`);case"src":}this.write(r)}writeCodeBlock(e){if(null==e.attrs||!e.attrs.language)return;const t=`|code:${e.attrs.language}\n`;this.write(t)}writeMarkTextWrapper(e){e&&this.write(e)}writeInlineMark(e){let t=`${e.type}`;if(e.attrs)for(const[r,o]of Object.entries(e.attrs))("language"===r&&"plain text"!==o||"color"===r)&&(t=`${t}:${o}`);this.write(t)}writeCommentMark(e){if(e.comment){const t=`#${e.comment}`;this.write(t)}}writeInlineMarkStartEnd(){this.write("|")}writeString(e){null!=e&&this.write(`${e}`)}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}getBitType(e){for(const t of e)if(t.key===n.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}write(e){return this.writerText+=e,this}writeLine(e){return this.write(`${e}\n`),this}writeLines(e,t){for(const r of e)this.write(`${r}${null!=t?t:""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}}},9677:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoBuilder=void 0;const o=r(2606),i=r(208);t.InfoBuilder=class{getSupportedBits(e){var t,r;const n=null===(t=null==e?void 0:e.includeNonDeprecated)||void 0===t||t,s=null!==(r=null==e?void 0:e.includeDeprecated)&&void 0!==r&&r,a=[];for(const t of i.RootBitType.values()){if(t===i.RootBitType._error)continue;const r=o.Config.getBitType(t),l=o.Config.getBitConfig(r),u=this.getSupportedBitAliases(t,e);(u.length>0||n&&!l.deprecated||s&&l.deprecated)&&a.push({name:t,since:l.since,deprecated:l.deprecated,aliases:u})}return a}getSupportedBitConfigs(){const e=[];for(const t of i.RootBitType.values()){if(t===i.RootBitType._error)continue;const r=o.Config.getBitType(t),n=o.Config.getBitConfig(r);e.push(n)}return e}getSupportedBitAliases(e,t){var r,n;const s=null===(r=null==t?void 0:t.includeNonDeprecated)||void 0===r||r,a=null!==(n=null==t?void 0:t.includeDeprecated)&&void 0!==n&&n,l=[];for(const t of i.AliasBitType.values()){const r=o.Config.getBitType(t);if(r.root===e){const e=o.Config.getBitConfig(r);(s&&!e.deprecated||a&&e.deprecated)&&l.push({name:r.alias,since:e.since,deprecated:e.deprecated})}}return l}}},7087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const o=r(1022),i=r(671);r(2606);let n=!1;t.init=function(){n||((0,i.initEnv)(o.buildInfo.name,o.buildInfo.version),n=!0)}},549:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeType=void 0;const o=(0,r(6688).superenum)({unknown:"unknown",bitType:"bitType",alias:"alias",root:"root",textFormat:"textFormat",bitmarkAst:"bitmarkAst",bits:"bits",bitsValue:"bitsValue",properties:"properties",property:"property",propertyValues:"propertyValues",itemLead:"itemLead",body:"body",bodyParts:"bodyParts",bodyPartsValue:"bodyPartsValue",bodyPartText:"bodyPartText",data:"data",bodyText:"bodyText",footer:"footer",footerText:"footerText",gap:"gap",select:"select",highlight:"highlight",cardNode:"cardNode",elements:"elements",solutions:"solutions",options:"options",optionsValue:"optionsValue",texts:"texts",textsValue:"textsValue",statement:"statement",statements:"statements",statementsValue:"statementsValue",choices:"choices",choicesValue:"choicesValue",responses:"responses",responsesValue:"responsesValue",quizzes:"quizzes",quizzesValue:"quizzesValue",heading:"heading",forValues:"forValues",pairs:"pairs",pairsValue:"pairsValue",values:"values",matrix:"matrix",matrixValue:"matrixValue",cells:"cells",cellsValue:"cellsValue",questions:"questions",questionsValue:"questionsValue",botResponses:"botResponses",botResponsesValue:"botResponsesValue",id:"id",idValue:"idValue",externalId:"externalId",externalIdValue:"externalIdValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",padletId:"padletId",padletIdValue:"padletIdValue",jupyterId:"jupyterId",jupyterIdValue:"jupyterIdValue",jupyterExecutionCount:"jupyterExecutionCount",jupyterExecutionCountValue:"jupyterExecutionCountValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",lang:"lang",langValue:"langValue",language:"language",languageValue:"languageValue",computerLanguage:"computerLanguage",computerLanguageValue:"computerLanguageValue",target:"target",targetValue:"targetValue",tag:"tag",tagValue:"tagValue",icon:"icon",iconValue:"iconValue",iconTag:"iconTag",iconTagValue:"iconTagValue",colorTag:"colorTag",colorTagValue:"colorTagValue",flashcardSet:"flashcardSet",flashcardSetValue:"flashcardSetValue",subtype:"subtype",subtypeValue:"subtypeValue",bookAlias:"bookAlias",bookAliasValue:"bookAliasValue",coverImage:"coverImage",coverImageValue:"coverImageValue",publisher:"publisher",publisherValue:"publisherValue",publications:"publications",publicationsValue:"publicationsValue",author:"author",authorValue:"authorValue",subject:"subject",subjectValue:"subjectValue",date:"date",dateValue:"dateValue",location:"location",locationValue:"locationValue",theme:"theme",themeValue:"themeValue",kind:"kind",kindValue:"kindValue",action:"action",actionValue:"actionValue",thumbImage:"thumbImage",thumbImageValue:"thumbImageValue",focusX:"focusX",focusXValue:"focusXValue",focusY:"focusY",focusYValue:"focusYValue",duration:"duration",durationValue:"durationValue",deeplink:"deeplink",deeplinkValue:"deeplinkValue",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",videoCallLinkValue:"videoCallLinkValue",bot:"bot",botValue:"botValue",referenceProperty:"referenceProperty",referencePropertyValue:"referencePropertyValue",list:"list",listValue:"listValue",textReference:"textReference",textReferenceValue:"textReferenceValue",isTracked:"isTracked",isTrackedValue:"isTrackedValue",isInfoOnly:"isInfoOnly",isInfoOnlyValue:"isInfoOnlyValue",labelTrue:"labelTrue",labelFalse:"labelFalse",content2Buy:"content2Buy",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",reasonableNumOfChars:"reasonableNumOfChars",reasonableNumOfCharsValue:"reasonableNumOfCharsValue",maxCreatedBits:"maxCreatedBits",maxCreatedBitsValue:"maxCreatedBitsValue",book:"book",item:"item",lead:"lead",hint:"hint",instruction:"instruction",isDefaultExample:"isDefaultExample",isExample:"isExample",example:"example",exampleValue:"exampleValue",extraProperties:"extraProperties",title:"title",subtitle:"subtitle",level:"level",toc:"toc",tocValue:"tocValue",progress:"progress",progressValue:"progressValue",anchor:"anchor",reference:"reference",referenceEnd:"referenceEnd",elementsValue:"elementsValue",solutionsValue:"solutionsValue",prefix:"prefix",postfix:"postfix",isCaseSensitive:"isCaseSensitive",isShortAnswer:"isShortAnswer",isCorrect:"isCorrect",forKeys:"forKeys",forValuesValue:"forValuesValue",key:"key",valuesValue:"valuesValue",question:"question",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",statementText:"statementText",text:"text",propertyKey:"propertyKey",propertyValue:"propertyValue",keyAudio:"keyAudio",keyImage:"keyImage",response:"response",reaction:"reaction",feedback:"feedback",imageSource:"imageSource",mockupId:"mockupId",size:"size",trim:"trim",partner:"partner",name:"name",avatarImage:"avatarImage",markConfig:"markConfig",markConfigValue:"markConfigValue",solution:"solution",mark:"mark",color:"color",emphasis:"emphasis",flashcards:"flashcards",flashcardsValue:"flashcardsValue",answer:"answer",alternativeAnswers:"alternativeAnswers",alternativeAnswersValue:"alternativeAnswersValue",resourceType:"resourceType",resources:"resources",resourcesValue:"resourcesValue",image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",audio:"audio",type:"type",typeAlias:"typeAlias",format:"format",value:"value",url:"url",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",width:"width",height:"height",alt:"alt",license:"license",copyright:"copyright",provider:"provider",showInIndex:"showInIndex",caption:"caption",posterImage:"posterImage",thumbnails:"thumbnails",thumbnailsValue:"thumbnailsValue",textAst:"textAst",textAstValue:"textAstValue",content:"contentValue",contentValue:"contentValue",contentValueValue:"contentValueValue",attrs:"attrs",section:"section",parent:"parent",marks:"marks",marksValue:"marksValue",comment:"comment",parser:"parser",version:"version",bitmarkVersion:"bitmarkVersion",warnings:"warnings",warningsValue:"warningsValue",errors:"errors",errorsValue:"errorsValue",message:"message",start:"start",end:"end",offset:"offset",line:"line",column:"column",markup:"markup"});t.NodeType=o},7200:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTagConfig=void 0;t.AbstractTagConfig=class{constructor(e,t,r,o,i,n,s,a,l){this.type=e,this.configKey=t,this.tag=r,this.maxCount=o,this.minCount=i,this.chain=n,this.jsonKey=s,this.astKey=a,this.deprecated=l}}},429:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitConfig=void 0;const o=r(1035);t.BitConfig=class{constructor(e,t,r,o,i,n,s,a,l,u,c,p,g){this.tags={},this.since=e,this.rootBitType=t.root,this.aliases=r,this.tags=o,this.cardSet=i,this.deprecated=n,this.bodyAllowed=s,this.bodyRequired=a,this.footerAllowed=l,this.footerRequired=u,this.resourceAttachmentAllowed=c,this.rootExampleType=p,this.comboResourceType=g}toString(e){const t=Object.assign({},e);let r=`[Bit]\n${this.rootBitType}`;this.aliases.length>0&&(r+="\n\n[Aliases]",r+=`\n${this.aliases.join(", ")}`);const i=[];null!=this.since&&i.push(`since=${this.since}`),null!=this.deprecated&&i.push(`deprecated=${this.deprecated}`),this.bodyAllowed&&i.push("bodyAllowed"),this.bodyRequired&&i.push("bodyRequired"),this.footerAllowed&&i.push("footerAllowed"),this.footerRequired&&i.push("footerRequired"),this.resourceAttachmentAllowed&&i.push("resourceAttachmentAllowed"),null!=this.rootExampleType&&i.push(`rootExampleType=${this.rootExampleType}`),null!=this.comboResourceType&&i.push(`comboResourceType=${this.comboResourceType}`),r+=`\n\n[Flags]\n${i.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))(e.maxCount===o.Count.infinity||e.maxCount>0)&&(r+=`\n${e.toString(t)}`);return this.cardSet&&(r+=`\n\n${this.cardSet.toString(t)}`),r}}},2005:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfig=void 0;t.CardSetConfig=class{constructor(e,t){this.configKey=e,this.variants=t}toString(e){const t=Object.assign({},e);let r="",o=0,i=0;for(const e of this.variants){for(const n of e)r+=`[Card - Side ${o}, Variant ${i}]`,r+=`\n${n.toString(t)}`,i++;o++}return r}}},3585:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardVariantConfig=void 0;t.CardVariantConfig=class{constructor(e,t,r,o){this.tags=e,this.bodyAllowed=t,this.bodyRequired=r,this.repeatCount=o}toString(e){const t=Object.assign({},e);let r="";const o=[];this.bodyAllowed&&o.push("bodyAllowed"),this.bodyRequired&&o.push("bodyRequired"),null!=this.repeatCount&&o.push(`repeatCount=${this.repeatCount}`),r+=`[Flags]\n${o.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))r+=`\n${e.toString(t)}`;return r}}},6620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MarkupTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,s){super(o.BitTagType.tag,e,t,r,i,n,void 0,void 0,s),this.type=o.BitTagType.tag}toString(e){const t=Object.assign({},e);let r=`TAG[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.MarkupTagConfig=n},6956:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,s,a,l,u,c,p){super(o.BitTagType.property,e,t,r,i,n,s,a,p),this.type=o.BitTagType.property,this.single=l,this.format=u,this.defaultValue=c}toString(e){const t=Object.assign({},e);let r=`PTY[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.single&&(r+=`, sgl=${this.single}`),null!=this.format&&(r+=`, fmt=${this.format}`),null!=this.defaultValue&&(r+=`, def=${this.defaultValue}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`),null!=this.astKey&&(r+=`, ast=${this.astKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.PropertyTagConfig=n},7585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,s,a){super(o.BitTagType.resource,e,t,r,i,n,s,void 0,a),this.type=o.BitTagType.resource}toString(e){const t=Object.assign({},e);let r=`RES[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.ResourceTagConfig=n},3059:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcesConfig=void 0;t.ResourcesConfig=class{constructor(e,t,r,o){this.tags=e,this.resourceAttachmentAllowed=null!=t&&t,this.resourceTypeAttachment=r,this.comboResourceTagTypesMap=o}getCountsMin(){const e=new Map;for(const t of Object.values(this.tags))null!=t.minCount&&e.set(t.tag,t.minCount);return e}getCountsMax(){const e=new Map;for(const t of Object.values(this.tags))null!=t.maxCount&&e.set(t.tag,t.maxCount);return e}}},2574:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfigKey=void 0;const o=(0,r(6688).superenum)({_flashcards:"_flashcards",_elements:"_elements",_statements:"_statements",_quiz:"_quiz",_questions:"_questions",_matchPairs:"_matchPairs",_matchAudioPairs:"_matchAudioPairs",_matchImagePairs:"_matchImagePairs",_matchMatrix:"_matchMatrix",_botActionResponses:"_botActionResponses"});t.CardSetConfigKey=o},8620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigKey=void 0;const o=r(6688),i=r(177),n=r(3518),s=r(6194),a=r(1595),l=(0,o.superenum)(Object.assign(Object.assign(Object.assign(Object.assign({_unknown:"_unknown"},a.tagConfigKeys),n.propertyConfigKeys),s.resourceConfigKeys),i.groupConfigKeys));t.ConfigKey=l,function(){const e=new Set,t=[a.tagConfigKeys,n.propertyConfigKeys,s.resourceConfigKeys,i.groupConfigKeys];for(const r of t)for(const t in r){if(e.has(t))throw new Error(`Duplicate ConfigKey: ${t}`);e.add(t)}}()},177:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.groupConfigKeys=t.GroupConfigKey=void 0;const o=r(6688),i={group_standardAllBits:"group_standardAllBits",group_standardItemLeadInstructionHint:"group_standardItemLeadInstructionHint",group_standardExample:"group_standardExample",group_standardTags:"group_standardTags",group_imageSource:"group_imageSource",group_partner:"group_partner",group_gap:"group_gap",group_trueFalse:"group_trueFalse",group_markConfig:"group_markConfig",group_mark:"group_mark",group_bookCommon:"group_bookCommon",group_learningPathCommon:"group_learningPathCommon",group_resourceCommon:"group_resourceCommon",group_resourceImageCommon:"group_resourceImageCommon",group_resourceAudioCommon:"group_resourceAudioCommon",group_resourceVideoCommon:"group_resourceVideoCommon",group_resourceImage:"group_resourceImage",group_resourceImageEmbed:"group_resourceImageEmbed",group_resourceImageLink:"group_resourceImageLink",group_resourceImageResponsive:"group_resourceImageResponsive",group_resourceImagePortrait:"group_resourceImagePortrait",group_resourceImageLandscape:"group_resourceImageLandscape",group_resourceAudio:"group_resourceAudio",group_resourceAudioEmbed:"group_resourceAudioEmbed",group_resourceAudioLink:"group_resourceAudioLink",group_resourceVideo:"group_resourceVideo",group_resourceVideoEmbed:"group_resourceVideoEmbed",group_resourceVideoLink:"group_resourceVideoLink",group_resourceStillImageFilm:"group_resourceStillImageFilm",group_resourceStillImageFilmEmbed:"group_resourceStillImageFilmEmbed",group_resourceStillImageFilmLink:"group_resourceStillImageFilmLink",group_resourceArticle:"group_resourceArticle",group_resourceArticleEmbed:"group_resourceArticleEmbed",group_resourceArticleLink:"group_resourceArticleLink",group_resourceDocument:"group_resourceDocument",group_resourceDocumentEmbed:"group_resourceDocumentEmbed",group_resourceDocumentLink:"group_resourceDocumentLink",group_resourceDocumentDownload:"group_resourceDocumentDownload",group_resourceAppLink:"group_resourceAppLink",group_resourceWebsiteLink:"group_resourceWebsiteLink"};t.groupConfigKeys=i;const n=(0,o.superenum)(i);t.GroupConfigKey=n},5428:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GroupConfigType=void 0;const o=(0,r(6688).superenum)({standard:"standard",resource:"resource",comboResource:"comboResource"});t.GroupConfigType=o},3518:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyConfigKeys=t.PropertyConfigKey=void 0;const o=r(6688),i={action:"action",ageRange:"ageRange",aiGenerated:"aiGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",caseSensitive:"caseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",longAnswer:"longAnswer",markConfig:"markConfig",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",posterImage:"posterImage",progress:"progress",property_mark:"property_mark",property_reference:"property_reference",property_sampleSolution:"property_sampleSolution",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",releaseVersion:"releaseVersion",shortAnswer:"shortAnswer",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width"};t.propertyConfigKeys=i;const n=(0,o.superenum)(i);t.PropertyConfigKey=n},6194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceConfigKeys=t.ResourceConfigKey=void 0;const o=r(6688),i={image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audio:"audio",audioEmbed:"audioEmbed",audioLink:"audioLink",video:"video",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",article:"article",articleEmbed:"articleEmbed",articleLink:"articleLink",document:"document",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"};t.resourceConfigKeys=i;const n=(0,o.superenum)(i);t.ResourceConfigKey=n},1595:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tagConfigKeys=t.TagConfigKey=void 0;const o=r(6688),i={title:"title",anchor:"anchor",tag_reference:"tag_reference",property:"property",itemLead:"itemLead",instruction:"instruction",hint:"hint",true:"true",false:"false",sampleSolution:"sampleSolution",gap:"gap",tag_mark:"tag_mark",resource:"resource",remark:"remark",comment:"comment"};t.tagConfigKeys=i;const n=(0,o.superenum)(i);t.TagConfigKey=n},742:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitTagType=void 0;const o=(0,r(6688).superenum)({tag:"tag",property:"property",resource:"resource",group:"group"});t.BitTagType=o},208:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AliasBitType=t.RootBitType=void 0;const o=r(6688),i=(0,o.superenum)({_error:"_error",appBitmarkFromJavascript:"app-bitmark-from-javascript",appFlashcards:"app-flashcards",appLink:"app-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",bitAlias:"bit-alias",book:"book",bookAlias:"book-alias",botActionResponse:"bot-action-response",botActionSend:"bot-action-send",browserImage:"browser-image",card1:"card-1",chapter:"chapter",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",code:"code",conversationLeft1:"conversation-left-1",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",essay:"essay",example:"example",flashcard:"flashcard",focusImage:"focus-image",highlightText:"highlight-text",image:"image",imageLink:"image-link",imageOnDevice:"image-on-device",imageResponsive:"image-responsive",internalLink:"internal-link",interview:"interview",learningPathBook:"learning-path-book",learningPathBotTraining:"learning-path-bot-training",learningPathExternalLink:"learning-path-external-link",learningPathVideoCall:"learning-path-video-call",mark:"mark",match:"match",matchAudio:"match-audio",matchMatrix:"match-matrix",matchPicture:"match-picture",multipleChoice:"multiple-choice",multipleChoice1:"multiple-choice-1",multipleChoiceText:"multiple-choice-text",multipleResponse:"multiple-response",multipleResponse1:"multiple-response-1",page:"page",pageBuyButton:"page-buy-button",photo:"photo",quote:"quote",rating:"rating",releaseNote:"release-note",sampleSolution:"sample-solution",sequence:"sequence",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",survey:"survey",surveyAnonymous:"survey-anonymous",toc:"toc",trueFalse:"true-false",trueFalse1:"true-false-1",vendorPadletEmbed:"vendor-padlet-embed",vendorJupyterOutput:"vendor-jupyter-output",video:"video",videoEmbed:"video-embed",videoLink:"video-link",websiteLink:"website-link"});t.RootBitType=i;const n=(0,o.superenum)({aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",appBitmarkFromEditor:"app-bitmark-from-editor",appCodeCell:"app-code-cell",appCodeEditor:"app-code-editor",appCodeIde:"app-code-ide",appCreateBitsFromImage:"app-create-bits-from-image",appFlashcardsLearn:"app-flashcards-learn",appFlashcardsQuiz:"app-flashcards-quiz",appGetScreenshot:"app-get-screenshot",articleAi:"article-ai",articleAttachment:"article-attachment",assignment:"assignment",audioTranscript:"audio-transcript",bitBookEnding:"bit-book-ending",bitBookSummary:"bit-book-summary",bitmarkExample:"bitmark-example",blogArticle:"blog-article",bookAcknowledgments:"book-acknowledgments",bookAddendum:"book-addendum",bookAfterword:"book-afterword",bookAppendix:"book-appendix",bookArticle:"book-article",bookAutherBio:"book-author-bio",bookBibliography:"book-bibliography",bookComingSoon:"book-coming-soon",bookConclusion:"book-conclusion",bookCopyright:"book-copyright",bookCopyrightPermissions:"book-copyright-permissions",bookDedication:"book-dedication",bookEndnotes:"book-endnotes",bookEpigraph:"book-epigraph",bookEpilogue:"book-epilogue",bookForword:"book-foreword",bookFrontispiece:"book-frontispiece",bookImprint:"book-imprint",bookIncitingIncident:"book-inciting-incident",bookIntroduction:"book-introduction",bookLink:"book-link",bookLinkNext:"book-link-next",bookLinkPrev:"book-link-prev",bookListOfContributors:"book-list-of-contributors",bookNotes:"book-notes",bookPostscript:"book-postscript",bookPreface:"book-preface",bookPrologue:"book-prologue",bookReadMore:"book-read-more",bookReferenceList:"book-reference-list",bookRequestForABookReview:"book-request-for-a-book-review",bookSummary:"book-summary",bookTeaser:"book-teaser",bookTitle:"book-title",botActionAnnounce:"bot-action-announce",botActionRatingNumber:"bot-action-rating-number",botActionRemind:"bot-action-remind",botActionSave:"bot-action-save",botActionTrueFalse:"bot-action-true-false",botInterview:"bot-interview",bug:"bug",buttonCopyText:"button-copy-text",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",clozeInstructionGrouped:"cloze-instruction-grouped",clozeSolutionGrouped:"cloze-solution-grouped",coachAudioTranscript:"coach-audio-transcript",coachCallToActionChecklist:"coach-call-to-action-checklist",coachCallToActionCloze:"coach-call-to-action-cloze",coachCallToActionClozeAndMultipleChoiceText:"coach-call-to-action-cloze-and-multiple-choice-text",coachCallToActionEssay:"coach-call-to-action-essay",coachCallToActionMultipleChoiceText:"coach-call-to-action-multiple-choice-text",coachHomeRules:"coach-home-rules",coachSelfReflectionCloze:"coach-self-reflection-cloze",coachSelfReflectionEssay:"coach-self-reflection-essay",coachSelfReflectionMultipleChoice:"coach-self-reflection-multiple-choice",coachSelfReflectionMultipleChoice1:"coach-self-reflection-multiple-choice-1",coachSelfReflectionMultipleChoiceText:"coach-self-reflection-multiple-choice-text",coachSelfReflectionMultipleResponse:"coach-self-reflection-multiple-response",coachSelfReflectionMultipleResponse1:"coach-self-reflection-multiple-response-1",coachSelfReflectionRating:"coach-self-reflection-rating",coachVideoTranscript:"coach-video-transcript",codeRuntime:"code-runtime",conclusion:"conclusion",consoleLog:"console-log",conversationLeft1Scream:"conversation-left-1-scream",conversationLeft1Thought:"conversation-left-1-thought",conversationRight1:"conversation-right-1",conversationRight1Scream:"conversation-right-1-scream",conversationRight1Thought:"conversation-right-1-thought",cookArrangement:"cook-arrangement",cookIngredients:"cook-ingredients",cookInsert:"cook-insert",cookPersonalRecommendation:"cook-personal-recommendation",cookPlate:"cook-plate",cookPracticeAdvise:"cook-practice-advise",cookPreparation:"cook-preparation",cookRecommendation:"cook-recommendation",cookRemark:"cook-remark",cookSideDish:"cook-side-dish",cookSideDrink:"cook-side-drink",cookStep:"cook-step",cookTimer:"cook-timer",cookVariation:"cook-variation",correction:"correction",danger:"danger",details:"details",details1:"details-1",detailsImage:"details-image",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",featured:"featured",figure:"figure",flashcard1:"flashcard-1",footNote:"foot-note",groupBorn:"group-born",groupDied:"group-died",help:"help",hint:"hint",imageBanner:"image-banner",imageFigure:"image-figure",imageLandscape:"image-landscape",imageMood:"image-mood",imagePortrait:"image-portrait",imagePrototype:"image-prototype",imageScreenshot:"image-screenshot",imageStyled:"image-styled",imageSuperWide:"image-super-wide",imageZoom:"image-zoom",info:"info",interviewInstructionGrouped:"interview-instruction-grouped",langAudioScript:"lang-audio-script",langEnablingLanguageSkills:"lang-enabling-language-skills",langEnglishAroundWorld:"lang-english-around-world",langExtraActivity:"lang-extra-activity",langGoodToKnow:"lang-good-to-know",langHomework:"lang-homework",langLearningGoal:"lang-learning-goal",langLearningOutcomes:"lang-learning-outcomes",langLearningStrategy:"lang-learning-strategy",langLevelDown:"lang-level-down",langLevelUp:"lang-level-up",langLifeSkillIcon:"lang-life-skill-icon",langLifeSkills:"lang-life-skills",langLikeALocal:"lang-like-a-local",langMaterial:"lang-material",langTeacherNote:"lang-teacher-note",langTeacherPronunciation:"lang-teacher-pronunciation",langUsefulPhrases:"lang-useful-phrases",langVideoScript:"lang-video-script",langVocabulary:"lang-vocabulary",learningPathClassroomEvent:"learning-path-classroom-event",learningPathClassroomTraining:"learning-path-classroom-training",learningPathClosing:"learning-path-closing",learningPathExternalLink:"learning-path-external-link",learningPathFeedback:"learning-path-feedback",learningPathLearningGoal:"learning-path-learning-goal",learningPathLti:"learning-path-lti",learningPathSign:"learning-path-sign",learningPathStep:"learning-path-step",learningPathVideoCall:"learning-path-video-call",lifeSkillSticker:"life-skill-sticker",matchAll:"match-all",matchAllReverse:"match-all-reverse",matchReverse:"match-reverse",matchSolutionGrouped:"match-solution-grouped",message:"message",newspaperArticle:"newspaper-article",note:"note",noteAi:"note-ai",notebookArticle:"notebook-article",output:"output",pageBanner:"page-banner",preparationNote:"preparation-note",question1:"question-1",recordAudio:"record-audio",releaseNotesSummary:"release-notes-summary",remark:"remark",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewNote:"review-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",screenshot:"screenshot",selfAssessment:"self-assessment",sideNote:"side-note",statement:"statement",stdout:"stdout",stickyNote:"sticky-note",summary:"summary",summaryAi:"summary-ai",survey1:"survey-1",surveyAnonymous1:"survey-anonymous-1",takePicture:"take-picture",vendorJupyterCellCode:"vendor-jupyter-cell-code",vendorJupyterCellMarkdown:"vendor-jupyter-cell-markdown",vendorJupyterCellRaw:"vendor-jupyter-cell-raw",vendorJupyterIpynb:"vendor-jupyter-ipynb",videoLandscape:"video-landscape",videoPortrait:"video-portrait",videoEmbedLandscape:"video-embed-landscape",videoEmbedPortrait:"video-embed-portrait",videoLinkLandscape:"video-link-landscape",videoLinkPortrait:"video-link-portrait",videoTranscript:"video-transcript",warning:"warning",workbookArticle:"workbook-article"});t.AliasBitType=n},6958:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParserType=void 0;const o=(0,r(6688).superenum)({peggy:"peggy"});t.BitmarkParserType=o},8791:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BITMARK_VERSION=t.BitmarkVersion=void 0;const o=(0,r(6688).superenum)({v2:2,v3:3});t.BitmarkVersion=o;const i=o.v3;t.DEFAULT_BITMARK_VERSION=i},1060:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BodyBitType=void 0;const o=(0,r(6688).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"});t.BodyBitType=o},8565:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetVersion=void 0;const o=(0,r(6688).superenum)({v1:1,v2:2});t.CardSetVersion=o},1035:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Count=void 0;const o=(0,r(6688).superenum)({infinity:"infinity"});t.Count=o},7028:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExampleType=void 0;const o=(0,r(6688).superenum)({none:"none",string:"string",boolean:"boolean"});t.ExampleType=o},7204:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyAstKey=void 0;const o=(0,r(6688).superenum)({aiGenerated:"aiGenerated",isCaseSensitive:"isCaseSensitive",referenceProperty:"referenceProperty",isShortAnswer:"isShortAnswer",markConfig:"markConfig"});t.PropertyAstKey=o},5486:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyFormat=void 0;const o=(0,r(6688).superenum)({none:"none",string:"string",trimmedString:"trimmedString",number:"number",boolean:"boolean",invertedBoolean:"invertedBoolean"});t.PropertyFormat=o},7572:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyJsonKey=void 0;const o=(0,r(6688).superenum)({caseSensitive:"isCaseSensitive",shortAnswer:"isShortAnswer"});t.PropertyJsonKey=o},7953:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTag=void 0;const o=(0,r(6688).superenum)({action:"action",ageRange:"ageRange",aiGenerated:"AIGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",caseSensitive:"caseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",longAnswer:"longAnswer",mark:"mark",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",posterImage:"posterImage",progress:"progress",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",reference:"reference",releaseVersion:"releaseVersion",sampleSolution:"sampleSolution",shortAnswer:"shortAnswer",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width"});t.PropertyTag=o},9431:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceJsonKey=void 0;const o=(0,r(6688).superenum)({imageResponsive:"imageResponsive",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audioEmbed:"audioEmbed",audioLink:"audioLink",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilm:"stillImageFilm",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",articleEmbed:"articleEmbed",articleLink:"articleLink",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"});t.ResourceJsonKey=o},9779:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTag=void 0;const o=(0,r(6688).superenum)({unknown:"unknown",image:"image",imageResponsive:"image-responsive",imagePortrait:"image-portrait",imageLandscape:"image-landscape",imageEmbed:"image-embed",imageLink:"image-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",video:"video",videoEmbed:"video-embed",videoLink:"video-link",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",document:"document",documentEmbed:"document-embed",documentLink:"document-link",documentDownload:"document-download",appLink:"app-link",websiteLink:"website-link"});t.ResourceTag=o},8739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const o=(0,r(6688).superenum)({title:"#",anchor:"▼",reference:"►",property:"@",itemLead:"%",instruction:"!",hint:"?",true:"+",false:"-",sampleSolution:"$",gap:"_",mark:"=",resource:"&",remark:"::",comment:"||"});t.Tag=o},1353:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFormat=void 0;const o=(0,r(6688).superenum)({text:"text",bitmarkMinusMinus:"bitmark--",bitmarkPlusPlus:"bitmark++"});t.TextFormat=o},1888:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextMarkType=void 0;const o=(0,r(6688).superenum)({bold:"bold",light:"light",italic:"italic",highlight:"highlight",strike:"strike",sub:"sub",super:"super",ins:"ins",del:"del",link:"link",var:"var",code:"code",color:"color",hash:"#",comment:"comment"});t.TextMarkType=o},2610:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextNodeType=void 0;const o=(0,r(6688).superenum)({text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",bulletList:"bulletList",orderedList:"orderedList",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",codeBlock:"codeBlock",gap:"gap",select:"select",highlight:"highlight"});t.TextNodeType=o},8681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoFormat=void 0;const o=(0,r(6688).superenum)({text:"text",json:"json",pojo:"pojo"});t.InfoFormat=o},7347:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoType=void 0;const o=(0,r(6688).superenum)({list:"list",deprecated:"deprecated",all:"all",bit:"bit"});t.InfoType=o},9556:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParser=void 0;const o=r(2434),i=r(8030);t.BitmarkParser=class{constructor(){this.jsonParser=new o.JsonParser}toAst(e,t){return(0,i.parse)(e)}}},8030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const o=r(4369).parse;t.parse=o},2892:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserHelper=void 0;const o=r(8565),i=r(3633),n=r(7542),s=r(6831);r(2606);t.BitmarkPegParserHelper=class{constructor(e){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0,this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation}handleRawBit(e){var t,r;const o=e.trim();if(this.debugPrint("RAW BIT",o),!o)return;const i=null!==(r=null===(t=this.parserLocation())||void 0===t?void 0:t.start)&&void 0!==r?r:{line:1,column:1,offset:0},s=this.parse(e,{startRule:"bit",grammarSource:new n.PeggyGrammarLocation("bit",i)});return s.value&&(s.value.markup=o),s}handleTextFormat(e){return{type:s.TypeKey.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:s.TypeKey.ResourceType,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleBitContent(e){let t=this.reduceToArrayOfTypes(e);return t=this.mergeCharToText(t),t}handleBitTag(e){return e}handleTag(e,t){return{type:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:s.TypeKey.Property,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){return{type:s.TypeKey.Resource,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let r=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),r=[e]}return r}handleCardSet(e){const t=e,r={cards:[]},o={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:o,parser:i}=e;if(!t||t!==s.TypeKey.Card)continue;const{cardIndex:n,cardSideIndex:a,cardVariantIndex:l,value:u}=o;let c=r.cards[n];c||(c={sides:[]},r.cards[n]=c);let p=c.sides[a];p||(p={variants:[]},c.sides[a]=p);p.variants[l]?p.variants[l].value+=u:p.variants[l]={value:u,parser:i}}r.cards=r.cards.filter((e=>e.sides.some((e=>e.variants.some((e=>0!==i.StringUtils.trimmedString(e.value).length))))));for(const t of r.cards){const r={sides:[]};o.cards.push(r);for(const o of t.sides){const t={variants:[]};r.sides.push(t);for(const r of o.variants){let o={line:1,column:1,offset:0};if(r.parser.location){o=r.parser.location.start;const e=r.parser.text,t=e?e.length:0,i=1;o.offset+=t,o.line+=i}let i=this.parse(r.value,{startRule:"cardContent",grammarSource:new n.PeggyGrammarLocation("card-content",o)});i=this.reduceToArrayOfTypes(i),this.debugPrint("parsedCardContent",i),t.variants.push({parser:e,content:i})}}}}return{type:s.TypeKey.CardSet,value:o,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSetStart(){this.cardIndex=-1,this.cardSideIndex=0,this.cardVariantIndex=0}handleCardSetEnd(){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0}handleCards(e){return e}handleCardLineOrDivider(e,t){let r=!1,i=!1,n=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===o.CardSetVersion.v1?(r=e===s.CARD_DIVIDER_V1,i=e===s.CARD_SIDE_DIVIDER_V1,n=e===s.CARD_VARIANT_DIVIDER_V1):(r=e===s.CARD_DIVIDER_V2,i=e===s.CARD_SIDE_DIVIDER_V2,n=e===s.CARD_VARIANT_DIVIDER_V2)),r?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):i?(this.cardSideIndex++,this.cardVariantIndex=0):n&&this.cardVariantIndex++,this.isType(e,s.TypeKey.Card)?e:{type:s.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:s.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:e},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardContent(e){return this.mergeCharToText(e)}handleCardTags(e){return e}mergeCharToText(e){var t,r,o,i,n,a;const l=[];let u,c;for(const p of e)switch(p.type){case s.TypeKey.BodyChar:if(u){const e=`${null!==(t=u.value)&&void 0!==t?t:""}${null!==(r=p.value)&&void 0!==r?r:""}`;u.value=e}else u={type:s.TypeKey.BodyText,value:null!==(o=p.value)&&void 0!==o?o:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case s.TypeKey.CardChar:if(c){const e=`${null!==(i=c.value)&&void 0!==i?i:""}${null!==(n=p.value)&&void 0!==n?n:""}`;c.value=e}else c={type:s.TypeKey.CardText,value:null!==(a=p.value)&&void 0!==a?a:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:u&&(l.push(u),u=void 0),c&&(l.push(c),c=void 0),l.push(p)}return u&&l.push(u),c&&l.push(c),l}isType(e,t){if(!e)return!1;const{type:r}=e;return t?Array.isArray(t)?t.indexOf(r)>=0:t===r:!!s.TypeKey.fromValue(r)}reduceToArrayOfTypes(e,t,r){if(!Array.isArray(e))return[];return e.reduce(((e,o,i)=>{if(null==o)return e;const{type:n,value:s}=o;if(Array.isArray(o)){const r=this.reduceToArrayOfTypes(o,t);e.push(...r)}else{if(!this.isType(o,t))return e;if(r&&Array.isArray(s)){const r=this.reduceToArrayOfTypes(s,t);e.push(...r)}else n&&e.push(o)}return e}),[])}debugPrint(e,t){}}},7448:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserProcessor=void 0;const i=r(9046),n=r(2606),s=r(208),a=r(1060),l=r(9779),u=r(1353),c=r(8386),p=r(1182),g=r(6934),d=r(8081),y=r(9577),f=r(2786),h=r(857),m=r(3287),T=r(3130),b=r(5516),v=r(1838),C=r(4177),x=r(6831),A=new i.Builder;t.BitmarkPegParserProcessor=class{constructor(e){this.nonFatalWarnings=[],this.nonFatalErrors=[],this.parser={},this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation,this.context={DEBUG_BIT_RAW:true,DEBUG_BIT_CONTENT_RAW:false,DEBUG_BIT_CONTENT:true,DEBUG_BIT_TAGS:true,DEBUG_BODY:true,DEBUG_FOOTER:true,DEBUG_CHAIN_CONTENT:true,DEBUG_CHAIN_TAGS:true,DEBUG_CARD_SET_CONTENT:true,DEBUG_CARD_SET:true,DEBUG_CARD_TAGS:true,parser:this.parser,parse:this.parse,bitContentProcessor:this.bitContentProcessor.bind(this),splitBitContent:this.splitBitContent.bind(this),addWarning:this.addWarning.bind(this),addError:this.addError.bind(this),debugPrint:this.debugPrint.bind(this),state:{}}}buildBits(e){var t;const r=[];let o=[];for(const i of e){if(!i)continue;const e=i.value;e?r.push(e):o=o.concat(null!==(t=i.errors)&&void 0!==t?t:[])}return A.bitmark({bits:r,errors:o.length>0?o:void 0})}buildBit(e,t){const{bitType:r,textFormat:i,resourceType:a}=e;if(!r||r.root===s.RootBitType._error)return this.invalidBit();const l=r.root===s.RootBitType.trueFalse1,u=r.root===s.RootBitType.multipleChoice1,g=r.root===s.RootBitType.multipleResponse1;this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=c.BitmarkPegParserValidator.validateBitTags(this.context,r,a,t);const d=n.Config.getBitConfig(r),y=this.bitContentProcessor(r,x.BitContentLevel.Bit,d.tags,t),{body:f,footer:h,cardSet:m,title:T,statement:C,statements:w,choices:B,responses:k,resources:P,comments:K}=y,S=o(y,["body","footer","cardSet","title","statement","statements","choices","responses","resources","comments"]);this.debugPrint("BIT TAGS",S),this.debugPrint("BIT BODY",f),this.debugPrint("BIT FOOTER",h);const _=(0,v.buildTitles)(this.context,r,T),R=(0,p.buildCards)(this.context,r,m,C,w,B,k),I=(0,b.buildResources)(this.context,r,a,P);(K||R.comments)&&(this.parser.comments=[],K&&this.parser.comments.push(...K),R.comments&&this.parser.comments.push(...R.comments));const O=this.buildBitLevelWarnings(),E=this.buildBitLevelErrors();O&&(this.parser.warnings=O),E&&(this.parser.errors=E);return{value:A.bit(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bitType:r,textFormat:i,resourceType:a},_),{statement:l?C:void 0,choices:u?B:void 0,responses:g?k:void 0}),S),{resources:I}),R),{body:f,footer:h,parser:this.parser}))}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:A.bit({bitType:n.Config.getBitType(s.RootBitType._error),parser:this.parser})}}buildBitHeader(e,t){var r;const o=n.Config.getBitType(e);return o.root===s.RootBitType._error&&this.addError(`Invalid bit type: '${e}'`),{bitType:o,textFormat:null!==(r=t.textFormat)&&void 0!==r?r:u.TextFormat.bitmarkMinusMinus,resourceType:t.resourceType}}buildTextAndResourceType(e,t){const r={textFormat:u.TextFormat.bitmarkMinusMinus},o=e=>{var t;e&&(e.type===x.TypeKey.TextFormat?(r.textFormat=u.TextFormat.fromValue(e.value),e.value&&!r.textFormat&&this.addWarning(`Invalid text format '${e.value}', defaulting to '${u.TextFormat.bitmarkMinusMinus}'`),r.textFormat=null!==(t=r.textFormat)&&void 0!==t?t:u.TextFormat.bitmarkMinusMinus):(r.resourceType=l.ResourceTag.fromValue(e.value),e.value&&!r.resourceType&&this.addWarning(`Invalid resource type '${e.value}', it will be ignored`)))};return o(e),o(t),r}resetParserState(){this.context.state={}}bitContentProcessor(e,t,r,o){const i={};if(!o)return i;i.title=[],i.solutions=[],i.statements=[],i.choices=[],i.responses=[],i.resources=[],i.trueFalse=[],i.markConfig=[],i.extraProperties={},i.comments=[];let n=!1,s=!1,a=!1;const l=[];let u="",p="",w="";const B=t===x.BitContentLevel.Chain,k=()=>{if(u){u=c.BitmarkPegParserValidator.checkBodyPart(this.context,e,t,u);const r=A.bodyText({text:u});l.push(r)}u=""};return o.forEach(((o,c)=>{const{type:A,value:P}=o;switch(A){case x.TypeKey.Comment:(0,g.commentTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.ItemLead:(0,f.itemLeadTagContentProcessor)(this.context,e,t,r,o,i,n),n=!0;break;case x.TypeKey.Instruction:case x.TypeKey.Hint:case x.TypeKey.Anchor:case x.TypeKey.SampleSolution:(0,d.defaultTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Reference:(0,T.referenceTagContentProcessor)(this.context,e,t,r,o,i,s),s=!0;break;case x.TypeKey.Title:(0,v.titleTagContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Property:(0,m.propertyContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.Gap:B||k(),(0,y.gapChainContentProcessor)(this.context,e,t,r,o,i,l);break;case x.TypeKey.Mark:B||k(),(0,h.markChainContentProcessor)(this.context,e,t,r,o,i,l);break;case x.TypeKey.True:case x.TypeKey.False:B||k(),(0,C.trueFalseChainContentProcessor)(this.context,e,t,r,o,i,l);break;case x.TypeKey.Resource:(0,b.resourceContentProcessor)(this.context,e,t,r,o,i);break;case x.TypeKey.CardSet:i.cardSet=P,a=!0;break;case x.TypeKey.BodyText:a?p+=P:u+=P;break;case x.TypeKey.CardText:w+=P}})),k(),i.body=l.length>0?A.body({bodyParts:this.trimBodyParts(l)}):void 0,c.BitmarkPegParserValidator.checkBody(this.context,e,t,i.body),p=p.trim(),p&&(p=c.BitmarkPegParserValidator.checkFooter(this.context,e,t,p),p&&(i.footer=A.footerText({text:p}))),w=w.trim(),w&&(i.cardBody=w),0===Object.keys(i.extraProperties).length&&delete i.extraProperties,0===i.title.length&&delete i.title,0===i.solutions.length&&delete i.solutions,0===i.statements.length&&delete i.statements,0===i.choices.length&&delete i.choices,0===i.responses.length&&delete i.responses,0===i.trueFalse.length&&delete i.trueFalse,0===i.markConfig.length&&delete i.markConfig,0===i.resources.length&&delete i.resources,0===i.comments.length&&delete i.comments,i}buildBitLevelWarnings(){let e;return this.nonFatalWarnings.length>0&&(e=this.nonFatalWarnings,this.nonFatalWarnings=[]),e}buildBitLevelErrors(){let e;return this.nonFatalErrors.length>0&&(e=this.nonFatalErrors,this.nonFatalErrors=[]),e}splitBitContent(e,t){const r=[];let o=[];for(const i of e)t.includes(i.type)&&(o.length>0&&r.push(o),o=[]),o.push(i);return o.length>0&&r.push(o),r}trimBodyParts(e){let t=!1,r=e.reduce(((e,r)=>{const o=r;if(t||o.type!==a.BodyBitType.text)t=!0,e.push(r);else{const r=o.data.bodyText.trimStart();r&&(t=!0,o.data.bodyText=r,e.push(o))}return e}),[]);return t=!1,r=r.reduceRight(((e,r)=>{const o=r;if(t||o.type!==a.BodyBitType.text)t=!0,e.unshift(r);else{const r=o.data.bodyText.trimEnd();r&&(t=!0,o.data.bodyText=r,e.unshift(o))}return e}),[]),r}addWarning(e,t,r){var o,i,n;const s={message:e,text:null!==(o=null==t?void 0:t.parser.text)&&void 0!==o?o:this.parserText(),location:null!==(i=null==t?void 0:t.parser.location)&&void 0!==i?i:this.parserLocation(),original:null!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};s.original||delete s.original,this.nonFatalWarnings.push(s)}addError(e,t,r){var o,i,n;const s={message:e,text:null!==(o=null==t?void 0:t.parser.text)&&void 0!==o?o:this.parserText(),location:null!==(i=null==t?void 0:t.parser.location)&&void 0!==i?i:this.parserLocation(),original:null!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};s.original||delete s.original,this.nonFatalErrors.push(s)}debugPrint(e,t){}}},6831:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_VARIANT_DIVIDER_V1=t.CARD_SIDE_DIVIDER_V1=t.CARD_DIVIDER_V1=t.CARD_VARIANT_DIVIDER_V2=t.CARD_SIDE_DIVIDER_V2=t.CARD_DIVIDER_V2=t.BitContentLevel=t.TypeKey=void 0;const o=r(6688),i=r(8739);t.CARD_DIVIDER_V2="====";t.CARD_SIDE_DIVIDER_V2="--";t.CARD_VARIANT_DIVIDER_V2="++";t.CARD_DIVIDER_V1="===";t.CARD_SIDE_DIVIDER_V1="==";t.CARD_VARIANT_DIVIDER_V1="--";const n=(0,o.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:i.Tag.title,Anchor:i.Tag.anchor,Reference:i.Tag.reference,ItemLead:i.Tag.itemLead,Instruction:i.Tag.instruction,Hint:i.Tag.hint,True:i.Tag.true,False:i.Tag.false,Gap:i.Tag.gap,Mark:i.Tag.mark,SampleSolution:i.Tag.sampleSolution,Comment:i.Tag.comment,Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain"});t.TypeKey=n;const s=(0,o.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"});t.BitContentLevel=s},8386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserValidator=void 0;const o=r(2606),i=r(742),n=r(1035),s=r(6831),a=["====","----","\n==\n","\n---\n","\n--\n",":::","::::","|||","||||"],l=["==\n","---\n","--\n"],u=["\n==","\n---","\n--"];const c=new class{validateBitTags(e,t,r,i){if(!i)return[];const n=o.Config.getBitConfig(t),{tags:a,cardSet:l}=n,u=o.Config.getBitResourcesConfig(t,r),c=Object.assign(Object.assign({},a),u.tags);return this.validateTagChainsRecursive(e,t,s.BitContentLevel.Bit,i,c,l)}checkBody(e,t,r,i){if(!i)return i;const n=o.Config.getBitConfig(t),{bodyAllowed:s}=n;return i.bodyParts.length>0&&!s&&e.addWarning(`Bit '${t.alias}' should not have a body.`),i}checkBodyPart(e,t,r,o){return o?(this.checkBodyForCommonPotentialMistakes(e,r,t,o),o):o}checkFooter(e,t,r,i){if(!i)return i;const n=o.Config.getBitConfig(t),{footerAllowed:s}=n;return this.checkBodyForCommonPotentialMistakes(e,r,t,i),s||e.addWarning(`Bit '${t.alias}' should not have a footer.`),i}checkCardBody(e,t,r,i,n,s,a){if(!i)return i;const l=o.Config.getBitConfig(t);if(!l.cardSet)return i;const u=this.getVariantConfig(l.cardSet.variants,s,a);if(!u)return i;const{bodyAllowed:c}=u;return this.checkBodyForCommonPotentialMistakes(e,r,t,i),c||e.addWarning(`Bit '${t.alias}' should not have a card body at card:${n+1}, side:${s+1}, variant:${a+1}.`),i}validateTagChainsRecursive(e,t,r,o,i,a){if(!o)return[];const l=[...o],u=this.convertTagsToTypeKeyMap(e,r,t,i),c=(e,t,r)=>{u.set(e,{maxCount:t,minCount:r,_type:e,_tag:e,_seenCount:0})};c(s.TypeKey.Comment,n.Count.infinity,0),r===s.BitContentLevel.Bit?(a&&c(s.TypeKey.CardSet,1,0),c(s.TypeKey.TextFormat,1,0),c(s.TypeKey.BodyText,n.Count.infinity,0)):r===s.BitContentLevel.Card&&c(s.TypeKey.CardText,n.Count.infinity,0);for(let o=0;o<l.length;o++){const i=l[o];if(!i)continue;const{type:n,key:c}=i,p=s.TypeKey.fromValue(n);if(!p)continue;let g=p;p!==s.TypeKey.Property&&p!==s.TypeKey.Resource||(g=`${p}:${c}`);const d=u.get(g),y=this.validateSingleTag(e,t,r,i,p,d,a);if(y||l.splice(o,1,null),y&&Array.isArray(y.chain)&&y.chain.length>0)if(d&&d.chain){const r=this.validateTagChainsRecursive(e,t,s.BitContentLevel.Chain,y.chain,d.chain);r&&r.length>0?y.chain=r:y.chain=void 0}else y.type!==s.TypeKey.Resource&&(l.splice(o+1,0,...y.chain),y.chain=void 0)}for(const t of u.values()){const{minCount:r,_seenCount:o}=t;if(null!=r&&o<r){const o=`${this.getTagSignature(t)} is required at least ${r} time(s)`;e.addWarning(o)}}return l.filter((e=>null!=e))}validateSingleTag(e,t,r,o,i,n,a){const{type:l,key:u}=o,c=n?this.getTagSignature(n):this.getUnknownTagSignature(l,u),p=" It will be ignored";let g,d,y="";if(n)switch(n._seenCount++,i){case s.TypeKey.Property:{const{content:i,warning:s}=this.validatePropertyTag(e,r,t,n,o);g=i,d=s;break}case s.TypeKey.Resource:{const{content:i,warning:s}=this.validateResourceTag(e,r,t,n,o);g=i,d=s;break}case s.TypeKey.CardSet:{const{content:r,warning:i}=this.validateCardSet(e,t,n,o,a);g=r,d=i;break}default:{const{content:i,warning:s}=this.validateStandardTag(e,r,t,n,o);g=i,d=s}}else switch(i){case s.TypeKey.Property:d={extraProperty:!0},g=o;break;case s.TypeKey.Resource:d={excessResource:!0},g=o;break;default:d={invalid:!0}}if(d){const t=null==n?void 0:n._previous;d.invalid||d.excessResource?y=`${c} is not valid here.${p}`:null!=d.tooMany?(y=`${c} is included more than ${d.tooMany} time(s).`,d.tooMany>0&&(y+=" The earlier ones will be ignored")):d.extraProperty?y=`${c} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:d.unexpectedCardSet?y=`${c} is not expected here.${p}`:d.unexpectedCardSideVariant&&(y=`${c} has a card / side / variant that is not expected here.${p}`),e.addWarning(y,o,t)}return n&&(n._previous=o),g}validateStandardTag(e,t,r,o,i){const s=null==o.maxCount?1:o.maxCount;return s!==n.Count.infinity&&o._seenCount>s?{warning:{tooMany:s},content:i}:{content:i}}validatePropertyTag(e,t,r,o,i){const s=null==o.maxCount?1:o.maxCount;return s!==n.Count.infinity&&o._seenCount>s?{warning:{tooMany:s},content:i}:{content:i}}validateResourceTag(e,t,r,o,i){const s=null==o.maxCount?1:o.maxCount;return s!==n.Count.infinity&&o._seenCount>s?{warning:{tooMany:s},content:i}:{content:i}}validateCardSet(e,t,r,o,i){if(!i||!i.variants||0===i.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:n}=o,a=n;let l,u=0,c=0;for(const r of a.cards){u=0;for(const o of r.sides){c=0;for(const r of o.variants){const n=r.content;let a;const p=this.getVariantConfig(i.variants,u,c);p?a=this.validateTagChainsRecursive(e,t,s.BitContentLevel.Card,n,p.tags):l={unexpectedCardSideVariant:!0},a&&a.length>0?o.variants[c]={parser:r.parser,content:a}:o.variants[c]={parser:r.parser,content:[]},c++}u++}}return{content:o,warning:l}}checkBodyForCommonPotentialMistakes(e,t,r,o){if(o){for(const t of a)o.includes(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of l)o.startsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of u)o.endsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`)}}convertTagsToTypeKeyMap(e,t,r,o){const n=new Map;for(const e of Object.values(o)){const t={minCount:e.minCount,maxCount:e.maxCount,isTag:e.type===i.BitTagType.tag,isProperty:e.type===i.BitTagType.property,isResource:e.type===i.BitTagType.resource,chain:e.chain,_configKey:e.configKey,_type:e.type,_tag:e.tag,_seenCount:0,_previous:void 0};if(t.isProperty)n.set(`${s.TypeKey.Property}:${e.tag}`,t);else if(t.isResource)n.set(`${s.TypeKey.Resource}:${e.tag}`,t);else{const r=s.TypeKey.fromValue(e.tag);r&&n.set(r,t)}}return n}getVariantConfig(e,t,r){let o;if(0===e.length)return;const i=e[Math.min(t,e.length-1)],s=i.length-1;if(r>s){if(o=i[s],o.repeatCount!==n.Count.infinity)return}else o=i[r];return o}getTagSignature(e){switch(e._type){case i.BitTagType.tag:return`[${e._tag}]`;case i.BitTagType.property:return`[@${e._tag}]`;case i.BitTagType.resource:return`[&${e._tag}]`;default:return`'${e._type}' tag '${e._tag}'`}}getUnknownTagSignature(e,t){switch(e){case s.TypeKey.Property:return`[@${t}]`;case s.TypeKey.Resource:return`[&${t}]`;default:return`'${e}' tag '${t}'`}}};t.BitmarkPegParserValidator=c},7542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PeggyGrammarLocation=void 0;t.PeggyGrammarLocation=class{constructor(e,t){this.source=e,this.start=t}toString(){return String(this.source)}offset(e){return{line:e.line+this.start.line-1,column:1===e.line?e.column+this.start.column-1:e.column,offset:e.offset+this.start.offset}}static offsetStart(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.start):e.start}static offsetEnd(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.end):e.end}}},4185:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bookChainContentProcessor=void 0;const o=r(3633),i=r(6831);t.bookChainContentProcessor=function(e,t,r,n,s,a){if(r===i.BitContentLevel.Chain);else{const r=function(e,t,r,n,s){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",s);const a=e.bitContentProcessor(t,i.BitContentLevel.Chain,n,s.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",a);const{reference:l,referenceEnd:u}=a,c=o.StringUtils.trimmedString(s.value);return{book:c,reference:l,referenceEnd:u}}(e,t,0,n,s);a.book=r.book,a.reference=r.reference,a.referenceEnd=r.referenceEnd}}},1182:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.buildCards=void 0;const i=r(9046),n=r(2606),s=r(2574),a=r(208),l=r(9779),u=r(8386),c=r(6831),p=new i.Builder;t.buildCards=function(e,t,r,i,g,d,y){var f;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let h={};const m=function(e,t,r){const o={cards:[],comments:[]};if(!r)return o;let i=0,s=0,a=0;for(const l of r.cards){const r={no:i++,sides:[]};o.cards.push(r);for(const i of l.sides){const l={no:s++,variants:[]};r.sides.push(l);for(const p of i.variants){const{parser:i,content:g}=p,d={parser:i,no:a++};l.variants.push(d);const y=n.Config.getTagsConfigForCardSet(t,s,a),f=e.bitContentProcessor(t,c.BitContentLevel.Card,y,g);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",f),f.cardBody=u.BitmarkPegParserValidator.checkCardBody(e,t,c.BitContentLevel.Card,f.cardBody,r.no,l.no,d.no),d.data=f,f.comments&&o.comments.push(...f.comments)}a=0}s=0}return o}(e,t,r);switch(null===(f=n.Config.getBitConfig(t).cardSet)||void 0===f?void 0:f.configKey){case s.CardSetConfigKey._flashcards:h=function(e,t,r){const i=[];let n,s,l="",u=[],c=0,g=0,d={};const y=t.alias===a.AliasBitType.flashcard1;for(const a of r.cards){l="",n=void 0,u=[],g=0,d={};for(const e of a.sides)for(const t of e.variants){const e=t.data,{cardBody:r}=e,i=o(e,["cardBody"]);d=Object.assign(Object.assign({},d),i),0===g?(s=t,l=null!=r?r:""):1===g?n=null!=r?r:"":u.push(null!=r?r:""),g++}if(0!==c&&y){e.addWarning(`Bit '${t.alias}' should only contain one card. Ignore subsequent card: '${l}'`,s);break}i.push(p.flashcard(Object.assign({question:l,answer:n,alternativeAnswers:u.length>0?u:void 0},d))),c++}return{flashcards:i.length>0?i:void 0}}(e,t,m);break;case s.CardSetConfigKey._elements:h=function(e,t,r){var o;const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;i.push(null!==(o=t.cardBody)&&void 0!==o?o:"")}return{elements:i.length>0?i:void 0}}(0,0,m);break;case s.CardSetConfigKey._statements:h=function(e,t,r,i,n){const s=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{statements:r}=t,i=o(t,["statements"]);if(Array.isArray(r))for(const e of r){const t=p.statement(Object.assign(Object.assign(Object.assign({},e),e.itemLead),i));s.push(t)}}i&&s.push(i);Array.isArray(n)&&n.length>0&&s.push(...n);return{statements:s.length>0?s:void 0}}(0,0,m,i,g);break;case s.CardSetConfigKey._quiz:h=function(e,t,r,i,n){const s=[],l=t.root===a.RootBitType.multipleChoice,u=t.root===a.RootBitType.multipleResponse;if(!l&&!u)return{};let c,g=!1;for(const e of r.cards){g=!1,c="";for(const t of e.sides)for(const e of t.variants){const t=e.data,{isDefaultExample:r,example:i}=t,n=o(t,["isDefaultExample","example"]);if(g=!0===r||g,c=i||c,n.trueFalse&&n.trueFalse.length>0){const e=[],t=u?p.response:p.choice;for(const r of n.trueFalse){const{isDefaultExample:i,example:n}=r,s=o(r,["isDefaultExample","example"]),a=i||g,l=n||c,u=t(Object.assign(Object.assign({},s),{isDefaultExample:a,example:l}));e.push(u)}u?n.responses=e:n.choices=e}const a=p.quiz(Object.assign(Object.assign({},n),{isDefaultExample:g,example:c}));s.push(a)}}if(l&&Array.isArray(i)&&i.length>0){const e=p.quiz({choices:i});s.push(e)}if(u&&Array.isArray(n)&&n.length>0){const e=p.quiz({responses:n});s.push(e)}return{quizzes:s.length>0?s:void 0}}(0,t,m,d,y);break;case s.CardSetConfigKey._questions:h=function(e,t,r){var o;const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=p.question(Object.assign({question:null!==(o=t.cardBody)&&void 0!==o?o:""},t));i.push(r)}return{questions:i.length>0?i:void 0}}(0,0,m);break;case s.CardSetConfigKey._matchPairs:h=function(e,t,r){let i,n=0;const s=[];let a;const u=[];let c,g,d,y,f,h=[],m={},T=!1,b=!1;for(const e of r.cards){a=void 0,c=void 0,h=[],g=void 0,d=void 0,n=0,m={},b=!1,f="";for(const t of e.sides){for(const e of t.variants){const t=e.data,{cardBody:r,title:i,resources:s,isDefaultExample:p,example:v}=t,C=o(t,["cardBody","title","resources","isDefaultExample","example"]);b=!0===p||b,f=v||f;const x=i&&i[1];if(0===n)if(null!=x)a=x,T=!0===p||T,y=v||y;else if(Array.isArray(s)&&s.length>0){const e=s[0];e.type===l.ResourceTag.audio?g=e:e.type===l.ResourceTag.image&&(d=e)}else c=r;else if(null!=x)u.push(x),T=!0===p||T,y=v||y;else if(null==i){const e=null!=r?r:"";h.push(e),!T&&!b||f||(f=e)}m=Object.assign(Object.assign(Object.assign({},m),C),{isCaseSensitive:!0})}n++}if(null!=a)i=p.heading({forKeys:a,forValues:u});else{b&&(y=void 0);const e=b||T,t=f||y,r=p.pair(Object.assign(Object.assign({key:null!=c?c:"",keyAudio:g,keyImage:d,values:h,isShortAnswer:!0},m),{isDefaultExample:e,example:t}));s.push(r)}}return{heading:i,pairs:s.length>0?s:void 0}}(0,0,m);break;case s.CardSetConfigKey._matchMatrix:h=function(e,t,r){let i,n,s=0;const a=[];let l;const u=[];let c,g,d,y=[],f=[],h={},m=!1,T=!1,b=!1;for(const e of r.cards){n=void 0,l=void 0,y=[],f=[],s=0,T=!1,g="";for(const t of e.sides){f=[],h={},b=!1,d="";for(const e of t.variants){const t=e.data,{title:r,cardBody:i,isDefaultExample:u,example:p}=t,y=o(t,["title","cardBody","isDefaultExample","example"]);b=!0===u||b,d=p||d,Object.assign(h,y);const v=r&&r[1];if(0===s)null!=v?(n=v,m=!0===u||m,c=p||c):(l=i,T=!0===u||T,g=p||g);else if(null!=v)a.push(v),m=!0===u||m,c=p||c;else if(null==t.title){const e=null!=i?i:"";f.push(e),!m&&!b||d||(d=e)}}if(s>0){b&&(g=c=void 0),T&&(c=void 0);const e=b||T||m,t=d||g||c,r=p.matrixCell(Object.assign(Object.assign({values:f},h),{isDefaultExample:e,example:t}));y.push(r)}s++}if(null!=n)i=p.heading({forKeys:n,forValues:a});else{const e=p.matrix({key:null!=l?l:"",cells:y,isShortAnswer:!0,isCaseSensitive:!0});u.push(e)}}return{heading:i,matrix:u.length>0?u:void 0}}(0,0,m);break;case s.CardSetConfigKey._botActionResponses:h=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{instruction:r,reaction:n,cardBody:s}=t,a=o(t,["instruction","reaction","cardBody"]),l=p.botResponse(Object.assign({response:null!=r?r:"",reaction:null!=n?n:"",feedback:null!=s?s:""},a));i.push(l)}return{botResponses:i.length>0?i:void 0}}(0,0,m)}return h.comments=m.comments.length>0?m.comments:void 0,h}},4471:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clozeTagContentProcessor=void 0;const o=r(3633);t.clozeTagContentProcessor=function(e,t,r,i,n,s){const{value:a}=n,l=s.solutions;if(l&&o.StringUtils.isString(a)){const e=o.StringUtils.trimmedString(a);l.push(e)}}},6934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commentTagContentProcessor=void 0;const o=r(9046),i=r(3633),n=new o.Builder;t.commentTagContentProcessor=function(e,t,r,o,s,a){if(!a.comments)return;const{value:l}=s,u=i.StringUtils.isString(l)?l:"",c=n.comment({text:u,location:s.parser.location});a.comments.push(c)}},8081:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTagContentProcessor=void 0;const o=r(3633),i=r(6831);t.defaultTagContentProcessor=function(e,t,r,n,s,a){const{type:l,value:u}=s,c=o.StringUtils.trimmedString(u);switch(l){case i.TypeKey.Instruction:a.instruction=c;break;case i.TypeKey.Hint:a.hint=c;break;case i.TypeKey.Anchor:a.anchor=c;break;case i.TypeKey.Reference:a.reference=c;break;case i.TypeKey.SampleSolution:a.sampleSolution=c,e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",s)}}},4787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.exampleTagContentProcessor=void 0;const o=r(208),i=r(672);function n(e,t,r,o,i){!0===o?(i.isDefaultExample=!0,i.example=void 0):i.example=o}t.exampleTagContentProcessor=function(e,t,r,s,a){const{value:l}=s,u=l;switch(t.root){case o.RootBitType.cloze:case o.RootBitType.clozeAndMultipleChoiceText:case o.RootBitType.multipleChoiceText:case o.RootBitType.highlightText:case o.RootBitType.trueFalse:case o.RootBitType.trueFalse1:case o.RootBitType.multipleResponse:case o.RootBitType.multipleResponse1:case o.RootBitType.multipleChoice:case o.RootBitType.multipleChoice1:!function(e,t,r,s,a){var l,u;let c;Array.isArray(a.trueFalse)&&a.trueFalse.length>0&&(c=null!==(l=a.trueFalse[a.trueFalse.length-1])&&void 0!==l?l:void 0);if(c)!0===s?(c.isDefaultExample=!0,c.example=void 0):i.BooleanUtils.isBooleanString(s)?c.example=s:(c.isDefaultExample=!0,c.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r));else if(Array.isArray(a.solutions)&&a.solutions.length>0)a.example=!0===s?null!==(u=a.solutions[a.solutions.length-1])&&void 0!==u?u:void 0:s;else switch(t.root){default:case o.RootBitType.cloze:n(e,t,r,s,a);break;case o.RootBitType.multipleChoiceText:case o.RootBitType.highlightText:case o.RootBitType.trueFalse:case o.RootBitType.trueFalse1:case o.RootBitType.multipleResponse:case o.RootBitType.multipleResponse1:!function(e,t,r,o,n){!0===o?(n.isDefaultExample=!0,n.example=void 0):i.BooleanUtils.isBooleanString(o)?n.example=o:(n.isDefaultExample=!0,n.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r))}(e,0,r,s,a);break;case o.RootBitType.clozeAndMultipleChoiceText:case o.RootBitType.multipleChoice:case o.RootBitType.multipleChoice1:a.isDefaultExample=!0,a.example=void 0,!0!==s&&e.addWarning("At this level, only default [@example] is allowed, using default",r)}}(e,t,s,u,a);break;case o.RootBitType.mark:!function(e,t,r,o,i){i.isDefaultExample=!0,i.example=void 0,!0!==o&&e.addWarning("Only default [@example] is allowed, using default",r)}(e,0,s,u,a);break;default:n(e,t,s,u,a)}}},9577:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.gapChainContentProcessor=void 0;const i=r(9046),n=r(2606),s=r(4471),a=r(6831),l=new i.Builder;t.gapChainContentProcessor=function(e,t,r,i,u,c,p){if(r===a.BitContentLevel.Chain)(0,s.clozeTagContentProcessor)(e,t,r,i,u,c);else{const r=function(e,t,r,i,s){var u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",s);const c=n.Config.getTagConfigForTag(i,s.type),p=[s,...null!==(u=s.chain)&&void 0!==u?u:[]],g=e.bitContentProcessor(t,a.BitContentLevel.Chain,null==c?void 0:c.chain,p);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",g);const{solutions:d}=g,y=o(g,["solutions"]),f=l.gap(Object.assign(Object.assign({solutions:null!=d?d:[]},y),{isCaseSensitive:!0}));return f}(e,t,0,i,u);r&&p.push(r)}}},8664:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.imageSourceChainContentProcessor=void 0;const i=r(9046),n=r(2606),s=r(3633),a=r(6831),l=new i.Builder;t.imageSourceChainContentProcessor=function(e,t,r,i,u,c){r===a.BitContentLevel.Chain?function(e,t,r,o,i,n){const{value:a}=i,l=s.StringUtils.trimmedString(a);n.imageSourceUrl=l}(0,0,0,0,u,c):function(e,t,r,i,s,u){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",s);const{key:c}=s,p=n.Config.getTagConfigForTag(i,c),g=e.bitContentProcessor(t,a.BitContentLevel.Chain,i,[s]),d=e.bitContentProcessor(t,a.BitContentLevel.Chain,null==p?void 0:p.chain,s.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",d);const{imageSourceUrl:y}=g,{mockupId:f}=d,h=o(d,["mockupId"]);y||e.addWarning("[@imageSource] is missing the image url",s);f||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",s);const m=l.imageSource(Object.assign({url:null!=y?y:"",mockupId:null!=f?f:""},h));u.imageSource=m}(e,t,0,i,u,c)}},2786:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemLeadTagContentProcessor=void 0;const o=r(3633);t.itemLeadTagContentProcessor=function(e,t,r,i,n,s,a){const{value:l}=n,u=o.StringUtils.trimmedString(l);a?s.lead=u:s.item=u}},857:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markChainContentProcessor=void 0;const i=r(9046),n=r(2606),s=r(7646),a=r(3298),l=r(6831),u=new i.Builder;t.markChainContentProcessor=function(e,t,r,i,c,p,g){if(r===l.BitContentLevel.Chain)(0,a.markTagContentProcessor)(e,l.BitContentLevel.Chain,t,c,p);else{const r=function(e,t,r,i,a){var c;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",a);const p=n.Config.getTagConfigForTag(i,a.type),g=e.bitContentProcessor(t,l.BitContentLevel.Chain,i,[a]),d=e.bitContentProcessor(t,l.BitContentLevel.Chain,null==p?void 0:p.chain,a.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",d);const{solution:y}=g,{mark:f}=d,h=o(d,["mark"]),m=u.mark(Object.assign({solution:null!=y?y:"",mark:null!==(c=s.ArrayUtils.asSingle(f))&&void 0!==c?c:""},h));return m}(e,t,0,i,c);r&&g.push(r)}}},2595:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markConfigChainContentProcessor=void 0;const i=r(9046),n=r(2606),s=r(3633),a=r(6831),l=new i.Builder;t.markConfigChainContentProcessor=function(e,t,r,i,u,c){var p;const{key:g}=u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",u);const d=c.markConfig;if(!d)return;const y=n.Config.getTagConfigForTag(i,g),f=e.bitContentProcessor(t,a.BitContentLevel.Chain,null==y?void 0:y.chain,u.chain),{mark:h}=f,m=o(f,["mark"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",m);const T=null!==(p=s.StringUtils.trimmedString(u.value))&&void 0!==p?p:"unknown",b=l.markConfig(Object.assign({mark:T,emphasis:"underline"},m));d.push(b)}},3298:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.markTagContentProcessor=void 0;const o=r(3633);t.markTagContentProcessor=function(e,t,r,i,n){const{value:s}=i;o.StringUtils.isString(s)&&(n.solution=s)}},8326:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.partnerChainContentProcessor=void 0;const o=r(9046),i=r(9779),n=r(3633),s=r(6831),a=new o.Builder;t.partnerChainContentProcessor=function(e,t,r,o,l,u){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("partner content",l);const c=e.bitContentProcessor(t,s.BitContentLevel.Chain,o,l.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("partner TAGS",c);const{resources:p}=c,g=n.StringUtils.trimmedString(l.value),d=function(e,t){let r;const o=[];if(t)for(const e of t.reverse())r||i.ResourceTag.image!==e.type?o.push(e):r=e;o.length>0&&(e.parser.excessResources=o,e.addWarning(`${o.length} excess resource(s) present in the [@parter] chain.`));return r}(e,p),y=a.partner({name:g,avatarImage:d});u.partner=y}},3287:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyContentProcessor=void 0;const o=r(2606),i=r(3518),n=r(5486),s=r(672),a=r(994),l=r(3633),u=r(4185),c=r(4787),p=r(8664),g=r(2595),d=r(8326),y=r(6831);t.propertyContentProcessor=function(e,t,r,f,h,m){const{key:T,value:b}=h,v=r===y.BitContentLevel.Chain,C=o.Config.getTagConfigForTag(f,T),x=C?C.configKey:void 0;if(C){if(x===i.PropertyConfigKey.example)return void(0,c.exampleTagContentProcessor)(e,t,r,h,m);if(x===i.PropertyConfigKey.partner)return void(0,d.partnerChainContentProcessor)(e,t,r,C.chain,h,m);if(x===i.PropertyConfigKey.imageSource)return void(0,p.imageSourceChainContentProcessor)(e,t,r,f,h,m);if(x===i.PropertyConfigKey.book)return void(0,u.bookChainContentProcessor)(e,t,r,C.chain,h,m);if(x===i.PropertyConfigKey.markConfig&&!v)return void(0,g.markConfigChainContentProcessor)(e,t,r,f,h,m)}const A=(e,t,r,o)=>{if(r=(e=>{if(null!=e){if(o)switch(o.format){case n.PropertyFormat.string:return l.StringUtils.isString(e)?l.StringUtils.string(e):void 0;case n.PropertyFormat.trimmedString:return l.StringUtils.isString(e)?l.StringUtils.trimmedString(e):void 0;case n.PropertyFormat.number:return a.NumberUtils.asNumber(e);case n.PropertyFormat.boolean:return s.BooleanUtils.toBoolean(e,!0);case n.PropertyFormat.invertedBoolean:return!s.BooleanUtils.toBoolean(e,!0)}return e}})(r),(null==o?void 0:o.astKey)&&(t=o.astKey),null==o?void 0:o.single)e[t]=r;else if(Object.prototype.hasOwnProperty.call(e,t)){const o=e[t];e[t]=[...o,r]}else e[t]=[r]};A(C?m:m.extraProperties,T,b,C)}},3130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.referenceTagContentProcessor=void 0;const o=r(3633);t.referenceTagContentProcessor=function(e,t,r,i,n,s,a){const{value:l}=n,u=o.StringUtils.trimmedString(l);a?s.referenceEnd=u:s.reference=u}},5516:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceContentProcessor=t.buildResources=void 0;const o=r(8703),i=r(2606),n=r(1035),s=r(9779),a=r(6831),l=new o.ResourceBuilder;t.buildResources=function(e,t,r,o){var a,l;const u=[],c=[],p=s.ResourceTag.fromValue(r),g=i.Config.getBitResourcesConfig(t,p),d=g.resourceAttachmentAllowed,y=g.getCountsMin(),f=g.getCountsMax();if(o)for(const e of o.reverse()){let t=null!==(a=y.get(e.typeAlias))&&void 0!==a?a:0,r=null!==(l=f.get(e.typeAlias))&&void 0!==l?l:0;t=Math.max(0,t-1),r===n.Count.infinity?u.unshift(e):r>0?(u.unshift(e),r--):c.unshift(e),y.set(e.typeAlias,t),f.set(e.typeAlias,r)}if(!d&&r){const t=`Resource type [&${r}] is specified in the bit header, but no extra resource is allowed for this bit.`;e.addWarning(t)}else 0===u.length&&r&&e.addWarning(`Resource type [&${r}] is specified in the bit header, but no such a resource is present`);return c.length>0&&(e.parser.excessResources=c),u},t.resourceContentProcessor=function(e,t,r,o,n,u){const{type:c,key:p,value:g,chain:d}=n,y=u.resources;if(!y)return;const f=s.ResourceTag.fromValue(p);if(f){const r=i.Config.getTagConfigForTag(o,p),n=e.bitContentProcessor(t,a.BitContentLevel.Chain,null==r?void 0:r.chain,d),s=l.resource(Object.assign({type:f,value:g},n));s&&y.push(s)}}},1838:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildTitles=t.titleTagContentProcessor=void 0;const o=r(208),i=r(3633);t.titleTagContentProcessor=function(e,t,r,o,n,s){const{value:a}=n,l=s.title;if(!l)return;const u=a,c=i.StringUtils.trimmedString(u.title);l[u.level.length]=c},t.buildTitles=function(e,t,r){var i,n;switch(r=null!=r?r:[],t.root){case o.RootBitType.chapter:{let e;return r.length>0&&(e=r[r.length-1]),{title:e,level:r.length>0?r.length-1:void 0}}case o.RootBitType.book:default:return{title:null!==(i=r[1])&&void 0!==i?i:void 0,subtitle:null!==(n=r[2])&&void 0!==n?n:void 0}}}},4177:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseChainContentProcessor=void 0;const i=r(9046),n=r(208),s=r(8660),a=r(6831),l=new i.Builder;t.trueFalseChainContentProcessor=function(e,t,r,i,u,c,p){r===a.BitContentLevel.Chain?(0,s.trueFalseTagContentProcessor)(e,a.BitContentLevel.Chain,t,u,c):function(e,t,r,i,s,u,c){var p;const g=[s,...null!==(p=s.chain)&&void 0!==p?p:[]],d=u.statements,y=u.choices,f=u.responses;if(!(d&&y&&f&&c))return;if(t.root===n.RootBitType.trueFalse1)u.statement=function(e,t,r,i){if(t.root!==n.RootBitType.trueFalse1)return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",i);const s=e.bitContentProcessor(t,a.BitContentLevel.Chain,r,i),{trueFalse:u}=s,c=o(s,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",c);let p;u&&u.length>0&&(p=l.statement(Object.assign(Object.assign({},u[0]),c)));return p}(e,t,i,g);else if(t.root===n.RootBitType.trueFalse||t.root===n.RootBitType.multipleChoice||t.root===n.RootBitType.multipleChoice1||t.root===n.RootBitType.multipleResponse||t.root===n.RootBitType.multipleResponse1){const r=function(e,t,r,i){const s=t.root===n.RootBitType.trueFalse,u=t.root===n.RootBitType.multipleChoice||t.root===n.RootBitType.multipleChoice1,c=t.root===n.RootBitType.multipleResponse||t.root===n.RootBitType.multipleResponse1;if(!s&&!u&&!c)return{};const p=[],g=[],d=[],y=e.splitBitContent(i,[a.TypeKey.True,a.TypeKey.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",y);for(const i of y){const n=e.bitContentProcessor(t,a.BitContentLevel.Chain,r,i),{trueFalse:y}=n,f=o(n,["trueFalse"]);if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",f),s){if(y&&y.length>0){const e=l.statement(Object.assign(Object.assign({},y[0]),f));p.push(e)}}else if(u){if(y&&y.length>0){const e=l.choice(Object.assign(Object.assign({},y[0]),f));g.push(e)}}else if(c&&y&&y.length>0){const e=l.response(Object.assign(Object.assign({},y[0]),f));d.push(e)}}const f={};s?f.statements=p:u?f.choices=g:c&&(f.responses=d);return f}(e,t,i,g);r.statements&&d.push(...r.statements),r.choices&&y.push(...r.choices),r.responses&&f.push(...r.responses)}else if(t.root===n.RootBitType.highlightText){const r=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",i);const n=e.bitContentProcessor(t,a.BitContentLevel.Chain,r,i),{trueFalse:s}=n,u=o(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",Object.assign({trueFalse:s},u));const c=[];if(s)for(const e of s)c.push(l.highlightText(Object.assign(Object.assign({},e),{isHighlighted:!1})));const p=l.highlight(Object.assign({texts:c},u));return p}(e,t,i,g);r&&c.push(r)}else{const r=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",i);const n=e.bitContentProcessor(t,a.BitContentLevel.Chain,r,i),{trueFalse:s}=n,u=o(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",Object.assign({trueFalse:s},u));const c=[];if(s)for(const e of s)c.push(l.selectOption(e));const p=l.select(Object.assign({options:c},u));return p}(e,t,i,g);r&&c.push(r)}}(e,t,0,i,u,c,p)}},8660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseTagContentProcessor=void 0;const o=r(3633),i=r(6831);t.trueFalseTagContentProcessor=function(e,t,r,n,s){const{type:a,value:l}=n,u=s.trueFalse;if(!u)return;const c=o.StringUtils.trimmedString(l);u.push({text:c,isCorrect:a===i.TypeKey.True,isDefaultExample:!1})}},2434:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonParser=void 0;const o=r(9046),i=r(8703),n=r(2606),s=r(6300),a=r(208),l=r(1060),u=r(9779),c=r(1353),p=r(3633),g=new o.Builder,d=new i.ResourceBuilder;t.JsonParser=class{constructor(){this.textGenerator=new s.TextGenerator}toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t}=e,o=this.bitToAst(t);o&&r.push(o)}const o=r.length>0?{bits:r}:{};return g.bitmark(o)}preprocessJson(e){const t=[];if(p.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const r=e=>{if(this.isBitWrapper(e)){const r=e;t.push(r)}else if(this.isBit(e)){const r=e;t.push(this.bitToBitWrapper(r))}};if(Array.isArray(e))for(const t of e)r(t);else r(e);return t}isBitWrapper(e){if(Object.prototype.hasOwnProperty.call(e,"bit")){const t=e;return this.isBit(t.bit)}return!1}isBit(e){if(Object.prototype.hasOwnProperty.call(e,"type")){const t=e;return n.Config.getBitType(t.type).root!==a.RootBitType._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e){var t;const{type:r,format:o,id:i,externalId:s,spaceId:a,padletId:l,jupyterId:u,jupyterExecutionCount:p,AIGenerated:d,releaseVersion:y,ageRange:f,lang:h,language:m,computerLanguage:T,target:b,tag:v,icon:C,iconTag:x,colorTag:A,flashcardSet:w,subtype:B,bookAlias:k,coverImage:P,publisher:K,publications:S,author:_,date:R,location:I,theme:O,kind:E,action:L,thumbImage:j,focusX:V,focusY:F,duration:G,deeplink:N,externalLink:D,externalLinkText:U,videoCallLink:M,bot:$,list:J,textReference:q,isTracked:H,isInfoOnly:z,labelTrue:W,labelFalse:Y,content2Buy:X,quotedPerson:Z,reasonableNumOfChars:Q,maxCreatedBits:ee,book:te,title:re,subtitle:oe,level:ie,toc:ne,progress:se,anchor:ae,reference:le,referenceEnd:ue,item:ce,lead:pe,hint:ge,instruction:de,example:ye,imageSource:fe,partner:he,marks:me,resource:Te,body:be,sampleSolution:ve,elements:Ce,statement:xe,isCorrect:Ae,cards:we,statements:Be,responses:ke,quizzes:Pe,heading:Ke,pairs:Se,matrix:_e,choices:Re,questions:Ie,footer:Oe,placeholders:Ee}=e,Le=n.Config.getBitType(r),je=null!==(t=c.TextFormat.fromValue(o))&&void 0!==t?t:c.TextFormat.bitmarkMinusMinus,Ve=this.getResourceType(Te),Fe=this.resourceBitToAst(Te),Ge=this.bodyToAst(be,je,Ee),Ne=this.imageSourceBitToAst(fe),De=this.partnerBitToAst(he),Ue=this.markConfigBitToAst(me),Me=this.flashcardBitsToAst(we),$e=this.statementBitsToAst(xe,Ae,Be,ye),Je=this.responseBitsToAst(Le,ke),qe=this.quizBitsToAst(Le,Pe),He=this.headingBitToAst(Ke),ze=this.pairBitsToAst(Se),We=this.matrixBitsToAst(_e),Ye=this.choiceBitsToAst(Re),Xe=this.questionBitsToAst(Ie),Ze=this.botResponseBitsToAst(Le,ke),Qe=this.footerToAst(Oe,je),{reference:et,referenceProperty:tt}=this.referenceToAst(le);return g.bit(Object.assign(Object.assign(Object.assign({bitType:Le,textFormat:o,resourceType:Ve,id:i,externalId:s,spaceId:a,padletId:l,jupyterId:u,jupyterExecutionCount:p,aiGenerated:d,releaseVersion:y,ageRange:f,lang:h,language:m,computerLanguage:T,target:b,tag:v,icon:C,iconTag:x,colorTag:A,flashcardSet:w,subtype:B,bookAlias:k,coverImage:P,publisher:K,publications:S,author:_,date:R,location:I,theme:O,kind:E,action:L,duration:G,referenceProperty:tt,thumbImage:j,focusX:V,focusY:F,deeplink:N,externalLink:D,externalLinkText:U,videoCallLink:M,bot:$,list:J,textReference:q,isTracked:H,isInfoOnly:z,labelTrue:W,labelFalse:Y,content2Buy:X,quotedPerson:Z,reasonableNumOfChars:Q,maxCreatedBits:ee,book:te,title:this.parseText(re),subtitle:this.parseText(oe),level:ie,toc:ne,progress:se,anchor:ae,reference:et,referenceEnd:ue},this.parseItemLeadHintInstruction(ce,pe,ge,de)),this.parseExample(ye)),{imageSource:Ne,partner:De,markConfig:Ue,resources:Fe,body:Ge,sampleSolution:ve,elements:Ce,flashcards:Me,statements:$e,responses:Je,quizzes:qe,heading:He,pairs:ze,matrix:We,choices:Ye,questions:Xe,botResponses:Ze,footer:Qe}))}imageSourceBitToAst(e){let t;if(e){const{url:r,mockupId:o,format:i,size:n,trim:s}=e;t=g.imageSource({url:r,mockupId:o,format:i,size:n,trim:s})}return t}partnerBitToAst(e){let t;if(e){const r=this.resourceDataToAst(u.ResourceTag.image,e.avatarImage);t=g.partner({name:e.name,avatarImage:r})}return t}markConfigBitToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{mark:e,color:o,emphasis:i}=r,n=g.markConfig({mark:e,color:o,emphasis:i});t.push(n)}if(0!==t.length)return t}flashcardBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{question:e,answer:o,alternativeAnswers:i,item:n,lead:s,hint:a,instruction:l,example:u}=r,c=g.flashcard(Object.assign(Object.assign({question:e,answer:o,alternativeAnswers:i},this.parseItemLeadHintInstruction(n,s,a,l)),this.parseExample(u)));t.push(c)}if(0!==t.length)return t}statementBitsToAst(e,t,r,o){const i=[];if(e){const r=g.statement(Object.assign({text:e,isCorrect:null!=t&&t},this.parseExample(o)));i.push(r)}if(Array.isArray(r))for(const e of r){const{statement:t,isCorrect:r,item:o,lead:n,hint:s,instruction:a,example:l,isCaseSensitive:u}=e,c=g.statement(Object.assign(Object.assign(Object.assign({text:t,isCorrect:r},this.parseItemLeadHintInstruction(o,n,s,a)),this.parseExample(l)),{isCaseSensitive:u}));i.push(c)}if(0!==i.length)return i}choiceBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{choice:e,isCorrect:o,item:i,lead:n,hint:s,instruction:a,example:l,isCaseSensitive:u}=r,c=g.choice(Object.assign(Object.assign(Object.assign({text:e,isCorrect:o},this.parseItemLeadHintInstruction(i,n,s,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}if(0!==t.length)return t}responseBitsToAst(e,t){const r=[];if(e.root!==a.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,isCorrect:o,item:i,lead:n,hint:s,instruction:a,example:l,isCaseSensitive:u}=e,c=g.response(Object.assign(Object.assign(Object.assign({text:t,isCorrect:o},this.parseItemLeadHintInstruction(i,n,s,a)),this.parseExample(l)),{isCaseSensitive:u}));r.push(c)}if(0!==r.length)return r}}selectOptionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:o,item:i,lead:n,hint:s,instruction:a,example:l,isCaseSensitive:u}=r,c=g.selectOption(Object.assign(Object.assign(Object.assign({text:e,isCorrect:o},this.parseItemLeadHintInstruction(i,n,s,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}return t}highlightTextBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:o,isHighlighted:i,item:n,lead:s,hint:a,instruction:l,example:u,isCaseSensitive:c}=r,p=g.highlightText(Object.assign(Object.assign(Object.assign({text:e,isCorrect:o,isHighlighted:i},this.parseItemLeadHintInstruction(n,s,a,l)),this.parseExample(u)),{isCaseSensitive:c}));t.push(p)}return t}quizBitsToAst(e,t){const r=[];if(Array.isArray(t))for(const o of t){const{item:t,lead:i,hint:n,instruction:s,choices:a,responses:l}=o,u=this.choiceBitsToAst(a),c=this.responseBitsToAst(e,l),p=g.quiz(Object.assign(Object.assign({},this.parseItemLeadHintInstruction(t,i,n,s)),{choices:u,responses:c}));r.push(p)}if(0!==r.length)return r}headingBitToAst(e){let t;return e&&(t=g.heading({forKeys:e.forKeys,forValues:e.forValues})),t}pairBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{key:e,keyAudio:o,keyImage:i,values:n,item:s,lead:a,hint:l,instruction:c,example:p,isCaseSensitive:d,isLongAnswer:y}=r,f=this.resourceDataToAst(u.ResourceTag.audio,o),h=this.resourceDataToAst(u.ResourceTag.image,i),m=g.pair(Object.assign(Object.assign(Object.assign({key:e,keyAudio:f,keyImage:h,values:n},this.parseItemLeadHintInstruction(s,a,l,c)),this.parseExample(p)),{isCaseSensitive:d,isShortAnswer:!y}));t.push(m)}if(0!==t.length)return t}matrixBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{key:e,cells:i,item:n,lead:s,hint:a,instruction:l,example:u,isCaseSensitive:c,isLongAnswer:p}=o,d=g.matrix(Object.assign(Object.assign(Object.assign({key:e,cells:null!==(t=this.matrixCellsToAst(i))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(n,s,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:!p}));r.push(d)}if(0!==r.length)return r}matrixCellsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{values:e,item:o,lead:i,hint:n,instruction:s,example:a}=r,l=g.matrixCell(Object.assign(Object.assign({values:e},this.parseItemLeadHintInstruction(o,i,n,s)),this.parseExample(a)));t.push(l)}if(0!==t.length)return t}questionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{question:e,partialAnswer:o,sampleSolution:i,item:n,lead:s,hint:a,instruction:l,example:u,isCaseSensitive:c,isShortAnswer:p,reasonableNumOfChars:d}=r,y=g.question(Object.assign(Object.assign(Object.assign({question:e,partialAnswer:o,sampleSolution:i},this.parseItemLeadHintInstruction(n,s,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:p,reasonableNumOfChars:d}));t.push(y)}if(0!==t.length)return t}botResponseBitsToAst(e,t){const r=[];if(e.root===a.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,reaction:o,feedback:i,item:n,lead:s,hint:a}=e,l=g.botResponse({response:t,reaction:o,feedback:i,item:this.parseText(n),lead:this.parseText(s),hint:this.parseText(a)});r.push(l)}if(0!==r.length)return r}}getResourceType(e){if(e){return u.ResourceTag.fromValue(e.type)}}resourceBitToAst(e){var t;const r=[];if(e){const o=null!==(t=u.ResourceTag.keyFromValue(e.type))&&void 0!==t?t:u.ResourceTag.unknown;let i;if(e.type===u.ResourceTag.imageResponsive){const t=e,o=this.resourceDataToAst(u.ResourceTag.imagePortrait,t.imagePortrait),i=this.resourceDataToAst(u.ResourceTag.imageLandscape,t.imageLandscape);o&&r.push(o),i&&r.push(i)}else if(e.type===u.ResourceTag.stillImageFilm){const t=e,o=this.resourceDataToAst(u.ResourceTag.image,t.image),i=this.resourceDataToAst(u.ResourceTag.audio,t.audio);o&&r.push(o),i&&r.push(i)}else{if(i=e[o],!i)return;const t=this.resourceDataToAst(e.type,i);t&&r.push(t)}}return r}resourceDataToAst(e,t){var r,o;let i;if(t){if(!t)return;const n=p.StringUtils.isString(t)?t:void 0,s=t.url||t.src||t.href||t.app||t.body||n,a=this.resourceDataToAst(u.ResourceTag.image,t.posterImage),l=t.thumbnails?t.thumbnails.map((e=>this.resourceDataToAst(u.ResourceTag.image,e))):void 0;i=d.resource({type:e,value:s,format:t.format,src1x:t.src1x,src2x:t.src2x,src3x:t.src3x,src4x:t.src4x,caption:this.parseText(t.caption),width:null!==(r=t.width)&&void 0!==r?r:void 0,height:null!==(o=t.height)&&void 0!==o?o:void 0,alt:t.alt,duration:t.duration,mute:t.mute,autoplay:t.autoplay,allowSubtitles:t.allowSubtitles,showSubtitles:t.showSubtitles,posterImage:a,thumbnails:l,siteName:t.siteName,license:t.license,copyright:t.copyright,showInIndex:t.showInIndex})}return i}bodyToAst(e,t,r){let o,i;const n={};if(Array.isArray(e)?(i=this.parseText(e,t),r=this.textGenerator.getPlaceholders()):i=e,r)for(const[e,t]of Object.entries(r)){const r=this.bodyBitToAst(t);n[e]=r}if(i){const e=[],t=p.StringUtils.splitPlaceholders(i,Object.keys(n));for(let r=0,o=t.length;r<o;r++){const o=t[r];if(n[o])e.push(n[o]);else{const t=this.bodyTextToAst(o);e.push(t)}}o=g.body({bodyParts:e})}return o}bodyTextToAst(e){return g.bodyText({text:e})}bodyBitToAst(e){switch(e.type){case l.BodyBitType.gap:return this.gapBitToAst(e);case l.BodyBitType.mark:return this.markBitToAst(e);case l.BodyBitType.select:return this.selectBitToAst(e);case l.BodyBitType.highlight:return this.highlightBitToAst(e)}return this.bodyTextToAst("")}footerToAst(e,t){const r=this.parseText(e,t);if(r)return g.footerText({text:r})}referenceToAst(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}gapBitToAst(e){const{item:t,lead:r,hint:o,instruction:i,example:n,isCaseSensitive:s,solutions:a}=e;return g.gap(Object.assign(Object.assign(Object.assign({solutions:a},this.parseItemLeadHintInstruction(t,r,o,i)),this.parseExample(n)),{isCaseSensitive:s}))}markBitToAst(e){const{solution:t,mark:r,item:o,lead:i,hint:n,instruction:s,example:a}=e;return g.mark(Object.assign(Object.assign({solution:t,mark:r},this.parseItemLeadHintInstruction(o,i,n,s)),this.parseExample(a)))}selectBitToAst(e){const{options:t,prefix:r,postfix:o,item:i,lead:n,hint:s,instruction:a,example:l}=e,u=this.selectOptionBitsToAst(t);return g.select(Object.assign(Object.assign(Object.assign({options:u,prefix:r,postfix:o},this.parseItemLeadHintInstruction(i,n,s,a)),this.parseExample(l)),{isCaseSensitive:!0}))}highlightBitToAst(e){const{texts:t,prefix:r,postfix:o,item:i,lead:n,hint:s,instruction:a,example:l}=e,u=this.highlightTextBitsToAst(t);return g.highlight(Object.assign(Object.assign(Object.assign({texts:u,prefix:r,postfix:o},this.parseItemLeadHintInstruction(i,n,s,a)),this.parseExample(l)),{isCaseSensitive:!0}))}parseItemLeadHintInstruction(e,t,r,o){return{item:this.parseText(e),lead:this.parseText(t),hint:this.parseText(r),instruction:this.parseText(o)}}parseExample(e){if(null==e)return;const t=this.parseText(e);return t?{example:t}:{example:!!e}}parseText(e,t){if(null!=e){if(Array.isArray(e)){return this.textGenerator.generateSync(e,t)}return e}}}},406:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextParser=void 0;const o=r(1353),i=r(3633),n=r(8436);t.TextParser=class{preprocessAst(e){if(i.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){if(Array.isArray(e)){if(0===e.length)return!0;if(Object.prototype.hasOwnProperty.call(e[0],"type"))return!0}return!1}toAst(e,t){if(Array.isArray(e))return e;const r=e,i=Object.assign({},t);i.textFormat||(i.textFormat=o.TextFormat.bitmarkMinusMinus);const s=i.textFormat===o.TextFormat.bitmarkPlusPlus?"bitmarkPlusPlus":"bitmarkMinusMinus";return(0,n.parse)(null!=r?r:"",{startRule:s})}}},8436:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const o=r(4764).parse;t.parse=o},7646:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayUtils=void 0;const r=new class{asArray(e){if(null!=e)return Array.isArray(e)?e:[e]}asSingle(e,t){if(null!=e)return Array.isArray(e)?e.length>0?t?e[e.length-1]:e[0]:void 0:e}};t.ArrayUtils=r},4598:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitUtils=void 0;const o=r(672);const i=new class{fillStringExample(e,t,r,o){if(e){Array.isArray(e)||(e=[e]);for(const i of e)if(!i.isExample&&(t?(i.isDefaultExample=!0,i.isExample=!0):(i.isDefaultExample=!1,i.example=r),o))break}}fillBooleanExample(e,t,r,i){if(e){Array.isArray(e)||(e=[e]);for(const n of e)if(!n.isExample&&(!i||n.isCorrect)&&(t?(n.isDefaultExample=!0,n.isExample=!0):(n.isDefaultExample=!1,n.example=o.BooleanUtils.toBoolean(r)),i))break}}};t.BitUtils=i},672:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanUtils=void 0;const r=new class{isBoolean(e){return!0===e||!1===e}isBooleanString(e){return!!this.isBoolean(e)||("true"===e||"false"===e)}toBoolean(e,t){return t?!1!==e&&"false"!==e:!0===e||"true"===e}};t.BooleanUtils=r},994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NumberUtils=void 0;const r=new class{asNumber(e,t){if(null==e)return null!=t?t:void 0;const r=+e;return Number.isNaN(r)?null!=t?t:void 0:r}};t.NumberUtils=r},3589:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUtils=void 0;const r=new class{isFunction(e){return"[object Function]"===Object.prototype.toString.call(e)}isArray(e){return Array.isArray(e)}isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}orderProperties(e,t){const r=e,o=Object.assign({},r);for(const e of Object.keys(r))delete r[e];for(const e of t)Object.prototype.hasOwnProperty.call(o,e)&&(r[e]=o[e])}removeUndefinedProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||null==o&&delete r[e]}removeFalseProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||!1===o&&delete r[e]}removeEmptyStringProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||""===o&&delete r[e]}removeEmptyArrayProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||Array.isArray(o)&&0===o.length&&delete r[e]}removeEmptyObjectProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||this.isObject(o)&&0===Object.keys(o).length&&delete r[e]}removeUnwantedProperties(e,t){(t=Object.assign({},t)).ignoreAllUndefined||this.removeUndefinedProperties(e,t.ignoreUndefined),t.ignoreAllFalse||this.removeFalseProperties(e,t.ignoreFalse),t.ignoreAllEmptyString||this.removeEmptyStringProperties(e,t.ignoreEmptyString),t.ignoreAllEmptyArrays||this.removeEmptyArrayProperties(e,t.ignoreEmptyArrays),t.ignoreAllEmptyObjects||this.removeEmptyObjectProperties(e,t.ignoreEmptyObjects)}extractSingleValue(e,t){if(!e)return;const r=e;if(null==r[t])return;let o=r[t];if(Array.isArray(o)){if(0===o.length)return;o=o[o.length-1]}return o}};t.ObjectUtils=r},3633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtils=void 0;const r=new class{isString(e){return"string"==typeof e||e instanceof String}string(e){return e?`${e}`:""}trimmedString(e){return this.string(e).trim()}splitPlaceholders(e,t){let r=[e];const o=(e,t)=>{const r=[];for(const o of e){const e=o.split(t);for(let o=0,i=e.length;o<i;o++){const n=e[o],s=o===i-1;r.push(n),s||r.push(t)}}return r};for(const e of t)r=o(r,e);return r}firstLine(e,t){const r=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return r;const o=e.split("\n");return o.length>0?o[0].substring(0,t):r}wordWrap(e,t){const r=[];if(t<1||null==e||e.length<=t)return r;const o=e.length,i=o-t;let n,s=0;for(;s<i;){let o;const i=s+t,a=e.indexOf("\n",s);if(a>-1&&a>s&&a<i){o=a-s,n=e.substr(s,o),s=s+o+1,r.push(n);continue}const l=e.lastIndexOf(" ",i);let u=0;l>-1&&l!=s-1?(o=l-s,o>0&&(u=s+o+1)):(o=t,u=s+t),n=e.substr(s,o),s=u,r.push(n.trim())}return s<o&&(n=e.substr(s),r.push(n)),r}};t.StringUtils=r},169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtils=void 0;const r=new class{fileExtensionFromUrl(e){let t;if(e)try{const r=new URL(e).pathname.split(".");r.length>1&&(t=r[r.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}};t.UrlUtils=r},671:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initEnv=t.env=void 0;const o=r(2164),i=r(7619),n=r(306),s=r(9870);const a=new class{constructor(){Object.defineProperty(this,"userAgentInfo",{value:(0,s.parseUserAgent)(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=n.EMPTY_VERSION,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===o.Environment.node,this.isCI=this.getIsCI(),this.NODE_ENV=this.getNodeEnv(),this.os=this.getOs(),this.osVersion=this.getOsVersion()}init(e,t){this.app=e,this.appVersion=this.parseMMBVersion(t)}get upTimestamp(){return Date.now()-this.bootTimestamp}getEnvironment(){return this.userAgentInfo?this.userAgentInfo.browser:"undefined"!=typeof process&&void 0!==process.versions&&process.versions.node?o.Environment.node:o.Environment.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):n.EMPTY_VERSION}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,i.Os.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):n.EMPTY_VERSION}getIsBrowser(){return!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof navigator||!navigator.userAgent)}getIsCI(){return!("undefined"==typeof process||!process.env||!process.env.CI)}getNodeEnv(){return"undefined"!=typeof process&&process.env?"production":""}parseMMBVersion(e){if(!e)return n.EMPTY_VERSION;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",o="",i="",s="";for(let e=0,n=t.length;e<n;e++){const n=t[e];0===e?r=n:1===e?o=n:2===e?s=n:3===e&&(i=n)}return{full:e,major:r,minor:o,patch:s,build:i}}};t.env=a;const l=a.init.bind(a);t.initEnv=l},2164:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;const o=(0,r(6688).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"});t.Environment=o},7619:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Os=void 0;const o=(0,r(6688).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});t.Os=o},306:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_VERSION=void 0;t.EMPTY_VERSION={full:"",major:"",minor:"",patch:"",build:""}},9870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUserAgent=void 0;const o=r(2164),i=r(7619);t.parseUserAgent=function(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:o.Environment.unknown,os:i.Os.unknown},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce(((e,t)=>(t&&e.push(t),e)),[]),r={keys:new Set,versions:{}};let o="";for(let e=0,i=t.length;e<i;e++){const i=t[e];let n=!1;for(let e=0;e<=9;e++)if(i.startsWith(`${e}`)){n=!0;break}n?r.versions[o]=i.replace("_","."):r.keys.add(i),o=i}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),n=t.keys.has("chrome"),s=t.keys.has("chromium"),a=t.keys.has("safari"),l=n,u=r,c=t.keys.has("macintosh");return a&&!n&&!s?(e.browser=o.Environment.safari,e.browserVersion=t.versions.version):l?(e.browser=o.Environment.chrome,e.browserVersion=t.versions.chrome):u&&(e.browser=o.Environment.firefox,e.browserVersion=t.versions.firefox),c&&(e.os=i.Os.macos,e.osVersion=t.versions.x),e}}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o].call(n.exports,n,n.exports,r),n.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.StreamWriter=e.FileWriter=e.BitmarkFileGenerator=e.JsonFileGenerator=e.InfoFormat=e.InfoType=e.CardSetVersion=e.BitmarkVersion=e.BitmarkParserType=e.NodeType=e.ResourceTag=e.TextFormat=e.AliasBitType=e.RootBitType=e.StringWriter=e.BitmarkStringGenerator=e.BitmarkGenerator=e.BitmarkParser=e.JsonStringGenerator=e.JsonGenerator=e.JsonParser=e.Ast=e.ResourceBuilder=e.Builder=e.Output=e.BitmarkParserGenerator=void 0;const t=r(7087);var i=r(390);Object.defineProperty(e,"BitmarkParserGenerator",{enumerable:!0,get:function(){return i.BitmarkParserGenerator}}),Object.defineProperty(e,"Output",{enumerable:!0,get:function(){return i.Output}});var n=r(9046);Object.defineProperty(e,"Builder",{enumerable:!0,get:function(){return n.Builder}});var s=r(8703);Object.defineProperty(e,"ResourceBuilder",{enumerable:!0,get:function(){return s.ResourceBuilder}});var a=r(8256);Object.defineProperty(e,"Ast",{enumerable:!0,get:function(){return a.Ast}});var l=r(2434);Object.defineProperty(e,"JsonParser",{enumerable:!0,get:function(){return l.JsonParser}});var u=r(3857);Object.defineProperty(e,"JsonGenerator",{enumerable:!0,get:function(){return u.JsonGenerator}});var c=r(5132);Object.defineProperty(e,"JsonStringGenerator",{enumerable:!0,get:function(){return c.JsonStringGenerator}});var p=r(9556);Object.defineProperty(e,"BitmarkParser",{enumerable:!0,get:function(){return p.BitmarkParser}});var g=r(297);Object.defineProperty(e,"BitmarkGenerator",{enumerable:!0,get:function(){return g.BitmarkGenerator}});var d=r(8582);Object.defineProperty(e,"BitmarkStringGenerator",{enumerable:!0,get:function(){return d.BitmarkStringGenerator}});var y=r(227);Object.defineProperty(e,"StringWriter",{enumerable:!0,get:function(){return y.StringWriter}});var f=r(208);Object.defineProperty(e,"RootBitType",{enumerable:!0,get:function(){return f.RootBitType}}),Object.defineProperty(e,"AliasBitType",{enumerable:!0,get:function(){return f.AliasBitType}});var h=r(1353);Object.defineProperty(e,"TextFormat",{enumerable:!0,get:function(){return h.TextFormat}});var m=r(9779);Object.defineProperty(e,"ResourceTag",{enumerable:!0,get:function(){return m.ResourceTag}});var T=r(549);Object.defineProperty(e,"NodeType",{enumerable:!0,get:function(){return T.NodeType}});var b=r(6958);Object.defineProperty(e,"BitmarkParserType",{enumerable:!0,get:function(){return b.BitmarkParserType}});var v=r(8791);Object.defineProperty(e,"BitmarkVersion",{enumerable:!0,get:function(){return v.BitmarkVersion}});var C=r(8565);Object.defineProperty(e,"CardSetVersion",{enumerable:!0,get:function(){return C.CardSetVersion}});var x=r(7347);Object.defineProperty(e,"InfoType",{enumerable:!0,get:function(){return x.InfoType}});var A=r(8681);Object.defineProperty(e,"InfoFormat",{enumerable:!0,get:function(){return A.InfoFormat}});(0,t.init)()})(),o})()));